[antlr-interest] Added ranges, escapes to [a-z] notation in lexer to honey badger

Terence Parr parrt at cs.usfca.edu
Fri Jan 27 10:15:30 PST 2012


Hi. I will make that syntax illegal or fix it.

BTW,  you cannot use ~ on more than a single character. what does ~'aaa' mean?
Ter
On Jan 24, 2012, at 9:14 AM, Peter Boughton wrote:

> Is the character class syntax only for use in isolation, or should it
> work within a group of alternatives?
> 
> i.e. I tried to convert a rule in the form:
> 	~('a'|'x'|'q'|'f'|'aaa'|'bbb'|'ccc')+
> 
> into:
> 	~([axqf]|'aaa'|'bbb'|'ccc')+
> 
> ...but it gives a "complete surprise" error on whatever the contents
> of the brackets are.
> 
> 
> Actually, I also tested ~[abc] and ~[a-c] syntax on its own, and they also say:
> 	'~' came as a complete surprise to me while looking for lexer rule
> elementlexer rule element".
> 
> Trying it as just [abc] and [a-c] both work as expected.
> 
> List: http://www.antlr.org/mailman/listinfo/antlr-interest
> Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-address



More information about the antlr-interest mailing list