In compiler construction terminology, which table is a permanent database that keeps an entry for every terminal symbol of the grammar used by the language front end?

Difficulty: Easy

Correct Answer: Terminal table

Explanation:


Introduction / Context:
Language processors maintain several tables to speed up analysis and translation. Distinguishing among terminal, literal, and identifier tables clarifies how lexical and syntactic information is organized for efficient parsing and semantic analysis.


Given Data / Assumptions:

  • Grammar-based front end (lexer + parser).
  • Terminals are tokens such as keywords, operators, and punctuation.
  • Literals and identifiers are distinct token classes with their own tables.


Concept / Approach:
The terminal table (sometimes part of the token specification) enumerates all terminal symbols of the grammar. The literal table stores unique literal constants (numbers, strings). The identifier table records user-defined names and, later, semantic attributes placed in a symbol table. “Reductions” refers to parser actions, not a table.


Step-by-Step Solution:

Identify role of terminals: fixed set of tokens known at compiler build time.Associate each terminal with token codes and attributes (e.g., precedence).Keep literal and identifier information in their respective tables, separate from terminals.


Verification / Alternative check:
Inspect parser generators (e.g., yacc/bison) where token definitions correspond to a fixed terminal set, distinct from runtime-populated literal/identifier pools.


Why Other Options Are Wrong:

Literal table: stores constants, not the universe of terminals.Identifier table: stores user symbols, not grammar terminals.Reductions: parser operations, not a database of symbols.None of the above: incorrect because “Terminal table” is correct.


Common Pitfalls:
Confusing language-defined terminals (finite, fixed) with program-defined identifiers (unbounded, discovered during scanning).


Final Answer:
Terminal table.

More Questions from Language Processors

Discussion & Comments

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