STUDY_GUIDE_TEST1

advertisement
STUDY GUIDE – TEST 1 – CS 424/524
Read the book, review the slides and your notes; study your homework, and review the topics
listed below. The purpose of the study guide is to point out some of the important things that you
should understand. It isn’t necessarily all inclusive.
Chapter 1
 Binding: know what it means, possible binding times, things that might be bound, relative
advantages of early and late bindings.
 Orthogonality: definition, example; other programming language characteristics that
promote or detract from readability and writeability.
 Compiler versus interpreter. Advantages and disadvantages of each kind of language
implementation. Understand a little about the virtual machine approach, as in the Java
Virtual Machine.
Chapter 2
 Define syntax. Know the difference between lexical, concrete, and abstract syntax. Be
able to identify the four components of a context-free grammar (page 25) and know the
basics notation of BNF notation (the most common notation for defining context-free
grammars). Understand the difference between EBNF and BNF; understand the
notations of both.
 Understand the definitions of operator precedence and associativity (page 30). Be able to
look at a concrete grammar and determine the precedence and associativity of its
operators.
 Ambiguity in a grammar: definition and recognition
 Figure 2.8: Major stages in compilation. Understand the steps, be able to describe, be
able to identify actions that occur at various stage. Know the input and output of each
stage also.
 Understand the abstract grammar representation of Clite given in our textbook. For
example, what is the format of a binary or unary?
 Be able to generate or interpret concrete and abstract syntax trees when given the
concrete and abstract grammars.
Chapter 3
 Be able to identify the Chomsky Hierarchy of grammars and know which two grammars
pertain to programming languages (page 58).
 Know what a token is. What are the various classes of tokens that are generally found in
programming languages?
 Regular expressions as an equivalent to regular grammars: given the notation for regular
expressions, be able to write or interpret one if given a description.
 Definition of a deterministic finite state automaton
 Be able to draw a DFSA when given the regexp it represents, or when given a DFSA, be
able to tell whether or not it recognizes a given string.
 Know what a parser does, and understand the basic difference between top-down and
bottom-up parsing.
 Know some basic facts about the recursive descent expression parser in the book: for
example, it is designed to return binaries that contain the intermediate code for that
expression; it is based on EBNF notation rather than BNF to avoid recursive function
calls; it calls the lexical analyzer for a new token whenever it needs one, etc.
Chapter 12 : Imperative Paradigm
 What are the distinguishing characteristics/features of imperative programming
languages?
 What was the relation between the von Neumann computer architecture and the
development of early programming languages
 What is a Turing complete language?
 Terminology: Be able to define procedural abstraction and data abstraction;be able to
identify structured programming and top-down design.
 What is the role of the assignment statement in imperative languages?

Drawbacks of imperative approach – why did developers extend it to also include objectoriented concepts?
Chapter 13: Object-Oriented Paradigm
 Definitions: Encapsulation, information hiding, inheritance,
 Be able to compare/contrast imperative paradigm and OO paradigm with respect to
software design process.
 OO terminology: class, object, message, client, constructors, visibility, etc. Be able to
identify the terms; be able to define class, object, and constructor.
 The three characteristics of an object-oriented language
 Know the difference between “pure” or “run-time” polymorphism (virtual
functions/methods) and parametric polymorphism (as in templates or generic
programming)
 Abstract classes and abstract methods; difference between abstract methods and virtual
methods
Python and Scripting Languages:
 Define, give characteristics of scripting languages; compare to more traditional languages
for usability, etc.
 Dynamic typing in Python
 Basic Python syntax; e.g., use of white space to delimit program blocks; multiple
assignment statements, multiple return values for functions
 How is a variable “declared”?
 Be prepared to write a few lines of code or tell the meaning of a few lines of code.
 Know the difference between a list and a tuple (e.g., which structure supports element
assignment?)
 Be able to create and populate a dictionary directly (without using functions); know how
to access dictionary entries via a key.
 Understand the difference between dictionaries and sequential structures such as strings,
lists, and tuples. In particular understand why there are different types of data structures,
what the differences are in terms of insertions and lookups, etc.
 Know the difference between a dictionary key and an index (which indicates the position
of some item in a sequence)
 Understand lists, list access using indexes, simple operations such as concatenation,
repetition (“multiplication”), etc.
 Use of the range statement in for-loops
Download