Discussion
Match each phase with what it produces.
List I
A. lexical analysis
B. syntax analysis
C. semantic analysis
D. intermediate code generation
List II
1. an annotated syntax tree
2. a stream of tokens
3. three address code
4. a parse or syntax tree
Answer: C
Correct answer: A-2, B-4, C-1, D-3
Each phase transforms its predecessor's output. Lexical analysis produces a stream of tokens; syntax analysis groups them into a parse or syntax tree.
Semantic analysis decorates that tree with types, scopes and coercions, giving an annotated syntax tree. Intermediate code generation flattens it into three-address code, a machine-independent form on which optimisation can work. Reading the outputs as a sequence - characters, tokens, tree, annotated tree, three-address code - settles the whole matching.
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