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 true — 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,…
- A.
Both S₁ and S₂ are true
- B.
S₁ is true, while S₂ is false
- C.
S₁ is false, while S₂ is true
- 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.