caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: skaller <skaller@users.sourceforge.net>
To: Joel Reymont <joelr1@gmail.com>
Cc: Francois.Pottier@inria.fr, menhir-list@yquem.inria.fr,
	Caml List <caml-list@inria.fr>
Subject: Re: [Caml-list] Re: [Menhir-list] There's an elephant in the room: Solution to sharing a symbol table
Date: Wed, 02 May 2007 19:04:50 +1000	[thread overview]
Message-ID: <1178096690.13660.80.camel@rosella.wigram> (raw)
In-Reply-To: <8C011A98-CE76-4A83-B24C-BA37B66DF15D@gmail.com>

On Wed, 2007-05-02 at 06:58 +0100, Joel Reymont wrote:
> On May 2, 2007, at 6:44 AM, Francois Pottier wrote:

> How do you write parse above with the %parameter approach to ensure  
> that parse ALWAYS uses a new symbol table that is shared between the  
> lexer and the parser in this parsing run?

You can't. Don't be confused by functor interface in Menhir. 
It is useless for maintaining state.

What you need is a feature I asked for .. the possibility of
passing a state argument to the parser the same way you can
now do for ocamllex: you just write

	rule fred state = parse ...


and now 'state' is passed to all actions. That's ocamllex,
we need the same for parsing.

[I thought this was implemented but can't see it anywhere
in the Menhir manual]

This IS a way to hack this .. by using the ocamllex feature
and cheating by wrapping stuff inside tokens so that
the parser user actions can get at the state object.


-- 
John Skaller <skaller at users dot sf dot net>
Felix, successor to C++: http://felix.sf.net


  parent reply	other threads:[~2007-05-02  9:04 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-01 21:39 Joel Reymont
2007-05-02  5:44 ` [Menhir-list] " Francois Pottier
2007-05-02  5:58   ` Joel Reymont
     [not found]     ` <20070502070345.GA5242@yquem.inria.fr>
2007-05-02  7:35       ` Joel Reymont
2007-05-02  9:04     ` skaller [this message]
2007-05-02 11:56       ` [Caml-list] " Francois Pottier
2007-05-02 16:07         ` skaller
2007-05-02 18:30           ` Francois Pottier
2007-05-03  1:17             ` skaller
2007-05-03  8:48               ` Joel Reymont

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=1178096690.13660.80.camel@rosella.wigram \
    --to=skaller@users.sourceforge.net \
    --cc=Francois.Pottier@inria.fr \
    --cc=caml-list@inria.fr \
    --cc=joelr1@gmail.com \
    --cc=menhir-list@yquem.inria.fr \
    /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).