Get the original syntax string that was used to create this expression. This can be useful for debugging, logging, or error messages to provide context about where the expression came from.
the original syntax string of the expression.
What expressions comprise the expression for use in caching/memoization.
an array of expressions that can be cached/memoized.
What data keys are required for this expression to be evaluated? This information is used by the rule engine to determine the dependencies between expressions and rules, and to ensure that all necessary data is available before evaluating the expression.
a set of data keys required for this expression to be evaluated.
What functions are invoked by this expression? This information can be used for optimization, caching, or to determine which function nodes in the graph are relevant for this expression.
a set of function names invoked by this expression.
Check the types of the expression using the provided type checker.
Optionalchecker: TypeCheckerthe type checker to use for validating the expression's types.
the result of the type check.
Evaluate the expression in the given context to compute its value. The implementation of this method will depend on the specific type of expression and how it computes its value based on the data in the context.
the current working context containing data and constants.
the computed value of the expression.
Get a string representation of the expression, which can be used for debugging, logging, or error messages.
a string representation of the expression.
Get a JSON representation of the expression, which can be used for serialization, logging, or visualization.
a JSON representation of the expression.
Represents an expression that can be evaluated in a given context to produce a value. Expressions can be used in conditions, assignments, and other parts of the rule syntax to compute values based on the current state of the working context. Each expression must implement the required() method to specify which data keys it depends on, and the evaluate() method to compute its value based on the context.