573exam1sol - ECE 573 Midterm 1 September 29, 2009 Name: _...

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

View Full Document Right Arrow Icon
ECE 573 — Midterm 1 September 29, 2009 Name: ______________________________________ Purdue email: ______________________________________ Please sign the following: I afFrm 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 15 3 10 4 22 5 25 6 20 Total 100
Background image of page 1

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

View Full DocumentRight Arrow Icon
Part 1: Short answers (8 points) 1) Place the following parts of a compiler in order and identify which are part of the front-end, and which are part of the back-end. Parser, Code generator, Scanner, Optimizer (of IR), Semantic routines (2 points) Scanner, Parser, Semantic routines, Optimizer, Code generator. The frst three are the Front-end 2) Name two (of four) different types of compilers, and provide a real-world example for each that you name (2 points) Source-to-source (research compilers); source-to-assembly (gcc, g++, etc.); source-to- bytecode (javac, C# compiler, etc.); bytecode-to-assembly (JIT compilers) 3) Explain (brieFy—you shouldn ʼ t need more than one sentence) the difference between the syntax of a language and its semantics (1 point) The syntax oF a language determines its structure, the semantics determine its meaning 4) Explain the difference between a context-free grammar and a context-sensitive grammar (1 point) Context-Free grammar: non-terminals can be replaced by terminals independent oF what surrounds them. Context-sensitive grammar: some productions may require that a non- terminal appear in a certain context beFore they can be applied. 5) Why do semantic routines need to be placed at the end of productions in LR
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.

This note was uploaded on 02/19/2012 for the course ECE 468 taught by Professor Test during the Fall '08 term at Purdue University-West Lafayette.

Page1 / 7

573exam1sol - ECE 573 Midterm 1 September 29, 2009 Name: _...

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

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