Midterm Exam Studyguide

CS 550 Programming Languages
Sections 501 and 900 (online)
Instructor: Jeremy Johnson
Format: online take home exam to be completed in 3 hours. Midterm exam date: anytime between April 29 and May 6.

Topics

  1. Grammars and Parsing (Lecture 1)
  2. Mini Language and Interpreter (Lecture 2)
  3. Dynamic Memory Allocation and Garbage Collection (Lecture 3)
  4. Functional programming and scheme (Chapter 11 Sec. 1-3 of the text and Lecture 4).
    1. evaluating S-expressions and the substitution model of evaluation. normal vs. applicative order.
    2. recursive functions in scheme
    3. data structures and list processing in scheme
    4. higher order functions (functions that are passed or return functions). E.G. map, filter, reduce, currying.
  5. Environments and the scheme interpreter (Chapters 5, 11 of the text, Chapter 4 Sec. 1-2 of SICP). and Lecture 4).
    1. why assignment can not be modeled with substitution
    2. environments - use and implementation
    3. scheme interpreter from SICP
    4. static vs. dynamic scope

What you should be able to do

  1. Demonstrate how dynamic memory and garbage collection works.
  2. Write a simple recursive descent parser
  3. Be able to use bison/flex to create a parser
  4. Use attribute grammars (and attributes in bison/flex) to build a data structure associated with parsing (e.g. abstract syntax tree, list, parse tree, etc.)
  5. Understand and extend the mini-language parser and interpreter (including the version that supports functions).
  6. Write a recursive scheme function and use and manipulate lists, including recursive data structures (e.g. trees).
  7. Write and use higher-order scheme functions
  8. Use substitution model of function application and lambda calculus.
  9. Use environment model of function application
  10. Trace through the execution of the scheme interpreter
  11. Understand the difference between static and dynamic scope and normal and applicative order.

Review Session

A review for the exam will be held during virtual office hours on Tue. April 28 from 7-9.

Format

Students will have three hours to take the exam once it is started. The exam is open book and open notes including online links from the lecture notes and assignment solutions. The exam must be taken in the window which it is available. The exam must be done alone using only the explicitly mentioned resources. I trust everyone to follow these instructions and failure to do so will result in explusion from the class.

There will be five questions (with multiple parts): 1) grammars, ambiguity, attribute grammars, and parsing 2) functional programming and scheme, 3) scheme interpreter, 4) mini language and the mini language interpreter along with extensions discussed and in the assignments. 5) one question building on the material presented and the assignments that students have done.