public class Binary implements Node {
  protected Node parent, a, b;
  protected Object T, aT, bT;

  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) {
    switch (i) {
    case 0:	a = n; break;
    case 1:	b = n; break;
    default:	throw new RuntimeException("add binary child "+i);
    }
  }
  public Node jjtGetChild (int i) {
    switch (i) {
    case 0:	return a;
    case 1:	return b;
    default:	throw new RuntimeException("binary child "+i);
    }
  }
  public int jjtGetNumChildren () {
    return 2;
  }
  public Object sem () throws SemanticException {
    if (aT == null) aT = a.sem();
    if (bT == null) bT = b.sem();
    return bT;
  }
  public Object run () {
    a.run();
    return b.run();
  }
}

