| Credit Hours: | 4, 4 |
| Course Coordinator: | Andrew Tolmach |
| Course Description: | Principles of programming languages and language implementation by compilation. Techniques of language definition. Run-time behavior of progrmas. Compilation by recursive descent. Use of LR compiler-generation tools. Design and implementation of a compiler for a small language. Prerequisites: CS 201, 202, 300, 311. |
| Prerequisites: | CS 201, 202, 300, 311. |
| Goals: | To give an in-depth understanding of the design and implementation of
programming languages and of their compilers. The CS 321/322 sequence
is centered around a substantial programming project: implementing a
complete compiler for a realistic language.
CS 321 describes formal methods for specifying the syntax and semantics of languages, and uses these methods to help build the compiler's front end. Programming language structure and capabilities are examined with an emphasis on understanding the demands of efficient implementation.
Upon the successful completion of this course students will be able to:
Upon the successful completion of this course students will be able to:
|
| Example Textbooks: | Compilers: Principles, Techniques, and Tools, Aho, Sethi, and Ullman, Addison-Wesley, 1986. |
| References: | Reference manuals for software tools; hardware architecture manuals. |
| Major Topics: | CS 321:
Language Design Issues Compiler Structure, symbol tables Lexical analysis theory and tools Syntax Analysis Data types Syntax-directed Translation Type checking Formal Semantics
CS 322:
|
| Laboratory Exercises: | CS 321: A complete frontend for a small but realistic language.
Project #1: Symbol tables (2 weeks) Project #2: Lexical analysis (2 weeks) Project #3: Parsing (3 weeks) Project #4: Type checking (3 weeks)
CS 322: A complete backend for the language of CS 301
|
| CAC Category Credits | Core | Advanced | |
| Data Structures | |||
| Algorithms | 1.0 | ||
| Software Design | 2.0 | ||
| Computer Architecture | |||
| Programming Languages | 5.0 |
| Oral and Written Communications: | None. |
| Social and Ethical Issues: | None. |
| Theoretical Content: | Finite automata and regular languages (2 weeks)
Context-free languages and parsing (3 weeks) Type systems (0.5 weeks) Operational and denotational semantics (1.5 weeks) Dataflow analysis (0.5 weeks) |
| Problem Analysis: | None. |
| Solution Design: | Many of the lab projects require significant design of data structures and algorithms for parts of the compiler project. |