deleted: export="true"
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpdt / internal / compiler / lookup / SyntheticArgumentBinding.java
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.lookup;
12
13 /**
14  * Specific local variable location used to:
15  * - either provide emulation for outer local variables used from within innerclass constructs,
16  * - or provide emulation to enclosing instances. 
17  * When it is mapping to an outer local variable, this actual outer local is accessible through 
18  * the public field #actualOuterLocalVariable.
19  *
20  * Such a synthetic argument binding will be inserted in all constructors of local innertypes before
21  * the user arguments.
22  */
23
24 import net.sourceforge.phpdt.internal.compiler.util.CharOperation;
25
26 public class SyntheticArgumentBinding extends LocalVariableBinding {
27
28         {       
29                 this.isArgument = true;
30                 this.used = true;
31         }
32         // if the argument is mapping to an outer local variable, this denotes the outer actual variable
33         public LocalVariableBinding actualOuterLocalVariable;
34         // if the argument has a matching synthetic field
35         public FieldBinding matchingField;
36
37         final static char[] OuterLocalPrefix = { 'v', 'a', 'l', '$' };
38         final static char[] EnclosingInstancePrefix = { 't', 'h', 'i', 's', '$' };
39 public SyntheticArgumentBinding(LocalVariableBinding actualOuterLocalVariable) {
40         super(
41                 CharOperation.concat(OuterLocalPrefix, actualOuterLocalVariable.name), 
42                 actualOuterLocalVariable.type, 
43                 AccFinal,
44                 true);
45         this.actualOuterLocalVariable = actualOuterLocalVariable;
46 }
47 public SyntheticArgumentBinding(ReferenceBinding enclosingType) {
48         super(
49                 CharOperation.concat(
50                         SyntheticArgumentBinding.EnclosingInstancePrefix,
51                         String.valueOf(enclosingType.depth()).toCharArray()),
52                 enclosingType, 
53                 AccFinal,
54                 true);
55 }
56 }