public interface Grammar
| Modifier and Type | Method and Description |
|---|---|
void |
addFunction(String functionName)
Use this method to add any function identification to the grammar.
|
String |
getOppositeBracket(String bracket)
Returns the opposite bracket for the given bracket.
|
int |
getPrecedenceOrder(ExpressionToken operator,
boolean isUnary)
Gets the precedence order of the given operator
|
int |
getPrecedenceOrder(String operator,
boolean isUnary)
Gets the precedence order of the given operator
|
boolean |
isAllowed(String token)
Checks whether the token is allowed or not.
|
boolean |
isApproachable(String token)
Checks whether the given token is approachable using any of the pattern
or not.
|
boolean |
isBinaryOperator(ExpressionToken token)
Checks whether the given token is a binary operator or not.
|
boolean |
isBinaryOperator(String token)
Checks whether the given token is a binary operator or not.
|
boolean |
isBracket(ExpressionToken token)
Check whether the given token is a bracket or not.
|
boolean |
isBracket(String token)
Check whether the given token is a bracket or not.
|
boolean |
isDelimiter(ExpressionToken token)
Checks whether the token is a delimiter or not.
|
boolean |
isDelimiter(String token)
Checks whether the token is a delimiter or not.
|
boolean |
isFunction(ExpressionToken token)
Checks whether the token is an function or not.
|
boolean |
isFunction(String token)
Checks whether the token is an function or not.
|
boolean |
isIgnoreBlank()
Checks whether to ignore the blanks in expression or not.
|
boolean |
isLeftBracket(ExpressionToken token)
Checks whether the token is a left bracket or not.
|
boolean |
isLeftBracket(String token)
Checks whether the token is a left bracket or not.
|
boolean |
isOperator(ExpressionToken token)
Checks whether the given token is an operator or not.
|
boolean |
isOperator(String token)
Checks whether the given token is an operator or not.
|
boolean |
isRightBracket(ExpressionToken token)
Checks whether the token is a right bracket or not.
|
boolean |
isRightBracket(String token)
Checks whether the token is a right bracket or not.
|
boolean |
isUnary(ExpressionToken operator)
Checks whether the given operator is a unary operator or not.
|
boolean |
isUnary(String operator)
Checks whether the given operator is a unary operator or not.
|
boolean isDelimiter(ExpressionToken token)
token - the tokentrue if the token is delimiter false otherwise.boolean isDelimiter(String token)
token - the tokentrue if the token is delimiter false otherwise.boolean isApproachable(String token)
token - the token, partially or full constructed, to check whether
it can approach to any expression token pattern or not.true if the token pattern is approachable false otherwise.boolean isAllowed(String token)
token - the token which is to be checked for its validitytrue if the token is allowed false otherwise.boolean isOperator(ExpressionToken token)
token - the token to checktrue if the token is an operator false otherwiseboolean isOperator(String token)
token - the token to checktrue if the token is an operator false otherwiseboolean isFunction(ExpressionToken token)
token - the token to checktrue if the token is an function false otherwiseboolean isFunction(String token)
token - the token to checktrue if the token is an function false otherwisevoid addFunction(String functionName)
functionName - name of the function to addboolean isBinaryOperator(ExpressionToken token)
token - the token to checktrue if the token is a binary operator false otherwiseboolean isBinaryOperator(String token)
token - the token to checktrue if the token is a binary operator false otherwiseboolean isUnary(ExpressionToken operator)
operator - the operator to checktrue if the operator is used as unary operator false otherwise.boolean isUnary(String operator)
operator - the operator to checktrue if the operator is used as unary operator false otherwise.int getPrecedenceOrder(ExpressionToken operator, boolean isUnary)
operator - the operator to check for precedenceisUnary - true if the operator is unary, as an operator can behave
either as unary or as binaryint getPrecedenceOrder(String operator, boolean isUnary)
operator - the operator to check for precedenceisUnary - true if the operator is unary, as an operator can behave
either as unary or as binaryboolean isLeftBracket(ExpressionToken token)
token - the token to checktrue if the token can be used as left bracket false otherwise.boolean isLeftBracket(String token)
token - the token to checktrue if the token can be used as left bracket false otherwise.boolean isRightBracket(ExpressionToken token)
token - the token to checktrue if the token can be used as right bracket false otherwise.boolean isRightBracket(String token)
token - the token to checktrue if the token can be used as right bracket false otherwise.boolean isBracket(ExpressionToken token)
token - the token to checktrue if the token is a bracket false otherwiseboolean isBracket(String token)
token - the token to checktrue if the token is a bracket false otherwiseString getOppositeBracket(String bracket)
bracket - the bracket for which we need to find the opposite bracketboolean isIgnoreBlank()
true if parser wants to exclude the blanks false otherwise.