package EDU.neu.ccs.demeter.tools.apstudio.graphedit;
import java.awt.*;
import java.io.*;
import java.util.*;
import EDU.neu.ccs.demeter.*;
import EDU.neu.ccs.demeter.common.tg.*;


import EDU.neu.ccs.demeter.*;
class PathDirective extends StrategyExpression {
  protected NegativeConstraint constraint;
  public NegativeConstraint get_constraint() { return constraint; }
  public void set_constraint(NegativeConstraint new_constraint)
    { constraint = new_constraint; }
  protected PathSegment_List segments;
  public PathSegment_List get_segments() { return segments; }
  public void set_segments(PathSegment_List new_segments)
    { segments = new_segments; }
  protected TargetDirective targetdirective;
  public TargetDirective get_targetdirective() { return targetdirective; }
  public void set_targetdirective(TargetDirective new_targetdirective)
    { targetdirective = new_targetdirective; }
  PathDirective() { super(); }
  public PathDirective(NegativeConstraint constraint, PathSegment_List segments, TargetDirective targetdirective) {
    super();
    set_constraint(constraint);
    set_segments(segments);
    set_targetdirective(targetdirective);
  }
  public static PathDirective parse(java.io.InputStream in) throws ParseException
    { return new Parser(in)._PathDirective(); }
  public static PathDirective parse(String s) {
    try { return parse(new java.io.ByteArrayInputStream(s.getBytes())); }
    catch (ParseException e) { throw new RuntimeException(e.toString()); }
  }
  StrategyGraph toGraph(ClassName source) {
    __V_PathDirective_toGraph v0 = new __V_PathDirective_toGraph();
    v0.set_source(source);
    v0.start();
    __trav_toGraph(v0);
    v0.finish();
    return v0.get_return_val();
  }
  void universal_trv0_bef(UniversalVisitor _v_) {
    super.universal_trv0_bef(_v_);
    _v_.before(this);
  }
  void universal_trv0_aft(UniversalVisitor _v_) {
    _v_.after(this);
    super.universal_trv0_aft(_v_);
  }
  void universal_trv0(UniversalVisitor _v_) {
    universal_trv0_bef(_v_);
    if (constraint != null) {
      _v_.before_constraint(this, constraint);
    constraint.universal_trv0(_v_);
      _v_.after_constraint(this, constraint);
    }
    _v_.before_segments(this, segments);
    segments.universal_trv0(_v_);
    _v_.after_segments(this, segments);
    _v_.before_targetdirective(this, targetdirective);
    targetdirective.universal_trv0(_v_);
    _v_.after_targetdirective(this, targetdirective);
    super.universal_trv0(_v_);
    universal_trv0_aft(_v_);
  }
  void toAllSubclasses_Program_trv_bef(ClassNameTranspVisitor cntv, EdgeVisitor aev) {
    super.toAllSubclasses_Program_trv_bef(cntv, aev);
  }
  void toAllSubclasses_Program_trv_aft(ClassNameTranspVisitor cntv, EdgeVisitor aev) {
    super.toAllSubclasses_Program_trv_aft(cntv, aev);
  }
  void toAllSubclasses_Program_trv(ClassNameTranspVisitor cntv, EdgeVisitor aev) {
    toAllSubclasses_Program_trv_bef(cntv, aev);
    if (constraint != null) {
    constraint.toAllSubclasses_Program_trv(cntv, aev);
    }
    segments.toAllSubclasses_Program_trv(cntv, aev);
    targetdirective.toAllSubclasses_Program_trv(cntv, aev);
    toAllSubclasses_Program_trv_aft(cntv, aev);
  }
  void checkStars_ProgramBehavior_trv_bef(DummyVisitor dv) {
    super.checkStars_ProgramBehavior_trv_bef(dv);
    dv.before(this);
  }
  void checkStars_ProgramBehavior_trv_aft(DummyVisitor dv) {
    super.checkStars_ProgramBehavior_trv_aft(dv);
  }
  void checkStars_ProgramBehavior_trv(DummyVisitor dv) {
    checkStars_ProgramBehavior_trv_bef(dv);
    if (constraint != null) {
    constraint.checkStars_ProgramBehavior_trv(dv);
    }
    segments.checkStars_ProgramBehavior_trv(dv);
    targetdirective.checkStars_ProgramBehavior_trv(dv);
    checkStars_ProgramBehavior_trv_aft(dv);
  }
  void allSources_StrategyGraph_trv(GlobVisitor __v0) {  }
  void allDests_StrategyGraph_trv(GlobVisitor __v0) {  }
  void __trav_markReachableForwardFromSources_StrategyGraph_trv(__V_StrategyGraph_markReachableForwardFromSources __v0) {  }
  void __trav_markReachableBackwardFromTargets_StrategyGraph_trv(__V_StrategyGraph_markReachableBackwardFromTargets __v0) {  }
  void __trav_allSourcesAndTargetsMarked_StrategyGraph_trv(__V_StrategyGraph_allSourcesAndTargetsMarked __v0) {  }
  void __trav_getFirst_StrategyGraph_trv(java.util.BitSet nodes, __V_StrategyGraph_getFirst __v0) {  }
  public void __trav_toGraph(__V_PathDirective_toGraph __v0) {
    __trav_toGraph_PathDirective_trv(__v0);
  }
  void __trav_toGraph_PathDirective_trv_bef(__V_PathDirective_toGraph __v0) {
    super.__trav_toGraph_PathDirective_trv_bef(__v0);
    __v0.before(this);
  }
  void __trav_toGraph_PathDirective_trv_aft(__V_PathDirective_toGraph __v0) {
    super.__trav_toGraph_PathDirective_trv_aft(__v0);
  }
  void __trav_toGraph_PathDirective_trv(__V_PathDirective_toGraph __v0) {
    __trav_toGraph_PathDirective_trv_bef(__v0);
    if (constraint != null) {
    constraint.__trav_toGraph_PathDirective_trv(__v0);
    }
    segments.__trav_toGraph_PathDirective_trv(__v0);
    targetdirective.__trav_toGraph_PathDirective_trv(__v0);
    __trav_toGraph_PathDirective_trv_aft(__v0);
  }
}

