Bob Rossi <[EMAIL PROTECTED]> writes:

> As I implement the push parser, I'm forced to have the same collection
> of globals in an ADT.

Hmm, just _one_ type?  Wouldn't it be a collection of types (and
objects to go along with them)?  That way you could localize info to
just the primitives that need it.

> First, I would like to know if when using a nonpure parser, if users
> of bison access those global data variables?

Never underestimate the power of Bison users to refer to all those
crufty globals....  But I think yhour approach with
backwards-compatibility macros should work.

> The code in yyparse would then change to something like
> (globalvar->yychar) instead of simply yychar.

Won't this slow things down somewhat?  It might not hurt to look at
the size/speed of the resulting nonpure code.  I suspect the
reformulated version won't be optimized as well as the original.
(But then, I've been wrong about optimization before....)


Reply via email to