6f286c9a6860d8e2b9d9feb9ca41f1c8f42cce29
[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.*;
16 import net.sourceforge.phpdt.internal.compiler.problem.*;
17
18 public class LocalTypeDeclaration extends InnerTypeDeclaration {
19         public AbstractMethodDeclaration enclosingMethod;
20
21 public LocalTypeDeclaration(CompilationResult compilationResult){
22         super(compilationResult);
23 }       
24
25 /**
26  *      Iteration for a local innertype
27  *
28  */
29 public void traverse(IAbstractSyntaxTreeVisitor visitor, BlockScope blockScope) {
30         if (ignoreFurtherInvestigation)
31                 return;
32         try {
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);
40                         }
41                         if (memberTypes != null) {
42                                 int memberTypesLength = memberTypes.length;
43                                 for (int i = 0; i < memberTypesLength; i++)
44                                         memberTypes[i].traverse(visitor, scope);
45                         }
46                         if (fields != null) {
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
52                                         } else {
53                                                 field.traverse(visitor, initializerScope);
54                                         }
55                                 }
56                         }
57                         if (methods != null) {
58                                 int methodsLength = methods.length;
59                                 for (int i = 0; i < methodsLength; i++)
60                                         methods[i].traverse(visitor, scope);
61                         }
62                 }
63                 visitor.endVisit(this, blockScope);
64         } catch (AbortType e) {
65         }
66 }
67 }