Package jminusminus

Class JBinaryExpression

Direct Known Subclasses:
JALeftShiftOp, JAndOp, JARightShiftOp, JAssignment, JBooleanBinaryExpression, JDivideOp, JLRightShiftOp, JMultiplyOp, JOrOp, JPlusOp, JRemainderOp, JStringConcatenationOp, JSubtractOp, JXorOp

abstract class JBinaryExpression extends JExpression
This abstract base class is the AST node for a binary expression --- an expression with a binary operator and two operands: lhs and rhs.
  • Field Details

    • operator

      protected String operator
      The binary operator.
    • lhs

      protected JExpression lhs
      The lhs operand.
    • rhs

      protected JExpression rhs
      The rhs operand.
  • Constructor Details

    • JBinaryExpression

      protected JBinaryExpression(int line, String operator, JExpression lhs, JExpression rhs)
      Constructs an AST node for a binary expression.
      Parameters:
      line - line in which the binary expression occurs in the source file.
      operator - the binary operator.
      lhs - the lhs operand.
      rhs - the rhs operand.
  • Method Details

    • toJSON

      public void toJSON(JSONElement json)
      Stores information about this AST in JSON format.
      Overrides:
      toJSON in class JAST
      Parameters:
      json - the JSON emitter.