caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Jeff Henrikson <jehenrik@yahoo.com>
To: "Mary F. Fernandez" <mff@research.att.com>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] CKit for O'Caml?
Date: Sat, 7 Jun 2003 09:41:41 -0400	[thread overview]
Message-ID: <C58F9EE9-98ED-11D7-A6F2-00039375801A@yahoo.com> (raw)
In-Reply-To: <3EE1077A.4030802@research.att.com>

I use the frontc package, by Hugues Casse, which you can find in the 
Caml Development Kit. (cdk)  There is an AST, parser, and pretty 
printer.  My only two difficulties with it have been:

- it can't parse the ":" operator for denoting bit fields in structs.

- it took me a while to figure out how to access what I want out of the 
AST.  The three constructors TYPEDEF, ONLYTYPEDEF and DECDEF have a lot 
of crossover, and I never figured out exactly why, but that if I 
projected these out with a filter function

   let simplify_def def =
     match def with
       (Cabs.TYPEDEF(bt0,_,vars)) -> Some (bt0,vars)
     | (Cabs.ONLYTYPEDEF(bt0,_,vars)) -> Some (bt0,vars)
     | (Cabs.DECDEF(bt0,_,vars)) -> Some (bt0,vars)
     | _ -> None;;

that I got access to the structs, unions and enums more easily.  The 
messiest part of my code ended up being the "view" I wrapped around the 
AST.


Jeff Henrikson



On Friday, June 6, 2003, at 05:28 PM, Mary F. Fernandez wrote:

> Does anyone know if there are any O'Caml tools similar to the SML CKit
> (http://www.smlnj.org/doc/ckit/).  I've searched comp.lang.ml, this
> mailing list's archives and looked at "The Hump", but no luck.
> In particular, I'm most interested in the C AST and pretty printer.
>
> I hope it's OK to ask this question here!
> Thanks,
> Mary
> -- 
> Mary Fernandez, Principal Technical Staff Member
> AT&T Labs - Research, 180 Park Ave., Room E243, Florham Park, NJ 
> 07932-0971
> phone: 973-360-8679,  fax: 973-360-8187
> mff@research.att.com, http://www.research.att.com/~mff
>
>
> -------------------
> To unsubscribe, mail caml-list-request@inria.fr Archives: 
> http://caml.inria.fr
> Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: 
> http://caml.inria.fr/FAQ/
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
>

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


  parent reply	other threads:[~2003-06-07 13:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-06-06 21:28 Mary F. Fernandez
2003-06-06 21:39 ` Manos Renieris
2003-06-07 13:41 ` Jeff Henrikson [this message]
2003-06-07 15:09 ` Guillaume Marceau

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=C58F9EE9-98ED-11D7-A6F2-00039375801A@yahoo.com \
    --to=jehenrik@yahoo.com \
    --cc=caml-list@inria.fr \
    --cc=mff@research.att.com \
    /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;
as well as URLs for NNTP newsgroup(s).