Action methods
class Calc::Grammar::Actions; method integer($/) { say("found an integer", $/); } method addop($/) { say("found an addop", $/); }
In Perl 6, $/ is the standard variable for storing the results of a regex match.
continued...Parrot | Perl6Grammar compiler and parsers | #18 |
class Calc::Grammar::Actions; method integer($/) { say("found an integer", $/); } method addop($/) { say("found an addop", $/); }
In Perl 6, $/ is the standard variable for storing the results of a regex match.
continued...
Copyright © 2009 http://www.pmichaud.com/2009/pres/ |