mirror of
https://github.com/ProgramSnail/Lama.git
synced 2025-12-06 14:58:50 +00:00
Sync
This commit is contained in:
parent
ef8ea21216
commit
23eb95ae33
4 changed files with 6 additions and 5 deletions
|
|
@ -79,7 +79,7 @@
|
||||||
keywords={let, begin, end, in, match, type, and, fun,
|
keywords={let, begin, end, in, match, type, and, fun,
|
||||||
function, try, with, class, object, method, of, rec, repeat, until,
|
function, try, with, class, object, method, of, rec, repeat, until,
|
||||||
while, not, do, done, as, val, inherit, module, sig, @type, struct,
|
while, not, do, done, as, val, inherit, module, sig, @type, struct,
|
||||||
if, then, else, open, virtual, new, fresh, skip, od, fi, elif, for, local, return, read, write},
|
if, then, else, open, virtual, new, fresh, skip, od, fi, elif, for, local, return, read, write, fi, case, esac, od},
|
||||||
sensitive=true,
|
sensitive=true,
|
||||||
%basicstyle=\small,
|
%basicstyle=\small,
|
||||||
commentstyle=\scriptsize\rmfamily,
|
commentstyle=\scriptsize\rmfamily,
|
||||||
|
|
@ -125,5 +125,6 @@ language=ocaml
|
||||||
\input{05}
|
\input{05}
|
||||||
\input{06}
|
\input{06}
|
||||||
\input{07}
|
\input{07}
|
||||||
|
\input{08}
|
||||||
|
|
||||||
\end{document}
|
\end{document}
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ let parse infile =
|
||||||
let s = Util.read infile in
|
let s = Util.read infile in
|
||||||
Util.parse
|
Util.parse
|
||||||
(object
|
(object
|
||||||
inherit Matcher.t s
|
inherit Matcher.stream s
|
||||||
inherit Util.Lexers.decimal s
|
inherit Util.Lexers.decimal s
|
||||||
inherit Util.Lexers.string s
|
inherit Util.Lexers.string s
|
||||||
inherit Util.Lexers.char s
|
inherit Util.Lexers.char s
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ with show
|
||||||
(* The type for the stack machine program *)
|
(* The type for the stack machine program *)
|
||||||
type prg = insn list
|
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
|
(* The type for the stack machine configuration: control stack, stack and configuration from statement
|
||||||
interpreter
|
interpreter
|
||||||
|
|
|
||||||
|
|
@ -103,7 +103,7 @@ open SM
|
||||||
of x86 instructions
|
of x86 instructions
|
||||||
*)
|
*)
|
||||||
let compile env code =
|
let compile env code =
|
||||||
(*SM.print_prg code;*)
|
SM.print_prg code;
|
||||||
flush stdout;
|
flush stdout;
|
||||||
let suffix = function
|
let suffix = function
|
||||||
| "<" -> "l"
|
| "<" -> "l"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue