English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
Camlp4: example/parse_files.ml
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2008-04-02 (23:14)
From: Hendrik Tews <tews@c...>
Subject: Camlp4: example/parse_files.ml

I have a few questions to the parse_files example.

The example starts with building the parser and printer via the
following functor application

    module Caml =

1. Can I omit the printer functor if I am only interested in
   parsing files (and not printing) and simplify to

    module Caml =

2. Ast, Gram, Quotation come from Camlp4.PreCast. Do I miss
   something if I simplify further to

    module Caml =

3. I looked into the registration of syntax extentions (Register
   functors) and how the syntax extention callbacks are called
   in Register.iter_and_take_callbacks. I have the impression
   that in camlp4 not the above nested functor application is
   performed but the Make functors are sequentially applied to
   the same Syntax functor. Therefore, can I further simplify to 

    module Caml = Camlp4.PreCast.Syntax
    let () = 
      let module M1 = Camlp4OCamlRevisedParser.Make(Caml) in
      let module M2 = Camlp4OCamlParser.Make(Caml)