How is a~b~c^d evaluated when both operators have same precedence and ~ and ^ are left and right associative respectively. Can somebody explain. Thanks
Asked
Active
Viewed 180 times
0
1 Answers
0
It isn't. Precedence and associativity are ways to disambiguate grammars and if you restrict your ability to use them, you're back to having ambiguous grammars. Conversely, deciding on one parse tree implies this problem does not exist. For instance, if you parse b~c^d as (b~c)^d, then either ~ has higher precedence or ^ is left associative.

robot1208
- 191
- 1
- 7