-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCalls.qll
More file actions
137 lines (111 loc) · 2.99 KB
/
Calls.qll
File metadata and controls
137 lines (111 loc) · 2.99 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
private import AstNodes
private import Expr
private import Idents
private import Misc
private import internal.Arguments
private import internal.CallExpression
private import internal.Parameter
private import internal.Parameters
private import internal.ParameterDeclaration
private import internal.UserDefinedFunction
abstract class Callable extends Expr {
/**
* Gets the identifier of the call expression.
*/
abstract Idents getIdentifier();
/**
* Gets the name of the call expression.
*/
string getName() { result = this.getIdentifier().getName() }
/**
* Checks if the call expression has a specific name.
*/
predicate hasName(string name) { this.getName() = name }
}
/**
* A CallExpression expression in the AST.
*/
class CallExpression extends Callable instanceof CallExpressionImpl {
override Idents getIdentifier() {
result = CallExpressionImpl.super.getIdentifier()
}
Expr getArgument(int index) {
result = this.getDeclaredArguments().getArgument(index)
}
Expr getArguments() {
result = this.getDeclaredArguments().getArguments()
}
Arguments getDeclaredArguments() {
result = CallExpressionImpl.super.getArguments()
}
}
/**
* A Arguments unknown AST node.
*/
class Arguments extends AstNode instanceof ArgumentsImpl {
Expr getArgument(int index) {
result = ArgumentsImpl.super.getArgument(index)
}
Expr getArguments() {
result = ArgumentsImpl.super.getArguments()
}
}
/**
* A Parameter unknown AST node.
*/
class Parameter extends AstNode instanceof ParameterImpl {
Idents getName() {
result = ParameterImpl.super.getName()
}
Type getType() {
result = ParameterImpl.super.getType()
}
}
/**
* A Parameters unknown AST node.
*/
class Parameters extends AstNode instanceof ParametersImpl {
Parameter getParameter(int index) {
result = ParametersImpl.super.getParameter(index)
}
}
/**
* A ParameterDeclaration unknown AST node.
*/
class ParameterDeclaration extends AstNode instanceof ParameterDeclarationImpl {
Identifier getName() {
result = ParameterDeclarationImpl.super.getName()
}
Type getType() {
result = ParameterDeclarationImpl.super.getType()
}
Expr getDefaultValue() {
result = ParameterDeclarationImpl.super.getDefaultValue()
}
}
/**
* A UserDefinedFunction unknown AST node.
*/
class UserDefinedFunction extends AstNode instanceof UserDefinedFunctionImpl {
Identifier getIdentifier() {
result = UserDefinedFunctionImpl.super.getName()
}
string getName() {
result = this.getIdentifier().getName()
}
Type getReturnType() {
result = UserDefinedFunctionImpl.super.getReturnType()
}
Parameters getDeclaredParameters() {
result = UserDefinedFunctionImpl.super.getParameters()
}
Parameter getParameters() {
result = this.getDeclaredParameters().getParameter(_)
}
Parameter getParameter(int index) {
result = this.getDeclaredParameters().getParameter(index)
}
Expr getBody() {
result = UserDefinedFunctionImpl.super.getBody()
}
}