[antlr-interest] Expr example in Wiki compile error Eclipse using ANTLRworks 1.0b8, ANTLR 3.0b5
Foolish Ewe
foolishewe at hotmail.com
Sat Dec 16 10:52:43 PST 2006
I've tried getting some my stuff working ANTLR source code into eclipse, by
adding the ANTLRworks 1.0b8 jar to my class path, and using ANTLRworks to
generate
the Java source and compile it in the Eclipse framework.
The generated code had compiler errors, (as did my much larger example) for
the following
ANTLR source line:
| '(' expr ')' {$value = $expr.value;}
The action $value=$expr.value; generates the following Java source (which
does not compile):
value = $expr.value;
Which does not compile.
I've noticed in my own source that I've had to create attribute labels in
order
to get compilable code out of ANTLR1.0b5 (via ANTRLworks 1.0b8),
so changing the ANTLR source to read:
| '(' myexpr=expr ')' {$value = $myexpr.value;}
generates the following Java source (which does compile):
value = myexpr;
Does anyone have any idea why the published example in the wiki isn't
building
in this environment?
Regards:
Bill M.
_________________________________________________________________
View Athletes Collections with Live Search
http://sportmaps.live.com/index.html?source=hmemailtaglinenov06&FORM=MGAC01
More information about the antlr-interest
mailing list