Computer Science EngineeringHard
For the grammar S -> aSb | ab, how many derivation steps produce the string aaabbb?
- A. 2
- B. 3
- C. 4
- D. 6
Correct answer: B. 3
Two applications of S -> aSb followed by one of S -> ab give 3 steps.
Practise more Theory of Computation, Compilers & Digital Logic (ISRO CS) questionsTheory of Computation, Compilers & Digital Logic (ISRO CS): notes and key points
More Theory of Computation, Compilers & Digital Logic (ISRO CS) questions
- For the grammar E -> E + E | id, how many reduce actions does a shift-reduce parser perform while parsing id + id?
- An operator grammar is one in which no production right-hand side contains
- An LL(1) grammar has 4 non-terminals and 5 terminals. The predictive parsing table (with the end marker as an extra column) has how many…
- Live variable analysis is a data-flow problem of which type?
- Available expressions analysis is a data-flow problem of which type?
- Moving a computation whose value does not change inside a loop to before the loop is called