Safiye Celik wrote:
> Hi
> I wanna ask one more question about parse tree construction..
> I have such a rule:
> 
> x: A B (C A B)* and I have to create such a tree for it:
> 
>                               
>                                            B
>                                      /      |     \
>                                 A        C        B
>                                                   /  |  \
>                                                A  C    B
>                                                         /  |  \
>                                                       A..C. B......and 
> continues like that. (The leftmost a B is in the rule, the closest it is 
> to the root of the tree.This is true also for other tokens)
> 
> How can I create such a tree for that rule? the "*" confuses everything :(

I *believe* (I may be wrong) that you need to formulate the rule using 
recursion, rather than EBNF. While (tail-)recursion and EBNF are 
equivalent in matching, they produce different results in tree 
constructions. I could very well be wrong, of course.

-- 
Sam Barnett-Cormack

List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe: 
http://www.antlr.org/mailman/options/antlr-interest/your-email-address

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"il-antlr-interest" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/il-antlr-interest?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to