Skip to content
Snippets Groups Projects
global.ml 1.1 KiB
Newer Older
(** Time-stamp: <modified the 11/03/2009 (at 16:14) by Erwan Jahier> *)
Erwan Jahier's avatar
Erwan Jahier committed

(** Some global variables. *)
Erwan Jahier's avatar
Erwan Jahier committed


(* 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 one_op_per_equation = ref true
let inline_iterator = 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
let oc = ref Pervasives.stdout


(* 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