fastparse.core

Parser

trait Parser[+T] extends ParserApi[T]

A single, self-contained, immutable parser. The primary method is parse, which returns a T on success and a stack trace on failure.

Some small optimizations are performed in-line: collapsing parsers.Combinators.Either cells into large ones and collapsing parsers.Combinators.Sequence cells into parsers.Combinators.Sequence.Flats. These optimizations together appear to make things faster but any 10%, whether or not you activate tracing

Collapsed, Trace Timings all true 87 /97 /94 all false 112/111/104 either true 89 /84 /81 either false 97 /102/97 none true 84 /79 /80 none false 96 /99 /97

Linear Supertypes
ParserApi[T], AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Parser
  2. ParserApi
  3. AnyRef
  4. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def parseRec(cfg: ParseCtx, index: Int): Result[T]

    Parses the given input starting from the given index and logDepth

Concrete Value Members

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

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

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

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  7. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. final def eq(arg0: AnyRef): Boolean

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

    Definition Classes
    AnyRef → Any
  10. def fail(f: Mutable, index: Int, cut: Boolean = false): Mutable

    Definition Classes
    ParserApi
  11. def failMore(f: Mutable, index: Int, trace: Boolean, cut: Boolean = false): Mutable

    Definition Classes
    ParserApi
  12. def finalize(): Unit

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

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

    Definition Classes
    AnyRef → Any
  15. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  16. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  17. final def notify(): Unit

    Definition Classes
    AnyRef
  18. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  19. def parse(input: String, index: Int = 0, trace: Boolean = true, instrument: (Parser[_], Int, () ⇒ Result[_]) ⇒ Unit = null): Result[T]

    Parses the given input starting from the given index

    Parses the given input starting from the given index

    input

    The string we want to parse

    index

    The index in the string to start from. By default parsing starts from the beginning of a string, but you can start from halfway through the string if you want.

    trace

    Whether or not you want a full trace of any error messages that appear. Without it, you only get the single deepest parser in the call-stack when it failed, and its index. With trace, you get every parser all the way to the top, though this comes with a ~20-40% slowdown.

    instrument

    Allows you to pass in a callback that will get called by every named rule, its index, as it itself given a callback that can be used to recurse into the parse and return the result. Very useful for extracting auxiliary information from the parse, e.g. counting rule invocations to locate bottlenecks or unwanted backtracking in the parser.

  20. def shortTraced: Boolean

    Whether or not this parser should show up when Failure.trace is called

  21. def success[T](s: Mutable[_], value: T, index: Int, cut: Boolean): Mutable[T]

    Definition Classes
    ParserApi
  22. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  23. def toString(): String

    Definition Classes
    AnyRef → Any
  24. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from ParserApi[T]

Inherited from AnyRef

Inherited from Any

Ungrouped