Cd_graph { traversal allInh(CountingVisitor c) { bypassing {-> *,vertex,*, => Neighbors, Construct} to Vertex; // is not elegant; should be: // *from* Cd_graph *via* Alternat *to* Vertex } } CountingVisitor { before Vertex (@ this.set_total(new Integer( total.intValue() + 1)) ; @) } Main { (@ static public void main(String args[]) throws Exception { Cd_graph graph = Cd_graph.parse(System.in); CountingVisitor count = new CountingVisitor(new Integer(0)); graph.allInh(count); int result = count.get_total().intValue(); System.out.println("Inheritance relationships " + result); if(result == 8) { System.out.println("SUCCESS"); } else { System.out.println("FAILURE"); } } @) }