caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: blue storm <bluestorm.dylc@gmail.com>
To: Zorg 421 <zorglub421@gmail.com>
Cc: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] printing the AST of a caml function
Date: Sun, 22 Mar 2009 18:41:09 +0100	[thread overview]
Message-ID: <527cf6bc0903221041r5fae361ei9e98986c18f3f28a@mail.gmail.com> (raw)
In-Reply-To: <6b546c750903220924p1d845975qc4436f46ec1d1361@mail.gmail.com>

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 <zorglub421@gmail.com> 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
>


      reply	other threads:[~2009-03-22 17:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-22 16:24 Zorg 421
2009-03-22 17:41 ` blue storm [this message]

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=527cf6bc0903221041r5fae361ei9e98986c18f3f28a@mail.gmail.com \
    --to=bluestorm.dylc@gmail.com \
    --cc=caml-list@yquem.inria.fr \
    --cc=zorglub421@gmail.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).