@@ -15,6 +15,14 @@ class ArithmeticOperation extends Operation, @arith_operation {
1515 override string getOperator ( ) { none ( ) }
1616}
1717
18+ /**
19+ * A binary arithmetic operation. Either a binary arithmetic expression (`BinaryArithmeticExpr`) or
20+ * an arithmetic assignment operation (`AssignArithmeticExpr`).
21+ */
22+ class BinaryArithmeticOperation extends ArithmeticOperation , BinaryOperation , @bin_arith_operation {
23+ override string getOperator ( ) { none ( ) }
24+ }
25+
1826/**
1927 * A unary arithmetic operation. Either a unary minus operation
2028 * (`UnaryMinusExpr`), a unary plus operation (`UnaryPlusExpr`),
@@ -94,6 +102,37 @@ class PostDecrExpr extends DecrementOperation, @post_decr_expr {
94102 override string getAPrimaryQlClass ( ) { result = "PostDecrExpr" }
95103}
96104
105+ /**
106+ * An addition operation, either `x + y` or `x += y`.
107+ */
108+ class AddOperation extends BinaryArithmeticOperation , @add_operation { }
109+
110+ /**
111+ * A subtraction operation, either `x - y` or `x -= y`.
112+ */
113+ class SubOperation extends BinaryArithmeticOperation , @sub_operation { }
114+
115+ /**
116+ * A multiplication operation, either `x * y` or `x *= y`.
117+ */
118+ class MulOperation extends BinaryArithmeticOperation , @mul_operation { }
119+
120+ /**
121+ * A division operation, either `x / y` or `x /= y`.
122+ */
123+ class DivOperation extends BinaryArithmeticOperation , @div_operation {
124+ /** Gets the numerator of this division operation. */
125+ Expr getNumerator ( ) { result = this .getLeftOperand ( ) }
126+
127+ /** Gets the denominator of this division operation. */
128+ Expr getDenominator ( ) { result = this .getRightOperand ( ) }
129+ }
130+
131+ /**
132+ * A remainder operation, either `x % y` or `x %= y`.
133+ */
134+ class RemOperation extends BinaryArithmeticOperation , @rem_operation { }
135+
97136/**
98137 * A binary arithmetic expression. Either an addition expression
99138 * (`AddExpr`), a subtraction expression (`SubExpr`), a multiplication
0 commit comments