in reply to Parse::Recdescent rule problem

hi hak0983,
Try rearranging you grammar to look something like this it might help (untested). If you need some more grammar for reference there is a post with compound statements here.
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] } }
This should also allow you to have multiple print statements per line as long as they are separated by a ';'.

Regards Paul