Consider the following parse tree for the expression a#b$c$d#e#f, involving two binary operators $ and #.
Which one of the following is correct for the given parse tree?
Tap to open full sizeFigure description
Parse tree. Root node # has two children: leaf a (left) and an internal node # (right). That right # node has two children: an internal node (left) and an internal # node (right). The left node has two children: an internal node (left) whose children are leaves b and c, and leaf d (right). The right # node has two children: leaf e (left) and leaf f (right). Leaves read left to right: a, b, c, d, e, f.
- (A)
$has higher precedence and is left associative;#is right associative - (B)
#has higher precedence and is left associative;$is right associative - (C)
$has higher precedence and is left associative;#is left associative - (D)
#has higher precedence and is right associative;$is left associative