// scs.beh // // Main program code Main { {{ // 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)." ); } }} }