-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
333 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
.../resources/acceleoAqlTests/evaluation/expressionStatement/letExpression/letExpression.mtl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[module letExpression('http://www.eclipse.org/emf/2002/Ecore')/] | ||
|
||
[template public myTemplate(myParam : ecore::EPackage)] | ||
[file (myParam.name + '.txt', false)] | ||
['The name is: ' + myParam.myQuery()/] | ||
[/file] | ||
[/template] | ||
|
||
[query public myQuery(myParam : ecore::EPackage) : String = | ||
let s : ecore::EPackage = myParam in s.name/] |
9 changes: 9 additions & 0 deletions
9
...s/acceleoAqlTests/evaluation/expressionStatement/letExpression/letExpression-expected.mtl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[module letExpression('http://www.eclipse.org/emf/2002/Ecore')/] | ||
|
||
[template public myTemplate(myParam : ecore::EPackage)] | ||
[file (myParam.name + '.txt', overwrite)] | ||
['The name is: ' + myParam.myQuery()/] | ||
[/file] | ||
[/template] | ||
|
||
[query public myQuery(myParam : ecore::EPackage) : String = let s : ecore::EPackage = myParam in s.name/] |
10 changes: 10 additions & 0 deletions
10
...ces/acceleoAqlTests/evaluation/expressionStatement/letExpression/letExpression-origin.mtl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[module letExpression('http://www.eclipse.org/emf/2002/Ecore')/] | ||
|
||
[template public myTemplate(myParam : ecore::EPackage)] | ||
[file (myParam.name + '.txt', false)] | ||
['The name is: ' + myParam.myQuery()/] | ||
[/file] | ||
[/template] | ||
|
||
[query public myQuery(myParam : ecore::EPackage) : String = | ||
let s : ecore::EPackage = myParam in s.name/] |
270 changes: 270 additions & 0 deletions
270
...resources/acceleoAqlTests/evaluation/expressionStatement/letExpression/letExpression.emtl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,270 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:mtl="http://www.eclipse.org/acceleo/mtl/3.0" xmlns:ocl.ecore="http://www.eclipse.org/ocl/1.1.0/Ecore"> | ||
<mtl:Module name="letExpression" nsURI="resources::acceleoAqlTests::evaluation::expressionStatement::letExpression::letExpression" endHeaderPosition="62"> | ||
<input> | ||
<takesTypesFrom href="http://www.eclipse.org/emf/2002/Ecore#/"/> | ||
</input> | ||
<ownedModuleElement xsi:type="mtl:Template" name="myTemplate" visibility="Public"> | ||
<body xsi:type="mtl:FileBlock" openMode="OverWrite"> | ||
<body xsi:type="ocl.ecore:StringLiteralExp" stringSymbol=" "/> | ||
<body xsi:type="ocl.ecore:OperationCallExp" referredOperation="/1/oclstdlib_String_Class/+"> | ||
<eType xsi:type="ocl.ecore:PrimitiveType" href="http://www.eclipse.org/ocl/1.1.0/oclstdlib.ecore#/0/String"/> | ||
<source xsi:type="ocl.ecore:StringLiteralExp" stringSymbol="The name is: "> | ||
<eType xsi:type="ocl.ecore:PrimitiveType" href="http://www.eclipse.org/ocl/1.1.0/oclstdlib.ecore#/0/String"/> | ||
</source> | ||
<argument xsi:type="mtl:QueryInvocation" definition="/0/myQuery"> | ||
<eType xsi:type="ocl.ecore:PrimitiveType" href="http://www.eclipse.org/ocl/1.1.0/oclstdlib.ecore#/0/String"/> | ||
<argument xsi:type="ocl.ecore:VariableExp" name="myParam" referredVariable="/0/myTemplate/myParam"> | ||
<eType xsi:type="ecore:EClass" href="http://www.eclipse.org/emf/2002/Ecore#//EPackage"/> | ||
</argument> | ||
</argument> | ||
</body> | ||
<body xsi:type="ocl.ecore:StringLiteralExp" stringSymbol="
"/> | ||
<fileUrl xsi:type="ocl.ecore:OperationCallExp" referredOperation="/1/oclstdlib_String_Class/+"> | ||
<eType xsi:type="ocl.ecore:PrimitiveType" href="http://www.eclipse.org/ocl/1.1.0/oclstdlib.ecore#/0/String"/> | ||
<source xsi:type="ocl.ecore:PropertyCallExp"> | ||
<eType xsi:type="ocl.ecore:PrimitiveType" href="http://www.eclipse.org/ocl/1.1.0/oclstdlib.ecore#/0/String"/> | ||
<source xsi:type="ocl.ecore:VariableExp" name="myParam" referredVariable="/0/myTemplate/myParam"> | ||
<eType xsi:type="ecore:EClass" href="http://www.eclipse.org/emf/2002/Ecore#//EPackage"/> | ||
</source> | ||
<referredProperty xsi:type="ecore:EAttribute" href="http://www.eclipse.org/emf/2002/Ecore#//ENamedElement/name"/> | ||
</source> | ||
<argument xsi:type="ocl.ecore:StringLiteralExp" stringSymbol=".txt"> | ||
<eType xsi:type="ocl.ecore:PrimitiveType" href="http://www.eclipse.org/ocl/1.1.0/oclstdlib.ecore#/0/String"/> | ||
</argument> | ||
</fileUrl> | ||
</body> | ||
<parameter name="myParam"> | ||
<eType xsi:type="ecore:EClass" href="http://www.eclipse.org/emf/2002/Ecore#//EPackage"/> | ||
</parameter> | ||
</ownedModuleElement> | ||
<ownedModuleElement xsi:type="mtl:Query" name="myQuery" visibility="Public"> | ||
<parameter name="myParam"> | ||
<eType xsi:type="ecore:EClass" href="http://www.eclipse.org/emf/2002/Ecore#//EPackage"/> | ||
</parameter> | ||
<expression xsi:type="ocl.ecore:LetExp"> | ||
<eType xsi:type="ocl.ecore:PrimitiveType" href="http://www.eclipse.org/ocl/1.1.0/oclstdlib.ecore#/0/String"/> | ||
<in xsi:type="ocl.ecore:PropertyCallExp"> | ||
<eType xsi:type="ocl.ecore:PrimitiveType" href="http://www.eclipse.org/ocl/1.1.0/oclstdlib.ecore#/0/String"/> | ||
<source xsi:type="ocl.ecore:VariableExp" name="s" referredVariable="/0/myQuery/%/s"> | ||
<eType xsi:type="ecore:EClass" href="http://www.eclipse.org/emf/2002/Ecore#//EPackage"/> | ||
</source> | ||
<referredProperty xsi:type="ecore:EAttribute" href="http://www.eclipse.org/emf/2002/Ecore#//ENamedElement/name"/> | ||
</in> | ||
<variable xsi:type="ocl.ecore:Variable" name="s"> | ||
<eType xsi:type="ecore:EClass" href="http://www.eclipse.org/emf/2002/Ecore#//EPackage"/> | ||
<initExpression xsi:type="ocl.ecore:VariableExp" name="myParam" referredVariable="/0/myQuery/myParam"> | ||
<eType xsi:type="ecore:EClass" href="http://www.eclipse.org/emf/2002/Ecore#//EPackage"/> | ||
</initExpression> | ||
</variable> | ||
</expression> | ||
<type xsi:type="ocl.ecore:PrimitiveType" href="http://www.eclipse.org/ocl/1.1.0/oclstdlib.ecore#/0/String"/> | ||
</ownedModuleElement> | ||
</mtl:Module> | ||
<ecore:EPackage name="additions"> | ||
<eClassifiers xsi:type="ecore:EClass" name="oclstdlib_String_Class"> | ||
<eAnnotations source="http://www.eclipse.org/ocl/1.1.0/OCL"> | ||
<references href="http://www.eclipse.org/ocl/1.1.0/oclstdlib.ecore#/0/String"/> | ||
</eAnnotations> | ||
<eOperations name="+"> | ||
<eAnnotations source="MTL non-standard"/> | ||
<eType xsi:type="ocl.ecore:PrimitiveType" href="http://www.eclipse.org/ocl/1.1.0/oclstdlib.ecore#/0/String"/> | ||
<eParameters name="other"> | ||
<eType xsi:type="ocl.ecore:AnyType" href="http://www.eclipse.org/ocl/1.1.0/oclstdlib.ecore#/0/OclAny"/> | ||
</eParameters> | ||
</eOperations> | ||
</eClassifiers> | ||
<eClassifiers xsi:type="ecore:EClass" name="oclstdlib_Integer_Class"> | ||
<eAnnotations source="http://www.eclipse.org/ocl/1.1.0/OCL"> | ||
<references href="http://www.eclipse.org/ocl/1.1.0/oclstdlib.ecore#/0/Integer"/> | ||
</eAnnotations> | ||
</eClassifiers> | ||
<eClassifiers xsi:type="ecore:EClass" name="oclstdlib_Real_Class"> | ||
<eAnnotations source="http://www.eclipse.org/ocl/1.1.0/OCL"> | ||
<references href="http://www.eclipse.org/ocl/1.1.0/oclstdlib.ecore#/0/Real"/> | ||
</eAnnotations> | ||
</eClassifiers> | ||
<eClassifiers xsi:type="ecore:EClass" name="ecore_EObject_Class"> | ||
<eAnnotations source="http://www.eclipse.org/ocl/1.1.0/OCL"> | ||
<references href="http://www.eclipse.org/emf/2002/Ecore#//EObject"/> | ||
</eAnnotations> | ||
<eOperations name="myTemplate"> | ||
<eAnnotations source="http://www.eclipse.org/ocl/1.1.0/OCL"> | ||
<contents xsi:type="ocl.ecore:Constraint"/> | ||
</eAnnotations> | ||
<eAnnotations source="MTL" references="/0/myTemplate"/> | ||
<eType xsi:type="ocl.ecore:PrimitiveType" href="http://www.eclipse.org/ocl/1.1.0/oclstdlib.ecore#/0/String"/> | ||
<eParameters name="myParam"> | ||
<eType xsi:type="ecore:EClass" href="http://www.eclipse.org/emf/2002/Ecore#//EPackage"/> | ||
</eParameters> | ||
</eOperations> | ||
<eOperations name="myQuery"> | ||
<eAnnotations source="http://www.eclipse.org/ocl/1.1.0/OCL"> | ||
<contents xsi:type="ocl.ecore:Constraint"/> | ||
</eAnnotations> | ||
<eAnnotations source="MTL" references="/0/myQuery"/> | ||
<eType xsi:type="ocl.ecore:PrimitiveType" href="http://www.eclipse.org/ocl/1.1.0/oclstdlib.ecore#/0/String"/> | ||
<eParameters name="myParam"> | ||
<eType xsi:type="ecore:EClass" href="http://www.eclipse.org/emf/2002/Ecore#//EPackage"/> | ||
</eParameters> | ||
</eOperations> | ||
</eClassifiers> | ||
<eClassifiers xsi:type="ecore:EClass" name="oclstdlib_OclAny_Class"> | ||
<eAnnotations source="http://www.eclipse.org/ocl/1.1.0/OCL"> | ||
<references href="http://www.eclipse.org/ocl/1.1.0/oclstdlib.ecore#/0/OclAny"/> | ||
</eAnnotations> | ||
</eClassifiers> | ||
<eClassifiers xsi:type="ecore:EClass" name="oclstdlib_Collection(T)_Class"> | ||
<eAnnotations source="http://www.eclipse.org/ocl/1.1.0/OCL"> | ||
<references href="http://www.eclipse.org/ocl/1.1.0/oclstdlib.ecore#/0/Collection(T)"/> | ||
</eAnnotations> | ||
</eClassifiers> | ||
<eClassifiers xsi:type="ecore:EClass" name="oclstdlib_Sequence(T)_Class"> | ||
<eAnnotations source="http://www.eclipse.org/ocl/1.1.0/OCL"> | ||
<references href="http://www.eclipse.org/ocl/1.1.0/oclstdlib.ecore#/0/Sequence(T)"/> | ||
</eAnnotations> | ||
</eClassifiers> | ||
<eClassifiers xsi:type="ecore:EClass" name="oclstdlib_OrderedSet(T)_Class"> | ||
<eAnnotations source="http://www.eclipse.org/ocl/1.1.0/OCL"> | ||
<references href="http://www.eclipse.org/ocl/1.1.0/oclstdlib.ecore#/0/OrderedSet(T)"/> | ||
</eAnnotations> | ||
</eClassifiers> | ||
<eClassifiers xsi:type="ecore:EClass" name="ecore_EPackage_Class"> | ||
<eAnnotations source="http://www.eclipse.org/ocl/1.1.0/OCL"> | ||
<references href="http://www.eclipse.org/emf/2002/Ecore#//EPackage"/> | ||
</eAnnotations> | ||
</eClassifiers> | ||
</ecore:EPackage> | ||
<ocl.ecore:Variable name="self"> | ||
<eType xsi:type="ecore:EClass" href="http://www.eclipse.org/emf/2002/Ecore#//EObject"/> | ||
</ocl.ecore:Variable> | ||
<ocl.ecore:Variable name="self"> | ||
<eType xsi:type="ecore:EClass" href="http://www.eclipse.org/emf/2002/Ecore#//EPackage"/> | ||
</ocl.ecore:Variable> | ||
<ocl.ecore:Variable name="self"> | ||
<eType xsi:type="ocl.ecore:PrimitiveType" href="http://www.eclipse.org/ocl/1.1.0/oclstdlib.ecore#/0/String"/> | ||
</ocl.ecore:Variable> | ||
<ocl.ecore:Variable name="self"> | ||
<eType xsi:type="ecore:EClass" href="http://www.eclipse.org/emf/2002/Ecore#//EPackage"/> | ||
</ocl.ecore:Variable> | ||
<ocl.ecore:Variable name="self"> | ||
<eType xsi:type="ecore:EClass" href="http://www.eclipse.org/emf/2002/Ecore#//EPackage"/> | ||
</ocl.ecore:Variable> | ||
<ocl.ecore:Variable name="self"> | ||
<eType xsi:type="ecore:EClass" href="http://www.eclipse.org/emf/2002/Ecore#//EPackage"/> | ||
</ocl.ecore:Variable> | ||
<ocl.ecore:Variable name="self"> | ||
<eType xsi:type="ecore:EClass" href="http://www.eclipse.org/emf/2002/Ecore#//EObject"/> | ||
</ocl.ecore:Variable> | ||
<ocl.ecore:Variable name="self"> | ||
<eType xsi:type="ecore:EClass" href="http://www.eclipse.org/emf/2002/Ecore#//EPackage"/> | ||
</ocl.ecore:Variable> | ||
<ocl.ecore:Variable name="self"> | ||
<eType xsi:type="ecore:EClass" href="http://www.eclipse.org/emf/2002/Ecore#//EPackage"/> | ||
</ocl.ecore:Variable> | ||
<ocl.ecore:Variable name="self"> | ||
<eType xsi:type="ecore:EClass" href="http://www.eclipse.org/emf/2002/Ecore#//EObject"/> | ||
</ocl.ecore:Variable> | ||
<ecore:EAnnotation source="positions"> | ||
<eAnnotations source="positions.0" references="/0/myTemplate"> | ||
<details key="start" value="66"/> | ||
<details key="end" value="226"/> | ||
<details key="line" value="3"/> | ||
</eAnnotations> | ||
<eAnnotations source="positions.1" references="/0/myTemplate/%"> | ||
<details key="start" value="124"/> | ||
<details key="end" value="214"/> | ||
<details key="line" value="4"/> | ||
</eAnnotations> | ||
<eAnnotations source="positions.2" references="/0/myTemplate/%/%"> | ||
<details key="start" value="162"/> | ||
<details key="end" value="166"/> | ||
<details key="line" value="5"/> | ||
</eAnnotations> | ||
<eAnnotations source="positions.3" references="/0/myTemplate/%/%.1"> | ||
<details key="start" value="167"/> | ||
<details key="end" value="202"/> | ||
<details key="line" value="0"/> | ||
</eAnnotations> | ||
<eAnnotations source="positions.4" references="/0/myTemplate/%/%.1/%"> | ||
<details key="start" value="167"/> | ||
<details key="end" value="182"/> | ||
<details key="line" value="0"/> | ||
</eAnnotations> | ||
<eAnnotations source="positions.5" references="/0/myTemplate/%/%.1/%.1"> | ||
<details key="start" value="185"/> | ||
<details key="end" value="202"/> | ||
<details key="line" value="0"/> | ||
</eAnnotations> | ||
<eAnnotations source="positions.6" references="/0/myTemplate/%/%.1/%.1/myParam"> | ||
<details key="start" value="185"/> | ||
<details key="end" value="192"/> | ||
<details key="line" value="0"/> | ||
</eAnnotations> | ||
<eAnnotations source="positions.7" references="/0/myTemplate/%/%.2"> | ||
<details key="start" value="204"/> | ||
<details key="end" value="205"/> | ||
<details key="line" value="6"/> | ||
</eAnnotations> | ||
<eAnnotations source="positions.8" references="/0/myTemplate/%/%.3"> | ||
<details key="start" value="131"/> | ||
<details key="end" value="152"/> | ||
<details key="line" value="0"/> | ||
</eAnnotations> | ||
<eAnnotations source="positions.9" references="/0/myTemplate/%/%.3/%"> | ||
<details key="start" value="131"/> | ||
<details key="end" value="143"/> | ||
<details key="line" value="0"/> | ||
</eAnnotations> | ||
<eAnnotations source="positions.10" references="/0/myTemplate/%/%.3/%/myParam"> | ||
<details key="start" value="131"/> | ||
<details key="end" value="138"/> | ||
<details key="line" value="0"/> | ||
</eAnnotations> | ||
<eAnnotations source="positions.11" references="/0/myTemplate/%/%.3/%.1"> | ||
<details key="start" value="146"/> | ||
<details key="end" value="152"/> | ||
<details key="line" value="0"/> | ||
</eAnnotations> | ||
<eAnnotations source="positions.12" references="/0/myTemplate/myParam"> | ||
<details key="start" value="94"/> | ||
<details key="end" value="119"/> | ||
<details key="line" value="3"/> | ||
</eAnnotations> | ||
<eAnnotations source="positions.13" references="/0/myQuery"> | ||
<details key="start" value="228"/> | ||
<details key="end" value="335"/> | ||
<details key="line" value="9"/> | ||
</eAnnotations> | ||
<eAnnotations source="positions.14" references="/0/myQuery/myParam"> | ||
<details key="start" value="250"/> | ||
<details key="end" value="275"/> | ||
<details key="line" value="9"/> | ||
</eAnnotations> | ||
<eAnnotations source="positions.15" references="/0/myQuery/%"> | ||
<details key="start" value="290"/> | ||
<details key="end" value="333"/> | ||
<details key="line" value="0"/> | ||
</eAnnotations> | ||
<eAnnotations source="positions.16" references="/0/myQuery/%/%"> | ||
<details key="start" value="327"/> | ||
<details key="end" value="333"/> | ||
<details key="line" value="0"/> | ||
</eAnnotations> | ||
<eAnnotations source="positions.17" references="/0/myQuery/%/%/s"> | ||
<details key="start" value="327"/> | ||
<details key="end" value="328"/> | ||
<details key="line" value="0"/> | ||
</eAnnotations> | ||
<eAnnotations source="positions.18" references="/0/myQuery/%/s"> | ||
<details key="start" value="294"/> | ||
<details key="end" value="323"/> | ||
<details key="line" value="0"/> | ||
</eAnnotations> | ||
<eAnnotations source="positions.19" references="/0/myQuery/%/s/myParam"> | ||
<details key="start" value="316"/> | ||
<details key="end" value="323"/> | ||
<details key="line" value="0"/> | ||
</eAnnotations> | ||
</ecore:EAnnotation> | ||
</xmi:XMI> |
9 changes: 9 additions & 0 deletions
9
.../resources/acceleoAqlTests/evaluation/expressionStatement/letExpression/letExpression.mtl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[module letExpression('http://www.eclipse.org/emf/2002/Ecore')/] | ||
|
||
[template public myTemplate(myParam : ecore::EPackage)] | ||
[file (myParam.name + '.txt', overwrite)] | ||
['The name is: ' + myParam.myQuery()/] | ||
[/file] | ||
[/template] | ||
|
||
[query public myQuery(myParam : ecore::EPackage) : String = let s : ecore::EPackage = myParam in s.name/] |