I have read most of the posts about bidirectional referencing, but it didnt really help me.
My Goal is to store further Data in an AST by referencing to Nodes "outside" the AST. (<- Not importent information for the description of my problem)
My First step was to create an annotation that can be applied to every node. This annotation is of concept "Ann" and holds 1 reference on a node of concept B. B should have a reference back on Ann. The Problem is that B must hold multiple refs on nodes of type Ann. B is NOT inside the regular AST. It exists at the "side".
I think I have an understanding on how the multiple refs problem can be solved, but what I dont understand are 2 things.
1. The concept of smart References, it seems to me its kinda like a bidirectional ref but not really?!?! I am confused.
2. Simply assigning a reference . I would like to write somehting like : node.@Ann.reference = new node<B>, but that doesnt work . Basicly I dont understand how to use the API at this point.
If someone could help me, I would really appreciate it.
Here a little drawing that might help visualize my problem
ASTNode ASTNode (Ann) ----> <--B--> <--/
/ \ /
AstNode AstNode(Ann) -------->--------->------- /