// *Use flattened .cd file as input ** //***************************************************************************** // (@ import java.awt.*; import java.io.*; import java.util.*; import java.lang.Math ; @) // Topmost class in class structure is Graph UGraph = "#Class" "#Dictionary" "#Graph" < vertices >UVertex_List < edges > UEdge_List . // Following is description of class Vertex_List and its parts UVertex_List ~ "#Vertex" "#List" { UVertex } . UVertex : UAltVertex | UConstVertex | UTerm *common* < vid > UID < vertexname > UVertexName < position > Coordinates [< incoming > IEdge_List] [< outgoing > OEdge_List] [Decorator]. IEdge_List ~ "#Incoming" { UID }. OEdge_List ~ "#Outgoing" { UID }. UConstVertex = "#ConstVertex" . UAltVertex = "#AltVertex" . UTerm = "#TermVertex" . // Following is description of class Edge_List and its parts UEdge_List ~ "#Edge" "#List" { UEdge } . UEdge : UAltEdge | UConstEdge *common* < eid >UID [Decorator] < fromVertex > UID < toVertex > UID. UAltEdge = "#AltEdge" . UConstEdge = "#ConstEdge" < edgename > UEdgeName Cardinality. Cardinality = < lower > Lower [ < upper > Upper]. Lower = Integer. Upper = "." "." String. // Classes common to Vertex and Edge UID = < id > Integer. UEdgeName = Ident. UVertexName = Ident. // Classes common to Vertex , VertexName , Edge and EdgeName Coordinates = "{" X Y "}". X = Integer . Y = Integer . //Decorator to store the attribute(color?) of vertices and edges Decorator = TravTag PList(Attributes). Attributes = Integer. TravTag = "travstat" Integer. IndependantTraversal = UID UID List(UID). UniqueIDGenerator = . List(S) ~ {S}. PList(S) ~ "(" {S} ")". ReadVertexVisitor = UGraph String Integer Integer . ReadEdgeVisitor = UGraph String String Integer String Integer Integer . Main = .