5 Written questions
5 Matching questions
- deterministic finite automaton
- nondeterministic finite automaton
- shift-reduce conflict
- a an ordering of operators that specifies that certain operators should be performed before others when no ordering is otherwise specified.
- b 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.
- c a finite automaton that has at most one transition from a state for each input symbol and no empty transitions. Abbreviated DFA.
- d a statement in a programming language that provides information to the compiler, such as the structure of a data record, but does not specify executable code.
- e in a grammar for a shift-reduce parser, a case in which an input might either be shifted onto the stack or reduced.
5 Multiple choice questions
- a lattice structure that shows which types are higher or derivable from others, e.g. float is higher than integer. When an operation is specified on different types, the arguments may be coerced to the least upper bound of the two types in the lattice.
- a deterministic function that converts converts a symbol or other input to a pseudo-randomized integer value.
- a method of translating statements, e.g. in a programming language, such that the translation of a phrase is built up from the translations of its components.
- Not a Number, a floating-point value that does not represent a valid number. This could result from use of uninitialized data (if memory is initialized to NaN's), arithmetic performed on a NaN, or an undefined operation such as 0/0. A NaN may be quiet, or signalling, in which case its generation or use generates a CPU exception.
- the assignment of multiple meanings to an operator, depending on the type of data to which it is applied; e.g., the symbol + could represent integer addition, floating-point addition, or matrix addition.
5 True/False questions
BNF → Backus-Naur Form, a syntax for writing context-free grammars that describe computer languages.
regular grammar → a grammar that denotes a regular language; its productions can only have on the right-hand side either a terminal string or a terminal string followed by a single nonterminal.
terminal symbol → a symbol in a phrase structure grammar that is a part of the language described by the grammar, such as a word or character of the language. cf. nonterminal symbol.
regular language → the output language of a compiler.
left recursion → in a grammar, a case where A ⇒ A α for some nonterminal symbol A. In top-down parsing, left recursion will cause an infinite recursion. Also, describes such a production.