sccd_to_xml_JS.py 28 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195
  1. class XML2JavaScriptRules(object):
  2. def __init__(self):
  3. self.rules = {
  4. 'SCCD': {
  5. 'type': 'Model',
  6. 'name': 'SCCD',
  7. 'package': 'protected.formalisms',
  8. 'pattern': ['<?xml version="1.0" ?>', '@newline',
  9. '<diagram name=\"','@SCCD.name','\"','@SCCDauthor', '>',
  10. '@newline',
  11. '@indent',
  12. '@SCCDdescription',
  13. '@SCCDInPort',
  14. '@SCCDTop',
  15. '@SCCDClass',
  16. '@SCCDBottom',
  17. '@dedent', '</diagram>'
  18. ]
  19. },
  20. 'SCCDauthor': {
  21. 'type': 'Attribute',
  22. 'pattern': [' author=\"','@SCCD.author','\"']
  23. },
  24. 'SCCDdescription': {
  25. 'type': 'Attribute',
  26. 'pattern': ['<description>', '@newline', '@indent',
  27. '@SCCD.description','@newline', '@dedent',
  28. '</description>', '@newline']
  29. },
  30. 'SCCDInPort': {
  31. 'type': 'Class',
  32. 'name': 'SCCD.InPort',
  33. 'pattern': ['<inport name="', '@Named.name','"/>', '@newline']
  34. },
  35. 'SCCDTop': {
  36. 'type': 'Class',
  37. 'name': 'SCCD.Top',
  38. 'pattern': ['<top>', '@newline', '@indent',
  39. '@ActionBlockStatement',
  40. '@dedent', '</top>', '@newline' ]
  41. },
  42. 'SCCDBottom': {
  43. 'type': 'Class',
  44. 'name': 'SCCD.Bottom',
  45. 'pattern': ['<bottom>', '@newline', '@indent',
  46. '@ActionBlockStatement',
  47. '@dedent', '</bottom>', '@newline' ]
  48. },
  49. 'SCCDActionBlock': {
  50. 'type': 'Class',
  51. 'name': 'SCCD.ActionBlock',
  52. 'pattern': ['@indent','@ActionBlockStatement', '@dedent']
  53. },
  54. 'ActionBlockStatement': {
  55. 'type': 'Association',
  56. 'name': 'SCCD.actionblock_statement',
  57. 'target': 'SCCD.Statement',
  58. 'pattern': ['@SCCDStatement']
  59. },
  60. 'SCCDStatement': {
  61. 'type': 'Class',
  62. 'name': 'SCCD.Statement',
  63. 'pattern': [
  64. '@StatementMethodCall',
  65. '@StatementImport',
  66. '@StatementAssignment',
  67. '@StatementWhile',
  68. '@StatementIfElse',
  69. '@StatementReturn',
  70. '@StatementContinue',
  71. '@StatementBreak',
  72. '@StatementDeclaration',
  73. '@NextStatement'
  74. ]
  75. },
  76. 'NextStatement': {
  77. 'type': 'Association',
  78. 'name': 'SCCD.statement_statement_next',
  79. 'target': 'SCCD.Statement',
  80. 'pattern': [
  81. '@SCCDStatement'
  82. ]
  83. },
  84. 'StatementDeclaration': {
  85. 'type': 'Class',
  86. 'name': 'SCCD.Declaration',
  87. 'pattern': [ #'@DeclarationType', not used in python nor javascript
  88. 'var ',
  89. '@Declaration.name',
  90. '@DeclarationInit', ';','@newline'
  91. ]
  92. },
  93. 'DeclarationType': {
  94. 'type': 'Association',
  95. 'name': 'SCCD.declaration_navigationexpression_type',
  96. 'target': 'SCCD.NavigationExpression',
  97. 'pattern': [ '@SCCDNavExpr', ' ' ]
  98. },
  99. 'DeclarationInit': {
  100. 'type': 'Association',
  101. 'name': 'SCCD.declaration_expression_init',
  102. 'target': 'SCCD.Expression',
  103. 'pattern': [ ' = ','@SCCDExpression' ]
  104. },
  105. 'StatementReturn': {
  106. 'type': 'Class',
  107. 'name': 'SCCD.Return',
  108. 'pattern': [ 'return', '@ReturnExpression', ';', '@newline'
  109. ]
  110. },
  111. 'ReturnExpression': {
  112. 'type': 'Association',
  113. 'name': 'SCCD.return_expression',
  114. 'target': 'SCCD.Expression',
  115. 'pattern': [ ' ','@SCCDExpression' ]
  116. },
  117. 'StatementContinue': {
  118. 'type': 'Class',
  119. 'name': 'SCCD.Continue',
  120. 'pattern': [ 'continue', ';','@newline' ]
  121. },
  122. 'StatementBreak': {
  123. 'type': 'Class',
  124. 'name': 'SCCD.Break',
  125. 'pattern': [ 'break', ';', '@newline' ]
  126. },
  127. 'StatementWhile': {
  128. 'type': 'Class',
  129. 'name': 'SCCD.While',
  130. 'pattern': [ 'while', '(', '@WhileCondition',')',
  131. '@WhileBody'
  132. ]
  133. },
  134. 'WhileCondition': {
  135. 'type': 'Association',
  136. 'name': 'SCCD.while_expression_condition',
  137. 'target': 'SCCD.Expression',
  138. 'pattern': [
  139. '@SCCDExpression'
  140. ]
  141. },
  142. 'WhileBody': {
  143. 'type': 'Association',
  144. 'name': 'SCCD.while_actionblock_body',
  145. 'target': 'SCCD.ActionBlock',
  146. 'pattern': ['{','@newline','@SCCDActionBlock','}','@newline']
  147. },
  148. 'StatementIfElse': {
  149. 'type': 'Class',
  150. 'name': 'SCCD.IfElse',
  151. 'pattern': [ 'if(', '@IfElseCondition', ') ',
  152. '@IfBody','@ElseBody','@newline'
  153. ]
  154. },
  155. 'IfElseCondition': {
  156. 'type': 'Association',
  157. 'name': 'SCCD.ifelse_expression_condition',
  158. 'target': 'SCCD.Expression',
  159. 'pattern': [
  160. '@SCCDExpression'
  161. ]
  162. },
  163. 'IfBody': {
  164. 'type': 'Association',
  165. 'name': 'SCCD.ifelse_actionblock_ifbody',
  166. 'target': 'SCCD.ActionBlock',
  167. 'pattern': ['{','@newline','@SCCDActionBlock','}']
  168. },
  169. 'ElseBody': {
  170. 'type': 'Association',
  171. 'name': 'SCCD.ifelse_actionblock_elsebody',
  172. 'target': 'SCCD.ActionBlock',
  173. 'pattern': [
  174. ' else {',
  175. '@newline',
  176. '@SCCDActionBlock','}'
  177. ]
  178. },
  179. 'StatementAssignment': {
  180. 'type': 'Class',
  181. 'name': 'SCCD.Assignment',
  182. 'pattern': [
  183. '@AssignmentLeft',
  184. '@StatementPlainAssignment',
  185. '@StatementPlusAssignment',
  186. '@StatementMinusAssignment',
  187. '@AssignmentRight',';','@newline'
  188. ]
  189. },
  190. 'StatementPlainAssignment': {
  191. 'type': 'Class',
  192. 'name': 'SCCD.PlainAssignment',
  193. 'pattern': [ ' = ' ]
  194. },
  195. 'StatementPlusAssignment': {
  196. 'type': 'Class',
  197. 'name': 'SCCD.PlusAssignment',
  198. 'pattern': [ ' += ' ]
  199. },
  200. 'StatementMinusAssignment': {
  201. 'type': 'Class',
  202. 'name': 'SCCD.MinusAssignment',
  203. 'pattern': [ ' -= ' ]
  204. },
  205. 'AssignmentLeft': {
  206. 'type': 'Association',
  207. 'name': 'SCCD.assignment_expression_left',
  208. 'target': 'SCCD.Expression',
  209. 'pattern': [ '@SCCDExpression' ]
  210. },
  211. 'AssignmentRight': {
  212. 'type': 'Association',
  213. 'name': 'SCCD.assignment_expression_right',
  214. 'target': 'SCCD.Expression',
  215. 'pattern': [ '@SCCDExpression' ]
  216. },
  217. 'StatementMethodCall': {
  218. 'type': 'Class',
  219. 'name': 'SCCD.MethodCallStm',
  220. 'pattern': [
  221. '@Sender',
  222. '@AbsMethodCall.name','(',
  223. '@Arguments',
  224. ')',';','@newline'
  225. ]
  226. },
  227. 'Sender': {
  228. 'type': 'Association',
  229. 'name': 'SCCD.methodcall_sender',
  230. 'target': 'SCCD.Expression',
  231. 'pattern': [ '@SCCDExpression', '.' ]
  232. },
  233. 'SCCDNavExpr': {
  234. 'type': 'Class',
  235. 'name': 'SCCD.NavigationExpression',
  236. 'pattern': [ '@FirstNavigation' ]
  237. },
  238. 'FirstNavigation': {
  239. 'type': 'Association',
  240. 'name': 'SCCD.navigationexpression_absnavigationexpression',
  241. 'target': 'SCCD.AbsNavigationExpression',
  242. 'pattern': [ '@SCCDDotExpr', '@SCCDSelfExpr' ]
  243. },
  244. 'SCCDDotExpr': {
  245. 'type': 'Class',
  246. 'name': 'SCCD.DotExpression',
  247. 'pattern': [ '@DotExpression.path' ]
  248. },
  249. 'SCCDSelfExpr': {
  250. 'type': 'Class',
  251. 'name': 'SCCD.SelfExpression',
  252. 'pattern': [ 'this','@@','@NextDot' ]
  253. },
  254. 'NextDot': {
  255. 'type': 'Association',
  256. 'name': 'SCCD.selfexpression_dotexpression',
  257. 'target': 'SCCD.DotExpression',
  258. 'pattern': [ '.','@SCCDDotExpr' ]
  259. },
  260. 'SCCDMethodCall': {
  261. 'type': 'Class',
  262. 'name': 'SCCD.MethodCall',
  263. 'pattern': [
  264. '@Sender',
  265. '@AbsMethodCall.name','(',
  266. '@Arguments',
  267. ')'
  268. ]
  269. },
  270. 'SCCDUnop': {
  271. 'type': 'Class',
  272. 'name': 'SCCD.Unop',
  273. 'pattern': [
  274. '@SCCDNot',
  275. '@SCCDMinus',
  276. '@SCCDParenthesis'
  277. ]
  278. },
  279. 'SCCDNot': {
  280. 'type': 'Class',
  281. 'name': 'SCCD.Not',
  282. 'pattern': [ 'not ', '@UnopExpression' ]
  283. },
  284. 'SCCDMinus': {
  285. 'type': 'Class',
  286. 'name': 'SCCD.Minus',
  287. 'pattern': [ '-', '@UnopExpression' ]
  288. },
  289. 'SCCDParenthesis': {
  290. 'type': 'Class',
  291. 'name': 'SCCD.Parenthesis',
  292. 'pattern': [ '(', '@UnopExpression', ')' ]
  293. },
  294. 'UnopExpression': {
  295. 'type': 'Association',
  296. 'name': 'SCCD.unop_expression',
  297. 'target': 'SCCD.Expression',
  298. 'pattern': [ '@SCCDExpression' ]
  299. },
  300. 'SCCDBinop': {
  301. 'type': 'Class',
  302. 'name': 'SCCD.Binop',
  303. 'pattern': [
  304. '@SCCDAnd',
  305. '@SCCDOr',
  306. '@SCCDNEqual',
  307. '@SCCDEqual',
  308. '@SCCDLEThan',
  309. '@SCCDLThan',
  310. '@SCCDGEThan',
  311. '@SCCDGThan',
  312. '@SCCDMod',
  313. '@SCCDDiv',
  314. '@SCCDMult',
  315. '@SCCDAdd',
  316. '@SCCDSubtract',
  317. '@SCCDSelection'
  318. ]
  319. },
  320. 'BinopLeft': {
  321. 'type': 'Association',
  322. 'name': 'SCCD.binop_expression_left',
  323. 'target': 'SCCD.Expression',
  324. 'pattern': [ '@SCCDExpression' ]
  325. },
  326. 'BinopRight': {
  327. 'type': 'Association',
  328. 'name': 'SCCD.binop_expression_right',
  329. 'target': 'SCCD.Expression',
  330. 'pattern': [ '@SCCDExpression' ]
  331. },
  332. 'SCCDAnd': {
  333. 'type': 'Class',
  334. 'name': 'SCCD.And',
  335. 'pattern': [
  336. '@BinopLeft',
  337. ' &amp;&amp; ',
  338. '@BinopRight'
  339. ]
  340. },
  341. 'SCCDOr': {
  342. 'type': 'Class',
  343. 'name': 'SCCD.Or',
  344. 'pattern': [
  345. '@BinopLeft',
  346. ' || ',
  347. '@BinopRight'
  348. ]
  349. },
  350. 'SCCDNEqual': {
  351. 'type': 'Class',
  352. 'name': 'SCCD.NEqual',
  353. 'pattern': [
  354. '@BinopLeft',
  355. ' != ',
  356. '@BinopRight'
  357. ]
  358. },
  359. 'SCCDEqual': {
  360. 'type': 'Class',
  361. 'name': 'SCCD.Equal',
  362. 'pattern': [
  363. '@BinopLeft',
  364. ' == ',
  365. '@BinopRight'
  366. ]
  367. },
  368. 'SCCDLEThan': {
  369. 'type': 'Class',
  370. 'name': 'SCCD.LEThan',
  371. 'pattern': [
  372. '@BinopLeft',
  373. ' <= ',
  374. '@BinopRight'
  375. ]
  376. },
  377. 'SCCDLThan': {
  378. 'type': 'Class',
  379. 'name': 'SCCD.LThan',
  380. 'pattern': [
  381. '@BinopLeft',
  382. ' < ',
  383. '@BinopRight'
  384. ]
  385. },
  386. 'SCCDGEThan': {
  387. 'type': 'Class',
  388. 'name': 'SCCD.GEThan',
  389. 'pattern': [
  390. '@BinopLeft',
  391. ' >= ',
  392. '@BinopRight'
  393. ]
  394. },
  395. 'SCCDGThan': {
  396. 'type': 'Class',
  397. 'name': 'SCCD.GThan',
  398. 'pattern': [
  399. '@BinopLeft',
  400. ' > ',
  401. '@BinopRight'
  402. ]
  403. },
  404. 'SCCDMod': {
  405. 'type': 'Class',
  406. 'name': 'SCCD.Mod',
  407. 'pattern': [
  408. '@BinopLeft',
  409. ' % ',
  410. '@BinopRight'
  411. ]
  412. },
  413. 'SCCDDiv': {
  414. 'type': 'Class',
  415. 'name': 'SCCD.Div',
  416. 'pattern': [
  417. '@BinopLeft',
  418. ' / ',
  419. '@BinopRight'
  420. ]
  421. },
  422. 'SCCDMult': {
  423. 'type': 'Class',
  424. 'name': 'SCCD.Mult',
  425. 'pattern': [
  426. '@BinopLeft',
  427. ' * ',
  428. '@BinopRight'
  429. ]
  430. },
  431. 'SCCDAdd': {
  432. 'type': 'Class',
  433. 'name': 'SCCD.Add',
  434. 'pattern': [
  435. '@BinopLeft',
  436. ' + ',
  437. '@BinopRight'
  438. ]
  439. },
  440. 'SCCDSubtract': {
  441. 'type': 'Class',
  442. 'name': 'SCCD.Subtract',
  443. 'pattern': [
  444. '@BinopLeft',
  445. ' - ',
  446. '@BinopRight'
  447. ]
  448. },
  449. 'SCCDSelection': {
  450. 'type': 'Class',
  451. 'name': 'SCCD.Selection',
  452. 'pattern': [
  453. '@BinopLeft',
  454. '[',
  455. '@BinopRight',
  456. ']'
  457. ]
  458. },
  459. 'SCCDComposite': {
  460. 'type': 'Class',
  461. 'name': 'SCCD.Composite',
  462. 'pattern': [ '@SCCDTuple', '@SCCDDict', '@SCCDArray' ]
  463. },
  464. 'SCCDTuple': {
  465. 'type': 'Class',
  466. 'name': 'SCCD.Tuple',
  467. 'pattern': [
  468. '(', '@CompositeArguments', ')'
  469. ]
  470. },
  471. 'SCCDArray': {
  472. 'type': 'Class',
  473. 'name': 'SCCD.Array',
  474. 'pattern': [
  475. '[', '@CompositeArguments', ']'
  476. ]
  477. },
  478. 'SCCDDict': {
  479. 'type': 'Class',
  480. 'name': 'SCCD.Dict',
  481. 'pattern': [
  482. '{', '@CompositeArguments', '}'
  483. ]
  484. },
  485. 'SCCDAtomValue': {
  486. 'type': 'Class',
  487. 'name': 'SCCD.AtomValue',
  488. 'pattern': [
  489. '@SCCDStringValue',
  490. '@SCCDIntegerValue',
  491. '@SCCDBooleanValue',
  492. '@SCCDFloatValue'
  493. ]
  494. },
  495. 'SCCDStringValue': {
  496. 'type': 'Class',
  497. 'name': 'SCCD.StringValue',
  498. 'pattern': [
  499. '\'',
  500. '@StringValue.value',
  501. '\''
  502. ]
  503. },
  504. 'SCCDIntegerValue': {
  505. 'type': 'Class',
  506. 'name': 'SCCD.IntegerValue',
  507. 'pattern': [
  508. '@IntegerValue.value',
  509. ]
  510. },
  511. 'SCCDFloatValue': {
  512. 'type': 'Class',
  513. 'name': 'SCCD.FloatValue',
  514. 'pattern': [
  515. '@FloatValue.value',
  516. ]
  517. },
  518. 'SCCDBooleanValue': {
  519. 'type': 'Class',
  520. 'name': 'SCCD.BooleanValue',
  521. 'pattern': [
  522. '@BooleanValue.value',
  523. ]
  524. },
  525. 'CompositeArguments': {
  526. 'type': 'Association',
  527. 'name': 'SCCD.composite_compositeargument',
  528. 'target': 'SCCD.CompositeArgument',
  529. 'pattern': [ '@CompositeArgument' ]
  530. },
  531. 'CompositeArgument': {
  532. 'type': 'Class',
  533. 'name': 'SCCD.CompositeArgument',
  534. 'pattern': [
  535. '@RegularArgument',
  536. '@DictArgument'
  537. ]
  538. },
  539. 'RegularArgument': {
  540. 'type': 'Class',
  541. 'name': 'SCCD.RegularArgument',
  542. 'pattern': [
  543. '@RegularArgumentValue',
  544. '@CompositeArgumentNext'
  545. ]
  546. },
  547. 'RegularArgumentValue': {
  548. 'type': 'Association',
  549. 'name': 'SCCD.regularargument_expression',
  550. 'target': 'SCCD.Expression',
  551. 'pattern': [ '@SCCDExpression' ]
  552. },
  553. 'DictArgument': {
  554. 'type': 'Class',
  555. 'name': 'SCCD.DictArgument',
  556. 'pattern': [
  557. '@DictArgumentLabel',':',
  558. '@DictArgumentValue',
  559. '@CompositeArgumentNext'
  560. ]
  561. },
  562. 'DictArgumentLabel': {
  563. 'type': 'Association',
  564. 'name': 'SCCD.dictargument_labelexpression',
  565. 'target': 'SCCD.Expression',
  566. 'pattern': [ '@SCCDExpression' ]
  567. },
  568. 'DictArgumentValue': {
  569. 'type': 'Association',
  570. 'name': 'SCCD.dictargument_expression',
  571. 'target': 'SCCD.Expression',
  572. 'pattern': [ '@SCCDExpression' ]
  573. },
  574. 'CompositeArgumentNext': {
  575. 'type': 'Association',
  576. 'name': 'SCCD.compositeargument_compositeargument_next',
  577. 'target': 'SCCD.CompositeArgument',
  578. 'pattern': [ ', ', '@CompositeArgument' ]
  579. },
  580. 'Arguments': {
  581. 'type': 'Association',
  582. 'name': 'SCCD.methodcall_argument',
  583. 'target': 'SCCD.Argument',
  584. 'pattern': [ '@SCCDArgument' ]
  585. },
  586. 'SCCDArgument': {
  587. 'type': 'Class',
  588. 'name': 'SCCD.Argument',
  589. 'pattern': [
  590. '@ArgumentName',
  591. '@ArgumentValue',
  592. '@ArgumentNext'
  593. ]
  594. },
  595. 'ArgumentName': {
  596. 'type': 'Attribute',
  597. 'pattern': [ '@Argument.name', '=']
  598. },
  599. 'ArgumentValue': {
  600. 'type': 'Association',
  601. 'name': 'SCCD.argument_value',
  602. 'target': 'SCCD.Expression',
  603. 'pattern': [ '@SCCDExpression' ]
  604. },
  605. 'ArgumentNext': {
  606. 'type': 'Association',
  607. 'name': 'SCCD.argument_argument_next',
  608. 'target': 'SCCD.Argument',
  609. 'pattern': [ ', ', '@SCCDArgument' ]
  610. },
  611. 'SCCDExpression': {
  612. 'type': 'Class',
  613. 'name': 'SCCD.Expression',
  614. 'pattern': [
  615. '@SCCDNavExpr',
  616. '@SCCDAtomValue',
  617. '@SCCDUnop',
  618. '@SCCDBinop',
  619. '@SCCDMethodCall',
  620. '@SCCDComposite'
  621. ]
  622. },
  623. 'StatementImport': {
  624. 'type': 'Class',
  625. 'name': 'SCCD.Import',
  626. 'pattern': [
  627. 'import ','@Import.location',
  628. ' from "', '@Import.from',
  629. '";','@newline'
  630. ]
  631. },
  632. 'SCCDClass': {
  633. 'type': 'Class',
  634. 'name': 'SCCD.Class',
  635. 'pattern': ['<class name="', '@Named.name', '"',
  636. '@ClassDefault', '>',
  637. '@newline','@indent',
  638. '@ClassInports',
  639. '@ClassRelationships',
  640. '@ClassAttributes',
  641. '@ClassMethods',
  642. '@ClassStateMachine',
  643. '@dedent',
  644. '</class>','@newline'
  645. ]
  646. },
  647. 'ClassDefault': {
  648. 'type': 'Attribute',
  649. 'pattern': [' default="', '@Class.default' ,'"']
  650. },
  651. 'ClassStateMachine': {
  652. 'type': 'Association',
  653. 'name': 'SCCD.class_statemachine',
  654. 'target': 'SCCD.StateMachine',
  655. 'pattern': [
  656. '<scxml ', '@StateMachinePseudoStates','>', '@newline',
  657. '@indent',
  658. '@StateMachineStates',
  659. '@HistoryOnStateMachine',
  660. '@TransitionsOnStateMachine',
  661. '@dedent',
  662. '</scxml>', '@newline'
  663. ]
  664. },
  665. 'StateMachineStates': {
  666. 'type': 'Association',
  667. 'name': 'SCCD.statemachine_absstate',
  668. 'target': 'SCCD.AbsState',
  669. 'pattern': [
  670. '@SCCDState',
  671. '@SCCDOrthogonalComponent'
  672. ]
  673. },
  674. 'SCCDState': {
  675. 'type': 'Class',
  676. 'name': 'SCCD.State',
  677. 'pattern': [
  678. '<state id="', '@AbsState.name', '"', '@StatePseudoStates','>',
  679. '@newline',
  680. '@indent',
  681. '@OnEnter',
  682. '@OnExit',
  683. '@Transitions',
  684. '@HistoryOnPseudoStates',
  685. '@InnerStates',
  686. '@dedent',
  687. '</state>','@newline'
  688. ]
  689. },
  690. 'SCCDOrthogonalComponent': {
  691. 'type': 'Class',
  692. 'name': 'SCCD.OrthogonalComponent',
  693. 'pattern': [
  694. '<parallel id="', '@AbsState.name', '"', '@StatePseudoStates','>',
  695. '@newline',
  696. '@indent',
  697. '@OnEnter',
  698. '@OnExit',
  699. '@Transitions',
  700. '@HistoryOnPseudoStates',
  701. '@InnerStates',
  702. '@dedent',
  703. '</parallel>','@newline'
  704. ]
  705. },
  706. 'OnEnter': {
  707. 'type': 'Association',
  708. 'name': 'SCCD.absstate_onenter',
  709. 'target': 'SCCD.ActionBlock',
  710. 'pattern': [
  711. '<onentry>','@newline',
  712. '@indent',
  713. '<script>', '@newline',
  714. '<![CDATA[','@newline',
  715. '@SCCDActionBlock',
  716. ']]>',
  717. '@newline','</script>', '@newline',
  718. '@dedent','</onentry>', '@newline'
  719. ]
  720. },
  721. 'OnExit': {
  722. 'type': 'Association',
  723. 'name': 'SCCD.absstate_onexit',
  724. 'target': 'SCCD.ActionBlock',
  725. 'pattern': [
  726. '<onexit>','@newline',
  727. '@indent',
  728. '<script>', '@newline',
  729. '<![CDATA[','@newline',
  730. '@SCCDActionBlock',
  731. ']]>',
  732. '@newline','</script>', '@newline',
  733. '@dedent','</onexit>', '@newline'
  734. ]
  735. },
  736. 'TransitionsOnStateMachine': {
  737. 'type': 'Association',
  738. 'name': 'SCCD.statemachine_transition',
  739. 'target': 'SCCD.Transition',
  740. 'pattern': [
  741. '@SCCDTransition'
  742. ]
  743. },
  744. 'Transitions': {
  745. 'type': 'Association',
  746. 'name': 'SCCD.absstate_transition',
  747. 'target': 'SCCD.Transition',
  748. 'pattern': [
  749. '@SCCDTransition'
  750. ]
  751. },
  752. 'SCCDTransition': {
  753. 'type': 'Class',
  754. 'name': 'SCCD.Transition',
  755. 'pattern': [
  756. '<transition',
  757. '@TransitionAfter',
  758. '@TransitionPort',
  759. '@TransitionTarget',
  760. '@TransitionEventName',
  761. '@TransitionCondition',
  762. '>','@newline',
  763. '@EventParameters',
  764. '@RaiseEvents',
  765. '@TransitionActionBlock',
  766. '</transition>','@newline'
  767. ]
  768. },
  769. 'TransitionActionBlock': {
  770. 'type': 'Association',
  771. 'name': 'SCCD.transition_actionblock',
  772. 'target': 'SCCD.ActionBlock',
  773. 'pattern': ['@indent',
  774. '<script>', '@newline', '@indent',
  775. '<![CDATA[','@newline',
  776. '@SCCDActionBlock',
  777. ']]>',
  778. '@newline','@dedent','</script>',
  779. '@dedent', '@newline'
  780. ]
  781. },
  782. 'RaiseEvents': {
  783. 'type': 'Association',
  784. 'name': 'SCCD.transition_raise',
  785. 'target': 'SCCD.Raise',
  786. 'pattern': [ '@indent','@SCCDRaise','@dedent' ]
  787. },
  788. 'SCCDRaise': {
  789. 'type': 'Class',
  790. 'name': 'SCCD.Raise',
  791. 'pattern': [
  792. '<raise ',
  793. '@RaiseEventName',
  794. '@RaiseScope',
  795. '@RaiseTarget',
  796. '>', '@newline',
  797. '@RaiseEventParameters',
  798. '</raise>', '@newline',
  799. ]
  800. },
  801. 'RaiseEventParameters': {
  802. 'type': 'Association',
  803. 'name': 'SCCD.raise_methodcall',
  804. 'target': 'SCCD.MethodCall',
  805. 'pattern': [ '@SCCDMethodArgs' ]
  806. },
  807. 'SCCDMethodArgs': {
  808. 'type': 'Class',
  809. 'name': 'SCCD.MethodCall',
  810. 'pattern': ['@MethodArguments']
  811. },
  812. 'MethodArguments': {
  813. 'type': 'Association',
  814. 'name': 'SCCD.methodcall_argument',
  815. 'target': 'SCCD.Argument',
  816. 'pattern': [ '@SCCDRaiseArgument' ]
  817. },
  818. 'SCCDRaiseArgument': {
  819. 'type': 'Class',
  820. 'name': 'SCCD.Argument',
  821. 'pattern': [
  822. '@indent',
  823. '<parameter expr="',
  824. '@ArgumentValue', '"/>',
  825. '@dedent','@newline',
  826. '@RaiseArgumentNext',
  827. ]
  828. },
  829. 'RaiseArgumentNext': {
  830. 'type': 'Association',
  831. 'name': 'SCCD.argument_argument_next',
  832. 'target': 'SCCD.Argument',
  833. 'pattern': [ '@SCCDRaiseArgument' ]
  834. },
  835. 'RaiseEventName': {
  836. 'type': 'Association',
  837. 'name': 'SCCD.raise_methodcall',
  838. 'target': 'SCCD.MethodCall',
  839. 'pattern': [ '@SCCDMethodName' ]
  840. },
  841. 'SCCDMethodName': {
  842. 'type': 'Class',
  843. 'name': 'SCCD.MethodCall',
  844. 'pattern': [
  845. 'event="','@AbsMethodCall.name','"'
  846. ]
  847. },
  848. 'RaiseScope': {
  849. 'type': 'Association',
  850. 'name': 'SCCD.raise_scope',
  851. 'target': 'SCCD.Scope',
  852. 'pattern': [ '@SCCDScope' ]
  853. },
  854. 'SCCDScope': {
  855. 'type': 'Class',
  856. 'name': 'SCCD.Scope',
  857. 'pattern': [
  858. ' scope="','@ScopeExpression','"'
  859. ]
  860. },
  861. 'ScopeExpression': {
  862. 'type': 'Association',
  863. 'name': 'SCCD.scope_expression',
  864. 'target': 'SCCD.Expression',
  865. 'pattern': [ '@SCCDExpression' ]
  866. },
  867. 'RaiseTarget': {
  868. 'type': 'Association',
  869. 'name': 'SCCD.raise_target',
  870. 'target': 'SCCD.Target',
  871. 'pattern': [ '@SCCDTarget' ]
  872. },
  873. 'SCCDTarget': {
  874. 'type': 'Class',
  875. 'name': 'SCCD.Target',
  876. 'pattern': [
  877. ' target="','@TargetExpression','"'
  878. ]
  879. },
  880. 'TargetExpression': {
  881. 'type': 'Association',
  882. 'name': 'SCCD.target_expression',
  883. 'target': 'SCCD.Expression',
  884. 'pattern': [ '@SCCDExpression' ]
  885. },
  886. 'TransitionCondition': {
  887. 'type': 'Association',
  888. 'name': 'SCCD.transition_guard',
  889. 'target': 'SCCD.Guard',
  890. 'pattern': [ '@SCCDGuard' ]
  891. },
  892. 'SCCDGuard': {
  893. 'type': 'Class',
  894. 'name': 'SCCD.Guard',
  895. 'pattern': [' cond="', '@GuardExpression', '"']
  896. },
  897. 'GuardExpression': {
  898. 'type': 'Association',
  899. 'name': 'SCCD.guard_expression',
  900. 'target': 'SCCD.Expression',
  901. 'pattern': [ '@SCCDExpression' ]
  902. },
  903. 'TransitionAfter': {
  904. 'type': 'Attribute',
  905. 'pattern': [' after="', '@Transition.after' ,'"']
  906. },
  907. 'TransitionTarget': {
  908. 'type': 'Attribute',
  909. 'pattern': [' target="', '@Transition.target' ,'"']
  910. },
  911. 'EventParameters': {
  912. 'type': 'Association',
  913. 'name': 'SCCD.transition_event_trigger',
  914. 'target': 'SCCD.Event',
  915. 'pattern': [ '@SCCDTransitionEventParams' ]
  916. },
  917. 'SCCDTransitionEventParams': {
  918. 'type': 'Class',
  919. 'name': 'SCCD.Event',
  920. 'pattern': ['@FirstEventParameter']
  921. },
  922. 'FirstEventParameter': {
  923. 'type': 'Association',
  924. 'name': 'SCCD.event_parameter',
  925. 'target': 'SCCD.Parameter',
  926. 'pattern': [
  927. '@indent',
  928. '<parameter ',
  929. '@SCCDParameter', '/>',
  930. '@dedent','@newline',
  931. '@ParameterNext'
  932. ]
  933. },
  934. 'TransitionEventName': {
  935. 'type': 'Association',
  936. 'name': 'SCCD.transition_event_trigger',
  937. 'target': 'SCCD.Event',
  938. 'pattern': [ '@SCCDTransitionEventName' ]
  939. },
  940. 'SCCDTransitionEventName': {
  941. 'type': 'Class',
  942. 'name': 'SCCD.Event',
  943. 'pattern': [' event="', '@Event.name' ,'"']
  944. },
  945. 'TransitionPort': {
  946. 'type': 'Association',
  947. 'name': 'SCCD.transition_inport',
  948. 'target': 'SCCD.InPort',
  949. 'pattern': [
  950. '@SCCDTransitionInPort'
  951. ]
  952. },
  953. 'SCCDTransitionInPort': {
  954. 'type': 'Class',
  955. 'name': 'SCCD.InPort',
  956. 'pattern': [' port="', '@Named.name' ,'"']
  957. },
  958. 'InnerStates': {
  959. 'type': 'Association',
  960. 'name': 'SCCD.absstate_absstate_inner',
  961. 'target': 'SCCD.AbsState',
  962. 'pattern': [
  963. '@SCCDState',
  964. '@SCCDOrthogonalComponent'
  965. ]
  966. },
  967. 'StatePseudoStates': {
  968. 'type': 'Association',
  969. 'name': 'SCCD.absstate_pseudostate',
  970. 'target': 'SCCD.PseudoState',
  971. 'pattern': [
  972. '@SCCDInitialState',
  973. '@SCCDFinalState'
  974. ]
  975. },
  976. 'HistoryOnPseudoStates': {
  977. 'type': 'Association',
  978. 'name': 'SCCD.absstate_pseudostate',
  979. 'target': 'SCCD.PseudoState',
  980. 'pattern': [
  981. '@SCCDHistoryState'
  982. ]
  983. },
  984. 'HistoryOnStateMachine': {
  985. 'type': 'Association',
  986. 'name': 'SCCD.statemachine_pseudostate',
  987. 'target': 'SCCD.PseudoState',
  988. 'pattern': [
  989. '@SCCDHistoryState'
  990. ]
  991. },
  992. 'StateMachinePseudoStates': {
  993. 'type': 'Association',
  994. 'name': 'SCCD.statemachine_pseudostate',
  995. 'target': 'SCCD.PseudoState',
  996. 'pattern': [
  997. '@SCCDInitialState',
  998. '@SCCDFinalState'
  999. ]
  1000. },
  1001. 'SCCDInitialState': {
  1002. 'type': 'Class',
  1003. 'name': 'SCCD.InitialState',
  1004. 'pattern': [' initial="', '@PseudoState.name', '"' ]
  1005. },
  1006. 'SCCDFinalState': {
  1007. 'type': 'Class',
  1008. 'name': 'SCCD.FinalState',
  1009. 'pattern': [' final="', '@PseudoState.name', '"' ]
  1010. },
  1011. 'SCCDHistoryState': {
  1012. 'type': 'Class',
  1013. 'name': 'SCCD.HistoryState',
  1014. 'pattern': ['<history id="', '@PseudoState.name', '"/>', '@newline' ]
  1015. },
  1016. 'ClassInports': {
  1017. 'type': 'Association',
  1018. 'name': 'SCCD.class_inport',
  1019. 'target': 'SCCD.InPort',
  1020. 'pattern': ['@SCCDInPort']
  1021. },
  1022. 'ClassRelationships': {
  1023. 'type': 'Association',
  1024. 'name': 'SCCD.class_relationship',
  1025. 'target': 'SCCD.Relationship',
  1026. 'pattern': [
  1027. '<relationships>', '@newline',
  1028. '@indent',
  1029. '@ClassAssociation',
  1030. '@ClassInheritance',
  1031. '@dedent',
  1032. '</relationships>', '@newline'
  1033. ]
  1034. },
  1035. 'ClassAssociation': {
  1036. 'type': 'Class',
  1037. 'name': 'SCCD.Association',
  1038. 'pattern': ['<association name="',
  1039. '@Association.name', '"',
  1040. '@RelationshipClass',
  1041. '@RelationshipMin',
  1042. '@RelationshipMax',
  1043. '/>',
  1044. '@newline'
  1045. ]
  1046. },
  1047. 'ClassInheritance': {
  1048. 'type': 'Class',
  1049. 'name': 'SCCD.Inheritance',
  1050. 'pattern': ['<inheritance',
  1051. '@RelationshipClass',
  1052. ' priority="','@Inheritance.priority','"',
  1053. '/>',
  1054. '@newline'
  1055. ]
  1056. },
  1057. 'RelationshipClass': {
  1058. 'type': 'Attribute',
  1059. 'pattern': [' class="','@Relationship.class', '"']
  1060. },
  1061. 'RelationshipMin': {
  1062. 'type': 'Attribute',
  1063. 'pattern': [' min="','@Relationship.min', '"']
  1064. },
  1065. 'RelationshipMax': {
  1066. 'type': 'Attribute',
  1067. 'pattern': [' max="','@Relationship.max', '"']
  1068. },
  1069. 'ClassAttributes': {
  1070. 'type': 'Association',
  1071. 'name': 'SCCD.class_attribute',
  1072. 'target': 'SCCD.Attribute',
  1073. 'pattern': [ '@ClassAttribute' ]
  1074. },
  1075. 'ClassAttribute': {
  1076. 'type': 'Class',
  1077. 'name': 'SCCD.Attribute',
  1078. 'pattern': [
  1079. '<attribute name="', '@Named.name', '"',
  1080. '@AttributeType', '@AttributeDefault',
  1081. '/>',
  1082. '@newline'
  1083. ]
  1084. },
  1085. 'AttributeType': {
  1086. 'type': 'Attribute',
  1087. 'pattern': [' type="','@Attribute.type', '"']
  1088. },
  1089. 'AttributeDefault': {
  1090. 'type': 'Attribute',
  1091. 'pattern': [' type="','@Attribute.default', '"']
  1092. },
  1093. 'ClassMethods': {
  1094. 'type': 'Association',
  1095. 'name': 'SCCD.class_method',
  1096. 'target': 'SCCD.AbsMethod',
  1097. 'pattern': [
  1098. '@ClassConstructor',
  1099. '@ClassDestructor',
  1100. '@ClassMethod'
  1101. ]
  1102. },
  1103. 'ClassConstructor': {
  1104. 'type': 'Class',
  1105. 'name': 'SCCD.Constructor',
  1106. 'pattern': [
  1107. '<method name="', '@-(SCCD.class_method).Named.name', '"', '>',
  1108. '@newline',
  1109. '@AbsMethodParameters',
  1110. '@AbsMethodBody',
  1111. '</method>', '@newline'
  1112. ]
  1113. },
  1114. 'ClassDestructor': {
  1115. 'type': 'Class',
  1116. 'name': 'SCCD.Destructor',
  1117. 'pattern': [
  1118. '<method name="~', '@-(SCCD.class_method).Named.name', '"', '>',
  1119. '@newline',
  1120. '@AbsMethodBody',
  1121. '</method>', '@newline'
  1122. ]
  1123. },
  1124. 'ClassMethod': {
  1125. 'type': 'Class',
  1126. 'name': 'SCCD.Method',
  1127. 'pattern': [
  1128. '<method name="', '@Method.name', '"', '>',
  1129. '@newline',
  1130. '@AbsMethodParameters',
  1131. '@AbsMethodBody',
  1132. '</method>', '@newline'
  1133. ]
  1134. },
  1135. 'AbsMethodParameters': {
  1136. 'type': 'Association',
  1137. 'name': 'SCCD.absmethod_parameter',
  1138. 'target': 'SCCD.Parameter',
  1139. 'pattern': [
  1140. '@indent',
  1141. '<parameter ',
  1142. '@SCCDParameter', '/>',
  1143. '@dedent', '@newline',
  1144. '@ParameterNext'
  1145. ]
  1146. },
  1147. 'ParameterNext': {
  1148. 'type': 'Association',
  1149. 'name': 'SCCD.parameter_parameter_next',
  1150. 'target': 'SCCD.Parameter',
  1151. 'pattern': [
  1152. '@indent',
  1153. '<parameter ',
  1154. '@SCCDParameter', '/>',
  1155. '@dedent', '@newline',
  1156. '@ParameterNext'
  1157. ]
  1158. },
  1159. 'SCCDParameter': {
  1160. 'type': 'Class',
  1161. 'name': 'SCCD.Parameter',
  1162. 'pattern': [
  1163. 'name="','@Parameter.name','"',
  1164. '@ParameterType',
  1165. '@ParameterDefault'
  1166. ]
  1167. },
  1168. 'ParameterType': {
  1169. 'type': 'Association',
  1170. 'name': 'SCCD.parameter_type_expression',
  1171. 'target': 'SCCD.NavigationExpression',
  1172. 'pattern': [ ' type="','@SCCDNavExpr', '"']
  1173. },
  1174. 'ParameterDefault': {
  1175. 'type': 'Attribute',
  1176. 'pattern': [ ' default="','@Parameter.default','"' ]
  1177. },
  1178. 'AbsMethodBody': {
  1179. 'type': 'Association',
  1180. 'name': 'SCCD.absmethod_actionblock_body',
  1181. 'target': 'SCCD.ActionBlock',
  1182. 'pattern': ['@indent',
  1183. '<body>', '@newline',
  1184. '<![CDATA[','@newline',
  1185. '@SCCDActionBlock',
  1186. ']]>','@newline',
  1187. '</body>',
  1188. '@dedent', '@newline'
  1189. ]
  1190. }
  1191. }