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:
sprigogin 2012-05-19 20:54:12 -07:00
parent e5141ca636
commit 6bf3a22858
3 changed files with 9 additions and 9 deletions

View file

@ -419,7 +419,7 @@ public interface IIndex {
* Returns an IIndexBinding for this IIndex that is equivalent to the specified binding, * Returns an IIndexBinding for this IIndex that is equivalent to the specified binding,
* or null if such a binding does not exist in this index. This is useful for adapting * or null if such a binding does not exist in this index. This is useful for adapting
* bindings obtained from IIndex objects that might have been created for a different scope * bindings obtained from IIndex objects that might have been created for a different scope
* or for IBinding objects obtained direct from the AST. * or for IBinding objects obtained directly from the AST.
* @param binding * @param binding
* @return an IIndexBinding for this IIndex that is equivalent to the specified binding * @return an IIndexBinding for this IIndex that is equivalent to the specified binding
*/ */

View file

@ -162,5 +162,4 @@ public class CharArrayObjectMap <T> extends CharTable {
System.arraycopy(valueTable, 0, values, 0, values.length); System.arraycopy(valueTable, 0, values, 0, values.length);
return values; return values;
} }
} }

View file

@ -24,8 +24,8 @@ import org.eclipse.cdt.core.parser.util.CharArraySet;
* @since 5.0 * @since 5.0
*/ */
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;
@ -52,7 +52,7 @@ final class ScannerContext {
private final ScannerContext fParent; private final ScannerContext fParent;
private final Lexer fLexer; private final Lexer fLexer;
private Token fTokens; private Token fTokens;
private ArrayList<Conditional> fConditionals= null; private ArrayList<Conditional> fConditionals;
private CodeState fCurrentState= CodeState.eActive; private CodeState fCurrentState= CodeState.eActive;
private IncludeSearchPathElement fFoundOnPath; private IncludeSearchPathElement fFoundOnPath;
private String fFoundViaDirective; private String fFoundViaDirective;
@ -60,7 +60,6 @@ final class ScannerContext {
private CharArrayObjectMap<char[]> fSignificantMacros; private CharArrayObjectMap<char[]> fSignificantMacros;
private boolean fPragmaOnce; private boolean fPragmaOnce;
private int fLoadedVersionCount; private int fLoadedVersionCount;
/** /**
* @param ctx * @param ctx
@ -70,7 +69,7 @@ final class ScannerContext {
fLocationCtx= ctx; fLocationCtx= ctx;
fParent= parent; fParent= parent;
fLexer= lexer; fLexer= lexer;
fDepth = parent == null ? 0 : parent.fDepth+1; fDepth = parent == null ? 0 : parent.fDepth + 1;
} }
public ScannerContext(ILocationCtx ctx, ScannerContext parent, TokenList tokens) { public ScannerContext(ILocationCtx ctx, ScannerContext parent, TokenList tokens) {
@ -131,7 +130,7 @@ final class ScannerContext {
} }
// if we are not inside of an conditional there shouldn't be an #else, #elsif or #end // if we are not inside of an conditional there shouldn't be an #else, #elsif or #end
final int pos= fConditionals.size()-1; final int pos= fConditionals.size() - 1;
if (pos < 0) { if (pos < 0) {
return null; return null;
} }
@ -393,7 +392,7 @@ final class ScannerContext {
// Propagate significant macros to direct parent, if it is interested. // Propagate significant macros to direct parent, if it is interested.
if (collector == fParent.fInternalModifications) { if (collector == fParent.fInternalModifications) {
final CharArrayObjectMap<char[]> significant = fParent.fSignificantMacros; final CharArrayObjectMap<char[]> significant = fParent.fSignificantMacros;
for (int i=0; i<fSignificantMacros.size(); i++) { for (int i= 0; i < fSignificantMacros.size(); i++) {
final char[] name = fSignificantMacros.keyAt(i); final char[] name = fSignificantMacros.keyAt(i);
if (!collector.containsKey(name)) { if (!collector.containsKey(name)) {
final char[] value= fSignificantMacros.getAt(i); final char[] value= fSignificantMacros.getAt(i);
@ -425,6 +424,7 @@ final class ScannerContext {
} }
return true; return true;
} }
@Override @Override
public boolean visitUndefined(char[] macro) { public boolean visitUndefined(char[] macro) {
if (!fInternalModifications.containsKey(macro)) { if (!fInternalModifications.containsKey(macro)) {
@ -432,6 +432,7 @@ final class ScannerContext {
} }
return true; return true;
} }
@Override @Override
public boolean visitDefined(char[] macro) { public boolean visitDefined(char[] macro) {
if (!fInternalModifications.containsKey(macro)) { if (!fInternalModifications.containsKey(macro)) {