Principles of Compiler Construction (CSE 340) at ASU

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.


Summer 2015


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:

  1. Course Presentation
  2. Introduction
  3. Lexical Analysis
  4. Lexer Implementation I
  5. Lexer Implementation II
  6. Closing with Lexical Analysis
  7. Syntactic Analysis I
  8. Syntactic Analysis II
  9. Grammars I
  10. Midterm Review
  11. Parser Implementation I
  12. Parser Implementation II
  13. Parsing Techniques I
  14. Parsing Techniques II
  15. Parsing Techniques III
  16. Grammars II
  17. Semantic Analysis I
  18. Semantic Analysis II
  19. Semantic Analysis III
  20. Intermediate Code I
  21. Intermediate Code II
  22. Intermediate Code III
  23. Intermediate Code IV


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)