Re: Moving from LR(0) to LALR(1)

"satya" <>
3 Feb 2007 23:23:22 -0500

          From comp.compilers

Related articles
Moving from LR(0) to LALR(1) (2007-01-31)
Re: Moving from LR(0) to LALR(1) (Lothar Schmitz) (2007-02-03)
Re: Moving from LR(0) to LALR(1) (Momchil Velikov) (2007-02-03)
Re: Moving from LR(0) to LALR(1) (satya) (2007-02-03)
Re: Moving from LR(0) to LALR(1) (Karsten Nyblad) (2007-02-04)
Re: Moving from LR(0) to LALR(1) (snoyberg) (2007-02-05)
| List of all articles for this month |

From: "satya" <>
Newsgroups: comp.compilers
Date: 3 Feb 2007 23:23:22 -0500
Organization: Compilers Central
References: 07-01-083
Keywords: LALR, parse
Posted-Date: 03 Feb 2007 23:23:22 EST

> I've been able to implement a program that generates action and GOTO
> tables for a given grammar using LR(0). However, I haven't been able
> to find any good documentation (read: something simple enough I can
> understand) on switching over to LALR(1). Since my main goal for
> writing this is parsing Java, getting it to use LALR(1) is a necesity
> (or at least some equivalently powered algorithm).
> Are there any good online resources to describe this transition?

Well, I guess there is no 'standard way' of implementing LALR(1)
parsing algorithms in practice (of course, I am not taking about the
theoretical methods). GNU Bison is a free LALR(1) parser generator
(written in C) and so is SableCC (written in Java); I guess you can
start by studying one of these. I have tried a bit to understand Bison
code myself and found it is not that easy. However, I was able to
document the internals of the LALR(1) parser (in C) generated by GNU
Bison - . This article
compares the standard algorithms published in books with a real world

Hope that helps.


Post a followup to this message

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