Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSergey Prigogin2012-04-04 18:11:57 +0000
committerSergey Prigogin2012-04-05 00:25:07 +0000
commit710e3589316e377cb77d5e3c2297a64622a25680 (patch)
tree2cbde30383179512fa9144a0aee29d4b376cd817 /core/org.eclipse.cdt.core/parser
parentffc583c84dff1622b5a42b1efddb7ae6be224431 (diff)
downloadorg.eclipse.cdt-710e3589316e377cb77d5e3c2297a64622a25680.tar.gz
org.eclipse.cdt-710e3589316e377cb77d5e3c2297a64622a25680.tar.xz
org.eclipse.cdt-710e3589316e377cb77d5e3c2297a64622a25680.zip
Cosmetics.
Diffstat (limited to 'core/org.eclipse.cdt.core/parser')
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/rewrite/ASTRewrite.java43
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTWhileStatement.java2
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/ASTRewriteAnalyzer.java9
3 files changed, 28 insertions, 26 deletions
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/rewrite/ASTRewrite.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/rewrite/ASTRewrite.java
index a83b0a2e559..99086ee473e 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/rewrite/ASTRewrite.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/rewrite/ASTRewrite.java
@@ -7,7 +7,7 @@
*
* Contributors:
* Markus Schorn - initial API and implementation
- *******************************************************************************/
+ *******************************************************************************/
package org.eclipse.cdt.core.dom.rewrite;
import java.util.List;
@@ -42,14 +42,14 @@ import org.eclipse.text.edits.TextEditGroup;
* progress. There is no guarantee that this API will work or that it will remain the same.
* Please do not use this API without consulting with the CDT team.
* </p>
- *
+ *
* @since 5.0
* @noinstantiate This class is not intended to be instantiated by clients.
*/
public final class ASTRewrite {
/**
* Defines the positions of the comment.
- *
+ *
* @since 5.3
*/
public enum CommentPosition {
@@ -67,7 +67,7 @@ public final class ASTRewrite {
*/
freestanding
}
-
+
/**
* Creates a rewriter for a translation unit.
*/
@@ -80,7 +80,7 @@ public final class ASTRewrite {
private final ASTModificationStore fModificationStore;
private final ASTModification fParentMod;
private final NodeCommentMap fCommentMap;
-
+
private enum Operation {
insertBefore,
replace,
@@ -99,8 +99,8 @@ public final class ASTRewrite {
* Creates and returns a node for a source string that is to be inserted into
* the output document.
* The string will be inserted without being reformatted beyond correcting
- * the indentation level.
- *
+ * the indentation level.
+ *
* @param code the string to be inserted; lines should not have extra indentation
* @return a synthetic node representing the literal code.
* @throws IllegalArgumentException if the code is null.
@@ -115,7 +115,7 @@ public final class ASTRewrite {
*
* @param node the node being removed
* @param editGroup the edit group in which to collect the corresponding
- * text edits, or <code>null</code>
+ * text edits, or <code>null</code>
* @throws IllegalArgumentException if the node is null, the node is not
* part of this rewriter's AST.
*/
@@ -129,13 +129,13 @@ public final class ASTRewrite {
/**
* Replaces the given node in this rewriter. The ast is not modified, the rewriter
* just records the replacement.
- * The replacement node can be part of a translation-unit or it is a synthetic
+ * The replacement node can be part of a translation-unit or it is a synthetic
* (newly created) node.
*
* @param node the node being replaced
* @param replacement the node replacing the given one
* @param editGroup the edit group in which to collect the corresponding text edits,
- * or <code>null</code>
+ * or <code>null</code>
* @return a rewriter for further rewriting the replacement node.
* @throws IllegalArgumentException if the node or the replacement is null, or if the node is
* not part of this rewriter's AST
@@ -155,14 +155,14 @@ public final class ASTRewrite {
/**
* Inserts the given node in this rewriter. The ast is not modified, the rewriter
* just records the insertion.
- * The new node can be part of a translation-unit or it is a synthetic
+ * The new node can be part of a translation-unit or it is a synthetic
* (newly created) node.
* @param parent the parent the new node is added to.
* @param insertionPoint the node before which the insertion shall be done, or <code>null</code>
* for inserting after the last child.
- * @param newNode the node being inserted
+ * @param newNode the node being inserted
* @param editGroup the edit group in which to collect the corresponding
- * text edits, or <code>null</code>
+ * text edits, or <code>null</code>
* @return a rewriter for further rewriting the inserted node.
* @throws IllegalArgumentException if the parent or the newNode is null, or if the parent is
* not part of this rewriter's AST, or the insertionPoint is not a child of the parent.
@@ -191,17 +191,17 @@ public final class ASTRewrite {
fModificationStore.storeModification(fParentMod, mod);
return new ASTRewrite(newNode, fModificationStore, mod, fCommentMap);
}
-
+
/**
* Converts all modifications recorded by this rewriter into the change object required by
* the refactoring framework.
* <p>
- * Calling this methods does not discard the modifications on record. Subsequence modifications
+ * Calling this methods does not discard the modifications on record. Subsequence modifications
* are added to the ones already on record. If this method is called again later,
* the resulting text edit object will accurately reflect the net cumulative affect of all those
* changes.
* </p>
- *
+ *
* @return Change object describing the changes to the document corresponding to the changes
* recorded by this rewriter
* @since 5.0
@@ -210,7 +210,8 @@ public final class ASTRewrite {
if (!(fRoot instanceof IASTTranslationUnit)) {
throw new IllegalArgumentException("This API can only be used for the root rewrite object."); //$NON-NLS-1$
}
- return ASTRewriteAnalyzer.rewriteAST((IASTTranslationUnit) fRoot, fModificationStore, fCommentMap);
+ return ASTRewriteAnalyzer.rewriteAST((IASTTranslationUnit) fRoot, fModificationStore,
+ fCommentMap);
}
private void checkBelongsToAST(IASTNode node) {
@@ -222,7 +223,7 @@ public final class ASTRewrite {
}
throw new IllegalArgumentException();
}
-
+
private void checkSupportedNode(IASTNode node, Operation op) {
if (node instanceof IASTComment) {
if (op != Operation.remove) {
@@ -234,12 +235,12 @@ public final class ASTRewrite {
}
if (node instanceof IASTProblem) {
throw new IllegalArgumentException("Rewriting problem nodes is not supported"); //$NON-NLS-1$
- }
+ }
}
/**
* Assigns the comment to the node.
- *
+ *
* @param node the node.
* @param comment the comment to be attached to the node at the given position.
* @param pos the position of the comment.
@@ -261,7 +262,7 @@ public final class ASTRewrite {
/**
* Returns comments for the given node.
- *
+ *
* @param node the node
* @param pos the position of the comments
* @return All comments assigned to the node at this position
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTWhileStatement.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTWhileStatement.java
index 2ad28acedcb..44c789f50ba 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTWhileStatement.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTWhileStatement.java
@@ -27,8 +27,8 @@ import org.eclipse.cdt.internal.core.dom.parser.IASTAmbiguityParent;
public class CPPASTWhileStatement extends ASTNode
implements ICPPASTWhileStatement, IASTAmbiguityParent {
private IASTExpression condition;
- private IASTStatement body;
private IASTDeclaration condition2;
+ private IASTStatement body;
private IScope scope;
public CPPASTWhileStatement() {
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/ASTRewriteAnalyzer.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/ASTRewriteAnalyzer.java
index 106d7934251..886841c7edf 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/ASTRewriteAnalyzer.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/ASTRewriteAnalyzer.java
@@ -6,8 +6,8 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * Markus Schorn - initial API and implementation
- *******************************************************************************/
+ * Markus Schorn - initial API and implementation
+ *******************************************************************************/
package org.eclipse.cdt.internal.core.dom.rewrite;
import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit;
@@ -20,7 +20,8 @@ import org.eclipse.ltk.core.refactoring.TextFileChange;
public class ASTRewriteAnalyzer {
private static ICTextFileChangeFactory sFileChangeFactory;
- public static Change rewriteAST(IASTTranslationUnit root, ASTModificationStore modificationStore, NodeCommentMap commentMap) {
+ public static Change rewriteAST(IASTTranslationUnit root, ASTModificationStore modificationStore,
+ NodeCommentMap commentMap) {
ChangeGenerator rewriter = new ChangeGenerator(modificationStore, commentMap);
rewriter.generateChange(root);
return rewriter.getChange();
@@ -29,7 +30,7 @@ public class ASTRewriteAnalyzer {
public static void setCTextFileChangeFactory(ICTextFileChangeFactory factory) {
sFileChangeFactory= factory;
}
-
+
public static TextFileChange createCTextFileChange(IFile file) {
if (sFileChangeFactory == null) {
return new TextFileChange(file.getName(), file);

Back to the top