COP5621 Exam and Grading Information
*Laboratory assignments include homework exercises and programming assignments.
| Exam |
Date |
Time |
| Exam 1 |
1/31 |
11:00AM - 12:15PM |
| Exam 2 |
2/21 |
11:00AM - 12:15PM |
| Exam 3 |
3/28 |
11:00AM - 12:15PM |
| Final |
4/26 |
12:30PM - 2:30PM |
| 94-100% |
A |
87-89% |
B+ |
77-79% |
C+ |
67-69% |
D+ |
0-59% |
F |
| 90-93% |
A- |
83-86% |
B |
73-76% |
C |
63-66% |
D |
|
|
80-82% |
B- |
70-72% |
C- |
60-62% |
D- |
Exam 1 Study Material
- Textbook chapters 1, 2 (2.1-2.9), and 3 (3.1-3.9).
- JVM Specification 2nd ed. Sections 1.1-1.2, 3.1-3.6, 3.11, 4.1-4.9, and 6.1-6.4.
- Lecture notes.
The knowledge and techniques you should master include (but are not limited to) the following:
- The structure of a compiler: compiler phases and passes
- The analysis-synthesis model
- Definition of a context-free grammar: terminals, nonterminals, productions, start symbols
- Derivations and sentential forms
- Parse trees
- Ambiguity problem, operator associativity, and operator precedence
- Syntax-directed translation: attributes and semantic rules
- Translation schemes with semantic actions
- Recursive descent (predictive) parsing
- Using FIRST to write a recursive descent parser
- Left factoring and left-recursion elimination
- Handling identifiers and keywords with symbol tables
- Abstract stack machines
- The basics of the JVM
- Interaction between the lexical analyzer and parser
- Definition of tokens, token attributes, patterns, lexemes, alphabets, strings, and languages
- Operations on languages
- Regular expressions and notational shorthand
- Regular definitions
- Transition diagrams: how to construct and code a scanner based on regular definitions
- The Lex/Flex specification
- Definition of NFA, DFA, transition graph, transition table
- Thompson's construction algorithm
- NFA simulation with e-closure and move
- Subset construction algorithm
- Minimizing the number of states of a DFA using the partition algorithm
- Converting a regular expression into a DFA directly
- NFA/DFA time-space tradeoffs
Exam 2 Study Material
- Textbook chapter 4, excluding (1st ed) section 4.6 "Operator Precedence Parsing" and (1st ed) section 4.7 parts "efficient construction of LALR parsing tables" and "compaction of LR parsing tables".
- Lecture notes.
The 2005 exam is available here.
The knowledge and techniques you should master include (but are not limited to) the following:
- Position of the parser in the front-end of the compiler model
- Importance of error handling, the viable prefix property, and error recovery strategies
- Grammars, deriviations, parse trees, and the Chomsky Hierarchy
- General and immediate left-recursion elimination
- Left factoring
- FIRST and FOLLOW
- Constructing an LL(1) parse table
- LL parsing and error recovery
- Shift-reduce parsing
- Constructing the set of LR(0) items using closure and goto
- Constructing an SLR parse table
- Constructing the set of LR(1) items using closure and goto (for canonical LR(1) and LALR(1) parse tables)
- Constructing canonical LR(1) and LALR(1) parse tables
- LR parsing and error recovery
- Subset relationship between LL(1), SLR(1), LR(1), and LALR(1) grammars
- Proving that a grammar is LL(1), SLR(1), LR(1), or LALR(1)
- Resolving shift/reduce conflicts with operator precedence and associativity
- The Yacc specification of a grammar
- Combining Yacc/Bison with Lex/Flex
Exam 3 Study Material
- Textbook sections 5.1 to 5.5, 6.1 to 6.4, 8.1 to 8.4, 8.6, and 8.7 (1st ed)
- Lecture notes.
The 2005 exam is available here.
The knowledge and techniques you should master include (but are not limited to) the following:
- Syntax directed definitions.
- Attribute grammars.
- Attribute dependence graphs.
- Parse tree evaluation methods for attributes.
- S- and L-attributed grammars.
- Top-down parsing with S- and L-attributed grammars.
- Bottom-up parsing with S- and L-attributed grammars.
- Translation schemes.
- Using marker nonterminals in translation schemes.
- Eliminating left recursion from translation schemes.
- Static checking versus dynamic checking.
- Type checks, flow-of-control checks, uniqueness checks, name-related checks.
- Type expressions and type representations.
- Structural equivalence versus name equivalence of types.
- Using Post systems to define type rules (don't need to memorize specific type rules).
- Syntax-directed definitions for constructing type graphs.
- Syntax-directed definitions for type checking.
- Syntax-directed definitions for type coercion.
- Syntax-directed definitions to compute lvalue/rvalue properties.
- Intermediate code representations, pros and cons.
- Symbol tables and data structures to support scoping rules.
- Three address code generation of expressions in scope.
- Three address code generation of array indexing.
- Three address code generation of function calls.
- Three address code generation of relational operators.
- Backpatch lists to support code generation of short-circuit operators.
Exam 4 (Final) Study Material
- Textbook sections 7.1-7.6, 9.1-9.9, 10.1-10.5 (1st ed)
- Lecture notes.
The 2005 exam is available here.
The knowledge and techniques you should master include (but are not limited to) the following:
- Activation trees
- Control stacks
- Activation records (subroutine frames)
- Allocation of activation records
- Control links
- Access links
- Calling sequences and parameter passing
- Scope rules and bindings
- Target code generation
- Instruction cost issues
- Addressing modes
- Instruction selection
- Basic blocks
- Control flow graphs
- Next-use information
- A simple code generator based on getreg()
- Register allocation and assignment
- Register allocation with graph coloring
- Peephole optimization
- Constant folding
- Constant combining
- Strength reduction
- Constant propagation
- Common subexpression elimination
- Global common subexpression elimination
- Backward copy propagation
- Dead code elimination
- Forward copy propagation
- Code motion
- Loop strength reduction
- Induction variable elimination
- Dominators and dominator trees
- Natural loops
- Reducible and irreducible loops
- Preheaders
- Global data flow analysis
- Dataflow equations for reaching definitions (gen, kill, in, out)