[antlr-interest] infinite loop in tree
antlruser
thief at iol.ie
Tue Sep 21 09:35:20 PDT 2004
Hey everyone,
I have a situation where the following string may arise
blah CLIPPED
I want to represent this in an AST as:
LS_CLIPPED
|
blah
so I have the following in my grammer
factor
: v:variable (l:leftSidedOperators[#v] { #factor=#l; })?
;
leftSidedOperators[AST operator]
: CLIPPED {#leftSidedOperators = #(#[LS_CLIPPED,"LS_CLIPPED"],
#operator);}
;
However when the AST is generated I get a StackOverflowError and as
infinite representation of the Tree like
LS_CLIPPED->blah->LS_CLIPPED->blah->LS_CLIPPED etc.
Can anyone help me with this.
Thanks in advance,
Mark
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/antlr-interest/
<*> To unsubscribe from this group, send an email to:
antlr-interest-unsubscribe at yahoogroups.com
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
More information about the antlr-interest
mailing list