Cse341 programming cse341 programming languages

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: e 1 Lecture 1 // L ecture term { + term }* expr ::= Course expr() { Course Mechanics Mechanics ExprNode ML Variable Bindings ExprNode op1, op2; M(4) L Variable Bindings Op1: Int Op2: Int(5) 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) 35 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: (4 + 5) Op2: Int(5) 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) 36 Example (Showing...
View Full Document

Ask a homework question - tutors are online