diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTImageLocation.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTImageLocation.java
index b8ea292c0ff..a2faf199e90 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTImageLocation.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTImageLocation.java
@@ -6,11 +6,10 @@
* 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.core.dom.ast;
-
/**
* An image location explains how a name made it into the translation unit.
* @since 5.0
@@ -19,7 +18,6 @@ package org.eclipse.cdt.core.dom.ast;
* @noimplement This interface is not intended to be implemented by clients.
*/
public interface IASTImageLocation extends IASTFileLocation {
-
/**
* The image is part of the code that has not been modified by the preprocessor.
*/
@@ -34,8 +32,8 @@ public interface IASTImageLocation extends IASTFileLocation {
final int ARGUMENT_TO_MACRO_EXPANSION= 3;
/**
- * Returns the kind of image-location, one of {@link #REGULAR_CODE}, {@link #MACRO_DEFINITION} or
- * {@link #ARGUMENT_TO_MACRO_EXPANSION}.
+ * Returns the kind of image-location, one of {@link #REGULAR_CODE}, {@link #MACRO_DEFINITION}
+ * or {@link #ARGUMENT_TO_MACRO_EXPANSION}.
*/
public int getLocationKind();
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTName.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTName.java
index 18853e2629c..02f47bb3f18 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTName.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTName.java
@@ -57,7 +57,7 @@ public interface IASTName extends IASTNode, IName {
/**
* Get the role of this name. If the name needs to be resolved to determine that and
- * allowResolution
is set to false
, then {@link IASTNameOwner#r_unclear}
+ * {@code allowResolution} is set to {@code false}, then {@link IASTNameOwner#r_unclear}
* is returned.
*
* @param allowResolution whether or not resolving the name is allowed.
@@ -80,21 +80,24 @@ public interface IASTName extends IASTNode, IName {
public ILinkage getLinkage();
/**
- * Returns the image location for this name or null
if the information is not available.
+ * Returns the image location for this name or null
if the information is not
+ * available.
*
- * An image location can be computed when the name is either found directly in the code, is (part of) - * an argument to a macro expansion or is (part of) a macro definition found in the source code. + * An image location can be computed when the name is either found directly in the code, is + * (part of) an argument to a macro expansion or is (part of) a macro definition found in + * the source code. *
- * The image location is null
, when the name consists of multiple tokens (qualified names)
- * and the tokens are not found side by side in the code, or if the name is the result of
- * a token-paste operation or the name is found in the definition of a built-in macro.
+ * The image location is null
, when the name consists of multiple tokens
+ * (qualified names) and the tokens are not found side by side in the code, or if the name is
+ * the result of a token-paste operation or the name is found in the definition of a built-in
+ * macro.
* @since 5.0
*/
public IASTImageLocation getImageLocation();
/**
- * For convenience this method returns the last name of a qualified name or this if this is not a
- * qualified name.
+ * For convenience this method returns the last name of a qualified name or this if this is not
+ * a qualified name.
* @since 5.1
*/
public IASTName getLastName();
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTNodeSelector.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTNodeSelector.java
index e418d73e41f..9ffbbf3f6b4 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTNodeSelector.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTNodeSelector.java
@@ -27,19 +27,20 @@ public interface IASTNodeSelector {
IASTName findName(int offset, int length);
/**
- * Returns the smallest name enclosing the given range, or null
if there is no such node.
- * Will not return an implicit name.
+ * Returns the smallest name enclosing the given range, or null
if there is
+ * no such node. Will not return an implicit name.
*/
IASTName findEnclosingName(int offset, int length);
/**
- * Returns the first name contained in the given range, or null
if there is no such node.
- * Will not return an implicit name.
+ * Returns the first name contained in the given range, or null
if there is
+ * no such node. Will not return an implicit name.
*/
IASTName findFirstContainedName(int offset, int length);
/**
- * Returns the implicit name for the exact given range, or null
if there is no such node.
+ * Returns the implicit name for the exact given range, or null
if there is
+ * no such node.
*
* Note that there can be more than one implicit name in the same location.
* The implicit name's parent can be used to get all the names at the location.
@@ -61,41 +62,45 @@ public interface IASTNodeSelector {
/**
* Returns the node for the exact given range, or null
if there is no such node.
*
- * For nodes with the same location, macro-expansions ({@link IASTPreprocessorMacroExpansion}) are preferred
- * over c/c++-nodes and children are preferred over their parents.
+ * For nodes with the same location, macro-expansions ({@link IASTPreprocessorMacroExpansion})
+ * are preferred over c/c++-nodes and children are preferred over their parents.
*/
IASTNode findNode(int offset, int length);
/**
- * Returns the smallest node enclosing the given range, or null
if there is no such node.
+ * Returns the smallest node enclosing the given range, or null
if there is
+ * no such node.
*
- * For nodes with the same location, macro-expansions ({@link IASTPreprocessorMacroExpansion}) are preferred
- * over c/c++-nodes nodes and children are preferred over their parents.
+ * For nodes with the same location, macro-expansions ({@link IASTPreprocessorMacroExpansion})
+ * are preferred over c/c++-nodes nodes and children are preferred over their parents.
*/
IASTNode findEnclosingNode(int offset, int length);
/**
- * Returns the smallest node strictly enclosing the given range, or null
if there is no such node.
+ * Returns the smallest node strictly enclosing the given range, or null
if there
+ * is no such node.
*
- * For nodes with the same location, macro-expansions ({@link IASTPreprocessorMacroExpansion}) are preferred
- * over c/c++-nodes nodes and children are preferred over their parents.
+ * For nodes with the same location, macro-expansions ({@link IASTPreprocessorMacroExpansion})
+ * are preferred over c/c++-nodes nodes and children are preferred over their parents.
* @since 5.3
*/
IASTNode findStrictlyEnclosingNode(int offset, int length);
/**
- * Returns the first node contained in the given range, or null
if there is no such node.
+ * Returns the first node contained in the given range, or null
if there is
+ * no such node.
*
- * For nodes with the same location, macro-expansions ({@link IASTPreprocessorMacroExpansion}) are preferred
- * over c/c++-nodes nodes and children are preferred over their parents.
+ * For nodes with the same location, macro-expansions ({@link IASTPreprocessorMacroExpansion})
+ * are preferred over c/c++-nodes nodes and children are preferred over their parents.
*/
IASTNode findFirstContainedNode(int offset, int length);
/**
* Returns the node for the exact given range, or null
if there is no such node.
*
- * The method never returns a macro expansion ({@link IASTPreprocessorMacroExpansion}) or the name for
- * an expansion. Rather than that the expansion itself is searched for a matching node.
+ * The method never returns a macro expansion ({@link IASTPreprocessorMacroExpansion}) or
+ * the name for an expansion. Rather than that the expansion itself is searched for a matching
+ * node.
* @since 5.1
*/
IASTNode findNodeInExpansion(int offset, int length);
@@ -103,17 +108,20 @@ public interface IASTNodeSelector {
/**
* Returns the smallest node enclosing the range, or null
if there is no such node.
*
- * The method never returns a macro expansion ({@link IASTPreprocessorMacroExpansion}) or the name for
- * an expansion. Rather than that the expansion itself is searched for a matching node.
+ * The method never returns a macro expansion ({@link IASTPreprocessorMacroExpansion}) or
+ * the name for an expansion. Rather than that the expansion itself is searched for a matching
+ * node.
* @since 5.1
*/
IASTNode findEnclosingNodeInExpansion(int offset, int length);
/**
- * Returns the first node contained in the given expansion, or null
if there is no such node.
+ * Returns the first node contained in the given expansion, or null
if there is
+ * no such node.
*
- * The method never returns a macro expansion ({@link IASTPreprocessorMacroExpansion}) or the name for
- * an expansion. Rather than that the expansion itself is searched for a matching node.
+ * The method never returns a macro expansion ({@link IASTPreprocessorMacroExpansion}) or
+ * the name for an expansion. Rather than that the expansion itself is searched for a matching
+ * node.
* @since 5.1
*/
IASTNode findFirstContainedNodeInExpansion(int offset, int length);
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTNullStatement.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTNullStatement.java
index 3e1ac165c3d..454ba6b1947 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTNullStatement.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTNullStatement.java
@@ -6,18 +6,17 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * John Camelon (IBM Rational Software) - Initial API and implementation
+ * John Camelon (IBM Rational Software) - Initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.core.dom.ast;
/**
- * This node represents a null statement. ';'
+ * This node represents a null statement, ';'
*
* @noextend This interface is not intended to be extended by clients.
* @noimplement This interface is not intended to be implemented by clients.
*/
public interface IASTNullStatement extends IASTStatement {
-
/**
* @since 5.1
*/
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTPreprocessorMacroExpansion.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTPreprocessorMacroExpansion.java
index 0c9824df7d7..c4c1c371ca8 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTPreprocessorMacroExpansion.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTPreprocessorMacroExpansion.java
@@ -6,7 +6,7 @@
* 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.core.dom.ast;
@@ -20,9 +20,9 @@ package org.eclipse.cdt.core.dom.ast;
public interface IASTPreprocessorMacroExpansion extends IASTNode {
public static final IASTPreprocessorMacroExpansion[] EMPTY_ARRAY = {};
public static final ASTNodeProperty EXPANSION_NAME=
- new ASTNodeProperty("IASTPreprocessorMacroExpansion.EXPANSION_NAME - macro name"); //$NON-NLS-1$
+ new ASTNodeProperty("IASTPreprocessorMacroExpansion.EXPANSION_NAME - macro name"); //$NON-NLS-1$
public static final ASTNodeProperty NESTED_EXPANSION_NAME=
- new ASTNodeProperty("IASTPreprocessorMacroExpansion.NESTED_EXPANSION_NAME - nested macro name"); //$NON-NLS-1$
+ new ASTNodeProperty("IASTPreprocessorMacroExpansion.NESTED_EXPANSION_NAME - nested macro name"); //$NON-NLS-1$
/**
* Returns the macro definition used for the expansion.
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTTranslationUnit.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTTranslationUnit.java
index 36db4a9af0e..05d283d8ef5 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTTranslationUnit.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTTranslationUnit.java
@@ -254,24 +254,22 @@ public interface IASTTranslationUnit extends IASTDeclarationListOwner, IFileNomi
/**
* Return the set of files that have been skipped because they have been part of the index
* prior to creating this AST, or
* NOTE: Indirectly called from background thread by UI runnable.
*
* NOTE: Allowed to be used by {@link SemanticHighlightingReconciler} only.
* null
if not available.
- * Applies only, if AST was created with an index and the option to skip headers found in the
- * index.
+ * Applies only, if AST was created with an index and the option to skip headers found in
+ * the index.
* @since 5.1
*/
IIndexFileSet getIndexFileSet();
/**
- * Return the set of files in the index that are superseded by this AST,
- * or null
if not available.
- * Applies only, if AST was created with an index.
+ * Return the set of files in the index that are superseded by this AST, or null
+ * if not available. Applies only, if AST was created with an index.
* @since 5.3
*/
IIndexFileSet getASTFileSet();
/**
- * In case the AST was created in a way that supports comment parsing,
- * all comments of the translation unit are returned. Otherwise an
- * empty array will be supplied.
+ * In case the AST was created in a way that supports comment parsing, all comments of
+ * the translation unit are returned. Otherwise an empty array will be supplied.
*
* @return IASTComment[]
* @since 4.0
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/ILocationCtx.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/ILocationCtx.java
index 2d9ac67ff07..ba19de1eeb3 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/ILocationCtx.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/ILocationCtx.java
@@ -6,9 +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.parser.scanner;
/**
@@ -18,7 +17,6 @@ package org.eclipse.cdt.internal.core.parser.scanner;
* @since 5.0
*/
public interface ILocationCtx {
-
/**
* If this is a file context the filename of this context is returned,
* otherwise the filename of the first enclosing context that is a file context is returned.
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/ILocationResolver.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/ILocationResolver.java
index c71cd61ce5c..b0a58f4fc8c 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/ILocationResolver.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/ILocationResolver.java
@@ -6,8 +6,8 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * IBM - Initial API and implementation
- * Markus Schorn (Wind River Systems)
+ * IBM - Initial API and implementation
+ * Markus Schorn (Wind River Systems)
*******************************************************************************/
package org.eclipse.cdt.internal.core.parser.scanner;
@@ -23,20 +23,19 @@ import org.eclipse.cdt.core.dom.ast.IASTPreprocessorMacroExpansion;
import org.eclipse.cdt.core.dom.ast.IASTPreprocessorStatement;
import org.eclipse.cdt.core.dom.ast.IASTProblem;
import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit;
-import org.eclipse.cdt.core.dom.ast.IMacroBinding;
import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit.IDependencyTree;
+import org.eclipse.cdt.core.dom.ast.IMacroBinding;
import org.eclipse.cdt.internal.core.dom.parser.ASTNodeSpecification;
import org.eclipse.cdt.internal.core.parser.scanner.Lexer.LexerOptions;
-
/**
- * Interface between the ast and the location-resolver for resolving offsets.
+ * Interface between the AST and the location-resolver for resolving offsets.
* @since 5.0
*/
public interface ILocationResolver {
/**
- * Introduces the ast translation unit to the location resolver. Must be called before any tokens from the
- * scanner are obtained.
+ * Introduces the AST translation unit to the location resolver. Must be called before any
+ * tokens from the scanner are obtained.
*/
void setRootNode(IASTTranslationUnit tu);
@@ -103,15 +102,17 @@ public interface ILocationResolver {
/**
* Returns the smallest file location, that encloses the given global range. In case the range
* spans over multiple files, the files are mapped to include statements until all of them are
- * found in the same file. So the resulting location contains the include directives that actually
- * cause the range to be part of the AST.
+ * found in the same file. So the resulting location contains the include directives that
+ * actually cause the range to be part of the AST.
* @param offset sequence number as stored in the ASTNodes.
* @param length
*/
IASTFileLocation getMappedFileLocation(int offset, int length);
/**
- * Returns an array of locations. This is a sequence of file locations and macro-expansion locations.
+ * Returns an array of locations. This is a sequence of file locations and macro-expansion
+ * locations.
+ *
* @param offset sequence number as stored in the ast nodes.
* @param length
* @return and array of locations.
@@ -124,8 +125,8 @@ public interface ILocationResolver {
IASTImageLocation getImageLocation(int offset, int length);
/**
- * Returns the sequence-number for the given file-path and offset, or -1
if this file
- * is not part of the translation-unit.
+ * Returns the sequence-number for the given file-path and offset, or -1
if this
+ * file is not part of the translation-unit.
* @param filePath a file path or null
to specify the root of the translation unit.
* @param fileOffset an offset into the source of the file, or -1
.
*/
@@ -158,7 +159,8 @@ public interface ILocationResolver {
boolean isPartOfSourceFile(int sequenceNumber);
/**
- * Same as {@link #getMappedFileLocation(int, int)} for the given array of consecutive node locations.
+ * Same as {@link #getMappedFileLocation(int, int)} for the given array of consecutive node
+ * locations.
*/
IASTFileLocation flattenLocations(IASTNodeLocation[] nodeLocations);
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/ImageLocationInfo.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/ImageLocationInfo.java
index 5460a50dd8f..a822c2fe0ab 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/ImageLocationInfo.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/ImageLocationInfo.java
@@ -6,7 +6,7 @@
* 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.parser.scanner;
@@ -15,13 +15,13 @@ import org.eclipse.cdt.core.dom.ast.IASTImageLocation;
import org.eclipse.cdt.core.dom.ast.IASTPreprocessorMacroDefinition;
/**
- * Information needed for computing image-locations. An image location exists for a name and describes where the name
- * came from. This can be: source code, macro-expansion, parameter to macro-expansion or synthetic.
+ * Information needed for computing image-locations. An image location exists for a name and
+ * describes where the name came from. This can be: source code, macro-expansion, parameter to
+ * macro-expansion or synthetic.
*
* @since 5.0
*/
public abstract class ImageLocationInfo {
-
public static final ImageLocationInfo[] NO_LOCATION_INFOS= {};
int fTokenOffsetInExpansion= -1;
@@ -33,6 +33,7 @@ public abstract class ImageLocationInfo {
private final ObjectStyleMacro fMacro;
private final int fOffset;
private final int fEndOffset;
+
public MacroImageLocationInfo(ObjectStyleMacro macro, int offset, int endOffset) {
fMacro= macro;
fOffset= offset;
@@ -66,14 +67,16 @@ public abstract class ImageLocationInfo {
public static class ParameterImageLocationInfo extends ImageLocationInfo {
public int fSequenceNumber;
public int fSequenceEndNumber;
+
public ParameterImageLocationInfo(int sequenceNumber, int sequenceEndNumber) {
fSequenceNumber= sequenceNumber;
fSequenceEndNumber= sequenceEndNumber;
}
+
@Override
public IASTImageLocation createLocation(LocationMap lm, ImageLocationInfo upto) {
int sequenceEnd= ((ParameterImageLocationInfo) upto).fSequenceEndNumber;
- IASTFileLocation loc= lm.getMappedFileLocation(fSequenceNumber, sequenceEnd-fSequenceNumber);
+ IASTFileLocation loc= lm.getMappedFileLocation(fSequenceNumber, sequenceEnd - fSequenceNumber);
if (loc != null) {
return new ASTImageLocation(IASTImageLocation.ARGUMENT_TO_MACRO_EXPANSION,
loc.getFileName(), loc.getNodeOffset(), loc.getNodeLength());
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/InactiveCodeToken.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/InactiveCodeToken.java
index f6d303c4c6e..48d3a6a836e 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/InactiveCodeToken.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/InactiveCodeToken.java
@@ -6,7 +6,7 @@
* 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.parser.scanner;
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/LocationCtx.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/LocationCtx.java
index 00125a9e335..fee6a0479b0 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/LocationCtx.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/LocationCtx.java
@@ -7,7 +7,7 @@
*
* Contributors:
* Markus Schorn - initial API and implementation
- *******************************************************************************/
+ *******************************************************************************/
package org.eclipse.cdt.internal.core.parser.scanner;
import java.util.ArrayList;
@@ -19,7 +19,7 @@ import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit.IDependencyTree.IASTIncl
/**
* Various location contexts which are suitable for interpreting local offsets. These offsets are
- * converted in a global sequence-number to make all ast nodes comparable with each other.
+ * converted in a global sequence-number to make all AST nodes comparable with each other.
* @since 5.0
*/
abstract class LocationCtx implements ILocationCtx {
@@ -29,11 +29,13 @@ abstract class LocationCtx implements ILocationCtx {
*/
final int fSequenceNumber;
/**
- * The offset of the denotation of this context in the parent's source. This is no sequence number.
+ * The offset of the denotation of this context in the parent's source. This is no sequence
+ * number.
*/
final int fOffsetInParent;
/**
- * The end-offset of the denotation of this context in the parent's source. This is no sequence number.
+ * The end-offset of the denotation of this context in the parent's source. This is no sequence
+ * number.
*/
final int fEndOffsetInParent;
@@ -46,40 +48,41 @@ abstract class LocationCtx implements ILocationCtx {
parent.addChild(this);
}
}
-
+
@Override
public String getFilePath() {
return fParent.getFilePath();
}
-
+
@Override
final public ILocationCtx getParent() {
return fParent;
}
+
/**
* Returns the amount of sequence numbers occupied by this context including its children.
*/
public abstract int getSequenceLength();
-
+
/**
- * Converts an offset within this context to the sequence number. In case there are child-contexts
- * behind the given offset, you need to set checkChildren to true
.
+ * Converts an offset within this context to the sequence number. In case there are
+ * child-contexts behind the given offset, you need to set checkChildren to true
.
*/
public int getSequenceNumberForOffset(int offset, boolean checkChildren) {
return fSequenceNumber+offset;
}
/**
- * When a child-context is finished it reports its total sequence length, such that offsets in this
- * context can be converted to sequence numbers.
+ * When a child-context is finished it reports its total sequence length, such that offsets in
+ * this context can be converted to sequence numbers.
*/
public void addChildSequenceLength(int childLength) {
assert false;
}
-
+
/**
- * Returns the line number for an offset within this context. Not all contexts support line numbers,
- * so this may return 0.
+ * Returns the line number for an offset within this context. Not all contexts support line
+ * numbers, so this may return 0.
*/
public int getLineNumber(int offset) {
return 0;
@@ -109,7 +112,7 @@ abstract class LocationCtx implements ILocationCtx {
}
/**
- * Returns the minimal file location containing the specified sequence number range, assuming
+ * Returns the minimal file location containing the specified sequence number range, assuming
* that it is contained in this context.
*/
public ASTFileLocation findMappedFileLocation(int sequenceNumber, int length) {
@@ -124,8 +127,8 @@ abstract class LocationCtx implements ILocationCtx {
}
/**
- * Returns the sequence of file locations spanning the given range.
- * Assumes that the range starts within this context.
+ * Returns the sequence of file locations spanning the given range.
+ * Assumes that the range starts within this context.
*/
public abstract boolean collectLocations(int sequenceNumber, int length, ArrayListnull
.
+ * Support for the dependency tree, returns inclusion statement that created this context,
+ * or null
.
*/
@Override
public ASTInclusionStatement getInclusionStatement() {
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/LocationCtxContainer.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/LocationCtxContainer.java
index ab7420409ee..6323e537149 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/LocationCtxContainer.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/LocationCtxContainer.java
@@ -35,7 +35,8 @@ class LocationCtxContainer extends LocationCtx {
private AbstractCharArray fSource;
private int[] fLineOffsets;
- public LocationCtxContainer(LocationCtxContainer parent, AbstractCharArray source, int parentOffset, int parentEndOffset, int sequenceNumber) {
+ public LocationCtxContainer(LocationCtxContainer parent, AbstractCharArray source,
+ int parentOffset, int parentEndOffset, int sequenceNumber) {
super(parent, parentOffset, parentEndOffset, sequenceNumber);
fSource= source;
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/LocationCtxMacroExpansion.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/LocationCtxMacroExpansion.java
index ad3fe391019..d94e229e8fb 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/LocationCtxMacroExpansion.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/LocationCtxMacroExpansion.java
@@ -79,7 +79,7 @@ class LocationCtxMacroExpansion extends LocationCtx {
if (length == 0) {
return null;
}
- final int end= offset+length;
+ final int end= offset + length;
int nextToCheck= offset;
ImageLocationInfo firstInfo= null;
ImageLocationInfo lastInfo= null;
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/MacroDefinitionParser.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/MacroDefinitionParser.java
index a680925689f..15221454f32 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/MacroDefinitionParser.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/MacroDefinitionParser.java
@@ -152,7 +152,7 @@ public class MacroDefinitionParser {
if (length > 0) {
char[] lastParam= paramList[length-1];
final int lpl = lastParam.length;
- switch(lpl) {
+ switch (lpl) {
case 0: case 1: case 2:
break;
case 3:
@@ -258,7 +258,7 @@ public class MacroDefinitionParser {
fExpansionOffset= fExpansionEndOffset= candidate.getOffset();
loop: while(true) {
- switch(candidate.getType()) {
+ switch (candidate.getType()) {
case IToken.tCOMPLETION:
throw new OffsetLimitReachedException(ORIGIN_PREPROCESSOR_DIRECTIVE, candidate);
case IToken.tEND_OF_INPUT:
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/MacroExpander.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/MacroExpander.java
index a6f1b990b95..6a71053d6aa 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/MacroExpander.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/MacroExpander.java
@@ -6,7 +6,7 @@
* 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.parser.scanner;
@@ -139,7 +139,8 @@ public class MacroExpander {
private ScannerContext fReportMacros;
private boolean fReportUndefined;
- public MacroExpander(ILexerLog log, CharArrayMap"org.eclipse.cdt.ui.edit.text.c.toggle.comment"
).
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/SemanticHighlightingManager.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/SemanticHighlightingManager.java
index e963a0b8970..ac1f51fa19b 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/SemanticHighlightingManager.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/SemanticHighlightingManager.java
@@ -1,15 +1,14 @@
/*******************************************************************************
- * Copyright (c) 2000, 2012 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
+ * Copyright (c) 2000, 2012 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
*
- * Contributors:
+ * Contributors:
* IBM Corporation - initial API and implementation
* Anton Leherbauer (Wind River Systems) - Adapted for CDT
*******************************************************************************/
-
package org.eclipse.cdt.internal.ui.editor;
import java.util.ArrayList;
@@ -42,12 +41,10 @@ import org.eclipse.cdt.internal.ui.text.CSourceViewerScalableConfiguration;
* @since 4.0
*/
public class SemanticHighlightingManager implements IPropertyChangeListener {
-
/**
* Highlighting style.
*/
public static class HighlightingStyle {
-
/** Text attribute */
private TextAttribute fTextAttribute;
/** Enabled state */
@@ -96,7 +93,6 @@ public class SemanticHighlightingManager implements IPropertyChangeListener {
* Highlighted Positions.
*/
public static class HighlightedPosition extends Position {
-
/** Highlighting of the position */
private HighlightingStyle fStyle;
@@ -169,9 +165,6 @@ public class SemanticHighlightingManager implements IPropertyChangeListener {
}
}
- /*
- * @see org.eclipse.jface.text.Position#setLength(int)
- */
@Override
public void setLength(int length) {
synchronized (fLock) {
@@ -179,9 +172,6 @@ public class SemanticHighlightingManager implements IPropertyChangeListener {
}
}
- /*
- * @see org.eclipse.jface.text.Position#setOffset(int)
- */
@Override
public void setOffset(int offset) {
synchronized (fLock) {
@@ -189,9 +179,6 @@ public class SemanticHighlightingManager implements IPropertyChangeListener {
}
}
- /*
- * @see org.eclipse.jface.text.Position#delete()
- */
@Override
public void delete() {
synchronized (fLock) {
@@ -199,9 +186,6 @@ public class SemanticHighlightingManager implements IPropertyChangeListener {
}
}
- /*
- * @see org.eclipse.jface.text.Position#undelete()
- */
@Override
public void undelete() {
synchronized (fLock) {
@@ -314,14 +298,16 @@ public class SemanticHighlightingManager implements IPropertyChangeListener {
}
/**
- * Install the semantic highlighting on the given source viewer infrastructure. No reconciliation will be performed.
+ * Installs the semantic highlighting on the given source viewer infrastructure.
+ * No reconciliation will be performed.
*
* @param sourceViewer the source viewer
* @param colorManager the color manager
* @param preferenceStore the preference store
* @param hardcodedRanges the hard-coded ranges to be highlighted
*/
- public void install(CSourceViewer sourceViewer, IColorManager colorManager, IPreferenceStore preferenceStore, HighlightedRange[][] hardcodedRanges) {
+ public void install(CSourceViewer sourceViewer, IColorManager colorManager,
+ IPreferenceStore preferenceStore, HighlightedRange[][] hardcodedRanges) {
fHardcodedRanges= hardcodedRanges;
install(null, sourceViewer, colorManager, preferenceStore);
}
@@ -383,7 +369,7 @@ public class SemanticHighlightingManager implements IPropertyChangeListener {
}
/**
- * Uninstall the semantic highlighting
+ * Uninstalls the semantic highlighting
*/
public void uninstall() {
disable();
@@ -402,7 +388,7 @@ public class SemanticHighlightingManager implements IPropertyChangeListener {
}
/**
- * Disable semantic highlighting.
+ * Disables semantic highlighting.
*/
private void disable() {
if (fReconciler != null) {
@@ -427,7 +413,7 @@ public class SemanticHighlightingManager implements IPropertyChangeListener {
}
/**
- * Initialize semantic highlightings.
+ * Initializes semantic highlightings.
*/
protected void initializeHighlightings() {
fSemanticHighlightings= SemanticHighlightings.getSemanticHighlightings();
@@ -460,7 +446,7 @@ public class SemanticHighlightingManager implements IPropertyChangeListener {
}
/**
- * Dispose the semantic highlightings.
+ * Disposes the semantic highlightings.
*/
protected void disposeHighlightings() {
for (int i= 0, n= fSemanticHighlightings.length; i < n; i++)
@@ -470,9 +456,6 @@ public class SemanticHighlightingManager implements IPropertyChangeListener {
fHighlightings= null;
}
- /*
- * @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
- */
@Override
public void propertyChange(PropertyChangeEvent event) {
handlePropertyChangeEvent(event);
@@ -626,7 +609,7 @@ public class SemanticHighlightingManager implements IPropertyChangeListener {
}
/**
- * Force refresh of highlighting.
+ * Forces refresh of highlighting.
*/
public void refresh() {
if (fReconciler != null) {
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/SemanticHighlightingPresenter.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/SemanticHighlightingPresenter.java
index e41d7c46981..f194ff0c1b7 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/SemanticHighlightingPresenter.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/SemanticHighlightingPresenter.java
@@ -9,7 +9,6 @@
* IBM Corporation - initial API and implementation
* Anton Leherbauer (Wind River Systems) - Adapted for CDT
*******************************************************************************/
-
package org.eclipse.cdt.internal.ui.editor;
import java.util.ArrayList;
@@ -37,7 +36,6 @@ import org.eclipse.cdt.internal.ui.editor.SemanticHighlightingManager.Highlighte
import org.eclipse.cdt.internal.ui.editor.SemanticHighlightingManager.HighlightingStyle;
import org.eclipse.cdt.internal.ui.text.CPresentationReconciler;
-
/**
* Semantic highlighting presenter - UI thread implementation.
* Cloned from JDT.
@@ -45,12 +43,10 @@ import org.eclipse.cdt.internal.ui.text.CPresentationReconciler;
* @since 4.0
*/
public class SemanticHighlightingPresenter implements ITextPresentationListener, ITextInputListener, IDocumentListener {
-
/**
* Semantic highlighting position updater.
*/
private class HighlightingPositionUpdater implements IPositionUpdater {
-
/** The position category. */
private final String fCategory;
@@ -63,12 +59,8 @@ public class SemanticHighlightingPresenter implements ITextPresentationListener,
fCategory= category;
}
- /*
- * @see org.eclipse.jface.text.IPositionUpdater#update(org.eclipse.jface.text.DocumentEvent)
- */
@Override
public void update(DocumentEvent event) {
-
int eventOffset= event.getOffset();
int eventOldLength= event.getLength();
int eventEnd= eventOffset + eventOldLength;
@@ -77,10 +69,10 @@ public class SemanticHighlightingPresenter implements ITextPresentationListener,
Position[] positions= event.getDocument().getPositions(fCategory);
for (int i= 0; i != positions.length; i++) {
-
HighlightedPosition position= (HighlightedPosition) positions[i];
- // Also update deleted positions because they get deleted by the background thread and removed/invalidated only in the UI runnable
+ // Also update deleted positions because they get deleted by the background
+ // thread and removed/invalidated only in the UI runnable.
// if (position.isDeleted())
// continue;
@@ -88,18 +80,19 @@ public class SemanticHighlightingPresenter implements ITextPresentationListener,
int length= position.getLength();
int end= offset + length;
- if (offset > eventEnd)
+ if (offset > eventEnd) {
updateWithPrecedingEvent(position, event);
- else if (end < eventOffset)
+ } else if (end < eventOffset) {
updateWithSucceedingEvent(position, event);
- else if (offset <= eventOffset && end >= eventEnd)
+ } else if (offset <= eventOffset && end >= eventEnd) {
updateWithIncludedEvent(position, event);
- else if (offset <= eventOffset)
+ } else if (offset <= eventOffset) {
updateWithOverEndEvent(position, event);
- else if (end >= eventEnd)
+ } else if (end >= eventEnd) {
updateWithOverStartEvent(position, event);
- else
+ } else {
updateWithIncludingEvent(position, event);
+ }
}
} catch (BadPositionCategoryException e) {
// ignore and return
@@ -107,7 +100,7 @@ public class SemanticHighlightingPresenter implements ITextPresentationListener,
}
/**
- * Update the given position with the given event. The event precedes the position.
+ * Updates the given position with the given event. The event precedes the position.
*
* @param position The position
* @param event The event
@@ -121,7 +114,7 @@ public class SemanticHighlightingPresenter implements ITextPresentationListener,
}
/**
- * Update the given position with the given event. The event succeeds the position.
+ * Updates the given position with the given event. The event succeeds the position.
*
* @param position The position
* @param event The event
@@ -130,7 +123,7 @@ public class SemanticHighlightingPresenter implements ITextPresentationListener,
}
/**
- * Update the given position with the given event. The event is included by the position.
+ * Updates the given position with the given event. The event is included by the position.
*
* @param position The position
* @param event The event
@@ -151,9 +144,9 @@ public class SemanticHighlightingPresenter implements ITextPresentationListener,
int includedLength= 0;
while (includedLength < eventNewLength && Character.isJavaIdentifierPart(newText.charAt(includedLength)))
includedLength++;
- if (includedLength == eventNewLength)
+ if (includedLength == eventNewLength) {
position.setLength(length + deltaLength);
- else {
+ } else {
int newLeftLength= eventOffset - offset + includedLength;
int excludedLength= eventNewLength;
@@ -176,7 +169,8 @@ public class SemanticHighlightingPresenter implements ITextPresentationListener,
}
/**
- * Update the given position with the given event. The event overlaps with the end of the position.
+ * Updates the given position with the given event. The event overlaps with the end of
+ * the position.
*
* @param position The position
* @param event The event
@@ -194,7 +188,8 @@ public class SemanticHighlightingPresenter implements ITextPresentationListener,
}
/**
- * Update the given position with the given event. The event overlaps with the start of the position.
+ * Updates the given position with the given event. The event overlaps with the start of
+ * the position.
*
* @param position The position
* @param event The event
@@ -353,12 +348,14 @@ public class SemanticHighlightingPresenter implements ITextPresentationListener,
}
/**
- * Invalidate the presentation of the positions based on the given added positions and the existing deleted positions.
- * Also unregisters the deleted positions from the document and patches the positions of this presenter.
+ * Invalidates the presentation of the positions based on the given added positions and
+ * the existing deleted positions. Also unregisters the deleted positions from the document
+ * and patches the positions of this presenter.
* null
, if the presentation should computed in the UI thread
+ * @param textPresentation the text presentation or null
, if the presentation
+ * should computed in the UI thread
* @param addedPositions the added positions
* @param removedPositions the removed positions
*/
@@ -398,7 +395,8 @@ public class SemanticHighlightingPresenter implements ITextPresentationListener,
ListfPositions
, s.t. the offsets remain in linear order.
+ * Inserts the given position in fPositions
, s.t. the offsets remain in linear order.
*
* @param position The position for insertion
*/
@@ -540,13 +538,11 @@ public class SemanticHighlightingPresenter implements ITextPresentationListener,
return j;
}
- /*
- * @see org.eclipse.jface.text.ITextPresentationListener#applyTextPresentation(org.eclipse.jface.text.TextPresentation)
- */
@Override
public void applyTextPresentation(TextPresentation textPresentation) {
IRegion region= textPresentation.getExtent();
- int i= computeIndexAtOffset(fPositions, region.getOffset()), n= computeIndexAtOffset(fPositions, region.getOffset() + region.getLength());
+ int i= computeIndexAtOffset(fPositions, region.getOffset());
+ int n= computeIndexAtOffset(fPositions, region.getOffset() + region.getLength());
if (n - i > 2) {
List