[antlr-interest] Can't create AST Node?

Ric Klaren klaren at cs.utwente.nl
Thu Jul 8 06:12:33 PDT 2004


On Thu, Jul 08, 2004 at 08:46:11AM -0400, Tiller, Michael (M.M.) wrote:
> > Could it be that you did parser.setASTNodeClass before setting the
> > ASTFactory ? (parser.setASTNodeClass() forwards to
> > astFactory.setASTNodeClass())
> 
> As far as I know, the Java side does not require the ASTFactory to be
> initialized.  At least the examples don't show that.

Ack. I see that now. So that theory is out of the window.

> > It could be helpfull to see on which variant of ASTFactory.create() it
> > bombs out.
> 
> I agree.  In fact, it would be nice if the code that fails printed
> information about the exception rather than just saying it couldn't
> create it.  It would be nice to know *why*.

You might get some inspiration to the why by looking at createUsingCtor and
create(Class c) methods in ASTFactory.java. Or put a breakpoint / trace
code in ASTFactory.getASTNodeType(int tokenType) and see from there. The
error message comes from the creat(Class c) method (that btw has no other
information to make the error clearer)

Cheers,

Ric
--
-----+++++*****************************************************+++++++++-------
    ---- Ric Klaren ----- j.klaren at utwente.nl ----- +31 53 4893755  ----
-----+++++*****************************************************+++++++++-------
  Chaos is found in greatest abundance wherever order is being sought.
  --- Terry Pratchet



 
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