Class OperatorToken
java.lang.Object
com.singularsys.jep.configurableparser.tokens.Token
com.singularsys.jep.configurableparser.tokens.OperatorToken
- All Implemented Interfaces:
Serializable
A token representing an operator.
The operator may be overloaded representing prefix, suffix, binary infix and ternary operators.
In Jep 3.5 and later there is one OperatorToken for each alternate symbol.
- See Also:
-
Constructor Summary
-
Method Summary
Methods inherited from class com.singularsys.jep.configurableparser.tokens.Token
equals, getColumnNumber, getLength, getLineNumber, getSource, hashCode, isComment, isFunction, isIdentifier, isImplicitMulRhs, isNumber, isString, isSymbol, isTerminal, isWhiteSpace, setPosition
-
Constructor Details
-
OperatorToken
Creates the basic token. Copies of this token will be created during parsing.- Parameters:
ops
- list of operators this matchessymbol
- text to be matched- Since:
- Jep 3.5
-
-
Method Details
-
getBinaryOp
If this symbol represents a binary infix operator then return it.- Returns:
- the binary op or null if no binary is operator specified.
-
getPrefixOp
-
getSuffixOp
-
getTernaryOp
-
isOperator
public boolean isOperator()- Overrides:
isOperator
in classToken
-
isBinary
public boolean isBinary() -
isPrefix
public boolean isPrefix() -
isSuffix
public boolean isSuffix() -
isTernary
public boolean isTernary() -
toString
-
cloneToken
Creates a copy of this token- Returns:
- a copy of the token
-