[antlr-interest] could not even do k=1 for decision xx; reason: timed out

Tomasz Jastrzebski tdjastrzebski at yahoo.com
Sun Aug 9 05:17:07 PDT 2009


I did some more debugging. It seems that is exactly the case - during node construction:

-> ^(BIN_EXPR<BinaryExpression>[$o.text, $addExpr.tree, $e.tree]>)
 
$addExpr.tree is not assigned yet. It gets reassigned later.
 
Thanks for the pointer. I am gonna post a new subject.
 
Tomasz

--- On Sat, 8/8/09, Gavin Lambert <antlr at mirality.co.nz> wrote:


From: Gavin Lambert <antlr at mirality.co.nz>
Subject: Re: [antlr-interest] could not even do k=1 for decision xx; reason: timed out
To: "Tomasz Jastrzebski" <tdjastrzebski at yahoo.com>, "antlr-interest" <antlr-interest at antlr.org>
Date: Saturday, August 8, 2009, 9:56 PM


At 13:48 9/08/2009, Tomasz Jastrzebski wrote:
> I tried replacing:
> -> ^($o $addExpr $e)
> with:
> -> ^(BIN_EXPR<BinaryExpression>[$o.text, $addExpr, $e.tree]>) // instead of $addExpr.tree
> but the tool (at least ver 3.1.1) dooes not allow this - error(117): missing attribute access on rule scope. Anyway, $addExpr is of type addExpr_return.
> 
> I do not know. This may be a bug.

Maybe.  It does make a certain amount of sense for the intermediate tree result to not yet be assigned to the .tree field, though.  But there ought to be some way to get at it.

I guess in the meantime you could just hack in the variable name it uses in the generated code to track it (look near the end of the method to see what gets assigned to the .tree of addExpr_return).  Not ideal, but it should get you by.




      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20090809/6a3ba4ea/attachment.html 


More information about the antlr-interest mailing list