Re: C and LL (1) (frigot eric)
27 Oct 2001 18:39:08 -0400

          From comp.compilers

Related articles
C and LL (1) (Pedro Pereira) (2001-10-23)
Re: C and LL (1) (Martin von Loewis) (2001-10-27)
Re: C and LL (1) (Andrew Wilson) (2001-10-27)
Re: C and LL (1) (2001-10-27)
Re: C and LL (1) (Martin von Loewis) (2001-10-28)
Re: C and LL (1) (2001-11-04)
Re: C and LL (1) (2001-11-05)
Re: C and LL (1) (Geoff Wozniak) (2001-11-08)
Re: C and LL (1) (Joachim Durchholz) (2001-11-11)
| List of all articles for this month |

From: (frigot eric)
Newsgroups: comp.compilers
Date: 27 Oct 2001 18:39:08 -0400
References: 01-10-121
Keywords: C, LL(1)
Posted-Date: 27 Oct 2001 18:39:08 EDT

Pedro Pereira <> wrote in message news:01-10-121...
> Hi,
> Can C be parsed by a LL (1) parser? I've serached in the web a lot,
> but i couldn't find the anwser!
> Thanks in advance,
> Pedro Pereira
> [Yes, give or take typedef. -John]


I think you can't parse C with a LL(1) grammar because there is a lot
of ambiguity in C (30-40 shift reduce with Bison, for exemple).
For exemple, just look at the if statement definition :
if (expression) statement
if (expression) statement else statement
I don't think you can parse that with LL(1) grammar.
You need to know if you've got the 'else' before reducing the if

Post a followup to this message

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