AbstractTermVisitor

abstract class AbstractTermVisitor<T> : TermVisitor<T>

A TermVisitor for the handful of Term sub-types that inherit from more than one immediate supertype in the hierarchy (namely Atom, which is both a it.unibo.tuprolog.core.Struct and a it.unibo.tuprolog.core.Constant, and it.unibo.tuprolog.core.EmptyList/it.unibo.tuprolog.core.EmptyBlock, each both a collection type and it.unibo.tuprolog.core.Empty). TermVisitor's default dispatch can only delegate to one supertype's visitX method; join is where subclasses decide how to combine the results of visiting as each of the (here, two) relevant supertypes. DefaultTermVisitor and ExhaustiveTermVisitor provide the two most common policies (first result wins, last result wins).

Inheritors

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
abstract fun defaultValue(term: Term): T

The value produced for any Term whose specific type has no dedicated, overridden visitX method.

Link copied to clipboard
open override fun visitAtom(term: Atom): T
Link copied to clipboard
open fun visitBlock(term: Block): T
Link copied to clipboard
open fun visitClause(term: Clause): T
Link copied to clipboard
open fun visitCollection(term: Recursive): T
Link copied to clipboard
open fun visitCons(term: Cons): T
Link copied to clipboard
open fun visitConstant(term: Constant): T
Link copied to clipboard
open fun visitDirective(term: Directive): T
Link copied to clipboard
open fun visitEmpty(term: Empty): T
Link copied to clipboard
open override fun visitEmptyBlock(term: EmptyBlock): T
Link copied to clipboard
open override fun visitEmptyList(term: EmptyList): T
Link copied to clipboard
open fun visitFact(term: Fact): T
Link copied to clipboard
open fun visitIndicator(term: Indicator): T
Link copied to clipboard
open fun visitInteger(term: Integer): T
Link copied to clipboard
open fun visitList(term: List): T
Link copied to clipboard
open fun visitNumeric(term: Numeric): T
Link copied to clipboard
open fun visitReal(term: Real): T
Link copied to clipboard
open fun visitRule(term: Rule): T
Link copied to clipboard
open fun visitStruct(term: Struct): T
Link copied to clipboard
open fun visitTerm(term: Term): T

Visits a generic Term, regardless of its specific sub-type. Falls back to defaultValue.

Link copied to clipboard
open fun visitTruth(term: Truth): T
Link copied to clipboard
open fun visitTuple(term: Tuple): T
Link copied to clipboard
open fun visitVar(term: Var): T