Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- type AST =
- | Program of Statement List
- and Statement =
- | DataType
- | Definition of (Identifier List) * Expression
- | FunctionDefinition of FunctionName: Identifier *
- Parameters: Identifier List *
- FunctionBody: Expression
- and Expression =
- | Tuple of Expression List
- | IfStatement of Comparison: Expression *
- Then: Expression *
- Else: Expression
- | CompoundExpression of Statement List * Expression
- | FunctionCall of FunctionName: Identifier *
- Parameters: Expression List
- | Arg of Arg
- and Arg =
- | BinaryArg of LHS: Expression *
- RHS: Expression *
- Op: BinaryOperation
- | UnaryArg of Expression * UnaryOperation
- | Identifier of Identifier
- | Literal of Literal
- and BinaryOperation =
- | BinaryOperation
- and UnaryOperation =
- | UnaryOperation
- and Identifier =
- | Identifier of string
- and Literal =
- | Integer of int
- | Float of single
- | Boolean of bool
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement