Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » mwe2 workflow: seperation of ide and non-ide fragments(Is it possible to seperate the generation of fragments by using existing generated sources?)
mwe2 workflow: seperation of ide and non-ide fragments [message #1834022] Fri, 30 October 2020 12:43 Go to next message
Jan Hermes is currently offline Jan HermesFriend
Messages: 27
Registered: September 2020
Junior Member
Hello everyone,

I wonder if its possible to separate the generation of code by the fragments into different modules. My specific request would be the separation of ide-sources and non-ide-sources:

My (simplified) setup with fragments is like this:

  • Core project (non-ide compiler)

    • XtextAntlrGeneratorFragment2

  • IDE integration

    • genericIde = { enabled = true }
    • XtextAntlrGeneratorFragment2

Now I would like to loose the complete XtextAntlrGeneratorFragment in the IDE integration project. But disabling it causes it also to not generate the ide.contentassist.antlr stuff, which I need.

Is there some predefined possibility to achieve such a seperation?

Otherwize I would maybe just customize an XtextAntlrGeneratorFragment like so and remove all non-ide specific lines?:

class XtextAntlrGeneratorFragment2OnlyIDE extends XtextAntlrGeneratorFragment2 {
        // inject grammarUtil

	override protected doGenerate() {
		new KeywordHelper(grammar, options.ignoreCase, grammarUtil)
		new CombinedGrammarMarker(isCombinedGrammar).attachToEmfObject(grammar)
		// if (debugGrammar)
		//	generateDebugGrammar()
		// generateProductionGrammar()
		if (projectConfig.genericIde.srcGen !== null) {
		// generateProductionParser().writeTo(projectConfig.runtime.srcGen)
		// generateAntlrTokenFileProvider().writeTo(projectConfig.runtime.srcGen)
		if (hasSyntheticTerminalRule()) {
			// generateProductionTokenSource().writeTo(projectConfig.runtime.src)
		// addRuntimeBindingsAndImports()

Thanks for any advice

[Updated on: Fri, 30 October 2020 13:15]

Report message to a moderator

Re: mwe2 workflow: seperation of ide and non-ide fragments [message #1834034 is a reply to message #1834022] Fri, 30 October 2020 14:26 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14492
Registered: July 2009
Senior Member
what is ide for your (lsp/web/generic ) or eclipse ui
and what is your line of separation / what is the reason to separate

in general: if you really want to go to route to tear this appart, you can do whatever you like.

Need professional support for Xtext, Xpand, EMF?
Go to:
Twitter : @chrdietrich
Blog :
Previous Topic:Can I bundle grammar and genmodel into a jar?
Next Topic:IllegalStateException during maven build of Xtext project
Goto Forum:

Current Time: Wed May 31 17:04:20 GMT 2023

Powered by FUDForum. Page generated in 0.02071 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top