On this page:
Megaparsack:   Practical Parser Combinators

Megaparsack: Practical Parser Combinators

Alexis King <lexi.lambda@gmail.com>

 (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 Parsers with State

      4.1 Parsing with context

      4.2 Indentation sensitivity

    5 API Reference

      5.1 Primitives

        5.1.1 Parser Parameters

      5.2 Parsing Text

      5.3 Parsing with parser-tools/lex

      5.4 Deprecated Forms and Functions

    6 Appendix: Parsack vs Megaparsack