[antlr-interest] How exclude a symbol from lexer rule?

Johannes Luber jaluber at gmx.de
Tue Oct 7 10:02:05 PDT 2008


Sergiy Karpenko schrieb:
> 
> Hi, all
> For axample we have a lexer rule:
> 
> CHAR : ('a'..'z')|('0'..'9');
> 
> But, I want exclude from this sequence 'k' symbol. 
> Somethig like
> EXTCHAR: CHAR ~'k' ;
> 
> Thanks

ANTLR doesn't support this kind of syntax, though it is sometimes quite
handy. You have to do it manually.

Johannes


More information about the antlr-interest mailing list