[antlr-interest] Possible bug in subrule invertion

Mike Lischke lists at lischke-online.de
Fri Apr 9 10:09:18 PDT 2004


Hi all,

It seems like I found a bug in the subrule invertion parser. When I try to invert a set of tokens like:

~('*' | LINE_FEED)

Where LINE_FEED is a (lexer) token defined as '\r'. ANTLR throws an error ("This subrule cannot be inverted....") however when I use

~('*' | '\r')

The construct is accepted. So to me it looks like a bug. Is this a known problem?

Btw.: It would be very helpful if we could do some "token set maths" like

 DIGIT:            '0'..'9';
 OCTAL_DIGIT:     DIGIT - ['8', '9'];

In this simple example it would be easy to replace the octal digit rule however for large sets like Unicode it is necessary to selectively take out arbitrary ranges of code points as they are not defined yet.

Mike
--
www.soft-gems.net



 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
     http://groups.yahoo.com/group/antlr-interest/

<*> To unsubscribe from this group, send an email to:
     antlr-interest-unsubscribe at yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
     http://docs.yahoo.com/info/terms/
 



More information about the antlr-interest mailing list