diff --git a/org.eclipse.cdt.core/META-INF/MANIFEST.MF b/org.eclipse.cdt.core/META-INF/MANIFEST.MF index 3cbcf2208..40b67f788 100644 --- a/org.eclipse.cdt.core/META-INF/MANIFEST.MF +++ b/org.eclipse.cdt.core/META-INF/MANIFEST.MF @@ -1,8 +1,8 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 -Bundle-Name: %pluginName +Bundle-Name: C/C++ Development Tools Core Bundle-SymbolicName: org.eclipse.cdt.core; singleton:=true -Bundle-Version: 6.4.0.qualifier +Bundle-Version: 6.4.0.201801130900 Bundle-Activator: org.eclipse.cdt.core.CCorePlugin Bundle-Vendor: %providerName Bundle-Localization: plugin diff --git a/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/ASTInclusionStatement.java b/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/ASTInclusionStatement.java new file mode 100644 index 000000000..2718ef985 --- /dev/null +++ b/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/ASTInclusionStatement.java @@ -0,0 +1,207 @@ +package org.eclipse.cdt.internal.core.parser.scanner; + +import org.eclipse.cdt.core.dom.ast.IASTName; +import org.eclipse.cdt.core.dom.ast.IASTPreprocessorIncludeStatement; +import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit; +import org.eclipse.cdt.core.dom.ast.IFileNomination; +import org.eclipse.cdt.core.index.IIndexFile; +import org.eclipse.cdt.core.parser.ISignificantMacros; +import org.eclipse.cdt.internal.core.dom.parser.ASTNodeSpecification; +import org.eclipse.core.runtime.CoreException; + +public class ASTInclusionStatement extends ASTPreprocessorNode implements IASTPreprocessorIncludeStatement { + private static final ISignificantMacros[] NO_VERSIONS = {}; + + private final ASTPreprocessorName fName; + private final String fPath; + private final boolean fIsResolved; + private final boolean fIsSystemInclude; + private final boolean fFoundByHeuristics; + private final boolean fIncludedFileExported; + private final IFileNomination fNominationDelegate; + private boolean fPragmaOnce; + private boolean fCreatesAST; + private ISignificantMacros fSignificantMacros; + private ISignificantMacros[] fLoadedVersions = NO_VERSIONS; + private long fIncludedFileContentsHash; + private long fIncludedFileTimestamp = -1; + private long fIncludedFileSize; + private long fIncludedFileReadTime; + private boolean fErrorInIncludedFile; + + public ASTInclusionStatement(IASTTranslationUnit parent, + int startNumber, int nameStartNumber, int nameEndNumber, int endNumber, + char[] headerName, String filePath, boolean userInclude, boolean active, boolean heuristic, + boolean exportedFile, IFileNomination nominationDelegate) { + super(parent, IASTTranslationUnit.PREPROCESSOR_STATEMENT, startNumber, endNumber); + fName= new ASTPreprocessorName(this, IASTPreprocessorIncludeStatement.INCLUDE_NAME, + nameStartNumber, nameEndNumber, headerName, null); + fPath= filePath == null ? "" : filePath; //$NON-NLS-1$ + fIsResolved= filePath != null; + fIsSystemInclude= !userInclude; + fFoundByHeuristics= heuristic; + fSignificantMacros= ISignificantMacros.NONE; + fNominationDelegate= nominationDelegate; + fIncludedFileExported= exportedFile; + if (!active) { + setInactive(); + } + } + + @Override + public IASTName getName() { + return fName; + } + + @Override + public String getPath() { + return fPath; + } + + @Override + public boolean isResolved() { + return fIsResolved; + } + + @Override + public boolean isSystemInclude() { + return fIsSystemInclude; + } + + @Override + void findNode(ASTNodeSpecification nodeSpec) { + super.findNode(nodeSpec); + nodeSpec.visit(fName); + } + + @Override + public boolean isResolvedByHeuristics() { + return fFoundByHeuristics; + } + + @Override + public boolean hasPragmaOnceSemantics() { + if (fNominationDelegate != null) { + try { + return fNominationDelegate.hasPragmaOnceSemantics(); + } catch (CoreException e) { + } + } + return fPragmaOnce; + } + + public void setPragamOnceSemantics(boolean value) { + assert fNominationDelegate == null; + fPragmaOnce= value; + } + + @Override + public ISignificantMacros getSignificantMacros() { + if (fNominationDelegate != null) { + try { + return fNominationDelegate.getSignificantMacros(); + } catch (CoreException e) { + } + } + return fSignificantMacros; + } + + public void setSignificantMacros(ISignificantMacros sig) { + assert sig != null; + assert fNominationDelegate == null; + fSignificantMacros= sig; + } + + public void setLoadedVersions(ISignificantMacros[] versions) { + fLoadedVersions= versions; + } + + @Override + public ISignificantMacros[] getLoadedVersions() { + return fLoadedVersions; + } + + @Override + public long getIncludedFileTimestamp() { + if (fNominationDelegate != null) { + return 0; + } + return fIncludedFileTimestamp; + } + + public void setIncludedFileTimestamp(long timestamp) { + assert fNominationDelegate == null; + fIncludedFileTimestamp= timestamp; + } + + @Override + public long getIncludedFileReadTime() { + if (fNominationDelegate != null) { + return 0; + } + return fIncludedFileReadTime; + } + + public void setIncludedFileReadTime(long time) { + assert fNominationDelegate == null; + fIncludedFileReadTime= time; + } + + @Override + public long getIncludedFileSize() { + if (fNominationDelegate != null) { + return 0; + } + return fIncludedFileSize; + } + + public void setIncludedFileSize(long size) { + assert fNominationDelegate == null; + fIncludedFileSize= size; + } + + @Override + public long getIncludedFileContentsHash() { + if (fNominationDelegate != null) { + return 0; + } + return fIncludedFileContentsHash; + } + + public void setIncludedFileContentsHash(long hash) { + assert fNominationDelegate == null; + fCreatesAST= true; + fIncludedFileContentsHash= hash; + } + + @Override + public boolean isErrorInIncludedFile() { + if (fNominationDelegate != null) { + return false; + } + return fErrorInIncludedFile; + } + + public void setErrorInIncludedFile(boolean error) { + assert fNominationDelegate == null; + fErrorInIncludedFile= error; + } + + @Override + public boolean isIncludedFileExported() { + return fIncludedFileExported; + } + + @Override + public boolean createsAST() { + return fCreatesAST; + } + + @Override + public IIndexFile getImportedIndexFile() { + if (fNominationDelegate instanceof IIndexFile) + return (IIndexFile) fNominationDelegate; + + return null; + } +} diff --git a/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/ASTPreprocessorNode.java b/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/ASTPreprocessorNode.java index 21a503d54..8c6b2110f 100644 --- a/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/ASTPreprocessorNode.java +++ b/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/ASTPreprocessorNode.java @@ -282,203 +282,6 @@ public boolean isPragmaOperator() { } } -class ASTInclusionStatement extends ASTPreprocessorNode implements IASTPreprocessorIncludeStatement { - private static final ISignificantMacros[] NO_VERSIONS = {}; - - private final ASTPreprocessorName fName; - private final String fPath; - private final boolean fIsResolved; - private final boolean fIsSystemInclude; - private final boolean fFoundByHeuristics; - private final boolean fIncludedFileExported; - private final IFileNomination fNominationDelegate; - private boolean fPragmaOnce; - private boolean fCreatesAST; - private ISignificantMacros fSignificantMacros; - private ISignificantMacros[] fLoadedVersions = NO_VERSIONS; - private long fIncludedFileContentsHash; - private long fIncludedFileTimestamp = -1; - private long fIncludedFileSize; - private long fIncludedFileReadTime; - private boolean fErrorInIncludedFile; - - public ASTInclusionStatement(IASTTranslationUnit parent, - int startNumber, int nameStartNumber, int nameEndNumber, int endNumber, - char[] headerName, String filePath, boolean userInclude, boolean active, boolean heuristic, - boolean exportedFile, IFileNomination nominationDelegate) { - super(parent, IASTTranslationUnit.PREPROCESSOR_STATEMENT, startNumber, endNumber); - fName= new ASTPreprocessorName(this, IASTPreprocessorIncludeStatement.INCLUDE_NAME, - nameStartNumber, nameEndNumber, headerName, null); - fPath= filePath == null ? "" : filePath; //$NON-NLS-1$ - fIsResolved= filePath != null; - fIsSystemInclude= !userInclude; - fFoundByHeuristics= heuristic; - fSignificantMacros= ISignificantMacros.NONE; - fNominationDelegate= nominationDelegate; - fIncludedFileExported= exportedFile; - if (!active) { - setInactive(); - } - } - - @Override - public IASTName getName() { - return fName; - } - - @Override - public String getPath() { - return fPath; - } - - @Override - public boolean isResolved() { - return fIsResolved; - } - - @Override - public boolean isSystemInclude() { - return fIsSystemInclude; - } - - @Override - void findNode(ASTNodeSpecification nodeSpec) { - super.findNode(nodeSpec); - nodeSpec.visit(fName); - } - - @Override - public boolean isResolvedByHeuristics() { - return fFoundByHeuristics; - } - - @Override - public boolean hasPragmaOnceSemantics() { - if (fNominationDelegate != null) { - try { - return fNominationDelegate.hasPragmaOnceSemantics(); - } catch (CoreException e) { - } - } - return fPragmaOnce; - } - - public void setPragamOnceSemantics(boolean value) { - assert fNominationDelegate == null; - fPragmaOnce= value; - } - - @Override - public ISignificantMacros getSignificantMacros() { - if (fNominationDelegate != null) { - try { - return fNominationDelegate.getSignificantMacros(); - } catch (CoreException e) { - } - } - return fSignificantMacros; - } - - public void setSignificantMacros(ISignificantMacros sig) { - assert sig != null; - assert fNominationDelegate == null; - fSignificantMacros= sig; - } - - public void setLoadedVersions(ISignificantMacros[] versions) { - fLoadedVersions= versions; - } - - @Override - public ISignificantMacros[] getLoadedVersions() { - return fLoadedVersions; - } - - @Override - public long getIncludedFileTimestamp() { - if (fNominationDelegate != null) { - return 0; - } - return fIncludedFileTimestamp; - } - - public void setIncludedFileTimestamp(long timestamp) { - assert fNominationDelegate == null; - fIncludedFileTimestamp= timestamp; - } - - @Override - public long getIncludedFileReadTime() { - if (fNominationDelegate != null) { - return 0; - } - return fIncludedFileReadTime; - } - - public void setIncludedFileReadTime(long time) { - assert fNominationDelegate == null; - fIncludedFileReadTime= time; - } - - @Override - public long getIncludedFileSize() { - if (fNominationDelegate != null) { - return 0; - } - return fIncludedFileSize; - } - - public void setIncludedFileSize(long size) { - assert fNominationDelegate == null; - fIncludedFileSize= size; - } - - @Override - public long getIncludedFileContentsHash() { - if (fNominationDelegate != null) { - return 0; - } - return fIncludedFileContentsHash; - } - - public void setIncludedFileContentsHash(long hash) { - assert fNominationDelegate == null; - fCreatesAST= true; - fIncludedFileContentsHash= hash; - } - - @Override - public boolean isErrorInIncludedFile() { - if (fNominationDelegate != null) { - return false; - } - return fErrorInIncludedFile; - } - - public void setErrorInIncludedFile(boolean error) { - assert fNominationDelegate == null; - fErrorInIncludedFile= error; - } - - @Override - public boolean isIncludedFileExported() { - return fIncludedFileExported; - } - - @Override - public boolean createsAST() { - return fCreatesAST; - } - - @Override - public IIndexFile getImportedIndexFile() { - if (fNominationDelegate instanceof IIndexFile) - return (IIndexFile) fNominationDelegate; - - return null; - } -} - class ASTMacroDefinition extends ASTPreprocessorNode implements IASTPreprocessorObjectStyleMacroDefinition { private final ASTPreprocessorName fName; protected final int fExpansionNumber; diff --git a/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/CPreprocessor.java b/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/CPreprocessor.java index 00fe6a9fb..c980fdeeb 100644 --- a/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/CPreprocessor.java +++ b/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/CPreprocessor.java @@ -112,12 +112,12 @@ public class CPreprocessor implements ILexerLog, IScanner, IAdaptable { private static final char[] __COUNTER__ = "__COUNTER__".toCharArray(); //$NON-NLS-1$ private static final char[] ONCE = "once".toCharArray(); //$NON-NLS-1$ - static final int NO_EXPANSION = 0x01; + protected static final int NO_EXPANSION = 0x01; // Set in contexts where preprocessor intrinsics such as 'defined' // or '__has_feature' need to be recognized. static final int PROTECT_INTRINSICS = 0x02; - static final int STOP_AT_NL = 0x04; - static final int CHECK_NUMBERS = 0x08; + protected static final int STOP_AT_NL = 0x04; + protected static final int CHECK_NUMBERS = 0x08; static final int REPORT_SIGNIFICANT_MACROS = 0x10; static final int IGNORE_UNDEFINED_SIGNIFICANT_MACROS = 0x20; @@ -265,7 +265,7 @@ public Token currentToken() { // configuration final private LexerOptions fLexOptions= new LexerOptions(); final private char[] fAdditionalNumericLiteralSuffixes; - final private CharArrayIntMap fKeywords; + final protected CharArrayIntMap fKeywords; final private CharArrayIntMap fPPKeywords; private final IncludeSearchPath fIncludeSearchPath; private String[][] fPreIncludedFiles= null; @@ -277,11 +277,11 @@ public Token currentToken() { // State information private final CharArrayMap fMacroDictionary = new CharArrayMap<>(512); private final IMacroDictionary fMacroDictionaryFacade = new MacroDictionary(); - private final LocationMap fLocationMap; + protected final LocationMap fLocationMap; private CharArraySet fPreventInclusion; private CharArraySet fImports; - private final ScannerContext fRootContext; + protected final ScannerContext fRootContext; protected ScannerContext fCurrentContext; private boolean isCancelled; @@ -290,8 +290,8 @@ public Token currentToken() { private Token fPrefetchedTokens; private Token fLastToken; - private InternalFileContent fRootContent; - private boolean fHandledEndOfTranslationUnit; + protected InternalFileContent fRootContent; + protected boolean fHandledEndOfTranslationUnit; // Detection of include guards used around an include directive private char[] fExternIncludeGuard; @@ -912,7 +912,7 @@ private void appendStringContent(StringBuilder buf, Token t1) { } } - Token internalFetchToken(final ScannerContext uptoEndOfCtx, int options, boolean withinExpansion) + protected Token internalFetchToken(final ScannerContext uptoEndOfCtx, int options, boolean withinExpansion) throws OffsetLimitReachedException { @@ -1005,7 +1005,7 @@ Token internalFetchToken(final ScannerContext uptoEndOfCtx, int options, boolean } } - private void completeInclusion(ASTInclusionStatement inc) { + protected void completeInclusion(ASTInclusionStatement inc) { final ISignificantMacros sig; CharArrayObjectMap sigMacros= fCurrentContext.getSignificantMacros(); if (sigMacros == null || sigMacros.isEmpty()) { @@ -1019,7 +1019,7 @@ private void completeInclusion(ASTInclusionStatement inc) { } } - private void checkNumber(Token number, final boolean isFloat) { + protected void checkNumber(Token number, final boolean isFloat) { final char[] image= number.getCharImage(); boolean hasExponent = false; @@ -1341,7 +1341,7 @@ public void handleProblem(int id, char[] arg, int offset, int endOffset) { * Assumes that the pound token has not yet been consumed * @since 5.0 */ - private void executeDirective(final Lexer lexer, final int startOffset, boolean withinExpansion) + protected void executeDirective(final Lexer lexer, final int startOffset, boolean withinExpansion) throws OffsetLimitReachedException { final Token ident= lexer.nextToken(); switch (ident.getType()) { @@ -1468,7 +1468,7 @@ private void executeDirective(final Lexer lexer, final int startOffset, boolean } } - private void executeInclude(final Lexer lexer, int poundOffset, int includeType, + protected void executeInclude(final Lexer lexer, int poundOffset, int includeType, boolean active, boolean withinExpansion) throws OffsetLimitReachedException { // Make sure to clear the extern include guard. final char[] externGuard= fExternIncludeGuard; @@ -1694,7 +1694,7 @@ private void processInclusionFromIndex(int offset, InternalFileContent fi, boole fLocationMap.skippedFile(fLocationMap.getSequenceNumberForOffset(offset), fi); } - private char[] extractHeaderName(final char[] image, final char startDelim, final char endDelim, + protected char[] extractHeaderName(final char[] image, final char startDelim, final char endDelim, int[] offsets) { char[] headerName; int start= 0; @@ -2017,7 +2017,7 @@ private CodeState skipBranch(final Lexer lexer, boolean withinExpansion) * @param isPPCondition whether the expansion is inside of a preprocessor condition. This * implies a specific handling for the defined token. */ - private boolean expandMacro(final Token identifier, Lexer lexer, int options, + protected boolean expandMacro(final Token identifier, Lexer lexer, int options, boolean withinExpansion) throws OffsetLimitReachedException { final boolean reportSignificant = (options & REPORT_SIGNIFICANT_MACROS) != 0; final char[] name= identifier.getCharImage(); diff --git a/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/Lexer.java b/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/Lexer.java index 99b1872cd..9f7779459 100644 --- a/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/Lexer.java +++ b/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/Lexer.java @@ -40,14 +40,14 @@ * The characters in string literals and char-literals are left as they are found, no conversion to * an execution character-set is performed. */ -final public class Lexer implements ITokenSequence { +public class Lexer implements ITokenSequence { public static final int tBEFORE_INPUT = IToken.FIRST_RESERVED_SCANNER; public static final int tNEWLINE = IToken.FIRST_RESERVED_SCANNER + 1; public static final int tQUOTE_HEADER_NAME = IToken.FIRST_RESERVED_SCANNER + 2; public static final int tSYSTEM_HEADER_NAME = IToken.FIRST_RESERVED_SCANNER + 3; public static final int tOTHER_CHARACTER = IToken.FIRST_RESERVED_SCANNER + 4; - private static final int END_OF_INPUT = -1; + protected static final int END_OF_INPUT = -1; private static final int ORIGIN_LEXER = OffsetLimitReachedException.ORIGIN_LEXER; public final static class LexerOptions implements Cloneable { @@ -72,22 +72,22 @@ public Object clone() { } // configuration - private final LexerOptions fOptions; - private boolean fSupportContentAssist= false; + protected final LexerOptions fOptions; + protected boolean fSupportContentAssist= false; private final ILexerLog fLog; private final Object fSource; // the input to the lexer - private final AbstractCharArray fInput; + protected final AbstractCharArray fInput; private final int fStart; private int fLimit; // after phase 3 (newline, trigraph, line-splice) - private int fOffset; + protected int fOffset; private int fEndOffset; - private int fCharPhase3; + protected int fCharPhase3; - private boolean fInsideIncludeDirective= false; + protected boolean fInsideIncludeDirective= false; private Token fToken; private Token fLastToken; @@ -259,7 +259,7 @@ public Token nextDirective() throws OffsetLimitReachedException { /** * Computes the next token. */ - private Token fetchToken() throws OffsetLimitReachedException { + protected Token fetchToken() throws OffsetLimitReachedException { while (true) { final int start= fOffset; final int c= fCharPhase3; @@ -649,15 +649,15 @@ private Token fetchToken() throws OffsetLimitReachedException { } } - private Token newToken(int kind, int offset) { + protected Token newToken(int kind, int offset) { return new Token(kind, fSource, offset, fOffset); } - private Token newDigraphToken(int kind, int offset) { + protected Token newDigraphToken(int kind, int offset) { return new TokenForDigraph(kind, fSource, offset, fOffset); } - private Token newToken(final int kind, final int offset, final int imageLength) { + protected Token newToken(final int kind, final int offset, final int imageLength) { final int endOffset= fOffset; final int sourceLen= endOffset - offset; char[] image; @@ -675,7 +675,7 @@ private void handleProblem(int problemID, char[] arg, int offset) { fLog.handleProblem(problemID, arg, offset, fOffset); } - private Token headerName(final int start, final boolean expectQuotes) throws OffsetLimitReachedException { + protected Token headerName(final int start, final boolean expectQuotes) throws OffsetLimitReachedException { int length= 1; boolean done = false; int c= fCharPhase3; @@ -704,7 +704,7 @@ private Token headerName(final int start, final boolean expectQuotes) throws Off return newToken((expectQuotes ? tQUOTE_HEADER_NAME : tSYSTEM_HEADER_NAME), start, length); } - private void blockComment(final int start, final char trigger) { + protected void blockComment(final int start, final char trigger) { // We can ignore line-splices, trigraphs and windows newlines when searching for the '*' int pos= fEndOffset; while (isValidOffset(pos)) { @@ -722,7 +722,7 @@ private void blockComment(final int start, final char trigger) { fLog.handleComment(true, start, pos, fInput); } - private void lineComment(final int start) { + protected void lineComment(final int start) { int c= fCharPhase3; while (true) { switch (c) { @@ -744,7 +744,7 @@ private boolean isIdentifierStart(int c) { c == '_'; } - private Token stringLiteral(final int start, int length, int tokenType) throws OffsetLimitReachedException { + protected Token stringLiteral(final int start, int length, int tokenType) throws OffsetLimitReachedException { boolean escaped = false; boolean done = false; @@ -805,7 +805,7 @@ private boolean isUDLSuffixStart(int c) { return c == '_'; } - private Token rawStringLiteral(final int start, int length, int tokenType) throws OffsetLimitReachedException { + protected Token rawStringLiteral(final int start, int length, int tokenType) throws OffsetLimitReachedException { final int delimOffset= fOffset; int delimEndOffset = delimOffset; int offset; @@ -859,7 +859,7 @@ private Token rawStringLiteral(final int start, int length, int tokenType) throw return newToken(tokenType, start, offset - start); } - private Token charLiteral(final int start, int tokenType) throws OffsetLimitReachedException { + protected Token charLiteral(final int start, int tokenType) throws OffsetLimitReachedException { boolean escaped = false; boolean done = false; int length= tokenType == IToken.tCHAR ? 1 : 2; @@ -901,7 +901,7 @@ private Token charLiteral(final int start, int tokenType) throws OffsetLimitReac return newToken(tokenType, start, length); } - private Token identifier(int start, int length) { + protected Token identifier(int start, int length) { int tokenKind= IToken.tIDENTIFIER; boolean isPartOfIdentifier= true; int c= fCharPhase3; @@ -970,7 +970,7 @@ private Token identifier(int start, int length) { return newToken(tokenKind, start, length); } - private Token number(final int start, int length, boolean isFloat) throws OffsetLimitReachedException { + protected Token number(final int start, int length, boolean isFloat) throws OffsetLimitReachedException { boolean isPartOfNumber= true; boolean isHex= false; int c= fCharPhase3; @@ -1062,7 +1062,7 @@ private Token number(final int start, int length, boolean isFloat) throws Offset * Saves the current state of phase3, necessary for '...', '%:%:', UNCs and string literals * with a long prefix. */ - private void markPhase3() { + protected void markPhase3() { fMarkPhase3Offset= fOffset; fMarkPhase3EndOffset= fEndOffset; fMarkPhase3PrefetchedChar= fCharPhase3; @@ -1071,7 +1071,7 @@ private void markPhase3() { /** * Restores a previously saved state of phase3. */ - private void restorePhase3() { + protected void restorePhase3() { fOffset= fMarkPhase3Offset; fEndOffset= fMarkPhase3EndOffset; fCharPhase3= fMarkPhase3PrefetchedChar; @@ -1081,7 +1081,7 @@ private void restorePhase3() { * Perform phase 1-3: Replace \r\n with \n, handle trigraphs, detect line-splicing. * Changes fOffset, fEndOffset and fCharPhase3, state-less otherwise. */ - private int nextCharPhase3() { + protected int nextCharPhase3() { int pos= fEndOffset; do { if (!isValidOffset(pos + 1)) { diff --git a/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/ScannerContext.java b/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/ScannerContext.java index 08f07ae48..4e947b24e 100644 --- a/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/ScannerContext.java +++ b/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/ScannerContext.java @@ -23,9 +23,9 @@ * Represents part of the input to the preprocessor. This may be a file or the result of a macro expansion. * @since 5.0 */ -final class ScannerContext { +public final class ScannerContext { enum BranchKind { eIf, eElif, eElse, eEnd } - enum CodeState { eActive, eParseInactive, eSkipInactive } + public enum CodeState { eActive, eParseInactive, eSkipInactive } final static class Conditional { private final CodeState fInitialState;