Path: blob/main/crypto/heimdal/lib/com_err/parse.c
34878 views
/* A Bison parser, made by GNU Bison 2.3. */12/* Skeleton implementation for Bison's Yacc-like parsers in C34Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 20065Free Software Foundation, Inc.67This program is free software; you can redistribute it and/or modify8it under the terms of the GNU General Public License as published by9the Free Software Foundation; either version 2, or (at your option)10any later version.1112This program is distributed in the hope that it will be useful,13but WITHOUT ANY WARRANTY; without even the implied warranty of14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the15GNU General Public License for more details.1617You should have received a copy of the GNU General Public License18along with this program; if not, write to the Free Software19Foundation, Inc., 51 Franklin Street, Fifth Floor,20Boston, MA 02110-1301, USA. */2122/* As a special exception, you may create a larger work that contains23part or all of the Bison parser skeleton and distribute that work24under terms of your choice, so long as that work isn't itself a25parser generator using the skeleton or a modified version thereof26as a parser skeleton. Alternatively, if you modify or redistribute27the parser skeleton itself, you may (at your option) remove this28special exception, which will cause the skeleton and the resulting29Bison output files to be licensed under the GNU General Public30License without this special exception.3132This special exception was added by the Free Software Foundation in33version 2.2 of Bison. */3435/* C LALR(1) parser skeleton written by Richard Stallman, by36simplifying the original so-called "semantic" parser. */3738/* All symbols defined below should begin with yy or YY, to avoid39infringing on user name space. This should be done even for local40variables, as they might otherwise be expanded by user macros.41There are some unavoidable exceptions within include files to42define necessary library symbols; they are noted "INFRINGES ON43USER NAME SPACE" below. */4445/* Identify Bison output. */46#define YYBISON 14748/* Bison version. */49#define YYBISON_VERSION "2.3"5051/* Skeleton name. */52#define YYSKELETON_NAME "yacc.c"5354/* Pure parsers. */55#define YYPURE 05657/* Using locations. */58#define YYLSP_NEEDED 059606162/* Tokens. */63#ifndef YYTOKENTYPE64# define YYTOKENTYPE65/* Put the tokens into the symbol table, so that GDB and other debuggers66know about them. */67enum yytokentype {68ET = 258,69INDEX = 259,70PREFIX = 260,71EC = 261,72ID = 262,73END = 263,74STRING = 264,75NUMBER = 26576};77#endif78/* Tokens. */79#define ET 25880#define INDEX 25981#define PREFIX 26082#define EC 26183#define ID 26284#define END 26385#define STRING 26486#define NUMBER 2658788899091/* Copy the first part of user declarations. */92#line 1 "parse.y"9394/*95* Copyright (c) 1998 - 2000 Kungliga Tekniska Högskolan96* (Royal Institute of Technology, Stockholm, Sweden).97* All rights reserved.98*99* Redistribution and use in source and binary forms, with or without100* modification, are permitted provided that the following conditions101* are met:102*103* 1. Redistributions of source code must retain the above copyright104* notice, this list of conditions and the following disclaimer.105*106* 2. Redistributions in binary form must reproduce the above copyright107* notice, this list of conditions and the following disclaimer in the108* documentation and/or other materials provided with the distribution.109*110* 3. Neither the name of the Institute nor the names of its contributors111* may be used to endorse or promote products derived from this software112* without specific prior written permission.113*114* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND115* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE116* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE117* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE118* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL119* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS120* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)121* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT122* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY123* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF124* SUCH DAMAGE.125*/126127#include "compile_et.h"128#include "lex.h"129130void yyerror (char *s);131static long name2number(const char *str);132133extern char *yytext;134135/* This is for bison */136137#if !defined(alloca) && !defined(HAVE_ALLOCA)138#define alloca(x) malloc(x)139#endif140141#define YYMALLOC malloc142#define YYFREE free143144145146/* Enabling traces. */147#ifndef YYDEBUG148# define YYDEBUG 0149#endif150151/* Enabling verbose error messages. */152#ifdef YYERROR_VERBOSE153# undef YYERROR_VERBOSE154# define YYERROR_VERBOSE 1155#else156# define YYERROR_VERBOSE 0157#endif158159/* Enabling the token table. */160#ifndef YYTOKEN_TABLE161# define YYTOKEN_TABLE 0162#endif163164#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED165typedef union YYSTYPE166#line 54 "parse.y"167{168char *string;169int number;170}171/* Line 193 of yacc.c. */172#line 174 "parse.c"173YYSTYPE;174# define yystype YYSTYPE /* obsolescent; will be withdrawn */175# define YYSTYPE_IS_DECLARED 1176# define YYSTYPE_IS_TRIVIAL 1177#endif178179180181/* Copy the second part of user declarations. */182183184/* Line 216 of yacc.c. */185#line 187 "parse.c"186187#ifdef short188# undef short189#endif190191#ifdef YYTYPE_UINT8192typedef YYTYPE_UINT8 yytype_uint8;193#else194typedef unsigned char yytype_uint8;195#endif196197#ifdef YYTYPE_INT8198typedef YYTYPE_INT8 yytype_int8;199#elif (defined __STDC__ || defined __C99__FUNC__ \200|| defined __cplusplus || defined _MSC_VER)201typedef signed char yytype_int8;202#else203typedef short int yytype_int8;204#endif205206#ifdef YYTYPE_UINT16207typedef YYTYPE_UINT16 yytype_uint16;208#else209typedef unsigned short int yytype_uint16;210#endif211212#ifdef YYTYPE_INT16213typedef YYTYPE_INT16 yytype_int16;214#else215typedef short int yytype_int16;216#endif217218#ifndef YYSIZE_T219# ifdef __SIZE_TYPE__220# define YYSIZE_T __SIZE_TYPE__221# elif defined size_t222# define YYSIZE_T size_t223# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \224|| defined __cplusplus || defined _MSC_VER)225# include <stddef.h> /* INFRINGES ON USER NAME SPACE */226# define YYSIZE_T size_t227# else228# define YYSIZE_T unsigned int229# endif230#endif231232#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)233234#ifndef YY_235# if defined YYENABLE_NLS && YYENABLE_NLS236# if ENABLE_NLS237# include <libintl.h> /* INFRINGES ON USER NAME SPACE */238# define YY_(msgid) dgettext ("bison-runtime", msgid)239# endif240# endif241# ifndef YY_242# define YY_(msgid) msgid243# endif244#endif245246/* Suppress unused-variable warnings by "using" E. */247#if ! defined lint || defined __GNUC__248# define YYUSE(e) ((void) (e))249#else250# define YYUSE(e) /* empty */251#endif252253/* Identity function, used to suppress warnings about constant conditions. */254#ifndef lint255# define YYID(n) (n)256#else257#if (defined __STDC__ || defined __C99__FUNC__ \258|| defined __cplusplus || defined _MSC_VER)259static int260YYID (int i)261#else262static int263YYID (i)264int i;265#endif266{267return i;268}269#endif270271#if ! defined yyoverflow || YYERROR_VERBOSE272273/* The parser invokes alloca or malloc; define the necessary symbols. */274275# ifdef YYSTACK_USE_ALLOCA276# if YYSTACK_USE_ALLOCA277# ifdef __GNUC__278# define YYSTACK_ALLOC __builtin_alloca279# elif defined __BUILTIN_VA_ARG_INCR280# include <alloca.h> /* INFRINGES ON USER NAME SPACE */281# elif defined _AIX282# define YYSTACK_ALLOC __alloca283# elif defined _MSC_VER284# include <malloc.h> /* INFRINGES ON USER NAME SPACE */285# define alloca _alloca286# else287# define YYSTACK_ALLOC alloca288# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \289|| defined __cplusplus || defined _MSC_VER)290# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */291# ifndef _STDLIB_H292# define _STDLIB_H 1293# endif294# endif295# endif296# endif297# endif298299# ifdef YYSTACK_ALLOC300/* Pacify GCC's `empty if-body' warning. */301# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))302# ifndef YYSTACK_ALLOC_MAXIMUM303/* The OS might guarantee only one guard page at the bottom of the stack,304and a page size can be as small as 4096 bytes. So we cannot safely305invoke alloca (N) if N exceeds 4096. Use a slightly smaller number306to allow for a few compiler-allocated temporary stack slots. */307# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */308# endif309# else310# define YYSTACK_ALLOC YYMALLOC311# define YYSTACK_FREE YYFREE312# ifndef YYSTACK_ALLOC_MAXIMUM313# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM314# endif315# if (defined __cplusplus && ! defined _STDLIB_H \316&& ! ((defined YYMALLOC || defined malloc) \317&& (defined YYFREE || defined free)))318# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */319# ifndef _STDLIB_H320# define _STDLIB_H 1321# endif322# endif323# ifndef YYMALLOC324# define YYMALLOC malloc325# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \326|| defined __cplusplus || defined _MSC_VER)327void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */328# endif329# endif330# ifndef YYFREE331# define YYFREE free332# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \333|| defined __cplusplus || defined _MSC_VER)334void free (void *); /* INFRINGES ON USER NAME SPACE */335# endif336# endif337# endif338#endif /* ! defined yyoverflow || YYERROR_VERBOSE */339340341#if (! defined yyoverflow \342&& (! defined __cplusplus \343|| (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))344345/* A type that is properly aligned for any stack member. */346union yyalloc347{348yytype_int16 yyss;349YYSTYPE yyvs;350};351352/* The size of the maximum gap between one aligned stack and the next. */353# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)354355/* The size of an array large to enough to hold all stacks, each with356N elements. */357# define YYSTACK_BYTES(N) \358((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \359+ YYSTACK_GAP_MAXIMUM)360361/* Copy COUNT objects from FROM to TO. The source and destination do362not overlap. */363# ifndef YYCOPY364# if defined __GNUC__ && 1 < __GNUC__365# define YYCOPY(To, From, Count) \366__builtin_memcpy (To, From, (Count) * sizeof (*(From)))367# else368# define YYCOPY(To, From, Count) \369do \370{ \371YYSIZE_T yyi; \372for (yyi = 0; yyi < (Count); yyi++) \373(To)[yyi] = (From)[yyi]; \374} \375while (YYID (0))376# endif377# endif378379/* Relocate STACK from its old location to the new one. The380local variables YYSIZE and YYSTACKSIZE give the old and new number of381elements in the stack, and YYPTR gives the new location of the382stack. Advance YYPTR to a properly aligned location for the next383stack. */384# define YYSTACK_RELOCATE(Stack) \385do \386{ \387YYSIZE_T yynewbytes; \388YYCOPY (&yyptr->Stack, Stack, yysize); \389Stack = &yyptr->Stack; \390yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \391yyptr += yynewbytes / sizeof (*yyptr); \392} \393while (YYID (0))394395#endif396397/* YYFINAL -- State number of the termination state. */398#define YYFINAL 9399/* YYLAST -- Last index in YYTABLE. */400#define YYLAST 23401402/* YYNTOKENS -- Number of terminals. */403#define YYNTOKENS 12404/* YYNNTS -- Number of nonterminals. */405#define YYNNTS 7406/* YYNRULES -- Number of rules. */407#define YYNRULES 15408/* YYNRULES -- Number of states. */409#define YYNSTATES 24410411/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */412#define YYUNDEFTOK 2413#define YYMAXUTOK 265414415#define YYTRANSLATE(YYX) \416((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)417418/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */419static const yytype_uint8 yytranslate[] =420{4210, 2, 2, 2, 2, 2, 2, 2, 2, 2,4222, 2, 2, 2, 2, 2, 2, 2, 2, 2,4232, 2, 2, 2, 2, 2, 2, 2, 2, 2,4242, 2, 2, 2, 2, 2, 2, 2, 2, 2,4252, 2, 2, 2, 11, 2, 2, 2, 2, 2,4262, 2, 2, 2, 2, 2, 2, 2, 2, 2,4272, 2, 2, 2, 2, 2, 2, 2, 2, 2,4282, 2, 2, 2, 2, 2, 2, 2, 2, 2,4292, 2, 2, 2, 2, 2, 2, 2, 2, 2,4302, 2, 2, 2, 2, 2, 2, 2, 2, 2,4312, 2, 2, 2, 2, 2, 2, 2, 2, 2,4322, 2, 2, 2, 2, 2, 2, 2, 2, 2,4332, 2, 2, 2, 2, 2, 2, 2, 2, 2,4342, 2, 2, 2, 2, 2, 2, 2, 2, 2,4352, 2, 2, 2, 2, 2, 2, 2, 2, 2,4362, 2, 2, 2, 2, 2, 2, 2, 2, 2,4372, 2, 2, 2, 2, 2, 2, 2, 2, 2,4382, 2, 2, 2, 2, 2, 2, 2, 2, 2,4392, 2, 2, 2, 2, 2, 2, 2, 2, 2,4402, 2, 2, 2, 2, 2, 2, 2, 2, 2,4412, 2, 2, 2, 2, 2, 2, 2, 2, 2,4422, 2, 2, 2, 2, 2, 2, 2, 2, 2,4432, 2, 2, 2, 2, 2, 2, 2, 2, 2,4442, 2, 2, 2, 2, 2, 2, 2, 2, 2,4452, 2, 2, 2, 2, 2, 2, 2, 2, 2,4462, 2, 2, 2, 2, 2, 1, 2, 3, 4,4475, 6, 7, 8, 9, 10448};449450#if YYDEBUG451/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in452YYRHS. */453static const yytype_uint8 yyprhs[] =454{4550, 0, 3, 4, 7, 10, 12, 15, 18, 22,45624, 27, 30, 33, 35, 40457};458459/* YYRHS -- A `-1'-separated list of the rules' RHS. */460static const yytype_int8 yyrhs[] =461{46213, 0, -1, -1, 14, 17, -1, 15, 16, -1,46316, -1, 7, 9, -1, 3, 9, -1, 3, 9,4649, -1, 18, -1, 17, 18, -1, 4, 10, -1,4655, 9, -1, 5, -1, 6, 9, 11, 9, -1,4668, -1467};468469/* YYRLINE[YYN] -- source line where rule number YYN was defined. */470static const yytype_uint8 yyrline[] =471{4720, 65, 65, 66, 69, 70, 73, 79, 85, 94,47395, 98, 102, 110, 117, 137474};475#endif476477#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE478/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.479First, the terminals, then, starting at YYNTOKENS, nonterminals. */480static const char *const yytname[] =481{482"$end", "error", "$undefined", "ET", "INDEX", "PREFIX", "EC", "ID",483"END", "STRING", "NUMBER", "','", "$accept", "file", "header", "id",484"et", "statements", "statement", 0485};486#endif487488# ifdef YYPRINT489/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to490token YYLEX-NUM. */491static const yytype_uint16 yytoknum[] =492{4930, 256, 257, 258, 259, 260, 261, 262, 263, 264,494265, 44495};496# endif497498/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */499static const yytype_uint8 yyr1[] =500{5010, 12, 13, 13, 14, 14, 15, 16, 16, 17,50217, 18, 18, 18, 18, 18503};504505/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */506static const yytype_uint8 yyr2[] =507{5080, 2, 0, 2, 2, 1, 2, 2, 3, 1,5092, 2, 2, 1, 4, 1510};511512/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state513STATE-NUM when YYTABLE doesn't specify something else to do. Zero514means the default is an error. */515static const yytype_uint8 yydefact[] =516{5172, 0, 0, 0, 0, 0, 5, 7, 6, 1,5180, 13, 0, 15, 3, 9, 4, 8, 11, 12,5190, 10, 0, 14520};521522/* YYDEFGOTO[NTERM-NUM]. */523static const yytype_int8 yydefgoto[] =524{525-1, 3, 4, 5, 6, 14, 15526};527528/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing529STATE-NUM. */530#define YYPACT_NINF -5531static const yytype_int8 yypact[] =532{5330, -3, -1, 5, -4, 6, -5, 1, -5, -5,5342, 4, 7, -5, -4, -5, -5, -5, -5, -5,5353, -5, 8, -5536};537538/* YYPGOTO[NTERM-NUM]. */539static const yytype_int8 yypgoto[] =540{541-5, -5, -5, -5, 10, -5, 9542};543544/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If545positive, shift that token. If negative, reduce the rule which546number is the opposite. If zero, do what YYDEFACT says.547If YYTABLE_NINF, syntax error. */548#define YYTABLE_NINF -1549static const yytype_uint8 yytable[] =550{55110, 11, 12, 1, 13, 9, 7, 2, 8, 1,55217, 0, 18, 19, 22, 16, 20, 23, 0, 0,5530, 0, 0, 21554};555556static const yytype_int8 yycheck[] =557{5584, 5, 6, 3, 8, 0, 9, 7, 9, 3,5599, -1, 10, 9, 11, 5, 9, 9, -1, -1,560-1, -1, -1, 14561};562563/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing564symbol of state STATE-NUM. */565static const yytype_uint8 yystos[] =566{5670, 3, 7, 13, 14, 15, 16, 9, 9, 0,5684, 5, 6, 8, 17, 18, 16, 9, 10, 9,5699, 18, 11, 9570};571572#define yyerrok (yyerrstatus = 0)573#define yyclearin (yychar = YYEMPTY)574#define YYEMPTY (-2)575#define YYEOF 0576577#define YYACCEPT goto yyacceptlab578#define YYABORT goto yyabortlab579#define YYERROR goto yyerrorlab580581582/* Like YYERROR except do call yyerror. This remains here temporarily583to ease the transition to the new meaning of YYERROR, for GCC.584Once GCC version 2 has supplanted version 1, this can go. */585586#define YYFAIL goto yyerrlab587588#define YYRECOVERING() (!!yyerrstatus)589590#define YYBACKUP(Token, Value) \591do \592if (yychar == YYEMPTY && yylen == 1) \593{ \594yychar = (Token); \595yylval = (Value); \596yytoken = YYTRANSLATE (yychar); \597YYPOPSTACK (1); \598goto yybackup; \599} \600else \601{ \602yyerror (YY_("syntax error: cannot back up")); \603YYERROR; \604} \605while (YYID (0))606607608#define YYTERROR 1609#define YYERRCODE 256610611612/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].613If N is 0, then set CURRENT to the empty location which ends614the previous symbol: RHS[0] (always defined). */615616#define YYRHSLOC(Rhs, K) ((Rhs)[K])617#ifndef YYLLOC_DEFAULT618# define YYLLOC_DEFAULT(Current, Rhs, N) \619do \620if (YYID (N)) \621{ \622(Current).first_line = YYRHSLOC (Rhs, 1).first_line; \623(Current).first_column = YYRHSLOC (Rhs, 1).first_column; \624(Current).last_line = YYRHSLOC (Rhs, N).last_line; \625(Current).last_column = YYRHSLOC (Rhs, N).last_column; \626} \627else \628{ \629(Current).first_line = (Current).last_line = \630YYRHSLOC (Rhs, 0).last_line; \631(Current).first_column = (Current).last_column = \632YYRHSLOC (Rhs, 0).last_column; \633} \634while (YYID (0))635#endif636637638/* YY_LOCATION_PRINT -- Print the location on the stream.639This macro was not mandated originally: define only if we know640we won't break user code: when these are the locations we know. */641642#ifndef YY_LOCATION_PRINT643# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL644# define YY_LOCATION_PRINT(File, Loc) \645fprintf (File, "%d.%d-%d.%d", \646(Loc).first_line, (Loc).first_column, \647(Loc).last_line, (Loc).last_column)648# else649# define YY_LOCATION_PRINT(File, Loc) ((void) 0)650# endif651#endif652653654/* YYLEX -- calling `yylex' with the right arguments. */655656#ifdef YYLEX_PARAM657# define YYLEX yylex (YYLEX_PARAM)658#else659# define YYLEX yylex ()660#endif661662/* Enable debugging if requested. */663#if YYDEBUG664665# ifndef YYFPRINTF666# include <stdio.h> /* INFRINGES ON USER NAME SPACE */667# define YYFPRINTF fprintf668# endif669670# define YYDPRINTF(Args) \671do { \672if (yydebug) \673YYFPRINTF Args; \674} while (YYID (0))675676# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \677do { \678if (yydebug) \679{ \680YYFPRINTF (stderr, "%s ", Title); \681yy_symbol_print (stderr, \682Type, Value); \683YYFPRINTF (stderr, "\n"); \684} \685} while (YYID (0))686687688/*--------------------------------.689| Print this symbol on YYOUTPUT. |690`--------------------------------*/691692/*ARGSUSED*/693#if (defined __STDC__ || defined __C99__FUNC__ \694|| defined __cplusplus || defined _MSC_VER)695static void696yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)697#else698static void699yy_symbol_value_print (yyoutput, yytype, yyvaluep)700FILE *yyoutput;701int yytype;702YYSTYPE const * const yyvaluep;703#endif704{705if (!yyvaluep)706return;707# ifdef YYPRINT708if (yytype < YYNTOKENS)709YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);710# else711YYUSE (yyoutput);712# endif713switch (yytype)714{715default:716break;717}718}719720721/*--------------------------------.722| Print this symbol on YYOUTPUT. |723`--------------------------------*/724725#if (defined __STDC__ || defined __C99__FUNC__ \726|| defined __cplusplus || defined _MSC_VER)727static void728yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)729#else730static void731yy_symbol_print (yyoutput, yytype, yyvaluep)732FILE *yyoutput;733int yytype;734YYSTYPE const * const yyvaluep;735#endif736{737if (yytype < YYNTOKENS)738YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);739else740YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);741742yy_symbol_value_print (yyoutput, yytype, yyvaluep);743YYFPRINTF (yyoutput, ")");744}745746/*------------------------------------------------------------------.747| yy_stack_print -- Print the state stack from its BOTTOM up to its |748| TOP (included). |749`------------------------------------------------------------------*/750751#if (defined __STDC__ || defined __C99__FUNC__ \752|| defined __cplusplus || defined _MSC_VER)753static void754yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)755#else756static void757yy_stack_print (bottom, top)758yytype_int16 *bottom;759yytype_int16 *top;760#endif761{762YYFPRINTF (stderr, "Stack now");763for (; bottom <= top; ++bottom)764YYFPRINTF (stderr, " %d", *bottom);765YYFPRINTF (stderr, "\n");766}767768# define YY_STACK_PRINT(Bottom, Top) \769do { \770if (yydebug) \771yy_stack_print ((Bottom), (Top)); \772} while (YYID (0))773774775/*------------------------------------------------.776| Report that the YYRULE is going to be reduced. |777`------------------------------------------------*/778779#if (defined __STDC__ || defined __C99__FUNC__ \780|| defined __cplusplus || defined _MSC_VER)781static void782yy_reduce_print (YYSTYPE *yyvsp, int yyrule)783#else784static void785yy_reduce_print (yyvsp, yyrule)786YYSTYPE *yyvsp;787int yyrule;788#endif789{790int yynrhs = yyr2[yyrule];791int yyi;792unsigned long int yylno = yyrline[yyrule];793YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",794yyrule - 1, yylno);795/* The symbols being reduced. */796for (yyi = 0; yyi < yynrhs; yyi++)797{798fprintf (stderr, " $%d = ", yyi + 1);799yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],800&(yyvsp[(yyi + 1) - (yynrhs)])801);802fprintf (stderr, "\n");803}804}805806# define YY_REDUCE_PRINT(Rule) \807do { \808if (yydebug) \809yy_reduce_print (yyvsp, Rule); \810} while (YYID (0))811812/* Nonzero means print parse trace. It is left uninitialized so that813multiple parsers can coexist. */814int yydebug;815#else /* !YYDEBUG */816# define YYDPRINTF(Args)817# define YY_SYMBOL_PRINT(Title, Type, Value, Location)818# define YY_STACK_PRINT(Bottom, Top)819# define YY_REDUCE_PRINT(Rule)820#endif /* !YYDEBUG */821822823/* YYINITDEPTH -- initial size of the parser's stacks. */824#ifndef YYINITDEPTH825# define YYINITDEPTH 200826#endif827828/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only829if the built-in stack extension method is used).830831Do not make this value too large; the results are undefined if832YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)833evaluated with infinite-precision integer arithmetic. */834835#ifndef YYMAXDEPTH836# define YYMAXDEPTH 10000837#endif838839840841#if YYERROR_VERBOSE842843# ifndef yystrlen844# if defined __GLIBC__ && defined _STRING_H845# define yystrlen strlen846# else847/* Return the length of YYSTR. */848#if (defined __STDC__ || defined __C99__FUNC__ \849|| defined __cplusplus || defined _MSC_VER)850static YYSIZE_T851yystrlen (const char *yystr)852#else853static YYSIZE_T854yystrlen (yystr)855const char *yystr;856#endif857{858YYSIZE_T yylen;859for (yylen = 0; yystr[yylen]; yylen++)860continue;861return yylen;862}863# endif864# endif865866# ifndef yystpcpy867# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE868# define yystpcpy stpcpy869# else870/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in871YYDEST. */872#if (defined __STDC__ || defined __C99__FUNC__ \873|| defined __cplusplus || defined _MSC_VER)874static char *875yystpcpy (char *yydest, const char *yysrc)876#else877static char *878yystpcpy (yydest, yysrc)879char *yydest;880const char *yysrc;881#endif882{883char *yyd = yydest;884const char *yys = yysrc;885886while ((*yyd++ = *yys++) != '\0')887continue;888889return yyd - 1;890}891# endif892# endif893894# ifndef yytnamerr895/* Copy to YYRES the contents of YYSTR after stripping away unnecessary896quotes and backslashes, so that it's suitable for yyerror. The897heuristic is that double-quoting is unnecessary unless the string898contains an apostrophe, a comma, or backslash (other than899backslash-backslash). YYSTR is taken from yytname. If YYRES is900null, do not copy; instead, return the length of what the result901would have been. */902static YYSIZE_T903yytnamerr (char *yyres, const char *yystr)904{905if (*yystr == '"')906{907YYSIZE_T yyn = 0;908char const *yyp = yystr;909910for (;;)911switch (*++yyp)912{913case '\'':914case ',':915goto do_not_strip_quotes;916917case '\\':918if (*++yyp != '\\')919goto do_not_strip_quotes;920/* Fall through. */921default:922if (yyres)923yyres[yyn] = *yyp;924yyn++;925break;926927case '"':928if (yyres)929yyres[yyn] = '\0';930return yyn;931}932do_not_strip_quotes: ;933}934935if (! yyres)936return yystrlen (yystr);937938return yystpcpy (yyres, yystr) - yyres;939}940# endif941942/* Copy into YYRESULT an error message about the unexpected token943YYCHAR while in state YYSTATE. Return the number of bytes copied,944including the terminating null byte. If YYRESULT is null, do not945copy anything; just return the number of bytes that would be946copied. As a special case, return 0 if an ordinary "syntax error"947message will do. Return YYSIZE_MAXIMUM if overflow occurs during948size calculation. */949static YYSIZE_T950yysyntax_error (char *yyresult, int yystate, int yychar)951{952int yyn = yypact[yystate];953954if (! (YYPACT_NINF < yyn && yyn <= YYLAST))955return 0;956else957{958int yytype = YYTRANSLATE (yychar);959YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);960YYSIZE_T yysize = yysize0;961YYSIZE_T yysize1;962int yysize_overflow = 0;963enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };964char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];965int yyx;966967# if 0968/* This is so xgettext sees the translatable formats that are969constructed on the fly. */970YY_("syntax error, unexpected %s");971YY_("syntax error, unexpected %s, expecting %s");972YY_("syntax error, unexpected %s, expecting %s or %s");973YY_("syntax error, unexpected %s, expecting %s or %s or %s");974YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");975# endif976char *yyfmt;977char const *yyf;978static char const yyunexpected[] = "syntax error, unexpected %s";979static char const yyexpecting[] = ", expecting %s";980static char const yyor[] = " or %s";981char yyformat[sizeof yyunexpected982+ sizeof yyexpecting - 1983+ ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)984* (sizeof yyor - 1))];985char const *yyprefix = yyexpecting;986987/* Start YYX at -YYN if negative to avoid negative indexes in988YYCHECK. */989int yyxbegin = yyn < 0 ? -yyn : 0;990991/* Stay within bounds of both yycheck and yytname. */992int yychecklim = YYLAST - yyn + 1;993int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;994int yycount = 1;995996yyarg[0] = yytname[yytype];997yyfmt = yystpcpy (yyformat, yyunexpected);998999for (yyx = yyxbegin; yyx < yyxend; ++yyx)1000if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)1001{1002if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)1003{1004yycount = 1;1005yysize = yysize0;1006yyformat[sizeof yyunexpected - 1] = '\0';1007break;1008}1009yyarg[yycount++] = yytname[yyx];1010yysize1 = yysize + yytnamerr (0, yytname[yyx]);1011yysize_overflow |= (yysize1 < yysize);1012yysize = yysize1;1013yyfmt = yystpcpy (yyfmt, yyprefix);1014yyprefix = yyor;1015}10161017yyf = YY_(yyformat);1018yysize1 = yysize + yystrlen (yyf);1019yysize_overflow |= (yysize1 < yysize);1020yysize = yysize1;10211022if (yysize_overflow)1023return YYSIZE_MAXIMUM;10241025if (yyresult)1026{1027/* Avoid sprintf, as that infringes on the user's name space.1028Don't have undefined behavior even if the translation1029produced a string with the wrong number of "%s"s. */1030char *yyp = yyresult;1031int yyi = 0;1032while ((*yyp = *yyf) != '\0')1033{1034if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)1035{1036yyp += yytnamerr (yyp, yyarg[yyi++]);1037yyf += 2;1038}1039else1040{1041yyp++;1042yyf++;1043}1044}1045}1046return yysize;1047}1048}1049#endif /* YYERROR_VERBOSE */105010511052/*-----------------------------------------------.1053| Release the memory associated to this symbol. |1054`-----------------------------------------------*/10551056/*ARGSUSED*/1057#if (defined __STDC__ || defined __C99__FUNC__ \1058|| defined __cplusplus || defined _MSC_VER)1059static void1060yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)1061#else1062static void1063yydestruct (yymsg, yytype, yyvaluep)1064const char *yymsg;1065int yytype;1066YYSTYPE *yyvaluep;1067#endif1068{1069YYUSE (yyvaluep);10701071if (!yymsg)1072yymsg = "Deleting";1073YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);10741075switch (yytype)1076{10771078default:1079break;1080}1081}108210831084/* Prevent warnings from -Wmissing-prototypes. */10851086#ifdef YYPARSE_PARAM1087#if defined __STDC__ || defined __cplusplus1088int yyparse (void *YYPARSE_PARAM);1089#else1090int yyparse ();1091#endif1092#else /* ! YYPARSE_PARAM */1093#if defined __STDC__ || defined __cplusplus1094int yyparse (void);1095#else1096int yyparse ();1097#endif1098#endif /* ! YYPARSE_PARAM */1099110011011102/* The look-ahead symbol. */1103int yychar;11041105/* The semantic value of the look-ahead symbol. */1106YYSTYPE yylval;11071108/* Number of syntax errors so far. */1109int yynerrs;1110111111121113/*----------.1114| yyparse. |1115`----------*/11161117#ifdef YYPARSE_PARAM1118#if (defined __STDC__ || defined __C99__FUNC__ \1119|| defined __cplusplus || defined _MSC_VER)1120int1121yyparse (void *YYPARSE_PARAM)1122#else1123int1124yyparse (YYPARSE_PARAM)1125void *YYPARSE_PARAM;1126#endif1127#else /* ! YYPARSE_PARAM */1128#if (defined __STDC__ || defined __C99__FUNC__ \1129|| defined __cplusplus || defined _MSC_VER)1130int1131yyparse (void)1132#else1133int1134yyparse ()11351136#endif1137#endif1138{11391140int yystate;1141int yyn;1142int yyresult;1143/* Number of tokens to shift before error messages enabled. */1144int yyerrstatus;1145/* Look-ahead token as an internal (translated) token number. */1146int yytoken = 0;1147#if YYERROR_VERBOSE1148/* Buffer for error messages, and its allocated size. */1149char yymsgbuf[128];1150char *yymsg = yymsgbuf;1151YYSIZE_T yymsg_alloc = sizeof yymsgbuf;1152#endif11531154/* Three stacks and their tools:1155`yyss': related to states,1156`yyvs': related to semantic values,1157`yyls': related to locations.11581159Refer to the stacks thru separate pointers, to allow yyoverflow1160to reallocate them elsewhere. */11611162/* The state stack. */1163yytype_int16 yyssa[YYINITDEPTH];1164yytype_int16 *yyss = yyssa;1165yytype_int16 *yyssp;11661167/* The semantic value stack. */1168YYSTYPE yyvsa[YYINITDEPTH];1169YYSTYPE *yyvs = yyvsa;1170YYSTYPE *yyvsp;1171117211731174#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))11751176YYSIZE_T yystacksize = YYINITDEPTH;11771178/* The variables used to return semantic value and location from the1179action routines. */1180YYSTYPE yyval;118111821183/* The number of symbols on the RHS of the reduced rule.1184Keep to zero when no symbol should be popped. */1185int yylen = 0;11861187YYDPRINTF ((stderr, "Starting parse\n"));11881189yystate = 0;1190yyerrstatus = 0;1191yynerrs = 0;1192yychar = YYEMPTY; /* Cause a token to be read. */11931194/* Initialize stack pointers.1195Waste one element of value and location stack1196so that they stay on the same level as the state stack.1197The wasted elements are never initialized. */11981199yyssp = yyss;1200yyvsp = yyvs;12011202goto yysetstate;12031204/*------------------------------------------------------------.1205| yynewstate -- Push a new state, which is found in yystate. |1206`------------------------------------------------------------*/1207yynewstate:1208/* In all cases, when you get here, the value and location stacks1209have just been pushed. So pushing a state here evens the stacks. */1210yyssp++;12111212yysetstate:1213*yyssp = yystate;12141215if (yyss + yystacksize - 1 <= yyssp)1216{1217/* Get the current used size of the three stacks, in elements. */1218YYSIZE_T yysize = yyssp - yyss + 1;12191220#ifdef yyoverflow1221{1222/* Give user a chance to reallocate the stack. Use copies of1223these so that the &'s don't force the real ones into1224memory. */1225YYSTYPE *yyvs1 = yyvs;1226yytype_int16 *yyss1 = yyss;122712281229/* Each stack pointer address is followed by the size of the1230data in use in that stack, in bytes. This used to be a1231conditional around just the two extra args, but that might1232be undefined if yyoverflow is a macro. */1233yyoverflow (YY_("memory exhausted"),1234&yyss1, yysize * sizeof (*yyssp),1235&yyvs1, yysize * sizeof (*yyvsp),12361237&yystacksize);12381239yyss = yyss1;1240yyvs = yyvs1;1241}1242#else /* no yyoverflow */1243# ifndef YYSTACK_RELOCATE1244goto yyexhaustedlab;1245# else1246/* Extend the stack our own way. */1247if (YYMAXDEPTH <= yystacksize)1248goto yyexhaustedlab;1249yystacksize *= 2;1250if (YYMAXDEPTH < yystacksize)1251yystacksize = YYMAXDEPTH;12521253{1254yytype_int16 *yyss1 = yyss;1255union yyalloc *yyptr =1256(union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));1257if (! yyptr)1258goto yyexhaustedlab;1259YYSTACK_RELOCATE (yyss);1260YYSTACK_RELOCATE (yyvs);12611262# undef YYSTACK_RELOCATE1263if (yyss1 != yyssa)1264YYSTACK_FREE (yyss1);1265}1266# endif1267#endif /* no yyoverflow */12681269yyssp = yyss + yysize - 1;1270yyvsp = yyvs + yysize - 1;127112721273YYDPRINTF ((stderr, "Stack size increased to %lu\n",1274(unsigned long int) yystacksize));12751276if (yyss + yystacksize - 1 <= yyssp)1277YYABORT;1278}12791280YYDPRINTF ((stderr, "Entering state %d\n", yystate));12811282goto yybackup;12831284/*-----------.1285| yybackup. |1286`-----------*/1287yybackup:12881289/* Do appropriate processing given the current state. Read a1290look-ahead token if we need one and don't already have one. */12911292/* First try to decide what to do without reference to look-ahead token. */1293yyn = yypact[yystate];1294if (yyn == YYPACT_NINF)1295goto yydefault;12961297/* Not known => get a look-ahead token if don't already have one. */12981299/* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */1300if (yychar == YYEMPTY)1301{1302YYDPRINTF ((stderr, "Reading a token: "));1303yychar = YYLEX;1304}13051306if (yychar <= YYEOF)1307{1308yychar = yytoken = YYEOF;1309YYDPRINTF ((stderr, "Now at end of input.\n"));1310}1311else1312{1313yytoken = YYTRANSLATE (yychar);1314YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);1315}13161317/* If the proper action on seeing token YYTOKEN is to reduce or to1318detect an error, take that action. */1319yyn += yytoken;1320if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)1321goto yydefault;1322yyn = yytable[yyn];1323if (yyn <= 0)1324{1325if (yyn == 0 || yyn == YYTABLE_NINF)1326goto yyerrlab;1327yyn = -yyn;1328goto yyreduce;1329}13301331if (yyn == YYFINAL)1332YYACCEPT;13331334/* Count tokens shifted since error; after three, turn off error1335status. */1336if (yyerrstatus)1337yyerrstatus--;13381339/* Shift the look-ahead token. */1340YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);13411342/* Discard the shifted token unless it is eof. */1343if (yychar != YYEOF)1344yychar = YYEMPTY;13451346yystate = yyn;1347*++yyvsp = yylval;13481349goto yynewstate;135013511352/*-----------------------------------------------------------.1353| yydefault -- do the default action for the current state. |1354`-----------------------------------------------------------*/1355yydefault:1356yyn = yydefact[yystate];1357if (yyn == 0)1358goto yyerrlab;1359goto yyreduce;136013611362/*-----------------------------.1363| yyreduce -- Do a reduction. |1364`-----------------------------*/1365yyreduce:1366/* yyn is the number of a rule to reduce with. */1367yylen = yyr2[yyn];13681369/* If YYLEN is nonzero, implement the default value of the action:1370`$$ = $1'.13711372Otherwise, the following line sets YYVAL to garbage.1373This behavior is undocumented and Bison1374users should not rely upon it. Assigning to YYVAL1375unconditionally makes the parser a bit smaller, and it avoids a1376GCC warning that YYVAL may be used uninitialized. */1377yyval = yyvsp[1-yylen];137813791380YY_REDUCE_PRINT (yyn);1381switch (yyn)1382{1383case 6:1384#line 74 "parse.y"1385{1386id_str = (yyvsp[(2) - (2)].string);1387}1388break;13891390case 7:1391#line 80 "parse.y"1392{1393base_id = name2number((yyvsp[(2) - (2)].string));1394strlcpy(name, (yyvsp[(2) - (2)].string), sizeof(name));1395free((yyvsp[(2) - (2)].string));1396}1397break;13981399case 8:1400#line 86 "parse.y"1401{1402base_id = name2number((yyvsp[(2) - (3)].string));1403strlcpy(name, (yyvsp[(3) - (3)].string), sizeof(name));1404free((yyvsp[(2) - (3)].string));1405free((yyvsp[(3) - (3)].string));1406}1407break;14081409case 11:1410#line 99 "parse.y"1411{1412number = (yyvsp[(2) - (2)].number);1413}1414break;14151416case 12:1417#line 103 "parse.y"1418{1419free(prefix);1420asprintf (&prefix, "%s_", (yyvsp[(2) - (2)].string));1421if (prefix == NULL)1422errx(1, "malloc");1423free((yyvsp[(2) - (2)].string));1424}1425break;14261427case 13:1428#line 111 "parse.y"1429{1430prefix = realloc(prefix, 1);1431if (prefix == NULL)1432errx(1, "malloc");1433*prefix = '\0';1434}1435break;14361437case 14:1438#line 118 "parse.y"1439{1440struct error_code *ec = malloc(sizeof(*ec));14411442if (ec == NULL)1443errx(1, "malloc");14441445ec->next = NULL;1446ec->number = number;1447if(prefix && *prefix != '\0') {1448asprintf (&ec->name, "%s%s", prefix, (yyvsp[(2) - (4)].string));1449if (ec->name == NULL)1450errx(1, "malloc");1451free((yyvsp[(2) - (4)].string));1452} else1453ec->name = (yyvsp[(2) - (4)].string);1454ec->string = (yyvsp[(4) - (4)].string);1455APPEND(codes, ec);1456number++;1457}1458break;14591460case 15:1461#line 138 "parse.y"1462{1463YYACCEPT;1464}1465break;146614671468/* Line 1267 of yacc.c. */1469#line 1471 "parse.c"1470default: break;1471}1472YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);14731474YYPOPSTACK (yylen);1475yylen = 0;1476YY_STACK_PRINT (yyss, yyssp);14771478*++yyvsp = yyval;147914801481/* Now `shift' the result of the reduction. Determine what state1482that goes to, based on the state we popped back to and the rule1483number reduced by. */14841485yyn = yyr1[yyn];14861487yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;1488if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)1489yystate = yytable[yystate];1490else1491yystate = yydefgoto[yyn - YYNTOKENS];14921493goto yynewstate;149414951496/*------------------------------------.1497| yyerrlab -- here on detecting error |1498`------------------------------------*/1499yyerrlab:1500/* If not already recovering from an error, report this error. */1501if (!yyerrstatus)1502{1503++yynerrs;1504#if ! YYERROR_VERBOSE1505yyerror (YY_("syntax error"));1506#else1507{1508YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);1509if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)1510{1511YYSIZE_T yyalloc = 2 * yysize;1512if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))1513yyalloc = YYSTACK_ALLOC_MAXIMUM;1514if (yymsg != yymsgbuf)1515YYSTACK_FREE (yymsg);1516yymsg = (char *) YYSTACK_ALLOC (yyalloc);1517if (yymsg)1518yymsg_alloc = yyalloc;1519else1520{1521yymsg = yymsgbuf;1522yymsg_alloc = sizeof yymsgbuf;1523}1524}15251526if (0 < yysize && yysize <= yymsg_alloc)1527{1528(void) yysyntax_error (yymsg, yystate, yychar);1529yyerror (yymsg);1530}1531else1532{1533yyerror (YY_("syntax error"));1534if (yysize != 0)1535goto yyexhaustedlab;1536}1537}1538#endif1539}1540154115421543if (yyerrstatus == 3)1544{1545/* If just tried and failed to reuse look-ahead token after an1546error, discard it. */15471548if (yychar <= YYEOF)1549{1550/* Return failure if at end of input. */1551if (yychar == YYEOF)1552YYABORT;1553}1554else1555{1556yydestruct ("Error: discarding",1557yytoken, &yylval);1558yychar = YYEMPTY;1559}1560}15611562/* Else will try to reuse look-ahead token after shifting the error1563token. */1564goto yyerrlab1;156515661567/*---------------------------------------------------.1568| yyerrorlab -- error raised explicitly by YYERROR. |1569`---------------------------------------------------*/1570yyerrorlab:15711572/* Pacify compilers like GCC when the user code never invokes1573YYERROR and the label yyerrorlab therefore never appears in user1574code. */1575if (/*CONSTCOND*/ 0)1576goto yyerrorlab;15771578/* Do not reclaim the symbols of the rule which action triggered1579this YYERROR. */1580YYPOPSTACK (yylen);1581yylen = 0;1582YY_STACK_PRINT (yyss, yyssp);1583yystate = *yyssp;1584goto yyerrlab1;158515861587/*-------------------------------------------------------------.1588| yyerrlab1 -- common code for both syntax error and YYERROR. |1589`-------------------------------------------------------------*/1590yyerrlab1:1591yyerrstatus = 3; /* Each real token shifted decrements this. */15921593for (;;)1594{1595yyn = yypact[yystate];1596if (yyn != YYPACT_NINF)1597{1598yyn += YYTERROR;1599if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)1600{1601yyn = yytable[yyn];1602if (0 < yyn)1603break;1604}1605}16061607/* Pop the current state because it cannot handle the error token. */1608if (yyssp == yyss)1609YYABORT;161016111612yydestruct ("Error: popping",1613yystos[yystate], yyvsp);1614YYPOPSTACK (1);1615yystate = *yyssp;1616YY_STACK_PRINT (yyss, yyssp);1617}16181619if (yyn == YYFINAL)1620YYACCEPT;16211622*++yyvsp = yylval;162316241625/* Shift the error token. */1626YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);16271628yystate = yyn;1629goto yynewstate;163016311632/*-------------------------------------.1633| yyacceptlab -- YYACCEPT comes here. |1634`-------------------------------------*/1635yyacceptlab:1636yyresult = 0;1637goto yyreturn;16381639/*-----------------------------------.1640| yyabortlab -- YYABORT comes here. |1641`-----------------------------------*/1642yyabortlab:1643yyresult = 1;1644goto yyreturn;16451646#ifndef yyoverflow1647/*-------------------------------------------------.1648| yyexhaustedlab -- memory exhaustion comes here. |1649`-------------------------------------------------*/1650yyexhaustedlab:1651yyerror (YY_("memory exhausted"));1652yyresult = 2;1653/* Fall through. */1654#endif16551656yyreturn:1657if (yychar != YYEOF && yychar != YYEMPTY)1658yydestruct ("Cleanup: discarding lookahead",1659yytoken, &yylval);1660/* Do not reclaim the symbols of the rule which action triggered1661this YYABORT or YYACCEPT. */1662YYPOPSTACK (yylen);1663YY_STACK_PRINT (yyss, yyssp);1664while (yyssp != yyss)1665{1666yydestruct ("Cleanup: popping",1667yystos[*yyssp], yyvsp);1668YYPOPSTACK (1);1669}1670#ifndef yyoverflow1671if (yyss != yyssa)1672YYSTACK_FREE (yyss);1673#endif1674#if YYERROR_VERBOSE1675if (yymsg != yymsgbuf)1676YYSTACK_FREE (yymsg);1677#endif1678/* Make sure YYID is used. */1679return YYID (yyresult);1680}168116821683#line 143 "parse.y"168416851686static long1687name2number(const char *str)1688{1689const char *p;1690long num = 0;1691const char *x = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"1692"abcdefghijklmnopqrstuvwxyz0123456789_";1693if(strlen(str) > 4) {1694yyerror("table name too long");1695return 0;1696}1697for(p = str; *p; p++){1698char *q = strchr(x, *p);1699if(q == NULL) {1700yyerror("invalid character in table name");1701return 0;1702}1703num = (num << 6) + (q - x) + 1;1704}1705num <<= 8;1706if(num > 0x7fffffff)1707num = -(0xffffffff - num + 1);1708return num;1709}17101711void1712yyerror (char *s)1713{1714_lex_error_message ("%s\n", s);1715}1716171717181719