xtext parser node [message #638592] |
Thu, 11 November 2010 12:33  |
Eclipse User |
|
|
|
I have an ASTNode that has been loaded from a resource using a standalone setup.
After that, I have code that modifies the ASTNode in memory. (adding some model elements etc.)
I am trying to get the NodeAdapter for the modified ASTNode to obtain some parser node information.
But using the NodeUtil.getNodeAdapter(..) on the modified ASTNode, returns a null.
Is there anyway, I can reconstitute the parser composite node or obtain the node adapter of the modified ASTNode.
I have also tried to use SerializerUtil to serialize the modified ASTNode, but it throws some NPE.
Any ideas?
Thanks!
|
|
|
|
|
|
|
|
|
|
Re: xtext parser node [message #639872 is a reply to message #639462] |
Thu, 18 November 2010 03:42  |
Eclipse User |
|
|
|
The node model is created by the (partial) parser only, So you have to
serialize and reparse after the the model change. For your convenience,
this functionality is bundled in the IDocumentEditor.
Am 16.11.10 17:28, schrieb sungam:
> Thanks for the pointer.
>
> I do not update the model from the editor/ui module, but rather to do
> some code generation.
>
> What I really need is, if sometimes there are missing links, for
> elements modeled as cross-references,I need a way to determine what the
> ID of the missing cross reference is.
> Well theres the NodeUtil to get the node adapter that leads me to the
> composite node. But having recreated a new EObject, that is no longer
> accessible.
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com
|
|
|
Powered by
FUDForum. Page generated in 0.06501 seconds