* [Caml-list] file specific outputting
@ 2012-07-10 10:50 Dash, Santanu
2012-07-10 11:21 ` Gabriel Scherer
2012-07-10 12:16 ` Jérémie Dimino
0 siblings, 2 replies; 4+ messages in thread
From: Dash, Santanu @ 2012-07-10 10:50 UTC (permalink / raw)
To: caml-list
Hello all,
I work in the area of program analysis. I am currently trying to analyse Ocaml programs and wish to output file-specific information with the aid of the Ocaml compiler.
For example, if I compile a file called foo.ml, i want to output a file called foo.info based on an analysis of alpha.ml. I have already integrated the analysis module with the Ocaml compiler.
Can someone direct me on the best way to go about this? Is there a variable in the compiler that stores the filename of the file currently being compiled?
Kind regards,
Santanu
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Caml-list] file specific outputting
2012-07-10 10:50 [Caml-list] file specific outputting Dash, Santanu
@ 2012-07-10 11:21 ` Gabriel Scherer
2012-07-10 12:16 ` Jérémie Dimino
1 sibling, 0 replies; 4+ messages in thread
From: Gabriel Scherer @ 2012-07-10 11:21 UTC (permalink / raw)
To: Dash, Santanu; +Cc: caml-list
[-- Attachment #1: Type: text/plain, Size: 1201 bytes --]
There is an "output_name" value in utils/clflags.ml, which is handled by
the "output_prefix" function in driver/main.ml, which passes it to the
Compile.{interface,implementation} functions of drivers/compile.ml; have a
look at how these two functions handle production of auxiliary .cmi or
.annot files.
On Tue, Jul 10, 2012 at 12:50 PM, Dash, Santanu <s.dash@herts.ac.uk> wrote:
> Hello all,
>
> I work in the area of program analysis. I am currently trying to analyse
> Ocaml programs and wish to output file-specific information with the aid of
> the Ocaml compiler.
>
> For example, if I compile a file called foo.ml, i want to output a file
> called foo.info based on an analysis of alpha.ml. I have already
> integrated the analysis module with the Ocaml compiler.
>
> Can someone direct me on the best way to go about this? Is there a
> variable in the compiler that stores the filename of the file currently
> being compiled?
>
> Kind regards,
> Santanu
> --
> Caml-list mailing list. Subscription management and archives:
> https://sympa-roc.inria.fr/wws/info/caml-list
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs
>
>
[-- Attachment #2: Type: text/html, Size: 2024 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Caml-list] file specific outputting
2012-07-10 10:50 [Caml-list] file specific outputting Dash, Santanu
2012-07-10 11:21 ` Gabriel Scherer
@ 2012-07-10 12:16 ` Jérémie Dimino
2012-07-10 12:39 ` Dash, Santanu
1 sibling, 1 reply; 4+ messages in thread
From: Jérémie Dimino @ 2012-07-10 12:16 UTC (permalink / raw)
To: Dash, Santanu; +Cc: caml-list
Le Tue, 10 Jul 2012 11:50:24 +0100,
"Dash, Santanu" <s.dash@herts.ac.uk> a écrit :
> Can someone direct me on the best way to go about this? Is there a
> variable in the compiler that stores the filename of the file
> currently being compiled?
There is Location.input_name. It is set by the compiler before parsing
a source file (file "driver/pparse.ml", function "file"). Note that if
there are multiple source files on the command line it will be
modified for each one of them.
--
Jérémie
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Caml-list] file specific outputting
2012-07-10 12:16 ` Jérémie Dimino
@ 2012-07-10 12:39 ` Dash, Santanu
0 siblings, 0 replies; 4+ messages in thread
From: Dash, Santanu @ 2012-07-10 12:39 UTC (permalink / raw)
To: Jérémie Dimino; +Cc: caml-list
Thank you Jérémie and Gabriel for the quick response. That answers my question perfectly.
Best regards,
Santanu
On 10 Jul 2012, at 13:16, Jérémie Dimino wrote:
> Le Tue, 10 Jul 2012 11:50:24 +0100,
> "Dash, Santanu" <s.dash@herts.ac.uk> a écrit :
>
>> Can someone direct me on the best way to go about this? Is there a
>> variable in the compiler that stores the filename of the file
>> currently being compiled?
>
> There is Location.input_name. It is set by the compiler before parsing
> a source file (file "driver/pparse.ml", function "file"). Note that if
> there are multiple source files on the command line it will be
> modified for each one of them.
>
> --
> Jérémie
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-07-10 12:39 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-10 10:50 [Caml-list] file specific outputting Dash, Santanu
2012-07-10 11:21 ` Gabriel Scherer
2012-07-10 12:16 ` Jérémie Dimino
2012-07-10 12:39 ` Dash, Santanu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox