caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Aleksey Nogin <nogin@cs.caltech.edu>
To: Nicolas Pouillard <nicolas.pouillard@gmail.com>
Cc: MetaPRL Developers <metaprl-devel@metaprl.org>,
	OCaml Mailing List <caml-list@yquem.inria.fr>,
	Jason Hickey <jyh@cs.caltech.edu>
Subject: Re: [Caml-list] [Camlp4] Beta-release
Date: Mon, 22 May 2006 15:39:10 -0700	[thread overview]
Message-ID: <44723D8E.4060704@cs.caltech.edu> (raw)
In-Reply-To: <cd67f63a0605170052u4687e38fnecd737fb6f0d97a@mail.gmail.com>

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


  reply	other threads:[~2006-05-22 22:39 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-15 11:41 Nicolas Pouillard
2006-05-16 14:55 ` [Caml-list] " Alain Frisch
2006-05-16 20:16 ` Aleksey Nogin
2006-05-17  7:52   ` Nicolas Pouillard
2006-05-22 22:39     ` Aleksey Nogin [this message]
2006-05-18 14:36 ` Stefano Zacchiroli
2006-05-18 14:41   ` Nicolas Pouillard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=44723D8E.4060704@cs.caltech.edu \
    --to=nogin@cs.caltech.edu \
    --cc=caml-list@inria.fr \
    --cc=caml-list@yquem.inria.fr \
    --cc=jyh@cs.caltech.edu \
    --cc=metaprl-devel@metaprl.org \
    --cc=nicolas.pouillard@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).