schala/Grammar

22 lines
429 B
Plaintext
Raw Normal View History

<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
2015-07-26 01:54:55 -07:00
| ( <expr> )
2015-07-25 17:43:44 -07:00
| <simple_expr>
2015-07-25 17:43:44 -07:00
<simple_expr> := <id>
| <number>
| <string>