[antlr-interest] Occasionally match hidden channel
Jim Idle
jimi at temporal-wave.com
Thu Dec 18 10:42:18 PST 2008
On Thu, 2008-12-18 at 18:13 +0000, Nicolas Wu wrote:
> To make things worse, sometimes I want to make sure that there is
> definitely no SLASHSLASH between elements.
>
> I know it sounds like it should just be an ordinary token, but it isn't,
> since there are only two specific places in the grammar where
> these funny requirements crop up. The rest of the time,
> SLASHSLASH is invisible.
To predicate on it not being there use this:
r : SOMETHING {(TokenStream)input ).get( input.index()-1 ).getType() !=
SLASHSLASH) }?=> SOMETHINGELSE
;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20081218/34e1d120/attachment.html
More information about the antlr-interest
mailing list