Discussion
Match each error with the phase that detects it.
List I
A. an illegal character in the source
B. an unbalanced parenthesis
C. adding an integer to a function name
D. a call to an undefined external routine
List II
1. semantic analysis
2. lexical analysis
3. linking
4. syntax analysis
Answer: A
Correct answer: A-2, B-4, C-1, D-3
Each error surfaces at the level where the property it violates is checked. An illegal character cannot form any token, so lexical analysis catches it.
An unbalanced parenthesis is a well-formed sequence of tokens that fits no production, so syntax analysis catches it. Adding an integer to a function name is grammatically legal but meaningless, so semantic analysis catches it. An undefined external routine is unresolvable only when all modules are present, so the linker catches it - character, form, meaning, then program-wide resolution.
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