Homework6 - in its standardized tree(If it exists in both...

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

View Full Document Right Arrow Icon
COP 5555 Programming Language Principles Homework 6 Assigned: July 6, 2011 Deadline: 11:59pm July. 13, 2011 *Note: Please submit your solution to the e-learning system by the deadline. No late submission is allowed. 1. Problem 1 (20 Points) Give an example of a left associative operator in RPAL and then modify the grammar such that it won't be left or right associative anymore. 2. Problem 2 (20 Points) According to the semantic definition of RPAL, are RPAL programs meant to be evaluated in PL order or normal order? Why was this choice made? 3. Problem 3 (20 Points) Can you give an example of an RPAL program whose root of a fully standardized tree is not lambda or gamma? Can you give an example of an RPAL program in which Ystar is not a leaf
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
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: in its standardized tree? (If it exists in both cases) 4. Problem 4 (20 Points) Can you write a macro in standard C that `returns' the greatest common divisor of a pair of arguments, without calling a subroutine? Why or why not? [textbook 3rd edition, problem 3.22] 5. Problem 5 (20 Points) In Section 3.5.4 we noted that while a single min function in C would work for both integer and floating-point numbers, overloading would be more efficient, because it would avoid the cost of type conversions. Give an example in which overloading does not seem advantageous--one in which it makes more sense to have a single function with floating-point parameters, and perform coercion when integers are supplied. [textbook 3rd edition, problem 3.20]...
View Full Document

{[ snackBarMessage ]}

Page1 / 2

Homework6 - in its standardized tree(If it exists in both...

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