[antlr-interest] Duplicate nodes on a parse tree?

Vadim Tropashko vadimtro at yahoo.com
Thu Mar 1 10:16:48 PST 2007


Here is another way to approach the problem. When
running the antlrworks interpreter, the parse tree
don't have any duplicates. How does the interpreter
constructs the tree? 


--- Vadim Tropashko <vadimtro at yahoo.com> wrote:

> I'm leveraging debugger parse tree generation as
> described in
>
http://www.antlr.org/wiki/pages/viewpage.action?pageId=1760
> 
> Everything works as advertised, although I'm getting
> duplicate nodes. For example given the rule:
> 
> boolean_primary options { backtrack=true; }
> :         sim_expr
> |
>  member_predicate
> |                          comparison_predicate
> ;
> 
> I'm getting the tree branch like this
> 
> boolean_primary
>     sim_expr
>         ....
>     sim_expr
>         ....
> 
> Is the duplicate "sim_expr" branch occurrence due to
> backtracking?  Then what would be the right way to
> filter out those ghost nodes? 
> 
> 
>  
>
____________________________________________________________________________________
> 8:00? 8:25? 8:40? Find a flick in no time 
> with the Yahoo! Search movie showtime shortcut.
> http://tools.search.yahoo.com/shortcuts/#news
> 



 
____________________________________________________________________________________
Food fight? Enjoy some healthy debate 
in the Yahoo! Answers Food & Drink Q&A.
http://answers.yahoo.com/dir/?link=list&sid=396545367


More information about the antlr-interest mailing list