Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- type literal =
- | Integer of int
- | Float of float
- type ('a, 'b) expr =
- | Base of 'a
- | Paren of 'b
- | Neg of 'b
- | Mult of 'b * 'b
- ...
- | Lit of literal
- type types = Tint | Tfloat
- type ('a, 'b) top =
- (* def type name exprs *)
- | Func of types * string * ('a, 'b) expr
- (* This definition is magical.
- * What it allows us to do is pair any amount of information with our AST,
- * without too much fiddling. Such as type data, or w/e else we might want.
- *)
- type ('a, 'b) ast = Ast of 'a * ('b, ('a, 'b) ast) top
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement