Package team.unnamed.mocha.parser.ast
Class BinaryExpression
java.lang.Object
team.unnamed.mocha.parser.ast.BinaryExpression
- All Implemented Interfaces:
Expression
Expression implementation for binary expressions
(expressions composed by two other expressions)
Example binary expressions: 1 + 1, 5 * 9,
a == b, a < b, true ?? false
- Since:
- 3.0.0
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionBinaryExpression(@NotNull BinaryExpression.Op op, @NotNull Expression left, @NotNull Expression right) -
Method Summary
Modifier and TypeMethodDescriptionbooleaninthashCode()@NotNull Expressionleft()Gets the left-hand expression for this binary expression.voidleft(@NotNull Expression left) Sets the left-hand expression for this binary expression.@NotNull BinaryExpression.Opop()Gets the binary expression type/operation.@NotNull Expressionright()Gets the right-hand expression for this binary expression.voidright(@NotNull Expression right) Sets the right-hand expression for this binary expression.toString()<R> Rvisit(@NotNull ExpressionVisitor<R> visitor) Visits this expression with the given visitor.
-
Constructor Details
-
BinaryExpression
public BinaryExpression(@NotNull @NotNull BinaryExpression.Op op, @NotNull @NotNull Expression left, @NotNull @NotNull Expression right)
-
-
Method Details
-
op
Gets the binary expression type/operation.- Returns:
- The expression operation.
- Since:
- 3.0.0
-
left
Gets the left-hand expression for this binary expression.- Returns:
- The left-hand expression
- Since:
- 3.0.0
-
left
Sets the left-hand expression for this binary expression.- Parameters:
left- The left-hand expression- Since:
- 3.0.0
-
right
Gets the right-hand expression for this binary expression.- Returns:
- The right-hand expression
- Since:
- 3.0.0
-
right
Sets the right-hand expression for this binary expression.- Parameters:
right- The right-hand expression- Since:
- 3.0.0
-
visit
Description copied from interface:ExpressionVisits this expression with the given visitor.- Specified by:
visitin interfaceExpression- Type Parameters:
R- The visit result return type- Parameters:
visitor- The expression visitor- Returns:
- The visit result
-
toString
-
equals
-
hashCode
public int hashCode()
-