CMPSC 160 Course Description

Department and Course Number: CMPSC 160

Course Title: Translation of Programming Languages

Total Credits: 4

Course Coordinator: Tevfik Bultan

Current Catalog Description

Study of the structure of compilers. Topics include: lexical analysis; syntax analysis including LL and LR parsers; type checking; run-time environments; intermediate code generation; and compiler-construction tools.

Prerequisites

CMPSC 130B and CMPSC 136

Textbook

Alfred V. Aho, Ravi Sethi and Jeffrey D. Ullman, "Compilers: Principles, Techniques, and Tools," Addison-Wesley, 1986.

Software Tools

JLex: A Lexical Analyzer Generator for Java
URL: http://www.cs.princeton.edu/~appel/modern/java/JLex

Java CUP parser generator
URL: http://www.cs.princeton.edu/~appel/modern/java/CUP/

Jasmin Java Assembler
URL: http://www.cat.nyu.edu/meyer/jasmin/

Course Goals

(1) To learn structure of compilers.

(2) To learn basic techniques used in compiler construction such as lexical analysis, top-down and bottom-up parsing, context-sensitive analysis, and intermediate code generation.

(3) To learn basic data structures used in compiler construction such as abstract syntax trees, symbol tables, three-address code, and stack machines.

(4) To learn software tools used in compiler construction such as lexical analyzer generators (JLex), and parser generators (Java CUP).

(5) To construct a compiler for a small language using the above techniques and tools.

Prerequisites by Topic

Automata theory and formal languages
Programming in Java
Data structures, algorithms, and complexity

Topics Covered in the Course

Laboratory projects

A four part programming project in Java. The goal is to incrementally build a compiler which translates programs written in a subset of Java to JVM assembly code (Jasmin). The input language does not have any object-oriented features and only allows integer and boolean variable types. The project involves using JLex lexical analyzer generator and JavaCUP parser generator. Parts of the project are:

Estimate CSAB Category Content

CSAB Category
CORE ADVANCED CSAB Category
CORE ADVANCED
Data Structures _ 0.5 Computer Organization and Architecture _ _
Algorithms _ 0.5 Concepts of Programming Languages _ 2
Software Design _ 1

Oral and Written Communications

Social and Ethical Issues

Students learn the impact of design decisions in programming languages to future generation of engineers.

Theoretical Content

Students review the following theoretical concepts in this course: regular expressions, DFAs, NFAs, context free grammars, regular, context-free and non context-sensitive languages. Students learn theoretical concepts such as LL, LR parsers, and attribute grammars.

Problem Analysis

Students learn how theoretical concepts such as finite automata, regular expressions and context-free grammars can be used in solving practical problems.

Solution Design

Students learn how using a modular design one can build complex software systems like compilers. Students learn how to build complex data structures such as abstract syntax trees using object-oriented design concepts.