1 package net.sourceforge.phpdt.internal.compiler.ast;
3 import net.sourceforge.phpdt.internal.compiler.parser.Outlineable;
4 import net.sourceforge.phpdt.internal.ui.PHPUiImages;
5 import org.eclipse.jface.resource.ImageDescriptor;
8 * @author Matthieu Casanova
10 public class InclusionStatement extends Statement implements Outlineable {
12 public static final int INCLUDE = 0;
13 public static final int INCLUDE_ONCE = 1;
14 public static final int REQUIRE = 2;
15 public static final int REQUIRE_ONCE = 3;
16 public boolean silent;
17 /** The kind of include. */
19 public Expression expression;
21 private Object parent;
23 public InclusionStatement(Object parent,
25 Expression expression,
27 super(sourceStart, expression.sourceEnd);
28 this.keyword = keyword;
29 this.expression = expression;
33 public String keywordToString() {
36 return "include"; //$NON-NLS-1$
38 return "include_once"; //$NON-NLS-1$
40 return "require"; //$NON-NLS-1$
42 return "require_once"; //$NON-NLS-1$
44 return "unknown keyword";//$NON-NLS-1$
48 * Return the object into String.
49 * @param tab how many tabs (not used here
52 public String toString(int tab) {
53 final StringBuffer buffer = new StringBuffer(tabString(tab));
57 buffer.append(keywordToString());
59 buffer.append(expression.toStringExpression());
60 return buffer.toString();
64 * Get the image of a variable.
65 * @return the image that represents a php variable
67 public ImageDescriptor getImage() {
68 return PHPUiImages.DESC_INC;
71 public Object getParent() {