I have a concept A and a concept B with a smart reference to A. Both concepts are extensions to a given language and should be replaced by concepts from that language. So an A node should be replaced by a node of concept A' and B should be replaced by a node of concept B' while the latter has a smart reference to A'. Apparently a job for two reduction rules, right?
If I apply the reduction of A to A' first, in the resulting (transient) model the smart reference of the B node is broken because the A' node does not exist any more. As I need to find the right A' node by its name which is derived from the name of the original A node, I don't see how the reduction rule for B->B' can create the right smart reference.
On the other hand, if I apply the B->B' reduction first then the proper A' node does not exist yet and again I cannot create the smart reference.
How can I solve this problem?
In case you are interested: I want to introduce C++-style templates to a C-style base language. A is a template instantiation, B is the usage of the instantiated template as a type, A' is a struct declaration and B' is the usage of this struct as a type. The code can be found here: https://mpscmindstorms.googlecode.com/svn/branches/alex/templates revision 139. The problem shows up when generating the stack model of the sandbox solution.