From: Martin Potier <martin.potier@gmail.com>
To: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] Caml typed AST
Date: Mon, 28 Jun 2010 16:03:20 +0200 [thread overview]
Message-ID: <4C28ABA8.2050807@gmail.com> (raw)
In-Reply-To: <940CD13B-5569-4B4C-9616-7AE9132EC114@gmail.com>
Thank you for your answer.
I still have no clue how to use it, or even pretty-print from that AST.
Is there a simple way to do so ?
Is there a documentation on using basic caml elements, like building an
AST from a string of ocaml code, typing, type-checking, transforming and
prettyprinting from this AST ?
--
Martin
Le 09/06/2010 00:46, Ruslan Ledesma Garza a écrit :
> Hello Martin,
>
> Looking at toploop.ml in 3.11.1, a line reads:
>
> let (str, sg, newenv) = Typemod.type_structure oldenv sstr Location.none
>
> I believe str contains the AST you are looking for.
>
> Best regards,
> Ruslan.
>
> On Jun 8, 2010, at 11:29 PM, Martin Potier wrote:
>
>> Dear List,
>>
>> I have a school research assignment about defunctionalization.
>>
>> I'd like to implement a defunctionalization algorithm for Caml, using
>> Caml, that's why I'd like to know if there is a way to retrieve a typped
>> AST from Caml.
>>
>> I had a look at the option -dparsetree of the Caml interpreter, but it
>> doesn't fit my need for two reasons : first it's not typped, and second
>> it's not easily reusable.
>>
>> In a way, I just want to "plug in" right after the typing of the Caml
>> AST in order to reuse it.
>>
>> Does anyone know the Caml source well enough to point me to a place
>> where a function uses a typped AST ?
>>
>> --
>> Martin Potier
>>
>> _______________________________________________
>> Caml-list mailing list. Subscription management:
>> http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
>> Archives: http://caml.inria.fr
>> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
>> Bug reports: http://caml.inria.fr/bin/caml-bugs
>
next prev parent reply other threads:[~2010-06-28 14:03 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-08 21:29 Martin Potier
[not found] ` <940CD13B-5569-4B4C-9616-7AE9132EC114@gmail.com>
2010-06-28 14:03 ` Martin Potier [this message]
2010-06-28 14:25 ` [Caml-list] " bluestorm
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4C28ABA8.2050807@gmail.com \
--to=martin.potier@gmail.com \
--cc=caml-list@yquem.inria.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox