adp-multi-0.2.1: ADP for multiple context-free languages

Safe HaskellSafe-Inferred

ADP.Multi.Parser

Description

Some common types for parsers.

Synopsis

Documentation

type Subword = [Int]Source

To support higher dimensions, a subword is a list of indices. Valid list lengths are 2n with n>0.

type Parser a bSource

Arguments

 = Array Int a

The input sequence

-> Subword

Subword of the input sequence to be parsed

-> [b]

Parsing results

data ParserInfo Source

Static information about yield sizes of a parser. For supporting dimensions > 2, this type has to be expanded with more constructors, or redesigned to be generic.

Constructors

ParserInfo1 

Fields

minYield :: Int
 
maxYield :: Maybe Int
 
ParserInfo2 

Fields

minYield2 :: (Int, Int)
 
maxYield2 :: (Maybe Int, Maybe Int)
 

class Parseable p a b | p -> a b whereSource

Methods

toParser :: p -> RichParser a bSource

Instances

Parseable Char Char Char 
Parseable EPS a EPS 
Eq a => Parseable [a] a [a] 
Parseable (RichParser a b) a b 
Parseable (Char, Char) Char (Char, Char) 
Parseable (Char, EPS) Char (Char, EPS) 
Eq a => Parseable ([a], [a]) a ([a], [a]) 
Parseable (EPS, Char) Char (EPS, Char) 
Parseable (EPS, EPS) a (EPS, EPS)