[antlr-interest] Possible bug in Antlr.g

Trey Spiva Trey.Spiva at embarcadero.com
Thu May 30 09:04:40 PDT 2002


I have been investigating why I am not able to get
charVocabulary='\3'..'\377'; to work in C++. 
I noticed something that I thought was odd and was wondering if I am reading
the antlr.g file 
incorrectly.
 
The parser rule lexerOptionsSpec references charSet when the option
"charVocabulary" is 
encountered.  charSet calls setBlockElement to retrieve the character set
range which 
calls the lexer rule CHAR_LITERAL to retrieve the start and end characters
in the range.
 
CHAR_LITERAL is defined as 
 
CHAR_LITERAL
   :  '\'' (ESC|~'\'') '\''
   ;
 
It seems to me that CHAR_LITERAL will only correctly match '\3' it will not
match '\377' because 
the rule does not have an (ESC|~'\'')*
 
Am I completely off?
 
Trey Spiva
Senior Software Engineer
trey.spiva at embarcadero.com
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20020530/c30c3246/attachment.html


More information about the antlr-interest mailing list