17 Sep 2005 13:47:52 -0400

Related articles |
---|

Is this grammar LL(1) ? sky4walk@gmx.de (2005-09-17) |

Re: Is this grammar LL(1) ? DrDiettrich@compuserve.de (Hans-Peter Diettrich) (2005-09-22) |

Re: Is this grammar LL(1) ? jjan@cs.rug.nl (J.H.Jongejan) (2005-09-22) |

From: | sky4walk@gmx.de |

Newsgroups: | comp.compilers |

Date: | 17 Sep 2005 13:47:52 -0400 |

Organization: | http://groups.google.com |

Keywords: | LL(1), question |

Hi,

i've a question about this grammar

E->'a',F,A,F,'b'.

F->'c',F | epsilon.

A->'d',A_1.

A_1->'d',A_1 | epsilon.

is this grammar LL(1)?

my first and follow list

First(E) = {a}

First(F) = {c,epsilon}

First(A) = {d}

First(A_1) = {d,epsilon}

Follow(E) = {}

Follow(F) = {d,b}

Follow(A) = {c,d,b}

Follow(A_1) = {c,d,b}

sp I see, that in Follow(A_1) and First(A_1) is a problem because of

same terminal 'd'.

So my question is:

1) is my follow list correct?

2) when 1) is true, why isn't my grammar LL(1), it isn't leftrecursivea

nd how can I change this one?

Thanks

André Betz

andrebetz.de

Post a followup to this message

Return to the
comp.compilers page.

Search the
comp.compilers archives again.