Getting comments from the node model [message #1567778] |
Fri, 16 January 2015 15:19 |
Andy Ed Messages: 64 Registered: December 2009 |
Member |
|
|
Hi,
I've been trying to get comments from a node model, so that I can inject them into an EMF model for separate persistence. But, it is not working as I expected. I assumed that the node associated with an EObject (representing a keyword in the text, for instance) would contain a tree (or some graph) of sub elements, related to the DSL spec.
To illustrate, I have a problem with comments on an axiom,
Axiom returns context::Axiom:
'@'name=EString
predicate=EString?
(theorem?='theorem')?
('//' comment=EString)?
;
When trying to obtain comments from the node model, if you can see the graphic attached, the comment associated with axm2 (note 1) using node.getText() is incorrect. In the xtext it is associated with axm1 (note 2). In some cases the comments are lost, so I am obviously doing something wrong.
In my code I use NodeModelUtils.getNode(eobj) to get a composite node, and ICompositeNode.getChildren() method to get an iterator. Is my assumption correct, that the comment should be navigable through an iterator obtained from the Axiom EObject?
Any hints would be appreciated.
Many thanks,
Andy
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03881 seconds