fix: better launch config for atl in runtime

This commit is contained in:
Laurent Fainsin 2021-12-04 12:50:02 +01:00
parent 833a9c684f
commit 03b4222df6
12 changed files with 1276 additions and 9 deletions

View file

@ -0,0 +1,50 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.m2m.atl.adt.launching.atlTransformation">
<stringAttribute key="ATL File Name" value="/fr.n7.game2petrinet/Game2PetriNet.atl"/>
<stringAttribute key="ATL VM" value="EMF-specific VM"/>
<stringAttribute key="ATL_COMPILER" value="atl2006"/>
<booleanAttribute key="IS_REFINING" value="false"/>
<mapAttribute key="Input">
<mapEntry key="IN" value="game"/>
</mapAttribute>
<mapAttribute key="Libs"/>
<mapAttribute key="Model Handler">
<mapEntry key="game" value="EMF"/>
<mapEntry key="petrinet" value="EMF"/>
</mapAttribute>
<mapAttribute key="ModelType">
<mapEntry key="IN" value="MODELINPUT"/>
<mapEntry key="OUT" value="MODELOUTPUT"/>
<mapEntry key="game" value="METAMODELINPUT"/>
<mapEntry key="petrinet" value="METAMODELOUTPUT"/>
</mapAttribute>
<mapAttribute key="Options">
<mapEntry key="OPTION_CLEAR" value="false"/>
<mapEntry key="OPTION_CONTENT_TYPE" value="false"/>
<mapEntry key="OPTION_DERIVED" value="true"/>
<mapEntry key="allowInterModelReferences" value="false"/>
<mapEntry key="printExecutionTime" value="false"/>
<mapEntry key="step" value="false"/>
<mapEntry key="supportUML2Stereotypes" value="false"/>
</mapAttribute>
<listAttribute key="OrderedInput">
<listEntry value="IN"/>
</listAttribute>
<listAttribute key="OrderedOutput">
<listEntry value="OUT"/>
</listAttribute>
<mapAttribute key="Output">
<mapEntry key="OUT" value="petrinet"/>
</mapAttribute>
<mapAttribute key="Path">
<mapEntry key="IN" value="/fr.n7.game.examples/enigme.game"/>
<mapEntry key="OUT" value="/fr.n7.petrinet.examples/enigme.petrinet"/>
<mapEntry key="game" value="uri:http://www.n7.fr/game/xtext/Game"/>
<mapEntry key="petrinet" value="uri:http://petrinet"/>
</mapAttribute>
<listAttribute key="Superimpose"/>
<stringAttribute key="bad_container_name" value="fr."/>
<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
<listEntry value="org.eclipse.debug.ui.launchGroup.run"/>
</listAttribute>
</launchConfiguration>

View file

@ -340,9 +340,6 @@ public class ToPrototype extends AbstractAcceleoGenerator {
@Override @Override
public void registerPackages(ResourceSet resourceSet) { public void registerPackages(ResourceSet resourceSet) {
super.registerPackages(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" * If you want to change the content of this method, do NOT forget to change the "@generated"

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project default="toPrototype" name="fr.n7.game.toPrototype"> <project default="toPrototype" name="fr.n7.game.toPrototype">
<property name="ECLIPSE_HOME" value="../../../../../../../../mnt/n7fs/ens/tp_cregut/eclipse-gls-2020-09"/> <property name="ECLIPSE_HOME" value="../../../../../../../../mnt/n7fs/ens/tp_cregut/eclipse-gls-2020-09"/>
<property name="ECLIPSE_WORKSPACE" value="../../../runtime-EclipseXtext"/> <property name="ECLIPSE_WORKSPACE" value="../.."/>
<!-- The classpath with only the dependencies used by the project --> <!-- The classpath with only the dependencies used by the project -->
<path id="fr.n7.game.toPrototype.libraryclasspath"> <path id="fr.n7.game.toPrototype.libraryclasspath">

View file

@ -1 +0,0 @@
/petrinet/

View file

@ -1 +0,0 @@
/petrinet/

View file

@ -1 +0,0 @@
/petrinet/

View file

@ -1 +0,0 @@
/fr/

File diff suppressed because it is too large Load diff

View file

@ -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]

View file

@ -1 +0,0 @@
/petrinet/