Mechanics non terminals a if producvons ml variable

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: nguages CSE341: Programming t some non- terminal A, •  Ideally, if we are SE341: Programming Languages and there are tLecture 1 possible 1 roducVons wo or more Lecture p A ::= α Course Course Mechanics Mechanics A ::= β ML Variable Bindings ML Variable Bindings we want to make the correct choice by looking at just the next input symbol Dan Grossman Dan Grossman F a predicCve parser •  If we can do this, all e can build all 2011 F w 2011 that can perform a top- down parse without backtracking Winter 2013 UW CSE 401 (Michael Ringenburg) 13 Example CSE341: CSE341: Programming Languages Languages •  Programming language gProgramming oPen suitable rammars are for predicVve parsing 1 Lecture 1 Lecture Course •  Typical example Mechanics Mechanics Course ML Variable Bindings stmt ::= id =Variable Bindings ML exp ; | return exp ; | if ( exp ) stmt | while ( exp ) stmt Dan Grossman D o the input If the next part anf Grossman begins with the tokens Fall 2011 Fall 2011 IF LPAREN ID(x) … we should expand stmt to an if- statement Winter 2013...
View Full Document

This document was uploaded on 04/04/2014.

Ask a homework question - tutors are online