Related articles |
---|
LL(1) parser table hyperarien@yahoo.com (2002-01-05) |
Re: LL(1) parser table gsc@zip.com.au (Sean Case) (2002-01-07) |
Re: LL(1) parser table dr_feriozi@prodigy.net (SLK Parsing) (2002-01-13) |
Re: LL(1) parser table kaarthik@cisco.com (Kaarthik) (2002-01-13) |
Re: LL(1) parser table kaarthik@cisco.com (Kaarthik) (2002-01-13) |
Re: LL(1) parser table hyperarien@yahoo.com (2002-01-14) |
From: | SLK Parsing <dr_feriozi@prodigy.net> |
Newsgroups: | comp.compilers |
Date: | 13 Jan 2002 22:54:07 -0500 |
Organization: | Prodigy Internet http://www.prodigy.com |
References: | 02-01-026 |
Keywords: | parse, LL(1) |
Posted-Date: | 13 Jan 2002 22:54:07 EST |
lee wrote:
>
> S -> E
> E -> TE'
> E'-> -TE'
> E'-> epsilon
> T -> FT'
> T'-> /FT'
> T'-> epsilon
> F -> GF'
> F'-> ++F'
> F'-> epsilon
> G -> ++E
> G -> id
>
> Still after all this grammar is ambiguous. Because F' FOLLOW set is
> {/,-,++,$} and there are two entries for [F',++] comination.
>
> Does this means the above grammar is not suitable for LL1 parsing?
>
It just means that you made a mistake in the grammar. It should be
G -> ++G
assuming the precedence order that is implied by the grammar. Or if you
want low precedence for prefix ++ then use
E -> ++_* T E'
++_* -> ++ ++_*
++_* -> epsilon
instead of
E -> TE'
G -> ++E
Return to the
comp.compilers page.
Search the
comp.compilers archives again.