CS/SE 153 Concepts of Compiler Design

Similar documents
CS/SE 153 Concepts of Compiler Design

CMPE 152 Compiler Design

CMPE 152 Compiler Design

CMPE 152 Compiler Design

CMPE 280 Web UI Design and Development

CMPE/SE 135 Object-Oriented Analysis and Design

CMPE 280 Web UI Design and Development

San José State University College of Science/Department of Computer Science CS 152, Programming Language Paradigms, Section 03/04, Fall, 2018

San José State University College of Science/Department of Computer Science CS152, Programming Paradigms, Sections 3 & 4, Fall Semester, 2016

San José State University Department of Computer Science CS166, Information Security, Section 1, Fall, 2018

San José State University Department of Computer Science CS-144, Advanced C++ Programming, Section 1, Fall 2017

CMPE 180A Data Structures and Algorithms in C++

San José State University College of Science/Department of Computer Science CS152, Programming Paradigms, Sections 1 & 2, Fall Semester, 2017

San José State University Department of Computer Science CS049J, Programming in Java, Section 2, Fall, 2016

San José State University Department of Computer Science CS-174, Server-side Web Programming, Section 2, Spring 2018

San José State University College of Science/Department of Computer Science CS152, Programming Paradigms, Sections 1 & 2 Spring Semester, 2018

San José State University Department of Computer Science CS151, Section 04 Object Oriented Design Spring 2018

San José State University Department of Computer Science CS151, Object Oriented Design, Section 04, Fall, 2016 (42968)

San José State University Computer Science Department CS49J, Section 3, Programming in Java, Fall 2015

Compilers. Computer Science 431

San José State University Department of Computer Science CS 166 / SE 166, Information Security, Section 4, spring, 2017

ECE573 Introduction to Compilers & Translators

San Jose State University College of Science Department of Computer Science CS151, Object-Oriented Design, Sections 1,2 and 3, Spring 2017

San José State University Computer Science Department CS157A: Introduction to Database Management Systems Sections 5 and 6, Fall 2015

San Jose State University College of Science Department of Computer Science CS151, Object-Oriented Design, Sections 1, 2, and 3, Spring 2018

San José State University Department of Computer Science CS-144, Advanced C++ Programming, Section 1, Spring 2018

Philadelphia University Faculty of Information Technology Department of Computer Science --- Semester, 2007/2008. Course Syllabus

San Jose State University - Department of Computer Science

AE Computer Programming for Aerospace Engineers

San José State University Computer Science CS 122 Advanced Python Programming Spring 2018

Computer Science Technology Department

San Jose State University College of Science Department of Computer Science CS151, Object-Oriented Design, Sections 1 and 2, Spring 2016

CS Compiler Construction West Virginia fall semester 2014 August 18, 2014 syllabus 1.0

BOSTON UNIVERSITY Metropolitan College MET CS342 Data Structures with Java Dr. V.Shtern (Fall 2011) Course Syllabus

Course and Contact Information. Course Description. Course Objectives

San José State University Department of Computer Science CS158B, Computer Network Management, Section 1, Fall 2016

INF 315E Introduction to Databases School of Information Fall 2015

CS 241 Data Organization using C

CS 3270 Mobile Development for Android Syllabus

San José State University College of Science / Department of Computer Science Introduction to Database Management Systems, CS157A-3-4, Fall 2017

B. Subject-specific skills B1. Problem solving skills: Supply the student with the ability to solve different problems related to the topics

IT 341 Fall 2017 Syllabus. Department of Information Sciences and Technology Volgenau School of Engineering George Mason University

CASPER COLLEGE COURSE SYLLABUS MSFT 1600 Managing Microsoft Exchange Server 2003 Semester/Year: Fall 2007

Course and Contact Information. Course Description. Course Objectives

Compilers for Modern Architectures Course Syllabus, Spring 2015

CSE4305: Compilers for Algorithmic Languages CSE5317: Design and Construction of Compilers

Web Programming Fall 2011

ECE Introduction to Compilers and Translation Engineering

Translator Design CRN Course Administration CMSC 4173 Spring 2017

Principles of Compiler Construction ( )

KOMAR UNIVERSITY OF SCIENCE AND TECHNOLOGY (KUST)

ISM 324: Information Systems Security Spring 2014

General Course Information. Catalogue Description. Objectives

Computer Science Technology Department

CSC 111 Introduction to Computer Science (Section C)

CSE4305: Compilers for Algorithmic Languages CSE5317: Design and Construction of Compilers

San Jose State University College of Science Department of Computer Science CS185C, NoSQL Database Systems, Section 1, Spring 2018

