CMPE 152: Compiler Design December 6 Class Meeting

Slides:



Advertisements
Similar presentations
Compiler Summary Mooly Sagiv html://
Advertisements

CS 153: Concepts of Compiler Design August 25 Class Meeting Department of Computer Science San Jose State University Fall 2014 Instructor: Ron Mak
CS 151: Object-Oriented Design December 5 Class Meeting Department of Computer Science San Jose State University Fall 2013 Instructor: Ron Mak
CS 157B: Database Management Systems II March 18 Class Meeting Department of Computer Science San Jose State University Spring 2013 Instructor: Ron Mak.
CS 152: Programming Language Paradigms April 9 Class Meeting Department of Computer Science San Jose State University Spring 2014 Instructor: Ron Mak
CS 153: Concepts of Compiler Design August 24 Class Meeting Department of Computer Science San Jose State University Fall 2015 Instructor: Ron Mak
CS 153: Concepts of Compiler Design October 5 Class Meeting Department of Computer Science San Jose State University Fall 2015 Instructor: Ron Mak
CS 153: Concepts of Compiler Design August 26 Class Meeting Department of Computer Science San Jose State University Fall 2015 Instructor: Ron Mak
CS 153: Concepts of Compiler Design September 16 Class Meeting Department of Computer Science San Jose State University Fall 2015 Instructor: Ron Mak
Topic #1: Introduction EE 456 – Compiling Techniques Prof. Carl Sable Fall 2003.
CS 153: Concepts of Compiler Design October 7 Class Meeting Department of Computer Science San Jose State University Fall 2015 Instructor: Ron Mak
CS 153: Concepts of Compiler Design October 10 Class Meeting Department of Computer Science San Jose State University Fall 2015 Instructor: Ron Mak
CMPE 226 Database Systems November 18 Class Meeting Department of Computer Engineering San Jose State University Fall 2015 Instructor: Ron Mak
CS 153: Concepts of Compiler Design November 25 Class Meeting Department of Computer Science San Jose State University Fall 2015 Instructor: Ron Mak
CS 153: Concepts of Compiler Design December 7 Class Meeting Department of Computer Science San Jose State University Fall 2015 Instructor: Ron Mak
CS 153: Concepts of Compiler Design November 18 Class Meeting Department of Computer Science San Jose State University Fall 2015 Instructor: Ron Mak
CS 151: Object-Oriented Design October 29 Class Meeting Department of Computer Science San Jose State University Fall 2013 Instructor: Ron Mak
CS 152: Programming Language Paradigms April 7 Class Meeting Department of Computer Science San Jose State University Spring 2014 Instructor: Ron Mak
©SoftMoore ConsultingSlide 1 Structure of Compilers.
CS 153: Concepts of Compiler Design October 12 Class Meeting Department of Computer Science San Jose State University Fall 2015 Instructor: Ron Mak
CS 154 Formal Languages and Computability April 19 Class Meeting Department of Computer Science San Jose State University Spring 2016 Instructor: Ron Mak.
CS 160 and CMPE/SE 131 Software Engineering May 12 Class Meeting Department of Computer Science Department of Computer Engineering San José State University.
CS 154 Formal Languages and Computability May 12 Class Meeting Department of Computer Science San Jose State University Spring 2016 Instructor: Ron Mak.
CS 152: Programming Language Paradigms May 12 Class Meeting Department of Computer Science San Jose State University Spring 2014 Instructor: Ron Mak
Compiler Summary Lexical analysis—scanner – String of characters  token – Finite automata. Syntactical analysis – parser – Sequence of tokens –> language.
Teaching Compiler Design
CS 153: Concepts of Compiler Design September 14 Class Meeting
Compiler Design (40-414) Main Text Book:
CS 153: Concepts of Compiler Design August 24 Class Meeting
CS 3304 Comparative Languages
CS 153: Concepts of Compiler Design August 29 Class Meeting
CS 153: Concepts of Compiler Design October 17 Class Meeting
CS 153: Concepts of Compiler Design October 5 Class Meeting
课程名 编译原理 Compiling Techniques
CS 153: Concepts of Compiler Design November 28 Class Meeting
CS 153: Concepts of Compiler Design December 5 Class Meeting
CS 153: Concepts of Compiler Design November 30 Class Meeting
Compiler Lecture 1 CS510.
CMPE Database Systems Exercise #1 Solutions
CMPE 152: Compiler Design December 5 Class Meeting
CMPE 152: Compiler Design January 25 Class Meeting
CPSC 388 – Compiler Design and Construction
CMPE 152: Compiler Design September 18 Class Meeting
CMPE 152: Compiler Design September 13 Class Meeting
CMPE 152: Compiler Design October 4 Class Meeting
CMPE 152: Compiler Design September 11/13 Lab
CMPE 152: Compiler Design October 4 Class Meeting
CMPE 152: Compiler Design August 23 Class Meeting
CMPE 152: Compiler Design August 21/23 Lab
CMPE 135: Object-Oriented Analysis and Design December 6 Class Meeting
CMPE 135: Object-Oriented Analysis and Design November 29 Class Meeting Department of Computer Engineering San Jose State University Fall 2018 Instructor:
CMPE 152: Compiler Design November 29 Class Meeting
CMPE 135: Object-Oriented Analysis and Design November 29 Class Meeting Department of Computer Engineering San Jose State University Fall 2018 Instructor:
CS 153: Concepts of Compiler Design October 30 Class Meeting
CS 153: Concepts of Compiler Design November 6 Class Meeting
CMPE 152: Compiler Design March 7 Class Meeting
CMPE/SE 131 Software Engineering May 9 Class Meeting
CMPE 152: Compiler Design April 9 Class Meeting
CMPE 152: Compiler Design January 29 Class Meeting
CMPE 152: Compiler Design February 21/26 Lab
CMPE 152: Compiler Design April 18 – 30 Labs
CS 144 Advanced C++ Programming April 25 Class Meeting
CMPE 152: Compiler Design April 25 Class Meeting
CMPE 152: Compiler Design April 16 Class Meeting
CMPE 152: Compiler Design March 19 Class Meeting
CMPE 152: Compiler Design April 30 Class Meeting
CMPE 152: Compiler Design May 2 Class Meeting
CMPE 152: Compiler Design August 27 Class Meeting
CMPE 152: Compiler Design September 17 Class Meeting
CMPE 152: Compiler Design September 19 Class Meeting
Presentation transcript:

