1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-05 16:56:04 +02:00

Start of PDOM.

This commit is contained in:
Doug Schaefer 2005-09-09 13:31:28 +00:00
parent 8a7ca5b2aa
commit 6c54322782
7 changed files with 283 additions and 1 deletions

View file

@ -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>

View file

@ -33,4 +33,6 @@ source.cdtcore.jar = index/,\
search/,\
dependency/,\
browser/
source.cdtparser.jar = parser/
source.cdtparser.jar = parser/,\
pdom/
output.cdtparser.jar = bin/

View file

@ -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) {
}
}

View file

@ -0,0 +1,8 @@
package org.eclipse.cdt.core.pdom;
public class PDOMUnimplementedException extends Error {
private static final long serialVersionUID = 99L;
}

View file

@ -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();
}
}

View file

@ -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();
}
}

View file

@ -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();
}
}