Race.pattern.metamodel 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245
  1. {
  2. "types": {
  3. "__pElement": [
  4. {
  5. "name": "__pLabel",
  6. "type": "string",
  7. "default": ""
  8. },
  9. {
  10. "name": "__pPivotIn",
  11. "type": "string",
  12. "default": ""
  13. },
  14. {
  15. "name": "__pPivotOut",
  16. "type": "string",
  17. "default": ""
  18. },
  19. {
  20. "name": "__pMatchSubtypes",
  21. "type": "boolean",
  22. "default": false
  23. },
  24. {
  25. "name": "name",
  26. "type": "code",
  27. "default": "\"[PYTHON]\"\n\"Example:\t result = True\"\n\"Example:\t result = getAttr()\"\n\n\"[JAVASCRIPT]\"\n\"Example:\t true\"\n\"Example:\t getAttr()\""
  28. },
  29. {
  30. "name": "position",
  31. "type": "code",
  32. "default": "\"[PYTHON]\"\n\"Example:\t result = True\"\n\"Example:\t result = getAttr()\"\n\n\"[JAVASCRIPT]\"\n\"Example:\t true\"\n\"Example:\t getAttr()\""
  33. }
  34. ],
  35. "__pPositionable": [
  36. {
  37. "name": "__pLabel",
  38. "type": "string",
  39. "default": ""
  40. },
  41. {
  42. "name": "__pPivotIn",
  43. "type": "string",
  44. "default": ""
  45. },
  46. {
  47. "name": "__pPivotOut",
  48. "type": "string",
  49. "default": ""
  50. },
  51. {
  52. "name": "__pMatchSubtypes",
  53. "type": "boolean",
  54. "default": false
  55. },
  56. {
  57. "name": "position",
  58. "type": "code",
  59. "default": "\"[PYTHON]\"\n\"Example:\t result = True\"\n\"Example:\t result = getAttr()\"\n\n\"[JAVASCRIPT]\"\n\"Example:\t true\"\n\"Example:\t getAttr()\""
  60. }
  61. ],
  62. "__pCar": [
  63. {
  64. "name": "__pLabel",
  65. "type": "string",
  66. "default": ""
  67. },
  68. {
  69. "name": "__pPivotIn",
  70. "type": "string",
  71. "default": ""
  72. },
  73. {
  74. "name": "__pPivotOut",
  75. "type": "string",
  76. "default": ""
  77. },
  78. {
  79. "name": "__pMatchSubtypes",
  80. "type": "boolean",
  81. "default": false
  82. },
  83. {
  84. "name": "name",
  85. "type": "code",
  86. "default": "\"[PYTHON]\"\n\"Example:\t result = True\"\n\"Example:\t result = getAttr()\"\n\n\"[JAVASCRIPT]\"\n\"Example:\t true\"\n\"Example:\t getAttr()\""
  87. },
  88. {
  89. "name": "position",
  90. "type": "code",
  91. "default": "\"[PYTHON]\"\n\"Example:\t result = True\"\n\"Example:\t result = getAttr()\"\n\n\"[JAVASCRIPT]\"\n\"Example:\t true\"\n\"Example:\t getAttr()\""
  92. }
  93. ],
  94. "__pStart": [
  95. {
  96. "name": "__pLabel",
  97. "type": "string",
  98. "default": ""
  99. },
  100. {
  101. "name": "__pPivotIn",
  102. "type": "string",
  103. "default": ""
  104. },
  105. {
  106. "name": "__pPivotOut",
  107. "type": "string",
  108. "default": ""
  109. },
  110. {
  111. "name": "__pMatchSubtypes",
  112. "type": "boolean",
  113. "default": false
  114. },
  115. {
  116. "name": "name",
  117. "type": "code",
  118. "default": "\"[PYTHON]\"\n\"Example:\t result = True\"\n\"Example:\t result = getAttr()\"\n\n\"[JAVASCRIPT]\"\n\"Example:\t true\"\n\"Example:\t getAttr()\""
  119. },
  120. {
  121. "name": "position",
  122. "type": "code",
  123. "default": "\"[PYTHON]\"\n\"Example:\t result = True\"\n\"Example:\t result = getAttr()\"\n\n\"[JAVASCRIPT]\"\n\"Example:\t true\"\n\"Example:\t getAttr()\""
  124. }
  125. ],
  126. "__pFinish": [
  127. {
  128. "name": "__pLabel",
  129. "type": "string",
  130. "default": ""
  131. },
  132. {
  133. "name": "__pPivotIn",
  134. "type": "string",
  135. "default": ""
  136. },
  137. {
  138. "name": "__pPivotOut",
  139. "type": "string",
  140. "default": ""
  141. },
  142. {
  143. "name": "__pMatchSubtypes",
  144. "type": "boolean",
  145. "default": false
  146. },
  147. {
  148. "name": "name",
  149. "type": "code",
  150. "default": "\"[PYTHON]\"\n\"Example:\t result = True\"\n\"Example:\t result = getAttr()\"\n\n\"[JAVASCRIPT]\"\n\"Example:\t true\"\n\"Example:\t getAttr()\""
  151. },
  152. {
  153. "name": "position",
  154. "type": "code",
  155. "default": "\"[PYTHON]\"\n\"Example:\t result = True\"\n\"Example:\t result = getAttr()\"\n\n\"[JAVASCRIPT]\"\n\"Example:\t true\"\n\"Example:\t getAttr()\""
  156. }
  157. ],
  158. "__pCup": [
  159. {
  160. "name": "__pLabel",
  161. "type": "string",
  162. "default": ""
  163. },
  164. {
  165. "name": "__pPivotIn",
  166. "type": "string",
  167. "default": ""
  168. },
  169. {
  170. "name": "__pPivotOut",
  171. "type": "string",
  172. "default": ""
  173. },
  174. {
  175. "name": "__pMatchSubtypes",
  176. "type": "boolean",
  177. "default": false
  178. },
  179. {
  180. "name": "name",
  181. "type": "code",
  182. "default": "\"[PYTHON]\"\n\"Example:\t result = True\"\n\"Example:\t result = getAttr()\"\n\n\"[JAVASCRIPT]\"\n\"Example:\t true\"\n\"Example:\t getAttr()\""
  183. },
  184. {
  185. "name": "position",
  186. "type": "code",
  187. "default": "\"[PYTHON]\"\n\"Example:\t result = True\"\n\"Example:\t result = getAttr()\"\n\n\"[JAVASCRIPT]\"\n\"Example:\t true\"\n\"Example:\t getAttr()\""
  188. }
  189. ]
  190. },
  191. "constraints": [
  192. {
  193. "name": "noAbstractInstances",
  194. "event": "pre-create",
  195. "code": "/* comment next line to enable this constraint */\nthrow \"IgnoredConstraint\"\nfalse",
  196. "targetType": "Element"
  197. },
  198. {
  199. "name": "noAbstractInstances",
  200. "event": "pre-create",
  201. "code": "/* comment next line to enable this constraint */\nthrow \"IgnoredConstraint\"\nfalse",
  202. "targetType": "Positionable"
  203. }
  204. ],
  205. "actions": [
  206. {
  207. "name": "distinctPLabels",
  208. "event": "post-create",
  209. "code": "if( getAttr(\"__pLabel\") == \"\" )\n{\n\tvar pLabels = getAllNodes().\n\t\t\t\t\t\t\tfilter( function(n) {return hasAttr(\"__pLabel\",n);} ).\n\t\t\t\t\t\t\t\tmap( function(n) {return getAttr(\"__pLabel\",n);} ),\n\t\t i\t\t\t= \"0\";\n\n\twhile( _utils.contains(pLabels,i) )\n\t\ti = String(parseInt(i)+1);\n\tsetAttr(\"__pLabel\",i);\n}",
  210. "targetType": "*"
  211. }
  212. ],
  213. "cardinalities": {
  214. "__pElement": [],
  215. "__pPositionable": [],
  216. "__pCar": [],
  217. "__pStart": [],
  218. "__pFinish": [],
  219. "__pCup": []
  220. },
  221. "legalConnections": {},
  222. "connectorTypes": {},
  223. "types2parentTypes": {
  224. "__pElement": [
  225. "__pPositionable"
  226. ],
  227. "__pPositionable": [],
  228. "__pCar": [
  229. "__pElement",
  230. "__pPositionable"
  231. ],
  232. "__pStart": [
  233. "__pElement",
  234. "__pPositionable"
  235. ],
  236. "__pFinish": [
  237. "__pElement",
  238. "__pPositionable"
  239. ],
  240. "__pCup": [
  241. "__pElement",
  242. "__pPositionable"
  243. ]
  244. }
  245. }