diff --git a/core/org.eclipse.cdt.core.tests/failures/org/eclipse/cdt/core/parser/failedTests/FailedCompleteParseASTTest.java b/core/org.eclipse.cdt.core.tests/failures/org/eclipse/cdt/core/parser/failedTests/FailedCompleteParseASTTest.java index 1fb6b56a7f0..89c5eac8ce1 100644 --- a/core/org.eclipse.cdt.core.tests/failures/org/eclipse/cdt/core/parser/failedTests/FailedCompleteParseASTTest.java +++ b/core/org.eclipse.cdt.core.tests/failures/org/eclipse/cdt/core/parser/failedTests/FailedCompleteParseASTTest.java @@ -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(); diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/AutomatedFramework.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/AutomatedFramework.java index 3326734d962..33c2447760c 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/AutomatedFramework.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/AutomatedFramework.java @@ -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; } diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/AutomatedTest.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/AutomatedTest.java index 36dffc9487d..d428db9e338 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/AutomatedTest.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/AutomatedTest.java @@ -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$ } } diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/BranchTrackerTest.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/BranchTrackerTest.java index a22b9288cbc..2a1881ab5ba 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/BranchTrackerTest.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/BranchTrackerTest.java @@ -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$ } } } diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/CompleteParseASTExpressionTest.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/CompleteParseASTExpressionTest.java index cecab37a0d5..fe009127b0f 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/CompleteParseASTExpressionTest.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/CompleteParseASTExpressionTest.java @@ -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(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(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(a) );").getDeclarations(); + Iterator i = parse( "int *a; \n int foo(); int foo( double* ); \n int x = foo( reinterpret_cast(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(a) );").getDeclarations(); + Iterator i = parse( "int a; \n int foo(); int foo( char ); \n int x = foo( static_cast(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(&a) );").getDeclarations(); + Iterator i = parse( "const int a; \n int foo(); int foo( int * ); \n int x = foo( const_cast(&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(); diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/CompleteParseASTTest.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/CompleteParseASTTest.java index d797eb8b8e8..5afaabab02a 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/CompleteParseASTTest.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/CompleteParseASTTest.java @@ -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(); diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/CompleteParseBaseTest.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/CompleteParseBaseTest.java index a82fdad9de0..5ff36345c2a 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/CompleteParseBaseTest.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/CompleteParseBaseTest.java @@ -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$ } } diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/CompletionParseBaseTest.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/CompletionParseBaseTest.java index 2d79192075c..5bdea702016 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/CompletionParseBaseTest.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/CompletionParseBaseTest.java @@ -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, diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ExprEvalTest.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ExprEvalTest.java index d745484781d..1bd8226fae2 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ExprEvalTest.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ExprEvalTest.java @@ -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$ } } diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/FractionalAutomatedTest.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/FractionalAutomatedTest.java index e2d3a5b4a05..195c1f7bf9e 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/FractionalAutomatedTest.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/FractionalAutomatedTest.java @@ -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; diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ParserSymbolTableTemplateTests.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ParserSymbolTableTemplateTests.java index 45ca1368e07..41cb92fa6f7 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ParserSymbolTableTemplateTests.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ParserSymbolTableTemplateTests.java @@ -70,20 +70,20 @@ public class ParserSymbolTableTemplateTests extends TestCase { public void testTemplateParameterAsParent() throws Exception{ newTable(); - ITemplateSymbol template = table.newTemplateSymbol( "A" ); - ISymbol param = table.newSymbol( "T", TypeInfo.t_templateParameter ); + ITemplateSymbol template = table.newTemplateSymbol( "A" ); //$NON-NLS-1$ + ISymbol param = table.newSymbol( "T", TypeInfo.t_templateParameter ); //$NON-NLS-1$ template.addTemplateParameter( param ); ITemplateFactory factory = table.newTemplateFactory(); factory.setContainingSymbol( table.getCompilationUnit() ); factory.pushTemplate( template ); - IDerivableContainerSymbol A = table.newDerivableContainerSymbol( "A", TypeInfo.t_class ); + IDerivableContainerSymbol A = table.newDerivableContainerSymbol( "A", TypeInfo.t_class ); //$NON-NLS-1$ factory.addSymbol( A ); A.addParent( param ); - IDerivableContainerSymbol B = table.newDerivableContainerSymbol( "B", TypeInfo.t_class ); - ISymbol i = table.newSymbol( "i", TypeInfo.t_int ); + IDerivableContainerSymbol B = table.newDerivableContainerSymbol( "B", TypeInfo.t_class ); //$NON-NLS-1$ + ISymbol i = table.newSymbol( "i", TypeInfo.t_int ); //$NON-NLS-1$ B.addSymbol( i ); table.getCompilationUnit().addSymbol( B ); @@ -91,22 +91,22 @@ public class ParserSymbolTableTemplateTests extends TestCase { ArrayList args = new ArrayList(); args.add( type ); - IContainerSymbol instance = (IContainerSymbol) table.getCompilationUnit().lookupTemplateId( "A", args ); + IContainerSymbol instance = (IContainerSymbol) table.getCompilationUnit().lookupTemplateId( "A", args ); //$NON-NLS-1$ assertEquals( instance.getInstantiatedSymbol(), A ); - ISymbol a = table.newSymbol( "a", TypeInfo.t_type ); + ISymbol a = table.newSymbol( "a", TypeInfo.t_type ); //$NON-NLS-1$ a.setTypeSymbol( instance ); table.getCompilationUnit().addSymbol( a ); - ISymbol look = table.getCompilationUnit().lookup( "a" ); + ISymbol look = table.getCompilationUnit().lookup( "a" ); //$NON-NLS-1$ assertEquals( look, a ); ISymbol symbol = a.getTypeSymbol(); assertEquals( symbol, instance ); - look = instance.lookup( "i" ); + look = instance.lookup( "i" ); //$NON-NLS-1$ assertEquals( look, i ); } @@ -123,45 +123,45 @@ public class ParserSymbolTableTemplateTests extends TestCase { public void testTemplateInstanceAsParent() throws Exception{ newTable(); - ITemplateSymbol template = table.newTemplateSymbol( "A" ); + ITemplateSymbol template = table.newTemplateSymbol( "A" ); //$NON-NLS-1$ - ISymbol param = table.newSymbol( "T", TypeInfo.t_templateParameter ); + ISymbol param = table.newSymbol( "T", TypeInfo.t_templateParameter ); //$NON-NLS-1$ template.addTemplateParameter( param ); ITemplateFactory factory = table.newTemplateFactory(); factory.setContainingSymbol( table.getCompilationUnit() ); factory.pushTemplate( template ); - IDerivableContainerSymbol A = table.newDerivableContainerSymbol( "A", TypeInfo.t_class ); + IDerivableContainerSymbol A = table.newDerivableContainerSymbol( "A", TypeInfo.t_class ); //$NON-NLS-1$ factory.addSymbol( A ); - ISymbol t = table.newSymbol( "t", TypeInfo.t_type ); - ISymbol look = template.lookup( "T" ); + ISymbol t = table.newSymbol( "t", TypeInfo.t_type ); //$NON-NLS-1$ + ISymbol look = template.lookup( "T" ); //$NON-NLS-1$ assertEquals( look, param ); t.setTypeSymbol( param ); A.addSymbol( t ); - IDerivableContainerSymbol B = table.newDerivableContainerSymbol( "B", TypeInfo.t_class ); + IDerivableContainerSymbol B = table.newDerivableContainerSymbol( "B", TypeInfo.t_class ); //$NON-NLS-1$ table.getCompilationUnit().addSymbol( B ); TypeInfo type = new TypeInfo( TypeInfo.t_int, 0 , null ); ArrayList args = new ArrayList(); args.add( type ); - look = table.getCompilationUnit().lookupTemplateId( "A", args ); + look = table.getCompilationUnit().lookupTemplateId( "A", args ); //$NON-NLS-1$ assertTrue( look.isTemplateInstance() ); assertEquals( look.getInstantiatedSymbol(), A ); B.addParent( look ); - ISymbol b = table.newSymbol( "b", TypeInfo.t_type ); + ISymbol b = table.newSymbol( "b", TypeInfo.t_type ); //$NON-NLS-1$ b.setTypeSymbol( B ); table.getCompilationUnit().addSymbol( b ); - look = table.getCompilationUnit().lookup( "b" ); + look = table.getCompilationUnit().lookup( "b" ); //$NON-NLS-1$ assertEquals( look, b ); - look = ((IDerivableContainerSymbol) b.getTypeSymbol()).lookup( "t" ); + look = ((IDerivableContainerSymbol) b.getTypeSymbol()).lookup( "t" ); //$NON-NLS-1$ assertTrue( look.isTemplateInstance() ); assertEquals( look.getInstantiatedSymbol(), t ); assertTrue( look.isType( TypeInfo.t_int ) ); @@ -186,14 +186,14 @@ public class ParserSymbolTableTemplateTests extends TestCase { public void testTemplateParameterDefaults() throws Exception{ newTable(); - ITemplateSymbol template = table.newTemplateSymbol( "X" ); + ITemplateSymbol template = table.newTemplateSymbol( "X" ); //$NON-NLS-1$ - ISymbol paramT = table.newSymbol( "T", TypeInfo.t_templateParameter ); + ISymbol paramT = table.newSymbol( "T", TypeInfo.t_templateParameter ); //$NON-NLS-1$ template.addTemplateParameter( paramT ); - ISymbol look = template.lookup( "T" ); + ISymbol look = template.lookup( "T" ); //$NON-NLS-1$ assertEquals( look, paramT ); - ISymbol paramU = table.newSymbol( "U", TypeInfo.t_templateParameter ); + ISymbol paramU = table.newSymbol( "U", TypeInfo.t_templateParameter ); //$NON-NLS-1$ paramU.getTypeInfo().setDefault( new TypeInfo( TypeInfo.t_type, 0, look ) ); template.addTemplateParameter( paramU ); @@ -201,36 +201,36 @@ public class ParserSymbolTableTemplateTests extends TestCase { factory.setContainingSymbol( table.getCompilationUnit() ); factory.pushTemplate( template ); - IDerivableContainerSymbol X = table.newDerivableContainerSymbol( "X", TypeInfo.t_class ); + IDerivableContainerSymbol X = table.newDerivableContainerSymbol( "X", TypeInfo.t_class ); //$NON-NLS-1$ factory.addSymbol( X ); - look = X.lookup( "T" ); + look = X.lookup( "T" ); //$NON-NLS-1$ assertEquals( look, paramT ); - ISymbol t = table.newSymbol( "t", TypeInfo.t_type ); + ISymbol t = table.newSymbol( "t", TypeInfo.t_type ); //$NON-NLS-1$ t.setTypeSymbol( look ); X.addSymbol( t ); - look = X.lookup( "U" ); + look = X.lookup( "U" ); //$NON-NLS-1$ assertEquals( look, paramU ); - ISymbol u = table.newSymbol( "u", TypeInfo.t_type ); + ISymbol u = table.newSymbol( "u", TypeInfo.t_type ); //$NON-NLS-1$ u.setTypeSymbol( look ); X.addSymbol( u ); TypeInfo type = new TypeInfo( TypeInfo.t_char, 0, null ); ArrayList args = new ArrayList(); args.add( type ); - IDerivableContainerSymbol lookX = (IDerivableContainerSymbol) table.getCompilationUnit().lookupTemplateId( "X", args ); + IDerivableContainerSymbol lookX = (IDerivableContainerSymbol) table.getCompilationUnit().lookupTemplateId( "X", args ); //$NON-NLS-1$ assertTrue( lookX.isTemplateInstance() ); assertEquals( lookX.getInstantiatedSymbol(), X ); - look = lookX.lookup( "t" ); + look = lookX.lookup( "t" ); //$NON-NLS-1$ assertTrue( look.isTemplateInstance() ); assertEquals( look.getInstantiatedSymbol(), t ); assertTrue( look.isType( TypeInfo.t_char ) ); - look = lookX.lookup( "u" ); + look = lookX.lookup( "u" ); //$NON-NLS-1$ assertTrue( look.isTemplateInstance() ); assertEquals( look.getInstantiatedSymbol(), u ); assertTrue( look.isType( TypeInfo.t_char ) ); @@ -254,58 +254,58 @@ public class ParserSymbolTableTemplateTests extends TestCase { public void testTemplateParameterAsFunctionArgument() throws Exception{ newTable(); - ITemplateSymbol template = table.newTemplateSymbol( "A" ); - ISymbol paramT = table.newSymbol( "T", TypeInfo.t_templateParameter ); + ITemplateSymbol template = table.newTemplateSymbol( "A" ); //$NON-NLS-1$ + ISymbol paramT = table.newSymbol( "T", TypeInfo.t_templateParameter ); //$NON-NLS-1$ template.addTemplateParameter( paramT ); ITemplateFactory factory = table.newTemplateFactory(); factory.setContainingSymbol( table.getCompilationUnit() ); factory.pushTemplate( template ); - IDerivableContainerSymbol A = table.newDerivableContainerSymbol( "A", TypeInfo.t_class ); + IDerivableContainerSymbol A = table.newDerivableContainerSymbol( "A", TypeInfo.t_class ); //$NON-NLS-1$ factory.addSymbol( A ); - ISymbol t = table.newSymbol( "t", TypeInfo.t_type ); + ISymbol t = table.newSymbol( "t", TypeInfo.t_type ); //$NON-NLS-1$ t.setTypeSymbol( paramT ); A.addSymbol( t ); - IDerivableContainerSymbol B = table.newDerivableContainerSymbol( "B", TypeInfo.t_class ); + IDerivableContainerSymbol B = table.newDerivableContainerSymbol( "B", TypeInfo.t_class ); //$NON-NLS-1$ table.getCompilationUnit().addSymbol( B ); ArrayList args = new ArrayList(); TypeInfo arg = new TypeInfo( TypeInfo.t_type, 0, B ); args.add( arg ); - IDerivableContainerSymbol lookA = (IDerivableContainerSymbol) table.getCompilationUnit().lookupTemplateId( "A", args ); + IDerivableContainerSymbol lookA = (IDerivableContainerSymbol) table.getCompilationUnit().lookupTemplateId( "A", args ); //$NON-NLS-1$ assertTrue( lookA.isTemplateInstance() ); assertEquals( lookA.getInstantiatedSymbol(), A ); - IParameterizedSymbol f1 = table.newParameterizedSymbol( "f", TypeInfo.t_function ); + IParameterizedSymbol f1 = table.newParameterizedSymbol( "f", TypeInfo.t_function ); //$NON-NLS-1$ f1.addParameter( TypeInfo.t_char, 0, null, false ); table.getCompilationUnit().addSymbol( f1 ); - IParameterizedSymbol f2 = table.newParameterizedSymbol( "f", TypeInfo.t_function ); + IParameterizedSymbol f2 = table.newParameterizedSymbol( "f", TypeInfo.t_function ); //$NON-NLS-1$ f2.addParameter( lookA, 0, null, false ); table.getCompilationUnit().addSymbol( f2 ); - IParameterizedSymbol f3 = table.newParameterizedSymbol( "f", TypeInfo.t_function ); + IParameterizedSymbol f3 = table.newParameterizedSymbol( "f", TypeInfo.t_function ); //$NON-NLS-1$ f3.addParameter( TypeInfo.t_int, 0, null, false ); table.getCompilationUnit().addSymbol( f3 ); args = new ArrayList(); args.add( new TypeInfo( TypeInfo.t_type, 0, B ) ); - IDerivableContainerSymbol lookA2 = (IDerivableContainerSymbol) table.getCompilationUnit().lookupTemplateId( "A", args ); + IDerivableContainerSymbol lookA2 = (IDerivableContainerSymbol) table.getCompilationUnit().lookupTemplateId( "A", args ); //$NON-NLS-1$ assertEquals( lookA2, lookA ); - ISymbol a = table.newSymbol( "a", TypeInfo.t_type ); + ISymbol a = table.newSymbol( "a", TypeInfo.t_type ); //$NON-NLS-1$ a.setTypeSymbol( lookA ); table.getCompilationUnit().addSymbol( a ); ArrayList params = new ArrayList(); params.add( new TypeInfo( TypeInfo.t_type, 0, a ) ); - ISymbol look = table.getCompilationUnit().unqualifiedFunctionLookup( "f", params ); + ISymbol look = table.getCompilationUnit().unqualifiedFunctionLookup( "f", params ); //$NON-NLS-1$ assertEquals( look, f2 ); } @@ -322,41 +322,41 @@ public class ParserSymbolTableTemplateTests extends TestCase { public void test_14_1__3_ParameterLookup() throws Exception{ newTable(); - IDerivableContainerSymbol T = table.newDerivableContainerSymbol( "T", TypeInfo.t_class ); + IDerivableContainerSymbol T = table.newDerivableContainerSymbol( "T", TypeInfo.t_class ); //$NON-NLS-1$ table.getCompilationUnit().addSymbol( T ); - ISymbol i = table.newSymbol( "i", TypeInfo.t_int ); + ISymbol i = table.newSymbol( "i", TypeInfo.t_int ); //$NON-NLS-1$ table.getCompilationUnit().addSymbol( i ); - ITemplateSymbol template = table.newTemplateSymbol( "f" ); + ITemplateSymbol template = table.newTemplateSymbol( "f" ); //$NON-NLS-1$ - ISymbol paramT = table.newSymbol( "T", TypeInfo.t_templateParameter ); + ISymbol paramT = table.newSymbol( "T", TypeInfo.t_templateParameter ); //$NON-NLS-1$ template.addTemplateParameter( paramT ); ITemplateFactory factory = table.newTemplateFactory(); factory.setContainingSymbol( table.getCompilationUnit() ); factory.pushTemplate( template ); - ISymbol parami = table.newSymbol( "i", TypeInfo.t_templateParameter ); + ISymbol parami = table.newSymbol( "i", TypeInfo.t_templateParameter ); //$NON-NLS-1$ parami.getTypeInfo().setTemplateParameterType( TypeInfo.t_type ); - ISymbol look = factory.lookup( "T" ); + ISymbol look = factory.lookup( "T" ); //$NON-NLS-1$ assertEquals( look, paramT ); parami.setTypeSymbol( look ); template.addTemplateParameter( parami ); - IParameterizedSymbol f = table.newParameterizedSymbol( "f", TypeInfo.t_function ); - ISymbol fParam = table.newSymbol( "t", TypeInfo.t_type ); + IParameterizedSymbol f = table.newParameterizedSymbol( "f", TypeInfo.t_function ); //$NON-NLS-1$ + ISymbol fParam = table.newSymbol( "t", TypeInfo.t_type ); //$NON-NLS-1$ fParam.setTypeSymbol( paramT ); f.addParameter( fParam ); factory.addSymbol( f ); - look = f.lookup( "T" ); + look = f.lookup( "T" ); //$NON-NLS-1$ assertEquals( look, paramT ); - look = f.lookup( "i" ); + look = f.lookup( "i" ); //$NON-NLS-1$ assertEquals( look, parami ); } @@ -378,9 +378,9 @@ public class ParserSymbolTableTemplateTests extends TestCase { public void test_14_1__8_ParameterAdjustment() throws Exception{ newTable(); - ITemplateSymbol templateR = table.newTemplateSymbol( "R" ); + ITemplateSymbol templateR = table.newTemplateSymbol( "R" ); //$NON-NLS-1$ - ISymbol paramA = table.newSymbol( "a", TypeInfo.t_templateParameter ); + ISymbol paramA = table.newSymbol( "a", TypeInfo.t_templateParameter ); //$NON-NLS-1$ paramA.getTypeInfo().setTemplateParameterType( TypeInfo.t_int ); paramA.addPtrOperator( new PtrOp( PtrOp.t_pointer ) ); templateR.addTemplateParameter( paramA ); @@ -389,12 +389,12 @@ public class ParserSymbolTableTemplateTests extends TestCase { factory.setContainingSymbol( table.getCompilationUnit() ); factory.pushTemplate( templateR ); - IDerivableContainerSymbol R = table.newDerivableContainerSymbol( "R", TypeInfo.t_struct ); + IDerivableContainerSymbol R = table.newDerivableContainerSymbol( "R", TypeInfo.t_struct ); //$NON-NLS-1$ factory.addSymbol( R ); - ITemplateSymbol templateS = table.newTemplateSymbol( "S" ); + ITemplateSymbol templateS = table.newTemplateSymbol( "S" ); //$NON-NLS-1$ - ISymbol paramB = table.newSymbol( "b", TypeInfo.t_templateParameter ); + ISymbol paramB = table.newSymbol( "b", TypeInfo.t_templateParameter ); //$NON-NLS-1$ paramB.getTypeInfo().setTemplateParameterType( TypeInfo.t_int ); paramB.addPtrOperator( new PtrOp( PtrOp.t_array ) ); templateS.addTemplateParameter( paramB ); @@ -403,10 +403,10 @@ public class ParserSymbolTableTemplateTests extends TestCase { factory.setContainingSymbol( table.getCompilationUnit() ); factory.pushTemplate( templateS ); - IDerivableContainerSymbol S = table.newDerivableContainerSymbol( "S", TypeInfo.t_struct ); + IDerivableContainerSymbol S = table.newDerivableContainerSymbol( "S", TypeInfo.t_struct ); //$NON-NLS-1$ factory.addSymbol( S ); - ISymbol look = table.getCompilationUnit().lookup( "S" ); + ISymbol look = table.getCompilationUnit().lookup( "S" ); //$NON-NLS-1$ assertEquals( look, templateS ); Iterator iter = templateS.getParameterList().iterator(); @@ -417,33 +417,33 @@ public class ParserSymbolTableTemplateTests extends TestCase { assertFalse( iter.hasNext() ); assertEquals( ptr.getType(), PtrOp.t_pointer ); - ISymbol p = table.newSymbol( "p", TypeInfo.t_int ); + ISymbol p = table.newSymbol( "p", TypeInfo.t_int ); //$NON-NLS-1$ p.addPtrOperator( new PtrOp( PtrOp.t_pointer ) ); table.getCompilationUnit().addSymbol( p ); List args = new ArrayList(); args.add( new TypeInfo( TypeInfo.t_type, 0, p ) ); - look = table.getCompilationUnit().lookupTemplateId( "R", args ); + look = table.getCompilationUnit().lookupTemplateId( "R", args ); //$NON-NLS-1$ assertTrue( look.isTemplateInstance() ); assertEquals( look.getInstantiatedSymbol(), R ); - look = table.getCompilationUnit().lookupTemplateId( "S", args ); + look = table.getCompilationUnit().lookupTemplateId( "S", args ); //$NON-NLS-1$ assertTrue( look.isTemplateInstance() ); assertEquals( look.getInstantiatedSymbol(), S ); - ISymbol v = table.newSymbol( "v", TypeInfo.t_int ); + ISymbol v = table.newSymbol( "v", TypeInfo.t_int ); //$NON-NLS-1$ v.addPtrOperator( new PtrOp( PtrOp.t_array ) ); table.getCompilationUnit().addSymbol( v ); args.clear(); args.add( new TypeInfo( TypeInfo.t_type, 0, v ) ); - look = table.getCompilationUnit().lookupTemplateId( "R", args ); + look = table.getCompilationUnit().lookupTemplateId( "R", args ); //$NON-NLS-1$ assertTrue( look.isTemplateInstance() ); assertEquals( look.getInstantiatedSymbol(), R ); - look = table.getCompilationUnit().lookupTemplateId( "S", args ); + look = table.getCompilationUnit().lookupTemplateId( "S", args ); //$NON-NLS-1$ assertTrue( look.isTemplateInstance() ); assertEquals( look.getInstantiatedSymbol(), S ); } @@ -460,9 +460,9 @@ public class ParserSymbolTableTemplateTests extends TestCase { public void test_14_3__4_ParameterDefaults() throws Exception{ newTable(); - ITemplateSymbol template = table.newTemplateSymbol( "String" ); + ITemplateSymbol template = table.newTemplateSymbol( "String" ); //$NON-NLS-1$ - ISymbol param = table.newSymbol( "T", TypeInfo.t_templateParameter ); + ISymbol param = table.newSymbol( "T", TypeInfo.t_templateParameter ); //$NON-NLS-1$ param.getTypeInfo().setDefault( new TypeInfo( TypeInfo.t_char, 0, null ) ); template.addTemplateParameter( param ); @@ -470,11 +470,11 @@ public class ParserSymbolTableTemplateTests extends TestCase { factory.setContainingSymbol( table.getCompilationUnit() ); factory.pushTemplate( template ); - IDerivableContainerSymbol string = table.newDerivableContainerSymbol( "String", TypeInfo.t_class ); + IDerivableContainerSymbol string = table.newDerivableContainerSymbol( "String", TypeInfo.t_class ); //$NON-NLS-1$ factory.addSymbol( string ); List args = new ArrayList(); - ISymbol look = table.getCompilationUnit().lookupTemplateId( "String", args ); + ISymbol look = table.getCompilationUnit().lookupTemplateId( "String", args ); //$NON-NLS-1$ assertTrue( look.isTemplateInstance() ); assertEquals( look.getInstantiatedSymbol(), string ); } @@ -495,25 +495,25 @@ public class ParserSymbolTableTemplateTests extends TestCase { public void test_14_3_1__2_TypeArgumentRestrictions() throws Exception{ newTable(); - ITemplateSymbol template = table.newTemplateSymbol( "X" ); - template.addTemplateParameter( table.newSymbol( "T", TypeInfo.t_templateParameter ) ); + ITemplateSymbol template = table.newTemplateSymbol( "X" ); //$NON-NLS-1$ + template.addTemplateParameter( table.newSymbol( "T", TypeInfo.t_templateParameter ) ); //$NON-NLS-1$ ITemplateFactory factory = table.newTemplateFactory(); factory.setContainingSymbol( table.getCompilationUnit() ); factory.pushTemplate( template ); - factory.addSymbol( table.newDerivableContainerSymbol( "X", TypeInfo.t_class ) ); + factory.addSymbol( table.newDerivableContainerSymbol( "X", TypeInfo.t_class ) ); //$NON-NLS-1$ - IParameterizedSymbol f = table.newParameterizedSymbol( "f", TypeInfo.t_function ); + IParameterizedSymbol f = table.newParameterizedSymbol( "f", TypeInfo.t_function ); //$NON-NLS-1$ table.getCompilationUnit().addSymbol( f ); - IDerivableContainerSymbol S = table.newDerivableContainerSymbol( "S", TypeInfo.t_struct ); + IDerivableContainerSymbol S = table.newDerivableContainerSymbol( "S", TypeInfo.t_struct ); //$NON-NLS-1$ f.addSymbol( S ); List args = new ArrayList(); args.add( new TypeInfo( TypeInfo.t_type, 0, S ) ); try{ - f.lookupTemplateId( "X", args ); + f.lookupTemplateId( "X", args ); //$NON-NLS-1$ assertTrue( false ); } catch( ParserSymbolTableException e ){ assertEquals( e.reason, ParserSymbolTableException.r_BadTemplateArgument ); @@ -522,7 +522,7 @@ public class ParserSymbolTableTemplateTests extends TestCase { args.clear(); args.add( new TypeInfo( TypeInfo.t_type, 0, S, new PtrOp( PtrOp.t_pointer ), false ) ); try{ - f.lookupTemplateId( "X", args ); + f.lookupTemplateId( "X", args ); //$NON-NLS-1$ assertTrue( false ); } catch( ParserSymbolTableException e ){ assertEquals( e.reason, ParserSymbolTableException.r_BadTemplateArgument ); @@ -545,10 +545,10 @@ public class ParserSymbolTableTemplateTests extends TestCase { public void test_14_3_2__2_NonTypeArgumentRestrictions() throws Exception{ newTable(); - ITemplateSymbol template = table.newTemplateSymbol( "X" ); - template.addTemplateParameter( table.newSymbol( "T", TypeInfo.t_templateParameter ) ); + ITemplateSymbol template = table.newTemplateSymbol( "X" ); //$NON-NLS-1$ + template.addTemplateParameter( table.newSymbol( "T", TypeInfo.t_templateParameter ) ); //$NON-NLS-1$ - ISymbol param2 = table.newSymbol( "p", TypeInfo.t_templateParameter ); + ISymbol param2 = table.newSymbol( "p", TypeInfo.t_templateParameter ); //$NON-NLS-1$ param2.getTypeInfo().setTemplateParameterType( TypeInfo.t_char ); param2.addPtrOperator( new PtrOp( PtrOp.t_pointer ) ); template.addTemplateParameter( param2 ); @@ -557,21 +557,21 @@ public class ParserSymbolTableTemplateTests extends TestCase { factory.setContainingSymbol( table.getCompilationUnit() ); factory.pushTemplate( template ); - IDerivableContainerSymbol X = table.newDerivableContainerSymbol( "X", TypeInfo.t_class ); + IDerivableContainerSymbol X = table.newDerivableContainerSymbol( "X", TypeInfo.t_class ); //$NON-NLS-1$ factory.addSymbol( X ); List args = new ArrayList(); args.add( new TypeInfo( TypeInfo.t_int, 0, null ) ); - args.add( new TypeInfo( TypeInfo.t_char, 0, null, new PtrOp( PtrOp.t_pointer ), "Studebaker" ) ); + args.add( new TypeInfo( TypeInfo.t_char, 0, null, new PtrOp( PtrOp.t_pointer ), "Studebaker" ) ); //$NON-NLS-1$ try{ - table.getCompilationUnit().lookupTemplateId( "X", args ); + table.getCompilationUnit().lookupTemplateId( "X", args ); //$NON-NLS-1$ assertTrue( false ); } catch( ParserSymbolTableException e ){ assertEquals( e.reason, ParserSymbolTableException.r_BadTemplateArgument ); } - ISymbol p = table.newSymbol( "p", TypeInfo.t_char ); + ISymbol p = table.newSymbol( "p", TypeInfo.t_char ); //$NON-NLS-1$ p.addPtrOperator( new PtrOp( PtrOp.t_array ) ); table.getCompilationUnit().addSymbol( p ); @@ -579,7 +579,7 @@ public class ParserSymbolTableTemplateTests extends TestCase { args.add( new TypeInfo( TypeInfo.t_int, 0, null ) ); args.add( new TypeInfo( TypeInfo.t_type, 0, p ) ); - ISymbol look = table.getCompilationUnit().lookupTemplateId( "X", args ); + ISymbol look = table.getCompilationUnit().lookupTemplateId( "X", args ); //$NON-NLS-1$ assertTrue( look.isTemplateInstance() ); assertEquals( look.getInstantiatedSymbol(), X ); } @@ -605,9 +605,9 @@ public class ParserSymbolTableTemplateTests extends TestCase { public void test_14_3_2__3_NonTypeArgumentRestrictions() throws Exception{ newTable(); - ITemplateSymbol template = table.newTemplateSymbol( "X" ); + ITemplateSymbol template = table.newTemplateSymbol( "X" ); //$NON-NLS-1$ - ISymbol param = table.newSymbol( "p", TypeInfo.t_templateParameter ); + ISymbol param = table.newSymbol( "p", TypeInfo.t_templateParameter ); //$NON-NLS-1$ param.getTypeInfo().setTemplateParameterType( TypeInfo.t_int ); param.addPtrOperator( new PtrOp( PtrOp.t_pointer ) ); template.addTemplateParameter( param ); @@ -616,18 +616,18 @@ public class ParserSymbolTableTemplateTests extends TestCase { factory.setContainingSymbol( table.getCompilationUnit() ); factory.pushTemplate( template ); - IDerivableContainerSymbol X = table.newDerivableContainerSymbol( "X", TypeInfo.t_class ); + IDerivableContainerSymbol X = table.newDerivableContainerSymbol( "X", TypeInfo.t_class ); //$NON-NLS-1$ factory.addSymbol( X ); - IDerivableContainerSymbol S = table.newDerivableContainerSymbol( "S", TypeInfo.t_struct ); + IDerivableContainerSymbol S = table.newDerivableContainerSymbol( "S", TypeInfo.t_struct ); //$NON-NLS-1$ table.getCompilationUnit().addSymbol( S ); - ISymbol m = table.newSymbol( "m", TypeInfo.t_int ); + ISymbol m = table.newSymbol( "m", TypeInfo.t_int ); //$NON-NLS-1$ S.addSymbol( m ); - ISymbol s = table.newSymbol( "s", TypeInfo.t_int ); + ISymbol s = table.newSymbol( "s", TypeInfo.t_int ); //$NON-NLS-1$ s.getTypeInfo().setBit( true, TypeInfo.isStatic ); S.addSymbol( s ); - ISymbol t = table.newSymbol( "t", TypeInfo.t_int ); + ISymbol t = table.newSymbol( "t", TypeInfo.t_int ); //$NON-NLS-1$ t.addPtrOperator( new PtrOp( PtrOp.t_pointer ) ); S.addSymbol( t ); @@ -638,7 +638,7 @@ public class ParserSymbolTableTemplateTests extends TestCase { try { - table.getCompilationUnit().lookupTemplateId( "X", args ); + table.getCompilationUnit().lookupTemplateId( "X", args ); //$NON-NLS-1$ assertTrue( false ); } catch ( ParserSymbolTableException e ){ assertEquals( e.reason, ParserSymbolTableException.r_BadTemplateArgument ); @@ -649,7 +649,7 @@ public class ParserSymbolTableTemplateTests extends TestCase { try { - table.getCompilationUnit().lookupTemplateId( "X", args ); + table.getCompilationUnit().lookupTemplateId( "X", args ); //$NON-NLS-1$ assertTrue( false ); } catch ( ParserSymbolTableException e ){ assertEquals( e.reason, ParserSymbolTableException.r_BadTemplateArgument ); @@ -660,7 +660,7 @@ public class ParserSymbolTableTemplateTests extends TestCase { arg.addOperatorExpression( TypeInfo.OperatorExpression.addressof ); args.add( arg ); - assertNotNull( table.getCompilationUnit().lookupTemplateId( "X", args ) ); + assertNotNull( table.getCompilationUnit().lookupTemplateId( "X", args ) ); //$NON-NLS-1$ } /** @@ -678,9 +678,9 @@ public class ParserSymbolTableTemplateTests extends TestCase { public void test_14_3_2__4_NonTypeArgumentRestrictions() throws Exception{ newTable(); - ITemplateSymbol template = table.newTemplateSymbol( "B" ); + ITemplateSymbol template = table.newTemplateSymbol( "B" ); //$NON-NLS-1$ - ISymbol I = table.newSymbol( "I", TypeInfo.t_templateParameter ); + ISymbol I = table.newSymbol( "I", TypeInfo.t_templateParameter ); //$NON-NLS-1$ I.getTypeInfo().setTemplateParameterType( TypeInfo.t_int ); I.addPtrOperator( new PtrOp( PtrOp.t_reference, true, false ) ); template.addTemplateParameter( I ); @@ -689,25 +689,25 @@ public class ParserSymbolTableTemplateTests extends TestCase { factory.setContainingSymbol( table.getCompilationUnit() ); factory.pushTemplate( template ); - IDerivableContainerSymbol B = table.newDerivableContainerSymbol( "B", TypeInfo.t_struct ); + IDerivableContainerSymbol B = table.newDerivableContainerSymbol( "B", TypeInfo.t_struct ); //$NON-NLS-1$ factory.addSymbol( B ); List args = new ArrayList( ); - args.add( new TypeInfo( TypeInfo.t_int, 0, null, null, "1" ) ); + args.add( new TypeInfo( TypeInfo.t_int, 0, null, null, "1" ) ); //$NON-NLS-1$ try{ - table.getCompilationUnit().lookupTemplateId( "B", args ); + table.getCompilationUnit().lookupTemplateId( "B", args ); //$NON-NLS-1$ assertTrue( false ); } catch ( ParserSymbolTableException e ){ assertEquals( e.reason, ParserSymbolTableException.r_BadTemplateArgument ); } - ISymbol c = table.newSymbol( "c", TypeInfo.t_int ); + ISymbol c = table.newSymbol( "c", TypeInfo.t_int ); //$NON-NLS-1$ table.getCompilationUnit().addSymbol( c ); args.clear(); args.add( new TypeInfo( TypeInfo.t_type, 0, c ) ); - ISymbol look = table.getCompilationUnit().lookupTemplateId( "B", args ); + ISymbol look = table.getCompilationUnit().lookupTemplateId( "B", args ); //$NON-NLS-1$ assertTrue( look.isTemplateInstance() ); assertEquals( look.getInstantiatedSymbol(), B ); } @@ -735,53 +735,53 @@ public class ParserSymbolTableTemplateTests extends TestCase { //TODO newTable(); - ITemplateSymbol templateA = table.newTemplateSymbol( "A" ); + ITemplateSymbol templateA = table.newTemplateSymbol( "A" ); //$NON-NLS-1$ table.getCompilationUnit().addSymbol( templateA ); - templateA.addTemplateParameter( table.newSymbol( "T", TypeInfo.t_templateParameter ) ); + templateA.addTemplateParameter( table.newSymbol( "T", TypeInfo.t_templateParameter ) ); //$NON-NLS-1$ - IDerivableContainerSymbol A1 = table.newDerivableContainerSymbol( "A", TypeInfo.t_class ); + IDerivableContainerSymbol A1 = table.newDerivableContainerSymbol( "A", TypeInfo.t_class ); //$NON-NLS-1$ templateA.addSymbol( A1 ); - ISymbol x1 = table.newSymbol( "x", TypeInfo.t_int ); + ISymbol x1 = table.newSymbol( "x", TypeInfo.t_int ); //$NON-NLS-1$ A1.addSymbol( x1 ); - ISpecializedSymbol specialization = table.newSpecializedSymbol( "A" ); + ISpecializedSymbol specialization = table.newSpecializedSymbol( "A" ); //$NON-NLS-1$ templateA.addSpecialization( specialization ); - ISymbol T = table.newSymbol( "T", TypeInfo.t_templateParameter ); + ISymbol T = table.newSymbol( "T", TypeInfo.t_templateParameter ); //$NON-NLS-1$ specialization.addTemplateParameter( T ); specialization.addArgument( new TypeInfo( TypeInfo.t_type, 0, T, new PtrOp( PtrOp.t_pointer ), false ) ); - IDerivableContainerSymbol A2 = table.newDerivableContainerSymbol( "A", TypeInfo.t_class ); + IDerivableContainerSymbol A2 = table.newDerivableContainerSymbol( "A", TypeInfo.t_class ); //$NON-NLS-1$ specialization.addSymbol( A2 ); - ISymbol x2 = table.newSymbol( "x", TypeInfo.t_int ); + ISymbol x2 = table.newSymbol( "x", TypeInfo.t_int ); //$NON-NLS-1$ x2.getTypeInfo().setBit( true, TypeInfo.isLong ); A2.addSymbol( x2 ); - ITemplateSymbol templateC = table.newTemplateSymbol( "C" ); + ITemplateSymbol templateC = table.newTemplateSymbol( "C" ); //$NON-NLS-1$ table.getCompilationUnit().addSymbol( templateC ); - ITemplateSymbol templateV = table.newTemplateSymbol( "V" ); + ITemplateSymbol templateV = table.newTemplateSymbol( "V" ); //$NON-NLS-1$ templateV.setType( TypeInfo.t_templateParameter ); templateV.getTypeInfo().setTemplateParameterType( TypeInfo.t_template ); - ISymbol U = table.newSymbol( "U", TypeInfo.t_templateParameter ); + ISymbol U = table.newSymbol( "U", TypeInfo.t_templateParameter ); //$NON-NLS-1$ templateV.addTemplateParameter( U ); templateC.addTemplateParameter( templateV ); - IDerivableContainerSymbol C = table.newDerivableContainerSymbol( "C", TypeInfo.t_class ); + IDerivableContainerSymbol C = table.newDerivableContainerSymbol( "C", TypeInfo.t_class ); //$NON-NLS-1$ templateC.addSymbol( C ); List args = new ArrayList(); args.add( new TypeInfo( TypeInfo.t_int, 0, null ) ); - ISymbol look = templateC.lookupTemplateId( "V", args ); + ISymbol look = templateC.lookupTemplateId( "V", args ); //$NON-NLS-1$ assertTrue( look != null ); assertTrue( look instanceof IDeferredTemplateInstance ); - ISymbol y = table.newSymbol( "y", TypeInfo.t_type ); + ISymbol y = table.newSymbol( "y", TypeInfo.t_type ); //$NON-NLS-1$ y.setTypeSymbol( look ); C.addSymbol( y ); @@ -789,25 +789,25 @@ public class ParserSymbolTableTemplateTests extends TestCase { args.clear(); args.add( new TypeInfo( TypeInfo.t_int, 0, null, new PtrOp( PtrOp.t_pointer ), false ) ); - look = templateC.lookupTemplateId( "V", args ); + look = templateC.lookupTemplateId( "V", args ); //$NON-NLS-1$ assertTrue( look != null ); assertTrue( look instanceof IDeferredTemplateInstance ); - ISymbol z = table.newSymbol( "z", TypeInfo.t_type ); + ISymbol z = table.newSymbol( "z", TypeInfo.t_type ); //$NON-NLS-1$ z.setTypeSymbol( look ); C.addSymbol( z ); - look = table.getCompilationUnit().lookup( "A" ); + look = table.getCompilationUnit().lookup( "A" ); //$NON-NLS-1$ assertEquals( look, templateA ); args.clear(); args.add ( new TypeInfo( TypeInfo.t_type, 0, look ) ); - look = table.getCompilationUnit().lookupTemplateId( "C", args ); + look = table.getCompilationUnit().lookupTemplateId( "C", args ); //$NON-NLS-1$ assertTrue( look.isTemplateInstance() ); assertEquals( look.getInstantiatedSymbol(), C ); IDerivableContainerSymbol lookC = (IDerivableContainerSymbol)look; - look = lookC.lookup( "y" ); + look = lookC.lookup( "y" ); //$NON-NLS-1$ assertEquals( look.getType(), TypeInfo.t_type ); ISymbol symbol = look.getTypeSymbol(); @@ -815,18 +815,18 @@ public class ParserSymbolTableTemplateTests extends TestCase { assertTrue( symbol.isTemplateInstance() ); assertEquals( symbol.getInstantiatedSymbol(), A1 ); - look = ((IContainerSymbol) symbol).lookup( "x" ); + look = ((IContainerSymbol) symbol).lookup( "x" ); //$NON-NLS-1$ assertEquals( look.getType(), TypeInfo.t_int ); assertEquals( look.getTypeInfo().checkBit( TypeInfo.isLong ), false ); - look = lookC.lookup( "z" ); + look = lookC.lookup( "z" ); //$NON-NLS-1$ assertEquals( look.getType(), TypeInfo.t_type ); symbol = look.getTypeSymbol(); assertTrue( symbol instanceof IContainerSymbol ); assertTrue( symbol.isTemplateInstance() ); assertEquals( symbol.getInstantiatedSymbol(), A2 ); - look = ((IContainerSymbol)symbol).lookup( "x" ); + look = ((IContainerSymbol)symbol).lookup( "x" ); //$NON-NLS-1$ assertEquals( look.getType(), TypeInfo.t_int ); assertEquals( look.getTypeInfo().checkBit( TypeInfo.isLong ), true ); @@ -849,8 +849,8 @@ public class ParserSymbolTableTemplateTests extends TestCase { newTable(); ITemplateSymbol template = table.newTemplateSymbol( ParserSymbolTable.EMPTY_NAME ); - ISymbol primaryT1 = table.newSymbol( "T1", TypeInfo.t_templateParameter ); - ISymbol primaryT2 = table.newSymbol( "T2", TypeInfo.t_templateParameter ); + ISymbol primaryT1 = table.newSymbol( "T1", TypeInfo.t_templateParameter ); //$NON-NLS-1$ + ISymbol primaryT2 = table.newSymbol( "T2", TypeInfo.t_templateParameter ); //$NON-NLS-1$ template.addTemplateParameter( primaryT1 ); template.addTemplateParameter( primaryT2 ); @@ -858,27 +858,27 @@ public class ParserSymbolTableTemplateTests extends TestCase { factory.setContainingSymbol( table.getCompilationUnit() ); factory.pushTemplate( template ); - IDerivableContainerSymbol A = table.newDerivableContainerSymbol( "A", TypeInfo.t_class ); + IDerivableContainerSymbol A = table.newDerivableContainerSymbol( "A", TypeInfo.t_class ); //$NON-NLS-1$ factory.addSymbol( A ); - IParameterizedSymbol f1 = table.newParameterizedSymbol( "f1", TypeInfo.t_function ); + IParameterizedSymbol f1 = table.newParameterizedSymbol( "f1", TypeInfo.t_function ); //$NON-NLS-1$ - ISymbol look = A.lookup( "T1" ); + ISymbol look = A.lookup( "T1" ); //$NON-NLS-1$ assertEquals( look, primaryT1 ); f1.setIsForwardDeclaration( true ); f1.setReturnType( look ); - IParameterizedSymbol f2 = table.newParameterizedSymbol( "f2", TypeInfo.t_function ); + IParameterizedSymbol f2 = table.newParameterizedSymbol( "f2", TypeInfo.t_function ); //$NON-NLS-1$ f2.setIsForwardDeclaration( true ); A.addSymbol( f1 ); A.addSymbol( f2 ); ITemplateSymbol temp = table.newTemplateSymbol( ParserSymbolTable.EMPTY_NAME ); - ISymbol U = table.newSymbol( "U", TypeInfo.t_templateParameter ); - ISymbol V = table.newSymbol( "V", TypeInfo.t_templateParameter ); + ISymbol U = table.newSymbol( "U", TypeInfo.t_templateParameter ); //$NON-NLS-1$ + ISymbol V = table.newSymbol( "V", TypeInfo.t_templateParameter ); //$NON-NLS-1$ temp.addTemplateParameter( U ); temp.addTemplateParameter( V ); @@ -886,22 +886,22 @@ public class ParserSymbolTableTemplateTests extends TestCase { factory.setContainingSymbol( table.getCompilationUnit() ); factory.pushTemplate( temp ); - ISymbol returnType = factory.lookup( "U" ); + ISymbol returnType = factory.lookup( "U" ); //$NON-NLS-1$ assertEquals( returnType, U ); List args = new ArrayList(); args.add( new TypeInfo( TypeInfo.t_type, 0, U ) ); args.add( new TypeInfo( TypeInfo.t_type, 0, V ) ); - look = factory.lookupTemplateIdForDefinition( "A", args ); + look = factory.lookupTemplateIdForDefinition( "A", args ); //$NON-NLS-1$ assertEquals( look, A ); factory.pushTemplateId( look, args ); - IParameterizedSymbol lookF = factory.lookupMethodForDefinition( "f1", new ArrayList() ); + IParameterizedSymbol lookF = factory.lookupMethodForDefinition( "f1", new ArrayList() ); //$NON-NLS-1$ assertEquals( lookF, f1 ); assertTrue( lookF.isForwardDeclaration() ); - IParameterizedSymbol defnd = table.newParameterizedSymbol( "f1", TypeInfo.t_function ); + IParameterizedSymbol defnd = table.newParameterizedSymbol( "f1", TypeInfo.t_function ); //$NON-NLS-1$ f1.setTypeSymbol( defnd ); defnd.setReturnType( returnType ); factory.addSymbol( defnd ); @@ -911,12 +911,12 @@ public class ParserSymbolTableTemplateTests extends TestCase { args.add( new TypeInfo( TypeInfo.t_int, 0, null ) ); args.add( new TypeInfo( TypeInfo.t_char, 0, null ) ); - IDerivableContainerSymbol lookA = (IDerivableContainerSymbol) table.getCompilationUnit().lookupTemplateId( "A", args ); + IDerivableContainerSymbol lookA = (IDerivableContainerSymbol) table.getCompilationUnit().lookupTemplateId( "A", args ); //$NON-NLS-1$ assertTrue( lookA.isTemplateInstance() ); assertEquals( lookA.getInstantiatedSymbol(), A ); List params = new ArrayList(); - look = lookA.qualifiedFunctionLookup( "f1", params ); + look = lookA.qualifiedFunctionLookup( "f1", params ); //$NON-NLS-1$ assertTrue( look.isTemplateInstance() ); assertEquals( look.getInstantiatedSymbol(), defnd ); assertTrue( ((IParameterizedSymbol)look).getReturnType().isType( TypeInfo.t_int ) ); @@ -925,8 +925,8 @@ public class ParserSymbolTableTemplateTests extends TestCase { args.clear(); temp = table.newTemplateSymbol( ParserSymbolTable.EMPTY_NAME ); - ISymbol X = table.newSymbol( "X", TypeInfo.t_templateParameter ); - ISymbol Y = table.newSymbol( "Y", TypeInfo.t_templateParameter ); + ISymbol X = table.newSymbol( "X", TypeInfo.t_templateParameter ); //$NON-NLS-1$ + ISymbol Y = table.newSymbol( "Y", TypeInfo.t_templateParameter ); //$NON-NLS-1$ temp.addTemplateParameter( X ); temp.addTemplateParameter( Y ); @@ -938,7 +938,7 @@ public class ParserSymbolTableTemplateTests extends TestCase { args.add( new TypeInfo( TypeInfo.t_type, 0, X ) ); try{ - look = factory.lookupTemplateIdForDefinition( "A", args ); + look = factory.lookupTemplateIdForDefinition( "A", args ); //$NON-NLS-1$ assertTrue( false ); } catch ( ParserSymbolTableException e ){ assertEquals( e.reason, ParserSymbolTableException.r_BadTemplate ); @@ -957,23 +957,23 @@ public class ParserSymbolTableTemplateTests extends TestCase { public void test_14_5_1_2_MemberClass() throws Exception{ newTable(); - ITemplateSymbol template = table.newTemplateSymbol( "A" ); - ISymbol primaryT = table.newSymbol( "T", TypeInfo.t_templateParameter ); + ITemplateSymbol template = table.newTemplateSymbol( "A" ); //$NON-NLS-1$ + ISymbol primaryT = table.newSymbol( "T", TypeInfo.t_templateParameter ); //$NON-NLS-1$ template.addTemplateParameter( primaryT ); ITemplateFactory factory = table.newTemplateFactory(); factory.setContainingSymbol( table.getCompilationUnit() ); factory.pushTemplate( template ); - IDerivableContainerSymbol A = table.newDerivableContainerSymbol( "A", TypeInfo.t_struct ); + IDerivableContainerSymbol A = table.newDerivableContainerSymbol( "A", TypeInfo.t_struct ); //$NON-NLS-1$ factory.addSymbol( A ); - IDerivableContainerSymbol B = table.newDerivableContainerSymbol( "B", TypeInfo.t_class ); + IDerivableContainerSymbol B = table.newDerivableContainerSymbol( "B", TypeInfo.t_class ); //$NON-NLS-1$ B.setIsForwardDeclaration( true ); A.addSymbol( B ); - ISymbol U = table.newSymbol( "U", TypeInfo.t_templateParameter ); - ITemplateSymbol temp = table.newTemplateSymbol( "" ); + ISymbol U = table.newSymbol( "U", TypeInfo.t_templateParameter ); //$NON-NLS-1$ + ITemplateSymbol temp = table.newTemplateSymbol( "" ); //$NON-NLS-1$ temp.addTemplateParameter( U ); factory = table.newTemplateFactory(); @@ -983,20 +983,20 @@ public class ParserSymbolTableTemplateTests extends TestCase { List args = new ArrayList(); args.add( new TypeInfo( TypeInfo.t_type, 0, U ) ); - IContainerSymbol lookA = factory.lookupTemplateIdForDefinition( "A", args ); + IContainerSymbol lookA = factory.lookupTemplateIdForDefinition( "A", args ); //$NON-NLS-1$ assertEquals( lookA, A ); factory.pushTemplateId( lookA, args ); - ISymbol look = lookA.lookupMemberForDefinition( "B" ); + ISymbol look = lookA.lookupMemberForDefinition( "B" ); //$NON-NLS-1$ assertEquals( look, B ); - IDerivableContainerSymbol newB = table.newDerivableContainerSymbol( "B", TypeInfo.t_class ); + IDerivableContainerSymbol newB = table.newDerivableContainerSymbol( "B", TypeInfo.t_class ); //$NON-NLS-1$ look.setTypeSymbol( newB ); factory.addSymbol( newB ); - ISymbol i = table.newSymbol( "i", TypeInfo.t_type ); - look = newB.lookup( "U" ); + ISymbol i = table.newSymbol( "i", TypeInfo.t_type ); //$NON-NLS-1$ + look = newB.lookup( "U" ); //$NON-NLS-1$ assertEquals( look, U ); i.setTypeSymbol( U ); newB.addSymbol( i ); @@ -1004,18 +1004,18 @@ public class ParserSymbolTableTemplateTests extends TestCase { args.clear(); args.add( new TypeInfo( TypeInfo.t_int, 0, null ) ); - look = table.getCompilationUnit().lookupTemplateId( "A", args ); + look = table.getCompilationUnit().lookupTemplateId( "A", args ); //$NON-NLS-1$ assertTrue( look.isTemplateInstance() ); assertEquals( look.getInstantiatedSymbol(), A ); assertTrue( look instanceof IDerivableContainerSymbol ); lookA = (IDerivableContainerSymbol) look; - look = lookA.qualifiedLookup( "B" ); + look = lookA.qualifiedLookup( "B" ); //$NON-NLS-1$ assertTrue( look.isTemplateInstance() ); assertEquals( look.getInstantiatedSymbol(), newB ); - look = ((IDerivableContainerSymbol) look).lookup( "i" ); + look = ((IDerivableContainerSymbol) look).lookup( "i" ); //$NON-NLS-1$ assertTrue( look.isTemplateInstance() ); assertEquals( look.getInstantiatedSymbol(), i ); assertEquals( look.getType(), TypeInfo.t_int ); @@ -1033,28 +1033,28 @@ public class ParserSymbolTableTemplateTests extends TestCase { public void test_14_5_1_3_StaticDataMember() throws Exception{ newTable(); - ITemplateSymbol template = table.newTemplateSymbol( "X" ); - ISymbol T = table.newSymbol( "T", TypeInfo.t_templateParameter ); + ITemplateSymbol template = table.newTemplateSymbol( "X" ); //$NON-NLS-1$ + ISymbol T = table.newSymbol( "T", TypeInfo.t_templateParameter ); //$NON-NLS-1$ template.addTemplateParameter( T ); ITemplateFactory factory = table.newTemplateFactory(); factory.setContainingSymbol( table.getCompilationUnit() ); factory.pushTemplate( template ); - IDerivableContainerSymbol X = table.newDerivableContainerSymbol( "X", TypeInfo.t_class ); + IDerivableContainerSymbol X = table.newDerivableContainerSymbol( "X", TypeInfo.t_class ); //$NON-NLS-1$ factory.addSymbol( X ); - ISymbol look = X.lookup( "T" ); + ISymbol look = X.lookup( "T" ); //$NON-NLS-1$ assertEquals( look, T ); - ISymbol s = table.newSymbol( "s", TypeInfo.t_type ); + ISymbol s = table.newSymbol( "s", TypeInfo.t_type ); //$NON-NLS-1$ s.setTypeSymbol( look ); s.getTypeInfo().setBit( true, TypeInfo.isStatic ); s.setIsForwardDeclaration( true ); X.addSymbol( s ); - ITemplateSymbol temp = table.newTemplateSymbol( "" ); - ISymbol paramU = table.newSymbol( "U", TypeInfo.t_templateParameter ); + ITemplateSymbol temp = table.newTemplateSymbol( "" ); //$NON-NLS-1$ + ISymbol paramU = table.newSymbol( "U", TypeInfo.t_templateParameter ); //$NON-NLS-1$ temp.addTemplateParameter( paramU ); factory = table.newTemplateFactory(); @@ -1064,15 +1064,15 @@ public class ParserSymbolTableTemplateTests extends TestCase { List args = new ArrayList(); args.add( new TypeInfo( TypeInfo.t_type, 0, paramU ) ); - look = factory.lookupTemplateIdForDefinition( "X", args ); + look = factory.lookupTemplateIdForDefinition( "X", args ); //$NON-NLS-1$ assertEquals( look, X ); factory.pushTemplateId( X, args ); - look = ((IContainerSymbol)look).lookupMemberForDefinition("s" ); + look = ((IContainerSymbol)look).lookupMemberForDefinition("s" ); //$NON-NLS-1$ assertEquals( look, s ); assertTrue( look.isForwardDeclaration() ); - ISymbol newS = table.newSymbol( "s", TypeInfo.t_type ); + ISymbol newS = table.newSymbol( "s", TypeInfo.t_type ); //$NON-NLS-1$ newS.setTypeSymbol( paramU ); look.setTypeSymbol( newS ); @@ -1082,12 +1082,12 @@ public class ParserSymbolTableTemplateTests extends TestCase { args.clear(); args.add( new TypeInfo( TypeInfo.t_float, 0, null ) ); - look = table.getCompilationUnit().lookupTemplateId( "X", args ); + look = table.getCompilationUnit().lookupTemplateId( "X", args ); //$NON-NLS-1$ assertTrue( look.isTemplateInstance() ); assertEquals( look.getInstantiatedSymbol(), X ); - look = ((IContainerSymbol)look).qualifiedLookup( "s" ); + look = ((IContainerSymbol)look).qualifiedLookup( "s" ); //$NON-NLS-1$ assertTrue( look.isType( TypeInfo.t_float ) ); assertTrue( look.isTemplateInstance() ); @@ -1108,74 +1108,74 @@ public class ParserSymbolTableTemplateTests extends TestCase { public void test_14_5_2__1_MemberTemplates() throws Exception{ newTable(); - ITemplateSymbol template1 = table.newTemplateSymbol( "string" ); - template1.addTemplateParameter( table.newSymbol( "T", TypeInfo.t_templateParameter ) ); + ITemplateSymbol template1 = table.newTemplateSymbol( "string" ); //$NON-NLS-1$ + template1.addTemplateParameter( table.newSymbol( "T", TypeInfo.t_templateParameter ) ); //$NON-NLS-1$ ITemplateFactory factory = table.newTemplateFactory(); factory.setContainingSymbol( table.getCompilationUnit() ); factory.pushTemplate( template1 ); - IDerivableContainerSymbol string = table.newDerivableContainerSymbol( "string", TypeInfo.t_class ); + IDerivableContainerSymbol string = table.newDerivableContainerSymbol( "string", TypeInfo.t_class ); //$NON-NLS-1$ factory.addSymbol( string ); - ITemplateSymbol template2 = table.newTemplateSymbol( "compare" ); - ISymbol T2 = table.newSymbol( "T2", TypeInfo.t_templateParameter ); + ITemplateSymbol template2 = table.newTemplateSymbol( "compare" ); //$NON-NLS-1$ + ISymbol T2 = table.newSymbol( "T2", TypeInfo.t_templateParameter ); //$NON-NLS-1$ template2.addTemplateParameter( T2 ); factory = table.newTemplateFactory(); factory.setContainingSymbol( string ); factory.pushTemplate( template2 ); - IParameterizedSymbol compare = table.newParameterizedSymbol( "compare", TypeInfo.t_function ); + IParameterizedSymbol compare = table.newParameterizedSymbol( "compare", TypeInfo.t_function ); //$NON-NLS-1$ compare.setIsForwardDeclaration( true ); compare.addParameter( T2, 0, new PtrOp( PtrOp.t_reference, true, false ), false ); - ISymbol returnType = table.newSymbol( "", TypeInfo.t_type ); + ISymbol returnType = table.newSymbol( "", TypeInfo.t_type ); //$NON-NLS-1$ returnType.setTypeSymbol( T2 ); compare.setReturnType( returnType ); factory.addSymbol( compare ); - ITemplateSymbol temp = table.newTemplateSymbol( "" ); - ISymbol U = table.newSymbol( "U", TypeInfo.t_templateParameter ); + ITemplateSymbol temp = table.newTemplateSymbol( "" ); //$NON-NLS-1$ + ISymbol U = table.newSymbol( "U", TypeInfo.t_templateParameter ); //$NON-NLS-1$ temp.addTemplateParameter( U ); factory = table.newTemplateFactory(); factory.setContainingSymbol( table.getCompilationUnit() ); factory.pushTemplate( temp ); - ITemplateSymbol temp2 = table.newTemplateSymbol( "" ); - ISymbol V = table.newSymbol( "V", TypeInfo.t_templateParameter ); + ITemplateSymbol temp2 = table.newTemplateSymbol( "" ); //$NON-NLS-1$ + ISymbol V = table.newSymbol( "V", TypeInfo.t_templateParameter ); //$NON-NLS-1$ temp2.addTemplateParameter( V ); factory.pushTemplate( temp2 ); - ISymbol lookV = factory.lookup( "V" ); + ISymbol lookV = factory.lookup( "V" ); //$NON-NLS-1$ assertEquals( lookV, V ); List args = new ArrayList(); args.add( new TypeInfo( TypeInfo.t_type, 0, U ) ); - ISymbol look = factory.lookupTemplateIdForDefinition( "string", args ); + ISymbol look = factory.lookupTemplateIdForDefinition( "string", args ); //$NON-NLS-1$ assertEquals( look, string ); factory.pushTemplateId( look, args ); args.clear(); args.add( new TypeInfo( TypeInfo.t_type, 0, lookV, new PtrOp( PtrOp.t_reference, true, false ), false ) ); - look = ((IContainerSymbol)look).lookupMethodForDefinition( "compare", args ); + look = ((IContainerSymbol)look).lookupMethodForDefinition( "compare", args ); //$NON-NLS-1$ assertEquals( look, compare ); - IParameterizedSymbol compareDef = table.newParameterizedSymbol( "compare", TypeInfo.t_function ); + IParameterizedSymbol compareDef = table.newParameterizedSymbol( "compare", TypeInfo.t_function ); //$NON-NLS-1$ compareDef.addParameter( lookV, 0, new PtrOp( PtrOp.t_reference, true, false ), false ); - ISymbol defReturn = table.newSymbol( "", TypeInfo.t_type ); + ISymbol defReturn = table.newSymbol( "", TypeInfo.t_type ); //$NON-NLS-1$ defReturn.setTypeSymbol( lookV ); compareDef.setReturnType( defReturn ); compare.setTypeSymbol( compareDef ); factory.addSymbol( compareDef ); - look = compareDef.lookup( "U" ); + look = compareDef.lookup( "U" ); //$NON-NLS-1$ assertEquals( look, U ); - ISymbol u = table.newSymbol( "u", TypeInfo.t_type ); + ISymbol u = table.newSymbol( "u", TypeInfo.t_type ); //$NON-NLS-1$ u.setTypeSymbol( look ); compareDef.addSymbol( u ); @@ -1183,18 +1183,18 @@ public class ParserSymbolTableTemplateTests extends TestCase { args.clear(); args.add( new TypeInfo( TypeInfo.t_int, 0, null ) ); - look = table.getCompilationUnit().lookupTemplateId( "string", args ); + look = table.getCompilationUnit().lookupTemplateId( "string", args ); //$NON-NLS-1$ assertTrue( look.isTemplateInstance() ); assertEquals( look.getInstantiatedSymbol(), string ); - look = ((IDerivableContainerSymbol)look).lookupTemplateId( "compare", args ); + look = ((IDerivableContainerSymbol)look).lookupTemplateId( "compare", args ); //$NON-NLS-1$ assertTrue( look.isTemplateInstance() ); assertTrue( look.getInstantiatedSymbol().isTemplateInstance() ); assertEquals( look.getInstantiatedSymbol().getInstantiatedSymbol(), compareDef ); assertTrue( ((IParameterizedSymbol)look).getReturnType().isType( TypeInfo.t_int ) ); - look = ((IContainerSymbol)look).lookup( "u" ); + look = ((IContainerSymbol)look).lookup( "u" ); //$NON-NLS-1$ assertTrue( look.isTemplateInstance() ); assertTrue( look.getInstantiatedSymbol().isTemplateInstance() ); assertEquals( look.getInstantiatedSymbol().getInstantiatedSymbol(), u ); @@ -1213,25 +1213,25 @@ public class ParserSymbolTableTemplateTests extends TestCase { public void test_14_5_2__3_VirtualMemberFunctionTemplate() throws Exception{ newTable(); - ITemplateSymbol template = table.newTemplateSymbol( "A" ); - template.addTemplateParameter( table.newSymbol( "T", TypeInfo.t_templateParameter ) ); + ITemplateSymbol template = table.newTemplateSymbol( "A" ); //$NON-NLS-1$ + template.addTemplateParameter( table.newSymbol( "T", TypeInfo.t_templateParameter ) ); //$NON-NLS-1$ ITemplateFactory factory = table.newTemplateFactory(); factory.setContainingSymbol( table.getCompilationUnit() ); factory.pushTemplate( template ); - IDerivableContainerSymbol A = table.newDerivableContainerSymbol( "A", TypeInfo.t_struct ); + IDerivableContainerSymbol A = table.newDerivableContainerSymbol( "A", TypeInfo.t_struct ); //$NON-NLS-1$ factory.addSymbol( A ); - ITemplateSymbol memberTemplate = table.newTemplateSymbol( "g" ); - ISymbol C = table.newSymbol( "C", TypeInfo.t_templateParameter ); + ITemplateSymbol memberTemplate = table.newTemplateSymbol( "g" ); //$NON-NLS-1$ + ISymbol C = table.newSymbol( "C", TypeInfo.t_templateParameter ); //$NON-NLS-1$ memberTemplate.addTemplateParameter( C ); factory = table.newTemplateFactory(); factory.setContainingSymbol( A ); factory.pushTemplate( memberTemplate ); - IParameterizedSymbol g = table.newParameterizedSymbol( "g", TypeInfo.t_function ); + IParameterizedSymbol g = table.newParameterizedSymbol( "g", TypeInfo.t_function ); //$NON-NLS-1$ g.addParameter( C, 0, null, false ); g.getTypeInfo().setBit( true, TypeInfo.isVirtual ); @@ -1242,7 +1242,7 @@ public class ParserSymbolTableTemplateTests extends TestCase { assertEquals( e.reason, ParserSymbolTableException.r_BadTemplate ); } - IParameterizedSymbol f = table.newParameterizedSymbol( "f", TypeInfo.t_function ); + IParameterizedSymbol f = table.newParameterizedSymbol( "f", TypeInfo.t_function ); //$NON-NLS-1$ f.getTypeInfo().setBit( true, TypeInfo.isVirtual ); A.addSymbol( f ); @@ -1273,30 +1273,30 @@ public class ParserSymbolTableTemplateTests extends TestCase { //TODO newTable(); - IContainerSymbol N = table.newContainerSymbol( "N", TypeInfo.t_namespace ); + IContainerSymbol N = table.newContainerSymbol( "N", TypeInfo.t_namespace ); //$NON-NLS-1$ table.getCompilationUnit().addSymbol( N ); - ITemplateSymbol template = table.newTemplateSymbol( "A" ); + ITemplateSymbol template = table.newTemplateSymbol( "A" ); //$NON-NLS-1$ - template.addTemplateParameter( table.newSymbol( "T1", TypeInfo.t_templateParameter ) ); - template.addTemplateParameter( table.newSymbol( "T2", TypeInfo.t_templateParameter ) ); + template.addTemplateParameter( table.newSymbol( "T1", TypeInfo.t_templateParameter ) ); //$NON-NLS-1$ + template.addTemplateParameter( table.newSymbol( "T2", TypeInfo.t_templateParameter ) ); //$NON-NLS-1$ - IDerivableContainerSymbol A1 = table.newDerivableContainerSymbol( "A", TypeInfo.t_class ); + IDerivableContainerSymbol A1 = table.newDerivableContainerSymbol( "A", TypeInfo.t_class ); //$NON-NLS-1$ template.addSymbol( A1 ); N.addSymbol( template ); - table.getCompilationUnit().addUsingDeclaration( "A", N ); + table.getCompilationUnit().addUsingDeclaration( "A", N ); //$NON-NLS-1$ - ISpecializedSymbol spec = table.newSpecializedSymbol( "A" ); - ISymbol T = table.newSymbol( "T", TypeInfo.t_templateParameter ); + ISpecializedSymbol spec = table.newSpecializedSymbol( "A" ); //$NON-NLS-1$ + ISymbol T = table.newSymbol( "T", TypeInfo.t_templateParameter ); //$NON-NLS-1$ spec.addTemplateParameter( T ); spec.addArgument( new TypeInfo( TypeInfo.t_type, 0, T ) ); spec.addArgument( new TypeInfo( TypeInfo.t_type, 0, T, new PtrOp( PtrOp.t_pointer ), false ) ); - IDerivableContainerSymbol A2 = table.newDerivableContainerSymbol( "A", TypeInfo.t_class ); + IDerivableContainerSymbol A2 = table.newDerivableContainerSymbol( "A", TypeInfo.t_class ); //$NON-NLS-1$ spec.addSymbol( A2 ); template.addSpecialization( spec ); @@ -1304,7 +1304,7 @@ public class ParserSymbolTableTemplateTests extends TestCase { args.add( new TypeInfo( TypeInfo.t_int, 0, null ) ); args.add( new TypeInfo( TypeInfo.t_int, 0, null, new PtrOp( PtrOp.t_pointer ), false ) ); - ISymbol look = table.getCompilationUnit().lookupTemplateId( "A", args ); + ISymbol look = table.getCompilationUnit().lookupTemplateId( "A", args ); //$NON-NLS-1$ assertTrue( look != null ); assertTrue( look.isTemplateInstance() ); assertEquals( look.getInstantiatedSymbol(), A2 ); @@ -1330,16 +1330,16 @@ public class ParserSymbolTableTemplateTests extends TestCase { //TODO newTable(); - IDerivableContainerSymbol cls1 = table.newDerivableContainerSymbol( "A", TypeInfo.t_class ); - IDerivableContainerSymbol cls2 = table.newDerivableContainerSymbol( "A", TypeInfo.t_class ); - IDerivableContainerSymbol cls3 = table.newDerivableContainerSymbol( "A", TypeInfo.t_class ); - IDerivableContainerSymbol cls4 = table.newDerivableContainerSymbol( "A", TypeInfo.t_class ); - IDerivableContainerSymbol cls5 = table.newDerivableContainerSymbol( "A", TypeInfo.t_class ); + IDerivableContainerSymbol cls1 = table.newDerivableContainerSymbol( "A", TypeInfo.t_class ); //$NON-NLS-1$ + IDerivableContainerSymbol cls2 = table.newDerivableContainerSymbol( "A", TypeInfo.t_class ); //$NON-NLS-1$ + IDerivableContainerSymbol cls3 = table.newDerivableContainerSymbol( "A", TypeInfo.t_class ); //$NON-NLS-1$ + IDerivableContainerSymbol cls4 = table.newDerivableContainerSymbol( "A", TypeInfo.t_class ); //$NON-NLS-1$ + IDerivableContainerSymbol cls5 = table.newDerivableContainerSymbol( "A", TypeInfo.t_class ); //$NON-NLS-1$ - ITemplateSymbol template1 = table.newTemplateSymbol( "A" ); - ISymbol T1p1 = table.newSymbol( "T1", TypeInfo.t_templateParameter ); - ISymbol T1p2 = table.newSymbol( "T2", TypeInfo.t_templateParameter ); - ISymbol T1p3 = table.newSymbol( "I", TypeInfo.t_templateParameter ); + ITemplateSymbol template1 = table.newTemplateSymbol( "A" ); //$NON-NLS-1$ + ISymbol T1p1 = table.newSymbol( "T1", TypeInfo.t_templateParameter ); //$NON-NLS-1$ + ISymbol T1p2 = table.newSymbol( "T2", TypeInfo.t_templateParameter ); //$NON-NLS-1$ + ISymbol T1p3 = table.newSymbol( "I", TypeInfo.t_templateParameter ); //$NON-NLS-1$ T1p3.getTypeInfo().setTemplateParameterType( TypeInfo.t_int ); template1.addTemplateParameter( T1p1 ); @@ -1348,9 +1348,9 @@ public class ParserSymbolTableTemplateTests extends TestCase { template1.addSymbol( cls1 ); table.getCompilationUnit().addSymbol( template1 ); - ISpecializedSymbol template2 = table.newSpecializedSymbol( "A" ); - ISymbol T2p1 = table.newSymbol( "T", TypeInfo.t_templateParameter ); - ISymbol T2p2 = table.newSymbol( "I", TypeInfo.t_templateParameter ); + ISpecializedSymbol template2 = table.newSpecializedSymbol( "A" ); //$NON-NLS-1$ + ISymbol T2p1 = table.newSymbol( "T", TypeInfo.t_templateParameter ); //$NON-NLS-1$ + ISymbol T2p2 = table.newSymbol( "I", TypeInfo.t_templateParameter ); //$NON-NLS-1$ T2p2.getTypeInfo().setTemplateParameterType( TypeInfo.t_int ); template2.addTemplateParameter( T2p1 ); @@ -1366,10 +1366,10 @@ public class ParserSymbolTableTemplateTests extends TestCase { template2.addSymbol( cls2 ); template1.addSpecialization( template2 ); - ISpecializedSymbol template3 = table.newSpecializedSymbol( "A" ); - ISymbol T3p1 = table.newSymbol( "T1", TypeInfo.t_templateParameter ); - ISymbol T3p2 = table.newSymbol( "T2", TypeInfo.t_templateParameter ); - ISymbol T3p3 = table.newSymbol( "I", TypeInfo.t_templateParameter ); + ISpecializedSymbol template3 = table.newSpecializedSymbol( "A" ); //$NON-NLS-1$ + ISymbol T3p1 = table.newSymbol( "T1", TypeInfo.t_templateParameter ); //$NON-NLS-1$ + ISymbol T3p2 = table.newSymbol( "T2", TypeInfo.t_templateParameter ); //$NON-NLS-1$ + ISymbol T3p3 = table.newSymbol( "I", TypeInfo.t_templateParameter ); //$NON-NLS-1$ T3p3.getTypeInfo().setTemplateParameterType( TypeInfo.t_int ); template3.addTemplateParameter( T3p1 ); @@ -1386,13 +1386,13 @@ public class ParserSymbolTableTemplateTests extends TestCase { template3.addSymbol( cls3 ); template1.addSpecialization( template3 ); - ISpecializedSymbol template4 = table.newSpecializedSymbol( "A" ); - ISymbol T4p1 = table.newSymbol( "T", TypeInfo.t_templateParameter ); + ISpecializedSymbol template4 = table.newSpecializedSymbol( "A" ); //$NON-NLS-1$ + ISymbol T4p1 = table.newSymbol( "T", TypeInfo.t_templateParameter ); //$NON-NLS-1$ template4.addTemplateParameter( T4p1 ); TypeInfo T4a1 = new TypeInfo( TypeInfo.t_int, 0, null ); TypeInfo T4a2 = new TypeInfo( TypeInfo.t_type, 0, T4p1, new PtrOp( PtrOp.t_pointer ), false ); - TypeInfo T4a3 = new TypeInfo( TypeInfo.t_int, 0, null, null, "5" ); + TypeInfo T4a3 = new TypeInfo( TypeInfo.t_int, 0, null, null, "5" ); //$NON-NLS-1$ //T4a3.setDefault( new Integer(5) ); template4.addArgument( T4a1 ); @@ -1401,10 +1401,10 @@ public class ParserSymbolTableTemplateTests extends TestCase { template4.addSymbol( cls4 ); template1.addSpecialization( template4 ); - ISpecializedSymbol template5 = table.newSpecializedSymbol( "A" ); - ISymbol T5p1 = table.newSymbol( "T1", TypeInfo.t_templateParameter ); - ISymbol T5p2 = table.newSymbol( "T2", TypeInfo.t_templateParameter ); - ISymbol T5p3 = table.newSymbol( "I", TypeInfo.t_templateParameter ); + ISpecializedSymbol template5 = table.newSpecializedSymbol( "A" ); //$NON-NLS-1$ + ISymbol T5p1 = table.newSymbol( "T1", TypeInfo.t_templateParameter ); //$NON-NLS-1$ + ISymbol T5p2 = table.newSymbol( "T2", TypeInfo.t_templateParameter ); //$NON-NLS-1$ + ISymbol T5p3 = table.newSymbol( "I", TypeInfo.t_templateParameter ); //$NON-NLS-1$ T5p3.getTypeInfo().setTemplateParameterType( TypeInfo.t_int ); template5.addTemplateParameter( T5p1 ); @@ -1421,7 +1421,7 @@ public class ParserSymbolTableTemplateTests extends TestCase { template5.addSymbol( cls5 ); template1.addSpecialization( template5 ); - ITemplateSymbol a = (ITemplateSymbol) table.getCompilationUnit().lookup( "A" ); + ITemplateSymbol a = (ITemplateSymbol) table.getCompilationUnit().lookup( "A" ); //$NON-NLS-1$ assertEquals( a, template1 ); ArrayList args = new ArrayList(); @@ -1437,7 +1437,7 @@ public class ParserSymbolTableTemplateTests extends TestCase { args.clear(); args.add( new TypeInfo( TypeInfo.t_int, 0, null ) ); args.add( new TypeInfo( TypeInfo.t_int, 0, null, new PtrOp( PtrOp.t_pointer ), false ) ); - args.add( new TypeInfo( TypeInfo.t_int, 0, null, null, "1" ) ); + args.add( new TypeInfo( TypeInfo.t_int, 0, null, null, "1" ) ); //$NON-NLS-1$ IContainerSymbol a2 = (IContainerSymbol) a.instantiate( args ); assertTrue( a2.isTemplateInstance() ); @@ -1446,7 +1446,7 @@ public class ParserSymbolTableTemplateTests extends TestCase { args.clear(); args.add( new TypeInfo( TypeInfo.t_int, 0, null ) ); args.add( new TypeInfo( TypeInfo.t_char, 0, null, new PtrOp( PtrOp.t_pointer ), false ) ); - args.add( new TypeInfo( TypeInfo.t_int, 0, null, null, "5" ) ); + args.add( new TypeInfo( TypeInfo.t_int, 0, null, null, "5" ) ); //$NON-NLS-1$ IContainerSymbol a3 = (IContainerSymbol) a.instantiate( args ); assertTrue( a3.isTemplateInstance() ); assertEquals( a3.getInstantiatedSymbol(), cls4 ); @@ -1454,7 +1454,7 @@ public class ParserSymbolTableTemplateTests extends TestCase { args.clear(); args.add( new TypeInfo( TypeInfo.t_int, 0, null ) ); args.add( new TypeInfo( TypeInfo.t_char, 0, null, new PtrOp( PtrOp.t_pointer ), false ) ); - args.add( new TypeInfo( TypeInfo.t_int, 0, null, null, "1" ) ); + args.add( new TypeInfo( TypeInfo.t_int, 0, null, null, "1" ) ); //$NON-NLS-1$ IContainerSymbol a4 = (IContainerSymbol) a.instantiate( args ); assertTrue( a4.isTemplateInstance() ); assertEquals( a4.getInstantiatedSymbol(), cls5 ); @@ -1462,7 +1462,7 @@ public class ParserSymbolTableTemplateTests extends TestCase { args.clear(); args.add( new TypeInfo( TypeInfo.t_int, 0, null, new PtrOp( PtrOp.t_pointer ), false ) ); args.add( new TypeInfo( TypeInfo.t_int, 0, null, new PtrOp( PtrOp.t_pointer ), false ) ); - args.add( new TypeInfo( TypeInfo.t_int, 0, null, null, "2" ) ); + args.add( new TypeInfo( TypeInfo.t_int, 0, null, null, "2" ) ); //$NON-NLS-1$ try{ a.instantiate( args ); @@ -1486,43 +1486,43 @@ public class ParserSymbolTableTemplateTests extends TestCase { public void test_14_5_5_2__5_OrderingFunctionTemplates_1() throws Exception{ newTable(); - ITemplateSymbol template1 = table.newTemplateSymbol( "f" ); - template1.addTemplateParameter( table.newSymbol( "T", TypeInfo.t_templateParameter ) ); + ITemplateSymbol template1 = table.newTemplateSymbol( "f" ); //$NON-NLS-1$ + template1.addTemplateParameter( table.newSymbol( "T", TypeInfo.t_templateParameter ) ); //$NON-NLS-1$ ITemplateFactory factory = table.newTemplateFactory(); factory.setContainingSymbol( table.getCompilationUnit() ); factory.pushTemplate( template1 ); - ISymbol T = template1.lookup( "T" ); - IParameterizedSymbol f1 = table.newParameterizedSymbol( "f", TypeInfo.t_function ); + ISymbol T = template1.lookup( "T" ); //$NON-NLS-1$ + IParameterizedSymbol f1 = table.newParameterizedSymbol( "f", TypeInfo.t_function ); //$NON-NLS-1$ f1.addParameter( T, 0, null, false ); factory.addSymbol( f1 ); - ITemplateSymbol template2 = table.newTemplateSymbol( "f" ); - template2.addTemplateParameter( table.newSymbol( "T", TypeInfo.t_templateParameter ) ); + ITemplateSymbol template2 = table.newTemplateSymbol( "f" ); //$NON-NLS-1$ + template2.addTemplateParameter( table.newSymbol( "T", TypeInfo.t_templateParameter ) ); //$NON-NLS-1$ factory = table.newTemplateFactory(); factory.setContainingSymbol( table.getCompilationUnit() ); factory.pushTemplate( template2 ); - T = template2.lookup( "T" ); - IParameterizedSymbol f2 = table.newParameterizedSymbol( "f", TypeInfo.t_function ); + T = template2.lookup( "T" ); //$NON-NLS-1$ + IParameterizedSymbol f2 = table.newParameterizedSymbol( "f", TypeInfo.t_function ); //$NON-NLS-1$ f2.addParameter( T, 0, new PtrOp( PtrOp.t_pointer ), false ); factory.addSymbol( f2 ); - ITemplateSymbol template3 = table.newTemplateSymbol( "f" ); - template3.addTemplateParameter( table.newSymbol( "T", TypeInfo.t_templateParameter ) ); + ITemplateSymbol template3 = table.newTemplateSymbol( "f" ); //$NON-NLS-1$ + template3.addTemplateParameter( table.newSymbol( "T", TypeInfo.t_templateParameter ) ); //$NON-NLS-1$ factory = table.newTemplateFactory(); factory.setContainingSymbol( table.getCompilationUnit() ); factory.pushTemplate( template3 ); - T = template3.lookup( "T" ); - IParameterizedSymbol f3 = table.newParameterizedSymbol( "f", TypeInfo.t_function ); + T = template3.lookup( "T" ); //$NON-NLS-1$ + IParameterizedSymbol f3 = table.newParameterizedSymbol( "f", TypeInfo.t_function ); //$NON-NLS-1$ f3.addParameter( T, TypeInfo.isConst, new PtrOp( PtrOp.t_pointer, false, false ), false ); factory.addSymbol( f3 ); - ISymbol p = table.newSymbol( "p", TypeInfo.t_int ); + ISymbol p = table.newSymbol( "p", TypeInfo.t_int ); //$NON-NLS-1$ p.getTypeInfo().setBit( true, TypeInfo.isConst ); p.addPtrOperator( new PtrOp( PtrOp.t_pointer, false, false ) ); table.getCompilationUnit().addSymbol( p ); @@ -1530,7 +1530,7 @@ public class ParserSymbolTableTemplateTests extends TestCase { List params = new ArrayList(); params.add( new TypeInfo( TypeInfo.t_type, 0, p ) ); - ISymbol look = table.getCompilationUnit().unqualifiedFunctionLookup( "f", params ); + ISymbol look = table.getCompilationUnit().unqualifiedFunctionLookup( "f", params ); //$NON-NLS-1$ assertTrue( look.isTemplateInstance() ); assertEquals( look.getInstantiatedSymbol(), f3 ); } @@ -1547,35 +1547,35 @@ public class ParserSymbolTableTemplateTests extends TestCase { public void test_14_5_5_2__5_OrderingFunctionTemplates_2() throws Exception{ newTable(); - ITemplateSymbol template1 = table.newTemplateSymbol( "g" ); - template1.addTemplateParameter( table.newSymbol( "T", TypeInfo.t_templateParameter ) ); + ITemplateSymbol template1 = table.newTemplateSymbol( "g" ); //$NON-NLS-1$ + template1.addTemplateParameter( table.newSymbol( "T", TypeInfo.t_templateParameter ) ); //$NON-NLS-1$ ITemplateFactory factory = table.newTemplateFactory(); factory.setContainingSymbol( table.getCompilationUnit() ); factory.pushTemplate( template1 ); - ISymbol T = template1.lookup( "T" ); - IParameterizedSymbol g1 = table.newParameterizedSymbol( "g", TypeInfo.t_function ); + ISymbol T = template1.lookup( "T" ); //$NON-NLS-1$ + IParameterizedSymbol g1 = table.newParameterizedSymbol( "g", TypeInfo.t_function ); //$NON-NLS-1$ g1.addParameter( T, 0, null, false ); factory.addSymbol( g1 ); - ITemplateSymbol template2 = table.newTemplateSymbol( "g" ); - template2.addTemplateParameter( table.newSymbol( "T", TypeInfo.t_templateParameter ) ); + ITemplateSymbol template2 = table.newTemplateSymbol( "g" ); //$NON-NLS-1$ + template2.addTemplateParameter( table.newSymbol( "T", TypeInfo.t_templateParameter ) ); //$NON-NLS-1$ factory = table.newTemplateFactory(); factory.setContainingSymbol( table.getCompilationUnit() ); factory.pushTemplate( template2 ); - T = template2.lookup( "T" ); - IParameterizedSymbol g2 = table.newParameterizedSymbol( "g", TypeInfo.t_function ); + T = template2.lookup( "T" ); //$NON-NLS-1$ + IParameterizedSymbol g2 = table.newParameterizedSymbol( "g", TypeInfo.t_function ); //$NON-NLS-1$ g2.addParameter( T, 0, new PtrOp( PtrOp.t_reference ), false ); factory.addSymbol( g2 ); - ISymbol x = table.newSymbol( "x", TypeInfo.t_float ); + ISymbol x = table.newSymbol( "x", TypeInfo.t_float ); //$NON-NLS-1$ List params = new ArrayList(); params.add( new TypeInfo( TypeInfo.t_type, 0, x ) ); try{ - table.getCompilationUnit().unqualifiedFunctionLookup( "g", params ); + table.getCompilationUnit().unqualifiedFunctionLookup( "g", params ); //$NON-NLS-1$ assertTrue( false ); } catch( ParserSymbolTableException e ){ assertEquals( e.reason, ParserSymbolTableException.r_Ambiguous ); @@ -1598,59 +1598,59 @@ public class ParserSymbolTableTemplateTests extends TestCase { public void test_14_5_5_2__5_OrderingFunctionTemplates_3() throws Exception{ newTable(); - ITemplateSymbol templateA = table.newTemplateSymbol( "A" ); - templateA.addTemplateParameter( table.newSymbol( "T", TypeInfo.t_templateParameter ) ); + ITemplateSymbol templateA = table.newTemplateSymbol( "A" ); //$NON-NLS-1$ + templateA.addTemplateParameter( table.newSymbol( "T", TypeInfo.t_templateParameter ) ); //$NON-NLS-1$ ITemplateFactory factory = table.newTemplateFactory(); factory.setContainingSymbol( table.getCompilationUnit() ); factory.pushTemplate( templateA ); - IDerivableContainerSymbol A = table.newDerivableContainerSymbol( "A", TypeInfo.t_struct ); + IDerivableContainerSymbol A = table.newDerivableContainerSymbol( "A", TypeInfo.t_struct ); //$NON-NLS-1$ factory.addSymbol( A ); - ITemplateSymbol template1 = table.newTemplateSymbol( "h" ); - template1.addTemplateParameter( table.newSymbol( "T", TypeInfo.t_templateParameter ) ); + ITemplateSymbol template1 = table.newTemplateSymbol( "h" ); //$NON-NLS-1$ + template1.addTemplateParameter( table.newSymbol( "T", TypeInfo.t_templateParameter ) ); //$NON-NLS-1$ factory = table.newTemplateFactory(); factory.setContainingSymbol( table.getCompilationUnit() ); factory.pushTemplate( template1 ); - ISymbol T = template1.lookup( "T" ); - IParameterizedSymbol h1 = table.newParameterizedSymbol( "h", TypeInfo.t_function ); + ISymbol T = template1.lookup( "T" ); //$NON-NLS-1$ + IParameterizedSymbol h1 = table.newParameterizedSymbol( "h", TypeInfo.t_function ); //$NON-NLS-1$ h1.addParameter( T, TypeInfo.isConst, new PtrOp( PtrOp.t_reference, false, false ),false ); factory.addSymbol( h1 ); - ITemplateSymbol template2 = table.newTemplateSymbol( "h" ); - template2.addTemplateParameter( table.newSymbol( "T", TypeInfo.t_templateParameter ) ); + ITemplateSymbol template2 = table.newTemplateSymbol( "h" ); //$NON-NLS-1$ + template2.addTemplateParameter( table.newSymbol( "T", TypeInfo.t_templateParameter ) ); //$NON-NLS-1$ factory = table.newTemplateFactory(); factory.setContainingSymbol( table.getCompilationUnit() ); factory.pushTemplate( template2 ); - T = template2.lookup( "T" ); + T = template2.lookup( "T" ); //$NON-NLS-1$ - IParameterizedSymbol h2 = table.newParameterizedSymbol( "h", TypeInfo.t_function ); + IParameterizedSymbol h2 = table.newParameterizedSymbol( "h", TypeInfo.t_function ); //$NON-NLS-1$ List argList = new ArrayList(); argList.add( new TypeInfo( TypeInfo.t_type, 0, T ) ); h2.addParameter( templateA.instantiate( argList ), 0, new PtrOp( PtrOp.t_reference ), false ); factory.addSymbol( h2 ); - ISymbol z = table.newSymbol( "z", TypeInfo.t_type ); + ISymbol z = table.newSymbol( "z", TypeInfo.t_type ); //$NON-NLS-1$ List args = new ArrayList(); args.add( new TypeInfo( TypeInfo.t_int, 0, null ) ); - ISymbol look = table.getCompilationUnit().lookupTemplateId( "A", args ); + ISymbol look = table.getCompilationUnit().lookupTemplateId( "A", args ); //$NON-NLS-1$ assertTrue( look.isTemplateInstance() ); assertEquals( look.getInstantiatedSymbol(), A ); z.setTypeSymbol( look ); List params = new ArrayList(); params.add( new TypeInfo( TypeInfo.t_type, 0, z ) ); - look = table.getCompilationUnit().unqualifiedFunctionLookup( "h", params ); + look = table.getCompilationUnit().unqualifiedFunctionLookup( "h", params ); //$NON-NLS-1$ assertTrue( look.isTemplateInstance() ); assertEquals( look.getInstantiatedSymbol(), h2 ); - ISymbol z2 = table.newSymbol( "z2", TypeInfo.t_type ); - look = table.getCompilationUnit().lookupTemplateId( "A", args ); + ISymbol z2 = table.newSymbol( "z2", TypeInfo.t_type ); //$NON-NLS-1$ + look = table.getCompilationUnit().lookupTemplateId( "A", args ); //$NON-NLS-1$ assertTrue( look.isTemplateInstance() ); assertEquals( look.getInstantiatedSymbol(), A ); z2.setTypeSymbol( look ); @@ -1658,7 +1658,7 @@ public class ParserSymbolTableTemplateTests extends TestCase { params.clear(); params.add( new TypeInfo( TypeInfo.t_type, 0, z2 ) ); - look = table.getCompilationUnit().unqualifiedFunctionLookup( "h", params ); + look = table.getCompilationUnit().unqualifiedFunctionLookup( "h", params ); //$NON-NLS-1$ assertTrue( look.isTemplateInstance() ); assertEquals( look.getInstantiatedSymbol(), h1 ); } @@ -1677,18 +1677,18 @@ public class ParserSymbolTableTemplateTests extends TestCase { public void test_14_6_1__1_TemplateName() throws Exception{ newTable(); - ITemplateSymbol template = table.newTemplateSymbol( "X" ); - ISymbol T = table.newSymbol( "T", TypeInfo.t_templateParameter ); + ITemplateSymbol template = table.newTemplateSymbol( "X" ); //$NON-NLS-1$ + ISymbol T = table.newSymbol( "T", TypeInfo.t_templateParameter ); //$NON-NLS-1$ template.addTemplateParameter( T ); ITemplateFactory factory = table.newTemplateFactory(); factory.setContainingSymbol( table.getCompilationUnit() ); factory.pushTemplate( template ); - IDerivableContainerSymbol X = table.newDerivableContainerSymbol( "X", TypeInfo.t_class ); + IDerivableContainerSymbol X = table.newDerivableContainerSymbol( "X", TypeInfo.t_class ); //$NON-NLS-1$ factory.addSymbol( X ); - ISymbol look = X.lookup( "X" ); + ISymbol look = X.lookup( "X" ); //$NON-NLS-1$ assertTrue( look != null ); assertTrue( look instanceof IDeferredTemplateInstance ); @@ -1716,23 +1716,23 @@ public class ParserSymbolTableTemplateTests extends TestCase { public void test_14_6_1__2_SpecializationName() throws Exception{ newTable(); - ITemplateSymbol template = table.newTemplateSymbol( "Y" ); - ISymbol T = table.newSymbol( "T", TypeInfo.t_templateParameter ); + ITemplateSymbol template = table.newTemplateSymbol( "Y" ); //$NON-NLS-1$ + ISymbol T = table.newSymbol( "T", TypeInfo.t_templateParameter ); //$NON-NLS-1$ template.addTemplateParameter( T ); - IDerivableContainerSymbol Y1 = table.newDerivableContainerSymbol( "Y", TypeInfo.t_class ); + IDerivableContainerSymbol Y1 = table.newDerivableContainerSymbol( "Y", TypeInfo.t_class ); //$NON-NLS-1$ template.addSymbol( Y1 ); table.getCompilationUnit().addSymbol( template ); - ISpecializedSymbol spec = table.newSpecializedSymbol( "Y" ); + ISpecializedSymbol spec = table.newSpecializedSymbol( "Y" ); //$NON-NLS-1$ spec.addArgument( new TypeInfo( TypeInfo.t_int, 0, null ) ); template.addSpecialization( spec ); - IDerivableContainerSymbol Y2 = table.newDerivableContainerSymbol( "Y", TypeInfo.t_class ); + IDerivableContainerSymbol Y2 = table.newDerivableContainerSymbol( "Y", TypeInfo.t_class ); //$NON-NLS-1$ spec.addSymbol( Y2 ); - ISymbol look = Y2.lookup( "Y" ); + ISymbol look = Y2.lookup( "Y" ); //$NON-NLS-1$ assertTrue( look != null ); assertTrue( look instanceof IDeferredTemplateInstance ); IDeferredTemplateInstance deferred = (IDeferredTemplateInstance) look; @@ -1761,10 +1761,10 @@ public class ParserSymbolTableTemplateTests extends TestCase { public void test_14_6_1__4_ParameterRedeclaration() throws Exception{ newTable(); - ITemplateSymbol template = table.newTemplateSymbol( "Y" ); - template.addTemplateParameter( table.newSymbol( "T", TypeInfo.t_templateParameter ) ); + ITemplateSymbol template = table.newTemplateSymbol( "Y" ); //$NON-NLS-1$ + template.addTemplateParameter( table.newSymbol( "T", TypeInfo.t_templateParameter ) ); //$NON-NLS-1$ - ISymbol i = table.newSymbol( "i", TypeInfo.t_templateParameter ); + ISymbol i = table.newSymbol( "i", TypeInfo.t_templateParameter ); //$NON-NLS-1$ i.getTypeInfo().setTemplateParameterType( TypeInfo.t_int ); template.addTemplateParameter( i ); @@ -1772,10 +1772,10 @@ public class ParserSymbolTableTemplateTests extends TestCase { factory.setContainingSymbol( table.getCompilationUnit() ); factory.pushTemplate( template ); - IDerivableContainerSymbol Y = table.newDerivableContainerSymbol( "Y", TypeInfo.t_class ); + IDerivableContainerSymbol Y = table.newDerivableContainerSymbol( "Y", TypeInfo.t_class ); //$NON-NLS-1$ factory.addSymbol( Y ); - ISymbol T = table.newSymbol( "T", TypeInfo.t_int ); + ISymbol T = table.newSymbol( "T", TypeInfo.t_int ); //$NON-NLS-1$ try{ Y.addSymbol( T ); assertTrue( false ); @@ -1783,19 +1783,19 @@ public class ParserSymbolTableTemplateTests extends TestCase { assertEquals( e.reason, ParserSymbolTableException.r_RedeclaredTemplateParam ); } - IParameterizedSymbol f = table.newParameterizedSymbol( "f", TypeInfo.t_function ); + IParameterizedSymbol f = table.newParameterizedSymbol( "f", TypeInfo.t_function ); //$NON-NLS-1$ Y.addSymbol( f ); try{ - f.addSymbol( table.newSymbol( "T", TypeInfo.t_char ) ); + f.addSymbol( table.newSymbol( "T", TypeInfo.t_char ) ); //$NON-NLS-1$ assertTrue( false ); } catch ( ParserSymbolTableException e ){ assertEquals( e.reason, ParserSymbolTableException.r_RedeclaredTemplateParam ); } - ITemplateSymbol template2 = table.newTemplateSymbol( "X" ); + ITemplateSymbol template2 = table.newTemplateSymbol( "X" ); //$NON-NLS-1$ try{ - template2.addTemplateParameter( table.newSymbol( "X", TypeInfo.t_templateParameter ) ); + template2.addTemplateParameter( table.newSymbol( "X", TypeInfo.t_templateParameter ) ); //$NON-NLS-1$ assertTrue( false ); } catch( ParserSymbolTableException e ){ assertEquals( e.reason, ParserSymbolTableException.r_BadTemplateParameter ); @@ -1822,23 +1822,23 @@ public class ParserSymbolTableTemplateTests extends TestCase { public void test_14_7_3__5_ExplicitSpecialization() throws Exception{ newTable(); - ITemplateSymbol template = table.newTemplateSymbol( "A" ); - ISymbol T = table.newSymbol( "T", TypeInfo.t_templateParameter ); + ITemplateSymbol template = table.newTemplateSymbol( "A" ); //$NON-NLS-1$ + ISymbol T = table.newSymbol( "T", TypeInfo.t_templateParameter ); //$NON-NLS-1$ template.addTemplateParameter( T ); ITemplateFactory factory = table.newTemplateFactory(); factory.setContainingSymbol( table.getCompilationUnit() ); factory.pushTemplate( template ); - IDerivableContainerSymbol A = table.newDerivableContainerSymbol( "A", TypeInfo.t_struct ); + IDerivableContainerSymbol A = table.newDerivableContainerSymbol( "A", TypeInfo.t_struct ); //$NON-NLS-1$ factory.addSymbol( A ); - IParameterizedSymbol f = table.newParameterizedSymbol( "f", TypeInfo.t_function ); + IParameterizedSymbol f = table.newParameterizedSymbol( "f", TypeInfo.t_function ); //$NON-NLS-1$ f.addParameter( T, 0, null, false ); A.addSymbol( f ); - ITemplateSymbol temp = table.newTemplateSymbol( "" ); + ITemplateSymbol temp = table.newTemplateSymbol( "" ); //$NON-NLS-1$ factory = table.newTemplateFactory(); factory.setContainingSymbol( table.getCompilationUnit() ); factory.pushTemplate( temp ); @@ -1850,31 +1850,31 @@ public class ParserSymbolTableTemplateTests extends TestCase { ITemplateSymbol templateSpec = table.newTemplateSymbol( ParserSymbolTable.EMPTY_NAME ); factory.pushTemplate( templateSpec ); - IDerivableContainerSymbol ASpec = table.newDerivableContainerSymbol( "A", TypeInfo.t_struct ); + IDerivableContainerSymbol ASpec = table.newDerivableContainerSymbol( "A", TypeInfo.t_struct ); //$NON-NLS-1$ args.add( new TypeInfo( TypeInfo.t_int, 0, null ) ); factory.addTemplateId( ASpec, args ); - IParameterizedSymbol f2 = table.newParameterizedSymbol( "f", TypeInfo.t_function ); + IParameterizedSymbol f2 = table.newParameterizedSymbol( "f", TypeInfo.t_function ); //$NON-NLS-1$ f2.addParameter( TypeInfo.t_int, 0, null, false ); f2.setIsForwardDeclaration( true ); ASpec.addSymbol( f2 ); - IParameterizedSymbol f3 = table.newParameterizedSymbol( "f", TypeInfo.t_function ); + IParameterizedSymbol f3 = table.newParameterizedSymbol( "f", TypeInfo.t_function ); //$NON-NLS-1$ f3.addParameter( TypeInfo.t_int, 0, null, false ); - IDerivableContainerSymbol look = (IDerivableContainerSymbol) table.getCompilationUnit().lookupTemplateId( "A", args ); + IDerivableContainerSymbol look = (IDerivableContainerSymbol) table.getCompilationUnit().lookupTemplateId( "A", args ); //$NON-NLS-1$ assertTrue( look.isTemplateInstance() ); assertEquals( look.getInstantiatedSymbol(), ASpec ); - ISymbol flook = look.lookupMethodForDefinition( "f", args ); + ISymbol flook = look.lookupMethodForDefinition( "f", args ); //$NON-NLS-1$ assertTrue( flook.isTemplateInstance() ); assertEquals( flook.getInstantiatedSymbol(), f2 ); flook.setTypeSymbol( f3 ); look.addSymbol( f3 ); - look = (IDerivableContainerSymbol) table.getCompilationUnit().lookupTemplateId( "A", args ); - flook = look.qualifiedFunctionLookup( "f", args ); + look = (IDerivableContainerSymbol) table.getCompilationUnit().lookupTemplateId( "A", args ); //$NON-NLS-1$ + flook = look.qualifiedFunctionLookup( "f", args ); //$NON-NLS-1$ assertEquals( flook, f3 ); } @@ -1890,57 +1890,57 @@ public class ParserSymbolTableTemplateTests extends TestCase { public void test_14_7_3__11_ExplicitSpecializationArgumentDeduction() throws Exception{ newTable(); - ITemplateSymbol templateArray = table.newTemplateSymbol( "Array" ); - templateArray.addTemplateParameter( table.newSymbol( "T", TypeInfo.t_templateParameter ) ); + ITemplateSymbol templateArray = table.newTemplateSymbol( "Array" ); //$NON-NLS-1$ + templateArray.addTemplateParameter( table.newSymbol( "T", TypeInfo.t_templateParameter ) ); //$NON-NLS-1$ ITemplateFactory factory = table.newTemplateFactory(); factory.setContainingSymbol( table.getCompilationUnit() ); factory.pushTemplate( templateArray ); - IDerivableContainerSymbol array = table.newDerivableContainerSymbol( "Array", TypeInfo.t_class ); + IDerivableContainerSymbol array = table.newDerivableContainerSymbol( "Array", TypeInfo.t_class ); //$NON-NLS-1$ factory.addSymbol( array ); - ITemplateSymbol templateSort = table.newTemplateSymbol( "sort" ); - ISymbol T = table.newSymbol( "T", TypeInfo.t_templateParameter ); + ITemplateSymbol templateSort = table.newTemplateSymbol( "sort" ); //$NON-NLS-1$ + ISymbol T = table.newSymbol( "T", TypeInfo.t_templateParameter ); //$NON-NLS-1$ templateSort.addTemplateParameter( T ); factory = table.newTemplateFactory(); factory.setContainingSymbol( table.getCompilationUnit() ); factory.pushTemplate( templateSort ); - IParameterizedSymbol sort = table.newParameterizedSymbol( "sort", TypeInfo.t_function ); + IParameterizedSymbol sort = table.newParameterizedSymbol( "sort", TypeInfo.t_function ); //$NON-NLS-1$ List args = new ArrayList(); args.add( new TypeInfo( TypeInfo.t_type, 0, T ) ); - ISymbol arrayLook = factory.lookupTemplateId( "Array", args ); + ISymbol arrayLook = factory.lookupTemplateId( "Array", args ); //$NON-NLS-1$ sort.addParameter( arrayLook, 0, new PtrOp( PtrOp.t_reference ), false ); factory.addSymbol( sort ); - ITemplateSymbol temp = table.newTemplateSymbol( "" ); + ITemplateSymbol temp = table.newTemplateSymbol( "" ); //$NON-NLS-1$ factory = table.newTemplateFactory(); factory.setContainingSymbol( table.getCompilationUnit() ); factory.pushTemplate( temp ); - IParameterizedSymbol newSort = table.newParameterizedSymbol( "sort", TypeInfo.t_function ); + IParameterizedSymbol newSort = table.newParameterizedSymbol( "sort", TypeInfo.t_function ); //$NON-NLS-1$ args.clear(); args.add( new TypeInfo( TypeInfo.t_int, 0, null ) ); - arrayLook = table.getCompilationUnit().lookupTemplateId( "Array", args ); + arrayLook = table.getCompilationUnit().lookupTemplateId( "Array", args ); //$NON-NLS-1$ assertTrue( arrayLook.isTemplateInstance() ); assertEquals( arrayLook.getInstantiatedSymbol(), array ); newSort.addParameter( arrayLook, 0, new PtrOp( PtrOp.t_reference ), false ); factory.addSymbol( newSort ); - ISymbol a = table.newSymbol( "a", TypeInfo.t_type ); + ISymbol a = table.newSymbol( "a", TypeInfo.t_type ); //$NON-NLS-1$ a.setTypeSymbol( arrayLook ); args.clear(); args.add( new TypeInfo( TypeInfo.t_type, 0, a ) ); - ISymbol look = table.getCompilationUnit().unqualifiedFunctionLookup( "sort", args ); + ISymbol look = table.getCompilationUnit().unqualifiedFunctionLookup( "sort", args ); //$NON-NLS-1$ assertTrue( look.isTemplateInstance() ); assertEquals( look.getInstantiatedSymbol(), newSort ); @@ -1963,28 +1963,28 @@ public class ParserSymbolTableTemplateTests extends TestCase { public void test_14_7_3__12_ExplicitSpecializationOverloadedFunction() throws Exception{ newTable(); - ITemplateSymbol template1 = table.newTemplateSymbol( "f" ); - ISymbol T1 = table.newSymbol( "T", TypeInfo.t_templateParameter ); + ITemplateSymbol template1 = table.newTemplateSymbol( "f" ); //$NON-NLS-1$ + ISymbol T1 = table.newSymbol( "T", TypeInfo.t_templateParameter ); //$NON-NLS-1$ template1.addTemplateParameter( T1 ); ITemplateFactory factory = table.newTemplateFactory(); factory.setContainingSymbol( table.getCompilationUnit() ); factory.pushTemplate( template1 ); - IParameterizedSymbol f1 = table.newParameterizedSymbol( "f", TypeInfo.t_function ); + IParameterizedSymbol f1 = table.newParameterizedSymbol( "f", TypeInfo.t_function ); //$NON-NLS-1$ f1.addParameter( T1, 0, null, false ); factory.addSymbol( f1 ); - ITemplateSymbol template2 = table.newTemplateSymbol( "f" ); - ISymbol T2 = table.newSymbol( "T", TypeInfo.t_templateParameter ); + ITemplateSymbol template2 = table.newTemplateSymbol( "f" ); //$NON-NLS-1$ + ISymbol T2 = table.newSymbol( "T", TypeInfo.t_templateParameter ); //$NON-NLS-1$ template2.addTemplateParameter( T2 ); factory = table.newTemplateFactory(); factory.setContainingSymbol( table.getCompilationUnit() ); factory.pushTemplate( template2 ); - IParameterizedSymbol f2 = table.newParameterizedSymbol( "f", TypeInfo.t_function ); + IParameterizedSymbol f2 = table.newParameterizedSymbol( "f", TypeInfo.t_function ); //$NON-NLS-1$ f2.addParameter( T2, 0, new PtrOp( PtrOp.t_pointer ), false ); factory.addSymbol( f2 ); @@ -1994,7 +1994,7 @@ public class ParserSymbolTableTemplateTests extends TestCase { factory.setContainingSymbol( table.getCompilationUnit() ); factory.pushTemplate( template ); - IParameterizedSymbol f3 = table.newParameterizedSymbol( "f", TypeInfo.t_function ); + IParameterizedSymbol f3 = table.newParameterizedSymbol( "f", TypeInfo.t_function ); //$NON-NLS-1$ f3.addParameter( TypeInfo.t_int, 0, new PtrOp( PtrOp.t_pointer ), false ); List args = new ArrayList(); @@ -2009,7 +2009,7 @@ public class ParserSymbolTableTemplateTests extends TestCase { factory.setContainingSymbol( table.getCompilationUnit() ); factory.pushTemplate( template ); - IParameterizedSymbol f4 = table.newParameterizedSymbol( "f", TypeInfo.t_function ); + IParameterizedSymbol f4 = table.newParameterizedSymbol( "f", TypeInfo.t_function ); //$NON-NLS-1$ f4.addParameter( TypeInfo.t_int, 0, new PtrOp( PtrOp.t_pointer ), false ); factory.addTemplateId( f4, args ); @@ -2021,14 +2021,14 @@ public class ParserSymbolTableTemplateTests extends TestCase { factory.setContainingSymbol( table.getCompilationUnit() ); factory.pushTemplate( template ); - IParameterizedSymbol f5 = table.newParameterizedSymbol( "f", TypeInfo.t_function ); + IParameterizedSymbol f5 = table.newParameterizedSymbol( "f", TypeInfo.t_function ); //$NON-NLS-1$ f5.addParameter( TypeInfo.t_char, 0, null, false ); factory.addSymbol( f5 ); args.clear(); args.add( new TypeInfo( TypeInfo.t_char, 0, null ) ); - ISymbol look = table.getCompilationUnit().unqualifiedFunctionLookup( "f", args ); + ISymbol look = table.getCompilationUnit().unqualifiedFunctionLookup( "f", args ); //$NON-NLS-1$ assertTrue( look.isTemplateInstance() ); assertEquals( look.getInstantiatedSymbol(), f5 ); } @@ -2051,23 +2051,23 @@ public class ParserSymbolTableTemplateTests extends TestCase { public void test_14_8_2_4__5_ArgumentDeduction() throws Exception{ newTable(); - ITemplateSymbol template = table.newTemplateSymbol( "f" ); - ISymbol T = table.newSymbol( "T", TypeInfo.t_templateParameter ); + ITemplateSymbol template = table.newTemplateSymbol( "f" ); //$NON-NLS-1$ + ISymbol T = table.newSymbol( "T", TypeInfo.t_templateParameter ); //$NON-NLS-1$ template.addTemplateParameter( T ); ITemplateFactory factory = table.newTemplateFactory(); factory.setContainingSymbol( table.getCompilationUnit() ); factory.pushTemplate( template ); - IParameterizedSymbol f = table.newParameterizedSymbol( "f", TypeInfo.t_function ); + IParameterizedSymbol f = table.newParameterizedSymbol( "f", TypeInfo.t_function ); //$NON-NLS-1$ - ISymbol lookT = template.lookup( "T" ); + ISymbol lookT = template.lookup( "T" ); //$NON-NLS-1$ assertEquals( lookT, T ); - ISymbol paramX = table.newSymbol( "x", TypeInfo.t_type ); + ISymbol paramX = table.newSymbol( "x", TypeInfo.t_type ); //$NON-NLS-1$ paramX.setTypeSymbol( lookT ); - ISymbol paramY = table.newSymbol( "y", TypeInfo.t_type ); + ISymbol paramY = table.newSymbol( "y", TypeInfo.t_type ); //$NON-NLS-1$ paramY.setTypeSymbol( lookT ); f.addParameter( paramX ); @@ -2075,17 +2075,17 @@ public class ParserSymbolTableTemplateTests extends TestCase { factory.addSymbol( f ); - IDerivableContainerSymbol A = table.newDerivableContainerSymbol( "A", TypeInfo.t_struct ); + IDerivableContainerSymbol A = table.newDerivableContainerSymbol( "A", TypeInfo.t_struct ); //$NON-NLS-1$ table.getCompilationUnit().addSymbol( A ); - IDerivableContainerSymbol B = table.newDerivableContainerSymbol( "B", TypeInfo.t_struct ); + IDerivableContainerSymbol B = table.newDerivableContainerSymbol( "B", TypeInfo.t_struct ); //$NON-NLS-1$ B.addParent( A ); table.getCompilationUnit().addSymbol( B ); - ISymbol a = table.newSymbol( "a", TypeInfo.t_type ); + ISymbol a = table.newSymbol( "a", TypeInfo.t_type ); //$NON-NLS-1$ a.setTypeSymbol( A ); - ISymbol b = table.newSymbol( "b", TypeInfo.t_type ); + ISymbol b = table.newSymbol( "b", TypeInfo.t_type ); //$NON-NLS-1$ b.setTypeSymbol( B ); table.getCompilationUnit().addSymbol( a ); @@ -2097,26 +2097,26 @@ public class ParserSymbolTableTemplateTests extends TestCase { argList.add( aParam ); argList.add( bParam ); - ISymbol look = table.getCompilationUnit().unqualifiedFunctionLookup( "f", argList ); + ISymbol look = table.getCompilationUnit().unqualifiedFunctionLookup( "f", argList ); //$NON-NLS-1$ assertEquals( look, null ); argList.clear(); argList.add( bParam ); argList.add( aParam ); - look = table.getCompilationUnit().unqualifiedFunctionLookup( "f", argList ); + look = table.getCompilationUnit().unqualifiedFunctionLookup( "f", argList ); //$NON-NLS-1$ assertEquals( look, null ); argList.clear(); argList.add( aParam ); argList.add( aParam ); - look = table.getCompilationUnit().unqualifiedFunctionLookup( "f", argList ); + look = table.getCompilationUnit().unqualifiedFunctionLookup( "f", argList ); //$NON-NLS-1$ assertTrue( look.isTemplateInstance() ); assertEquals( look.getInstantiatedSymbol(), f ); argList.clear(); argList.add( bParam ); argList.add( bParam ); - look = table.getCompilationUnit().unqualifiedFunctionLookup( "f", argList ); + look = table.getCompilationUnit().unqualifiedFunctionLookup( "f", argList ); //$NON-NLS-1$ assertTrue( look.isTemplateInstance()); assertEquals( look.getInstantiatedSymbol(), f ); } @@ -2136,49 +2136,49 @@ public class ParserSymbolTableTemplateTests extends TestCase { public void test_14_8_2_4__6_ArgumentDeduction() throws Exception{ newTable(); - ITemplateSymbol template = table.newTemplateSymbol( "f" ); + ITemplateSymbol template = table.newTemplateSymbol( "f" ); //$NON-NLS-1$ - template.addTemplateParameter( table.newSymbol( "T", TypeInfo.t_templateParameter ) ); - template.addTemplateParameter( table.newSymbol( "U", TypeInfo.t_templateParameter ) ); + template.addTemplateParameter( table.newSymbol( "T", TypeInfo.t_templateParameter ) ); //$NON-NLS-1$ + template.addTemplateParameter( table.newSymbol( "U", TypeInfo.t_templateParameter ) ); //$NON-NLS-1$ ITemplateFactory factory = table.newTemplateFactory(); factory.setContainingSymbol( table.getCompilationUnit() ); factory.pushTemplate( template ); - IParameterizedSymbol paramFunction = table.newParameterizedSymbol( "", TypeInfo.t_function ); + IParameterizedSymbol paramFunction = table.newParameterizedSymbol( "", TypeInfo.t_function ); //$NON-NLS-1$ paramFunction.setIsTemplateMember( true ); - ISymbol T = template.lookup( "T" ); - ISymbol U = template.lookup( "U" ); + ISymbol T = template.lookup( "T" ); //$NON-NLS-1$ + ISymbol U = template.lookup( "U" ); //$NON-NLS-1$ paramFunction.setReturnType( T ); paramFunction.addParameter( T, 0, null, false ); paramFunction.addParameter( U, 0, null, false ); paramFunction.addParameter( U, 0, null, false ); - IParameterizedSymbol f = table.newParameterizedSymbol( "f", TypeInfo.t_function ); + IParameterizedSymbol f = table.newParameterizedSymbol( "f", TypeInfo.t_function ); //$NON-NLS-1$ f.addParameter( paramFunction, 0, null, false ); factory.addSymbol( f ); - IParameterizedSymbol g1 = table.newParameterizedSymbol( "g1", TypeInfo.t_function ); - g1.setReturnType( table.newSymbol( "", TypeInfo.t_int ) ); + IParameterizedSymbol g1 = table.newParameterizedSymbol( "g1", TypeInfo.t_function ); //$NON-NLS-1$ + g1.setReturnType( table.newSymbol( "", TypeInfo.t_int ) ); //$NON-NLS-1$ g1.addParameter( TypeInfo.t_int, 0, null, false ); g1.addParameter( TypeInfo.t_float, 0, null, false ); g1.addParameter( TypeInfo.t_float, 0, null, false ); table.getCompilationUnit().addSymbol( g1 ); - IParameterizedSymbol g2 = table.newParameterizedSymbol( "g2", TypeInfo.t_function ); - g2.setReturnType( table.newSymbol( "", TypeInfo.t_char ) ); + IParameterizedSymbol g2 = table.newParameterizedSymbol( "g2", TypeInfo.t_function ); //$NON-NLS-1$ + g2.setReturnType( table.newSymbol( "", TypeInfo.t_char ) ); //$NON-NLS-1$ g2.addParameter( TypeInfo.t_int, 0, null, false ); g2.addParameter( TypeInfo.t_float, 0, null, false ); g2.addParameter( TypeInfo.t_float, 0, null, false ); table.getCompilationUnit().addSymbol( g2); - IParameterizedSymbol g3 = table.newParameterizedSymbol( "g3", TypeInfo.t_function ); - g3.setReturnType( table.newSymbol( "", TypeInfo.t_int ) ); + IParameterizedSymbol g3 = table.newParameterizedSymbol( "g3", TypeInfo.t_function ); //$NON-NLS-1$ + g3.setReturnType( table.newSymbol( "", TypeInfo.t_int ) ); //$NON-NLS-1$ g3.addParameter( TypeInfo.t_int, 0, null, false ); g3.addParameter( TypeInfo.t_char, 0, null, false ); g3.addParameter( TypeInfo.t_float, 0, null, false ); @@ -2189,16 +2189,16 @@ public class ParserSymbolTableTemplateTests extends TestCase { List argList = new ArrayList(); argList.add( arg ); - ISymbol look = table.getCompilationUnit().unqualifiedFunctionLookup( "f", argList ); + ISymbol look = table.getCompilationUnit().unqualifiedFunctionLookup( "f", argList ); //$NON-NLS-1$ assertTrue( look.isTemplateInstance() ); assertEquals( look.getInstantiatedSymbol(), f ); arg.setTypeSymbol( g2 ); - look = table.getCompilationUnit().unqualifiedFunctionLookup( "f", argList ); + look = table.getCompilationUnit().unqualifiedFunctionLookup( "f", argList ); //$NON-NLS-1$ assertEquals( look, null ); arg.setTypeSymbol( g3 ); - look = table.getCompilationUnit().unqualifiedFunctionLookup( "f", argList ); + look = table.getCompilationUnit().unqualifiedFunctionLookup( "f", argList ); //$NON-NLS-1$ assertEquals( look, null ); } /** @@ -2213,24 +2213,24 @@ public class ParserSymbolTableTemplateTests extends TestCase { public void test_14_8_2_4__7_ArgumentDeduction() throws Exception{ newTable(); - ITemplateSymbol template = table.newTemplateSymbol( "f" ); - ISymbol T = table.newSymbol( "T", TypeInfo.t_templateParameter ); + ITemplateSymbol template = table.newTemplateSymbol( "f" ); //$NON-NLS-1$ + ISymbol T = table.newSymbol( "T", TypeInfo.t_templateParameter ); //$NON-NLS-1$ template.addTemplateParameter( T ); ITemplateFactory factory = table.newTemplateFactory(); factory.setContainingSymbol( table.getCompilationUnit() ); factory.pushTemplate( template ); - IParameterizedSymbol f = table.newParameterizedSymbol( "f", TypeInfo.t_function ); + IParameterizedSymbol f = table.newParameterizedSymbol( "f", TypeInfo.t_function ); //$NON-NLS-1$ f.addParameter( T, 0, new PtrOp( PtrOp.t_pointer, true, false ), false ); factory.addSymbol( f ); - ISymbol p = table.newSymbol( "p", TypeInfo.t_int ); + ISymbol p = table.newSymbol( "p", TypeInfo.t_int ); //$NON-NLS-1$ p.addPtrOperator( new PtrOp( PtrOp.t_pointer ) ); List params = new ArrayList(); params.add( new TypeInfo( TypeInfo.t_type, 0, p ) ); - ISymbol look = table.getCompilationUnit().unqualifiedFunctionLookup( "f", params ); + ISymbol look = table.getCompilationUnit().unqualifiedFunctionLookup( "f", params ); //$NON-NLS-1$ assertTrue( look != null ); assertTrue( look.isTemplateInstance() ); @@ -2270,40 +2270,40 @@ public class ParserSymbolTableTemplateTests extends TestCase { public void test_14_8_2_4__8_ArgumentDeduction() throws Exception{ newTable(); - ITemplateSymbol templateB = table.newTemplateSymbol( "B" ); - templateB.addTemplateParameter( table.newSymbol( "T", TypeInfo.t_templateParameter ) ); + ITemplateSymbol templateB = table.newTemplateSymbol( "B" ); //$NON-NLS-1$ + templateB.addTemplateParameter( table.newSymbol( "T", TypeInfo.t_templateParameter ) ); //$NON-NLS-1$ ITemplateFactory factory = table.newTemplateFactory(); factory.setContainingSymbol( table.getCompilationUnit() ); factory.pushTemplate( templateB ); - IDerivableContainerSymbol B = table.newDerivableContainerSymbol( "B", TypeInfo.t_struct ); + IDerivableContainerSymbol B = table.newDerivableContainerSymbol( "B", TypeInfo.t_struct ); //$NON-NLS-1$ factory.addSymbol( B ); - ITemplateSymbol templateD = table.newTemplateSymbol( "D" ); - templateD.addTemplateParameter( table.newSymbol( "T", TypeInfo.t_templateParameter ) ); + ITemplateSymbol templateD = table.newTemplateSymbol( "D" ); //$NON-NLS-1$ + templateD.addTemplateParameter( table.newSymbol( "T", TypeInfo.t_templateParameter ) ); //$NON-NLS-1$ factory = table.newTemplateFactory(); factory.setContainingSymbol( table.getCompilationUnit() ); factory.pushTemplate( templateD ); - IDerivableContainerSymbol D = table.newDerivableContainerSymbol( "D", TypeInfo.t_struct ); + IDerivableContainerSymbol D = table.newDerivableContainerSymbol( "D", TypeInfo.t_struct ); //$NON-NLS-1$ factory.addSymbol( D ); - ISymbol T = templateD.lookup( "T" ); + ISymbol T = templateD.lookup( "T" ); //$NON-NLS-1$ List args = new ArrayList (); args.add( new TypeInfo( TypeInfo.t_type, 0, T ) ); - ISymbol look = table.getCompilationUnit().lookupTemplateId( "B", args ); + ISymbol look = table.getCompilationUnit().lookupTemplateId( "B", args ); //$NON-NLS-1$ assertTrue( look instanceof IDeferredTemplateInstance ); assertEquals( ((IDeferredTemplateInstance)look).getTemplate(), templateB ); D.addParent( look ); - IDerivableContainerSymbol D2 = table.newDerivableContainerSymbol( "D2", TypeInfo.t_struct ); + IDerivableContainerSymbol D2 = table.newDerivableContainerSymbol( "D2", TypeInfo.t_struct ); //$NON-NLS-1$ args.clear(); args.add( new TypeInfo( TypeInfo.t_int, 0, null ) ); - look = table.getCompilationUnit().lookupTemplateId( "B", args ); + look = table.getCompilationUnit().lookupTemplateId( "B", args ); //$NON-NLS-1$ assertTrue( look.isTemplateInstance() ); assertEquals( look.getInstantiatedSymbol(), B ); @@ -2311,55 +2311,55 @@ public class ParserSymbolTableTemplateTests extends TestCase { table.getCompilationUnit().addSymbol( D2 ); - ITemplateSymbol templatef = table.newTemplateSymbol( "f" ); - T = table.newSymbol( "T", TypeInfo.t_templateParameter ); + ITemplateSymbol templatef = table.newTemplateSymbol( "f" ); //$NON-NLS-1$ + T = table.newSymbol( "T", TypeInfo.t_templateParameter ); //$NON-NLS-1$ templatef.addTemplateParameter( T ); factory = table.newTemplateFactory(); factory.setContainingSymbol( table.getCompilationUnit() ); factory.pushTemplate( templatef ); - IParameterizedSymbol f = table.newParameterizedSymbol( "f", TypeInfo.t_function ); + IParameterizedSymbol f = table.newParameterizedSymbol( "f", TypeInfo.t_function ); //$NON-NLS-1$ args.clear(); args.add( new TypeInfo( TypeInfo.t_type, 0, T ) ); - look = table.getCompilationUnit().lookupTemplateId( "B", args ); + look = table.getCompilationUnit().lookupTemplateId( "B", args ); //$NON-NLS-1$ assertTrue( look instanceof IDeferredTemplateInstance ); assertEquals( ((IDeferredTemplateInstance)look).getTemplate(), templateB ); - ISymbol param = table.newSymbol( "", TypeInfo.t_type ); + ISymbol param = table.newSymbol( "", TypeInfo.t_type ); //$NON-NLS-1$ param.setTypeSymbol( look ); param.addPtrOperator( new PtrOp( PtrOp.t_reference ) ); f.addParameter( param ); factory.addSymbol( f ); - ISymbol d = table.newSymbol( "d", TypeInfo.t_type ); + ISymbol d = table.newSymbol( "d", TypeInfo.t_type ); //$NON-NLS-1$ args.clear(); args.add( new TypeInfo( TypeInfo.t_int, 0, null ) ); - look = table.getCompilationUnit().lookupTemplateId( "D", args ); + look = table.getCompilationUnit().lookupTemplateId( "D", args ); //$NON-NLS-1$ assertTrue( look.isTemplateInstance() ); assertEquals( look.getInstantiatedSymbol(), D ); d.setTypeSymbol( look ); table.getCompilationUnit().addSymbol( d ); - ISymbol d2 = table.newSymbol( "d2", TypeInfo.t_type ); + ISymbol d2 = table.newSymbol( "d2", TypeInfo.t_type ); //$NON-NLS-1$ d2.setTypeSymbol( D2 ); table.getCompilationUnit().addSymbol( d2 ); args.clear(); args.add( new TypeInfo( TypeInfo.t_type, 0, d ) ); - look = table.getCompilationUnit().unqualifiedFunctionLookup( "f", args ); + look = table.getCompilationUnit().unqualifiedFunctionLookup( "f", args ); //$NON-NLS-1$ assertTrue( look != null ); assertTrue( look.isTemplateInstance() ); assertEquals( look.getInstantiatedSymbol(), f ); args.clear(); args.add( new TypeInfo( TypeInfo.t_type, 0, d2 ) ); - ISymbol look2 = table.getCompilationUnit().unqualifiedFunctionLookup( "f", args ); + ISymbol look2 = table.getCompilationUnit().unqualifiedFunctionLookup( "f", args ); //$NON-NLS-1$ assertTrue( look2 != null ); assertTrue( look2.isTemplateInstance() ); assertEquals( look2.getInstantiatedSymbol(), f ); @@ -2404,9 +2404,9 @@ public class ParserSymbolTableTemplateTests extends TestCase { newTable(); //template < class T1, class T2 > class A { void f(); }; - ITemplateSymbol template = table.newTemplateSymbol( "A" ); - ISymbol T1 = table.newSymbol( "T1", TypeInfo.t_templateParameter ); - ISymbol T2 = table.newSymbol( "T2", TypeInfo.t_templateParameter ); + ITemplateSymbol template = table.newTemplateSymbol( "A" ); //$NON-NLS-1$ + ISymbol T1 = table.newSymbol( "T1", TypeInfo.t_templateParameter ); //$NON-NLS-1$ + ISymbol T2 = table.newSymbol( "T2", TypeInfo.t_templateParameter ); //$NON-NLS-1$ template.addTemplateParameter( T1 ); template.addTemplateParameter( T2 ); @@ -2414,16 +2414,16 @@ public class ParserSymbolTableTemplateTests extends TestCase { factory.setContainingSymbol( table.getCompilationUnit() ); factory.pushTemplate( template ); - IDerivableContainerSymbol A1 = table.newDerivableContainerSymbol( "A", TypeInfo.t_class ); + IDerivableContainerSymbol A1 = table.newDerivableContainerSymbol( "A", TypeInfo.t_class ); //$NON-NLS-1$ factory.addSymbol( A1 ); - IParameterizedSymbol f1 = table.newParameterizedSymbol( "f", TypeInfo.t_function ); + IParameterizedSymbol f1 = table.newParameterizedSymbol( "f", TypeInfo.t_function ); //$NON-NLS-1$ f1.setIsForwardDeclaration( true ); A1.addSymbol( f1 ); //template < class T > class A < T, T > { void f(); }; - ITemplateSymbol spec1 = table.newTemplateSymbol(""); - ISymbol spec1_T = table.newSymbol( "T", TypeInfo.t_templateParameter ); + ITemplateSymbol spec1 = table.newTemplateSymbol(""); //$NON-NLS-1$ + ISymbol spec1_T = table.newSymbol( "T", TypeInfo.t_templateParameter ); //$NON-NLS-1$ spec1.addTemplateParameter( spec1_T ); factory = table.newTemplateFactory(); @@ -2434,16 +2434,16 @@ public class ParserSymbolTableTemplateTests extends TestCase { args.add( new TypeInfo( TypeInfo.t_type, 0, spec1_T ) ); args.add( new TypeInfo( TypeInfo.t_type, 0, spec1_T ) ); - IDerivableContainerSymbol A2 = table.newDerivableContainerSymbol( "A", TypeInfo.t_class ); + IDerivableContainerSymbol A2 = table.newDerivableContainerSymbol( "A", TypeInfo.t_class ); //$NON-NLS-1$ factory.addTemplateId( A2, args ); - IParameterizedSymbol f2 = table.newParameterizedSymbol( "f", TypeInfo.t_function ); + IParameterizedSymbol f2 = table.newParameterizedSymbol( "f", TypeInfo.t_function ); //$NON-NLS-1$ f2.setIsForwardDeclaration( true ); A2.addSymbol( f2 ); //template < class T > class A < char, T > { void f(); }; - ITemplateSymbol spec2 = table.newTemplateSymbol(""); - ISymbol spec2_T = table.newSymbol( "T", TypeInfo.t_templateParameter ); + ITemplateSymbol spec2 = table.newTemplateSymbol(""); //$NON-NLS-1$ + ISymbol spec2_T = table.newSymbol( "T", TypeInfo.t_templateParameter ); //$NON-NLS-1$ spec2.addTemplateParameter( spec2_T ); factory = table.newTemplateFactory(); @@ -2454,17 +2454,17 @@ public class ParserSymbolTableTemplateTests extends TestCase { args.add( new TypeInfo( TypeInfo.t_char, 0, null ) ); args.add( new TypeInfo( TypeInfo.t_type, 0, spec2_T ) ); - IDerivableContainerSymbol A3 = table.newDerivableContainerSymbol( "A", TypeInfo.t_class ); + IDerivableContainerSymbol A3 = table.newDerivableContainerSymbol( "A", TypeInfo.t_class ); //$NON-NLS-1$ factory.addTemplateId( A3, args ); - IParameterizedSymbol f3 = table.newParameterizedSymbol( "f", TypeInfo.t_function ); + IParameterizedSymbol f3 = table.newParameterizedSymbol( "f", TypeInfo.t_function ); //$NON-NLS-1$ f3.setIsForwardDeclaration( true ); A3.addSymbol( f3 ); //template < class U, class V > void A::f(){ int c; } - ITemplateSymbol templateDef = table.newTemplateSymbol(""); - ISymbol U = table.newSymbol( "U", TypeInfo.t_templateParameter ); - ISymbol V = table.newSymbol( "V", TypeInfo.t_templateParameter ); + ITemplateSymbol templateDef = table.newTemplateSymbol(""); //$NON-NLS-1$ + ISymbol U = table.newSymbol( "U", TypeInfo.t_templateParameter ); //$NON-NLS-1$ + ISymbol V = table.newSymbol( "V", TypeInfo.t_templateParameter ); //$NON-NLS-1$ templateDef.addTemplateParameter( U ); templateDef.addTemplateParameter( V ); @@ -2476,22 +2476,22 @@ public class ParserSymbolTableTemplateTests extends TestCase { args.add( new TypeInfo( TypeInfo.t_type, 0, U ) ); args.add( new TypeInfo( TypeInfo.t_type, 0, V ) ); - ISymbol symbol = factory.lookupTemplateId( "A", args ); + ISymbol symbol = factory.lookupTemplateId( "A", args ); //$NON-NLS-1$ assertEquals( ((IDeferredTemplateInstance)symbol).getTemplate(), template ); factory.pushTemplateId( symbol, args ); - ISymbol look = factory.lookupMethodForDefinition( "f", new ArrayList() ); + ISymbol look = factory.lookupMethodForDefinition( "f", new ArrayList() ); //$NON-NLS-1$ assertEquals( look, f1 ); - IParameterizedSymbol f1Def = table.newParameterizedSymbol( "f", TypeInfo.t_function ); + IParameterizedSymbol f1Def = table.newParameterizedSymbol( "f", TypeInfo.t_function ); //$NON-NLS-1$ f1.setTypeSymbol( f1Def ); factory.addSymbol( f1Def ); - ISymbol c1 = table.newSymbol( "c", TypeInfo.t_int ); + ISymbol c1 = table.newSymbol( "c", TypeInfo.t_int ); //$NON-NLS-1$ f1Def.addSymbol( c1 ); //template < class W > void A < W, W >::f(){ char c; } - ITemplateSymbol specDef1 = table.newTemplateSymbol(""); - ISymbol W = table.newSymbol( "W", TypeInfo.t_templateParameter ); + ITemplateSymbol specDef1 = table.newTemplateSymbol(""); //$NON-NLS-1$ + ISymbol W = table.newSymbol( "W", TypeInfo.t_templateParameter ); //$NON-NLS-1$ specDef1.addTemplateParameter( W ); factory = table.newTemplateFactory(); @@ -2502,21 +2502,21 @@ public class ParserSymbolTableTemplateTests extends TestCase { args.add( new TypeInfo( TypeInfo.t_type, 0, W ) ); args.add( new TypeInfo( TypeInfo.t_type, 0, W ) ); - symbol = factory.lookupTemplateId( "A", args ); + symbol = factory.lookupTemplateId( "A", args ); //$NON-NLS-1$ factory.pushTemplateId( symbol, args ); - look = factory.lookupMethodForDefinition( "f", new ArrayList() ); + look = factory.lookupMethodForDefinition( "f", new ArrayList() ); //$NON-NLS-1$ assertEquals( look, f2 ); - IParameterizedSymbol f2Def = table.newParameterizedSymbol( "f", TypeInfo.t_function ); + IParameterizedSymbol f2Def = table.newParameterizedSymbol( "f", TypeInfo.t_function ); //$NON-NLS-1$ f2.setTypeSymbol( f2Def ); factory.addSymbol( f2Def ); - ISymbol c2 = table.newSymbol( "c", TypeInfo.t_char ); + ISymbol c2 = table.newSymbol( "c", TypeInfo.t_char ); //$NON-NLS-1$ f2Def.addSymbol( c2 ); //template < class X > void < char, X >::f(){ float c; } - ITemplateSymbol specDef2 = table.newTemplateSymbol(""); - ISymbol X = table.newSymbol( "X", TypeInfo.t_templateParameter ); + ITemplateSymbol specDef2 = table.newTemplateSymbol(""); //$NON-NLS-1$ + ISymbol X = table.newSymbol( "X", TypeInfo.t_templateParameter ); //$NON-NLS-1$ specDef2.addTemplateParameter( X ); factory = table.newTemplateFactory(); @@ -2527,16 +2527,16 @@ public class ParserSymbolTableTemplateTests extends TestCase { args.add( new TypeInfo( TypeInfo.t_char, 0, null ) ); args.add( new TypeInfo( TypeInfo.t_type, 0, X ) ); - symbol = factory.lookupTemplateId( "A", args ); + symbol = factory.lookupTemplateId( "A", args ); //$NON-NLS-1$ factory.pushTemplateId( symbol, args ); - look = factory.lookupMethodForDefinition( "f", new ArrayList() ); + look = factory.lookupMethodForDefinition( "f", new ArrayList() ); //$NON-NLS-1$ assertEquals( look, f3 ); - IParameterizedSymbol f3Def = table.newParameterizedSymbol( "f", TypeInfo.t_function ); + IParameterizedSymbol f3Def = table.newParameterizedSymbol( "f", TypeInfo.t_function ); //$NON-NLS-1$ f3.setTypeSymbol( f3Def ); factory.addSymbol( f3Def ); - ISymbol c3 = table.newSymbol( "c", TypeInfo.t_float ); + ISymbol c3 = table.newSymbol( "c", TypeInfo.t_float ); //$NON-NLS-1$ f3Def.addSymbol( c3 ); //A< int, char > a1; @@ -2544,15 +2544,15 @@ public class ParserSymbolTableTemplateTests extends TestCase { args.add( new TypeInfo( TypeInfo.t_int, 0, null ) ); args.add( new TypeInfo( TypeInfo.t_char, 0, null ) ); - look = table.getCompilationUnit().lookupTemplateId( "A", args ); + look = table.getCompilationUnit().lookupTemplateId( "A", args ); //$NON-NLS-1$ assertTrue( look.isTemplateInstance() ); assertEquals( look.getInstantiatedSymbol(), A1 ); - look = ((IContainerSymbol)look).qualifiedFunctionLookup( "f", new ArrayList() ); + look = ((IContainerSymbol)look).qualifiedFunctionLookup( "f", new ArrayList() ); //$NON-NLS-1$ assertTrue( look.isTemplateInstance() ); assertEquals( look.getInstantiatedSymbol(), f1Def ); - look = ((IContainerSymbol)look).qualifiedLookup( "c" ); + look = ((IContainerSymbol)look).qualifiedLookup( "c" ); //$NON-NLS-1$ assertTrue( look.isTemplateInstance() ); assertEquals( look.getInstantiatedSymbol(), c1 ); assertTrue( look.isType( TypeInfo.t_int ) ); @@ -2562,15 +2562,15 @@ public class ParserSymbolTableTemplateTests extends TestCase { args.add( new TypeInfo( TypeInfo.t_int, 0, null ) ); args.add( new TypeInfo( TypeInfo.t_int, 0, null ) ); - look = table.getCompilationUnit().lookupTemplateId( "A", args ); + look = table.getCompilationUnit().lookupTemplateId( "A", args ); //$NON-NLS-1$ assertTrue( look.isTemplateInstance() ); assertEquals( look.getInstantiatedSymbol(), A2 ); - look = ((IContainerSymbol)look).qualifiedFunctionLookup( "f", new ArrayList() ); + look = ((IContainerSymbol)look).qualifiedFunctionLookup( "f", new ArrayList() ); //$NON-NLS-1$ assertTrue( look.isTemplateInstance() ); assertEquals( look.getInstantiatedSymbol(), f2Def ); - look = ((IContainerSymbol)look).qualifiedLookup( "c" ); + look = ((IContainerSymbol)look).qualifiedLookup( "c" ); //$NON-NLS-1$ assertTrue( look.isTemplateInstance() ); assertEquals( look.getInstantiatedSymbol(), c2 ); assertTrue( look.isType( TypeInfo.t_char ) ); @@ -2580,15 +2580,15 @@ public class ParserSymbolTableTemplateTests extends TestCase { args.add( new TypeInfo( TypeInfo.t_char, 0, null ) ); args.add( new TypeInfo( TypeInfo.t_int, 0, null ) ); - look = table.getCompilationUnit().lookupTemplateId( "A", args ); + look = table.getCompilationUnit().lookupTemplateId( "A", args ); //$NON-NLS-1$ assertTrue( look.isTemplateInstance() ); assertEquals( look.getInstantiatedSymbol(), A3 ); - look = ((IContainerSymbol)look).qualifiedFunctionLookup( "f", new ArrayList() ); + look = ((IContainerSymbol)look).qualifiedFunctionLookup( "f", new ArrayList() ); //$NON-NLS-1$ assertTrue( look.isTemplateInstance() ); assertEquals( look.getInstantiatedSymbol(), f3Def ); - look = ((IContainerSymbol)look).qualifiedLookup( "c" ); + look = ((IContainerSymbol)look).qualifiedLookup( "c" ); //$NON-NLS-1$ assertTrue( look.isTemplateInstance() ); assertEquals( look.getInstantiatedSymbol(), c3 ); assertTrue( look.isType( TypeInfo.t_float ) ); diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ParserSymbolTableTest.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ParserSymbolTableTest.java index 29912369317..4acd34bdf30 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ParserSymbolTableTest.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ParserSymbolTableTest.java @@ -82,7 +82,7 @@ public class ParserSymbolTableTest extends TestCase { public void testSimpleAdd() throws Exception{ newTable(); //create the symbol table - ISymbol x = table.newSymbol( "x" ); + ISymbol x = table.newSymbol( "x" ); //$NON-NLS-1$ IContainerSymbol compUnit = table.getCompilationUnit(); compUnit.addSymbol( x ); @@ -94,7 +94,7 @@ public class ParserSymbolTableTest extends TestCase { assertEquals( false, iter.hasNext() ); assertEquals( x, contained ); - assertEquals( contained.getName(), "x" ); + assertEquals( contained.getName(), "x" ); //$NON-NLS-1$ } /** @@ -105,10 +105,10 @@ public class ParserSymbolTableTest extends TestCase { public void testSimpleLookup() throws Exception{ newTable(); //new symbol table - ISymbol x = table.newSymbol( "x", TypeInfo.t_int ); + ISymbol x = table.newSymbol( "x", TypeInfo.t_int ); //$NON-NLS-1$ table.getCompilationUnit().addSymbol( x ); - ISymbol look = table.getCompilationUnit().lookup( "x" ); + ISymbol look = table.getCompilationUnit().lookup( "x" ); //$NON-NLS-1$ assertEquals( x, look ); } @@ -116,14 +116,14 @@ public class ParserSymbolTableTest extends TestCase { public void testLookupNonExistant() throws Exception{ newTable(); - ISymbol look = table.getCompilationUnit().lookup("boo"); + ISymbol look = table.getCompilationUnit().lookup("boo"); //$NON-NLS-1$ assertEquals( look, null ); } public void testSimpleSetGetObject() throws Exception{ newTable(); - IContainerSymbol x = table.newContainerSymbol( "x", TypeInfo.t_namespace ); + IContainerSymbol x = table.newContainerSymbol( "x", TypeInfo.t_namespace ); //$NON-NLS-1$ ISymbolASTExtension extension = new StandardSymbolExtension(x,null); @@ -131,7 +131,7 @@ public class ParserSymbolTableTest extends TestCase { table.getCompilationUnit().addSymbol( x ); - ISymbol look = table.getCompilationUnit().lookup( "x" ); + ISymbol look = table.getCompilationUnit().lookup( "x" ); //$NON-NLS-1$ assertEquals( look.getASTExtension(), extension ); } @@ -145,23 +145,23 @@ public class ParserSymbolTableTest extends TestCase { public void testHide() throws Exception{ newTable(); - ISymbol firstX = table.newSymbol("x"); + ISymbol firstX = table.newSymbol("x"); //$NON-NLS-1$ table.getCompilationUnit().addSymbol( firstX ); - IDerivableContainerSymbol firstClass = table.newDerivableContainerSymbol("class"); + IDerivableContainerSymbol firstClass = table.newDerivableContainerSymbol("class"); //$NON-NLS-1$ firstClass.setType( TypeInfo.t_class ); table.getCompilationUnit().addSymbol( firstClass ); - ISymbol look = firstClass.lookup( "x" ); + ISymbol look = firstClass.lookup( "x" ); //$NON-NLS-1$ assertEquals( look, firstX ); - ISymbol secondX = table.newSymbol("x"); + ISymbol secondX = table.newSymbol("x"); //$NON-NLS-1$ firstClass.addSymbol( secondX ); - look = firstClass.lookup( "x" ); + look = firstClass.lookup( "x" ); //$NON-NLS-1$ assertEquals( look, secondX ); - look = table.getCompilationUnit().lookup( "x" ); + look = table.getCompilationUnit().lookup( "x" ); //$NON-NLS-1$ assertEquals( look, firstX ); } @@ -173,14 +173,14 @@ public class ParserSymbolTableTest extends TestCase { public void testContainingScopeLookup() throws Exception{ newTable(); - ISymbol x = table.newSymbol("x"); + ISymbol x = table.newSymbol("x"); //$NON-NLS-1$ table.getCompilationUnit().addSymbol( x ); - IDerivableContainerSymbol decl = table.newDerivableContainerSymbol("class"); + IDerivableContainerSymbol decl = table.newDerivableContainerSymbol("class"); //$NON-NLS-1$ decl.setType( TypeInfo.t_class ); table.getCompilationUnit().addSymbol( decl ); - ISymbol look = decl.lookup( "x" ); + ISymbol look = decl.lookup( "x" ); //$NON-NLS-1$ assertEquals( x, look ); } @@ -194,20 +194,20 @@ public class ParserSymbolTableTest extends TestCase { public void testParentLookup() throws Exception{ newTable(); - IDerivableContainerSymbol parent = table.newDerivableContainerSymbol("parent"); + IDerivableContainerSymbol parent = table.newDerivableContainerSymbol("parent"); //$NON-NLS-1$ parent.setType( TypeInfo.t_class ); - IDerivableContainerSymbol class1 = table.newDerivableContainerSymbol("class"); + IDerivableContainerSymbol class1 = table.newDerivableContainerSymbol("class"); //$NON-NLS-1$ class1.setType( TypeInfo.t_class ); class1.addParent( parent ); - ISymbol decl = table.newSymbol( "x", TypeInfo.t_int ); + ISymbol decl = table.newSymbol( "x", TypeInfo.t_int ); //$NON-NLS-1$ parent.addSymbol( decl ); table.getCompilationUnit().addSymbol( parent ); table.getCompilationUnit().addSymbol( class1 ); - ISymbol look = class1.lookup( "x" ); + ISymbol look = class1.lookup( "x" ); //$NON-NLS-1$ assertEquals( look, decl ); } @@ -223,17 +223,17 @@ public class ParserSymbolTableTest extends TestCase { public void testAmbiguousParentLookup() throws Exception{ testParentLookup(); - IDerivableContainerSymbol parent2 = table.newDerivableContainerSymbol("parent2"); + IDerivableContainerSymbol parent2 = table.newDerivableContainerSymbol("parent2"); //$NON-NLS-1$ table.getCompilationUnit().addSymbol( parent2 ); - IDerivableContainerSymbol class1 = (IDerivableContainerSymbol) table.getCompilationUnit().lookup( "class" ); + IDerivableContainerSymbol class1 = (IDerivableContainerSymbol) table.getCompilationUnit().lookup( "class" ); //$NON-NLS-1$ class1.addParent( parent2 ); - ISymbol decl = table.newSymbol( "x", TypeInfo.t_int ); + ISymbol decl = table.newSymbol( "x", TypeInfo.t_int ); //$NON-NLS-1$ parent2.addSymbol( decl ); try{ - class1.lookup( "x" ); + class1.lookup( "x" ); //$NON-NLS-1$ assertTrue( false ); } catch ( ParserSymbolTableException e ){ @@ -249,17 +249,17 @@ public class ParserSymbolTableTest extends TestCase { public void testCircularParentLookup() throws Exception{ newTable(); - IDerivableContainerSymbol a = table.newDerivableContainerSymbol("a"); + IDerivableContainerSymbol a = table.newDerivableContainerSymbol("a"); //$NON-NLS-1$ table.getCompilationUnit().addSymbol( a ); - IDerivableContainerSymbol b = table.newDerivableContainerSymbol("b"); + IDerivableContainerSymbol b = table.newDerivableContainerSymbol("b"); //$NON-NLS-1$ b.addParent( a ); table.getCompilationUnit().addSymbol( b ); a.addParent( b ); try{ - a.lookup("foo"); + a.lookup("foo"); //$NON-NLS-1$ assertTrue( false ); } catch ( ParserSymbolTableException e) { assertEquals( e.reason, ParserSymbolTableException.r_CircularInheritance ); @@ -281,13 +281,13 @@ public class ParserSymbolTableTest extends TestCase { public void testVirtualParentLookup() throws Exception{ newTable(); - IDerivableContainerSymbol decl = table.newDerivableContainerSymbol("class"); - IDerivableContainerSymbol c = table.newDerivableContainerSymbol("C"); + IDerivableContainerSymbol decl = table.newDerivableContainerSymbol("class"); //$NON-NLS-1$ + IDerivableContainerSymbol c = table.newDerivableContainerSymbol("C"); //$NON-NLS-1$ - IDerivableContainerSymbol a = table.newDerivableContainerSymbol("A"); + IDerivableContainerSymbol a = table.newDerivableContainerSymbol("A"); //$NON-NLS-1$ a.addParent( c, true, ASTAccessVisibility.PUBLIC, 3, null ); - IDerivableContainerSymbol b = table.newDerivableContainerSymbol("B"); + IDerivableContainerSymbol b = table.newDerivableContainerSymbol("B"); //$NON-NLS-1$ b.addParent( c, true, ASTAccessVisibility.PUBLIC, 6, null ); decl.addParent( a ); @@ -296,14 +296,14 @@ public class ParserSymbolTableTest extends TestCase { IContainerSymbol compUnit = table.getCompilationUnit(); compUnit.addSymbol( c ); - ISymbol x = table.newSymbol( "x", TypeInfo.t_int ); + ISymbol x = table.newSymbol( "x", TypeInfo.t_int ); //$NON-NLS-1$ c.addSymbol( x ); compUnit.addSymbol( decl ); compUnit.addSymbol( a ); compUnit.addSymbol( b ); - ISymbol look = decl.lookup( "x" ); + ISymbol look = decl.lookup( "x" ); //$NON-NLS-1$ assertEquals( look, x ); } @@ -324,9 +324,9 @@ public class ParserSymbolTableTest extends TestCase { IContainerSymbol compUnit = table.getCompilationUnit(); - IDerivableContainerSymbol cls = (IDerivableContainerSymbol) compUnit.lookup("class"); - IDerivableContainerSymbol c = (IDerivableContainerSymbol) compUnit.lookup("C"); - IDerivableContainerSymbol d = table.newDerivableContainerSymbol("D"); + IDerivableContainerSymbol cls = (IDerivableContainerSymbol) compUnit.lookup("class"); //$NON-NLS-1$ + IDerivableContainerSymbol c = (IDerivableContainerSymbol) compUnit.lookup("C"); //$NON-NLS-1$ + IDerivableContainerSymbol d = table.newDerivableContainerSymbol("D"); //$NON-NLS-1$ d.addParent( c ); cls.addParent( d ); @@ -334,7 +334,7 @@ public class ParserSymbolTableTest extends TestCase { compUnit.addSymbol( d ); try{ - cls.lookup( "x" ); + cls.lookup( "x" ); //$NON-NLS-1$ assertTrue( false ); } catch( ParserSymbolTableException e){ @@ -358,10 +358,10 @@ public class ParserSymbolTableTest extends TestCase { public void testStaticEnumParentLookup() throws Exception{ newTable(); - IDerivableContainerSymbol a = table.newDerivableContainerSymbol("a" ); - IDerivableContainerSymbol b = table.newDerivableContainerSymbol( "b" ); - IDerivableContainerSymbol c = table.newDerivableContainerSymbol( "c" ); - IDerivableContainerSymbol d = table.newDerivableContainerSymbol( "d" ); + IDerivableContainerSymbol a = table.newDerivableContainerSymbol("a" ); //$NON-NLS-1$ + IDerivableContainerSymbol b = table.newDerivableContainerSymbol( "b" ); //$NON-NLS-1$ + IDerivableContainerSymbol c = table.newDerivableContainerSymbol( "c" ); //$NON-NLS-1$ + IDerivableContainerSymbol d = table.newDerivableContainerSymbol( "d" ); //$NON-NLS-1$ IContainerSymbol compUnit = table.getCompilationUnit(); @@ -370,14 +370,14 @@ public class ParserSymbolTableTest extends TestCase { compUnit.addSymbol( c ); compUnit.addSymbol( d ); - IContainerSymbol enum = table.newContainerSymbol( "enum", TypeInfo.t_enumeration ); + IContainerSymbol enum = table.newContainerSymbol( "enum", TypeInfo.t_enumeration ); //$NON-NLS-1$ - ISymbol enumerator = table.newSymbol( "enumerator", TypeInfo.t_enumerator ); + ISymbol enumerator = table.newSymbol( "enumerator", TypeInfo.t_enumerator ); //$NON-NLS-1$ - ISymbol stat = table.newSymbol( "static", TypeInfo.t_int ); + ISymbol stat = table.newSymbol( "static", TypeInfo.t_int ); //$NON-NLS-1$ stat.getTypeInfo().setBit( true, TypeInfo.isStatic ); - ISymbol x = table.newSymbol( "x", TypeInfo.t_int ); + ISymbol x = table.newSymbol( "x", TypeInfo.t_int ); //$NON-NLS-1$ d.addSymbol( enum ); d.addSymbol( stat ); @@ -391,7 +391,7 @@ public class ParserSymbolTableTest extends TestCase { c.addParent( d ); try{ - a.lookup( "enumerator" ); + a.lookup( "enumerator" ); //$NON-NLS-1$ assertTrue( true ); } catch ( ParserSymbolTableException e){ @@ -399,7 +399,7 @@ public class ParserSymbolTableTest extends TestCase { } try{ - a.lookup( "static" ); + a.lookup( "static" ); //$NON-NLS-1$ assertTrue( true ); } catch ( ParserSymbolTableException e){ @@ -407,7 +407,7 @@ public class ParserSymbolTableTest extends TestCase { } try{ - a.lookup( "x" ); + a.lookup( "x" ); //$NON-NLS-1$ assertTrue( false ); } catch ( ParserSymbolTableException e){ @@ -423,21 +423,21 @@ public class ParserSymbolTableTest extends TestCase { public void testElaboratedLookup() throws Exception{ newTable(); - IDerivableContainerSymbol cls = table.newDerivableContainerSymbol( "class" ); + IDerivableContainerSymbol cls = table.newDerivableContainerSymbol( "class" ); //$NON-NLS-1$ cls.setType( TypeInfo.t_class ); - IDerivableContainerSymbol struct = table.newDerivableContainerSymbol("struct"); + IDerivableContainerSymbol struct = table.newDerivableContainerSymbol("struct"); //$NON-NLS-1$ struct.setType( TypeInfo.t_struct ); - IContainerSymbol union = table.newContainerSymbol("union"); + IContainerSymbol union = table.newContainerSymbol("union"); //$NON-NLS-1$ union.setType( TypeInfo.t_union ); - IDerivableContainerSymbol hideCls = table.newDerivableContainerSymbol( "class" ); - IDerivableContainerSymbol hideStruct = table.newDerivableContainerSymbol("struct"); - IContainerSymbol hideUnion = table.newContainerSymbol("union"); + IDerivableContainerSymbol hideCls = table.newDerivableContainerSymbol( "class" ); //$NON-NLS-1$ + IDerivableContainerSymbol hideStruct = table.newDerivableContainerSymbol("struct"); //$NON-NLS-1$ + IContainerSymbol hideUnion = table.newContainerSymbol("union"); //$NON-NLS-1$ - IDerivableContainerSymbol a = table.newDerivableContainerSymbol("a"); - IDerivableContainerSymbol b = table.newDerivableContainerSymbol("b"); + IDerivableContainerSymbol a = table.newDerivableContainerSymbol("a"); //$NON-NLS-1$ + IDerivableContainerSymbol b = table.newDerivableContainerSymbol("b"); //$NON-NLS-1$ a.addSymbol(hideCls); a.addSymbol(hideStruct); @@ -452,11 +452,11 @@ public class ParserSymbolTableTest extends TestCase { table.getCompilationUnit().addSymbol( a ); table.getCompilationUnit().addSymbol( b ); - ISymbol look = a.elaboratedLookup( TypeInfo.t_class, "class" ); + ISymbol look = a.elaboratedLookup( TypeInfo.t_class, "class" ); //$NON-NLS-1$ assertEquals( look, cls ); - look = a.elaboratedLookup( TypeInfo.t_struct, "struct" ); + look = a.elaboratedLookup( TypeInfo.t_struct, "struct" ); //$NON-NLS-1$ assertEquals( look, struct ); - look = a.elaboratedLookup( TypeInfo.t_union, "union" ); + look = a.elaboratedLookup( TypeInfo.t_union, "union" ); //$NON-NLS-1$ assertEquals( look, union ); } @@ -474,26 +474,26 @@ public class ParserSymbolTableTest extends TestCase { IContainerSymbol compUnit = table.getCompilationUnit(); //pre-condition - IContainerSymbol A = table.newContainerSymbol("A"); + IContainerSymbol A = table.newContainerSymbol("A"); //$NON-NLS-1$ compUnit.addSymbol(A); - ISymbol member = table.newSymbol("member"); + ISymbol member = table.newSymbol("member"); //$NON-NLS-1$ A.addSymbol(member); //at time of "A a;" - ISymbol look = compUnit.lookup("A"); + ISymbol look = compUnit.lookup("A"); //$NON-NLS-1$ assertEquals( look, A ); - ISymbol a = table.newSymbol("a"); + ISymbol a = table.newSymbol("a"); //$NON-NLS-1$ a.setTypeSymbol( look ); compUnit.addSymbol( a ); //later "a.member" - look = compUnit.lookup("a"); + look = compUnit.lookup("a"); //$NON-NLS-1$ assertEquals( look, a ); IContainerSymbol type = (IContainerSymbol) look.getTypeSymbol(); assertEquals( type, A ); - look = type.lookup("member"); + look = type.lookup("member"); //$NON-NLS-1$ assertEquals( look, member ); } @@ -516,22 +516,22 @@ public class ParserSymbolTableTest extends TestCase { IContainerSymbol compUnit = table.getCompilationUnit(); - IDerivableContainerSymbol struct = table.newDerivableContainerSymbol("stat"); + IDerivableContainerSymbol struct = table.newDerivableContainerSymbol("stat"); //$NON-NLS-1$ struct.setType( TypeInfo.t_struct ); compUnit.addSymbol( struct ); - IParameterizedSymbol function = table.newParameterizedSymbol( "stat" ); + IParameterizedSymbol function = table.newParameterizedSymbol( "stat" ); //$NON-NLS-1$ function.setType( TypeInfo.t_function ); compUnit.addSymbol( function ); - IParameterizedSymbol f = table.newParameterizedSymbol("f"); + IParameterizedSymbol f = table.newParameterizedSymbol("f"); //$NON-NLS-1$ f.setType( TypeInfo.t_function ); compUnit.addSymbol( f ); - ISymbol look = f.elaboratedLookup( TypeInfo.t_struct, "stat" ); + ISymbol look = f.elaboratedLookup( TypeInfo.t_struct, "stat" ); //$NON-NLS-1$ assertEquals( look, struct ); - look = f.lookup( "stat" ); + look = f.lookup( "stat" ); //$NON-NLS-1$ assertEquals( look, function ); } @@ -569,55 +569,55 @@ public class ParserSymbolTableTest extends TestCase { public void testUsingDirectives_1() throws Exception{ newTable(); - IContainerSymbol nsA = table.newContainerSymbol("A"); + IContainerSymbol nsA = table.newContainerSymbol("A"); //$NON-NLS-1$ nsA.setType( TypeInfo.t_namespace ); table.getCompilationUnit().addSymbol( nsA ); - ISymbol nsA_i = table.newSymbol("i"); + ISymbol nsA_i = table.newSymbol("i"); //$NON-NLS-1$ nsA.addSymbol( nsA_i ); - IContainerSymbol nsB = table.newContainerSymbol("B"); + IContainerSymbol nsB = table.newContainerSymbol("B"); //$NON-NLS-1$ nsB.setType( TypeInfo.t_namespace ); nsA.addSymbol( nsB ); - IContainerSymbol nsC = table.newContainerSymbol("C"); + IContainerSymbol nsC = table.newContainerSymbol("C"); //$NON-NLS-1$ nsC.setType( TypeInfo.t_namespace ); nsB.addSymbol( nsC ); - ISymbol nsC_i = table.newSymbol("i"); + ISymbol nsC_i = table.newSymbol("i"); //$NON-NLS-1$ nsC.addSymbol( nsC_i ); - ISymbol look = nsB.lookup("C"); + ISymbol look = nsB.lookup("C"); //$NON-NLS-1$ assertEquals( look, nsC ); nsB.addUsingDirective( nsC ); - IParameterizedSymbol f1 = table.newParameterizedSymbol("f"); + IParameterizedSymbol f1 = table.newParameterizedSymbol("f"); //$NON-NLS-1$ f1.setType( TypeInfo.t_function ); nsB.addSymbol( f1 ); - look = f1.lookup( "i" ); + look = f1.lookup( "i" ); //$NON-NLS-1$ assertEquals( look, nsC_i ); //C::i visible and hides A::i - IContainerSymbol nsD = table.newContainerSymbol("D"); + IContainerSymbol nsD = table.newContainerSymbol("D"); //$NON-NLS-1$ nsD.setType( TypeInfo.t_namespace ); nsA.addSymbol( nsD ); - look = nsD.lookup("B"); + look = nsD.lookup("B"); //$NON-NLS-1$ assertEquals( look, nsB ); nsD.addUsingDirective( nsB ); - look = nsD.lookup("C"); + look = nsD.lookup("C"); //$NON-NLS-1$ assertEquals( look, nsC ); nsD.addUsingDirective( nsC ); - IParameterizedSymbol f2 = table.newParameterizedSymbol( "f2" ); + IParameterizedSymbol f2 = table.newParameterizedSymbol( "f2" ); //$NON-NLS-1$ f2.setType( TypeInfo.t_function ); nsD.addSymbol( f2 ); try { - look = f2.lookup( "i" ); + look = f2.lookup( "i" ); //$NON-NLS-1$ assertTrue( false ); } catch ( ParserSymbolTableException e ) @@ -626,18 +626,18 @@ public class ParserSymbolTableTest extends TestCase { assertEquals( e.reason, ParserSymbolTableException.r_Ambiguous ); } - IParameterizedSymbol f3 = table.newParameterizedSymbol("f3"); + IParameterizedSymbol f3 = table.newParameterizedSymbol("f3"); //$NON-NLS-1$ f3.setType( TypeInfo.t_function ); nsA.addSymbol( f3 ); - look = f3.lookup("i"); + look = f3.lookup("i"); //$NON-NLS-1$ assertEquals( look, nsA_i ); //uses A::i - IParameterizedSymbol f4 = table.newParameterizedSymbol("f4"); + IParameterizedSymbol f4 = table.newParameterizedSymbol("f4"); //$NON-NLS-1$ f4.setType( TypeInfo.t_function ); table.getCompilationUnit().addSymbol( f4 ); - look = f4.lookup("i"); + look = f4.lookup("i"); //$NON-NLS-1$ assertEquals( look, null );//neither i is visible here. } /** @@ -666,24 +666,24 @@ public class ParserSymbolTableTest extends TestCase { IContainerSymbol compUnit = table.getCompilationUnit(); - IContainerSymbol nsM = table.newContainerSymbol( "M" ); + IContainerSymbol nsM = table.newContainerSymbol( "M" ); //$NON-NLS-1$ nsM.setType( TypeInfo.t_namespace ); compUnit.addSymbol( nsM ); - ISymbol nsM_i = table.newSymbol("i"); + ISymbol nsM_i = table.newSymbol("i"); //$NON-NLS-1$ nsM.addSymbol( nsM_i ); - IContainerSymbol nsN = table.newContainerSymbol( "N" ); + IContainerSymbol nsN = table.newContainerSymbol( "N" ); //$NON-NLS-1$ nsN.setType( TypeInfo.t_namespace ); compUnit.addSymbol( nsN ); - ISymbol nsN_i = table.newSymbol("i"); + ISymbol nsN_i = table.newSymbol("i"); //$NON-NLS-1$ nsN.addSymbol( nsN_i ); nsN.addUsingDirective( nsM ); - IParameterizedSymbol f = table.newParameterizedSymbol("f"); + IParameterizedSymbol f = table.newParameterizedSymbol("f"); //$NON-NLS-1$ compUnit.addSymbol( f ); f.addUsingDirective( nsN ); @@ -691,7 +691,7 @@ public class ParserSymbolTableTest extends TestCase { ISymbol look = null; try { - look = f.lookup( "i" ); + look = f.lookup( "i" ); //$NON-NLS-1$ assertTrue( false ); } catch ( ParserSymbolTableException e ) @@ -700,10 +700,10 @@ public class ParserSymbolTableTest extends TestCase { assertEquals( e.reason, ParserSymbolTableException.r_Ambiguous ); } - look = f.lookupNestedNameSpecifier("N"); + look = f.lookupNestedNameSpecifier("N"); //$NON-NLS-1$ assertEquals( look, nsN ); - look = ((IContainerSymbol) look).qualifiedLookup("i"); //ok + look = ((IContainerSymbol) look).qualifiedLookup("i"); //ok //$NON-NLS-1$ assertEquals( look, nsN_i ); } @@ -736,36 +736,36 @@ public class ParserSymbolTableTest extends TestCase { IContainerSymbol compUnit = table.getCompilationUnit(); - IContainerSymbol nsA = table.newContainerSymbol("A"); + IContainerSymbol nsA = table.newContainerSymbol("A"); //$NON-NLS-1$ nsA.setType( TypeInfo.t_namespace ); compUnit.addSymbol( nsA ); - ISymbol a = table.newSymbol("a"); + ISymbol a = table.newSymbol("a"); //$NON-NLS-1$ nsA.addSymbol( a ); - IContainerSymbol nsB = table.newContainerSymbol("B"); + IContainerSymbol nsB = table.newContainerSymbol("B"); //$NON-NLS-1$ nsB.setType( TypeInfo.t_namespace ); compUnit.addSymbol( nsB ); nsB.addUsingDirective( nsA ); - IContainerSymbol nsC = table.newContainerSymbol("C"); + IContainerSymbol nsC = table.newContainerSymbol("C"); //$NON-NLS-1$ nsC.setType( TypeInfo.t_namespace ); compUnit.addSymbol( nsC ); nsC.addUsingDirective( nsA ); - IContainerSymbol nsBC = table.newContainerSymbol("BC"); + IContainerSymbol nsBC = table.newContainerSymbol("BC"); //$NON-NLS-1$ nsBC.setType( TypeInfo.t_namespace ); compUnit.addSymbol( nsBC ); nsBC.addUsingDirective( nsB ); nsBC.addUsingDirective( nsC ); - IParameterizedSymbol f = table.newParameterizedSymbol("f"); + IParameterizedSymbol f = table.newParameterizedSymbol("f"); //$NON-NLS-1$ f.setType(TypeInfo.t_function); compUnit.addSymbol( f ); - ISymbol look = f.lookupNestedNameSpecifier("BC"); + ISymbol look = f.lookupNestedNameSpecifier("BC"); //$NON-NLS-1$ assertEquals( look, nsBC ); - look = ((IContainerSymbol)look).qualifiedLookup("a"); + look = ((IContainerSymbol)look).qualifiedLookup("a"); //$NON-NLS-1$ assertEquals( look, a ); } @@ -797,41 +797,41 @@ public class ParserSymbolTableTest extends TestCase { IContainerSymbol compUnit = table.getCompilationUnit(); - IContainerSymbol nsB = table.newContainerSymbol( "B" ); + IContainerSymbol nsB = table.newContainerSymbol( "B" ); //$NON-NLS-1$ nsB.setType( TypeInfo.t_namespace ); compUnit.addSymbol( nsB ); - ISymbol b = table.newSymbol("b"); + ISymbol b = table.newSymbol("b"); //$NON-NLS-1$ nsB.addSymbol( b ); - IContainerSymbol nsA = table.newContainerSymbol( "A" ); + IContainerSymbol nsA = table.newContainerSymbol( "A" ); //$NON-NLS-1$ nsA.setType( TypeInfo.t_namespace ); compUnit.addSymbol( nsA ); nsA.addUsingDirective( nsB ); - ISymbol a = table.newSymbol("a"); + ISymbol a = table.newSymbol("a"); //$NON-NLS-1$ nsA.addSymbol( a ); nsB.addUsingDirective( nsA ); - IParameterizedSymbol f = table.newParameterizedSymbol("f"); + IParameterizedSymbol f = table.newParameterizedSymbol("f"); //$NON-NLS-1$ compUnit.addSymbol(f); - IContainerSymbol lookA = f.lookupNestedNameSpecifier("A"); + IContainerSymbol lookA = f.lookupNestedNameSpecifier("A"); //$NON-NLS-1$ assertEquals( lookA, nsA ); - ISymbol look = lookA.qualifiedLookup("a"); + ISymbol look = lookA.qualifiedLookup("a"); //$NON-NLS-1$ assertEquals( look, a ); - look = lookA.qualifiedLookup("b"); + look = lookA.qualifiedLookup("b"); //$NON-NLS-1$ assertEquals( look, b ); - IContainerSymbol lookB = f.lookupNestedNameSpecifier("B"); - look = lookB.qualifiedLookup("a"); + IContainerSymbol lookB = f.lookupNestedNameSpecifier("B"); //$NON-NLS-1$ + look = lookB.qualifiedLookup("a"); //$NON-NLS-1$ assertEquals( look, a ); - look = lookB.qualifiedLookup("b"); + look = lookB.qualifiedLookup("b"); //$NON-NLS-1$ assertEquals( look, b ); } @@ -862,23 +862,23 @@ public class ParserSymbolTableTest extends TestCase { IContainerSymbol compUnit = table.getCompilationUnit(); - IContainerSymbol nsA = table.newContainerSymbol( "A" ); + IContainerSymbol nsA = table.newContainerSymbol( "A" ); //$NON-NLS-1$ nsA.setType( TypeInfo.t_namespace ); compUnit.addSymbol( nsA ); - IContainerSymbol nsB = table.newContainerSymbol( "B" ); + IContainerSymbol nsB = table.newContainerSymbol( "B" ); //$NON-NLS-1$ nsB.setType( TypeInfo.t_namespace ); compUnit.addSymbol( nsB ); nsB.addUsingDirective( nsA ); nsA.addUsingDirective( nsB ); - IParameterizedSymbol f = table.newParameterizedSymbol("f"); + IParameterizedSymbol f = table.newParameterizedSymbol("f"); //$NON-NLS-1$ compUnit.addSymbol(f); f.addUsingDirective(nsA); f.addUsingDirective(nsB); - ISymbol look = f.lookup("i"); + ISymbol look = f.lookup("i"); //$NON-NLS-1$ assertEquals( look, null ); } @@ -911,55 +911,55 @@ public class ParserSymbolTableTest extends TestCase { IContainerSymbol compUnit = table.getCompilationUnit(); - IContainerSymbol nsA = table.newContainerSymbol("A"); + IContainerSymbol nsA = table.newContainerSymbol("A"); //$NON-NLS-1$ nsA.setType( TypeInfo.t_namespace ); compUnit.addSymbol( nsA ); - IContainerSymbol structX = table.newContainerSymbol("x"); + IContainerSymbol structX = table.newContainerSymbol("x"); //$NON-NLS-1$ structX.setType( TypeInfo.t_struct ); nsA.addSymbol( structX ); - ISymbol intX = table.newSymbol("x"); + ISymbol intX = table.newSymbol("x"); //$NON-NLS-1$ intX.setType( TypeInfo.t_int ); nsA.addSymbol( intX ); - ISymbol intY = table.newSymbol("y"); + ISymbol intY = table.newSymbol("y"); //$NON-NLS-1$ intY.setType( TypeInfo.t_int ); nsA.addSymbol( intY ); - IContainerSymbol nsB = table.newContainerSymbol("B"); + IContainerSymbol nsB = table.newContainerSymbol("B"); //$NON-NLS-1$ nsB.setType( TypeInfo.t_namespace ); compUnit.addSymbol( nsB ); - IContainerSymbol structY = table.newContainerSymbol("y"); + IContainerSymbol structY = table.newContainerSymbol("y"); //$NON-NLS-1$ structY.setType( TypeInfo.t_struct ); nsB.addSymbol( structY ); - IContainerSymbol nsC = table.newContainerSymbol("C"); + IContainerSymbol nsC = table.newContainerSymbol("C"); //$NON-NLS-1$ nsC.setType( TypeInfo.t_namespace); compUnit.addSymbol( nsC ); - ISymbol look = nsC.lookup("A"); + ISymbol look = nsC.lookup("A"); //$NON-NLS-1$ assertEquals( look, nsA ); nsC.addUsingDirective( nsA ); - look = nsC.lookup("B"); + look = nsC.lookup("B"); //$NON-NLS-1$ assertEquals( look, nsB ); nsC.addUsingDirective( nsB ); //lookup C::x - look = nsC.lookupNestedNameSpecifier("C"); + look = nsC.lookupNestedNameSpecifier("C"); //$NON-NLS-1$ assertEquals( look, nsC ); - look = ((IContainerSymbol)look).qualifiedLookup( "x" ); + look = ((IContainerSymbol)look).qualifiedLookup( "x" ); //$NON-NLS-1$ assertEquals( look, intX ); //lookup C::y - look = nsC.lookupNestedNameSpecifier("C"); + look = nsC.lookupNestedNameSpecifier("C"); //$NON-NLS-1$ assertEquals( look, nsC ); try{ - look = ((IContainerSymbol)look).qualifiedLookup( "y" ); + look = ((IContainerSymbol)look).qualifiedLookup( "y" ); //$NON-NLS-1$ assertTrue(false); } catch ( ParserSymbolTableException e ) { assertEquals( e.reason, ParserSymbolTableException.r_Ambiguous ); @@ -985,28 +985,28 @@ public class ParserSymbolTableTest extends TestCase { IContainerSymbol compUnit = table.getCompilationUnit(); - IContainerSymbol nsA = table.newContainerSymbol( "A" ); + IContainerSymbol nsA = table.newContainerSymbol( "A" ); //$NON-NLS-1$ nsA.setType( TypeInfo.t_namespace ); compUnit.addSymbol( nsA ); - IContainerSymbol nsB = table.newContainerSymbol( "B" ); + IContainerSymbol nsB = table.newContainerSymbol( "B" ); //$NON-NLS-1$ nsB.setType( TypeInfo.t_namespace ); nsA.addSymbol( nsB ); - IParameterizedSymbol f1 = table.newParameterizedSymbol("f1"); + IParameterizedSymbol f1 = table.newParameterizedSymbol("f1"); //$NON-NLS-1$ f1.setType( TypeInfo.t_function ); nsB.addSymbol( f1 ); nsA.addUsingDirective( nsB ); - IContainerSymbol lookA = compUnit.lookupNestedNameSpecifier( "A" ); + IContainerSymbol lookA = compUnit.lookupNestedNameSpecifier( "A" ); //$NON-NLS-1$ assertEquals( nsA, lookA ); - ISymbol look = lookA.lookupMemberForDefinition( "f1" ); + ISymbol look = lookA.lookupMemberForDefinition( "f1" ); //$NON-NLS-1$ assertEquals( look, null ); //but notice if you wanted to do A::f1 as a function call, it is ok - look = lookA.qualifiedLookup( "f1" ); + look = lookA.qualifiedLookup( "f1" ); //$NON-NLS-1$ assertEquals( look, f1 ); } @@ -1039,19 +1039,19 @@ public class ParserSymbolTableTest extends TestCase { IContainerSymbol compUnit = table.getCompilationUnit(); - IDerivableContainerSymbol B = table.newDerivableContainerSymbol("B"); + IDerivableContainerSymbol B = table.newDerivableContainerSymbol("B"); //$NON-NLS-1$ B.setType( TypeInfo.t_struct ); compUnit.addSymbol( B ); - IParameterizedSymbol f = table.newParameterizedSymbol("f"); + IParameterizedSymbol f = table.newParameterizedSymbol("f"); //$NON-NLS-1$ f.setType( TypeInfo.t_function ); B.addSymbol( f ); - IContainerSymbol E = table.newContainerSymbol( "E" ); + IContainerSymbol E = table.newContainerSymbol( "E" ); //$NON-NLS-1$ E.setType( TypeInfo.t_enumeration ); B.addSymbol( E ); - ISymbol e = table.newSymbol( "e" ); + ISymbol e = table.newSymbol( "e" ); //$NON-NLS-1$ e.setType( TypeInfo.t_enumerator ); E.addSymbol( e ); @@ -1059,36 +1059,36 @@ public class ParserSymbolTableTest extends TestCase { * TBD: Anonymous unions are not yet implemented */ - IDerivableContainerSymbol C = table.newDerivableContainerSymbol( "C" ); + IDerivableContainerSymbol C = table.newDerivableContainerSymbol( "C" ); //$NON-NLS-1$ C.setType( TypeInfo.t_class ); compUnit.addSymbol( C ); - IParameterizedSymbol g = table.newParameterizedSymbol( "g" ); + IParameterizedSymbol g = table.newParameterizedSymbol( "g" ); //$NON-NLS-1$ g.setType( TypeInfo.t_function ); C.addSymbol( g ); - IDerivableContainerSymbol D = table.newDerivableContainerSymbol( "D" ); + IDerivableContainerSymbol D = table.newDerivableContainerSymbol( "D" ); //$NON-NLS-1$ D.setType( TypeInfo.t_struct ); - ISymbol look = compUnit.lookup( "B" ); + ISymbol look = compUnit.lookup( "B" ); //$NON-NLS-1$ assertEquals( look, B ); D.addParent( B ); compUnit.addSymbol( D ); - IContainerSymbol lookB = D.lookupNestedNameSpecifier("B"); + IContainerSymbol lookB = D.lookupNestedNameSpecifier("B"); //$NON-NLS-1$ assertEquals( lookB, B ); - D.addUsingDeclaration( "f", lookB ); - D.addUsingDeclaration( "e", lookB ); + D.addUsingDeclaration( "f", lookB ); //$NON-NLS-1$ + D.addUsingDeclaration( "e", lookB ); //$NON-NLS-1$ //TBD anonymous union //D.addUsingDeclaration( "x", lookB ); - look = D.lookupNestedNameSpecifier("C"); + look = D.lookupNestedNameSpecifier("C"); //$NON-NLS-1$ assertEquals( look, C ); try{ - D.addUsingDeclaration( "g", C ); + D.addUsingDeclaration( "g", C ); //$NON-NLS-1$ assertTrue( false ); } catch ( ParserSymbolTableException exception ){ @@ -1125,35 +1125,35 @@ public class ParserSymbolTableTest extends TestCase { IContainerSymbol compUnit = table.getCompilationUnit(); - IContainerSymbol A = table.newContainerSymbol( "A", TypeInfo.t_namespace ); + IContainerSymbol A = table.newContainerSymbol( "A", TypeInfo.t_namespace ); //$NON-NLS-1$ compUnit.addSymbol( A ); - IParameterizedSymbol f1 = table.newParameterizedSymbol( "f", TypeInfo.t_function ); - f1.setReturnType( table.newSymbol( "", TypeInfo.t_void ) ); + IParameterizedSymbol f1 = table.newParameterizedSymbol( "f", TypeInfo.t_function ); //$NON-NLS-1$ + f1.setReturnType( table.newSymbol( "", TypeInfo.t_void ) ); //$NON-NLS-1$ f1.addParameter( TypeInfo.t_int, 0, null, false ); A.addSymbol( f1 ); - ISymbol look = compUnit.lookupNestedNameSpecifier("A"); + ISymbol look = compUnit.lookupNestedNameSpecifier("A"); //$NON-NLS-1$ assertEquals( look, A ); - IUsingDeclarationSymbol using = compUnit.addUsingDeclaration( "f", A ); + IUsingDeclarationSymbol using = compUnit.addUsingDeclaration( "f", A ); //$NON-NLS-1$ assertEquals( using.getReferencedSymbols().size(), 1 ); assertEquals( using.getReferencedSymbols().get(0), f1 ); IParameterizedSymbol usingF = (IParameterizedSymbol)using.getDeclaredSymbols().get(0); - look = compUnit.lookup("A"); + look = compUnit.lookup("A"); //$NON-NLS-1$ assertEquals( look, A ); - IParameterizedSymbol f2 = table.newParameterizedSymbol("f"); + IParameterizedSymbol f2 = table.newParameterizedSymbol("f"); //$NON-NLS-1$ f2.setType( TypeInfo.t_function ); - f2.setReturnType( table.newSymbol( "", TypeInfo.t_void ) ); + f2.setReturnType( table.newSymbol( "", TypeInfo.t_void ) ); //$NON-NLS-1$ f2.addParameter( TypeInfo.t_char, 0, null, false ); A.addSymbol( f2 ); - IParameterizedSymbol foo = table.newParameterizedSymbol("foo"); + IParameterizedSymbol foo = table.newParameterizedSymbol("foo"); //$NON-NLS-1$ foo.setType( TypeInfo.t_function ); compUnit.addSymbol( foo ); @@ -1161,19 +1161,19 @@ public class ParserSymbolTableTest extends TestCase { TypeInfo param = new TypeInfo( TypeInfo.t_char, 0, null ); paramList.add( param ); - look = foo.unqualifiedFunctionLookup( "f", paramList ); + look = foo.unqualifiedFunctionLookup( "f", paramList ); //$NON-NLS-1$ assertEquals( look, usingF ); assertTrue( usingF.hasSameParameters( f1 ) ); - IParameterizedSymbol bar = table.newParameterizedSymbol( "bar" ); + IParameterizedSymbol bar = table.newParameterizedSymbol( "bar" ); //$NON-NLS-1$ bar.setType( TypeInfo.t_function ); bar.addParameter( TypeInfo.t_char, 0, null, false ); compUnit.addSymbol( bar ); - look = bar.lookupNestedNameSpecifier( "A" ); + look = bar.lookupNestedNameSpecifier( "A" ); //$NON-NLS-1$ assertEquals( look, A ); - using = bar.addUsingDeclaration( "f", A ); + using = bar.addUsingDeclaration( "f", A ); //$NON-NLS-1$ List list = using.getReferencedSymbols(); assertTrue( list.contains( f1 ) ); @@ -1183,7 +1183,7 @@ public class ParserSymbolTableTest extends TestCase { int index = list.indexOf( f2 ); list = using.getDeclaredSymbols(); - look = bar.unqualifiedFunctionLookup( "f", paramList ); + look = bar.unqualifiedFunctionLookup( "f", paramList ); //$NON-NLS-1$ assertTrue( look != null ); assertEquals( look, list.get( index ) ); } @@ -1199,16 +1199,16 @@ public class ParserSymbolTableTest extends TestCase { public void testThisPointer() throws Exception{ newTable(); - IDerivableContainerSymbol cls = table.newDerivableContainerSymbol( "class", TypeInfo.t_class ); + IDerivableContainerSymbol cls = table.newDerivableContainerSymbol( "class", TypeInfo.t_class ); //$NON-NLS-1$ - IParameterizedSymbol fn = table.newParameterizedSymbol("function", TypeInfo.t_function ); + IParameterizedSymbol fn = table.newParameterizedSymbol("function", TypeInfo.t_function ); //$NON-NLS-1$ fn.setType( TypeInfo.t_function ); fn.getTypeInfo().setBit( true, TypeInfo.isConst ); table.getCompilationUnit().addSymbol( cls ); cls.addSymbol( fn ); - ISymbol look = fn.lookup("this"); + ISymbol look = fn.lookup("this"); //$NON-NLS-1$ assertTrue( look != null ); assertEquals( look.getType(), TypeInfo.t_type ); @@ -1230,20 +1230,20 @@ public class ParserSymbolTableTest extends TestCase { public void testEnumerator() throws Exception{ newTable(); - IContainerSymbol cls = table.newContainerSymbol("class"); + IContainerSymbol cls = table.newContainerSymbol("class"); //$NON-NLS-1$ cls.setType( TypeInfo.t_class ); - IContainerSymbol enumeration = table.newContainerSymbol("enumeration"); + IContainerSymbol enumeration = table.newContainerSymbol("enumeration"); //$NON-NLS-1$ enumeration.setType( TypeInfo.t_enumeration ); table.getCompilationUnit().addSymbol( cls ); cls.addSymbol( enumeration ); - ISymbol enumerator = table.newSymbol( "enumerator" ); + ISymbol enumerator = table.newSymbol( "enumerator" ); //$NON-NLS-1$ enumerator.setType( TypeInfo.t_enumerator ); enumeration.addSymbol( enumerator ); - ISymbol look = cls.lookup( "enumerator" ); + ISymbol look = cls.lookup( "enumerator" ); //$NON-NLS-1$ assertEquals( look, enumerator ); assertEquals( look.getContainingSymbol(), cls ); assertEquals( look.getTypeSymbol(), enumeration ); @@ -1267,48 +1267,48 @@ public class ParserSymbolTableTest extends TestCase { IContainerSymbol compUnit = table.getCompilationUnit(); - IContainerSymbol NS = table.newContainerSymbol("NS"); + IContainerSymbol NS = table.newContainerSymbol("NS"); //$NON-NLS-1$ NS.setType( TypeInfo.t_namespace ); compUnit.addSymbol( NS ); - IDerivableContainerSymbol T = table.newDerivableContainerSymbol("T"); + IDerivableContainerSymbol T = table.newDerivableContainerSymbol("T"); //$NON-NLS-1$ T.setType( TypeInfo.t_class ); NS.addSymbol( T ); - IParameterizedSymbol f = table.newParameterizedSymbol("f"); + IParameterizedSymbol f = table.newParameterizedSymbol("f"); //$NON-NLS-1$ f.setType( TypeInfo.t_function ); - f.setReturnType( table.newSymbol( "", TypeInfo.t_void ) ); + f.setReturnType( table.newSymbol( "", TypeInfo.t_void ) ); //$NON-NLS-1$ - ISymbol look = NS.lookup( "T" ); + ISymbol look = NS.lookup( "T" ); //$NON-NLS-1$ assertEquals( look, T ); f.addParameter( look, 0, null, false ); NS.addSymbol( f ); - look = compUnit.lookupNestedNameSpecifier( "NS" ); + look = compUnit.lookupNestedNameSpecifier( "NS" ); //$NON-NLS-1$ assertEquals( look, NS ); - look = NS.qualifiedLookup( "T" ); + look = NS.qualifiedLookup( "T" ); //$NON-NLS-1$ assertEquals( look, T ); - ISymbol param = table.newSymbol("parm"); + ISymbol param = table.newSymbol("parm"); //$NON-NLS-1$ param.setType( TypeInfo.t_type ); param.setTypeSymbol( look ); compUnit.addSymbol( param ); - IParameterizedSymbol main = table.newParameterizedSymbol("main"); + IParameterizedSymbol main = table.newParameterizedSymbol("main"); //$NON-NLS-1$ main.setType( TypeInfo.t_function ); - main.setReturnType( table.newSymbol( "", TypeInfo.t_int ) ); + main.setReturnType( table.newSymbol( "", TypeInfo.t_int ) ); //$NON-NLS-1$ compUnit.addSymbol( main ); ArrayList paramList = new ArrayList(); - look = main.lookup( "parm" ); + look = main.lookup( "parm" ); //$NON-NLS-1$ assertEquals( look, param ); TypeInfo p = new TypeInfo( TypeInfo.t_type, 0, look ); paramList.add( p ); - look = main.unqualifiedFunctionLookup( "f", paramList ); + look = main.unqualifiedFunctionLookup( "f", paramList ); //$NON-NLS-1$ assertEquals( look, f ); } @@ -1340,62 +1340,62 @@ public class ParserSymbolTableTest extends TestCase { IContainerSymbol compUnit = table.getCompilationUnit(); - IContainerSymbol NS1 = table.newContainerSymbol( "NS1" ); + IContainerSymbol NS1 = table.newContainerSymbol( "NS1" ); //$NON-NLS-1$ NS1.setType( TypeInfo.t_namespace ); compUnit.addSymbol( NS1 ); - IParameterizedSymbol f1 = table.newParameterizedSymbol( "f", TypeInfo.t_function ); - f1.setReturnType( table.newSymbol( "", TypeInfo.t_void ) ); + IParameterizedSymbol f1 = table.newParameterizedSymbol( "f", TypeInfo.t_function ); //$NON-NLS-1$ + f1.setReturnType( table.newSymbol( "", TypeInfo.t_void ) ); //$NON-NLS-1$ f1.addParameter( TypeInfo.t_void, 0, new PtrOp( PtrOp.t_pointer ), false ); NS1.addSymbol( f1 ); - IContainerSymbol NS2 = table.newContainerSymbol( "NS2" ); + IContainerSymbol NS2 = table.newContainerSymbol( "NS2" ); //$NON-NLS-1$ NS2.setType( TypeInfo.t_namespace ); compUnit.addSymbol( NS2 ); - ISymbol look = NS2.lookup( "NS1" ); + ISymbol look = NS2.lookup( "NS1" ); //$NON-NLS-1$ assertEquals( look, NS1 ); NS2.addUsingDirective( NS1 ); - IDerivableContainerSymbol B = table.newDerivableContainerSymbol( "B" ); + IDerivableContainerSymbol B = table.newDerivableContainerSymbol( "B" ); //$NON-NLS-1$ B.setType( TypeInfo.t_class ); NS2.addSymbol( B ); - IParameterizedSymbol f2 = table.newParameterizedSymbol( "f" ); + IParameterizedSymbol f2 = table.newParameterizedSymbol( "f" ); //$NON-NLS-1$ f2.setType( TypeInfo.t_function ); - f2.setReturnType( table.newSymbol( "", TypeInfo.t_void ) ); + f2.setReturnType( table.newSymbol( "", TypeInfo.t_void ) ); //$NON-NLS-1$ f2.addParameter( TypeInfo.t_void, 0, new PtrOp( PtrOp.t_pointer ), false ); NS2.addSymbol( f2 ); - IDerivableContainerSymbol A = table.newDerivableContainerSymbol( "A" ); + IDerivableContainerSymbol A = table.newDerivableContainerSymbol( "A" ); //$NON-NLS-1$ A.setType( TypeInfo.t_class ); - look = compUnit.lookupNestedNameSpecifier( "NS2" ); + look = compUnit.lookupNestedNameSpecifier( "NS2" ); //$NON-NLS-1$ assertEquals( look, NS2 ); - look = NS2.qualifiedLookup( "B" ); + look = NS2.qualifiedLookup( "B" ); //$NON-NLS-1$ assertEquals( look, B ); A.addParent( B ); compUnit.addSymbol( A ); - look = compUnit.lookup( "A" ); + look = compUnit.lookup( "A" ); //$NON-NLS-1$ assertEquals( look, A ); - ISymbol a = table.newSymbol( "a" ); + ISymbol a = table.newSymbol( "a" ); //$NON-NLS-1$ a.setType( TypeInfo.t_type ); a.setTypeSymbol( look ); compUnit.addSymbol( a ); ArrayList paramList = new ArrayList(); - look = compUnit.lookup( "a" ); + look = compUnit.lookup( "a" ); //$NON-NLS-1$ assertEquals( look, a ); TypeInfo param = new TypeInfo( look.getType(), 0, look, null, false ); //new PtrOp( PtrOp.t_reference ) param.addOperatorExpression( OperatorExpression.addressof ); paramList.add( param ); - look = compUnit.unqualifiedFunctionLookup( "f", paramList ); + look = compUnit.unqualifiedFunctionLookup( "f", paramList ); //$NON-NLS-1$ assertEquals( look, f2 ); } @@ -1424,41 +1424,41 @@ public class ParserSymbolTableTest extends TestCase { IContainerSymbol compUnit = table.getCompilationUnit(); - IDerivableContainerSymbol C = table.newDerivableContainerSymbol( "C" ); + IDerivableContainerSymbol C = table.newDerivableContainerSymbol( "C" ); //$NON-NLS-1$ C.setType( TypeInfo.t_class ); compUnit.addSymbol(C); - IParameterizedSymbol f1 = table.newParameterizedSymbol("foo"); + IParameterizedSymbol f1 = table.newParameterizedSymbol("foo"); //$NON-NLS-1$ f1.setType( TypeInfo.t_function ); - f1.setReturnType( table.newSymbol( "", TypeInfo.t_void ) ); + f1.setReturnType( table.newSymbol( "", TypeInfo.t_void ) ); //$NON-NLS-1$ f1.addParameter( TypeInfo.t_int, 0, null, false ); C.addSymbol( f1 ); - IParameterizedSymbol f2 = table.newParameterizedSymbol("foo"); + IParameterizedSymbol f2 = table.newParameterizedSymbol("foo"); //$NON-NLS-1$ f2.setType( TypeInfo.t_function ); - f2.setReturnType( table.newSymbol( "", TypeInfo.t_void ) ); + f2.setReturnType( table.newSymbol( "", TypeInfo.t_void ) ); //$NON-NLS-1$ f2.addParameter( TypeInfo.t_int, 0, null, false ); f2.addParameter( TypeInfo.t_char, 0, null, false ); C.addSymbol( f2 ); - IParameterizedSymbol f3 = table.newParameterizedSymbol("foo"); + IParameterizedSymbol f3 = table.newParameterizedSymbol("foo"); //$NON-NLS-1$ f3.setType( TypeInfo.t_function ); - f3.setReturnType( table.newSymbol( "", TypeInfo.t_void ) ); + f3.setReturnType( table.newSymbol( "", TypeInfo.t_void ) ); //$NON-NLS-1$ f3.addParameter( TypeInfo.t_int, 0, null, false ); f3.addParameter( TypeInfo.t_char, 0, null, false ); f3.addParameter( C, 0, new PtrOp( PtrOp.t_pointer ), false ); C.addSymbol( f3 ); - ISymbol look = compUnit.lookup("C"); + ISymbol look = compUnit.lookup("C"); //$NON-NLS-1$ assertEquals( look, C ); - ISymbol c = table.newSymbol("c"); + ISymbol c = table.newSymbol("c"); //$NON-NLS-1$ c.setType( TypeInfo.t_type ); c.setTypeSymbol( look ); c.addPtrOperator( new PtrOp( PtrOp.t_pointer, false, false ) ); compUnit.addSymbol( c ); - look = compUnit.lookup( "c" ); + look = compUnit.lookup( "c" ); //$NON-NLS-1$ assertEquals( look, c ); assertEquals( look.getTypeSymbol(), C ); @@ -1469,15 +1469,15 @@ public class ParserSymbolTableTest extends TestCase { TypeInfo p3 = new TypeInfo( TypeInfo.t_type, 0, c ); paramList.add( p1 ); - look = C.memberFunctionLookup( "foo", paramList ); + look = C.memberFunctionLookup( "foo", paramList ); //$NON-NLS-1$ assertEquals( look, f1 ); paramList.add( p2 ); - look = C.memberFunctionLookup( "foo", paramList ); + look = C.memberFunctionLookup( "foo", paramList ); //$NON-NLS-1$ assertEquals( look, f2 ); paramList.add( p3 ); - look = C.memberFunctionLookup( "foo", paramList ); + look = C.memberFunctionLookup( "foo", paramList ); //$NON-NLS-1$ assertEquals( look, f3 ); } @@ -1498,12 +1498,12 @@ public class ParserSymbolTableTest extends TestCase { IContainerSymbol compUnit = table.getCompilationUnit(); - IParameterizedSymbol f1 = table.newParameterizedSymbol("f"); + IParameterizedSymbol f1 = table.newParameterizedSymbol("f"); //$NON-NLS-1$ f1.setType( TypeInfo.t_function ); f1.addParameter( TypeInfo.t_int, 0, null, false ); compUnit.addSymbol( f1 ); - IParameterizedSymbol f2 = table.newParameterizedSymbol("f"); + IParameterizedSymbol f2 = table.newParameterizedSymbol("f"); //$NON-NLS-1$ f2.setType( TypeInfo.t_function ); f2.addParameter( TypeInfo.t_char, 0, null, true ); compUnit.addSymbol( f2 ); @@ -1512,22 +1512,22 @@ public class ParserSymbolTableTest extends TestCase { TypeInfo p1 = new TypeInfo( TypeInfo.t_int, 0, null ); paramList.add( p1 ); - ISymbol look = compUnit.unqualifiedFunctionLookup( "f", paramList ); + ISymbol look = compUnit.unqualifiedFunctionLookup( "f", paramList ); //$NON-NLS-1$ assertEquals( look, f1 ); paramList.clear(); TypeInfo p2 = new TypeInfo( TypeInfo.t_char, 0, null ); paramList.add( p2 ); - look = compUnit.unqualifiedFunctionLookup( "f", paramList ); + look = compUnit.unqualifiedFunctionLookup( "f", paramList ); //$NON-NLS-1$ assertEquals( look, f2 ); paramList.clear(); TypeInfo p3 = new TypeInfo( TypeInfo.t_bool, 0, null ); paramList.add( p3 ); - look = compUnit.unqualifiedFunctionLookup( "f", paramList ); + look = compUnit.unqualifiedFunctionLookup( "f", paramList ); //$NON-NLS-1$ assertEquals( look, f1 ); - look = compUnit.unqualifiedFunctionLookup( "f", null ); + look = compUnit.unqualifiedFunctionLookup( "f", null ); //$NON-NLS-1$ assertEquals( look, f2 ); } @@ -1553,36 +1553,36 @@ public class ParserSymbolTableTest extends TestCase { IContainerSymbol compUnit = table.getCompilationUnit(); - IDerivableContainerSymbol A = table.newDerivableContainerSymbol( "A" ); + IDerivableContainerSymbol A = table.newDerivableContainerSymbol( "A" ); //$NON-NLS-1$ A.setType( TypeInfo.t_class ); compUnit.addSymbol( A ); - IDerivableContainerSymbol B = table.newDerivableContainerSymbol( "B" ); + IDerivableContainerSymbol B = table.newDerivableContainerSymbol( "B" ); //$NON-NLS-1$ B.setType( TypeInfo.t_class ); B.addParent( A ); compUnit.addSymbol( B ); - IDerivableContainerSymbol C = table.newDerivableContainerSymbol( "C" ); + IDerivableContainerSymbol C = table.newDerivableContainerSymbol( "C" ); //$NON-NLS-1$ C.setType( TypeInfo.t_class ); C.addParent( B ); compUnit.addSymbol( C ); - IParameterizedSymbol f1 = table.newParameterizedSymbol( "f" ); + IParameterizedSymbol f1 = table.newParameterizedSymbol( "f" ); //$NON-NLS-1$ f1.setType( TypeInfo.t_function ); f1.addParameter( A, 0, new PtrOp( PtrOp.t_pointer ), false ); compUnit.addSymbol( f1 ); - IParameterizedSymbol f2 = table.newParameterizedSymbol( "f" ); + IParameterizedSymbol f2 = table.newParameterizedSymbol( "f" ); //$NON-NLS-1$ f2.setType( TypeInfo.t_function ); f2.addParameter( B, 0, new PtrOp( PtrOp.t_pointer ), false ); compUnit.addSymbol( f2 ); - ISymbol a = table.newSymbol( "a" ); + ISymbol a = table.newSymbol( "a" ); //$NON-NLS-1$ a.setType( TypeInfo.t_type ); a.setTypeSymbol( A ); a.addPtrOperator( new PtrOp( PtrOp.t_pointer, false, false ) ); - ISymbol c = table.newSymbol( "c" ); + ISymbol c = table.newSymbol( "c" ); //$NON-NLS-1$ c.setType( TypeInfo.t_type ); c.setTypeSymbol( C ); c.addPtrOperator( new PtrOp( PtrOp.t_pointer, false, false ) ); @@ -1590,13 +1590,13 @@ public class ParserSymbolTableTest extends TestCase { ArrayList paramList = new ArrayList(); TypeInfo p1 = new TypeInfo( TypeInfo.t_type, 0, a ); paramList.add( p1 ); - ISymbol look = compUnit.unqualifiedFunctionLookup( "f", paramList ); + ISymbol look = compUnit.unqualifiedFunctionLookup( "f", paramList ); //$NON-NLS-1$ assertEquals( look, f1 ); paramList.clear(); TypeInfo p2 = new TypeInfo( TypeInfo.t_type, 0, c ); paramList.add( p2 ); - look = compUnit.unqualifiedFunctionLookup( "f", paramList ); + look = compUnit.unqualifiedFunctionLookup( "f", paramList ); //$NON-NLS-1$ assertEquals( look, f2 ); } @@ -1625,38 +1625,38 @@ public class ParserSymbolTableTest extends TestCase { IContainerSymbol compUnit = table.getCompilationUnit(); - IDerivableContainerSymbol A = table.newDerivableContainerSymbol( "A" ); + IDerivableContainerSymbol A = table.newDerivableContainerSymbol( "A" ); //$NON-NLS-1$ A.setType( TypeInfo.t_class ); compUnit.addSymbol( A ); - ISymbol B = table.newSymbol( "B" ); + ISymbol B = table.newSymbol( "B" ); //$NON-NLS-1$ B.setType( TypeInfo.t_type ); B.setTypeSymbol( A ); B.getTypeInfo().setBit( true, TypeInfo.isTypedef ); B.addPtrOperator( new PtrOp( PtrOp.t_pointer, false, false ) ); compUnit.addSymbol( B ); - IParameterizedSymbol f1 = table.newParameterizedSymbol( "f" ); + IParameterizedSymbol f1 = table.newParameterizedSymbol( "f" ); //$NON-NLS-1$ f1.setType( TypeInfo.t_function ); f1.addParameter( A, 0, new PtrOp( PtrOp.t_pointer ), false ); compUnit.addSymbol( f1 ); - IParameterizedSymbol f2 = table.newParameterizedSymbol( "f" ); + IParameterizedSymbol f2 = table.newParameterizedSymbol( "f" ); //$NON-NLS-1$ f2.setType( TypeInfo.t_function ); f2.addParameter( A, 0, null, false ); compUnit.addSymbol( f2 ); - ISymbol a = table.newSymbol( "a" ); + ISymbol a = table.newSymbol( "a" ); //$NON-NLS-1$ a.setType( TypeInfo.t_type ); a.setTypeSymbol( A ); compUnit.addSymbol( a ); - ISymbol b = table.newSymbol( "b" ); + ISymbol b = table.newSymbol( "b" ); //$NON-NLS-1$ b.setType( TypeInfo.t_type ); b.setTypeSymbol( B ); compUnit.addSymbol( b ); - ISymbol array = table.newSymbol( "array" ); + ISymbol array = table.newSymbol( "array" ); //$NON-NLS-1$ array.setType( TypeInfo.t_type ); array.setTypeSymbol( A ); array.addPtrOperator( new PtrOp( PtrOp.t_array, false, false ) ); @@ -1665,25 +1665,25 @@ public class ParserSymbolTableTest extends TestCase { TypeInfo p = new TypeInfo( TypeInfo.t_type, 0, a ); paramList.add( p ); - ISymbol look = compUnit.unqualifiedFunctionLookup( "f", paramList ); + ISymbol look = compUnit.unqualifiedFunctionLookup( "f", paramList ); //$NON-NLS-1$ assertEquals( look, f2 ); p.addOperatorExpression( OperatorExpression.addressof ); - look = compUnit.unqualifiedFunctionLookup( "f", paramList ); + look = compUnit.unqualifiedFunctionLookup( "f", paramList ); //$NON-NLS-1$ assertEquals( look, f1 ); p.setTypeSymbol( b ); p.getOperatorExpressions().clear(); - look = compUnit.unqualifiedFunctionLookup( "f", paramList ); + look = compUnit.unqualifiedFunctionLookup( "f", paramList ); //$NON-NLS-1$ assertEquals( look, f1 ); p.addOperatorExpression( OperatorExpression.indirection ); - look = compUnit.unqualifiedFunctionLookup( "f", paramList ); + look = compUnit.unqualifiedFunctionLookup( "f", paramList ); //$NON-NLS-1$ assertEquals( look, f2 ); p.setTypeSymbol( array ); p.getOperatorExpressions().clear(); - look = compUnit.unqualifiedFunctionLookup( "f", paramList ); + look = compUnit.unqualifiedFunctionLookup( "f", paramList ); //$NON-NLS-1$ assertEquals( look, f1 ); } @@ -1709,25 +1709,25 @@ public class ParserSymbolTableTest extends TestCase { IContainerSymbol compUnit = table.getCompilationUnit(); - IDerivableContainerSymbol A = table.newDerivableContainerSymbol( "A" ); + IDerivableContainerSymbol A = table.newDerivableContainerSymbol( "A" ); //$NON-NLS-1$ A.setType( TypeInfo.t_class ); compUnit.addSymbol( A ); - IDerivableContainerSymbol B = table.newDerivableContainerSymbol( "B" ); + IDerivableContainerSymbol B = table.newDerivableContainerSymbol( "B" ); //$NON-NLS-1$ B.setType( TypeInfo.t_class ); compUnit.addSymbol( B ); - IParameterizedSymbol constructor = table.newParameterizedSymbol("B"); + IParameterizedSymbol constructor = table.newParameterizedSymbol("B"); //$NON-NLS-1$ constructor.setType( TypeInfo.t_constructor ); constructor.addParameter( A, 0, null, false ); B.addConstructor( constructor ); - IParameterizedSymbol f = table.newParameterizedSymbol( "f" ); + IParameterizedSymbol f = table.newParameterizedSymbol( "f" ); //$NON-NLS-1$ f.setType( TypeInfo.t_function ); f.addParameter( B, 0, null, false ); compUnit.addSymbol( f ); - ISymbol a = table.newSymbol( "a" ); + ISymbol a = table.newSymbol( "a" ); //$NON-NLS-1$ a.setType( TypeInfo.t_type ); a.setTypeSymbol( A ); compUnit.addSymbol( a ); @@ -1736,7 +1736,7 @@ public class ParserSymbolTableTest extends TestCase { TypeInfo p = new TypeInfo( TypeInfo.t_type, 0, a ); paramList.add( p ); - ISymbol look = compUnit.unqualifiedFunctionLookup( "f", paramList ); + ISymbol look = compUnit.unqualifiedFunctionLookup( "f", paramList ); //$NON-NLS-1$ assertEquals( look, f ); } @@ -1766,29 +1766,29 @@ public class ParserSymbolTableTest extends TestCase { IContainerSymbol compUnit = table.getCompilationUnit(); - IParameterizedSymbol f1 = table.newParameterizedSymbol( "f" ); + IParameterizedSymbol f1 = table.newParameterizedSymbol( "f" ); //$NON-NLS-1$ f1.setType( TypeInfo.t_function ); f1.addParameter( TypeInfo.t_int, TypeInfo.isConst, new PtrOp( PtrOp.t_pointer, false, false ), false ); f1.addParameter( TypeInfo.t_int, TypeInfo.isShort, null, false ); compUnit.addSymbol( f1 ); - IParameterizedSymbol f2 = table.newParameterizedSymbol( "f" ); + IParameterizedSymbol f2 = table.newParameterizedSymbol( "f" ); //$NON-NLS-1$ f2.setType( TypeInfo.t_function ); f2.addParameter( TypeInfo.t_int, 0, new PtrOp( PtrOp.t_pointer ), false ); f2.addParameter( TypeInfo.t_int, 0, null, false ); compUnit.addSymbol( f2 ); - ISymbol i = table.newSymbol( "i" ); + ISymbol i = table.newSymbol( "i" ); //$NON-NLS-1$ i.setType( TypeInfo.t_int ); compUnit.addSymbol( i ); - ISymbol s = table.newSymbol( "s" ); + ISymbol s = table.newSymbol( "s" ); //$NON-NLS-1$ s.setType( TypeInfo.t_int ); s.getTypeInfo().setBit( true, TypeInfo.isShort ); compUnit.addSymbol( s ); - IParameterizedSymbol main = table.newParameterizedSymbol( "main" ); + IParameterizedSymbol main = table.newParameterizedSymbol( "main" ); //$NON-NLS-1$ main.setType( TypeInfo.t_function ); compUnit.addSymbol( main ); @@ -1802,7 +1802,7 @@ public class ParserSymbolTableTest extends TestCase { ISymbol look = null; try{ - look = main.unqualifiedFunctionLookup( "f", params ); + look = main.unqualifiedFunctionLookup( "f", params ); //$NON-NLS-1$ assertTrue( false ); } catch ( ParserSymbolTableException e ){ assertEquals( e.reason, ParserSymbolTableException.r_Ambiguous ); @@ -1812,14 +1812,14 @@ public class ParserSymbolTableTest extends TestCase { TypeInfo p3 = new TypeInfo( TypeInfo.t_int, TypeInfo.isLong, null ); params.add( p1 ); params.add( p3 ); - look = main.unqualifiedFunctionLookup( "f", params ); + look = main.unqualifiedFunctionLookup( "f", params ); //$NON-NLS-1$ assertEquals( look, f2 ); params.clear(); TypeInfo p4 = new TypeInfo( TypeInfo.t_char, 0, null ); params.add( p1 ); params.add( p4 ); - look = main.unqualifiedFunctionLookup( "f", params ); + look = main.unqualifiedFunctionLookup( "f", params ); //$NON-NLS-1$ assertEquals( look, f2 ); params.clear(); @@ -1827,7 +1827,7 @@ public class ParserSymbolTableTest extends TestCase { params.add( p1 ); params.add( p3 ); - look = main.unqualifiedFunctionLookup( "f", params ); + look = main.unqualifiedFunctionLookup( "f", params ); //$NON-NLS-1$ assertEquals( look, f1 ); } @@ -1860,30 +1860,30 @@ public class ParserSymbolTableTest extends TestCase { IContainerSymbol compUnit = table.getCompilationUnit(); - IDerivableContainerSymbol B = table.newDerivableContainerSymbol( "B" ); + IDerivableContainerSymbol B = table.newDerivableContainerSymbol( "B" ); //$NON-NLS-1$ B.setType( TypeInfo.t_class ); compUnit.addSymbol( B ); - IDerivableContainerSymbol A = table.newDerivableContainerSymbol( "A" ); + IDerivableContainerSymbol A = table.newDerivableContainerSymbol( "A" ); //$NON-NLS-1$ A.setType( TypeInfo.t_class ); compUnit.addSymbol( A ); - IParameterizedSymbol constructA = table.newParameterizedSymbol( "A" ); + IParameterizedSymbol constructA = table.newParameterizedSymbol( "A" ); //$NON-NLS-1$ constructA.setType( TypeInfo.t_constructor ); constructA.addParameter( B, 0, new PtrOp( PtrOp.t_reference ), false ); A.addConstructor( constructA ); - IParameterizedSymbol operator = table.newParameterizedSymbol( "operator A" ); + IParameterizedSymbol operator = table.newParameterizedSymbol( "operator A" ); //$NON-NLS-1$ operator.setType( TypeInfo.t_function ); B.addSymbol( operator ); - IParameterizedSymbol f1 = table.newParameterizedSymbol( "f" ); + IParameterizedSymbol f1 = table.newParameterizedSymbol( "f" ); //$NON-NLS-1$ f1.setType( TypeInfo.t_function ); f1.addParameter( A, 0, null, false ); compUnit.addSymbol( f1 ); - ISymbol b = table.newSymbol( "b" ); + ISymbol b = table.newSymbol( "b" ); //$NON-NLS-1$ b.setType( TypeInfo.t_type ); b.setTypeSymbol( B ); @@ -1894,39 +1894,39 @@ public class ParserSymbolTableTest extends TestCase { ISymbol look = null; try{ - look = compUnit.unqualifiedFunctionLookup( "f", params ); + look = compUnit.unqualifiedFunctionLookup( "f", params ); //$NON-NLS-1$ assertTrue( false ); } catch( ParserSymbolTableException e ){ assertEquals( e.reason, ParserSymbolTableException.r_Ambiguous ); } - IDerivableContainerSymbol C = table.newDerivableContainerSymbol("C"); + IDerivableContainerSymbol C = table.newDerivableContainerSymbol("C"); //$NON-NLS-1$ C.setType( TypeInfo.t_class ); compUnit.addSymbol( C ); - IParameterizedSymbol constructC = table.newParameterizedSymbol("C"); + IParameterizedSymbol constructC = table.newParameterizedSymbol("C"); //$NON-NLS-1$ constructC.setType( TypeInfo.t_constructor ); constructC.addParameter( B, 0, new PtrOp( PtrOp.t_reference ), false ); C.addConstructor( constructC ); - IParameterizedSymbol f2 = table.newParameterizedSymbol( "f" ); + IParameterizedSymbol f2 = table.newParameterizedSymbol( "f" ); //$NON-NLS-1$ f2.setType( TypeInfo.t_function ); f2.addParameter( C, 0, null, false ); compUnit.addSymbol( f2 ); try{ - look = compUnit.unqualifiedFunctionLookup( "f", params ); + look = compUnit.unqualifiedFunctionLookup( "f", params ); //$NON-NLS-1$ assertTrue( false ); } catch( ParserSymbolTableException e ){ assertEquals( e.reason, ParserSymbolTableException.r_Ambiguous ); } - IParameterizedSymbol f3 = table.newParameterizedSymbol( "f" ); + IParameterizedSymbol f3 = table.newParameterizedSymbol( "f" ); //$NON-NLS-1$ f3.setType( TypeInfo.t_function ); f3.addParameter( B, 0, null, false ); compUnit.addSymbol( f3 ); - look = compUnit.unqualifiedFunctionLookup( "f", params ); + look = compUnit.unqualifiedFunctionLookup( "f", params ); //$NON-NLS-1$ assertEquals( look, f3 ); } @@ -1993,20 +1993,20 @@ public class ParserSymbolTableTest extends TestCase { public void testForwardClassDeclaration() throws Exception{ newTable(); - ISymbol forwardSymbol = table.newDerivableContainerSymbol( "A", TypeInfo.t_class ); + ISymbol forwardSymbol = table.newDerivableContainerSymbol( "A", TypeInfo.t_class ); //$NON-NLS-1$ forwardSymbol.setIsForwardDeclaration( true ); table.getCompilationUnit().addSymbol( forwardSymbol ); /*...*/ - ISymbol lookup = table.getCompilationUnit().lookup( "A" ); - ISymbol otherLookup = table.getCompilationUnit().elaboratedLookup( TypeInfo.t_class, "A" ); + ISymbol lookup = table.getCompilationUnit().lookup( "A" ); //$NON-NLS-1$ + ISymbol otherLookup = table.getCompilationUnit().elaboratedLookup( TypeInfo.t_class, "A" ); //$NON-NLS-1$ assertEquals( lookup, otherLookup ); assertEquals( lookup, forwardSymbol ); - ISymbol a = table.newSymbol( "a", TypeInfo.t_type ); + ISymbol a = table.newSymbol( "a", TypeInfo.t_type ); //$NON-NLS-1$ a.setTypeSymbol( forwardSymbol ); a.addPtrOperator( new PtrOp( PtrOp.t_pointer ) ); @@ -2014,21 +2014,21 @@ public class ParserSymbolTableTest extends TestCase { /*...*/ - lookup = table.getCompilationUnit().lookup( "A" ); - IDerivableContainerSymbol classA = table.newDerivableContainerSymbol( "A", TypeInfo.t_class ); + lookup = table.getCompilationUnit().lookup( "A" ); //$NON-NLS-1$ + IDerivableContainerSymbol classA = table.newDerivableContainerSymbol( "A", TypeInfo.t_class ); //$NON-NLS-1$ assertTrue( lookup.isForwardDeclaration() ); lookup.setTypeSymbol( classA ); table.getCompilationUnit().addSymbol( classA ); - lookup = table.getCompilationUnit().lookup( "a" ); + lookup = table.getCompilationUnit().lookup( "a" ); //$NON-NLS-1$ assertEquals( lookup, a ); assertEquals( a.getTypeSymbol(), classA ); - lookup = table.getCompilationUnit().lookup( "A" ); + lookup = table.getCompilationUnit().lookup( "A" ); //$NON-NLS-1$ assertEquals( lookup, classA ); - lookup = table.getCompilationUnit().elaboratedLookup( TypeInfo.t_class, "A" ); + lookup = table.getCompilationUnit().elaboratedLookup( TypeInfo.t_class, "A" ); //$NON-NLS-1$ assertEquals( lookup, classA ); } @@ -2057,22 +2057,22 @@ public class ParserSymbolTableTest extends TestCase { public void testForwardDeclarationUsedAsFunctionParam() throws Exception{ newTable(); - ISymbol forwardSymbol = table.newDerivableContainerSymbol( "A", TypeInfo.t_class ); + ISymbol forwardSymbol = table.newDerivableContainerSymbol( "A", TypeInfo.t_class ); //$NON-NLS-1$ forwardSymbol.setIsForwardDeclaration( true ); table.getCompilationUnit().addSymbol( forwardSymbol ); /*...*/ - IDerivableContainerSymbol classB = table.newDerivableContainerSymbol( "B", TypeInfo.t_class ); + IDerivableContainerSymbol classB = table.newDerivableContainerSymbol( "B", TypeInfo.t_class ); //$NON-NLS-1$ - IParameterizedSymbol fn1 = table.newParameterizedSymbol( "f", TypeInfo.t_function ); - ISymbol lookup = table.getCompilationUnit().lookup( "A" ); + IParameterizedSymbol fn1 = table.newParameterizedSymbol( "f", TypeInfo.t_function ); //$NON-NLS-1$ + ISymbol lookup = table.getCompilationUnit().lookup( "A" ); //$NON-NLS-1$ assertEquals( lookup, forwardSymbol ); fn1.addParameter( lookup, 0, new PtrOp( PtrOp.t_pointer ), false ); fn1.getTypeInfo().setBit( true, TypeInfo.isStatic ); classB.addSymbol( fn1 ); - IParameterizedSymbol fn2 = table.newParameterizedSymbol( "f", TypeInfo.t_function ); + IParameterizedSymbol fn2 = table.newParameterizedSymbol( "f", TypeInfo.t_function ); //$NON-NLS-1$ fn2.addParameter( TypeInfo.t_int, 0, null, false ); fn2.getTypeInfo().setBit( true, TypeInfo.isStatic ); classB.addSymbol( fn2 ); @@ -2081,8 +2081,8 @@ public class ParserSymbolTableTest extends TestCase { /*...*/ - ISymbol a1 = table.newSymbol( "a1", TypeInfo.t_type ); - lookup = table.getCompilationUnit().lookup( "A" ); + ISymbol a1 = table.newSymbol( "a1", TypeInfo.t_type ); //$NON-NLS-1$ + lookup = table.getCompilationUnit().lookup( "A" ); //$NON-NLS-1$ assertEquals( lookup, forwardSymbol ); a1.setTypeSymbol( lookup ); a1.addPtrOperator( new PtrOp( PtrOp.t_pointer ) ); @@ -2091,15 +2091,15 @@ public class ParserSymbolTableTest extends TestCase { /*...*/ - lookup = table.getCompilationUnit().lookup( "A" ); - IDerivableContainerSymbol classA = table.newDerivableContainerSymbol( "A", TypeInfo.t_class ); + lookup = table.getCompilationUnit().lookup( "A" ); //$NON-NLS-1$ + IDerivableContainerSymbol classA = table.newDerivableContainerSymbol( "A", TypeInfo.t_class ); //$NON-NLS-1$ assertTrue( lookup.isForwardDeclaration() ); lookup.setTypeSymbol( classA ); table.getCompilationUnit().addSymbol( classA ); /*..*/ - ISymbol a2 = table.newSymbol( "a2", TypeInfo.t_type ); - lookup = table.getCompilationUnit().lookup( "A" ); + ISymbol a2 = table.newSymbol( "a2", TypeInfo.t_type ); //$NON-NLS-1$ + lookup = table.getCompilationUnit().lookup( "A" ); //$NON-NLS-1$ assertEquals( lookup, classA ); a2.setTypeSymbol( lookup ); a2.addPtrOperator( new PtrOp( PtrOp.t_pointer ) ); @@ -2111,28 +2111,28 @@ public class ParserSymbolTableTest extends TestCase { ArrayList paramList = new ArrayList(); TypeInfo p1 = new TypeInfo( TypeInfo.t_type, 0, a1 ); paramList.add( p1 ); - ISymbol look = classB.memberFunctionLookup( "f", paramList ); + ISymbol look = classB.memberFunctionLookup( "f", paramList ); //$NON-NLS-1$ assertEquals( look, fn1 ); paramList.clear(); p1 = new TypeInfo( TypeInfo.t_type, 0, a2 ); paramList.add( p1 ); - look = classB.memberFunctionLookup( "f", paramList ); + look = classB.memberFunctionLookup( "f", paramList ); //$NON-NLS-1$ assertEquals( look, fn1 ); } public void testConstructors() throws Exception{ newTable(); - IDerivableContainerSymbol classA = table.newDerivableContainerSymbol( "A", TypeInfo.t_class ); + IDerivableContainerSymbol classA = table.newDerivableContainerSymbol( "A", TypeInfo.t_class ); //$NON-NLS-1$ - IParameterizedSymbol constructor1 = table.newParameterizedSymbol( "A", TypeInfo.t_constructor ); + IParameterizedSymbol constructor1 = table.newParameterizedSymbol( "A", TypeInfo.t_constructor ); //$NON-NLS-1$ constructor1.addParameter( classA, 0, new PtrOp( PtrOp.t_reference ), false ); - IParameterizedSymbol constructor2 = table.newParameterizedSymbol( "A", TypeInfo.t_constructor ); + IParameterizedSymbol constructor2 = table.newParameterizedSymbol( "A", TypeInfo.t_constructor ); //$NON-NLS-1$ constructor2.addParameter( TypeInfo.t_int, 0, null, false ); - IParameterizedSymbol constructor3 = table.newParameterizedSymbol( "A", TypeInfo.t_constructor ); + IParameterizedSymbol constructor3 = table.newParameterizedSymbol( "A", TypeInfo.t_constructor ); //$NON-NLS-1$ constructor3.addParameter( TypeInfo.t_char, 0, null, false ); classA.addConstructor( constructor1 ); @@ -2171,21 +2171,21 @@ public class ParserSymbolTableTest extends TestCase { public void testNamespaceAlias() throws Exception{ newTable(); - IContainerSymbol NSA = table.newContainerSymbol( "A", TypeInfo.t_namespace ); + IContainerSymbol NSA = table.newContainerSymbol( "A", TypeInfo.t_namespace ); //$NON-NLS-1$ table.getCompilationUnit().addSymbol( NSA ); - ISymbol x = table.newSymbol( "x", TypeInfo.t_int ); + ISymbol x = table.newSymbol( "x", TypeInfo.t_int ); //$NON-NLS-1$ NSA.addSymbol( x ); - IContainerSymbol NSB = table.newContainerSymbol( "B", TypeInfo.t_namespace ); + IContainerSymbol NSB = table.newContainerSymbol( "B", TypeInfo.t_namespace ); //$NON-NLS-1$ NSB.setTypeSymbol( NSA ); //alias B to A table.getCompilationUnit().addSymbol( NSB ); - ISymbol lookup = table.getCompilationUnit().lookup( "B" ); + ISymbol lookup = table.getCompilationUnit().lookup( "B" ); //$NON-NLS-1$ assertEquals( lookup, NSB ); - lookup = NSB.lookup( "x" ); + lookup = NSB.lookup( "x" ); //$NON-NLS-1$ assertEquals( lookup, x ); } @@ -2206,26 +2206,26 @@ public class ParserSymbolTableTest extends TestCase { public void testUsingNamespaceAlias() throws Exception{ newTable(); - IContainerSymbol NSA = table.newContainerSymbol( "A", TypeInfo.t_namespace ); + IContainerSymbol NSA = table.newContainerSymbol( "A", TypeInfo.t_namespace ); //$NON-NLS-1$ table.getCompilationUnit().addSymbol( NSA ); - IParameterizedSymbol f = table.newParameterizedSymbol( "f", TypeInfo.t_function ); - f.setReturnType( table.newSymbol( "", TypeInfo.t_void ) ); + IParameterizedSymbol f = table.newParameterizedSymbol( "f", TypeInfo.t_function ); //$NON-NLS-1$ + f.setReturnType( table.newSymbol( "", TypeInfo.t_void ) ); //$NON-NLS-1$ NSA.addSymbol( f ); - IContainerSymbol NSB = table.newContainerSymbol( "B", TypeInfo.t_namespace ); + IContainerSymbol NSB = table.newContainerSymbol( "B", TypeInfo.t_namespace ); //$NON-NLS-1$ NSB.setTypeSymbol( NSA ); table.getCompilationUnit().addSymbol( NSB ); //look for function that has no parameters ArrayList paramList = new ArrayList(); - ISymbol look = NSB.qualifiedFunctionLookup( "f", paramList ); + ISymbol look = NSB.qualifiedFunctionLookup( "f", paramList ); //$NON-NLS-1$ assertEquals( look, f ); table.getCompilationUnit().addUsingDirective( NSB ); - look = table.getCompilationUnit().unqualifiedFunctionLookup( "f", paramList ); + look = table.getCompilationUnit().unqualifiedFunctionLookup( "f", paramList ); //$NON-NLS-1$ assertEquals( look, f ); } @@ -2240,10 +2240,10 @@ public class ParserSymbolTableTest extends TestCase { public void testBadParameterInfo() throws Exception{ newTable(); - IParameterizedSymbol f = table.newParameterizedSymbol( "f", TypeInfo.t_function ); - f.setReturnType( table.newSymbol( "", TypeInfo.t_void ) ); + IParameterizedSymbol f = table.newParameterizedSymbol( "f", TypeInfo.t_function ); //$NON-NLS-1$ + f.setReturnType( table.newSymbol( "", TypeInfo.t_void ) ); //$NON-NLS-1$ - IDerivableContainerSymbol a = table.newDerivableContainerSymbol( "A", TypeInfo.t_class ); + IDerivableContainerSymbol a = table.newDerivableContainerSymbol( "A", TypeInfo.t_class ); //$NON-NLS-1$ table.getCompilationUnit().addSymbol( a ); f.addParameter( a, 0, null, false ); @@ -2256,15 +2256,15 @@ public class ParserSymbolTableTest extends TestCase { paramList.add( param ); - ISymbol look = table.getCompilationUnit().unqualifiedFunctionLookup( "f", paramList ); + ISymbol look = table.getCompilationUnit().unqualifiedFunctionLookup( "f", paramList ); //$NON-NLS-1$ assertEquals( look, null ); - ISymbol intermediate = table.newSymbol( "", TypeInfo.t_type ); + ISymbol intermediate = table.newSymbol( "", TypeInfo.t_type ); //$NON-NLS-1$ param.setTypeSymbol( intermediate ); - look = table.getCompilationUnit().unqualifiedFunctionLookup( "f", paramList ); + look = table.getCompilationUnit().unqualifiedFunctionLookup( "f", paramList ); //$NON-NLS-1$ assertEquals( look, null ); } @@ -2287,18 +2287,18 @@ public class ParserSymbolTableTest extends TestCase { public void testGetConditionalOperand_bug43106() throws Exception{ newTable(); - IDerivableContainerSymbol clsA = table.newDerivableContainerSymbol( "A", TypeInfo.t_class ); - IDerivableContainerSymbol clsB = table.newDerivableContainerSymbol( "B", TypeInfo.t_class ); + IDerivableContainerSymbol clsA = table.newDerivableContainerSymbol( "A", TypeInfo.t_class ); //$NON-NLS-1$ + IDerivableContainerSymbol clsB = table.newDerivableContainerSymbol( "B", TypeInfo.t_class ); //$NON-NLS-1$ clsB.addParent( clsA ); table.getCompilationUnit().addSymbol( clsA ); table.getCompilationUnit().addSymbol( clsB ); - ISymbol a = table.newSymbol( "a", TypeInfo.t_type ); + ISymbol a = table.newSymbol( "a", TypeInfo.t_type ); //$NON-NLS-1$ a.setTypeSymbol( clsA ); - ISymbol b = table.newSymbol( "b", TypeInfo.t_type ); + ISymbol b = table.newSymbol( "b", TypeInfo.t_type ); //$NON-NLS-1$ b.setTypeSymbol( clsB ); table.getCompilationUnit().addSymbol( a ); @@ -2312,9 +2312,9 @@ public class ParserSymbolTableTest extends TestCase { TypeInfo returned = ParserSymbolTable.getConditionalOperand( secondOp, thirdOp ); assertEquals( returned, secondOp ); - IDerivableContainerSymbol clsC = table.newDerivableContainerSymbol( "C", TypeInfo.t_class ); + IDerivableContainerSymbol clsC = table.newDerivableContainerSymbol( "C", TypeInfo.t_class ); //$NON-NLS-1$ table.getCompilationUnit().addSymbol( clsC ); - ISymbol c = table.newSymbol( "c", TypeInfo.t_type ); + ISymbol c = table.newSymbol( "c", TypeInfo.t_type ); //$NON-NLS-1$ c.setTypeSymbol( clsC ); table.getCompilationUnit().addSymbol( c ); @@ -2324,11 +2324,11 @@ public class ParserSymbolTableTest extends TestCase { returned = ParserSymbolTable.getConditionalOperand( secondOp, anotherOp ); assertEquals( returned, null ); - IParameterizedSymbol constructorA = table.newParameterizedSymbol( "A", TypeInfo.t_constructor ); + IParameterizedSymbol constructorA = table.newParameterizedSymbol( "A", TypeInfo.t_constructor ); //$NON-NLS-1$ constructorA.addParameter( clsC, 0, null, false ); clsA.addConstructor( constructorA ); - IParameterizedSymbol constructorC = table.newParameterizedSymbol( "C", TypeInfo.t_constructor ); + IParameterizedSymbol constructorC = table.newParameterizedSymbol( "C", TypeInfo.t_constructor ); //$NON-NLS-1$ constructorC.addParameter( clsA, 0, null, false ); clsC.addConstructor( constructorC ); @@ -2361,17 +2361,17 @@ public class ParserSymbolTableTest extends TestCase { public void testDerivedReference() throws Exception{ newTable(); - IDerivableContainerSymbol clsA = table.newDerivableContainerSymbol( "A", TypeInfo.t_class ); - IDerivableContainerSymbol clsB = table.newDerivableContainerSymbol( "B", TypeInfo.t_class ); - IDerivableContainerSymbol clsC = table.newDerivableContainerSymbol( "C", TypeInfo.t_class ); + IDerivableContainerSymbol clsA = table.newDerivableContainerSymbol( "A", TypeInfo.t_class ); //$NON-NLS-1$ + IDerivableContainerSymbol clsB = table.newDerivableContainerSymbol( "B", TypeInfo.t_class ); //$NON-NLS-1$ + IDerivableContainerSymbol clsC = table.newDerivableContainerSymbol( "C", TypeInfo.t_class ); //$NON-NLS-1$ clsB.addParent( clsA ); clsC.addParent( clsA, false, ASTAccessVisibility.PRIVATE, 0, null ); - ISymbol b = table.newSymbol("b", TypeInfo.t_type ); + ISymbol b = table.newSymbol("b", TypeInfo.t_type ); //$NON-NLS-1$ b.setTypeSymbol( clsB ); - ISymbol c = table.newSymbol("c", TypeInfo.t_type ); + ISymbol c = table.newSymbol("c", TypeInfo.t_type ); //$NON-NLS-1$ c.setTypeSymbol( clsC ); table.getCompilationUnit().addSymbol( clsA ); @@ -2380,7 +2380,7 @@ public class ParserSymbolTableTest extends TestCase { table.getCompilationUnit().addSymbol( b ); table.getCompilationUnit().addSymbol( c ); - IParameterizedSymbol f1 = table.newParameterizedSymbol( "f", TypeInfo.t_function ); + IParameterizedSymbol f1 = table.newParameterizedSymbol( "f", TypeInfo.t_function ); //$NON-NLS-1$ f1.addParameter( clsA, 0, new PtrOp( PtrOp.t_reference ), false ); table.getCompilationUnit().addSymbol( f1 ); @@ -2388,21 +2388,21 @@ public class ParserSymbolTableTest extends TestCase { TypeInfo param = new TypeInfo( TypeInfo.t_type, 0, b ); parameters.add( param ); - ISymbol look = table.getCompilationUnit().unqualifiedFunctionLookup( "f", parameters ); + ISymbol look = table.getCompilationUnit().unqualifiedFunctionLookup( "f", parameters ); //$NON-NLS-1$ assertEquals( look, f1 ); - IParameterizedSymbol f2 = table.newParameterizedSymbol( "f", TypeInfo.t_function ); + IParameterizedSymbol f2 = table.newParameterizedSymbol( "f", TypeInfo.t_function ); //$NON-NLS-1$ f2.addParameter( clsB, 0, new PtrOp( PtrOp.t_reference ), false ); table.getCompilationUnit().addSymbol( f2 ); - look = table.getCompilationUnit().unqualifiedFunctionLookup( "f", parameters ); + look = table.getCompilationUnit().unqualifiedFunctionLookup( "f", parameters ); //$NON-NLS-1$ assertEquals( look, f2 ); parameters.clear(); param = new TypeInfo( TypeInfo.t_type, 0, c ); parameters.add( param ); try{ - look = table.getCompilationUnit().unqualifiedFunctionLookup( "f", parameters ); + look = table.getCompilationUnit().unqualifiedFunctionLookup( "f", parameters ); //$NON-NLS-1$ assertTrue( false ); } catch ( ParserSymbolTableException e ){ //good @@ -2434,18 +2434,18 @@ public class ParserSymbolTableTest extends TestCase { public void testAddCopyConstructor() throws Exception { newTable(); - IDerivableContainerSymbol clsA = table.newDerivableContainerSymbol( "A", TypeInfo.t_class ); + IDerivableContainerSymbol clsA = table.newDerivableContainerSymbol( "A", TypeInfo.t_class ); //$NON-NLS-1$ table.getCompilationUnit().addSymbol( clsA ); - ISymbol a = table.newSymbol( "a", TypeInfo.t_type ); + ISymbol a = table.newSymbol( "a", TypeInfo.t_type ); //$NON-NLS-1$ a.setTypeSymbol( clsA ); table.getCompilationUnit().addSymbol( a ); - IDerivableContainerSymbol clsB = table.newDerivableContainerSymbol( "B", TypeInfo.t_class ); + IDerivableContainerSymbol clsB = table.newDerivableContainerSymbol( "B", TypeInfo.t_class ); //$NON-NLS-1$ clsB.addParent( clsA ); table.getCompilationUnit().addSymbol( clsB ); - ISymbol b = table.newSymbol( "b", TypeInfo.t_type ); + ISymbol b = table.newSymbol( "b", TypeInfo.t_type ); //$NON-NLS-1$ b.setTypeSymbol( clsB ); table.getCompilationUnit().addSymbol( b ); @@ -2465,7 +2465,7 @@ public class ParserSymbolTableTest extends TestCase { public void testbug43834() throws Exception{ newTable(); - IParameterizedSymbol f = table.newParameterizedSymbol( "f", TypeInfo.t_function ); + IParameterizedSymbol f = table.newParameterizedSymbol( "f", TypeInfo.t_function ); //$NON-NLS-1$ table.getCompilationUnit().addSymbol( f ); ArrayList parameters = new ArrayList(); @@ -2473,14 +2473,14 @@ public class ParserSymbolTableTest extends TestCase { parameters.add( param ); - ISymbol look = table.getCompilationUnit().unqualifiedFunctionLookup( "f", parameters ); + ISymbol look = table.getCompilationUnit().unqualifiedFunctionLookup( "f", parameters ); //$NON-NLS-1$ assertEquals( look, f ); f.addParameter( TypeInfo.t_void, 0, null, false ); parameters.clear(); - look = table.getCompilationUnit().unqualifiedFunctionLookup( "f", parameters ); + look = table.getCompilationUnit().unqualifiedFunctionLookup( "f", parameters ); //$NON-NLS-1$ assertEquals( look, f ); } @@ -2500,25 +2500,25 @@ public class ParserSymbolTableTest extends TestCase { */ public void testBug43503_AmbiguousUsing() throws Exception{ newTable(); - IContainerSymbol NSA = table.newContainerSymbol( "A", TypeInfo.t_namespace ); + IContainerSymbol NSA = table.newContainerSymbol( "A", TypeInfo.t_namespace ); //$NON-NLS-1$ table.getCompilationUnit().addSymbol( NSA ); - IParameterizedSymbol f1 = table.newParameterizedSymbol( "f", TypeInfo.t_function ); + IParameterizedSymbol f1 = table.newParameterizedSymbol( "f", TypeInfo.t_function ); //$NON-NLS-1$ NSA.addSymbol( f1 ); - IContainerSymbol NSB = table.newContainerSymbol( "B", TypeInfo.t_namespace ); + IContainerSymbol NSB = table.newContainerSymbol( "B", TypeInfo.t_namespace ); //$NON-NLS-1$ table.getCompilationUnit().addSymbol( NSB ); - ISymbol f2 = table.newSymbol( "f", TypeInfo.t_int ); + ISymbol f2 = table.newSymbol( "f", TypeInfo.t_int ); //$NON-NLS-1$ NSB.addSymbol( f2 ); - IContainerSymbol NSC = table.newContainerSymbol( "C", TypeInfo.t_namespace ); + IContainerSymbol NSC = table.newContainerSymbol( "C", TypeInfo.t_namespace ); //$NON-NLS-1$ table.getCompilationUnit().addSymbol( NSC ); NSC.addUsingDirective( NSA ); NSC.addUsingDirective( NSB ); try{ - NSC.addUsingDeclaration( "f" ); + NSC.addUsingDeclaration( "f" ); //$NON-NLS-1$ assertTrue( false ); } catch ( ParserSymbolTableException e ){ assertEquals( e.reason, ParserSymbolTableException.r_Ambiguous ); @@ -2535,16 +2535,16 @@ public class ParserSymbolTableTest extends TestCase { public void testBug43503_UnableToResolveFunction() throws Exception{ newTable(); - IParameterizedSymbol f1 = table.newParameterizedSymbol( "f", TypeInfo.t_function ); + IParameterizedSymbol f1 = table.newParameterizedSymbol( "f", TypeInfo.t_function ); //$NON-NLS-1$ - IParameterizedSymbol f2 = table.newParameterizedSymbol( "f", TypeInfo.t_function ); + IParameterizedSymbol f2 = table.newParameterizedSymbol( "f", TypeInfo.t_function ); //$NON-NLS-1$ f2.addParameter( TypeInfo.t_int, 0, null, false ); table.getCompilationUnit().addSymbol( f1 ); table.getCompilationUnit().addSymbol( f2 ); try{ - table.getCompilationUnit().lookup( "f" ); + table.getCompilationUnit().lookup( "f" ); //$NON-NLS-1$ assertTrue( false ); } catch( ParserSymbolTableException e ){ assertEquals( e.reason, ParserSymbolTableException.r_UnableToResolveFunction ); @@ -2565,13 +2565,13 @@ public class ParserSymbolTableTest extends TestCase { public void testBug44510() throws Exception{ newTable(); - IParameterizedSymbol init1 = table.newParameterizedSymbol( "initialize", TypeInfo.t_function ); + IParameterizedSymbol init1 = table.newParameterizedSymbol( "initialize", TypeInfo.t_function ); //$NON-NLS-1$ table.getCompilationUnit().addSymbol( init1 ); - IParameterizedSymbol init2 = table.newParameterizedSymbol( "initialize", TypeInfo.t_function ); + IParameterizedSymbol init2 = table.newParameterizedSymbol( "initialize", TypeInfo.t_function ); //$NON-NLS-1$ - ISymbol look = table.getCompilationUnit().unqualifiedFunctionLookup( "initialize", new ArrayList() ); + ISymbol look = table.getCompilationUnit().unqualifiedFunctionLookup( "initialize", new ArrayList() ); //$NON-NLS-1$ assertEquals( look, init1 ); init1.getTypeInfo().setIsForwardDeclaration( true ); @@ -2579,7 +2579,7 @@ public class ParserSymbolTableTest extends TestCase { table.getCompilationUnit().addSymbol( init2 ); - look = table.getCompilationUnit().unqualifiedFunctionLookup( "initialize", new ArrayList() ); + look = table.getCompilationUnit().unqualifiedFunctionLookup( "initialize", new ArrayList() ); //$NON-NLS-1$ assertEquals( look, init2 ); } @@ -2600,34 +2600,34 @@ public class ParserSymbolTableTest extends TestCase { public void testBug46882() throws Exception{ newTable(); - IDerivableContainerSymbol A = table.newDerivableContainerSymbol( "A", TypeInfo.t_class ); + IDerivableContainerSymbol A = table.newDerivableContainerSymbol( "A", TypeInfo.t_class ); //$NON-NLS-1$ table.getCompilationUnit().addSymbol( A ); - IParameterizedSymbol f1 = table.newParameterizedSymbol( "f", TypeInfo.t_function ); + IParameterizedSymbol f1 = table.newParameterizedSymbol( "f", TypeInfo.t_function ); //$NON-NLS-1$ f1.addParameter( TypeInfo.t_int, 0, null, false ); A.addSymbol( f1 ); - IParameterizedSymbol f2 = table.newParameterizedSymbol( "f", TypeInfo.t_function ); + IParameterizedSymbol f2 = table.newParameterizedSymbol( "f", TypeInfo.t_function ); //$NON-NLS-1$ A.addSymbol( f2 ); - IDerivableContainerSymbol B = table.newDerivableContainerSymbol( "B", TypeInfo.t_class ); + IDerivableContainerSymbol B = table.newDerivableContainerSymbol( "B", TypeInfo.t_class ); //$NON-NLS-1$ B.addParent( A ); table.getCompilationUnit().addSymbol( B ); - IParameterizedSymbol f3 = table.newParameterizedSymbol( "f", TypeInfo.t_function ); + IParameterizedSymbol f3 = table.newParameterizedSymbol( "f", TypeInfo.t_function ); //$NON-NLS-1$ f3.addParameter( TypeInfo.t_char, 0, null, false ); B.addSymbol( f3 ); List params = new ArrayList(); params.add( new TypeInfo( TypeInfo.t_int, 0, null ) ); - ISymbol look = B.qualifiedFunctionLookup( "f", params ); + ISymbol look = B.qualifiedFunctionLookup( "f", params ); //$NON-NLS-1$ assertEquals( look, f3 ); params.clear(); - look = B.qualifiedFunctionLookup( "f", params ); + look = B.qualifiedFunctionLookup( "f", params ); //$NON-NLS-1$ assertEquals( look, null ); } @@ -2641,16 +2641,16 @@ public class ParserSymbolTableTest extends TestCase { public void testPrefixLookup_Unqualified() throws Exception { newTable( ParserLanguage.CPP, ParserMode.COMPLETION_PARSE ); - ISymbol aVar = table.newSymbol( "aVar", TypeInfo.t_int ); + ISymbol aVar = table.newSymbol( "aVar", TypeInfo.t_int ); //$NON-NLS-1$ table.getCompilationUnit().addSymbol( aVar ); - IParameterizedSymbol foo = table.newParameterizedSymbol( "foo", TypeInfo.t_function ); + IParameterizedSymbol foo = table.newParameterizedSymbol( "foo", TypeInfo.t_function ); //$NON-NLS-1$ table.getCompilationUnit().addSymbol( foo ); - ISymbol anotherVar = table.newSymbol( "anotherVar", TypeInfo.t_int ); + ISymbol anotherVar = table.newSymbol( "anotherVar", TypeInfo.t_int ); //$NON-NLS-1$ foo.addSymbol( anotherVar ); - List results = foo.prefixLookup( null, "a", false, null ); + List results = foo.prefixLookup( null, "a", false, null ); //$NON-NLS-1$ assertTrue( results != null ); assertEquals( results.size(), 2 ); @@ -2672,19 +2672,19 @@ public class ParserSymbolTableTest extends TestCase { public void testPrefixLookup_Qualified() throws Exception { newTable( ParserLanguage.CPP, ParserMode.COMPLETION_PARSE ); - ISymbol aVar = table.newSymbol( "aVar", TypeInfo.t_int ); + ISymbol aVar = table.newSymbol( "aVar", TypeInfo.t_int ); //$NON-NLS-1$ table.getCompilationUnit().addSymbol( aVar ); - IDerivableContainerSymbol D = table.newDerivableContainerSymbol( "D", TypeInfo.t_class ); + IDerivableContainerSymbol D = table.newDerivableContainerSymbol( "D", TypeInfo.t_class ); //$NON-NLS-1$ table.getCompilationUnit().addSymbol( D ); - ISymbol aField = table.newSymbol( "aField", TypeInfo.t_int ); - IParameterizedSymbol aMethod = table.newParameterizedSymbol( "aMethod", TypeInfo.t_function ); + ISymbol aField = table.newSymbol( "aField", TypeInfo.t_int ); //$NON-NLS-1$ + IParameterizedSymbol aMethod = table.newParameterizedSymbol( "aMethod", TypeInfo.t_function ); //$NON-NLS-1$ D.addSymbol( aField ); D.addSymbol( aMethod ); - List results = D.prefixLookup( null, "a", true, null ); + List results = D.prefixLookup( null, "a", true, null ); //$NON-NLS-1$ assertTrue( results != null ); assertEquals( results.size(), 2 ); @@ -2712,31 +2712,31 @@ public class ParserSymbolTableTest extends TestCase { public void testPrefixLookup_Inheritance() throws Exception { newTable( ParserLanguage.CPP, ParserMode.COMPLETION_PARSE ); - IDerivableContainerSymbol A = table.newDerivableContainerSymbol( "A", TypeInfo.t_class ); + IDerivableContainerSymbol A = table.newDerivableContainerSymbol( "A", TypeInfo.t_class ); //$NON-NLS-1$ table.getCompilationUnit().addSymbol( A ); - ISymbol aVar = table.newSymbol( "aVar", TypeInfo.t_int ); - ISymbol anotherVar1 = table.newSymbol( "anotherVar", TypeInfo.t_int ); + ISymbol aVar = table.newSymbol( "aVar", TypeInfo.t_int ); //$NON-NLS-1$ + ISymbol anotherVar1 = table.newSymbol( "anotherVar", TypeInfo.t_int ); //$NON-NLS-1$ A.addSymbol( aVar ); A.addSymbol( anotherVar1 ); - IParameterizedSymbol af1 = table.newParameterizedSymbol( "af", TypeInfo.t_function ); + IParameterizedSymbol af1 = table.newParameterizedSymbol( "af", TypeInfo.t_function ); //$NON-NLS-1$ A.addSymbol( af1 ); - IDerivableContainerSymbol B = table.newDerivableContainerSymbol( "B", TypeInfo.t_class ); + IDerivableContainerSymbol B = table.newDerivableContainerSymbol( "B", TypeInfo.t_class ); //$NON-NLS-1$ B.addParent( A ); table.getCompilationUnit().addSymbol( B ); - ISymbol anotherVar2 = table.newSymbol( "anotherVar", TypeInfo.t_int ); + ISymbol anotherVar2 = table.newSymbol( "anotherVar", TypeInfo.t_int ); //$NON-NLS-1$ B.addSymbol( anotherVar2 ); - IParameterizedSymbol af2 = table.newParameterizedSymbol( "af", TypeInfo.t_function ); + IParameterizedSymbol af2 = table.newParameterizedSymbol( "af", TypeInfo.t_function ); //$NON-NLS-1$ af2.addParameter( TypeInfo.t_char, 0, null, false ); B.addSymbol( af2 ); - List results = B.prefixLookup( null, "a", true, null ); + List results = B.prefixLookup( null, "a", true, null ); //$NON-NLS-1$ assertTrue( results != null ); assertEquals( results.size(), 3 ); @@ -2773,35 +2773,35 @@ public class ParserSymbolTableTest extends TestCase { public void testPrefixLookup_Ambiguities() throws Exception{ newTable( ParserLanguage.CPP, ParserMode.COMPLETION_PARSE ); - ISymbol aa = table.newSymbol( "aa", TypeInfo.t_int ); + ISymbol aa = table.newSymbol( "aa", TypeInfo.t_int ); //$NON-NLS-1$ table.getCompilationUnit().addSymbol( aa ); - IContainerSymbol ns = table.newContainerSymbol( "", TypeInfo.t_namespace ); + IContainerSymbol ns = table.newContainerSymbol( "", TypeInfo.t_namespace ); //$NON-NLS-1$ table.getCompilationUnit().addSymbol( ns ); - IContainerSymbol U = table.newContainerSymbol( "U", TypeInfo.t_namespace ); + IContainerSymbol U = table.newContainerSymbol( "U", TypeInfo.t_namespace ); //$NON-NLS-1$ ns.addSymbol( U ); - ISymbol a1 = table.newSymbol( "a", TypeInfo.t_int ); + ISymbol a1 = table.newSymbol( "a", TypeInfo.t_int ); //$NON-NLS-1$ U.addSymbol( a1 ); - IContainerSymbol V = table.newContainerSymbol( "V", TypeInfo.t_namespace ); + IContainerSymbol V = table.newContainerSymbol( "V", TypeInfo.t_namespace ); //$NON-NLS-1$ ns.addSymbol( V ); - ISymbol a2 = table.newSymbol( "a", TypeInfo.t_int ); + ISymbol a2 = table.newSymbol( "a", TypeInfo.t_int ); //$NON-NLS-1$ V.addSymbol( a2 ); - IContainerSymbol W = table.newContainerSymbol( "W", TypeInfo.t_namespace ); + IContainerSymbol W = table.newContainerSymbol( "W", TypeInfo.t_namespace ); //$NON-NLS-1$ ns.addSymbol( W ); - ISymbol a3 = table.newSymbol( "a", TypeInfo.t_int ); + ISymbol a3 = table.newSymbol( "a", TypeInfo.t_int ); //$NON-NLS-1$ W.addSymbol( a3 ); - IParameterizedSymbol f = table.newParameterizedSymbol( "f", TypeInfo.t_function ); + IParameterizedSymbol f = table.newParameterizedSymbol( "f", TypeInfo.t_function ); //$NON-NLS-1$ ns.addSymbol( f ); f.addUsingDirective( U ); f.addUsingDirective( V ); f.addUsingDirective( W ); - List results = f.prefixLookup( null, "a", false, null ); + List results = f.prefixLookup( null, "a", false, null ); //$NON-NLS-1$ assertTrue( results != null ); assertEquals( results.size(), 1 ); @@ -2823,17 +2823,17 @@ public class ParserSymbolTableTest extends TestCase { public void testQualifiedUnqualifiedLookup() throws Exception{ newTable(); - ISymbol i = table.newSymbol( "i", TypeInfo.t_int ); + ISymbol i = table.newSymbol( "i", TypeInfo.t_int ); //$NON-NLS-1$ table.getCompilationUnit().addSymbol( i ); - IDerivableContainerSymbol A = table.newDerivableContainerSymbol( "A", TypeInfo.t_class ); + IDerivableContainerSymbol A = table.newDerivableContainerSymbol( "A", TypeInfo.t_class ); //$NON-NLS-1$ table.getCompilationUnit().addSymbol( A ); - IParameterizedSymbol g = table.newParameterizedSymbol( "g", TypeInfo.t_function ); + IParameterizedSymbol g = table.newParameterizedSymbol( "g", TypeInfo.t_function ); //$NON-NLS-1$ A.addSymbol( g ); - assertEquals( null, A.qualifiedLookup( "i" ) ); - assertEquals( i, g.lookup( "i" ) ); + assertEquals( null, A.qualifiedLookup( "i" ) ); //$NON-NLS-1$ + assertEquals( i, g.lookup( "i" ) ); //$NON-NLS-1$ } /** @@ -2852,16 +2852,16 @@ public class ParserSymbolTableTest extends TestCase { public void testVisibilityDetermination() throws Exception{ newTable(); - IDerivableContainerSymbol D = table.newDerivableContainerSymbol( "D", TypeInfo.t_class ); + IDerivableContainerSymbol D = table.newDerivableContainerSymbol( "D", TypeInfo.t_class ); //$NON-NLS-1$ table.getCompilationUnit().addSymbol( D ); - IDerivableContainerSymbol A = table.newDerivableContainerSymbol( "A", TypeInfo.t_class ); - ISymbol i = table.newSymbol( "i", TypeInfo.t_int ); - ISymbol j = table.newSymbol( "j", TypeInfo.t_int ); + IDerivableContainerSymbol A = table.newDerivableContainerSymbol( "A", TypeInfo.t_class ); //$NON-NLS-1$ + ISymbol i = table.newSymbol( "i", TypeInfo.t_int ); //$NON-NLS-1$ + ISymbol j = table.newSymbol( "j", TypeInfo.t_int ); //$NON-NLS-1$ table.getCompilationUnit().addSymbol( A ); - ISymbol friend = A.lookupForFriendship( "D" ); + ISymbol friend = A.lookupForFriendship( "D" ); //$NON-NLS-1$ assertEquals( friend, D ); A.addFriend( friend ); @@ -2884,11 +2884,11 @@ public class ParserSymbolTableTest extends TestCase { extension = new StandardSymbolExtension( j, (ASTSymbol) field ); j.setASTExtension( extension ); - IDerivableContainerSymbol B = table.newDerivableContainerSymbol( "B", TypeInfo.t_class ); + IDerivableContainerSymbol B = table.newDerivableContainerSymbol( "B", TypeInfo.t_class ); //$NON-NLS-1$ B.addParent( A, false, ASTAccessVisibility.PRIVATE, 0, null ); table.getCompilationUnit().addSymbol( B ); - IDerivableContainerSymbol C = table.newDerivableContainerSymbol( "C", TypeInfo.t_class ); + IDerivableContainerSymbol C = table.newDerivableContainerSymbol( "C", TypeInfo.t_class ); //$NON-NLS-1$ C.addParent( B ); C.addParent( A ); table.getCompilationUnit().addSymbol( C ); @@ -2917,34 +2917,34 @@ public class ParserSymbolTableTest extends TestCase { */ public void testPrefixFiltering() throws Exception{ newTable( ParserLanguage.CPP, ParserMode.COMPLETION_PARSE ); - IDerivableContainerSymbol a1 = table.newDerivableContainerSymbol( "a1", TypeInfo.t_struct ); + IDerivableContainerSymbol a1 = table.newDerivableContainerSymbol( "a1", TypeInfo.t_struct ); //$NON-NLS-1$ table.getCompilationUnit().addSymbol( a1 ); - IParameterizedSymbol aFoo = table.newParameterizedSymbol( "aFoo", TypeInfo.t_function ); + IParameterizedSymbol aFoo = table.newParameterizedSymbol( "aFoo", TypeInfo.t_function ); //$NON-NLS-1$ table.getCompilationUnit().addSymbol( aFoo ); - ISymbol aa = table.newSymbol( "aa", TypeInfo.t_int ); + ISymbol aa = table.newSymbol( "aa", TypeInfo.t_int ); //$NON-NLS-1$ table.getCompilationUnit().addSymbol( aa ); - IDerivableContainerSymbol A2 = table.newDerivableContainerSymbol( "A2", TypeInfo.t_class ); + IDerivableContainerSymbol A2 = table.newDerivableContainerSymbol( "A2", TypeInfo.t_class ); //$NON-NLS-1$ table.getCompilationUnit().addSymbol( A2 ); - IDerivableContainerSymbol a3 = table.newDerivableContainerSymbol( "a3", TypeInfo.t_struct ); + IDerivableContainerSymbol a3 = table.newDerivableContainerSymbol( "a3", TypeInfo.t_struct ); //$NON-NLS-1$ A2.addSymbol( a3 ); - ISymbol a3_int = table.newSymbol( "a3", TypeInfo.t_int ); + ISymbol a3_int = table.newSymbol( "a3", TypeInfo.t_int ); //$NON-NLS-1$ A2.addSymbol( a3_int ); - IParameterizedSymbol aF = table.newParameterizedSymbol( "aF", TypeInfo.t_function ); + IParameterizedSymbol aF = table.newParameterizedSymbol( "aF", TypeInfo.t_function ); //$NON-NLS-1$ A2.addSymbol( aF ); - IParameterizedSymbol f = table.newParameterizedSymbol( "f", TypeInfo.t_function ); + IParameterizedSymbol f = table.newParameterizedSymbol( "f", TypeInfo.t_function ); //$NON-NLS-1$ A2.addSymbol( f ); - ISymbol aLocal = table.newSymbol( "aLocal", TypeInfo.t_int ); + ISymbol aLocal = table.newSymbol( "aLocal", TypeInfo.t_int ); //$NON-NLS-1$ f.addSymbol( aLocal ); - List results = f.prefixLookup( new TypeFilter( LookupKind.STRUCTURES ), "A", false, null ); + List results = f.prefixLookup( new TypeFilter( LookupKind.STRUCTURES ), "A", false, null ); //$NON-NLS-1$ assertEquals( results.size(), 3 ); @@ -2952,7 +2952,7 @@ public class ParserSymbolTableTest extends TestCase { assertTrue( results.contains( A2 ) ); assertTrue( results.contains( a3 ) ); - results = f.prefixLookup( null, "a", false, null ); + results = f.prefixLookup( null, "a", false, null ); //$NON-NLS-1$ assertEquals( results.size(), 7 ); assertTrue( results.contains( aF ) ); assertTrue( results.contains( A2 ) ); @@ -2962,23 +2962,23 @@ public class ParserSymbolTableTest extends TestCase { assertTrue( results.contains( aa ) ); assertTrue( results.contains( aLocal ) ); - results = f.prefixLookup( new TypeFilter( LookupKind.FUNCTIONS ), "a", false, null ); + results = f.prefixLookup( new TypeFilter( LookupKind.FUNCTIONS ), "a", false, null ); //$NON-NLS-1$ assertEquals( results.size(), 1 ); assertTrue( results.contains( aFoo ) ); - results = f.prefixLookup( new TypeFilter( LookupKind.METHODS ), "a", false, null ); + results = f.prefixLookup( new TypeFilter( LookupKind.METHODS ), "a", false, null ); //$NON-NLS-1$ assertEquals( results.size(), 1 ); assertTrue( results.contains( aF ) ); - results = f.prefixLookup( new TypeFilter( LookupKind.LOCAL_VARIABLES ), "a", false, null ); + results = f.prefixLookup( new TypeFilter( LookupKind.LOCAL_VARIABLES ), "a", false, null ); //$NON-NLS-1$ assertEquals( results.size(), 1 ); assertTrue( results.contains( aLocal ) ); - results = f.prefixLookup( new TypeFilter( LookupKind.VARIABLES ), "a", false, null ); + results = f.prefixLookup( new TypeFilter( LookupKind.VARIABLES ), "a", false, null ); //$NON-NLS-1$ assertEquals( results.size(), 1 ); assertTrue( results.contains( aa ) ); - results = f.prefixLookup( new TypeFilter( LookupKind.FIELDS), "a", false, null ); + results = f.prefixLookup( new TypeFilter( LookupKind.FIELDS), "a", false, null ); //$NON-NLS-1$ assertEquals( results.size(), 1 ); assertTrue( results.contains( a3_int ) ); } @@ -2993,7 +2993,7 @@ public class ParserSymbolTableTest extends TestCase { public void testBug43110_Ellipses() throws Exception{ newTable(); - IParameterizedSymbol foo = table.newParameterizedSymbol( "foo", TypeInfo.t_function ); + IParameterizedSymbol foo = table.newParameterizedSymbol( "foo", TypeInfo.t_function ); //$NON-NLS-1$ foo.setHasVariableArgs( true ); table.getCompilationUnit().addSymbol( foo ); @@ -3003,7 +3003,7 @@ public class ParserSymbolTableTest extends TestCase { TypeInfo p1 = new TypeInfo( TypeInfo.t_int, 0, null ); params.add( p1 ); - ISymbol look = table.getCompilationUnit().unqualifiedFunctionLookup( "foo", params ); + ISymbol look = table.getCompilationUnit().unqualifiedFunctionLookup( "foo", params ); //$NON-NLS-1$ assertEquals( foo, look ); } @@ -3018,12 +3018,12 @@ public class ParserSymbolTableTest extends TestCase { public void testBug43110_EllipsesRanking() throws Exception{ newTable(); - IParameterizedSymbol foo1 = table.newParameterizedSymbol( "foo", TypeInfo.t_function ); + IParameterizedSymbol foo1 = table.newParameterizedSymbol( "foo", TypeInfo.t_function ); //$NON-NLS-1$ foo1.setHasVariableArgs( true ); table.getCompilationUnit().addSymbol( foo1 ); - IParameterizedSymbol foo2 = table.newParameterizedSymbol( "foo", TypeInfo.t_function ); + IParameterizedSymbol foo2 = table.newParameterizedSymbol( "foo", TypeInfo.t_function ); //$NON-NLS-1$ foo2.addParameter( TypeInfo.t_int, 0, null, false ); table.getCompilationUnit().addSymbol( foo2 ); @@ -3032,7 +3032,7 @@ public class ParserSymbolTableTest extends TestCase { TypeInfo p1 = new TypeInfo( TypeInfo.t_int, 0, null ); params.add( p1 ); - ISymbol look = table.getCompilationUnit().unqualifiedFunctionLookup( "foo", params ); + ISymbol look = table.getCompilationUnit().unqualifiedFunctionLookup( "foo", params ); //$NON-NLS-1$ assertEquals( foo2, look ); } @@ -3047,17 +3047,17 @@ public class ParserSymbolTableTest extends TestCase { public void testBug43110_ElipsesRanking_2() throws Exception{ newTable(); - IParameterizedSymbol foo1 = table.newParameterizedSymbol( "foo", TypeInfo.t_function ); + IParameterizedSymbol foo1 = table.newParameterizedSymbol( "foo", TypeInfo.t_function ); //$NON-NLS-1$ foo1.addParameter( TypeInfo.t_int, 0, null, true ); table.getCompilationUnit().addSymbol( foo1 ); - IParameterizedSymbol foo2 = table.newParameterizedSymbol( "foo", TypeInfo.t_function ); + IParameterizedSymbol foo2 = table.newParameterizedSymbol( "foo", TypeInfo.t_function ); //$NON-NLS-1$ foo2.setHasVariableArgs( true ); table.getCompilationUnit().addSymbol( foo2 ); List params = new ArrayList(); - ISymbol look = table.getCompilationUnit().unqualifiedFunctionLookup( "foo", params ); + ISymbol look = table.getCompilationUnit().unqualifiedFunctionLookup( "foo", params ); //$NON-NLS-1$ assertEquals( foo1, look ); } @@ -3074,20 +3074,20 @@ public class ParserSymbolTableTest extends TestCase { public void testIterator_1() throws Exception{ newTable(); - ISymbol global = table.newSymbol( "global", TypeInfo.t_int ); + ISymbol global = table.newSymbol( "global", TypeInfo.t_int ); //$NON-NLS-1$ table.getCompilationUnit().addSymbol( global ); - IDerivableContainerSymbol cls = table.newDerivableContainerSymbol( "A", TypeInfo.t_class ); + IDerivableContainerSymbol cls = table.newDerivableContainerSymbol( "A", TypeInfo.t_class ); //$NON-NLS-1$ table.getCompilationUnit().addSymbol( cls ); - IParameterizedSymbol constructor = table.newParameterizedSymbol( "A", TypeInfo.t_constructor ); + IParameterizedSymbol constructor = table.newParameterizedSymbol( "A", TypeInfo.t_constructor ); //$NON-NLS-1$ cls.addConstructor( constructor ); - ISymbol var = table.newSymbol( "var", TypeInfo.t_int ); + ISymbol var = table.newSymbol( "var", TypeInfo.t_int ); //$NON-NLS-1$ cls.addSymbol( var ); - IParameterizedSymbol foo = table.newParameterizedSymbol( "foo", TypeInfo.t_function ); + IParameterizedSymbol foo = table.newParameterizedSymbol( "foo", TypeInfo.t_function ); //$NON-NLS-1$ cls.addSymbol( foo ); @@ -3120,25 +3120,25 @@ public class ParserSymbolTableTest extends TestCase { public void testIterator_2() throws Exception{ newTable(); - IParameterizedSymbol foo = table.newParameterizedSymbol( "foo", TypeInfo.t_function ); + IParameterizedSymbol foo = table.newParameterizedSymbol( "foo", TypeInfo.t_function ); //$NON-NLS-1$ table.getCompilationUnit().addSymbol( foo ); - IContainerSymbol nsA = table.newContainerSymbol( "A", TypeInfo.t_namespace ); + IContainerSymbol nsA = table.newContainerSymbol( "A", TypeInfo.t_namespace ); //$NON-NLS-1$ table.getCompilationUnit().addSymbol( nsA ); - IParameterizedSymbol bar1 = table.newParameterizedSymbol( "bar", TypeInfo.t_function ); + IParameterizedSymbol bar1 = table.newParameterizedSymbol( "bar", TypeInfo.t_function ); //$NON-NLS-1$ nsA.addSymbol( bar1 ); - IParameterizedSymbol bar2 = table.newParameterizedSymbol( "bar", TypeInfo.t_function ); + IParameterizedSymbol bar2 = table.newParameterizedSymbol( "bar", TypeInfo.t_function ); //$NON-NLS-1$ bar2.addParameter( TypeInfo.t_int, 0, null, false ); nsA.addSymbol( bar2 ); - IDerivableContainerSymbol B = table.newDerivableContainerSymbol("B", TypeInfo.t_class); + IDerivableContainerSymbol B = table.newDerivableContainerSymbol("B", TypeInfo.t_class); //$NON-NLS-1$ table.getCompilationUnit().addSymbol( B ); B.addCopyConstructor(); - IParameterizedSymbol func = table.newParameterizedSymbol( "func", TypeInfo.t_function ); + IParameterizedSymbol func = table.newParameterizedSymbol( "func", TypeInfo.t_function ); //$NON-NLS-1$ B.addSymbol( func ); IUsingDirectiveSymbol using = func.addUsingDirective( nsA ); @@ -3165,7 +3165,7 @@ public class ParserSymbolTableTest extends TestCase { //Copy constructor!! ISymbol copy = (ISymbol) iter.next(); assertTrue( copy instanceof IParameterizedSymbol ); - assertEquals( copy.getName(), "B" ); + assertEquals( copy.getName(), "B" ); //$NON-NLS-1$ assertEquals( copy.getType(), TypeInfo.t_constructor ); assertEquals( iter.next(), func ); @@ -3174,7 +3174,7 @@ public class ParserSymbolTableTest extends TestCase { iter = func.getContentsIterator(); //this pointer!! ISymbol th = (ISymbol) iter.next(); - assertEquals( th.getName(), "this" ); + assertEquals( th.getName(), "this" ); //$NON-NLS-1$ assertEquals( th.getTypeSymbol(), B ); assertEquals( iter.next(), using ); @@ -3193,23 +3193,23 @@ public class ParserSymbolTableTest extends TestCase { */ public void testLongLong() throws Exception{ newTable(); - IParameterizedSymbol f1 = table.newParameterizedSymbol( "f", TypeInfo.t_function ); + IParameterizedSymbol f1 = table.newParameterizedSymbol( "f", TypeInfo.t_function ); //$NON-NLS-1$ f1.addParameter( TypeInfo.t_int, TypeInfo.isLongLong, null, false ); table.getCompilationUnit().addSymbol( f1 ); - IParameterizedSymbol f2 = table.newParameterizedSymbol( "f", TypeInfo.t_function ); + IParameterizedSymbol f2 = table.newParameterizedSymbol( "f", TypeInfo.t_function ); //$NON-NLS-1$ f2.addParameter( TypeInfo.t_int, TypeInfo.isLong, null, false ); table.getCompilationUnit().addSymbol( f2 ); List params = new ArrayList(); params.add( new TypeInfo( TypeInfo.t_int, TypeInfo.isLong, null ) ); - IParameterizedSymbol lookup = table.getCompilationUnit().unqualifiedFunctionLookup( "f", params ); + IParameterizedSymbol lookup = table.getCompilationUnit().unqualifiedFunctionLookup( "f", params ); //$NON-NLS-1$ assertEquals( lookup, f2 ); params.clear(); params.add( new TypeInfo( TypeInfo.t_int, TypeInfo.isLongLong, null ) ); - lookup = table.getCompilationUnit().unqualifiedFunctionLookup( "f", params ); + lookup = table.getCompilationUnit().unqualifiedFunctionLookup( "f", params ); //$NON-NLS-1$ assertEquals( lookup, f1 ); } @@ -3230,50 +3230,50 @@ public class ParserSymbolTableTest extends TestCase { public void testComplex() throws Exception{ newTable(); - IParameterizedSymbol f = table.newParameterizedSymbol( "f", TypeInfo.t_function ); + IParameterizedSymbol f = table.newParameterizedSymbol( "f", TypeInfo.t_function ); //$NON-NLS-1$ f.addParameter( TypeInfo.t_float, TypeInfo.isComplex, null, false ); table.getCompilationUnit().addSymbol( f ); - IParameterizedSymbol g = table.newParameterizedSymbol( "g", TypeInfo.t_function ); + IParameterizedSymbol g = table.newParameterizedSymbol( "g", TypeInfo.t_function ); //$NON-NLS-1$ g.addParameter( TypeInfo.t_float, 0, null, false ); table.getCompilationUnit().addSymbol( g ); List params = new ArrayList(); params.add( new TypeInfo( TypeInfo.t_float, TypeInfo.isComplex, null ) ); - IParameterizedSymbol lookup = table.getCompilationUnit().unqualifiedFunctionLookup( "f", params ); + IParameterizedSymbol lookup = table.getCompilationUnit().unqualifiedFunctionLookup( "f", params ); //$NON-NLS-1$ assertEquals( lookup, f ); params.clear(); params.add( new TypeInfo( TypeInfo.t_float, 0, null ) ); - lookup = table.getCompilationUnit().unqualifiedFunctionLookup( "f", params ); + lookup = table.getCompilationUnit().unqualifiedFunctionLookup( "f", params ); //$NON-NLS-1$ assertEquals( lookup, f ); params.clear(); params.add( new TypeInfo( TypeInfo.t_float, TypeInfo.isComplex, null ) ); - lookup = table.getCompilationUnit().unqualifiedFunctionLookup( "g", params ); + lookup = table.getCompilationUnit().unqualifiedFunctionLookup( "g", params ); //$NON-NLS-1$ assertEquals( lookup, g ); params.clear(); params.add( new TypeInfo( TypeInfo.t_float, TypeInfo.isImaginary, null ) ); - lookup = table.getCompilationUnit().unqualifiedFunctionLookup( "g", params ); + lookup = table.getCompilationUnit().unqualifiedFunctionLookup( "g", params ); //$NON-NLS-1$ assertEquals( lookup, g ); - lookup = table.getCompilationUnit().unqualifiedFunctionLookup( "f", params ); + lookup = table.getCompilationUnit().unqualifiedFunctionLookup( "f", params ); //$NON-NLS-1$ assertEquals( lookup, f ); } public void test_Bool() throws Exception{ newTable(); - IParameterizedSymbol f = table.newParameterizedSymbol( "f", TypeInfo.t_function ); + IParameterizedSymbol f = table.newParameterizedSymbol( "f", TypeInfo.t_function ); //$NON-NLS-1$ f.addParameter( TypeInfo.t__Bool, 0, null, false ); table.getCompilationUnit().addSymbol( f ); - IParameterizedSymbol g = table.newParameterizedSymbol( "g", TypeInfo.t_function ); + IParameterizedSymbol g = table.newParameterizedSymbol( "g", TypeInfo.t_function ); //$NON-NLS-1$ g.addParameter( TypeInfo.t_int, 0, null, false ); table.getCompilationUnit().addSymbol( g ); @@ -3281,15 +3281,15 @@ public class ParserSymbolTableTest extends TestCase { List params = new ArrayList(); params.add( new TypeInfo( TypeInfo.t__Bool, 0, null ) ); - IParameterizedSymbol look = table.getCompilationUnit().unqualifiedFunctionLookup( "f", params ); + IParameterizedSymbol look = table.getCompilationUnit().unqualifiedFunctionLookup( "f", params ); //$NON-NLS-1$ assertEquals( look, f ); - look = table.getCompilationUnit().unqualifiedFunctionLookup( "g", params ); + look = table.getCompilationUnit().unqualifiedFunctionLookup( "g", params ); //$NON-NLS-1$ assertEquals( look, g ); params.clear(); params.add( new TypeInfo( TypeInfo.t_int, 0, null ) ); - look = table.getCompilationUnit().unqualifiedFunctionLookup( "f", params ); + look = table.getCompilationUnit().unqualifiedFunctionLookup( "f", params ); //$NON-NLS-1$ assertEquals( look, f ); } @@ -3305,14 +3305,14 @@ public class ParserSymbolTableTest extends TestCase { public void testBug47636FunctionParameterComparisons_1() throws Exception{ newTable(); - ISymbol Int = table.newSymbol( "Int", TypeInfo.t_type ); + ISymbol Int = table.newSymbol( "Int", TypeInfo.t_type ); //$NON-NLS-1$ Int.getTypeInfo().setBit( true, TypeInfo.isTypedef ); Int.setTypeSymbol( table.newSymbol( ParserSymbolTable.EMPTY_NAME, TypeInfo.t_int ) ); - IParameterizedSymbol f1 = table.newParameterizedSymbol( "f", TypeInfo.t_function ); + IParameterizedSymbol f1 = table.newParameterizedSymbol( "f", TypeInfo.t_function ); //$NON-NLS-1$ f1.addParameter( TypeInfo.t_int, 0, null, false ); - IParameterizedSymbol f2 = table.newParameterizedSymbol( "f", TypeInfo.t_function ); + IParameterizedSymbol f2 = table.newParameterizedSymbol( "f", TypeInfo.t_function ); //$NON-NLS-1$ f2.addParameter( Int, 0, null, false ); assertTrue( f1.hasSameParameters( f2 ) ); @@ -3325,10 +3325,10 @@ public class ParserSymbolTableTest extends TestCase { public void testBug47636FunctionParameterComparisons_2() throws Exception{ newTable(); - IParameterizedSymbol g1 = table.newParameterizedSymbol( "g", TypeInfo.t_function ); + IParameterizedSymbol g1 = table.newParameterizedSymbol( "g", TypeInfo.t_function ); //$NON-NLS-1$ g1.addParameter( TypeInfo.t_char, 0, new PtrOp( PtrOp.t_pointer ), false ); - IParameterizedSymbol g2 = table.newParameterizedSymbol( "g", TypeInfo.t_function ); + IParameterizedSymbol g2 = table.newParameterizedSymbol( "g", TypeInfo.t_function ); //$NON-NLS-1$ g2.addParameter( TypeInfo.t_char, 0, new PtrOp( PtrOp.t_array ), false ); assertTrue( g1.hasSameParameters( g2 ) ); @@ -3344,10 +3344,10 @@ public class ParserSymbolTableTest extends TestCase { IParameterizedSymbol f = table.newParameterizedSymbol( ParserSymbolTable.EMPTY_NAME, TypeInfo.t_function ); f.setReturnType( table.newSymbol( ParserSymbolTable.EMPTY_NAME, TypeInfo.t_int ) ); - IParameterizedSymbol h1 = table.newParameterizedSymbol( "h", TypeInfo.t_function ); + IParameterizedSymbol h1 = table.newParameterizedSymbol( "h", TypeInfo.t_function ); //$NON-NLS-1$ h1.addParameter( f, 0, null, false ); - IParameterizedSymbol h2 = table.newParameterizedSymbol( "h", TypeInfo.t_function ); + IParameterizedSymbol h2 = table.newParameterizedSymbol( "h", TypeInfo.t_function ); //$NON-NLS-1$ h2.addParameter( f, 0, new PtrOp( PtrOp.t_pointer ), false ); assertTrue( h1.hasSameParameters( h2 ) ); @@ -3360,10 +3360,10 @@ public class ParserSymbolTableTest extends TestCase { public void testBug47636FunctionParameterComparisons_4() throws Exception{ newTable(); - IParameterizedSymbol f1 = table.newParameterizedSymbol( "f", TypeInfo.t_function ); + IParameterizedSymbol f1 = table.newParameterizedSymbol( "f", TypeInfo.t_function ); //$NON-NLS-1$ f1.addParameter( TypeInfo.t_int, 0, null, false ); - IParameterizedSymbol f2 = table.newParameterizedSymbol( "f", TypeInfo.t_function ); + IParameterizedSymbol f2 = table.newParameterizedSymbol( "f", TypeInfo.t_function ); //$NON-NLS-1$ f2.addParameter( TypeInfo.t_int, TypeInfo.isConst, null, false ); assertTrue( f1.hasSameParameters( f2 ) ); @@ -3372,26 +3372,26 @@ public class ParserSymbolTableTest extends TestCase { public void testBug52111RemoveSymbol() throws Exception{ newTable(); - IDerivableContainerSymbol A = table.newDerivableContainerSymbol( "A", TypeInfo.t_class ); + IDerivableContainerSymbol A = table.newDerivableContainerSymbol( "A", TypeInfo.t_class ); //$NON-NLS-1$ table.getCompilationUnit().addSymbol( A ); - ISymbol i = table.newSymbol( "i", TypeInfo.t_int ); + ISymbol i = table.newSymbol( "i", TypeInfo.t_int ); //$NON-NLS-1$ A.addSymbol( i ); - IParameterizedSymbol f1 = table.newParameterizedSymbol( "f", TypeInfo.t_function ); + IParameterizedSymbol f1 = table.newParameterizedSymbol( "f", TypeInfo.t_function ); //$NON-NLS-1$ A.addSymbol( f1 ); - IParameterizedSymbol f2 = table.newParameterizedSymbol( "f", TypeInfo.t_function ); + IParameterizedSymbol f2 = table.newParameterizedSymbol( "f", TypeInfo.t_function ); //$NON-NLS-1$ f2.addParameter( TypeInfo.t_int, 0, null, false ); A.addSymbol( f2 ); - IDerivableContainerSymbol B = table.newDerivableContainerSymbol( "B", TypeInfo.t_class ); + IDerivableContainerSymbol B = table.newDerivableContainerSymbol( "B", TypeInfo.t_class ); //$NON-NLS-1$ B.addParent( A ); table.getCompilationUnit().addSymbol( B ); - ISymbol look = B.qualifiedLookup( "i" ); + ISymbol look = B.qualifiedLookup( "i" ); //$NON-NLS-1$ assertEquals( look, i ); Iterator iter = A.getContentsIterator(); @@ -3407,12 +3407,12 @@ public class ParserSymbolTableTest extends TestCase { assertEquals( iter.next(), f2 ); assertFalse( iter.hasNext() ); - look = B.qualifiedLookup( "i" ); + look = B.qualifiedLookup( "i" ); //$NON-NLS-1$ assertNull( look ); List params = new ArrayList(); - look = B.qualifiedFunctionLookup( "f", params ); + look = B.qualifiedFunctionLookup( "f", params ); //$NON-NLS-1$ assertEquals( look, f1 ); assertTrue( A.removeSymbol( f1 ) ); @@ -3420,11 +3420,11 @@ public class ParserSymbolTableTest extends TestCase { assertEquals( iter.next(), f2 ); assertFalse( iter.hasNext() ); - look = B.qualifiedFunctionLookup( "f", params ); + look = B.qualifiedFunctionLookup( "f", params ); //$NON-NLS-1$ assertNull( look ); params.add( new TypeInfo( TypeInfo.t_int, 0, null ) ); - look = B.qualifiedFunctionLookup( "f", params ); + look = B.qualifiedFunctionLookup( "f", params ); //$NON-NLS-1$ assertEquals( look, f2 ); assertTrue( A.removeSymbol( f2 ) ); @@ -3432,7 +3432,7 @@ public class ParserSymbolTableTest extends TestCase { iter = A.getContentsIterator(); assertFalse( iter.hasNext() ); - look = B.qualifiedFunctionLookup( "f", params ); + look = B.qualifiedFunctionLookup( "f", params ); //$NON-NLS-1$ assertNull( look ); assertEquals( A.getContainedSymbols().size(), 0 ); diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/PerformanceTests.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/PerformanceTests.java index e625ec00f2c..eb46ac5e839 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/PerformanceTests.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/PerformanceTests.java @@ -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()); diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/PreprocessorConditionalTest.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/PreprocessorConditionalTest.java index 704795164bf..81279a58b02 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/PreprocessorConditionalTest.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/PreprocessorConditionalTest.java @@ -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$ } diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/PreprocessorTest.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/PreprocessorTest.java index 3d2fd89ecb6..cf4ad5dc330 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/PreprocessorTest.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/PreprocessorTest.java @@ -64,7 +64,7 @@ public class PreprocessorTest extends TestCase { public void testSimpleExample() { Callback c = new Callback(); - IPreprocessor p = setupPreprocessor( "#include ", + IPreprocessor p = setupPreprocessor( "#include ", //$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; } diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/QuickParseASTQualifiedNameTest.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/QuickParseASTQualifiedNameTest.java index 3263c72e394..77eb6d60cde 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/QuickParseASTQualifiedNameTest.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/QuickParseASTQualifiedNameTest.java @@ -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$ } } diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/QuickParseASTTests.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/QuickParseASTTests.java index 196585866f2..9fbfa25411e 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/QuickParseASTTests.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/QuickParseASTTests.java @@ -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 diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/StructuralParseTest.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/StructuralParseTest.java index d7100b25cf3..7c40793ff18 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/StructuralParseTest.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/StructuralParseTest.java @@ -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$ } } diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/TortureTest.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/TortureTest.java index f85eb839b37..51c3eef98f4 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/TortureTest.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/TortureTest.java @@ -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(); diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/XMLDumper.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/XMLDumper.java index 1fa4e171cb0..7a41359a5f0 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/XMLDumper.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/XMLDumper.java @@ -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)); } diff --git a/core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/core/suite/AutomatedIntegrationSuite.java b/core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/core/suite/AutomatedIntegrationSuite.java index 709576edbb7..27bc6c8f757 100644 --- a/core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/core/suite/AutomatedIntegrationSuite.java +++ b/core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/core/suite/AutomatedIntegrationSuite.java @@ -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; diff --git a/core/org.eclipse.cdt.core/.classpath b/core/org.eclipse.cdt.core/.classpath index 9d6202a599d..2c147c1d2bd 100644 --- a/core/org.eclipse.cdt.core/.classpath +++ b/core/org.eclipse.cdt.core/.classpath @@ -10,5 +10,6 @@ + diff --git a/core/org.eclipse.cdt.core/.cvsignore b/core/org.eclipse.cdt.core/.cvsignore index 693869726de..5c83bde60da 100644 --- a/core/org.eclipse.cdt.core/.cvsignore +++ b/core/org.eclipse.cdt.core/.cvsignore @@ -1,2 +1,3 @@ bin doc +aniefer diff --git a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/Util.java b/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/Util.java index bd26fd6a135..5a52854bd5c 100644 --- a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/Util.java +++ b/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/Util.java @@ -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; diff --git a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/InMemoryIndex.java b/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/InMemoryIndex.java index 70c31e4e008..69f6d8f5f8c 100644 --- a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/InMemoryIndex.java +++ b/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/InMemoryIndex.java @@ -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 diff --git a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/indexing/AbstractIndexer.java b/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/indexing/AbstractIndexer.java index e5adf3d4558..bb374e8c763 100644 --- a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/indexing/AbstractIndexer.java +++ b/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/indexing/AbstractIndexer.java @@ -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(); diff --git a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/indexing/IndexAllProject.java b/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/indexing/IndexAllProject.java index 452d5793a2a..20b671011d0 100644 --- a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/indexing/IndexAllProject.java +++ b/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/indexing/IndexAllProject.java @@ -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; diff --git a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/indexing/IndexManager.java b/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/indexing/IndexManager.java index 7109b99c320..5c121119ef5 100644 --- a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/indexing/IndexManager.java +++ b/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/indexing/IndexManager.java @@ -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(); diff --git a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/indexing/SourceIndexer.java b/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/indexing/SourceIndexer.java index 9d1c6166b4b..b7acf1234ab 100644 --- a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/indexing/SourceIndexer.java +++ b/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/indexing/SourceIndexer.java @@ -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; diff --git a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/indexing/SourceIndexerRequestor.java b/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/indexing/SourceIndexerRequestor.java index b4ccb6e2a3b..f6c98230625 100644 --- a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/indexing/SourceIndexerRequestor.java +++ b/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/indexing/SourceIndexerRequestor.java @@ -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 += ')'; diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelBuilder.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelBuilder.java index a607bfd7283..7812d2cf1cd 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelBuilder.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelBuilder.java @@ -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())); diff --git a/core/org.eclipse.cdt.core/search/org/eclipse/cdt/core/search/BasicSearchResultCollector.java b/core/org.eclipse.cdt.core/search/org/eclipse/cdt/core/search/BasicSearchResultCollector.java index ef7417fe312..f18ecdd7abb 100644 --- a/core/org.eclipse.cdt.core/search/org/eclipse/cdt/core/search/BasicSearchResultCollector.java +++ b/core/org.eclipse.cdt.core/search/org/eclipse/cdt/core/search/BasicSearchResultCollector.java @@ -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]; } diff --git a/core/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/matching/CSearchPattern.java b/core/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/matching/CSearchPattern.java index e204ada50f8..9c181c81b2e 100644 --- a/core/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/matching/CSearchPattern.java +++ b/core/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/matching/CSearchPattern.java @@ -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; diff --git a/core/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/matching/DerivedTypesPattern.java b/core/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/matching/DerivedTypesPattern.java index 79bab93bbb8..05a48255c9a 100644 --- a/core/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/matching/DerivedTypesPattern.java +++ b/core/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/matching/DerivedTypesPattern.java @@ -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; /** diff --git a/core/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/matching/FriendPattern.java b/core/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/matching/FriendPattern.java index de2b2cc0c1b..482f3e7cfa0 100644 --- a/core/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/matching/FriendPattern.java +++ b/core/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/matching/FriendPattern.java @@ -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; /** diff --git a/core/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/matching/MethodDeclarationPattern.java b/core/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/matching/MethodDeclarationPattern.java index a464fa7e548..2640cd63a79 100644 --- a/core/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/matching/MethodDeclarationPattern.java +++ b/core/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/matching/MethodDeclarationPattern.java @@ -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; diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/CSearchResultCollector.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/CSearchResultCollector.java index 96187dff9ca..1e4104e48f5 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/CSearchResultCollector.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/CSearchResultCollector.java @@ -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; diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/actions/OpenDeclarationsAction.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/actions/OpenDeclarationsAction.java index 7a492029522..b66d86789cc 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/actions/OpenDeclarationsAction.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/actions/OpenDeclarationsAction.java @@ -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;