|
||||||||||
PREV NEXT | FRAMES NO FRAMES |
Parser
that always succeeds.
CharPredicate
that always returns true.
Pattern
that always matches with match length 0
.
CharPredicate
that returns true if the character is equal to any character in
chars
.
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.
Patterns.among(chars).toScanner(name)
.
chars
.
CharPredicate
that returns true if both predicate1
and
predicate2
evaluates to true.
CharPredicate
that returns true if all CharPredicate
in
predicates
evaluate to true.
Pattern
that matches if all of patterns
matches, in which case, the maximum match length
is returned.
Pattern
that matches any character and only mismatches for an empty string.
Parser
that consumes a token.
Parser
that sequentially runs parsers
one by one and collects the return
values in an array.
Parser
that runs this
parser greedily for at least min
times.
Pattern
object that matches this pattern for at least min
times.
Pattern
object that matches if the input starts with min
or more characters and all
satisfy predicate
.
Pattern
object that matches this pattern for up to max
times.
Pattern
that matches up to max
number of characters satisfying
predicate
.
Parser
that undoes any partial match if this
fails.
Parser
that runs this
between before
and after
.
Parser.between(Parser, Parser)
.
T
.Parser
that returns a Binary
instance that invokes the underlying
map
method or curried constructor with the two parameters of the
Map2.map(Object, Object)
method.
begin
and ends with
end
.
begin
and ends with
end
.
begin
and ends with
end
.
Parser
based on information in this OperatorTable
.
Terminals
instance that recognizes words defined in this builder.
operators(ops)
.words(Scanners.IDENTIFIER)
.caseInsensitiveKeywords(keywords)
.build()
instead.
operators(ops)
.words(wordScanner)
.caseInsensitiveKeywords(keywords)
.build()
instead.
operators(ops)
.words(wordScanner)
.tokenizeWordsWith(wordMap)
.caseInsensitiveKeywords(keywords)
.build()
instead.
operators(ops)
.words(Scanners.IDENTIFIER)
.keywords(keywords)
.build()
instead.
operators(ops)
.words(wordScanner)
.keywords(keywords)
.build()
instead.
operators(ops)
.words(wordScanner)
.tokenizeWordsWith(wordMap)
.keywords(keywords)
.build()
instead.
this
to a Parser
of type R
.
CharPredicate
implementations.Map
that always maps any object to v
.
Parser
that always returns v
regardless of input.
Mapper
that curries the only public constructor defined in clazz
and invokes it with parameters returned by the sequentially executed Parser
objects.
Pattern
object that matches a decimal integer, which starts with a non-zero digit and is followed by 0 or
more digits.
1, 10, 123
),
and converts the string to a Long
value.
Pattern
object that matches a decimal number that could start with a decimal point or a digit.
Tokens.Fragment
tagged as Tokens.Tag.DECIMAL
.
'\'
),
and transforms the quoted content by applying escape characters.
Parser
that runs this
for 0 or more times delimited and terminated by delim
.
Parser
that runs this
for 1 or more times delimited and terminated by delim
.
Parser
that succeeds only if EOF is met.
Pattern
object that matches if the input has no character left.
Pattern
object that succeeds with match length 2
if there are at least 2 characters in the input
and the first character is '\'
.
Parser
that fails and reports that name
is logically expected.
Parser
that always fails with message
.
Parser
that returns true
if this
fails, false
otherwise.
Parser
that sequentially executes this
and then parser
, whose return value is ignored.
Pattern
object that matches a decimal point and one or more digits after it.
Parser
that recognizes Tokens.Fragment
token values
tagged with one of tags
.
Tokens.Fragment
tagged with tag
.
Parser
that takes as input the Token
collection returned by lexer
,
and runs this
to parse the tokens.
Parser
that takes as input the tokens returned by tokenizer
delimited by
delim
, and runs this
to parse the tokens.
null
if none.
Parsers.fail(String)
,
or null
if none.
null
if none.
null
if none.
Pattern
object that matches if the input has at least n
characters left.
Pattern
object that matches if the input has exactly n
characters left.
Pattern
object that matches a hex integer, which starts with a 0x
or 0X
, and is followed
by one or more hex digits.
0x1, 0Xff, 0xFe1
etc.), and converts the string to a Long
value.
Parser
that recognizes identifiers (a.k.a words, variable names etc).
Tokens.Fragment
tagged as Tokens.Tag.IDENTIFIER
.
Parser
that runs consequence
if this
succeeds, or alternative
otherwise.
Parser
that runs consequence
if this
succeeds, or alternative
otherwise.
Pattern
object that, if this pattern matches,
matches the remaining input against consequence
pattern, or otherwise matches against
alternative
pattern.
Parser
that recognizes the generated indent
token.
Indentation
object that uses indent
and outdent
as the
token values for indentation and outdentation.
Indentation
object that generates default indent and outdent tokens.
Parser
that retrieves the current index in the source.
Parser
that runs operator
and returns a Binary
instance,
which will pass along its first parameter, followed by the return value of operator
,
followed by its second parameter to the underlying map
method or curried constructor.
Parser
that runs operator
sequentially and returns a Binary
instance,
which will pass along its first parameter, followed by the return values of operator
,
followed by its second parameter to the underlying map
method or curried constructor.
Parser
for left-associative infix operator.
Parser
that parses non-associative infix operator.
Parser
for right-associative infix operator.
Pattern
object that matches an integer.
Tokens.Fragment
tagged as Tokens.Tag.INTEGER
.
CharPredicate
that returns true if the character is an alpha character.
CharPredicate
that returns true if it is an alpha character or the underscore
character _
.
CharPredicate
that returns true if it is an alphanumeric character, or an
underscore character.
CharPredicate
that returns true if it is an alphanumeric character, or an
underscore character.
CharPredicate
that returns true if the character is a digit.
CharPredicate
that returns true if the character is a digit or within the range
of [a-f]
or [A-F]
.
CharPredicate
that returns true if Character.isLetter(char)
returns
true.
CharPredicate
that returns true if Character.isLowerCase(char)
returns
true.
CharPredicate
that returns true if Character.isUpperCase(char)
returns
true.
CharPredicate
that returns true if Character.isWhitespace(char)
returns true.
c
satisfies the predicate.
CharPredicate
that returns true if the character is equal to c
.
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.
Pattern
object that matches if the current character in the input satisfies predicate
, in
which case 1
is returned as match length.
CharPredicate
.
Object.toString()
in the CharPredicate
,
or use Patterns.isChar(predicate).toScanner(name)
.
Scanners.isChar(char)
instead
or use Patterns.isChar(ch).toScanner(name)
.
ch
.
Parser
that reports reports an error about name
expected, if this
fails with no partial
match.
Parser
that delegates to the parser object referenced by this
during parsing time.
Parser
that greedily runs tokenizer
, and translates line feed characters
('\n'
) to indent
and outdent
tokens.
Parser
that greedily runs this
repeatedly, and ignores the pattern recognized by delim
before and after each occurrence.
Pattern
object that matches a line comment started by begin
and ended by EOF
or
LF
(the line feed character).
'\n'
character
if the current input starts with the string literal begin
.
Parser
that sequentially runs parsers
one by one and collects the return
values in a List
.
Location
instance.
Parser
that runs both p1
and p2
and selects the longer match.
Pattern
that tries both p1
and p2
,
and picks the one with the longer match length.
Parser
that runs every element of parsers
and selects the longest match.
Parser
that runs every element of parsers
and selects the longest match.
Pattern
that tries all of patterns
, and picks the one with the
longest match length.
p.many()
is equivalent to p*
in EBNF.
Pattern
object that matches this pattern for 0 or more times.
Pattern.atLeast(int)
instead.
Patterns.atLeast(int, CharPredicate)
instead.
Pattern
that matches 0 or more characters satisfying predicate
.
pattern.many().toScanner(name)
.
p.many1()
is equivalent to p+
in EBNF.
Pattern
object that matches this pattern for 1 or more times.
Pattern
that matches 1 or more characters satisfying predicate
.
pattern.many1().toScanner(name)
.
From
to an object of type To
.from
to the target object.
a
and b
to the target object.
a
, b
and c
to the target object.
a
, b
, c
and d
to the target object.
a
, b
, c
, d
and e
to the target object.
Map
to Map
.
Parser
that runs this
parser and transforms the return value using map
.
token
to an instance of T
.
A
and B
respectively to an object of type T
.A
, B
and C
respectively to an object of type
T
.A
, B
, C
and D
respectively
to an object of type T
.A
, B
, C
, D
and E
respectively
to an object of type T
.Parser
results to an object of T
type-safely
using the map
method defined in subclass, or the curried constructor
defined in the target class.map
method defined in subclass for mapping.
Map
interface and the variants.Map
instance that maps its parameter to a String
by calling
Object.toString()
against it.
Pattern.match(CharSequence, int, int)
method when match fails.
begin
and ends with
end
.
begin
and ends with
end
.
begin
and ends with
end
.
outer
succeeds,
subsequently feeds the recognized characters to inner
for a nested scanning.
Parser
that always fails.
CharPredicate
that always returns false.
Pattern
that always returns Pattern.MISMATCH
.
Parser.Reference
.
Parser
that sequentially executes this
and then parser
.
Parser
that executes this
, maps the result using map
to another Parser
object
to be executed as the next step.
Pattern
object that sequentially matches the character range against
this
and then next
.
Parser
that fails if this
succeeds.
Parser
that fails if this
succeeds.
CharPredicate
that returns true if predicate
evaluates to false.
Pattern
object that only matches if this pattern mismatches, 0 is returned
otherwise.
CharPredicate
that returns true if the character is not equal to any character
in chars
.
Patterns.among(chars).not().toScanner(name)
,
or isChar(CharPredicates.notAmong(chars), name)
.
chars
.
CharPredicate
that returns true if the character is not equal to c
.
Scanners.notChar(char)
.
ch
.
Parser
that succeeds if this
succeeds and the pattern recognized by parser
isn't
following.
CharPredicate
that returns true if the character is not within the range of
[a, b]
.
Pattern
object that matches if the input has at least 1 character and doesn't match string
.
Pattern
object that matches if the input has at least 1 character and doesn't match string
case insensitively.
Pattern
object that matches an octal integer that starts with a 0
and is followed by 0 or more
[0 - 7]
characters.
0, 07, 017, 0371
etc.), and converts the string to a Long
value.
Terminals
object for lexing the operators with names specified in
ops
.
Terminals
object for lexing the operators with names specified in
ops
.
Parser
to parse expressions with operator-precedence grammar.p.optional()
is equivalent to p?
in EBNF.
Parser
that returns defaultValue
if this
fails with no partial match.
Pattern
object that matches with 0 length even if this
mismatches.
p1.or(p2)
is equivalent to p1 | p2
in EBNF.
Parser
that tries 2 alternative parser objects.
Parser
that tries 3 alternative parser objects.
Parser
that tries 4 alternative parser objects.
Parser
that tries 5 alternative parser objects.
Parser
that tries 6 alternative parser objects.
Parser
that tries 7 alternative parser objects.
Parser
that tries 8 alternative parser objects.
Parser
that tries 9 alternative parser objects.
Parser
that tries each alternative parser in alternatives
.
Parser
that tries each alternative parser in alternatives
.
CharPredicate
that returns true if either predicate1
or
predicate2
evaluates to true.
CharPredicate
that returns true if any CharPredicate
in
predicates
evaluates to true.
Pattern
object that matches if either this
or p2
matches.
Pattern
that matches if any of patterns
matches, in which case, the first match length is
returned.
Parser
that recognizes the generated outdent
token.
Pair
of 2 objects.
Parser
that sequentially runs p1
and p2
and collects the results in a
Pair
object.
source
.
source
.
readable
.
readable
.
Parser
that recognizes Character
tokens.
Parser
that recognizes Tokens.Fragment
tokens tagged as Tokens.Tag.DECIMAL
.
Parser
that recognizes identifier tokens.
Parser
that recognizes Tokens.Fragment
tokens tagged as Tokens.Tag.INTEGER
.
Parser
that recognizes Long
tokens.
Parser
that recognies Tokens.ScientificNotation
tokens.
Parser
that recognizes String
tokens.
Parser
used in recursive grammars.ParserException
object.
ParserException
object.
Parser
implementations.pattern.toScanner(name)
.
Pattern
implementations.Parser
that runs this
and undoes any input consumption if succeeds.
Pattern
object that matches with match length 0 if this Pattern object matches.
Parser
that runs operator
and returns a Unary
instance,
which will pass along its only parameter followed by the return value of operator
to the underlying map
method or curried constructor.
Parser
that runs operator
sequentially and returns a Unary
instance,
which will pass along its only parameter followed by the return values of operator
to the underlying map
method or curried constructor.
Parser
that runs this
and then runs op
for 0 or more times greedily.
Parser
that runs operator
and returns a Unary
instance,
which will pass along the return value of operator
followed by its only parameter
to the underlying map
method or curried constructor.
Parser
that runs operator
sequentially and returns a Unary
instance,
which will pass along the return values of operator
followed by its only parameter
to the underlying map
method or curried constructor.
Parser
that runs op
for 0 or more times greedily, then runs this
.
begin
and ends with character
end
.
Parsers.sequence(begin, quoted.skipMany(), end).source()
.
CharPredicate
that returns true if the character is within the range of
[a, b]
.
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.
Pattern
.
Pattern
.
Pattern
object that matches regular expression modifiers, which is a list of alpha characters.
Pattern
object that matches any regular expression pattern string in the form of /some pattern
here/
.
Pattern.times(int)
instead.
Pattern
object that matches if the input has at least n
characters and the first n
characters all satisfy predicate
.
Parser
that recognizes reserved word tokens.
Tokens.Fragment
tagged as Tokens.Tag.RESERVED
.
Parser
that executes this
, and returns value
if succeeds.
Parser
implementations that scan the source and match certain string
patterns.Pattern
object that matches a scientific notation, such as 1e12
, 1.2E-1
, etc.
Tokens.ScientificNotation
with significand
before the 'e' or 'E'
and exponent
after.
Parser
that runs this
0 or more times separated by delim
.
Parser
that runs this
1 or more times separated by delim
.
Parser
that runs this
for 0 ore more times separated and optionally terminated by delim
.
Parser
that runs this
for 1 ore more times separated and optionally terminated by delim
.
Parser
that sequentially runs parsers
and invokes the underlying
map
method or curried constructor using the returned values.
Parser
that runs 2 parser objects sequentially.
Parser
that runs 3 parser objects sequentially.
Parser
that runs 4 parser objects sequentially.
Parser
that runs 5 parser objects sequentially.
Parser
that runs p1
and p2
sequentially
and transforms the return values using map
.
Parser
that runs 3 parser objects sequentially and transforms the return values
using map
.
Parser
that runs 4 parser objects sequentially and transforms the return values
using map
.
Parser
that runs 5 parser objects sequentially and transforms the return values
using map
.
Parser
that runs parsers
sequentially and discards the return values.
Parser
that runs parsers
sequentially and discards the return values.
Pattern
object that matches the input against patterns
sequentially.
Parser
that runs both p1
and p2
and selects the shorter match.
Pattern
that tries both p1
and p2
, and picks the one with the shorter match
length.
Parser
that runs every element of parsers
and selects the shortest match.
Parser
that runs every element of parsers
and selects the shortest match.
Pattern
that tries all of patterns
, and picks the one with the shortest match length.
'\'
),
and then converts the character to a Character
token.
Parser
that runs this
parser greedily for at least min
times and ignores the return
values.
p.skipMany()
is equivalent to p*
in EBNF.
p.skipMany1()
is equivalent to p+
in EBNF.
Parser
that sequentially runs this
for n
times and ignores the return values.
Parser
that runs this
parser for at least min
times and up to max
times, with
all the return values ignored.
Pattern.atMost(int)
instead.
Pattern.times(int, int)
instead.
Patterns.times(int, int, CharPredicate)
instead.
Patterns.atMost(int, CharPredicate)
instead.
Parser
that returns the matched string in the original source.
Pattern
object that matches a decimal number that has at least one digit before the decimal point.
Pattern
object that matches string
literally.
Patterns.string(str).toScanner(name)
.
Pattern
object that matches string
case insensitively.
Patterns.stringCaseInsensitive(str).toScanner(name)
.
Parser
that returns true
if this
succeeds, false
otherwise.
Terminals
instance by defining the words and keywords recognized.String
.String
.Long
.Parser
that runs this
for n
times and collects the return values in a List
.
Parser
that runs this
parser for at least min
times and up to max
times.
Pattern
object that matches this pattern for at least min
times
and up to max
times.
Pattern
object that matches the input against this pattern for n
times.
Pattern
that matches at least min
and up to max
number of characters satisfying
predicate
,
Map
that maps a String
to Integer
by calling
Integer.valueOf(String)
.
Unary
that maps a String
to lower case using Locale.US
.
Unary
that maps a String
to upper case using Locale.US
.
Map
that maps the string representation of an enum
to the corresponding enum value by calling Enum.valueOf(Class, String)
.
Parser
that runs this
and wraps the return value in a Token
.
fromToken
object.
1, 2.3, 00, 0., .23
)
and returns a Tokens.Fragment
token tagged as Tokens.Tag.DECIMAL
.
Tokens.Fragment
token tagged as
Tokens.Tag.IDENTIFIER
.
0, 00, 1, 10
)
and returns a Tokens.Fragment
token tagged as Tokens.Tag.INTEGER
.
Long
value.
Tokens.ScientificNotation
value.
Token
to a an object of type T
, or null if the token isn't recognized.Tokens.Fragment
token tags.type
, in which case, the token value is
returned and parse succeeds.
Unary
that maps a String
to lower case using locale
.
Map2
object that maps 2 values into a Pair
object.
this
pattern.
Map3
object that maps 3 values to a Tuple3
object.
Map4
object that maps 4 values to a Tuple4
object.
Map5
object that maps 5 values to a Tuple5
object.
Unary
that maps a String
to upper case using locale
.
Pair
of 2 objects.
Tuple3
of 3 objects.
Tuple4
of 4 objects.
Tuple5
of 5 objects.
Parser
that sequentially runs p1
and p2
and collects the results in a
Pair
object.
Parser
that sequentially runs 3 parser objects and collects the results in a
Tuple3
object.
Parser
that sequentially runs 4 parser objects and collects the results in a
Tuple4
object.
Parser
that sequentially runs 5 parser objects and collects the results in a
Tuple5
object.
Pair
and tuple instances.T
.Parser
that returns a Unary
instance that invokes the underlying
map
method or curried constructor with the only parameter of the
Map.map(Object)
method.
Parser
that fails and reports that name
is logically unexpected.
Parser
that matches this parser zero or many times
until the given parser succeeds.
Parser
that recognizes 1 or more whitespace characters on the same line.
Parser
that returns both parsed object and matched string.
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.
Terminals
instance that recognizes words not already recognized
by this
Terminals
instance (typically operators).
parser
so that it will be skipped when applied in Mapper.sequence(Parser[])
,
Mapper.prefix(Parser[])
or Mapper.postfix(Parser[])
.
|
||||||||||
PREV NEXT | FRAMES NO FRAMES |