Bug 347363 - [Backport] IASTTranslationUnit.getRawSignature() return empty string
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/CPreprocessor.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/CPreprocessor.java
index 0fa4224..2e4f805 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/CPreprocessor.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/CPreprocessor.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2010 IBM Corporation and others.
+ * Copyright (c) 2004, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -92,7 +92,6 @@
private static final int PROTECT_DEFINED = 0x02;
private static final int STOP_AT_NL = 0x04;
private static final int CHECK_NUMBERS = 0x08;
- private static final Token END_OF_INPUT = new Token(IToken.tEND_OF_INPUT, null, 0, 0);
private interface IIncludeFileTester<T> {
T checkFile(String path, boolean isHeuristicMatch, IncludeSearchPathElement onPath);
@@ -135,7 +134,7 @@
t= lexer.currentToken();
}
if (fStopAtNewline && t.getType() == Lexer.tNEWLINE)
- return END_OF_INPUT;
+ return new Token(IToken.tEND_OF_INPUT, null, 0, 0);
return t;
}
@@ -145,7 +144,7 @@
public Token currentToken() {
Token t= fCurrentContext.currentLexerToken();
if (fStopAtNewline && t.getType() == Lexer.tNEWLINE)
- return END_OF_INPUT;
+ return new Token(IToken.tEND_OF_INPUT, null, 0, 0);
return t;
}
@@ -570,6 +569,7 @@
case IToken.tEND_OF_INPUT:
if (fContentAssistLimit < 0) {
+ fPrefetchedTokens= t1;
throw new EndOfFileException(t1.getOffset());
}
int useType= fHandledCompletion ? IToken.tEOC : IToken.tCOMPLETION;
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/ScannerContext.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/ScannerContext.java
index 6a642e2..3212aae 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/ScannerContext.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/ScannerContext.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2009 Wind River Systems, Inc. and others.
+ * Copyright (c) 2007, 2011 Wind River Systems, Inc. and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -20,8 +20,6 @@
* @since 5.0
*/
final class ScannerContext {
- private static final Token END_TOKEN = new Token(IToken.tEND_OF_INPUT, null, 0, 0);
-
enum BranchKind {eIf, eElif, eElse, eEnd}
enum CodeState {eActive, eParseInactive, eSkipInactive}
final static class Conditional {
@@ -231,7 +229,7 @@
if (fLexer != null) {
return fLexer.currentToken();
}
- return END_TOKEN;
+ return new Token(IToken.tEND_OF_INPUT, null, 0, 0);
}
/**
@@ -245,7 +243,7 @@
if (fLexer != null) {
return fLexer.nextToken();
}
- return END_TOKEN;
+ return new Token(IToken.tEND_OF_INPUT, null, 0, 0);
}
/**