org.eclipse.jdt.internal.compiler.ASTVisitor Java Examples

The following examples show how to use org.eclipse.jdt.internal.compiler.ASTVisitor. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AllocationExpression.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 6 votes vote down vote up
public void traverse(ASTVisitor visitor, BlockScope scope) {
	if (visitor.visit(this, scope)) {
		if (this.typeArguments != null) {
			for (int i = 0, typeArgumentsLength = this.typeArguments.length; i < typeArgumentsLength; i++) {
				this.typeArguments[i].traverse(visitor, scope);
			}
		}
		if (this.type != null) { // enum constant scenario
			this.type.traverse(visitor, scope);
		}
		if (this.arguments != null) {
			for (int i = 0, argumentsLength = this.arguments.length; i < argumentsLength; i++)
				this.arguments[i].traverse(visitor, scope);
		}
	}
	visitor.endVisit(this, scope);
}
 
Example #2
Source File: MessageSend.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 6 votes vote down vote up
public void traverse(ASTVisitor visitor, BlockScope blockScope) {
	if (visitor.visit(this, blockScope)) {
		this.receiver.traverse(visitor, blockScope);
		if (this.typeArguments != null) {
			for (int i = 0, typeArgumentsLength = this.typeArguments.length; i < typeArgumentsLength; i++) {
				this.typeArguments[i].traverse(visitor, blockScope);
			}
		}
		if (this.arguments != null) {
			int argumentsLength = this.arguments.length;
			for (int i = 0; i < argumentsLength; i++)
				this.arguments[i].traverse(visitor, blockScope);
		}
	}
	visitor.endVisit(this, blockScope);
}
 
Example #3
Source File: ParameterizedSingleTypeReference.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 6 votes vote down vote up
public void traverse(ASTVisitor visitor, BlockScope scope) {
	if (visitor.visit(this, scope)) {
		if (this.annotations != null) {
			Annotation [] typeAnnotations = this.annotations[0];
			for (int i = 0, length = typeAnnotations == null ? 0 : typeAnnotations.length; i < length; i++) {
				typeAnnotations[i].traverse(visitor, scope);
			}
		}
		Annotation [][] annotationsOnDimensions = getAnnotationsOnDimensions(true);
		if (annotationsOnDimensions != null) {
			for (int i = 0, max = annotationsOnDimensions.length; i < max; i++) {
				Annotation[] annotations2 = annotationsOnDimensions[i];
				if (annotations2 != null) {
					for (int j = 0, max2 = annotations2.length; j < max2; j++) {
						Annotation annotation = annotations2[j];
						annotation.traverse(visitor, scope);
					}
				}
			}
		}
		for (int i = 0, max = this.typeArguments.length; i < max; i++) {
			this.typeArguments[i].traverse(visitor, scope);
		}
	}
	visitor.endVisit(this, scope);
}
 
Example #4
Source File: ExplicitConstructorCall.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 6 votes vote down vote up
public void traverse(ASTVisitor visitor, BlockScope scope) {
	if (visitor.visit(this, scope)) {
		if (this.qualification != null) {
			this.qualification.traverse(visitor, scope);
		}
		if (this.typeArguments != null) {
			for (int i = 0, typeArgumentsLength = this.typeArguments.length; i < typeArgumentsLength; i++) {
				this.typeArguments[i].traverse(visitor, scope);
			}
		}
		if (this.arguments != null) {
			for (int i = 0, argumentLength = this.arguments.length; i < argumentLength; i++)
				this.arguments[i].traverse(visitor, scope);
		}
	}
	visitor.endVisit(this, scope);
}
 
Example #5
Source File: ArrayTypeReference.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 6 votes vote down vote up
public void traverse(ASTVisitor visitor, BlockScope scope) {
	if (visitor.visit(this, scope)) {
		if (this.annotations != null) {
			Annotation [] typeAnnotations = this.annotations[0];
			for (int i = 0, length = typeAnnotations == null ? 0 : typeAnnotations.length; i < length; i++) {
				typeAnnotations[i].traverse(visitor, scope);
			}
		}
		if (this.annotationsOnDimensions != null) {
			for (int i = 0, max = this.annotationsOnDimensions.length; i < max; i++) {
				Annotation[] annotations2 = this.annotationsOnDimensions[i];
				if (annotations2 != null) {
					for (int j = 0, max2 = annotations2.length; j < max2; j++) {
						Annotation annotation = annotations2[j];
						annotation.traverse(visitor, scope);
					}
				}
			}
		}
	}
	visitor.endVisit(this, scope);
}
 
