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.ASTVisitor;
14 import net.sourceforge.phpdt.internal.compiler.CompilationResult;
15 import net.sourceforge.phpdt.internal.compiler.lookup.BlockScope;
16 import net.sourceforge.phpdt.internal.compiler.problem.AbortType;
18 public class LocalTypeDeclaration extends InnerTypeDeclaration {
19 public AbstractMethodDeclaration enclosingMethod;
21 public LocalTypeDeclaration(CompilationResult compilationResult){
22 super(compilationResult);
26 * Iteration for a local innertype
29 public void traverse(ASTVisitor visitor, BlockScope blockScope) {
30 if (ignoreFurtherInvestigation)
33 if (visitor.visit(this, blockScope)) {
34 if (superclass != null)
35 superclass.traverse(visitor, scope);
36 if (superInterfaces != null) {
37 int superInterfaceLength = superInterfaces.length;
38 for (int i = 0; i < superInterfaceLength; i++)
39 superInterfaces[i].traverse(visitor, scope);
41 if (memberTypes != null) {
42 int memberTypesLength = memberTypes.length;
43 for (int i = 0; i < memberTypesLength; i++)
44 memberTypes[i].traverse(visitor, scope);
47 int fieldsLength = fields.length;
48 for (int i = 0; i < fieldsLength; i++) {
49 FieldDeclaration field;
50 if ((field = fields[i]).isStatic()) {
51 // local type cannot have static fields
53 field.traverse(visitor, initializerScope);
57 if (methods != null) {
58 int methodsLength = methods.length;
59 for (int i = 0; i < methodsLength; i++)
60 methods[i].traverse(visitor, scope);
63 visitor.endVisit(this, blockScope);
64 } catch (AbortType e) {