G types winter 2013 uw cse 401 michael ringenburg 45

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: n(); g all 2011 Fall 2011 op2 = term(); op1 = CreatePlusNode(op1, op2); } return op1; } Winter 2013 UW CSE 401 (Michael Ringenburg) 38 Example (Showing LeP AssociaVvity) CSE341: Programming CSE341: Programming Languages Languages // parse 4+5+x 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) + x) Op2: Id(x) D 5) + x) Returns ((4 + an Grossman Fall 2011 Winter 2013 op1 = term(); D an Grossman while (next symbol is PLUS) { FetNextToken(); g all 2011 op2 = term(); op1 = CreatePlusNode(op1, op2); } return op1; } UW CSE 401 (Michael Ringenburg) 39 What About Indirect LeP Recursion? CSE341: Programming CSE341: Programming Languages Languages •  A grammar might have a derivaVon that leads Lecture to a leP recursion 1 Lecture 1 Course Course Mechanics Mechanics A => βM=>* βn => ABindings M...
View Full Document

Ask a homework question - tutors are online