Refactored packagename to net.sourceforge.phpdt.internal.compiler.ast
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpdt / internal / compiler / ast / AnonymousLocalTypeDeclaration.java
index 2c4fb60..73b3689 100644 (file)
@@ -1,18 +1,19 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2001, 2002 International Business Machines Corp. and others.
+ * Copyright (c) 2000, 2003 IBM 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 
+ * are made available under the terms of the Common Public License v1.0
  * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v05.html
+ * http://www.eclipse.org/legal/cpl-v10.html
  * 
  * Contributors:
  *     IBM Corporation - initial API and implementation
- ******************************************************************************/
+ *******************************************************************************/
 package net.sourceforge.phpdt.internal.compiler.ast;
 
+import net.sourceforge.phpdt.internal.compiler.ASTVisitor;
 import net.sourceforge.phpdt.internal.compiler.CompilationResult;
-import net.sourceforge.phpdt.internal.compiler.IAbstractSyntaxTreeVisitor;
 import net.sourceforge.phpdt.internal.compiler.lookup.BlockScope;
+import net.sourceforge.phpdt.internal.compiler.lookup.LocalTypeBinding;
 import net.sourceforge.phpdt.internal.compiler.lookup.MethodBinding;
 import net.sourceforge.phpdt.internal.compiler.lookup.MethodScope;
 import net.sourceforge.phpdt.internal.compiler.lookup.TypeBinding;
@@ -30,7 +31,7 @@ public class AnonymousLocalTypeDeclaration extends LocalTypeDeclaration {
        } 
        
        // use a default name in order to th name lookup 
-       // to operate juat like a regular type (which has a name)
+       // to operate just like a regular type (which has a name)
        //without checking systematically if the naem is null .... 
        public MethodBinding createsInternalConstructorWithBinding(MethodBinding inheritedConstructorBinding) {
 
@@ -55,8 +56,7 @@ public class AnonymousLocalTypeDeclaration extends LocalTypeDeclaration {
                }
 
                //the super call inside the constructor
-               cd.constructorCall =
-                       new ExplicitConstructorCall(ExplicitConstructorCall.ImplicitSuper);
+               cd.constructorCall = SuperReference.implicitSuperConstructorCall();
                cd.constructorCall.sourceStart = sourceStart;
                cd.constructorCall.sourceEnd = sourceEnd;
 
@@ -90,7 +90,7 @@ public class AnonymousLocalTypeDeclaration extends LocalTypeDeclaration {
                                inheritedConstructorBinding.thrownExceptions, //exceptions
                                binding); //declaringClass
                                
-               cd.scope = new MethodScope(scope, this, true);
+               cd.scope = new MethodScope(scope, cd, true);
                cd.bindArguments();
                cd.constructorCall.resolve(cd.scope);
 
@@ -114,6 +114,10 @@ public class AnonymousLocalTypeDeclaration extends LocalTypeDeclaration {
        }
        public void resolve(BlockScope scope) {
 
+               if (binding != null) {
+                       // remember local types binding for innerclass emulation propagation
+                       scope.referenceCompilationUnit().record((LocalTypeBinding)binding);
+               }
                // scope and binding are provided in updateBindingSuperclass 
                resolve();
                updateMaxFieldCount();
@@ -129,7 +133,7 @@ public class AnonymousLocalTypeDeclaration extends LocalTypeDeclaration {
         *
         */
        public void traverse(
-               IAbstractSyntaxTreeVisitor visitor,
+           ASTVisitor visitor,
                BlockScope blockScope) {
 
                if (ignoreFurtherInvestigation)
@@ -170,4 +174,4 @@ public class AnonymousLocalTypeDeclaration extends LocalTypeDeclaration {
                } catch (AbortType e) {
                }
        }
-}
\ No newline at end of file
+}