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