p

org.http4s

parsley

package parsley

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

Type Members

  1. trait Breakpoint extends AnyRef
  2. final class ExpressionParser[-A, +B] extends AnyRef

    This class is used to generate efficient expression parsers given a table of operators in operator of operator precedence and an atomic value that represents the smallest part of the expression.

    This class is used to generate efficient expression parsers given a table of operators in operator of operator precedence and an atomic value that represents the smallest part of the expression. Caters to unary and binary operators of different associativities.

  3. case class Failure extends Result[Nothing] with Product with Serializable

    Returned on parsing failure

  4. sealed trait Impl extends AnyRef

    The Impl trait is used to provide implementation of the parser requirements from LanguageDef

  5. final case class LanguageDef(commentStart: String, commentEnd: String, commentLine: String, nestedComments: Boolean, identStart: Impl, identLetter: Impl, opStart: Impl, opLetter: Impl, keywords: Set[String], operators: Set[String], caseSensitive: Boolean, space: Impl) extends Product with Serializable

    This class is required to construct a TokenParser.

    This class is required to construct a TokenParser. It defines the various characteristics of the language to be tokenised. Where a parameter can be either a Set[Char] or a Parsley object, prefer the Set where possible. It will unlock a variety of faster intrinsic versions of the parsers, which will greatly improve tokenisation performance! In addition, the Sets are one time converted to heavily optimised BitSets, though that has up to 8KB memory usage associated but at least doubles the execution speed for that instruction. See parsley.Impl.

    commentStart

    For multi-line comments; how does the comment start? (If this or commentEnd is the empty string, multi-line comments are disabled)

    commentEnd

    For multi-line comments; how does the comment end? (If this or commentEnd is the empty string, multi-line comments are disabled)

    commentLine

    For single-line comments; how does the comment start? (This this is the empty string, single-line comments are disabled)

    nestedComments

    Are multi-line comments allowed to be nested inside each other? E.g. If {- and -} are opening and closing comments, is the following valid syntax: {-{-hello -}-}? Note in C this is not the case.

    identStart

    What characters can an identifier in the language start with?

    identLetter

    What characters can an identifier in the language consist of after the starting character?

    opStart

    What characters can an operator in the language start with?

    opLetter

    What characters can an operator in the language consist of after the starting character?

    keywords

    What keywords does the language contain?

    operators

    What operators does the language contain?

    caseSensitive

    Is the language case-sensitive. I.e. is IF equivalent to if?

    space

    What characters count as whitespace in the language?

  6. final case class Parser(p: Parsley[_]) extends Impl with Product with Serializable

    The implementation provided is a parser which parses the required token.

    The implementation provided is a parser which parses the required token.

    p

    The parser which will parse the token

  7. abstract class Parsley[+A] extends AnyRef

    This is the class that encapsulates the act of parsing and running an object of this class with runParser will parse the string given as input to runParser.

    This is the class that encapsulates the act of parsing and running an object of this class with runParser will parse the string given as input to runParser.

    Note: In order to construct an object of this class you must use the combinators; the class itself is abstract

    Version

    1

  8. final case class Predicate(f: (Char) ⇒ Boolean) extends Impl with Product with Serializable

    The implementation provided is a function which matches on the input streams characters

    The implementation provided is a function which matches on the input streams characters

    f

    The predicate that input tokens are tested against

  9. sealed abstract class Result[+A] extends AnyRef

    Result of a parser.

    Result of a parser. Either a Success[A] or a Failure

    A

    The type of expected success result

  10. case class Success[A] extends Result[A] with Product with Serializable

    Returned when a parser succeeded.

    Returned when a parser succeeded.

    A

    The type of expected success result

  11. final class TokenParser extends AnyRef

    When provided with a LanguageDef, this class will produce a large variety of parsers that can be used for tokenisation of a language.

    When provided with a LanguageDef, this class will produce a large variety of parsers that can be used for tokenisation of a language. This includes parsing numbers and strings in their various formats and ensuring that all operations consume whitespace after them (so-called lexeme parsers). These are very useful in parsing programming languages. This class also has a large number of hand-optimised intrinsic parsers to improve performance!

  12. final case class Var(v: Int) extends AnyVal with Product with Serializable

    This class is used to index registers within the mutable state.

    This class is used to index registers within the mutable state. Currently, there are only 4 available registers, so use them wisely!

    v

    The index of the register to interact with

