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 MAA20820 for caml-red; Mon, 26 Jun 2000 12:30:19 +0200 (MET DST) Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id MAA23290 for ; Mon, 26 Jun 2000 12:06:31 +0200 (MET DST) Received: from pst.polyspace.com (polyspace.com [193.51.203.61]) by nez-perce.inria.fr (8.10.0/8.10.0) with ESMTP id e5QA6UD23849 for ; Mon, 26 Jun 2000 12:06:31 +0200 (MET DST) Received: from localhost (rinderkn@localhost) by pst.polyspace.com (8.9.1b+Sun/8.9.1) with ESMTP id MAA04239; Mon, 26 Jun 2000 12:05:47 +0200 (MET DST) Date: Mon, 26 Jun 2000 12:05:46 +0200 (MET DST) From: Christian Rinderknecht To: Steve Stevenson cc: caml-list@inria.fr Subject: Re: Multiple Yacc-style Parsers in one application? In-Reply-To: <14675.23674.237350.612515@merlin.cs.clemson.edu> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: weis@pauillac.inria.fr Hello Steve, Last year I wrote in OCaml a software that had to deal with multiple output/input files of a commercial tool, and hence needed up to six lexers and parsers. The different formats were rather close (both lexically and syntactically), but I wasn't able to share the lexers and the parsers rules because: 1) ocamllex generates an "open " directive; 2) ocamlyacc doesn't allow rule sharing. Nevertheless, I shared a lot of semantic actions (defined in standalone modules). The first point could be solved if ocamllex produced a functor whose argument signature would constrain the abstract syntax tree, but I am not sure the underlying implementation of lexer buffers would then behave soundly. Best regards, Christian -------------------------------------------------------------------- Christian Rinderknecht Christian.Rinderknecht@polyspace.com PolySpace Technologies Tel: 04.76.61.54.17 c/o INRIA Fax: 04.76.61.54.09 655, Av. de l'Europe http://www.polyspace.com/ F-38330 Montbonnot St Martin On Fri, 23 Jun 2000, Steve Stevenson wrote: > I'm interested in hearing experiences from people who have used > multiple yacc parsers in one application. I assume that they would > share one lexer buffer (but maybe not). Do you have to manipulate the > lexical world to deal with the one-lookahead?