100_Type_Checking_2

100_Type_Checking_2 - Type-Checking II Announcements...

Info iconThis preview shows pages 1–16. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Type-Checking II Announcements Written Assignment 2 Due Monday at 5:00PM. Office hours today, Sunday, and Monday. Ask questions on Piazzza! Email the staff list with questions! Midterm next Wednesday in class, 11:00 1:00. Midterm review session next Monday in class. We'll post practice midterms online. Midterm covers all of scanning and parsing, but not semantic analysis. Open-book, open-notes, open-computer, closed-network. OH switch next week: Monday office hours in Gates B24A, Friday office hours in Gates 160 at the scheduled times. Where We Are Lexical Analysis Semantic Analysis Syntax Analysis IR Generation IR Optimization Code Generation Optimization Source Code Machine Code Review from Last Time Static type checking in Decaf consists of two separate processes: Inferring the type of each expression from the types of its components. Confirming that the types of expressions in certain contexts matches what is expected. Logically two steps, but you will probably combine into one pass. Review from Last Time while (numBitsSet(x + 5) <= 10) { if (1.0 + 4.0) { /* */ } while (5 == null) { /* */ } } Review from Last Time while ( numBitsSet(x + 5) <= 10 ) { if (1.0 + 4.0) { /* */ } while (5 == null) { /* */ } } Review from Last Time while (numBitsSet(x + 5) <= 10) { if ( 1.0 + 4.0 ) { /* */ } while (5 == null) { /* */ } } Review from Last Time while (numBitsSet(x + 5) <= 10) { if ( 1.0 + 4.0 ) { /* */ } while (5 == null) { /* */ } } Well-typed expression with wrong type. Review from Last Time while (numBitsSet(x + 5) <= 10) { if (1.0 + 4.0) { /* */ } while ( 5 == null ) { /* */ } } Review from Last Time while (numBitsSet(x + 5) <= 10) { if (1.0 + 4.0) { /* */ } while ( 5 == null ) { /* */ } } Expression with type error Review from Last Time We write S e : T if in scope S , the expression e has type T . Review from Last Time S f(e 1 , ..., e n ) : U f is an identifier. f is a non-member function in scope S. f has type (T 1 , , T n ) U S e i : T i for 1 i n Read rules like this Review from Last Time S f(e 1 , ..., e n ) : U f is an identifier. f is a non-member function in scope S. f has type (T 1 , , T n ) U S e i : T i for 1 i n Review from Last Time We say that A B if A is convertible to B. The least upper bound of A and B is the class C where A C B C C C' for all other upper bounds. The least upper bound is denoted A B when it exists. A minimal upper bound of A and B is an upper bound of A and B that is not larger than any other upper bound. Review from Last Time S f(e 1 , ..., e n ) : U f is an identifier....
View Full Document

This document was uploaded on 07/18/2011.

Page1 / 215

100_Type_Checking_2 - Type-Checking II Announcements...

This preview shows document pages 1 - 16. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online