Compiler construction tables: Which permanent compiler table contains an entry for every terminal symbol of the language grammar?

Difficulty: Easy

Correct Answer: Terminal table

Explanation:


Introduction / Context:
Compilers maintain several symbol and support tables during lexical, syntax, and semantic analysis. Distinguishing between tables helps in understanding tokenization, parsing, and code generation phases in language processing.


Given Data / Assumptions:

  • The language has a formal grammar with terminals (tokens) and nonterminals.
  • We seek a table that catalogs terminals (keywords, operators, punctuation).
  • Tables like literal and identifier tables store program-specific entries.


Concept / Approach:
The terminal table lists all terminal symbols defined by the language: reserved words (if, while), operators (+, *), delimiters (;, ,), and so forth. It is part of the compiler’s static knowledge. By contrast, the literal table records constants from the current program (like 3.14), and the identifier table stores names declared by the program (variables, functions). “Reductions” is an action in parsing, not a static table of terminals.


Step-by-Step Solution:

Identify what “terminal symbols” means: basic tokens of the grammar.Select the table that is language-defined and permanent: terminal table.Eliminate program-dependent tables: literals and identifiers vary per source.Confirm reductions are parser operations, not a catalog.


Verification / Alternative check:
Compiler design texts describe token sets and reserved word/operator tables as part of the language specification embedded in the compiler.


Why Other Options Are Wrong:
Literal/identifier tables depend on the specific program being compiled. “Reductions” denote grammar actions in bottom-up parsing. “None of the above” is incorrect.


Common Pitfalls:
Confusing tokens seen in the current program with the full set of possible terminals defined by the language.


Final Answer:
Terminal table

More Questions from Operating Systems Concepts

Discussion & Comments

No comments yet. Be the first to comment!
Join Discussion