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.flow.FlowContext;
14 import net.sourceforge.phpdt.internal.compiler.flow.FlowInfo;
15 import net.sourceforge.phpdt.internal.compiler.lookup.BlockScope;
17 public abstract class AbstractVariableDeclaration extends Statement {
20 public TypeReference type;
21 public Expression initialization;
24 public int declarationEnd;
25 public int declarationSourceStart;
26 public int declarationSourceEnd;
27 public int modifiersSourceStart;
29 public AbstractVariableDeclaration() {}
31 public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext, FlowInfo flowInfo) {
35 public abstract String name();
37 public void resolve(BlockScope scope) {}
39 public String toString(int tab) {
41 String s = tabString(tab);
42 if (modifiers != AccDefault) {
43 s += modifiersString(modifiers);
45 s += type.toString(0) + " " + new String(name()); //$NON-NLS-1$
46 if (initialization != null)
47 s += " = " + initialization.toStringExpression(tab); //$NON-NLS-1$