import edu.neu.ccs.demeter.dj.*; import java.util.*; import edu.neu.ccs.demeter.*; class Main { public Main() { super(); } public static Main parse(java.io.Reader in) throws ParseException { return new Parser(in)._Main(); } public static Main parse(java.io.InputStream in) throws ParseException { return new Parser(in)._Main(); } public static Main parse(String s) { try { return parse(new java.io.StringReader(s)); } catch (ParseException e) { throw new RuntimeException(e.toString()); } } // Define static vars. The variables ecount and wcount represent the // total error count and warning count, respectively. static ClassGraph cg; static Cd_graph cdg; static String IdentLoc = "edu.neu.ccs.demeter.Ident"; static int ecount = 0; static int wcount = 0; public static void main(String args[]) throws Exception { // Create new Cd_graph and ClassGraph objects. These are used globally. cdg = Cd_graph.parse(System.in); cg = new ClassGraph(true,false); // Flatten the Cd_graph. cdg.flatten(); // Create traversal graph which targets each class defined in the input // file. TraversalGraph tg = new TraversalGraph( "from Cd_graph bypassing ParentList to Adjacency", cg ); // Create visitors for the traversal. UndefClassVisitor unV = new UndefClassVisitor(); UniquePartsVisitor upV = new UniquePartsVisitor(); SingleInhVisitor siV = new SingleInhVisitor(); InhCycleVisitor icV = new InhCycleVisitor(); TBRVisitor tbV = new TBRVisitor(); // Traverse... tg.traverse(cdg, new Visitor[] {unV, upV, siV, icV, tbV}); // Print final results System.out.println( "Check completed. Found " + ecount + " error(s) and " + wcount + " warning(s)." ); } 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_) { universal_trv0_bef(_v_); universal_trv0_aft(_v_); } }