Perl 6 Rakudo Perl - Perl 6 on Parrot #40

Action methods in action!

Pure parse rule:

rule statement_control {
    | <if_statement>      {*}     #= if
    | <while_statement>   {*}     #= while
    | <for_statement>     {*}     #= for
    | ...
}

rule while_statement {
    'while' <EXPR> <pblock> {*}
}

Add {*} markers to denote places to invoke actions

Copyright © 2008
http://www.pmichaud.com/2008/pres/