Given the following statements: S₁: SLR uses FOLLOW information to guide…

2013

Given the following statements:

S₁: SLR uses FOLLOW information to guide reductions. In case of LR and LALR parsers, the lookahead are associated with the items and they make use of the left context available to the parser.

S₂: LR grammar is a larger subclass of context-free grammar as compared to that SLR and LALR grammars.

Which of the following is true?

  1. A.

    S₁ is not correct and S₂ is not correct

  2. B.

    S₁ is not correct and S₂ is correct

  3. C.

    S₁ is correct and S₂ is not correct

  4. D.

    S₁ is correct and S₂ is correct

Attempted by 16 students.

Show answer & explanation

Correct answer: D

Statement S₁ is correct because SLR parsers utilize FOLLOW sets to determine reductions, whereas LR and LALR parsers associate lookahead symbols directly with items. Statement S₂ is accurate as LR grammars represent a broader class that encompasses both SLR and LALR grammars. Therefore, both statements are technically true regarding parsing theory hierarchies.

A video solution is available for this question — log in and enroll to watch it.

Explore the full course: Nta Ugc Net Paper 2

Loading lesson…