- All Known Implementing Classes:
Expr.Assign
,Expr.Binary
,Expr.Call
,Expr.CallOptional
,Expr.Get
,Expr.GetOptional
,Expr.Grouping
,Expr.Literal
,Expr.Logical
,Expr.NullishCoalescence
,Expr.Set
,Expr.Ternary
,Expr.Unary
,Expr.Variable
public interface Expr
Expr represents code that evaluates to a value.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final record
Expression that assigns a value to a variable.static final record
Expression for binary operators that operate on two expression (such as "+" to sum numbers).static final record
Expression that calls aSolaScriptCallable
with desired arguments.static final record
Expression that calls aSolaScriptCallable
with desired arguments.static final record
Expression that gets a property from aSolaScriptMap
and returns its.static final record
Expression that gets a property from aSolaScriptMap
and returns its.static final record
Grouping expressions warps an expression to change when it is evaluated.static final record
Literal expressions hold a value such as string, number, boolean, map or null.static final record
Expression for logical operators that operate on two expression (such as "||" to evaluate a logical or).static final record
Expression for nullish coalescence operator that evaluates to the right side expression if the left side expression evaluates to null.static final record
Expression that sets a property on aSolaScriptMap
.static final record
Expression for a ternary operation.static final record
Expression for unary operators that operate on one expression (such as "!" to invert a boolean).static final record
Variable expressions hold a name of a variable to evaluate the value of.static interface
Defines operations for the variousExpr
implementations. -
Method Summary
Modifier and TypeMethodDescription<R> @Nullable R
accept
(Expr.Visitor<R> visitor) Evaluate this expression via the desiredExpr.Visitor
-
Method Details
-
accept
Evaluate this expression via the desiredExpr.Visitor
- Type Parameters:
R
- the return type- Parameters:
visitor
- theExpr.Visitor
to evaluate this expression- Returns:
- the evaluated value
-