Package | Description |
---|---|
org.jparsec |
Provides core Parser implementations for parser combinator logic.
|
org.jparsec.examples.java.parser | |
org.jparsec.pattern |
Provides Pattern implementations for use by character level scanners.
|
Modifier and Type | Method and Description |
---|---|
static Parser<Void> |
Scanners.blockComment(String begin,
String end,
Pattern commented)
A scanner for a non-nestable block comment that starts with
begin and ends with
end . |
static Parser<Void> |
Scanners.many(Pattern pattern,
String name)
Deprecated.
Use
pattern.many().toScanner(name) . |
static Parser<Void> |
Scanners.many1(Pattern pattern,
String name)
Deprecated.
Use
pattern.many1().toScanner(name) . |
static Parser<Void> |
Scanners.nestableBlockComment(String begin,
String end,
Pattern commented)
A scanner for a nestable block comment that starts with
begin and ends with
end . |
static Parser<Void> |
Scanners.pattern(Pattern pattern,
String name)
Deprecated.
Use
pattern.toScanner(name) . |
Modifier and Type | Field and Description |
---|---|
static Pattern |
JavaScanners.DEC_INTEGER_PATTERN
A
Pattern object that matches a decimal integer, which is either '0' or starts with a non-zero digit and is followed by 0 or
more digits. |
static Pattern |
JavaScanners.OCT_INTEGER_PATTERN
A
Pattern object that matches an octal integer that starts with a 0 and is followed by 1 or more
[0 - 7] characters. |
Modifier and Type | Field and Description |
---|---|
static Pattern |
Patterns.ALWAYS
A
Pattern that always matches with match length 0 . |
static Pattern |
Patterns.ANY_CHAR
A
Pattern that matches any character and only mismatches for an empty string. |
static Pattern |
Patterns.DEC_INTEGER
A
Pattern object that matches a decimal integer, which starts with a non-zero digit and is followed by 0 or
more digits. |
static Pattern |
Patterns.DECIMAL
A
Pattern object that matches a decimal number that could start with a decimal point or a digit. |
static Pattern |
Patterns.EOF
A
Pattern object that matches if the input has no character left. |
static Pattern |
Patterns.ESCAPED
A
Pattern object that succeeds with match length 2 if there are at least 2 characters in the input
and the first character is '\' . |
static Pattern |
Patterns.FRACTION
A
Pattern object that matches a decimal point and one or more digits after it. |
static Pattern |
Patterns.HEX_INTEGER
A
Pattern object that matches a hex integer, which starts with a 0x or 0X , and is followed
by one or more hex digits. |
static Pattern |
Patterns.INTEGER
A
Pattern object that matches an integer. |
static Pattern |
Patterns.NEVER
|
static Pattern |
Patterns.OCT_INTEGER
A
Pattern object that matches an octal integer that starts with a 0 and is followed by 0 or more
[0 - 7] characters. |
static Pattern |
Patterns.REGEXP_MODIFIERS
A
Pattern object that matches regular expression modifiers, which is a list of alpha characters. |
static Pattern |
Patterns.REGEXP_PATTERN
A
Pattern object that matches any regular expression pattern string in the form of /some pattern
here/ . |
static Pattern |
Patterns.SCIENTIFIC_NOTATION
|
static Pattern |
Patterns.STRICT_DECIMAL
A
Pattern object that matches a decimal number that has at least one digit before the decimal point. |
static Pattern |
Patterns.WORD
A
Pattern object that matches a standard english word, which starts with either an underscore or an alpha
character, followed by 0 or more alphanumeric characters. |
Modifier and Type | Method and Description |
---|---|
static Pattern |
Patterns.among(String chars)
Returns a
Pattern object that matches if the current character in the input is equal to any character in
chars , in which case 1 is returned as match length. |
static Pattern |
Patterns.and(Pattern... patterns)
Returns a
Pattern that matches if all of patterns matches, in which case, the maximum match length
is returned. |
Pattern |
Pattern.atLeast(int min)
Returns
Pattern object that matches this pattern for at least min times. |
static Pattern |
Patterns.atLeast(int min,
CharPredicate predicate)
Returns a
Pattern object that matches if the input starts with min or more characters and all
satisfy predicate . |
Pattern |
Pattern.atMost(int max)
Returns
Pattern object that matches this pattern for up to max times. |
static Pattern |
Patterns.atMost(int max,
CharPredicate predicate)
|
static Pattern |
Patterns.hasAtLeast(int n)
Returns a
Pattern object that matches if the input has at least n characters left. |
static Pattern |
Patterns.hasExact(int n)
Returns a
Pattern object that matches if the input has exactly n characters left. |
Pattern |
Pattern.ifelse(Pattern consequence,
Pattern alternative)
Returns
Pattern object that, if this pattern matches,
matches the remaining input against consequence pattern, or otherwise matches against
alternative pattern. |
static Pattern |
Patterns.isChar(char c)
Returns a
Pattern object that matches if the current character in the input is equal to character c , in which case 1 is returned as match length. |
static Pattern |
Patterns.isChar(CharPredicate predicate)
Returns a
Pattern object that matches if the current character in the input satisfies predicate , in
which case 1 is returned as match length. |
static Pattern |
Patterns.lineComment(String begin)
Returns a
Pattern object that matches a line comment started by begin and ended by EOF or
LF (the line feed character). |
static Pattern |
Patterns.longer(Pattern p1,
Pattern p2)
|
static Pattern |
Patterns.longest(Pattern... patterns)
Returns a
Pattern that tries all of patterns , and picks the one with the
longest match length. |
Pattern |
Pattern.many()
Returns a
Pattern object that matches this pattern for 0 or more times. |
static Pattern |
Patterns.many(CharPredicate predicate)
Returns a
Pattern that matches 0 or more characters satisfying predicate . |
Pattern |
Pattern.many(int min)
Deprecated.
Use
atLeast(int) instead. |
static Pattern |
Patterns.many(int min,
CharPredicate predicate)
Deprecated.
Use
Patterns.atLeast(int, CharPredicate) instead. |
Pattern |
Pattern.many1()
Returns a
Pattern object that matches this pattern for 1 or more times. |
static Pattern |
Patterns.many1(CharPredicate predicate)
Returns a
Pattern that matches 1 or more characters satisfying predicate . |
Pattern |
Pattern.next(Pattern next)
|
Pattern |
Pattern.not()
Returns a
Pattern object that only matches if this pattern mismatches, 0 is returned
otherwise. |
static Pattern |
Patterns.not(Pattern pattern) |
static Pattern |
Patterns.notString(String string)
Returns a
Pattern object that matches if the input has at least 1 character and doesn't match string . |
static Pattern |
Patterns.notStringCaseInsensitive(String string)
Returns a
Pattern object that matches if the input has at least 1 character and doesn't match string case insensitively. |
Pattern |
Pattern.optional()
Returns a
Pattern object that matches with 0 length even if this mismatches. |
static Pattern |
Patterns.or(Pattern... patterns)
Returns a
Pattern that matches if any of patterns matches, in which case, the first match length is
returned. |
Pattern |
Pattern.or(Pattern p2)
|
Pattern |
Pattern.peek()
Returns
Pattern object that matches with match length 0 if this Pattern object matches. |
static Pattern |
Patterns.range(char c1,
char c2)
Returns a
Pattern object that matches if the current character in the input is between character c1
and c2 , in which case 1 is returned as match length. |
static Pattern |
Patterns.regex(Pattern p)
Adapts a regular expression pattern to a
Pattern . |
static Pattern |
Patterns.regex(String s)
Adapts a regular expression pattern string to a
Pattern . |
Pattern |
Pattern.repeat(int n)
Deprecated.
Use
times(int) instead. |
static Pattern |
Patterns.repeat(int n,
CharPredicate predicate)
Returns a
Pattern object that matches if the input has at least n characters and the first n characters all satisfy predicate . |
static Pattern |
Patterns.sequence(Pattern... patterns)
Returns a
Pattern object that matches the input against patterns sequentially. |
static Pattern |
Patterns.shorter(Pattern p1,
Pattern p2)
|
static Pattern |
Patterns.shortest(Pattern... patterns)
Returns a
Pattern that tries all of patterns , and picks the one with the shortest match length. |
Pattern |
Pattern.some(int max)
Deprecated.
Use
atMost(int) instead. |
static Pattern |
Patterns.some(int max,
CharPredicate predicate)
Deprecated.
Use
Patterns.atMost(int, CharPredicate) instead. |
Pattern |
Pattern.some(int min,
int max)
Deprecated.
Use
times(int, int) instead. |
static Pattern |
Patterns.some(int min,
int max,
CharPredicate predicate)
Deprecated.
Use
Patterns.times(int, int, CharPredicate) instead. |
static Pattern |
Patterns.string(String string)
Returns a
Pattern object that matches string literally. |
static Pattern |
Patterns.stringCaseInsensitive(String string)
Returns a
Pattern object that matches string case insensitively. |
Pattern |
Pattern.times(int n)
Returns
Pattern object that matches the input against this pattern for n times. |
Pattern |
Pattern.times(int min,
int max)
|
static Pattern |
Patterns.times(int min,
int max,
CharPredicate predicate)
Returns a
Pattern that matches at least min and up to max number of characters satisfying
predicate , |
Modifier and Type | Method and Description |
---|---|
static Pattern |
Patterns.and(Pattern... patterns)
Returns a
Pattern that matches if all of patterns matches, in which case, the maximum match length
is returned. |
Pattern |
Pattern.ifelse(Pattern consequence,
Pattern alternative)
Returns
Pattern object that, if this pattern matches,
matches the remaining input against consequence pattern, or otherwise matches against
alternative pattern. |
static Pattern |
Patterns.longer(Pattern p1,
Pattern p2)
|
static Pattern |
Patterns.longest(Pattern... patterns)
Returns a
Pattern that tries all of patterns , and picks the one with the
longest match length. |
Pattern |
Pattern.next(Pattern next)
|
static Pattern |
Patterns.not(Pattern pattern) |
static Pattern |
Patterns.or(Pattern... patterns)
Returns a
Pattern that matches if any of patterns matches, in which case, the first match length is
returned. |
Pattern |
Pattern.or(Pattern p2)
|
static Pattern |
Patterns.sequence(Pattern... patterns)
Returns a
Pattern object that matches the input against patterns sequentially. |
static Pattern |
Patterns.shorter(Pattern p1,
Pattern p2)
|
static Pattern |
Patterns.shortest(Pattern... patterns)
Returns a
Pattern that tries all of patterns , and picks the one with the shortest match length. |
Copyright © 2013–2016 jparsec. All rights reserved.