1 package net.sourceforge.phpdt.internal.compiler.ast;
5 import net.sourceforge.phpdt.internal.compiler.parser.Outlineable;
6 import net.sourceforge.phpdt.internal.ui.PHPUiImages;
8 import org.eclipse.jface.resource.ImageDescriptor;
9 import org.eclipse.jface.text.Position;
12 * A Field declaration.
13 * This is a variable declaration for a php class
14 * In fact it's an array of VariableUsage, since a field could contains
17 * @author Matthieu Casanova
19 public final class FieldDeclaration extends Statement implements Outlineable {
22 public final VariableDeclaration[] vars;
24 private final Object parent;
25 private final Position position;
29 * @param vars the array of variables.
30 * @param sourceStart the starting offset
31 * @param sourceEnd the ending offset
33 public FieldDeclaration(final VariableDeclaration[] vars,
34 final int sourceStart,
36 final Object parent) {
37 super(sourceStart, sourceEnd);
40 position = new Position(sourceStart, sourceEnd);
44 * Return the object into String.
45 * @param tab how many tabs (not used here
48 public String toString(final int tab) {
49 final StringBuffer buff = new StringBuffer(tabString(tab));
50 buff.append("var ");//$NON-NLS-1$
51 for (int i = 0; i < vars.length; i++) {
53 buff.append(",");//$NON-NLS-1$
55 buff.append(vars[i].toStringExpression());
57 return buff.toString();
61 * Get the image of a variable.
62 * @return the image that represents a php variable
64 public ImageDescriptor getImage() {
65 return PHPUiImages.DESC_VAR;
68 public Object getParent() {
72 public Position getPosition() {
77 * Get the variables from outside (parameters, globals ...)
79 * @param list the list where we will put variables
81 public void getOutsideVariable(final List list) {}
84 * get the modified variables.
86 * @param list the list where we will put variables
88 public void getModifiedVariable(final List list) {}
91 * Get the variables used.
93 * @param list the list where we will put variables
95 public void getUsedVariable(final List list) {}