[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
[cdt-patch] Applied [HEAD] : Class Specifier updates to ISourceElementRequestor
|
Added
Class/Base infrastructure to public interfaces & requestor callback.
Moved
many internal interfaces to external packages.
Organized
imports.
JohnC
Index: ChangeLog
===================================================================
RCS file: /home/tools/org.eclipse.cdt.ui.tests/ChangeLog,v
retrieving revision 1.62
diff -u -r1.62 ChangeLog
--- ChangeLog 13 Jun 2003 18:24:26 -0000 1.62
+++ ChangeLog 13 Jun 2003 19:57:10 -0000
@@ -1,3 +1,8 @@
+2003-06-13 John Camelon
+ Added Class/Base infrastructure to public interfaces & requestor callback.
+ Moved many internal interfaces to external packages.
+ Organized imports.
+
2003-06-13 Victor Mozgin
Renamed NullParserCallback into NullSourceElementRequester in AutomatedFramework.
Index: parser/org/eclipse/cdt/core/parser/tests/AutomatedFramework.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.ui.tests/parser/org/eclipse/cdt/core/parser/tests/AutomatedFramework.java,v
retrieving revision 1.4
diff -u -r1.4 AutomatedFramework.java
--- parser/org/eclipse/cdt/core/parser/tests/AutomatedFramework.java 13 Jun 2003 18:24:26 -0000 1.4
+++ parser/org/eclipse/cdt/core/parser/tests/AutomatedFramework.java 13 Jun 2003 19:57:10 -0000
@@ -24,7 +24,7 @@
import junit.framework.TestCase;
import junit.framework.TestSuite;
-import org.eclipse.cdt.internal.core.parser.IParserCallback;
+import org.eclipse.cdt.core.parser.IParserCallback;
import org.eclipse.cdt.internal.core.parser.NullSourceElementRequestor;
/**
Index: parser/org/eclipse/cdt/core/parser/tests/BaseScannerTest.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.ui.tests/parser/org/eclipse/cdt/core/parser/tests/BaseScannerTest.java,v
retrieving revision 1.2
diff -u -r1.2 BaseScannerTest.java
--- parser/org/eclipse/cdt/core/parser/tests/BaseScannerTest.java 24 Apr 2003 21:01:24 -0000 1.2
+++ parser/org/eclipse/cdt/core/parser/tests/BaseScannerTest.java 13 Jun 2003 19:57:10 -0000
@@ -15,10 +15,10 @@
import junit.framework.TestCase;
+import org.eclipse.cdt.core.parser.IToken;
+import org.eclipse.cdt.core.parser.ScannerException;
import org.eclipse.cdt.internal.core.parser.Parser;
import org.eclipse.cdt.internal.core.parser.Scanner;
-import org.eclipse.cdt.internal.core.parser.ScannerException;
-import org.eclipse.cdt.internal.core.parser.Token;
/**
* @author jcamelon
@@ -43,13 +43,13 @@
{
try
{
- Token t= scanner.nextToken();
+ IToken t= scanner.nextToken();
while (t != null)
{
if (verbose)
System.out.println("Token t = " + t);
- if ((t.type < 1) || (t.type > Token.tLAST))
+ if ((t.getType()> IToken.tLAST))
System.out.println("Unknown type for token " + t);
t= scanner.nextToken();
}
@@ -66,9 +66,9 @@
public void validateIdentifier(String expectedImage) throws ScannerException
{
try {
- Token t= scanner.nextToken();
- assertTrue(t.type == Token.tIDENTIFIER);
- assertTrue(t.image.equals(expectedImage));
+ IToken t= scanner.nextToken();
+ assertTrue(t.getType() == IToken.tIDENTIFIER);
+ assertTrue(t.getImage().equals(expectedImage));
} catch (Parser.EndOfFile e) {
assertTrue(false);
}
@@ -77,9 +77,9 @@
public void validateInteger(String expectedImage) throws ScannerException
{
try {
- Token t= scanner.nextToken();
- assertTrue(t.type == Token.tINTEGER);
- assertTrue(t.image.equals(expectedImage));
+ IToken t= scanner.nextToken();
+ assertTrue(t.getType() == IToken.tINTEGER);
+ assertTrue(t.getImage().equals(expectedImage));
} catch (Parser.EndOfFile e) {
assertTrue(false);
}
@@ -88,9 +88,9 @@
public void validateFloatingPointLiteral(String expectedImage) throws ScannerException
{
try {
- Token t= scanner.nextToken();
- assertTrue(t.type == Token.tFLOATINGPT);
- assertTrue(t.image.equals(expectedImage));
+ IToken t= scanner.nextToken();
+ assertTrue(t.getType() == IToken.tFLOATINGPT);
+ assertTrue(t.getImage().equals(expectedImage));
} catch (Parser.EndOfFile e) {
assertTrue(false);
}
@@ -99,8 +99,8 @@
public void validateChar( char expected )throws ScannerException
{
try {
- Token t= scanner.nextToken();
- assertTrue(t.getType() == Token.tCHAR );
+ IToken t= scanner.nextToken();
+ assertTrue(t.getType() == IToken.tCHAR );
Character c = new Character( expected );
assertEquals( t.getImage(), c.toString() );
} catch (Parser.EndOfFile e) {
@@ -110,8 +110,8 @@
public void validateChar( String expected ) throws ScannerException
{
try {
- Token t= scanner.nextToken();
- assertTrue(t.getType() == Token.tCHAR );
+ IToken t= scanner.nextToken();
+ assertTrue(t.getType() == IToken.tCHAR );
assertEquals( t.getImage(), expected );
} catch (Parser.EndOfFile e) {
assertTrue(false);
@@ -126,11 +126,11 @@
public void validateString(String expectedImage, boolean lString ) throws ScannerException
{
try {
- Token t= scanner.nextToken();
+ IToken t= scanner.nextToken();
if( lString )
- assertTrue(t.getType() == Token.tLSTRING);
+ assertTrue(t.getType() == IToken.tLSTRING);
else
- assertTrue(t.getType() == Token.tSTRING);
+ assertTrue(t.getType() == IToken.tSTRING);
assertTrue(t.getImage().equals(expectedImage));
} catch (Parser.EndOfFile e) {
assertTrue(false);
@@ -140,8 +140,8 @@
public void validateToken(int tokenType) throws ScannerException
{
try {
- Token t= scanner.nextToken();
- assertTrue(t.type == tokenType);
+ IToken t= scanner.nextToken();
+ assertTrue(t.getType() == tokenType);
} catch (Parser.EndOfFile e) {
assertTrue(false);
}
Index: parser/org/eclipse/cdt/core/parser/tests/BranchTrackerTest.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.ui.tests/parser/org/eclipse/cdt/core/parser/tests/BranchTrackerTest.java,v
retrieving revision 1.2
diff -u -r1.2 BranchTrackerTest.java
--- parser/org/eclipse/cdt/core/parser/tests/BranchTrackerTest.java 4 Mar 2003 18:25:45 -0000 1.2
+++ parser/org/eclipse/cdt/core/parser/tests/BranchTrackerTest.java 13 Jun 2003 19:57:11 -0000
@@ -2,8 +2,8 @@
import junit.framework.TestCase;
+import org.eclipse.cdt.core.parser.ScannerException;
import org.eclipse.cdt.internal.core.parser.BranchTracker;
-import org.eclipse.cdt.internal.core.parser.ScannerException;
/**
* @author jcamelon
Index: parser/org/eclipse/cdt/core/parser/tests/DOMTests.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.ui.tests/parser/org/eclipse/cdt/core/parser/tests/DOMTests.java,v
retrieving revision 1.36
diff -u -r1.36 DOMTests.java
--- parser/org/eclipse/cdt/core/parser/tests/DOMTests.java 13 Jun 2003 15:01:12 -0000 1.36
+++ parser/org/eclipse/cdt/core/parser/tests/DOMTests.java 13 Jun 2003 19:57:12 -0000
@@ -6,6 +6,7 @@
import java.util.Iterator;
import java.util.List;
+import org.eclipse.cdt.core.parser.IToken;
import org.eclipse.cdt.internal.core.dom.ASMDefinition;
import org.eclipse.cdt.internal.core.dom.AccessSpecifier;
import org.eclipse.cdt.internal.core.dom.ArrayQualifier;
@@ -356,7 +357,7 @@
assertEquals( 1, exp.elements().size() );
Token t = (Token)exp.elements().get(0);
assertEquals( t.getImage(), "5" );
- assertEquals( t.getType(), Token.tINTEGER);
+ assertEquals( t.getType(), IToken.tINTEGER);
}
/**
@@ -574,10 +575,10 @@
Token t1 = (Token)initialValueParm1.elements().get( 0 );
Token t2 = (Token)initialValueParm1.elements().get( 1 );
Token t3 = (Token)initialValueParm1.elements().get( 2 );
- assertEquals( t1.getType(), Token.tINTEGER );
+ assertEquals( t1.getType(), IToken.tINTEGER );
assertEquals( t1.getImage(), "3" );
- assertEquals( t3.getType(), Token.tSTAR );
- assertEquals( t2.getType(), Token.tINTEGER );
+ assertEquals( t3.getType(), IToken.tSTAR );
+ assertEquals( t2.getType(), IToken.tINTEGER );
assertEquals( t2.getImage(), "4" );
ParameterDeclaration parm2 = (ParameterDeclaration)parameterDecls.get( 1 );
@@ -794,7 +795,7 @@
assertFalse( po1.isVolatile() );
assertEquals( po1.getType(), PointerOperator.t_pointer );
Token t1 = (Token)initValue1.elements().get(0);
- assertEquals( t1.getType(), Token.tINTEGER );
+ assertEquals( t1.getType(), IToken.tINTEGER );
assertEquals( t1.getImage(), "0");
Declarator declarator2 = (Declarator)decl1.getDeclarators().get( 1 );
@@ -932,7 +933,7 @@
assertEquals( expression.getExpression().elements().size(), 1 );
Token t = (Token)expression.getExpression().elements().get(0);
assertEquals( t.getImage(), "0");
- assertEquals( t.getType(), Token.tINTEGER );
+ assertEquals( t.getType(), IToken.tINTEGER );
Index: parser/org/eclipse/cdt/core/parser/tests/LineNumberTest.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.ui.tests/parser/org/eclipse/cdt/core/parser/tests/LineNumberTest.java,v
retrieving revision 1.5
diff -u -r1.5 LineNumberTest.java
--- parser/org/eclipse/cdt/core/parser/tests/LineNumberTest.java 13 Jun 2003 15:01:12 -0000 1.5
+++ parser/org/eclipse/cdt/core/parser/tests/LineNumberTest.java 13 Jun 2003 19:57:12 -0000
@@ -20,6 +20,7 @@
import junit.framework.TestCase;
import org.eclipse.cdt.core.parser.IParser;
+import org.eclipse.cdt.core.parser.IToken;
import org.eclipse.cdt.internal.core.dom.ClassSpecifier;
import org.eclipse.cdt.internal.core.dom.DOMBuilder;
import org.eclipse.cdt.internal.core.dom.EnumerationSpecifier;
@@ -29,7 +30,6 @@
import org.eclipse.cdt.internal.core.dom.TemplateDeclaration;
import org.eclipse.cdt.internal.core.parser.Parser;
import org.eclipse.cdt.internal.core.parser.Scanner;
-import org.eclipse.cdt.internal.core.parser.Token;
import org.eclipse.core.runtime.Path;
/**
@@ -57,25 +57,25 @@
Reader reader = new StringReader( "int x = 3;\n foo\nfire\nfoe ");
scanner.initialize( reader, "string");
scanner.mapLineNumbers(true);
- Token t = scanner.nextToken();
- assertEquals( t.getType(), Token.t_int );
+ IToken t = scanner.nextToken();
+ assertEquals( t.getType(), IToken.t_int );
assertEquals( scanner.getLineNumberForOffset(t.getOffset()), 1 );
t = scanner.nextToken();
assertEquals( t.getImage(), "x");
assertEquals( scanner.getLineNumberForOffset(t.getOffset()), 1 );
t = scanner.nextToken();
- assertEquals( t.getType(), Token.tASSIGN );
+ assertEquals( t.getType(), IToken.tASSIGN );
assertEquals( scanner.getLineNumberForOffset(t.getOffset()), 1 );
t = scanner.nextToken();
assertEquals( t.getImage(), "3" );
assertEquals( scanner.getLineNumberForOffset(t.getOffset()), 1 );
t = scanner.nextToken();
- assertEquals( t.getType(), Token.tSEMI);
+ assertEquals( t.getType(), IToken.tSEMI);
assertEquals( scanner.getLineNumberForOffset(t.getOffset()), 1 );
for( int i = 2; i < 5; ++i )
{
t = scanner.nextToken();
- assertEquals( t.getType(), Token.tIDENTIFIER);
+ assertEquals( t.getType(), IToken.tIDENTIFIER);
assertEquals( scanner.getLineNumberForOffset(t.getOffset()), i );
}
Index: parser/org/eclipse/cdt/core/parser/tests/ParserTestSuite.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.ui.tests/parser/org/eclipse/cdt/core/parser/tests/ParserTestSuite.java,v
retrieving revision 1.6
diff -u -r1.6 ParserTestSuite.java
--- parser/org/eclipse/cdt/core/parser/tests/ParserTestSuite.java 13 Jun 2003 15:01:12 -0000 1.6
+++ parser/org/eclipse/cdt/core/parser/tests/ParserTestSuite.java 13 Jun 2003 19:57:12 -0000
@@ -15,7 +15,6 @@
import junit.framework.TestSuite;
import org.eclipse.cdt.core.model.tests.CModelElementsTests;
-import org.eclipse.cdt.core.parser.failedTests.*;
/**
* @author jcamelon
Index: parser/org/eclipse/cdt/core/parser/tests/ScannerTestCase.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.ui.tests/parser/org/eclipse/cdt/core/parser/tests/ScannerTestCase.java,v
retrieving revision 1.22
diff -u -r1.22 ScannerTestCase.java
--- parser/org/eclipse/cdt/core/parser/tests/ScannerTestCase.java 9 Jun 2003 18:40:14 -0000 1.22
+++ parser/org/eclipse/cdt/core/parser/tests/ScannerTestCase.java 13 Jun 2003 19:57:12 -0000
@@ -4,9 +4,10 @@
import java.io.Writer;
import java.util.List;
-import org.eclipse.cdt.internal.core.parser.IMacroDescriptor;
+import org.eclipse.cdt.core.parser.IMacroDescriptor;
+import org.eclipse.cdt.core.parser.IToken;
+import org.eclipse.cdt.core.parser.ScannerException;
import org.eclipse.cdt.internal.core.parser.Parser;
-import org.eclipse.cdt.internal.core.parser.ScannerException;
import org.eclipse.cdt.internal.core.parser.Token;
/**
@@ -182,7 +183,7 @@
validateFloatingPointLiteral( "3.");
validateFloatingPointLiteral( "4E5");
validateFloatingPointLiteral( "2.01E-03" );
- validateToken( Token.tELIPSE );
+ validateToken( IToken.tELIPSE );
validateEOF();
}
catch( ScannerException se )
@@ -207,42 +208,42 @@
try
{
initializeScanner("#define SIMPLE_NUMERIC 5\nint x = SIMPLE_NUMERIC");
- validateToken(Token.t_int);
+ validateToken(IToken.t_int);
validateDefinition("SIMPLE_NUMERIC", "5");
validateIdentifier("x");
- validateToken(Token.tASSIGN);
+ validateToken(IToken.tASSIGN);
validateInteger("5");
validateEOF();
initializeScanner("#define SIMPLE_STRING \"This is a simple string.\"\n\nconst char * myVariable = SIMPLE_STRING;");
- validateToken(Token.t_const);
+ validateToken(IToken.t_const);
validateDefinition("SIMPLE_STRING", "\"This is a simple string.\"");
- validateToken(Token.t_char);
- validateToken(Token.tSTAR);
+ validateToken(IToken.t_char);
+ validateToken(IToken.tSTAR);
validateIdentifier("myVariable");
- validateToken(Token.tASSIGN);
+ validateToken(IToken.tASSIGN);
validateString("This is a simple string.");
- validateToken(Token.tSEMI);
+ validateToken(IToken.tSEMI);
validateEOF();
initializeScanner("#define FOOL 5 \n int tryAFOOL = FOOL + FOOL;");
- validateToken(Token.t_int);
+ validateToken(IToken.t_int);
validateIdentifier("tryAFOOL");
- validateToken(Token.tASSIGN);
+ validateToken(IToken.tASSIGN);
validateInteger("5");
- validateToken(Token.tPLUS);
+ validateToken(IToken.tPLUS);
validateInteger("5");
- validateToken(Token.tSEMI);
+ validateToken(IToken.tSEMI);
validateEOF();
initializeScanner("#define FOOL 5 \n int FOOLer = FOOL;");
- validateToken(Token.t_int);
+ validateToken(IToken.t_int);
validateIdentifier("FOOLer");
- validateToken(Token.tASSIGN);
+ validateToken(IToken.tASSIGN);
validateInteger("5");
- validateToken(Token.tSEMI);
+ validateToken(IToken.tSEMI);
validateEOF();
// the case we were failing against in ctype.h
@@ -384,13 +385,13 @@
try
{
initializeScanner("#define F1 3\n#define F2 F1##F1\nint x=F2;");
- validateToken(Token.t_int);
+ validateToken(IToken.t_int);
validateDefinition("F1", "3");
validateDefinition( "F2", "F1##F1");
validateIdentifier("x");
- validateToken(Token.tASSIGN);
+ validateToken(IToken.tASSIGN);
validateInteger("33");
- validateToken(Token.tSEMI);
+ validateToken(IToken.tSEMI);
validateEOF();
initializeScanner("#define PREFIX RT_\n#define RUN PREFIX##Run");
@@ -406,18 +407,18 @@
try
{
initializeScanner( "#define DECLARE_HANDLE(name) struct name##__ { int unused; }; typedef struct name##__ *name\n DECLARE_HANDLE( joe )" );
- validateToken( Token.t_struct );
+ validateToken( IToken.t_struct );
validateIdentifier( "joe__");
- validateToken( Token.tLBRACE);
- validateToken( Token.t_int );
+ validateToken( IToken.tLBRACE);
+ validateToken( IToken.t_int );
validateIdentifier( "unused");
- validateToken( Token.tSEMI );
- validateToken( Token.tRBRACE );
- validateToken( Token.tSEMI );
- validateToken( Token.t_typedef );
- validateToken( Token.t_struct );
+ validateToken( IToken.tSEMI );
+ validateToken( IToken.tRBRACE );
+ validateToken( IToken.tSEMI );
+ validateToken( IToken.t_typedef );
+ validateToken( IToken.t_struct );
validateIdentifier( "joe__" );
- validateToken( Token.tSTAR );
+ validateToken( IToken.tSTAR );
validateIdentifier( "joe");
validateEOF();
}
@@ -434,36 +435,36 @@
initializeScanner("#define SYMBOL 5\n#ifdef SYMBOL\nint counter(SYMBOL);\n#endif");
- validateToken(Token.t_int);
+ validateToken(IToken.t_int);
validateIdentifier("counter");
- validateToken(Token.tLPAREN);
+ validateToken(IToken.tLPAREN);
validateInteger("5");
- validateToken(Token.tRPAREN);
- validateToken(Token.tSEMI);
+ validateToken(IToken.tRPAREN);
+ validateToken(IToken.tSEMI);
validateEOF();
initializeScanner("#define SYMBOL 5\n#ifndef SYMBOL\nint counter(SYMBOL);\n#endif");
validateEOF();
initializeScanner("#ifndef DEFINED\n#define DEFINED 100\n#endif\nint count = DEFINED;");
- validateToken(Token.t_int);
+ validateToken(IToken.t_int);
validateDefinition("DEFINED", "100");
validateIdentifier("count");
- validateToken(Token.tASSIGN);
+ validateToken(IToken.tASSIGN);
validateInteger("100");
- validateToken(Token.tSEMI);
+ validateToken(IToken.tSEMI);
validateEOF();
initializeScanner("#ifndef DEFINED\n#define DEFINED 100\n#endif\nint count = DEFINED;");
scanner.addDefinition("DEFINED", "101");
validateDefinition("DEFINED", "101");
- validateToken(Token.t_int);
+ validateToken(IToken.t_int);
validateIdentifier("count");
- validateToken(Token.tASSIGN);
+ validateToken(IToken.tASSIGN);
validateInteger("101");
- validateToken(Token.tSEMI);
+ validateToken(IToken.tSEMI);
validateEOF();
initializeScanner( "/* NB: This is #if 0'd out */");
@@ -483,7 +484,7 @@
code.write( " + 44\n\nCOMPLEX_MACRO");
initializeScanner( code.toString() );
validateInteger( "33" );
- validateToken( Token.tPLUS );
+ validateToken( IToken.tPLUS );
validateInteger( "44" );
}
@@ -504,32 +505,32 @@
{
initializeScanner("#ifndef ONE\n#define ONE 1\n#ifdef TWO\n#define THREE ONE + TWO\n#endif\n#endif\nint three(THREE);");
- validateToken(Token.t_int);
+ validateToken(IToken.t_int);
validateDefinition("ONE", "1");
validateAsUndefined("TWO");
validateAsUndefined("THREE");
validateIdentifier("three");
- validateToken(Token.tLPAREN);
+ validateToken(IToken.tLPAREN);
validateIdentifier("THREE");
- validateToken(Token.tRPAREN);
- validateToken(Token.tSEMI);
+ validateToken(IToken.tRPAREN);
+ validateToken(IToken.tSEMI);
validateEOF();
validateBalance();
initializeScanner("#ifndef ONE\n#define ONE 1\n#ifdef TWO\n#define THREE ONE + TWO\n#endif\n#endif\nint three(THREE);");
scanner.addDefinition("TWO", "2");
- validateToken(Token.t_int);
+ validateToken(IToken.t_int);
validateDefinition("ONE", "1");
validateDefinition("TWO", "2");
validateDefinition("THREE", "ONE + TWO");
validateIdentifier("three");
- validateToken(Token.tLPAREN);
+ validateToken(IToken.tLPAREN);
validateInteger("1");
- validateToken(Token.tPLUS);
+ validateToken(IToken.tPLUS);
validateInteger("2");
- validateToken(Token.tRPAREN);
- validateToken(Token.tSEMI);
+ validateToken(IToken.tRPAREN);
+ validateToken(IToken.tSEMI);
validateEOF();
validateBalance();
@@ -685,7 +686,7 @@
try
{
initializeScanner("#if ! 0\n#error Correct!\n#endif");
- Token t= scanner.nextToken();
+ IToken t= scanner.nextToken();
fail(EXPECTED_FAILURE);
}
catch (ScannerException se)
@@ -704,12 +705,12 @@
try
{
initializeScanner("#define GO(x) x+1\nint y(5);\ny = GO(y);");
- validateToken(Token.t_int);
+ validateToken(IToken.t_int);
validateIdentifier("y");
- validateToken(Token.tLPAREN);
+ validateToken(IToken.tLPAREN);
validateInteger("5");
- validateToken(Token.tRPAREN);
- validateToken(Token.tSEMI);
+ validateToken(IToken.tRPAREN);
+ validateToken(IToken.tSEMI);
IMacroDescriptor descriptor=
(IMacroDescriptor) scanner.getDefinition("GO");
@@ -721,18 +722,18 @@
List expansion= descriptor.getTokenizedExpansion();
assertNotNull(parms);
assertTrue(expansion.size() == 3);
- assertTrue(((Token) expansion.get(0)).type == Token.tIDENTIFIER);
+ assertTrue(((Token) expansion.get(0)).type == IToken.tIDENTIFIER);
assertTrue(((Token) expansion.get(0)).image.equals("x"));
- assertTrue(((Token) expansion.get(1)).type == Token.tPLUS);
- assertTrue(((Token) expansion.get(2)).type == Token.tINTEGER);
+ assertTrue(((Token) expansion.get(1)).type == IToken.tPLUS);
+ assertTrue(((Token) expansion.get(2)).type == IToken.tINTEGER);
assertTrue(((Token) expansion.get(2)).image.equals("1"));
validateIdentifier("y");
- validateToken(Token.tASSIGN);
+ validateToken(IToken.tASSIGN);
validateIdentifier("y");
- validateToken(Token.tPLUS);
+ validateToken(IToken.tPLUS);
validateInteger("1");
- validateToken(Token.tSEMI);
+ validateToken(IToken.tSEMI);
validateEOF();
validateBalance();
@@ -740,25 +741,25 @@
"#define ONE 1\n"
+ "#define SUM(a,b,c,d,e,f,g) ( a + b + c + d + e + f + g )\n"
+ "int daSum = SUM(ONE,3,5,7,9,11,13);");
- validateToken(Token.t_int);
+ validateToken(IToken.t_int);
validateIdentifier("daSum");
- validateToken(Token.tASSIGN);
- validateToken(Token.tLPAREN);
+ validateToken(IToken.tASSIGN);
+ validateToken(IToken.tLPAREN);
validateInteger("1");
- validateToken(Token.tPLUS);
+ validateToken(IToken.tPLUS);
validateInteger("3");
- validateToken(Token.tPLUS);
+ validateToken(IToken.tPLUS);
validateInteger("5");
- validateToken(Token.tPLUS);
+ validateToken(IToken.tPLUS);
validateInteger("7");
- validateToken(Token.tPLUS);
+ validateToken(IToken.tPLUS);
validateInteger("9");
- validateToken(Token.tPLUS);
+ validateToken(IToken.tPLUS);
validateInteger("11");
- validateToken(Token.tPLUS);
+ validateToken(IToken.tPLUS);
validateInteger("13");
- validateToken(Token.tRPAREN);
- validateToken(Token.tSEMI);
+ validateToken(IToken.tRPAREN);
+ validateToken(IToken.tSEMI);
validateEOF();
IMacroDescriptor macro= (IMacroDescriptor) scanner.getDefinition("SUM");
@@ -772,61 +773,61 @@
initializeScanner("#define LOG( format, var1) printf( format, var1 )\nLOG( \"My name is %s\", \"Bogdan\" );\n");
validateIdentifier("printf");
- validateToken(Token.tLPAREN);
+ validateToken(IToken.tLPAREN);
validateString("My name is %s");
- validateToken(Token.tCOMMA);
+ validateToken(IToken.tCOMMA);
validateString("Bogdan");
- validateToken(Token.tRPAREN);
- validateToken(Token.tSEMI);
+ validateToken(IToken.tRPAREN);
+ validateToken(IToken.tSEMI);
validateEOF();
initializeScanner("#define INCR( x ) ++x\nint y(2);\nINCR(y);");
- validateToken(Token.t_int);
+ validateToken(IToken.t_int);
validateIdentifier("y");
- validateToken(Token.tLPAREN);
+ validateToken(IToken.tLPAREN);
validateInteger("2");
- validateToken(Token.tRPAREN);
- validateToken(Token.tSEMI);
- validateToken(Token.tINCR);
+ validateToken(IToken.tRPAREN);
+ validateToken(IToken.tSEMI);
+ validateToken(IToken.tINCR);
validateIdentifier("y");
- validateToken(Token.tSEMI);
+ validateToken(IToken.tSEMI);
validateEOF();
initializeScanner("#define CHECK_AND_SET( x, y, z ) if( x ) { \\\n y = z; \\\n }\n\nCHECK_AND_SET( 1, balance, 5000 );\nCHECK_AND_SET( confused(), you, dumb );");
- validateToken(Token.t_if);
- validateToken(Token.tLPAREN);
+ validateToken(IToken.t_if);
+ validateToken(IToken.tLPAREN);
validateInteger("1");
- validateToken(Token.tRPAREN);
- validateToken(Token.tLBRACE);
+ validateToken(IToken.tRPAREN);
+ validateToken(IToken.tLBRACE);
validateIdentifier("balance");
- validateToken(Token.tASSIGN);
+ validateToken(IToken.tASSIGN);
validateInteger("5000");
- validateToken(Token.tSEMI);
- validateToken(Token.tRBRACE);
- validateToken(Token.tSEMI);
+ validateToken(IToken.tSEMI);
+ validateToken(IToken.tRBRACE);
+ validateToken(IToken.tSEMI);
- validateToken(Token.t_if);
- validateToken(Token.tLPAREN);
+ validateToken(IToken.t_if);
+ validateToken(IToken.tLPAREN);
validateIdentifier("confused");
- validateToken(Token.tLPAREN);
- validateToken(Token.tRPAREN);
- validateToken(Token.tRPAREN);
- validateToken(Token.tLBRACE);
+ validateToken(IToken.tLPAREN);
+ validateToken(IToken.tRPAREN);
+ validateToken(IToken.tRPAREN);
+ validateToken(IToken.tLBRACE);
validateIdentifier("you");
- validateToken(Token.tASSIGN);
+ validateToken(IToken.tASSIGN);
validateIdentifier("dumb");
- validateToken(Token.tSEMI);
- validateToken(Token.tRBRACE);
- validateToken(Token.tSEMI);
+ validateToken(IToken.tSEMI);
+ validateToken(IToken.tRBRACE);
+ validateToken(IToken.tSEMI);
validateEOF();
initializeScanner("#define ON 7\n#if defined(ON)\nint itsOn = ON;\n#endif");
- validateToken(Token.t_int);
+ validateToken(IToken.t_int);
validateBalance(1);
validateIdentifier("itsOn");
- validateToken(Token.tASSIGN);
+ validateToken(IToken.tASSIGN);
validateInteger("7");
- validateToken(Token.tSEMI);
+ validateToken(IToken.tSEMI);
validateEOF();
validateBalance();
@@ -851,11 +852,11 @@
{
initializeScanner( "#if X + 5 < 7\n int found = 1;\n#endif" );
scanner.setQuickScan( true );
- validateToken( Token.t_int );
+ validateToken( IToken.t_int );
validateIdentifier( "found" );
- validateToken( Token.tASSIGN );
+ validateToken( IToken.tASSIGN );
validateInteger( "1");
- validateToken( Token.tSEMI );
+ validateToken( IToken.tSEMI );
validateEOF();
}
@@ -997,46 +998,46 @@
{
initializeScanner( "X::X( const X & rtg_arg ) : U( rtg_arg ) , Z( rtg_arg.Z ) , er( rtg_arg.er ){}" );
validateIdentifier("X");
- validateToken( Token.tCOLONCOLON);
+ validateToken( IToken.tCOLONCOLON);
validateIdentifier("X");
- validateToken( Token.tLPAREN );
- validateToken( Token.t_const );
+ validateToken( IToken.tLPAREN );
+ validateToken( IToken.t_const );
validateIdentifier("X");
- validateToken( Token.tAMPER );
+ validateToken( IToken.tAMPER );
validateIdentifier( "rtg_arg");
- validateToken( Token.tRPAREN );
- validateToken( Token.tCOLON );
+ validateToken( IToken.tRPAREN );
+ validateToken( IToken.tCOLON );
validateIdentifier( "U");
- validateToken( Token.tLPAREN );
+ validateToken( IToken.tLPAREN );
validateIdentifier( "rtg_arg");
- validateToken( Token.tRPAREN );
- validateToken( Token.tCOMMA );
+ validateToken( IToken.tRPAREN );
+ validateToken( IToken.tCOMMA );
validateIdentifier( "Z");
- validateToken( Token.tLPAREN );
+ validateToken( IToken.tLPAREN );
validateIdentifier( "rtg_arg");
- validateToken( Token.tDOT );
+ validateToken( IToken.tDOT );
validateIdentifier( "Z");
- validateToken( Token.tRPAREN );
- validateToken( Token.tCOMMA );
+ validateToken( IToken.tRPAREN );
+ validateToken( IToken.tCOMMA );
validateIdentifier( "er");
- validateToken( Token.tLPAREN );
+ validateToken( IToken.tLPAREN );
validateIdentifier( "rtg_arg");
- validateToken( Token.tDOT );
+ validateToken( IToken.tDOT );
validateIdentifier( "er");
- validateToken( Token.tRPAREN );
- validateToken( Token.tLBRACE);
- validateToken( Token.tRBRACE);
+ validateToken( IToken.tRPAREN );
+ validateToken( IToken.tLBRACE);
+ validateToken( IToken.tRBRACE);
validateEOF();
initializeScanner( "foo.*bar");
validateIdentifier("foo");
- validateToken( Token.tDOTSTAR );
+ validateToken( IToken.tDOTSTAR );
validateIdentifier("bar");
validateEOF();
initializeScanner( "foo...bar");
validateIdentifier("foo");
- validateToken( Token.tELIPSE );
+ validateToken( IToken.tELIPSE );
validateIdentifier("bar");
validateEOF();
}
@@ -1097,41 +1098,41 @@
break;
}
- validateToken( Token.t_int );
+ validateToken( IToken.t_int );
validateIdentifier( "foobar");
- validateToken( Token.tLPAREN );
- validateToken( Token.t_int );
+ validateToken( IToken.tLPAREN );
+ validateToken( IToken.t_int );
validateIdentifier( "a" );
- validateToken( Token.tRPAREN );
- validateToken( Token.tLBRACE );
- validateToken( Token.t_if );
- validateToken( Token.tLPAREN );
+ validateToken( IToken.tRPAREN );
+ validateToken( IToken.tLBRACE );
+ validateToken( IToken.t_if );
+ validateToken( IToken.tLPAREN );
validateIdentifier( "a" );
- validateToken( Token.tEQUAL );
+ validateToken( IToken.tEQUAL );
validateInteger( "0" );
- validateToken( Token.tRPAREN );
- validateToken( Token.tLBRACE );
+ validateToken( IToken.tRPAREN );
+ validateToken( IToken.tLBRACE );
if( i <= 1 )
{
- validateToken( Token.tRBRACE );
- validateToken( Token.t_else );
- validateToken( Token.tLBRACE );
- validateToken( Token.tRBRACE );
+ validateToken( IToken.tRBRACE );
+ validateToken( IToken.t_else );
+ validateToken( IToken.tLBRACE );
+ validateToken( IToken.tRBRACE );
}
if( i == 2 )
{
- validateToken( Token.tRBRACE );
- validateToken( Token.t_else );
- validateToken( Token.tLBRACE );
- validateToken( Token.tRBRACE );
+ validateToken( IToken.tRBRACE );
+ validateToken( IToken.t_else );
+ validateToken( IToken.tLBRACE );
+ validateToken( IToken.tRBRACE );
}
- validateToken( Token.t_return );
+ validateToken( IToken.t_return );
validateInteger( "0");
- validateToken( Token.tSEMI );
- validateToken( Token.tRBRACE );
+ validateToken( IToken.tSEMI );
+ validateToken( IToken.tRBRACE );
validateEOF();
}
} catch( ScannerException se )
@@ -1160,7 +1161,7 @@
validateIdentifier("B");
validateDefinition("A", "B->A");
- validateToken(Token.tARROW);
+ validateToken(IToken.tARROW);
validateIdentifier("A");
validateEOF();
}
@@ -1218,14 +1219,14 @@
initializeScanner( writer.toString() );
//printf("x1=%d, x2= %s", x1, x2);
validateIdentifier( "printf" );
- validateToken( Token.tLPAREN );
+ validateToken( IToken.tLPAREN );
validateString("x1= %d, x2= %s");
- validateToken(Token.tCOMMA);
+ validateToken(IToken.tCOMMA);
validateIdentifier("x1");
- validateToken(Token.tCOMMA);
+ validateToken(IToken.tCOMMA);
validateIdentifier("x2");
- validateToken(Token.tRPAREN);
- validateToken(Token.tSEMI);
+ validateToken(IToken.tRPAREN);
+ validateToken(IToken.tSEMI);
validateEOF();
}
@@ -1249,12 +1250,12 @@
initializeScanner( writer.toString() );
validateIdentifier("fputs");
- validateToken(Token.tLPAREN);
+ validateToken(IToken.tLPAREN);
validateString("strncmp ( \\\"abc\\\\0d\\\" , \\\"abc\\\" , '\\\\4' ) == 0");
- validateToken(Token.tCOMMA);
+ validateToken(IToken.tCOMMA);
validateIdentifier("s");
- validateToken(Token.tRPAREN);
- validateToken(Token.tSEMI);
+ validateToken(IToken.tRPAREN);
+ validateToken(IToken.tSEMI);
}
public void testBug36770() throws Exception
Index: dom/org/eclipse/cdt/internal/core/dom/ClassSpecifier.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/dom/org/eclipse/cdt/internal/core/dom/ClassSpecifier.java,v
retrieving revision 1.11
diff -u -r1.11 ClassSpecifier.java
--- dom/org/eclipse/cdt/internal/core/dom/ClassSpecifier.java 13 Jun 2003 15:01:22 -0000 1.11
+++ dom/org/eclipse/cdt/internal/core/dom/ClassSpecifier.java 13 Jun 2003 19:56:27 -0000
@@ -4,8 +4,8 @@
import java.util.LinkedList;
import java.util.List;
+import org.eclipse.cdt.core.parser.IToken;
import org.eclipse.cdt.internal.core.parser.Name;
-import org.eclipse.cdt.internal.core.parser.Token;
public class ClassSpecifier extends TypeSpecifier implements IScope, IOffsetable, IAccessable {
@@ -13,7 +13,7 @@
private ClassKey key = new ClassKey();
private int startingOffset = 0, totalLength = 0;
private int topLine = 0, bottomLine = 0;
- private Token classKeyToken = null;
+ private IToken classKeyToken = null;
public int getClassKey() { return key.getClassKey(); }
@@ -88,7 +88,7 @@
* Returns the classKeyToken.
* @return Token
*/
- public Token getClassKeyToken() {
+ public IToken getClassKeyToken() {
return classKeyToken;
}
@@ -96,7 +96,7 @@
* Sets the classKeyToken.
* @param classKeyToken The classKeyToken to set
*/
- public void setClassKeyToken(Token classKeyToken) {
+ public void setClassKeyToken(IToken classKeyToken) {
this.classKeyToken = classKeyToken;
}
Index: dom/org/eclipse/cdt/internal/core/dom/DOMBuilder.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/dom/org/eclipse/cdt/internal/core/dom/DOMBuilder.java,v
retrieving revision 1.33
diff -u -r1.33 DOMBuilder.java
--- dom/org/eclipse/cdt/internal/core/dom/DOMBuilder.java 13 Jun 2003 15:01:22 -0000 1.33
+++ dom/org/eclipse/cdt/internal/core/dom/DOMBuilder.java 13 Jun 2003 19:56:28 -0000
@@ -2,14 +2,15 @@
import org.eclipse.cdt.core.parser.IParser;
+import org.eclipse.cdt.core.parser.IParserCallback;
import org.eclipse.cdt.core.parser.IProblem;
import org.eclipse.cdt.core.parser.ISourceElementRequestor;
+import org.eclipse.cdt.core.parser.IToken;
import org.eclipse.cdt.core.parser.ast.IASTASMDefinition;
import org.eclipse.cdt.core.parser.ast.IASTClassSpecifier;
import org.eclipse.cdt.core.parser.ast.IASTCompilationUnit;
import org.eclipse.cdt.core.parser.ast.IASTConstructor;
-import org.eclipse.cdt.core.parser.ast.IASTEnumSpecifier;
-import org.eclipse.cdt.core.parser.ast.IASTEnumerator;
+import org.eclipse.cdt.core.parser.ast.IASTEnumerationSpecifier;
import org.eclipse.cdt.core.parser.ast.IASTField;
import org.eclipse.cdt.core.parser.ast.IASTFunction;
import org.eclipse.cdt.core.parser.ast.IASTInclusion;
@@ -24,9 +25,7 @@
import org.eclipse.cdt.core.parser.ast.IASTUsingDeclaration;
import org.eclipse.cdt.core.parser.ast.IASTUsingDirective;
import org.eclipse.cdt.core.parser.ast.IASTVariable;
-import org.eclipse.cdt.internal.core.parser.IParserCallback;
import org.eclipse.cdt.internal.core.parser.Name;
-import org.eclipse.cdt.internal.core.parser.Token;
/**
* This is the parser callback that creates objects in the DOM.
@@ -59,21 +58,21 @@
/**
* @see org.eclipse.cdt.internal.core.newparser.IParserCallback#classBegin(java.lang.String, org.eclipse.cdt.internal.core.newparser.Token)
*/
- public Object classSpecifierBegin(Object container, Token classKey) {
+ public Object classSpecifierBegin(Object container, IToken classKey) {
TypeSpecifier.IOwner decl = (TypeSpecifier.IOwner)container;
int kind = ClassKey.t_struct;
int visibility = AccessSpecifier.v_public;
switch (classKey.getType()) {
- case Token.t_class:
+ case IToken.t_class:
kind = ClassKey.t_class;
visibility = AccessSpecifier.v_private;
break;
- case Token.t_struct:
+ case IToken.t_struct:
kind = ClassKey.t_struct;
break;
- case Token.t_union:
+ case IToken.t_union:
kind = ClassKey.t_union;
break;
}
@@ -98,7 +97,7 @@
/**
* @see org.eclipse.cdt.internal.core.newparser.IParserCallback#classEnd()
*/
- public void classSpecifierEnd(Object classSpecifier, Token closingBrace) {
+ public void classSpecifierEnd(Object classSpecifier, IToken closingBrace) {
ClassSpecifier c = (ClassSpecifier)classSpecifier;
c.setTotalLength( closingBrace.getOffset() + closingBrace.getLength() - c.getStartingOffset() );
domScopes.pop();
@@ -144,7 +143,7 @@
/**
* @see org.eclipse.cdt.internal.core.newparser.IParserCallback#declSpecifier(org.eclipse.cdt.internal.core.newparser.Token)
*/
- public void simpleDeclSpecifier(Object Container, Token specifier) {
+ public void simpleDeclSpecifier(Object Container, IToken specifier) {
DeclSpecifier.IContainer decl = (DeclSpecifier.IContainer)Container;
DeclSpecifier declSpec = decl.getDeclSpecifier();
declSpec.setType( specifier );
@@ -155,7 +154,7 @@
/**
* @see org.eclipse.cdt.internal.core.newparser.IParserCallback#expressionOperator(org.eclipse.cdt.internal.core.newparser.Token)
*/
- public void expressionOperator(Object expression, Token operator){
+ public void expressionOperator(Object expression, IToken operator){
Expression e = (Expression)expression;
e.add( operator );
}
@@ -163,7 +162,7 @@
/**
* @see org.eclipse.cdt.internal.core.newparser.IParserCallback#expressionTerminal(org.eclipse.cdt.internal.core.newparser.Token)
*/
- public void expressionTerminal(Object expression, Token terminal){
+ public void expressionTerminal(Object expression, IToken terminal){
Expression e = (Expression)expression;
e.add( terminal );
}
@@ -216,7 +215,7 @@
/**
* @see org.eclipse.cdt.internal.core.newparser.IParserCallback#simpleDeclarationBegin(org.eclipse.cdt.internal.core.newparser.Token)
*/
- public Object simpleDeclarationBegin(Object container, Token firstToken) {
+ public Object simpleDeclarationBegin(Object container, IToken firstToken) {
SimpleDeclaration decl = new SimpleDeclaration( getCurrentDOMScope() );
if( getCurrentDOMScope() instanceof IAccessable )
decl.setAccessSpecifier(new AccessSpecifier( ((IAccessable)getCurrentDOMScope()).getVisibility() ));
@@ -227,7 +226,7 @@
/**
* @see org.eclipse.cdt.internal.core.newparser.IParserCallback#simpleDeclarationEnd(org.eclipse.cdt.internal.core.newparser.Token)
*/
- public void simpleDeclarationEnd(Object declaration, Token lastToken) {
+ public void simpleDeclarationEnd(Object declaration, IToken lastToken) {
SimpleDeclaration decl = (SimpleDeclaration)declaration;
IOffsetable offsetable = (IOffsetable)decl;
offsetable.setTotalLength( lastToken.getOffset() + lastToken.getLength() - offsetable.getStartingOffset());
@@ -252,14 +251,14 @@
/**
* @see org.eclipse.cdt.internal.core.newparser.IParserCallback#nameBegin(org.eclipse.cdt.internal.core.newparser.Token)
*/
- public void nameBegin(Token firstToken) {
+ public void nameBegin(IToken firstToken) {
currName = new Name(firstToken);
}
/**
* @see org.eclipse.cdt.internal.core.newparser.IParserCallback#nameEnd(org.eclipse.cdt.internal.core.newparser.Token)
*/
- public void nameEnd(Token lastToken) {
+ public void nameEnd(IToken lastToken) {
currName.setEnd(lastToken);
}
@@ -281,18 +280,18 @@
bs.setVirtual( virtual );
}
- public void baseSpecifierVisibility( Object baseSpecifier, Token visibility )
+ public void baseSpecifierVisibility( Object baseSpecifier, IToken visibility )
{
int access = AccessSpecifier.v_public;
- switch( visibility.type )
+ switch( visibility.getType() )
{
- case Token.t_public:
+ case IToken.t_public:
access = AccessSpecifier.v_public;
break;
- case Token.t_protected:
+ case IToken.t_protected:
access = AccessSpecifier.v_protected;
break;
- case Token.t_private:
+ case IToken.t_private:
access = AccessSpecifier.v_private;
break;
default:
@@ -353,20 +352,20 @@
/**
* @see org.eclipse.cdt.internal.core.parser.IParserCallback#elaboratedTypeSpecifierBegin(java.lang.Object)
*/
- public Object elaboratedTypeSpecifierBegin(Object container, Token classKey) {
+ public Object elaboratedTypeSpecifierBegin(Object container, IToken classKey) {
int kind = ClassKey.t_struct;
switch (classKey.getType()) {
- case Token.t_class:
+ case IToken.t_class:
kind = ClassKey.t_class;
break;
- case Token.t_struct:
+ case IToken.t_struct:
kind = ClassKey.t_struct;
break;
- case Token.t_union:
+ case IToken.t_union:
kind = ClassKey.t_union;
break;
- case Token.t_enum:
+ case IToken.t_enum:
kind = ClassKey.t_enum;
break;
}
@@ -409,17 +408,17 @@
/* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.parser.IParserCallback#classMemberVisibility(java.lang.Object, org.eclipse.cdt.internal.core.parser.Token)
*/
- public void classMemberVisibility(Object classSpecifier, Token visibility) {
+ public void classMemberVisibility(Object classSpecifier, IToken visibility) {
ClassSpecifier spec = (ClassSpecifier)classSpecifier;
switch( visibility.getType() )
{
- case Token.t_public:
+ case IToken.t_public:
spec.setVisibility( AccessSpecifier.v_public );
break;
- case Token.t_protected:
+ case IToken.t_protected:
spec.setVisibility( AccessSpecifier.v_protected );
break;
- case Token.t_private:
+ case IToken.t_private:
spec.setVisibility( AccessSpecifier.v_private );
break;
}
@@ -453,14 +452,14 @@
/* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.parser.IParserCallback#pointerOperatorType(java.lang.Object, org.eclipse.cdt.internal.core.parser.Token)
*/
- public void pointerOperatorType(Object ptrOperator, Token type) {
+ public void pointerOperatorType(Object ptrOperator, IToken type) {
PointerOperator ptrOp = (PointerOperator)ptrOperator;
switch( type.getType() )
{
- case Token.tSTAR:
+ case IToken.tSTAR:
ptrOp.setType( PointerOperator.t_pointer );
break;
- case Token.tAMPER:
+ case IToken.tAMPER:
ptrOp.setType( PointerOperator.t_reference );
break;
default:
@@ -471,14 +470,14 @@
/* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.parser.IParserCallback#pointerOperatorCVModifier(java.lang.Object, org.eclipse.cdt.internal.core.parser.Token)
*/
- public void pointerOperatorCVModifier(Object ptrOperator, Token modifier) {
+ public void pointerOperatorCVModifier(Object ptrOperator, IToken modifier) {
PointerOperator ptrOp = (PointerOperator)ptrOperator;
switch( modifier.getType() )
{
- case Token.t_const:
+ case IToken.t_const:
ptrOp.setConst(true);
break;
- case Token.t_volatile:
+ case IToken.t_volatile:
ptrOp.setVolatile( true );
break;
default:
@@ -489,14 +488,14 @@
/* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.parser.IParserCallback#declaratorCVModifier(java.lang.Object, org.eclipse.cdt.internal.core.parser.Token)
*/
- public void declaratorCVModifier(Object declarator, Token modifier) {
+ public void declaratorCVModifier(Object declarator, IToken modifier) {
Declarator decl = (Declarator)declarator;
switch( modifier.getType() )
{
- case Token.t_const:
+ case IToken.t_const:
decl.setConst(true);
break;
- case Token.t_volatile:
+ case IToken.t_volatile:
decl.setVolatile( true );
break;
default:
@@ -544,7 +543,7 @@
/* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.parser.IParserCallback#namespaceDeclarationBegin(java.lang.Object)
*/
- public Object namespaceDefinitionBegin(Object container, Token namespace) {
+ public Object namespaceDefinitionBegin(Object container, IToken namespace) {
// IScope ownerScope = (IScope)container;
// NamespaceDefinition namespaceDef = new NamespaceDefinition(ownerScope);
// namespaceDef.setStartToken(namespace);
@@ -570,7 +569,7 @@
/* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.parser.IParserCallback#namespaceDeclarationEnd(java.lang.Object)
*/
- public void namespaceDefinitionEnd(Object namespace, Token closingBrace) {
+ public void namespaceDefinitionEnd(Object namespace, IToken closingBrace) {
// NamespaceDefinition ns = (NamespaceDefinition)namespace;
// ns.setTotalLength( closingBrace.getOffset() + closingBrace.getLength() - ns.getStartingOffset() );
// ns.getOwnerScope().addDeclaration(ns);
@@ -662,7 +661,7 @@
/* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.parser.IParserCallback#enumSpecifierBegin(java.lang.Object)
*/
- public Object enumSpecifierBegin(Object container, Token enumKey) {
+ public Object enumSpecifierBegin(Object container, IToken enumKey) {
TypeSpecifier.IOwner decl = (TypeSpecifier.IOwner)container;
EnumerationSpecifier es = new EnumerationSpecifier( decl );
es.setStartToken(enumKey);
@@ -690,7 +689,7 @@
/* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.parser.IParserCallback#enumSpecifierEnd(java.lang.Object)
*/
- public void enumSpecifierEnd(Object enumSpec, Token closingBrace) {
+ public void enumSpecifierEnd(Object enumSpec, IToken closingBrace) {
IOffsetable offsetable = (IOffsetable)enumSpec;
offsetable.setTotalLength( closingBrace.getOffset() + closingBrace.getLength() - offsetable.getStartingOffset());
}
@@ -717,7 +716,7 @@
/* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.parser.IParserCallback#enumDefinitionEnd(java.lang.Object)
*/
- public void enumeratorEnd(Object enumDefn, Token lastToken) {
+ public void enumeratorEnd(Object enumDefn, IToken lastToken) {
IOffsetable offsetable = (IOffsetable)enumDefn;
offsetable.setTotalLength( lastToken.getOffset() + lastToken.getLength() - offsetable.getStartingOffset());
}
@@ -838,7 +837,7 @@
/* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.parser.IParserCallback#templateDeclarationBegin(java.lang.Object, boolean)
*/
- public Object templateDeclarationBegin(Object container, Token exported) {
+ public Object templateDeclarationBegin(Object container, IToken exported) {
TemplateDeclaration d = new TemplateDeclaration( (IScope)getCurrentDOMScope(), exported );
if( getCurrentDOMScope() instanceof IAccessable )
d.setVisibility( ((IAccessable)container).getVisibility() );
@@ -857,7 +856,7 @@
/* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.parser.IParserCallback#templateDeclarationEnd(java.lang.Object)
*/
- public void templateDeclarationEnd(Object templateDecl, Token lastToken) {
+ public void templateDeclarationEnd(Object templateDecl, IToken lastToken) {
TemplateDeclaration decl = (TemplateDeclaration)domScopes.pop();
decl.setLastToken(lastToken);
decl.getOwnerScope().addDeclaration(decl);
@@ -867,18 +866,18 @@
/* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.parser.IParserCallback#templateTypeParameterBegin(java.lang.Object, org.eclipse.cdt.internal.core.parser.Token)
*/
- public Object templateTypeParameterBegin(Object templDecl, Token kind) {
+ public Object templateTypeParameterBegin(Object templDecl, IToken kind) {
TemplateParameterList list = (TemplateParameterList)templDecl;
int k;
switch( kind.getType() )
{
- case Token.t_class:
+ case IToken.t_class:
k = TemplateParameter.k_class;
break;
- case Token.t_typename:
+ case IToken.t_typename:
k= TemplateParameter.k_typename;
break;
- case Token.t_template:
+ case IToken.t_template:
k= TemplateParameter.k_template;
break;
default:
@@ -1051,30 +1050,6 @@
}
/* (non-Javadoc)
- * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#enterEnumSpecifier(org.eclipse.cdt.core.parser.ast.IASTEnumSpecifier)
- */
- public void enterEnumSpecifier(IASTEnumSpecifier enumSpec) {
- // TODO Auto-generated method stub
-
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptEnumerator(org.eclipse.cdt.core.parser.ast.IASTEnumerator)
- */
- public void acceptEnumerator(IASTEnumerator enumerator) {
- // TODO Auto-generated method stub
-
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#exitEnumSpecifier(org.eclipse.cdt.core.parser.ast.IASTEnumSpecifier)
- */
- public void exitEnumSpecifier(IASTEnumSpecifier enumSpec) {
- // TODO Auto-generated method stub
-
- }
-
- /* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ISourceElementRequestor#enterFunctionBody(org.eclipse.cdt.core.parser.ast.IASTFunction)
*/
public void enterFunctionBody(IASTFunction function) {
@@ -1271,5 +1246,20 @@
private IScope getCurrentDOMScope()
{
return domScopes.peek();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptEnumerationSpecifier(org.eclipse.cdt.core.parser.ast.IASTEnumerationSpecifier)
+ */
+ public void acceptEnumerationSpecifier(IASTEnumerationSpecifier enumeration) {
+ // TODO Auto-generated method stub
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptClassReference(org.eclipse.cdt.core.parser.ast.IASTClassSpecifier, int)
+ */
+ public void acceptClassReference(IASTClassSpecifier classSpecifier, int referenceOffset) {
+ // TODO Auto-generated method stub
+
}
}
Index: dom/org/eclipse/cdt/internal/core/dom/DeclSpecifier.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/dom/org/eclipse/cdt/internal/core/dom/DeclSpecifier.java,v
retrieving revision 1.5
diff -u -r1.5 DeclSpecifier.java
--- dom/org/eclipse/cdt/internal/core/dom/DeclSpecifier.java 13 Jun 2003 15:01:22 -0000 1.5
+++ dom/org/eclipse/cdt/internal/core/dom/DeclSpecifier.java 13 Jun 2003 19:56:28 -0000
@@ -2,8 +2,8 @@
import java.util.List;
+import org.eclipse.cdt.core.parser.IToken;
import org.eclipse.cdt.internal.core.parser.Name;
-import org.eclipse.cdt.internal.core.parser.Token;
/**
* @author jcamelon
@@ -168,81 +168,81 @@
public static final int t_double = 6;
public static final int t_void = 7;
- public void setType(Token token) {
+ public void setType(IToken token) {
switch (token.getType()) {
- case Token.t_typename:
+ case IToken.t_typename:
setTypename(true);
break;
- case Token.t_auto :
+ case IToken.t_auto :
setAuto(true);
break;
- case Token.t_register :
+ case IToken.t_register :
setRegister(true);
break;
- case Token.t_static :
+ case IToken.t_static :
setStatic(true);
break;
- case Token.t_extern :
+ case IToken.t_extern :
setExtern(true);
break;
- case Token.t_mutable :
+ case IToken.t_mutable :
setMutable(true);
break;
- case Token.t_inline :
+ case IToken.t_inline :
setInline(true);
break;
- case Token.t_virtual :
+ case IToken.t_virtual :
setVirtual(true);
break;
- case Token.t_explicit :
+ case IToken.t_explicit :
setExplicit(true);
break;
- case Token.t_typedef :
+ case IToken.t_typedef :
setTypedef(true);
break;
- case Token.t_friend :
+ case IToken.t_friend :
setFriend(true);
break;
- case Token.t_const :
+ case IToken.t_const :
setConst(true);
break;
- case Token.t_volatile :
+ case IToken.t_volatile :
setVolatile(true);
break;
- case Token.t_char :
+ case IToken.t_char :
setType(DeclSpecifier.t_char);
break;
- case Token.t_wchar_t :
+ case IToken.t_wchar_t :
setType(DeclSpecifier.t_wchar_t);
break;
- case Token.t_bool :
+ case IToken.t_bool :
setType(DeclSpecifier.t_bool);
break;
- case Token.t_short :
+ case IToken.t_short :
setShort(true);
break;
- case Token.t_int :
+ case IToken.t_int :
setType(DeclSpecifier.t_int);
break;
- case Token.t_long :
+ case IToken.t_long :
setLong(true);
break;
- case Token.t_signed :
+ case IToken.t_signed :
setUnsigned(false);
break;
- case Token.t_unsigned :
+ case IToken.t_unsigned :
setUnsigned(true);
break;
- case Token.t_float :
+ case IToken.t_float :
setType(DeclSpecifier.t_float);
break;
- case Token.t_double :
+ case IToken.t_double :
setType(DeclSpecifier.t_double);
break;
- case Token.t_void :
+ case IToken.t_void :
setType(DeclSpecifier.t_void);
break;
- case Token.tIDENTIFIER :
+ case IToken.tIDENTIFIER :
setType(DeclSpecifier.t_type);
break;
}
Index: dom/org/eclipse/cdt/internal/core/dom/EnumerationSpecifier.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/dom/org/eclipse/cdt/internal/core/dom/EnumerationSpecifier.java,v
retrieving revision 1.9
diff -u -r1.9 EnumerationSpecifier.java
--- dom/org/eclipse/cdt/internal/core/dom/EnumerationSpecifier.java 13 Jun 2003 15:01:22 -0000 1.9
+++ dom/org/eclipse/cdt/internal/core/dom/EnumerationSpecifier.java 13 Jun 2003 19:56:28 -0000
@@ -16,8 +16,8 @@
import java.util.Collections;
import java.util.List;
+import org.eclipse.cdt.core.parser.IToken;
import org.eclipse.cdt.internal.core.parser.Name;
-import org.eclipse.cdt.internal.core.parser.Token;
/**
* @author jcamelon
@@ -32,7 +32,7 @@
private Name name = null;
private List enumeratorDefinitions = new ArrayList();
private int startingOffset = 0, totalLength = 0;
- private Token startToken = null;
+ private IToken startToken = null;
public void addEnumeratorDefinition( EnumeratorDefinition def )
{
@@ -94,7 +94,7 @@
* Returns the startToken.
* @return Token
*/
- public Token getStartToken() {
+ public IToken getStartToken() {
return startToken;
}
@@ -102,7 +102,7 @@
* Sets the startToken.
* @param startToken The startToken to set
*/
- public void setStartToken(Token startToken) {
+ public void setStartToken(IToken startToken) {
this.startToken = startToken;
}
Index: dom/org/eclipse/cdt/internal/core/dom/Expression.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/dom/org/eclipse/cdt/internal/core/dom/Expression.java,v
retrieving revision 1.5
diff -u -r1.5 Expression.java
--- dom/org/eclipse/cdt/internal/core/dom/Expression.java 13 Jun 2003 15:01:22 -0000 1.5
+++ dom/org/eclipse/cdt/internal/core/dom/Expression.java 13 Jun 2003 19:56:28 -0000
@@ -15,8 +15,8 @@
import java.util.Collections;
import java.util.List;
+import org.eclipse.cdt.core.parser.IToken;
import org.eclipse.cdt.internal.core.parser.Name;
-import org.eclipse.cdt.internal.core.parser.Token;
/**
* @author jcamelon
@@ -26,7 +26,7 @@
private List tokens = new ArrayList();
- public void add( Token t )
+ public void add( IToken t )
{
tokens.add( t );
}
Index: dom/org/eclipse/cdt/internal/core/dom/LineNumberedDOMBuilder.java
===================================================================
RCS file: dom/org/eclipse/cdt/internal/core/dom/LineNumberedDOMBuilder.java
diff -N dom/org/eclipse/cdt/internal/core/dom/LineNumberedDOMBuilder.java
--- dom/org/eclipse/cdt/internal/core/dom/LineNumberedDOMBuilder.java 5 Jun 2003 20:01:54 -0000 1.2
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,166 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2002,2003 Rational Software Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v0.5
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v05.html
- *
- * Contributors:
- * IBM Rational Software - Initial API and implementation
-***********************************************************************/
-package org.eclipse.cdt.internal.core.dom;
-
-import org.eclipse.cdt.internal.core.parser.Token;
-
-/**
- * @author jcamelon
- */
-public class LineNumberedDOMBuilder extends DOMBuilder {
-
- protected LineNumberedDOMBuilder()
- {
- }
-
- protected void setLineNumber( IOffsetable element, int offset, boolean topLine )
- {
- try
- {
- if( topLine )
- element.setTopLine( parser.getLineNumberForOffset( offset ));
- else
- element.setBottomLine( parser.getLineNumberForOffset( offset ));
- }
- catch( NoSuchMethodException nsm )
- {
- System.out.println( "Incorrect parser setup to get line numbers");
- }
- }
- /* (non-Javadoc)
- * @see org.eclipse.cdt.internal.core.parser.IParserCallback#classSpecifierBegin(java.lang.Object, org.eclipse.cdt.internal.core.parser.Token)
- */
- public Object classSpecifierBegin(Object container, Token classKey) {
- Object returnValue = super.classSpecifierBegin(container, classKey);
- setLineNumber( (IOffsetable)returnValue, classKey.getOffset(), true );
- return returnValue;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.cdt.internal.core.parser.IParserCallback#classSpecifierEnd(java.lang.Object, org.eclipse.cdt.internal.core.parser.Token)
- */
- public void classSpecifierEnd(Object classSpecifier, Token closingBrace) {
- super.classSpecifierEnd(classSpecifier, closingBrace);
- setLineNumber( (IOffsetable)classSpecifier, closingBrace.getOffset() + closingBrace.getLength(), false );
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.cdt.internal.core.parser.IParserCallback#enumeratorEnd(java.lang.Object, org.eclipse.cdt.internal.core.parser.Token)
- */
- public void enumeratorEnd(Object enumDefn, Token lastToken) {
- super.enumeratorEnd(enumDefn, lastToken);
- setLineNumber( (IOffsetable)enumDefn, lastToken.getOffset() + lastToken.getLength(), false );
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.cdt.internal.core.parser.IParserCallback#enumeratorId(java.lang.Object)
- */
- public void enumeratorId(Object enumDefn) {
- super.enumeratorId(enumDefn);
- setLineNumber( (IOffsetable)enumDefn, currName.getStartOffset(), true );
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.cdt.internal.core.parser.IParserCallback#enumSpecifierBegin(java.lang.Object, org.eclipse.cdt.internal.core.parser.Token)
- */
- public Object enumSpecifierBegin(Object container, Token enumKey) {
- Object returnValue = super.enumSpecifierBegin(container, enumKey);
- setLineNumber( (IOffsetable)returnValue, enumKey.getOffset(), true);
- return returnValue;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.cdt.internal.core.parser.IParserCallback#enumSpecifierEnd(java.lang.Object, org.eclipse.cdt.internal.core.parser.Token)
- */
- public void enumSpecifierEnd(Object enumSpec, Token closingBrace) {
- super.enumSpecifierEnd(enumSpec, closingBrace);
- setLineNumber( (IOffsetable)enumSpec, closingBrace.getOffset() + closingBrace.getLength(), false);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.cdt.internal.core.parser.IParserCallback#inclusionBegin(java.lang.String, int, int)
- */
- public Object inclusionBegin(
- String includeFile,
- int offset,
- int inclusionBeginOffset, boolean local) {
- Object inclusion = super.inclusionBegin(includeFile, offset, inclusionBeginOffset, local);
- setLineNumber( (IOffsetable)inclusion, inclusionBeginOffset, true );
- setLineNumber( (IOffsetable)inclusion, offset + includeFile.length() + 1, false );
- return inclusion;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.cdt.internal.core.parser.IParserCallback#macro(java.lang.String, int, int, int)
- */
- public Object macro(
- String macroName,
- int offset,
- int macroBeginOffset,
- int macroEndOffset) {
- Object macro = super.macro(macroName, offset, macroBeginOffset, macroEndOffset);
- setLineNumber( (IOffsetable) macro, macroBeginOffset, true );
- setLineNumber( (IOffsetable) macro, macroEndOffset, false );
- return macro;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.cdt.internal.core.parser.IParserCallback#namespaceDefinitionBegin(java.lang.Object, org.eclipse.cdt.internal.core.parser.Token)
- */
- public Object namespaceDefinitionBegin(Object container, Token namespace) {
- Object namespaceDef = super.namespaceDefinitionBegin(container, namespace);
- setLineNumber( (IOffsetable)namespaceDef, namespace.getOffset(), true);
- return namespaceDef;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.cdt.internal.core.parser.IParserCallback#namespaceDefinitionEnd(java.lang.Object, org.eclipse.cdt.internal.core.parser.Token)
- */
- public void namespaceDefinitionEnd(Object namespace, Token closingBrace) {
- super.namespaceDefinitionEnd(namespace, closingBrace);
- setLineNumber( (IOffsetable)namespace, closingBrace.getOffset() + closingBrace.getLength(), false);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.cdt.internal.core.parser.IParserCallback#simpleDeclarationBegin(java.lang.Object, org.eclipse.cdt.internal.core.parser.Token)
- */
- public Object simpleDeclarationBegin(Object container, Token firstToken) {
- Object retval = super.simpleDeclarationBegin(container, firstToken);
- setLineNumber( (IOffsetable)retval, firstToken.getOffset(), true );
- return retval;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.cdt.internal.core.parser.IParserCallback#simpleDeclarationEnd(java.lang.Object, org.eclipse.cdt.internal.core.parser.Token)
- */
- public void simpleDeclarationEnd(Object declaration, Token lastToken) {
- super.simpleDeclarationEnd(declaration, lastToken);
- setLineNumber( (IOffsetable)declaration, lastToken.getOffset() + lastToken.getLength(), false );
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.cdt.internal.core.parser.IParserCallback#templateDeclarationBegin(java.lang.Object, org.eclipse.cdt.internal.core.parser.Token)
- */
- public Object templateDeclarationBegin(Object container, Token exported) {
- Object template = super.templateDeclarationBegin(container, exported);
- setLineNumber( (IOffsetable)template, exported.getOffset(), true );
- return template;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.cdt.internal.core.parser.IParserCallback#templateDeclarationEnd(java.lang.Object, org.eclipse.cdt.internal.core.parser.Token)
- */
- public void templateDeclarationEnd(Object templateDecl, Token lastToken) {
- super.templateDeclarationEnd(templateDecl, lastToken);
- setLineNumber( (IOffsetable)templateDecl, lastToken.getOffset() + lastToken.getLength(), false);
- }
-
-}
Index: dom/org/eclipse/cdt/internal/core/dom/Name.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/dom/org/eclipse/cdt/internal/core/dom/Name.java,v
retrieving revision 1.2
diff -u -r1.2 Name.java
--- dom/org/eclipse/cdt/internal/core/dom/Name.java 10 Jun 2003 14:41:40 -0000 1.2
+++ dom/org/eclipse/cdt/internal/core/dom/Name.java 13 Jun 2003 19:56:28 -0000
@@ -1,5 +1,6 @@
package org.eclipse.cdt.internal.core.dom;
+import org.eclipse.cdt.core.parser.IToken;
import org.eclipse.cdt.internal.core.parser.Token;
@@ -37,14 +38,14 @@
Token t = nameStart;
StringBuffer buffer = new StringBuffer();
buffer.append( t.getImage() );
- if( t.getType() == Token.t_operator )
+ if( t.getType() == IToken.t_operator )
buffer.append( " " );
while (t != nameEnd) {
t = t.getNext();
buffer.append( t.getImage() );
- if (t.getType() == Token.t_operator) buffer.append( " " );
+ if (t.getType() == IToken.t_operator) buffer.append( " " );
}
return buffer.toString();
@@ -57,7 +58,7 @@
/**
* @return
*/
- public Token getNameStart() {
+ public IToken getNameStart() {
return nameStart;
}
Index: dom/org/eclipse/cdt/internal/core/dom/TemplateDeclaration.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/dom/org/eclipse/cdt/internal/core/dom/TemplateDeclaration.java,v
retrieving revision 1.7
diff -u -r1.7 TemplateDeclaration.java
--- dom/org/eclipse/cdt/internal/core/dom/TemplateDeclaration.java 24 Apr 2003 18:36:22 -0000 1.7
+++ dom/org/eclipse/cdt/internal/core/dom/TemplateDeclaration.java 13 Jun 2003 19:56:28 -0000
@@ -16,6 +16,7 @@
import java.util.Collections;
import java.util.List;
+import org.eclipse.cdt.core.parser.IToken;
import org.eclipse.cdt.internal.core.parser.Token;
/**
@@ -26,15 +27,15 @@
private final boolean exported;
private AccessSpecifier visibility = null;
- private Token firstToken, lastToken;
+ private IToken firstToken, lastToken;
private List declarations = new ArrayList();
private TemplateParameterList templateParms = null;
- public TemplateDeclaration( IScope ownerScope, Token exported )
+ public TemplateDeclaration( IScope ownerScope, IToken exported )
{
super( ownerScope );
this.firstToken = exported;
- this.exported = exported.getType() == Token.t_export ? true : false;
+ this.exported = exported.getType() == IToken.t_export ? true : false;
}
/* (non-Javadoc)
@@ -75,14 +76,14 @@
/**
* @return
*/
- public Token getFirstToken() {
+ public IToken getFirstToken() {
return firstToken;
}
/**
* @return
*/
- public Token getLastToken() {
+ public IToken getLastToken() {
return lastToken;
}
@@ -97,7 +98,7 @@
/**
* @param token
*/
- public void setLastToken(Token token) {
+ public void setLastToken(IToken token) {
lastToken = token;
setTotalLength( getLastToken().getOffset() + getLastToken().getLength() - getStartingOffset() );
}
Index: dom/org/eclipse/cdt/internal/core/dom/UsingDirective.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/dom/org/eclipse/cdt/internal/core/dom/UsingDirective.java,v
retrieving revision 1.4
diff -u -r1.4 UsingDirective.java
--- dom/org/eclipse/cdt/internal/core/dom/UsingDirective.java 13 Jun 2003 15:01:22 -0000 1.4
+++ dom/org/eclipse/cdt/internal/core/dom/UsingDirective.java 13 Jun 2003 19:56:28 -0000
@@ -12,7 +12,6 @@
***********************************************************************/
package org.eclipse.cdt.internal.core.dom;
-import org.eclipse.cdt.internal.core.parser.Name;
/**
Index: parser/ChangeLog
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/parser/ChangeLog,v
retrieving revision 1.56
diff -u -r1.56 ChangeLog
--- parser/ChangeLog 13 Jun 2003 18:24:25 -0000 1.56
+++ parser/ChangeLog 13 Jun 2003 19:56:28 -0000
@@ -1,3 +1,8 @@
+2003-06-13 John Camelon
+ Added Class/Base infrastructure to public interfaces & requestor callback.
+ Moved many internal interfaces to external packages.
+ Organized imports.
+
2003-06-13 Victor Mozgin
Renamed NullParserCallback into NullSourceElementRequester.
NullSourceElementRequester now dummy-implements both IParserCallback and ISourceElementRequester.
Index: parser/org/eclipse/cdt/core/parser/IMacroDescriptor.java
===================================================================
RCS file: parser/org/eclipse/cdt/core/parser/IMacroDescriptor.java
diff -N parser/org/eclipse/cdt/core/parser/IMacroDescriptor.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ parser/org/eclipse/cdt/core/parser/IMacroDescriptor.java 13 Jun 2003 19:56:29 -0000
@@ -0,0 +1,18 @@
+package org.eclipse.cdt.core.parser;
+import java.util.List;
+/**
+ * @author jcamelon
+ *
+ * To change this generated comment edit the template variable
+"typecomment":
+ * Window>Preferences>Java>Templates.
+ * To enable and disable the creation of type comments go to
+ * Window>Preferences>Java>Code Generation.
+ */
+public interface IMacroDescriptor {
+ void initialize(String name, List identifiers, List tokens, String sig);
+ List getParameters();
+ List getTokenizedExpansion();
+ String getName();
+ String getSignature();
+}
\ No newline at end of file
Index: parser/org/eclipse/cdt/core/parser/IParserCallback.java
===================================================================
RCS file: parser/org/eclipse/cdt/core/parser/IParserCallback.java
diff -N parser/org/eclipse/cdt/core/parser/IParserCallback.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ parser/org/eclipse/cdt/core/parser/IParserCallback.java 13 Jun 2003 19:56:29 -0000
@@ -0,0 +1,147 @@
+/*******************************************************************************
+ * Copyright (c) 2001 Rational Software Corp. and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Common Public License v0.5
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/cpl-v05.html
+ *
+ * Contributors:
+ * Rational Software - initial implementation
+ ******************************************************************************/
+package org.eclipse.cdt.core.parser;
+
+
+public interface IParserCallback {
+
+ public void setParser( IParser parser );
+
+ public Object translationUnitBegin();
+ public void translationUnitEnd(Object unit);
+
+ public Object inclusionBegin(String includeFile, int nameBeginOffset, int inclusionBeginOffset, boolean local);
+ public void inclusionEnd(Object inclusion);
+ public Object macro(String macroName, int macroNameOffset, int macroBeginOffset, int macroEndOffset);
+
+ public Object simpleDeclarationBegin(Object Container, IToken firstToken);
+ public void simpleDeclSpecifier(Object Container, IToken specifier);
+ public void simpleDeclSpecifierName( Object declaration );
+ public void simpleDeclSpecifierType( Object declaration, Object type );
+ public void simpleDeclarationEnd(Object declaration, IToken lastToken);
+
+ public Object parameterDeclarationBegin( Object Container );
+ public void parameterDeclarationEnd( Object declaration );
+
+ public void nameBegin(IToken firstToken);
+ public void nameEnd(IToken lastToken);
+
+ public Object declaratorBegin(Object container);
+ public void declaratorId(Object declarator);
+ public void declaratorAbort( Object declarator );
+ public void declaratorPureVirtual( Object declarator );
+ public void declaratorCVModifier( Object declarator, IToken modifier );
+ public void declaratorThrowsException( Object declarator );
+ public void declaratorThrowExceptionName( Object declarator );
+ public void declaratorEnd(Object declarator);
+
+ public Object arrayDeclaratorBegin( Object declarator );
+ public void arrayDeclaratorEnd( Object arrayQualifier );
+
+ public Object pointerOperatorBegin( Object container );
+ public void pointerOperatorType( Object ptrOperator, IToken type );
+ public void pointerOperatorName( Object ptrOperator );
+ public void pointerOperatorCVModifier( Object ptrOperator, IToken modifier );
+ public void pointerOperatorAbort( Object ptrOperator );
+ public void pointerOperatorEnd( Object ptrOperator );
+
+ public Object argumentsBegin( Object declarator );
+ public void argumentsEnd(Object parameterDeclarationClause);
+
+ public Object functionBodyBegin(Object declaration);
+ public void functionBodyEnd(Object functionBody);
+
+ public Object classSpecifierBegin(Object container, IToken classKey);
+ public void classSpecifierName(Object classSpecifier);
+ public void classSpecifierAbort( Object classSpecifier );
+ public void classMemberVisibility( Object classSpecifier, IToken visibility );
+ public void classSpecifierEnd(Object classSpecifier, IToken closingBrace );
+
+ public Object baseSpecifierBegin( Object containingClassSpec );
+ public void baseSpecifierName( Object baseSpecifier );
+ public void baseSpecifierVisibility( Object baseSpecifier, IToken visibility );
+ public void baseSpecifierVirtual( Object baseSpecifier, boolean virtual );
+ public void baseSpecifierEnd( Object baseSpecifier );
+
+ public Object expressionBegin( Object container );
+ public void expressionOperator(Object expression, IToken operator);
+ public void expressionTerminal(Object expression, IToken terminal);
+ public void expressionName( Object expression );
+ public void expressionAbort( Object expression );
+ public void expressionEnd(Object expression );
+
+ public Object elaboratedTypeSpecifierBegin( Object container, IToken classKey );
+ public void elaboratedTypeSpecifierName( Object elab );
+ public void elaboratedTypeSpecifierEnd( Object elab );
+
+ public Object namespaceDefinitionBegin( Object container, IToken namespace );
+ public void namespaceDefinitionId( Object namespace );
+ public void namespaceDefinitionAbort( Object namespace );
+ public void namespaceDefinitionEnd( Object namespace, IToken closingBrace );
+
+ public Object linkageSpecificationBegin( Object container, String literal );
+ public void linkageSpecificationEnd( Object linkageSpec );
+
+ public Object usingDirectiveBegin( Object container );
+ public void usingDirectiveNamespaceId( Object directive );
+ public void usingDirectiveAbort( Object directive );
+ public void usingDirectiveEnd( Object directive );
+
+ public Object usingDeclarationBegin( Object container );
+ public void usingDeclarationMapping( Object declaration, boolean isTypeName );
+ public void usingDeclarationAbort( Object declaration );
+ public void usingDeclarationEnd( Object declaration );
+
+ public Object enumSpecifierBegin( Object container, IToken enumKey );
+ public void enumSpecifierId( Object enumSpec );
+ public void enumSpecifierAbort( Object enumSpec );
+ public void enumSpecifierEnd( Object enumSpec, IToken closingBrace );
+
+ public Object enumeratorBegin( Object enumSpec );
+ public void enumeratorId( Object enumDefn );
+ public void enumeratorEnd( Object enumDefn, IToken lastToken );
+
+ public void asmDefinition( Object container, String assemblyCode );
+
+ public Object constructorChainBegin( Object declarator );
+ public void constructorChainAbort( Object ctor );
+ public void constructorChainEnd( Object ctor );
+
+ public Object constructorChainElementBegin( Object ctor );
+ public void constructorChainElementId( Object element );
+ public void constructorChainElementEnd( Object element );
+
+ public Object constructorChainElementExpressionListElementBegin( Object element );
+ public void constructorChainElementExpressionListElementEnd( Object expression );
+
+ public Object explicitInstantiationBegin( Object container);
+ public void explicitInstantiationEnd( Object instantiation );
+
+ public Object explicitSpecializationBegin( Object container );
+ public void explicitSpecializationEnd( Object instantiation );
+
+ public Object templateDeclarationBegin( Object container, IToken firstToken );
+ public void templateDeclarationAbort( Object templateDecl );
+ public void templateDeclarationEnd( Object templateDecl, IToken lastToken );
+
+ public Object templateParameterListBegin( Object declaration );
+ public void templateParameterListEnd( Object parameterList );
+
+ public Object templateTypeParameterBegin( Object templDecl, IToken kind );
+ public void templateTypeParameterName( Object typeParm );
+ public void templateTypeParameterAbort( Object typeParm );
+ public void templateTypeParameterInitialTypeId( Object typeParm );
+ public void templateTypeParameterEnd( Object typeParm );
+
+ public Object startBitfield(Object declarator);
+ public void endBitfield(Object bitfield);
+
+}
Index: parser/org/eclipse/cdt/core/parser/IScanner.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/IScanner.java,v
retrieving revision 1.2
diff -u -r1.2 IScanner.java
--- parser/org/eclipse/cdt/core/parser/IScanner.java 13 Jun 2003 15:01:23 -0000 1.2
+++ parser/org/eclipse/cdt/core/parser/IScanner.java 13 Jun 2003 19:56:29 -0000
@@ -4,11 +4,7 @@
import java.util.List;
import org.eclipse.cdt.core.parser.ast.IASTFactory;
-import org.eclipse.cdt.internal.core.parser.IMacroDescriptor;
-import org.eclipse.cdt.internal.core.parser.IParserCallback;
import org.eclipse.cdt.internal.core.parser.Parser;
-import org.eclipse.cdt.internal.core.parser.ScannerException;
-import org.eclipse.cdt.internal.core.parser.Token;
/**
* @author jcamelon
@@ -29,7 +25,7 @@
public void addIncludePath(String includePath);
public void overwriteIncludePath( List newIncludePaths );
- public Token nextToken() throws ScannerException, Parser.EndOfFile;
+ public IToken nextToken() throws ScannerException, Parser.EndOfFile;
public int getLineNumberForOffset(int offset) throws NoSuchMethodException;
public void setCppNature( boolean value );
public void mapLineNumbers( boolean value );
Index: parser/org/eclipse/cdt/core/parser/IScannerContext.java
===================================================================
RCS file: parser/org/eclipse/cdt/core/parser/IScannerContext.java
diff -N parser/org/eclipse/cdt/core/parser/IScannerContext.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ parser/org/eclipse/cdt/core/parser/IScannerContext.java 13 Jun 2003 19:56:29 -0000
@@ -0,0 +1,38 @@
+package org.eclipse.cdt.core.parser;
+import java.io.IOException;
+import java.io.Reader;
+
+import org.eclipse.cdt.core.parser.ast.IASTInclusion;
+/**
+ * @author jcamelon
+ *
+ * To change this generated comment edit the template variable
+"typecomment":
+ * Window>Preferences>Java>Templates.
+ * To enable and disable the creation of type comments go to
+ * Window>Preferences>Java>Code Generation.
+ */
+public interface IScannerContext {
+
+ public static int SENTINEL = 0;
+ public static int TOP = 1;
+ public static int INCLUSION = 2;
+ public static int MACROEXPANSION = 3;
+
+ public IScannerContext initialize(Reader r, String f, int k, IASTInclusion i);
+ public int read() throws IOException;
+ public String getFilename();
+ public int getOffset();
+ public Reader getReader();
+
+ public int undoStackSize();
+ public int popUndo();
+ public void pushUndo(int undo);
+
+ public int getKind();
+ public void setKind( int kind );
+
+ public IASTInclusion getExtension();
+ public void setExtension( IASTInclusion ext );
+
+}
\ No newline at end of file
Index: parser/org/eclipse/cdt/core/parser/ISourceElementRequestor.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ISourceElementRequestor.java,v
retrieving revision 1.2
diff -u -r1.2 ISourceElementRequestor.java
--- parser/org/eclipse/cdt/core/parser/ISourceElementRequestor.java 13 Jun 2003 15:01:23 -0000 1.2
+++ parser/org/eclipse/cdt/core/parser/ISourceElementRequestor.java 13 Jun 2003 19:56:29 -0000
@@ -14,8 +14,7 @@
import org.eclipse.cdt.core.parser.ast.IASTClassSpecifier;
import org.eclipse.cdt.core.parser.ast.IASTCompilationUnit;
import org.eclipse.cdt.core.parser.ast.IASTConstructor;
-import org.eclipse.cdt.core.parser.ast.IASTEnumSpecifier;
-import org.eclipse.cdt.core.parser.ast.IASTEnumerator;
+import org.eclipse.cdt.core.parser.ast.IASTEnumerationSpecifier;
import org.eclipse.cdt.core.parser.ast.IASTField;
import org.eclipse.cdt.core.parser.ast.IASTFunction;
import org.eclipse.cdt.core.parser.ast.IASTInclusion;
@@ -46,10 +45,7 @@
public void acceptUsingDeclaration( IASTUsingDeclaration usageDeclaration );
public void acceptASMDefinition( IASTASMDefinition asmDefinition );
public void acceptTypedef( IASTTypedef typedef );
-
- public void enterEnumSpecifier( IASTEnumSpecifier enumSpec );
- public void acceptEnumerator( IASTEnumerator enumerator );
- public void exitEnumSpecifier( IASTEnumSpecifier enumSpec );
+ public void acceptEnumerationSpecifier( IASTEnumerationSpecifier enumeration );
public void enterFunctionBody( IASTFunction function );
public void exitFunctionBody( IASTFunction function );
@@ -70,6 +66,8 @@
public void acceptField( IASTField field );
public void acceptConstructor( IASTConstructor constructor );
+ public void acceptClassReference( IASTClassSpecifier classSpecifier, int referenceOffset );
+
public void exitTemplateDeclaration( IASTTemplateDeclaration declaration );
public void exitTemplateSpecialization( IASTTemplateSpecialization specialization );
public void exitTemplateExplicitInstantiation( IASTTemplateInstantiation instantiation );
Index: parser/org/eclipse/cdt/core/parser/IToken.java
===================================================================
RCS file: parser/org/eclipse/cdt/core/parser/IToken.java
diff -N parser/org/eclipse/cdt/core/parser/IToken.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ parser/org/eclipse/cdt/core/parser/IToken.java 13 Jun 2003 19:56:29 -0000
@@ -0,0 +1,302 @@
+/**********************************************************************
+ * Copyright (c) 2002,2003 Rational Software Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Common Public License v0.5
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/cpl-v05.html
+ *
+ * Contributors:
+ * IBM Rational Software - Initial API and implementation
+***********************************************************************/
+package org.eclipse.cdt.core.parser;
+
+import org.eclipse.cdt.internal.core.parser.Token;
+
+/**
+ * @author jcamelon
+ *
+ */
+public interface IToken {
+ public abstract String toString();
+ public abstract int getType();
+ public abstract String getImage();
+ public abstract int getOffset();
+ public abstract int getLength();
+ public abstract int getEndOffset();
+ public abstract int getDelta(IToken other);
+ public abstract Token getNext();
+ public abstract void setNext(Token t);
+ public abstract boolean looksLikeExpression();
+ public abstract boolean isPointer();
+ public abstract boolean isOperator();
+ // Token types
+ static public final int tIDENTIFIER = 1;
+
+ static public final int tINTEGER = 2;
+
+ static public final int tCOLONCOLON = 3;
+
+ static public final int tCOLON = 4;
+
+ static public final int tSEMI = 5;
+
+ static public final int tCOMMA = 6;
+
+ static public final int tQUESTION = 7;
+
+ static public final int tLPAREN = 8;
+
+ static public final int tRPAREN = 9;
+
+ static public final int tLBRACKET = 10;
+
+ static public final int tRBRACKET = 11;
+
+ static public final int tLBRACE = 12;
+
+ static public final int tRBRACE = 13;
+
+ static public final int tPLUSASSIGN = 14;
+
+ static public final int tINCR = 15;
+
+ static public final int tPLUS = 16;
+
+ static public final int tMINUSASSIGN = 17;
+
+ static public final int tDECR = 18;
+
+ static public final int tARROWSTAR = 19;
+
+ static public final int tARROW = 20;
+
+ static public final int tMINUS = 21;
+
+ static public final int tSTARASSIGN = 22;
+
+ static public final int tSTAR = 23;
+
+ static public final int tMODASSIGN = 24;
+
+ static public final int tMOD = 25;
+
+ static public final int tXORASSIGN = 26;
+
+ static public final int tXOR = 27;
+
+ static public final int tAMPERASSIGN = 28;
+
+ static public final int tAND = 29;
+
+ static public final int tAMPER = 30;
+
+ static public final int tBITORASSIGN = 31;
+
+ static public final int tOR = 32;
+
+ static public final int tBITOR = 33;
+
+ static public final int tCOMPL = 34;
+
+ static public final int tNOTEQUAL = 35;
+
+ static public final int tNOT = 36;
+
+ static public final int tEQUAL = 37;
+
+ static public final int tASSIGN = 38;
+
+ static public final int tSHIFTL = 40;
+
+ static public final int tLTEQUAL = 41;
+
+ static public final int tLT = 42;
+
+ static public final int tSHIFTRASSIGN = 43;
+
+ static public final int tSHIFTR = 44;
+
+ static public final int tGTEQUAL = 45;
+
+ static public final int tGT = 46;
+
+ static public final int tSHIFTLASSIGN = 47;
+
+ static public final int tELIPSE = 48;
+
+ static public final int tDOTSTAR = 49;
+
+ static public final int tDOT = 50;
+
+ static public final int tDIVASSIGN = 51;
+
+ static public final int tDIV = 52;
+
+ static public final int tCLASSNAME = 53;
+
+ static public final int t_and = 54;
+
+ static public final int t_and_eq = 55;
+
+ static public final int t_asm = 56;
+
+ static public final int t_auto = 57;
+
+ static public final int t_bitand = 58;
+
+ static public final int t_bitor = 59;
+
+ static public final int t_bool = 60;
+
+ static public final int t_break = 61;
+
+ static public final int t_case = 62;
+
+ static public final int t_catch = 63;
+
+ static public final int t_char = 64;
+
+ static public final int t_class = 65;
+
+ static public final int t_compl = 66;
+
+ static public final int t_const = 67;
+
+ static public final int t_const_cast = 69;
+
+ static public final int t_continue = 70;
+
+ static public final int t_default = 71;
+
+ static public final int t_delete = 72;
+
+ static public final int t_do = 73;
+
+ static public final int t_double = 74;
+
+ static public final int t_dynamic_cast = 75;
+
+ static public final int t_else = 76;
+
+ static public final int t_enum = 77;
+
+ static public final int t_explicit = 78;
+
+ static public final int t_export = 79;
+
+ static public final int t_extern = 80;
+
+ static public final int t_false = 81;
+
+ static public final int t_float = 82;
+
+ static public final int t_for = 83;
+
+ static public final int t_friend = 84;
+
+ static public final int t_goto = 85;
+
+ static public final int t_if = 86;
+
+ static public final int t_inline = 87;
+
+ static public final int t_int = 88;
+
+ static public final int t_long = 89;
+
+ static public final int t_mutable = 90;
+
+ static public final int t_namespace = 91;
+
+ static public final int t_new = 92;
+
+ static public final int t_not = 93;
+
+ static public final int t_not_eq = 94;
+
+ static public final int t_operator = 95;
+
+ static public final int t_or = 96;
+
+ static public final int t_or_eq = 97;
+
+ static public final int t_private = 98;
+
+ static public final int t_protected = 99;
+
+ static public final int t_public = 100;
+
+ static public final int t_register = 101;
+
+ static public final int t_reinterpret_cast = 102;
+
+ static public final int t_return = 103;
+
+ static public final int t_short = 104;
+
+ static public final int t_sizeof = 105;
+
+ static public final int t_static = 106;
+
+ static public final int t_static_cast = 107;
+
+ static public final int t_signed = 108;
+
+ static public final int t_struct = 109;
+
+ static public final int t_switch = 110;
+
+ static public final int t_template = 111;
+
+ static public final int t_this = 112;
+
+ static public final int t_throw = 113;
+
+ static public final int t_true = 114;
+
+ static public final int t_try = 115;
+
+ static public final int t_typedef = 116;
+
+ static public final int t_typeid = 117;
+
+ static public final int t_typename = 118;
+
+ static public final int t_union = 119;
+
+ static public final int t_unsigned = 120;
+
+ static public final int t_using = 121;
+
+ static public final int t_virtual = 122;
+
+ static public final int t_void = 123;
+
+ static public final int t_volatile = 124;
+
+ static public final int t_wchar_t = 125;
+
+ static public final int t_while = 126;
+
+ static public final int t_xor = 127;
+
+ static public final int t_xor_eq = 128;
+
+ static public final int tSTRING = 129;
+
+ static public final int tFLOATINGPT = 130;
+
+ static public final int tLSTRING = 131;
+
+ static public final int tCHAR = 132;
+
+ static public final int t__Bool = 133;
+
+ static public final int t__Complex = 134;
+
+ static public final int t__Imaginary = 135;
+
+ static public final int t_restrict = 136;
+
+ static public final int tLAST = t_restrict;
+}
\ No newline at end of file
Index: parser/org/eclipse/cdt/core/parser/ScannerException.java
===================================================================
RCS file: parser/org/eclipse/cdt/core/parser/ScannerException.java
diff -N parser/org/eclipse/cdt/core/parser/ScannerException.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ parser/org/eclipse/cdt/core/parser/ScannerException.java 13 Jun 2003 19:56:29 -0000
@@ -0,0 +1,30 @@
+/*******************************************************************************
+ * Copyright (c) 2001 Rational Software Corp. and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Common Public License v0.5
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/cpl-v05.html
+ *
+ * Contributors:
+ * Rational Software - initial implementation
+ ******************************************************************************/
+package org.eclipse.cdt.core.parser;
+
+public class ScannerException extends Exception {
+
+ /**
+ * Constructor for ScannerException.
+ */
+ public ScannerException() {
+ super();
+ }
+
+ /**
+ * Constructor for ScannerException.
+ * @param s
+ */
+ public ScannerException(String s) {
+ super(s);
+ }
+
+}
Index: parser/org/eclipse/cdt/core/parser/ast/IASTClassSpecifier.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTClassSpecifier.java,v
retrieving revision 1.2
diff -u -r1.2 IASTClassSpecifier.java
--- parser/org/eclipse/cdt/core/parser/ast/IASTClassSpecifier.java 13 Jun 2003 15:01:22 -0000 1.2
+++ parser/org/eclipse/cdt/core/parser/ast/IASTClassSpecifier.java 13 Jun 2003 19:56:29 -0000
@@ -16,12 +16,14 @@
* @author jcamelon
*
*/
-public interface IASTClassSpecifier extends IASTScope, IASTOffsetableNamedElement, IASTTemplatedDeclaration {
+public interface IASTClassSpecifier extends IASTTypeSpecifier, IASTScope, IASTOffsetableNamedElement, IASTTemplatedDeclaration {
public ClassNameType getClassNameType();
public ClassKind getClassKind();
public Iterator getBaseClauses();
+
+ public AccessVisibility getCurrentVisiblity();
}
Index: parser/org/eclipse/cdt/core/parser/ast/IASTElaboratedTypeSpecifier.java
===================================================================
RCS file: parser/org/eclipse/cdt/core/parser/ast/IASTElaboratedTypeSpecifier.java
diff -N parser/org/eclipse/cdt/core/parser/ast/IASTElaboratedTypeSpecifier.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ parser/org/eclipse/cdt/core/parser/ast/IASTElaboratedTypeSpecifier.java 13 Jun 2003 19:56:29 -0000
@@ -0,0 +1,19 @@
+/**********************************************************************
+ * Copyright (c) 2002,2003 Rational Software Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Common Public License v0.5
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/cpl-v05.html
+ *
+ * Contributors:
+ * IBM Rational Software - Initial API and implementation
+***********************************************************************/
+package org.eclipse.cdt.core.parser.ast;
+
+/**
+ * @author jcamelon
+ *
+ */
+public interface IASTElaboratedTypeSpecifier extends IASTTypeSpecifier {
+
+}
Index: parser/org/eclipse/cdt/core/parser/ast/IASTEnumSpecifier.java
===================================================================
RCS file: parser/org/eclipse/cdt/core/parser/ast/IASTEnumSpecifier.java
diff -N parser/org/eclipse/cdt/core/parser/ast/IASTEnumSpecifier.java
--- parser/org/eclipse/cdt/core/parser/ast/IASTEnumSpecifier.java 13 Jun 2003 15:01:22 -0000 1.2
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,19 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2002,2003 Rational Software Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v0.5
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v05.html
- *
- * Contributors:
- * IBM Rational Software - Initial API and implementation
-***********************************************************************/
-package org.eclipse.cdt.core.parser.ast;
-
-/**
- * @author jcamelon
- *
- */
-public interface IASTEnumSpecifier {
-
-}
Index: parser/org/eclipse/cdt/core/parser/ast/IASTEnumerationSpecifier.java
===================================================================
RCS file: parser/org/eclipse/cdt/core/parser/ast/IASTEnumerationSpecifier.java
diff -N parser/org/eclipse/cdt/core/parser/ast/IASTEnumerationSpecifier.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ parser/org/eclipse/cdt/core/parser/ast/IASTEnumerationSpecifier.java 13 Jun 2003 19:56:29 -0000
@@ -0,0 +1,19 @@
+/**********************************************************************
+ * Copyright (c) 2002,2003 Rational Software Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Common Public License v0.5
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/cpl-v05.html
+ *
+ * Contributors:
+ * IBM Rational Software - Initial API and implementation
+***********************************************************************/
+package org.eclipse.cdt.core.parser.ast;
+
+/**
+ * @author jcamelon
+ *
+ */
+public interface IASTEnumerationSpecifier extends IASTTypeSpecifier {
+
+}
Index: parser/org/eclipse/cdt/core/parser/ast/IASTFactory.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTFactory.java,v
retrieving revision 1.2
diff -u -r1.2 IASTFactory.java
--- parser/org/eclipse/cdt/core/parser/ast/IASTFactory.java 13 Jun 2003 15:01:22 -0000 1.2
+++ parser/org/eclipse/cdt/core/parser/ast/IASTFactory.java 13 Jun 2003 19:56:29 -0000
@@ -48,4 +48,18 @@
public IASTLinkageSpecification createLinkageSpecification(IASTScope scope, String spec);
+ public IASTClassSpecifier createClassSpecifier( IASTScope scope,
+ String name,
+ ClassKind kind,
+ ClassNameType type,
+ AccessVisibility access,
+ IASTTemplateDeclaration ownerTemplateDeclaration, int startingOffset, int nameOffset );
+ /**
+ * @param astClassSpec
+ * @param isVirtual
+ * @param visibility
+ * @param string
+ */
+ public void addBaseSpecifier(IASTClassSpecifier astClassSpec, boolean isVirtual, AccessVisibility visibility, String string);
+
}
Index: parser/org/eclipse/cdt/core/parser/ast/IASTTypeSpecifier.java
===================================================================
RCS file: parser/org/eclipse/cdt/core/parser/ast/IASTTypeSpecifier.java
diff -N parser/org/eclipse/cdt/core/parser/ast/IASTTypeSpecifier.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ parser/org/eclipse/cdt/core/parser/ast/IASTTypeSpecifier.java 13 Jun 2003 19:56:29 -0000
@@ -0,0 +1,19 @@
+/**********************************************************************
+ * Copyright (c) 2002,2003 Rational Software Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Common Public License v0.5
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/cpl-v05.html
+ *
+ * Contributors:
+ * IBM Rational Software - Initial API and implementation
+***********************************************************************/
+package org.eclipse.cdt.core.parser.ast;
+
+/**
+ * @author jcamelon
+ *
+ */
+public interface IASTTypeSpecifier {
+
+}
Index: parser/org/eclipse/cdt/internal/core/parser/BranchTracker.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/BranchTracker.java,v
retrieving revision 1.2
diff -u -r1.2 BranchTracker.java
--- parser/org/eclipse/cdt/internal/core/parser/BranchTracker.java 4 Mar 2003 18:25:40 -0000 1.2
+++ parser/org/eclipse/cdt/internal/core/parser/BranchTracker.java 13 Jun 2003 19:56:29 -0000
@@ -3,6 +3,8 @@
import java.util.EmptyStackException;
import java.util.Stack;
+import org.eclipse.cdt.core.parser.ScannerException;
+
/**
* @author jcamelon
*
Index: parser/org/eclipse/cdt/internal/core/parser/ContextStack.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ContextStack.java,v
retrieving revision 1.4
diff -u -r1.4 ContextStack.java
--- parser/org/eclipse/cdt/internal/core/parser/ContextStack.java 13 Jun 2003 15:01:22 -0000 1.4
+++ parser/org/eclipse/cdt/internal/core/parser/ContextStack.java 13 Jun 2003 19:56:29 -0000
@@ -19,7 +19,9 @@
import java.util.Set;
import java.util.Stack;
+import org.eclipse.cdt.core.parser.IScannerContext;
import org.eclipse.cdt.core.parser.ISourceElementRequestor;
+import org.eclipse.cdt.core.parser.ScannerException;
import org.eclipse.cdt.core.parser.ast.IASTInclusion;
/**
Index: parser/org/eclipse/cdt/internal/core/parser/ExpressionEvaluator.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ExpressionEvaluator.java,v
retrieving revision 1.26
diff -u -r1.26 ExpressionEvaluator.java
--- parser/org/eclipse/cdt/internal/core/parser/ExpressionEvaluator.java 13 Jun 2003 15:01:22 -0000 1.26
+++ parser/org/eclipse/cdt/internal/core/parser/ExpressionEvaluator.java 13 Jun 2003 19:56:29 -0000
@@ -14,6 +14,8 @@
import java.util.Stack;
import org.eclipse.cdt.core.parser.IParser;
+import org.eclipse.cdt.core.parser.IParserCallback;
+import org.eclipse.cdt.core.parser.IToken;
public class ExpressionEvaluator implements IParserCallback {
@@ -34,61 +36,61 @@
/**
* @see org.eclipse.cdt.core.newparser.IParserCallback#expressionOperator(Token)
*/
- public void expressionOperator(Object expression, Token operator) {
+ public void expressionOperator(Object expression, IToken operator) {
int second = popInt();
int first;
switch (operator.getType()) {
- case Token.tPLUS:
+ case IToken.tPLUS:
first = popInt();
stack.push(new Integer(first + second));
break;
- case Token.tMINUS:
+ case IToken.tMINUS:
first = popInt();
stack.push(new Integer(first - second));
break;
- case Token.tSTAR:
+ case IToken.tSTAR:
first = popInt();
stack.push(new Integer(first * second));
break;
- case Token.tDIV:
+ case IToken.tDIV:
first = popInt();
stack.push(new Integer(first / second));
break;
- case Token.tLT:
+ case IToken.tLT:
first = popInt();
stack.push(new Integer(first < second ? 1 : 0));
break;
- case Token.tLTEQUAL:
+ case IToken.tLTEQUAL:
first = popInt();
stack.push(new Integer(first <= second ? 1 : 0));
break;
- case Token.tGT:
+ case IToken.tGT:
first = popInt();
stack.push(new Integer(first > second ? 1 : 0));
break;
- case Token.tGTEQUAL:
+ case IToken.tGTEQUAL:
first = popInt();
stack.push(new Integer(first >= second ? 1 : 0));
break;
- case Token.tEQUAL:
+ case IToken.tEQUAL:
first = popInt();
stack.push(new Integer(first == second ? 1 : 0));
break;
- case Token.tNOTEQUAL:
+ case IToken.tNOTEQUAL:
first = popInt();
stack.push(new Integer(first != second ? 1 : 0));
break;
- case Token.tAND:
+ case IToken.tAND:
first = popInt();
stack.push( new Integer( ( ( first != 0 ) && ( second != 0 ) ) ? 1 : 0 ) );
break;
- case Token.tOR:
+ case IToken.tOR:
first = popInt();
stack.push( new Integer( ( ( first != 0 ) || ( second != 0 ) ) ? 1 : 0 ) );
break;
- case Token.tNOT:
+ case IToken.tNOT:
stack.push( new Integer( ( second == 0 ) ? 1 : 0 ) );
break;
default:
@@ -99,9 +101,9 @@
/**
* @see org.eclipse.cdt.core.newparser.IParserCallback#expressionTerminal(Token)
*/
- public void expressionTerminal(Object expression, Token terminal) {
+ public void expressionTerminal(Object expression, IToken terminal) {
switch (terminal.getType()) {
- case Token.tINTEGER:
+ case IToken.tINTEGER:
stack.push(new Integer(terminal.getImage()));
break;
default:
@@ -143,13 +145,13 @@
/**
* @see org.eclipse.cdt.internal.core.parser.IParserCallback#simpleDeclarationBegin(java.lang.Object)
*/
- public Object simpleDeclarationBegin(Object Container, Token firstToken) {
+ public Object simpleDeclarationBegin(Object Container, IToken firstToken) {
return null;
}
/**
* @see org.eclipse.cdt.internal.core.parser.IParserCallback#simpleDeclarationEnd(java.lang.Object)
*/
- public void simpleDeclarationEnd(Object declaration, Token lastToken) {
+ public void simpleDeclarationEnd(Object declaration, IToken lastToken) {
}
/**
* @see org.eclipse.cdt.internal.core.parser.IParserCallback#parameterDeclarationBegin(java.lang.Object)
@@ -165,7 +167,7 @@
/**
* @see org.eclipse.cdt.internal.core.parser.IParserCallback#simpleDeclSpecifier(java.lang.Object, org.eclipse.cdt.internal.core.parser.Token)
*/
- public void simpleDeclSpecifier(Object Container, Token specifier) {
+ public void simpleDeclSpecifier(Object Container, IToken specifier) {
}
/**
* @see org.eclipse.cdt.internal.core.parser.IParserCallback#declaratorBegin(java.lang.Object)
@@ -213,7 +215,7 @@
/**
* @see org.eclipse.cdt.internal.core.parser.IParserCallback#classSpecifierBegin(java.lang.Object, org.eclipse.cdt.internal.core.parser.Token)
*/
- public Object classSpecifierBegin(Object container, Token classKey) {
+ public Object classSpecifierBegin(Object container, IToken classKey) {
return null;
}
/**
@@ -224,7 +226,7 @@
/**
* @see org.eclipse.cdt.internal.core.parser.IParserCallback#classSpecifierEnd(java.lang.Object)
*/
- public void classSpecifierEnd(Object classSpecifier, Token closingBrace) {
+ public void classSpecifierEnd(Object classSpecifier, IToken closingBrace) {
}
/**
* @see org.eclipse.cdt.internal.core.parser.IParserCallback#baseSpecifierBegin(java.lang.Object)
@@ -242,7 +244,7 @@
*/
public void baseSpecifierVisibility(
Object baseSpecifier,
- Token visibility) {
+ IToken visibility) {
}
/**
* @see org.eclipse.cdt.internal.core.parser.IParserCallback#baseSpecifierVirtual(java.lang.Object, boolean)
@@ -275,7 +277,7 @@
/**
* @see org.eclipse.cdt.internal.core.parser.IParserCallback#elaboratedTypeSpecifierBegin(java.lang.Object)
*/
- public Object elaboratedTypeSpecifierBegin(Object container, Token classKey) {
+ public Object elaboratedTypeSpecifierBegin(Object container, IToken classKey) {
return null;
}
@@ -308,7 +310,7 @@
/* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.parser.IParserCallback#classMemberVisibility(java.lang.Object, org.eclipse.cdt.internal.core.parser.Token)
*/
- public void classMemberVisibility(Object classSpecifier, Token visibility) {
+ public void classMemberVisibility(Object classSpecifier, IToken visibility) {
}
/* (non-Javadoc)
@@ -336,20 +338,20 @@
/* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.parser.IParserCallback#pointerOperatorType(java.lang.Object, org.eclipse.cdt.internal.core.parser.Token)
*/
- public void pointerOperatorType(Object ptrOperator, Token type) {
+ public void pointerOperatorType(Object ptrOperator, IToken type) {
}
/* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.parser.IParserCallback#pointerOperatorCVModifier(java.lang.Object, org.eclipse.cdt.internal.core.parser.Token)
*/
- public void pointerOperatorCVModifier(Object ptrOperator, Token modifier) {
+ public void pointerOperatorCVModifier(Object ptrOperator, IToken modifier) {
}
/* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.parser.IParserCallback#declaratorCVModifier(java.lang.Object, org.eclipse.cdt.internal.core.parser.Token)
*/
- public void declaratorCVModifier(Object declarator, Token modifier) {
+ public void declaratorCVModifier(Object declarator, IToken modifier) {
}
/* (non-Javadoc)
@@ -382,7 +384,7 @@
/* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.parser.IParserCallback#namespaceDeclarationBegin(java.lang.Object)
*/
- public Object namespaceDefinitionBegin(Object container, Token namespace) {
+ public Object namespaceDefinitionBegin(Object container, IToken namespace) {
return null;
}
@@ -404,7 +406,7 @@
/* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.parser.IParserCallback#namespaceDeclarationEnd(java.lang.Object)
*/
- public void namespaceDefinitionEnd(Object namespace, Token closingBrace) {
+ public void namespaceDefinitionEnd(Object namespace, IToken closingBrace) {
}
@@ -484,7 +486,7 @@
/* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.parser.IParserCallback#enumSpecifierBegin(java.lang.Object)
*/
- public Object enumSpecifierBegin(Object container, Token enumKey) {
+ public Object enumSpecifierBegin(Object container, IToken enumKey) {
return null;
}
@@ -505,7 +507,7 @@
/* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.parser.IParserCallback#enumSpecifierEnd(java.lang.Object)
*/
- public void enumSpecifierEnd(Object enumSpec, Token closingBrace) {
+ public void enumSpecifierEnd(Object enumSpec, IToken closingBrace) {
}
@@ -527,7 +529,7 @@
/* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.parser.IParserCallback#enumDefinitionEnd(java.lang.Object)
*/
- public void enumeratorEnd(Object enumDefn, Token lastToken) {
+ public void enumeratorEnd(Object enumDefn, IToken lastToken) {
}
@@ -624,7 +626,7 @@
/* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.parser.IParserCallback#templateDeclarationBegin(java.lang.Object, boolean)
*/
- public Object templateDeclarationBegin(Object container, Token exported) {
+ public Object templateDeclarationBegin(Object container, IToken exported) {
return null;
}
@@ -637,13 +639,13 @@
/* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.parser.IParserCallback#templateDeclarationEnd(java.lang.Object)
*/
- public void templateDeclarationEnd(Object templateDecl, Token lastToken) {
+ public void templateDeclarationEnd(Object templateDecl, IToken lastToken) {
}
/* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.parser.IParserCallback#templateTypeParameterBegin(java.lang.Object, org.eclipse.cdt.internal.core.parser.Token)
*/
- public Object templateTypeParameterBegin(Object templDecl, Token kind) {
+ public Object templateTypeParameterBegin(Object templDecl, IToken kind) {
return null;
}
@@ -706,14 +708,14 @@
/**
* @see org.eclipse.cdt.internal.core.newparser.IParserCallback#nameBegin(org.eclipse.cdt.internal.core.newparser.Token)
*/
- public void nameBegin(Token firstToken) {
+ public void nameBegin(IToken firstToken) {
currName = new Name(firstToken);
}
/**
* @see org.eclipse.cdt.internal.core.newparser.IParserCallback#nameEnd(org.eclipse.cdt.internal.core.newparser.Token)
*/
- public void nameEnd(Token lastToken) {
+ public void nameEnd(IToken lastToken) {
currName.setEnd(lastToken);
}
Index: parser/org/eclipse/cdt/internal/core/parser/IMacroDescriptor.java
===================================================================
RCS file: parser/org/eclipse/cdt/internal/core/parser/IMacroDescriptor.java
diff -N parser/org/eclipse/cdt/internal/core/parser/IMacroDescriptor.java
--- parser/org/eclipse/cdt/internal/core/parser/IMacroDescriptor.java 4 Mar 2003 18:25:40 -0000 1.2
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,18 +0,0 @@
-package org.eclipse.cdt.internal.core.parser;
-import java.util.List;
-/**
- * @author jcamelon
- *
- * To change this generated comment edit the template variable
-"typecomment":
- * Window>Preferences>Java>Templates.
- * To enable and disable the creation of type comments go to
- * Window>Preferences>Java>Code Generation.
- */
-public interface IMacroDescriptor {
- void initialize(String name, List identifiers, List tokens, String sig);
- List getParameters();
- List getTokenizedExpansion();
- String getName();
- String getSignature();
-}
\ No newline at end of file
Index: parser/org/eclipse/cdt/internal/core/parser/IParserCallback.java
===================================================================
RCS file: parser/org/eclipse/cdt/internal/core/parser/IParserCallback.java
diff -N parser/org/eclipse/cdt/internal/core/parser/IParserCallback.java
--- parser/org/eclipse/cdt/internal/core/parser/IParserCallback.java 13 Jun 2003 15:01:22 -0000 1.25
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,148 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001 Rational Software Corp. and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v0.5
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v05.html
- *
- * Contributors:
- * Rational Software - initial implementation
- ******************************************************************************/
-package org.eclipse.cdt.internal.core.parser;
-
-import org.eclipse.cdt.core.parser.IParser;
-
-public interface IParserCallback {
-
- public void setParser( IParser parser );
-
- public Object translationUnitBegin();
- public void translationUnitEnd(Object unit);
-
- public Object inclusionBegin(String includeFile, int nameBeginOffset, int inclusionBeginOffset, boolean local);
- public void inclusionEnd(Object inclusion);
- public Object macro(String macroName, int macroNameOffset, int macroBeginOffset, int macroEndOffset);
-
- public Object simpleDeclarationBegin(Object Container, Token firstToken);
- public void simpleDeclSpecifier(Object Container, Token specifier);
- public void simpleDeclSpecifierName( Object declaration );
- public void simpleDeclSpecifierType( Object declaration, Object type );
- public void simpleDeclarationEnd(Object declaration, Token lastToken);
-
- public Object parameterDeclarationBegin( Object Container );
- public void parameterDeclarationEnd( Object declaration );
-
- public void nameBegin(Token firstToken);
- public void nameEnd(Token lastToken);
-
- public Object declaratorBegin(Object container);
- public void declaratorId(Object declarator);
- public void declaratorAbort( Object declarator );
- public void declaratorPureVirtual( Object declarator );
- public void declaratorCVModifier( Object declarator, Token modifier );
- public void declaratorThrowsException( Object declarator );
- public void declaratorThrowExceptionName( Object declarator );
- public void declaratorEnd(Object declarator);
-
- public Object arrayDeclaratorBegin( Object declarator );
- public void arrayDeclaratorEnd( Object arrayQualifier );
-
- public Object pointerOperatorBegin( Object container );
- public void pointerOperatorType( Object ptrOperator, Token type );
- public void pointerOperatorName( Object ptrOperator );
- public void pointerOperatorCVModifier( Object ptrOperator, Token modifier );
- public void pointerOperatorAbort( Object ptrOperator );
- public void pointerOperatorEnd( Object ptrOperator );
-
- public Object argumentsBegin( Object declarator );
- public void argumentsEnd(Object parameterDeclarationClause);
-
- public Object functionBodyBegin(Object declaration);
- public void functionBodyEnd(Object functionBody);
-
- public Object classSpecifierBegin(Object container, Token classKey);
- public void classSpecifierName(Object classSpecifier);
- public void classSpecifierAbort( Object classSpecifier );
- public void classMemberVisibility( Object classSpecifier, Token visibility );
- public void classSpecifierEnd(Object classSpecifier, Token closingBrace );
-
- public Object baseSpecifierBegin( Object containingClassSpec );
- public void baseSpecifierName( Object baseSpecifier );
- public void baseSpecifierVisibility( Object baseSpecifier, Token visibility );
- public void baseSpecifierVirtual( Object baseSpecifier, boolean virtual );
- public void baseSpecifierEnd( Object baseSpecifier );
-
- public Object expressionBegin( Object container );
- public void expressionOperator(Object expression, Token operator);
- public void expressionTerminal(Object expression, Token terminal);
- public void expressionName( Object expression );
- public void expressionAbort( Object expression );
- public void expressionEnd(Object expression );
-
- public Object elaboratedTypeSpecifierBegin( Object container, Token classKey );
- public void elaboratedTypeSpecifierName( Object elab );
- public void elaboratedTypeSpecifierEnd( Object elab );
-
- public Object namespaceDefinitionBegin( Object container, Token namespace );
- public void namespaceDefinitionId( Object namespace );
- public void namespaceDefinitionAbort( Object namespace );
- public void namespaceDefinitionEnd( Object namespace, Token closingBrace );
-
- public Object linkageSpecificationBegin( Object container, String literal );
- public void linkageSpecificationEnd( Object linkageSpec );
-
- public Object usingDirectiveBegin( Object container );
- public void usingDirectiveNamespaceId( Object directive );
- public void usingDirectiveAbort( Object directive );
- public void usingDirectiveEnd( Object directive );
-
- public Object usingDeclarationBegin( Object container );
- public void usingDeclarationMapping( Object declaration, boolean isTypeName );
- public void usingDeclarationAbort( Object declaration );
- public void usingDeclarationEnd( Object declaration );
-
- public Object enumSpecifierBegin( Object container, Token enumKey );
- public void enumSpecifierId( Object enumSpec );
- public void enumSpecifierAbort( Object enumSpec );
- public void enumSpecifierEnd( Object enumSpec, Token closingBrace );
-
- public Object enumeratorBegin( Object enumSpec );
- public void enumeratorId( Object enumDefn );
- public void enumeratorEnd( Object enumDefn, Token lastToken );
-
- public void asmDefinition( Object container, String assemblyCode );
-
- public Object constructorChainBegin( Object declarator );
- public void constructorChainAbort( Object ctor );
- public void constructorChainEnd( Object ctor );
-
- public Object constructorChainElementBegin( Object ctor );
- public void constructorChainElementId( Object element );
- public void constructorChainElementEnd( Object element );
-
- public Object constructorChainElementExpressionListElementBegin( Object element );
- public void constructorChainElementExpressionListElementEnd( Object expression );
-
- public Object explicitInstantiationBegin( Object container);
- public void explicitInstantiationEnd( Object instantiation );
-
- public Object explicitSpecializationBegin( Object container );
- public void explicitSpecializationEnd( Object instantiation );
-
- public Object templateDeclarationBegin( Object container, Token firstToken );
- public void templateDeclarationAbort( Object templateDecl );
- public void templateDeclarationEnd( Object templateDecl, Token lastToken );
-
- public Object templateParameterListBegin( Object declaration );
- public void templateParameterListEnd( Object parameterList );
-
- public Object templateTypeParameterBegin( Object templDecl, Token kind );
- public void templateTypeParameterName( Object typeParm );
- public void templateTypeParameterAbort( Object typeParm );
- public void templateTypeParameterInitialTypeId( Object typeParm );
- public void templateTypeParameterEnd( Object typeParm );
-
- public Object startBitfield(Object declarator);
- public void endBitfield(Object bitfield);
-
-}
Index: parser/org/eclipse/cdt/internal/core/parser/IScannerContext.java
===================================================================
RCS file: parser/org/eclipse/cdt/internal/core/parser/IScannerContext.java
diff -N parser/org/eclipse/cdt/internal/core/parser/IScannerContext.java
--- parser/org/eclipse/cdt/internal/core/parser/IScannerContext.java 13 Jun 2003 15:01:22 -0000 1.5
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,38 +0,0 @@
-package org.eclipse.cdt.internal.core.parser;
-import java.io.IOException;
-import java.io.Reader;
-
-import org.eclipse.cdt.core.parser.ast.IASTInclusion;
-/**
- * @author jcamelon
- *
- * To change this generated comment edit the template variable
-"typecomment":
- * Window>Preferences>Java>Templates.
- * To enable and disable the creation of type comments go to
- * Window>Preferences>Java>Code Generation.
- */
-public interface IScannerContext {
-
- public static int SENTINEL = 0;
- public static int TOP = 1;
- public static int INCLUSION = 2;
- public static int MACROEXPANSION = 3;
-
- public IScannerContext initialize(Reader r, String f, int k, IASTInclusion i);
- public int read() throws IOException;
- public String getFilename();
- public int getOffset();
- public Reader getReader();
-
- public int undoStackSize();
- public int popUndo();
- public void pushUndo(int undo);
-
- public int getKind();
- public void setKind( int kind );
-
- public IASTInclusion getExtension();
- public void setExtension( IASTInclusion ext );
-
-}
\ No newline at end of file
Index: parser/org/eclipse/cdt/internal/core/parser/MacroDescriptor.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/MacroDescriptor.java,v
retrieving revision 1.2
diff -u -r1.2 MacroDescriptor.java
--- parser/org/eclipse/cdt/internal/core/parser/MacroDescriptor.java 4 Mar 2003 18:25:40 -0000 1.2
+++ parser/org/eclipse/cdt/internal/core/parser/MacroDescriptor.java 13 Jun 2003 19:56:29 -0000
@@ -13,6 +13,9 @@
import java.util.Iterator;
import java.util.List;
+import org.eclipse.cdt.core.parser.IMacroDescriptor;
+import org.eclipse.cdt.core.parser.IToken;
+
public class MacroDescriptor implements IMacroDescriptor {
public MacroDescriptor()
@@ -89,7 +92,7 @@
current = 0;
while( iter.hasNext() )
{
- buffer.append( "Token #" + current++ + " is " + ((Token)iter.next()).toString() + "\n" );
+ buffer.append( "Token #" + current++ + " is " + ((IToken)iter.next()).toString() + "\n" );
}
return buffer.toString();
Index: parser/org/eclipse/cdt/internal/core/parser/Name.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/Name.java,v
retrieving revision 1.2
diff -u -r1.2 Name.java
--- parser/org/eclipse/cdt/internal/core/parser/Name.java 13 Jun 2003 15:01:22 -0000 1.2
+++ parser/org/eclipse/cdt/internal/core/parser/Name.java 13 Jun 2003 19:56:29 -0000
@@ -1,5 +1,7 @@
package org.eclipse.cdt.internal.core.parser;
+import org.eclipse.cdt.core.parser.IToken;
+
/**
@@ -12,44 +14,44 @@
*/
public class Name {
- private Token nameStart, nameEnd;
+ private IToken nameStart, nameEnd;
- public Name(Token nameStart) {
+ public Name(IToken nameStart) {
this.nameStart = nameStart;
}
- public Name(Token nameStart, Token nameEnd) {
+ public Name(IToken nameStart, IToken nameEnd) {
this( nameStart );
setEnd( nameEnd );
}
- public void setEnd(Token nameEnd) {
+ public void setEnd(IToken nameEnd) {
this.nameEnd = nameEnd;
}
public int getStartOffset()
{
- return nameStart.offset;
+ return nameStart.getOffset();
}
public int getEndOffset()
{
- return nameEnd.offset;
+ return nameEnd.getOffset();
}
public String toString() {
- Token t = nameStart;
+ IToken t = nameStart;
StringBuffer buffer = new StringBuffer();
buffer.append( t.getImage() );
- if( t.getType() == Token.t_operator )
+ if( t.getType() == IToken.t_operator )
buffer.append( " " );
while (t != nameEnd) {
t = t.getNext();
buffer.append( t.getImage() );
- if (t.getType() == Token.t_operator) buffer.append( " " );
+ if (t.getType() == IToken.t_operator) buffer.append( " " );
}
return buffer.toString();
@@ -62,7 +64,7 @@
/**
* @return
*/
- public Token getNameStart() {
+ public IToken getNameStart() {
return nameStart;
}
Index: parser/org/eclipse/cdt/internal/core/parser/NullParserCallback.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/Attic/NullParserCallback.java,v
retrieving revision 1.25
diff -u -r1.25 NullParserCallback.java
--- parser/org/eclipse/cdt/internal/core/parser/NullParserCallback.java 13 Jun 2003 15:01:22 -0000 1.25
+++ parser/org/eclipse/cdt/internal/core/parser/NullParserCallback.java 13 Jun 2003 19:56:30 -0000
@@ -1,6 +1,8 @@
package org.eclipse.cdt.internal.core.parser;
import org.eclipse.cdt.core.parser.IParser;
+import org.eclipse.cdt.core.parser.IParserCallback;
+import org.eclipse.cdt.core.parser.IToken;
public class NullParserCallback implements IParserCallback {
@@ -40,14 +42,14 @@
/* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.parser.IParserCallback#simpleDeclarationBegin(java.lang.Object)
*/
- public Object simpleDeclarationBegin(Object Container, Token firstToken) {
+ public Object simpleDeclarationBegin(Object Container, IToken firstToken) {
return null;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.parser.IParserCallback#simpleDeclSpecifier(java.lang.Object, org.eclipse.cdt.internal.core.parser.Token)
*/
- public void simpleDeclSpecifier(Object Container, Token specifier) {
+ public void simpleDeclSpecifier(Object Container, IToken specifier) {
}
/* (non-Javadoc)
@@ -60,7 +62,7 @@
/* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.parser.IParserCallback#simpleDeclarationEnd(java.lang.Object)
*/
- public void simpleDeclarationEnd(Object declaration, Token lastToken) {
+ public void simpleDeclarationEnd(Object declaration, IToken lastToken) {
}
/* (non-Javadoc)
@@ -79,13 +81,13 @@
/* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.parser.IParserCallback#nameBegin(org.eclipse.cdt.internal.core.parser.Token)
*/
- public void nameBegin(Token firstToken) {
+ public void nameBegin(IToken firstToken) {
}
/* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.parser.IParserCallback#nameEnd(org.eclipse.cdt.internal.core.parser.Token)
*/
- public void nameEnd(Token lastToken) {
+ public void nameEnd(IToken lastToken) {
}
/* (non-Javadoc)
@@ -111,7 +113,7 @@
/* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.parser.IParserCallback#declaratorCVModifier(java.lang.Object, org.eclipse.cdt.internal.core.parser.Token)
*/
- public void declaratorCVModifier(Object declarator, Token modifier) {
+ public void declaratorCVModifier(Object declarator, IToken modifier) {
}
/* (non-Javadoc)
@@ -149,7 +151,7 @@
/* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.parser.IParserCallback#pointerOperatorType(java.lang.Object, org.eclipse.cdt.internal.core.parser.Token)
*/
- public void pointerOperatorType(Object ptrOperator, Token type) {
+ public void pointerOperatorType(Object ptrOperator, IToken type) {
}
/* (non-Javadoc)
@@ -161,7 +163,7 @@
/* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.parser.IParserCallback#pointerOperatorCVModifier(java.lang.Object, org.eclipse.cdt.internal.core.parser.Token)
*/
- public void pointerOperatorCVModifier(Object ptrOperator, Token modifier) {
+ public void pointerOperatorCVModifier(Object ptrOperator, IToken modifier) {
}
/* (non-Javadoc)
@@ -199,7 +201,7 @@
/* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.parser.IParserCallback#classSpecifierBegin(java.lang.Object, org.eclipse.cdt.internal.core.parser.Token)
*/
- public Object classSpecifierBegin(Object container, Token classKey) {
+ public Object classSpecifierBegin(Object container, IToken classKey) {
return null;
}
@@ -218,13 +220,13 @@
/* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.parser.IParserCallback#classMemberVisibility(java.lang.Object, org.eclipse.cdt.internal.core.parser.Token)
*/
- public void classMemberVisibility(Object classSpecifier, Token visibility) {
+ public void classMemberVisibility(Object classSpecifier, IToken visibility) {
}
/* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.parser.IParserCallback#classSpecifierEnd(java.lang.Object)
*/
- public void classSpecifierEnd(Object classSpecifier, Token closingBrace) {
+ public void classSpecifierEnd(Object classSpecifier, IToken closingBrace) {
}
/* (non-Javadoc)
@@ -243,7 +245,7 @@
/* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.parser.IParserCallback#baseSpecifierVisibility(java.lang.Object, org.eclipse.cdt.internal.core.parser.Token)
*/
- public void baseSpecifierVisibility(Object baseSpecifier, Token visibility) {
+ public void baseSpecifierVisibility(Object baseSpecifier, IToken visibility) {
}
/* (non-Javadoc)
@@ -268,13 +270,13 @@
/* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.parser.IParserCallback#expressionOperator(java.lang.Object, org.eclipse.cdt.internal.core.parser.Token)
*/
- public void expressionOperator(Object expression, Token operator) {
+ public void expressionOperator(Object expression, IToken operator) {
}
/* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.parser.IParserCallback#expressionTerminal(java.lang.Object, org.eclipse.cdt.internal.core.parser.Token)
*/
- public void expressionTerminal(Object expression, Token terminal) {
+ public void expressionTerminal(Object expression, IToken terminal) {
}
/* (non-Javadoc)
@@ -292,7 +294,7 @@
/* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.parser.IParserCallback#elaboratedTypeSpecifierBegin(java.lang.Object, org.eclipse.cdt.internal.core.parser.Token)
*/
- public Object elaboratedTypeSpecifierBegin(Object container, Token classKey) {
+ public Object elaboratedTypeSpecifierBegin(Object container, IToken classKey) {
return null;
}
@@ -317,7 +319,7 @@
/* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.parser.IParserCallback#namespaceDeclarationBegin(java.lang.Object)
*/
- public Object namespaceDefinitionBegin(Object container, Token namespace) {
+ public Object namespaceDefinitionBegin(Object container, IToken namespace) {
return null;
}
@@ -336,7 +338,7 @@
/* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.parser.IParserCallback#namespaceDeclarationEnd(java.lang.Object)
*/
- public void namespaceDefinitionEnd(Object namespace, Token closingBrace) {
+ public void namespaceDefinitionEnd(Object namespace, IToken closingBrace) {
}
/* (non-Javadoc)
@@ -413,7 +415,7 @@
/* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.parser.IParserCallback#enumSpecifierBegin(java.lang.Object)
*/
- public Object enumSpecifierBegin(Object container, Token enumKey) {
+ public Object enumSpecifierBegin(Object container, IToken enumKey) {
return null;
}
@@ -432,7 +434,7 @@
/* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.parser.IParserCallback#enumSpecifierEnd(java.lang.Object)
*/
- public void enumSpecifierEnd(Object enumSpec, Token closingBrace) {
+ public void enumSpecifierEnd(Object enumSpec, IToken closingBrace) {
}
/* (non-Javadoc)
@@ -451,7 +453,7 @@
/* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.parser.IParserCallback#enumDefinitionEnd(java.lang.Object)
*/
- public void enumeratorEnd(Object enumDefn, Token lastToken) {
+ public void enumeratorEnd(Object enumDefn, IToken lastToken) {
}
/* (non-Javadoc)
@@ -546,7 +548,7 @@
/* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.parser.IParserCallback#templateDeclarationBegin(java.lang.Object, boolean)
*/
- public Object templateDeclarationBegin(Object container, Token exported) {
+ public Object templateDeclarationBegin(Object container, IToken exported) {
return null;
}
@@ -559,13 +561,13 @@
/* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.parser.IParserCallback#templateDeclarationEnd(java.lang.Object)
*/
- public void templateDeclarationEnd(Object templateDecl, Token lastToken) {
+ public void templateDeclarationEnd(Object templateDecl, IToken lastToken) {
}
/* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.parser.IParserCallback#templateTypeParameterBegin(java.lang.Object, org.eclipse.cdt.internal.core.parser.Token)
*/
- public Object templateTypeParameterBegin(Object templDecl, Token kind) {
+ public Object templateTypeParameterBegin(Object templDecl, IToken kind) {
return null;
}
Index: parser/org/eclipse/cdt/internal/core/parser/NullSourceElementRequestor.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/NullSourceElementRequestor.java,v
retrieving revision 1.1
diff -u -r1.1 NullSourceElementRequestor.java
--- parser/org/eclipse/cdt/internal/core/parser/NullSourceElementRequestor.java 13 Jun 2003 18:24:25 -0000 1.1
+++ parser/org/eclipse/cdt/internal/core/parser/NullSourceElementRequestor.java 13 Jun 2003 19:56:30 -0000
@@ -1,14 +1,15 @@
package org.eclipse.cdt.internal.core.parser;
-import org.eclipse.cdt.core.parser.ISourceElementRequestor;
import org.eclipse.cdt.core.parser.IParser;
+import org.eclipse.cdt.core.parser.IParserCallback;
import org.eclipse.cdt.core.parser.IProblem;
+import org.eclipse.cdt.core.parser.ISourceElementRequestor;
+import org.eclipse.cdt.core.parser.IToken;
import org.eclipse.cdt.core.parser.ast.IASTASMDefinition;
import org.eclipse.cdt.core.parser.ast.IASTClassSpecifier;
import org.eclipse.cdt.core.parser.ast.IASTCompilationUnit;
import org.eclipse.cdt.core.parser.ast.IASTConstructor;
-import org.eclipse.cdt.core.parser.ast.IASTEnumSpecifier;
-import org.eclipse.cdt.core.parser.ast.IASTEnumerator;
+import org.eclipse.cdt.core.parser.ast.IASTEnumerationSpecifier;
import org.eclipse.cdt.core.parser.ast.IASTField;
import org.eclipse.cdt.core.parser.ast.IASTFunction;
import org.eclipse.cdt.core.parser.ast.IASTInclusion;
@@ -23,8 +24,6 @@
import org.eclipse.cdt.core.parser.ast.IASTUsingDeclaration;
import org.eclipse.cdt.core.parser.ast.IASTUsingDirective;
import org.eclipse.cdt.core.parser.ast.IASTVariable;
-import org.eclipse.cdt.internal.core.parser.IParserCallback;
-import org.eclipse.cdt.internal.core.parser.Token;
public class NullSourceElementRequestor implements ISourceElementRequestor, IParserCallback {
@@ -80,24 +79,6 @@
}
/* (non-Javadoc)
- * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#enterEnumSpecifier(org.eclipse.cdt.core.parser.ast.IASTEnumSpecifier)
- */
- public void enterEnumSpecifier(IASTEnumSpecifier enumSpec) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptEnumerator(org.eclipse.cdt.core.parser.ast.IASTEnumerator)
- */
- public void acceptEnumerator(IASTEnumerator enumerator) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#exitEnumSpecifier(org.eclipse.cdt.core.parser.ast.IASTEnumSpecifier)
- */
- public void exitEnumSpecifier(IASTEnumSpecifier enumSpec) {
- }
-
- /* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ISourceElementRequestor#enterFunctionBody(org.eclipse.cdt.core.parser.ast.IASTFunction)
*/
public void enterFunctionBody(IASTFunction function) {
@@ -274,14 +255,14 @@
/* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.parser.IParserCallback#simpleDeclarationBegin(java.lang.Object)
*/
- public Object simpleDeclarationBegin(Object Container, Token firstToken) {
+ public Object simpleDeclarationBegin(Object Container, IToken firstToken) {
return null;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.parser.IParserCallback#simpleDeclSpecifier(java.lang.Object, org.eclipse.cdt.internal.core.parser.Token)
*/
- public void simpleDeclSpecifier(Object Container, Token specifier) {
+ public void simpleDeclSpecifier(Object Container, IToken specifier) {
}
/* (non-Javadoc)
@@ -294,7 +275,7 @@
/* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.parser.IParserCallback#simpleDeclarationEnd(java.lang.Object)
*/
- public void simpleDeclarationEnd(Object declaration, Token lastToken) {
+ public void simpleDeclarationEnd(Object declaration, IToken lastToken) {
}
/* (non-Javadoc)
@@ -313,13 +294,13 @@
/* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.parser.IParserCallback#nameBegin(org.eclipse.cdt.internal.core.parser.Token)
*/
- public void nameBegin(Token firstToken) {
+ public void nameBegin(IToken firstToken) {
}
/* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.parser.IParserCallback#nameEnd(org.eclipse.cdt.internal.core.parser.Token)
*/
- public void nameEnd(Token lastToken) {
+ public void nameEnd(IToken lastToken) {
}
/* (non-Javadoc)
@@ -345,7 +326,7 @@
/* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.parser.IParserCallback#declaratorCVModifier(java.lang.Object, org.eclipse.cdt.internal.core.parser.Token)
*/
- public void declaratorCVModifier(Object declarator, Token modifier) {
+ public void declaratorCVModifier(Object declarator, IToken modifier) {
}
/* (non-Javadoc)
@@ -383,7 +364,7 @@
/* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.parser.IParserCallback#pointerOperatorType(java.lang.Object, org.eclipse.cdt.internal.core.parser.Token)
*/
- public void pointerOperatorType(Object ptrOperator, Token type) {
+ public void pointerOperatorType(Object ptrOperator, IToken type) {
}
/* (non-Javadoc)
@@ -395,7 +376,7 @@
/* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.parser.IParserCallback#pointerOperatorCVModifier(java.lang.Object, org.eclipse.cdt.internal.core.parser.Token)
*/
- public void pointerOperatorCVModifier(Object ptrOperator, Token modifier) {
+ public void pointerOperatorCVModifier(Object ptrOperator, IToken modifier) {
}
/* (non-Javadoc)
@@ -433,7 +414,7 @@
/* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.parser.IParserCallback#classSpecifierBegin(java.lang.Object, org.eclipse.cdt.internal.core.parser.Token)
*/
- public Object classSpecifierBegin(Object container, Token classKey) {
+ public Object classSpecifierBegin(Object container, IToken classKey) {
return null;
}
@@ -452,13 +433,13 @@
/* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.parser.IParserCallback#classMemberVisibility(java.lang.Object, org.eclipse.cdt.internal.core.parser.Token)
*/
- public void classMemberVisibility(Object classSpecifier, Token visibility) {
+ public void classMemberVisibility(Object classSpecifier, IToken visibility) {
}
/* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.parser.IParserCallback#classSpecifierEnd(java.lang.Object)
*/
- public void classSpecifierEnd(Object classSpecifier, Token closingBrace) {
+ public void classSpecifierEnd(Object classSpecifier, IToken closingBrace) {
}
/* (non-Javadoc)
@@ -477,7 +458,7 @@
/* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.parser.IParserCallback#baseSpecifierVisibility(java.lang.Object, org.eclipse.cdt.internal.core.parser.Token)
*/
- public void baseSpecifierVisibility(Object baseSpecifier, Token visibility) {
+ public void baseSpecifierVisibility(Object baseSpecifier, IToken visibility) {
}
/* (non-Javadoc)
@@ -502,13 +483,13 @@
/* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.parser.IParserCallback#expressionOperator(java.lang.Object, org.eclipse.cdt.internal.core.parser.Token)
*/
- public void expressionOperator(Object expression, Token operator) {
+ public void expressionOperator(Object expression, IToken operator) {
}
/* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.parser.IParserCallback#expressionTerminal(java.lang.Object, org.eclipse.cdt.internal.core.parser.Token)
*/
- public void expressionTerminal(Object expression, Token terminal) {
+ public void expressionTerminal(Object expression, IToken terminal) {
}
/* (non-Javadoc)
@@ -526,7 +507,7 @@
/* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.parser.IParserCallback#elaboratedTypeSpecifierBegin(java.lang.Object, org.eclipse.cdt.internal.core.parser.Token)
*/
- public Object elaboratedTypeSpecifierBegin(Object container, Token classKey) {
+ public Object elaboratedTypeSpecifierBegin(Object container, IToken classKey) {
return null;
}
@@ -551,7 +532,7 @@
/* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.parser.IParserCallback#namespaceDeclarationBegin(java.lang.Object)
*/
- public Object namespaceDefinitionBegin(Object container, Token namespace) {
+ public Object namespaceDefinitionBegin(Object container, IToken namespace) {
return null;
}
@@ -570,7 +551,7 @@
/* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.parser.IParserCallback#namespaceDeclarationEnd(java.lang.Object)
*/
- public void namespaceDefinitionEnd(Object namespace, Token closingBrace) {
+ public void namespaceDefinitionEnd(Object namespace, IToken closingBrace) {
}
/* (non-Javadoc)
@@ -647,7 +628,7 @@
/* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.parser.IParserCallback#enumSpecifierBegin(java.lang.Object)
*/
- public Object enumSpecifierBegin(Object container, Token enumKey) {
+ public Object enumSpecifierBegin(Object container, IToken enumKey) {
return null;
}
@@ -666,7 +647,7 @@
/* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.parser.IParserCallback#enumSpecifierEnd(java.lang.Object)
*/
- public void enumSpecifierEnd(Object enumSpec, Token closingBrace) {
+ public void enumSpecifierEnd(Object enumSpec, IToken closingBrace) {
}
/* (non-Javadoc)
@@ -685,7 +666,7 @@
/* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.parser.IParserCallback#enumDefinitionEnd(java.lang.Object)
*/
- public void enumeratorEnd(Object enumDefn, Token lastToken) {
+ public void enumeratorEnd(Object enumDefn, IToken lastToken) {
}
/* (non-Javadoc)
@@ -780,7 +761,7 @@
/* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.parser.IParserCallback#templateDeclarationBegin(java.lang.Object, boolean)
*/
- public Object templateDeclarationBegin(Object container, Token exported) {
+ public Object templateDeclarationBegin(Object container, IToken exported) {
return null;
}
@@ -793,13 +774,13 @@
/* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.parser.IParserCallback#templateDeclarationEnd(java.lang.Object)
*/
- public void templateDeclarationEnd(Object templateDecl, Token lastToken) {
+ public void templateDeclarationEnd(Object templateDecl, IToken lastToken) {
}
/* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.parser.IParserCallback#templateTypeParameterBegin(java.lang.Object, org.eclipse.cdt.internal.core.parser.Token)
*/
- public Object templateTypeParameterBegin(Object templDecl, Token kind) {
+ public Object templateTypeParameterBegin(Object templDecl, IToken kind) {
return null;
}
@@ -875,5 +856,21 @@
* @see org.eclipse.cdt.internal.core.parser.IParserCallback#simpleDeclSpecifierType(java.lang.Object, java.lang.Object)
*/
public void simpleDeclSpecifierType(Object declaration, Object type) {
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptEnumerationSpecifier(org.eclipse.cdt.core.parser.ast.IASTEnumerationSpecifier)
+ */
+ public void acceptEnumerationSpecifier(IASTEnumerationSpecifier enumeration) {
+ // TODO Auto-generated method stub
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptClassReference(org.eclipse.cdt.core.parser.ast.IASTClassSpecifier, int)
+ */
+ public void acceptClassReference(IASTClassSpecifier classSpecifier, int referenceOffset) {
+ // TODO Auto-generated method stub
+
}
}
Index: parser/org/eclipse/cdt/internal/core/parser/Parser.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/Parser.java,v
retrieving revision 1.51
diff -u -r1.51 Parser.java
--- parser/org/eclipse/cdt/internal/core/parser/Parser.java 13 Jun 2003 18:24:25 -0000 1.51
+++ parser/org/eclipse/cdt/internal/core/parser/Parser.java 13 Jun 2003 19:56:31 -0000
@@ -16,9 +16,16 @@
import java.io.StringReader;
import org.eclipse.cdt.core.parser.IParser;
+import org.eclipse.cdt.core.parser.IParserCallback;
import org.eclipse.cdt.core.parser.IScanner;
import org.eclipse.cdt.core.parser.ISourceElementRequestor;
+import org.eclipse.cdt.core.parser.IToken;
+import org.eclipse.cdt.core.parser.ScannerException;
+import org.eclipse.cdt.core.parser.ast.AccessVisibility;
+import org.eclipse.cdt.core.parser.ast.ClassKind;
+import org.eclipse.cdt.core.parser.ast.ClassNameType;
import org.eclipse.cdt.core.parser.ast.IASTASMDefinition;
+import org.eclipse.cdt.core.parser.ast.IASTClassSpecifier;
import org.eclipse.cdt.core.parser.ast.IASTCompilationUnit;
import org.eclipse.cdt.core.parser.ast.IASTFactory;
import org.eclipse.cdt.core.parser.ast.IASTLinkageSpecification;
@@ -38,6 +45,7 @@
*/
public class Parser implements IParser {
+ private ClassNameType access;
private static int DEFAULT_OFFSET = -1; // sentinel initial value for offsets
private int firstErrorOffset = DEFAULT_OFFSET; // offset where the first parse error occurred
private IParserCallback callback; // the parser callback that was registered with us
@@ -56,7 +64,7 @@
protected void failParse() throws EndOfFile
{
if( firstErrorOffset == DEFAULT_OFFSET )
- firstErrorOffset = LA(1).offset;
+ firstErrorOffset = LA(1).getOffset();
parsePassed = false;
}
@@ -181,8 +189,8 @@
IASTCompilationUnit compilationUnit = astFactory.createCompilationUnit();
requestor.enterCompilationUnit( compilationUnit );
- Token lastBacktrack = null;
- Token checkToken;
+ IToken lastBacktrack = null;
+ IToken checkToken;
while (true) {
try {
checkToken = LA(1);
@@ -232,13 +240,13 @@
failParse();
consume();
int depth = 0;
- while ( ! ( (LT(1) == Token.tSEMI && depth == 0 ) || ( LT(1) == Token.tRBRACE && depth == 1 ) ) ){
+ while ( ! ( (LT(1) == IToken.tSEMI && depth == 0 ) || ( LT(1) == IToken.tRBRACE && depth == 1 ) ) ){
switch( LT(1))
{
- case Token.tLBRACE:
+ case IToken.tLBRACE:
++depth;
break;
- case Token.tRBRACE:
+ case IToken.tRBRACE:
--depth;
break;
}
@@ -263,18 +271,18 @@
*/
protected void usingClause( Object container, IASTScope scope ) throws Backtrack
{
- Token firstToken = consume( Token.t_using );
+ IToken firstToken = consume( IToken.t_using );
- if( LT(1) == Token.t_namespace )
+ if( LT(1) == IToken.t_namespace )
{
Object directive = null;
try{ directive = callback.usingDirectiveBegin( container);} catch( Exception e ) {}
// using-directive
- consume( Token.t_namespace );
+ consume( IToken.t_namespace );
// optional :: and nested classes handled in name
TokenDuple duple = null ;
- if( LT(1) == Token.tIDENTIFIER || LT(1) == Token.tCOLONCOLON )
+ if( LT(1) == IToken.tIDENTIFIER || LT(1) == IToken.tCOLONCOLON )
{
duple = name();
try{ callback.usingDirectiveNamespaceId( directive );} catch( Exception e ) {}
@@ -285,9 +293,9 @@
throw backtrack;
}
- if( LT(1) == Token.tSEMI )
+ if( LT(1) == IToken.tSEMI )
{
- consume( Token.tSEMI );
+ consume( IToken.tSEMI );
try{ callback.usingDirectiveEnd( directive );} catch( Exception e ) {}
IASTUsingDirective astUD = astFactory.createUsingDirective(scope, duple);
@@ -306,14 +314,14 @@
try{ usingDeclaration = callback.usingDeclarationBegin( container );} catch( Exception e ) {}
boolean typeName = false;
- if( LT(1) == Token.t_typename )
+ if( LT(1) == IToken.t_typename )
{
typeName = true;
- consume( Token.t_typename );
+ consume( IToken.t_typename );
}
TokenDuple name = null;
- if( LT(1) == Token.tIDENTIFIER || LT(1) == Token.tCOLONCOLON )
+ if( LT(1) == IToken.tIDENTIFIER || LT(1) == IToken.tCOLONCOLON )
{
// optional :: and nested classes handled in name
name = name();
@@ -325,9 +333,9 @@
throw backtrack;
}
- if( LT(1) == Token.tSEMI )
+ if( LT(1) == IToken.tSEMI )
{
- consume( Token.tSEMI );
+ consume( IToken.tSEMI );
try{ callback.usingDeclarationEnd( usingDeclaration );} catch( Exception e ) {}
@@ -355,29 +363,29 @@
*/
protected void linkageSpecification( Object container, IASTScope scope ) throws Backtrack
{
- consume( Token.t_extern );
+ consume( IToken.t_extern );
- if( LT(1) != Token.tSTRING )
+ if( LT(1) != IToken.tSTRING )
throw backtrack;
Object linkageSpec = null;
- Token spec = consume( Token.tSTRING );
+ IToken spec = consume( IToken.tSTRING );
try{ linkageSpec = callback.linkageSpecificationBegin( container, spec.getImage() );} catch( Exception e ) {}
- if( LT(1) == Token.tLBRACE )
+ if( LT(1) == IToken.tLBRACE )
{
- consume(Token.tLBRACE);
+ consume(IToken.tLBRACE);
IASTLinkageSpecification linkage = astFactory.createLinkageSpecification(scope, spec.getImage());
requestor.enterLinkageSpecification( linkage );
linkageDeclarationLoop:
- while (LT(1) != Token.tRBRACE) {
- Token checkToken = LA(1);
+ while (LT(1) != IToken.tRBRACE) {
+ IToken checkToken = LA(1);
switch (LT(1)) {
- case Token.tRBRACE:
- consume(Token.tRBRACE);
+ case IToken.tRBRACE:
+ consume(IToken.tRBRACE);
break linkageDeclarationLoop;
default:
try
@@ -427,17 +435,17 @@
*/
protected void templateDeclaration( Object container ) throws Backtrack
{
- Token firstToken = null;
- if( LT(1) == Token.t_export )
+ IToken firstToken = null;
+ if( LT(1) == IToken.t_export )
{
- firstToken = consume( Token.t_export );
- consume( Token.t_template );
+ firstToken = consume( IToken.t_export );
+ consume( IToken.t_template );
}
else
- firstToken = consume( Token.t_template );
+ firstToken = consume( IToken.t_template );
- if( LT(1) != Token.tLT )
+ if( LT(1) != IToken.tLT )
{
// explicit-instantiation
Object instantiation = null;
@@ -448,10 +456,10 @@
}
else
{
- consume( Token.tLT );
- if( LT(1) == Token.tGT )
+ consume( IToken.tLT );
+ if( LT(1) == IToken.tGT )
{
- consume( Token.tGT );
+ consume( IToken.tGT );
// explicit-specialization
Object specialization = null;
try{ specialization = callback.explicitSpecializationBegin( container ); } catch( Exception e ) { }
@@ -466,9 +474,9 @@
{
try{ templateDeclaration = callback.templateDeclarationBegin( container, firstToken ); } catch ( Exception e ) {}
templateParameterList( templateDeclaration );
- consume( Token.tGT );
+ consume( IToken.tGT );
declaration( templateDeclaration );
- try{ callback.templateDeclarationEnd( templateDeclaration, lastToken ); } catch( Exception e ) {}
+ try{ callback.templateDeclarationEnd( templateDeclaration, (Token)lastToken ); } catch( Exception e ) {}
} catch( Backtrack bt )
{
@@ -511,8 +519,8 @@
for ( ; ; )
{
- if( LT(1) == Token.tGT ) return;
- if( LT(1) == Token.t_class || LT(1) == Token.t_typename )
+ if( LT(1) == IToken.tGT ) return;
+ if( LT(1) == IToken.t_class || LT(1) == IToken.t_typename )
{
Object currentTemplateParm = null;
try
@@ -521,13 +529,13 @@
currentTemplateParm = callback.templateTypeParameterBegin(
templateParameterList, consume() );
} catch( Exception e ) {}
- if( LT(1) == Token.tIDENTIFIER ) // optional identifier
+ if( LT(1) == IToken.tIDENTIFIER ) // optional identifier
{
identifier();
try { callback.templateTypeParameterName( currentTemplateParm );} catch( Exception e ) {}
- if( LT(1) == Token.tASSIGN ) // optional = type-id
+ if( LT(1) == IToken.tASSIGN ) // optional = type-id
{
- consume( Token.tASSIGN );
+ consume( IToken.tASSIGN );
typeId(); // type-id
try{ callback.templateTypeParameterInitialTypeId( currentTemplateParm ); }catch( Exception e ) {}
}
@@ -540,31 +548,31 @@
throw bt;
}
}
- else if( LT(1) == Token.t_template )
+ else if( LT(1) == IToken.t_template )
{
- Token kind = consume( Token.t_template );
- consume( Token.tLT );
+ IToken kind = consume( IToken.t_template );
+ consume( IToken.tLT );
Object newTemplateParm = null;
try{ newTemplateParm = callback.templateTypeParameterBegin(templateParameterList,kind ); } catch( Exception e ) {}
templateParameterList( newTemplateParm );
- consume( Token.tGT );
- consume( Token.t_class );
- if( LT(1) == Token.tIDENTIFIER ) // optional identifier
+ consume( IToken.tGT );
+ consume( IToken.t_class );
+ if( LT(1) == IToken.tIDENTIFIER ) // optional identifier
{
identifier();
try{ callback.templateTypeParameterName( newTemplateParm );} catch( Exception e ) {}
- if( LT(1) == Token.tASSIGN ) // optional = type-id
+ if( LT(1) == IToken.tASSIGN ) // optional = type-id
{
- consume( Token.tASSIGN );
+ consume( IToken.tASSIGN );
typeId();
try{ callback.templateTypeParameterInitialTypeId( newTemplateParm );} catch( Exception e ) {}
}
}
try{ callback.templateTypeParameterEnd( newTemplateParm );} catch( Exception e ) {}
}
- else if( LT(1) == Token.tCOMMA )
+ else if( LT(1) == IToken.tCOMMA )
{
- consume( Token.tCOMMA );
+ consume( IToken.tCOMMA );
continue;
}
else
@@ -604,12 +612,12 @@
*/
protected void declaration( Object container, IASTScope scope ) throws Backtrack {
switch (LT(1)) {
- case Token.t_asm:
- Token first = consume( Token.t_asm );
- consume( Token.tLPAREN );
- String assembly = consume( Token.tSTRING ).getImage();
- consume( Token.tRPAREN );
- Token last = consume( Token.tSEMI );
+ case IToken.t_asm:
+ IToken first = consume( IToken.t_asm );
+ consume( IToken.tLPAREN );
+ String assembly = consume( IToken.tSTRING ).getImage();
+ consume( IToken.tRPAREN );
+ IToken last = consume( IToken.tSEMI );
IASTASMDefinition asmDefinition =
astFactory.createASMDefinition(scope, assembly, first.getOffset(), last.getEndOffset());
@@ -620,33 +628,33 @@
requestor.acceptASMDefinition( asmDefinition );
return;
- case Token.t_namespace:
+ case IToken.t_namespace:
namespaceDefinition( container, scope);
return;
- case Token.t_using:
+ case IToken.t_using:
usingClause( container, scope );
return;
- case Token.t_export:
- case Token.t_template:
+ case IToken.t_export:
+ case IToken.t_template:
templateDeclaration( container );
return;
- case Token.t_extern:
- if( LT(2) == Token.tSTRING )
+ case IToken.t_extern:
+ if( LT(2) == IToken.tSTRING )
{
linkageSpecification( container, scope );
return;
}
default:
- Token mark = mark();
+ IToken mark = mark();
try
{
- simpleDeclaration( container, true ); // try it first with the original strategy
+ simpleDeclaration( container, true, scope ); // try it first with the original strategy
}
catch( Backtrack bt)
{
// did not work
backup( mark );
- simpleDeclaration( container, false ); // try it again with the second strategy
+ simpleDeclaration( container, false, scope ); // try it again with the second strategy
}
}
}
@@ -665,18 +673,18 @@
protected void namespaceDefinition( Object container, IASTScope scope ) throws Backtrack
{
Object namespace = null;
- Token first = consume( Token.t_namespace );
+ IToken first = consume( IToken.t_namespace );
try{ namespace = callback.namespaceDefinitionBegin( container, first );} catch( Exception e ) {}
- Token identifier = null;
+ IToken identifier = null;
// optional name
- if( LT(1) == Token.tIDENTIFIER )
+ if( LT(1) == IToken.tIDENTIFIER )
{
identifier = identifier();
try{ callback.namespaceDefinitionId( namespace );} catch( Exception e ) {}
}
- if( LT(1) == Token.tLBRACE )
+ if( LT(1) == IToken.tLBRACE )
{
consume();
@@ -689,10 +697,10 @@
requestor.enterNamespaceDefinition( namespaceDefinition );
namepsaceDeclarationLoop:
- while (LT(1) != Token.tRBRACE) {
- Token checkToken = LA(1);
+ while (LT(1) != IToken.tRBRACE) {
+ IToken checkToken = LA(1);
switch (LT(1)) {
- case Token.tRBRACE:
+ case IToken.tRBRACE:
//consume(Token.tRBRACE);
break namepsaceDeclarationLoop;
default:
@@ -712,8 +720,8 @@
}
// consume the }
- Token last = consume( Token.tRBRACE );
- try{ callback.namespaceDefinitionEnd( namespace, last);} catch( Exception e ) {}
+ IToken last = consume( IToken.tRBRACE );
+ try{ callback.namespaceDefinitionEnd( namespace, (Token)last);} catch( Exception e ) {}
namespaceDefinition.setEndingOffset( last.getOffset() + last.getLength());
requestor.exitNamespaceDefinition( namespaceDefinition );
@@ -744,17 +752,17 @@
* @param tryConstructor true == take strategy1 (constructor ) : false == take strategy 2 ( pointer to function)
* @throws Backtrack request a backtrack
*/
- protected void simpleDeclaration( Object container, boolean tryConstructor ) throws Backtrack {
+ protected void simpleDeclaration( Object container, boolean tryConstructor, IASTScope scope ) throws Backtrack {
Object simpleDecl = null;
try{ simpleDecl = callback.simpleDeclarationBegin( container, LA(1));} catch( Exception e ) {}
- declSpecifierSeq(simpleDecl, false, tryConstructor);
+ declSpecifierSeq(simpleDecl, false, tryConstructor, scope);
Object declarator = null;
- if (LT(1) != Token.tSEMI)
+ if (LT(1) != IToken.tSEMI)
try {
declarator = initDeclarator(simpleDecl);
- while (LT(1) == Token.tCOMMA) {
+ while (LT(1) == IToken.tCOMMA) {
consume();
try {
@@ -768,26 +776,26 @@
}
switch (LT(1)) {
- case Token.tSEMI:
- consume(Token.tSEMI);
+ case IToken.tSEMI:
+ consume(IToken.tSEMI);
break;
- case Token.tCOLON:
+ case IToken.tCOLON:
ctorInitializer(declarator);
// Falling through on purpose
- case Token.tLBRACE:
+ case IToken.tLBRACE:
Object function = null;
try{ function = callback.functionBodyBegin(simpleDecl ); } catch( Exception e ) {}
if (quickParse) {
// speed up the parser by skiping the body
// simply look for matching brace and return
- consume(Token.tLBRACE);
+ consume(IToken.tLBRACE);
int depth = 1;
while (depth > 0) {
switch (consume().getType()) {
- case Token.tRBRACE:
+ case IToken.tRBRACE:
--depth;
break;
- case Token.tLBRACE:
+ case IToken.tLBRACE:
++depth;
break;
}
@@ -801,7 +809,7 @@
throw backtrack;
}
- try{ callback.simpleDeclarationEnd(simpleDecl, lastToken);} catch( Exception e ) {}
+ try{ callback.simpleDeclarationEnd(simpleDecl, (Token)lastToken);} catch( Exception e ) {}
}
/**
@@ -816,23 +824,23 @@
* @throws Backtrack request a backtrack
*/
protected void ctorInitializer(Object declarator) throws Backtrack {
- consume( Token.tCOLON );
+ consume( IToken.tCOLON );
Object constructorChain = null;
try { constructorChain = callback.constructorChainBegin(declarator);} catch( Exception e ) {}
try {
for( ; ; ) {
- if( LT(1) == Token.tLBRACE ) break;
+ if( LT(1) == IToken.tLBRACE ) break;
Object constructorChainElement = null;
try{ constructorChainElement = callback.constructorChainElementBegin( constructorChain );} catch( Exception e ) {}
name();
try{ callback.constructorChainElementId(constructorChainElement);} catch( Exception e) {}
- consume( Token.tLPAREN );
+ consume( IToken.tLPAREN );
- while( LT(1) != Token.tRPAREN )
+ while( LT(1) != IToken.tRPAREN )
{
//handle expression list here
Object item = null;
@@ -842,15 +850,15 @@
assignmentExpression( expression );
try{ callback.expressionEnd( item );} catch( Exception e) {}
try{ callback.constructorChainElementExpressionListElementEnd( item );} catch( Exception e) {}
- if( LT(1) == Token.tRPAREN ) break;
- consume( Token.tCOMMA );
+ if( LT(1) == IToken.tRPAREN ) break;
+ consume( IToken.tCOMMA );
}
- consume( Token.tRPAREN );
+ consume( IToken.tRPAREN );
try{ callback.constructorChainElementEnd(constructorChainElement );} catch( Exception e) {}
- if( LT(1) == Token.tLBRACE ) break;
- if( LT(1) == Token.tCOMMA ) consume( Token.tCOMMA );
+ if( LT(1) == IToken.tLBRACE ) break;
+ if( LT(1) == IToken.tCOMMA ) consume( IToken.tCOMMA );
}
}
catch( Backtrack bt )
@@ -872,12 +880,12 @@
*/
protected void parameterDeclaration( Object containerObject ) throws Backtrack
{
- Token current = LA(1);
+ IToken current = LA(1);
Object parameterDecl = null;
try{ parameterDecl = callback.parameterDeclarationBegin( containerObject );} catch( Exception e ) {}
- declSpecifierSeq( parameterDecl, true, false );
+ declSpecifierSeq( parameterDecl, true, false, null );
- if (LT(1) != Token.tSEMI)
+ if (LT(1) != IToken.tSEMI)
try {
Object declarator = initDeclarator(parameterDecl);
@@ -963,11 +971,11 @@
private boolean lookAheadForConstructorOrConversion( Flags flags ) throws EndOfFile
{
if (flags.isForParameterDeclaration()) return false;
- if (LT(2) == Token.tLPAREN && flags.isForConstructor()) return true;
+ if (LT(2) == IToken.tLPAREN && flags.isForConstructor()) return true;
int posTokenAfterTemplateParameters = 2;
- if (LT(posTokenAfterTemplateParameters) == Token.tLT) {
+ if (LT(posTokenAfterTemplateParameters) == IToken.tLT) {
// a case for template constructor, like CFoobar<A,B>::CFoobar
posTokenAfterTemplateParameters++;
@@ -977,10 +985,10 @@
while (depth > 0) {
switch (LT(posTokenAfterTemplateParameters++)) {
- case Token.tGT :
+ case IToken.tGT :
--depth;
break;
- case Token.tLT :
+ case IToken.tLT :
++depth;
break;
}
@@ -991,20 +999,20 @@
return
(
(
- (LT(posTokenAfterTemplateParameters) == Token.tCOLONCOLON)
+ (LT(posTokenAfterTemplateParameters) == IToken.tCOLONCOLON)
&&
(
LA(posTokenAfterTemplateParameters+1).getImage().equals( LA(1).getImage() ) ||
- LT(posTokenAfterTemplateParameters+1) == Token.tCOMPL
+ LT(posTokenAfterTemplateParameters+1) == IToken.tCOMPL
)
)
||
(
// for conversion operators
- (LT(posTokenAfterTemplateParameters) == Token.tCOLONCOLON)
+ (LT(posTokenAfterTemplateParameters) == IToken.tCOLONCOLON)
&&
(
- LT(posTokenAfterTemplateParameters+1) == Token.t_operator
+ LT(posTokenAfterTemplateParameters+1) == IToken.t_operator
)
)
);
@@ -1021,10 +1029,10 @@
flags.haveEncounteredTypename() &&
(
(
- LT(2) != Token.tIDENTIFIER ||
+ LT(2) != IToken.tIDENTIFIER ||
(
- LT(3) != Token.tLPAREN &&
- LT(3) != Token.tASSIGN
+ LT(3) != IToken.tLPAREN &&
+ LT(3) != IToken.tASSIGN
)
) &&
!LA(2).isPointer()
@@ -1058,47 +1066,47 @@
* @param tryConstructor true for constructor, false for pointer to function strategy
* @throws Backtrack request a backtrack
*/
- protected void declSpecifierSeq( Object decl, boolean parm, boolean tryConstructor ) throws Backtrack {
+ protected void declSpecifierSeq( Object decl, boolean parm, boolean tryConstructor, IASTScope scope ) throws Backtrack {
Flags flags = new Flags( parm, tryConstructor );
declSpecifiers:
for (;;) {
switch (LT(1)) {
- case Token.t_inline:
- case Token.t_auto:
- case Token.t_register:
- case Token.t_static:
- case Token.t_extern:
- case Token.t_mutable:
- case Token.t_virtual:
- case Token.t_explicit:
- case Token.t_typedef:
- case Token.t_friend:
- case Token.t_const:
- case Token.t_volatile:
+ case IToken.t_inline:
+ case IToken.t_auto:
+ case IToken.t_register:
+ case IToken.t_static:
+ case IToken.t_extern:
+ case IToken.t_mutable:
+ case IToken.t_virtual:
+ case IToken.t_explicit:
+ case IToken.t_typedef:
+ case IToken.t_friend:
+ case IToken.t_const:
+ case IToken.t_volatile:
try{ callback.simpleDeclSpecifier(decl, consume());} catch( Exception e ) {}
break;
- case Token.t_signed:
- case Token.t_unsigned:
- case Token.t_short:
- case Token.t_char:
- case Token.t_wchar_t:
- case Token.t_bool:
- case Token.t_int:
- case Token.t_long:
- case Token.t_float:
- case Token.t_double:
- case Token.t_void:
+ case IToken.t_signed:
+ case IToken.t_unsigned:
+ case IToken.t_short:
+ case IToken.t_char:
+ case IToken.t_wchar_t:
+ case IToken.t_bool:
+ case IToken.t_int:
+ case IToken.t_long:
+ case IToken.t_float:
+ case IToken.t_double:
+ case IToken.t_void:
flags.setEncounteredRawType(true);
try{ callback.simpleDeclSpecifier(decl, consume());} catch( Exception e ) {}
break;
- case Token.t_typename:
- try{ callback.simpleDeclSpecifier(decl, consume( Token.t_typename ));} catch( Exception e ) {}
- Token first = LA(1);
- Token last = null;
+ case IToken.t_typename:
+ try{ callback.simpleDeclSpecifier(decl, consume( IToken.t_typename ));} catch( Exception e ) {}
+ IToken first = LA(1);
+ IToken last = null;
name();
- if( LT(1) == Token.t_template )
+ if( LT(1) == IToken.t_template )
{
- consume( Token.t_template );
+ consume( IToken.t_template );
last = templateId();
try
{
@@ -1112,10 +1120,10 @@
try{ callback.simpleDeclSpecifierName( decl );} catch( Exception e ) {}
return;
- case Token.tCOLONCOLON:
- consume( Token.tCOLONCOLON );
+ case IToken.tCOLONCOLON:
+ consume( IToken.tCOLONCOLON );
// handle nested later:
- case Token.tIDENTIFIER:
+ case IToken.tIDENTIFIER:
// TODO - Kludgy way to handle constructors/destructors
// handle nested later:
if ( flags.haveEncounteredRawType() )
@@ -1133,14 +1141,14 @@
break;
- case Token.t_class:
- case Token.t_struct:
- case Token.t_union:
+ case IToken.t_class:
+ case IToken.t_struct:
+ case IToken.t_union:
if( !parm )
{
try
{
- classSpecifier(decl);
+ classSpecifier(decl, scope);
return;
}
catch( Backtrack bt )
@@ -1156,7 +1164,7 @@
flags.setEncounteredTypename(true);
break;
}
- case Token.t_enum:
+ case IToken.t_enum:
if( !parm )
{
try
@@ -1209,11 +1217,11 @@
* @return Last consumed token, or <code>previousLast</code> if nothing was consumed
* @throws Backtrack request a backtrack
*/
- private Token consumeTemplateParameters(Token previousLast) throws Backtrack {
- Token last = previousLast;
+ private IToken consumeTemplateParameters(IToken previousLast) throws Backtrack {
+ IToken last = previousLast;
- if (LT(1) == Token.tLT) {
- last = consume(Token.tLT);
+ if (LT(1) == IToken.tLT) {
+ last = consume(IToken.tLT);
// until we get all the names sorted out
int depth = 1;
@@ -1221,10 +1229,10 @@
while (depth > 0) {
last = consume();
switch (last.getType()) {
- case Token.tGT :
+ case IToken.tGT :
--depth;
break;
- case Token.tLT :
+ case IToken.tLT :
++depth;
break;
}
@@ -1239,8 +1247,8 @@
*
* @throws Backtrack request a backtrack
*/
- protected Token identifier() throws Backtrack {
- Token first = consume(Token.tIDENTIFIER); // throws backtrack if its not that
+ protected IToken identifier() throws Backtrack {
+ IToken first = consume(IToken.tIDENTIFIER); // throws backtrack if its not that
try
{
callback.nameBegin(first);
@@ -1256,18 +1264,18 @@
*
* @throws Backtrack
*/
- protected void className() throws Backtrack
+ protected TokenDuple className() throws Backtrack
{
- if( LT(1) == Token.tIDENTIFIER)
+ if( LT(1) == IToken.tIDENTIFIER)
{
- if( LT(2) == Token.tLT )
+ if( LT(2) == IToken.tLT )
{
- templateId();
+ return new TokenDuple( LA(1), templateId() );
}
else
{
- identifier();
- return;
+ IToken t = identifier();
+ return new TokenDuple(t, t);
}
}
else
@@ -1284,9 +1292,9 @@
*
* @throws Backtrack request a backtrack
*/
- protected Token templateId() throws Backtrack {
- Token first = consume( Token.tIDENTIFIER );
- Token last = consumeTemplateParameters(first);
+ protected IToken templateId() throws Backtrack {
+ IToken first = consume( IToken.tIDENTIFIER );
+ IToken last = consumeTemplateParameters(first);
callback.nameBegin( first );
callback.nameEnd( last );
@@ -1305,21 +1313,21 @@
* @throws Backtrack request a backtrack
*/
protected TokenDuple name() throws Backtrack {
- Token first = LA(1);
- Token last = null;
+ IToken first = LA(1);
+ IToken last = null;
- Token mark = mark();
+ IToken mark = mark();
try{ callback.nameBegin(first); } catch( Exception e ) {}
- if (LT(1) == Token.tCOLONCOLON)
+ if (LT(1) == IToken.tCOLONCOLON)
last = consume();
// TODO - whacky way to deal with destructors, please revisit
- if (LT(1) == Token.tCOMPL)
+ if (LT(1) == IToken.tCOMPL)
consume();
switch (LT(1)) {
- case Token.tIDENTIFIER:
+ case IToken.tIDENTIFIER:
last = consume();
last = consumeTemplateParameters(last);
break;
@@ -1328,20 +1336,20 @@
throw backtrack;
}
- while (LT(1) == Token.tCOLONCOLON) {
+ while (LT(1) == IToken.tCOLONCOLON) {
last = consume();
- if (LT(1) == Token.t_template )
+ if (LT(1) == IToken.t_template )
consume();
- if (LT(1) == Token.tCOMPL)
+ if (LT(1) == IToken.tCOMPL)
consume();
switch (LT(1)) {
- case Token.t_operator:
+ case IToken.t_operator:
backup( mark );
throw backtrack;
- case Token.tIDENTIFIER:
+ case IToken.tIDENTIFIER:
last = consume();
last = consumeTemplateParameters(last);
}
@@ -1366,8 +1374,8 @@
*/
protected Object cvQualifier( Object ptrOp ) throws Backtrack {
switch (LT(1)) {
- case Token.t_const:
- case Token.t_volatile:
+ case IToken.t_const:
+ case IToken.t_volatile:
try{ callback.pointerOperatorCVModifier( ptrOp, consume() ); } catch( Exception e ) {}
return ptrOp;
default:
@@ -1389,7 +1397,7 @@
// handle = initializerClause
- if (LT(1) == Token.tASSIGN) {
+ if (LT(1) == IToken.tASSIGN) {
consume();
// assignmentExpression || { initializerList , } || { }
@@ -1406,25 +1414,25 @@
try{ callback.expressionAbort( expression );} catch( Exception e ) {}
}
- if (LT(1) == Token.tLBRACE) {
+ if (LT(1) == IToken.tLBRACE) {
// for now, just consume to matching brace
consume();
int depth = 1;
while (depth > 0) {
switch (consume().getType()) {
- case Token.tRBRACE:
+ case IToken.tRBRACE:
--depth;
break;
- case Token.tLBRACE:
+ case IToken.tLBRACE:
++depth;
break;
}
}
}
}
- else if( LT(1) == Token.tLPAREN )
+ else if( LT(1) == IToken.tLPAREN )
{
- consume(Token.tLPAREN); // EAT IT!
+ consume(IToken.tLPAREN); // EAT IT!
Object expression = null;
try
@@ -1439,7 +1447,7 @@
try{ callback.expressionAbort( expression );} catch( Exception e ) {}
}
- if( LT(1) == Token.tRPAREN )
+ if( LT(1) == IToken.tRPAREN )
consume();
}
@@ -1484,37 +1492,37 @@
}
}
- if (LT(1) == Token.tLPAREN) {
+ if (LT(1) == IToken.tLPAREN) {
consume();
Object subDeclarator = declarator(declarator);
- consume(Token.tRPAREN);
+ consume(IToken.tRPAREN);
try{ callback.declaratorEnd( subDeclarator );} catch( Exception e ) {}
}
- else if( LT(1) == Token.t_operator )
+ else if( LT(1) == IToken.t_operator )
{
// we know this is an operator
- Token operatorToken = consume( Token.t_operator );
- Token toSend = null;
- if( LA(1).isOperator() || LT(1) == Token.tLPAREN || LT(1) == Token.tLBRACKET )
+ IToken operatorToken = consume( IToken.t_operator );
+ IToken toSend = null;
+ if( LA(1).isOperator() || LT(1) == IToken.tLPAREN || LT(1) == IToken.tLBRACKET )
{
- if( (LT(1) == Token.t_new || LT(1) == Token.t_delete ) &&
- LT(2) == Token.tLBRACKET && LT(3) == Token.tRBRACKET )
+ if( (LT(1) == IToken.t_new || LT(1) == IToken.t_delete ) &&
+ LT(2) == IToken.tLBRACKET && LT(3) == IToken.tRBRACKET )
{
consume();
- consume( Token.tLBRACKET );
- toSend = consume( Token.tRBRACKET );
+ consume( IToken.tLBRACKET );
+ toSend = consume( IToken.tRBRACKET );
// vector new and delete operators
}
- else if ( LT(1) == Token.tLPAREN && LT(2) == Token.tRPAREN )
+ else if ( LT(1) == IToken.tLPAREN && LT(2) == IToken.tRPAREN )
{
// operator ()
- consume( Token.tLPAREN );
- toSend = consume( Token.tRPAREN );
+ consume( IToken.tLPAREN );
+ toSend = consume( IToken.tRPAREN );
}
- else if ( LT(1) == Token.tLBRACKET && LT(2) == Token.tRBRACKET )
+ else if ( LT(1) == IToken.tLBRACKET && LT(2) == IToken.tRBRACKET )
{
- consume( Token.tLBRACKET );
- toSend = consume( Token.tRBRACKET );
+ consume( IToken.tLBRACKET );
+ toSend = consume( IToken.tRBRACKET );
}
else if( LA(1).isOperator() )
toSend = consume();
@@ -1554,40 +1562,40 @@
}
catch( Backtrack bt )
{
- if( LT(1) == Token.tCOLONCOLON || LT(1) == Token.tIDENTIFIER )
+ if( LT(1) == IToken.tCOLONCOLON || LT(1) == IToken.tIDENTIFIER )
{
- Token start = consume();
- Token end = null;
- if (start.type == Token.tIDENTIFIER) end = consumeTemplateParameters(end);
- while( LT(1) == Token.tCOLONCOLON || LT(1) == Token.tIDENTIFIER )
+ IToken start = consume();
+ IToken end = null;
+ if (start.getType() == IToken.tIDENTIFIER) end = consumeTemplateParameters(end);
+ while( LT(1) == IToken.tCOLONCOLON || LT(1) == IToken.tIDENTIFIER )
{
end = consume();
- if (end.type == Token.tIDENTIFIER) end = consumeTemplateParameters(end);
+ if (end.getType() == IToken.tIDENTIFIER) end = consumeTemplateParameters(end);
}
- if( LT(1) == Token.t_operator )
+ if( LT(1) == IToken.t_operator )
{
consume();
- if( LA(1).isOperator() || LT(1) == Token.tLPAREN || LT(1) == Token.tLBRACKET )
+ if( LA(1).isOperator() || LT(1) == IToken.tLPAREN || LT(1) == IToken.tLBRACKET )
{
- if( (LT(1) == Token.t_new || LT(1) == Token.t_delete ) &&
- LT(2) == Token.tLBRACKET && LT(3) == Token.tRBRACKET )
+ if( (LT(1) == IToken.t_new || LT(1) == IToken.t_delete ) &&
+ LT(2) == IToken.tLBRACKET && LT(3) == IToken.tRBRACKET )
{
consume();
- consume( Token.tLBRACKET );
- end = consume( Token.tRBRACKET );
+ consume( IToken.tLBRACKET );
+ end = consume( IToken.tRBRACKET );
// vector new and delete operators
}
- else if ( LT(1) == Token.tLPAREN && LT(2) == Token.tRPAREN )
+ else if ( LT(1) == IToken.tLPAREN && LT(2) == IToken.tRPAREN )
{
// operator ()
- consume( Token.tLPAREN );
- end = consume( Token.tRPAREN );
+ consume( IToken.tLPAREN );
+ end = consume( IToken.tRPAREN );
}
- else if ( LT(1) == Token.tLBRACKET && LT(2) == Token.tRBRACKET )
+ else if ( LT(1) == IToken.tLBRACKET && LT(2) == IToken.tRBRACKET )
{
- consume( Token.tLBRACKET );
- end = consume( Token.tRBRACKET );
+ consume( IToken.tLBRACKET );
+ end = consume( IToken.tRBRACKET );
}
else if( LA(1).isOperator() )
end = consume();
@@ -1630,7 +1638,7 @@
for (;;) {
switch (LT(1)) {
- case Token.tLPAREN:
+ case IToken.tLPAREN:
// temporary fix for initializer/function declaration ambiguity
if( ! LA(2).looksLikeExpression() )
{
@@ -1642,13 +1650,13 @@
parameterDeclarationLoop:
for (;;) {
switch (LT(1)) {
- case Token.tRPAREN:
+ case IToken.tRPAREN:
consume();
break parameterDeclarationLoop;
- case Token.tELIPSE:
+ case IToken.tELIPSE:
consume();
break;
- case Token.tCOMMA:
+ case IToken.tCOMMA:
consume();
seenParameter = false;
break;
@@ -1661,39 +1669,39 @@
}
try{ callback.argumentsEnd(clause);} catch( Exception e ) {}
- if( LT(1) == Token.tCOLON )
+ if( LT(1) == IToken.tCOLON )
{
// this is most likely the definition of the constructor
return declarator;
}
// const-volatile marker on the method
- if( LT(1) == Token.t_const || LT(1) == Token.t_volatile )
+ if( LT(1) == IToken.t_const || LT(1) == IToken.t_volatile )
{
try{ callback.declaratorCVModifier( declarator, consume() );} catch( Exception e ) {}
}
//check for throws clause here
- if( LT(1) == Token.t_throw )
+ if( LT(1) == IToken.t_throw )
{
try{ callback.declaratorThrowsException( declarator );} catch( Exception e ) {}
consume(); // throw
- consume( Token.tLPAREN );// (
+ consume( IToken.tLPAREN );// (
boolean done = false;
while( ! done )
{
switch( LT(1) )
{
- case Token.tRPAREN:
+ case IToken.tRPAREN:
consume();
done = true;
break;
- case Token.tIDENTIFIER:
+ case IToken.tIDENTIFIER:
//TODO this is not exactly right - should be type-id rather than just a name
name();
try{ callback.declaratorThrowExceptionName( declarator );} catch( Exception e ) {}
break;
- case Token.tCOMMA:
+ case IToken.tCOMMA:
consume();
break;
default:
@@ -1705,34 +1713,34 @@
}
// check for optional pure virtual
- if( LT(1) == Token.tASSIGN && LT(2) == Token.tINTEGER && LA(2).getImage().equals( "0") )
+ if( LT(1) == IToken.tASSIGN && LT(2) == IToken.tINTEGER && LA(2).getImage().equals( "0") )
{
- consume( Token.tASSIGN);
- consume( Token.tINTEGER);
+ consume( IToken.tASSIGN);
+ consume( IToken.tINTEGER);
try{ callback.declaratorPureVirtual( declarator ); } catch( Exception e ) { }
}
}
break;
- case Token.tLBRACKET:
- while( LT(1) == Token.tLBRACKET )
+ case IToken.tLBRACKET:
+ while( LT(1) == IToken.tLBRACKET )
{
consume(); // eat the '['
Object array = null;
try{ array = callback.arrayDeclaratorBegin( declarator ); } catch( Exception e ) {}
- if( LT(1) != Token.tRBRACKET )
+ if( LT(1) != IToken.tRBRACKET )
{
Object expression = null;
try{ expression = callback.expressionBegin( array );} catch( Exception e ) {}
constantExpression(expression);
try{ callback.expressionEnd( expression ); } catch( Exception e ) {}
}
- consume(Token.tRBRACKET);
+ consume(IToken.tRBRACKET);
try{ callback.arrayDeclaratorEnd( array );} catch( Exception e ) {}
}
continue;
- case Token.tCOLON:
- consume( Token.tCOLON );
+ case IToken.tCOLON:
+ consume( IToken.tCOLON );
Object bitfield = null;
try{ bitfield = callback.startBitfield( declarator );} catch( Exception e ) {}
Object expression = null;
@@ -1747,7 +1755,7 @@
break;
}
- if( LA(1).getType() == Token.tIDENTIFIER )
+ if( LA(1).getType() == IToken.tIDENTIFIER )
{
try{ callback.declaratorAbort( declarator ); } catch( Exception e ) {}
declarator = null;
@@ -1774,22 +1782,22 @@
Object ptrOp = null;
try{ ptrOp = callback.pointerOperatorBegin( owner );} catch( Exception e ) {}
- if (t == Token.tAMPER) {
- try{ callback.pointerOperatorType( ptrOp, consume(Token.tAMPER) ); } catch( Exception e ) {}
+ if (t == IToken.tAMPER) {
+ try{ callback.pointerOperatorType( ptrOp, consume(IToken.tAMPER) ); } catch( Exception e ) {}
try{ callback.pointerOperatorEnd( ptrOp );} catch( Exception e ) {}
return;
}
- Token mark = mark();
+ IToken mark = mark();
boolean hasName = false;
- if (t == Token.tIDENTIFIER || t == Token.tCOLONCOLON)
+ if (t == IToken.tIDENTIFIER || t == IToken.tCOLONCOLON)
{
name();
hasName = true;
}
- if (t == Token.tSTAR) {
+ if (t == IToken.tSTAR) {
if( hasName )
try{ callback.pointerOperatorName( ptrOp );} catch( Exception e ) {}
@@ -1833,23 +1841,23 @@
protected void enumSpecifier( Object owner ) throws Backtrack
{
Object enumSpecifier = null;
- Token mark = mark();
- try{ enumSpecifier = callback.enumSpecifierBegin( owner, consume( Token.t_enum ) );} catch( Exception e ) {}
+ IToken mark = mark();
+ try{ enumSpecifier = callback.enumSpecifierBegin( owner, consume( IToken.t_enum ) );} catch( Exception e ) {}
- if( LT(1) == Token.tIDENTIFIER )
+ if( LT(1) == IToken.tIDENTIFIER )
{
identifier();
try{ callback.enumSpecifierId( enumSpecifier );} catch( Exception e ) {}
}
- if( LT(1) == Token.tLBRACE )
+ if( LT(1) == IToken.tLBRACE )
{
- consume( Token.tLBRACE );
+ consume( IToken.tLBRACE );
- while( LT(1) != Token.tRBRACE )
+ while( LT(1) != IToken.tRBRACE )
{
Object defn;
- if( LT(1) == Token.tIDENTIFIER )
+ if( LT(1) == IToken.tIDENTIFIER )
{
defn = null;
try{ defn = callback.enumeratorBegin( enumSpecifier );} catch( Exception e ) {}
@@ -1862,9 +1870,9 @@
throw backtrack;
}
- if( LT(1) == Token.tASSIGN )
+ if( LT(1) == IToken.tASSIGN )
{
- consume( Token.tASSIGN );
+ consume( IToken.tASSIGN );
Object expression = null;
try{ expression = callback.expressionBegin( defn );} catch( Exception e ) {}
constantExpression( expression );
@@ -1873,18 +1881,18 @@
try{ callback.enumeratorEnd( defn, lastToken );} catch( Exception e ) {}
- if( LT(1) == Token.tRBRACE )
+ if( LT(1) == IToken.tRBRACE )
break;
- if( LT(1) != Token.tCOMMA )
+ if( LT(1) != IToken.tCOMMA )
{
try{ callback.enumSpecifierAbort( enumSpecifier );} catch( Exception e ) {}
throw backtrack;
}
- consume(Token.tCOMMA);
+ consume(IToken.tCOMMA);
}
- try{ callback.enumSpecifierEnd( enumSpecifier, consume( Token.tRBRACE ) );} catch( Exception e ) {}
+ try{ callback.enumSpecifierEnd( enumSpecifier, consume( IToken.tRBRACE ) );} catch( Exception e ) {}
}
else
{
@@ -1904,16 +1912,28 @@
* @param owner IParserCallback object that represents the declaration that owns this classSpecifier
* @throws Backtrack request a backtrack
*/
- protected void classSpecifier( Object owner ) throws Backtrack {
- Token classKey = null;
+ protected void classSpecifier( Object owner, IASTScope scope ) throws Backtrack {
+ ClassNameType nameType = ClassNameType.t_identifier;
+ ClassKind classKind = null;
+ AccessVisibility access = AccessVisibility.v_public;
+
+ IToken classKey = null;
- Token mark = mark();
+ IToken mark = mark();
// class key
switch (LT(1)) {
- case Token.t_class:
- case Token.t_struct:
- case Token.t_union:
+ case IToken.t_class:
classKey = consume();
+ classKind = ClassKind.k_class;
+ access = AccessVisibility.v_private;
+ break;
+ case IToken.t_struct:
+ classKey = consume();
+ classKind = ClassKind.k_struct;
+ break;
+ case IToken.t_union:
+ classKey = consume();
+ classKind = ClassKind.k_union;
break;
default:
throw backtrack;
@@ -1922,13 +1942,17 @@
Object classSpec = null;
try{ classSpec = callback.classSpecifierBegin( owner, classKey);} catch( Exception e ){}
+ TokenDuple duple = null;
// class name
- if (LT(1) == Token.tIDENTIFIER) {
- className();
+ if (LT(1) == IToken.tIDENTIFIER) {
+ duple = className();
try{ callback.classSpecifierName(classSpec);} catch( Exception e ){}
}
- if( LT(1) != Token.tCOLON && LT(1) != Token.tLBRACE )
+ if( duple != null && !duple.isIdentifier() )
+ nameType = ClassNameType.t_template;
+
+ if( LT(1) != IToken.tCOLON && LT(1) != IToken.tLBRACE )
{
// this is not a classSpecification
try{ callback.classSpecifierAbort( classSpec );} catch( Exception e ){}
@@ -1937,27 +1961,39 @@
throw backtrack;
}
+ IASTClassSpecifier astClassSpecifier = astFactory.createClassSpecifier(
+ scope,
+ duple == null ? "" : duple.toString(),
+ classKind,
+ nameType,
+ access,
+ null, //TODO add TemplateDeclaration here
+ classKey.getOffset(),
+ duple == null ? 0 : duple.getFirstToken().getOffset() );
+
// base clause
- if (LT(1) == Token.tCOLON) {
- baseSpecifier( classSpec );
+ if (LT(1) == IToken.tCOLON) {
+ baseSpecifier( classSpec, astClassSpecifier );
}
- if (LT(1) == Token.tLBRACE) {
- consume(Token.tLBRACE);
+ if (LT(1) == IToken.tLBRACE) {
+ consume(IToken.tLBRACE);
+
+ requestor.enterClassSpecifier( astClassSpecifier );
memberDeclarationLoop:
- while (LT(1) != Token.tRBRACE) {
- Token checkToken = LA(1);
+ while (LT(1) != IToken.tRBRACE) {
+ IToken checkToken = LA(1);
switch (LT(1)) {
- case Token.t_public:
- case Token.t_protected:
- case Token.t_private:
+ case IToken.t_public:
+ case IToken.t_protected:
+ case IToken.t_private:
try{ callback.classMemberVisibility( classSpec, consume() );} catch( Exception e ){}
- consume(Token.tCOLON);
+ consume(IToken.tCOLON);
break;
- case Token.tRBRACE:
- consume(Token.tRBRACE);
+ case IToken.tRBRACE:
+ consume(IToken.tRBRACE);
break memberDeclarationLoop;
default:
try
@@ -1974,8 +2010,13 @@
if (checkToken == LA(1))
errorHandling();
}
+
+
// consume the }
- try{ callback.classSpecifierEnd(classSpec, consume( Token.tRBRACE )); } catch( Exception e ) {}
+ IToken lastToken = consume( IToken.tRBRACE );
+ try{ callback.classSpecifierEnd(classSpec, lastToken); } catch( Exception e ) {}
+ astClassSpecifier.setEndingOffset( lastToken.getEndOffset() );
+ requestor.exitClassSpecifier(astClassSpecifier);
}
@@ -1994,31 +2035,46 @@
* @param classSpecOwner
* @throws Backtrack
*/
- protected void baseSpecifier( Object classSpecOwner ) throws Backtrack {
- consume( Token.tCOLON );
+ protected void baseSpecifier( Object classSpecOwner, IASTClassSpecifier astClassSpec ) throws Backtrack {
+ consume( IToken.tCOLON );
Object baseSpecifier = null;
try { baseSpecifier = callback.baseSpecifierBegin( classSpecOwner ); } catch( Exception e ) {}
+ boolean isVirtual = false;
+ AccessVisibility visibility = AccessVisibility.v_public;
+ TokenDuple nameDuple = null;
baseSpecifierLoop:
for (;;) {
switch (LT(1)) {
- case Token.t_virtual:
- consume(Token.t_virtual);
+ case IToken.t_virtual:
+ consume(IToken.t_virtual);
+ isVirtual = true;
try{ callback.baseSpecifierVirtual( baseSpecifier, true ); } catch( Exception e ){}
break;
- case Token.t_public:
- case Token.t_protected:
- case Token.t_private:
+ case IToken.t_public:
try { callback.baseSpecifierVisibility( baseSpecifier, consume() );} catch( Exception e ){}
break;
- case Token.tCOLONCOLON:
- case Token.tIDENTIFIER:
- name();
+ case IToken.t_protected:
+ try { callback.baseSpecifierVisibility( baseSpecifier, consume() );} catch( Exception e ){}
+ visibility = AccessVisibility.v_protected;
+ break;
+ case IToken.t_private:
+ visibility = AccessVisibility.v_private;
+ try { callback.baseSpecifierVisibility( baseSpecifier, consume() );} catch( Exception e ){}
+ break;
+ case IToken.tCOLONCOLON:
+ case IToken.tIDENTIFIER:
+ nameDuple = name();
try { callback.baseSpecifierName( baseSpecifier ); } catch( Exception e ){}
break;
- case Token.tCOMMA:
+ case IToken.tCOMMA:
try {
+ astFactory.addBaseSpecifier( astClassSpec, isVirtual, visibility, nameDuple.toString() );
+ isVirtual = false;
+ visibility = AccessVisibility.v_public;
+ nameDuple = null;
+
callback.baseSpecifierEnd( baseSpecifier );
baseSpecifier = callback.baseSpecifierBegin( classSpecOwner );
} catch( Exception e ){}
@@ -2029,6 +2085,7 @@
}
}
try { callback.baseSpecifierEnd( baseSpecifier ); } catch( Exception e ){}
+ astFactory.addBaseSpecifier( astClassSpec, isVirtual, visibility, nameDuple.toString() );
}
/**
@@ -2049,115 +2106,115 @@
protected void statement() throws Backtrack {
Object expression = null;
switch (LT(1)) {
- case Token.t_case:
+ case IToken.t_case:
consume();
// TODO regarding this null
try{ expression = callback.expressionBegin( null ); } catch( Exception e ) {}
constantExpression(expression);
try{ callback.expressionEnd( expression ); } catch( Exception e ) {}
- consume(Token.tCOLON);
+ consume(IToken.tCOLON);
statement();
return;
- case Token.t_default:
+ case IToken.t_default:
consume();
- consume(Token.tCOLON);
+ consume(IToken.tCOLON);
statement();
return;
- case Token.tLBRACE:
+ case IToken.tLBRACE:
compoundStatement();
return;
- case Token.t_if:
+ case IToken.t_if:
consume();
- consume(Token.tLPAREN);
+ consume(IToken.tLPAREN);
condition();
- consume(Token.tRPAREN);
+ consume(IToken.tRPAREN);
statement();
- if (LT(1) == Token.t_else) {
+ if (LT(1) == IToken.t_else) {
consume();
statement();
}
return;
- case Token.t_switch:
+ case IToken.t_switch:
consume();
- consume(Token.tLPAREN);
+ consume(IToken.tLPAREN);
condition();
- consume(Token.tRPAREN);
+ consume(IToken.tRPAREN);
statement();
return;
- case Token.t_while:
+ case IToken.t_while:
consume();
- consume(Token.tLPAREN);
+ consume(IToken.tLPAREN);
condition();
- consume(Token.tRPAREN);
+ consume(IToken.tRPAREN);
statement();
return;
- case Token.t_do:
+ case IToken.t_do:
consume();
statement();
- consume(Token.t_while);
- consume(Token.tLPAREN);
+ consume(IToken.t_while);
+ consume(IToken.tLPAREN);
condition();
- consume(Token.tRPAREN);
+ consume(IToken.tRPAREN);
return;
- case Token.t_for:
+ case IToken.t_for:
consume();
- consume(Token.tLPAREN);
+ consume(IToken.tLPAREN);
forInitStatement();
- if (LT(1) != Token.tSEMI)
+ if (LT(1) != IToken.tSEMI)
condition();
- consume(Token.tSEMI);
- if (LT(1) != Token.tRPAREN)
+ consume(IToken.tSEMI);
+ if (LT(1) != IToken.tRPAREN)
{
try{ expression = callback.expressionBegin( null ); } catch( Exception e ) {}
//TODO get rid of NULL
expression(expression);
try{ callback.expressionEnd( expression );} catch( Exception e ) {}
}
- consume(Token.tRPAREN);
+ consume(IToken.tRPAREN);
statement();
return;
- case Token.t_break:
+ case IToken.t_break:
consume();
- consume(Token.tSEMI);
+ consume(IToken.tSEMI);
return;
- case Token.t_continue:
+ case IToken.t_continue:
consume();
- consume(Token.tSEMI);
+ consume(IToken.tSEMI);
return;
- case Token.t_return:
+ case IToken.t_return:
consume();
- if (LT(1) != Token.tSEMI)
+ if (LT(1) != IToken.tSEMI)
{
try{ expression = callback.expressionBegin( null );} catch( Exception e ) {}
//TODO get rid of NULL
expression(expression);
try{ callback.expressionEnd( expression );} catch( Exception e ) {}
}
- consume(Token.tSEMI);
+ consume(IToken.tSEMI);
return;
- case Token.t_goto:
+ case IToken.t_goto:
consume();
- consume(Token.tIDENTIFIER);
- consume(Token.tSEMI);
+ consume(IToken.tIDENTIFIER);
+ consume(IToken.tSEMI);
return;
- case Token.t_try:
+ case IToken.t_try:
consume();
compoundStatement();
- while (LT(1) == Token.t_catch) {
+ while (LT(1) == IToken.t_catch) {
consume();
- consume(Token.tLPAREN);
+ consume(IToken.tLPAREN);
declaration(null); // was exceptionDeclaration
- consume(Token.tRPAREN);
+ consume(IToken.tRPAREN);
compoundStatement();
}
return;
- case Token.tSEMI:
+ case IToken.tSEMI:
consume();
return;
default:
// can be many things:
// label
- if (LT(1) == Token.tIDENTIFIER && LT(2) == Token.tCOLON) {
+ if (LT(1) == IToken.tIDENTIFIER && LT(2) == IToken.tCOLON) {
consume();
consume();
statement();
@@ -2172,7 +2229,7 @@
//TODO get rid of NULL
expression(expression);
try{ callback.expressionEnd( expression );} catch( Exception e ) {}
- consume(Token.tSEMI);
+ consume(IToken.tSEMI);
return;
} catch (Backtrack b) {
}
@@ -2200,8 +2257,8 @@
* @throws Backtrack
*/
protected void compoundStatement() throws Backtrack {
- consume(Token.tLBRACE);
- while (LT(1) != Token.tRBRACE)
+ consume(IToken.tLBRACE);
+ while (LT(1) != IToken.tRBRACE)
statement();
consume();
}
@@ -2220,8 +2277,8 @@
public void expression( Object expression ) throws Backtrack {
assignmentExpression( expression );
- while (LT(1) == Token.tCOMMA) {
- Token t = consume();
+ while (LT(1) == IToken.tCOMMA) {
+ IToken t = consume();
assignmentExpression( expression );
try{ callback.expressionOperator(expression, t);} catch( Exception e ) {}
}
@@ -2232,7 +2289,7 @@
* @throws Backtrack
*/
protected void assignmentExpression( Object expression ) throws Backtrack {
- if (LT(1) == Token.t_throw) {
+ if (LT(1) == IToken.t_throw) {
throwExpression(expression);
return;
}
@@ -2240,18 +2297,18 @@
// if the condition not taken, try assignment operators
if (!conditionalExpression(expression)) {
switch (LT(1)) {
- case Token.tASSIGN:
- case Token.tSTARASSIGN:
- case Token.tDIVASSIGN:
- case Token.tMODASSIGN:
- case Token.tPLUSASSIGN:
- case Token.tMINUSASSIGN:
- case Token.tSHIFTRASSIGN:
- case Token.tSHIFTLASSIGN:
- case Token.tAMPERASSIGN:
- case Token.tXORASSIGN:
- case Token.tBITORASSIGN:
- Token t = consume();
+ case IToken.tASSIGN:
+ case IToken.tSTARASSIGN:
+ case IToken.tDIVASSIGN:
+ case IToken.tMODASSIGN:
+ case IToken.tPLUSASSIGN:
+ case IToken.tMINUSASSIGN:
+ case IToken.tSHIFTRASSIGN:
+ case IToken.tSHIFTLASSIGN:
+ case IToken.tAMPERASSIGN:
+ case IToken.tXORASSIGN:
+ case IToken.tBITORASSIGN:
+ IToken t = consume();
conditionalExpression(expression);
try { callback.expressionOperator(expression, t); } catch( Exception e ) {}
break;
@@ -2264,7 +2321,7 @@
* @throws Backtrack
*/
protected void throwExpression( Object expression ) throws Backtrack {
- consume(Token.t_throw);
+ consume(IToken.t_throw);
try {
expression(expression);
@@ -2280,10 +2337,10 @@
protected boolean conditionalExpression( Object expression ) throws Backtrack {
logicalOrExpression( expression );
- if (LT(1) == Token.tQUESTION) {
+ if (LT(1) == IToken.tQUESTION) {
consume();
expression(expression);
- consume(Token.tCOLON);
+ consume(IToken.tCOLON);
assignmentExpression(expression);
return true;
} else
@@ -2297,8 +2354,8 @@
protected void logicalOrExpression( Object expression ) throws Backtrack {
logicalAndExpression( expression );
- while (LT(1) == Token.tOR) {
- Token t = consume();
+ while (LT(1) == IToken.tOR) {
+ IToken t = consume();
logicalAndExpression( expression );
try{ callback.expressionOperator(expression, t);} catch( Exception e ) {}
}
@@ -2311,8 +2368,8 @@
protected void logicalAndExpression( Object expression ) throws Backtrack {
inclusiveOrExpression( expression );
- while (LT(1) == Token.tAND) {
- Token t = consume();
+ while (LT(1) == IToken.tAND) {
+ IToken t = consume();
inclusiveOrExpression(expression );
try{ callback.expressionOperator(expression, t);} catch( Exception e ) {}
}
@@ -2325,8 +2382,8 @@
protected void inclusiveOrExpression( Object expression ) throws Backtrack {
exclusiveOrExpression(expression);
- while (LT(1) == Token.tBITOR) {
- Token t = consume();
+ while (LT(1) == IToken.tBITOR) {
+ IToken t = consume();
exclusiveOrExpression(expression);
try{ callback.expressionOperator(expression, t);} catch( Exception e ) {}
}
@@ -2339,8 +2396,8 @@
protected void exclusiveOrExpression( Object expression ) throws Backtrack {
andExpression( expression );
- while (LT(1) == Token.tXOR) {
- Token t = consume();
+ while (LT(1) == IToken.tXOR) {
+ IToken t = consume();
andExpression(expression);
try { callback.expressionOperator(expression, t);} catch( Exception e ) {}
@@ -2354,8 +2411,8 @@
protected void andExpression( Object expression ) throws Backtrack {
equalityExpression(expression);
- while (LT(1) == Token.tAMPER) {
- Token t = consume();
+ while (LT(1) == IToken.tAMPER) {
+ IToken t = consume();
equalityExpression(expression);
try{ callback.expressionOperator(expression, t); } catch( Exception e ) {}
@@ -2372,9 +2429,9 @@
for (;;) {
switch (LT(1)) {
- case Token.tEQUAL:
- case Token.tNOTEQUAL:
- Token t = consume();
+ case IToken.tEQUAL:
+ case IToken.tNOTEQUAL:
+ IToken t = consume();
relationalExpression(expression);
try{ callback.expressionOperator(expression, t);} catch( Exception e ) {}
break;
@@ -2393,16 +2450,16 @@
for (;;) {
switch (LT(1)) {
- case Token.tGT:
+ case IToken.tGT:
// For template args, the GT means end of args
//if (templateArgs)
// return;
- case Token.tLT:
- case Token.tLTEQUAL:
- case Token.tGTEQUAL:
- Token mark = mark();
- Token t = consume();
- Token next = LA(1);
+ case IToken.tLT:
+ case IToken.tLTEQUAL:
+ case IToken.tGTEQUAL:
+ IToken mark = mark();
+ IToken t = consume();
+ IToken next = LA(1);
shiftExpression(expression);
if( next == LA(1) )
{
@@ -2432,9 +2489,9 @@
for (;;) {
switch (LT(1)) {
- case Token.tSHIFTL:
- case Token.tSHIFTR:
- Token t = consume();
+ case IToken.tSHIFTL:
+ case IToken.tSHIFTR:
+ IToken t = consume();
additiveExpression(expression);
try{ callback.expressionOperator(expression, t);} catch( Exception e ) {}
break;
@@ -2453,9 +2510,9 @@
for (;;) {
switch (LT(1)) {
- case Token.tPLUS:
- case Token.tMINUS:
- Token t = consume();
+ case IToken.tPLUS:
+ case IToken.tMINUS:
+ IToken t = consume();
multiplicativeExpression(expression);
try { callback.expressionOperator(expression, t); } catch( Exception e ) {}
break;
@@ -2474,10 +2531,10 @@
for (;;) {
switch (LT(1)) {
- case Token.tSTAR:
- case Token.tDIV:
- case Token.tMOD:
- Token t = consume();
+ case IToken.tSTAR:
+ case IToken.tDIV:
+ case IToken.tMOD:
+ IToken t = consume();
pmExpression(expression );
try{ callback.expressionOperator(expression , t);} catch( Exception e ) {}
break;
@@ -2496,9 +2553,9 @@
for (;;) {
switch (LT(1)) {
- case Token.tDOTSTAR:
- case Token.tARROWSTAR:
- Token t = consume();
+ case IToken.tDOTSTAR:
+ case IToken.tARROWSTAR:
+ IToken t = consume();
castExpression( expression );
try{ callback.expressionOperator(expression, t);} catch( Exception e ) {}
break;
@@ -2515,20 +2572,20 @@
*/
protected void castExpression( Object expression ) throws Backtrack {
// TO DO: we need proper symbol checkint to ensure type name
- if (LT(1) == Token.tLPAREN) {
- Token mark = mark();
+ if (LT(1) == IToken.tLPAREN) {
+ IToken mark = mark();
consume();
// If this isn't a type name, then we shouldn't be here
try {
- if( LT(1) == Token.t_const ) consume();
+ if( LT(1) == IToken.t_const ) consume();
typeId();
- while( LT(1) == Token.tSTAR )
+ while( LT(1) == IToken.tSTAR )
{
- consume( Token.tSTAR );
- if( LT(1) == Token.t_const || LT(1) == Token.t_volatile ) consume();
+ consume( IToken.tSTAR );
+ if( LT(1) == IToken.t_const || LT(1) == IToken.t_volatile ) consume();
}
- consume(Token.tRPAREN);
+ consume(IToken.tRPAREN);
castExpression( expression );
return;
} catch (Backtrack b) {
@@ -2547,33 +2604,33 @@
name();
return;
} catch (Backtrack b) {
- Token begin = LA(1);
- Token end = null;
+ IToken begin = LA(1);
+ IToken end = null;
simpleMods:
for( ; ; )
{
switch( LT(1) )
{
- case Token.t_short:
- case Token.t_unsigned:
- case Token.t_long:
- case Token.t_const:
+ case IToken.t_short:
+ case IToken.t_unsigned:
+ case IToken.t_long:
+ case IToken.t_const:
end = consume();
break;
- case Token.tAMPER:
- case Token.tSTAR:
- case Token.tIDENTIFIER:
+ case IToken.tAMPER:
+ case IToken.tSTAR:
+ case IToken.tIDENTIFIER:
if( end == null )
throw backtrack;
end = consume();
break;
- case Token.t_int:
- case Token.t_char:
- case Token.t_bool:
- case Token.t_double:
- case Token.t_float:
- case Token.t_wchar_t:
- case Token.t_void:
+ case IToken.t_int:
+ case IToken.t_char:
+ case IToken.t_bool:
+ case IToken.t_double:
+ case IToken.t_float:
+ case IToken.t_wchar_t:
+ case IToken.t_void:
end = consume();
default:
break simpleMods;
@@ -2587,9 +2644,9 @@
callback.nameEnd( end );
} catch( Exception e ) {}
}
- else if( LT(1) == Token.t_typename )
+ else if( LT(1) == IToken.t_typename )
{
- consume( Token.t_typename );
+ consume( IToken.t_typename );
name();
}
else
@@ -2602,17 +2659,17 @@
* @throws Backtrack
*/
protected void deleteExpression( Object expression ) throws Backtrack {
- if (LT(1) == Token.tCOLONCOLON) {
+ if (LT(1) == IToken.tCOLONCOLON) {
// global scope
consume();
}
- consume(Token.t_delete);
+ consume(IToken.t_delete);
- if (LT(1) == Token.tLBRACKET) {
+ if (LT(1) == IToken.tLBRACKET) {
// array delete
consume();
- consume(Token.tRBRACKET);
+ consume(IToken.tRBRACKET);
}
castExpression( expression );
@@ -2635,34 +2692,34 @@
* newinitializer: ( expressionlist? )
*/
protected void newExpression( Object expression ) throws Backtrack {
- if (LT(1) == Token.tCOLONCOLON) {
+ if (LT(1) == IToken.tCOLONCOLON) {
// global scope
consume();
}
- consume (Token.t_new);
+ consume (IToken.t_new);
boolean typeIdInParen = false;
boolean placementParseFailure = true;
- Token beforeSecondParen = null;
- Token backtrackMarker = null;
+ IToken beforeSecondParen = null;
+ IToken backtrackMarker = null;
- if( LT(1) == Token.tLPAREN )
+ if( LT(1) == IToken.tLPAREN )
{
- consume( Token.tLPAREN );
+ consume( IToken.tLPAREN );
try {
// Try to consume placement list
// Note: since expressionList and expression are the same...
backtrackMarker = mark();
expression(expression);
- consume( Token.tRPAREN );
+ consume( IToken.tRPAREN );
placementParseFailure = false;
- if( LT(1) == Token.tLPAREN ) {
+ if( LT(1) == IToken.tLPAREN ) {
beforeSecondParen = mark();
- consume( Token.tLPAREN );
+ consume( IToken.tLPAREN );
typeIdInParen = true;
}
} catch (Backtrack e) {
@@ -2674,10 +2731,10 @@
// the first expression in () is not a placement
// - then it has to be typeId
typeId();
- consume(Token.tRPAREN);
+ consume(IToken.tRPAREN);
} else {
if (!typeIdInParen) {
- if (LT(1) == Token.tLBRACKET) {
+ if (LT(1) == IToken.tLBRACKET) {
// CASE: new (typeid-looking-as-placement) [expr]...
// the first expression in () has been parsed as a placement;
// however, we assume that it was in fact typeId, and this
@@ -2701,9 +2758,9 @@
// The problem is, the first expression might as well be a typeid
try {
typeId();
- consume(Token.tRPAREN);
+ consume(IToken.tRPAREN);
- if (LT(1) == Token.tLPAREN || LT(1) == Token.tLBRACKET) {
+ if (LT(1) == IToken.tLPAREN || LT(1) == IToken.tLBRACKET) {
// CASE: new (placement)(typeid)(initializer)
// CASE: new (placement)(typeid)[] ...
// Great, so far all our assumptions have been correct
@@ -2730,20 +2787,20 @@
typeId();
}
- while (LT(1) == Token.tLBRACKET) {
+ while (LT(1) == IToken.tLBRACKET) {
// array new
consume();
assignmentExpression(expression);
- consume(Token.tRBRACKET);
+ consume(IToken.tRBRACKET);
}
// newinitializer
- if( LT(1) == Token.tLPAREN )
+ if( LT(1) == IToken.tLPAREN )
{
- consume( Token.tLPAREN );
- if( LT(1) != Token.tRPAREN )
+ consume( IToken.tLPAREN );
+ if( LT(1) != IToken.tRPAREN )
expression( expression );
- consume( Token.tRPAREN );
+ consume( IToken.tRPAREN );
}
}
@@ -2754,27 +2811,27 @@
*/
protected void unaryExpression( Object expression ) throws Backtrack {
switch (LT(1)) {
- case Token.tSTAR:
- case Token.tAMPER:
- case Token.tPLUS:
- case Token.tMINUS:
- case Token.tNOT:
- case Token.tCOMPL:
- case Token.tINCR:
- case Token.tDECR:
- Token t = consume();
+ case IToken.tSTAR:
+ case IToken.tAMPER:
+ case IToken.tPLUS:
+ case IToken.tMINUS:
+ case IToken.tNOT:
+ case IToken.tCOMPL:
+ case IToken.tINCR:
+ case IToken.tDECR:
+ IToken t = consume();
castExpression(expression);
try{ callback.expressionOperator(expression, t);} catch( Exception e ) {}
return;
- case Token.t_sizeof:
- consume(Token.t_sizeof);
- Token mark = LA(1);
- if (LT(1) == Token.tLPAREN) {
+ case IToken.t_sizeof:
+ consume(IToken.t_sizeof);
+ IToken mark = LA(1);
+ if (LT(1) == IToken.tLPAREN) {
try
{
- consume( Token.tLPAREN );
+ consume( IToken.tLPAREN );
typeId();
- consume(Token.tRPAREN);
+ consume(IToken.tRPAREN);
}
catch( Backtrack bt )
{
@@ -2785,18 +2842,18 @@
unaryExpression( expression );
}
return;
- case Token.t_new:
+ case IToken.t_new:
newExpression( expression );
return;
- case Token.t_delete:
+ case IToken.t_delete:
deleteExpression( expression );
return;
- case Token.tCOLONCOLON:
+ case IToken.tCOLONCOLON:
switch (LT(2)) {
- case Token.t_new:
+ case IToken.t_new:
newExpression(expression);
return;
- case Token.t_delete:
+ case IToken.t_delete:
deleteExpression(expression);
return;
default:
@@ -2815,54 +2872,54 @@
*/
protected void postfixExpression( Object expression) throws Backtrack {
switch (LT(1)) {
- case Token.t_typename:
+ case IToken.t_typename:
consume();
// TO DO: this
break;
// simple-type-specifier ( assignment-expression , .. )
- case Token.t_char:
- case Token.t_wchar_t:
- case Token.t_bool:
- case Token.t_short:
- case Token.t_int:
- case Token.t_long:
- case Token.t_signed:
- case Token.t_unsigned:
- case Token.t_float:
- case Token.t_double:
+ case IToken.t_char:
+ case IToken.t_wchar_t:
+ case IToken.t_bool:
+ case IToken.t_short:
+ case IToken.t_int:
+ case IToken.t_long:
+ case IToken.t_signed:
+ case IToken.t_unsigned:
+ case IToken.t_float:
+ case IToken.t_double:
consume();
- consume( Token.tLPAREN );
+ consume( IToken.tLPAREN );
while( true )
{
assignmentExpression( expression );
- if( LT(1) == Token.tRPAREN ) break;
- consume( Token.tCOMMA );
+ if( LT(1) == IToken.tRPAREN ) break;
+ consume( IToken.tCOMMA );
}
- consume( Token.tRPAREN );
+ consume( IToken.tRPAREN );
break;
- case Token.t_dynamic_cast:
- case Token.t_static_cast:
- case Token.t_reinterpret_cast:
- case Token.t_const_cast:
+ case IToken.t_dynamic_cast:
+ case IToken.t_static_cast:
+ case IToken.t_reinterpret_cast:
+ case IToken.t_const_cast:
consume();
- consume(Token.tLT);
+ consume(IToken.tLT);
typeId();
- consume(Token.tGT);
- consume(Token.tLPAREN);
+ consume(IToken.tGT);
+ consume(IToken.tLPAREN);
expression(expression);
- consume(Token.tRPAREN);
+ consume(IToken.tRPAREN);
break;
- case Token.t_typeid:
+ case IToken.t_typeid:
consume();
- consume(Token.tLPAREN);
+ consume(IToken.tLPAREN);
try {
typeId();
} catch (Backtrack b) {
expression(expression);
}
- consume(Token.tRPAREN);
+ consume(IToken.tRPAREN);
break;
default:
// TO DO: try simpleTypeSpecifier "(" expressionList ")"
@@ -2871,26 +2928,26 @@
for (;;) {
switch (LT(1)) {
- case Token.tLBRACKET:
+ case IToken.tLBRACKET:
// array access
consume();
expression(expression);
- consume(Token.tRBRACKET);
+ consume(IToken.tRBRACKET);
break;
- case Token.tLPAREN:
+ case IToken.tLPAREN:
// function call
consume();
// Note: since expressionList and expression are the same...
expression(expression);
- consume(Token.tRPAREN);
+ consume(IToken.tRPAREN);
break;
- case Token.tINCR:
- case Token.tDECR:
+ case IToken.tINCR:
+ case IToken.tDECR:
// post incr/decr
consume();
break;
- case Token.tDOT:
- case Token.tARROW:
+ case IToken.tDOT:
+ case IToken.tARROW:
// member access
consume();
primaryExpression(expression);
@@ -2909,27 +2966,27 @@
int type = LT(1);
switch (type) {
// TO DO: we need more literals...
- case Token.tINTEGER:
- case Token.tFLOATINGPT:
- case Token.tSTRING:
- case Token.tLSTRING:
- case Token.t_false:
- case Token.t_true:
- case Token.tCHAR:
+ case IToken.tINTEGER:
+ case IToken.tFLOATINGPT:
+ case IToken.tSTRING:
+ case IToken.tLSTRING:
+ case IToken.t_false:
+ case IToken.t_true:
+ case IToken.tCHAR:
try{ callback.expressionTerminal(expression, consume());} catch( Exception e ) {}
return;
- case Token.tIDENTIFIER:
+ case IToken.tIDENTIFIER:
name();
try{ callback.expressionName(expression);} catch( Exception e ) {}
return;
- case Token.t_this:
+ case IToken.t_this:
consume();
return;
- case Token.tLPAREN:
+ case IToken.tLPAREN:
consume();
expression(expression);
- consume(Token.tRPAREN);
+ consume(IToken.tRPAREN);
return;
default:
// TO DO: idExpression which yeilds a variable
@@ -2942,22 +2999,22 @@
* @throws Exception
*/
protected void varName() throws Exception {
- if (LT(1) == Token.tCOLONCOLON)
+ if (LT(1) == IToken.tCOLONCOLON)
consume();
for (;;) {
switch (LT(1)) {
- case Token.tIDENTIFIER:
+ case IToken.tIDENTIFIER:
consume();
//if (isTemplateArgs()) {
// rTemplateArgs();
//}
- if (LT(1) == Token.tCOLONCOLON) {
+ if (LT(1) == IToken.tCOLONCOLON) {
switch (LT(2)) {
- case Token.tIDENTIFIER:
- case Token.tCOMPL:
- case Token.t_operator:
+ case IToken.tIDENTIFIER:
+ case IToken.tCOMPL:
+ case IToken.t_operator:
consume();
break;
default:
@@ -2966,11 +3023,11 @@
} else
return;
break;
- case Token.tCOMPL:
+ case IToken.tCOMPL:
consume();
- consume(Token.tIDENTIFIER);
+ consume(IToken.tIDENTIFIER);
return;
- case Token.t_operator:
+ case IToken.t_operator:
consume();
//rOperatorName();
return;
@@ -3002,7 +3059,7 @@
// Token management
private IScanner scanner;
- private Token currToken, // current token we plan to consume next
+ private IToken currToken, // current token we plan to consume next
lastToken; // last token we consumed
/**
@@ -3011,7 +3068,7 @@
* @return the next token from the scanner
* @throws EndOfFile thrown when the scanner.nextToken() yields no tokens
*/
- private Token fetchToken() throws EndOfFile {
+ private IToken fetchToken() throws EndOfFile {
try {
return scanner.nextToken();
} catch (EndOfFile e) {
@@ -3029,7 +3086,7 @@
* @return the token you wish to observe
* @throws EndOfFile if looking ahead encounters EOF, throw EndOfFile
*/
- protected Token LA(int i) throws EndOfFile {
+ protected IToken LA(int i) throws EndOfFile {
if (i < 1)
// can't go backwards
return null;
@@ -3037,7 +3094,7 @@
if (currToken == null)
currToken = fetchToken();
- Token retToken = currToken;
+ IToken retToken = currToken;
for (; i > 1; --i) {
retToken = retToken.getNext();
@@ -3056,7 +3113,7 @@
* @throws EndOfFile if looking ahead encounters EOF, throw EndOfFile
*/
protected int LT(int i) throws EndOfFile {
- return LA(i).type;
+ return LA(i).getType();
}
/**
@@ -3065,7 +3122,7 @@
* @return The token that was consumed and removed from our buffer.
* @throws EndOfFile If there is no token to consume.
*/
- protected Token consume() throws EndOfFile {
+ protected IToken consume() throws EndOfFile {
if (currToken == null)
currToken = fetchToken();
@@ -3083,7 +3140,7 @@
* @return the token that was consumed and removed from our buffer.
* @throws Backtrack If LT(1) != type
*/
- protected Token consume(int type) throws Backtrack {
+ protected IToken consume(int type) throws Backtrack {
if (LT(1) == type)
return consume();
else
@@ -3096,7 +3153,7 @@
* @return The current token.
* @throws EndOfFile If there are no more tokens.
*/
- protected Token mark() throws EndOfFile {
+ protected IToken mark() throws EndOfFile {
if (currToken == null)
currToken = fetchToken();
return currToken;
@@ -3108,8 +3165,8 @@
* @param mark The point that we wish to restore to.
*
*/
- protected void backup(Token mark) {
- currToken = mark;
+ protected void backup(IToken mark) {
+ currToken = (Token)mark;
lastToken = null; // this is not entirely right ...
}
Index: parser/org/eclipse/cdt/internal/core/parser/ParserException.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ParserException.java,v
retrieving revision 1.2
diff -u -r1.2 ParserException.java
--- parser/org/eclipse/cdt/internal/core/parser/ParserException.java 4 Mar 2003 18:25:40 -0000 1.2
+++ parser/org/eclipse/cdt/internal/core/parser/ParserException.java 13 Jun 2003 19:56:31 -0000
@@ -10,9 +10,11 @@
******************************************************************************/
package org.eclipse.cdt.internal.core.parser;
+import org.eclipse.cdt.core.parser.IToken;
+
public class ParserException extends Exception {
- public ParserException(Token t) {
+ public ParserException(IToken t) {
}
public ParserException( String msg )
Index: parser/org/eclipse/cdt/internal/core/parser/Scanner.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/Scanner.java,v
retrieving revision 1.30
diff -u -r1.30 Scanner.java
--- parser/org/eclipse/cdt/internal/core/parser/Scanner.java 13 Jun 2003 15:01:22 -0000 1.30
+++ parser/org/eclipse/cdt/internal/core/parser/Scanner.java 13 Jun 2003 19:56:32 -0000
@@ -24,13 +24,19 @@
import java.util.StringTokenizer;
import java.util.Vector;
+import org.eclipse.cdt.core.parser.IMacroDescriptor;
import org.eclipse.cdt.core.parser.IParser;
+import org.eclipse.cdt.core.parser.IParserCallback;
import org.eclipse.cdt.core.parser.IScanner;
+import org.eclipse.cdt.core.parser.IScannerContext;
import org.eclipse.cdt.core.parser.ISourceElementRequestor;
+import org.eclipse.cdt.core.parser.IToken;
+import org.eclipse.cdt.core.parser.ScannerException;
import org.eclipse.cdt.core.parser.ast.IASTFactory;
import org.eclipse.cdt.core.parser.ast.IASTInclusion;
import org.eclipse.cdt.core.parser.ast.IASTMacro;
+
/**
* @author jcamelon
*
@@ -474,7 +480,7 @@
- public Token nextToken() throws ScannerException, Parser.EndOfFile {
+ public IToken nextToken() throws ScannerException, Parser.EndOfFile {
return nextToken( true );
}
@@ -559,7 +565,7 @@
if (c != NOCHAR )
{
- int type = wideString ? Token.tLSTRING : Token.tSTRING;
+ int type = wideString ? IToken.tLSTRING : IToken.tSTRING;
//If the next token is going to be a string as well, we need to concatenate
//it with this token.
@@ -618,7 +624,7 @@
String ident = buff.toString();
if (ident.equals(DEFINED))
- return newToken(Token.tINTEGER, handleDefinedMacro());
+ return newToken(IToken.tINTEGER, handleDefinedMacro());
Object mapping = definitions.get(ident);
@@ -637,7 +643,7 @@
else
tokenTypeObject = cKeywords.get(ident);
- int tokenType = Token.tIDENTIFIER;
+ int tokenType = IToken.tIDENTIFIER;
if (tokenTypeObject != null)
tokenType = ((Integer) tokenTypeObject).intValue();
@@ -693,15 +699,15 @@
//if pasting, there could actually be a float here instead of just a .
if( buff.toString().equals( "." ) ){
if( c == '*' ){
- return newToken( Token.tDOTSTAR, ".*", contextStack.getCurrentContext() );
+ return newToken( IToken.tDOTSTAR, ".*", contextStack.getCurrentContext() );
} else if( c == '.' ){
if( getChar() == '.' )
- return newToken( Token.tELIPSE, "..." );
+ return newToken( IToken.tELIPSE, "..." );
else
throw new ScannerException( "Invalid floating point @ offset " + contextStack.getCurrentContext().getOffset() );
} else {
ungetChar( c );
- return newToken( Token.tDOT, ".", contextStack.getCurrentContext() );
+ return newToken( IToken.tDOT, ".", contextStack.getCurrentContext() );
}
}
} else if (c == 'x') {
@@ -806,9 +812,9 @@
String result = buff.toString();
if( floatingPoint && result.equals(".") )
- tokenType = Token.tDOT;
+ tokenType = IToken.tDOT;
else
- tokenType = floatingPoint ? Token.tFLOATINGPT : Token.tINTEGER;
+ tokenType = floatingPoint ? IToken.tFLOATINGPT : IToken.tINTEGER;
return newToken(
tokenType,
@@ -1022,11 +1028,11 @@
c = next;
next = getChar( true );
if( next == '\'' )
- return newToken( Token.tCHAR, '\\' + new Character( (char)c ).toString(), contextStack.getCurrentContext() );
+ return newToken( IToken.tCHAR, '\\' + new Character( (char)c ).toString(), contextStack.getCurrentContext() );
else if( throwExceptionOnBadCharacterRead )
throw new ScannerException( "Invalid character '" + (char)c + "' read @ offset " + contextStack.getCurrentContext().getOffset() + " of file " + contextStack.getCurrentContext().getFilename() );
} else if( next == '\'' )
- return newToken( Token.tCHAR, new Character( (char)c ).toString(), contextStack.getCurrentContext() );
+ return newToken( IToken.tCHAR, new Character( (char)c ).toString(), contextStack.getCurrentContext() );
else
if( throwExceptionOnBadCharacterRead )
throw new ScannerException( "Invalid character '" + (char)c + "' read @ offset " + contextStack.getCurrentContext().getOffset() + " of file " + contextStack.getCurrentContext().getFilename() );
@@ -1035,51 +1041,51 @@
switch (c) {
case ':' :
return newToken(
- Token.tCOLONCOLON,
+ IToken.tCOLONCOLON,
"::",
contextStack.getCurrentContext());
default :
ungetChar(c);
return newToken(
- Token.tCOLON,
+ IToken.tCOLON,
":",
contextStack.getCurrentContext());
}
case ';' :
- return newToken(Token.tSEMI, ";", contextStack.getCurrentContext());
+ return newToken(IToken.tSEMI, ";", contextStack.getCurrentContext());
case ',' :
- return newToken(Token.tCOMMA, ",", contextStack.getCurrentContext());
+ return newToken(IToken.tCOMMA, ",", contextStack.getCurrentContext());
case '?' :
- return newToken(Token.tQUESTION, "?", contextStack.getCurrentContext());
+ return newToken(IToken.tQUESTION, "?", contextStack.getCurrentContext());
case '(' :
- return newToken(Token.tLPAREN, "(", contextStack.getCurrentContext());
+ return newToken(IToken.tLPAREN, "(", contextStack.getCurrentContext());
case ')' :
- return newToken(Token.tRPAREN, ")", contextStack.getCurrentContext());
+ return newToken(IToken.tRPAREN, ")", contextStack.getCurrentContext());
case '[' :
- return newToken(Token.tLBRACKET, "[", contextStack.getCurrentContext());
+ return newToken(IToken.tLBRACKET, "[", contextStack.getCurrentContext());
case ']' :
- return newToken(Token.tRBRACKET, "]", contextStack.getCurrentContext());
+ return newToken(IToken.tRBRACKET, "]", contextStack.getCurrentContext());
case '{' :
- return newToken(Token.tLBRACE, "{", contextStack.getCurrentContext());
+ return newToken(IToken.tLBRACE, "{", contextStack.getCurrentContext());
case '}' :
- return newToken(Token.tRBRACE, "}", contextStack.getCurrentContext());
+ return newToken(IToken.tRBRACE, "}", contextStack.getCurrentContext());
case '+' :
c = getChar();
switch (c) {
case '=' :
return newToken(
- Token.tPLUSASSIGN,
+ IToken.tPLUSASSIGN,
"+=",
contextStack.getCurrentContext());
case '+' :
return newToken(
- Token.tINCR,
+ IToken.tINCR,
"++",
contextStack.getCurrentContext());
default :
ungetChar(c);
return newToken(
- Token.tPLUS,
+ IToken.tPLUS,
"+",
contextStack.getCurrentContext());
}
@@ -1088,12 +1094,12 @@
switch (c) {
case '=' :
return newToken(
- Token.tMINUSASSIGN,
+ IToken.tMINUSASSIGN,
"-=",
contextStack.getCurrentContext());
case '-' :
return newToken(
- Token.tDECR,
+ IToken.tDECR,
"--",
contextStack.getCurrentContext());
case '>' :
@@ -1101,20 +1107,20 @@
switch (c) {
case '*' :
return newToken(
- Token.tARROWSTAR,
+ IToken.tARROWSTAR,
"->*",
contextStack.getCurrentContext());
default :
ungetChar(c);
return newToken(
- Token.tARROW,
+ IToken.tARROW,
"->",
contextStack.getCurrentContext());
}
default :
ungetChar(c);
return newToken(
- Token.tMINUS,
+ IToken.tMINUS,
"-",
contextStack.getCurrentContext());
}
@@ -1123,13 +1129,13 @@
switch (c) {
case '=' :
return newToken(
- Token.tSTARASSIGN,
+ IToken.tSTARASSIGN,
"*=",
contextStack.getCurrentContext());
default :
ungetChar(c);
return newToken(
- Token.tSTAR,
+ IToken.tSTAR,
"*",
contextStack.getCurrentContext());
}
@@ -1138,13 +1144,13 @@
switch (c) {
case '=' :
return newToken(
- Token.tMODASSIGN,
+ IToken.tMODASSIGN,
"%=",
contextStack.getCurrentContext());
default :
ungetChar(c);
return newToken(
- Token.tMOD,
+ IToken.tMOD,
"%",
contextStack.getCurrentContext());
}
@@ -1153,13 +1159,13 @@
switch (c) {
case '=' :
return newToken(
- Token.tXORASSIGN,
+ IToken.tXORASSIGN,
"^=",
contextStack.getCurrentContext());
default :
ungetChar(c);
return newToken(
- Token.tXOR,
+ IToken.tXOR,
"^",
contextStack.getCurrentContext());
}
@@ -1168,18 +1174,18 @@
switch (c) {
case '=' :
return newToken(
- Token.tAMPERASSIGN,
+ IToken.tAMPERASSIGN,
"&=",
contextStack.getCurrentContext());
case '&' :
return newToken(
- Token.tAND,
+ IToken.tAND,
"&&",
contextStack.getCurrentContext());
default :
ungetChar(c);
return newToken(
- Token.tAMPER,
+ IToken.tAMPER,
"&",
contextStack.getCurrentContext());
}
@@ -1188,35 +1194,35 @@
switch (c) {
case '=' :
return newToken(
- Token.tBITORASSIGN,
+ IToken.tBITORASSIGN,
"|=",
contextStack.getCurrentContext());
case '|' :
return newToken(
- Token.tOR,
+ IToken.tOR,
"||",
contextStack.getCurrentContext());
default :
ungetChar(c);
return newToken(
- Token.tBITOR,
+ IToken.tBITOR,
"|",
contextStack.getCurrentContext());
}
case '~' :
- return newToken(Token.tCOMPL, "~", contextStack.getCurrentContext());
+ return newToken(IToken.tCOMPL, "~", contextStack.getCurrentContext());
case '!' :
c = getChar();
switch (c) {
case '=' :
return newToken(
- Token.tNOTEQUAL,
+ IToken.tNOTEQUAL,
"!=",
contextStack.getCurrentContext());
default :
ungetChar(c);
return newToken(
- Token.tNOT,
+ IToken.tNOT,
"!",
contextStack.getCurrentContext());
}
@@ -1225,13 +1231,13 @@
switch (c) {
case '=' :
return newToken(
- Token.tEQUAL,
+ IToken.tEQUAL,
"==",
contextStack.getCurrentContext());
default :
ungetChar(c);
return newToken(
- Token.tASSIGN,
+ IToken.tASSIGN,
"=",
contextStack.getCurrentContext());
}
@@ -1243,24 +1249,24 @@
switch (c) {
case '=' :
return newToken(
- Token.tSHIFTLASSIGN,
+ IToken.tSHIFTLASSIGN,
"<<=",
contextStack.getCurrentContext());
default :
ungetChar(c);
return newToken(
- Token.tSHIFTL,
+ IToken.tSHIFTL,
"<<",
contextStack.getCurrentContext());
}
case '=' :
return newToken(
- Token.tLTEQUAL,
+ IToken.tLTEQUAL,
"<=",
contextStack.getCurrentContext());
default :
ungetChar(c);
- return newToken(Token.tLT, "<", contextStack.getCurrentContext());
+ return newToken(IToken.tLT, "<", contextStack.getCurrentContext());
}
case '>' :
c = getChar();
@@ -1270,24 +1276,24 @@
switch (c) {
case '=' :
return newToken(
- Token.tSHIFTRASSIGN,
+ IToken.tSHIFTRASSIGN,
">>=",
contextStack.getCurrentContext());
default :
ungetChar(c);
return newToken(
- Token.tSHIFTR,
+ IToken.tSHIFTR,
">>",
contextStack.getCurrentContext());
}
case '=' :
return newToken(
- Token.tGTEQUAL,
+ IToken.tGTEQUAL,
">=",
contextStack.getCurrentContext());
default :
ungetChar(c);
- return newToken(Token.tGT, ">", contextStack.getCurrentContext());
+ return newToken(IToken.tGT, ">", contextStack.getCurrentContext());
}
case '.' :
c = getChar();
@@ -1297,7 +1303,7 @@
switch (c) {
case '.' :
return newToken(
- Token.tELIPSE,
+ IToken.tELIPSE,
"...",
contextStack.getCurrentContext());
default :
@@ -1306,13 +1312,13 @@
break;
case '*' :
return newToken(
- Token.tDOTSTAR,
+ IToken.tDOTSTAR,
".*",
contextStack.getCurrentContext());
default :
ungetChar(c);
return newToken(
- Token.tDOT,
+ IToken.tDOT,
".",
contextStack.getCurrentContext());
}
@@ -1331,13 +1337,13 @@
continue;
case '=' :
return newToken(
- Token.tDIVASSIGN,
+ IToken.tDIVASSIGN,
"/=",
contextStack.getCurrentContext());
default :
ungetChar(c);
return newToken(
- Token.tDIV,
+ IToken.tDIV,
"/",
contextStack.getCurrentContext());
}
@@ -1371,7 +1377,7 @@
// the static instance we always use
protected static endOfMacroTokenException endOfMacroToken = new endOfMacroTokenException();
- protected Token nextTokenForStringizing() throws ScannerException, Parser.EndOfFile
+ protected IToken nextTokenForStringizing() throws ScannerException, Parser.EndOfFile
{
int c = getChar();
StringBuffer tokenImage = new StringBuffer();
@@ -1407,7 +1413,7 @@
if (c != NOCHAR )
{
- return newToken( Token.tSTRING, buff.toString(), contextStack.getCurrentContext());
+ return newToken( IToken.tSTRING, buff.toString(), contextStack.getCurrentContext());
} else {
if (throwExceptionOnUnboundedString)
@@ -1425,23 +1431,23 @@
c = next;
next = getChar( true );
if( next == '\'' )
- return newToken( Token.tCHAR, '\\' + new Character( (char)c ).toString(), contextStack.getCurrentContext() );
+ return newToken( IToken.tCHAR, '\\' + new Character( (char)c ).toString(), contextStack.getCurrentContext() );
else if( throwExceptionOnBadCharacterRead )
throw new ScannerException( "Invalid character '" + (char)c + "' read @ offset " + contextStack.getCurrentContext().getOffset() + " of file " + contextStack.getCurrentContext().getFilename() );
} else if( next == '\'' )
- return newToken( Token.tCHAR, new Character( (char)c ).toString(), contextStack.getCurrentContext() );
+ return newToken( IToken.tCHAR, new Character( (char)c ).toString(), contextStack.getCurrentContext() );
else
if( throwExceptionOnBadCharacterRead )
throw new ScannerException( "Invalid character '" + (char)c + "' read @ offset " + contextStack.getCurrentContext().getOffset() + " of file " + contextStack.getCurrentContext().getFilename() );
case ',' :
if (tokenImage.length() > 0) throw endOfMacroToken;
- return newToken(Token.tCOMMA, ",", contextStack.getCurrentContext());
+ return newToken(IToken.tCOMMA, ",", contextStack.getCurrentContext());
case '(' :
if (tokenImage.length() > 0) throw endOfMacroToken;
- return newToken(Token.tLPAREN, "(", contextStack.getCurrentContext());
+ return newToken(IToken.tLPAREN, "(", contextStack.getCurrentContext());
case ')' :
if (tokenImage.length() > 0) throw endOfMacroToken;
- return newToken(Token.tRPAREN, ")", contextStack.getCurrentContext());
+ return newToken(IToken.tRPAREN, ")", contextStack.getCurrentContext());
case '/' :
if (tokenImage.length() > 0) throw endOfMacroToken;
c = getChar();
@@ -1472,7 +1478,7 @@
// return completed token
if (tokenImage.length() > 0) {
- return newToken(Token.tIDENTIFIER, tokenImage.toString(), contextStack.getCurrentContext());
+ return newToken(IToken.tIDENTIFIER, tokenImage.toString(), contextStack.getCurrentContext());
}
// we're done
@@ -1481,80 +1487,80 @@
static {
- cppKeywords.put("and", new Integer(Token.t_and));
- cppKeywords.put("and_eq", new Integer(Token.t_and_eq));
- cppKeywords.put("asm", new Integer(Token.t_asm));
- cppKeywords.put("auto", new Integer(Token.t_auto));
- cppKeywords.put("bitand", new Integer(Token.t_bitand));
- cppKeywords.put("bitor", new Integer(Token.t_bitor));
- cppKeywords.put("bool", new Integer(Token.t_bool));
- cppKeywords.put("break", new Integer(Token.t_break));
- cppKeywords.put("case", new Integer(Token.t_case));
- cppKeywords.put("catch", new Integer(Token.t_catch));
- cppKeywords.put("char", new Integer(Token.t_char));
- cppKeywords.put("class", new Integer(Token.t_class));
- cppKeywords.put("compl", new Integer(Token.t_compl));
- cppKeywords.put("const", new Integer(Token.t_const));
- cppKeywords.put("const_cast", new Integer(Token.t_const_cast));
- cppKeywords.put("continue", new Integer(Token.t_continue));
- cppKeywords.put("default", new Integer(Token.t_default));
- cppKeywords.put("delete", new Integer(Token.t_delete));
- cppKeywords.put("do", new Integer(Token.t_do));
- cppKeywords.put("double", new Integer(Token.t_double));
- cppKeywords.put("dynamic_cast", new Integer(Token.t_dynamic_cast));
- cppKeywords.put("else", new Integer(Token.t_else));
- cppKeywords.put("enum", new Integer(Token.t_enum));
- cppKeywords.put("explicit", new Integer(Token.t_explicit));
- cppKeywords.put("export", new Integer(Token.t_export));
- cppKeywords.put("extern", new Integer(Token.t_extern));
- cppKeywords.put("false", new Integer(Token.t_false));
- cppKeywords.put("float", new Integer(Token.t_float));
- cppKeywords.put("for", new Integer(Token.t_for));
- cppKeywords.put("friend", new Integer(Token.t_friend));
- cppKeywords.put("goto", new Integer(Token.t_goto));
- cppKeywords.put("if", new Integer(Token.t_if));
- cppKeywords.put("inline", new Integer(Token.t_inline));
- cppKeywords.put("int", new Integer(Token.t_int));
- cppKeywords.put("long", new Integer(Token.t_long));
- cppKeywords.put("mutable", new Integer(Token.t_mutable));
- cppKeywords.put("namespace", new Integer(Token.t_namespace));
- cppKeywords.put("new", new Integer(Token.t_new));
- cppKeywords.put("not", new Integer(Token.t_not));
- cppKeywords.put("not_eq", new Integer(Token.t_not_eq));
- cppKeywords.put("operator", new Integer(Token.t_operator));
- cppKeywords.put("or", new Integer(Token.t_or));
- cppKeywords.put("or_eq", new Integer(Token.t_or_eq));
- cppKeywords.put("private", new Integer(Token.t_private));
- cppKeywords.put("protected", new Integer(Token.t_protected));
- cppKeywords.put("public", new Integer(Token.t_public));
- cppKeywords.put("register", new Integer(Token.t_register));
- cppKeywords.put("reinterpret_cast", new Integer(Token.t_reinterpret_cast));
- cppKeywords.put("return", new Integer(Token.t_return));
- cppKeywords.put("short", new Integer(Token.t_short));
- cppKeywords.put("signed", new Integer(Token.t_signed));
- cppKeywords.put("sizeof", new Integer(Token.t_sizeof));
- cppKeywords.put("static", new Integer(Token.t_static));
- cppKeywords.put("static_cast", new Integer(Token.t_static_cast));
- cppKeywords.put("struct", new Integer(Token.t_struct));
- cppKeywords.put("switch", new Integer(Token.t_switch));
- cppKeywords.put("template", new Integer(Token.t_template));
- cppKeywords.put("this", new Integer(Token.t_this));
- cppKeywords.put("throw", new Integer(Token.t_throw));
- cppKeywords.put("true", new Integer(Token.t_true));
- cppKeywords.put("try", new Integer(Token.t_try));
- cppKeywords.put("typedef", new Integer(Token.t_typedef));
- cppKeywords.put("typeid", new Integer(Token.t_typeid));
- cppKeywords.put("typename", new Integer(Token.t_typename));
- cppKeywords.put("union", new Integer(Token.t_union));
- cppKeywords.put("unsigned", new Integer(Token.t_unsigned));
- cppKeywords.put("using", new Integer(Token.t_using));
- cppKeywords.put("virtual", new Integer(Token.t_virtual));
- cppKeywords.put("void", new Integer(Token.t_void));
- cppKeywords.put("volatile", new Integer(Token.t_volatile));
- cppKeywords.put("wchar_t", new Integer(Token.t_wchar_t));
- cppKeywords.put("while", new Integer(Token.t_while));
- cppKeywords.put("xor", new Integer(Token.t_xor));
- cppKeywords.put("xor_eq", new Integer(Token.t_xor_eq));
+ cppKeywords.put("and", new Integer(IToken.t_and));
+ cppKeywords.put("and_eq", new Integer(IToken.t_and_eq));
+ cppKeywords.put("asm", new Integer(IToken.t_asm));
+ cppKeywords.put("auto", new Integer(IToken.t_auto));
+ cppKeywords.put("bitand", new Integer(IToken.t_bitand));
+ cppKeywords.put("bitor", new Integer(IToken.t_bitor));
+ cppKeywords.put("bool", new Integer(IToken.t_bool));
+ cppKeywords.put("break", new Integer(IToken.t_break));
+ cppKeywords.put("case", new Integer(IToken.t_case));
+ cppKeywords.put("catch", new Integer(IToken.t_catch));
+ cppKeywords.put("char", new Integer(IToken.t_char));
+ cppKeywords.put("class", new Integer(IToken.t_class));
+ cppKeywords.put("compl", new Integer(IToken.t_compl));
+ cppKeywords.put("const", new Integer(IToken.t_const));
+ cppKeywords.put("const_cast", new Integer(IToken.t_const_cast));
+ cppKeywords.put("continue", new Integer(IToken.t_continue));
+ cppKeywords.put("default", new Integer(IToken.t_default));
+ cppKeywords.put("delete", new Integer(IToken.t_delete));
+ cppKeywords.put("do", new Integer(IToken.t_do));
+ cppKeywords.put("double", new Integer(IToken.t_double));
+ cppKeywords.put("dynamic_cast", new Integer(IToken.t_dynamic_cast));
+ cppKeywords.put("else", new Integer(IToken.t_else));
+ cppKeywords.put("enum", new Integer(IToken.t_enum));
+ cppKeywords.put("explicit", new Integer(IToken.t_explicit));
+ cppKeywords.put("export", new Integer(IToken.t_export));
+ cppKeywords.put("extern", new Integer(IToken.t_extern));
+ cppKeywords.put("false", new Integer(IToken.t_false));
+ cppKeywords.put("float", new Integer(IToken.t_float));
+ cppKeywords.put("for", new Integer(IToken.t_for));
+ cppKeywords.put("friend", new Integer(IToken.t_friend));
+ cppKeywords.put("goto", new Integer(IToken.t_goto));
+ cppKeywords.put("if", new Integer(IToken.t_if));
+ cppKeywords.put("inline", new Integer(IToken.t_inline));
+ cppKeywords.put("int", new Integer(IToken.t_int));
+ cppKeywords.put("long", new Integer(IToken.t_long));
+ cppKeywords.put("mutable", new Integer(IToken.t_mutable));
+ cppKeywords.put("namespace", new Integer(IToken.t_namespace));
+ cppKeywords.put("new", new Integer(IToken.t_new));
+ cppKeywords.put("not", new Integer(IToken.t_not));
+ cppKeywords.put("not_eq", new Integer(IToken.t_not_eq));
+ cppKeywords.put("operator", new Integer(IToken.t_operator));
+ cppKeywords.put("or", new Integer(IToken.t_or));
+ cppKeywords.put("or_eq", new Integer(IToken.t_or_eq));
+ cppKeywords.put("private", new Integer(IToken.t_private));
+ cppKeywords.put("protected", new Integer(IToken.t_protected));
+ cppKeywords.put("public", new Integer(IToken.t_public));
+ cppKeywords.put("register", new Integer(IToken.t_register));
+ cppKeywords.put("reinterpret_cast", new Integer(IToken.t_reinterpret_cast));
+ cppKeywords.put("return", new Integer(IToken.t_return));
+ cppKeywords.put("short", new Integer(IToken.t_short));
+ cppKeywords.put("signed", new Integer(IToken.t_signed));
+ cppKeywords.put("sizeof", new Integer(IToken.t_sizeof));
+ cppKeywords.put("static", new Integer(IToken.t_static));
+ cppKeywords.put("static_cast", new Integer(IToken.t_static_cast));
+ cppKeywords.put("struct", new Integer(IToken.t_struct));
+ cppKeywords.put("switch", new Integer(IToken.t_switch));
+ cppKeywords.put("template", new Integer(IToken.t_template));
+ cppKeywords.put("this", new Integer(IToken.t_this));
+ cppKeywords.put("throw", new Integer(IToken.t_throw));
+ cppKeywords.put("true", new Integer(IToken.t_true));
+ cppKeywords.put("try", new Integer(IToken.t_try));
+ cppKeywords.put("typedef", new Integer(IToken.t_typedef));
+ cppKeywords.put("typeid", new Integer(IToken.t_typeid));
+ cppKeywords.put("typename", new Integer(IToken.t_typename));
+ cppKeywords.put("union", new Integer(IToken.t_union));
+ cppKeywords.put("unsigned", new Integer(IToken.t_unsigned));
+ cppKeywords.put("using", new Integer(IToken.t_using));
+ cppKeywords.put("virtual", new Integer(IToken.t_virtual));
+ cppKeywords.put("void", new Integer(IToken.t_void));
+ cppKeywords.put("volatile", new Integer(IToken.t_volatile));
+ cppKeywords.put("wchar_t", new Integer(IToken.t_wchar_t));
+ cppKeywords.put("while", new Integer(IToken.t_while));
+ cppKeywords.put("xor", new Integer(IToken.t_xor));
+ cppKeywords.put("xor_eq", new Integer(IToken.t_xor_eq));
ppDirectives.put("#define", new Integer(PreprocessorDirectives.DEFINE));
ppDirectives.put("#undef",new Integer(PreprocessorDirectives.UNDEFINE));
@@ -1572,44 +1578,44 @@
ppDirectives.put("#elif", new Integer(PreprocessorDirectives.ELIF));
ppDirectives.put("#", new Integer(PreprocessorDirectives.BLANK));
- cKeywords.put("auto", new Integer(Token.t_auto));
- cKeywords.put("break", new Integer(Token.t_break));
- cKeywords.put("case", new Integer(Token.t_case));
- cKeywords.put("char", new Integer(Token.t_char));
- cKeywords.put("const", new Integer(Token.t_const));
- cKeywords.put("continue", new Integer(Token.t_continue));
- cKeywords.put("default", new Integer(Token.t_default));
- cKeywords.put("delete", new Integer(Token.t_delete));
- cKeywords.put("do", new Integer(Token.t_do));
- cKeywords.put("double", new Integer(Token.t_double));
- cKeywords.put("else", new Integer(Token.t_else));
- cKeywords.put("enum", new Integer(Token.t_enum));
- cKeywords.put("extern", new Integer(Token.t_extern));
- cKeywords.put("float", new Integer(Token.t_float));
- cKeywords.put("for", new Integer(Token.t_for));
- cKeywords.put("goto", new Integer(Token.t_goto));
- cKeywords.put("if", new Integer(Token.t_if));
- cKeywords.put("inline", new Integer(Token.t_inline));
- cKeywords.put("int", new Integer(Token.t_int));
- cKeywords.put("long", new Integer(Token.t_long));
- cKeywords.put("register", new Integer(Token.t_register));
- cKeywords.put("restrict", new Integer(Token.t_restrict));
- cKeywords.put("return", new Integer(Token.t_return));
- cKeywords.put("short", new Integer(Token.t_short));
- cKeywords.put("signed", new Integer(Token.t_signed));
- cKeywords.put("sizeof", new Integer(Token.t_sizeof));
- cKeywords.put("static", new Integer(Token.t_static));
- cKeywords.put("struct", new Integer(Token.t_struct));
- cKeywords.put("switch", new Integer(Token.t_switch));
- cKeywords.put("typedef", new Integer(Token.t_typedef));
- cKeywords.put("union", new Integer(Token.t_union));
- cKeywords.put("unsigned", new Integer(Token.t_unsigned));
- cKeywords.put("void", new Integer(Token.t_void));
- cKeywords.put("volatile", new Integer(Token.t_volatile));
- cKeywords.put("while", new Integer(Token.t_while));
- cKeywords.put("_Bool", new Integer(Token.t__Bool));
- cKeywords.put("_Complex", new Integer(Token.t__Complex));
- cKeywords.put("_Imaginary", new Integer(Token.t__Imaginary));
+ cKeywords.put("auto", new Integer(IToken.t_auto));
+ cKeywords.put("break", new Integer(IToken.t_break));
+ cKeywords.put("case", new Integer(IToken.t_case));
+ cKeywords.put("char", new Integer(IToken.t_char));
+ cKeywords.put("const", new Integer(IToken.t_const));
+ cKeywords.put("continue", new Integer(IToken.t_continue));
+ cKeywords.put("default", new Integer(IToken.t_default));
+ cKeywords.put("delete", new Integer(IToken.t_delete));
+ cKeywords.put("do", new Integer(IToken.t_do));
+ cKeywords.put("double", new Integer(IToken.t_double));
+ cKeywords.put("else", new Integer(IToken.t_else));
+ cKeywords.put("enum", new Integer(IToken.t_enum));
+ cKeywords.put("extern", new Integer(IToken.t_extern));
+ cKeywords.put("float", new Integer(IToken.t_float));
+ cKeywords.put("for", new Integer(IToken.t_for));
+ cKeywords.put("goto", new Integer(IToken.t_goto));
+ cKeywords.put("if", new Integer(IToken.t_if));
+ cKeywords.put("inline", new Integer(IToken.t_inline));
+ cKeywords.put("int", new Integer(IToken.t_int));
+ cKeywords.put("long", new Integer(IToken.t_long));
+ cKeywords.put("register", new Integer(IToken.t_register));
+ cKeywords.put("restrict", new Integer(IToken.t_restrict));
+ cKeywords.put("return", new Integer(IToken.t_return));
+ cKeywords.put("short", new Integer(IToken.t_short));
+ cKeywords.put("signed", new Integer(IToken.t_signed));
+ cKeywords.put("sizeof", new Integer(IToken.t_sizeof));
+ cKeywords.put("static", new Integer(IToken.t_static));
+ cKeywords.put("struct", new Integer(IToken.t_struct));
+ cKeywords.put("switch", new Integer(IToken.t_switch));
+ cKeywords.put("typedef", new Integer(IToken.t_typedef));
+ cKeywords.put("union", new Integer(IToken.t_union));
+ cKeywords.put("unsigned", new Integer(IToken.t_unsigned));
+ cKeywords.put("void", new Integer(IToken.t_void));
+ cKeywords.put("volatile", new Integer(IToken.t_volatile));
+ cKeywords.put("while", new Integer(IToken.t_while));
+ cKeywords.put("_Bool", new Integer(IToken.t__Bool));
+ cKeywords.put("_Complex", new Integer(IToken.t__Complex));
+ cKeywords.put("_Imaginary", new Integer(IToken.t__Imaginary));
}
@@ -1986,12 +1992,12 @@
try {
while (true) {
- t = forStringizing ? tokenizer.nextTokenForStringizing() : tokenizer.nextToken(false);
- if (t.type == Token.tLPAREN) {
+ t = (Token)(forStringizing ? tokenizer.nextTokenForStringizing() : tokenizer.nextToken(false));
+ if (t.type == IToken.tLPAREN) {
nParen++;
- } else if (t.type == Token.tRPAREN) {
+ } else if (t.type == IToken.tRPAREN) {
nParen--;
- } else if (t.type == Token.tCOMMA && nParen == 0) {
+ } else if (t.type == IToken.tCOMMA && nParen == 0) {
parameterValues.add(str);
str = "";
space = false;
@@ -2002,9 +2008,9 @@
str += ' ';
switch (t.type) {
- case Token.tSTRING : str += '\"' + t.image + '\"'; break;
- case Token.tLSTRING : str += "L\"" + t.image + '\"'; break;
- case Token.tCHAR : str += '\'' + t.image + '\''; break;
+ case IToken.tSTRING : str += '\"' + t.image + '\"'; break;
+ case IToken.tLSTRING : str += "L\"" + t.image + '\"'; break;
+ case IToken.tCHAR : str += '\'' + t.image + '\''; break;
default : str += t.image; break;
}
space = true;
@@ -2065,7 +2071,7 @@
for (int i = 0; i < numberOfTokens; ++i) {
t = (Token) tokens.get(i);
- if (t.type == Token.tIDENTIFIER) {
+ if (t.type == IToken.tIDENTIFIER) {
String identifierName = t.image;
// is this identifier in the parameterNames
@@ -2115,9 +2121,9 @@
} else {
switch( t.type )
{
- case Token.tSTRING: buffer.append('\"' + t.image + '\"'); break;
- case Token.tLSTRING: buffer.append("L\"" + t.image + '\"'); break;
- case Token.tCHAR: buffer.append('\'' + t.image + '\''); break;
+ case IToken.tSTRING: buffer.append('\"' + t.image + '\"'); break;
+ case IToken.tLSTRING: buffer.append("L\"" + t.image + '\"'); break;
+ case IToken.tCHAR: buffer.append('\'' + t.image + '\''); break;
default: buffer.append(t.image); break;
}
}
@@ -2126,7 +2132,7 @@
if( i != numberOfTokens - 1)
{
- Token t2 = (Token) tokens.get(i+1);
+ IToken t2 = (IToken) tokens.get(i+1);
if( t2.getType() == tPOUNDPOUND )
pastingNext = true;
}
Index: parser/org/eclipse/cdt/internal/core/parser/ScannerContext.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ScannerContext.java,v
retrieving revision 1.5
diff -u -r1.5 ScannerContext.java
--- parser/org/eclipse/cdt/internal/core/parser/ScannerContext.java 13 Jun 2003 15:01:22 -0000 1.5
+++ parser/org/eclipse/cdt/internal/core/parser/ScannerContext.java 13 Jun 2003 19:56:32 -0000
@@ -14,6 +14,7 @@
import java.io.Reader;
import java.util.Stack;
+import org.eclipse.cdt.core.parser.IScannerContext;
import org.eclipse.cdt.core.parser.ast.IASTInclusion;
public class ScannerContext implements IScannerContext
Index: parser/org/eclipse/cdt/internal/core/parser/ScannerException.java
===================================================================
RCS file: parser/org/eclipse/cdt/internal/core/parser/ScannerException.java
diff -N parser/org/eclipse/cdt/internal/core/parser/ScannerException.java
--- parser/org/eclipse/cdt/internal/core/parser/ScannerException.java 4 Mar 2003 18:25:40 -0000 1.2
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001 Rational Software Corp. and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v0.5
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v05.html
- *
- * Contributors:
- * Rational Software - initial implementation
- ******************************************************************************/
-package org.eclipse.cdt.internal.core.parser;
-
-public class ScannerException extends Exception {
-
- /**
- * Constructor for ScannerException.
- */
- public ScannerException() {
- super();
- }
-
- /**
- * Constructor for ScannerException.
- * @param s
- */
- public ScannerException(String s) {
- super(s);
- }
-
-}
Index: parser/org/eclipse/cdt/internal/core/parser/Token.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/Token.java,v
retrieving revision 1.13
diff -u -r1.13 Token.java
--- parser/org/eclipse/cdt/internal/core/parser/Token.java 13 Jun 2003 15:01:22 -0000 1.13
+++ parser/org/eclipse/cdt/internal/core/parser/Token.java 13 Jun 2003 19:56:32 -0000
@@ -10,7 +10,10 @@
******************************************************************************/
package org.eclipse.cdt.internal.core.parser;
-public class Token {
+import org.eclipse.cdt.core.parser.IScannerContext;
+import org.eclipse.cdt.core.parser.IToken;
+
+public class Token implements IToken {
public Token(int t, String i, IScannerContext context ) {
type = t;
@@ -46,7 +49,7 @@
public int getEndOffset() { return getOffset() + getLength(); }
- public int getDelta( Token other )
+ public int getDelta( IToken other )
{
return other.getOffset() + other.getLength() - getOffset();
}
@@ -87,184 +90,48 @@
{
switch( getType() )
{
- case Token.t_new:
- case Token.t_delete:
- case Token.tPLUS:
- case Token.tMINUS:
- case Token.tSTAR:
- case Token.tDIV:
- case Token.tXOR:
- case Token.tMOD:
- case Token.tAMPER:
- case Token.tBITOR:
- case Token.tCOMPL:
- case Token.tNOT:
- case Token.tASSIGN:
- case Token.tLT:
- case Token.tGT:
- case Token.tPLUSASSIGN:
- case Token.tMINUSASSIGN:
- case Token.tSTARASSIGN:
- case Token.tDIVASSIGN:
- case Token.tMODASSIGN:
- case Token.tBITORASSIGN:
- case Token.tAMPERASSIGN:
- case Token.tXORASSIGN:
- case Token.tSHIFTL:
- case Token.tSHIFTR:
- case Token.tSHIFTLASSIGN:
- case Token.tSHIFTRASSIGN:
- case Token.tEQUAL:
- case Token.tNOTEQUAL:
- case Token.tLTEQUAL:
- case Token.tGTEQUAL:
- case Token.tAND:
- case Token.tOR:
- case Token.tINCR:
- case Token.tDECR:
- case Token.tCOMMA:
- case Token.tARROW:
- case Token.tARROWSTAR:
+ case IToken.t_new:
+ case IToken.t_delete:
+ case IToken.tPLUS:
+ case IToken.tMINUS:
+ case IToken.tSTAR:
+ case IToken.tDIV:
+ case IToken.tXOR:
+ case IToken.tMOD:
+ case IToken.tAMPER:
+ case IToken.tBITOR:
+ case IToken.tCOMPL:
+ case IToken.tNOT:
+ case IToken.tASSIGN:
+ case IToken.tLT:
+ case IToken.tGT:
+ case IToken.tPLUSASSIGN:
+ case IToken.tMINUSASSIGN:
+ case IToken.tSTARASSIGN:
+ case IToken.tDIVASSIGN:
+ case IToken.tMODASSIGN:
+ case IToken.tBITORASSIGN:
+ case IToken.tAMPERASSIGN:
+ case IToken.tXORASSIGN:
+ case IToken.tSHIFTL:
+ case IToken.tSHIFTR:
+ case IToken.tSHIFTLASSIGN:
+ case IToken.tSHIFTRASSIGN:
+ case IToken.tEQUAL:
+ case IToken.tNOTEQUAL:
+ case IToken.tLTEQUAL:
+ case IToken.tGTEQUAL:
+ case IToken.tAND:
+ case IToken.tOR:
+ case IToken.tINCR:
+ case IToken.tDECR:
+ case IToken.tCOMMA:
+ case IToken.tARROW:
+ case IToken.tARROWSTAR:
return true;
default:
return false;
}
}
- // Token types
- static public final int tIDENTIFIER = 1;
- static public final int tINTEGER = 2;
- static public final int tCOLONCOLON = 3;
- static public final int tCOLON = 4;
- static public final int tSEMI = 5;
- static public final int tCOMMA = 6;
- static public final int tQUESTION = 7;
- static public final int tLPAREN = 8;
- static public final int tRPAREN = 9;
- static public final int tLBRACKET = 10;
- static public final int tRBRACKET = 11;
- static public final int tLBRACE = 12;
- static public final int tRBRACE = 13;
- static public final int tPLUSASSIGN = 14;
- static public final int tINCR = 15;
- static public final int tPLUS = 16;
- static public final int tMINUSASSIGN = 17;
- static public final int tDECR = 18;
- static public final int tARROWSTAR = 19;
- static public final int tARROW = 20;
- static public final int tMINUS = 21;
- static public final int tSTARASSIGN = 22;
- static public final int tSTAR = 23;
- static public final int tMODASSIGN = 24;
- static public final int tMOD = 25;
- static public final int tXORASSIGN = 26;
- static public final int tXOR = 27;
- static public final int tAMPERASSIGN = 28;
- static public final int tAND = 29;
- static public final int tAMPER = 30;
- static public final int tBITORASSIGN = 31;
- static public final int tOR = 32;
- static public final int tBITOR = 33;
- static public final int tCOMPL = 34;
- static public final int tNOTEQUAL = 35;
- static public final int tNOT = 36;
- static public final int tEQUAL = 37;
- static public final int tASSIGN = 38;
- static public final int tSHIFTL = 40;
- static public final int tLTEQUAL = 41;
- static public final int tLT = 42;
- static public final int tSHIFTRASSIGN = 43;
- static public final int tSHIFTR = 44;
- static public final int tGTEQUAL = 45;
- static public final int tGT = 46;
- static public final int tSHIFTLASSIGN = 47;
- static public final int tELIPSE = 48;
- static public final int tDOTSTAR = 49;
- static public final int tDOT = 50;
- static public final int tDIVASSIGN = 51;
- static public final int tDIV = 52;
- static public final int tCLASSNAME = 53;
- static public final int t_and = 54;
- static public final int t_and_eq = 55;
- static public final int t_asm = 56;
- static public final int t_auto = 57;
- static public final int t_bitand = 58;
- static public final int t_bitor = 59;
- static public final int t_bool = 60;
- static public final int t_break = 61;
- static public final int t_case = 62;
- static public final int t_catch = 63;
- static public final int t_char = 64;
- static public final int t_class = 65;
- static public final int t_compl = 66;
- static public final int t_const = 67;
- static public final int t_const_cast = 69;
- static public final int t_continue = 70;
- static public final int t_default = 71;
- static public final int t_delete = 72;
- static public final int t_do = 73;
- static public final int t_double = 74;
- static public final int t_dynamic_cast = 75;
- static public final int t_else = 76;
- static public final int t_enum = 77;
- static public final int t_explicit = 78;
- static public final int t_export = 79;
- static public final int t_extern = 80;
- static public final int t_false = 81;
- static public final int t_float = 82;
- static public final int t_for = 83;
- static public final int t_friend = 84;
- static public final int t_goto = 85;
- static public final int t_if = 86;
- static public final int t_inline = 87;
- static public final int t_int = 88;
- static public final int t_long = 89;
- static public final int t_mutable = 90;
- static public final int t_namespace = 91;
- static public final int t_new = 92;
- static public final int t_not = 93;
- static public final int t_not_eq = 94;
- static public final int t_operator = 95;
- static public final int t_or = 96;
- static public final int t_or_eq = 97;
- static public final int t_private = 98;
- static public final int t_protected = 99;
- static public final int t_public = 100;
- static public final int t_register = 101;
- static public final int t_reinterpret_cast = 102;
- static public final int t_return = 103;
- static public final int t_short = 104;
- static public final int t_sizeof = 105;
- static public final int t_static = 106;
- static public final int t_static_cast = 107;
- static public final int t_signed = 108;
- static public final int t_struct = 109;
- static public final int t_switch = 110;
- static public final int t_template = 111;
- static public final int t_this = 112;
- static public final int t_throw = 113;
- static public final int t_true = 114;
- static public final int t_try = 115;
- static public final int t_typedef = 116;
- static public final int t_typeid = 117;
- static public final int t_typename = 118;
- static public final int t_union = 119;
- static public final int t_unsigned = 120;
- static public final int t_using = 121;
- static public final int t_virtual = 122;
- static public final int t_void = 123;
- static public final int t_volatile = 124;
- static public final int t_wchar_t = 125;
- static public final int t_while = 126;
- static public final int t_xor = 127;
- static public final int t_xor_eq = 128;
- static public final int tSTRING = 129;
- static public final int tFLOATINGPT = 130;
- static public final int tLSTRING = 131;
- static public final int tCHAR = 132;
- static public final int t__Bool = 133;
- static public final int t__Complex = 134;
- static public final int t__Imaginary = 135;
- static public final int t_restrict = 136;
- static public final int tLAST = t_restrict;
}
Index: parser/org/eclipse/cdt/internal/core/parser/TokenDuple.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/TokenDuple.java,v
retrieving revision 1.2
diff -u -r1.2 TokenDuple.java
--- parser/org/eclipse/cdt/internal/core/parser/TokenDuple.java 13 Jun 2003 15:01:22 -0000 1.2
+++ parser/org/eclipse/cdt/internal/core/parser/TokenDuple.java 13 Jun 2003 19:56:32 -0000
@@ -12,29 +12,31 @@
import java.util.Iterator;
+import org.eclipse.cdt.core.parser.IToken;
+
/**
* @author jcamelon
*
*/
public class TokenDuple {
- public TokenDuple( Token first, Token last )
+ public TokenDuple( IToken first, IToken last )
{
firstToken = first;
lastToken = last;
}
- private final Token firstToken, lastToken;
+ private final IToken firstToken, lastToken;
/**
* @return
*/
- public Token getFirstToken() {
+ public IToken getFirstToken() {
return firstToken;
}
/**
* @return
*/
- public Token getLastToken() {
+ public IToken getLastToken() {
return lastToken;
}
@@ -45,7 +47,7 @@
private class TokenIterator implements Iterator
{
- private Token iter = TokenDuple.this.firstToken;
+ private IToken iter = TokenDuple.this.firstToken;
/* (non-Javadoc)
* @see java.util.Iterator#hasNext()
@@ -58,7 +60,7 @@
* @see java.util.Iterator#next()
*/
public Object next() {
- Token temp = iter;
+ IToken temp = iter;
iter = iter.getNext();
return temp;
}
@@ -75,7 +77,7 @@
public String toString()
{
StringBuffer buff = new StringBuffer();
- Token iter = firstToken;
+ IToken iter = firstToken;
for( ; ; )
{
buff.append( iter.getImage() );
@@ -84,4 +86,10 @@
}
return buff.toString();
}
+
+ public boolean isIdentifier()
+ {
+ return ( firstToken == lastToken );
+ }
+
}
Index: parser/org/eclipse/cdt/internal/core/parser/ast/full/ASTClassSpecifier.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/full/ASTClassSpecifier.java,v
retrieving revision 1.2
diff -u -r1.2 ASTClassSpecifier.java
--- parser/org/eclipse/cdt/internal/core/parser/ast/full/ASTClassSpecifier.java 13 Jun 2003 15:01:21 -0000 1.2
+++ parser/org/eclipse/cdt/internal/core/parser/ast/full/ASTClassSpecifier.java 13 Jun 2003 19:56:32 -0000
@@ -12,6 +12,7 @@
import java.util.Iterator;
+import org.eclipse.cdt.core.parser.ast.AccessVisibility;
import org.eclipse.cdt.core.parser.ast.ClassKind;
import org.eclipse.cdt.core.parser.ast.ClassNameType;
import org.eclipse.cdt.core.parser.ast.IASTTemplateDeclaration;
@@ -132,6 +133,14 @@
*/
public ISymbol getSymbol() {
return symbol;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.parser.ast.IASTClassSpecifier#getCurrentVisiblity()
+ */
+ public AccessVisibility getCurrentVisiblity() {
+ // TODO Auto-generated method stub
+ return null;
}
}
Index: parser/org/eclipse/cdt/internal/core/parser/ast/full/FullParseASTFactory.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/full/FullParseASTFactory.java,v
retrieving revision 1.2
diff -u -r1.2 FullParseASTFactory.java
--- parser/org/eclipse/cdt/internal/core/parser/ast/full/FullParseASTFactory.java 13 Jun 2003 15:01:21 -0000 1.2
+++ parser/org/eclipse/cdt/internal/core/parser/ast/full/FullParseASTFactory.java 13 Jun 2003 19:56:32 -0000
@@ -12,15 +12,20 @@
import java.util.Iterator;
+import org.eclipse.cdt.core.parser.IToken;
+import org.eclipse.cdt.core.parser.ast.AccessVisibility;
+import org.eclipse.cdt.core.parser.ast.ClassKind;
+import org.eclipse.cdt.core.parser.ast.ClassNameType;
import org.eclipse.cdt.core.parser.ast.IASTASMDefinition;
+import org.eclipse.cdt.core.parser.ast.IASTClassSpecifier;
import org.eclipse.cdt.core.parser.ast.IASTCompilationUnit;
import org.eclipse.cdt.core.parser.ast.IASTFactory;
import org.eclipse.cdt.core.parser.ast.IASTLinkageSpecification;
import org.eclipse.cdt.core.parser.ast.IASTNamespaceDefinition;
import org.eclipse.cdt.core.parser.ast.IASTScope;
+import org.eclipse.cdt.core.parser.ast.IASTTemplateDeclaration;
import org.eclipse.cdt.core.parser.ast.IASTUsingDeclaration;
import org.eclipse.cdt.core.parser.ast.IASTUsingDirective;
-import org.eclipse.cdt.internal.core.parser.Token;
import org.eclipse.cdt.internal.core.parser.TokenDuple;
import org.eclipse.cdt.internal.core.parser.Parser.Backtrack;
import org.eclipse.cdt.internal.core.parser.ast.BaseASTFactory;
@@ -42,10 +47,10 @@
TokenDuple duple)
throws Backtrack {
Iterator iter = duple.iterator();
- Token t1 = (Token)iter.next();
+ IToken t1 = (IToken)iter.next();
IContainerSymbol symbol = null;
- if( t1.getType() == Token.tCOLONCOLON )
+ if( t1.getType() == IToken.tCOLONCOLON )
symbol = pst.getCompilationUnit();
else
{
@@ -61,8 +66,8 @@
while( iter.hasNext() )
{
- Token t = (Token)iter.next();
- if( t.getType() == Token.tCOLONCOLON ) continue;
+ IToken t = (IToken)iter.next();
+ if( t.getType() == IToken.tCOLONCOLON ) continue;
try
{
symbol = symbol.LookupNestedNameSpecifier( t.getImage() );
@@ -143,6 +148,22 @@
public IASTUsingDeclaration createUsingDeclaration(IASTScope scope, boolean isTypeName, TokenDuple name) {
// TODO Auto-generated method stub
return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.parser.ast.IASTFactory#createClassSpecifier(org.eclipse.cdt.core.parser.ast.IASTScope, java.lang.String, org.eclipse.cdt.core.parser.ast.ClassKind, org.eclipse.cdt.core.parser.ast.ClassNameType, org.eclipse.cdt.core.parser.ast.AccessVisibility, org.eclipse.cdt.core.parser.ast.IASTTemplateDeclaration)
+ */
+ public IASTClassSpecifier createClassSpecifier(IASTScope scope, String name, ClassKind kind, ClassNameType type, AccessVisibility access, IASTTemplateDeclaration ownerTemplateDeclaration, int startingOffset, int nameOffset) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.parser.ast.IASTFactory#addBaseSpecifier(org.eclipse.cdt.core.parser.ast.IASTClassSpecifier, boolean, org.eclipse.cdt.core.parser.ast.AccessVisibility, java.lang.String)
+ */
+ public void addBaseSpecifier(IASTClassSpecifier astClassSpec, boolean isVirtual, AccessVisibility visibility, String string) {
+ // TODO Auto-generated method stub
+
}
}
Index: parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTBaseSpecifier.java
===================================================================
RCS file: parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTBaseSpecifier.java
diff -N parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTBaseSpecifier.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTBaseSpecifier.java 13 Jun 2003 19:56:32 -0000
@@ -0,0 +1,57 @@
+/**********************************************************************
+ * Copyright (c) 2002,2003 Rational Software Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Common Public License v0.5
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/cpl-v05.html
+ *
+ * Contributors:
+ * IBM Rational Software - Initial API and implementation
+***********************************************************************/
+package org.eclipse.cdt.internal.core.parser.ast.quick;
+
+import org.eclipse.cdt.core.parser.ast.AccessVisibility;
+import org.eclipse.cdt.core.parser.ast.IASTBaseSpecifier;
+import org.eclipse.cdt.core.parser.ast.IASTClassSpecifier;
+
+/**
+ * @author jcamelon
+ *
+ */
+public class ASTBaseSpecifier implements IASTBaseSpecifier {
+
+ private final AccessVisibility visibility;
+ private final boolean isVirtual;
+ private final IASTClassSpecifier parentClass;
+
+ public ASTBaseSpecifier( IASTClassSpecifier classSpec, boolean v, AccessVisibility a )
+ {
+ parentClass = classSpec;
+ isVirtual = v;
+ visibility = a;
+ }
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.parser.ast.IASTBaseSpecifier#getAccess()
+ */
+ public AccessVisibility getAccess() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.parser.ast.IASTBaseSpecifier#isVirtual()
+ */
+ public boolean isVirtual() {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.parser.ast.IASTBaseSpecifier#getParent()
+ */
+ public IASTClassSpecifier getParent() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+}
Index: parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTClassSpecifier.java
===================================================================
RCS file: parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTClassSpecifier.java
diff -N parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTClassSpecifier.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTClassSpecifier.java 13 Jun 2003 19:56:32 -0000
@@ -0,0 +1,160 @@
+/**********************************************************************
+ * Copyright (c) 2002,2003 Rational Software Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Common Public License v0.5
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/cpl-v05.html
+ *
+ * Contributors:
+ * IBM Rational Software - Initial API and implementation
+***********************************************************************/
+package org.eclipse.cdt.internal.core.parser.ast.quick;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.cdt.core.parser.ast.AccessVisibility;
+import org.eclipse.cdt.core.parser.ast.ClassKind;
+import org.eclipse.cdt.core.parser.ast.ClassNameType;
+import org.eclipse.cdt.core.parser.ast.IASTBaseSpecifier;
+import org.eclipse.cdt.core.parser.ast.IASTDeclaration;
+import org.eclipse.cdt.core.parser.ast.IASTScope;
+import org.eclipse.cdt.core.parser.ast.IASTTemplateDeclaration;
+import org.eclipse.cdt.internal.core.parser.ast.NamedOffsets;
+
+/**
+ * @author jcamelon
+ *
+ */
+public class ASTClassSpecifier extends ASTDeclaration implements IASTQClassSpecifier, IASTQScope {
+
+ public ASTClassSpecifier(IASTScope scope,
+ String name,
+ ClassKind kind,
+ ClassNameType type,
+ AccessVisibility access,
+ IASTTemplateDeclaration ownerTemplateDeclaration )
+ {
+ super(scope);
+ classNameType = type;
+ classKind = kind;
+ this.access = access;
+ this.name = name;
+ templateOwner = ownerTemplateDeclaration;
+ }
+
+ private IASTTemplateDeclaration templateOwner = null;
+ private final String name;
+ private List declarations = new ArrayList();
+ private List baseClauses = new ArrayList();
+ private AccessVisibility access;
+ private NamedOffsets offsets = new NamedOffsets();
+ private final ClassNameType classNameType;
+ private final ClassKind classKind;
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.parser.ast.IASTClassSpecifier#getClassNameType()
+ */
+ public ClassNameType getClassNameType() {
+ return classNameType;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.parser.ast.IASTClassSpecifier#getClassKind()
+ */
+ public ClassKind getClassKind() {
+ return classKind;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.parser.ast.IASTClassSpecifier#getBaseClauses()
+ */
+ public Iterator getBaseClauses() {
+ return baseClauses.iterator();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.parser.ast.IASTClassSpecifier#getCurrentVisiblity()
+ */
+ public AccessVisibility getCurrentVisiblity() {
+ return access;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.parser.ast.IASTScope#getDeclarations()
+ */
+ public Iterator getDeclarations() {
+ return declarations.iterator();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#getName()
+ */
+ public String getName() {
+ return name;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#getElementNameOffset()
+ */
+ public int getElementNameOffset() {
+ return offsets.getElementNameOffset();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#setNameOffset(int)
+ */
+ public void setNameOffset(int o) {
+ offsets.setNameOffset(o);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.parser.ast.IASTTemplatedDeclaration#getOwnerTemplateDeclaration()
+ */
+ public IASTTemplateDeclaration getOwnerTemplateDeclaration() {
+ return templateOwner;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setStartingOffset(int)
+ */
+ public void setStartingOffset(int o) {
+ offsets.setStartingOffset(o);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setEndingOffset(int)
+ */
+ public void setEndingOffset(int o) {
+ offsets.setEndingOffset(o);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getElementStartingOffset()
+ */
+ public int getElementStartingOffset() {
+ return offsets.getElementStartingOffset();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getElementEndingOffset()
+ */
+ public int getElementEndingOffset() {
+ return offsets.getElementEndingOffset();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.internal.core.parser.ast.quick.IASTQScope#addDeclaration(org.eclipse.cdt.core.parser.ast.IASTDeclaration)
+ */
+ public void addDeclaration(IASTDeclaration declaration) {
+ declarations.add( declaration );
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.internal.core.parser.ast.quick.IASTQClassSpecifier#addBaseClass(org.eclipse.cdt.core.parser.ast.IASTBaseSpecifier)
+ */
+ public void addBaseClass(IASTBaseSpecifier baseSpecifier) {
+ baseClauses.add( baseSpecifier );
+ }
+
+}
Index: parser/org/eclipse/cdt/internal/core/parser/ast/quick/IASTQClassSpecifier.java
===================================================================
RCS file: parser/org/eclipse/cdt/internal/core/parser/ast/quick/IASTQClassSpecifier.java
diff -N parser/org/eclipse/cdt/internal/core/parser/ast/quick/IASTQClassSpecifier.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ parser/org/eclipse/cdt/internal/core/parser/ast/quick/IASTQClassSpecifier.java 13 Jun 2003 19:56:32 -0000
@@ -0,0 +1,23 @@
+/**********************************************************************
+ * Copyright (c) 2002,2003 Rational Software Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Common Public License v0.5
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/cpl-v05.html
+ *
+ * Contributors:
+ * IBM Rational Software - Initial API and implementation
+***********************************************************************/
+package org.eclipse.cdt.internal.core.parser.ast.quick;
+
+import org.eclipse.cdt.core.parser.ast.IASTBaseSpecifier;
+import org.eclipse.cdt.core.parser.ast.IASTClassSpecifier;
+
+/**
+ * @author jcamelon
+ *
+ */
+public interface IASTQClassSpecifier extends IASTClassSpecifier {
+
+ public void addBaseClass( IASTBaseSpecifier baseSpecifier );
+}
Index: parser/org/eclipse/cdt/internal/core/parser/ast/quick/QuickParseASTFactory.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/QuickParseASTFactory.java,v
retrieving revision 1.2
diff -u -r1.2 QuickParseASTFactory.java
--- parser/org/eclipse/cdt/internal/core/parser/ast/quick/QuickParseASTFactory.java 13 Jun 2003 15:01:22 -0000 1.2
+++ parser/org/eclipse/cdt/internal/core/parser/ast/quick/QuickParseASTFactory.java 13 Jun 2003 19:56:32 -0000
@@ -10,12 +10,18 @@
***********************************************************************/
package org.eclipse.cdt.internal.core.parser.ast.quick;
+import org.eclipse.cdt.core.parser.ast.AccessVisibility;
+import org.eclipse.cdt.core.parser.ast.ClassKind;
+import org.eclipse.cdt.core.parser.ast.ClassNameType;
import org.eclipse.cdt.core.parser.ast.IASTASMDefinition;
+import org.eclipse.cdt.core.parser.ast.IASTBaseSpecifier;
+import org.eclipse.cdt.core.parser.ast.IASTClassSpecifier;
import org.eclipse.cdt.core.parser.ast.IASTCompilationUnit;
import org.eclipse.cdt.core.parser.ast.IASTFactory;
import org.eclipse.cdt.core.parser.ast.IASTLinkageSpecification;
import org.eclipse.cdt.core.parser.ast.IASTNamespaceDefinition;
import org.eclipse.cdt.core.parser.ast.IASTScope;
+import org.eclipse.cdt.core.parser.ast.IASTTemplateDeclaration;
import org.eclipse.cdt.core.parser.ast.IASTUsingDeclaration;
import org.eclipse.cdt.core.parser.ast.IASTUsingDirective;
import org.eclipse.cdt.internal.core.parser.TokenDuple;
@@ -74,6 +80,24 @@
*/
public IASTUsingDeclaration createUsingDeclaration(IASTScope scope, boolean isTypeName, TokenDuple name) {
return new ASTUsingDeclaration( scope, isTypeName, name.toString() );
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.parser.ast.IASTFactory#createClassSpecifier(org.eclipse.cdt.core.parser.ast.IASTScope, java.lang.String, org.eclipse.cdt.core.parser.ast.ClassKind, org.eclipse.cdt.core.parser.ast.ClassNameType, org.eclipse.cdt.core.parser.ast.AccessVisibility, org.eclipse.cdt.core.parser.ast.IASTTemplateDeclaration)
+ */
+ public IASTClassSpecifier createClassSpecifier(IASTScope scope, String name, ClassKind kind, ClassNameType type, AccessVisibility access, IASTTemplateDeclaration ownerTemplateDeclaration, int startingOffset, int nameOffset) {
+ IASTClassSpecifier spec = new ASTClassSpecifier( scope, name, kind, type, access, ownerTemplateDeclaration );
+ spec.setStartingOffset( startingOffset );
+ spec.setNameOffset( nameOffset );
+ return spec;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.parser.ast.IASTFactory#addBaseSpecifier(org.eclipse.cdt.core.parser.ast.IASTClassSpecifier, boolean, org.eclipse.cdt.core.parser.ast.AccessVisibility, java.lang.String)
+ */
+ public void addBaseSpecifier(IASTClassSpecifier astClassSpec, boolean isVirtual, AccessVisibility visibility, String string) {
+ IASTBaseSpecifier baseSpecifier = new ASTBaseSpecifier( astClassSpec, isVirtual, visibility );
+ ((IASTQClassSpecifier)astClassSpec).addBaseClass(baseSpecifier);
}
}