COSC 4360 Exam 1 Review
The exam will be given on October 7, 2011 during regular class hours. You will
have an hour and 15 minutes to complete the exam. The exam will cover information
from chapters 1 to 5 from Sebesta. You will be allowed a one-page, 8 1/2 X 11
inch, handwritten, original note sheet.
Most of the exam questions will be of two types:
- Short Answer. You will be given a question on a programming language concept
and asked to explain your understanding of the concept.
- Problem. You will be given a problem, similar to what has been demonstrated
in lecture and/or homework. These problems will directly reflect what we have
discussed in class.
Chapter 1, Preliminaries. Know the following concepts:
- Why do we study programming languages?
- How do different programming domains affect the languages that are commonly
used to solve problems in this domain?
- The author uses four primary criteria to evaluate languages. Know the criteria
in detail. Each criteria has multiple components, you need to be able to list
and define each of these. Be able to give examples of language features that
do well or poorly in each criteria.
- What are the primary influences on language design. Be able to give an examples
of each of these.
- Know the primary language categories. Be able to list the primary languages
that fit into each category.
- Be able to give examples of language trade-offs and how they have affected
language design.
- Understand how compilation, pure implementation, and hybrid implementation
schemes affect languages. Why have languages adopted each method?
- What are the steps in compilation?
- Why do almost all languages that use a compiler, compile to an intermediate
level language, instead of to the target machine language?
- What is the Von Neumann bottleneck? What techniques are we using to overcome
this bottleneck.
Chapter 2, Evaluation of the Major Programming Languages. I only did
an introduction of this chapter, but you will need to understand the basic evaluation
of the programming languages as outlined in figure 2.1.
- Any of the questions given in Homework 1 for this chapter would be appropriate
test questions.
Chapter 3, Describing Syntax and Semantics.
- Know the definitions of syntax and semantics in relation to language design.
- Who are the users of a language definition?
- Know what a sentence, language, lexeme, and token
are. Be able to give examples of each.
- What is the differences and similarities of language recognizers versus
language generators.
- What is a context-free grammar?
- What is Backus-Naur Form (BNF)? How is it used in computer languages? How
was BNF developed and by who? Understand the fundamentals of BNF.
- Be able to take a language description and convert it to BNF. These problems
will be similar to the questions in homework 2.
- Be able to take a grammar described using BNF and take a sentence in that
language and complete a derivation and/or a parse tree.
- Understand how grammars can be ambiguous. Be able to take an ambiguous grammar
described in BNF and modify the BNF in such a way that the grammar is no longer
ambiguous
- Be able to build a BNF grammar that handles associatively and precedence.
- How is extended BNF different from BNF. What are the advantages and disadvantages
of extended BNF.
- What is static semantics? Be able to give common programming language issues
that require the use of static semantics. How are attribute grammars used
to provide static semantics specifications?
- Why is there no widely accepted notation for describing programming language
semantics? Why do we need to describe programming language semantics?
- What is operational semantics? How is operational semantics
used to describe a programming language?
- What is denotational semantics? How is denotational semantics
used to describe a programming language?
- What is axiomatic semantics? How is axiomatic semantics used
to describe a programming language?
Chapter 4, Lexical and Syntax Analysis.
- What are the two parts of syntax analysis?
- Why is it common to separate lexical and syntax analysis?
- What is lexical analysis? What is accomplished during lexical
analysis?
- What is syntactical analysis? What is accomplished during syntactical
analysis?
- What are the goals of a parser?
- What is the difference between a top down and bottom up parser? What are
the advantages of each type of parser?
- Why do parsers use token look ahead?
- What is the shift-reduce algorithm used in a bottom-up parser? Why
is it used? Be able to describe this process.
- What are the advantages of a LR parser over an LL parser?
- Be able to prepare a lex/flex scanner for simple arithmetic expressions,
similar to the examples demonstrated in class and the assignment.
Chapter 5, Names, Bindings, and Scopes.
- What are the design issues for names used in computer languages?
- The author gave six attributes of variables. Know the attributes and be
able give examples of how each attribute has been used in different programming
languages.
- Understand the concept of binding. When can binding occur? What are
the advantages and disadvantages of each binding time? What are some of the
costs in different binding times?
- There are many different issues involved with explicit versus implicit variable
declaration. Be able to describe the issues and compare and contrast why each
method might be used?
- Variables have very different lifetimes. Why does this occur? Be able to
discuss the stack-dynamic method of binding variables. What are its advantages
and disadvantages? What major languages use this method? Many languages use
a hybrid version of this concept. Be able to describe this and why it is commonly
used.
- Understand variable scope.
- Why are named constants used?