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