Course Description
Design and implementation of compilers for high-level programming languages. Topics include all phases of a typical compiler, including scanning, parsing, semantic analysis, intermediate code generation, code optimization, and code generation. Students design and develop a compiler for a small programming language. Emphasis is placed on using compiler development tools.
Additional Requirements for Graduate Students:
Graduate students additionally concentrate on more difficult aspects of compiler development, such as advanced code optimization. Their compiler projects cover a larger programming language with additional data types and/or statements.
Athena Title
Compilers
Undergraduate Prerequisite
CSCI 4720
Graduate Prerequisite
CSCI 6720
Semester Course Offered
Not offered on a regular basis.
Grading System
A - F (Traditional)
Course Objectives
1. Define the phases of a typical compiler, including the front- and back-end. 2. Identify tokens of a typical high-level programming language; define regular expressions for tokens; design and implement a lexical analyzer using a scanner generator. 3. Explain the role of a parser in a compiler; apply an algorithm for a top-down and a bottom-up parser construction. 4. Design and implement a parser for a small programming language using a parser generator; create a syntax tree. 5. Explain the role of a semantic analyzer and type checking; create a syntax-directed definition and an annotated parse tree. 6. Explain the role of different types of runtime environments and memory organization for the implementation of typical programming languages. 7. Describe the purpose of translating to intermediate code in the compilation process; design and implement an intermediate code generator.
Topical Outline
1. Compiler fundamentals a. Identify the role of compilers in computing. b. Contrast the source code and the target code (low-level code). c. Identify and explain the purpose of the phases of a typical compiler. 2. Lexical analysis a. Identify and create regular expressions for classes of tokens in typical programming languages. b. Apply scanner generator construction algorithm for a set of tokens. c. Design and implement a lexical analyzer for a small programming language. 3. Parsing a. Parse input string using context-free grammar; create a parse tree for input string derivations. b. Define and apply a top-down parsing algorithm. c. Define and apply a bottom-up parsing algorithm. d. Design and implement a parser for a small programming language. e. Define syntax errors and design and implement syntax error detection and recovery. f. Design and implement the creation of a syntax tree for a small programming language. 4. Semantic analysis a. Define the role of a semantic error analyzer. b. Define semantic errors for a small programming language. c. Define the role of a symbol table; design and implement. d. Design and implement a semantic analyzer for a small programming language. 5. Runtime environments a. Explain the role of a runtime environment for executing programs. b. Differentiate stack and heap allocation. 6. Intermediate code generation a. Describe the role of intermediate languages and syntax-directed translation. b. Define the types of intermediate languages. c. Design a strategy for memory allocation. d. Describe the role and types of code optimization. e. Design and implement an intermediate code generator for a small programming language.
Syllabus