Create an Ecore Modeling Project (in the remainder we call the package MeeduseTuto)
Create a class Counter with a single-valued and mondatory attribute
Use the genmodel file to extract via EMF the model editor code.
Extraction of B models
Translate your meta-model in B: right click on your ECore file and select "Meeduse: Extract B models"
Three files are extracted:
MeeduseTuto.uml: is an extraction of a UML model from the ECore file.
MeeduseTuto.bmethod: is an instance of a B meta-model, extracted from the UML model.
MeeduseTuto.mch: is a B specfication defining the static semantics of your DSL
Create in folder "model", a new file named MeeduseTuto_main.mch
It is important to keep the files inside folder "model". They must be located in the same folder as the ECore file.
File "MeeduseTuto_main.mch" defines the operational semantics of the DSL.
The following, increases and decreases the counter in the interval 0..10
Execute a runtime Eclipse and create a model (instance of the MeeduseTuto meta-model).
Right click on the root object of your model (object Counter) and select execute model. The menu shows two actions: "Structural machine"
and "abstract behaviour". The first one animates the static semantics machine, and the second one animates the operational semantics.
Click on "Abstract Behaviour", and then "Finish"
You get two new views: "Execution view" and "State view". Arrange them at your convenience.
Double-click on an operation in the "Execution view" to execute it.
Enjoy! and do not forget to give us your feedback :-)