package eu.bryants.anthony.toylanguage.ast.expression;

import eu.bryants.anthony.toylanguage.ast.type.Type;
import eu.bryants.anthony.toylanguage.parser.LexicalPhrase;

/*
 * Created on 10 Apr 2012
 */

/**
 * @author Anthony Bryant
 */
public class CastExpression extends Expression
{
  private Expression expression;

  public CastExpression(Type type, Expression expression, LexicalPhrase lexicalPhrase)
  {
    super(lexicalPhrase);
    setType(type); // the Type is stored in the superclass
    this.expression = expression;
  }

  /**
   * @return the expression
   */
  public Expression getExpression()
  {
    return expression;
  }
}

@@ -635,11 +635,111 @@
 ion;%0A  %7D
+%0A%0A  @Override%0A  public String toString()%0A  %7B%0A    return %22cast%3C%22 + getType() + %22%3E %22 + expression;%0A  %7D
 %0A%7D%0A

Add CastExpression.toString()