[antlr-interest] Comment rule matches links

Jenny Balfer ai06087 at Lehre.BA-Stuttgart.De
Tue Aug 26 04:31:18 PDT 2008


> An alternate solution is to analyse the context of the / in the lexer
> to determine if it is a regular expression or division (e.g. a
> division cannot directly follow an equals, so if the last non-hidden
> token was an equals it must be a regular expression). Depending on
> your language it may be hard to formulate and implement an adequate
> set of rules at the lexer level.

That sounds like a solution for me! How can I access the last non-hidden
token in the lexer? I think I'll try that out.



More information about the antlr-interest mailing list