/*******************************************************************************
 * Copyright (c) 2000, 2003 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials 
 * are made available under the terms of the Common Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/cpl-v10.html
 * 
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.jdt.internal.compiler;

import org.eclipse.jdt.core.compiler.*;
import org.eclipse.jdt.internal.compiler.ast.*;
import org.eclipse.jdt.internal.compiler.lookup.*;

/**
 * An adapter class for interating through the parse tree.
 */

public class AbstractSyntaxTreeVisitorAdapter implements IAbstractSyntaxTreeVisitor {

	public void acceptProblem(IProblem problem) {
		// do nothing by default
	}
	public void endVisit(
		AllocationExpression allocationExpression,
		BlockScope scope) {
		// do nothing by default
	}
	public void endVisit(AND_AND_Expression and_and_Expression, BlockScope scope) {
		// do nothing by default
	}
	public void endVisit(
		AnonymousLocalTypeDeclaration anonymousTypeDeclaration,
		BlockScope scope) {
		// do nothing by default
	}
	public void endVisit(JavadocArrayQualifiedTypeReference typeRef, BlockScope scope) {
		// do nothing by default
	}
	public void endVisit(JavadocArraySingleTypeReference typeRef, BlockScope scope) {
		// do nothing by default
	}
	public void endVisit(JavadocArgumentExpression expression, BlockScope scope) {
		// do nothing by default
	}
	public void endVisit(JavadocFieldReference fieldRef, BlockScope scope) {
		// do nothing by default
	}
	public void endVisit(JavadocMessageSend messageSend, BlockScope scope) {
		// do nothing by default
	}
	public void endVisit(JavadocQualifiedTypeReference typeRef, BlockScope scope) {
		// do nothing by default
	}
	public void endVisit(JavadocReturnStatement statement, BlockScope scope) {
		// do nothing by default
	}
	public void endVisit(JavadocSingleNameReference argument, BlockScope scope) {
		// do nothing by default
	}
	public void endVisit(JavadocSingleTypeReference typeRef, BlockScope scope) {
		// do nothing by default
	}
	public void endVisit(Argument argument, BlockScope scope) {
		// do nothing by default
	}
	public void endVisit(
		ArrayAllocationExpression arrayAllocationExpression,
		BlockScope scope) {
		// do nothing by default
	}
	public void endVisit(ArrayInitializer arrayInitializer, BlockScope scope) {
		// do nothing by default
	}
	public void endVisit(
		ArrayQualifiedTypeReference arrayQualifiedTypeReference,
		BlockScope scope) {
		// do nothing by default
	}
	public void endVisit(
		ArrayQualifiedTypeReference arrayQualifiedTypeReference,
		ClassScope scope) {
		// do nothing by default
	}
	public void endVisit(ArrayReference arrayReference, BlockScope scope) {
		// do nothing by default
	}
	public void endVisit(ArrayTypeReference arrayTypeReference, BlockScope scope) {
		// do nothing by default
	}
	public void endVisit(ArrayTypeReference arrayTypeReference, ClassScope scope) {
		// do nothing by default
	}
	public void endVisit(Assignment assignment, BlockScope scope) {
		// do nothing by default
	}
	public void endVisit(AssertStatement assertStatement, BlockScope scope) {
		// do nothing by default
	}
	public void endVisit(BinaryExpression binaryExpression, BlockScope scope) {
		// do nothing by default
	}
	public void endVisit(Block block, BlockScope scope) {
		// do nothing by default
	}
	public void endVisit(BreakStatement breakStatement, BlockScope scope) {
		// do nothing by default
	}
	public void endVisit(CaseStatement caseStatement, BlockScope scope) {
		// do nothing by default
	}
	public void endVisit(CastExpression castExpression, BlockScope scope) {
		// do nothing by default
	}
	public void endVisit(CharLiteral charLiteral, BlockScope scope) {
		// do nothing by default
	}
	public void endVisit(ClassLiteralAccess classLiteral, BlockScope scope) {
		// do nothing by default
	}
	public void endVisit(Clinit clinit, ClassScope scope) {
		// do nothing by default
	}
	public void endVisit(
		CompilationUnitDeclaration compilationUnitDeclaration,
		CompilationUnitScope scope) {
		// do nothing by default
	}
	public void endVisit(CompoundAssignment compoundAssignment, BlockScope scope) {
		// do nothing by default
	}
	public void endVisit(
		ConditionalExpression conditionalExpression,
		BlockScope scope) {
		// do nothing by default
	}
	public void endVisit(
		ConstructorDeclaration constructorDeclaration,
		ClassScope scope) {
		// do nothing by default
	}
	public void endVisit(ContinueStatement continueStatement, BlockScope scope) {
		// do nothing by default
	}
	public void endVisit(DoStatement doStatement, BlockScope scope) {
		// do nothing by default
	}
	public void endVisit(DoubleLiteral doubleLiteral, BlockScope scope) {
		// do nothing by default
	}
	public void endVisit(EqualExpression equalExpression, BlockScope scope) {
		// do nothing by default
	}
	public void endVisit(
		ExplicitConstructorCall explicitConstructor,
		BlockScope scope) {
		// do nothing by default
	}
	public void endVisit(
		ExtendedStringLiteral extendedStringLiteral,
		BlockScope scope) {
		// do nothing by default
	}
	public void endVisit(FalseLiteral falseLiteral, BlockScope scope) {
		// do nothing by default
	}
	public void endVisit(FieldDeclaration fieldDeclaration, MethodScope scope) {
		// do nothing by default
	}
	public void endVisit(FieldReference fieldReference, BlockScope scope) {
		// do nothing by default
	}
	public void endVisit(FloatLiteral floatLiteral, BlockScope scope) {
		// do nothing by default
	}
	public void endVisit(EmptyStatement emptyStatement, BlockScope scope) {
		// do nothing by default
	}
	public void endVisit(ForStatement forStatement, BlockScope scope) {
		// do nothing by default
	}
	public void endVisit(IfStatement ifStatement, BlockScope scope) {
		// do nothing by default
	}
	public void endVisit(ImportReference importRef, CompilationUnitScope scope) {
		// do nothing by default
	}
	public void endVisit(Initializer initializer, MethodScope scope) {
		// do nothing by default
	}
	public void endVisit(
		InstanceOfExpression instanceOfExpression,
		BlockScope scope) {
		// do nothing by default
	}
	public void endVisit(IntLiteral intLiteral, BlockScope scope) {
		// do nothing by default
	}
	public void endVisit(IteratorForStatement forStatement, BlockScope scope) {
		// do nothing by default
	}
	public void endVisit(LabeledStatement labeledStatement, BlockScope scope) {
		// do nothing by default
	}
	public void endVisit(LocalDeclaration localDeclaration, BlockScope scope) {
		// do nothing by default
	}
	public void endVisit(LongLiteral longLiteral, BlockScope scope) {
		// do nothing by default
	}
	public void endVisit(
		MemberTypeDeclaration memberTypeDeclaration,
		ClassScope scope) {
		// do nothing by default
	}
	public void endVisit(MessageSend messageSend, BlockScope scope) {
		// do nothing by default
	}
	public void endVisit(MethodDeclaration methodDeclaration, ClassScope scope) {
		// do nothing by default
	}
	public void endVisit(NullLiteral nullLiteral, BlockScope scope) {
		// do nothing by default
	}
	public void endVisit(OR_OR_Expression or_or_Expression, BlockScope scope) {
		// do nothing by default
	}
	public void endVisit(PostfixExpression postfixExpression, BlockScope scope) {
		// do nothing by default
	}
	public void endVisit(PrefixExpression prefixExpression, BlockScope scope) {
		// do nothing by default
	}
	public void endVisit(
		QualifiedAllocationExpression qualifiedAllocationExpression,
		BlockScope scope) {
		// do nothing by default
	}
	public void endVisit(
		QualifiedNameReference qualifiedNameReference,
		BlockScope scope) {
		// do nothing by default
	}
	public void endVisit(
		QualifiedSuperReference qualifiedSuperReference,
		BlockScope scope) {
		// do nothing by default
	}
	public void endVisit(
		QualifiedThisReference qualifiedThisReference,
		BlockScope scope) {
		// do nothing by default
	}
	public void endVisit(
		QualifiedTypeReference qualifiedTypeReference,
		BlockScope scope) {
		// do nothing by default
	}
	public void endVisit(
		QualifiedTypeReference qualifiedTypeReference,
		ClassScope scope) {
		// do nothing by default
	}
	public void endVisit(ReturnStatement returnStatement, BlockScope scope) {
		// do nothing by default
	}
	public void endVisit(
		SingleNameReference singleNameReference,
		BlockScope scope) {
		// do nothing by default
	}
	public void endVisit(
		SingleTypeReference singleTypeReference,
		BlockScope scope) {
		// do nothing by default
	}
	public void endVisit(
		SingleTypeReference singleTypeReference,
		ClassScope scope) {
		// do nothing by default
	}
	public void endVisit(StringLiteral stringLiteral, BlockScope scope) {
		// do nothing by default
	}
	public void endVisit(SuperReference superReference, BlockScope scope) {
		// do nothing by default
	}
	public void endVisit(SwitchStatement switchStatement, BlockScope scope) {
		// do nothing by default
	}
	public void endVisit(
		SynchronizedStatement synchronizedStatement,
		BlockScope scope) {
		// do nothing by default
	}
	public void endVisit(ThisReference thisReference, BlockScope scope) {
		// do nothing by default
	}
	public void endVisit(ThrowStatement throwStatement, BlockScope scope) {
		// do nothing by default
	}
	public void endVisit(TrueLiteral trueLiteral, BlockScope scope) {
		// do nothing by default
	}
	public void endVisit(TryStatement tryStatement, BlockScope scope) {
		// do nothing by default
	}
	public void endVisit(
		TypeDeclaration typeDeclaration,
		CompilationUnitScope scope) {
		// do nothing by default
	}
	public void endVisit(UnaryExpression unaryExpression, BlockScope scope) {
		// do nothing by default
	}
	public void endVisit(WhileStatement whileStatement, BlockScope scope) {
		// do nothing by default
	}
	public boolean visit(
		AllocationExpression allocationExpression,
		BlockScope scope) {
		return true; // do nothing by default, keep traversing
		// do nothing by default
	}
	public boolean visit(AND_AND_Expression and_and_Expression, BlockScope scope) {
		return true; // do nothing by default, keep traversing
	}
	public boolean visit(
		AnonymousLocalTypeDeclaration anonymousTypeDeclaration,
		BlockScope scope) {
		return true; // do nothing by default, keep traversing
	}
	public boolean visit(JavadocArrayQualifiedTypeReference typeRef, BlockScope scope) {
		return true; // do nothing by default, keep traversing
	}
	public boolean visit(JavadocArraySingleTypeReference typeRef, BlockScope scope) {
		return true; // do nothing by default, keep traversing
	}
	public boolean visit(JavadocArgumentExpression expression, BlockScope scope) {
		return true; // do nothing by default, keep traversing
	}
	public boolean visit(JavadocFieldReference fieldRef, BlockScope scope) {
		return true; // do nothing by default, keep traversing
	}
	public boolean visit(JavadocMessageSend messageSend, BlockScope scope) {
		return true; // do nothing by default, keep traversing
	}
	public boolean visit(JavadocQualifiedTypeReference typeRef, BlockScope scope) {
		return true; // do nothing by default, keep traversing
	}
	public boolean visit(JavadocReturnStatement statement, BlockScope scope) {
		return true; // do nothing by default, keep traversing
	}
	public boolean visit(JavadocSingleNameReference argument, BlockScope scope) {
		return true; // do nothing by default, keep traversing
	}
	public boolean visit(JavadocSingleTypeReference typeRef, BlockScope scope) {
		return true; // do nothing by default, keep traversing
	}
	public boolean visit(Argument argument, BlockScope scope) {
		return true; // do nothing by default, keep traversing
	}
	public boolean visit(
		ArrayAllocationExpression arrayAllocationExpression,
		BlockScope scope) {
		return true; // do nothing by default, keep traversing
	}
	public boolean visit(ArrayInitializer arrayInitializer, BlockScope scope) {
		return true; // do nothing by default, keep traversing
	}
	public boolean visit(
		ArrayQualifiedTypeReference arrayQualifiedTypeReference,
		BlockScope scope) {
		return true; // do nothing by default, keep traversing
	}
	public boolean visit(
		ArrayQualifiedTypeReference arrayQualifiedTypeReference,
		ClassScope scope) {
		return true; // do nothing by default, keep traversing
	}
	public boolean visit(ArrayReference arrayReference, BlockScope scope) {
		return true; // do nothing by default, keep traversing
	}
	public boolean visit(ArrayTypeReference arrayTypeReference, BlockScope scope) {
		return true; // do nothing by default, keep traversing
	}
	public boolean visit(ArrayTypeReference arrayTypeReference, ClassScope scope) {
		return true; // do nothing by default, keep traversing
	}
	public boolean visit(Assignment assignment, BlockScope scope) {
		return true; // do nothing by default, keep traversing
	}
	public boolean visit(AssertStatement assertStatement, BlockScope scope) {
		return true; // do nothing by default, keep traversing
	}
	public boolean visit(BinaryExpression binaryExpression, BlockScope scope) {
		return true; // do nothing by default, keep traversing
	}
	public boolean visit(Block block, BlockScope scope) {
		return true; // do nothing by default, keep traversing
	}
	public boolean visit(BreakStatement breakStatement, BlockScope scope) {
		return true; // do nothing by default, keep traversing
	}
	public boolean visit(CaseStatement caseStatement, BlockScope scope) {
		return true; // do nothing by default, keep traversing
	}
	public boolean visit(CastExpression castExpression, BlockScope scope) {
		return true; // do nothing by default, keep traversing
	}
	public boolean visit(CharLiteral charLiteral, BlockScope scope) {
		return true; // do nothing by default, keep traversing
	}
	public boolean visit(ClassLiteralAccess classLiteral, BlockScope scope) {
		return true; // do nothing by default, keep traversing
	}
	public boolean visit(Clinit clinit, ClassScope scope) {
		return true; // do nothing by default, keep traversing
	}
	public boolean visit(
		CompilationUnitDeclaration compilationUnitDeclaration,
		CompilationUnitScope scope) {
		return true; // do nothing by default, keep traversing
	}
	public boolean visit(CompoundAssignment compoundAssignment, BlockScope scope) {
		return true; // do nothing by default, keep traversing
	}
	public boolean visit(
		ConditionalExpression conditionalExpression,
		BlockScope scope) {
		return true; // do nothing by default, keep traversing
	}
	public boolean visit(
		ConstructorDeclaration constructorDeclaration,
		ClassScope scope) {
		return true; // do nothing by default, keep traversing
	}
	public boolean visit(ContinueStatement continueStatement, BlockScope scope) {
		return true; // do nothing by default, keep traversing
	}
	public boolean visit(DoStatement doStatement, BlockScope scope) {
		return true; // do nothing by default, keep traversing
	}
	public boolean visit(DoubleLiteral doubleLiteral, BlockScope scope) {
		return true; // do nothing by default, keep traversing
	}
	public boolean visit(EqualExpression equalExpression, BlockScope scope) {
		return true; // do nothing by default, keep traversing
	}
	public boolean visit(EmptyStatement emptyStatement, BlockScope scope) {
		return true; // do nothing by default, keep traversing
	}
	public boolean visit(
		ExplicitConstructorCall explicitConstructor,
		BlockScope scope) {
		return true; // do nothing by default, keep traversing
	}
	public boolean visit(
		ExtendedStringLiteral extendedStringLiteral,
		BlockScope scope) {
		return true; // do nothing by default, keep traversing
	}
	public boolean visit(FalseLiteral falseLiteral, BlockScope scope) {
		return true; // do nothing by default, keep traversing
	}
	public boolean visit(FieldDeclaration fieldDeclaration, MethodScope scope) {
		return true; // do nothing by default, keep traversing
	}
	public boolean visit(FieldReference fieldReference, BlockScope scope) {
		return true; // do nothing by default, keep traversing
	}
	public boolean visit(FloatLiteral floatLiteral, BlockScope scope) {
		return true; // do nothing by default, keep traversing
	}
	public boolean visit(ForStatement forStatement, BlockScope scope) {
		return true; // do nothing by default, keep traversing
	}
	public boolean visit(IfStatement ifStatement, BlockScope scope) {
		return true; // do nothing by default, keep traversing
	}
	public boolean visit(ImportReference importRef, CompilationUnitScope scope) {
		return true; // do nothing by default, keep traversing
	}
	public boolean visit(Initializer initializer, MethodScope scope) {
		return true; // do nothing by default, keep traversing
	}
	public boolean visit(
		InstanceOfExpression instanceOfExpression,
		BlockScope scope) {
		return true; // do nothing by default, keep traversing
	}
	public boolean visit(IntLiteral intLiteral, BlockScope scope) {
		return true; // do nothing by default, keep traversing
	}
	public boolean visit(IteratorForStatement forStatement, BlockScope scope) {
		return true; // do nothing by default, keep traversing
	}
	public boolean visit(LabeledStatement labeledStatement, BlockScope scope) {
		return true; // do nothing by default, keep traversing
	}
	public boolean visit(LocalDeclaration localDeclaration, BlockScope scope) {
		return true; // do nothing by default, keep traversing
	}
	public boolean visit(LongLiteral longLiteral, BlockScope scope) {
		return true; // do nothing by default, keep traversing
	}
	public boolean visit(
		MemberTypeDeclaration memberTypeDeclaration,
		ClassScope scope) {
		return true; // do nothing by default, keep traversing
	}
	public boolean visit(MessageSend messageSend, BlockScope scope) {
		return true; // do nothing by default, keep traversing
	}
	public boolean visit(MethodDeclaration methodDeclaration, ClassScope scope) {
		return true; // do nothing by default, keep traversing
	}
	public boolean visit(NullLiteral nullLiteral, BlockScope scope) {
		return true; // do nothing by default, keep traversing
	}
	public boolean visit(OR_OR_Expression or_or_Expression, BlockScope scope) {
		return true; // do nothing by default, keep traversing
	}
	public boolean visit(PostfixExpression postfixExpression, BlockScope scope) {
		return true; // do nothing by default, keep traversing
	}
	public boolean visit(PrefixExpression prefixExpression, BlockScope scope) {
		return true; // do nothing by default, keep traversing
	}
	public boolean visit(
		QualifiedAllocationExpression qualifiedAllocationExpression,
		BlockScope scope) {
		return true; // do nothing by default, keep traversing
	}
	public boolean visit(
		QualifiedNameReference qualifiedNameReference,
		BlockScope scope) {
		return true; // do nothing by default, keep traversing
	}
	public boolean visit(
		QualifiedSuperReference qualifiedSuperReference,
		BlockScope scope) {
		return true; // do nothing by default, keep traversing
	}
	public boolean visit(
		QualifiedThisReference qualifiedThisReference,
		BlockScope scope) {
		return true; // do nothing by default, keep traversing
	}
	public boolean visit(
		QualifiedTypeReference qualifiedTypeReference,
		BlockScope scope) {
		return true; // do nothing by default, keep traversing
	}
	public boolean visit(
		QualifiedTypeReference qualifiedTypeReference,
		ClassScope scope) {
		return true; // do nothing by default, keep traversing
	}
	public boolean visit(ReturnStatement returnStatement, BlockScope scope) {
		return true; // do nothing by default, keep traversing
	}
	public boolean visit(
		SingleNameReference singleNameReference,
		BlockScope scope) {
		return true; // do nothing by default, keep traversing
	}
	public boolean visit(
		SingleTypeReference singleTypeReference,
		BlockScope scope) {
		return true; // do nothing by default, keep traversing
	}
	public boolean visit(
		SingleTypeReference singleTypeReference,
		ClassScope scope) {
		return true; // do nothing by default, keep traversing
	}
	public boolean visit(StringLiteral stringLiteral, BlockScope scope) {
		return true; // do nothing by default, keep traversing
	}
	public boolean visit(SuperReference superReference, BlockScope scope) {
		return true; // do nothing by default, keep traversing
	}
	public boolean visit(SwitchStatement switchStatement, BlockScope scope) {
		return true; // do nothing by default, keep traversing
	}
	public boolean visit(
		SynchronizedStatement synchronizedStatement,
		BlockScope scope) {
		return true; // do nothing by default, keep traversing
	}
	public boolean visit(ThisReference thisReference, BlockScope scope) {
		return true; // do nothing by default, keep traversing
	}
	public boolean visit(ThrowStatement throwStatement, BlockScope scope) {
		return true; // do nothing by default, keep traversing
	}
	public boolean visit(TrueLiteral trueLiteral, BlockScope scope) {
		return true; // do nothing by default, keep traversing
	}
	public boolean visit(TryStatement tryStatement, BlockScope scope) {
		return true; // do nothing by default, keep traversing
	}
	public boolean visit(
		TypeDeclaration typeDeclaration,
		CompilationUnitScope scope) {
		return true; // do nothing by default, keep traversing
	}
	public boolean visit(UnaryExpression unaryExpression, BlockScope scope) {
		return true; // do nothing by default, keep traversing
	}
	public boolean visit(WhileStatement whileStatement, BlockScope scope) {
		return true; // do nothing by default, keep traversing
	}
	public boolean visit(
		LocalTypeDeclaration localTypeDeclaration,
		BlockScope scope) {
		return true; // do nothing by default, keep traversing
	}
	public void endVisit(
		LocalTypeDeclaration localTypeDeclaration,
		BlockScope scope) {
		// do nothing by default
	}
}
