Expression

sealed interface Expression

Represents any kind of expression. This is an abstract top-level interface and describes no details about an expression on its own. Expressions may be of various specific types (e.g., AttributePath, ComparisonExpr, AndExpr, etc.) each of which have specific data detailing the expression.

Expression and its derivatives support the visitor design pattern by way of an accept method.

Inheritors

Functions

Link copied to clipboard
abstract fun <T> accept(visitor: ExpressionVisitor<T>): T

Accepts a visitor that is traversing an expression tree by dispatching to a subtype implementation. Subtype implementations MUST call the ExpressionVisitor.visit overload for their concrete type (effectively forming a double dispatch) and MUST return the resulting value.