Example #6
Source File: JavadocAllocationExpression.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 6 votes vote down vote up
public void traverse(ASTVisitor visitor, ClassScope scope) {
	if (visitor.visit(this, scope)) {
		if (this.typeArguments != null) {
			for (int i = 0, typeArgumentsLength = this.typeArguments.length; i < typeArgumentsLength; i++) {
				this.typeArguments[i].traverse(visitor, scope);
			}
		}
		if (this.type != null) { // enum constant scenario
			this.type.traverse(visitor, scope);
		}
		if (this.arguments != null) {
			for (int i = 0, argumentsLength = this.arguments.length; i < argumentsLength; i++)
				this.arguments[i].traverse(visitor, scope);
		}
	}
	visitor.endVisit(this, scope);
}
 
Example #7
Source File: TypeParameter.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 6 votes vote down vote up
public void traverse(ASTVisitor visitor, BlockScope scope) {
	if (visitor.visit(this, scope)) {
		if (this.annotations != null) {
			int annotationsLength = this.annotations.length;
			for (int i = 0; i < annotationsLength; i++)
				this.annotations[i].traverse(visitor, scope);
		}
		if (this.type != null) {
			this.type.traverse(visitor, scope);
		}
		if (this.bounds != null) {
			int boundsLength = this.bounds.length;
			for (int i = 0; i < boundsLength; i++) {
				this.bounds[i].traverse(visitor, scope);
			}
		}
	}
	visitor.endVisit(this, scope);
}
 
Example #8
Source File: ArrayQualifiedTypeReference.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 6 votes vote down vote up
public void traverse(ASTVisitor visitor, ClassScope scope) {
	if (visitor.visit(this, scope)) {
		if (this.annotations != null) {
			int annotationsLevels = this.annotations.length;
			for (int i = 0; i < annotationsLevels; i++) {
				int annotationsLength = this.annotations[i] == null ? 0 : this.annotations[i].length;
				for (int j = 0; j < annotationsLength; j++)
					this.annotations[i][j].traverse(visitor, scope);
			}
		}
		if (this.annotationsOnDimensions != null) {
			for (int i = 0, max = this.annotationsOnDimensions.length; i < max; i++) {
				Annotation[] annotations2 = this.annotationsOnDimensions[i];
				for (int j = 0, max2 = annotations2 == null ? 0 : annotations2.length; j < max2; j++) {
					Annotation annotation = annotations2[j];
					annotation.traverse(visitor, scope);
				}
			}
		}
	}
	visitor.endVisit(this, scope);
}
 
Example #9
Source File: AnnotationMethodDeclaration.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 6 votes vote down vote up
public void traverse(
	ASTVisitor visitor,
	ClassScope classScope) {

	if (visitor.visit(this, classScope)) {
		if (this.annotations != null) {
			int annotationsLength = this.annotations.length;
			for (int i = 0; i < annotationsLength; i++)
				this.annotations[i].traverse(visitor, this.scope);
		}
		if (this.returnType != null) {
			this.returnType.traverse(visitor, this.scope);
		}
		if (this.defaultValue != null) {
			this.defaultValue.traverse(visitor, this.scope);
		}
	}
	visitor.endVisit(this, classScope);
}
 
Example #10
Source File: FieldDeclaration.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 6 votes vote down vote up
public void traverse(ASTVisitor visitor, MethodScope scope) {
	if (visitor.visit(this, scope)) {
		if (this.javadoc != null) {
			this.javadoc.traverse(visitor, scope);
		}
		if (this.annotations != null) {
			int annotationsLength = this.annotations.length;
			for (int i = 0; i < annotationsLength; i++)
				this.annotations[i].traverse(visitor, scope);
		}
		if (this.type != null) {
			this.type.traverse(visitor, scope);
		}
		if (this.initialization != null)
			this.initialization.traverse(visitor, scope);
	}
	visitor.endVisit(this, scope);
}
 
Example #11
Source File: SingleTypeReference.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
public void traverse(ASTVisitor visitor, ClassScope scope) {
	if (visitor.visit(this, scope)) {
		if (this.annotations != null) {
			Annotation [] typeAnnotations = this.annotations[0];
			for (int i = 0, length = typeAnnotations == null ? 0 : typeAnnotations.length; i < length; i++)
				typeAnnotations[i].traverse(visitor, scope);
		}
	}
	visitor.endVisit(this, scope);
}
 
