Page tree
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 6 Next »


Under Construction

This tutorial is still under construction.

Xtent tutorials

The two Xtend tutorials are stand-alone tutorials. You do not need to do the Xtend I tutorial in order to perform the Xtend II tutorial. Ask your supervisor which tutorial suits you best.

 

This installment of our little series of tutorials will be all about Xtend, a programming language that looks very similar to Java, but which adds some very convenient features. Xtend code compiles to Java and and was developed using Xtext. In fact, once you gain experience working with Xtend you will probably appreciate the power of Xtext even more.



Preliminaries

There's a few things to do before we dive into the tutorial itself. 

Required Software

For this tutorial, we need you to have Eclipse installed:

  1. Install Eclipse. For what we do, we recommend installing the Eclipse Modeling Tools, with a few extras. Our Wiki page on getting Eclipse has the details: simply follow the instructions for downloading and installing Eclipse and you should be set.
  2. Install the complete Xtext SDK 2.7.3 from the itemis updatesite: http://download.itemis.de/updates/ if you haven't done this already.

Recommended Tutorials

We recommend that you have completed the following tutorials before diving into this one.

  1. Eclipse Plug-ins and Extension Points
  2. Eclipse Modeling Framework (EMF)
    1. This tutorial needs the turingmachine.ecore and the controller you've implemented in the EMF tutorial. If you did not complete the EMF tutorial, you may download a working turing machine here... (in the future).

Required Tutorials

This tutorial continues from the Xtext II - Create a new Metamodel from Scratch! tutorial thematically. You might want to complete the Xtext I tutorial first.

Extended Brainfuck

Let's play a bit more with Brainfuck (BF). BF is nice, but not nice enough! Let's extend it by adding some syntactic sugar to the language. Feel free to express yourself here but you should at least add the following commands to eBF:

$Increment the actual cell by 65
%Increment the actual cell by 32
/Multiply the value of the actual cell by 2
aCopy the value of actual cell to the next cell on the right
ACopy the value in the next cell to the right to the actual cell
{ ... }

Every command between { and the corresponding closing bracket } is duplicated immediately

 

  1. Open your BF grammar of the previous tutorial (or create a new one) and create rules so that the BF editor accepts the syntax changes.
  2. Re-generate your BF code and run your eclipse instance to verify the changes.

 

Writing a Model Transformation

 

Testing your Model Transformation

 

  • No labels