Lexer/Parser in Multithreaded C App

isaacson@blue.seas.upenn.edu (Ron Isaacson)
3 Jul 1998 00:40:52 -0400

          From comp.compilers

Related articles
Lexer/Parser in Multithreaded C App isaacson@blue.seas.upenn.edu (1998-07-03)
Re: Lexer/Parser in Multithreaded C App cfc@world.std.com (Chris F Clark) (1998-07-05)
| List of all articles for this month |

From: isaacson@blue.seas.upenn.edu (Ron Isaacson)
Newsgroups: comp.compilers
Date: 3 Jul 1998 00:40:52 -0400
Organization: University of Pennsylvania
Keywords: lex, parse, parallel

I'm using Flex and Bison to create a lexer/parser in a multithreaded C
(not C++) app. Bison has the %pure_parser option; does that make the
generated parser completely thread-safe?


Lex's C++ lexer class claims to be inherently thread-safe, but I'd
rather keep it in C; I couldn't find any info on this. Does anyone
know if it's possible, or do I have to use C++?


Also, out of curiosity, is there a standard way of doing lexer/parser
global variables in a multithreaded app? My lexer currently has a
global which it uses to keep track of the state, and my parser has a
few globals which are used as temporary storage as each token in a
sequence is parsed. Can anyone recommend a thread-safe way of redoing
this?


I'm a bit new to multithreaded programming, so any advice would be
greatly appreciated. Thank you very much!


  - Ron, isaacson@seas.upenn.edu
                http://www.seas.upenn.edu/~isaacson/
--


Post a followup to this message

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