|flex/bison multithreading issues email@example.com (Michael) (2001-04-22)|
|Date:||22 Apr 2001 23:54:19 -0400|
|Organization:||Posted via Supernews, http://www.supernews.com|
|Keywords:||lex, yacc, parallel, comment|
|Posted-Date:||22 Apr 2001 23:54:18 EDT|
I have a few problems to resolve.
I need to generate a parser/interpreter that I can embed in a function
and call within multiple threads. It must be thread safe.
Inintialy I just need to do simple math expressions parser so that I
can work out the main problem.
I may run this function concurrently in multiple spawned processes,
thus it is important that the parser/interpreter code that is
generated is reentrant and thread safe. This means no global variables
I need to take flex and bison code that is generated and embed and
encapsulatate the entire code in a function to be run using the
expression as a parameter to the function.
It may now be obvious that the input is not going to be stdin. It will
be a string that is passed as a parameter.
Thanks for any advise
[Bison has an option to generate reentrant parsers. Flex will do so
if you tell it to make a C++ scanner, but needs hand tweaking for C
scanners. Reading from a string is easy and is well-documented in the
flex man page. -John]
Return to the
Search the comp.compilers archives again.