[antlr-interest] Re: Problem with Heterogenous AST antlr 2.7.2a6
beeh1973 <hastur4711 at bigfoot.com>
hastur4711 at bigfoot.com
Sat Dec 21 07:01:16 PST 2002
--- In antlr-interest at yahoogroups.com, Terence Parr <parrt at j...>
wrote:
> > So the class is really called "org.mydomain.ExistOperator"
> >
> > Have you tried the following?
> > tokens {
> > EXIST <AST=org.mydomain.ExistOperator>;
> > }
> >
> > I'm not sure whether your example with just the classname should
work
> > as well. Ter?
it worked with antlr 2.7.2a2
> You should have to use the full classname unless your parser is in
the
> org.mydomain package (in Java).
it is in the same package
i compared the code generated by v2.7.2a2 and v2.7.2.a6
v2.7.2a2 generates
...
ExistOperator tmp35_AST = null;
tmp35_AST = new ExistOperator(LT(1));
...
v2.7.2a6 generates:
...
ExistOperator tmp35_AST = null;
tmp35_AST = (ExistOperator)astFactory.create(LT(1),"ExistOperator");
...
as far as i understand the change.
v2.7.2a2: if parser and astclasses
reside in the same package you can use unqualified names in the
grammar.
v2.7.2a6: you need to use full qulified classnames for astclasses in
the
grammar.
right?
so i am changing my grammar.
thanks,
alphonse
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
More information about the antlr-interest
mailing list