1 package net.sourceforge.phpdt.internal.compiler.ast;
6 * This is a cast expression.
7 * @author Matthieu Casanova
9 public class CastExpression extends Expression {
11 /** The type in which we cast the expression. */
12 public ConstantIdentifier type;
14 /** The expression to be casted. */
15 public 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 public void getOutsideVariable(final List list) {
52 * get the modified variables.
54 public void getModifiedVariable(final List list) {
55 expression.getModifiedVariable(list);
59 * Get the variables used.
61 public void getUsedVariable(final List list) {
62 expression.getUsedVariable(list);