Wed, 27 Apr 2016 01:34:52 +0800
Initial load
http://hg.openjdk.java.net/jdk8u/jdk8u/langtools/
changeset: 2573:53ca196be1ae
tag: jdk8u25-b17
aoqi@0 | 1 | /* |
aoqi@0 | 2 | * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. |
aoqi@0 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
aoqi@0 | 4 | * |
aoqi@0 | 5 | * This code is free software; you can redistribute it and/or modify it |
aoqi@0 | 6 | * under the terms of the GNU General Public License version 2 only, as |
aoqi@0 | 7 | * published by the Free Software Foundation. Oracle designates this |
aoqi@0 | 8 | * particular file as subject to the "Classpath" exception as provided |
aoqi@0 | 9 | * by Oracle in the LICENSE file that accompanied this code. |
aoqi@0 | 10 | * |
aoqi@0 | 11 | * This code is distributed in the hope that it will be useful, but WITHOUT |
aoqi@0 | 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
aoqi@0 | 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
aoqi@0 | 14 | * version 2 for more details (a copy is included in the LICENSE file that |
aoqi@0 | 15 | * accompanied this code). |
aoqi@0 | 16 | * |
aoqi@0 | 17 | * You should have received a copy of the GNU General Public License version |
aoqi@0 | 18 | * 2 along with this work; if not, write to the Free Software Foundation, |
aoqi@0 | 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
aoqi@0 | 20 | * |
aoqi@0 | 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
aoqi@0 | 22 | * or visit www.oracle.com if you need additional information or have any |
aoqi@0 | 23 | * questions. |
aoqi@0 | 24 | */ |
aoqi@0 | 25 | |
aoqi@0 | 26 | package com.sun.source.tree; |
aoqi@0 | 27 | |
aoqi@0 | 28 | /** |
aoqi@0 | 29 | * A visitor of trees, in the style of the visitor design pattern. |
aoqi@0 | 30 | * Classes implementing this interface are used to operate |
aoqi@0 | 31 | * on a tree when the kind of tree is unknown at compile time. |
aoqi@0 | 32 | * When a visitor is passed to an tree's {@link Tree#accept |
aoqi@0 | 33 | * accept} method, the <tt>visit<i>XYZ</i></tt> method most applicable |
aoqi@0 | 34 | * to that tree is invoked. |
aoqi@0 | 35 | * |
aoqi@0 | 36 | * <p> Classes implementing this interface may or may not throw a |
aoqi@0 | 37 | * {@code NullPointerException} if the additional parameter {@code p} |
aoqi@0 | 38 | * is {@code null}; see documentation of the implementing class for |
aoqi@0 | 39 | * details. |
aoqi@0 | 40 | * |
aoqi@0 | 41 | * <p> <b>WARNING:</b> It is possible that methods will be added to |
aoqi@0 | 42 | * this interface to accommodate new, currently unknown, language |
aoqi@0 | 43 | * structures added to future versions of the Java™ programming |
aoqi@0 | 44 | * language. Therefore, visitor classes directly implementing this |
aoqi@0 | 45 | * interface may be source incompatible with future versions of the |
aoqi@0 | 46 | * platform. |
aoqi@0 | 47 | * |
aoqi@0 | 48 | * @param <R> the return type of this visitor's methods. Use {@link |
aoqi@0 | 49 | * Void} for visitors that do not need to return results. |
aoqi@0 | 50 | * @param <P> the type of the additional parameter to this visitor's |
aoqi@0 | 51 | * methods. Use {@code Void} for visitors that do not need an |
aoqi@0 | 52 | * additional parameter. |
aoqi@0 | 53 | * |
aoqi@0 | 54 | * @author Peter von der Ahé |
aoqi@0 | 55 | * @author Jonathan Gibbons |
aoqi@0 | 56 | * |
aoqi@0 | 57 | * @since 1.6 |
aoqi@0 | 58 | */ |
aoqi@0 | 59 | @jdk.Exported |
aoqi@0 | 60 | public interface TreeVisitor<R,P> { |
aoqi@0 | 61 | R visitAnnotatedType(AnnotatedTypeTree node, P p); |
aoqi@0 | 62 | R visitAnnotation(AnnotationTree node, P p); |
aoqi@0 | 63 | R visitMethodInvocation(MethodInvocationTree node, P p); |
aoqi@0 | 64 | R visitAssert(AssertTree node, P p); |
aoqi@0 | 65 | R visitAssignment(AssignmentTree node, P p); |
aoqi@0 | 66 | R visitCompoundAssignment(CompoundAssignmentTree node, P p); |
aoqi@0 | 67 | R visitBinary(BinaryTree node, P p); |
aoqi@0 | 68 | R visitBlock(BlockTree node, P p); |
aoqi@0 | 69 | R visitBreak(BreakTree node, P p); |
aoqi@0 | 70 | R visitCase(CaseTree node, P p); |
aoqi@0 | 71 | R visitCatch(CatchTree node, P p); |
aoqi@0 | 72 | R visitClass(ClassTree node, P p); |
aoqi@0 | 73 | R visitConditionalExpression(ConditionalExpressionTree node, P p); |
aoqi@0 | 74 | R visitContinue(ContinueTree node, P p); |
aoqi@0 | 75 | R visitDoWhileLoop(DoWhileLoopTree node, P p); |
aoqi@0 | 76 | R visitErroneous(ErroneousTree node, P p); |
aoqi@0 | 77 | R visitExpressionStatement(ExpressionStatementTree node, P p); |
aoqi@0 | 78 | R visitEnhancedForLoop(EnhancedForLoopTree node, P p); |
aoqi@0 | 79 | R visitForLoop(ForLoopTree node, P p); |
aoqi@0 | 80 | R visitIdentifier(IdentifierTree node, P p); |
aoqi@0 | 81 | R visitIf(IfTree node, P p); |
aoqi@0 | 82 | R visitImport(ImportTree node, P p); |
aoqi@0 | 83 | R visitArrayAccess(ArrayAccessTree node, P p); |
aoqi@0 | 84 | R visitLabeledStatement(LabeledStatementTree node, P p); |
aoqi@0 | 85 | R visitLiteral(LiteralTree node, P p); |
aoqi@0 | 86 | R visitMethod(MethodTree node, P p); |
aoqi@0 | 87 | R visitModifiers(ModifiersTree node, P p); |
aoqi@0 | 88 | R visitNewArray(NewArrayTree node, P p); |
aoqi@0 | 89 | R visitNewClass(NewClassTree node, P p); |
aoqi@0 | 90 | R visitLambdaExpression(LambdaExpressionTree node, P p); |
aoqi@0 | 91 | R visitParenthesized(ParenthesizedTree node, P p); |
aoqi@0 | 92 | R visitReturn(ReturnTree node, P p); |
aoqi@0 | 93 | R visitMemberSelect(MemberSelectTree node, P p); |
aoqi@0 | 94 | R visitMemberReference(MemberReferenceTree node, P p); |
aoqi@0 | 95 | R visitEmptyStatement(EmptyStatementTree node, P p); |
aoqi@0 | 96 | R visitSwitch(SwitchTree node, P p); |
aoqi@0 | 97 | R visitSynchronized(SynchronizedTree node, P p); |
aoqi@0 | 98 | R visitThrow(ThrowTree node, P p); |
aoqi@0 | 99 | R visitCompilationUnit(CompilationUnitTree node, P p); |
aoqi@0 | 100 | R visitTry(TryTree node, P p); |
aoqi@0 | 101 | R visitParameterizedType(ParameterizedTypeTree node, P p); |
aoqi@0 | 102 | R visitUnionType(UnionTypeTree node, P p); |
aoqi@0 | 103 | R visitIntersectionType(IntersectionTypeTree node, P p); |
aoqi@0 | 104 | R visitArrayType(ArrayTypeTree node, P p); |
aoqi@0 | 105 | R visitTypeCast(TypeCastTree node, P p); |
aoqi@0 | 106 | R visitPrimitiveType(PrimitiveTypeTree node, P p); |
aoqi@0 | 107 | R visitTypeParameter(TypeParameterTree node, P p); |
aoqi@0 | 108 | R visitInstanceOf(InstanceOfTree node, P p); |
aoqi@0 | 109 | R visitUnary(UnaryTree node, P p); |
aoqi@0 | 110 | R visitVariable(VariableTree node, P p); |
aoqi@0 | 111 | R visitWhileLoop(WhileLoopTree node, P p); |
aoqi@0 | 112 | R visitWildcard(WildcardTree node, P p); |
aoqi@0 | 113 | R visitOther(Tree node, P p); |
aoqi@0 | 114 | } |