CMPE 152 Compiler Design Section 4 (Seminar) Section 5 (Lab) Spring 2017

Similar documents
The University of Akron Department of Mathematics. 3450: COLLEGE ALGEBRA 4 credits Spring 2015

CS 261 C and Assembly Language Programming. Course Syllabus

Assessment for Master s Degree Program Fall Spring 2011 Computer Science Dept. Texas A&M University - Commerce

FI 630 Financial Management I

n Introduction n Art of programming language design n Programming language spectrum n Why study programming languages? n Overview of compilation

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

CS 301 Course Information

CSC 281 Automata and Algorithms Spring 2009

Drop Policy: A course drop grade will be assigned in accord with UTA policy (see current catalog).

Syllabus Introduction to C++ Programming and Numerical Analysis Spring 2016

IT 106 Introduction to IT Problem Solving Using Computer Programming revised

Business Ethics (BUS 105) Cycle II, Spring, 2012 Semester

SAMPLE ONLY. COMM 304 Interpersonal Communication Spring 2015 Tu/Th 11:00 12:20 ANN L101

MGSC 590 Information Systems Development Course Syllabus for Spring 2008

1.00 Lecture 1. Course information Course staff (TA, instructor names on syllabus/faq): 2 instructors, 4 TAs, 2 Lab TAs, graders

MATH 1310, SECTION 17086

CSCI 3136 Principles of Programming Languages

University of Regina Faculty of Business Administration Management of Performance. BUS Winter 2013: January 7, 2013 April 17, 2013

Syllabus: IST451. Division of Business and Engineering. Penn State Altoona

SYLLABUS: MKT , Monday evening 4:00-6:30pm; BU124 Spring Semester, 2012

ACG (10061) INTERMEDIATE THEORY III (3 credit hours) Tentative Syllabus spring 2012 Class hours: Wednesdays, 7:10 p.m. 10:00 p.m.

Computer Science Theory. From the course description:

Sample Syllabus (C++) CSCI 1301 Introduction to Programming Principles

Artificial Intelligence. Class: 3 rd

BRAZOSPORT COLLEGE LAKE JACKSON, TEXAS SYLLABUS ITSE 1432 INTRODUCTION TO VISUAL BASIC.NET PROGRAMMING

San José State University Department of Electrical Engineering EE 198B, Senior Design Project II, All Sections, Spring 2015

Syllabus Systems Analysis and Design Page 1 of 6

231 Consumer and Market Behavior Section 01 Summer 2015

University of Toronto Department of Electrical and Computer Engineering. Midterm Examination. CSC467 Compilers and Interpreters Fall Semester, 2005

Introduction to Information Technology ITP 101x (4 Units)

BUS4 118S Big Data San José State University Fall 2014

FINN Principles of Risk Management and Insurance Summer 2015

CSCI E 98: Managed Environments for the Execution of Programs

University of Colorado Denver College of Engineering & Applied Science CVEN 5235 Advanced Construction Engineering

This four (4) credit hour. Students will explore tools and techniques used penetrate, exploit and infiltrate data from computers and networks.

Philadelphia University Faculty of Information Technology Department of Computer Science First Semester, 2007/2008.

Syllabus -- Spring 2016 Juvenile Justice (CRJU CRN 7031)

INFM 700: Information Architecture

COURSE SYLLABUS PHILOSOPHY 001 CRITICAL THINKING AND WRITING SPRING 2012

SJSU School of Journalism and Mass Communications Journalism 132, Section 1 Information Gathering Spring 2015

ISM 4113: SYSTEMS ANALYSIS & DESIGN

ITS1100: Train the Trainer

College Algebra Online Course Syllabus

Dr. Gus C. Lease. Instructor: MUSIC BUILDING, Room 185. Office Location: 1/408/ Telephone:

The course assumes successful completion of CSCI E-50a and CSCI E-50b, i.e. at least two semesters of programming, with a grade of C- or better.

Scanning and parsing. Topics. Announcements Pick a partner by Monday Makeup lecture will be on Monday August 29th at 3pm

IST639 Enterprise Technologies Course Syllabus Spring 2014

Systems and Internet Marketing Syllabus Spring 2011 Department of Management, Marketing and International Business

MATHEMATICAL TOOLS FOR ECONOMICS ECON SPRING 2012

COMPUTER SCIENCE, BACHELOR OF SCIENCE (B.S.)

CS 2302 Data Structures Spring 2015

SYLLABUS MAC 1105 COLLEGE ALGEBRA Spring 2011 Tuesday & Thursday 12:30 p.m. 1:45 p.m.

