Interface Expr

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 Classes
    Modifier and Type
    Interface
    Description
    static 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 a SolaScriptCallable with desired arguments.
    static final record 
    Expression that calls a SolaScriptCallable with desired arguments.
    static final record 
    Expression that gets a property from a SolaScriptMap and returns its.
    static final record 
    Expression that gets a property from a SolaScriptMap 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 a SolaScriptMap.
    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 various Expr implementations.
  • Method Summary

    Modifier and Type
    Method
    Description
    <R> @Nullable R
    accept(Expr.Visitor<R> visitor)
    Evaluate this expression via the desired Expr.Visitor
  • Method Details

    • accept

      <R> @Nullable R accept(Expr.Visitor<R> visitor)
      Evaluate this expression via the desired Expr.Visitor
      Type Parameters:
      R - the return type
      Parameters:
      visitor - the Expr.Visitor to evaluate this expression
      Returns:
      the evaluated value