Package org.ek9lang.compiler.support.trees
package org.ek9lang.compiler.support.trees
THE parse-tree navigation for the compiler - one class per question, each held as an instance by the class that
asks. Use these; never hand-write a recursive
for (i < getChildCount()) collector, a
getParent().getParent() chain or a private while (node != null) ascent.
Down:
DescendantCollector- THE typed-descendant collector, in document order, stopping at a match or descending into it. The compiler-servicesmcp.oracle.support.ParseTreesdelegates here (stop-at-match).
Up (each caller keeps its own construct-kind set and its own boundary; these own only the walking):
GrandParent- the parent's parent (for a member, the construct that declares it).NearestAncestorMatchingandNearestAncestorOfType- the nearest strict ancestor, with a stop condition.IsWithin- strictly below another node.
Ascents that track a child cursor, or whose exact parent shape is the point (a fixed three-level
primary -> expression -> ... test), stay where they are. These were once ParseTrees and
Ancestors.
-
ClassesClassDescriptionTHE parse-tree DESCENDANT collector for the compiler - use this, do not hand-write a recursive
for (i < getChildCount())collector.THE parent's parent of a parse-tree node, or null when either is missing.THE test for "is this node anywhere inside that one (strictly below it)".THE ascent to the nearest strict ancestor that satisfies a test, with a boundary.THE nearest strict ancestor of a given parse-rule type, with a boundary (NearestAncestorMatchingby type).