Eclipse Xtext Workflow

The mwe2 file controls the workflow, it generates all the necessary files. In xtext it is in a file with a name like: Generate????.mwe2 mwe2 file
This .mwe2 file starts with module information and then has a 'Workflow' which contains a list of components which are written in java. components
These interfaces are defined at the links on the right:

So, in more detail, here is an example of a component:


Generator component

The component that we are interested in is the 'Generator' component, it is called from the mwe2 file like this:

    component = Generator {
    	pathRtProject = runtimeProject
    	pathUiProject = "${runtimeProject}.ui"
    	pathTestProject = "${runtimeProject}.tests"
    	projectNameRt = projectName
    	projectNameUi = "${projectName}.ui"
    	encoding = encoding
    	language = auto-inject {
    		uri = grammarURI
   		fragment = grammarAccess.GrammarAccessFragment auto-inject {}
    		fragment = ....

This sets up some properties and then lists fragments in language property.

generator component

When InvokeInternal is called in Generator then the main packages are defined in OutputImpl and registered. output impl


There is a 'Generator' component for xtext here.


These are defined in xtext rather than the mwe structure. Here are some examples of fragments.

Example - Antlr

The mwe2 file contains the following:

    		// The antlr parser generator fragment.
    		fragment = parser.antlr.XtextAntlrGeneratorFragment {
    			antlrParam = "-Xconversiontimeout" antlrParam = "10000"
    		// generates a more lightweight Antlr parser and lexer tailored for content assist
    		fragment = parser.antlr.XtextAntlrUiGeneratorFragment auto-inject {
    			antlrParam = "-Xconversiontimeout" antlrParam = "10000"

These fragments are defined here:


metadata block
see also:


Correspondence about this page

This site may have errors. Don't use for critical systems.

Copyright (c) 1998-2022 Martin John Baker - All rights reserved - privacy policy.