Lecture 11

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: break; … } return res; } Winter 2013 UW CSE 401 (Michael Ringenburg) 32 Example (Showing LeP AssociaVvity) CSE341: Programming CSE341: Programming Languages Languages 4+5+x // parse 1 Lecture 1 // L ecture term { + term }* expr ::= Course expr() { Course Mechanics Mechanics ExprNode ML Variable Bindings ExprNode op1, op2; ML Variable Bindings op1 = term(); Dan Grossman Dan Grossman while (next symbol is PLUS) { FetNextToken(); g all 2011 Fall 2011 op2 = term(); op1 = CreatePlusNode(op1, op2); } return op1; } Winter 2013 UW CSE 401 (Michael Ringenburg) 33 Example (Showing LeP AssociaVvity) CSE341: Programming CSE341: Programming Languages Languages 4+5+x // parse 1 Lecture 1 // L ecture term { + term }* expr ::= Course expr() { Course Mechanics Mechanics ExprNode ML Variable Bindings ExprNode op1, op2; ML Variable Bindings Op1: Int(4) op1 = term(); Dan Grossman Dan Grossman while (next symbol is PLUS) { FetNextToken(); g all 2011 Fall 2011 op2 = term(); op1 = CreatePlusNode(op1, op2); } return op1; } Winter 2013 UW CSE 401 (Michael Ringenburg) 34 Example (Showing LeP AssociaVvity) CSE341: Programming CSE341: Programming Languages Languages 4+5+x // pars...
View Full Document

This document was uploaded on 04/04/2014.

Ask a homework question - tutors are online