Pre-parsing

This commit is contained in:
Dmitry Boulytchev 2018-02-25 15:04:10 +03:00
commit b8fb21720c

View file

@ -44,7 +44,7 @@ let rec eval ((stack, ((st, i, o) as c)) as conf) = function
Takes an input stream, a program, and returns an output stream this program calculates Takes an input stream, a program, and returns an output stream this program calculates
*) *)
let run p i = let (_, (_, _, o)) = eval ([], (Expr.empty, i, [])) p in o let run p i = let (_, (_, _, o)) = eval ([], (Expr.empty, i, [])) p in o
(* Stack machine compiler (* Stack machine compiler
val compile : Language.Stmt.t -> prg val compile : Language.Stmt.t -> prg
@ -52,7 +52,6 @@ let run p i = let (_, (_, _, o)) = eval ([], (Expr.empty, i, [])) p in o
Takes a program in the source language and returns an equivalent program for the Takes a program in the source language and returns an equivalent program for the
stack machine stack machine
*) *)
let rec compile = let rec compile =
let rec expr = function let rec expr = function
| Expr.Var x -> [LD x] | Expr.Var x -> [LD x]