{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

exam1-rubric - ECE 468 Midterm 1 Name Purdue email Please...

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

View Full Document Right Arrow Icon
ECE 468 — Midterm 1 September 30, 2010 Name: ______________________________________ Purdue email: ______________________________________ Please sign the following: I affirm that the answers given on this test are mine and mine alone. I did not receive help from any person or material (other than those explicitly allowed). X ___________________________________________ Part Points Score 1 8 2 20 3 10 4 22 5 40 Total 100
Background image of page 1

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

View Full Document Right Arrow Icon
Part 1: Short answers (8 points) 1) Explain (in at most 30 words) why it is useful to split the phases of a compiler into a front end and a back end (2 points) -1 point for only defining what front and back end are, without explaining why we might want to split them. 2) Give an example of an English sentence that is syntactically correct but not semantically correct. (1 point) -1 point for no/incorrect answer. 3) Briefly explain (it shouldn ʼ t take you more than two sentences) why the following grammar is not LL(k) for any k (3 points) S E $ E int E (E + E) E (E – E) Many people pointed out that rules 3 & 4 both started with ʻ ( ʻ . That merely means that it is not LL(1). To get full credit, your answer needed to include some discussion of the recursion: there could be an unlimited number of ʻ ( ʻ s. -2 for only explaining why it is not LL(1) 4) Give a grammar that is equivalent to the grammar in problem 3, but is LL(1) (2 points) -2 for grammar that is not equivalent to grammar in (3), or not LL(1)
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}