A Complete Cb Compilation Example
| Phase | Language Class | Compelling Feature | Machine | Grammar | Described By | Software Tool |
|---|---|---|---|---|---|---|
| Scanning (aka tokenizing aka lexical analysis) | Regular Language | Just states | Finite State Machine (FSM) | Regular Grammar | Regular Expression | lex |
| Parsing | Context-Free Language | States plus a stack | Push-Down Automaton (PDA) | Context-Free Grammar | yacc |
Coding Examples
Coding an FSM as a switch
Coding a table-driven FSM
Lex Example
Yacc Example
Hashtable Example
Variable Declaration Processing
Error Processing
Argc-argv Example
Code Generation
The Program Body
Activation Record Construction
Arithmetic
Branches
Last modified: Mon Dec 4 14:02:49 MST 2006