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 
     
    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 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