Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Execution order of different Validators
Execution order of different Validators [message #1770542] Mon, 14 August 2017 08:12 Go to next message
Alexander Fichtinger is currently offline Alexander FichtingerFriend
Messages: 66
Registered: January 2013
Member
Hey guys,

we are running into the following issue currently:

We have several Validators which are used by the "basic" Validator of our DSL.
The validators are registered via @ComposedChecks annotation.

One validator (let's call it ResolverValidator later) does the type-resolving of the statements in our DSL.

Here is a little example to show what this validator does:


VAR_LIST
      someVariable : INT;
END_VAR_LIST

someVariable = 3;



When the ResolverValidator reaches the statement "someVarialbe = 3;", it stores the type for the whole statement, which is INT.

Of course this is done for all the files in a project.

Other validators then need the results of the ResolverValidator.

Now we come to our problem:
It is not ensured, that the ResolverValidator is processed BEFORE all the other validators.

So it can happen, that the other validators are called, and the statements are not resolved yet.


Is there a way to tell Xtext some "execution order" of the validators, or something like this?



Thank you very much for your help!












Re: Execution order of different Validators [message #1770550 is a reply to message #1770542] Mon, 14 August 2017 09:26 Go to previous messageGo to next message
Karsten Thoms is currently offline Karsten ThomsFriend
Messages: 762
Registered: July 2009
Location: Dortmund, Germany
Senior Member

The approach itself is bogus, the validator must not depend on derived state. Use an IDerivedStateComputer and proper resource implementation for that.
Re: Execution order of different Validators [message #1770553 is a reply to message #1770550] Mon, 14 August 2017 09:48 Go to previous message
Alexander Fichtinger is currently offline Alexander FichtingerFriend
Messages: 66
Registered: January 2013
Member
Thanks for your fast answer.
This sounds good. We will try to change this, when we have the time for it...
Previous Topic:new project with Oxygen and xtext 2.12
Next Topic:Xbase.genmodel is unmapped while running .mwe2 workflow
Goto Forum:
  


Current Time: Thu Apr 25 13:29:22 GMT 2024

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

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

Back to the top