Class BinaryExpressionSyntax


public final class BinaryExpressionSyntax extends ExpressionSyntax
Represents a binary expression in the syntax tree. This class defines a binary expression, which consists of a left-hand side expression, an operator token, and a right-hand side expression. It is used to represent expressions like "x + y" or "a * b". This class inherits from the ExpressionSyntax class and provides additional properties and methods specific to binary expressions.
Version:
1.0
Author:
Siyabend Urun
See Also:
  • Constructor Details

    • BinaryExpressionSyntax

      public BinaryExpressionSyntax(ExpressionSyntax left, SyntaxToken operator, ExpressionSyntax right)
      Initializes a new instance of the BinaryExpressionSyntax class.
      Parameters:
      left - The left-hand side expression.
      operator - The operator token.
      right - The right-hand side expression.
  • Method Details

    • getNumberToken

      public SyntaxToken getNumberToken()
      Gets the number token.
      Returns:
      The number token.
    • setNumberToken

      public void setNumberToken(SyntaxToken _numberToken)
      Sets the number token.
      Parameters:
      _numberToken - The number token to set.
    • getLeft

      public ExpressionSyntax getLeft()
      Gets the left-hand side expression.
      Returns:
      The left-hand side expression.
    • setLeft

      public void setLeft(ExpressionSyntax left)
      Sets the left-hand side expression.
      Parameters:
      left - The left-hand side expression to set.
    • getOperator

      public SyntaxToken getOperator()
      Gets the operator token.
      Returns:
      The operator token.
    • setOperator

      public void setOperator(SyntaxToken operator)
      Sets the operator token.
      Parameters:
      operator - The operator token to set.
    • getRight

      public ExpressionSyntax getRight()
      Gets the right-hand side expression.
      Returns:
      The right-hand side expression.
    • setRight

      public void setRight(ExpressionSyntax right)
      Sets the right-hand side expression.
      Parameters:
      right - The right-hand side expression to set.
    • getType

      public SyntaxType getType()
      Gets the type of the syntax node.
      Specified by:
      getType in class SyntaxNode
      Returns:
      The syntax type of the binary expression.
    • getChildren

      public Iterator<SyntaxNode> getChildren()
      Returns an iterator over the child nodes of the binary expression.
      Specified by:
      getChildren in class SyntaxNode
      Returns:
      An iterator over the child nodes.