[antlr-interest] Java1.5 grammar and enum as identifier and not as a keyword

Michael Studman mstudman at gmx.net
Sun Jun 26 13:22:06 PDT 2005


If you're not in a position to be able to change the source code you're 
parsing and you can guarantee "enum" is not used as a keyword  then you 
can call JavaLexer.enableEnum(false) on the lexer before you pass it 
into the recogniser.

Akhilesh Mritunjai wrote:

>Hi
>
>I encountered similar problem, and since we were
>transitioning to 1.5, we decided to clean up the code.
>Fortunately, for java 1.4, it can be done using a
>simple find/replace. sed -i 's/\<enum\>/_enum/' takes
>care of it :-)
>
>--- Jörg Rech <joerg.rech at gmail.com> wrote:
>  
>
>>  I have a problem parsing the java libraries using
>>the java1.5.g 
>>grammar updated by Scott Wisniewski. Several
>>statements use the 
>>java1.5-keyword "enum" as a name for a variable.
>>    
>>
>
>
>
>		
>__________________________________ 
>Yahoo! Mail 
>Stay connected, organized, and protected. Take the tour: 
>http://tour.mail.yahoo.com/mailtour.html 
>
>
>  
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20050626/01e76ea3/attachment.html


More information about the antlr-interest mailing list