I taught Principles of Programming Languages (CSE340) this summer. I have taught this class for two years –Summer 2015, Fall 2014, Summer 2014, Spring 2014, and Summer 2013. In CSE 340 we define an structural programming language and implement a compiler for it while studying theoretical foundations for several programming paradigms including formal lexical, syntactic and semantic descriptions, compilation and run-time issues.
Syllabus
Lectures
CSE340 has 28 lectures and includes the following topics:
concepts; lexical analysis; lexer implementation; syntactic analysis; parse tree, BNF, and syntax diagrams; grammars; parser; error synchronization; error recovery; first and follow sets; chomsky hierarchy; semantic analysis; type matching; conditional expressions; and intermediate code. My slides for each lecture are available below:
- Course Presentation
- Introduction
- Lexical Analysis
- Lexer Implementation I
- Lexer Implementation II
- Closing with Lexical Analysis
- Syntactic Analysis I
- Syntactic Analysis II
- Grammars I
- Midterm Review
- Parser Implementation I
- Parser Implementation II
- Parsing Techniques I
- Parsing Techniques II
- Parsing Techniques III
- Grammars II
- Semantic Analysis I
- Semantic Analysis II
- Semantic Analysis III
- Intermediate Code I
- Intermediate Code II
- Intermediate Code III
- Intermediate Code IV
Assignments
There are four programming assignments: a Lexical Analyzer, a Parser, a Semantic Analyzer and an Intermediate Code Generator. The four assignments bundled together as a compiler for a custom programming language. An example of the statements supported is shown in the picture below. A GUI is provided to visualize each stage of the compilation process: a token table, a parse tree, a symbol table, and intermediate code; as well as a console (in black background) to display alerts and error messages.
Aditionally, a VM with a GUI is provided to test the execution of the generated intermediate code.
GitHub repository
javiergs/CSE340 (private)