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 class FieldDeclaration extends Statement implements Outlineable {
22 public VariableDeclaration[] vars;
24 private Object parent;
25 private 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 public void getOutsideVariable(final List list) {
83 * get the modified variables.
85 public void getModifiedVariable(final List list) {
89 * Get the variables used.
91 public void getUsedVariable(final List list) {