1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-01 05:15:43 +02:00

Cosmetics.

This commit is contained in:
Sergey Prigogin 2011-08-08 15:46:03 -07:00
parent be1435ad0a
commit 389a1ff92b
6 changed files with 21 additions and 26 deletions

View file

@ -17,9 +17,7 @@ package org.eclipse.cdt.core.dom.ast;
* @noextend This interface is not intended to be extended by clients. * @noextend This interface is not intended to be extended by clients.
* @noimplement This interface is not intended to be implemented by clients. * @noimplement This interface is not intended to be implemented by clients.
*/ */
public interface IASTPreprocessorMacroDefinition extends public interface IASTPreprocessorMacroDefinition extends IASTPreprocessorStatement, IASTNameOwner {
IASTPreprocessorStatement, IASTNameOwner {
/** /**
* <code>MACRO_NAME</code> describes the relationship between a macro * <code>MACRO_NAME</code> describes the relationship between a macro
* definition and it's name. * definition and it's name.
@ -44,7 +42,6 @@ public interface IASTPreprocessorMacroDefinition extends
*/ */
public IASTFileLocation getExpansionLocation(); public IASTFileLocation getExpansionLocation();
/** /**
* Returns whether this macro definition occurs in active code. * Returns whether this macro definition occurs in active code.
* @since 5.1 * @since 5.1

View file

@ -8,7 +8,6 @@
* Contributors: * Contributors:
* Markus Schorn - initial API and implementation * Markus Schorn - initial API and implementation
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.core.index; package org.eclipse.cdt.core.index;
import org.eclipse.cdt.core.dom.ast.IASTFileLocation; import org.eclipse.cdt.core.dom.ast.IASTFileLocation;
@ -23,7 +22,6 @@ import org.eclipse.core.runtime.CoreException;
* @noimplement This interface is not intended to be implemented by clients. * @noimplement This interface is not intended to be implemented by clients.
*/ */
public interface IIndexMacro extends IMacroBinding, IIndexBinding { public interface IIndexMacro extends IMacroBinding, IIndexBinding {
IIndexMacro[] EMPTY_INDEX_MACRO_ARRAY = new IIndexMacro[0]; IIndexMacro[] EMPTY_INDEX_MACRO_ARRAY = new IIndexMacro[0];
/** /**

View file

@ -11,13 +11,12 @@
package org.eclipse.cdt.core.index; package org.eclipse.cdt.core.index;
/** /**
* Represents a binding for all macros with the same name. When you try to adapt a macro binding in an index * Represents a binding for all macros with the same name. When you try to adapt a macro binding
* you'll get the container as a result. * in an index you'll get the container as a result.
* @since 5.0 * @since 5.0
* *
* @noextend This interface is not intended to be extended by clients. * @noextend This interface is not intended to be extended by clients.
* @noimplement This interface is not intended to be implemented by clients. * @noimplement This interface is not intended to be implemented by clients.
*/ */
public interface IIndexMacroContainer extends IIndexBinding { public interface IIndexMacroContainer extends IIndexBinding {
} }

View file

@ -1250,6 +1250,7 @@ public class CPreprocessor implements ILexerLog, IScanner, IAdaptable {
condEndOffset= lexer.consumeLine(ORIGIN_PREPROCESSOR_DIRECTIVE); condEndOffset= lexer.consumeLine(ORIGIN_PREPROCESSOR_DIRECTIVE);
break; break;
} }
if (headerName == null || headerName.length == 0) { if (headerName == null || headerName.length == 0) {
if (active) { if (active) {
handleProblem(IProblem.PREPROCESSOR_INVALID_DIRECTIVE, handleProblem(IProblem.PREPROCESSOR_INVALID_DIRECTIVE,
@ -1288,8 +1289,8 @@ public class CPreprocessor implements ILexerLog, IScanner, IAdaptable {
fAllIncludedFiles.add(path); fAllIncludedFiles.add(path);
ILocationCtx ctx= fLocationMap.pushInclusion(poundOffset, nameOffsets[0], nameOffsets[1], ILocationCtx ctx= fLocationMap.pushInclusion(poundOffset, nameOffsets[0], nameOffsets[1],
condEndOffset, source, path, headerName, userInclude, isHeuristic, fi.isSource()); condEndOffset, source, path, headerName, userInclude, isHeuristic, fi.isSource());
ScannerContext fctx= new ScannerContext(ctx, fCurrentContext, new Lexer(source, ScannerContext fctx= new ScannerContext(ctx, fCurrentContext,
fLexOptions, this, this)); new Lexer(source, fLexOptions, this, this));
fctx.setFoundOnPath(fi.getFoundOnPath(), includeDirective); fctx.setFoundOnPath(fi.getFoundOnPath(), includeDirective);
fCurrentContext= fctx; fCurrentContext= fctx;
} }

View file

@ -22,14 +22,17 @@ import org.eclipse.cdt.core.parser.OffsetLimitReachedException;
final class ScannerContext { final class ScannerContext {
enum BranchKind {eIf, eElif, eElse, eEnd} enum BranchKind {eIf, eElif, eElse, eEnd}
enum CodeState {eActive, eParseInactive, eSkipInactive} enum CodeState {eActive, eParseInactive, eSkipInactive}
final static class Conditional { final static class Conditional {
private final CodeState fInitialState; private final CodeState fInitialState;
private BranchKind fLast; private BranchKind fLast;
private boolean fTakeElse= true; private boolean fTakeElse= true;
Conditional(CodeState state) { Conditional(CodeState state) {
fInitialState= state; fInitialState= state;
fLast= BranchKind.eIf; fLast= BranchKind.eIf;
} }
boolean canHaveActiveBranch(boolean withinExpansion) { boolean canHaveActiveBranch(boolean withinExpansion) {
return fTakeElse && isActive(withinExpansion); return fTakeElse && isActive(withinExpansion);
} }

View file

@ -10,7 +10,6 @@
* Andrew Ferguson (Symbian) * Andrew Ferguson (Symbian)
* Markus Schorn (Wind River Systems) * Markus Schorn (Wind River Systems)
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.internal.core.pdom.db; package org.eclipse.cdt.internal.core.pdom.db;
import org.eclipse.cdt.core.CCorePlugin; import org.eclipse.cdt.core.CCorePlugin;
@ -260,7 +259,6 @@ public class ShortString implements IString {
return 0; return 0;
} }
public int compareCompatibleWithIgnoreCase(IString string) throws CoreException { public int compareCompatibleWithIgnoreCase(IString string) throws CoreException {
if (string instanceof ShortString) if (string instanceof ShortString)
return compareCompatibleWithIgnoreCase((ShortString)string); return compareCompatibleWithIgnoreCase((ShortString)string);
@ -270,7 +268,6 @@ public class ShortString implements IString {
throw new IllegalArgumentException(); throw new IllegalArgumentException();
} }
public int compareCompatibleWithIgnoreCase(ShortString other) throws CoreException { public int compareCompatibleWithIgnoreCase(ShortString other) throws CoreException {
Chunk chunk1 = db.getChunk(record); Chunk chunk1 = db.getChunk(record);
Chunk chunk2 = other.db.getChunk(other.record); Chunk chunk2 = other.db.getChunk(other.record);