Class BinaryOperatorNode

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

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

    • BinaryOperatorNode

      public BinaryOperatorNode(Opcode opcode, SyntaxNode leftOperand, SyntaxNode rightOperand)
      Creates a new instance.
      Parameters:
      opcode - The opcode.
      leftOperand - The left operand.
      rightOperand - The right 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.