Discussion
Match each associativity declaration with the parser action taken on equal precedence.
List I
A. left associative
B. right associative
C. non associative
D. no declaration at all
List II
1. report an error
2. reduce
3. conflict reported by the generator
4. shift
Answer: D
Correct answer: A-2, B-4, C-1, D-3
Four declarations and four behaviours on equal precedence. Left associativity reduces, closing the left operand first; right associativity shifts, deferring the reduction; non-associativity reports an error, which is how a construct like a < b < c is forbidden outright; and with no declaration at all there is nothing to settle the conflict, so the generator reports it.
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