Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTFileLocation.java6
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTMacroExpansion.java12
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTNodeLocation.java17
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTTranslationUnit.java19
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser2/c/CASTTranslationUnit.java17
5 files changed, 66 insertions, 5 deletions
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTFileLocation.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTFileLocation.java
index 113dcf9360..6d90fdd334 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTFileLocation.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTFileLocation.java
@@ -20,8 +20,8 @@ public interface IASTFileLocation extends IASTNodeLocation {
/**
* The name of the file.
*
- * @return
+ * @return the name of the file
*/
- public String getFilename();
-
+ public String getFileName();
+
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTMacroExpansion.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTMacroExpansion.java
index 62d0422fd3..bab822bd09 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTMacroExpansion.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTMacroExpansion.java
@@ -16,8 +16,18 @@ package org.eclipse.cdt.core.dom.ast;
public interface IASTMacroExpansion {
/**
- * The definition
+ * The macro definition used for the expansion
+ *
* @return
*/
public IASTMacroDefinition getMacroDefinition();
+
+ /**
+ * The source location for for the macro expansion. This is the location
+ * in the original source that expansion occured and was replaced.
+ *
+ * @return
+ */
+ public IASTNodeLocation getExpansionLocation();
+
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTNodeLocation.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTNodeLocation.java
index 9eccaacef6..fd1ffe9eaf 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTNodeLocation.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTNodeLocation.java
@@ -11,7 +11,7 @@
package org.eclipse.cdt.core.dom.ast;
/**
- * A NodeLocation represents some location that contains code. Most
+ * A NodeLocation represents the source location of a given node. Most
* often this is a file it may be other fancy things like macro
* expansions.
*
@@ -19,4 +19,19 @@ package org.eclipse.cdt.core.dom.ast;
*/
public interface IASTNodeLocation {
+ /**
+ * This is the offset into the actual source location that this node
+ * starts at.
+ *
+ * @return
+ */
+ public int getNodeOffset();
+
+ /**
+ * This is the length of the node contained in this location.
+ *
+ * @return
+ */
+ public int getNodeLength();
+
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTTranslationUnit.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTTranslationUnit.java
index 00de995b31..3d1bbdec03 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTTranslationUnit.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTTranslationUnit.java
@@ -37,4 +37,23 @@ public interface IASTTranslationUnit extends IASTNode {
*/
public IScope getScope();
+ /**
+ * Returns the list of declarations in this translation unit for the given
+ * binding. The list contains the IASTName nodes that declare the binding.
+ *
+ * @param binding
+ * @return List of IASTName nodes for the binding's declaration
+ */
+ public List getDeclarations(IBinding binding);
+
+ /**
+ * Returns the list of references in this translation unit to the given
+ * binding. This list contains the IASTName nodes that represent a use of
+ * the binding.
+ *
+ * @param binding
+ * @return List of IASTName nodes representing uses of the binding
+ */
+ public List getReferences(IBinding binding);
+
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser2/c/CASTTranslationUnit.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser2/c/CASTTranslationUnit.java
index 8f4b60507c..79a1516150 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser2/c/CASTTranslationUnit.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser2/c/CASTTranslationUnit.java
@@ -15,6 +15,7 @@ import java.util.List;
import org.eclipse.cdt.core.dom.ast.IASTDeclaration;
import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit;
+import org.eclipse.cdt.core.dom.ast.IBinding;
import org.eclipse.cdt.core.dom.ast.IScope;
import org.eclipse.cdt.internal.core.parser2.CompilationUnit;
@@ -83,4 +84,20 @@ public class CASTTranslationUnit extends CASTNode implements IASTTranslationUnit
compilationUnit = new CompilationUnit();
return compilationUnit;
}
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.dom.ast.IASTTranslationUnit#getDeclarations(org.eclipse.cdt.core.dom.ast.IBinding)
+ */
+ public List getDeclarations(IBinding binding) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.dom.ast.IASTTranslationUnit#getReferences(org.eclipse.cdt.core.dom.ast.IBinding)
+ */
+ public List getReferences(IBinding binding) {
+ // TODO Auto-generated method stub
+ return null;
+ }
}

Back to the top