module Pparse:sig
..end
解析器和外部前處理器的驅動程式。
警告:此模組不穩定,屬於 compiler-libs 的一部分。
type
error =
| |
CannotRun of |
| |
WrongMagic of |
exception Error of error
val preprocess : string -> string
val remove_preprocessed : string -> unit
type 'a
ast_kind =
| |
Structure : |
| |
Signature : |
val read_ast : 'a ast_kind -> string -> 'a
val write_ast : 'a ast_kind -> string -> 'a -> unit
val file : tool_name:string ->
string -> (Lexing.lexbuf -> 'a) -> 'a ast_kind -> 'a
val apply_rewriters : ?restore:bool -> tool_name:string -> 'a ast_kind -> 'a -> 'a
如果 restore = true
(預設值),外部重寫器設定的 cookies 將會保留,以供後續呼叫使用。
val apply_rewriters_str : ?restore:bool ->
tool_name:string -> Parsetree.structure -> Parsetree.structure
val apply_rewriters_sig : ?restore:bool ->
tool_name:string -> Parsetree.signature -> Parsetree.signature
val report_error : Format.formatter -> error -> unit
val parse_implementation : tool_name:string -> string -> Parsetree.structure
val parse_interface : tool_name:string -> string -> Parsetree.signature
val call_external_preprocessor : string -> string -> string
val open_and_check_magic : string -> string -> in_channel * bool