Skip to content

Latest commit

 

History

History
102 lines (72 loc) · 6.64 KB

README.md

File metadata and controls

102 lines (72 loc) · 6.64 KB

DSL Forge

DSL Forge is a framework for the development of domain-specific language (DSL) editors for web applications and cloud IDEs. It allows to get web-based textual editors automatically from ANTLR grammars. From the language grammar specification, JavaScript parser and lexer are automatically generated and embedded into Cloud9’s ACE editor.

The framework comes with two code generators which take the grammars expressed with Xtext or ANTLR and generate two variants of editors.

  • Generate Web Editor from ANTLR produces a text editor with JavaScript parser and lexer from ANTLR v3. You get an ACE editor tailored for the language definition which runs fully on the client side. This editor has no backend, use it for integration with JavaScript servers.
  • Generate Web Editor from Xtext produces a plugin to be packaged with the original Xtext plugin into a workbench application enabling precise interaction between the client and the server.

Editor Features

Below the complete list of features bound by default in the generated editors.

  • Syntax highlighting,
  • Syntax validation,
  • Content assist,
  • Sever-side semantic validation,
  • Scoping,
  • Template proposals,
  • Text hovering,
  • Default Key bindings,
  • Undo/Redo Support,
  • Code Folding,
  • Brace Matching.

Use Cases

Below some examples of use cases showing how the generated editors can be integrated with Web IDEs, forms, HTML5 canvas, guiders, and many other popular JavaScript frameworks.

  • The following use case is a petrinet form made up of an embedded textual editor integrated with D3.js framework. The form is available in the live demo, open the petrinet project folder, right click on a petrinet model file, and select "Open with form editor".

  • The following use case is an online coding game made with DSL Forge. It comes with a domain-specific language for specifying the actions of a robot, a remote debugger, next to a canvas animation made with Phaser.js. The game is free and publicly available on CodingPark.

  • The following example is an ANTLR v4 web editor embedded in the live demo, it demonstrates the integration of the editor with guiders based on the Guiders.js framework.

Installation

  1. Install Eclipse The current DSL Forge Tooling is based on Eclipse Neon packages. To know which package is the most appropriate for you, select one of the following alternatives.
  • Eclipse IDE for Java EE Developers You want a static web project with a full integration of ANTLR v3 (v4 is following) and ACE that you can easily debug in the browser. The recommended package in this case is Eclipse IDE for Java EE Developers as it comes with a simple HTTP Preview server easy to debug. The generator outputs the language mode and worker, and does the integration with the lexer/parser generated by ANTLR in the worker script. Once you update the grammar specification file, the parser/lexer are regenerated automatically on save, the language mode/worker are regenerated from contextual menu.

  • Eclipse for RCP and RAP Developers You want a closer integration with Eclipse Modeling tools such as Xtext and EMF, trigger code generation, do live compilation and execute some generated artefacts, you’d better install Eclipse for RCP and RAP Developers. The tooling comes with a set of runtime plugins that will make the integration of your tool chains (e.g. transformations written in Xtend, Xpand, and Java) very easy. The editor is generated together with a target platform and a build script. The target platform is a super set of the Basic Equinox Target, it contains runtime plugins providing services such as workspace management, persistency, etc. The build script outputs a war bundle that you can deploy either in OSGI environments (Jetty) or JEE environments (Tomcat).

  1. Install DSL Forge Tooling Use the regular update site.

Usage

The two usage scenarios are documented on the website.

Generate Web Editor from Xtext

Generate Web Editor from ANTLR

See tutorial

Documentation

Additional usage informationn and technical details can be found below:

If you still need help, please open an issue we'll try to help as much as possible in a reasonable time.

If you need professional support, drop an email to [email protected].

Contributing

We actively encourage and support contributions! DSL Forge is open source, feel free to fork the repository and enhance the tool the way you want.

License

DSL Forge program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which is available at http://www.eclipse.org/legal/epl-v10.html