Ml variable bindings ml variable bindings use a

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: given state Lecture 1 C example Course Mechanics •  Contrived ourse Mechanics ML Variable Bindings ML Variable Bindings 1. 2. 3. 4. S ::= A S ::= B Dan Grossman A ::= x Fall 2011 B ::= x Dan Grossman Fall 2011 •  What happens when you try to parse x? –  Which reduc;on do you use ini;ally? r3 or r4? Winter 2013 UW CSE 401 (Michael Ringenburg) Parser States for 1 Winter 2013 1. 2. 3. 4. 12 S ::= A S ::= B A ::= x B ::= x S ::= .A S ::= .B UW CSE 401 (Michael Ringenburg) 13 1/25/13 Parser States for 1 S ::= A S ::= B A ::= x B ::= x S ::= .A S ::= .B A ::= .x B ::= .x Winter 2013 14 UW CSE 401 (Michael Ringenburg) Parser States for 1 2 Winter 2013 1. 2. 3. 4. S ::= .A S ::= .B A ::= .x B ::= .x 1. 2. 3. 4. S ::= A S ::= B A ::= x B ::= x •  State 2 has a reduce- reduce conflict (r3, r4) x A ::= x. B ::= x. UW CSE 401 (Michael Ringenburg) 15 1/25/13 Handling Reduce- Reduce Conflicts C CSE341: Programming a problem Languages •  These normally SE341: Programmingwith the indicate Languages grammar – can’t be parsed ecture 1type of parser. Lecture 1 L by this Course Course Mechanics Mechanics •  How to fix? ML Variable Bindings ML Variable Bindings –  Use a different kind of parser generator that takes lookahead informa;on into account when Dan Gross...
View Full Document

Ask a homework question - tutors are online