Action methods
...to this:
grammar Calc::Grammar; regex integer { \d+ {*} } regex addop { [ '+' | '-' ] {*} } ... class Calc::Grammar::Actions; method integer($/) { say("found an integer", $/); } method addop($/) { say("found an addop", $/); }
Parrot | Perl6Grammar compiler and parsers | #17 |
...to this:
grammar Calc::Grammar; regex integer { \d+ {*} } regex addop { [ '+' | '-' ] {*} } ... class Calc::Grammar::Actions; method integer($/) { say("found an integer", $/); } method addop($/) { say("found an addop", $/); }
Copyright © 2009 http://www.pmichaud.com/2009/pres/ |