[antlr-interest] Passing values in tree walker
Mike Jones
Mike.Jones at woofumdust.com
Thu Sep 4 06:47:01 PDT 2003
Terence,
I found the problem. There was a second reference to expr without the
[i2] farther down in the grammar. I had not noticed that the java error
was related to this other expression.
Thanks, I'm flying!
Mike
-----Original Message-----
From: Terence Parr [mailto:parrt at cs.usfca.edu]
Sent: Wednesday, September 03, 2003 11:34 PM
To: antlr-interest at yahoogroups.com
Subject: Re: [antlr-interest] Passing values in tree walker
On Wednesday, September 3, 2003, at 10:32 PM, Mike Jones wrote:
> Terence,
>
> I feel stupid!
>
> Ok, so to reference it:
>
> Expr2
> {
> int i2;
> }
> : expr[i2]
> ;
>
> I tried that and the resulting code fails because it only calls with
> the
> AST parameter.
>
> Any suggestion?
Hmm...must be a rule name issue...that is the way I pass arguments all
the time. :) I'll bet you can check the java.g grammar from the site
and you'll see me building trees by passing info down into other rules.
Could be a weird syntax gotcha too.
Terence
--
Professor Comp. Sci., University of San Francisco
Creator, ANTLR Parser Generator, http://www.antlr.org
Co-founder, http://www.jguru.com
Co-founder, http://www.knowspam.net enjoy email again!
Co-founder, http://www.peerscope.com link sharing, pure-n-simple
Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
More information about the antlr-interest
mailing list