Teaching:
Principles of Programming Languages

I am teaching CSE340 again this summer. I have taught this class for two years –Summer 2015, Fall 2014, Summer 2014, Spring 2014, and Summer 2013. 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.

You could find links to follow my lectures and programming projects below. Topics included are:

  1. Introduction: abstractions; language paradigms; language definition; compilation versus interpretation.
  2. Lexical Analysis: regular expressions; deterministic finite automata.
  3. Syntax: BNF, EBF, syntax and diagrams; parse trees and abstract syntax trees; one-token look-ahead parsing; recursive- descent parsers;
  4. Basic Semantics: data Types and type matching; symbol tables; binding; scope; allocation and storage; variables; pointers.
  5. Intermediate Representation
  6. Programming Paradigms
  7. Object-Oriented Programming
  8. Functional Programming: functional algorithms; tail-recursion; lambda calculus – conversions, Church-Rosser theorem, fixed-points.
  9. Logical Programming: Horn clause logic, resolution and unification.

Lectures

Follow my lectures; I am posting my slides each week.

01 course presentation 02 introduction 03 lexical analysis 04 lexer (1/2)
05 lexer (2/2) 06 closing lexical analysis 07 syntactic analysis (1/2) 08 syntactic analysis (2/2)
09 grammars (1/2) 10 midterm review 11 parser (1/2) 12 parser (2/2)
13 parsing (1/3) 14 parsing (2/3) 15 parsing (3/3) 16 grammars (3/3)
17 semantic (1/3) 18 semantic (2/3) 18 semantic (3/3) 20 code (1/4)
21 code (2/4) 22 code (3/4) 23 code (4/4)

 
Assignments

There are four programming assignments in this course: a Lexical Analyzer, a Parser, a Semantics Analyzer and an Intermediate Code Generator. The four assignments bundled together result in a compiler for a custom programming language. An example the statements supported in the programming language designed in this course is shown in the picture. A GUI is provided to visualize the result of each stage: 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 intermediate code generated by the compiler.

A student (Rajesh Surana) creates a GitHub repository with the source code for the complete project. Take a look at his repository here.