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.


CMPSC 64 or ECE 154 and CMPSC 130A and CMPSC 138

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 (lex, flex), and parser generators (yacc, bison).

(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 C++
Data structures, algorithms, and complexity

Topics Covered in the Course

Laboratory projects

A five part programming project in C++. The goal is to incrementally build a compiler which translates programs written in a simple programming language x86 assembly. The input language does not have any object-oriented features and only allows integer and boolean variable types. The project involves using lex/flex lexical analyzer generators and yacc/bison parser generators. Parts of the project are:

Estimate CSAB Category Content

CSAB Category
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.