base/config/kconfig/zconf.tab.c

Go to the documentation of this file.
00001 /* A Bison parser, made by GNU Bison 1.875a.  */
00002 
00003 /* Skeleton parser for Yacc-like parsing with Bison,
00004    Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
00005 
00006    This program is free software; you can redistribute it and/or modify
00007    it under the terms of the GNU General Public License as published by
00008    the Free Software Foundation; either version 2, or (at your option)
00009    any later version.
00010 
00011    This program is distributed in the hope that it will be useful,
00012    but WITHOUT ANY WARRANTY; without even the implied warranty of
00013    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014    GNU General Public License for more details.
00015 
00016    You should have received a copy of the GNU General Public License
00017    along with this program; if not, write to the Free Software
00018    Foundation, Inc., 59 Temple Place - Suite 330,
00019    Boston, MA 02111-1307, USA.  */
00020 
00021 /* As a special exception, when this file is copied by Bison into a
00022    Bison output file, you may use that output file without restriction.
00023    This special exception was added by the Free Software Foundation
00024    in version 1.24 of Bison.  */
00025 
00026 /* Written by Richard Stallman by simplifying the original so called
00027    ``semantic'' parser.  */
00028 
00029 /* All symbols defined below should begin with yy or YY, to avoid
00030    infringing on user name space.  This should be done even for local
00031    variables, as they might otherwise be expanded by user macros.
00032    There are some unavoidable exceptions within include files to
00033    define necessary library symbols; they are noted "INFRINGES ON
00034    USER NAME SPACE" below.  */
00035 
00036 /* Identify Bison output.  */
00037 #define YYBISON 1
00038 
00039 /* Skeleton name.  */
00040 #define YYSKELETON_NAME "yacc.c"
00041 
00042 /* Pure parsers.  */
00043 #define YYPURE 0
00044 
00045 /* Using locations.  */
00046 #define YYLSP_NEEDED 0
00047 
00048 /* If NAME_PREFIX is specified substitute the variables and functions
00049    names.  */
00050 #define yyparse zconfparse
00051 #define yylex   zconflex
00052 #define yyerror zconferror
00053 #define yylval  zconflval
00054 #define yychar  zconfchar
00055 #define yydebug zconfdebug
00056 #define yynerrs zconfnerrs
00057 
00058 
00059 /* Tokens.  */
00060 #ifndef YYTOKENTYPE
00061 # define YYTOKENTYPE
00062    /* Put the tokens into the symbol table, so that GDB and other debuggers
00063       know about them.  */
00064    enum yytokentype {
00065      T_MAINMENU = 258,
00066      T_MENU = 259,
00067      T_ENDMENU = 260,
00068      T_SOURCE = 261,
00069      T_CHOICE = 262,
00070      T_ENDCHOICE = 263,
00071      T_COMMENT = 264,
00072      T_CONFIG = 265,
00073      T_MENUCONFIG = 266,
00074      T_HELP = 267,
00075      T_HELPTEXT = 268,
00076      T_IF = 269,
00077      T_ENDIF = 270,
00078      T_DEPENDS = 271,
00079      T_REQUIRES = 272,
00080      T_OPTIONAL = 273,
00081      T_PROMPT = 274,
00082      T_DEFAULT = 275,
00083      T_TRISTATE = 276,
00084      T_DEF_TRISTATE = 277,
00085      T_BOOLEAN = 278,
00086      T_DEF_BOOLEAN = 279,
00087      T_STRING = 280,
00088      T_INT = 281,
00089      T_HEX = 282,
00090      T_WORD = 283,
00091      T_WORD_QUOTE = 284,
00092      T_UNEQUAL = 285,
00093      T_EOF = 286,
00094      T_EOL = 287,
00095      T_CLOSE_PAREN = 288,
00096      T_OPEN_PAREN = 289,
00097      T_ON = 290,
00098      T_SELECT = 291,
00099      T_RANGE = 292,
00100      T_OR = 293,
00101      T_AND = 294,
00102      T_EQUAL = 295,
00103      T_NOT = 296
00104    };
00105 #endif
00106 #define T_MAINMENU 258
00107 #define T_MENU 259
00108 #define T_ENDMENU 260
00109 #define T_SOURCE 261
00110 #define T_CHOICE 262
00111 #define T_ENDCHOICE 263
00112 #define T_COMMENT 264
00113 #define T_CONFIG 265
00114 #define T_MENUCONFIG 266
00115 #define T_HELP 267
00116 #define T_HELPTEXT 268
00117 #define T_IF 269
00118 #define T_ENDIF 270
00119 #define T_DEPENDS 271
00120 #define T_REQUIRES 272
00121 #define T_OPTIONAL 273
00122 #define T_PROMPT 274
00123 #define T_DEFAULT 275
00124 #define T_TRISTATE 276
00125 #define T_DEF_TRISTATE 277
00126 #define T_BOOLEAN 278
00127 #define T_DEF_BOOLEAN 279
00128 #define T_STRING 280
00129 #define T_INT 281
00130 #define T_HEX 282
00131 #define T_WORD 283
00132 #define T_WORD_QUOTE 284
00133 #define T_UNEQUAL 285
00134 #define T_EOF 286
00135 #define T_EOL 287
00136 #define T_CLOSE_PAREN 288
00137 #define T_OPEN_PAREN 289
00138 #define T_ON 290
00139 #define T_SELECT 291
00140 #define T_RANGE 292
00141 #define T_OR 293
00142 #define T_AND 294
00143 #define T_EQUAL 295
00144 #define T_NOT 296
00145 
00146 
00147 
00148 
00149 /* Copy the first part of user declarations.  */
00150 
00151 
00152 /*
00153  * Copyright (C) 2002 Roman Zippel <zippel@linux-m68k.org>
00154  * Released under the terms of the GNU GPL v2.0.
00155  */
00156 
00157 #include <ctype.h>
00158 #include <stdarg.h>
00159 #include <stdio.h>
00160 #include <stdlib.h>
00161 #include <string.h>
00162 #include <stdbool.h>
00163 
00164 #define printd(mask, fmt...) if (cdebug & (mask)) printf(fmt)
00165 
00166 #define PRINTD      0x0001
00167 #define DEBUG_PARSE 0x0002
00168 
00169 int cdebug = PRINTD;
00170 
00171 extern int zconflex(void);
00172 static void zconfprint(const char *err, ...);
00173 static void zconferror(const char *err);
00174 static bool zconf_endtoken(int token, int starttoken, int endtoken);
00175 
00176 struct symbol *symbol_hash[257];
00177 
00178 #define YYERROR_VERBOSE
00179 
00180 
00181 /* Enabling traces.  */
00182 #ifndef YYDEBUG
00183 # define YYDEBUG 0
00184 #endif
00185 
00186 /* Enabling verbose error messages.  */
00187 #ifdef YYERROR_VERBOSE
00188 # undef YYERROR_VERBOSE
00189 # define YYERROR_VERBOSE 1
00190 #else
00191 # define YYERROR_VERBOSE 0
00192 #endif
00193 
00194 #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
00195 
00196 typedef union YYSTYPE {
00197     int token;
00198     char *string;
00199     struct symbol *symbol;
00200     struct expr *expr;
00201     struct menu *menu;
00202 } YYSTYPE;
00203 /* Line 191 of yacc.c.  */
00204 
00205 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
00206 # define YYSTYPE_IS_DECLARED 1
00207 # define YYSTYPE_IS_TRIVIAL 1
00208 #endif
00209 
00210 
00211 
00212 /* Copy the second part of user declarations.  */
00213 
00214 
00215 #define LKC_DIRECT_LINK
00216 #include "lkc.h"
00217 
00218 
00219 /* Line 214 of yacc.c.  */
00220 
00221 
00222 #if ! defined (yyoverflow) || YYERROR_VERBOSE
00223 
00224 /* The parser invokes alloca or malloc; define the necessary symbols.  */
00225 
00226 # if YYSTACK_USE_ALLOCA
00227 #  define YYSTACK_ALLOC alloca
00228 # else
00229 #  ifndef YYSTACK_USE_ALLOCA
00230 #   if defined (alloca) || defined (_ALLOCA_H)
00231 #    define YYSTACK_ALLOC alloca
00232 #   else
00233 #    ifdef __GNUC__
00234 #     define YYSTACK_ALLOC __builtin_alloca
00235 #    endif
00236 #   endif
00237 #  endif
00238 # endif
00239 
00240 # ifdef YYSTACK_ALLOC
00241    /* Pacify GCC's `empty if-body' warning. */
00242 #  define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
00243 # else
00244 #  if defined (__STDC__) || defined (__cplusplus)
00245 #   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
00246 #   define YYSIZE_T size_t
00247 #  endif
00248 #  define YYSTACK_ALLOC malloc
00249 #  define YYSTACK_FREE free
00250 # endif
00251 #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
00252 
00253 
00254 #if (! defined (yyoverflow) \
00255      && (! defined (__cplusplus) \
00256      || (YYSTYPE_IS_TRIVIAL)))
00257 
00258 /* A type that is properly aligned for any stack member.  */
00259 union yyalloc
00260 {
00261   short yyss;
00262   YYSTYPE yyvs;
00263   };
00264 
00265 /* The size of the maximum gap between one aligned stack and the next.  */
00266 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
00267 
00268 /* The size of an array large to enough to hold all stacks, each with
00269    N elements.  */
00270 # define YYSTACK_BYTES(N) \
00271      ((N) * (sizeof (short) + sizeof (YYSTYPE))             \
00272       + YYSTACK_GAP_MAXIMUM)
00273 
00274 /* Copy COUNT objects from FROM to TO.  The source and destination do
00275    not overlap.  */
00276 # ifndef YYCOPY
00277 #  if 1 < __GNUC__
00278 #   define YYCOPY(To, From, Count) \
00279       __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
00280 #  else
00281 #   define YYCOPY(To, From, Count)      \
00282       do                    \
00283     {                   \
00284       register YYSIZE_T yyi;        \
00285       for (yyi = 0; yyi < (Count); yyi++)   \
00286         (To)[yyi] = (From)[yyi];        \
00287     }                   \
00288       while (0)
00289 #  endif
00290 # endif
00291 
00292 /* Relocate STACK from its old location to the new one.  The
00293    local variables YYSIZE and YYSTACKSIZE give the old and new number of
00294    elements in the stack, and YYPTR gives the new location of the
00295    stack.  Advance YYPTR to a properly aligned location for the next
00296    stack.  */
00297 # define YYSTACK_RELOCATE(Stack)                    \
00298     do                                  \
00299       {                                 \
00300     YYSIZE_T yynewbytes;                        \
00301     YYCOPY (&yyptr->Stack, Stack, yysize);              \
00302     Stack = &yyptr->Stack;                      \
00303     yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
00304     yyptr += yynewbytes / sizeof (*yyptr);              \
00305       }                                 \
00306     while (0)
00307 
00308 #endif
00309 
00310 #if defined (__STDC__) || defined (__cplusplus)
00311    typedef signed char yysigned_char;
00312 #else
00313    typedef short yysigned_char;
00314 #endif
00315 
00316 /* YYFINAL -- State number of the termination state. */
00317 #define YYFINAL  2
00318 /* YYLAST -- Last index in YYTABLE.  */
00319 #define YYLAST   201
00320 
00321 /* YYNTOKENS -- Number of terminals. */
00322 #define YYNTOKENS  42
00323 /* YYNNTS -- Number of nonterminals. */
00324 #define YYNNTS  41
00325 /* YYNRULES -- Number of rules. */
00326 #define YYNRULES  104
00327 /* YYNRULES -- Number of states. */
00328 #define YYNSTATES  182
00329 
00330 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
00331 #define YYUNDEFTOK  2
00332 #define YYMAXUTOK   296
00333 
00334 #define YYTRANSLATE(YYX)                        \
00335   ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
00336 
00337 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX.  */
00338 static const unsigned char yytranslate[] =
00339 {
00340        0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00341        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00342        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00343        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00344        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00345        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00346        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00347        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00348        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00349        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00350        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00351        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00352        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00353        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00354        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00355        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00356        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00357        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00358        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00359        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00360        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00361        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00362        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00363        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00364        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00365        2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
00366        5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
00367       15,    16,    17,    18,    19,    20,    21,    22,    23,    24,
00368       25,    26,    27,    28,    29,    30,    31,    32,    33,    34,
00369       35,    36,    37,    38,    39,    40,    41
00370 };
00371 
00372 #if YYDEBUG
00373 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
00374    YYRHS.  */
00375 static const unsigned short yyprhs[] =
00376 {
00377        0,     0,     3,     4,     7,     9,    11,    13,    17,    19,
00378       21,    23,    26,    28,    30,    32,    34,    36,    38,    42,
00379       45,    49,    52,    53,    56,    59,    62,    65,    69,    74,
00380       78,    83,    87,    91,    95,   100,   105,   110,   116,   119,
00381      122,   124,   128,   131,   132,   135,   138,   141,   144,   149,
00382      153,   157,   160,   165,   166,   169,   173,   175,   179,   182,
00383      183,   186,   189,   192,   196,   199,   201,   205,   208,   209,
00384      212,   215,   218,   222,   226,   228,   232,   235,   238,   241,
00385      242,   245,   248,   253,   257,   261,   262,   265,   267,   269,
00386      272,   275,   278,   280,   282,   283,   286,   288,   292,   296,
00387      300,   303,   307,   311,   313
00388 };
00389 
00390 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
00391 static const yysigned_char yyrhs[] =
00392 {
00393       43,     0,    -1,    -1,    43,    44,    -1,    45,    -1,    55,
00394       -1,    66,    -1,     3,    77,    79,    -1,     5,    -1,    15,
00395       -1,     8,    -1,     1,    79,    -1,    61,    -1,    71,    -1,
00396       47,    -1,    49,    -1,    69,    -1,    79,    -1,    10,    28,
00397       32,    -1,    46,    50,    -1,    11,    28,    32,    -1,    48,
00398       50,    -1,    -1,    50,    51,    -1,    50,    75,    -1,    50,
00399       73,    -1,    50,    32,    -1,    21,    76,    32,    -1,    22,
00400       81,    80,    32,    -1,    23,    76,    32,    -1,    24,    81,
00401       80,    32,    -1,    26,    76,    32,    -1,    27,    76,    32,
00402       -1,    25,    76,    32,    -1,    19,    77,    80,    32,    -1,
00403       20,    81,    80,    32,    -1,    36,    28,    80,    32,    -1,
00404       37,    82,    82,    80,    32,    -1,     7,    32,    -1,    52,
00405       56,    -1,    78,    -1,    53,    58,    54,    -1,    53,    58,
00406       -1,    -1,    56,    57,    -1,    56,    75,    -1,    56,    73,
00407       -1,    56,    32,    -1,    19,    77,    80,    32,    -1,    21,
00408       76,    32,    -1,    23,    76,    32,    -1,    18,    32,    -1,
00409       20,    28,    80,    32,    -1,    -1,    58,    45,    -1,    14,
00410       81,    32,    -1,    78,    -1,    59,    62,    60,    -1,    59,
00411       62,    -1,    -1,    62,    45,    -1,    62,    66,    -1,    62,
00412       55,    -1,     4,    77,    32,    -1,    63,    74,    -1,    78,
00413       -1,    64,    67,    65,    -1,    64,    67,    -1,    -1,    67,
00414       45,    -1,    67,    66,    -1,    67,    55,    -1,    67,     1,
00415       32,    -1,     6,    77,    32,    -1,    68,    -1,     9,    77,
00416       32,    -1,    70,    74,    -1,    12,    32,    -1,    72,    13,
00417       -1,    -1,    74,    75,    -1,    74,    32,    -1,    16,    35,
00418       81,    32,    -1,    16,    81,    32,    -1,    17,    81,    32,
00419       -1,    -1,    77,    80,    -1,    28,    -1,    29,    -1,     5,
00420       79,    -1,     8,    79,    -1,    15,    79,    -1,    32,    -1,
00421       31,    -1,    -1,    14,    81,    -1,    82,    -1,    82,    40,
00422       82,    -1,    82,    30,    82,    -1,    34,    81,    33,    -1,
00423       41,    81,    -1,    81,    38,    81,    -1,    81,    39,    81,
00424       -1,    28,    -1,    29,    -1
00425 };
00426 
00427 /* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
00428 static const unsigned short yyrline[] =
00429 {
00430        0,    94,    94,    95,    98,    99,   100,   101,   102,   103,
00431      104,   105,   109,   110,   111,   112,   113,   114,   120,   128,
00432      134,   142,   152,   154,   155,   156,   157,   160,   166,   173,
00433      179,   186,   192,   198,   204,   210,   216,   222,   230,   239,
00434      245,   254,   255,   261,   263,   264,   265,   266,   269,   275,
00435      281,   287,   293,   299,   301,   306,   315,   324,   325,   331,
00436      333,   334,   335,   340,   347,   353,   362,   363,   369,   371,
00437      372,   373,   374,   377,   383,   390,   397,   404,   410,   417,
00438      418,   419,   422,   427,   432,   440,   442,   447,   448,   451,
00439      452,   453,   457,   457,   459,   460,   463,   464,   465,   466,
00440      467,   468,   469,   472,   473
00441 };
00442 #endif
00443 
00444 #if YYDEBUG || YYERROR_VERBOSE
00445 /* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
00446    First, the terminals, then, starting at YYNTOKENS, nonterminals. */
00447 static const char *const yytname[] =
00448 {
00449   "$end", "error", "$undefined", "T_MAINMENU", "T_MENU", "T_ENDMENU", 
00450   "T_SOURCE", "T_CHOICE", "T_ENDCHOICE", "T_COMMENT", "T_CONFIG", 
00451   "T_MENUCONFIG", "T_HELP", "T_HELPTEXT", "T_IF", "T_ENDIF", "T_DEPENDS", 
00452   "T_REQUIRES", "T_OPTIONAL", "T_PROMPT", "T_DEFAULT", "T_TRISTATE", 
00453   "T_DEF_TRISTATE", "T_BOOLEAN", "T_DEF_BOOLEAN", "T_STRING", "T_INT", 
00454   "T_HEX", "T_WORD", "T_WORD_QUOTE", "T_UNEQUAL", "T_EOF", "T_EOL", 
00455   "T_CLOSE_PAREN", "T_OPEN_PAREN", "T_ON", "T_SELECT", "T_RANGE", "T_OR", 
00456   "T_AND", "T_EQUAL", "T_NOT", "$accept", "input", "block", 
00457   "common_block", "config_entry_start", "config_stmt", 
00458   "menuconfig_entry_start", "menuconfig_stmt", "config_option_list", 
00459   "config_option", "choice", "choice_entry", "choice_end", "choice_stmt", 
00460   "choice_option_list", "choice_option", "choice_block", "if", "if_end", 
00461   "if_stmt", "if_block", "menu", "menu_entry", "menu_end", "menu_stmt", 
00462   "menu_block", "source", "source_stmt", "comment", "comment_stmt", 
00463   "help_start", "help", "depends_list", "depends", "prompt_stmt_opt", 
00464   "prompt", "end", "nl_or_eof", "if_expr", "expr", "symbol", 0
00465 };
00466 #endif
00467 
00468 # ifdef YYPRINT
00469 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
00470    token YYLEX-NUM.  */
00471 static const unsigned short yytoknum[] =
00472 {
00473        0,   256,   257,   258,   259,   260,   261,   262,   263,   264,
00474      265,   266,   267,   268,   269,   270,   271,   272,   273,   274,
00475      275,   276,   277,   278,   279,   280,   281,   282,   283,   284,
00476      285,   286,   287,   288,   289,   290,   291,   292,   293,   294,
00477      295,   296
00478 };
00479 # endif
00480 
00481 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
00482 static const unsigned char yyr1[] =
00483 {
00484        0,    42,    43,    43,    44,    44,    44,    44,    44,    44,
00485       44,    44,    45,    45,    45,    45,    45,    45,    46,    47,
00486       48,    49,    50,    50,    50,    50,    50,    51,    51,    51,
00487       51,    51,    51,    51,    51,    51,    51,    51,    52,    53,
00488       54,    55,    55,    56,    56,    56,    56,    56,    57,    57,
00489       57,    57,    57,    58,    58,    59,    60,    61,    61,    62,
00490       62,    62,    62,    63,    64,    65,    66,    66,    67,    67,
00491       67,    67,    67,    68,    69,    70,    71,    72,    73,    74,
00492       74,    74,    75,    75,    75,    76,    76,    77,    77,    78,
00493       78,    78,    79,    79,    80,    80,    81,    81,    81,    81,
00494       81,    81,    81,    82,    82
00495 };
00496 
00497 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
00498 static const unsigned char yyr2[] =
00499 {
00500        0,     2,     0,     2,     1,     1,     1,     3,     1,     1,
00501        1,     2,     1,     1,     1,     1,     1,     1,     3,     2,
00502        3,     2,     0,     2,     2,     2,     2,     3,     4,     3,
00503        4,     3,     3,     3,     4,     4,     4,     5,     2,     2,
00504        1,     3,     2,     0,     2,     2,     2,     2,     4,     3,
00505        3,     2,     4,     0,     2,     3,     1,     3,     2,     0,
00506        2,     2,     2,     3,     2,     1,     3,     2,     0,     2,
00507        2,     2,     3,     3,     1,     3,     2,     2,     2,     0,
00508        2,     2,     4,     3,     3,     0,     2,     1,     1,     2,
00509        2,     2,     1,     1,     0,     2,     1,     3,     3,     3,
00510        2,     3,     3,     1,     1
00511 };
00512 
00513 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
00514    STATE-NUM when YYTABLE doesn't specify something else to do.  Zero
00515    means the default is an error.  */
00516 static const unsigned char yydefact[] =
00517 {
00518        2,     0,     1,     0,     0,     0,     8,     0,     0,    10,
00519        0,     0,     0,     0,     9,    93,    92,     3,     4,    22,
00520       14,    22,    15,    43,    53,     5,    59,    12,    79,    68,
00521        6,    74,    16,    79,    13,    17,    11,    87,    88,     0,
00522        0,     0,    38,     0,     0,     0,   103,   104,     0,     0,
00523        0,    96,    19,    21,    39,    42,    58,    64,     0,    76,
00524        7,    63,    73,    75,    18,    20,     0,   100,    55,     0,
00525        0,     0,     0,     0,     0,     0,     0,     0,    85,     0,
00526       85,     0,    85,    85,    85,    26,     0,     0,    23,     0,
00527       25,    24,     0,     0,     0,    85,    85,    47,    44,    46,
00528       45,     0,     0,     0,    54,    41,    40,    60,    62,    57,
00529       61,    56,    81,    80,     0,    69,    71,    66,    70,    65,
00530       99,   101,   102,    98,    97,    77,     0,     0,     0,    94,
00531       94,     0,    94,    94,     0,    94,     0,     0,     0,    94,
00532        0,    78,    51,    94,    94,     0,     0,    89,    90,    91,
00533       72,     0,    83,    84,     0,     0,     0,    27,    86,     0,
00534       29,     0,    33,    31,    32,     0,    94,     0,     0,    49,
00535       50,    82,    95,    34,    35,    28,    30,    36,     0,    48,
00536       52,    37
00537 };
00538 
00539 /* YYDEFGOTO[NTERM-NUM]. */
00540 static const short yydefgoto[] =
00541 {
00542       -1,     1,    17,    18,    19,    20,    21,    22,    52,    88,
00543       23,    24,   105,    25,    54,    98,    55,    26,   109,    27,
00544       56,    28,    29,   117,    30,    58,    31,    32,    33,    34,
00545       89,    90,    57,    91,   131,   132,   106,    35,   155,    50,
00546       51
00547 };
00548 
00549 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
00550    STATE-NUM.  */
00551 #define YYPACT_NINF -99
00552 static const short yypact[] =
00553 {
00554      -99,    48,   -99,    38,    46,    46,   -99,    46,   -29,   -99,
00555       46,   -17,    -3,   -11,   -99,   -99,   -99,   -99,   -99,   -99,
00556      -99,   -99,   -99,   -99,   -99,   -99,   -99,   -99,   -99,   -99,
00557      -99,   -99,   -99,   -99,   -99,   -99,   -99,   -99,   -99,    38,
00558       12,    15,   -99,    18,    51,    62,   -99,   -99,   -11,   -11,
00559        4,   -24,   138,   138,   160,   121,   110,    -4,    81,    -4,
00560      -99,   -99,   -99,   -99,   -99,   -99,   -19,   -99,   -99,   -11,
00561      -11,    70,    70,    73,    32,   -11,    46,   -11,    46,   -11,
00562       46,   -11,    46,    46,    46,   -99,    36,    70,   -99,    95,
00563      -99,   -99,    96,    46,   106,    46,    46,   -99,   -99,   -99,
00564      -99,    38,    38,    38,   -99,   -99,   -99,   -99,   -99,   -99,
00565      -99,   -99,   -99,   -99,   112,   -99,   -99,   -99,   -99,   -99,
00566      -99,   117,   -99,   -99,   -99,   -99,   -11,    33,    65,   131,
00567        1,   119,   131,     1,   136,     1,   153,   154,   155,   131,
00568       70,   -99,   -99,   131,   131,   156,   157,   -99,   -99,   -99,
00569      -99,   101,   -99,   -99,   -11,   158,   159,   -99,   -99,   161,
00570      -99,   162,   -99,   -99,   -99,   163,   131,   164,   165,   -99,
00571      -99,   -99,    99,   -99,   -99,   -99,   -99,   -99,   166,   -99,
00572      -99,   -99
00573 };
00574 
00575 /* YYPGOTO[NTERM-NUM].  */
00576 static const short yypgoto[] =
00577 {
00578      -99,   -99,   -99,   111,   -99,   -99,   -99,   -99,   178,   -99,
00579      -99,   -99,   -99,    91,   -99,   -99,   -99,   -99,   -99,   -99,
00580      -99,   -99,   -99,   -99,   115,   -99,   -99,   -99,   -99,   -99,
00581      -99,   146,   168,    89,    27,     0,   126,    -1,   -98,   -48,
00582      -63
00583 };
00584 
00585 /* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
00586    positive, shift that token.  If negative, reduce the rule which
00587    number is the opposite.  If zero, do what YYDEFACT says.
00588    If YYTABLE_NINF, syntax error.  */
00589 #define YYTABLE_NINF -68
00590 static const short yytable[] =
00591 {
00592       66,    67,    36,    42,    39,    40,    71,    41,   123,   124,
00593       43,    44,    74,    75,   120,   154,    72,    46,    47,    69,
00594       70,   121,   122,    48,   140,    45,   127,   128,   112,   130,
00595       49,   133,   156,   135,   158,   159,    68,   161,    60,    69,
00596       70,   165,    69,    70,    61,   167,   168,    62,     2,     3,
00597       63,     4,     5,     6,     7,     8,     9,    10,    11,    12,
00598       46,    47,    13,    14,   139,   152,    48,   126,   178,    15,
00599       16,    69,    70,    49,    37,    38,   129,   166,   151,    15,
00600       16,   -67,   114,    64,   -67,     5,   101,     7,     8,   102,
00601       10,    11,    12,   143,    65,    13,   103,   153,    46,    47,
00602      147,   148,   149,    69,    70,   125,   172,   134,   141,   136,
00603      137,   138,    15,    16,     5,   101,     7,     8,   102,    10,
00604       11,    12,   145,   146,    13,   103,   101,     7,   142,   102,
00605       10,    11,    12,   171,   144,    13,   103,    69,    70,    69,
00606       70,    15,    16,   100,   150,   154,   113,   108,   113,   116,
00607       73,   157,    15,    16,    74,    75,    70,    76,    77,    78,
00608       79,    80,    81,    82,    83,    84,   104,   107,   160,   115,
00609       85,   110,    73,   118,    86,    87,    74,    75,    92,    93,
00610       94,    95,   111,    96,   119,   162,   163,   164,   169,   170,
00611      173,   174,    97,   175,   176,   177,   179,   180,   181,    53,
00612       99,    59
00613 };
00614 
00615 static const unsigned char yycheck[] =
00616 {
00617       48,    49,     3,    32,     4,     5,    30,     7,    71,    72,
00618       10,    28,    16,    17,    33,    14,    40,    28,    29,    38,
00619       39,    69,    70,    34,    87,    28,    74,    75,    32,    77,
00620       41,    79,   130,    81,   132,   133,    32,   135,    39,    38,
00621       39,   139,    38,    39,    32,   143,   144,    32,     0,     1,
00622       32,     3,     4,     5,     6,     7,     8,     9,    10,    11,
00623       28,    29,    14,    15,    28,    32,    34,    35,   166,    31,
00624       32,    38,    39,    41,    28,    29,    76,   140,   126,    31,
00625       32,     0,     1,    32,     3,     4,     5,     6,     7,     8,
00626        9,    10,    11,    93,    32,    14,    15,    32,    28,    29,
00627      101,   102,   103,    38,    39,    32,   154,    80,    13,    82,
00628       83,    84,    31,    32,     4,     5,     6,     7,     8,     9,
00629       10,    11,    95,    96,    14,    15,     5,     6,    32,     8,
00630        9,    10,    11,    32,    28,    14,    15,    38,    39,    38,
00631       39,    31,    32,    54,    32,    14,    57,    56,    59,    58,
00632       12,    32,    31,    32,    16,    17,    39,    19,    20,    21,
00633       22,    23,    24,    25,    26,    27,    55,    56,    32,    58,
00634       32,    56,    12,    58,    36,    37,    16,    17,    18,    19,
00635       20,    21,    56,    23,    58,    32,    32,    32,    32,    32,
00636       32,    32,    32,    32,    32,    32,    32,    32,    32,    21,
00637       54,    33
00638 };
00639 
00640 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
00641    symbol of state STATE-NUM.  */
00642 static const unsigned char yystos[] =
00643 {
00644        0,    43,     0,     1,     3,     4,     5,     6,     7,     8,
00645        9,    10,    11,    14,    15,    31,    32,    44,    45,    46,
00646       47,    48,    49,    52,    53,    55,    59,    61,    63,    64,
00647       66,    68,    69,    70,    71,    79,    79,    28,    29,    77,
00648       77,    77,    32,    77,    28,    28,    28,    29,    34,    41,
00649       81,    82,    50,    50,    56,    58,    62,    74,    67,    74,
00650       79,    32,    32,    32,    32,    32,    81,    81,    32,    38,
00651       39,    30,    40,    12,    16,    17,    19,    20,    21,    22,
00652       23,    24,    25,    26,    27,    32,    36,    37,    51,    72,
00653       73,    75,    18,    19,    20,    21,    23,    32,    57,    73,
00654       75,     5,     8,    15,    45,    54,    78,    45,    55,    60,
00655       66,    78,    32,    75,     1,    45,    55,    65,    66,    78,
00656       33,    81,    81,    82,    82,    32,    35,    81,    81,    77,
00657       81,    76,    77,    81,    76,    81,    76,    76,    76,    28,
00658       82,    13,    32,    77,    28,    76,    76,    79,    79,    79,
00659       32,    81,    32,    32,    14,    80,    80,    32,    80,    80,
00660       32,    80,    32,    32,    32,    80,    82,    80,    80,    32,
00661       32,    32,    81,    32,    32,    32,    32,    32,    80,    32,
00662       32,    32
00663 };
00664 
00665 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
00666 # define YYSIZE_T __SIZE_TYPE__
00667 #endif
00668 #if ! defined (YYSIZE_T) && defined (size_t)
00669 # define YYSIZE_T size_t
00670 #endif
00671 #if ! defined (YYSIZE_T)
00672 # if defined (__STDC__) || defined (__cplusplus)
00673 #  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
00674 #  define YYSIZE_T size_t
00675 # endif
00676 #endif
00677 #if ! defined (YYSIZE_T)
00678 # define YYSIZE_T unsigned int
00679 #endif
00680 
00681 #define yyerrok     (yyerrstatus = 0)
00682 #define yyclearin   (yychar = YYEMPTY)
00683 #define YYEMPTY     (-2)
00684 #define YYEOF       0
00685 
00686 #define YYACCEPT    goto yyacceptlab
00687 #define YYABORT     goto yyabortlab
00688 #define YYERROR     goto yyerrlab1
00689 
00690 
00691 /* Like YYERROR except do call yyerror.  This remains here temporarily
00692    to ease the transition to the new meaning of YYERROR, for GCC.
00693    Once GCC version 2 has supplanted version 1, this can go.  */
00694 
00695 #define YYFAIL      goto yyerrlab
00696 
00697 #define YYRECOVERING()  (!!yyerrstatus)
00698 
00699 #define YYBACKUP(Token, Value)                  \
00700 do                              \
00701   if (yychar == YYEMPTY && yylen == 1)              \
00702     {                               \
00703       yychar = (Token);                     \
00704       yylval = (Value);                     \
00705       yytoken = YYTRANSLATE (yychar);               \
00706       YYPOPSTACK;                       \
00707       goto yybackup;                        \
00708     }                               \
00709   else                              \
00710     {                               \
00711       yyerror ("syntax error: cannot back up");\
00712       YYERROR;                          \
00713     }                               \
00714 while (0)
00715 
00716 #define YYTERROR    1
00717 #define YYERRCODE   256
00718 
00719 /* YYLLOC_DEFAULT -- Compute the default location (before the actions
00720    are run).  */
00721 
00722 #ifndef YYLLOC_DEFAULT
00723 # define YYLLOC_DEFAULT(Current, Rhs, N)         \
00724   Current.first_line   = Rhs[1].first_line;      \
00725   Current.first_column = Rhs[1].first_column;    \
00726   Current.last_line    = Rhs[N].last_line;       \
00727   Current.last_column  = Rhs[N].last_column;
00728 #endif
00729 
00730 /* YYLEX -- calling `yylex' with the right arguments.  */
00731 
00732 #ifdef YYLEX_PARAM
00733 # define YYLEX yylex (YYLEX_PARAM)
00734 #else
00735 # define YYLEX yylex ()
00736 #endif
00737 
00738 /* Enable debugging if requested.  */
00739 #if YYDEBUG
00740 
00741 # ifndef YYFPRINTF
00742 #  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
00743 #  define YYFPRINTF fprintf
00744 # endif
00745 
00746 # define YYDPRINTF(Args)            \
00747 do {                        \
00748   if (yydebug)                  \
00749     YYFPRINTF Args;             \
00750 } while (0)
00751 
00752 # define YYDSYMPRINT(Args)          \
00753 do {                        \
00754   if (yydebug)                  \
00755     yysymprint Args;                \
00756 } while (0)
00757 
00758 # define YYDSYMPRINTF(Title, Token, Value, Location)        \
00759 do {                                \
00760   if (yydebug)                          \
00761     {                               \
00762       YYFPRINTF (stderr, "%s ", Title);             \
00763       yysymprint (stderr,                   \
00764                   Token, Value);    \
00765       YYFPRINTF (stderr, "\n");                 \
00766     }                               \
00767 } while (0)
00768 
00769 /*------------------------------------------------------------------.
00770 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
00771 | TOP (cinluded).                                                   |
00772 `------------------------------------------------------------------*/
00773 
00774 #if defined (__STDC__) || defined (__cplusplus)
00775 static void
00776 yy_stack_print (short *bottom, short *top)
00777 #else
00778 static void
00779 yy_stack_print (bottom, top)
00780     short *bottom;
00781     short *top;
00782 #endif
00783 {
00784   YYFPRINTF (stderr, "Stack now");
00785   for (/* Nothing. */; bottom <= top; ++bottom)
00786     YYFPRINTF (stderr, " %d", *bottom);
00787   YYFPRINTF (stderr, "\n");
00788 }
00789 
00790 # define YY_STACK_PRINT(Bottom, Top)                \
00791 do {                                \
00792   if (yydebug)                          \
00793     yy_stack_print ((Bottom), (Top));               \
00794 } while (0)
00795 
00796 
00797 /*------------------------------------------------.
00798 | Report that the YYRULE is going to be reduced.  |
00799 `------------------------------------------------*/
00800 
00801 #if defined (__STDC__) || defined (__cplusplus)
00802 static void
00803 yy_reduce_print (int yyrule)
00804 #else
00805 static void
00806 yy_reduce_print (yyrule)
00807     int yyrule;
00808 #endif
00809 {
00810   int yyi;
00811   unsigned int yylineno = yyrline[yyrule];
00812   YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ",
00813              yyrule - 1, yylineno);
00814   /* Print the symbols being reduced, and their result.  */
00815   for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
00816     YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]);
00817   YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]);
00818 }
00819 
00820 # define YY_REDUCE_PRINT(Rule)      \
00821 do {                    \
00822   if (yydebug)              \
00823     yy_reduce_print (Rule);     \
00824 } while (0)
00825 
00826 /* Nonzero means print parse trace.  It is left uninitialized so that
00827    multiple parsers can coexist.  */
00828 int yydebug;
00829 #else /* !YYDEBUG */
00830 # define YYDPRINTF(Args)
00831 # define YYDSYMPRINT(Args)
00832 # define YYDSYMPRINTF(Title, Token, Value, Location)
00833 # define YY_STACK_PRINT(Bottom, Top)
00834 # define YY_REDUCE_PRINT(Rule)
00835 #endif /* !YYDEBUG */
00836 
00837 
00838 /* YYINITDEPTH -- initial size of the parser's stacks.  */
00839 #ifndef YYINITDEPTH
00840 # define YYINITDEPTH 200
00841 #endif
00842 
00843 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
00844    if the built-in stack extension method is used).
00845 
00846    Do not make this value too large; the results are undefined if
00847    SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
00848    evaluated with infinite-precision integer arithmetic.  */
00849 
00850 #if YYMAXDEPTH == 0
00851 # undef YYMAXDEPTH
00852 #endif
00853 
00854 #ifndef YYMAXDEPTH
00855 # define YYMAXDEPTH 10000
00856 #endif
00857 
00858 
00859 
00860 #if YYERROR_VERBOSE
00861 
00862 # ifndef yystrlen
00863 #  if defined (__GLIBC__) && defined (_STRING_H)
00864 #   define yystrlen strlen
00865 #  else
00866 /* Return the length of YYSTR.  */
00867 static YYSIZE_T
00868 #   if defined (__STDC__) || defined (__cplusplus)
00869 yystrlen (const char *yystr)
00870 #   else
00871 yystrlen (yystr)
00872      const char *yystr;
00873 #   endif
00874 {
00875   register const char *yys = yystr;
00876 
00877   while (*yys++ != '\0')
00878     continue;
00879 
00880   return yys - yystr - 1;
00881 }
00882 #  endif
00883 # endif
00884 
00885 # ifndef yystpcpy
00886 #  if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
00887 #   define yystpcpy stpcpy
00888 #  else
00889 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
00890    YYDEST.  */
00891 static char *
00892 #   if defined (__STDC__) || defined (__cplusplus)
00893 yystpcpy (char *yydest, const char *yysrc)
00894 #   else
00895 yystpcpy (yydest, yysrc)
00896      char *yydest;
00897      const char *yysrc;
00898 #   endif
00899 {
00900   register char *yyd = yydest;
00901   register const char *yys = yysrc;
00902 
00903   while ((*yyd++ = *yys++) != '\0')
00904     continue;
00905 
00906   return yyd - 1;
00907 }
00908 #  endif
00909 # endif
00910 
00911 #endif /* !YYERROR_VERBOSE */
00912 
00913 
00914 
00915 #if YYDEBUG
00916 /*--------------------------------.
00917 | Print this symbol on YYOUTPUT.  |
00918 `--------------------------------*/
00919 
00920 #if defined (__STDC__) || defined (__cplusplus)
00921 static void
00922 yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
00923 #else
00924 static void
00925 yysymprint (yyoutput, yytype, yyvaluep)
00926     FILE *yyoutput;
00927     int yytype;
00928     YYSTYPE *yyvaluep;
00929 #endif
00930 {
00931   /* Pacify ``unused variable'' warnings.  */
00932   (void) yyvaluep;
00933 
00934   if (yytype < YYNTOKENS)
00935     {
00936       YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
00937 # ifdef YYPRINT
00938       YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
00939 # endif
00940     }
00941   else
00942     YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
00943 
00944   switch (yytype)
00945     {
00946       default:
00947         break;
00948     }
00949   YYFPRINTF (yyoutput, ")");
00950 }
00951 
00952 #endif /* ! YYDEBUG */
00953 /*-----------------------------------------------.
00954 | Release the memory associated to this symbol.  |
00955 `-----------------------------------------------*/
00956 
00957 #if defined (__STDC__) || defined (__cplusplus)
00958 static void
00959 yydestruct (int yytype, YYSTYPE *yyvaluep)
00960 #else
00961 static void
00962 yydestruct (yytype, yyvaluep)
00963     int yytype;
00964     YYSTYPE *yyvaluep;
00965 #endif
00966 {
00967   /* Pacify ``unused variable'' warnings.  */
00968   (void) yyvaluep;
00969 
00970   switch (yytype)
00971     {
00972 
00973       default:
00974         break;
00975     }
00976 }
00977 
00978 
00979 /* Prevent warnings from -Wmissing-prototypes.  */
00980 
00981 #ifdef YYPARSE_PARAM
00982 # if defined (__STDC__) || defined (__cplusplus)
00983 int yyparse (void *YYPARSE_PARAM);
00984 # else
00985 int yyparse ();
00986 # endif
00987 #else /* ! YYPARSE_PARAM */
00988 #if defined (__STDC__) || defined (__cplusplus)
00989 int yyparse (void);
00990 #else
00991 int yyparse ();
00992 #endif
00993 #endif /* ! YYPARSE_PARAM */
00994 
00995 
00996 
00997 /* The lookahead symbol.  */
00998 int yychar;
00999 
01000 /* The semantic value of the lookahead symbol.  */
01001 YYSTYPE yylval;
01002 
01003 /* Number of syntax errors so far.  */
01004 int yynerrs;
01005 
01006 
01007 
01008 /*----------.
01009 | yyparse.  |
01010 `----------*/
01011 
01012 #ifdef YYPARSE_PARAM
01013 # if defined (__STDC__) || defined (__cplusplus)
01014 int yyparse (void *YYPARSE_PARAM)
01015 # else
01016 int yyparse (YYPARSE_PARAM)
01017   void *YYPARSE_PARAM;
01018 # endif
01019 #else /* ! YYPARSE_PARAM */
01020 #if defined (__STDC__) || defined (__cplusplus)
01021 int
01022 yyparse (void)
01023 #else
01024 int
01025 yyparse ()
01026 
01027 #endif
01028 #endif
01029 {
01030   
01031   register int yystate;
01032   register int yyn;
01033   int yyresult;
01034   /* Number of tokens to shift before error messages enabled.  */
01035   int yyerrstatus;
01036   /* Lookahead token as an internal (translated) token number.  */
01037   int yytoken = 0;
01038 
01039   /* Three stacks and their tools:
01040      `yyss': related to states,
01041      `yyvs': related to semantic values,
01042      `yyls': related to locations.
01043 
01044      Refer to the stacks thru separate pointers, to allow yyoverflow
01045      to reallocate them elsewhere.  */
01046 
01047   /* The state stack.  */
01048   short yyssa[YYINITDEPTH];
01049   short *yyss = yyssa;
01050   register short *yyssp;
01051 
01052   /* The semantic value stack.  */
01053   YYSTYPE yyvsa[YYINITDEPTH];
01054   YYSTYPE *yyvs = yyvsa;
01055   register YYSTYPE *yyvsp;
01056 
01057 
01058 
01059 #define YYPOPSTACK   (yyvsp--, yyssp--)
01060 
01061   YYSIZE_T yystacksize = YYINITDEPTH;
01062 
01063   /* The variables used to return semantic value and location from the
01064      action routines.  */
01065   YYSTYPE yyval;
01066 
01067 
01068   /* When reducing, the number of symbols on the RHS of the reduced
01069      rule.  */
01070   int yylen;
01071 
01072   YYDPRINTF ((stderr, "Starting parse\n"));
01073 
01074   yystate = 0;
01075   yyerrstatus = 0;
01076   yynerrs = 0;
01077   yychar = YYEMPTY;     /* Cause a token to be read.  */
01078 
01079   /* Initialize stack pointers.
01080      Waste one element of value and location stack
01081      so that they stay on the same level as the state stack.
01082      The wasted elements are never initialized.  */
01083 
01084   yyssp = yyss;
01085   yyvsp = yyvs;
01086 
01087   goto yysetstate;
01088 
01089 /*------------------------------------------------------------.
01090 | yynewstate -- Push a new state, which is found in yystate.  |
01091 `------------------------------------------------------------*/
01092  yynewstate:
01093   /* In all cases, when you get here, the value and location stacks
01094      have just been pushed. so pushing a state here evens the stacks.
01095      */
01096   yyssp++;
01097 
01098  yysetstate:
01099   *yyssp = yystate;
01100 
01101   if (yyss + yystacksize - 1 <= yyssp)
01102     {
01103       /* Get the current used size of the three stacks, in elements.  */
01104       YYSIZE_T yysize = yyssp - yyss + 1;
01105 
01106 #ifdef yyoverflow
01107       {
01108     /* Give user a chance to reallocate the stack. Use copies of
01109        these so that the &'s don't force the real ones into
01110        memory.  */
01111     YYSTYPE *yyvs1 = yyvs;
01112     short *yyss1 = yyss;
01113 
01114 
01115     /* Each stack pointer address is followed by the size of the
01116        data in use in that stack, in bytes.  This used to be a
01117        conditional around just the two extra args, but that might
01118        be undefined if yyoverflow is a macro.  */
01119     yyoverflow ("parser stack overflow",
01120             &yyss1, yysize * sizeof (*yyssp),
01121             &yyvs1, yysize * sizeof (*yyvsp),
01122 
01123             &yystacksize);
01124 
01125     yyss = yyss1;
01126     yyvs = yyvs1;
01127       }
01128 #else /* no yyoverflow */
01129 # ifndef YYSTACK_RELOCATE
01130       goto yyoverflowlab;
01131 # else
01132       /* Extend the stack our own way.  */
01133       if (YYMAXDEPTH <= yystacksize)
01134     goto yyoverflowlab;
01135       yystacksize *= 2;
01136       if (YYMAXDEPTH < yystacksize)
01137     yystacksize = YYMAXDEPTH;
01138 
01139       {
01140     short *yyss1 = yyss;
01141     union yyalloc *yyptr =
01142       (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
01143     if (! yyptr)
01144       goto yyoverflowlab;
01145     YYSTACK_RELOCATE (yyss);
01146     YYSTACK_RELOCATE (yyvs);
01147 
01148 #  undef YYSTACK_RELOCATE
01149     if (yyss1 != yyssa)
01150       YYSTACK_FREE (yyss1);
01151       }
01152 # endif
01153 #endif /* no yyoverflow */
01154 
01155       yyssp = yyss + yysize - 1;
01156       yyvsp = yyvs + yysize - 1;
01157 
01158 
01159       YYDPRINTF ((stderr, "Stack size increased to %lu\n",
01160           (unsigned long int) yystacksize));
01161 
01162       if (yyss + yystacksize - 1 <= yyssp)
01163     YYABORT;
01164     }
01165 
01166   YYDPRINTF ((stderr, "Entering state %d\n", yystate));
01167 
01168   goto yybackup;
01169 
01170 /*-----------.
01171 | yybackup.  |
01172 `-----------*/
01173 yybackup:
01174 
01175 /* Do appropriate processing given the current state.  */
01176 /* Read a lookahead token if we need one and don't already have one.  */
01177 /* yyresume: */
01178 
01179   /* First try to decide what to do without reference to lookahead token.  */
01180 
01181   yyn = yypact[yystate];
01182   if (yyn == YYPACT_NINF)
01183     goto yydefault;
01184 
01185   /* Not known => get a lookahead token if don't already have one.  */
01186 
01187   /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol.  */
01188   if (yychar == YYEMPTY)
01189     {
01190       YYDPRINTF ((stderr, "Reading a token: "));
01191       yychar = YYLEX;
01192     }
01193 
01194   if (yychar <= YYEOF)
01195     {
01196       yychar = yytoken = YYEOF;
01197       YYDPRINTF ((stderr, "Now at end of input.\n"));
01198     }
01199   else
01200     {
01201       yytoken = YYTRANSLATE (yychar);
01202       YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc);
01203     }
01204 
01205   /* If the proper action on seeing token YYTOKEN is to reduce or to
01206      detect an error, take that action.  */
01207   yyn += yytoken;
01208   if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
01209     goto yydefault;
01210   yyn = yytable[yyn];
01211   if (yyn <= 0)
01212     {
01213       if (yyn == 0 || yyn == YYTABLE_NINF)
01214     goto yyerrlab;
01215       yyn = -yyn;
01216       goto yyreduce;
01217     }
01218 
01219   if (yyn == YYFINAL)
01220     YYACCEPT;
01221 
01222   /* Shift the lookahead token.  */
01223   YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken]));
01224 
01225   /* Discard the token being shifted unless it is eof.  */
01226   if (yychar != YYEOF)
01227     yychar = YYEMPTY;
01228 
01229   *++yyvsp = yylval;
01230 
01231 
01232   /* Count tokens shifted since error; after three, turn off error
01233      status.  */
01234   if (yyerrstatus)
01235     yyerrstatus--;
01236 
01237   yystate = yyn;
01238   goto yynewstate;
01239 
01240 
01241 /*-----------------------------------------------------------.
01242 | yydefault -- do the default action for the current state.  |
01243 `-----------------------------------------------------------*/
01244 yydefault:
01245   yyn = yydefact[yystate];
01246   if (yyn == 0)
01247     goto yyerrlab;
01248   goto yyreduce;
01249 
01250 
01251 /*-----------------------------.
01252 | yyreduce -- Do a reduction.  |
01253 `-----------------------------*/
01254 yyreduce:
01255   /* yyn is the number of a rule to reduce with.  */
01256   yylen = yyr2[yyn];
01257 
01258   /* If YYLEN is nonzero, implement the default value of the action:
01259      `$$ = $1'.
01260 
01261      Otherwise, the following line sets YYVAL to garbage.
01262      This behavior is undocumented and Bison
01263      users should not rely upon it.  Assigning to YYVAL
01264      unconditionally makes the parser a bit smaller, and it avoids a
01265      GCC warning that YYVAL may be used uninitialized.  */
01266   yyval = yyvsp[1-yylen];
01267 
01268 
01269   YY_REDUCE_PRINT (yyn);
01270   switch (yyn)
01271     {
01272         case 8:
01273 
01274     { zconfprint("unexpected 'endmenu' statement"); ;}
01275     break;
01276 
01277   case 9:
01278 
01279     { zconfprint("unexpected 'endif' statement"); ;}
01280     break;
01281 
01282   case 10:
01283 
01284     { zconfprint("unexpected 'endchoice' statement"); ;}
01285     break;
01286 
01287   case 11:
01288 
01289     { zconfprint("syntax error"); yyerrok; ;}
01290     break;
01291 
01292   case 18:
01293 
01294     {
01295     struct symbol *sym = sym_lookup(yyvsp[-1].string, 0);
01296     sym->flags |= SYMBOL_OPTIONAL;
01297     menu_add_entry(sym);
01298     printd(DEBUG_PARSE, "%s:%d:config %s\n", zconf_curname(), zconf_lineno(), yyvsp[-1].string);
01299 ;}
01300     break;
01301 
01302   case 19:
01303 
01304     {
01305     menu_end_entry();
01306     printd(DEBUG_PARSE, "%s:%d:endconfig\n", zconf_curname(), zconf_lineno());
01307 ;}
01308     break;
01309 
01310   case 20:
01311 
01312     {
01313     struct symbol *sym = sym_lookup(yyvsp[-1].string, 0);
01314     sym->flags |= SYMBOL_OPTIONAL;
01315     menu_add_entry(sym);
01316     printd(DEBUG_PARSE, "%s:%d:menuconfig %s\n", zconf_curname(), zconf_lineno(), yyvsp[-1].string);
01317 ;}
01318     break;
01319 
01320   case 21:
01321 
01322     {
01323     if (current_entry->prompt)
01324         current_entry->prompt->type = P_MENU;
01325     else
01326         zconfprint("warning: menuconfig statement without prompt");
01327     menu_end_entry();
01328     printd(DEBUG_PARSE, "%s:%d:endconfig\n", zconf_curname(), zconf_lineno());
01329 ;}
01330     break;
01331 
01332   case 27:
01333 
01334     {
01335     menu_set_type(S_TRISTATE);
01336     printd(DEBUG_PARSE, "%s:%d:tristate\n", zconf_curname(), zconf_lineno());
01337 ;}
01338     break;
01339 
01340   case 28:
01341 
01342     {
01343     menu_add_expr(P_DEFAULT, yyvsp[-2].expr, yyvsp[-1].expr);
01344     menu_set_type(S_TRISTATE);
01345     printd(DEBUG_PARSE, "%s:%d:def_boolean\n", zconf_curname(), zconf_lineno());
01346 ;}
01347     break;
01348 
01349   case 29:
01350 
01351     {
01352     menu_set_type(S_BOOLEAN);
01353     printd(DEBUG_PARSE, "%s:%d:boolean\n", zconf_curname(), zconf_lineno());
01354 ;}
01355     break;
01356 
01357   case 30:
01358 
01359     {
01360     menu_add_expr(P_DEFAULT, yyvsp[-2].expr, yyvsp[-1].expr);
01361     menu_set_type(S_BOOLEAN);
01362     printd(DEBUG_PARSE, "%s:%d:def_boolean\n", zconf_curname(), zconf_lineno());
01363 ;}
01364     break;
01365 
01366   case 31:
01367 
01368     {
01369     menu_set_type(S_INT);
01370     printd(DEBUG_PARSE, "%s:%d:int\n", zconf_curname(), zconf_lineno());
01371 ;}
01372     break;
01373 
01374   case 32:
01375 
01376     {
01377     menu_set_type(S_HEX);
01378     printd(DEBUG_PARSE, "%s:%d:hex\n", zconf_curname(), zconf_lineno());
01379 ;}
01380     break;
01381 
01382   case 33:
01383 
01384     {
01385     menu_set_type(S_STRING);
01386     printd(DEBUG_PARSE, "%s:%d:string\n", zconf_curname(), zconf_lineno());
01387 ;}
01388     break;
01389 
01390   case 34:
01391 
01392     {
01393     menu_add_prompt(P_PROMPT, yyvsp[-2].string, yyvsp[-1].expr);
01394     printd(DEBUG_PARSE, "%s:%d:prompt\n", zconf_curname(), zconf_lineno());
01395 ;}
01396     break;
01397 
01398   case 35:
01399 
01400     {
01401     menu_add_expr(P_DEFAULT, yyvsp[-2].expr, yyvsp[-1].expr);
01402     printd(DEBUG_PARSE, "%s:%d:default\n", zconf_curname(), zconf_lineno());
01403 ;}
01404     break;
01405 
01406   case 36:
01407 
01408     {
01409     menu_add_symbol(P_SELECT, sym_lookup(yyvsp[-2].string, 0), yyvsp[-1].expr);
01410     printd(DEBUG_PARSE, "%s:%d:select\n", zconf_curname(), zconf_lineno());
01411 ;}
01412     break;
01413 
01414   case 37:
01415 
01416     {
01417     menu_add_expr(P_RANGE, expr_alloc_comp(E_RANGE,yyvsp[-3].symbol, yyvsp[-2].symbol), yyvsp[-1].expr);
01418     printd(DEBUG_PARSE, "%s:%d:range\n", zconf_curname(), zconf_lineno());
01419 ;}
01420     break;
01421 
01422   case 38:
01423 
01424     {
01425     struct symbol *sym = sym_lookup(NULL, 0);
01426     sym->flags |= SYMBOL_CHOICE;
01427     menu_add_entry(sym);
01428     menu_add_expr(P_CHOICE, NULL, NULL);
01429     printd(DEBUG_PARSE, "%s:%d:choice\n", zconf_curname(), zconf_lineno());
01430 ;}
01431     break;
01432 
01433   case 39:
01434 
01435     {
01436     menu_end_entry();
01437     menu_add_menu();
01438 ;}
01439     break;
01440 
01441   case 40:
01442 
01443     {
01444     if (zconf_endtoken(yyvsp[0].token, T_CHOICE, T_ENDCHOICE)) {
01445         menu_end_menu();
01446         printd(DEBUG_PARSE, "%s:%d:endchoice\n", zconf_curname(), zconf_lineno());
01447     }
01448 ;}
01449     break;
01450 
01451   case 42:
01452 
01453     {
01454     printf("%s:%d: missing 'endchoice' for this 'choice' statement\n", current_menu->file->name, current_menu->lineno);
01455     zconfnerrs++;
01456 ;}
01457     break;
01458 
01459   case 48:
01460 
01461     {
01462     menu_add_prompt(P_PROMPT, yyvsp[-2].string, yyvsp[-1].expr);
01463     printd(DEBUG_PARSE, "%s:%d:prompt\n", zconf_curname(), zconf_lineno());
01464 ;}
01465     break;
01466 
01467   case 49:
01468 
01469     {
01470     menu_set_type(S_TRISTATE);
01471     printd(DEBUG_PARSE, "%s:%d:tristate\n", zconf_curname(), zconf_lineno());
01472 ;}
01473     break;
01474 
01475   case 50:
01476 
01477     {
01478     menu_set_type(S_BOOLEAN);
01479     printd(DEBUG_PARSE, "%s:%d:boolean\n", zconf_curname(), zconf_lineno());
01480 ;}
01481     break;
01482 
01483   case 51:
01484 
01485     {
01486     current_entry->sym->flags |= SYMBOL_OPTIONAL;
01487     printd(DEBUG_PARSE, "%s:%d:optional\n", zconf_curname(), zconf_lineno());
01488 ;}
01489     break;
01490 
01491   case 52:
01492 
01493     {
01494     menu_add_symbol(P_DEFAULT, sym_lookup(yyvsp[-2].string, 0), yyvsp[-1].expr);
01495     printd(DEBUG_PARSE, "%s:%d:default\n", zconf_curname(), zconf_lineno());
01496 ;}
01497     break;
01498 
01499   case 55:
01500 
01501     {
01502     printd(DEBUG_PARSE, "%s:%d:if\n", zconf_curname(), zconf_lineno());
01503     menu_add_entry(NULL);
01504     menu_add_dep(yyvsp[-1].expr);
01505     menu_end_entry();
01506     menu_add_menu();
01507 ;}
01508     break;
01509 
01510   case 56:
01511 
01512     {
01513     if (zconf_endtoken(yyvsp[0].token, T_IF, T_ENDIF)) {
01514         menu_end_menu();
01515         printd(DEBUG_PARSE, "%s:%d:endif\n", zconf_curname(), zconf_lineno());
01516     }
01517 ;}
01518     break;
01519 
01520   case 58:
01521 
01522     {
01523     printf("%s:%d: missing 'endif' for this 'if' statement\n", current_menu->file->name, current_menu->lineno);
01524     zconfnerrs++;
01525 ;}
01526     break;
01527 
01528   case 63:
01529 
01530     {
01531     menu_add_entry(NULL);
01532     menu_add_prop(P_MENU, yyvsp[-1].string, NULL, NULL);
01533     printd(DEBUG_PARSE, "%s:%d:menu\n", zconf_curname(), zconf_lineno());
01534 ;}
01535     break;
01536 
01537   case 64:
01538 
01539     {
01540     menu_end_entry();
01541     menu_add_menu();
01542 ;}
01543     break;
01544 
01545   case 65:
01546 
01547     {
01548     if (zconf_endtoken(yyvsp[0].token, T_MENU, T_ENDMENU)) {
01549         menu_end_menu();
01550         printd(DEBUG_PARSE, "%s:%d:endmenu\n", zconf_curname(), zconf_lineno());
01551     }
01552 ;}
01553     break;
01554 
01555   case 67:
01556 
01557     {
01558     printf("%s:%d: missing 'endmenu' for this 'menu' statement\n", current_menu->file->name, current_menu->lineno);
01559     zconfnerrs++;
01560 ;}
01561     break;
01562 
01563   case 72:
01564 
01565     { zconfprint("invalid menu option"); yyerrok; ;}
01566     break;
01567 
01568   case 73:
01569 
01570     {
01571     yyval.string = yyvsp[-1].string;
01572     printd(DEBUG_PARSE, "%s:%d:source %s\n", zconf_curname(), zconf_lineno(), yyvsp[-1].string);
01573 ;}
01574     break;
01575 
01576   case 74:
01577 
01578     {
01579     zconf_nextfile(yyvsp[0].string);
01580 ;}
01581     break;
01582 
01583   case 75:
01584 
01585     {
01586     menu_add_entry(NULL);
01587     menu_add_prop(P_COMMENT, yyvsp[-1].string, NULL, NULL);
01588     printd(DEBUG_PARSE, "%s:%d:comment\n", zconf_curname(), zconf_lineno());
01589 ;}
01590     break;
01591 
01592   case 76:
01593 
01594     {
01595     menu_end_entry();
01596 ;}
01597     break;
01598 
01599   case 77:
01600 
01601     {
01602     printd(DEBUG_PARSE, "%s:%d:help\n", zconf_curname(), zconf_lineno());
01603     zconf_starthelp();
01604 ;}
01605     break;
01606 
01607   case 78:
01608 
01609     {
01610     current_entry->sym->help = yyvsp[0].string;
01611 ;}
01612     break;
01613 
01614   case 82:
01615 
01616     {
01617     menu_add_dep(yyvsp[-1].expr);
01618     printd(DEBUG_PARSE, "%s:%d:depends on\n", zconf_curname(), zconf_lineno());
01619 ;}
01620     break;
01621 
01622   case 83:
01623 
01624     {
01625     menu_add_dep(yyvsp[-1].expr);
01626     printd(DEBUG_PARSE, "%s:%d:depends\n", zconf_curname(), zconf_lineno());
01627 ;}
01628     break;
01629 
01630   case 84:
01631 
01632     {
01633     menu_add_dep(yyvsp[-1].expr);
01634     printd(DEBUG_PARSE, "%s:%d:requires\n", zconf_curname(), zconf_lineno());
01635 ;}
01636     break;
01637 
01638   case 86:
01639 
01640     {
01641     menu_add_prop(P_PROMPT, yyvsp[-1].string, NULL, yyvsp[0].expr);
01642 ;}
01643     break;
01644 
01645   case 89:
01646 
01647     { yyval.token = T_ENDMENU; ;}
01648     break;
01649 
01650   case 90:
01651 
01652     { yyval.token = T_ENDCHOICE; ;}
01653     break;
01654 
01655   case 91:
01656 
01657     { yyval.token = T_ENDIF; ;}
01658     break;
01659 
01660   case 94:
01661 
01662     { yyval.expr = NULL; ;}
01663     break;
01664 
01665   case 95:
01666 
01667     { yyval.expr = yyvsp[0].expr; ;}
01668     break;
01669 
01670   case 96:
01671 
01672     { yyval.expr = expr_alloc_symbol(yyvsp[0].symbol); ;}
01673     break;
01674 
01675   case 97:
01676 
01677     { yyval.expr = expr_alloc_comp(E_EQUAL, yyvsp[-2].symbol, yyvsp[0].symbol); ;}
01678     break;
01679 
01680   case 98:
01681 
01682     { yyval.expr = expr_alloc_comp(E_UNEQUAL, yyvsp[-2].symbol, yyvsp[0].symbol); ;}
01683     break;
01684 
01685   case 99:
01686 
01687     { yyval.expr = yyvsp[-1].expr; ;}
01688     break;
01689 
01690   case 100:
01691 
01692     { yyval.expr = expr_alloc_one(E_NOT, yyvsp[0].expr); ;}
01693     break;
01694 
01695   case 101:
01696 
01697     { yyval.expr = expr_alloc_two(E_OR, yyvsp[-2].expr, yyvsp[0].expr); ;}
01698     break;
01699 
01700   case 102:
01701 
01702     { yyval.expr = expr_alloc_two(E_AND, yyvsp[-2].expr, yyvsp[0].expr); ;}
01703     break;
01704 
01705   case 103:
01706 
01707     { yyval.symbol = sym_lookup(yyvsp[0].string, 0); free(yyvsp[0].string); ;}
01708     break;
01709 
01710   case 104:
01711 
01712     { yyval.symbol = sym_lookup(yyvsp[0].string, 1); free(yyvsp[0].string); ;}
01713     break;
01714 
01715 
01716     }
01717 
01718 /* Line 999 of yacc.c.  */
01719 
01720 
01721   yyvsp -= yylen;
01722   yyssp -= yylen;
01723 
01724 
01725   YY_STACK_PRINT (yyss, yyssp);
01726 
01727   *++yyvsp = yyval;
01728 
01729 
01730   /* Now `shift' the result of the reduction.  Determine what state
01731      that goes to, based on the state we popped back to and the rule
01732      number reduced by.  */
01733 
01734   yyn = yyr1[yyn];
01735 
01736   yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
01737   if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
01738     yystate = yytable[yystate];
01739   else
01740     yystate = yydefgoto[yyn - YYNTOKENS];
01741 
01742   goto yynewstate;
01743 
01744 
01745 /*------------------------------------.
01746 | yyerrlab -- here on detecting error |
01747 `------------------------------------*/
01748 yyerrlab:
01749   /* If not already recovering from an error, report this error.  */
01750   if (!yyerrstatus)
01751     {
01752       ++yynerrs;
01753 #if YYERROR_VERBOSE
01754       yyn = yypact[yystate];
01755 
01756       if (YYPACT_NINF < yyn && yyn < YYLAST)
01757     {
01758       YYSIZE_T yysize = 0;
01759       int yytype = YYTRANSLATE (yychar);
01760       char *yymsg;
01761       int yyx, yycount;
01762 
01763       yycount = 0;
01764       /* Start YYX at -YYN if negative to avoid negative indexes in
01765          YYCHECK.  */
01766       for (yyx = yyn < 0 ? -yyn : 0;
01767            yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++)
01768         if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
01769           yysize += yystrlen (yytname[yyx]) + 15, yycount++;
01770       yysize += yystrlen ("syntax error, unexpected ") + 1;
01771       yysize += yystrlen (yytname[yytype]);
01772       yymsg = (char *) YYSTACK_ALLOC (yysize);
01773       if (yymsg != 0)
01774         {
01775           char *yyp = yystpcpy (yymsg, "syntax error, unexpected ");
01776           yyp = yystpcpy (yyp, yytname[yytype]);
01777 
01778           if (yycount < 5)
01779         {
01780           yycount = 0;
01781           for (yyx = yyn < 0 ? -yyn : 0;
01782                yyx < (int) (sizeof (yytname) / sizeof (char *));
01783                yyx++)
01784             if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
01785               {
01786             const char *yyq = ! yycount ? ", expecting " : " or ";
01787             yyp = yystpcpy (yyp, yyq);
01788             yyp = yystpcpy (yyp, yytname[yyx]);
01789             yycount++;
01790               }
01791         }
01792           yyerror (yymsg);
01793           YYSTACK_FREE (yymsg);
01794         }
01795       else
01796         yyerror ("syntax error; also virtual memory exhausted");
01797     }
01798       else
01799 #endif /* YYERROR_VERBOSE */
01800     yyerror ("syntax error");
01801     }
01802 
01803 
01804 
01805   if (yyerrstatus == 3)
01806     {
01807       /* If just tried and failed to reuse lookahead token after an
01808      error, discard it.  */
01809 
01810       /* Return failure if at end of input.  */
01811       if (yychar == YYEOF)
01812         {
01813       /* Pop the error token.  */
01814           YYPOPSTACK;
01815       /* Pop the rest of the stack.  */
01816       while (yyss < yyssp)
01817         {
01818           YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
01819           yydestruct (yystos[*yyssp], yyvsp);
01820           YYPOPSTACK;
01821         }
01822       YYABORT;
01823         }
01824 
01825       YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc);
01826       yydestruct (yytoken, &yylval);
01827       yychar = YYEMPTY;
01828 
01829     }
01830 
01831   /* Else will try to reuse lookahead token after shifting the error
01832      token.  */
01833   goto yyerrlab1;
01834 
01835 
01836 /*----------------------------------------------------.
01837 | yyerrlab1 -- error raised explicitly by an action.  |
01838 `----------------------------------------------------*/
01839 yyerrlab1:
01840   yyerrstatus = 3;  /* Each real token shifted decrements this.  */
01841 
01842   for (;;)
01843     {
01844       yyn = yypact[yystate];
01845       if (yyn != YYPACT_NINF)
01846     {
01847       yyn += YYTERROR;
01848       if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
01849         {
01850           yyn = yytable[yyn];
01851           if (0 < yyn)
01852         break;
01853         }
01854     }
01855 
01856       /* Pop the current state because it cannot handle the error token.  */
01857       if (yyssp == yyss)
01858     YYABORT;
01859 
01860       YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
01861       yydestruct (yystos[yystate], yyvsp);
01862       yyvsp--;
01863       yystate = *--yyssp;
01864 
01865       YY_STACK_PRINT (yyss, yyssp);
01866     }
01867 
01868   if (yyn == YYFINAL)
01869     YYACCEPT;
01870 
01871   YYDPRINTF ((stderr, "Shifting error token, "));
01872 
01873   *++yyvsp = yylval;
01874 
01875 
01876   yystate = yyn;
01877   goto yynewstate;
01878 
01879 
01880 /*-------------------------------------.
01881 | yyacceptlab -- YYACCEPT comes here.  |
01882 `-------------------------------------*/
01883 yyacceptlab:
01884   yyresult = 0;
01885   goto yyreturn;
01886 
01887 /*-----------------------------------.
01888 | yyabortlab -- YYABORT comes here.  |
01889 `-----------------------------------*/
01890 yyabortlab:
01891   yyresult = 1;
01892   goto yyreturn;
01893 
01894 #ifndef yyoverflow
01895 /*----------------------------------------------.
01896 | yyoverflowlab -- parser overflow comes here.  |
01897 `----------------------------------------------*/
01898 yyoverflowlab:
01899   yyerror ("parser stack overflow");
01900   yyresult = 2;
01901   /* Fall through.  */
01902 #endif
01903 
01904 yyreturn:
01905 #ifndef yyoverflow
01906   if (yyss != yyssa)
01907     YYSTACK_FREE (yyss);
01908 #endif
01909   return yyresult;
01910 }
01911 
01912 
01913 
01914 
01915 
01916 void conf_parse(const char *name)
01917 {
01918     struct symbol *sym;
01919     int i;
01920 
01921     zconf_initscan(name);
01922 
01923     sym_init();
01924     menu_init();
01925     modules_sym = sym_lookup("MODULES", 0);
01926     rootmenu.prompt = menu_add_prop(P_MENU, "Linux Kernel Configuration", NULL, NULL);
01927 
01928     //zconfdebug = 1;
01929     zconfparse();
01930     if (zconfnerrs)
01931         exit(1);
01932     menu_finalize(&rootmenu);
01933     for_all_symbols(i, sym) {
01934                 if (!(sym->flags & SYMBOL_CHECKED) && sym_check_deps(sym))
01935                         printf("\n");
01936         else
01937             sym->flags |= SYMBOL_CHECK_DONE;
01938         }
01939 
01940     sym_change_count = 1;
01941 }
01942 
01943 const char *zconf_tokenname(int token)
01944 {
01945     switch (token) {
01946     case T_MENU:        return "menu";
01947     case T_ENDMENU:     return "endmenu";
01948     case T_CHOICE:      return "choice";
01949     case T_ENDCHOICE:   return "endchoice";
01950     case T_IF:      return "if";
01951     case T_ENDIF:       return "endif";
01952     }
01953     return "<token>";
01954 }
01955 
01956 static bool zconf_endtoken(int token, int starttoken, int endtoken)
01957 {
01958     if (token != endtoken) {
01959         zconfprint("unexpected '%s' within %s block", zconf_tokenname(token), zconf_tokenname(starttoken));
01960         zconfnerrs++;
01961         return false;
01962     }
01963     if (current_menu->file != current_file) {
01964         zconfprint("'%s' in different file than '%s'", zconf_tokenname(token), zconf_tokenname(starttoken));
01965         zconfprint("location of the '%s'", zconf_tokenname(starttoken));
01966         zconfnerrs++;
01967         return false;
01968     }
01969     return true;
01970 }
01971 
01972 static void zconfprint(const char *err, ...)
01973 {
01974     va_list ap;
01975 
01976     fprintf(stderr, "%s:%d: ", zconf_curname(), zconf_lineno() + 1);
01977     va_start(ap, err);
01978     vfprintf(stderr, err, ap);
01979     va_end(ap);
01980     fprintf(stderr, "\n");
01981 }
01982 
01983 static void zconferror(const char *err)
01984 {
01985     fprintf(stderr, "%s:%d: %s\n", zconf_curname(), zconf_lineno() + 1, err);
01986 }
01987 
01988 void print_quoted_string(FILE *out, const char *str)
01989 {
01990     const char *p;
01991     int len;
01992 
01993     putc('"', out);
01994     while ((p = strchr(str, '"'))) {
01995         len = p - str;
01996         if (len)
01997             fprintf(out, "%.*s", len, str);
01998         fputs("\\\"", out);
01999         str = p + 1;
02000     }
02001     fputs(str, out);
02002     putc('"', out);
02003 }
02004 
02005 void print_symbol(FILE *out, struct menu *menu)
02006 {
02007     struct symbol *sym = menu->sym;
02008     struct property *prop;
02009 
02010     if (sym_is_choice(sym))
02011         fprintf(out, "choice\n");
02012     else
02013         fprintf(out, "config %s\n", sym->name);
02014     switch (sym->type) {
02015     case S_BOOLEAN:
02016         fputs("  boolean\n", out);
02017         break;
02018     case S_TRISTATE:
02019         fputs("  tristate\n", out);
02020         break;
02021     case S_STRING:
02022         fputs("  string\n", out);
02023         break;
02024     case S_INT:
02025         fputs("  integer\n", out);
02026         break;
02027     case S_HEX:
02028         fputs("  hex\n", out);
02029         break;
02030     default:
02031         fputs("  ???\n", out);
02032         break;
02033     }
02034     for (prop = sym->prop; prop; prop = prop->next) {
02035         if (prop->menu != menu)
02036             continue;
02037         switch (prop->type) {
02038         case P_PROMPT:
02039             fputs("  prompt ", out);
02040             print_quoted_string(out, prop->text);
02041             if (!expr_is_yes(prop->visible.expr)) {
02042                 fputs(" if ", out);
02043                 expr_fprint(prop->visible.expr, out);
02044             }
02045             fputc('\n', out);
02046             break;
02047         case P_DEFAULT:
02048             fputs( "  default ", out);
02049             expr_fprint(prop->expr, out);
02050             if (!expr_is_yes(prop->visible.expr)) {
02051                 fputs(" if ", out);
02052                 expr_fprint(prop->visible.expr, out);
02053             }
02054             fputc('\n', out);
02055             break;
02056         case P_CHOICE:
02057             fputs("  #choice value\n", out);
02058             break;
02059         default:
02060             fprintf(out, "  unknown prop %d!\n", prop->type);
02061             break;
02062         }
02063     }
02064     if (sym->help) {
02065         int len = strlen(sym->help);
02066         while (sym->help[--len] == '\n')
02067             sym->help[len] = 0;
02068         fprintf(out, "  help\n%s\n", sym->help);
02069     }
02070     fputc('\n', out);
02071 }
02072 
02073 void zconfdump(FILE *out)
02074 {
02075     struct property *prop;
02076     struct symbol *sym;
02077     struct menu *menu;
02078 
02079     menu = rootmenu.list;
02080     while (menu) {
02081         if ((sym = menu->sym))
02082             print_symbol(out, menu);
02083         else if ((prop = menu->prompt)) {
02084             switch (prop->type) {
02085             case P_COMMENT:
02086                 fputs("\ncomment ", out);
02087                 print_quoted_string(out, prop->text);
02088                 fputs("\n", out);
02089                 break;
02090             case P_MENU:
02091                 fputs("\nmenu ", out);
02092                 print_quoted_string(out, prop->text);
02093                 fputs("\n", out);
02094                 break;
02095             default:
02096                 ;
02097             }
02098             if (!expr_is_yes(prop->visible.expr)) {
02099                 fputs("  depends ", out);
02100                 expr_fprint(prop->visible.expr, out);
02101                 fputc('\n', out);
02102             }
02103             fputs("\n", out);
02104         }
02105 
02106         if (menu->list)
02107             menu = menu->list;
02108         else if (menu->next)
02109             menu = menu->next;
02110         else while ((menu = menu->parent)) {
02111             if (menu->prompt && menu->prompt->type == P_MENU)
02112                 fputs("\nendmenu\n", out);
02113             if (menu->next) {
02114                 menu = menu->next;
02115                 break;
02116             }
02117         }
02118     }
02119 }
02120 
02121 #include "lex.zconf.c"
02122 #include "confdata.c"
02123 #include "expr.c"
02124 #include "symbol.c"
02125 #include "menu.c"
02126 
02127 

Generated on Tue Feb 2 17:46:04 2010 for RTAI API by  doxygen 1.4.7