This page contains the log of the topics that of the
CompilationLecture? for class EPITA 2006 (i.e., from January 2004 to
July 2004). The topic was started with the
FormalLanguagesLecture?;
see the
ThlLog2006.
- Week 1 January 19, RobertAnisko: Program generators, Introduction to Gperf, Flex, Bison
- Week 2, January 26, RobertAnisko: Tiger Samples, Fixing Yacc Conflicts
- Week 3, February 2: Fixing Yacc Conflicts
- Week 4, February 16th
- Week 5, March 1th
- Week 6, March 8th: History of Programming Languages
- Week 7, March 15th: History of Programming Languages
- Week 8, March 22th: Types and Type Checking
- Week 9, March 29th: T4 and History of Object Oriented Programming Languages
- Week 10, April 5th: Object Oriented Programming Languages and Eiffel
- Week 11, May 3rd: Intermediate Representation 1
- Week 12, May 24th: Intermediate Representation 2
- Week 13, June 7th: Instruction Selection and Subprograms
Week 1 January 19, RobertAnisko?: Program generators, Introduction to Gperf, Flex, Bison
- Introduction to scanner/parser generators
- Lex/Flex
- Yacc/Bison
- Introduction to Flex
- Scanning keywords
- Scanning integers: yytext
- Scanning identifiers: yytext + yyleng + yylval
- Identifier vs. keyword: the ``meta'' rules (longuest match, first rule)
- Using start conditions to handle the nested comments
- Using start conditions to handle escapes in strings
- Introduction to Bison
- Writing a simple grammar
- Writing calc: %left and so forth
- Dealing with ambiguous grammars: learn to read Bison's report
- Writing actions
- Interface Flex & Bison
- Write a flex scanner for arithmetics
- Write a bison parser for arithmetics
- Put pieces of calculator to work
Week 2, January 26, RobertAnisko?: Tiger Samples, Fixing Yacc Conflicts
- The Tiger language
- Syntax, expressions, functional flavor
- Chunks of declarations, recursion, mutual recursion
- Arrays, records, and references
- Sample programs
- print-tree
- queens
- merge
- Fixing the Dangling else Shift/Reduce:
cat >1-if.y <<-EOF
%%
exp:
"if" exp "then" exp
| "if" exp "then" exp "else" exp
| "exp"
;
%%
EOF
- Fixing the ternary operator Shift/Reduce
cat >2-ternary.y <<-EOF
%%
exp:
exp "?" exp ":" exp
| "exp"
;
%%
EOF
Week 3, February 2: Fixing Yacc Conflicts
Lectures notes are available in PDF.
- Melkior
- Fixing the Dangling else Shift/Reduce:
cat >1-if.y <<-EOF
%%
exp:
"if" exp "then" exp
| "if" exp "then" exp "else" exp
| "exp"
;
%%
EOF
- Fixing the ternary operator Shift/Reduce
cat >2-ternary.y <<-EOF
%%
exp:
exp "?" exp ":" exp
| "exp"
;
%%
EOF
- Understanding the mysterious Reduce/Reduce
cat >3-promac.y <<-EOF
%%
sentence:
"proc" argument '.' | "proc" parameter ';'
| "macro" argument ';' | "macro" parameter '.' ;
argument: "id";
parameter: "id";
%%
EOF
- Fixing Reduce/Reduce problems: lvalues
cat >5-lvalues.y <<-EOF
%%
exp:
typeid "[" exp "]" "of" exp
| lvalue
;
lvalue:
"id"
| lvalue "[" exp "]"
;
typeid:
"id"
;
%%
EOF
- Autoconf: tc/configure.ac
- Automake: tc/src/Makefile.am, tc/src/type/Makefile.am
- Tracking Locations with Flex.
Week 4, February 16th
Week 5, March 1th
Week 6, March 8th: History of Programming Languages
- Template specialization.
- Traits.
- Using Traits to factor const and non const visitors.
Week 7, March 15th: History of Programming Languages
See the lecture notes,
http://www.lrde.epita.fr/~akim/compil/lecture-notes/history.pdf.
- Computing Chronology.
- Eniac.
- The Baby.
- Ferranti Pegasus & autocode
- IBM 704 & FORTRAN I
- Algol.
- COBOL.
- PL/I
- BASIC.
- Pascal and its family.
Week 8, March 22th: Types and Type Checking
See the lecture notes,
http://www.lrde.epita.fr/~akim/compil/lecture-notes/type-checking.pdf.
- Why using Types
- Type Kinds
- Atomic types
- Composed types
- Variants/Unions
- Genericity
- Types Behavior
- Equivalence
- A Grammar for Types
- Subtyping vs. subclassing
- Tiger Type checking
- A Grammar for Types
- A TypeVisitor
- A TypeEnvironment
- Typechecking a simple expression
- Typechecking an OpExp
Week 9, March 29th: T4 and History of Object Oriented Programming Languages
See the lecture notes,
http://www.lrde.epita.fr/~akim/compil/lecture-notes/object.pdf.
- Design Issues
- The /Template Method/ Design Pattern
- The static /Template Method/ using /method templates/ and
template specialization
- Tiger Type Checking
- Type-checking type declarations
- The
list type
- Mutually recursive types
- Multiple definitions
- Type-checking function declarations
- Implementing Header/Body visits generically
- Object Oriented Programming Languages History
- Simula
- Smalltalk
- C++
Week 10, April 5th: Object Oriented Programming Languages and Eiffel
See the lecture notes,
http://www.lrde.epita.fr/~akim/compil/lecture-notes/object.pdf and
http://www.lrde.epita.fr/~akim/loo/eiffel.pdf.
- Bad Properties from OO Languages
- Eiffel
Week 11, May 3rd: Intermediate Representation 1
See the lecture notes,
http://www.lrde.epita.fr/~akim/compil/lecture-notes/intermediate.pdf
- Intermediate Representations
- High Level Representation
Week 12, May 24th: Intermediate Representation 2
See the lecture notes,
http://www.lrde.epita.fr/~akim/compil/lecture-notes/intermediate.pdf
- High Level Representation
- Low Level Representation
Week 13, June 7th: Instruction Selection and Subprograms
See the lecture notes,
http://www.lrde.epita.fr/~akim/compil/lecture-notes/instr-selection.pdf and
http://www.lrde.epita.fr/~akim/compil/lecture-notes/subprograms.pdf.
- Instruction Selection
- Subprograms
to top