Re: About the usage of the Compilation Manager.
Matthias Blume <[email protected]>
| Newsgroups | gmane.comp.lang.sml.smlnj |
|---|---|
| Message-ID | <[email protected]> |
Dear Kwanghoon,
first, let me apologize for not having replied to your earlier
message...
On Jun 2, 2005, at 2:25 AM, Kwanghoon Choi wrote:
>
> Dear All,
>
> Would you please help me to use the Compilation Manager CM?
>
>
> Currently, I made a simple compiler whose target file is a ".sml".
> I wanted the source file of this compiler to use datatypes and
> function defintions defined in other ".sml" files.
>
> That is,
>
> A.sml - defines some datatype D and some function defintion F.
>
> B.src - uses D and F, and
> - is compiled by my compiler into B.sml.
My question here is: how exactly does B.src depend on D and F, i.e.,
how does your compiler process the contents of A.sml? Does it
rely on SML/NJ's internal data structures? In other words, does
it require SML/NJ to compile A.sml before it can compile B.src?
If this is the case, then things are rather tricky, and I am afraid
CM does not currently handle this situation without some serious
amount of hackery.
If, however, your compiler merely parses A.sml, then things are simpler
and will probably work out-of-the-box:
1. Write a "Makefile" (for Unix' "make" command) which describes
how to invoke your compiler on B.src to make B.sml. Let's call
that file "B.make". The make rule for B.sml would mention A.sml
as a dependency.
2. Add the following line to your .cm file:
B.sml : make (-f B.make)
3. A.sml must also be included in your .cm file somewhere.
I hope this helps. If it doesn't, please send me e-mail with a
description of how your compiler works (in particular, how it gets
at those definitions exported from A.sml), and I will see what
can be done.
Kind regards,
Matthias
> Finally, A.sml and B.sml are compiled into binaries by SML/NJ.
>
>
> However, in order to compile B.src into B.sml, I need to know what
> definitions are used by B.src, for example, due to type checking.
>
>
> Q1. Could I specify by CM the order of compilation so that A.sml will
> be compiled first and B.src will then be compiled with the
> exported
> definitions of A.sml?
>
> Q2. Moreover, how could I get a list of exported definitions of A.sml
> to compile B.src, automatically or by any means I need to do?
>
>
> My situation seems to be more complicated than that of MLyacc and
> MLlex because the compilation of ".MLYacc" and ".MLLex" itself does
> not need any exported definitions of other ".sml" files.
>
>
>
>
> Best regards,
>
>
> K. Choi
>
>
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by Yahoo.
> Introducing Yahoo! Search Developer Network - Create apps using Yahoo!
> Search APIs Find out how you can build Yahoo! directly into your own
> Applications - visit http://developer.yahoo.net/?fr=offad-ysdn-ostg-
> q22005
> _______________________________________________
> Smlnj-list mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/smlnj-list
>
>
-------------------------------------------------------
This SF.Net email is sponsored by Yahoo.
Introducing Yahoo! Search Developer Network - Create apps using Yahoo!
Search APIs Find out how you can build Yahoo! directly into your own
Applications - visit http://developer.yahoo.net/?fr=offad-ysdn-ostg-q22005