Re: Thread-safety, lex and yacc.

"Clark" <>
12 Apr 2001 02:48:58 -0400

          From comp.compilers

Related articles
Thread-safety, lex and yacc. (Nicholas Dronen) (2001-03-31)
Re: Thread-safety, lex and yacc. (2001-04-04)
Re: Thread-safety, lex and yacc. (Troy Cauble) (2001-04-10)
Re: Thread-safety, lex and yacc. (Clark) (2001-04-12)
| List of all articles for this month |

From: "Clark" <>
Newsgroups: comp.compilers
Date: 12 Apr 2001 02:48:58 -0400
Organization: Compilers Central
References: 01-03-164
Keywords: lex, yacc, C++, parallel
Posted-Date: 12 Apr 2001 02:48:58 EDT

> I noticed that yylval is a global variable in the lex file for an
> application I'm auditing for thread-safety. In the C++ source file
> generated by lex, the variable is global as well. I suspect that this
> doesn't bode well for the thread-safety of the application.

If you use lex++ and bison++ then all these can be local variables
passed to the constructor or method of the generated classes.
Unfortunately the documentation on the changes from regular lex and
bison is nearly non-existent. (Lots, and lots of #defines or

Going through some of the test code I've written though, it appears
like they are fully re-entrant. I'm still developing my own grammar,
however. Thus far no quirks and I have no globals.

Clark Goble

Post a followup to this message

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