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

Vadim Tropashko vadimtro at yahoo.com
Fri Mar 2 09:49:58 PST 2007


OK, I see the coloring (when tree is in chart form).
It must be the Tree.getType() method that does this.
Is there javadoc html page anywhere? 


--- Jean Bovet <antlr-list at arizona-software.ch> wrote:

> This can be part of the backtracking, yes. Are the
> duplicate nodes  
> colored in green or red?
> 
> Jean
> 
> On Mar 1, 2007, at 10:16 AM, Vadim Tropashko wrote:
> 
> > 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
> 
> 



 
____________________________________________________________________________________
It's here! Your new message!  
Get new email alerts with the free Yahoo! Toolbar.
http://tools.search.yahoo.com/toolbar/features/mail/


More information about the antlr-interest mailing list