DefaultParsers
Provides common Parser implementations and helper methods.
Attributes
- Graph
-
- Supertypes
- Self type
-
DefaultParsers.type
Members list
Type members
Inherited classlikes
See unapply.
See unapply.
Attributes
- Inherited from:
- ParserMain
- Supertypes
-
class Objecttrait Matchableclass Any
Value members
Concrete methods
Applies parser p
to input s
and returns true
if the parse was successful.
Applies parser p
to input s
and returns true
if the parse was successful.
Attributes
Inherited methods
Parses a URI that is valid according to the single argument java.net.URI constructor, using ex
as tab completion examples.
Parses a URI that is valid according to the single argument java.net.URI constructor, using ex
as tab completion examples.
Attributes
- Inherited from:
- Parsers
Returns true if c
is an ASCII letter or digit.
Applies parser p
to input s
.
Defines a Parser that parses a single character only if the predicate f
returns true for that character. If this parser fails, label
is used as the failure message.
Defines a Parser that parses a single character only if the predicate f
returns true for that character. If this parser fails, label
is used as the failure message.
Attributes
- Inherited from:
- ParserMain
Defines a Parser that parses a single character only if it is contained in legal
.
Defines a Parser that parses a single character only if it is contained in legal
.
Attributes
- Inherited from:
- ParserMain
Applies parser p
to input s
and returns the completions at verbosity level
. The interpretation of level
is up to parser definitions, but 0 is the default by convention, with increasing positive numbers corresponding to increasing verbosity. Typically no more than a few levels are defined.
Applies parser p
to input s
and returns the completions at verbosity level
. The interpretation of level
is up to parser definitions, but 0 is the default by convention, with increasing positive numbers corresponding to increasing verbosity. Typically no more than a few levels are defined.
Attributes
- Inherited from:
- ParserMain
Applies parser p
to a single character of input.
Type parameters
- A
-
the type of values that are returned by the parser.
Value parameters
- a
-
the parser to decorate with a source of examples. All validation and parsing is delegated to this parser, only Parser.completions is modified.
- completions
-
the source of examples when displaying completions to the user.
- maxNumberOfExamples
-
limits the number of examples that the source of examples should return. This can prevent lengthy pauses and avoids bad interactive user experience.
- removeInvalidExamples
-
indicates whether completion examples should be checked for validity (against the given parser). An exception is thrown if the example source contains no valid completion suggestions.
Attributes
- Inherited from:
- ParserMain
Attributes
- Inherited from:
- ParserMain
Defines a parser that always fails on any input with message msg
. If definitive
is true
, any failures by later alternatives are discarded.
Defines a parser that always fails on any input with message msg
. If definitive
is true
, any failures by later alternatives are discarded.
Attributes
- Inherited from:
- ParserMain
Value parameters
- base
-
the directory used for completion proposals (when the user presses the TAB key). Only paths under this directory will be proposed.
Attributes
- Returns
-
the file that was parsed from the input string. The returned path may or may not exist.
- Inherited from:
- Parsers
Applies p
and uses true
as the result if it succeeds and turns failure into a result of false
.
Applies p
and uses true
as the result if it succeeds and turns failure into a result of false
.
Attributes
- Inherited from:
- Parsers
Attributes
- Inherited from:
- ParserMain
Parses a String that starts with start
and is followed by zero or more characters parsed by rep
.
Parses a String that starts with start
and is followed by zero or more characters parsed by rep
.
Attributes
- Inherited from:
- Parsers
Defines a parser that always fails on any input with messages msgs
. If definitive
is true
, any failures by later alternatives are discarded.
Defines a parser that always fails on any input with messages msgs
. If definitive
is true
, any failures by later alternatives are discarded.
Attributes
- Inherited from:
- ParserMain
Attributes
- Inherited from:
- Parsers
Returns true if c
is a dash -
, a letter, digit, or an underscore _
.
Returns true if c
is a dash -
, a letter, digit, or an underscore _
.
Attributes
- Inherited from:
- Parsers
Returns true if c
an operator character.
Returns true if c
is a letter, digit, or an underscore _
.
Applies f
to the result of p
, transforming any exception when evaluating f
into a parse failure with the exception toString
as the message.
Applies f
to the result of p
, transforming any exception when evaluating f
into a parse failure with the exception toString
as the message.
Attributes
- Inherited from:
- Parsers
Attributes
- Inherited from:
- ParserMain
Attributes
- Inherited from:
- ParserMain
Attributes
- Inherited from:
- ParserMain
Attributes
- Inherited from:
- Parsers
Parses input str
using parser
. If successful, the result is provided wrapped in Right
. If unsuccessful, an error message is provided in Left
.
Parses input str
using parser
. If successful, the result is provided wrapped in Right
. If unsuccessful, an error message is provided in Left
.
Attributes
- Inherited from:
- ParserMain
Presents a Char range as a Parser. A single Char is parsed only if it is in the given range.
Presents a Char range as a Parser. A single Char is parsed only if it is in the given range.
Attributes
- Inherited from:
- ParserMain
Applies rep
one or more times, separated by sep
. The result is the non-empty sequence of results from the multiple rep
applications. The sep
results are discarded.
Applies rep
one or more times, separated by sep
. The result is the non-empty sequence of results from the multiple rep
applications. The sep
results are discarded.
Attributes
- Inherited from:
- Parsers
Defines a sequence parser where the parser used for each part depends on the previously parsed values. p
is applied to the (possibly empty) sequence of already parsed values to obtain the next parser to use. The parsers obtained in this way are separated by sep
, whose result is discarded and only the sequence of values from the parsers returned by p
is used for the result.
Defines a sequence parser where the parser used for each part depends on the previously parsed values. p
is applied to the (possibly empty) sequence of already parsed values to obtain the next parser to use. The parsers obtained in this way are separated by sep
, whose result is discarded and only the sequence of values from the parsers returned by p
is used for the result.
Attributes
- Inherited from:
- Parsers
Applies rep
zero or more times, separated by sep
. The result is the (possibly empty) sequence of results from the multiple rep
applications. The sep
results are discarded.
Applies rep
zero or more times, separated by sep
. The result is the (possibly empty) sequence of results from the multiple rep
applications. The sep
results are discarded.
Attributes
- Inherited from:
- Parsers
Attributes
- Inherited from:
- ParserMain
Convenience method to use when developing a parser. parser
is applied to the input str
. If completions
is true, the available completions for the input are displayed. Otherwise, the result of parsing is printed using the result's toString
method. If parsing fails, the error message is displayed.
Convenience method to use when developing a parser. parser
is applied to the input str
. If completions
is true, the available completions for the input are displayed. Otherwise, the result of parsing is printed using the result's toString
method. If parsing fails, the error message is displayed.
See also sampleParse and sampleCompletions.
Attributes
- Inherited from:
- ParserMain
Convenience method to use when developing a parser. parser
is applied to the input str
and the available completions are displayed on separate lines. If parsing fails, the error message is displayed.
Convenience method to use when developing a parser. parser
is applied to the input str
and the available completions are displayed on separate lines. If parsing fails, the error message is displayed.
Attributes
- Inherited from:
- ParserMain
Convenience method to use when developing a parser. parser
is applied to the input str
and the result of parsing is printed using the result's toString
method. If parsing fails, the error message is displayed.
Convenience method to use when developing a parser. parser
is applied to the input str
and the result of parsing is printed using the result's toString
method. If parsing fails, the error message is displayed.
Attributes
- Inherited from:
- ParserMain
Attributes
- Inherited from:
- ParserMain
Attributes
- Inherited from:
- ParserMain
Wraps the result of p
in Some
.
Parses a space-delimited, possibly empty sequence of arguments. The arguments may use quotes and escapes according to StringBasic.
Parses a space-delimited, possibly empty sequence of arguments. The arguments may use quotes and escapes according to StringBasic.
Attributes
- Inherited from:
- Parsers
Attributes
- Inherited from:
- ParserMain
Defines a parser that always succeeds on empty input with the result value
.
Defines a parser that always succeeds on empty input with the result value
.
Attributes
- Inherited from:
- ParserMain
Attributes
- Inherited from:
- ParserMain
Establishes delegate parser t
as a single token of tab completion. When tab completion of part of this token is requested, description
is displayed for suggestions and no completions are ever performed.
Establishes delegate parser t
as a single token of tab completion. When tab completion of part of this token is requested, description
is displayed for suggestions and no completions are ever performed.
Attributes
- Inherited from:
- ParserMain
Establishes delegate parser t
as a single token of tab completion. When tab completion of part of this token is requested, no completions are returned if hide
returns true for the current tab completion level. Otherwise, the completions provided by the delegate t
or a later derivative are appended to the prefix String already seen by this parser.
Establishes delegate parser t
as a single token of tab completion. When tab completion of part of this token is requested, no completions are returned if hide
returns true for the current tab completion level. Otherwise, the completions provided by the delegate t
or a later derivative are appended to the prefix String already seen by this parser.
Attributes
- Inherited from:
- ParserMain
Establishes delegate parser t
as a single token of tab completion. When tab completion of part of this token is requested, the completions provided by the delegate t
or a later derivative are appended to the prefix String already seen by this parser.
Establishes delegate parser t
as a single token of tab completion. When tab completion of part of this token is requested, the completions provided by the delegate t
or a later derivative are appended to the prefix String already seen by this parser.
Attributes
- Inherited from:
- ParserMain
Establishes delegate parser t
as a single token of tab completion. When tab completion of part of this token is requested, display
is used as the printed suggestion, but the completions from the delegate parser t
are used to complete if unambiguous.
Establishes delegate parser t
as a single token of tab completion. When tab completion of part of this token is requested, display
is used as the printed suggestion, but the completions from the delegate parser t
are used to complete if unambiguous.
Attributes
- Inherited from:
- ParserMain
Inherited fields
Backslash character.
Parses the lower-case values true
and false
into their corresponding Boolean values.
Parses the lower-case values true
and false
into their corresponding Boolean values.
Attributes
- Inherited from:
- Parsers
Parses a non-symbolic Scala-like identifier. The identifier must start with Upper and contain zero or more ScalaIDChars after that.
Parses a non-symbolic Scala-like identifier. The identifier must start with Upper and contain zero or more ScalaIDChars after that.
Attributes
- Inherited from:
- Parsers
Double quote character.
Matches a single double quote.
Parses any single digit and provides that digit as a Char as the result.
Parses any single digit and provides that digit as a Char as the result.
Attributes
- Inherited from:
- Parsers
Set that contains each digit in a String representation.
Matches the end of input, providing no useful result on success.
Parses a single escape sequence into the represented Char. Escapes start with a backslash and are followed by u
for a UnicodeEscape or by b
, t
, n
, f
, r
, "
, '
, \
for standard escapes.
Parses a single escape sequence into the represented Char. Escapes start with a backslash and are followed by u
for a UnicodeEscape or by b
, t
, n
, f
, r
, "
, '
, \
for standard escapes.
Attributes
- Inherited from:
- Parsers
Parses a single hexadecimal digit (0-9, a-f, A-F).
Set containing Chars for hexadecimal digits 0-9 and A-F (but not a-f).
Set containing Chars for hexadecimal digits 0-9 and A-F (but not a-f).
Attributes
- Inherited from:
- Parsers
Parses an identifier Char other than the first character. This includes letters, digits, dash -
, and underscore _
.
Parses an identifier Char other than the first character. This includes letters, digits, dash -
, and underscore _
.
Attributes
- Inherited from:
- Parsers
Parses a signed integer.
Parses a single letter, according to Char.isLetter, into a Char.
Parses a single letter, according to Char.isLower, into a Char.
Parses an unsigned integer.
Matches any character except a double quote or backslash.
Matches any character except a double quote or whitespace.
Parses an unquoted, non-empty String value that cannot start with a double quote and cannot contain whitespace.
Parses an unquoted, non-empty String value that cannot start with a double quote and cannot contain whitespace.
Attributes
- Inherited from:
- Parsers
Parses a non-empty String value that cannot start with a double quote, but includes double quotes.
Parses a non-empty String value that cannot start with a double quote, but includes double quotes.
Attributes
- Inherited from:
- Parsers
Matches a non-empty String consisting of non-whitespace characters.
Matches a non-empty String consisting of non-whitespace characters.
Attributes
- Inherited from:
- Parsers
Matches a single character that is not a whitespace character.
Matches a possibly empty String consisting of non-whitespace characters.
Matches a possibly empty String consisting of non-whitespace characters.
Attributes
- Inherited from:
- Parsers
Matches a possibly empty String consisting of whitespace characters. The suggested tab completion is a single, constant space character.
Matches a possibly empty String consisting of whitespace characters. The suggested tab completion is a single, constant space character.
Attributes
- Inherited from:
- Parsers
Parses a port number. Currently, this accepts any integer and presents a tab completion suggestion of <port>
.
Parses a port number. Currently, this accepts any integer and presents a tab completion suggestion of <port>
.
Attributes
- Inherited from:
- Parsers
Parses a non-symbolic Scala-like identifier. The identifier must start with IDStart and contain zero or more ScalaIDChars after that.
Parses a non-symbolic Scala-like identifier. The identifier must start with IDStart and contain zero or more ScalaIDChars after that.
Attributes
- Inherited from:
- Parsers
Parses a single, non-symbolic Scala identifier Char. Valid characters are letters, digits, and the underscore character _
.
Parses a single, non-symbolic Scala identifier Char. Valid characters are letters, digits, and the underscore character _
.
Attributes
- Inherited from:
- Parsers
Parses a size unit string. For example, 128K
parsers to 128L * 1024
, and 1.25g
parses to 1024L * 1024 * 1024 * 5 / 4
.
Parses a size unit string. For example, 128K
parsers to 128L * 1024
, and 1.25g
parses to 1024L * 1024 * 1024 * 5 / 4
.
Attributes
- Inherited from:
- Parsers
Matches a non-empty String consisting of whitespace characters. The suggested tab completion is a single, constant space character.
Matches a non-empty String consisting of whitespace characters. The suggested tab completion is a single, constant space character.
Attributes
- Inherited from:
- Parsers
Matches a single whitespace character, as determined by Char.isWhitespace.
Matches a single whitespace character, as determined by Char.isWhitespace.
Attributes
- Inherited from:
- Parsers
Parses a potentially quoted String value. The value may be verbatim quoted (StringVerbatim), quoted with interpreted escapes (StringEscapable), or unquoted (NotQuoted).
Parses a potentially quoted String value. The value may be verbatim quoted (StringVerbatim), quoted with interpreted escapes (StringEscapable), or unquoted (NotQuoted).
Attributes
- Inherited from:
- Parsers
Parses a string value, interpreting escapes and discarding the surrounding quotes in the result. See EscapeSequence for supported escapes.
Parses a string value, interpreting escapes and discarding the surrounding quotes in the result. See EscapeSequence for supported escapes.
Attributes
- Inherited from:
- Parsers
Parses a verbatim quoted String value, discarding the quotes in the result. This kind of quoted text starts with triple quotes """
and ends at the next triple quotes and may contain any character in between.
Parses a verbatim quoted String value, discarding the quotes in the result. This kind of quoted text starts with triple quotes """
and ends at the next triple quotes and may contain any character in between.
Attributes
- Inherited from:
- Parsers
Matches a single character that is valid somewhere in a URI.
Parses a single unicode escape sequence into the represented Char. A unicode escape begins with a backslash, followed by a u
and 4 hexadecimal digits representing the unicode value.
Parses a single unicode escape sequence into the represented Char. A unicode escape begins with a backslash, followed by a u
and 4 hexadecimal digits representing the unicode value.
Attributes
- Inherited from:
- Parsers
Parses a single letter, according to Char.isUpper, into a Char.
Triple-quotes, as used for verbatim quoting.
Parses any single character and provides that character as the result.
Parses any single character and provides that character as the result.
Attributes
- Inherited from:
- Parsers
Extensions
Inherited extensions
Attributes
- Inherited from:
- ParserMain
Implicits
Inherited implicits
Presents a literal String s
as a Parser that only parses that exact text and provides it as the result.
Presents a literal String s
as a Parser that only parses that exact text and provides it as the result.
Attributes
- Inherited from:
- ParserMain
Presents a single Char ch
as a Parser that only parses that exact character.
Presents a single Char ch
as a Parser that only parses that exact character.
Attributes
- Inherited from:
- ParserMain
Attributes
- Inherited from:
- ParserMain
Attributes
- Inherited from:
- ParserMain
Presents a Char range as a Parser. A single Char is parsed only if it is in the given range.
Presents a Char range as a Parser. A single Char is parsed only if it is in the given range.
Attributes
- Inherited from:
- ParserMain
Provides combinators for Parsers.