java.lang.Object
com.maroontress.intexpr.impl.OperatorSpec
- All Implemented Interfaces:
Consumer<Deque<SyntaxNode>>
This class provides the class objects of operators.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
accept
(Deque<SyntaxNode> stack) getCode()
Returns the executable code associated with this.int
Returns the precedence of the operator.static Optional<OperatorSpec>
query
(String symbol, OperatorType type) Returns theOperatorSpec
object corresponding to the specified symbol and operator type.toString()
-
Method Details
-
query
Returns theOperatorSpec
object corresponding to the specified symbol and operator type.- Parameters:
symbol
- The symbol representing theOperatorSpec
object.type
-OperatorType.UNARY
orOperatorType.BINARY
.- Returns:
- The
OperatorSpec
object if found, otherwiseOptional.empty()
.
-
getCode
Returns the executable code associated with this.- Returns:
- The executable code.
-
getPrecedence
public int getPrecedence()Returns the precedence of the operator.- Returns:
- The precedence of the operator.
-
accept
- Specified by:
accept
in interfaceConsumer<Deque<SyntaxNode>>
-
toString
-