Advertisement
Guest User

Untitled

a guest
Nov 11th, 2014
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
F# 1.36 KB | None | 0 0
  1. type AST =
  2.     | Program               of  Statement List
  3.  
  4. and Statement =
  5.     | DataType
  6.     | Definition            of  (Identifier List) * Expression
  7.     | FunctionDefinition    of  FunctionName: Identifier *
  8.                                 Parameters: Identifier List *
  9.                                 FunctionBody: Expression
  10.  
  11. and Expression =
  12.     | Tuple                 of  Expression List
  13.     | IfStatement           of  Comparison: Expression *
  14.                                 Then: Expression *  
  15.                                 Else: Expression
  16.     | CompoundExpression    of  Statement List * Expression
  17.     | FunctionCall          of  FunctionName: Identifier *
  18.                                 Parameters: Expression List
  19.     | Arg                   of  Arg
  20.  
  21. and Arg =
  22.     | BinaryArg             of  LHS: Expression *
  23.                                 RHS: Expression *
  24.                                 Op: BinaryOperation
  25.     | UnaryArg              of  Expression * UnaryOperation
  26.     | Identifier            of  Identifier
  27.     | Literal               of  Literal
  28.  
  29. and BinaryOperation =
  30.     | BinaryOperation
  31.  
  32. and UnaryOperation =
  33.     | UnaryOperation
  34.  
  35. and Identifier =
  36.     | Identifier            of  string
  37.  
  38. and Literal =
  39.     | Integer               of  int
  40.     | Float                 of  single
  41.     | Boolean               of  bool
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement