📄 zconf.tab.c_shipped
字号:
/* A Bison parser, made by GNU Bison 1.875a. *//* Skeleton parser for Yacc-like parsing with Bison, Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *//* As a special exception, when this file is copied by Bison into a Bison output file, you may use that output file without restriction. This special exception was added by the Free Software Foundation in version 1.24 of Bison. *//* Written by Richard Stallman by simplifying the original so called ``semantic'' parser. *//* All symbols defined below should begin with yy or YY, to avoid infringing on user name space. This should be done even for local variables, as they might otherwise be expanded by user macros. There are some unavoidable exceptions within include files to define necessary library symbols; they are noted "INFRINGES ON USER NAME SPACE" below. *//* Identify Bison output. */#define YYBISON 1/* Skeleton name. */#define YYSKELETON_NAME "yacc.c"/* Pure parsers. */#define YYPURE 0/* Using locations. */#define YYLSP_NEEDED 0/* If NAME_PREFIX is specified substitute the variables and functions names. */#define yyparse zconfparse#define yylex zconflex#define yyerror zconferror#define yylval zconflval#define yychar zconfchar#define yydebug zconfdebug#define yynerrs zconfnerrs/* Tokens. */#ifndef YYTOKENTYPE# define YYTOKENTYPE /* Put the tokens into the symbol table, so that GDB and other debuggers know about them. */ enum yytokentype { T_MAINMENU = 258, T_MENU = 259, T_ENDMENU = 260, T_SOURCE = 261, T_CHOICE = 262, T_ENDCHOICE = 263, T_COMMENT = 264, T_CONFIG = 265, T_MENUCONFIG = 266, T_HELP = 267, T_HELPTEXT = 268, T_IF = 269, T_ENDIF = 270, T_DEPENDS = 271, T_REQUIRES = 272, T_OPTIONAL = 273, T_PROMPT = 274, T_DEFAULT = 275, T_TRISTATE = 276, T_DEF_TRISTATE = 277, T_BOOLEAN = 278, T_DEF_BOOLEAN = 279, T_STRING = 280, T_INT = 281, T_HEX = 282, T_WORD = 283, T_WORD_QUOTE = 284, T_UNEQUAL = 285, T_EOF = 286, T_EOL = 287, T_CLOSE_PAREN = 288, T_OPEN_PAREN = 289, T_ON = 290, T_SELECT = 291, T_RANGE = 292, T_OR = 293, T_AND = 294, T_EQUAL = 295, T_NOT = 296 };#endif#define T_MAINMENU 258#define T_MENU 259#define T_ENDMENU 260#define T_SOURCE 261#define T_CHOICE 262#define T_ENDCHOICE 263#define T_COMMENT 264#define T_CONFIG 265#define T_MENUCONFIG 266#define T_HELP 267#define T_HELPTEXT 268#define T_IF 269#define T_ENDIF 270#define T_DEPENDS 271#define T_REQUIRES 272#define T_OPTIONAL 273#define T_PROMPT 274#define T_DEFAULT 275#define T_TRISTATE 276#define T_DEF_TRISTATE 277#define T_BOOLEAN 278#define T_DEF_BOOLEAN 279#define T_STRING 280#define T_INT 281#define T_HEX 282#define T_WORD 283#define T_WORD_QUOTE 284#define T_UNEQUAL 285#define T_EOF 286#define T_EOL 287#define T_CLOSE_PAREN 288#define T_OPEN_PAREN 289#define T_ON 290#define T_SELECT 291#define T_RANGE 292#define T_OR 293#define T_AND 294#define T_EQUAL 295#define T_NOT 296/* Copy the first part of user declarations. *//* * Copyright (C) 2002 Roman Zippel <zippel@linux-m68k.org> * Released under the terms of the GNU GPL v2.0. */#include <ctype.h>#include <stdarg.h>#include <stdio.h>#include <stdlib.h>#include <string.h>#include <stdbool.h>#define printd(mask, fmt...) if (cdebug & (mask)) printf(fmt)#define PRINTD 0x0001#define DEBUG_PARSE 0x0002int cdebug = PRINTD;extern int zconflex(void);static void zconfprint(const char *err, ...);static void zconferror(const char *err);static bool zconf_endtoken(int token, int starttoken, int endtoken);struct symbol *symbol_hash[257];static struct menu *current_menu, *current_entry;#define YYERROR_VERBOSE/* Enabling traces. */#ifndef YYDEBUG# define YYDEBUG 0#endif/* Enabling verbose error messages. */#ifdef YYERROR_VERBOSE# undef YYERROR_VERBOSE# define YYERROR_VERBOSE 1#else# define YYERROR_VERBOSE 0#endif#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)typedef union YYSTYPE { int token; char *string; struct symbol *symbol; struct expr *expr; struct menu *menu;} YYSTYPE;/* Line 191 of yacc.c. */# define yystype YYSTYPE /* obsolescent; will be withdrawn */# define YYSTYPE_IS_DECLARED 1# define YYSTYPE_IS_TRIVIAL 1#endif/* Copy the second part of user declarations. */#define LKC_DIRECT_LINK#include "lkc.h"/* Line 214 of yacc.c. */#if ! defined (yyoverflow) || YYERROR_VERBOSE/* The parser invokes alloca or malloc; define the necessary symbols. */# if YYSTACK_USE_ALLOCA# define YYSTACK_ALLOC alloca# else# ifndef YYSTACK_USE_ALLOCA# if defined (alloca) || defined (_ALLOCA_H)# define YYSTACK_ALLOC alloca# else# ifdef __GNUC__# define YYSTACK_ALLOC __builtin_alloca# endif# endif# endif# endif# ifdef YYSTACK_ALLOC /* Pacify GCC's `empty if-body' warning. */# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)# else# if defined (__STDC__) || defined (__cplusplus)# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */# define YYSIZE_T size_t# endif# define YYSTACK_ALLOC malloc# define YYSTACK_FREE free# endif#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */#if (! defined (yyoverflow) \ && (! defined (__cplusplus) \ || (YYSTYPE_IS_TRIVIAL)))/* A type that is properly aligned for any stack member. */union yyalloc{ short yyss; YYSTYPE yyvs; };/* The size of the maximum gap between one aligned stack and the next. */# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)/* The size of an array large to enough to hold all stacks, each with N elements. */# define YYSTACK_BYTES(N) \ ((N) * (sizeof (short) + sizeof (YYSTYPE)) \ + YYSTACK_GAP_MAXIMUM)/* Copy COUNT objects from FROM to TO. The source and destination do not overlap. */# ifndef YYCOPY# if 1 < __GNUC__# define YYCOPY(To, From, Count) \ __builtin_memcpy (To, From, (Count) * sizeof (*(From)))# else# define YYCOPY(To, From, Count) \ do \ { \ register YYSIZE_T yyi; \ for (yyi = 0; yyi < (Count); yyi++) \ (To)[yyi] = (From)[yyi]; \ } \ while (0)# endif# endif/* Relocate STACK from its old location to the new one. The local variables YYSIZE and YYSTACKSIZE give the old and new number of elements in the stack, and YYPTR gives the new location of the stack. Advance YYPTR to a properly aligned location for the next stack. */# define YYSTACK_RELOCATE(Stack) \ do \ { \ YYSIZE_T yynewbytes; \ YYCOPY (&yyptr->Stack, Stack, yysize); \ Stack = &yyptr->Stack; \ yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ yyptr += yynewbytes / sizeof (*yyptr); \ } \ while (0)#endif#if defined (__STDC__) || defined (__cplusplus) typedef signed char yysigned_char;#else typedef short yysigned_char;#endif/* YYFINAL -- State number of the termination state. */#define YYFINAL 2/* YYLAST -- Last index in YYTABLE. */#define YYLAST 201/* YYNTOKENS -- Number of terminals. */#define YYNTOKENS 42/* YYNNTS -- Number of nonterminals. */#define YYNNTS 41/* YYNRULES -- Number of rules. */#define YYNRULES 104/* YYNRULES -- Number of states. */#define YYNSTATES 182/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */#define YYUNDEFTOK 2#define YYMAXUTOK 296#define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */static const unsigned char yytranslate[] ={ 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41};#if YYDEBUG/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in YYRHS. */static const unsigned short yyprhs[] ={ 0, 0, 3, 4, 7, 9, 11, 13, 17, 19, 21, 23, 26, 28, 30, 32, 34, 36, 38, 42, 45, 49, 52, 53, 56, 59, 62, 65, 69, 74, 78, 83, 87, 91, 95, 100, 105, 110, 116, 119, 122, 124, 128, 131, 132, 135, 138, 141, 144, 149, 153, 157, 160, 165, 166, 169, 173, 175, 179, 182, 183, 186, 189, 192, 196, 199, 201, 205, 208, 209, 212, 215, 218, 222, 226, 228, 232, 235, 238, 241, 242, 245, 248, 253, 257, 261, 262, 265, 267, 269, 272, 275, 278, 280, 282, 283, 286, 288, 292, 296, 300, 303, 307, 311, 313};/* YYRHS -- A `-1'-separated list of the rules' RHS. */static const yysigned_char yyrhs[] ={ 43, 0, -1, -1, 43, 44, -1, 45, -1, 55, -1, 66, -1, 3, 77, 79, -1, 5, -1, 15, -1, 8, -1, 1, 79, -1, 61, -1, 71, -1, 47, -1, 49, -1, 69, -1, 79, -1, 10, 28, 32, -1, 46, 50, -1, 11, 28, 32, -1, 48, 50, -1, -1, 50, 51, -1, 50, 75, -1, 50, 73, -1, 50, 32, -1, 21, 76, 32, -1, 22, 81, 80, 32, -1, 23, 76, 32, -1, 24, 81, 80, 32, -1, 26, 76, 32, -1, 27, 76, 32, -1, 25, 76, 32, -1, 19, 77, 80, 32, -1, 20, 81, 80, 32, -1, 36, 28, 80, 32, -1, 37, 82, 82, 80, 32, -1, 7, 32, -1, 52, 56, -1, 78, -1, 53, 58, 54, -1, 53, 58, -1, -1, 56, 57, -1, 56, 75, -1, 56, 73, -1, 56, 32, -1, 19, 77, 80, 32, -1, 21, 76, 32, -1, 23, 76, 32, -1, 18, 32, -1, 20, 28, 80, 32, -1, -1, 58, 45, -1, 14, 81, 32, -1, 78, -1, 59, 62, 60, -1, 59, 62, -1, -1, 62, 45, -1, 62, 66, -1, 62, 55, -1, 4, 77, 32, -1, 63, 74, -1, 78, -1, 64, 67, 65, -1, 64, 67, -1, -1, 67, 45, -1, 67, 66, -1, 67, 55, -1, 67, 1, 32, -1, 6, 77, 32, -1, 68, -1, 9, 77, 32, -1, 70, 74, -1, 12, 32, -1, 72, 13, -1, -1, 74, 75, -1, 74, 32, -1, 16, 35, 81, 32, -1, 16, 81, 32, -1, 17, 81, 32, -1, -1, 77, 80, -1, 28, -1, 29, -1, 5, 79, -1, 8, 79, -1, 15, 79, -1, 32, -1, 31, -1, -1, 14, 81, -1, 82, -1, 82, 40, 82, -1, 82, 30, 82, -1, 34, 81, 33, -1, 41, 81, -1, 81, 38, 81, -1, 81, 39, 81, -1, 28, -1, 29, -1};/* YYRLINE[YYN] -- source line where rule number YYN was defined. */static const unsigned short yyrline[] ={ 0, 94, 94, 95, 98, 99, 100, 101, 102, 103, 104, 105, 109, 110, 111, 112, 113, 114, 120, 128, 134, 142, 152, 154, 155, 156, 157, 160, 166, 173, 179, 186, 192, 198, 204, 210, 216, 222, 230, 239, 245, 254, 255, 261, 263, 264, 265, 266, 269, 275, 281, 287, 293, 299, 301, 306, 315, 324, 325, 331, 333, 334, 335, 340, 347, 353, 362, 363, 369, 371, 372, 373, 374, 377, 383, 390, 397, 404, 410, 417, 418, 419, 422, 427, 432, 440, 442, 447, 448, 451, 452, 453, 457, 457, 459, 460, 463, 464, 465, 466, 467, 468, 469, 472, 473};#endif#if YYDEBUG || YYERROR_VERBOSE/* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. First, the terminals, then, starting at YYNTOKENS, nonterminals. */static const char *const yytname[] ={ "$end", "error", "$undefined", "T_MAINMENU", "T_MENU", "T_ENDMENU", "T_SOURCE", "T_CHOICE", "T_ENDCHOICE", "T_COMMENT", "T_CONFIG", "T_MENUCONFIG", "T_HELP", "T_HELPTEXT", "T_IF", "T_ENDIF", "T_DEPENDS", "T_REQUIRES", "T_OPTIONAL", "T_PROMPT", "T_DEFAULT", "T_TRISTATE", "T_DEF_TRISTATE", "T_BOOLEAN", "T_DEF_BOOLEAN", "T_STRING", "T_INT", "T_HEX", "T_WORD", "T_WORD_QUOTE", "T_UNEQUAL", "T_EOF", "T_EOL", "T_CLOSE_PAREN", "T_OPEN_PAREN", "T_ON", "T_SELECT", "T_RANGE", "T_OR", "T_AND", "T_EQUAL", "T_NOT", "$accept", "input", "block", "common_block", "config_entry_start", "config_stmt", "menuconfig_entry_start", "menuconfig_stmt", "config_option_list", "config_option", "choice", "choice_entry", "choice_end", "choice_stmt", "choice_option_list", "choice_option", "choice_block", "if", "if_end", "if_stmt", "if_block", "menu", "menu_entry", "menu_end", "menu_stmt", "menu_block", "source", "source_stmt", "comment", "comment_stmt", "help_start", "help", "depends_list", "depends", "prompt_stmt_opt", "prompt", "end", "nl_or_eof", "if_expr", "expr", "symbol", 0};#endif# ifdef YYPRINT/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to token YYLEX-NUM. */static const unsigned short yytoknum[] ={ 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296};# endif/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */static const unsigned char yyr1[] ={ 0, 42, 43, 43, 44, 44, 44, 44, 44, 44, 44, 44, 45, 45, 45, 45, 45, 45, 46, 47, 48, 49, 50, 50, 50, 50, 50, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 52, 53, 54, 55, 55, 56, 56, 56, 56, 56, 57, 57, 57, 57, 57, 58, 58, 59, 60, 61, 61, 62, 62, 62, 62, 63, 64, 65, 66, 66, 67, 67, 67, 67, 67, 68, 69, 70, 71, 72, 73, 74, 74, 74, 75, 75, 75, 76, 76, 77, 77, 78, 78, 78, 79, 79, 80, 80, 81, 81, 81, 81, 81, 81, 81, 82, 82};/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */static const unsigned char yyr2[] ={ 0, 2, 0, 2, 1, 1, 1, 3, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 3, 2, 3, 2, 0, 2, 2, 2, 2, 3, 4, 3, 4, 3, 3, 3, 4, 4, 4, 5, 2, 2, 1, 3, 2, 0, 2, 2, 2, 2, 4, 3, 3, 2, 4, 0, 2, 3, 1, 3, 2, 0, 2, 2, 2, 3, 2, 1, 3, 2, 0, 2, 2, 2, 3, 3, 1, 3, 2, 2, 2, 0, 2, 2, 4, 3, 3, 0, 2, 1, 1, 2, 2, 2, 1, 1, 0, 2, 1, 3, 3, 3, 2, 3, 3, 1, 1};/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state STATE-NUM when YYTABLE doesn't specify something else to do. Zero means the default is an error. */static const unsigned char yydefact[] ={ 2, 0, 1, 0, 0, 0, 8, 0, 0, 10, 0, 0, 0, 0, 9, 93, 92, 3, 4, 22, 14, 22, 15, 43, 53, 5, 59, 12, 79, 68, 6, 74, 16, 79, 13, 17, 11, 87, 88, 0, 0, 0, 38, 0, 0, 0, 103, 104, 0, 0, 0, 96, 19, 21, 39, 42, 58, 64, 0, 76, 7, 63, 73, 75, 18, 20, 0, 100, 55, 0, 0, 0, 0, 0, 0, 0, 0, 0, 85, 0, 85, 0, 85, 85, 85, 26, 0, 0, 23, 0, 25, 24, 0, 0, 0, 85, 85, 47, 44, 46, 45, 0, 0, 0, 54, 41, 40, 60, 62, 57, 61, 56, 81, 80, 0, 69, 71, 66, 70, 65, 99, 101, 102, 98, 97, 77, 0, 0, 0, 94, 94, 0, 94, 94, 0, 94, 0, 0, 0, 94,
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -