Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Grammar Modularity
Grammar Modularity [message #1861014] Thu, 14 September 2023 12:18 Go to next message
Antonio Silva is currently offline Antonio SilvaFriend
Messages: 2
Registered: September 2023
Junior Member
Hello,

I know xtext grammar extends mechanism (with) but could not find any information about whether it is possible that the language we extend from is designed and implemented in another xtext project.

If possible, can we only reuse the grammar or can we also reuse the other modules, for instance, the validators.

Many thanks,
António Silva
Re: Grammar Modularity [message #1861019 is a reply to message #1861014] Thu, 14 September 2023 13:23 Go to previous messageGo to next message
Rubén Porras Campo is currently offline Rubén Porras CampoFriend
Messages: 67
Registered: July 2009
Member
Hi,

Quote:
I know xtext grammar extends mechanism (with) but could not find any information about whether it is possible that the language we extend from is designed and implemented in another xtext project.


Yes, it is possible.


Quote:
If possible, can we only reuse the grammar or can we also reuse the other modules, for instance, the validators.


Yes, you can do that by registering the ePackage of the extended grammar in the validator that extends the validator of the extended grammar.

Regards
Re: Grammar Modularity [message #1861022 is a reply to message #1861019] Thu, 14 September 2023 13:46 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14686
Registered: July 2009
Senior Member
(depending on the usecase the subgrammar service classes will inherit from the basegrammar service classes)

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Grammar Modularity [message #1861038 is a reply to message #1861022] Fri, 15 September 2023 07:57 Go to previous messageGo to next message
Antonio Silva is currently offline Antonio SilvaFriend
Messages: 2
Registered: September 2023
Junior Member
Hi,

Thanks for your replies!

There is documentation on how to do it or an open-source project or example that we can look at?

Thanks,
António
Re: Grammar Modularity [message #1861043 is a reply to message #1861038] Fri, 15 September 2023 09:10 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14686
Registered: July 2009
Senior Member
am not sure what your exact question is?


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Grammar Modularity [message #1861231 is a reply to message #1861043] Sun, 01 October 2023 10:04 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7661
Registered: July 2009
Senior Member
The Eclipse OCL project defines a number of grammars that are internally used and extended. They are further extended by four grammars in the Eclipse QVTd project.

This unfortunately results in very tight coupling between Eclipse OCL and Eclipse QVTd; just about any evolution of an OCL model/grammar requires a matched rebuild of QVTd.

(A number of releng procedures such as a Java serialization of the *.xtextbin avoid correspondingly tight coupling with the Eclipse Xtext project.)
Previous Topic:VSCode extension retrieve workspace configuration
Next Topic:Xtext 2.33.0.M1 is out
Goto Forum:
  


Current Time: Mon Jun 17 21:22:20 GMT 2024

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

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

Back to the top