Package team.unnamed.mocha.parser.ast
Class UnaryExpression
java.lang.Object
team.unnamed.mocha.parser.ast.UnaryExpression
- All Implemented Interfaces:
Expression
Unary expression implementation, performs a single operation
to a single expression, like logical negation, arithmetical
negation, or "return expr;".
Example unary expressions: -hello, !p,
!q, -(10 * 5), return this,
return 5
- Since:
- 3.0.0
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionUnaryExpression(@NotNull UnaryExpression.Op op, @NotNull Expression expression) -
Method Summary
Modifier and TypeMethodDescriptionboolean@NotNull ExpressionGets the operated expression.voidexpression(@NotNull Expression expression) Sets the operated expression.inthashCode()@NotNull UnaryExpression.Opop()Gets the unary expression operation.toString()<R> Rvisit(@NotNull ExpressionVisitor<R> visitor) Visits this expression with the given visitor.
-
Constructor Details
-
UnaryExpression
public UnaryExpression(@NotNull @NotNull UnaryExpression.Op op, @NotNull @NotNull Expression expression)
-
-
Method Details
-
op
Gets the unary expression operation.- Returns:
- The unary expression operation.
- Since:
- 3.0.0
-
expression
Gets the operated expression.- Returns:
- The operated expression.
- Since:
- 3.0.0
-
expression
Sets the operated expression.- Parameters:
expression- The operated 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()
-