25debb43e999308d21d12cd15e8c09d8dd66ce97
[phpeclipse.git] /
1 /*******************************************************************************
2  * Copyright (c) 2000, 2001, 2002 International Business Machines Corp. and others.
3  * All rights reserved. This program and the accompanying materials 
4  * are made available under the terms of the Common Public License v0.5 
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/cpl-v05.html
7  * 
8  * Contributors:
9  *     IBM Corporation - initial API and implementation
10  ******************************************************************************/
11 package net.sourceforge.phpdt.internal.compiler.ast;
12
13 import net.sourceforge.phpdt.internal.compiler.CompilationResult;
14 import net.sourceforge.phpdt.internal.compiler.IAbstractSyntaxTreeVisitor;
15 import net.sourceforge.phpdt.internal.compiler.lookup.ClassScope;
16 import net.sourceforge.phpdt.internal.compiler.problem.AbortType;
17
18 public class MemberTypeDeclaration extends InnerTypeDeclaration {
19         public TypeDeclaration enclosingType;
20         
21 public MemberTypeDeclaration(CompilationResult compilationResult){
22         super(compilationResult);
23 }               
24 /**
25  *      Iteration for a member innertype
26  *
27  */
28 public void traverse(IAbstractSyntaxTreeVisitor visitor, ClassScope classScope) {
29         if (ignoreFurtherInvestigation)
30                 return;
31         try {
32                 if (visitor.visit(this, classScope)) {
33                         if (superclass != null)
34                                 superclass.traverse(visitor, scope);
35                         if (superInterfaces != null) {
36                                 int superInterfaceLength = superInterfaces.length;
37                                 for (int i = 0; i < superInterfaceLength; i++)
38                                         superInterfaces[i].traverse(visitor, scope);
39                         }
40                         if (memberTypes != null) {
41                                 int memberTypesLength = memberTypes.length;
42                                 for (int i = 0; i < memberTypesLength; i++)
43                                         memberTypes[i].traverse(visitor, scope);
44                         }
45                         if (fields != null) {
46                                 int fieldsLength = fields.length;
47                                 for (int i = 0; i < fieldsLength; i++) {
48                                         FieldDeclaration field;
49                                         if ((field = fields[i]).isStatic()) {
50                                                 field.traverse(visitor, staticInitializerScope);
51                                         } else {
52                                                 field.traverse(visitor, initializerScope);
53                                         }
54                                 }
55                         }
56                         if (methods != null) {
57                                 int methodsLength = methods.length;
58                                 for (int i = 0; i < methodsLength; i++)
59                                         methods[i].traverse(visitor, scope);
60                         }
61                 }
62                 visitor.endVisit(this, classScope);
63         } catch (AbortType e) {
64         }
65 }
66 }