diff options
author | Doug Schaefer | 2005-09-09 13:31:28 +0000 |
---|---|---|
committer | Doug Schaefer | 2005-09-09 13:31:28 +0000 |
commit | 6c543227824915b4addd8fad64f84b328b9aeff5 (patch) | |
tree | 2423a8b254ea441af984be4e81e6e05ccffe48fe | |
parent | 8a7ca5b2aa5cb9b5453b6d24749c81da9f442827 (diff) | |
download | org.eclipse.cdt-6c543227824915b4addd8fad64f84b328b9aeff5.tar.gz org.eclipse.cdt-6c543227824915b4addd8fad64f84b328b9aeff5.tar.xz org.eclipse.cdt-6c543227824915b4addd8fad64f84b328b9aeff5.zip |
Start of PDOM.
7 files changed, 283 insertions, 1 deletions
diff --git a/core/org.eclipse.cdt.core/.classpath b/core/org.eclipse.cdt.core/.classpath index 9d6202a599d..5331ddcbabb 100644 --- a/core/org.eclipse.cdt.core/.classpath +++ b/core/org.eclipse.cdt.core/.classpath @@ -10,5 +10,6 @@ <classpathentry kind="src" path="browser"/> <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> + <classpathentry kind="src" path="pdom"/> <classpathentry kind="output" path="bin"/> </classpath> diff --git a/core/org.eclipse.cdt.core/build.properties b/core/org.eclipse.cdt.core/build.properties index 703f38d75ce..cd98839fffa 100644 --- a/core/org.eclipse.cdt.core/build.properties +++ b/core/org.eclipse.cdt.core/build.properties @@ -33,4 +33,6 @@ source.cdtcore.jar = index/,\ search/,\ dependency/,\ browser/ -source.cdtparser.jar = parser/ +source.cdtparser.jar = parser/,\ + pdom/ +output.cdtparser.jar = bin/ diff --git a/core/org.eclipse.cdt.core/pdom/org/eclipse/cdt/core/pdom/PDOM.java b/core/org.eclipse.cdt.core/pdom/org/eclipse/cdt/core/pdom/PDOM.java new file mode 100644 index 00000000000..0bda0ecc05c --- /dev/null +++ b/core/org.eclipse.cdt.core/pdom/org/eclipse/cdt/core/pdom/PDOM.java @@ -0,0 +1,82 @@ +package org.eclipse.cdt.core.pdom; + +import java.util.HashSet; +import java.util.Iterator; +import java.util.Set; + +import org.eclipse.cdt.core.dom.ast.IASTName; +import org.eclipse.cdt.core.dom.ast.IBinding; +import org.eclipse.cdt.core.dom.ast.IScope; + +public class PDOM { + + // To reduce storage requirements we have a single table that contains all + // of the strings in the PDOM. To check for equality, all you need to do + // is compare string handles. + private Set stringTable = new HashSet(); + + private IScope globalScope; + + /** + * Look up the name from the DOM in the PDOM and return the PDOM + * version of the Binding. + * + * @param name + * @return binding + */ + public IBinding resolveBinding(IASTName name) { + // look up the name in the PDOM + return null; + } + + /** + * Return all bindings that have this name as a prefix. + * This is used for content assist. + * + * @param prefix + * @return bindings + */ + public IBinding[] resolvePrefix(IASTName name) { + return new IBinding[0]; + } + + /** + * Add the name to the PDOM. This will also add the binding to the + * PDOM if it is not already there. + * + * @param name + */ + public void addName(IASTName name) { + + } + + /** + * Get all names stored in the PDOM for a given binding. + * + * @param binding + * @return declarations + */ + public Iterator getDeclarations(IBinding binding) { + return null; + } + + /** + * Get all names in the PDOM that refer to a given binding. + * @param binding + * @return references + */ + public Iterator getReferences(IBinding binding) { + return null; + } + + /** + * Clear all names from the PDOM that appear in the given file. + * This is used when reparsing a file. + * + * @param filename + */ + public void clearNamesInFile(String filename) { + + } + +} diff --git a/core/org.eclipse.cdt.core/pdom/org/eclipse/cdt/core/pdom/PDOMUnimplementedException.java b/core/org.eclipse.cdt.core/pdom/org/eclipse/cdt/core/pdom/PDOMUnimplementedException.java new file mode 100644 index 00000000000..259722e45b2 --- /dev/null +++ b/core/org.eclipse.cdt.core/pdom/org/eclipse/cdt/core/pdom/PDOMUnimplementedException.java @@ -0,0 +1,8 @@ +package org.eclipse.cdt.core.pdom; + + +public class PDOMUnimplementedException extends Error { + + private static final long serialVersionUID = 99L; + +} diff --git a/core/org.eclipse.cdt.core/pdom/org/eclipse/cdt/internal/core/pdom/PCASTName.java b/core/org.eclipse.cdt.core/pdom/org/eclipse/cdt/internal/core/pdom/PCASTName.java new file mode 100644 index 00000000000..79184e93afa --- /dev/null +++ b/core/org.eclipse.cdt.core/pdom/org/eclipse/cdt/internal/core/pdom/PCASTName.java @@ -0,0 +1,87 @@ +package org.eclipse.cdt.internal.core.pdom; + +import org.eclipse.cdt.core.dom.ast.ASTNodeProperty; +import org.eclipse.cdt.core.dom.ast.ASTVisitor; +import org.eclipse.cdt.core.dom.ast.IASTFileLocation; +import org.eclipse.cdt.core.dom.ast.IASTName; +import org.eclipse.cdt.core.dom.ast.IASTNode; +import org.eclipse.cdt.core.dom.ast.IASTNodeLocation; +import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit; +import org.eclipse.cdt.core.dom.ast.IBinding; +import org.eclipse.cdt.core.pdom.PDOMUnimplementedException; + +public class PCASTName implements IASTName { + + public IBinding resolveBinding() { + throw new PDOMUnimplementedException(); + } + + public IBinding getBinding() { + throw new PDOMUnimplementedException(); + } + + public void setBinding(IBinding binding) { + throw new PDOMUnimplementedException(); + } + + public IBinding[] resolvePrefix() { + throw new PDOMUnimplementedException(); + } + + public char[] toCharArray() { + throw new PDOMUnimplementedException(); + } + + public boolean isDeclaration() { + throw new PDOMUnimplementedException(); + } + + public boolean isReference() { + throw new PDOMUnimplementedException(); + } + + public boolean isDefinition() { + throw new PDOMUnimplementedException(); + } + + public IASTTranslationUnit getTranslationUnit() { + throw new PDOMUnimplementedException(); + } + + public IASTNodeLocation[] getNodeLocations() { + throw new PDOMUnimplementedException(); + } + + public IASTFileLocation getFileLocation() { + throw new PDOMUnimplementedException(); + } + + public String getContainingFilename() { + throw new PDOMUnimplementedException(); + } + + public IASTNode getParent() { + throw new PDOMUnimplementedException(); + } + + public void setParent(IASTNode node) { + throw new PDOMUnimplementedException(); + } + + public ASTNodeProperty getPropertyInParent() { + throw new PDOMUnimplementedException(); + } + + public void setPropertyInParent(ASTNodeProperty property) { + throw new PDOMUnimplementedException(); + } + + public boolean accept(ASTVisitor visitor) { + throw new PDOMUnimplementedException(); + } + + public String getRawSignature() { + throw new PDOMUnimplementedException(); + } + +} diff --git a/core/org.eclipse.cdt.core/pdom/org/eclipse/cdt/internal/core/pdom/PCBasicType.java b/core/org.eclipse.cdt.core/pdom/org/eclipse/cdt/internal/core/pdom/PCBasicType.java new file mode 100644 index 00000000000..148c8239314 --- /dev/null +++ b/core/org.eclipse.cdt.core/pdom/org/eclipse/cdt/internal/core/pdom/PCBasicType.java @@ -0,0 +1,59 @@ +package org.eclipse.cdt.internal.core.pdom; + +import org.eclipse.cdt.core.dom.ast.DOMException; +import org.eclipse.cdt.core.dom.ast.IASTExpression; +import org.eclipse.cdt.core.dom.ast.IType; +import org.eclipse.cdt.core.dom.ast.c.ICBasicType; +import org.eclipse.cdt.core.pdom.PDOMUnimplementedException; + +public class PCBasicType implements ICBasicType { + + public Object clone() { + try { + return super.clone(); + } catch (CloneNotSupportedException e) { + return null; + } + } + + public boolean isComplex() { + throw new PDOMUnimplementedException(); + } + + public boolean isImaginary() { + throw new PDOMUnimplementedException(); + } + + public boolean isLongLong() throws DOMException { + throw new PDOMUnimplementedException(); + } + + public int getType() throws DOMException { + throw new PDOMUnimplementedException(); + } + + public IASTExpression getValue() throws DOMException { + throw new PDOMUnimplementedException(); + } + + public boolean isSigned() throws DOMException { + throw new PDOMUnimplementedException(); + } + + public boolean isUnsigned() throws DOMException { + throw new PDOMUnimplementedException(); + } + + public boolean isShort() throws DOMException { + throw new PDOMUnimplementedException(); + } + + public boolean isLong() throws DOMException { + throw new PDOMUnimplementedException(); + } + + public boolean isSameType(IType type) { + throw new PDOMUnimplementedException(); + } + +} diff --git a/core/org.eclipse.cdt.core/pdom/org/eclipse/cdt/internal/core/pdom/PCVariable.java b/core/org.eclipse.cdt.core/pdom/org/eclipse/cdt/internal/core/pdom/PCVariable.java new file mode 100644 index 00000000000..fdc6035ccee --- /dev/null +++ b/core/org.eclipse.cdt.core/pdom/org/eclipse/cdt/internal/core/pdom/PCVariable.java @@ -0,0 +1,43 @@ +package org.eclipse.cdt.internal.core.pdom; + +import org.eclipse.cdt.core.dom.ast.DOMException; +import org.eclipse.cdt.core.dom.ast.IScope; +import org.eclipse.cdt.core.dom.ast.IType; +import org.eclipse.cdt.core.dom.ast.IVariable; +import org.eclipse.cdt.core.pdom.PDOMUnimplementedException; + +public class PCVariable implements IVariable { + + public IType getType() throws DOMException { + throw new PDOMUnimplementedException(); + } + + public boolean isStatic() throws DOMException { + throw new PDOMUnimplementedException(); + } + + public boolean isExtern() throws DOMException { + throw new PDOMUnimplementedException(); + } + + public boolean isAuto() throws DOMException { + throw new PDOMUnimplementedException(); + } + + public boolean isRegister() throws DOMException { + throw new PDOMUnimplementedException(); + } + + public String getName() { + throw new PDOMUnimplementedException(); + } + + public char[] getNameCharArray() { + throw new PDOMUnimplementedException(); + } + + public IScope getScope() throws DOMException { + throw new PDOMUnimplementedException(); + } + +} |