[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
[cdt-patch] Applied [HEAD ] Further parser updates
|
JohnCIndex: ChangeLog
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core.tests/ChangeLog,v
retrieving revision 1.16
diff -u -r1.16 ChangeLog
--- ChangeLog 4 Jul 2003 18:36:47 -0000 1.16
+++ ChangeLog 7 Jul 2003 13:45:03 -0000
@@ -1,3 +1,6 @@
+2003-07-07 John Camelon
+ Update ClassDeclarationPatternTests::testBug39652().
+
2003-07-04 John Camelon
Moved testBug39652() from failed search tests to ClassDeclarationPatternTests.
Index: parser/org/eclipse/cdt/core/parser/tests/ParserSymbolTableTest.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ParserSymbolTableTest.java,v
retrieving revision 1.3
diff -u -r1.3 ParserSymbolTableTest.java
--- parser/org/eclipse/cdt/core/parser/tests/ParserSymbolTableTest.java 24 Jun 2003 20:18:16 -0000 1.3
+++ parser/org/eclipse/cdt/core/parser/tests/ParserSymbolTableTest.java 7 Jul 2003 13:45:04 -0000
@@ -17,7 +17,7 @@
import junit.framework.TestCase;
-import org.eclipse.cdt.core.parser.ast.AccessVisibility;
+import org.eclipse.cdt.core.parser.ast.ASTAccessVisibility;
import org.eclipse.cdt.internal.core.parser.ast.full.ASTCompilationUnit;
import org.eclipse.cdt.internal.core.parser.ast.full.IASTFCompilationUnit;
import org.eclipse.cdt.internal.core.parser.pst.IContainerSymbol;
@@ -266,10 +266,10 @@
IDerivableContainerSymbol c = table.newDerivableContainerSymbol("C");
IDerivableContainerSymbol a = table.newDerivableContainerSymbol("A");
- a.addParent( c, true, AccessVisibility.PUBLIC );
+ a.addParent( c, true, ASTAccessVisibility.PUBLIC );
IDerivableContainerSymbol b = table.newDerivableContainerSymbol("B");
- b.addParent( c, true, AccessVisibility.PUBLIC );
+ b.addParent( c, true, ASTAccessVisibility.PUBLIC );
decl.addParent( a );
decl.addParent( b );
Index: search/org/eclipse/cdt/core/search/tests/ClassDeclarationPatternTests.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core.tests/search/org/eclipse/cdt/core/search/tests/ClassDeclarationPatternTests.java,v
retrieving revision 1.2
diff -u -r1.2 ClassDeclarationPatternTests.java
--- search/org/eclipse/cdt/core/search/tests/ClassDeclarationPatternTests.java 4 Jul 2003 18:03:22 -0000 1.2
+++ search/org/eclipse/cdt/core/search/tests/ClassDeclarationPatternTests.java 7 Jul 2003 13:45:04 -0000
@@ -96,13 +96,13 @@
initialize( pattern );
matchLocator.locateMatches( new String[] { cppPath }, null, null );
matches = resultCollector.getMatches();
- assertTrue( matches == null );
+ assertTrue( matches != null );
pattern = CSearchPattern.createPattern( "NS::B::A", TYPE, DECLARATIONS, EXACT_MATCH, true );
initialize( pattern );
matchLocator.locateMatches( new String[] { cppPath }, null, null );
matches = resultCollector.getMatches();
- assertTrue( matches == null );
+ assertTrue( matches != null );
}
public void failingtestMatchStruct(){
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.39
diff -u -r1.39 DOMBuilder.java
--- dom/org/eclipse/cdt/internal/core/dom/DOMBuilder.java 30 Jun 2003 22:08:38 -0000 1.39
+++ dom/org/eclipse/cdt/internal/core/dom/DOMBuilder.java 7 Jul 2003 13:43:07 -0000
@@ -9,7 +9,6 @@
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.IASTElaboratedTypeSpecifier;
import org.eclipse.cdt.core.parser.ast.IASTEnumerationSpecifier;
import org.eclipse.cdt.core.parser.ast.IASTField;
@@ -1178,13 +1177,6 @@
}
- /* (non-Javadoc)
- * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptConstructor(org.eclipse.cdt.core.parser.ast.IASTConstructor)
- */
- public void acceptConstructor(IASTConstructor constructor) {
- // TODO Auto-generated method stub
-
- }
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ISourceElementRequestor#exitTemplateDeclaration(org.eclipse.cdt.core.parser.ast.IASTTemplateDeclaration)
Index: index/org/eclipse/cdt/internal/core/search/indexing/AbstractIndexer.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/indexing/AbstractIndexer.java,v
retrieving revision 1.2
diff -u -r1.2 AbstractIndexer.java
--- index/org/eclipse/cdt/internal/core/search/indexing/AbstractIndexer.java 4 Jul 2003 03:02:07 -0000 1.2
+++ index/org/eclipse/cdt/internal/core/search/indexing/AbstractIndexer.java 7 Jul 2003 13:43:07 -0000
@@ -13,7 +13,7 @@
import java.io.IOException;
-import org.eclipse.cdt.core.parser.ast.ClassKind;
+import org.eclipse.cdt.core.parser.ast.ASTClassKind;
import org.eclipse.cdt.core.parser.ast.IASTClassSpecifier;
import org.eclipse.cdt.core.search.ICSearchConstants;
import org.eclipse.cdt.internal.core.index.IDocument;
@@ -33,15 +33,15 @@
}
public void addClassSpecifier(IASTClassSpecifier classSpecification){
- if (classSpecification.getClassKind().equals(ClassKind.CLASS))
+ if (classSpecification.getClassKind().equals(ASTClassKind.CLASS))
{
this.output.addRef(encodeTypeEntry(classSpecification.getName().toCharArray(),CLASS));
}
- else if (classSpecification.getClassKind().equals(ClassKind.STRUCT))
+ else if (classSpecification.getClassKind().equals(ASTClassKind.STRUCT))
{
this.output.addRef(encodeTypeEntry(classSpecification.getName().toCharArray(),STRUCT));
}
- else if (classSpecification.getClassKind().equals(ClassKind.UNION))
+ else if (classSpecification.getClassKind().equals(ASTClassKind.UNION))
{
this.output.addRef(encodeTypeEntry(classSpecification.getName().toCharArray(),UNION));
}
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.2
diff -u -r1.2 SourceIndexerRequestor.java
--- index/org/eclipse/cdt/internal/core/search/indexing/SourceIndexerRequestor.java 4 Jul 2003 03:02:07 -0000 1.2
+++ index/org/eclipse/cdt/internal/core/search/indexing/SourceIndexerRequestor.java 7 Jul 2003 13:43:07 -0000
@@ -23,7 +23,6 @@
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.IASTElaboratedTypeSpecifier;
import org.eclipse.cdt.core.parser.ast.IASTEnumerationSpecifier;
import org.eclipse.cdt.core.parser.ast.IASTField;
@@ -252,14 +251,6 @@
public void acceptField(IASTField field) {
// TODO Auto-generated method stub
//System.out.println("acceptField");
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptConstructor(org.eclipse.cdt.core.parser.ast.IASTConstructor)
- */
- public void acceptConstructor(IASTConstructor constructor) {
- // TODO Auto-generated method stub
- //System.out.println("acceptConstructor");
}
/* (non-Javadoc)
Index: parser/ChangeLog
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/parser/ChangeLog,v
retrieving revision 1.73
diff -u -r1.73 ChangeLog
--- parser/ChangeLog 4 Jul 2003 18:03:21 -0000 1.73
+++ parser/ChangeLog 7 Jul 2003 13:43:08 -0000
@@ -1,3 +1,7 @@
+2003-07-07 John Camelon
+ Bug 39652 - AST: Nested Classes incorrectly report null qualified Names
+ Fuller specification of Field/Method interfaces.
+
2003-07-04 John Camelon
Fixed NPE in Parser::declarator().
Bug 39652 - AST: Nested Classes incorrectly report null qualified Names
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.4
diff -u -r1.4 ISourceElementRequestor.java
--- parser/org/eclipse/cdt/core/parser/ISourceElementRequestor.java 24 Jun 2003 20:18:11 -0000 1.4
+++ parser/org/eclipse/cdt/core/parser/ISourceElementRequestor.java 7 Jul 2003 13:43:08 -0000
@@ -13,7 +13,6 @@
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.IASTElaboratedTypeSpecifier;
import org.eclipse.cdt.core.parser.ast.IASTEnumerationSpecifier;
import org.eclipse.cdt.core.parser.ast.IASTField;
@@ -65,7 +64,6 @@
public void enterMethodBody( IASTMethod method );
public void exitMethodBody( IASTMethod method );
public void acceptField( IASTField field );
- public void acceptConstructor( IASTConstructor constructor );
public void acceptClassReference( IASTClassSpecifier classSpecifier, int referenceOffset );
Index: parser/org/eclipse/cdt/core/parser/ast/ASTAccessVisibility.java
===================================================================
RCS file: parser/org/eclipse/cdt/core/parser/ast/ASTAccessVisibility.java
diff -N parser/org/eclipse/cdt/core/parser/ast/ASTAccessVisibility.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ parser/org/eclipse/cdt/core/parser/ast/ASTAccessVisibility.java 7 Jul 2003 13:43:08 -0000
@@ -0,0 +1,30 @@
+/**********************************************************************
+ * 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;
+
+import org.eclipse.cdt.core.parser.Enum;
+
+/**
+ * @author jcamelon
+ *
+ */
+public class ASTAccessVisibility extends Enum {
+
+ public static final ASTAccessVisibility PUBLIC = new ASTAccessVisibility( 1 );
+ public static final ASTAccessVisibility PROTECTED = new ASTAccessVisibility( 2 );
+ public static final ASTAccessVisibility PRIVATE = new ASTAccessVisibility( 3 );
+
+ private ASTAccessVisibility( int constant)
+ {
+ super( constant );
+ }
+
+}
Index: parser/org/eclipse/cdt/core/parser/ast/ASTClassKind.java
===================================================================
RCS file: parser/org/eclipse/cdt/core/parser/ast/ASTClassKind.java
diff -N parser/org/eclipse/cdt/core/parser/ast/ASTClassKind.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ parser/org/eclipse/cdt/core/parser/ast/ASTClassKind.java 7 Jul 2003 13:43:08 -0000
@@ -0,0 +1,31 @@
+/**********************************************************************
+ * 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;
+
+import org.eclipse.cdt.core.parser.Enum;
+
+/**
+ * @author jcamelon
+ *
+ */
+public class ASTClassKind extends Enum {
+
+ public final static ASTClassKind CLASS = new ASTClassKind( 1 );
+ public final static ASTClassKind STRUCT = new ASTClassKind( 2 );
+ public final static ASTClassKind UNION = new ASTClassKind( 3 );
+ public final static ASTClassKind ENUM = new ASTClassKind( 4 );
+
+ private ASTClassKind( int value )
+ {
+ super( value );
+ }
+
+}
Index: parser/org/eclipse/cdt/core/parser/ast/ASTPointerOperator.java
===================================================================
RCS file: parser/org/eclipse/cdt/core/parser/ast/ASTPointerOperator.java
diff -N parser/org/eclipse/cdt/core/parser/ast/ASTPointerOperator.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ parser/org/eclipse/cdt/core/parser/ast/ASTPointerOperator.java 7 Jul 2003 13:43:08 -0000
@@ -0,0 +1,37 @@
+/**********************************************************************
+ * 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;
+
+import org.eclipse.cdt.core.parser.Enum;
+
+/**
+ * @author jcamelon
+ *
+ */
+public class ASTPointerOperator extends Enum
+{
+ public static final ASTPointerOperator REFERENCE = new ASTPointerOperator( 0 );
+ public static final ASTPointerOperator POINTER = new ASTPointerOperator( 1 );
+ public static final ASTPointerOperator CONST_POINTER = new ASTPointerOperator( 2 );
+ public static final ASTPointerOperator VOLATILE_POINTER = new ASTPointerOperator( 3 );
+ public static final ASTPointerOperator POINTER_TO_FUNCTION = new ASTPointerOperator( 4 );
+ public static final ASTPointerOperator CONST_POINTER_TO_FUNCTION = new ASTPointerOperator( 5 );
+ public static final ASTPointerOperator VOLATILE_POINTER_TO_FUNCTION = new ASTPointerOperator( 6 );
+
+
+ /**
+ * @param enumValue
+ */
+ protected ASTPointerOperator(int enumValue)
+ {
+ super(enumValue);
+ }
+}
Index: parser/org/eclipse/cdt/core/parser/ast/ASTTemplateDeclarationType.java
===================================================================
RCS file: parser/org/eclipse/cdt/core/parser/ast/ASTTemplateDeclarationType.java
diff -N parser/org/eclipse/cdt/core/parser/ast/ASTTemplateDeclarationType.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ parser/org/eclipse/cdt/core/parser/ast/ASTTemplateDeclarationType.java 7 Jul 2003 13:43:08 -0000
@@ -0,0 +1,32 @@
+/**********************************************************************
+ * 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;
+
+import org.eclipse.cdt.core.parser.Enum;
+
+/**
+ * @author jcamelon
+ *
+ */
+public class ASTTemplateDeclarationType extends Enum {
+
+ public static final ASTTemplateDeclarationType CLASS = new ASTTemplateDeclarationType(1);
+ public static final ASTTemplateDeclarationType FUNCTION = new ASTTemplateDeclarationType( 2 );
+ public static final ASTTemplateDeclarationType MEMBERCLASS = new ASTTemplateDeclarationType( 3 );
+ public static final ASTTemplateDeclarationType METHOD = new ASTTemplateDeclarationType( 4 );
+ public static final ASTTemplateDeclarationType FIELD = new ASTTemplateDeclarationType( 5 );
+
+ private ASTTemplateDeclarationType( int t )
+ {
+ super( t );
+ }
+
+}
Index: parser/org/eclipse/cdt/core/parser/ast/AccessVisibility.java
===================================================================
RCS file: parser/org/eclipse/cdt/core/parser/ast/AccessVisibility.java
diff -N parser/org/eclipse/cdt/core/parser/ast/AccessVisibility.java
--- parser/org/eclipse/cdt/core/parser/ast/AccessVisibility.java 27 Jun 2003 00:20:07 -0000 1.4
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,30 +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;
-
-import org.eclipse.cdt.core.parser.Enum;
-
-/**
- * @author jcamelon
- *
- */
-public class AccessVisibility extends Enum {
-
- public static final AccessVisibility PUBLIC = new AccessVisibility( 1 );
- public static final AccessVisibility PROTECTED = new AccessVisibility( 2 );
- public static final AccessVisibility PRIVATE = new AccessVisibility( 3 );
-
- private AccessVisibility( int constant)
- {
- super( constant );
- }
-
-}
Index: parser/org/eclipse/cdt/core/parser/ast/ClassKind.java
===================================================================
RCS file: parser/org/eclipse/cdt/core/parser/ast/ClassKind.java
diff -N parser/org/eclipse/cdt/core/parser/ast/ClassKind.java
--- parser/org/eclipse/cdt/core/parser/ast/ClassKind.java 27 Jun 2003 00:20:07 -0000 1.4
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,31 +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;
-
-import org.eclipse.cdt.core.parser.Enum;
-
-/**
- * @author jcamelon
- *
- */
-public class ClassKind extends Enum {
-
- public final static ClassKind CLASS = new ClassKind( 1 );
- public final static ClassKind STRUCT = new ClassKind( 2 );
- public final static ClassKind UNION = new ClassKind( 3 );
- public final static ClassKind ENUM = new ClassKind( 4 );
-
- private ClassKind( int value )
- {
- super( value );
- }
-
-}
Index: parser/org/eclipse/cdt/core/parser/ast/IASTAbstractDeclarator.java
===================================================================
RCS file: parser/org/eclipse/cdt/core/parser/ast/IASTAbstractDeclarator.java
diff -N parser/org/eclipse/cdt/core/parser/ast/IASTAbstractDeclarator.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ parser/org/eclipse/cdt/core/parser/ast/IASTAbstractDeclarator.java 7 Jul 2003 13:43:08 -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.core.parser.ast;
+
+import java.util.List;
+
+/**
+ * @author jcamelon
+ *
+ */
+public interface IASTAbstractDeclarator
+{
+ public IASTTypeSpecifier getTypeSpecifier();
+ public List getPointerOperators();
+}
Index: parser/org/eclipse/cdt/core/parser/ast/IASTBaseSpecifier.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTBaseSpecifier.java,v
retrieving revision 1.2
diff -u -r1.2 IASTBaseSpecifier.java
--- parser/org/eclipse/cdt/core/parser/ast/IASTBaseSpecifier.java 13 Jun 2003 15:01:22 -0000 1.2
+++ parser/org/eclipse/cdt/core/parser/ast/IASTBaseSpecifier.java 7 Jul 2003 13:43:08 -0000
@@ -17,7 +17,7 @@
*/
public interface IASTBaseSpecifier {
- public AccessVisibility getAccess();
+ public ASTAccessVisibility getAccess();
public boolean isVirtual();
public IASTClassSpecifier getParent();
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.6
diff -u -r1.6 IASTClassSpecifier.java
--- parser/org/eclipse/cdt/core/parser/ast/IASTClassSpecifier.java 27 Jun 2003 00:20:07 -0000 1.6
+++ parser/org/eclipse/cdt/core/parser/ast/IASTClassSpecifier.java 7 Jul 2003 13:43:08 -0000
@@ -18,7 +18,7 @@
* @author jcamelon
*
*/
-public interface IASTClassSpecifier extends IASTTypeSpecifier, IASTScope, IASTOffsetableNamedElement, IASTTemplatedDeclaration {
+public interface IASTClassSpecifier extends IASTTypeSpecifier, IASTScope, IASTOffsetableNamedElement, IASTTemplatedDeclaration, IASTQualifiedNameElement {
public class ClassNameType extends Enum {
@@ -33,12 +33,10 @@
public ClassNameType getClassNameType();
- public ClassKind getClassKind();
+ public ASTClassKind getClassKind();
public Iterator getBaseClauses();
- public AccessVisibility getCurrentVisibilityMode();
-
- public String[] getFullyQualifiedName();
+ public ASTAccessVisibility getCurrentVisibilityMode();
}
Index: parser/org/eclipse/cdt/core/parser/ast/IASTConstructor.java
===================================================================
RCS file: parser/org/eclipse/cdt/core/parser/ast/IASTConstructor.java
diff -N parser/org/eclipse/cdt/core/parser/ast/IASTConstructor.java
--- parser/org/eclipse/cdt/core/parser/ast/IASTConstructor.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 IASTConstructor {
-
-}
Index: parser/org/eclipse/cdt/core/parser/ast/IASTElaboratedTypeSpecifier.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTElaboratedTypeSpecifier.java,v
retrieving revision 1.2
diff -u -r1.2 IASTElaboratedTypeSpecifier.java
--- parser/org/eclipse/cdt/core/parser/ast/IASTElaboratedTypeSpecifier.java 24 Jun 2003 20:18:11 -0000 1.2
+++ parser/org/eclipse/cdt/core/parser/ast/IASTElaboratedTypeSpecifier.java 7 Jul 2003 13:43:08 -0000
@@ -18,6 +18,6 @@
public interface IASTElaboratedTypeSpecifier extends IASTTypeSpecifier, IASTOffsetableElement {
public String getTypeName();
- public ClassKind getClassKind();
+ public ASTClassKind getClassKind();
}
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.7
diff -u -r1.7 IASTFactory.java
--- parser/org/eclipse/cdt/core/parser/ast/IASTFactory.java 30 Jun 2003 22:08:38 -0000 1.7
+++ parser/org/eclipse/cdt/core/parser/ast/IASTFactory.java 7 Jul 2003 13:43:08 -0000
@@ -16,7 +16,7 @@
import org.eclipse.cdt.core.parser.ITokenDuple;
import org.eclipse.cdt.core.parser.ast.IASTClassSpecifier.ClassNameType;
import org.eclipse.cdt.core.parser.ast.IASTExpression.IASTNewExpressionDescriptor;
-import org.eclipse.cdt.internal.core.parser.IASTArrayModifier;
+import org.eclipse.cdt.internal.core.parser.ast.IASTArrayModifier;
/**
* @author jcamelon
@@ -55,9 +55,9 @@
public IASTClassSpecifier createClassSpecifier( IASTScope scope,
String name,
- ClassKind kind,
+ ASTClassKind kind,
ClassNameType type,
- AccessVisibility access,
+ ASTAccessVisibility access,
IASTTemplateDeclaration ownerTemplateDeclaration, int startingOffset, int nameOffset );
/**
@@ -66,9 +66,9 @@
* @param visibility
* @param string
*/
- public void addBaseSpecifier(IASTClassSpecifier astClassSpec, boolean isVirtual, AccessVisibility visibility, String string);
+ public void addBaseSpecifier(IASTClassSpecifier astClassSpec, boolean isVirtual, ASTAccessVisibility visibility, String string);
- public IASTElaboratedTypeSpecifier createElaboratedTypeSpecifier(ClassKind elaboratedClassKind, String typeName, int startingOffset, int endOffset );
+ public IASTElaboratedTypeSpecifier createElaboratedTypeSpecifier(ASTClassKind elaboratedClassKind, String typeName, int startingOffset, int endOffset );
public IASTEnumerationSpecifier createEnumerationSpecifier(String name, int startingOffset, int nameOffset );
public void addEnumerator(IASTEnumerationSpecifier enumeration, String string, int startingOffset, int endingOffset);
Index: parser/org/eclipse/cdt/core/parser/ast/IASTField.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTField.java,v
retrieving revision 1.2
diff -u -r1.2 IASTField.java
--- parser/org/eclipse/cdt/core/parser/ast/IASTField.java 13 Jun 2003 15:01:22 -0000 1.2
+++ parser/org/eclipse/cdt/core/parser/ast/IASTField.java 7 Jul 2003 13:43:08 -0000
@@ -14,6 +14,6 @@
* @author jcamelon
*
*/
-public interface IASTField {
+public interface IASTField extends IASTVariable {
}
Index: parser/org/eclipse/cdt/core/parser/ast/IASTFunction.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTFunction.java,v
retrieving revision 1.2
diff -u -r1.2 IASTFunction.java
--- parser/org/eclipse/cdt/core/parser/ast/IASTFunction.java 13 Jun 2003 15:01:22 -0000 1.2
+++ parser/org/eclipse/cdt/core/parser/ast/IASTFunction.java 7 Jul 2003 13:43:08 -0000
@@ -15,5 +15,11 @@
*
*/
public interface IASTFunction {
+
+ public boolean isInline();
+ public boolean isFriend();
+ public boolean isStatic();
+
+ public IASTAbstractDeclarator getReturnType();
}
Index: parser/org/eclipse/cdt/core/parser/ast/IASTMethod.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTMethod.java,v
retrieving revision 1.2
diff -u -r1.2 IASTMethod.java
--- parser/org/eclipse/cdt/core/parser/ast/IASTMethod.java 13 Jun 2003 15:01:22 -0000 1.2
+++ parser/org/eclipse/cdt/core/parser/ast/IASTMethod.java 7 Jul 2003 13:43:08 -0000
@@ -14,6 +14,12 @@
* @author jcamelon
*
*/
-public interface IASTMethod {
+public interface IASTMethod extends IASTFunction {
+ public boolean isVirtual();
+ public boolean isExplicit();
+
+ public boolean isConstructor();
+ public boolean isDestructor();
+
}
Index: parser/org/eclipse/cdt/core/parser/ast/IASTNamespaceDefinition.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTNamespaceDefinition.java,v
retrieving revision 1.2
diff -u -r1.2 IASTNamespaceDefinition.java
--- parser/org/eclipse/cdt/core/parser/ast/IASTNamespaceDefinition.java 13 Jun 2003 15:01:22 -0000 1.2
+++ parser/org/eclipse/cdt/core/parser/ast/IASTNamespaceDefinition.java 7 Jul 2003 13:43:08 -0000
@@ -14,6 +14,6 @@
* @author jcamelon
*
*/
-public interface IASTNamespaceDefinition extends IASTOffsetableNamedElement, IASTScope, IASTDeclaration {
+public interface IASTNamespaceDefinition extends IASTOffsetableNamedElement, IASTScope, IASTDeclaration, IASTQualifiedNameElement {
}
Index: parser/org/eclipse/cdt/core/parser/ast/IASTQualifiedNameElement.java
===================================================================
RCS file: parser/org/eclipse/cdt/core/parser/ast/IASTQualifiedNameElement.java
diff -N parser/org/eclipse/cdt/core/parser/ast/IASTQualifiedNameElement.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ parser/org/eclipse/cdt/core/parser/ast/IASTQualifiedNameElement.java 7 Jul 2003 13:43:08 -0000
@@ -0,0 +1,20 @@
+/**********************************************************************
+ * 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 IASTQualifiedNameElement
+{
+ public String[] getFullyQualifiedName();
+}
Index: parser/org/eclipse/cdt/core/parser/ast/IASTTemplateDeclaration.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTTemplateDeclaration.java,v
retrieving revision 1.2
diff -u -r1.2 IASTTemplateDeclaration.java
--- parser/org/eclipse/cdt/core/parser/ast/IASTTemplateDeclaration.java 13 Jun 2003 15:01:22 -0000 1.2
+++ parser/org/eclipse/cdt/core/parser/ast/IASTTemplateDeclaration.java 7 Jul 2003 13:43:08 -0000
@@ -18,7 +18,7 @@
*/
public interface IASTTemplateDeclaration {
- public TemplateDeclarationType getTemplateDeclarationType();
+ public ASTTemplateDeclarationType getTemplateDeclarationType();
public Iterator getTemplateParameters();
}
Index: parser/org/eclipse/cdt/core/parser/ast/IASTTemplateInstantiation.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTTemplateInstantiation.java,v
retrieving revision 1.2
diff -u -r1.2 IASTTemplateInstantiation.java
--- parser/org/eclipse/cdt/core/parser/ast/IASTTemplateInstantiation.java 13 Jun 2003 15:01:22 -0000 1.2
+++ parser/org/eclipse/cdt/core/parser/ast/IASTTemplateInstantiation.java 7 Jul 2003 13:43:08 -0000
@@ -16,6 +16,6 @@
*/
public interface IASTTemplateInstantiation {
- public TemplateDeclarationType getTemplateDeclarationType();
+ public ASTTemplateDeclarationType getTemplateDeclarationType();
public IASTTemplateDeclaration getTemplateDeclaration();
}
Index: parser/org/eclipse/cdt/core/parser/ast/IASTTemplateSpecialization.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTTemplateSpecialization.java,v
retrieving revision 1.2
diff -u -r1.2 IASTTemplateSpecialization.java
--- parser/org/eclipse/cdt/core/parser/ast/IASTTemplateSpecialization.java 13 Jun 2003 15:01:22 -0000 1.2
+++ parser/org/eclipse/cdt/core/parser/ast/IASTTemplateSpecialization.java 7 Jul 2003 13:43:08 -0000
@@ -16,6 +16,6 @@
*/
public interface IASTTemplateSpecialization {
- public TemplateDeclarationType getTemplateDeclarationType();
+ public ASTTemplateDeclarationType getTemplateDeclarationType();
public IASTTemplateDeclaration getTemplateDeclaration();
}
Index: parser/org/eclipse/cdt/core/parser/ast/IASTVariable.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTVariable.java,v
retrieving revision 1.2
diff -u -r1.2 IASTVariable.java
--- parser/org/eclipse/cdt/core/parser/ast/IASTVariable.java 13 Jun 2003 15:01:22 -0000 1.2
+++ parser/org/eclipse/cdt/core/parser/ast/IASTVariable.java 7 Jul 2003 13:43:08 -0000
@@ -16,4 +16,13 @@
*/
public interface IASTVariable {
+ public boolean isAuto();
+ public boolean isRegister();
+ public boolean isStatic();
+ public boolean isExtern();
+ public boolean isMutable();
+
+ public IASTAbstractDeclarator getAbstractDeclaration();
+ public String getName();
+ public IASTInitializerClause getInitializerClause();
}
Index: parser/org/eclipse/cdt/core/parser/ast/TemplateDeclarationType.java
===================================================================
RCS file: parser/org/eclipse/cdt/core/parser/ast/TemplateDeclarationType.java
diff -N parser/org/eclipse/cdt/core/parser/ast/TemplateDeclarationType.java
--- parser/org/eclipse/cdt/core/parser/ast/TemplateDeclarationType.java 27 Jun 2003 00:20:07 -0000 1.4
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,32 +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;
-
-import org.eclipse.cdt.core.parser.Enum;
-
-/**
- * @author jcamelon
- *
- */
-public class TemplateDeclarationType extends Enum {
-
- public static final TemplateDeclarationType CLASS = new TemplateDeclarationType(1);
- public static final TemplateDeclarationType FUNCTION = new TemplateDeclarationType( 2 );
- public static final TemplateDeclarationType MEMBERCLASS = new TemplateDeclarationType( 3 );
- public static final TemplateDeclarationType METHOD = new TemplateDeclarationType( 4 );
- public static final TemplateDeclarationType FIELD = new TemplateDeclarationType( 5 );
-
- private TemplateDeclarationType( int t )
- {
- super( t );
- }
-
-}
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.3
diff -u -r1.3 DeclarationWrapper.java
--- parser/org/eclipse/cdt/internal/core/parser/DeclarationWrapper.java 30 Jun 2003 22:08:38 -0000 1.3
+++ parser/org/eclipse/cdt/internal/core/parser/DeclarationWrapper.java 7 Jul 2003 13:43:08 -0000
@@ -27,7 +27,7 @@
* @author jcamelon
*
*/
-public class DeclarationWrapper
+public class DeclarationWrapper implements IDeclaratorOwner
{
private final IASTScope scope;
private IASTTypeSpecifier typeSpecifier;
@@ -285,9 +285,9 @@
declarators.add( d );
}
- public List getDeclarators()
+ public Iterator getDeclarators()
{
- return Collections.unmodifiableList( declarators );
+ return Collections.unmodifiableList( declarators ).iterator();
}
/**
@@ -342,7 +342,7 @@
*/
private IASTMethod createMethodASTNode(Declarator declarator)
{
- // TODO Auto-generated method stub
+
return null;
}
/**
@@ -371,6 +371,13 @@
{
// TODO Auto-generated method stub
return null;
+ }
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.internal.core.parser.IDeclaratorOwner#getDeclarationWrapper()
+ */
+ public DeclarationWrapper getDeclarationWrapper()
+ {
+ return this;
}
}
Index: parser/org/eclipse/cdt/internal/core/parser/Declarator.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/Declarator.java,v
retrieving revision 1.4
diff -u -r1.4 Declarator.java
--- parser/org/eclipse/cdt/internal/core/parser/Declarator.java 30 Jun 2003 22:08:38 -0000 1.4
+++ parser/org/eclipse/cdt/internal/core/parser/Declarator.java 7 Jul 2003 13:43:09 -0000
@@ -12,6 +12,7 @@
import java.util.ArrayList;
import java.util.Collections;
+import java.util.Iterator;
import java.util.List;
import org.eclipse.cdt.core.parser.ITokenDuple;
@@ -19,19 +20,19 @@
import org.eclipse.cdt.core.parser.ast.IASTExceptionSpecification;
import org.eclipse.cdt.core.parser.ast.IASTExpression;
import org.eclipse.cdt.core.parser.ast.IASTInitializerClause;
+import org.eclipse.cdt.internal.core.parser.ast.*;
/**
* @author jcamelon
*
*/
-public class Declarator implements IParameterCollection
+public class Declarator implements IParameterCollection, IDeclaratorOwner
{
private boolean isFunction;
private boolean hasFunctionBody;
private IASTExpression constructorExpression;
private boolean pureVirtual = false;
- private final DeclarationWrapper owner1;
- private final Declarator owner2;
+ private final IDeclaratorOwner owner;
private Declarator ownedDeclarator = null;
private String name = "";
private IASTInitializerClause initializerClause = null;
@@ -48,17 +49,11 @@
private int nameStartOffset, nameEndOffset;
- public Declarator( DeclarationWrapper owner )
+ public Declarator( IDeclaratorOwner owner )
{
- this.owner1 = owner;
- owner2 = null;
+ this.owner = owner;
}
- public Declarator( Declarator owner )
- {
- owner2 = owner;
- owner1 = null;
- }
/**
* @return
*/
@@ -86,9 +81,9 @@
/**
* @return
*/
- public DeclarationWrapper getOwner()
+ public IDeclaratorOwner getOwner()
{
- return owner1;
+ return owner;
}
/**
@@ -118,14 +113,6 @@
/**
* @return
*/
- public Declarator getOwnerDeclarator()
- {
- return owner2;
- }
-
- /**
- * @return
- */
public List getPtrOps()
{
return Collections.unmodifiableList( ptrOps );
@@ -354,4 +341,27 @@
isFunction = b;
}
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.internal.core.parser.IDeclaratorOwner#getDeclarators()
+ */
+ public Iterator getDeclarators()
+ {
+ List l = new ArrayList();
+ if( ownedDeclarator != null )
+ l.add( ownedDeclarator );
+ return l.iterator();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.internal.core.parser.IDeclaratorOwner#getDeclarationWrapper()
+ */
+ public DeclarationWrapper getDeclarationWrapper()
+ {
+ Declarator d = this;
+ while( d.getOwner() instanceof Declarator )
+ d = (Declarator)d.getOwner();
+ return (DeclarationWrapper)d.getOwner();
+ }
+
+
}
Index: parser/org/eclipse/cdt/internal/core/parser/IASTArrayModifier.java
===================================================================
RCS file: parser/org/eclipse/cdt/internal/core/parser/IASTArrayModifier.java
diff -N parser/org/eclipse/cdt/internal/core/parser/IASTArrayModifier.java
--- parser/org/eclipse/cdt/internal/core/parser/IASTArrayModifier.java 30 Jun 2003 22:08:38 -0000 1.1
+++ /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.internal.core.parser;
-
-/**
- * @author jcamelon
- *
- */
-public interface IASTArrayModifier
-{
-
-}
Index: parser/org/eclipse/cdt/internal/core/parser/IDeclaratorOwner.java
===================================================================
RCS file: parser/org/eclipse/cdt/internal/core/parser/IDeclaratorOwner.java
diff -N parser/org/eclipse/cdt/internal/core/parser/IDeclaratorOwner.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ parser/org/eclipse/cdt/internal/core/parser/IDeclaratorOwner.java 7 Jul 2003 13:43:09 -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;
+
+import java.util.Iterator;
+
+/**
+ * @author jcamelon
+ *
+ */
+public interface IDeclaratorOwner
+{
+ public Iterator getDeclarators();
+ public DeclarationWrapper 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.4
diff -u -r1.4 NullSourceElementRequestor.java
--- parser/org/eclipse/cdt/internal/core/parser/NullSourceElementRequestor.java 24 Jun 2003 20:18:11 -0000 1.4
+++ parser/org/eclipse/cdt/internal/core/parser/NullSourceElementRequestor.java 7 Jul 2003 13:43:09 -0000
@@ -8,7 +8,6 @@
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.IASTElaboratedTypeSpecifier;
import org.eclipse.cdt.core.parser.ast.IASTEnumerationSpecifier;
import org.eclipse.cdt.core.parser.ast.IASTField;
@@ -161,12 +160,6 @@
* @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptField(org.eclipse.cdt.core.parser.ast.IASTField)
*/
public void acceptField(IASTField field) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptConstructor(org.eclipse.cdt.core.parser.ast.IASTConstructor)
- */
- public void acceptConstructor(IASTConstructor constructor) {
}
/* (non-Javadoc)
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.65
diff -u -r1.65 Parser.java
--- parser/org/eclipse/cdt/internal/core/parser/Parser.java 4 Jul 2003 18:03:21 -0000 1.65
+++ parser/org/eclipse/cdt/internal/core/parser/Parser.java 7 Jul 2003 13:43:11 -0000
@@ -25,8 +25,8 @@
import org.eclipse.cdt.core.parser.ParserFactory;
import org.eclipse.cdt.core.parser.ParserMode;
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.ASTAccessVisibility;
+import org.eclipse.cdt.core.parser.ast.ASTClassKind;
import org.eclipse.cdt.core.parser.ast.IASTASMDefinition;
import org.eclipse.cdt.core.parser.ast.IASTClassSpecifier;
import org.eclipse.cdt.core.parser.ast.IASTCompilationUnit;
@@ -43,6 +43,7 @@
import org.eclipse.cdt.core.parser.ast.IASTClassSpecifier.ClassNameType;
import org.eclipse.cdt.core.parser.ast.IASTExpression.Kind;
import org.eclipse.cdt.internal.core.model.Util;
+import org.eclipse.cdt.internal.core.parser.ast.*;
/**
@@ -1668,21 +1669,21 @@
// this is an elaborated class specifier
Object elab = null;
IToken t = consume();
- ClassKind eck = null;
+ ASTClassKind eck = null;
switch( t.getType() )
{
case Token.t_class:
- eck = ClassKind.CLASS;
+ eck = ASTClassKind.CLASS;
break;
case Token.t_struct:
- eck = ClassKind.STRUCT;
+ eck = ASTClassKind.STRUCT;
break;
case Token.t_union:
- eck = ClassKind.UNION;
+ eck = ASTClassKind.UNION;
break;
case Token.t_enum:
- eck = ClassKind.ENUM;
+ eck = ASTClassKind.ENUM;
break;
default:
break;
@@ -1922,7 +1923,7 @@
protected DeclaratorDuple initDeclarator(Object owner, DeclarationWrapper sdw)
throws Backtrack
{
- DeclaratorDuple duple = declarator(owner, sdw, null);
+ DeclaratorDuple duple = declarator(owner, sdw);
Object declarator = duple.getObject();
Declarator d = duple.getDeclarator();
@@ -2076,21 +2077,17 @@
* @return declarator that this parsing produced.
* @throws Backtrack request a backtrack
*/
- protected DeclaratorDuple declarator(Object container, DeclarationWrapper sdw, Declarator owningDeclarator) throws Backtrack
+ protected DeclaratorDuple declarator(Object container, IDeclaratorOwner owner) throws Backtrack
{
Object declarator = null;
Declarator d = null;
+ DeclarationWrapper sdw = owner.getDeclarationWrapper();
overallLoop:
do
{
declarator = null;
- d = null;
-
- if( sdw != null )
- d = new Declarator( sdw );
- else if( owningDeclarator != null )
- d = new Declarator( owningDeclarator );
+ d = new Declarator( owner );
try
{
@@ -2113,7 +2110,7 @@
if (LT(1) == IToken.tLPAREN)
{
consume();
- DeclaratorDuple subDeclarator = declarator(declarator, null, d);
+ DeclaratorDuple subDeclarator = declarator(declarator, d);
consume(IToken.tRPAREN);
try
{
@@ -2354,23 +2351,12 @@
try
{
do
- {
- IASTScope s = null;
- if( sdw != null )
- s = sdw.getScope();
- else
- {
- Declarator i = owningDeclarator;
- while( i.getOwnerDeclarator() != null )
- i = i.getOwnerDeclarator();
- s = i.getOwner().getScope();
- }
-
+ {
simpleDeclaration(
oldKRParameterDeclarationClause,
false,
true,
- s);
+ sdw.getScope());
}
while (LT(1) != IToken.tLBRACE);
}
@@ -2495,8 +2481,9 @@
}
}
while (true);
- if( sdw == null )
- owningDeclarator.setOwnedDeclarator(d);
+
+ if( d.getOwner() instanceof Declarator )
+ ((Declarator)d.getOwner()).setOwnedDeclarator(d);
return new DeclaratorDuple( declarator, d );
}
@@ -2849,8 +2836,8 @@
throws Backtrack
{
ClassNameType nameType = ClassNameType.IDENTIFIER;
- ClassKind classKind = null;
- AccessVisibility access = AccessVisibility.PUBLIC;
+ ASTClassKind classKind = null;
+ ASTAccessVisibility access = ASTAccessVisibility.PUBLIC;
IToken classKey = null;
IToken mark = mark();
// class key
@@ -2858,16 +2845,16 @@
{
case IToken.t_class :
classKey = consume();
- classKind = ClassKind.CLASS;
- access = AccessVisibility.PRIVATE;
+ classKind = ASTClassKind.CLASS;
+ access = ASTAccessVisibility.PRIVATE;
break;
case IToken.t_struct :
classKey = consume();
- classKind = ClassKind.STRUCT;
+ classKind = ASTClassKind.STRUCT;
break;
case IToken.t_union :
classKey = consume();
- classKind = ClassKind.UNION;
+ classKind = ASTClassKind.UNION;
break;
default :
throw backtrack;
@@ -3008,7 +2995,7 @@
{
}
boolean isVirtual = false;
- AccessVisibility visibility = AccessVisibility.PUBLIC;
+ ASTAccessVisibility visibility = ASTAccessVisibility.PUBLIC;
ITokenDuple nameDuple = null;
baseSpecifierLoop : for (;;)
{
@@ -3046,10 +3033,10 @@
catch (Exception e)
{
}
- visibility = AccessVisibility.PROTECTED;
+ visibility = ASTAccessVisibility.PROTECTED;
break;
case IToken.t_private :
- visibility = AccessVisibility.PRIVATE;
+ visibility = ASTAccessVisibility.PRIVATE;
try
{
callback.baseSpecifierVisibility(
@@ -3080,7 +3067,7 @@
visibility,
nameDuple.toString());
isVirtual = false;
- visibility = AccessVisibility.PUBLIC;
+ visibility = ASTAccessVisibility.PUBLIC;
nameDuple = null;
callback.baseSpecifierEnd(baseSpecifier);
baseSpecifier =
Index: parser/org/eclipse/cdt/internal/core/parser/ast/ASTBaseSpecifier.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/ASTBaseSpecifier.java,v
retrieving revision 1.2
diff -u -r1.2 ASTBaseSpecifier.java
--- parser/org/eclipse/cdt/internal/core/parser/ast/ASTBaseSpecifier.java 13 Jun 2003 15:01:22 -0000 1.2
+++ parser/org/eclipse/cdt/internal/core/parser/ast/ASTBaseSpecifier.java 7 Jul 2003 13:43:11 -0000
@@ -10,7 +10,7 @@
***********************************************************************/
package org.eclipse.cdt.internal.core.parser.ast;
-import org.eclipse.cdt.core.parser.ast.AccessVisibility;
+import org.eclipse.cdt.core.parser.ast.ASTAccessVisibility;
import org.eclipse.cdt.core.parser.ast.IASTBaseSpecifier;
import org.eclipse.cdt.core.parser.ast.IASTClassSpecifier;
@@ -22,9 +22,9 @@
private final IASTClassSpecifier baseClass;
private final boolean isVirtual;
- private final AccessVisibility visibility;
+ private final ASTAccessVisibility visibility;
- public ASTBaseSpecifier( IASTClassSpecifier c, AccessVisibility a, boolean virtual )
+ public ASTBaseSpecifier( IASTClassSpecifier c, ASTAccessVisibility a, boolean virtual )
{
isVirtual = virtual;
baseClass = c;
@@ -34,7 +34,7 @@
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTBaseSpecifier#getAccess()
*/
- public AccessVisibility getAccess() {
+ public ASTAccessVisibility getAccess() {
return visibility;
}
Index: parser/org/eclipse/cdt/internal/core/parser/ast/IASTArrayModifier.java
===================================================================
RCS file: parser/org/eclipse/cdt/internal/core/parser/ast/IASTArrayModifier.java
diff -N parser/org/eclipse/cdt/internal/core/parser/ast/IASTArrayModifier.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ parser/org/eclipse/cdt/internal/core/parser/ast/IASTArrayModifier.java 7 Jul 2003 13:43:11 -0000
@@ -0,0 +1,20 @@
+/**********************************************************************
+ * 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;
+
+/**
+ * @author jcamelon
+ *
+ */
+public interface IASTArrayModifier
+{
+
+}
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.6
diff -u -r1.6 ASTClassSpecifier.java
--- parser/org/eclipse/cdt/internal/core/parser/ast/full/ASTClassSpecifier.java 27 Jun 2003 00:20:07 -0000 1.6
+++ parser/org/eclipse/cdt/internal/core/parser/ast/full/ASTClassSpecifier.java 7 Jul 2003 13:43:11 -0000
@@ -12,8 +12,8 @@
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.ASTAccessVisibility;
+import org.eclipse.cdt.core.parser.ast.ASTClassKind;
import org.eclipse.cdt.core.parser.ast.IASTTemplateDeclaration;
import org.eclipse.cdt.internal.core.parser.pst.IDerivableContainerSymbol;
import org.eclipse.cdt.internal.core.parser.pst.ISymbol;
@@ -26,11 +26,11 @@
public class ASTClassSpecifier implements IASTFClassSpecifier, IPSTSymbolExtension {
private final IDerivableContainerSymbol symbol;
- private final ClassKind classKind;
+ private final ASTClassKind classKind;
private final ClassNameType type;
private final String name;
- public ASTClassSpecifier( IDerivableContainerSymbol symbol, String name, ClassNameType type, ClassKind kind )
+ public ASTClassSpecifier( IDerivableContainerSymbol symbol, String name, ClassNameType type, ASTClassKind kind )
{
this.name = name;
this.symbol = symbol;
@@ -56,7 +56,7 @@
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTClassSpecifier#getClassKind()
*/
- public ClassKind getClassKind() {
+ public ASTClassKind getClassKind() {
return classKind;
}
@@ -137,7 +137,7 @@
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTClassSpecifier#getCurrentVisiblity()
*/
- public AccessVisibility getCurrentVisibilityMode() {
+ public ASTAccessVisibility getCurrentVisibilityMode() {
// TODO Auto-generated method stub
return null;
}
Index: parser/org/eclipse/cdt/internal/core/parser/ast/full/ASTNamespaceDefinition.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/full/ASTNamespaceDefinition.java,v
retrieving revision 1.2
diff -u -r1.2 ASTNamespaceDefinition.java
--- parser/org/eclipse/cdt/internal/core/parser/ast/full/ASTNamespaceDefinition.java 13 Jun 2003 15:01:21 -0000 1.2
+++ parser/org/eclipse/cdt/internal/core/parser/ast/full/ASTNamespaceDefinition.java 7 Jul 2003 13:43:11 -0000
@@ -108,5 +108,14 @@
*/
public IASTScope getOwnerScope() {
return (IPSTContainerExtension)symbol.getContainingSymbol().getASTNode();
- }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.parser.ast.IASTQualifiedNameElement#getFullyQualifiedName()
+ */
+ public String[] getFullyQualifiedName()
+ {
+ // 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.7
diff -u -r1.7 FullParseASTFactory.java
--- parser/org/eclipse/cdt/internal/core/parser/ast/full/FullParseASTFactory.java 30 Jun 2003 22:08:38 -0000 1.7
+++ parser/org/eclipse/cdt/internal/core/parser/ast/full/FullParseASTFactory.java 7 Jul 2003 13:43:11 -0000
@@ -16,8 +16,8 @@
import org.eclipse.cdt.core.parser.Backtrack;
import org.eclipse.cdt.core.parser.IToken;
import org.eclipse.cdt.core.parser.ITokenDuple;
-import org.eclipse.cdt.core.parser.ast.AccessVisibility;
-import org.eclipse.cdt.core.parser.ast.ClassKind;
+import org.eclipse.cdt.core.parser.ast.ASTAccessVisibility;
+import org.eclipse.cdt.core.parser.ast.ASTClassKind;
import org.eclipse.cdt.core.parser.ast.IASTASMDefinition;
import org.eclipse.cdt.core.parser.ast.IASTClassSpecifier;
import org.eclipse.cdt.core.parser.ast.IASTCompilationUnit;
@@ -39,8 +39,8 @@
import org.eclipse.cdt.core.parser.ast.IASTExpression.IASTNewExpressionDescriptor;
import org.eclipse.cdt.core.parser.ast.IASTExpression.Kind;
import org.eclipse.cdt.core.parser.ast.IASTSimpleTypeSpecifier.SimpleType;
-import org.eclipse.cdt.internal.core.parser.IASTArrayModifier;
import org.eclipse.cdt.internal.core.parser.ast.BaseASTFactory;
+import org.eclipse.cdt.internal.core.parser.ast.IASTArrayModifier;
import org.eclipse.cdt.internal.core.parser.pst.IContainerSymbol;
import org.eclipse.cdt.internal.core.parser.pst.ISymbol;
import org.eclipse.cdt.internal.core.parser.pst.ParserSymbolTable;
@@ -165,7 +165,7 @@
/* (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) {
+ public IASTClassSpecifier createClassSpecifier(IASTScope scope, String name, ASTClassKind kind, ClassNameType type, ASTAccessVisibility access, IASTTemplateDeclaration ownerTemplateDeclaration, int startingOffset, int nameOffset) {
// TODO Auto-generated method stub
return null;
}
@@ -173,7 +173,7 @@
/* (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) {
+ public void addBaseSpecifier(IASTClassSpecifier astClassSpec, boolean isVirtual, ASTAccessVisibility visibility, String string) {
// TODO Auto-generated method stub
}
@@ -181,7 +181,7 @@
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTFactory#createElaboratedTypeSpecifier(org.eclipse.cdt.core.parser.ast.ClassKind, java.lang.String, int, int)
*/
- public IASTElaboratedTypeSpecifier createElaboratedTypeSpecifier(ClassKind elaboratedClassKind, String typeName, int startingOffset, int endOffset )
+ public IASTElaboratedTypeSpecifier createElaboratedTypeSpecifier(ASTClassKind elaboratedClassKind, String typeName, int startingOffset, int endOffset )
{
// TODO Auto-generated method stub
return null;
Index: parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTBaseSpecifier.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTBaseSpecifier.java,v
retrieving revision 1.1
diff -u -r1.1 ASTBaseSpecifier.java
--- parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTBaseSpecifier.java 13 Jun 2003 20:03:14 -0000 1.1
+++ parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTBaseSpecifier.java 7 Jul 2003 13:43:11 -0000
@@ -10,7 +10,7 @@
***********************************************************************/
package org.eclipse.cdt.internal.core.parser.ast.quick;
-import org.eclipse.cdt.core.parser.ast.AccessVisibility;
+import org.eclipse.cdt.core.parser.ast.ASTAccessVisibility;
import org.eclipse.cdt.core.parser.ast.IASTBaseSpecifier;
import org.eclipse.cdt.core.parser.ast.IASTClassSpecifier;
@@ -20,11 +20,11 @@
*/
public class ASTBaseSpecifier implements IASTBaseSpecifier {
- private final AccessVisibility visibility;
+ private final ASTAccessVisibility visibility;
private final boolean isVirtual;
private final IASTClassSpecifier parentClass;
- public ASTBaseSpecifier( IASTClassSpecifier classSpec, boolean v, AccessVisibility a )
+ public ASTBaseSpecifier( IASTClassSpecifier classSpec, boolean v, ASTAccessVisibility a )
{
parentClass = classSpec;
isVirtual = v;
@@ -33,25 +33,22 @@
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTBaseSpecifier#getAccess()
*/
- public AccessVisibility getAccess() {
- // TODO Auto-generated method stub
- return null;
+ public ASTAccessVisibility getAccess() {
+ return visibility;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTBaseSpecifier#isVirtual()
*/
public boolean isVirtual() {
- // TODO Auto-generated method stub
- return false;
+ return isVirtual;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTBaseSpecifier#getParent()
*/
public IASTClassSpecifier getParent() {
- // TODO Auto-generated method stub
- return null;
+ return parentClass;
}
}
Index: parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTClassSpecifier.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTClassSpecifier.java,v
retrieving revision 1.5
diff -u -r1.5 ASTClassSpecifier.java
--- parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTClassSpecifier.java 4 Jul 2003 18:03:21 -0000 1.5
+++ parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTClassSpecifier.java 7 Jul 2003 13:43:11 -0000
@@ -12,15 +12,11 @@
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
-import java.util.Stack;
-import org.eclipse.cdt.core.parser.ast.AccessVisibility;
-import org.eclipse.cdt.core.parser.ast.ClassKind;
+import org.eclipse.cdt.core.parser.ast.ASTAccessVisibility;
+import org.eclipse.cdt.core.parser.ast.ASTClassKind;
import org.eclipse.cdt.core.parser.ast.IASTBaseSpecifier;
-import org.eclipse.cdt.core.parser.ast.IASTClassSpecifier;
import org.eclipse.cdt.core.parser.ast.IASTDeclaration;
-import org.eclipse.cdt.core.parser.ast.IASTNamespaceDefinition;
-import org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement;
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;
@@ -29,57 +25,33 @@
*
*/
public class ASTClassSpecifier
- extends ASTDeclaration
+ extends ASTQualifiedNamedDeclaration
implements IASTQClassSpecifier, IASTQScope
{
public ASTClassSpecifier(
IASTScope scope,
String name,
- ClassKind kind,
+ ASTClassKind kind,
ClassNameType type,
- AccessVisibility access,
+ ASTAccessVisibility access,
IASTTemplateDeclaration ownerTemplateDeclaration)
{
- super(scope);
+ super(scope, name );
classNameType = type;
classKind = kind;
this.access = access;
this.name = name;
templateOwner = ownerTemplateDeclaration;
-
- Stack names = new Stack();
- IASTScope parent = getOwnerScope();
-
- names.push( name ); // push on our own name
- while (parent != null)
- {
- if (parent instanceof IASTNamespaceDefinition
- || parent instanceof IASTClassSpecifier)
- {
- names.push(((IASTOffsetableNamedElement)parent).getName());
- parent = ((IASTDeclaration)parent).getOwnerScope();
- }
- break;
- }
- if (names.size() != 0)
- {
- qualifiedNames = new String[names.size()];
- int counter = 0;
- while (!names.empty())
- qualifiedNames[counter++] = (String)names.pop();
- }
- else
- qualifiedNames = null;
}
- private final String[] qualifiedNames;
+
private IASTTemplateDeclaration templateOwner = null;
private final String name;
private List declarations = new ArrayList();
private List baseClauses = new ArrayList();
- private AccessVisibility access;
+ private ASTAccessVisibility access;
private NamedOffsets offsets = new NamedOffsets();
private final ClassNameType classNameType;
- private final ClassKind classKind;
+ private final ASTClassKind classKind;
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTClassSpecifier#getClassNameType()
*/
@@ -90,7 +62,7 @@
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTClassSpecifier#getClassKind()
*/
- public ClassKind getClassKind()
+ public ASTClassKind getClassKind()
{
return classKind;
}
@@ -104,7 +76,7 @@
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTClassSpecifier#getCurrentVisiblity()
*/
- public AccessVisibility getCurrentVisibilityMode()
+ public ASTAccessVisibility getCurrentVisibilityMode()
{
return access;
}
@@ -184,12 +156,5 @@
public void addBaseClass(IASTBaseSpecifier baseSpecifier)
{
baseClauses.add(baseSpecifier);
- }
- /* (non-Javadoc)
- * @see org.eclipse.cdt.core.parser.ast.IASTClassSpecifier#getFullyQualifiedName()
- */
- public String[] getFullyQualifiedName()
- {
- return qualifiedNames;
}
}
Index: parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTElaboratedTypeSpecifier.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTElaboratedTypeSpecifier.java,v
retrieving revision 1.1
diff -u -r1.1 ASTElaboratedTypeSpecifier.java
--- parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTElaboratedTypeSpecifier.java 24 Jun 2003 20:18:11 -0000 1.1
+++ parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTElaboratedTypeSpecifier.java 7 Jul 2003 13:43:11 -0000
@@ -10,7 +10,7 @@
***********************************************************************/
package org.eclipse.cdt.internal.core.parser.ast.quick;
-import org.eclipse.cdt.core.parser.ast.ClassKind;
+import org.eclipse.cdt.core.parser.ast.ASTClassKind;
import org.eclipse.cdt.core.parser.ast.IASTElaboratedTypeSpecifier;
import org.eclipse.cdt.internal.core.parser.ast.Offsets;
@@ -23,14 +23,14 @@
private Offsets offsets = new Offsets();
private final String typeName;
- private final ClassKind classKind;
+ private final ASTClassKind classKind;
/**
* @param elaboratedClassKind
* @param typeName
* @param startingOffset
* @param endOffset
*/
- public ASTElaboratedTypeSpecifier(ClassKind elaboratedClassKind, String typeName, int startingOffset, int endOffset)
+ public ASTElaboratedTypeSpecifier(ASTClassKind elaboratedClassKind, String typeName, int startingOffset, int endOffset)
{
classKind = elaboratedClassKind;
this.typeName = typeName;
@@ -47,7 +47,7 @@
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTElaboratedTypeSpecifier#getClassKind()
*/
- public ClassKind getClassKind()
+ public ASTClassKind getClassKind()
{
return classKind;
}
Index: parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTNamespaceDefinition.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTNamespaceDefinition.java,v
retrieving revision 1.2
diff -u -r1.2 ASTNamespaceDefinition.java
--- parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTNamespaceDefinition.java 13 Jun 2003 15:01:21 -0000 1.2
+++ parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTNamespaceDefinition.java 7 Jul 2003 13:43:11 -0000
@@ -23,14 +23,14 @@
* @author jcamelon
*
*/
-public class ASTNamespaceDefinition extends ASTDeclaration implements IASTNamespaceDefinition, IASTQScope {
+public class ASTNamespaceDefinition extends ASTQualifiedNamedDeclaration implements IASTNamespaceDefinition, IASTQScope {
private final String name;
private NamedOffsets offsets = new NamedOffsets();
public ASTNamespaceDefinition( IASTScope scope, String name )
{
- super( scope );
+ super( scope, name );
this.name = name;
}
/* (non-Javadoc)
Index: parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTQualifiedNamedDeclaration.java
===================================================================
RCS file: parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTQualifiedNamedDeclaration.java
diff -N parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTQualifiedNamedDeclaration.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTQualifiedNamedDeclaration.java 7 Jul 2003 13:43:11 -0000
@@ -0,0 +1,68 @@
+/**********************************************************************
+ * 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.Stack;
+
+import org.eclipse.cdt.core.parser.ast.IASTClassSpecifier;
+import org.eclipse.cdt.core.parser.ast.IASTDeclaration;
+import org.eclipse.cdt.core.parser.ast.IASTNamespaceDefinition;
+import org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement;
+import org.eclipse.cdt.core.parser.ast.IASTScope;
+
+/**
+ * @author jcamelon
+ *
+ */
+public class ASTQualifiedNamedDeclaration extends ASTDeclaration
+{
+
+ /**
+ * @param scope
+ */
+ public ASTQualifiedNamedDeclaration(IASTScope scope, String name )
+ {
+ super(scope);
+ Stack names = new Stack();
+ IASTScope parent = getOwnerScope();
+
+ names.push( name ); // push on our own name
+ while (parent != null)
+ {
+ if (parent instanceof IASTNamespaceDefinition
+ || parent instanceof IASTClassSpecifier )
+ {
+ names.push(((IASTOffsetableNamedElement)parent).getName());
+ parent = ((IASTDeclaration)parent).getOwnerScope();
+ }
+ else
+ break;
+ }
+ if (names.size() != 0)
+ {
+ qualifiedNames = new String[names.size()];
+ int counter = 0;
+ while (!names.empty())
+ qualifiedNames[counter++] = (String)names.pop();
+ }
+ else
+ qualifiedNames = null;
+
+ }
+
+ public String[] getFullyQualifiedName()
+ {
+ return qualifiedNames;
+ }
+
+ private final String[] qualifiedNames;
+
+}
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.7
diff -u -r1.7 QuickParseASTFactory.java
--- parser/org/eclipse/cdt/internal/core/parser/ast/quick/QuickParseASTFactory.java 30 Jun 2003 22:08:38 -0000 1.7
+++ parser/org/eclipse/cdt/internal/core/parser/ast/quick/QuickParseASTFactory.java 7 Jul 2003 13:43:11 -0000
@@ -14,8 +14,8 @@
import org.eclipse.cdt.core.parser.Backtrack;
import org.eclipse.cdt.core.parser.ITokenDuple;
-import org.eclipse.cdt.core.parser.ast.AccessVisibility;
-import org.eclipse.cdt.core.parser.ast.ClassKind;
+import org.eclipse.cdt.core.parser.ast.ASTAccessVisibility;
+import org.eclipse.cdt.core.parser.ast.ASTClassKind;
import org.eclipse.cdt.core.parser.ast.IASTASMDefinition;
import org.eclipse.cdt.core.parser.ast.IASTBaseSpecifier;
import org.eclipse.cdt.core.parser.ast.IASTClassSpecifier;
@@ -39,8 +39,8 @@
import org.eclipse.cdt.core.parser.ast.IASTExpression.IASTNewExpressionDescriptor;
import org.eclipse.cdt.core.parser.ast.IASTExpression.Kind;
import org.eclipse.cdt.core.parser.ast.IASTSimpleTypeSpecifier.SimpleType;
-import org.eclipse.cdt.internal.core.parser.IASTArrayModifier;
import org.eclipse.cdt.internal.core.parser.ast.BaseASTFactory;
+import org.eclipse.cdt.internal.core.parser.ast.IASTArrayModifier;
/**
* @author jcamelon
@@ -99,7 +99,7 @@
/* (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) {
+ public IASTClassSpecifier createClassSpecifier(IASTScope scope, String name, ASTClassKind kind, ClassNameType type, ASTAccessVisibility access, IASTTemplateDeclaration ownerTemplateDeclaration, int startingOffset, int nameOffset) {
IASTClassSpecifier spec = new ASTClassSpecifier( scope, name, kind, type, access, ownerTemplateDeclaration );
spec.setStartingOffset( startingOffset );
spec.setNameOffset( nameOffset );
@@ -109,7 +109,7 @@
/* (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) {
+ public void addBaseSpecifier(IASTClassSpecifier astClassSpec, boolean isVirtual, ASTAccessVisibility visibility, String string) {
IASTBaseSpecifier baseSpecifier = new ASTBaseSpecifier( astClassSpec, isVirtual, visibility );
((IASTQClassSpecifier)astClassSpec).addBaseClass(baseSpecifier);
}
@@ -117,7 +117,7 @@
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTFactory#createElaboratedTypeSpecifier(org.eclipse.cdt.core.parser.ast.ClassKind, java.lang.String, int, int)
*/
- public IASTElaboratedTypeSpecifier createElaboratedTypeSpecifier(ClassKind elaboratedClassKind, String typeName, int startingOffset, int endOffset)
+ public IASTElaboratedTypeSpecifier createElaboratedTypeSpecifier(ASTClassKind elaboratedClassKind, String typeName, int startingOffset, int endOffset)
{
return new ASTElaboratedTypeSpecifier( elaboratedClassKind, typeName, startingOffset, endOffset );
}
Index: parser/org/eclipse/cdt/internal/core/parser/pst/IDerivableContainerSymbol.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/IDerivableContainerSymbol.java,v
retrieving revision 1.2
diff -u -r1.2 IDerivableContainerSymbol.java
--- parser/org/eclipse/cdt/internal/core/parser/pst/IDerivableContainerSymbol.java 13 Jun 2003 15:01:22 -0000 1.2
+++ parser/org/eclipse/cdt/internal/core/parser/pst/IDerivableContainerSymbol.java 7 Jul 2003 13:43:12 -0000
@@ -18,7 +18,7 @@
import java.util.List;
-import org.eclipse.cdt.core.parser.ast.AccessVisibility;
+import org.eclipse.cdt.core.parser.ast.ASTAccessVisibility;
/**
* @author aniefer
@@ -29,7 +29,7 @@
public interface IDerivableContainerSymbol extends IContainerSymbol {
public void addParent( ISymbol parent );
- public void addParent( ISymbol parent, boolean virtual, AccessVisibility visibility );
+ public void addParent( ISymbol parent, boolean virtual, ASTAccessVisibility visibility );
public List getParents();
public boolean hasParents();
Index: parser/org/eclipse/cdt/internal/core/parser/pst/ParserSymbolTable.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/ParserSymbolTable.java,v
retrieving revision 1.3
diff -u -r1.3 ParserSymbolTable.java
--- parser/org/eclipse/cdt/internal/core/parser/pst/ParserSymbolTable.java 24 Jun 2003 20:18:11 -0000 1.3
+++ parser/org/eclipse/cdt/internal/core/parser/pst/ParserSymbolTable.java 7 Jul 2003 13:43:13 -0000
@@ -22,7 +22,7 @@
import java.util.Map;
import java.util.Set;
-import org.eclipse.cdt.core.parser.ast.AccessVisibility;
+import org.eclipse.cdt.core.parser.ast.ASTAccessVisibility;
import org.eclipse.cdt.internal.core.parser.ast.full.IPSTSymbolExtension;
/**
@@ -2337,9 +2337,9 @@
}
public void addParent( ISymbol parent ){
- addParent( parent, false, AccessVisibility.PUBLIC );
+ addParent( parent, false, ASTAccessVisibility.PUBLIC );
}
- public void addParent( ISymbol parent, boolean virtual, AccessVisibility visibility ){
+ public void addParent( ISymbol parent, boolean virtual, ASTAccessVisibility visibility ){
if( _parentScopes == null ){
_parentScopes = new LinkedList();
}
@@ -3104,7 +3104,7 @@
public class ParentWrapper implements IDerivableContainerSymbol.IParentSymbol
{
- public ParentWrapper( ISymbol p, boolean v, AccessVisibility s ){
+ public ParentWrapper( ISymbol p, boolean v, ASTAccessVisibility s ){
parent = p;
isVirtual = v;
access = s;
@@ -3128,11 +3128,11 @@
private boolean isVirtual = false;
private ISymbol parent = null;
- private final AccessVisibility access;
+ private final ASTAccessVisibility access;
/**
* @return
*/
- public AccessVisibility getAccess() {
+ public ASTAccessVisibility getAccess() {
return access;
}
Index: search/org/eclipse/cdt/internal/core/search/matching/CSearchPattern.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/matching/CSearchPattern.java,v
retrieving revision 1.4
diff -u -r1.4 CSearchPattern.java
--- search/org/eclipse/cdt/internal/core/search/matching/CSearchPattern.java 4 Jul 2003 17:15:41 -0000 1.4
+++ search/org/eclipse/cdt/internal/core/search/matching/CSearchPattern.java 7 Jul 2003 13:43:13 -0000
@@ -22,7 +22,7 @@
import org.eclipse.cdt.core.parser.ParserFactory;
import org.eclipse.cdt.core.parser.ParserMode;
import org.eclipse.cdt.core.parser.ScannerException;
-import org.eclipse.cdt.core.parser.ast.ClassKind;
+import org.eclipse.cdt.core.parser.ast.ASTClassKind;
import org.eclipse.cdt.core.search.ICSearchConstants;
import org.eclipse.cdt.core.search.ICSearchPattern;
import org.eclipse.cdt.internal.core.search.CharOperation;
@@ -146,15 +146,15 @@
} catch (ScannerException e) {
}
- ClassKind kind = null;
+ ASTClassKind kind = null;
if( searchFor == CLASS ){
- kind = ClassKind.CLASS;
+ kind = ASTClassKind.CLASS;
} else if( searchFor == STRUCT ) {
- kind = ClassKind.STRUCT;
+ kind = ASTClassKind.STRUCT;
} else if ( searchFor == ENUM ) {
- kind = ClassKind.ENUM;
+ kind = ASTClassKind.ENUM;
} else if ( searchFor == UNION ) {
- kind = ClassKind.UNION;
+ kind = ASTClassKind.UNION;
}
char [][] qualifications = new char[0][];
Index: search/org/eclipse/cdt/internal/core/search/matching/ClassDeclarationPattern.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/matching/ClassDeclarationPattern.java,v
retrieving revision 1.3
diff -u -r1.3 ClassDeclarationPattern.java
--- search/org/eclipse/cdt/internal/core/search/matching/ClassDeclarationPattern.java 4 Jul 2003 17:15:41 -0000 1.3
+++ search/org/eclipse/cdt/internal/core/search/matching/ClassDeclarationPattern.java 7 Jul 2003 13:43:13 -0000
@@ -13,7 +13,7 @@
*/
package org.eclipse.cdt.internal.core.search.matching;
-import org.eclipse.cdt.core.parser.ast.ClassKind;
+import org.eclipse.cdt.core.parser.ast.ASTClassKind;
import org.eclipse.cdt.core.parser.ast.IASTClassSpecifier;
import org.eclipse.cdt.core.parser.ast.IASTOffsetableElement;
import org.eclipse.cdt.internal.core.search.CharOperation;
@@ -30,7 +30,7 @@
super( matchMode, caseSensitive );
}
- public ClassDeclarationPattern( char[] name, char[][] containers, ClassKind kind, int mode, boolean caseSensitive ){
+ public ClassDeclarationPattern( char[] name, char[][] containers, ASTClassKind kind, int mode, boolean caseSensitive ){
super( mode, caseSensitive );
simpleName = caseSensitive ? name : CharOperation.toLowerCase( name );
if( caseSensitive || containers == null ){
@@ -90,6 +90,6 @@
private char[] simpleName;
private char[][] containingTypes;
- private ClassKind classKind;
+ private ASTClassKind classKind;
}
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.4
diff -u -r1.4 MatchLocator.java
--- search/org/eclipse/cdt/internal/core/search/matching/MatchLocator.java 4 Jul 2003 17:15:41 -0000 1.4
+++ search/org/eclipse/cdt/internal/core/search/matching/MatchLocator.java 7 Jul 2003 13:43:13 -0000
@@ -77,7 +77,6 @@
public void acceptElaboratedTypeSpecifier(IASTElaboratedTypeSpecifier elaboratedTypeSpec){ }
public void acceptMethodDeclaration(IASTMethod method) { }
public void acceptField(IASTField field) { }
- public void acceptConstructor(IASTConstructor constructor) { }
public void enterFunctionBody(IASTFunction function) { }
public void enterCompilationUnit(IASTCompilationUnit compilationUnit) { }
public void enterNamespaceDefinition(IASTNamespaceDefinition namespaceDefinition) { }