1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Cosmetics.

This commit is contained in:
Sergey Prigogin 2012-04-07 23:32:14 -07:00
parent 1d9c709b88
commit 36442384d4
12 changed files with 46 additions and 86 deletions

View file

@ -17,7 +17,6 @@ package org.eclipse.cdt.core.dom.ast;
* @noimplement This interface is not intended to be implemented by clients.
*/
public interface IASTExpressionList extends IASTExpression {
/**
* <code>NESTED_EXPRESSION</code> describes the relationship between
* <code>IASTExpressionList</code> and the nested
@ -29,7 +28,7 @@ public interface IASTExpressionList extends IASTExpression {
/**
* Get nested expressions.
*
* @return <code>IASTExpression [] </code> nested expressions
* @return <code>IASTExpression[] </code> nested expressions
*/
public IASTExpression[] getExpressions();

View file

@ -6,7 +6,7 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Doug Schaefer (IBM) - Initial API and implementation
* Doug Schaefer (IBM) - Initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.core.dom.ast;
@ -19,7 +19,6 @@ package org.eclipse.cdt.core.dom.ast;
*/
@Deprecated
public interface IASTInitializerExpression extends IASTEqualsInitializer {
/**
* <code>INITIALIZER_EXPRESSION</code> represents the relationship between
* an <code>IASTInitializerExpression</code>. and its <code></code>IASTExpression</code>.

View file

@ -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;
@ -24,8 +24,8 @@ public interface IValue {
Long numericalValue();
/**
* Returns an internal representation of the expression that builds up the
* value. It is suitable for instantiating dependent values but may not be
* Returns an internal representation of the expression that builds up
* the value. It is suitable for instantiating dependent values but may not be
* used for the purpose of displaying values.
*/
char[] getInternalExpression();
@ -37,8 +37,8 @@ public interface IValue {
IBinding[] getUnknownBindings();
/**
* Returns a signature containing both the internal representation and the
* unknown bindings. The representation is sufficient to distinguish values
* Returns a signature containing both the internal representation and
* the unknown bindings. The representation is sufficient to distinguish values
* for the purpose of instantiation, it may not be used to display the value.
*/
char[] getSignature();

View file

@ -30,7 +30,6 @@ import org.eclipse.cdt.internal.core.parser.scanner.Lexer;
* @noimplement This interface is not intended to be implemented by clients.
*/
public interface IScanner {
/**
* Returns a map from {@link String} to {@link IMacroBinding} containing
* all the definitions that are defined at the current point in the

View file

@ -20,9 +20,8 @@ import org.eclipse.cdt.core.dom.ast.IASTNode;
/**
* Initializer with equals sign (copy initialization)
*/
public abstract class ASTEqualsInitializer extends ASTNode implements IASTEqualsInitializer,
IASTAmbiguityParent {
public abstract class ASTEqualsInitializer extends ASTNode
implements IASTEqualsInitializer, IASTAmbiguityParent {
private IASTInitializerClause fArgument;
public ASTEqualsInitializer() {

View file

@ -181,7 +181,6 @@ public abstract class AbstractGNUSourceCodeParser implements ISourceCodeParser {
protected boolean functionCallCanBeLValue= false;
protected boolean skipTrivialExpressionsInAggregateInitializers= false;
/**
* Marks the beginning of the current declaration. It is important to clear the mark whenever we
@ -2122,7 +2121,6 @@ public abstract class AbstractGNUSourceCodeParser implements ISourceCodeParser {
}
}
protected IASTStatement parseCompoundStatement() throws EndOfFileException, BacktrackException {
IASTCompoundStatement compound = compoundStatement();
return compound;
@ -2501,7 +2499,6 @@ public abstract class AbstractGNUSourceCodeParser implements ISourceCodeParser {
}
protected boolean canBeTypeSpecifier() throws EndOfFileException {
final int lt1 = LT(1);
switch (lt1) {
// simple type specifiers:

View file

@ -17,7 +17,6 @@ import org.eclipse.cdt.core.dom.ast.INodeFactory;
* Abstract base class for node factories.
*/
public abstract class NodeFactory implements INodeFactory {
@Override
public final void setOffsets(IASTNode node, int offset, int endOffset) {
((ASTNode) node).setOffsetAndLength(offset, endOffset-offset);

View file

@ -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.dom.parser.c;
@ -29,13 +29,11 @@ import org.eclipse.core.runtime.Assert;
* @since 5.0.1
*/
public class CASTAmbiguousDeclarator extends ASTAmbiguousNode implements IASTAmbiguousDeclarator {
private IASTDeclarator[] dtors = new IASTDeclarator[2];
private int dtorPos=-1;
private int dtorPos= -1;
public CASTAmbiguousDeclarator(IASTDeclarator... decls) {
for(IASTDeclarator d : decls) {
for (IASTDeclarator d : decls) {
if (d != null) {
addDeclarator(d);
}
@ -63,7 +61,7 @@ public class CASTAmbiguousDeclarator extends ASTAmbiguousNode implements IASTAmb
@Override
public IASTDeclarator[] getDeclarators() {
dtors = ArrayUtil.trimAt(IASTDeclarator.class, dtors, dtorPos );
dtors = ArrayUtil.trimAt(IASTDeclarator.class, dtors, dtorPos);
return dtors;
}

View file

@ -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.dom.parser.cpp;
@ -29,15 +29,14 @@ import org.eclipse.core.runtime.Assert;
* <br>
* Example: void f(int (D)); // is D a type?
*/
public class CPPASTAmbiguousDeclarator extends ASTAmbiguousNode implements IASTAmbiguousDeclarator, ICPPASTDeclarator {
public class CPPASTAmbiguousDeclarator extends ASTAmbiguousNode
implements IASTAmbiguousDeclarator, ICPPASTDeclarator {
private IASTDeclarator[] dtors = new IASTDeclarator[2];
private int dtorPos=-1;
private int dtorPos= -1;
private IASTInitializer fInitializer;
public CPPASTAmbiguousDeclarator(IASTDeclarator... decls) {
for(IASTDeclarator d : decls) {
for (IASTDeclarator d : decls) {
if (d != null) {
addDeclarator(d);
}

View file

@ -6,9 +6,9 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM - Initial API and implementation
* Anton Leherbauer (Wind River Systems)
* Markus Schorn (Wind River Systems)
* IBM - Initial API and implementation
* Anton Leherbauer (Wind River Systems)
* Markus Schorn (Wind River Systems)
*******************************************************************************/
package org.eclipse.cdt.internal.core.dom.parser.cpp;
@ -16,7 +16,7 @@ import org.eclipse.cdt.core.dom.ast.ASTVisitor;
import org.eclipse.cdt.internal.core.dom.parser.ASTProblem;
/**
* cpp-specific implementation allows actions to visit the problem.
* C++-specific implementation allows actions to visit the problem.
*/
public class CPPASTProblem extends ASTProblem {
@ -41,19 +41,19 @@ public class CPPASTProblem extends ASTProblem {
}
@Override
public boolean accept( ASTVisitor action ){
if( action.shouldVisitProblems ){
switch( action.visit( this ) ){
case ASTVisitor.PROCESS_ABORT : return false;
case ASTVisitor.PROCESS_SKIP : return true;
default : break;
public boolean accept(ASTVisitor action) {
if (action.shouldVisitProblems) {
switch (action.visit(this)) {
case ASTVisitor.PROCESS_ABORT: return false;
case ASTVisitor.PROCESS_SKIP: return true;
default: break;
}
}
if( action.shouldVisitProblems ){
switch( action.leave( this ) ){
case ASTVisitor.PROCESS_ABORT : return false;
case ASTVisitor.PROCESS_SKIP : return true;
default : break;
if (action.shouldVisitProblems) {
switch (action.leave(this)) {
case ASTVisitor.PROCESS_ABORT: return false;
case ASTVisitor.PROCESS_SKIP: return true;
default: break;
}
}
return true;

View file

@ -51,7 +51,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.ICReconcilingListener;
/**
* Semantic highlighting reconciler - Background thread implementation.
* Cloned from JDT.
@ -59,12 +58,10 @@ import org.eclipse.cdt.internal.ui.text.ICReconcilingListener;
* @since 4.0
*/
public class SemanticHighlightingReconciler implements ICReconcilingListener {
/**
* Collects positions from the AST.
*/
private class PositionCollector extends ASTVisitor {
/** The semantic token */
private SemanticToken fToken= new SemanticToken();
private int fMinLocation;
@ -82,12 +79,8 @@ public class SemanticHighlightingReconciler implements ICReconcilingListener {
shouldVisitImplicitNameAlternates = visitImplicitNames;
}
/*
* @see org.eclipse.cdt.core.dom.ast.ASTVisitor#visit(org.eclipse.cdt.core.dom.ast.IASTTranslationUnit)
*/
@Override
public int visit(IASTTranslationUnit tu) {
// visit macro definitions
IASTPreprocessorMacroDefinition[] macroDefs= tu.getMacroDefinitions();
for (IASTPreprocessorMacroDefinition macroDef : macroDefs) {
@ -115,9 +108,6 @@ public class SemanticHighlightingReconciler implements ICReconcilingListener {
return super.visit(tu);
}
/*
* @see org.eclipse.cdt.core.dom.ast.ASTVisitor#visit(org.eclipse.cdt.core.dom.ast.IASTDeclaration)
*/
@Override
public int visit(IASTDeclaration declaration) {
if (!declaration.isPartOfTranslationUnitFile()) {
@ -126,9 +116,6 @@ public class SemanticHighlightingReconciler implements ICReconcilingListener {
return PROCESS_CONTINUE;
}
/*
* @see org.eclipse.cdt.core.dom.ast.ASTVisitor#leave(org.eclipse.cdt.core.dom.ast.IASTDeclaration)
*/
@Override
public int leave(IASTDeclaration declaration) {
// if (!shouldVisitCatchHandlers && declaration instanceof IASTFunctionDefinition) {
@ -154,9 +141,6 @@ public class SemanticHighlightingReconciler implements ICReconcilingListener {
return PROCESS_CONTINUE;
}
/*
* @see org.eclipse.cdt.core.dom.ast.ASTVisitor#visit(org.eclipse.cdt.core.dom.ast.IASTDeclarator)
*/
@Override
public int visit(IASTDeclarator declarator) {
// if (declarator instanceof ICPPASTFunctionTryBlockDeclarator) {
@ -165,9 +149,6 @@ public class SemanticHighlightingReconciler implements ICReconcilingListener {
return PROCESS_CONTINUE;
}
/*
* @see org.eclipse.cdt.core.dom.ast.ASTVisitor#visit(org.eclipse.cdt.core.dom.ast.IASTStatement)
*/
@Override
public int visit(IASTStatement statement) {
// if (!shouldVisitCatchHandlers && statement instanceof ICPPASTCatchHandler) {
@ -176,9 +157,6 @@ public class SemanticHighlightingReconciler implements ICReconcilingListener {
return PROCESS_CONTINUE;
}
/*
* @see org.eclipse.cdt.core.dom.ast.ASTVisitor#visit(org.eclipse.cdt.core.dom.ast.IASTName)
*/
@Override
public int visit(IASTName name) {
if (visitNode(name)) {
@ -226,7 +204,7 @@ public class SemanticHighlightingReconciler implements ICReconcilingListener {
}
}
} else {
// fallback in case no image location available
// Fallback in case no image location available
IASTNodeLocation[] nodeLocations= name.getNodeLocations();
if (nodeLocations.length == 1 && !(nodeLocations[0] instanceof IASTMacroExpansionLocation)) {
addNodeLocation(nodeLocations[0], highlightingStyle);
@ -319,20 +297,14 @@ public class SemanticHighlightingReconciler implements ICReconcilingListener {
/** Highlightings - cache for background thread, only valid during {@link #reconciled(IASTTranslationUnit, boolean, IProgressMonitor)} */
private HighlightingStyle[] fJobHighlightings;
/*
* @see org.eclipse.cdt.internal.ui.text.java.ICReconcilingListener#aboutToBeReconciled()
*/
@Override
public void aboutToBeReconciled() {
// Do nothing
}
/*
* @see org.eclipse.cdt.internal.ui.text.ICReconcilingListener#reconciled(IASTTranslationUnit, boolean, IProgressMonitor)
*/
@Override
public void reconciled(IASTTranslationUnit ast, boolean force, IProgressMonitor progressMonitor) {
// ensure at most one thread can be reconciling at any time
// Ensure at most one thread can be reconciling at any time
synchronized (fReconcileLock) {
if (fIsReconciling)
return;
@ -397,8 +369,8 @@ public class SemanticHighlightingReconciler implements ICReconcilingListener {
/**
* Reconcile positions based on the AST.
*
* @param ast the AST
* @param visitor the AST visitor
* @param ast the AST
* @param visitor the AST visitor
*/
private void reconcilePositions(IASTTranslationUnit ast, PositionCollector visitor) {
ast.accept(visitor);
@ -410,12 +382,13 @@ public class SemanticHighlightingReconciler implements ICReconcilingListener {
newPositions.add(current);
}
fRemovedPositions= newPositions;
// positions need to be sorted by ascending offset
// Positions need to be sorted by ascending offset
Collections.sort(fAddedPositions, new Comparator<Position>() {
@Override
public int compare(final Position p1, final Position p2) {
return p1.getOffset() - p2.getOffset();
}});
}
});
}
/**
@ -450,7 +423,7 @@ public class SemanticHighlightingReconciler implements ICReconcilingListener {
}
/**
* Stop reconciling positions.
* Stops reconciling positions.
*/
protected void stopReconcilingPositions() {
fRemovedPositions.clear();
@ -459,7 +432,7 @@ public class SemanticHighlightingReconciler implements ICReconcilingListener {
}
/**
* Install this reconciler on the given editor, presenter and highlightings.
* Installs this reconciler on the given editor, presenter and highlightings.
* @param editor the editor
* @param sourceViewer the source viewer
* @param presenter the semantic highlighting presenter
@ -479,7 +452,7 @@ public class SemanticHighlightingReconciler implements ICReconcilingListener {
}
/**
* Uninstall this reconciler from the editor
* Uninstalsl this reconciler from the editor
*/
public void uninstall() {
if (fPresenter != null)
@ -496,7 +469,7 @@ public class SemanticHighlightingReconciler implements ICReconcilingListener {
}
/**
* Schedule a background job for retrieving the AST and reconciling the Semantic Highlighting model.
* Schedules a background job for retrieving the AST and reconciling the Semantic Highlighting model.
*/
private void scheduleJob() {
final ICElement element= fEditor.getInputCElement();

View file

@ -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 org.eclipse.cdt.core.dom.ast.IASTName;
@ -24,7 +23,6 @@ import org.eclipse.cdt.core.dom.ast.IBinding;
* @since 4.0
*/
public final class SemanticToken {
/** AST node */
private IASTNode fNode;
@ -35,7 +33,7 @@ public final class SemanticToken {
/** AST root */
private IASTTranslationUnit fRoot;
private boolean fIsRootResolved= false;
private boolean fIsRootResolved;
/**
* @return Returns the binding, can be <code>null</code>.
@ -44,7 +42,7 @@ public final class SemanticToken {
if (!fIsBindingResolved) {
fIsBindingResolved= true;
if (fNode instanceof IASTName)
fBinding= ((IASTName)fNode).resolveBinding();
fBinding= ((IASTName) fNode).resolveBinding();
}
return fBinding;