cs 614: theory and construction of compilers lecture 8 fall 2002 department of computer science...

6
CS 614: Theory and Construction of Compilers Lecture 8 Fall 2002 Department of Computer Science University of Alabama Joel Jones

Upload: luke-sutton

Post on 20-Jan-2018

212 views

Category:

Documents


0 download

DESCRIPTION

©2002 Joel Jones Definitions P L MST L S L Program P expressed in language L Machine M Translator from S to T expressed in L Interpreter for S expressed in language L

TRANSCRIPT

Page 1: CS 614: Theory and Construction of Compilers Lecture 8 Fall 2002 Department of Computer Science University…

CS 614: Theory and Construction of Compilers

Lecture 8Fall 2002Department of Computer ScienceUniversity of AlabamaJoel Jones

Page 2: CS 614: Theory and Construction of Compilers Lecture 8 Fall 2002 Department of Computer Science University…

©2002 Joel Jones

Outline “Everybody Dance Now”

Review Tombstone Diagrams Tombstone ‘til you drop

Reading & Questions for Next Class

Page 3: CS 614: Theory and Construction of Compilers Lecture 8 Fall 2002 Department of Computer Science University…

©2002 Joel Jones

DefinitionsP

L

M

S TL

SL

Program P expressed in language L

Machine M

Translator from S to T expressed in L

Interpreter for S expressed in language L

Page 4: CS 614: Theory and Construction of Compilers Lecture 8 Fall 2002 Department of Computer Science University…

©2002 Joel Jones

Tombstone Diagram Problems 1:

Compile a Triangle Source Program P Running the object program Disassembling the object program

2: (machine M, C compiler on M producing M, Java->C translator written in C) Diagrams for above Compile and run program P expressed in C Compile Java-into-C translator to machine code Compile and run program Q expressed in Java

Page 5: CS 614: Theory and Construction of Compilers Lecture 8 Fall 2002 Department of Computer Science University…

©2002 Joel Jones

More Tombstone Diagram Problems 3: (Gnu RTL intermediate language; HLL: C, C+

+, Pascal; Machine Code: Alpha, PPC, SPARC; RTL->RTL optimizer; all written in C Install on SPARC, given a C compiler for SPARC Compile P in Pascal, into SPARC machine code Compile using RTL optimizer Cross-compile C++ program Q for PPC machine

code