source: driver/options.ml

Last change on this file was 3020, checked in by sacerdot, 7 years ago
  • Options not used removed from the help/interface.
  • More compliance with the untrusted prototype.
File size: 5.4 KB
RevLine 
[3005]1(*open Misc.ArgExt replaced by next line*)
2let extra_doc s = "", Arg.Unit ignore, s
3
[3020]4(*
[3005]5let web_mode             = ref false
6let is_web_mode ()       = !web_mode
7let set_web_mode ()      = web_mode := true
[3020]8*)
[3005]9
[3020]10(*
[3005]11let default_choice       = "default"
12let option_settings_step = "during option settings"
13
14let language_from_string kind default s =
15  try
16    Languages.from_string s
17  with Not_found ->
18    if s = default_choice then
19      default
20    else
21      Error.global_error option_settings_step
22        (Printf.sprintf "`%s' is not a valid %s language." s kind)
23 
24let source_language_of_string   = language_from_string "source" Languages.Clight
25let source_language             = ref (source_language_of_string default_choice)
26let set_source_language s       = source_language := source_language_of_string s
27let get_source_language ()      = !source_language
28
29let target_language_of_string   = language_from_string "target" Languages.ASM
30let target_language             = ref (target_language_of_string default_choice)
31let set_target_language s       = target_language := target_language_of_string s
32let get_target_language ()      = !target_language
33*)
34
[3020]35(*
[3005]36let input_files                 = ref []
37let add_input_file f            = input_files := f :: !input_files
38let input_files ()              = !input_files
[3020]39*)
[3005]40
41let output_files                = ref None
42let set_output_files s          = output_files := Some s
43let get_output_files ()         = !output_files
44
45let annotation_flag             = ref false
46let request_annotation          = (:=) annotation_flag
47let annotation_requested ()     = !annotation_flag
48
[3020]49(*
[3005]50let interpretation_flag         = ref false
51let request_interpretation      = (:=) interpretation_flag
52let interpretation_requested () = !interpretation_flag
[3020]53*)
[3005]54
55let interpretations_flag         = ref false
56let request_interpretations      = (:=) interpretations_flag
57let interpretations_requested () = !interpretations_flag
58
[3020]59(*
[3005]60let debug_flag                  = ref false
61let set_debug                   = (:=) debug_flag
62let is_debug_enabled ()         = !debug_flag
[3020]63*)
[3005]64
[3020]65(*
[3005]66let asm_pretty_flag             = ref false
67let set_asm_pretty              = (:=) asm_pretty_flag
68let is_asm_pretty ()            = !asm_pretty_flag
[3020]69*)
[3005]70
71let lustre_flag                 = ref false
72let set_lustre_file             = (:=) lustre_flag
73let is_lustre_file ()           = !lustre_flag
74
75let remove_lustre_externals       = ref false
76let set_remove_lustre_externals   = (:=) remove_lustre_externals
77let is_remove_lustre_externals () = !remove_lustre_externals
78
79let lustre_test                 = ref None
80let set_lustre_test s           = lustre_test := Some s
81let get_lustre_test ()          = !lustre_test
82
83let lustre_test_cases           = ref 100
84let set_lustre_test_cases       = (:=) lustre_test_cases
85let get_lustre_test_cases ()    = !lustre_test_cases
86
87let lustre_test_cycles          = ref 100
88let set_lustre_test_cycles      = (:=) lustre_test_cycles
89let get_lustre_test_cycles ()   = !lustre_test_cycles
90
91let lustre_test_min_int         = ref (-1000)
92let set_lustre_test_min_int     = (:=) lustre_test_min_int
93let get_lustre_test_min_int ()  = !lustre_test_min_int
94
95let lustre_test_max_int         = ref 1000
96let set_lustre_test_max_int     = (:=) lustre_test_max_int
97let get_lustre_test_max_int ()  = !lustre_test_max_int
98
99(*
100let print_result_flag           = ref false
101let set_print_result            = (:=) print_result_flag
102let is_print_result_enabled ()  = !print_result_flag
103*)
104
[3020]105(*
[3005]106let dev_test                    = ref false
107let set_dev_test                = (:=) dev_test
108let is_dev_test_enabled ()      = !dev_test
[3020]109*)
[3005]110
111let options = OptionsParsing.register [
112(*
113  "-s", Arg.String set_source_language,
114  " Choose the source language between:";
115  extra_doc " Clight, Cminor";
116  extra_doc " [default is C]";
117
118  "-l", Arg.String set_target_language,
119  " Choose the target language between:";
120  extra_doc " Clight, Cminor, RTLabs, RTL, ERTL, LTL, LIN, ASM";
121  extra_doc " [default is ASM]";
122*)
123
124  "-a", Arg.Set annotation_flag,
125  " Add cost annotations on the source code.";
126
[3020]127(*
[3005]128  "-i", Arg.Set interpretation_flag,
129  " Interpret the compiled code.";
[3020]130*)
[3005]131
132  "-is", Arg.Set interpretations_flag,
[3020]133  " Outputs and interprets all the compilation passes,";
134  extra_doc " showing the execution traces";
[3005]135
[3020]136(*
[3005]137  "-d", Arg.Set debug_flag,
138  " Debug mode.";
139  extra_doc " Outputs all the passes up to the target language.";
140  extra_doc " Combined with an interpret option, shows the trace";
141  extra_doc " of execution states.";
[3020]142*)
[3005]143
144  "-o", Arg.String set_output_files,
145  " Prefix of the output files.";
146
[3020]147(*
[3005]148  "-asm-pretty", Arg.Set asm_pretty_flag,
149  " Output a pretty-printed assembly file.";
[3020]150*)
[3005]151
152  "-lustre", Arg.Set lustre_flag,
153  " Input file is a Lustre file.";
154
155  "-remove-lustre-externals", Arg.Set remove_lustre_externals,
156  " Remove Lustre externals.";
157
158  "-lustre-test", Arg.String set_lustre_test,
159  " Input file is a Lustre file, testing requested.";
160
161  "-lustre-test-cases", Arg.Int set_lustre_test_cases,
162  " Set the number of test cases when testing a Lustre";
163  extra_doc " file.";
164  extra_doc " [default is 100]";
165
166  "-lustre-test-cycles", Arg.Int set_lustre_test_cycles,
167  " Set the number of cycles for each case when testing";
168  extra_doc " a Lustre file.";
169  extra_doc " [default is 100]";
170
171  "-lustre-test-min-int", Arg.Int set_lustre_test_min_int,
172  " Random int minimum value when testing a Lustre file.";
173  extra_doc " [default is -1000]";
174
175  "-lustre-test-max-int", Arg.Int set_lustre_test_max_int,
176  " Random int maximum value when testing a Lustre file.";
177  extra_doc " [default is 1000]";
178
179(*
180  "-res", Arg.Set print_result_flag,
181  " Print the result of interpretations.";
182*)
183
[3020]184(*
[3005]185  "-dev", Arg.Set dev_test,
186  " Playground for developers.";
[3020]187*)
[3005]188]
Note: See TracBrowser for help on using the repository browser.