Skip to main content



      Home
Home » Modeling » TMF (Xtext) » Set attributes in the model
Set attributes in the model [message #537138] Tue, 01 June 2010 08:47 Go to next message
Eclipse UserFriend
Hi,
My grammar looks like :
...........
AttributeStatic returns kdm::Attribute : {kdm::Attribute}
value=ID;
AttributeVisibility returns kdm::Attribute : {kdm::Attribute}
(value=ID) ;
AttributeType returns kdm::Attribute : {kdm::Attribute}
(value=ID) ;
AttributeTo returns kdm::Attribute : {kdm::Attribute}
(value=ID) ;
There is another attribute 'tag' in the class 'Attribute' which
I want to set depending on the type of the Attribute (AttributeStatic or AttributeVisibility ...) but in the model I have only the type 'Attribute' because all the AttributeXXX returns Attribute.
Is there a way to know if an attribute is an AttributeStatic or AttributeStatic or ...?
Re: Set attributes in the model [message #537151 is a reply to message #537138] Tue, 01 June 2010 09:16 Go to previous message
Eclipse UserFriend
Hi Piko,

it is possible to navigate the the associated grammar element via

NodeUtil.getNode(attribute).getGrammarElement().

If the node does not hold the correct element for you, it may be
necessary to navigate through the node tree to find the right grammar
element.

Hope that helps,
Sebastian
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com

Am 01.06.10 14:47, schrieb piko:
> Hi,
> My grammar looks like :
> ..........
> AttributeStatic returns kdm::Attribute : {kdm::Attribute}
> value=ID;
> AttributeVisibility returns kdm::Attribute : {kdm::Attribute}
> (value=ID) ;
> AttributeType returns kdm::Attribute : {kdm::Attribute}
> (value=ID) ;
> AttributeTo returns kdm::Attribute : {kdm::Attribute}
> (value=ID) ;
> There is another attribute 'tag' in the class 'Attribute' which I want
> to set depending on the type of the Attribute (AttributeStatic or
> AttributeVisibility ...) but in the model I have only the type
> 'Attribute' because all the AttributeXXX returns Attribute. Is there a
> way to know if an attribute is an AttributeStatic or AttributeStatic or
> ...?
>
Previous Topic:[Announce] TMF Xtext 1.0.0RC3 is available
Next Topic:Injection
Goto Forum:
  


Current Time: Tue Oct 28 16:50:33 EDT 2025

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

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

Back to the top