flex/bison multithreading issues

"Michael" <rbtree1@yahoo.com>
22 Apr 2001 23:54:19 -0400

          From comp.compilers

Related articles
flex/bison multithreading issues rbtree1@yahoo.com (Michael) (2001-04-22)
| List of all articles for this month |

From: "Michael" <rbtree1@yahoo.com>
Newsgroups: comp.compilers
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.


For example:


do_evaluate("(3+3)/2");


Inintialy I just need to do simple math expressions parser so that I
can work out the main problem.


Again..
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
and such.


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


Also..
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]


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.