ps4 - ECE 468 Problem Set 4: Symbol Tables, Declarations...

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

View Full Document Right Arrow Icon
ECE 468 Problem Set 4: Symbol Tables, Declarations and Expressions 1. Write out the symbol table(s) (including any attributes that you think are important) for the following piece of code: int x; float y; string z = "hello"; void foo() { int x; float z; } void main() { int q; string p = "goodbye"; } 2. Explain the difference between an L-value and an R-value 3. ECE 468 student Cam Piler has come up with a code generation strategy for his project: while walking his Abstract Syntax Tree, whenever he sees a variable, he will immediately generate code to load its value into a temporary. He thinks this will make his compiler more efficient, because he generates code as soon as possible. Is he right? Why or why not? 4. Give the abstract syntax tree for the following expression (assume the usual order of
Background image of page 1

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

View Full DocumentRight Arrow Icon
Background image of page 2
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 / 2

ps4 - ECE 468 Problem Set 4: Symbol Tables, Declarations...

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

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