mirror of
https://github.com/ProgramSnail/Lama.git
synced 2025-12-24 07:38:46 +00:00
Sync
This commit is contained in:
parent
ef8ea21216
commit
23eb95ae33
4 changed files with 6 additions and 5 deletions
|
|
@ -4,7 +4,7 @@ let parse infile =
|
|||
let s = Util.read infile in
|
||||
Util.parse
|
||||
(object
|
||||
inherit Matcher.t s
|
||||
inherit Matcher.stream s
|
||||
inherit Util.Lexers.decimal s
|
||||
inherit Util.Lexers.string s
|
||||
inherit Util.Lexers.char s
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ with show
|
|||
(* The type for the stack machine program *)
|
||||
type prg = insn list
|
||||
|
||||
let print_prg p = List.iter (fun i -> Printf.printf "%s\n\!" (show(insn) i)) p
|
||||
let print_prg p = List.iter (fun i -> Printf.printf "%s\n" (show(insn) i)) p
|
||||
|
||||
(* The type for the stack machine configuration: control stack, stack and configuration from statement
|
||||
interpreter
|
||||
|
|
|
|||
|
|
@ -103,7 +103,7 @@ open SM
|
|||
of x86 instructions
|
||||
*)
|
||||
let compile env code =
|
||||
(*SM.print_prg code;*)
|
||||
SM.print_prg code;
|
||||
flush stdout;
|
||||
let suffix = function
|
||||
| "<" -> "l"
|
||||
|
|
@ -279,7 +279,7 @@ let compile env code =
|
|||
else [Binop (op, x, y); Or1 y]
|
||||
)
|
||||
| LABEL s -> (if env#is_barrier then (env#drop_barrier)#retrieve_stack s else env), [Label s]
|
||||
|
||||
|
||||
| JMP l -> (env#set_stack l)#set_barrier, [Jmp l]
|
||||
|
||||
| CJMP (s, l) ->
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue