/usr/lib/ocaml/camlp5/plexer.mli is in camlp5 7.01-1build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 | (* camlp5r *)
(* plexer.mli,v *)
(* Copyright (c) INRIA 2007-2017 *)
(** This module contains the lexer used for ocaml syntax (revised and
normal). *)
value gmake : unit -> Plexing.lexer (string * string);
(** [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:
- * [("", s)] is the keyword [s].
- * [("", s)] is the keyword [s],
- * [("LIDENT", s)] is the ident [s] starting with a lowercase letter,
- * [("UIDENT", s)] is the ident [s] starting with an uppercase letter,
- * [("INT", s)] is an integer constant whose string source is [s],
- * [("INT_l", s)] is an 32 bits integer constant,
- * [("INT_L", s)] is an 64 bits integer constant,
- * [("INT_n", s)] is an native integer constant,
- * [("FLOAT", s)] is a float constant whose string source is [s],
- * [("STRING", s)] is the string constant [s],
- * [("CHAR", s)] is the character constant [s],
- * [("TILDEIDENT", s)] is the tilde character [~] followed by the
ident [s],
- * [("TILDEIDENTCOLON", s)] is the tilde character [~] followed by the
ident [s] and a colon [:],
- * [("QUESTIONIDENT", s)] is the question mark [?] followed by the
ident [s],
- * [("QUESTIONIDENTCOLON", s)] is the question mark [?] followed by the
ident [s] and a colon [:],
- * [("QUOTATION", "t:s")] is a quotation [t] holding the string [s],
- * [("ANTIQUOT", "t:s")] is an antiquotation [t] holding the string [s],
- * [("EOI", "")] is the end of input.
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. *)
value dollar_for_antiquotation : ref bool;
(** 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. *)
value specific_space_dot : ref bool;
(** 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). *)
value dot_newline_is : ref string;
(** experimental
Specific interpretation for a dot "." followed by a newline;
by default, it is just a dot. Setting another value makes
the lexer interpret it as this value. For example, in
revised syntax (pa_r.ml) setting it to ";" allows to end
phrases with a dot, instead of a semicolon. In normal syntax,
the same can be done by setting it with ";;". *)
value no_quotations : ref bool;
(** When True, all lexers built by [Plexer.gmake ()] do not lex the
quotation syntax. Default is False (quotations are lexed). *)
value utf8_lexing : ref bool;
(** When True, all lexers built by [Plexer.gmake ()] use utf-8 encoding
to specify letters and punctuation marks. Default is False (all
characters between '\128' and '\255' are considered as letters) *)
(*** For system use *)
value force_antiquot_loc : ref bool;
|