Uses of Class
org.jparsec.pattern.Pattern
Packages that use Pattern
Package
Description
Provides core Parser implementations for parser combinator logic.
Provides Pattern implementations for use by character level scanners.
-
Uses of Pattern in org.jparsec
Fields in org.jparsec declared as PatternModifier and TypeFieldDescription(package private) static final 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 final Pattern
Indentation.LINE_CONTINUATION
APattern
object that matches a line continuation.Methods in org.jparsec that return PatternModifier and TypeMethodDescriptionprivate 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 PatternModifier and TypeMethodDescriptionScanners.blockComment
(String begin, String end, Pattern commented) A scanner for a non-nestable block comment that starts withbegin
and ends withend
.Deprecated.Deprecated.Usepattern.many1().toScanner(name)
.Scanners.nestableBlockComment
(String begin, String end, Pattern commented) A scanner for a nestable block comment that starts withbegin
and ends withend
.Deprecated.Usepattern.toScanner(name)
. -
Uses of Pattern in org.jparsec.examples.java.parser
Fields in org.jparsec.examples.java.parser declared as PatternModifier and TypeFieldDescriptionstatic final 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 final 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.patternModifier and TypeClassDescription(package private) class
(package private) class
(package private) class
(package private) class
(package private) class
(package private) class
(package private) class
(package private) class
(package private) class
(package private) class
Fields in org.jparsec.pattern declared as PatternModifier and TypeFieldDescriptionstatic final Pattern
Patterns.ALWAYS
APattern
that always matches with match length0
.static final Pattern
Patterns.ANY_CHAR
APattern
that matches any character and only mismatches for an empty string.static final 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 final Pattern
Patterns.DECIMAL
APattern
object that matches a decimal number that could start with a decimal point or a digit.static final Pattern
Patterns.EOF
APattern
object that matches if the input has no character left.static final 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 final Pattern
Patterns.FRACTION
APattern
object that matches a decimal point and one or more digits after it.static final 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 final Pattern
Patterns.INTEGER
APattern
object that matches an integer.static final Pattern
Patterns.NEVER
static final 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 final Pattern
LowerBoundedPattern.pattern
private final Pattern
ManyPattern.pattern
private final Pattern
OptionalPattern.pattern
private final Pattern
RepeatPattern.pattern
private final Pattern
UpperBoundedPattern.pattern
private final Pattern[]
OrPattern.patterns
private final Pattern[]
SequencePattern.patterns
private final Pattern
NotPattern.pp
private final Pattern
PeekPattern.pp
static final Pattern
Patterns.REGEXP_MODIFIERS
APattern
object that matches regular expression modifiers, which is a list of alpha characters.static final Pattern
Patterns.REGEXP_PATTERN
APattern
object that matches any regular expression pattern string in the form of/some pattern here/
.static final Pattern
Patterns.SCIENTIFIC_NOTATION
static final Pattern
Patterns.STRICT_DECIMAL
APattern
object that matches a decimal number that has at least one digit before the decimal point.static final 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 PatternModifier and TypeMethodDescriptionstatic Pattern
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
Returns aPattern
that matches if all ofpatterns
matches, in which case, the maximum match length is returned.final 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
.final 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.final Pattern
ReturnsPattern
object that, if this pattern matches, matches the remaining input againstconsequence
pattern, or otherwise matches againstalternative
pattern.private static Pattern
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
(String begin) Returns aPattern
object that matches a line comment started bybegin
and ended byEOF
orLF
(the line feed character).static Pattern
static Pattern
Returns aPattern
that tries all ofpatterns
, and picks the one with the longest match length.final Pattern
Pattern.many()
Returns aPattern
object that matches this pattern for 0 or more times.final 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
.final 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
.final Pattern
(package private) static Pattern
Patterns.nextWithEmpty
(Pattern left, Pattern right) final Pattern
Pattern.not()
Returns aPattern
object that only matches if this pattern mismatches, 0 is returned otherwise.static Pattern
static Pattern
Returns aPattern
object that matches if the input has at least 1 character and doesn't matchstring
.static Pattern
Patterns.notStringCaseInsensitive
(String string) Returns aPattern
object that matches if the input has at least 1 character and doesn't matchstring
case insensitively.final Pattern
Pattern.optional()
Returns aPattern
object that matches with 0 length even ifthis
mismatches.(package private) static Pattern
final Pattern
static Pattern
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) final 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
Adapts a regular expression pattern string to aPattern
.static Pattern
Adapts a regular expression pattern to aPattern
.final 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
Returns aPattern
object that matches the input againstpatterns
sequentially.static Pattern
static Pattern
Returns aPattern
that tries all ofpatterns
, and picks the one with the shortest match length.final Pattern
Pattern.some
(int max) Deprecated.UseatMost(int)
instead.final 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
Returns aPattern
object that matchesstring
literally.static Pattern
Patterns.stringCaseInsensitive
(String string) Returns aPattern
object that matchesstring
case insensitively.final Pattern
Pattern.times
(int n) ReturnsPattern
object that matches the input against this pattern forn
times.final Pattern
Pattern.times
(int min, int max) private static Pattern
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 PatternModifier and TypeMethodDescriptionstatic Pattern
Returns aPattern
that matches if all ofpatterns
matches, in which case, the maximum match length is returned.final Pattern
ReturnsPattern
object that, if this pattern matches, matches the remaining input againstconsequence
pattern, or otherwise matches againstalternative
pattern.private static Pattern
static Pattern
static Pattern
Returns aPattern
that tries all ofpatterns
, and picks the one with the longest match length.(package private) static int
ManyPattern.matchMany
(Pattern pattern, CharSequence src, int len, int from, int acc) (package private) static int
RepeatPattern.matchRepeat
(int n, Pattern pattern, CharSequence src, int len, int from, int acc) (package private) static int
UpperBoundedPattern.matchSome
(int max, Pattern pattern, CharSequence src, int len, int from, int acc) final Pattern
(package private) static Pattern
Patterns.nextWithEmpty
(Pattern left, Pattern right) static Pattern
(package private) static Pattern
final Pattern
static Pattern
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
Returns aPattern
object that matches the input againstpatterns
sequentially.static Pattern
static Pattern
Returns aPattern
that tries all ofpatterns
, and picks the one with the shortest match length.private static Pattern
Constructors in org.jparsec.pattern with parameters of type PatternModifierConstructorDescription(package private)
LowerBoundedPattern
(int min, Pattern pattern) (package private)
ManyPattern
(Pattern pattern) (package private)
NotPattern
(Pattern pp) (package private)
OptionalPattern
(Pattern pattern) (package private)
PeekPattern
(Pattern pp) (package private)
RepeatPattern
(int n, Pattern pattern) (package private)
SequencePattern
(Pattern... patterns) (package private)
UpperBoundedPattern
(int max, Pattern pattern)
pattern.many().toScanner(name)
.