package CSU670_Plugin.gen;
import edu.neu.ccs.demeter.dj.*;
import edu.neu.ccs.demeter.aplib.cd.ClassDefVisitor;
import edu.neu.ccs.demeter.aplib.cd.ClassDef;
import java.io.*;
import java.util.*;

import edu.neu.ccs.demeter.*;
class BCompound extends DecNodeSetBody {
  protected BinaryOp op;
  public BinaryOp get_op() { return op; }
  public void set_op(BinaryOp new_op) { op = new_op; }
  protected DecNodeSetBody_PCList args;
  public DecNodeSetBody_PCList get_args() { return args; }
  public void set_args(DecNodeSetBody_PCList new_args) { args = new_args; }
  public BCompound() { super(); }
  public BCompound(BinaryOp op, DecNodeSetBody_PCList args) {
    super();
    set_op(op);
    set_args(args);
  }
  public static BCompound parse(java.io.Reader in) throws ParseException { return new Parser(in)._BCompound(); }
  public static BCompound parse(java.io.InputStream in) throws ParseException { return new Parser(in)._BCompound(); }
  public static BCompound parse(String s) {
    try { return parse(new java.io.StringReader(s)); }
    catch (ParseException e) {
      throw new RuntimeException(e.toString());
    }
  }

    List eval(){
        List t = new ArrayList();
        for(Enumeration e = args.elements();e.hasMoreElements();)
        	t.add(((DecNodeSetBody)e.nextElement()).eval());
        return op.apply(t);
    }

  void universal_trv0_bef(UniversalVisitor _v_) {
    super.universal_trv0_bef(_v_);
    ((UniversalVisitor) _v_).before(this);
  }

  void universal_trv0_aft(UniversalVisitor _v_) {
    ((UniversalVisitor) _v_).after(this);
    super.universal_trv0_aft(_v_);
  }

  void universal_trv0(UniversalVisitor _v_) {
    universal_trv0_bef(_v_);
    ((UniversalVisitor) _v_).before_op(this, op);
    op.universal_trv0(_v_);
    ((UniversalVisitor) _v_).after_op(this, op);
    ((UniversalVisitor) _v_).before_args(this, args);
    args.universal_trv0(_v_);
    ((UniversalVisitor) _v_).after_args(this, args);
    super.universal_trv0(_v_);
    universal_trv0_aft(_v_);
  }

}
