public class Neg extends Unary {
  public Neg (int id) {
  }
  public Object sem () throws SemanticException {
    super.sem();
    if (childT != Integer.class && childT != Float.class)
      throw new SemanticException("unary - expects float or int");
    return T = childT;
  }
  public Object run () {
    if (T == Integer.class)
      return IntLit.neg((Number)child.run());
    return FloatLit.neg((Number)child.run());
  }
}

