Blame doc/specs/parse_y.c

Packit 7e982e
/* A Bison parser, made by GNU Bison 2.7.  */
Packit 7e982e
Packit 7e982e
/* Bison implementation for Yacc-like parsers in C
Packit 7e982e
   
Packit 7e982e
      Copyright (C) 1984, 1989-1990, 2000-2012 Free Software Foundation, Inc.
Packit 7e982e
   
Packit 7e982e
   This program is free software: you can redistribute it and/or modify
Packit 7e982e
   it under the terms of the GNU General Public License as published by
Packit 7e982e
   the Free Software Foundation, either version 3 of the License, or
Packit 7e982e
   (at your option) any later version.
Packit 7e982e
   
Packit 7e982e
   This program is distributed in the hope that it will be useful,
Packit 7e982e
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 7e982e
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit 7e982e
   GNU General Public License for more details.
Packit 7e982e
   
Packit 7e982e
   You should have received a copy of the GNU General Public License
Packit 7e982e
   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
Packit 7e982e
Packit 7e982e
/* As a special exception, you may create a larger work that contains
Packit 7e982e
   part or all of the Bison parser skeleton and distribute that work
Packit 7e982e
   under terms of your choice, so long as that work isn't itself a
Packit 7e982e
   parser generator using the skeleton or a modified version thereof
Packit 7e982e
   as a parser skeleton.  Alternatively, if you modify or redistribute
Packit 7e982e
   the parser skeleton itself, you may (at your option) remove this
Packit 7e982e
   special exception, which will cause the skeleton and the resulting
Packit 7e982e
   Bison output files to be licensed under the GNU General Public
Packit 7e982e
   License without this special exception.
Packit 7e982e
   
Packit 7e982e
   This special exception was added by the Free Software Foundation in
Packit 7e982e
   version 2.2 of Bison.  */
Packit 7e982e
Packit 7e982e
/* C LALR(1) parser skeleton written by Richard Stallman, by
Packit 7e982e
   simplifying the original so-called "semantic" parser.  */
Packit 7e982e
Packit 7e982e
/* All symbols defined below should begin with yy or YY, to avoid
Packit 7e982e
   infringing on user name space.  This should be done even for local
Packit 7e982e
   variables, as they might otherwise be expanded by user macros.
Packit 7e982e
   There are some unavoidable exceptions within include files to
Packit 7e982e
   define necessary library symbols; they are noted "INFRINGES ON
Packit 7e982e
   USER NAME SPACE" below.  */
Packit 7e982e
Packit 7e982e
/* Identify Bison output.  */
Packit 7e982e
#define YYBISON 1
Packit 7e982e
Packit 7e982e
/* Bison version.  */
Packit 7e982e
#define YYBISON_VERSION "2.7"
Packit 7e982e
Packit 7e982e
/* Skeleton name.  */
Packit 7e982e
#define YYSKELETON_NAME "yacc.c"
Packit 7e982e
Packit 7e982e
/* Pure parsers.  */
Packit 7e982e
#define YYPURE 0
Packit 7e982e
Packit 7e982e
/* Push parsers.  */
Packit 7e982e
#define YYPUSH 0
Packit 7e982e
Packit 7e982e
/* Pull parsers.  */
Packit 7e982e
#define YYPULL 1
Packit 7e982e
Packit 7e982e
Packit 7e982e
Packit 7e982e
Packit 7e982e
/* Copy the first part of user declarations.  */
Packit 7e982e
/* Line 371 of yacc.c  */
Packit 7e982e
#line 2 "parse_y.y"
Packit 7e982e
Packit 7e982e
#ifdef HAVE_CONFIG_H
Packit 7e982e
#  include <config.h>
Packit 7e982e
#endif
Packit 7e982e
Packit 7e982e
#include <stdio.h>
Packit 7e982e
#include <stdlib.h>
Packit 7e982e
#include <string.h>
Packit 7e982e
Packit 7e982e
#define MAXLINE  1000
Packit 7e982e
#define INDENT_STRING "  "
Packit 7e982e
#define PAPER_WIDTH   74
Packit 7e982e
Packit 7e982e
    int indent=0;
Packit 7e982e
    int line=1;
Packit 7e982e
    char *last_label=NULL;
Packit 7e982e
Packit 7e982e
    extern int yylex(void);
Packit 7e982e
    extern char *yytext;
Packit 7e982e
    extern void yyerror(const char *x);
Packit 7e982e
    extern char *get_label(const char *label);
Packit 7e982e
    extern void set_label(const char *label, const char *target);
Packit 7e982e
    char *new_counter(const char *key);
Packit 7e982e
Packit 7e982e
/* Line 371 of yacc.c  */
Packit 7e982e
#line 93 "parse_y.c"
Packit 7e982e
Packit 7e982e
# ifndef YY_NULL
Packit 7e982e
#  if defined __cplusplus && 201103L <= __cplusplus
Packit 7e982e
#   define YY_NULL nullptr
Packit 7e982e
#  else
Packit 7e982e
#   define YY_NULL 0
Packit 7e982e
#  endif
Packit 7e982e
# endif
Packit 7e982e
Packit 7e982e
/* Enabling verbose error messages.  */
Packit 7e982e
#ifdef YYERROR_VERBOSE
Packit 7e982e
# undef YYERROR_VERBOSE
Packit 7e982e
# define YYERROR_VERBOSE 1
Packit 7e982e
#else
Packit 7e982e
# define YYERROR_VERBOSE 0
Packit 7e982e
#endif
Packit 7e982e
Packit 7e982e
/* In a future release of Bison, this section will be replaced
Packit 7e982e
   by #include "y.tab.h".  */
Packit 7e982e
#ifndef YY_YY_PARSE_Y_H_INCLUDED
Packit 7e982e
# define YY_YY_PARSE_Y_H_INCLUDED
Packit 7e982e
/* Enabling traces.  */
Packit 7e982e
#ifndef YYDEBUG
Packit 7e982e
# define YYDEBUG 0
Packit 7e982e
#endif
Packit 7e982e
#if YYDEBUG
Packit 7e982e
extern int yydebug;
Packit 7e982e
#endif
Packit 7e982e
Packit 7e982e
/* Tokens.  */
Packit 7e982e
#ifndef YYTOKENTYPE
Packit 7e982e
# define YYTOKENTYPE
Packit 7e982e
   /* Put the tokens into the symbol table, so that GDB and other debuggers
Packit 7e982e
      know about them.  */
Packit 7e982e
   enum yytokentype {
Packit 7e982e
     NEW_COUNTER = 258,
Packit 7e982e
     LABEL = 259,
Packit 7e982e
     HASH = 260,
Packit 7e982e
     CHAR = 261,
Packit 7e982e
     NEWLINE = 262,
Packit 7e982e
     NO_INDENT = 263,
Packit 7e982e
     RIGHT = 264
Packit 7e982e
   };
Packit 7e982e
#endif
Packit 7e982e
/* Tokens.  */
Packit 7e982e
#define NEW_COUNTER 258
Packit 7e982e
#define LABEL 259
Packit 7e982e
#define HASH 260
Packit 7e982e
#define CHAR 261
Packit 7e982e
#define NEWLINE 262
Packit 7e982e
#define NO_INDENT 263
Packit 7e982e
#define RIGHT 264
Packit 7e982e
Packit 7e982e
Packit 7e982e
Packit 7e982e
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
Packit 7e982e
typedef union YYSTYPE
Packit 7e982e
{
Packit 7e982e
/* Line 387 of yacc.c  */
Packit 7e982e
#line 27 "parse_y.y"
Packit 7e982e
Packit 7e982e
    int def;
Packit 7e982e
    char *string;
Packit 7e982e
Packit 7e982e
Packit 7e982e
/* Line 387 of yacc.c  */
Packit 7e982e
#line 160 "parse_y.c"
Packit 7e982e
} YYSTYPE;
Packit 7e982e
# define YYSTYPE_IS_TRIVIAL 1
Packit 7e982e
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
Packit 7e982e
# define YYSTYPE_IS_DECLARED 1
Packit 7e982e
#endif
Packit 7e982e
Packit 7e982e
extern YYSTYPE yylval;
Packit 7e982e
Packit 7e982e
#ifdef YYPARSE_PARAM
Packit 7e982e
#if defined __STDC__ || defined __cplusplus
Packit 7e982e
int yyparse (void *YYPARSE_PARAM);
Packit 7e982e
#else
Packit 7e982e
int yyparse ();
Packit 7e982e
#endif
Packit 7e982e
#else /* ! YYPARSE_PARAM */
Packit 7e982e
#if defined __STDC__ || defined __cplusplus
Packit 7e982e
int yyparse (void);
Packit 7e982e
#else
Packit 7e982e
int yyparse ();
Packit 7e982e
#endif
Packit 7e982e
#endif /* ! YYPARSE_PARAM */
Packit 7e982e
Packit 7e982e
#endif /* !YY_YY_PARSE_Y_H_INCLUDED  */
Packit 7e982e
Packit 7e982e
/* Copy the second part of user declarations.  */
Packit 7e982e
Packit 7e982e
/* Line 390 of yacc.c  */
Packit 7e982e
#line 188 "parse_y.c"
Packit 7e982e
Packit 7e982e
#ifdef short
Packit 7e982e
# undef short
Packit 7e982e
#endif
Packit 7e982e
Packit 7e982e
#ifdef YYTYPE_UINT8
Packit 7e982e
typedef YYTYPE_UINT8 yytype_uint8;
Packit 7e982e
#else
Packit 7e982e
typedef unsigned char yytype_uint8;
Packit 7e982e
#endif
Packit 7e982e
Packit 7e982e
#ifdef YYTYPE_INT8
Packit 7e982e
typedef YYTYPE_INT8 yytype_int8;
Packit 7e982e
#elif (defined __STDC__ || defined __C99__FUNC__ \
Packit 7e982e
     || defined __cplusplus || defined _MSC_VER)
Packit 7e982e
typedef signed char yytype_int8;
Packit 7e982e
#else
Packit 7e982e
typedef short int yytype_int8;
Packit 7e982e
#endif
Packit 7e982e
Packit 7e982e
#ifdef YYTYPE_UINT16
Packit 7e982e
typedef YYTYPE_UINT16 yytype_uint16;
Packit 7e982e
#else
Packit 7e982e
typedef unsigned short int yytype_uint16;
Packit 7e982e
#endif
Packit 7e982e
Packit 7e982e
#ifdef YYTYPE_INT16
Packit 7e982e
typedef YYTYPE_INT16 yytype_int16;
Packit 7e982e
#else
Packit 7e982e
typedef short int yytype_int16;
Packit 7e982e
#endif
Packit 7e982e
Packit 7e982e
#ifndef YYSIZE_T
Packit 7e982e
# ifdef __SIZE_TYPE__
Packit 7e982e
#  define YYSIZE_T __SIZE_TYPE__
Packit 7e982e
# elif defined size_t
Packit 7e982e
#  define YYSIZE_T size_t
Packit 7e982e
# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
Packit 7e982e
     || defined __cplusplus || defined _MSC_VER)
Packit 7e982e
#  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
Packit 7e982e
#  define YYSIZE_T size_t
Packit 7e982e
# else
Packit 7e982e
#  define YYSIZE_T unsigned int
Packit 7e982e
# endif
Packit 7e982e
#endif
Packit 7e982e
Packit 7e982e
#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
Packit 7e982e
Packit 7e982e
#ifndef YY_
Packit 7e982e
# if defined YYENABLE_NLS && YYENABLE_NLS
Packit 7e982e
#  if ENABLE_NLS
Packit 7e982e
#   include <libintl.h> /* INFRINGES ON USER NAME SPACE */
Packit 7e982e
#   define YY_(Msgid) dgettext ("bison-runtime", Msgid)
Packit 7e982e
#  endif
Packit 7e982e
# endif
Packit 7e982e
# ifndef YY_
Packit 7e982e
#  define YY_(Msgid) Msgid
Packit 7e982e
# endif
Packit 7e982e
#endif
Packit 7e982e
Packit 7e982e
/* Suppress unused-variable warnings by "using" E.  */
Packit 7e982e
#if ! defined lint || defined __GNUC__
Packit 7e982e
# define YYUSE(E) ((void) (E))
Packit 7e982e
#else
Packit 7e982e
# define YYUSE(E) /* empty */
Packit 7e982e
#endif
Packit 7e982e
Packit 7e982e
/* Identity function, used to suppress warnings about constant conditions.  */
Packit 7e982e
#ifndef lint
Packit 7e982e
# define YYID(N) (N)
Packit 7e982e
#else
Packit 7e982e
#if (defined __STDC__ || defined __C99__FUNC__ \
Packit 7e982e
     || defined __cplusplus || defined _MSC_VER)
Packit 7e982e
static int
Packit 7e982e
YYID (int yyi)
Packit 7e982e
#else
Packit 7e982e
static int
Packit 7e982e
YYID (yyi)
Packit 7e982e
    int yyi;
Packit 7e982e
#endif
Packit 7e982e
{
Packit 7e982e
  return yyi;
Packit 7e982e
}
Packit 7e982e
#endif
Packit 7e982e
Packit 7e982e
#if ! defined yyoverflow || YYERROR_VERBOSE
Packit 7e982e
Packit 7e982e
/* The parser invokes alloca or malloc; define the necessary symbols.  */
Packit 7e982e
Packit 7e982e
# ifdef YYSTACK_USE_ALLOCA
Packit 7e982e
#  if YYSTACK_USE_ALLOCA
Packit 7e982e
#   ifdef __GNUC__
Packit 7e982e
#    define YYSTACK_ALLOC __builtin_alloca
Packit 7e982e
#   elif defined __BUILTIN_VA_ARG_INCR
Packit 7e982e
#    include <alloca.h> /* INFRINGES ON USER NAME SPACE */
Packit 7e982e
#   elif defined _AIX
Packit 7e982e
#    define YYSTACK_ALLOC __alloca
Packit 7e982e
#   elif defined _MSC_VER
Packit 7e982e
#    include <malloc.h> /* INFRINGES ON USER NAME SPACE */
Packit 7e982e
#    define alloca _alloca
Packit 7e982e
#   else
Packit 7e982e
#    define YYSTACK_ALLOC alloca
Packit 7e982e
#    if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
Packit 7e982e
     || defined __cplusplus || defined _MSC_VER)
Packit 7e982e
#     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
Packit 7e982e
      /* Use EXIT_SUCCESS as a witness for stdlib.h.  */
Packit 7e982e
#     ifndef EXIT_SUCCESS
Packit 7e982e
#      define EXIT_SUCCESS 0
Packit 7e982e
#     endif
Packit 7e982e
#    endif
Packit 7e982e
#   endif
Packit 7e982e
#  endif
Packit 7e982e
# endif
Packit 7e982e
Packit 7e982e
# ifdef YYSTACK_ALLOC
Packit 7e982e
   /* Pacify GCC's `empty if-body' warning.  */
Packit 7e982e
#  define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
Packit 7e982e
#  ifndef YYSTACK_ALLOC_MAXIMUM
Packit 7e982e
    /* The OS might guarantee only one guard page at the bottom of the stack,
Packit 7e982e
       and a page size can be as small as 4096 bytes.  So we cannot safely
Packit 7e982e
       invoke alloca (N) if N exceeds 4096.  Use a slightly smaller number
Packit 7e982e
       to allow for a few compiler-allocated temporary stack slots.  */
Packit 7e982e
#   define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
Packit 7e982e
#  endif
Packit 7e982e
# else
Packit 7e982e
#  define YYSTACK_ALLOC YYMALLOC
Packit 7e982e
#  define YYSTACK_FREE YYFREE
Packit 7e982e
#  ifndef YYSTACK_ALLOC_MAXIMUM
Packit 7e982e
#   define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
Packit 7e982e
#  endif
Packit 7e982e
#  if (defined __cplusplus && ! defined EXIT_SUCCESS \
Packit 7e982e
       && ! ((defined YYMALLOC || defined malloc) \
Packit 7e982e
	     && (defined YYFREE || defined free)))
Packit 7e982e
#   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
Packit 7e982e
#   ifndef EXIT_SUCCESS
Packit 7e982e
#    define EXIT_SUCCESS 0
Packit 7e982e
#   endif
Packit 7e982e
#  endif
Packit 7e982e
#  ifndef YYMALLOC
Packit 7e982e
#   define YYMALLOC malloc
Packit 7e982e
#   if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
Packit 7e982e
     || defined __cplusplus || defined _MSC_VER)
Packit 7e982e
void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
Packit 7e982e
#   endif
Packit 7e982e
#  endif
Packit 7e982e
#  ifndef YYFREE
Packit 7e982e
#   define YYFREE free
Packit 7e982e
#   if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
Packit 7e982e
     || defined __cplusplus || defined _MSC_VER)
Packit 7e982e
void free (void *); /* INFRINGES ON USER NAME SPACE */
Packit 7e982e
#   endif
Packit 7e982e
#  endif
Packit 7e982e
# endif
Packit 7e982e
#endif /* ! defined yyoverflow || YYERROR_VERBOSE */
Packit 7e982e
Packit 7e982e
Packit 7e982e
#if (! defined yyoverflow \
Packit 7e982e
     && (! defined __cplusplus \
Packit 7e982e
	 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
Packit 7e982e
Packit 7e982e
/* A type that is properly aligned for any stack member.  */
Packit 7e982e
union yyalloc
Packit 7e982e
{
Packit 7e982e
  yytype_int16 yyss_alloc;
Packit 7e982e
  YYSTYPE yyvs_alloc;
Packit 7e982e
};
Packit 7e982e
Packit 7e982e
/* The size of the maximum gap between one aligned stack and the next.  */
Packit 7e982e
# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
Packit 7e982e
Packit 7e982e
/* The size of an array large to enough to hold all stacks, each with
Packit 7e982e
   N elements.  */
Packit 7e982e
# define YYSTACK_BYTES(N) \
Packit 7e982e
     ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
Packit 7e982e
      + YYSTACK_GAP_MAXIMUM)
Packit 7e982e
Packit 7e982e
# define YYCOPY_NEEDED 1
Packit 7e982e
Packit 7e982e
/* Relocate STACK from its old location to the new one.  The
Packit 7e982e
   local variables YYSIZE and YYSTACKSIZE give the old and new number of
Packit 7e982e
   elements in the stack, and YYPTR gives the new location of the
Packit 7e982e
   stack.  Advance YYPTR to a properly aligned location for the next
Packit 7e982e
   stack.  */
Packit 7e982e
# define YYSTACK_RELOCATE(Stack_alloc, Stack)				\
Packit 7e982e
    do									\
Packit 7e982e
      {									\
Packit 7e982e
	YYSIZE_T yynewbytes;						\
Packit 7e982e
	YYCOPY (&yyptr->Stack_alloc, Stack, yysize);			\
Packit 7e982e
	Stack = &yyptr->Stack_alloc;					\
Packit 7e982e
	yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
Packit 7e982e
	yyptr += yynewbytes / sizeof (*yyptr);				\
Packit 7e982e
      }									\
Packit 7e982e
    while (YYID (0))
Packit 7e982e
Packit 7e982e
#endif
Packit 7e982e
Packit 7e982e
#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
Packit 7e982e
/* Copy COUNT objects from SRC to DST.  The source and destination do
Packit 7e982e
   not overlap.  */
Packit 7e982e
# ifndef YYCOPY
Packit 7e982e
#  if defined __GNUC__ && 1 < __GNUC__
Packit 7e982e
#   define YYCOPY(Dst, Src, Count) \
Packit 7e982e
      __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
Packit 7e982e
#  else
Packit 7e982e
#   define YYCOPY(Dst, Src, Count)              \
Packit 7e982e
      do                                        \
Packit 7e982e
        {                                       \
Packit 7e982e
          YYSIZE_T yyi;                         \
Packit 7e982e
          for (yyi = 0; yyi < (Count); yyi++)   \
Packit 7e982e
            (Dst)[yyi] = (Src)[yyi];            \
Packit 7e982e
        }                                       \
Packit 7e982e
      while (YYID (0))
Packit 7e982e
#  endif
Packit 7e982e
# endif
Packit 7e982e
#endif /* !YYCOPY_NEEDED */
Packit 7e982e
Packit 7e982e
/* YYFINAL -- State number of the termination state.  */
Packit 7e982e
#define YYFINAL  2
Packit 7e982e
/* YYLAST -- Last index in YYTABLE.  */
Packit 7e982e
#define YYLAST   27
Packit 7e982e
Packit 7e982e
/* YYNTOKENS -- Number of terminals.  */
Packit 7e982e
#define YYNTOKENS  10
Packit 7e982e
/* YYNNTS -- Number of nonterminals.  */
Packit 7e982e
#define YYNNTS  4
Packit 7e982e
/* YYNRULES -- Number of rules.  */
Packit 7e982e
#define YYNRULES  15
Packit 7e982e
/* YYNRULES -- Number of states.  */
Packit 7e982e
#define YYNSTATES  19
Packit 7e982e
Packit 7e982e
/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
Packit 7e982e
#define YYUNDEFTOK  2
Packit 7e982e
#define YYMAXUTOK   264
Packit 7e982e
Packit 7e982e
#define YYTRANSLATE(YYX)						\
Packit 7e982e
  ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
Packit 7e982e
Packit 7e982e
/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX.  */
Packit 7e982e
static const yytype_uint8 yytranslate[] =
Packit 7e982e
{
Packit 7e982e
       0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
Packit 7e982e
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
Packit 7e982e
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
Packit 7e982e
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
Packit 7e982e
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
Packit 7e982e
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
Packit 7e982e
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
Packit 7e982e
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
Packit 7e982e
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
Packit 7e982e
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
Packit 7e982e
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
Packit 7e982e
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
Packit 7e982e
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
Packit 7e982e
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
Packit 7e982e
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
Packit 7e982e
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
Packit 7e982e
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
Packit 7e982e
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
Packit 7e982e
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
Packit 7e982e
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
Packit 7e982e
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
Packit 7e982e
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
Packit 7e982e
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
Packit 7e982e
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
Packit 7e982e
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
Packit 7e982e
       2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
Packit 7e982e
       5,     6,     7,     8,     9
Packit 7e982e
};
Packit 7e982e
Packit 7e982e
#if YYDEBUG
Packit 7e982e
/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
Packit 7e982e
   YYRHS.  */
Packit 7e982e
static const yytype_uint8 yyprhs[] =
Packit 7e982e
{
Packit 7e982e
       0,     0,     3,     4,     7,    11,    17,    25,    33,    34,
Packit 7e982e
      37,    39,    42,    44,    46,    48
Packit 7e982e
};
Packit 7e982e
Packit 7e982e
/* YYRHS -- A `-1'-separated list of the rules' RHS.  */
Packit 7e982e
static const yytype_int8 yyrhs[] =
Packit 7e982e
{
Packit 7e982e
      11,     0,    -1,    -1,    11,     7,    -1,    11,    12,     7,
Packit 7e982e
      -1,    11,    12,     9,    12,     7,    -1,    11,    12,     9,
Packit 7e982e
      12,     9,    12,     7,    -1,    11,    12,     9,    12,     9,
Packit 7e982e
      12,     7,    -1,    -1,    12,    13,    -1,     6,    -1,    13,
Packit 7e982e
       6,    -1,     8,    -1,     5,    -1,     4,    -1,     3,    -1
Packit 7e982e
};
Packit 7e982e
Packit 7e982e
/* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
Packit 7e982e
static const yytype_uint8 yyrline[] =
Packit 7e982e
{
Packit 7e982e
       0,    39,    39,    40,    44,    53,    72,    99,   128,   131,
Packit 7e982e
     139,   142,   147,   151,   154,   160
Packit 7e982e
};
Packit 7e982e
#endif
Packit 7e982e
Packit 7e982e
#if YYDEBUG || YYERROR_VERBOSE || 0
Packit 7e982e
/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
Packit 7e982e
   First, the terminals, then, starting at YYNTOKENS, nonterminals.  */
Packit 7e982e
static const char *const yytname[] =
Packit 7e982e
{
Packit 7e982e
  "$end", "error", "$undefined", "NEW_COUNTER", "LABEL", "HASH", "CHAR",
Packit 7e982e
  "NEWLINE", "NO_INDENT", "RIGHT", "$accept", "doc", "stuff", "text", YY_NULL
Packit 7e982e
};
Packit 7e982e
#endif
Packit 7e982e
Packit 7e982e
# ifdef YYPRINT
Packit 7e982e
/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
Packit 7e982e
   token YYLEX-NUM.  */
Packit 7e982e
static const yytype_uint16 yytoknum[] =
Packit 7e982e
{
Packit 7e982e
       0,   256,   257,   258,   259,   260,   261,   262,   263,   264
Packit 7e982e
};
Packit 7e982e
# endif
Packit 7e982e
Packit 7e982e
/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
Packit 7e982e
static const yytype_uint8 yyr1[] =
Packit 7e982e
{
Packit 7e982e
       0,    10,    11,    11,    11,    11,    11,    11,    12,    12,
Packit 7e982e
      13,    13,    13,    13,    13,    13
Packit 7e982e
};
Packit 7e982e
Packit 7e982e
/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
Packit 7e982e
static const yytype_uint8 yyr2[] =
Packit 7e982e
{
Packit 7e982e
       0,     2,     0,     2,     3,     5,     7,     7,     0,     2,
Packit 7e982e
       1,     2,     1,     1,     1,     1
Packit 7e982e
};
Packit 7e982e
Packit 7e982e
/* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM.
Packit 7e982e
   Performed when YYTABLE doesn't specify something else to do.  Zero
Packit 7e982e
   means the default is an error.  */
Packit 7e982e
static const yytype_uint8 yydefact[] =
Packit 7e982e
{
Packit 7e982e
       2,     8,     1,     3,     0,    15,    14,    13,    10,     4,
Packit 7e982e
      12,     8,     9,     0,    11,     5,     8,     0,     6
Packit 7e982e
};
Packit 7e982e
Packit 7e982e
/* YYDEFGOTO[NTERM-NUM].  */
Packit 7e982e
static const yytype_int8 yydefgoto[] =
Packit 7e982e
{
Packit 7e982e
      -1,     1,     4,    12
Packit 7e982e
};
Packit 7e982e
Packit 7e982e
/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
Packit 7e982e
   STATE-NUM.  */
Packit 7e982e
#define YYPACT_NINF -3
Packit 7e982e
static const yytype_int8 yypact[] =
Packit 7e982e
{
Packit 7e982e
      -3,     0,    -3,    -3,     5,    -3,    -3,    -3,    -3,    -3,
Packit 7e982e
      -3,    -3,    17,    12,    -3,    -3,    -3,    -2,    -3
Packit 7e982e
};
Packit 7e982e
Packit 7e982e
/* YYPGOTO[NTERM-NUM].  */
Packit 7e982e
static const yytype_int8 yypgoto[] =
Packit 7e982e
{
Packit 7e982e
      -3,    -3,    11,    -3
Packit 7e982e
};
Packit 7e982e
Packit 7e982e
/* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
Packit 7e982e
   positive, shift that token.  If negative, reduce the rule which
Packit 7e982e
   number is the opposite.  If YYTABLE_NINF, syntax error.  */
Packit 7e982e
#define YYTABLE_NINF -1
Packit 7e982e
static const yytype_uint8 yytable[] =
Packit 7e982e
{
Packit 7e982e
       2,     5,     6,     7,     8,    18,    10,     3,     5,     6,
Packit 7e982e
       7,     8,     9,    10,    11,     5,     6,     7,     8,    15,
Packit 7e982e
      10,    16,    13,    14,     0,     0,     0,    17
Packit 7e982e
};
Packit 7e982e
Packit 7e982e
#define yypact_value_is_default(Yystate) \
Packit 7e982e
  (!!((Yystate) == (-3)))
Packit 7e982e
Packit 7e982e
#define yytable_value_is_error(Yytable_value) \
Packit 7e982e
  YYID (0)
Packit 7e982e
Packit 7e982e
static const yytype_int8 yycheck[] =
Packit 7e982e
{
Packit 7e982e
       0,     3,     4,     5,     6,     7,     8,     7,     3,     4,
Packit 7e982e
       5,     6,     7,     8,     9,     3,     4,     5,     6,     7,
Packit 7e982e
       8,     9,    11,     6,    -1,    -1,    -1,    16
Packit 7e982e
};
Packit 7e982e
Packit 7e982e
/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
Packit 7e982e
   symbol of state STATE-NUM.  */
Packit 7e982e
static const yytype_uint8 yystos[] =
Packit 7e982e
{
Packit 7e982e
       0,    11,     0,     7,    12,     3,     4,     5,     6,     7,
Packit 7e982e
       8,     9,    13,    12,     6,     7,     9,    12,     7
Packit 7e982e
};
Packit 7e982e
Packit 7e982e
#define yyerrok		(yyerrstatus = 0)
Packit 7e982e
#define yyclearin	(yychar = YYEMPTY)
Packit 7e982e
#define YYEMPTY		(-2)
Packit 7e982e
#define YYEOF		0
Packit 7e982e
Packit 7e982e
#define YYACCEPT	goto yyacceptlab
Packit 7e982e
#define YYABORT		goto yyabortlab
Packit 7e982e
#define YYERROR		goto yyerrorlab
Packit 7e982e
Packit 7e982e
Packit 7e982e
/* Like YYERROR except do call yyerror.  This remains here temporarily
Packit 7e982e
   to ease the transition to the new meaning of YYERROR, for GCC.
Packit 7e982e
   Once GCC version 2 has supplanted version 1, this can go.  However,
Packit 7e982e
   YYFAIL appears to be in use.  Nevertheless, it is formally deprecated
Packit 7e982e
   in Bison 2.4.2's NEWS entry, where a plan to phase it out is
Packit 7e982e
   discussed.  */
Packit 7e982e
Packit 7e982e
#define YYFAIL		goto yyerrlab
Packit 7e982e
#if defined YYFAIL
Packit 7e982e
  /* This is here to suppress warnings from the GCC cpp's
Packit 7e982e
     -Wunused-macros.  Normally we don't worry about that warning, but
Packit 7e982e
     some users do, and we want to make it easy for users to remove
Packit 7e982e
     YYFAIL uses, which will produce warnings from Bison 2.5.  */
Packit 7e982e
#endif
Packit 7e982e
Packit 7e982e
#define YYRECOVERING()  (!!yyerrstatus)
Packit 7e982e
Packit 7e982e
#define YYBACKUP(Token, Value)                                  \
Packit 7e982e
do                                                              \
Packit 7e982e
  if (yychar == YYEMPTY)                                        \
Packit 7e982e
    {                                                           \
Packit 7e982e
      yychar = (Token);                                         \
Packit 7e982e
      yylval = (Value);                                         \
Packit 7e982e
      YYPOPSTACK (yylen);                                       \
Packit 7e982e
      yystate = *yyssp;                                         \
Packit 7e982e
      goto yybackup;                                            \
Packit 7e982e
    }                                                           \
Packit 7e982e
  else                                                          \
Packit 7e982e
    {                                                           \
Packit 7e982e
      yyerror (YY_("syntax error: cannot back up")); \
Packit 7e982e
      YYERROR;							\
Packit 7e982e
    }								\
Packit 7e982e
while (YYID (0))
Packit 7e982e
Packit 7e982e
/* Error token number */
Packit 7e982e
#define YYTERROR	1
Packit 7e982e
#define YYERRCODE	256
Packit 7e982e
Packit 7e982e
Packit 7e982e
/* This macro is provided for backward compatibility. */
Packit 7e982e
#ifndef YY_LOCATION_PRINT
Packit 7e982e
# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
Packit 7e982e
#endif
Packit 7e982e
Packit 7e982e
Packit 7e982e
/* YYLEX -- calling `yylex' with the right arguments.  */
Packit 7e982e
#ifdef YYLEX_PARAM
Packit 7e982e
# define YYLEX yylex (YYLEX_PARAM)
Packit 7e982e
#else
Packit 7e982e
# define YYLEX yylex ()
Packit 7e982e
#endif
Packit 7e982e
Packit 7e982e
/* Enable debugging if requested.  */
Packit 7e982e
#if YYDEBUG
Packit 7e982e
Packit 7e982e
# ifndef YYFPRINTF
Packit 7e982e
#  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
Packit 7e982e
#  define YYFPRINTF fprintf
Packit 7e982e
# endif
Packit 7e982e
Packit 7e982e
# define YYDPRINTF(Args)			\
Packit 7e982e
do {						\
Packit 7e982e
  if (yydebug)					\
Packit 7e982e
    YYFPRINTF Args;				\
Packit 7e982e
} while (YYID (0))
Packit 7e982e
Packit 7e982e
# define YY_SYMBOL_PRINT(Title, Type, Value, Location)			  \
Packit 7e982e
do {									  \
Packit 7e982e
  if (yydebug)								  \
Packit 7e982e
    {									  \
Packit 7e982e
      YYFPRINTF (stderr, "%s ", Title);					  \
Packit 7e982e
      yy_symbol_print (stderr,						  \
Packit 7e982e
		  Type, Value); \
Packit 7e982e
      YYFPRINTF (stderr, "\n");						  \
Packit 7e982e
    }									  \
Packit 7e982e
} while (YYID (0))
Packit 7e982e
Packit 7e982e
Packit 7e982e
/*--------------------------------.
Packit 7e982e
| Print this symbol on YYOUTPUT.  |
Packit 7e982e
`--------------------------------*/
Packit 7e982e
Packit 7e982e
/*ARGSUSED*/
Packit 7e982e
#if (defined __STDC__ || defined __C99__FUNC__ \
Packit 7e982e
     || defined __cplusplus || defined _MSC_VER)
Packit 7e982e
static void
Packit 7e982e
yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
Packit 7e982e
#else
Packit 7e982e
static void
Packit 7e982e
yy_symbol_value_print (yyoutput, yytype, yyvaluep)
Packit 7e982e
    FILE *yyoutput;
Packit 7e982e
    int yytype;
Packit 7e982e
    YYSTYPE const * const yyvaluep;
Packit 7e982e
#endif
Packit 7e982e
{
Packit 7e982e
  FILE *yyo = yyoutput;
Packit 7e982e
  YYUSE (yyo);
Packit 7e982e
  if (!yyvaluep)
Packit 7e982e
    return;
Packit 7e982e
# ifdef YYPRINT
Packit 7e982e
  if (yytype < YYNTOKENS)
Packit 7e982e
    YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
Packit 7e982e
# else
Packit 7e982e
  YYUSE (yyoutput);
Packit 7e982e
# endif
Packit 7e982e
  switch (yytype)
Packit 7e982e
    {
Packit 7e982e
      default:
Packit 7e982e
        break;
Packit 7e982e
    }
Packit 7e982e
}
Packit 7e982e
Packit 7e982e
Packit 7e982e
/*--------------------------------.
Packit 7e982e
| Print this symbol on YYOUTPUT.  |
Packit 7e982e
`--------------------------------*/
Packit 7e982e
Packit 7e982e
#if (defined __STDC__ || defined __C99__FUNC__ \
Packit 7e982e
     || defined __cplusplus || defined _MSC_VER)
Packit 7e982e
static void
Packit 7e982e
yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
Packit 7e982e
#else
Packit 7e982e
static void
Packit 7e982e
yy_symbol_print (yyoutput, yytype, yyvaluep)
Packit 7e982e
    FILE *yyoutput;
Packit 7e982e
    int yytype;
Packit 7e982e
    YYSTYPE const * const yyvaluep;
Packit 7e982e
#endif
Packit 7e982e
{
Packit 7e982e
  if (yytype < YYNTOKENS)
Packit 7e982e
    YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
Packit 7e982e
  else
Packit 7e982e
    YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
Packit 7e982e
Packit 7e982e
  yy_symbol_value_print (yyoutput, yytype, yyvaluep);
Packit 7e982e
  YYFPRINTF (yyoutput, ")");
Packit 7e982e
}
Packit 7e982e
Packit 7e982e
/*------------------------------------------------------------------.
Packit 7e982e
| yy_stack_print -- Print the state stack from its BOTTOM up to its |
Packit 7e982e
| TOP (included).                                                   |
Packit 7e982e
`------------------------------------------------------------------*/
Packit 7e982e
Packit 7e982e
#if (defined __STDC__ || defined __C99__FUNC__ \
Packit 7e982e
     || defined __cplusplus || defined _MSC_VER)
Packit 7e982e
static void
Packit 7e982e
yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
Packit 7e982e
#else
Packit 7e982e
static void
Packit 7e982e
yy_stack_print (yybottom, yytop)
Packit 7e982e
    yytype_int16 *yybottom;
Packit 7e982e
    yytype_int16 *yytop;
Packit 7e982e
#endif
Packit 7e982e
{
Packit 7e982e
  YYFPRINTF (stderr, "Stack now");
Packit 7e982e
  for (; yybottom <= yytop; yybottom++)
Packit 7e982e
    {
Packit 7e982e
      int yybot = *yybottom;
Packit 7e982e
      YYFPRINTF (stderr, " %d", yybot);
Packit 7e982e
    }
Packit 7e982e
  YYFPRINTF (stderr, "\n");
Packit 7e982e
}
Packit 7e982e
Packit 7e982e
# define YY_STACK_PRINT(Bottom, Top)				\
Packit 7e982e
do {								\
Packit 7e982e
  if (yydebug)							\
Packit 7e982e
    yy_stack_print ((Bottom), (Top));				\
Packit 7e982e
} while (YYID (0))
Packit 7e982e
Packit 7e982e
Packit 7e982e
/*------------------------------------------------.
Packit 7e982e
| Report that the YYRULE is going to be reduced.  |
Packit 7e982e
`------------------------------------------------*/
Packit 7e982e
Packit 7e982e
#if (defined __STDC__ || defined __C99__FUNC__ \
Packit 7e982e
     || defined __cplusplus || defined _MSC_VER)
Packit 7e982e
static void
Packit 7e982e
yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
Packit 7e982e
#else
Packit 7e982e
static void
Packit 7e982e
yy_reduce_print (yyvsp, yyrule)
Packit 7e982e
    YYSTYPE *yyvsp;
Packit 7e982e
    int yyrule;
Packit 7e982e
#endif
Packit 7e982e
{
Packit 7e982e
  int yynrhs = yyr2[yyrule];
Packit 7e982e
  int yyi;
Packit 7e982e
  unsigned long int yylno = yyrline[yyrule];
Packit 7e982e
  YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
Packit 7e982e
	     yyrule - 1, yylno);
Packit 7e982e
  /* The symbols being reduced.  */
Packit 7e982e
  for (yyi = 0; yyi < yynrhs; yyi++)
Packit 7e982e
    {
Packit 7e982e
      YYFPRINTF (stderr, "   $%d = ", yyi + 1);
Packit 7e982e
      yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
Packit 7e982e
		       &(yyvsp[(yyi + 1) - (yynrhs)])
Packit 7e982e
		       		       );
Packit 7e982e
      YYFPRINTF (stderr, "\n");
Packit 7e982e
    }
Packit 7e982e
}
Packit 7e982e
Packit 7e982e
# define YY_REDUCE_PRINT(Rule)		\
Packit 7e982e
do {					\
Packit 7e982e
  if (yydebug)				\
Packit 7e982e
    yy_reduce_print (yyvsp, Rule); \
Packit 7e982e
} while (YYID (0))
Packit 7e982e
Packit 7e982e
/* Nonzero means print parse trace.  It is left uninitialized so that
Packit 7e982e
   multiple parsers can coexist.  */
Packit 7e982e
int yydebug;
Packit 7e982e
#else /* !YYDEBUG */
Packit 7e982e
# define YYDPRINTF(Args)
Packit 7e982e
# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
Packit 7e982e
# define YY_STACK_PRINT(Bottom, Top)
Packit 7e982e
# define YY_REDUCE_PRINT(Rule)
Packit 7e982e
#endif /* !YYDEBUG */
Packit 7e982e
Packit 7e982e
Packit 7e982e
/* YYINITDEPTH -- initial size of the parser's stacks.  */
Packit 7e982e
#ifndef	YYINITDEPTH
Packit 7e982e
# define YYINITDEPTH 200
Packit 7e982e
#endif
Packit 7e982e
Packit 7e982e
/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
Packit 7e982e
   if the built-in stack extension method is used).
Packit 7e982e
Packit 7e982e
   Do not make this value too large; the results are undefined if
Packit 7e982e
   YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
Packit 7e982e
   evaluated with infinite-precision integer arithmetic.  */
Packit 7e982e
Packit 7e982e
#ifndef YYMAXDEPTH
Packit 7e982e
# define YYMAXDEPTH 10000
Packit 7e982e
#endif
Packit 7e982e
Packit 7e982e
Packit 7e982e
#if YYERROR_VERBOSE
Packit 7e982e
Packit 7e982e
# ifndef yystrlen
Packit 7e982e
#  if defined __GLIBC__ && defined _STRING_H
Packit 7e982e
#   define yystrlen strlen
Packit 7e982e
#  else
Packit 7e982e
/* Return the length of YYSTR.  */
Packit 7e982e
#if (defined __STDC__ || defined __C99__FUNC__ \
Packit 7e982e
     || defined __cplusplus || defined _MSC_VER)
Packit 7e982e
static YYSIZE_T
Packit 7e982e
yystrlen (const char *yystr)
Packit 7e982e
#else
Packit 7e982e
static YYSIZE_T
Packit 7e982e
yystrlen (yystr)
Packit 7e982e
    const char *yystr;
Packit 7e982e
#endif
Packit 7e982e
{
Packit 7e982e
  YYSIZE_T yylen;
Packit 7e982e
  for (yylen = 0; yystr[yylen]; yylen++)
Packit 7e982e
    continue;
Packit 7e982e
  return yylen;
Packit 7e982e
}
Packit 7e982e
#  endif
Packit 7e982e
# endif
Packit 7e982e
Packit 7e982e
# ifndef yystpcpy
Packit 7e982e
#  if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
Packit 7e982e
#   define yystpcpy stpcpy
Packit 7e982e
#  else
Packit 7e982e
/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
Packit 7e982e
   YYDEST.  */
Packit 7e982e
#if (defined __STDC__ || defined __C99__FUNC__ \
Packit 7e982e
     || defined __cplusplus || defined _MSC_VER)
Packit 7e982e
static char *
Packit 7e982e
yystpcpy (char *yydest, const char *yysrc)
Packit 7e982e
#else
Packit 7e982e
static char *
Packit 7e982e
yystpcpy (yydest, yysrc)
Packit 7e982e
    char *yydest;
Packit 7e982e
    const char *yysrc;
Packit 7e982e
#endif
Packit 7e982e
{
Packit 7e982e
  char *yyd = yydest;
Packit 7e982e
  const char *yys = yysrc;
Packit 7e982e
Packit 7e982e
  while ((*yyd++ = *yys++) != '\0')
Packit 7e982e
    continue;
Packit 7e982e
Packit 7e982e
  return yyd - 1;
Packit 7e982e
}
Packit 7e982e
#  endif
Packit 7e982e
# endif
Packit 7e982e
Packit 7e982e
# ifndef yytnamerr
Packit 7e982e
/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
Packit 7e982e
   quotes and backslashes, so that it's suitable for yyerror.  The
Packit 7e982e
   heuristic is that double-quoting is unnecessary unless the string
Packit 7e982e
   contains an apostrophe, a comma, or backslash (other than
Packit 7e982e
   backslash-backslash).  YYSTR is taken from yytname.  If YYRES is
Packit 7e982e
   null, do not copy; instead, return the length of what the result
Packit 7e982e
   would have been.  */
Packit 7e982e
static YYSIZE_T
Packit 7e982e
yytnamerr (char *yyres, const char *yystr)
Packit 7e982e
{
Packit 7e982e
  if (*yystr == '"')
Packit 7e982e
    {
Packit 7e982e
      YYSIZE_T yyn = 0;
Packit 7e982e
      char const *yyp = yystr;
Packit 7e982e
Packit 7e982e
      for (;;)
Packit 7e982e
	switch (*++yyp)
Packit 7e982e
	  {
Packit 7e982e
	  case '\'':
Packit 7e982e
	  case ',':
Packit 7e982e
	    goto do_not_strip_quotes;
Packit 7e982e
Packit 7e982e
	  case '\\':
Packit 7e982e
	    if (*++yyp != '\\')
Packit 7e982e
	      goto do_not_strip_quotes;
Packit 7e982e
	    /* Fall through.  */
Packit 7e982e
	  default:
Packit 7e982e
	    if (yyres)
Packit 7e982e
	      yyres[yyn] = *yyp;
Packit 7e982e
	    yyn++;
Packit 7e982e
	    break;
Packit 7e982e
Packit 7e982e
	  case '"':
Packit 7e982e
	    if (yyres)
Packit 7e982e
	      yyres[yyn] = '\0';
Packit 7e982e
	    return yyn;
Packit 7e982e
	  }
Packit 7e982e
    do_not_strip_quotes: ;
Packit 7e982e
    }
Packit 7e982e
Packit 7e982e
  if (! yyres)
Packit 7e982e
    return yystrlen (yystr);
Packit 7e982e
Packit 7e982e
  return yystpcpy (yyres, yystr) - yyres;
Packit 7e982e
}
Packit 7e982e
# endif
Packit 7e982e
Packit 7e982e
/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
Packit 7e982e
   about the unexpected token YYTOKEN for the state stack whose top is
Packit 7e982e
   YYSSP.
Packit 7e982e
Packit 7e982e
   Return 0 if *YYMSG was successfully written.  Return 1 if *YYMSG is
Packit 7e982e
   not large enough to hold the message.  In that case, also set
Packit 7e982e
   *YYMSG_ALLOC to the required number of bytes.  Return 2 if the
Packit 7e982e
   required number of bytes is too large to store.  */
Packit 7e982e
static int
Packit 7e982e
yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
Packit 7e982e
                yytype_int16 *yyssp, int yytoken)
