Uses of Class
org.jparsec.pattern.Pattern
-
Packages that use Pattern 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. -
-
Uses of Pattern in org.jparsec
Fields in org.jparsec declared as Pattern Modifier and Type Field Description (package private) static Pattern
Indentation. INLINE_WHITESPACES
APattern
object that matches one or more whitespace characters or line continuations, where the line feed character ('\n'
) is escaped by the backslash character ('\'
).(package private) static Pattern
Indentation. LINE_CONTINUATION
APattern
object that matches a line continuation.Methods in org.jparsec that return Pattern Modifier and Type Method Description private static Pattern
Scanners. escapedChar(char escape)
private static Pattern
Scanners. notChar2(char c1, char c2)
Matches a character if the input has at least 1 character, or if the input has at least 2 characters with the first 2 characters not beingc1
andc2
.Methods in org.jparsec with parameters of type Pattern Modifier and Type Method Description static Parser<java.lang.Void>
Scanners. blockComment(java.lang.String begin, java.lang.String end, Pattern commented)
A scanner for a non-nestable block comment that starts withbegin
and ends withend
.static Parser<java.lang.Void>
Scanners. many(Pattern pattern, java.lang.String name)
Deprecated.Usepattern.many().toScanner(name)
.static Parser<java.lang.Void>
Scanners. many1(Pattern pattern, java.lang.String name)
Deprecated.Usepattern.many1().toScanner(name)
.static Parser<java.lang.Void>
Scanners. nestableBlockComment(java.lang.String begin, java.lang.String end, Pattern commented)
A scanner for a nestable block comment that starts withbegin
and ends withend
.static Parser<java.lang.Void>
Scanners. pattern(Pattern pattern, java.lang.String name)
Deprecated.Usepattern.toScanner(name)
. -
Uses of Pattern in org.jparsec.examples.java.parser
Fields in org.jparsec.examples.java.parser declared as Pattern Modifier and Type Field Description static Pattern
JavaScanners. DEC_INTEGER_PATTERN
APattern
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
APattern
object that matches an octal integer that starts with a0
and is followed by 1 or more[0 - 7]
characters. -
Uses of Pattern in org.jparsec.pattern
Subclasses of Pattern in org.jparsec.pattern Modifier and Type Class Description (package private) class
LowerBoundedPattern
(package private) class
ManyPattern
(package private) class
NotPattern
(package private) class
OptionalPattern
(package private) class
OrPattern
(package private) class
PeekPattern
(package private) class
RepeatCharPredicatePattern
(package private) class
RepeatPattern
(package private) class
SequencePattern
(package private) class
UpperBoundedPattern
Fields in org.jparsec.pattern declared as Pattern Modifier and Type Field Description static Pattern
Patterns. ALWAYS
APattern
that always matches with match length0
.static Pattern
Patterns. ANY_CHAR
APattern
that matches any character and only mismatches for an empty string.static Pattern
Patterns. DEC_INTEGER
APattern
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
APattern
object that matches a decimal number that could start with a decimal point or a digit.static Pattern
Patterns. EOF
APattern
object that matches if the input has no character left.static Pattern
Patterns. ESCAPED
APattern
object that succeeds with match length2
if there are at least 2 characters in the input and the first character is'\'
.static Pattern
Patterns. FRACTION
APattern
object that matches a decimal point and one or more digits after it.static Pattern
Patterns. HEX_INTEGER
APattern
object that matches a hex integer, which starts with a0x
or0X
, and is followed by one or more hex digits.static Pattern
Patterns. INTEGER
APattern
object that matches an integer.static Pattern
Patterns. NEVER
static Pattern
Patterns. OCT_INTEGER
APattern
object that matches an octal integer that starts with a0
and is followed by 0 or more[0 - 7]
characters.private Pattern
LowerBoundedPattern. pattern
private Pattern
ManyPattern. pattern
private Pattern
OptionalPattern. pattern
private Pattern
RepeatPattern. pattern
private Pattern
UpperBoundedPattern. pattern
private Pattern[]
OrPattern. patterns
private Pattern[]
SequencePattern. patterns
private Pattern
NotPattern. pp
private Pattern
PeekPattern. pp
static Pattern
Patterns. REGEXP_MODIFIERS
APattern
object that matches regular expression modifiers, which is a list of alpha characters.static Pattern
Patterns. REGEXP_PATTERN
APattern
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
APattern
object that matches a decimal number that has at least one digit before the decimal point.static Pattern
Patterns. WORD
APattern
object that matches a standard english word, which starts with either an underscore or an alpha character, followed by 0 or more alphanumeric characters.Methods in org.jparsec.pattern that return Pattern Modifier and Type Method Description static Pattern
Patterns. among(java.lang.String chars)
Returns aPattern
object that matches if the current character in the input is equal to any character inchars
, in which case1
is returned as match length.static Pattern
Patterns. and(Pattern... patterns)
Returns aPattern
that matches if all ofpatterns
matches, in which case, the maximum match length is returned.Pattern
Pattern. atLeast(int min)
ReturnsPattern
object that matches this pattern for at leastmin
times.static Pattern
Patterns. atLeast(int min, CharPredicate predicate)
Returns aPattern
object that matches if the input starts withmin
or more characters and all satisfypredicate
.Pattern
Pattern. atMost(int max)
ReturnsPattern
object that matches this pattern for up tomax
times.static Pattern
Patterns. atMost(int max, CharPredicate predicate)
private static Pattern
Patterns. getModifiersPattern()
private static Pattern
Patterns. getRegularExpressionPattern()
static Pattern
Patterns. hasAtLeast(int n)
Returns aPattern
object that matches if the input has at leastn
characters left.static Pattern
Patterns. hasExact(int n)
Returns aPattern
object that matches if the input has exactlyn
characters left.Pattern
Pattern. ifelse(Pattern consequence, Pattern alternative)
ReturnsPattern
object that, if this pattern matches, matches the remaining input againstconsequence
pattern, or otherwise matches againstalternative
pattern.private static Pattern
Pattern. ifElse(Pattern cond, Pattern consequence, Pattern alternative)
static Pattern
Patterns. isChar(char c)
Returns aPattern
object that matches if the current character in the input is equal to characterc
, in which case1
is returned as match length.static Pattern
Patterns. isChar(CharPredicate predicate)
Returns aPattern
object that matches if the current character in the input satisfiespredicate
, in which case1
is returned as match length.static Pattern
Patterns. lineComment(java.lang.String begin)
Returns aPattern
object that matches a line comment started bybegin
and ended byEOF
orLF
(the line feed character).static Pattern
Patterns. longer(Pattern p1, Pattern p2)
static Pattern
Patterns. longest(Pattern... patterns)
Returns aPattern
that tries all ofpatterns
, and picks the one with the longest match length.Pattern
Pattern. many()
Returns aPattern
object that matches this pattern for 0 or more times.Pattern
Pattern. many(int min)
Deprecated.UseatLeast(int)
instead.static Pattern
Patterns. many(int min, CharPredicate predicate)
Deprecated.UsePatterns.atLeast(int, CharPredicate)
instead.static Pattern
Patterns. many(CharPredicate predicate)
Returns aPattern
that matches 0 or more characters satisfyingpredicate
.Pattern
Pattern. many1()
Returns aPattern
object that matches this pattern for 1 or more times.static Pattern
Patterns. many1(CharPredicate predicate)
Returns aPattern
that matches 1 or more characters satisfyingpredicate
.Pattern
Pattern. next(Pattern next)
(package private) static Pattern
Patterns. nextWithEmpty(Pattern left, Pattern right)
Pattern
Pattern. not()
Returns aPattern
object that only matches if this pattern mismatches, 0 is returned otherwise.static Pattern
Patterns. not(Pattern pattern)
static Pattern
Patterns. notString(java.lang.String string)
Returns aPattern
object that matches if the input has at least 1 character and doesn't matchstring
.static Pattern
Patterns. notStringCaseInsensitive(java.lang.String string)
Returns aPattern
object that matches if the input has at least 1 character and doesn't matchstring
case insensitively.Pattern
Pattern. optional()
Returns aPattern
object that matches with 0 length even ifthis
mismatches.(package private) static Pattern
Patterns. optional(Pattern pp)
Pattern
Pattern. or(Pattern p2)
static Pattern
Patterns. or(Pattern... patterns)
Returns aPattern
that matches if any ofpatterns
matches, in which case, the first match length is returned.(package private) static Pattern
Patterns. orWithoutEmpty(Pattern left, Pattern right)
Pattern
Pattern. peek()
ReturnsPattern
object that matches with match length 0 if this Pattern object matches.static Pattern
Patterns. range(char c1, char c2)
Returns aPattern
object that matches if the current character in the input is between characterc1
andc2
, in which case1
is returned as match length.static Pattern
Patterns. regex(java.lang.String s)
Adapts a regular expression pattern string to aPattern
.static Pattern
Patterns. regex(java.util.regex.Pattern p)
Adapts a regular expression pattern to aPattern
.Pattern
Pattern. repeat(int n)
Deprecated.Usetimes(int)
instead.static Pattern
Patterns. repeat(int n, CharPredicate predicate)
Returns aPattern
object that matches if the input has at leastn
characters and the firstn
characters all satisfypredicate
.static Pattern
Patterns. sequence(Pattern... patterns)
Returns aPattern
object that matches the input againstpatterns
sequentially.static Pattern
Patterns. shorter(Pattern p1, Pattern p2)
static Pattern
Patterns. shortest(Pattern... patterns)
Returns aPattern
that tries all ofpatterns
, and picks the one with the shortest match length.Pattern
Pattern. some(int max)
Deprecated.UseatMost(int)
instead.Pattern
Pattern. some(int min, int max)
Deprecated.Usetimes(int, int)
instead.static Pattern
Patterns. some(int min, int max, CharPredicate predicate)
Deprecated.UsePatterns.times(int, int, CharPredicate)
instead.static Pattern
Patterns. some(int max, CharPredicate predicate)
Deprecated.UsePatterns.atMost(int, CharPredicate)
instead.static Pattern
Patterns. string(java.lang.String string)
Returns aPattern
object that matchesstring
literally.static Pattern
Patterns. stringCaseInsensitive(java.lang.String string)
Returns aPattern
object that matchesstring
case insensitively.Pattern
Pattern. times(int n)
ReturnsPattern
object that matches the input against this pattern forn
times.Pattern
Pattern. times(int min, int max)
private static Pattern
Pattern. times(Pattern pp, int min, int max)
static Pattern
Patterns. times(int min, int max, CharPredicate predicate)
Returns aPattern
that matches at leastmin
and up tomax
number of characters satisfyingpredicate
,Methods in org.jparsec.pattern with parameters of type Pattern Modifier and Type Method Description static Pattern
Patterns. and(Pattern... patterns)
Returns aPattern
that matches if all ofpatterns
matches, in which case, the maximum match length is returned.Pattern
Pattern. ifelse(Pattern consequence, Pattern alternative)
ReturnsPattern
object that, if this pattern matches, matches the remaining input againstconsequence
pattern, or otherwise matches againstalternative
pattern.private static Pattern
Pattern. ifElse(Pattern cond, Pattern consequence, Pattern alternative)
static Pattern
Patterns. longer(Pattern p1, Pattern p2)
static Pattern
Patterns. longest(Pattern... patterns)
Returns aPattern
that tries all ofpatterns
, and picks the one with the longest match length.(package private) static int
ManyPattern. matchMany(Pattern pattern, java.lang.CharSequence src, int len, int from, int acc)
(package private) static int
RepeatPattern. matchRepeat(int n, Pattern pattern, java.lang.CharSequence src, int len, int from, int acc)
(package private) static int
UpperBoundedPattern. matchSome(int max, Pattern pattern, java.lang.CharSequence src, int len, int from, int acc)
Pattern
Pattern. next(Pattern next)
(package private) static Pattern
Patterns. nextWithEmpty(Pattern left, Pattern right)
static Pattern
Patterns. not(Pattern pattern)
(package private) static Pattern
Patterns. optional(Pattern pp)
Pattern
Pattern. or(Pattern p2)
static Pattern
Patterns. or(Pattern... patterns)
Returns aPattern
that matches if any ofpatterns
matches, in which case, the first match length is returned.(package private) static Pattern
Patterns. orWithoutEmpty(Pattern left, Pattern right)
static Pattern
Patterns. sequence(Pattern... patterns)
Returns aPattern
object that matches the input againstpatterns
sequentially.static Pattern
Patterns. shorter(Pattern p1, Pattern p2)
static Pattern
Patterns. shortest(Pattern... patterns)
Returns aPattern
that tries all ofpatterns
, and picks the one with the shortest match length.private static Pattern
Pattern. times(Pattern pp, int min, int max)
Constructors in org.jparsec.pattern with parameters of type Pattern Constructor Description LowerBoundedPattern(int min, Pattern pattern)
ManyPattern(Pattern pattern)
NotPattern(Pattern pp)
OptionalPattern(Pattern pattern)
OrPattern(Pattern... patterns)
PeekPattern(Pattern pp)
RepeatPattern(int n, Pattern pattern)
SequencePattern(Pattern... patterns)
UpperBoundedPattern(int max, Pattern pattern)
-