ParserTypeChecker

This is the LookupTreeAdaptor for building and navigating the lazyTypeFilterTrees. It gets built from 2-tuples containing a phrase type and a corresponding A_ParsingPlanInProgress. The type is used to perform type filtering after parsing each leaf argument, and the phrase type is the expected type of that latest argument.

Properties

Link copied to clipboard

A lightweight leaf node that can be used to indicate a negative search (i.e., no elements were applicable).

Functions

Link copied to clipboard
open override fun compareTypes(argumentRestrictions: List<TypeRestriction>, signatureType: A_Type): TypeComparison

Compare two types to produce a TypeComparison.

Link copied to clipboard
open override fun constructResult(elements: List<A_Tuple>, memento: A_BundleTree): A_BundleTree

Construct a Result from a List of Elements.

Link copied to clipboard
fun createRoot(allElements: Collection<A_Tuple>, knownArgumentRestrictions: List<TypeRestriction>, memento: A_BundleTree): LookupTree<A_Tuple, A_BundleTree>

Create a LookupTree, using the provided collection of Elements, and the list of initial argument types.

Link copied to clipboard
fun extractBoundingType(argumentRestrictions: List<TypeRestriction>): A_Type

Compute the bounding signature from the given List of TypeRestrictions.

Link copied to clipboard
open override fun extractSignature(element: A_Tuple): A_Type

Convert from an Element to a suitable A_Type for organizing the tree.

Link copied to clipboard
fun lookupByTypes(root: LookupTree<A_Tuple, A_BundleTree>, argumentTypesTuple: A_Tuple, memento: A_BundleTree, lookupStats: LookupStatistics): A_BundleTree

Use the tuple of types to traverse the tree. Answer the solution, a Result. Uses iteration rather than recursion to limit stack depth.

Link copied to clipboard

Use the given singular value to traverse the tree. Answer the solution, a Result. Uses iteration rather than recursion to limit stack depth.

Link copied to clipboard

Given a List of A_BasicObjects, use their types to traverse the LookupTree. Answer the solution, a Result. Uses iteration rather than recursion to limit stack depth.

Link copied to clipboard
fun restrictedSignature(element: A_Tuple, signatureExtrasExtractor: (A_Tuple) -> Pair<A_Type?, List<A_Type>>, signatureBound: A_Type): A_Type

Extract the signature of the element, then intersect it with the given tuple type.

Link copied to clipboard
open override fun subtypesHideSupertypes(): Boolean

true if Elements with more specific signatures exclude those with strictly more general signatures, false otherwise.

Link copied to clipboard
open override fun testsArgumentPositions(): Boolean

true if the tree uses whole type testing, or false if the tree tests individual elements of a tuple type.