3.7.11 A Pure (Reentrant) Parser

slipbits <[email protected]> Wed, 8 Jun 2022 10:50:44 -0700
Newsgroups gmane.comp.parsers.bison.general
Message-ID <[email protected]>
The first sentence reads "A /reentrant/ program is one which does not 
alter in the course of execution; in other words, it consists entirely 
of /pure/ (read-only) code. "

Some points which confuse me:

 1. "alters" what? The object is not mentioned. Did you mean that it
    does not alter non-local data and input parameters? See paragraph 2
    "The standard Yacc interfaces are inherently nonreentrant, because
    they use statically allocated variables" which alludes to modifying
    non-local data.
 2. "...it consists entirely of /pure/ (read-only) code. " This is
    confusing to me. In modern machines, code is read-only (this wasn't
    the case in computers from the 50's, 60's, and I believe 70's in
    which it was possible to alter the executing code. Did you mean that
    the code did not alter non-local data and parameters? If it doesn't
    alter anything then the function does nothing.
 3. I'm not sure but I believe the standard definition of reentrancy is
    that the external environment is unaltered. This is tantamount to
    not altering data, objects, external objects, etc., that is, status
    quo ante. After the execution of the code changes to the environment
    external to the code is non-detectable. However, returning values
    (of functions) and returning data through alteration of the input
    parameters (either [inout] or [out]) is perfectly fine.

This section may be in error.

thanks
art