Converting an LR(1) grammar to LL (exitsfunnel)
4 Feb 2004 21:57:09 -0500

          From comp.compilers

Related articles
Converting an LR(1) grammar to LL (2004-02-04)
| List of all articles for this month |

From: (exitsfunnel)
Newsgroups: comp.compilers
Date: 4 Feb 2004 21:57:09 -0500
Keywords: parse, question
Posted-Date: 04 Feb 2004 21:57:09 EST


I have a very large YACC {LR(1)} grammar which I'm attempting to
convert to ANTLR which is LL(k). It makes heavy use of Left
Recursion. I'm able to convert some of the simpler pieces but some of
it is quite complicated. What follows is an example of the stuff I
can't figure out how to convert:

membrane B A
A C membrane D
gentle B A
A C gentle D

dimentia B E C
membrane B F C
F C dimentia H
F C membrane H
membrane B E C
E C dimentia H
E C membrane H

gentle B K
        membrane L K

A couple of questions then. Is it possible that the above (about
which yacc has no complaints) can't be converted to LL? If there is
an alternative LL grammar and anyone could point me towards some
strategies for dealing with the situation I'd really appreciate it.
Thanks in advance.


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.