import gen.*; import edu.neu.ccs.demeterf.*; import edu.neu.ccs.demeterf.demfgen.lib.*; public class Main { static void p(String s){ System.out.println(s); } static void p(){ System.out.println(); } public static void main(String args[]) throws Exception { AbstractClass tree = AbstractClass.parse(System.in); // p(" Tree: "+tree+"\n"); // tree.print(); p(); p("The input in three different forms =============================="); p(tree.display() + "\n"); p(tree.print() + "\n"); p(tree.toStr() + "\n"); // Pack res = new Traversal(new Check()).traverse(tree); // p(res.toStr() + "\n"); // p(" Check: "+new Traversal(new Check()).traverse(tree)+"\n"); p("The result =========================="); p(" Check result " + Check.check(tree)); /* p(" Sum: "+new Traversal(new Sum()).traverse(tree)+"\n"); p(" Diameter: "+new Traversal(new Diameter()).traverse(tree)+"\n"); DiameterPair pair = new Traversal(new Diameter()).traverse(tree); pair.print(); p(); p(" Diameter2: "+tree.diameter2() +"\n"); p(" ToStr: "+new Traversal(new ToStr()).traverse(tree)+"\n"); p(" Incr: "+new Traversal(new Incr()).traverse(tree)+"\n"); BSTInt incremented = new Traversal(new Incr()).traverse(tree); incremented.print(); p(); p("Height: "+new Traversal(new Height()).traverse(tree,0)+"\n"); p("Height2: "+new Traversal(new Height2()).traverse(tree,0)+"\n"); p("Height3: "+new Traversal(new Height3()).traverse(tree,new DownHeight(0))+"\n"); p("String: "+new Traversal(new Strs()).traverse(tree)+"\n"); // what does this do?? creates a tree of strings. Why not caught by type checking? p("Rev: "+new Traversal(new Rev()).traverse(tree)+"\n"); // BSTInt withText = new Traversal(new Rev()).traverse(tree); // Does not work with a tree of Integer BSTInt reversed = new Traversal(new Rev()).traverse(tree); reversed.print(); p(); System.out.println(" done "); */ } } /* public static void p(String s){ System.out.print(s); } public static void main(String args[]) throws Exception { RawMaterial start = RawMaterial.parse(System.in); // some sample functionality p(start.display() + "\n"); p(start.print() + "\n"); p(start.toStr() + "\n"); System.out.println(start.equals(start)); p(Magic.magic(start).display() + "\n"); Map statistics = start.countRelationNrs(); p(statistics.toString() + "\n"); p(new Traversal(new Print()).traverse(statistics).toString() + "\n"); p(statistics.keys().toString() + "\n"); for (RelationNr w : statistics.keys()) { p(w.toStr() + "\n"); } } } */