Re: Error recovery and LR(1)/LALR(1)

"=?Windows-1252?Q?S=F6nke_Kannapinn?=" <soenke.kannapinn@wincor-nixdorf.com>
28 Jun 2002 18:07:22 -0400

          From comp.compilers

Related articles
Error recovery and LR(1)/LALR(1) heng@Ag.arizona.edu (Heng Yuan) (2002-06-17)
Re: Error recovery and LR(1)/LALR(1) gvcormac@uwaterloo.ca (Gordon V Cormack) (2002-06-20)
Re: Error recovery and LR(1)/LALR(1) kgw-news@stiscan.com (2002-06-20)
Error recovery and LR(1)/LALR(1) cfc@world.std.com (Chris F Clark) (2002-06-20)
Re: Error recovery and LR(1)/LALR(1) soenke.kannapinn@wincor-nixdorf.com (=?Windows-1252?Q?S=F6nke_Kannapinn?=) (2002-06-28)
| List of all articles for this month |
From: "=?Windows-1252?Q?S=F6nke_Kannapinn?=" <soenke.kannapinn@wincor-nixdorf.com>
Newsgroups: comp.compilers
Date: 28 Jun 2002 18:07:22 -0400
Organization: Siemens Inc.
References: 02-06-055 02-06-062
Keywords: LALR, errors
Posted-Date: 28 Jun 2002 18:07:22 EDT

> >Situation 1:
> >For example, a DFA state contains the following LR(1) items
> > A -> alpha X . , lookahead = 'a'
> > B -> beta X . gamma , lookahead = 'b'
> >My question is really what to do if the lookahead is neither 'a'
> >or 'b'? Should A be reduced?
>
> Minor nit: If this is a valid LR state, alpha == beta.


No, not necessarily. In the classical (canonical) LR(k) table
construction the following holds:


For any two items [A -> alpha . gamma, x], [B -> beta . delta, y]
being members of the same LR(k)-DFA state,
alpha is a suffix of beta, or beta is a suffix of alpha.
--
Dr. Sönke Kannapinn
String.concat[ "soenke", ".", "kannapinn", "@", "wincor-nixdorf", ".", "com" ]



Post a followup to this message

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