Tutorial Lex/Yacc - capsl
Tutorial Lex/Yacc - capsl
Tutorial Lex/Yacc - capsl
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
Bison: rules Section Example<br />
/*** Rules section ***/<br />
statement_list: statement '\n'<br />
| statement_list statement '\n'<br />
statement: NAME '=' expression { $1->value = $3; }<br />
| expression { printf("= %g\n", $1); }<br />
expression: NUMBER<br />
| NAME { $$ = $1->value; }<br />
What this says is that a statement list is made<br />
up of a statement OR a statement list<br />
followed by a statement.<br />
2/17/2012<br />
CAPSL<br />
49