Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Page
Library
Module
Module type
Parameter
Class
Class type
Source
MakeRegexp.TokensSourcePredefined 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.
brackets p parses p between angle brackets '<' and '>'.
semi_sep p parses zero or more occurrences of p, separated by ';'. It returns a list of the results returned by p.
semi_sep1 p parses one or more occurrences of p, separated by ';'. It returns a list of the results returned by p.
semi_sep_end p parses zero or more occurrences of p, separated and optionally ended by ';'. It returns a list of the results returned by p.
semi_sep_end1 p parses one or more occurrences of p, separated and optionally ended by ';'. It returns a list of the results returned by p.
semi_end p parses zero or more occurrences of p, separated and ended by ';'. It returns a list of the results returned by p.
semi_sep_end1 p parses one or more occurrences of p, separated and ended by ';'. It returns a list of the results returned by p.
comma_sep p parses zero or more occurrences of p, separated by ','. It returns a list of the results returned by p.
comma_sep1 p parses one or more occurrences of p, separated by ','. It returns a list of the results returned by p.
Parses a character literal as defined in the OCaml language and returns the character. The literal may contain an escape sequence.
Parses a string literal as defined in the OCaml language and returns the string. The literal may contain escape sequences.
Parses a decimal natural number and returns it as an integer value. Fails with a Message_error if the parsed number is larger than max_int.
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 a decimal integer number and returns its value. Fails with a Message_error if the parsed number is smaller than min_int or larger than max_int.