winter 2013 uw cse 401 michael ringenburg 26 lep

Info iconThis preview shows page 1. Sign up to view the full content.

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

Unformatted text preview: | while ( exp ) stmt RETURN: returnStmt(); break; Dan Grossman Dan Grossman IF: ifStmt(); break; Fall 2011 Fall 2011 WHILE: whileStmt(); break; ID: assignStmt(); break; } } Winter 2013 UW CSE 401 (Michael Ringenburg) 22 Example (cont) CSE341: Programming Languagese Languages // parse while (exp) stmtCSE341: Programming xp ; // parse return void whileStmt() { void returnStmt() { L // skip “return” ecture 1 // skip “while” “(” Lecture 1 // real parser would verify “(“ Course Mechanics Course MechanicsgetNextToken(); getNextToken(); getNextTokenML Variable Bindings (); ML Variable Bindingsparse expression // // parse condiVon e Grossman Danxp(); Dan Grossman exp(); Fall 2011 // skip “;” Fall 2011 // skip “)” getNextToken(); getNextToken(); } // parse stmt stmt(); } Winter 2013 UW CSE 401 (Michael Ringenburg) 23 Invariant for P...
View Full Document

Ask a homework question - tutors are online