package aspectEditor.aspectEditorUtils;
import java.util.jar.JarFile;
import java.util.*;
import java.io.*;
import edu.neu.ccs.demeter.aplib.*;
import edu.neu.ccs.demeter.*;
public abstract class Strategy implements StrategyI {
  public Strategy() {
    super();
  }
  public static Strategy readFrom(InputStream in) throws ParseException {
    return readFrom(in, new HashMap());
  }
  public static Strategy readFrom(Reader in) throws ParseException {
    return readFrom(in, new HashMap());
  }
  public static Strategy fromString(String s) {
    return fromString(s, new HashMap());
  }
  public static Strategy readFrom(InputStream in, Map env) throws ParseException {
    Strategy s =  StrategyExpression.parse(in).get_strategy();
    s.attachEnv(env);
    return s;
  }
  public static Strategy readFrom(Reader in, Map env) throws ParseException {
    Strategy s = StrategyExpression.parse(in).get_strategy();
    s.attachEnv(env);
    return s;
  }
  public static Strategy fromString(String in, Map env) {
    Strategy s = StrategyExpression.parse(in).get_strategy();
    s.attachEnv(env);
    return s;
  }
  void attachEnv(Map env) {
    __V_Strategy_attachEnv v0 = new __V_Strategy_attachEnv();
    v0.set_env(env);
    v0.start();
    __trav_attachEnv(v0);
    v0.finish();
  }
  public boolean isSimpleStrategy() {
    return false;
  }
  public SimpleStrategyI toSimpleStrategy() {
    return (SimpleStrategyI) this;
  }
  public boolean isStrategyCombination() {
    return false;
  }
  public StrategyCombinationI toStrategyCombination() {
    return (StrategyCombinationI) this;
  }
  public abstract Set getSourceNames() ;
  public abstract Set getTargetNames() ;
  public Object clone() {
    try {
      return super.clone();
    } catch (CloneNotSupportedException e) {
      throw new RuntimeException(e);
    }
  }
  void universal_trv0_bef(UniversalVisitor _v_) {
    ((UniversalVisitor) _v_).before(this);
  }

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

  void universal_trv0(UniversalVisitor _v_) {  }

  public void __trav_attachEnv(__V_Strategy_attachEnv __v0) {
    __trav_attachEnv_Strategy_trv(__v0);
  }

  void __trav_attachEnv_Strategy_trv_bef(__V_Strategy_attachEnv __v0) {  }

  void __trav_attachEnv_Strategy_trv_aft(__V_Strategy_attachEnv __v0) {  }

  void __trav_attachEnv_Strategy_trv(__V_Strategy_attachEnv __v0) {  }

  void __trav_toGraph_PathDirective_trv_bef(__V_PathDirective_toGraph __v0) {  }

  void __trav_toGraph_PathDirective_trv_aft(__V_PathDirective_toGraph __v0) {  }

  void __trav_toGraph_PathDirective_trv(__V_PathDirective_toGraph __v0) {  }

}
