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