Skip to main content



      Home
Home » Modeling » TMF (Xtext) » Grammar Modularity
Grammar Modularity [message #1861014] Thu, 14 September 2023 08:18 Go to next message
Eclipse UserFriend
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 09:23 Go to previous messageGo to next message
Eclipse UserFriend
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 09:46 Go to previous messageGo to next message
Eclipse UserFriend
(depending on the usecase the subgrammar service classes will inherit from the basegrammar service classes)
Re: Grammar Modularity [message #1861038 is a reply to message #1861022] Fri, 15 September 2023 03:57 Go to previous messageGo to next message
Eclipse UserFriend
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 05:10 Go to previous messageGo to next message
Eclipse UserFriend
am not sure what your exact question is?
Re: Grammar Modularity [message #1861231 is a reply to message #1861043] Sun, 01 October 2023 06:04 Go to previous message
Eclipse UserFriend
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: Thu Mar 27 01:14:22 EDT 2025

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

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

Back to the top