23 lines
255 B
OCaml
23 lines
255 B
OCaml
|
type op
|
||
|
= OpAdd
|
||
|
| OpSub
|
||
|
| OpMul
|
||
|
| OpDiv
|
||
|
|
||
|
type lit
|
||
|
= LitInt of int64
|
||
|
| LitFloat of float
|
||
|
|
||
|
type expr
|
||
|
= ExprLit of lit
|
||
|
| ExprBin of expr * op * expr
|
||
|
|
||
|
type func =
|
||
|
{ name : string
|
||
|
}
|
||
|
|
||
|
type decl
|
||
|
= DeclFunc of func
|
||
|
|
||
|
type program = decl list
|