02 B The Java Virtual Machine

SI 539, Winter 2014 Complex Web Design

Compiler I: Syntax Analysis Human Thought

Professor: Dr. Esra Memili Office: 370 Bryan Office Hours: Monday 2:00-6:00pm and 8:50-9:50pm, and by appointment

Technology and Online Computer Access Requirements: Lake-Sumter State College Course Syllabus

CS 300 Data Structures Syllabus - Fall 2014

Course Title: Advanced Topics in Quantitative Methods: Educational Data Science Practicum

Computer Science 1015F ~ 2010 ~ Notes to Students

TMGT W Principles of Cost Engineering Course Syllabus: Spring 2013 Online ecollege Course

University of Central Oklahoma Spring 2012 Undergraduate Course Syllabus. "Transforming Academic Excellence into Professional Competence"

SERP 523b: Braille 2 University of Arizona Department of Special Education, Rehabilitation and School Psychology Spring 2009

MGMT 280 Impact Investing Ed Quevedo

Programming Language Concepts for Software Developers

Eastern Washington University Department of Computer Science. Questionnaire for Prospective Masters in Computer Science Students

C Compiler Targeting the Java Virtual Machine

Eastern Washington University Department of Computer Science. Questionnaire for Prospective Masters in Computer Science Students

University of Florida at Gainesville Linguistics Program 4131 Turlington Hall LIN Introduction to Graduate Research

COMPUTER SCIENCE. FACULTY: Jennifer Bowen, Chair Denise Byrnes, Associate Chair Sofia Visa

Business Administration Online Course - Plagiarism and Fraud

Programming Language Pragmatics

CS 341: Foundations of Computer Science II elearning Section Syllabus, Spring 2015

Biology 45 ONLINE Introduction to Human Nutrition


PCA 342B, andia<at>post.harvard.edu, (305) Spring 2015

HISTORY OF PSYCHOLOGY PSY 4000 (40) ONLINE SPRING SEMESTER, 2015

Course Overview Principles of Project Management

Course Syllabus PEHR 2990 Intro to Intercollegiate Athletic Administration Dixie State College of Utah Spring 2013

Eastern Washington University Department of Computer Science. Questionnaire for Prospective Masters in Computer Science Students

How to make the computer understand? Lecture 15: Putting it all together. Example (Output assembly code) Example (input program) Anatomy of a Computer

Department of Computer & Information Sciences. CSCI-445: Computer and Network Security Syllabus

Course: ISYS 4373 Application Development with Java Prerequisite: ISYS 3293

Karen D.W. Patterson, PhD Office: ASM 2089 Telephone:

Computer Programming & Information Systems BCS451 Virtualization / Cloud Computing. Outline

English 3010IA: Writing for Business

FACULTY OF MANAGEMENT PROFESSIONAL CONSULTING MGMT 3901 Y SPRING 2016

SCM 432 Syllabus Spring 2015 Dr. Taube Page 1

ISM 4210: DATABASE MANAGEMENT

CSC-570 Introduction to Database Management Systems

Florida Gulf Coast University Lutgert College of Business Marketing Department MAR3503 Consumer Behavior Spring 2015

Texas A&M University-Commerce Syllabus Accounting Information Systems - Acct W & W

CMSC Fundamentals of Computer Programming II (C++)

After completing SI- 539, students will have a working personal portfolio website in production.

Canisius College Computer Science Department Computer Programming for Science CSC107 & CSC107L Fall 2014

Division of Mathematical Sciences

Transcription:

San José State University Department of Computer Engineering CMPE 152 Compiler Design Section 4 (Seminar) Section 5 (Lab) Spring 2017 GREEN SHEET CMPE 152-04 (seminar) TuTh 10:30 11:20 AM ENG 303 CMPE 152-05 (lab) Tu 1:30 4:20 PM ENG 405 Instructor: Ron Mak Office hours: Th: 2:30 4:30 PM Office location: ENG 250 E-mail: ron.mak@sjsu.edu Instructor web page: http://www.cs.sjsu.edu/~mak/ Class web page: http://www.cs.sjsu.edu/~mak/cmpe152/ Course description Principles of lexical analysis, finite state automata and parsing; issues of variable declarations, variable types, control statements, function calls, nested scopes and efficient assembler target code. Prerequisite: CMPE 126, CMPE 102 (both with grade of C- or better). Misc/Lab: Lecture 2 hours/lab 3 hours. 3 units Please submit into Canvas a copy of your transcript with the prerequisite courses highlighted. Students who do not provide documentation of having satisfied the class prerequisite and co-requisite requirements (if any) by the second class meeting will be dropped from the class. Goals of the course 1. 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. 2. 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 skills that are highly desired by employers. CMPE 152-04 and -05: Compiler Design Ron Mak 1

