TM3SimplePDLPackage.tom 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. %typeterm SPDLScenario extends EObject {
  2. implement { SimplePDLSemantics.TM3SimplePDL.SPDLScenario }
  3. is_sort(t) { $t instanceof SimplePDLSemantics.TM3SimplePDL.SPDLScenario }
  4. equals(l1,l2) { $l1.equals($l2) }
  5. }
  6. %typeterm SPDLTrace extends EObject {
  7. implement { SimplePDLSemantics.TM3SimplePDL.SPDLTrace }
  8. is_sort(t) { $t instanceof SimplePDLSemantics.TM3SimplePDL.SPDLTrace }
  9. equals(l1,l2) { $l1.equals($l2) }
  10. }
  11. %op SPDLTrace SPDLTrace(scenario : SPDLScenario) {
  12. is_fsym(t) { $t instanceof SimplePDLSemantics.TM3SimplePDL.SPDLTrace }
  13. get_slot(scenario, t) { (SimplePDLSemantics.TM3SimplePDL.SPDLScenario)$t.eGet($t.eClass().getEStructuralFeature("scenario")) }
  14. make(scenario) { constructSPDLTrace((SimplePDLSemantics.TM3SimplePDL.SPDLTrace)SimplePDLSemantics.TM3SimplePDL.TM3SimplePDLFactory.eINSTANCE.create((EClass)SimplePDLSemantics.TM3SimplePDL.TM3SimplePDLPackage.eINSTANCE.getEClassifier("SPDLTrace")), new Object[]{ $scenario }) }
  15. implement() { SimplePDLSemantics.TM3SimplePDL.impl.SPDLTraceImpl }
  16. }
  17. public static <O extends org.eclipse.emf.ecore.EObject> O constructSPDLTrace(O o, Object[] objs) {
  18. int i=0;
  19. EList<EStructuralFeature> sfes = o.eClass().getEAllStructuralFeatures();
  20. for(EStructuralFeature esf : sfes) {
  21. if(esf.isChangeable()) {
  22. o.eSet(esf, objs[i]);
  23. i++;
  24. }
  25. }
  26. return o;
  27. }
  28. %typeterm SPDLTraceEList {
  29. implement { org.eclipse.emf.common.util.EList<SimplePDLSemantics.TM3SimplePDL.SPDLTrace> }
  30. is_sort(t) { $t instanceof org.eclipse.emf.common.util.EList<?> && (((org.eclipse.emf.common.util.EList<SimplePDLSemantics.TM3SimplePDL.SPDLTrace>)$t).size() == 0 || (((org.eclipse.emf.common.util.EList<SimplePDLSemantics.TM3SimplePDL.SPDLTrace>)$t).size()>0 && ((org.eclipse.emf.common.util.EList<SimplePDLSemantics.TM3SimplePDL.SPDLTrace>)$t).get(0) instanceof SimplePDLSemantics.TM3SimplePDL.SPDLTrace)) }
  31. equals(l1,l2) { $l1.equals($l2) }
  32. }
  33. %oparray SPDLTraceEList SPDLTraceEList ( SPDLTrace* ) {
  34. is_fsym(t) { $t instanceof org.eclipse.emf.common.util.EList<?> && ($t.size() == 0 || ($t.size()>0 && $t.get(0) instanceof SimplePDLSemantics.TM3SimplePDL.SPDLTrace)) }
  35. make_empty(n) { new org.eclipse.emf.common.util.BasicEList<SimplePDLSemantics.TM3SimplePDL.SPDLTrace>($n) }
  36. make_append(e,l) { appendSPDLTraceEList($e,$l) }
  37. get_element(l,n) { $l.get($n) }
  38. get_size(l) { $l.size() }
  39. }
  40. private static <O> org.eclipse.emf.common.util.EList<O> appendSPDLTraceEList(O e,org.eclipse.emf.common.util.EList<O> l) {
  41. l.add(e);
  42. return l;
  43. }
  44. %typeterm SPDLSimEvent extends EObject {
  45. implement { SimplePDLSemantics.TM3SimplePDL.SPDLSimEvent }
  46. is_sort(t) { $t instanceof SimplePDLSemantics.TM3SimplePDL.SPDLSimEvent }
  47. equals(l1,l2) { $l1.equals($l2) }
  48. }
  49. %op SPDLSimEvent SPDLSimEvent(internal : boolean, date : int, name : String) {
  50. is_fsym(t) { $t instanceof SimplePDLSemantics.TM3SimplePDL.SPDLSimEvent }
  51. get_slot(internal, t) { (java.lang.Boolean)$t.eGet($t.eClass().getEStructuralFeature("internal")) }
  52. get_slot(date, t) { (java.lang.Integer)$t.eGet($t.eClass().getEStructuralFeature("date")) }
  53. get_slot(name, t) { (java.lang.String)$t.eGet($t.eClass().getEStructuralFeature("name")) }
  54. get_default(internal) { false }
  55. get_default(date) { 0 }
  56. get_default(name) { "" }
  57. make(internal, date, name) { constructSPDLSimEvent((SimplePDLSemantics.TM3SimplePDL.SPDLSimEvent)SimplePDLSemantics.TM3SimplePDL.TM3SimplePDLFactory.eINSTANCE.create((EClass)SimplePDLSemantics.TM3SimplePDL.TM3SimplePDLPackage.eINSTANCE.getEClassifier("SPDLSimEvent")), new Object[]{ $internal, $date, $name }) }
  58. implement() { SimplePDLSemantics.TM3SimplePDL.impl.SPDLSimEventImpl }
  59. }
  60. public static <O extends org.eclipse.emf.ecore.EObject> O constructSPDLSimEvent(O o, Object[] objs) {
  61. int i=0;
  62. EList<EStructuralFeature> sfes = o.eClass().getEAllStructuralFeatures();
  63. for(EStructuralFeature esf : sfes) {
  64. if(esf.isChangeable()) {
  65. o.eSet(esf, objs[i]);
  66. i++;
  67. }
  68. }
  69. return o;
  70. }
  71. %typeterm SPDLSimEventEList {
  72. implement { org.eclipse.emf.common.util.EList<SimplePDLSemantics.TM3SimplePDL.SPDLSimEvent> }
  73. is_sort(t) { $t instanceof org.eclipse.emf.common.util.EList<?> && (((org.eclipse.emf.common.util.EList<SimplePDLSemantics.TM3SimplePDL.SPDLSimEvent>)$t).size() == 0 || (((org.eclipse.emf.common.util.EList<SimplePDLSemantics.TM3SimplePDL.SPDLSimEvent>)$t).size()>0 && ((org.eclipse.emf.common.util.EList<SimplePDLSemantics.TM3SimplePDL.SPDLSimEvent>)$t).get(0) instanceof SimplePDLSemantics.TM3SimplePDL.SPDLSimEvent)) }
  74. equals(l1,l2) { $l1.equals($l2) }
  75. }
  76. %oparray SPDLSimEventEList SPDLSimEventEList ( SPDLSimEvent* ) {
  77. is_fsym(t) { $t instanceof org.eclipse.emf.common.util.EList<?> && ($t.size() == 0 || ($t.size()>0 && $t.get(0) instanceof SimplePDLSemantics.TM3SimplePDL.SPDLSimEvent)) }
  78. make_empty(n) { new org.eclipse.emf.common.util.BasicEList<SimplePDLSemantics.TM3SimplePDL.SPDLSimEvent>($n) }
  79. make_append(e,l) { appendSPDLSimEventEList($e,$l) }
  80. get_element(l,n) { $l.get($n) }
  81. get_size(l) { $l.size() }
  82. }
  83. private static <O> org.eclipse.emf.common.util.EList<O> appendSPDLSimEventEList(O e,org.eclipse.emf.common.util.EList<O> l) {
  84. l.add(e);
  85. return l;
  86. }
  87. %op SPDLScenario SPDLScenario(traces : SPDLTraceEList, simEvents : SPDLSimEventEList) {
  88. is_fsym(t) { $t instanceof SimplePDLSemantics.TM3SimplePDL.SPDLScenario }
  89. get_slot(traces, t) { (org.eclipse.emf.common.util.EList<SimplePDLSemantics.TM3SimplePDL.SPDLTrace>)$t.eGet($t.eClass().getEStructuralFeature("traces")) }
  90. get_slot(simEvents, t) { (org.eclipse.emf.common.util.EList<SimplePDLSemantics.TM3SimplePDL.SPDLSimEvent>)$t.eGet($t.eClass().getEStructuralFeature("simEvents")) }
  91. make(traces, simEvents) { constructSPDLScenario((SimplePDLSemantics.TM3SimplePDL.SPDLScenario)SimplePDLSemantics.TM3SimplePDL.TM3SimplePDLFactory.eINSTANCE.create((EClass)SimplePDLSemantics.TM3SimplePDL.TM3SimplePDLPackage.eINSTANCE.getEClassifier("SPDLScenario")), new Object[]{ $traces, $simEvents }) }
  92. implement() { SimplePDLSemantics.TM3SimplePDL.impl.SPDLScenarioImpl }
  93. }
  94. public static <O extends org.eclipse.emf.ecore.EObject> O constructSPDLScenario(O o, Object[] objs) {
  95. int i=0;
  96. EList<EStructuralFeature> sfes = o.eClass().getEAllStructuralFeatures();
  97. for(EStructuralFeature esf : sfes) {
  98. if(esf.isChangeable()) {
  99. o.eSet(esf, objs[i]);
  100. i++;
  101. }
  102. }
  103. return o;
  104. }