Textual Class Dictionary

UseCase3



//
// Modification History:
//
// 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
//	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
//
//*****************************************************************************
//
Graph = "Class Dictionary Graph"
           < vertices > Vertex_List
           < edges > Edge_List 

//    made the following optional so we wouldn't need to change the 
//    demeter-input file, but would create using the cppInit.pp 

	   [ "defaultConstVertex" < defaultConstVertex > ConstVertex]
	   [ "defaultAltVertex" < defaultAltVertex > AltVertex]
	   [ "defaultConstEdge" < defaultConstEdge > ConstEdge]
	   [ "defaultAltEdge" < defaultAltEdge > AltEdge] .

Edge :   AltEdge
        | ConstEdge
        *common*
	  "from"     < from > Vertex
	  [ "Bendpoints" < middlepoints > Coordinates ]
	  "to"    < to > Vertex .

Edge_List ~ "Edge" "List" { Edge } .

Vertex_List ~ "Vertex" "List" {  Vertex } .

Vertex :  AltVertex
        | ConstVertex
	| Term
        *common*
          < vertexname > VertexName
          [ "vertex_pos" < position > Coordinates ] .

AltEdge = "AltEdge" .

ConstEdge = "ConstEdge"
            < edgename > EdgeName .

ConstVertex = "ConstVertex" .

AltVertex =  "AltVertex" .

Coordinates =  DemString.

VertexName =  < name > DemIdent
              [ "name_pos" < vn_offset > Coordinates ] .

EdgeName =    < name > DemIdent 
	      "name_pos" < en_offset > Coordinates .

Term =    "TermVertex" .


// New classes for creating a Class Dictionary Graph object

Cd_Graph = < adjacencies > Cd_Adj_List .

Cd_Adj_List ~ { Cd_Adjacency } .

Cd_Adjacency = < source > Cd_Vertex < ns > Cd_Neighbors "." .

Cd_Neighbors :  Cd_Construct | Cd_Alternat 
                *common* < construct_ns > Cd_LV_List .

Cd_Construct = "=" .

Cd_Alternat = ":" < alternat_ns > Cd_V_BarList "*common*" .

Cd_LV_List ~ { Cd_LVertex } .

Cd_V_BarList ~ Cd_Vertex { "|" Cd_Vertex } .

Cd_LVertex = "<" < label_name > DemIdent ">" < vertex > Cd_Vertex .

Cd_Vertex = < vertex_name > DemIdent .