View Javadoc

    1   /***
    2    *
    3    * Copyright 2005 Jeremy Rayner
    4    *
    5    * Licensed under the Apache License, Version 2.0 (the "License");
    6    * you may not use this file except in compliance with the License.
    7    * 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   **/
    18  package org.codehaus.groovy.antlr.treewalker;
    19
    20  import org.codehaus.groovy.antlr.GroovySourceAST;
    21
    22  /***
    23   * An interface for visiting a GroovySourceAST node.
    24   *
    25   * @author <a href="mailto:groovy@ross-rayner.com">Jeremy Rayner</a>
    26   * @version $Revision: 1.2 $
    27   */
    28
    29  public interface Visitor {
    30      final int OPENING_VISIT = 1;
    31      final int CLOSING_VISIT = 2;
    32      final int SUBSEQUENT_VISIT = 3;
    33
    34      void setUp();
    35      void visitAbstract(GroovySourceAST t, int visit);
    36      void visitAnnotation(GroovySourceAST t, int visit);
    37      void visitAnnotations(GroovySourceAST t, int visit);
    38      void visitAnnotationArrayInit(GroovySourceAST t, int visit);
    39      void visitAnnotationDef(GroovySourceAST t, int visit);
    40      void visitAnnotationFieldDef(GroovySourceAST t, int visit);
    41      void visitAnnotationMemberValuePair(GroovySourceAST t, int visit);
    42      void visitArrayDeclarator(GroovySourceAST t, int visit);
    43      void visitAssign(GroovySourceAST t, int visit);
    44      void visitAt(GroovySourceAST t, int visit);
    45      void visitBand(GroovySourceAST t, int visit);
    46      void visitBandAssign(GroovySourceAST t, int visit);
    47      void visitBigSuffix(GroovySourceAST t, int visit);
    48      void visitBlock(GroovySourceAST t, int visit);
    49      void visitBnot(GroovySourceAST t, int visit);
    50      void visitBor(GroovySourceAST t, int visit);
    51      void visitBorAssign(GroovySourceAST t, int visit);
    52      void visitBsr(GroovySourceAST t, int visit);
    53      void visitBsrAssign(GroovySourceAST t, int visit);
    54      void visitBxor(GroovySourceAST t, int visit);
    55      void visitBxorAssign(GroovySourceAST t, int visit);
    56      void visitCaseGroup(GroovySourceAST t, int visit);
    57      void visitClassDef(GroovySourceAST t, int visit);
    58      void visitClosedBlock(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 visitLiteralAny(GroovySourceAST t, int visit);
    109     void visitLiteralAs(GroovySourceAST t, int visit);
    110     void visitLiteralAssert(GroovySourceAST t, int visit);
    111     void visitLiteralBoolean(GroovySourceAST t, int visit);
    112     void visitLiteralBreak(GroovySourceAST t, int visit);
    113     void visitLiteralByte(GroovySourceAST t, int visit);
    114     void visitLiteralCase(GroovySourceAST t, int visit);
    115     void visitLiteralCatch(GroovySourceAST t, int visit);
    116     void visitLiteralChar(GroovySourceAST t, int visit);
    117     void visitLiteralClass(GroovySourceAST t, int visit);
    118     void visitLiteralContinue(GroovySourceAST t, int visit);
    119     void visitLiteralDef(GroovySourceAST t, int visit);
    120     void visitLiteralDefault(GroovySourceAST t, int visit);
    121     void visitLiteralDouble(GroovySourceAST t, int visit);
    122     void visitLiteralElse(GroovySourceAST t, int visit);
    123     void visitLiteralEnum(GroovySourceAST t, int visit);
    124     void visitLiteralExtends(GroovySourceAST t, int visit);
    125     void visitLiteralFalse(GroovySourceAST t, int visit);
    126     void visitLiteralFinally(GroovySourceAST t, int visit);
    127     void visitLiteralFloat(GroovySourceAST t, int visit);
    128     void visitLiteralFor(GroovySourceAST t, int visit);
    129     void visitLiteralIf(GroovySourceAST t, int visit);
    130     void visitLiteralImplements(GroovySourceAST t, int visit);
    131     void visitLiteralImport(GroovySourceAST t, int visit);
    132     void visitLiteralIn(GroovySourceAST t, int visit);
    133     void visitLiteralInstanceof(GroovySourceAST t, int visit);
    134     void visitLiteralInt(GroovySourceAST t, int visit);
    135     void visitLiteralInterface(GroovySourceAST t, int visit);
    136     void visitLiteralLong(GroovySourceAST t, int visit);
    137     void visitLiteralNative(GroovySourceAST t, int visit);
    138     void visitLiteralNew(GroovySourceAST t, int visit);
    139     void visitLiteralNull(GroovySourceAST t, int visit);
    140     void visitLiteralPackage(GroovySourceAST t, int visit);
    141     void visitLiteralPrivate(GroovySourceAST t, int visit);
    142     void visitLiteralProtected(GroovySourceAST t, int visit);
    143     void visitLiteralPublic(GroovySourceAST t, int visit);
    144     void visitLiteralReturn(GroovySourceAST t, int visit);
    145     void visitLiteralShort(GroovySourceAST t, int visit);
    146     void visitLiteralStatic(GroovySourceAST t, int visit);
    147     void visitLiteralSuper(GroovySourceAST t, int visit);
    148     void visitLiteralSwitch(GroovySourceAST t, int visit);
    149     void visitLiteralSynchronized(GroovySourceAST t, int visit);
    150     void visitLiteralThis(GroovySourceAST t, int visit);
    151     void visitLiteralThreadsafe(GroovySourceAST t, int visit);
    152     void visitLiteralThrow(GroovySourceAST t, int visit);
    153     void visitLiteralThrows(GroovySourceAST t, int visit);
    154     void visitLiteralTransient(GroovySourceAST t, int visit);
    155     void visitLiteralTrue(GroovySourceAST t, int visit);
    156     void visitLiteralTry(GroovySourceAST t, int visit);
    157     void visitLiteralVoid(GroovySourceAST t, int visit);
    158     void visitLiteralVolatile(GroovySourceAST t, int visit);
    159     void visitLiteralWhile(GroovySourceAST t, int visit);
    160     void visitLiteralWith(GroovySourceAST t, int visit);
    161     void visitLnot(GroovySourceAST t, int visit);
    162     void visitLor(GroovySourceAST t, int visit);
    163     void visitLparen(GroovySourceAST t, int visit);
    164     void visitLt(GroovySourceAST t, int visit);
    165     void visitMapConstructor(GroovySourceAST t, int visit);
    166     void visitMemberPointer(GroovySourceAST t, int visit);
    167     void visitMethodCall(GroovySourceAST t, int visit);
    168     void visitMethodDef(GroovySourceAST t, int visit);
    169     void visitMinus(GroovySourceAST t, int visit);
    170     void visitMinusAssign(GroovySourceAST t, int visit);
    171     void visitMlComment(GroovySourceAST t, int visit);
    172     void visitMod(GroovySourceAST t, int visit);
    173     void visitModifiers(GroovySourceAST t, int visit);
    174     void visitModAssign(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 visitScopeEscape(GroovySourceAST t, int visit);
    206     void visitSelectSlot(GroovySourceAST t, int visit);
    207     void visitSemi(GroovySourceAST t, int visit);
    208     void visitShComment(GroovySourceAST t, int visit);
    209     void visitSl(GroovySourceAST t, int visit);
    210     void visitSlist(GroovySourceAST t, int visit);
    211     void visitSlAssign(GroovySourceAST t, int visit);
    212     void visitSlComment(GroovySourceAST t, int visit);
    213     void visitSpreadArg(GroovySourceAST t, int visit);
    214     void visitSpreadDot(GroovySourceAST t, int visit);
    215     void visitSpreadMapArg(GroovySourceAST t, int visit);
    216     void visitSr(GroovySourceAST t, int visit);
    217     void visitSrAssign(GroovySourceAST t, int visit);
    218     void visitStar(GroovySourceAST t, int visit);
    219     void visitStarAssign(GroovySourceAST t, int visit);
    220     void visitStarStar(GroovySourceAST t, int visit);
    221     void visitStarStarAssign(GroovySourceAST t, int visit);
    222     void visitStaticImport(GroovySourceAST t, int visit);
    223     void visitStaticInit(GroovySourceAST t, int visit);
    224     void visitStrictfp(GroovySourceAST t, int visit);
    225     void visitStringCh(GroovySourceAST t, int visit);
    226     void visitStringConstructor(GroovySourceAST t, int visit);
    227     void visitStringCtorEnd(GroovySourceAST t, int visit);
    228     void visitStringCtorMiddle(GroovySourceAST t, int visit);
    229     void visitStringCtorStart(GroovySourceAST t, int visit);
    230     void visitStringLiteral(GroovySourceAST t, int visit);
    231     void visitStringNl(GroovySourceAST t, int visit);
    232     void visitSuperCtorCall(GroovySourceAST t, int visit);
    233     void visitTripleDot(GroovySourceAST t, int visit);
    234     void visitType(GroovySourceAST t, int visit);
    235     void visitTypecast(GroovySourceAST t, int visit);
    236     void visitTypeArgument(GroovySourceAST t, int visit);
    237     void visitTypeArguments(GroovySourceAST t, int visit);
    238     void visitTypeLowerBounds(GroovySourceAST t, int visit);
    239     void visitTypeParameter(GroovySourceAST t, int visit);
    240     void visitTypeParameters(GroovySourceAST t, int visit);
    241     void visitTypeUpperBounds(GroovySourceAST t, int visit);
    242     void visitUnaryMinus(GroovySourceAST t, int visit);
    243     void visitUnaryPlus(GroovySourceAST t, int visit);
    244     void visitUnusedConst(GroovySourceAST t, int visit);
    245     void visitUnusedDo(GroovySourceAST t, int visit);
    246     void visitUnusedGoto(GroovySourceAST t, int visit);
    247     void visitVariableDef(GroovySourceAST t, int visit);
    248     void visitVariableParameterDef(GroovySourceAST t, int visit);
    249     void visitVocab(GroovySourceAST t, int visit);
    250     void visitWildcardType(GroovySourceAST t, int visit);
    251     void visitWs(GroovySourceAST t, int visit);
    252
    253     void visitDefault(GroovySourceAST t,int visit);
    254     void tearDown();
    255
    256     void push(GroovySourceAST t);
    257     GroovySourceAST pop();
    258 }