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:
-
BNF questions of the type asked in Assignment 1:
-
Given a BNF grammar, decide if a string is derivable from the grammar.
-
Given a BNF grammar and an input string, draw a parse tree for the string.
-
Given a BNF grammar, simplify it by reducing the number of rules and/or non-
terminal symbols used in the grammar.
-
Given an English description of a simple syntactic feature, define the BNF
rules for it.
-
Questions about lexical analysis, as covered in Assignment 2:
-
Given an English description of a type of token, write a regular expression for
it.
-
Given the skeleton for a JFlex lexer, fill in some rule or action to perform a
basic lexical analysis task.
-
Given a BNF, identify the tokens it uses.
-
Questions about parsing, parse trees, and symbol tables, as covered in
Assignment 3:
-
Given an excerpt of a textbook-style BNF, write the CUP-acceptable grammar for
it.
-
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.
-
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.
-
Given the specification for a language feature not specifically part of Pascal
or EJay, write the CUP grammar and actions to handle the feature.
-
Questions about operational semantics, as covered in Assignments 4 and 6:
-
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.
-
Given an EJay or Lisp program with several levels of function call, draw a
picture of memory at selected points during its execution.
-
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.
-
Given a piece of functionality that uses exception handling, explain what's
going on, and why exception handling is useful.
-
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.
-
Questions about Lisp and functional programming, as covered in Assignments 5
and 6:
-
Write a recursive function to perform a simple computation, such as those in
Assignment 5.
-
Write the destructive and non-destructive versions of a list-modifying function
in Lisp.
-
Compare and contrast the functionality of fundamental Lisp functions, such as:
-
eq versus equal
-
setf versus setq
-
let versus setq
-
append versus list versus cons
-
Compare and contrast related functionality in Lisp versus the C/Java class of
languages, such as:
-
assignment statements
-
basic control and data structures
-
pointers (references)
-
function/method calls
-
memory management