calc example -- adding actions
grammar Calc::Grammar; token TOP { <statement> } rule statement { <term> <addop> <term> } token term { \d+ } token addop { '+' | '-' }continued...
Programming Parrot | Programming Parrot | #42 |
grammar Calc::Grammar; token TOP { <statement> } rule statement { <term> <addop> <term> } token term { \d+ } token addop { '+' | '-' }continued...
Copyright © 2008 Patrick Michaud |