@@ -30,6 +30,8 @@ class Decl extends @decl, ExprParent, StmtParent {
30
30
*/
31
31
class BadDecl extends @baddecl, Decl {
32
32
override string toString ( ) { result = "bad declaration" }
33
+
34
+ override string describeQlClass ( ) { result = "BadDecl" }
33
35
}
34
36
35
37
/**
@@ -46,34 +48,44 @@ class GenDecl extends @gendecl, Decl, Documentable {
46
48
int getNumSpec ( ) { result = count ( getASpec ( ) ) }
47
49
48
50
override predicate mayHaveSideEffects ( ) { getASpec ( ) .mayHaveSideEffects ( ) }
51
+
52
+ override string describeQlClass ( ) { result = "GenDecl" }
49
53
}
50
54
51
55
/**
52
56
* An import declaration.
53
57
*/
54
58
class ImportDecl extends @importdecl, GenDecl {
55
59
override string toString ( ) { result = "import declaration" }
60
+
61
+ override string describeQlClass ( ) { result = "ImportDecl" }
56
62
}
57
63
58
64
/**
59
65
* A constant declaration.
60
66
*/
61
67
class ConstDecl extends @constdecl, GenDecl {
62
68
override string toString ( ) { result = "constant declaration" }
69
+
70
+ override string describeQlClass ( ) { result = "ConstDecl" }
63
71
}
64
72
65
73
/**
66
74
* A type declaration.
67
75
*/
68
76
class TypeDecl extends @typedecl, GenDecl {
69
77
override string toString ( ) { result = "type declaration" }
78
+
79
+ override string describeQlClass ( ) { result = "TypeDecl" }
70
80
}
71
81
72
82
/**
73
83
* A variable declaration.
74
84
*/
75
85
class VarDecl extends @vardecl, GenDecl {
76
86
override string toString ( ) { result = "variable declaration" }
87
+
88
+ override string describeQlClass ( ) { result = "VarDecl" }
77
89
}
78
90
79
91
/**
@@ -133,6 +145,8 @@ class FuncDef extends @funcdef, StmtParent, ExprParent {
133
145
* Gets a call to this function.
134
146
*/
135
147
DataFlow:: CallNode getACall ( ) { result .getACallee ( ) = this }
148
+
149
+ override string describeQlClass ( ) { result = "FuncDef" }
136
150
}
137
151
138
152
/**
@@ -155,6 +169,8 @@ class FuncDecl extends @funcdecl, Decl, Documentable, FuncDef {
155
169
DeclaredFunction getFunction ( ) { this = result .getFuncDecl ( ) }
156
170
157
171
override string toString ( ) { result = "function declaration" }
172
+
173
+ override string describeQlClass ( ) { result = "FuncDecl" }
158
174
}
159
175
160
176
/**
@@ -219,6 +235,8 @@ class MethodDecl extends FuncDecl {
219
235
* is the variable `p`.
220
236
*/
221
237
ReceiverVariable getReceiver ( ) { result .getFunction ( ) = this }
238
+
239
+ override string describeQlClass ( ) { result = "MethodDecl" }
222
240
}
223
241
224
242
/**
@@ -243,6 +261,8 @@ class Spec extends @spec, ExprParent, Documentable {
243
261
* Memory allocation is not considered an observable side effect.
244
262
*/
245
263
predicate mayHaveSideEffects ( ) { none ( ) }
264
+
265
+ override string describeQlClass ( ) { result = "Spec" }
246
266
}
247
267
248
268
/**
@@ -262,6 +282,8 @@ class ImportSpec extends @importspec, Spec {
262
282
string getPath ( ) { result = getPathExpr ( ) .getValue ( ) }
263
283
264
284
override string toString ( ) { result = "import specifier" }
285
+
286
+ override string describeQlClass ( ) { result = "ImportSpec" }
265
287
}
266
288
267
289
/**
@@ -344,6 +366,8 @@ class ValueSpec extends @valuespec, Spec {
344
366
override predicate mayHaveSideEffects ( ) { getAnInit ( ) .mayHaveSideEffects ( ) }
345
367
346
368
override string toString ( ) { result = "value declaration specifier" }
369
+
370
+ override string describeQlClass ( ) { result = "ValueSpec" }
347
371
}
348
372
349
373
/**
@@ -360,6 +384,8 @@ class TypeSpec extends @typespec, Spec {
360
384
Expr getTypeExpr ( ) { result = getChildExpr ( 1 ) }
361
385
362
386
override string toString ( ) { result = "type declaration specifier" }
387
+
388
+ override string describeQlClass ( ) { result = "TypeSpec" }
363
389
}
364
390
365
391
/**
@@ -397,13 +423,17 @@ class FieldDecl extends @field, Documentable, ExprParent {
397
423
StructType getDeclaringType ( ) { result = getDeclaringStructTypeExpr ( ) .getType ( ) }
398
424
399
425
override string toString ( ) { result = "field declaration" }
426
+
427
+ override string describeQlClass ( ) { result = "FieldDecl" }
400
428
}
401
429
402
430
/**
403
431
* An embedded field declaration in a struct.
404
432
*/
405
433
class EmbeddedFieldDecl extends FieldDecl {
406
434
EmbeddedFieldDecl ( ) { not exists ( this .getNameExpr ( _) ) }
435
+
436
+ override string describeQlClass ( ) { result = "EmbeddedFieldDecl" }
407
437
}
408
438
409
439
/**
@@ -453,6 +483,8 @@ class ParameterDecl extends @field, Documentable, ExprParent {
453
483
}
454
484
455
485
override string toString ( ) { result = "parameter declaration" }
486
+
487
+ override string describeQlClass ( ) { result = "ParameterDecl" }
456
488
}
457
489
458
490
/**
@@ -482,6 +514,8 @@ class ReceiverDecl extends @field, Documentable, ExprParent {
482
514
Expr getNameExpr ( ) { result = getChildExpr ( 1 ) }
483
515
484
516
override string toString ( ) { result = "receiver declaration" }
517
+
518
+ override string describeQlClass ( ) { result = "ReceiverDecl" }
485
519
}
486
520
487
521
/**
@@ -531,6 +565,8 @@ class ResultVariableDecl extends @field, Documentable, ExprParent {
531
565
int getIndex ( ) { fields ( this , _, - ( result + 1 ) ) }
532
566
533
567
override string toString ( ) { result = "result variable declaration" }
568
+
569
+ override string describeQlClass ( ) { result = "ResultVariableDecl" }
534
570
}
535
571
536
572
/**
@@ -579,6 +615,8 @@ class MethodSpec extends InterfaceMemberSpec {
579
615
Expr getNameExpr ( ) { result = name }
580
616
581
617
override string toString ( ) { result = "method declaration" }
618
+
619
+ override string describeQlClass ( ) { result = "MethodSpec" }
582
620
}
583
621
584
622
/**
@@ -588,4 +626,6 @@ class EmbeddingSpec extends InterfaceMemberSpec {
588
626
EmbeddingSpec ( ) { not exists ( getChildExpr ( 1 ) ) }
589
627
590
628
override string toString ( ) { result = "interface embedding" }
629
+
630
+ override string describeQlClass ( ) { result = "EmbeddingSpec" }
591
631
}
0 commit comments