mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
CORE
Fixed Bug 39530 - More problems with initializers. Fixed Bug 37424 - Crash when opening big files Refactored pointerOperators & cvQualifiers to not throw backtracks in optional case. Added tracing support to cdt.core plugin via .options file. TESTS Added QuickParseASTTests::testBug39530().
This commit is contained in:
parent
94b8758d5c
commit
2f398f309b
10 changed files with 143 additions and 81 deletions
|
@ -1,3 +1,6 @@
|
||||||
|
2003-08-25 John Camelon
|
||||||
|
Added QuickParseASTTests::testBug39530().
|
||||||
|
|
||||||
2003-08-21 Hoda Amer
|
2003-08-21 Hoda Amer
|
||||||
Enabled some tests in the IStructureTests, namely:
|
Enabled some tests in the IStructureTests, namely:
|
||||||
testGetFields(), testGetField(), testGetMethods(), testGetMethod(),
|
testGetFields(), testGetField(), testGetMethods(), testGetMethod(),
|
||||||
|
|
|
@ -1763,4 +1763,10 @@ public class QuickParseASTTests extends BaseASTTest
|
||||||
parse("class {} const null;");
|
parse("class {} const null;");
|
||||||
assertTrue( quickParseCallback.getCompilationUnit().getDeclarations().hasNext() );
|
assertTrue( quickParseCallback.getCompilationUnit().getDeclarations().hasNext() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void testBug39530() throws Exception
|
||||||
|
{
|
||||||
|
parse( "X sPassed(-1)");
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
1
core/org.eclipse.cdt.core/.options
Normal file
1
core/org.eclipse.cdt.core/.options
Normal file
|
@ -0,0 +1 @@
|
||||||
|
org.eclipse.cdt.core/debug=true
|
|
@ -174,7 +174,8 @@ public class Util {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void debugLog(String message) {
|
public static void debugLog(String message) {
|
||||||
if (CCorePlugin.getDefault() != null && CCorePlugin.getDefault().isDebugging()) {
|
if( CCorePlugin.getDefault() == null ) return;
|
||||||
|
if ( CCorePlugin.getDefault().isDebugging()) {
|
||||||
// Time stamp
|
// Time stamp
|
||||||
message = MessageFormat.format( "[{0}] {1}", new Object[] { new Long( System.currentTimeMillis() ), message } );
|
message = MessageFormat.format( "[{0}] {1}", new Object[] { new Long( System.currentTimeMillis() ), message } );
|
||||||
while (message.length() > 100) {
|
while (message.length() > 100) {
|
||||||
|
|
|
@ -1,3 +1,9 @@
|
||||||
|
2003-08-25 John Camelon
|
||||||
|
Fixed Bug 39530 - More problems with initializers.
|
||||||
|
Fixed Bug 37424 - Crash when opening big files
|
||||||
|
Refactored pointerOperators & cvQualifiers to not throw backtracks in optional case.
|
||||||
|
Added tracing support to cdt.core plugin via .options file.
|
||||||
|
|
||||||
2003-08-14 John Camelon
|
2003-08-14 John Camelon
|
||||||
Removed warnings from SymbolTable & QuickParseCallback (removing implicit accessor generation).
|
Removed warnings from SymbolTable & QuickParseCallback (removing implicit accessor generation).
|
||||||
Made IASTElaboratedTypeSpecifier derive from IASTOffsetableNamedElement (as it should).
|
Made IASTElaboratedTypeSpecifier derive from IASTOffsetableNamedElement (as it should).
|
||||||
|
|
|
@ -32,4 +32,9 @@ public interface IScanner {
|
||||||
public void setTokenizingMacroReplacementList(boolean b);
|
public void setTokenizingMacroReplacementList(boolean b);
|
||||||
|
|
||||||
public void onParseEnd();
|
public void onParseEnd();
|
||||||
|
/**
|
||||||
|
* @param i
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public int getLineNumberForOffset(int i);
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,6 +22,7 @@ import java.util.Stack;
|
||||||
import org.eclipse.cdt.core.parser.ISourceElementRequestor;
|
import org.eclipse.cdt.core.parser.ISourceElementRequestor;
|
||||||
import org.eclipse.cdt.core.parser.ScannerException;
|
import org.eclipse.cdt.core.parser.ScannerException;
|
||||||
import org.eclipse.cdt.core.parser.ast.IASTInclusion;
|
import org.eclipse.cdt.core.parser.ast.IASTInclusion;
|
||||||
|
import org.eclipse.cdt.internal.core.model.Util;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author aniefer
|
* @author aniefer
|
||||||
|
@ -85,7 +86,7 @@ public class ContextStack {
|
||||||
try {
|
try {
|
||||||
currentContext.getReader().close();
|
currentContext.getReader().close();
|
||||||
} catch (IOException ie) {
|
} catch (IOException ie) {
|
||||||
System.out.println("Error closing reader");
|
Util.debugLog("ContextStack : Error closing reader ");
|
||||||
}
|
}
|
||||||
|
|
||||||
if( currentContext.getKind() == IScannerContext.INCLUSION )
|
if( currentContext.getKind() == IScannerContext.INCLUSION )
|
||||||
|
|
|
@ -793,7 +793,7 @@ public class Parser implements IParser
|
||||||
DeclarationWrapper sdw =
|
DeclarationWrapper sdw =
|
||||||
new DeclarationWrapper(scope, LA(1).getOffset(), ownerTemplate);
|
new DeclarationWrapper(scope, LA(1).getOffset(), ownerTemplate);
|
||||||
|
|
||||||
declSpecifierSeq(false, tryConstructor, sdw);
|
declSpecifierSeq(false, tryConstructor, sdw, forKR );
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (sdw.getTypeSpecifier() == null && sdw.getSimpleType() != IASTSimpleTypeSpecifier.Type.UNSPECIFIED )
|
if (sdw.getTypeSpecifier() == null && sdw.getSimpleType() != IASTSimpleTypeSpecifier.Type.UNSPECIFIED )
|
||||||
|
@ -816,14 +816,14 @@ public class Parser implements IParser
|
||||||
if (LT(1) != IToken.tSEMI)
|
if (LT(1) != IToken.tSEMI)
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
declarator = initDeclarator(sdw);
|
declarator = initDeclarator(sdw, forKR);
|
||||||
|
|
||||||
while (LT(1) == IToken.tCOMMA)
|
while (LT(1) == IToken.tCOMMA)
|
||||||
{
|
{
|
||||||
consume();
|
consume();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
initDeclarator(sdw);
|
initDeclarator(sdw, forKR);
|
||||||
}
|
}
|
||||||
catch (Backtrack b)
|
catch (Backtrack b)
|
||||||
{
|
{
|
||||||
|
@ -1010,7 +1010,7 @@ public class Parser implements IParser
|
||||||
|
|
||||||
DeclarationWrapper sdw =
|
DeclarationWrapper sdw =
|
||||||
new DeclarationWrapper(scope, current.getOffset(), null);
|
new DeclarationWrapper(scope, current.getOffset(), null);
|
||||||
declSpecifierSeq(true, false, sdw);
|
declSpecifierSeq(true, false, sdw, false);
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (sdw.getTypeSpecifier() == null
|
if (sdw.getTypeSpecifier() == null
|
||||||
|
@ -1034,7 +1034,7 @@ public class Parser implements IParser
|
||||||
if (LT(1) != IToken.tSEMI)
|
if (LT(1) != IToken.tSEMI)
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
initDeclarator(sdw);
|
initDeclarator(sdw, false);
|
||||||
}
|
}
|
||||||
catch (Backtrack b)
|
catch (Backtrack b)
|
||||||
{
|
{
|
||||||
|
@ -1219,7 +1219,8 @@ public class Parser implements IParser
|
||||||
protected void declSpecifierSeq(
|
protected void declSpecifierSeq(
|
||||||
boolean parm,
|
boolean parm,
|
||||||
boolean tryConstructor,
|
boolean tryConstructor,
|
||||||
DeclarationWrapper sdw)
|
DeclarationWrapper sdw,
|
||||||
|
boolean forKR )
|
||||||
throws Backtrack
|
throws Backtrack
|
||||||
{
|
{
|
||||||
Flags flags = new Flags(parm, tryConstructor);
|
Flags flags = new Flags(parm, tryConstructor);
|
||||||
|
@ -1418,7 +1419,7 @@ public class Parser implements IParser
|
||||||
case IToken.t_class :
|
case IToken.t_class :
|
||||||
case IToken.t_struct :
|
case IToken.t_struct :
|
||||||
case IToken.t_union :
|
case IToken.t_union :
|
||||||
if (!parm)
|
if (!parm && !forKR )
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -1440,7 +1441,7 @@ public class Parser implements IParser
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case IToken.t_enum :
|
case IToken.t_enum :
|
||||||
if (!parm)
|
if (!parm || !forKR )
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -1684,7 +1685,7 @@ public class Parser implements IParser
|
||||||
* @return Returns the same object sent in.
|
* @return Returns the same object sent in.
|
||||||
* @throws Backtrack
|
* @throws Backtrack
|
||||||
*/
|
*/
|
||||||
protected void cvQualifier(
|
protected boolean cvQualifier(
|
||||||
Declarator declarator)
|
Declarator declarator)
|
||||||
throws Backtrack
|
throws Backtrack
|
||||||
{
|
{
|
||||||
|
@ -1693,13 +1694,13 @@ public class Parser implements IParser
|
||||||
case IToken.t_const :
|
case IToken.t_const :
|
||||||
consume( IToken.t_const );
|
consume( IToken.t_const );
|
||||||
declarator.addPtrOp(ASTPointerOperator.CONST_POINTER);
|
declarator.addPtrOp(ASTPointerOperator.CONST_POINTER);
|
||||||
return;
|
return true;
|
||||||
case IToken.t_volatile :
|
case IToken.t_volatile :
|
||||||
consume( IToken.t_volatile );
|
consume( IToken.t_volatile );
|
||||||
declarator.addPtrOp(ASTPointerOperator.VOLATILE_POINTER);
|
declarator.addPtrOp(ASTPointerOperator.VOLATILE_POINTER);
|
||||||
return;
|
return true;
|
||||||
default :
|
default :
|
||||||
throw backtrack;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
@ -1712,10 +1713,10 @@ public class Parser implements IParser
|
||||||
* @throws Backtrack request a backtrack
|
* @throws Backtrack request a backtrack
|
||||||
*/
|
*/
|
||||||
protected Declarator initDeclarator(
|
protected Declarator initDeclarator(
|
||||||
DeclarationWrapper sdw)
|
DeclarationWrapper sdw, boolean forKR )
|
||||||
throws Backtrack
|
throws Backtrack
|
||||||
{
|
{
|
||||||
Declarator d = declarator(sdw, sdw.getScope());
|
Declarator d = declarator(sdw, sdw.getScope(), forKR );
|
||||||
// handle = initializerClause
|
// handle = initializerClause
|
||||||
if (LT(1) == IToken.tASSIGN)
|
if (LT(1) == IToken.tASSIGN)
|
||||||
{
|
{
|
||||||
|
@ -1810,7 +1811,7 @@ public class Parser implements IParser
|
||||||
* @throws Backtrack request a backtrack
|
* @throws Backtrack request a backtrack
|
||||||
*/
|
*/
|
||||||
protected Declarator declarator(
|
protected Declarator declarator(
|
||||||
IDeclaratorOwner owner, IASTScope scope)
|
IDeclaratorOwner owner, IASTScope scope, boolean forKR )
|
||||||
throws Backtrack
|
throws Backtrack
|
||||||
{
|
{
|
||||||
Declarator d = null;
|
Declarator d = null;
|
||||||
|
@ -1819,21 +1820,12 @@ public class Parser implements IParser
|
||||||
{
|
{
|
||||||
d = new Declarator(owner);
|
d = new Declarator(owner);
|
||||||
|
|
||||||
for (;;)
|
consumePointerOperators(d, false);
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
ptrOperator(d);
|
|
||||||
}
|
|
||||||
catch (Backtrack b)
|
|
||||||
{
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (LT(1) == IToken.tLPAREN)
|
if (LT(1) == IToken.tLPAREN)
|
||||||
{
|
{
|
||||||
consume();
|
consume();
|
||||||
declarator(d, scope);
|
declarator(d, scope, forKR);
|
||||||
consume(IToken.tRPAREN);
|
consume(IToken.tRPAREN);
|
||||||
}
|
}
|
||||||
else if (LT(1) == IToken.t_operator)
|
else if (LT(1) == IToken.t_operator)
|
||||||
|
@ -1879,8 +1871,11 @@ public class Parser implements IParser
|
||||||
switch (LT(1))
|
switch (LT(1))
|
||||||
{
|
{
|
||||||
case IToken.tLPAREN :
|
case IToken.tLPAREN :
|
||||||
|
if( forKR )
|
||||||
|
throw backtrack;
|
||||||
|
|
||||||
// temporary fix for initializer/function declaration ambiguity
|
// temporary fix for initializer/function declaration ambiguity
|
||||||
if (!LA(2).looksLikeExpression())
|
if (!LA(2).looksLikeExpression() )
|
||||||
{
|
{
|
||||||
// parameterDeclarationClause
|
// parameterDeclarationClause
|
||||||
d.setIsFunction(true);
|
d.setIsFunction(true);
|
||||||
|
@ -2030,7 +2025,7 @@ public class Parser implements IParser
|
||||||
}
|
}
|
||||||
while (LT(1) != IToken.tLBRACE);
|
while (LT(1) != IToken.tLBRACE);
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Backtrack bt)
|
||||||
{
|
{
|
||||||
// Something is wrong,
|
// Something is wrong,
|
||||||
// this is not a proper K&R declaration clause
|
// this is not a proper K&R declaration clause
|
||||||
|
@ -2122,8 +2117,9 @@ public class Parser implements IParser
|
||||||
{
|
{
|
||||||
// this ptrOp doesn't belong to the declarator,
|
// this ptrOp doesn't belong to the declarator,
|
||||||
// it's just a part of the name
|
// it's just a part of the name
|
||||||
ptrOperator(d);
|
consumePointerOperators(d, true);
|
||||||
toSend = lastToken;
|
if( lastToken != null )
|
||||||
|
toSend = lastToken;
|
||||||
}
|
}
|
||||||
catch (Backtrack b)
|
catch (Backtrack b)
|
||||||
{
|
{
|
||||||
|
@ -2149,50 +2145,59 @@ public class Parser implements IParser
|
||||||
* @param owner Declarator that this pointer operator corresponds to.
|
* @param owner Declarator that this pointer operator corresponds to.
|
||||||
* @throws Backtrack request a backtrack
|
* @throws Backtrack request a backtrack
|
||||||
*/
|
*/
|
||||||
protected void ptrOperator(Declarator d) throws Backtrack
|
protected void consumePointerOperators(Declarator d, boolean consumeOnlyOne) throws Backtrack
|
||||||
{
|
{
|
||||||
int t = LT(1);
|
for( ; ; )
|
||||||
if (t == IToken.tAMPER)
|
{
|
||||||
{
|
int t = LT(1);
|
||||||
consume( IToken.tAMPER );
|
if (t == IToken.tAMPER)
|
||||||
d.addPtrOp(ASTPointerOperator.REFERENCE);
|
{
|
||||||
return;
|
consume( IToken.tAMPER );
|
||||||
}
|
d.addPtrOp(ASTPointerOperator.REFERENCE);
|
||||||
IToken mark = mark();
|
if( consumeOnlyOne ) return;
|
||||||
IToken tokenType = LA(1);
|
continue;
|
||||||
ITokenDuple nameDuple = null;
|
}
|
||||||
if (t == IToken.tIDENTIFIER || t == IToken.tCOLONCOLON)
|
IToken mark = mark();
|
||||||
{
|
IToken tokenType = LA(1);
|
||||||
nameDuple = name();
|
ITokenDuple nameDuple = null;
|
||||||
t = LT(1);
|
if (t == IToken.tIDENTIFIER || t == IToken.tCOLONCOLON)
|
||||||
}
|
{
|
||||||
if (t == IToken.tSTAR)
|
try
|
||||||
{
|
{
|
||||||
tokenType = consume(Token.tSTAR); // tokenType = "*"
|
nameDuple = name();
|
||||||
|
}
|
||||||
|
catch( Backtrack bt )
|
||||||
|
{
|
||||||
|
backup( mark );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
t = LT(1);
|
||||||
|
}
|
||||||
|
if (t == IToken.tSTAR)
|
||||||
|
{
|
||||||
|
tokenType = consume(Token.tSTAR); // tokenType = "*"
|
||||||
|
|
||||||
d.setPointerOperatorName(nameDuple);
|
d.setPointerOperatorName(nameDuple);
|
||||||
|
|
||||||
boolean successful = false;
|
boolean successful = false;
|
||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
try
|
boolean newSuccess = cvQualifier(d);
|
||||||
{
|
if( newSuccess ) successful = true;
|
||||||
cvQualifier(d);
|
else break;
|
||||||
successful = true;
|
|
||||||
}
|
|
||||||
catch (Backtrack b)
|
|
||||||
{
|
|
||||||
// expected at some point
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if( !successful )
|
|
||||||
d.addPtrOp( ASTPointerOperator.POINTER );
|
|
||||||
|
|
||||||
return;
|
}
|
||||||
}
|
|
||||||
backup(mark);
|
if( !successful )
|
||||||
throw backtrack;
|
{
|
||||||
|
d.addPtrOp( ASTPointerOperator.POINTER );
|
||||||
|
}
|
||||||
|
if( consumeOnlyOne ) return;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
backup(mark);
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Parse an enumeration specifier, as according to the ANSI specs in C & C++.
|
* Parse an enumeration specifier, as according to the ANSI specs in C & C++.
|
||||||
|
@ -4401,6 +4406,9 @@ public class Parser implements IParser
|
||||||
private IScanner scanner;
|
private IScanner scanner;
|
||||||
private IToken currToken, // current token we plan to consume next
|
private IToken currToken, // current token we plan to consume next
|
||||||
lastToken; // last token we consumed
|
lastToken; // last token we consumed
|
||||||
|
|
||||||
|
private int highWaterOffset = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fetches a token from the scanner.
|
* Fetches a token from the scanner.
|
||||||
*
|
*
|
||||||
|
@ -4411,7 +4419,17 @@ public class Parser implements IParser
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
return scanner.nextToken();
|
IToken t = scanner.nextToken();
|
||||||
|
if( t.getEndOffset() > highWaterOffset )
|
||||||
|
highWaterOffset = t.getEndOffset();
|
||||||
|
if( t.getOffset() == 872556 )
|
||||||
|
{
|
||||||
|
Util.debugLog( "This is the point of failure.");
|
||||||
|
Util.debugLog( "Token is of image =" + t.getImage() );
|
||||||
|
Util.debugLog( "Token is on line " + scanner.getLineNumberForOffset( t.getOffset() ) );
|
||||||
|
}
|
||||||
|
Util.debugLog( "FetchToken retrieved token w/offset=" + t.getOffset() );
|
||||||
|
return t;
|
||||||
}
|
}
|
||||||
catch (EndOfFile e)
|
catch (EndOfFile e)
|
||||||
{
|
{
|
||||||
|
@ -4419,7 +4437,7 @@ public class Parser implements IParser
|
||||||
}
|
}
|
||||||
catch (ScannerException e)
|
catch (ScannerException e)
|
||||||
{
|
{
|
||||||
// e.printStackTrace();
|
Util.debugLog( "ScannerException thrown : " + e.getMessage() );
|
||||||
return fetchToken();
|
return fetchToken();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,6 +26,7 @@ import java.util.Vector;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.parser.Backtrack;
|
import org.eclipse.cdt.core.parser.Backtrack;
|
||||||
import org.eclipse.cdt.core.parser.EndOfFile;
|
import org.eclipse.cdt.core.parser.EndOfFile;
|
||||||
|
import org.eclipse.cdt.core.parser.ILineOffsetReconciler;
|
||||||
import org.eclipse.cdt.core.parser.IMacroDescriptor;
|
import org.eclipse.cdt.core.parser.IMacroDescriptor;
|
||||||
import org.eclipse.cdt.core.parser.IParser;
|
import org.eclipse.cdt.core.parser.IParser;
|
||||||
import org.eclipse.cdt.core.parser.IProblemReporter;
|
import org.eclipse.cdt.core.parser.IProblemReporter;
|
||||||
|
@ -42,6 +43,7 @@ import org.eclipse.cdt.core.parser.ast.ExpressionEvaluationException;
|
||||||
import org.eclipse.cdt.core.parser.ast.IASTExpression;
|
import org.eclipse.cdt.core.parser.ast.IASTExpression;
|
||||||
import org.eclipse.cdt.core.parser.ast.IASTFactory;
|
import org.eclipse.cdt.core.parser.ast.IASTFactory;
|
||||||
import org.eclipse.cdt.core.parser.ast.IASTInclusion;
|
import org.eclipse.cdt.core.parser.ast.IASTInclusion;
|
||||||
|
import org.eclipse.cdt.internal.core.model.Util;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -51,10 +53,13 @@ import org.eclipse.cdt.core.parser.ast.IASTInclusion;
|
||||||
|
|
||||||
public class Scanner implements IScanner {
|
public class Scanner implements IScanner {
|
||||||
|
|
||||||
public Scanner(Reader reader, String filename, IScannerInfo info, IProblemReporter problemReporter, ITranslationResult unitResult, ISourceElementRequestor requestor, ParserMode parserMode ) {
|
private Reader backupReader;
|
||||||
|
|
||||||
|
public Scanner(Reader reader, String filename, IScannerInfo info, IProblemReporter problemReporter, ITranslationResult unitResult, ISourceElementRequestor requestor, ParserMode parserMode ) {
|
||||||
this.requestor = requestor;
|
this.requestor = requestor;
|
||||||
this.mode = parserMode;
|
this.mode = parserMode;
|
||||||
astFactory = ParserFactory.createASTFactory( mode );
|
astFactory = ParserFactory.createASTFactory( mode );
|
||||||
|
this.backupReader = reader;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
//this is a hack to get around a sudden EOF experience
|
//this is a hack to get around a sudden EOF experience
|
||||||
|
@ -2133,7 +2138,7 @@ public class Scanner implements IScanner {
|
||||||
BAD_PP + contextStack.getCurrentContext().getOffset());
|
BAD_PP + contextStack.getCurrentContext().getOffset());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
System.out.println("Unexpected character " + ((char) c));
|
Util.debugLog("Scanner : Encountered unexpected character " + ((char) c));
|
||||||
if (throwExceptionOnBadPreprocessorSyntax)
|
if (throwExceptionOnBadPreprocessorSyntax)
|
||||||
throw new ScannerException(BAD_PP + contextStack.getCurrentContext().getOffset());
|
throw new ScannerException(BAD_PP + contextStack.getCurrentContext().getOffset());
|
||||||
}
|
}
|
||||||
|
@ -2325,7 +2330,7 @@ public class Scanner implements IScanner {
|
||||||
"Improper use of macro " + symbol);
|
"Improper use of macro " + symbol);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
System.out.println(
|
Util.debugLog(
|
||||||
"Unexpected class stored in definitions table. "
|
"Unexpected class stored in definitions table. "
|
||||||
+ expansion.getClass().getName());
|
+ expansion.getClass().getName());
|
||||||
}
|
}
|
||||||
|
@ -2546,4 +2551,15 @@ public class Scanner implements IScanner {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see org.eclipse.cdt.core.parser.IScanner#getLineNumberForOffset(int)
|
||||||
|
*/
|
||||||
|
public int getLineNumberForOffset(int i)
|
||||||
|
{
|
||||||
|
ILineOffsetReconciler reconciler = ParserFactory.createLineOffsetReconciler( backupReader );
|
||||||
|
return reconciler.getLineNumberForOffset(i);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -78,6 +78,11 @@ public class Token implements IToken {
|
||||||
case tAMPER:
|
case tAMPER:
|
||||||
case tDOT:
|
case tDOT:
|
||||||
case tLPAREN:
|
case tLPAREN:
|
||||||
|
case tMINUS:
|
||||||
|
case tSTAR:
|
||||||
|
case tPLUS:
|
||||||
|
case tNOT:
|
||||||
|
case tCOMPL:
|
||||||
return true;
|
return true;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Add table
Reference in a new issue