Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Schorn2010-10-13 03:48:39 -0400
committerMarkus Schorn2010-10-13 03:48:39 -0400
commit67f123cf5e5ab67611ec962324cdff94dba8e1b3 (patch)
tree68cdc1afffb7db828765f53508cc54f59393188f /core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite
parent6174986b48b3a26c0ebd65c92670b697d872976d (diff)
downloadorg.eclipse.cdt-67f123cf5e5ab67611ec962324cdff94dba8e1b3.tar.gz
org.eclipse.cdt-67f123cf5e5ab67611ec962324cdff94dba8e1b3.tar.xz
org.eclipse.cdt-67f123cf5e5ab67611ec962324cdff94dba8e1b3.zip
Bug 327328: Push concept of restrict up to IASTPointer and IPointerType.
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/astwriter/DeclaratorWriter.java20
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/astwriter/NodeWriter.java6
2 files changed, 7 insertions, 19 deletions
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/astwriter/DeclaratorWriter.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/astwriter/DeclaratorWriter.java
index 3cef7d0691..171f370ee4 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/astwriter/DeclaratorWriter.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/astwriter/DeclaratorWriter.java
@@ -12,6 +12,7 @@
*******************************************************************************/
package org.eclipse.cdt.internal.core.dom.rewrite.astwriter;
+import org.eclipse.cdt.core.dom.ast.ASTVisitor;
import org.eclipse.cdt.core.dom.ast.IASTArrayDeclarator;
import org.eclipse.cdt.core.dom.ast.IASTArrayModifier;
import org.eclipse.cdt.core.dom.ast.IASTDeclaration;
@@ -25,13 +26,10 @@ import org.eclipse.cdt.core.dom.ast.IASTPointer;
import org.eclipse.cdt.core.dom.ast.IASTPointerOperator;
import org.eclipse.cdt.core.dom.ast.IASTStandardFunctionDeclarator;
import org.eclipse.cdt.core.dom.ast.IASTTypeId;
-import org.eclipse.cdt.core.dom.ast.c.ICASTPointer;
-import org.eclipse.cdt.core.dom.ast.cpp.CPPASTVisitor;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTFunctionDeclarator;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTPointerToMember;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTReferenceOperator;
import org.eclipse.cdt.core.dom.ast.gnu.c.ICASTKnRFunctionDeclarator;
-import org.eclipse.cdt.core.dom.ast.gnu.cpp.IGPPASTPointer;
import org.eclipse.cdt.internal.core.dom.rewrite.commenthandler.NodeCommentMap;
@@ -52,7 +50,7 @@ public class DeclaratorWriter extends NodeWriter {
private static final String STAR_SPACE = "* "; //$NON-NLS-1$
private static final String PURE_VIRTUAL = " =0"; //$NON-NLS-1$
- public DeclaratorWriter(Scribe scribe, CPPASTVisitor visitor, NodeCommentMap commentMap) {
+ public DeclaratorWriter(Scribe scribe, ASTVisitor visitor, NodeCommentMap commentMap) {
super(scribe, visitor, commentMap);
}
@@ -176,22 +174,12 @@ public class DeclaratorWriter extends NodeWriter {
if (operator.isConst()) {
scribe.printStringSpace(CONST);
-
}
if (operator.isVolatile()) {
scribe.printStringSpace(VOLATILE);
}
- if (operator instanceof ICASTPointer) {
- ICASTPointer cPoint = (ICASTPointer) operator;
- if(cPoint.isRestrict()) {
- scribe.print(RESTRICT);
- }
- }
- if (operator instanceof IGPPASTPointer) {
- IGPPASTPointer gppPoint = (IGPPASTPointer) operator;
- if(gppPoint.isRestrict()) {
- scribe.print(RESTRICT);
- }
+ if (operator.isRestrict()) {
+ scribe.print(RESTRICT);
}
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/astwriter/NodeWriter.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/astwriter/NodeWriter.java
index ecf21e1d30..369fe35e39 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/astwriter/NodeWriter.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/astwriter/NodeWriter.java
@@ -11,9 +11,9 @@
*******************************************************************************/
package org.eclipse.cdt.internal.core.dom.rewrite.astwriter;
+import org.eclipse.cdt.core.dom.ast.ASTVisitor;
import org.eclipse.cdt.core.dom.ast.IASTComment;
import org.eclipse.cdt.core.dom.ast.IASTNode;
-import org.eclipse.cdt.core.dom.ast.cpp.CPPASTVisitor;
import org.eclipse.cdt.internal.core.dom.rewrite.commenthandler.NodeCommentMap;
/**
@@ -27,7 +27,7 @@ import org.eclipse.cdt.internal.core.dom.rewrite.commenthandler.NodeCommentMap;
public class NodeWriter {
protected Scribe scribe;
- protected CPPASTVisitor visitor;
+ protected ASTVisitor visitor;
protected NodeCommentMap commentMap;
protected static final String COMMA_SPACE = ", "; //$NON-NLS-1$
protected static final String EQUALS = " = "; //$NON-NLS-1$
@@ -59,7 +59,7 @@ public class NodeWriter {
protected static final String VAR_ARGS = "..."; //$NON-NLS-1$
protected static final String COLON_COLON = "::"; //$NON-NLS-1$
- public NodeWriter(Scribe scribe, CPPASTVisitor visitor, NodeCommentMap commentMap) {
+ public NodeWriter(Scribe scribe, ASTVisitor visitor, NodeCommentMap commentMap) {
super();
this.scribe = scribe;
this.visitor = visitor;

Back to the top