@@ -63,25 +63,70 @@ class Ptrdiff_t extends Type {
63
63
override string getAPrimaryQlClass ( ) { result = "Ptrdiff_t" }
64
64
}
65
65
66
+ /**
67
+ * A parent class representing C/C++ typedef'd `UserTypes` such as `int8_t`.
68
+ */
69
+ private class IntegralUnderlyingUserType extends UserType {
70
+ IntegralUnderlyingUserType ( ) { this .getUnderlyingType ( ) instanceof IntegralType }
71
+ }
72
+
66
73
/**
67
74
* A C/C++ fixed-width numeric type, such as `int8_t`.
68
75
*/
69
- abstract class FixedWidthIntegralType extends UserType {
70
- FixedWidthIntegralType ( ) { this .getUnderlyingType ( ) instanceof IntegralType }
76
+ class FixedWidthIntegralType extends UserType {
77
+ FixedWidthIntegralType ( ) {
78
+ this instanceof Int8_t or
79
+ this instanceof Int16_t or
80
+ this instanceof Int32_t or
81
+ this instanceof Int64_t or
82
+ this instanceof UInt8_t or
83
+ this instanceof UInt16_t or
84
+ this instanceof UInt32_t or
85
+ this instanceof UInt64_t
86
+ }
87
+ }
88
+
89
+ /**
90
+ * A C/C++ minimum-width numeric type, such as `int_least8_t`.
91
+ */
92
+ class MinimumWidthIntegralType extends UserType {
93
+ MinimumWidthIntegralType ( ) {
94
+ this instanceof Int_least8_t or
95
+ this instanceof Int_least16_t or
96
+ this instanceof Int_least32_t or
97
+ this instanceof Int_least64_t or
98
+ this instanceof UInt_least8_t or
99
+ this instanceof UInt_least16_t or
100
+ this instanceof UInt_least32_t or
101
+ this instanceof UInt_least64_t
102
+ }
71
103
}
72
104
73
105
/**
74
- * A C/C++ minimum-width numeric type, such as `int_least8_t` or `uint_fast16_t`.
106
+ * A C/C++ minimum-width numeric type, representing the fastest integer type with a
107
+ * width of at least `N` such as `int_fast8_t`.
75
108
*/
76
- abstract class MinimumWidthIntegralType extends UserType {
77
- MinimumWidthIntegralType ( ) { this .getUnderlyingType ( ) instanceof IntegralType }
109
+ class FastestMinimumWidthIntegralType extends UserType {
110
+ FastestMinimumWidthIntegralType ( ) {
111
+ this instanceof Int_fast8_t or
112
+ this instanceof Int_fast16_t or
113
+ this instanceof Int_fast32_t or
114
+ this instanceof Int_fast64_t or
115
+ this instanceof UInt_fast8_t or
116
+ this instanceof UInt_fast16_t or
117
+ this instanceof UInt_fast32_t or
118
+ this instanceof UInt_fast64_t
119
+ }
78
120
}
79
121
80
122
/**
81
123
* A C/C++ maximum-width numeric type, either `intmax_t` or `uintmax_t`.
82
124
*/
83
- abstract class MaximumWidthIntegralType extends UserType {
84
- MaximumWidthIntegralType ( ) { this .getUnderlyingType ( ) instanceof IntegralType }
125
+ class MaximumWidthIntegralType extends UserType {
126
+ MaximumWidthIntegralType ( ) {
127
+ this instanceof Intmax_t or
128
+ this instanceof Uintmax_t
129
+ }
85
130
}
86
131
87
132
/**
@@ -94,7 +139,7 @@ class FixedWidthEnumType extends UserType {
94
139
/**
95
140
* The C/C++ `int8_t` type.
96
141
*/
97
- class Int8_t extends FixedWidthIntegralType {
142
+ class Int8_t extends IntegralUnderlyingUserType {
98
143
Int8_t ( ) { this .hasGlobalOrStdName ( "int8_t" ) }
99
144
100
145
override string getAPrimaryQlClass ( ) { result = "Int8_t" }
@@ -103,7 +148,7 @@ class Int8_t extends FixedWidthIntegralType {
103
148
/**
104
149
* The C/C++ `int16_t` type.
105
150
*/
106
- class Int16_t extends FixedWidthIntegralType {
151
+ class Int16_t extends IntegralUnderlyingUserType {
107
152
Int16_t ( ) { this .hasGlobalOrStdName ( "int16_t" ) }
108
153
109
154
override string getAPrimaryQlClass ( ) { result = "Int16_t" }
@@ -112,7 +157,7 @@ class Int16_t extends FixedWidthIntegralType {
112
157
/**
113
158
* The C/C++ `int32_t` type.
114
159
*/
115
- class Int32_t extends FixedWidthIntegralType {
160
+ class Int32_t extends IntegralUnderlyingUserType {
116
161
Int32_t ( ) { this .hasGlobalOrStdName ( "int32_t" ) }
117
162
118
163
override string getAPrimaryQlClass ( ) { result = "Int32_t" }
@@ -121,7 +166,7 @@ class Int32_t extends FixedWidthIntegralType {
121
166
/**
122
167
* The C/C++ `int64_t` type.
123
168
*/
124
- class Int64_t extends FixedWidthIntegralType {
169
+ class Int64_t extends IntegralUnderlyingUserType {
125
170
Int64_t ( ) { this .hasGlobalOrStdName ( "int64_t" ) }
126
171
127
172
override string getAPrimaryQlClass ( ) { result = "Int64_t" }
@@ -130,7 +175,7 @@ class Int64_t extends FixedWidthIntegralType {
130
175
/**
131
176
* The C/C++ `uint8_t` type.
132
177
*/
133
- class UInt8_t extends FixedWidthIntegralType {
178
+ class UInt8_t extends IntegralUnderlyingUserType {
134
179
UInt8_t ( ) { this .hasGlobalOrStdName ( "uint8_t" ) }
135
180
136
181
override string getAPrimaryQlClass ( ) { result = "UInt8_t" }
@@ -139,7 +184,7 @@ class UInt8_t extends FixedWidthIntegralType {
139
184
/**
140
185
* The C/C++ `uint16_t` type.
141
186
*/
142
- class UInt16_t extends FixedWidthIntegralType {
187
+ class UInt16_t extends IntegralUnderlyingUserType {
143
188
UInt16_t ( ) { this .hasGlobalOrStdName ( "uint16_t" ) }
144
189
145
190
override string getAPrimaryQlClass ( ) { result = "UInt16_t" }
@@ -148,7 +193,7 @@ class UInt16_t extends FixedWidthIntegralType {
148
193
/**
149
194
* The C/C++ `uint32_t` type.
150
195
*/
151
- class UInt32_t extends FixedWidthIntegralType {
196
+ class UInt32_t extends IntegralUnderlyingUserType {
152
197
UInt32_t ( ) { this .hasGlobalOrStdName ( "uint32_t" ) }
153
198
154
199
override string getAPrimaryQlClass ( ) { result = "UInt32_t" }
@@ -157,7 +202,7 @@ class UInt32_t extends FixedWidthIntegralType {
157
202
/**
158
203
* The C/C++ `uint64_t` type.
159
204
*/
160
- class UInt64_t extends FixedWidthIntegralType {
205
+ class UInt64_t extends IntegralUnderlyingUserType {
161
206
UInt64_t ( ) { this .hasGlobalOrStdName ( "uint64_t" ) }
162
207
163
208
override string getAPrimaryQlClass ( ) { result = "UInt64_t" }
@@ -166,7 +211,7 @@ class UInt64_t extends FixedWidthIntegralType {
166
211
/**
167
212
* The C/C++ `int_least8_t` type.
168
213
*/
169
- class Int_least8_t extends MinimumWidthIntegralType {
214
+ class Int_least8_t extends IntegralUnderlyingUserType {
170
215
Int_least8_t ( ) { this .hasGlobalOrStdName ( "int_least8_t" ) }
171
216
172
217
override string getAPrimaryQlClass ( ) { result = "Int_least8_t" }
@@ -175,7 +220,7 @@ class Int_least8_t extends MinimumWidthIntegralType {
175
220
/**
176
221
* The C/C++ `int_least16_t` type.
177
222
*/
178
- class Int_least16_t extends MinimumWidthIntegralType {
223
+ class Int_least16_t extends IntegralUnderlyingUserType {
179
224
Int_least16_t ( ) { this .hasGlobalOrStdName ( "int_least16_t" ) }
180
225
181
226
override string getAPrimaryQlClass ( ) { result = "Int_least16_t" }
@@ -184,7 +229,7 @@ class Int_least16_t extends MinimumWidthIntegralType {
184
229
/**
185
230
* The C/C++ `int_least32_t` type.
186
231
*/
187
- class Int_least32_t extends MinimumWidthIntegralType {
232
+ class Int_least32_t extends IntegralUnderlyingUserType {
188
233
Int_least32_t ( ) { this .hasGlobalOrStdName ( "int_least32_t" ) }
189
234
190
235
override string getAPrimaryQlClass ( ) { result = "Int_least32_t" }
@@ -193,7 +238,7 @@ class Int_least32_t extends MinimumWidthIntegralType {
193
238
/**
194
239
* The C/C++ `int_least64_t` type.
195
240
*/
196
- class Int_least64_t extends MinimumWidthIntegralType {
241
+ class Int_least64_t extends IntegralUnderlyingUserType {
197
242
Int_least64_t ( ) { this .hasGlobalOrStdName ( "int_least64_t" ) }
198
243
199
244
override string getAPrimaryQlClass ( ) { result = "Int_least64_t" }
@@ -202,7 +247,7 @@ class Int_least64_t extends MinimumWidthIntegralType {
202
247
/**
203
248
* The C/C++ `uint_least8_t` type.
204
249
*/
205
- class UInt_least8_t extends MinimumWidthIntegralType {
250
+ class UInt_least8_t extends IntegralUnderlyingUserType {
206
251
UInt_least8_t ( ) { this .hasGlobalOrStdName ( "uint_least8_t" ) }
207
252
208
253
override string getAPrimaryQlClass ( ) { result = "UInt_least8_t" }
@@ -211,7 +256,7 @@ class UInt_least8_t extends MinimumWidthIntegralType {
211
256
/**
212
257
* The C/C++ `uint_least16_t` type.
213
258
*/
214
- class UInt_least16_t extends MinimumWidthIntegralType {
259
+ class UInt_least16_t extends IntegralUnderlyingUserType {
215
260
UInt_least16_t ( ) { this .hasGlobalOrStdName ( "uint_least16_t" ) }
216
261
217
262
override string getAPrimaryQlClass ( ) { result = "UInt_least16_t" }
@@ -220,7 +265,7 @@ class UInt_least16_t extends MinimumWidthIntegralType {
220
265
/**
221
266
* The C/C++ `uint_least32_t` type.
222
267
*/
223
- class UInt_least32_t extends MinimumWidthIntegralType {
268
+ class UInt_least32_t extends IntegralUnderlyingUserType {
224
269
UInt_least32_t ( ) { this .hasGlobalOrStdName ( "uint_least32_t" ) }
225
270
226
271
override string getAPrimaryQlClass ( ) { result = "UInt_least32_t" }
@@ -229,7 +274,7 @@ class UInt_least32_t extends MinimumWidthIntegralType {
229
274
/**
230
275
* The C/C++ `uint_least64_t` type.
231
276
*/
232
- class UInt_least64_t extends MinimumWidthIntegralType {
277
+ class UInt_least64_t extends IntegralUnderlyingUserType {
233
278
UInt_least64_t ( ) { this .hasGlobalOrStdName ( "uint_least64_t" ) }
234
279
235
280
override string getAPrimaryQlClass ( ) { result = "UInt_least64_t" }
@@ -238,7 +283,7 @@ class UInt_least64_t extends MinimumWidthIntegralType {
238
283
/**
239
284
* The C/C++ `int_fast8_t` type.
240
285
*/
241
- class Int_fast8_t extends MinimumWidthIntegralType {
286
+ class Int_fast8_t extends IntegralUnderlyingUserType {
242
287
Int_fast8_t ( ) { this .hasGlobalOrStdName ( "int_fast8_t" ) }
243
288
244
289
override string getAPrimaryQlClass ( ) { result = "Int_fast8_t" }
@@ -247,7 +292,7 @@ class Int_fast8_t extends MinimumWidthIntegralType {
247
292
/**
248
293
* The C/C++ `int_fast16_t` type.
249
294
*/
250
- class Int_fast16_t extends MinimumWidthIntegralType {
295
+ class Int_fast16_t extends IntegralUnderlyingUserType {
251
296
Int_fast16_t ( ) { this .hasGlobalOrStdName ( "int_fast16_t" ) }
252
297
253
298
override string getAPrimaryQlClass ( ) { result = "Int_fast16_t" }
@@ -256,7 +301,7 @@ class Int_fast16_t extends MinimumWidthIntegralType {
256
301
/**
257
302
* The C/C++ `int_fast32_t` type.
258
303
*/
259
- class Int_fast32_t extends MinimumWidthIntegralType {
304
+ class Int_fast32_t extends IntegralUnderlyingUserType {
260
305
Int_fast32_t ( ) { this .hasGlobalOrStdName ( "int_fast32_t" ) }
261
306
262
307
override string getAPrimaryQlClass ( ) { result = "Int_fast32_t" }
@@ -265,7 +310,7 @@ class Int_fast32_t extends MinimumWidthIntegralType {
265
310
/**
266
311
* The C/C++ `int_fast64_t` type.
267
312
*/
268
- class Int_fast64_t extends MinimumWidthIntegralType {
313
+ class Int_fast64_t extends IntegralUnderlyingUserType {
269
314
Int_fast64_t ( ) { this .hasGlobalOrStdName ( "int_fast64_t" ) }
270
315
271
316
override string getAPrimaryQlClass ( ) { result = "Int_fast64_t" }
@@ -274,7 +319,7 @@ class Int_fast64_t extends MinimumWidthIntegralType {
274
319
/**
275
320
* The C/C++ `uint_fast8_t` type.
276
321
*/
277
- class UInt_fast8_t extends MinimumWidthIntegralType {
322
+ class UInt_fast8_t extends IntegralUnderlyingUserType {
278
323
UInt_fast8_t ( ) { this .hasGlobalOrStdName ( "uint_fast8_t" ) }
279
324
280
325
override string getAPrimaryQlClass ( ) { result = "UInt_fast8_t" }
@@ -283,7 +328,7 @@ class UInt_fast8_t extends MinimumWidthIntegralType {
283
328
/**
284
329
* The C/C++ `uint_fast16_t` type.
285
330
*/
286
- class UInt_fast16_t extends MinimumWidthIntegralType {
331
+ class UInt_fast16_t extends IntegralUnderlyingUserType {
287
332
UInt_fast16_t ( ) { this .hasGlobalOrStdName ( "uint_fast16_t" ) }
288
333
289
334
override string getAPrimaryQlClass ( ) { result = "UInt_fast16_t" }
@@ -292,7 +337,7 @@ class UInt_fast16_t extends MinimumWidthIntegralType {
292
337
/**
293
338
* The C/C++ `uint_fast32_t` type.
294
339
*/
295
- class UInt_fast32_t extends MinimumWidthIntegralType {
340
+ class UInt_fast32_t extends IntegralUnderlyingUserType {
296
341
UInt_fast32_t ( ) { this .hasGlobalOrStdName ( "uint_fast32_t" ) }
297
342
298
343
override string getAPrimaryQlClass ( ) { result = "UInt_fast32_t" }
@@ -301,7 +346,7 @@ class UInt_fast32_t extends MinimumWidthIntegralType {
301
346
/**
302
347
* The C/C++ `uint_fast64_t` type.
303
348
*/
304
- class UInt_fast64_t extends MinimumWidthIntegralType {
349
+ class UInt_fast64_t extends IntegralUnderlyingUserType {
305
350
UInt_fast64_t ( ) { this .hasGlobalOrStdName ( "uint_fast64_t" ) }
306
351
307
352
override string getAPrimaryQlClass ( ) { result = "UInt_fast64_t" }
@@ -310,7 +355,7 @@ class UInt_fast64_t extends MinimumWidthIntegralType {
310
355
/**
311
356
* The C/C++ `intmax_t` type.
312
357
*/
313
- class Intmax_t extends MaximumWidthIntegralType {
358
+ class Intmax_t extends IntegralUnderlyingUserType {
314
359
Intmax_t ( ) { this .hasGlobalOrStdName ( "intmax_t" ) }
315
360
316
361
override string getAPrimaryQlClass ( ) { result = "Intmax_t" }
@@ -319,7 +364,7 @@ class Intmax_t extends MaximumWidthIntegralType {
319
364
/**
320
365
* The C/C++ `uintmax_t` type.
321
366
*/
322
- class Uintmax_t extends MaximumWidthIntegralType {
367
+ class Uintmax_t extends IntegralUnderlyingUserType {
323
368
Uintmax_t ( ) { this .hasGlobalOrStdName ( "uintmax_t" ) }
324
369
325
370
override string getAPrimaryQlClass ( ) { result = "Uintmax_t" }
0 commit comments