Steven Reinisch, now studying at hasso-plattner-institute for software systems engineering, has added some cool refactorings to Xpand and Xtend languages of openArchitectureWare 4.3 during this year's Google Summer Of Code.
During the development he lived in Kiel in order to work in our office at itemis. He managed to understand the code base of Xpand more or less independently. It was a pleasure to work with him and I'm looking forward to future contributions from Steven (He said he's willing to do so :-)).
It's not sure where and how this work will be made available. If we don't put it into oAW 4.3.1, itemis will include it in the distros available at oaw.itemis.eu when it's finished.
Here's a screencast steven made.
Showing posts with label oAW. Show all posts
Showing posts with label oAW. Show all posts
Friday, August 08, 2008
Tuesday, June 10, 2008
Fowler's DSL example with Xtext
In his recent DSL related blog entries (ParseFear and Syntactic Noise), Martin Fowler mentioned a DSL example he's using in his upcoming DSL book. Here you can see how it is implemented using Antlr and a lot of Java.
This is how it can be done using Xtext and openArchitectureWare.
1) Download the oAW distro from itemis
2) Create a new Xtext Project
3) Paste the following Xtext grammar into the opened editor:
4) start the generator (right click on generate.oaw Run->oaw workflow)
your're done.
You not only get an Antlr based parser but also get an EMF based AST (SemanticModel), and a fully fledged eclipse editor.
Of course it's up to you whether you want to interpret models or generate some code out of them. I choosed to write a small Xpand template file, generating a "controller".
Here it is.
This is how it can be done using Xtext and openArchitectureWare.
1) Download the oAW distro from itemis
2) Create a new Xtext Project
3) Paste the following Xtext grammar into the opened editor:
Statemachine :
'events'
(events+=Event)*
'end'
'commands'
(commands+=Command)*
'end'
(states+=State)*;
Event :
(resetting?='resetting')? name=ID code=ID;
Command :
name=ID code=ID;
State :
'state' name=ID
('actions' '{' (actions+=[Command])+ '}')?
(transitions+=Transition)*
'end';
Transition :
event=[Event] '=>' state=[State];
4) start the generator (right click on generate.oaw Run->oaw workflow)
your're done.
You not only get an Antlr based parser but also get an EMF based AST (SemanticModel), and a fully fledged eclipse editor.
Of course it's up to you whether you want to interpret models or generate some code out of them. I choosed to write a small Xpand template file, generating a "controller".
Here it is.
Wednesday, April 16, 2008
Game development with oAW
Last week Jens Wagener posted a small riddle in his blog. He stated that it is claimed that 98% of all people are incapable of solving it.
To put it short: I didn't solve it. (Thank God! I'm not that freaky ;-))
But hey, as we're currently testing our next release of openArchitectureWare, I thought I should give it a try and do something which helps solving it (our at least help to understand that it is really hard to solve ;-)) using oAW.
So first I wrote a DSL implemented in Xtext and then I specified the constraints outlined in the riddle using Check. (At this point you should have read Jens' post so you can understand what I'm talking about)
Using the DSL one writes the attributes (Color, Role, Pet, Language and Magazine) for the five houses down, one house per line. As I said the constraints outlined in the riddle are implemented using Check. So if there are any of theses constraints violated the editor provides the appropriate feedback.
The puzzle is solved when all markers have gone and there are no more wildcards 'X' in it.
This is a screenshot, of the "game" implemented in oAW:

So if you want to play around with it, just drop me a mail, and please don't come up with boring rule engine solutions ;-)
To put it short: I didn't solve it. (Thank God! I'm not that freaky ;-))
But hey, as we're currently testing our next release of openArchitectureWare, I thought I should give it a try and do something which helps solving it (our at least help to understand that it is really hard to solve ;-)) using oAW.
So first I wrote a DSL implemented in Xtext and then I specified the constraints outlined in the riddle using Check. (At this point you should have read Jens' post so you can understand what I'm talking about)
Using the DSL one writes the attributes (Color, Role, Pet, Language and Magazine) for the five houses down, one house per line. As I said the constraints outlined in the riddle are implemented using Check. So if there are any of theses constraints violated the editor provides the appropriate feedback.
The puzzle is solved when all markers have gone and there are no more wildcards 'X' in it.
This is a screenshot, of the "game" implemented in oAW:

So if you want to play around with it, just drop me a mail, and please don't come up with boring rule engine solutions ;-)
Subscribe to:
Posts (Atom)