From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id E9989BB83 for ; Tue, 23 May 2006 00:39:13 +0200 (CEST) Received: from blizzard.cs.caltech.edu (blizzard.cs.caltech.edu [131.215.44.2]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id k4MMdCUB031202 for ; Tue, 23 May 2006 00:39:13 +0200 Received: from localhost (flood.cs.caltech.edu [131.215.44.31]) by blizzard.cs.caltech.edu (Postfix) with ESMTP id 453E24028F2; Mon, 22 May 2006 15:39:12 -0700 (PDT) Received: from blizzard.cs.caltech.edu ([131.215.44.2]) by localhost (flood.cs.caltech.edu [131.215.44.31]) (amavisd-new, port 10024) with ESMTP id 10060-03; Mon, 22 May 2006 15:39:12 -0700 (PDT) Received: from [192.168.1.100] (charter-242-015.caltech.edu [131.215.242.15]) by blizzard.cs.caltech.edu (Postfix) with ESMTP id 426E84028E4; Mon, 22 May 2006 15:39:11 -0700 (PDT) Message-ID: <44723D8E.4060704@cs.caltech.edu> Date: Mon, 22 May 2006 15:39:10 -0700 From: Aleksey Nogin Reply-To: Caml List , MetaPRL Developers Organization: California Institute of Technology, Computer Science Department User-Agent: Mozilla Thunderbird 1.0.7-1.1.fc3 (X11/20050929) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Nicolas Pouillard Cc: MetaPRL Developers , OCaml Mailing List , Jason Hickey Subject: Re: [Caml-list] [Camlp4] Beta-release References: <446A331F.4000205@cs.caltech.edu> In-Reply-To: X-Enigmail-Version: 0.89.5.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Miltered: at nez-perce with ID 44723D90.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; camlp:01 camlp:01 parsers:01 mutable:01 parser:01 grammar:01 parser:01 lexer:01 lexer:01 viewcvs:01 util:01 util:01 grammar:01 wrote:01 polymorphic:01 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.3 On 17.05.2006 00:52, Nicolas Pouillard wrote: >> Basically, I would really like to see camlp4 help with the following: >> >> 1) Defining parsers that depend on a shared state that is passed around. > > I don't know what you mean by shared state: a mutable data, a purely > functional data structure? It should probably up to the end-users. The idea then would be to have the parser thread (in fold-style) the state through the productions and it would be up to the individual productions to decide whether to modify it in place or to return a different value functionally. > And what will be the kind of this state, > because that state must be extensible by any extension. The grammar type should probably be polymorphic in the type of the state. BTW, in some of our code Jason Hickey have implemented an extensible LR1 parser generator with such a polymorphic "fold-style" state handling (where the state is threaded both through the lexer and through all the productions). See the lm_parser and lm_lexer modules at http://svn.metaprl.org/viewcvs/mojave/libmojave/util/ (can also be checked out via Subversion from svn://svn.metaprl.org/libmojave/util/ ). >> 3) (completely unrelated) I wish there was a way to tell camlp4 to >> detect and report conflicts! > > There is no way to detect more conflicts than by default. Sorry. Would it be possible to add such detection? Possibly in the form of a camlp4 module that processes the grammar extension directives differently, retaining more information as needed for such analysis? -- Aleksey Nogin Home Page: http://nogin.org/ E-Mail: nogin@cs.caltech.edu (office), aleksey@nogin.org (personal) Office: Moore 04, tel: (626) 395-2200