Class UnaryOperatorNode

java.lang.Object
com.maroontress.intexpr.syntaxtree.UnaryOperatorNode
All Implemented Interfaces:
SyntaxNode

public final class UnaryOperatorNode extends Object implements SyntaxNode
The syntax node representing a unary operator.
  • Constructor Details

    • UnaryOperatorNode

      public UnaryOperatorNode(Opcode opcode, SyntaxNode operand)
      Creates a new instance.
      Parameters:
      opcode - The opcode.
      operand - The operand.
  • Method Details

    • toString

      public String toString(String firstIndent, String indent)
      Returns the string visualizing the syntax tree.
      Specified by:
      toString in interface SyntaxNode
      Parameters:
      firstIndent - The string to indent the first line.
      indent - The string to indent the second and subsequent lines.
      Returns:
      The string visualizing the syntax tree.