Re: Making a CFG for RDP with one token lookahead.

feriozi@my-deja.com
30 Jun 2000 01:02:04 -0400

          From comp.compilers

Related articles
Making a CFG for RDP with one token lookahead. e8rasmus@etek.chalmers.se (Rasmus Anthin) (2000-06-22)
Re: Making a CFG for RDP with one token lookahead. feriozi@my-deja.com (2000-06-30)
| List of all articles for this month |

From: feriozi@my-deja.com
Newsgroups: comp.compilers
Date: 30 Jun 2000 01:02:04 -0400
Organization: Deja.com - Before you buy.
References: 00-06-087
Keywords: parse

    Rasmus Anthin <e8rasmus@etek.chalmers.se> wrote:
>
> I have a problem. It seems that I have to have more lookahead tokens
> than necessary (and that is really a pain). My CFG in EBNF looks as
follows:
>
  > <init>::= <ID>|<assign>
> <assign>::= <ID> "=" <asg-part>
>


This is one example of where you need to left-factor the grammar. Check
the dragon book or some other compiler book to see the requirements for
LL1 parsing.


Post a followup to this message

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