Object/Trait

sbt.internal.util.complete

Parser

Related Docs: trait Parser | package complete

Permalink

object Parser extends ParserMain

Contains Parser implementation helper methods not typically needed for using parsers.

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

Type Members

  1. final class Failure extends Result[Nothing]

    Permalink
  2. sealed abstract class Result[+T] extends AnyRef

    Permalink
  3. final case class Value[+T](value: T) extends Result[T] with Product with Serializable

    Permalink

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. def and[T](a: Parser[T], b: Parser[_]): Parser[T]

    Permalink
  5. 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
  6. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  7. def bindParser[A, B](a: Parser[A], f: (A) ⇒ Parser[B]): Parser[B]

    Permalink
  8. 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
  9. 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
  10. def choiceParser[A, B](a: Parser[A], b: Parser[B]): Parser[Either[A, B]]

    Permalink
  11. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  12. 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
  13. 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
  14. final def eq(arg0: AnyRef): Boolean

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

    Permalink
    Definition Classes
    AnyRef → Any
  16. 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
  17. def examples[A](a: Parser[A], completions: Set[String], check: Boolean = false): Parser[A]

    Permalink
    Definition Classes
    ParserMain
  18. 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
  19. def filterParser[T](a: Parser[T], f: (T) ⇒ Boolean, seen: String, msg: (String) ⇒ String): Parser[T]

    Permalink
  20. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  21. final def getClass(): Class[_]

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

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

    Permalink
    Definition Classes
    ParserMain
  24. 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
  25. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  26. 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
  27. 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
  28. implicit def literalRichCharParser(c: Char): RichParser[Char]

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

    Permalink
    Definition Classes
    ParserMain
  30. def mapParser[A, B](a: Parser[A], f: (A) ⇒ B): Parser[B]

    Permalink
  31. def matched(t: Parser[_], seen: Vector[Char] = Vector.empty, partial: Boolean = false): Parser[String]

    Permalink
    Definition Classes
    ParserMain
  32. def mkFailure(error: ⇒ String, definitive: Boolean = false): Failure

    Permalink
  33. def mkFailures(errors: ⇒ Seq[String], definitive: Boolean = false): Failure

    Permalink
  34. final def ne(arg0: AnyRef): Boolean

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

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

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

    Permalink
    Definition Classes
    AnyRef
  38. def onFailure[T](delegate: Parser[T], msg: String): Parser[T]

    Permalink
  39. def oneOf[T](p: Seq[Parser[T]]): Parser[T]

    Permalink
    Definition Classes
    ParserMain
  40. def oneOrMore[T](p: Parser[T]): Parser[Seq[T]]

    Permalink
  41. def opt[T](a: Parser[T]): Parser[Option[T]]

    Permalink
  42. 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
  43. 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
  44. def repeat[T](p: Parser[T], min: Int = 0, max: UpperBound = Infinite): Parser[Seq[T]]

    Permalink
  45. def result[T](p: Parser[T], s: String): Either[() ⇒ (Seq[String], Int), T]

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

    Permalink

    Provides combinators for Parsers.

    Provides combinators for Parsers.

    Definition Classes
    ParserMain
  47. 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
  48. 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
  49. 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
  50. def seq[T](p: Seq[Parser[T]]): Parser[Seq[T]]

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

    Permalink
    Definition Classes
    ParserMain
  52. def seqParser[A, B](a: Parser[A], b: Parser[B]): Parser[(A, B)]

    Permalink
  53. def stringLiteral(s: String, start: Int): Parser[String]

    Permalink
    Definition Classes
    ParserMain
  54. 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
  55. final def synchronized[T0](arg0: ⇒ T0): T0

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

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

    Permalink
    Definition Classes
    ParserMain
  58. 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
  59. 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
  60. 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
  61. 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
  62. def trapAndFail[T](delegate: Parser[T]): Parser[T]

    Permalink
  63. def tuple[A, B](a: Option[A], b: Option[B]): Option[(A, B)]

    Permalink
  64. final def wait(): Unit

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  67. def zeroOrMore[T](p: Parser[T]): Parser[Seq[T]]

    Permalink
  68. object ~

    Permalink

    See unapply.

    See unapply.

    Definition Classes
    ParserMain

Inherited from ParserMain

Inherited from AnyRef

Inherited from Any

Ungrouped