English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
How can I generate an AST?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2007-08-20 (08:29)
From: Loup Vaillant <loup.vaillant@g...>
Subject: Re: [Caml-list] How can I generate an AST?
2007/8/19, Alain Frisch <alain@frisch.fr>:
> Loup Vaillant wrote:
> > Can anybody give me a pointer about how to do this?
> The function Pparse.file is the one that makes the compiler accepts
> either source code or marshaled ASTs. By looking at its implementation
> and its call sites, you'll discover that the binary format is the
> concatenation of a magic string Config.ast_impl_magic_number (resp.
> Config.ast_intf_magic_number) and the marshaled version of a
> Parsetree.structure (resp. a Parsetree.signature).

Great. Thank you. I'll go and try some toy example.