Possible problem: Subsuming connects
What should happen to connected endpoints within a subtree, that is replaced by a receiving endpoint?
Example
// grammar
Root ::= A* ;
A ::= B* ;
B ::= C* ;
C ;
// connect
receive Root.A;
receive A.B;
receive B.C;
b1.addC(c1);
a1.addB(b1);
root.addA(a1);
b1.connectC("url-for-c");
a1.connectB("url-for-B");
root.connectA("url-for-A");
When a new value for a1
is received, b1
and c1
are overridden, and are not part of the AST anymore.
Hence they should be disconnected.
One could argue, that if the structure of the replacing subtree (of type A
) is equal/similar, those endpoints could be transferred, but no such assumption can be made.
A possibility would be to prohibit such endpoints (or warn), but that sounds too restrictive; especially with #34 (closed) in mind and recursive types (e.g., A ::= A*
), that could never be connected in that case.