030_Top_Down_Parsing

030_Top_Down_Parsing - Top-Down Parsing Announcements...

Info iconThis preview shows pages 1–21. 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

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: Top-Down Parsing Announcements Office hours schedule posted on website. Keith: Mon 1:00PM 3:00PM, Gates 160 Wed 1:00PM 3:00PM, Gates 160 Hrysoula: Thursday 7:00PM 9:00PM, Gates 24A Friday 1:00PM 3:00PM, Gates 24A Riddhi Tuesday 7:00PM 9:00PM, Gates 24A Sunday 12:00PM 2:00PM, Gates 24A Or ask questions on Piazzza: www.piazzza.com Where We Are Lexical Analysis Syntax Analysis Semantic Analysis IR Generation IR Optimization Code Generation Optimization Source Code Machine Code Review from Last Time Goal of syntax analysis: recover the intended structure of the program. Idea: Use a context-free grammar to describe the programming language. Given a sequence of tokens, look for a parse tree that generates those tokens. Recovering this syntax tree is called parsing and is the topic of this week (and part of next!) Different Types of Parsing Top-Down Parsing (today) Beginning with the start symbol, try to guess the productions to apply to end up at the user's program. Bottom-Up Parsing (Wednesday / Friday) Beginning with the user's program, try to apply productions in reverse to convert the program back into the start symbol. Top-Down Parsing S E $ E T E T + E T int T ( E ) Top-Down Parsing S E $ E T E T + E T int T ( E ) int + ( int + int ) Top-Down Parsing S E $ E T E T + E T int T ( E ) int + ( int + int ) Top-Down Parsing S E $ E T E T + E T int T ( E ) int + ( int + int ) $ Top-Down Parsing S E $ E T E T + E T int T ( E ) int + ( int + int ) S $ Top-Down Parsing S E $ E T E T + E T int T ( E ) int + ( int + int ) E S $ Top-Down Parsing S E $ E T E T + E T int T ( E ) int + ( int + int ) T E E S $ Top-Down Parsing S E $ E T E T + E T int T ( E ) int + ( int + int ) T E E S $ Top-Down Parsing S E $ E T E T + E T int T ( E ) int + ( int + int ) T E E T S $ Top-Down Parsing S E $ E T E T + E T int T ( E ) int + ( int + int ) T E E T E S $ Top-Down Parsing S E $ E T E T + E T int T ( E ) int + ( int + int ) T E E T T E E S $ Top-Down Parsing S E $ E T E T + E T int T ( E ) int + ( int + int ) T E E T T T E E S $ Top-Down Parsing S E $ E T E T + E T int T ( E ) int + ( int + int ) T E E T T T E E S $ Top-Down Parsing S E $ E T E T + E T int T ( E ) int + ( int + int ) T E E T T T E E S $ Challenges in Top-Down Parsing Top-down parsing begins with virtually no information. Begins with just the start symbol, which matches every program....
View Full Document

This document was uploaded on 07/18/2011.

Page1 / 304

030_Top_Down_Parsing - Top-Down Parsing Announcements...

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

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