The Figure 2.9 Grammar for Micro with Action Aymbols
<program> | -> #start begin <statement list> end |
<statement list> | -> <statement> { <statement> } |
<statement> | -> <ident> := <expression> #assign; |
<statement> | -> read (<id list> ); |
<statement> | -> write( <expr list> ); |
<id list> | -> <ident> #read_id {, <ident> #read_id } |
<expr list> | -> <expression> #write_expr {, <expression> #write_expr } |
<expression> | -> <primary> { <add op> <primary> #gen_infix } |
<primary> | -> ( <expression> ) |
<primary> | -> <ident> |
<primary> | -> INTLITERAL #process_op |
<add op> | -> PLUSOP #process_op |
<add op> | -> MINUSOP #process_op |
<ident> | -> ID #process_id |
<system goal> | -> <program> SCANEOF #finish |
Author: Ming-I Hsieh (Powered by FreeBSD, c2html, gimp, vim, gmake)