util.mli 662 B

12345678910111213141516171819
  1. (* Generate a fresh variable from a given prefix, e.g. "counter" -> "counter$1" *)
  2. val fresh_var : string -> string
  3. (* Generate an Ast.loc tuple from Lexing data structures *)
  4. val loc_from_lexpos : Lexing.position -> Lexing.position -> Ast.loc
  5. (* Default transformation traversal for AST nodes *)
  6. val transform_children : (Ast.node -> Ast.node) -> Ast.node -> Ast.node
  7. (*val visit_children : (Ast.node -> unit) -> Ast.node -> unit*)
  8. (* Extract location from node *)
  9. val locof : Ast.node -> Ast.loc
  10. (* Print file location to stderr *)
  11. val prerr_loc : Ast.loc -> unit
  12. (* Print file location to stderr *)
  13. val prerr_loc_msg : Ast.loc -> string -> int -> unit