[antlr-interest] Strange report on console

Loring Craymer lgcraymer at yahoo.com
Thu Jul 20 10:45:04 PDT 2006


This looks like an ANTLR 3 problem.  Ter changed to single-quoted strings ('File' is a STRING_LITERAL), but the lexer also recognizes double-quoted STRINGs (DOUBLE_QUOTED_STRING_LITERAL).  Change "File" to 'File' in your grammar, and do the same for other doubly quoted strings.

--Loring

romje at javaxpert.com wrote: 
Hi all,
using the latest stable ANTLR release I've got some strange information on
my console:

line 1:1: expecting "File", found 'File'

This is an excerpt from my grammar..

header_eliot_unit:
                  file_identifier
                  ;
file_identifier:
                "File" HEADER_SEPARATOR PATH
                "RS" QUALIFIED_NAME
                ;

Can't see what 's wrong with it...
Can't figure how ANTLR see a string as a kind of char indeed....


grepping through the source code, found this message comes from the
MismatchedTokenException#getMessage().. Why such exception ?
I hope that File is seen a File isn't it ?

Any clue welcomed

Cheers
jerome
-- 
Auteur cahiers du programmeur J2EE - Eyrolles 2003



 		
---------------------------------
Yahoo! Messenger with Voice. Make PC-to-Phone Calls to the US (and 30+ countries) for 2¢/min or less.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20060720/5978cdc5/attachment.html


More information about the antlr-interest mailing list