Packit 7e982e
{
Packit 7e982e
  YYSIZE_T yysize0 = yytnamerr (YY_NULL, yytname[yytoken]);
Packit 7e982e
  YYSIZE_T yysize = yysize0;
Packit 7e982e
  enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
Packit 7e982e
  /* Internationalized format string. */
Packit 7e982e
  const char *yyformat = YY_NULL;
Packit 7e982e
  /* Arguments of yyformat. */
Packit 7e982e
  char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
Packit 7e982e
  /* Number of reported tokens (one for the "unexpected", one per
Packit 7e982e
     "expected"). */
Packit 7e982e
  int yycount = 0;
Packit 7e982e
Packit 7e982e
  /* There are many possibilities here to consider:
Packit 7e982e
     - Assume YYFAIL is not used.  It's too flawed to consider.  See
Packit 7e982e
       <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html>
Packit 7e982e
       for details.  YYERROR is fine as it does not invoke this
Packit 7e982e
       function.
Packit 7e982e
     - If this state is a consistent state with a default action, then
Packit 7e982e
       the only way this function was invoked is if the default action
Packit 7e982e
       is an error action.  In that case, don't check for expected
Packit 7e982e
       tokens because there are none.
Packit 7e982e
     - The only way there can be no lookahead present (in yychar) is if
Packit 7e982e
       this state is a consistent state with a default action.  Thus,
Packit 7e982e
       detecting the absence of a lookahead is sufficient to determine
Packit 7e982e
       that there is no unexpected or expected token to report.  In that
Packit 7e982e
       case, just report a simple "syntax error".
Packit 7e982e
     - Don't assume there isn't a lookahead just because this state is a
Packit 7e982e
       consistent state with a default action.  There might have been a
Packit 7e982e
       previous inconsistent state, consistent state with a non-default
Packit 7e982e
       action, or user semantic action that manipulated yychar.
Packit 7e982e
     - Of course, the expected token list depends on states to have
Packit 7e982e
       correct lookahead information, and it depends on the parser not
Packit 7e982e
       to perform extra reductions after fetching a lookahead from the
Packit 7e982e
       scanner and before detecting a syntax error.  Thus, state merging
Packit 7e982e
       (from LALR or IELR) and default reductions corrupt the expected
Packit 7e982e
       token list.  However, the list is correct for canonical LR with
Packit 7e982e
       one exception: it will still contain any token that will not be
Packit 7e982e
       accepted due to an error action in a later state.
Packit 7e982e
  */
Packit 7e982e
  if (yytoken != YYEMPTY)
Packit 7e982e
    {
Packit 7e982e
      int yyn = yypact[*yyssp];
Packit 7e982e
      yyarg[yycount++] = yytname[yytoken];
Packit 7e982e
      if (!yypact_value_is_default (yyn))
Packit 7e982e
        {
Packit 7e982e
          /* Start YYX at -YYN if negative to avoid negative indexes in
Packit 7e982e
             YYCHECK.  In other words, skip the first -YYN actions for
Packit 7e982e
             this state because they are default actions.  */
Packit 7e982e
          int yyxbegin = yyn < 0 ? -yyn : 0;
Packit 7e982e
          /* Stay within bounds of both yycheck and yytname.  */
Packit 7e982e
          int yychecklim = YYLAST - yyn + 1;
Packit 7e982e
          int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
Packit 7e982e
          int yyx;
Packit 7e982e
Packit 7e982e
          for (yyx = yyxbegin; yyx < yyxend; ++yyx)
Packit 7e982e
            if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
Packit 7e982e
                && !yytable_value_is_error (yytable[yyx + yyn]))
Packit 7e982e
              {
Packit 7e982e
                if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
Packit 7e982e
                  {
Packit 7e982e
                    yycount = 1;
Packit 7e982e
                    yysize = yysize0;
Packit 7e982e
                    break;
Packit 7e982e
                  }
Packit 7e982e
                yyarg[yycount++] = yytname[yyx];
Packit 7e982e
                {
Packit 7e982e
                  YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]);
Packit 7e982e
                  if (! (yysize <= yysize1
Packit 7e982e
                         && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
Packit 7e982e
                    return 2;
Packit 7e982e
                  yysize = yysize1;
Packit 7e982e
                }
Packit 7e982e
              }
Packit 7e982e
        }
Packit 7e982e
    }
Packit 7e982e
Packit 7e982e
  switch (yycount)
Packit 7e982e
    {
Packit 7e982e
# define YYCASE_(N, S)                      \
Packit 7e982e
      case N:                               \
Packit 7e982e
        yyformat = S;                       \
Packit 7e982e
      break
Packit 7e982e
      YYCASE_(0, YY_("syntax error"));
Packit 7e982e
      YYCASE_(1, YY_("syntax error, unexpected %s"));
Packit 7e982e
      YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
Packit 7e982e
      YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
Packit 7e982e
      YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
Packit 7e982e
      YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
Packit 7e982e
# undef YYCASE_
Packit 7e982e
    }
Packit 7e982e
Packit 7e982e
  {
Packit 7e982e
    YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
Packit 7e982e
    if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
Packit 7e982e
      return 2;
Packit 7e982e
    yysize = yysize1;
Packit 7e982e
  }
Packit 7e982e
Packit 7e982e
  if (*yymsg_alloc < yysize)
Packit 7e982e
    {
Packit 7e982e
      *yymsg_alloc = 2 * yysize;
Packit 7e982e
      if (! (yysize <= *yymsg_alloc
Packit 7e982e
             && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
Packit 7e982e
        *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
Packit 7e982e
      return 1;
Packit 7e982e
    }
Packit 7e982e
Packit 7e982e
  /* Avoid sprintf, as that infringes on the user's name space.
Packit 7e982e
     Don't have undefined behavior even if the translation
Packit 7e982e
     produced a string with the wrong number of "%s"s.  */
Packit 7e982e
  {
Packit 7e982e
    char *yyp = *yymsg;
Packit 7e982e
    int yyi = 0;
Packit 7e982e
    while ((*yyp = *yyformat) != '\0')
Packit 7e982e
      if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
Packit 7e982e
        {
Packit 7e982e
          yyp += yytnamerr (yyp, yyarg[yyi++]);
Packit 7e982e
          yyformat += 2;
Packit 7e982e
        }
Packit 7e982e
      else
Packit 7e982e
        {
Packit 7e982e
          yyp++;
Packit 7e982e
          yyformat++;
Packit 7e982e
        }
Packit 7e982e
  }
Packit 7e982e
  return 0;
Packit 7e982e
}
Packit 7e982e
#endif /* YYERROR_VERBOSE */
Packit 7e982e
Packit 7e982e
/*-----------------------------------------------.
Packit 7e982e
| Release the memory associated to this symbol.  |
Packit 7e982e
`-----------------------------------------------*/
Packit 7e982e
Packit 7e982e
/*ARGSUSED*/
Packit 7e982e
#if (defined __STDC__ || defined __C99__FUNC__ \
Packit 7e982e
     || defined __cplusplus || defined _MSC_VER)
Packit 7e982e
static void
Packit 7e982e
yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
Packit 7e982e
#else
Packit 7e982e
static void
Packit 7e982e
yydestruct (yymsg, yytype, yyvaluep)
Packit 7e982e
    const char *yymsg;
Packit 7e982e
    int yytype;
Packit 7e982e
    YYSTYPE *yyvaluep;
Packit 7e982e
#endif
Packit 7e982e
{
Packit 7e982e
  YYUSE (yyvaluep);
Packit 7e982e
Packit 7e982e
  if (!yymsg)
Packit 7e982e
    yymsg = "Deleting";
Packit 7e982e
  YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
Packit 7e982e
Packit 7e982e
  switch (yytype)
Packit 7e982e
    {
Packit 7e982e
Packit 7e982e
      default:
Packit 7e982e
        break;
Packit 7e982e
    }
Packit 7e982e
}
Packit 7e982e
Packit 7e982e
Packit 7e982e
Packit 7e982e
Packit 7e982e
/* The lookahead symbol.  */
Packit 7e982e
int yychar;
Packit 7e982e
Packit 7e982e
Packit 7e982e
#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
Packit 7e982e
# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
Packit 7e982e
# define YY_IGNORE_MAYBE_UNINITIALIZED_END
Packit 7e982e
#endif
Packit 7e982e
#ifndef YY_INITIAL_VALUE
Packit 7e982e
# define YY_INITIAL_VALUE(Value) /* Nothing. */
Packit 7e982e
#endif
Packit 7e982e
Packit 7e982e
/* The semantic value of the lookahead symbol.  */
Packit 7e982e
YYSTYPE yylval YY_INITIAL_VALUE(yyval_default);
Packit 7e982e
Packit 7e982e
/* Number of syntax errors so far.  */
Packit 7e982e
int yynerrs;
Packit 7e982e
Packit 7e982e
Packit 7e982e
/*----------.
Packit 7e982e
| yyparse.  |
Packit 7e982e
`----------*/
Packit 7e982e
Packit 7e982e
#ifdef YYPARSE_PARAM
Packit 7e982e
#if (defined __STDC__ || defined __C99__FUNC__ \
Packit 7e982e
     || defined __cplusplus || defined _MSC_VER)
Packit 7e982e
int
Packit 7e982e
yyparse (void *YYPARSE_PARAM)
Packit 7e982e
#else
Packit 7e982e
int
Packit 7e982e
yyparse (YYPARSE_PARAM)
Packit 7e982e
    void *YYPARSE_PARAM;
Packit 7e982e
#endif
Packit 7e982e
#else /* ! YYPARSE_PARAM */
Packit 7e982e
#if (defined __STDC__ || defined __C99__FUNC__ \
Packit 7e982e
     || defined __cplusplus || defined _MSC_VER)
