Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] CKit for O'Caml?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2003-06-07 (13:40)
From: Jeff Henrikson <jehenrik@y...>
Subject: Re: [Caml-list] CKit for O'Caml?
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 

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
> (  I've searched, 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
> -------------------
> To unsubscribe, mail Archives: 
> Bug reports: FAQ: 
> Beginner's list:

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: