Advertisement
Guest User

Untitled

a guest
Jun 4th, 2016
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.20 KB | None | 0 0
  1. type binop = Add | Sub | Mul | Div
  2. type monop = UnaryMinus
  3. type promise={d:(data ref) option; ex:expr; gamma: env}
  4. and data =
  5. | Numeric of expr array (*num[n1,...nm]*)
  6. | String of expr array(*str[s1,...sm]*)
  7. | Gen of (data ref) array (*gen[nu1...num]*)
  8. | Closure of f list * expr * env (*\f1..\fn.e,G*)
  9. | PromiseD of promise
  10. and u=
  11. | Value of data
  12. | Promise of promise
  13. and expr =
  14. | Num of float (*n*)
  15. | Str of string (*s*)
  16. | Symbol of string
  17. | ArrayAccess of expr * expr (*x[[e]]*)
  18. | CompoundExpression of expr * expr (*{e;e}*)
  19. | FunctionDeclaration of f list * expr (*function(f1,..fn) e*)
  20. | Application of expr * a list (*x(a1,...an)*)
  21. | AssignExpression of expr * expr (*x<-e*)
  22. | ArrayAssignWithIndex of expr * expr * expr (*x[e]<-e*)
  23. | U of u ref (*u*)
  24. | PartialEvaluation of (data ref) * (a list) (*nu(a1,..an)*)
  25. (* | BinOp of binop * expr * expr
  26. | MonOp of monop * expr*)
  27. and f=
  28. | Identifier of string
  29. | AssignParam of string * expr
  30. and a=
  31. | Expr of expr
  32. | AssignArg of string * expr
  33. and frameElement=
  34. | PromiseF of promise
  35. | DataRef of (data ref)
  36.  
  37. and frame = (expr, frameElement) Hashtbl.t
  38. and env= (frame ref) list
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement