(root)/
Linux-PAM-1.5.3/
doc/
specs/
parse_y.c
       1  /* A Bison parser, made by GNU Bison 3.7.6.  */
       2  
       3  /* Bison implementation for Yacc-like parsers in C
       4  
       5     Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation,
       6     Inc.
       7  
       8     This program is free software: you can redistribute it and/or modify
       9     it under the terms of the GNU General Public License as published by
      10     the Free Software Foundation, either version 3 of the License, or
      11     (at your option) any later version.
      12  
      13     This program is distributed in the hope that it will be useful,
      14     but WITHOUT ANY WARRANTY; without even the implied warranty of
      15     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      16     GNU General Public License for more details.
      17  
      18     You should have received a copy of the GNU General Public License
      19     along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
      20  
      21  /* As a special exception, you may create a larger work that contains
      22     part or all of the Bison parser skeleton and distribute that work
      23     under terms of your choice, so long as that work isn't itself a
      24     parser generator using the skeleton or a modified version thereof
      25     as a parser skeleton.  Alternatively, if you modify or redistribute
      26     the parser skeleton itself, you may (at your option) remove this
      27     special exception, which will cause the skeleton and the resulting
      28     Bison output files to be licensed under the GNU General Public
      29     License without this special exception.
      30  
      31     This special exception was added by the Free Software Foundation in
      32     version 2.2 of Bison.  */
      33  
      34  /* C LALR(1) parser skeleton written by Richard Stallman, by
      35     simplifying the original so-called "semantic" parser.  */
      36  
      37  /* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual,
      38     especially those whose name start with YY_ or yy_.  They are
      39     private implementation details that can be changed or removed.  */
      40  
      41  /* All symbols defined below should begin with yy or YY, to avoid
      42     infringing on user name space.  This should be done even for local
      43     variables, as they might otherwise be expanded by user macros.
      44     There are some unavoidable exceptions within include files to
      45     define necessary library symbols; they are noted "INFRINGES ON
      46     USER NAME SPACE" below.  */
      47  
      48  /* Identify Bison output, and Bison version.  */
      49  #define YYBISON 30706
      50  
      51  /* Bison version string.  */
      52  #define YYBISON_VERSION "3.7.6"
      53  
      54  /* Skeleton name.  */
      55  #define YYSKELETON_NAME "yacc.c"
      56  
      57  /* Pure parsers.  */
      58  #define YYPURE 0
      59  
      60  /* Push parsers.  */
      61  #define YYPUSH 0
      62  
      63  /* Pull parsers.  */
      64  #define YYPULL 1
      65  
      66  
      67  
      68  
      69  /* First part of user prologue.  */
      70  #line 2 "parse_y.y"
      71  
      72  #ifdef HAVE_CONFIG_H
      73  #  include <config.h>
      74  #endif
      75  
      76  #include <stdio.h>
      77  #include <stdlib.h>
      78  #include <string.h>
      79  
      80  #define MAXLINE  1000
      81  #define INDENT_STRING "  "
      82  #define PAPER_WIDTH   74
      83  
      84      int indent=0;
      85      int line=1;
      86      char *last_label=NULL;
      87  
      88      extern int yylex(void);
      89      extern char *yytext;
      90      extern void yyerror(const char *x);
      91      extern char *get_label(const char *label);
      92      extern void set_label(const char *label, const char *target);
      93      char *new_counter(const char *key);
      94  
      95  #line 96 "parse_y.c"
      96  
      97  # ifndef YY_CAST
      98  #  ifdef __cplusplus
      99  #   define YY_CAST(Type, Val) static_cast<Type> (Val)
     100  #   define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast<Type> (Val)
     101  #  else
     102  #   define YY_CAST(Type, Val) ((Type) (Val))
     103  #   define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val))
     104  #  endif
     105  # endif
     106  # ifndef YY_NULLPTR
     107  #  if defined __cplusplus
     108  #   if 201103L <= __cplusplus
     109  #    define YY_NULLPTR nullptr
     110  #   else
     111  #    define YY_NULLPTR 0
     112  #   endif
     113  #  else
     114  #   define YY_NULLPTR ((void*)0)
     115  #  endif
     116  # endif
     117  
     118  /* Use api.header.include to #include this header
     119     instead of duplicating it here.  */
     120  #ifndef YY_YY_PARSE_Y_H_INCLUDED
     121  # define YY_YY_PARSE_Y_H_INCLUDED
     122  /* Debug traces.  */
     123  #ifndef YYDEBUG
     124  # define YYDEBUG 0
     125  #endif
     126  #if YYDEBUG
     127  extern int yydebug;
     128  #endif
     129  
     130  /* Token kinds.  */
     131  #ifndef YYTOKENTYPE
     132  # define YYTOKENTYPE
     133    enum yytokentype
     134    {
     135      YYEMPTY = -2,
     136      YYEOF = 0,                     /* "end of file"  */
     137      YYerror = 256,                 /* error  */
     138      YYUNDEF = 257,                 /* "invalid token"  */
     139      NEW_COUNTER = 258,             /* NEW_COUNTER  */
     140      LABEL = 259,                   /* LABEL  */
     141      HASH = 260,                    /* HASH  */
     142      CHAR = 261,                    /* CHAR  */
     143      NEWLINE = 262,                 /* NEWLINE  */
     144      NO_INDENT = 263,               /* NO_INDENT  */
     145      RIGHT = 264                    /* RIGHT  */
     146    };
     147    typedef enum yytokentype yytoken_kind_t;
     148  #endif
     149  /* Token kinds.  */
     150  #define YYEMPTY -2
     151  #define YYEOF 0
     152  #define YYerror 256
     153  #define YYUNDEF 257
     154  #define NEW_COUNTER 258
     155  #define LABEL 259
     156  #define HASH 260
     157  #define CHAR 261
     158  #define NEWLINE 262
     159  #define NO_INDENT 263
     160  #define RIGHT 264
     161  
     162  /* Value type.  */
     163  #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
     164  union YYSTYPE
     165  {
     166  #line 27 "parse_y.y"
     167  
     168      int def;
     169      char *string;
     170  
     171  #line 172 "parse_y.c"
     172  
     173  };
     174  typedef union YYSTYPE YYSTYPE;
     175  # define YYSTYPE_IS_TRIVIAL 1
     176  # define YYSTYPE_IS_DECLARED 1
     177  #endif
     178  
     179  
     180  extern YYSTYPE yylval;
     181  
     182  int yyparse (void);
     183  
     184  #endif /* !YY_YY_PARSE_Y_H_INCLUDED  */
     185  /* Symbol kind.  */
     186  enum yysymbol_kind_t
     187  {
     188    YYSYMBOL_YYEMPTY = -2,
     189    YYSYMBOL_YYEOF = 0,                      /* "end of file"  */
     190    YYSYMBOL_YYerror = 1,                    /* error  */
     191    YYSYMBOL_YYUNDEF = 2,                    /* "invalid token"  */
     192    YYSYMBOL_NEW_COUNTER = 3,                /* NEW_COUNTER  */
     193    YYSYMBOL_LABEL = 4,                      /* LABEL  */
     194    YYSYMBOL_HASH = 5,                       /* HASH  */
     195    YYSYMBOL_CHAR = 6,                       /* CHAR  */
     196    YYSYMBOL_NEWLINE = 7,                    /* NEWLINE  */
     197    YYSYMBOL_NO_INDENT = 8,                  /* NO_INDENT  */
     198    YYSYMBOL_RIGHT = 9,                      /* RIGHT  */
     199    YYSYMBOL_YYACCEPT = 10,                  /* $accept  */
     200    YYSYMBOL_doc = 11,                       /* doc  */
     201    YYSYMBOL_stuff = 12,                     /* stuff  */
     202    YYSYMBOL_text = 13                       /* text  */
     203  };
     204  typedef enum yysymbol_kind_t yysymbol_kind_t;
     205  
     206  
     207  
     208  
     209  #ifdef short
     210  # undef short
     211  #endif
     212  
     213  /* On compilers that do not define __PTRDIFF_MAX__ etc., make sure
     214     <limits.h> and (if available) <stdint.h> are included
     215     so that the code can choose integer types of a good width.  */
     216  
     217  #ifndef __PTRDIFF_MAX__
     218  # include <limits.h> /* INFRINGES ON USER NAME SPACE */
     219  # if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
     220  #  include <stdint.h> /* INFRINGES ON USER NAME SPACE */
     221  #  define YY_STDINT_H
     222  # endif
     223  #endif
     224  
     225  /* Narrow types that promote to a signed type and that can represent a
     226     signed or unsigned integer of at least N bits.  In tables they can
     227     save space and decrease cache pressure.  Promoting to a signed type
     228     helps avoid bugs in integer arithmetic.  */
     229  
     230  #ifdef __INT_LEAST8_MAX__
     231  typedef __INT_LEAST8_TYPE__ yytype_int8;
     232  #elif defined YY_STDINT_H
     233  typedef int_least8_t yytype_int8;
     234  #else
     235  typedef signed char yytype_int8;
     236  #endif
     237  
     238  #ifdef __INT_LEAST16_MAX__
     239  typedef __INT_LEAST16_TYPE__ yytype_int16;
     240  #elif defined YY_STDINT_H
     241  typedef int_least16_t yytype_int16;
     242  #else
     243  typedef short yytype_int16;
     244  #endif
     245  
     246  /* Work around bug in HP-UX 11.23, which defines these macros
     247     incorrectly for preprocessor constants.  This workaround can likely
     248     be removed in 2023, as HPE has promised support for HP-UX 11.23
     249     (aka HP-UX 11i v2) only through the end of 2022; see Table 2 of
     250     <https://h20195.www2.hpe.com/V2/getpdf.aspx/4AA4-7673ENW.pdf>.  */
     251  #ifdef __hpux
     252  # undef UINT_LEAST8_MAX
     253  # undef UINT_LEAST16_MAX
     254  # define UINT_LEAST8_MAX 255
     255  # define UINT_LEAST16_MAX 65535
     256  #endif
     257  
     258  #if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__
     259  typedef __UINT_LEAST8_TYPE__ yytype_uint8;
     260  #elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \
     261         && UINT_LEAST8_MAX <= INT_MAX)
     262  typedef uint_least8_t yytype_uint8;
     263  #elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX
     264  typedef unsigned char yytype_uint8;
     265  #else
     266  typedef short yytype_uint8;
     267  #endif
     268  
     269  #if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__
     270  typedef __UINT_LEAST16_TYPE__ yytype_uint16;
     271  #elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \
     272         && UINT_LEAST16_MAX <= INT_MAX)
     273  typedef uint_least16_t yytype_uint16;
     274  #elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX
     275  typedef unsigned short yytype_uint16;
     276  #else
     277  typedef int yytype_uint16;
     278  #endif
     279  
     280  #ifndef YYPTRDIFF_T
     281  # if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__
     282  #  define YYPTRDIFF_T __PTRDIFF_TYPE__
     283  #  define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__
     284  # elif defined PTRDIFF_MAX
     285  #  ifndef ptrdiff_t
     286  #   include <stddef.h> /* INFRINGES ON USER NAME SPACE */
     287  #  endif
     288  #  define YYPTRDIFF_T ptrdiff_t
     289  #  define YYPTRDIFF_MAXIMUM PTRDIFF_MAX
     290  # else
     291  #  define YYPTRDIFF_T long
     292  #  define YYPTRDIFF_MAXIMUM LONG_MAX
     293  # endif
     294  #endif
     295  
     296  #ifndef YYSIZE_T
     297  # ifdef __SIZE_TYPE__
     298  #  define YYSIZE_T __SIZE_TYPE__
     299  # elif defined size_t
     300  #  define YYSIZE_T size_t
     301  # elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
     302  #  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
     303  #  define YYSIZE_T size_t
     304  # else
     305  #  define YYSIZE_T unsigned
     306  # endif
     307  #endif
     308  
     309  #define YYSIZE_MAXIMUM                                  \
     310    YY_CAST (YYPTRDIFF_T,                                 \
     311             (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1)  \
     312              ? YYPTRDIFF_MAXIMUM                         \
     313              : YY_CAST (YYSIZE_T, -1)))
     314  
     315  #define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X))
     316  
     317  
     318  /* Stored state numbers (used for stacks). */
     319  typedef yytype_int8 yy_state_t;
     320  
     321  /* State numbers in computations.  */
     322  typedef int yy_state_fast_t;
     323  
     324  #ifndef YY_
     325  # if defined YYENABLE_NLS && YYENABLE_NLS
     326  #  if ENABLE_NLS
     327  #   include <libintl.h> /* INFRINGES ON USER NAME SPACE */
     328  #   define YY_(Msgid) dgettext ("bison-runtime", Msgid)
     329  #  endif
     330  # endif
     331  # ifndef YY_
     332  #  define YY_(Msgid) Msgid
     333  # endif
     334  #endif
     335  
     336  
     337  #ifndef YY_ATTRIBUTE_PURE
     338  # if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__)
     339  #  define YY_ATTRIBUTE_PURE __attribute__ ((__pure__))
     340  # else
     341  #  define YY_ATTRIBUTE_PURE
     342  # endif
     343  #endif
     344  
     345  #ifndef YY_ATTRIBUTE_UNUSED
     346  # if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__)
     347  #  define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__))
     348  # else
     349  #  define YY_ATTRIBUTE_UNUSED
     350  # endif
     351  #endif
     352  
     353  /* Suppress unused-variable warnings by "using" E.  */
     354  #if ! defined lint || defined __GNUC__
     355  # define YY_USE(E) ((void) (E))
     356  #else
     357  # define YY_USE(E) /* empty */
     358  #endif
     359  
     360  #if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
     361  /* Suppress an incorrect diagnostic about yylval being uninitialized.  */
     362  # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN                            \
     363      _Pragma ("GCC diagnostic push")                                     \
     364      _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")              \
     365      _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
     366  # define YY_IGNORE_MAYBE_UNINITIALIZED_END      \
     367      _Pragma ("GCC diagnostic pop")
     368  #else
     369  # define YY_INITIAL_VALUE(Value) Value
     370  #endif
     371  #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
     372  # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
     373  # define YY_IGNORE_MAYBE_UNINITIALIZED_END
     374  #endif
     375  #ifndef YY_INITIAL_VALUE
     376  # define YY_INITIAL_VALUE(Value) /* Nothing. */
     377  #endif
     378  
     379  #if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__
     380  # define YY_IGNORE_USELESS_CAST_BEGIN                          \
     381      _Pragma ("GCC diagnostic push")                            \
     382      _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"")
     383  # define YY_IGNORE_USELESS_CAST_END            \
     384      _Pragma ("GCC diagnostic pop")
     385  #endif
     386  #ifndef YY_IGNORE_USELESS_CAST_BEGIN
     387  # define YY_IGNORE_USELESS_CAST_BEGIN
     388  # define YY_IGNORE_USELESS_CAST_END
     389  #endif
     390  
     391  
     392  #define YY_ASSERT(E) ((void) (0 && (E)))
     393  
     394  #if !defined yyoverflow
     395  
     396  /* The parser invokes alloca or malloc; define the necessary symbols.  */
     397  
     398  # ifdef YYSTACK_USE_ALLOCA
     399  #  if YYSTACK_USE_ALLOCA
     400  #   ifdef __GNUC__
     401  #    define YYSTACK_ALLOC __builtin_alloca
     402  #   elif defined __BUILTIN_VA_ARG_INCR
     403  #    include <alloca.h> /* INFRINGES ON USER NAME SPACE */
     404  #   elif defined _AIX
     405  #    define YYSTACK_ALLOC __alloca
     406  #   elif defined _MSC_VER
     407  #    include <malloc.h> /* INFRINGES ON USER NAME SPACE */
     408  #    define alloca _alloca
     409  #   else
     410  #    define YYSTACK_ALLOC alloca
     411  #    if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
     412  #     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
     413        /* Use EXIT_SUCCESS as a witness for stdlib.h.  */
     414  #     ifndef EXIT_SUCCESS
     415  #      define EXIT_SUCCESS 0
     416  #     endif
     417  #    endif
     418  #   endif
     419  #  endif
     420  # endif
     421  
     422  # ifdef YYSTACK_ALLOC
     423     /* Pacify GCC's 'empty if-body' warning.  */
     424  #  define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
     425  #  ifndef YYSTACK_ALLOC_MAXIMUM
     426      /* The OS might guarantee only one guard page at the bottom of the stack,
     427         and a page size can be as small as 4096 bytes.  So we cannot safely
     428         invoke alloca (N) if N exceeds 4096.  Use a slightly smaller number
     429         to allow for a few compiler-allocated temporary stack slots.  */
     430  #   define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
     431  #  endif
     432  # else
     433  #  define YYSTACK_ALLOC YYMALLOC
     434  #  define YYSTACK_FREE YYFREE
     435  #  ifndef YYSTACK_ALLOC_MAXIMUM
     436  #   define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
     437  #  endif
     438  #  if (defined __cplusplus && ! defined EXIT_SUCCESS \
     439         && ! ((defined YYMALLOC || defined malloc) \
     440               && (defined YYFREE || defined free)))
     441  #   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
     442  #   ifndef EXIT_SUCCESS
     443  #    define EXIT_SUCCESS 0
     444  #   endif
     445  #  endif
     446  #  ifndef YYMALLOC
     447  #   define YYMALLOC malloc
     448  #   if ! defined malloc && ! defined EXIT_SUCCESS
     449  void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
     450  #   endif
     451  #  endif
     452  #  ifndef YYFREE
     453  #   define YYFREE free
     454  #   if ! defined free && ! defined EXIT_SUCCESS
     455  void free (void *); /* INFRINGES ON USER NAME SPACE */
     456  #   endif
     457  #  endif
     458  # endif
     459  #endif /* !defined yyoverflow */
     460  
     461  #if (! defined yyoverflow \
     462       && (! defined __cplusplus \
     463           || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
     464  
     465  /* A type that is properly aligned for any stack member.  */
     466  union yyalloc
     467  {
     468    yy_state_t yyss_alloc;
     469    YYSTYPE yyvs_alloc;
     470  };
     471  
     472  /* The size of the maximum gap between one aligned stack and the next.  */
     473  # define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1)
     474  
     475  /* The size of an array large to enough to hold all stacks, each with
     476     N elements.  */
     477  # define YYSTACK_BYTES(N) \
     478       ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE)) \
     479        + YYSTACK_GAP_MAXIMUM)
     480  
     481  # define YYCOPY_NEEDED 1
     482  
     483  /* Relocate STACK from its old location to the new one.  The
     484     local variables YYSIZE and YYSTACKSIZE give the old and new number of
     485     elements in the stack, and YYPTR gives the new location of the
     486     stack.  Advance YYPTR to a properly aligned location for the next
     487     stack.  */
     488  # define YYSTACK_RELOCATE(Stack_alloc, Stack)                           \
     489      do                                                                  \
     490        {                                                                 \
     491          YYPTRDIFF_T yynewbytes;                                         \
     492          YYCOPY (&yyptr->Stack_alloc, Stack, yysize);                    \
     493          Stack = &yyptr->Stack_alloc;                                    \
     494          yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \
     495          yyptr += yynewbytes / YYSIZEOF (*yyptr);                        \
     496        }                                                                 \
     497      while (0)
     498  
     499  #endif
     500  
     501  #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
     502  /* Copy COUNT objects from SRC to DST.  The source and destination do
     503     not overlap.  */
     504  # ifndef YYCOPY
     505  #  if defined __GNUC__ && 1 < __GNUC__
     506  #   define YYCOPY(Dst, Src, Count) \
     507        __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src)))
     508  #  else
     509  #   define YYCOPY(Dst, Src, Count)              \
     510        do                                        \
     511          {                                       \
     512            YYPTRDIFF_T yyi;                      \
     513            for (yyi = 0; yyi < (Count); yyi++)   \
     514              (Dst)[yyi] = (Src)[yyi];            \
     515          }                                       \
     516        while (0)
     517  #  endif
     518  # endif
     519  #endif /* !YYCOPY_NEEDED */
     520  
     521  /* YYFINAL -- State number of the termination state.  */
     522  #define YYFINAL  2
     523  /* YYLAST -- Last index in YYTABLE.  */
     524  #define YYLAST   27
     525  
     526  /* YYNTOKENS -- Number of terminals.  */
     527  #define YYNTOKENS  10
     528  /* YYNNTS -- Number of nonterminals.  */
     529  #define YYNNTS  4
     530  /* YYNRULES -- Number of rules.  */
     531  #define YYNRULES  15
     532  /* YYNSTATES -- Number of states.  */
     533  #define YYNSTATES  19
     534  
     535  /* YYMAXUTOK -- Last valid token kind.  */
     536  #define YYMAXUTOK   264
     537  
     538  
     539  /* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM
     540     as returned by yylex, with out-of-bounds checking.  */
     541  #define YYTRANSLATE(YYX)                                \
     542    (0 <= (YYX) && (YYX) <= YYMAXUTOK                     \
     543     ? YY_CAST (yysymbol_kind_t, yytranslate[YYX])        \
     544     : YYSYMBOL_YYUNDEF)
     545  
     546  /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
     547     as returned by yylex.  */
     548  static const yytype_int8 yytranslate[] =
     549  {
     550         0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     551         2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     552         2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     553         2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     554         2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     555         2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     556         2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     557         2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     558         2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     559         2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     560         2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     561         2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     562         2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     563         2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     564         2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     565         2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     566         2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     567         2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     568         2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     569         2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     570         2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     571         2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     572         2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     573         2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     574         2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     575         2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
     576         5,     6,     7,     8,     9
     577  };
     578  
     579  #if YYDEBUG
     580    /* YYRLINE[YYN] -- Source line where rule number YYN was defined.  */
     581  static const yytype_uint8 yyrline[] =
     582  {
     583         0,    39,    39,    40,    44,    53,    72,    99,   128,   131,
     584       139,   142,   147,   151,   154,   160
     585  };
     586  #endif
     587  
     588  /** Accessing symbol of state STATE.  */
     589  #define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State])
     590  
     591  #if YYDEBUG || 0
     592  /* The user-facing name of the symbol whose (internal) number is
     593     YYSYMBOL.  No bounds checking.  */
     594  static const char *yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED;
     595  
     596  /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
     597     First, the terminals, then, starting at YYNTOKENS, nonterminals.  */
     598  static const char *const yytname[] =
     599  {
     600    "\"end of file\"", "error", "\"invalid token\"", "NEW_COUNTER", "LABEL",
     601    "HASH", "CHAR", "NEWLINE", "NO_INDENT", "RIGHT", "$accept", "doc",
     602    "stuff", "text", YY_NULLPTR
     603  };
     604  
     605  static const char *
     606  yysymbol_name (yysymbol_kind_t yysymbol)
     607  {
     608    return yytname[yysymbol];
     609  }
     610  #endif
     611  
     612  #ifdef YYPRINT
     613  /* YYTOKNUM[NUM] -- (External) token number corresponding to the
     614     (internal) symbol number NUM (which must be that of a token).  */
     615  static const yytype_int16 yytoknum[] =
     616  {
     617         0,   256,   257,   258,   259,   260,   261,   262,   263,   264
     618  };
     619  #endif
     620  
     621  #define YYPACT_NINF (-3)
     622  
     623  #define yypact_value_is_default(Yyn) \
     624    ((Yyn) == YYPACT_NINF)
     625  
     626  #define YYTABLE_NINF (-1)
     627  
     628  #define yytable_value_is_error(Yyn) \
     629    0
     630  
     631    /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
     632       STATE-NUM.  */
     633  static const yytype_int8 yypact[] =
     634  {
     635        -3,     0,    -3,    -3,     5,    -3,    -3,    -3,    -3,    -3,
     636        -3,    -3,    17,    12,    -3,    -3,    -3,    -2,    -3
     637  };
     638  
     639    /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
     640       Performed when YYTABLE does not specify something else to do.  Zero
     641       means the default is an error.  */
     642  static const yytype_int8 yydefact[] =
     643  {
     644         2,     8,     1,     3,     0,    15,    14,    13,    10,     4,
     645        12,     8,     9,     0,    11,     5,     8,     0,     6
     646  };
     647  
     648    /* YYPGOTO[NTERM-NUM].  */
     649  static const yytype_int8 yypgoto[] =
     650  {
     651        -3,    -3,    11,    -3
     652  };
     653  
     654    /* YYDEFGOTO[NTERM-NUM].  */
     655  static const yytype_int8 yydefgoto[] =
     656  {
     657         0,     1,     4,    12
     658  };
     659  
     660    /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM.  If
     661       positive, shift that token.  If negative, reduce the rule whose
     662       number is the opposite.  If YYTABLE_NINF, syntax error.  */
     663  static const yytype_int8 yytable[] =
     664  {
     665         2,     5,     6,     7,     8,    18,    10,     3,     5,     6,
     666         7,     8,     9,    10,    11,     5,     6,     7,     8,    15,
     667        10,    16,    13,    14,     0,     0,     0,    17
     668  };
     669  
     670  static const yytype_int8 yycheck[] =
     671  {
     672         0,     3,     4,     5,     6,     7,     8,     7,     3,     4,
     673         5,     6,     7,     8,     9,     3,     4,     5,     6,     7,
     674         8,     9,    11,     6,    -1,    -1,    -1,    16
     675  };
     676  
     677    /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
     678       symbol of state STATE-NUM.  */
     679  static const yytype_int8 yystos[] =
     680  {
     681         0,    11,     0,     7,    12,     3,     4,     5,     6,     7,
     682         8,     9,    13,    12,     6,     7,     9,    12,     7
     683  };
     684  
     685    /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
     686  static const yytype_int8 yyr1[] =
     687  {
     688         0,    10,    11,    11,    11,    11,    11,    11,    12,    12,
     689        13,    13,    13,    13,    13,    13
     690  };
     691  
     692    /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN.  */
     693  static const yytype_int8 yyr2[] =
     694  {
     695         0,     2,     0,     2,     3,     5,     7,     7,     0,     2,
     696         1,     2,     1,     1,     1,     1
     697  };
     698  
     699  
     700  enum { YYENOMEM = -2 };
     701  
     702  #define yyerrok         (yyerrstatus = 0)
     703  #define yyclearin       (yychar = YYEMPTY)
     704  
     705  #define YYACCEPT        goto yyacceptlab
     706  #define YYABORT         goto yyabortlab
     707  #define YYERROR         goto yyerrorlab
     708  
     709  
     710  #define YYRECOVERING()  (!!yyerrstatus)
     711  
     712  #define YYBACKUP(Token, Value)                                    \
     713    do                                                              \
     714      if (yychar == YYEMPTY)                                        \
     715        {                                                           \
     716          yychar = (Token);                                         \
     717          yylval = (Value);                                         \
     718          YYPOPSTACK (yylen);                                       \
     719          yystate = *yyssp;                                         \
     720          goto yybackup;                                            \
     721        }                                                           \
     722      else                                                          \
     723        {                                                           \
     724          yyerror (YY_("syntax error: cannot back up")); \
     725          YYERROR;                                                  \
     726        }                                                           \
     727    while (0)
     728  
     729  /* Backward compatibility with an undocumented macro.
     730     Use YYerror or YYUNDEF. */
     731  #define YYERRCODE YYUNDEF
     732  
     733  
     734  /* Enable debugging if requested.  */
     735  #if YYDEBUG
     736  
     737  # ifndef YYFPRINTF
     738  #  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
     739  #  define YYFPRINTF fprintf
     740  # endif
     741  
     742  # define YYDPRINTF(Args)                        \
     743  do {                                            \
     744    if (yydebug)                                  \
     745      YYFPRINTF Args;                             \
     746  } while (0)
     747  
     748  /* This macro is provided for backward compatibility. */
     749  # ifndef YY_LOCATION_PRINT
     750  #  define YY_LOCATION_PRINT(File, Loc) ((void) 0)
     751  # endif
     752  
     753  
     754  # define YY_SYMBOL_PRINT(Title, Kind, Value, Location)                    \
     755  do {                                                                      \
     756    if (yydebug)                                                            \
     757      {                                                                     \
     758        YYFPRINTF (stderr, "%s ", Title);                                   \
     759        yy_symbol_print (stderr,                                            \
     760                    Kind, Value); \
     761        YYFPRINTF (stderr, "\n");                                           \
     762      }                                                                     \
     763  } while (0)
     764  
     765  
     766  /*-----------------------------------.
     767  | Print this symbol's value on YYO.  |
     768  `-----------------------------------*/
     769  
     770  static void
     771  yy_symbol_value_print (FILE *yyo,
     772                         yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep)
     773  {
     774    FILE *yyoutput = yyo;
     775    YY_USE (yyoutput);
     776    if (!yyvaluep)
     777      return;
     778  # ifdef YYPRINT
     779    if (yykind < YYNTOKENS)
     780      YYPRINT (yyo, yytoknum[yykind], *yyvaluep);
     781  # endif
     782    YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
     783    YY_USE (yykind);
     784    YY_IGNORE_MAYBE_UNINITIALIZED_END
     785  }
     786  
     787  
     788  /*---------------------------.
     789  | Print this symbol on YYO.  |
     790  `---------------------------*/
     791  
     792  static void
     793  yy_symbol_print (FILE *yyo,
     794                   yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep)
     795  {
     796    YYFPRINTF (yyo, "%s %s (",
     797               yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind));
     798  
     799    yy_symbol_value_print (yyo, yykind, yyvaluep);
     800    YYFPRINTF (yyo, ")");
     801  }
     802  
     803  /*------------------------------------------------------------------.
     804  | yy_stack_print -- Print the state stack from its BOTTOM up to its |
     805  | TOP (included).                                                   |
     806  `------------------------------------------------------------------*/
     807  
     808  static void
     809  yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop)
     810  {
     811    YYFPRINTF (stderr, "Stack now");
     812    for (; yybottom <= yytop; yybottom++)
     813      {
     814        int yybot = *yybottom;
     815        YYFPRINTF (stderr, " %d", yybot);
     816      }
     817    YYFPRINTF (stderr, "\n");
     818  }
     819  
     820  # define YY_STACK_PRINT(Bottom, Top)                            \
     821  do {                                                            \
     822    if (yydebug)                                                  \
     823      yy_stack_print ((Bottom), (Top));                           \
     824  } while (0)
     825  
     826  
     827  /*------------------------------------------------.
     828  | Report that the YYRULE is going to be reduced.  |
     829  `------------------------------------------------*/
     830  
     831  static void
     832  yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp,
     833                   int yyrule)
     834  {
     835    int yylno = yyrline[yyrule];
     836    int yynrhs = yyr2[yyrule];
     837    int yyi;
     838    YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n",
     839               yyrule - 1, yylno);
     840    /* The symbols being reduced.  */
     841    for (yyi = 0; yyi < yynrhs; yyi++)
     842      {
     843        YYFPRINTF (stderr, "   $%d = ", yyi + 1);
     844        yy_symbol_print (stderr,
     845                         YY_ACCESSING_SYMBOL (+yyssp[yyi + 1 - yynrhs]),
     846                         &yyvsp[(yyi + 1) - (yynrhs)]);
     847        YYFPRINTF (stderr, "\n");
     848      }
     849  }
     850  
     851  # define YY_REDUCE_PRINT(Rule)          \
     852  do {                                    \
     853    if (yydebug)                          \
     854      yy_reduce_print (yyssp, yyvsp, Rule); \
     855  } while (0)
     856  
     857  /* Nonzero means print parse trace.  It is left uninitialized so that
     858     multiple parsers can coexist.  */
     859  int yydebug;
     860  #else /* !YYDEBUG */
     861  # define YYDPRINTF(Args) ((void) 0)
     862  # define YY_SYMBOL_PRINT(Title, Kind, Value, Location)
     863  # define YY_STACK_PRINT(Bottom, Top)
     864  # define YY_REDUCE_PRINT(Rule)
     865  #endif /* !YYDEBUG */
     866  
     867  
     868  /* YYINITDEPTH -- initial size of the parser's stacks.  */
     869  #ifndef YYINITDEPTH
     870  # define YYINITDEPTH 200
     871  #endif
     872  
     873  /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
     874     if the built-in stack extension method is used).
     875  
     876     Do not make this value too large; the results are undefined if
     877     YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
     878     evaluated with infinite-precision integer arithmetic.  */
     879  
     880  #ifndef YYMAXDEPTH
     881  # define YYMAXDEPTH 10000
     882  #endif
     883  
     884  
     885  
     886  
     887  
     888  
     889  /*-----------------------------------------------.
     890  | Release the memory associated to this symbol.  |
     891  `-----------------------------------------------*/
     892  
     893  static void
     894  yydestruct (const char *yymsg,
     895              yysymbol_kind_t yykind, YYSTYPE *yyvaluep)
     896  {
     897    YY_USE (yyvaluep);
     898    if (!yymsg)
     899      yymsg = "Deleting";
     900    YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp);
     901  
     902    YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
     903    YY_USE (yykind);
     904    YY_IGNORE_MAYBE_UNINITIALIZED_END
     905  }
     906  
     907  
     908  /* Lookahead token kind.  */
     909  int yychar;
     910  
     911  /* The semantic value of the lookahead symbol.  */
     912  YYSTYPE yylval;
     913  /* Number of syntax errors so far.  */
     914  int yynerrs;
     915  
     916  
     917  
     918  
     919  /*----------.
     920  | yyparse.  |
     921  `----------*/
     922  
     923  int
     924  yyparse (void)
     925  {
     926      yy_state_fast_t yystate = 0;
     927      /* Number of tokens to shift before error messages enabled.  */
     928      int yyerrstatus = 0;
     929  
     930      /* Refer to the stacks through separate pointers, to allow yyoverflow
     931         to reallocate them elsewhere.  */
     932  
     933      /* Their size.  */
     934      YYPTRDIFF_T yystacksize = YYINITDEPTH;
     935  
     936      /* The state stack: array, bottom, top.  */
     937      yy_state_t yyssa[YYINITDEPTH];
     938      yy_state_t *yyss = yyssa;
     939      yy_state_t *yyssp = yyss;
     940  
     941      /* The semantic value stack: array, bottom, top.  */
     942      YYSTYPE yyvsa[YYINITDEPTH];
     943      YYSTYPE *yyvs = yyvsa;
     944      YYSTYPE *yyvsp = yyvs;
     945  
     946    int yyn;
     947    /* The return value of yyparse.  */
     948    int yyresult;
     949    /* Lookahead symbol kind.  */
     950    yysymbol_kind_t yytoken = YYSYMBOL_YYEMPTY;
     951    /* The variables used to return semantic value and location from the
     952       action routines.  */
     953    YYSTYPE yyval;
     954  
     955  
     956  
     957  #define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N))
     958  
     959    /* The number of symbols on the RHS of the reduced rule.
     960       Keep to zero when no symbol should be popped.  */
     961    int yylen = 0;
     962  
     963    YYDPRINTF ((stderr, "Starting parse\n"));
     964  
     965    yychar = YYEMPTY; /* Cause a token to be read.  */
     966    goto yysetstate;
     967  
     968  
     969  /*------------------------------------------------------------.
     970  | yynewstate -- push a new state, which is found in yystate.  |
     971  `------------------------------------------------------------*/
     972  yynewstate:
     973    /* In all cases, when you get here, the value and location stacks
     974       have just been pushed.  So pushing a state here evens the stacks.  */
     975    yyssp++;
     976  
     977  
     978  /*--------------------------------------------------------------------.
     979  | yysetstate -- set current state (the top of the stack) to yystate.  |
     980  `--------------------------------------------------------------------*/
     981  yysetstate:
     982    YYDPRINTF ((stderr, "Entering state %d\n", yystate));
     983    YY_ASSERT (0 <= yystate && yystate < YYNSTATES);
     984    YY_IGNORE_USELESS_CAST_BEGIN
     985    *yyssp = YY_CAST (yy_state_t, yystate);
     986    YY_IGNORE_USELESS_CAST_END
     987    YY_STACK_PRINT (yyss, yyssp);
     988  
     989    if (yyss + yystacksize - 1 <= yyssp)
     990  #if !defined yyoverflow && !defined YYSTACK_RELOCATE
     991      goto yyexhaustedlab;
     992  #else
     993      {
     994        /* Get the current used size of the three stacks, in elements.  */
     995        YYPTRDIFF_T yysize = yyssp - yyss + 1;
     996  
     997  # if defined yyoverflow
     998        {
     999          /* Give user a chance to reallocate the stack.  Use copies of
    1000             these so that the &'s don't force the real ones into
    1001             memory.  */
    1002          yy_state_t *yyss1 = yyss;
    1003          YYSTYPE *yyvs1 = yyvs;
    1004  
    1005          /* Each stack pointer address is followed by the size of the
    1006             data in use in that stack, in bytes.  This used to be a
    1007             conditional around just the two extra args, but that might
    1008             be undefined if yyoverflow is a macro.  */
    1009          yyoverflow (YY_("memory exhausted"),
    1010                      &yyss1, yysize * YYSIZEOF (*yyssp),
    1011                      &yyvs1, yysize * YYSIZEOF (*yyvsp),
    1012                      &yystacksize);
    1013          yyss = yyss1;
    1014          yyvs = yyvs1;
    1015        }
    1016  # else /* defined YYSTACK_RELOCATE */
    1017        /* Extend the stack our own way.  */
    1018        if (YYMAXDEPTH <= yystacksize)
    1019          goto yyexhaustedlab;
    1020        yystacksize *= 2;
    1021        if (YYMAXDEPTH < yystacksize)
    1022          yystacksize = YYMAXDEPTH;
    1023  
    1024        {
    1025          yy_state_t *yyss1 = yyss;
    1026          union yyalloc *yyptr =
    1027            YY_CAST (union yyalloc *,
    1028                     YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize))));
    1029          if (! yyptr)
    1030            goto yyexhaustedlab;
    1031          YYSTACK_RELOCATE (yyss_alloc, yyss);
    1032          YYSTACK_RELOCATE (yyvs_alloc, yyvs);
    1033  #  undef YYSTACK_RELOCATE
    1034          if (yyss1 != yyssa)
    1035            YYSTACK_FREE (yyss1);
    1036        }
    1037  # endif
    1038  
    1039        yyssp = yyss + yysize - 1;
    1040        yyvsp = yyvs + yysize - 1;
    1041  
    1042        YY_IGNORE_USELESS_CAST_BEGIN
    1043        YYDPRINTF ((stderr, "Stack size increased to %ld\n",
    1044                    YY_CAST (long, yystacksize)));
    1045        YY_IGNORE_USELESS_CAST_END
    1046  
    1047        if (yyss + yystacksize - 1 <= yyssp)
    1048          YYABORT;
    1049      }
    1050  #endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */
    1051  
    1052    if (yystate == YYFINAL)
    1053      YYACCEPT;
    1054  
    1055    goto yybackup;
    1056  
    1057  
    1058  /*-----------.
    1059  | yybackup.  |
    1060  `-----------*/
    1061  yybackup:
    1062    /* Do appropriate processing given the current state.  Read a
    1063       lookahead token if we need one and don't already have one.  */
    1064  
    1065    /* First try to decide what to do without reference to lookahead token.  */
    1066    yyn = yypact[yystate];
    1067    if (yypact_value_is_default (yyn))
    1068      goto yydefault;
    1069  
    1070    /* Not known => get a lookahead token if don't already have one.  */
    1071  
    1072    /* YYCHAR is either empty, or end-of-input, or a valid lookahead.  */
    1073    if (yychar == YYEMPTY)
    1074      {
    1075        YYDPRINTF ((stderr, "Reading a token\n"));
    1076        yychar = yylex ();
    1077      }
    1078  
    1079    if (yychar <= YYEOF)
    1080      {
    1081        yychar = YYEOF;
    1082        yytoken = YYSYMBOL_YYEOF;
    1083        YYDPRINTF ((stderr, "Now at end of input.\n"));
    1084      }
    1085    else if (yychar == YYerror)
    1086      {
    1087        /* The scanner already issued an error message, process directly
    1088           to error recovery.  But do not keep the error token as
    1089           lookahead, it is too special and may lead us to an endless
    1090           loop in error recovery. */
    1091        yychar = YYUNDEF;
    1092        yytoken = YYSYMBOL_YYerror;
    1093        goto yyerrlab1;
    1094      }
    1095    else
    1096      {
    1097        yytoken = YYTRANSLATE (yychar);
    1098        YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
    1099      }
    1100  
    1101    /* If the proper action on seeing token YYTOKEN is to reduce or to
    1102       detect an error, take that action.  */
    1103    yyn += yytoken;
    1104    if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
    1105      goto yydefault;
    1106    yyn = yytable[yyn];
    1107    if (yyn <= 0)
    1108      {
    1109        if (yytable_value_is_error (yyn))
    1110          goto yyerrlab;
    1111        yyn = -yyn;
    1112        goto yyreduce;
    1113      }
    1114  
    1115    /* Count tokens shifted since error; after three, turn off error
    1116       status.  */
    1117    if (yyerrstatus)
    1118      yyerrstatus--;
    1119  
    1120    /* Shift the lookahead token.  */
    1121    YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
    1122    yystate = yyn;
    1123    YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
    1124    *++yyvsp = yylval;
    1125    YY_IGNORE_MAYBE_UNINITIALIZED_END
    1126  
    1127    /* Discard the shifted token.  */
    1128    yychar = YYEMPTY;
    1129    goto yynewstate;
    1130  
    1131  
    1132  /*-----------------------------------------------------------.
    1133  | yydefault -- do the default action for the current state.  |
    1134  `-----------------------------------------------------------*/
    1135  yydefault:
    1136    yyn = yydefact[yystate];
    1137    if (yyn == 0)
    1138      goto yyerrlab;
    1139    goto yyreduce;
    1140  
    1141  
    1142  /*-----------------------------.
    1143  | yyreduce -- do a reduction.  |
    1144  `-----------------------------*/
    1145  yyreduce:
    1146    /* yyn is the number of a rule to reduce with.  */
    1147    yylen = yyr2[yyn];
    1148  
    1149    /* If YYLEN is nonzero, implement the default value of the action:
    1150       '$$ = $1'.
    1151  
    1152       Otherwise, the following line sets YYVAL to garbage.
    1153       This behavior is undocumented and Bison
    1154       users should not rely upon it.  Assigning to YYVAL
    1155       unconditionally makes the parser a bit smaller, and it avoids a
    1156       GCC warning that YYVAL may be used uninitialized.  */
    1157    yyval = yyvsp[1-yylen];
    1158  
    1159  
    1160    YY_REDUCE_PRINT (yyn);
    1161    switch (yyn)
    1162      {
    1163    case 3: /* doc: doc NEWLINE  */
    1164  #line 40 "parse_y.y"
    1165                {
    1166      printf("\n");
    1167      ++line;
    1168  }
    1169  #line 1170 "parse_y.c"
    1170      break;
    1171  
    1172    case 4: /* doc: doc stuff NEWLINE  */
    1173  #line 44 "parse_y.y"
    1174                      {
    1175      if (strlen((yyvsp[-1].string)) > (PAPER_WIDTH-(indent ? strlen(INDENT_STRING):0))) {
    1176  	yyerror("line too long");
    1177      }
    1178      printf("%s%s\n", indent ? INDENT_STRING:"", (yyvsp[-1].string));
    1179      free((yyvsp[-1].string));
    1180      indent = 1;
    1181      ++line;
    1182  }
    1183  #line 1184 "parse_y.c"
    1184      break;
    1185  
    1186    case 5: /* doc: doc stuff RIGHT stuff NEWLINE  */
    1187  #line 53 "parse_y.y"
    1188                                  {
    1189      char fixed[PAPER_WIDTH+1];
    1190      int len;
    1191  
    1192      len = PAPER_WIDTH-(strlen((yyvsp[-3].string))+strlen((yyvsp[-1].string)));
    1193  
    1194      if (len >= 0) {
    1195  	memset(fixed, ' ', len);
    1196  	fixed[len] = '\0';
    1197      } else {
    1198  	yyerror("line too wide");
    1199  	fixed[0] = '\0';
    1200      }
    1201      printf("%s%s%s\n", (yyvsp[-3].string), fixed, (yyvsp[-1].string));
    1202      free((yyvsp[-3].string));
    1203      free((yyvsp[-1].string));
    1204      indent = 1;
    1205      ++line;
    1206  }
    1207  #line 1208 "parse_y.c"
    1208      break;
    1209  
    1210    case 6: /* doc: doc stuff RIGHT stuff RIGHT stuff NEWLINE  */
    1211  #line 72 "parse_y.y"
    1212                                              {
    1213      char fixed[PAPER_WIDTH+1];
    1214      int len, l;
    1215  
    1216      len = PAPER_WIDTH-(strlen((yyvsp[-5].string))+strlen((yyvsp[-3].string)));
    1217  
    1218      if (len < 0) {
    1219  	len = 0;
    1220  	yyerror("line too wide");
    1221      }
    1222  
    1223      l = len/2;
    1224      memset(fixed, ' ', l);
    1225      fixed[l] = '\0';
    1226      printf("%s%s%s", (yyvsp[-5].string), fixed, (yyvsp[-3].string));
    1227      free((yyvsp[-5].string));
    1228      free((yyvsp[-3].string));
    1229  
    1230      l = (len+1)/2;
    1231      memset(fixed, ' ', l);
    1232      fixed[l] = '\0';
    1233      printf("%s%s\n", fixed, (yyvsp[-1].string));
    1234      free((yyvsp[-1].string));
    1235  
    1236      indent = 1;
    1237      ++line;
    1238  }
    1239  #line 1240 "parse_y.c"
    1240      break;
    1241  
    1242    case 7: /* doc: doc stuff RIGHT stuff RIGHT stuff NEWLINE  */
    1243  #line 99 "parse_y.y"
    1244                                              {
    1245      char fixed[PAPER_WIDTH+1];
    1246      int len, l;
    1247  
    1248      len = PAPER_WIDTH-(strlen((yyvsp[-5].string))+strlen((yyvsp[-3].string)));
    1249  
    1250      if (len < 0) {
    1251  	len = 0;
    1252  	yyerror("line too wide");
    1253      }
    1254  
    1255      l = len/2;
    1256      memset(fixed, ' ', l);
    1257      fixed[l] = '\0';
    1258      printf("%s%s%s", (yyvsp[-5].string), fixed, (yyvsp[-3].string));
    1259      free((yyvsp[-5].string));
    1260      free((yyvsp[-3].string));
    1261  
    1262      l = (len+1)/2;
    1263      memset(fixed, ' ', l);
    1264      fixed[l] = '\0';
    1265      printf("%s%s\n", fixed, (yyvsp[-1].string));
    1266      free((yyvsp[-1].string));
    1267  
    1268      indent = 1;
    1269      ++line;
    1270  }
    1271  #line 1272 "parse_y.c"
    1272      break;
    1273  
    1274    case 8: /* stuff: %empty  */
    1275  #line 128 "parse_y.y"
    1276         {
    1277      (yyval.string) = strdup("");
    1278  }
    1279  #line 1280 "parse_y.c"
    1280      break;
    1281  
    1282    case 9: /* stuff: stuff text  */
    1283  #line 131 "parse_y.y"
    1284               {
    1285      (yyval.string) = malloc(strlen((yyvsp[-1].string))+strlen((yyvsp[0].string))+1);
    1286      sprintf((yyval.string),"%s%s", (yyvsp[-1].string), (yyvsp[0].string));
    1287      free((yyvsp[-1].string));
    1288      free((yyvsp[0].string));
    1289  }
    1290  #line 1291 "parse_y.c"
    1291      break;
    1292  
    1293    case 10: /* text: CHAR  */
    1294  #line 139 "parse_y.y"
    1295             {
    1296      (yyval.string) = strdup(yytext);
    1297  }
    1298  #line 1299 "parse_y.c"
    1299      break;
    1300  
    1301    case 11: /* text: text CHAR  */
    1302  #line 142 "parse_y.y"
    1303              {
    1304      (yyval.string) = malloc(strlen((yyvsp[-1].string))+2);
    1305      sprintf((yyval.string),"%s%s", (yyvsp[-1].string), yytext);
    1306      free((yyvsp[-1].string));
    1307  }
    1308  #line 1309 "parse_y.c"
    1309      break;
    1310  
    1311    case 12: /* text: NO_INDENT  */
    1312  #line 147 "parse_y.y"
    1313              {
    1314      (yyval.string) = strdup("");
    1315      indent = 0;
    1316  }
    1317  #line 1318 "parse_y.c"
    1318      break;
    1319  
    1320    case 13: /* text: HASH  */
    1321  #line 151 "parse_y.y"
    1322         {
    1323      (yyval.string) = strdup("#");
    1324  }
    1325  #line 1326 "parse_y.c"
    1326      break;
    1327  
    1328    case 14: /* text: LABEL  */
    1329  #line 154 "parse_y.y"
    1330          {
    1331      if (((yyval.string) = get_label(yytext)) == NULL) {
    1332  	set_label(yytext, last_label);
    1333  	(yyval.string) = strdup("");
    1334      }
    1335  }
    1336  #line 1337 "parse_y.c"
    1337      break;
    1338  
    1339    case 15: /* text: NEW_COUNTER  */
    1340  #line 160 "parse_y.y"
    1341                {
    1342      (yyval.string) = new_counter(yytext);
    1343  }
    1344  #line 1345 "parse_y.c"
    1345      break;
    1346  
    1347  
    1348  #line 1349 "parse_y.c"
    1349  
    1350        default: break;
    1351      }
    1352    /* User semantic actions sometimes alter yychar, and that requires
    1353       that yytoken be updated with the new translation.  We take the
    1354       approach of translating immediately before every use of yytoken.
    1355       One alternative is translating here after every semantic action,
    1356       but that translation would be missed if the semantic action invokes
    1357       YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
    1358       if it invokes YYBACKUP.  In the case of YYABORT or YYACCEPT, an
    1359       incorrect destructor might then be invoked immediately.  In the
    1360       case of YYERROR or YYBACKUP, subsequent parser actions might lead
    1361       to an incorrect destructor call or verbose syntax error message
    1362       before the lookahead is translated.  */
    1363    YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc);
    1364  
    1365    YYPOPSTACK (yylen);
    1366    yylen = 0;
    1367  
    1368    *++yyvsp = yyval;
    1369  
    1370    /* Now 'shift' the result of the reduction.  Determine what state
    1371       that goes to, based on the state we popped back to and the rule
    1372       number reduced by.  */
    1373    {
    1374      const int yylhs = yyr1[yyn] - YYNTOKENS;
    1375      const int yyi = yypgoto[yylhs] + *yyssp;
    1376      yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp
    1377                 ? yytable[yyi]
    1378                 : yydefgoto[yylhs]);
    1379    }
    1380  
    1381    goto yynewstate;
    1382  
    1383  
    1384  /*--------------------------------------.
    1385  | yyerrlab -- here on detecting error.  |
    1386  `--------------------------------------*/
    1387  yyerrlab:
    1388    /* Make sure we have latest lookahead translation.  See comments at
    1389       user semantic actions for why this is necessary.  */
    1390    yytoken = yychar == YYEMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar);
    1391    /* If not already recovering from an error, report this error.  */
    1392    if (!yyerrstatus)
    1393      {
    1394        ++yynerrs;
    1395        yyerror (YY_("syntax error"));
    1396      }
    1397  
    1398    if (yyerrstatus == 3)
    1399      {
    1400        /* If just tried and failed to reuse lookahead token after an
    1401           error, discard it.  */
    1402  
    1403        if (yychar <= YYEOF)
    1404          {
    1405            /* Return failure if at end of input.  */
    1406            if (yychar == YYEOF)
    1407              YYABORT;
    1408          }
    1409        else
    1410          {
    1411            yydestruct ("Error: discarding",
    1412                        yytoken, &yylval);
    1413            yychar = YYEMPTY;
    1414          }
    1415      }
    1416  
    1417    /* Else will try to reuse lookahead token after shifting the error
    1418       token.  */
    1419    goto yyerrlab1;
    1420  
    1421  
    1422  /*---------------------------------------------------.
    1423  | yyerrorlab -- error raised explicitly by YYERROR.  |
    1424  `---------------------------------------------------*/
    1425  yyerrorlab:
    1426    /* Pacify compilers when the user code never invokes YYERROR and the
    1427       label yyerrorlab therefore never appears in user code.  */
    1428    if (0)
    1429      YYERROR;
    1430  
    1431    /* Do not reclaim the symbols of the rule whose action triggered
    1432       this YYERROR.  */
    1433    YYPOPSTACK (yylen);
    1434    yylen = 0;
    1435    YY_STACK_PRINT (yyss, yyssp);
    1436    yystate = *yyssp;
    1437    goto yyerrlab1;
    1438  
    1439  
    1440  /*-------------------------------------------------------------.
    1441  | yyerrlab1 -- common code for both syntax error and YYERROR.  |
    1442  `-------------------------------------------------------------*/
    1443  yyerrlab1:
    1444    yyerrstatus = 3;      /* Each real token shifted decrements this.  */
    1445  
    1446    /* Pop stack until we find a state that shifts the error token.  */
    1447    for (;;)
    1448      {
    1449        yyn = yypact[yystate];
    1450        if (!yypact_value_is_default (yyn))
    1451          {
    1452            yyn += YYSYMBOL_YYerror;
    1453            if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror)
    1454              {
    1455                yyn = yytable[yyn];
    1456                if (0 < yyn)
    1457                  break;
    1458              }
    1459          }
    1460  
    1461        /* Pop the current state because it cannot handle the error token.  */
    1462        if (yyssp == yyss)
    1463          YYABORT;
    1464  
    1465  
    1466        yydestruct ("Error: popping",
    1467                    YY_ACCESSING_SYMBOL (yystate), yyvsp);
    1468        YYPOPSTACK (1);
    1469        yystate = *yyssp;
    1470        YY_STACK_PRINT (yyss, yyssp);
    1471      }
    1472  
    1473    YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
    1474    *++yyvsp = yylval;
    1475    YY_IGNORE_MAYBE_UNINITIALIZED_END
    1476  
    1477  
    1478    /* Shift the error token.  */
    1479    YY_SYMBOL_PRINT ("Shifting", YY_ACCESSING_SYMBOL (yyn), yyvsp, yylsp);
    1480  
    1481    yystate = yyn;
    1482    goto yynewstate;
    1483  
    1484  
    1485  /*-------------------------------------.
    1486  | yyacceptlab -- YYACCEPT comes here.  |
    1487  `-------------------------------------*/
    1488  yyacceptlab:
    1489    yyresult = 0;
    1490    goto yyreturn;
    1491  
    1492  
    1493  /*-----------------------------------.
    1494  | yyabortlab -- YYABORT comes here.  |
    1495  `-----------------------------------*/
    1496  yyabortlab:
    1497    yyresult = 1;
    1498    goto yyreturn;
    1499  
    1500  
    1501  #if !defined yyoverflow
    1502  /*-------------------------------------------------.
    1503  | yyexhaustedlab -- memory exhaustion comes here.  |
    1504  `-------------------------------------------------*/
    1505  yyexhaustedlab:
    1506    yyerror (YY_("memory exhausted"));
    1507    yyresult = 2;
    1508    goto yyreturn;
    1509  #endif
    1510  
    1511  
    1512  /*-------------------------------------------------------.
    1513  | yyreturn -- parsing is finished, clean up and return.  |
    1514  `-------------------------------------------------------*/
    1515  yyreturn:
    1516    if (yychar != YYEMPTY)
    1517      {
    1518        /* Make sure we have latest lookahead translation.  See comments at
    1519           user semantic actions for why this is necessary.  */
    1520        yytoken = YYTRANSLATE (yychar);
    1521        yydestruct ("Cleanup: discarding lookahead",
    1522                    yytoken, &yylval);
    1523      }
    1524    /* Do not reclaim the symbols of the rule whose action triggered
    1525       this YYABORT or YYACCEPT.  */
    1526    YYPOPSTACK (yylen);
    1527    YY_STACK_PRINT (yyss, yyssp);
    1528    while (yyssp != yyss)
    1529      {
    1530        yydestruct ("Cleanup: popping",
    1531                    YY_ACCESSING_SYMBOL (+*yyssp), yyvsp);
    1532        YYPOPSTACK (1);
    1533      }
    1534  #ifndef yyoverflow
    1535    if (yyss != yyssa)
    1536      YYSTACK_FREE (yyss);
    1537  #endif
    1538  
    1539    return yyresult;
    1540  }
    1541  
    1542  #line 165 "parse_y.y"
    1543  
    1544  
    1545  typedef struct node_s {
    1546      struct node_s *left, *right;
    1547      const char *key;
    1548      char *value;
    1549  } *node_t;
    1550  
    1551  node_t label_root = NULL;
    1552  node_t counter_root = NULL;
    1553  
    1554  static const char *find_key(node_t root, const char *key)
    1555  {
    1556      while (root) {
    1557  	int cmp = strcmp(key, root->key);
    1558  
    1559  	if (cmp > 0) {
    1560  	    root = root->right;
    1561  	} else if (cmp) {
    1562  	    root = root->left;
    1563  	} else {
    1564  	    return root->value;
    1565  	}
    1566      }
    1567      return NULL;
    1568  }
    1569  
    1570  static node_t set_key(node_t root, const char *key, const char *value)
    1571  {
    1572      if (root) {
    1573  	int cmp = strcmp(key, root->key);
    1574  	if (cmp > 0) {
    1575  	    root->right = set_key(root->right, key, value);
    1576  	} else if (cmp) {
    1577  	    root->left = set_key(root->left, key, value);
    1578  	} else {
    1579  	    free(root->value);
    1580  	    root->value = strdup(value);
    1581  	}
    1582      } else {
    1583  	root = malloc(sizeof(struct node_s));
    1584  	root->right = root->left = NULL;
    1585  	root->key = strdup(key);
    1586  	root->value = strdup(value);
    1587      }
    1588      return root;
    1589  }
    1590  
    1591  void yyerror(const char *x)
    1592  {
    1593      fprintf(stderr, "line %d: %s\n", line, x);
    1594  }
    1595  
    1596  char *get_label(const char *label)
    1597  {
    1598      const char *found = find_key(label_root, label);
    1599  
    1600      if (found) {
    1601  	return strdup(found);
    1602      }
    1603      return NULL;
    1604  }
    1605  
    1606  void set_label(const char *label, const char *target)
    1607  {
    1608      if (target == NULL) {
    1609  	yyerror("no hanging value for label");
    1610  	target = "<??" ">";	/* avoid trigraph warning */
    1611      }
    1612      label_root = set_key(label_root, label, target);
    1613  }
    1614  
    1615  char *new_counter(const char *key)
    1616  {
    1617      int i=0, j, ndollars = 0;
    1618      const char *old;
    1619      char *new;
    1620  
    1621      if (key[i++] != '#') {
    1622  	yyerror("bad index");
    1623  	return strdup("<???" ">");	/* avoid trigraph warning */
    1624      }
    1625  
    1626      while (key[i] == '$') {
    1627  	++ndollars;
    1628  	++i;
    1629      }
    1630  
    1631      key += i;
    1632      old = find_key(counter_root, key);
    1633      new = malloc(20*ndollars);
    1634  
    1635      if (old) {
    1636  	for (j=0; ndollars > 1 && old[j]; ) {
    1637  	    if (old[j++] == '.' && --ndollars <= 0) {
    1638  		break;
    1639  	    }
    1640  	}
    1641  	if (j) {
    1642  	    strncpy(new, old, j);
    1643  	}
    1644  	if (old[j]) {
    1645  	    i = atoi(old+j);
    1646  	} else {
    1647  	    new[j++] = '.';
    1648  	    i = 0;
    1649  	}
    1650      } else {
    1651  	j=0;
    1652  	while (--ndollars > 0) {
    1653  	    new[j++] = '0';
    1654  	    new[j++] = '.';
    1655  	}
    1656  	i = 0;
    1657      }
    1658      new[j] = '\0';
    1659      sprintf(new+j, "%d", ++i);
    1660  
    1661      counter_root = set_key(counter_root, key, new);
    1662  
    1663      if (last_label) {
    1664  	free(last_label);
    1665      }
    1666      last_label = strdup(new);
    1667  
    1668      return new;
    1669  }
    1670  
    1671  int
    1672  main(void)
    1673  {
    1674      return yyparse();
    1675  }