1Pparse(3) OCaml library Pparse(3)
2
3
4
6 Pparse - Driver for the parser, external preprocessors and ast plugin
7 hooks
8
10 Module Pparse
11
13 Module Pparse
14 : sig end
15
16
17 Driver for the parser, external preprocessors and ast plugin hooks
18
19
20
21
22
23 type error =
24 | CannotRun of string
25 | WrongMagic of string
26
27
28
29
30
31 exception Error of error
32
33
34
35
36
37 val preprocess : string -> string
38
39
40
41
42 val remove_preprocessed : string -> unit
43
44
45
46 type 'a ast_kind =
47 | Structure : Parsetree.structure ast_kind
48 | Signature : Parsetree.signature ast_kind
49
50
51
52
53
54 val read_ast : 'a ast_kind -> string -> 'a
55
56
57
58
59 val write_ast : 'a ast_kind -> string -> 'a -> unit
60
61
62
63
64 val file : Format.formatter -> tool_name:string -> string -> (Lex‐
65 ing.lexbuf -> 'a) -> 'a ast_kind -> 'a
66
67
68
69
70 val apply_rewriters : ?restore:bool -> tool_name:string -> 'a ast_kind
71 -> 'a -> 'a
72
73 If restore = true (the default), cookies set by external rewriters will
74 be kept for later calls.
75
76
77
78 val apply_rewriters_str : ?restore:bool -> tool_name:string -> Parse‐
79 tree.structure -> Parsetree.structure
80
81
82
83
84 val apply_rewriters_sig : ?restore:bool -> tool_name:string -> Parse‐
85 tree.signature -> Parsetree.signature
86
87
88
89
90 val report_error : Format.formatter -> error -> unit
91
92
93
94
95 val parse_implementation : Format.formatter -> tool_name:string ->
96 string -> Parsetree.structure
97
98
99
100
101 val parse_interface : Format.formatter -> tool_name:string -> string ->
102 Parsetree.signature
103
104
105
106
107 val call_external_preprocessor : string -> string -> string
108
109
110
111
112 val open_and_check_magic : string -> string -> Pervasives.in_channel *
113 bool
114
115
116
117 module ImplementationHooks : sig end
118
119
120
121
122 module InterfaceHooks : sig end
123
124
125
126
127
128
129
130OCamldoc 2018-07-14 Pparse(3)