The sequence of MDELite transformations is the composite function: CD2Png = PlantUml2Png"CDSchema2CD.



CDSchemaSpec : CDLine TableLine+ SubTableLine+ AssocLine* ;
CDLine       : "classDiagram" cdname ;
TableLine    : "table" "(" tableName "," "[" columnName+ "]" ")" "." ;
SubTableLine : "subtable" "(" superTableName "," "[" tableName+ "]" ")" "." ;
AssocLine    : "assoc" "(" assocId "," assocName "," tableName1 "," roleName1 "," card1 "," tableName2 "," roleName2 "," card2 "]" ")" "." ;


columnName : Name
           | Name ":" Type ;

cdname     :
tableName  :
assocId    :
assocName  :
tableName1 :
roleName1  :
tableName2 :
roleName2  : Name ;          // Name is syntactically a java identifier

Type  : int | bool | float
      | dbl | str | qstr     // str = string; qstring = single or doubly-quoted string
      ;

card1 :
card2 : "BLANK"              // means *
      | "NM"                 // means *
      | "BLACK_DIAMOND"      // means composition 1:1
      | "DIAMOND"            // means aggregation 0:1
      | INTEGER "," INTEGER; // custom n..m, where n<m
      ;