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: 11588
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


Need professional support for Xtext, Xpand, EMF?
Go to: http://xtext.itemis.com
Twitter : @chrdietrich
Blog : christiandietrich.wordpress.com
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: 11588
Registered: July 2009
Senior Member
And there is only one supergrammmar possible
Thus you get terminals transitive from mydsla (if that inherits from terminals)


Need professional support for Xtext, Xpand, EMF?
Go to: http://xtext.itemis.com
Twitter : @chrdietrich
Blog : christiandietrich.wordpress.com
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: Wed Jan 17 22:11:21 GMT 2018

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

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