Mail Archives: djgpp/1998/07/13/02:45:29
Brett Porter wrote:
> It was fantastic learning how to use lex and yacc but didn't do much
> in terms of actions and code-generation: beyond the scope of the book
> really. I think I've got it down now, using "Introduction to Compiling
> Techniques" by JP Bennett. It uses Lex, Yacc and C to write a simple
> compiler, with all the source in the back of the book. Mine is
> slightly more complicated than the language they use, but it got me
> going. We'll see... any other good books would be appreciated.
"Compiler Design in C" by Allen I. Holub, Prentice Hall, ISBN
0-13-155151-5.
IMHO, this is an excellent book on compilers and compiler-compilers (ie
lex and yacc). It goes into the full nitty gritty of compiler operation
right from lexical analysis to optimising the output (a little skimpy on
the optimisation, but I didn't read that chapter fully), but presents
the information in a reasonably understandable way (Lots and lots of
examples). It has full source code to a version of lex, two parser
generators (one yacc like) and a buggy C compiler (deliberate, one of
the `assignments' is to fix it). You can by the source for somewhere in
the vicinity of $60US (1992) or you can sit there and type it in for a
month or two (I did:).
Bill
--
Leave others their otherness.
- Raw text -