Re: converting this grammar to LL1

"Joachim Durchholz" <joachim_d@gmx.de>
24 Oct 2002 23:57:45 -0400

          From comp.compilers

Related articles
converting this grammar to LL1 te-cheng_shen@agilent.com (Te-Cheng Shen) (2002-10-20)
Re: converting this grammar to LL1 chungyc@pobox.com (Yoo Chung) (2002-10-24)
Re: converting this grammar to LL1 joachim_d@gmx.de (Joachim Durchholz) (2002-10-24)
Re: converting this grammar to LL1 patrick.volteau@st.com (Patrick Volteau) (2002-10-25)
Re: converting this grammar to LL1 andreas.gieriet@externsoft.ch (Andreas Gieriet) (2002-10-25)
Re: converting this grammar to LL1 te-cheng_shen@agilent.com (Te-Cheng Shen) (2002-11-06)
Re: converting this grammar to LL1 joachim_d@gmx.de (Joachim Durchholz) (2002-11-07)
Re: converting this grammar to LL1 slk12@earthlink.net (SLK Parsers) (2002-11-12)
| List of all articles for this month |
From: "Joachim Durchholz" <joachim_d@gmx.de>
Newsgroups: comp.compilers
Date: 24 Oct 2002 23:57:45 -0400
Organization: Compilers Central
References: 02-10-097
Keywords: parse, LL(1)
Posted-Date: 24 Oct 2002 23:57:45 EDT

Te-Cheng Shen wrote:
> Then the resulting grammar is
>
> E-> F = E
> E -> F
>
> F -> id| & id | ( E ) | E [ int ]


I think you'll have to factor out the e[int] alternative as well. How
the exact rules should be depends on how you want to parse E=E[int]: as
(E=E)[int] or as E=(E[int])?
IOW your grammar is ambiguous, and ambiguities make any grammar non-LL
(and also non-LR).


Regards,
Joachim
--
This is not an official statement from my employer.



Post a followup to this message

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