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 TypeMethodDescriptionvoidaccept(Deque<SyntaxNode> stack) getCode()Returns the executable code associated with this.intReturns the precedence of the operator.static Optional<OperatorSpec> query(String symbol, OperatorType type) Returns theOperatorSpecobject corresponding to the specified symbol and operator type.toString()
-
Method Details
-
query
Returns theOperatorSpecobject corresponding to the specified symbol and operator type.- Parameters:
symbol- The symbol representing theOperatorSpecobject.type-OperatorType.UNARYorOperatorType.BINARY.- Returns:
- The
OperatorSpecobject 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:
acceptin interfaceConsumer<Deque<SyntaxNode>>
-
toString
-