# this example mixes official Perl 6 syntax an PGE syntax, # I don't really know if they are 100% compatible # see https://svn.perl.org/parrot/trunk/docs/pct/pct_optable_guide.pod # and http://perlcabal.org/syn/S05.html rule factor { | | '(' ')' } token infix:<*> { }; # stands for a literal * here token infix: is equiv('infix:*') { }; token infix:<+> is looser('infix:*') { }; token infix:<-> is equiv('inifx:+') { }; # put parser in bottom-up mode: rule expression is optable { ... }; # yes, '...' is valid Perl 6 ;-) proto 'term:' is tighter('infix:*') is parsed(&factor) { ... };