S ifthen s else s else 4 winter 2013 s ifthen s

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: CSE341: Programming Languages Languages •  Situa;on: both a shiU and a reduce are possible at a Lecture oint Ln the parse given p 1 i ecture 1 Course Course Mechanics Mechanics (equivalently: in a pML Variabletate of the DFA) ar;cular s Bindings ML Variable Bindings •  Classic example: if- else statement (condi;on Dan Grossman Dan Grossman omihed to save s2011 pace) Fall 2011 Fall S ::= iUhen S | iUhen S else S Winter 2013 UW CSE 401 (Michael Ringenburg) 8 1/25/13 Parser States •  State 3 has a shiU- reduce conflict –  Can shiU past else into state 4 (s4) –  Can reduce (r1) S ::= iUhen S 1. 2. 1 S ::= ifthen S S ::= ifthen S else S S ::= . ifthen S S ::= . ifthen S else S ifthen 2 S ::= ifthen . S S ::= ifthen . S else S S (Note: some items omihed in states 2- 4 to save space) 3 S ::= ifthen S . S ::= ifthen S...
View Full Document

This document was uploaded on 04/04/2014.

Ask a homework question - tutors are online