Re: C and LL (1)

Martin von Loewis <loewis@informatik.hu-berlin.de>
28 Oct 2001 13:57:10 -0500

          From comp.compilers

Related articles
C and LL (1) pjbp@netc.pt (Pedro Pereira) (2001-10-23)
Re: C and LL (1) loewis@informatik.hu-berlin.de (Martin von Loewis) (2001-10-27)
Re: C and LL (1) andrew@blueoffice.com (Andrew Wilson) (2001-10-27)
Re: C and LL (1) frigot_e@epita.fr (2001-10-27)
Re: C and LL (1) loewis@informatik.hu-berlin.de (Martin von Loewis) (2001-10-28)
Re: C and LL (1) dr_feriozi@prodigy.net (2001-11-04)
Re: C and LL (1) GOLDParser@DevinCook.com (2001-11-05)
Re: C and LL (1) gzw@home.com (Geoff Wozniak) (2001-11-08)
Re: C and LL (1) joachim_d@gmx.de (Joachim Durchholz) (2001-11-11)
| List of all articles for this month |

From: Martin von Loewis <loewis@informatik.hu-berlin.de>
Newsgroups: comp.compilers
Date: 28 Oct 2001 13:57:10 -0500
Organization: Humboldt University Berlin, Department of Computer Science
References: 01-10-121 01-10-134
Keywords: C, parse
Posted-Date: 28 Oct 2001 13:57:10 EST

frigot_e@epita.fr (frigot eric) writes:


> 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
> OR
> if (expression) statement else statement


That is a question of how the grammar is formulated. A
recursive-descent parser can very well determine whether 'statement'
is a nested if statement by just looking at the first token of
'statement'.


Regards,
Martin


Post a followup to this message

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