[antlr-interest] Tree structure

ManimuthuLakshmi Pitchaikani antlr_lakshmi at yahoo.com
Thu Sep 30 13:13:46 PDT 2004


In .java file,
 
priVal_AST = (AST)astFactory.make( (new ASTArray(1)).add(astFactory.create(tmp12_AST,"-15")));
 
The errors is on the create(tmp12_AST,"-15").  The errror "The method create() in the ASTFactory is not applicable for the arguments(AST,String)" occurs.
 
Because of this error, the following error occurs for priVal as it is not being recognised:

opt_pri_AST = (AST)astFactory.make( (new ASTArray(2)).add(astFactory.create(NICE,"nice")).add(priVal)); 
Here it is not able to recognise priVal and the error "priVal cannot be resolved" occurs.
Also i observed that '!' mark doesn't matter.   
 
Rule on priVal needs any change?
 
Current code:
 

opt_pri! :#(PRI priVal)

{

#opt_pri = #(#[NICE, "nice"], #priVal); 

}

;



priVal! : INT

{

#priVal = #([INT,"-15"]);

}

;



Bryan Ewbank <Bryan.Ewbank at synopsys.com> wrote:
One other problem I've had is that "!" disables construction of the subtrees.  Try removing the "!" after the rule name.  This is just a guess, but it follows the pattern of what I've been seeing in my code.
 
I'm using ANTLR to generate C++, by the way; I don't think it'd be different for java, but just in case....
-----Original Message-----
From: ManimuthuLakshmi Pitchaikani [mailto:antlr_lakshmi at yahoo.com]
Sent: Thursday, September 30, 2004 14:52
To: Bryan.Ewbank at synopsys.com
Subject: Fwd: RE: [antlr-interest] Tree structure




Note: forwarded message attached.


---------------------------------
Do you Yahoo!?
vote.yahoo.com - Register online to vote today!
		
---------------------------------
Do you Yahoo!?
New and Improved Yahoo! Mail - 100MB free storage!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20040930/6e11747a/attachment.html


More information about the antlr-interest mailing list