Line | |
---|
1 | |
---|
2 | (** A playground function for developers where they can test very specific |
---|
3 | functionalities not available in the compiler. |
---|
4 | It is called with the -dev option. |
---|
5 | [filenames] are the file names given in the command line when calling |
---|
6 | acc. *) |
---|
7 | |
---|
8 | let do_dev_test (filenames : string list) : unit = |
---|
9 | |
---|
10 | let f filename = |
---|
11 | let target = Languages.Clight in |
---|
12 | let print = false in |
---|
13 | let interpret = true in |
---|
14 | let p = Languages.parse Languages.Clight filename in |
---|
15 | let p = Languages.labelize p in |
---|
16 | let ps = Languages.compile false Languages.Clight target p in |
---|
17 | let f f' p = match Languages.language_of_ast p with |
---|
18 | | l when l = target -> f' p |
---|
19 | | _ -> () |
---|
20 | in |
---|
21 | if print then List.iter (f (Languages.save false filename)) ps ; |
---|
22 | if interpret then |
---|
23 | List.iter (f (fun p -> ignore (Languages.interpret true p))) ps |
---|
24 | in |
---|
25 | |
---|
26 | List.iter f filenames |
---|
Note: See
TracBrowser
for help on using the repository browser.