Compiler Compilers Resources - Programming On Unix

Users browsing this thread: 1 Guest(s)
Hi there,

I was wondering about the books you'd recommend to learn about tools like lex and yacc, and its different successors (i.e. bison, flex, byacc, maybe some other here...).

I've found a couple of books, plus the manpages are always one of the best resources (if not the best), but with things like compiler design and architecture, context-free grammars and lexical analysis, I think there's a lot to get wrong.

I'm not thinking about building a very complex compiler, with optimization engines and the like, just something simple to manipulate text and perform some operations and I considered it was a very good time to learn lex and yacc properly, instead of using the common stream manipulation tools available on Unices.

What do you think? What are your experiences?

See you around :)
Long time nixers
I do not know these tools, but I found these links over time:

- Flex (from lex) implementation:
- Invisible-Island, home of some of the tools you quoted:
- yasm (from nasm):
- nasm (assembler):
- explanations and book references:

Maybe you already know most of them. As I do not know these tools, I can not help much more...

If you want to have fun with a simple compiler (this one for C), you may have a look at scc development:
Long time nixers
A good yacc/lex guide is the tutorial from TLDP

With knowledge from the tutorial I made a program for window rules
You can see an example of a simple yacc grammar.
Long time nixers
"the unix programming environment" (in itself a book highly recommended) contains a description of developing a programmable calculator using lex and yacc in chapter 8.

mpu has compiled some resources for compiler writers here.

He also wrote miniyacc, whose repository contains some examples of yacc grammars.
Thanks for the resources guys, especially pranomostro@; those resources are very high quality.

I have that book in my reading list, but I never got to read it, sadly. I'll try to prioritize it for summer though (I need to finish The Practice of Programming in the first place hehe.)