Which of the following is an ε-free grammar?
Pick an option to check yourself, or open the answer below.
Show answer & explanation
Correct answer: B. Type-1
Explanation
Type-1 (context-sensitive) grammars are non-contracting (|α| ≤ |β|), so they have no ε-productions (apart from the special S → ε). Type-0, Type-2 and Type-3 grammars may contain A → ε. (Some published keys print Type-3, but regular grammars allow ε-productions.)More Theory of Computation and Compilers questions
- While processing a string, an LR parser reads the input
- What are the minimum and maximum numbers of initial, dead, unreachable and final states in a valid n-state finite automaton whose accepted…
- Which of the following finite automata recognise the language L = {a, b}*? A. M = ({q0}, {a, b}, δ, q0, {q0}) with δ(q0, a) = {q0}, δ(q0, b…
- Which of the following statements are correct? A. Syntax-directed translation can be applied in type checking. B. Syntax-directed translati…
- Match List I with List II (stack and input configurations)List I List II A. Initial configuration of stack and input in LL parsing I. $ | w…
- The precedence of regular-expression operators from lowest to highest is: