Removed embedding

This commit is contained in:
Dmitry Boulytchev 2018-02-25 14:51:46 +03:00
parent 337a5d1a67
commit 1996d0e0cb
2 changed files with 1 additions and 42 deletions

View file

@ -1,41 +0,0 @@
(* A deep embedding of simple expressions in OCaml. *)
(* Opening GT yet again. *)
open GT
(* Opening the substrate module for convenience. *)
open Syntax
(* Shortcuts for leaf constructors *)
let ( ! ) x = Expr.Var x
let ( !? ) n = Expr.Const n
(* Implementation of operators *)
let binop op x y = Expr.Binop (op, x, y)
let ( + ) = binop "+"
let ( - ) = binop "-"
let ( * ) = binop "*"
let ( / ) = binop "/"
let ( % ) = binop "%"
let ( < ) = binop "<"
let ( <= ) = binop "<="
let ( > ) = binop ">"
let ( >= ) = binop ">="
let ( == ) = binop "=="
let ( != ) = binop "!="
let ( && ) = binop "&&"
let ( || ) = binop "!!"
let ( =:= ) x e = Stmt.Assign (x, e)
let read x = Stmt.Read x
let write e = Stmt.Write e
let (|>) x y = Stmt.Seq (x, y)
(* Some predefined names for variables *)
let x = !"x"
let y = !"y"
let z = !"z"
let t = !"t"

View file

@ -2,7 +2,7 @@ TOPFILE = rc
OCAMLC = ocamlc
OCAMLOPT = ocamlopt
OCAMLDEP = ocamldep
SOURCES = Language.ml Embedding.ml SM.ml Driver.ml
SOURCES = Language.ml SM.ml Driver.ml
LIBS = GT.cma unix.cma re.cma re_emacs.cma re_str.cma
CAMLP5 = -pp "camlp5o -I `ocamlfind -query GT.syntax` -I `ocamlfind -query ostap.syntax` pa_ostap.cmo pa_gt.cmo -L `ocamlfind -query GT.syntax`"
PXFLAGS = $(CAMLP5)