Module Fmlib_parse.Token_parser

Token Parser: A parser which parses streams of user supplied tokens.

It supports layout parsing and friendly error messages.

The token parser is a functor which needs a module Token to describe the type of tokens. The generated parser receives tokens of type Position.range * Token.t. I.e. the lexer has to parse the tokens which are usually a token type (identifier, number, keyword, ...) and a string representing the actual token. Furthermore the lexer has to provide position information of the location of the token in the source file.

The combinators in a token parser work with tokens of type Token.t.

The generated parser works with tokens of type Position.range * Token.t.