antlrdslxtextdsl-tools

XText: How to create parser for multiple target language


I defined my DSL in XText and it automatically have Java version of language parser and code generation skeleton generated, which is really cool.

The problem is that my DSL is intended to be consumed by projects that are implements with multiple languages. You can imagine that we may need to parse the DSL in C#, Java and Ruby at least.

So the question is: Is there a way to generate the parser for multiple languages with the help of xtext?


Solution

  • The pure parsing stuff is only a small part of the complete Xtext suite. Integration into the Eclipse IDE and the Xtend generator stuff are two big chunks of code. And Xtext builds on top of the EMF Ecore model. None of these parts are available in other languages.

    So running Xtext from within plain C# and Ruby is not possible.

    What you can do: