/
argumentsType.java
221 lines (213 loc) · 7.81 KB
/
argumentsType.java
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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
// Autogenerated AST node
package org.python.pydev.parser.jython.ast;
import org.python.pydev.parser.jython.SimpleNode;
public final class argumentsType extends SimpleNode {
public exprType[] args;
public NameTokType vararg;
public NameTokType kwarg;
public exprType[] defaults;
public exprType[] kwonlyargs;
public exprType[] kw_defaults;
public exprType[] annotation;
public exprType varargannotation;
public exprType kwargannotation;
public exprType[] kwonlyargannotation;
public argumentsType(exprType[] args, NameTokType vararg, NameTokType kwarg, exprType[]
defaults, exprType[] kwonlyargs, exprType[] kw_defaults, exprType[] annotation, exprType
varargannotation, exprType kwargannotation, exprType[] kwonlyargannotation) {
this.args = args;
this.vararg = vararg;
this.kwarg = kwarg;
this.defaults = defaults;
this.kwonlyargs = kwonlyargs;
this.kw_defaults = kw_defaults;
this.annotation = annotation;
this.varargannotation = varargannotation;
this.kwargannotation = kwargannotation;
this.kwonlyargannotation = kwonlyargannotation;
}
public argumentsType(exprType[] args, NameTokType vararg, NameTokType kwarg, exprType[]
defaults, exprType[] kwonlyargs, exprType[] kw_defaults, exprType[] annotation, exprType
varargannotation, exprType kwargannotation, exprType[] kwonlyargannotation, SimpleNode parent) {
this(args, vararg, kwarg, defaults, kwonlyargs, kw_defaults, annotation, varargannotation,
kwargannotation, kwonlyargannotation);
this.beginLine = parent.beginLine;
this.beginColumn = parent.beginColumn;
}
public argumentsType createCopy() {
exprType[] new0;
if(this.args != null){
new0 = new exprType[this.args.length];
for(int i=0;i<this.args.length;i++){
new0[i] = (exprType) (this.args[i] != null? this.args[i].createCopy():null);
}
}else{
new0 = this.args;
}
exprType[] new1;
if(this.defaults != null){
new1 = new exprType[this.defaults.length];
for(int i=0;i<this.defaults.length;i++){
new1[i] = (exprType) (this.defaults[i] != null? this.defaults[i].createCopy():null);
}
}else{
new1 = this.defaults;
}
exprType[] new2;
if(this.kwonlyargs != null){
new2 = new exprType[this.kwonlyargs.length];
for(int i=0;i<this.kwonlyargs.length;i++){
new2[i] = (exprType) (this.kwonlyargs[i] != null? this.kwonlyargs[i].createCopy():null);
}
}else{
new2 = this.kwonlyargs;
}
exprType[] new3;
if(this.kw_defaults != null){
new3 = new exprType[this.kw_defaults.length];
for(int i=0;i<this.kw_defaults.length;i++){
new3[i] = (exprType) (this.kw_defaults[i] != null?
this.kw_defaults[i].createCopy():null);
}
}else{
new3 = this.kw_defaults;
}
exprType[] new4;
if(this.annotation != null){
new4 = new exprType[this.annotation.length];
for(int i=0;i<this.annotation.length;i++){
new4[i] = (exprType) (this.annotation[i] != null? this.annotation[i].createCopy():null);
}
}else{
new4 = this.annotation;
}
exprType[] new5;
if(this.kwonlyargannotation != null){
new5 = new exprType[this.kwonlyargannotation.length];
for(int i=0;i<this.kwonlyargannotation.length;i++){
new5[i] = (exprType) (this.kwonlyargannotation[i] != null?
this.kwonlyargannotation[i].createCopy():null);
}
}else{
new5 = this.kwonlyargannotation;
}
argumentsType temp = new argumentsType(new0,
vararg!=null?(NameTokType)vararg.createCopy():null,
kwarg!=null?(NameTokType)kwarg.createCopy():null, new1, new2, new3, new4,
varargannotation!=null?(exprType)varargannotation.createCopy():null,
kwargannotation!=null?(exprType)kwargannotation.createCopy():null, new5);
temp.beginLine = this.beginLine;
temp.beginColumn = this.beginColumn;
if(this.specialsBefore != null){
for(Object o:this.specialsBefore){
if(o instanceof commentType){
commentType commentType = (commentType) o;
temp.getSpecialsBefore().add(commentType.createCopy());
}
}
}
if(this.specialsAfter != null){
for(Object o:this.specialsAfter){
if(o instanceof commentType){
commentType commentType = (commentType) o;
temp.getSpecialsAfter().add(commentType.createCopy());
}
}
}
return temp;
}
public String toString() {
StringBuffer sb = new StringBuffer("arguments[");
sb.append("args=");
sb.append(dumpThis(this.args));
sb.append(", ");
sb.append("vararg=");
sb.append(dumpThis(this.vararg));
sb.append(", ");
sb.append("kwarg=");
sb.append(dumpThis(this.kwarg));
sb.append(", ");
sb.append("defaults=");
sb.append(dumpThis(this.defaults));
sb.append(", ");
sb.append("kwonlyargs=");
sb.append(dumpThis(this.kwonlyargs));
sb.append(", ");
sb.append("kw_defaults=");
sb.append(dumpThis(this.kw_defaults));
sb.append(", ");
sb.append("annotation=");
sb.append(dumpThis(this.annotation));
sb.append(", ");
sb.append("varargannotation=");
sb.append(dumpThis(this.varargannotation));
sb.append(", ");
sb.append("kwargannotation=");
sb.append(dumpThis(this.kwargannotation));
sb.append(", ");
sb.append("kwonlyargannotation=");
sb.append(dumpThis(this.kwonlyargannotation));
sb.append("]");
return sb.toString();
}
public Object accept(VisitorIF visitor) throws Exception {
traverse(visitor);
return null;
}
public void traverse(VisitorIF visitor) throws Exception {
if (args != null) {
for (int i = 0; i < args.length; i++) {
if (args[i] != null){
args[i].accept(visitor);
}
}
}
if (vararg != null){
vararg.accept(visitor);
}
if (kwarg != null){
kwarg.accept(visitor);
}
if (defaults != null) {
for (int i = 0; i < defaults.length; i++) {
if (defaults[i] != null){
defaults[i].accept(visitor);
}
}
}
if (kwonlyargs != null) {
for (int i = 0; i < kwonlyargs.length; i++) {
if (kwonlyargs[i] != null){
kwonlyargs[i].accept(visitor);
}
}
}
if (kw_defaults != null) {
for (int i = 0; i < kw_defaults.length; i++) {
if (kw_defaults[i] != null){
kw_defaults[i].accept(visitor);
}
}
}
if (annotation != null) {
for (int i = 0; i < annotation.length; i++) {
if (annotation[i] != null){
annotation[i].accept(visitor);
}
}
}
if (varargannotation != null){
varargannotation.accept(visitor);
}
if (kwargannotation != null){
kwargannotation.accept(visitor);
}
if (kwonlyargannotation != null) {
for (int i = 0; i < kwonlyargannotation.length; i++) {
if (kwonlyargannotation[i] != null){
kwonlyargannotation[i].accept(visitor);
}
}
}
}
}