Re: Compiler textbook available online (Torben =?iso-8859-1?Q?=C6gidius?= Mogensen)
26 Mar 2007 09:21:16 -0400

          From comp.compilers

Related articles
[2 earlier articles]
Re: Compiler textbook available online (=?ISO-8859-1?Q?J=FCrgen_Kahrs?=) (2007-03-17)
Re: Compiler textbook available online (Computer Wizard) (2007-03-19)
Re: Compiler textbook available online (2007-03-19)
Re: Compiler textbook available online (2007-03-19)
Re: Compiler textbook available online (Tommy Thorn) (2007-03-21)
Re: Compiler textbook available online (Uncle Noah) (2007-03-23)
Re: Compiler textbook available online (2007-03-26)
| List of all articles for this month |

From: (Torben =?iso-8859-1?Q?=C6gidius?= Mogensen)
Newsgroups: comp.compilers
Date: 26 Mar 2007 09:21:16 -0400
Organization: Department of Computer Science, University of Copenhagen
References: 07-03-060 07-03-068 07-03-081 07-03-086
Keywords: books, parse, LALR
Posted-Date: 26 Mar 2007 09:21:16 EDT

"Uncle Noah" <> writes:

> Personally, i've never taken a course
> to deal with DFAs and NDFAs not to mention lexical/syntactical
> analysis (i've a B.Sc. on Physics, and my M.Sc. was more on an
> electronics theme). I use lex/yacc for 6 years know, have produced
> more than 20-30 frontends for a variety of input languages. I believe
> that many people since the introduction of lex and yacc in 1975 can
> live well without frontend theory.

While it is possible to use Lex/Yacc without knowledge of the theory,
I find that it helps enourmously when you want to get rid of conflicts
in parse tables if you do know a bit of the theory. My book stops at
SLR (where most books that cover LR parsing also cover at least
LALR(1)) because I think SLR theory is sufficient to help you get rid
of conflicts in LALR(1) parsers -- LALR(1) gives you fewer conflicts
tnan SLR, but if what you want is to get rid of the errors you get
even with LALR(1), SLR theory is enough. After all, you rarely plan
you grammar in advance to make it free of conflicts, you typically
just write your grammar in its simplest form and then add precedence
declarations or rewrite until you get rid of the conflicts.

But I agree that you might not need to remember _all_ the theory
required to build a parser generator. For example, you won't need to
remember how FOLLOW sets are calculated, as long as you know what they
represent. And you don't need to remember how item sets are
constructed, as long as you understand the "." notation used for items
in the output from yacc etc. Even so, I find it useful to provide the
full theory, so students can see how it fits together, so the process
of eliminating conflicts is not all black magic.


Post a followup to this message

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