CompoundNode

interface CompoundNode<N : Node>(source)

A Node that combines multiple other nodes into a single node.

A compound node may have 0.n children. Children are added by calling the accept method.

Accepted children must follow a few invariants. See Node for more information.

There are no general-purpose way of accessing the children after they have been accepted. Instead, this node should be considered as representing the children itself, as a single unit. Subtypes may decide to provide such a feature, however.

Inheritors

Functions

Link copied to clipboard
abstract fun accept(node: N)

Adds a new Node into the current node.

Link copied to clipboard
fun <N : Node> CompoundNode<N>.acceptAll(nodes: Iterable<N>)

Adds any number of nodes into this one.