CMPE 152: Compiler Design December 6 Class Meeting Department of Computer Engineering San Jose State University Fall 2018 Instructor: Ron Mak www.cs.sjsu.edu/~mak

Extra Credit Presentations Today Pepe Pied Piper SSD The Kool Krab ~12 minutes each

Final Exam Friday, December 14 It will be similar to the midterm. 2:45 – 5:00 PM in ENG 343 It will be similar to the midterm. Covers the entire semester. Emphasis on the second half. It will be given online in Canvas, if I figure out the lockdown browser, otherwise on paper.

Course Review Lectures and PowerPoint slide sets Reading assignments Homework assignments Compiler project

Course Review, cont’d Good understanding of compiler concepts Front end: parser, scanner, and tokens Intermediate tier: symbol table and parse trees Back end: interpreter and code generator The ANTLR 4 compiler-compiler Basic understanding of Pascal

Course Review, cont’d What is the overall architecture of a compiler or an interpreter? What are the source language-independent and -dependent parts? What are the target machine-independent and -dependent parts? How can we manage the size and complexity of a compiler or an interpreter during its development?

Course Review, cont’d What are the main characteristics of a top-down recursive-descent parser? Of a bottom-up parser? What is the basic control flow through an interpreter as a source program is read, translated, and executed? Through a compiler for code generation?

Course Review, cont’d How do the various components work with each other? parser  scanner scanner  source program parser  symbol table parser  parse tree executor code generator symbol table parse tree 

Course Review, cont’d What information is kept in a symbol table? When is a symbol table created? How is this information structured? How is this information accessed? What information is kept in a parse tree? When is a parse tree created?

Course Review, cont’d What is the purpose of the symbol table stack runtime stack runtime display operand stack parse stack

Course Review, cont’d Define or explain syntax and semantics syntax diagrams and BNF syntax error handling runtime error handling type checking

Course Review, cont’d Deterministic finite automaton (DFA) start state accepting state transitions state transition table table-driven DFA scanner

Course Review, cont’d What information is kept in an activation record or stack frame? How is this information initialized? What happens during a procedure or function call? How to pass parameters by value by reference with an interpreter and with generated object code

Course Review, cont’d The Java Virtual Machine (JVM) architecture Runtime stack Stack frame operand stack local variables array program counter

Course Review, cont’d The Jasmin assembly language instructions explicit operands operands on the stack generic and “short cut” type descriptors assembler directives Be familiar with the instructions and be able to read a Jasmin program, but don’t try to memorize the instructions. You will not be asked to write Jasmin programs from scratch.

Course Review, cont’d Basic concepts of the ANTLR 4 compiler-compiler Token specification with regular expressions Production rules labelled alternates Tree node visitors Overriding visit methods.

Course Review, cont’d Code generation and code templates expressions assignment statements conditional statements looping statements arrays and records

Course Review, cont’d Compiling programs, procedures, and functions fields and local variables call and return passing parameters

Course Review, cont’d Multipass compilers type checking pass with the visitor pattern optimization pass code generation pass with the visitor pattern

Course Review, cont’d Integrating Jasmin routines with Java routines Pascal runtime library Instruction selection Instruction scheduling Register allocation spilling values live variables

Course Review, cont’d Optimization for performance constant folding constant propagation strength reduction dead code elimination loop unrolling common subexpression elimination Runtime garbage collection algorithms

Unofficial Field Trip Computer History Museum in Mt. View http://www.computerhistory.org/ Provide your own transportation to the museum. Saturday, December 8, 11:30 – closing time Special free admission. We will meet in the lobby. No backpacks. Experience a fully restored IBM 1401 mainframe computer from the early 1960s in operation. Do a self-guided tour of the Revolution exhibit.

Unofficial Field Trip, cont’d IBM 1401 computer, fully restored and operational. A small transistor-based mainframe computer. Extremely popular with small businesses in the late 1950s through the mid 1960s Maximum of 16K bytes of memory 800 card/minute punched card reader (reads holes with wire brushes) 600 line/minute line printer (impact) 6 magnetic tape drives, no disk drives

Unofficial Field Trip, cont’d Information on the IBM 1401: General info: http://en.wikipedia.org/wiki/IBM_1401 My summer seminar: http://www.cs.sjsu.edu/~mak/1401/ Restoration: http://ed-thelen.org/1401Project/1401RestorationPage.html

Unofficial Field Trip, cont’d See the extensive Revolution exhibit! Walk through a timeline of the First 2000 Years of Computing History. Historic computer systems, data processing equipment, and other artifacts. Small theater presentations. Hollerith Census Machine Atanasoff-Berry Computer