reserved_word: 'AND' | 'OR'
WORD: ...!reserved_word /[a-z0-9]+/i
Using the above grammar, rule WORD fails to match any token that start
with a reserved word (e.g. Andy). That is not what I expected since in
'demo_Cgrammar.pl', we have:
IDENTIFIER: ...!reserved_word /[a-z]\w*/i
I
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
{
Andras Karacsony schrieb:
Hello Karl!
No, because the C grammar example doesn't tweak the skip pattern either.
(I made my program work by 'preprocessing' the target text.
$_ = lc ;
s/\b(and|or)\b/\U$1/g;
my $tree = $parser-start($_);
and getting rid of the 'i'