Example #12
Source File: MethodDeclaration.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
public void traverse(
	ASTVisitor visitor,
	ClassScope classScope) {

	if (visitor.visit(this, classScope)) {
		if (this.javadoc != null) {
			this.javadoc.traverse(visitor, this.scope);
		}
		if (this.annotations != null) {
			int annotationsLength = this.annotations.length;
			for (int i = 0; i < annotationsLength; i++)
				this.annotations[i].traverse(visitor, this.scope);
		}
		if (this.typeParameters != null) {
			int typeParametersLength = this.typeParameters.length;
			for (int i = 0; i < typeParametersLength; i++) {
				this.typeParameters[i].traverse(visitor, this.scope);
			}
		}
		if (this.returnType != null)
			this.returnType.traverse(visitor, this.scope);
		if (this.arguments != null) {
			int argumentLength = this.arguments.length;
			for (int i = 0; i < argumentLength; i++)
				this.arguments[i].traverse(visitor, this.scope);
		}
		if (this.thrownExceptions != null) {
			int thrownExceptionsLength = this.thrownExceptions.length;
			for (int i = 0; i < thrownExceptionsLength; i++)
				this.thrownExceptions[i].traverse(visitor, this.scope);
		}
		if (this.statements != null) {
			int statementsLength = this.statements.length;
			for (int i = 0; i < statementsLength; i++)
				this.statements[i].traverse(visitor, this.scope);
		}
	}
	visitor.endVisit(this, classScope);
}
 
Example #13
Source File: QualifiedTypeReference.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
public void traverse(ASTVisitor visitor, ClassScope scope) {
	if (visitor.visit(this, scope)) {
		if (this.annotations != null) {
			int annotationsLevels = this.annotations.length;
			for (int i = 0; i < annotationsLevels; i++) {
				int annotationsLength = this.annotations[i] == null ? 0 : this.annotations[i].length;
				for (int j = 0; j < annotationsLength; j++)
					this.annotations[i][j].traverse(visitor, scope);
			}
		}
	}
	visitor.endVisit(this, scope);
}
 
Example #14
Source File: QualifiedTypeReference.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
public void traverse(ASTVisitor visitor, BlockScope scope) {
	if (visitor.visit(this, scope)) {
		if (this.annotations != null) {
			int annotationsLevels = this.annotations.length;
			for (int i = 0; i < annotationsLevels; i++) {
				int annotationsLength = this.annotations[i] == null ? 0 : this.annotations[i].length;
				for (int j = 0; j < annotationsLength; j++)
					this.annotations[i][j].traverse(visitor, scope);
			}
		}
	}
	visitor.endVisit(this, scope);
}
 
Example #15
Source File: SingleMemberAnnotation.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
public void traverse(ASTVisitor visitor, ClassScope scope) {
	if (visitor.visit(this, scope)) {
		if (this.type != null) {
			this.type.traverse(visitor, scope);
		}
		if (this.memberValue != null) {
			this.memberValue.traverse(visitor, scope);
		}
	}
	visitor.endVisit(this, scope);
}
 
Example #16
Source File: UnionTypeReference.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
public void traverse(ASTVisitor visitor, ClassScope scope) {
	if (visitor.visit(this, scope)) {
		int length = this.typeReferences == null ? 0 : this.typeReferences.length;
		for (int i = 0; i < length; i++) {
			this.typeReferences[i].traverse(visitor, scope);
		}
	}
	visitor.endVisit(this, scope);
}
 
Example #17
Source File: QualifiedSuperReference.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
public void traverse(
		ASTVisitor visitor,
		ClassScope blockScope) {

	if (visitor.visit(this, blockScope)) {
		this.qualification.traverse(visitor, blockScope);
	}
	visitor.endVisit(this, blockScope);
}
 
Example #18
Source File: Javadoc.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
public void traverse(ASTVisitor visitor, ClassScope scope) {
	if (visitor.visit(this, scope)) {
		if (this.paramReferences != null) {
			for (int i = 0, length = this.paramReferences.length; i < length; i++) {
				this.paramReferences[i].traverse(visitor, scope);
			}
		}
		if (this.paramTypeParameters != null) {
			for (int i = 0, length = this.paramTypeParameters.length; i < length; i++) {
				this.paramTypeParameters[i].traverse(visitor, scope);
			}
		}
		if (this.returnStatement != null) {
			this.returnStatement.traverse(visitor, scope);
		}
		if (this.exceptionReferences != null) {
			for (int i = 0, length = this.exceptionReferences.length; i < length; i++) {
				this.exceptionReferences[i].traverse(visitor, scope);
			}
		}
		if (this.seeReferences != null) {
			for (int i = 0, length = this.seeReferences.length; i < length; i++) {
				this.seeReferences[i].traverse(visitor, scope);
			}
		}
	}
	visitor.endVisit(this, scope);
}
 
Example #19
Source File: EqualExpression.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
public void traverse(ASTVisitor visitor, BlockScope scope) {
	if (visitor.visit(this, scope)) {
		this.left.traverse(visitor, scope);
		this.right.traverse(visitor, scope);
	}
	visitor.endVisit(this, scope);
}
 
Example #20
Source File: AssertStatement.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
public void traverse(ASTVisitor visitor, BlockScope scope) {
	if (visitor.visit(this, scope)) {
		this.assertExpression.traverse(visitor, scope);
		if (this.exceptionArgument != null) {
			this.exceptionArgument.traverse(visitor, scope);
		}
	}
	visitor.endVisit(this, scope);
}
 
