UP to more information about CS2121

CS2121 "Implementation" Handouts

Detailed Contents, postscript (492K) gzipped postscript (164K)

Note: most of the handouts include optional exercises (but not answers!)

Lectures and Handouts Extras
(more about lex & yacc)
1 Representation and Meaning needs exercises & answers
Infix, Postfix and Prefix notations
2 Lex exercises & answers
Lex program for a postfix calculator
D: Example run of lex calculator
3 Yacc exercises & answers
Yacc program for an infix calculator
Yacc + Lex program for an infix calculator
E: Example run of yacc calculator
4 Yacc: Further usage exercises & answers
5 How lexers (e.g. from lex) and parsers (e.g. from yacc or Javacc) work exercises & answers
G: Left and Right recursion
6 Ambiguous and confusing grammars exercises & answers
H: More examples of Ambiguous and confusing grammars
I: More examples of shift/reduce and reduce/reduce conflicts with YACC
Bending grammars to your will
7 Parse Trees exercises & answers
Building parse trees for expressions
Greg Michaelson's lecture notes
8 Variables and Types exercises & answers (no answers!)
B: A small example C program being analysed
C: A small example - Parse Tree after Semantic Annotation
F: A larger example illustrating the Phases of Compilation - dictionary & parse tree
A much more detailed version of this lecture
9 Composing Programs exercises & answers
GoTo statement considered harmful or here
Flow diagrams, Turing Machines, and languages with only two formation rules
10 Putting it all together needs exercises & answers
A: Phases of compilation
[I need to check existing exercises and answers and create the missing ones.]