caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Using Frontc
@ 2005-11-18  9:22 Zhu Ping
  2005-11-18  9:52 ` [Caml-list] " Anil Madhavapeddy
  0 siblings, 1 reply; 8+ messages in thread
From: Zhu Ping @ 2005-11-18  9:22 UTC (permalink / raw)
  To: caml-list

[-- Attachment #1: Type: text/plain, Size: 1400 bytes --]

Dear OCaml users:

  I'm using Frontc, which is one of the libraries released in CDK, to parse C source code.

  I downloded the complete binaries for Linux i386 libc6 from http://pauillac.inria.fr/cdk/binaries/binaries-3.03/gz/cdk-3.03.tar.gz and installed it on a Linux server by following the installation instructions.

  The following code (mail.ml) is the main ocaml program that use Frontc to parse a sample code written in C language.


  open Frontc
  (* -------------------------------------- Test case for sample1.c --------------------------------------*)
  let parse_result = Frontc.parse_file "/home/sand/zhuping/sample1.c" error_channel; 


  I compiled the maim.ml using this command:  ocamlopt -I /usr/local/lib/cdk-3.03/lib/ocaml-3.03/ main.ml
  
  But some error returns: /usr/local/lib/cdk-3.03/lib/ocaml-3.03/pervasives.cmi is not a compiled interface

  All the Frontc codes located under the directory /usr/local/lib/cdk-3.03/lib/ocaml-3.03/ are compiled codes: 
    frontc.a
    frontc.cma
    frontc.cmi
    frontc.cmx
    frontc.cmxa
    clexer.cmi
    clexer.cmx
    cparser.cmi
    cparser.cmx
    cabs.cmi
    cabs.cmx
    cprint.cmi
    cprint.cmx

There are no source implementation/interface files with respect to the corresponding files listed above.

  Can anybody help to to solve this problem? Thank you very much for your help:)

[-- Attachment #2: Type: text/html, Size: 3392 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread
* Re: [Caml-list] Using Frontc
@ 2005-11-20  8:44 Zhu Ping
  2005-11-20 12:37 ` Matthieu Dubuget
  0 siblings, 1 reply; 8+ messages in thread
From: Zhu Ping @ 2005-11-20  8:44 UTC (permalink / raw)
  To: Anil Madhavapeddy; +Cc: caml-list

[-- Attachment #1: Type: text/plain, Size: 2205 bytes --]

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 = Frontc.parse "/home/sand/zhuping/sample1.c"; 

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:  

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 = (Unix.times ()).Unix.tms_utime


Can anybody help me to solve this problem? 

Thank you very much for your help:)


----- Original Message ----- 
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 wrote:
>> 
>> I'm using Frontc, which is one of the libraries released in
>> CDK, to parse C source code.
> (snip)
>> 
>> There are no source implementation/interface files with respect to
>> the corresponding files listed above.
>> 
>> Can anybody help to to solve this problem? Thank you very much for
>> your help:)
> 
> 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).
> 
> You can find more details at http://manju.cs.berkeley.edu/cil/
> 
> -- 
> Anil Madhavapeddy                                 http://anil.recoil.org
> University of Cambridge                          http://www.cl.cam.ac.uk
>

[-- Attachment #2: Type: text/html, Size: 4047 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2005-11-24 10:26 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-11-18  9:22 Using Frontc Zhu Ping
2005-11-18  9:52 ` [Caml-list] " Anil Madhavapeddy
2005-11-20  8:44 Zhu Ping
2005-11-20 12:37 ` Matthieu Dubuget
2005-11-21  8:41   ` Zhu Ping
2005-11-21  9:54     ` Gerd Stolpmann
2005-11-24  6:12       ` Zhu Ping
2005-11-24 10:25         ` skaller

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).