Re: Perhaps a FAQ: How to shortcut an alternation if one already commited subrule fails

2004-04-01 Thread Sean O'Rourke
Barring Perl 6, one thing you can do is lift the unique prefixes up into the rule you want to fail, e.g.: ENTITY : ( '#' commit COMMENT | IDENT '=' commit OPTION | TYPE NAME '{' commit DECLARATION | 'scope' commit SCOPE )(s) COMMENT : m/.*/ OPTION : VALUE

Re: Perhaps a FAQ: How to shortcut an alternation if one already commited subrule fails

2004-04-01 Thread Karl Gaissmaier
Hi Sean and other P::RD participants, Sean O'Rourke schrieb: Barring Perl 6, one thing you can do is lift the unique prefixes up into the rule you want to fail, e.g.: ENTITY : ( '#' commit COMMENT | IDENT '=' commit OPTION | TYPE NAME '{' commit DECLARATION | 'scope'

Perhaps a FAQ: How to shortcut an alternation if one already commited subrule fails

2004-03-31 Thread Karl Gaissmaier
Hi P::RD lovers, is there a general advice to shortcut an alternation in a rule if one already commited subrule fails: Example: ENTITY : ( COMMENT | OPTION | DECLARATION | SCOPE )(s) COMMENT : '#' commit m/.*/ | error? reject OPTION : IDENT '=' commit VALUE {