Rules
token TOP { <integer> <addop> <integer> {*} } token integer { \d+ {*} } token addop { [ '+' | '-' ] {*} }
Our current grammar doesn't handle whitespace:
$ ./calc --target=parse > 12 + 45 Failed to parse sourcecontinued...
Parrot | Perl6Grammar compiler and parsers | #25 |
token TOP { <integer> <addop> <integer> {*} } token integer { \d+ {*} } token addop { [ '+' | '-' ] {*} }
Our current grammar doesn't handle whitespace:
$ ./calc --target=parse > 12 + 45 Failed to parse sourcecontinued...
Copyright © 2009 http://www.pmichaud.com/2009/pres/ |