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