Discussion
Consider the following statements about the symbol table.
1. It is created and used by several phases rather than by one.
2. It records attributes such as type, scope and storage location.
3. It is discarded as soon as syntax analysis is complete.
Answer: C
Correct answer: 1 and 2 only
The first two are correct. The symbol table is created during lexical and syntax analysis and consulted by every later phase, and it records type, scope, storage location and other attributes.
The third is false and would break the compiler. Semantic analysis needs the types, the intermediate code generator needs storage information, and the code generator needs offsets - all held there. The table is one of the few structures that persists across the whole compilation.
Post your comment
Please log in or register to post a comment.
Examination Categories
- SSC Exams
- Banking Exams
- Teaching Exams
- Civil Services Exams
- Railways Exams
- Engineering Recruitment Exams
- Defence Exams
- State Government Exams
- Police Exams
- Insurance Exams
- Nursing Exams
- Other Government Exams
- NRA CET
- PG Entrance Exams
- Campus Placement
- MBA Entrance Exams
- CUET and UG Entrance
- Judiciary Exams
- Regulatory Body Exams
- Software Development