Re: Beginner help with LALR(1) closure

adrian@dcs.rhbnc.ac.uk (A Johnstone)
19 Nov 1996 23:32:13 -0500

          From comp.compilers

Related articles
Beginner help with LALR(1) closure kentr@rollinssoft.com (Kent Rollins) (1996-11-12)
Re: Beginner help with LALR(1) closure dlester@cs.man.ac.uk (1996-11-14)
Re: Beginner help with LALR(1) closure grout@sp55.csrd.uiuc.edu (1996-11-14)
Re: Beginner help with LALR(1) closure compres@world.std.com (1996-11-14)
Re: Beginner help with LALR(1) closure farzu@cs.tamu.edu (Francisco Arzu) (1996-11-14)
Re: Beginner help with LALR(1) closure adrian@dcs.rhbnc.ac.uk (1996-11-19)
Re: Beginner help with LALR(1) closure salomon@silver.cs.umanitoba.ca (1996-11-19)
Re: Beginner help with LALR(1) closure gianni@engr.sgi.com (Gianni Mariani) (1996-12-03)
Re: Beginner help with LALR(1) closure icedancer@ibm.net (1996-12-07)
Re: Beginner help with LALR(1) closure salomon@silver.cs.umanitoba.ca (1996-12-15)
| List of all articles for this month |
From: adrian@dcs.rhbnc.ac.uk (A Johnstone)
Newsgroups: comp.compilers
Date: 19 Nov 1996 23:32:13 -0500
Organization: Royal Holloway, University of London
References: 96-11-080
Keywords: LALR, parse

Kent Rollins (kentr@rollinssoft.com) wrote:
: 1. I've downloaded a few YACC-able grammars and I've noticed that
: they all have left-recusive grammars...


: In order to get around the
: problem, I used a technique from a previous chapter which
: eliminates left-recursion (B) from LL grammars. I would like to
: know how the LALR(1) closure process avoids left recursion.


Watch out! I don't believe it is a well known fact, but in general an
LALR grammar that is transformed using the standard left recursion
removal algorithm will not be LALR afterwards. So apart from the fact
that your solution is over engineered (see other posts), it is also
incorrect.


                                                                  Adrian


--
    Dr Adrian Johnstone, Dean of the Science Faculty, Dept of Computer Science,
        Royal Holloway, University of London, Egham, Surrey, TW20 0EX, England.
Email: adrian@dcs.rhbnc.ac.uk Tel: +44 (0)1784 443425 Fax: +44 (0)1784 443420
--


Post a followup to this message

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