1Lexer(3) OCaml library Lexer(3)
2
3
4
6 Lexer - The lexical analyzer
7
9 Module Lexer
10
12 Module Lexer
13 : sig end
14
15
16 The lexical analyzer
17
18 Warning: this module is unstable and part of Compiler_libs .
19
20
21
22
23
24
25 val init : unit -> unit
26
27
28
29
30 val token : Lexing.lexbuf -> Parser.token
31
32
33
34
35 val skip_hash_bang : Lexing.lexbuf -> unit
36
37
38
39 type error =
40 | Illegal_character of char
41 | Illegal_escape of string * string option
42 | Reserved_sequence of string * string option
43 | Unterminated_comment of Location.t
44 | Unterminated_string
45 | Unterminated_string_in_comment of Location.t * Location.t
46 | Empty_character_literal
47 | Keyword_as_label of string
48 | Invalid_literal of string
49 | Invalid_directive of string * string option
50
51
52
53
54
55 exception Error of error * Location.t
56
57
58
59
60
61 val in_comment : unit -> bool
62
63
64
65
66 val in_string : unit -> bool
67
68
69
70
71 val print_warnings : bool ref
72
73
74
75
76 val handle_docstrings : bool ref
77
78
79
80
81 val comments : unit -> (string * Location.t) list
82
83
84
85
86 val token_with_comments : Lexing.lexbuf -> Parser.token
87
88
89
90
91 val set_preprocessor : (unit -> unit) -> ((Lexing.lexbuf -> Parser.to‐
92 ken) -> Lexing.lexbuf -> Parser.token) -> unit
93
94
95
96
97
98
99OCamldoc 2023-01-23 Lexer(3)