Class Expr.BinOp

  • Direct Known Subclasses:
    Expr.And, Expr.Or
    Enclosing class:
    Expr

    abstract static class Expr.BinOp
    extends Expr
    Abstract base class for binary expressions.
    • Field Detail

      • left

        public final Expr left
        The left subexpression of the binary expression
      • right

        public final Expr right
        The right subexpression of the binary expression
    • Constructor Detail

      • BinOp

        public BinOp​(Expr left,
                     Expr right)
        Constructor initializing left and right subexpressions.
        Parameters:
        left - the left subexpression
        right - the right subexpression
    • Method Detail

      • toString

        public String toString()
        Returns a string representation.
        Overrides:
        toString in class Object
        Returns:
        the string representation
      • getOp

        protected abstract String getOp()
        Returns the string for the operator of the binary expression.
        Returns:
        the string for the operator