views:

243

answers:

4

It seems that parsing is a hard subject to learn. I was wondering what would be recommended as the very easiest books on the subject. The most basic, beginner, easiest books on parsing. Is there no parsing for dummies?

+2  A: 

Dragon Book is definitely not the easiest.
Yes. Its not the easiest. But then compiler design is also not easy.
Its the standard & most recommended book for Compiler Design in colleges.

N 1.1
Rotten recommendation when the request was for "easiest". There is time to deal with the full mathematical complexity later if desired.
dmckee
The math in the dragon book is not that hard. And if you do not understand it you should not be in the parsing field. It is a complicated subject, and believe it or not the Dragon Book is actually very good introductory text. Things get much more complicated when you go deeper.
Vlad
@dmckee: i thought someone would suggest otherwise :). so i removed the word `easy`
N 1.1
@Vlad: The math is *not* hard, but it is deep and complex and it takes *time* to digest, and that does not add up to a easy book anyway you look at it. And claiming that you shouldn't be parsing at all unless you understand it is nonsense. Certainly anyone who will be doing much parsing will want to learn the topic in depth. But that is not what was requested here.
dmckee
I might be dense, but I never made it through the Dragon Book. It can hardly be the easiest.
Amigable Clark Kant
+3  A: 

Few books cover just parsing, divorced from all other tasks that relate to developing compilers, but there are some -- out of the few I'd recommend this one, which has the substantial advantage that you can freely download the PDF for the first edition. (The second edition, which is for sale and I have not seen, appears to offer, as additions, mostly pretty advanced stuff and very updated surveys of very advanced academic literature -- probably stuff you don't really need as a beginner).

Alex Martelli
+3  A: 

The most commonly used parsing methods applicable to parsing data files and programming languages can be divided into two groups: top-down and bottom-up. For beginners, the top-down method also known as recursive descent parsing is generally easier to understand, so I would recommend you start with that.

The most hands on text for recursive descent parsing (and compiling) is Jack Crenshaw's online book/tutorial "Let's write a compiler". You can find it here:

The exercises/examples are written in Turbo-Pascal. You can use the free FreePascal compiler to compile and run them. You can find it at:

Once you have worked through Jack Crenshaw's text, I'd recommend the following book for it is very easy to read and hands-on as well:

  • Brinch Hansen on Pascal compilers, ISBN 0130830984

There is also Wirth's book "Compiler Construction" which is now freely available as a PDF from ETHZ's website at:

The PDF is a revised version of the 1996 edition which uses Oberon (a descendant of Pascal and Modula-2). Free compilers for Oberon are listed on DMOZ at:

trijezdci
+1  A: 

Check out chapters 10 & 11 of The Elements of Computing Systems.

Dinah