From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.1.3 Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id BDA1EBC69 for ; Sun, 19 Aug 2007 23:38:34 +0200 (CEST) Received: from smtp3-g19.free.fr (smtp3-g19.free.fr [212.27.42.29]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l7JLcYtI005720 for ; Sun, 19 Aug 2007 23:38:34 +0200 Received: from smtp3-g19.free.fr (localhost.localdomain [127.0.0.1]) by smtp3-g19.free.fr (Postfix) with ESMTP id 55CAF5A0AF for ; Sun, 19 Aug 2007 23:38:34 +0200 (CEST) Received: from [10.0.2.15] (rke75-3-82-229-183-156.fbx.proxad.net [82.229.183.156]) by smtp3-g19.free.fr (Postfix) with ESMTP id 21D485A09D for ; Sun, 19 Aug 2007 23:38:34 +0200 (CEST) Message-ID: <46C8B80E.1020901@frisch.fr> Date: Sun, 19 Aug 2007 23:37:18 +0200 From: Alain Frisch User-Agent: Thunderbird 2.0.0.6 (X11/20070728) MIME-Version: 1.0 To: caml-list@inria.fr Subject: Re: [Caml-list] How can I generate an AST? References: <6f9f8f4a0708191039o2119f94bm10959175cc887eef@mail.gmail.com> In-Reply-To: <6f9f8f4a0708191039o2119f94bm10959175cc887eef@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Miltered: at discorde with ID 46C8B85A.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; frisch:01 frisch:01 pointer:01 pparse:01 compiler:01 marshaled:01 impl:01 intf:01 marshaled:01 parsetree:01 parsetree:01 config:01 config:01 resp:01 resp:01 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). -- Alain