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 KAA22916; Tue, 5 Feb 2002 10:31:28 +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 KAA29581 for ; Tue, 5 Feb 2002 10:31:27 +0100 (MET) Received: from verdot.inria.fr (verdot.inria.fr [128.93.11.7]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g159VQH05447 for ; Tue, 5 Feb 2002 10:31:26 +0100 (MET) Received: (from ddr@localhost) by verdot.inria.fr (8.9.3/8.9.3) id KAA23834 for caml-list@inria.fr; Tue, 5 Feb 2002 10:31:26 +0100 Date: Tue, 5 Feb 2002 10:31:26 +0100 From: Daniel de Rauglaudre To: caml-list@inria.fr Subject: Re: [Caml-list] LL, LR, and camlp4 (was Re: syntax change) Message-ID: <20020205103126.E23442@verdot.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 Content-Disposition: inline User-Agent: Mutt/1.2.5i 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 Hi, On Tue, Feb 05, 2002 at 01:09:11AM -0800, Chris Hecker wrote: > My question is just why did you hand-write the parser, rather than > using a tool like yacc? To preserve the extensibility with a simple way. I could not do that with a yacc parser except revisiting the whole grammar and rebuiding the whole table when extensions are done. In Camlp4, when you extend an "entry level", only the entry level is modified: an extension is just adding a rule in a tree, like adding a case in a function. It is simple and I want to keep that simplicity. > Are parser generators not all they're cracked up to be? If so, why > does caml use yacc? I don't know: when I arrived 10 years ago, there was nothing by yacc. and for most people: parsing <=> yacc Not for me. I don't agree with that. I discovered parsing by learning Pascal, 25 years ago and I found amazing the rules: expression ::= term + term | term - term term ::= factor + factor | factor - factor factor ::= integer | variable | ( expression ) I found this recursivity with "expression between parentheses" as a marvelous thing... :-) When I arrived here, I just combined this idea with the Caml language and its polymorphism, and I wrote the stream parsers, using Michel Mauny's ideas. Extensible grammars of Camlp4 are just improved stream parsers. -- Daniel de RAUGLAUDRE daniel.de_rauglaudre@inria.fr http://cristal.inria.fr/~ddr/ ------------------- 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