The explanation was that it was to make it more affordable for us, although the prices were still high. Many publishers at the time did this, I'm not sure why. Off topic, but we had the 'International' edition of this book. Coding styles change over time, and definitely the popularity of languages has changed, but the theory is still just as useful. It's interesting that most of the content is still just as relevant today. This was a big help when learning and made compilers a lot more fun.
Compiler design in c code#
The dragon book covers a lot of ground, and is very interesting, but Holub's book is much more practical, with everything illustrated with real code examples (if my memory is correct). It made a good companion text to our main textbook, the dragon book. In fact I can't think of any C compilers at the moment that are using a generated parser/lexer. On the small "toy compiler"/hobbyist/experimentation side, there's TCC/OTCC, CC500 ( ), C4 ( ), SubC ( ), and many others, all based on RD parsers. EDG's front-end, used in Intel's and other commercial compilers, is also handwritten RD. On the "big, production-quality" side, gcc used a generated parser but moved to a handwritten RD-based one, and Clang always used RD. Parser/lexer generators also seem to have fallen out of favour for the creation of actual compilers, both big and small, at least for C-like languages techniques based on recursive-descent (RD) are quite popular now. It's a good if somewhat outdated book if you're interested mostly in parsing and lexing, but for all the claims it makes in the preface about being practical instead of theoretical and all the source code presented throughout, I found the lack of actual Asm code generation (or any mentions of this compiler being able to compile itself) disappointing.
Compiler design in c how to#
If you aren't interested in the nuts and bolts, you can just skip over the sections that discuss code.This book appears to be more of a "compiler-compiler design in C" it goes through how to write a lexer and parser generator, then writes a compiler using them, and I think the resulting compiler is a bit of a letdown: it does not much more than translate C into a linearised subset of C, and so the IMHO more "interesting" and important parts of the back-end like register allocation and instruction selection are completely absent. I've resolved the too-many-details problem, to some extent, by isolating the theoretical materials into their own sections, all marked with asterisks in the table ofcontents and in the header on the top of the page. One of the secondary reasons for learning how to build a compiler, however, is to learn how to put together a large and complex program, and presenting complete programs, rather than just the directly compiler-related portions of those programs, furthers this end. Similarly, a lot of the low-level details are more related to program implementation in general than to compilers in particular. It is my belief, however, that this detail is both critically important to understanding how to actually build a real compiler, and is missing from virtually every other book on the subject. The disadvantage of my approach is that there is, by necessity, a tremendous amount oflow-level detail in this book. I've found, however, that looking at an implementation-at any implementation-can be a very useful adjunct to understanding the theory, and the reader is well able to adapt the concepts presented here to alternate implementations. I make no claims that the code presented here is the only (or the best) implementation of the concepts presented. If a theoretical discussion isn't clear, you can look at the code that implements the theory. I have deliberately avoided mathematical notation, foreign to many programmers, in favor of English descriptions of the theory and using the code itself to explain a process. So, this book is built around working code that provides immediate practical examples of how given theories are applied. My basic premise is that the best way to learn how to write a compiler is to look at one in depth the best way to understand the theory is to build tools that use that theory for practical ends. This book presents the subject of Compiler Design in a way that's understandable to a programmer, rather than a mathematician.