Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Camlp4] questions
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Hendrik Tews <tews@o...>
Subject: Re: [Caml-list] [Camlp4] questions
Raphael Proust <> writes:

   Is there a (nice) way to input/output multiple files? I managed reading from a
   second file while transforming one but the code is (really) ugly.

How about

    let start_loc_1 = Syntax.Loc.mkloc file_1 in
    let stream_1 = Stream.of_channel (open_in file_1) in
    let ast_1 = Syntax.parse_implem start_loc_1 stream_1 in

    let start_loc_2 = Syntax.Loc.mkloc file_2 in
    let stream_2 = Stream.of_channel (open_in file_2) in
    let ast_2 = Syntax.parse_implem start_loc_2 stream_2

   For those who ever need it camlunity as the ocamldoc online:

Nice, but the main camlp4 problem still needs to be fixed: The
sources are almost not documented. Just look at, it _only_ says

   Add an option to the command line options.


BTW, where are all the modules from the Camlp4Parsers directory,
eg Camlp4OCamlParser?