// main.beh // Last modified -binoy - May 26'98 // Author - binoy // This is used to test out different parts of the big application separately //*******************Main********************************/ Main { (@ /** A command line interface to test out all the non-gui part of ApStudio The input is a class dictionary file(cd) and a text file containing a strategy expression. The ouput is the propagation graph corresponding to the input strategy. The non-gui parts of ApStudio are - cd-to-gcd , gcd-to-cd , placement , subgraph , propagation-graph */ public static void main(String args[]) throws Exception { String strfilename = args[0]; FileInputStream fi=new FileInputStream(strfilename); Program prog = Program.parse(fi); try{ UGraph graph = prog.print_edges(); //print_edges() converts cd to gcd strfilename = args[1]; FileInputStream fi2=new FileInputStream(strfilename); StrategyGraph sg = StrategyGraph.parse(fi2); sg = sg.toGraph(sg.getFirst()); //needed to initialise strategy properly //System.out.println("did sg.toGraph"); graph.computeSubgraph(sg); //compute the subgraph //System.out.println("graph- \n"+ graph.GetGraphString()); //propagation graph - UGraph gnew = graph.parse(graph.GetMarkedGraphString()); //GetMarkedGraphString returns only the //marked portion of the gcd System.out.println(gnew.getCdString()); //getCdString() does gcd to cd conversion //System.out.println("Done"); } catch(ParameterisationException e) { System.out.println("Cannot handle parameterized classes in class dictionary"); } } @) }