Search code examples
parsingcompiler-theorycompiler-construction

Help understanding LR(1) parsers, table generation? Any other resources?


I am currently taking a compilers class and I am having a hard time understanding LR(1) parsing algorithms using the action/goto table and also how to hand generate these tables. Right now we are using Engineering a Compiler by Cooper and Torczon as our class text book and I have also read the wikipedia pages on table generation but I still do not understand the concepts. If possible can anyone recommend any other book that explains parsing well or an online resource? I would think many universities would have good online resources/slides on the subject but I have no idea on where to start looking. Thanks!


Solution

  • some decent lecture notes...

    http://cs.oberlin.edu/~jdonalds/331/lecture14.html

    Understanding and Writing Compilers has a section, What are the True Advantages of LR(1) Analysis?

    http://www.amazon.com/Understanding-Writing-Compilers-Yourself-Macmillan/dp/0333217322

    (also available freely online)

    Here is a link to a decent summary, although explanation is lacking.

    http://arantxa.ii.uam.es/~modonnel/Compilers/LR1Summary.pdf

    more lecture notes...

    http://www.cs.umd.edu/class/spring2011/cmsc430/lectures/lec07.pdf

    and notes here...

    http://cobweb.ecn.purdue.edu/~smidkiff/ece495S/files/handouts/w3w4bBW.pdf

    (including goto and action tables)

    Sorry I can't explain personally, I'm not too sure myself. Maybe you will find a kind, more knowledgeable soul around.