- 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
static final record
static final record
static final record
static final record
static final record
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
static final record
static final record
static final record
static final record
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
-