mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Final removal of the pdom plugin, the PDOMCorePlugin class. Moved everything over to CCorePlugin.
This commit is contained in:
parent
6db76f9002
commit
fe67ae0785
13 changed files with 91 additions and 94 deletions
|
@ -5,17 +5,17 @@ import java.io.IOException;
|
||||||
|
|
||||||
import junit.framework.TestCase;
|
import junit.framework.TestCase;
|
||||||
|
|
||||||
|
import org.eclipse.cdt.core.testplugin.CTestPlugin;
|
||||||
import org.eclipse.cdt.internal.core.pdom.db.BTree;
|
import org.eclipse.cdt.internal.core.pdom.db.BTree;
|
||||||
import org.eclipse.cdt.internal.core.pdom.db.Database;
|
import org.eclipse.cdt.internal.core.pdom.db.Database;
|
||||||
import org.eclipse.cdt.internal.core.pdom.db.StringComparator;
|
import org.eclipse.cdt.internal.core.pdom.db.StringComparator;
|
||||||
import org.eclipse.cdt.internal.core.pdom.db.StringVisitor;
|
import org.eclipse.cdt.internal.core.pdom.db.StringVisitor;
|
||||||
import org.eclipse.cdt.pdom.core.PDOMCorePlugin;
|
|
||||||
import org.eclipse.core.runtime.IPath;
|
import org.eclipse.core.runtime.IPath;
|
||||||
|
|
||||||
public class DBTest extends TestCase {
|
public class DBTest extends TestCase {
|
||||||
|
|
||||||
protected IPath getTestDir() {
|
protected IPath getTestDir() {
|
||||||
IPath path = PDOMCorePlugin.getDefault().getStateLocation().append("tests/");
|
IPath path = CTestPlugin.getDefault().getStateLocation().append("tests/");
|
||||||
File file = path.toFile();
|
File file = path.toFile();
|
||||||
if (!file.exists())
|
if (!file.exists())
|
||||||
file.mkdir();
|
file.mkdir();
|
||||||
|
|
|
@ -3,8 +3,7 @@ Bundle-ManifestVersion: 2
|
||||||
Bundle-Name: %pluginName
|
Bundle-Name: %pluginName
|
||||||
Bundle-SymbolicName: org.eclipse.cdt.core; singleton:=true
|
Bundle-SymbolicName: org.eclipse.cdt.core; singleton:=true
|
||||||
Bundle-Version: 3.1.0
|
Bundle-Version: 3.1.0
|
||||||
Bundle-ClassPath: cdtcore.jar,
|
Bundle-ClassPath: cdtcore.jar
|
||||||
cdtparser.jar
|
|
||||||
Bundle-Activator: org.eclipse.cdt.core.CCorePlugin
|
Bundle-Activator: org.eclipse.cdt.core.CCorePlugin
|
||||||
Bundle-Vendor: %providerName
|
Bundle-Vendor: %providerName
|
||||||
Bundle-Localization: plugin
|
Bundle-Localization: plugin
|
||||||
|
@ -56,7 +55,7 @@ Export-Package: .,
|
||||||
org.eclipse.cdt.internal.core.parser.token,
|
org.eclipse.cdt.internal.core.parser.token,
|
||||||
org.eclipse.cdt.internal.core.parser.util,
|
org.eclipse.cdt.internal.core.parser.util,
|
||||||
org.eclipse.cdt.internal.core.pdom,
|
org.eclipse.cdt.internal.core.pdom,
|
||||||
org.eclipse.cdt.internal.core.pdom.db;x-friends:="org.eclipse.cdt.pdom.ui",
|
org.eclipse.cdt.internal.core.pdom.db,
|
||||||
org.eclipse.cdt.internal.core.search,
|
org.eclipse.cdt.internal.core.search,
|
||||||
org.eclipse.cdt.internal.core.search.indexing,
|
org.eclipse.cdt.internal.core.search.indexing,
|
||||||
org.eclipse.cdt.internal.core.search.matching,
|
org.eclipse.cdt.internal.core.search.matching,
|
||||||
|
@ -66,7 +65,6 @@ Export-Package: .,
|
||||||
org.eclipse.cdt.internal.errorparsers,
|
org.eclipse.cdt.internal.errorparsers,
|
||||||
org.eclipse.cdt.internal.formatter,
|
org.eclipse.cdt.internal.formatter,
|
||||||
org.eclipse.cdt.internal.pdom.dom,
|
org.eclipse.cdt.internal.pdom.dom,
|
||||||
org.eclipse.cdt.pdom.core,
|
|
||||||
org.eclipse.cdt.utils,
|
org.eclipse.cdt.utils,
|
||||||
org.eclipse.cdt.utils.coff,
|
org.eclipse.cdt.utils.coff,
|
||||||
org.eclipse.cdt.utils.coff.parser,
|
org.eclipse.cdt.utils.coff.parser,
|
||||||
|
|
|
@ -13,8 +13,10 @@ package org.eclipse.cdt.core.dom;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.dom.ast.ASTCompletionNode;
|
import org.eclipse.cdt.core.dom.ast.ASTCompletionNode;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit;
|
import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit;
|
||||||
|
import org.eclipse.cdt.core.dom.ast.IBinding;
|
||||||
import org.eclipse.cdt.core.model.ITranslationUnit;
|
import org.eclipse.cdt.core.model.ITranslationUnit;
|
||||||
import org.eclipse.cdt.core.model.IWorkingCopy;
|
import org.eclipse.cdt.core.model.IWorkingCopy;
|
||||||
|
import org.eclipse.cdt.internal.pdom.dom.PDOMBinding;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Doug Schaefer
|
* @author Doug Schaefer
|
||||||
|
@ -43,8 +45,40 @@ public interface ILanguage {
|
||||||
*/
|
*/
|
||||||
public static final int AST_SKIP_INDEXED_HEADERS = 4;
|
public static final int AST_SKIP_INDEXED_HEADERS = 4;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create the AST for the given translation unit with the given style.
|
||||||
|
*
|
||||||
|
* @param file
|
||||||
|
* @param style
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
public IASTTranslationUnit getTranslationUnit(ITranslationUnit file, int style);
|
public IASTTranslationUnit getTranslationUnit(ITranslationUnit file, int style);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return the AST Completion Node for the given working copy at the given
|
||||||
|
* offset.
|
||||||
|
*
|
||||||
|
* @param workingCopy
|
||||||
|
* @param offset
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
public ASTCompletionNode getCompletionNode(IWorkingCopy workingCopy, int offset);
|
public ASTCompletionNode getCompletionNode(IWorkingCopy workingCopy, int offset);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return the PDOM Binding for the given AST binding.
|
||||||
|
*
|
||||||
|
* @param binding
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public PDOMBinding getPDOMBinding(IBinding binding);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return a new PDOM Binding that has the given language specific type.
|
||||||
|
* The type id is extracted from the PDOM Database.
|
||||||
|
*
|
||||||
|
* @param bindingType
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public PDOMBinding createPDOMBinding(int bindingType);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,6 +17,7 @@ import org.eclipse.cdt.core.dom.ILanguage;
|
||||||
import org.eclipse.cdt.core.dom.PDOM;
|
import org.eclipse.cdt.core.dom.PDOM;
|
||||||
import org.eclipse.cdt.core.dom.ast.ASTCompletionNode;
|
import org.eclipse.cdt.core.dom.ast.ASTCompletionNode;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit;
|
import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit;
|
||||||
|
import org.eclipse.cdt.core.dom.ast.IBinding;
|
||||||
import org.eclipse.cdt.core.model.ITranslationUnit;
|
import org.eclipse.cdt.core.model.ITranslationUnit;
|
||||||
import org.eclipse.cdt.core.model.IWorkingCopy;
|
import org.eclipse.cdt.core.model.IWorkingCopy;
|
||||||
import org.eclipse.cdt.core.parser.CodeReader;
|
import org.eclipse.cdt.core.parser.CodeReader;
|
||||||
|
@ -35,6 +36,7 @@ import org.eclipse.cdt.internal.core.dom.parser.c.GNUCSourceParser;
|
||||||
import org.eclipse.cdt.internal.core.parser.scanner2.DOMScanner;
|
import org.eclipse.cdt.internal.core.parser.scanner2.DOMScanner;
|
||||||
import org.eclipse.cdt.internal.core.parser.scanner2.GCCScannerExtensionConfiguration;
|
import org.eclipse.cdt.internal.core.parser.scanner2.GCCScannerExtensionConfiguration;
|
||||||
import org.eclipse.cdt.internal.core.parser.scanner2.IScannerExtensionConfiguration;
|
import org.eclipse.cdt.internal.core.parser.scanner2.IScannerExtensionConfiguration;
|
||||||
|
import org.eclipse.cdt.internal.pdom.dom.PDOMBinding;
|
||||||
import org.eclipse.core.resources.IFile;
|
import org.eclipse.core.resources.IFile;
|
||||||
import org.eclipse.core.resources.IProject;
|
import org.eclipse.core.resources.IProject;
|
||||||
|
|
||||||
|
@ -87,4 +89,15 @@ public class GCCLanguage implements ILanguage {
|
||||||
public ASTCompletionNode getCompletionNode(IWorkingCopy workingCopy, int offset) {
|
public ASTCompletionNode getCompletionNode(IWorkingCopy workingCopy, int offset) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public PDOMBinding getPDOMBinding(IBinding binding) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public PDOMBinding createPDOMBinding(int bindingType) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,6 +16,7 @@ import org.eclipse.cdt.core.dom.ICodeReaderFactory;
|
||||||
import org.eclipse.cdt.core.dom.ILanguage;
|
import org.eclipse.cdt.core.dom.ILanguage;
|
||||||
import org.eclipse.cdt.core.dom.ast.ASTCompletionNode;
|
import org.eclipse.cdt.core.dom.ast.ASTCompletionNode;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit;
|
import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit;
|
||||||
|
import org.eclipse.cdt.core.dom.ast.IBinding;
|
||||||
import org.eclipse.cdt.core.model.ITranslationUnit;
|
import org.eclipse.cdt.core.model.ITranslationUnit;
|
||||||
import org.eclipse.cdt.core.model.IWorkingCopy;
|
import org.eclipse.cdt.core.model.IWorkingCopy;
|
||||||
import org.eclipse.cdt.core.parser.CodeReader;
|
import org.eclipse.cdt.core.parser.CodeReader;
|
||||||
|
@ -34,6 +35,7 @@ import org.eclipse.cdt.internal.core.dom.parser.cpp.GPPParserExtensionConfigurat
|
||||||
import org.eclipse.cdt.internal.core.parser.scanner2.DOMScanner;
|
import org.eclipse.cdt.internal.core.parser.scanner2.DOMScanner;
|
||||||
import org.eclipse.cdt.internal.core.parser.scanner2.GPPScannerExtensionConfiguration;
|
import org.eclipse.cdt.internal.core.parser.scanner2.GPPScannerExtensionConfiguration;
|
||||||
import org.eclipse.cdt.internal.core.parser.scanner2.IScannerExtensionConfiguration;
|
import org.eclipse.cdt.internal.core.parser.scanner2.IScannerExtensionConfiguration;
|
||||||
|
import org.eclipse.cdt.internal.pdom.dom.PDOMBinding;
|
||||||
import org.eclipse.core.resources.IFile;
|
import org.eclipse.core.resources.IFile;
|
||||||
import org.eclipse.core.resources.IProject;
|
import org.eclipse.core.resources.IProject;
|
||||||
|
|
||||||
|
@ -86,4 +88,14 @@ public class GPPLanguage implements ILanguage {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public PDOMBinding getPDOMBinding(IBinding binding) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public PDOMBinding createPDOMBinding(int bindingType) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,6 +15,7 @@ import java.io.IOException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.eclipse.cdt.core.CCorePlugin;
|
||||||
import org.eclipse.cdt.core.dom.ICodeReaderFactory;
|
import org.eclipse.cdt.core.dom.ICodeReaderFactory;
|
||||||
import org.eclipse.cdt.core.model.ITranslationUnit;
|
import org.eclipse.cdt.core.model.ITranslationUnit;
|
||||||
import org.eclipse.cdt.core.model.IWorkingCopy;
|
import org.eclipse.cdt.core.model.IWorkingCopy;
|
||||||
|
@ -22,7 +23,6 @@ import org.eclipse.cdt.core.parser.CodeReader;
|
||||||
import org.eclipse.cdt.core.parser.ICodeReaderCache;
|
import org.eclipse.cdt.core.parser.ICodeReaderCache;
|
||||||
import org.eclipse.cdt.core.parser.ParserUtil;
|
import org.eclipse.cdt.core.parser.ParserUtil;
|
||||||
import org.eclipse.cdt.internal.pdom.dom.PDOMFile;
|
import org.eclipse.cdt.internal.pdom.dom.PDOMFile;
|
||||||
import org.eclipse.cdt.pdom.core.PDOMCorePlugin;
|
|
||||||
import org.eclipse.core.runtime.CoreException;
|
import org.eclipse.core.runtime.CoreException;
|
||||||
import org.eclipse.core.runtime.IStatus;
|
import org.eclipse.core.runtime.IStatus;
|
||||||
import org.eclipse.core.runtime.Status;
|
import org.eclipse.core.runtime.Status;
|
||||||
|
@ -70,8 +70,8 @@ public class PDOMCodeReaderFactory implements ICodeReaderFactory {
|
||||||
if (PDOMFile.find(pdom, path) != null)
|
if (PDOMFile.find(pdom, path) != null)
|
||||||
return null;
|
return null;
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
PDOMCorePlugin.log(new CoreException(new Status(IStatus.ERROR,
|
CCorePlugin.log(new CoreException(new Status(IStatus.ERROR,
|
||||||
PDOMCorePlugin.ID, 0, "PDOM Exception", e)));
|
CCorePlugin.PLUGIN_ID, 0, "PDOM Exception", e)));
|
||||||
}
|
}
|
||||||
|
|
||||||
return ParserUtil.createReader(path, null);
|
return ParserUtil.createReader(path, null);
|
||||||
|
|
|
@ -13,6 +13,7 @@ package org.eclipse.cdt.internal.core.pdom;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
import org.eclipse.cdt.core.CCorePlugin;
|
||||||
import org.eclipse.cdt.core.dom.ICodeReaderFactory;
|
import org.eclipse.cdt.core.dom.ICodeReaderFactory;
|
||||||
import org.eclipse.cdt.core.dom.IPDOM;
|
import org.eclipse.cdt.core.dom.IPDOM;
|
||||||
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
||||||
|
@ -31,7 +32,6 @@ import org.eclipse.cdt.internal.core.pdom.db.BTree;
|
||||||
import org.eclipse.cdt.internal.core.pdom.db.Database;
|
import org.eclipse.cdt.internal.core.pdom.db.Database;
|
||||||
import org.eclipse.cdt.internal.pdom.dom.PDOMBinding;
|
import org.eclipse.cdt.internal.pdom.dom.PDOMBinding;
|
||||||
import org.eclipse.cdt.internal.pdom.dom.PDOMName;
|
import org.eclipse.cdt.internal.pdom.dom.PDOMName;
|
||||||
import org.eclipse.cdt.pdom.core.PDOMCorePlugin;
|
|
||||||
import org.eclipse.core.resources.IProject;
|
import org.eclipse.core.resources.IProject;
|
||||||
import org.eclipse.core.runtime.CoreException;
|
import org.eclipse.core.runtime.CoreException;
|
||||||
import org.eclipse.core.runtime.IPath;
|
import org.eclipse.core.runtime.IPath;
|
||||||
|
@ -62,7 +62,7 @@ public class PDOMDatabase implements IPDOM {
|
||||||
private BTree bindingIndex;
|
private BTree bindingIndex;
|
||||||
|
|
||||||
private static final QualifiedName dbNameProperty
|
private static final QualifiedName dbNameProperty
|
||||||
= new QualifiedName(PDOMCorePlugin.ID, "dbName"); //$NON-NLS-1$
|
= new QualifiedName(CCorePlugin.PLUGIN_ID, "dbName"); //$NON-NLS-1$
|
||||||
|
|
||||||
public PDOMDatabase(IProject project, PDOMManager manager) throws CoreException {
|
public PDOMDatabase(IProject project, PDOMManager manager) throws CoreException {
|
||||||
String dbName = project.getPersistentProperty(dbNameProperty);
|
String dbName = project.getPersistentProperty(dbNameProperty);
|
||||||
|
@ -72,13 +72,13 @@ public class PDOMDatabase implements IPDOM {
|
||||||
project.setPersistentProperty(dbNameProperty, dbName);
|
project.setPersistentProperty(dbNameProperty, dbName);
|
||||||
}
|
}
|
||||||
|
|
||||||
dbPath = PDOMCorePlugin.getDefault().getStateLocation().append(dbName);
|
dbPath = CCorePlugin.getDefault().getStateLocation().append(dbName);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
db = new Database(dbPath.toOSString(), VERSION);
|
db = new Database(dbPath.toOSString(), VERSION);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
throw new CoreException(new Status(IStatus.ERROR,
|
throw new CoreException(new Status(IStatus.ERROR,
|
||||||
PDOMCorePlugin.ID, 0, "Failed to create database", e));
|
CCorePlugin.PLUGIN_ID, 0, "Failed to create database", e));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -162,10 +162,9 @@ public class PDOMDatabase implements IPDOM {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (CoreException e) {
|
} catch (CoreException e) {
|
||||||
PDOMCorePlugin.log(e);
|
CCorePlugin.log(e);
|
||||||
} catch (DOMException e) {
|
} catch (DOMException e) {
|
||||||
PDOMCorePlugin.log(new CoreException(new Status(IStatus.ERROR,
|
CCorePlugin.log(e);
|
||||||
PDOMCorePlugin.ID, 0, "DOMException", e)));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -194,8 +193,7 @@ public class PDOMDatabase implements IPDOM {
|
||||||
return new IASTName[] { name };
|
return new IASTName[] { name };
|
||||||
}
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
PDOMCorePlugin.log(new CoreException(new Status(IStatus.ERROR,
|
CCorePlugin.log(e);
|
||||||
PDOMCorePlugin.ID, 0, "getDeclarations", e)));
|
|
||||||
}
|
}
|
||||||
return new IASTName[0];
|
return new IASTName[0];
|
||||||
}
|
}
|
||||||
|
@ -204,7 +202,7 @@ public class PDOMDatabase implements IPDOM {
|
||||||
try {
|
try {
|
||||||
return new PDOMBinding(this, name, null);
|
return new PDOMBinding(this, name, null);
|
||||||
} catch (CoreException e) {
|
} catch (CoreException e) {
|
||||||
PDOMCorePlugin.log(e);
|
CCorePlugin.log(e);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,11 +10,11 @@
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.internal.core.pdom;
|
package org.eclipse.cdt.internal.core.pdom;
|
||||||
|
|
||||||
|
import org.eclipse.cdt.core.CCorePlugin;
|
||||||
import org.eclipse.cdt.core.dom.IPDOM;
|
import org.eclipse.cdt.core.dom.IPDOM;
|
||||||
import org.eclipse.cdt.core.dom.IPDOMProvider;
|
import org.eclipse.cdt.core.dom.IPDOMProvider;
|
||||||
import org.eclipse.cdt.core.model.ElementChangedEvent;
|
import org.eclipse.cdt.core.model.ElementChangedEvent;
|
||||||
import org.eclipse.cdt.core.model.IElementChangedListener;
|
import org.eclipse.cdt.core.model.IElementChangedListener;
|
||||||
import org.eclipse.cdt.pdom.core.PDOMCorePlugin;
|
|
||||||
import org.eclipse.core.resources.IProject;
|
import org.eclipse.core.resources.IProject;
|
||||||
import org.eclipse.core.runtime.CoreException;
|
import org.eclipse.core.runtime.CoreException;
|
||||||
import org.eclipse.core.runtime.QualifiedName;
|
import org.eclipse.core.runtime.QualifiedName;
|
||||||
|
@ -34,7 +34,7 @@ public class PDOMManager implements IPDOMProvider, IElementChangedListener, IJob
|
||||||
private PDOMUpdator currJob;
|
private PDOMUpdator currJob;
|
||||||
|
|
||||||
private static final QualifiedName pdomProperty
|
private static final QualifiedName pdomProperty
|
||||||
= new QualifiedName(PDOMCorePlugin.ID, "pdom"); //$NON-NLS-1$
|
= new QualifiedName(CCorePlugin.PLUGIN_ID, "pdom"); //$NON-NLS-1$
|
||||||
|
|
||||||
public static PDOMManager getInstance() {
|
public static PDOMManager getInstance() {
|
||||||
if (instance == null)
|
if (instance == null)
|
||||||
|
@ -53,7 +53,7 @@ public class PDOMManager implements IPDOMProvider, IElementChangedListener, IJob
|
||||||
|
|
||||||
return pdom;
|
return pdom;
|
||||||
} catch (CoreException e) {
|
} catch (CoreException e) {
|
||||||
PDOMCorePlugin.log(e);
|
CCorePlugin.log(e);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,7 +24,6 @@ import org.eclipse.cdt.core.model.ICElement;
|
||||||
import org.eclipse.cdt.core.model.ICElementDelta;
|
import org.eclipse.cdt.core.model.ICElementDelta;
|
||||||
import org.eclipse.cdt.core.model.ICProject;
|
import org.eclipse.cdt.core.model.ICProject;
|
||||||
import org.eclipse.cdt.core.model.ITranslationUnit;
|
import org.eclipse.cdt.core.model.ITranslationUnit;
|
||||||
import org.eclipse.cdt.pdom.core.PDOMCorePlugin;
|
|
||||||
import org.eclipse.core.resources.IFile;
|
import org.eclipse.core.resources.IFile;
|
||||||
import org.eclipse.core.resources.IProject;
|
import org.eclipse.core.resources.IProject;
|
||||||
import org.eclipse.core.resources.IResource;
|
import org.eclipse.core.resources.IResource;
|
||||||
|
@ -183,7 +182,7 @@ public class PDOMUpdator extends Job {
|
||||||
}
|
}
|
||||||
}, 0);
|
}, 0);
|
||||||
} catch (CoreException e) {
|
} catch (CoreException e) {
|
||||||
PDOMCorePlugin.log(e);
|
CCorePlugin.log(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -12,6 +12,7 @@ package org.eclipse.cdt.internal.pdom.dom;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import org.eclipse.cdt.core.CCorePlugin;
|
||||||
import org.eclipse.cdt.core.dom.ast.DOMException;
|
import org.eclipse.cdt.core.dom.ast.DOMException;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTName;
|
import org.eclipse.cdt.core.dom.ast.IASTName;
|
||||||
import org.eclipse.cdt.core.dom.ast.IBinding;
|
import org.eclipse.cdt.core.dom.ast.IBinding;
|
||||||
|
@ -22,7 +23,6 @@ import org.eclipse.cdt.internal.core.pdom.db.BTree;
|
||||||
import org.eclipse.cdt.internal.core.pdom.db.Database;
|
import org.eclipse.cdt.internal.core.pdom.db.Database;
|
||||||
import org.eclipse.cdt.internal.core.pdom.db.IBTreeComparator;
|
import org.eclipse.cdt.internal.core.pdom.db.IBTreeComparator;
|
||||||
import org.eclipse.cdt.internal.core.pdom.db.IBTreeVisitor;
|
import org.eclipse.cdt.internal.core.pdom.db.IBTreeVisitor;
|
||||||
import org.eclipse.cdt.pdom.core.PDOMCorePlugin;
|
|
||||||
import org.eclipse.core.runtime.CoreException;
|
import org.eclipse.core.runtime.CoreException;
|
||||||
import org.eclipse.core.runtime.IStatus;
|
import org.eclipse.core.runtime.IStatus;
|
||||||
import org.eclipse.core.runtime.Status;
|
import org.eclipse.core.runtime.Status;
|
||||||
|
@ -123,7 +123,7 @@ public class PDOMBinding implements IBinding {
|
||||||
}
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
throw new CoreException(new Status(IStatus.ERROR,
|
throw new CoreException(new Status(IStatus.ERROR,
|
||||||
PDOMCorePlugin.ID, 0, "Failed to allocate binding", e));
|
CCorePlugin.PLUGIN_ID, 0, "Failed to allocate binding", e));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -156,8 +156,7 @@ public class PDOMBinding implements IBinding {
|
||||||
int stringRecord = db.getInt(record + STRING_REC_OFFSET);
|
int stringRecord = db.getInt(record + STRING_REC_OFFSET);
|
||||||
return db.getString(stringRecord);
|
return db.getString(stringRecord);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
PDOMCorePlugin.log(new CoreException(new Status(IStatus.ERROR,
|
CCorePlugin.log(e);
|
||||||
PDOMCorePlugin.ID, 0, "PDOMString", e)));
|
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -168,8 +167,7 @@ public class PDOMBinding implements IBinding {
|
||||||
int stringRecord = db.getInt(record + STRING_REC_OFFSET);
|
int stringRecord = db.getInt(record + STRING_REC_OFFSET);
|
||||||
return db.getChars(stringRecord);
|
return db.getChars(stringRecord);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
PDOMCorePlugin.log(new CoreException(new Status(IStatus.ERROR,
|
CCorePlugin.log(e);
|
||||||
PDOMCorePlugin.ID, 0, "PDOMString", e)));
|
|
||||||
return new char[0];
|
return new char[0];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,12 +12,12 @@ package org.eclipse.cdt.internal.pdom.dom;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import org.eclipse.cdt.core.CCorePlugin;
|
||||||
import org.eclipse.cdt.internal.core.pdom.PDOMDatabase;
|
import org.eclipse.cdt.internal.core.pdom.PDOMDatabase;
|
||||||
import org.eclipse.cdt.internal.core.pdom.db.BTree;
|
import org.eclipse.cdt.internal.core.pdom.db.BTree;
|
||||||
import org.eclipse.cdt.internal.core.pdom.db.Database;
|
import org.eclipse.cdt.internal.core.pdom.db.Database;
|
||||||
import org.eclipse.cdt.internal.core.pdom.db.StringComparator;
|
import org.eclipse.cdt.internal.core.pdom.db.StringComparator;
|
||||||
import org.eclipse.cdt.internal.core.pdom.db.StringVisitor;
|
import org.eclipse.cdt.internal.core.pdom.db.StringVisitor;
|
||||||
import org.eclipse.cdt.pdom.core.PDOMCorePlugin;
|
|
||||||
import org.eclipse.core.runtime.CoreException;
|
import org.eclipse.core.runtime.CoreException;
|
||||||
import org.eclipse.core.runtime.IStatus;
|
import org.eclipse.core.runtime.IStatus;
|
||||||
import org.eclipse.core.runtime.Status;
|
import org.eclipse.core.runtime.Status;
|
||||||
|
@ -116,7 +116,7 @@ public class PDOMFile {
|
||||||
pdom.getDB().free(record);
|
pdom.getDB().free(record);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
throw new CoreException(new Status(IStatus.ERROR,
|
throw new CoreException(new Status(IStatus.ERROR,
|
||||||
PDOMCorePlugin.ID, 0, "Failed to free string", e));
|
CCorePlugin.PLUGIN_ID, 0, "Failed to free string", e));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -12,6 +12,7 @@ package org.eclipse.cdt.internal.pdom.dom;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import org.eclipse.cdt.core.CCorePlugin;
|
||||||
import org.eclipse.cdt.core.dom.ast.ASTNodeProperty;
|
import org.eclipse.cdt.core.dom.ast.ASTNodeProperty;
|
||||||
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTFileLocation;
|
import org.eclipse.cdt.core.dom.ast.IASTFileLocation;
|
||||||
|
@ -23,7 +24,6 @@ import org.eclipse.cdt.core.dom.ast.IBinding;
|
||||||
import org.eclipse.cdt.core.dom.ast.IScope2;
|
import org.eclipse.cdt.core.dom.ast.IScope2;
|
||||||
import org.eclipse.cdt.internal.core.pdom.PDOMDatabase;
|
import org.eclipse.cdt.internal.core.pdom.PDOMDatabase;
|
||||||
import org.eclipse.cdt.internal.core.pdom.db.Database;
|
import org.eclipse.cdt.internal.core.pdom.db.Database;
|
||||||
import org.eclipse.cdt.pdom.core.PDOMCorePlugin;
|
|
||||||
import org.eclipse.core.runtime.CoreException;
|
import org.eclipse.core.runtime.CoreException;
|
||||||
import org.eclipse.core.runtime.IStatus;
|
import org.eclipse.core.runtime.IStatus;
|
||||||
import org.eclipse.core.runtime.Status;
|
import org.eclipse.core.runtime.Status;
|
||||||
|
@ -77,7 +77,7 @@ public class PDOMName implements IASTName, IASTFileLocation {
|
||||||
db.putInt(record + NODE_LENGTH_OFFSET, fileloc.getNodeLength());
|
db.putInt(record + NODE_LENGTH_OFFSET, fileloc.getNodeLength());
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
throw new CoreException(new Status(IStatus.ERROR,
|
throw new CoreException(new Status(IStatus.ERROR,
|
||||||
PDOMCorePlugin.ID, 0, "Failed to allocate name", e));
|
CCorePlugin.PLUGIN_ID, 0, "Failed to allocate name", e));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -107,8 +107,7 @@ public class PDOMName implements IASTName, IASTFileLocation {
|
||||||
int bindingRecord = pdom.getDB().getInt(record + BINDING_REC_OFFET);
|
int bindingRecord = pdom.getDB().getInt(record + BINDING_REC_OFFET);
|
||||||
return new PDOMBinding(pdom, bindingRecord);
|
return new PDOMBinding(pdom, bindingRecord);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
PDOMCorePlugin.log(new CoreException(new Status(IStatus.ERROR,
|
CCorePlugin.log(e);
|
||||||
PDOMCorePlugin.ID, 0, "Failed to allocate name", e)));
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -134,8 +133,7 @@ public class PDOMName implements IASTName, IASTFileLocation {
|
||||||
|
|
||||||
return new PDOMBinding(pdom, bindingRec).getNameCharArray();
|
return new PDOMBinding(pdom, bindingRec).getNameCharArray();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
PDOMCorePlugin.log(new CoreException(new Status(IStatus.ERROR,
|
CCorePlugin.log(e);
|
||||||
PDOMCorePlugin.ID, 0, "Failed to allocate name", e)));
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -201,8 +199,7 @@ public class PDOMName implements IASTName, IASTFileLocation {
|
||||||
try {
|
try {
|
||||||
return new PDOMFile(pdom, pdom.getDB().getInt(record + FILE_REC_OFFSET)).getFileName();
|
return new PDOMFile(pdom, pdom.getDB().getInt(record + FILE_REC_OFFSET)).getFileName();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
PDOMCorePlugin.log(new CoreException(new Status(IStatus.ERROR,
|
CCorePlugin.log(e);
|
||||||
PDOMCorePlugin.ID, 0, "PDOM Exception", e)));
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -219,8 +216,7 @@ public class PDOMName implements IASTName, IASTFileLocation {
|
||||||
try {
|
try {
|
||||||
return pdom.getDB().getInt(record + NODE_LENGTH_OFFSET);
|
return pdom.getDB().getInt(record + NODE_LENGTH_OFFSET);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
PDOMCorePlugin.log(new CoreException(new Status(IStatus.ERROR,
|
CCorePlugin.log(e);
|
||||||
PDOMCorePlugin.ID, 0, "PDOM Exception", e)));
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -229,8 +225,7 @@ public class PDOMName implements IASTName, IASTFileLocation {
|
||||||
try {
|
try {
|
||||||
return pdom.getDB().getInt(record + NODE_OFFSET_OFFSET);
|
return pdom.getDB().getInt(record + NODE_OFFSET_OFFSET);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
PDOMCorePlugin.log(new CoreException(new Status(IStatus.ERROR,
|
CCorePlugin.log(e);
|
||||||
PDOMCorePlugin.ID, 0, "PDOM Exception", e)));
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,50 +0,0 @@
|
||||||
package org.eclipse.cdt.pdom.core;
|
|
||||||
|
|
||||||
import org.eclipse.core.runtime.CoreException;
|
|
||||||
import org.eclipse.core.runtime.Plugin;
|
|
||||||
import org.osgi.framework.BundleContext;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The main plugin class to be used in the desktop.
|
|
||||||
*/
|
|
||||||
public class PDOMCorePlugin extends Plugin {
|
|
||||||
|
|
||||||
public static final String ID = "org.eclipse.cdt.pdom.core"; //$NON-NLS-1$
|
|
||||||
|
|
||||||
//The shared instance.
|
|
||||||
private static PDOMCorePlugin plugin;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The constructor.
|
|
||||||
*/
|
|
||||||
public PDOMCorePlugin() {
|
|
||||||
plugin = this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This method is called upon plug-in activation
|
|
||||||
*/
|
|
||||||
public void start(BundleContext context) throws Exception {
|
|
||||||
super.start(context);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This method is called when the plug-in is stopped
|
|
||||||
*/
|
|
||||||
public void stop(BundleContext context) throws Exception {
|
|
||||||
super.stop(context);
|
|
||||||
plugin = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the shared instance.
|
|
||||||
*/
|
|
||||||
public static PDOMCorePlugin getDefault() {
|
|
||||||
return plugin;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void log(CoreException e) {
|
|
||||||
plugin.getLog().log(e.getStatus());
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
Loading…
Add table
Reference in a new issue