summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpfriese2009-02-11 14:20:59 (EST)
committer pfriese2009-02-11 14:20:59 (EST)
commitcf965be575a36333f6213b906716f0c85a66f4df (patch)
tree9ce97ed2217799e036d565b0f5bd8c11365aa107
parenteef5b428421faae7faf13b9b7da5045a736d4fc7 (diff)
downloadorg.eclipse.xpand-cf965be575a36333f6213b906716f0c85a66f4df.zip
org.eclipse.xpand-cf965be575a36333f6213b906716f0c85a66f4df.tar.gz
org.eclipse.xpand-cf965be575a36333f6213b906716f0c85a66f4df.tar.bz2
FIXED - bug 264544: Generate Eclipse help
https://bugs.eclipse.org/bugs/show_bug.cgi?id=264544
-rw-r--r--doc/org.eclipse.xpand.doc/book.css228
-rw-r--r--doc/org.eclipse.xpand.doc/build-docbook.properties92
-rw-r--r--doc/org.eclipse.xpand.doc/build-docbook.xml154
-rw-r--r--doc/org.eclipse.xpand.doc/build.xml320
-rw-r--r--doc/org.eclipse.xpand.doc/contents/Check_language.html105
-rw-r--r--doc/org.eclipse.xpand.doc/contents/Xtend_language.html809
-rw-r--r--doc/org.eclipse.xpand.doc/contents/index.html38
-rw-r--r--doc/org.eclipse.xpand.doc/contents/r10_expressions_language.html589
-rw-r--r--doc/org.eclipse.xpand.doc/contents/r10_typesystem.html441
-rw-r--r--doc/org.eclipse.xpand.doc/contents/xpand_reference_introduction.html1279
-rw-r--r--doc/org.eclipse.xpand.doc/plugin.xml8
-rw-r--r--doc/org.eclipse.xpand.doc/src/5.0/content/xpand_reference.xml3
-rw-r--r--doc/org.eclipse.xpand.doc/src/styles/css/book.css227
-rw-r--r--doc/org.eclipse.xpand.doc/src/styles/xslt/custom_eclipse.xsl77
-rw-r--r--doc/org.eclipse.xpand.doc/src/styles/xslt/fopdf.xsl523
-rw-r--r--doc/org.eclipse.xpand.doc/src/styles/xslt/html.xsl44
-rw-r--r--doc/org.eclipse.xpand.doc/toc.xml141
-rw-r--r--doc/org.eclipse.xpand.doc/topics_Reference.xml6
-rw-r--r--doc/org.eclipse.xpand.doc/xpand_reference.html1
19 files changed, 4664 insertions, 421 deletions
diff --git a/doc/org.eclipse.xpand.doc/book.css b/doc/org.eclipse.xpand.doc/book.css
index 84d8880..a8a6b28 100644
--- a/doc/org.eclipse.xpand.doc/book.css
+++ b/doc/org.eclipse.xpand.doc/book.css
@@ -1 +1,227 @@
-@import "../PRODUCT_PLUGIN/book.css";
+pre.programlisting {
+ display: block;
+ text-align: left;
+ text-indent: 0.00pt;
+ margin-top: 0.000000pt;
+ margin-bottom: 0.000000pt;
+ margin-right: 0.000000pt;
+ margin-left: 15pt;
+ font-size: 10.000000pt;
+ font-weight: medium;
+ font-style: Regular;
+ color: #4444CC;
+ text-decoration: none;
+ vertical-align: baseline;
+ text-transform: none;
+ font-family: "Courier New";
+}
+
+P.Code {
+ display: block;
+ text-align: left;
+ text-indent: 0.00pt;
+ margin-top: 0.000000pt;
+ margin-bottom: 0.000000pt;
+ margin-right: 0.000000pt;
+ margin-left: 15pt;
+ font-size: 10.000000pt;
+ font-weight: medium;
+ font-style: Regular;
+ color: #4444CC;
+ text-decoration: none;
+ vertical-align: baseline;
+ text-transform: none;
+ font-family: "Courier New";
+}
+
+H6.CaptionFigColumn {
+ display: block;
+ text-align: left;
+ text-indent: 0.000000pt;
+ margin-top: 3.000000pt;
+ margin-bottom: 11.000000pt;
+ margin-right: 0.000000pt;
+ margin-left: 0.000000pt;
+ font-size: 9.000000pt;
+ font-weight: medium;
+ font-style: Italic;
+ color: #000000;
+ text-decoration: none;
+ vertical-align: baseline;
+ text-transform: none;
+ font-family: "Arial";
+}
+
+P.Note {
+ display: block;
+ text-align: left;
+ text-indent: 0pt;
+ margin-top: 19.500000pt;
+ margin-bottom: 19.500000pt;
+ margin-right: 0.000000pt;
+ margin-left: 30pt;
+ font-size: 11.000000pt;
+ font-weight: medium;
+ font-style: Italic;
+ color: #000000;
+ text-decoration: none;
+ vertical-align: baseline;
+ text-transform: none;
+ font-family: "Arial";
+}
+
+EM.UILabel {
+ font-weight: Bold;
+ font-style: Regular;
+ text-decoration: none;
+ vertical-align: baseline;
+ text-transform: none;
+}
+
+EM.CodeName {
+ font-weight: Bold;
+ font-style: Regular;
+ text-decoration: none;
+ vertical-align: baseline;
+ text-transform: none;
+ font-family: "Courier New";
+}
+
+SPAN.NoWrap {
+ white-space: nowrap;
+}
+
+/* following font face declarations need to be removed for DBCS */
+body,h1,h2,h3,h4,h5,h6,p,table,td,caption,th,ul,ol,dl,li,dd,dt {
+ font-family: Arial, Helvetica, sans-serif;
+ color: #000000
+}
+
+pre {
+ font-family: Courier, monospace
+}
+
+/* end font face declarations */
+ /* following font size declarations should be OK for DBCS */
+body,h1,h2,h3,h4,h5,h6,p,table,td,caption,th,ul,ol,dl,li,dd,dt {
+ font-size: 10pt;
+}
+
+pre {
+ font-size: 10pt
+}
+
+/* end font size declarations */
+body {
+ background: #FFFFFF
+}
+
+h1 {
+ font-size: 18pt;
+ margin-top: 5;
+ margin-bottom: 1
+}
+
+h2 {
+ font-size: 14pt;
+ margin-top: 25;
+ margin-bottom: 3
+}
+
+h3 {
+ font-size: 11pt;
+ margin-top: 20;
+ margin-bottom: 3
+}
+
+h4 {
+ font-size: 10pt;
+ margin-top: 20;
+ margin-bottom: 3;
+ font-style: italic
+}
+
+p {
+ margin-top: 10px;
+ margin-bottom: 10px
+}
+
+pre {
+ margin-left: 6;
+ font-size: 9pt
+}
+
+a:link {
+ color: #0000FF
+}
+
+a:hover {
+ color: #000080
+}
+
+a:visited {
+ text-decoration: underline
+}
+
+ul {
+ margin-top: 0;
+ margin-bottom: 10
+}
+
+li {
+ margin-top: 0;
+ margin-bottom: 0
+}
+
+li p {
+ margin-top: 0;
+ margin-bottom: 0
+}
+
+ol {
+ margin-top: 0;
+ margin-bottom: 10
+}
+
+dl {
+ margin-top: 0;
+ margin-bottom: 10
+}
+
+dt {
+ margin-top: 0;
+ margin-bottom: 0;
+ font-weight: bold
+}
+
+dd {
+ margin-top: 0;
+ margin-bottom: 0
+}
+
+strong {
+ font-weight: bold
+}
+
+em {
+ font-style: italic
+}
+
+var {
+ font-style: italic
+}
+
+div.revision {
+ border-left-style: solid;
+ border-left-width: thin;
+ border-left-color: #7B68EE;
+ padding-left: 5
+}
+
+th {
+ font-weight: bold
+}
+
+xxtd{
+ border-top:2px solid black;
+} \ No newline at end of file
diff --git a/doc/org.eclipse.xpand.doc/build-docbook.properties b/doc/org.eclipse.xpand.doc/build-docbook.properties
deleted file mode 100644
index 00d8496..0000000
--- a/doc/org.eclipse.xpand.doc/build-docbook.properties
+++ /dev/null
@@ -1,92 +0,0 @@
-############### Adaptable properties ###############
-
-# Product information
-product.name=Xpand
-product.name.files=${product_name}
-product.provider=openarchitectureware.org
-product.version=5.0
-
-# Directories
-tools.basedir=${basedir}/../org.eclipse.xpand.doc
-
-# Style files
-custom-css.file=book.css
-custom.pdf-xsl.file=fopdf.xsl
-custom.html-xsl.file=html.xsl
-custom.eclipse-xsl.file=eclipse.xsl
-
-# Flags
-custom = true
-
-# Document type
-document.type=individual
-
-# DocBook version
-docbook.version = 4.5
-
-
-############### Do not change below ###############
-
-# Directories
-tools.basedir.build = ${tools.basedir}
-tools.dir=${tools.basedir}/lib/tools
-tools.dir.build = ${tools.basedir.build}/lib/tools
-version.dir=${product.version}
-docbook.dir=${tools.dir.build}/docbook
-docbook-src.dir=${basedir}/src
-docbook-lib.dir=${docbook.dir}
-src.dir=${docbook-src.dir}/${version.dir}
-content.dir=${src.dir}/content
-images.dir=${content.dir}/images
-build.dir=${basedir}/build-docbook
-output.dir=${basedir}/output
-html.dir=${output.dir}/html
-pdf.dir=${output.dir}/pdf
-release.dir=${output.dir}//release
-release.build.dir=${build.dir}/release
-style.dir=${tools.basedir}/styles
-css.style.dir=${style.dir}/css
-xsl.style.dir=${style.dir}/xslt
-shared.dir=${tools.basedir.build}/shared
-shared.src.dir=${tools.basedir.build}/src/${version.dir}
-shared.content.dir=${shared.src.dir}/content
-shared.images.dir=${shared.content.dir}/images
-
-# Title of documentation
-doc.title=${product.name} User Guide
-
-# Files
-css.file.path=${css.style.dir}/${custom-css.file}
-css.file=${custom-css.file}
-
-# PDF
-pdf.output.dir=${pdf.dir}/${version.dir}
-pdf.stylesheet.path=${xsl.style.dir}/${custom.pdf-xsl.file}
-pdf.stylesheet=${custom.pdf-xsl.file}
-
-# HTML
-html.output.dir=${html.dir}/${version.dir}
-html.stylesheet.path=${xsl.style.dir}/${custom.html-xsl.file}
-html.stylesheet=${custom.html-xsl.file}
-
-# Eclipse help
-eclipse.plugin.id=org.eclipse.xpand.doc.help.userguide
-eclipse.output.dir=../${eclipse.plugin.id}
-eclipse.plugin.name=$[product.name} User Guide
-eclipse.plugin.provider=$[product.provider}
-eclipse.stylesheet.path=${xsl.style.dir}/${custom.eclipse-xsl.file}
-eclipse.stylesheet=${custom.eclipse-xsl.file}
-
-# docbook
-docbook-xsl.dir=${docbook.dir}/xsl
-docbook-xsl.eclipse-xsl.file=${docbook-xsl.dir}/eclipse/eclipse.xsl
-docbook-xsl.html-xsl.file=${docbook-xsl.dir}/html/chunk.xsl
-docbook-xsl.pdf-xsl.file=${docbook-xsl.dir}/fo/fo.xsl
-
-# saxon
-saxon.dir = ${tools.dir}/saxon
-saxon.lib.path = ${saxon.dir}/saxon.jar
-
-# xerces
-xerces.dir = ${tools.dir}/fop
-xerces.lib.path = ${xerces.dir}/xercesImpl-2.7.1.jar \ No newline at end of file
diff --git a/doc/org.eclipse.xpand.doc/build-docbook.xml b/doc/org.eclipse.xpand.doc/build-docbook.xml
deleted file mode 100644
index 2b49cf6..0000000
--- a/doc/org.eclipse.xpand.doc/build-docbook.xml
+++ /dev/null
@@ -1,154 +0,0 @@
-<?xml version="1.0"?>
-<project name="Xpand documentation" default="build.all">
-
- <property file="build-docbook.properties" />
-
- <path id="fop">
- <pathelement location="${tools.dir}/fop/fop.jar" />
- <pathelement location="${tools.dir}/fop/avalon-framework-4.2.0.jar" />
- <pathelement location="${tools.dir}/fop/batik-all-1.6.jar" />
- </path>
-
- <path id="saxon">
- <pathelement location="${xerces.lib.path}" />
- <pathelement location="${saxon.lib.path}" />
- </path>
-
- <tstamp>
- <format property="date" pattern="yyyy-MM-dd" />
- <format property="year" pattern="yyyy" />
- </tstamp>
-
- <taskdef name="fop" classname="org.apache.fop.tools.anttasks.Fop" classpathref="fop" />
-
- <target name="build.all" depends="stage, build.doc.html, build.doc.eclipsehelp, build.doc.pdf, unstage" />
-
- <target name="build.doc.html" depends="stage.html">
- <delete dir="${html.output.dir}/contents" failonerror="false" />
- <copy todir="${html.output.dir}/contents/images">
- <fileset dir="${images.dir}">
- <include name="**/*" />
- </fileset>
- </copy>
- <copy file="${css.file.path}" todir="${html.output.dir}" />
- <java fork="true" dir="${html.output.dir}" failonerror="true" classname="com.icl.saxon.StyleSheet">
- <classpath refid="saxon" />
- <sysproperty key="javax.xml.parsers.DocumentBuilderFactory" value="org.apache.xerces.jaxp.DocumentBuilderFactoryImpl"/>
- <sysproperty key="javax.xml.parsers.SAXParserFactory" value="org.apache.xerces.jaxp.SAXParserFactoryImpl"/>
- <sysproperty key="org.apache.xerces.xni.parser.XMLParserConfiguration" value="org.apache.xerces.parsers.XIncludeParserConfiguration"/>
- <arg value="${build.dir}/index.xml" />
- <arg value="${build.dir}/${html.stylesheet}" />
- <arg value='profile.condition="${document.type}"'>
- </arg>
- </java>
- </target>
-
- <target name="build.doc.eclipsehelp" depends="stage.eclipse">
- <delete dir="${eclipse.output.dir}/contents" failonerror="false" />
- <copy todir="${eclipse.output.dir}/contents/images">
- <fileset dir="${images.dir}">
- <include name="**/*" />
- </fileset>
- </copy>
- <copy file="${css.file.path}" todir="${eclipse.output.dir}" />
- <java fork="true" dir="${eclipse.output.dir}" failonerror="true" classname="com.icl.saxon.StyleSheet">
- <classpath refid="saxon" />
- <sysproperty key="javax.xml.parsers.DocumentBuilderFactory" value="org.apache.xerces.jaxp.DocumentBuilderFactoryImpl"/>
- <sysproperty key="javax.xml.parsers.SAXParserFactory" value="org.apache.xerces.jaxp.SAXParserFactoryImpl"/>
- <sysproperty key="org.apache.xerces.xni.parser.XMLParserConfiguration" value="org.apache.xerces.parsers.XIncludeParserConfiguration"/>
- <arg value="${build.dir}/index.xml" />
- <arg value="${build.dir}/${eclipse.stylesheet}" />
- <arg value="eclipse.plugin.id=${eclipse.plugin.id}" />
- <arg value="eclipse.plugin.name=${eclipse.plugin.name}" />
- <arg value="eclipse.plugin.provider=${eclipse.plugin.provider}" />
- <arg value='profile.condition="${document.type}"'>
- </arg>
- </java>
- </target>
-
- <target name="build.doc.pdf" depends="stage.pdf">
- <java fork="true" dir="${build.dir}" failonerror="true" classname="com.icl.saxon.StyleSheet">
- <classpath refid="saxon" />
- <sysproperty key="javax.xml.parsers.DocumentBuilderFactory" value="org.apache.xerces.jaxp.DocumentBuilderFactoryImpl"/>
- <sysproperty key="javax.xml.parsers.SAXParserFactory" value="org.apache.xerces.jaxp.SAXParserFactoryImpl"/>
- <sysproperty key="org.apache.xerces.xni.parser.XMLParserConfiguration" value="org.apache.xerces.parsers.XIncludeParserConfiguration"/>
- <arg value="-o" />
- <arg value="${build.dir}/${product.name.files}_documentation.fo" />
- <arg value="${build.dir}/index.xml" />
- <arg value="${pdf.stylesheet}" />
- <arg value="draft.mode=no" />
- <arg value="paper.type=A4" />
- <arg value="l10n.gentext.language=en" />
- <arg value='profile.condition="${document.type}"'>
- </arg>
- </java>
-
- <mkdir dir="${pdf.output.dir}" />
-
- <fop format="application/pdf" outdir="${pdf.output.dir}" basedir="${build.dir}" messagelevel="debug">
- <fileset dir="${build.dir}">
- <include name="**/*.fo" />
- </fileset>
- </fop>
- </target>
-
- <target name="stage" depends="unstage">
- <copy todir="${build.dir}">
- <fileset dir="${src.dir}">
- <include name="**/*.xml" />
- </fileset>
- </copy>
- <copy todir="${build.dir}/content">
- <fileset dir="${content.dir}">
- <include name="**/*.xml" />
- </fileset>
- </copy>
- <copy todir="${build.dir}/content/images">
- <fileset dir="${images.dir}">
- <include name="**/*" />
- </fileset>
- </copy>
- <copy file="${tools.basedir}/shared/bookinfo.xml" todir="${build.dir}" />
- <replace file="${build.dir}/index.xml" token="@DOCBOOKVERSION@"
- value="${docbook.version}" casesensitive="true"/>
- <replace file="${build.dir}/index.xml" token="@TITLE@"
- value="${doc.title}" casesensitive="true"/>
- <replace file="${build.dir}/bookinfo.xml" token="@VERSION@"
- value="${product.version}" casesensitive="true"/>
- <replace file="${build.dir}/bookinfo.xml" token="@DATE@"
- value="${date}" casesensitive="true"/>
- </target>
-
- <target name="stage.pdf" depends="stage">
- <copy file="${pdf.stylesheet.path}" todir="${build.dir}" />
- <replace file="${build.dir}/${pdf.stylesheet}" token="@SHAREDIMAGESDIR@"
- value="${shared.images.dir}" casesensitive="true"/>
- <replace file="${build.dir}/${pdf.stylesheet}" token="@DOCBOOKDIR@"
- value="${docbook.dir}" casesensitive="true" />
- <replace file="${build.dir}/${pdf.stylesheet}" token="@TOOLSDIR@"
- value="${tools.dir}" casesensitive="true"/>
- <replace file="${build.dir}/${pdf.stylesheet}" token="@YEAR@"
- value="${year}" casesensitive="true"/>
- </target>
-
- <target name="stage.html" depends="stage">
- <copy file="${html.stylesheet.path}" todir="${build.dir}" />
- <replace file="${build.dir}/${html.stylesheet}" token="@DOCBOOKDIR@"
- value="${docbook.dir}" casesensitive="true" />
- </target>
-
- <target name="stage.eclipse" depends="stage">
- <copy file="${eclipse.stylesheet.path}" todir="${build.dir}" />
- <replace file="${build.dir}/${eclipse.stylesheet}" token="@DOCBOOKDIR@"
- value="${docbook.dir}" casesensitive="true" />
- </target>
-
- <target name="unstage">
- <delete dir="${build.dir}" />
- </target>
-
- <target name="clean" depends="unstage">
- <delete dir="${output.dir}" />
- </target>
-
-</project>
diff --git a/doc/org.eclipse.xpand.doc/build.xml b/doc/org.eclipse.xpand.doc/build.xml
index a4e19ef..9682970 100644
--- a/doc/org.eclipse.xpand.doc/build.xml
+++ b/doc/org.eclipse.xpand.doc/build.xml
@@ -1,158 +1,164 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project name="org.eclipse.xpand.doc" default="build.jars" basedir=".">
-
- <property file="${buildDirectory}/finalPluginsVersions.properties"/>
- <!-- Plug-in version. This is a HACK. Do not forget to update. -->
- <property name="pluginVersion" value="${org.eclipse.xpand.doc}"/>
-
- <property name="plugin" value="org.eclipse.xpand"/>
- <property name="docPlugin" value="org.eclipse.xpand.doc"/>
- <property name="filesToInclude"
- value="META-INF/**,images/**,tasks/**,gettingStarted/**,references/**,tutorials/**,notices.html,about.*,eclipse*.gif,ModelingFeature*.png,eclipse_lg.gif,plugin.*,book.css,toc*.xml,topics_*.xml,index/**"/>
-
- <!-- Compiler settings. -->
- <property name="javacFailOnError" value="false"/>
- <property name="javacDebugInfo" value="on"/>
- <property name="javacVerbose" value="true"/>
- <property name="javacSource" value="1.5"/>
- <property name="javacTarget" value="1.5"/>
- <property name="compilerArg" value=""/>
- <path id="path_bootclasspath">
- <fileset dir="${java.home}/lib">
- <include name="*.jar"/>
- </fileset>
- </path>
- <property name="bootclasspath" refid="path_bootclasspath"/>
-
- <property name="bundleJavacSource" value="${javacSource}"/>
- <property name="bundleJavacTarget" value="${javacTarget}"/>
- <property name="bundleBootClasspath" value="${bootclasspath}"/>
- <property name="basews" value="${ws}"/>
- <property name="baseos" value="${os}"/>
- <property name="basearch" value="${arch}"/>
- <property name="basenl" value="${nl}"/>
-
- <target name="init" depends="properties">
- <condition property="pluginTemp" value="${buildTempFolder}/plugins">
- <isset property="buildTempFolder"/>
- </condition>
- <property name="pluginTemp" value="${basedir}"/>
- <condition property="build.result.folder"
- value="${pluginTemp}/${docPlugin}">
- <isset property="buildTempFolder"/>
- </condition>
- <property name="build.result.folder" value="${basedir}"/>
- <property name="temp.folder" value="${basedir}/temp.folder"/>
- <property name="plugin.destination" value="${basedir}"/>
- </target>
-
- <target name="properties" if="eclipse.running">
- <property name="build.compiler"
- value="org.eclipse.jdt.core.JDTCompilerAdapter"/>
-
- </target>
-
- <target name="build.update.jar" depends="init"
- description="Build the plug-in: ${plugin} for an update site.">
- <delete dir="${temp.folder}"/>
- <mkdir dir="${temp.folder}"/>
- <antcall target="build.jars"/>
- <antcall target="gather.bin.parts">
- <param name="destination.temp.folder" value="${temp.folder}/"/>
- </antcall>
- <zip destfile="${plugin.destination}/${docPlugin}_${pluginVersion}.jar"
- basedir="${temp.folder}/${docPlugin}_${pluginVersion}" filesonly="false"
- whenempty="skip" update="false"/>
- <delete dir="${temp.folder}"/>
- </target>
-
- <target name="build.jars" depends="init"
- description="Build all the jars for the plug-in: ${docPlugin}.">
-
- <!-- Execute a shell script that will create an ant javadoc script and then run it for us -->
- <exec executable="sh">
- <arg value="build/antJavadoc.sh"/>
- <arg value="${eclipse.home}/../eclipse"/>
- </exec>
-
- <antcall target="build.index"/>
-
- </target>
-
- <target name="build.index" depends="init"
- description="Builds search index for the plug-in" if="eclipse.running">
- <help.buildHelpIndex manifest="plugin.xml" destination="."/>
- </target>
-
- <target name="build.sources" depends="init">
- </target>
-
- <target name="gather.bin.parts" depends="init" if="destination.temp.folder">
- <mkdir dir="${destination.temp.folder}/${docPlugin}_${pluginVersion}"/>
- <copy todir="${destination.temp.folder}/${docPlugin}_${pluginVersion}"
- failonerror="false" overwrite="false">
- <fileset dir="${basedir}" includes="${filesToInclude}"/>
- </copy>
- <eclipse.versionReplacer
- path="${destination.temp.folder}/${docPlugin}_${pluginVersion}"
- version="${pluginVersion}"/>
- </target>
-
- <target name="build.zips" depends="init">
- </target>
-
- <target name="gather.sources" depends="init" if="destination.temp.folder">
- </target>
-
- <target name="gather.logs" depends="init" if="destination.temp.folder">
- </target>
-
- <target name="clean" depends="init"
- description="Clean the plug-in: ${docPlugin} of all the zips, jars and logs created.">
- <delete file="${plugin.destination}/${docPlugin}_${pluginVersion}.jar"/>
- <delete file="${plugin.destination}/${docPlugin}_${pluginVersion}.zip"/>
- <delete dir="${temp.folder}"/>
- </target>
-
- <target name="zip.plugin" depends="init"
- description="Create a zip containing all the elements for the plug-in: ${docPlugin}.">
- <delete dir="${temp.folder}"/>
- <mkdir dir="${temp.folder}"/>
- <antcall target="build.jars"/>
- <antcall target="build.sources"/>
- <antcall target="gather.bin.parts">
- <param name="destination.temp.folder" value="${temp.folder}/"/>
- </antcall>
- <antcall target="gather.sources">
- <param name="destination.temp.folder" value="${temp.folder}/"/>
- </antcall>
- <delete>
- <fileset dir="${temp.folder}" includes="**/*.bin.log"/>
- </delete>
- <zip destfile="${plugin.destination}/${docPlugin}_${pluginVersion}.zip"
- basedir="${temp.folder}" filesonly="true" whenempty="skip" update="false"/>
- <delete dir="${temp.folder}"/>
- </target>
-
- <property file="build-docbook.properties"/>
-
- <target name="release">
- <mkdir dir="${release.build.dir}"/>
- <mkdir dir="${release.dir}"/>
-
- <copy todir="${release.build.dir}">
- <fileset dir="${pdf.output.dir}">
- <include name="*.pdf"/>
- </fileset>
- </copy>
-
- <zip
- zipfile="${release.dir}/${product.name}-documentation-${product.version}.zip">
- <fileset dir="${release.build.dir}">
- <include name="*.pdf"/>
- </fileset>
- </zip>
-
- <delete dir="${release.build.dir}"/>
- </target>
+<!--
+ This build script is an adoption of the build script being use for Eclipse.org Articles.
+ Original authors: Chris Aniszczyk <zx@eclipsesource.com>,
+ Lawrence Mandel <lmandel@ca.ibm.com>
+
+ Other authors: Peter Friese <peter.friese@itemis.com>
+-->
+
+<project name="eclipse.org article (docbook)" default="docbook2html" basedir=".">
+
+ <!-- ========== Properties: User Defined Options ========================= -->
+
+ <property name="eclipse.plugin.id" value="org.eclipse.xpand.doc" />
+ <property name="eclipse.plugin.name" value="Xpand core documentation (Incubation)" />
+ <property name="eclipse.plugin.provider" value="Eclipse.org" />
+
+ <property name="src.dir" value="src/5.0/content"/>
+ <property name="article.name" value="xpand_reference"/>
+ <property name="article.stylesheet" value="src/styles/xslt/custom_eclipse.xsl"/>
+
+ <property name="dest.dir" value="."/>
+ <property name="download.dir" value="${java.io.tmpdir}${file.separator}downloads"/>
+
+ <property name="docbook.version" value="1.73.2" />
+ <property name="docbook.dir" value="${download.dir}${file.separator}docbook-xsl-${docbook.version}"/>
+ <property name="docbookxsl.url" value="http://internap.dl.sourceforge.net/sourceforge/docbook/docbook-xsl-${docbook.version}.zip"/>
+ <property name="fop.dir" value="${download.dir}${file.separator}fop-0.20.5"/>
+ <property name="fop.url" value="http://archive.apache.org/dist/xmlgraphics/fop/binaries/fop-0.20.5-bin.zip"/>
+ <property name="jai.dir" value="ENTER_JAI_DIRECTORY"/>
+
+ <property name="build.home" value="build"/>
+
+ <!-- ========== Macro Definition =================================================== -->
+
+ <macrodef name="docbook2pdf">
+ <attribute name="source"/>
+ <attribute name="target"/>
+ <sequential>
+ <taskdef name="fop" classname="org.apache.fop.tools.anttasks.Fop">
+ <classpath>
+ <pathelement location="${fop.dir}${file.separator}build${file.separator}fop.jar" />
+ <pathelement location="${fop.dir}${file.separator}lib${file.separator}avalon-framework-cvs-20020806.jar" />
+ <pathelement location="${fop.dir}${file.separator}lib${file.separator}batik.jar" />
+ <pathelement location="${jai.dir}${file.separator}lib${file.separator}jai_core.jar" />
+ <pathelement location="${jai.dir}${file.separator}lib${file.separator}jai_codec.jar" />
+ </classpath>
+ </taskdef>
+ <fop
+ format="application/pdf"
+ fofile="@{source}"
+ outfile="@{target}"
+ messagelevel="info"/>
+ </sequential>
+ </macrodef>
+
+ <!-- ========== Targets =================================================== -->
+
+ <target name="init">
+ <mkdir dir="${download.dir}"/>
+
+ <available file="${jai.dir}" property="jai.exists"/>
+ <antcall target="notifyJAI"/>
+ </target>
+
+ <target name="notifyJAI" unless="jai.exists">
+ <echo message="The Java Advanced Imaging (JAI) library is not available."/>
+ <echo message="JAI is required if you want to use PNG images in your article."/>
+ <echo message="You can download JAI from http://java.sun.com/products/java-media/jai/downloads/download-1_1_2_01.html."/>
+ <echo message="Specify the JAI installation directory to the article build by providing the parameter jai.dir to this build script."/>
+ </target>
+
+ <target name="build-doc" depends="init, get-docbook-xsl, get-fop">
+ <echo>Building Help...</echo>
+ <antcall target="docbook2html"/>
+ <antcall target="docbook2pdf"/>
+ <antcall target="dist"/>
+ </target>
+
+ <target name="check-docbook">
+ <available file="${download.dir}${file.separator}docbook.zip" property="hasDocbook"/>
+ </target>
+
+ <target name="check-fop">
+ <available file="${download.dir}${file.separator}fop.zip" property="hasFOP"/>
+ </target>
+
+ <target name="get-docbook-xsl" description="Downloads docbook xsl" depends="check-docbook" unless="hasDocbook">
+ <echo>Downloading DocBook XSL...</echo>
+ <get dest="${download.dir}${file.separator}docbook.zip" src="${docbookxsl.url}"/>
+ <unzip src="${download.dir}${file.separator}docbook.zip" dest="${download.dir}"/>
+ </target>
+
+ <target name="get-fop" description="Downloads FOP" depends="check-fop" unless="hasFOP">
+ <echo>Downloading FOP...</echo>
+ <get dest="${download.dir}${file.separator}fop.zip" src="${fop.url}"/>
+ <unzip src="${download.dir}${file.separator}fop.zip" dest="${download.dir}"/>
+ </target>
+
+ <target name="docbook2html">
+ <echo>Converting article to HTML...</echo>
+ <delete file="${dest.dir}${file.separator}${article.name}.html"/>
+ <xslt in="${src.dir}${file.separator}${article.name}.xml" extension="xml" out="${dest.dir}${file.separator}${article.name}.html" style="${article.stylesheet}">
+ <factory name="org.apache.xalan.processor.TransformerFactoryImpl">
+ <attribute name="http://xml.apache.org/xalan/features/optimize" value="true"/>
+ </factory>
+ <xmlcatalog>
+ <entity
+ publicId="docbook.xsl"
+ location="${docbook.dir}${file.separator}html${file.separator}docbook.xsl"/>
+ <entity
+ publicId="eclipse.xsl"
+ location="${docbook.dir}${file.separator}eclipse${file.separator}eclipse.xsl"/>
+ </xmlcatalog>
+ <param name="header.rule" expression="1" />
+ <param name="admon.graphics.extension" expression=".gif"/>
+ <param name="admon.textlabel" expression="0"/>
+ <param name="ulink.target" expression="_new"/>
+ <param name="eclipse.plugin.id" expression="${eclipse.plugin.id}" />
+ <param name="eclipse.plugin.name" expression="${eclipse.plugin.name}" />
+ <param name="eclipse.plugin.provider" expression="${eclipse.plugin.provider}" />
+ </xslt>
+ </target>
+
+ <target name="docbook2pdf">
+ <echo>Converting article to PDF...</echo>
+
+ <delete file="${dest.dir}${file.separator}${article.name}.pdf"/>
+ <delete file="${dest.dir}${file.separator}${article.name}.fo"/>
+ <xslt in="${src.dir}${file.separator}${article.name}.xml" extension="xml" out="${dest.dir}${file.separator}${article.name}.fo" style="${docbook.dir}${file.separator}fo${file.separator}docbook.xsl">
+ <factory name="org.apache.xalan.processor.TransformerFactoryImpl">
+ <attribute name="http://xml.apache.org/xalan/features/optimize" value="true"/>
+ </factory>
+ <xmlcatalog>
+ <entity
+ publicId="docbook.xsl"
+ location="${docbook.dir}${file.separator}fo${file.separator}docbook.xsl"/>
+ </xmlcatalog>
+ <param name="generate.toc" expression="book toc" />
+ <param name="show.comments" expression="0" />
+ <param name="header.rule" expression="1" />
+ <param name="admon.graphics.extension" expression=".gif"/>
+ <param name="admon.textlabel" expression="0"/>
+ <param name="admon.graphics" expression="1"/>
+ </xslt>
+
+ <docbook2pdf
+ source="${dest.dir}${file.separator}${article.name}.fo"
+ target="${dest.dir}${file.separator}${article.name}.pdf"/>
+
+ <!-- Remove the resulting formatting object. This object isn't necessary in the
+ result of this build. -->
+ <delete file="${dest.dir}${file.separator}${article.name}.fo"/>
+ </target>
+
+ <target name="dist">
+ <echo>Building article zip file...</echo>
+ <delete file="${dest.dir}${file.separator}${article.name}.zip"/>
+ <zip basedir="${dest.dir}" destfile="${dest.dir}${file.separator}${article.name}.zip"
+ excludes="${article.name}.fo, ${article.name}.zip, .project">
+ </zip>
+ <echo>If you're done with your article, please post the zip file on the related bugzilla entry.</echo>
+ </target>
+
</project> \ No newline at end of file
diff --git a/doc/org.eclipse.xpand.doc/contents/Check_language.html b/doc/org.eclipse.xpand.doc/contents/Check_language.html
new file mode 100644
index 0000000..3c7457a
--- /dev/null
+++ b/doc/org.eclipse.xpand.doc/contents/Check_language.html
@@ -0,0 +1,105 @@
+<html>
+<head>
+<title>Check</title>
+<link href="../book.css" rel="stylesheet" type="text/css"/>
+<meta content="DocBook XSL Stylesheets V1.73.2" name="generator"/>
+<link rel="start" href="index.html" title="Check / Xtend / Xpand Reference"/>
+<link rel="up" href="index.html" title="Check / Xtend / Xpand Reference"/>
+<link rel="prev" href="r10_expressions_language.html" title="Expressions"/>
+<link rel="next" href="Xtend_language.html" title="Xtend"/>
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<p>openArchitectureWare also provides a language to specify constraints that the
+ model has to fulfill in order to be correct. This language is very easy to understand
+ and use. Basically, it is built around the expression syntax that has been discussed
+ in detail in the previous section. Constraints specified in the
+ <span class="emphasis">
+<em>Check</em>
+</span> language have to be stored in files with the file
+ extension <code class="filename">.chk</code>. Furthermore, these files have to be on the
+ Java classpath, of course, in order to be found. Let us look at an example, in order to
+ understand, what these constraints look like and what they do:
+ <pre class="programlisting">
+
+ import data; context Attribute ERROR "Names have
+ to be more than one character long." : name.length &gt; 1;</pre>Now,
+ let us look at the example line by line:
+ <div class="orderedlist">
+<ol type="1">
+<li>
+<p>First, the metamodel has to be imported.</p>
+</li>
+<li>
+<p>Then, the context is specified for which the constraint applies. In other
+ words, after the
+ <code class="code">context</code> keyword, we put the name of the metaclass that is going
+ to be checked by the constraint. Then, there follows either
+ <code class="code">ERROR</code> or
+ <code class="code">WARNING</code>, These keywords specify what kind of action will be
+ taken in case the constraint fails:
+ <div class="table">
+<a name="N10474"/>
+<p class="title">
+<b>Table 1. Types of action for <span class="emphasis">
+<em>Check</em>
+</span>
+ constraints</b>
+</p>
+<div class="table-contents">
+<table summary="Types of action for Check&#10; constraints" cellspacing="0" cellpadding="10" style="border-collapse: collapse;border-top: 0.5pt solid ; border-bottom: 0.5pt solid ; border-left: 0.5pt solid ; border-right: 0.5pt solid ; ">
+<colgroup>
+<col/>
+<col/>
+</colgroup>
+<tbody>
+<tr>
+<td style="border-right: 2 solid #000000; border-bottom: 2 solid #000000; ">
+ <code class="code">WARNING</code>
+ </td>
+<td style="border-bottom: 2 solid #000000; ">If the constraint fails, the specified message is printed,
+ but the workflow execution is not stopped.</td>
+</tr>
+<tr>
+<td style="border-right: 2 solid #000000; ">
+ <code class="code">ERROR</code>
+ </td>
+<td style="">If the constraint fails, the specified message is printed
+ and all further processing is stopped.</td>
+</tr>
+</tbody>
+</table>
+</div>
+</div>
+<br class="table-break"/>
+</p>
+</li>
+<li>
+<p>Now, the message that is put in case that the constraint fails is specified
+ as a string. It is possible to include the value of attributes or the return
+ value of functions into the message in order to make the message more clear. For
+ example, it would be possible to improve the above example by rewriting it like
+ this:</p>
+<pre class="programlisting">
+
+ import data; context Attribute ERROR "Name
+ of '" + name + "too short. Names have to be more than one character long." :
+ name.length &gt; 1;</pre>
+</li>
+<li>
+<p>Finally, there is the condition itself, which is specified by an
+ expression, which has been discussed in detail in the previous section. If
+ this expression is <code class="varname">true</code>, the constraint is
+ fulfilled.</p>
+</li>
+</ol>
+</div>
+</p>
+<p> <div class="important" style="margin-left: 0.5in; margin-right: 0.5in;">
+<p>Please always keep in mind that the message that is associated with the
+ constraint is printed, if the condition of the constraint is
+ <code class="varname">false</code>! Thus, if the specified constraint condition is
+ <code class="varname">true</code>, nothing will be printed out and the constraint will be
+ fulfilled.</p>
+</div> </p>
+</body>
+</html>
diff --git a/doc/org.eclipse.xpand.doc/contents/Xtend_language.html b/doc/org.eclipse.xpand.doc/contents/Xtend_language.html
new file mode 100644
index 0000000..94c646c
--- /dev/null
+++ b/doc/org.eclipse.xpand.doc/contents/Xtend_language.html
@@ -0,0 +1,809 @@
+<html>
+<head>
+<title>Xtend</title>
+<link href="../book.css" rel="stylesheet" type="text/css"/>
+<meta content="DocBook XSL Stylesheets V1.73.2" name="generator"/>
+<link rel="start" href="index.html" title="Check / Xtend / Xpand Reference"/>
+<link rel="up" href="index.html" title="Check / Xtend / Xpand Reference"/>
+<link rel="prev" href="Check_language.html" title="Check"/>
+<link rel="next" href="xpand_reference_introduction.html" title="Xpand2"/>
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<p>Like the expressions sublanguage that summarizes the syntax of expressions for
+ all the other textual languages delivered with the openArchitectureWare
+ framework, there is another commonly used language called
+ <span class="emphasis">
+<em>Xtend</em>
+</span>.</p>
+<p>This language provides the possibility to define rich libraries of independent
+ operations and no-invasive metamodel extensions based on either Java methods or oAW
+ expressions. Those libraries can be referenced from all other textual languages,
+ that are based on the expressions framework.</p>
+<div class="section" lang="en">
+<div class="titlepage">
+<div>
+<div>
+<h3 class="title">
+<a name="N104BA"/>Extend files</h3>
+</div>
+</div>
+</div>
+<p>An extend file must reside in the Java class path of the used execution context.
+ Additionally it is file extension must be <code class="filename">*.ext</code>. Let us
+ have a look at an extend file.</p>
+<pre class="programlisting">import my::metamodel;extension other::ExtensionFile;
+ /** * Documentation */ anExpressionExtension(String stringParam) :
+ doingStuff(with(stringParam)) ;
+ /** * java extensions are just mappings */ String aJavaExtension(String param) :
+ JAVA my.JavaClass.staticMethod(java.lang.String) ; </pre>
+<p>The example shows the following statements:</p>
+<div class="orderedlist">
+<ol type="1">
+<li>
+<p>import statements</p>
+</li>
+<li>
+<p>extension import statements</p>
+</li>
+<li>
+<p>expression or java extensions</p>
+</li>
+</ol>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage">
+<div>
+<div>
+<h3 class="title">
+<a name="N104D0"/>Comments</h3>
+</div>
+</div>
+</div>
+<p>We have single- and multi-line comments. The syntax for single line comments
+ is:</p>
+<pre class="programlisting">// my comment</pre>
+<p>Multi line comments are written like this:</p>
+<pre class="programlisting">/* My multi line comment */</pre>
+</div>
+<div class="section" lang="en">
+<div class="titlepage">
+<div>
+<div>
+<h3 class="title">
+<a name="N104DB"/>Import Statements</h3>
+</div>
+</div>
+</div>
+<p>Using the import statement one can import name spaces of different types.(see
+ expressions framework reference documentation).</p>
+<p>Syntax is:</p>
+<pre class="programlisting">import my::imported::namespace;</pre>
+<p>Extend does not support static imports or any similar concept. Therefore, the
+ following is incorrect syntax:</p>
+<pre class="programlisting">import my::imported::namespace::*; // WRONG! import my::Type; //
+ WRONG!</pre>
+</div>
+<div class="section" lang="en">
+<div class="titlepage">
+<div>
+<div>
+<h3 class="title">
+<a name="N104E8"/>Extension Import Statement</h3>
+</div>
+</div>
+</div>
+<p>You can import another extend file using the extension statement. The syntax
+ is:</p>
+<pre class="programlisting">extension
+ fully::qualified::ExtensionFileName;</pre>
+<p>Note, that no file extension ( <code class="filename">*.ext</code>) is
+ specified.</p>
+<div class="section" lang="en">
+<div class="titlepage">
+<div>
+<div>
+<h4 class="title">
+<a name="N104F4"/>Reexporting Extensions</h4>
+</div>
+</div>
+</div>
+<p>If you want to export extensions from another extension file together with
+ your local extensions, you can add the keyword 'reexport' to the end of the
+ respective extension import statement.</p>
+<pre class="programlisting">extension fully::qualified::ExtensionFileName
+ reexport;</pre>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage">
+<div>
+<div>
+<h3 class="title">
+<a name="N104FB"/>Extensions</h3>
+</div>
+</div>
+</div>
+<p>The syntax of a simple expression extension is as follows:</p>
+<pre class="programlisting">ReturnType extensionName(ParamType1 paramName1,
+ ParamType2...): expression-using-params;</pre>
+<p>Example:</p>
+<pre class="programlisting">String getterName(NamedElement ele) :
+ 'get'+ele.name.firstUpper();</pre>
+<div class="section" lang="en">
+<div class="titlepage">
+<div>
+<div>
+<h4 class="title">
+<a name="N10506"/>Extension Invocation</h4>
+</div>
+</div>
+</div>
+<p>There are two different ways of how to invoke an extension. It can be invoked
+ like a function:</p>
+<pre class="programlisting">getterName(myNamedElement)</pre>
+<p>The other way to invoke an extension is through the "member syntax":</p>
+<pre class="programlisting">myNamedElement.getterName()</pre>
+<p>For any invocation in member syntax, the target expression (the member) is
+ mapped to the first parameter. Therefore, both syntactical forms do the same
+ thing.</p>
+<p>It is important to understand that extensions are not members of the type
+ system, hence, they are not accessible through reflection and you cannot
+ specialize or overwrite operations using them.</p>
+<p>The expression evaluation engine first looks for an appropriate operation
+ before looking for an extension, in other words operations have higher
+ precedence.</p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage">
+<div>
+<div>
+<h4 class="title">
+<a name="N10517"/>Type Inference</h4>
+</div>
+</div>
+</div>
+<p>For most extensions, you do not need to specify the return type, because it
+ can be derived from the specified expression. The special thing is, that the
+ static return type of such an extension depends on the context of use.</p>
+<p>For instance, if you have the following extension</p>
+<pre class="programlisting">asList(Object o): {o};</pre>
+<p>the invocation of</p>
+<pre class="programlisting">asList('text')</pre>
+<p>has the static type List[String]. This means you can call</p>
+<pre class="programlisting">asList('text').get(0).toUpperCase()</pre>
+<p>The expression is statically type safe, because its return type is derived
+ automatically.</p>
+<p>There is always a return value, whether you specify it or not, even if you
+ specify explicitly ' <code class="classname">Void</code>'.</p>
+<p>See the following example.</p>
+<pre class="programlisting">
+ modelTarget.ownedElements.addAllNotNull(modelSource.contents.duplicate())</pre>
+<p>In this example duplicate() dispatches polymorphically. Two of the
+ extensions might look like:</p>
+<pre class="programlisting">Void duplicate(Realization realization):
+ realization.Specifier().duplicate()-&gt;
+ realization.Realizer().duplicate() ;
+ create target::Class duplicate(source::Class): ... ;</pre>
+<p>If a ' <code class="classname">Realization</code>' is contained in the '
+ <code class="methodname">contents</code>' list of '
+ <code class="varname">modelSource</code>', the '
+ <code class="methodname">Realizer</code>' of the '
+ <code class="classname">Realization</code>' will be added to the '
+ <code class="varname">ownedElements</code>' list of the '
+ <code class="varname">modelTarget</code>'. If you do not want to add in the case that the
+ contained element is a 'Realization' you might change the extension to:</p>
+<pre class="programlisting">Void duplicate(Realization realization):
+ realization.Specifier().duplicate()-&gt;
+ realization.Realizer().duplicate() -&gt; {} ;</pre>
+</div>
+<div class="section" lang="en">
+<div class="titlepage">
+<div>
+<div>
+<h4 class="title">
+<a name="N10550"/>Recursion</h4>
+</div>
+</div>
+</div>
+<p>There is only one exception: For recursive extensions the return type
+ cannot be inferred, therefore you need to specify it explicitly:</p>
+<pre class="programlisting">String fullyQualifiedName(NamedElement n) : n.parent == null ?
+ n.name : fullyQualifiedName(n.parent)+'::'+n.name ;</pre>
+<p>Recursive extensions are non-deterministic in a static context,
+ therefore, it is necessary to specify a return type.</p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage">
+<div>
+<div>
+<h4 class="title">
+<a name="N10559"/>Cached Extensions</h4>
+</div>
+</div>
+</div>
+<p>If you call an extension without side effects very often, you would like to
+ cache the result for each set of parameters, in order improve the performance.
+ You can just add the keyword '
+ <code class="code">cached</code>' to the extension in order to achieve this:</p>
+<pre class="programlisting">cached String getterName(NamedElement ele) :
+ 'get'+ele.name.firstUpper() ;</pre>
+<p>The <code class="methodname">getterName</code> will be computed only once for
+ each <code class="classname">NamedElement</code>.</p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage">
+<div>
+<div>
+<h4 class="title">
+<a name="N1056B"/>Private Extensions</h4>
+</div>
+</div>
+</div>
+<p>By default all extensions are public, i.e. they are visible from outside the
+ extension file. If you want to hide extensions you can add the keyword 'private'
+ in front of them:</p>
+<pre class="programlisting">private internalHelper(NamedElement ele) : //
+ implementation.... ;</pre>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage">
+<div>
+<div>
+<h3 class="title">
+<a name="N10572"/>Java Extensions</h3>
+</div>
+</div>
+</div>
+<p>In some rare cases one does want to call a Java method from inside an expression.
+ This can be done by providing a Java extension:</p>
+<pre class="programlisting">Void myJavaExtension(String param) : JAVA
+ my.Type.staticMethod(java.lang.String) ;</pre>
+<p>The signature is the same as for any other extension. The implementation is
+ redirected to a public static method in a Java class.</p>
+<p>Its syntax is:</p>
+<pre class="programlisting">JAVA fully.qualified.Type.staticMethod(my.ParamType1,
+ my.ParamType2, ...) ;</pre>
+<p>Note that you cannot use any imported namespaces. You have to specify the type,
+ its method and the parameter types in a fully qualified way.</p>
+<p>Example:</p>
+<p>If you have defined the following Java extension:</p>
+<pre class="programlisting">Void dump(String s) : JAVA my.Helper.dump(java.lang.String)
+ ;</pre>
+<p>and you have the following Java class:</p>
+<pre class="programlisting">package my;
+ public class Helper { public final static void dump(String aString) {
+ System.out.println(aString); } }</pre>
+<p>the expressions</p>
+<pre class="programlisting">dump('Hello world!') 'Hello World'.dump()</pre>
+<p>both result are invoking the Java method void dump(String aString)</p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage">
+<div>
+<div>
+<h3 class="title">
+<a name="N10591"/>Create Extensions (Model Transformation)</h3>
+</div>
+</div>
+</div>
+<p>Since Version 4.1 the <span class="emphasis">
+<em>Xtend</em>
+</span> language supports
+ additional support for model transformation. The new concept is called
+ <span class="emphasis">
+<em>create extension</em>
+</span> and it is explained a bit more
+ comprehensive as usual.</p>
+<p>Elements contained in a model are usually referenced multiple times.
+ Consider the following model structure:</p>
+<pre class="programlisting"> P / \ C1 C2 \ / R </pre>
+<p>A package P contains two classes C1 and C2. C1 contains a reference R of type C2 (P
+ also references C2).</p>
+<p>We could write the following extensions in order to transform an Ecore (EMF)
+ model to our metamodel (Package, Class, Reference).</p>
+<pre class="programlisting">toPackage(EPackage x) : let p = new Package :
+ p.ownedMember.addAll(x.eClassifiers.toClass()) -&gt; p;
+ toClass(EClass x) : let c = new Class :
+ c.attributes.addAll(x.eReferences.toReference()) -&gt; c;
+ toReference(EReference x) : let r = new Reference : r.setType(x.eType.toClass())
+ -&gt; r; </pre>
+<p>For an Ecore model with the above structure, the result would be:</p>
+<pre class="programlisting"> P / \ C1 C2 | R - C2 </pre>
+<p>What happened? The C2 class has been created 2 times (one time for the package
+ containment and another time for the reference R that also refers to C2). We can
+ solve the problem by adding the 'cached' keyword to the second extension:</p>
+<pre class="programlisting">cached toClass(EClass x) : let c = new Class :
+ c.attributes.addAll(c.eAttributes.toAttribute()) -&gt; c; </pre>
+<p>The process goes like this:</p>
+<div class="orderedlist">
+<ol type="1">
+<li>
+<p>start create P</p>
+<div class="orderedlist">
+<ol type="a">
+<li>
+<p>start create C1 (contained in P)</p>
+<div class="orderedlist">
+<ol type="i">
+<li>
+<p>start create R (contained in C1)</p>
+<div class="orderedlist">
+<ol type="A">
+<li>
+<p>start create C2 (referenced from R)</p>
+</li>
+<li>
+<p>end (result C2 is cached)</p>
+</li>
+</ol>
+</div>
+</li>
+<li>
+<p>end R</p>
+</li>
+</ol>
+</div>
+</li>
+<li>
+<p>end C1</p>
+</li>
+<li>
+<p>start get cached C2 (contained in P)</p>
+</li>
+</ol>
+</div>
+</li>
+<li>
+<p>end P</p>
+</li>
+</ol>
+</div>
+<p>So this works very well. We will get the intended structure. But what about
+ circular dependencies? For instance, C2 could contain a Reference R2 of type C1
+ (bidirectional references):</p>
+<p>The transformation would occur like this:</p>
+<div class="orderedlist">
+<ol type="1">
+<li>
+<p>start create P</p>
+<div class="orderedlist">
+<ol type="a">
+<li>
+<p>start create C1 (contained in P)</p>
+<div class="orderedlist">
+<ol type="i">
+<li>
+<p>start create R (contained in C1)</p>
+<div class="orderedlist">
+<ol type="A">
+<li>
+<p>start create C2 (referenced from R)</p>
+<div class="orderedlist">
+<ol type="I">
+<li>
+<p>start create R2 (contained in C2)</p>
+<div class="orderedlist">
+<ol type="1">
+<li>
+<p>start create C1 (referenced from R1)...
+ OOPS!</p>
+</li>
+</ol>
+</div>
+</li>
+</ol>
+</div>
+</li>
+</ol>
+</div>
+</li>
+</ol>
+</div>
+</li>
+</ol>
+</div>
+</li>
+</ol>
+</div>
+<p>C1 is already in creation and will not complete until the stack is reduced.
+ Deadlock! The problem is that the cache caches the return value, but C1 was not
+ returned so far, because it is still in construction. The solution: create
+ extensions</p>
+<p>The syntax is as follows:</p>
+<pre class="programlisting">create Package toPackage(EPackage x) :
+ this.classifiers.addAll(x.eClassifiers.toClass());
+ create Class toClass(EClass x) :
+ this.attributes.addAll(x.eReferences.toReference());
+ create Reference toReference(EReference x) : this.setType(x.eType.toClass());
+ </pre>
+<p>This is not only a shorter syntax, but it also has the needed semantics: The
+ created model element will be added to the cache before evaluating the body. The
+ return value is always the reference to the created and maybe not completely
+ initialized element.</p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage">
+<div>
+<div>
+<h3 class="title">
+<a name="N105F3"/>Calling Extensions From Java</h3>
+</div>
+</div>
+</div>
+<p>The previous section showed how to implement Extensions in Java. This section
+ shows how to call Extensions from Java.</p>
+<pre class="programlisting">// setup XtendFacade f =
+ XtendFacade.create("my::path::MyExtensionFile");
+ // use f.call("sayHello",new Object[]{"World"}); </pre>
+<p>The called extension file looks like this:</p>
+<pre class="programlisting">sayHello(String s) : "Hello " + s;</pre>
+<p>This example uses only features of the BuiltinMetaModel, in this case the "
+ <code class="methodname">+</code>" feature from the StringTypeImpl.</p>
+<p>Here is another example, that uses the JavaBeansMetaModel strategy. This
+ strategy provides as additional feature: the access to properties using the
+ getter and setter methods.</p>
+<p>For more information about type systems, see the <span class="emphasis">
+<em> <a class="xref" href="r10_expressions_language.html" title="Expressions">Expressions</a> </em>
+</span> reference
+ documentation.</p>
+<p>We have one JavaBean-like metamodel class:</p>
+<pre class="programlisting">package mypackage; public class MyBeanMetaClass { private String
+ myProp; public String getMyProp() { return myProp; } public void setMyProp(String
+ s) { myProp = s;} }</pre>
+<p>in addition to the built-in metamodel type system, we register the
+ JavaMetaModel with the JavaBeansStrategy for our facade. Now, we can use also this
+ strategy in our extension:</p>
+<pre class="programlisting">// setup facade
+ XtendFacade f = XtendFacade.create("myext::JavaBeanExtension");
+ // setup additional type system JavaMetaModel jmm = new JavaMetaModel("JavaMM",
+ new JavaBeansStrategy());
+ f.registerMetaModel(jmm);
+ // use the facade MyBeanMetaClass jb = MyBeanMetaClass(); jb.setMyProp("test");
+ f.call("readMyProp", new Object[]{jb}));</pre>
+<p>The called extension file looks like this:</p>
+<pre class="programlisting">import mypackage;
+ readMyProp(MyBeanMetaClass jb) : jb.myProp ; </pre>
+</div>
+<div class="section" lang="en">
+<div class="titlepage">
+<div>
+<div>
+<h3 class="title">
+<a name="N10619"/>WorkflowComponent</h3>
+</div>
+</div>
+</div>
+<p>With the additional support for model transformation, it makes sense to
+ invoke <span class="emphasis">
+<em>Xtend</em>
+</span> within a workflow. A typical workflow
+ configuration of the <span class="emphasis">
+<em>Xtend</em>
+</span> component looks like
+ this:</p>
+<pre class="programlisting">
+
+ &lt;component
+ class="oaw.xtend.XtendComponent"&gt;
+ &lt;metaModel class="oaw.type.emf.EmfMetaModel"&gt;
+ &lt;metaModelFile value="metamodel1.ecore"/&gt;
+ &lt;/metamodel&gt;
+ &lt;metaModel class="oaw.type.emf.EmfMetaModel"&gt;
+ &lt;metaModelFile value="metamodel2.ecore"/&gt;
+ &lt;/metaModel&gt;
+ &lt;invoke value="my::example::Trafo::transform(inputSlot)"/&gt;
+ &lt;outputSlot value="transformedModel"/&gt;
+ &lt;/component&gt; </pre>
+<p>Note that you can mix and use any kinds of metamodels (not only EMF
+ metamodels).</p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage">
+<div>
+<div>
+<h3 class="title">
+<a name="N10629"/>Aspect-Oriented Programming in <span class="emphasis">
+<em>Xtend</em>
+</span> (since
+ 4.2)</h3>
+</div>
+</div>
+</div>
+<p>Using the workflow engine, it is now possible to package (e.g. zip) a written
+ generator and deliver it as a kind of black box. If you want to use such a generator but
+ need to change some things without modifying any code, you can make use of around
+ advices that are supported by <span class="emphasis">
+<em>Xtend</em>
+</span>.</p>
+<p>The following advice is weaved around every invocation of an extension whose
+ name starts with 'my::generator::':</p>
+<pre class="programlisting">around my::generator::*(*) : log('Invoking ' + ctx.name) -&gt;
+ ctx.proceed() ; </pre>
+<p>Around advices let you change behaviour in an non-invasive way (you do not need
+ to touch the packaged extensions).</p>
+<div class="section" lang="en">
+<div class="titlepage">
+<div>
+<div>
+<h4 class="title">
+<a name="N1063A"/>Join Point and Point Cut Syntax</h4>
+</div>
+</div>
+</div>
+<p>Aspect orientaton is basically about weaving code into different points
+ inside the call graph of a software module. Such points are called
+ <span class="emphasis">
+<em>join points</em>
+</span>. In <span class="emphasis">
+<em>Xtend</em>
+</span> the join
+ points are the extension invocations (Note that <span class="emphasis">
+<em>Xpand</em>
+</span>
+ offers a similar feature, see the <span class="emphasis">
+<em>Xpand</em>
+</span>
+ documentation).</p>
+<p>One specifies on which join points the contributed code should be executed
+ by specifying something like a 'query' on all available join points. Such a query
+ is called a point cut.</p>
+<pre class="programlisting">around [pointcut] : expression;</pre>
+<p>A point cut consists of a fully qualified name and a list of parameter
+ declarations.</p>
+<div class="section" lang="en">
+<div class="titlepage">
+<div>
+<div>
+<h5 class="title">
+<a name="N10651"/>Extensions Name</h5>
+</div>
+</div>
+</div>
+<p>The extension name part of a point cut must match the fully qualified name
+ of the definition of the join point. Such expressions are case sensitive. The
+ asterisk character is used to specify wildcards. Some examples:</p>
+<pre class="programlisting">my::Extension::definition // extensions with the specified
+ name org::oaw::* //extensions prefixed with 'org::oaw::' *Operation* //
+ extensions containing the word 'Operation' in it. * // all
+ extensions</pre>
+<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
+<p>Be careful when using wildcards, because you will get an endless
+ recursion, in case you weave an extension, which is called inside the
+ advice.</p>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage">
+<div>
+<div>
+<h5 class="title">
+<a name="N1065B"/>Parameter Types</h5>
+</div>
+</div>
+</div>
+<p>The parameters of the extensions that we want to add our advice to, can also
+ be specified in the point cut. The rule is, that the type of the specified
+ parameter must be the same or a supertype of the corresponding parameter type
+ (the dynamic type at runtime) of the definition to be called.</p>
+<p>Additionally, one can set the wildcard at the end of the parameter list, to
+ specify that there might be none or more parameters of any kind.</p>
+<p>Some examples:</p>
+<pre class="programlisting">my::Templ::extension() // extension without parameters
+ my::Templ::extension(String s) // extension with exactly one parameter of
+ type String my::Templ::extension(String s,*) // templ def with one or more
+ parameters, // where the first parameter is of type String
+ my::Templ::extension(*) // templ def with any number of parameters
+ </pre>
+</div>
+<div class="section" lang="en">
+<div class="titlepage">
+<div>
+<div>
+<h5 class="title">
+<a name="N10666"/>Proceeding</h5>
+</div>
+</div>
+</div>
+<p>Inside an advice, you might want to call the underlying definition. This
+ can be done using the implicit variable <code class="varname">ctx</code>, which is of
+ the type <span class="type">xtend::AdviceContext</span> and provides an operation
+ <code class="methodname">proceed()</code> which invokes the underlying
+ definition with the original parameters (Note that you might have changed any
+ mutable object in the advice before).</p>
+<p>If you want to control what parameters are to be passed to the definition,
+ you can use the operation <code class="methodname">proceed(List[Object]
+ params)</code>. You should be aware, that in advices, no type checking
+ is done.</p>
+<p>Additionally, there are some inspection properties (like
+ <code class="varname">name</code>, <code class="varname">paramTypes</code>, etc.)
+ available.</p>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage">
+<div>
+<div>
+<h4 class="title">
+<a name="N10681"/>Workflow configuration</h4>
+</div>
+</div>
+</div>
+<p>To weave the defined advices into the different join points, you need to
+ configure the <code class="classname">XtendComponent</code> with the qualified
+ names of the Extension files containing the advices.</p>
+<p>Example:</p>
+<pre class="programlisting">
+
+ &lt;component
+ class="oaw.xtend.XtendComponent"&gt;
+ &lt;metaModel class="oaw.type.emf.EmfMetaModel"&gt;
+ &lt;metaModelFile value="metamodel1.ecore"/&gt;
+ &lt;/metamodel&gt;
+ &lt;metaModel class="oaw.type.emf.EmfMetaModel"&gt;
+ &lt;metaModelFile value="metamodel2.ecore"/&gt;
+ &lt;/metaModel&gt;
+
+ &lt;invoke value="my::example::Trafo::transform(inputSlot)"/&gt;
+ &lt;outputSlot value="transformedModel"/&gt;
+ &lt;advices value="my::Advices,my::Advices2"/&gt;
+ &lt;/component&gt; </pre>
+</div>
+<div class="section" lang="en">
+<div class="titlepage">
+<div>
+<div>
+<h4 class="title">
+<a name="xtend_example_introduction"/>Model-to-Model transformation with <span class="emphasis">
+<em>Xtend</em>
+</span>
+ </h4>
+</div>
+</div>
+</div>
+<p>This example uses Eclipse EMF as the basis for model-to-model
+ transformations. It builds on the <span class="emphasis">
+<em>emfExample</em>
+</span>
+ documented elsewhere. Please read and install the
+ <span class="emphasis">
+<em>emfExample</em>
+</span> first.</p>
+<p>The idea in this example is to transform the data model introduced in the EMF
+ example into itself. This might seem boring, but the example is in fact quite
+ illustrative.</p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage">
+<div>
+<div>
+<h4 class="title">
+<a name="xtend_example_workflow"/>Workflow</h4>
+</div>
+</div>
+</div>
+<p>By now, you should know the role and structure of workflow files. Therefore,
+ the interesting aspect of the workflow file below is the <span class="emphasis">
+<em>
+ <code class="classname">XtendComponent</code> </em>
+</span>.</p>
+<pre class="programlisting">
+
+ &lt;workflow&gt;
+ &lt;property file="workflow.properties"/&gt; ...
+ &lt;component class="oaw.xtend.XtendComponent"&gt;
+ &lt;metaModel class="oaw.type.emf.EmfMetaModel"&gt;
+ &lt;metaModelPackage value="data.DataPackage"/&gt;
+ &lt;/metaModel&gt;
+ &lt;invoke value="test::Trafo::duplicate(rootElement)"/&gt;
+ &lt;outputSlot value="newModel"/&gt;
+ &lt;/component&gt; ...
+ &lt;/workflow&gt;</pre>
+<p>As usual, we have to define the metamodel that should be used, and since we
+ want to transform a data model into a data model, we need to specify only the
+ <code class="classname">data.DataPackage</code> as the metamodel.</p>
+<p>We then specify which function to invoke for the transformation. The
+ statement <code class="classname">test::Trafo::duplicate(rootElement)</code>
+ means to invoke:
+ <div class="itemizedlist">
+<ul type="disc">
+<li> the <code class="classname">duplicate</code> function taking the
+ contents of the <code class="classname">rootElement</code> slot as a parameter
+ </li>
+<li> the function can be found in the <code class="filename">Trafo.ext</code>
+ file </li>
+<li> and that in turn is in the classpath, in the
+ <code class="classname">test</code> package </li>
+</ul>
+</div>
+</p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage">
+<div>
+<div>
+<h4 class="title">
+<a name="xtend_example_the_transformation"/>The Transformation</h4>
+</div>
+</div>
+</div>
+<p>The transformation, as mentioned above, can be found in the
+ <code class="filename">Trafo.ext</code> file in the <code class="classname">test</code>
+ package in the <code class="classname">src</code> folder. Let us walk through the
+ file.</p>
+<p>So, first we import the metamodel.</p>
+<pre class="programlisting">import data;</pre>
+<p>The next function is a so-called <code class="classname">create</code>
+ extension. Create extensions, as a side effect when called, create an instance
+ of the type given after the <code class="classname">create</code> keyword. In our
+ case, the <code class="classname">duplicate</code> function creates an instance of
+ <code class="classname">DataModel</code>. This newly created object can be referred
+ to in the transformation by <code class="classname">this</code> (which is why
+ <code class="classname">this</code> is specified behind the type). Since
+ <code class="classname">this</code> can be omitted, we do not have to mention it
+ explicitly in the transformation.</p>
+<p>The function also takes an instance of <code class="classname">DataModel</code>
+ as its only parameter. That object is referred to in the transformation as
+ <code class="varname">s</code>. So, this function sets the name of the newly created
+ <code class="classname">DataModel</code> to be the name of the original one, and then
+ adds duplicates of all entities of the original one to the new one. To create the
+ duplicates of the entities, the <code class="classname">duplicate()</code>
+ operation is called for each <code class="classname">Entity</code>. This is the next
+ function in the transformation.</p>
+<pre class="programlisting">
+
+ create DataModel this duplicate(DataModel
+ s): entity.addAll(s.entity.duplicate()) -&gt;
+ setName(s.name);</pre>
+<p>The duplication function for entities is also a create extension. This
+ time, it creates a new <code class="classname">Entity</code> for each old
+ <code class="classname">Entity</code> passed in. Again, it copies the name and adds
+ duplicates of the attributes and references to the new one.</p>
+<pre class="programlisting">
+
+ create Entity this duplicate(Entity old):
+ attribute.addAll(old.attribute.duplicate()) -&gt;
+ reference.addAll(old.reference.duplicate()) -&gt;
+ setName(old.name);</pre>
+<p>The function that copies the attribute is rather straight forward, but
+ ...</p>
+<pre class="programlisting">
+
+ create Attribute this duplicate(Attribute
+ old): setName(old.name) -&gt; setType(old.type);</pre>
+<p>... the one for the references is more interesting. Note that a reference,
+ while being owned by some <code class="classname">Entity</code>, also references
+ another Entity as its target. So, how do you make sure you do not duplicate the
+ target twice? <span class="emphasis">
+<em>Xtend</em>
+</span> provides explicit support for this
+ kind of situation. <span class="emphasis">
+<em>Create extensions are only executed once per
+ tuple of parameters!</em>
+</span> So if, for example, the
+ <span class="emphasis">
+<em>Entity</em>
+</span> behind the target reference had already been
+ duplicated by calling the <code class="methodname">duplicate</code> function with
+ the respective parameter, the next time it will be called <span class="emphasis">
+<em>the exact
+ same object will be returned</em>
+</span>. This is very useful for graph
+ transformations.</p>
+<pre class="programlisting">
+
+ create EntityReference this
+ duplicate(EntityReference old): setName( old.name ) -&gt; setTarget(
+ old.target.duplicate() );</pre>
+<p>For more information about the <span class="emphasis">
+<em>Xtend</em>
+</span> language
+ please see the <span class="emphasis">
+<em> <a class="xref" href="Xtend_language.html" title="Xtend">Xtend</a> </em>
+</span>
+ reference documentation.</p>
+</div>
+</div>
+</body>
+</html>
diff --git a/doc/org.eclipse.xpand.doc/contents/index.html b/doc/org.eclipse.xpand.doc/contents/index.html
new file mode 100644
index 0000000..d15a705
--- /dev/null
+++ b/doc/org.eclipse.xpand.doc/contents/index.html
@@ -0,0 +1,38 @@
+<html>
+<head>
+<title>Check / Xtend / Xpand Reference</title>
+<link href="../book.css" rel="stylesheet" type="text/css"/>
+<meta content="DocBook XSL Stylesheets V1.73.2" name="generator"/>
+<link rel="start" href="index.html" title="Check / Xtend / Xpand Reference"/>
+<link rel="next" href="r10_typesystem.html" title="Type System"/>
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<div class="section" lang="en">
+<div class="titlepage">
+<div>
+<div>
+<h2 class="title" style="clear: both">
+<a name="r10_introduction"/>Introduction</h2>
+</div>
+</div>
+</div>
+<p>The oAW4 generator framework provides textual languages, that are useful in
+ different contexts in the MDSD process (e.g. checks, extensions, code generation,
+ model transformation). Each oAW language ( <span class="emphasis">
+<em>Check</em>
+</span>,
+ <span class="emphasis">
+<em>Xtend</em>
+</span>, and <span class="emphasis">
+<em>Xpand</em>
+</span>) is built up on a
+ common expression language and type system. Therefore, they can operate on the same
+ models, metamodels and meta-metamodels and you do not need to learn the syntax again
+ and again, because it is always the same.</p>
+<p>The expressions framework provides a uniform abstraction layer over different
+ meta-meta-models (e.g. EMF Ecore, Eclipse UML, JavaBeans, XML Schema etc.).
+ Additionally, it offers a powerful, statically typed expressions language, which
+ is used in the various textual languages.</p>
+</div>
+</body>
+</html>
diff --git a/doc/org.eclipse.xpand.doc/contents/r10_expressions_language.html b/doc/org.eclipse.xpand.doc/contents/r10_expressions_language.html
new file mode 100644
index 0000000..469ac9c
--- /dev/null
+++ b/doc/org.eclipse.xpand.doc/contents/r10_expressions_language.html
@@ -0,0 +1,589 @@
+<html>
+<head>
+<title>Expressions</title>
+<link href="../book.css" rel="stylesheet" type="text/css"/>
+<meta content="DocBook XSL Stylesheets V1.73.2" name="generator"/>
+<link rel="start" href="index.html" title="Check / Xtend / Xpand Reference"/>
+<link rel="up" href="index.html" title="Check / Xtend / Xpand Reference"/>
+<link rel="prev" href="r10_typesystem.html" title="Type System"/>
+<link rel="next" href="Check_language.html" title="Check"/>
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<p>The oAW expression sub-language is a syntactical mixture of Java and OCL. This
+ documentation provides a detailed description of each available expression. Let us
+ start with some simple examples.</p>
+<p>Accessing a property:</p>
+<pre class="programlisting">myModelElement.name</pre>
+<p>Accessing an operation:</p>
+<pre class="programlisting">myModelElement.doStuff()</pre>
+<p>simple arithmetic:</p>
+<pre class="programlisting">1 + 1 * 2</pre>
+<p>boolean expressions (just an example:-)):</p>
+<pre class="programlisting">!('text'.startsWith('t') &amp;&amp; ! false)</pre>
+<div class="section" lang="en">
+<div class="titlepage">
+<div>
+<div>
+<h3 class="title">
+<a name="r10_expressions_builtin"/>Literals and special operators for built-in types</h3>
+</div>
+</div>
+</div>
+<p>There are several literals for built-in types:</p>
+<div class="section" lang="en">
+<div class="titlepage">
+<div>
+<div>
+<h4 class="title">
+<a name="r10_expressions_builtin_object"/> <code class="classname">Object</code>
+ </h4>
+</div>
+</div>
+</div>
+<p>There are naturally no literals for object, but we have two
+ operators:</p>
+<p>equals:</p>
+<pre class="programlisting">obj1 == obj2</pre>
+<p>not equals:</p>
+<pre class="programlisting">obj1 != obj2</pre>
+</div>
+<div class="section" lang="en">
+<div class="titlepage">
+<div>
+<div>
+<h4 class="title">
+<a name="r10_expressions_builtin_void"/> <code class="classname">Void</code>
+ </h4>
+</div>
+</div>
+</div>
+<p>The only possible instance of <code class="classname">Void</code> is the
+ <code class="varname">null</code> reference. Therefore, we have one literal:</p>
+<pre class="programlisting">null</pre>
+</div>
+<div class="section" lang="en">
+<div class="titlepage">
+<div>
+<div>
+<h4 class="title">
+<a name="r10_expressions_builtin_typeliterals"/>Type literals</h4>
+</div>
+</div>
+</div>
+<p>The literal for types is just the name of the type (no '.class' suffix, etc.).
+ Example:</p>
+<pre class="programlisting">String // the type string my::special::Type // evaluates to the
+ type 'my::special::Type'</pre>
+</div>
+<div class="section" lang="en">
+<div class="titlepage">
+<div>
+<div>
+<h4 class="title">
+<a name="r10_expressions_builtin_staticproperties"/>StaticProperty literals</h4>
+</div>
+</div>
+</div>
+<p>The literal for static properties (aka enum literals) is correlative to
+ type literals:</p>
+<pre class="programlisting">my::Color::RED</pre>
+</div>
+<div class="section" lang="en">
+<div class="titlepage">
+<div>
+<div>
+<h4 class="title">
+<a name="r10_expressions_builtin_string"/> <code class="classname">String</code>
+ </h4>
+</div>
+</div>
+</div>
+<p>There are two different literal syntaxes (with the same
+ semantics):</p>
+<pre class="programlisting">S'a String literal' "a String literal" // both are
+ okay</pre>
+<p>For Strings the expression sub-language supports the plus operator that is
+ overloaded with concatenation:</p>
+<pre class="programlisting">'my element '+ ele.name +' is really cool!'</pre>
+<p>Note, that multi-line Strings are supported.</p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage">
+<div>
+<div>
+<h4 class="title">
+<a name="r10_expressions_builtin_boolean"/> <code class="classname">Boolean</code>
+ </h4>
+</div>
+</div>
+</div>
+<p>The boolean literals are:</p>
+<pre class="programlisting">true false</pre>
+<p>Operators are:</p>
+<pre class="programlisting">true &amp;&amp; false // AND true || false // OR ! true //
+ NOT</pre>
+</div>
+<div class="section" lang="en">
+<div class="titlepage">
+<div>
+<div>
+<h4 class="title">
+<a name="r10_expressions_builtin_numeric"/> <code class="classname">Integer</code> and <code class="classname">Real</code>
+ </h4>
+</div>
+</div>
+</div>
+<p>The syntax for integer literals is as expected:</p>
+<pre class="programlisting">// integer literals 3 57278 // real literals 3.0 0.75
+ </pre>
+<p>Additionally, we have the common arithmetic operators:</p>
+<pre class="programlisting">3 + 4 // addition 4 - 5 // subtraction 2 * 6 // multiplication 3 / 64 //
+ divide // Unary minus operator - 42 - 47.11 </pre>
+<p>Furthermore, the well known compare operators are defined:</p>
+<pre class="programlisting">4 &gt; 5 // greater than 4 &lt; 5 // smaller than 4 &gt;= 23 // greater
+ equals than 4 &lt;= 12 // smaller equals than </pre>
+</div>
+<div class="section" lang="en">
+<div class="titlepage">
+<div>
+<div>
+<h4 class="title">
+<a name="r10_expressions_builtin_collections"/>Collections</h4>
+</div>
+</div>
+</div>
+<p>There is a literal for lists:</p>
+<pre class="programlisting">{1,2,3,4} // a list with four integers</pre>
+<p>There is no other special concrete syntax for collections. If you need a set,
+ you have to call the <code class="methodname">toSet()</code> operation on the list
+ literal:</p>
+<pre class="programlisting">{1,2,4,4}.toSet() // a set with 3(!) integers</pre>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage">
+<div>
+<div>
+<h3 class="title">
+<a name="r10_expressions_collection_operations"/>Special Collection operations</h3>
+</div>
+</div>
+</div>
+<p>Like OCL, the oAW expression sub-language defines several special
+ operations on collections. However, those operations are not members of the type
+ system, therefore you cannot use them in a reflective manner.</p>
+<div class="section" lang="en">
+<div class="titlepage">
+<div>
+<div>
+<h4 class="title">
+<a name="r10_expressions_collection_select"/> <code class="methodname">select</code>
+ </h4>
+</div>
+</div>
+</div>
+<p>Sometimes, an expression yields a large collection, but one is only
+ interested in a special subset of the collection. The expression sub-language
+ has special constructs to specify a selection out of a specific collection.
+ These are the <code class="methodname">select</code> and
+ <code class="methodname">reject</code> operations. The select specifies a subset
+ of a collection. A <code class="methodname">select</code> is an operation on a
+ collection and is specified as follows:</p>
+<pre class="programlisting">collection.select(v |
+ boolean-expression-with-v)</pre>
+<p> <code class="methodname">select</code> returns a sublist of the specified
+ collection. The list contains all elements for which the evaluation of
+ boolean-expression-with-v results is <code class="varname">true</code>.
+ Example:</p>
+<pre class="programlisting">{1,2,3,4}.select(i | i &gt;= 3) // returns
+ {3,4}</pre>
+</div>
+<div class="section" lang="en">
+<div class="titlepage">
+<div>
+<div>
+<h4 class="title">
+<a name="r10_expressions_collection_typeselect"/> <code class="methodname">typeSelect</code>
+ </h4>
+</div>
+</div>
+</div>
+<p>A special version of a select expression is
+ <code class="methodname">typeSelect</code>. Rather than providing a boolean
+ expression a class name is here provided.</p>
+<pre class="programlisting">collection.typeSelect(classname) </pre>
+<p> <code class="methodname">typeSelect</code> returns that sublist of the
+ specified collection, that contains only objects which are an instance of the
+ specified class (also inherited).</p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage">
+<div>
+<div>
+<h4 class="title">
+<a name="r10_expressions_collection_reject"/> <code class="methodname">reject</code>
+ </h4>
+</div>
+</div>
+</div>
+<p>The <code class="methodname">reject</code> operation is similar to the
+ <code class="methodname">select</code> operation, but with
+ <code class="methodname">reject</code> we get the subset of all the elements of the
+ collection for which the expression evaluates to <code class="varname">false</code>.
+ The <code class="methodname">reject</code> syntax is identical to the
+ <code class="methodname">select</code> syntax:</p>
+<pre class="programlisting">collection.reject(v |
+ boolean-expression-with-v)</pre>
+<p>Example:</p>
+<pre class="programlisting">{1,2,3,4}.reject(i | i &gt;= 3) // returns
+ {1,2}</pre>
+</div>
+<div class="section" lang="en">
+<div class="titlepage">
+<div>
+<div>
+<h4 class="title">
+<a name="r10_expressions_collection_collect"/> <code class="methodname">collect</code>
+ </h4>
+</div>
+</div>
+</div>
+<p>As shown in the previous section, the <code class="methodname">select</code>
+ and <code class="methodname">reject</code> operations always result in a
+ sub-collection of the original collection. Sometimes one wants to specify a
+ collection which is derived from another collection, but which contains
+ objects that are not in the original collection (it is not a sub-collection). In
+ such cases, we can use a <code class="methodname">collect</code> operation. The
+ <code class="methodname">collect</code> operation uses the same syntax as the
+ <code class="methodname">select</code> and <code class="methodname">reject</code> and
+ is written like this:</p>
+<pre class="programlisting">collection.collect(v | expression-with-v)</pre>
+<p> <code class="methodname">collect</code> again iterates over the target
+ collection and evaluates the given expression on each element. In contrast to
+ <code class="methodname">select</code>, the evaluation result is collected in a
+ list. When an iteration is finished the list with all results is returned.
+ Example:</p>
+<pre class="programlisting">namedElements.collect(ne | ne.name) // returns a list of strings
+ </pre>
+</div>
+<div class="section" lang="en">
+<div class="titlepage">
+<div>
+<div>
+<h4 class="title">
+<a name="r10_expressions_collection_collect_shorthand"/>Shorthand for <code class="methodname">collect</code> (and more than
+ that)</h4>
+</div>
+</div>
+</div>
+<p>As navigation through many objects is very common, there is a shorthand
+ notation for collect that makes the expressions more readable. Instead
+ of</p>
+<pre class="programlisting">self.employee.collect(e | e.birthdate) </pre>
+<p>one can also write:</p>
+<pre class="programlisting">self.employee.birthdate</pre>
+<p>In general, when a property is applied to a collection of Objects, it will
+ automatically be interpreted as a <code class="methodname">collect</code> over the
+ members of the collection with the specified property.</p>
+<p>The syntax is a shorthand for <code class="methodname">collect</code>, if the
+ feature does not return a collection itself. But sometimes we have the
+ following:</p>
+<pre class="programlisting">self.buildings.rooms.windows // returns a list of
+ windows</pre>
+<p>This syntax works, but one cannot express it using the
+ <code class="methodname">collect</code> operation in an easy way.</p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage">
+<div>
+<div>
+<h4 class="title">
+<a name="r10_expressions_collection_forall"/> <code class="methodname">forAll</code>
+ </h4>
+</div>
+</div>
+</div>
+<p>Often a boolean expression has to be evaluated for all elements in a
+ collection. The <code class="methodname">forAll</code> operation allows
+ specifying a Boolean expression, which must be <code class="varname">true</code> for
+ all objects in a collection in order for the <code class="methodname">forAll</code>
+ operation to return <code class="varname">true</code>:</p>
+<pre class="programlisting">collection.forAll(v |
+ boolean-expression-with-v)</pre>
+<p>The result of <code class="methodname">forAll</code> is
+ <code class="varname">true</code> if
+ <code class="varname">boolean-expression-with-v</code> is <code class="varname">true
+ </code>for all the elements contained in a collection. If
+ <code class="varname">boolean-expression-with-v</code> is
+ <code class="varname">false</code> for one or more of the elements in the collection,
+ then the <code class="methodname">forAll</code> expression evaluates to
+ <code class="varname">false</code>.</p>
+<p>Example:</p>
+<pre class="programlisting">{3,4,500}.forAll(i | i &lt; 10) // evaluates to false (500 &lt; 10
+ is false)</pre>
+</div>
+<div class="section" lang="en">
+<div class="titlepage">
+<div>
+<div>
+<h4 class="title">
+<a name="r10_expressions_collection_exists"/> <code class="methodname">exists</code>
+ </h4>
+</div>
+</div>
+</div>
+<p>Often you will need to know whether there is at least one element in a
+ collection for which a boolean is <code class="varname">true</code>. The exists
+ operation allows you to specify a Boolean expression which must be
+ <code class="varname">true</code> for at least one object in a collection:</p>
+<pre class="programlisting">collection.exists(v |
+ boolean-expression-with-v)</pre>
+<p>The result of the exists operation is <code class="varname">true</code> if
+ <code class="varname">boolean-expression-with-v</code> is
+ <code class="varname">true</code> for at least one element of collection. If the
+ <code class="varname">boolean-expression-with-v</code> is
+ <code class="varname">false</code> for all elements in collection, then the complete
+ expression evaluates to <code class="varname">false</code>.</p>
+<p>Example:</p>
+<pre class="programlisting">{3,4,500}.exists(i | i &lt; 10) // evaluates to true (e.g. 3 &lt; 10
+ is true)</pre>
+</div>
+<div class="section" lang="en">
+<div class="titlepage">
+<div>
+<div>
+<h4 class="title">
+<a name="r10_expressions_collection_sortby"/> <code class="methodname">sortBy</code> <sup>[<a href="#ftn.N10371" name="N10371" class="footnote">1</a>]</sup>
+ </h4>
+</div>
+</div>
+</div>
+<p>If you want to sort a list of elements, you can use the higher order function
+ <code class="methodname">sortBy</code>. The list you invoke the
+ <code class="methodname">sortBy</code> operation on, is sorted by the results of the
+ given expression.</p>
+<p>Example:</p>
+<pre class="programlisting">myListOfEntity.sortBy(entity |
+ entity.name)</pre>
+<p>In the example the list of entities is sorted by the name of the entities. Note
+ that there is no such <code class="classname">Comparable</code> type in oaw. If the
+ values returned from the expression are instances of
+ <code class="classname">java.util.Comparable</code> the
+ <code class="methodname">compareTo</code> method is used, otherwise
+ <code class="methodname">toString()</code> is invoked and the the result is
+ used.</p>
+<p>More Examples &#8211; all the following expressions return
+ <code class="varname">true</code>:</p>
+<pre class="programlisting">{'C','B','A'}.sortBy(e | e) == {'A','B','C'}
+ {'AAA','BB','C'}.sortBy(e | e.length) == {'C','BB','AAA'}
+ {5,3,1,2}.sortBy(e | e) == {1,2,3,5} {5,3,1,2}.sortBy(e | e - 2 * e) == {5,3,2,1}
+ ...</pre>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage">
+<div>
+<div>
+<h3 class="title">
+<a name="r10_expressions_if"/> <code class="methodname">if</code> expression</h3>
+</div>
+</div>
+</div>
+<p>There are two different forms of conditional expressions. The first one is the
+ so-called <span class="emphasis">
+<em>if expression</em>
+</span>. Syntax:</p>
+<pre class="programlisting">condition ? thenExpression : elseExpression</pre>
+<p>Example:</p>
+<pre class="programlisting">name != null ? name : 'unknown'</pre>
+</div>
+<div class="section" lang="en">
+<div class="titlepage">
+<div>
+<div>
+<h3 class="title">
+<a name="r10_expressions_switch"/> <code class="methodname">switch</code> expression</h3>
+</div>
+</div>
+</div>
+<p>The other one is called <span class="emphasis">
+<em>switch expression</em>
+</span>.
+ Syntax:</p>
+<pre class="programlisting">switch (expression) { (case expression : thenExpression)* default
+ : catchAllExpression }</pre>
+<p>The default part is mandatory, because <code class="methodname">switch</code> is
+ an expression, therefore it needs to evaluate to something in any case.
+ Example:</p>
+<pre class="programlisting">switch (person.name) { case 'Hansen' : 'Du kanns platt schnacken'
+ default : 'Du kanns mi nech verstohn!' }</pre>
+<p>There is an abbreviation for <span class="emphasis">
+<em>Boolean</em>
+</span>
+ expressions:</p>
+<pre class="programlisting">switch { case booleanExpression : thenExpression default :
+ catchAllExpression } </pre>
+</div>
+<div class="section" lang="en">
+<div class="titlepage">
+<div>
+<div>
+<h3 class="title">
+<a name="r10_expressions_chain"/>Chain expression</h3>
+</div>
+</div>
+</div>
+<p>Expressions and functional languages should be free of side effects as far as
+ possible. But sometimes there you need invocations that do have side effects. In
+ some cases expressions even don not have a return type (i.e. the return type is
+ <code class="classname">Void</code>). If you need to call such operations, you can use
+ the chain expression. Syntax:</p>
+<pre class="programlisting">anExpr -&gt; anotherExpr -&gt; lastExpr </pre>
+<p>Each expression is evaluated in sequence, but only the result of the last
+ expression is returned. Example:</p>
+<pre class="programlisting">pers.setName('test') -&gt; pers</pre>
+<p>This chain expression will set the <code class="varname">name</code> of the person
+ first, before it returns the person object itself.</p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage">
+<div>
+<div>
+<h3 class="title">
+<a name="r10_expressions_create"/> <code class="methodname">create</code> expression</h3>
+</div>
+</div>
+</div>
+<p>The <code class="methodname">create</code> expression is used to instantiate new
+ objects of a given type:</p>
+<pre class="programlisting">new TypeName</pre>
+</div>
+<div class="section" lang="en">
+<div class="titlepage">
+<div>
+<div>
+<h3 class="title">
+<a name="r10_expressions_let"/> <code class="methodname">let</code> expression</h3>
+</div>
+</div>
+</div>
+<p>The <code class="methodname">let</code> expression lets you define local
+ variables. Syntax is as follows:</p>
+<pre class="programlisting">let v = expression in expression-with-v </pre>
+<p>This is especially useful together with a chain- and a create expressions.
+ Example:</p>
+<pre class="programlisting">let p = new Person in p.name('John Doe') -&gt; p.age(42) -&gt;
+ p.city('New York') -&gt; p</pre>
+</div>
+<div class="section" lang="en">
+<div class="titlepage">
+<div>
+<div>
+<h3 class="title">
+<a name="r10_expressions_globalvar"/>'GLOBALVAR' expression</h3>
+</div>
+</div>
+</div>
+<p>Sometimes you don't want to pass everything down the call stack by parameter.
+ Therefore, we have the <code class="methodname">GLOBALVAR</code> expression. There
+ are two things you need to do, to use global variables within one of the
+ openArchitectureWare languages ( <span class="emphasis">
+<em>Check</em>
+</span>,
+ <span class="emphasis">
+<em>Xtend</em>
+</span> or <span class="emphasis">
+<em>Xpand</em>
+</span>).</p>
+<div class="section" lang="en">
+<div class="titlepage">
+<div>
+<div>
+<h4 class="title">
+<a name="r10_expressions_globalvar_workflow"/>Using GLOBALVARS to configure workflows</h4>
+</div>
+</div>
+</div>
+<p>Each workflow component using the expression framework (
+ <span class="emphasis">
+<em>Xpand</em>
+</span>, <span class="emphasis">
+<em>Check</em>
+</span> and
+ <span class="emphasis">
+<em>Xtend</em>
+</span>) can be configured with global variables. Here is
+ an example:</p>
+<pre class="programlisting">
+
+ &lt;workflow&gt; .... stuff
+ &lt;component class="oaw.xpand2.Generator"&gt; ... usual stuff (see ref doc)
+ &lt;globalVarDef name="MyPSM" value="slotNameOfPSM"/&gt;
+ &lt;globalVarDef name="ImplClassSuffix" value="'Impl'"/&gt;
+ &lt;/component&gt;
+ &lt;/workflow&gt;</pre>
+<p>If you have injected global variables into the respective component, you
+ can call them using the following syntax:</p>
+<pre class="programlisting">GLOBALVAR ImplClassSuffix</pre>
+<p>Note, we don't have any static type information. Therefore
+ <code class="classname">Object</code> is assumed. So, you have to down cast the global
+ variable to the intended type:</p>
+<pre class="programlisting">((String) GLOBALVAR ImplClassSuffix)</pre>
+<p>It is good practice to type it once, using an Extension and then always refer
+ to that extension:</p>
+<pre class="programlisting">
+
+ String implClassSuffix() : GLOBALVAR
+ ImplClassSuffix; // usage of the typed global var extension ImplName(Class c) :
+ name+implClassSuffix();</pre>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage">
+<div>
+<div>
+<h3 class="title">
+<a name="r10_expressions_multidispatch"/>Multi methods (multiple dispatch)</h3>
+</div>
+</div>
+</div>
+<p>The expressions language supports multiple dispatching. This means that
+ when there is a bunch of overloaded operations, the decision which operation has to
+ be resolved is based on the dynamic type of all parameters (the implicit '
+ <code class="varname">this</code>' included).</p>
+<p>In Java only the dynamic type of the ' <code class="varname">this</code>' element is
+ considered, for parameters the static type is used. (this is called single
+ dispatch)</p>
+<p>Here is a Java example:</p>
+<pre class="programlisting">
+
+ class MyClass { boolean equals(Object o) { if (o
+ instanceof MyClass) { return equals((MyClass)o); } return super.equals(o); }
+ boolean equals(MyType mt) { //implementation... } } </pre>
+<p>The method <code class="methodname">equals(Object o)</code> would not have to be
+ overwritten, if Java would support multiple dispatch.</p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage">
+<div>
+<div>
+<h3 class="title">
+<a name="r10_expressions_casting"/>Casting</h3>
+</div>
+</div>
+</div>
+<p>The expression language is statically type checked. Although there are many
+ concepts that help the programmer to have really good static type information,
+ sometimes. one knows more about the real type than the system. To explicitly give
+ the system such an information casts are available. <span class="emphasis">
+<em>Casts are 100%
+ static, so you do not need them, if you never statically typecheck your
+ expressions! </em>
+</span>
+</p>
+<p>The syntax for casts is very Java-like:</p>
+<pre class="programlisting">
+ ((String)unTypedList.get(0)).toUpperCase()</pre>
+</div>
+</body>
+</html>
diff --git a/doc/org.eclipse.xpand.doc/contents/r10_typesystem.html b/doc/org.eclipse.xpand.doc/contents/r10_typesystem.html
new file mode 100644
index 0000000..585c096
--- /dev/null
+++ b/doc/org.eclipse.xpand.doc/contents/r10_typesystem.html
@@ -0,0 +1,441 @@
+<html>
+<head>
+<title>Type System</title>
+<link href="../book.css" rel="stylesheet" type="text/css"/>
+<meta content="DocBook XSL Stylesheets V1.73.2" name="generator"/>
+<link rel="start" href="index.html" title="Check / Xtend / Xpand Reference"/>
+<link rel="up" href="index.html" title="Check / Xtend / Xpand Reference"/>
+<link rel="prev" href="index.html" title="Check / Xtend / Xpand Reference"/>
+<link rel="next" href="r10_expressions_language.html" title="Expressions"/>
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<p>The abstraction layer on API basis is called a type system. It provides access to
+ built-in types and different registered metamodel implementations. These
+ registered metamodel implementations offer access to the types they provide. The
+ first part of this documentation describes the type system. The expression
+ sub-language is described afterwards in the second part of this documentation. This
+ differentiation is necessary because the type system and the expression language
+ are two different things. The type system is a kind of reflection layer, that can be
+ extended with metamodel implementations. The expression language defines a
+ concrete syntax for executable expressions, using the type system.</p>
+<p>The Java API described here is located in the
+ <span class="package">org.openarchitectureware.type</span> package and is a part of the
+ subproject
+ <span class="package">core-expressions</span>.</p>
+<div class="section" lang="en">
+<div class="titlepage">
+<div>
+<div>
+<h3 class="title">
+<a name="r10_typesystem_types"/>Types</h3>
+</div>
+</div>
+</div>
+<p>Every object (e.g. model elements, values, etc.) has a type. A type contains
+ properties and operations. In addition it might inherit from other types
+ (multiple inheritance).</p>
+<div class="section" lang="en">
+<div class="titlepage">
+<div>
+<div>
+<h4 class="title">
+<a name="r10_typesystem_typenames"/>Type Names</h4>
+</div>
+</div>
+</div>
+<p>Types have a simple Name (e.g. <code class="classname">String</code>) and an
+ optional namespace used to distingish between two types with the same name (e.g.
+ <code class="classname">my::metamodel</code>). The delimiter for name space
+ fragments is a double colon " <code class="classname">::</code>". A fully qualified
+ name looks like this:
+ <pre class="programlisting">
+
+
+ my::fully::qualified::MetaType</pre>
+</p>
+<p>The namespace and name used by a specific type is defined by the
+ corresponding <code class="classname">MetaModel</code> implementation. The
+ <code class="classname">EmfMetaModel</code>, for instance, maps
+ <code class="classname">EPackages</code> to namespace and
+ <code class="classname">EClassifiers</code> to names. Therefore, the name of the
+ Ecore element <code class="classname">EClassifier</code> is called:</p>
+<pre class="programlisting">ecore::EClassifier</pre>
+<p>If you do not want to use namespaces (for whatever reason), you can always
+ implement your own metamodel and map the names accordingly.</p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage">
+<div>
+<div>
+<h4 class="title">
+<a name="r10_typesystem_collection_typenames"/>Collection Type Names</h4>
+</div>
+</div>
+</div>
+<p>The built-in type system also contains the following collection types:
+ <code class="classname">Collection</code>, <code class="classname">List</code> and
+ <code class="classname">Set</code>. Because the expressions language is statically
+ type checked and we do not like casts and
+ <code class="classname">ClassCastExceptions</code>, we introduced the concept of
+ <span class="emphasis">
+<em>parameterized types</em>
+</span>. The type system does not support
+ full featured generics, because we do not need them.</p>
+<p>The syntax is:</p>
+<pre class="programlisting">Collection[my::Type] List[my::Type] Set[my::Type]
+ </pre>
+</div>
+<div class="section" lang="en">
+<div class="titlepage">
+<div>
+<div>
+<h4 class="title">
+<a name="r10_typesystem_features"/>Features</h4>
+</div>
+</div>
+</div>
+<p>Each type offers features. The type (resp. the metamodel) is responsible
+ for mapping the features. There are three different kinds of features:
+ <div class="itemizedlist">
+<ul type="disc">
+<li> Properties </li>
+<li> Operations </li>
+<li> Static properties </li>
+</ul>
+</div>
+</p>
+<p> <span class="emphasis">
+<em>Properties</em>
+</span> are straight forward: They have a name
+ and a type. They can be invoked on instances of the corresponding type. The same is
+ true for <span class="emphasis">
+<em>Operations</em>
+</span>. But in contrast to properties,
+ they can have parameters. <span class="emphasis">
+<em>Static properties</em>
+</span> are the
+ equivalent to enums or constants. They must be invoked statically and they do not
+ have parameters.</p>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage">
+<div>
+<div>
+<h3 class="title">
+<a name="r10_builtintypes"/>Built-In Types</h3>
+</div>
+</div>
+</div>
+<p>As mentioned before, the expressions framework has several built-in types
+ that define operations and properties. In the following, we will give a rough
+ overview of the types and their features. We will not document all of the operations
+ here, because the built-.in types will evolve over time and we want to derive the
+ documentation from the implementation (model-driven, of course). For a complete
+ reference, consult the generated API documentation ( <a class="ulink" href="http://www.openarchitectureware.org/api/built-ins/" target="_new">http://www.openarchitectureware.org/api/built-ins/</a>
+ ).</p>
+<div class="section" lang="en">
+<div class="titlepage">
+<div>
+<div>
+<h4 class="title">
+<a name="r10_builtintypes_object"/> <code class="classname">Object</code>
+ </h4>
+</div>
+</div>
+</div>
+<p> <code class="classname">Object</code> defines a couple of basic operations,
+ like <code class="methodname">equals()</code>. Every type has to extend
+ <code class="classname">Object</code>.</p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage">
+<div>
+<div>
+<h4 class="title">
+<a name="r10_builtintypes_void"/> <code class="classname">Void</code>
+ </h4>
+</div>
+</div>
+</div>
+<p>The <code class="classname">Void</code> type can be specified as the return type
+ for operations, although it is not recommended, because whenever possible
+ expressions should be free of side effects whenever possible.</p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage">
+<div>
+<div>
+<h4 class="title">
+<a name="r10_builtintypes_simple"/>Simple types (Data types)</h4>
+</div>
+</div>
+</div>
+<p>The type system doesn't have a concept data type. Data types are just types.
+ As in OCL, we support the following types: <code class="classname">String</code>,
+ <code class="classname">Boolean</code>, <code class="classname">Integer</code>,
+ <code class="classname">Real</code>.
+ <div class="itemizedlist">
+<ul type="disc">
+<li>
+<code class="classname">String</code> : A rich and convenient
+ <code class="classname">String</code> library is especially important for code
+ generation. The type system supports the '+' operator for concatenation,
+ the usual <code class="classname">java.lang.String</code> operations (
+ <code class="methodname">length()</code> , etc.) and some special operations
+ (like <code class="methodname">toFirstUpper()</code> ,
+ <code class="methodname">toFirstLower()</code> , regular expressions, etc.
+ often needed in code generation templates). </li>
+<li>
+<code class="classname">Boolean</code> :
+ <code class="classname">Boolean</code> offers the usual operators (Java
+ syntax): &amp;&amp;, ||, !, etc. </li>
+<li>
+<code class="classname">Integer</code> and
+ <code class="classname">Real</code> : <code class="classname">Integer</code> and
+ <code class="classname">Real</code> offer the usual compare operators
+ (&lt;,&gt;,&lt;=,&gt;=) and simple arithmetics (+,-,*,/). Note that
+ <span class="emphasis">
+<em> <code class="classname">Integer</code> extends
+ <code class="classname">Real</code>
+</em>
+</span> ! </li>
+</ul>
+</div>
+</p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage">
+<div>
+<div>
+<h4 class="title">
+<a name="r10_builtintypes_collections"/>Collection types</h4>
+</div>
+</div>
+</div>
+<p>The type system has three different Collection types.
+ <code class="classname">Collection</code> is the base type, it provides several
+ operations known from <code class="classname">java.util.Collection</code>. The
+ other two types ( <code class="classname">List</code>, <code class="classname">Set</code>
+ ) correspond to their
+ <span class="package">java.util</span> equivalents, too.</p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage">
+<div>
+<div>
+<h4 class="title">
+<a name="r10_builtintypes_typesystem_types"/>Type system types</h4>
+</div>
+</div>
+</div>
+<p>The type system describes itself, hence, there are types for the different
+ concepts. These types are needed for reflective programming. To avoid
+ confusion with metatypes with the same name (it is not unusual to have a metatype
+ called <code class="classname">Operation</code>, for instance) we have prefixed all
+ of the types with the namespace <code class="classname">oaw</code>. We have:</p>
+<div class="itemizedlist">
+<ul type="disc">
+<li>
+<code class="classname">oaw::Type</code>
+</li>
+<li>
+<code class="classname">oaw::Feature</code>
+</li>
+<li>
+<code class="classname">oaw::Property</code>
+</li>
+<li>
+<code class="classname">oaw::StaticProperty</code>
+</li>
+<li>
+<code class="classname">oaw::Operation</code>
+</li>
+</ul>
+</div>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage">
+<div>
+<div>
+<h3 class="title">
+<a name="r10_metamodel_implementations"/>Metamodel Implementations (also known as Meta-Metamodels)</h3>
+</div>
+</div>
+</div>
+<p>By default, the type system only knows the built-in types. In order to register
+ your own metatypes (e.g. <code class="classname">Entity</code> or
+ <code class="classname">State</code>), you need to register a respective metamodel
+ implementation with the type system. Within a metamodel implementation the oAW
+ type system elements (Type, Property, Operation) are mapped to an arbitrary other
+ type system (Java reflections, Ecore or XML Schema).</p>
+<div class="section" lang="en">
+<div class="titlepage">
+<div>
+<div>
+<h4 class="title">
+<a name="r10_metamodel_example_java"/>Example JavaMetaModel</h4>
+</div>
+</div>
+</div>
+<p>For instance, if you want to have the following JavaBean act as a metatype
+ (i.e. your model contains instances of the type):</p>
+<pre class="programlisting">
+
+ public class Attribute { private String name;
+ private String type; public String getName() { return name; } public void
+ setName(String name) { this.name = name; } public String getType() { return type; }
+ public void setType(String type) { this.type = type; } } </pre>
+<p>You need to use the <code class="classname">JavaMetaModel</code>
+ implementation which uses the ordinary Java reflection layer in order to map
+ access to the model.</p>
+<p>So, if you have the following expression in e.g.
+ <span class="emphasis">
+<em>Xpand</em>
+</span>:</p>
+<pre class="programlisting">myattr.name.toFirstUpper()</pre>
+<p>and <code class="varname">myattr</code> is the name of a local variable pointing to
+ an instance of <code class="classname">Attribute</code>. The oAW type system asks the
+ metamodel implementations, if they 'know' a type for the instance of Attribute.
+ If you have the <code class="classname">JavaMetaModel</code> registered it will
+ return an <code class="classname">oaw::Type</code> which maps to the underlying Java
+ class. When the type is asked if it knows a property ' <code class="varname">name</code>',
+ it will inspect the Java class using the Java reflection API.</p>
+<p>The JavaMetaModel implementation shipped with oAW can be configured with a
+ strategy [GOF95-Pattern] in order to control or change the mapping. For
+ instance, the JavaBeansStrategy maps getter and setter methods to simple
+ properties, so we would use this strategy for the example above.</p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage">
+<div>
+<div>
+<h4 class="title">
+<a name="r10_metamodel_contributors"/>Eclipse IDE MetaModelContributors</h4>
+</div>
+</div>
+</div>
+<p>You should know that for each <code class="classname">Metamodel</code>
+ implementation you use at runtime, you need to have a so called
+ <code class="classname">MetamodelContributor</code> extension for the plugins to
+ work with. If you just use one of the standard metamodel implementations (EMF,
+ UML2 or Java) you don't have to worry about it, since oAW is shipped with
+ respective MetamodelContributors (see the corresponding docs for details).
+ If you need to implement your own
+ <code class="classname">MetamodelContributor</code> you should have a look at the
+ Eclipse plug-in reference doc.</p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage">
+<div>
+<div>
+<h4 class="title">
+<a name="r10_metamodel_workflow"/>Configuring Metamodel implementations with the workflow</h4>
+</div>
+</div>
+</div>
+<p>You need to configure your oAW language components with the respective
+ metamodel implementations.</p>
+<p>A possible configuration of the <code class="classname">Xpand2</code>
+ generator component looks like this:</p>
+<pre class="programlisting">
+
+ &lt;component
+ class="oaw.xpand2.Generator"&gt;
+ &lt;metaModel class="oaw.type.emf.EmfMetaModel"&gt;
+ &lt;metaModelPackage value="my.generated.MetaModel1Package"/&gt;
+ &lt;/metaModel&gt;
+ &lt;metaModel class="oaw.type.emf.EmfMetaModel"&gt;
+ &lt;metaModelFile value="my/java/package/metamodel2.ecore"/&gt;
+ &lt;/metaModel&gt; ...
+ &lt;/component&gt; </pre>
+<p>In this example the <code class="classname">EmfMetaModel</code>
+ implementation is configured two times. This means that we want to use two
+ metamodels at the same time, both based on EMF. The metaModelPackage property is
+ a property that is specific to the <code class="classname">EmfMetaModel</code>
+ (located in the <code class="filename">core.emftools</code> project). It points to
+ the generated <code class="classname">EPackages</code> interface. The second meta
+ model is configured using the Ecore file. You do no need to have a generated Ecore
+ model for oAW in order to work. The <code class="classname">EmfMetaModel</code> works
+ with dynamic EMF models just as it works with generated EMF models.</p>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage">
+<div>
+<div>
+<h3 class="title">
+<a name="r10_using_different_metamodels"/>Using different Metamodel implementations (also known as
+ Meta-Metamodels)</h3>
+</div>
+</div>
+</div>
+<p>With oAW you can work on different kinds of Model representations at the same
+ time in a transparent manner. One can work with EMF models, XML DOM models, and
+ simple JavaBeans in the same Xpand-Template. You just need to configure the
+ respective MetaModel implementations.</p>
+<p>If you want to do so you need to know how the type lookup works. Let us assume that
+ we have an EMF metamodel and a model based on some Java classes. Then the following
+ would be a possible configuration:</p>
+<pre class="programlisting">
+
+ &lt;component
+ class="oaw.xpand2.Generator"&gt;
+ &lt;metaModel class="oaw.type.impl.java.JavaMetaModel"/&gt;
+ &lt;metaModel class="oaw.type.emf.EmfMetaModel"&gt;
+ &lt;metaModelFile value="my/java/package/metamodel.ecore"/&gt;
+ &lt;/metaModel&gt;
+ ...
+ &lt;/component&gt; </pre>
+<p>When the oAW runtime needs to access a property of a given object, it asks the
+ metamodels in the configured order. Let us assume that our model element is an
+ instance of the Java type
+ <code class="classname">org.eclipse.emf.ecore.EObject</code> and it is a dynamic
+ instance of an EMF EClass <code class="classname">MyType</code>.</p>
+<p>We have <span class="emphasis">
+<em>three</em>
+</span> Metamodels:
+ <div class="orderedlist">
+<ol type="1">
+<li> Built-Ins (always the first one) </li>
+<li> JavaMetaModel </li>
+<li> EMFMetaModel &#8211; metamodel.ecore </li>
+</ol>
+</div>
+</p>
+<p>The first one will return the type <code class="classname">Object</code> (not
+ <code class="classname">java.lang.Object</code> but
+ <code class="classname">Object</code> of oAW). At this point the type
+ <code class="classname">Object</code> best fits the request, so it will act as the
+ desired type.</p>
+<p>The second metamodel returns an oAW type called
+ <code class="classname">oaw::eclipse::emf::ecore::EObject</code> The type system
+ will check if the returned type is a specialization of the current 'best-fit' type (
+ <code class="classname">Object</code>). It is, because it extends
+ <code class="classname">Object</code> (Every metatype has to extend
+ <code class="classname">Object</code>). At this time the type system assumes
+ <code class="classname">oaw::eclipse::emf::ecore::EObject</code> to be the desired
+ type.</p>
+<p>The third metamodel will return
+ <code class="classname">metamodel::MyType</code> which is the desired type. But
+ unfortunately it doesn't extend
+ <code class="classname">org::eclipse::emf::ecore::EObject</code> as it has nothing
+ to do with those Java types. Instead it extends
+ <code class="classname">emf::EObject</code> which extends
+ <code class="classname">Object</code>.</p>
+<p>We need to swap the configuration of the two metamodels to get the desired
+ type.</p>
+<pre class="programlisting">
+
+ &lt;component
+ class="oaw.xpand2.Generator"&gt;
+ &lt;metaModel class="oaw.type.emf.EmfMetaModel"&gt;
+ &lt;metaModelFile value="my/java/package/metamodel.ecore"/&gt;
+ &lt;/metaModel&gt;
+ &lt;metaModel class="oaw.type.impl.java.JavaMetaModel"/&gt;
+ ...
+ &lt;/component&gt;</pre>
+</div>
+</body>
+</html>
diff --git a/doc/org.eclipse.xpand.doc/contents/xpand_reference_introduction.html b/doc/org.eclipse.xpand.doc/contents/xpand_reference_introduction.html
new file mode 100644
index 0000000..23d8e9e
--- /dev/null
+++ b/doc/org.eclipse.xpand.doc/contents/xpand_reference_introduction.html
@@ -0,0 +1,1279 @@
+<html>
+<head>
+<title>Xpand2</title>
+<link href="../book.css" rel="stylesheet" type="text/css"/>
+<meta content="DocBook XSL Stylesheets V1.73.2" name="generator"/>
+<link rel="start" href="index.html" title="Check / Xtend / Xpand Reference"/>
+<link rel="up" href="index.html" title="Check / Xtend / Xpand Reference"/>
+<link rel="prev" href="Xtend_language.html" title="Xtend"/>
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<p>The openArchitectureWare framework contains a special language called
+ <span class="emphasis">
+<em>Xpand</em>
+</span> <a name="N10748" class="indexterm"/> that is used in templates to control the
+ output generation. This documentation describes the general syntax and semantics
+ of the <span class="emphasis">
+<em>Xpand</em>
+</span> language.</p>
+<p>Typing the <span class="foreignphrase">
+<em class="foreignphrase">guillemets</em>
+</span> <a name="N10754" class="indexterm"/> (« and ») used in the templates is
+ supported by the Eclipse editor: which provides keyboard shortcuts with <span class="keycap">
+<strong>Ctrl</strong>
+</span>+<span class="keycap">
+<strong>&lt; </strong>
+</span>
+ and <span class="keycap">
+<strong>Ctrl</strong>
+</span>+<span class="keycap">
+<strong>&gt; </strong>
+</span>.</p>
+<div class="section" lang="en">
+<div class="titlepage">
+<div>
+<div>
+<h3 class="title">
+<a name="xpand_reference_template_files_and_ecoding"/>Template files and encoding</h3>
+</div>
+</div>
+</div>
+<p>Templates are stored in files with the extension <code class="filename">.xpt</code>
+ <a name="N1076F" class="indexterm"/>. Template files must
+ reside on the Java classpath of the generator process.</p>
+<p>Almost all characters used in the standard syntax are part of
+ <span class="emphasis">
+<em>ASCII</em>
+</span> and should therefore be available in any encoding.
+ The only limitation are the tag brackets ( <span class="emphasis">
+<em>guillemets</em>
+</span>),
+ for which the characters "«" (Unicode <code class="varname">00AB</code>) and "»" (Unicode
+ <code class="varname">00BB</code>) are used. So for reading templates, an encoding should
+ be used that supports these characters (e.g. <code class="varname">ISO-8859-1</code> or
+ <code class="varname">UTF-8</code>).</p>
+<p>Names of properties, templates, namespaces etc. must only contain letters,
+ numbers and underscores.</p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage">
+<div>
+<div>
+<h3 class="title">
+<a name="xpand_reference_general_structure_of_template_files"/>General structure of template files</h3>
+</div>
+</div>
+</div>
+<p>Here is a first example of a template:
+
+
+ <pre class="programlisting">«IMPORT meta::model» «EXTENSION my::ExtensionFile»
+ «DEFINE javaClass FOR Entity» «FILE fileName()» package «javaPackage()»;
+ public class «name» { // implementation } «ENDFILE»
+ «ENDDEFINE»</pre>
+ A template file consists of any number of IMPORT statements, followed by any number
+ of EXTENSION statements, followed by one or more DEFINE blocks (called
+ definitions).</p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage">
+<div>
+<div>
+<h3 class="title">
+<a name="xpand_reference_statements_of_the_expand_language"/>Statements of the <span class="emphasis">
+<em>Xpand</em>
+</span> language</h3>
+</div>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage">
+<div>
+<div>
+<h4 class="title">
+<a name="xpand_reference_import"/>IMPORT <a name="N1079D" class="indexterm"/>
+</h4>
+</div>
+</div>
+</div>
+<p>If you are tired of always typing the fully qualified names of your types and
+ definitions, you can import a namespace using the IMPORT statement.
+ <pre class="programlisting">«IMPORT meta::model»</pre>This one imports
+ the namespace <code class="varname">meta::model</code>. If your template contains
+ such a statement, you can use the unqualified names of all types and template
+ files contained in that namespace. This is similar to a Java import statement
+ <code class="varname">import meta.model.*</code>.</p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage">
+<div>
+<div>
+<h4 class="title">
+<a name="xpand_reference_extension"/>EXTENSION <a name="N107AF" class="indexterm"/>
+</h4>
+</div>
+</div>
+</div>
+<p>Metamodels are typically described in a structural way (graphical, or
+ hierarchical, etc.) . A shortcoming of this is that it is difficult to specify
+ additional behaviour (query operations, derived properties, etc.). Also, it
+ is a good idea not to pollute the metamodel with target platform specific
+ information (e.g. Java type names, packages, getter and setter names,
+ etc.).</p>
+<p>Extensions provide a flexible and convenient way of defining additional
+ features of metaclasses. You do this by using the <span class="emphasis">
+<em>Extend</em>
+</span>
+ <a name="N107B9" class="indexterm"/> language. (See the corresponding
+ reference documentation for details)</p>
+<p>An EXTENSION import points to the <span class="emphasis">
+<em>Xtend</em>
+</span> file
+ containing the required extensions:
+ <pre class="programlisting">«EXTENSION my::ExtensionFile»</pre> Note
+ that extension files have to reside on the Java classpath <a name="N107C5" class="indexterm"/>, too. Therefore, they use the
+ same namespace mechanism (and syntax) as types and template files.</p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage">
+<div>
+<div>
+<h4 class="title">
+<a name="xpand_reference_define"/>DEFINE <a name="N107CD" class="indexterm"/>
+</h4>
+</div>
+</div>
+</div>
+<p>The central concept of <span class="emphasis">
+<em>Xpand</em>
+</span> is the
+ <code class="code">DEFINE</code> block, also called a template. This is the smallest
+ identifiable unit in a template file <a name="N107D8" class="indexterm"/>. The tag consists of a name, an
+ optional comma-separated parameter list, as well as the name of the metamodel
+ class for which the template is defined.
+
+
+ <pre class="programlisting">«DEFINE templateName(formalParameterList) FOR MetaClass» a
+ sequence of statements «ENDDEFINE»</pre>To
+ some extent, templates can be seen as special methods of the metaclass &#8211;
+ there is always an implicit <span class="emphasis">
+<em>this</em>
+</span> parameter which can be
+ used to address the "underlying" model element; in our example above, this model
+ element is "MetaClass".</p>
+<p>As in Java, a formal parameter list entry consists of the type followed by the
+ name of that parameter.</p>
+<p>The body of a template can contain a sequence of other statements including
+ any text.</p>
+<p>A full parametric polymorphism <a name="N107E8" class="indexterm"/> <a name="N107EC" class="indexterm"/> is available for
+ templates. If there are two templates with the same name that are defined for two
+ metaclasses which inherit from the same superclass,
+ <span class="emphasis">
+<em>Xpand</em>
+</span> will use the corresponding subclass template, in
+ case the template is called for the superclass. Vice versa, the template of the
+ superclass would be used in case a subclass template is not available. Note that
+ this not only works for the target type, but for all parameters. Technically, the
+ target type is handled as the first parameter.</p>
+<p>So, let us assume you have the following metamodel:
+ <div class="figure">
+<a name="N107F7"/>
+<p class="title">
+<b>Figure 1. Sample metamodel</b>
+</p>
+<div class="figure-contents">
+<div class="mediaobject">
+<img src="images/Xpand/metamodelexample.gif" alt="Sample metamodel"/>
+</div>
+</div>
+</div>
+<br class="figure-break"/>
+</p>
+<p>Assume further, you would have a model which contains a collection of
+ <code class="classname">A</code>, <code class="classname">B</code> and
+ <code class="classname">C</code> instances in the property
+ <code class="methodname">listOfAs</code>. Then, you can write the following
+ template:
+
+
+ <pre class="programlisting">«DEFINE someOtherDefine FOR SomeMetaClass» «EXPAND
+ implClass FOREACH listOfAs» «ENDDEFINE»
+ «DEFINE implClass FOR A» // this is the code generated for the superclass A
+ «ENDDEFINE»
+ «DEFINE implClass FOR B» // this is the code generated for the subclass B
+ «ENDDEFINE»
+ «DEFINE implClass FOR C» // this is the code generated for the subclass C
+ «ENDDEFINE»</pre>So
+ for each <code class="classname">B</code> in the list, the template defined for
+ <code class="classname">B</code> is executed, for each <code class="classname">C</code> in
+ the collection the template defined for <span class="emphasis">
+<em> <code class="classname">C</code>
+ </em>
+</span> is invoked, and for all others (which are then instances of
+ <code class="classname">A</code>) the default template is executed.</p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage">
+<div>
+<div>
+<h4 class="title">
+<a name="xpand_reference_file"/>FILE <a name="N1082B" class="indexterm"/>
+</h4>
+</div>
+</div>
+</div>
+<p>The <code class="varname">FILE</code> statement redirects the output generated
+ from its body statements to the specified target.
+
+
+ <pre class="programlisting">«FILE expression [outletName]» a sequence of statements
+ «ENDFILE»</pre>The
+ target is a file in the file system whose name is specified by the expression
+ (relative to the specified target directory for that generator run). The
+ expression for the target specification can be a concatenation (using the +
+ operator). Additionally, you can specify an identifier (a legal Java
+ identifier) for the name of the outlet <a name="N10836" class="indexterm"/>. (See the configuration section for
+ a description of outlets).</p>
+<p>The body of a <code class="varname">FILE</code> statement can contain any other
+ statements. Example:
+
+
+ <pre class="programlisting">«FILE InterfaceName + ".java"» package
+ «InterfacePackageName»;
+ /* generated class! Do not modify! */ public interface «InterfaceName» {
+ «EXPAND Operation::InterfaceImplementation FOREACH Operation» } «ENDFILE»
+ «FILE ImplName + ".java" MY_OUTLET» package «ImplPackageName»;
+ public class «ImplName» extends «ImplBaseName» implements «InterfaceName» {
+ //TODO: implement it } «ENDFILE»</pre>
+</p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage">
+<div>
+<div>
+<h4 class="title">
+<a name="xpand_reference_expand"/>EXPAND <a name="N10845" class="indexterm"/>
+</h4>
+</div>
+</div>
+</div>
+<p>The <code class="varname">EXPAND</code> statement "expands" another
+ <code class="varname">DEFINE</code> block (in a separate variable context), inserts
+ its output at the current location and continues with the next statement. This is
+ similar in concept to a subroutine call.
+
+
+ <pre class="programlisting">«EXPAND definitionName [(parameterList)] [FOR expression |
+ FOREACH expression [SEPARATOR expression] ]»</pre>The
+ various alternative syntaxes are explained below.</p>
+<div class="section" lang="en">
+<div class="titlepage">
+<div>
+<div>
+<h5 class="title">
+<a name="xpand_reference_names"/>Names</h5>
+</div>
+</div>
+</div>
+<p>If the <span class="emphasis">
+<em>definitionName</em>
+</span> is a simple unqualified
+ name, the corresponding <code class="varname">DEFINE</code> block must be in the same
+ template file.</p>
+<p>If the called definition is not contained in the same template file, the
+ name of the template file must be specified. As usual, the double colon is used
+ to delimit namespaces.
+
+
+ <pre class="programlisting">«EXPAND TemplateFile::definitionName FOR
+ myModelElement»</pre>Note
+ that you would need to import the namespace <a name="N10864" class="indexterm"/> of the template file (if there
+ is one). For instance, if the template file resides in the java package
+ <code class="varname">my.templates</code>, there are two alternatives. You could
+ either write
+
+
+ <pre class="programlisting">«IMPORT my::templates» ... «EXPAND
+ TemplateFile::definitionName FOR myModelElement»</pre>
+ or
+
+
+ <pre class="programlisting">«EXPAND my::templates::TemplateFile::definitionName
+ FOR myModelElement»</pre>
+</p>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage">
+<div>
+<div>
+<h4 class="title">
+<a name="xpand_reference_for_vs_foreach"/>FOR vs. FOREACH <a name="N10876" class="indexterm"/> <a name="N1087A" class="indexterm"/>
+</h4>
+</div>
+</div>
+</div>
+<p>If <code class="varname">FOR</code> or <code class="varname">FOREACH</code> is omitted the
+ other template is called <code class="varname">FOR this</code>.
+
+
+ <pre class="programlisting">«EXPAND TemplateFile::definitionName»</pre>
+ equals
+
+
+ <pre class="programlisting">«EXPAND TemplateFile::definitionName FOR
+ this»</pre>
+ If <code class="varname">FOR</code> is specified, the definition is executed for the
+ result of the target expression.
+ <pre class="programlisting">«EXPAND myDef FOR entity»</pre>If
+ <code class="varname">FOREACH</code> is specified, the target expression must
+ evaluate to a collection type <a name="N10897" class="indexterm"/>. In this case, the
+ specified definition is executed for each element of that collection.
+
+
+ <pre class="programlisting">«EXPAND myDef FOREACH entity.allAttributes»
+ </pre>
+</p>
+<div class="section" lang="en">
+<div class="titlepage">
+<div>
+<div>
+<h5 class="title">
+<a name="xpand_reference_specifying_a_separator"/>Specifying a Separator <a name="N108A1" class="indexterm"/>
+</h5>
+</div>
+</div>
+</div>
+<p>If a definition is to be expanded <code class="varname">FOREACH</code> element of
+ the target expression it is possible to specify a
+ <code class="varname">SEPARATOR</code> expression:
+
+
+ <pre class="programlisting">«EXPAND paramTypeAndName FOREACH params SEPARATOR
+ ','»</pre>The
+ result of the separator expression <a name="N108AF" class="indexterm"/> will be written to the
+ output between each evaluation of the target definition (not
+ <span class="emphasis">
+<em>after</em>
+</span> each one, but rather only in
+ <span class="emphasis">
+<em>between</em>
+</span> two elements. This comes in handy for things
+ such as comma-separated parameter lists).</p>
+<p>An <code class="varname">EvaluationException</code> will be thrown if the
+ specified target expression cannot be evaluated to an existing element of the
+ instantiated model or no suitable <code class="varname">DEFINE</code> block can be
+ found.</p>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage">
+<div>
+<div>
+<h4 class="title">
+<a name="xpand_reference_foreach"/>FOREACH <a name="N108C7" class="indexterm"/>
+</h4>
+</div>
+</div>
+</div>
+<p>This statement expands the body of the <code class="varname">FOREACH</code> block
+ for each element of the target collection <a name="N108CF" class="indexterm"/> that results from the
+ expression. The current element is bound to a variable with the specified name in
+ the current context.
+
+
+ <pre class="programlisting">«FOREACH expression AS variableName [ITERATOR iterName]
+ [SEPARATOR expression]» a sequence of statements using variableName to access
+ the current element of the iteration «ENDFOREACH»</pre>The
+ body of a <code class="varname">FOREACH</code> block can contain any other statements;
+ specifically <code class="varname">FOREACH</code> statements may be nested. If
+ <code class="varname">ITERATOR</code> <a name="N108DF" class="indexterm"/> name is specified, an object of the
+ type <span class="emphasis">
+<em>xpand2::Iterator</em>
+</span> (see API doc for details) is
+ accessible using the specified name. The <code class="varname">SEPARATOR</code>
+ expression works in the same way as the one for <code class="varname">EXPAND</code>
+ .</p>
+<p>Example:
+
+
+ <pre class="programlisting">«FOREACH {'A','B','C'} AS c ITERATOR iter SEPARATOR ','»
+ «iter.counter1» : «c» «ENDFOREACH»</pre>The
+ evaluation of the above statement results in the following text:
+ <pre class="programlisting">1 : A, 2 : B, 3 : C</pre>
+</p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage">
+<div>
+<div>
+<h4 class="title">
+<a name="xpand_reference_if"/>IF <a name="N108F7" class="indexterm"/>
+</h4>
+</div>
+</div>
+</div>
+<p>The <code class="varname">IF</code> statement supports conditional expansion.
+ Any number of <code class="varname">ELSEIF</code> <a name="N10902" class="indexterm"/> statements are allowed. The
+ <code class="varname">ELSE</code> block is optional. Every <code class="varname">IF</code>
+ statement must be closed with an <code class="varname">ENDIF</code> <a name="N1090F" class="indexterm"/>. The body of an
+ <code class="varname">IF</code> block can contain any other statement, specifically,
+ <code class="varname">IF</code> statements may be nested.
+
+
+ <pre class="programlisting">«IF expression» a sequence of statements [ «ELSEIF expression»
+ ] a sequence of statements ] [ «ELSE» a sequence of statements ]
+ «ENDIF»</pre>
+</p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage">
+<div>
+<div>
+<h4 class="title">
+<a name="xpand_reference_protect"/>PROTECT <a name="N1091F" class="indexterm"/>
+</h4>
+</div>
+</div>
+</div>
+<p>Protected Regions <a name="N10924" class="indexterm"/> are used to mark sections
+ in the generated code that shall not be overridden again by the subsequent
+ generator run. These sections typically contain manually written code.
+
+
+ <pre class="programlisting">«PROTECT CSTART expression CEND expression ID expression
+ (DISABLE)?» a sequence of statements «ENDPROTECT»</pre>
+ The values of CSTART <a name="N1092B" class="indexterm"/> and CEND <a name="N1092F" class="indexterm"/> expressions are used to enclose the
+ protected regions marker in the output. They should build valid comment
+ beginning and end strings corresponding to the generated target language (e.g.
+ <span class="emphasis">
+<em>"/*"</em>
+</span> and <span class="emphasis">
+<em>"*/"</em>
+</span> for Java). The
+ following is an example for Java:
+
+
+ <pre class="programlisting">«PROTECT CSTART "/*" CEND "*/" ID ElementsUniqueID» here goes
+ some content «ENDPROTECT»</pre>The
+ ID is set by the <code class="varname">ID</code> expression and must be globally unique
+ (at least for one complete pass of the generator).</p>
+<p>Generated target code looks like this:
+
+
+ <pre class="programlisting">public class Person { /*PROTECTED REGION ID(Person) ENABLED
+ START*/ This protected region is enabled, therefore the contents will always be
+ preserved. If you want to get the default contents from the template you must
+ remove the ENABLED keyword (or even remove the whole file :-)) /*PROTECTED
+ REGION END*/ }</pre>
+ Protected regions are generated in enabled state <a name="N10944" class="indexterm"/> by default. Unless you manually
+ disable <a name="N1094A" class="indexterm"/> them, by removing the
+ <code class="varname">ENABLED</code> keyword, they will always be preserved.</p>
+<p>If you want the generator to generate disabled protected regions, you need
+ to add the <code class="varname">DISABLE</code> keyword inside the declaration:
+
+
+ <pre class="programlisting">«PROTECT CSTART '/*' CEND '*/' ID this.name
+ DISABLE»</pre>
+</p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage">
+<div>
+<div>
+<h4 class="title">
+<a name="xpand_reference_let"/>LET</h4>
+</div>
+</div>
+</div>
+<p> <code class="varname">LET</code> lets you specify local variables:
+
+
+ <pre class="programlisting">«LET expression AS variableName» a sequence of statements
+ «ENDLET»</pre>During
+ the expansion of the body of the <code class="varname">LET</code> <a name="N10969" class="indexterm"/> block, the value of the expression is
+ bound to the specified variable. Note that the expression will only be evaluated
+ once, independent from the number of usages of the variable within the
+ <code class="varname">LET</code> block. Example:
+
+
+ <pre class="programlisting">«LET packageName + "." + className AS fqn» the fully qualified
+ name is: «fqn»; «ENDLET»</pre>
+</p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage">
+<div>
+<div>
+<h4 class="title">
+<a name="xpand_reference_error"/>ERROR <a name="N10976" class="indexterm"/>
+</h4>
+</div>
+</div>
+</div>
+<p>The <code class="varname">ERROR</code> statement aborts the evaluation of the
+ templates by throwing an <code class="varname">XpandException</code> <a name="N10981" class="indexterm"/> with the specified
+ message.
+ <pre class="programlisting">«ERROR expression»</pre>Note that you should
+ use this facility very sparingly, since it is better practice to check for
+ invalid models using constraints on the metamodel, and not in the
+ templates.</p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage">
+<div>
+<div>
+<h4 class="title">
+<a name="xpand_reference_comments"/>Comments <a name="N1098C" class="indexterm"/>
+</h4>
+</div>
+</div>
+</div>
+<p>Comments are only allowed outside of tags.
+ <pre class="programlisting">«REM» text comment «ENDREM»</pre>Comments
+ may not contain a REM <a name="N10994" class="indexterm"/> tag, this implies that comments are not
+ nestable. A comment may not have a white space between the REM keyword and its
+ brackets. Example:
+
+
+ <pre class="programlisting">«REM»«LET expression AS variableName»«ENDREM» a sequence of
+ statements «REM» «variableName.stuff» «ENDLET»«ENDREM»</pre>
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage">
+<div>
+<div>
+<h4 class="title">
+<a name="xpand_reference_expression_statement"/>Expression Statement <a name="N1099F" class="indexterm"/>
+</h4>
+</div>
+</div>
+</div>
+<p>Expressions support processing of the information provided by the
+ instantiated metamodel. Xpand provides powerful expressions for selection,
+ aggregation, and navigation. Xpand uses the expressions sublanguage in almost
+ any statement that we have seen so far. The expression statement just evaluates
+ the contained expression and writes the result to the output (using the
+ <code class="varname">toString()</code> method of
+ <code class="varname">java.lang.Object</code>). Example:
+ <pre class="programlisting">public class «this.name» {</pre> All
+ expressions defined by the oArchitectureWare expressions sublanguage are
+ also available in Xpand. You can invoke imported extensions. (See the
+ <span class="emphasis">
+<em> <a class="xref" href="r10_expressions_language.html" title="Expressions">Expressions</a> </em>
+</span> and
+ <span class="emphasis">
+<em> <a class="xref" href="Xtend_language.html" title="Xtend">Xtend</a> language
+ reference</em>
+</span> for more details).</p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage">
+<div>
+<div>
+<h4 class="title">
+<a name="xpand_reference_controlling_generation_of_white_space"/>Controlling generation of white space</h4>
+</div>
+</div>
+</div>
+<p>If you want to omit the output of superfluous whitespace <a name="N109BF" class="indexterm"/> you can add a minus sign just before
+ any closing bracket. Example:
+
+
+ <pre class="programlisting">«FILE InterfaceName + ".java"-» «IF hasPackage-» package
+ «InterfacePackageName»; «ENDIF-» ... «ENDFILE»</pre>The
+ generated file would start with two new lines (one after the
+ <code class="varname">FILE</code> and one after the <code class="varname">IF</code> statement)
+ if the minus characters had not been set.</p>
+<p>In general, this mechanism works as follows: If a statement (or comment)
+ ends with such a minus all preceding whitespace up to the newline <a name="N109D0" class="indexterm"/> character (excluded!) is removed.
+ Additionally all following whitespace including the first newline character
+ (\r\n is handled as one character) is also removed.</p>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage">
+<div>
+<div>
+<h3 class="title">
+<a name="xpand_reference_aspect-oriented_programming_in_xpand"/>Aspect-Oriented Programming in <span class="emphasis">
+<em>Xpand</em>
+</span> <a name="N109DB" class="indexterm"/>
+</h3>
+</div>
+</div>
+</div>
+<p>Using the workflow engine it is now possible to package (
+ <span class="emphasis">
+<em>e.g.</em>
+</span> zip) a written generator and deliver it as a kind of
+ black box. If you want to use such a generator but need to change some small
+ generation stuff, you can make use of the <code class="varname">AROUND</code> <a name="N109E6" class="indexterm"/> aspects.
+
+
+ <pre class="programlisting">«AROUND qualifiedDefinitionName(parameterList)? FOR type» a
+ sequence of statements «ENDAROUND» </pre>
+ <code class="varname">AROUND</code> lets you add templates in an non-invasive way (you do
+ not need to touch the generator templates). Because aspects are invasive, a
+ template file containing <code class="varname">AROUND</code> aspects must be wrapped by
+ configuration (see next section).</p>
+<div class="section" lang="en">
+<div class="titlepage">
+<div>
+<div>
+<h4 class="title">
+<a name="xpand_reference_join_point_and_cut_syntax"/>Join Point <a name="N109F7" class="indexterm"/> <a name="N109FB" class="indexterm"/> and Point Cut <a name="N10A01" class="indexterm"/> <a name="N10A05" class="indexterm"/> Syntax</h4>
+</div>
+</div>
+</div>
+<p>AOP is basically about weaving code into different points inside the call
+ graph of a software module. Such points are called <span class="emphasis">
+<em>Join
+ Points</em>
+</span>. In <span class="emphasis">
+<em>Xpand</em>
+</span>, there is only one join
+ point so far: a call to a definition.</p>
+<p>You specify on which join points the contributed code should be executed by
+ specifying something like a 'query' on all available join points. Such a query is
+ called a <span class="emphasis">
+<em>point cut</em>
+</span>.
+
+
+ <pre class="programlisting">«AROUND [pointcut]» do stuff «ENDAROUND»</pre>
+ A pointcut consists of a fully qualified name, parameter types and the target
+ type.</p>
+<div class="section" lang="en">
+<div class="titlepage">
+<div>
+<div>
+<h5 class="title">
+<a name="xpand_reference_definition_name"/>Definition Name</h5>
+</div>
+</div>
+</div>
+<p>The definition name part of a point cut must match the fully qualified name
+ of the join point definition. Such expressions are case sensitive. The
+ asterisk character is used to specify wildcards.</p>
+<p>Some examples:
+
+
+ <pre class="programlisting">my::Template::definition // definitions with the
+ specified name org::oaw::* // definitions prefixed with 'org::oaw::'
+ *Operation* // definitions containing the word 'Operation' in it. * // all
+ definitions</pre>
+</p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage">
+<div>
+<div>
+<h5 class="title">
+<a name="xpand_reference_parameter_types"/>Parameter Types</h5>
+</div>
+</div>
+</div>
+<p>The parameters of the definitions we want to add our advice to, can also be
+ specified in the point cut. The rule is that the type of the specified parameter
+ must be the same or a supertype of the corresponding parameter type (the
+ dynamic type at runtime!) of the definition to be called.</p>
+<p>Additionally, one can set a wildcard at the end of the parameter list, to
+ specify that there might be an arbitrary number of parameters of any
+ kind.</p>
+<p>Some examples:
+
+
+ <pre class="programlisting">my::Templ::def() // templ def without parameters
+ my::Templ::def(String s) // templ def with exactly one parameter // of type
+ String my::Templ::def(String s,*) // templ def with one or more parameters,
+ // where the first parameter is of type String my::Templ::def(*) // templ def
+ with any number of parameters</pre>
+</p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage">
+<div>
+<div>
+<h5 class="title">
+<a name="xpand_reference_target_type"/>Target Type</h5>
+</div>
+</div>
+</div>
+<p>Finally, we have to specify the target type. This is straightforward:
+
+
+ <pre class="programlisting">my::Templ::def() FOR Object// templ def for any target type
+ my::Templ::def() FOR Entity// templ def objects of type
+ Entity</pre>
+</p>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage">
+<div>
+<div>
+<h4 class="title">
+<a name="xpand_reference_proceeding"/>Proceeding</h4>
+</div>
+</div>
+</div>
+<p>Inside an advice, you might want to call the underlying definition. This can
+ be done using the implicit variable <code class="varname">targetDef</code>, which is of
+ the type <span class="type">xpand2::Definition</span> and which provides an operation
+ <code class="methodname">proceed()</code>that invokes the underlying definition
+ with the original parameters (Note that you might have changed any mutable
+ object in the advice before).</p>
+<p>If you want to control, what parameters are to be passed to the definition,
+ you can use the operation <code class="methodname">proceed</code>(
+ <code class="classname">Object</code> <code class="varname">target</code>,
+ <code class="classname">List</code> <code class="varname">params</code>). Please keep in
+ mind that no type checking is done in this context.</p>
+<p>Additionally, there are some inspection properties (like
+ <code class="varname">name</code>, <code class="varname">paramTypes</code>, etc.)
+ available.</p>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage">
+<div>
+<div>
+<h3 class="title">
+<a name="xpand_reference_generator_workflow_component"/>Generator Workflow Component</h3>
+</div>
+</div>
+</div>
+<p>This section describes the workflow component that is provided to perform the
+ code generation, i.e. run the templates. You should have a basic idea of how the
+ workflow engine works. (see <span class="emphasis">
+<em> <span> <a class="xref" href="">???</a>
+</span>
+<span>Workflow reference</span>
+</em>
+</span>). A
+ simple generator component configuration could look as follows:
+
+
+ <pre class="programlisting">&lt;component class="oaw.xpand2.Generator"&gt;
+ &lt;fileEncoding value="ISO-8859-1"/&gt;
+ &lt;metaModel class="oaw.type.emf.EmfMetaModel"&gt;
+ &lt;metaModelPackage value="org.eclipse.emf.ecore.EcorePackage"/&gt;
+ &lt;/metaModel&gt;
+ &lt;expand value="example::Java::all FOR myModel"/&gt;
+
+ &lt;!-- aop configuration --&gt;
+ &lt;advices value='example::Advices1, example::Advices2'/&gt;
+
+ &lt;!-- output configuration --&gt;
+ &lt;outlet path='main/src-gen'/&gt;
+ &lt;outlet name='TO_SRC' path='main/src' overwrite='false'/&gt;
+ &lt;beautifier class="oaw.xpand2.output.JavaBeautifier"/&gt;
+ &lt;beautifier class="oaw.xpand2.output.XmlBeautifier"/&gt;
+
+ &lt;!-- protected regions configuration --&gt;
+ &lt;prSrcPaths value="main/src"/&gt;
+ &lt;prDefaultExcludes value="false"/&gt;
+ &lt;prExcludes value="*.xml"/&gt;
+ &lt;/component&gt;</pre>Now,
+ let us go through the different properties one by one.</p>
+<div class="section" lang="en">
+<div class="titlepage">
+<div>
+<div>
+<h4 class="title">
+<a name="xpand_reference_main_configuration"/>Main configuration</h4>
+</div>
+</div>
+</div>
+<p>The first thing to note is that the qualified Java name of the component is
+ <code class="varname">org.openarchitectureware.xpand2.Generator2</code>. One can
+ use the shortcut <code class="varname">oaw</code> instead of a preceding
+ <code class="varname">org.openarchitectureware</code>. The workflow engine will
+ resolve it.</p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage">
+<div>
+<div>
+<h4 class="title">
+<a name="xpand_reference_encoding"/>Encoding</h4>
+</div>
+</div>
+</div>
+<p>For <span class="emphasis">
+<em>Xpand</em>
+</span>, it is important to have the file encoding
+ in mind because of the <span class="foreignphrase">
+<em class="foreignphrase">guillemet</em>
+</span> characters
+ used to delimit keywords and property access. The
+ <code class="varname">fileEncoding</code> property specifies the file encoding to use
+ for reading the templates, reading the protected regions and writing the
+ generated files. This property defaults to the default file encoding of your
+ JVM.</p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage">
+<div>
+<div>
+<h4 class="title">
+<a name="xpand_reference_metamodel"/>Metamodel</h4>
+</div>
+</div>
+</div>
+<p>The property <code class="varname">metaModel</code> is used to tell the generator
+ engine on which metamodels the <span class="emphasis">
+<em>Xpand</em>
+</span> templates should
+ be evaluated. One can specify more than one metamodel here. Metamodel
+ implementations are required by the expression framework (see <span class="emphasis">
+<em>
+ <a class="xref" href="r10_expressions_language.html" title="Expressions">Expressions</a> </em>
+</span>) used by
+ <span class="emphasis">
+<em>Xpand2</em>
+</span>. In the example above we configured the Ecore
+ metamodel using the <span class="emphasis">
+<em>EMFMetaModel</em>
+</span> implementation
+ shipped with the core part of the openArchitectureWare 4 release.</p>
+<p>A mandatory configuration is the <code class="varname">expand</code> property. It
+ expects a syntax similar to that of the <code class="varname">EXPAND</code> statement
+ (described above). The only difference is that we omit the
+ <code class="varname">EXPAND</code> keyword. Instead, we specify the name of the
+ property. Examples:
+
+
+ <pre class="programlisting">&lt;expand value="Template::define FOR
+ mySlot"/&gt;</pre>
+ or:
+
+
+ <pre class="programlisting">&lt;expand value="Template::define('foo') FOREACH
+ {mySlot1,mySlot2}"/&gt;</pre>The
+ expressions are evaluated using the workflow context. Each slot is mapped to a
+ variable. For the examples above the workflow context needs to contain elements
+ in the slots <code class="varname">'mySlot'</code>, <code class="varname">'mySlot1'</code>
+ and <code class="varname">'mySlot2'</code>. It is also possible to specify some complex
+ expressions here. If, for instance, the slot <code class="varname">myModel</code>
+ contains a collection of model elements one could write:
+
+
+ <pre class="programlisting">&lt;expand value="Template::define FOREACH
+ myModel.typeSelect(Entity)"/&gt;</pre>This
+ selects all elements of type <span class="emphasis">
+<em>Entity</em>
+</span> contained in the
+ collection stored in the <code class="varname">myModel</code> slot.</p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage">
+<div>
+<div>
+<h4 class="title">
+<a name="xpand_reference_output_configuration"/>Output configuration</h4>
+</div>
+</div>
+</div>
+<p>The second mandatory configuration is the specification of so called
+ outlets (a concept borrowed from AndroMDA). Outlets are responsible for
+ writing the generated files to disk . Example:
+
+
+ <pre class="programlisting">&lt;component class="oaw.xpand2.Generator2"&gt; ...
+ &lt;outlet path='main/src-gen'/&gt;
+ &lt;outlet name='TO_SRC' path='main/src' overwrite='false'/&gt; ...
+ &lt;/component&gt;</pre>In
+ the example there are two outlets configured. The first one has no name and is
+ therefore handled as the default outlet. Default outlets are triggered by
+ omitting an outlet name:
+
+
+ <pre class="programlisting">«FILE 'test/note.txt'» # this goes to the default outlet
+ «ENDFILE»</pre>The
+ configured base path is ' <code class="filename">main/src-gen</code>', so the file
+ from above would go to ' <code class="filename">main/src-gen/test/note.txt</code>
+ '.</p>
+<p>The second outlet has a <code class="varname">name</code> ('TO_SRC') specified.
+ Additionally the flag <code class="varname">overwrite</code> is set to
+ <code class="varname">false</code> (defaults to <code class="varname">true</code>). The
+ following <span class="emphasis">
+<em>Xpand</em>
+</span> fragment
+
+
+ <pre class="programlisting">«FILE 'test/note.txt' TO_SRC» # this goes to the TO_SRC outlet
+ «ENDFILE»</pre>would
+ cause the generator to write the contents to '
+ <code class="filename">main/src/test/note.txt</code>' if the file does not already
+ exist (the <code class="varname">overwrite</code> flag).</p>
+<p>Another option called <code class="varname">append</code> (defaults to
+ <code class="varname">false</code>) causes the generator to append the generated text
+ to an existing file. If <code class="varname">overwrite</code> is set to
+ <code class="varname">false</code> this flag has no effect.</p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage">
+<div>
+<div>
+<h4 class="title">
+<a name="xpand_reference_beautifier"/>Beautifier</h4>
+</div>
+</div>
+</div>
+<p>Beautifying the generated code is a good idea. It is very important that
+ generated code looks good, because developers should be able to understand it.
+ On the other hand template files should look good, too. It is thus best practice to
+ write nice looking template files and not to care how the generated code looks
+ &#8211; and then you run a beautifier over the generated code to fix that problem.
+ Of course, if a beautifier is not available, or if white space has syntactical
+ meaning (as in Python), you would have to write your templates with that in mind
+ (using the minus character before closing brackets as described in a preceding
+ section).</p>
+<p>The <span class="emphasis">
+<em>Xpand</em>
+</span> workflow component can be configured
+ with multiple beautifiers:
+
+
+ <pre class="programlisting">&lt;beautifier
+ class="org.openarchitectureware.xpand2.output.JavaBeautifier"/&gt;
+ &lt;beautifier
+ class="org.openarchitectureware.xpand2.output.XmlBeautifier"/&gt;</pre>
+ These are the two beautifiers delivered with <span class="emphasis">
+<em>Xpand</em>
+</span>. If
+ you want to use your own beautifier, you would just need to implement the
+ following Java interface:
+
+
+ <pre class="programlisting">package org.openarchitectureware.xpand2.output;
+ public interface PostProcessor { public void
+ beforeWriteAndClose(FileHandle handle); public void
+ afterClose(FileHandle handle); }</pre>The
+ <code class="varname">beforeWriteAndClose</code> method is called for each
+ <code class="varname">ENDFILE</code> statement.</p>
+<div class="section" lang="en">
+<div class="titlepage">
+<div>
+<div>
+<h5 class="title">
+<a name="xpand_reference_javabeautifier"/>JavaBeautifier</h5>
+</div>
+</div>
+</div>
+<p>The JavaBeautifier is based on the Eclipse Java formatter provides base
+ beautifying for Java files.</p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage">
+<div>
+<div>
+<h5 class="title">
+<a name="xpand_reference_xmlbeautifier"/>XmlBeautifier</h5>
+</div>
+</div>
+</div>
+<p>The XmlBeautifier is based on <span class="emphasis">
+<em>dom4j</em>
+</span> and provides
+ a single option <code class="varname">fileExtensions</code> (defaults to "
+ <code class="filename">.xml</code>, <code class="filename">.xsl</code>,
+ <code class="filename">.wsdd</code>, <code class="filename">.wsdl</code>") used to
+ specify which files should be pretty-printed.</p>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage">
+<div>
+<div>
+<h4 class="title">
+<a name="xpand_reference_protected_region_configuration"/>Protected Region Configuration</h4>
+</div>
+</div>
+</div>
+<p>Finally, you need to configure the protected region resolver, if you want to
+ use protected regions.
+
+
+ <pre class="programlisting">&lt;prSrcPaths value="main/src"/&gt;
+ &lt;prDefaultExcludes value="false"/&gt;
+ &lt;prExcludes value="*.xml"/&gt;</pre>The
+ <span class="emphasis">
+<em>prSrcPaths</em>
+</span> property points to a comma-separated list
+ of directories. The protected region resolver will scan these directories for
+ files containing activated protected regions.</p>
+<p>There are several file names which are excluded by default:
+
+
+ <pre class="programlisting">RCS, SCCS, CVS, CVS.adm, RCSLOG, cvslog.*, tags, TAGS,
+ .make.state, .nse_depinfo, *~, #*, .#*, ',*', _$*,*$, *.old, *.bak, *.BAK,
+ *.orig, *.rej, .del-*, *.a, *.olb, *.o, *.obj, *.so, *.exe, *.Z,* .elc, *.ln,
+ core, .svn</pre>
+ If you do not want to exclude any of these, you must set
+ <code class="varname">prDefaultExcludes</code> to false.
+
+
+ <pre class="programlisting">&lt;prDefaultExcludes
+ value="false"/&gt;</pre>
+ If you want to add additional excludes, you should use the prExcludes property.
+
+
+ <pre class="programlisting">&lt;prExcludes
+ value="*.xml,*.hbm"/&gt;</pre>
+</p>
+<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
+<p>It is bad practice to mix generated and non-generated code in one artifact.
+ Instead of using protected regions, you should try to leverage the extension
+ features of the used target language (inheritance, inclusion, references,
+ etc.) wherever possible. It is very rare that the use of protected regions is an
+ appropriate solution.</p>
+</div>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage">
+<div>
+<div>
+<h3 class="title">
+<a name="aop_template_introduction"/>Example for using Aspect-Oriented Programming in
+ <span class="emphasis">
+<em>Xpand</em>
+</span>
+</h3>
+</div>
+</div>
+</div>
+<p>This example shows how to use aspect-oriented programming techniques in
+ <span class="emphasis">
+<em>Xpand</em>
+</span> templates. It is applicable to EMF based and
+ <span class="emphasis">
+<em>Classic</em>
+</span> systems. However, we explain the idea based on the
+ <span class="emphasis">
+<em>emfExample</em>
+</span> &#8211; hence you should read that
+ before.</p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage">
+<div>
+<div>
+<h3 class="title">
+<a name="aop_template_the_problem"/>The Problem</h3>
+</div>
+</div>
+</div>
+<p>There are many circumstances when template-AOP is useful. Here are two
+ examples:</p>
+<p> <span class="bold">
+<strong>Scenario 1:</strong>
+</span> Assume you have a nice
+ generator that generates certain artifacts. The generator (or cartridge) might
+ be a third party product, delivered in a single JAR file. Still you might want to
+ adapt certain aspects of the generation process &#8211; <span class="emphasis">
+<em>without
+ modifying the original generator</em>
+</span>.</p>
+<p> <span class="bold">
+<strong>Scenario 2:</strong>
+</span> You are building a family of
+ generators that can generate variations of the generate code, e.g.
+ Implementations for different embedded platforms. In such a scenario, you need to
+ be able to express those differences (variabilities) sensibly without creating a
+ non-understandable chaos of <span class="emphasis">
+<em>if</em>
+</span> statements in the
+ templates.</p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage">
+<div>
+<div>
+<h3 class="title">
+<a name="aop_template_example"/>Example</h3>
+</div>
+</div>
+</div>
+<p>To illustrate the idea of extending a generator without "touching" it, let us
+ create a new project called
+ <code class="classname">oaw4.demo.emf.datamodel.generator-aop</code>. The idea is
+ that it will "extend" the original
+ <code class="classname">oaw4.demo.emf.datamodel.generator</code> project
+ introduced in the <span class="emphasis">
+<em>emfExample</em>
+</span>. So this new projects needs
+ to have a project dependency to the former one.</p>
+<div class="section" lang="en">
+<div class="titlepage">
+<div>
+<div>
+<h4 class="title">
+<a name="aop_template_example_templates"/>Templates</h4>
+</div>
+</div>
+</div>
+<p>An AOP system always needs to define a join point model; this is, you have to
+ define, at which locations of a (template) program you can add additional
+ (template) code. In Xpand, the join points are simply templates (i.e.
+ <span class="emphasis">
+<em>DEFINE .. ENDDEFINE</em>
+</span>) blocks. An "aspect template" can
+ be declared <span class="emphasis">
+<em>AROUND</em>
+</span> previously existing templates. If
+ you take a look at the
+ <code class="classname">oaw4.demo.emf.datamodel.generator</code> source folder
+ of the project, you can find the <code class="filename">Root.xpt</code> template file.
+ Inside, you can find a template called <code class="classname">Impl</code> that
+ generates the implementation of the JavaBean.</p>
+<pre class="programlisting">
+
+ «DEFINE Entity FOR data::Entity» «FILE
+ baseClassFileName() » // generated at «timestamp()» public abstract class
+ «baseClassName()» { «EXPAND Impl» } «ENDFILE» «ENDDEFINE»
+ «DEFINE Impl FOR data::Entity» «EXPAND GettersAndSetters» «ENDDEFINE»
+ «DEFINE Impl FOR data::PersistentEntity» «EXPAND GettersAndSetters» public
+ void save() {
+ } «ENDDEFINE»</pre>
+<p>What we now want to do is as follows: Whenever the
+ <span class="emphasis">
+<em>Impl</em>
+</span> template is executed, we want to run an additional
+ template that generates additional code (for example, some kind of meta
+ information for frameworks &#8211; the specific code is not important for the
+ example here).</p>
+<p>So, in our new project, we define the following template file:</p>
+<pre class="programlisting">
+
+ «AROUND Impl FOR data::Entity» «FOREACH
+ attribute AS a» public static final AttrInfo «a.name»Info = new AttrInfo(
+ "«a.name»", «a.type».class ); «ENDFOREACH» «targetDef.proceed()»
+ «ENDAROUND»</pre>
+<p>So, this new template wraps around the existing template called
+ <code class="classname">Impl</code> It first generates additional code and then
+ forwards the execution to the original template using
+ <code class="methodname">targetDef.proceed()</code>. So, in effect, this is a
+ <code class="varname">BEFORE</code> advice. Moving the
+ <code class="methodname">proceed</code> statement to the beginning makes it an
+ <code class="varname">AFTER</code> advice, omitting it, makes it an override.</p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage">
+<div>
+<div>
+<h4 class="title">
+<a name="aop_template_example_workflow_file"/>Workflow File</h4>
+</div>
+</div>
+</div>
+<p>Let us take a look at the workflow file to run this generator:</p>
+<pre class="programlisting">
+
+ &lt;workflow&gt;
+ &lt;cartridge file="workflow.oaw"/&gt;
+ &lt;component adviceTarget="generator" id="reflectionAdvice"
+ class="oaw.xpand2.GeneratorAdvice"&gt;
+ &lt;advices value="templates::Advices"/&gt;
+ &lt;/component&gt;
+ &lt;/workflow&gt;</pre>
+<p>Mainly, what we do here, is to call the original workflow file. It has to be
+ available from the classpath. After this cartridge call, we define an
+ additional workflow component, a so called <span class="emphasis">
+<em>advice
+ component</em>
+</span>. It specifies <span class="emphasis">
+<em>generator</em>
+</span> as its
+ <span class="emphasis">
+<em>adviceTarget</em>
+</span>. That means, that all the properties we
+ define inside this advice component will be added to the component referenced by
+ name in the <span class="emphasis">
+<em>adviceTarget</em>
+</span> instead. In our case, this is
+ the generator. So, in effect, we add the
+ &lt;advices value="templates::Advices" /&gt; to the original generator
+ component (without invasively modifying its own definition). This
+ contributes the advice templates to the generator.</p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage">
+<div>
+<div>
+<h4 class="title">
+<a name="aop_template_example_running_the_new_generator"/>Running the new generator</h4>
+</div>
+</div>
+</div>
+<p>Running the generator produces the following code:</p>
+<pre class="programlisting">
+
+ public abstract class PersonImplBase { public
+ static final AttrInfo nameInfo = new AttrInfo("name", String.class); public
+ static final AttrInfo name2Info = new AttrInfo("name2", String.class); private
+ String name; private String name2;
+ public void setName(String value) { this.name = value; }
+ public String getName() { return this.name; }
+ public void setName2(String value) { this.name2 = value; }
+ public String getName2() { return this.name2; } }</pre>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage">
+<div>
+<div>
+<h3 class="title">
+<a name="aop_template_more_ao"/>More Aspect Orientation</h3>
+</div>
+</div>
+</div>
+<p>In general, the syntax for the <span class="emphasis">
+<em>AROUND</em>
+</span> construct is as
+ follows:</p>
+<pre class="programlisting">
+
+ &lt;&lt;AROUND
+ fullyQualifiedDefinitionNameWithWildcards (Paramlist (*)?) FOR
+ TypeName&gt;&gt; do Stuff
+ &lt;&lt;ENDAROUND&gt;&gt;</pre>
+<p>Here are some examples:</p>
+<pre class="programlisting">&lt;&lt;AROUND *(*) FOR Object&gt;&gt;</pre>
+<p>matches all templates</p>
+<pre class="programlisting">&lt;&lt;AROUND *define(*) FOR Object&gt;&gt;</pre>
+<p>matches all templates with <span class="emphasis">
+<em>define</em>
+</span> at the end of its
+ name and any number of parameters</p>
+<pre class="programlisting">&lt;&lt;AROUND org::oaw::* FOR
+ Entity&gt;&gt;</pre>
+<p>matches all templates with namespace <span class="emphasis">
+<em>org::oaw::</em>
+</span>
+ that do not have any parameters and whose type is Entity or a subclass</p>
+<pre class="programlisting">&lt;&lt;AROUND *(String s) FOR Object&gt;&gt;</pre>
+<p>matches all templates that have exactly one <code class="classname">String</code>
+ parameter</p>
+<pre class="programlisting">&lt;&lt;AROUND *(String s,*) FOR
+ Object&gt;&gt;</pre>
+<p>matches all templates that have at least one <code class="classname">String</code>
+ parameter</p>
+<pre class="programlisting">&lt;&lt;AROUND my::Template::definition(String s) FOR
+ Entity&gt;&gt;</pre>
+<p>matches exactly this single definition</p>
+<p>Inside an <code class="varname">AROUND</code>, there is the variable
+ <code class="varname">targetDef</code>, which has the type
+ <code class="classname">xpand2::Definition</code>. On this variable, you can call
+ <code class="methodname">proceed</code>, and also query a number of other
+ things:</p>
+<pre class="programlisting">&lt;&lt;AROUND my::Template::definition(String s) FOR
+ String&gt;&gt; log('invoking '+&lt;&lt;targetDef.name&gt;&gt;+' with '+this)
+ &lt;&lt;targetDef.proceed()&gt;&gt;
+ &lt;&lt;ENDAROUND&gt;&gt;</pre>
+</div>
+</body>
+</html>
diff --git a/doc/org.eclipse.xpand.doc/plugin.xml b/doc/org.eclipse.xpand.doc/plugin.xml
index cbf84f1..989fb2d 100644
--- a/doc/org.eclipse.xpand.doc/plugin.xml
+++ b/doc/org.eclipse.xpand.doc/plugin.xml
@@ -1,3 +1,5 @@
-<?xml version="1.0"?>
-<?eclipse version="3.0"?>
-<plugin><extension point="org.eclipse.help.toc"><toc file="toc.xml" primary="true"/><index path="index"/></extension><extension point="org.eclipse.help.toc"><toc file="topics_Reference.xml"/></extension><extension point="org.eclipse.pde.core.javadoc"><javadoc path="doc.zip!/references/javadoc" archive="true"><plugin id="org.eclipse.m2t.common.recipe"/><plugin id="org.eclipse.m2t.common.recipe.astChecks"/><plugin id="org.eclipse.m2t.common.recipe.simpleChecks"/><plugin id="org.eclipse.m2t.common.recipe.ui"/><plugin id="org.eclipse.m2t.common.recipe.workflow"/><plugin id="org.eclipse.xpand"/><plugin id="org.eclipse.xpand.ui"/><plugin id="org.eclipse.xtend"/><plugin id="org.eclipse.xtend.check.ui"/><plugin id="org.eclipse.xtend.shared.ui"/><plugin id="org.eclipse.xtend.typesystem.emf"/><plugin id="org.eclipse.xtend.typesystem.emf.ui"/><plugin id="org.eclipse.xtend.typesystem.uml2"/><plugin id="org.eclipse.xtend.typesystem.uml2.ui"/><plugin id="org.eclipse.xtend.ui"/><plugin id="org.eclipse.xtend.util.stdlib"/></javadoc></extension></plugin> \ No newline at end of file
+<plugin provider-name="Eclipse.org" version="1.0" id="org.eclipse.xpand.doc" name="Xpand core documentation (Incubation)">
+<extension point="org.eclipse.help.toc">
+<toc primary="true" file="toc.xml"/>
+</extension>
+</plugin>
diff --git a/doc/org.eclipse.xpand.doc/src/5.0/content/xpand_reference.xml b/doc/org.eclipse.xpand.doc/src/5.0/content/xpand_reference.xml
index 1662ed6..d8d66fb 100644
--- a/doc/org.eclipse.xpand.doc/src/5.0/content/xpand_reference.xml
+++ b/doc/org.eclipse.xpand.doc/src/5.0/content/xpand_reference.xml
@@ -2838,7 +2838,4 @@
&lt;&lt;ENDAROUND&gt;&gt;</programlisting>
</section>
</section>
-
- <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
- href="../content/builtin_api.xml"/>
</chapter> \ No newline at end of file
diff --git a/doc/org.eclipse.xpand.doc/src/styles/css/book.css b/doc/org.eclipse.xpand.doc/src/styles/css/book.css
new file mode 100644
index 0000000..a8a6b28
--- /dev/null
+++ b/doc/org.eclipse.xpand.doc/src/styles/css/book.css
@@ -0,0 +1,227 @@
+pre.programlisting {
+ display: block;
+ text-align: left;
+ text-indent: 0.00pt;
+ margin-top: 0.000000pt;
+ margin-bottom: 0.000000pt;
+ margin-right: 0.000000pt;
+ margin-left: 15pt;
+ font-size: 10.000000pt;
+ font-weight: medium;
+ font-style: Regular;
+ color: #4444CC;
+ text-decoration: none;
+ vertical-align: baseline;
+ text-transform: none;
+ font-family: "Courier New";
+}
+
+P.Code {
+ display: block;
+ text-align: left;
+ text-indent: 0.00pt;
+ margin-top: 0.000000pt;
+ margin-bottom: 0.000000pt;
+ margin-right: 0.000000pt;
+ margin-left: 15pt;
+ font-size: 10.000000pt;
+ font-weight: medium;
+ font-style: Regular;
+ color: #4444CC;
+ text-decoration: none;
+ vertical-align: baseline;
+ text-transform: none;
+ font-family: "Courier New";
+}
+
+H6.CaptionFigColumn {
+ display: block;
+ text-align: left;
+ text-indent: 0.000000pt;
+ margin-top: 3.000000pt;
+ margin-bottom: 11.000000pt;
+ margin-right: 0.000000pt;
+ margin-left: 0.000000pt;
+ font-size: 9.000000pt;
+ font-weight: medium;
+ font-style: Italic;
+ color: #000000;
+ text-decoration: none;
+ vertical-align: baseline;
+ text-transform: none;
+ font-family: "Arial";
+}
+
+P.Note {
+ display: block;
+ text-align: left;
+ text-indent: 0pt;
+ margin-top: 19.500000pt;
+ margin-bottom: 19.500000pt;
+ margin-right: 0.000000pt;
+ margin-left: 30pt;
+ font-size: 11.000000pt;
+ font-weight: medium;
+ font-style: Italic;
+ color: #000000;
+ text-decoration: none;
+ vertical-align: baseline;
+ text-transform: none;
+ font-family: "Arial";
+}
+
+EM.UILabel {
+ font-weight: Bold;
+ font-style: Regular;
+ text-decoration: none;
+ vertical-align: baseline;
+ text-transform: none;
+}
+
+EM.CodeName {
+ font-weight: Bold;
+ font-style: Regular;
+ text-decoration: none;
+ vertical-align: baseline;
+ text-transform: none;
+ font-family: "Courier New";
+}
+
+SPAN.NoWrap {
+ white-space: nowrap;
+}
+
+/* following font face declarations need to be removed for DBCS */
+body,h1,h2,h3,h4,h5,h6,p,table,td,caption,th,ul,ol,dl,li,dd,dt {
+ font-family: Arial, Helvetica, sans-serif;
+ color: #000000
+}
+
+pre {
+ font-family: Courier, monospace
+}
+
+/* end font face declarations */
+ /* following font size declarations should be OK for DBCS */
+body,h1,h2,h3,h4,h5,h6,p,table,td,caption,th,ul,ol,dl,li,dd,dt {
+ font-size: 10pt;
+}
+
+pre {
+ font-size: 10pt
+}
+
+/* end font size declarations */
+body {
+ background: #FFFFFF
+}
+
+h1 {
+ font-size: 18pt;
+ margin-top: 5;
+ margin-bottom: 1
+}
+
+h2 {
+ font-size: 14pt;
+ margin-top: 25;
+ margin-bottom: 3
+}
+
+h3 {
+ font-size: 11pt;
+ margin-top: 20;
+ margin-bottom: 3
+}
+
+h4 {
+ font-size: 10pt;
+ margin-top: 20;
+ margin-bottom: 3;
+ font-style: italic
+}
+
+p {
+ margin-top: 10px;
+ margin-bottom: 10px
+}
+
+pre {
+ margin-left: 6;
+ font-size: 9pt
+}
+
+a:link {
+ color: #0000FF
+}
+
+a:hover {
+ color: #000080
+}
+
+a:visited {
+ text-decoration: underline
+}
+
+ul {
+ margin-top: 0;
+ margin-bottom: 10
+}
+
+li {
+ margin-top: 0;
+ margin-bottom: 0
+}
+
+li p {
+ margin-top: 0;
+ margin-bottom: 0
+}
+
+ol {
+ margin-top: 0;
+ margin-bottom: 10
+}
+
+dl {
+ margin-top: 0;
+ margin-bottom: 10
+}
+
+dt {
+ margin-top: 0;
+ margin-bottom: 0;
+ font-weight: bold
+}
+
+dd {
+ margin-top: 0;
+ margin-bottom: 0
+}
+
+strong {
+ font-weight: bold
+}
+
+em {
+ font-style: italic
+}
+
+var {
+ font-style: italic
+}
+
+div.revision {
+ border-left-style: solid;
+ border-left-width: thin;
+ border-left-color: #7B68EE;
+ padding-left: 5
+}
+
+th {
+ font-weight: bold
+}
+
+xxtd{
+ border-top:2px solid black;
+} \ No newline at end of file
diff --git a/doc/org.eclipse.xpand.doc/src/styles/xslt/custom_eclipse.xsl b/doc/org.eclipse.xpand.doc/src/styles/xslt/custom_eclipse.xsl
new file mode 100644
index 0000000..6ca3beb
--- /dev/null
+++ b/doc/org.eclipse.xpand.doc/src/styles/xslt/custom_eclipse.xsl
@@ -0,0 +1,77 @@
+<?xml version="1.0"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+
+ <xsl:import href="eclipse.xsl" />
+ <xsl:output method="xml" indent="yes" encoding="ISO-8859-1" omit-xml-declaration="yes" />
+
+ <xsl:param name="html.stylesheet">../book.css</xsl:param>
+ <xsl:param name="chunk.first.sections" select="0" />
+ <xsl:param name="chunk.section.depth" select="1" />
+ <xsl:param name="base.dir" select="'contents/'"></xsl:param>
+ <xsl:param name="use.id.as.filename" select="1" />
+ <xsl:param name="suppress.navigation" select="1" />
+ <xsl:param name="chapter.autolabel" select="0" />
+ <xsl:param name="generate.section.toc.level" select="1"></xsl:param>
+ <xsl:param name="toc.max.depth">1</xsl:param>
+ <xsl:param name="table.borders.with.css" select="1"></xsl:param>
+ <xsl:param name="table.cell.border.color" select="'#000000'"></xsl:param>
+ <xsl:param name="table.cell.border.thickness" select="'2'"></xsl:param>
+ <xsl:param name="html.cellspacing" select="'0'"></xsl:param>
+ <xsl:param name="html.cellpadding" select="'10'"></xsl:param>
+
+ <xsl:param name="html.cleanup" select="1"></xsl:param>
+
+ <xsl:param name="generate.toc">
+ appendix toc,title
+ article/appendix nop
+ article toc,title
+ book nop
+ chapter toc
+ part toc
+ preface toc,title
+ qandadiv toc
+ qandaset toc
+ reference toc,title
+ sect1 nop
+ sect2 nop
+ sect3 nop
+ sect4 nop
+ sect5 nop
+ section nop
+ set toc,title
+ </xsl:param>
+
+ <xsl:param name="eclipse.plugin.extensions">
+ <![CDATA[
+ <extension
+ point="org.eclipse.ui.intro.configExtension">
+ <configExtension
+ configId="org.eclipse.ui.intro.universalConfig"
+ content="intro/overviewExtensionContext.xml">
+ </configExtension>
+ <configExtension
+ configId="org.eclipse.ui.intro.universalConfig"
+ content="intro/newsExtensionContext.xml">
+ </configExtension>
+ <configExtension
+ configId="org.eclipse.ui.intro.universalConfig"
+ content="intro/tutorialsExtensionContext.xml">
+ </configExtension>
+ </extension>
+ <extension
+ point="org.eclipse.ui.cheatsheets.cheatSheetContent">
+ <category
+ id="org.openarchitectureware"
+ name="openArchitectureWare"/>
+ <cheatsheet
+ category="org.openarchitectureware"
+ composite="false"
+ contentFile="$nl$/cheatsheets/CreatingAnOAWProject.xml"
+ id="org.openarchitectureware.create.project.oaw"
+ name="Creating an oAW generator project">
+ </cheatsheet>
+ </extension>
+ ]]>
+ </xsl:param>
+
+</xsl:stylesheet> \ No newline at end of file
diff --git a/doc/org.eclipse.xpand.doc/src/styles/xslt/fopdf.xsl b/doc/org.eclipse.xpand.doc/src/styles/xslt/fopdf.xsl
new file mode 100644
index 0000000..3a31e5f
--- /dev/null
+++ b/doc/org.eclipse.xpand.doc/src/styles/xslt/fopdf.xsl
@@ -0,0 +1,523 @@
+<?xml version="1.0"?>
+
+<!--
+
+ This is the XSL FO configuration file for the openArchitectureWare
+ Reference Documentation. It defines a custom titlepage and
+ the parameters for the A4 sized PDF printable output.
+
+ This stylesheet is a customized version of the stylesheet Christian
+ Bauer wrote for Hibernate, so here is due credit to Christian. You can
+ contact him at: christian.bauer@bluemars.de
+
+ This version of the stylesheet works with Apache FOP 0.93 and has been
+ tuned by Peter Friese (peter.friese@gentleware.org).
+-->
+
+<!DOCTYPE xsl:stylesheet [
+ <!ENTITY db_xsl_path "../../../lib/docbook/xsl">
+ <!ENTITY admon_gfx_path "../images/admons/">
+ <!ENTITY copyright "&#xA9;">
+]>
+
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ version="1.0"
+ xmlns="http://www.w3.org/TR/xhtml1/transitional"
+ xmlns:fo="http://www.w3.org/1999/XSL/Format"
+ exclude-result-prefixes="#default">
+
+<xsl:import href="&db_xsl_path;/fo/docbook.xsl"/>
+
+<!--###################################################
+ Custom Title Page
+ ################################################### -->
+<!-- Define the margins, background image for the cover page -->
+ <xsl:template name="user.pagemasters">
+ <fo:page-sequence-master master-name="coversequence">
+ <fo:repeatable-page-master-alternatives>
+ <fo:conditional-page-master-reference master-reference="my.titlepage" page-position="first"/>
+ <fo:conditional-page-master-reference master-reference="my.titlepage" odd-or-even="odd"/>
+ <fo:conditional-page-master-reference master-reference="my.titlepage" odd-or-even="even"/>
+ <fo:conditional-page-master-reference master-reference="blank" blank-or-not-blank="blank"/>
+ </fo:repeatable-page-master-alternatives>
+ </fo:page-sequence-master>
+ <fo:simple-page-master master-name="my.titlepage"
+ page-width="{$page.width}"
+ page-height="{$page.height}"
+ margin-top="0"
+ margin-bottom="0"
+ margin-left="{$page.margin.inner}"
+ margin-right="{$page.margin.outer}">
+ <fo:region-body margin-bottom="0"
+ margin-top="0"
+ column-count="{$column.count.titlepage}">
+ </fo:region-body>
+ <fo:region-before region-name="xsl-region-before-even"
+ extent="0"
+ display-align="before"/>
+ <fo:region-after region-name="xsl-region-after-even"
+ extent="0"
+ display-align="after"/>
+ </fo:simple-page-master>
+
+ </xsl:template>
+ <xsl:template name="select.user.pagemaster">
+ <xsl:param name="element"/>
+ <xsl:param name="pageclass"/>
+ <xsl:param name="default-pagemaster"/>
+ <xsl:choose>
+ <xsl:when test="$element = 'book' and $pageclass = 'titlepage'">
+ <xsl:value-of select="'coversequence'"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$default-pagemaster"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <xsl:template name="book.titlepage.recto">
+ <fo:block>
+ <fo:table table-layout="fixed" width="175mm">
+ <fo:table-column column-width="175mm"/>
+ <fo:table-body>
+ <fo:table-row>
+ <fo:table-cell text-align="center">
+ <fo:block>
+ <fo:external-graphic src="file:images/logo/building.jpg" content-width="21cm"/>
+ </fo:block>
+ </fo:table-cell>
+ </fo:table-row>
+ <fo:table-row>
+ <fo:table-cell text-align="right">
+ <fo:block font-family="Helvetica" font-size="22pt" padding-before="25mm">
+ <xsl:value-of select="title"/>
+ </fo:block>
+ <fo:block font-family="Helvetica" font-size="12pt">
+ <xsl:value-of select="bookinfo/releaseinfo"/>
+ </fo:block>
+ </fo:table-cell>
+ </fo:table-row>
+ <fo:table-row>
+ <fo:table-cell text-align="right">
+ <fo:block padding-before="50mm">
+ <fo:external-graphic src="file:images/logo/logo.tif" />
+ </fo:block>
+ </fo:table-cell>
+ </fo:table-row>
+ </fo:table-body>
+ </fo:table>
+ </fo:block>
+ </xsl:template>
+
+ <!-- Prevent blank pages in output -->
+ <xsl:template name="book.titlepage.before.verso">
+ </xsl:template>
+ <xsl:template name="book.titlepage.verso">
+ <fo:block>
+ <fo:table table-layout="fixed" width="175mm">
+ <fo:table-column column-width="175mm"/>
+ <fo:table-body>
+ <fo:table-row>
+ <fo:table-cell text-align="center">
+ <fo:block font-family="Helvetica" font-size="14pt" padding-before="200mm">
+ <xsl:value-of select="bookinfo/pubdate"/>
+ </fo:block>
+ </fo:table-cell>
+ </fo:table-row>
+ <fo:table-row>
+ <fo:table-cell text-align="center">
+ <fo:block font-family="Helvetica" font-size="12pt" padding="10mm">
+ <xsl:text>Copyright &copyright; 2004-2008 </xsl:text>
+ <xsl:for-each select="bookinfo/authorgroup/author">
+ <xsl:if test="position() > 1">
+ <xsl:text>, </xsl:text>
+ </xsl:if>
+ <xsl:value-of select="firstname"/>
+ <xsl:text> </xsl:text>
+ <xsl:value-of select="surname"/>
+ </xsl:for-each>
+ </fo:block>
+ <fo:block font-family="Helvetica" font-size="10pt" padding="1mm">
+ <xsl:value-of select="bookinfo/legalnotice"/>
+ </fo:block>
+ </fo:table-cell>
+ </fo:table-row>
+ </fo:table-body>
+ </fo:table>
+ </fo:block>
+ </xsl:template>
+ <xsl:template name="book.titlepage.separator">
+ </xsl:template>
+
+<!--###################################################
+ Header
+ ################################################### -->
+
+ <!-- More space in the center header for long text -->
+ <xsl:attribute-set name="header.content.properties">
+ <xsl:attribute name="font-family">
+ <xsl:value-of select="$body.font.family"/>
+ </xsl:attribute>
+ </xsl:attribute-set>
+
+<!--###################################################
+ Custom Footer
+ ################################################### -->
+
+ <!-- This footer prints the Spring Framework version number on the left side -->
+ <xsl:template name="footer.content">
+ <xsl:param name="pageclass" select="''"/>
+ <xsl:param name="sequence" select="''"/>
+ <xsl:param name="position" select="''"/>
+ <xsl:param name="gentext-key" select="''"/>
+
+ <xsl:variable name="Version">
+ <xsl:choose>
+ <xsl:when test="//releaseinfo">
+ <xsl:text>oAW </xsl:text><xsl:value-of select="//releaseinfo"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <!-- nop -->
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+
+ <xsl:choose>
+ <xsl:when test="$sequence='blank'">
+ <xsl:choose>
+ <xsl:when test="$double.sided != 0 and $position = 'left'">
+ <xsl:value-of select="$Version"/>
+ </xsl:when>
+
+ <xsl:when test="$double.sided = 0 and $position = 'center'">
+ <!-- nop -->
+ </xsl:when>
+
+ <xsl:otherwise>
+ <fo:page-number/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+
+ <xsl:when test="$pageclass='titlepage'">
+ <!-- nop: other titlepage sequences have no footer -->
+ </xsl:when>
+
+ <xsl:when test="$double.sided != 0 and $sequence = 'even' and $position='left'">
+ <fo:page-number/>
+ </xsl:when>
+
+ <xsl:when test="$double.sided != 0 and $sequence = 'odd' and $position='right'">
+ <fo:page-number/>
+ </xsl:when>
+
+ <xsl:when test="$double.sided = 0 and $position='right'">
+ <fo:page-number/>
+ </xsl:when>
+
+ <xsl:when test="$double.sided != 0 and $sequence = 'odd' and $position='left'">
+ <xsl:value-of select="$Version"/>
+ </xsl:when>
+
+ <xsl:when test="$double.sided != 0 and $sequence = 'even' and $position='right'">
+ <xsl:value-of select="$Version"/>
+ </xsl:when>
+
+ <xsl:when test="$double.sided = 0 and $position='left'">
+ <xsl:value-of select="$Version"/>
+ </xsl:when>
+
+ <xsl:otherwise>
+ <!-- nop -->
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+<!--###################################################
+ Extensions
+ ################################################### -->
+
+ <!-- These extensions are required for table printing and other stuff -->
+ <xsl:param name="use.extensions">1</xsl:param>
+ <xsl:param name="tablecolumns.extension">0</xsl:param>
+ <xsl:param name="callout.extensions">1</xsl:param>
+ <!-- FOP provide only PDF Bookmarks at the moment -->
+ <xsl:param name="fop.extensions">0</xsl:param>
+ <xsl:param name="fop1.extensions">1</xsl:param>
+
+<!--###################################################
+ Table Of Contents
+ ################################################### -->
+
+ <!-- Generate the TOCs for named components only -->
+ <xsl:param name="generate.toc">
+ book toc,title,figure,table,example,equation
+ </xsl:param>
+
+ <!-- Show only Sections up to level 3 in the TOCs -->
+ <xsl:param name="toc.section.depth">2</xsl:param>
+
+ <!-- Dot and Whitespace as separator in TOC between Label and Title-->
+ <xsl:param name="autotoc.label.separator" select="'. '"/>
+
+
+<!--###################################################
+ Paper & Page Size
+ ################################################### -->
+
+ <!-- Paper type, no headers on blank pages, no double sided printing -->
+ <xsl:param name="paper.type" select="'A4'"/>
+ <xsl:param name="double.sided">0</xsl:param>
+ <xsl:param name="headers.on.blank.pages">0</xsl:param>
+ <xsl:param name="footers.on.blank.pages">0</xsl:param>
+
+ <!-- Space between paper border and content (chaotic stuff, don't touch) -->
+ <xsl:param name="page.margin.top">5mm</xsl:param>
+ <xsl:param name="region.before.extent">10mm</xsl:param>
+ <xsl:param name="body.margin.top">10mm</xsl:param>
+ <xsl:param name="body.margin.left">0mm</xsl:param>
+
+ <xsl:param name="body.margin.bottom">15mm</xsl:param>
+ <xsl:param name="region.after.extent">10mm</xsl:param>
+ <xsl:param name="page.margin.bottom">10mm</xsl:param>
+
+ <xsl:param name="page.margin.outer">18mm</xsl:param>
+ <xsl:param name="page.margin.inner">18mm</xsl:param>
+
+ <!-- No intendation of Titles -->
+ <xsl:param name="body.start.indent">0pc</xsl:param>
+ <xsl:param name="title.margin.left">0pc</xsl:param>
+
+<!--###################################################
+ Fonts & Styles
+ ################################################### -->
+
+ <!-- Left aligned text and no hyphenation -->
+ <xsl:param name="alignment">justify</xsl:param>
+ <xsl:param name="hyphenate">false</xsl:param>
+
+ <!-- Default Font size -->
+ <xsl:param name="body.font.master">11</xsl:param>
+ <xsl:param name="body.font.small">8</xsl:param>
+
+ <!-- Line height in body text -->
+ <xsl:param name="line-height">1.4</xsl:param>
+
+ <!-- Monospaced fonts are smaller than regular text -->
+ <xsl:attribute-set name="monospace.properties">
+ <xsl:attribute name="font-family">
+ <xsl:value-of select="$monospace.font.family"/>
+ </xsl:attribute>
+ <xsl:attribute name="font-size">0.8em</xsl:attribute>
+ </xsl:attribute-set>
+
+<!--###################################################
+ Tables
+ ################################################### -->
+
+ <!-- The table width should be adapted to the paper size -->
+ <xsl:param name="default.table.width">17.4cm</xsl:param>
+
+ <!-- Some padding inside tables -->
+ <xsl:attribute-set name="table.cell.padding">
+ <xsl:attribute name="padding-left">0pt</xsl:attribute>
+ <xsl:attribute name="padding-right">0pt</xsl:attribute>
+ <xsl:attribute name="padding-top">0pt</xsl:attribute>
+ <xsl:attribute name="padding-bottom">0pt</xsl:attribute>
+ </xsl:attribute-set>
+
+ <!-- Only hairlines as frame and cell borders in tables -->
+ <xsl:param name="table.frame.border.thickness">1pt</xsl:param>
+ <xsl:param name="table.cell.border.thickness">1pt</xsl:param>
+
+<!--###################################################
+ Labels
+ ################################################### -->
+
+ <!-- Label Chapters and Sections (numbering) -->
+ <xsl:param name="chapter.autolabel">1</xsl:param>
+ <xsl:param name="section.autolabel" select="1"/>
+ <xsl:param name="section.label.includes.component.label" select="1"/>
+
+<!--###################################################
+ Titles
+ ################################################### -->
+
+ <!-- Chapter title size -->
+ <xsl:attribute-set name="chapter.titlepage.recto.style">
+ <xsl:attribute name="text-align">left</xsl:attribute>
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
+ <xsl:attribute name="font-size">
+ <xsl:value-of select="$body.font.master * 1.8"/>
+ <xsl:text>pt</xsl:text>
+ </xsl:attribute>
+ </xsl:attribute-set>
+
+ <!-- Why is the font-size for chapters hardcoded in the XSL FO templates?
+ Let's remove it, so this sucker can use our attribute-set only... -->
+ <xsl:template match="title" mode="chapter.titlepage.recto.auto.mode">
+ <fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format"
+ xsl:use-attribute-sets="chapter.titlepage.recto.style">
+ <xsl:call-template name="component.title">
+ <xsl:with-param name="node" select="ancestor-or-self::chapter[1]"/>
+ </xsl:call-template>
+ </fo:block>
+ </xsl:template>
+
+ <!-- Sections 1, 2 and 3 titles have a small bump factor and padding -->
+ <xsl:attribute-set name="section.title.level1.properties">
+ <xsl:attribute name="space-before.optimum">0.8em</xsl:attribute>
+ <xsl:attribute name="space-before.minimum">0.8em</xsl:attribute>
+ <xsl:attribute name="space-before.maximum">0.8em</xsl:attribute>
+ <xsl:attribute name="font-size">
+ <xsl:value-of select="$body.font.master * 1.5"/>
+ <xsl:text>pt</xsl:text>
+ </xsl:attribute>
+ <xsl:attribute name="space-after.optimum">0.1em</xsl:attribute>
+ <xsl:attribute name="space-after.minimum">0.1em</xsl:attribute>
+ <xsl:attribute name="space-after.maximum">0.1em</xsl:attribute>
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
+ </xsl:attribute-set>
+ <xsl:attribute-set name="section.title.level2.properties">
+ <xsl:attribute name="space-before.optimum">0.6em</xsl:attribute>
+ <xsl:attribute name="space-before.minimum">0.6em</xsl:attribute>
+ <xsl:attribute name="space-before.maximum">0.6em</xsl:attribute>
+ <xsl:attribute name="font-size">
+ <xsl:value-of select="$body.font.master * 1.25"/>
+ <xsl:text>pt</xsl:text>
+ </xsl:attribute>
+ <xsl:attribute name="space-after.optimum">0.1em</xsl:attribute>
+ <xsl:attribute name="space-after.minimum">0.1em</xsl:attribute>
+ <xsl:attribute name="space-after.maximum">0.1em</xsl:attribute>
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
+ </xsl:attribute-set>
+ <xsl:attribute-set name="section.title.level3.properties">
+ <xsl:attribute name="space-before.optimum">0.4em</xsl:attribute>
+ <xsl:attribute name="space-before.minimum">0.4em</xsl:attribute>
+ <xsl:attribute name="space-before.maximum">0.4em</xsl:attribute>
+ <xsl:attribute name="font-size">
+ <xsl:value-of select="$body.font.master * 1.0"/>
+ <xsl:text>pt</xsl:text>
+ </xsl:attribute>
+ <xsl:attribute name="space-after.optimum">0.1em</xsl:attribute>
+ <xsl:attribute name="space-after.minimum">0.1em</xsl:attribute>
+ <xsl:attribute name="space-after.maximum">0.1em</xsl:attribute>
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
+ </xsl:attribute-set>
+
+ <!-- Titles of formal objects (tables, examples, ...) -->
+ <xsl:attribute-set name="formal.title.properties" use-attribute-sets="normal.para.spacing">
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
+ <xsl:attribute name="font-size">
+ <xsl:value-of select="$body.font.master"/>
+ <xsl:text>pt</xsl:text>
+ </xsl:attribute>
+ <xsl:attribute name="hyphenate">false</xsl:attribute>
+ <xsl:attribute name="space-after.minimum">0.4em</xsl:attribute>
+ <xsl:attribute name="space-after.optimum">0.6em</xsl:attribute>
+ <xsl:attribute name="space-after.maximum">0.8em</xsl:attribute>
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
+ </xsl:attribute-set>
+
+<!--###################################################
+ Programlistings
+ ################################################### -->
+
+ <!-- Verbatim text formatting (programlistings) -->
+ <xsl:attribute-set name="monospace.verbatim.properties">
+ <xsl:attribute name="font-size">
+ <xsl:value-of select="$body.font.small * 1.0"/>
+ <xsl:text>pt</xsl:text>
+ </xsl:attribute>
+ <xsl:attribute name="keep-together.within-column">always</xsl:attribute>
+ </xsl:attribute-set>
+
+ <xsl:attribute-set name="verbatim.properties">
+ <xsl:attribute name="space-before.minimum">1em</xsl:attribute>
+ <xsl:attribute name="space-before.optimum">1em</xsl:attribute>
+ <xsl:attribute name="space-before.maximum">1em</xsl:attribute>
+ <xsl:attribute name="border-color">#444444</xsl:attribute>
+ <xsl:attribute name="border-style">solid</xsl:attribute>
+ <xsl:attribute name="border-width">0.5pt</xsl:attribute>
+ <xsl:attribute name="padding-top">0.5em</xsl:attribute>
+ <xsl:attribute name="padding-left">0.5em</xsl:attribute>
+ <xsl:attribute name="padding-right">0.5em</xsl:attribute>
+ <xsl:attribute name="padding-bottom">0.5em</xsl:attribute>
+ <xsl:attribute name="margin-left">0.5em</xsl:attribute>
+ <xsl:attribute name="margin-right">0.5em</xsl:attribute>
+ </xsl:attribute-set>
+
+ <!-- Shade (background) programlistings -->
+ <xsl:param name="shade.verbatim">1</xsl:param>
+ <xsl:attribute-set name="shade.verbatim.style">
+ <xsl:attribute name="background-color">#F0F0F0</xsl:attribute>
+ </xsl:attribute-set>
+
+<!--###################################################
+ Callouts
+ ################################################### -->
+
+ <!-- Use images for callouts instead of (1) (2) (3) -->
+ <xsl:param name="callout.graphics">0</xsl:param>
+ <xsl:param name="callout.unicode">1</xsl:param>
+
+ <!-- Place callout marks at this column in annotated areas -->
+ <xsl:param name="callout.defaultcolumn">90</xsl:param>
+
+<!--###################################################
+ Admonitions
+ ################################################### -->
+
+ <!-- Use nice graphics for admonitions -->
+ <xsl:param name="admon.graphics">'1'</xsl:param>
+ <xsl:param name="admon.graphics.path">&admon_gfx_path;</xsl:param>
+
+<!--###################################################
+ Misc
+ ################################################### -->
+
+ <!-- Placement of titles -->
+ <xsl:param name="formal.title.placement">
+ figure after
+ example before
+ equation before
+ table before
+ procedure before
+ </xsl:param>
+
+ <!-- arrow between menu items -->
+ <xsl:param name="menuchoice.menu.separator"> -&gt; </xsl:param>
+
+ <!-- Format Variable Lists as Blocks (prevents horizontal overflow) -->
+ <xsl:param name="variablelist.as.blocks">1</xsl:param>
+
+ <!-- The horrible list spacing problems -->
+ <xsl:attribute-set name="list.block.spacing">
+ <xsl:attribute name="space-before.optimum">0.8em</xsl:attribute>
+ <xsl:attribute name="space-before.minimum">0.8em</xsl:attribute>
+ <xsl:attribute name="space-before.maximum">0.8em</xsl:attribute>
+ <xsl:attribute name="space-after.optimum">0.1em</xsl:attribute>
+ <xsl:attribute name="space-after.minimum">0.1em</xsl:attribute>
+ <xsl:attribute name="space-after.maximum">0.1em</xsl:attribute>
+ </xsl:attribute-set>
+
+<!--###################################################
+ colored and hyphenated links
+ ################################################### -->
+ <xsl:template match="ulink">
+ <fo:basic-link external-destination="{@url}"
+ xsl:use-attribute-sets="xref.properties"
+ text-decoration="underline"
+ color="blue">
+ <xsl:choose>
+ <xsl:when test="count(child::node())=0">
+ <xsl:value-of select="@url"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:apply-templates/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </fo:basic-link>
+ </xsl:template>
+
+</xsl:stylesheet> \ No newline at end of file
diff --git a/doc/org.eclipse.xpand.doc/src/styles/xslt/html.xsl b/doc/org.eclipse.xpand.doc/src/styles/xslt/html.xsl
new file mode 100644
index 0000000..5b2bbdb
--- /dev/null
+++ b/doc/org.eclipse.xpand.doc/src/styles/xslt/html.xsl
@@ -0,0 +1,44 @@
+<?xml version="1.0"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+
+ <xsl:import href="file:../../../lib/docbook/xsl/html/chunk.xsl" />
+ <xsl:output method="xml" indent="yes" encoding="ISO-8859-1" omit-xml-declaration="yes" />
+
+ <xsl:param name="html.stylesheet">../book.css</xsl:param>
+ <xsl:param name="chunk.first.sections" select="0" />
+ <xsl:param name="chunk.section.depth" select="0" />
+ <xsl:param name="base.dir" select="'contents/'"></xsl:param>
+ <xsl:param name="use.id.as.filename" select="1" />
+ <xsl:param name="suppress.navigation" select="0" />
+ <xsl:param name="chapter.autolabel" select="0" />
+ <xsl:param name="generate.section.toc.level" select="1"></xsl:param>
+ <xsl:param name="toc.max.depth">1</xsl:param>
+ <xsl:param name="table.borders.with.css" select="1"></xsl:param>
+ <xsl:param name="table.cell.border.color" select="'#000000'"></xsl:param>
+ <xsl:param name="table.cell.border.thickness" select="'2'"></xsl:param>
+ <xsl:param name="html.cellspacing" select="'0'"></xsl:param>
+ <xsl:param name="html.cellpadding" select="'10'"></xsl:param>
+
+ <xsl:param name="html.cleanup" select="1"></xsl:param>
+
+ <xsl:param name="generate.toc">
+ appendix toc,title
+ article/appendix nop
+ article toc,title
+ book toc
+ chapter toc
+ part toc
+ preface toc,title
+ qandadiv toc
+ qandaset toc
+ reference toc,title
+ sect1 nop
+ sect2 nop
+ sect3 nop
+ sect4 nop
+ sect5 nop
+ section nop
+ set toc,title
+ </xsl:param>
+
+</xsl:stylesheet> \ No newline at end of file
diff --git a/doc/org.eclipse.xpand.doc/toc.xml b/doc/org.eclipse.xpand.doc/toc.xml
index 09f2734..593550b 100644
--- a/doc/org.eclipse.xpand.doc/toc.xml
+++ b/doc/org.eclipse.xpand.doc/toc.xml
@@ -1,6 +1,137 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?NLS TYPE="org.eclipse.help.toc"?>
-
-<toc label="M2T _SUBPROJECTNAME_ Table of Contents">
- <topic label="Javadoc" href="references/javadoc/index.html"/>
+<toc topic="contents/index.html" label="Check / Xtend / Xpand Reference">
+<topic href="contents/index.html#r10_introduction" label="Introduction"/>
+<topic href="contents/r10_typesystem.html" label="Type System">
+<topic href="contents/r10_typesystem.html#r10_typesystem_types" label="Types">
+<topic href="contents/r10_typesystem.html#r10_typesystem_typenames" label="Type Names"/>
+<topic href="contents/r10_typesystem.html#r10_typesystem_collection_typenames" label="Collection Type Names"/>
+<topic href="contents/r10_typesystem.html#r10_typesystem_features" label="Features"/>
+</topic>
+<topic href="contents/r10_typesystem.html#r10_builtintypes" label="Built-In Types">
+<topic href="contents/r10_typesystem.html#r10_builtintypes_object" label="Object"/>
+<topic href="contents/r10_typesystem.html#r10_builtintypes_void" label="Void"/>
+<topic href="contents/r10_typesystem.html#r10_builtintypes_simple" label="Simple types (Data types)"/>
+<topic href="contents/r10_typesystem.html#r10_builtintypes_collections" label="Collection types"/>
+<topic href="contents/r10_typesystem.html#r10_builtintypes_typesystem_types" label="Type system types"/>
+</topic>
+<topic href="contents/r10_typesystem.html#r10_metamodel_implementations" label="Metamodel Implementations (also known as Meta-Metamodels)">
+<topic href="contents/r10_typesystem.html#r10_metamodel_example_java" label="Example JavaMetaModel"/>
+<topic href="contents/r10_typesystem.html#r10_metamodel_contributors" label="Eclipse IDE MetaModelContributors"/>
+<topic href="contents/r10_typesystem.html#r10_metamodel_workflow" label="Configuring Metamodel implementations with the workflow"/>
+</topic>
+<topic href="contents/r10_typesystem.html#r10_using_different_metamodels" label="Using different Metamodel implementations (also known as Meta-Metamodels)"/>
+</topic>
+<topic href="contents/r10_expressions_language.html" label="Expressions">
+<topic href="contents/r10_expressions_language.html#r10_expressions_builtin" label="Literals and special operators for built-in types">
+<topic href="contents/r10_expressions_language.html#r10_expressions_builtin_object" label="Object"/>
+<topic href="contents/r10_expressions_language.html#r10_expressions_builtin_void" label="Void"/>
+<topic href="contents/r10_expressions_language.html#r10_expressions_builtin_typeliterals" label="Type literals"/>
+<topic href="contents/r10_expressions_language.html#r10_expressions_builtin_staticproperties" label="StaticProperty literals"/>
+<topic href="contents/r10_expressions_language.html#r10_expressions_builtin_string" label="String"/>
+<topic href="contents/r10_expressions_language.html#r10_expressions_builtin_boolean" label="Boolean"/>
+<topic href="contents/r10_expressions_language.html#r10_expressions_builtin_numeric" label="Integer and Real"/>
+<topic href="contents/r10_expressions_language.html#r10_expressions_builtin_collections" label="Collections"/>
+</topic>
+<topic href="contents/r10_expressions_language.html#r10_expressions_collection_operations" label="Special Collection operations">
+<topic href="contents/r10_expressions_language.html#r10_expressions_collection_select" label="select"/>
+<topic href="contents/r10_expressions_language.html#r10_expressions_collection_typeselect" label="typeSelect"/>
+<topic href="contents/r10_expressions_language.html#r10_expressions_collection_reject" label="reject"/>
+<topic href="contents/r10_expressions_language.html#r10_expressions_collection_collect" label="collect"/>
+<topic href="contents/r10_expressions_language.html#r10_expressions_collection_collect_shorthand" label="Shorthand for collect (and more than that)"/>
+<topic href="contents/r10_expressions_language.html#r10_expressions_collection_forall" label="forAll"/>
+<topic href="contents/r10_expressions_language.html#r10_expressions_collection_exists" label="exists"/>
+<topic href="contents/r10_expressions_language.html#r10_expressions_collection_sortby" label="sortBy"/>
+</topic>
+<topic href="contents/r10_expressions_language.html#r10_expressions_if" label="if expression"/>
+<topic href="contents/r10_expressions_language.html#r10_expressions_switch" label="switch expression"/>
+<topic href="contents/r10_expressions_language.html#r10_expressions_chain" label="Chain expression"/>
+<topic href="contents/r10_expressions_language.html#r10_expressions_create" label="create expression"/>
+<topic href="contents/r10_expressions_language.html#r10_expressions_let" label="let expression"/>
+<topic href="contents/r10_expressions_language.html#r10_expressions_globalvar" label="'GLOBALVAR' expression">
+<topic href="contents/r10_expressions_language.html#r10_expressions_globalvar_workflow" label="Using GLOBALVARS to configure workflows"/>
+</topic>
+<topic href="contents/r10_expressions_language.html#r10_expressions_multidispatch" label="Multi methods (multiple dispatch)"/>
+<topic href="contents/r10_expressions_language.html#r10_expressions_casting" label="Casting"/>
+</topic>
+<topic href="contents/Check_language.html" label="Check"/>
+<topic href="contents/Xtend_language.html" label="Xtend">
+<topic href="contents/Xtend_language.html#N104BA" label="Extend files"/>
+<topic href="contents/Xtend_language.html#N104D0" label="Comments"/>
+<topic href="contents/Xtend_language.html#N104DB" label="Import Statements"/>
+<topic href="contents/Xtend_language.html#N104E8" label="Extension Import Statement">
+<topic href="contents/Xtend_language.html#N104F4" label="Reexporting Extensions"/>
+</topic>
+<topic href="contents/Xtend_language.html#N104FB" label="Extensions">
+<topic href="contents/Xtend_language.html#N10506" label="Extension Invocation"/>
+<topic href="contents/Xtend_language.html#N10517" label="Type Inference"/>
+<topic href="contents/Xtend_language.html#N10550" label="Recursion"/>
+<topic href="contents/Xtend_language.html#N10559" label="Cached Extensions"/>
+<topic href="contents/Xtend_language.html#N1056B" label="Private Extensions"/>
+</topic>
+<topic href="contents/Xtend_language.html#N10572" label="Java Extensions"/>
+<topic href="contents/Xtend_language.html#N10591" label="Create Extensions (Model Transformation)"/>
+<topic href="contents/Xtend_language.html#N105F3" label="Calling Extensions From Java"/>
+<topic href="contents/Xtend_language.html#N10619" label="WorkflowComponent"/>
+<topic href="contents/Xtend_language.html#N10629" label="Aspect-Oriented Programming in Xtend (since 4.2)">
+<topic href="contents/Xtend_language.html#N1063A" label="Join Point and Point Cut Syntax">
+<topic href="contents/Xtend_language.html#N10651" label="Extensions Name"/>
+<topic href="contents/Xtend_language.html#N1065B" label="Parameter Types"/>
+<topic href="contents/Xtend_language.html#N10666" label="Proceeding"/>
+</topic>
+<topic href="contents/Xtend_language.html#N10681" label="Workflow configuration"/>
+<topic href="contents/Xtend_language.html#xtend_example_introduction" label="Model-to-Model transformation with Xtend"/>
+<topic href="contents/Xtend_language.html#xtend_example_workflow" label="Workflow"/>
+<topic href="contents/Xtend_language.html#xtend_example_the_transformation" label="The Transformation"/>
+</topic>
+</topic>
+<topic href="contents/xpand_reference_introduction.html" label="Xpand2">
+<topic href="contents/xpand_reference_introduction.html#xpand_reference_template_files_and_ecoding" label="Template files and encoding"/>
+<topic href="contents/xpand_reference_introduction.html#xpand_reference_general_structure_of_template_files" label="General structure of template files"/>
+<topic href="contents/xpand_reference_introduction.html#xpand_reference_statements_of_the_expand_language" label="Statements of the Xpand language">
+<topic href="contents/xpand_reference_introduction.html#xpand_reference_import" label="IMPORT"/>
+<topic href="contents/xpand_reference_introduction.html#xpand_reference_extension" label="EXTENSION"/>
+<topic href="contents/xpand_reference_introduction.html#xpand_reference_define" label="DEFINE"/>
+<topic href="contents/xpand_reference_introduction.html#xpand_reference_file" label="FILE"/>
+<topic href="contents/xpand_reference_introduction.html#xpand_reference_expand" label="EXPAND">
+<topic href="contents/xpand_reference_introduction.html#xpand_reference_names" label="Names"/>
+</topic>
+<topic href="contents/xpand_reference_introduction.html#xpand_reference_for_vs_foreach" label="FOR vs. FOREACH">
+<topic href="contents/xpand_reference_introduction.html#xpand_reference_specifying_a_separator" label="Specifying a Separator"/>
+</topic>
+<topic href="contents/xpand_reference_introduction.html#xpand_reference_foreach" label="FOREACH"/>
+<topic href="contents/xpand_reference_introduction.html#xpand_reference_if" label="IF"/>
+<topic href="contents/xpand_reference_introduction.html#xpand_reference_protect" label="PROTECT"/>
+<topic href="contents/xpand_reference_introduction.html#xpand_reference_let" label="LET"/>
+<topic href="contents/xpand_reference_introduction.html#xpand_reference_error" label="ERROR"/>
+<topic href="contents/xpand_reference_introduction.html#xpand_reference_comments" label="Comments"/>
+<topic href="contents/xpand_reference_introduction.html#xpand_reference_expression_statement" label="Expression Statement"/>
+<topic href="contents/xpand_reference_introduction.html#xpand_reference_controlling_generation_of_white_space" label="Controlling generation of white space"/>
+</topic>
+<topic href="contents/xpand_reference_introduction.html#xpand_reference_aspect-oriented_programming_in_xpand" label="Aspect-Oriented Programming in Xpand">
+<topic href="contents/xpand_reference_introduction.html#xpand_reference_join_point_and_cut_syntax" label="Join Point and Point Cut Syntax">
+<topic href="contents/xpand_reference_introduction.html#xpand_reference_definition_name" label="Definition Name"/>
+<topic href="contents/xpand_reference_introduction.html#xpand_reference_parameter_types" label="Parameter Types"/>
+<topic href="contents/xpand_reference_introduction.html#xpand_reference_target_type" label="Target Type"/>
+</topic>
+<topic href="contents/xpand_reference_introduction.html#xpand_reference_proceeding" label="Proceeding"/>
+</topic>
+<topic href="contents/xpand_reference_introduction.html#xpand_reference_generator_workflow_component" label="Generator Workflow Component">
+<topic href="contents/xpand_reference_introduction.html#xpand_reference_main_configuration" label="Main configuration"/>
+<topic href="contents/xpand_reference_introduction.html#xpand_reference_encoding" label="Encoding"/>
+<topic href="contents/xpand_reference_introduction.html#xpand_reference_metamodel" label="Metamodel"/>
+<topic href="contents/xpand_reference_introduction.html#xpand_reference_output_configuration" label="Output configuration"/>
+<topic href="contents/xpand_reference_introduction.html#xpand_reference_beautifier" label="Beautifier">
+<topic href="contents/xpand_reference_introduction.html#xpand_reference_javabeautifier" label="JavaBeautifier"/>
+<topic href="contents/xpand_reference_introduction.html#xpand_reference_xmlbeautifier" label="XmlBeautifier"/>
+</topic>
+<topic href="contents/xpand_reference_introduction.html#xpand_reference_protected_region_configuration" label="Protected Region Configuration"/>
+</topic>
+<topic href="contents/xpand_reference_introduction.html#aop_template_introduction" label="Example for using Aspect-Oriented Programming in Xpand"/>
+<topic href="contents/xpand_reference_introduction.html#aop_template_the_problem" label="The Problem"/>
+<topic href="contents/xpand_reference_introduction.html#aop_template_example" label="Example">
+<topic href="contents/xpand_reference_introduction.html#aop_template_example_templates" label="Templates"/>
+<topic href="contents/xpand_reference_introduction.html#aop_template_example_workflow_file" label="Workflow File"/>
+<topic href="contents/xpand_reference_introduction.html#aop_template_example_running_the_new_generator" label="Running the new generator"/>
+</topic>
+<topic href="contents/xpand_reference_introduction.html#aop_template_more_ao" label="More Aspect Orientation"/>
+</topic>
</toc>
diff --git a/doc/org.eclipse.xpand.doc/topics_Reference.xml b/doc/org.eclipse.xpand.doc/topics_Reference.xml
deleted file mode 100644
index 5b34e44..0000000
--- a/doc/org.eclipse.xpand.doc/topics_Reference.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?NLS TYPE="org.eclipse.help.toc"?>
-<toc label="Reference">
- <topic label="API Reference" href="references/javadoc/overview-summary.html">
- </topic>
-</toc>
diff --git a/doc/org.eclipse.xpand.doc/xpand_reference.html b/doc/org.eclipse.xpand.doc/xpand_reference.html
new file mode 100644
index 0000000..8b13789
--- /dev/null
+++ b/doc/org.eclipse.xpand.doc/xpand_reference.html
@@ -0,0 +1 @@
+