Class ParanthesizedExpressionSyntax


public final class ParanthesizedExpressionSyntax extends ExpressionSyntax
Represents a parenthesized expression in the syntax tree. This class encapsulates an opening parenthesis token, an expression, and a closing parenthesis token.
Version:
1.0
Author:
Siyabend Urun
See Also:
  • Constructor Details

    • ParanthesizedExpressionSyntax

      public ParanthesizedExpressionSyntax(SyntaxToken openParenthesisToken, ExpressionSyntax expression, SyntaxToken closeParenthesisToken)
      Initializes a new instance of the ParenthesizedExpressionSyntax class with the specified tokens and expression.
      Parameters:
      openParenthesisToken - The opening parenthesis token.
      expression - The expression contained within the parentheses.
      closeParenthesisToken - The closing parenthesis token.
  • Method Details

    • getType

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

      public Iterator<SyntaxNode> getChildren()
      Retrieves an iterator over the child nodes of the paranthesized expression. The child nodes include the opening paranthesis token, expression, and closing paranthesis token.
      Specified by:
      getChildren in class SyntaxNode
      Returns:
      An iterator over the child nodes of the paranthesized expression.
    • setOpenParenthesisToken

      public void setOpenParenthesisToken(SyntaxToken openParenthesisToken)
      Sets the opening parenthesis token for the paranthesized expression.
      Parameters:
      openParenthesisToken - The opening parenthesis token.
    • getOpenParenthesisToken

      public SyntaxToken getOpenParenthesisToken()
      Gets the opening parenthesis token of the parenthesized expression.
      Returns:
      The opening parenthesis token.
    • setCloseParenthesisToken

      public void setCloseParenthesisToken(SyntaxToken closeParenthesisToken)
      Sets the closing parenthesis token for the paranthesized expression.
      Parameters:
      closeParenthesisToken - The closing paranthesis token.
    • getCloseParenthesisToken

      public SyntaxToken getCloseParenthesisToken()
      Gets the closing parenthesis token of the parenthesized expression.
      Returns:
      The closing parenthesis token.
    • getExpression

      public ExpressionSyntax getExpression()
      Gets the expression contained within the parentheses of the parenthesized expression.
      Returns:
      The expression within the parentheses.
    • setExpression

      public void setExpression(ExpressionSyntax _expression)
      Sets the expression contained within the parentheses of the parenthesized expression.
      Parameters:
      _expression - The expression within the parentheses.