oAW4 beta1 available
Hi everybody,
we've released a first beta version of the upcoming oAW4 generator framework.
There are two new languages contained in this release. Additionally, the Eclipse editor support has been improved.
I've made a short presentation, showing some features. Have a look
Download the release from sourceforge : download
A short description of the new languages follows:
Maybe you've allready seen, that there is no return type specified for the first extension. That's because they can be derived from the expression.
The special thing is, that the static return type of such an extension depends on the context of use!
For instance, if you invoke the following extension
An example:
Mean: "ouput a WARNing for each instance of Eclass with zero structural features".
The syntax is:
Namespaces and extensions can be imported as shown above.
The Eclipse-Editor-Plugins for Xpand, Extend and Check have been improved significantely.
For now, we have static type checking, syntax highlighting and code completion.
we've released a first beta version of the upcoming oAW4 generator framework.
There are two new languages contained in this release. Additionally, the Eclipse editor support has been improved.
I've made a short presentation, showing some features. Have a look
Download the release from sourceforge : download
A short description of the new languages follows:
New Language: Extend
„Extend“ can be used to define arbritary libraries usable in every language based on the new oAW4-expressions sublanguage.
Here is an example:
import ecore; // imports the namespace 'ecore'
extension my::other::ExtensionFile; // imports all extensions from another extension file
/*
* computes the fully qualified name
*/
fullyQualifiedName(ENamedElement ele, String delim) :
ele.eContainer !=null ?
fullyQualifiedName(((ENamedElement)ele.eContainer),delim)+delim+ele.name :
ele.name
;
/*
* this extension points to a public static Java method
*/
String doIOStuff(String txt) :
JAVA my.JavaClass.staticMethod(java.lang.String)
;
As you can see, there are two different kinds of extensions:
The first one simply uses the new expressions to implement the behaviour of the extension. The second maps the extension signature to a public static Java method.
You shouldn't need the Java extensions very often, because most things can be done using expressions (IO stuff might be an exception).
Extensions can be invoked on member position
This means that you can either write
ele.fullyQualifiedName()
orfullyQualifiedName(ele)
Both do the same thing!Return types are inferred for expression extensions
Maybe you've allready seen, that there is no return type specified for the first extension. That's because they can be derived from the expression.
The special thing is, that the static return type of such an extension depends on the context of use!
For instance, if you invoke the following extension
asList(Object o): {o};
with a String, it's type is List[String].Validation language: Check
The second language is called „Check“ and is an equivalent to OCL.An example:
ctx EClass WARN
"An EClass should have at least one feature" :
this.eStructuralFeatures.size()==0
;
Mean: "ouput a WARNing for each instance of Eclass with zero structural features".
The syntax is:
“ctx“ typeName (WARN|ERR) msgExpression : condition ;
Namespaces and extensions can be imported as shown above.
The Eclipse-Editor-Plugins for Xpand, Extend and Check have been improved significantely.
For now, we have static type checking, syntax highlighting and code completion.

