Discussion
Consider the following statements about attribute classes.
1. Every S-attributed definition is also L-attributed.
2. Every L-attributed definition is also S-attributed.
3. L-attributed definitions can be evaluated in one depth first pass.
Answer: A
Correct answer: 1 and 3 only
Statements 1 and 3 are correct: an S-attributed definition has no inherited attributes at all, so it satisfies the L-attributed condition vacuously, and L-attributed definitions evaluate in one depth-first pass. Statement 2 reverses the containment - an L-attributed definition may use inherited attributes, which an S-attributed one by definition does not.
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