CS322 Languages and Compiler Design II Spring 2012
- Office hour (in Linux Lab): Thursday 4pm
Course Information
Final Exam
Required Readings and Suggested Exercises
-
Check here for an up-to-date
list of errata for the 2nd. edition of Engineering a Compiler.
-
And here is a similar list for the 1st. edition.
Suggested Exercises
Problems from Engineering a Compiler. Numbers of exercises are given in the form
first-edition-number [second-edition-number]. In a few cases, the exercise is missing from
the second edition. Solutions (numbered as in the first
edition) are available here using
the user name "cs322" and the password given in class. Please do not copy the solution file or make any part of it visible on the open web.
-
Suggested exercises: 5.3.1 [5.3], 5.3.2 (the CFG) [5.4], 5.4.1 [5.5],
7.2.1 [7.1], 7.2.2 [7.3], 7.3.1 [7.4], 7.3.2 [7.5], 7.4.2 [7.8], 7.5.1 [7.9], 7.6.1 [7.12], 7.6.2 [-], 7.8.1 [7.16], 7.8.2 [7.17].
-
Additional Suggested exercises:
6.2.1 [6.1], 6.2.2 [6.2], 6.3.2 [6.5], 6.3.3 [-], 6.3.4 [6.6],
6.4.1 [6.9], 6.4.2 [6.8], 6.6.2 [6.11] , 6.7.1 [-], 6.7.2 [-],
7.9.1 [7.18], 7.9.2 [7.19], 7.10.2 [-], 8.3.2 [-], 8.4.1 [-],
9.2.1 [9.1], 9.2.2 [-], 9.2.3 [9.2], 13.3.1 [13.1], 13.4.1 [13.3].
Lecture Notes and Supporting Code
fab Language
- Reference Manual (pdf) (updated slightly from CS321 version) [REVISED 9Apr12 8am]
- Sample Programs [REVISED 9Apr12 8am]
Homework Assignments
- Homework 1 (due 4/24/12) (pdf)
- Homework 2 (due 5/3/12) (pdf)
- Homework 3 (due 5/29/12) (pdf)
- Complete Working Frontend frontend.jar
- Ast.java source code (bytecode is already in frontend.jar)
- Complete Working Solution (including generator and interpreter) ir.jar [REVISED 17May 7:50am]
- IR IR.java source code (bytecode is already in ir.jar) [REVISED 16May 4:40pm]
- Generator Driver (reads .fab file; writes.ir file) IRGenDriver.java (bytecode is already in ir.jar)
- New Interpreter Driver (reads and interprets .ir file) IRInterpFile.java (bytecode is already in ir.jar)
- Original Interpreter Driver (reads .fab file; translates to internal IR; interprets IR) IRInterpDriver.java (bytecode is already in ir.jar)
- Skeleton solution code IRGen0.java [REVISED 16May 4:40pm]
- IR grammar
- Homework 4 (due 6/7/12) (pdf)
x86-64 Resources
Note that this architecture goes under many different names, including
"AMD64" and "Intel 64". (But "IA-64" refers to a different architecture altogether,
the Intel Itanium.)
Warning: There are two assembler syntaxes in common use for the x86.
So-called AT&T syntax, used by the GNU assembler, uses the format
"opcode src,dst" whereas so-called Intel syntax, used by Microsoft's MASM
assmebler, uses the format "opcode dst,src". When trying to decode documentation,
make sure you know which format is being used!
Java Resources
- Language Reference
- User Manuals (for version 1.7)
- Documentation for Oracle/Sun's Java tools is here.
- The standard Java library (API) is documented here.
- Implementations
- A free implementation for linux or Windows is available from
here
- IDEs
- The eclipse IDE for Java Developers
is freely available for download on linux, Mac OS, and Windows.