Package jminusminus

Class JUnaryExpression

Direct Known Subclasses:
JComplementOp, JLogicalNotOp, JNegateOp, JPostDecrementOp, JPostIncrementOp, JPreDecrementOp, JPreIncrementOp, JUnaryPlusOp

abstract class JUnaryExpression extends JExpression
This abstract base class is the AST node for an unary expression --- an expression with a single operand.
  • Field Details

    • operator

      protected String operator
      The unary operator.
    • operand

      protected JExpression operand
      The operand.
  • Constructor Details

    • JUnaryExpression

      protected JUnaryExpression(int line, String operator, JExpression operand)
      Constructs an AST node for an unary expression.
      Parameters:
      line - line in which the unary expression occurs in the source file.
      operator - the unary operator.
      operand - the 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.