CSC 172 Data Structures and Algorithms. Fall 2017 TuTh 3:25 pm 4:40 pm Aug 30- Dec 22 Hoyt Auditorium

Computer Science Technology Department

ESET 349 Microcontroller Architecture, Fall 2018

Syllabus Revised 08/21/17

Course and Contact Information. Catalog Description. Course Objectives

Principles of Compiler Construction ( )

San Jose State University College of Science Department of Computer Science CS185C, Introduction to NoSQL databases, Spring 2017

CS157a Fall 2018 Sec3 Home Page/Syllabus

CS 3030 Scripting Languages Syllabus

Network Fundamentals and Design Fall Semester 2014

CS 0449 Intro to Systems Software Fall Term: 2181

CS 415 Midterm Exam Spring 2002

Spring 2018 El Camino College E. Ambrosio. Course Syllabus

CSCI 201L Syllabus Principles of Software Development Spring 2018

Developing Web Applications and Services Course Syllabus Fall 2015

Syllabus COSC-051-x - Computer Science I Fall Office Hours: Daily hours will be entered on Course calendar (or by appointment)

San José State University Department of Design / Industrial Design Program DSID 129, Visualization III, Section 02, Fall 2017

Introduction to Programming System Design CSCI 455x (4 Units)

COURSE SYLLABUS FOR. COMP-297 Web Page Design: Adobe Dreamweaver

Rochester Institute of Technology Golisano College of Computing and Information Sciences Department of Information Sciences and Technologies

ITSY Information Technology Security Course Syllabus Spring 2018

CS 3304 Comparative Languages. Lecture 1: Introduction

Translator Design CRN Course Administration CMSC 4173 Spring 2018

HOLY ANGEL UNIVERSITY COLLEGE OF INFORMATION AND COMMUNICATIONS TECHNOLOGY COMPILER THEORY COURSE SYLLABUS

CSE4305: Compilers for Algorithmic Languages CSE5317: Design and Construction of Compilers

Computer Science Technology Department

Syllabus CSCI 405 Operating Systems Fall 2018

Syllabus. ICS103: Computer Programming in C 2017 / 2018 First Semester (Term 171) INSTRUCTOR Office Phone Address Office Hours

CoSci 487 SYLLABUS Introduction to Networks

Compiling Techniques

CSE 114, Computer Science 1 Course Information. Spring 2017 Stony Brook University Instructor: Dr. Paul Fodor

Oklahoma State University Institute of Technology Face-to-Face Common Syllabus Fall 2017

CS 241 Data Organization. August 21, 2018

A: 90% - 100% B: 80% - <90% C: 70% - <80% D: 60% - <70% F: < 60% Important Dates:

BIRLA INSTITUTE OF TECHNOLOGY AND SCIENCE, Pilani Pilani Campus Instruction Division

BRAZOSPORT COLLEGE LAKE JACKSON, TEXAS SYLLABUS COSC 1320: INTRODUCTION TO C++ PROGRAMMING COMPUTER TECHNOLOGY & OFFICE ADMINISTRATION DEPARTMENT

15-411/ Compiler Design

Marshall University MTH 100 Syllabus

CMSC 132: Object-Oriented Programming II. Administrivia

Murach's HTML and CSS3 3 rd Edition By Boehm, Anne Fresno, Calif Publisher: Mike Murach & Associates, 2015 ISBN-13:

New York City College of Technology/CUNY Department of Computer Systems Technology. CST2400 Computer System Management and Support 4 hours 3 credits

Course Syllabus. NTM 2415 Cisco TCP/IP Routing Protocols & Router Configuration Cisco Networking Academy Cisco Semesters 1 & 2 Online Spring 2015

Programming 1. Outline (111) Lecture 0. Important Information. Lecture Protocol. Subject Overview. General Overview.

Transcription:

