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
Handling include files using ocamllex
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2007-08-02 (10:29)
From: Christoph Bauer <Christoph.Bauer@l...>
Subject: RE: [SPAM?][Caml-list] Handling include files using ocamllex
> Hi all,
> I doing some simple parsing with ocamllex and ocamlyacc and I 
> need to be able to handle C style include files.
> I know how to do this in C with flex and bison, but I can't 
> figure out how to do it with ocamllex and ocamlyacc.
> Anyone know how to do this?

A solution could be to create an lexbuf from a function with
This function has to manage a stack of open channels and positions. It
has to 
scan for "#include"-statements and copies instead of these statements
the contents
of the corresponding files into the buffer.

Just an idea, I haven't done it yet.

Christoph Bauer