5 Written questions
5 Matching questions
- right-associative operator
- ambiguous grammar
- a 1. a contiguous set of symbols at the beginning of a string. 2. a way of writing expressions in which an operator appears before its operands: +ab.
- b 1. in a hash table storage scheme, to calculate a new hash value for an item when the previous hash value caused a collision with an existing item. 2. the algorithm used to calculate the new hash value.
- c a set of symbols used in the definition of a language.
- d a grammar that allows some sentence or string to be generated or parsed in more than one way ( i.e., with distinct parse trees).
- e an operator in an arithmetic expression such that if there are two adjacent occurrences of operators with equal precedence, the right one should be done first.
5 Multiple choice questions
- an expression written with an operator between its operand, e.g. a + b . cf. prefix, postfix.
- a word in a programming language that is reserved for use as part of the language and may not be used as an identifier.
- a description of a kind of variables, including a set of possible values and a set of operations.
- an algebraic expression that denotes a regular language. Regular expressions are usually easier to write than an equivalent regular grammar.
- a list of steps that shows how a sentence in a language is derived from a grammar by application of grammar rules.
5 True/False questions
storage alignment → the assignment of memory locations to data and program code.
overloading → a symbol that denotes an operation to be performed on data in an expression.
preorder → an order of visiting trees, in which a node is examined first, followed by recursive examination of its children, in left-to-right order, in the same fashion.
left-associative → describes operators in an arithmetic expression such that if there are two adjacent occurrences of operators with the same precedence, the left one should be done first. Thus, a - b + c means (a - b) + c. Most operators are left-associative.
Chomsky hierarchy → the phase of a compiler in which executable output code is generated from intermediate code.