|
| 1 | +/** |
| 2 | + * Provides classes for operations that also have compound assignment forms. |
| 3 | + */ |
| 4 | + |
| 5 | +import Expr |
| 6 | + |
| 7 | +/** A binary operation that involves a null-coalescing operation. */ |
| 8 | +abstract private class NullCoalescingOperationImpl extends BinaryOperation { } |
| 9 | + |
| 10 | +final class NullCoalescingOperation = NullCoalescingOperationImpl; |
| 11 | + |
| 12 | +private class AddNullCoalescingExpr extends NullCoalescingOperationImpl instanceof NullCoalescingExpr |
| 13 | +{ } |
| 14 | + |
| 15 | +private class AddAssignCoalesceExpr extends NullCoalescingOperationImpl instanceof AssignCoalesceExpr |
| 16 | +{ } |
| 17 | + |
| 18 | +/** A binary operations that involves an addition operation. */ |
| 19 | +abstract private class AddOperationImpl extends BinaryOperation { } |
| 20 | + |
| 21 | +final class AddOperation = AddOperationImpl; |
| 22 | + |
| 23 | +private class AddAddExpr extends AddOperationImpl instanceof AddExpr { } |
| 24 | + |
| 25 | +private class AddAssignExpr extends AddOperationImpl instanceof AssignAddExpr { } |
| 26 | + |
| 27 | +/** A binary operation that involves a subtraction operation. */ |
| 28 | +abstract private class SubOperationImpl extends BinaryOperation { } |
| 29 | + |
| 30 | +final class SubOperation = SubOperationImpl; |
| 31 | + |
| 32 | +private class AddSubExpr extends SubOperationImpl instanceof SubExpr { } |
| 33 | + |
| 34 | +private class AddSubAssignExpr extends SubOperationImpl instanceof AssignSubExpr { } |
| 35 | + |
| 36 | +/** A binary operation that involves a multiplication operation. */ |
| 37 | +abstract private class MulOperationImpl extends BinaryOperation { } |
| 38 | + |
| 39 | +final class MulOperation = MulOperationImpl; |
| 40 | + |
| 41 | +private class AddMulExpr extends MulOperationImpl instanceof MulExpr { } |
| 42 | + |
| 43 | +private class AddMulAssignExpr extends MulOperationImpl instanceof AssignMulExpr { } |
| 44 | + |
| 45 | +/** A binary operation that involves a division operation. */ |
| 46 | +abstract private class DivOperationImpl extends BinaryOperation { |
| 47 | + /** Gets the denominator of this division operation. */ |
| 48 | + Expr getDenominator() { result = this.getRightOperand() } |
| 49 | +} |
| 50 | + |
| 51 | +final class DivOperation = DivOperationImpl; |
| 52 | + |
| 53 | +private class AddDivExpr extends DivOperationImpl instanceof DivExpr { } |
| 54 | + |
| 55 | +private class AddDivAssignExpr extends DivOperationImpl instanceof AssignDivExpr { } |
| 56 | + |
| 57 | +/** A binary operation that involves a remainder operation. */ |
| 58 | +abstract private class RemOperationImpl extends BinaryOperation { } |
| 59 | + |
| 60 | +final class RemOperation = RemOperationImpl; |
| 61 | + |
| 62 | +private class AddRemExpr extends RemOperationImpl instanceof RemExpr { } |
| 63 | + |
| 64 | +private class AddRemAssignExpr extends RemOperationImpl instanceof AssignRemExpr { } |
| 65 | + |
| 66 | +/** A binary operation that involves a bitwise AND operation. */ |
| 67 | +abstract private class BitwiseAndOperationImpl extends BinaryOperation { } |
| 68 | + |
| 69 | +final class BitwiseAndOperation = BitwiseAndOperationImpl; |
| 70 | + |
| 71 | +private class AddBitwiseAndExpr extends BitwiseAndOperationImpl instanceof BitwiseAndExpr { } |
| 72 | + |
| 73 | +private class AddAssignBitwiseAndExpr extends BitwiseAndOperationImpl instanceof AssignAndExpr { } |
| 74 | + |
| 75 | +/** A binary operation that involves a bitwise OR operation. */ |
| 76 | +abstract private class BitwiseOrOperationImpl extends BinaryOperation { } |
| 77 | + |
| 78 | +final class BitwiseOrOperation = BitwiseOrOperationImpl; |
| 79 | + |
| 80 | +private class AddBitwiseOrExpr extends BitwiseOrOperationImpl instanceof BitwiseOrExpr { } |
| 81 | + |
| 82 | +private class AddAssignBitwiseOrExpr extends BitwiseOrOperationImpl instanceof AssignOrExpr { } |
| 83 | + |
| 84 | +/** A binary operation that involves a bitwise XOR operation. */ |
| 85 | +abstract private class BitwiseXorOperationImpl extends BinaryOperation { } |
| 86 | + |
| 87 | +final class BitwiseXorOperation = BitwiseXorOperationImpl; |
| 88 | + |
| 89 | +private class AddBitwiseXorExpr extends BitwiseXorOperationImpl instanceof BitwiseXorExpr { } |
| 90 | + |
| 91 | +private class AddAssignBitwiseXorExpr extends BitwiseXorOperationImpl instanceof AssignXorExpr { } |
| 92 | + |
| 93 | +/** A binary operation that involves a left shift operation. */ |
| 94 | +abstract private class LeftShiftOperationImpl extends BinaryOperation { } |
| 95 | + |
| 96 | +final class LeftShiftOperation = LeftShiftOperationImpl; |
| 97 | + |
| 98 | +private class AddLeftShiftExpr extends LeftShiftOperationImpl instanceof LeftShiftExpr { } |
| 99 | + |
| 100 | +private class AddAssignLeftShiftExpr extends LeftShiftOperationImpl instanceof AssignLeftShiftExpr { |
| 101 | +} |
| 102 | + |
| 103 | +/** A binary operation that involves a right shift operation. */ |
| 104 | +abstract private class RightShiftOperationImpl extends BinaryOperation { } |
| 105 | + |
| 106 | +final class RightShiftOperation = RightShiftOperationImpl; |
| 107 | + |
| 108 | +private class AddRightShiftExpr extends RightShiftOperationImpl instanceof RightShiftExpr { } |
| 109 | + |
| 110 | +private class AddAssignRightShiftExpr extends RightShiftOperationImpl instanceof AssignRightShiftExpr |
| 111 | +{ } |
| 112 | + |
| 113 | +/** A binary operation that involves a unsigned right shift operation. */ |
| 114 | +abstract private class UnsignedRightShiftOperationImpl extends BinaryOperation { } |
| 115 | + |
| 116 | +final class UnsignedRightShiftOperation = UnsignedRightShiftOperationImpl; |
| 117 | + |
| 118 | +private class AddUnsignedRightShiftExpr extends UnsignedRightShiftOperationImpl instanceof UnsignedRightShiftExpr |
| 119 | +{ } |
| 120 | + |
| 121 | +private class AddAssignUnsignedRightShiftExpr extends UnsignedRightShiftOperationImpl instanceof AssignUnsignedRightShiftExpr |
| 122 | +{ } |
0 commit comments