Class CallExpression

java.lang.Object
team.unnamed.mocha.parser.ast.CallExpression
All Implemented Interfaces:
Expression

public final class CallExpression extends Object implements Expression
Call expression implementation, executes functions with certain arguments.

Example call expressions: print('hello'), math.sqrt(9), math.pow(3, 2)

Since:
3.0.0
  • Constructor Details

    • CallExpression

      public CallExpression(@NotNull @NotNull Expression function, @NotNull @NotNull List<Expression> arguments)
  • Method Details

    • function

      @NotNull public @NotNull Expression function()
      Gets the function expression.
      Since:
      3.0.0
    • function

      public void function(@NotNull @NotNull Expression function)
      Sets the function expression.
      Since:
      3.0.0
    • arguments

      @NotNull public @NotNull List<Expression> arguments()
      Gets the list of arguments to pass to the function.
      Since:
      3.0.0
    • visit

      public <R> R visit(@NotNull @NotNull ExpressionVisitor<R> visitor)
      Description copied from interface: Expression
      Visits this expression with the given visitor.
      Specified by:
      visit in interface Expression
      Type Parameters:
      R - The visit result return type
      Parameters:
      visitor - The expression visitor
      Returns:
      The visit result
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object