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 113dcf9360b..6d90fdd334e 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 62d0422fd34..bab822bd09f 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 9eccaacef66..fd1ffe9eaf7 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 00de995b319..3d1bbdec030 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 8f4b60507c3..79a15161502 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