[antlr-interest] ASTFactory.dup*
Ric Klaren
klaren at cs.utwente.nl
Thu Dec 27 05:27:36 PST 2001
Hi,
On Sun, Dec 23, 2001 at 01:52:22PM -0800, Terence Parr wrote:
> > I just learned yesterday, that the dup* methods don't work as expected,
> > if you
> > use various types of AST nodes and cannot set the default AST type
> > therefore.
> > They return a CommonAST node, instead of the typ, that is passed to
> > them. I've
> > already found a workaround for me, but maybe using some clone() method
> > in the
> > dup* methods would be better?
>
> Ouch. Good point. dup should pay attention to types...hmmm...I wonder
> how that can be made efficient. Oh, each heterogeneous AST node must
> define dup or clone or whatever.
You might have a look at the astfactory stuff in C++ mode, that does now
mostly the right thing. This is one of the reasons why that stuff should be
ported to java mode as well....
Ric
--
-----+++++*****************************************************+++++++++-------
---- Ric Klaren ----- klaren at cs.utwente.nl ----- +31 53 4893722 ----
-----+++++*****************************************************+++++++++-------
Human beings, who are almost unique in having the ability to learn
from the experience of others, are also remarkable for their apparent
disinclination to do so. --- Douglas Adams, Last Chance to See
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
More information about the antlr-interest
mailing list