DecisionStep

sealed class DecisionStep<Element : A_BasicObject, Result : A_BasicObject>

This abstraction represents a mechanism for achieving a quantum of progress toward looking up which method definition to invoke, or some similar usage.

Author

Mark van Gulik

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
abstract fun addChildrenTo(    list: MutableList<Pair<LookupTree<Element, Result>, List<L2SemanticValue>>>,     semanticValues: List<L2SemanticValue>,     extraSemanticValues: List<L2SemanticValue>)

Add the children LookupTrees, coupled with the available L2SemanticValues at that point, to the given list.

Link copied to clipboard
abstract fun describe(    node: InternalLookupTree<Element, Result>,     indent: Int,     builder: StringBuilder)

Output a description of this step on the given builder. Do not expand any subtrees that are still lazy.

Link copied to clipboard
fun extractArgument(argValues: List<A_BasicObject>, extraValues: List<A_BasicObject>): AvailObject
Link copied to clipboard
fun extractArgumentType(argTypes: A_Tuple, extraValues: List<A_Type>): AvailObject
fun extractArgumentType(argTypes: List<A_Type>, extraValues: List<A_Type>): AvailObject
Link copied to clipboard
fun extractValue(probeValue: A_BasicObject, extraValues: List<A_BasicObject>): AvailObject
Link copied to clipboard
abstract fun generateEdgesFor(    semanticArguments: List<L2SemanticValue>,     extraSemanticArguments: List<L2SemanticValue>,     callSiteHelper: L1Translator.CallSiteHelper): List<Triple<L2BasicBlock, LookupTree<A_Definition, A_Tuple>, List<L2SemanticValue>>>

Generate suitable branch instructions via the CallSiteHelper, and answer a list of Triples that coordinate each target L2BasicBlock with the LookupTree responsible for generating code in that block, plus the list of extra L2SemanticValues that will be present at that block.

Link copied to clipboard
abstract fun <AdaptorMemento> lookupStepByTypes(    argTypes: A_Tuple,     extraValues: List<A_Type>,     adaptor: LookupTreeAdaptor<Element, Result, AdaptorMemento>,     memento: AdaptorMemento): LookupTree<Element, Result>

Perform one step of looking up the most-specific Result that matches the provided tuple of argument types. Answer another LookupTree with which to continue the search.

abstract fun <AdaptorMemento> lookupStepByTypes(    argTypes: List<A_Type>,     extraValues: List<A_Type>,     adaptor: LookupTreeAdaptor<Element, Result, AdaptorMemento>,     memento: AdaptorMemento): LookupTree<Element, Result>

Perform one step of looking up the most-specific Result that matches the provided list of argument types. Answer another LookupTree with which to continue the search.

Link copied to clipboard
abstract fun <AdaptorMemento> lookupStepByValue(    probeValue: A_BasicObject,     extraValues: List<A_BasicObject>,     adaptor: LookupTreeAdaptor<Element, Result, AdaptorMemento>,     memento: AdaptorMemento): LookupTree<Element, Result>

Perform one step of looking up the most-specific Result that matches the provided value. Answer another LookupTree with which to continue the search.

Link copied to clipboard
abstract fun <AdaptorMemento> lookupStepByValues(    argValues: List<A_BasicObject>,     extraValues: List<A_BasicObject>,     adaptor: LookupTreeAdaptor<Element, Result, AdaptorMemento>,     memento: AdaptorMemento): LookupTree<Element, Result>

Perform one step of looking up the most-specific Result that matches the provided list of arguments. Answer another LookupTree with which to continue the search.

Link copied to clipboard
abstract fun simplyAddChildrenTo(list: MutableList<LookupTree<Element, Result>>)

Add the children LookupTrees to the given list. This can be used for scanning the tree for some condition, without recursion.

Link copied to clipboard
fun sourceSemanticValue(semanticValues: List<L2SemanticValue>, extraSemanticValues: List<L2SemanticValue>): L2SemanticValue

Extract the L2SemanticValue that is providing the value operated on by this step.

Link copied to clipboard
open fun updateExtraValuesByTypes(argTypes: A_Tuple, extraValues: List<A_Type>): List<A_Type>
open fun updateExtraValuesByTypes(types: List<A_Type>, extraValues: List<A_Type>): List<A_Type>

Given an optional list of values used to supplement the lookup, answer the updated list of values that takes this step into account. The given and resulting lists must not be modified by subsequent steps.

Link copied to clipboard
open fun updateExtraValuesByValue(probeValue: A_BasicObject, extraValues: List<Element>): List<Element>

Given an optional list of values used to supplement the lookup, answer the updated list of values that takes this step into account. The given and resulting lists must not be modified by subsequent steps.

Link copied to clipboard
open fun updateExtraValuesByValues(argValues: List<A_BasicObject>, extraValues: List<Element>): List<Element>

Given an optional list of values used to supplement the lookup, answer the updated list of values that takes this step into account. The given and resulting lists must not be modified by subsequent steps.

Link copied to clipboard
open fun <Memento> updateSignatureExtrasExtractor(    adaptor: LookupTreeAdaptor<Element, Result, Memento>,     extrasTypeExtractor: (Element) -> Pair<A_Type?, List<A_Type>>,     numArgs: Int): (Element) -> Pair<A_Type?, List<A_Type>>

Given a function that produces a list of types from an Element due to an ancestor tree node, produce a new function for producing a lists of types that takes this DecisionStep into account. The function also optionally produces the type signature of the element, for reuse by subsequent wrapped functions.

Properties

Link copied to clipboard
val argumentPositionToTest: Int

The argument position to test. If the index is within bounds for the arguments, use the indicated argument, otherwise index the extraValues as though they were concatenated to the end of the arguments.

Inheritors

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard