Difficulty: Easy
Correct Answer: Literal table
Explanation:
Introduction / Context:
Compilers break down source code through lexical analysis (tokenization), syntax analysis (parsing), and semantic analysis. Along the way they build tables of symbols to drive later stages of translation and optimization.
Given Data / Assumptions:
Concept / Approach:
A literal table stores each distinct literal constant, often with attributes such as type, value, and sometimes storage placement. This enables deduplication and consistent handling in later phases, including code generation where literals may be placed in constant pools or data segments.
Step-by-Step Solution:
Verification / Alternative check:
Compiler design references list symbol tables for identifiers and separate literal tables or constant pools for numeric and string constants.
Why Other Options Are Wrong:
Common Pitfalls:
Assuming all tokens go into a single symbol table; in practice, compilers separate identifiers from literals for clarity and efficiency.
Final Answer:
Literal table
Discussion & Comments