5 Written questions
5 Matching questions
- regular language
- parse tree
- reduction step
- bottom-up parsing
- symbol table
- a a data structure that associates a name (symbol) with information about the named object.
- b in shift-reduce parsing, the reduction of items at the top of the stack to a phrase that encompasses those items.
- c a language described by a regular grammar, or recognizable by a finite automaton, e.g. a simple item such as a variable name or a number in a programming language.
- d a parsing method in which input words are matched against the right-hand sides of grammar productions in an attempt to build a parse tree from the bottom towards the top.
- e a data structure that shows how a statement in a language is derived from the context-free grammar of the language; it may be annotated with additional information, e.g. for compilation purposes.
5 Multiple choice questions
- the location of data relative to the start of a data area.
- 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.
- the assignment of memory locations to data and program code.
- a set of symbols used in the definition of a language.
- a finite automaton that has multiple state transitions from a single state for a given input symbol, or that has a null transition, not requiring an input symbol. Abbreviated NFA.
5 True/False questions
prefix → 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.
semantics → the process of reading a source language, determining its structure, and producing intermediate code for it.
recognizer → a program or abstract device that can read a string of symbols and decide whether the string is a member of a particular language.
leftmost derivation → a derivation in which the leftmost nonterminal of the string is replaced at each step.
suffix → 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.