Value Members

  1. def giveContext: Context

    This function returns a fresh Context.

    This function returns a fresh Context. Contexts are used by the parsers to store their state. You should only need to use this if you are using runParserFastUnsafe and you need separate execution contexts due to multi-threaded parsing.

    returns

    A fresh execution context for parsers

  2. implicit def neq[A, B]: =!=[A, B]
  3. implicit def neqAmbig1[A]: =!=[A, A]
    Annotations
    @implicitAmbiguous( ... )
  4. implicit def neqAmbig2[A]: =!=[A, A]
  5. def runParser[A](p: Parsley[A], input: Array[Char], ctx: Context): Result[A]

    This method is responsible for actually executing parsers.

    This method is responsible for actually executing parsers. Given a Parsley[A] and an input array, will parse the string with the parser. The result is either a Success or a Failure.

    A

    The type of the result of parsing

    p

    The parser to run

    input

    The input to run against

    ctx

    The provided context from the user

    returns

    Either a success with a value of type A or a failure with error message

  6. def runParser[A](p: Parsley[A], input: String, ctx: Context): Result[A]

    This method is responsible for actually executing parsers.

    This method is responsible for actually executing parsers. Given a Parsley[A] and an input string, will parse the string with the parser. The result is either a Success or a Failure.

    A

    The type of the result of parsing

    p

    The parser to run

    input

    The input to run against

    ctx

    The provided context from the user

    returns

    Either a success with a value of type A or a failure with error message

  7. def runParser[A](p: Parsley[A], input: Array[Char]): Result[A]

    This method is responsible for actually executing parsers.

    This method is responsible for actually executing parsers. Given a Parsley[A] and an input array, will parse the string with the parser. The result is either a Success or a Failure.

    A

    The type of the result of parsing

    p

    The parser to run

    input

    The input to run against

    returns

    Either a success with a value of type A or a failure with error message

  8. def runParser[A](p: Parsley[A], input: String): Result[A]

    This method is responsible for actually executing parsers.

    This method is responsible for actually executing parsers. Given a Parsley[A] and an input string, will parse the string with the parser. The result is either a Success or a Failure.

    A

    The type of the result of parsing

    p

    The parser to run

    input

    The input to run against

    returns

    Either a success with a value of type A or a failure with error message

  9. def runParserFastUnsafe[A](p: Parsley[A], input: String)(implicit ctx: Context = internalCtx): Result[A]

    This method allows you to run a parser with a cached context, which improves performance.

    This method allows you to run a parser with a cached context, which improves performance. If no implicit context can be found, the parsley default context is used. This will cause issues with multi-threaded execution of parsers. In order to mitigate these issues, each thread should request its own context with parsley.giveContext. This value may be implicit for convenience.

  10. def runParserThreadSafe[A](p: Parsley[A], input: String, ctx: Context = giveContext): Result[A]

    This method allows you to run parsers in parallel in a thread-safe fashion.

    This method allows you to run parsers in parallel in a thread-safe fashion. This is safer than runParser in the case where the parser maintains internal states, but is otherwise likely slower for serial executions of the same parser.

  11. object BitGen

    This implementation uses a predicate to generate a BitSet.

    This implementation uses a predicate to generate a BitSet. This should be preferred over Predicate when the function in question is expensive to execute and the parser itself is expected to be used many times. If the predicate is cheap, this is unlikely to provide any performance improvements, but will instead incur heavy space costs

  12. object Char
  13. object CharSet

    This implementation uses a set of valid tokens.

    This implementation uses a set of valid tokens. It is converted to a high-performance BitSet.

  14. object Combinator
  15. object EntryBreak extends Breakpoint with Product with Serializable
  16. object ExitBreak extends Breakpoint with Product with Serializable
  17. object ExpressionParser
  18. object FullBreak extends Breakpoint with Product with Serializable
  19. object Implicits

    Provides implicit conversions and lifts for different values and parsers.

  20. object LanguageDef extends Serializable
  21. object NoBreak extends Breakpoint with Product with Serializable
  22. object NotRequired extends Impl with Product with Serializable

    This implementation states that the required functionality is not required.

    This implementation states that the required functionality is not required. If it is used it will raise an error at parse-time

  23. object Parsley

Inherited from AnyRef

Inherited from Any

Ungrouped