CCOM 4087 - Compiler Design - Spring 2018

University of Puerto Rico
Rio Piedras Campus
College of Natural Sciences
Department of Computer Science


Field Value
Name Humberto Ortiz-Zuazaga
Office NCL A-159
Laboratory NCL A-158
Telephone 787-764-0000 x88363
Web page
Office hours Tuesday, Thursday 8:30-10:30 AM
or by appointment


3 credits


Introduction to compiling, structure of simple one-step compilers: syntax and lexical analysis, parsing, introduction to type checking, intermediate code generation, introduction to code generation and optimization. Discussion about tools for compilers design (e.g. Lex and Yacc).


  • High Level Programming Languages (CCOM 4029)
  • Computer Architecture (CCOM 4086)
  • Operating Systems (CCOM 4017)


  • Introduction to compiling

  • Simple one pass compilers

  • Lexical analysis

  • Symbol tables

  • Parsing

  • Syntax directed translation

  • Introduction to type checking and run time environment

  • Intermediate code generation

  • Introduction to code generation and code optimization

  • Discussion of tools in compiler design


  1. Understand how the design of a compiler requires most of the knowledge acquired during their study

  2. Develop a firm and enlightened grasp of concepts learned earlier in their study like higher level programming, assemblers, automata theory, and formal languages, languages, languages specifications, data structure and algorithms, operating systems and computer architecture.

  3. Develop an in–depth knowledge of major topics in compiler design.

  4. Develop a fundamental understanding of various stages of compiling.

  5. Apply the ideas, the techniques, and the knowledge acquired for the purpose of other software design

  6. Develop fundamental knowledge of language specifications using context free grammars (CFG).

Course Schedule

Class will meet Mondays and Wednesdays from 9:00 to 10:50 AM in NCL A-141. In UPR-RP attendance is compulsory.


Date Topic Reading Assignment
Mar 12 Introduction Ch 1 depython
Mar 19 Lexical Analysis Ch 2 lexer
Mar 26 - Apr 9 Parsing Ch 3 parser
Apr 9 Abstract Syntax Trees Ch 4
Apr 11 Semantic Analysis Ch 5 semantic
Apr 16-18 Travel No class
Apr 23 - May 9 Instruction Generation Ch 9 instructions
May 14 Stack Frames Ch 6
May 16 Intermediate Code Ch 7 intermediate
May 21 Basic Blocks and Traces Ch 8
May 23 Liveness Analysis Ch 10
May 28 Register Allocation Ch 11
May 30 Final Form Ch 12

Métodos alternos de enseñanza:

La Certificación Núm 112 (2014-2015) de la Junta de Gobierno define un curso presencial como un curso en el cual 75% o más de las horas de instrucción requieren la presencia física del estudiante y el profesor en el salón de clases. Esto quiere decir que 25% de un curso presencial, pudiera ofrecerse sin requerir la presencia física de los estudiantes y el profesor en el salón de clases. En caso de ser necesario, este curso podrá completar hasta 25% de las horas contacto (11.25 horas) de forma no presencial por métodos alternos como por ejemplo: Videoconferencias, módulos instruccionales, foros de discusión y cibercharlas entre otros. De ser así, se modificará el calendario/temario para incluir los temas que serán cubiertos por métodos alternos.

Instructional strategies

The professor will discuss each topic, students will complete a practical excercise for each compiler technique discussed in class.

Instructional resources

The course will be hosted on the UPRRP Moodle. Register and stay tuned for our polls and forum postings.


The text for the course will be Modern Compiler Implementation in ML by Andrew Appel. ISBN 0-521-60764-7

Students with no functional programming experience will probably need an additional text on Standard ML. I can suggest the free textbook by Robert Harper of CMU Programming in Standard ML, or the books ML for the Working Programmer or Elements of ML Programming


We will be writing our compiler in the functional programming language Standard ML. Several implementations are available, I recommend Standard ML of New Jersey. Check your package manager, or download the newest version.


Students work will be evaluated on a 100% basis with the standard curve.

  • Participation in course forums (online, classroom), 25% final grade
  • Homework, 25% final grade
  • Quizzes, 25% final grade
  • Compiler project, 25% final grade

Reasonable accomodations for students

Students with disabilities properly registered with the Office of Affairs for Persons with Disabilities Oficina de Asuntos para la Persona con Impedimento (O.A.P.I.) should notify the professor at the start of the semester. The professor will make reasonable accommodations to support the student, in consultation with OAPI.

Academic integrity

The University of Puerto Rico promotes the highest standards of academic and scientific integrity. Article 6.2 of the UPR Student Bylaws (Certification JS 13 2009–2010) states that “academic dishonesty includes but is not limited to: fraudulent actions, obtaining grades or academic degrees using false or fraudulent simulations, copying totally or partially academic work from another person, plagiarizing totally or partially the work of another person, copying totally or partially responses from another person to examination questions, making another person to take any test, oral or written examination on his/hers behalf, as well as assisting or facilitating any person to incur in the aforementioned conduct”. Fraudulent conduct refers to “behavior with the intent to defraud, including but not limited to, malicious alteration or falsification of grades, records, identification cards or other official documents of the UPR or any other institution.” Any of these actions shall be subject to disciplinary sanctions in accordance with the disciplinary procedure, as stated in the existing UPR Student Bylaws.

DISCLAIMER: The above statement is an English translation, prepared at the Deanship of Academic Affairs of the Medical Sciences Campus, of certain parts of Article 6.2 of the UPR Student Bylaws “Reglamento General de Estudiantes de la Universidad de Puerto Rico”, (Certificación JS 13 2009-2010). It is in no way intended to be a legal substitute for the original document, written in Spanish.


  1. Andrew W. Appel. (1998) Modern Compiler Implementation in ML. Cambridge University Press. ISBN 0-521-60764-7.

  2. Robert Harper. (2013) Programming in Standard ML. Carnegie Mellon University.

  3. L.C. Paulson (1996) ML for the Working Programmer, 2nd Edition. Cambridge University Press. ISBN 052156543X

  4. Ullman, J. D. (1994). Elements of ML programming. Prentice-Hall, Inc.. ISBN 0-13-184854-2

  5. Fischer, C. N., Cytron, R. K., & LeBlanc, R. J. (2009). Crafting a compiler. Addison-Wesley Publishing Company. ISBN 0136067050 9780136067054