mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Partial fix for https://bugs.eclipse.org/bugs/show_bug.cgi?id=59468
This commit is contained in:
parent
fc6b681d61
commit
d763240879
4 changed files with 23 additions and 84 deletions
|
@ -1,3 +1,6 @@
|
||||||
|
2004-04-21 John Camelon
|
||||||
|
Removed unused testInclusions() test from ScannerTestCase.
|
||||||
|
|
||||||
2004-04-20 Andrew Niefer
|
2004-04-20 Andrew Niefer
|
||||||
added parser/CompleteParseASTTest.testBug59302()
|
added parser/CompleteParseASTTest.testBug59302()
|
||||||
|
|
||||||
|
|
|
@ -158,10 +158,6 @@ public class ScannerTestCase extends BaseScannerTest
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public final static boolean doIncludeStdio= false;
|
|
||||||
public final static boolean doIncludeWindowsH= false;
|
|
||||||
public final static boolean doIncludeWinUserH= false;
|
|
||||||
|
|
||||||
public final static int SIZEOF_TRUTHTABLE = 10;
|
public final static int SIZEOF_TRUTHTABLE = 10;
|
||||||
|
|
||||||
|
@ -356,41 +352,6 @@ public class ScannerTestCase extends BaseScannerTest
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void prepareForWindowsRH()
|
|
||||||
{
|
|
||||||
scanner.addIncludePath(
|
|
||||||
"C:\\Program Files\\Microsoft Visual Studio\\VC98\\Include");
|
|
||||||
scanner.addDefinition("_WIN32_WINNT", "0x0300");
|
|
||||||
scanner.addDefinition("WINVER", "0x0400");
|
|
||||||
scanner.addDefinition("_WIN32_WINDOWS", "0x0300");
|
|
||||||
scanner.addDefinition("_MSC_VER", "1200");
|
|
||||||
}
|
|
||||||
|
|
||||||
public void prepareForWindowsH()
|
|
||||||
{
|
|
||||||
scanner.addIncludePath(
|
|
||||||
"C:\\Program Files\\Microsoft Visual Studio\\VC98\\Include");
|
|
||||||
scanner.addDefinition("_MSC_VER", "1200");
|
|
||||||
scanner.addDefinition("__cplusplus", "1");
|
|
||||||
scanner.addDefinition("__STDC__", "1");
|
|
||||||
scanner.addDefinition("_WIN32", "");
|
|
||||||
scanner.addDefinition( "__midl", "1000" );
|
|
||||||
scanner.addDefinition("_WIN32_WINNT", "0x0300");
|
|
||||||
scanner.addDefinition("WINVER", "0x0400");
|
|
||||||
scanner.addDefinition( "_M_IX86", "300");
|
|
||||||
scanner.addDefinition( "_INTEGRAL_MAX_BITS", "64");
|
|
||||||
}
|
|
||||||
|
|
||||||
public void prepareForStdio()
|
|
||||||
{
|
|
||||||
scanner.addIncludePath(
|
|
||||||
"C:\\Program Files\\Microsoft Visual Studio\\VC98\\Include");
|
|
||||||
scanner.addDefinition("_MSC_VER", "1100");
|
|
||||||
scanner.addDefinition("__STDC__", "1");
|
|
||||||
scanner.addDefinition("_INTEGRAL_MAX_BITS", "64");
|
|
||||||
scanner.addDefinition("_WIN32", "");
|
|
||||||
scanner.addDefinition( "_M_IX86", "300");
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testConcatenation()
|
public void testConcatenation()
|
||||||
{
|
{
|
||||||
|
@ -888,51 +849,6 @@ public class ScannerTestCase extends BaseScannerTest
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testInclusions()
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
if (doIncludeStdio)
|
|
||||||
{
|
|
||||||
initializeScanner("#include <stdio.h>");
|
|
||||||
prepareForStdio();
|
|
||||||
int count= fullyTokenize();
|
|
||||||
if (verbose)
|
|
||||||
System.out.println(
|
|
||||||
"For stdio.h, Scanner produced " + count + " tokens");
|
|
||||||
validateBalance();
|
|
||||||
|
|
||||||
initializeScanner("#include \\\n<\\\nstdio.h \\\n>");
|
|
||||||
prepareForStdio();
|
|
||||||
count= fullyTokenize();
|
|
||||||
if (verbose)
|
|
||||||
System.out.println(
|
|
||||||
"For stdio.h, Scanner produced " + count + " tokens");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (doIncludeWindowsH)
|
|
||||||
{
|
|
||||||
initializeScanner("#include <Windows.h>");
|
|
||||||
prepareForWindowsH();
|
|
||||||
int count= fullyTokenize();
|
|
||||||
|
|
||||||
validateBalance();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (doIncludeWinUserH)
|
|
||||||
{
|
|
||||||
initializeScanner("#include <WinUser.rh>");
|
|
||||||
prepareForWindowsRH();
|
|
||||||
validateEOF();
|
|
||||||
validateBalance();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
fail(EXCEPTION_THROWN + e.toString());
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testOtherPreprocessorCommands() throws ParserFactoryError
|
public void testOtherPreprocessorCommands() throws ParserFactoryError
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
|
2004-04-21 John Camelon
|
||||||
|
Partial fix for https://bugs.eclipse.org/bugs/show_bug.cgi?id=59468
|
||||||
|
|
||||||
2004-04-20 Andrew Niefer
|
2004-04-20 Andrew Niefer
|
||||||
fixed https://bugs.eclipse.org/bugs/show_bug.cgi?id=59302 - Nested friend mishandled
|
fixed https://bugs.eclipse.org/bugs/show_bug.cgi?id=59302 - Nested friend mishandled
|
||||||
|
|
||||||
|
|
|
@ -12,6 +12,7 @@ package org.eclipse.cdt.internal.core.parser;
|
||||||
|
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
import org.eclipse.cdt.core.parser.BacktrackException;
|
||||||
import org.eclipse.cdt.core.parser.EndOfFileException;
|
import org.eclipse.cdt.core.parser.EndOfFileException;
|
||||||
import org.eclipse.cdt.core.parser.IParserLogService;
|
import org.eclipse.cdt.core.parser.IParserLogService;
|
||||||
import org.eclipse.cdt.core.parser.IScanner;
|
import org.eclipse.cdt.core.parser.IScanner;
|
||||||
|
@ -212,4 +213,20 @@ public class ContextualParser extends CompleteParser {
|
||||||
protected void setCurrentFunctionName(String functionName) {
|
protected void setCurrentFunctionName(String functionName) {
|
||||||
currentFunctionName = functionName;
|
currentFunctionName = functionName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void handleFunctionBody(IASTScope scope) throws BacktrackException, EndOfFileException
|
||||||
|
{
|
||||||
|
if( scanner.isOnTopContext() )
|
||||||
|
functionBody(scope);
|
||||||
|
else
|
||||||
|
skipOverCompoundStatement();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void catchBlockCompoundStatement(IASTScope scope) throws BacktrackException, EndOfFileException
|
||||||
|
{
|
||||||
|
if( scanner.isOnTopContext() )
|
||||||
|
compoundStatement(scope, true);
|
||||||
|
else
|
||||||
|
skipOverCompoundStatement();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue