(* Logging functions, they print to stderr and consider the verbosity flag *) val prt_line : string -> unit val prt_node : Ast.node -> unit val log_line : int -> string -> unit val log_node : int -> Ast.node -> unit val dbg_line : string -> unit val dbg_node : Ast.node -> unit (* Generate a fresh variable from a given prefix, e.g. "foo" -> "foo$1" *) val fresh_var : string -> string (* Generate a fresg constant from a given prefix, e.g. "foo" -> "foo$$1" *) val fresh_const : string -> string (* Generate an Ast.location tuple from Lexing data structures *) val loc_from_lexpos : Lexing.position -> Lexing.position -> Ast.location (* Default transformation traversal for AST nodes *) val transform_children : (Ast.node -> Ast.node) -> Ast.node -> Ast.node (*val visit_children : (Ast.node -> unit) -> Ast.node -> unit*) (* Extract annotation from node *) val annof : Ast.node -> Ast.annotation list val locof : Ast.node -> Ast.location val depthof : Ast.node -> int val typeof : Ast.node -> Ast.ctype (* Print file location to stderr *) val prerr_loc : Ast.location -> unit (* Print file location to stderr *) val prerr_loc_msg : Ast.location -> string -> int -> unit (* Flatten Block nodes into the given array of nodes *) val flatten_blocks : Ast.node list -> Ast.node list (* Extract the node list from a Block node *) val block_body : Ast.node -> Ast.node list (* Get the size of a list by traversing it recurcively *) val list_size : 'a list -> int (* Get the basic type of a declaration, removing array dimensions *) val basetypeof : Ast.node -> Ast.ctype (* Get the number of dimensions from an Array type *) val array_depth : Ast.ctype -> int (* Get name from variable or function declaration *) val nameof : Ast.node -> string val optmap : ('a -> 'b) -> 'a list option -> 'b list option val optmapl : ('a -> 'b) -> 'a list option -> 'b list (* List.mapi clone (only available in OCaml version >= 4.00 *) val mapi : (int -> 'a -> 'b) -> 'a list -> 'b list