Skip to content
Snippets Groups Projects
lv6MainArgs.mli 3.24 KiB
Newer Older
erwan's avatar
erwan committed
(* Time-stamp: <modified the 16/11/2023 (at 12:25) by Erwan Jahier> *)
type enum_mode =
    AsInt  (* translate enums into int (for rif-friendlyness *)
  | AsBool (* translate enums into bool arrays; not working yet *)
  | AsConst  (* translate enums into abstract const *)
  | AsEnum (* do nothing *)


(* koketeri, vu qu'on continu  ranger concetement
   les options dans des var. globales ! (cf Global
*)
type io_transmit_mode =
  | Stack (* All I/O are are passed as arguments of the step functions *)
  | Heap  (* All I/O are in a ctx structure; ctx of memoryless soc are global *)
  | HeapStack  (* I/O of memoryful soc are in a ctx structure; memoryless soc uses step arg *)
(* *)

type schedul_mode = Simple | Sort | Reorder
type t = {
  mutable opts : (string * Arg.spec * string) list; (* classical Arg option tab used by Arg.parse *)
  mutable user_man  : (string * string list) list; (* ad hoc tab for pretty prtting usage *)
  mutable hidden_man: (string * string list) list; (* ad hoc tab for pretty prtting usage *)
  mutable dev_man: (string * string list) list; (* ad hoc tab for pretty prtting usage *)
  mutable others: string list;
  mutable margin : int;
  mutable outfile :  string;
  mutable infiles :  string list;
  mutable main_node :  string;
  mutable compile_all_items : bool;
  mutable run_unit_test :  bool;
  mutable expand_nodes :  bool;
  mutable expand_node_call :  string list;
  mutable expand_arrays :  bool;
  mutable oc :  out_channel;
  mutable tlex :  bool;
  mutable exec :  bool;
  mutable gen_smv:  bool;
  mutable launch_cc :  bool;
  mutable launch_exec :  bool;
  mutable precision : int option;
  mutable keep_aliases : bool;
}

(* Those are really too boring to be functionnal (used in all over the places) *)
type global_opt = {
erwan's avatar
erwan committed
  mutable dir : string;
  mutable gen_c_inline_predef :  bool;
erwan's avatar
erwan committed
  mutable rte :  bool;
  mutable kcg :  bool;
  mutable gen_autotest :  bool;
  mutable expand_enums :  enum_mode;
  mutable inline_iterator :  bool;
  mutable one_op_per_equation :  bool;
  mutable one_op_per_equation_set :  bool; (* to be able to give priority to cli option *)
  mutable one_user_op_per_equation :  bool;
  mutable one_user_op_per_equation_set :  bool; (* to be able to give priority to cli option *)
  mutable no_prefix :  bool;
  mutable nonreg_test :  bool;
  mutable current_file :  string;
  mutable line_num : int;
  mutable line_start_pos : int;
  mutable soc2c_no_switch : bool;
  mutable soc2c_inline_loops : bool;
erwan's avatar
erwan committed
  mutable soc2c_dro : bool;
erwan's avatar
erwan committed
  mutable multi_core : bool;
  mutable gen_wcet :  bool;
  mutable io_transmit_mode : io_transmit_mode;
  mutable schedul_mode : schedul_mode;
val paranoid : Lv6Verbose.flag

(* La ``mthode'' principale *)
val parse : string array -> t

val usage : out_channel -> t -> unit
val full_usage : out_channel -> t -> unit

val lexbuf_of_file_name : string -> Lexing.lexbuf