// generated by program in: // http://www.ccs.neu.edu/research/demeter/sources/DemeterJava/examples/j-gprint // output simplified A { (@ void g_print() { PrintingVisitor pv = new PrintingVisitor(); this.t(pv); } void display() {} int countG() {return 1;} @) traversal t(PrintingVisitor pv) {to *;} } Main { (@ static public void main(String args[]) throws Exception { A a = A.parse(System.in); System.out.println("print:"); a.g_print(); System.out.println(); System.out.println("tree structure:"); a.display(); System.out.println("count:"); int result = a.countG(); System.out.println(result + " done "); } @) } PrintingVisitor{ before A (@ System.out.print(" a "); @) after A (@ System.out.print(" enda "); @) before D (@ System.out.print(" d "); @) before E (@ System.out.print(" e "); @) before H (@ System.out.print(" h "); @) }