Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Validate two models of different metamodels
Validate two models of different metamodels [message #1781079] Thu, 01 February 2018 09:11 Go to next message
Chris X is currently offline Chris XFriend
Messages: 60
Registered: November 2017
Member
Hi guys,

I have the following scenario:

Xtext generates automatically the AST of my DSL. In the IDerivedStateComputer
I transform this AST to another AST (derived AST from another metamodel) and put the derived AST to the XtextResource-Content-Slot1 with resource.contents.add(...).

Now I want to run the validator on the AST and on the derived AST. What is the best/cleanest way to do this?

Currently I override the register (EValidatorRegistrar registrar) and register the EPackage of the derived model.

Is there a better way? It would be nice to have one validator class for the AST and one for the derived AST.

PS: My application runs in the eclipse IDE

Many thanks :)
Re: Validate two models of different metamodels [message #1781088 is a reply to message #1781079] Thu, 01 February 2018 09:46 Go to previous messageGo to next message
Karsten Thoms is currently offline Karsten ThomsFriend
Messages: 608
Registered: July 2009
Location: Dortmund, Germany
Senior Member

You just want to split the validators into 2 classes, one for your DSL metamodel and one for the derived AST?

Put it into a separate class and register it as an eager singleton binding as it is done for your DSLs validator.
Re: Validate two models of different metamodels [message #1781091 is a reply to message #1781088] Thu, 01 February 2018 10:01 Go to previous message
Chris X is currently offline Chris XFriend
Messages: 60
Registered: November 2017
Member
Hi Karsten,

it works !! Too easy :)

Many thanks and have a nice day!
Previous Topic:How to remove prefix in cross-reference
Next Topic:Content Assist problem
Goto Forum:
  


Current Time: Fri Aug 17 02:02:58 GMT 2018

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

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

Back to the top