Computer Science EngineeringHard
Which parser accepts the largest class of grammars among the following?
- A. SLR(1)
- B. LALR(1)
- C. Canonical LR(1)
- D. LL(1)
Correct answer: C. Canonical LR(1)
CLR(1) is strictly more powerful than LALR(1) and SLR(1), and LL(1) grammars are a subset of LR(1) grammars.
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 a given grammar, an LALR(1) parser has the same number of states as which other parser?
- How many nodes does the DAG for the expression a + a(b-c) + (b-c)d contain (common subexpressions shared)?
- Type checking of expressions is performed during which phase of a compiler?
- A string of length 5 is derived in a grammar in Chomsky normal form. How many derivation steps are required?
- Deterministic context-free languages are closed under
- Rice's theorem states that every non-trivial property of which of the following, for a Turing machine, is undecidable?