Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Kucera2008-03-24 18:51:29 +0000
committerMike Kucera2008-03-24 18:51:29 +0000
commit2e3fbf6c23755e395ff5ba843f9e1b35279ab32e (patch)
tree905f6d2fc24c1c8999fabba210c7c4045849e3db /core/org.eclipse.cdt.core/parser
parent8d37ffe0608d00f84191d229b9d4030e641f347f (diff)
downloadorg.eclipse.cdt-2e3fbf6c23755e395ff5ba843f9e1b35279ab32e.tar.gz
org.eclipse.cdt-2e3fbf6c23755e395ff5ba843f9e1b35279ab32e.tar.xz
org.eclipse.cdt-2e3fbf6c23755e395ff5ba843f9e1b35279ab32e.zip
decl spec node was missing info
Diffstat (limited to 'core/org.eclipse.cdt.core/parser')
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTSimpleDeclaration.java16
1 files changed, 15 insertions, 1 deletions
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTSimpleDeclaration.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTSimpleDeclaration.java
index 746ed987330..0aeff63fa7d 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTSimpleDeclaration.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTSimpleDeclaration.java
@@ -14,13 +14,15 @@ package org.eclipse.cdt.internal.core.dom.parser.cpp;
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
import org.eclipse.cdt.core.dom.ast.IASTDeclSpecifier;
import org.eclipse.cdt.core.dom.ast.IASTDeclarator;
+import org.eclipse.cdt.core.dom.ast.IASTNode;
import org.eclipse.cdt.core.dom.ast.IASTSimpleDeclaration;
import org.eclipse.cdt.core.parser.util.ArrayUtil;
+import org.eclipse.cdt.internal.core.dom.parser.IASTAmbiguityParent;
/**
* @author jcamelon
*/
-public class CPPASTSimpleDeclaration extends CPPASTNode implements IASTSimpleDeclaration {
+public class CPPASTSimpleDeclaration extends CPPASTNode implements IASTSimpleDeclaration, IASTAmbiguityParent {
public CPPASTSimpleDeclaration() {
}
@@ -85,5 +87,17 @@ public class CPPASTSimpleDeclaration extends CPPASTNode implements IASTSimpleDec
}
return true;
}
+
+ public void replace(IASTNode child, IASTNode other) {
+ IASTDeclarator[] declarators = getDeclarators();
+ for(int i = 0; i < declarators.length; i++) {
+ if(declarators[i] == child) {
+ declarators[i] = (IASTDeclarator)other;
+ other.setParent(child.getParent());
+ other.setPropertyInParent(child.getPropertyInParent());
+ break;
+ }
+ }
+ }
}

Back to the top