ParentIndextypeno test imports ittype ParentIndex = ReadonlyMap<Node, Node>;The parent of each node of one tree; the root has none.
The parent of each node (commons lang-sql 0003-sql-ast-tools FR-005): nodes do not hold their parent, so a program that needs it makes this table once for a tree and reads it.
Spec: 0003-sql-ast-tools FR-005
ParentIndextypeno test imports ittype ParentIndex = ReadonlyMap<Node, Node>;The parent of each node of one tree; the root has none.
ancestorsfunctionfunction ancestors(index: ParentIndex, node: Node): Iterable<Node>The ancestors of a node, nearest first.
parentIndexfunctionfunction parentIndex(root: Node): ParentIndexMakes the table from each node of a tree to its parent.
| Parameter | What it is |
|---|---|
root | the tree |
Returns: the table
parentOffunctionfunction parentOf(index: ParentIndex, node: Node): Node | undefinedThe parent of a node, or undefined for the root.