Package codeanalysis.syntax
Class BinaryExpressionSyntax
java.lang.Object
codeanalysis.syntax.SyntaxNode
codeanalysis.syntax.ExpressionSyntax
codeanalysis.syntax.BinaryExpressionSyntax
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:
-
Field Summary
Fields inherited from class codeanalysis.syntax.SyntaxNode
_span -
Constructor Summary
ConstructorsConstructorDescriptionBinaryExpressionSyntax(ExpressionSyntax left, SyntaxToken operator, ExpressionSyntax right) Initializes a new instance of the BinaryExpressionSyntax class. -
Method Summary
Modifier and TypeMethodDescriptionReturns an iterator over the child nodes of the binary expression.getLeft()Gets the left-hand side expression.Gets the number token.Gets the operator token.getRight()Gets the right-hand side expression.getType()Gets the type of the syntax node.voidsetLeft(ExpressionSyntax left) Sets the left-hand side expression.voidsetNumberToken(SyntaxToken _numberToken) Sets the number token.voidsetOperator(SyntaxToken operator) Sets the operator token.voidsetRight(ExpressionSyntax right) Sets the right-hand side expression.Methods inherited from class codeanalysis.syntax.SyntaxNode
getSpan, toString, writeTo
-
Constructor Details
-
BinaryExpressionSyntax
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
Gets the number token.- Returns:
- The number token.
-
setNumberToken
Sets the number token.- Parameters:
_numberToken- The number token to set.
-
getLeft
Gets the left-hand side expression.- Returns:
- The left-hand side expression.
-
setLeft
Sets the left-hand side expression.- Parameters:
left- The left-hand side expression to set.
-
getOperator
Gets the operator token.- Returns:
- The operator token.
-
setOperator
Sets the operator token.- Parameters:
operator- The operator token to set.
-
getRight
Gets the right-hand side expression.- Returns:
- The right-hand side expression.
-
setRight
Sets the right-hand side expression.- Parameters:
right- The right-hand side expression to set.
-
getType
Gets the type of the syntax node.- Specified by:
getTypein classSyntaxNode- Returns:
- The syntax type of the binary expression.
-
getChildren
Returns an iterator over the child nodes of the binary expression.- Specified by:
getChildrenin classSyntaxNode- Returns:
- An iterator over the child nodes.
-