[antlr-interest] parse tree construction after left recursion removal

Safiye Celik safisce at gmail.com
Tue Jul 7 06:10:38 PDT 2009


Hi,
I have a rule and its tree construction such below:
a : b | c! a c! | a d^ a
I apply left recursion removal algorithm and convert above rule to below two
rules:
a : b a' | c a c a'
a' : (d a a')?
But now, I cannot create the parse tree I want. That's, I want "a : a d a"
rule in the first case, to have 'd' as the root of the two 'a's. But in the
two-rule case after the left recursion removal, I cannot provide this tree.
What should I do to remove left recursion, but also provide the tree I need?
I would be glad if you have an idea and share it with me.


-- 
-safiye
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20090707/d161a0a5/attachment.html 


More information about the antlr-interest mailing list