Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoraradermache2013-04-04 22:03:13 +0000
committeraradermache2013-04-04 22:03:13 +0000
commit168bcb97ea99372e921c00bd859b0bab61076cf8 (patch)
tree1b182af08dd573928591906d9adf4b2d13373524 /extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/acceleo/util/CppTemplates.mtl
parent51518784b0995b2f15bff5982cd1421be3fe6910 (diff)
downloadorg.eclipse.papyrus-168bcb97ea99372e921c00bd859b0bab61076cf8.tar.gz
org.eclipse.papyrus-168bcb97ea99372e921c00bd859b0bab61076cf8.tar.xz
org.eclipse.papyrus-168bcb97ea99372e921c00bd859b0bab61076cf8.zip
Transition to Acceleo based generator
Diffstat (limited to 'extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/acceleo/util/CppTemplates.mtl')
-rw-r--r--extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/acceleo/util/CppTemplates.mtl26
1 files changed, 26 insertions, 0 deletions
diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/acceleo/util/CppTemplates.mtl b/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/acceleo/util/CppTemplates.mtl
new file mode 100644
index 00000000000..0cb88942a45
--- /dev/null
+++ b/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/acceleo/util/CppTemplates.mtl
@@ -0,0 +1,26 @@
+[module CppTemplates('http://www.eclipse.org/uml2/4.0.0/UML')/]
+[import org::eclipse::papyrus::cpp::codegen::utils::GenUtils/]
+
+
+[query public CppTemplateBindingParameter(tps : TemplateParameterSubstitution) : String =
+if (tps.actual.oclIsKindOf(LiteralInteger)) then
+ tps.actual.oclAsType(LiteralInteger).value
+else
+ tps.actual.oclAsType(NamedElement).name
+endif
+/]
+
+[query public isTemplate(class : Classifier) : Boolean =
+ getTemplateParameters()->size() > 0
+/]
+
+
+[template public templateSignature(class : Classifier)]
+[if isTemplate()]
+template<[for (getTemplateParameters()) separator(', ')][getType()/][/for]> [/if]
+[/template]
+
+
+[template public templateSignature(operation : Operation)]
+[owner.oclAsType(Classifier).templateSignature()/]
+[/template] \ No newline at end of file

Back to the top