| <!-- | |
| Auto-generated ant script that extracts a <file>.${dsl.ext}.xmi into <file>.${dsl.ext}.xmi.${dsl.ext} | |
| It may be used in different ways: | |
| - As an example to write your own ant scripts that do further processing | |
| (e.g., injections, ATL transformations). | |
| - Called from another script | |
| - From the "AM3 Resource Navigator" view, and if the corresponding megamodel | |
| (megamodel.xmi) has been registered (via right-click action "Add megamodel"): | |
| by right-click action "Extract ${dsl.name} Model to ${dsl.name} File" on files | |
| with extension "${dsl.ext}.xmi". | |
| Notes: | |
| - Property "MUri" is initialized by AM3 when invoked as a right-click injection | |
| action. In any other case (e.g., calling the ant script, copy-paste-modify), property | |
| "MUri" has to be defined explicitely. | |
| - This script creates uses extension "${dsl.ext}.xmi.${dsl.ext}" instead of | |
| simply "${dsl.ext}" so that inadvertendly erasing a source file is less likely. | |
| - You may want to change some of the default options of the extractor (e.g., "indentString"). | |
| --> | |
| <project name="${dsl.name}Extractor" default="extraction"> | |
| <property name="MUri" value="/${dsl.name}/Samples/Test1.${dsl.ext}.xmi"/> | |
| <target name="extraction"> | |
| <!-- Loading ${dsl.name} metamodel --> | |
| <am3.loadModel modelHandler="EMF" name="${dsl.name}" metamodel="MOF" path="${mm.location}"/> | |
| <!-- Loading ${dsl.name} model --> | |
| <am3.loadModel modelHandler="EMF" name="my${dsl.name}" metamodel="${dsl.name}" path="${MUri}"/> | |
| <!-- Loading TCS metamodel --> | |
| <am3.loadModel modelHandler="EMF" name="TCS" metamodel="MOF" path="/AMMACore/TCS/Metamodel/TCS.ecore"/> | |
| <!-- Loading ${dsl.name}.tcs model --> | |
| <am3.loadModel modelHandler="EMF" name="${dsl.name}.tcs" metamodel="TCS" path="${syntax.path}/${syntax.tcs.filename}"> | |
| <injector name="ebnf"> | |
| <param name="name" value="TCS"/> | |
| <param name="parserGenerator" value="antlr3"/> | |
| </injector> | |
| </am3.loadModel> | |
| <!-- Saving ${dsl.name} model --> | |
| <am3.saveModel model="my${dsl.name}" path="${MUri}.${dsl.ext}"> | |
| <extractor name="ebnf"> | |
| <param name="format" value="${dsl.name}.tcs"/> | |
| <param name="indentString" value="	"/> | |
| <param name="identEsc" value="""/> | |
| <param name="stringDelim" value="'"/> | |
| <param name="decimalFormat" value="0.##############"/> | |
| <param name="serializeComments" value="true"/> | |
| </extractor> | |
| </am3.saveModel> | |
| </target> | |
| </project> |