[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: proposed namespace cleanup for bison.simple

From: Akim Demaille
Subject: Re: proposed namespace cleanup for bison.simple
Date: 30 Nov 2001 14:11:36 +0100
User-agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Civil Service)

2001-11-29  Paul Eggert  <address@hidden>

        Name space cleanup in generated parser.

        * doc/bison.texinfo (Bison Parser): Discuss system headers
        and their effect on the user name space.

        * src/bison.simple:
        YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
        i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).

        (YYSIZE_T): New macro.  Use it instead of size_t, to avoid infringing
        on user names when possible.

        (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
        Simplify test for whather <alloca.h> exists.

        (<stdlib.h>): Include if we will use malloc, and if standard C or C++.

        (<stdio.h>): Include if YYDEBUG.

        (yymemcpy): Renamed from __yy_memcpy.  Do not define unless
        ! defined (yyoverflow) && ! defined (yymemcpy).

        (yymemcpy, yyparse): Rename local variables as needed so that
        they all begin with 'yy'.

        (yystrlen, yystpcpy): New functions.

        All uses changed.

        (yyparse): size_t -> YYSIZE_T.  Use yystrlen and yystpcpy
        instead of relying on string.h functions.  Use YYSTACK_ALLOC
        and YYSTACK_FREE instead of malloc and free.

I went ahead and applied it, I was too afraid to see this patch be
obsoleted by other changes.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]