Commit 72c35c97 by Danny Willems

Improve comments.

parent 0a129b04
......@@ -33,7 +33,8 @@
(* A top level is a term. See that only terms are accepted as top level
expression. Type term like type application is not allowed.
Parenthesis is not mandatory for the top level expressions.
Parentheses are not mandatory for the top level expressions.
A top level expression must be ended with ;; to evaluate it (as in OCaml).
*)
top_level:
| t = term ; SEMICOLON ; SEMICOLON { t }
......@@ -51,6 +52,9 @@ term:
t = term {
F.TeAbs(bv, typevar, t)
}
(* Build an abstraction. For ease of reading when the variable type is long,
parentheses are added around the variable and the type.
*)
| ABSTRACTION ;
LPARENT ;
bv = VAR ;
......@@ -81,14 +85,11 @@ term:
t = term {
F.TeProj(i, t)
}
(* Build a term application. It must be surround by parenthesis: it avoids
conflicts between (id [A] x), (id [B] y) and id [A] (x, id [B] y)
By a previous rule, we can add as many parenthesis as we want.
(* Build a term application. No parentheses are mandatory.
*)
|
|
t1 = term ;
t2 = term {
F.TeApp(t1, t2)
}
(* Build a Let definition *)
......@@ -108,7 +109,7 @@ term:
F.TeTyAbs(id, t)
}
(* Surround term with nested parentheses. Allow to add an infinite number of
parenthesis without modifying the meaning
parentheses.
*)
| LPARENT ;
t = term ;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment