Consider the following statements: S₁: A parse table is the data structure in…

Consider the following statements:

S₁: A parse table is the data structure in a compiler that is used for managing information about variables and their attributes.

S₂: Every deterministic context-free language has an LR(1) grammar.

Select the correct option:

Answer: C. S₁ is false, while S₂ is trueCorrect answer: S₁ is false, while S₂ is true. S₁ is false because the data structure used to store information about identifiers, variables, types, scopes,…

  1. A.

    Both S₁ and S₂ are true

  2. B.

    S₁ is true, while S₂ is false

  3. C.

    S₁ is false, while S₂ is true

  4. D.

    Both S₁ and S₂ are false

Attempted by 47 students.

Show answer & explanation

Correct answer: C

Correct answer: S₁ is false, while S₂ is true.

S₁ is false because the data structure used to store information about identifiers, variables, types, scopes, and attributes is the symbol table, not the parse table. A parse table is used by a parser to choose parsing actions or productions.

S₂ is true in the standard compiler-theory sense: deterministic context-free languages are exactly the class that can be described by LR(k) grammars, and they can be represented by an LR(1) grammar.

Therefore, S₁ is false and S₂ is true.

Explore the full course: Gate Guidance By Sanchit Sir

Loading lesson…