All Downloads are FREE. Search and download functionalities are using the official Maven repository.

spoon.reflect.visitor.CtVisitor Maven / Gradle / Ivy

/* 
 * Spoon - http://spoon.gforge.inria.fr/
 * Copyright (C) 2006 INRIA Futurs 
 * 
 * This software is governed by the CeCILL-C License under French law and
 * abiding by the rules of distribution of free software. You can use, modify 
 * and/or redistribute the software under the terms of the CeCILL-C license as 
 * circulated by CEA, CNRS and INRIA at http://www.cecill.info. 
 * 
 * This program is distributed in the hope that it will be useful, but WITHOUT 
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
 * FITNESS FOR A PARTICULAR PURPOSE. See the CeCILL-C License for more details.
 *  
 * The fact that you are presently reading this means that you have had
 * knowledge of the CeCILL-C license and that you accept its terms.
 */

package spoon.reflect.visitor;

import java.lang.annotation.Annotation;

import spoon.reflect.code.CtAnnotationFieldAccess;
import spoon.reflect.code.CtArrayAccess;
import spoon.reflect.code.CtAssert;
import spoon.reflect.code.CtAssignment;
import spoon.reflect.code.CtBinaryOperator;
import spoon.reflect.code.CtBlock;
import spoon.reflect.code.CtBreak;
import spoon.reflect.code.CtCase;
import spoon.reflect.code.CtCatch;
import spoon.reflect.code.CtCodeSnippetExpression;
import spoon.reflect.code.CtCodeSnippetStatement;
import spoon.reflect.code.CtConditional;
import spoon.reflect.code.CtContinue;
import spoon.reflect.code.CtDo;
import spoon.reflect.code.CtExpression;
import spoon.reflect.code.CtFor;
import spoon.reflect.code.CtForEach;
import spoon.reflect.code.CtIf;
import spoon.reflect.code.CtInvocation;
import spoon.reflect.code.CtLiteral;
import spoon.reflect.code.CtLocalVariable;
import spoon.reflect.code.CtNewArray;
import spoon.reflect.code.CtNewClass;
import spoon.reflect.code.CtOperatorAssignment;
import spoon.reflect.code.CtReturn;
import spoon.reflect.code.CtStatementList;
import spoon.reflect.code.CtSwitch;
import spoon.reflect.code.CtSynchronized;
import spoon.reflect.code.CtTargetedAccess;
import spoon.reflect.code.CtThisAccess;
import spoon.reflect.code.CtThrow;
import spoon.reflect.code.CtTry;
import spoon.reflect.code.CtUnaryOperator;
import spoon.reflect.code.CtVariableAccess;
import spoon.reflect.code.CtWhile;
import spoon.reflect.declaration.CtAnnotation;
import spoon.reflect.declaration.CtAnnotationType;
import spoon.reflect.declaration.CtAnonymousExecutable;
import spoon.reflect.declaration.CtClass;
import spoon.reflect.declaration.CtConstructor;
import spoon.reflect.declaration.CtEnum;
import spoon.reflect.declaration.CtField;
import spoon.reflect.declaration.CtInterface;
import spoon.reflect.declaration.CtMethod;
import spoon.reflect.declaration.CtPackage;
import spoon.reflect.declaration.CtParameter;
import spoon.reflect.declaration.CtTypeParameter;
import spoon.reflect.reference.CtArrayTypeReference;
import spoon.reflect.reference.CtExecutableReference;
import spoon.reflect.reference.CtFieldReference;
import spoon.reflect.reference.CtLocalVariableReference;
import spoon.reflect.reference.CtPackageReference;
import spoon.reflect.reference.CtParameterReference;
import spoon.reflect.reference.CtTypeParameterReference;
import spoon.reflect.reference.CtTypeReference;

/**
 * This interface defines the visitor for the Spoon metamodel, as defined in
 * {@link spoon.reflect.declaration}, {@link spoon.reflect.code}, and
 * {@link spoon.reflect.reference}.
 */
public interface CtVisitor {
	/**
	 * Visits an annotation.
	 */
	 void visitCtAnnotation(CtAnnotation annotation);

	/**
	 * Visits a code snippet expression.
	 */
	 void visitCtCodeSnippetExpression(CtCodeSnippetExpression expression);

	/**
	 * Visits a code snippet statement.
	 */
	void visitCtCodeSnippetStatement(CtCodeSnippetStatement statement);

	/**
	 * Visits an annotation type declaration.
	 */
	 void visitCtAnnotationType(
			CtAnnotationType annotationType);

	/**
	 * Visits an anonymous executable.
	 */
	void visitCtAnonymousExecutable(CtAnonymousExecutable anonymousExec);

	/**
	 * Visits an array access.
	 */
	> void visitCtArrayAccess(
			CtArrayAccess arrayAccess);

	/**
	 * Visits a reference to an array type.
	 */
	 void visitCtArrayTypeReference(CtArrayTypeReference reference);

	/**
	 * Visits an assert.
	 */
	 void visitCtAssert(CtAssert asserted);

	/**
	 * Visits an assignment.
	 */
	 void visitCtAssignment(CtAssignment assignement);