San José State University Department of Computer Science CS/SE 153 Concepts of Compiler Design Course and Contact Information Instructor: Ron Mak Office Location: ENG 250 Email: Website: Office Hours: Class Days/Time: ron.mak@sjsu.edu Classroom: MQH 222 Prerequisites: Course Format http://www.cs.sjsu.edu/~mak/ TuTh 3:00-4:00 PM TuTh 9:00-10:15 AM Section 1 Fall 2017 CS 47 or CMPE 102, CS 146, and CS 154 (with a grade of "C-" or better in each); Computer Science, Applied and Computational Math, or Software Engineering majors only; or instructor consent. This course will be taught primarily face-to-face instruction. Course materials, syllabus, assignments, grading criteria, exams, and other information will be posted on the SJSU Canvas course site at http://sjsu.instructure.com/ You are responsible to check Canvas regularly for class work and exams. You also can find Canvas video tutorials and documentations at http://ges.sjsu.edu/canvas-students Faculty Web Page and MySJSU Messaging Course materials such as syllabus, handouts, notes, assignment instructions, etc. can be found on my faculty web page at http://www.sjsu.edu/people/firstname.lastname and/or on Canvas Learning Management System course login website at http://sjsu.instructure.com. You are responsible for regularly checking with the messaging system through MySJSU at http://my.sjsu.edu to learn of any updates. Piazza will be available for announcements and to serve as an online discussion forum for the class. You are responsible for responding to enrollment invitations. Course Catalog Description Theoretical aspects of compiler design, including parsing context free languages, lexical analysis, translation specification and machine-independent code generation. Programming projects to demonstrate design topics. Course Goals Compiler construction. Design and build a working compiler for a programming language that you invented. Write sample programs in your language, compile your programs into byte code for the Java Virtual Machine to produce.class files, and then successfully run your programs on the JVM. CS 153 Concepts of Compiler Design, Fall 2017, Ron Mak Page 1 of 6

Software engineering. Employ the best practices of object-oriented design and team-based software engineering. A compiler is a large, complex program! Managing the development of such a program requires learning critical job skills that are highly desired by employers. Course Learning Outcomes (CLO) Upon successful completion of this course, you will be able to: Develop a scanner and a parser for a procedure-oriented programming language. Generate a symbol table and intermediate code. Perform semantic analysis such as type checking. Develop an interpreter that creates a suitable runtime environment from the intermediate code and the symbol table and executes the source program. Use a compiler-compiler to generate a parser and a scanner based on a written grammar for an existing programming language or an invented language. Develop a compiler that generates assembly language object code that can be assembled into executable code for a real or a virtual machine. Required Texts/Readings Textbook Title: Author: Publisher: ISBN: Source files: Title: Author: Publisher: ISBN: Writing Compilers and Interpreters, 3 rd edition Ronald Mak Wiley Publishers, Inc. 978-0-470-17707-5 http://www.cs.sjsu.edu/~mak/cmpe152/sources (both Java and C++ source files are available) The Definitive ANTLR 4 Reference Terence Parr Pragmatic Bookshelf 978-1934356999 http://www.antlr.org We will use the ANTLR 4 compiler-compiler during the second half of the course, so you won t need the ANTLR text until then. ANTLR 4 can generate compiler components written in either Java or C++. Other Readings We will use Pascal as an example source language during semester. These online Pascal tutorials are helpful: Pascal Tutorial looks very good. It even has an online compiler. Learn Pascal also looks good, although it doesn't appear to cover set types. CS 153 Concepts of Compiler Design, Fall 2017, Ron Mak Page 2 of 6

Course Requirements and Assignments You must have good Java programming skills and know how to use software development tools such as Eclipse. You will work during the semester in small four-person teams. Weekly assignments during the first part of the semester will provide practice with compiler design techniques and give students experience adding new features to a large legacy code base. During the latter part of the semester, each student team will develop a working compiler for an existing language or for a newly invented language. Teams will be able to write, compile, and execute programs written in their chosen or invented languages. This is a challenging course that will demand much of your time and effort throughout the semester. The university s syllabus policies: University Syllabus Policy S16-9 at http://www.sjsu.edu/senate/docs/s16-9.pdf. Office of Graduate and Undergraduate Programs Syllabus Information web page at http://www.sjsu.edu/gup/syllabusinfo/ The University s Credit Hour Requirement: Success in this course is based on the expectation that students will spend, for each unit of credit, a minimum of 45 hours over the length of the course (normally 3 hours per unit per week with 1 of the hours used for lecture) for instruction or preparation/studying or course related activities including but not limited to internships, labs, clinical practica. Other course structures will have equivalent workload expectations as described in the syllabus. Team Compiler Project Each student team will work on a compiler project throughout the semester. Each project involves: Choosing either an existing language (or subset of a language) or inventing a new language. Creating a grammar for the language. Generate a compiler for the language using the ANTLR compiler-compiler. Other components may be borrowed from the compiler code given in the class. An acceptable compiler project has at least these features: Two data types with type checking. Basic arithmetic operations with operator precedence. Assignment statements. A conditional control statement (e.g., IF). A looping control statement. Procedures or functions with calls and returns. Parameters passed by value or by reference. Basic error recovery (skip to semicolon or end of line). Nontrivial sample programs written in the source language. Generate Jasmin assembly code that can be successfully assembled. Execute the resulting.class file. CS 153 Concepts of Compiler Design, Fall 2017, Ron Mak Page 3 of 6

