Discussion
A language that requires declaration before use is easier to compile in a single pass because
Answer: C
Correct answer: the symbol table entry exists before the name is ever referenced
A single-pass compiler must generate code for a reference at the moment it meets it, which requires the name's type, size and storage already to be known.
Declaration before use guarantees exactly that: the declaration has been processed and the symbol table entry created before any use is scanned. Without the rule, a forward reference would have to be left incomplete and filled in later - backpatching, or a second pass. Semantic analysis is still required, and the rule says nothing about ambiguity.
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