The key question really is: at what level? I'm going to assuming a fairly introductory one if you're asking this question. I have only done one course on compilers, so perhaps my knowledge is too elementary, but here's what is useful to know:
- Basic 32-bit assembler, including how the stack works, and the usage of
ebp, and the different kind of
- Good understanding of data structures: trees, linked lists, and some of the common algorithms associated with them (binary search, for example)
- Basic understanding of complexity theory, mainly the big O notation
- Knowledge of basic regular expressions
To be perfectly honest, if you wanted to pick up any book on compiler theory and read it, then you should have read an introduction to compilers and preferably implemented something basic yourself (so you get a good idea from how it works: parsing source code, generating parse trees, to code generation). After that, you can look at optimisations (e.g.
age = 4 + 5 would be compiled directly as
age = 9, the
4+5 computation would be done once at compile time and never again).