Class UnaryExpressionSyntax


public final class UnaryExpressionSyntax extends ExpressionSyntax
Represents a unary expression in the syntax tree. This class defines a unary 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 -a or !b. This class inherits from the ExpressionSyntax class and provides additional properties and methods specific to Unary expressions.
Version:
1.0
Author:
Siyabend Urun
See Also:
  • Constructor Details

    • UnaryExpressionSyntax

      public UnaryExpressionSyntax(SyntaxToken operator, ExpressionSyntax operand)
      Initializes a new instance of the UnaryExpressionSyntax class.
      Parameters:
      operator - The operator token.
      operand - The operand token.
  • Method Details

    • 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.
    • getOperand

      public ExpressionSyntax getOperand()
      Gets the operand of the unary expression.
      Returns:
      The operand of the unary expression.
    • setOperand

      public void setOperand(ExpressionSyntax operand)
      Sets the operand of the unary expression.
      Parameters:
      operand - The new operand 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 unary expression.
    • getChildren

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