Re: What IS an LL/LR/SLR/LALR etc. grammar?

JPA <paul.janssens@skynet.be.NOSPAM>
21 Feb 1999 21:37:17 -0500

          From comp.compilers

Related articles
What IS an LL/LR/SLR/LALR etc. grammar? joe.hotchkiss@gecm.com (Joe Hotchkiss) (1999-02-18)
Re: What IS an LL/LR/SLR/LALR etc. grammar? dwight@pentasoft.com (1999-02-21)
Re: What IS an LL/LR/SLR/LALR etc. grammar? paul.janssens@skynet.be.NOSPAM (JPA) (1999-02-21)
Re: What IS an LL/LR/SLR/LALR etc. grammar? bromage@cs.mu.OZ.AU (1999-02-21)
Re: What IS an LL/LR/SLR/LALR etc. grammar? jamz@my-dejanews.com (1999-02-24)
Re: What IS an LL/LR/SLR/LALR etc. grammar? mslamm@mscc.huji.ac.il (Ehud Lamm) (1999-02-24)
| List of all articles for this month |
From: JPA <paul.janssens@skynet.be.NOSPAM>
Newsgroups: comp.compilers
Date: 21 Feb 1999 21:37:17 -0500
Organization: Belgacom Skynet SA/NV
References: 99-02-099
Keywords: parse

LL,LR,SLR and LALR are parsing methods. If a grammar can be parsed by
that method, it is also called LL,LR,SLR or LALR (k).


LL(k) means a top-down parser can be created for the parser with a max
lookahead of k symbols.
LR(k) means a bottom-up parser can be created for the parser with a max
lookahead of k symbols.




LALR(1) grammars are a subset of LR(1) grammars, requiring smaller
parsing table. (speed up gain vs. complication of error reporting and
recovery).


SLR(1) parsing is a hack of LR(0) parsing: you attempt to construct a
LR(0) parser for it, and if there are only minor glitches, you slap on
some extra control.


Because these parsing processes are rather complex, it's a lot of work
to check if a grammar is LR(k),SLR(1) or LALR(1)




Theory and Practice of Compiler Writing, by Tremblay and Sorenson,
McGraw Hill, is an in-depth work, but not for the technically
challenged.




JPA


Post a followup to this message

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