1178825Sdfr/* A Bison parser, made by GNU Bison 2.3. */ 2178825Sdfr 3178825Sdfr/* Skeleton implementation for Bison's Yacc-like parsers in C 4178825Sdfr 5178825Sdfr Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 6178825Sdfr Free Software Foundation, Inc. 7178825Sdfr 8178825Sdfr This program is free software; you can redistribute it and/or modify 9178825Sdfr it under the terms of the GNU General Public License as published by 10178825Sdfr the Free Software Foundation; either version 2, or (at your option) 11178825Sdfr any later version. 12178825Sdfr 13178825Sdfr This program is distributed in the hope that it will be useful, 14178825Sdfr but WITHOUT ANY WARRANTY; without even the implied warranty of 15178825Sdfr MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16178825Sdfr GNU General Public License for more details. 17178825Sdfr 18178825Sdfr You should have received a copy of the GNU General Public License 19178825Sdfr along with this program; if not, write to the Free Software 20178825Sdfr Foundation, Inc., 51 Franklin Street, Fifth Floor, 21178825Sdfr Boston, MA 02110-1301, USA. */ 22178825Sdfr 23178825Sdfr/* As a special exception, you may create a larger work that contains 24178825Sdfr part or all of the Bison parser skeleton and distribute that work 25178825Sdfr under terms of your choice, so long as that work isn't itself a 26178825Sdfr parser generator using the skeleton or a modified version thereof 27178825Sdfr as a parser skeleton. Alternatively, if you modify or redistribute 28178825Sdfr the parser skeleton itself, you may (at your option) remove this 29178825Sdfr special exception, which will cause the skeleton and the resulting 30178825Sdfr Bison output files to be licensed under the GNU General Public 31178825Sdfr License without this special exception. 32178825Sdfr 33178825Sdfr This special exception was added by the Free Software Foundation in 34178825Sdfr version 2.2 of Bison. */ 35178825Sdfr 36178825Sdfr/* C LALR(1) parser skeleton written by Richard Stallman, by 37178825Sdfr simplifying the original so-called "semantic" parser. */ 38178825Sdfr 39178825Sdfr/* All symbols defined below should begin with yy or YY, to avoid 40178825Sdfr infringing on user name space. This should be done even for local 41178825Sdfr variables, as they might otherwise be expanded by user macros. 42178825Sdfr There are some unavoidable exceptions within include files to 43178825Sdfr define necessary library symbols; they are noted "INFRINGES ON 44178825Sdfr USER NAME SPACE" below. */ 45178825Sdfr 46178825Sdfr/* Identify Bison output. */ 47178825Sdfr#define YYBISON 1 48178825Sdfr 49178825Sdfr/* Bison version. */ 50178825Sdfr#define YYBISON_VERSION "2.3" 51178825Sdfr 52178825Sdfr/* Skeleton name. */ 53178825Sdfr#define YYSKELETON_NAME "yacc.c" 54178825Sdfr 55178825Sdfr/* Pure parsers. */ 56178825Sdfr#define YYPURE 0 57178825Sdfr 58178825Sdfr/* Using locations. */ 59178825Sdfr#define YYLSP_NEEDED 0 60178825Sdfr 61178825Sdfr 62178825Sdfr 63178825Sdfr/* Tokens. */ 64178825Sdfr#ifndef YYTOKENTYPE 65178825Sdfr# define YYTOKENTYPE 66178825Sdfr /* Put the tokens into the symbol table, so that GDB and other debuggers 67178825Sdfr know about them. */ 68178825Sdfr enum yytokentype { 69178825Sdfr ET = 258, 70178825Sdfr INDEX = 259, 71178825Sdfr PREFIX = 260, 72178825Sdfr EC = 261, 73178825Sdfr ID = 262, 74178825Sdfr END = 263, 75178825Sdfr STRING = 264, 76178825Sdfr NUMBER = 265 77178825Sdfr }; 78178825Sdfr#endif 79178825Sdfr/* Tokens. */ 80178825Sdfr#define ET 258 81178825Sdfr#define INDEX 259 82178825Sdfr#define PREFIX 260 83178825Sdfr#define EC 261 84178825Sdfr#define ID 262 85178825Sdfr#define END 263 86178825Sdfr#define STRING 264 87178825Sdfr#define NUMBER 265 88178825Sdfr 89178825Sdfr 90178825Sdfr 91178825Sdfr 92178825Sdfr/* Copy the first part of user declarations. */ 93178825Sdfr#line 1 "parse.y" 94178825Sdfr 95178825Sdfr/* 96233294Sstas * Copyright (c) 1998 - 2000 Kungliga Tekniska H��gskolan 97233294Sstas * (Royal Institute of Technology, Stockholm, Sweden). 98233294Sstas * All rights reserved. 99178825Sdfr * 100233294Sstas * Redistribution and use in source and binary forms, with or without 101233294Sstas * modification, are permitted provided that the following conditions 102233294Sstas * are met: 103178825Sdfr * 104233294Sstas * 1. Redistributions of source code must retain the above copyright 105233294Sstas * notice, this list of conditions and the following disclaimer. 106178825Sdfr * 107233294Sstas * 2. Redistributions in binary form must reproduce the above copyright 108233294Sstas * notice, this list of conditions and the following disclaimer in the 109233294Sstas * documentation and/or other materials provided with the distribution. 110178825Sdfr * 111233294Sstas * 3. Neither the name of the Institute nor the names of its contributors 112233294Sstas * may be used to endorse or promote products derived from this software 113233294Sstas * without specific prior written permission. 114178825Sdfr * 115233294Sstas * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND 116233294Sstas * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 117233294Sstas * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 118233294Sstas * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE 119233294Sstas * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 120233294Sstas * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 121233294Sstas * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 122233294Sstas * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 123233294Sstas * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 124233294Sstas * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 125233294Sstas * SUCH DAMAGE. 126178825Sdfr */ 127178825Sdfr 128178825Sdfr#include "compile_et.h" 129178825Sdfr#include "lex.h" 130178825Sdfr 131178825Sdfrvoid yyerror (char *s); 132178825Sdfrstatic long name2number(const char *str); 133178825Sdfr 134178825Sdfrextern char *yytext; 135178825Sdfr 136178825Sdfr/* This is for bison */ 137178825Sdfr 138178825Sdfr#if !defined(alloca) && !defined(HAVE_ALLOCA) 139178825Sdfr#define alloca(x) malloc(x) 140178825Sdfr#endif 141178825Sdfr 142233294Sstas#define YYMALLOC malloc 143233294Sstas#define YYFREE free 144178825Sdfr 145178825Sdfr 146233294Sstas 147178825Sdfr/* Enabling traces. */ 148178825Sdfr#ifndef YYDEBUG 149178825Sdfr# define YYDEBUG 0 150178825Sdfr#endif 151178825Sdfr 152178825Sdfr/* Enabling verbose error messages. */ 153178825Sdfr#ifdef YYERROR_VERBOSE 154178825Sdfr# undef YYERROR_VERBOSE 155178825Sdfr# define YYERROR_VERBOSE 1 156178825Sdfr#else 157178825Sdfr# define YYERROR_VERBOSE 0 158178825Sdfr#endif 159178825Sdfr 160178825Sdfr/* Enabling the token table. */ 161178825Sdfr#ifndef YYTOKEN_TABLE 162178825Sdfr# define YYTOKEN_TABLE 0 163178825Sdfr#endif 164178825Sdfr 165178825Sdfr#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED 166178825Sdfrtypedef union YYSTYPE 167233294Sstas#line 54 "parse.y" 168178825Sdfr{ 169178825Sdfr char *string; 170178825Sdfr int number; 171178825Sdfr} 172178825Sdfr/* Line 193 of yacc.c. */ 173233294Sstas#line 174 "parse.c" 174178825Sdfr YYSTYPE; 175178825Sdfr# define yystype YYSTYPE /* obsolescent; will be withdrawn */ 176178825Sdfr# define YYSTYPE_IS_DECLARED 1 177178825Sdfr# define YYSTYPE_IS_TRIVIAL 1 178178825Sdfr#endif 179178825Sdfr 180178825Sdfr 181178825Sdfr 182178825Sdfr/* Copy the second part of user declarations. */ 183178825Sdfr 184178825Sdfr 185178825Sdfr/* Line 216 of yacc.c. */ 186233294Sstas#line 187 "parse.c" 187178825Sdfr 188178825Sdfr#ifdef short 189178825Sdfr# undef short 190178825Sdfr#endif 191178825Sdfr 192178825Sdfr#ifdef YYTYPE_UINT8 193178825Sdfrtypedef YYTYPE_UINT8 yytype_uint8; 194178825Sdfr#else 195178825Sdfrtypedef unsigned char yytype_uint8; 196178825Sdfr#endif 197178825Sdfr 198178825Sdfr#ifdef YYTYPE_INT8 199178825Sdfrtypedef YYTYPE_INT8 yytype_int8; 200178825Sdfr#elif (defined __STDC__ || defined __C99__FUNC__ \ 201178825Sdfr || defined __cplusplus || defined _MSC_VER) 202178825Sdfrtypedef signed char yytype_int8; 203178825Sdfr#else 204178825Sdfrtypedef short int yytype_int8; 205178825Sdfr#endif 206178825Sdfr 207178825Sdfr#ifdef YYTYPE_UINT16 208178825Sdfrtypedef YYTYPE_UINT16 yytype_uint16; 209178825Sdfr#else 210178825Sdfrtypedef unsigned short int yytype_uint16; 211178825Sdfr#endif 212178825Sdfr 213178825Sdfr#ifdef YYTYPE_INT16 214178825Sdfrtypedef YYTYPE_INT16 yytype_int16; 215178825Sdfr#else 216178825Sdfrtypedef short int yytype_int16; 217178825Sdfr#endif 218178825Sdfr 219178825Sdfr#ifndef YYSIZE_T 220178825Sdfr# ifdef __SIZE_TYPE__ 221178825Sdfr# define YYSIZE_T __SIZE_TYPE__ 222178825Sdfr# elif defined size_t 223178825Sdfr# define YYSIZE_T size_t 224178825Sdfr# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ 225178825Sdfr || defined __cplusplus || defined _MSC_VER) 226178825Sdfr# include <stddef.h> /* INFRINGES ON USER NAME SPACE */ 227178825Sdfr# define YYSIZE_T size_t 228178825Sdfr# else 229178825Sdfr# define YYSIZE_T unsigned int 230178825Sdfr# endif 231178825Sdfr#endif 232178825Sdfr 233178825Sdfr#define YYSIZE_MAXIMUM ((YYSIZE_T) -1) 234178825Sdfr 235178825Sdfr#ifndef YY_ 236178825Sdfr# if defined YYENABLE_NLS && YYENABLE_NLS 237178825Sdfr# if ENABLE_NLS 238178825Sdfr# include <libintl.h> /* INFRINGES ON USER NAME SPACE */ 239178825Sdfr# define YY_(msgid) dgettext ("bison-runtime", msgid) 240178825Sdfr# endif 241178825Sdfr# endif 242178825Sdfr# ifndef YY_ 243178825Sdfr# define YY_(msgid) msgid 244178825Sdfr# endif 245178825Sdfr#endif 246178825Sdfr 247178825Sdfr/* Suppress unused-variable warnings by "using" E. */ 248178825Sdfr#if ! defined lint || defined __GNUC__ 249178825Sdfr# define YYUSE(e) ((void) (e)) 250178825Sdfr#else 251178825Sdfr# define YYUSE(e) /* empty */ 252178825Sdfr#endif 253178825Sdfr 254178825Sdfr/* Identity function, used to suppress warnings about constant conditions. */ 255178825Sdfr#ifndef lint 256178825Sdfr# define YYID(n) (n) 257178825Sdfr#else 258178825Sdfr#if (defined __STDC__ || defined __C99__FUNC__ \ 259178825Sdfr || defined __cplusplus || defined _MSC_VER) 260178825Sdfrstatic int 261178825SdfrYYID (int i) 262178825Sdfr#else 263178825Sdfrstatic int 264178825SdfrYYID (i) 265178825Sdfr int i; 266178825Sdfr#endif 267178825Sdfr{ 268178825Sdfr return i; 269178825Sdfr} 270178825Sdfr#endif 271178825Sdfr 272178825Sdfr#if ! defined yyoverflow || YYERROR_VERBOSE 273178825Sdfr 274178825Sdfr/* The parser invokes alloca or malloc; define the necessary symbols. */ 275178825Sdfr 276178825Sdfr# ifdef YYSTACK_USE_ALLOCA 277178825Sdfr# if YYSTACK_USE_ALLOCA 278178825Sdfr# ifdef __GNUC__ 279178825Sdfr# define YYSTACK_ALLOC __builtin_alloca 280178825Sdfr# elif defined __BUILTIN_VA_ARG_INCR 281178825Sdfr# include <alloca.h> /* INFRINGES ON USER NAME SPACE */ 282178825Sdfr# elif defined _AIX 283178825Sdfr# define YYSTACK_ALLOC __alloca 284178825Sdfr# elif defined _MSC_VER 285178825Sdfr# include <malloc.h> /* INFRINGES ON USER NAME SPACE */ 286178825Sdfr# define alloca _alloca 287178825Sdfr# else 288178825Sdfr# define YYSTACK_ALLOC alloca 289178825Sdfr# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ 290178825Sdfr || defined __cplusplus || defined _MSC_VER) 291178825Sdfr# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ 292178825Sdfr# ifndef _STDLIB_H 293178825Sdfr# define _STDLIB_H 1 294178825Sdfr# endif 295178825Sdfr# endif 296178825Sdfr# endif 297178825Sdfr# endif 298178825Sdfr# endif 299178825Sdfr 300178825Sdfr# ifdef YYSTACK_ALLOC 301178825Sdfr /* Pacify GCC's `empty if-body' warning. */ 302178825Sdfr# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) 303178825Sdfr# ifndef YYSTACK_ALLOC_MAXIMUM 304178825Sdfr /* The OS might guarantee only one guard page at the bottom of the stack, 305178825Sdfr and a page size can be as small as 4096 bytes. So we cannot safely 306178825Sdfr invoke alloca (N) if N exceeds 4096. Use a slightly smaller number 307178825Sdfr to allow for a few compiler-allocated temporary stack slots. */ 308178825Sdfr# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ 309178825Sdfr# endif 310178825Sdfr# else 311178825Sdfr# define YYSTACK_ALLOC YYMALLOC 312178825Sdfr# define YYSTACK_FREE YYFREE 313178825Sdfr# ifndef YYSTACK_ALLOC_MAXIMUM 314178825Sdfr# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM 315178825Sdfr# endif 316178825Sdfr# if (defined __cplusplus && ! defined _STDLIB_H \ 317178825Sdfr && ! ((defined YYMALLOC || defined malloc) \ 318178825Sdfr && (defined YYFREE || defined free))) 319178825Sdfr# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ 320178825Sdfr# ifndef _STDLIB_H 321178825Sdfr# define _STDLIB_H 1 322178825Sdfr# endif 323178825Sdfr# endif 324178825Sdfr# ifndef YYMALLOC 325178825Sdfr# define YYMALLOC malloc 326178825Sdfr# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ 327178825Sdfr || defined __cplusplus || defined _MSC_VER) 328178825Sdfrvoid *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ 329178825Sdfr# endif 330178825Sdfr# endif 331178825Sdfr# ifndef YYFREE 332178825Sdfr# define YYFREE free 333178825Sdfr# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ 334178825Sdfr || defined __cplusplus || defined _MSC_VER) 335178825Sdfrvoid free (void *); /* INFRINGES ON USER NAME SPACE */ 336178825Sdfr# endif 337178825Sdfr# endif 338178825Sdfr# endif 339178825Sdfr#endif /* ! defined yyoverflow || YYERROR_VERBOSE */ 340178825Sdfr 341178825Sdfr 342178825Sdfr#if (! defined yyoverflow \ 343178825Sdfr && (! defined __cplusplus \ 344178825Sdfr || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) 345178825Sdfr 346178825Sdfr/* A type that is properly aligned for any stack member. */ 347178825Sdfrunion yyalloc 348178825Sdfr{ 349178825Sdfr yytype_int16 yyss; 350178825Sdfr YYSTYPE yyvs; 351178825Sdfr }; 352178825Sdfr 353178825Sdfr/* The size of the maximum gap between one aligned stack and the next. */ 354178825Sdfr# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) 355178825Sdfr 356178825Sdfr/* The size of an array large to enough to hold all stacks, each with 357178825Sdfr N elements. */ 358178825Sdfr# define YYSTACK_BYTES(N) \ 359178825Sdfr ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ 360178825Sdfr + YYSTACK_GAP_MAXIMUM) 361178825Sdfr 362178825Sdfr/* Copy COUNT objects from FROM to TO. The source and destination do 363178825Sdfr not overlap. */ 364178825Sdfr# ifndef YYCOPY 365178825Sdfr# if defined __GNUC__ && 1 < __GNUC__ 366178825Sdfr# define YYCOPY(To, From, Count) \ 367178825Sdfr __builtin_memcpy (To, From, (Count) * sizeof (*(From))) 368178825Sdfr# else 369178825Sdfr# define YYCOPY(To, From, Count) \ 370178825Sdfr do \ 371178825Sdfr { \ 372178825Sdfr YYSIZE_T yyi; \ 373178825Sdfr for (yyi = 0; yyi < (Count); yyi++) \ 374178825Sdfr (To)[yyi] = (From)[yyi]; \ 375178825Sdfr } \ 376178825Sdfr while (YYID (0)) 377178825Sdfr# endif 378178825Sdfr# endif 379178825Sdfr 380178825Sdfr/* Relocate STACK from its old location to the new one. The 381178825Sdfr local variables YYSIZE and YYSTACKSIZE give the old and new number of 382178825Sdfr elements in the stack, and YYPTR gives the new location of the 383178825Sdfr stack. Advance YYPTR to a properly aligned location for the next 384178825Sdfr stack. */ 385178825Sdfr# define YYSTACK_RELOCATE(Stack) \ 386178825Sdfr do \ 387178825Sdfr { \ 388178825Sdfr YYSIZE_T yynewbytes; \ 389178825Sdfr YYCOPY (&yyptr->Stack, Stack, yysize); \ 390178825Sdfr Stack = &yyptr->Stack; \ 391178825Sdfr yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ 392178825Sdfr yyptr += yynewbytes / sizeof (*yyptr); \ 393178825Sdfr } \ 394178825Sdfr while (YYID (0)) 395178825Sdfr 396178825Sdfr#endif 397178825Sdfr 398178825Sdfr/* YYFINAL -- State number of the termination state. */ 399178825Sdfr#define YYFINAL 9 400178825Sdfr/* YYLAST -- Last index in YYTABLE. */ 401178825Sdfr#define YYLAST 23 402178825Sdfr 403178825Sdfr/* YYNTOKENS -- Number of terminals. */ 404178825Sdfr#define YYNTOKENS 12 405178825Sdfr/* YYNNTS -- Number of nonterminals. */ 406178825Sdfr#define YYNNTS 7 407178825Sdfr/* YYNRULES -- Number of rules. */ 408178825Sdfr#define YYNRULES 15 409178825Sdfr/* YYNRULES -- Number of states. */ 410178825Sdfr#define YYNSTATES 24 411178825Sdfr 412178825Sdfr/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ 413178825Sdfr#define YYUNDEFTOK 2 414178825Sdfr#define YYMAXUTOK 265 415178825Sdfr 416178825Sdfr#define YYTRANSLATE(YYX) \ 417178825Sdfr ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) 418178825Sdfr 419178825Sdfr/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ 420178825Sdfrstatic const yytype_uint8 yytranslate[] = 421178825Sdfr{ 422178825Sdfr 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 423178825Sdfr 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 424178825Sdfr 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 425178825Sdfr 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 426178825Sdfr 2, 2, 2, 2, 11, 2, 2, 2, 2, 2, 427178825Sdfr 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 428178825Sdfr 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 429178825Sdfr 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 430178825Sdfr 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 431178825Sdfr 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 432178825Sdfr 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 433178825Sdfr 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 434178825Sdfr 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 435178825Sdfr 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 436178825Sdfr 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 437178825Sdfr 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 438178825Sdfr 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 439178825Sdfr 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 440178825Sdfr 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 441178825Sdfr 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 442178825Sdfr 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 443178825Sdfr 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 444178825Sdfr 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 445178825Sdfr 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 446178825Sdfr 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 447178825Sdfr 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, 448178825Sdfr 5, 6, 7, 8, 9, 10 449178825Sdfr}; 450178825Sdfr 451178825Sdfr#if YYDEBUG 452178825Sdfr/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in 453178825Sdfr YYRHS. */ 454178825Sdfrstatic const yytype_uint8 yyprhs[] = 455178825Sdfr{ 456178825Sdfr 0, 0, 3, 4, 7, 10, 12, 15, 18, 22, 457178825Sdfr 24, 27, 30, 33, 35, 40 458178825Sdfr}; 459178825Sdfr 460178825Sdfr/* YYRHS -- A `-1'-separated list of the rules' RHS. */ 461178825Sdfrstatic const yytype_int8 yyrhs[] = 462178825Sdfr{ 463178825Sdfr 13, 0, -1, -1, 14, 17, -1, 15, 16, -1, 464178825Sdfr 16, -1, 7, 9, -1, 3, 9, -1, 3, 9, 465178825Sdfr 9, -1, 18, -1, 17, 18, -1, 4, 10, -1, 466178825Sdfr 5, 9, -1, 5, -1, 6, 9, 11, 9, -1, 467178825Sdfr 8, -1 468178825Sdfr}; 469178825Sdfr 470178825Sdfr/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ 471178825Sdfrstatic const yytype_uint8 yyrline[] = 472178825Sdfr{ 473233294Sstas 0, 65, 65, 66, 69, 70, 73, 79, 85, 94, 474233294Sstas 95, 98, 102, 110, 117, 137 475178825Sdfr}; 476178825Sdfr#endif 477178825Sdfr 478178825Sdfr#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE 479178825Sdfr/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. 480178825Sdfr First, the terminals, then, starting at YYNTOKENS, nonterminals. */ 481178825Sdfrstatic const char *const yytname[] = 482178825Sdfr{ 483178825Sdfr "$end", "error", "$undefined", "ET", "INDEX", "PREFIX", "EC", "ID", 484178825Sdfr "END", "STRING", "NUMBER", "','", "$accept", "file", "header", "id", 485178825Sdfr "et", "statements", "statement", 0 486178825Sdfr}; 487178825Sdfr#endif 488178825Sdfr 489178825Sdfr# ifdef YYPRINT 490178825Sdfr/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to 491178825Sdfr token YYLEX-NUM. */ 492178825Sdfrstatic const yytype_uint16 yytoknum[] = 493178825Sdfr{ 494178825Sdfr 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 495178825Sdfr 265, 44 496178825Sdfr}; 497178825Sdfr# endif 498178825Sdfr 499178825Sdfr/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ 500178825Sdfrstatic const yytype_uint8 yyr1[] = 501178825Sdfr{ 502178825Sdfr 0, 12, 13, 13, 14, 14, 15, 16, 16, 17, 503178825Sdfr 17, 18, 18, 18, 18, 18 504178825Sdfr}; 505178825Sdfr 506178825Sdfr/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ 507178825Sdfrstatic const yytype_uint8 yyr2[] = 508178825Sdfr{ 509178825Sdfr 0, 2, 0, 2, 2, 1, 2, 2, 3, 1, 510178825Sdfr 2, 2, 2, 1, 4, 1 511178825Sdfr}; 512178825Sdfr 513178825Sdfr/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state 514178825Sdfr STATE-NUM when YYTABLE doesn't specify something else to do. Zero 515178825Sdfr means the default is an error. */ 516178825Sdfrstatic const yytype_uint8 yydefact[] = 517178825Sdfr{ 518178825Sdfr 2, 0, 0, 0, 0, 0, 5, 7, 6, 1, 519178825Sdfr 0, 13, 0, 15, 3, 9, 4, 8, 11, 12, 520178825Sdfr 0, 10, 0, 14 521178825Sdfr}; 522178825Sdfr 523178825Sdfr/* YYDEFGOTO[NTERM-NUM]. */ 524178825Sdfrstatic const yytype_int8 yydefgoto[] = 525178825Sdfr{ 526178825Sdfr -1, 3, 4, 5, 6, 14, 15 527178825Sdfr}; 528178825Sdfr 529178825Sdfr/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing 530178825Sdfr STATE-NUM. */ 531178825Sdfr#define YYPACT_NINF -5 532178825Sdfrstatic const yytype_int8 yypact[] = 533178825Sdfr{ 534178825Sdfr 0, -3, -1, 5, -4, 6, -5, 1, -5, -5, 535178825Sdfr 2, 4, 7, -5, -4, -5, -5, -5, -5, -5, 536178825Sdfr 3, -5, 8, -5 537178825Sdfr}; 538178825Sdfr 539178825Sdfr/* YYPGOTO[NTERM-NUM]. */ 540178825Sdfrstatic const yytype_int8 yypgoto[] = 541178825Sdfr{ 542178825Sdfr -5, -5, -5, -5, 10, -5, 9 543178825Sdfr}; 544178825Sdfr 545178825Sdfr/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If 546178825Sdfr positive, shift that token. If negative, reduce the rule which 547178825Sdfr number is the opposite. If zero, do what YYDEFACT says. 548178825Sdfr If YYTABLE_NINF, syntax error. */ 549178825Sdfr#define YYTABLE_NINF -1 550178825Sdfrstatic const yytype_uint8 yytable[] = 551178825Sdfr{ 552178825Sdfr 10, 11, 12, 1, 13, 9, 7, 2, 8, 1, 553178825Sdfr 17, 0, 18, 19, 22, 16, 20, 23, 0, 0, 554178825Sdfr 0, 0, 0, 21 555178825Sdfr}; 556178825Sdfr 557178825Sdfrstatic const yytype_int8 yycheck[] = 558178825Sdfr{ 559178825Sdfr 4, 5, 6, 3, 8, 0, 9, 7, 9, 3, 560178825Sdfr 9, -1, 10, 9, 11, 5, 9, 9, -1, -1, 561178825Sdfr -1, -1, -1, 14 562178825Sdfr}; 563178825Sdfr 564178825Sdfr/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing 565178825Sdfr symbol of state STATE-NUM. */ 566178825Sdfrstatic const yytype_uint8 yystos[] = 567178825Sdfr{ 568178825Sdfr 0, 3, 7, 13, 14, 15, 16, 9, 9, 0, 569178825Sdfr 4, 5, 6, 8, 17, 18, 16, 9, 10, 9, 570178825Sdfr 9, 18, 11, 9 571178825Sdfr}; 572178825Sdfr 573178825Sdfr#define yyerrok (yyerrstatus = 0) 574178825Sdfr#define yyclearin (yychar = YYEMPTY) 575178825Sdfr#define YYEMPTY (-2) 576178825Sdfr#define YYEOF 0 577178825Sdfr 578178825Sdfr#define YYACCEPT goto yyacceptlab 579178825Sdfr#define YYABORT goto yyabortlab 580178825Sdfr#define YYERROR goto yyerrorlab 581178825Sdfr 582178825Sdfr 583178825Sdfr/* Like YYERROR except do call yyerror. This remains here temporarily 584178825Sdfr to ease the transition to the new meaning of YYERROR, for GCC. 585178825Sdfr Once GCC version 2 has supplanted version 1, this can go. */ 586178825Sdfr 587178825Sdfr#define YYFAIL goto yyerrlab 588178825Sdfr 589178825Sdfr#define YYRECOVERING() (!!yyerrstatus) 590178825Sdfr 591178825Sdfr#define YYBACKUP(Token, Value) \ 592178825Sdfrdo \ 593178825Sdfr if (yychar == YYEMPTY && yylen == 1) \ 594178825Sdfr { \ 595178825Sdfr yychar = (Token); \ 596178825Sdfr yylval = (Value); \ 597178825Sdfr yytoken = YYTRANSLATE (yychar); \ 598178825Sdfr YYPOPSTACK (1); \ 599178825Sdfr goto yybackup; \ 600178825Sdfr } \ 601178825Sdfr else \ 602178825Sdfr { \ 603178825Sdfr yyerror (YY_("syntax error: cannot back up")); \ 604178825Sdfr YYERROR; \ 605178825Sdfr } \ 606178825Sdfrwhile (YYID (0)) 607178825Sdfr 608178825Sdfr 609178825Sdfr#define YYTERROR 1 610178825Sdfr#define YYERRCODE 256 611178825Sdfr 612178825Sdfr 613178825Sdfr/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. 614178825Sdfr If N is 0, then set CURRENT to the empty location which ends 615178825Sdfr the previous symbol: RHS[0] (always defined). */ 616178825Sdfr 617178825Sdfr#define YYRHSLOC(Rhs, K) ((Rhs)[K]) 618178825Sdfr#ifndef YYLLOC_DEFAULT 619178825Sdfr# define YYLLOC_DEFAULT(Current, Rhs, N) \ 620178825Sdfr do \ 621178825Sdfr if (YYID (N)) \ 622178825Sdfr { \ 623178825Sdfr (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ 624178825Sdfr (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ 625178825Sdfr (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ 626178825Sdfr (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ 627178825Sdfr } \ 628178825Sdfr else \ 629178825Sdfr { \ 630178825Sdfr (Current).first_line = (Current).last_line = \ 631178825Sdfr YYRHSLOC (Rhs, 0).last_line; \ 632178825Sdfr (Current).first_column = (Current).last_column = \ 633178825Sdfr YYRHSLOC (Rhs, 0).last_column; \ 634178825Sdfr } \ 635178825Sdfr while (YYID (0)) 636178825Sdfr#endif 637178825Sdfr 638178825Sdfr 639178825Sdfr/* YY_LOCATION_PRINT -- Print the location on the stream. 640178825Sdfr This macro was not mandated originally: define only if we know 641178825Sdfr we won't break user code: when these are the locations we know. */ 642178825Sdfr 643178825Sdfr#ifndef YY_LOCATION_PRINT 644178825Sdfr# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL 645178825Sdfr# define YY_LOCATION_PRINT(File, Loc) \ 646178825Sdfr fprintf (File, "%d.%d-%d.%d", \ 647178825Sdfr (Loc).first_line, (Loc).first_column, \ 648178825Sdfr (Loc).last_line, (Loc).last_column) 649178825Sdfr# else 650178825Sdfr# define YY_LOCATION_PRINT(File, Loc) ((void) 0) 651178825Sdfr# endif 652178825Sdfr#endif 653178825Sdfr 654178825Sdfr 655178825Sdfr/* YYLEX -- calling `yylex' with the right arguments. */ 656178825Sdfr 657178825Sdfr#ifdef YYLEX_PARAM 658178825Sdfr# define YYLEX yylex (YYLEX_PARAM) 659178825Sdfr#else 660178825Sdfr# define YYLEX yylex () 661178825Sdfr#endif 662178825Sdfr 663178825Sdfr/* Enable debugging if requested. */ 664178825Sdfr#if YYDEBUG 665178825Sdfr 666178825Sdfr# ifndef YYFPRINTF 667178825Sdfr# include <stdio.h> /* INFRINGES ON USER NAME SPACE */ 668178825Sdfr# define YYFPRINTF fprintf 669178825Sdfr# endif 670178825Sdfr 671178825Sdfr# define YYDPRINTF(Args) \ 672178825Sdfrdo { \ 673178825Sdfr if (yydebug) \ 674178825Sdfr YYFPRINTF Args; \ 675178825Sdfr} while (YYID (0)) 676178825Sdfr 677178825Sdfr# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ 678178825Sdfrdo { \ 679178825Sdfr if (yydebug) \ 680178825Sdfr { \ 681178825Sdfr YYFPRINTF (stderr, "%s ", Title); \ 682178825Sdfr yy_symbol_print (stderr, \ 683178825Sdfr Type, Value); \ 684178825Sdfr YYFPRINTF (stderr, "\n"); \ 685178825Sdfr } \ 686178825Sdfr} while (YYID (0)) 687178825Sdfr 688178825Sdfr 689178825Sdfr/*--------------------------------. 690178825Sdfr| Print this symbol on YYOUTPUT. | 691178825Sdfr`--------------------------------*/ 692178825Sdfr 693178825Sdfr/*ARGSUSED*/ 694178825Sdfr#if (defined __STDC__ || defined __C99__FUNC__ \ 695178825Sdfr || defined __cplusplus || defined _MSC_VER) 696178825Sdfrstatic void 697178825Sdfryy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) 698178825Sdfr#else 699178825Sdfrstatic void 700178825Sdfryy_symbol_value_print (yyoutput, yytype, yyvaluep) 701178825Sdfr FILE *yyoutput; 702178825Sdfr int yytype; 703178825Sdfr YYSTYPE const * const yyvaluep; 704178825Sdfr#endif 705178825Sdfr{ 706178825Sdfr if (!yyvaluep) 707178825Sdfr return; 708178825Sdfr# ifdef YYPRINT 709178825Sdfr if (yytype < YYNTOKENS) 710178825Sdfr YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); 711178825Sdfr# else 712178825Sdfr YYUSE (yyoutput); 713178825Sdfr# endif 714178825Sdfr switch (yytype) 715178825Sdfr { 716178825Sdfr default: 717178825Sdfr break; 718178825Sdfr } 719178825Sdfr} 720178825Sdfr 721178825Sdfr 722178825Sdfr/*--------------------------------. 723178825Sdfr| Print this symbol on YYOUTPUT. | 724178825Sdfr`--------------------------------*/ 725178825Sdfr 726178825Sdfr#if (defined __STDC__ || defined __C99__FUNC__ \ 727178825Sdfr || defined __cplusplus || defined _MSC_VER) 728178825Sdfrstatic void 729178825Sdfryy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) 730178825Sdfr#else 731178825Sdfrstatic void 732178825Sdfryy_symbol_print (yyoutput, yytype, yyvaluep) 733178825Sdfr FILE *yyoutput; 734178825Sdfr int yytype; 735178825Sdfr YYSTYPE const * const yyvaluep; 736178825Sdfr#endif 737178825Sdfr{ 738178825Sdfr if (yytype < YYNTOKENS) 739178825Sdfr YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); 740178825Sdfr else 741178825Sdfr YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); 742178825Sdfr 743178825Sdfr yy_symbol_value_print (yyoutput, yytype, yyvaluep); 744178825Sdfr YYFPRINTF (yyoutput, ")"); 745178825Sdfr} 746178825Sdfr 747178825Sdfr/*------------------------------------------------------------------. 748178825Sdfr| yy_stack_print -- Print the state stack from its BOTTOM up to its | 749178825Sdfr| TOP (included). | 750178825Sdfr`------------------------------------------------------------------*/ 751178825Sdfr 752178825Sdfr#if (defined __STDC__ || defined __C99__FUNC__ \ 753178825Sdfr || defined __cplusplus || defined _MSC_VER) 754178825Sdfrstatic void 755178825Sdfryy_stack_print (yytype_int16 *bottom, yytype_int16 *top) 756178825Sdfr#else 757178825Sdfrstatic void 758178825Sdfryy_stack_print (bottom, top) 759178825Sdfr yytype_int16 *bottom; 760178825Sdfr yytype_int16 *top; 761178825Sdfr#endif 762178825Sdfr{ 763178825Sdfr YYFPRINTF (stderr, "Stack now"); 764178825Sdfr for (; bottom <= top; ++bottom) 765178825Sdfr YYFPRINTF (stderr, " %d", *bottom); 766178825Sdfr YYFPRINTF (stderr, "\n"); 767178825Sdfr} 768178825Sdfr 769178825Sdfr# define YY_STACK_PRINT(Bottom, Top) \ 770178825Sdfrdo { \ 771178825Sdfr if (yydebug) \ 772178825Sdfr yy_stack_print ((Bottom), (Top)); \ 773178825Sdfr} while (YYID (0)) 774178825Sdfr 775178825Sdfr 776178825Sdfr/*------------------------------------------------. 777178825Sdfr| Report that the YYRULE is going to be reduced. | 778178825Sdfr`------------------------------------------------*/ 779178825Sdfr 780178825Sdfr#if (defined __STDC__ || defined __C99__FUNC__ \ 781178825Sdfr || defined __cplusplus || defined _MSC_VER) 782178825Sdfrstatic void 783178825Sdfryy_reduce_print (YYSTYPE *yyvsp, int yyrule) 784178825Sdfr#else 785178825Sdfrstatic void 786178825Sdfryy_reduce_print (yyvsp, yyrule) 787178825Sdfr YYSTYPE *yyvsp; 788178825Sdfr int yyrule; 789178825Sdfr#endif 790178825Sdfr{ 791178825Sdfr int yynrhs = yyr2[yyrule]; 792178825Sdfr int yyi; 793178825Sdfr unsigned long int yylno = yyrline[yyrule]; 794178825Sdfr YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", 795178825Sdfr yyrule - 1, yylno); 796178825Sdfr /* The symbols being reduced. */ 797178825Sdfr for (yyi = 0; yyi < yynrhs; yyi++) 798178825Sdfr { 799178825Sdfr fprintf (stderr, " $%d = ", yyi + 1); 800178825Sdfr yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], 801178825Sdfr &(yyvsp[(yyi + 1) - (yynrhs)]) 802178825Sdfr ); 803178825Sdfr fprintf (stderr, "\n"); 804178825Sdfr } 805178825Sdfr} 806178825Sdfr 807178825Sdfr# define YY_REDUCE_PRINT(Rule) \ 808178825Sdfrdo { \ 809178825Sdfr if (yydebug) \ 810178825Sdfr yy_reduce_print (yyvsp, Rule); \ 811178825Sdfr} while (YYID (0)) 812178825Sdfr 813178825Sdfr/* Nonzero means print parse trace. It is left uninitialized so that 814178825Sdfr multiple parsers can coexist. */ 815178825Sdfrint yydebug; 816178825Sdfr#else /* !YYDEBUG */ 817178825Sdfr# define YYDPRINTF(Args) 818178825Sdfr# define YY_SYMBOL_PRINT(Title, Type, Value, Location) 819178825Sdfr# define YY_STACK_PRINT(Bottom, Top) 820178825Sdfr# define YY_REDUCE_PRINT(Rule) 821178825Sdfr#endif /* !YYDEBUG */ 822178825Sdfr 823178825Sdfr 824178825Sdfr/* YYINITDEPTH -- initial size of the parser's stacks. */ 825178825Sdfr#ifndef YYINITDEPTH 826178825Sdfr# define YYINITDEPTH 200 827178825Sdfr#endif 828178825Sdfr 829178825Sdfr/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only 830178825Sdfr if the built-in stack extension method is used). 831178825Sdfr 832178825Sdfr Do not make this value too large; the results are undefined if 833178825Sdfr YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) 834178825Sdfr evaluated with infinite-precision integer arithmetic. */ 835178825Sdfr 836178825Sdfr#ifndef YYMAXDEPTH 837178825Sdfr# define YYMAXDEPTH 10000 838178825Sdfr#endif 839178825Sdfr 840178825Sdfr 841178825Sdfr 842178825Sdfr#if YYERROR_VERBOSE 843178825Sdfr 844178825Sdfr# ifndef yystrlen 845178825Sdfr# if defined __GLIBC__ && defined _STRING_H 846178825Sdfr# define yystrlen strlen 847178825Sdfr# else 848178825Sdfr/* Return the length of YYSTR. */ 849178825Sdfr#if (defined __STDC__ || defined __C99__FUNC__ \ 850178825Sdfr || defined __cplusplus || defined _MSC_VER) 851178825Sdfrstatic YYSIZE_T 852178825Sdfryystrlen (const char *yystr) 853178825Sdfr#else 854178825Sdfrstatic YYSIZE_T 855178825Sdfryystrlen (yystr) 856178825Sdfr const char *yystr; 857178825Sdfr#endif 858178825Sdfr{ 859178825Sdfr YYSIZE_T yylen; 860178825Sdfr for (yylen = 0; yystr[yylen]; yylen++) 861178825Sdfr continue; 862178825Sdfr return yylen; 863178825Sdfr} 864178825Sdfr# endif 865178825Sdfr# endif 866178825Sdfr 867178825Sdfr# ifndef yystpcpy 868178825Sdfr# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE 869178825Sdfr# define yystpcpy stpcpy 870178825Sdfr# else 871178825Sdfr/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in 872178825Sdfr YYDEST. */ 873178825Sdfr#if (defined __STDC__ || defined __C99__FUNC__ \ 874178825Sdfr || defined __cplusplus || defined _MSC_VER) 875178825Sdfrstatic char * 876178825Sdfryystpcpy (char *yydest, const char *yysrc) 877178825Sdfr#else 878178825Sdfrstatic char * 879178825Sdfryystpcpy (yydest, yysrc) 880178825Sdfr char *yydest; 881178825Sdfr const char *yysrc; 882178825Sdfr#endif 883178825Sdfr{ 884178825Sdfr char *yyd = yydest; 885178825Sdfr const char *yys = yysrc; 886178825Sdfr 887178825Sdfr while ((*yyd++ = *yys++) != '\0') 888178825Sdfr continue; 889178825Sdfr 890178825Sdfr return yyd - 1; 891178825Sdfr} 892178825Sdfr# endif 893178825Sdfr# endif 894178825Sdfr 895178825Sdfr# ifndef yytnamerr 896178825Sdfr/* Copy to YYRES the contents of YYSTR after stripping away unnecessary 897178825Sdfr quotes and backslashes, so that it's suitable for yyerror. The 898178825Sdfr heuristic is that double-quoting is unnecessary unless the string 899178825Sdfr contains an apostrophe, a comma, or backslash (other than 900178825Sdfr backslash-backslash). YYSTR is taken from yytname. If YYRES is 901178825Sdfr null, do not copy; instead, return the length of what the result 902178825Sdfr would have been. */ 903178825Sdfrstatic YYSIZE_T 904178825Sdfryytnamerr (char *yyres, const char *yystr) 905178825Sdfr{ 906178825Sdfr if (*yystr == '"') 907178825Sdfr { 908178825Sdfr YYSIZE_T yyn = 0; 909178825Sdfr char const *yyp = yystr; 910178825Sdfr 911178825Sdfr for (;;) 912178825Sdfr switch (*++yyp) 913178825Sdfr { 914178825Sdfr case '\'': 915178825Sdfr case ',': 916178825Sdfr goto do_not_strip_quotes; 917178825Sdfr 918178825Sdfr case '\\': 919178825Sdfr if (*++yyp != '\\') 920178825Sdfr goto do_not_strip_quotes; 921178825Sdfr /* Fall through. */ 922178825Sdfr default: 923178825Sdfr if (yyres) 924178825Sdfr yyres[yyn] = *yyp; 925178825Sdfr yyn++; 926178825Sdfr break; 927178825Sdfr 928178825Sdfr case '"': 929178825Sdfr if (yyres) 930178825Sdfr yyres[yyn] = '\0'; 931178825Sdfr return yyn; 932178825Sdfr } 933178825Sdfr do_not_strip_quotes: ; 934178825Sdfr } 935178825Sdfr 936178825Sdfr if (! yyres) 937178825Sdfr return yystrlen (yystr); 938178825Sdfr 939178825Sdfr return yystpcpy (yyres, yystr) - yyres; 940178825Sdfr} 941178825Sdfr# endif 942178825Sdfr 943178825Sdfr/* Copy into YYRESULT an error message about the unexpected token 944178825Sdfr YYCHAR while in state YYSTATE. Return the number of bytes copied, 945178825Sdfr including the terminating null byte. If YYRESULT is null, do not 946178825Sdfr copy anything; just return the number of bytes that would be 947178825Sdfr copied. As a special case, return 0 if an ordinary "syntax error" 948178825Sdfr message will do. Return YYSIZE_MAXIMUM if overflow occurs during 949178825Sdfr size calculation. */ 950178825Sdfrstatic YYSIZE_T 951178825Sdfryysyntax_error (char *yyresult, int yystate, int yychar) 952178825Sdfr{ 953178825Sdfr int yyn = yypact[yystate]; 954178825Sdfr 955178825Sdfr if (! (YYPACT_NINF < yyn && yyn <= YYLAST)) 956178825Sdfr return 0; 957178825Sdfr else 958178825Sdfr { 959178825Sdfr int yytype = YYTRANSLATE (yychar); 960178825Sdfr YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); 961178825Sdfr YYSIZE_T yysize = yysize0; 962178825Sdfr YYSIZE_T yysize1; 963178825Sdfr int yysize_overflow = 0; 964178825Sdfr enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; 965178825Sdfr char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; 966178825Sdfr int yyx; 967178825Sdfr 968178825Sdfr# if 0 969178825Sdfr /* This is so xgettext sees the translatable formats that are 970178825Sdfr constructed on the fly. */ 971178825Sdfr YY_("syntax error, unexpected %s"); 972178825Sdfr YY_("syntax error, unexpected %s, expecting %s"); 973178825Sdfr YY_("syntax error, unexpected %s, expecting %s or %s"); 974178825Sdfr YY_("syntax error, unexpected %s, expecting %s or %s or %s"); 975178825Sdfr YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); 976178825Sdfr# endif 977178825Sdfr char *yyfmt; 978178825Sdfr char const *yyf; 979178825Sdfr static char const yyunexpected[] = "syntax error, unexpected %s"; 980178825Sdfr static char const yyexpecting[] = ", expecting %s"; 981178825Sdfr static char const yyor[] = " or %s"; 982178825Sdfr char yyformat[sizeof yyunexpected 983178825Sdfr + sizeof yyexpecting - 1 984178825Sdfr + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) 985178825Sdfr * (sizeof yyor - 1))]; 986178825Sdfr char const *yyprefix = yyexpecting; 987178825Sdfr 988178825Sdfr /* Start YYX at -YYN if negative to avoid negative indexes in 989178825Sdfr YYCHECK. */ 990178825Sdfr int yyxbegin = yyn < 0 ? -yyn : 0; 991178825Sdfr 992178825Sdfr /* Stay within bounds of both yycheck and yytname. */ 993178825Sdfr int yychecklim = YYLAST - yyn + 1; 994178825Sdfr int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; 995178825Sdfr int yycount = 1; 996178825Sdfr 997178825Sdfr yyarg[0] = yytname[yytype]; 998178825Sdfr yyfmt = yystpcpy (yyformat, yyunexpected); 999178825Sdfr 1000178825Sdfr for (yyx = yyxbegin; yyx < yyxend; ++yyx) 1001178825Sdfr if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) 1002178825Sdfr { 1003178825Sdfr if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) 1004178825Sdfr { 1005178825Sdfr yycount = 1; 1006178825Sdfr yysize = yysize0; 1007178825Sdfr yyformat[sizeof yyunexpected - 1] = '\0'; 1008178825Sdfr break; 1009178825Sdfr } 1010178825Sdfr yyarg[yycount++] = yytname[yyx]; 1011178825Sdfr yysize1 = yysize + yytnamerr (0, yytname[yyx]); 1012178825Sdfr yysize_overflow |= (yysize1 < yysize); 1013178825Sdfr yysize = yysize1; 1014178825Sdfr yyfmt = yystpcpy (yyfmt, yyprefix); 1015178825Sdfr yyprefix = yyor; 1016178825Sdfr } 1017178825Sdfr 1018178825Sdfr yyf = YY_(yyformat); 1019178825Sdfr yysize1 = yysize + yystrlen (yyf); 1020178825Sdfr yysize_overflow |= (yysize1 < yysize); 1021178825Sdfr yysize = yysize1; 1022178825Sdfr 1023178825Sdfr if (yysize_overflow) 1024178825Sdfr return YYSIZE_MAXIMUM; 1025178825Sdfr 1026178825Sdfr if (yyresult) 1027178825Sdfr { 1028178825Sdfr /* Avoid sprintf, as that infringes on the user's name space. 1029178825Sdfr Don't have undefined behavior even if the translation 1030178825Sdfr produced a string with the wrong number of "%s"s. */ 1031178825Sdfr char *yyp = yyresult; 1032178825Sdfr int yyi = 0; 1033178825Sdfr while ((*yyp = *yyf) != '\0') 1034178825Sdfr { 1035178825Sdfr if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) 1036178825Sdfr { 1037178825Sdfr yyp += yytnamerr (yyp, yyarg[yyi++]); 1038178825Sdfr yyf += 2; 1039178825Sdfr } 1040178825Sdfr else 1041178825Sdfr { 1042178825Sdfr yyp++; 1043178825Sdfr yyf++; 1044178825Sdfr } 1045178825Sdfr } 1046178825Sdfr } 1047178825Sdfr return yysize; 1048178825Sdfr } 1049178825Sdfr} 1050178825Sdfr#endif /* YYERROR_VERBOSE */ 1051178825Sdfr 1052178825Sdfr 1053178825Sdfr/*-----------------------------------------------. 1054178825Sdfr| Release the memory associated to this symbol. | 1055178825Sdfr`-----------------------------------------------*/ 1056178825Sdfr 1057178825Sdfr/*ARGSUSED*/ 1058178825Sdfr#if (defined __STDC__ || defined __C99__FUNC__ \ 1059178825Sdfr || defined __cplusplus || defined _MSC_VER) 1060178825Sdfrstatic void 1061178825Sdfryydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) 1062178825Sdfr#else 1063178825Sdfrstatic void 1064178825Sdfryydestruct (yymsg, yytype, yyvaluep) 1065178825Sdfr const char *yymsg; 1066178825Sdfr int yytype; 1067178825Sdfr YYSTYPE *yyvaluep; 1068178825Sdfr#endif 1069178825Sdfr{ 1070178825Sdfr YYUSE (yyvaluep); 1071178825Sdfr 1072178825Sdfr if (!yymsg) 1073178825Sdfr yymsg = "Deleting"; 1074178825Sdfr YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); 1075178825Sdfr 1076178825Sdfr switch (yytype) 1077178825Sdfr { 1078178825Sdfr 1079178825Sdfr default: 1080178825Sdfr break; 1081178825Sdfr } 1082178825Sdfr} 1083178825Sdfr 1084178825Sdfr 1085178825Sdfr/* Prevent warnings from -Wmissing-prototypes. */ 1086178825Sdfr 1087178825Sdfr#ifdef YYPARSE_PARAM 1088178825Sdfr#if defined __STDC__ || defined __cplusplus 1089178825Sdfrint yyparse (void *YYPARSE_PARAM); 1090178825Sdfr#else 1091178825Sdfrint yyparse (); 1092178825Sdfr#endif 1093178825Sdfr#else /* ! YYPARSE_PARAM */ 1094178825Sdfr#if defined __STDC__ || defined __cplusplus 1095178825Sdfrint yyparse (void); 1096178825Sdfr#else 1097178825Sdfrint yyparse (); 1098178825Sdfr#endif 1099178825Sdfr#endif /* ! YYPARSE_PARAM */ 1100178825Sdfr 1101178825Sdfr 1102178825Sdfr 1103178825Sdfr/* The look-ahead symbol. */ 1104178825Sdfrint yychar; 1105178825Sdfr 1106178825Sdfr/* The semantic value of the look-ahead symbol. */ 1107178825SdfrYYSTYPE yylval; 1108178825Sdfr 1109178825Sdfr/* Number of syntax errors so far. */ 1110178825Sdfrint yynerrs; 1111178825Sdfr 1112178825Sdfr 1113178825Sdfr 1114178825Sdfr/*----------. 1115178825Sdfr| yyparse. | 1116178825Sdfr`----------*/ 1117178825Sdfr 1118178825Sdfr#ifdef YYPARSE_PARAM 1119178825Sdfr#if (defined __STDC__ || defined __C99__FUNC__ \ 1120178825Sdfr || defined __cplusplus || defined _MSC_VER) 1121178825Sdfrint 1122178825Sdfryyparse (void *YYPARSE_PARAM) 1123178825Sdfr#else 1124178825Sdfrint 1125178825Sdfryyparse (YYPARSE_PARAM) 1126178825Sdfr void *YYPARSE_PARAM; 1127178825Sdfr#endif 1128178825Sdfr#else /* ! YYPARSE_PARAM */ 1129178825Sdfr#if (defined __STDC__ || defined __C99__FUNC__ \ 1130178825Sdfr || defined __cplusplus || defined _MSC_VER) 1131178825Sdfrint 1132178825Sdfryyparse (void) 1133178825Sdfr#else 1134178825Sdfrint 1135178825Sdfryyparse () 1136178825Sdfr 1137178825Sdfr#endif 1138178825Sdfr#endif 1139178825Sdfr{ 1140178825Sdfr 1141178825Sdfr int yystate; 1142178825Sdfr int yyn; 1143178825Sdfr int yyresult; 1144178825Sdfr /* Number of tokens to shift before error messages enabled. */ 1145178825Sdfr int yyerrstatus; 1146178825Sdfr /* Look-ahead token as an internal (translated) token number. */ 1147178825Sdfr int yytoken = 0; 1148178825Sdfr#if YYERROR_VERBOSE 1149178825Sdfr /* Buffer for error messages, and its allocated size. */ 1150178825Sdfr char yymsgbuf[128]; 1151178825Sdfr char *yymsg = yymsgbuf; 1152178825Sdfr YYSIZE_T yymsg_alloc = sizeof yymsgbuf; 1153178825Sdfr#endif 1154178825Sdfr 1155178825Sdfr /* Three stacks and their tools: 1156178825Sdfr `yyss': related to states, 1157178825Sdfr `yyvs': related to semantic values, 1158178825Sdfr `yyls': related to locations. 1159178825Sdfr 1160178825Sdfr Refer to the stacks thru separate pointers, to allow yyoverflow 1161178825Sdfr to reallocate them elsewhere. */ 1162178825Sdfr 1163178825Sdfr /* The state stack. */ 1164178825Sdfr yytype_int16 yyssa[YYINITDEPTH]; 1165178825Sdfr yytype_int16 *yyss = yyssa; 1166178825Sdfr yytype_int16 *yyssp; 1167178825Sdfr 1168178825Sdfr /* The semantic value stack. */ 1169178825Sdfr YYSTYPE yyvsa[YYINITDEPTH]; 1170178825Sdfr YYSTYPE *yyvs = yyvsa; 1171178825Sdfr YYSTYPE *yyvsp; 1172178825Sdfr 1173178825Sdfr 1174178825Sdfr 1175178825Sdfr#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) 1176178825Sdfr 1177178825Sdfr YYSIZE_T yystacksize = YYINITDEPTH; 1178178825Sdfr 1179178825Sdfr /* The variables used to return semantic value and location from the 1180178825Sdfr action routines. */ 1181178825Sdfr YYSTYPE yyval; 1182178825Sdfr 1183178825Sdfr 1184178825Sdfr /* The number of symbols on the RHS of the reduced rule. 1185178825Sdfr Keep to zero when no symbol should be popped. */ 1186178825Sdfr int yylen = 0; 1187178825Sdfr 1188178825Sdfr YYDPRINTF ((stderr, "Starting parse\n")); 1189178825Sdfr 1190178825Sdfr yystate = 0; 1191178825Sdfr yyerrstatus = 0; 1192178825Sdfr yynerrs = 0; 1193178825Sdfr yychar = YYEMPTY; /* Cause a token to be read. */ 1194178825Sdfr 1195178825Sdfr /* Initialize stack pointers. 1196178825Sdfr Waste one element of value and location stack 1197178825Sdfr so that they stay on the same level as the state stack. 1198178825Sdfr The wasted elements are never initialized. */ 1199178825Sdfr 1200178825Sdfr yyssp = yyss; 1201178825Sdfr yyvsp = yyvs; 1202178825Sdfr 1203178825Sdfr goto yysetstate; 1204178825Sdfr 1205178825Sdfr/*------------------------------------------------------------. 1206178825Sdfr| yynewstate -- Push a new state, which is found in yystate. | 1207178825Sdfr`------------------------------------------------------------*/ 1208178825Sdfr yynewstate: 1209178825Sdfr /* In all cases, when you get here, the value and location stacks 1210178825Sdfr have just been pushed. So pushing a state here evens the stacks. */ 1211178825Sdfr yyssp++; 1212178825Sdfr 1213178825Sdfr yysetstate: 1214178825Sdfr *yyssp = yystate; 1215178825Sdfr 1216178825Sdfr if (yyss + yystacksize - 1 <= yyssp) 1217178825Sdfr { 1218178825Sdfr /* Get the current used size of the three stacks, in elements. */ 1219178825Sdfr YYSIZE_T yysize = yyssp - yyss + 1; 1220178825Sdfr 1221178825Sdfr#ifdef yyoverflow 1222178825Sdfr { 1223178825Sdfr /* Give user a chance to reallocate the stack. Use copies of 1224178825Sdfr these so that the &'s don't force the real ones into 1225178825Sdfr memory. */ 1226178825Sdfr YYSTYPE *yyvs1 = yyvs; 1227178825Sdfr yytype_int16 *yyss1 = yyss; 1228178825Sdfr 1229178825Sdfr 1230178825Sdfr /* Each stack pointer address is followed by the size of the 1231178825Sdfr data in use in that stack, in bytes. This used to be a 1232178825Sdfr conditional around just the two extra args, but that might 1233178825Sdfr be undefined if yyoverflow is a macro. */ 1234178825Sdfr yyoverflow (YY_("memory exhausted"), 1235178825Sdfr &yyss1, yysize * sizeof (*yyssp), 1236178825Sdfr &yyvs1, yysize * sizeof (*yyvsp), 1237178825Sdfr 1238178825Sdfr &yystacksize); 1239178825Sdfr 1240178825Sdfr yyss = yyss1; 1241178825Sdfr yyvs = yyvs1; 1242178825Sdfr } 1243178825Sdfr#else /* no yyoverflow */ 1244178825Sdfr# ifndef YYSTACK_RELOCATE 1245178825Sdfr goto yyexhaustedlab; 1246178825Sdfr# else 1247178825Sdfr /* Extend the stack our own way. */ 1248178825Sdfr if (YYMAXDEPTH <= yystacksize) 1249178825Sdfr goto yyexhaustedlab; 1250178825Sdfr yystacksize *= 2; 1251178825Sdfr if (YYMAXDEPTH < yystacksize) 1252178825Sdfr yystacksize = YYMAXDEPTH; 1253178825Sdfr 1254178825Sdfr { 1255178825Sdfr yytype_int16 *yyss1 = yyss; 1256178825Sdfr union yyalloc *yyptr = 1257178825Sdfr (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); 1258178825Sdfr if (! yyptr) 1259178825Sdfr goto yyexhaustedlab; 1260178825Sdfr YYSTACK_RELOCATE (yyss); 1261178825Sdfr YYSTACK_RELOCATE (yyvs); 1262178825Sdfr 1263178825Sdfr# undef YYSTACK_RELOCATE 1264178825Sdfr if (yyss1 != yyssa) 1265178825Sdfr YYSTACK_FREE (yyss1); 1266178825Sdfr } 1267178825Sdfr# endif 1268178825Sdfr#endif /* no yyoverflow */ 1269178825Sdfr 1270178825Sdfr yyssp = yyss + yysize - 1; 1271178825Sdfr yyvsp = yyvs + yysize - 1; 1272178825Sdfr 1273178825Sdfr 1274178825Sdfr YYDPRINTF ((stderr, "Stack size increased to %lu\n", 1275178825Sdfr (unsigned long int) yystacksize)); 1276178825Sdfr 1277178825Sdfr if (yyss + yystacksize - 1 <= yyssp) 1278178825Sdfr YYABORT; 1279178825Sdfr } 1280178825Sdfr 1281178825Sdfr YYDPRINTF ((stderr, "Entering state %d\n", yystate)); 1282178825Sdfr 1283178825Sdfr goto yybackup; 1284178825Sdfr 1285178825Sdfr/*-----------. 1286178825Sdfr| yybackup. | 1287178825Sdfr`-----------*/ 1288178825Sdfryybackup: 1289178825Sdfr 1290178825Sdfr /* Do appropriate processing given the current state. Read a 1291178825Sdfr look-ahead token if we need one and don't already have one. */ 1292178825Sdfr 1293178825Sdfr /* First try to decide what to do without reference to look-ahead token. */ 1294178825Sdfr yyn = yypact[yystate]; 1295178825Sdfr if (yyn == YYPACT_NINF) 1296178825Sdfr goto yydefault; 1297178825Sdfr 1298178825Sdfr /* Not known => get a look-ahead token if don't already have one. */ 1299178825Sdfr 1300178825Sdfr /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */ 1301178825Sdfr if (yychar == YYEMPTY) 1302178825Sdfr { 1303178825Sdfr YYDPRINTF ((stderr, "Reading a token: ")); 1304178825Sdfr yychar = YYLEX; 1305178825Sdfr } 1306178825Sdfr 1307178825Sdfr if (yychar <= YYEOF) 1308178825Sdfr { 1309178825Sdfr yychar = yytoken = YYEOF; 1310178825Sdfr YYDPRINTF ((stderr, "Now at end of input.\n")); 1311178825Sdfr } 1312178825Sdfr else 1313178825Sdfr { 1314178825Sdfr yytoken = YYTRANSLATE (yychar); 1315178825Sdfr YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); 1316178825Sdfr } 1317178825Sdfr 1318178825Sdfr /* If the proper action on seeing token YYTOKEN is to reduce or to 1319178825Sdfr detect an error, take that action. */ 1320178825Sdfr yyn += yytoken; 1321178825Sdfr if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) 1322178825Sdfr goto yydefault; 1323178825Sdfr yyn = yytable[yyn]; 1324178825Sdfr if (yyn <= 0) 1325178825Sdfr { 1326178825Sdfr if (yyn == 0 || yyn == YYTABLE_NINF) 1327178825Sdfr goto yyerrlab; 1328178825Sdfr yyn = -yyn; 1329178825Sdfr goto yyreduce; 1330178825Sdfr } 1331178825Sdfr 1332178825Sdfr if (yyn == YYFINAL) 1333178825Sdfr YYACCEPT; 1334178825Sdfr 1335178825Sdfr /* Count tokens shifted since error; after three, turn off error 1336178825Sdfr status. */ 1337178825Sdfr if (yyerrstatus) 1338178825Sdfr yyerrstatus--; 1339178825Sdfr 1340178825Sdfr /* Shift the look-ahead token. */ 1341178825Sdfr YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); 1342178825Sdfr 1343178825Sdfr /* Discard the shifted token unless it is eof. */ 1344178825Sdfr if (yychar != YYEOF) 1345178825Sdfr yychar = YYEMPTY; 1346178825Sdfr 1347178825Sdfr yystate = yyn; 1348178825Sdfr *++yyvsp = yylval; 1349178825Sdfr 1350178825Sdfr goto yynewstate; 1351178825Sdfr 1352178825Sdfr 1353178825Sdfr/*-----------------------------------------------------------. 1354178825Sdfr| yydefault -- do the default action for the current state. | 1355178825Sdfr`-----------------------------------------------------------*/ 1356178825Sdfryydefault: 1357178825Sdfr yyn = yydefact[yystate]; 1358178825Sdfr if (yyn == 0) 1359178825Sdfr goto yyerrlab; 1360178825Sdfr goto yyreduce; 1361178825Sdfr 1362178825Sdfr 1363178825Sdfr/*-----------------------------. 1364178825Sdfr| yyreduce -- Do a reduction. | 1365178825Sdfr`-----------------------------*/ 1366178825Sdfryyreduce: 1367178825Sdfr /* yyn is the number of a rule to reduce with. */ 1368178825Sdfr yylen = yyr2[yyn]; 1369178825Sdfr 1370178825Sdfr /* If YYLEN is nonzero, implement the default value of the action: 1371178825Sdfr `$$ = $1'. 1372178825Sdfr 1373178825Sdfr Otherwise, the following line sets YYVAL to garbage. 1374178825Sdfr This behavior is undocumented and Bison 1375178825Sdfr users should not rely upon it. Assigning to YYVAL 1376178825Sdfr unconditionally makes the parser a bit smaller, and it avoids a 1377178825Sdfr GCC warning that YYVAL may be used uninitialized. */ 1378178825Sdfr yyval = yyvsp[1-yylen]; 1379178825Sdfr 1380178825Sdfr 1381178825Sdfr YY_REDUCE_PRINT (yyn); 1382178825Sdfr switch (yyn) 1383178825Sdfr { 1384178825Sdfr case 6: 1385233294Sstas#line 74 "parse.y" 1386178825Sdfr { 1387178825Sdfr id_str = (yyvsp[(2) - (2)].string); 1388178825Sdfr } 1389178825Sdfr break; 1390178825Sdfr 1391178825Sdfr case 7: 1392233294Sstas#line 80 "parse.y" 1393178825Sdfr { 1394178825Sdfr base_id = name2number((yyvsp[(2) - (2)].string)); 1395178825Sdfr strlcpy(name, (yyvsp[(2) - (2)].string), sizeof(name)); 1396178825Sdfr free((yyvsp[(2) - (2)].string)); 1397178825Sdfr } 1398178825Sdfr break; 1399178825Sdfr 1400178825Sdfr case 8: 1401233294Sstas#line 86 "parse.y" 1402178825Sdfr { 1403178825Sdfr base_id = name2number((yyvsp[(2) - (3)].string)); 1404178825Sdfr strlcpy(name, (yyvsp[(3) - (3)].string), sizeof(name)); 1405178825Sdfr free((yyvsp[(2) - (3)].string)); 1406178825Sdfr free((yyvsp[(3) - (3)].string)); 1407178825Sdfr } 1408178825Sdfr break; 1409178825Sdfr 1410178825Sdfr case 11: 1411233294Sstas#line 99 "parse.y" 1412178825Sdfr { 1413178825Sdfr number = (yyvsp[(2) - (2)].number); 1414178825Sdfr } 1415178825Sdfr break; 1416178825Sdfr 1417178825Sdfr case 12: 1418233294Sstas#line 103 "parse.y" 1419178825Sdfr { 1420178825Sdfr free(prefix); 1421178825Sdfr asprintf (&prefix, "%s_", (yyvsp[(2) - (2)].string)); 1422178825Sdfr if (prefix == NULL) 1423178825Sdfr errx(1, "malloc"); 1424178825Sdfr free((yyvsp[(2) - (2)].string)); 1425178825Sdfr } 1426178825Sdfr break; 1427178825Sdfr 1428178825Sdfr case 13: 1429233294Sstas#line 111 "parse.y" 1430178825Sdfr { 1431178825Sdfr prefix = realloc(prefix, 1); 1432178825Sdfr if (prefix == NULL) 1433178825Sdfr errx(1, "malloc"); 1434178825Sdfr *prefix = '\0'; 1435178825Sdfr } 1436178825Sdfr break; 1437178825Sdfr 1438178825Sdfr case 14: 1439233294Sstas#line 118 "parse.y" 1440178825Sdfr { 1441178825Sdfr struct error_code *ec = malloc(sizeof(*ec)); 1442233294Sstas 1443178825Sdfr if (ec == NULL) 1444178825Sdfr errx(1, "malloc"); 1445178825Sdfr 1446178825Sdfr ec->next = NULL; 1447178825Sdfr ec->number = number; 1448178825Sdfr if(prefix && *prefix != '\0') { 1449178825Sdfr asprintf (&ec->name, "%s%s", prefix, (yyvsp[(2) - (4)].string)); 1450178825Sdfr if (ec->name == NULL) 1451178825Sdfr errx(1, "malloc"); 1452178825Sdfr free((yyvsp[(2) - (4)].string)); 1453178825Sdfr } else 1454178825Sdfr ec->name = (yyvsp[(2) - (4)].string); 1455178825Sdfr ec->string = (yyvsp[(4) - (4)].string); 1456178825Sdfr APPEND(codes, ec); 1457178825Sdfr number++; 1458178825Sdfr } 1459178825Sdfr break; 1460178825Sdfr 1461178825Sdfr case 15: 1462233294Sstas#line 138 "parse.y" 1463178825Sdfr { 1464178825Sdfr YYACCEPT; 1465178825Sdfr } 1466178825Sdfr break; 1467178825Sdfr 1468178825Sdfr 1469178825Sdfr/* Line 1267 of yacc.c. */ 1470233294Sstas#line 1471 "parse.c" 1471178825Sdfr default: break; 1472178825Sdfr } 1473178825Sdfr YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); 1474178825Sdfr 1475178825Sdfr YYPOPSTACK (yylen); 1476178825Sdfr yylen = 0; 1477178825Sdfr YY_STACK_PRINT (yyss, yyssp); 1478178825Sdfr 1479178825Sdfr *++yyvsp = yyval; 1480178825Sdfr 1481178825Sdfr 1482178825Sdfr /* Now `shift' the result of the reduction. Determine what state 1483178825Sdfr that goes to, based on the state we popped back to and the rule 1484178825Sdfr number reduced by. */ 1485178825Sdfr 1486178825Sdfr yyn = yyr1[yyn]; 1487178825Sdfr 1488178825Sdfr yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; 1489178825Sdfr if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) 1490178825Sdfr yystate = yytable[yystate]; 1491178825Sdfr else 1492178825Sdfr yystate = yydefgoto[yyn - YYNTOKENS]; 1493178825Sdfr 1494178825Sdfr goto yynewstate; 1495178825Sdfr 1496178825Sdfr 1497178825Sdfr/*------------------------------------. 1498178825Sdfr| yyerrlab -- here on detecting error | 1499178825Sdfr`------------------------------------*/ 1500178825Sdfryyerrlab: 1501178825Sdfr /* If not already recovering from an error, report this error. */ 1502178825Sdfr if (!yyerrstatus) 1503178825Sdfr { 1504178825Sdfr ++yynerrs; 1505178825Sdfr#if ! YYERROR_VERBOSE 1506178825Sdfr yyerror (YY_("syntax error")); 1507178825Sdfr#else 1508178825Sdfr { 1509178825Sdfr YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); 1510178825Sdfr if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) 1511178825Sdfr { 1512178825Sdfr YYSIZE_T yyalloc = 2 * yysize; 1513178825Sdfr if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM)) 1514178825Sdfr yyalloc = YYSTACK_ALLOC_MAXIMUM; 1515178825Sdfr if (yymsg != yymsgbuf) 1516178825Sdfr YYSTACK_FREE (yymsg); 1517178825Sdfr yymsg = (char *) YYSTACK_ALLOC (yyalloc); 1518178825Sdfr if (yymsg) 1519178825Sdfr yymsg_alloc = yyalloc; 1520178825Sdfr else 1521178825Sdfr { 1522178825Sdfr yymsg = yymsgbuf; 1523178825Sdfr yymsg_alloc = sizeof yymsgbuf; 1524178825Sdfr } 1525178825Sdfr } 1526178825Sdfr 1527178825Sdfr if (0 < yysize && yysize <= yymsg_alloc) 1528178825Sdfr { 1529178825Sdfr (void) yysyntax_error (yymsg, yystate, yychar); 1530178825Sdfr yyerror (yymsg); 1531178825Sdfr } 1532178825Sdfr else 1533178825Sdfr { 1534178825Sdfr yyerror (YY_("syntax error")); 1535178825Sdfr if (yysize != 0) 1536178825Sdfr goto yyexhaustedlab; 1537178825Sdfr } 1538178825Sdfr } 1539178825Sdfr#endif 1540178825Sdfr } 1541178825Sdfr 1542178825Sdfr 1543178825Sdfr 1544178825Sdfr if (yyerrstatus == 3) 1545178825Sdfr { 1546178825Sdfr /* If just tried and failed to reuse look-ahead token after an 1547178825Sdfr error, discard it. */ 1548178825Sdfr 1549178825Sdfr if (yychar <= YYEOF) 1550178825Sdfr { 1551178825Sdfr /* Return failure if at end of input. */ 1552178825Sdfr if (yychar == YYEOF) 1553178825Sdfr YYABORT; 1554178825Sdfr } 1555178825Sdfr else 1556178825Sdfr { 1557178825Sdfr yydestruct ("Error: discarding", 1558178825Sdfr yytoken, &yylval); 1559178825Sdfr yychar = YYEMPTY; 1560178825Sdfr } 1561178825Sdfr } 1562178825Sdfr 1563178825Sdfr /* Else will try to reuse look-ahead token after shifting the error 1564178825Sdfr token. */ 1565178825Sdfr goto yyerrlab1; 1566178825Sdfr 1567178825Sdfr 1568178825Sdfr/*---------------------------------------------------. 1569178825Sdfr| yyerrorlab -- error raised explicitly by YYERROR. | 1570178825Sdfr`---------------------------------------------------*/ 1571178825Sdfryyerrorlab: 1572178825Sdfr 1573178825Sdfr /* Pacify compilers like GCC when the user code never invokes 1574178825Sdfr YYERROR and the label yyerrorlab therefore never appears in user 1575178825Sdfr code. */ 1576178825Sdfr if (/*CONSTCOND*/ 0) 1577178825Sdfr goto yyerrorlab; 1578178825Sdfr 1579178825Sdfr /* Do not reclaim the symbols of the rule which action triggered 1580178825Sdfr this YYERROR. */ 1581178825Sdfr YYPOPSTACK (yylen); 1582178825Sdfr yylen = 0; 1583178825Sdfr YY_STACK_PRINT (yyss, yyssp); 1584178825Sdfr yystate = *yyssp; 1585178825Sdfr goto yyerrlab1; 1586178825Sdfr 1587178825Sdfr 1588178825Sdfr/*-------------------------------------------------------------. 1589178825Sdfr| yyerrlab1 -- common code for both syntax error and YYERROR. | 1590178825Sdfr`-------------------------------------------------------------*/ 1591178825Sdfryyerrlab1: 1592178825Sdfr yyerrstatus = 3; /* Each real token shifted decrements this. */ 1593178825Sdfr 1594178825Sdfr for (;;) 1595178825Sdfr { 1596178825Sdfr yyn = yypact[yystate]; 1597178825Sdfr if (yyn != YYPACT_NINF) 1598178825Sdfr { 1599178825Sdfr yyn += YYTERROR; 1600178825Sdfr if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) 1601178825Sdfr { 1602178825Sdfr yyn = yytable[yyn]; 1603178825Sdfr if (0 < yyn) 1604178825Sdfr break; 1605178825Sdfr } 1606178825Sdfr } 1607178825Sdfr 1608178825Sdfr /* Pop the current state because it cannot handle the error token. */ 1609178825Sdfr if (yyssp == yyss) 1610178825Sdfr YYABORT; 1611178825Sdfr 1612178825Sdfr 1613178825Sdfr yydestruct ("Error: popping", 1614178825Sdfr yystos[yystate], yyvsp); 1615178825Sdfr YYPOPSTACK (1); 1616178825Sdfr yystate = *yyssp; 1617178825Sdfr YY_STACK_PRINT (yyss, yyssp); 1618178825Sdfr } 1619178825Sdfr 1620178825Sdfr if (yyn == YYFINAL) 1621178825Sdfr YYACCEPT; 1622178825Sdfr 1623178825Sdfr *++yyvsp = yylval; 1624178825Sdfr 1625178825Sdfr 1626178825Sdfr /* Shift the error token. */ 1627178825Sdfr YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); 1628178825Sdfr 1629178825Sdfr yystate = yyn; 1630178825Sdfr goto yynewstate; 1631178825Sdfr 1632178825Sdfr 1633178825Sdfr/*-------------------------------------. 1634178825Sdfr| yyacceptlab -- YYACCEPT comes here. | 1635178825Sdfr`-------------------------------------*/ 1636178825Sdfryyacceptlab: 1637178825Sdfr yyresult = 0; 1638178825Sdfr goto yyreturn; 1639178825Sdfr 1640178825Sdfr/*-----------------------------------. 1641178825Sdfr| yyabortlab -- YYABORT comes here. | 1642178825Sdfr`-----------------------------------*/ 1643178825Sdfryyabortlab: 1644178825Sdfr yyresult = 1; 1645178825Sdfr goto yyreturn; 1646178825Sdfr 1647178825Sdfr#ifndef yyoverflow 1648178825Sdfr/*-------------------------------------------------. 1649178825Sdfr| yyexhaustedlab -- memory exhaustion comes here. | 1650178825Sdfr`-------------------------------------------------*/ 1651178825Sdfryyexhaustedlab: 1652178825Sdfr yyerror (YY_("memory exhausted")); 1653178825Sdfr yyresult = 2; 1654178825Sdfr /* Fall through. */ 1655178825Sdfr#endif 1656178825Sdfr 1657178825Sdfryyreturn: 1658178825Sdfr if (yychar != YYEOF && yychar != YYEMPTY) 1659178825Sdfr yydestruct ("Cleanup: discarding lookahead", 1660178825Sdfr yytoken, &yylval); 1661178825Sdfr /* Do not reclaim the symbols of the rule which action triggered 1662178825Sdfr this YYABORT or YYACCEPT. */ 1663178825Sdfr YYPOPSTACK (yylen); 1664178825Sdfr YY_STACK_PRINT (yyss, yyssp); 1665178825Sdfr while (yyssp != yyss) 1666178825Sdfr { 1667178825Sdfr yydestruct ("Cleanup: popping", 1668178825Sdfr yystos[*yyssp], yyvsp); 1669178825Sdfr YYPOPSTACK (1); 1670178825Sdfr } 1671178825Sdfr#ifndef yyoverflow 1672178825Sdfr if (yyss != yyssa) 1673178825Sdfr YYSTACK_FREE (yyss); 1674178825Sdfr#endif 1675178825Sdfr#if YYERROR_VERBOSE 1676178825Sdfr if (yymsg != yymsgbuf) 1677178825Sdfr YYSTACK_FREE (yymsg); 1678178825Sdfr#endif 1679178825Sdfr /* Make sure YYID is used. */ 1680178825Sdfr return YYID (yyresult); 1681178825Sdfr} 1682178825Sdfr 1683178825Sdfr 1684233294Sstas#line 143 "parse.y" 1685178825Sdfr 1686178825Sdfr 1687178825Sdfrstatic long 1688178825Sdfrname2number(const char *str) 1689178825Sdfr{ 1690178825Sdfr const char *p; 1691178825Sdfr long num = 0; 1692178825Sdfr const char *x = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" 1693178825Sdfr "abcdefghijklmnopqrstuvwxyz0123456789_"; 1694178825Sdfr if(strlen(str) > 4) { 1695178825Sdfr yyerror("table name too long"); 1696178825Sdfr return 0; 1697178825Sdfr } 1698178825Sdfr for(p = str; *p; p++){ 1699178825Sdfr char *q = strchr(x, *p); 1700178825Sdfr if(q == NULL) { 1701178825Sdfr yyerror("invalid character in table name"); 1702178825Sdfr return 0; 1703178825Sdfr } 1704178825Sdfr num = (num << 6) + (q - x) + 1; 1705178825Sdfr } 1706178825Sdfr num <<= 8; 1707178825Sdfr if(num > 0x7fffffff) 1708178825Sdfr num = -(0xffffffff - num + 1); 1709178825Sdfr return num; 1710178825Sdfr} 1711178825Sdfr 1712178825Sdfrvoid 1713178825Sdfryyerror (char *s) 1714178825Sdfr{ 1715233294Sstas _lex_error_message ("%s\n", s); 1716178825Sdfr} 1717178825Sdfr 1718