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

The following examples show how to use org.eclipse.jdt.internal.compiler.ASTVisitor#endVisit() . 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: TypeParameter.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 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 2
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 3
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 4
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 5
Source File: Block.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)) {
		if (this.statements != null) {
			for (int i = 0, length = this.statements.length; i < length; i++)
				this.statements[i].traverse(visitor, this.scope);
		}
	}
	visitor.endVisit(this, blockScope);
}
 
Example 6
Source File: QualifiedThisReference.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 7
Source File: ArrayInitializer.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.expressions != null) {
				int expressionsLength = this.expressions.length;
				for (int i = 0; i < expressionsLength; i++)
					this.expressions[i].traverse(visitor, scope);
			}
		}
		visitor.endVisit(this, scope);
	}
 
Example 8
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 9
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, 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);
		}
	}
	visitor.endVisit(this, scope);
}
 
Example 10
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, ClassScope scope) {
	if (visitor.visit(this, scope)) {
		if (this.value != null) {
			this.value.traverse(visitor, scope);
		}
	}
	visitor.endVisit(this, scope);
}
 
Example 11
Source File: Wildcard.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) {
			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.bound != null) {
			this.bound.traverse(visitor, scope);
		}
	}
	visitor.endVisit(this, scope);
}
 
Example 12
Source File: LocalDeclaration.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
private void traverseWithoutInitializer(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);
	}
	visitor.endVisit(this, scope);
}
 
Example 13
Source File: JavadocArgumentExpression.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)) {
		if (this.argument != null) {
			this.argument.traverse(visitor, blockScope);
		}
	}
	visitor.endVisit(this, blockScope);
}
 
Example 14
Source File: IntersectionCastTypeReference.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)) {
		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 15
Source File: Clinit.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) {

	visitor.visit(this, classScope);
	visitor.endVisit(this, classScope);
}
 
Example 16
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 17
Source File: EmptyStatement.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: CompilationUnitDeclaration.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 4 votes vote down vote up
public void traverse(ASTVisitor visitor, CompilationUnitScope unitScope, boolean skipOnError) {
	if (skipOnError && this.ignoreFurtherInvestigation)
		return;
	try {
		if (visitor.visit(this, this.scope)) {
			if (this.types != null && isPackageInfo()) {
	            // resolve synthetic type declaration
				final TypeDeclaration syntheticTypeDeclaration = this.types[0];
				// resolve javadoc package if any
				final MethodScope methodScope = syntheticTypeDeclaration.staticInitializerScope;
				// Don't traverse in null scope and invite trouble a la bug 252555.
				if (this.javadoc != null && methodScope != null) {
					this.javadoc.traverse(visitor, methodScope);
				}
				// Don't traverse in null scope and invite trouble a la bug 252555.
				if (this.currentPackage != null && methodScope != null) {
					final Annotation[] annotations = this.currentPackage.annotations;
					if (annotations != null) {
						int annotationsLength = annotations.length;
						for (int i = 0; i < annotationsLength; i++) {
							annotations[i].traverse(visitor, methodScope);
						}
					}
				}
			}
			if (this.currentPackage != null) {
				this.currentPackage.traverse(visitor, this.scope);
			}
			if (this.imports != null) {
				int importLength = this.imports.length;
				for (int i = 0; i < importLength; i++) {
					this.imports[i].traverse(visitor, this.scope);
				}
			}
			if (this.types != null) {
				int typesLength = this.types.length;
				for (int i = 0; i < typesLength; i++) {
					this.types[i].traverse(visitor, this.scope);
				}
			}
		}
		visitor.endVisit(this, this.scope);
	} catch (AbortCompilationUnit e) {
		// ignore
	}
}
 
Example 19
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);
}
 
Example 20
Source File: LongLiteral.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);
}