1
2
3
4
5 package com.randomnoun.common.jexl.visitor;
6 import com.randomnoun.common.jexl.ast.*;
7 import java.util.*;
8
9
10
11
12
13 public class GJVoidDepthFirst<A> implements GJVoidVisitor<A> {
14
15
16
17 public void visit(NodeList n, A argu) {
18 int _count=0;
19 for ( Enumeration<Node> e = n.elements(); e.hasMoreElements(); ) {
20 e.nextElement().accept(this,argu);
21 _count++;
22 }
23 }
24
25 public void visit(NodeListOptional n, A argu) {
26 if ( n.present() ) {
27 int _count=0;
28 for ( Enumeration<Node> e = n.elements(); e.hasMoreElements(); ) {
29 e.nextElement().accept(this,argu);
30 _count++;
31 }
32 }
33 }
34
35 public void visit(NodeOptional n, A argu) {
36 if ( n.present() )
37 n.node.accept(this,argu);
38 }
39
40 public void visit(NodeSequence n, A argu) {
41 int _count=0;
42 for ( Enumeration<Node> e = n.elements(); e.hasMoreElements(); ) {
43 e.nextElement().accept(this,argu);
44 _count++;
45 }
46 }
47
48 public void visit(NodeToken n, A argu) {}
49
50
51
52
53
54
55
56
57
58
59
60 public void visit(TopLevelExpression n, A argu) {
61 n.expression.accept(this, argu);
62 n.nodeToken.accept(this, argu);
63 }
64
65
66
67
68
69
70
71 public void visit(Expression n, A argu) {
72 n.conditionalAndExpression.accept(this, argu);
73 n.nodeListOptional.accept(this, argu);
74 }
75
76
77
78
79
80
81
82 public void visit(ConditionalAndExpression n, A argu) {
83 n.equalityExpression.accept(this, argu);
84 n.nodeListOptional.accept(this, argu);
85 }
86
87
88
89
90
91
92
93 public void visit(EqualityExpression n, A argu) {
94 n.relationalExpression.accept(this, argu);
95 n.nodeListOptional.accept(this, argu);
96 }
97
98
99
100
101
102
103
104 public void visit(RelationalExpression n, A argu) {
105 n.additiveExpression.accept(this, argu);
106 n.nodeListOptional.accept(this, argu);
107 }
108
109
110
111
112
113
114
115 public void visit(AdditiveExpression n, A argu) {
116 n.multiplicativeExpression.accept(this, argu);
117 n.nodeListOptional.accept(this, argu);
118 }
119
120
121
122
123
124
125
126 public void visit(MultiplicativeExpression n, A argu) {
127 n.unaryExpression.accept(this, argu);
128 n.nodeListOptional.accept(this, argu);
129 }
130
131
132
133
134
135
136
137 public void visit(UnaryExpression n, A argu) {
138 n.nodeChoice.accept(this, argu);
139 }
140
141
142
143
144
145
146
147
148
149 public void visit(PrimaryExpression n, A argu) {
150 n.nodeChoice.accept(this, argu);
151 }
152
153
154
155
156
157
158
159 public void visit(Name n, A argu) {
160 n.nodeToken.accept(this, argu);
161 n.nodeListOptional.accept(this, argu);
162 }
163
164
165
166
167
168
169
170 public void visit(FunctionCall n, A argu) {
171 n.nodeToken.accept(this, argu);
172 n.arguments.accept(this, argu);
173 }
174
175
176
177
178
179
180
181
182 public void visit(Arguments n, A argu) {
183 n.nodeToken.accept(this, argu);
184 n.nodeOptional.accept(this, argu);
185 n.nodeToken1.accept(this, argu);
186 }
187
188
189
190
191
192
193
194 public void visit(ArgumentList n, A argu) {
195 n.expression.accept(this, argu);
196 n.nodeListOptional.accept(this, argu);
197 }
198
199
200
201
202
203
204
205
206
207
208
209 public void visit(Literal n, A argu) {
210 n.nodeChoice.accept(this, argu);
211 }
212
213
214
215
216
217
218
219 public void visit(BooleanLiteral n, A argu) {
220 n.nodeChoice.accept(this, argu);
221 }
222
223
224
225
226
227
228 public void visit(NullLiteral n, A argu) {
229 n.nodeToken.accept(this, argu);
230 }
231
232 }