Java Code Examples for org.eclipse.jdt.internal.compiler.ASTVisitor#visit()

The following examples show how to use org.eclipse.jdt.internal.compiler.ASTVisitor#visit() . 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: 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 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: QualifiedAllocationExpression.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.enclosingInstance != null)
			this.enclosingInstance.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.type != null) // case of enum constant
			this.type.traverse(visitor, scope);
		if (this.arguments != null) {
			int argumentsLength = this.arguments.length;
			for (int i = 0; i < argumentsLength; i++)
				this.arguments[i].traverse(visitor, scope);
		}
		if (this.anonymousType != null)
			this.anonymousType.traverse(visitor, scope);
	}
	visitor.endVisit(this, scope);
}
 
Example 4
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, 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);
			}
		}
		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 5
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, 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 6
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 7
Source File: Argument.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 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);
		}
		visitor.endVisit(this, scope);
	}
 
Example 8
Source File: MemberValuePair.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.value != null) {
			this.value.traverse(visitor, scope);
		}
	}
	visitor.endVisit(this, scope);
}
 
Example 9
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 10
Source File: ParameterizedQualifiedTypeReference.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);
			}
		}
		Annotation [][] annotationsOnDimensions = getAnnotationsOnDimensions(true);
		if (annotationsOnDimensions != null) {
			for (int i = 0, max = annotationsOnDimensions.length; i < max; i++) {
				Annotation[] annotations2 = annotationsOnDimensions[i];
				for (int j = 0, max2 = annotations2 == null ? 0 : annotations2.length; j < max2; j++) {
					Annotation annotation = annotations2[j];
					annotation.traverse(visitor, scope);
				}
			}
		}
		for (int i = 0, max = this.typeArguments.length; i < max; i++) {
			if (this.typeArguments[i] != null) {
				for (int j = 0, max2 = this.typeArguments[i].length; j < max2; j++) {
					this.typeArguments[i][j].traverse(visitor, scope);
				}
			}
		}
	}
	visitor.endVisit(this, scope);
}
 
Example 11
Source File: JavadocMessageSend.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);
		}
		if (this.arguments != null) {
			int argumentsLength = this.arguments.length;
			for (int i = 0; i < argumentsLength; i++)
				this.arguments[i].traverse(visitor, scope);
		}
	}
	visitor.endVisit(this, scope);
}
 
Example 12
Source File: ArrayReference.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.receiver.traverse(visitor, scope);
		this.position.traverse(visitor, scope);
	}
	visitor.endVisit(this, scope);
}
 
Example 13
Source File: JavadocArraySingleTypeReference.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 4 votes vote down vote up
public void traverse(ASTVisitor visitor, ClassScope scope) {
	visitor.visit(this, scope);
	visitor.endVisit(this, scope);
}
 
Example 14
Source File: DoubleLiteral.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 4 votes vote down vote up
public void traverse(ASTVisitor visitor, BlockScope scope) {
	visitor.visit(this, scope);
	visitor.endVisit(this, scope);
}
 
Example 15
Source File: ThrowStatement.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 4 votes vote down vote up
public void traverse(ASTVisitor visitor, BlockScope blockScope) {
	if (visitor.visit(this, blockScope))
		this.exception.traverse(visitor, blockScope);
	visitor.endVisit(this, blockScope);
}
 
Example 16
Source File: JavadocQualifiedTypeReference.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 4 votes vote down vote up
public void traverse(ASTVisitor visitor, ClassScope scope) {
	visitor.visit(this, scope);
	visitor.endVisit(this, scope);
}
 
Example 17
Source File: IntLiteral.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 4 votes vote down vote up
public void traverse(ASTVisitor visitor, BlockScope scope) {
	visitor.visit(this, scope);
	visitor.endVisit(this, scope);
}
 
Example 18
Source File: JavadocImplicitTypeReference.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 4 votes vote down vote up
public void traverse(ASTVisitor visitor, BlockScope scope) {
	visitor.visit(this, scope);
	visitor.endVisit(this, scope);
}
 
Example 19
Source File: JavadocSingleTypeReference.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 4 votes vote down vote up
public void traverse(ASTVisitor visitor, ClassScope scope) {
	visitor.visit(this, scope);
	visitor.endVisit(this, scope);
}
 
Example 20
Source File: JavadocReturnStatement.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 4 votes vote down vote up
public void traverse(ASTVisitor visitor, ClassScope scope) {
	visitor.visit(this, scope);
	visitor.endVisit(this, scope);
}