From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: ** X-Spam-Status: No, score=2.1 required=5.0 tests=AWL,DNS_FROM_RFC_POST, MAILTO_TO_SPAM_ADDR,SPF_NEUTRAL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id 3A07DBBAF for ; Sun, 22 Mar 2009 18:41:11 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AtQCAIIVxklKfSweimdsb2JhbACNCocrez8BAQEKCQwHDwWtNoEHjRkBAwEDg3sG X-IronPort-AV: E=Sophos;i="4.38,403,1233529200"; d="scan'208";a="36983620" Received: from yx-out-2324.google.com ([74.125.44.30]) by mail4-smtp-sop.national.inria.fr with ESMTP; 22 Mar 2009 18:41:10 +0100 Received: by yx-out-2324.google.com with SMTP id 8so1193784yxm.3 for ; Sun, 22 Mar 2009 10:41:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=SA4vTTzDUXpwVoOH5gbH7QCBllLxmr47QBaGYP72uVY=; b=d5Si4ZvVSdXzxZW9bSXrs6Xe7If49TW9+z7xgFR9axoOOLBsOF/I30TqSEykeSYgLK YwDeMbvoLEQNknE/CuuQz8chYk7vaLV1GS1+RHtP5dsz/4b758YOmrzqm5zvVZfHmJ1y FMecma6dtEZ/jqRNhtQn0ad20wGpY6qb4E6oA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=YH3RIL/5UXW0wj+xfJI9Wh2qpkwKtxvK6SFln3WI0T2cXlWwustxqrJVVAFlKO5LX0 NMkWk6iAGhLUmP0TCAHU25h6w2rSDyh0YDF2wGPIJP+kIeW2QHGKSZI8D77eyZ+dvEVj 88idu2UxKfPIXrL52dPc/+UCyCVwe/48HRyMc= MIME-Version: 1.0 Received: by 10.150.218.10 with SMTP id q10mr11159456ybg.11.1237743669496; Sun, 22 Mar 2009 10:41:09 -0700 (PDT) In-Reply-To: <6b546c750903220924p1d845975qc4436f46ec1d1361@mail.gmail.com> References: <6b546c750903220924p1d845975qc4436f46ec1d1361@mail.gmail.com> Date: Sun, 22 Mar 2009 18:41:09 +0100 Message-ID: <527cf6bc0903221041r5fae361ei9e98986c18f3f28a@mail.gmail.com> Subject: Re: [Caml-list] printing the AST of a caml function From: blue storm To: Zorg 421 Cc: caml-list@yquem.inria.fr Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Spam: no; 0.00; -nostdlib:01 lexing:01 cmx:01 cmx:01 lexing:01 printast:01 stdout:01 ocamlopt:01 lib:01 ocaml:01 linenum:01 lexer:01 syntaxerr:01 clflags:01 parser:01 I'm not sure this is the cleanest way (i'd rather use something like -nostdlib), but your two last "lexing.cmx" and "format.cmx" are actually the same as the standard library modules. You can just remove them both from your build script, and it will then works. On 3/22/09, Zorg 421 wrote: > Hello, > > I want to play/understand the caml AST, so I try using this code snippet: > > --- > let factstring = "let rec fact n = if n < 1 then 0 else n * fact (n-1)" in > let tree = Parse.implementation (Lexing.from_string factstring) in > Printast.implementation (Format.formatter_of_out_channel stdout) tree > --- > > and this build script (~15 minutes spent in ordering correctly the .cmx :-/ > ) > > --- > #!/bin/sh > ocamlopt -I /opt/godi/lib/ocaml/compiler-lib/ misc.cmx linenum.cmx > warnings.cmx location.cmx lexer.cmx syntaxerr.cmx config.cmx > clflags.cmx parser.cmx parse.cmx printast.cmx lexing.cmx format.cmx > factast.ml -o factast > --- > > But the linker is confused by the Lexing module of stdlib: > > Files /opt/godi/lib/ocaml/std-lib/lexing.cmx > and /opt/godi/lib/ocaml/std-lib/stdlib.cmxa both define a module named > Lexing > > How can I prevent the linker to look in /opt/godi/lib/ocaml/std-lib/ > or /opt/godi/lib/ocaml/std-lib/stdlib.cmxa ? > > regards. > > _______________________________________________ > 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 >