Discussion
Arrange the steps of translating an assignment statement into three address code.
1. generate the instruction combining the operand temporaries
2. parse the right hand side into a tree or during the parse
3. generate the copy assigning the result to the left hand side
4. generate code for each subexpression into a temporary
Answer: D
Correct answer: 2 - 4 - 1 - 3
The order follows the structure of the expression. The right hand side is parsed, each subexpression is evaluated into a temporary, those temporaries are combined by the operator, and the result is finally copied to the left hand side. Generating the copy first would have nothing to copy.
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