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 | |
---|
12 | ASMInterpret.parse_and_interpret_hex filename |
---|
13 | |
---|
14 | (* |
---|
15 | let print = false in |
---|
16 | let interpret = false in |
---|
17 | let labelize = false in |
---|
18 | let target = Languages.ASM in |
---|
19 | let p = Languages.parse Languages.Clight filename in |
---|
20 | let p = if labelize then Languages.labelize p else p in |
---|
21 | let ps = Languages.compile false Languages.Clight target p in |
---|
22 | let f f' p = match Languages.language_of_ast p with |
---|
23 | | l when l = target -> f' p |
---|
24 | | _ -> () |
---|
25 | in |
---|
26 | if print then List.iter (f (Languages.save filename)) ps ; |
---|
27 | if interpret then List.iter (f (fun p -> ignore (Languages.interpret p))) ps |
---|
28 | *) |
---|
29 | in |
---|
30 | |
---|
31 | List.iter f filenames |
---|
Note: See
TracBrowser
for help on using the repository browser.