parsley-core-2.0.0.0: A fast parser combinator library backed by Typed Template Haskell
LicenseBSD-3-Clause
MaintainerJamie Willis
Stabilityunstable
Safe HaskellNone
LanguageHaskell2010

Parsley.Internal.Backend.Machine

Description

Since: 0.1.0.0

Synopsis

Documentation

class (InputPrep input, Ops input) => Input input Source #

This class is exposed to parsley itself and is used to denote which types may be used as input for a parser.

Since: 0.1.0.0

Instances

Instances details
Input ByteString Source # 
Instance details

Defined in Parsley.Internal.Backend.Machine

Input ByteString Source # 
Instance details

Defined in Parsley.Internal.Backend.Machine

Input Text Source # 
Instance details

Defined in Parsley.Internal.Backend.Machine

Input Stream Source # 
Instance details

Defined in Parsley.Internal.Backend.Machine

Input CharList Source # 
Instance details

Defined in Parsley.Internal.Backend.Machine

Input Text16 Source # 
Instance details

Defined in Parsley.Internal.Backend.Machine

Input [Char] Source # 
Instance details

Defined in Parsley.Internal.Backend.Machine

Input (UArray Int Char) Source # 
Instance details

Defined in Parsley.Internal.Backend.Machine

eval :: forall input a. (Input input, Trace) => Code input -> (LetBinding input a a, DMap MVar (LetBinding input a)) -> Code (Maybe a) Source #

This function is exposed to parsley itself and is used to generate the Haskell code for a parser.

Since: 0.1.0.0

data Coins Source #

Packages together the known input that can be consumed after a length-check with the number of characters that can be rewound on a lookahead backtrack.

Since: 1.5.0.0

Constructors

Coins 

Fields

  • willConsume :: Int

    The number of tokens we know must be consumed along the path to succeed.

  • canReclaim :: Int

    The number of tokens we can reclaim if the parser backtracks.

Instances

Instances details
Show Coins Source # 
Instance details

Defined in Parsley.Internal.Backend.Machine.Types.Coins

Methods

showsPrec :: Int -> Coins -> ShowS #

show :: Coins -> String #

showList :: [Coins] -> ShowS #

zero :: Coins Source #

Makes a Coins value of 0.

Since: 1.5.0.0

minCoins :: Coins -> Coins -> Coins Source #

Takes the pairwise min of two Coins values.

Since: 1.5.0.0

maxCoins :: Coins -> Coins -> Coins Source #

Takes the pairwise max of two Coins values.

Since: 1.5.0.0

plus1 :: Coins -> Coins Source #

Adds 1 to all the Coins values.

Since: 1.5.0.0

plus :: Coins -> Coins -> Coins Source #

Performs the pairwise addition of two Coins values.

Since: 1.5.0.0

minus :: Coins -> Coins -> Coins Source #

Performs the pairwise subtraction of two Coins values.

Since: 1.5.0.0

plusNotReclaim :: Coins -> Int -> Coins Source #

A verson of plus where the reclaim value remains constant.

Since: 1.5.0.0

user :: Defunc a -> Defunc a Source #

Promotes a Defunc value from the Frontend API into a Backend one.

Since: 1.1.0.0

data LetBinding o a x Source #

Packages a binding along with its free registers that are required for it, which are left existential. This is possible since the Regs datatype serves as a singleton-style witness of the original registers and their types. It also requires Metadata to be provided, sourced from analysis.

Since: 1.5.0.0

makeLetBinding :: Binding o a x -> Set SomeΣVar -> Metadata -> LetBinding o a x Source #

Given a Binding , a set of existential ΣVars, and some Metadata, produces a LetBinding instance.

Since: 1.5.0.0

newMeta :: Metadata Source #

Produces a new Metadata object, with fields initialised to sensible conservative defaults.

Since: 1.5.0.0