On this page:
Megaparsack:   Practical Parser Combinators

Megaparsack: Practical Parser Combinators

Alexis King <[email protected]>

 (require megaparsack) package: megaparsack-lib

Megaparsack is a parser combinator library: a composable set of simple parsers that can be used to create larger parsing systems that can parse arbitrary grammars, including context-sensitive ones. Megaparsack uses the gen:monad generic interface to provide a uniform interface to sequence and compose different parsers using a base set of primitives.

    1 Parsing Basics

      1.1 Getting started with parsers

      1.2 Parsing textual data

      1.3 Sequencing parsers

    2 Parsers with Choice

      2.1 Providing multiple paths

        2.1.1 Parsing ambiguous grammars

        2.1.2 Backtracking with caution

      2.2 Parsing sequences

    3 Producing Syntax

      3.1 Annotating parsers to produce syntax

      3.2 Parsing tokens from parser-tools/lex

    4 API Reference

      4.1 Primitives

      4.2 Parsing Text

      4.3 Parsing with parser-tools/lex

      4.4 Deprecated Forms and Functions

    5 Appendix: Parsack vs Megaparsack