Companion

object Companion

Types

Link copied to clipboard
class TreeIterator(val childrenExtractor: (A_Phrase, (A_Phrase) -> Unit) -> Unit, val aBlock: (A_Phrase, parent: A_Phrase?) -> Unit)

A helper for traversing a phrase tree without recursion.

Functions

Link copied to clipboard

Does the specified flat list of phrases contain only statements?

Link copied to clipboard
fun equalPhrases(phrases1: Iterable<A_Phrase>, phrases2: Iterable<A_Phrase>): Boolean

Given two Iterables of A_Phrases, check that they have the same length, and that their corresponding elements are A_Phrase.equalsPhrase.

Link copied to clipboard

Initialize the phrase's hash value during construction.

Link copied to clipboard
fun styleDescendantsThen(phrase: A_Phrase, context: CompilationContext, visitedSet: MutableSet<A_Phrase>, then: () -> Unit)

Recursively style all descendants of the given phrase.

Link copied to clipboard
fun treeDoWithParent(self: A_Phrase, parentNode: A_Phrase? = null, children: (A_Phrase, (A_Phrase) -> Unit) -> Unit = { phrase, withChild -> phrase.childrenDo(withChild) }, aBlock: (A_Phrase, parent: A_Phrase?) -> Unit)

Visit the entire tree with the given consumer, children before parents. The block takes two arguments: the phrase and its parent.