Lines 1725-1739
Link Here
|
1725 |
} |
1725 |
} |
1726 |
} else if (expr1 instanceof CombinedBinaryExpression) { |
1726 |
} else if (expr1 instanceof CombinedBinaryExpression) { |
1727 |
CombinedBinaryExpression cursor; |
1727 |
CombinedBinaryExpression cursor; |
|
|
1728 |
int numberOfParens = (expr1.bits & ASTNode.ParenthesizedMASK) >> ASTNode.ParenthesizedSHIFT; |
1728 |
// shift cursor; create BE/CBE as needed |
1729 |
// shift cursor; create BE/CBE as needed |
1729 |
if ((cursor = (CombinedBinaryExpression)expr1).arity < |
1730 |
if ((cursor = (CombinedBinaryExpression)expr1).arity < |
1730 |
cursor.arityMax) { |
1731 |
cursor.arityMax) { |
1731 |
cursor.left = new BinaryExpression(cursor.left, |
1732 |
cursor.left = new BinaryExpression(cursor.left, |
1732 |
cursor.right, PLUS); |
1733 |
cursor.right, PLUS); |
|
|
1734 |
if (numberOfParens != 0) { |
1735 |
// clear the bits on cursor and put them back on cursor.left |
1736 |
cursor.bits &= ~ASTNode.ParenthesizedMASK; |
1737 |
cursor.left.bits &= ~ASTNode.ParenthesizedMASK; |
1738 |
cursor.left.bits |= numberOfParens << ASTNode.ParenthesizedSHIFT; |
1739 |
} |
1733 |
cursor.arity++; |
1740 |
cursor.arity++; |
1734 |
} else { |
1741 |
} else { |
1735 |
cursor.left = new CombinedBinaryExpression(cursor.left, |
1742 |
cursor.left = new CombinedBinaryExpression(cursor.left, |
1736 |
cursor.right, PLUS, cursor.arity); |
1743 |
cursor.right, PLUS, cursor.arity); |
|
|
1744 |
if (numberOfParens != 0) { |
1745 |
// clear the bits on cursor and put them back on cursor.left |
1746 |
cursor.bits &= ~ASTNode.ParenthesizedMASK; |
1747 |
cursor.left.bits &= ~ASTNode.ParenthesizedMASK; |
1748 |
cursor.left.bits |= numberOfParens << ASTNode.ParenthesizedSHIFT; |
1749 |
} |
1737 |
cursor.arity = 0; |
1750 |
cursor.arity = 0; |
1738 |
cursor.tuneArityMax(); |
1751 |
cursor.tuneArityMax(); |
1739 |
} |
1752 |
} |
Lines 1743-1752
Link Here
|
1743 |
// cursor.depthTracker = ((BinaryExpression)cursor.left). |
1756 |
// cursor.depthTracker = ((BinaryExpression)cursor.left). |
1744 |
// depthTracker + 1; |
1757 |
// depthTracker + 1; |
1745 |
this.expressionStack[this.expressionPtr] = cursor; |
1758 |
this.expressionStack[this.expressionPtr] = cursor; |
1746 |
} else if (expr1 instanceof BinaryExpression && |
1759 |
} else if (expr1 instanceof BinaryExpression |
1747 |
// single out the a + b case |
1760 |
&& ((expr1.bits & ASTNode.OperatorMASK) >> |
1748 |
((expr1.bits & ASTNode.OperatorMASK) >> |
|
|
1749 |
ASTNode.OperatorSHIFT) == OperatorIds.PLUS) { |
1761 |
ASTNode.OperatorSHIFT) == OperatorIds.PLUS) { |
|
|
1762 |
// single out the a + b case |
1750 |
this.expressionStack[this.expressionPtr] = |
1763 |
this.expressionStack[this.expressionPtr] = |
1751 |
new CombinedBinaryExpression(expr1, expr2, PLUS, 1); |
1764 |
new CombinedBinaryExpression(expr1, expr2, PLUS, 1); |
1752 |
} else { |
1765 |
} else { |
Lines 1767-1773
Link Here
|
1767 |
new BinaryExpression( |
1780 |
new BinaryExpression( |
1768 |
expr1, |
1781 |
expr1, |
1769 |
expr2, |
1782 |
expr2, |
1770 |
op); |
1783 |
op); |
1771 |
} |
1784 |
} |
1772 |
} |
1785 |
} |
1773 |
/** |
1786 |
/** |