You will have the unique opportunity to invent a programming language, define its grammar, create a compiler for it, and then successfully compile and run programs written in your new language. Course learning outcomes Upon successful completion of the course, students will be able to Understand some of the underlying theory of compiler technology. Develop a scanner and a parser for a procedure-oriented programming language. Produce a symbol table and intermediate code (parse trees). Perform semantic analysis such as type checking. Develop an interpreter that creates a suitable runtime environment and executes the source program from the intermediate code and the symbol table. Invent a new programming language and define a grammar for it. Use the JavaCC compiler-compiler to generate a compiler for the team s language. Compile programs into the assembly language of the Java Virtual Machine (JVM). Assemble the assembly code into byte code for the JVM (create.class files). Successfully run programs written in the team s programming language on the JVM. Learn critical job skills that employers look for in new college hires! o Work together in a small programming team. Students form teams of four students each. Each student must be part of a team. o Understand and modify a Big Hairy Legacy Application (a Pascal interpreter written in Java). o Practice good object-oriented design and apply modern software engineering tools and practices to successfully develop a large complex application (your team's compiler project). This is a challenging course that will demand much of your time and effort throughout the semester. Course websites Course materials such as syllabus, handouts, notes, assignment instructions, etc. can be found on the class web page at http://www.cs.sjsu.edu/~mak/cmpe152/ and on the Canvas Learning Management System course website at http://sjsu.instructure.com. Piazza at https://piazza.com provides broadcast messages and a class forum. You are responsible for registering with these sites and regularly checking them for updates. CMPE 152-04 and -05: Compiler Design Ron Mak 2

Required texts Publisher: ISBN: Source files: Publisher: ISBN: PDF or book: 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.zip Generating Parsers with JavaCC, 2 nd edition Tom Copeland Centennial Books 0-9762214-3-8 http://generatingparserswithjavacc.com/ Recommended texts Publisher: ISBN: PDF: Programming for the Java Virtual Machine Joshua Engel Addison-Wesley Professional 978-0201309720 Understanding and Writing Compilers (free download) Richard Bornat http://www.cs.sjsu.edu/~mak/cmpe152/understandingandwritingcompilers.pdf Online Pascal tutorials Pascal Tutorial looks very good. It has an online Pascal compiler. Learn Pascal also looks good, although it doesn't appear to cover set types. There may be additional reading assignments and the use of tools from the Internet.This class will progress rapidly, and you must work hard to keep up. Do not fall behind in the reading. Compiler project teams You will form project teams of four students each. Team membership is mandatory for this class. Choose your teams wisely! Once teams are formed, students may not move from one team to another. All the members of a project team will each receive the same score for each team assignment. At the end of the semester, all members of a project team will receive the same score for its compiler project. The project grade will be determined by the overall quality of the final version of the team s artifacts and by how well the team achieved its goals to create a successful compiler. CMPE 152-04 and -05: Compiler Design Ron Mak 3

Labs, assignments, and compiler projects Lab assignments during the first half of the semester will be to Learn the Pascal language. Experiment with the underlying theory of compiler technology. Modify, debug, and add features to the source code of a Pascal interpreter written in Java. Lab assignments during the second half of the semester will be to Define a grammar for your team s programming language. Implement the grammar in JavaCC. Generate a compiler for your language. Compile programs into the assembly language of the JVM. There will be individual and team assignments. Each assignment will be worth a specified maximum number of points, depending on difficulty. You will have at least one week to complete each assignment. Late assignments will lose 20% of the maximum points and an additional 20% for each 24 hours after the due date. Most of the lab assignments will help you to design and develop your compiler. Each team should be working on its compiler project in the background outside of the labs, although the labs can be ideal times to discuss and find solutions to problems. The following applies to individual assignments: You may study together and discuss the assignments, but what you turn in must be your individual work. Assignment submissions will be checked for plagiarism using Moss (http://theory.stanford.edu/~aiken/moss/). Copying another student s program or sharing your program is a violation of academic integrity. Moss is not fooled by renaming variables, reformatting source code, or re-ordering functions. Violators of academic integrity will suffer severe sanctions, including academic probation. Students who are on academic probation are not eligible for work as instructional assistants in the university or for internships at local companies. Postmortem report At the end of the semester, each student must also turn in a short (1 or 2 pages) 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. CMPE 152-04 and -05: Compiler Design Ron Mak 4

Exams The midterm and final examinations will be closed book. Instant messaging, e-mails, texting, tweeting, file sharing, or any other forms of communication with anyone else during the exams will be strictly forbidden. There can be no make-up midterm examination unless there is a documented medical emergency. Make-up final examinations are available only under conditions dictated by University regulations. Class grade Your individual final class grade will be weighted as follows: 30% Assignments 35% Compiler project 15% Midterm exam 20% Final exam During the semester, you can keep track of your progress in Canvas. Each assignment and exam will be scored (given points) but not assigned a letter grade. The average score can be seen in Canvas after each assignment and the midterm exam. At the end of the semester, all the students will be ranked in the order of their weighted class scores. Students with the median score will be assigned the B grade. Higher and lower grades will then be assigned based on how the scores cluster above and below the median. Your final class grade can be adjusted up or down depending on your level and quality of participation on your project team as determined by project tracking tools and your team members' assessments of your performance. Note that All students have the right, within a reasonable time, to know their academic scores, to review their grade-dependent work, and to be provided with explanations for the determination of their course grades. See University Policy F13-1 at http://www.sjsu.edu/senate/docs/f13-1.pdf for more details. Classroom protocol It is very important for each student to attend classes and labs 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/ CMPE 152-04 and -05: Compiler Design Ron Mak 5

Schedule Subject to change with fair notice. Chapter readings are from the required texts. Week Dates Topics and activities WCI JavaCC 1 Jan 26 Overview of the course 1, 2 What are compilers and interpreters? A software framework for compilers and interpreters Form programming teams 2 Jan 31 Feb 2 Syntax diagrams Scanning (lexical analysis) 3, 4 Jan 31 lab Symbol table management Install software Write, compile, and run a Pascal program 3 Feb 7, 9 Top-down recursive-descent parsing Parsing assignment statements and expressions Intermediate code (parse trees) Feb 7 lab JFLAP exercises on finite automata and grammars Create a scanner and a symbol table 4 Feb 14, 16 Interpreting assignment statements and expressions Parsing control statements Parser error handling Feb 14 lab More exercises on finite automata and grammars Modify the Pascal parser for set expressions 5 Feb 21, 23 Interpreting control statements Runtime error handling Parsing declarations Feb 21 lab Execute Pascal set expressions 6 Feb 28 Mar 2 Parsing declarations, cont'd Semantic actions and type checking Feb 28 lab Parse set and complex type definitions 7 Mar 7, 9 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 Mar 7 lab Type check set and complex expressions Create a runtime library for complex arithmetic 8 Mar 14, 16 Passing parameters by value and by reference Interpreting Pascal programs Midcourse review 5 6, 7 8, 9 9, 10 11, 12 12 Mar 14 lab Midterm exam Thursday, March 16 Compile and interpret Pascal programs Debug the interpreter CMPE 152-04 and -05: Compiler Design Ron Mak 6

9 Mar 21, 23 A simple DFA scanner BNF grammars for programming languages The JavaCC compiler-compiler Mar 21 lab Create a grammar for your programming language 1 SPRING BREAK 10 Apr 4, 6 Generating a scanner with JavaCC Generating a parser with JavaCC JJTrees Apr 4 lab Use JavaCC to generate a scanner for your programming language 11 Apr 11, 13 JavaCC error handling The Java Virtual Machine (JVM) architecture Jasmin assembly language Code templates and code generation Apr 11 lab Use JavaCC to generate a parser for your programming language 12 Apr 18, 20 Code for expressions Code for assignment statements Apr 18 lab The Java Virtual Machine (JVM) architecture Learn the Jasmin assembly language 13 Apr 25, 27 Code for procedure and function calls Code to pass parameters by value and by reference Code for string operations Apr 25 lab Generate Jasmin assembly code for expressions, assignment statements, and function calls 14 May 2, 4 Code for control statements Code for arrays Code for records May 2 lab Generate Jasmin assembly code for control statements 15 May 9, 11 Executing compiled Pascal programs Bottom-up parsing Yacc and Lex Code optimization May 9 lab Generate Jasmin assembly code for arrays and records 16 May 16 Compiling object-oriented languages An interactive source-level debugger A multi-threaded GUI-based debugger Heap, stack, and garbage collection Course review May 16 lab Complete your compiler Exercises on Yacc and Lex May 17 Final projects due Wednesday, May 17 Final May 22 Final exam Monday, May 22 9:45 AM noon, ENG 303 2, 3, 4 15 7 16 17 18 19 19 CMPE 152-04 and -05: Compiler Design Ron Mak 7