Example #21
Source File: UnaryExpression.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
public void traverse(
   		ASTVisitor visitor,
   		BlockScope blockScope) {

	if (visitor.visit(this, blockScope)) {
		this.expression.traverse(visitor, blockScope);
	}
	visitor.endVisit(this, blockScope);
}
 
Example #22
Source File: LocalDeclaration.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
public void traverse(ASTVisitor visitor, BlockScope scope) {

		if (visitor.visit(this, scope)) {
			if (this.annotations != null) {
				int annotationsLength = this.annotations.length;
				for (int i = 0; i < annotationsLength; i++)
					this.annotations[i].traverse(visitor, scope);
			}
			this.type.traverse(visitor, scope);
			if (this.initialization != null)
				this.initialization.traverse(visitor, scope);
		}
		visitor.endVisit(this, scope);
	}
 
Example #23
Source File: JavadocFieldReference.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
public void traverse(ASTVisitor visitor, ClassScope scope) {

		if (visitor.visit(this, scope)) {
			if (this.receiver != null) {
				this.receiver.traverse(visitor, scope);
			}
		}
		visitor.endVisit(this, scope);
	}
 
Example #24
Source File: CombinedBinaryExpression.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
public void traverse(ASTVisitor visitor, BlockScope scope) {
	if (this.referencesTable == null) {
		super.traverse(visitor, scope);
	} else {
		if (visitor.visit(this, scope)) {
			int restart;
			for (restart = this.arity - 1;
					restart >= 0;
					restart--) {
				if (!visitor.visit(
						this.referencesTable[restart], scope)) {
					visitor.endVisit(
						this.referencesTable[restart], scope);
					break;
				}
			}
			restart++;
			// restart now points to the deepest BE for which
			// visit returned true, if any
			if (restart == 0) {
				this.referencesTable[0].left.traverse(visitor, scope);
			}
			for (int i = restart, end = this.arity;
						i < end; i++) {
				this.referencesTable[i].right.traverse(visitor, scope);
				visitor.endVisit(this.referencesTable[i], scope);
			}
			this.right.traverse(visitor, scope);
		}
		visitor.endVisit(this, scope);
	}
}
 
Example #25
Source File: CastExpression.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
public void traverse(ASTVisitor visitor, BlockScope blockScope) {
	if (visitor.visit(this, blockScope)) {
		this.type.traverse(visitor, blockScope);
		this.expression.traverse(visitor, blockScope);
	}
	visitor.endVisit(this, blockScope);
}
 
Example #26
Source File: ForeachStatement.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
public void traverse(
	ASTVisitor visitor,
	BlockScope blockScope) {

	if (visitor.visit(this, blockScope)) {
		this.elementVariable.traverse(visitor, this.scope);
		if (this.collection != null) {
			this.collection.traverse(visitor, this.scope);
		}
		if (this.action != null) {
			this.action.traverse(visitor, this.scope);
		}
	}
	visitor.endVisit(this, blockScope);
}
 
Example #27
Source File: SynchronizedStatement.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
public void traverse(ASTVisitor visitor, BlockScope blockScope) {
	if (visitor.visit(this, blockScope)) {
		this.expression.traverse(visitor, this.scope);
		this.block.traverse(visitor, this.scope);
	}
	visitor.endVisit(this, blockScope);
}
 
Example #28
Source File: NormalAnnotation.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
public void traverse(ASTVisitor visitor, ClassScope scope) {
	if (visitor.visit(this, scope)) {
		if (this.type != null) {
			this.type.traverse(visitor, scope);
		}
		if (this.memberValuePairs != null) {
			int memberValuePairsLength = this.memberValuePairs.length;
			for (int i = 0; i < memberValuePairsLength; i++)
				this.memberValuePairs[i].traverse(visitor, scope);
		}
	}
	visitor.endVisit(this, scope);
}
 
Example #29
Source File: SwitchStatement.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
public void traverse(
		ASTVisitor visitor,
		BlockScope blockScope) {

	if (visitor.visit(this, blockScope)) {
		this.expression.traverse(visitor, blockScope);
		if (this.statements != null) {
			int statementsLength = this.statements.length;
			for (int i = 0; i < statementsLength; i++)
				this.statements[i].traverse(visitor, this.scope);
		}
	}
	visitor.endVisit(this, blockScope);
}
 
Example #30
Source File: MarkerAnnotation.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
public void traverse(ASTVisitor visitor, BlockScope scope) {
	if (visitor.visit(this, scope)) {
		if (this.type != null) {
			this.type.traverse(visitor, scope);
		}
	}
	visitor.endVisit(this, scope);
}