X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=src%2Forg%2Feclipse%2Fjdt%2Finternal%2Fcompiler%2Fparser%2FRecoveredImport.java;fp=src%2Forg%2Feclipse%2Fjdt%2Finternal%2Fcompiler%2Fparser%2FRecoveredImport.java;h=a86c81a7f9e4e5a0348f85ab9edef249b63e53cc;hb=040fa5af2cd00017cf3575950cdaade34a6d7f6c;hp=0000000000000000000000000000000000000000;hpb=a580fb8376d315d05e4d6bfdff9ff1101a151cd6;p=org.ibex.tool.git diff --git a/src/org/eclipse/jdt/internal/compiler/parser/RecoveredImport.java b/src/org/eclipse/jdt/internal/compiler/parser/RecoveredImport.java new file mode 100644 index 0000000..a86c81a --- /dev/null +++ b/src/org/eclipse/jdt/internal/compiler/parser/RecoveredImport.java @@ -0,0 +1,57 @@ +/******************************************************************************* + * Copyright (c) 2000, 2004 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.parser; + +/** + * Internal import structure for parsing recovery + */ +import org.eclipse.jdt.internal.compiler.ast.ASTNode; +import org.eclipse.jdt.internal.compiler.ast.ImportReference; + +public class RecoveredImport extends RecoveredElement { + + public ImportReference importReference; +public RecoveredImport(ImportReference importReference, RecoveredElement parent, int bracketBalance){ + super(parent, bracketBalance); + this.importReference = importReference; +} +/* + * Answer the associated parsed structure + */ +public ASTNode parseTree(){ + return importReference; +} +/* + * Answer the very source end of the corresponding parse node + */ +public int sourceEnd(){ + return this.importReference.declarationSourceEnd; +} +public String toString(int tab) { + return tabString(tab) + "Recovered import: " + importReference.toString(); //$NON-NLS-1$ +} +public ImportReference updatedImportReference(){ + + return importReference; +} +public void updateParseTree(){ + this.updatedImportReference(); +} +/* + * Update the declarationSourceEnd of the corresponding parse node + */ +public void updateSourceEndIfNecessary(int bodyStart, int bodyEnd){ + if (this.importReference.declarationSourceEnd == 0) { + this.importReference.declarationSourceEnd = bodyEnd; + this.importReference.declarationEnd = bodyEnd; + } +} +}