1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

remove warnings

This commit is contained in:
Andrew Niefer 2004-05-28 14:54:58 +00:00
parent e5c605c11d
commit a7e23f8c15
38 changed files with 1231 additions and 1276 deletions

View file

@ -12,8 +12,6 @@ package org.eclipse.cdt.core.parser.failedTests;
import java.util.Iterator;
import org.eclipse.cdt.core.parser.ast.IASTAbstractTypeSpecifierDeclaration;
import org.eclipse.cdt.core.parser.ast.IASTClassSpecifier;
import org.eclipse.cdt.core.parser.ast.IASTFunction;
import org.eclipse.cdt.core.parser.ast.IASTVariable;
import org.eclipse.cdt.core.parser.tests.CompleteParseBaseTest;
@ -43,9 +41,9 @@ public class FailedCompleteParseASTTest extends CompleteParseBaseTest
{
//parse no longer passes
try{
parse ("class A { int m(int); }; \n A a; int A::*pm = &A::m; \n int f(){} \n int f(int); \n int x = f((a.*pm)(5));");
parse ("class A { int m(int); }; \n A a; int A::*pm = &A::m; \n int f(){} \n int f(int); \n int x = f((a.*pm)(5));"); //$NON-NLS-1$
} catch ( ParserException e ){
assertTrue( e.getMessage().equals( "FAILURE" ) );
assertTrue( e.getMessage().equals( "FAILURE" ) ); //$NON-NLS-1$
}
// Iterator i = parse ("class A { int m(int); }; \n A a; int A::*pm = &A::m; \n int f(){} \n int f(int); \n int x = f((a.*pm)(5));").getDeclarations();
// IASTClassSpecifier cl = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)i.next()).getTypeSpecifier();
@ -65,9 +63,9 @@ public class FailedCompleteParseASTTest extends CompleteParseBaseTest
{
//parse no longer passes
try{
parse ("class A { int m(int); }; \n A * a; int A::*pm = &A::m; \n int f(){} \n int f(int); \n int x = f((a->*pm)(5));");
parse ("class A { int m(int); }; \n A * a; int A::*pm = &A::m; \n int f(){} \n int f(int); \n int x = f((a->*pm)(5));"); //$NON-NLS-1$
} catch ( ParserException e ){
assertTrue( e.getMessage().equals( "FAILURE" ) );
assertTrue( e.getMessage().equals( "FAILURE" ) ); //$NON-NLS-1$
}
// Iterator i = parse ("class A { int m(int); }; \n A * a; int A::*pm = &A::m; \n int f(){} \n int f(int); \n int x = f((a->*pm)(5));").getDeclarations();
// IASTClassSpecifier cl = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)i.next()).getTypeSpecifier();
@ -85,7 +83,7 @@ public class FailedCompleteParseASTTest extends CompleteParseBaseTest
}
public void testUnaryStarCastexpressionPointerToFunction_Bug43241() throws Exception
{
Iterator i = parse ("int m(int); \n int *pm = &m; \n int f(){} \n int f(int); \n int x = f((*pm)(5));").getDeclarations();
Iterator i = parse ("int m(int); \n int *pm = &m; \n int f(){} \n int f(int); \n int x = f((*pm)(5));").getDeclarations(); //$NON-NLS-1$
IASTFunction m = (IASTFunction) i.next();
IASTVariable pm = (IASTVariable) i.next();
IASTFunction f1 = (IASTFunction) i.next();
@ -103,9 +101,9 @@ public class FailedCompleteParseASTTest extends CompleteParseBaseTest
{
//parse no longer passes
try{
parse ( "class A { int m; }; \n A a; int A::*pm; \n int f(){} \n int f(int); \n int x = f(a.*pm);" );
parse ( "class A { int m; }; \n A a; int A::*pm; \n int f(){} \n int f(int); \n int x = f(a.*pm);" ); //$NON-NLS-1$
} catch ( ParserException e ){
assertTrue( e.getMessage().equals( "FAILURE" ) );
assertTrue( e.getMessage().equals( "FAILURE" ) ); //$NON-NLS-1$
}
// Iterator i = parse ("class A { int m; }; \n A a; int A::*pm; \n int f(){} \n int f(int); \n int x = f(a.*pm);").getDeclarations();
// IASTClassSpecifier cl = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)i.next()).getTypeSpecifier();
@ -123,9 +121,9 @@ public class FailedCompleteParseASTTest extends CompleteParseBaseTest
{
//parse no longer passes
try{
parse ("class A { int m; }; \n A * a; int A::*pm; \n int f(){} \n int f(int); \n int x = f(a->*pm);");
parse ("class A { int m; }; \n A * a; int A::*pm; \n int f(){} \n int f(int); \n int x = f(a->*pm);"); //$NON-NLS-1$
} catch ( ParserException e ){
assertTrue( e.getMessage().equals( "FAILURE" ) );
assertTrue( e.getMessage().equals( "FAILURE" ) ); //$NON-NLS-1$
}
// Iterator i = parse ("class A { int m; }; \n A * a; int A::*pm; \n int f(){} \n int f(int); \n int x = f(a->*pm);").getDeclarations();
// IASTClassSpecifier cl = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)i.next()).getTypeSpecifier();

View file

@ -72,14 +72,14 @@ public abstract class AutomatedFramework extends TestCase {
continue;
}
if( filePath.endsWith(".cpp") || filePath.endsWith(".hpp") ||
filePath.endsWith(".cc") || filePath.endsWith(".CC") ||
filePath.endsWith(".C") ||
filePath.endsWith(".hxx") || filePath.endsWith(".hh") )
if( filePath.endsWith(".cpp") || filePath.endsWith(".hpp") || //$NON-NLS-1$ //$NON-NLS-2$
filePath.endsWith(".cc") || filePath.endsWith(".CC") || //$NON-NLS-1$ //$NON-NLS-2$
filePath.endsWith(".C") || //$NON-NLS-1$
filePath.endsWith(".hxx") || filePath.endsWith(".hh") ) //$NON-NLS-1$ //$NON-NLS-2$
{
AutomatedTest.natures.put( filePath, "cpp" );
} else if( filePath.endsWith(".c") ){
AutomatedTest.natures.put( filePath, "c" );
AutomatedTest.natures.put( filePath, "cpp" ); //$NON-NLS-1$
} else if( filePath.endsWith(".c") ){ //$NON-NLS-1$
AutomatedTest.natures.put( filePath, "c" ); //$NON-NLS-1$
} else {
AutomatedTest.natures.put( filePath, AutomatedTest.defaultNature );
}
@ -95,19 +95,19 @@ public abstract class AutomatedFramework extends TestCase {
}
public void reportFailed() {
fail( "Unable to open " + outputFile + "for output of results." );
fail( "Unable to open " + outputFile + "for output of results." ); //$NON-NLS-1$ //$NON-NLS-2$
}
public void propertiesFailed() {
fail( "Unable to load properties file." );
fail( "Unable to load properties file." ); //$NON-NLS-1$
}
protected void runTest() throws Throwable {
String name = getName();
if( name.equals("propertiesFailed") )
if( name.equals("propertiesFailed") ) //$NON-NLS-1$
propertiesFailed();
else if ( name.equals("reportFailed") )
else if ( name.equals("reportFailed") ) //$NON-NLS-1$
reportFailed();
else
doFile();
@ -119,10 +119,10 @@ public abstract class AutomatedFramework extends TestCase {
try{
loadProperties();
} catch( Exception e ){
suite.addTest( newTest( "propertiesFailed") );
suite.addTest( newTest( "propertiesFailed") ); //$NON-NLS-1$
}
if( outputFile != null && !outputFile.equals("") ){
if( outputFile != null && !outputFile.equals("") ){ //$NON-NLS-1$
try{
File output = new File( outputFile );
@ -136,7 +136,7 @@ public abstract class AutomatedFramework extends TestCase {
report = new FileOutputStream( output );
} catch( Exception e ) {
suite.addTest( newTest( "reportFailed" ) );
suite.addTest( newTest( "reportFailed" ) ); //$NON-NLS-1$
}
}
@ -170,15 +170,15 @@ public abstract class AutomatedFramework extends TestCase {
static private class Filter implements FilenameFilter
{
public boolean accept(File dir, String name) {
if( name.endsWith(".cpp") ||
name.endsWith(".c") ||
name.endsWith(".cc") ||
name.endsWith(".CC") ||
name.endsWith(".C") ||
name.endsWith(".h") ||
name.endsWith(".hh") ||
name.endsWith(".hpp") ||
name.endsWith(".hxx"))
if( name.endsWith(".cpp") || //$NON-NLS-1$
name.endsWith(".c") || //$NON-NLS-1$
name.endsWith(".cc") || //$NON-NLS-1$
name.endsWith(".CC") || //$NON-NLS-1$
name.endsWith(".C") || //$NON-NLS-1$
name.endsWith(".h") || //$NON-NLS-1$
name.endsWith(".hh") || //$NON-NLS-1$
name.endsWith(".hpp") || //$NON-NLS-1$
name.endsWith(".hxx")) //$NON-NLS-1$
{
return true;
}

View file

@ -57,7 +57,7 @@ public class AutomatedTest extends AutomatedFramework {
FileInputStream stream = new FileInputStream( file );
String filePath = file.getCanonicalPath();
ParserLanguage language = ((String)natures.get( filePath )).equalsIgnoreCase("cpp") ? ParserLanguage.CPP : ParserLanguage.C;
ParserLanguage language = ((String)natures.get( filePath )).equalsIgnoreCase("cpp") ? ParserLanguage.CPP : ParserLanguage.C; //$NON-NLS-1$
parser = ParserFactory.createParser( ParserFactory.createScanner( new InputStreamReader (stream), filePath, new ScannerInfo(), ParserMode.QUICK_PARSE, language, nullCallback, null, null ), nullCallback, ParserMode.QUICK_PARSE, language, null);
mapping = ParserFactory.createLineOffsetReconciler( new InputStreamReader( stream ) );
@ -68,11 +68,11 @@ public class AutomatedTest extends AutomatedFramework {
{
String output = null;
if( e instanceof AssertionFailedError ){
output = file.getCanonicalPath() + ": Parse failed on line ";
output += mapping.getLineNumberForOffset(parser.getLastErrorOffset()) + "\n";
output = file.getCanonicalPath() + ": Parse failed on line "; //$NON-NLS-1$
output += mapping.getLineNumberForOffset(parser.getLastErrorOffset()) + "\n"; //$NON-NLS-1$
} else {
output = file.getCanonicalPath() + ": " + e.getClass().toString();
output += " on line " + mapping.getLineNumberForOffset(parser.getLastErrorOffset()) + "\n";
output = file.getCanonicalPath() + ": " + e.getClass().toString(); //$NON-NLS-1$
output += " on line " + mapping.getLineNumberForOffset(parser.getLastErrorOffset()) + "\n"; //$NON-NLS-1$ //$NON-NLS-2$
}
if( report != null ){
report.write( output.getBytes() );
@ -101,19 +101,19 @@ public class AutomatedTest extends AutomatedFramework {
}
protected void loadProperties() throws Exception{
String resourcePath = org.eclipse.core.runtime.Platform.getPlugin("org.eclipse.cdt.core.tests").find(new Path("/")).getFile();
resourcePath += "resources/parser/AutomatedTest";
String resourcePath = org.eclipse.core.runtime.Platform.getPlugin("org.eclipse.cdt.core.tests").find(new Path("/")).getFile(); //$NON-NLS-1$ //$NON-NLS-2$
resourcePath += "resources/parser/AutomatedTest"; //$NON-NLS-1$
try{
FileInputStream propertiesIn = new FileInputStream( resourcePath + "/AutomatedTest.properties");
FileInputStream propertiesIn = new FileInputStream( resourcePath + "/AutomatedTest.properties"); //$NON-NLS-1$
properties.load( propertiesIn );
outputFile = properties.getProperty( "outputFile", "" );
String sourceInfo = properties.getProperty( "source", "" );
if( sourceInfo.equals("") )
outputFile = properties.getProperty( "outputFile", "" ); //$NON-NLS-1$ //$NON-NLS-2$
String sourceInfo = properties.getProperty( "source", "" ); //$NON-NLS-1$ //$NON-NLS-2$
if( sourceInfo.equals("") ) //$NON-NLS-1$
throw new FileNotFoundException();
else{
StringTokenizer tokenizer = new StringTokenizer( sourceInfo, "," );
StringTokenizer tokenizer = new StringTokenizer( sourceInfo, "," ); //$NON-NLS-1$
String str = null, val = null;
try{
while( tokenizer.hasMoreTokens() ){
@ -124,13 +124,13 @@ public class AutomatedTest extends AutomatedFramework {
}
} catch ( NoSuchElementException e ){
//only way to get here is to have a missing val, assume cpp for that str
testSources.put( str, "cpp" );
testSources.put( str, "cpp" ); //$NON-NLS-1$
}
}
} catch ( FileNotFoundException e ){
testSources.put( resourcePath + "/defaultCpp", "cpp" );
testSources.put( resourcePath + "/defaultC", "c" );
testSources.put( resourcePath + "/defaultCpp", "cpp" ); //$NON-NLS-1$ //$NON-NLS-2$
testSources.put( resourcePath + "/defaultC", "c" ); //$NON-NLS-1$ //$NON-NLS-2$
}
}

View file

@ -142,7 +142,7 @@ public class BranchTrackerTest extends TestCase {
assertTrue( bt.poundEndif() );
assertEquals(0, bt.getDepth());
} catch (EmptyStackException se) {
fail("Unexpected Scanner exception thrown");
fail("Unexpected Scanner exception thrown"); //$NON-NLS-1$
}
}
@ -199,7 +199,7 @@ public class BranchTrackerTest extends TestCase {
}
catch( EmptyStackException se )
{
fail( "Exception" );
fail( "Exception" ); //$NON-NLS-1$
}
}
}

View file

@ -34,7 +34,7 @@ public class CompleteParseASTExpressionTest extends CompleteParseBaseTest{
// Kind PRIMARY_EMPTY : void
public void testPrimaryEmpty() throws Exception
{
Iterator i = parse ("int f(char); \n int f(void); \n int x = f();").getDeclarations();
Iterator i = parse ("int f(char); \r\n int f(void); \r\n int x = f();").getDeclarations(); //$NON-NLS-1$
IASTFunction f1 = (IASTFunction) i.next();
IASTFunction f2 = (IASTFunction) i.next();
IASTVariable x = (IASTVariable) i.next();
@ -43,7 +43,7 @@ public class CompleteParseASTExpressionTest extends CompleteParseBaseTest{
// Kind PRIMARY_INTEGER_LITERAL : int
public void testPrimaryIntegerLiteral() throws Exception
{
Iterator i = parse ("int f(int, int); \n int f(int); \n int x = f(1, 2+3);").getDeclarations();
Iterator i = parse ("int f(int, int); \n int f(int); \n int x = f(1, 2+3);").getDeclarations(); //$NON-NLS-1$
IASTFunction f1 = (IASTFunction) i.next();
IASTFunction f2 = (IASTFunction) i.next();
IASTVariable x = (IASTVariable) i.next();
@ -52,7 +52,7 @@ public class CompleteParseASTExpressionTest extends CompleteParseBaseTest{
// Kind PRIMARY_CHAR_LITERAL : char
public void testPrimaryCharLiteral() throws Exception
{
Iterator i = parse ("int f(char, int); \n int f(char); \n int x = f('c');").getDeclarations();
Iterator i = parse ("int f(char, int); \n int f(char); \n int x = f('c');").getDeclarations(); //$NON-NLS-1$
IASTFunction f1 = (IASTFunction) i.next();
IASTFunction f2 = (IASTFunction) i.next();
IASTVariable x = (IASTVariable) i.next();
@ -61,7 +61,7 @@ public class CompleteParseASTExpressionTest extends CompleteParseBaseTest{
// Kind PRIMARY_FLOAT_LITERAL : float
public void testPrimaryFloatLiteral() throws Exception
{
Iterator i = parse ("int f(char); \n int f(float); \n int x = f(1.13);").getDeclarations();
Iterator i = parse ("int f(char); \n int f(float); \n int x = f(1.13);").getDeclarations(); //$NON-NLS-1$
IASTFunction f1 = (IASTFunction) i.next();
IASTFunction f2 = (IASTFunction) i.next();
IASTVariable x = (IASTVariable) i.next();
@ -70,7 +70,7 @@ public class CompleteParseASTExpressionTest extends CompleteParseBaseTest{
// Kind PRIMARY_STRING_LITERAL : char*
public void testPrimaryStringLiteral() throws Exception
{
Iterator i = parse ("int f(char); \n int f(char*); \n int x = f(\"str\");").getDeclarations();
Iterator i = parse ("int f(char); \n int f(char*); \n int x = f(\"str\");").getDeclarations(); //$NON-NLS-1$
IASTFunction f1 = (IASTFunction) i.next();
IASTFunction f2 = (IASTFunction) i.next();
IASTVariable x = (IASTVariable) i.next();
@ -79,7 +79,7 @@ public class CompleteParseASTExpressionTest extends CompleteParseBaseTest{
// Kind PRIMARY_BOOLEAN_LITERAL : bool
public void testPrimaryBooleanLiteral() throws Exception
{
Iterator i = parse ("int f(bool); \n int f(float); \n int x = f(true);").getDeclarations();
Iterator i = parse ("int f(bool); \n int f(float); \n int x = f(true);").getDeclarations(); //$NON-NLS-1$
IASTFunction f1 = (IASTFunction) i.next();
IASTFunction f2 = (IASTFunction) i.next();
IASTVariable x = (IASTVariable) i.next();
@ -88,7 +88,7 @@ public class CompleteParseASTExpressionTest extends CompleteParseBaseTest{
// Kind PRIMARY_THIS : type of inner most enclosing structure scope
public void testPrimaryThis() throws Exception
{
Iterator i = parse ("class A{ int m(); }; A a; \n int f(void); \n int f(A * a); \n int A::m(){ int x = f(this); }").getDeclarations();
Iterator i = parse ("class A{ int m(); }; A a; \n int f(void); \n int f(A * a); \n int A::m(){ int x = f(this); }").getDeclarations(); //$NON-NLS-1$
IASTClassSpecifier cl = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)i.next()).getTypeSpecifier();
Iterator members = getDeclarations(cl);
IASTMethod method = (IASTMethod)members.next();
@ -102,7 +102,7 @@ public class CompleteParseASTExpressionTest extends CompleteParseBaseTest{
// Kind PRIMARY_BRACKETED_EXPRESSION : LHS
public void testPrimaryBracketedExpression() throws Exception
{
Iterator i = parse ("int f(int, int); \n int f(int); \n int x = f(1, (2+3));").getDeclarations();
Iterator i = parse ("int f(int, int); \n int f(int); \n int x = f(1, (2+3));").getDeclarations(); //$NON-NLS-1$
IASTFunction f1 = (IASTFunction) i.next();
IASTFunction f2 = (IASTFunction) i.next();
IASTVariable x = (IASTVariable) i.next();
@ -111,7 +111,7 @@ public class CompleteParseASTExpressionTest extends CompleteParseBaseTest{
// Kind ID_EXPRESSION : type of the ID
public void testIdExpression() throws Exception
{
Iterator i = parse ("class A{}a; \n int f(A a); \n int f(void); \n int x = f(a);").getDeclarations();
Iterator i = parse ("class A{}a; \n int f(A a); \n int f(void); \n int x = f(a);").getDeclarations(); //$NON-NLS-1$
IASTVariable a = (IASTVariable) i.next();
IASTClassSpecifier cl = (IASTClassSpecifier)a.getAbstractDeclaration().getTypeSpecifier();
@ -124,7 +124,7 @@ public class CompleteParseASTExpressionTest extends CompleteParseBaseTest{
// Kind ID_EXPRESSION ( refers to a pointer ) : pointer to type of ID
public void testIdExpressionToPointer() throws Exception
{
Iterator i = parse ("class A {}; \n A * pa; \n int f(A *ia){} \n int f(void); \n int x = f(pa);").getDeclarations();
Iterator i = parse ("class A {}; \n A * pa; \n int f(A *ia){} \n int f(void); \n int x = f(pa);").getDeclarations(); //$NON-NLS-1$
IASTClassSpecifier cl = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)i.next()).getTypeSpecifier();
IASTVariable a = (IASTVariable) i.next();
IASTFunction f1 = (IASTFunction) i.next();
@ -136,7 +136,7 @@ public class CompleteParseASTExpressionTest extends CompleteParseBaseTest{
// Kind POSTFIX_SUBSCRIPT
public void testPostfixSubscript() throws Exception
{
Iterator i = parse ("int pa[10]; \n int f(int ia){} \n int f(void); \n int x = f(pa[1]);").getDeclarations();
Iterator i = parse ("int pa[10]; \n int f(int ia){} \n int f(void); \n int x = f(pa[1]);").getDeclarations(); //$NON-NLS-1$
IASTVariable pa = (IASTVariable) i.next();
IASTFunction f1 = (IASTFunction) i.next();
IASTFunction f2 = (IASTFunction) i.next();
@ -146,7 +146,7 @@ public class CompleteParseASTExpressionTest extends CompleteParseBaseTest{
public void testPostfixSubscriptA() throws Exception
{
Iterator i = parse ("int pa[10][5] ; \n int f(int ia){} \n int f(void); \n int x = f(pa[1][2]);").getDeclarations();
Iterator i = parse ("int pa[10][5] ; \n int f(int ia){} \n int f(void); \n int x = f(pa[1][2]);").getDeclarations(); //$NON-NLS-1$
IASTVariable pa = (IASTVariable) i.next();
IASTFunction f1 = (IASTFunction) i.next();
IASTFunction f2 = (IASTFunction) i.next();
@ -156,7 +156,7 @@ public class CompleteParseASTExpressionTest extends CompleteParseBaseTest{
public void testPostfixSubscriptB() throws Exception
{
Iterator i = parse ("int* pa[10][5] ; \n int f(int* ia){} \n int f(void); \n int x = f(pa[1][2]);").getDeclarations();
Iterator i = parse ("int* pa[10][5] ; \n int f(int* ia){} \n int f(void); \n int x = f(pa[1][2]);").getDeclarations(); //$NON-NLS-1$
IASTVariable pa = (IASTVariable) i.next();
IASTFunction f1 = (IASTFunction) i.next();
IASTFunction f2 = (IASTFunction) i.next();
@ -166,7 +166,7 @@ public class CompleteParseASTExpressionTest extends CompleteParseBaseTest{
public void testPostfixSubscriptWithReferences() throws Exception
{
Iterator i = parse ("class A{}; \n A *pa[10][5] ; \n int f(A* ia){} \n int f(void); \n int x = f(pa[1][2]);").getDeclarations();
Iterator i = parse ("class A{}; \n A *pa[10][5] ; \n int f(A* ia){} \n int f(void); \n int x = f(pa[1][2]);").getDeclarations(); //$NON-NLS-1$
IASTClassSpecifier cl = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)i.next()).getTypeSpecifier();
IASTVariable pa = (IASTVariable) i.next();
IASTFunction f1 = (IASTFunction) i.next();
@ -178,7 +178,7 @@ public class CompleteParseASTExpressionTest extends CompleteParseBaseTest{
// Kind POSTFIX_FUNCTIONCALL : return type of called function
public void testPostfixFunctioncallBug42822() throws Exception
{
Iterator i = parse( "int foo( float b ); int bar( int a, int b ); int test( void ) { int x = bar( foo( 3.0 ), foo( 5.0 ) ) ; }").getDeclarations();
Iterator i = parse( "int foo( float b ); int bar( int a, int b ); int test( void ) { int x = bar( foo( 3.0 ), foo( 5.0 ) ) ; }").getDeclarations(); //$NON-NLS-1$
IASTFunction foo = (IASTFunction)i.next();
IASTFunction bar = (IASTFunction)i.next();
i.next();
@ -189,8 +189,8 @@ public class CompleteParseASTExpressionTest extends CompleteParseBaseTest{
public void testPostfixSimpletypesBug42823() throws Exception
{
StringBuffer buffer = new StringBuffer();
buffer.append( "void foo( int anInt, short aShort, double aDouble, float aFloat, char aChar, wchar_t aWchar, signed aSigned, unsigned anUnsigned, bool aBool, long aLong );");
buffer.append( "void test( void ) { int someInt = foo( int(3), short(4), double(3.0), float(4.0), char( 'a'), wchar_t( 'a' ), signed( 2 ), unsigned( 3 ), bool( false ), long( 3L ) ); }");
buffer.append( "void foo( int anInt, short aShort, double aDouble, float aFloat, char aChar, wchar_t aWchar, signed aSigned, unsigned anUnsigned, bool aBool, long aLong );"); //$NON-NLS-1$
buffer.append( "void test( void ) { int someInt = foo( int(3), short(4), double(3.0), float(4.0), char( 'a'), wchar_t( 'a' ), signed( 2 ), unsigned( 3 ), bool( false ), long( 3L ) ); }"); //$NON-NLS-1$
Iterator i = parse( buffer.toString() ).getDeclarations();
IASTFunction foo = (IASTFunction)i.next();
IASTFunction test = (IASTFunction)i.next();
@ -200,7 +200,7 @@ public class CompleteParseASTExpressionTest extends CompleteParseBaseTest{
// Kind POSTFIX_TYPENAME_IDENTIFIER
public void testPostfixTypenameIdentifier() throws Exception{
Iterator i = parse( "class A {}; \n int foo(); int foo( A a ); \n int x = foo( typename A() );").getDeclarations();
Iterator i = parse( "class A {}; \n int foo(); int foo( A a ); \n int x = foo( typename A() );").getDeclarations(); //$NON-NLS-1$
IASTClassSpecifier cl = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)i.next()).getTypeSpecifier();
IASTFunction f1 = (IASTFunction) i.next();
IASTFunction f2 = (IASTFunction) i.next();
@ -212,7 +212,7 @@ public class CompleteParseASTExpressionTest extends CompleteParseBaseTest{
// Kind POSTFIX_DOT_IDEXPRESSION : type of member in the scope of the container
public void testPostfixDotExpression() throws Exception{
Iterator i = parse( "class A {int m;}; \n A a; \n int foo(char); int foo( int ); \n int x = foo( a.m );").getDeclarations();
Iterator i = parse( "class A {int m;}; \n A a; \n int foo(char); int foo( int ); \n int x = foo( a.m );").getDeclarations(); //$NON-NLS-1$
IASTClassSpecifier cl = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)i.next()).getTypeSpecifier();
IASTVariable a = (IASTVariable) i.next();
IASTFunction f1 = (IASTFunction) i.next();
@ -224,7 +224,7 @@ public class CompleteParseASTExpressionTest extends CompleteParseBaseTest{
}
// Kind POSTFIX_ARROW_IDEXPRESSION : type of member in the scope of the container
public void testPostfixArrowExpression() throws Exception{
Iterator i = parse( "class A {int m;}; \n A * a; \n int foo(char); int foo( int ); \n int x = foo( a->m );").getDeclarations();
Iterator i = parse( "class A {int m;}; \n A * a; \n int foo(char); int foo( int ); \n int x = foo( a->m );").getDeclarations(); //$NON-NLS-1$
IASTClassSpecifier cl = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)i.next()).getTypeSpecifier();
IASTVariable a = (IASTVariable) i.next();
IASTFunction f1 = (IASTFunction) i.next();
@ -243,7 +243,7 @@ public class CompleteParseASTExpressionTest extends CompleteParseBaseTest{
// Kind POSTFIX_INCREMENT : LHS
public void testPostfixIncrement() throws Exception
{
Iterator i = parse( "void foo(); int foo( int ); void test( void ) { int x = 5; int y = foo( x++ ); } ").getDeclarations();
Iterator i = parse( "void foo(); int foo( int ); void test( void ) { int x = 5; int y = foo( x++ ); } ").getDeclarations(); //$NON-NLS-1$
IASTFunction foo = (IASTFunction)i.next();
IASTFunction foo2 = (IASTFunction)i.next();
IASTFunction test = (IASTFunction)i.next();
@ -257,7 +257,7 @@ public class CompleteParseASTExpressionTest extends CompleteParseBaseTest{
// Kind POSTFIX_DECREMENT : LHS
public void testPostfixDecrement() throws Exception
{
Iterator i = parse( "void foo(); int foo( int ); void test( void ) { int x = 5; int y = foo( x-- ); } ").getDeclarations();
Iterator i = parse( "void foo(); int foo( int ); void test( void ) { int x = 5; int y = foo( x-- ); } ").getDeclarations(); //$NON-NLS-1$
IASTFunction foo = (IASTFunction)i.next();
IASTFunction foo2 = (IASTFunction)i.next();
IASTFunction test = (IASTFunction)i.next();
@ -270,7 +270,7 @@ public class CompleteParseASTExpressionTest extends CompleteParseBaseTest{
}
// Kind POSTFIX_DYNAMIC_CAST
public void testPostfixDynamicCast() throws Exception{
Iterator i = parse( "class A {}; class B : public A{}; \n A *a; \n int foo(); int foo( B* ); \n int x = foo( dynamic_cast<B*>(a) );").getDeclarations();
Iterator i = parse( "class A {}; class B : public A{}; \n A *a; \n int foo(); int foo( B* ); \n int x = foo( dynamic_cast<B*>(a) );").getDeclarations(); //$NON-NLS-1$
IASTClassSpecifier cla = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)i.next()).getTypeSpecifier();
IASTClassSpecifier clb = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)i.next()).getTypeSpecifier();
IASTVariable a = (IASTVariable) i.next();
@ -282,7 +282,7 @@ public class CompleteParseASTExpressionTest extends CompleteParseBaseTest{
}
// Kind POSTFIX_REINTERPRET_CAST
public void testPostfixReinterpretCast() throws Exception{
Iterator i = parse( "int *a; \n int foo(); int foo( double* ); \n int x = foo( reinterpret_cast<double*>(a) );").getDeclarations();
Iterator i = parse( "int *a; \n int foo(); int foo( double* ); \n int x = foo( reinterpret_cast<double*>(a) );").getDeclarations(); //$NON-NLS-1$
IASTVariable a = (IASTVariable) i.next();
IASTFunction f1 = (IASTFunction) i.next();
IASTFunction f2 = (IASTFunction) i.next();
@ -292,7 +292,7 @@ public class CompleteParseASTExpressionTest extends CompleteParseBaseTest{
}
// Kind POSTFIX_STATIC_CAST
public void testPostfixStaticCast() throws Exception{
Iterator i = parse( "int a; \n int foo(); int foo( char ); \n int x = foo( static_cast<char>(a) );").getDeclarations();
Iterator i = parse( "int a; \n int foo(); int foo( char ); \n int x = foo( static_cast<char>(a) );").getDeclarations(); //$NON-NLS-1$
IASTVariable a = (IASTVariable) i.next();
IASTFunction f1 = (IASTFunction) i.next();
IASTFunction f2 = (IASTFunction) i.next();
@ -302,7 +302,7 @@ public class CompleteParseASTExpressionTest extends CompleteParseBaseTest{
}
// Kind POSTFIX_CONST_CAST
public void testPostfixConstCast() throws Exception{
Iterator i = parse( "const int a; \n int foo(); int foo( int * ); \n int x = foo( const_cast<int *>(&a) );").getDeclarations();
Iterator i = parse( "const int a; \n int foo(); int foo( int * ); \n int x = foo( const_cast<int *>(&a) );").getDeclarations(); //$NON-NLS-1$
IASTVariable a = (IASTVariable) i.next();
IASTFunction f1 = (IASTFunction) i.next();
IASTFunction f2 = (IASTFunction) i.next();
@ -312,7 +312,7 @@ public class CompleteParseASTExpressionTest extends CompleteParseBaseTest{
}
// Kind POSTFIX_TYPEID_EXPRESSION : LHS
public void testPostfixTypeIdExpression() throws Exception{
Iterator i = parse( "int foo(char); int foo( int ); \n int x = foo( typeid(5) );").getDeclarations();
Iterator i = parse( "int foo(char); int foo( int ); \n int x = foo( typeid(5) );").getDeclarations(); //$NON-NLS-1$
IASTFunction f1 = (IASTFunction) i.next();
IASTFunction f2 = (IASTFunction) i.next();
IASTVariable x = (IASTVariable) i.next();
@ -320,7 +320,7 @@ public class CompleteParseASTExpressionTest extends CompleteParseBaseTest{
}
// Kind POSTFIX_TYPEID_EXPRESSION : type of the ID
public void testPostfixTypeIdExpression2() throws Exception{
Iterator i = parse( "class A {}; \n A a; \n int foo(A); int foo( int ); \n int x = foo( typeid(a) );").getDeclarations();
Iterator i = parse( "class A {}; \n A a; \n int foo(A); int foo( int ); \n int x = foo( typeid(a) );").getDeclarations(); //$NON-NLS-1$
IASTClassSpecifier cl = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)i.next()).getTypeSpecifier();
IASTVariable a = (IASTVariable) i.next();
IASTFunction f1 = (IASTFunction) i.next();
@ -330,7 +330,7 @@ public class CompleteParseASTExpressionTest extends CompleteParseBaseTest{
}
// Kind POSTFIX_TYPEID_TYPEID : type of the ID
public void testPostfixTypeIdTypeId() throws Exception{
Iterator i = parse( "class A {}; \n A a; \n int foo(A); int foo( int ); \n int x = foo( typeid(A) );").getDeclarations();
Iterator i = parse( "class A {}; \n A a; \n int foo(A); int foo( int ); \n int x = foo( typeid(A) );").getDeclarations(); //$NON-NLS-1$
IASTClassSpecifier cl = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)i.next()).getTypeSpecifier();
IASTVariable a = (IASTVariable) i.next();
IASTFunction f1 = (IASTFunction) i.next();
@ -340,7 +340,7 @@ public class CompleteParseASTExpressionTest extends CompleteParseBaseTest{
}
// Kind POSTFIX_TYPEID_TYPEID : type of the ID
public void testPostfixTypeIdTypeId2() throws Exception{
Iterator i = parse( "class A {}; \n A a; \n int foo(A); int foo( int ); \n int x = foo( typeid(const A) );").getDeclarations();
Iterator i = parse( "class A {}; \n A a; \n int foo(A); int foo( int ); \n int x = foo( typeid(const A) );").getDeclarations(); //$NON-NLS-1$
IASTClassSpecifier cl = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)i.next()).getTypeSpecifier();
IASTVariable a = (IASTVariable) i.next();
IASTFunction f1 = (IASTFunction) i.next();
@ -351,7 +351,7 @@ public class CompleteParseASTExpressionTest extends CompleteParseBaseTest{
// Kind UNARY_INCREMENT : LHS
public void testUnaryIncrement() throws Exception
{
Iterator i = parse( "void foo(); int foo( int ); void test( void ) { int x = 5; int y = foo( ++x ); } ").getDeclarations();
Iterator i = parse( "void foo(); int foo( int ); void test( void ) { int x = 5; int y = foo( ++x ); } ").getDeclarations(); //$NON-NLS-1$
IASTFunction foo = (IASTFunction)i.next();
IASTFunction foo2 = (IASTFunction)i.next();
IASTFunction test = (IASTFunction)i.next();
@ -365,7 +365,7 @@ public class CompleteParseASTExpressionTest extends CompleteParseBaseTest{
// Kind UNARY_DECREMENT : LHS
public void testUnaryDecrement() throws Exception
{
Iterator i = parse( "void foo(); int foo( int ); void test( void ) { int x = 5; int y = foo( --x ); } ").getDeclarations();
Iterator i = parse( "void foo(); int foo( int ); void test( void ) { int x = 5; int y = foo( --x ); } ").getDeclarations(); //$NON-NLS-1$
IASTFunction foo = (IASTFunction)i.next();
IASTFunction foo2 = (IASTFunction)i.next();
IASTFunction test = (IASTFunction)i.next();
@ -379,7 +379,7 @@ public class CompleteParseASTExpressionTest extends CompleteParseBaseTest{
// Kind UNARY_STAR_CASTEXPRESSION : LHS + t_pointer
public void testUnaryStarCastExpression() throws Exception
{
Iterator i = parse ("class A {}; \n A * pa; \n int f(A ia){} \n int f(void); \n int x = f(*pa);").getDeclarations();
Iterator i = parse ("class A {}; \n A * pa; \n int f(A ia){} \n int f(void); \n int x = f(*pa);").getDeclarations(); //$NON-NLS-1$
IASTClassSpecifier cl = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)i.next()).getTypeSpecifier();
IASTVariable a = (IASTVariable) i.next();
IASTFunction f1 = (IASTFunction) i.next();
@ -390,7 +390,7 @@ public class CompleteParseASTExpressionTest extends CompleteParseBaseTest{
// Kind UNARY_AMPSND_CASTEXPRESSION : LHS + t_reference
public void testUnaryAmpersandCastExpression() throws Exception
{
Iterator i = parse ("class A {}; \n A * pa; \n int f(A ** ia){} \n int f(void); \n int x = f(&pa);").getDeclarations();
Iterator i = parse ("class A {}; \n A * pa; \n int f(A ** ia){} \n int f(void); \n int x = f(&pa);").getDeclarations(); //$NON-NLS-1$
IASTClassSpecifier cl = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)i.next()).getTypeSpecifier();
IASTVariable a = (IASTVariable) i.next();
IASTFunction f1 = (IASTFunction) i.next();
@ -400,7 +400,7 @@ public class CompleteParseASTExpressionTest extends CompleteParseBaseTest{
}
// Kind UNARY_PLUS_CASTEXPRESSION : LHS
public void testUnaryPlusCastExpression() throws Exception {
Iterator i = parse( "void foo(); int foo( int ); int x = foo( +5 );").getDeclarations();
Iterator i = parse( "void foo(); int foo( int ); int x = foo( +5 );").getDeclarations(); //$NON-NLS-1$
IASTFunction foo = (IASTFunction)i.next();
IASTFunction foo2 = (IASTFunction)i.next();
IASTVariable x = (IASTVariable)i.next();
@ -409,7 +409,7 @@ public class CompleteParseASTExpressionTest extends CompleteParseBaseTest{
}
// Kind UNARY_MINUS_CASTEXPRESSION : LHS
public void testUnaryMinusCastExpression() throws Exception {
Iterator i = parse( "void foo(); int foo( int ); int x = foo( -5 );").getDeclarations();
Iterator i = parse( "void foo(); int foo( int ); int x = foo( -5 );").getDeclarations(); //$NON-NLS-1$
IASTFunction foo = (IASTFunction)i.next();
IASTFunction foo2 = (IASTFunction)i.next();
IASTVariable x = (IASTVariable)i.next();
@ -418,7 +418,7 @@ public class CompleteParseASTExpressionTest extends CompleteParseBaseTest{
}
// Kind UNARY_NOT_CASTEXPRESSION : LHS
public void testUnaryNotCastExpression() throws Exception {
Iterator i = parse( "void foo(); int foo( bool ); bool b=true; int x = foo( !b );").getDeclarations();
Iterator i = parse( "void foo(); int foo( bool ); bool b=true; int x = foo( !b );").getDeclarations(); //$NON-NLS-1$
IASTFunction foo = (IASTFunction)i.next();
IASTFunction foo2 = (IASTFunction)i.next();
IASTVariable b = (IASTVariable)i.next();
@ -428,7 +428,7 @@ public class CompleteParseASTExpressionTest extends CompleteParseBaseTest{
}
// Kind UNARY_TILDE_CASTEXPRESSION : LHS
public void testTildeNotCastExpression() throws Exception {
Iterator i = parse( "void foo(); int foo( int ); int x = 5; int y = foo( ~x );").getDeclarations();
Iterator i = parse( "void foo(); int foo( int ); int x = 5; int y = foo( ~x );").getDeclarations(); //$NON-NLS-1$
IASTFunction foo = (IASTFunction)i.next();
IASTFunction foo2 = (IASTFunction)i.next();
IASTVariable x = (IASTVariable)i.next();
@ -438,7 +438,7 @@ public class CompleteParseASTExpressionTest extends CompleteParseBaseTest{
}
// Kind UNARY_SIZEOF_UNARYEXPRESSION : unsigned int
public void testUnarySizeofUnaryExpression() throws Exception {
Iterator i = parse( "void foo(); int foo( int ); int x = 5; int y = foo( sizeof(5) );").getDeclarations();
Iterator i = parse( "void foo(); int foo( int ); int x = 5; int y = foo( sizeof(5) );").getDeclarations(); //$NON-NLS-1$
IASTFunction foo = (IASTFunction)i.next();
IASTFunction foo2 = (IASTFunction)i.next();
IASTVariable x = (IASTVariable)i.next();
@ -448,7 +448,7 @@ public class CompleteParseASTExpressionTest extends CompleteParseBaseTest{
}
// Kind UNARY_SIZEOF_TYPEID : unsigned int
public void testUnarySizeofTypeId() throws Exception {
Iterator i = parse( "void foo(); int foo( int ); int x = 5; int y = foo( sizeof(x) );").getDeclarations();
Iterator i = parse( "void foo(); int foo( int ); int x = 5; int y = foo( sizeof(x) );").getDeclarations(); //$NON-NLS-1$
IASTFunction foo = (IASTFunction)i.next();
IASTFunction foo2 = (IASTFunction)i.next();
IASTVariable x = (IASTVariable)i.next();
@ -459,7 +459,7 @@ public class CompleteParseASTExpressionTest extends CompleteParseBaseTest{
// Kind NEW_NEWTYPEID
// Kind NEW_TYPEID
public void testNewTypeId() throws Exception {
Iterator i = parse( "class A{}; void foo(); int foo( A * a ); int x = foo( new A() );").getDeclarations();
Iterator i = parse( "class A{}; void foo(); int foo( A * a ); int x = foo( new A() );").getDeclarations(); //$NON-NLS-1$
IASTClassSpecifier cl = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)i.next()).getTypeSpecifier();
IASTFunction foo = (IASTFunction)i.next();
IASTFunction foo2 = (IASTFunction)i.next();
@ -473,7 +473,7 @@ public class CompleteParseASTExpressionTest extends CompleteParseBaseTest{
// Kind CASTEXPRESSION
public void testCastExpression() throws Exception{
Iterator i = parse( "class A {}; class B : public A{}; \n B *b; \n int foo(); int foo( A* ); \n int x = foo( (A*)b );").getDeclarations();
Iterator i = parse( "class A {}; class B : public A{}; \n B *b; \n int foo(); int foo( A* ); \n int x = foo( (A*)b );").getDeclarations(); //$NON-NLS-1$
IASTClassSpecifier cla = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)i.next()).getTypeSpecifier();
IASTClassSpecifier clb = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)i.next()).getTypeSpecifier();
IASTVariable b = (IASTVariable) i.next();
@ -492,7 +492,7 @@ public class CompleteParseASTExpressionTest extends CompleteParseBaseTest{
// Kind MULTIPLICATIVE_MULTIPLY : usual arithmetic conversions
public void testMultiplicativeMultiply() throws Exception {
Iterator i = parse( "int foo(int); int foo( float ); int a = 3; float b=5.1 ; int x = foo( a * b );").getDeclarations();
Iterator i = parse( "int foo(int); int foo( float ); int a = 3; float b=5.1 ; int x = foo( a * b );").getDeclarations(); //$NON-NLS-1$
IASTFunction foo = (IASTFunction)i.next();
IASTFunction foo2 = (IASTFunction)i.next();
IASTVariable a = (IASTVariable)i.next();
@ -504,7 +504,7 @@ public class CompleteParseASTExpressionTest extends CompleteParseBaseTest{
}
// Kind MULTIPLICATIVE_DIVIDE : usual arithmetic conversions
public void testMultiplicativeDivide() throws Exception {
Iterator i = parse( "int foo(int); int foo( float ); int a = 3; float b=5.1 ; int x = foo( b / a );").getDeclarations();
Iterator i = parse( "int foo(int); int foo( float ); int a = 3; float b=5.1 ; int x = foo( b / a );").getDeclarations(); //$NON-NLS-1$
IASTFunction foo = (IASTFunction)i.next();
IASTFunction foo2 = (IASTFunction)i.next();
IASTVariable a = (IASTVariable)i.next();
@ -515,7 +515,7 @@ public class CompleteParseASTExpressionTest extends CompleteParseBaseTest{
}
// Kind MULTIPLICATIVE_MODULUS : usual arithmetic conversions
public void testMultiplicativeModulus() throws Exception {
Iterator i = parse( "int foo(int); int foo( float ); int a = 3; float b=5.1 ; int x = foo( b % a );").getDeclarations();
Iterator i = parse( "int foo(int); int foo( float ); int a = 3; float b=5.1 ; int x = foo( b % a );").getDeclarations(); //$NON-NLS-1$
IASTFunction foo = (IASTFunction)i.next();
IASTFunction foo2 = (IASTFunction)i.next();
IASTVariable a = (IASTVariable)i.next();
@ -526,7 +526,7 @@ public class CompleteParseASTExpressionTest extends CompleteParseBaseTest{
}
// Kind ADDITIVE_PLUS : usual arithmetic conversions
public void testAdditivePlus() throws Exception {
Iterator i = parse( "int foo(int); int foo( float ); int a = 3; float b=5.1 ; int x = foo( b + a );").getDeclarations();
Iterator i = parse( "int foo(int); int foo( float ); int a = 3; float b=5.1 ; int x = foo( b + a );").getDeclarations(); //$NON-NLS-1$
IASTFunction foo = (IASTFunction)i.next();
IASTFunction foo2 = (IASTFunction)i.next();
IASTVariable a = (IASTVariable)i.next();
@ -537,7 +537,7 @@ public class CompleteParseASTExpressionTest extends CompleteParseBaseTest{
}
// Kind ADDITIVE_MINUS : usual arithmetic conversions
public void testAdditiveMinus() throws Exception {
Iterator i = parse( "int foo(int); int foo( float ); int a = 3; float b=5.1 ; int x = foo( b - a );").getDeclarations();
Iterator i = parse( "int foo(int); int foo( float ); int a = 3; float b=5.1 ; int x = foo( b - a );").getDeclarations(); //$NON-NLS-1$
IASTFunction foo = (IASTFunction)i.next();
IASTFunction foo2 = (IASTFunction)i.next();
IASTVariable a = (IASTVariable)i.next();
@ -548,7 +548,7 @@ public class CompleteParseASTExpressionTest extends CompleteParseBaseTest{
}
// Kind SHIFT_LEFT : LHS
public void testShiftLeft() throws Exception {
Iterator i = parse( "int foo(int); int foo( bool ); int a = 10; int x = foo( a << 5 );").getDeclarations();
Iterator i = parse( "int foo(int); int foo( bool ); int a = 10; int x = foo( a << 5 );").getDeclarations(); //$NON-NLS-1$
IASTFunction foo1 = (IASTFunction)i.next();
IASTFunction foo2 = (IASTFunction)i.next();
IASTVariable a = (IASTVariable)i.next();
@ -558,7 +558,7 @@ public class CompleteParseASTExpressionTest extends CompleteParseBaseTest{
}
// Kind SHIFT_RIGHT : LHS
public void testShiftRight() throws Exception {
Iterator i = parse( "int foo(int); int foo( bool ); int a = 10; int x = foo( a >> 5 );").getDeclarations();
Iterator i = parse( "int foo(int); int foo( bool ); int a = 10; int x = foo( a >> 5 );").getDeclarations(); //$NON-NLS-1$
IASTFunction foo1 = (IASTFunction)i.next();
IASTFunction foo2 = (IASTFunction)i.next();
IASTVariable a = (IASTVariable)i.next();
@ -568,7 +568,7 @@ public class CompleteParseASTExpressionTest extends CompleteParseBaseTest{
}
// Kind RELATIONAL_LESSTHAN : bool
public void testRelationalLessThan() throws Exception {
Iterator i = parse( "void foo(); int foo( bool ); int b=5; int x = foo( b < 3 );").getDeclarations();
Iterator i = parse( "void foo(); int foo( bool ); int b=5; int x = foo( b < 3 );").getDeclarations(); //$NON-NLS-1$
IASTFunction foo = (IASTFunction)i.next();
IASTFunction foo2 = (IASTFunction)i.next();
IASTVariable b = (IASTVariable)i.next();
@ -578,7 +578,7 @@ public class CompleteParseASTExpressionTest extends CompleteParseBaseTest{
}
// Kind RELATIONAL_GREATERTHAN : bool
public void testRelationalGreaterThan() throws Exception {
Iterator i = parse( "void foo(); int foo( bool ); int b=5; int x = foo( b > 3 );").getDeclarations();
Iterator i = parse( "void foo(); int foo( bool ); int b=5; int x = foo( b > 3 );").getDeclarations(); //$NON-NLS-1$
IASTFunction foo = (IASTFunction)i.next();
IASTFunction foo2 = (IASTFunction)i.next();
IASTVariable b = (IASTVariable)i.next();
@ -588,7 +588,7 @@ public class CompleteParseASTExpressionTest extends CompleteParseBaseTest{
}
// Kind RELATIONAL_LESSTHANEQUALTO : bool
public void testRelationalLessThanOrEqual() throws Exception {
Iterator i = parse( "void foo(); int foo( bool ); int b=5; int x = foo( b <= 3 );").getDeclarations();
Iterator i = parse( "void foo(); int foo( bool ); int b=5; int x = foo( b <= 3 );").getDeclarations(); //$NON-NLS-1$
IASTFunction foo = (IASTFunction)i.next();
IASTFunction foo2 = (IASTFunction)i.next();
IASTVariable b = (IASTVariable)i.next();
@ -598,7 +598,7 @@ public class CompleteParseASTExpressionTest extends CompleteParseBaseTest{
}
// Kind RELATIONAL_GREATERTHANEQUALTO : bool
public void testRelationalGreaterThanOrEqual() throws Exception {
Iterator i = parse( "void foo(); int foo( bool ); int b=5; int x = foo( b >= 3 );").getDeclarations();
Iterator i = parse( "void foo(); int foo( bool ); int b=5; int x = foo( b >= 3 );").getDeclarations(); //$NON-NLS-1$
IASTFunction foo = (IASTFunction)i.next();
IASTFunction foo2 = (IASTFunction)i.next();
IASTVariable b = (IASTVariable)i.next();
@ -608,7 +608,7 @@ public class CompleteParseASTExpressionTest extends CompleteParseBaseTest{
}
// Kind EQUALITY_EQUALS : bool
public void testEqualityEquals() throws Exception {
Iterator i = parse( "void foo(); int foo( bool ); int b=5; int x = foo( b == 3 );").getDeclarations();
Iterator i = parse( "void foo(); int foo( bool ); int b=5; int x = foo( b == 3 );").getDeclarations(); //$NON-NLS-1$
IASTFunction foo = (IASTFunction)i.next();
IASTFunction foo2 = (IASTFunction)i.next();
IASTVariable b = (IASTVariable)i.next();
@ -618,7 +618,7 @@ public class CompleteParseASTExpressionTest extends CompleteParseBaseTest{
}
// Kind EQUALITY_NOTEQUALS : bool
public void testEqualityNotEquals() throws Exception {
Iterator i = parse( "void foo(); int foo( bool ); int b=5; int x = foo( b != 3 );").getDeclarations();
Iterator i = parse( "void foo(); int foo( bool ); int b=5; int x = foo( b != 3 );").getDeclarations(); //$NON-NLS-1$
IASTFunction foo = (IASTFunction)i.next();
IASTFunction foo2 = (IASTFunction)i.next();
IASTVariable b = (IASTVariable)i.next();
@ -628,7 +628,7 @@ public class CompleteParseASTExpressionTest extends CompleteParseBaseTest{
}
// Kind ANDEXPRESSION : usual arithmetic conversions
public void testAndExpression() throws Exception {
Iterator i = parse( "int foo(); int foo( int ); int a = 3; int b= 5; int x = foo( a & b );").getDeclarations();
Iterator i = parse( "int foo(); int foo( int ); int a = 3; int b= 5; int x = foo( a & b );").getDeclarations(); //$NON-NLS-1$
IASTFunction foo = (IASTFunction)i.next();
IASTFunction foo2 = (IASTFunction)i.next();
IASTVariable a = (IASTVariable)i.next();
@ -639,7 +639,7 @@ public class CompleteParseASTExpressionTest extends CompleteParseBaseTest{
}
// Kind EXCLUSIVEOREXPRESSION : usual arithmetic conversions
public void testExclusiveOrExpression() throws Exception {
Iterator i = parse( "int foo(); int foo( int ); int a = 3; int b= 5; int x = foo( a ^ b );").getDeclarations();
Iterator i = parse( "int foo(); int foo( int ); int a = 3; int b= 5; int x = foo( a ^ b );").getDeclarations(); //$NON-NLS-1$
IASTFunction foo = (IASTFunction)i.next();
IASTFunction foo2 = (IASTFunction)i.next();
IASTVariable a = (IASTVariable)i.next();
@ -650,7 +650,7 @@ public class CompleteParseASTExpressionTest extends CompleteParseBaseTest{
}
// Kind INCLUSIVEOREXPRESSION : : usual arithmetic conversions
public void testInclusiveOrExpression() throws Exception {
Iterator i = parse( "int foo(); int foo( int ); int a = 3; int b= 5; int x = foo( a | b );").getDeclarations();
Iterator i = parse( "int foo(); int foo( int ); int a = 3; int b= 5; int x = foo( a | b );").getDeclarations(); //$NON-NLS-1$
IASTFunction foo = (IASTFunction)i.next();
IASTFunction foo2 = (IASTFunction)i.next();
IASTVariable a = (IASTVariable)i.next();
@ -661,7 +661,7 @@ public class CompleteParseASTExpressionTest extends CompleteParseBaseTest{
}
// Kind LOGICALANDEXPRESSION : bool
public void testLogicalAndExpression() throws Exception {
Iterator i = parse( "int foo(); int foo( bool ); bool a = true; bool b= false; int x = foo( a && b );").getDeclarations();
Iterator i = parse( "int foo(); int foo( bool ); bool a = true; bool b= false; int x = foo( a && b );").getDeclarations(); //$NON-NLS-1$
IASTFunction foo = (IASTFunction)i.next();
IASTFunction foo2 = (IASTFunction)i.next();
IASTVariable a = (IASTVariable)i.next();
@ -672,7 +672,7 @@ public class CompleteParseASTExpressionTest extends CompleteParseBaseTest{
}
// Kind LOGICALOREXPRESSION : bool
public void testLogicalOrExpression() throws Exception {
Iterator i = parse( "int foo(); int foo( bool ); bool a = true; bool b= false; int x = foo( a || b );").getDeclarations();
Iterator i = parse( "int foo(); int foo( bool ); bool a = true; bool b= false; int x = foo( a || b );").getDeclarations(); //$NON-NLS-1$
IASTFunction foo = (IASTFunction)i.next();
IASTFunction foo2 = (IASTFunction)i.next();
IASTVariable a = (IASTVariable)i.next();
@ -683,7 +683,7 @@ public class CompleteParseASTExpressionTest extends CompleteParseBaseTest{
}
// Kind CONDITIONALEXPRESSION : conditional Expression Conversions
public void testConditionalExpression() throws Exception {
Iterator i = parse( "int foo(bool); int foo(int); int a = 10, b = 4, c = 2; int x = foo( a > 5 ? b : c );").getDeclarations();
Iterator i = parse( "int foo(bool); int foo(int); int a = 10, b = 4, c = 2; int x = foo( a > 5 ? b : c );").getDeclarations(); //$NON-NLS-1$
IASTFunction foo1 = (IASTFunction)i.next();
IASTFunction foo2 = (IASTFunction)i.next();
IASTVariable a = (IASTVariable)i.next();
@ -695,7 +695,7 @@ public class CompleteParseASTExpressionTest extends CompleteParseBaseTest{
}
// Kind CONDITIONALEXPRESSION with references : conditional Expression Conversions
public void testConditionalExpressionWithReferencesA() throws Exception {
Iterator i = parse( "class A{}; class B : public A{}; int foo(); int foo(A*); A *a ; B *b; int c = 0; int x = foo( c > 5 ? b : a );").getDeclarations();
Iterator i = parse( "class A{}; class B : public A{}; int foo(); int foo(A*); A *a ; B *b; int c = 0; int x = foo( c > 5 ? b : a );").getDeclarations(); //$NON-NLS-1$
IASTClassSpecifier cla = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)i.next()).getTypeSpecifier();
IASTClassSpecifier clb = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)i.next()).getTypeSpecifier();
IASTFunction foo1 = (IASTFunction)i.next();
@ -708,7 +708,7 @@ public class CompleteParseASTExpressionTest extends CompleteParseBaseTest{
assertAllReferences(8, createTaskList( new Task( cla, 3 ), new Task( clb ), new Task( c ), new Task( b ), new Task( a ), new Task( foo2 )) );
}
public void testConditionalExpressionWithReferencesB_Bug43106() throws Exception {
Iterator i = parse( "class A{}; class B : public A{}; int foo(); int foo(A&); A a ; B b; int c = 0; int x = foo( c > 5 ? b : a );").getDeclarations();
Iterator i = parse( "class A{}; class B : public A{}; int foo(); int foo(A&); A a ; B b; int c = 0; int x = foo( c > 5 ? b : a );").getDeclarations(); //$NON-NLS-1$
IASTClassSpecifier cla = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)i.next()).getTypeSpecifier();
IASTClassSpecifier clb = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)i.next()).getTypeSpecifier();
IASTFunction foo1 = (IASTFunction)i.next();
@ -725,7 +725,7 @@ public class CompleteParseASTExpressionTest extends CompleteParseBaseTest{
// Kind ASSIGNMENTEXPRESSION_NORMAL : LHS
public void testAssignmentExpressionNormal() throws Exception {
Iterator i = parse( "int foo(int); int foo( bool ); int a = 10; int x = foo( a = 5 );").getDeclarations();
Iterator i = parse( "int foo(int); int foo( bool ); int a = 10; int x = foo( a = 5 );").getDeclarations(); //$NON-NLS-1$
IASTFunction foo1 = (IASTFunction)i.next();
IASTFunction foo2 = (IASTFunction)i.next();
IASTVariable a = (IASTVariable)i.next();
@ -735,7 +735,7 @@ public class CompleteParseASTExpressionTest extends CompleteParseBaseTest{
}
// Kind ASSIGNMENTEXPRESSION_PLUS : LHS
public void testAssignmentExpressionPlus() throws Exception {
Iterator i = parse( "int foo(int); int foo( bool ); int a = 10; int x = foo( a += 5 );").getDeclarations();
Iterator i = parse( "int foo(int); int foo( bool ); int a = 10; int x = foo( a += 5 );").getDeclarations(); //$NON-NLS-1$
IASTFunction foo1 = (IASTFunction)i.next();
IASTFunction foo2 = (IASTFunction)i.next();
IASTVariable a = (IASTVariable)i.next();
@ -745,7 +745,7 @@ public class CompleteParseASTExpressionTest extends CompleteParseBaseTest{
}
// Kind ASSIGNMENTEXPRESSION_MINUS : LHS
public void testAssignmentExpressionMinus() throws Exception {
Iterator i = parse( "int foo(int); int foo( bool ); int a = 10; int x = foo( a -= 5 );").getDeclarations();
Iterator i = parse( "int foo(int); int foo( bool ); int a = 10; int x = foo( a -= 5 );").getDeclarations(); //$NON-NLS-1$
IASTFunction foo1 = (IASTFunction)i.next();
IASTFunction foo2 = (IASTFunction)i.next();
IASTVariable a = (IASTVariable)i.next();
@ -755,7 +755,7 @@ public class CompleteParseASTExpressionTest extends CompleteParseBaseTest{
}
// Kind ASSIGNMENTEXPRESSION_MULT : LHS
public void testAssignmentExpressionMulti() throws Exception {
Iterator i = parse( "int foo(int); int foo( bool ); int a = 10; int x = foo( a *= 5 );").getDeclarations();
Iterator i = parse( "int foo(int); int foo( bool ); int a = 10; int x = foo( a *= 5 );").getDeclarations(); //$NON-NLS-1$
IASTFunction foo1 = (IASTFunction)i.next();
IASTFunction foo2 = (IASTFunction)i.next();
IASTVariable a = (IASTVariable)i.next();
@ -765,7 +765,7 @@ public class CompleteParseASTExpressionTest extends CompleteParseBaseTest{
}
// Kind ASSIGNMENTEXPRESSION_DIV : LHS
public void testAssignmentExpressionDiv() throws Exception {
Iterator i = parse( "int foo(int); int foo( bool ); int a = 10; int x = foo( a /= 5 );").getDeclarations();
Iterator i = parse( "int foo(int); int foo( bool ); int a = 10; int x = foo( a /= 5 );").getDeclarations(); //$NON-NLS-1$
IASTFunction foo1 = (IASTFunction)i.next();
IASTFunction foo2 = (IASTFunction)i.next();
IASTVariable a = (IASTVariable)i.next();
@ -775,7 +775,7 @@ public class CompleteParseASTExpressionTest extends CompleteParseBaseTest{
}
// Kind ASSIGNMENTEXPRESSION_MOD : LHS
public void testAssignmentExpressionMod() throws Exception {
Iterator i = parse( "int foo(int); int foo( bool ); int a = 10; int x = foo( a %= 5 );").getDeclarations();
Iterator i = parse( "int foo(int); int foo( bool ); int a = 10; int x = foo( a %= 5 );").getDeclarations(); //$NON-NLS-1$
IASTFunction foo1 = (IASTFunction)i.next();
IASTFunction foo2 = (IASTFunction)i.next();
IASTVariable a = (IASTVariable)i.next();
@ -785,7 +785,7 @@ public class CompleteParseASTExpressionTest extends CompleteParseBaseTest{
}
// Kind ASSIGNMENTEXPRESSION_LSHIFT : LHS
public void testAssignmentExpressionLShift() throws Exception {
Iterator i = parse( "int foo(int); int foo( bool ); int a = 10; int x = foo( a >>= 5 );").getDeclarations();
Iterator i = parse( "int foo(int); int foo( bool ); int a = 10; int x = foo( a >>= 5 );").getDeclarations(); //$NON-NLS-1$
IASTFunction foo1 = (IASTFunction)i.next();
IASTFunction foo2 = (IASTFunction)i.next();
IASTVariable a = (IASTVariable)i.next();
@ -795,7 +795,7 @@ public class CompleteParseASTExpressionTest extends CompleteParseBaseTest{
}
// Kind ASSIGNMENTEXPRESSION_RSHIFT : LHS
public void testAssignmentExpressionRShift() throws Exception {
Iterator i = parse( "int foo(int); int foo( bool ); int a = 10; int x = foo( a <<= 5 );").getDeclarations();
Iterator i = parse( "int foo(int); int foo( bool ); int a = 10; int x = foo( a <<= 5 );").getDeclarations(); //$NON-NLS-1$
IASTFunction foo1 = (IASTFunction)i.next();
IASTFunction foo2 = (IASTFunction)i.next();
IASTVariable a = (IASTVariable)i.next();
@ -805,7 +805,7 @@ public class CompleteParseASTExpressionTest extends CompleteParseBaseTest{
}
// Kind ASSIGNMENTEXPRESSION_AND : LHS
public void testAssignmentExpressionAnd() throws Exception {
Iterator i = parse( "int foo(int); int foo( bool ); int a = 10; int x = foo( a &= 5 );").getDeclarations();
Iterator i = parse( "int foo(int); int foo( bool ); int a = 10; int x = foo( a &= 5 );").getDeclarations(); //$NON-NLS-1$
IASTFunction foo1 = (IASTFunction)i.next();
IASTFunction foo2 = (IASTFunction)i.next();
IASTVariable a = (IASTVariable)i.next();
@ -815,7 +815,7 @@ public class CompleteParseASTExpressionTest extends CompleteParseBaseTest{
}
// Kind ASSIGNMENTEXPRESSION_OR : LHS
public void testAssignmentExpressionOr() throws Exception {
Iterator i = parse( "int foo(int); int foo( bool ); int a = 10; int x = foo( a |= 5 );").getDeclarations();
Iterator i = parse( "int foo(int); int foo( bool ); int a = 10; int x = foo( a |= 5 );").getDeclarations(); //$NON-NLS-1$
IASTFunction foo1 = (IASTFunction)i.next();
IASTFunction foo2 = (IASTFunction)i.next();
IASTVariable a = (IASTVariable)i.next();
@ -825,7 +825,7 @@ public class CompleteParseASTExpressionTest extends CompleteParseBaseTest{
}
// Kind ASSIGNMENTEXPRESSION_XOR : LHS
public void testAssignmentExpressionXOr() throws Exception {
Iterator i = parse( "int foo(int); int foo( bool ); int a = 10; int x = foo( a ^= 5 );").getDeclarations();
Iterator i = parse( "int foo(int); int foo( bool ); int a = 10; int x = foo( a ^= 5 );").getDeclarations(); //$NON-NLS-1$
IASTFunction foo1 = (IASTFunction)i.next();
IASTFunction foo2 = (IASTFunction)i.next();
IASTVariable a = (IASTVariable)i.next();

View file

@ -1766,12 +1766,12 @@ public class CompleteParseASTTest extends CompleteParseBaseTest
public void test575513_qualified() throws Exception
{
Writer writer = new StringWriter();
writer.write( "namespace Foo{ " );
writer.write( " class Bar{ public : Bar(); }; " );
writer.write( "} " );
writer.write( "void main(){ " );
writer.write( " Foo::Bar * bar = new Foo::Bar(); " );
writer.write( "} " );
writer.write( "namespace Foo{ " ); //$NON-NLS-1$
writer.write( " class Bar{ public : Bar(); }; " ); //$NON-NLS-1$
writer.write( "} " ); //$NON-NLS-1$
writer.write( "void main(){ " ); //$NON-NLS-1$
writer.write( " Foo::Bar * bar = new Foo::Bar(); " ); //$NON-NLS-1$
writer.write( "} " ); //$NON-NLS-1$
Iterator i = parse( writer.toString() ).getDeclarations();
@ -1871,16 +1871,16 @@ public class CompleteParseASTTest extends CompleteParseBaseTest
public void testBug64010() throws Exception
{
Writer writer = new StringWriter();
writer.write( " #define ONE else if (0) { } \n");
writer.write( " #define TEN ONE ONE ONE ONE ONE ONE ONE ONE ONE ONE \n ");
writer.write( " #define HUN TEN TEN TEN TEN TEN TEN TEN TEN TEN TEN \n ");
writer.write( " #define THOU HUN HUN HUN HUN HUN HUN HUN HUN HUN HUN \n");
writer.write("void foo() ");
writer.write("{ ");
writer.write(" if (0) { } ");
writer.write(" /* 11,000 else if's. */ ");
writer.write(" THOU THOU THOU THOU THOU THOU THOU THOU THOU THOU THOU ");
writer.write("} ");
writer.write( " #define ONE else if (0) { } \n"); //$NON-NLS-1$
writer.write( " #define TEN ONE ONE ONE ONE ONE ONE ONE ONE ONE ONE \n "); //$NON-NLS-1$
writer.write( " #define HUN TEN TEN TEN TEN TEN TEN TEN TEN TEN TEN \n "); //$NON-NLS-1$
writer.write( " #define THOU HUN HUN HUN HUN HUN HUN HUN HUN HUN HUN \n"); //$NON-NLS-1$
writer.write("void foo() "); //$NON-NLS-1$
writer.write("{ "); //$NON-NLS-1$
writer.write(" if (0) { } "); //$NON-NLS-1$
writer.write(" /* 11,000 else if's. */ "); //$NON-NLS-1$
writer.write(" THOU THOU THOU THOU THOU THOU THOU THOU THOU THOU THOU "); //$NON-NLS-1$
writer.write("} "); //$NON-NLS-1$
Iterator d = parse( writer.toString() ).getDeclarations();

View file

@ -753,10 +753,10 @@ public class CompleteParseBaseTest extends TestCase
{
callback = new FullParseCallback();
IParser parser = ParserFactory.createParser(
ParserFactory.createScanner( new StringReader( code ), "test-code", new ScannerInfo(),
ParserFactory.createScanner( new StringReader( code ), "test-code", new ScannerInfo(), //$NON-NLS-1$
ParserMode.COMPLETE_PARSE, language, callback, new NullLogService(), null ), callback, ParserMode.COMPLETE_PARSE, language, null
);
if( ! parser.parse() && throwOnError ) throw new ParserException( "FAILURE");
if( ! parser.parse() && throwOnError ) throw new ParserException( "FAILURE"); //$NON-NLS-1$
return callback.getCompilationUnit();
}
@ -773,7 +773,7 @@ public class CompleteParseBaseTest extends TestCase
if( r.getReferencedElement() == element )
{
if( ! matches.add( r ) && ! allowDuplicates )
fail( "Duplicate reference found for ISourceElementCallbackDelegate: " + element + " @ offset " + r.getOffset() );
fail( "Duplicate reference found for ISourceElementCallbackDelegate: " + element + " @ offset " + r.getOffset() ); //$NON-NLS-1$ //$NON-NLS-2$
}
else
{
@ -789,7 +789,7 @@ public class CompleteParseBaseTest extends TestCase
{
if( ! matches.add( r ) && ! allowDuplicates )
fail( "Duplicate reference found for ISourceElementCallbackDelegate: " + element + " @ offset " + r.getOffset() );
fail( "Duplicate reference found for ISourceElementCallbackDelegate: " + element + " @ offset " + r.getOffset() ); //$NON-NLS-1$ //$NON-NLS-2$
}
}

View file

@ -52,7 +52,7 @@ public class CompletionParseBaseTest extends CompleteParseBaseTest {
ParserFactory.createParser(
ParserFactory.createScanner(
new StringReader(code),
"completion-test",
"completion-test", //$NON-NLS-1$
new ScannerInfo(),
ParserMode.COMPLETION_PARSE,
ParserLanguage.CPP,
@ -74,7 +74,7 @@ public class CompletionParseBaseTest extends CompleteParseBaseTest {
ParserFactory.createParser(
ParserFactory.createScanner(
new StringReader(code),
"completion-test",
"completion-test", //$NON-NLS-1$
new ScannerInfo(),
ParserMode.COMPLETION_PARSE,
lang,

View file

@ -34,58 +34,58 @@ public class ExprEvalTest extends TestCase {
}
public void testInteger() throws Exception {
runTest("5;", 5);
runTest( "33;", 33 );
runTest("5;", 5); //$NON-NLS-1$
runTest( "33;", 33 ); //$NON-NLS-1$
}
public void testNot() throws Exception
{
runTest( "!1;", 0 );
runTest( "!0;", 1 );
runTest( "!4;", 0 );
runTest( "!!4;", 1 );
runTest( "!1;", 0 ); //$NON-NLS-1$
runTest( "!0;", 1 ); //$NON-NLS-1$
runTest( "!4;", 0 ); //$NON-NLS-1$
runTest( "!!4;", 1 ); //$NON-NLS-1$
}
public void testMultiplicational() throws Exception
{
runTest( "3 * 4;", 12 );
runTest( "55 * 2;", 110 );
runTest( "4 / 3;", 1 );
runTest( "100/4;", 25 );
runTest( "8 % 2;", 0 );
runTest( "8 % 3;", 2 );
runTest( "3 * 4;", 12 ); //$NON-NLS-1$
runTest( "55 * 2;", 110 ); //$NON-NLS-1$
runTest( "4 / 3;", 1 ); //$NON-NLS-1$
runTest( "100/4;", 25 ); //$NON-NLS-1$
runTest( "8 % 2;", 0 ); //$NON-NLS-1$
runTest( "8 % 3;", 2 ); //$NON-NLS-1$
}
public void testAdditive() throws Exception
{
runTest( "4 + 4;", 8 );
runTest( "4 - 4;", 0 );
runTest( "4 + 4;", 8 ); //$NON-NLS-1$
runTest( "4 - 4;", 0 ); //$NON-NLS-1$
}
public void testLogicalAnd() throws Exception
{
runTest( "4 && 5;", 1 );
runTest( "0 && 5;", 0 );
runTest( "5 && 0;", 0 );
runTest( "0 && 0;", 0 );
runTest( "4 && 5;", 1 ); //$NON-NLS-1$
runTest( "0 && 5;", 0 ); //$NON-NLS-1$
runTest( "5 && 0;", 0 ); //$NON-NLS-1$
runTest( "0 && 0;", 0 ); //$NON-NLS-1$
}
public void testLogicalOr() throws Exception
{
runTest( "4 || 5;", 1 );
runTest( "0 || 5;", 1 );
runTest( "5 || 0;", 1 );
runTest( "0 || 0;", 0 );
runTest( "4 || 5;", 1 ); //$NON-NLS-1$
runTest( "0 || 5;", 1 ); //$NON-NLS-1$
runTest( "5 || 0;", 1 ); //$NON-NLS-1$
runTest( "0 || 0;", 0 ); //$NON-NLS-1$
}
public void testRelational() throws Exception {
runTest("1 < 2;", 1);
runTest("2 < 1;", 0);
runTest("2 == 1 + 1;", 1);
runTest("2 != 1 + 1;", 0);
runTest("1 < 2;", 1); //$NON-NLS-1$
runTest("2 < 1;", 0); //$NON-NLS-1$
runTest("2 == 1 + 1;", 1); //$NON-NLS-1$
runTest("2 != 1 + 1;", 0); //$NON-NLS-1$
}
public void testBracketed() throws Exception {
runTest("2 * (3 + 4);", 14);
runTest("2 * (3 + 4);", 14); //$NON-NLS-1$
}
}

View file

@ -50,25 +50,25 @@ public class FractionalAutomatedTest extends AutomatedFramework {
return new FractionalAutomatedTest( name );
}
protected void loadProperties() throws Exception{
String resourcePath = org.eclipse.core.runtime.Platform.getPlugin("org.eclipse.cdt.core.tests").find(new Path("/")).getFile();
resourcePath += "resources/parser/AutomatedTest";
String resourcePath = org.eclipse.core.runtime.Platform.getPlugin("org.eclipse.cdt.core.tests").find(new Path("/")).getFile(); //$NON-NLS-1$ //$NON-NLS-2$
resourcePath += "resources/parser/AutomatedTest"; //$NON-NLS-1$
try{
FileInputStream propertiesIn = new FileInputStream( resourcePath + "/FractionalAutomatedTest.properties");
FileInputStream propertiesIn = new FileInputStream( resourcePath + "/FractionalAutomatedTest.properties"); //$NON-NLS-1$
properties.load( propertiesIn );
outputFile = properties.getProperty( "outputFile", "" );
String sourceInfo = properties.getProperty( "source", "" );
outputFile = properties.getProperty( "outputFile", "" ); //$NON-NLS-1$ //$NON-NLS-2$
String sourceInfo = properties.getProperty( "source", "" ); //$NON-NLS-1$ //$NON-NLS-2$
stepSize = Integer.parseInt( properties.getProperty( "stepSize", "50" ) );
windowSize = Integer.parseInt( properties.getProperty( "windowSize", "200" ) );
timeOut = Integer.parseInt( properties.getProperty( "timeOut", "5000" ));
outputDir = properties.getProperty( "outDir", "" );
stepSize = Integer.parseInt( properties.getProperty( "stepSize", "50" ) ); //$NON-NLS-1$ //$NON-NLS-2$
windowSize = Integer.parseInt( properties.getProperty( "windowSize", "200" ) ); //$NON-NLS-1$ //$NON-NLS-2$
timeOut = Integer.parseInt( properties.getProperty( "timeOut", "5000" )); //$NON-NLS-1$ //$NON-NLS-2$
outputDir = properties.getProperty( "outDir", "" ); //$NON-NLS-1$ //$NON-NLS-2$
if( sourceInfo.equals("") )
if( sourceInfo.equals("") ) //$NON-NLS-1$
throw new FileNotFoundException();
else{
StringTokenizer tokenizer = new StringTokenizer( sourceInfo, "," );
StringTokenizer tokenizer = new StringTokenizer( sourceInfo, "," ); //$NON-NLS-1$
String str = null, val = null;
try{
while( tokenizer.hasMoreTokens() ){
@ -79,13 +79,13 @@ public class FractionalAutomatedTest extends AutomatedFramework {
}
} catch ( NoSuchElementException e ){
//only way to get here is to have a missing val, assume cpp for that str
testSources.put( str, "cpp" );
testSources.put( str, "cpp" ); //$NON-NLS-1$
}
}
} catch ( FileNotFoundException e ){
testSources.put( resourcePath + "/defaultCpp", "cpp" );
testSources.put( resourcePath + "/defaultC", "c" );
testSources.put( resourcePath + "/defaultCpp", "cpp" ); //$NON-NLS-1$ //$NON-NLS-2$
testSources.put( resourcePath + "/defaultC", "c" ); //$NON-NLS-1$ //$NON-NLS-2$
}
}
@ -97,8 +97,8 @@ public class FractionalAutomatedTest extends AutomatedFramework {
}
static private String outputFile( String code ) {
if( outputDir == null || outputDir.equals("") )
return "";
if( outputDir == null || outputDir.equals("") ) //$NON-NLS-1$
return ""; //$NON-NLS-1$
File output = new File( outputDir );
@ -116,7 +116,7 @@ public class FractionalAutomatedTest extends AutomatedFramework {
} else {
output.mkdir();
}
File file = new File( outputDir + "/" + failures++ + ".tmp" );
File file = new File( outputDir + "/" + failures++ + ".tmp" ); //$NON-NLS-1$ //$NON-NLS-2$
if( file.exists() )
file.delete();
file.createNewFile();
@ -129,15 +129,15 @@ public class FractionalAutomatedTest extends AutomatedFramework {
} catch ( Exception e )
{}
return "";
return ""; //$NON-NLS-1$
}
static public void reportHang( String code, String file ){
String output = outputFile( code.toString() );
if( output.equals("") )
output = "Parser hang while parsing " + file + "\n";
if( output.equals("") ) //$NON-NLS-1$
output = "Parser hang while parsing " + file + "\n"; //$NON-NLS-1$ //$NON-NLS-2$
else
output = "Parser hang while parsing " + output + "\n";
output = "Parser hang while parsing " + output + "\n"; //$NON-NLS-1$ //$NON-NLS-2$
if( report != null ){
try{
@ -151,10 +151,10 @@ public class FractionalAutomatedTest extends AutomatedFramework {
static public void reportException( String code, String file, String exception ){
String output = outputFile( code.toString() );
if( output.equals("") )
output = exception.getClass().toString() + " encountered in " + file + "\n";
if( output.equals("") ) //$NON-NLS-1$
output = exception.getClass().toString() + " encountered in " + file + "\n"; //$NON-NLS-1$ //$NON-NLS-2$
else
output = exception.getClass().toString() + " encountered in " + output + "\n";
output = exception.getClass().toString() + " encountered in " + output + "\n"; //$NON-NLS-1$ //$NON-NLS-2$
if( report != null ){
try{
@ -174,7 +174,7 @@ public class FractionalAutomatedTest extends AutomatedFramework {
String filePath = file.getCanonicalPath();
String nature = (String)natures.get( filePath );
boolean cppNature = nature.equalsIgnoreCase("cpp");
boolean cppNature = nature.equalsIgnoreCase("cpp"); //$NON-NLS-1$
StringWriter code = new StringWriter();
@ -211,7 +211,7 @@ public class FractionalAutomatedTest extends AutomatedFramework {
while( curPos + windowSize < length){
windowedCode = fullCode.substring( 0, curPos );
windowedCode += "\n" + fullCode.substring( curPos + windowSize, length );
windowedCode += "\n" + fullCode.substring( curPos + windowSize, length ); //$NON-NLS-1$
thread.code = windowedCode;
thread.cppNature = cppNature;

View file

@ -31,13 +31,13 @@ public class PerformanceTests extends BaseASTTest
{
Writer code = new StringWriter();
try {
code.write("#define e0 \"a\"\n");
code.write("#define e1 e0 e0 e0 e0 e0 e0 e0 e0 e0 e0\n");
code.write("#define e2 e1 e1 e1 e1 e1 e1 e1 e1 e1 e1\n");
code.write("#define e3 e2 e2 e2 e2 e2 e2 e2 e2 e2 e2\n");
code.write("#define e4 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3\n");
code.write("#define e5 e4 e4 e4 e4 e4 e4 e4 e4 e4 e4\n");
code.write("void foo() { (void)(e5); }\n");
code.write("#define e0 \"a\"\n"); //$NON-NLS-1$
code.write("#define e1 e0 e0 e0 e0 e0 e0 e0 e0 e0 e0\n"); //$NON-NLS-1$
code.write("#define e2 e1 e1 e1 e1 e1 e1 e1 e1 e1 e1\n"); //$NON-NLS-1$
code.write("#define e3 e2 e2 e2 e2 e2 e2 e2 e2 e2 e2\n"); //$NON-NLS-1$
code.write("#define e4 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3\n"); //$NON-NLS-1$
code.write("#define e5 e4 e4 e4 e4 e4 e4 e4 e4 e4 e4\n"); //$NON-NLS-1$
code.write("void foo() { (void)(e5); }\n"); //$NON-NLS-1$
} catch( IOException ioe ){}
parse(code.toString());

View file

@ -36,7 +36,7 @@ public class PreprocessorConditionalTest extends BaseScannerTest
protected void initializeScanner(String input, Map definitions ) throws Exception
{
scanner= ParserFactory.createScanner( new StringReader(input),"TEXT", new ScannerInfo( definitions ), ParserMode.COMPLETE_PARSE, ParserLanguage.CPP, nullSourceElementRequestor, null, null );
scanner= ParserFactory.createScanner( new StringReader(input),"TEXT", new ScannerInfo( definitions ), ParserMode.COMPLETE_PARSE, ParserLanguage.CPP, nullSourceElementRequestor, null, null ); //$NON-NLS-1$
}
@ -44,9 +44,9 @@ public class PreprocessorConditionalTest extends BaseScannerTest
{
StringBuffer buff = new StringBuffer();
buff.append( "#if " );
buff.append( "#if " ); //$NON-NLS-1$
buff.append( conditional );
buff.append( "\n int x;\n#else\n#error NEVER\n#endif\n");
buff.append( "\n int x;\n#else\n#error NEVER\n#endif\n"); //$NON-NLS-1$
initializeScanner( buff.toString(), definitions );
evaluate();
}
@ -55,9 +55,9 @@ public class PreprocessorConditionalTest extends BaseScannerTest
{
StringBuffer buff = new StringBuffer();
buff.append( "#if " );
buff.append( "#if " ); //$NON-NLS-1$
buff.append( conditional );
buff.append( "\n#error NEVER\n#else\n int x;\n#endif\n");
buff.append( "\n#error NEVER\n#else\n int x;\n#endif\n"); //$NON-NLS-1$
initializeScanner( buff.toString(), definitions );
evaluate();
}
@ -70,14 +70,14 @@ public class PreprocessorConditionalTest extends BaseScannerTest
try
{
validateToken( IToken.t_int );
validateIdentifier( "x");
validateIdentifier( "x"); //$NON-NLS-1$
validateToken( IToken.tSEMI );
scanner.nextToken();
fail( "Should have hit EOF by now");
fail( "Should have hit EOF by now"); //$NON-NLS-1$
}
catch( ScannerException se )
{
fail( "Got #error, should not have gotten that.");
fail( "Got #error, should not have gotten that."); //$NON-NLS-1$
}
catch( EndOfFileException eof )
{
@ -97,17 +97,17 @@ public class PreprocessorConditionalTest extends BaseScannerTest
public void testConditionals()throws Exception
{
Map definitions = new HashMap();
definitions.put( "DEFED", "" );
definitions.put( "VALUE", "30 ");
definitions.put( "DEFED", "" ); //$NON-NLS-1$ //$NON-NLS-2$
definitions.put( "VALUE", "30 "); //$NON-NLS-1$ //$NON-NLS-2$
evaluateConditionalsPositive( "defined( DEFED )", definitions );
evaluateConditionalsNegative( "defined( NOTDEFED )", definitions );
evaluateConditionalsPositive( "defined( DEFED )", definitions ); //$NON-NLS-1$
evaluateConditionalsNegative( "defined( NOTDEFED )", definitions ); //$NON-NLS-1$
evaluateConditionalsNegative( "! defined( DEFED )", definitions );
evaluateConditionalsPositive( "! defined( NOTDEFED )", definitions );
evaluateConditionalsNegative( "! defined( DEFED )", definitions ); //$NON-NLS-1$
evaluateConditionalsPositive( "! defined( NOTDEFED )", definitions ); //$NON-NLS-1$
evaluateConditionalsPositive( "defined( VALUE ) && VALUE == 30", definitions );
evaluateConditionalsNegative( "defined( VALUE ) && VALUE == 40", definitions );
evaluateConditionalsPositive( "defined( VALUE ) && VALUE == 30", definitions ); //$NON-NLS-1$
evaluateConditionalsNegative( "defined( VALUE ) && VALUE == 40", definitions ); //$NON-NLS-1$
}

View file

@ -64,7 +64,7 @@ public class PreprocessorTest extends TestCase {
public void testSimpleExample()
{
Callback c = new Callback();
IPreprocessor p = setupPreprocessor( "#include <stdio.h>",
IPreprocessor p = setupPreprocessor( "#include <stdio.h>", //$NON-NLS-1$
null, // NOTE -- to demonstrate simple example, this should be set up with the info from the
// build properties
null, c );
@ -74,7 +74,7 @@ public class PreprocessorTest extends TestCase {
public IPreprocessor setupPreprocessor( String text, List includePaths, Map defns, ISourceElementRequestor rq )
{
IPreprocessor p = ParserFactory.createPreprocessor( new StringReader( text ), "test", new ScannerInfo( defns,
IPreprocessor p = ParserFactory.createPreprocessor( new StringReader( text ), "test", new ScannerInfo( defns, //$NON-NLS-1$
includePaths == null ? null : (String [])includePaths.toArray()), ParserMode.COMPLETE_PARSE, ParserLanguage.CPP, rq, null, null );
return p;
}

View file

@ -38,77 +38,77 @@ public class QuickParseASTQualifiedNameTest extends BaseASTTest
public void testNamespace() throws Exception
{
IASTNamespaceDefinition namespace = (IASTNamespaceDefinition)assertSoleDeclaration("namespace A { namespace B { int x; } }");
assertQualifiedName( namespace.getFullyQualifiedName(), new String [] {"A" } );
IASTNamespaceDefinition namespace = (IASTNamespaceDefinition)assertSoleDeclaration("namespace A { namespace B { int x; } }"); //$NON-NLS-1$
assertQualifiedName( namespace.getFullyQualifiedName(), new String [] {"A" } ); //$NON-NLS-1$
IASTNamespaceDefinition namespace2 = (IASTNamespaceDefinition)namespace.getDeclarations().next();
assertQualifiedName( namespace2.getFullyQualifiedName(), new String [] { "A", "B" } );
assertQualifiedName( namespace2.getFullyQualifiedName(), new String [] { "A", "B" } ); //$NON-NLS-1$ //$NON-NLS-2$
}
public void testClass() throws Exception
{
IASTAbstractTypeSpecifierDeclaration abs = (IASTAbstractTypeSpecifierDeclaration)assertSoleDeclaration( "class A { class B { int a; }; };");
IASTAbstractTypeSpecifierDeclaration abs = (IASTAbstractTypeSpecifierDeclaration)assertSoleDeclaration( "class A { class B { int a; }; };"); //$NON-NLS-1$
IASTClassSpecifier classSpec = (IASTClassSpecifier)abs.getTypeSpecifier();
assertQualifiedName( classSpec.getFullyQualifiedName(), new String [] { "A" } );
assertQualifiedName( classSpec.getFullyQualifiedName(), new String [] { "A" } ); //$NON-NLS-1$
Iterator subDecls = classSpec.getDeclarations();
abs = (IASTAbstractTypeSpecifierDeclaration)subDecls.next();
assertFalse( subDecls.hasNext() );
classSpec = (IASTClassSpecifier)abs.getTypeSpecifier();
assertQualifiedName( classSpec.getFullyQualifiedName(), new String [] { "A", "B" } );
assertQualifiedName( classSpec.getFullyQualifiedName(), new String [] { "A", "B" } ); //$NON-NLS-1$ //$NON-NLS-2$
}
public void testEnum() throws Exception
{
Iterator declarations = parse( "class A { enum E1 { enumerator = 1 }; };\n namespace N { enum E2 { enumerator = 4 }; }\n" ).getDeclarations();
Iterator declarations = parse( "class A { enum E1 { enumerator = 1 }; };\n namespace N { enum E2 { enumerator = 4 }; }\n" ).getDeclarations(); //$NON-NLS-1$
IASTAbstractTypeSpecifierDeclaration abs = (IASTAbstractTypeSpecifierDeclaration)declarations.next();
IASTClassSpecifier classSpec = (IASTClassSpecifier)abs.getTypeSpecifier();
IASTEnumerationSpecifier enumSpec = (IASTEnumerationSpecifier)(((IASTAbstractTypeSpecifierDeclaration)classSpec.getDeclarations().next()).getTypeSpecifier());
assertQualifiedName( enumSpec.getFullyQualifiedName(), new String[] { "A", "E1" } );
assertQualifiedName( enumSpec.getFullyQualifiedName(), new String[] { "A", "E1" } ); //$NON-NLS-1$ //$NON-NLS-2$
IASTNamespaceDefinition nms = (IASTNamespaceDefinition)declarations.next();
enumSpec = (IASTEnumerationSpecifier)(((IASTAbstractTypeSpecifierDeclaration)nms.getDeclarations().next()).getTypeSpecifier());
assertQualifiedName( enumSpec.getFullyQualifiedName(), new String[] { "N", "E2" } );
assertQualifiedName( enumSpec.getFullyQualifiedName(), new String[] { "N", "E2" } ); //$NON-NLS-1$ //$NON-NLS-2$
assertFalse( declarations.hasNext() );
}
public void testVariable() throws Exception
{
IASTNamespaceDefinition topNMS = (IASTNamespaceDefinition)assertSoleDeclaration("namespace A { int x; namespace B { int y; } }");
IASTNamespaceDefinition topNMS = (IASTNamespaceDefinition)assertSoleDeclaration("namespace A { int x; namespace B { int y; } }"); //$NON-NLS-1$
Iterator level1 = topNMS.getDeclarations();
IASTVariable var = (IASTVariable)level1.next();
assertQualifiedName( var.getFullyQualifiedName(), new String[] {"A","x"});
assertQualifiedName( var.getFullyQualifiedName(), new String[] {"A","x"}); //$NON-NLS-1$ //$NON-NLS-2$
Iterator level2 = ((IASTNamespaceDefinition)level1.next()).getDeclarations();
assertFalse( level1.hasNext());
var = (IASTVariable)level2.next();
assertQualifiedName( var.getFullyQualifiedName(), new String[] {"A","B","y"});
assertQualifiedName( var.getFullyQualifiedName(), new String[] {"A","B","y"}); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
public void testTypedef() throws Exception
{
IASTNamespaceDefinition topNMS = (IASTNamespaceDefinition)
assertSoleDeclaration("namespace FLEA { typedef int GODS_INT; class ANTHONY { typedef ANTHONY * tonyPointer; }; }");
assertSoleDeclaration("namespace FLEA { typedef int GODS_INT; class ANTHONY { typedef ANTHONY * tonyPointer; }; }"); //$NON-NLS-1$
Iterator level1 = topNMS.getDeclarations();
assertQualifiedName( ((IASTTypedefDeclaration)level1.next()).getFullyQualifiedName(), new String [] { "FLEA", "GODS_INT" } );
assertQualifiedName( ((IASTTypedefDeclaration)((IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)level1.next()).getTypeSpecifier()).getDeclarations().next()).getFullyQualifiedName(), new String [] { "FLEA", "ANTHONY", "tonyPointer" } );
assertQualifiedName( ((IASTTypedefDeclaration)level1.next()).getFullyQualifiedName(), new String [] { "FLEA", "GODS_INT" } ); //$NON-NLS-1$ //$NON-NLS-2$
assertQualifiedName( ((IASTTypedefDeclaration)((IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)level1.next()).getTypeSpecifier()).getDeclarations().next()).getFullyQualifiedName(), new String [] { "FLEA", "ANTHONY", "tonyPointer" } ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
public void testMembers() throws Exception
{
IASTNamespaceDefinition topNMS =
(IASTNamespaceDefinition)assertSoleDeclaration( "namespace John { class David { int Shannon; void Camelon(); }; } ");
(IASTNamespaceDefinition)assertSoleDeclaration( "namespace John { class David { int Shannon; void Camelon(); }; } "); //$NON-NLS-1$
Iterator members =
((IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)topNMS.getDeclarations().next()).getTypeSpecifier()).getDeclarations();
assertQualifiedName( ((IASTField)members.next()).getFullyQualifiedName(), new String[] { "John", "David", "Shannon" } );
assertQualifiedName( ((IASTMethod)members.next()).getFullyQualifiedName(), new String[] { "John", "David", "Camelon" } );
assertQualifiedName( ((IASTField)members.next()).getFullyQualifiedName(), new String[] { "John", "David", "Shannon" } ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
assertQualifiedName( ((IASTMethod)members.next()).getFullyQualifiedName(), new String[] { "John", "David", "Camelon" } ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
public void testFunction() throws Exception
{
IASTNamespaceDefinition topNMS =
(IASTNamespaceDefinition)assertSoleDeclaration( "namespace Bogdan { void Wears(); namespace Fancy { int Pants(); } }" );
(IASTNamespaceDefinition)assertSoleDeclaration( "namespace Bogdan { void Wears(); namespace Fancy { int Pants(); } }" ); //$NON-NLS-1$
Iterator members = topNMS.getDeclarations();
assertQualifiedName( ((IASTFunction)members.next()).getFullyQualifiedName(), new String[] { "Bogdan", "Wears" } );
assertQualifiedName( ((IASTFunction)((IASTNamespaceDefinition)members.next()).getDeclarations().next()).getFullyQualifiedName(), new String[] { "Bogdan", "Fancy", "Pants" } );
assertQualifiedName( ((IASTFunction)members.next()).getFullyQualifiedName(), new String[] { "Bogdan", "Wears" } ); //$NON-NLS-1$ //$NON-NLS-2$
assertQualifiedName( ((IASTFunction)((IASTNamespaceDefinition)members.next()).getDeclarations().next()).getFullyQualifiedName(), new String[] { "Bogdan", "Fancy", "Pants" } ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
}

View file

@ -1173,8 +1173,8 @@ public class QuickParseASTTests extends BaseASTTest
IASTMacro m = (IASTMacro)macros.next();
assertEquals( m.getName(), "DEF" ); //$NON-NLS-1$
assertEquals( m.getStartingOffset(), code.indexOf("#define") ); //$NON-NLS-1$
assertEquals( m.getNameOffset(), code.indexOf("DEF") );
assertEquals( m.getEndingOffset(), code.indexOf("VALUE") + 5);
assertEquals( m.getNameOffset(), code.indexOf("DEF") ); //$NON-NLS-1$
assertEquals( m.getEndingOffset(), code.indexOf("VALUE") + 5); //$NON-NLS-1$
}
public void testTemplateDeclarationOfFunction() throws Exception

View file

@ -59,17 +59,17 @@ public class StructuralParseTest extends TestCase {
{
callback = new StructuralParseCallback();
IParser parser = ParserFactory.createParser(
ParserFactory.createScanner( new StringReader( code ), "test-code", new ScannerInfo(),
ParserFactory.createScanner( new StringReader( code ), "test-code", new ScannerInfo(), //$NON-NLS-1$
ParserMode.STRUCTURAL_PARSE, language, callback, new NullLogService(), null ),
callback, ParserMode.STRUCTURAL_PARSE, language, null
);
if( ! parser.parse() && throwOnError ) throw new ParserException( "FAILURE");
if( ! parser.parse() && throwOnError ) throw new ParserException( "FAILURE"); //$NON-NLS-1$
return callback.getCompilationUnit();
}
public void testBug60149() throws Exception
{
IASTCompilationUnit cu = parse( "extern \"C\" { int v; } " );
IASTCompilationUnit cu = parse( "extern \"C\" { int v; } " ); //$NON-NLS-1$
Iterator i = cu.getDeclarations();
@ -78,19 +78,19 @@ public class StructuralParseTest extends TestCase {
i = ls.getDeclarations();
IASTVariable v = (IASTVariable) i.next();
assertEquals( v.getName(), "v" );
assertEquals( v.getName(), "v" ); //$NON-NLS-1$
assertFalse( i.hasNext() );
}
public void testBug60480() throws Exception
{
IASTCompilationUnit cu = parse( "template < int > void foo();" );
IASTCompilationUnit cu = parse( "template < int > void foo();" ); //$NON-NLS-1$
Iterator i = cu.getDeclarations();
IASTTemplateDeclaration template = (IASTTemplateDeclaration) i.next();
assertFalse( i.hasNext() );
IASTFunction foo = (IASTFunction) template.getOwnedDeclaration();
assertEquals( foo.getName(), "foo" );
assertEquals( foo.getName(), "foo" ); //$NON-NLS-1$
}
}

View file

@ -55,27 +55,27 @@ public class TortureTest extends FractionalAutomatedTest {
}
protected void loadProperties() throws Exception{
String resourcePath = org.eclipse.core.runtime.Platform.getPlugin("org.eclipse.cdt.core.tests").find(new Path("/")).getFile();
resourcePath += "resources/parser/TortureTest";
String resourcePath = org.eclipse.core.runtime.Platform.getPlugin("org.eclipse.cdt.core.tests").find(new Path("/")).getFile(); //$NON-NLS-1$ //$NON-NLS-2$
resourcePath += "resources/parser/TortureTest"; //$NON-NLS-1$
try {
FileInputStream propertiesIn = new FileInputStream(resourcePath + "/TortureTest.properties");
FileInputStream propertiesIn = new FileInputStream(resourcePath + "/TortureTest.properties"); //$NON-NLS-1$
properties.load (propertiesIn);
isEnabled = properties.getProperty("enabled", "false").equalsIgnoreCase("true");
quickParse = properties.getProperty("quickParse", "true").equalsIgnoreCase("true");
isEnabled = properties.getProperty("enabled", "false").equalsIgnoreCase("true"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
quickParse = properties.getProperty("quickParse", "true").equalsIgnoreCase("true"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
String sourceInfo = properties.getProperty("source", "");
String sourceInfo = properties.getProperty("source", ""); //$NON-NLS-1$ //$NON-NLS-2$
stepSize = Integer.parseInt(properties.getProperty("stepSize", "25000"));
outputFile = properties.getProperty("outputFile", "");
timeOut = Integer.parseInt(properties.getProperty("timeOut", "60000"));
outputDir = properties.getProperty("outDir", "");
stepSize = Integer.parseInt(properties.getProperty("stepSize", "25000")); //$NON-NLS-1$ //$NON-NLS-2$
outputFile = properties.getProperty("outputFile", ""); //$NON-NLS-1$ //$NON-NLS-2$
timeOut = Integer.parseInt(properties.getProperty("timeOut", "60000")); //$NON-NLS-1$ //$NON-NLS-2$
outputDir = properties.getProperty("outDir", ""); //$NON-NLS-1$ //$NON-NLS-2$
if (sourceInfo.equals(""))
if (sourceInfo.equals("")) //$NON-NLS-1$
throw new FileNotFoundException();
else {
StringTokenizer tokenizer = new StringTokenizer(sourceInfo, ",");
StringTokenizer tokenizer = new StringTokenizer(sourceInfo, ","); //$NON-NLS-1$
String str = null, val = null;
try {
while (tokenizer.hasMoreTokens()) {
@ -86,12 +86,12 @@ public class TortureTest extends FractionalAutomatedTest {
}
} catch (NoSuchElementException e){
//only way to get here is to have a missing val, assume cpp for that str
testSources.put(str, "cpp");
testSources.put(str, "cpp"); //$NON-NLS-1$
}
}
} catch (FileNotFoundException e){
testSources.put(resourcePath, "cpp");
testSources.put(resourcePath, "cpp"); //$NON-NLS-1$
}
if (!isEnabled) testSources.clear();
@ -114,11 +114,11 @@ public class TortureTest extends FractionalAutomatedTest {
} catch (Exception ex) {}
if (e instanceof AssertionFailedError) {
output = file + ": Parse failed on line ";
output += lineNumber + "\n";
output = file + ": Parse failed on line "; //$NON-NLS-1$
output += lineNumber + "\n"; //$NON-NLS-1$
} else {
output = file + ": " + e.getClass().toString();
output += " on line " + lineNumber + "\n";
output = file + ": " + e.getClass().toString(); //$NON-NLS-1$
output += " on line " + lineNumber + "\n"; //$NON-NLS-1$ //$NON-NLS-2$
}
try {
if (report != null) {
@ -135,9 +135,9 @@ public class TortureTest extends FractionalAutomatedTest {
String fileName = file.getName();
// Filter out gcc-specific tests that are not easy to detect automatically
if ( fileName.equals("init-2.c")
|| fileName.equals("init-3.c")
|| fileName.equals("struct-ini-4.c")) {
if ( fileName.equals("init-2.c") //$NON-NLS-1$
|| fileName.equals("init-3.c") //$NON-NLS-1$
|| fileName.equals("struct-ini-4.c")) { //$NON-NLS-1$
// gcc-specific (and deprecated) designated initializers
// struct { int e1, e2; } v = { e2: 0 };
@ -145,7 +145,7 @@ public class TortureTest extends FractionalAutomatedTest {
return false;
}
if ( fileName.equals("stmtexpr3.C")) {
if ( fileName.equals("stmtexpr3.C")) { //$NON-NLS-1$
// statements in expressions
// B() : a(({ 1; })) {}
@ -153,7 +153,7 @@ public class TortureTest extends FractionalAutomatedTest {
return false;
}
if ( fileName.equals("widechar-1.c")) {
if ( fileName.equals("widechar-1.c")) { //$NON-NLS-1$
// concatenation of incompatible literals
// char *s = L"a" "b";
@ -161,9 +161,9 @@ public class TortureTest extends FractionalAutomatedTest {
return false;
}
if ( fileName.equals("bf-common.h")
|| fileName.equals("class-tests-1.h")
|| fileName.equals("unclaimed-category-1.h")) {
if ( fileName.equals("bf-common.h") //$NON-NLS-1$
|| fileName.equals("class-tests-1.h") //$NON-NLS-1$
|| fileName.equals("unclaimed-category-1.h")) { //$NON-NLS-1$
// ObjectiveC header file
@ -171,41 +171,41 @@ public class TortureTest extends FractionalAutomatedTest {
}
// Process some DejaGNU instructions
if (testCode.indexOf("{ dg-error") >= 0) return false;
if (testCode.indexOf("// ERROR") >= 0) return false;
if (testCode.indexOf("- ERROR") >= 0) return false;
if (testCode.indexOf("// XFAIL") >= 0) return false;
if (testCode.indexOf("- XFAIL") >= 0) return false;
if (testCode.indexOf("{ xfail") >= 0) return false;
if (testCode.indexOf("{ dg-preprocess") >= 0) return false;
if (testCode.indexOf("{ dg-do preprocess") >= 0) return false;
if (testCode.indexOf("{ dg-error") >= 0) return false; //$NON-NLS-1$
if (testCode.indexOf("// ERROR") >= 0) return false; //$NON-NLS-1$
if (testCode.indexOf("- ERROR") >= 0) return false; //$NON-NLS-1$
if (testCode.indexOf("// XFAIL") >= 0) return false; //$NON-NLS-1$
if (testCode.indexOf("- XFAIL") >= 0) return false; //$NON-NLS-1$
if (testCode.indexOf("{ xfail") >= 0) return false; //$NON-NLS-1$
if (testCode.indexOf("{ dg-preprocess") >= 0) return false; //$NON-NLS-1$
if (testCode.indexOf("{ dg-do preprocess") >= 0) return false; //$NON-NLS-1$
// gcc extensions
if (testCode.indexOf("__attribute") >= 0) return false;
if (testCode.indexOf("__extension") >= 0) return false;
if (testCode.indexOf("__restrict") >= 0) return false;
if (testCode.indexOf("__const") >= 0) return false;
if (testCode.indexOf("__declspec") >= 0) return false;
if (testCode.indexOf("__alignof") >= 0) return false;
if (testCode.indexOf("__label") >= 0) return false;
if (testCode.indexOf("__real") >= 0) return false;
if (testCode.indexOf("__imag") >= 0) return false;
if (testCode.indexOf("extern template") >= 0) return false;
if (testCode.indexOf("inline template") >= 0) return false;
if (testCode.indexOf("static template") >= 0) return false;
if (testCode.indexOf("typeof") >= 0) return false;
if (testCode.indexOf(" asm") >= 0) return false;
if (testCode.indexOf(") return") >= 0) return false;
if (testCode.indexOf("#ident") >= 0) return false;
if (testCode.indexOf("__attribute") >= 0) return false; //$NON-NLS-1$
if (testCode.indexOf("__extension") >= 0) return false; //$NON-NLS-1$
if (testCode.indexOf("__restrict") >= 0) return false; //$NON-NLS-1$
if (testCode.indexOf("__const") >= 0) return false; //$NON-NLS-1$
if (testCode.indexOf("__declspec") >= 0) return false; //$NON-NLS-1$
if (testCode.indexOf("__alignof") >= 0) return false; //$NON-NLS-1$
if (testCode.indexOf("__label") >= 0) return false; //$NON-NLS-1$
if (testCode.indexOf("__real") >= 0) return false; //$NON-NLS-1$
if (testCode.indexOf("__imag") >= 0) return false; //$NON-NLS-1$
if (testCode.indexOf("extern template") >= 0) return false; //$NON-NLS-1$
if (testCode.indexOf("inline template") >= 0) return false; //$NON-NLS-1$
if (testCode.indexOf("static template") >= 0) return false; //$NON-NLS-1$
if (testCode.indexOf("typeof") >= 0) return false; //$NON-NLS-1$
if (testCode.indexOf(" asm") >= 0) return false; //$NON-NLS-1$
if (testCode.indexOf(") return") >= 0) return false; //$NON-NLS-1$
if (testCode.indexOf("#ident") >= 0) return false; //$NON-NLS-1$
// These are expected errors (not marked in the code)
if (testCode.indexOf("#include_next") >= 0) return false;
if (testCode.indexOf("#include_next") >= 0) return false; //$NON-NLS-1$
// Long long literals are part of ANSI C99
// if (containsLongLongLiterals(testCode)) return false;
if (testCode.indexOf("{ dg-do run") >= 0) return true;
if (testCode.indexOf("{ dg-do link") >= 0) return true;
if (testCode.indexOf("{ dg-do run") >= 0) return true; //$NON-NLS-1$
if (testCode.indexOf("{ dg-do link") >= 0) return true; //$NON-NLS-1$
return true;
}
@ -233,7 +233,7 @@ public class TortureTest extends FractionalAutomatedTest {
String testCode = code.toString();
if ( file.getName().equals("concat1.C")) {
if ( file.getName().equals("concat1.C")) { //$NON-NLS-1$
// This is a really time-consuming test,
// override timeout
timeOut = 600000;
@ -244,7 +244,7 @@ public class TortureTest extends FractionalAutomatedTest {
thread.quickParse = quickParse;
thread.code = testCode;
thread.cppNature = nature.equalsIgnoreCase("cpp");
thread.cppNature = nature.equalsIgnoreCase("cpp"); //$NON-NLS-1$
thread.file = filePath;
thread.start();

View file

@ -26,7 +26,7 @@ import org.w3c.dom.Element;
public class XMLDumper {
public static class Test {
private String msg = "hi";
private String msg = "hi"; //$NON-NLS-1$
public String getMsg() {
return msg;
@ -45,7 +45,7 @@ public class XMLDumper {
Transformer transformer = TransformerFactory.newInstance().newTransformer();
transformer.transform(new DOMSource(document), new StreamResult(writer));
System.out.println( "STRXML = " + writer.toString() ); //Spit out DOM as a String
System.out.println( "STRXML = " + writer.toString() ); //Spit out DOM as a String //$NON-NLS-1$
} catch (TransformerException e) {
e.printStackTrace();
} catch (ParserConfigurationException e) {
@ -74,7 +74,7 @@ public class XMLDumper {
Element element = document.createElement(clsName);
map.put(obj, new Integer(id));
element.setAttribute("id",String.valueOf(id++));
element.setAttribute("id",String.valueOf(id++)); //$NON-NLS-1$
Field [] fields = cls.getDeclaredFields();
for (int i = 0; i < fields.length; ++i) {
@ -99,7 +99,7 @@ public class XMLDumper {
value = e;
}
} else {
String methodName = "get" +
String methodName = "get" + //$NON-NLS-1$
fieldName.substring(0, 1).toUpperCase() +
fieldName.substring(1);
@ -133,7 +133,7 @@ public class XMLDumper {
else {
Object v = map.get(value);
if (v != null)
fieldElement.setAttribute("refid", v.toString());
fieldElement.setAttribute("refid", v.toString()); //$NON-NLS-1$
else
fieldElement.appendChild(createObject(value));
}

View file

@ -14,8 +14,6 @@ import org.eclipse.cdt.core.cdescriptor.tests.CDescriptorTests;
import org.eclipse.cdt.core.filetype.tests.ResolverTests;
import org.eclipse.cdt.core.indexer.tests.DependencyTests;
import org.eclipse.cdt.core.indexer.tests.IndexManagerTests;
import org.eclipse.cdt.core.internal.errorparsers.tests.GCCErrorParserTests;
import org.eclipse.cdt.core.internal.errorparsers.tests.GenericErrorParserTests;
import org.eclipse.cdt.core.model.tests.AllCoreTests;
import org.eclipse.cdt.core.model.tests.BinaryTests;
import org.eclipse.cdt.core.model.tests.ElementDeltaTests;

View file

@ -10,5 +10,6 @@
<classpathentry kind="src" path="browser"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="src" path="aniefer"/>
<classpathentry kind="output" path="bin"/>
</classpath>

View file

@ -1,2 +1,3 @@
bin
doc
aniefer

View file

@ -21,7 +21,6 @@ import java.util.Locale;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
import org.eclipse.cdt.internal.core.model.CModelManager;
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IPath;

View file

@ -82,7 +82,7 @@ public class InMemoryIndex {
* If the include does not exist, it adds it to the tree.
*/
protected void addIncludeRef(char[] include, int fileNum) {
IncludeEntry entry= (IncludeEntry) this.includes.get(include);
IncludeEntry entry= this.includes.get(include);
if (entry == null) {
entry= new IncludeEntry(include, ++lastId);
entry.addRef(fileNum);
@ -113,7 +113,7 @@ public class InMemoryIndex {
* If the word does not exist, it adds it in the index.
*/
protected void addRef(char[] word, int fileNum) {
WordEntry entry= (WordEntry) this.words.get(word);
WordEntry entry= this.words.get(word);
if (entry == null) {
entry= new WordEntry(word);
entry.addRef(fileNum);
@ -142,10 +142,10 @@ public class InMemoryIndex {
IncludeEntry parentEntry=null;
if (inclusion != null)
childEntry= (IncludeEntry) this.includes.get(inclusion);
childEntry= this.includes.get(inclusion);
if (parent != null)
parentEntry= (IncludeEntry) this.includes.get(parent);
parentEntry= this.includes.get(parent);
childEntry.addParent(fileNumber,(parentEntry!=null) ? parentEntry.getID() : -1);
@ -181,7 +181,7 @@ public class InMemoryIndex {
* Returns the include entry corresponding to the given include.
*/
protected IncludeEntry getIncludeEntry(char[] include) {
return (IncludeEntry) includes.get(include);
return includes.get(include);
}
/**
* @see IIndex#getNumDocuments()
@ -237,7 +237,7 @@ public class InMemoryIndex {
* Returns the word entry corresponding to the given word.
*/
protected WordEntry getWordEntry(char[] word) {
return (WordEntry) words.get(word);
return words.get(word);
}
/**
* Initialises the fields of the index

View file

@ -16,12 +16,10 @@ import java.util.Iterator;
import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.cdt.core.filetype.ICFileType;
import org.eclipse.cdt.core.model.CoreModel;
import org.eclipse.cdt.core.parser.ast.ASTClassKind;
import org.eclipse.cdt.core.parser.ast.ASTNotImplementedException;
import org.eclipse.cdt.core.parser.ast.IASTBaseSpecifier;
import org.eclipse.cdt.core.parser.ast.IASTClassSpecifier;
import org.eclipse.cdt.core.parser.ast.IASTDeclaration;
import org.eclipse.cdt.core.parser.ast.IASTElaboratedTypeSpecifier;
import org.eclipse.cdt.core.parser.ast.IASTEnumerationSpecifier;
import org.eclipse.cdt.core.parser.ast.IASTEnumerator;
@ -57,10 +55,10 @@ public abstract class AbstractIndexer implements IIndexer, IIndexConstants, ICSe
public static boolean VERBOSE = false;
//IDs defined in plugin.xml for file types
private final static String C_SOURCE_ID = "org.eclipse.cdt.core.fileType.c_source";
private final static String C_HEADER_ID = "org.eclipse.cdt.core.fileType.c_header";
private final static String CPP_SOURCE_ID = "org.eclipse.cdt.core.fileType.cxx_source";
private final static String CPP_HEADER_ID = "org.eclipse.cdt.core.fileType.cxx_header";
private final static String C_SOURCE_ID = "org.eclipse.cdt.core.fileType.c_source"; //$NON-NLS-1$
private final static String C_HEADER_ID = "org.eclipse.cdt.core.fileType.c_header"; //$NON-NLS-1$
private final static String CPP_SOURCE_ID = "org.eclipse.cdt.core.fileType.cxx_source"; //$NON-NLS-1$
private final static String CPP_HEADER_ID = "org.eclipse.cdt.core.fileType.cxx_header"; //$NON-NLS-1$
public AbstractIndexer() {
super();

View file

@ -12,30 +12,19 @@
package org.eclipse.cdt.internal.core.search.indexing;
import java.io.IOException;
import java.util.HashSet;
import org.eclipse.cdt.core.model.ICProject;
import org.eclipse.cdt.core.model.IPathEntry;
import org.eclipse.cdt.core.model.ISourceEntry;
import org.eclipse.cdt.core.model.ISourceRoot;
import org.eclipse.cdt.internal.core.Util;
import org.eclipse.cdt.internal.core.index.IIndex;
import org.eclipse.cdt.internal.core.index.IQueryResult;
import org.eclipse.cdt.internal.core.index.impl.IFileDocument;
import org.eclipse.cdt.internal.core.model.CModel;
import org.eclipse.cdt.internal.core.model.CModelManager;
import org.eclipse.cdt.internal.core.model.SourceEntry;
import org.eclipse.cdt.internal.core.model.SourceRoot;
import org.eclipse.cdt.internal.core.search.SimpleLookupTable;
import org.eclipse.cdt.internal.core.search.processing.JobManager;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IResourceProxy;
import org.eclipse.core.resources.IResourceProxyVisitor;
import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
@ -74,13 +63,11 @@ public class IndexAllProject extends IndexRequest {
IQueryResult[] results = index.queryInDocumentNames(""); // all file names //$NON-NLS-1$
int max = results == null ? 0 : results.length;
final SimpleLookupTable indexedFileNames = new SimpleLookupTable(max == 0 ? 33 : max + 11);
final String OK = "OK"; //$NON-NLS-1$
final String DELETED = "DELETED"; //$NON-NLS-1$
for (int i = 0; i < max; i++)
indexedFileNames.put(results[i].getPath(), DELETED);
final long indexLastModified = max == 0 ? 0L : index.getIndexFile().lastModified();
CModel model = (CModel) CModelManager.getDefault().getCModel();
CModel model = CModelManager.getDefault().getCModel();
if (model == null)
return false;

View file

@ -777,7 +777,7 @@ public class IndexManager extends JobManager implements IIndexConstants {
};
public void removeAllIndexerProblems( IProject project){
String jobName = "remove markers";
String jobName = "remove markers"; //$NON-NLS-1$
RemoveIndexMarkersJob job = new RemoveIndexMarkersJob( project, jobName );
job.setPriority( Job.DECORATE );
job.schedule();

View file

@ -34,7 +34,6 @@ import org.eclipse.cdt.core.parser.ParserMode;
import org.eclipse.cdt.core.parser.ParserUtil;
import org.eclipse.cdt.core.parser.ScannerInfo;
import org.eclipse.cdt.internal.core.index.IDocument;
import org.eclipse.cdt.internal.core.model.CModelManager;
import org.eclipse.cdt.utils.TimeOut;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;

View file

@ -731,7 +731,7 @@ public class SourceIndexerRequestor implements ISourceElementRequestor, IIndexCo
continue;
}
String jobName = INDEXER_MARKER_PROCESSING;
jobName += " (";
jobName += " ("; //$NON-NLS-1$
jobName += resource.getFullPath();
jobName += ')';

View file

@ -405,10 +405,10 @@ public class CModelBuilder {
private Include createInclusion(Parent parent, IASTInclusion inclusion) throws CModelException{
// create element
Include element = new Include((CElement)parent, inclusion.getName(), !inclusion.isLocal());
Include element = new Include(parent, inclusion.getName(), !inclusion.isLocal());
element.setFullPathName(inclusion.getFullFileName());
// add to parent
parent.addChild((CElement) element);
parent.addChild(element);
// set position
element.setIdPos(inclusion.getNameOffset(), inclusion.getNameEndOffset() - inclusion.getNameOffset());
element.setPos(inclusion.getStartingOffset(), inclusion.getEndingOffset() - inclusion.getStartingOffset());
@ -421,7 +421,7 @@ public class CModelBuilder {
// create element
org.eclipse.cdt.internal.core.model.Macro element = new Macro(parent, macro.getName());
// add to parent
parent.addChild((CElement) element);
parent.addChild(element);
// set position
element.setIdPos(macro.getNameOffset(), macro.getNameEndOffset() - macro.getNameOffset());
element.setPos(macro.getStartingOffset(), macro.getEndingOffset() - macro.getStartingOffset());
@ -437,9 +437,9 @@ public class CModelBuilder {
String nsName = (nsDef.getName() == null )
? "" //$NON-NLS-1$
: nsDef.getName().toString();
Namespace element = new Namespace ((ICElement)parent, nsName );
Namespace element = new Namespace (parent, nsName );
// add to parent
parent.addChild((ICElement)element);
parent.addChild(element);
element.setIdPos(nsDef.getNameOffset(),
(nsName.length() == 0) ? type.length() : (nsDef.getNameEndOffset() - nsDef.getNameOffset()));
element.setPos(nsDef.getStartingOffset(), nsDef.getEndingOffset() - nsDef.getStartingOffset());
@ -456,9 +456,9 @@ public class CModelBuilder {
String enumName = (enumSpecifier.getName() == null )
? "" //$NON-NLS-1$
: enumSpecifier.getName().toString();
Enumeration element = new Enumeration ((ICElement)parent, enumName );
Enumeration element = new Enumeration (parent, enumName );
// add to parent
parent.addChild((ICElement)element);
parent.addChild(element);
Iterator i = enumSpecifier.getEnumerators();
while (i.hasNext()){
// create sub element
@ -534,10 +534,10 @@ public class CModelBuilder {
Structure element;
if(!isTemplate){
Structure classElement = new Structure( (CElement)parent, kind, className );
Structure classElement = new Structure( parent, kind, className );
element = classElement;
} else {
StructureTemplate classTemplate = new StructureTemplate( (CElement)parent, kind, className );
StructureTemplate classTemplate = new StructureTemplate( parent, kind, className );
element = classTemplate;
}
@ -549,7 +549,7 @@ public class CModelBuilder {
}
// add to parent
parent.addChild((ICElement) element);
parent.addChild(element);
// set element position
element.setIdPos( classSpecifier.getNameOffset(),
(className.length() == 0) ? type.length() : (classSpecifier.getNameEndOffset() - classSpecifier.getNameOffset() ));
@ -574,7 +574,7 @@ public class CModelBuilder {
element.setTypeName(typeName.toString());
// add to parent
parent.addChild((CElement)element);
parent.addChild(element);
// set positions
element.setIdPos(typeDefDeclaration.getNameOffset(), (typeDefDeclaration.getNameEndOffset() - typeDefDeclaration.getNameOffset()));

View file

@ -144,7 +144,7 @@ public class BasicSearchResultCollector implements ICSearchResultCollector {
for( int i = 0; i < paramTypes.length; i++ ){
if( i != 0 )
paramString += ", ";
paramString += ", "; //$NON-NLS-1$
paramString += paramTypes[i];
}

View file

@ -34,24 +34,15 @@ import org.eclipse.cdt.core.parser.ParserMode;
import org.eclipse.cdt.core.parser.ParserUtil;
import org.eclipse.cdt.core.parser.ScannerException;
import org.eclipse.cdt.core.parser.ScannerInfo;
import org.eclipse.cdt.core.parser.ast.ASTClassKind;
import org.eclipse.cdt.core.parser.ast.ASTNotImplementedException;
import org.eclipse.cdt.core.parser.ast.ASTPointerOperator;
import org.eclipse.cdt.core.parser.ast.ASTUtil;
import org.eclipse.cdt.core.parser.ast.IASTClassSpecifier;
import org.eclipse.cdt.core.parser.ast.IASTCompilationUnit;
import org.eclipse.cdt.core.parser.ast.IASTDeclaration;
import org.eclipse.cdt.core.parser.ast.IASTElaboratedTypeSpecifier;
import org.eclipse.cdt.core.parser.ast.IASTEnumerationSpecifier;
import org.eclipse.cdt.core.parser.ast.IASTFunction;
import org.eclipse.cdt.core.parser.ast.IASTOffsetableElement;
import org.eclipse.cdt.core.parser.ast.IASTParameterDeclaration;
import org.eclipse.cdt.core.parser.ast.IASTSimpleTypeSpecifier;
import org.eclipse.cdt.core.parser.ast.IASTTypeSpecifier;
import org.eclipse.cdt.core.search.*;
import org.eclipse.cdt.core.search.ICSearchConstants;
import org.eclipse.cdt.core.search.ICSearchPattern;
import org.eclipse.cdt.core.search.ICSearchScope;
import org.eclipse.cdt.core.search.OrPattern;
import org.eclipse.cdt.internal.core.CharOperation;
import org.eclipse.cdt.internal.core.index.IEntryResult;
import org.eclipse.cdt.internal.core.index.IIndex;

View file

@ -9,16 +9,10 @@ package org.eclipse.cdt.internal.core.search.matching;
import java.util.Iterator;
import org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate;
import org.eclipse.cdt.core.parser.ast.ASTClassKind;
import org.eclipse.cdt.core.parser.ast.ASTNotImplementedException;
import org.eclipse.cdt.core.parser.ast.IASTBaseSpecifier;
import org.eclipse.cdt.core.parser.ast.IASTClassSpecifier;
import org.eclipse.cdt.core.parser.ast.IASTElaboratedTypeSpecifier;
import org.eclipse.cdt.core.parser.ast.IASTEnumerationSpecifier;
import org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement;
import org.eclipse.cdt.core.parser.ast.IASTQualifiedNameElement;
import org.eclipse.cdt.core.parser.ast.IASTTypeSpecifier;
import org.eclipse.cdt.core.search.ICSearchConstants;
import org.eclipse.cdt.internal.core.search.indexing.AbstractIndexer;
/**

View file

@ -8,12 +8,10 @@ package org.eclipse.cdt.internal.core.search.matching;
import java.util.Iterator;
import org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate;
import org.eclipse.cdt.core.parser.ast.ASTNotImplementedException;
import org.eclipse.cdt.core.parser.ast.IASTBaseSpecifier;
import org.eclipse.cdt.core.parser.ast.IASTClassSpecifier;
import org.eclipse.cdt.core.parser.ast.IASTElaboratedTypeSpecifier;
import org.eclipse.cdt.core.parser.ast.IASTTypeSpecifier;
import org.eclipse.cdt.internal.core.search.indexing.AbstractIndexer;
/**

View file

@ -14,13 +14,11 @@
package org.eclipse.cdt.internal.core.search.matching;
import java.io.IOException;
import java.util.Iterator;
import org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate;
import org.eclipse.cdt.core.parser.ast.ASTUtil;
import org.eclipse.cdt.core.parser.ast.IASTFunction;
import org.eclipse.cdt.core.parser.ast.IASTMethod;
import org.eclipse.cdt.core.parser.ast.IASTParameterDeclaration;
import org.eclipse.cdt.core.parser.ast.IASTQualifiedNameElement;
import org.eclipse.cdt.core.search.ICSearchScope;
import org.eclipse.cdt.internal.core.CharOperation;

View file

@ -13,7 +13,6 @@
*/
package org.eclipse.cdt.internal.ui.search;
import java.text.MessageFormat;
import java.util.HashMap;
import org.eclipse.cdt.core.CCorePlugin;

View file

@ -13,15 +13,12 @@ package org.eclipse.cdt.internal.ui.search.actions;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.cdt.core.ICLogConstants;
import org.eclipse.cdt.core.model.CModelException;
import org.eclipse.cdt.core.model.CoreModel;
import org.eclipse.cdt.core.model.ICElement;
import org.eclipse.cdt.core.model.ITranslationUnit;
import org.eclipse.cdt.core.parser.IParser;
import org.eclipse.cdt.core.parser.IScannerInfo;
import org.eclipse.cdt.core.parser.IScannerInfoProvider;
@ -45,11 +42,8 @@ import org.eclipse.cdt.core.parser.ast.IASTNode;
import org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement;
import org.eclipse.cdt.core.parser.ast.IASTVariable;
import org.eclipse.cdt.core.resources.FileStorage;
import org.eclipse.cdt.core.search.BasicSearchResultCollector;
import org.eclipse.cdt.core.search.ICSearchConstants;
import org.eclipse.cdt.core.search.ICSearchScope;
import org.eclipse.cdt.core.search.IMatch;
import org.eclipse.cdt.core.search.OrPattern;
import org.eclipse.cdt.core.search.SearchEngine;
import org.eclipse.cdt.core.search.ICSearchConstants.SearchFor;
import org.eclipse.cdt.internal.ui.dialogs.ElementListSelectionDialog;
@ -59,7 +53,6 @@ import org.eclipse.cdt.internal.ui.search.CSearchMessages;
import org.eclipse.cdt.internal.ui.util.EditorUtility;
import org.eclipse.cdt.ui.CSearchResultLabelProvider;
import org.eclipse.cdt.ui.CUIPlugin;
import org.eclipse.cdt.ui.IWorkingCopyManager;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
@ -68,6 +61,7 @@ import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.Path;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.dialogs.ProgressMonitorDialog;
import org.eclipse.jface.operation.IRunnableWithProgress;