CSC 330 Final Study Guide
(a superset of the midterm study guide)



The final will be open book, open note. The questions will be focused on the work that you have done in the assignments. Relevant supporting subject matter is that covered in the Lecture notes, online examples, and the related portions of Chapters 1-6 and 8 of the book. The questions will in the following topic areas:
  1. BNF questions of the type asked in Assignment 1:
    1. Given a BNF grammar, decide if a string is derivable from the grammar.
    2. Given a BNF grammar and an input string, draw a parse tree for the string.
    3. Given a BNF grammar, simplify it by reducing the number of rules and/or non- terminal symbols used in the grammar.
    4. Given an English description of a simple syntactic feature, define the BNF rules for it.

  2. Questions about lexical analysis, as covered in Assignment 2:
    1. Given an English description of a type of token, write a regular expression for it.
    2. Given the skeleton for a JFlex lexer, fill in some rule or action to perform a basic lexical analysis task.
    3. Given a BNF, identify the tokens it uses.

  3. Questions about parsing, parse trees, and symbol tables, as covered in Assignment 3:
    1. Given an excerpt of a textbook-style BNF, write the CUP-acceptable grammar for it.
    2. Given a description of the kind of parse tree that should be generated for a particular programming language construct, write the CUP action to build the tree.
    3. Given a description of the kind information that should stored in a symbol table for a particular programming language construct, write the CUP action to build enter the information in a symbol table.
    4. Given the specification for a language feature not specifically part of Pascal or EJay, write the CUP grammar and actions to handle the feature.

  4. Questions about operational semantics, as covered in Assignments 4 and 6:
    1. Given a functionless EJay or Lisp program, draw a picture of memory at selected points during its execution, where memory is both the static pool and stack.
    2. Given an EJay or Lisp program with several levels of function call, draw a picture of memory at selected points during its execution.
    3. Given an EJay program that uses arrays and structs, draw a picture of the static pool, stack, and heap at selected points during its execution.
    4. Given a piece of functionality that uses exception handling, explain what's going on, and why exception handling is useful.
    5. Given the specification for a language feature not specifically part of Pascal, EJay, or XLisp, write an EJay or Lisp interpreter method to handle the feature.

  5. Questions about Lisp and functional programming, as covered in Assignments 5 and 6:
    1. Write a recursive function to perform a simple computation, such as those in Assignment 5.
    2. Write the destructive and non-destructive versions of a list-modifying function in Lisp.
    3. Compare and contrast the functionality of fundamental Lisp functions, such as:
      1. eq versus equal
      2. setf versus setq
      3. let versus setq
      4. append versus list versus cons
    4. Compare and contrast related functionality in Lisp versus the C/Java class of languages, such as:
      1. assignment statements
      2. basic control and data structures
      3. pointers (references)
      4. function/method calls
      5. memory management