1 package net.sourceforge.phpdt.internal.compiler.parser;
3 import net.sourceforge.phpdt.internal.ui.PHPUiImages;
5 import org.eclipse.jface.resource.ImageDescriptor;
9 * A php variable declaration strongly inspired by the PHPFunctionDeclaration of Khartlage (:.
10 * @author khartlage, Matthieu Casanova
12 public class PHPVarDeclaration extends PHPSegment {
15 private final PHPVar variable;
17 * Create a php variable declaration.
18 * @param parent the parent object (it should be a php class)
19 * @param name the name of the variable
20 * @param index where the variable is in the file
21 * @param value the value
23 public PHPVarDeclaration(Object parent, String name, int index, String value) {
24 super(parent, name, index);
25 variable = new PHPVar(name,value);
29 * Create a php variable declaration.
30 * @param parent the parent object (it should be a php class)
31 * @param name the name of the variable
32 * @param index where the variable is in the file
34 public PHPVarDeclaration(Object parent, String name, int index) {
35 this(parent, name, index,null);
39 * Get the image of a variable.
40 * @return the image that represents a php variable
42 public ImageDescriptor getImage() {
43 return PHPUiImages.DESC_VAR;
48 * @return a phpvar object
50 public PHPVar getVariable() {
54 public String toString() {
55 return variable.toString();