calc example -- adding actions
grammar Calc::Grammar; token TOP { <statement> {*} } rule statement { <term> <addop> <term> {*} } token term { \d+ {*} } token addop { '+' | '-' }
Add the {*} markers
continued...Parrot | Parrot Compiler Toolkit | #40 |
grammar Calc::Grammar; token TOP { <statement> {*} } rule statement { <term> <addop> <term> {*} } token term { \d+ {*} } token addop { '+' | '-' }
Add the {*} markers
continued...
Copyright © 2008 Patrick R. Michaud http://www.pmichaud.com/2008/pres/ |