Principles and Practice of Compiling

COM S 440
  1. Credits and contact hours: 3 credits, 4 contact hours
  2. Instructor’s or course coordinator’s name: Hridesh Rajan/Andrew Miner
  3. Text book, title, author, and year: Compilers: Principles, Techniques, and Tools, 2nd edition, Aho, Lam, Sethi, and Ullman, 2006.; Programming for the Java Virtual Machine, Joshua Engel, 1999.
  4. Other supplemental materials: Lex & Yacc, Levine, Mason and Brown, 1992.; The Java Virtual Machine Specification, 2nd Edition, Lindholm and Yellin, 1999.; The Java Language Specification, 3rd Edition (The Java Series), Gosling, Joy, Steele, and Bracha, 2005.; The Jikes Java compiler,; Gnu Document Online, available from This Internet website provides documents for many software tools which include Make, Flex, Bison, GCC, GDB, Gnu C Library, Emacs, among others.

Specific course information

  1. Brief description of the content of the course: Theory of compiling and implementation issues of programming languages. Programming projects leading to the construction of a compiler. Projects with different difficulty levels will be given for 440 and 540. Topics: lexical, syntactic and semantic analyses, syntax-directed translation, code generation, runtime environment and library support.
  2. Prerequisites or co-requisites: COM S 331, COM S 342, ENGL 250, SP CM 212
  3. Required, elective, or selected elective? Selected Elective

Specific goals for the course

  1. Specific outcomes of instruction: Upon completion of this course, students will possess the following general skills and knowledge:
  • Thorough understanding of the overall architecture of a modern compiler. (2)
  • Being familiar with both top-down and bottom-up parsing paradigms.
  • Fluent with syntax-directed translation scheme and different compiler-compilers.
  • Knowledgeable with assembly language and code-block based code generation scheme.
  • Knowing the inner details of compilers, libraries, operating systems/platforms, and how they interact with each other to form modern computing environments. (6)
  • The experience and confidence of having developed a major software system with thousands of lines of code based on four years of CS training. (6)
  • Submit a written report on the project. (3)

Brief list of topics to be covered

  • Lexical analysis to recognize keywords in the source language (3 hours)
  • Symbol table to keep information gathered from the source language (3 hours)
  • Syntax analysis to understand the source language description (12 hours)
  • Semantic analysis to tell if the source language is meaningful (9 hours)
  • Code generation to turn the source language into machine codes (9 hours)
  • Code optimization to better translate the source language (3 hours)
  • Runtime libraries to support the execution of translated programs (3 hours)