public class Unary implements Node {
  protected Node parent, child;
  protected Object T, childT;

  public void jjtOpen () {
  }
  public void jjtClose () {
  }
  public void jjtSetParent (Node n) {
    parent = n;
  }
  public Node jjtGetParent () {
    return parent;
  }
  public void jjtAddChild (Node n, int i) {
    if (i != 0)
      throw new RuntimeException("add unary child "+i);
    child = n;
  }
  public Node jjtGetChild (int i) {
    if (i != 0)
      throw new RuntimeException("unary child "+i);
    return child;
  }
  public int jjtGetNumChildren () {
    return 1;
  }
  public Object sem () throws SemanticException {
    if (childT == null) childT = child.sem();
    return childT;
  }
  public Object run () {
    return child.run();
  }
}


