This should also allow you to have multiple print statements per line as long as they are separated by a ';'.my $grammar = q{ # --- Tokens --- EOF : /^\Z/ IDENTIFIER : /[A-Za-z]\w*/ QUOTE : '\'' # --- Rules --- parse : stmt(s?) EOF { $item[1] } stmt : print ';' { $item[1] } | <error> print : 'print' QUOTE IDENTIFIER QUOTE { $item[2] } }
In reply to Re: Parse::Recdescent rule problem
by thekestrel
in thread Parse::Recdescent rule problem
by hak0983
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |