---
name: "Pparse"
section: "3o"
platform: "linux"
package: "ocaml"
version: "5.5.0-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/Pparse"
---

# Pparse(3o)

Driver for the parser and external preprocessors.

## NAME

Pparse - Driver for the parser and external preprocessors.

## Module

Module   Pparse

## Documentation

Module **Pparse**\
  :  **sig end**

Driver for the parser and external preprocessors.

Warning: this module is unstable and part of **Compiler\_libs** .

*type error* =\
  \| CannotRun **of** **string**\
  \| WrongMagic **of** **string**

*exception Error* **of** **error**

*val preprocess* :  **string -\> string**

*val remove\_preprocessed* :  **string -\> unit**

*type* **'a** *ast\_kind* =\
  \| Structure **:** **Parsetree.structure ast\_kind**\
  \| Signature **:** **Parsetree.signature ast\_kind**

*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**

If  **restore = true** (the default), cookies set by external rewriters will be kept for later calls.

*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* :  **error Format\_doc.format\_printer**

*val report\_error\_doc* :  **error Format\_doc.printer**

*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**
