[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
[cdt-patch] Applied[HEAD] Parser - Pointers to Functions/Typedefs
|
CORE
Updated AST to better represent pointers to functions/methods.
Implemented typedef declaration/x-ref infrastructure.
TESTS
Updated QuickParseASTTests for pointer to function updates.
Updated CompleteParseASTTests for typedef work.
JohnC
Index: ChangeLog
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core.tests/ChangeLog,v
retrieving revision 1.43
diff -u -r1.43 ChangeLog
--- ChangeLog 29 Jul 2003 14:28:32 -0000 1.43
+++ ChangeLog 30 Jul 2003 01:30:43 -0000
@@ -1,3 +1,7 @@
+2003-07-29 John Camelon
+ Updated QuickParseASTTests for pointer to function updates.
+ Updated CompleteParseASTTests for typedef work.
+
2003-07-28 Victor Mozgin
Moved testBug39546() from ASTFailedTests.java to QuickParseASTTests.java.
Index: failures/org/eclipse/cdt/core/parser/failedTests/ASTFailedTests.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core.tests/failures/org/eclipse/cdt/core/parser/failedTests/ASTFailedTests.java,v
retrieving revision 1.5
diff -u -r1.5 ASTFailedTests.java
--- failures/org/eclipse/cdt/core/parser/failedTests/ASTFailedTests.java 29 Jul 2003 14:21:02 -0000 1.5
+++ failures/org/eclipse/cdt/core/parser/failedTests/ASTFailedTests.java 30 Jul 2003 01:30:44 -0000
@@ -18,7 +18,6 @@
import org.eclipse.cdt.core.parser.ast.IASTClassSpecifier;
import org.eclipse.cdt.core.parser.ast.IASTDeclaration;
import org.eclipse.cdt.core.parser.ast.IASTFunction;
-import org.eclipse.cdt.core.parser.ast.IASTPointerToFunction;
import org.eclipse.cdt.core.parser.ast.IASTTypedefDeclaration;
import org.eclipse.cdt.core.parser.ast.IASTVariable;
import org.eclipse.cdt.core.parser.tests.BaseASTTest;
@@ -323,7 +322,7 @@
{
try
{
- IASTPointerToFunction p2f = (IASTPointerToFunction)assertSoleDeclaration("extern int (* import) (void) __attribute__((dllimport));");
+ IASTDeclaration d = assertSoleDeclaration("extern int (* import) (void) __attribute__((dllimport));");
fail( "We should not reach this point");
}
catch( ClassCastException cce )
Index: parser/org/eclipse/cdt/core/parser/tests/BaseASTTest.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/BaseASTTest.java,v
retrieving revision 1.5
diff -u -r1.5 BaseASTTest.java
--- parser/org/eclipse/cdt/core/parser/tests/BaseASTTest.java 28 Jul 2003 17:21:50 -0000 1.5
+++ parser/org/eclipse/cdt/core/parser/tests/BaseASTTest.java 30 Jul 2003 01:30:44 -0000
@@ -25,6 +25,7 @@
import org.eclipse.cdt.core.parser.ast.IASTFunction;
import org.eclipse.cdt.core.parser.ast.IASTParameterDeclaration;
import org.eclipse.cdt.core.parser.ast.IASTSimpleTypeSpecifier;
+import org.eclipse.cdt.core.parser.ast.IASTTypedefDeclaration;
import org.eclipse.cdt.core.parser.ast.IASTVariable;
import org.eclipse.cdt.internal.core.parser.ParserException;
import org.eclipse.cdt.internal.core.parser.ScannerInfo;
@@ -119,6 +120,12 @@
{
assertEquals( ((IASTSimpleTypeSpecifier)function.getReturnType().getTypeSpecifier()).getType(), type );
}
+
+ protected void assertSimpleType(IASTTypedefDeclaration variable, IASTSimpleTypeSpecifier.Type type)
+ {
+ assertEquals( ((IASTSimpleTypeSpecifier)variable.getAbstractDeclarator().getTypeSpecifier()).getType(), type );
+ }
+
protected void assertSimpleType(IASTVariable variable, IASTSimpleTypeSpecifier.Type type)
{
Index: parser/org/eclipse/cdt/core/parser/tests/CompleteParseASTTest.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/CompleteParseASTTest.java,v
retrieving revision 1.8
diff -u -r1.8 CompleteParseASTTest.java
--- parser/org/eclipse/cdt/core/parser/tests/CompleteParseASTTest.java 28 Jul 2003 20:49:41 -0000 1.8
+++ parser/org/eclipse/cdt/core/parser/tests/CompleteParseASTTest.java 30 Jul 2003 01:30:44 -0000
@@ -48,8 +48,6 @@
import org.eclipse.cdt.core.parser.ast.IASTMethodReference;
import org.eclipse.cdt.core.parser.ast.IASTNamespaceDefinition;
import org.eclipse.cdt.core.parser.ast.IASTNamespaceReference;
-import org.eclipse.cdt.core.parser.ast.IASTPointerToFunction;
-import org.eclipse.cdt.core.parser.ast.IASTPointerToMethod;
import org.eclipse.cdt.core.parser.ast.IASTReference;
import org.eclipse.cdt.core.parser.ast.IASTScope;
import org.eclipse.cdt.core.parser.ast.IASTSimpleTypeSpecifier;
@@ -380,20 +378,6 @@
this.compilationUnit = popScope();
}
- /* (non-Javadoc)
- * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptPointerToFunction(org.eclipse.cdt.core.parser.ast.IASTPointerToFunction)
- */
- public void acceptPointerToFunction(IASTPointerToFunction function)
- {
- getCurrentScope().addDeclaration(function);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptPointerToMethod(org.eclipse.cdt.core.parser.ast.IASTPointerToMethod)
- */
- public void acceptPointerToMethod(IASTPointerToMethod method)
- {
- getCurrentScope().addDeclaration(method); }
private Stack scopes = new Stack();
@@ -796,11 +780,26 @@
assertEquals( callback.getReferences().size(), 2 );
}
-// public void testSimpleTypedef() throws Exception
-// {
-// IASTTypedefDeclaration typedef = (IASTTypedefDeclaration)parse( "typedef int myInt;").getDeclarations().next();
-// assertEquals( typedef.getName(), "myInt");
-// }
+ public void testSimpleTypedef() throws Exception
+ {
+ Iterator iter = parse( "typedef int myInt;\n myInt var;").getDeclarations();
+ IASTTypedefDeclaration typedef = (IASTTypedefDeclaration)iter.next();
+ assertEquals( typedef.getName(), "myInt");
+ assertEquals( ((IASTSimpleTypeSpecifier)typedef.getAbstractDeclarator().getTypeSpecifier()).getType(), IASTSimpleTypeSpecifier.Type.INT );
+ IASTVariable v = (IASTVariable)iter.next();
+ assertEquals( v.getName(), "var");
+ assertEquals( callback.getReferences().size(), 1 );
+ }
+
+ public void testComplexTypedef() throws Exception
+ {
+ Iterator declarations = parse( "class A{ }; typedef A ** A_DOUBLEPTR;").getDeclarations();
+ IASTClassSpecifier classA = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)declarations.next()).getTypeSpecifier();
+ IASTTypedefDeclaration typedef = (IASTTypedefDeclaration)declarations.next();
+ assertEquals( ((IASTSimpleTypeSpecifier)typedef.getAbstractDeclarator().getTypeSpecifier()).getTypeSpecifier(), classA );
+ assertEquals( callback.getReferences().size(), 1 );
+ }
+
protected void assertQualifiedName(String [] fromAST, String [] theTruth)
{
Index: parser/org/eclipse/cdt/core/parser/tests/QuickParseASTTests.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/QuickParseASTTests.java,v
retrieving revision 1.7
diff -u -r1.7 QuickParseASTTests.java
--- parser/org/eclipse/cdt/core/parser/tests/QuickParseASTTests.java 29 Jul 2003 14:21:02 -0000 1.7
+++ parser/org/eclipse/cdt/core/parser/tests/QuickParseASTTests.java 30 Jul 2003 01:30:45 -0000
@@ -35,8 +35,6 @@
import org.eclipse.cdt.core.parser.ast.IASTMethod;
import org.eclipse.cdt.core.parser.ast.IASTNamespaceDefinition;
import org.eclipse.cdt.core.parser.ast.IASTParameterDeclaration;
-import org.eclipse.cdt.core.parser.ast.IASTPointerToFunction;
-import org.eclipse.cdt.core.parser.ast.IASTPointerToMethod;
import org.eclipse.cdt.core.parser.ast.IASTSimpleTypeSpecifier;
import org.eclipse.cdt.core.parser.ast.IASTTemplateDeclaration;
import org.eclipse.cdt.core.parser.ast.IASTTemplateInstantiation;
@@ -433,6 +431,7 @@
parse("typedef void (boo) ( void ); ");
parse("typedef void boo (void); ");
}
+
public void testBug36769B() throws Exception {
parse("class X { operator int(); } \n");
parse("class X { operator int*(); } \n");
@@ -1495,24 +1494,22 @@
code.write( "static void * (* const orig_malloc_hook)(const char *file, int line, size_t size);\n");
Iterator declarations = parse( code.toString() ).getDeclarations();
- IASTPointerToFunction p2f = (IASTPointerToFunction)declarations.next();
- assertSimpleReturnType( p2f, IASTSimpleTypeSpecifier.Type.VOID );
- assertEquals( p2f.getName(), "name");
- assertEquals( p2f.getPointerOperator(), ASTPointerOperator.POINTER);
- Iterator parameters = p2f.getParameters();
+ IASTVariable p2f = (IASTVariable)declarations.next();
+ assertSimpleType( p2f, IASTSimpleTypeSpecifier.Type.VOID );
+ assertEquals( p2f.getName(), "name" );
+ Iterator parameters = p2f.getAbstractDeclaration().getParameters();
IASTParameterDeclaration parm = (IASTParameterDeclaration)parameters.next();
assertFalse( parameters.hasNext() );
assertParameterSimpleType( parm, IASTSimpleTypeSpecifier.Type.VOID );
assertEquals( parm.getName(), "" );
- p2f = (IASTPointerToFunction)declarations.next();
- assertSimpleReturnType( p2f, IASTSimpleTypeSpecifier.Type.VOID );
+ p2f = (IASTVariable)declarations.next();
+ assertSimpleType( p2f, IASTSimpleTypeSpecifier.Type.VOID );
assertTrue( p2f.isStatic() );
- Iterator rtPo = p2f.getReturnType().getPointerOperators();
+ Iterator rtPo = p2f.getAbstractDeclaration().getPointerOperators();
assertEquals( rtPo.next(), ASTPointerOperator.POINTER );
assertFalse( rtPo.hasNext() );
- assertEquals( p2f.getPointerOperator(), ASTPointerOperator.CONST_POINTER);
- parameters = p2f.getParameters();
+ parameters = p2f.getAbstractDeclaration().getParameters();
parm = (IASTParameterDeclaration)parameters.next();
assertParameterSimpleType( parm, IASTSimpleTypeSpecifier.Type.CHAR );
assertEquals( parm.getName(), "file" );
@@ -1529,13 +1526,12 @@
public void testBug36600() throws Exception
{
- IASTPointerToFunction p2f = (IASTPointerToFunction)parse( "enum mad_flow (*input_func)(void *, struct mad_stream *);").getDeclarations().next();
- IASTElaboratedTypeSpecifier elab = (IASTElaboratedTypeSpecifier)p2f.getReturnType().getTypeSpecifier();
+ IASTVariable p2f = (IASTVariable)parse( "enum mad_flow (*input_func)(void *, struct mad_stream *);").getDeclarations().next();
+ IASTElaboratedTypeSpecifier elab = (IASTElaboratedTypeSpecifier)p2f.getAbstractDeclaration().getTypeSpecifier();
assertEquals( elab.getName(), "mad_flow");
assertEquals( elab.getClassKind(), ASTClassKind.ENUM );
- assertEquals( p2f.getPointerOperator(), ASTPointerOperator.POINTER );
assertEquals( p2f.getName(), "input_func");
- Iterator parms = p2f.getParameters();
+ Iterator parms = p2f.getAbstractDeclaration().getParameters();
IASTParameterDeclaration parm = (IASTParameterDeclaration)parms.next();
assertEquals( parm.getName(), "" );
assertEquals( parm.getPointerOperators().next(), ASTPointerOperator.POINTER);
@@ -1635,11 +1631,11 @@
public void testPointersToMemberFunctions() throws Exception
{
- IASTPointerToMethod p2m = (IASTPointerToMethod)parse("void (A::*name)(void);").getDeclarations().next();
- assertSimpleReturnType( p2m, IASTSimpleTypeSpecifier.Type.VOID );
+ IASTVariable p2m = (IASTVariable)parse("void (A::*name)(void);").getDeclarations().next();
+ assertSimpleType( p2m, IASTSimpleTypeSpecifier.Type.VOID );
assertEquals( p2m.getName(), "A::name");
- assertEquals( p2m.getPointerOperator(), ASTPointerOperator.POINTER);
- Iterator parameters = p2m.getParameters();
+ assertEquals( p2m.getAbstractDeclaration().getPointerToFunctionOperator(), ASTPointerOperator.POINTER);
+ Iterator parameters = p2m.getAbstractDeclaration().getParameters();
IASTParameterDeclaration parm = (IASTParameterDeclaration)parameters.next();
assertFalse( parameters.hasNext() );
assertParameterSimpleType( parm, IASTSimpleTypeSpecifier.Type.VOID );
@@ -1720,5 +1716,39 @@
{
parse("signed char c = (signed char) 0xffffffff;");
assertTrue( quickParseCallback.getCompilationUnit().getDeclarations().hasNext() );
+ }
+
+ public void testIndirectDeclarators() throws Exception
+ {
+ IASTVariable v = (IASTVariable)parse( "void (*x)( int );").getDeclarations().next();
+ assertEquals( v.getName(), "x");
+ assertSimpleType( v, IASTSimpleTypeSpecifier.Type.VOID );
+ assertParameterSimpleType( (IASTParameterDeclaration)v.getAbstractDeclaration().getParameters().next(), IASTSimpleTypeSpecifier.Type.INT );
+ assertEquals( v.getAbstractDeclaration().getPointerToFunctionOperator(), ASTPointerOperator.POINTER );
+
+ v = (IASTVariable)parse( "const int * (* const something)( const int * const * const );").getDeclarations().next();
+ assertEquals( v.getName(), "something");
+ assertEquals( v.getAbstractDeclaration().getPointerToFunctionOperator(), ASTPointerOperator.CONST_POINTER);
+ assertTrue( v.getAbstractDeclaration().isConst() );
+ assertSimpleType( v, IASTSimpleTypeSpecifier.Type.INT );
+ assertEquals( v.getAbstractDeclaration().getPointerOperators().next(), ASTPointerOperator.POINTER );
+ IASTParameterDeclaration parm = (IASTParameterDeclaration)v.getAbstractDeclaration().getParameters().next();
+ assertParameterSimpleType( parm, IASTSimpleTypeSpecifier.Type.INT );
+ Iterator pointerOps = parm.getPointerOperators();
+ assertEquals( pointerOps.next(), ASTPointerOperator.CONST_POINTER );
+ assertEquals( pointerOps.next(), ASTPointerOperator.CONST_POINTER );
+ assertFalse( pointerOps.hasNext() );
+
+ IASTTypedefDeclaration typedef = (IASTTypedefDeclaration)parse( "typedef void (*life)(int);").getDeclarations().next();
+ assertEquals( typedef.getName(), "life");
+ assertSimpleType( typedef, IASTSimpleTypeSpecifier.Type.VOID );
+ assertParameterSimpleType( (IASTParameterDeclaration)typedef.getAbstractDeclarator().getParameters().next(), IASTSimpleTypeSpecifier.Type.INT );
+
+ IASTFunction f = (IASTFunction)parse( "void (f)(void);").getDeclarations().next();
+ assertEquals( f.getName(), "f");
+
+ typedef = (IASTTypedefDeclaration)parse( "typedef void (life)(int);").getDeclarations().next();
+ assertEquals( typedef.getName(), "life");
+
}
}
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.44
diff -u -r1.44 DOMBuilder.java
--- dom/org/eclipse/cdt/internal/core/dom/DOMBuilder.java 21 Jul 2003 17:29:55 -0000 1.44
+++ dom/org/eclipse/cdt/internal/core/dom/DOMBuilder.java 30 Jul 2003 01:30:24 -0000
@@ -28,8 +28,6 @@
import org.eclipse.cdt.core.parser.ast.IASTMethodReference;
import org.eclipse.cdt.core.parser.ast.IASTNamespaceDefinition;
import org.eclipse.cdt.core.parser.ast.IASTNamespaceReference;
-import org.eclipse.cdt.core.parser.ast.IASTPointerToFunction;
-import org.eclipse.cdt.core.parser.ast.IASTPointerToMethod;
import org.eclipse.cdt.core.parser.ast.IASTSimpleTypeSpecifier;
import org.eclipse.cdt.core.parser.ast.IASTTemplateDeclaration;
import org.eclipse.cdt.core.parser.ast.IASTTemplateInstantiation;
@@ -892,22 +890,11 @@
// TODO Auto-generated method stub
}
- /* (non-Javadoc)
- * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptPointerToFunction(org.eclipse.cdt.core.parser.ast.IASTPointerToFunction)
- */
- public void acceptPointerToFunction(IASTPointerToFunction function)
- {
- // TODO Auto-generated method stub
-
- }
+
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptPointerToMethod(org.eclipse.cdt.core.parser.ast.IASTPointerToMethod)
*/
- public void acceptPointerToMethod(IASTPointerToMethod method)
- {
- // TODO Auto-generated method stub
-
- }
+
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptTypedefReference(org.eclipse.cdt.core.parser.ast.IASTTypedefReference)
*/
Index: index/org/eclipse/cdt/internal/core/search/Util.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/Util.java,v
retrieving revision 1.3
diff -u -r1.3 Util.java
--- index/org/eclipse/cdt/internal/core/search/Util.java 11 Jul 2003 22:12:35 -0000 1.3
+++ index/org/eclipse/cdt/internal/core/search/Util.java 30 Jul 2003 01:30:24 -0000
@@ -318,7 +318,7 @@
} else if (existingExternalFiles.contains(externalFile)) {
return externalFile;
} else {
- //TODO: BOG do we need to add something here?
+ //TODO: BOG do we need to add something here? ANSWER YES!
/*
if (JavaModelManager.ZIP_ACCESS_VERBOSE) {
System.out.println("(" + Thread.currentThread() + ") [JavaModel.getTarget(...)] Checking existence of " + path.toString()); //$NON-NLS-1$ //$NON-NLS-2$
Index: index/org/eclipse/cdt/internal/core/search/indexing/SourceIndexerRequestor.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/indexing/SourceIndexerRequestor.java,v
retrieving revision 1.8
diff -u -r1.8 SourceIndexerRequestor.java
--- index/org/eclipse/cdt/internal/core/search/indexing/SourceIndexerRequestor.java 25 Jul 2003 15:21:57 -0000 1.8
+++ index/org/eclipse/cdt/internal/core/search/indexing/SourceIndexerRequestor.java 30 Jul 2003 01:30:24 -0000
@@ -35,8 +35,6 @@
import org.eclipse.cdt.core.parser.ast.IASTMethodReference;
import org.eclipse.cdt.core.parser.ast.IASTNamespaceDefinition;
import org.eclipse.cdt.core.parser.ast.IASTNamespaceReference;
-import org.eclipse.cdt.core.parser.ast.IASTPointerToFunction;
-import org.eclipse.cdt.core.parser.ast.IASTPointerToMethod;
import org.eclipse.cdt.core.parser.ast.IASTTemplateDeclaration;
import org.eclipse.cdt.core.parser.ast.IASTTemplateInstantiation;
import org.eclipse.cdt.core.parser.ast.IASTTemplateSpecialization;
@@ -351,20 +349,7 @@
// TODO Auto-generated method stub
}
- /* (non-Javadoc)
- * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptPointerToFunction(org.eclipse.cdt.core.parser.ast.IASTPointerToFunction)
- */
- public void acceptPointerToFunction(IASTPointerToFunction function) {
- // TODO Auto-generated method stub
-
- }
- /* (non-Javadoc)
- * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptPointerToMethod(org.eclipse.cdt.core.parser.ast.IASTPointerToMethod)
- */
- public void acceptPointerToMethod(IASTPointerToMethod method) {
- // TODO Auto-generated method stub
-
- }
+
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptTypedefReference(org.eclipse.cdt.core.parser.ast.IASTTypedefReference)
*/
Index: parser/ChangeLog
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/parser/ChangeLog,v
retrieving revision 1.91
diff -u -r1.91 ChangeLog
--- parser/ChangeLog 29 Jul 2003 14:21:07 -0000 1.91
+++ parser/ChangeLog 30 Jul 2003 01:30:26 -0000
@@ -1,3 +1,7 @@
+2003-07-29 John Camelon
+ Updated AST to better represent pointers to functions/methods.
+ Implemented typedef declaration/x-ref infrastructure.
+
2003-07-29 Victor Mozgin
Fixed PR 39546 : Parser fails on 'signed' casts.
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.8
diff -u -r1.8 ISourceElementRequestor.java
--- parser/org/eclipse/cdt/core/parser/ISourceElementRequestor.java 18 Jul 2003 16:39:22 -0000 1.8
+++ parser/org/eclipse/cdt/core/parser/ISourceElementRequestor.java 30 Jul 2003 01:30:26 -0000
@@ -28,8 +28,6 @@
import org.eclipse.cdt.core.parser.ast.IASTMethodReference;
import org.eclipse.cdt.core.parser.ast.IASTNamespaceDefinition;
import org.eclipse.cdt.core.parser.ast.IASTNamespaceReference;
-import org.eclipse.cdt.core.parser.ast.IASTPointerToFunction;
-import org.eclipse.cdt.core.parser.ast.IASTPointerToMethod;
import org.eclipse.cdt.core.parser.ast.IASTTemplateDeclaration;
import org.eclipse.cdt.core.parser.ast.IASTTemplateInstantiation;
import org.eclipse.cdt.core.parser.ast.IASTTemplateSpecialization;
@@ -95,13 +93,5 @@
public void exitInclusion( IASTInclusion inclusion );
public void exitCompilationUnit( IASTCompilationUnit compilationUnit );
- /**
- * @param function
- */
- public void acceptPointerToFunction(IASTPointerToFunction function);
-
- /**
- * @param method
- */
- public void acceptPointerToMethod(IASTPointerToMethod method);
+
}
Index: parser/org/eclipse/cdt/core/parser/ast/IASTAbstractDeclaration.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTAbstractDeclaration.java,v
retrieving revision 1.3
diff -u -r1.3 IASTAbstractDeclaration.java
--- parser/org/eclipse/cdt/core/parser/ast/IASTAbstractDeclaration.java 28 Jul 2003 20:49:46 -0000 1.3
+++ parser/org/eclipse/cdt/core/parser/ast/IASTAbstractDeclaration.java 30 Jul 2003 01:30:26 -0000
@@ -21,6 +21,7 @@
public boolean isConst();
public Iterator getPointerOperators();
public Iterator getArrayModifiers();
-
+ public Iterator getParameters();
+ public ASTPointerOperator getPointerToFunctionOperator();
}
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.18
diff -u -r1.18 IASTFactory.java
--- parser/org/eclipse/cdt/core/parser/ast/IASTFactory.java 25 Jul 2003 00:35:40 -0000 1.18
+++ parser/org/eclipse/cdt/core/parser/ast/IASTFactory.java 30 Jul 2003 01:30:26 -0000
@@ -139,7 +139,7 @@
boolean isConst,
IASTTypeSpecifier typeSpecifier,
List pointerOperators,
- List arrayModifiers);
+ List arrayModifiers, List parameters, ASTPointerOperator pointerOperator);
public IASTMethod createMethod(
IASTScope scope,
String name,
@@ -166,7 +166,7 @@
public IASTField createField( IASTScope scope, String name, boolean isAuto, IASTInitializerClause initializerClause, IASTExpression bitfieldExpression, IASTAbstractDeclaration abstractDeclaration, boolean isMutable, boolean isExtern, boolean isRegister, boolean isStatic, int startingOffset, int nameOffset, ASTAccessVisibility visibility) throws ASTSemanticException;
- public IASTParameterDeclaration createParameterDeclaration( boolean isConst, IASTTypeSpecifier getTypeSpecifier, List pointerOperators, List arrayModifiers, String parameterName, IASTInitializerClause initializerClause );
+ public IASTParameterDeclaration createParameterDeclaration( boolean isConst, IASTTypeSpecifier getTypeSpecifier, List pointerOperators, List arrayModifiers, List parameters, ASTPointerOperator pointerOp, String parameterName, IASTInitializerClause initializerClause );
public IASTTemplateDeclaration createTemplateDeclaration( IASTScope scope, List templateParameters, boolean exported, int startingOffset );
@@ -176,42 +176,8 @@
public IASTTemplateSpecialization createTemplateSpecialization(IASTScope scope, int startingOffset);
- public IASTTypedefDeclaration createTypedef( IASTScope scope, String name, IASTAbstractDeclaration mapping, int startingOffset, int nameOffset );
+ public IASTTypedefDeclaration createTypedef( IASTScope scope, String name, IASTAbstractDeclaration mapping, int startingOffset, int nameOffset ) throws ASTSemanticException;
public IASTAbstractTypeSpecifierDeclaration createTypeSpecDeclaration( IASTScope scope, IASTTypeSpecifier typeSpecifier, IASTTemplate template, int startingOffset, int endingOffset);
- public IASTPointerToFunction createPointerToFunction(
- IASTScope scope,
- String name,
- List parameters,
- IASTAbstractDeclaration returnType,
- IASTExceptionSpecification exception,
- boolean isInline,
- boolean isFriend,
- boolean isStatic,
- int startOffset,
- int nameOffset,
- IASTTemplate ownerTemplate, ASTPointerOperator pointerOperator);
-
- public IASTPointerToMethod createPointerToMethod(
- IASTScope scope,
- String name,
- List parameters,
- IASTAbstractDeclaration returnType,
- IASTExceptionSpecification exception,
- boolean isInline,
- boolean isFriend,
- boolean isStatic,
- int startOffset,
- int nameOffset,
- IASTTemplate ownerTemplate,
- boolean isConst,
- boolean isVolatile,
- boolean isConstructor,
- boolean isDestructor,
- boolean isVirtual,
- boolean isExplicit,
- boolean isPureVirtual,
- ASTAccessVisibility visibility, ASTPointerOperator pointerOperator);
-
}
Index: parser/org/eclipse/cdt/core/parser/ast/IASTPointerToFunction.java
===================================================================
RCS file: parser/org/eclipse/cdt/core/parser/ast/IASTPointerToFunction.java
diff -N parser/org/eclipse/cdt/core/parser/ast/IASTPointerToFunction.java
--- parser/org/eclipse/cdt/core/parser/ast/IASTPointerToFunction.java 18 Jul 2003 16:39:22 -0000 1.2
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,20 +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 IASTPointerToFunction extends IASTFunction, IASTPointerOperatorOwner
-{
-}
Index: parser/org/eclipse/cdt/core/parser/ast/IASTPointerToMethod.java
===================================================================
RCS file: parser/org/eclipse/cdt/core/parser/ast/IASTPointerToMethod.java
diff -N parser/org/eclipse/cdt/core/parser/ast/IASTPointerToMethod.java
--- parser/org/eclipse/cdt/core/parser/ast/IASTPointerToMethod.java 18 Jul 2003 16:39:22 -0000 1.2
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,20 +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 IASTPointerToMethod extends IASTMethod, IASTPointerOperatorOwner
-{
-}
Index: parser/org/eclipse/cdt/internal/core/parser/DeclarationWrapper.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/DeclarationWrapper.java,v
retrieving revision 1.12
diff -u -r1.12 DeclarationWrapper.java
--- parser/org/eclipse/cdt/internal/core/parser/DeclarationWrapper.java 25 Jul 2003 00:35:40 -0000 1.12
+++ parser/org/eclipse/cdt/internal/core/parser/DeclarationWrapper.java 30 Jul 2003 01:30:26 -0000
@@ -14,19 +14,16 @@
import java.util.Iterator;
import java.util.List;
-import org.eclipse.cdt.core.parser.IToken;
import org.eclipse.cdt.core.parser.ITokenDuple;
-import org.eclipse.cdt.core.parser.ast.ASTAccessVisibility;
import org.eclipse.cdt.core.parser.ast.ASTPointerOperator;
import org.eclipse.cdt.core.parser.ast.ASTSemanticException;
+import org.eclipse.cdt.core.parser.ast.IASTAbstractDeclaration;
import org.eclipse.cdt.core.parser.ast.IASTClassSpecifier;
import org.eclipse.cdt.core.parser.ast.IASTDeclaration;
import org.eclipse.cdt.core.parser.ast.IASTFactory;
import org.eclipse.cdt.core.parser.ast.IASTField;
import org.eclipse.cdt.core.parser.ast.IASTFunction;
import org.eclipse.cdt.core.parser.ast.IASTMethod;
-import org.eclipse.cdt.core.parser.ast.IASTPointerToFunction;
-import org.eclipse.cdt.core.parser.ast.IASTPointerToMethod;
import org.eclipse.cdt.core.parser.ast.IASTScope;
import org.eclipse.cdt.core.parser.ast.IASTSimpleTypeSpecifier;
import org.eclipse.cdt.core.parser.ast.IASTTemplate;
@@ -316,65 +313,115 @@
boolean isWithinClass = (getScope() instanceof IASTClassSpecifier); //TODO fix this for COMPLETE_PARSE
boolean isFunction = declarator.isFunction();
boolean hasInnerDeclarator = ( declarator.getOwnedDeclarator() != null );
-
+
if( hasInnerDeclarator )
- {
- ITokenDuple innerPointerName = declarator.getOwnedDeclarator().getPointerOperatorNameDuple();
- if( innerPointerName != null && innerPointerName.getLastToken().getType() == IToken.tCOLONCOLON )
- return createP2MethodASTNode(declarator);
- else
- return createP2FunctionASTNode( declarator );
- }
-
+ return createIndirectDeclaration( declarator );
+
if (isTypedef())
- return createTypedef(declarator);
+ return createTypedef(declarator, false);
if (isWithinClass )
{
if( isFunction)
- return createMethodASTNode(declarator);
+ return createMethodASTNode(declarator, false);
else
- return createFieldASTNode(declarator);
+ return createFieldASTNode(declarator, false );
}
else
{
if (isFunction)
- return createFunctionASTNode(declarator);
+ return createFunctionASTNode(declarator, false);
else
- return createVariableASTNode(declarator);
+ return createVariableASTNode(declarator, false);
}
}
/**
* @param declarator
* @return
*/
- private IASTTypedefDeclaration createTypedef(Declarator declarator)
+ private IASTDeclaration createIndirectDeclaration(Declarator declarator) throws ASTSemanticException
+ {
+ if( declarator.getOwnedDeclarator().getOwnedDeclarator() == null )
+ {
+
+ Declarator d = declarator.getOwnedDeclarator();
+ Iterator i = d.getPtrOps().iterator();
+ if( !i.hasNext() )
+ {
+ boolean isWithinClass = scope instanceof IASTClassSpecifier;
+ boolean isFunction = (declarator.getParameters().size() != 0);
+ if (isTypedef())
+ return createTypedef(declarator, true);
+
+ if (isWithinClass )
+ {
+ if( isFunction)
+ return createMethodASTNode(declarator, true);
+ else
+ return createFieldASTNode(declarator, true );
+ }
+ else
+ {
+ if (isFunction)
+ return createFunctionASTNode(declarator, true);
+ else
+ return createVariableASTNode(declarator, true);
+ }
+
+ }
+
+ List convertedParms = createParameterList( declarator.getParameters() );
+ IASTAbstractDeclaration abs = astFactory.createAbstractDeclaration(
+ constt, getTypeSpecifier(), declarator.getPtrOps(), declarator.getArrayModifiers(), convertedParms,
+ (ASTPointerOperator)i.next() );
+ String name = ( d.getPointerOperatorNameDuple() != null ) ? d.getPointerOperatorNameDuple().toString() + d.getName() : d.getName();
+ if( typedef )
+ return astFactory.createTypedef(
+ scope,
+ name,
+ abs, getStartingOffset(), d.getNameStartOffset() );
+ else
+ return astFactory.createVariable( scope, name, auto, d.getInitializerClause(), d.getBitFieldExpression(), abs, mutable, extern, register, staticc, getStartingOffset(), d.getNameStartOffset() );
+
+ }
+ else
+ {
+ throw new ASTSemanticException();
+ }
+
+ }
+
+ /**
+ * @param declarator
+ * @return
+ */
+ private IASTTypedefDeclaration createTypedef(Declarator declarator, boolean nested ) throws ASTSemanticException
{
return astFactory.createTypedef(
scope,
- declarator.getName(),
+ nested ? declarator.getOwnedDeclarator().getName() : declarator.getName(),
astFactory.createAbstractDeclaration(
constt,
getTypeSpecifier(),
declarator.getPtrOps(),
- declarator.getArrayModifiers()), startingOffset, declarator.getNameStartOffset());
+ declarator.getArrayModifiers(), null, null), startingOffset, declarator.getNameStartOffset());
}
/**
* @param declarator
* @return
*/
- private IASTMethod createMethodASTNode(Declarator declarator) throws ASTSemanticException
+ private IASTMethod createMethodASTNode(Declarator declarator, boolean nested) throws ASTSemanticException
{
return astFactory
.createMethod(
scope,
- declarator.getName(),
+ nested ? declarator.getOwnedDeclarator().getName() : declarator.getName(),
createParameterList(declarator.getParameters()),
astFactory.createAbstractDeclaration(
constt,
getTypeSpecifier(),
declarator.getPtrOps(),
- declarator.getArrayModifiers()),
+ declarator.getArrayModifiers(), null, null),
declarator.getExceptionSpecification(),
inline,
friend,
@@ -396,17 +443,17 @@
* @param declarator
* @return
*/
- private IASTFunction createFunctionASTNode(Declarator declarator) throws ASTSemanticException
+ private IASTFunction createFunctionASTNode(Declarator declarator, boolean nested) throws ASTSemanticException
{
return astFactory.createFunction(
scope,
- declarator.getName(),
+ nested ? declarator.getOwnedDeclarator().getName() : declarator.getName(),
createParameterList(declarator.getParameters()),
astFactory.createAbstractDeclaration(
constt,
getTypeSpecifier(),
declarator.getPtrOps(),
- declarator.getArrayModifiers()),
+ declarator.getArrayModifiers(), null, null),
declarator.getExceptionSpecification(),
inline,
friend,
@@ -419,11 +466,11 @@
* @param declarator
* @return
*/
- private IASTField createFieldASTNode(Declarator declarator) throws ASTSemanticException
+ private IASTField createFieldASTNode(Declarator declarator, boolean nested) throws ASTSemanticException
{
return astFactory.createField(
scope,
- declarator.getName(),
+ nested ? declarator.getOwnedDeclarator().getName() : declarator.getName(),
auto,
declarator.getInitializerClause(),
declarator.getBitFieldExpression(),
@@ -431,7 +478,7 @@
constt,
getTypeSpecifier(),
declarator.getPtrOps(),
- declarator.getArrayModifiers()),
+ declarator.getArrayModifiers(), null, null),
mutable,
extern,
register,
@@ -457,10 +504,10 @@
wrapper.getTypeSpecifier(),
declarator.getPtrOps(),
declarator.getArrayModifiers(),
- declarator.getName() == null
- ? ""
- : declarator.getName(),
- declarator.getInitializerClause()));
+ null,
+ null, declarator.getName() == null
+ ? ""
+ : declarator.getName(), declarator.getInitializerClause()));
}
}
return result;
@@ -469,11 +516,11 @@
* @param declarator
* @return
*/
- private IASTVariable createVariableASTNode(Declarator declarator) throws ASTSemanticException
+ private IASTVariable createVariableASTNode(Declarator declarator, boolean nested ) throws ASTSemanticException
{
return astFactory.createVariable(
scope,
- declarator.getName(),
+ nested ? declarator.getOwnedDeclarator().getName() : declarator.getName(),
isAuto(),
declarator.getInitializerClause(),
declarator.getBitFieldExpression(),
@@ -481,75 +528,14 @@
constt,
getTypeSpecifier(),
declarator.getPtrOps(),
- declarator.getArrayModifiers()),
+ declarator.getArrayModifiers(), null, null),
mutable,
extern,
register,
staticc,
getStartingOffset(),
declarator.getNameStartOffset());
- }
-
- /**
- * @param declarator
- * @return
- */
- private IASTPointerToMethod createP2MethodASTNode(Declarator declarator)
- {
-
- return astFactory
- .createPointerToMethod(
- scope,
- declarator.getOwnedDeclarator().getPointerOperatorNameDuple().toString().trim() +
- declarator.getOwnedDeclarator().getName().trim(),
- createParameterList(declarator.getParameters()),
- astFactory.createAbstractDeclaration(
- constt,
- getTypeSpecifier(),
- declarator.getPtrOps(),
- declarator.getArrayModifiers()),
- declarator.getExceptionSpecification(),
- inline,
- friend,
- staticc,
- startingOffset,
- declarator.getOwnedDeclarator().getNameStartOffset(),
- templateDeclaration,
- declarator.isConst(),
- declarator.isVolatile(),
- false,
- // isConstructor
- false, // isDestructor
- virtual,
- explicit,
- declarator.isPureVirtual(),
- ((scope instanceof IASTClassSpecifier )? ((IASTClassSpecifier)scope).getCurrentVisibilityMode() : ASTAccessVisibility.PUBLIC )
- , (ASTPointerOperator)declarator.getOwnedDeclarator().getPtrOps().get(0));
- }
- /**
- * @param declarator
- * @return
- */
- private IASTPointerToFunction createP2FunctionASTNode(Declarator declarator)
- {
- return astFactory.createPointerToFunction(
- scope,
- declarator.getOwnedDeclarator().getName(),
- createParameterList(declarator.getParameters()),
- astFactory.createAbstractDeclaration(
- constt,
- getTypeSpecifier(),
- declarator.getPtrOps(),
- declarator.getArrayModifiers()),
- declarator.getExceptionSpecification(),
- inline,
- friend,
- staticc,
- startingOffset,
- declarator.getOwnedDeclarator().getNameStartOffset(),
- templateDeclaration, (ASTPointerOperator)declarator.getOwnedDeclarator().getPtrOps().get(0));
- }
-
+ }
/* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.parser.IDeclaratorOwner#getDeclarationWrapper()
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.8
diff -u -r1.8 NullSourceElementRequestor.java
--- parser/org/eclipse/cdt/internal/core/parser/NullSourceElementRequestor.java 18 Jul 2003 16:39:22 -0000 1.8
+++ parser/org/eclipse/cdt/internal/core/parser/NullSourceElementRequestor.java 30 Jul 2003 01:30:26 -0000
@@ -20,8 +20,6 @@
import org.eclipse.cdt.core.parser.ast.IASTMethodReference;
import org.eclipse.cdt.core.parser.ast.IASTNamespaceDefinition;
import org.eclipse.cdt.core.parser.ast.IASTNamespaceReference;
-import org.eclipse.cdt.core.parser.ast.IASTPointerToFunction;
-import org.eclipse.cdt.core.parser.ast.IASTPointerToMethod;
import org.eclipse.cdt.core.parser.ast.IASTTemplateDeclaration;
import org.eclipse.cdt.core.parser.ast.IASTTemplateInstantiation;
import org.eclipse.cdt.core.parser.ast.IASTTemplateSpecialization;
@@ -333,23 +331,8 @@
}
- /* (non-Javadoc)
- * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptPointerToFunction(org.eclipse.cdt.core.parser.ast.IASTPointerToFunction)
- */
- public void acceptPointerToFunction(IASTPointerToFunction function)
- {
- // TODO Auto-generated method stub
-
- }
- /* (non-Javadoc)
- * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptPointerToMethod(org.eclipse.cdt.core.parser.ast.IASTPointerToMethod)
- */
- public void acceptPointerToMethod(IASTPointerToMethod method)
- {
- // TODO Auto-generated method stub
-
- }
+
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptTypedefReference(org.eclipse.cdt.core.parser.ast.IASTTypedefReference)
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.84
diff -u -r1.84 Parser.java
--- parser/org/eclipse/cdt/internal/core/parser/Parser.java 29 Jul 2003 14:21:07 -0000 1.84
+++ parser/org/eclipse/cdt/internal/core/parser/Parser.java 30 Jul 2003 01:30:28 -0000
@@ -595,10 +595,10 @@
wrapper.getTypeSpecifier(),
declarator.getPtrOps(),
declarator.getArrayModifiers(),
- declarator.getName() == null
- ? ""
- : declarator.getName(),
- declarator.getInitializerClause()),
+ null,
+ null, declarator.getName() == null
+ ? ""
+ : declarator.getName(), declarator.getInitializerClause()),
null));
}
}
Index: parser/org/eclipse/cdt/internal/core/parser/ast/ASTAbstractDeclaration.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/ASTAbstractDeclaration.java,v
retrieving revision 1.1
diff -u -r1.1 ASTAbstractDeclaration.java
--- parser/org/eclipse/cdt/internal/core/parser/ast/ASTAbstractDeclaration.java 22 Jul 2003 22:02:21 -0000 1.1
+++ parser/org/eclipse/cdt/internal/core/parser/ast/ASTAbstractDeclaration.java 30 Jul 2003 01:30:28 -0000
@@ -13,6 +13,7 @@
import java.util.Iterator;
import java.util.List;
+import org.eclipse.cdt.core.parser.ast.ASTPointerOperator;
import org.eclipse.cdt.core.parser.ast.IASTAbstractDeclaration;
import org.eclipse.cdt.core.parser.ast.IASTTypeSpecifier;
@@ -22,22 +23,26 @@
*/
public class ASTAbstractDeclaration implements IASTAbstractDeclaration
{
- private final boolean isConst;
+ private final List parms;
+ private final boolean isConst;
private final IASTTypeSpecifier typeSpecifier;
private final List pointerOperators;
private final List arrayModifiers;
+ private final ASTPointerOperator pointerOperator;
/**
* @param isConst
* @param typeSpecifier
* @param pointerOperators
* @param arrayModifiers
*/
- public ASTAbstractDeclaration(boolean isConst, IASTTypeSpecifier typeSpecifier, List pointerOperators, List arrayModifiers)
+ public ASTAbstractDeclaration(boolean isConst, IASTTypeSpecifier typeSpecifier, List pointerOperators, List arrayModifiers, List parameters, ASTPointerOperator pointerOp )
{
this.isConst = isConst;
this.typeSpecifier = typeSpecifier;
this.pointerOperators = pointerOperators;
- this.arrayModifiers = arrayModifiers;
+ this.arrayModifiers = arrayModifiers;
+ this.parms = parameters;
+ this.pointerOperator = pointerOp;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTAbstractDeclaration#isConst()
@@ -66,5 +71,19 @@
public Iterator getArrayModifiers()
{
return arrayModifiers.iterator();
+ }
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.parser.ast.IASTAbstractDeclaration#getParameters()
+ */
+ public Iterator getParameters()
+ {
+ return parms.iterator();
+ }
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.parser.ast.IASTAbstractDeclaration#getPointerToFunctionOperator()
+ */
+ public ASTPointerOperator getPointerToFunctionOperator()
+ {
+ return pointerOperator;
}
}
Index: parser/org/eclipse/cdt/internal/core/parser/ast/ASTParameterDeclaration.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/ASTParameterDeclaration.java,v
retrieving revision 1.1
diff -u -r1.1 ASTParameterDeclaration.java
--- parser/org/eclipse/cdt/internal/core/parser/ast/ASTParameterDeclaration.java 25 Jul 2003 00:35:40 -0000 1.1
+++ parser/org/eclipse/cdt/internal/core/parser/ast/ASTParameterDeclaration.java 30 Jul 2003 01:30:28 -0000
@@ -10,9 +10,9 @@
***********************************************************************/
package org.eclipse.cdt.internal.core.parser.ast;
-import java.util.Iterator;
import java.util.List;
+import org.eclipse.cdt.core.parser.ast.ASTPointerOperator;
import org.eclipse.cdt.core.parser.ast.IASTInitializerClause;
import org.eclipse.cdt.core.parser.ast.IASTParameterDeclaration;
import org.eclipse.cdt.core.parser.ast.IASTTypeSpecifier;
@@ -21,12 +21,9 @@
* @author jcamelon
*
*/
-public class ASTParameterDeclaration implements IASTParameterDeclaration
+public class ASTParameterDeclaration extends ASTAbstractDeclaration implements IASTParameterDeclaration
{
- private final boolean isConst;
- private final IASTTypeSpecifier typeSpecifier;
- private final List pointerOperators;
- private final List arrayModifiers;
+
private final String parameterName;
private final IASTInitializerClause initializerClause;
/**
@@ -37,12 +34,9 @@
* @param parameterName
* @param initializerClause
*/
- public ASTParameterDeclaration(boolean isConst, IASTTypeSpecifier typeSpecifier, List pointerOperators, List arrayModifiers, String parameterName, IASTInitializerClause initializerClause)
+ public ASTParameterDeclaration(boolean isConst, IASTTypeSpecifier typeSpecifier, List pointerOperators, List arrayModifiers, List parameters, ASTPointerOperator pointerOp, String parameterName, IASTInitializerClause initializerClause)
{
- this.isConst = isConst;
- this.typeSpecifier = typeSpecifier;
- this.pointerOperators = pointerOperators;
- this.arrayModifiers = arrayModifiers;
+ super( isConst, typeSpecifier, pointerOperators, arrayModifiers, parameters, pointerOp );
this.parameterName = parameterName;
this.initializerClause = initializerClause;
}
@@ -59,33 +53,5 @@
public IASTInitializerClause getDefaultValue()
{
return initializerClause;
- }
- /* (non-Javadoc)
- * @see org.eclipse.cdt.core.parser.ast.IASTAbstractDeclaration#isConst()
- */
- public boolean isConst()
- {
- return isConst;
- }
- /* (non-Javadoc)
- * @see org.eclipse.cdt.core.parser.ast.IASTAbstractDeclaration#getTypeSpecifier()
- */
- public IASTTypeSpecifier getTypeSpecifier()
- {
- return typeSpecifier;
- }
- /* (non-Javadoc)
- * @see org.eclipse.cdt.core.parser.ast.IASTAbstractDeclaration#getPointerOperators()
- */
- public Iterator getPointerOperators()
- {
- return pointerOperators.iterator();
- }
- /* (non-Javadoc)
- * @see org.eclipse.cdt.core.parser.ast.IASTAbstractDeclaration#getArrayModifiers()
- */
- public Iterator getArrayModifiers()
- {
- return arrayModifiers.iterator();
}
}
Index: parser/org/eclipse/cdt/internal/core/parser/ast/BaseASTFactory.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/BaseASTFactory.java,v
retrieving revision 1.5
diff -u -r1.5 BaseASTFactory.java
--- parser/org/eclipse/cdt/internal/core/parser/ast/BaseASTFactory.java 25 Jul 2003 00:35:40 -0000 1.5
+++ parser/org/eclipse/cdt/internal/core/parser/ast/BaseASTFactory.java 30 Jul 2003 01:30:28 -0000
@@ -12,6 +12,7 @@
import java.util.List;
+import org.eclipse.cdt.core.parser.ast.ASTPointerOperator;
import org.eclipse.cdt.core.parser.ast.IASTAbstractDeclaration;
import org.eclipse.cdt.core.parser.ast.IASTInclusion;
import org.eclipse.cdt.core.parser.ast.IASTInitializerClause;
@@ -48,14 +49,14 @@
return inclusion;
}
- public IASTAbstractDeclaration createAbstractDeclaration(boolean isConst, IASTTypeSpecifier typeSpecifier, List pointerOperators, List arrayModifiers)
+ public IASTAbstractDeclaration createAbstractDeclaration(boolean isConst, IASTTypeSpecifier typeSpecifier, List pointerOperators, List arrayModifiers, List parameters, ASTPointerOperator pointerOperator)
{
- return new ASTAbstractDeclaration( isConst, typeSpecifier, pointerOperators, arrayModifiers );
+ return new ASTAbstractDeclaration( isConst, typeSpecifier, pointerOperators, arrayModifiers, parameters, pointerOperator );
}
- public IASTParameterDeclaration createParameterDeclaration(boolean isConst, IASTTypeSpecifier typeSpecifier, List pointerOperators, List arrayModifiers, String parameterName, IASTInitializerClause initializerClause)
+ public IASTParameterDeclaration createParameterDeclaration(boolean isConst, IASTTypeSpecifier typeSpecifier, List pointerOperators, List arrayModifiers, List parameters, ASTPointerOperator pointerOp, String parameterName, IASTInitializerClause initializerClause)
{
- return new ASTParameterDeclaration( isConst, typeSpecifier, pointerOperators, arrayModifiers, parameterName, initializerClause );
+ return new ASTParameterDeclaration( isConst, typeSpecifier, pointerOperators, arrayModifiers, parameters, pointerOp, parameterName, initializerClause );
}
Index: parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTTypedef.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTTypedef.java,v
retrieving revision 1.1
diff -u -r1.1 ASTTypedef.java
--- parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTTypedef.java 24 Jul 2003 13:47:18 -0000 1.1
+++ parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTTypedef.java 30 Jul 2003 01:30:28 -0000
@@ -10,121 +10,137 @@
***********************************************************************/
package org.eclipse.cdt.internal.core.parser.ast.complete;
+import java.util.List;
+
import org.eclipse.cdt.core.parser.ISourceElementRequestor;
import org.eclipse.cdt.core.parser.ast.IASTAbstractDeclaration;
-import org.eclipse.cdt.core.parser.ast.IASTScope;
import org.eclipse.cdt.core.parser.ast.IASTTypedefDeclaration;
+import org.eclipse.cdt.internal.core.parser.ast.ASTQualifiedNamedElement;
+import org.eclipse.cdt.internal.core.parser.ast.NamedOffsets;
+import org.eclipse.cdt.internal.core.parser.pst.ISymbol;
/**
* @author jcamelon
*
*/
-public class ASTTypedef implements IASTTypedefDeclaration
+public class ASTTypedef extends ASTSymbol implements IASTTypedefDeclaration
{
+
+ private final IASTAbstractDeclaration mapping;
+ private NamedOffsets offsets = new NamedOffsets();
+ private final ASTQualifiedNamedElement qualifiedName;
+ private final ASTReferenceStore referenceStore;
+
/**
- *
- */
- public ASTTypedef()
- {
- super();
- // TODO Auto-generated constructor stub
+ * @param newSymbol
+ * @param mapping
+ * @param startingOffset
+ * @param nameOffset
+ * @param references
+ */
+ public ASTTypedef(ISymbol newSymbol, IASTAbstractDeclaration mapping, int startingOffset, int nameOffset, List references)
+ {
+ super( newSymbol );
+ this.mapping = mapping;
+ this.referenceStore = new ASTReferenceStore( references );
+ this.qualifiedName = new ASTQualifiedNamedElement( getOwnerScope(), newSymbol.getName());
+ setStartingOffset(startingOffset);
+ setNameOffset(nameOffset);
}
+
/* (non-Javadoc)
- * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#getName()
+ * @see org.eclipse.cdt.core.parser.ast.IASTTypedefDeclaration#getName()
*/
public String getName()
{
- // TODO Auto-generated method stub
- return null;
+ return getSymbol().getName();
}
+
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTTypedefDeclaration#getAbstractDeclarator()
*/
public IASTAbstractDeclaration getAbstractDeclarator()
{
- // TODO Auto-generated method stub
- return null;
- }
- /* (non-Javadoc)
- * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#getNameOffset()
- */
- public int getNameOffset()
- {
- // TODO Auto-generated method stub
- return 0;
- }
- /* (non-Javadoc)
- * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#setNameOffset(int)
- */
- public void setNameOffset(int o)
- {
- // TODO Auto-generated method stub
+ return mapping;
}
+
/* (non-Javadoc)
- * @see org.eclipse.cdt.core.parser.ast.IASTQualifiedNameElement#getFullyQualifiedName()
+ * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#acceptElement(org.eclipse.cdt.core.parser.ISourceElementRequestor)
*/
- public String[] getFullyQualifiedName()
+ public void acceptElement(ISourceElementRequestor requestor)
{
- // TODO Auto-generated method stub
- return null;
+ requestor.acceptTypedefDeclaration(this);
+ referenceStore.processReferences(requestor);
}
+
/* (non-Javadoc)
- * @see org.eclipse.cdt.core.parser.ast.IASTScopedElement#getOwnerScope()
+ * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#enterScope(org.eclipse.cdt.core.parser.ISourceElementRequestor)
*/
- public IASTScope getOwnerScope()
- {
- // TODO Auto-generated method stub
- return null;
+ public void enterScope(ISourceElementRequestor requestor)
+ {
}
+
/* (non-Javadoc)
- * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#acceptElement(org.eclipse.cdt.core.parser.ISourceElementRequestor)
+ * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#exitScope(org.eclipse.cdt.core.parser.ISourceElementRequestor)
*/
- public void acceptElement(ISourceElementRequestor requestor)
+ public void exitScope(ISourceElementRequestor requestor)
{
- // TODO Auto-generated method stub
}
+
/* (non-Javadoc)
- * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#enterScope(org.eclipse.cdt.core.parser.ISourceElementRequestor)
+ * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#getNameOffset()
*/
- public void enterScope(ISourceElementRequestor requestor)
+ public int getNameOffset()
{
- // TODO Auto-generated method stub
+ return offsets.getNameOffset();
}
+
/* (non-Javadoc)
- * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#exitScope(org.eclipse.cdt.core.parser.ISourceElementRequestor)
+ * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#setNameOffset(int)
*/
- public void exitScope(ISourceElementRequestor requestor)
+ public void setNameOffset(int o)
{
- // TODO Auto-generated method stub
+ offsets.setNameOffset(o);
}
+
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setStartingOffset(int)
*/
public void setStartingOffset(int o)
{
- // TODO Auto-generated method stub
+ offsets.setStartingOffset(o);
}
+
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setEndingOffset(int)
*/
public void setEndingOffset(int o)
{
- // TODO Auto-generated method stub
+ offsets.setEndingOffset(o);
}
+
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getStartingOffset()
*/
public int getStartingOffset()
{
- // TODO Auto-generated method stub
- return 0;
+ return offsets.getStartingOffset();
}
+
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getEndingOffset()
*/
public int getEndingOffset()
{
- // TODO Auto-generated method stub
- return 0;
+ return offsets.getEndingOffset();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.parser.ast.IASTQualifiedNameElement#getFullyQualifiedName()
+ */
+ public String[] getFullyQualifiedName()
+ {
+ return qualifiedName.getFullyQualifiedName();
}
+
}
Index: parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTTypedefReference.java
===================================================================
RCS file: parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTTypedefReference.java
diff -N parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTTypedefReference.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTTypedefReference.java 30 Jul 2003 01:30:28 -0000
@@ -0,0 +1,62 @@
+/**********************************************************************
+ * 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.complete;
+
+import org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate;
+import org.eclipse.cdt.core.parser.ISourceElementRequestor;
+import org.eclipse.cdt.core.parser.ast.IASTTypedefDeclaration;
+import org.eclipse.cdt.core.parser.ast.IASTTypedefReference;
+
+/**
+ * @author jcamelon
+ *
+ */
+public class ASTTypedefReference
+ extends ASTReference
+ implements IASTTypedefReference
+{
+ private final IASTTypedefDeclaration referencedItem;
+ /**
+ * @param offset
+ * @param name
+ */
+ public ASTTypedefReference(int offset, String name, IASTTypedefDeclaration referencedItem )
+ {
+ super(offset, name);
+ this.referencedItem = referencedItem;
+ }
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.parser.ast.IASTReference#getReferencedElement()
+ */
+ public ISourceElementCallbackDelegate getReferencedElement()
+ {
+ return referencedItem;
+ }
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#acceptElement(org.eclipse.cdt.core.parser.ISourceElementRequestor)
+ */
+ public void acceptElement(ISourceElementRequestor requestor)
+ {
+ requestor.acceptTypedefReference(this);
+ }
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#enterScope(org.eclipse.cdt.core.parser.ISourceElementRequestor)
+ */
+ public void enterScope(ISourceElementRequestor requestor)
+ {
+ }
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#exitScope(org.eclipse.cdt.core.parser.ISourceElementRequestor)
+ */
+ public void exitScope(ISourceElementRequestor requestor)
+ {
+ }
+}
Index: parser/org/eclipse/cdt/internal/core/parser/ast/complete/CompleteParseASTFactory.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/CompleteParseASTFactory.java,v
retrieving revision 1.9
diff -u -r1.9 CompleteParseASTFactory.java
--- parser/org/eclipse/cdt/internal/core/parser/ast/complete/CompleteParseASTFactory.java 28 Jul 2003 20:49:47 -0000 1.9
+++ parser/org/eclipse/cdt/internal/core/parser/ast/complete/CompleteParseASTFactory.java 30 Jul 2003 01:30:28 -0000
@@ -38,8 +38,6 @@
import org.eclipse.cdt.core.parser.ast.IASTMethod;
import org.eclipse.cdt.core.parser.ast.IASTNamespaceDefinition;
import org.eclipse.cdt.core.parser.ast.IASTParameterDeclaration;
-import org.eclipse.cdt.core.parser.ast.IASTPointerToFunction;
-import org.eclipse.cdt.core.parser.ast.IASTPointerToMethod;
import org.eclipse.cdt.core.parser.ast.IASTReference;
import org.eclipse.cdt.core.parser.ast.IASTScope;
import org.eclipse.cdt.core.parser.ast.IASTSimpleTypeSpecifier;
@@ -432,6 +430,10 @@
{
return new ASTClassReference( offset, string, (IASTClassSpecifier)symbol.getASTExtension().getPrimaryDeclaration() );
}
+ else if( symbol.getTypeInfo().checkBit( TypeInfo.isTypedef ))
+ {
+ return new ASTTypedefReference( offset, string, (IASTTypedefDeclaration)symbol.getASTExtension().getPrimaryDeclaration());
+ }
else if( symbol.getType() == TypeInfo.t_enumeration )
return new ASTEnumerationReference( offset, string, (IASTEnumerationSpecifier)symbol.getASTExtension().getPrimaryDeclaration() );
else if( symbol.getType() == TypeInfo.t_function )
@@ -1137,10 +1139,36 @@
String name,
IASTAbstractDeclaration mapping,
int startingOffset,
- int nameOffset)
+ int nameOffset) throws ASTSemanticException
{
- // TODO Auto-generated method stub
- return new ASTTypedef();
+ IContainerSymbol containerSymbol = scopeToSymbol(scope);
+ ISymbol newSymbol = pst.newSymbol( name, TypeInfo.t_type);
+ newSymbol.getTypeInfo().setBit( true,TypeInfo.isTypedef );
+
+ List references = new ArrayList();
+ if( mapping.getTypeSpecifier() instanceof ASTSimpleTypeSpecifier )
+ {
+ references.addAll( ((ASTSimpleTypeSpecifier)mapping.getTypeSpecifier()).getReferences() );
+ }
+
+ try
+ {
+ containerSymbol.addSymbol( newSymbol );
+ }
+ catch (ParserSymbolTableException e)
+ {
+ throw new ASTSemanticException();
+ }
+ ASTTypedef d = new ASTTypedef( newSymbol, mapping, startingOffset, nameOffset, references );
+ try
+ {
+ attachSymbolExtension(newSymbol, d );
+ }
+ catch (ExtensionException e1)
+ {
+ throw new ASTSemanticException();
+ }
+ return d;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTFactory#createTypeSpecDeclaration(org.eclipse.cdt.core.parser.ast.IASTScope, org.eclipse.cdt.core.parser.ast.IASTTypeSpecifier, org.eclipse.cdt.core.parser.ast.IASTTemplate, int, int)
@@ -1154,54 +1182,7 @@
{
return new ASTAbstractTypeSpecifierDeclaration( scopeToSymbol(scope), typeSpecifier, template, startingOffset, endingOffset);
}
- /* (non-Javadoc)
- * @see org.eclipse.cdt.core.parser.ast.IASTFactory#createPointerToFunction(org.eclipse.cdt.core.parser.ast.IASTScope, java.lang.String, java.util.List, org.eclipse.cdt.core.parser.ast.IASTAbstractDeclaration, org.eclipse.cdt.core.parser.ast.IASTExceptionSpecification, boolean, boolean, boolean, int, int, org.eclipse.cdt.core.parser.ast.IASTTemplate, org.eclipse.cdt.core.parser.ast.ASTPointerOperator)
- */
- public IASTPointerToFunction createPointerToFunction(
- IASTScope scope,
- String name,
- List parameters,
- IASTAbstractDeclaration returnType,
- IASTExceptionSpecification exception,
- boolean isInline,
- boolean isFriend,
- boolean isStatic,
- int startOffset,
- int nameOffset,
- IASTTemplate ownerTemplate,
- ASTPointerOperator pointerOperator)
- {
- // TODO Auto-generated method stub
- return null;
- }
- /* (non-Javadoc)
- * @see org.eclipse.cdt.core.parser.ast.IASTFactory#createPointerToMethod(org.eclipse.cdt.core.parser.ast.IASTScope, java.lang.String, java.util.List, org.eclipse.cdt.core.parser.ast.IASTAbstractDeclaration, org.eclipse.cdt.core.parser.ast.IASTExceptionSpecification, boolean, boolean, boolean, int, int, org.eclipse.cdt.core.parser.ast.IASTTemplate, boolean, boolean, boolean, boolean, boolean, boolean, boolean, org.eclipse.cdt.core.parser.ast.ASTAccessVisibility, org.eclipse.cdt.core.parser.ast.ASTPointerOperator)
- */
- public IASTPointerToMethod createPointerToMethod(
- IASTScope scope,
- String name,
- List parameters,
- IASTAbstractDeclaration returnType,
- IASTExceptionSpecification exception,
- boolean isInline,
- boolean isFriend,
- boolean isStatic,
- int startOffset,
- int nameOffset,
- IASTTemplate ownerTemplate,
- boolean isConst,
- boolean isVolatile,
- boolean isConstructor,
- boolean isDestructor,
- boolean isVirtual,
- boolean isExplicit,
- boolean isPureVirtual,
- ASTAccessVisibility visibility,
- ASTPointerOperator pointerOperator)
- {
- // TODO Auto-generated method stub
- return null;
- }
+
protected ParserSymbolTable pst = new ParserSymbolTable();
}
Index: parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTPointerToFunction.java
===================================================================
RCS file: parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTPointerToFunction.java
diff -N parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTPointerToFunction.java
--- parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTPointerToFunction.java 17 Jul 2003 20:15:13 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,72 +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.parser.ast.quick;
-
-import java.util.List;
-
-import org.eclipse.cdt.core.parser.ast.ASTPointerOperator;
-import org.eclipse.cdt.core.parser.ast.IASTAbstractDeclaration;
-import org.eclipse.cdt.core.parser.ast.IASTExceptionSpecification;
-import org.eclipse.cdt.core.parser.ast.IASTPointerToFunction;
-import org.eclipse.cdt.core.parser.ast.IASTScope;
-import org.eclipse.cdt.core.parser.ast.IASTTemplate;
-
-/**
- * @author jcamelon
- *
- */
-public class ASTPointerToFunction
- extends ASTFunction
- implements IASTPointerToFunction
-{
-
- private final ASTPointerOperator pointerOperator;
-
- /**
- * @param scope
- * @param name
- * @param parameters
- * @param returnType
- * @param exception
- * @param isInline
- * @param isFriend
- * @param isStatic
- * @param startOffset
- * @param nameOffset
- * @param ownerTemplate
- */
- public ASTPointerToFunction(IASTScope scope, String name, List parameters, IASTAbstractDeclaration returnType, IASTExceptionSpecification exception, boolean isInline, boolean isFriend, boolean isStatic, int startOffset, int nameOffset, IASTTemplate ownerTemplate, ASTPointerOperator pointerOperator)
- {
- super(
- scope,
- name,
- parameters,
- returnType,
- exception,
- isInline,
- isFriend,
- isStatic,
- startOffset,
- nameOffset,
- ownerTemplate);
- this.pointerOperator = pointerOperator;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.cdt.core.parser.ast.IASTPointerOperatorOwner#getPointerOperator()
- */
- public ASTPointerOperator getPointerOperator()
- {
- return pointerOperator;
- }
-
-
-}
Index: parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTPointerToMethod.java
===================================================================
RCS file: parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTPointerToMethod.java
diff -N parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTPointerToMethod.java
--- parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTPointerToMethod.java 17 Jul 2003 20:15:13 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,87 +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.parser.ast.quick;
-
-import java.util.List;
-
-import org.eclipse.cdt.core.parser.ast.ASTAccessVisibility;
-import org.eclipse.cdt.core.parser.ast.ASTPointerOperator;
-import org.eclipse.cdt.core.parser.ast.IASTAbstractDeclaration;
-import org.eclipse.cdt.core.parser.ast.IASTExceptionSpecification;
-import org.eclipse.cdt.core.parser.ast.IASTPointerToMethod;
-import org.eclipse.cdt.core.parser.ast.IASTScope;
-import org.eclipse.cdt.core.parser.ast.IASTTemplate;
-
-/**
- * @author jcamelon
- *
- */
-public class ASTPointerToMethod
- extends ASTMethod
- implements IASTPointerToMethod
-{
-
- private final ASTPointerOperator pointerOperator;
-
- /**
- * @param scope
- * @param name
- * @param parameters
- * @param returnType
- * @param exception
- * @param isInline
- * @param isFriend
- * @param isStatic
- * @param startOffset
- * @param nameOffset
- * @param ownerTemplate
- * @param isConst
- * @param isVolatile
- * @param isConstructor
- * @param isDestructor
- * @param isVirtual
- * @param isExplicit
- * @param isPureVirtual
- * @param visibility
- */
- public ASTPointerToMethod(IASTScope scope, String name, List parameters, IASTAbstractDeclaration returnType, IASTExceptionSpecification exception, boolean isInline, boolean isFriend, boolean isStatic, int startOffset, int nameOffset, IASTTemplate ownerTemplate, boolean isConst, boolean isVolatile, boolean isConstructor, boolean isDestructor, boolean isVirtual, boolean isExplicit, boolean isPureVirtual, ASTAccessVisibility visibility, ASTPointerOperator pointerOperator)
- {
- super(
- scope,
- name,
- parameters,
- returnType,
- exception,
- isInline,
- isFriend,
- isStatic,
- startOffset,
- nameOffset,
- ownerTemplate,
- isConst,
- isVolatile,
- isConstructor,
- isDestructor,
- isVirtual,
- isExplicit,
- isPureVirtual,
- visibility);
- this.pointerOperator = pointerOperator;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.cdt.core.parser.ast.IASTPointerOperatorOwner#getPointerOperator()
- */
- public ASTPointerOperator getPointerOperator()
- {
- return pointerOperator;
- }
-}
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.18
diff -u -r1.18 QuickParseASTFactory.java
--- parser/org/eclipse/cdt/internal/core/parser/ast/quick/QuickParseASTFactory.java 25 Jul 2003 00:35:40 -0000 1.18
+++ parser/org/eclipse/cdt/internal/core/parser/ast/quick/QuickParseASTFactory.java 30 Jul 2003 01:30:29 -0000
@@ -15,7 +15,6 @@
import org.eclipse.cdt.core.parser.ITokenDuple;
import org.eclipse.cdt.core.parser.ast.ASTAccessVisibility;
import org.eclipse.cdt.core.parser.ast.ASTClassKind;
-import org.eclipse.cdt.core.parser.ast.ASTPointerOperator;
import org.eclipse.cdt.core.parser.ast.ASTSemanticException;
import org.eclipse.cdt.core.parser.ast.IASTASMDefinition;
import org.eclipse.cdt.core.parser.ast.IASTAbstractDeclaration;
@@ -37,8 +36,6 @@
import org.eclipse.cdt.core.parser.ast.IASTMethod;
import org.eclipse.cdt.core.parser.ast.IASTNamespaceDefinition;
import org.eclipse.cdt.core.parser.ast.IASTParameterDeclaration;
-import org.eclipse.cdt.core.parser.ast.IASTPointerToFunction;
-import org.eclipse.cdt.core.parser.ast.IASTPointerToMethod;
import org.eclipse.cdt.core.parser.ast.IASTScope;
import org.eclipse.cdt.core.parser.ast.IASTSimpleTypeSpecifier;
import org.eclipse.cdt.core.parser.ast.IASTTemplate;
@@ -288,19 +285,5 @@
return new ASTAbstractTypeSpecifierDeclaration( scope, typeSpecifier, template, startingOffset, endingOffset );
}
- /* (non-Javadoc)
- * @see org.eclipse.cdt.core.parser.ast.IASTFactory#createPointerToFunction(org.eclipse.cdt.core.parser.ast.IASTScope, java.lang.String, java.util.List, org.eclipse.cdt.core.parser.ast.IASTAbstractDeclaration, org.eclipse.cdt.core.parser.ast.IASTExceptionSpecification, boolean, boolean, boolean, int, int, org.eclipse.cdt.core.parser.ast.IASTTemplate)
- */
- public IASTPointerToFunction createPointerToFunction(IASTScope scope, String name, List parameters, IASTAbstractDeclaration returnType, IASTExceptionSpecification exception, boolean isInline, boolean isFriend, boolean isStatic, int startOffset, int nameOffset, IASTTemplate ownerTemplate, ASTPointerOperator pointerOperator)
- {
- return new ASTPointerToFunction( scope, name, parameters, returnType, exception, isInline, isFriend, isStatic, startOffset, nameOffset, ownerTemplate, pointerOperator);
- }
- /* (non-Javadoc)
- * @see org.eclipse.cdt.core.parser.ast.IASTFactory#createPointerToMethod(org.eclipse.cdt.core.parser.ast.IASTScope, java.lang.String, java.util.List, org.eclipse.cdt.core.parser.ast.IASTAbstractDeclaration, org.eclipse.cdt.core.parser.ast.IASTExceptionSpecification, boolean, boolean, boolean, int, int, org.eclipse.cdt.core.parser.ast.IASTTemplate, boolean, boolean, boolean, boolean, boolean, boolean, boolean, org.eclipse.cdt.core.parser.ast.ASTAccessVisibility)
- */
- public IASTPointerToMethod createPointerToMethod(IASTScope scope, String name, List parameters, IASTAbstractDeclaration returnType, IASTExceptionSpecification exception, boolean isInline, boolean isFriend, boolean isStatic, int startOffset, int nameOffset, IASTTemplate ownerTemplate, boolean isConst, boolean isVolatile, boolean isConstructor, boolean isDestructor, boolean isVirtual, boolean isExplicit, boolean isPureVirtual, ASTAccessVisibility visibility, ASTPointerOperator pointerOperator)
- {
- return new ASTPointerToMethod(scope, name, parameters, returnType, exception, isInline, isFriend, isStatic, startOffset, nameOffset, ownerTemplate, isConst, isVolatile, isConstructor, isDestructor, isVirtual, isExplicit, isPureVirtual, visibility, pointerOperator);
- }
}
Index: search/org/eclipse/cdt/internal/core/search/matching/MatchLocator.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/matching/MatchLocator.java,v
retrieving revision 1.14
diff -u -r1.14 MatchLocator.java
--- search/org/eclipse/cdt/internal/core/search/matching/MatchLocator.java 29 Jul 2003 22:47:57 -0000 1.14
+++ search/org/eclipse/cdt/internal/core/search/matching/MatchLocator.java 30 Jul 2003 01:30:29 -0000
@@ -75,8 +75,6 @@
public void acceptTypedefDeclaration(IASTTypedefDeclaration typedef) { }
public void acceptAbstractTypeSpecDeclaration(IASTAbstractTypeSpecifierDeclaration abstractDeclaration) {}
- public void acceptPointerToFunction(IASTPointerToFunction function) {}
- public void acceptPointerToMethod(IASTPointerToMethod method) { }
public void acceptTypedefReference( IASTTypedefReference reference ) { }
public void enterLinkageSpecification(IASTLinkageSpecification linkageSpec) { }