dcsimg
Named literals generate: new Integer("let").
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Slawek_Kolasinski
Posted On:   Saturday, April 23, 2005 08:15 AM

Hi I need to have a named literal in my grammar. I write: class KogucikParser extends Parser; ... tokens { LET = "let" ; ... ANTLR generates KogucikParser.java with: protected void buildTokenTypeASTClassMap() { tokenTypeToASTClassMap = new Hashtable(); tokenTypeToASTClassMap.put(new Integer("let"), mypackage.LetNode.class); ... For now I've just corrected it manually but I expect it to be fixed in next releases. Slawek    More>>

Hi

I need to have a named literal in my grammar. I write:



class KogucikParser extends Parser;

...

tokens

{

LET = "let" ;

...





ANTLR generates KogucikParser.java with:



protected void buildTokenTypeASTClassMap() {

tokenTypeToASTClassMap = new Hashtable();

tokenTypeToASTClassMap.put(new Integer("let"), mypackage.LetNode.class);

...





For now I've just corrected it manually but I expect it to be fixed in next releases.



Slawek

   <<Less
About | Sitemap | Contact