diff options
author | Markus Schorn | 2008-05-30 11:13:33 +0000 |
---|---|---|
committer | Markus Schorn | 2008-05-30 11:13:33 +0000 |
commit | 7e1f9c87fc2ae7886156613a95802eb902665efc (patch) | |
tree | 7b329301958df9e69ef67f48402ffe80a476aea6 /core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/astwriter | |
parent | 1b0953a43484994b3ee7174fbf73c39dd162ee38 (diff) | |
download | org.eclipse.cdt-7e1f9c87fc2ae7886156613a95802eb902665efc.tar.gz org.eclipse.cdt-7e1f9c87fc2ae7886156613a95802eb902665efc.tar.xz org.eclipse.cdt-7e1f9c87fc2ae7886156613a95802eb902665efc.zip |
Fixes for refactoring by Guido Zgraggen and Lukas Felber, bug 234783, 234786 and 234791.
Diffstat (limited to 'core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/astwriter')
2 files changed, 17 insertions, 5 deletions
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/astwriter/ASTWriter.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/astwriter/ASTWriter.java index 598e025c900..22b013232f2 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/astwriter/ASTWriter.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/astwriter/ASTWriter.java @@ -45,7 +45,7 @@ public class ASTWriter { /** * Creates a <code>ASTWriter</code> that indents the code. * - * @param givenIndentation The indention added to each line + * @param givenIndentation The indentation added to each line */ public ASTWriter(String givenIndentation) { super(); @@ -66,7 +66,7 @@ public class ASTWriter { /** * - * Genereates the source code representing this node including comments. + * Generates the source code representing this node including comments. * * @param rootNode Node to write. * @param fileScope @@ -84,7 +84,6 @@ public class ASTWriter { return str; } - public void setModificationStore(ASTModificationStore modificationStore) { this.modificationStore = modificationStore; diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/astwriter/ASTWriterVisitor.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/astwriter/ASTWriterVisitor.java index a733f3bb8f0..edb2af11c73 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/astwriter/ASTWriterVisitor.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/astwriter/ASTWriterVisitor.java @@ -218,14 +218,27 @@ public class ASTWriterVisitor extends CPPASTVisitor { writeLeadingComments((ASTNode) parameterDeclaration); if(!macroHandler.checkisMacroExpansionNode(parameterDeclaration)) { parameterDeclaration.getDeclSpecifier().accept(this); - IASTDeclarator declarator = parameterDeclaration.getDeclarator(); - if(declarator.getName().toString().length() != 0){ + IASTDeclarator declarator = getParameterDeclarator(parameterDeclaration); + + if(getParameterName(declarator).toString().length() != 0){ scribe.printSpaces(1); } declarator.accept(this); } return ASTVisitor.PROCESS_SKIP; } + + + + protected IASTName getParameterName(IASTDeclarator declarator) { + return declarator.getName(); + } + + + protected IASTDeclarator getParameterDeclarator( + IASTParameterDeclaration parameterDeclaration) { + return parameterDeclaration.getDeclarator(); + } @Override public int visit(ICPPASTNamespaceDefinition namespace) { |