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 TAA13529; Mon, 22 Oct 2001 19:10:01 +0200 (MET DST) 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 TAA13608 for ; Mon, 22 Oct 2001 19:10:00 +0200 (MET DST) Received: from localhost.localdomain (jimbo68.zip.com.au [202.7.67.68]) by concorde.inria.fr (8.11.1/8.10.0) with ESMTP id f9MH9v922108 for ; Mon, 22 Oct 2001 19:09:58 +0200 (MET DST) Received: from maxtal.com.au (IDENT:root@localhost [127.0.0.1]) by localhost.localdomain (8.9.3/8.8.7) with ESMTP id DAA01154; Tue, 23 Oct 2001 03:09:38 +1000 Message-ID: <3BD452D2.4FCEA1A9@maxtal.com.au> Date: Tue, 23 Oct 2001 03:09:38 +1000 From: John Max Skaller X-Mailer: Mozilla 4.7 [en] (X11; I; Linux 2.2.12-20 i686) X-Accept-Language: en MIME-Version: 1.0 To: Christian Lindig CC: Vesa Karvonen , Caml Mailing List Subject: Re: [Caml-list] On ocamlyacc and ocamllex References: <000b01c143aa$d5218690$422aa8c0@housemarque.fi> <20010922211013.A580@eecs.harvard.edu> <001501c1444c$a7b0a720$422aa8c0@housemarque.fi> <20010923134425.A28129@lakeland.eecs.harvard.edu> <000901c14466$7848e280$422aa8c0@housemarque.fi> <20010923160915.B28129@lakeland.eecs.harvard.edu> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Christian Lindig wrote: > > I agree that it may be somewhat easier for the parser generator, but I > > find that separating the token type definition from the grammar > > definition can be justified using quantitative technical arguments. > > I agree that this alternative avoids the dependency of the type > definition on the grammar. But I am not sure that manually keeping the > type definition and the %token declarations in the parser in sync is > better than automatic recompiles or a little Make hack. Adding the tokens to the .mly file is a pain. I have two other files which also need to list all tokens: one to print them, and one to extract the source file/line/column information. Both have to be manually tracked anyhow. Worse, the %token command makes a normal union: how to use polymorphic variants instead? Even worse, the lexer and parser are improperly connected, with the parser incorrectly taking a lexer and lexbuf as arguments -- a right pain if you want to preprocess the tokens. I have to create a dummy lexbuf/lexer to drive the parser. The parser should take a callback function as an argument. A patch to make this alternative calling technique available would be useful. -- John (Max) Skaller, mailto:skaller@maxtal.com.au 10/1 Toxteth Rd Glebe NSW 2037 Australia voice: 61-2-9660-0850 New generation programming language Felix http://felix.sourceforge.net Literate Programming tool Interscript http://Interscript.sourceforge.net ------------------- 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