caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Ocamlyacc reentrancy
@ 2004-05-01  3:08 skaller
  2004-05-01  4:47 ` Jon Harrop
  0 siblings, 1 reply; 6+ messages in thread
From: skaller @ 2004-05-01  3:08 UTC (permalink / raw)
  To: caml-list

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2004-05-05 14:00 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-05-01  3:08 [Caml-list] Ocamlyacc reentrancy skaller
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

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).