View Javadoc
Minimize
Table

1   /*
2    * Copyright 2003-2010 the original author or authors.
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *     http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.codehaus.groovy.antlr.treewalker;
17  
18  import org.codehaus.groovy.antlr.GroovySourceAST;
19  
20  /**
21   * An interface for visiting a GroovySourceAST node.
22   *
23   * @author <a href="mailto:groovy@ross-rayner.com">Jeremy Rayner</a>
24   * @version $Revision: 21821 $
25   */
26  
27  public interface Visitor {
28      int OPENING_VISIT = 1;
29      int SECOND_VISIT = 2; // only used on rare occasions, e.g. the '(' in this snippet...   @Foo  (  a=1, b=2, c=3)
30      int SUBSEQUENT_VISIT = 3;
31      int CLOSING_VISIT = 4;
32  
33      void setUp();
34      void visitAbstract(GroovySourceAST t, int visit);
35      void visitAnnotation(GroovySourceAST t, int visit);
36      void visitAnnotations(GroovySourceAST t, int visit);
37      void visitAnnotationArrayInit(GroovySourceAST t, int visit);
38      void visitAnnotationDef(GroovySourceAST t, int visit);
39      void visitAnnotationFieldDef(GroovySourceAST t, int visit);
40      void visitAnnotationMemberValuePair(GroovySourceAST t, int visit);
41      void visitArrayDeclarator(GroovySourceAST t, int visit);
42      void visitAssign(GroovySourceAST t, int visit);
43      void visitAt(GroovySourceAST t, int visit);
44      void visitBand(GroovySourceAST t, int visit);
45      void visitBandAssign(GroovySourceAST t, int visit);
46      void visitBigSuffix(GroovySourceAST t, int visit);
47      void visitBlock(GroovySourceAST t, int visit);
48      void visitBnot(GroovySourceAST t, int visit);
49      void visitBor(GroovySourceAST t, int visit);
50      void visitBorAssign(GroovySourceAST t, int visit);
51      void visitBsr(GroovySourceAST t, int visit);
52      void visitBsrAssign(GroovySourceAST t, int visit);
53      void visitBxor(GroovySourceAST t, int visit);
54      void visitBxorAssign(GroovySourceAST t, int visit);
55      void visitCaseGroup(GroovySourceAST t, int visit);
56      void visitClassDef(GroovySourceAST t, int visit);
57      void visitClosedBlock(GroovySourceAST t, int visit);
58      void visitClosureList(GroovySourceAST t, int visit);
59      void visitClosureOp(GroovySourceAST t, int visit);
60      void visitColon(GroovySourceAST t, int visit);
61      void visitComma(GroovySourceAST t, int visit);
62      void visitCompareTo(GroovySourceAST t, int visit);
63      void visitCtorCall(GroovySourceAST t, int visit);
64      void visitCtorIdent(GroovySourceAST t, int visit);
65      void visitDec(GroovySourceAST t, int visit);
66      void visitDigit(GroovySourceAST t, int visit);
67      void visitDiv(GroovySourceAST t, int visit);
68      void visitDivAssign(GroovySourceAST t, int visit);
69      void visitDollar(GroovySourceAST t, int visit);
70      void visitDot(GroovySourceAST t, int visit);
71      void visitDynamicMember(GroovySourceAST t, int visit);
72      void visitElist(GroovySourceAST t, int visit);
73      void visitEmptyStat(GroovySourceAST t, int visit);
74      void visitEnumConstantDef(GroovySourceAST t, int visit);
75      void visitEnumDef(GroovySourceAST t, int visit);
76      void visitEof(GroovySourceAST t, int visit);
77      void visitEqual(GroovySourceAST t, int visit);
78      void visitEsc(GroovySourceAST t, int visit);
79      void visitExponent(GroovySourceAST t, int visit);
80      void visitExpr(GroovySourceAST t, int visit);
81      void visitExtendsClause(GroovySourceAST t, int visit);
82      void visitFinal(GroovySourceAST t, int visit);
83      void visitFloatSuffix(GroovySourceAST t, int visit);
84      void visitForCondition(GroovySourceAST t, int visit);
85      void visitForEachClause(GroovySourceAST t, int visit);
86      void visitForInit(GroovySourceAST t, int visit);
87      void visitForInIterable(GroovySourceAST t, int visit);
88      void visitForIterator(GroovySourceAST t, int visit);
89      void visitGe(GroovySourceAST t, int visit);
90      void visitGt(GroovySourceAST t, int visit);
91      void visitHexDigit(GroovySourceAST t, int visit);
92      void visitIdent(GroovySourceAST t, int visit);
93      void visitImplementsClause(GroovySourceAST t, int visit);
94      void visitImplicitParameters(GroovySourceAST t, int visit);
95      void visitImport(GroovySourceAST t, int visit);
96      void visitInc(GroovySourceAST t, int visit);
97      void visitIndexOp(GroovySourceAST t, int visit);
98      void visitInstanceInit(GroovySourceAST t, int visit);
99      void visitInterfaceDef(GroovySourceAST t, int visit);
100     void visitLabeledArg(GroovySourceAST t, int visit);
101     void visitLabeledStat(GroovySourceAST t, int visit);
102     void visitLand(GroovySourceAST t, int visit);
103     void visitLbrack(GroovySourceAST t, int visit);
104     void visitLcurly(GroovySourceAST t, int visit);
105     void visitLe(GroovySourceAST t, int visit);
106     void visitLetter(GroovySourceAST t, int visit);
107     void visitListConstructor(GroovySourceAST t, int visit);
108     void visitLiteralAs(GroovySourceAST t, int visit);
109     void visitLiteralAssert(GroovySourceAST t, int visit);
110     void visitLiteralBoolean(GroovySourceAST t, int visit);
111     void visitLiteralBreak(GroovySourceAST t, int visit);
112     void visitLiteralByte(GroovySourceAST t, int visit);
113     void visitLiteralCase(GroovySourceAST t, int visit);
114     void visitLiteralCatch(GroovySourceAST t, int visit);
115     void visitLiteralChar(GroovySourceAST t, int visit);
116     void visitLiteralClass(GroovySourceAST t, int visit);
117     void visitLiteralContinue(GroovySourceAST t, int visit);
118     void visitLiteralDef(GroovySourceAST t, int visit);
119     void visitLiteralDefault(GroovySourceAST t, int visit);
120     void visitLiteralDouble(GroovySourceAST t, int visit);
121     void visitLiteralElse(GroovySourceAST t, int visit);
122     void visitLiteralEnum(GroovySourceAST t, int visit);
123     void visitLiteralExtends(GroovySourceAST t, int visit);
124     void visitLiteralFalse(GroovySourceAST t, int visit);
125     void visitLiteralFinally(GroovySourceAST t, int visit);
126     void visitLiteralFloat(GroovySourceAST t, int visit);
127     void visitLiteralFor(GroovySourceAST t, int visit);
128     void visitLiteralIf(GroovySourceAST t, int visit);
129     void visitLiteralImplements(GroovySourceAST t, int visit);
130     void visitLiteralImport(GroovySourceAST t, int visit);
131     void visitLiteralIn(GroovySourceAST t, int visit);
132     void visitLiteralInstanceof(GroovySourceAST t, int visit);
133     void visitLiteralInt(GroovySourceAST t, int visit);
134     void visitLiteralInterface(GroovySourceAST t, int visit);
135     void visitLiteralLong(GroovySourceAST t, int visit);
136     void visitLiteralNative(GroovySourceAST t, int visit);
137     void visitLiteralNew(GroovySourceAST t, int visit);
138     void visitLiteralNull(GroovySourceAST t, int visit);
139     void visitLiteralPackage(GroovySourceAST t, int visit);
140     void visitLiteralPrivate(GroovySourceAST t, int visit);
141     void visitLiteralProtected(GroovySourceAST t, int visit);
142     void visitLiteralPublic(GroovySourceAST t, int visit);
143     void visitLiteralReturn(GroovySourceAST t, int visit);
144     void visitLiteralShort(GroovySourceAST t, int visit);
145     void visitLiteralStatic(GroovySourceAST t, int visit);
146     void visitLiteralSuper(GroovySourceAST t, int visit);
147     void visitLiteralSwitch(GroovySourceAST t, int visit);
148     void visitLiteralSynchronized(GroovySourceAST t, int visit);
149     void visitLiteralThis(GroovySourceAST t, int visit);
150     void visitLiteralThreadsafe(GroovySourceAST t, int visit);
151     void visitLiteralThrow(GroovySourceAST t, int visit);
152     void visitLiteralThrows(GroovySourceAST t, int visit);
153     void visitLiteralTransient(GroovySourceAST t, int visit);
154     void visitLiteralTrue(GroovySourceAST t, int visit);
155     void visitLiteralTry(GroovySourceAST t, int visit);
156     void visitLiteralVoid(GroovySourceAST t, int visit);
157     void visitLiteralVolatile(GroovySourceAST t, int visit);
158     void visitLiteralWhile(GroovySourceAST t, int visit);
159     void visitLnot(GroovySourceAST t, int visit);
160     void visitLor(GroovySourceAST t, int visit);
161     void visitLparen(GroovySourceAST t, int visit);
162     void visitLt(GroovySourceAST t, int visit);
163     void visitMapConstructor(GroovySourceAST t, int visit);
164     void visitMemberPointer(GroovySourceAST t, int visit);
165     void visitMethodCall(GroovySourceAST t, int visit);
166     void visitMethodDef(GroovySourceAST t, int visit);
167     void visitMinus(GroovySourceAST t, int visit);
168     void visitMinusAssign(GroovySourceAST t, int visit);
169     void visitMlComment(GroovySourceAST t, int visit);
170     void visitMod(GroovySourceAST t, int visit);
171     void visitModifiers(GroovySourceAST t, int visit);
172     void visitModAssign(GroovySourceAST t, int visit);
173     void visitMultiCatch(GroovySourceAST t, int visit);
174     void visitMultiCatchTypes(GroovySourceAST t, int visit);
175     void visitNls(GroovySourceAST t, int visit);
176     void visitNotEqual(GroovySourceAST t, int visit);
177     void visitNullTreeLookahead(GroovySourceAST t, int visit);
178     void visitNumBigDecimal(GroovySourceAST t, int visit);
179     void visitNumBigInt(GroovySourceAST t, int visit);
180     void visitNumDouble(GroovySourceAST t, int visit);
181     void visitNumFloat(GroovySourceAST t, int visit);
182     void visitNumInt(GroovySourceAST t, int visit);
183     void visitNumLong(GroovySourceAST t, int visit);
184     void visitObjblock(GroovySourceAST t, int visit);
185     void visitOneNl(GroovySourceAST t, int visit);
186     void visitOptionalDot(GroovySourceAST t, int visit);
187     void visitPackageDef(GroovySourceAST t, int visit);
188     void visitParameters(GroovySourceAST t, int visit);
189     void visitParameterDef(GroovySourceAST t, int visit);
190     void visitPlus(GroovySourceAST t, int visit);
191     void visitPlusAssign(GroovySourceAST t, int visit);
192     void visitPostDec(GroovySourceAST t, int visit);
193     void visitPostInc(GroovySourceAST t, int visit);
194     void visitQuestion(GroovySourceAST t, int visit);
195     void visitRangeExclusive(GroovySourceAST t, int visit);
196     void visitRangeInclusive(GroovySourceAST t, int visit);
197     void visitRbrack(GroovySourceAST t, int visit);
198     void visitRcurly(GroovySourceAST t, int visit);
199     void visitRegexpCtorEnd(GroovySourceAST t, int visit);
200     void visitRegexpLiteral(GroovySourceAST t, int visit);
201     void visitRegexpSymbol(GroovySourceAST t, int visit);
202     void visitRegexFind(GroovySourceAST t, int visit);
203     void visitRegexMatch(GroovySourceAST t, int visit);
204     void visitRparen(GroovySourceAST t, int visit);
205     void visitSelectSlot(GroovySourceAST t, int visit);
206     void visitSemi(GroovySourceAST t, int visit);
207     void visitShComment(GroovySourceAST t, int visit);
208     void visitSl(GroovySourceAST t, int visit);
209     void visitSlist(GroovySourceAST t, int visit);
210     void visitSlAssign(GroovySourceAST t, int visit);
211     void visitSlComment(GroovySourceAST t, int visit);
212     void visitSpreadArg(GroovySourceAST t, int visit);
213     void visitSpreadDot(GroovySourceAST t, int visit);
214     void visitSpreadMapArg(GroovySourceAST t, int visit);
215     void visitSr(GroovySourceAST t, int visit);
216     void visitSrAssign(GroovySourceAST t, int visit);
217     void visitStar(GroovySourceAST t, int visit);
218     void visitStarAssign(GroovySourceAST t, int visit);
219     void visitStarStar(GroovySourceAST t, int visit);
220     void visitStarStarAssign(GroovySourceAST t, int visit);
221     void visitStaticImport(GroovySourceAST t, int visit);
222     void visitStaticInit(GroovySourceAST t, int visit);
223     void visitStrictfp(GroovySourceAST t, int visit);
224     void visitStringCh(GroovySourceAST t, int visit);
225     void visitStringConstructor(GroovySourceAST t, int visit);
226     void visitStringCtorEnd(GroovySourceAST t, int visit);
227     void visitStringCtorMiddle(GroovySourceAST t, int visit);
228     void visitStringCtorStart(GroovySourceAST t, int visit);
229     void visitStringLiteral(GroovySourceAST t, int visit);
230     void visitStringNl(GroovySourceAST t, int visit);
231     void visitSuperCtorCall(GroovySourceAST t, int visit);
232     void visitTripleDot(GroovySourceAST t, int visit);
233     void visitType(GroovySourceAST t, int visit);
234     void visitTypecast(GroovySourceAST t, int visit);
235     void visitTypeArgument(GroovySourceAST t, int visit);
236     void visitTypeArguments(GroovySourceAST t, int visit);
237     void visitTypeLowerBounds(GroovySourceAST t, int visit);
238     void visitTypeParameter(GroovySourceAST t, int visit);
239     void visitTypeParameters(GroovySourceAST t, int visit);
240     void visitTypeUpperBounds(GroovySourceAST t, int visit);
241     void visitUnaryMinus(GroovySourceAST t, int visit);
242     void visitUnaryPlus(GroovySourceAST t, int visit);
243     void visitUnusedConst(GroovySourceAST t, int visit);
244     void visitUnusedDo(GroovySourceAST t, int visit);
245     void visitUnusedGoto(GroovySourceAST t, int visit);
246     void visitVariableDef(GroovySourceAST t, int visit);
247     void visitVariableParameterDef(GroovySourceAST t, int visit);
248     void visitVocab(GroovySourceAST t, int visit);
249     void visitWildcardType(GroovySourceAST t, int visit);
250     void visitWs(GroovySourceAST t, int visit);
251 
252     void visitDefault(GroovySourceAST t,int visit);
253     void tearDown();
254 
255     void push(GroovySourceAST t);
256     GroovySourceAST pop();
257 }