From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id 9470ABB9C for ; Sun, 20 Nov 2005 09:45:08 +0100 (CET) Received: from x86unx3.comp.nus.edu.sg (x86unx3.comp.nus.edu.sg [137.132.80.24]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id jAK8j5aW032220 for ; Sun, 20 Nov 2005 09:45:07 +0100 Received: from e500c.comp.nus.edu.sg (e500c.comp.nus.edu.sg [137.132.90.68]) by x86unx3.comp.nus.edu.sg (8.9.1-20030924/8.9.1) with SMTP id QAA01709; Sun, 20 Nov 2005 16:44:58 +0800 (GMT-8) Received: from sn40.comp.nus.edu.sg(137.132.80.15) by e500c.comp.nus.edu.sg via csmap id 0615cd3a_59a2_11da_9a5e_003048298555_4282; Sun, 20 Nov 2005 16:45:38 +0800 (SGT) Received: from zhuping (soccf-pls-037.ddns.comp.nus.edu.sg [172.18.179.29]) (authenticated bits=0) by sn40.comp.nus.edu.sg (8.13.1/8.13.1) with ESMTP id jAK8iuAP022316 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NOT); Sun, 20 Nov 2005 16:44:57 +0800 (SGT) Message-ID: <002c01c5edae$afd08d20$1db312ac@comp.nus.edu.sg> From: "Zhu Ping" To: "Anil Madhavapeddy" Cc: Subject: Re: [Caml-list] Using Frontc Date: Sun, 20 Nov 2005 16:44:51 +0800 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0029_01C5EDF1.BA545F40" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.2527 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2527 X-Miltered: at nez-perce with ID 43803791.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 parsing:01 ocaml:01 ocamlc:01 ocamlc:01 cmo:01 cmo:01 utime:01 anil:01 anil:01 caml-list:01 cdk:01 parser:01 ocaml:01 parsing:01 X-Attachments: cset="gb2312" cset="gb2312" X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.1 required=5.0 tests=HTML_40_50,HTML_MESSAGE autolearn=disabled version=3.0.3 This is a multi-part message in MIME format. ------=_NextPart_000_0029_01C5EDF1.BA545F40 Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: quoted-printable Dear Madhavapeddy: I used FrontC because I hope the parsing result w.r.t a C source code is = represented in OCaml code. I installed CIT and linked my main program with the library released in = CIL. My main program (main.ml) now is: open Frontc (* -------------------------------------- Test case for sample1.wh = --------------------------------------*) let parse_result =3D Frontc.parse "/home/sand/zhuping/sample1.c";=20 The main program is successfully compiled without linking by executing: = ocamlc -c -I /home/sand/cil/obj/x86_LINUX main.ml But an error occurs when I linked the related object codes together: =20 ocamlc -o main -I /home/sand/cil/obj/x86_LINUX/ pretty.cmo trace.cmo = errormsg.cmo cabs.cmo cabsvisit.cmo escape.cmo cprint.cmo patch.cmo = frontc.cmo main.cmo "Error while linking /home/sand/cil/obj/x86_LINUX/patch.cmo: Reference = to undefined global 'Unix' " I looked into the patch.ml code and found this piece of code where = 'Unix' is referenced: let gettime () : float =3D (Unix.times ()).Unix.tms_utime Can anybody help me to solve this problem?=20 Thank you very much for your help:) ----- Original Message -----=20 From: "Anil Madhavapeddy" To: "Zhu Ping" Cc: Sent: Friday, November 18, 2005 5:52 PM Subject: Re: [Caml-list] Using Frontc > On Fri, Nov 18, 2005 at 05:22:37PM +0800, Zhu Ping wrote: >>=20 >> I'm using Frontc, which is one of the libraries released in >> CDK, to parse C source code. > (snip) >>=20 >> There are no source implementation/interface files with respect to >> the corresponding files listed above. >>=20 >> Can anybody help to to solve this problem? Thank you very much for >> your help:) >=20 > You haven't said if you must get FrontC to work, or can use any C > parser. If you dont mind using another package, CIL from Berkeley > is written in OCaml and is actively developed (and very very good). >=20 > You can find more details at http://manju.cs.berkeley.edu/cil/ >=20 > --=20 > Anil Madhavapeddy = http://anil.recoil.org > University of Cambridge = http://www.cl.cam.ac.uk > ------=_NextPart_000_0029_01C5EDF1.BA545F40 Content-Type: text/html; charset="gb2312" Content-Transfer-Encoding: quoted-printable
Dear Madhavapeddy:
 
I used FrontC because I hope the parsing result w.r.t a C source = code is=20 represented in OCaml code.
 
I installed CIT and linked my main program with the library = released in=20 CIL.
 
My main program (main.ml) now is:
 
  open Frontc
  (* = -------------------------------------- Test=20 case for sample1.wh --------------------------------------*)
  = let=20 parse_result =3D Frontc.parse "/home/sand/zhuping/sample1.c";
 
The main program is successfully compiled without linking by = executing:=20 ocamlc -c -I /home/sand/cil/obj/x86_LINUX  main.ml
 
But an error occurs when I linked the related object codes = together: =20
 
ocamlc -o main -I /home/sand/cil/obj/x86_LINUX/ pretty.cmo = trace.cmo=20 errormsg.cmo cabs.cmo cabsvisit.cmo escape.cmo cprint.cmo patch.cmo = frontc.cmo=20 main.cmo
 
"Error while linking /home/sand/cil/obj/x86_LINUX/patch.cmo: = Reference to=20 undefined global 'Unix' "
 
I looked into the patch.ml code and found this piece of code where = 'Unix'=20 is referenced:
let gettime () : float =3D (Unix.times = ()).Unix.tms_utime
 
 
Can anybody help me to solve this problem?
 
Thank you very much for your help:)
 
 
----- Original Message -----=20
From: "Anil Madhavapeddy" <anil@recoil.org>
To: "Zhu Ping" <zhuping@comp.nus.edu.sg>
Cc: <caml-list@yquem.inria.fr>=
Sent: Friday, November 18, 2005 5:52 PM
Subject: Re: [Caml-list] Using Frontc

> On Fri, Nov 18, 2005 at 05:22:37PM +0800, Zhu Ping=20 wrote:
>>
>> I'm using Frontc, which is one of the = libraries=20 released in
>> CDK, to parse C source code.
> = (snip)
>>=20
>> There are no source implementation/interface files with = respect=20 to
>> the corresponding files listed above.
>> =
>>=20 Can anybody help to to solve this problem? Thank you very much = for
>>=20 your help:)
>
> You haven't said if you must get FrontC to = work, or=20 can use any C
> parser.  If you dont mind using another = package, CIL=20 from Berkeley
> is written in OCaml and is actively developed (and = very=20 very good).
>
> You can find more details at http://manju.cs.berkeley.edu/c= il/
>=20
> --
> Anil=20 Madhavapeddy          &= nbsp;           &n= bsp;         =20 http://anil.recoil.org
> = University=20 of=20 Cambridge          &nbs= p;            = ;  =20 http://www.cl.cam.ac.uk
> ------=_NextPart_000_0029_01C5EDF1.BA545F40--