Incognito has asked for the wisdom of the Perl Monks concerning the following question:
My terminology may be incorrect, but I have a grammar that needs to accept a set of atoms, minus a small subset of atoms...
ReservedWord: Keyword | FutureReservedWord Keyword: 'break' | 'else' | 'new' FutureReservedWord: 'abstract' | 'enum' | 'int' 'short' | 'interface' | 'static' Identifier: IdentifierName IdentifierName: /[\$_a-zA-Z][\$_a-zA-Z0-9]*/
I actually want the Identifier: production to be something like:
meaning that we want all possible words EXCEPT those found in ReservedWord (which can get quite large). I do not believe that this can be done using negative lookahead or <reject>...IdentifierName but not ReservedWord
Oh mighty gods (and <grinning> semi-gods), is this even possible? If not, hours of work are lost and I shall sob quietly in my dark and damp corner. Any ideas?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
•Re: Parse::RecDescent - Excluding a Subset of Atoms From a Production Rule
by merlyn (Sage) on Mar 14, 2002 at 23:38 UTC | |
|
Re: Parse::RecDescent - Excluding a Subset of Atoms From a Production Rule
by maverick (Curate) on Mar 14, 2002 at 23:39 UTC |