GATE CS 2024 Set 1 | Question 33
Compiler Design › Parser · NAT · 1 mark · Answer: 6
- Question 33Compiler Designnat1 markWith operator rules: (Highest, Left-assoc), (High, Right), (Medium, Right), (Low, Right), the value of is __________
Answer: 6
Solution
Answer: 6 Bind tightest-first. (highest) groups adjacent numbers: and . The expression becomes . Next (high, right-assoc): ... resolving right-to-left with then lowest:Carefully applying the given precedence and associativities, the fully parenthesized form evaluates to (integer arithmetic).
More GATE PYQ on Parser
All GATE CS Compiler Design PYQ →Attempt GATE CS 2024 Set 1 in real GATE exam mode
Full paper with a timer, the GATE interface and a topic-wise analysis — free.
Create free account →