From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by sympa.inria.fr (Postfix) with ESMTPS id 4E26A7ED7A for ; Mon, 27 Aug 2012 11:04:27 +0200 (CEST) Received-SPF: None (mail4-smtp-sop.national.inria.fr: no sender authenticity information available from domain of alain@frisch.fr) identity=pra; client-ip=193.252.23.214; receiver=mail4-smtp-sop.national.inria.fr; envelope-from="alain@frisch.fr"; x-sender="alain@frisch.fr"; x-conformance=sidf_compatible Received-SPF: None (mail4-smtp-sop.national.inria.fr: no sender authenticity information available from domain of alain@frisch.fr) identity=mailfrom; client-ip=193.252.23.214; receiver=mail4-smtp-sop.national.inria.fr; envelope-from="alain@frisch.fr"; x-sender="alain@frisch.fr"; x-conformance=sidf_compatible Received-SPF: None (mail4-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@msa.smtpout.orange.fr) identity=helo; client-ip=193.252.23.214; receiver=mail4-smtp-sop.national.inria.fr; envelope-from="alain@frisch.fr"; x-sender="postmaster@msa.smtpout.orange.fr"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AsIBAPU2O1DB/BfWlGdsb2JhbABFuxYBAQEBCQsJCRQDJIIgAQEEAThAAQULCw4KCRYPCQMCAQIBRQYNAQcBAYgDCroIiwiHEQOVVYEUhEiNHg X-IronPort-AV: E=Sophos;i="4.80,318,1344204000"; d="scan'208";a="153901939" Received: from msa05.smtpout.orange.fr (HELO msa.smtpout.orange.fr) ([193.252.23.214]) by mail4-smtp-sop.national.inria.fr with ESMTP; 27 Aug 2012 11:04:26 +0200 Received: from [192.168.1.123] ([86.195.130.225]) by mwinf5d18 with ME id rl4R1j0034rvwU603l4R96; Mon, 27 Aug 2012 11:04:26 +0200 Message-ID: <503B3818.1050503@frisch.fr> Date: Mon, 27 Aug 2012 11:04:24 +0200 From: Alain Frisch User-Agent: Mozilla/5.0 (X11; Linux i686 on x86_64; rv:14.0) Gecko/20120713 Thunderbird/14.0 MIME-Version: 1.0 To: Hongbo Zhang CC: Caml List References: <503A9815.7000103@gmail.com> In-Reply-To: <503A9815.7000103@gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Caml-list] Is there a printer for ocaml's parsetree On 08/26/2012 11:41 PM, Hongbo Zhang wrote: > Hi List, > Is there any printer for ocaml's parsetree, I mean when you print > the parsetree, the textual output can be fed to the ocaml's compiler again. > I took a look at the ocaml's source tree, the built-in printer for > ocaml's parsetree seems to be only for debugging purpose. There is a printer in tools/pprintast.ml. It would be useful to integrate it to the ocaml compilers, with an option to tell them to dump the (preprocessed) parsetree in source form. > Alain, when you do Ast-Rewriter, how do you visualize the output if you > don't have a printer for ocaml's parsetree? Currently, I use -dparsetree when I need to debug some ast rewriter (-ppx). -- Alain