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 UCompound extends DecNodeSetBody {
  protected UnaryOp op;
  public UnaryOp get_op() { return op; }
  public void set_op(UnaryOp new_op) { op = new_op; }
  protected DecNodeSetBody arg;
  public DecNodeSetBody get_arg() { return arg; }
  public void set_arg(DecNodeSetBody new_arg) { arg = new_arg; }
  public UCompound() { super(); }
  public UCompound(UnaryOp op, DecNodeSetBody arg) {
    super();
    set_op(op);
    set_arg(arg);
  }
  public static UCompound parse(java.io.Reader in) throws ParseException { return new Parser(in)._UCompound(); }
  public static UCompound parse(java.io.InputStream in) throws ParseException { return new Parser(in)._UCompound(); }
  public static UCompound parse(String s) {
    try { return parse(new java.io.StringReader(s)); }
    catch (ParseException e) {
      throw new RuntimeException(e.toString());
    }
  }

    List eval(){
        return op.apply(arg.eval());
    }

  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_arg(this, arg);
    arg.universal_trv0(_v_);
    ((UniversalVisitor) _v_).after_arg(this, arg);
    super.universal_trv0(_v_);
    universal_trv0_aft(_v_);
  }

}
