Legend:
Library
Module
Module type
Parameter
Class
Class type
Functional LL(x) parsing with monadic combinators.
Overview
This module implements functional left-shift/left-reduce parser combinators using a state-exception monad over a sequence of input symbols. The input symbol sequence is the state, and the recognized production is either a returned value Some v, or None if the input stream is not recognized. Composing a grammar production from a sequence of other productions is done by using the bind operator. Backtracking assumes the input stream is confluently persistent.
The input is conceptually sequence of symbol value, attributed in the iota type with stream position. Accordingly, productions are returned wrapped in a 'a form type that conceptually represents the value and the span of positions where it was recognized in the input. However, a simplified module signature is provided where type iota = symbol and type 'a form = 'a.
Syntax errors can be raised with arbitrary OCaml exceptions. Exceptions can be caught, and various functions are available for error recovery.
Define a module of this type in a scanner basis. It defines the functions required by the basic scanner to relate produced values and their corresponding 'a form.
This module provides simple scanners for analyzing texts encoded in 8bit-extended ASCII text encodings, e.g. ISO 8859 Latin, without any concept of stream position.