DDMMSimplePDLPackage.tom 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. %typeterm Process extends EObject {
  2. implement { SimplePDLSemantics.DDMMSimplePDL.Process }
  3. is_sort(t) { $t instanceof SimplePDLSemantics.DDMMSimplePDL.Process }
  4. equals(l1,l2) { $l1.equals($l2) }
  5. }
  6. %include { string.tom }
  7. %typeterm ProcessElement extends EObject {
  8. implement { SimplePDLSemantics.DDMMSimplePDL.ProcessElement }
  9. is_sort(t) { $t instanceof SimplePDLSemantics.DDMMSimplePDL.ProcessElement }
  10. equals(l1,l2) { $l1.equals($l2) }
  11. }
  12. %typeterm ProcessElementEList {
  13. implement { org.eclipse.emf.common.util.EList<SimplePDLSemantics.DDMMSimplePDL.ProcessElement> }
  14. is_sort(t) { $t instanceof org.eclipse.emf.common.util.EList<?> && (((org.eclipse.emf.common.util.EList<SimplePDLSemantics.DDMMSimplePDL.ProcessElement>)$t).size() == 0 || (((org.eclipse.emf.common.util.EList<SimplePDLSemantics.DDMMSimplePDL.ProcessElement>)$t).size()>0 && ((org.eclipse.emf.common.util.EList<SimplePDLSemantics.DDMMSimplePDL.ProcessElement>)$t).get(0) instanceof SimplePDLSemantics.DDMMSimplePDL.ProcessElement)) }
  15. equals(l1,l2) { $l1.equals($l2) }
  16. }
  17. %oparray ProcessElementEList ProcessElementEList ( ProcessElement* ) {
  18. is_fsym(t) { $t instanceof org.eclipse.emf.common.util.EList<?> && ($t.size() == 0 || ($t.size()>0 && $t.get(0) instanceof SimplePDLSemantics.DDMMSimplePDL.ProcessElement)) }
  19. make_empty(n) { new org.eclipse.emf.common.util.BasicEList<SimplePDLSemantics.DDMMSimplePDL.ProcessElement>($n) }
  20. make_append(e,l) { appendProcessElementEList($e,$l) }
  21. get_element(l,n) { $l.get($n) }
  22. get_size(l) { $l.size() }
  23. }
  24. private static <O> org.eclipse.emf.common.util.EList<O> appendProcessElementEList(O e,org.eclipse.emf.common.util.EList<O> l) {
  25. l.add(e);
  26. return l;
  27. }
  28. %typeterm WorkDefinition extends ProcessElement {
  29. implement { SimplePDLSemantics.DDMMSimplePDL.WorkDefinition }
  30. is_sort(t) { $t instanceof SimplePDLSemantics.DDMMSimplePDL.WorkDefinition }
  31. equals(l1,l2) { $l1.equals($l2) }
  32. }
  33. %typeterm WorkSequence extends ProcessElement {
  34. implement { SimplePDLSemantics.DDMMSimplePDL.WorkSequence }
  35. is_sort(t) { $t instanceof SimplePDLSemantics.DDMMSimplePDL.WorkSequence }
  36. equals(l1,l2) { $l1.equals($l2) }
  37. }
  38. %typeterm WorkSequenceType {
  39. implement { SimplePDLSemantics.DDMMSimplePDL.WorkSequenceType }
  40. is_sort(t) { $t instanceof SimplePDLSemantics.DDMMSimplePDL.WorkSequenceType }
  41. equals(l1,l2) { $l1.equals($l2) }
  42. }
  43. %op WorkSequenceType WorkSequenceTypestartToStart() {
  44. is_fsym(t) { t == SimplePDLSemantics.DDMMSimplePDL.WorkSequenceType.get("startToStart") }
  45. make() { (SimplePDLSemantics.DDMMSimplePDL.WorkSequenceType)SimplePDLSemantics.DDMMSimplePDL.DDMMSimplePDLFactory.eINSTANCE.createFromString((EDataType)SimplePDLSemantics.DDMMSimplePDL.DDMMSimplePDLPackage.eINSTANCE.getWorkSequenceType(), "startToStart") }
  46. }
  47. %op WorkSequenceType WorkSequenceTypefinishToStart() {
  48. is_fsym(t) { t == SimplePDLSemantics.DDMMSimplePDL.WorkSequenceType.get("finishToStart") }
  49. make() { (SimplePDLSemantics.DDMMSimplePDL.WorkSequenceType)SimplePDLSemantics.DDMMSimplePDL.DDMMSimplePDLFactory.eINSTANCE.createFromString((EDataType)SimplePDLSemantics.DDMMSimplePDL.DDMMSimplePDLPackage.eINSTANCE.getWorkSequenceType(), "finishToStart") }
  50. }
  51. %op WorkSequenceType WorkSequenceTypestartToFinish() {
  52. is_fsym(t) { t == SimplePDLSemantics.DDMMSimplePDL.WorkSequenceType.get("startToFinish") }
  53. make() { (SimplePDLSemantics.DDMMSimplePDL.WorkSequenceType)SimplePDLSemantics.DDMMSimplePDL.DDMMSimplePDLFactory.eINSTANCE.createFromString((EDataType)SimplePDLSemantics.DDMMSimplePDL.DDMMSimplePDLPackage.eINSTANCE.getWorkSequenceType(), "startToFinish") }
  54. }
  55. %op WorkSequenceType WorkSequenceTypefinishToFinish() {
  56. is_fsym(t) { t == SimplePDLSemantics.DDMMSimplePDL.WorkSequenceType.get("finishToFinish") }
  57. make() { (SimplePDLSemantics.DDMMSimplePDL.WorkSequenceType)SimplePDLSemantics.DDMMSimplePDL.DDMMSimplePDLFactory.eINSTANCE.createFromString((EDataType)SimplePDLSemantics.DDMMSimplePDL.DDMMSimplePDLPackage.eINSTANCE.getWorkSequenceType(), "finishToFinish") }
  58. }
  59. %op WorkSequence WorkSequence(parent : Process, linkType : WorkSequenceType, predecessor : WorkDefinition, successor : WorkDefinition) {
  60. is_fsym(t) { $t instanceof SimplePDLSemantics.DDMMSimplePDL.WorkSequence }
  61. get_slot(parent, t) { (SimplePDLSemantics.DDMMSimplePDL.Process)$t.eGet($t.eClass().getEStructuralFeature("parent")) }
  62. get_slot(linkType, t) { (SimplePDLSemantics.DDMMSimplePDL.WorkSequenceType)$t.eGet($t.eClass().getEStructuralFeature("linkType")) }
  63. get_slot(predecessor, t) { (SimplePDLSemantics.DDMMSimplePDL.WorkDefinition)$t.eGet($t.eClass().getEStructuralFeature("predecessor")) }
  64. get_slot(successor, t) { (SimplePDLSemantics.DDMMSimplePDL.WorkDefinition)$t.eGet($t.eClass().getEStructuralFeature("successor")) }
  65. get_default(linkType) { `WorkSequenceTypestartToStart() }
  66. make(parent, linkType, predecessor, successor) { constructWorkSequence((SimplePDLSemantics.DDMMSimplePDL.WorkSequence)SimplePDLSemantics.DDMMSimplePDL.DDMMSimplePDLFactory.eINSTANCE.create((EClass)SimplePDLSemantics.DDMMSimplePDL.DDMMSimplePDLPackage.eINSTANCE.getEClassifier("WorkSequence")), new Object[]{ $parent, $linkType, $predecessor, $successor }) }
  67. implement() { SimplePDLSemantics.DDMMSimplePDL.impl.WorkSequenceImpl }
  68. }
  69. public static <O extends org.eclipse.emf.ecore.EObject> O constructWorkSequence(O o, Object[] objs) {
  70. int i=0;
  71. EList<EStructuralFeature> sfes = o.eClass().getEAllStructuralFeatures();
  72. for(EStructuralFeature esf : sfes) {
  73. if(esf.isChangeable()) {
  74. o.eSet(esf, objs[i]);
  75. i++;
  76. }
  77. }
  78. return o;
  79. }
  80. %typeterm WorkSequenceEList {
  81. implement { org.eclipse.emf.common.util.EList<SimplePDLSemantics.DDMMSimplePDL.WorkSequence> }
  82. is_sort(t) { $t instanceof org.eclipse.emf.common.util.EList<?> && (((org.eclipse.emf.common.util.EList<SimplePDLSemantics.DDMMSimplePDL.WorkSequence>)$t).size() == 0 || (((org.eclipse.emf.common.util.EList<SimplePDLSemantics.DDMMSimplePDL.WorkSequence>)$t).size()>0 && ((org.eclipse.emf.common.util.EList<SimplePDLSemantics.DDMMSimplePDL.WorkSequence>)$t).get(0) instanceof SimplePDLSemantics.DDMMSimplePDL.WorkSequence)) }
  83. equals(l1,l2) { $l1.equals($l2) }
  84. }
  85. %oparray WorkSequenceEList WorkSequenceEList ( WorkSequence* ) {
  86. is_fsym(t) { $t instanceof org.eclipse.emf.common.util.EList<?> && ($t.size() == 0 || ($t.size()>0 && $t.get(0) instanceof SimplePDLSemantics.DDMMSimplePDL.WorkSequence)) }
  87. make_empty(n) { new org.eclipse.emf.common.util.BasicEList<SimplePDLSemantics.DDMMSimplePDL.WorkSequence>($n) }
  88. make_append(e,l) { appendWorkSequenceEList($e,$l) }
  89. get_element(l,n) { $l.get($n) }
  90. get_size(l) { $l.size() }
  91. }
  92. private static <O> org.eclipse.emf.common.util.EList<O> appendWorkSequenceEList(O e,org.eclipse.emf.common.util.EList<O> l) {
  93. l.add(e);
  94. return l;
  95. }
  96. %op WorkDefinition WorkDefinition(parent : Process, linksToPredecessors : WorkSequenceEList, linksToSuccessors : WorkSequenceEList, name : String, process : Process) {
  97. is_fsym(t) { $t instanceof SimplePDLSemantics.DDMMSimplePDL.WorkDefinition }
  98. get_slot(parent, t) { (SimplePDLSemantics.DDMMSimplePDL.Process)$t.eGet($t.eClass().getEStructuralFeature("parent")) }
  99. get_slot(linksToPredecessors, t) { (org.eclipse.emf.common.util.EList<SimplePDLSemantics.DDMMSimplePDL.WorkSequence>)$t.eGet($t.eClass().getEStructuralFeature("linksToPredecessors")) }
  100. get_slot(linksToSuccessors, t) { (org.eclipse.emf.common.util.EList<SimplePDLSemantics.DDMMSimplePDL.WorkSequence>)$t.eGet($t.eClass().getEStructuralFeature("linksToSuccessors")) }
  101. get_slot(name, t) { (java.lang.String)$t.eGet($t.eClass().getEStructuralFeature("name")) }
  102. get_slot(process, t) { (SimplePDLSemantics.DDMMSimplePDL.Process)$t.eGet($t.eClass().getEStructuralFeature("process")) }
  103. make(parent, linksToPredecessors, linksToSuccessors, name, process) { constructWorkDefinition((SimplePDLSemantics.DDMMSimplePDL.WorkDefinition)SimplePDLSemantics.DDMMSimplePDL.DDMMSimplePDLFactory.eINSTANCE.create((EClass)SimplePDLSemantics.DDMMSimplePDL.DDMMSimplePDLPackage.eINSTANCE.getEClassifier("WorkDefinition")), new Object[]{ $parent, $linksToPredecessors, $linksToSuccessors, $name, $process }) }
  104. implement() { SimplePDLSemantics.DDMMSimplePDL.impl.WorkDefinitionImpl }
  105. }
  106. public static <O extends org.eclipse.emf.ecore.EObject> O constructWorkDefinition(O o, Object[] objs) {
  107. int i=0;
  108. EList<EStructuralFeature> sfes = o.eClass().getEAllStructuralFeatures();
  109. for(EStructuralFeature esf : sfes) {
  110. if(esf.isChangeable()) {
  111. o.eSet(esf, objs[i]);
  112. i++;
  113. }
  114. }
  115. return o;
  116. }
  117. %op Process Process(name : String, processElements : ProcessElementEList, from : WorkDefinition) {
  118. is_fsym(t) { $t instanceof SimplePDLSemantics.DDMMSimplePDL.Process }
  119. get_slot(name, t) { (java.lang.String)$t.eGet($t.eClass().getEStructuralFeature("name")) }
  120. get_slot(processElements, t) { (org.eclipse.emf.common.util.EList<SimplePDLSemantics.DDMMSimplePDL.ProcessElement>)$t.eGet($t.eClass().getEStructuralFeature("processElements")) }
  121. get_slot(from, t) { (SimplePDLSemantics.DDMMSimplePDL.WorkDefinition)$t.eGet($t.eClass().getEStructuralFeature("from")) }
  122. make(name, processElements, from) { constructProcess((SimplePDLSemantics.DDMMSimplePDL.Process)SimplePDLSemantics.DDMMSimplePDL.DDMMSimplePDLFactory.eINSTANCE.create((EClass)SimplePDLSemantics.DDMMSimplePDL.DDMMSimplePDLPackage.eINSTANCE.getEClassifier("Process")), new Object[]{ $name, $processElements, $from }) }
  123. implement() { SimplePDLSemantics.DDMMSimplePDL.impl.ProcessImpl }
  124. }
  125. public static <O extends org.eclipse.emf.ecore.EObject> O constructProcess(O o, Object[] objs) {
  126. int i=0;
  127. EList<EStructuralFeature> sfes = o.eClass().getEAllStructuralFeatures();
  128. for(EStructuralFeature esf : sfes) {
  129. if(esf.isChangeable()) {
  130. o.eSet(esf, objs[i]);
  131. i++;
  132. }
  133. }
  134. return o;
  135. }
  136. %typeterm Guidance extends ProcessElement {
  137. implement { SimplePDLSemantics.DDMMSimplePDL.Guidance }
  138. is_sort(t) { $t instanceof SimplePDLSemantics.DDMMSimplePDL.Guidance }
  139. equals(l1,l2) { $l1.equals($l2) }
  140. }
  141. %op Guidance Guidance(parent : Process, element : ProcessElementEList, text : String) {
  142. is_fsym(t) { $t instanceof SimplePDLSemantics.DDMMSimplePDL.Guidance }
  143. get_slot(parent, t) { (SimplePDLSemantics.DDMMSimplePDL.Process)$t.eGet($t.eClass().getEStructuralFeature("parent")) }
  144. get_slot(element, t) { (org.eclipse.emf.common.util.EList<SimplePDLSemantics.DDMMSimplePDL.ProcessElement>)$t.eGet($t.eClass().getEStructuralFeature("element")) }
  145. get_slot(text, t) { (java.lang.String)$t.eGet($t.eClass().getEStructuralFeature("text")) }
  146. make(parent, element, text) { constructGuidance((SimplePDLSemantics.DDMMSimplePDL.Guidance)SimplePDLSemantics.DDMMSimplePDL.DDMMSimplePDLFactory.eINSTANCE.create((EClass)SimplePDLSemantics.DDMMSimplePDL.DDMMSimplePDLPackage.eINSTANCE.getEClassifier("Guidance")), new Object[]{ $parent, $element, $text }) }
  147. implement() { SimplePDLSemantics.DDMMSimplePDL.impl.GuidanceImpl }
  148. }
  149. public static <O extends org.eclipse.emf.ecore.EObject> O constructGuidance(O o, Object[] objs) {
  150. int i=0;
  151. EList<EStructuralFeature> sfes = o.eClass().getEAllStructuralFeatures();
  152. for(EStructuralFeature esf : sfes) {
  153. if(esf.isChangeable()) {
  154. o.eSet(esf, objs[i]);
  155. i++;
  156. }
  157. }
  158. return o;
  159. }