

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
An outline of the topics to be covered in exam #2 for the cs 405 programming languages course, along with sample questions. The exam will cover static and dynamic semantics, functional programming languages, and attribute grammar. The questions include fill in the blank, true or false, multiple choice, short answer, and discussion questions.
Typology: Exams
1 / 2
This page cannot be seen from the preview
Don't miss anything!


October 14, 2003
The exam will cover everything we have discussed from Chapters 3 (i.e. Sections 3.4, 3.5 - except 3.5.2 and 3.5.3) and 15 (i.e. all sections except 15.7-15.8) in the text and all notes, but emphasizing the material covered in class. The style of the exam will be very flexible, possibly consisting of fill in the blank, true or false (possibly with justification), multiple choice, matching, short answer (e.g. definitions or listing), and discussion questions. You will not be asked to work detailed problems such as writing any actual code (i.e. code in a specific language like Java or Lisp
A brief outline of the topics we have covered is described below. (This list is intended to be as complete as possible but may not be all inclusive.)
(a) Indicate which attributes are inherited, which are synthesized, and which are intrinsic. (b) Draw the attributed parse tree for the string “aaabbbccc”, showing clearly the order of evaluation of all attributes.
(defun update (store V n) (prog (currentenv newbinding newstore) (setq currentenv (cdaddr store))) (setq newbinding (cons (list ’eq ’V (list ’quote V)) (list n))) (setq newstore (list ’lambda (list ’V) (cons ’cond (cons newbinding currentenv)))) (return newstore))))
Note that the (prog (list of local variables) (exp-1) (exp-2) ... (exp-n) (return exp)) construction declares a list of local variables used in the expressions with exp being the value returned. Let S represent the Lisp expression (lambda (V) (cond ((eq V (quote x)) 4) (t (quote bottom)))). What is the internal list representation that Lisp uses for S? What is (cdaddr S)? Trace the execution of (update S ’x 5), showing the values of currentenv, newbinding, and newstore.