1 package net.sourceforge.phpdt.internal.compiler.ast;
 
   4 import java.util.ArrayList;
 
   7  * This is a cast expression.
 
   8  * @author Matthieu Casanova
 
  10 public class CastExpression extends Expression {
 
  12   /** The type in which we cast the expression. */
 
  13   public ConstantIdentifier type;
 
  15   /** The expression to be casted. */
 
  16   public Expression expression;
 
  19    * Create a cast expression.
 
  20    * @param type the type
 
  21    * @param expression the expression
 
  22    * @param sourceStart starting offset
 
  23    * @param sourceEnd ending offset
 
  25   public CastExpression(final ConstantIdentifier type,
 
  26                         final Expression expression,
 
  27                         final int sourceStart,
 
  28                         final int sourceEnd) {
 
  29     super(sourceStart, sourceEnd);
 
  31     this.expression = expression;
 
  35    * Return the expression as String.
 
  36    * @return the expression
 
  38   public String toStringExpression() {
 
  39     final StringBuffer buff = new StringBuffer("(");
 
  40     buff.append(type.toStringExpression());
 
  42     buff.append(expression.toStringExpression());
 
  43     return buff.toString();
 
  47    * Get the variables from outside (parameters, globals ...)
 
  48    * @return the variables from outside
 
  50   public List getOutsideVariable() {
 
  51     return new ArrayList();
 
  55    * get the modified variables.
 
  56    * @return the variables from we change value
 
  58   public List getModifiedVariable() {
 
  59     return expression.getModifiedVariable();
 
  63    * Get the variables used.
 
  64    * @return the variables used
 
  66   public List getUsedVariable() {
 
  67     return expression.getUsedVariable();