Cd_graph { {{ public void terminalBufferLimit(ClassGraph cg) { Strategy sg = new Strategy("from Cd_graph through Construct_ns to Vertex"); TraversalGraph tg = new TraversalGraph(sg,cg); tg.traverse( this, new Visitor() { public Ident current_Vertex; public Integer number_Of_Parts; public boolean inside_Class; public void start() { currentVertex = new Ident(""); number_Of_Parts = new Integer(0); inside_Class = false; } public void before(Adjacency host){ currentVertex = host.get_source().get_vertex_name(); number_Of_parts = new Integer(0); if(Main.debug) System.out.println("Before Adjacency: " + current_Vertex.toString() ); } public void before(Vertex host) { if ( (number_Of_Parts.intValue() > 1 || inside_Class) && host.isTerminalClass()) System.out.println(" *** ERROR DETECTED: Class "+current_Vertex.toString()+" Exceeds Terminal Buffer Limit. Class " + host.get_vertex_name().toString() + " is not the only part class. *** " ); if(Main.debug) System.out.println("Before Vertex: " + host.get_vertex_name().toString() ); } public void before(Any_vertex_List host){ number_Of_Parts = new Integer(host.size()); if(Main.debug) System.out.println("Num Parts: "+number_Of_Parts); } public void before(Term_Comma_list host) { inside_Class = true; if(Main.debug) System.out.println("Inside ParamClass. "); } public void after(Term_Comma_list host) {inside_Class = false;} }); } }} } Vertex { {{ private static String builtinTypes[] = { "boolean", "char", "byte", "short", "int", "long", "float", "double" }; private static String terminalClasses[] = { // from java.lang.*: "Boolean", "Character", "Integer", "Long", "Float", "Double", "Number", "String", "StringBuffer", // from demeter.*: "Ident", "Text", "Line", "Word" }; }} boolean isTerminalClass() {{ String s = vertex_name.toString(); for (int i = 0; i < terminalClasses.length; i++) { if (terminalClasses[i].equals(s)) return true; } return false; }} }} }