Object

sbt.internal.util.complete

DefaultParsers

Related Doc: package complete

Permalink

object DefaultParsers extends Parsers with ParserMain

Provides common Parser implementations and helper methods.

Linear Supertypes
ParserMain, Parsers, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. DefaultParsers
  2. ParserMain
  3. Parsers
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. lazy val BackslashChar: Char

    Permalink

    Backslash character.

    Backslash character.

    Definition Classes
    Parsers
  5. lazy val Bool: Parser[Boolean]

    Permalink

    Parses the lower-case values true and false into their respesct Boolean values.

    Parses the lower-case values true and false into their respesct Boolean values.

    Definition Classes
    Parsers
  6. lazy val DQuoteChar: Char

    Permalink

    Double quote character.

    Double quote character.

    Definition Classes
    Parsers
  7. lazy val DQuoteClass: Parser[Char]

    Permalink

    Matches a single double quote.

    Matches a single double quote.

    Definition Classes
    Parsers
  8. lazy val Digit: Parser[Char]

    Permalink

    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.

    Definition Classes
    Parsers
  9. lazy val DigitSet: Set[String]

    Permalink

    Set that contains each digit in a String representation.

    Set that contains each digit in a String representation.

    Definition Classes
    Parsers
  10. lazy val EOF: Parser[Unit]

    Permalink

    Matches the end of input, providing no useful result on success.

    Matches the end of input, providing no useful result on success.

    Definition Classes
    Parsers
  11. lazy val EscapeSequence: Parser[Char]

    Permalink

    Parses a single escape sequence into the represented Char.

    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.

    Definition Classes
    Parsers
  12. lazy val HexDigit: Parser[Char]

    Permalink

    Parses a single hexadecimal digit (0-9, a-f, A-F).

    Parses a single hexadecimal digit (0-9, a-f, A-F).

    Definition Classes
    Parsers
  13. lazy val HexDigitSet: Set[Char]

    Permalink

    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).

    Definition Classes
    Parsers
  14. lazy val ID: Parser[String]

    Permalink

    Parses an identifier String, which must start with IDStart and contain zero or more IDChars after that.

    Parses an identifier String, which must start with IDStart and contain zero or more IDChars after that.

    Definition Classes
    Parsers
  15. lazy val IDChar: Parser[Char]

    Permalink

    Parses an identifier Char other than the first character.

    Parses an identifier Char other than the first character. This includes letters, digits, dash -, and underscore _.

    Definition Classes
    Parsers
  16. def IDStart: Parser[Char]

    Permalink

    Parses the first Char in an sbt identifier, which must be a Letter.

    Parses the first Char in an sbt identifier, which must be a Letter.

    Definition Classes
    Parsers
  17. lazy val IntBasic: Parser[Int]

    Permalink

    Parses a signed integer.

    Parses a signed integer.

    Definition Classes
    Parsers
  18. lazy val Letter: Parser[Char]

    Permalink

    Parses a single letter, according to Char.isLetter, into a Char.

    Parses a single letter, according to Char.isLetter, into a Char.

    Definition Classes
    Parsers
  19. lazy val NatBasic: Parser[Int]

    Permalink

    Parses an unsigned integer.

    Parses an unsigned integer.

    Definition Classes
    Parsers
  20. lazy val NotDQuoteBackslashClass: Parser[Char]

    Permalink

    Matches any character except a double quote or backslash.

    Matches any character except a double quote or backslash.

    Definition Classes
    Parsers
  21. lazy val NotDQuoteSpaceClass: Parser[Char]

    Permalink

    Matches any character except a double quote or whitespace.

    Matches any character except a double quote or whitespace.

    Definition Classes
    Parsers
  22. lazy val NotQuoted: Parser[String]

    Permalink

    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.

    Definition Classes
    Parsers
  23. lazy val NotSpace: Parser[String]

    Permalink

    Matches a non-empty String consisting of non-whitespace characters.

    Matches a non-empty String consisting of non-whitespace characters.

    Definition Classes
    Parsers
  24. lazy val NotSpaceClass: Parser[Char]

    Permalink

    Matches a single character that is not a whitespace character.

    Matches a single character that is not a whitespace character.

    Definition Classes
    Parsers
  25. lazy val Op: Parser[String]

    Permalink

    Parses a non-empty operator String, which consists only of characters allowed by OpChar.

    Parses a non-empty operator String, which consists only of characters allowed by OpChar.

    Definition Classes
    Parsers
  26. lazy val OpChar: Parser[Char]

    Permalink

    Parses a single operator Char, as allowed by isOpChar.

    Parses a single operator Char, as allowed by isOpChar.

    Definition Classes
    Parsers
  27. lazy val OpOrID: Parser[String]

    Permalink

    Parses either an operator String defined by Op or a non-symbolic identifier defined by ID.

    Parses either an operator String defined by Op or a non-symbolic identifier defined by ID.

    Definition Classes
    Parsers
  28. lazy val OptNotSpace: Parser[String]

    Permalink

    Matches a possibly empty String consisting of non-whitespace characters.

    Matches a possibly empty String consisting of non-whitespace characters.

    Definition Classes
    Parsers
  29. lazy val OptSpace: Parser[Seq[Char]]

    Permalink

    Matches a possibly empty String consisting of whitespace characters.

    Matches a possibly empty String consisting of whitespace characters. The suggested tab completion is a single, constant space character.

    Definition Classes
    Parsers
  30. lazy val Port: Parser[Int]

    Permalink

    Parses a port number.

    Parses a port number. Currently, this accepts any integer and presents a tab completion suggestion of <port>.

    Definition Classes
    Parsers
  31. lazy val ScalaID: Parser[String]

    Permalink

    Parses a non-symbolic Scala-like identifier.

    Parses a non-symbolic Scala-like identifier. The identifier must start with IDStart and contain zero or more ScalaIDChars after that.

    Definition Classes
    Parsers
  32. lazy val ScalaIDChar: Parser[Char]

    Permalink

    Parses a single, non-symbolic Scala identifier Char.

    Parses a single, non-symbolic Scala identifier Char. Valid characters are letters, digits, and the underscore character _.

    Definition Classes
    Parsers
  33. lazy val Space: Parser[Seq[Char]]

    Permalink

    Matches a non-empty String consisting of whitespace characters.

    Matches a non-empty String consisting of whitespace characters. The suggested tab completion is a single, constant space character.

    Definition Classes
    Parsers
  34. lazy val SpaceClass: Parser[Char]

    Permalink

    Matches a single whitespace character, as determined by Char.isWhitespace.

    Matches a single whitespace character, as determined by Char.isWhitespace.

    Definition Classes
    Parsers
  35. lazy val StringBasic: Parser[String]

    Permalink

    Parses a potentially quoted String value.

    Parses a potentially quoted String value. The value may be verbatim quoted (StringVerbatim), quoted with interpreted escapes (StringEscapable), or unquoted (NotQuoted).

    Definition Classes
    Parsers
  36. lazy val StringEscapable: Parser[String]

    Permalink

    Parses a string value, interpreting escapes and discarding the surrounding quotes in the result.

    Parses a string value, interpreting escapes and discarding the surrounding quotes in the result. See EscapeSequence for supported escapes.

    Definition Classes
    Parsers
  37. lazy val StringVerbatim: Parser[String]

    Permalink

    Parses a verbatim quoted String value, discarding the quotes in the result.

    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.

    Definition Classes
    Parsers
  38. lazy val URIChar: Parser[Char]

    Permalink

    Matches a single character that is valid somewhere in a URI.

    Matches a single character that is valid somewhere in a URI.

    Definition Classes
    Parsers
  39. lazy val URIClass: Parser[String]

    Permalink

    Parses a non-empty String that contains only valid URI characters, as defined by URIChar.

    Parses a non-empty String that contains only valid URI characters, as defined by URIChar.

    Definition Classes
    Parsers
  40. lazy val UnicodeEscape: Parser[Char]

    Permalink

    Parses a single unicode escape sequence into the represented Char.

    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.

    Definition Classes
    Parsers
  41. def Uri(ex: Set[URI]): Parser[URI]

    Permalink

    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.

    Definition Classes
    Parsers
  42. lazy val VerbatimDQuotes: String

    Permalink

    Triple-quotes, as used for verbatim quoting.

    Triple-quotes, as used for verbatim quoting.

    Definition Classes
    Parsers
  43. def alphanum(c: Char): Boolean

    Permalink

    Returns true if c is an ASCII letter or digit.

    Returns true if c is an ASCII letter or digit.

    Definition Classes
    Parsers
  44. lazy val any: Parser[Char]

    Permalink

    Parses any single character and provides that character as the result.

    Parses any single character and provides that character as the result.

    Definition Classes
    Parsers
  45. def apply[T](p: Parser[T])(s: String): Parser[T]

    Permalink

    Applies parser p to input s.

    Applies parser p to input s.

    Definition Classes
    ParserMain
  46. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  47. lazy val basicUri: Parser[URI]

    Permalink

    Parses a URI that is valid according to the single argument java.net.URI constructor.

    Parses a URI that is valid according to the single argument java.net.URI constructor.

    Definition Classes
    Parsers
  48. def charClass(f: (Char) ⇒ Boolean, label: String = "<unspecified>"): Parser[Char]

    Permalink

    Defines a Parser that parses a single character only if the predicate f returns true for that character.

    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.

    Definition Classes
    ParserMain
  49. def chars(legal: String): Parser[Char]

    Permalink

    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.

    Definition Classes
    ParserMain
  50. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  51. def completions(p: Parser[_], s: String, level: Int): Completions

    Permalink

    Applies parser p to input s and returns the completions at verbosity level.

    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.

    Definition Classes
    ParserMain
  52. def derive1[T](p: Parser[T], c: Char): Parser[T]

    Permalink

    Applies parser p to a single character of input.

    Applies parser p to a single character of input.

    Definition Classes
    ParserMain
  53. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  54. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  55. def examples[A](a: Parser[A], completions: ExampleSource, maxNumberOfExamples: Int, removeInvalidExamples: Boolean): Parser[A]

    Permalink

    A

    the type of values that are returned by the parser.

    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.

    Definition Classes
    ParserMain
  56. def examples[A](a: Parser[A], completions: Set[String], check: Boolean = false): Parser[A]

    Permalink
    Definition Classes
    ParserMain
  57. def failure(msg: ⇒ String, definitive: Boolean = false): Parser[Nothing]

    Permalink

    Defines a parser that always fails on any input with message msg.

    Defines a parser that always fails on any input with message msg. If definitive is true, any failures by later alternatives are discarded.

    Definition Classes
    ParserMain
  58. def fileParser(base: File): Parser[File]

    Permalink

    base

    the directory used for completion proposals (when the user presses the TAB key). Only paths under this directory will be proposed.

    returns

    the file that was parsed from the input string. The returned path may or may not exist.

    Definition Classes
    Parsers
  59. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  60. def flag[T](p: Parser[T]): Parser[Boolean]

    Permalink

    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.

    Definition Classes
    Parsers
  61. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  62. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  63. def homParser[A](a: Parser[A], b: Parser[A]): Parser[A]

    Permalink
    Definition Classes
    ParserMain
  64. def identifier(start: Parser[Char], rep: Parser[Char]): Parser[String]

    Permalink

    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.

    Definition Classes
    Parsers
  65. def invalid(msgs: ⇒ Seq[String], definitive: Boolean = false): Parser[Nothing]

    Permalink

    Defines a parser that always fails on any input with messages msgs.

    Defines a parser that always fails on any input with messages msgs. If definitive is true, any failures by later alternatives are discarded.

    Definition Classes
    ParserMain
  66. def isDelimiter(c: Char): Boolean

    Permalink
    Definition Classes
    Parsers
  67. def isIDChar(c: Char): Boolean

    Permalink

    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 _.

    Definition Classes
    Parsers
  68. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  69. def isOpChar(c: Char): Boolean

    Permalink

    Returns true if c an operator character.

    Returns true if c an operator character.

    Definition Classes
    Parsers
  70. def isOpType(cat: Int): Boolean

    Permalink
    Definition Classes
    Parsers
  71. def isScalaIDChar(c: Char): Boolean

    Permalink

    Returns true if c is a letter, digit, or an underscore _.

    Returns true if c is a letter, digit, or an underscore _.

    Definition Classes
    Parsers
  72. implicit def literal(s: String): Parser[String]

    Permalink

    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.

    Definition Classes
    ParserMain
  73. implicit def literal(ch: Char): Parser[Char]

    Permalink

    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.

    Definition Classes
    ParserMain
  74. implicit def literalRichCharParser(c: Char): RichParser[Char]

    Permalink
    Definition Classes
    ParserMain
  75. implicit def literalRichStringParser(s: String): RichParser[String]

    Permalink
    Definition Classes
    ParserMain
  76. def mapOrFail[S, T](p: Parser[S])(f: (S) ⇒ T): Parser[T]

    Permalink

    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.

    Definition Classes
    Parsers
  77. def matched(t: Parser[_], seen: Vector[Char] = Vector.empty, partial: Boolean = false): Parser[String]

    Permalink
    Definition Classes
    ParserMain
  78. def matches(p: Parser[_], s: String): Boolean

    Permalink

    Applies parser p to input s and returns true if the parse was successful.

  79. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  80. def not(p: Parser[_], failMessage: String): Parser[Unit]

    Permalink
    Definition Classes
    ParserMain
  81. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  82. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  83. def oneOf[T](p: Seq[Parser[T]]): Parser[T]

    Permalink
    Definition Classes
    ParserMain
  84. def opOrIDSpaced(s: String): Parser[Char]

    Permalink
    Definition Classes
    Parsers
  85. def parse[T](str: String, parser: Parser[T]): Either[String, T]

    Permalink

    Parses input str using parser.

    Parses input str using parser. If successful, the result is provided wrapped in Right. If unsuccessful, an error message is provided in Left.

    Definition Classes
    ParserMain
  86. implicit def range(r: NumericRange[Char]): Parser[Char]

    Permalink

    Presents a Char range as a Parser.

    Presents a Char range as a Parser. A single Char is parsed only if it is in the given range.

    Definition Classes
    ParserMain
  87. def rep1sep[T](rep: Parser[T], sep: Parser[_]): Parser[Seq[T]]

    Permalink

    Applies rep one or more times, separated by sep.

    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.

    Definition Classes
    Parsers
  88. def repeatDep[A](p: (Seq[A]) ⇒ Parser[A], sep: Parser[Any]): Parser[Seq[A]]

    Permalink

    Defines a sequence parser where the parser used for each part depends on the previously parsed values.

    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.

    Definition Classes
    Parsers
  89. def repsep[T](rep: Parser[T], sep: Parser[_]): Parser[Seq[T]]

    Permalink

    Applies rep zero or more times, separated by sep.

    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.

    Definition Classes
    Parsers
  90. def result[T](p: Parser[T], s: String): Either[() ⇒ (Seq[String], Int), T]

    Permalink
    Definition Classes
    ParserMain
  91. implicit def richParser[A](a: Parser[A]): RichParser[A]

    Permalink

    Provides combinators for Parsers.

    Provides combinators for Parsers.

    Definition Classes
    ParserMain
  92. def sample(str: String, parser: Parser[_], completions: Boolean = false): Unit

    Permalink

    Convenience method to use when developing a parser.

    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.

    Definition Classes
    ParserMain
  93. def sampleCompletions(str: String, parser: Parser[_], level: Int = 1): Unit

    Permalink

    Convenience method to use when developing a parser.

    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.

    Definition Classes
    ParserMain
  94. def sampleParse(str: String, parser: Parser[_]): Unit

    Permalink

    Convenience method to use when developing a parser.

    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.

    Definition Classes
    ParserMain
  95. def seq[T](p: Seq[Parser[T]]): Parser[Seq[T]]

    Permalink
    Definition Classes
    ParserMain
  96. def seq0[T](p: Seq[Parser[T]], errors: ⇒ Seq[String]): Parser[Seq[T]]

    Permalink
    Definition Classes
    ParserMain
  97. def some[T](p: Parser[T]): Parser[Option[T]]

    Permalink

    Wraps the result of p in Some.

    Wraps the result of p in Some.

    Definition Classes
    Parsers
  98. def spaceDelimited(display: String): Parser[Seq[String]]

    Permalink

    Parses a space-delimited, possibly empty sequence of arguments.

    Parses a space-delimited, possibly empty sequence of arguments. The arguments may use quotes and escapes according to StringBasic.

    Definition Classes
    Parsers
  99. def stringLiteral(s: String, start: Int): Parser[String]

    Permalink
    Definition Classes
    ParserMain
  100. def success[T](value: T): Parser[T]

    Permalink

    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.

    Definition Classes
    ParserMain
  101. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  102. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  103. def token[T](t: Parser[T], complete: TokenCompletions): Parser[T]

    Permalink
    Definition Classes
    ParserMain
  104. def token[T](t: Parser[T], description: String): Parser[T]

    Permalink

    Establishes delegate parser t as a single token of tab completion.

    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.

    Definition Classes
    ParserMain
  105. def token[T](t: Parser[T], hide: (Int) ⇒ Boolean): Parser[T]

    Permalink

    Establishes delegate parser t as a single token of tab completion.

    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.

    Definition Classes
    ParserMain
  106. def token[T](t: Parser[T]): Parser[T]

    Permalink

    Establishes delegate parser t as a single token of tab completion.

    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.

    Definition Classes
    ParserMain
  107. def tokenDisplay[T](t: Parser[T], display: String): Parser[T]

    Permalink

    Establishes delegate parser t as a single token of tab completion.

    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.

    Definition Classes
    ParserMain
  108. def trimmed(p: Parser[String]): Parser[String]

    Permalink

    Applies String.trim to the result of p.

    Applies String.trim to the result of p.

    Definition Classes
    Parsers
  109. def validID(s: String): Boolean

    Permalink

    Returns true if s parses successfully according to ID.

  110. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  111. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  112. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  113. object ~

    Permalink

    See unapply.

    See unapply.

    Definition Classes
    ParserMain

Inherited from ParserMain

Inherited from Parsers

Inherited from AnyRef

Inherited from Any

Ungrouped