Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Generator problems when using cross references in xtext(Generator problems when using cross references in xtext)
icon5.gif  Generator problems when using cross references in xtext [message #1211699] Tue, 26 November 2013 15:22 Go to next message
Arshad Adavani is currently offline Arshad AdavaniFriend
Messages: 119
Registered: July 2013
Location: Bangalore
Senior Member
Hello all,
I have 2 grammars say Grammar1 and Grammar2.

My Grammar2 is referencing some objects (Not all) in Grammar1.

Now a scenario,
Say DSL of my Grammar1 has some error, no doubt its generator will not be called that's fine.

But, DSL of my Grammar2 doesn't have even a single error and hence generator will be called, but as it is referencing to DSL of Grammar1, the generator of Grammar1 results in some errors.

So what I basically need is, if the cross referenced DSL doesn't have any error then proceed with generation or abort it.

How can I achieve it?

Thanks in advance Smile


Arshad
Re: Generator problems when using cross references in xtext [message #1213322 is a reply to message #1211699] Wed, 27 November 2013 07:33 Go to previous message
Sven Efftinge is currently offline Sven EfftingeFriend
Messages: 1771
Registered: July 2009
Senior Member
You should validate your Grammar2 language to have everything the generator needs. So if you are referencing elements from Grammar1 and need to retrieve some information from them during code generation. You should add a validation rule that checks whether this information is available and if not tell the user by adding an issue.

--
Need professional support on Xtext or Xtend?
Mail to: xtext (at) itemis.com
Twitter : @svenefftinge
Blog : blog.efftinge.de
Previous Topic:Resolving proxies for Java types fails when model is loaded externally
Next Topic:Showing validation error at the right eStructural feature
Goto Forum:
  


Current Time: Wed Dec 17 21:42:58 GMT 2014

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

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