Re: Threadsafe parser generators? (John Lilley)
9 Dec 1996 00:07:22 -0500

          From comp.compilers

Related articles
Threadsafe parser generators? (Wilf Coles) (1996-12-07)
Re: Threadsafe parser generators? (1996-12-09)
Re: Threadsafe parser generators? (1996-12-10)
Re: Threadsafe parser generators? (Chuck Rendleman) (1996-12-14)
Re: Threadsafe parser generators? (Michael Meissner) (1996-12-15)
Re: Threadsafe parser generators? (1996-12-15)
Re: Threadsafe parser generators? (Wilf Coles) (1996-12-24)
| List of all articles for this month |

From: (John Lilley)
Newsgroups: comp.compilers
Date: 9 Dec 1996 00:07:22 -0500
Organization: Empathy Software
References: 96-12-059
Keywords: C, parallel says...
>Does anyone know of any threadsafe parser generators (for C),
>i.e. that will generate parsers to work in a multi threaded
>environment. All of the parser generators that I am aware of rely on
>global or static data and so it is not possible to run two instances
>of a parser concurrently in two different threads. Do the C++ parser
>generators have this capability?

I use PCCTS quite a bit and have looked into this. PCCTS generates
parser and lexers that have static members. In the lexer, the static
data is in the state table and so is read-only. In the parser, most
of the static data is used to represent leading-sets and so is also
read only. There is some gratuitous static data in the parser that I
think can be easily made per-object.

PCCTS generates C or C++, but the above comments apply only to the C++
code. The "C" code is definitely not thread-safe. In general, PCCTS
does not generate thread-safe parsers out of the box, but I think it
can be hacked to do so without too much trouble. PCCTS is an LL(k)
parser-generator with predicates and backtracking.

john lilley

Post a followup to this message

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