Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Kucera2008-12-17 10:41:35 -0500
committerMike Kucera2008-12-17 10:41:35 -0500
commita036483c1817b7aadb44c6f3fbbca01ae89ad835 (patch)
treec4e6d54200e939ef80e45953fd44f5796caa08b8 /core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite
parentde24d81d292e37940a457897f60432af7d9e0ef5 (diff)
downloadorg.eclipse.cdt-a036483c1817b7aadb44c6f3fbbca01ae89ad835.tar.gz
org.eclipse.cdt-a036483c1817b7aadb44c6f3fbbca01ae89ad835.tar.xz
org.eclipse.cdt-a036483c1817b7aadb44c6f3fbbca01ae89ad835.zip
bug 258345, implementation of IASTNode.copy()
Diffstat (limited to 'core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite')
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/ASTLiteralNode.java4
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/astwriter/ContainerNode.java8
2 files changed, 12 insertions, 0 deletions
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/ASTLiteralNode.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/ASTLiteralNode.java
index b7e8290130..7cdd2adddf 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/ASTLiteralNode.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/ASTLiteralNode.java
@@ -95,4 +95,8 @@ public class ASTLiteralNode implements IASTNode {
public boolean isFrozen() {
return false;
}
+
+ public IASTNode copy() {
+ throw new UnsupportedOperationException();
+ }
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/astwriter/ContainerNode.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/astwriter/ContainerNode.java
index 1f9a10c84c..39f2dd0a95 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/astwriter/ContainerNode.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/astwriter/ContainerNode.java
@@ -42,6 +42,14 @@ public class ContainerNode extends ASTNode {
}
}
+ public ContainerNode copy() {
+ ContainerNode copy = new ContainerNode();
+ for(IASTNode node : getNodes())
+ copy.addNode(node == null ? null : node.copy());
+ copy.setOffsetAndLength(this);
+ return copy;
+ }
+
public void addNode(IASTNode node) {
nodes.add(node);
if(node.getParent() == null) {

Back to the top