1ae61287c1
to indicate what portion of it is now parsed
29 lines
610 B
Plaintext
29 lines
610 B
Plaintext
|
|
|
|
<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> :=
|
|
|
|
|
|
/* actual grammar encoded in program */
|
|
|
|
<program> := <statements> EOF
|
|
<statements> := <statement> | <statement> SEP <statements>
|
|
<let_expression> := let <identifier> = <rhs>
|
|
<rhs> := <num_literal> | <str_literal> | <identifier>
|
|
|