From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id KAA29485; Tue, 5 Feb 2002 10:34:01 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f 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 KAA30093 for ; Tue, 5 Feb 2002 10:34:00 +0100 (MET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g159XvH05532; Tue, 5 Feb 2002 10:33:57 +0100 (MET) Received: (from xleroy@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id KAA30086; Tue, 5 Feb 2002 10:33:57 +0100 (MET) Date: Tue, 5 Feb 2002 10:33:57 +0100 From: Xavier Leroy To: Chris Hecker Cc: Daniel de Rauglaudre , caml-list@inria.fr Subject: Re: [Caml-list] LL, LR, and camlp4 (was Re: syntax change) Message-ID: <20020205103357.B17751@pauillac.inria.fr> References: <15454.38553.300800.53941@gargle.gargle.HOWL> <20020204155242.B2338@verdot.inria.fr> <20020204150839.GE14738@chopin.ai.univie.ac.at> <20020204164154.D2338@verdot.inria.fr> <20020204162513.GA22263@chopin.ai.univie.ac.at> <4.3.2.7.2.20020204150243.037b5af0@arda.pair.com> <20020205034719.A23069@verdot.inria.fr> <4.3.2.7.2.20020204185723.036f4dc0@arda.pair.com> <20020205094244.A23442@verdot.inria.fr> <4.3.2.7.2.20020205005831.03799740@arda.pair.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0i In-Reply-To: <4.3.2.7.2.20020205005831.03799740@arda.pair.com>; from checker@d6.com on Tue, Feb 05, 2002 at 01:09:11AM -0800 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk > My question is just why did you hand-write the parser, rather than > using a tool like yacc? Was it because of the extensibility and hooks > you needed in camlp4 and there's no way to make an extensible > generated parser? Yacc-generated parsers (LALR automata) are certainly not extensible -- or at least not without having to recompute most of the automata at each extension. > Are parser generators not all they're cracked up to be? If so, why > does caml use yacc? Like all tools, parser generators work well for what they've been designed to do. In the case of Yacc, it works well for fixed grammars (non extensible) of a certain kind (LALR(1) plus precedences for disambiguation). The Caml compilers (OCaml, Caml Light, and even the original LeLisp-based Caml) use Yacc-generated parsers because that's the technology we had available at the time they were written, and it works relatively well -- some efforts are required to disambiguate the grammar, but at least Yacc tells you where the ambiguities are. - Xavier Leroy ------------------- Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr