Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » [SOLVED]Validation- Grammar mixin semantic validation(How to call semantic validator of the imported grammar? )
[SOLVED]Validation- Grammar mixin semantic validation [message #1352049] Tue, 13 May 2014 09:25 Go to next message
emilio incerto is currently offline emilio incertoFriend
Messages: 3
Registered: May 2012
Location: l'aquila
Junior Member
Hi guys

I'm developping a new textual dsl with xtext, I have splitted the whole grammar in 3 differents xtext projects related each other as follow:

  • org.xtext.odata (odata.xtext)
  • org.xtext.ogda extends org.xtext.odata (ogda.xtext)
  • org.xtext.obcp extends org.xtext.odata (obcp.xtext)

The extending grammar include the base grammar with the "with" clause and everything works fine. I can use the rule of the super-grammar inside the sub-grammar and there are no generation errors.
Now, I have created many semantic validator classes for the rules specified in the odata grammar but these are not called during the validation of the model of the sub grammar.

There is a mechanism that allow me to include the super grammar validator classes during the validation of sub-grammar models?

I hope I explained it well, thanks Smile

[Updated on: Tue, 13 May 2014 18:21]

Report message to a moderator

Re: Validation- Grammar mixin semantic validation [message #1352943 is a reply to message #1352049] Tue, 13 May 2014 18:00 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13607
Registered: July 2009
Senior Member
Hi,

i am note sure if i get your problem. with a simple example it more or less works out of the box if you register all packages in the validators
org.xtext.example.mydslb.validation.AbstractMyDslBValidator.getEPackages()


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Validation- Grammar mixin semantic validation [message #1352971 is a reply to message #1352943] Tue, 13 May 2014 18:17 Go to previous message
emilio incerto is currently offline emilio incertoFriend
Messages: 3
Registered: May 2012
Location: l'aquila
Junior Member
Thanks for your response Christian, I made the override of the getEPackages() method and now works great!

thanks!
Previous Topic:"XtextReconcilerJob" internal error
Next Topic:"XtextReconcilerJob" internal error
Goto Forum:
  


Current Time: Thu Sep 24 13:04:49 GMT 2020

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

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

Back to the top