[antlr-interest] Duplicate nodes on a parse tree?
Jean Bovet
antlr-list at arizona-software.ch
Thu Mar 1 21:41:42 PST 2007
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
More information about the antlr-interest
mailing list