[antlr-interest] My parser hangs in an infinite loop on certa in inputs

Matt Lowry mclowry at cs.adelaide.edu.au
Tue Sep 9 18:47:41 PDT 2003


mzukowski at yci.com wrote:

>Don't mix automatic tree building with manual tree building.  Your node
>#occur has been automatically built with #val as the sibling already.
>Remember, it is a tree, not just a node, unless you turn tree building off
>for the whole rule.  So adding #val as the sibling of the tree #occur is
>really adding #val to #val causing an infinite loop.  
>
>Possible solutions, I recommend the first as the most common and clearest
>code:
>
>Common idiom using "##" shorthand for "current root":
>  
>
Ah, ... this makes a lot of sense. Getting a bit more jiggy with the 
tree building stuff now.
Thanks muchly for your help.
PS! I haven't seen this ## notation anywhere in the documentaion ... :o

-- 
---------------------------------------------------------------
"He never sat down to program without a crowbar close at hand."
  -- Stanislaw Lem
---------------------------------------------------------------



 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 




More information about the antlr-interest mailing list