public class StringTokenMatcher2 extends java.lang.Object implements TokenMatcher
StringTokenMatcher
a hand built pattern matcher
is used rather than regular expressions.Constructor and Description |
---|
StringTokenMatcher2(char delim,
boolean incQuotes)
Construct a string matcher.
|
Modifier and Type | Method and Description |
---|---|
static StringTokenMatcher2 |
doubleQuoteStringMatcher()
Factory for matching single line double quoted strings.
|
void |
init(Jep j)
Initialize the matcher when the Jep instance is known.
|
Token |
match(java.lang.String s)
Attempts to match the start of the string.
|
static StringTokenMatcher2 |
singleQuoteStringMatcher()
Factory for matching single line single quoted strings.
|
static StringTokenMatcher2 |
singleQuoteStringMatcher(boolean incQuotes)
Factory for matching single line single quoted strings.
|
public StringTokenMatcher2(char delim, boolean incQuotes)
delim
- The delimiter character typically " or ' or `.incQuotes
- whether the quote character should be included.public Token match(java.lang.String s) throws ParseException
TokenMatcher
match
in interface TokenMatcher
s
- the string to match againstParseException
- on syntax errorpublic static StringTokenMatcher2 doubleQuoteStringMatcher()
public static StringTokenMatcher2 singleQuoteStringMatcher()
public static StringTokenMatcher2 singleQuoteStringMatcher(boolean incQuotes)
incQuotes
- whether the quote character should be returned to the parser.public void init(Jep j)
TokenMatcher
init
in interface TokenMatcher
j
- Jep instanceCopyright © 2018 Singular Systems http://www.singularsys.com/jep