mirror of
https://github.com/ProgramSnail/Lama.git
synced 2025-12-12 01:38:45 +00:00
Sync
This commit is contained in:
commit
6bd9b1a5f5
2 changed files with 8 additions and 3 deletions
|
|
@ -70,7 +70,12 @@ module Expr =
|
||||||
| Var x -> st x
|
| Var x -> st x
|
||||||
| Binop (op, x, y) -> to_func op (eval st x) (eval st y)
|
| Binop (op, x, y) -> to_func op (eval st x) (eval st y)
|
||||||
|
|
||||||
(* Expression parser *)
|
(* Expression parser. You can use the following terminals:
|
||||||
|
|
||||||
|
IDENT --- a non-empty identifier a-zA-Z[a-zA-Z0-9_]* as a string
|
||||||
|
DECIMAL --- a decimal constant [0-9]+ as a string
|
||||||
|
|
||||||
|
*)
|
||||||
ostap (
|
ostap (
|
||||||
parse:
|
parse:
|
||||||
!(Ostap.Util.expr
|
!(Ostap.Util.expr
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ type prg = insn list
|
||||||
(* The type for the stack machine configuration: a stack and a configuration from statement
|
(* The type for the stack machine configuration: a stack and a configuration from statement
|
||||||
interpreter
|
interpreter
|
||||||
*)
|
*)
|
||||||
type config = int list * Language.Stmt.config
|
type config = int list * Stmt.config
|
||||||
|
|
||||||
(* Stack machine interpreter
|
(* Stack machine interpreter
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue