Interface PegOperatorTerm<T>

Type Parameters:
T - the type of operands used by this operator
All Superinterfaces:
PegTerm
All Known Implementing Classes:
PegArithmeticsOperatorTerm, PegBoolOperatorTerm

public interface PegOperatorTerm<T> extends PegTerm
Interface for all operator terms. Operators have a priority of execution and can be applied to two operands.
Author:
skerdudou
  • Method Summary

    Modifier and Type
    Method
    Description
    apply(T left, T right)
    Apply the operator to the two operands.
    int
    Get the priority of the operator.

    Methods inherited from interface io.vertigo.commons.peg.term.PegTerm

    getStrValues
  • Method Details

    • getPriority

      int getPriority()
      Get the priority of the operator. Higher is the priority, earlier the operator is executed.
      Returns:
      the priority of the operator
    • apply

      T apply(T left, T right) throws PegParsingValueException
      Apply the operator to the two operands.
      Parameters:
      left - the left operand
      right - the right operand
      Returns:
      the result of the operation
      Throws:
      PegParsingValueException - if the operator cannot be applied to the operands