Final Exam Topics
CS 536, Fall 2004
Basic ideas of scanning and parsing
- including, e.g., writing a CFG for a language, but not including LL(1)
parsing
Symbol-Table Management
- static scoping
- scoping rules for Java vs for C--
- identifying multiply declared names
- matching uses to corresponding declarations
- implementation: list of hashtables and hashtable of lists
how the two approaches work, trade-offs in efficiency, extending the
approaches to handle new language constructs
- dynamic scoping
- matching uses to corresponding declaration
Type Checking
- type checking the constructs of the language used for the project
- extensions to handle new constructs
Runtime Storage Management
- general storage layout (stack, heap, static data area)
- activation records
manipulation of activation records on:
- method call
- method entry
- method return
- access to non-local variables
- for parameters, locals, globals
- access links and displays for languages with nested subprograms
Parameter-Passing Modes
- call-by-value
- call-by-reference
- call-by-value-result
- call-by-name
both from a language-design point of view and a compiler-writer's point of view
Code Generation
- generating code for the constructs of the language used for the project
- extensions to handle new constructs
- numeric and control-flow approaches to generating code for boolean expressions
Optimization
- goals (safety and profitability)
- peephole optimizations
- copy propagation
- loop optimizations
- moving loop-invariant computations out of the loop
- strength reduction in for loops