Makefile fixup
[org.ibex.tool.git] / repo / org.ibex.tool / src / org / eclipse / jdt / internal / compiler / ast / AbstractVariableDeclaration.java
1 /*******************************************************************************
2  * Copyright (c) 2000, 2004 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
7  * 
8  * Contributors:
9  *     IBM Corporation - initial API and implementation
10  *******************************************************************************/
11 package org.eclipse.jdt.internal.compiler.ast;
12
13 import org.eclipse.jdt.internal.compiler.flow.FlowContext;
14 import org.eclipse.jdt.internal.compiler.flow.FlowInfo;
15 import org.eclipse.jdt.internal.compiler.lookup.BlockScope;
16 import org.eclipse.jdt.internal.compiler.lookup.InvocationSite;
17 import org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding;
18
19 public abstract class AbstractVariableDeclaration extends Statement implements InvocationSite {
20         public int declarationEnd;
21         public int declarationSourceEnd;
22         public int declarationSourceStart;
23         public int hiddenVariableDepth; // used to diagnose hiding scenarii
24         public Expression initialization;
25         public int modifiers;
26         public int modifiersSourceStart;
27
28         public char[] name;
29
30         public TypeReference type;
31         
32         public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext, FlowInfo flowInfo) {
33                 return flowInfo;
34         }
35         /* (non-Javadoc)
36          * @see org.eclipse.jdt.internal.compiler.lookup.InvocationSite#isSuperAccess()
37          */
38         public boolean isSuperAccess() {
39                 return false;
40         }
41
42         /* (non-Javadoc)
43          * @see org.eclipse.jdt.internal.compiler.lookup.InvocationSite#isTypeAccess()
44          */
45         public boolean isTypeAccess() {
46                 return false;
47         }
48
49         
50         public StringBuffer printStatement(int indent, StringBuffer output) {
51
52                 printIndent(indent, output);
53                 printModifiers(this.modifiers, output);
54                 type.print(0, output).append(' ').append(this.name); 
55                 if (initialization != null) {
56                         output.append(" = "); //$NON-NLS-1$
57                         initialization.printExpression(indent, output);
58                 }
59                 return output.append(';');
60         }
61
62         public void resolve(BlockScope scope) {
63                 // do nothing by default (redefined for local variables)
64         }
65
66         /* (non-Javadoc)
67          * @see org.eclipse.jdt.internal.compiler.lookup.InvocationSite#setActualReceiverType(org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding)
68          */
69         public void setActualReceiverType(ReferenceBinding receiverType) {
70                 // do nothing by default
71         }
72
73         /* (non-Javadoc)
74          * @see org.eclipse.jdt.internal.compiler.lookup.InvocationSite#setDepth(int)
75          */
76         public void setDepth(int depth) {
77
78                 this.hiddenVariableDepth = depth;
79         }
80
81         /* (non-Javadoc)
82          * @see org.eclipse.jdt.internal.compiler.lookup.InvocationSite#setFieldIndex(int)
83          */
84         public void setFieldIndex(int depth) {
85                 // do nothing by default
86         }
87 }