From 03b4222df60bd18ca7657eb9f02b238b7fe2adcc Mon Sep 17 00:00:00 2001 From: Laurent Fainsin Date: Sat, 4 Dec 2021 12:50:02 +0100 Subject: [PATCH] fix: better launch config for atl in runtime --- .../ATL Transformation (game2petrinet).launch | 50 + .../n7/game/toPrototype/main/ToPrototype.java | 3 - .../tasks/toPrototype.xml | 2 +- .../xtext/tests/.GameParsingTest.xtendbin | Bin 3389 -> 3389 bytes .../xtext/generator/.GameGenerator.xtendbin | Bin 2284 -> 2284 bytes workspace/fr.n7.petrinet.edit/bin/.gitignore | 1 - .../fr.n7.petrinet.editor/bin/.gitignore | 1 - workspace/fr.n7.petrinet.tests/bin/.gitignore | 1 - .../fr.n7.petrinet.toTINA/bin/.gitignore | 1 - .../fr/n7/petrinet/toTINA/main/toTINA.emtl | 1181 +++++++++++++++++ .../bin/fr/n7/petrinet/toTINA/main/toTINA.mtl | 44 + workspace/fr.n7.petrinet/bin/.gitignore | 1 - 12 files changed, 1276 insertions(+), 9 deletions(-) create mode 100644 runtime-workspace/fr.n7.game2petrinet/ATL Transformation (game2petrinet).launch delete mode 100644 workspace/fr.n7.petrinet.edit/bin/.gitignore delete mode 100644 workspace/fr.n7.petrinet.editor/bin/.gitignore delete mode 100644 workspace/fr.n7.petrinet.tests/bin/.gitignore delete mode 100644 workspace/fr.n7.petrinet.toTINA/bin/.gitignore create mode 100644 workspace/fr.n7.petrinet.toTINA/bin/fr/n7/petrinet/toTINA/main/toTINA.emtl create mode 100755 workspace/fr.n7.petrinet.toTINA/bin/fr/n7/petrinet/toTINA/main/toTINA.mtl delete mode 100644 workspace/fr.n7.petrinet/bin/.gitignore diff --git a/runtime-workspace/fr.n7.game2petrinet/ATL Transformation (game2petrinet).launch b/runtime-workspace/fr.n7.game2petrinet/ATL Transformation (game2petrinet).launch new file mode 100644 index 0000000..ad41721 --- /dev/null +++ b/runtime-workspace/fr.n7.game2petrinet/ATL Transformation (game2petrinet).launch @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/workspace/fr.n7.game.toPrototype/src/fr/n7/game/toPrototype/main/ToPrototype.java b/workspace/fr.n7.game.toPrototype/src/fr/n7/game/toPrototype/main/ToPrototype.java index 0dc72b2..ff38995 100644 --- a/workspace/fr.n7.game.toPrototype/src/fr/n7/game/toPrototype/main/ToPrototype.java +++ b/workspace/fr.n7.game.toPrototype/src/fr/n7/game/toPrototype/main/ToPrototype.java @@ -340,9 +340,6 @@ public class ToPrototype extends AbstractAcceleoGenerator { @Override public void registerPackages(ResourceSet resourceSet) { super.registerPackages(resourceSet); - if (!isInWorkspace(fr.n7.game.xtext.game.GamePackage.class)) { - resourceSet.getPackageRegistry().put(fr.n7.game.xtext.game.GamePackage.eINSTANCE.getNsURI(), fr.n7.game.xtext.game.GamePackage.eINSTANCE); - } /* * If you want to change the content of this method, do NOT forget to change the "@generated" diff --git a/workspace/fr.n7.game.toPrototype/tasks/toPrototype.xml b/workspace/fr.n7.game.toPrototype/tasks/toPrototype.xml index 88121ea..fed1f37 100644 --- a/workspace/fr.n7.game.toPrototype/tasks/toPrototype.xml +++ b/workspace/fr.n7.game.toPrototype/tasks/toPrototype.xml @@ -1,7 +1,7 @@ - + diff --git a/workspace/fr.n7.game.xtext.tests/xtend-gen/fr/n7/game/xtext/tests/.GameParsingTest.xtendbin b/workspace/fr.n7.game.xtext.tests/xtend-gen/fr/n7/game/xtext/tests/.GameParsingTest.xtendbin index 6d3a38edd1f7355bc3c20486f3f7716bce0e99be..351816d9f8b938fca44c35df276bf596eb7e0880 100644 GIT binary patch delta 58 zcmdlhwO5KKz?+#xgn@&DgJDJLMxGC>Oe<11|6}!M0nz?kdQ3oiay^d)h}y~H0HS{L GH~|3l!V;nY delta 58 zcmdlhwO5KKz?+#xgn@&DgCR9xBhLp`rqqPZ|5*K5n9>q9`*Z0r0r`{bc`QKGP96uK J=;Yr#P5{jE5cB{5 diff --git a/workspace/fr.n7.game.xtext/xtend-gen/fr/n7/game/xtext/generator/.GameGenerator.xtendbin b/workspace/fr.n7.game.xtext/xtend-gen/fr/n7/game/xtext/generator/.GameGenerator.xtendbin index a187f02625554ec8a44f927cf6f00d0e6a305c3c..d042664353dc3c1f5bea5600d028c86312270ab1 100644 GIT binary patch delta 58 zcmaDO_(qT?z?+#xgn@&DgJF5;WIYZG5S78<0HRiL GH~|0x7ZO$g delta 58 zcmaDO_(qT?z?+#xgn@&DgW*QPMxH&)Og9oXpJHxc0?|Hf4;X>;WIYZG5S78<0HRiL GH~|0~O%q-K diff --git a/workspace/fr.n7.petrinet.edit/bin/.gitignore b/workspace/fr.n7.petrinet.edit/bin/.gitignore deleted file mode 100644 index 79b56a6..0000000 --- a/workspace/fr.n7.petrinet.edit/bin/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/petrinet/ diff --git a/workspace/fr.n7.petrinet.editor/bin/.gitignore b/workspace/fr.n7.petrinet.editor/bin/.gitignore deleted file mode 100644 index 79b56a6..0000000 --- a/workspace/fr.n7.petrinet.editor/bin/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/petrinet/ diff --git a/workspace/fr.n7.petrinet.tests/bin/.gitignore b/workspace/fr.n7.petrinet.tests/bin/.gitignore deleted file mode 100644 index 79b56a6..0000000 --- a/workspace/fr.n7.petrinet.tests/bin/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/petrinet/ diff --git a/workspace/fr.n7.petrinet.toTINA/bin/.gitignore b/workspace/fr.n7.petrinet.toTINA/bin/.gitignore deleted file mode 100644 index 44fde90..0000000 --- a/workspace/fr.n7.petrinet.toTINA/bin/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/fr/ diff --git a/workspace/fr.n7.petrinet.toTINA/bin/fr/n7/petrinet/toTINA/main/toTINA.emtl b/workspace/fr.n7.petrinet.toTINA/bin/fr/n7/petrinet/toTINA/main/toTINA.emtl new file mode 100644 index 0000000..5050566 --- /dev/null +++ b/workspace/fr.n7.petrinet.toTINA/bin/fr/n7/petrinet/toTINA/main/toTINA.emtl @@ -0,0 +1,1181 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + + diff --git a/workspace/fr.n7.petrinet.toTINA/bin/fr/n7/petrinet/toTINA/main/toTINA.mtl b/workspace/fr.n7.petrinet.toTINA/bin/fr/n7/petrinet/toTINA/main/toTINA.mtl new file mode 100755 index 0000000..601544f --- /dev/null +++ b/workspace/fr.n7.petrinet.toTINA/bin/fr/n7/petrinet/toTINA/main/toTINA.mtl @@ -0,0 +1,44 @@ +[comment encoding = UTF-8 /] +[module toTINA('http://petrinet')] + +[template public networkToTINA(aNetwork : Network)] +[comment @main/] +[file (aNetwork.name + '.net', false, 'UTF-8')] +net [aNetwork.name/] +[let places : OrderedSet(Place) = aNetwork.getPlaces() ] + [if (places->size() > 0)] + [for (place : Place | places)] +pl [place.name/] ([place.tokens/]) + [/for] + [else] + [/if] +[/let] +[let transitions : OrderedSet(Transition) = aNetwork.getTransitions() ] + [if (transitions->size() > 0)] + [for (transition : Transition | transitions)] +[transition.afficher()/] + [/for] + [else] + [/if] +[/let] +[/file] +[/template] + +[query public getPlaces(n: Network) : OrderedSet(Place) = + n.nodes + ->select( e | e.oclIsTypeOf(Place) ) + ->collect( e | e.oclAsType(Place) ) + ->asOrderedSet() +/] + +[query public getTransitions(n: Network) : OrderedSet(Transition) = + n.nodes + ->select( e | e.oclIsTypeOf(Transition) ) + ->collect( e | e.oclAsType(Transition) ) + ->asOrderedSet() +/] + +[template public afficher(t : Transition) post (trim()) ] +[comment][let outgoing = t.getArcs()->select( e | e.isOutgoing() ) /][/comment] +tr [t.name/] [for (a : Arc | t.arcs)][if (not a.outgoing)][a.place.name/]*[a.weight/] [/if][/for]-> [for (a : Arc | t.arcs)][if (a.outgoing)][a.place.name/]*[a.weight/] [/if][/for] +[/template] \ No newline at end of file diff --git a/workspace/fr.n7.petrinet/bin/.gitignore b/workspace/fr.n7.petrinet/bin/.gitignore deleted file mode 100644 index 79b56a6..0000000 --- a/workspace/fr.n7.petrinet/bin/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/petrinet/