Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Books About Parsing (reverberate.org)
35 points by mbrubeck on June 29, 2009 | hide | past | favorite | 6 comments


The "A Regular Expression Matcher" in Beautiful Code is a command-line wildcard matcher (from memory), and lacks parentheses and alternation. Useful, and probably an ideal example for the book, but much less powerful even than a mathematical regular expression.

See for yourself: http://books.google.com/books?id=gJrmszNHQV4C&lpg=PA1...


Still very cool though, thanks for the link.


I think you will learn much faster about parsing if you just read source code. Once you have looked at more then two implementation of the same thing you start to see similarities and differences and pick up the ideas in use.


Sounds like a theory rather than something you're tried. :-)

You might be right, but regular expressions (for example) are one of those relatively rare tools in computer science that are both very practical and very theoretical - difficult to grasp without understanding the concepts. Personally, I did have a (brief) look some source code (for parsing particles for the XML Schema in Xerces; and the perl-style regex library in Java), but they really didn't make much sense until I went back to the Dragon book. Maybe if I'd spent more time on the source code, and looked at many more examples, and also mixed in some less sophisticated examples, it would have also become clearer... but I really don't think so. You need the ideas that the code is trying to implement, in addition to seeing the surface code. Regular expressions, and implementations of Thompson's powerset algorithm are really hard to understand even with the concepts.

But like I said, you could be right. Why not try out your approach, to test it as a hypothesis, and let us know how you went, with a "Tell HN: learning parsing by reading source code" submission?


Possibly faster-- but will you learn as thoroughly? Are you really in so much of a hurry that reading Knuth's papers is a waste of time?


or just use sexps ... and you are done.




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: