1 package net.sourceforge.phpdt.internal.compiler.ast;
6 * This is a cast expression.
7 * @author Matthieu Casanova
9 public final class CastExpression extends Expression {
11 /** The type in which we cast the expression. */
12 private final ConstantIdentifier type;
14 /** The expression to be casted. */
15 private final Expression expression;
18 * Create a cast expression.
19 * @param type the type
20 * @param expression the expression
21 * @param sourceStart starting offset
22 * @param sourceEnd ending offset
24 public CastExpression(final ConstantIdentifier type,
25 final Expression expression,
26 final int sourceStart,
27 final int sourceEnd) {
28 super(sourceStart, sourceEnd);
30 this.expression = expression;
34 * Return the expression as String.
35 * @return the expression
37 public String toStringExpression() {
38 final StringBuffer buff = new StringBuffer("(");
39 buff.append(type.toStringExpression());
41 buff.append(expression.toStringExpression());
42 return buff.toString();
46 * Get the variables from outside (parameters, globals ...)
48 * @param list the list where we will put variables
50 public void getOutsideVariable(final List list) {}
53 * get the modified variables.
55 * @param list the list where we will put variables
57 public void getModifiedVariable(final List list) {
58 expression.getModifiedVariable(list);
62 * Get the variables used.
64 * @param list the list where we will put variables
66 public void getUsedVariable(final List list) {
67 expression.getUsedVariable(list);