Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] Ocamlyacc reentrancy
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: skaller <skaller@u...>
Subject: [Caml-list] Ocamlyacc reentrancy
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