1178843Sdfr/* A Bison parser, made by GNU Bison 2.3. */ 2178843Sdfr 3178843Sdfr/* Skeleton implementation for Bison's Yacc-like parsers in C 4178843Sdfr 5178843Sdfr Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 6178843Sdfr Free Software Foundation, Inc. 7178843Sdfr 8178843Sdfr This program is free software; you can redistribute it and/or modify 9178843Sdfr it under the terms of the GNU General Public License as published by 10178843Sdfr the Free Software Foundation; either version 2, or (at your option) 11178843Sdfr any later version. 12178843Sdfr 13178843Sdfr This program is distributed in the hope that it will be useful, 14178843Sdfr but WITHOUT ANY WARRANTY; without even the implied warranty of 15178843Sdfr MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16178843Sdfr GNU General Public License for more details. 17178843Sdfr 18178843Sdfr You should have received a copy of the GNU General Public License 19178843Sdfr along with this program; if not, write to the Free Software 20178843Sdfr Foundation, Inc., 51 Franklin Street, Fifth Floor, 21178843Sdfr Boston, MA 02110-1301, USA. */ 22178843Sdfr 23178843Sdfr/* As a special exception, you may create a larger work that contains 24178843Sdfr part or all of the Bison parser skeleton and distribute that work 25178843Sdfr under terms of your choice, so long as that work isn't itself a 26178843Sdfr parser generator using the skeleton or a modified version thereof 27178843Sdfr as a parser skeleton. Alternatively, if you modify or redistribute 28178843Sdfr the parser skeleton itself, you may (at your option) remove this 29178843Sdfr special exception, which will cause the skeleton and the resulting 30178843Sdfr Bison output files to be licensed under the GNU General Public 31178843Sdfr License without this special exception. 32178843Sdfr 33178843Sdfr This special exception was added by the Free Software Foundation in 34178843Sdfr version 2.2 of Bison. */ 35178843Sdfr 36178843Sdfr/* C LALR(1) parser skeleton written by Richard Stallman, by 37178843Sdfr simplifying the original so-called "semantic" parser. */ 38178843Sdfr 39178843Sdfr/* All symbols defined below should begin with yy or YY, to avoid 40178843Sdfr infringing on user name space. This should be done even for local 41178843Sdfr variables, as they might otherwise be expanded by user macros. 42178843Sdfr There are some unavoidable exceptions within include files to 43178843Sdfr define necessary library symbols; they are noted "INFRINGES ON 44178843Sdfr USER NAME SPACE" below. */ 45178843Sdfr 46178843Sdfr/* Identify Bison output. */ 47178843Sdfr#define YYBISON 1 48178843Sdfr 49178843Sdfr/* Bison version. */ 50178843Sdfr#define YYBISON_VERSION "2.3" 51178843Sdfr 52178843Sdfr/* Skeleton name. */ 53178843Sdfr#define YYSKELETON_NAME "yacc.c" 54178843Sdfr 55178843Sdfr/* Pure parsers. */ 56178843Sdfr#define YYPURE 0 57178843Sdfr 58178843Sdfr/* Using locations. */ 59178843Sdfr#define YYLSP_NEEDED 0 60178843Sdfr 61178843Sdfr 62178843Sdfr 63178843Sdfr/* Tokens. */ 64178843Sdfr#ifndef YYTOKENTYPE 65178843Sdfr# define YYTOKENTYPE 66178843Sdfr /* Put the tokens into the symbol table, so that GDB and other debuggers 67178843Sdfr know about them. */ 68178843Sdfr enum yytokentype { 69178843Sdfr ET = 258, 70178843Sdfr INDEX = 259, 71178843Sdfr PREFIX = 260, 72178843Sdfr EC = 261, 73178843Sdfr ID = 262, 74178843Sdfr END = 263, 75178843Sdfr STRING = 264, 76178843Sdfr NUMBER = 265 77178843Sdfr }; 78178843Sdfr#endif 79178843Sdfr/* Tokens. */ 80178843Sdfr#define ET 258 81178843Sdfr#define INDEX 259 82178843Sdfr#define PREFIX 260 83178843Sdfr#define EC 261 84178843Sdfr#define ID 262 85178843Sdfr#define END 263 86178843Sdfr#define STRING 264 87178843Sdfr#define NUMBER 265 88178843Sdfr 89178843Sdfr 90178843Sdfr 91178843Sdfr 92178843Sdfr/* Copy the first part of user declarations. */ 93178843Sdfr#line 1 "parse.y" 94178843Sdfr 95178843Sdfr/* 96178843Sdfr * Copyright (c) 1998 - 2000 Kungliga Tekniska H�gskolan 97178843Sdfr * (Royal Institute of Technology, Stockholm, Sweden). 98178843Sdfr * All rights reserved. 99178843Sdfr * 100178843Sdfr * Redistribution and use in source and binary forms, with or without 101178843Sdfr * modification, are permitted provided that the following conditions 102178843Sdfr * are met: 103178843Sdfr * 104178843Sdfr * 1. Redistributions of source code must retain the above copyright 105178843Sdfr * notice, this list of conditions and the following disclaimer. 106178843Sdfr * 107178843Sdfr * 2. Redistributions in binary form must reproduce the above copyright 108178843Sdfr * notice, this list of conditions and the following disclaimer in the 109178843Sdfr * documentation and/or other materials provided with the distribution. 110178843Sdfr * 111178843Sdfr * 3. Neither the name of the Institute nor the names of its contributors 112178843Sdfr * may be used to endorse or promote products derived from this software 113178843Sdfr * without specific prior written permission. 114178843Sdfr * 115178843Sdfr * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND 116178843Sdfr * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 117178843Sdfr * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 118178843Sdfr * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE 119178843Sdfr * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 120178843Sdfr * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 121178843Sdfr * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 122178843Sdfr * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 123178843Sdfr * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 124178843Sdfr * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 125178843Sdfr * SUCH DAMAGE. 126178843Sdfr */ 127178843Sdfr 128178843Sdfr#include "compile_et.h" 129178843Sdfr#include "lex.h" 130178843Sdfr 131178843SdfrRCSID("$Id: parse.y 15426 2005-06-16 19:21:42Z lha $"); 132178843Sdfr 133178843Sdfrvoid yyerror (char *s); 134178843Sdfrstatic long name2number(const char *str); 135178843Sdfr 136178843Sdfrextern char *yytext; 137178843Sdfr 138178843Sdfr/* This is for bison */ 139178843Sdfr 140178843Sdfr#if !defined(alloca) && !defined(HAVE_ALLOCA) 141178843Sdfr#define alloca(x) malloc(x) 142178843Sdfr#endif 143178843Sdfr 144178843Sdfr 145178843Sdfr 146178843Sdfr/* Enabling traces. */ 147178843Sdfr#ifndef YYDEBUG 148178843Sdfr# define YYDEBUG 0 149178843Sdfr#endif 150178843Sdfr 151178843Sdfr/* Enabling verbose error messages. */ 152178843Sdfr#ifdef YYERROR_VERBOSE 153178843Sdfr# undef YYERROR_VERBOSE 154178843Sdfr# define YYERROR_VERBOSE 1 155178843Sdfr#else 156178843Sdfr# define YYERROR_VERBOSE 0 157178843Sdfr#endif 158178843Sdfr 159178843Sdfr/* Enabling the token table. */ 160178843Sdfr#ifndef YYTOKEN_TABLE 161178843Sdfr# define YYTOKEN_TABLE 0 162178843Sdfr#endif 163178843Sdfr 164178843Sdfr#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED 165178843Sdfrtypedef union YYSTYPE 166178843Sdfr#line 53 "parse.y" 167178843Sdfr{ 168178843Sdfr char *string; 169178843Sdfr int number; 170178843Sdfr} 171178843Sdfr/* Line 193 of yacc.c. */ 172178843Sdfr#line 173 "parse.c" 173178843Sdfr YYSTYPE; 174178843Sdfr# define yystype YYSTYPE /* obsolescent; will be withdrawn */ 175178843Sdfr# define YYSTYPE_IS_DECLARED 1 176178843Sdfr# define YYSTYPE_IS_TRIVIAL 1 177178843Sdfr#endif 178178843Sdfr 179178843Sdfr 180178843Sdfr 181178843Sdfr/* Copy the second part of user declarations. */ 182178843Sdfr 183178843Sdfr 184178843Sdfr/* Line 216 of yacc.c. */ 185178843Sdfr#line 186 "parse.c" 186178843Sdfr 187178843Sdfr#ifdef short 188178843Sdfr# undef short 189178843Sdfr#endif 190178843Sdfr 191178843Sdfr#ifdef YYTYPE_UINT8 192178843Sdfrtypedef YYTYPE_UINT8 yytype_uint8; 193178843Sdfr#else 194178843Sdfrtypedef unsigned char yytype_uint8; 195178843Sdfr#endif 196178843Sdfr 197178843Sdfr#ifdef YYTYPE_INT8 198178843Sdfrtypedef YYTYPE_INT8 yytype_int8; 199178843Sdfr#elif (defined __STDC__ || defined __C99__FUNC__ \ 200178843Sdfr || defined __cplusplus || defined _MSC_VER) 201178843Sdfrtypedef signed char yytype_int8; 202178843Sdfr#else 203178843Sdfrtypedef short int yytype_int8; 204178843Sdfr#endif 205178843Sdfr 206178843Sdfr#ifdef YYTYPE_UINT16 207178843Sdfrtypedef YYTYPE_UINT16 yytype_uint16; 208178843Sdfr#else 209178843Sdfrtypedef unsigned short int yytype_uint16; 210178843Sdfr#endif 211178843Sdfr 212178843Sdfr#ifdef YYTYPE_INT16 213178843Sdfrtypedef YYTYPE_INT16 yytype_int16; 214178843Sdfr#else 215178843Sdfrtypedef short int yytype_int16; 216178843Sdfr#endif 217178843Sdfr 218178843Sdfr#ifndef YYSIZE_T 219178843Sdfr# ifdef __SIZE_TYPE__ 220178843Sdfr# define YYSIZE_T __SIZE_TYPE__ 221178843Sdfr# elif defined size_t 222178843Sdfr# define YYSIZE_T size_t 223178843Sdfr# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ 224178843Sdfr || defined __cplusplus || defined _MSC_VER) 225178843Sdfr# include <stddef.h> /* INFRINGES ON USER NAME SPACE */ 226178843Sdfr# define YYSIZE_T size_t 227178843Sdfr# else 228178843Sdfr# define YYSIZE_T unsigned int 229178843Sdfr# endif 230178843Sdfr#endif 231178843Sdfr 232178843Sdfr#define YYSIZE_MAXIMUM ((YYSIZE_T) -1) 233178843Sdfr 234178843Sdfr#ifndef YY_ 235178843Sdfr# if defined YYENABLE_NLS && YYENABLE_NLS 236178843Sdfr# if ENABLE_NLS 237178843Sdfr# include <libintl.h> /* INFRINGES ON USER NAME SPACE */ 238178843Sdfr# define YY_(msgid) dgettext ("bison-runtime", msgid) 239178843Sdfr# endif 240178843Sdfr# endif 241178843Sdfr# ifndef YY_ 242178843Sdfr# define YY_(msgid) msgid 243178843Sdfr# endif 244178843Sdfr#endif 245178843Sdfr 246178843Sdfr/* Suppress unused-variable warnings by "using" E. */ 247178843Sdfr#if ! defined lint || defined __GNUC__ 248178843Sdfr# define YYUSE(e) ((void) (e)) 249178843Sdfr#else 250178843Sdfr# define YYUSE(e) /* empty */ 251178843Sdfr#endif 252178843Sdfr 253178843Sdfr/* Identity function, used to suppress warnings about constant conditions. */ 254178843Sdfr#ifndef lint 255178843Sdfr# define YYID(n) (n) 256178843Sdfr#else 257178843Sdfr#if (defined __STDC__ || defined __C99__FUNC__ \ 258178843Sdfr || defined __cplusplus || defined _MSC_VER) 259178843Sdfrstatic int 260178843SdfrYYID (int i) 261178843Sdfr#else 262178843Sdfrstatic int 263178843SdfrYYID (i) 264178843Sdfr int i; 265178843Sdfr#endif 266178843Sdfr{ 267178843Sdfr return i; 268178843Sdfr} 269178843Sdfr#endif 270178843Sdfr 271178843Sdfr#if ! defined yyoverflow || YYERROR_VERBOSE 272178843Sdfr 273178843Sdfr/* The parser invokes alloca or malloc; define the necessary symbols. */ 274178843Sdfr 275178843Sdfr# ifdef YYSTACK_USE_ALLOCA 276178843Sdfr# if YYSTACK_USE_ALLOCA 277178843Sdfr# ifdef __GNUC__ 278178843Sdfr# define YYSTACK_ALLOC __builtin_alloca 279178843Sdfr# elif defined __BUILTIN_VA_ARG_INCR 280178843Sdfr# include <alloca.h> /* INFRINGES ON USER NAME SPACE */ 281178843Sdfr# elif defined _AIX 282178843Sdfr# define YYSTACK_ALLOC __alloca 283178843Sdfr# elif defined _MSC_VER 284178843Sdfr# include <malloc.h> /* INFRINGES ON USER NAME SPACE */ 285178843Sdfr# define alloca _alloca 286178843Sdfr# else 287178843Sdfr# define YYSTACK_ALLOC alloca 288178843Sdfr# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ 289178843Sdfr || defined __cplusplus || defined _MSC_VER) 290178843Sdfr# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ 291178843Sdfr# ifndef _STDLIB_H 292178843Sdfr# define _STDLIB_H 1 293178843Sdfr# endif 294178843Sdfr# endif 295178843Sdfr# endif 296178843Sdfr# endif 297178843Sdfr# endif 298178843Sdfr 299178843Sdfr# ifdef YYSTACK_ALLOC 300178843Sdfr /* Pacify GCC's `empty if-body' warning. */ 301178843Sdfr# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) 302178843Sdfr# ifndef YYSTACK_ALLOC_MAXIMUM 303178843Sdfr /* The OS might guarantee only one guard page at the bottom of the stack, 304178843Sdfr and a page size can be as small as 4096 bytes. So we cannot safely 305178843Sdfr invoke alloca (N) if N exceeds 4096. Use a slightly smaller number 306178843Sdfr to allow for a few compiler-allocated temporary stack slots. */ 307178843Sdfr# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ 308178843Sdfr# endif 309178843Sdfr# else 310178843Sdfr# define YYSTACK_ALLOC YYMALLOC 311178843Sdfr# define YYSTACK_FREE YYFREE 312178843Sdfr# ifndef YYSTACK_ALLOC_MAXIMUM 313178843Sdfr# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM 314178843Sdfr# endif 315178843Sdfr# if (defined __cplusplus && ! defined _STDLIB_H \ 316178843Sdfr && ! ((defined YYMALLOC || defined malloc) \ 317178843Sdfr && (defined YYFREE || defined free))) 318178843Sdfr# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ 319178843Sdfr# ifndef _STDLIB_H 320178843Sdfr# define _STDLIB_H 1 321178843Sdfr# endif 322178843Sdfr# endif 323178843Sdfr# ifndef YYMALLOC 324178843Sdfr# define YYMALLOC malloc 325178843Sdfr# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ 326178843Sdfr || defined __cplusplus || defined _MSC_VER) 327178843Sdfrvoid *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ 328178843Sdfr# endif 329178843Sdfr# endif 330178843Sdfr# ifndef YYFREE 331178843Sdfr# define YYFREE free 332178843Sdfr# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ 333178843Sdfr || defined __cplusplus || defined _MSC_VER) 334178843Sdfrvoid free (void *); /* INFRINGES ON USER NAME SPACE */ 335178843Sdfr# endif 336178843Sdfr# endif 337178843Sdfr# endif 338178843Sdfr#endif /* ! defined yyoverflow || YYERROR_VERBOSE */ 339178843Sdfr 340178843Sdfr 341178843Sdfr#if (! defined yyoverflow \ 342178843Sdfr && (! defined __cplusplus \ 343178843Sdfr || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) 344178843Sdfr 345178843Sdfr/* A type that is properly aligned for any stack member. */ 346178843Sdfrunion yyalloc 347178843Sdfr{ 348178843Sdfr yytype_int16 yyss; 349178843Sdfr YYSTYPE yyvs; 350178843Sdfr }; 351178843Sdfr 352178843Sdfr/* The size of the maximum gap between one aligned stack and the next. */ 353178843Sdfr# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) 354178843Sdfr 355178843Sdfr/* The size of an array large to enough to hold all stacks, each with 356178843Sdfr N elements. */ 357178843Sdfr# define YYSTACK_BYTES(N) \ 358178843Sdfr ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ 359178843Sdfr + YYSTACK_GAP_MAXIMUM) 360178843Sdfr 361178843Sdfr/* Copy COUNT objects from FROM to TO. The source and destination do 362178843Sdfr not overlap. */ 363178843Sdfr# ifndef YYCOPY 364178843Sdfr# if defined __GNUC__ && 1 < __GNUC__ 365178843Sdfr# define YYCOPY(To, From, Count) \ 366178843Sdfr __builtin_memcpy (To, From, (Count) * sizeof (*(From))) 367178843Sdfr# else 368178843Sdfr# define YYCOPY(To, From, Count) \ 369178843Sdfr do \ 370178843Sdfr { \ 371178843Sdfr YYSIZE_T yyi; \ 372178843Sdfr for (yyi = 0; yyi < (Count); yyi++) \ 373178843Sdfr (To)[yyi] = (From)[yyi]; \ 374178843Sdfr } \ 375178843Sdfr while (YYID (0)) 376178843Sdfr# endif 377178843Sdfr# endif 378178843Sdfr 379178843Sdfr/* Relocate STACK from its old location to the new one. The 380178843Sdfr local variables YYSIZE and YYSTACKSIZE give the old and new number of 381178843Sdfr elements in the stack, and YYPTR gives the new location of the 382178843Sdfr stack. Advance YYPTR to a properly aligned location for the next 383178843Sdfr stack. */ 384178843Sdfr# define YYSTACK_RELOCATE(Stack) \ 385178843Sdfr do \ 386178843Sdfr { \ 387178843Sdfr YYSIZE_T yynewbytes; \ 388178843Sdfr YYCOPY (&yyptr->Stack, Stack, yysize); \ 389178843Sdfr Stack = &yyptr->Stack; \ 390178843Sdfr yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ 391178843Sdfr yyptr += yynewbytes / sizeof (*yyptr); \ 392178843Sdfr } \ 393178843Sdfr while (YYID (0)) 394178843Sdfr 395178843Sdfr#endif 396178843Sdfr 397178843Sdfr/* YYFINAL -- State number of the termination state. */ 398178843Sdfr#define YYFINAL 9 399178843Sdfr/* YYLAST -- Last index in YYTABLE. */ 400178843Sdfr#define YYLAST 23 401178843Sdfr 402178843Sdfr/* YYNTOKENS -- Number of terminals. */ 403178843Sdfr#define YYNTOKENS 12 404178843Sdfr/* YYNNTS -- Number of nonterminals. */ 405178843Sdfr#define YYNNTS 7 406178843Sdfr/* YYNRULES -- Number of rules. */ 407178843Sdfr#define YYNRULES 15 408178843Sdfr/* YYNRULES -- Number of states. */ 409178843Sdfr#define YYNSTATES 24 410178843Sdfr 411178843Sdfr/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ 412178843Sdfr#define YYUNDEFTOK 2 413178843Sdfr#define YYMAXUTOK 265 414178843Sdfr 415178843Sdfr#define YYTRANSLATE(YYX) \ 416178843Sdfr ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) 417178843Sdfr 418178843Sdfr/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ 419178843Sdfrstatic const yytype_uint8 yytranslate[] = 420178843Sdfr{ 421178843Sdfr 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 422178843Sdfr 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 423178843Sdfr 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 424178843Sdfr 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 425178843Sdfr 2, 2, 2, 2, 11, 2, 2, 2, 2, 2, 426178843Sdfr 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 427178843Sdfr 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 428178843Sdfr 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 429178843Sdfr 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 430178843Sdfr 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 431178843Sdfr 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 432178843Sdfr 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 433178843Sdfr 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 434178843Sdfr 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 435178843Sdfr 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 436178843Sdfr 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 437178843Sdfr 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 438178843Sdfr 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 439178843Sdfr 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 440178843Sdfr 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 441178843Sdfr 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 442178843Sdfr 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 443178843Sdfr 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 444178843Sdfr 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 445178843Sdfr 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 446178843Sdfr 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, 447178843Sdfr 5, 6, 7, 8, 9, 10 448178843Sdfr}; 449178843Sdfr 450178843Sdfr#if YYDEBUG 451178843Sdfr/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in 452178843Sdfr YYRHS. */ 453178843Sdfrstatic const yytype_uint8 yyprhs[] = 454178843Sdfr{ 455178843Sdfr 0, 0, 3, 4, 7, 10, 12, 15, 18, 22, 456178843Sdfr 24, 27, 30, 33, 35, 40 457178843Sdfr}; 458178843Sdfr 459178843Sdfr/* YYRHS -- A `-1'-separated list of the rules' RHS. */ 460178843Sdfrstatic const yytype_int8 yyrhs[] = 461178843Sdfr{ 462178843Sdfr 13, 0, -1, -1, 14, 17, -1, 15, 16, -1, 463178843Sdfr 16, -1, 7, 9, -1, 3, 9, -1, 3, 9, 464178843Sdfr 9, -1, 18, -1, 17, 18, -1, 4, 10, -1, 465178843Sdfr 5, 9, -1, 5, -1, 6, 9, 11, 9, -1, 466178843Sdfr 8, -1 467178843Sdfr}; 468178843Sdfr 469178843Sdfr/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ 470178843Sdfrstatic const yytype_uint8 yyrline[] = 471178843Sdfr{ 472178843Sdfr 0, 64, 64, 65, 68, 69, 72, 78, 84, 93, 473178843Sdfr 94, 97, 101, 109, 116, 136 474178843Sdfr}; 475178843Sdfr#endif 476178843Sdfr 477178843Sdfr#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE 478178843Sdfr/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. 479178843Sdfr First, the terminals, then, starting at YYNTOKENS, nonterminals. */ 480178843Sdfrstatic const char *const yytname[] = 481178843Sdfr{ 482178843Sdfr "$end", "error", "$undefined", "ET", "INDEX", "PREFIX", "EC", "ID", 483178843Sdfr "END", "STRING", "NUMBER", "','", "$accept", "file", "header", "id", 484178843Sdfr "et", "statements", "statement", 0 485178843Sdfr}; 486178843Sdfr#endif 487178843Sdfr 488178843Sdfr# ifdef YYPRINT 489178843Sdfr/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to 490178843Sdfr token YYLEX-NUM. */ 491178843Sdfrstatic const yytype_uint16 yytoknum[] = 492178843Sdfr{ 493178843Sdfr 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 494178843Sdfr 265, 44 495178843Sdfr}; 496178843Sdfr# endif 497178843Sdfr 498178843Sdfr/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ 499178843Sdfrstatic const yytype_uint8 yyr1[] = 500178843Sdfr{ 501178843Sdfr 0, 12, 13, 13, 14, 14, 15, 16, 16, 17, 502178843Sdfr 17, 18, 18, 18, 18, 18 503178843Sdfr}; 504178843Sdfr 505178843Sdfr/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ 506178843Sdfrstatic const yytype_uint8 yyr2[] = 507178843Sdfr{ 508178843Sdfr 0, 2, 0, 2, 2, 1, 2, 2, 3, 1, 509178843Sdfr 2, 2, 2, 1, 4, 1 510178843Sdfr}; 511178843Sdfr 512178843Sdfr/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state 513178843Sdfr STATE-NUM when YYTABLE doesn't specify something else to do. Zero 514178843Sdfr means the default is an error. */ 515178843Sdfrstatic const yytype_uint8 yydefact[] = 516178843Sdfr{ 517178843Sdfr 2, 0, 0, 0, 0, 0, 5, 7, 6, 1, 518178843Sdfr 0, 13, 0, 15, 3, 9, 4, 8, 11, 12, 519178843Sdfr 0, 10, 0, 14 520178843Sdfr}; 521178843Sdfr 522178843Sdfr/* YYDEFGOTO[NTERM-NUM]. */ 523178843Sdfrstatic const yytype_int8 yydefgoto[] = 524178843Sdfr{ 525178843Sdfr -1, 3, 4, 5, 6, 14, 15 526178843Sdfr}; 527178843Sdfr 528178843Sdfr/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing 529178843Sdfr STATE-NUM. */ 530178843Sdfr#define YYPACT_NINF -5 531178843Sdfrstatic const yytype_int8 yypact[] = 532178843Sdfr{ 533178843Sdfr 0, -3, -1, 5, -4, 6, -5, 1, -5, -5, 534178843Sdfr 2, 4, 7, -5, -4, -5, -5, -5, -5, -5, 535178843Sdfr 3, -5, 8, -5 536178843Sdfr}; 537178843Sdfr 538178843Sdfr/* YYPGOTO[NTERM-NUM]. */ 539178843Sdfrstatic const yytype_int8 yypgoto[] = 540178843Sdfr{ 541178843Sdfr -5, -5, -5, -5, 10, -5, 9 542178843Sdfr}; 543178843Sdfr 544178843Sdfr/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If 545178843Sdfr positive, shift that token. If negative, reduce the rule which 546178843Sdfr number is the opposite. If zero, do what YYDEFACT says. 547178843Sdfr If YYTABLE_NINF, syntax error. */ 548178843Sdfr#define YYTABLE_NINF -1 549178843Sdfrstatic const yytype_uint8 yytable[] = 550178843Sdfr{ 551178843Sdfr 10, 11, 12, 1, 13, 9, 7, 2, 8, 1, 552178843Sdfr 17, 0, 18, 19, 22, 16, 20, 23, 0, 0, 553178843Sdfr 0, 0, 0, 21 554178843Sdfr}; 555178843Sdfr 556178843Sdfrstatic const yytype_int8 yycheck[] = 557178843Sdfr{ 558178843Sdfr 4, 5, 6, 3, 8, 0, 9, 7, 9, 3, 559178843Sdfr 9, -1, 10, 9, 11, 5, 9, 9, -1, -1, 560178843Sdfr -1, -1, -1, 14 561178843Sdfr}; 562178843Sdfr 563178843Sdfr/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing 564178843Sdfr symbol of state STATE-NUM. */ 565178843Sdfrstatic const yytype_uint8 yystos[] = 566178843Sdfr{ 567178843Sdfr 0, 3, 7, 13, 14, 15, 16, 9, 9, 0, 568178843Sdfr 4, 5, 6, 8, 17, 18, 16, 9, 10, 9, 569178843Sdfr 9, 18, 11, 9 570178843Sdfr}; 571178843Sdfr 572178843Sdfr#define yyerrok (yyerrstatus = 0) 573178843Sdfr#define yyclearin (yychar = YYEMPTY) 574178843Sdfr#define YYEMPTY (-2) 575178843Sdfr#define YYEOF 0 576178843Sdfr 577178843Sdfr#define YYACCEPT goto yyacceptlab 578178843Sdfr#define YYABORT goto yyabortlab 579178843Sdfr#define YYERROR goto yyerrorlab 580178843Sdfr 581178843Sdfr 582178843Sdfr/* Like YYERROR except do call yyerror. This remains here temporarily 583178843Sdfr to ease the transition to the new meaning of YYERROR, for GCC. 584178843Sdfr Once GCC version 2 has supplanted version 1, this can go. */ 585178843Sdfr 586178843Sdfr#define YYFAIL goto yyerrlab 587178843Sdfr 588178843Sdfr#define YYRECOVERING() (!!yyerrstatus) 589178843Sdfr 590178843Sdfr#define YYBACKUP(Token, Value) \ 591178843Sdfrdo \ 592178843Sdfr if (yychar == YYEMPTY && yylen == 1) \ 593178843Sdfr { \ 594178843Sdfr yychar = (Token); \ 595178843Sdfr yylval = (Value); \ 596178843Sdfr yytoken = YYTRANSLATE (yychar); \ 597178843Sdfr YYPOPSTACK (1); \ 598178843Sdfr goto yybackup; \ 599178843Sdfr } \ 600178843Sdfr else \ 601178843Sdfr { \ 602178843Sdfr yyerror (YY_("syntax error: cannot back up")); \ 603178843Sdfr YYERROR; \ 604178843Sdfr } \ 605178843Sdfrwhile (YYID (0)) 606178843Sdfr 607178843Sdfr 608178843Sdfr#define YYTERROR 1 609178843Sdfr#define YYERRCODE 256 610178843Sdfr 611178843Sdfr 612178843Sdfr/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. 613178843Sdfr If N is 0, then set CURRENT to the empty location which ends 614178843Sdfr the previous symbol: RHS[0] (always defined). */ 615178843Sdfr 616178843Sdfr#define YYRHSLOC(Rhs, K) ((Rhs)[K]) 617178843Sdfr#ifndef YYLLOC_DEFAULT 618178843Sdfr# define YYLLOC_DEFAULT(Current, Rhs, N) \ 619178843Sdfr do \ 620178843Sdfr if (YYID (N)) \ 621178843Sdfr { \ 622178843Sdfr (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ 623178843Sdfr (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ 624178843Sdfr (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ 625178843Sdfr (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ 626178843Sdfr } \ 627178843Sdfr else \ 628178843Sdfr { \ 629178843Sdfr (Current).first_line = (Current).last_line = \ 630178843Sdfr YYRHSLOC (Rhs, 0).last_line; \ 631178843Sdfr (Current).first_column = (Current).last_column = \ 632178843Sdfr YYRHSLOC (Rhs, 0).last_column; \ 633178843Sdfr } \ 634178843Sdfr while (YYID (0)) 635178843Sdfr#endif 636178843Sdfr 637178843Sdfr 638178843Sdfr/* YY_LOCATION_PRINT -- Print the location on the stream. 639178843Sdfr This macro was not mandated originally: define only if we know 640178843Sdfr we won't break user code: when these are the locations we know. */ 641178843Sdfr 642178843Sdfr#ifndef YY_LOCATION_PRINT 643178843Sdfr# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL 644178843Sdfr# define YY_LOCATION_PRINT(File, Loc) \ 645178843Sdfr fprintf (File, "%d.%d-%d.%d", \ 646178843Sdfr (Loc).first_line, (Loc).first_column, \ 647178843Sdfr (Loc).last_line, (Loc).last_column) 648178843Sdfr# else 649178843Sdfr# define YY_LOCATION_PRINT(File, Loc) ((void) 0) 650178843Sdfr# endif 651178843Sdfr#endif 652178843Sdfr 653178843Sdfr 654178843Sdfr/* YYLEX -- calling `yylex' with the right arguments. */ 655178843Sdfr 656178843Sdfr#ifdef YYLEX_PARAM 657178843Sdfr# define YYLEX yylex (YYLEX_PARAM) 658178843Sdfr#else 659178843Sdfr# define YYLEX yylex () 660178843Sdfr#endif 661178843Sdfr 662178843Sdfr/* Enable debugging if requested. */ 663178843Sdfr#if YYDEBUG 664178843Sdfr 665178843Sdfr# ifndef YYFPRINTF 666178843Sdfr# include <stdio.h> /* INFRINGES ON USER NAME SPACE */ 667178843Sdfr# define YYFPRINTF fprintf 668178843Sdfr# endif 669178843Sdfr 670178843Sdfr# define YYDPRINTF(Args) \ 671178843Sdfrdo { \ 672178843Sdfr if (yydebug) \ 673178843Sdfr YYFPRINTF Args; \ 674178843Sdfr} while (YYID (0)) 675178843Sdfr 676178843Sdfr# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ 677178843Sdfrdo { \ 678178843Sdfr if (yydebug) \ 679178843Sdfr { \ 680178843Sdfr YYFPRINTF (stderr, "%s ", Title); \ 681178843Sdfr yy_symbol_print (stderr, \ 682178843Sdfr Type, Value); \ 683178843Sdfr YYFPRINTF (stderr, "\n"); \ 684178843Sdfr } \ 685178843Sdfr} while (YYID (0)) 686178843Sdfr 687178843Sdfr 688178843Sdfr/*--------------------------------. 689178843Sdfr| Print this symbol on YYOUTPUT. | 690178843Sdfr`--------------------------------*/ 691178843Sdfr 692178843Sdfr/*ARGSUSED*/ 693178843Sdfr#if (defined __STDC__ || defined __C99__FUNC__ \ 694178843Sdfr || defined __cplusplus || defined _MSC_VER) 695178843Sdfrstatic void 696178843Sdfryy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) 697178843Sdfr#else 698178843Sdfrstatic void 699178843Sdfryy_symbol_value_print (yyoutput, yytype, yyvaluep) 700178843Sdfr FILE *yyoutput; 701178843Sdfr int yytype; 702178843Sdfr YYSTYPE const * const yyvaluep; 703178843Sdfr#endif 704178843Sdfr{ 705178843Sdfr if (!yyvaluep) 706178843Sdfr return; 707178843Sdfr# ifdef YYPRINT 708178843Sdfr if (yytype < YYNTOKENS) 709178843Sdfr YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); 710178843Sdfr# else 711178843Sdfr YYUSE (yyoutput); 712178843Sdfr# endif 713178843Sdfr switch (yytype) 714178843Sdfr { 715178843Sdfr default: 716178843Sdfr break; 717178843Sdfr } 718178843Sdfr} 719178843Sdfr 720178843Sdfr 721178843Sdfr/*--------------------------------. 722178843Sdfr| Print this symbol on YYOUTPUT. | 723178843Sdfr`--------------------------------*/ 724178843Sdfr 725178843Sdfr#if (defined __STDC__ || defined __C99__FUNC__ \ 726178843Sdfr || defined __cplusplus || defined _MSC_VER) 727178843Sdfrstatic void 728178843Sdfryy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) 729178843Sdfr#else 730178843Sdfrstatic void 731178843Sdfryy_symbol_print (yyoutput, yytype, yyvaluep) 732178843Sdfr FILE *yyoutput; 733178843Sdfr int yytype; 734178843Sdfr YYSTYPE const * const yyvaluep; 735178843Sdfr#endif 736178843Sdfr{ 737178843Sdfr if (yytype < YYNTOKENS) 738178843Sdfr YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); 739178843Sdfr else 740178843Sdfr YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); 741178843Sdfr 742178843Sdfr yy_symbol_value_print (yyoutput, yytype, yyvaluep); 743178843Sdfr YYFPRINTF (yyoutput, ")"); 744178843Sdfr} 745178843Sdfr 746178843Sdfr/*------------------------------------------------------------------. 747178843Sdfr| yy_stack_print -- Print the state stack from its BOTTOM up to its | 748178843Sdfr| TOP (included). | 749178843Sdfr`------------------------------------------------------------------*/ 750178843Sdfr 751178843Sdfr#if (defined __STDC__ || defined __C99__FUNC__ \ 752178843Sdfr || defined __cplusplus || defined _MSC_VER) 753178843Sdfrstatic void 754178843Sdfryy_stack_print (yytype_int16 *bottom, yytype_int16 *top) 755178843Sdfr#else 756178843Sdfrstatic void 757178843Sdfryy_stack_print (bottom, top) 758178843Sdfr yytype_int16 *bottom; 759178843Sdfr yytype_int16 *top; 760178843Sdfr#endif 761178843Sdfr{ 762178843Sdfr YYFPRINTF (stderr, "Stack now"); 763178843Sdfr for (; bottom <= top; ++bottom) 764178843Sdfr YYFPRINTF (stderr, " %d", *bottom); 765178843Sdfr YYFPRINTF (stderr, "\n"); 766178843Sdfr} 767178843Sdfr 768178843Sdfr# define YY_STACK_PRINT(Bottom, Top) \ 769178843Sdfrdo { \ 770178843Sdfr if (yydebug) \ 771178843Sdfr yy_stack_print ((Bottom), (Top)); \ 772178843Sdfr} while (YYID (0)) 773178843Sdfr 774178843Sdfr 775178843Sdfr/*------------------------------------------------. 776178843Sdfr| Report that the YYRULE is going to be reduced. | 777178843Sdfr`------------------------------------------------*/ 778178843Sdfr 779178843Sdfr#if (defined __STDC__ || defined __C99__FUNC__ \ 780178843Sdfr || defined __cplusplus || defined _MSC_VER) 781178843Sdfrstatic void 782178843Sdfryy_reduce_print (YYSTYPE *yyvsp, int yyrule) 783178843Sdfr#else 784178843Sdfrstatic void 785178843Sdfryy_reduce_print (yyvsp, yyrule) 786178843Sdfr YYSTYPE *yyvsp; 787178843Sdfr int yyrule; 788178843Sdfr#endif 789178843Sdfr{ 790178843Sdfr int yynrhs = yyr2[yyrule]; 791178843Sdfr int yyi; 792178843Sdfr unsigned long int yylno = yyrline[yyrule]; 793178843Sdfr YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", 794178843Sdfr yyrule - 1, yylno); 795178843Sdfr /* The symbols being reduced. */ 796178843Sdfr for (yyi = 0; yyi < yynrhs; yyi++) 797178843Sdfr { 798178843Sdfr fprintf (stderr, " $%d = ", yyi + 1); 799178843Sdfr yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], 800178843Sdfr &(yyvsp[(yyi + 1) - (yynrhs)]) 801178843Sdfr ); 802178843Sdfr fprintf (stderr, "\n"); 803178843Sdfr } 804178843Sdfr} 805178843Sdfr 806178843Sdfr# define YY_REDUCE_PRINT(Rule) \ 807178843Sdfrdo { \ 808178843Sdfr if (yydebug) \ 809178843Sdfr yy_reduce_print (yyvsp, Rule); \ 810178843Sdfr} while (YYID (0)) 811178843Sdfr 812178843Sdfr/* Nonzero means print parse trace. It is left uninitialized so that 813178843Sdfr multiple parsers can coexist. */ 814178843Sdfrint yydebug; 815178843Sdfr#else /* !YYDEBUG */ 816178843Sdfr# define YYDPRINTF(Args) 817178843Sdfr# define YY_SYMBOL_PRINT(Title, Type, Value, Location) 818178843Sdfr# define YY_STACK_PRINT(Bottom, Top) 819178843Sdfr# define YY_REDUCE_PRINT(Rule) 820178843Sdfr#endif /* !YYDEBUG */ 821178843Sdfr 822178843Sdfr 823178843Sdfr/* YYINITDEPTH -- initial size of the parser's stacks. */ 824178843Sdfr#ifndef YYINITDEPTH 825178843Sdfr# define YYINITDEPTH 200 826178843Sdfr#endif 827178843Sdfr 828178843Sdfr/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only 829178843Sdfr if the built-in stack extension method is used). 830178843Sdfr 831178843Sdfr Do not make this value too large; the results are undefined if 832178843Sdfr YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) 833178843Sdfr evaluated with infinite-precision integer arithmetic. */ 834178843Sdfr 835178843Sdfr#ifndef YYMAXDEPTH 836178843Sdfr# define YYMAXDEPTH 10000 837178843Sdfr#endif 838178843Sdfr 839178843Sdfr 840178843Sdfr 841178843Sdfr#if YYERROR_VERBOSE 842178843Sdfr 843178843Sdfr# ifndef yystrlen 844178843Sdfr# if defined __GLIBC__ && defined _STRING_H 845178843Sdfr# define yystrlen strlen 846178843Sdfr# else 847178843Sdfr/* Return the length of YYSTR. */ 848178843Sdfr#if (defined __STDC__ || defined __C99__FUNC__ \ 849178843Sdfr || defined __cplusplus || defined _MSC_VER) 850178843Sdfrstatic YYSIZE_T 851178843Sdfryystrlen (const char *yystr) 852178843Sdfr#else 853178843Sdfrstatic YYSIZE_T 854178843Sdfryystrlen (yystr) 855178843Sdfr const char *yystr; 856178843Sdfr#endif 857178843Sdfr{ 858178843Sdfr YYSIZE_T yylen; 859178843Sdfr for (yylen = 0; yystr[yylen]; yylen++) 860178843Sdfr continue; 861178843Sdfr return yylen; 862178843Sdfr} 863178843Sdfr# endif 864178843Sdfr# endif 865178843Sdfr 866178843Sdfr# ifndef yystpcpy 867178843Sdfr# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE 868178843Sdfr# define yystpcpy stpcpy 869178843Sdfr# else 870178843Sdfr/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in 871178843Sdfr YYDEST. */ 872178843Sdfr#if (defined __STDC__ || defined __C99__FUNC__ \ 873178843Sdfr || defined __cplusplus || defined _MSC_VER) 874178843Sdfrstatic char * 875178843Sdfryystpcpy (char *yydest, const char *yysrc) 876178843Sdfr#else 877178843Sdfrstatic char * 878178843Sdfryystpcpy (yydest, yysrc) 879178843Sdfr char *yydest; 880178843Sdfr const char *yysrc; 881178843Sdfr#endif 882178843Sdfr{ 883178843Sdfr char *yyd = yydest; 884178843Sdfr const char *yys = yysrc; 885178843Sdfr 886178843Sdfr while ((*yyd++ = *yys++) != '\0') 887178843Sdfr continue; 888178843Sdfr 889178843Sdfr return yyd - 1; 890178843Sdfr} 891178843Sdfr# endif 892178843Sdfr# endif 893178843Sdfr 894178843Sdfr# ifndef yytnamerr 895178843Sdfr/* Copy to YYRES the contents of YYSTR after stripping away unnecessary 896178843Sdfr quotes and backslashes, so that it's suitable for yyerror. The 897178843Sdfr heuristic is that double-quoting is unnecessary unless the string 898178843Sdfr contains an apostrophe, a comma, or backslash (other than 899178843Sdfr backslash-backslash). YYSTR is taken from yytname. If YYRES is 900178843Sdfr null, do not copy; instead, return the length of what the result 901178843Sdfr would have been. */ 902178843Sdfrstatic YYSIZE_T 903178843Sdfryytnamerr (char *yyres, const char *yystr) 904178843Sdfr{ 905178843Sdfr if (*yystr == '"') 906178843Sdfr { 907178843Sdfr YYSIZE_T yyn = 0; 908178843Sdfr char const *yyp = yystr; 909178843Sdfr 910178843Sdfr for (;;) 911178843Sdfr switch (*++yyp) 912178843Sdfr { 913178843Sdfr case '\'': 914178843Sdfr case ',': 915178843Sdfr goto do_not_strip_quotes; 916178843Sdfr 917178843Sdfr case '\\': 918178843Sdfr if (*++yyp != '\\') 919178843Sdfr goto do_not_strip_quotes; 920178843Sdfr /* Fall through. */ 921178843Sdfr default: 922178843Sdfr if (yyres) 923178843Sdfr yyres[yyn] = *yyp; 924178843Sdfr yyn++; 925178843Sdfr break; 926178843Sdfr 927178843Sdfr case '"': 928178843Sdfr if (yyres) 929178843Sdfr yyres[yyn] = '\0'; 930178843Sdfr return yyn; 931178843Sdfr } 932178843Sdfr do_not_strip_quotes: ; 933178843Sdfr } 934178843Sdfr 935178843Sdfr if (! yyres) 936178843Sdfr return yystrlen (yystr); 937178843Sdfr 938178843Sdfr return yystpcpy (yyres, yystr) - yyres; 939178843Sdfr} 940178843Sdfr# endif 941178843Sdfr 942178843Sdfr/* Copy into YYRESULT an error message about the unexpected token 943178843Sdfr YYCHAR while in state YYSTATE. Return the number of bytes copied, 944178843Sdfr including the terminating null byte. If YYRESULT is null, do not 945178843Sdfr copy anything; just return the number of bytes that would be 946178843Sdfr copied. As a special case, return 0 if an ordinary "syntax error" 947178843Sdfr message will do. Return YYSIZE_MAXIMUM if overflow occurs during 948178843Sdfr size calculation. */ 949178843Sdfrstatic YYSIZE_T 950178843Sdfryysyntax_error (char *yyresult, int yystate, int yychar) 951178843Sdfr{ 952178843Sdfr int yyn = yypact[yystate]; 953178843Sdfr 954178843Sdfr if (! (YYPACT_NINF < yyn && yyn <= YYLAST)) 955178843Sdfr return 0; 956178843Sdfr else 957178843Sdfr { 958178843Sdfr int yytype = YYTRANSLATE (yychar); 959178843Sdfr YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); 960178843Sdfr YYSIZE_T yysize = yysize0; 961178843Sdfr YYSIZE_T yysize1; 962178843Sdfr int yysize_overflow = 0; 963178843Sdfr enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; 964178843Sdfr char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; 965178843Sdfr int yyx; 966178843Sdfr 967178843Sdfr# if 0 968178843Sdfr /* This is so xgettext sees the translatable formats that are 969178843Sdfr constructed on the fly. */ 970178843Sdfr YY_("syntax error, unexpected %s"); 971178843Sdfr YY_("syntax error, unexpected %s, expecting %s"); 972178843Sdfr YY_("syntax error, unexpected %s, expecting %s or %s"); 973178843Sdfr YY_("syntax error, unexpected %s, expecting %s or %s or %s"); 974178843Sdfr YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); 975178843Sdfr# endif 976178843Sdfr char *yyfmt; 977178843Sdfr char const *yyf; 978178843Sdfr static char const yyunexpected[] = "syntax error, unexpected %s"; 979178843Sdfr static char const yyexpecting[] = ", expecting %s"; 980178843Sdfr static char const yyor[] = " or %s"; 981178843Sdfr char yyformat[sizeof yyunexpected 982178843Sdfr + sizeof yyexpecting - 1 983178843Sdfr + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) 984178843Sdfr * (sizeof yyor - 1))]; 985178843Sdfr char const *yyprefix = yyexpecting; 986178843Sdfr 987178843Sdfr /* Start YYX at -YYN if negative to avoid negative indexes in 988178843Sdfr YYCHECK. */ 989178843Sdfr int yyxbegin = yyn < 0 ? -yyn : 0; 990178843Sdfr 991178843Sdfr /* Stay within bounds of both yycheck and yytname. */ 992178843Sdfr int yychecklim = YYLAST - yyn + 1; 993178843Sdfr int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; 994178843Sdfr int yycount = 1; 995178843Sdfr 996178843Sdfr yyarg[0] = yytname[yytype]; 997178843Sdfr yyfmt = yystpcpy (yyformat, yyunexpected); 998178843Sdfr 999178843Sdfr for (yyx = yyxbegin; yyx < yyxend; ++yyx) 1000178843Sdfr if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) 1001178843Sdfr { 1002178843Sdfr if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) 1003178843Sdfr { 1004178843Sdfr yycount = 1; 1005178843Sdfr yysize = yysize0; 1006178843Sdfr yyformat[sizeof yyunexpected - 1] = '\0'; 1007178843Sdfr break; 1008178843Sdfr } 1009178843Sdfr yyarg[yycount++] = yytname[yyx]; 1010178843Sdfr yysize1 = yysize + yytnamerr (0, yytname[yyx]); 1011178843Sdfr yysize_overflow |= (yysize1 < yysize); 1012178843Sdfr yysize = yysize1; 1013178843Sdfr yyfmt = yystpcpy (yyfmt, yyprefix); 1014178843Sdfr yyprefix = yyor; 1015178843Sdfr } 1016178843Sdfr 1017178843Sdfr yyf = YY_(yyformat); 1018178843Sdfr yysize1 = yysize + yystrlen (yyf); 1019178843Sdfr yysize_overflow |= (yysize1 < yysize); 1020178843Sdfr yysize = yysize1; 1021178843Sdfr 1022178843Sdfr if (yysize_overflow) 1023178843Sdfr return YYSIZE_MAXIMUM; 1024178843Sdfr 1025178843Sdfr if (yyresult) 1026178843Sdfr { 1027178843Sdfr /* Avoid sprintf, as that infringes on the user's name space. 1028178843Sdfr Don't have undefined behavior even if the translation 1029178843Sdfr produced a string with the wrong number of "%s"s. */ 1030178843Sdfr char *yyp = yyresult; 1031178843Sdfr int yyi = 0; 1032178843Sdfr while ((*yyp = *yyf) != '\0') 1033178843Sdfr { 1034178843Sdfr if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) 1035178843Sdfr { 1036178843Sdfr yyp += yytnamerr (yyp, yyarg[yyi++]); 1037178843Sdfr yyf += 2; 1038178843Sdfr } 1039178843Sdfr else 1040178843Sdfr { 1041178843Sdfr yyp++; 1042178843Sdfr yyf++; 1043178843Sdfr } 1044178843Sdfr } 1045178843Sdfr } 1046178843Sdfr return yysize; 1047178843Sdfr } 1048178843Sdfr} 1049178843Sdfr#endif /* YYERROR_VERBOSE */ 1050178843Sdfr 1051178843Sdfr 1052178843Sdfr/*-----------------------------------------------. 1053178843Sdfr| Release the memory associated to this symbol. | 1054178843Sdfr`-----------------------------------------------*/ 1055178843Sdfr 1056178843Sdfr/*ARGSUSED*/ 1057178843Sdfr#if (defined __STDC__ || defined __C99__FUNC__ \ 1058178843Sdfr || defined __cplusplus || defined _MSC_VER) 1059178843Sdfrstatic void 1060178843Sdfryydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) 1061178843Sdfr#else 1062178843Sdfrstatic void 1063178843Sdfryydestruct (yymsg, yytype, yyvaluep) 1064178843Sdfr const char *yymsg; 1065178843Sdfr int yytype; 1066178843Sdfr YYSTYPE *yyvaluep; 1067178843Sdfr#endif 1068178843Sdfr{ 1069178843Sdfr YYUSE (yyvaluep); 1070178843Sdfr 1071178843Sdfr if (!yymsg) 1072178843Sdfr yymsg = "Deleting"; 1073178843Sdfr YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); 1074178843Sdfr 1075178843Sdfr switch (yytype) 1076178843Sdfr { 1077178843Sdfr 1078178843Sdfr default: 1079178843Sdfr break; 1080178843Sdfr } 1081178843Sdfr} 1082178843Sdfr 1083178843Sdfr 1084178843Sdfr/* Prevent warnings from -Wmissing-prototypes. */ 1085178843Sdfr 1086178843Sdfr#ifdef YYPARSE_PARAM 1087178843Sdfr#if defined __STDC__ || defined __cplusplus 1088178843Sdfrint yyparse (void *YYPARSE_PARAM); 1089178843Sdfr#else 1090178843Sdfrint yyparse (); 1091178843Sdfr#endif 1092178843Sdfr#else /* ! YYPARSE_PARAM */ 1093178843Sdfr#if defined __STDC__ || defined __cplusplus 1094178843Sdfrint yyparse (void); 1095178843Sdfr#else 1096178843Sdfrint yyparse (); 1097178843Sdfr#endif 1098178843Sdfr#endif /* ! YYPARSE_PARAM */ 1099178843Sdfr 1100178843Sdfr 1101178843Sdfr 1102178843Sdfr/* The look-ahead symbol. */ 1103178843Sdfrint yychar; 1104178843Sdfr 1105178843Sdfr/* The semantic value of the look-ahead symbol. */ 1106178843SdfrYYSTYPE yylval; 1107178843Sdfr 1108178843Sdfr/* Number of syntax errors so far. */ 1109178843Sdfrint yynerrs; 1110178843Sdfr 1111178843Sdfr 1112178843Sdfr 1113178843Sdfr/*----------. 1114178843Sdfr| yyparse. | 1115178843Sdfr`----------*/ 1116178843Sdfr 1117178843Sdfr#ifdef YYPARSE_PARAM 1118178843Sdfr#if (defined __STDC__ || defined __C99__FUNC__ \ 1119178843Sdfr || defined __cplusplus || defined _MSC_VER) 1120178843Sdfrint 1121178843Sdfryyparse (void *YYPARSE_PARAM) 1122178843Sdfr#else 1123178843Sdfrint 1124178843Sdfryyparse (YYPARSE_PARAM) 1125178843Sdfr void *YYPARSE_PARAM; 1126178843Sdfr#endif 1127178843Sdfr#else /* ! YYPARSE_PARAM */ 1128178843Sdfr#if (defined __STDC__ || defined __C99__FUNC__ \ 1129178843Sdfr || defined __cplusplus || defined _MSC_VER) 1130178843Sdfrint 1131178843Sdfryyparse (void) 1132178843Sdfr#else 1133178843Sdfrint 1134178843Sdfryyparse () 1135178843Sdfr 1136178843Sdfr#endif 1137178843Sdfr#endif 1138178843Sdfr{ 1139178843Sdfr 1140178843Sdfr int yystate; 1141178843Sdfr int yyn; 1142178843Sdfr int yyresult; 1143178843Sdfr /* Number of tokens to shift before error messages enabled. */ 1144178843Sdfr int yyerrstatus; 1145178843Sdfr /* Look-ahead token as an internal (translated) token number. */ 1146178843Sdfr int yytoken = 0; 1147178843Sdfr#if YYERROR_VERBOSE 1148178843Sdfr /* Buffer for error messages, and its allocated size. */ 1149178843Sdfr char yymsgbuf[128]; 1150178843Sdfr char *yymsg = yymsgbuf; 1151178843Sdfr YYSIZE_T yymsg_alloc = sizeof yymsgbuf; 1152178843Sdfr#endif 1153178843Sdfr 1154178843Sdfr /* Three stacks and their tools: 1155178843Sdfr `yyss': related to states, 1156178843Sdfr `yyvs': related to semantic values, 1157178843Sdfr `yyls': related to locations. 1158178843Sdfr 1159178843Sdfr Refer to the stacks thru separate pointers, to allow yyoverflow 1160178843Sdfr to reallocate them elsewhere. */ 1161178843Sdfr 1162178843Sdfr /* The state stack. */ 1163178843Sdfr yytype_int16 yyssa[YYINITDEPTH]; 1164178843Sdfr yytype_int16 *yyss = yyssa; 1165178843Sdfr yytype_int16 *yyssp; 1166178843Sdfr 1167178843Sdfr /* The semantic value stack. */ 1168178843Sdfr YYSTYPE yyvsa[YYINITDEPTH]; 1169178843Sdfr YYSTYPE *yyvs = yyvsa; 1170178843Sdfr YYSTYPE *yyvsp; 1171178843Sdfr 1172178843Sdfr 1173178843Sdfr 1174178843Sdfr#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) 1175178843Sdfr 1176178843Sdfr YYSIZE_T yystacksize = YYINITDEPTH; 1177178843Sdfr 1178178843Sdfr /* The variables used to return semantic value and location from the 1179178843Sdfr action routines. */ 1180178843Sdfr YYSTYPE yyval; 1181178843Sdfr 1182178843Sdfr 1183178843Sdfr /* The number of symbols on the RHS of the reduced rule. 1184178843Sdfr Keep to zero when no symbol should be popped. */ 1185178843Sdfr int yylen = 0; 1186178843Sdfr 1187178843Sdfr YYDPRINTF ((stderr, "Starting parse\n")); 1188178843Sdfr 1189178843Sdfr yystate = 0; 1190178843Sdfr yyerrstatus = 0; 1191178843Sdfr yynerrs = 0; 1192178843Sdfr yychar = YYEMPTY; /* Cause a token to be read. */ 1193178843Sdfr 1194178843Sdfr /* Initialize stack pointers. 1195178843Sdfr Waste one element of value and location stack 1196178843Sdfr so that they stay on the same level as the state stack. 1197178843Sdfr The wasted elements are never initialized. */ 1198178843Sdfr 1199178843Sdfr yyssp = yyss; 1200178843Sdfr yyvsp = yyvs; 1201178843Sdfr 1202178843Sdfr goto yysetstate; 1203178843Sdfr 1204178843Sdfr/*------------------------------------------------------------. 1205178843Sdfr| yynewstate -- Push a new state, which is found in yystate. | 1206178843Sdfr`------------------------------------------------------------*/ 1207178843Sdfr yynewstate: 1208178843Sdfr /* In all cases, when you get here, the value and location stacks 1209178843Sdfr have just been pushed. So pushing a state here evens the stacks. */ 1210178843Sdfr yyssp++; 1211178843Sdfr 1212178843Sdfr yysetstate: 1213178843Sdfr *yyssp = yystate; 1214178843Sdfr 1215178843Sdfr if (yyss + yystacksize - 1 <= yyssp) 1216178843Sdfr { 1217178843Sdfr /* Get the current used size of the three stacks, in elements. */ 1218178843Sdfr YYSIZE_T yysize = yyssp - yyss + 1; 1219178843Sdfr 1220178843Sdfr#ifdef yyoverflow 1221178843Sdfr { 1222178843Sdfr /* Give user a chance to reallocate the stack. Use copies of 1223178843Sdfr these so that the &'s don't force the real ones into 1224178843Sdfr memory. */ 1225178843Sdfr YYSTYPE *yyvs1 = yyvs; 1226178843Sdfr yytype_int16 *yyss1 = yyss; 1227178843Sdfr 1228178843Sdfr 1229178843Sdfr /* Each stack pointer address is followed by the size of the 1230178843Sdfr data in use in that stack, in bytes. This used to be a 1231178843Sdfr conditional around just the two extra args, but that might 1232178843Sdfr be undefined if yyoverflow is a macro. */ 1233178843Sdfr yyoverflow (YY_("memory exhausted"), 1234178843Sdfr &yyss1, yysize * sizeof (*yyssp), 1235178843Sdfr &yyvs1, yysize * sizeof (*yyvsp), 1236178843Sdfr 1237178843Sdfr &yystacksize); 1238178843Sdfr 1239178843Sdfr yyss = yyss1; 1240178843Sdfr yyvs = yyvs1; 1241178843Sdfr } 1242178843Sdfr#else /* no yyoverflow */ 1243178843Sdfr# ifndef YYSTACK_RELOCATE 1244178843Sdfr goto yyexhaustedlab; 1245178843Sdfr# else 1246178843Sdfr /* Extend the stack our own way. */ 1247178843Sdfr if (YYMAXDEPTH <= yystacksize) 1248178843Sdfr goto yyexhaustedlab; 1249178843Sdfr yystacksize *= 2; 1250178843Sdfr if (YYMAXDEPTH < yystacksize) 1251178843Sdfr yystacksize = YYMAXDEPTH; 1252178843Sdfr 1253178843Sdfr { 1254178843Sdfr yytype_int16 *yyss1 = yyss; 1255178843Sdfr union yyalloc *yyptr = 1256178843Sdfr (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); 1257178843Sdfr if (! yyptr) 1258178843Sdfr goto yyexhaustedlab; 1259178843Sdfr YYSTACK_RELOCATE (yyss); 1260178843Sdfr YYSTACK_RELOCATE (yyvs); 1261178843Sdfr 1262178843Sdfr# undef YYSTACK_RELOCATE 1263178843Sdfr if (yyss1 != yyssa) 1264178843Sdfr YYSTACK_FREE (yyss1); 1265178843Sdfr } 1266178843Sdfr# endif 1267178843Sdfr#endif /* no yyoverflow */ 1268178843Sdfr 1269178843Sdfr yyssp = yyss + yysize - 1; 1270178843Sdfr yyvsp = yyvs + yysize - 1; 1271178843Sdfr 1272178843Sdfr 1273178843Sdfr YYDPRINTF ((stderr, "Stack size increased to %lu\n", 1274178843Sdfr (unsigned long int) yystacksize)); 1275178843Sdfr 1276178843Sdfr if (yyss + yystacksize - 1 <= yyssp) 1277178843Sdfr YYABORT; 1278178843Sdfr } 1279178843Sdfr 1280178843Sdfr YYDPRINTF ((stderr, "Entering state %d\n", yystate)); 1281178843Sdfr 1282178843Sdfr goto yybackup; 1283178843Sdfr 1284178843Sdfr/*-----------. 1285178843Sdfr| yybackup. | 1286178843Sdfr`-----------*/ 1287178843Sdfryybackup: 1288178843Sdfr 1289178843Sdfr /* Do appropriate processing given the current state. Read a 1290178843Sdfr look-ahead token if we need one and don't already have one. */ 1291178843Sdfr 1292178843Sdfr /* First try to decide what to do without reference to look-ahead token. */ 1293178843Sdfr yyn = yypact[yystate]; 1294178843Sdfr if (yyn == YYPACT_NINF) 1295178843Sdfr goto yydefault; 1296178843Sdfr 1297178843Sdfr /* Not known => get a look-ahead token if don't already have one. */ 1298178843Sdfr 1299178843Sdfr /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */ 1300178843Sdfr if (yychar == YYEMPTY) 1301178843Sdfr { 1302178843Sdfr YYDPRINTF ((stderr, "Reading a token: ")); 1303178843Sdfr yychar = YYLEX; 1304178843Sdfr } 1305178843Sdfr 1306178843Sdfr if (yychar <= YYEOF) 1307178843Sdfr { 1308178843Sdfr yychar = yytoken = YYEOF; 1309178843Sdfr YYDPRINTF ((stderr, "Now at end of input.\n")); 1310178843Sdfr } 1311178843Sdfr else 1312178843Sdfr { 1313178843Sdfr yytoken = YYTRANSLATE (yychar); 1314178843Sdfr YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); 1315178843Sdfr } 1316178843Sdfr 1317178843Sdfr /* If the proper action on seeing token YYTOKEN is to reduce or to 1318178843Sdfr detect an error, take that action. */ 1319178843Sdfr yyn += yytoken; 1320178843Sdfr if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) 1321178843Sdfr goto yydefault; 1322178843Sdfr yyn = yytable[yyn]; 1323178843Sdfr if (yyn <= 0) 1324178843Sdfr { 1325178843Sdfr if (yyn == 0 || yyn == YYTABLE_NINF) 1326178843Sdfr goto yyerrlab; 1327178843Sdfr yyn = -yyn; 1328178843Sdfr goto yyreduce; 1329178843Sdfr } 1330178843Sdfr 1331178843Sdfr if (yyn == YYFINAL) 1332178843Sdfr YYACCEPT; 1333178843Sdfr 1334178843Sdfr /* Count tokens shifted since error; after three, turn off error 1335178843Sdfr status. */ 1336178843Sdfr if (yyerrstatus) 1337178843Sdfr yyerrstatus--; 1338178843Sdfr 1339178843Sdfr /* Shift the look-ahead token. */ 1340178843Sdfr YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); 1341178843Sdfr 1342178843Sdfr /* Discard the shifted token unless it is eof. */ 1343178843Sdfr if (yychar != YYEOF) 1344178843Sdfr yychar = YYEMPTY; 1345178843Sdfr 1346178843Sdfr yystate = yyn; 1347178843Sdfr *++yyvsp = yylval; 1348178843Sdfr 1349178843Sdfr goto yynewstate; 1350178843Sdfr 1351178843Sdfr 1352178843Sdfr/*-----------------------------------------------------------. 1353178843Sdfr| yydefault -- do the default action for the current state. | 1354178843Sdfr`-----------------------------------------------------------*/ 1355178843Sdfryydefault: 1356178843Sdfr yyn = yydefact[yystate]; 1357178843Sdfr if (yyn == 0) 1358178843Sdfr goto yyerrlab; 1359178843Sdfr goto yyreduce; 1360178843Sdfr 1361178843Sdfr 1362178843Sdfr/*-----------------------------. 1363178843Sdfr| yyreduce -- Do a reduction. | 1364178843Sdfr`-----------------------------*/ 1365178843Sdfryyreduce: 1366178843Sdfr /* yyn is the number of a rule to reduce with. */ 1367178843Sdfr yylen = yyr2[yyn]; 1368178843Sdfr 1369178843Sdfr /* If YYLEN is nonzero, implement the default value of the action: 1370178843Sdfr `$$ = $1'. 1371178843Sdfr 1372178843Sdfr Otherwise, the following line sets YYVAL to garbage. 1373178843Sdfr This behavior is undocumented and Bison 1374178843Sdfr users should not rely upon it. Assigning to YYVAL 1375178843Sdfr unconditionally makes the parser a bit smaller, and it avoids a 1376178843Sdfr GCC warning that YYVAL may be used uninitialized. */ 1377178843Sdfr yyval = yyvsp[1-yylen]; 1378178843Sdfr 1379178843Sdfr 1380178843Sdfr YY_REDUCE_PRINT (yyn); 1381178843Sdfr switch (yyn) 1382178843Sdfr { 1383178843Sdfr case 6: 1384178843Sdfr#line 73 "parse.y" 1385178843Sdfr { 1386178843Sdfr id_str = (yyvsp[(2) - (2)].string); 1387178843Sdfr } 1388178843Sdfr break; 1389178843Sdfr 1390178843Sdfr case 7: 1391178843Sdfr#line 79 "parse.y" 1392178843Sdfr { 1393178843Sdfr base_id = name2number((yyvsp[(2) - (2)].string)); 1394178843Sdfr strlcpy(name, (yyvsp[(2) - (2)].string), sizeof(name)); 1395178843Sdfr free((yyvsp[(2) - (2)].string)); 1396178843Sdfr } 1397178843Sdfr break; 1398178843Sdfr 1399178843Sdfr case 8: 1400178843Sdfr#line 85 "parse.y" 1401178843Sdfr { 1402178843Sdfr base_id = name2number((yyvsp[(2) - (3)].string)); 1403178843Sdfr strlcpy(name, (yyvsp[(3) - (3)].string), sizeof(name)); 1404178843Sdfr free((yyvsp[(2) - (3)].string)); 1405178843Sdfr free((yyvsp[(3) - (3)].string)); 1406178843Sdfr } 1407178843Sdfr break; 1408178843Sdfr 1409178843Sdfr case 11: 1410178843Sdfr#line 98 "parse.y" 1411178843Sdfr { 1412178843Sdfr number = (yyvsp[(2) - (2)].number); 1413178843Sdfr } 1414178843Sdfr break; 1415178843Sdfr 1416178843Sdfr case 12: 1417178843Sdfr#line 102 "parse.y" 1418178843Sdfr { 1419178843Sdfr free(prefix); 1420178843Sdfr asprintf (&prefix, "%s_", (yyvsp[(2) - (2)].string)); 1421178843Sdfr if (prefix == NULL) 1422178843Sdfr errx(1, "malloc"); 1423178843Sdfr free((yyvsp[(2) - (2)].string)); 1424178843Sdfr } 1425178843Sdfr break; 1426178843Sdfr 1427178843Sdfr case 13: 1428178843Sdfr#line 110 "parse.y" 1429178843Sdfr { 1430178843Sdfr prefix = realloc(prefix, 1); 1431178843Sdfr if (prefix == NULL) 1432178843Sdfr errx(1, "malloc"); 1433178843Sdfr *prefix = '\0'; 1434178843Sdfr } 1435178843Sdfr break; 1436178843Sdfr 1437178843Sdfr case 14: 1438178843Sdfr#line 117 "parse.y" 1439178843Sdfr { 1440178843Sdfr struct error_code *ec = malloc(sizeof(*ec)); 1441178843Sdfr 1442178843Sdfr if (ec == NULL) 1443178843Sdfr errx(1, "malloc"); 1444178843Sdfr 1445178843Sdfr ec->next = NULL; 1446178843Sdfr ec->number = number; 1447178843Sdfr if(prefix && *prefix != '\0') { 1448178843Sdfr asprintf (&ec->name, "%s%s", prefix, (yyvsp[(2) - (4)].string)); 1449178843Sdfr if (ec->name == NULL) 1450178843Sdfr errx(1, "malloc"); 1451178843Sdfr free((yyvsp[(2) - (4)].string)); 1452178843Sdfr } else 1453178843Sdfr ec->name = (yyvsp[(2) - (4)].string); 1454178843Sdfr ec->string = (yyvsp[(4) - (4)].string); 1455178843Sdfr APPEND(codes, ec); 1456178843Sdfr number++; 1457178843Sdfr } 1458178843Sdfr break; 1459178843Sdfr 1460178843Sdfr case 15: 1461178843Sdfr#line 137 "parse.y" 1462178843Sdfr { 1463178843Sdfr YYACCEPT; 1464178843Sdfr } 1465178843Sdfr break; 1466178843Sdfr 1467178843Sdfr 1468178843Sdfr/* Line 1267 of yacc.c. */ 1469178843Sdfr#line 1470 "parse.c" 1470178843Sdfr default: break; 1471178843Sdfr } 1472178843Sdfr YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); 1473178843Sdfr 1474178843Sdfr YYPOPSTACK (yylen); 1475178843Sdfr yylen = 0; 1476178843Sdfr YY_STACK_PRINT (yyss, yyssp); 1477178843Sdfr 1478178843Sdfr *++yyvsp = yyval; 1479178843Sdfr 1480178843Sdfr 1481178843Sdfr /* Now `shift' the result of the reduction. Determine what state 1482178843Sdfr that goes to, based on the state we popped back to and the rule 1483178843Sdfr number reduced by. */ 1484178843Sdfr 1485178843Sdfr yyn = yyr1[yyn]; 1486178843Sdfr 1487178843Sdfr yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; 1488178843Sdfr if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) 1489178843Sdfr yystate = yytable[yystate]; 1490178843Sdfr else 1491178843Sdfr yystate = yydefgoto[yyn - YYNTOKENS]; 1492178843Sdfr 1493178843Sdfr goto yynewstate; 1494178843Sdfr 1495178843Sdfr 1496178843Sdfr/*------------------------------------. 1497178843Sdfr| yyerrlab -- here on detecting error | 1498178843Sdfr`------------------------------------*/ 1499178843Sdfryyerrlab: 1500178843Sdfr /* If not already recovering from an error, report this error. */ 1501178843Sdfr if (!yyerrstatus) 1502178843Sdfr { 1503178843Sdfr ++yynerrs; 1504178843Sdfr#if ! YYERROR_VERBOSE 1505178843Sdfr yyerror (YY_("syntax error")); 1506178843Sdfr#else 1507178843Sdfr { 1508178843Sdfr YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); 1509178843Sdfr if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) 1510178843Sdfr { 1511178843Sdfr YYSIZE_T yyalloc = 2 * yysize; 1512178843Sdfr if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM)) 1513178843Sdfr yyalloc = YYSTACK_ALLOC_MAXIMUM; 1514178843Sdfr if (yymsg != yymsgbuf) 1515178843Sdfr YYSTACK_FREE (yymsg); 1516178843Sdfr yymsg = (char *) YYSTACK_ALLOC (yyalloc); 1517178843Sdfr if (yymsg) 1518178843Sdfr yymsg_alloc = yyalloc; 1519178843Sdfr else 1520178843Sdfr { 1521178843Sdfr yymsg = yymsgbuf; 1522178843Sdfr yymsg_alloc = sizeof yymsgbuf; 1523178843Sdfr } 1524178843Sdfr } 1525178843Sdfr 1526178843Sdfr if (0 < yysize && yysize <= yymsg_alloc) 1527178843Sdfr { 1528178843Sdfr (void) yysyntax_error (yymsg, yystate, yychar); 1529178843Sdfr yyerror (yymsg); 1530178843Sdfr } 1531178843Sdfr else 1532178843Sdfr { 1533178843Sdfr yyerror (YY_("syntax error")); 1534178843Sdfr if (yysize != 0) 1535178843Sdfr goto yyexhaustedlab; 1536178843Sdfr } 1537178843Sdfr } 1538178843Sdfr#endif 1539178843Sdfr } 1540178843Sdfr 1541178843Sdfr 1542178843Sdfr 1543178843Sdfr if (yyerrstatus == 3) 1544178843Sdfr { 1545178843Sdfr /* If just tried and failed to reuse look-ahead token after an 1546178843Sdfr error, discard it. */ 1547178843Sdfr 1548178843Sdfr if (yychar <= YYEOF) 1549178843Sdfr { 1550178843Sdfr /* Return failure if at end of input. */ 1551178843Sdfr if (yychar == YYEOF) 1552178843Sdfr YYABORT; 1553178843Sdfr } 1554178843Sdfr else 1555178843Sdfr { 1556178843Sdfr yydestruct ("Error: discarding", 1557178843Sdfr yytoken, &yylval); 1558178843Sdfr yychar = YYEMPTY; 1559178843Sdfr } 1560178843Sdfr } 1561178843Sdfr 1562178843Sdfr /* Else will try to reuse look-ahead token after shifting the error 1563178843Sdfr token. */ 1564178843Sdfr goto yyerrlab1; 1565178843Sdfr 1566178843Sdfr 1567178843Sdfr/*---------------------------------------------------. 1568178843Sdfr| yyerrorlab -- error raised explicitly by YYERROR. | 1569178843Sdfr`---------------------------------------------------*/ 1570178843Sdfryyerrorlab: 1571178843Sdfr 1572178843Sdfr /* Pacify compilers like GCC when the user code never invokes 1573178843Sdfr YYERROR and the label yyerrorlab therefore never appears in user 1574178843Sdfr code. */ 1575178843Sdfr if (/*CONSTCOND*/ 0) 1576178843Sdfr goto yyerrorlab; 1577178843Sdfr 1578178843Sdfr /* Do not reclaim the symbols of the rule which action triggered 1579178843Sdfr this YYERROR. */ 1580178843Sdfr YYPOPSTACK (yylen); 1581178843Sdfr yylen = 0; 1582178843Sdfr YY_STACK_PRINT (yyss, yyssp); 1583178843Sdfr yystate = *yyssp; 1584178843Sdfr goto yyerrlab1; 1585178843Sdfr 1586178843Sdfr 1587178843Sdfr/*-------------------------------------------------------------. 1588178843Sdfr| yyerrlab1 -- common code for both syntax error and YYERROR. | 1589178843Sdfr`-------------------------------------------------------------*/ 1590178843Sdfryyerrlab1: 1591178843Sdfr yyerrstatus = 3; /* Each real token shifted decrements this. */ 1592178843Sdfr 1593178843Sdfr for (;;) 1594178843Sdfr { 1595178843Sdfr yyn = yypact[yystate]; 1596178843Sdfr if (yyn != YYPACT_NINF) 1597178843Sdfr { 1598178843Sdfr yyn += YYTERROR; 1599178843Sdfr if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) 1600178843Sdfr { 1601178843Sdfr yyn = yytable[yyn]; 1602178843Sdfr if (0 < yyn) 1603178843Sdfr break; 1604178843Sdfr } 1605178843Sdfr } 1606178843Sdfr 1607178843Sdfr /* Pop the current state because it cannot handle the error token. */ 1608178843Sdfr if (yyssp == yyss) 1609178843Sdfr YYABORT; 1610178843Sdfr 1611178843Sdfr 1612178843Sdfr yydestruct ("Error: popping", 1613178843Sdfr yystos[yystate], yyvsp); 1614178843Sdfr YYPOPSTACK (1); 1615178843Sdfr yystate = *yyssp; 1616178843Sdfr YY_STACK_PRINT (yyss, yyssp); 1617178843Sdfr } 1618178843Sdfr 1619178843Sdfr if (yyn == YYFINAL) 1620178843Sdfr YYACCEPT; 1621178843Sdfr 1622178843Sdfr *++yyvsp = yylval; 1623178843Sdfr 1624178843Sdfr 1625178843Sdfr /* Shift the error token. */ 1626178843Sdfr YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); 1627178843Sdfr 1628178843Sdfr yystate = yyn; 1629178843Sdfr goto yynewstate; 1630178843Sdfr 1631178843Sdfr 1632178843Sdfr/*-------------------------------------. 1633178843Sdfr| yyacceptlab -- YYACCEPT comes here. | 1634178843Sdfr`-------------------------------------*/ 1635178843Sdfryyacceptlab: 1636178843Sdfr yyresult = 0; 1637178843Sdfr goto yyreturn; 1638178843Sdfr 1639178843Sdfr/*-----------------------------------. 1640178843Sdfr| yyabortlab -- YYABORT comes here. | 1641178843Sdfr`-----------------------------------*/ 1642178843Sdfryyabortlab: 1643178843Sdfr yyresult = 1; 1644178843Sdfr goto yyreturn; 1645178843Sdfr 1646178843Sdfr#ifndef yyoverflow 1647178843Sdfr/*-------------------------------------------------. 1648178843Sdfr| yyexhaustedlab -- memory exhaustion comes here. | 1649178843Sdfr`-------------------------------------------------*/ 1650178843Sdfryyexhaustedlab: 1651178843Sdfr yyerror (YY_("memory exhausted")); 1652178843Sdfr yyresult = 2; 1653178843Sdfr /* Fall through. */ 1654178843Sdfr#endif 1655178843Sdfr 1656178843Sdfryyreturn: 1657178843Sdfr if (yychar != YYEOF && yychar != YYEMPTY) 1658178843Sdfr yydestruct ("Cleanup: discarding lookahead", 1659178843Sdfr yytoken, &yylval); 1660178843Sdfr /* Do not reclaim the symbols of the rule which action triggered 1661178843Sdfr this YYABORT or YYACCEPT. */ 1662178843Sdfr YYPOPSTACK (yylen); 1663178843Sdfr YY_STACK_PRINT (yyss, yyssp); 1664178843Sdfr while (yyssp != yyss) 1665178843Sdfr { 1666178843Sdfr yydestruct ("Cleanup: popping", 1667178843Sdfr yystos[*yyssp], yyvsp); 1668178843Sdfr YYPOPSTACK (1); 1669178843Sdfr } 1670178843Sdfr#ifndef yyoverflow 1671178843Sdfr if (yyss != yyssa) 1672178843Sdfr YYSTACK_FREE (yyss); 1673178843Sdfr#endif 1674178843Sdfr#if YYERROR_VERBOSE 1675178843Sdfr if (yymsg != yymsgbuf) 1676178843Sdfr YYSTACK_FREE (yymsg); 1677178843Sdfr#endif 1678178843Sdfr /* Make sure YYID is used. */ 1679178843Sdfr return YYID (yyresult); 1680178843Sdfr} 1681178843Sdfr 1682178843Sdfr 1683178843Sdfr#line 142 "parse.y" 1684178843Sdfr 1685178843Sdfr 1686178843Sdfrstatic long 1687178843Sdfrname2number(const char *str) 1688178843Sdfr{ 1689178843Sdfr const char *p; 1690178843Sdfr long num = 0; 1691178843Sdfr const char *x = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" 1692178843Sdfr "abcdefghijklmnopqrstuvwxyz0123456789_"; 1693178843Sdfr if(strlen(str) > 4) { 1694178843Sdfr yyerror("table name too long"); 1695178843Sdfr return 0; 1696178843Sdfr } 1697178843Sdfr for(p = str; *p; p++){ 1698178843Sdfr char *q = strchr(x, *p); 1699178843Sdfr if(q == NULL) { 1700178843Sdfr yyerror("invalid character in table name"); 1701178843Sdfr return 0; 1702178843Sdfr } 1703178843Sdfr num = (num << 6) + (q - x) + 1; 1704178843Sdfr } 1705178843Sdfr num <<= 8; 1706178843Sdfr if(num > 0x7fffffff) 1707178843Sdfr num = -(0xffffffff - num + 1); 1708178843Sdfr return num; 1709178843Sdfr} 1710178843Sdfr 1711178843Sdfrvoid 1712178843Sdfryyerror (char *s) 1713178843Sdfr{ 1714178843Sdfr error_message ("%s\n", s); 1715178843Sdfr} 1716178843Sdfr 1717