East Carolina University
Department of Computer Science
CSCI 5220
Program Translation
Standard Syllabus
3 credits |
Prepared by Karl Abrahamson, May 2018 |
Catalog entry
P: CSCI 4627 or consent of instructor. Formal language specification
for programming languages. Advanced parsing techniques. Code
generation and optimization.
Course summary
This course covers both theory and practice of compiler construction.
Course topics
-
Overview of compiler structure
-
Regular expressions.
-
Lexical analysis. Tokens and lexemes.
Creating a lexical analyzer using Flex.
-
Context-free grammars. Derivations and parse trees.
-
Parsing, including top-down parsing by recursive descent
and LR parsing using Bison.
-
Attributes and attribute grammars. Syntax-directed
translation.
-
Intermediate code and intermediate-code generation
using syntax-directed translation.
-
Code optimization techniques as applied to intermediate code.
Student learning outcomes
-
Describe a set of strings using a regular expression
-
Construct a lexical analyzer using Flex
-
Distinguish between a token and a lexeme
-
Write a context-free grammar for a small language
-
Do derivations and create parse trees for
a given sequence of tokens and a given
context-free grammar.
-
Write a recursive-descent parser for a small grammar,
with elementary semantic processing
-
Determine FIRST and FOLLOW sets for a given grammar
-
Recognize and analyze an LL(1) grammar
-
Simulate a shift-reduce parser
-
Construct an SLR(1) finite-state machine
for a given grammar
-
Use Bison to create a parser for a given grammar
that create abstract syntax trees
-
Add semantic actions to a grammar to produce
intermediate code
-
Explain the purpose of control-flow analysis
-
Explain the purpose of data-flow analysis
-
Write an interpreter that simplifies abstract
syntax trees
Textbook
Compilers, principles, techniques and tools. Alfred V. Aho, Monica S. Lam,
Ravi Sethi, and Jeffrey D. Ullman., 2nd edition, Pearson Education, 2007.
Grading
Grading will be based on midterm exams, a final exam and
a major programming project. The midterm exams count a total of 36%,
the final exam 25% and the programming projects 39%.
Grade meanings
Grade |
Meaning |
A |
Achievement substantially exceeds basic course expectations |
A− |
|
B+ |
|
B |
Achievement exceeds basic course expectations |
B− |
|
B+ |
|
C |
Achievement adequately meets basic course expectations |
C− |
|
D+ |
|
D |
Achievement falls below basic course expectations |
D− |
|
F |
Failure – achievement does not justify credit for course |