[antlr-interest] Problems with generated code

Theo Harper Theo_Harper at systemsunion.com
Wed Aug 3 09:05:38 PDT 2005

I am running 2.7.5.

How can I get hold of a newer versions?


-----Original Message-----
From: Micheal J [mailto:open.zone at virgin.net] 
Sent: 03 August 2005 17:25
To: antlr-interest at antlr.org
Subject: RE: [antlr-interest] Problems with generated code

> I am having a problem with the generated parser, specifically the 
> ASTFactory initialisation.
> My tokens are defines as follows (in the grammar file):
> 	EXECUTE="execute";
> INSERT="insert"<AST=SystemsUnion.Reporting.Server.Execution.SQ
> LParser.Insert
> AST>;
> 	...
> When I generate the parser and lexer the following code is generated 
> which does not compile:
> 	static public void initializeASTFactory( ASTFactory factory ) {
> 		factory.setMaxNodeType(79);
> 		factory.setTokenTypeASTNodeType("insert",
> "SystemsUnion.Reporting.Server.Execution.SQLParser.InsertAST");
> 		factory.setTokenTypeASTNodeType("select",
> "SystemsUnion.Reporting.Server.Execution.SQLParser.SelectAST");
> 		...
> The first argument to setTokenTypeAsTNodeType should be an int and not 
> a string.
> Does anyone have any suggestions? 

What version of ANTLR are you using?. 2.7.5 is the latest 

[I should note that Ric Klaren and Scott Stansfield distribute more recent
variants of 2.7.5 (Scott calls his 2.7.6).]

In the meantime, I'll do a quick test here myself...


This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom it is addressed. If you have received this e-mail in error you must not copy, distribute or take any action in reliance on it. Please notify the sender by e-mail or telephone.
We utilise an anti-virus system and therefore any files sent via e-mail will have been checked for known viruses. You are however advised to run your own virus check before opening any attachments received as we will not in any event accept any liability whatsoever once an e-mail and/or any attachment is received. Any views expressed by an individual within this e-mail do not necessarily reflect the views of Systems Union Group plc or any of its subsidiary companies.

More information about the antlr-interest mailing list