	/**
	 * Visits a binary operator.
	 */
	 void visitCtBinaryOperator(CtBinaryOperator operator);

	/**
	 * Visits a block of code.
	 */
	 void visitCtBlock(CtBlock block);

	/**
	 * Visits a break statement.
	 */
	void visitCtBreak(CtBreak breakStatement);

	/**
	 * Visits a case clause.
	 */
	 void visitCtCase(CtCase caseStatement);

	/**
	 * Visits a catch clause.
	 */
	void visitCtCatch(CtCatch catchBlock);

	/**
	 * Visits a class declaration.
	 */
	 void visitCtClass(CtClass ctClass);

	/**
	 * Visits a conditional expression
	 */
	 void visitCtConditional(CtConditional conditional);

	/**
	 * Visits a constructor declaration.
	 */
	 void visitCtConstructor(CtConstructor c);

	/**
	 * Visits a continue statement.
	 */
	void visitCtContinue(CtContinue continueStatement);

	/**
	 * Visits a do loop.
	 */
	void visitCtDo(CtDo doLoop);

	/**
	 * Visits an enumeration declaration.
	 */
	> void visitCtEnum(CtEnum ctEnum);

	/**
	 * Visits a reference to an executable.
	 */
	 void visitCtExecutableReference(CtExecutableReference reference);

	/**
	 * Visits a field declaration.
	 */
	 void visitCtField(CtField f);

	/**
	 * Visits a field access.
	 */
	 void visitCtTargetedAccess(CtTargetedAccess targetedAccess);

	/**
	 * Visits a this access.
	 */
	 void visitCtThisAccess(CtThisAccess thisAccess);
	
	/**
	 * Visits a reference to a field.
	 */
	 void visitCtFieldReference(CtFieldReference reference);

	/**
	 * Visits a for loop.
	 */
	void visitCtFor(CtFor forLoop);

	/**
	 * Visits an enhanced for loop.
	 */
	void visitCtForEach(CtForEach foreach);

	/**
	 * Visits an if statement.
	 */
	void visitCtIf(CtIf ifElement);

	/**
	 * Visits an interface declaration.
	 */
	 void visitCtInterface(CtInterface intrface);

	/**
	 * Visits an executable invocation.
	 */
	 void visitCtInvocation(CtInvocation invocation);

	/**
	 * Visits a literal expression.
	 */
	 void visitCtLiteral(CtLiteral literal);

	/**
	 * Visits a local variable declaration.
	 */
	 void visitCtLocalVariable(CtLocalVariable localVariable);

	/**
	 * Visits a reference to a local variable.
	 */
	 void visitCtLocalVariableReference(CtLocalVariableReference reference);

	/**
	 * Visits a method declaration.
	 */
	 void visitCtMethod(CtMethod m);

	/**
	 * Visits an array construction.
	 */
	 void visitCtNewArray(CtNewArray newArray);

	/**
	 * Visits an anonymous class construction.
	 */
	 void visitCtNewClass(CtNewClass newClass);

	/**
	 * Visits an operator assignment.
	 */
	 void visitCtOperatorAssignement(
			CtOperatorAssignment assignment);

	/**
	 * Visits a package declaration.
	 */
	void visitCtPackage(CtPackage ctPackage);

	/**
	 * Visits a reference to a package.
	 */
	void visitCtPackageReference(CtPackageReference reference);

	/**
	 * Visits a parameter declaration.
	 */
	 void visitCtParameter(CtParameter parameter);

	/**
	 * Visits a reference to a parameter.
	 */
	 void visitCtParameterReference(CtParameterReference reference);

	/**
	 * Visits a return statement.
	 */
	 void visitCtReturn(CtReturn returnStatement);

	/**
	 * Visits a statement list.
	 */
	 void visitCtStatementList(CtStatementList statements);

	/**
	 * Visits a switch statement.
	 */
	 void visitCtSwitch(CtSwitch switchStatement);

	/**
	 * Visits a synchronized modifier.
	 */
	void visitCtSynchronized(CtSynchronized synchro);

	/**
	 * Visits a throw statement.
	 */
	void visitCtThrow(CtThrow throwStatement);

	/**
	 * Visits a try statement.
	 */
	void visitCtTry(CtTry tryBlock);

	/**
	 * Visits a type parameter declaration.
	 */
	void visitCtTypeParameter(CtTypeParameter typeParameter);

	/**
	 * Visits a reference to a type parameter.
	 */
	void visitCtTypeParameterReference(CtTypeParameterReference ref);

	/**
	 * Visits a reference to a type.
	 */
	 void visitCtTypeReference(CtTypeReference reference);

	/**
	 * Visits a unary operator.
	 */
	 void visitCtUnaryOperator(CtUnaryOperator operator);

	/**
	 * Visits a variable access.
	 */
	 void visitCtVariableAccess(CtVariableAccess variableAccess);

	/**
	 * Visits a while loop.
	 */
	void visitCtWhile(CtWhile whileLoop);

	 void visitCtAnnotationFieldAccess(
			CtAnnotationFieldAccess annotationFieldAccess);

}