Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » grammar mixin and inheritance
grammar mixin and inheritance [message #1770993] Sun, 20 August 2017 19:25 Go to next message
Susie Agerholm is currently offline Susie AgerholmFriend
Messages: 54
Registered: April 2017
Member
I have two different xtext grammars - URDF and Expr - and I want to do a grammar mixin like so:

grammar org.example.urdf.URDF
with org.example.expr.Expr

I have two questions:
1. I guess, I will have to register Expr in the mwe file in my URDF project, but how? Is there any other config needed?

2. How does the inheritance work? More specifically: I had to remove Terminal from URDf in order to be able to mixin Expr. If Expr has org.eclipse.xtext.common.Terminals as mixin - will I be able to ref Terminals from URDF?




Re: grammar mixin and inheritance [message #1770994 is a reply to message #1770993] Sun, 20 August 2017 19:28 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
You just need to put the first dsl on the classpath of the second

(EG by addding mydsl atop the manifest of mydslb as required bundle

Addditionally you might need a

referencedResource="platform:/resource/xxx.mydsla/model/generated/Mydsla.genmodel"

In the language section of the workflow of mydslb


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: grammar mixin and inheritance [message #1770995 is a reply to message #1770994] Sun, 20 August 2017 19:41 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
And there is only one supergrammmar possible
Thus you get terminals transitive from mydsla (if that inherits from terminals)


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: grammar mixin and inheritance [message #1771042 is a reply to message #1770995] Mon, 21 August 2017 12:41 Go to previous message
Susie Agerholm is currently offline Susie AgerholmFriend
Messages: 54
Registered: April 2017
Member
Ok - thanks a lot!
Previous Topic:Error "Failed to create injector"
Next Topic:Exclude Keyword from ID in specific Context
Goto Forum:
  


Current Time: Sat Apr 20 01:38:19 GMT 2024

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

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

Back to the top