TypeFox / xtext2langium

A tool for migrating an Xtext language to Langium
https://www.typefox.io/blog/xtext-to-langium
MIT License
7 stars 1 forks source link
langium migration xtext

Build Xtext2Langium

Convert Xtext to Langium

Generator Fragment for MWE2 Workflow

This MWE2 fragment reads your Xtext grammar and converts it to Langium. If you are using a predefined Ecore model (not generated), it will also be converted to Langium as a type definition file.

How to consume

P2 Repository

Add the https://typefox.github.io/xtext2langium/download/updates/v0.4.0/ update site to your .target file as an additional location.

<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
   <unit id="io.typefox.xtext2langium" version="0.0.0"/>
   <repository location="https://typefox.github.io/xtext2langium/download/updates/v0.4.0/"/>
</location>
Maven
<dependency>
    <groupId>io.typefox.xtext2langium</groupId>
    <artifactId>io.typefox.xtext2langium</artifactId>
    <version>0.4.0</version>
</dependency>
Gradle
io.typefox.xtext2langium:io.typefox.xtext2langium:0.4.0

How to use

Add the fragment to you Language configuration in the MWE2 file and configure the output path.

language = StandardLanguage {
    name = "io.typefox.Example"
    // ... //

    fragment = io.typefox.xtext2langium.Xtext2LangiumFragment {
        outputPath = './langium'
    }

After running the workflow you will find the generated Langium output in ./langium folder.

Fragment options