12
votes

I have a DSL (implemented with ANTLR) for which I need to write a content assist/autocomplete editor. I've ported a prototype of my grammar to Xtext, and I'm quite happy with the quality of the editor it generates.

Unfortunately, I cannot use Eclipse as my editor. Instead, I'd like use the Xtext grammar to generate some artifacts that I could reuse outside of Eclipse. From what I've seen, the minimum set of artifacts I need are:

  • the EMF models,
  • the parsers,
  • the *ProposalProviders, and
  • the required libraries.

Has anyone tried to use Xtext outside of Eclipse? How many external libraries does it depend on?

Thanks!

4

4 Answers

10
votes

for the backend part (parser / serializer / formatter / metamodel etc) this is not problem and it will require about 30 libaries / 17MB. the ui part requires eclipse.

you can use the export -> runnable jar file wizard to get all dependent libs you need

8
votes

Essentially the same answer as the one given by Christian, this is just a pointer to a more detailed description of How to Deploy Xtext to a Headless Plain-Java Environment. If you are interested in using the artifacts generated from the grammar, you can find a snippet in the XText FAQ

1
votes

You can use command line mode of xtext application. For this purposes : you schould in workflow description file GenerationYourDSLName.mwe2 the following lines

// generator API
fragment = generator.GeneratorFragment {
  generateJavaMain = true
}

then generate xtext artifacts

1
votes

With Xtext 2.9, it is possible to build your language infrastructure independent of Eclipse (and possibly targeting IntelliJ IDEA or the web), using plain old Maven/Gradle. Just uncheck the Eclipse plugin facet when creating an Xtext project and set the Preferred Build System to Maven or Gradle.