1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-01 14:15:23 +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

@ -6,8 +6,8 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Doug Schaefer (IBM) - Initial API and implementation
* Markus Schorn (Wind River Systems)
* Doug Schaefer (IBM) - Initial API and implementation
* Markus Schorn (Wind River Systems)
*******************************************************************************/
package org.eclipse.cdt.core.dom.ast;
@ -17,9 +17,7 @@ package org.eclipse.cdt.core.dom.ast;
* @noextend This interface is not intended to be extended by clients.
* @noimplement This interface is not intended to be implemented by clients.
*/
public interface IASTPreprocessorMacroDefinition extends
IASTPreprocessorStatement, IASTNameOwner {
public interface IASTPreprocessorMacroDefinition extends IASTPreprocessorStatement, IASTNameOwner {
/**
* <code>MACRO_NAME</code> describes the relationship between a macro
* definition and it's name.
@ -43,7 +41,6 @@ public interface IASTPreprocessorMacroDefinition extends
* @since 5.0
*/
public IASTFileLocation getExpansionLocation();
/**
* Returns whether this macro definition occurs in active code.

View file

@ -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.core.index;
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.
*/
public interface IIndexMacro extends IMacroBinding, IIndexBinding {
IIndexMacro[] EMPTY_INDEX_MACRO_ARRAY = new IIndexMacro[0];
/**

View file

@ -6,18 +6,17 @@
* 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.index;
/**
* Represents a binding for all macros with the same name. When you try to adapt a macro binding in an index
* you'll get the container as a result.
* Represents a binding for all macros with the same name. When you try to adapt a macro binding
* in an index you'll get the container as a result.
* @since 5.0
*
* @noextend This interface is not intended to be extended by clients.
* @noimplement This interface is not intended to be implemented by clients.
*/
public interface IIndexMacroContainer extends IIndexBinding {
}

View file

@ -1200,14 +1200,14 @@ public class CPreprocessor implements ILexerLog, IScanner, IAdaptable {
final int[] nameOffsets= new int[] {header.getOffset(), condEndOffset};
char[] headerName= null;
boolean userInclude= true;
switch (header.getType()) {
case Lexer.tSYSTEM_HEADER_NAME:
userInclude= false;
headerName = extractHeaderName(header.getCharImage(), '<', '>', nameOffsets);
condEndOffset= lexer.consumeLine(ORIGIN_PREPROCESSOR_DIRECTIVE);
break;
case Lexer.tQUOTE_HEADER_NAME:
headerName = extractHeaderName(header.getCharImage(), '"', '"', nameOffsets);
condEndOffset= lexer.consumeLine(ORIGIN_PREPROCESSOR_DIRECTIVE);
@ -1215,7 +1215,7 @@ public class CPreprocessor implements ILexerLog, IScanner, IAdaptable {
case IToken.tCOMPLETION:
throw new OffsetLimitReachedException(ORIGIN_PREPROCESSOR_DIRECTIVE, header);
case IToken.tIDENTIFIER:
TokenList tl= new TokenList();
condEndOffset= nameOffsets[1]= getTokensWithinPPDirective(false, tl, false);
@ -1245,11 +1245,12 @@ public class CPreprocessor implements ILexerLog, IScanner, IAdaptable {
}
}
break;
default:
condEndOffset= lexer.consumeLine(ORIGIN_PREPROCESSOR_DIRECTIVE);
break;
}
if (headerName == null || headerName.length == 0) {
if (active) {
handleProblem(IProblem.PREPROCESSOR_INVALID_DIRECTIVE,
@ -1288,8 +1289,8 @@ public class CPreprocessor implements ILexerLog, IScanner, IAdaptable {
fAllIncludedFiles.add(path);
ILocationCtx ctx= fLocationMap.pushInclusion(poundOffset, nameOffsets[0], nameOffsets[1],
condEndOffset, source, path, headerName, userInclude, isHeuristic, fi.isSource());
ScannerContext fctx= new ScannerContext(ctx, fCurrentContext, new Lexer(source,
fLexOptions, this, this));
ScannerContext fctx= new ScannerContext(ctx, fCurrentContext,
new Lexer(source, fLexOptions, this, this));
fctx.setFoundOnPath(fi.getFoundOnPath(), includeDirective);
fCurrentContext= fctx;
}

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.parser.scanner;
@ -22,14 +22,17 @@ import org.eclipse.cdt.core.parser.OffsetLimitReachedException;
final class ScannerContext {
enum BranchKind {eIf, eElif, eElse, eEnd}
enum CodeState {eActive, eParseInactive, eSkipInactive}
final static class Conditional {
private final CodeState fInitialState;
private BranchKind fLast;
private boolean fTakeElse= true;
Conditional(CodeState state) {
fInitialState= state;
fLast= BranchKind.eIf;
}
boolean canHaveActiveBranch(boolean withinExpansion) {
return fTakeElse && isActive(withinExpansion);
}
@ -174,12 +177,12 @@ final class ScannerContext {
private int getOldNestingLevel(BranchKind kind, int nesting) {
switch (kind) {
case eIf:
return nesting-1;
return nesting - 1;
case eElif:
case eElse:
return nesting;
case eEnd:
return nesting+1;
return nesting + 1;
}
return nesting;
}

View file

@ -10,7 +10,6 @@
* Andrew Ferguson (Symbian)
* Markus Schorn (Wind River Systems)
*******************************************************************************/
package org.eclipse.cdt.internal.core.pdom.db;
import org.eclipse.cdt.core.CCorePlugin;
@ -77,7 +76,7 @@ public class ShortString implements IString {
Chunk chunk = db.getChunk(record);
int length = chunk.getInt(record + LENGTH);
char[] chars = new char[length];
chunk.getCharArray(record+CHARS, chars);
chunk.getCharArray(record + CHARS, chars);
return chars;
}
@ -259,7 +258,6 @@ public class ShortString implements IString {
else
return 0;
}
public int compareCompatibleWithIgnoreCase(IString string) throws CoreException {
if (string instanceof ShortString)
@ -269,7 +267,6 @@ public class ShortString implements IString {
else
throw new IllegalArgumentException();
}
public int compareCompatibleWithIgnoreCase(ShortString other) throws CoreException {
Chunk chunk1 = db.getChunk(record);