hw3cs441f10-key

hw3cs441f10-key - (b) The string in problem 3.1.1 matches...

Info iconThis preview shows pages 1–5. Sign up to view the full content.

View Full Document Right Arrow Icon
CS 441 Homework #3 Fall 2010 Sample Solution (based on student's submission) 3.1.1 a
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
3.1.1 b first tree
Background image of page 2
3.1.1 b second tree
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
3.1.2
Background image of page 4
3.1.3 (a) G1 is ambiguous, because more than one parse tree can be drawn for a given string (it is sufficient to have one string with two different parse trees for a grammar to be ambiguous).
Background image of page 5
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: (b) The string in problem 3.1.1 matches the conditional statement as it would be understood in C++ (c) G2 is ambiguous, because you could select a string such that you could start with the second production of <Stmt> or the first production of <IElse> and generate the same string....
View Full Document

Page1 / 5

hw3cs441f10-key - (b) The string in problem 3.1.1 matches...

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online