EDMMPetriNetPackage.tom 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. %typeterm PetriNetEvent extends PNSimEvent {
  2. implement { petrinetsemantics.EDMMPetriNet.PetriNetEvent }
  3. is_sort(t) { $t instanceof petrinetsemantics.EDMMPetriNet.PetriNetEvent }
  4. equals(l1,l2) { $l1.equals($l2) }
  5. }
  6. %include { boolean.tom }
  7. %typeterm FireTransitionEvent extends PetriNetEvent {
  8. implement { petrinetsemantics.EDMMPetriNet.FireTransitionEvent }
  9. is_sort(t) { $t instanceof petrinetsemantics.EDMMPetriNet.FireTransitionEvent }
  10. equals(l1,l2) { $l1.equals($l2) }
  11. }
  12. %include { double.tom }
  13. %op FireTransitionEvent FireTransitionEvent(internal : boolean, date : int, name : String, time : double, firedTransition : Transition) {
  14. is_fsym(t) { $t instanceof petrinetsemantics.EDMMPetriNet.FireTransitionEvent }
  15. get_slot(internal, t) { (java.lang.Boolean)$t.eGet($t.eClass().getEStructuralFeature("internal")) }
  16. get_slot(date, t) { (java.lang.Integer)$t.eGet($t.eClass().getEStructuralFeature("date")) }
  17. get_slot(name, t) { (java.lang.String)$t.eGet($t.eClass().getEStructuralFeature("name")) }
  18. get_slot(time, t) { (java.lang.Double)$t.eGet($t.eClass().getEStructuralFeature("time")) }
  19. get_slot(firedTransition, t) { (petrinetsemantics.DDMMPetriNet.Transition)$t.eGet($t.eClass().getEStructuralFeature("firedTransition")) }
  20. get_default(internal) { false }
  21. get_default(date) { 0 }
  22. get_default(name) { "" }
  23. get_default(time) { 0.0 }
  24. make(internal, date, name, time, firedTransition) { constructFireTransitionEvent((petrinetsemantics.EDMMPetriNet.FireTransitionEvent)petrinetsemantics.EDMMPetriNet.EDMMPetriNetFactory.eINSTANCE.create((EClass)petrinetsemantics.EDMMPetriNet.EDMMPetriNetPackage.eINSTANCE.getEClassifier("FireTransitionEvent")), new Object[]{ $internal, $date, $name, $time, $firedTransition }) }
  25. implement() { petrinetsemantics.EDMMPetriNet.impl.FireTransitionEventImpl }
  26. }
  27. public static <O extends org.eclipse.emf.ecore.EObject> O constructFireTransitionEvent(O o, Object[] objs) {
  28. int i=0;
  29. EList<EStructuralFeature> sfes = o.eClass().getEAllStructuralFeatures();
  30. for(EStructuralFeature esf : sfes) {
  31. if(esf.isChangeable()) {
  32. o.eSet(esf, objs[i]);
  33. i++;
  34. }
  35. }
  36. return o;
  37. }