Legend:
Library
Module
Module type
Parameter
Class
Class type
Predefined token parsers.
This module provides parsers for tokens that are commonly used in parsing computer languages. All parsers in this module skip the spaces (as defined by the MParser.spaces parser) that occur after a token. Where they are applied to a user-defined parser p, however, they do not skip the spaces occurring after the characters parsed by p. For example, parens p is equivalent to char '(' >> spaces >> p << char ')' << spaces.
Parses a hexadecimal natural number as defined in the OCaml language (prefixed with "0x" or "0X") and returns it as an integer value. Fails with a Message_error if the parsed number is larger than max_int.
Parses an octal natural number as defined in the OCaml language (prefixed with "0o" or "0O") and returns it as an integer value. Fails with a Message_error if the parsed number is larger than max_int.
Parses a binary natural number as defined in the OCaml language (prefixed with "0b" or "0B") and returns it as an integer value. Fails with a Message_error if the parsed number is larger than max_int.
Parses floating-point literal as defined in the OCaml language and returns its value. Fails with a Message_error if the parsed number is not a valid representation of a float value.