Interface PendedOperator


public interface PendedOperator
This interface represents the operator wrapper temporally created while the Compiler creates the list of Instruction objects in Reverse Polish notation.
See Also:
  • Method Details

    • toOperator

      Optional<Operator> toOperator()
      Returns the operator that this wraps if this is not a left parenthesis, otherwise Optional.empty().
      Returns:
      The operator that this wraps or Optional.empty().
    • comparePrecedence

      int comparePrecedence(Operator that)
      Compares the precedences of this and the specified operator.
      Parameters:
      that - The operator to compare the precedence of.
      Returns:
      A negative integer, zero, or a positive integer as the precedence of this is less than, equal to, or greater than one of that.
    • getToken

      com.maroontress.clione.Token getToken()
      Returns the token if this is a left parenthesis or throws IllegalStateException otherwise.
      Returns:
      The token.
    • newLeftParen

      static PendedOperator newLeftParen(com.maroontress.clione.Token token)
      Returns a new PendedOperator object that represents a left parenthesis.
      Parameters:
      token - The token representing a left parenthesis.
      Returns:
      The new PendedOperator object.
    • of

      static PendedOperator of(Operator operator)
      Returns a new PendedOperator object that represents the specified operator.
      Parameters:
      operator - The operator to wrap.
      Returns:
      The new PendedOperator object.