Presentation is loading. Please wait.

Presentation is loading. Please wait.

CMPE 152: Compiler Design December 6 Class Meeting

Similar presentations


Presentation on theme: "CMPE 152: Compiler Design December 6 Class Meeting"— Presentation transcript:

1 CMPE 152: Compiler Design December 6 Class Meeting
Department of Computer Engineering San Jose State University Fall 2018 Instructor: Ron Mak

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

3 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.

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

5 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

6 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?

7 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?

8 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 

9 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?

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

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

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

13 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

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

15 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.

16 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.

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

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

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

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

21 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

22 Unofficial Field Trip Computer History Museum in Mt. View
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.

23 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

24 Unofficial Field Trip, cont’d
Information on the IBM 1401: General info: My summer seminar: Restoration:

25 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


Download ppt "CMPE 152: Compiler Design December 6 Class Meeting"

Similar presentations


Ads by Google