Skip to content
Snippets Groups Projects
global.ml 1.17 KiB
(** Time-stamp: <modified the 03/11/2010 (at 14:12) by Erwan Jahier> *)

(** Some global variables. *)


(* to compute line/col *)
let line_num = ref 1
let line_start_pos = ref 0
let (outfile:string ref) = ref ""
let (infiles:string list ref) = ref []
let current_file = ref ""
let main_node = ref ""
let compile_all_items = ref true
let run_unit_test = ref false
let one_op_per_equation = ref true
let inline_iterator = ref false
let lv4 = ref false
let ec = ref false
let no_prefix = ref false
let expand_nodes = ref false
let dont_expand_nodes : string list ref = ref []
let expand_enums = ref false
let expand_structs = ref false
(* the output channel *)
let oc = ref Pervasives.stdout
let tlex = ref false
let nonreg_test = ref false
(* those functions are here as they modify some global vars *)

let add_infile file_name =
  infiles := !infiles@[file_name]


let lexbuf_of_file_name file = 
  let inchannel = 
    Verbose.print_string ~level:1 
(*       ("Opening file " ^ (Filename.concat (Sys.getcwd ()) file) ^ "\n"); *)
      ("Opening file " ^ (file) ^ "\n");
    open_in file 
  in
    line_num := 1;
    line_start_pos := 0;
    current_file := file;
    Lexing.from_channel inchannel