Model Access in Post Process Scripts of Generator Aspect
Hello everyone,
I have a post-process script in the generator aspect of my language and I want to iterate on all the related nodes in the model.
For this purpose I am trying to use the following code however I cannot get any node:
If I use something like this:
It actually gets the nodes that I want to iterate however it is not a generic solution.
How could I get the nodes from models in a generic way for post-process script?
Thanks in advance,
Özlem
I have a post-process script in the generator aspect of my language and I want to iterate on all the related nodes in the model.
For this purpose I am trying to use the following code however I cannot get any node:
for (node<NodeType> nd: model.roots(NodeType)) {
//implementation
}
If I use something like this:
for (node<NodeType> nd: model/myLanguage.sandbox/.roots(NodeType)) {
//implementation
}
It actually gets the nodes that I want to iterate however it is not a generic solution.
How could I get the nodes from models in a generic way for post-process script?
Thanks in advance,
Özlem
Please sign in to leave a comment.
I also try your suggestion however it's not working either.
How could I get the NodeType roots under the sandbox model in post-process script?
Here is the code:
It seems to work for me however I don't know wheter it will cause any complications in the language afterwards.