1 /*******************************************************************************
2 * Copyright (c) 2000, 2003 IBM Corporation and others.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Common Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/cpl-v10.html
9 * IBM Corporation - initial API and implementation
10 *******************************************************************************/
11 package net.sourceforge.phpeclipse.internal.compiler.ast;
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;
18 public class MemberTypeDeclaration extends InnerTypeDeclaration {
19 public TypeDeclaration enclosingType;
21 public MemberTypeDeclaration(CompilationResult compilationResult){
22 super(compilationResult);
25 * Iteration for a member innertype
28 public void traverse(IAbstractSyntaxTreeVisitor visitor, ClassScope classScope) {
29 if (ignoreFurtherInvestigation)
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);
40 if (memberTypes != null) {
41 int memberTypesLength = memberTypes.length;
42 for (int i = 0; i < memberTypesLength; i++)
43 memberTypes[i].traverse(visitor, scope);
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);
52 field.traverse(visitor, initializerScope);
56 if (methods != null) {
57 int methodsLength = methods.length;
58 for (int i = 0; i < methodsLength; i++)
59 methods[i].traverse(visitor, scope);
62 visitor.endVisit(this, classScope);
63 } catch (AbortType e) {