No crashes (e.g., null pointer exceptions). Each team will write a report (5-10 pp.) that includes: A high-level description of the design of the compiler with UML diagrams of the major classes. The grammar for your source language, either as syntax diagrams or in BNF. Code templates that show the Jasmin code your compiler generates for some key constructs of the source language. Final Examination Besides a final project from each team, there will be a written in-class final examination for each student. The exam will test understanding (not memorization) of the material taught during the semester and now well each you participated in your project team. Grading Information Each assignment will be worth 100 points. For each team assignment, each team member will receive the same score. Late assignments will be penalized 25% and an additional 25% for each subsequent day. Individual total scores will be computed with these weights: 30% Assignments 35% Compiler project 15% Midterm exam 20% Final exam Class grades will be based on a curve. The median total score will earn a B. Depending on how all the total scores cluster above and below the median, approximately one quarter of the class will earn higher grades, and another one quarter will earn lower grades. There can be no make-up midterm or final exams without a valid medical excuse. Postmortem report At the end of the semester, each student must also turn in a short (1 page) individual postmortem report that includes: A brief description of what you learned in the course. An assessment of your accomplishments for your project team on the assignments and the web application project. An assessment of each of your other project team members. Only the instructor will see these reports. How your teammates evaluate you may affect your class grade. Classroom Protocol It is very important for each student to attend classes and to participate. Cell phones in silent mode, please. University Policies Per University Policy S16-9, university-wide policy information relevant to all courses, such as academic integrity, accommodations, etc. will be available on Office of Graduate and Undergraduate Programs Syllabus Information web page at http://www.sjsu.edu/gup/syllabusinfo/. CS 153 Concepts of Compiler Design, Fall 2017, Ron Mak Page 4 of 6

CS/SE 153 Concepts of Compiler Design Section 1 Fall 2017 This schedule is subject to change with fair notice which will be communicated through emails and announcements via Canvas and Piazza. WCI = Writing Compilers and Interpreters, 3 rd edition ANTLR = The Definitive ANTLR 4 Reference, 2 nd edition Course Schedule Week Date Topics Readings 1 Aug 24 Overview of the course What are compilers and interpreters? A software framework for compilers and interpreters Form programming teams 2 Aug 29 Aug 31 3 Sept 5 Sept 7 4 Sept 12 Sept 14 5 Sept 19 Sept 21 6 Sept 26 Sept 28 7 Oct 3 Oct 5 8 Oct 10 Oct 12 9 Oct 17 Oct 19 10 Oct 24 Oct 26 11 Oct 31 Nov 2 Syntax diagrams Scanning (lexical analysis) Symbol table management Top-down recursive-descent parsing Parsing assignment statements and expressions Intermediate code (parse trees) Interpreting assignment statements and expressions Parsing control statements Parser error handling Interpreting control statements Runtime error handling Parsing declarations Parsing declarations, cont'd Semantic actions and type checking Scope and the symbol table stack Parsing programs, procedures, and functions Parsing procedure and function calls Runtime memory management The runtime stack and activation frames Passing parameters by value and by reference Interpreting Pascal programs Midcourse review Midterm exam Thursday, October 12 A simple DFA scanner BNF grammars for programming languages The ANTLR compiler-compiler WCI 1, 2, 3 WCI 4 WCI 5 WCI 5 WCI 6, 7 WCI 8, 9 WCI 9, 10 WCI 11, 12 WCI 12 ANTLR 1-4 Generating a scanner and a parser with ANTLR ANTLR 5, 6 The Java Virtual Machine (JVM) architecture Jasmin assembly language Code templates and code generation WCI 15 ANTLR 7, 8 CS 153 Concepts of Compiler Design, Fall 2017, Ron Mak Page 5 of 6

Week Date Topics Readings 12 Nov 7 Nov 9 13 Nov 14 Nov 16 Code for expressions Code for assignment statements Code for procedure and function calls Code to pass parameters by value and by reference Code for string operations 14 Nov 21 Code for control statements Code for arrays Code for records 15 Nov 28 Nov 30 16 Dec 5 Dec 7 Final Exam Tuesday Dec 19 Executing compiled Pascal programs Bottom-up parsing Lex and Yacc Code optimization Compiling object-oriented languages An interactive source-level debugger A multi-threaded GUI-based debugger Heap, stack, and garbage collection Course review Time: 7:15 9:30 AM Room: MQH 222 WCI 16 ANTLR 9 WCI 17 WCI 18 WCI 13, 14, 19 CS 153 Concepts of Compiler Design, Fall 2017, Ron Mak Page 6 of 6