Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
Lex and yacc
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Alex Baretta <alex@b...>
Subject: Lex and yacc
I have used ocamllex and ocamlyacc to write lexers and parsers for a
few different variants of a lambda calculus, and I think they are
excellent tools. Yesterday, I tried to take advantage of the
experience I had by using Flex and Bison to write a lexer and parser
for the http protocol to be used in a proxy to be written in C. I read
the texinfo manual for both, and I have noticed that, while Bison
takes care to generate reentrant parsers, flex *apparently* generates
code that is inadequate on a multithreaded process with several open
input streams and several parsers running contemporarily (but you may
correct me if I am mistaken). I am pretty sure these problems do not
exists in ocamllex and ocamlyacc. Now, can you gurus teach me a way to
write my reentrant lexer and parser with the Ocaml tools and link the
result with a C application? (I am not sure the professor would accept
this solution, but if it feasible I might try to convince him... ;-)

Thanks for your time!