L variable bindings lalr1 aer the merging acts like an

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: the lookahead) is a. –  Note not only if – may be item [A ::= α . , b] in state •  Key difference is in how you compute the closure. Winter 2013 UW CSE 401 (Michael Ringenburg) 24 2/4/13 LR(1) Closure CSE341: Programming CSE341: Programming Languages Languages Lecture 1 1 Closure(S) Lecture Course Mechanics = Course Mechanics repeat Variable Bindings Bindings ML Variable ML for any item [A ::= α . X β, c] in S Dan Grossman Dan Grossman for all productions 2011:= γ Fall X : Fall 2011 for each b in FIRST(βc) add [X ::= . γ, b] to S until S does not change Winter 2013 UW CSE 401 (Michael Ringenburg) 25 LR(1) Tradeoffs CSE341: Programming Languages CSE341: Programming Languages •  LR(1) Lecture 1 Lecture f –  Pro: extremely precise; largest set o1 grammars Course Mechanics Course Mechanics arse –  Con: poten]ally VERY lL Variable tables with many M arge p Bindings ML Variable Bindings states Dan Grossman •  This explosion happens during the last step of the Transi7on Dan Grossman (aka Goto) computa]on, when you check if an equivalent Fall 2011 Fall 2011 state already exists. Now, you have to also check whether or not the lookaheads match, and they o[en don’t. •  Previously, a single state could encode many u...
View Full Document

Ask a homework question - tutors are online