Package codeanalysis.syntax
Class UnaryExpressionSyntax
java.lang.Object
codeanalysis.syntax.SyntaxNode
codeanalysis.syntax.ExpressionSyntax
codeanalysis.syntax.UnaryExpressionSyntax
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:
-
Field Summary
Fields inherited from class codeanalysis.syntax.SyntaxNode
_span -
Constructor Summary
ConstructorsConstructorDescriptionUnaryExpressionSyntax(SyntaxToken operator, ExpressionSyntax operand) Initializes a new instance of the UnaryExpressionSyntax class. -
Method Summary
Modifier and TypeMethodDescriptionReturns an iterator over the child nodes of the unary expression.Gets the operand of the unary expression.Gets the operator token.getType()Gets the type of the syntax node.voidsetOperand(ExpressionSyntax operand) Sets the operand of the unary expression.voidsetOperator(SyntaxToken operator) Sets the operator token.Methods inherited from class codeanalysis.syntax.SyntaxNode
getSpan, toString, writeTo
-
Constructor Details
-
UnaryExpressionSyntax
Initializes a new instance of the UnaryExpressionSyntax class.- Parameters:
operator- The operator token.operand- The operand token.
-
-
Method Details
-
getOperator
Gets the operator token.- Returns:
- The operator token.
-
setOperator
Sets the operator token.- Parameters:
operator- The operator token to set.
-
getOperand
Gets the operand of the unary expression.- Returns:
- The operand of the unary expression.
-
setOperand
Sets the operand of the unary expression.- Parameters:
operand- The new operand to set.
-
getType
Gets the type of the syntax node.- Specified by:
getTypein classSyntaxNode- Returns:
- The syntax type of the unary expression.
-
getChildren
Returns an iterator over the child nodes of the unary expression.- Specified by:
getChildrenin classSyntaxNode- Returns:
- An iterator over the child nodes.
-