View Javadoc
1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one or more
3    * contributor license agreements.  See the NOTICE file distributed with
4    * this work for additional information regarding copyright ownership.
5    * The ASF licenses this file to You under the Apache License, Version 2.0
6    * (the "License"); you may not use this file except in compliance with
7    * the License.  You may obtain a copy of the License at
8    *
9    *      http://www.apache.org/licenses/LICENSE-2.0
10   *
11   * Unless required by applicable law or agreed to in writing, software
12   * distributed under the License is distributed on an "AS IS" BASIS,
13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14   * See the License for the specific language governing permissions and
15   * limitations under the License.
16   */
17  package org.apache.commons.jexl3.parser;
18  
19  /**
20   * Fully abstract to avoid public interface exposition.
21   */
22  public abstract class ParserVisitor {
23      protected abstract Object visit(ASTAddNode node, Object data);
24  
25      /**
26       * Unused, should throw in Parser.
27       * @param node a node
28       * @param data the data
29       * @return does not return
30       */
31      protected final Object visit(final ASTAmbiguous node, final Object data) {
32          throw new UnsupportedOperationException("unexpected type of node");
33      }
34  
35      protected abstract Object visit(ASTAndNode node, Object data);
36  
37      protected abstract Object visit(ASTAnnotatedStatement node, Object data);
38  
39      protected abstract Object visit(ASTAnnotation node, Object data);
40  
41      protected abstract Object visit(ASTArguments node, Object data);
42  
43      protected abstract Object visit(ASTArrayAccess node, Object data);
44  
45      protected abstract Object visit(ASTArrayLiteral node, Object data);
46  
47      protected abstract Object visit(ASTAssignment node, Object data);
48  
49      protected abstract Object visit(ASTBitwiseAndNode node, Object data);
50  
51      protected abstract Object visit(ASTBitwiseComplNode node, Object data);
52  
53      protected abstract Object visit(ASTBitwiseOrNode node, Object data);
54  
55      protected abstract Object visit(ASTBitwiseXorNode node, Object data);
56  
57      protected abstract Object visit(ASTBlock node, Object data);
58  
59      protected abstract Object visit(ASTBreak node, Object data);
60  
61      protected abstract Object visit(ASTConstructorNode node, Object data);
62  
63      protected abstract Object visit(ASTContinue node, Object data);
64  
65      protected abstract Object visit(ASTDecrementGetNode node, final Object data);
66  
67      protected abstract Object visit(ASTDefineVars node, Object data);
68  
69      protected abstract Object visit(ASTDivNode node, Object data);
70  
71      protected abstract Object visit(ASTDoWhileStatement node, Object data);
72  
73      protected abstract Object visit(ASTEmptyFunction node, Object data);
74  
75      protected abstract Object visit(ASTEQNode node, Object data);
76  
77      protected abstract Object visit(ASTEQSNode node, Object data);
78  
79      protected abstract Object visit(ASTERNode node, Object data);
80  
81      protected abstract Object visit(ASTEWNode node, Object data);
82  
83      protected abstract Object visit(ASTExtendedLiteral node, Object data);
84  
85      protected abstract Object visit(ASTFalseNode node, Object data);
86  
87      protected abstract Object visit(ASTForeachStatement node, Object data);
88  
89      protected abstract Object visit(ASTFunctionNode node, Object data);
90  
91      protected abstract Object visit(ASTGENode node, Object data);
92  
93      protected abstract Object visit(ASTGetDecrementNode node, final Object data);
94  
95      protected abstract Object visit(ASTGetIncrementNode node, final Object data);
96  
97      protected abstract Object visit(ASTGTNode node, Object data);
98  
99      protected abstract Object visit(ASTIdentifier node, Object data);
100 
101     protected abstract Object visit(ASTIdentifierAccess node, Object data);
102 
103     protected abstract Object visit(ASTIfStatement node, Object data);
104 
105     protected abstract Object visit(ASTIncrementGetNode node, final Object data);
106 
107     protected abstract Object visit(final ASTInstanceOf node, final Object data);
108 
109     protected abstract Object visit(ASTJexlScript node, Object data);
110 
111     protected abstract Object visit(ASTJxltLiteral node, Object data);
112 
113     protected abstract Object visit(ASTLENode node, Object data);
114 
115     protected abstract Object visit(ASTLTNode node, Object data);
116 
117     protected abstract Object visit(ASTMapEntry node, Object data);
118 
119     protected abstract Object visit(ASTMapLiteral node, Object data);
120 
121     protected abstract Object visit(ASTMethodNode node, Object data);
122 
123     protected abstract Object visit(ASTModNode node, Object data);
124 
125     protected abstract Object visit(ASTMulNode node, Object data);
126 
127     protected abstract Object visit(ASTNENode node, Object data);
128 
129     protected abstract Object visit(ASTNESNode node, Object data);
130 
131     protected abstract Object visit(ASTNEWNode node, Object data);
132 
133     protected abstract Object visit(final ASTNotInstanceOf node, final Object data);
134 
135     protected abstract Object visit(ASTNotNode node, Object data);
136 
137     protected abstract Object visit(ASTNRNode node, Object data);
138 
139     protected abstract Object visit(ASTNSWNode node, Object data);
140 
141     protected abstract Object visit(ASTNullLiteral node, Object data);
142 
143     protected abstract Object visit(ASTNullpNode node, Object data);
144 
145     protected abstract Object visit(ASTNumberLiteral node, Object data);
146 
147     protected abstract Object visit(ASTOrNode node, Object data);
148 
149     protected abstract Object visit(final ASTQualifiedIdentifier node, final Object data);
150 
151     protected abstract Object visit(ASTRangeNode node, Object data);
152 
153     protected abstract Object visit(ASTReference node, Object data);
154 
155     protected abstract Object visit(ASTReferenceExpression node, Object data);
156 
157     protected abstract Object visit(ASTRegexLiteral node, Object data);
158 
159     protected abstract Object visit(ASTReturnStatement node, Object data);
160 
161     protected abstract Object visit(ASTSetAddNode node, Object data);
162 
163     protected abstract Object visit(ASTSetAndNode node, Object data);
164 
165     protected abstract Object visit(ASTSetDivNode node, Object data);
166 
167     protected abstract Object visit(ASTSetLiteral node, Object data);
168 
169     protected abstract Object visit(ASTSetModNode node, Object data);
170 
171     protected abstract Object visit(ASTSetMultNode node, Object data);
172 
173     protected abstract Object visit(ASTSetOrNode node, Object data);
174 
175     protected abstract Object visit(ASTSetShiftLeftNode node, final Object data);
176 
177     protected abstract Object visit(ASTSetShiftRightNode node, final Object data);
178 
179     protected abstract Object visit(ASTSetShiftRightUnsignedNode node, final Object data);
180 
181     protected abstract Object visit(ASTSetSubNode node, Object data);
182 
183     protected abstract Object visit(ASTSetXorNode node, Object data);
184 
185     protected abstract Object visit(ASTShiftLeftNode node, final Object data);
186 
187     protected abstract Object visit(ASTShiftRightNode node, final Object data);
188 
189     protected abstract Object visit(ASTShiftRightUnsignedNode node, final Object data);
190 
191     protected abstract Object visit(ASTSizeFunction node, Object data);
192 
193     protected abstract Object visit(ASTStringLiteral node, Object data);
194 
195     protected abstract Object visit(ASTSubNode node, Object data);
196 
197     protected abstract Object visit(ASTSWNode node, Object data);
198 
199     protected abstract Object visit(ASTTernaryNode node, Object data);
200 
201     protected abstract Object visit( ASTThrowStatement node, Object data);
202 
203     protected abstract Object visit(ASTTrueNode node, Object data);
204 
205     protected abstract Object visit(ASTTryResources node, Object data);
206 
207     protected abstract Object visit(ASTTryStatement node, Object data);
208 
209     protected abstract Object visit(ASTUnaryMinusNode node, Object data);
210 
211     protected abstract Object visit(ASTUnaryPlusNode node, Object data);
212 
213     protected abstract Object visit(ASTVar node, Object data);
214 
215     protected abstract Object visit(ASTWhileStatement node, Object data);
216 
217     /**
218      * Unused, satisfy ParserVisitor interface.
219      * @param node a node
220      * @param data the data
221      * @return does not return
222      */
223     protected final Object visit(final SimpleNode node, final Object data) {
224         throw new UnsupportedOperationException(node.getClass().getSimpleName() + " : not supported yet.");
225     }
226 }