From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id JAA26259 for caml-red; Thu, 25 Jan 2001 09:10:38 +0100 (MET) Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id IAA26986 for ; Thu, 25 Jan 2001 08:52:48 +0100 (MET) Received: from romeo.apsystems.it ([213.82.20.2]) by concorde.inria.fr (8.11.1/8.10.0) with ESMTP id f0P7qlL02263 for ; Thu, 25 Jan 2001 08:52:47 +0100 (MET) Received: from alex (ppp-104.dial1.planet.it [212.110.170.104]) by romeo.apsystems.it with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2650.21) id DQZAG7XQ; Thu, 25 Jan 2001 08:52:42 -0000 Message-ID: <002301c086a3$4fe3e320$68aa6ed4@alex> From: "Alex Baretta" To: "Ocaml Mailing List" Subject: Lex and yacc Date: Thu, 25 Jan 2001 08:49:12 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 4.72.3110.5 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 Sender: weis@pauillac.inria.fr I have used ocamllex and ocamlyacc to write lexers and parsers for a few different variants of a lambda calculus, and I think they are excellent tools. Yesterday, I tried to take advantage of the experience I had by using Flex and Bison to write a lexer and parser for the http protocol to be used in a proxy to be written in C. I read the texinfo manual for both, and I have noticed that, while Bison takes care to generate reentrant parsers, flex *apparently* generates code that is inadequate on a multithreaded process with several open input streams and several parsers running contemporarily (but you may correct me if I am mistaken). I am pretty sure these problems do not exists in ocamllex and ocamlyacc. Now, can you gurus teach me a way to write my reentrant lexer and parser with the Ocaml tools and link the result with a C application? (I am not sure the professor would accept this solution, but if it feasible I might try to convince him... ;-) Thanks for your time! Alex