From: skaller <skaller@users.sourceforge.net>
To: caml-list <caml-list@inria.fr>
Subject: [Caml-list] Ocamlyacc reentrancy
Date: 01 May 2004 13:08:55 +1000 [thread overview]
Message-ID: <1083380934.2581.321.camel@pelican.wigram> (raw)
As far as I can tell, Ocamlyacc parsers aren't
reentrant: it uses static storage to hold
the parser stack. There is even an argumentless
clear function to empty 'the' stack after a parse
is finished.
It would be nice if we could get a re-entrant
parser so recursive parsing could be done.
This can be useful for processing '#include"
files in C for example, if you want to handle
that at the parse level instead of the token level.
However, it may be possible to 'hack' something
which allows this for sequential progamming
(i.e. not with threads) by providing two functions:
get_parser_state
set_parser_state
Does this make sense? Would it be useful to anyone else?
Can it be implemented without too much fuss
in lieu of a fully re-entrant parser?
--
John Skaller, mailto:skaller@users.sf.net
voice: 061-2-9660-0850,
snail: PO BOX 401 Glebe NSW 2037 Australia
Checkout the Felix programming language http://felix.sf.net
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
next reply other threads:[~2004-05-01 3:09 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-05-01 3:08 skaller [this message]
2004-05-01 4:47 ` Jon Harrop
2004-05-01 5:36 ` skaller
2004-05-02 20:38 ` Eckart Goehler
2004-05-05 11:52 ` Keith Wansbrough
2004-05-05 14:00 ` skaller
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=1083380934.2581.321.camel@pelican.wigram \
--to=skaller@users.sourceforge.net \
--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