[antlr-interest] AST generation: EXPRESSION TREE example.

Bharath Sundararaman bharath at starthis.com
Wed Jun 2 14:35:14 PDT 2004


Hi Monty,

Yes, they do. In fact, if I don't use INTNode, PLUSNode and MULTNode in my
grammar and just use CalcAST in my "main" class which runs the parser and
the lex, it works fine. I can correctly resolve CalcAST and use it. Should I
qualify my usage of INTNode, PLUSNode and MULTNode? In my tokens section, I
have the line "PLUS<AST = PLUSNode>;". Also, all my class files exist under
one same package.

Thanks again,

Bharath.

-----Original Message-----
From: Monty Zukowski [mailto:monty at codetransform.com] 
Sent: Wednesday, June 02, 2004 4:02 PM
To: antlr-interest at yahoogroups.com
Cc: Monty Zukowski
Subject: Re: [antlr-interest] AST generation: EXPRESSION TREE example.


On Jun 2, 2004, at 1:56 PM, Bharath Sundararaman wrote:

> I am aware that I'm dealing with heterogeneous ASTs. I have the
> required
> classes from the documentation (CalcAST, BinaryOperatorAST, INTNode,
> PLUSNode and MULTNode) and I tried 
> "parser.setASTNodeClass(myPkg.CalcAST);"
> since setASTNodeType("myClassName") gave me a deprecation warning. 
> CalcAST
> class extends antlr.baseAST and not antlr.CommonAST -- What's the
> difference? I tried both classes and the error remains.
>

Do you have "package myPkg;" in your CalcAST classes?  Your error is 
about java not being able to load the class properly because it can't 
find it.

Monty Zukowski

ANTLR & Java Consultant -- http://www.codetransform.com
ANSI C/GCC transformation toolkit -- 
http://www.codetransform.com/gcc.html
Embrace the Decay -- http://www.codetransform.com/EmbraceDecay.html



 
Yahoo! Groups Links



 




 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
     http://groups.yahoo.com/group/antlr-interest/

<*> To unsubscribe from this group, send an email to:
     antlr-interest-unsubscribe at yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
     http://docs.yahoo.com/info/terms/
 



More information about the antlr-interest mailing list