SimpleClassDiagram.metamodel 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. {
  2. "types": {
  3. "Class": [
  4. {
  5. "name": "name",
  6. "type": "string",
  7. "default": "Class_"
  8. },
  9. {
  10. "name": "attributes",
  11. "type": "list<$ATTRIBUTE>",
  12. "default": []
  13. },
  14. {
  15. "name": "constraints",
  16. "type": "list<$EVENT_HANDLER>",
  17. "default": []
  18. },
  19. {
  20. "name": "actions",
  21. "type": "list<$EVENT_HANDLER>",
  22. "default": []
  23. },
  24. {
  25. "name": "cardinalities",
  26. "type": "list<$CARDINALITY>",
  27. "default": []
  28. },
  29. {
  30. "name": "abstract",
  31. "type": "boolean",
  32. "default": false
  33. }
  34. ],
  35. "GlobalConstraint": [
  36. {
  37. "name": "name",
  38. "type": "string",
  39. "default": "GC_"
  40. },
  41. {
  42. "name": "event",
  43. "type": "$EVENT",
  44. "default": ""
  45. },
  46. {
  47. "name": "code",
  48. "type": "code",
  49. "default": ""
  50. }
  51. ],
  52. "GlobalAction": [
  53. {
  54. "name": "name",
  55. "type": "string",
  56. "default": "GA_"
  57. },
  58. {
  59. "name": "event",
  60. "type": "$EVENT",
  61. "default": ""
  62. },
  63. {
  64. "name": "code",
  65. "type": "code",
  66. "default": ""
  67. }
  68. ],
  69. "Association": [
  70. {
  71. "name": "name",
  72. "type": "string",
  73. "default": "Association_"
  74. },
  75. {
  76. "name": "attributes",
  77. "type": "list<$ATTRIBUTE>",
  78. "default": []
  79. },
  80. {
  81. "name": "constraints",
  82. "type": "list<$EVENT_HANDLER>",
  83. "default": []
  84. },
  85. {
  86. "name": "actions",
  87. "type": "list<$EVENT_HANDLER>",
  88. "default": []
  89. },
  90. {
  91. "name": "cardinalities",
  92. "type": "list<$CARDINALITY>",
  93. "default": []
  94. },
  95. {
  96. "name": "linktype",
  97. "type": "ENUM(visual,containment)",
  98. "default": "visual"
  99. }
  100. ],
  101. "Inheritance": []
  102. },
  103. "constraints": [
  104. {
  105. "name": "noInheritanceLoops",
  106. "event": "post-create",
  107. "code": "/*newline*/var mm = '/Formalisms/__LanguageSyntax__/SimpleClassDiagram/SimpleClassDiagram/',/*newline*/ nout = getNeighbors('>',mm+'Class'),/*newline*/ visited = [];/*newline*/function dfs(to_visit)/*newline*/{/*newline*/ var curr = to_visit.pop();/*newline*/ if( curr == undefined )/*newline*/ return true;/*newline*/ else if( visited.indexOf(curr) > -1 )/*newline*/ return false;/*newline*/ else/*newline*/ {/*newline*/ visited.push(curr);/*newline*/ var ntype = (getAttr('$type',curr) == mm+'Class' ? /*newline*/ mm+'Inheritance' : mm+'Class');/*newline*/ return dfs( to_visit.concat(getNeighbors('>',ntype,curr)) );/*newline*/ }/*newline*/}/*newline*/dfs(nout);",
  108. "targetType": "Inheritance"
  109. }
  110. ],
  111. "actions": [],
  112. "cardinalities": {
  113. "Class": [
  114. {
  115. "dir": "out",
  116. "type": "Association",
  117. "min": "0",
  118. "max": "Infinity"
  119. },
  120. {
  121. "dir": "in",
  122. "type": "Association",
  123. "min": "0",
  124. "max": "Infinity"
  125. },
  126. {
  127. "dir": "out",
  128. "type": "Inheritance",
  129. "min": "0",
  130. "max": "Infinity"
  131. },
  132. {
  133. "dir": "in",
  134. "type": "Inheritance",
  135. "min": "0",
  136. "max": "Infinity"
  137. }
  138. ],
  139. "GlobalConstraint": [],
  140. "GlobalAction": [],
  141. "Association": [
  142. {
  143. "dir": "in",
  144. "type": "Class",
  145. "min": "0",
  146. "max": "1"
  147. },
  148. {
  149. "dir": "out",
  150. "type": "Class",
  151. "min": "0",
  152. "max": "1"
  153. }
  154. ],
  155. "Inheritance": [
  156. {
  157. "dir": "in",
  158. "type": "Class",
  159. "min": "0",
  160. "max": "1"
  161. },
  162. {
  163. "dir": "out",
  164. "type": "Class",
  165. "min": "0",
  166. "max": "1"
  167. }
  168. ]
  169. },
  170. "legalConnections": {
  171. "Class": {
  172. "Class": [
  173. "Association",
  174. "Inheritance"
  175. ]
  176. }
  177. },
  178. "connectorTypes": {
  179. "Association": "visual",
  180. "Inheritance": "visual"
  181. },
  182. "types2parentTypes": {}
  183. }