Parrot Perl6Grammar compiler and parsers #17

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", $/); }
Copyright © 2009
http://www.pmichaud.com/2009/pres/