Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: chet@watson.ibm.com
To: Gerd.Stolpmann@darmstadt.netsurf.de
Cc: chet@watson.ibm.com, caml-list@inria.fr
Subject: Re: re-entrant CAMLYACC parsers?
Date: Fri, 13 Aug 1999 17:18:57 -0400	[thread overview]
Message-ID: <199908132118.RAA01096@bismarck.chet.org> (raw)
In-Reply-To: Your message of "Fri, 13 Aug 1999 21:52:00 +0200." <99081322272704.00491@schneemann>


How amusing!  I'm hacking an XML parser in CAML, too!

It sure was easy!

I ended up hacking caml-yacc to do it -- added a slot in the
parser_env, and a method to fetch the slot in parser actions.

--chet--
>>>>> "GS" == Gerd Stolpmann <Gerd.Stolpmann@darmstadt.netsurf.de> writes:

    GS> On Tue, 03 Aug 1999, chet@watson.ibm.com wrote:
    >> How do most people implement re-entrancy in caml-yacc parsers
    >> which must manipulate side-state?  E.g., if I want to have some
    >> hashtable to store a mapping from name to right-hand-side,
    >> which the lexer will expand dynamically and push back onto the
    >> lexbuf (I've enclosed the code I use to do that -- it looks
    >> right, and it works, but I'm not certain that I got the
    >> semantics of Lexing.lexbuf down), it'd be nice to store that
    >> someplace on the stack, so that I don't have to count on
    >> serialization of calls to the parser.
    >> 
    >> I've thought about hacking Parsing to have an extra slot in the
    >> parsing_env record, of polymorphic type, and then adding some
    >> syntax to the caml-yacc language to fetch that value.
    >> 
    >> Anybody done anything like this?
    >> 
 
    GS> I had recently the same problem for my XML parser (BTW: will
    GS> be available soon). The idea is simple: make the parser an
    GS> object!




      reply	other threads:[~1999-08-22 18:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-08-03 21:45 chet
1999-08-13 19:52 ` Gerd Stolpmann
1999-08-13 21:18   ` chet [this message]

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=199908132118.RAA01096@bismarck.chet.org \
    --to=chet@watson.ibm.com \
    --cc=Gerd.Stolpmann@darmstadt.netsurf.de \
    --cc=caml-list@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