DSL Forge 0.9.0 is Out!

dslforge-header

DSL Forge v0.9.0 is based on Eclipse Neon packages, with RAP 3.1.0 and Xtext 2.10. ANTLR v3.3 with JavaScript target has been patched for Java 8. This version comes with core refactorings on the generators. Mainly, the ACE/ANTLR Generator has been extracted from the Xtext/RAP Generator, which has been enhanced with new features. The Xtext content assist feature has been ported to RAP with very localized changes. The difficulty is not in porting the Xtext interfaces, but rather to manage the dependencies to JFace (no web support) and the adherence to the Eclipse JDT. Well, the Xtext team have refactored their features since version 2.9.x and the dependencies are now managed much better.

The Xtext/RAP Generator produces now 3 projects. For example, if you have the following RCP plugins:

  • /org.eclipse.xtext.example.statemachine
  • /org.eclipse.xtext.example.statemachine.ui

The generator outputs 3 projects:

  • /org.eclipse.xtext.example.statemachine.web
  • /org.eclipse.xtext.example.statemachine.web.build
  • /org.eclipse.xtext.example.statemachine.web.target

The web plugin to package with RAP, a Maven/Tycho project to actually build and package the editor as a web application archive (war), and the target platform on top of which to compile and build the web application.

4 Steps to get your DSL deployed on the web!

Step 1: Generate a web editor from an existing Xtext grammar.

Step 2: Set up the debug configuration and launch the web application from Eclipse.

Step 3: run the Maven build to get a web application archive ready to be deployed.

Step 4: Deploy the web archive on Tomcat

Limitations

Xbase is out of scope for now, as its adherence to the JDT cannot be satisfied in the current scenario. Moreover, Xtext grammar inheritence is not yet translated into ANTLR grammar inheritence, so if your grammar imports other grammars, generate the editor from the main grammar then copy the rules from the original Xtext files to the ANTLR file. Contact the professional support for additional details.

Download P2 Sites

Tooling: http://dslforge.org/downloads/tooling/repository/

Runtime: http://dslforge.org/downloads/runtime/repository/

Get the Source Code

https://github.com/plugbee/dslforge

Report issues

GitHub: https://github.com/plugbee/dslforge/issues

mailto: team@dslforge.org

dslforge

Pirate Robot: A Cool Application of Domain-Specific Languages!

As a case study, we used DSL Forge to build an e-learning platform for teaching kids the basics of computer programming. There is a blog post on Modeling-Languages.com which describes the use case in details. The Adventures of the Pirate Robot is an online and publicly available coding game which aims to teach kids computational thinking by coding the progression of a pirate robot in a game canvas. The technologies used to build the game (RAP, EMF, Xtext, Xtend) are traditionally used in the industry to build advanced RCP platforms for software and systems engineering. What we have done is to apply these technologies in the unusual context of online education and gamification.

Pirate Robot

Pirate Robot

This use case will be demonstrated during the next EclipseCon France 2016 as an application of DSLs for gamification, do *not* miss the talk!

Aknowledgement

Special thanks to Jabier Martinez for his contribution to the design of the game canvas, something I wouldn’t be able to do better than him given my lack of experience with sprite sheets and the short time we had.

The DSL Forge is now open-source!

First of all, happy new year! I’m writing this post to give some fresh news about the current state of DSL Forge.

Getting the tool to its current state wasn’t an easy task. At the time I was working for itemis, the prototype attracted customers attention, as it was a precursor in the area of domain-specific language web editors. Things were going in the right direction, however, for political reasons, the Xtext team at that time wanted to provide a new tool built from scratch.

That sounds weird right? Anyway, that was the reason why I left the company in July 2015 and started PlugBee, a software company specialized in Model-Driven Engineering. DSL Forge has evolved since the original prototype released in January 2014, the tool is now  open sourced under the EPL licence. You can download it from here, you will also find initial documentation to get started. The code is also available on GitHub.

A reminder of what’s the tool for:

The DSL Forge Framework

 

dslforgeDSL Forge framework allows you to get web-based textual editors from ANTLR grammars. From the grammar specification, a JavaScript parser and lexer are automatically generated and embedded into Cloud9’s ACE editor.

How it Works

The core of the generator is a model to text transformation between Xtext and ANTLR. Indeed, the Xtext grammar specification language uses a subset of ANTLR, it also adds extra sugar to make parsing EMF models more accurate. The generator extracts the core ANTLR spec from the Xtext spec and outputs an ANTLR grammar file. From the ANTLR file, JavaScript parser and lexer are instantly generated. This way, the client parser can be used to mirror the Xtext parser on the client side. It’s up to the developer to customize the way the parsers are used, the editors can be adapted for this purpose.

Why ACE

ACE is one of the most robust JavaScript editors, it has a clean JavaScript API, it comes with a lot of features already bound by default. The fact is, Cloud9 has specialized the editor for dozens of languages such as (JavaScript, Phyton, etc) but there isn’t any methodology nor tool to specialize ACE for custom languages. Thanks to our experience in model-driven engineering, we were able to automatize such a task, making it possible to get the editor just from the grammar specification.

To Backend or Not to Backend

It doesn’t matter in fact, both scenarios are handled by the tool. The tool is able to generate a static web project containing the ACE editor already customized for the language. This is a HTML/JavaScript project which runs entirely on the client side. Moreover, it can generate a JEE application based on Eclipse RAP with an Xtext backend. In the last scenario, the developer is free to customize where the features are handled. More info about the use cases in the online documentation.