Packit 7e982e
int
Packit 7e982e
yyparse (void)
Packit 7e982e
#else
Packit 7e982e
int
Packit 7e982e
yyparse ()
Packit 7e982e
Packit 7e982e
#endif
Packit 7e982e
#endif
Packit 7e982e
{
Packit 7e982e
    int yystate;
Packit 7e982e
    /* Number of tokens to shift before error messages enabled.  */
Packit 7e982e
    int yyerrstatus;
Packit 7e982e
Packit 7e982e
    /* The stacks and their tools:
Packit 7e982e
       `yyss': related to states.
Packit 7e982e
       `yyvs': related to semantic values.
Packit 7e982e
Packit 7e982e
       Refer to the stacks through separate pointers, to allow yyoverflow
Packit 7e982e
       to reallocate them elsewhere.  */
Packit 7e982e
Packit 7e982e
    /* The state stack.  */
Packit 7e982e
    yytype_int16 yyssa[YYINITDEPTH];
Packit 7e982e
    yytype_int16 *yyss;
Packit 7e982e
    yytype_int16 *yyssp;
Packit 7e982e
Packit 7e982e
    /* The semantic value stack.  */
Packit 7e982e
    YYSTYPE yyvsa[YYINITDEPTH];
Packit 7e982e
    YYSTYPE *yyvs;
Packit 7e982e
    YYSTYPE *yyvsp;
Packit 7e982e
Packit 7e982e
    YYSIZE_T yystacksize;
Packit 7e982e
Packit 7e982e
  int yyn;
Packit 7e982e
  int yyresult;
Packit 7e982e
  /* Lookahead token as an internal (translated) token number.  */
Packit 7e982e
  int yytoken = 0;
Packit 7e982e
  /* The variables used to return semantic value and location from the
Packit 7e982e
     action routines.  */
Packit 7e982e
  YYSTYPE yyval;
Packit 7e982e
Packit 7e982e
#if YYERROR_VERBOSE
Packit 7e982e
  /* Buffer for error messages, and its allocated size.  */
Packit 7e982e
  char yymsgbuf[128];
Packit 7e982e
  char *yymsg = yymsgbuf;
Packit 7e982e
  YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
Packit 7e982e
#endif
Packit 7e982e
Packit 7e982e
#define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N))
Packit 7e982e
Packit 7e982e
  /* The number of symbols on the RHS of the reduced rule.
Packit 7e982e
     Keep to zero when no symbol should be popped.  */
Packit 7e982e
  int yylen = 0;
Packit 7e982e
Packit 7e982e
  yyssp = yyss = yyssa;
Packit 7e982e
  yyvsp = yyvs = yyvsa;
Packit 7e982e
  yystacksize = YYINITDEPTH;
Packit 7e982e
Packit 7e982e
  YYDPRINTF ((stderr, "Starting parse\n"));
Packit 7e982e
Packit 7e982e
  yystate = 0;
Packit 7e982e
  yyerrstatus = 0;
Packit 7e982e
  yynerrs = 0;
Packit 7e982e
  yychar = YYEMPTY; /* Cause a token to be read.  */
Packit 7e982e
  goto yysetstate;
Packit 7e982e
Packit 7e982e
/*------------------------------------------------------------.
Packit 7e982e
| yynewstate -- Push a new state, which is found in yystate.  |
Packit 7e982e
`------------------------------------------------------------*/
Packit 7e982e
 yynewstate:
Packit 7e982e
  /* In all cases, when you get here, the value and location stacks
Packit 7e982e
     have just been pushed.  So pushing a state here evens the stacks.  */
Packit 7e982e
  yyssp++;
Packit 7e982e
Packit 7e982e
 yysetstate:
Packit 7e982e
  *yyssp = yystate;
Packit 7e982e
Packit 7e982e
  if (yyss + yystacksize - 1 <= yyssp)
Packit 7e982e
    {
Packit 7e982e
      /* Get the current used size of the three stacks, in elements.  */
Packit 7e982e
      YYSIZE_T yysize = yyssp - yyss + 1;
Packit 7e982e
Packit 7e982e
#ifdef yyoverflow
Packit 7e982e
      {
Packit 7e982e
	/* Give user a chance to reallocate the stack.  Use copies of
Packit 7e982e
	   these so that the &'s don't force the real ones into
Packit 7e982e
	   memory.  */
Packit 7e982e
	YYSTYPE *yyvs1 = yyvs;
Packit 7e982e
	yytype_int16 *yyss1 = yyss;
Packit 7e982e
Packit 7e982e
	/* Each stack pointer address is followed by the size of the
Packit 7e982e
	   data in use in that stack, in bytes.  This used to be a
Packit 7e982e
	   conditional around just the two extra args, but that might
Packit 7e982e
	   be undefined if yyoverflow is a macro.  */
Packit 7e982e
	yyoverflow (YY_("memory exhausted"),
Packit 7e982e
		    &yyss1, yysize * sizeof (*yyssp),
Packit 7e982e
		    &yyvs1, yysize * sizeof (*yyvsp),
Packit 7e982e
		    &yystacksize);
Packit 7e982e
Packit 7e982e
	yyss = yyss1;
Packit 7e982e
	yyvs = yyvs1;
Packit 7e982e
      }
Packit 7e982e
#else /* no yyoverflow */
Packit 7e982e
# ifndef YYSTACK_RELOCATE
Packit 7e982e
      goto yyexhaustedlab;
Packit 7e982e
# else
Packit 7e982e
      /* Extend the stack our own way.  */
Packit 7e982e
      if (YYMAXDEPTH <= yystacksize)
Packit 7e982e
	goto yyexhaustedlab;
Packit 7e982e
      yystacksize *= 2;
Packit 7e982e
      if (YYMAXDEPTH < yystacksize)
Packit 7e982e
	yystacksize = YYMAXDEPTH;
Packit 7e982e
Packit 7e982e
      {
Packit 7e982e
	yytype_int16 *yyss1 = yyss;
Packit 7e982e
	union yyalloc *yyptr =
Packit 7e982e
	  (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
Packit 7e982e
	if (! yyptr)
Packit 7e982e
	  goto yyexhaustedlab;
Packit 7e982e
	YYSTACK_RELOCATE (yyss_alloc, yyss);
Packit 7e982e
	YYSTACK_RELOCATE (yyvs_alloc, yyvs);
Packit 7e982e
#  undef YYSTACK_RELOCATE
Packit 7e982e
	if (yyss1 != yyssa)
Packit 7e982e
	  YYSTACK_FREE (yyss1);
Packit 7e982e
      }
Packit 7e982e
# endif
Packit 7e982e
#endif /* no yyoverflow */
Packit 7e982e
Packit 7e982e
      yyssp = yyss + yysize - 1;
Packit 7e982e
      yyvsp = yyvs + yysize - 1;
Packit 7e982e
Packit 7e982e
      YYDPRINTF ((stderr, "Stack size increased to %lu\n",
Packit 7e982e
		  (unsigned long int) yystacksize));
Packit 7e982e
Packit 7e982e
      if (yyss + yystacksize - 1 <= yyssp)
Packit 7e982e
	YYABORT;
Packit 7e982e
    }
Packit 7e982e
Packit 7e982e
  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
Packit 7e982e
Packit 7e982e
  if (yystate == YYFINAL)
Packit 7e982e
    YYACCEPT;
Packit 7e982e
Packit 7e982e
  goto yybackup;
Packit 7e982e
Packit 7e982e
/*-----------.
Packit 7e982e
| yybackup.  |
Packit 7e982e
`-----------*/
Packit 7e982e
yybackup:
Packit 7e982e
Packit 7e982e
  /* Do appropriate processing given the current state.  Read a
Packit 7e982e
     lookahead token if we need one and don't already have one.  */
Packit 7e982e
Packit 7e982e
  /* First try to decide what to do without reference to lookahead token.  */
Packit 7e982e
  yyn = yypact[yystate];
Packit 7e982e
  if (yypact_value_is_default (yyn))
Packit 7e982e
    goto yydefault;
Packit 7e982e
Packit 7e982e
  /* Not known => get a lookahead token if don't already have one.  */
Packit 7e982e
Packit 7e982e
  /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol.  */
Packit 7e982e
  if (yychar == YYEMPTY)
Packit 7e982e
    {
Packit 7e982e
      YYDPRINTF ((stderr, "Reading a token: "));
Packit 7e982e
      yychar = YYLEX;
Packit 7e982e
    }
Packit 7e982e
Packit 7e982e
  if (yychar <= YYEOF)
Packit 7e982e
    {
Packit 7e982e
      yychar = yytoken = YYEOF;
Packit 7e982e
      YYDPRINTF ((stderr, "Now at end of input.\n"));
Packit 7e982e
    }
Packit 7e982e
  else
Packit 7e982e
    {
Packit 7e982e
      yytoken = YYTRANSLATE (yychar);
Packit 7e982e
      YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
Packit 7e982e
    }
Packit 7e982e
Packit 7e982e
  /* If the proper action on seeing token YYTOKEN is to reduce or to
Packit 7e982e
     detect an error, take that action.  */
Packit 7e982e
  yyn += yytoken;
Packit 7e982e
  if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
Packit 7e982e
    goto yydefault;
Packit 7e982e
  yyn = yytable[yyn];
Packit 7e982e
  if (yyn <= 0)
Packit 7e982e
    {
Packit 7e982e
      if (yytable_value_is_error (yyn))
Packit 7e982e
        goto yyerrlab;
Packit 7e982e
      yyn = -yyn;
Packit 7e982e
      goto yyreduce;
Packit 7e982e
    }
Packit 7e982e
Packit 7e982e
  /* Count tokens shifted since error; after three, turn off error
Packit 7e982e
     status.  */
Packit 7e982e
  if (yyerrstatus)
Packit 7e982e
    yyerrstatus--;
Packit 7e982e
Packit 7e982e
  /* Shift the lookahead token.  */
Packit 7e982e
  YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
Packit 7e982e
Packit 7e982e
  /* Discard the shifted token.  */
Packit 7e982e
  yychar = YYEMPTY;
Packit 7e982e
Packit 7e982e
  yystate = yyn;
Packit 7e982e
  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
Packit 7e982e
  *++yyvsp = yylval;
Packit 7e982e
  YY_IGNORE_MAYBE_UNINITIALIZED_END
Packit 7e982e
Packit 7e982e
  goto yynewstate;
Packit 7e982e
Packit 7e982e
Packit 7e982e
/*-----------------------------------------------------------.
Packit 7e982e
| yydefault -- do the default action for the current state.  |
Packit 7e982e
`-----------------------------------------------------------*/
Packit 7e982e
yydefault:
Packit 7e982e
  yyn = yydefact[yystate];
Packit 7e982e
  if (yyn == 0)
Packit 7e982e
    goto yyerrlab;
Packit 7e982e
  goto yyreduce;
Packit 7e982e
Packit 7e982e
Packit 7e982e
/*-----------------------------.
Packit 7e982e
| yyreduce -- Do a reduction.  |
Packit 7e982e
`-----------------------------*/
Packit 7e982e
yyreduce:
Packit 7e982e
  /* yyn is the number of a rule to reduce with.  */
Packit 7e982e
  yylen = yyr2[yyn];
Packit 7e982e
Packit 7e982e
  /* If YYLEN is nonzero, implement the default value of the action:
Packit 7e982e
     `$$ = $1'.
Packit 7e982e
Packit 7e982e
     Otherwise, the following line sets YYVAL to garbage.
Packit 7e982e
     This behavior is undocumented and Bison
Packit 7e982e
     users should not rely upon it.  Assigning to YYVAL
Packit 7e982e
     unconditionally makes the parser a bit smaller, and it avoids a
Packit 7e982e
     GCC warning that YYVAL may be used uninitialized.  */
Packit 7e982e
  yyval = yyvsp[1-yylen];
Packit 7e982e
Packit 7e982e
Packit 7e982e
  YY_REDUCE_PRINT (yyn);
Packit 7e982e
  switch (yyn)
Packit 7e982e
    {
Packit 7e982e
        case 3:
Packit 7e982e
/* Line 1792 of yacc.c  */
Packit 7e982e
#line 40 "parse_y.y"
Packit 7e982e
    {
Packit 7e982e
    printf("\n");
Packit 7e982e
    ++line;
Packit 7e982e
}
Packit 7e982e
    break;
Packit 7e982e
Packit 7e982e
  case 4:
Packit 7e982e
/* Line 1792 of yacc.c  */
Packit 7e982e
#line 44 "parse_y.y"
Packit 7e982e
    {
Packit 7e982e
    if (strlen((yyvsp[(2) - (3)].string)) > (PAPER_WIDTH-(indent ? strlen(INDENT_STRING):0))) {
Packit 7e982e
	yyerror("line too long");
Packit 7e982e
    }
Packit 7e982e
    printf("%s%s\n", indent ? INDENT_STRING:"", (yyvsp[(2) - (3)].string));
Packit 7e982e
    free((yyvsp[(2) - (3)].string));
Packit 7e982e
    indent = 1;
Packit 7e982e
    ++line;
Packit 7e982e
}
Packit 7e982e
    break;
Packit 7e982e
Packit 7e982e
  case 5:
Packit 7e982e
/* Line 1792 of yacc.c  */
Packit 7e982e
#line 53 "parse_y.y"
Packit 7e982e
    {
Packit 7e982e
    char fixed[PAPER_WIDTH+1];
Packit 7e982e
    int len;
Packit 7e982e
Packit 7e982e
    len = PAPER_WIDTH-(strlen((yyvsp[(2) - (5)].string))+strlen((yyvsp[(4) - (5)].string)));
Packit 7e982e
Packit 7e982e
    if (len >= 0) {
Packit 7e982e
	memset(fixed, ' ', len);
Packit 7e982e
	fixed[len] = '\0';
Packit 7e982e
    } else {
Packit 7e982e
	yyerror("line too wide");
Packit 7e982e
	fixed[0] = '\0';
Packit 7e982e
    }
Packit 7e982e
    printf("%s%s%s\n", (yyvsp[(2) - (5)].string), fixed, (yyvsp[(4) - (5)].string));
Packit 7e982e
    free((yyvsp[(2) - (5)].string));
Packit 7e982e
    free((yyvsp[(4) - (5)].string));
Packit 7e982e
    indent = 1;
Packit 7e982e
    ++line;
Packit 7e982e
}
Packit 7e982e
    break;
Packit 7e982e
Packit 7e982e
  case 6:
Packit 7e982e
/* Line 1792 of yacc.c  */
Packit 7e982e
#line 72 "parse_y.y"
Packit 7e982e
    {
Packit 7e982e
    char fixed[PAPER_WIDTH+1];
Packit 7e982e
    int len, l;
Packit 7e982e
Packit 7e982e
    len = PAPER_WIDTH-(strlen((yyvsp[(2) - (7)].string))+strlen((yyvsp[(4) - (7)].string)));
Packit 7e982e
Packit 7e982e
    if (len < 0) {
Packit 7e982e
	len = 0;
Packit 7e982e
	yyerror("line too wide");
Packit 7e982e
    }
Packit 7e982e
Packit 7e982e
    l = len/2;
Packit 7e982e
    memset(fixed, ' ', l);
Packit 7e982e
    fixed[l] = '\0';
Packit 7e982e
    printf("%s%s%s", (yyvsp[(2) - (7)].string), fixed, (yyvsp[(4) - (7)].string));
Packit 7e982e
    free((yyvsp[(2) - (7)].string));
Packit 7e982e
    free((yyvsp[(4) - (7)].string));
Packit 7e982e
Packit 7e982e
    l = (len+1)/2;
Packit 7e982e
    memset(fixed, ' ', l);
Packit 7e982e
    fixed[l] = '\0';
Packit 7e982e
    printf("%s%s\n", fixed, (yyvsp[(6) - (7)].string));
Packit 7e982e
    free((yyvsp[(6) - (7)].string));
Packit 7e982e
Packit 7e982e
    indent = 1;
Packit 7e982e
    ++line;
Packit 7e982e
}
Packit 7e982e
    break;
Packit 7e982e
Packit 7e982e
  case 7:
Packit 7e982e
/* Line 1792 of yacc.c  */
Packit 7e982e
#line 99 "parse_y.y"
Packit 7e982e
    {
Packit 7e982e
    char fixed[PAPER_WIDTH+1];
Packit 7e982e
    int len, l;
Packit 7e982e
Packit 7e982e
    len = PAPER_WIDTH-(strlen((yyvsp[(2) - (7)].string))+strlen((yyvsp[(4) - (7)].string)));
Packit 7e982e
Packit 7e982e
    if (len < 0) {
Packit 7e982e
	len = 0;
Packit 7e982e
	yyerror("line too wide");
Packit 7e982e
    }
Packit 7e982e
Packit 7e982e
    l = len/2;
Packit 7e982e
    memset(fixed, ' ', l);
Packit 7e982e
    fixed[l] = '\0';
Packit 7e982e
    printf("%s%s%s", (yyvsp[(2) - (7)].string), fixed, (yyvsp[(4) - (7)].string));
Packit 7e982e
    free((yyvsp[(2) - (7)].string));
Packit 7e982e
    free((yyvsp[(4) - (7)].string));
Packit 7e982e
Packit 7e982e
    l = (len+1)/2;
Packit 7e982e
    memset(fixed, ' ', l);
Packit 7e982e
    fixed[l] = '\0';
Packit 7e982e
    printf("%s%s\n", fixed, (yyvsp[(6) - (7)].string));
Packit 7e982e
    free((yyvsp[(6) - (7)].string));
Packit 7e982e
Packit 7e982e
    indent = 1;
Packit 7e982e
    ++line;
Packit 7e982e
}
Packit 7e982e
    break;
Packit 7e982e
Packit 7e982e
  case 8:
Packit 7e982e
/* Line 1792 of yacc.c  */
Packit 7e982e
#line 128 "parse_y.y"
Packit 7e982e
    {
Packit 7e982e
    (yyval.string) = strdup("");
Packit 7e982e
}
Packit 7e982e
    break;
Packit 7e982e
Packit 7e982e
  case 9:
Packit 7e982e
/* Line 1792 of yacc.c  */
Packit 7e982e
#line 131 "parse_y.y"
Packit 7e982e
    {
Packit 7e982e
    (yyval.string) = malloc(strlen((yyvsp[(1) - (2)].string))+strlen((yyvsp[(2) - (2)].string))+1);
Packit 7e982e
    sprintf((yyval.string),"%s%s", (yyvsp[(1) - (2)].string), (yyvsp[(2) - (2)].string));
Packit 7e982e
    free((yyvsp[(1) - (2)].string));
Packit 7e982e
    free((yyvsp[(2) - (2)].string));
Packit 7e982e
}
Packit 7e982e
    break;
Packit 7e982e
Packit 7e982e
  case 10:
Packit 7e982e
/* Line 1792 of yacc.c  */
Packit 7e982e
#line 139 "parse_y.y"
Packit 7e982e
    {
Packit 7e982e
    (yyval.string) = strdup(yytext);
Packit 7e982e
}
Packit 7e982e
    break;
Packit 7e982e
Packit 7e982e
  case 11:
Packit 7e982e
/* Line 1792 of yacc.c  */
Packit 7e982e
#line 142 "parse_y.y"
Packit 7e982e
    {
Packit 7e982e
    (yyval.string) = malloc(strlen((yyvsp[(1) - (2)].string))+2);
Packit 7e982e
    sprintf((yyval.string),"%s%s", (yyvsp[(1) - (2)].string), yytext);
Packit 7e982e
    free((yyvsp[(1) - (2)].string));
Packit 7e982e
}
Packit 7e982e
    break;
Packit 7e982e
Packit 7e982e
  case 12:
Packit 7e982e
/* Line 1792 of yacc.c  */
Packit 7e982e
#line 147 "parse_y.y"
Packit 7e982e
    {
Packit 7e982e
    (yyval.string) = strdup("");
Packit 7e982e
    indent = 0;
Packit 7e982e
}
Packit 7e982e
    break;
Packit 7e982e
Packit 7e982e
  case 13:
Packit 7e982e
/* Line 1792 of yacc.c  */
Packit 7e982e
#line 151 "parse_y.y"
Packit 7e982e
    {
Packit 7e982e
    (yyval.string) = strdup("#");
Packit 7e982e
}
Packit 7e982e
    break;
Packit 7e982e
Packit 7e982e
  case 14:
Packit 7e982e
/* Line 1792 of yacc.c  */
Packit 7e982e
#line 154 "parse_y.y"
Packit 7e982e
    {
Packit 7e982e
    if (((yyval.string) = get_label(yytext)) == NULL) {
Packit 7e982e
	set_label(yytext, last_label);
Packit 7e982e
	(yyval.string) = strdup("");
Packit 7e982e
    }
Packit 7e982e
}
Packit 7e982e
    break;
Packit 7e982e
Packit 7e982e
  case 15:
Packit 7e982e
/* Line 1792 of yacc.c  */
Packit 7e982e
#line 160 "parse_y.y"
Packit 7e982e
    {
Packit 7e982e
    (yyval.string) = new_counter(yytext);
Packit 7e982e
}
Packit 7e982e
    break;
Packit 7e982e
Packit 7e982e
Packit 7e982e
/* Line 1792 of yacc.c  */
Packit 7e982e
#line 1563 "parse_y.c"
Packit 7e982e
      default: break;
Packit 7e982e
    }
Packit 7e982e
  /* User semantic actions sometimes alter yychar, and that requires
Packit 7e982e
     that yytoken be updated with the new translation.  We take the
Packit 7e982e
     approach of translating immediately before every use of yytoken.
Packit 7e982e
     One alternative is translating here after every semantic action,
Packit 7e982e
     but that translation would be missed if the semantic action invokes
Packit 7e982e
     YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
Packit 7e982e
     if it invokes YYBACKUP.  In the case of YYABORT or YYACCEPT, an
Packit 7e982e
     incorrect destructor might then be invoked immediately.  In the
Packit 7e982e
     case of YYERROR or YYBACKUP, subsequent parser actions might lead
Packit 7e982e
     to an incorrect destructor call or verbose syntax error message
Packit 7e982e
     before the lookahead is translated.  */
Packit 7e982e
  YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
Packit 7e982e
Packit 7e982e
  YYPOPSTACK (yylen);
Packit 7e982e
  yylen = 0;
Packit 7e982e
  YY_STACK_PRINT (yyss, yyssp);
Packit 7e982e
Packit 7e982e
  *++yyvsp = yyval;
Packit 7e982e
Packit 7e982e
  /* Now `shift' the result of the reduction.  Determine what state
Packit 7e982e
     that goes to, based on the state we popped back to and the rule
Packit 7e982e
     number reduced by.  */
Packit 7e982e
Packit 7e982e
  yyn = yyr1[yyn];
Packit 7e982e
Packit 7e982e
  yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
Packit 7e982e
  if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
Packit 7e982e
    yystate = yytable[yystate];
Packit 7e982e
  else
Packit 7e982e
    yystate = yydefgoto[yyn - YYNTOKENS];
Packit 7e982e
Packit 7e982e
  goto yynewstate;
Packit 7e982e
Packit 7e982e
Packit 7e982e
/*------------------------------------.
Packit 7e982e
| yyerrlab -- here on detecting error |
Packit 7e982e
`------------------------------------*/
Packit 7e982e
yyerrlab:
Packit 7e982e
  /* Make sure we have latest lookahead translation.  See comments at
Packit 7e982e
     user semantic actions for why this is necessary.  */
Packit 7e982e
  yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
Packit 7e982e
Packit 7e982e
  /* If not already recovering from an error, report this error.  */
Packit 7e982e
  if (!yyerrstatus)
Packit 7e982e
    {
Packit 7e982e
      ++yynerrs;
Packit 7e982e
#if ! YYERROR_VERBOSE
Packit 7e982e
      yyerror (YY_("syntax error"));
Packit 7e982e
#else
Packit 7e982e
# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
Packit 7e982e
                                        yyssp, yytoken)
Packit 7e982e
      {
Packit 7e982e
        char const *yymsgp = YY_("syntax error");
Packit 7e982e
        int yysyntax_error_status;
Packit 7e982e
        yysyntax_error_status = YYSYNTAX_ERROR;
Packit 7e982e
        if (yysyntax_error_status == 0)
Packit 7e982e
          yymsgp = yymsg;
Packit 7e982e
        else if (yysyntax_error_status == 1)
Packit 7e982e
          {
Packit 7e982e
            if (yymsg != yymsgbuf)
Packit 7e982e
              YYSTACK_FREE (yymsg);
Packit 7e982e
            yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
Packit 7e982e
            if (!yymsg)
Packit 7e982e
              {
Packit 7e982e
                yymsg = yymsgbuf;
Packit 7e982e
                yymsg_alloc = sizeof yymsgbuf;
Packit 7e982e
                yysyntax_error_status = 2;
Packit 7e982e
              }
Packit 7e982e
            else
Packit 7e982e
              {
Packit 7e982e
                yysyntax_error_status = YYSYNTAX_ERROR;
Packit 7e982e
                yymsgp = yymsg;
Packit 7e982e
              }
Packit 7e982e
          }
Packit 7e982e
        yyerror (yymsgp);
Packit 7e982e
        if (yysyntax_error_status == 2)
Packit 7e982e
          goto yyexhaustedlab;
Packit 7e982e
      }
Packit 7e982e
# undef YYSYNTAX_ERROR
Packit 7e982e
#endif
Packit 7e982e
    }
Packit 7e982e
Packit 7e982e
Packit 7e982e
Packit 7e982e
  if (yyerrstatus == 3)
Packit 7e982e
    {
Packit 7e982e
      /* If just tried and failed to reuse lookahead token after an
Packit 7e982e
	 error, discard it.  */
Packit 7e982e
Packit 7e982e
      if (yychar <= YYEOF)
Packit 7e982e
	{
Packit 7e982e
	  /* Return failure if at end of input.  */
Packit 7e982e
	  if (yychar == YYEOF)
Packit 7e982e
	    YYABORT;
Packit 7e982e
	}
Packit 7e982e
      else
Packit 7e982e
	{
Packit 7e982e
	  yydestruct ("Error: discarding",
Packit 7e982e
		      yytoken, &yylval);
Packit 7e982e
	  yychar = YYEMPTY;
Packit 7e982e
	}
Packit 7e982e
    }
Packit 7e982e
Packit 7e982e
  /* Else will try to reuse lookahead token after shifting the error
Packit 7e982e
     token.  */
Packit 7e982e
  goto yyerrlab1;
Packit 7e982e
Packit 7e982e
Packit 7e982e
/*---------------------------------------------------.
Packit 7e982e
| yyerrorlab -- error raised explicitly by YYERROR.  |
Packit 7e982e
`---------------------------------------------------*/
Packit 7e982e
yyerrorlab:
Packit 7e982e
Packit 7e982e
  /* Pacify compilers like GCC when the user code never invokes
Packit 7e982e
     YYERROR and the label yyerrorlab therefore never appears in user
Packit 7e982e
     code.  */
Packit 7e982e
  if (/*CONSTCOND*/ 0)
Packit 7e982e
     goto yyerrorlab;
Packit 7e982e
Packit 7e982e
  /* Do not reclaim the symbols of the rule which action triggered
Packit 7e982e
     this YYERROR.  */
Packit 7e982e
  YYPOPSTACK (yylen);
Packit 7e982e
  yylen = 0;
Packit 7e982e
  YY_STACK_PRINT (yyss, yyssp);
Packit 7e982e
  yystate = *yyssp;
Packit 7e982e
  goto yyerrlab1;
Packit 7e982e
Packit 7e982e
Packit 7e982e
/*-------------------------------------------------------------.
Packit 7e982e
| yyerrlab1 -- common code for both syntax error and YYERROR.  |
Packit 7e982e
`-------------------------------------------------------------*/
Packit 7e982e
yyerrlab1:
Packit 7e982e
  yyerrstatus = 3;	/* Each real token shifted decrements this.  */
Packit 7e982e
Packit 7e982e
  for (;;)
Packit 7e982e
    {
Packit 7e982e
      yyn = yypact[yystate];
Packit 7e982e
      if (!yypact_value_is_default (yyn))
Packit 7e982e
	{
Packit 7e982e
	  yyn += YYTERROR;
Packit 7e982e
	  if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
Packit 7e982e
	    {
Packit 7e982e
	      yyn = yytable[yyn];
Packit 7e982e
	      if (0 < yyn)
Packit 7e982e
		break;
Packit 7e982e
	    }
Packit 7e982e
	}
Packit 7e982e
Packit 7e982e
      /* Pop the current state because it cannot handle the error token.  */
Packit 7e982e
      if (yyssp == yyss)
Packit 7e982e
	YYABORT;
Packit 7e982e
Packit 7e982e
Packit 7e982e
      yydestruct ("Error: popping",
Packit 7e982e
		  yystos[yystate], yyvsp);
Packit 7e982e
      YYPOPSTACK (1);
Packit 7e982e
      yystate = *yyssp;
Packit 7e982e
      YY_STACK_PRINT (yyss, yyssp);
Packit 7e982e
    }
Packit 7e982e
Packit 7e982e
  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
Packit 7e982e
  *++yyvsp = yylval;
Packit 7e982e
  YY_IGNORE_MAYBE_UNINITIALIZED_END
Packit 7e982e
Packit 7e982e
Packit 7e982e
  /* Shift the error token.  */
Packit 7e982e
  YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
Packit 7e982e
Packit 7e982e
  yystate = yyn;
Packit 7e982e
  goto yynewstate;
Packit 7e982e
Packit 7e982e
Packit 7e982e
/*-------------------------------------.
Packit 7e982e
| yyacceptlab -- YYACCEPT comes here.  |
Packit 7e982e
`-------------------------------------*/
Packit 7e982e
yyacceptlab:
Packit 7e982e
  yyresult = 0;
Packit 7e982e
  goto yyreturn;
Packit 7e982e
Packit 7e982e
/*-----------------------------------.
Packit 7e982e
| yyabortlab -- YYABORT comes here.  |
Packit 7e982e
`-----------------------------------*/
Packit 7e982e
yyabortlab:
Packit 7e982e
  yyresult = 1;
Packit 7e982e
  goto yyreturn;
Packit 7e982e
Packit 7e982e
#if !defined yyoverflow || YYERROR_VERBOSE
Packit 7e982e
/*-------------------------------------------------.
Packit 7e982e
| yyexhaustedlab -- memory exhaustion comes here.  |
Packit 7e982e
`-------------------------------------------------*/
Packit 7e982e
yyexhaustedlab:
Packit 7e982e
  yyerror (YY_("memory exhausted"));
Packit 7e982e
  yyresult = 2;
Packit 7e982e
  /* Fall through.  */
Packit 7e982e
#endif
Packit 7e982e
Packit 7e982e
yyreturn:
Packit 7e982e
  if (yychar != YYEMPTY)
Packit 7e982e
    {
Packit 7e982e
      /* Make sure we have latest lookahead translation.  See comments at
Packit 7e982e
         user semantic actions for why this is necessary.  */
Packit 7e982e
      yytoken = YYTRANSLATE (yychar);
Packit 7e982e
      yydestruct ("Cleanup: discarding lookahead",
Packit 7e982e
                  yytoken, &yylval);
Packit 7e982e
    }
Packit 7e982e
  /* Do not reclaim the symbols of the rule which action triggered
Packit 7e982e
     this YYABORT or YYACCEPT.  */
Packit 7e982e
  YYPOPSTACK (yylen);
Packit 7e982e
  YY_STACK_PRINT (yyss, yyssp);
Packit 7e982e
  while (yyssp != yyss)
Packit 7e982e
    {
Packit 7e982e
      yydestruct ("Cleanup: popping",
Packit 7e982e
		  yystos[*yyssp], yyvsp);
Packit 7e982e
      YYPOPSTACK (1);
Packit 7e982e
    }
Packit 7e982e
#ifndef yyoverflow
Packit 7e982e
  if (yyss != yyssa)
Packit 7e982e
    YYSTACK_FREE (yyss);
Packit 7e982e
#endif
Packit 7e982e
#if YYERROR_VERBOSE
Packit 7e982e
  if (yymsg != yymsgbuf)
Packit 7e982e
    YYSTACK_FREE (yymsg);
Packit 7e982e
#endif
Packit 7e982e
  /* Make sure YYID is used.  */
Packit 7e982e
  return YYID (yyresult);
Packit 7e982e
}
Packit 7e982e
Packit 7e982e
Packit 7e982e
/* Line 2055 of yacc.c  */
Packit 7e982e
#line 165 "parse_y.y"
Packit 7e982e
Packit 7e982e
Packit 7e982e
typedef struct node_s {
Packit 7e982e
    struct node_s *left, *right;
Packit 7e982e
    const char *key;
Packit 7e982e
    char *value;
Packit 7e982e
} *node_t;
Packit 7e982e
Packit 7e982e
node_t label_root = NULL;
Packit 7e982e
node_t counter_root = NULL;
Packit 7e982e
Packit 7e982e
static const char *find_key(node_t root, const char *key)
Packit 7e982e
{
Packit 7e982e
    while (root) {
Packit 7e982e
	int cmp = strcmp(key, root->key);
Packit 7e982e
Packit 7e982e
	if (cmp > 0) {
Packit 7e982e
	    root = root->right;
Packit 7e982e
	} else if (cmp) {
Packit 7e982e
	    root = root->left;
Packit 7e982e
	} else {
Packit 7e982e
	    return root->value;
Packit 7e982e
	}
Packit 7e982e
    }
Packit 7e982e
    return NULL;
Packit 7e982e
}
Packit 7e982e
Packit 7e982e
static node_t set_key(node_t root, const char *key, const char *value)
Packit 7e982e
{
Packit 7e982e
    if (root) {
Packit 7e982e
	int cmp = strcmp(key, root->key);
Packit 7e982e
	if (cmp > 0) {
Packit 7e982e
	    root->right = set_key(root->right, key, value);
Packit 7e982e
	} else if (cmp) {
Packit 7e982e
	    root->left = set_key(root->left, key, value);
Packit 7e982e
	} else {
Packit 7e982e
	    free(root->value);
Packit 7e982e
	    root->value = strdup(value);
Packit 7e982e
	}
Packit 7e982e
    } else {
Packit 7e982e
	root = malloc(sizeof(struct node_s));
Packit 7e982e
	root->right = root->left = NULL;
Packit 7e982e
	root->key = strdup(key);
Packit 7e982e
	root->value = strdup(value);
Packit 7e982e
    }
Packit 7e982e
    return root;
Packit 7e982e
}
Packit 7e982e
Packit 7e982e
void yyerror(const char *x)
Packit 7e982e
{
Packit 7e982e
    fprintf(stderr, "line %d: %s\n", line, x);
Packit 7e982e
}
Packit 7e982e
Packit 7e982e
char *get_label(const char *label)
Packit 7e982e
{
Packit 7e982e
    const char *found = find_key(label_root, label);
Packit 7e982e
Packit 7e982e
    if (found) {
Packit 7e982e
	return strdup(found);
Packit 7e982e
    }
Packit 7e982e
    return NULL;
Packit 7e982e
}
Packit 7e982e
Packit 7e982e
void set_label(const char *label, const char *target)
Packit 7e982e
{
Packit 7e982e
    if (target == NULL) {
Packit 7e982e
	yyerror("no hanging value for label");
Packit 7e982e
	target = "";	/* avoid trigraph warning */
Packit 7e982e
    }
Packit 7e982e
    label_root = set_key(label_root, label, target);
Packit 7e982e
}
Packit 7e982e
Packit 7e982e
char *new_counter(const char *key)
Packit 7e982e
{
Packit 7e982e
    int i=0, j, ndollars = 0;
Packit 7e982e
    const char *old;
Packit 7e982e
    char *new;
Packit 7e982e
Packit 7e982e
    if (key[i++] != '#') {
Packit 7e982e
	yyerror("bad index");
Packit 7e982e
	return strdup("");	/* avoid trigraph warning */
Packit 7e982e
    }
Packit 7e982e
Packit 7e982e
    while (key[i] == '$') {
Packit 7e982e
	++ndollars;
Packit 7e982e
	++i;
Packit 7e982e
    }
Packit 7e982e
Packit 7e982e
    key += i;
Packit 7e982e
    old = find_key(counter_root, key);
Packit 7e982e
    new = malloc(20*ndollars);
Packit 7e982e
Packit 7e982e
    if (old) {
Packit 7e982e
	for (j=0; ndollars > 1 && old[j]; ) {
Packit 7e982e
	    if (old[j++] == '.' && --ndollars <= 0) {
Packit 7e982e
		break;
Packit 7e982e
	    }
Packit 7e982e
	}
Packit 7e982e
	if (j) {
Packit 7e982e
	    strncpy(new, old, j);
Packit 7e982e
	}
Packit 7e982e
	if (old[j]) {
Packit 7e982e
	    i = atoi(old+j);
Packit 7e982e
	} else {
Packit 7e982e
	    new[j++] = '.';
Packit 7e982e
	    i = 0;
Packit 7e982e
	}
Packit 7e982e
    } else {
Packit 7e982e
	j=0;
Packit 7e982e
	while (--ndollars > 0) {
Packit 7e982e
	    new[j++] = '0';
Packit 7e982e
	    new[j++] = '.';
Packit 7e982e
	}
Packit 7e982e
	i = 0;
Packit 7e982e
    }
Packit 7e982e
    new[j] = '\0';
Packit 7e982e
    sprintf(new+j, "%d", ++i);
Packit 7e982e
Packit 7e982e
    counter_root = set_key(counter_root, key, new);
Packit 7e982e
Packit 7e982e
    if (last_label) {
Packit 7e982e
	free(last_label);
Packit 7e982e
    }
Packit 7e982e
    last_label = strdup(new);
Packit 7e982e
Packit 7e982e
    return new;
Packit 7e982e
}
Packit 7e982e
Packit 7e982e
int
Packit 7e982e
main(void)
Packit 7e982e
{
Packit 7e982e
    return yyparse();
Packit 7e982e
}