Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Extracts single business aspects into separate grammars
Extracts single business aspects into separate grammars [message #1780187] Thu, 18 January 2018 13:20 Go to next message
Klaus H. is currently offline Klaus H.Friend
Messages: 14
Registered: July 2009
Junior Member
Hi all,
is following separation of concerns possibly with xtext?

grammar A with keywords regarding a single aspect (e.g logging)
grammar B with grammars regarding a single aspect (e.g. accounting)

grammar X1 with specific keywords; should also allow the use of logging functions by usage of logging keywords of grammar A
grammar X2 with specific keywords; should also allow the use of logging and accounting function by usage of keywords of grammar A & B
grammar X3 with specific keywords; should also allow the use accounting function by usage of keywords of grammar B

My current knowledge is that reuse is only possible with inheritance. But only single inheritance is allowed.

Did i try to use the wrong concept for solving my issue? Which is the right one?

Thanks
klaus
Re: Extracts single business aspects into separate grammars [message #1780188 is a reply to message #1780187] Thu, 18 January 2018 13:22 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 12322
Registered: July 2009
Senior Member
since xtext does not allow multi composition / reuse e.g. as Jetbrains MPS does it: no you dont have a chance.

Need professional support for Xtext, Xpand, EMF?
Go to: https://xtext.itemis.com
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Extracts single business aspects into separate grammars [message #1780250 is a reply to message #1780188] Fri, 19 January 2018 09:29 Go to previous message
Uli Merkel is currently offline Uli MerkelFriend
Messages: 236
Registered: June 2013
Senior Member
But what stops you to build grammar AB :
Just use a Copy&Paste of your Grammar B, but base it on Grammar A?

So X1 is based on Grammar A,
X3 is based on Grammar B
and for the X2, you have grammar AB
Previous Topic:Xtext for generating random dsl code
Next Topic:[Solved] Referencing to two separate types
Goto Forum:
  


Current Time: Wed Oct 17 12:25:07 GMT 2018

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

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

Back to the top