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:
- Introduction: abstractions; language paradigms; language definition; compilation versus interpretation.
- Lexical Analysis: regular expressions; deterministic finite automata.
- Syntax: BNF, EBF, syntax and diagrams; parse trees and abstract syntax trees; one-token look-ahead parsing; recursive- descent parsers;
- Basic Semantics: data Types and type matching; symbol tables; binding; scope; allocation and storage; variables; pointers.
- Intermediate Representation
- Programming Paradigms
- Object-Oriented Programming
- Functional Programming: functional algorithms; tail-recursion; lambda calculus – conversions, Church-Rosser theorem, fixed-points.
- Logical Programming: Horn clause logic, resolution and unification.
Follow my lectures; I am posting my slides each week.
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.