2015-07-21 03:32:16 -07:00
|
|
|
|
|
|
|
|
|
|
|
<program> := <statements> EOF
|
|
|
|
|
2015-07-24 02:06:45 -07:00
|
|
|
<statements> := <statement>
|
2015-07-21 03:32:16 -07:00
|
|
|
| <statement> SEP <statements>
|
|
|
|
|
|
|
|
<statement> := let <id> = <expr>
|
|
|
|
| <expr>
|
2015-08-08 12:51:46 -07:00
|
|
|
| <fn_block>
|
|
|
|
|
|
|
|
<fn_block> := fn <id> ( <arg_list> ) <statements> end
|
|
|
|
|
|
|
|
<arg_list> := e
|
2015-08-08 17:58:51 -07:00
|
|
|
| <id>
|
2015-08-08 12:51:46 -07:00
|
|
|
| <id> , <arg_list>
|
2015-07-21 03:32:16 -07:00
|
|
|
|
|
|
|
<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-26 14:59:01 -07:00
|
|
|
| <binop>
|
|
|
|
|
|
|
|
<binop> := <simple_expr>
|
|
|
|
| <simple_expr> <id> <binop>
|
2015-07-21 03:32:16 -07:00
|
|
|
|
2015-07-25 17:43:44 -07:00
|
|
|
<simple_expr> := <id>
|
|
|
|
| <number>
|
|
|
|
| <string>
|
2015-07-21 03:32:16 -07:00
|
|
|
|
|
|
|
|