Advertisement
Guest User

Untitled

a guest
Apr 10th, 2015
214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
F# 0.43 KB | None | 0 0
  1. type Binary =
  2.     Add | Sub | Mul |
  3.     Div | Mod | Pow
  4.  
  5. type Expression =
  6.     | Number of int
  7.     | Variable of string
  8.     | Operation of Binary * Expression * Expression
  9.  
  10. type Statement =
  11.     | Read of string
  12.     | Write of Expression
  13.     | Assign of string * Expression
  14.     | Sequence of Statement * Statement
  15.     | If of Expression * t * t
  16.     | While of Expression * t
  17.  
  18. let parseExpression l =
  19.     match l with
  20.     |
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement