// // Modification History: // // 12/05/95 by Ron Westberg (westber) // Added '[ "defaultTermVertex" < defaultTermVertex > Term]' to the // Graph object so we could impliment termial classes. // // 12/04/95 by Peter Tandara-Kuhns (ptandara) // Added "pretty printing" command characters to the Cd_Graph classes. // // 12/04/95 by Tom Kneeland (tomk) // Made some changes to better support the unique IDs. It was pointed // out by Carlos that multiple vertices and edges with the same names // stored in a saved file would confuse the system. Therefore the // unique IDs are no longer optional, but must apear in the input // files. Once all the objects are cleaned up after being loaded into // C++ object, new IDs will be given to them to ensure uniqueness as // the user adds and deletes stuff. // // 12/02/95 by Tom Kneeland (tomk) // Made changes to support the use of Unique IDs for all Vertices, and // Edges. Added a Class called IDGenerator which has a DemNumber data // member and will store the next ID to be used when an object is // created. // Also added datamembers to Edge and Vertex to contain the unique // IDs assigned when they are created. // // 11/28/95 10:30 am by Ron Westberg (westber) // Added edges "defaultConstEdge" and "defaultAltEdge" from Graph to // ConstEdge and AltEdge, respectively. This allows us to initalize a // ConstEdge object or an AltEdge object, then fill in the data of that // object and then add it to the Graph appending onto the Edge_List. // // // 11/26/95 by Peter Tandara-Kuhns (ptandara) // Added new classes for constructing and printing a CDG // COM1205 Class Dictionary - DemDraw Application // // // 11/22/95 7:42 pm by Ron Westberg (westber) // Added edges "defaultConstVertex" and "defaultAltVertex" from Graph to // ConstVertex and AltVertex, respectively. This allows us to initalize a // ConstVertex object or an AltVertex object, then fill in the data of // that object and then add it to the Graph by appending onto the // Vertex_List. // // // 11/21/95 @ 9:32 pm by Tom Kneeland (tomk) // Documented changes made for Use Case 2. These Changes include // Changed Coordinates to have a DemString datamember, as opposed to // two DemNumbers. It was determined that the C++ code would never have // to change the values stored in this object, therefore we could store // the exact string that tcl needed to draw verticies and labels. This // change made all interaction to tcl easier. // // Also added a Coordinates object to support lines with // bends. tcl will generate the actual list of points to be stored in // this string. This datamember is optional, since lines can be strait. // // Made a vertex position, and a vertex name position optional. This // allowed the demeter-input file to be modified, so that whole verticies // did not have to be specified when declaring edges. // // // 11/16/95 @ 10:00 by Ron // added Coodinates_List and Term // renamed vn_position to vn_offset // renamed e_position to en_offset // // 10/17/96 // prepared for Demeter/Java // started with: // /proj/lieber2/f95/com1205/tools/demdraw/demdraw-0.4/src // DemString -> String // DemIdent -> Ident // DemNumber -> Integer // because "to" is a Demeter/Java keyword: // "to" to "toVertex" // added: // // Visitors. // PrintVisitor = . // to test program // because of scanner restriction // changed *common* to "*" "common" "*" // The latest demjava.cd available from // /proj/demsys/demjava/sourceC++/Java/demjava.cd // incorporated as of 10/29/96 // *Use flattened .cd file as input ** //***************************************************************************** // (@ import java.awt.*; import java.io.*; import java.util.*; @) // 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* < id > UID < vertexname > UVertexName < position > Coordinates [< incoming > IEdge_List] [< outgoing > OEdge_List] . IEdge_List ~ "Incoming" { UID }. OEdge_List ~ "Outgoing" { UID }. UConstVertex = "ConstVertex" . UAltVertex = "AltVertex" . UTerm = "TermVertex" . Width = Integer . Height = Integer . // Following is description of class Edge_List and its parts UEdge_List ~ "Edge" "List" { UEdge } . UEdge : UAltEdge | UConstEdge *common* < id >UID < fromVertex > UVertex [< fromPortNo > PortNo] < toVertex > UVertex [< toPortNo > PortNo] [< middlepoints > Coordinates_List] . Coordinates_List~ "Bendpoints" {Coordinates}. UAltEdge = "AltEdge" . UConstEdge = "ConstEdge" < edgename > UEdgeName [ Cardinality]. Cardinality = < lower > Lower [ < upper > Upper]. Lower = Integer. Upper = "." "." String. PortNo = "PortNo" Integer . // Classes common to Vertex and Edge UID = < id > Integer. UEdgeName = Ident. UVertexName = Ident. // Classes common to Vertex , VertexName , Edge and EdgeName Coordinates = "{" X Y "}". IDGenerator = Integer. X = Integer . Y = Integer . //**********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}. 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 PrintVisitor = UGraph . EdgeDistinctionVisitor = String. ClassNameRetVisitor = ClassName. ClassNameTranspVisitor = ParamClassName. EdgeVisitor = EdgeDistinctionVisitor ClassNameTranspVisitor UGraph.