RootNode type #8
thomas-quadratic
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
BranchNode subtypes include InternalNode and StemNode. StemNode's occur at the end of the internal tree, while internal nodes are all the other nodes. StemNodes can in particular have extensions, while InternalNodes don't.
However, there is a little difference occuring at the root: there should always be a root node and it should be an internal node. That means that the root cannot be part of an extension.
Perhaps we should include RootNode subtype of InternalNode. It would need to overload the print method, but nothing else.
This would also require modifications in the visitors.
In particular the FlattenVisitor could act on the parent node instead of on the unique child. Then the check whether the location is empty can be done by dispatching according to the type of node. RootNode will not be flatten ever.
Beta Was this translation helpful? Give feedback.
All reactions