1 package net.sourceforge.phpdt.internal.compiler.ast;
4 * This is a cast expression.
5 * @author Matthieu Casanova
7 public class CastExpression extends Expression {
9 /** The type in which we cast the expression. */
10 public ConstantIdentifier type;
12 /** The expression to be casted. */
13 public Expression expression;
16 * Create a cast expression.
17 * @param type the type
18 * @param expression the expression
19 * @param sourceStart starting offset
20 * @param sourceEnd ending offset
22 public CastExpression(ConstantIdentifier type,
23 Expression expression,
26 super(sourceStart, sourceEnd);
28 this.expression = expression;
32 * Return the expression as String.
33 * @return the expression
35 public String toStringExpression() {
36 final StringBuffer buff = new StringBuffer('(');
37 buff.append(type.toStringExpression());
39 buff.append(expression.toStringExpression());
40 return buff.toString();