|
1 | 1 | import powershell
|
2 | 2 |
|
3 | 3 | class BinaryExpr extends @binary_expression, Expr {
|
4 |
| - override string toString() { |
5 |
| - result = "...+..." // TODO |
6 |
| - } |
7 |
| - |
8 | 4 | override SourceLocation getLocation() { binary_expression_location(this, result) }
|
9 | 5 |
|
10 |
| - private int getKind() { binary_expression(this, result, _, _) } |
| 6 | + int getKind() { binary_expression(this, result, _, _) } |
11 | 7 |
|
12 | 8 | Expr getLeft() { binary_expression(this, _, result, _) }
|
13 | 9 |
|
14 | 10 | Expr getRight() { binary_expression(this, _, _, result) }
|
15 | 11 | }
|
| 12 | + |
| 13 | +abstract private class AbstractArithmeticExpr extends BinaryExpr { } |
| 14 | + |
| 15 | +final class ArithmeticExpr = AbstractArithmeticExpr; |
| 16 | + |
| 17 | +class AddExpr extends AbstractArithmeticExpr { |
| 18 | + AddExpr() { this.getKind() = 40 } |
| 19 | + |
| 20 | + final override string toString() { result = "...+..." } |
| 21 | +} |
| 22 | + |
| 23 | +class SubExpr extends AbstractArithmeticExpr { |
| 24 | + SubExpr() { this.getKind() = 41 } |
| 25 | + |
| 26 | + final override string toString() { result = "...-..." } |
| 27 | +} |
| 28 | + |
| 29 | +class MulExpr extends AbstractArithmeticExpr { |
| 30 | + MulExpr() { this.getKind() = 37 } |
| 31 | + |
| 32 | + final override string toString() { result = "...*..." } |
| 33 | +} |
| 34 | + |
| 35 | +class DivExpr extends AbstractArithmeticExpr { |
| 36 | + DivExpr() { this.getKind() = 38 } |
| 37 | + |
| 38 | + final override string toString() { result = ".../..." } |
| 39 | +} |
| 40 | + |
| 41 | +class RemExpr extends AbstractArithmeticExpr { |
| 42 | + RemExpr() { this.getKind() = 39 } |
| 43 | + |
| 44 | + final override string toString() { result = "...%..." } |
| 45 | +} |
| 46 | + |
| 47 | +abstract private class AbstractBitwiseExpr extends BinaryExpr { } |
| 48 | + |
| 49 | +final class BitwiseExpr = AbstractBitwiseExpr; |
| 50 | + |
| 51 | +class BitwiseAndExpr extends AbstractBitwiseExpr { |
| 52 | + BitwiseAndExpr() { this.getKind() = 56 } |
| 53 | + |
| 54 | + final override string toString() { result = "...&..." } |
| 55 | +} |
| 56 | + |
| 57 | +class BitwiseOrExpr extends AbstractBitwiseExpr { |
| 58 | + BitwiseOrExpr() { this.getKind() = 57 } |
| 59 | + |
| 60 | + final override string toString() { result = "...|..." } |
| 61 | +} |
| 62 | + |
| 63 | +class BitwiseXorExpr extends AbstractBitwiseExpr { |
| 64 | + BitwiseXorExpr() { this.getKind() = 58 } |
| 65 | + |
| 66 | + final override string toString() { result = "...^..." } |
| 67 | +} |
| 68 | + |
| 69 | +class ShiftLeftExpr extends AbstractBitwiseExpr { |
| 70 | + ShiftLeftExpr() { this.getKind() = 97 } |
| 71 | + |
| 72 | + final override string toString() { result = "...<<..." } |
| 73 | +} |
| 74 | + |
| 75 | +class ShiftRightExpr extends AbstractBitwiseExpr { |
| 76 | + ShiftRightExpr() { this.getKind() = 98 } |
| 77 | + |
| 78 | + final override string toString() { result = "...>>..." } |
| 79 | +} |
| 80 | + |
| 81 | +abstract private class AbstractComparisonExpr extends BinaryExpr { } |
| 82 | + |
| 83 | +final class ComparisonExpr = AbstractComparisonExpr; |
| 84 | + |
| 85 | +abstract private class AbstractCaseInsensitiveComparisonExpr extends AbstractComparisonExpr { } |
| 86 | + |
| 87 | +final class CaseInsensitiveComparisonExpr = AbstractCaseInsensitiveComparisonExpr; |
| 88 | + |
| 89 | +class EqExpr extends AbstractCaseInsensitiveComparisonExpr { |
| 90 | + EqExpr() { this.getKind() = 60 } |
| 91 | + |
| 92 | + final override string toString() { result = "... -eq ..." } |
| 93 | +} |
| 94 | + |
| 95 | +class NeExpr extends AbstractCaseInsensitiveComparisonExpr { |
| 96 | + NeExpr() { this.getKind() = 61 } |
| 97 | + |
| 98 | + final override string toString() { result = "... -ne ..." } |
| 99 | +} |
| 100 | + |
| 101 | +abstract private class AbstractRelationalExpr extends AbstractComparisonExpr { } |
| 102 | + |
| 103 | +final class RelationalExpr = AbstractRelationalExpr; |
| 104 | + |
| 105 | +abstract private class AbstractCaseInsensitiveRelationalExpr extends AbstractRelationalExpr { } |
| 106 | + |
| 107 | +class GeExpr extends AbstractCaseInsensitiveRelationalExpr { |
| 108 | + GeExpr() { this.getKind() = 62 } |
| 109 | + |
| 110 | + final override string toString() { result = "... -ge ..." } |
| 111 | +} |
| 112 | + |
| 113 | +class GtExpr extends AbstractCaseInsensitiveRelationalExpr { |
| 114 | + GtExpr() { this.getKind() = 63 } |
| 115 | + |
| 116 | + final override string toString() { result = "... -gt ..." } |
| 117 | +} |
| 118 | + |
| 119 | +class LtExpr extends AbstractCaseInsensitiveRelationalExpr { |
| 120 | + LtExpr() { this.getKind() = 64 } |
| 121 | + |
| 122 | + final override string toString() { result = "... -lt ..." } |
| 123 | +} |
| 124 | + |
| 125 | +class LeExpr extends AbstractCaseInsensitiveRelationalExpr { |
| 126 | + LeExpr() { this.getKind() = 65 } |
| 127 | + |
| 128 | + final override string toString() { result = "... -le ..." } |
| 129 | +} |
| 130 | + |
| 131 | +class LikeExpr extends AbstractCaseInsensitiveComparisonExpr { |
| 132 | + LikeExpr() { this.getKind() = 66 } |
| 133 | + |
| 134 | + final override string toString() { result = "... -like ..." } |
| 135 | +} |
| 136 | + |
| 137 | +class NotLikeExpr extends AbstractCaseInsensitiveComparisonExpr { |
| 138 | + NotLikeExpr() { this.getKind() = 67 } |
| 139 | + |
| 140 | + final override string toString() { result = "... -notlike ..." } |
| 141 | +} |
| 142 | + |
| 143 | +class MatchExpr extends AbstractCaseInsensitiveComparisonExpr { |
| 144 | + MatchExpr() { this.getKind() = 68 } |
| 145 | + |
| 146 | + final override string toString() { result = "... -match ..." } |
| 147 | +} |
| 148 | + |
| 149 | +class NotMatchExpr extends AbstractCaseInsensitiveComparisonExpr { |
| 150 | + NotMatchExpr() { this.getKind() = 69 } |
| 151 | + |
| 152 | + final override string toString() { result = "... -notmatch ..." } |
| 153 | +} |
| 154 | + |
| 155 | +class ReplaceExpr extends AbstractCaseInsensitiveComparisonExpr { |
| 156 | + ReplaceExpr() { this.getKind() = 70 } |
| 157 | + |
| 158 | + final override string toString() { result = "... -replace ..." } |
| 159 | +} |
| 160 | + |
| 161 | +abstract class AbstractTypeExpr extends BinaryExpr { } |
| 162 | + |
| 163 | +final class TypeExpr = AbstractTypeExpr; |
| 164 | + |
| 165 | +abstract class AbstractTypeComparisonExpr extends AbstractTypeExpr { } |
| 166 | + |
| 167 | +final class TypeComparisonExpr = AbstractTypeComparisonExpr; |
| 168 | + |
| 169 | +class IsExpr extends AbstractTypeComparisonExpr { |
| 170 | + IsExpr() { this.getKind() = 92 } |
| 171 | + |
| 172 | + final override string toString() { result = "... -is ..." } |
| 173 | +} |
| 174 | + |
| 175 | +class IsNotExpr extends AbstractTypeComparisonExpr { |
| 176 | + IsNotExpr() { this.getKind() = 93 } |
| 177 | + |
| 178 | + final override string toString() { result = "... -isnot ..." } |
| 179 | +} |
| 180 | + |
| 181 | +class AsExpr extends AbstractTypeExpr { |
| 182 | + AsExpr() { this.getKind() = 94 } |
| 183 | + |
| 184 | + final override string toString() { result = "... -as ..." } |
| 185 | +} |
| 186 | + |
| 187 | +abstract private class AbstractContainmentExpr extends BinaryExpr { } |
| 188 | + |
| 189 | +final class ContainmentExpr = AbstractContainmentExpr; |
| 190 | + |
| 191 | +abstract private class AbstractCaseInsensitiveContainmentExpr extends AbstractContainmentExpr { } |
| 192 | + |
| 193 | +final class CaseInsensitiveContainmentExpr = AbstractCaseInsensitiveContainmentExpr; |
| 194 | + |
| 195 | +class ContainsExpr extends AbstractCaseInsensitiveContainmentExpr { |
| 196 | + ContainsExpr() { this.getKind() = 71 } |
| 197 | + |
| 198 | + final override string toString() { result = "... -contains ..." } |
| 199 | +} |
| 200 | + |
| 201 | +class NotContainsExpr extends AbstractCaseInsensitiveContainmentExpr { |
| 202 | + NotContainsExpr() { this.getKind() = 72 } |
| 203 | + |
| 204 | + final override string toString() { result = "... -notcontains ..." } |
| 205 | +} |
| 206 | + |
| 207 | +class InExpr extends AbstractCaseInsensitiveContainmentExpr { |
| 208 | + InExpr() { this.getKind() = 73 } |
| 209 | + |
| 210 | + final override string toString() { result = "... -in ..." } |
| 211 | +} |
| 212 | + |
| 213 | +class NotInExpr extends AbstractCaseInsensitiveContainmentExpr { |
| 214 | + NotInExpr() { this.getKind() = 74 } |
| 215 | + |
| 216 | + final override string toString() { result = "... -notin ..." } |
| 217 | +} |
| 218 | + |
| 219 | +abstract private class AbstractLogicalBinaryExpr extends BinaryExpr { } |
| 220 | + |
| 221 | +final class LogicalBinaryExpr = AbstractLogicalBinaryExpr; |
| 222 | + |
| 223 | +class LogicalAndExpr extends AbstractLogicalBinaryExpr { |
| 224 | + LogicalAndExpr() { this.getKind() = 53 } |
| 225 | + |
| 226 | + final override string toString() { result = "... -and ..." } |
| 227 | +} |
| 228 | + |
| 229 | +class LogicalOrExpr extends AbstractLogicalBinaryExpr { |
| 230 | + LogicalOrExpr() { this.getKind() = 54 } |
| 231 | + |
| 232 | + final override string toString() { result = "... -or ..." } |
| 233 | +} |
| 234 | + |
| 235 | +class LogicalXorExpr extends AbstractLogicalBinaryExpr { |
| 236 | + LogicalXorExpr() { this.getKind() = 55 } |
| 237 | + |
| 238 | + final override string toString() { result = "... -xor ..." } |
| 239 | +} |
| 240 | + |
| 241 | +abstract private class AbstractStringExpr extends BinaryExpr { } |
| 242 | + |
| 243 | +final class StringExpr = AbstractStringExpr; |
| 244 | + |
| 245 | +class JoinExpr extends AbstractStringExpr { |
| 246 | + JoinExpr() { this.getKind() = 59 } |
| 247 | + |
| 248 | + final override string toString() { result = "... -join ..." } |
| 249 | +} |
| 250 | + |
| 251 | +class SplitExpr extends AbstractStringExpr { |
| 252 | + SplitExpr() { this.getKind() = 75 } |
| 253 | + |
| 254 | + final override string toString() { result = "... -split ..." } |
| 255 | +} |
0 commit comments