Instructor: Amitabha Sanyal
Last updated on: 12th February, 2003.
2002-2003
2001-2002
Clarifications
1. Why is a compiler called a compiler? The first paragraph of this link , which briefly describes the history of language processing, tells you why.
2. How much of the symbol table information does a language with dynamic scoping have to carry at runtime? This brief note will give you an idea. Is the note clearly written? Inform me if you have difficulties understanding it.
This is an outline of the course, that I, along with Prof. Biswas and Prof. Dhamdhere, had designed in the year 1994 as part of project IMPACT.
Here are the slides and lecture notes on some of the topics.
Here are my own notes on lex
and yacc.
Here are quite a few examples of lex
scripts and yacc
scripts.
Here is a list of references. I shall modify it in due course of time, since quite a few recent references have not been added and some of the references are old.
The first book will be our main text. You are strongly urged to buy a copy for yourself. It does an excellent job of lexing, parsing (minus error recovery), static semantics and runtime environments. However, it deals with register allocation and code generation in a sketchy fashion. Does a moderately good job of code optimization. There is an Indian edition available for some time now.
1. Aho, A.V., R. Sethi and J.D. Ullman (1986) : Compilers - Principles, Techniques and Tools, Addison-Wesley, Reading.
This is an affordable book which has a "hands on" flavour. It deals with a few topics which the earlier book does not talk about.
2. Andrew W. Appel, Modern Compiler Implementation in C. Cambridge University Press (1998), pp. 544,
The following book describes the actual implementation of a compiler. Combines theory with a great deal of implementational details in a remarkable way.
3. Christopher N. Fraser and David R Hanson: Retargetable C compiler, design and implementation
4. Fischer, C.N. and R.J. LeBlanc (1988) : Crafting a compiler, Benjamin/Cummings, Menlo Park, California.
The next book has more code than text.
6. Holub, A.I. (1993): Compiler Design in C. Prentice-Hall, Englewood-Cliffs.
For people with more than a passing interest in Lex & Yacc.
7. Levine, J.R., T. Mason and D. Brown (1990): Lex and Yacc, edition, O'Reilly & Associates, Sebastopol.
The next book has now become the standard reference on compiler back ends. There is an Indian edition and some of you may want to buy it.
8. Steven S. Muchnick: Advanced Compiler Implementation. Harcourt Asia Private Ltd, 2000.
We shall be referring to some papers too. Here are some of them.
9. Sethi, R. and J.D. Ullman (1970): The generation of Optimal Code for Arithmetic Expressions, Journal of the Association for Computing Machinery, Vol. 17, No. 4, pp 715-728.
10. Aho, A.V. and S.C. Johnson
(1974): Optimal Code Generation for Expression Trees, Journal of the
Association for Computing
Machinery, Vol. 23, No. 3, pp 488-501.
11. Chow, F. and J.L. Hennessy (1990): The priority based coloring approach to register allocation, ACM Transactions on Programming Languages and Systems, vol. 12, No. 4, pp 501-536.