dap4/d4core/src/main/java/dap4/core/dmr/DapNode.java
public void setParent(DapNode parent)
    {
        assert this.parent == null;
        assert (
                (this.getSort() == DapSort.ENUMCONST && parent.getSort() == DapSort.ENUMERATION)
                        || parent.getSort().isa(DapSort.GROUP)
                        || parent.getSort() == DapSort.VARIABLE
                        || parent.getSort() == DapSort.STRUCTURE
                        || parent.getSort() == DapSort.SEQUENCE
                        || this.getSort() == DapSort.ATTRIBUTE
                        || this.getSort() == DapSort.ATTRIBUTESET
        );
        this.parent = parent;
    }
public void setParent(DapNode parent)
    {
        assert this.parent == null;
        assert (
                (this.getSort() == DapSort.ENUMCONST && parent.getSort() == DapSort.ENUMERATION)
                        || parent.getSort().isa(DapSort.GROUP)
                        || parent.getSort() == DapSort.VARIABLE
                        || parent.getSort() == DapSort.STRUCTURE
                        || parent.getSort() == DapSort.SEQUENCE
                        || this.getSort() == DapSort.ATTRIBUTE
                        || this.getSort() == DapSort.ATTRIBUTESET
        );
        this.parent = parent;
    }
Set the parent DapNode; may sometimes be same as container,
but not always (think attributes or maps).
Invariant: parent must be either a group or a variable.
We can infer the container, so set that also.

@param parent the proposed parent node