]>
Commit | Line | Data |
---|---|---|
6ade8b0a | 1 | (* L3 compiler |
0a24e44d | 2 | * stringifier |
12aa4087 | 3 | * turns a list of x86 insns into the assembly code to generate them |
0a24e44d | 4 | * Author: Chris Lu <czl@andrew.cmu.edu> |
12aa4087 JW |
5 | *) |
6 | ||
7 | signature STRINGIFY = | |
8 | sig | |
f716a180 | 9 | type asm = Blarg.insn list |
6ade8b0a | 10 | val stringify : (string -> string) -> asm -> string |
12aa4087 JW |
11 | end |
12 | ||
13 | structure Stringify :> STRINGIFY = | |
14 | struct | |
f716a180 JW |
15 | type asm = Blarg.insn list |
16 | structure X = Blarg | |
12aa4087 | 17 | |
0a24e44d | 18 | (* val stringify : asm -> string |
12aa4087 JW |
19 | * turns a x86 instruction list into a string of assembly code for these instructions *) |
20 | ||
f716a180 JW |
21 | fun (*stringify' rn (X.CALL (l, n)) = X.print (X.CALL ((Symbol.symbol (rn (Symbol.name l))), n)) |
22 | | *)stringify' rn x = X.print x | |
12aa4087 | 23 | |
0a24e44d | 24 | (* val stringify : asm -> string *) |
5c79bb68 | 25 | fun stringify realname l = String.concat (List.map (stringify' realname) l) |
12aa4087 JW |
26 | |
27 | end |