Skip to main content



      Home
Home » Modeling » TMF (Xtext) » Scoping same type of objects
Scoping same type of objects [message #1810127] Wed, 31 July 2019 16:46 Go to next message
Eclipse UserFriend
Hello,

I have the following rule:

('mcontroller' mcontroller1 = [DSLManagerController] access=DSLAccess 'mcontroller' mcontroller2 = [DSLManagerController] ';') 


I defined 2 mcontroller objects: controller_1 and controller_2.

So a valid rule can be :

mcontroller controller_1 can-access  mcontroller controller_2


I want to scope the right part of my rule, where accessing the same controller will be an invalid entry or the autocompletition can not reach the controller of the left part of the rule.

For instance:

mcontroller controller_1 can-access  mcontroller controller_1


Should be invalid,

Regards,

Daniel.
Re: Scoping same type of objects [message #1810132 is a reply to message #1810127] Thu, 01 August 2019 00:07 Go to previous messageGo to next message
Eclipse UserFriend
Customize scoping.

Wrap delegateGetScope(ctx, ref) into a FilteringScope and Filter the description for the current object there
Re: Scoping same type of objects [message #1810133 is a reply to message #1810132] Thu, 01 August 2019 00:08 Go to previous messageGo to next message
Eclipse UserFriend
Pleas also consider to do this with a validation instead of scoping
Re: Scoping same type of objects [message #1810149 is a reply to message #1810127] Thu, 01 August 2019 09:36 Go to previous messageGo to next message
Eclipse UserFriend
Thank you for your reply.

Yes, by using a validation rule was pretty simple. Just for curiosity, How should I implement a solution with Scope? I tried some examples but couldn't get it. Do you have a code snippet for guiding me, with some explanations?

Regards,


Daniel.

Re: Scoping same type of objects [message #1810153 is a reply to message #1810149] Thu, 01 August 2019 11:17 Go to previous message
Eclipse UserFriend
please give what you have tried
Previous Topic:Creating custom appender for log4j
Next Topic:LSP -> Debugger implementation
Goto Forum:
  


Current Time: Sun Apr 20 13:36:15 EDT 2025

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

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

Back to the top