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 GraphNodeRegExp extends Simple {
  protected ClassNamePrefix classnameprefix;
  public ClassNamePrefix get_classnameprefix() { return classnameprefix; }
  public void set_classnameprefix(ClassNamePrefix new_classnameprefix) { classnameprefix = new_classnameprefix; }
  protected WildCard wildcard;
  public WildCard get_wildcard() { return wildcard; }
  public void set_wildcard(WildCard new_wildcard) { wildcard = new_wildcard; }
  public GraphNodeRegExp() { super(); }
  public GraphNodeRegExp(ClassNamePrefix classnameprefix, WildCard wildcard) {
    super();
    set_classnameprefix(classnameprefix);
    set_wildcard(wildcard);
  }
  public static GraphNodeRegExp parse(java.io.Reader in) throws ParseException { return new Parser(in)._GraphNodeRegExp(); }
  public static GraphNodeRegExp parse(java.io.InputStream in) throws ParseException { return new Parser(in)._GraphNodeRegExp(); }
  public static GraphNodeRegExp 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(Iterator i=Main.definedNodes.iterator();i.hasNext();){
    		String cur = i.next().toString();
    		if(cur.startsWith(classnameprefix.ident.toString()))
    			t.add(cur);
    	}
        return 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_classnameprefix(this, classnameprefix);
    classnameprefix.universal_trv0(_v_);
    ((UniversalVisitor) _v_).after_classnameprefix(this, classnameprefix);
    ((UniversalVisitor) _v_).before_wildcard(this, wildcard);
    wildcard.universal_trv0(_v_);
    ((UniversalVisitor) _v_).after_wildcard(this, wildcard);
    super.universal_trv0(_v_);
    universal_trv0_aft(_v_);
  }

}
