Skip to main content



      Home
Home » Modeling » TMF (Xtext) » Return different properties depending of the EObject type(Scoping)
Return different properties depending of the EObject type [message #674838] Sat, 28 May 2011 16:44
Eclipse UserFriend
Hello everybody,

I need to allow the call of functions or properties on EObjects references depending of the type of the EObject. So far, I've done this kind of things through scoping. Now, the problem is that those functions and properties I have to call are not defined by the user.

I thought I should do something like create the new EObjects I need in my scoping implementation and return them.

Fox example:

Model:
	(connection+=Connection)+
	(attribute+=Attribute)+
	assignment=Assignment
;

Connection:
  'con: ' name=ID
;

Attribute:
  'att: ' name= ID
;

Assignment:
	object=[ecore::EObject]'.'call=[ecore::EObject]
;



I want to write something like:

con: MyConnection
att: MyAttribute
MyConnection.username
MyAttribute.toString()


, where "username" only applies to Connection objects and "toString()" to Attributes.

Where I should write or create those methods and properties?

Thank you very much!

Previous Topic:Run MWE2 workflow from java project
Next Topic:Creating an unvalidated area of text
Goto Forum:
  


Current Time: Fri Jul 04 16:22:21 EDT 2025

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

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

Back to the top