Add grammar of language to repo
Preliminary, work in progress
This commit is contained in:
parent
9f4330889a
commit
1e9cd551a6
21
Grammar
Normal file
21
Grammar
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
|
||||||
|
|
||||||
|
<program> := <statements> EOF
|
||||||
|
|
||||||
|
<statements> := <statement>
|
||||||
|
| <statement> SEP <statements>
|
||||||
|
|
||||||
|
<statement> := let <id> = <expr>
|
||||||
|
| <expr>
|
||||||
|
|
||||||
|
<expr> := if <expr> then <statements> end
|
||||||
|
| if <expr> then <statements> else <statements> end
|
||||||
|
| while <expr> SEP <statements> end
|
||||||
|
| <binexpr>
|
||||||
|
| <number>
|
||||||
|
| <id>
|
||||||
|
|
||||||
|
|
||||||
|
<binexpr> :=
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user