Package codeanalysis.syntax
Class ParanthesizedExpressionSyntax
java.lang.Object
codeanalysis.syntax.SyntaxNode
codeanalysis.syntax.ExpressionSyntax
codeanalysis.syntax.ParanthesizedExpressionSyntax
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:
-
Field Summary
Fields inherited from class codeanalysis.syntax.SyntaxNode
_span -
Constructor Summary
ConstructorsConstructorDescriptionParanthesizedExpressionSyntax(SyntaxToken openParenthesisToken, ExpressionSyntax expression, SyntaxToken closeParenthesisToken) Initializes a new instance of the ParenthesizedExpressionSyntax class with the specified tokens and expression. -
Method Summary
Modifier and TypeMethodDescriptionRetrieves an iterator over the child nodes of the paranthesized expression.Gets the closing parenthesis token of the parenthesized expression.Gets the expression contained within the parentheses of the parenthesized expression.Gets the opening parenthesis token of the parenthesized expression.getType()Gets the syntax type of the parenthesized expression.voidsetCloseParenthesisToken(SyntaxToken closeParenthesisToken) Sets the closing parenthesis token for the paranthesized expression.voidsetExpression(ExpressionSyntax _expression) Sets the expression contained within the parentheses of the parenthesized expression.voidsetOpenParenthesisToken(SyntaxToken openParenthesisToken) Sets the opening parenthesis token for the paranthesized expression.Methods inherited from class codeanalysis.syntax.SyntaxNode
getSpan, toString, writeTo
-
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
Gets the syntax type of the parenthesized expression.- Specified by:
getTypein classSyntaxNode- Returns:
- The syntax type of the parenthesized expression.
-
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:
getChildrenin classSyntaxNode- Returns:
- An iterator over the child nodes of the paranthesized expression.
-
setOpenParenthesisToken
Sets the opening parenthesis token for the paranthesized expression.- Parameters:
openParenthesisToken- The opening parenthesis token.
-
getOpenParenthesisToken
Gets the opening parenthesis token of the parenthesized expression.- Returns:
- The opening parenthesis token.
-
setCloseParenthesisToken
Sets the closing parenthesis token for the paranthesized expression.- Parameters:
closeParenthesisToken- The closing paranthesis token.
-
getCloseParenthesisToken
Gets the closing parenthesis token of the parenthesized expression.- Returns:
- The closing parenthesis token.
-
getExpression
Gets the expression contained within the parentheses of the parenthesized expression.- Returns:
- The expression within the parentheses.
-
setExpression
Sets the expression contained within the parentheses of the parenthesized expression.- Parameters:
_expression- The expression within the parentheses.
-