E
- the type of the base expressionspublic abstract class LogicExpressionParser<E> extends java.lang.Object implements com.google.common.base.Function<java.lang.String,LogicExpression<E>>
Modifier and Type | Field and Description |
---|---|
static java.util.regex.Pattern |
doubleQuoteStringLiteralRegex |
static java.util.regex.Pattern |
regexLiteralRegex |
static java.util.regex.Pattern |
singleQuoteStringLiteralRegex |
Constructor and Description |
---|
LogicExpressionParser() |
Modifier and Type | Method and Description |
---|---|
LogicExpression<E> |
apply(java.lang.String string) |
abstract Expression.Arg<E> |
factory(java.lang.String argument)
The factory method creates an argument from the supplied token string.
|
LogicExpression<E> |
parse(java.lang.String string)
Create a LogicExpression object from the supplied string.
|
java.lang.String |
readToken(java.lang.String remainder)
The readToken method reads a token from the remaining LogicExpression string.
|
java.util.List<Expression<E>> |
tokenize(java.lang.String input)
Convert an infix string logic representation to an infix list of tokens.
|
public static final java.util.regex.Pattern doubleQuoteStringLiteralRegex
public static final java.util.regex.Pattern singleQuoteStringLiteralRegex
public static final java.util.regex.Pattern regexLiteralRegex
public LogicExpression<E> parse(java.lang.String string)
string
- public LogicExpression<E> apply(java.lang.String string)
apply
in interface com.google.common.base.Function<java.lang.String,LogicExpression<E>>
public abstract Expression.Arg<E> factory(java.lang.String argument)
argument
- a string representation of a tokenpublic java.lang.String readToken(java.lang.String remainder)
remainder
- the remaining text to tokenizepublic java.util.List<Expression<E>> tokenize(java.lang.String input) throws LogicException.TokenizeLogicException
input
- an infix string logic representation.factory
- a delegate that converts a string representation of an
argument into a token object. @returnLogicException.TokenizeLogicException