CS 370: Lecture Notes

separator
bar

A Complete Cb Compilation Example

Language Class Hierarchy

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

Tokenizers

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

Error Handling


Last modified: Mon Dec 4 14:02:49 MST 2006

Valid XHTML 1.0 Strict Valid CSS!