ExpressionEvaluator

open class ExpressionEvaluator: TermVisitor<Term>, Any

A class implementing a visitor that will evaluate expression terms according to context loaded functions

No additional check is implemented at this level

Fields

Name Description
protected loadedFunctions: /** Shorthand to access context loaded functions */

Shorthand to access context loaded functions

Constructors

<init>

constructor(context: ExecutionContext)

A class implementing a visitor that will evaluate expression terms according to context loaded functions

No additional check is implemented at this level

Parameters

Name Description
context: ExecutionContext

the context in which the evaluation should happen

Methods

defaultValue

open fun defaultValue(term: Term): Term

Parameters

Name Description
term: Term

ReturnValue

Name Description
Term

visit

open fun visit(term: Term): Term

Parameters

Name Description
term: Term

ReturnValue

Name Description
Term

visitAtom

open fun visitAtom(term: Atom): Term

Parameters

Name Description
term: Atom

ReturnValue

Name Description
Term

visitStruct

open fun visitStruct(term: Struct): Term

Parameters

Name Description
term: Struct

ReturnValue

Name Description
Term

staticCheck

protected open fun Term.staticCheck(context: ExecutionContext)

Template method to implement static checks, i.e. those checks that can be made before evaluating sub-expressions

This is a stub implementation, that does nothing

Receiver

Name Description
Term

Parameters

Name Description
context: ExecutionContext

ReturnValue

Name Description
Unit

dynamicCheck

protected open fun Term.dynamicCheck(enclosingTerm: Struct, context: ExecutionContext)

Template method to implement dynamic checks, i.e. those checks that must be made after sub-expression evaluation, on its result

This is a stub implementation, that does nothing

Receiver

Name Description
Term

Parameters

Name Description
enclosingTerm: Struct
context: ExecutionContext

ReturnValue

Name Description
Unit