2008-09-19

Agile Language Engineering Tutorial

This week, Guido Wachsmuth and I gave a tutorial at the University of Agder on using the tools MMUnit, EProvide, and TEF for agile language engineering. We described how to generate a prototype of a DSL with a test-first approach to metamodel development and with an operational semantics approach for describing the DSL's semantics.

As an example DSL, we used a very simple language for describing the behaviour of a telephone remote control system. The idea is that you can call the system with your mobile phone and use your phone's DTMF tones to control something remotely in your house. The DSL looks like this:
main {
say "main menu";
listen {
1: "control lights" -> lights;
}
}

lights {
say "your lights are";
say lights_status();
listen {
1: "switch your lights" -> switch_lights;
0: "return to main menu" -> main;
}
}

switch_lights {
lights_switch();
say "your lights are now";
say lights_status();
goto main;
}
You can find the slides of the tutorial here and here. There was also a handout that explains step-by-step how to create the DSL prototype. In this folder, there are some code snippets you may find useful if you want to go through this tutorial.
If you are lazy you can also just download the completed project or watch this screencast showing the prototype in action.

Keine Kommentare: