Module Plexer


module Plexer: sig .. end
This module contains the lexer used for ocaml syntax (revised and normal).

val gmake : unit -> (string * string) Plexing.lexer
gmake () returns a lexer compatible with the extensible grammars. The returned tokens follow the normal syntax and the revised syntax lexing rules.

The token type is "<tt>(string * string)</tt>" just like the pattern type.

The meaning of the tokens are:

The associated token patterns in the EXTEND statement hold the same names than the first string (constructor name) of the tokens expressions above.

Warning: the string associated with the STRING constructor is the string found in the source without any interpretation. In particular, the backslashes are not interpreted. For example, if the input is "\n" the string is *not* a string with one element containing the "newline" character, but a string of two elements: the backslash and the "n" letter.

Same thing for the string associated with the CHAR constructor.

The functions Plexing.eval_string and Plexing.eval_char allow to convert them into the real corresponding string or char value.

val dollar_for_antiquotation : bool Pervasives.ref
When True (default), the next call to Plexer.gmake () returns a lexer where the dollar sign is used for antiquotations. If False, the dollar sign can be used as token.
val specific_space_dot : bool Pervasives.ref
When False (default), the next call to Plexer.gmake () returns a lexer where there is no difference between dots which have spaces before and dots which don't have spaces before. If True, dots which have spaces before return the keyword " ." (space dot) and the ones which don't have spaces before return the keyword "." (dot alone).
val no_quotations : bool Pervasives.ref
When True, all lexers built by Plexer.gmake () do not lex the quotation syntax. Default is False (quotations are lexed).
val force_antiquot_loc : bool Pervasives.ref