// *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 = . //**********reduced demjava.cd . actual source******** //*****from*****/proj/demsys/demjava/sourceC++/Java/demjava.cd ****** //*******as of Oct 29th 1996****** // demjava.cd -- class dictionary for Demeter/Java Program = [ JavaCode ] ClassGraph. ClassGraph = DList(ClassDef). ClassDef = ParamClassName ClassParts "." [ DFS_mark ] [ PP_mark ] . ParamClassName = ClassName ["(" Commalist(ClassName) ")"]. ClassParts : ConstOrAltClass | RepetitionClass. ConstOrAltClass : ConstructionClass | AlternationClass *common* + + + List(PartOrSyntax) ClassParents - - -. PartOrSyntax : Part | OptionalPart | Syntax. Part = [ "<" PartName ">" ] ClassSpec. OptionalPart = "[" Sandwich(Part) "]". ClassParents = [ "*extends*" ClassSpec ] [ "*implements*" Commalist(ClassSpec) ] . ConstructionClass = "=". AlternationClass = ":" + + + Barlist(Subclass) - - - [ Common ]. Subclass = ClassSpec. Common = *l + + + "*common*" - - -. RepetitionClass = "~" Sandwich(RepeatedPart). RepeatedPart = [ ClassSpec ] "{" Sandwich(ClassSpec) "}". Sandwich(S) = List(Syntax) S List(Syntax) . ClassSpec = ClassName ["(" Commalist(ClassSpec) ")" ] [ PP_mark ] . Syntax : PlainSyntax | PrintCommand. PlainSyntax = String. PrintCommand : PrintIndent | PrintUnindent | PrintSkip | PrintSpace. PrintIndent = "+" . PrintUnindent = "-" . PrintSkip = "*l" . PrintSpace = "*s" . // Marks for traversal bookkeeping. DFS_mark = "*dfs*". PP_mark = "*pp*". // Verbatim java code. Verbatim = JavaCode. // Terminal buffer classes. ClassName = Ident. PartName = Ident. TraversalName = Ident. VisitorName = Ident. MethodName = Ident. JavaCode = String. // Parameterized class definitions. List(S) ~ {S}. PList(S) ~ "(" {S} ")". SList(S) ~ S { *l S } *l . DList(S) ~ S { *l *l S } *l . Commalist(S) ~ S {"," S}. Barlist(S) ~ S { *l "|" S}. // Extra utility parameterized classes. Parameterized = Commalist(Part). SyntaxTable = List(PlainSyntax). ///********** //visitors (text-uml ones) PrintVisitor = UGraph . PlacementVisitor = UGraph . EdgeDistinctionVisitor = String. ClassNameRetVisitor = ClassName. ClassNameTranspVisitor = ParamClassName. EdgeVisitor = EdgeDistinctionVisitor ClassNameTranspVisitor UGraph. //************ // Visitors and Main class (the GUI ones) ReadVertexVisitor= VertexContainer . VertexContainer = .//< construction > Vector < alternation > Vector < termination > Vector. ReadEdgeVisitor = < elements > EdgeContainer . EdgeContainer = .//< construction > Vector < alternation > Vector . SaveGraphVisitor = < graphString > String . Main = . CountingVisitor = Integer.