[antlr-interest] How to specify ‘any non-control symbol’?

Jim Idle jimi at temporal-wave.com
Thu Oct 30 09:22:25 PDT 2008


On Thu, 2008-10-30 at 16:10 +0100, Hendrik Maryns wrote:

> Hendrik Maryns schreef:
> > Johannes Luber schreef:



> Why doesn’t
> 
> LABEL : ~(WHITESPACE | '(' | ')')+ ;
> 


Your WHITESPACE rule probably defines a sequence rather than a set.
Create a:

fragment WSCHARS : (' ' | '\t' | '\f');

Then:

LABEL : ( ~ (WSCHARS | '(' | ')' ) )+;

Will probably work, though you are probably gong to create huge lexer
tables (which we are hoping to do something about shortly).

Jim 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20081030/8013861e/attachment.html 


More information about the antlr-interest mailing list