kconfig/zconf.tab.c
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Tue Jan 12 19:24:03 2010 +0100 (2010-01-12)
changeset 1761 88020b2c3246
parent 878 aa3be56634c1
child 2448 a103abae1560
permissions -rw-r--r--
scripts/functions: change handling of nochdir

- 'nochdir' must be the first option
- have systematic pushd/popd, even if nochdir
yann@943
     1
/* A Bison parser, made by GNU Bison 2.3.  */
yann@1
     2
yann@943
     3
/* Skeleton implementation for Bison's Yacc-like parsers in C
yann@943
     4
yann@943
     5
   Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
yann@943
     6
   Free Software Foundation, Inc.
yann@1
     7
yann@1
     8
   This program is free software; you can redistribute it and/or modify
yann@1
     9
   it under the terms of the GNU General Public License as published by
yann@1
    10
   the Free Software Foundation; either version 2, or (at your option)
yann@1
    11
   any later version.
yann@1
    12
yann@1
    13
   This program is distributed in the hope that it will be useful,
yann@1
    14
   but WITHOUT ANY WARRANTY; without even the implied warranty of
yann@1
    15
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
yann@1
    16
   GNU General Public License for more details.
yann@1
    17
yann@1
    18
   You should have received a copy of the GNU General Public License
yann@1
    19
   along with this program; if not, write to the Free Software
yann@1
    20
   Foundation, Inc., 51 Franklin Street, Fifth Floor,
yann@1
    21
   Boston, MA 02110-1301, USA.  */
yann@1
    22
yann@943
    23
/* As a special exception, you may create a larger work that contains
yann@943
    24
   part or all of the Bison parser skeleton and distribute that work
yann@943
    25
   under terms of your choice, so long as that work isn't itself a
yann@943
    26
   parser generator using the skeleton or a modified version thereof
yann@943
    27
   as a parser skeleton.  Alternatively, if you modify or redistribute
yann@943
    28
   the parser skeleton itself, you may (at your option) remove this
yann@943
    29
   special exception, which will cause the skeleton and the resulting
yann@943
    30
   Bison output files to be licensed under the GNU General Public
yann@943
    31
   License without this special exception.
yann@1
    32
yann@943
    33
   This special exception was added by the Free Software Foundation in
yann@943
    34
   version 2.2 of Bison.  */
yann@943
    35
yann@943
    36
/* C LALR(1) parser skeleton written by Richard Stallman, by
yann@943
    37
   simplifying the original so-called "semantic" parser.  */
yann@1
    38
yann@1
    39
/* All symbols defined below should begin with yy or YY, to avoid
yann@1
    40
   infringing on user name space.  This should be done even for local
yann@1
    41
   variables, as they might otherwise be expanded by user macros.
yann@1
    42
   There are some unavoidable exceptions within include files to
yann@1
    43
   define necessary library symbols; they are noted "INFRINGES ON
yann@1
    44
   USER NAME SPACE" below.  */
yann@1
    45
yann@1
    46
/* Identify Bison output.  */
yann@1
    47
#define YYBISON 1
yann@1
    48
yann@1
    49
/* Bison version.  */
yann@943
    50
#define YYBISON_VERSION "2.3"
yann@1
    51
yann@1
    52
/* Skeleton name.  */
yann@1
    53
#define YYSKELETON_NAME "yacc.c"
yann@1
    54
yann@1
    55
/* Pure parsers.  */
yann@1
    56
#define YYPURE 0
yann@1
    57
yann@1
    58
/* Using locations.  */
yann@1
    59
#define YYLSP_NEEDED 0
yann@1
    60
yann@1
    61
/* Substitute the variable and function names.  */
yann@1
    62
#define yyparse zconfparse
yann@1
    63
#define yylex   zconflex
yann@1
    64
#define yyerror zconferror
yann@1
    65
#define yylval  zconflval
yann@1
    66
#define yychar  zconfchar
yann@1
    67
#define yydebug zconfdebug
yann@1
    68
#define yynerrs zconfnerrs
yann@1
    69
yann@1
    70
yann@1
    71
/* Tokens.  */
yann@1
    72
#ifndef YYTOKENTYPE
yann@1
    73
# define YYTOKENTYPE
yann@1
    74
   /* Put the tokens into the symbol table, so that GDB and other debuggers
yann@1
    75
      know about them.  */
yann@1
    76
   enum yytokentype {
yann@1
    77
     T_MAINMENU = 258,
yann@1
    78
     T_MENU = 259,
yann@1
    79
     T_ENDMENU = 260,
yann@1
    80
     T_SOURCE = 261,
yann@1
    81
     T_CHOICE = 262,
yann@1
    82
     T_ENDCHOICE = 263,
yann@1
    83
     T_COMMENT = 264,
yann@1
    84
     T_CONFIG = 265,
yann@1
    85
     T_MENUCONFIG = 266,
yann@1
    86
     T_HELP = 267,
yann@1
    87
     T_HELPTEXT = 268,
yann@1
    88
     T_IF = 269,
yann@1
    89
     T_ENDIF = 270,
yann@1
    90
     T_DEPENDS = 271,
yann@943
    91
     T_OPTIONAL = 272,
yann@943
    92
     T_PROMPT = 273,
yann@943
    93
     T_TYPE = 274,
yann@943
    94
     T_DEFAULT = 275,
yann@943
    95
     T_SELECT = 276,
yann@943
    96
     T_RANGE = 277,
yann@943
    97
     T_OPTION = 278,
yann@943
    98
     T_ON = 279,
yann@943
    99
     T_WORD = 280,
yann@943
   100
     T_WORD_QUOTE = 281,
yann@943
   101
     T_UNEQUAL = 282,
yann@943
   102
     T_CLOSE_PAREN = 283,
yann@943
   103
     T_OPEN_PAREN = 284,
yann@943
   104
     T_EOL = 285,
yann@943
   105
     T_OR = 286,
yann@943
   106
     T_AND = 287,
yann@943
   107
     T_EQUAL = 288,
yann@943
   108
     T_NOT = 289
yann@1
   109
   };
yann@1
   110
#endif
yann@1
   111
/* Tokens.  */
yann@1
   112
#define T_MAINMENU 258
yann@1
   113
#define T_MENU 259
yann@1
   114
#define T_ENDMENU 260
yann@1
   115
#define T_SOURCE 261
yann@1
   116
#define T_CHOICE 262
yann@1
   117
#define T_ENDCHOICE 263
yann@1
   118
#define T_COMMENT 264
yann@1
   119
#define T_CONFIG 265
yann@1
   120
#define T_MENUCONFIG 266
yann@1
   121
#define T_HELP 267
yann@1
   122
#define T_HELPTEXT 268
yann@1
   123
#define T_IF 269
yann@1
   124
#define T_ENDIF 270
yann@1
   125
#define T_DEPENDS 271
yann@943
   126
#define T_OPTIONAL 272
yann@943
   127
#define T_PROMPT 273
yann@943
   128
#define T_TYPE 274
yann@943
   129
#define T_DEFAULT 275
yann@943
   130
#define T_SELECT 276
yann@943
   131
#define T_RANGE 277
yann@943
   132
#define T_OPTION 278
yann@943
   133
#define T_ON 279
yann@943
   134
#define T_WORD 280
yann@943
   135
#define T_WORD_QUOTE 281
yann@943
   136
#define T_UNEQUAL 282
yann@943
   137
#define T_CLOSE_PAREN 283
yann@943
   138
#define T_OPEN_PAREN 284
yann@943
   139
#define T_EOL 285
yann@943
   140
#define T_OR 286
yann@943
   141
#define T_AND 287
yann@943
   142
#define T_EQUAL 288
yann@943
   143
#define T_NOT 289
yann@1
   144
yann@1
   145
yann@1
   146
yann@1
   147
yann@1
   148
/* Copy the first part of user declarations.  */
yann@1
   149
yann@1
   150
yann@1
   151
/*
yann@1
   152
 * Copyright (C) 2002 Roman Zippel <zippel@linux-m68k.org>
yann@1
   153
 * Released under the terms of the GNU GPL v2.0.
yann@1
   154
 */
yann@1
   155
yann@1
   156
#include <ctype.h>
yann@1
   157
#include <stdarg.h>
yann@1
   158
#include <stdio.h>
yann@1
   159
#include <stdlib.h>
yann@1
   160
#include <string.h>
yann@1
   161
#include <stdbool.h>
yann@1
   162
yann@1
   163
#define LKC_DIRECT_LINK
yann@1
   164
#include "lkc.h"
yann@1
   165
yann@1
   166
#include "zconf.hash.c"
yann@1
   167
yann@1
   168
#define printd(mask, fmt...) if (cdebug & (mask)) printf(fmt)
yann@1
   169
yann@1
   170
#define PRINTD		0x0001
yann@1
   171
#define DEBUG_PARSE	0x0002
yann@1
   172
yann@1
   173
int cdebug = PRINTD;
yann@1
   174
yann@1
   175
extern int zconflex(void);
yann@1
   176
static void zconfprint(const char *err, ...);
yann@1
   177
static void zconf_error(const char *err, ...);
yann@1
   178
static void zconferror(const char *err);
yann@1
   179
static bool zconf_endtoken(struct kconf_id *id, int starttoken, int endtoken);
yann@1
   180
yann@1
   181
struct symbol *symbol_hash[257];
yann@1
   182
yann@1
   183
static struct menu *current_menu, *current_entry;
yann@1
   184
yann@1
   185
#define YYDEBUG 0
yann@1
   186
#if YYDEBUG
yann@1
   187
#define YYERROR_VERBOSE
yann@1
   188
#endif
yann@1
   189
yann@1
   190
yann@1
   191
/* Enabling traces.  */
yann@1
   192
#ifndef YYDEBUG
yann@1
   193
# define YYDEBUG 0
yann@1
   194
#endif
yann@1
   195
yann@1
   196
/* Enabling verbose error messages.  */
yann@1
   197
#ifdef YYERROR_VERBOSE
yann@1
   198
# undef YYERROR_VERBOSE
yann@1
   199
# define YYERROR_VERBOSE 1
yann@1
   200
#else
yann@1
   201
# define YYERROR_VERBOSE 0
yann@1
   202
#endif
yann@1
   203
yann@1
   204
/* Enabling the token table.  */
yann@1
   205
#ifndef YYTOKEN_TABLE
yann@1
   206
# define YYTOKEN_TABLE 0
yann@1
   207
#endif
yann@1
   208
yann@943
   209
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
yann@943
   210
typedef union YYSTYPE
yann@1
   211
yann@943
   212
{
yann@1
   213
	char *string;
yann@1
   214
	struct file *file;
yann@1
   215
	struct symbol *symbol;
yann@1
   216
	struct expr *expr;
yann@1
   217
	struct menu *menu;
yann@1
   218
	struct kconf_id *id;
yann@943
   219
}
yann@943
   220
/* Line 187 of yacc.c.  */
yann@1
   221
yann@943
   222
	YYSTYPE;
yann@1
   223
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
yann@1
   224
# define YYSTYPE_IS_DECLARED 1
yann@1
   225
# define YYSTYPE_IS_TRIVIAL 1
yann@1
   226
#endif
yann@1
   227
yann@1
   228
yann@1
   229
yann@1
   230
/* Copy the second part of user declarations.  */
yann@1
   231
yann@1
   232
yann@943
   233
/* Line 216 of yacc.c.  */
yann@1
   234
yann@1
   235
yann@943
   236
#ifdef short
yann@943
   237
# undef short
yann@1
   238
#endif
yann@943
   239
yann@943
   240
#ifdef YYTYPE_UINT8
yann@943
   241
typedef YYTYPE_UINT8 yytype_uint8;
yann@943
   242
#else
yann@943
   243
typedef unsigned char yytype_uint8;
yann@1
   244
#endif
yann@943
   245
yann@943
   246
#ifdef YYTYPE_INT8
yann@943
   247
typedef YYTYPE_INT8 yytype_int8;
yann@943
   248
#elif (defined __STDC__ || defined __C99__FUNC__ \
yann@943
   249
     || defined __cplusplus || defined _MSC_VER)
yann@943
   250
typedef signed char yytype_int8;
yann@943
   251
#else
yann@943
   252
typedef short int yytype_int8;
yann@1
   253
#endif
yann@943
   254
yann@943
   255
#ifdef YYTYPE_UINT16
yann@943
   256
typedef YYTYPE_UINT16 yytype_uint16;
yann@943
   257
#else
yann@943
   258
typedef unsigned short int yytype_uint16;
yann@1
   259
#endif
yann@1
   260
yann@943
   261
#ifdef YYTYPE_INT16
yann@943
   262
typedef YYTYPE_INT16 yytype_int16;
yann@943
   263
#else
yann@943
   264
typedef short int yytype_int16;
yann@943
   265
#endif
yann@943
   266
yann@943
   267
#ifndef YYSIZE_T
yann@943
   268
# ifdef __SIZE_TYPE__
yann@943
   269
#  define YYSIZE_T __SIZE_TYPE__
yann@943
   270
# elif defined size_t
yann@943
   271
#  define YYSIZE_T size_t
yann@943
   272
# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
yann@943
   273
     || defined __cplusplus || defined _MSC_VER)
yann@943
   274
#  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
yann@943
   275
#  define YYSIZE_T size_t
yann@943
   276
# else
yann@943
   277
#  define YYSIZE_T unsigned int
yann@943
   278
# endif
yann@943
   279
#endif
yann@943
   280
yann@943
   281
#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
yann@943
   282
yann@1
   283
#ifndef YY_
yann@1
   284
# if YYENABLE_NLS
yann@1
   285
#  if ENABLE_NLS
yann@1
   286
#   include <libintl.h> /* INFRINGES ON USER NAME SPACE */
yann@1
   287
#   define YY_(msgid) dgettext ("bison-runtime", msgid)
yann@1
   288
#  endif
yann@1
   289
# endif
yann@1
   290
# ifndef YY_
yann@1
   291
#  define YY_(msgid) msgid
yann@1
   292
# endif
yann@1
   293
#endif
yann@1
   294
yann@943
   295
/* Suppress unused-variable warnings by "using" E.  */
yann@943
   296
#if ! defined lint || defined __GNUC__
yann@943
   297
# define YYUSE(e) ((void) (e))
yann@943
   298
#else
yann@943
   299
# define YYUSE(e) /* empty */
yann@943
   300
#endif
yann@943
   301
yann@943
   302
/* Identity function, used to suppress warnings about constant conditions.  */
yann@943
   303
#ifndef lint
yann@943
   304
# define YYID(n) (n)
yann@943
   305
#else
yann@943
   306
#if (defined __STDC__ || defined __C99__FUNC__ \
yann@943
   307
     || defined __cplusplus || defined _MSC_VER)
yann@943
   308
static int
yann@943
   309
YYID (int i)
yann@943
   310
#else
yann@943
   311
static int
yann@943
   312
YYID (i)
yann@943
   313
    int i;
yann@943
   314
#endif
yann@943
   315
{
yann@943
   316
  return i;
yann@943
   317
}
yann@943
   318
#endif
yann@943
   319
yann@943
   320
#if ! defined yyoverflow || YYERROR_VERBOSE
yann@1
   321
yann@1
   322
/* The parser invokes alloca or malloc; define the necessary symbols.  */
yann@1
   323
yann@1
   324
# ifdef YYSTACK_USE_ALLOCA
yann@1
   325
#  if YYSTACK_USE_ALLOCA
yann@1
   326
#   ifdef __GNUC__
yann@1
   327
#    define YYSTACK_ALLOC __builtin_alloca
yann@943
   328
#   elif defined __BUILTIN_VA_ARG_INCR
yann@943
   329
#    include <alloca.h> /* INFRINGES ON USER NAME SPACE */
yann@943
   330
#   elif defined _AIX
yann@943
   331
#    define YYSTACK_ALLOC __alloca
yann@943
   332
#   elif defined _MSC_VER
yann@943
   333
#    include <malloc.h> /* INFRINGES ON USER NAME SPACE */
yann@943
   334
#    define alloca _alloca
yann@1
   335
#   else
yann@1
   336
#    define YYSTACK_ALLOC alloca
yann@943
   337
#    if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
yann@943
   338
     || defined __cplusplus || defined _MSC_VER)
yann@1
   339
#     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
yann@943
   340
#     ifndef _STDLIB_H
yann@943
   341
#      define _STDLIB_H 1
yann@943
   342
#     endif
yann@1
   343
#    endif
yann@1
   344
#   endif
yann@1
   345
#  endif
yann@1
   346
# endif
yann@1
   347
yann@1
   348
# ifdef YYSTACK_ALLOC
yann@943
   349
   /* Pacify GCC's `empty if-body' warning.  */
yann@943
   350
#  define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
yann@1
   351
#  ifndef YYSTACK_ALLOC_MAXIMUM
yann@1
   352
    /* The OS might guarantee only one guard page at the bottom of the stack,
yann@1
   353
       and a page size can be as small as 4096 bytes.  So we cannot safely
yann@1
   354
       invoke alloca (N) if N exceeds 4096.  Use a slightly smaller number
yann@1
   355
       to allow for a few compiler-allocated temporary stack slots.  */
yann@943
   356
#   define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
yann@1
   357
#  endif
yann@1
   358
# else
yann@1
   359
#  define YYSTACK_ALLOC YYMALLOC
yann@1
   360
#  define YYSTACK_FREE YYFREE
yann@1
   361
#  ifndef YYSTACK_ALLOC_MAXIMUM
yann@943
   362
#   define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
yann@1
   363
#  endif
yann@943
   364
#  if (defined __cplusplus && ! defined _STDLIB_H \
yann@943
   365
       && ! ((defined YYMALLOC || defined malloc) \
yann@943
   366
	     && (defined YYFREE || defined free)))
yann@943
   367
#   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
yann@943
   368
#   ifndef _STDLIB_H
yann@943
   369
#    define _STDLIB_H 1
yann@943
   370
#   endif
yann@1
   371
#  endif
yann@1
   372
#  ifndef YYMALLOC
yann@1
   373
#   define YYMALLOC malloc
yann@943
   374
#   if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
yann@943
   375
     || defined __cplusplus || defined _MSC_VER)
yann@1
   376
void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
yann@1
   377
#   endif
yann@1
   378
#  endif
yann@1
   379
#  ifndef YYFREE
yann@1
   380
#   define YYFREE free
yann@943
   381
#   if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
yann@943
   382
     || defined __cplusplus || defined _MSC_VER)
yann@1
   383
void free (void *); /* INFRINGES ON USER NAME SPACE */
yann@1
   384
#   endif
yann@1
   385
#  endif
yann@1
   386
# endif
yann@943
   387
#endif /* ! defined yyoverflow || YYERROR_VERBOSE */
yann@1
   388
yann@1
   389
yann@943
   390
#if (! defined yyoverflow \
yann@943
   391
     && (! defined __cplusplus \
yann@943
   392
	 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
yann@1
   393
yann@1
   394
/* A type that is properly aligned for any stack member.  */
yann@1
   395
union yyalloc
yann@1
   396
{
yann@943
   397
  yytype_int16 yyss;
yann@1
   398
  YYSTYPE yyvs;
yann@1
   399
  };
yann@1
   400
yann@1
   401
/* The size of the maximum gap between one aligned stack and the next.  */
yann@1
   402
# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
yann@1
   403
yann@1
   404
/* The size of an array large to enough to hold all stacks, each with
yann@1
   405
   N elements.  */
yann@1
   406
# define YYSTACK_BYTES(N) \
yann@943
   407
     ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
yann@1
   408
      + YYSTACK_GAP_MAXIMUM)
yann@1
   409
yann@1
   410
/* Copy COUNT objects from FROM to TO.  The source and destination do
yann@1
   411
   not overlap.  */
yann@1
   412
# ifndef YYCOPY
yann@943
   413
#  if defined __GNUC__ && 1 < __GNUC__
yann@1
   414
#   define YYCOPY(To, From, Count) \
yann@1
   415
      __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
yann@1
   416
#  else
yann@1
   417
#   define YYCOPY(To, From, Count)		\
yann@1
   418
      do					\
yann@1
   419
	{					\
yann@1
   420
	  YYSIZE_T yyi;				\
yann@1
   421
	  for (yyi = 0; yyi < (Count); yyi++)	\
yann@1
   422
	    (To)[yyi] = (From)[yyi];		\
yann@1
   423
	}					\
yann@943
   424
      while (YYID (0))
yann@1
   425
#  endif
yann@1
   426
# endif
yann@1
   427
yann@1
   428
/* Relocate STACK from its old location to the new one.  The
yann@1
   429
   local variables YYSIZE and YYSTACKSIZE give the old and new number of
yann@1
   430
   elements in the stack, and YYPTR gives the new location of the
yann@1
   431
   stack.  Advance YYPTR to a properly aligned location for the next
yann@1
   432
   stack.  */
yann@1
   433
# define YYSTACK_RELOCATE(Stack)					\
yann@1
   434
    do									\
yann@1
   435
      {									\
yann@1
   436
	YYSIZE_T yynewbytes;						\
yann@1
   437
	YYCOPY (&yyptr->Stack, Stack, yysize);				\
yann@1
   438
	Stack = &yyptr->Stack;						\
yann@1
   439
	yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
yann@1
   440
	yyptr += yynewbytes / sizeof (*yyptr);				\
yann@1
   441
      }									\
yann@943
   442
    while (YYID (0))
yann@1
   443
yann@1
   444
#endif
yann@1
   445
yann@943
   446
/* YYFINAL -- State number of the termination state.  */
yann@1
   447
#define YYFINAL  3
yann@1
   448
/* YYLAST -- Last index in YYTABLE.  */
yann@943
   449
#define YYLAST   259
yann@1
   450
yann@943
   451
/* YYNTOKENS -- Number of terminals.  */
yann@943
   452
#define YYNTOKENS  35
yann@943
   453
/* YYNNTS -- Number of nonterminals.  */
yann@943
   454
#define YYNNTS  46
yann@943
   455
/* YYNRULES -- Number of rules.  */
yann@1
   456
#define YYNRULES  110
yann@943
   457
/* YYNRULES -- Number of states.  */
yann@943
   458
#define YYNSTATES  180
yann@1
   459
yann@1
   460
/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
yann@1
   461
#define YYUNDEFTOK  2
yann@943
   462
#define YYMAXUTOK   289
yann@1
   463
yann@1
   464
#define YYTRANSLATE(YYX)						\
yann@1
   465
  ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
yann@1
   466
yann@1
   467
/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX.  */
yann@943
   468
static const yytype_uint8 yytranslate[] =
yann@1
   469
{
yann@1
   470
       0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
yann@1
   471
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
yann@1
   472
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
yann@1
   473
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
yann@1
   474
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
yann@1
   475
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
yann@1
   476
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
yann@1
   477
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
yann@1
   478
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
yann@1
   479
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
yann@1
   480
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
yann@1
   481
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
yann@1
   482
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
yann@1
   483
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
yann@1
   484
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
yann@1
   485
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
yann@1
   486
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
yann@1
   487
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
yann@1
   488
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
yann@1
   489
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
yann@1
   490
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
yann@1
   491
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
yann@1
   492
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
yann@1
   493
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
yann@1
   494
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
yann@1
   495
       2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
yann@1
   496
       5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
yann@1
   497
      15,    16,    17,    18,    19,    20,    21,    22,    23,    24,
yann@943
   498
      25,    26,    27,    28,    29,    30,    31,    32,    33,    34
yann@1
   499
};
yann@1
   500
yann@1
   501
#if YYDEBUG
yann@1
   502
/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
yann@1
   503
   YYRHS.  */
yann@943
   504
static const yytype_uint16 yyprhs[] =
yann@1
   505
{
yann@1
   506
       0,     0,     3,     5,     6,     9,    12,    15,    20,    23,
yann@1
   507
      28,    33,    37,    39,    41,    43,    45,    47,    49,    51,
yann@1
   508
      53,    55,    57,    59,    61,    63,    67,    70,    74,    77,
yann@1
   509
      81,    84,    85,    88,    91,    94,    97,   100,   103,   107,
yann@943
   510
     112,   117,   122,   128,   132,   133,   137,   138,   141,   145,
yann@943
   511
     148,   150,   154,   155,   158,   161,   164,   167,   170,   175,
yann@943
   512
     179,   182,   187,   188,   191,   195,   197,   201,   202,   205,
yann@943
   513
     208,   211,   215,   218,   220,   224,   225,   228,   231,   234,
yann@943
   514
     238,   242,   245,   248,   251,   252,   255,   258,   261,   266,
yann@943
   515
     267,   270,   272,   274,   277,   280,   283,   285,   288,   289,
yann@943
   516
     292,   294,   298,   302,   306,   309,   313,   317,   319,   321,
yann@943
   517
     322
yann@1
   518
};
yann@1
   519
yann@943
   520
/* YYRHS -- A `-1'-separated list of the rules' RHS.  */
yann@943
   521
static const yytype_int8 yyrhs[] =
yann@1
   522
{
yann@943
   523
      36,     0,    -1,    37,    -1,    -1,    37,    39,    -1,    37,
yann@943
   524
      53,    -1,    37,    64,    -1,    37,     3,    74,    76,    -1,
yann@943
   525
      37,    75,    -1,    37,    25,     1,    30,    -1,    37,    38,
yann@943
   526
       1,    30,    -1,    37,     1,    30,    -1,    16,    -1,    18,
yann@943
   527
      -1,    19,    -1,    21,    -1,    17,    -1,    22,    -1,    20,
yann@943
   528
      -1,    30,    -1,    59,    -1,    68,    -1,    42,    -1,    44,
yann@943
   529
      -1,    66,    -1,    25,     1,    30,    -1,     1,    30,    -1,
yann@943
   530
      10,    25,    30,    -1,    41,    45,    -1,    11,    25,    30,
yann@943
   531
      -1,    43,    45,    -1,    -1,    45,    46,    -1,    45,    47,
yann@943
   532
      -1,    45,    72,    -1,    45,    70,    -1,    45,    40,    -1,
yann@943
   533
      45,    30,    -1,    19,    73,    30,    -1,    18,    74,    77,
yann@943
   534
      30,    -1,    20,    78,    77,    30,    -1,    21,    25,    77,
yann@943
   535
      30,    -1,    22,    79,    79,    77,    30,    -1,    23,    48,
yann@943
   536
      30,    -1,    -1,    48,    25,    49,    -1,    -1,    33,    74,
yann@943
   537
      -1,     7,    80,    30,    -1,    50,    54,    -1,    75,    -1,
yann@943
   538
      51,    56,    52,    -1,    -1,    54,    55,    -1,    54,    72,
yann@943
   539
      -1,    54,    70,    -1,    54,    30,    -1,    54,    40,    -1,
yann@943
   540
      18,    74,    77,    30,    -1,    19,    73,    30,    -1,    17,
yann@943
   541
      30,    -1,    20,    25,    77,    30,    -1,    -1,    56,    39,
yann@943
   542
      -1,    14,    78,    76,    -1,    75,    -1,    57,    60,    58,
yann@943
   543
      -1,    -1,    60,    39,    -1,    60,    64,    -1,    60,    53,
yann@943
   544
      -1,     4,    74,    30,    -1,    61,    71,    -1,    75,    -1,
yann@943
   545
      62,    65,    63,    -1,    -1,    65,    39,    -1,    65,    64,
yann@943
   546
      -1,    65,    53,    -1,     6,    74,    30,    -1,     9,    74,
yann@943
   547
      30,    -1,    67,    71,    -1,    12,    30,    -1,    69,    13,
yann@943
   548
      -1,    -1,    71,    72,    -1,    71,    30,    -1,    71,    40,
yann@943
   549
      -1,    16,    24,    78,    30,    -1,    -1,    74,    77,    -1,
yann@943
   550
      25,    -1,    26,    -1,     5,    30,    -1,     8,    30,    -1,
yann@943
   551
      15,    30,    -1,    30,    -1,    76,    30,    -1,    -1,    14,
yann@943
   552
      78,    -1,    79,    -1,    79,    33,    79,    -1,    79,    27,
yann@943
   553
      79,    -1,    29,    78,    28,    -1,    34,    78,    -1,    78,
yann@943
   554
      31,    78,    -1,    78,    32,    78,    -1,    25,    -1,    26,
yann@943
   555
      -1,    -1,    25,    -1
yann@1
   556
};
yann@1
   557
yann@1
   558
/* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
yann@943
   559
static const yytype_uint16 yyrline[] =
yann@1
   560
{
yann@943
   561
       0,   104,   104,   106,   108,   109,   110,   111,   112,   113,
yann@943
   562
     114,   118,   122,   122,   122,   122,   122,   122,   122,   126,
yann@943
   563
     127,   128,   129,   130,   131,   135,   136,   142,   150,   156,
yann@943
   564
     164,   174,   176,   177,   178,   179,   180,   181,   184,   192,
yann@943
   565
     198,   208,   214,   220,   223,   225,   236,   237,   242,   251,
yann@943
   566
     256,   264,   267,   269,   270,   271,   272,   273,   276,   282,
yann@943
   567
     293,   299,   309,   311,   316,   324,   332,   335,   337,   338,
yann@943
   568
     339,   344,   351,   356,   364,   367,   369,   370,   371,   374,
yann@943
   569
     382,   389,   396,   402,   409,   411,   412,   413,   416,   424,
yann@943
   570
     426,   431,   432,   435,   436,   437,   441,   442,   445,   446,
yann@943
   571
     449,   450,   451,   452,   453,   454,   455,   458,   459,   462,
yann@943
   572
     463
yann@1
   573
};
yann@1
   574
#endif
yann@1
   575
yann@1
   576
#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
yann@1
   577
/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
yann@943
   578
   First, the terminals, then, starting at YYNTOKENS, nonterminals.  */
yann@1
   579
static const char *const yytname[] =
yann@1
   580
{
yann@1
   581
  "$end", "error", "$undefined", "T_MAINMENU", "T_MENU", "T_ENDMENU",
yann@1
   582
  "T_SOURCE", "T_CHOICE", "T_ENDCHOICE", "T_COMMENT", "T_CONFIG",
yann@1
   583
  "T_MENUCONFIG", "T_HELP", "T_HELPTEXT", "T_IF", "T_ENDIF", "T_DEPENDS",
yann@943
   584
  "T_OPTIONAL", "T_PROMPT", "T_TYPE", "T_DEFAULT", "T_SELECT", "T_RANGE",
yann@943
   585
  "T_OPTION", "T_ON", "T_WORD", "T_WORD_QUOTE", "T_UNEQUAL",
yann@943
   586
  "T_CLOSE_PAREN", "T_OPEN_PAREN", "T_EOL", "T_OR", "T_AND", "T_EQUAL",
yann@943
   587
  "T_NOT", "$accept", "input", "stmt_list", "option_name", "common_stmt",
yann@943
   588
  "option_error", "config_entry_start", "config_stmt",
yann@1
   589
  "menuconfig_entry_start", "menuconfig_stmt", "config_option_list",
yann@1
   590
  "config_option", "symbol_option", "symbol_option_list",
yann@1
   591
  "symbol_option_arg", "choice", "choice_entry", "choice_end",
yann@1
   592
  "choice_stmt", "choice_option_list", "choice_option", "choice_block",
yann@1
   593
  "if_entry", "if_end", "if_stmt", "if_block", "menu", "menu_entry",
yann@1
   594
  "menu_end", "menu_stmt", "menu_block", "source_stmt", "comment",
yann@1
   595
  "comment_stmt", "help_start", "help", "depends_list", "depends",
yann@943
   596
  "prompt_stmt_opt", "prompt", "end", "nl", "if_expr", "expr", "symbol",
yann@943
   597
  "word_opt", 0
yann@1
   598
};
yann@1
   599
#endif
yann@1
   600
yann@1
   601
# ifdef YYPRINT
yann@1
   602
/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
yann@1
   603
   token YYLEX-NUM.  */
yann@943
   604
static const yytype_uint16 yytoknum[] =
yann@1
   605
{
yann@1
   606
       0,   256,   257,   258,   259,   260,   261,   262,   263,   264,
yann@1
   607
     265,   266,   267,   268,   269,   270,   271,   272,   273,   274,
yann@1
   608
     275,   276,   277,   278,   279,   280,   281,   282,   283,   284,
yann@943
   609
     285,   286,   287,   288,   289
yann@1
   610
};
yann@1
   611
# endif
yann@1
   612
yann@1
   613
/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
yann@943
   614
static const yytype_uint8 yyr1[] =
yann@1
   615
{
yann@943
   616
       0,    35,    36,    37,    37,    37,    37,    37,    37,    37,
yann@943
   617
      37,    37,    38,    38,    38,    38,    38,    38,    38,    39,
yann@943
   618
      39,    39,    39,    39,    39,    40,    40,    41,    42,    43,
yann@943
   619
      44,    45,    45,    45,    45,    45,    45,    45,    46,    46,
yann@943
   620
      46,    46,    46,    47,    48,    48,    49,    49,    50,    51,
yann@943
   621
      52,    53,    54,    54,    54,    54,    54,    54,    55,    55,
yann@943
   622
      55,    55,    56,    56,    57,    58,    59,    60,    60,    60,
yann@943
   623
      60,    61,    62,    63,    64,    65,    65,    65,    65,    66,
yann@943
   624
      67,    68,    69,    70,    71,    71,    71,    71,    72,    73,
yann@943
   625
      73,    74,    74,    75,    75,    75,    76,    76,    77,    77,
yann@943
   626
      78,    78,    78,    78,    78,    78,    78,    79,    79,    80,
yann@1
   627
      80
yann@1
   628
};
yann@1
   629
yann@1
   630
/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
yann@943
   631
static const yytype_uint8 yyr2[] =
yann@1
   632
{
yann@1
   633
       0,     2,     1,     0,     2,     2,     2,     4,     2,     4,
yann@1
   634
       4,     3,     1,     1,     1,     1,     1,     1,     1,     1,
yann@1
   635
       1,     1,     1,     1,     1,     3,     2,     3,     2,     3,
yann@1
   636
       2,     0,     2,     2,     2,     2,     2,     2,     3,     4,
yann@943
   637
       4,     4,     5,     3,     0,     3,     0,     2,     3,     2,
yann@1
   638
       1,     3,     0,     2,     2,     2,     2,     2,     4,     3,
yann@1
   639
       2,     4,     0,     2,     3,     1,     3,     0,     2,     2,
yann@1
   640
       2,     3,     2,     1,     3,     0,     2,     2,     2,     3,
yann@943
   641
       3,     2,     2,     2,     0,     2,     2,     2,     4,     0,
yann@943
   642
       2,     1,     1,     2,     2,     2,     1,     2,     0,     2,
yann@943
   643
       1,     3,     3,     3,     2,     3,     3,     1,     1,     0,
yann@1
   644
       1
yann@1
   645
};
yann@1
   646
yann@1
   647
/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
yann@1
   648
   STATE-NUM when YYTABLE doesn't specify something else to do.  Zero
yann@1
   649
   means the default is an error.  */
yann@943
   650
static const yytype_uint8 yydefact[] =
yann@1
   651
{
yann@943
   652
       3,     0,     0,     1,     0,     0,     0,     0,     0,   109,
yann@1
   653
       0,     0,     0,     0,     0,     0,    12,    16,    13,    14,
yann@1
   654
      18,    15,    17,     0,    19,     0,     4,    31,    22,    31,
yann@1
   655
      23,    52,    62,     5,    67,    20,    84,    75,     6,    24,
yann@943
   656
      84,    21,     8,    11,    91,    92,     0,     0,    93,     0,
yann@943
   657
     110,     0,    94,     0,     0,     0,   107,   108,     0,     0,
yann@943
   658
       0,   100,    95,     0,     0,     0,     0,     0,     0,     0,
yann@943
   659
       0,     0,     0,    96,     7,    71,    79,    48,    80,    27,
yann@943
   660
      29,     0,   104,     0,     0,    64,     0,     0,     9,    10,
yann@943
   661
       0,     0,     0,     0,    89,     0,     0,     0,    44,     0,
yann@943
   662
      37,    36,    32,    33,     0,    35,    34,     0,     0,    89,
yann@943
   663
       0,    56,    57,    53,    55,    54,    63,    51,    50,    68,
yann@943
   664
      70,    66,    69,    65,    86,    87,    85,    76,    78,    74,
yann@943
   665
      77,    73,    97,   103,   105,   106,   102,   101,    26,    82,
yann@943
   666
       0,    98,     0,    98,    98,    98,     0,     0,     0,    83,
yann@943
   667
      60,    98,     0,    98,     0,     0,     0,    38,    90,     0,
yann@943
   668
       0,    98,    46,    43,    25,     0,    59,     0,    88,    99,
yann@943
   669
      39,    40,    41,     0,     0,    45,    58,    61,    42,    47
yann@1
   670
};
yann@1
   671
yann@943
   672
/* YYDEFGOTO[NTERM-NUM].  */
yann@943
   673
static const yytype_int16 yydefgoto[] =
yann@1
   674
{
yann@943
   675
      -1,     1,     2,    25,    26,   101,    27,    28,    29,    30,
yann@943
   676
      65,   102,   103,   147,   175,    31,    32,   117,    33,    67,
yann@943
   677
     113,    68,    34,   121,    35,    69,    36,    37,   129,    38,
yann@943
   678
      71,    39,    40,    41,   104,   105,    70,   106,   142,   143,
yann@943
   679
      42,    74,   156,    60,    61,    51
yann@1
   680
};
yann@1
   681
yann@1
   682
/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
yann@1
   683
   STATE-NUM.  */
yann@943
   684
#define YYPACT_NINF -80
yann@943
   685
static const yytype_int16 yypact[] =
yann@1
   686
{
yann@943
   687
     -80,     2,   132,   -80,   -13,    -1,    -1,    -2,    -1,     9,
yann@943
   688
      33,    -1,    27,    40,    -3,    38,   -80,   -80,   -80,   -80,
yann@943
   689
     -80,   -80,   -80,    71,   -80,    77,   -80,   -80,   -80,   -80,
yann@943
   690
     -80,   -80,   -80,   -80,   -80,   -80,   -80,   -80,   -80,   -80,
yann@943
   691
     -80,   -80,   -80,   -80,   -80,   -80,    57,    61,   -80,    63,
yann@943
   692
     -80,    76,   -80,    87,   101,   133,   -80,   -80,    -3,    -3,
yann@943
   693
     195,    -6,   -80,   136,   149,    39,   104,    65,   150,     5,
yann@943
   694
     194,     5,   167,   -80,   176,   -80,   -80,   -80,   -80,   -80,
yann@943
   695
     -80,    68,   -80,    -3,    -3,   176,    72,    72,   -80,   -80,
yann@943
   696
     177,   187,    78,    -1,    -1,    -3,   196,    72,   -80,   222,
yann@943
   697
     -80,   -80,   -80,   -80,   221,   -80,   -80,   205,    -1,    -1,
yann@943
   698
     211,   -80,   -80,   -80,   -80,   -80,   -80,   -80,   -80,   -80,
yann@943
   699
     -80,   -80,   -80,   -80,   -80,   -80,   -80,   -80,   -80,   -80,
yann@943
   700
     -80,   -80,   -80,   -80,   206,   -80,   -80,   -80,   -80,   -80,
yann@943
   701
      -3,   223,   209,   223,   197,   223,    72,     7,   210,   -80,
yann@943
   702
     -80,   223,   212,   223,   201,    -3,   213,   -80,   -80,   214,
yann@943
   703
     215,   223,   208,   -80,   -80,   216,   -80,   217,   -80,   113,
yann@943
   704
     -80,   -80,   -80,   218,    -1,   -80,   -80,   -80,   -80,   -80
yann@1
   705
};
yann@1
   706
yann@1
   707
/* YYPGOTO[NTERM-NUM].  */
yann@943
   708
static const yytype_int16 yypgoto[] =
yann@1
   709
{
yann@943
   710
     -80,   -80,   -80,   -80,   122,   -34,   -80,   -80,   -80,   -80,
yann@943
   711
     220,   -80,   -80,   -80,   -80,   -80,   -80,   -80,    59,   -80,
yann@943
   712
     -80,   -80,   -80,   -80,   -80,   -80,   -80,   -80,   -80,   125,
yann@943
   713
     -80,   -80,   -80,   -80,   -80,   183,   219,    22,   142,    -5,
yann@943
   714
     147,   192,    69,   -54,   -79,   -80
yann@1
   715
};
yann@1
   716
yann@1
   717
/* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
yann@1
   718
   positive, shift that token.  If negative, reduce the rule which
yann@1
   719
   number is the opposite.  If zero, do what YYDEFACT says.
yann@1
   720
   If YYTABLE_NINF, syntax error.  */
yann@1
   721
#define YYTABLE_NINF -82
yann@943
   722
static const yytype_int16 yytable[] =
yann@1
   723
{
yann@943
   724
      46,    47,     3,    49,    81,    82,    53,   136,   137,     6,
yann@943
   725
       7,     8,     9,    10,    11,    12,    13,    43,   146,    14,
yann@943
   726
      15,    86,    56,    57,    44,    45,    58,    87,    48,   134,
yann@943
   727
     135,    59,   162,   112,    50,    24,   125,   163,   125,   -28,
yann@943
   728
      90,   144,   -28,   -28,   -28,   -28,   -28,   -28,   -28,   -28,
yann@943
   729
     -28,    91,    54,   -28,   -28,    92,   -28,    93,    94,    95,
yann@943
   730
      96,    97,    98,    52,    99,    55,    90,   161,    62,   100,
yann@943
   731
     -49,   -49,    63,   -49,   -49,   -49,   -49,    91,    64,   -49,
yann@943
   732
     -49,    92,   107,   108,   109,   110,   154,    73,   141,   115,
yann@943
   733
      99,    75,   126,    76,   126,   111,   133,    56,    57,    83,
yann@943
   734
      84,   169,   140,   151,   -30,    90,    77,   -30,   -30,   -30,
yann@943
   735
     -30,   -30,   -30,   -30,   -30,   -30,    91,    78,   -30,   -30,
yann@943
   736
      92,   -30,    93,    94,    95,    96,    97,    98,   120,    99,
yann@943
   737
     128,    79,    -2,     4,   100,     5,     6,     7,     8,     9,
yann@943
   738
      10,    11,    12,    13,    83,    84,    14,    15,    16,    17,
yann@943
   739
      18,    19,    20,    21,    22,     7,     8,    23,    10,    11,
yann@943
   740
      12,    13,    24,    80,    14,    15,    88,   -81,    90,   179,
yann@943
   741
     -81,   -81,   -81,   -81,   -81,   -81,   -81,   -81,   -81,    89,
yann@943
   742
      24,   -81,   -81,    92,   -81,   -81,   -81,   -81,   -81,   -81,
yann@943
   743
     116,   119,    99,   127,   122,    90,   130,   124,   -72,   -72,
yann@943
   744
     -72,   -72,   -72,   -72,   -72,   -72,   132,   138,   -72,   -72,
yann@943
   745
      92,   155,   158,   159,   160,   118,   123,   139,   131,    99,
yann@943
   746
     165,   145,   167,   148,   124,    73,    83,    84,    83,    84,
yann@943
   747
     173,   168,    83,    84,   149,   150,   153,   155,    84,   157,
yann@943
   748
     164,   174,   166,   170,   171,   172,   176,   177,   178,    66,
yann@943
   749
     114,   152,    85,     0,     0,     0,     0,     0,     0,    72
yann@1
   750
};
yann@1
   751
yann@943
   752
static const yytype_int16 yycheck[] =
yann@1
   753
{
yann@943
   754
       5,     6,     0,     8,    58,    59,    11,    86,    87,     4,
yann@943
   755
       5,     6,     7,     8,     9,    10,    11,    30,    97,    14,
yann@943
   756
      15,    27,    25,    26,    25,    26,    29,    33,    30,    83,
yann@943
   757
      84,    34,    25,    67,    25,    30,    70,    30,    72,     0,
yann@943
   758
       1,    95,     3,     4,     5,     6,     7,     8,     9,    10,
yann@943
   759
      11,    12,    25,    14,    15,    16,    17,    18,    19,    20,
yann@943
   760
      21,    22,    23,    30,    25,    25,     1,   146,    30,    30,
yann@943
   761
       5,     6,     1,     8,     9,    10,    11,    12,     1,    14,
yann@943
   762
      15,    16,    17,    18,    19,    20,   140,    30,    93,    67,
yann@943
   763
      25,    30,    70,    30,    72,    30,    28,    25,    26,    31,
yann@943
   764
      32,   155,    24,   108,     0,     1,    30,     3,     4,     5,
yann@943
   765
       6,     7,     8,     9,    10,    11,    12,    30,    14,    15,
yann@943
   766
      16,    17,    18,    19,    20,    21,    22,    23,    69,    25,
yann@943
   767
      71,    30,     0,     1,    30,     3,     4,     5,     6,     7,
yann@943
   768
       8,     9,    10,    11,    31,    32,    14,    15,    16,    17,
yann@943
   769
      18,    19,    20,    21,    22,     5,     6,    25,     8,     9,
yann@943
   770
      10,    11,    30,    30,    14,    15,    30,     0,     1,   174,
yann@943
   771
       3,     4,     5,     6,     7,     8,     9,    10,    11,    30,
yann@943
   772
      30,    14,    15,    16,    17,    18,    19,    20,    21,    22,
yann@943
   773
      68,    69,    25,    71,    69,     1,    71,    30,     4,     5,
yann@943
   774
       6,     7,     8,     9,    10,    11,    30,    30,    14,    15,
yann@943
   775
      16,    14,   143,   144,   145,    68,    69,    30,    71,    25,
yann@943
   776
     151,    25,   153,     1,    30,    30,    31,    32,    31,    32,
yann@943
   777
     161,    30,    31,    32,    13,    30,    25,    14,    32,    30,
yann@943
   778
      30,    33,    30,    30,    30,    30,    30,    30,    30,    29,
yann@943
   779
      67,   109,    60,    -1,    -1,    -1,    -1,    -1,    -1,    40
yann@1
   780
};
yann@1
   781
yann@1
   782
/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
yann@1
   783
   symbol of state STATE-NUM.  */
yann@943
   784
static const yytype_uint8 yystos[] =
yann@1
   785
{
yann@943
   786
       0,    36,    37,     0,     1,     3,     4,     5,     6,     7,
yann@943
   787
       8,     9,    10,    11,    14,    15,    16,    17,    18,    19,
yann@943
   788
      20,    21,    22,    25,    30,    38,    39,    41,    42,    43,
yann@943
   789
      44,    50,    51,    53,    57,    59,    61,    62,    64,    66,
yann@943
   790
      67,    68,    75,    30,    25,    26,    74,    74,    30,    74,
yann@943
   791
      25,    80,    30,    74,    25,    25,    25,    26,    29,    34,
yann@943
   792
      78,    79,    30,     1,     1,    45,    45,    54,    56,    60,
yann@943
   793
      71,    65,    71,    30,    76,    30,    30,    30,    30,    30,
yann@943
   794
      30,    78,    78,    31,    32,    76,    27,    33,    30,    30,
yann@943
   795
       1,    12,    16,    18,    19,    20,    21,    22,    23,    25,
yann@943
   796
      30,    40,    46,    47,    69,    70,    72,    17,    18,    19,
yann@943
   797
      20,    30,    40,    55,    70,    72,    39,    52,    75,    39,
yann@943
   798
      53,    58,    64,    75,    30,    40,    72,    39,    53,    63,
yann@943
   799
      64,    75,    30,    28,    78,    78,    79,    79,    30,    30,
yann@943
   800
      24,    74,    73,    74,    78,    25,    79,    48,     1,    13,
yann@943
   801
      30,    74,    73,    25,    78,    14,    77,    30,    77,    77,
yann@943
   802
      77,    79,    25,    30,    30,    77,    30,    77,    30,    78,
yann@943
   803
      30,    30,    30,    77,    33,    49,    30,    30,    30,    74
yann@1
   804
};
yann@1
   805
yann@1
   806
#define yyerrok		(yyerrstatus = 0)
yann@1
   807
#define yyclearin	(yychar = YYEMPTY)
yann@1
   808
#define YYEMPTY		(-2)
yann@1
   809
#define YYEOF		0
yann@1
   810
yann@1
   811
#define YYACCEPT	goto yyacceptlab
yann@1
   812
#define YYABORT		goto yyabortlab
yann@1
   813
#define YYERROR		goto yyerrorlab
yann@1
   814
yann@1
   815
yann@1
   816
/* Like YYERROR except do call yyerror.  This remains here temporarily
yann@1
   817
   to ease the transition to the new meaning of YYERROR, for GCC.
yann@1
   818
   Once GCC version 2 has supplanted version 1, this can go.  */
yann@1
   819
yann@1
   820
#define YYFAIL		goto yyerrlab
yann@1
   821
yann@1
   822
#define YYRECOVERING()  (!!yyerrstatus)
yann@1
   823
yann@1
   824
#define YYBACKUP(Token, Value)					\
yann@1
   825
do								\
yann@1
   826
  if (yychar == YYEMPTY && yylen == 1)				\
yann@1
   827
    {								\
yann@1
   828
      yychar = (Token);						\
yann@1
   829
      yylval = (Value);						\
yann@1
   830
      yytoken = YYTRANSLATE (yychar);				\
yann@943
   831
      YYPOPSTACK (1);						\
yann@1
   832
      goto yybackup;						\
yann@1
   833
    }								\
yann@1
   834
  else								\
yann@1
   835
    {								\
yann@1
   836
      yyerror (YY_("syntax error: cannot back up")); \
yann@1
   837
      YYERROR;							\
yann@1
   838
    }								\
yann@943
   839
while (YYID (0))
yann@1
   840
yann@1
   841
yann@1
   842
#define YYTERROR	1
yann@1
   843
#define YYERRCODE	256
yann@1
   844
yann@1
   845
yann@1
   846
/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
yann@1
   847
   If N is 0, then set CURRENT to the empty location which ends
yann@1
   848
   the previous symbol: RHS[0] (always defined).  */
yann@1
   849
yann@1
   850
#define YYRHSLOC(Rhs, K) ((Rhs)[K])
yann@1
   851
#ifndef YYLLOC_DEFAULT
yann@1
   852
# define YYLLOC_DEFAULT(Current, Rhs, N)				\
yann@1
   853
    do									\
yann@943
   854
      if (YYID (N))                                                    \
yann@1
   855
	{								\
yann@1
   856
	  (Current).first_line   = YYRHSLOC (Rhs, 1).first_line;	\
yann@1
   857
	  (Current).first_column = YYRHSLOC (Rhs, 1).first_column;	\
yann@1
   858
	  (Current).last_line    = YYRHSLOC (Rhs, N).last_line;		\
yann@1
   859
	  (Current).last_column  = YYRHSLOC (Rhs, N).last_column;	\
yann@1
   860
	}								\
yann@1
   861
      else								\
yann@1
   862
	{								\
yann@1
   863
	  (Current).first_line   = (Current).last_line   =		\
yann@1
   864
	    YYRHSLOC (Rhs, 0).last_line;				\
yann@1
   865
	  (Current).first_column = (Current).last_column =		\
yann@1
   866
	    YYRHSLOC (Rhs, 0).last_column;				\
yann@1
   867
	}								\
yann@943
   868
    while (YYID (0))
yann@1
   869
#endif
yann@1
   870
yann@1
   871
yann@1
   872
/* YY_LOCATION_PRINT -- Print the location on the stream.
yann@1
   873
   This macro was not mandated originally: define only if we know
yann@1
   874
   we won't break user code: when these are the locations we know.  */
yann@1
   875
yann@1
   876
#ifndef YY_LOCATION_PRINT
yann@1
   877
# if YYLTYPE_IS_TRIVIAL
yann@1
   878
#  define YY_LOCATION_PRINT(File, Loc)			\
yann@1
   879
     fprintf (File, "%d.%d-%d.%d",			\
yann@943
   880
	      (Loc).first_line, (Loc).first_column,	\
yann@943
   881
	      (Loc).last_line,  (Loc).last_column)
yann@1
   882
# else
yann@1
   883
#  define YY_LOCATION_PRINT(File, Loc) ((void) 0)
yann@1
   884
# endif
yann@1
   885
#endif
yann@1
   886
yann@1
   887
yann@1
   888
/* YYLEX -- calling `yylex' with the right arguments.  */
yann@1
   889
yann@1
   890
#ifdef YYLEX_PARAM
yann@1
   891
# define YYLEX yylex (YYLEX_PARAM)
yann@1
   892
#else
yann@1
   893
# define YYLEX yylex ()
yann@1
   894
#endif
yann@1
   895
yann@1
   896
/* Enable debugging if requested.  */
yann@1
   897
#if YYDEBUG
yann@1
   898
yann@1
   899
# ifndef YYFPRINTF
yann@1
   900
#  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
yann@1
   901
#  define YYFPRINTF fprintf
yann@1
   902
# endif
yann@1
   903
yann@1
   904
# define YYDPRINTF(Args)			\
yann@1
   905
do {						\
yann@1
   906
  if (yydebug)					\
yann@1
   907
    YYFPRINTF Args;				\
yann@943
   908
} while (YYID (0))
yann@1
   909
yann@943
   910
# define YY_SYMBOL_PRINT(Title, Type, Value, Location)			  \
yann@943
   911
do {									  \
yann@943
   912
  if (yydebug)								  \
yann@943
   913
    {									  \
yann@943
   914
      YYFPRINTF (stderr, "%s ", Title);					  \
yann@943
   915
      yy_symbol_print (stderr,						  \
yann@943
   916
		  Type, Value); \
yann@943
   917
      YYFPRINTF (stderr, "\n");						  \
yann@943
   918
    }									  \
yann@943
   919
} while (YYID (0))
yann@943
   920
yann@943
   921
yann@943
   922
/*--------------------------------.
yann@943
   923
| Print this symbol on YYOUTPUT.  |
yann@943
   924
`--------------------------------*/
yann@943
   925
yann@943
   926
/*ARGSUSED*/
yann@943
   927
#if (defined __STDC__ || defined __C99__FUNC__ \
yann@943
   928
     || defined __cplusplus || defined _MSC_VER)
yann@943
   929
static void
yann@943
   930
yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
yann@943
   931
#else
yann@943
   932
static void
yann@943
   933
yy_symbol_value_print (yyoutput, yytype, yyvaluep)
yann@943
   934
    FILE *yyoutput;
yann@943
   935
    int yytype;
yann@943
   936
    YYSTYPE const * const yyvaluep;
yann@943
   937
#endif
yann@943
   938
{
yann@943
   939
  if (!yyvaluep)
yann@943
   940
    return;
yann@943
   941
# ifdef YYPRINT
yann@943
   942
  if (yytype < YYNTOKENS)
yann@943
   943
    YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
yann@943
   944
# else
yann@943
   945
  YYUSE (yyoutput);
yann@943
   946
# endif
yann@943
   947
  switch (yytype)
yann@943
   948
    {
yann@943
   949
      default:
yann@943
   950
	break;
yann@943
   951
    }
yann@943
   952
}
yann@943
   953
yann@943
   954
yann@943
   955
/*--------------------------------.
yann@943
   956
| Print this symbol on YYOUTPUT.  |
yann@943
   957
`--------------------------------*/
yann@943
   958
yann@943
   959
#if (defined __STDC__ || defined __C99__FUNC__ \
yann@943
   960
     || defined __cplusplus || defined _MSC_VER)
yann@943
   961
static void
yann@943
   962
yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
yann@943
   963
#else
yann@943
   964
static void
yann@943
   965
yy_symbol_print (yyoutput, yytype, yyvaluep)
yann@943
   966
    FILE *yyoutput;
yann@943
   967
    int yytype;
yann@943
   968
    YYSTYPE const * const yyvaluep;
yann@943
   969
#endif
yann@943
   970
{
yann@943
   971
  if (yytype < YYNTOKENS)
yann@943
   972
    YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
yann@943
   973
  else
yann@943
   974
    YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
yann@943
   975
yann@943
   976
  yy_symbol_value_print (yyoutput, yytype, yyvaluep);
yann@943
   977
  YYFPRINTF (yyoutput, ")");
yann@943
   978
}
yann@1
   979
yann@1
   980
/*------------------------------------------------------------------.
yann@1
   981
| yy_stack_print -- Print the state stack from its BOTTOM up to its |
yann@1
   982
| TOP (included).                                                   |
yann@1
   983
`------------------------------------------------------------------*/
yann@1
   984
yann@943
   985
#if (defined __STDC__ || defined __C99__FUNC__ \
yann@943
   986
     || defined __cplusplus || defined _MSC_VER)
yann@1
   987
static void
yann@943
   988
yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)
yann@1
   989
#else
yann@1
   990
static void
yann@1
   991
yy_stack_print (bottom, top)
yann@943
   992
    yytype_int16 *bottom;
yann@943
   993
    yytype_int16 *top;
yann@1
   994
#endif
yann@1
   995
{
yann@1
   996
  YYFPRINTF (stderr, "Stack now");
yann@943
   997
  for (; bottom <= top; ++bottom)
yann@1
   998
    YYFPRINTF (stderr, " %d", *bottom);
yann@1
   999
  YYFPRINTF (stderr, "\n");
yann@1
  1000
}
yann@1
  1001
yann@1
  1002
# define YY_STACK_PRINT(Bottom, Top)				\
yann@1
  1003
do {								\
yann@1
  1004
  if (yydebug)							\
yann@1
  1005
    yy_stack_print ((Bottom), (Top));				\
yann@943
  1006
} while (YYID (0))
yann@1
  1007
yann@1
  1008
yann@1
  1009
/*------------------------------------------------.
yann@1
  1010
| Report that the YYRULE is going to be reduced.  |
yann@1
  1011
`------------------------------------------------*/
yann@1
  1012
yann@943
  1013
#if (defined __STDC__ || defined __C99__FUNC__ \
yann@943
  1014
     || defined __cplusplus || defined _MSC_VER)
yann@1
  1015
static void
yann@943
  1016
yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
yann@1
  1017
#else
yann@1
  1018
static void
yann@943
  1019
yy_reduce_print (yyvsp, yyrule)
yann@943
  1020
    YYSTYPE *yyvsp;
yann@1
  1021
    int yyrule;
yann@1
  1022
#endif
yann@1
  1023
{
yann@943
  1024
  int yynrhs = yyr2[yyrule];
yann@1
  1025
  int yyi;
yann@1
  1026
  unsigned long int yylno = yyrline[yyrule];
yann@943
  1027
  YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
yann@943
  1028
	     yyrule - 1, yylno);
yann@943
  1029
  /* The symbols being reduced.  */
yann@943
  1030
  for (yyi = 0; yyi < yynrhs; yyi++)
yann@943
  1031
    {
yann@943
  1032
      fprintf (stderr, "   $%d = ", yyi + 1);
yann@943
  1033
      yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
yann@943
  1034
		       &(yyvsp[(yyi + 1) - (yynrhs)])
yann@943
  1035
		       		       );
yann@943
  1036
      fprintf (stderr, "\n");
yann@943
  1037
    }
yann@1
  1038
}
yann@1
  1039
yann@1
  1040
# define YY_REDUCE_PRINT(Rule)		\
yann@1
  1041
do {					\
yann@1
  1042
  if (yydebug)				\
yann@943
  1043
    yy_reduce_print (yyvsp, Rule); \
yann@943
  1044
} while (YYID (0))
yann@1
  1045
yann@1
  1046
/* Nonzero means print parse trace.  It is left uninitialized so that
yann@1
  1047
   multiple parsers can coexist.  */
yann@1
  1048
int yydebug;
yann@1
  1049
#else /* !YYDEBUG */
yann@1
  1050
# define YYDPRINTF(Args)
yann@1
  1051
# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
yann@1
  1052
# define YY_STACK_PRINT(Bottom, Top)
yann@1
  1053
# define YY_REDUCE_PRINT(Rule)
yann@1
  1054
#endif /* !YYDEBUG */
yann@1
  1055
yann@1
  1056
yann@1
  1057
/* YYINITDEPTH -- initial size of the parser's stacks.  */
yann@1
  1058
#ifndef	YYINITDEPTH
yann@1
  1059
# define YYINITDEPTH 200
yann@1
  1060
#endif
yann@1
  1061
yann@1
  1062
/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
yann@1
  1063
   if the built-in stack extension method is used).
yann@1
  1064
yann@1
  1065
   Do not make this value too large; the results are undefined if
yann@1
  1066
   YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
yann@1
  1067
   evaluated with infinite-precision integer arithmetic.  */
yann@1
  1068
yann@1
  1069
#ifndef YYMAXDEPTH
yann@1
  1070
# define YYMAXDEPTH 10000
yann@1
  1071
#endif
yann@1
  1072
yann@1
  1073

yann@1
  1074
yann@1
  1075
#if YYERROR_VERBOSE
yann@1
  1076
yann@1
  1077
# ifndef yystrlen
yann@943
  1078
#  if defined __GLIBC__ && defined _STRING_H
yann@1
  1079
#   define yystrlen strlen
yann@1
  1080
#  else
yann@1
  1081
/* Return the length of YYSTR.  */
yann@943
  1082
#if (defined __STDC__ || defined __C99__FUNC__ \
yann@943
  1083
     || defined __cplusplus || defined _MSC_VER)
yann@1
  1084
static YYSIZE_T
yann@1
  1085
yystrlen (const char *yystr)
yann@943
  1086
#else
yann@943
  1087
static YYSIZE_T
yann@1
  1088
yystrlen (yystr)
yann@943
  1089
    const char *yystr;
yann@943
  1090
#endif
yann@1
  1091
{
yann@943
  1092
  YYSIZE_T yylen;
yann@943
  1093
  for (yylen = 0; yystr[yylen]; yylen++)
yann@1
  1094
    continue;
yann@943
  1095
  return yylen;
yann@1
  1096
}
yann@1
  1097
#  endif
yann@1
  1098
# endif
yann@1
  1099
yann@1
  1100
# ifndef yystpcpy
yann@943
  1101
#  if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
yann@1
  1102
#   define yystpcpy stpcpy
yann@1
  1103
#  else
yann@1
  1104
/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
yann@1
  1105
   YYDEST.  */
yann@943
  1106
#if (defined __STDC__ || defined __C99__FUNC__ \
yann@943
  1107
     || defined __cplusplus || defined _MSC_VER)
yann@1
  1108
static char *
yann@1
  1109
yystpcpy (char *yydest, const char *yysrc)
yann@943
  1110
#else
yann@943
  1111
static char *
yann@1
  1112
yystpcpy (yydest, yysrc)
yann@943
  1113
    char *yydest;
yann@943
  1114
    const char *yysrc;
yann@943
  1115
#endif
yann@1
  1116
{
yann@1
  1117
  char *yyd = yydest;
yann@1
  1118
  const char *yys = yysrc;
yann@1
  1119
yann@1
  1120
  while ((*yyd++ = *yys++) != '\0')
yann@1
  1121
    continue;
yann@1
  1122
yann@1
  1123
  return yyd - 1;
yann@1
  1124
}
yann@1
  1125
#  endif
yann@1
  1126
# endif
yann@1
  1127
yann@1
  1128
# ifndef yytnamerr
yann@1
  1129
/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
yann@1
  1130
   quotes and backslashes, so that it's suitable for yyerror.  The
yann@1
  1131
   heuristic is that double-quoting is unnecessary unless the string
yann@1
  1132
   contains an apostrophe, a comma, or backslash (other than
yann@1
  1133
   backslash-backslash).  YYSTR is taken from yytname.  If YYRES is
yann@1
  1134
   null, do not copy; instead, return the length of what the result
yann@1
  1135
   would have been.  */
yann@1
  1136
static YYSIZE_T
yann@1
  1137
yytnamerr (char *yyres, const char *yystr)
yann@1
  1138
{
yann@1
  1139
  if (*yystr == '"')
yann@1
  1140
    {
yann@943
  1141
      YYSIZE_T yyn = 0;
yann@1
  1142
      char const *yyp = yystr;
yann@1
  1143
yann@1
  1144
      for (;;)
yann@1
  1145
	switch (*++yyp)
yann@1
  1146
	  {
yann@1
  1147
	  case '\'':
yann@1
  1148
	  case ',':
yann@1
  1149
	    goto do_not_strip_quotes;
yann@1
  1150
yann@1
  1151
	  case '\\':
yann@1
  1152
	    if (*++yyp != '\\')
yann@1
  1153
	      goto do_not_strip_quotes;
yann@1
  1154
	    /* Fall through.  */
yann@1
  1155
	  default:
yann@1
  1156
	    if (yyres)
yann@1
  1157
	      yyres[yyn] = *yyp;
yann@1
  1158
	    yyn++;
yann@1
  1159
	    break;
yann@1
  1160
yann@1
  1161
	  case '"':
yann@1
  1162
	    if (yyres)
yann@1
  1163
	      yyres[yyn] = '\0';
yann@1
  1164
	    return yyn;
yann@1
  1165
	  }
yann@1
  1166
    do_not_strip_quotes: ;
yann@1
  1167
    }
yann@1
  1168
yann@1
  1169
  if (! yyres)
yann@1
  1170
    return yystrlen (yystr);
yann@1
  1171
yann@1
  1172
  return yystpcpy (yyres, yystr) - yyres;
yann@1
  1173
}
yann@1
  1174
# endif
yann@1
  1175
yann@943
  1176
/* Copy into YYRESULT an error message about the unexpected token
yann@943
  1177
   YYCHAR while in state YYSTATE.  Return the number of bytes copied,
yann@943
  1178
   including the terminating null byte.  If YYRESULT is null, do not
yann@943
  1179
   copy anything; just return the number of bytes that would be
yann@943
  1180
   copied.  As a special case, return 0 if an ordinary "syntax error"
yann@943
  1181
   message will do.  Return YYSIZE_MAXIMUM if overflow occurs during
yann@943
  1182
   size calculation.  */
yann@943
  1183
static YYSIZE_T
yann@943
  1184
yysyntax_error (char *yyresult, int yystate, int yychar)
yann@943
  1185
{
yann@943
  1186
  int yyn = yypact[yystate];
yann@943
  1187
yann@943
  1188
  if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
yann@943
  1189
    return 0;
yann@943
  1190
  else
yann@943
  1191
    {
yann@943
  1192
      int yytype = YYTRANSLATE (yychar);
yann@943
  1193
      YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
yann@943
  1194
      YYSIZE_T yysize = yysize0;
yann@943
  1195
      YYSIZE_T yysize1;
yann@943
  1196
      int yysize_overflow = 0;
yann@943
  1197
      enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
yann@943
  1198
      char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
yann@943
  1199
      int yyx;
yann@943
  1200
yann@943
  1201
# if 0
yann@943
  1202
      /* This is so xgettext sees the translatable formats that are
yann@943
  1203
	 constructed on the fly.  */
yann@943
  1204
      YY_("syntax error, unexpected %s");
yann@943
  1205
      YY_("syntax error, unexpected %s, expecting %s");
yann@943
  1206
      YY_("syntax error, unexpected %s, expecting %s or %s");
yann@943
  1207
      YY_("syntax error, unexpected %s, expecting %s or %s or %s");
yann@943
  1208
      YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
yann@943
  1209
# endif
yann@943
  1210
      char *yyfmt;
yann@943
  1211
      char const *yyf;
yann@943
  1212
      static char const yyunexpected[] = "syntax error, unexpected %s";
yann@943
  1213
      static char const yyexpecting[] = ", expecting %s";
yann@943
  1214
      static char const yyor[] = " or %s";
yann@943
  1215
      char yyformat[sizeof yyunexpected
yann@943
  1216
		    + sizeof yyexpecting - 1
yann@943
  1217
		    + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
yann@943
  1218
		       * (sizeof yyor - 1))];
yann@943
  1219
      char const *yyprefix = yyexpecting;
yann@943
  1220
yann@943
  1221
      /* Start YYX at -YYN if negative to avoid negative indexes in
yann@943
  1222
	 YYCHECK.  */
yann@943
  1223
      int yyxbegin = yyn < 0 ? -yyn : 0;
yann@943
  1224
yann@943
  1225
      /* Stay within bounds of both yycheck and yytname.  */
yann@943
  1226
      int yychecklim = YYLAST - yyn + 1;
yann@943
  1227
      int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
yann@943
  1228
      int yycount = 1;
yann@943
  1229
yann@943
  1230
      yyarg[0] = yytname[yytype];
yann@943
  1231
      yyfmt = yystpcpy (yyformat, yyunexpected);
yann@943
  1232
yann@943
  1233
      for (yyx = yyxbegin; yyx < yyxend; ++yyx)
yann@943
  1234
	if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
yann@943
  1235
	  {
yann@943
  1236
	    if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
yann@943
  1237
	      {
yann@943
  1238
		yycount = 1;
yann@943
  1239
		yysize = yysize0;
yann@943
  1240
		yyformat[sizeof yyunexpected - 1] = '\0';
yann@943
  1241
		break;
yann@943
  1242
	      }
yann@943
  1243
	    yyarg[yycount++] = yytname[yyx];
yann@943
  1244
	    yysize1 = yysize + yytnamerr (0, yytname[yyx]);
yann@943
  1245
	    yysize_overflow |= (yysize1 < yysize);
yann@943
  1246
	    yysize = yysize1;
yann@943
  1247
	    yyfmt = yystpcpy (yyfmt, yyprefix);
yann@943
  1248
	    yyprefix = yyor;
yann@943
  1249
	  }
yann@943
  1250
yann@943
  1251
      yyf = YY_(yyformat);
yann@943
  1252
      yysize1 = yysize + yystrlen (yyf);
yann@943
  1253
      yysize_overflow |= (yysize1 < yysize);
yann@943
  1254
      yysize = yysize1;
yann@943
  1255
yann@943
  1256
      if (yysize_overflow)
yann@943
  1257
	return YYSIZE_MAXIMUM;
yann@943
  1258
yann@943
  1259
      if (yyresult)
yann@943
  1260
	{
yann@943
  1261
	  /* Avoid sprintf, as that infringes on the user's name space.
yann@943
  1262
	     Don't have undefined behavior even if the translation
yann@943
  1263
	     produced a string with the wrong number of "%s"s.  */
yann@943
  1264
	  char *yyp = yyresult;
yann@943
  1265
	  int yyi = 0;
yann@943
  1266
	  while ((*yyp = *yyf) != '\0')
yann@943
  1267
	    {
yann@943
  1268
	      if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
yann@943
  1269
		{
yann@943
  1270
		  yyp += yytnamerr (yyp, yyarg[yyi++]);
yann@943
  1271
		  yyf += 2;
yann@943
  1272
		}
yann@943
  1273
	      else
yann@943
  1274
		{
yann@943
  1275
		  yyp++;
yann@943
  1276
		  yyf++;
yann@943
  1277
		}
yann@943
  1278
	    }
yann@943
  1279
	}
yann@943
  1280
      return yysize;
yann@943
  1281
    }
yann@943
  1282
}
yann@1
  1283
#endif /* YYERROR_VERBOSE */
yann@1
  1284

yann@1
  1285
yann@1
  1286
/*-----------------------------------------------.
yann@1
  1287
| Release the memory associated to this symbol.  |
yann@1
  1288
`-----------------------------------------------*/
yann@1
  1289
yann@943
  1290
/*ARGSUSED*/
yann@943
  1291
#if (defined __STDC__ || defined __C99__FUNC__ \
yann@943
  1292
     || defined __cplusplus || defined _MSC_VER)
yann@1
  1293
static void
yann@1
  1294
yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
yann@1
  1295
#else
yann@1
  1296
static void
yann@1
  1297
yydestruct (yymsg, yytype, yyvaluep)
yann@1
  1298
    const char *yymsg;
yann@1
  1299
    int yytype;
yann@1
  1300
    YYSTYPE *yyvaluep;
yann@1
  1301
#endif
yann@1
  1302
{
yann@943
  1303
  YYUSE (yyvaluep);
yann@1
  1304
yann@1
  1305
  if (!yymsg)
yann@1
  1306
    yymsg = "Deleting";
yann@1
  1307
  YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
yann@1
  1308
yann@1
  1309
  switch (yytype)
yann@1
  1310
    {
yann@943
  1311
      case 51: /* "choice_entry" */
yann@1
  1312
yann@943
  1313
	{
yann@1
  1314
	fprintf(stderr, "%s:%d: missing end statement for this entry\n",
yann@1
  1315
		(yyvaluep->menu)->file->name, (yyvaluep->menu)->lineno);
yann@1
  1316
	if (current_menu == (yyvaluep->menu))
yann@1
  1317
		menu_end_menu();
yann@1
  1318
};
yann@1
  1319
yann@943
  1320
	break;
yann@943
  1321
      case 57: /* "if_entry" */
yann@1
  1322
yann@943
  1323
	{
yann@1
  1324
	fprintf(stderr, "%s:%d: missing end statement for this entry\n",
yann@1
  1325
		(yyvaluep->menu)->file->name, (yyvaluep->menu)->lineno);
yann@1
  1326
	if (current_menu == (yyvaluep->menu))
yann@1
  1327
		menu_end_menu();
yann@1
  1328
};
yann@1
  1329
yann@943
  1330
	break;
yann@943
  1331
      case 62: /* "menu_entry" */
yann@1
  1332
yann@943
  1333
	{
yann@1
  1334
	fprintf(stderr, "%s:%d: missing end statement for this entry\n",
yann@1
  1335
		(yyvaluep->menu)->file->name, (yyvaluep->menu)->lineno);
yann@1
  1336
	if (current_menu == (yyvaluep->menu))
yann@1
  1337
		menu_end_menu();
yann@1
  1338
};
yann@1
  1339
yann@943
  1340
	break;
yann@1
  1341
yann@1
  1342
      default:
yann@943
  1343
	break;
yann@1
  1344
    }
yann@1
  1345
}
yann@1
  1346

yann@1
  1347
yann@1
  1348
/* Prevent warnings from -Wmissing-prototypes.  */
yann@1
  1349
yann@1
  1350
#ifdef YYPARSE_PARAM
yann@943
  1351
#if defined __STDC__ || defined __cplusplus
yann@1
  1352
int yyparse (void *YYPARSE_PARAM);
yann@943
  1353
#else
yann@1
  1354
int yyparse ();
yann@943
  1355
#endif
yann@1
  1356
#else /* ! YYPARSE_PARAM */
yann@943
  1357
#if defined __STDC__ || defined __cplusplus
yann@1
  1358
int yyparse (void);
yann@1
  1359
#else
yann@1
  1360
int yyparse ();
yann@1
  1361
#endif
yann@1
  1362
#endif /* ! YYPARSE_PARAM */
yann@1
  1363
yann@1
  1364
yann@1
  1365
yann@1
  1366
/* The look-ahead symbol.  */
yann@1
  1367
int yychar;
yann@1
  1368
yann@1
  1369
/* The semantic value of the look-ahead symbol.  */
yann@1
  1370
YYSTYPE yylval;
yann@1
  1371
yann@1
  1372
/* Number of syntax errors so far.  */
yann@1
  1373
int yynerrs;
yann@1
  1374
yann@1
  1375
yann@1
  1376
yann@1
  1377
/*----------.
yann@1
  1378
| yyparse.  |
yann@1
  1379
`----------*/
yann@1
  1380
yann@1
  1381
#ifdef YYPARSE_PARAM
yann@943
  1382
#if (defined __STDC__ || defined __C99__FUNC__ \
yann@943
  1383
     || defined __cplusplus || defined _MSC_VER)
yann@943
  1384
int
yann@943
  1385
yyparse (void *YYPARSE_PARAM)
yann@943
  1386
#else
yann@943
  1387
int
yann@943
  1388
yyparse (YYPARSE_PARAM)
yann@943
  1389
    void *YYPARSE_PARAM;
yann@943
  1390
#endif
yann@1
  1391
#else /* ! YYPARSE_PARAM */
yann@943
  1392
#if (defined __STDC__ || defined __C99__FUNC__ \
yann@943
  1393
     || defined __cplusplus || defined _MSC_VER)
yann@1
  1394
int
yann@1
  1395
yyparse (void)
yann@1
  1396
#else
yann@1
  1397
int
yann@1
  1398
yyparse ()
yann@943
  1399
yann@1
  1400
#endif
yann@1
  1401
#endif
yann@1
  1402
{
yann@1
  1403
  
yann@1
  1404
  int yystate;
yann@1
  1405
  int yyn;
yann@1
  1406
  int yyresult;
yann@1
  1407
  /* Number of tokens to shift before error messages enabled.  */
yann@1
  1408
  int yyerrstatus;
yann@1
  1409
  /* Look-ahead token as an internal (translated) token number.  */
yann@1
  1410
  int yytoken = 0;
yann@943
  1411
#if YYERROR_VERBOSE
yann@943
  1412
  /* Buffer for error messages, and its allocated size.  */
yann@943
  1413
  char yymsgbuf[128];
yann@943
  1414
  char *yymsg = yymsgbuf;
yann@943
  1415
  YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
yann@943
  1416
#endif
yann@1
  1417
yann@1
  1418
  /* Three stacks and their tools:
yann@1
  1419
     `yyss': related to states,
yann@1
  1420
     `yyvs': related to semantic values,
yann@1
  1421
     `yyls': related to locations.
yann@1
  1422
yann@1
  1423
     Refer to the stacks thru separate pointers, to allow yyoverflow
yann@1
  1424
     to reallocate them elsewhere.  */
yann@1
  1425
yann@1
  1426
  /* The state stack.  */
yann@943
  1427
  yytype_int16 yyssa[YYINITDEPTH];
yann@943
  1428
  yytype_int16 *yyss = yyssa;
yann@943
  1429
  yytype_int16 *yyssp;
yann@1
  1430
yann@1
  1431
  /* The semantic value stack.  */
yann@1
  1432
  YYSTYPE yyvsa[YYINITDEPTH];
yann@1
  1433
  YYSTYPE *yyvs = yyvsa;
yann@1
  1434
  YYSTYPE *yyvsp;
yann@1
  1435
yann@1
  1436
yann@1
  1437
yann@943
  1438
#define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N))
yann@1
  1439
yann@1
  1440
  YYSIZE_T yystacksize = YYINITDEPTH;
yann@1
  1441
yann@1
  1442
  /* The variables used to return semantic value and location from the
yann@1
  1443
     action routines.  */
yann@1
  1444
  YYSTYPE yyval;
yann@1
  1445
yann@1
  1446
yann@943
  1447
  /* The number of symbols on the RHS of the reduced rule.
yann@943
  1448
     Keep to zero when no symbol should be popped.  */
yann@943
  1449
  int yylen = 0;
yann@1
  1450
yann@1
  1451
  YYDPRINTF ((stderr, "Starting parse\n"));
yann@1
  1452
yann@1
  1453
  yystate = 0;
yann@1
  1454
  yyerrstatus = 0;
yann@1
  1455
  yynerrs = 0;
yann@1
  1456
  yychar = YYEMPTY;		/* Cause a token to be read.  */
yann@1
  1457
yann@1
  1458
  /* Initialize stack pointers.
yann@1
  1459
     Waste one element of value and location stack
yann@1
  1460
     so that they stay on the same level as the state stack.
yann@1
  1461
     The wasted elements are never initialized.  */
yann@1
  1462
yann@1
  1463
  yyssp = yyss;
yann@1
  1464
  yyvsp = yyvs;
yann@1
  1465
yann@1
  1466
  goto yysetstate;
yann@1
  1467
yann@1
  1468
/*------------------------------------------------------------.
yann@1
  1469
| yynewstate -- Push a new state, which is found in yystate.  |
yann@1
  1470
`------------------------------------------------------------*/
yann@1
  1471
 yynewstate:
yann@1
  1472
  /* In all cases, when you get here, the value and location stacks
yann@943
  1473
     have just been pushed.  So pushing a state here evens the stacks.  */
yann@1
  1474
  yyssp++;
yann@1
  1475
yann@1
  1476
 yysetstate:
yann@1
  1477
  *yyssp = yystate;
yann@1
  1478
yann@1
  1479
  if (yyss + yystacksize - 1 <= yyssp)
yann@1
  1480
    {
yann@1
  1481
      /* Get the current used size of the three stacks, in elements.  */
yann@1
  1482
      YYSIZE_T yysize = yyssp - yyss + 1;
yann@1
  1483
yann@1
  1484
#ifdef yyoverflow
yann@1
  1485
      {
yann@943
  1486
	/* Give user a chance to reallocate the stack.  Use copies of
yann@1
  1487
	   these so that the &'s don't force the real ones into
yann@1
  1488
	   memory.  */
yann@1
  1489
	YYSTYPE *yyvs1 = yyvs;
yann@943
  1490
	yytype_int16 *yyss1 = yyss;
yann@1
  1491
yann@1
  1492
yann@1
  1493
	/* Each stack pointer address is followed by the size of the
yann@1
  1494
	   data in use in that stack, in bytes.  This used to be a
yann@1
  1495
	   conditional around just the two extra args, but that might
yann@1
  1496
	   be undefined if yyoverflow is a macro.  */
yann@1
  1497
	yyoverflow (YY_("memory exhausted"),
yann@1
  1498
		    &yyss1, yysize * sizeof (*yyssp),
yann@1
  1499
		    &yyvs1, yysize * sizeof (*yyvsp),
yann@1
  1500
yann@1
  1501
		    &yystacksize);
yann@1
  1502
yann@1
  1503
	yyss = yyss1;
yann@1
  1504
	yyvs = yyvs1;
yann@1
  1505
      }
yann@1
  1506
#else /* no yyoverflow */
yann@1
  1507
# ifndef YYSTACK_RELOCATE
yann@1
  1508
      goto yyexhaustedlab;
yann@1
  1509
# else
yann@1
  1510
      /* Extend the stack our own way.  */
yann@1
  1511
      if (YYMAXDEPTH <= yystacksize)
yann@1
  1512
	goto yyexhaustedlab;
yann@1
  1513
      yystacksize *= 2;
yann@1
  1514
      if (YYMAXDEPTH < yystacksize)
yann@1
  1515
	yystacksize = YYMAXDEPTH;
yann@1
  1516
yann@1
  1517
      {
yann@943
  1518
	yytype_int16 *yyss1 = yyss;
yann@1
  1519
	union yyalloc *yyptr =
yann@1
  1520
	  (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
yann@1
  1521
	if (! yyptr)
yann@1
  1522
	  goto yyexhaustedlab;
yann@1
  1523
	YYSTACK_RELOCATE (yyss);
yann@1
  1524
	YYSTACK_RELOCATE (yyvs);
yann@1
  1525
yann@1
  1526
#  undef YYSTACK_RELOCATE
yann@1
  1527
	if (yyss1 != yyssa)
yann@1
  1528
	  YYSTACK_FREE (yyss1);
yann@1
  1529
      }
yann@1
  1530
# endif
yann@1
  1531
#endif /* no yyoverflow */
yann@1
  1532
yann@1
  1533
      yyssp = yyss + yysize - 1;
yann@1
  1534
      yyvsp = yyvs + yysize - 1;
yann@1
  1535
yann@1
  1536
yann@1
  1537
      YYDPRINTF ((stderr, "Stack size increased to %lu\n",
yann@1
  1538
		  (unsigned long int) yystacksize));
yann@1
  1539
yann@1
  1540
      if (yyss + yystacksize - 1 <= yyssp)
yann@1
  1541
	YYABORT;
yann@1
  1542
    }
yann@1
  1543
yann@1
  1544
  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
yann@1
  1545
yann@1
  1546
  goto yybackup;
yann@1
  1547
yann@1
  1548
/*-----------.
yann@1
  1549
| yybackup.  |
yann@1
  1550
`-----------*/
yann@1
  1551
yybackup:
yann@1
  1552
yann@943
  1553
  /* Do appropriate processing given the current state.  Read a
yann@943
  1554
     look-ahead token if we need one and don't already have one.  */
yann@1
  1555
yann@1
  1556
  /* First try to decide what to do without reference to look-ahead token.  */
yann@1
  1557
  yyn = yypact[yystate];
yann@1
  1558
  if (yyn == YYPACT_NINF)
yann@1
  1559
    goto yydefault;
yann@1
  1560
yann@1
  1561
  /* Not known => get a look-ahead token if don't already have one.  */
yann@1
  1562
yann@1
  1563
  /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol.  */
yann@1
  1564
  if (yychar == YYEMPTY)
yann@1
  1565
    {
yann@1
  1566
      YYDPRINTF ((stderr, "Reading a token: "));
yann@1
  1567
      yychar = YYLEX;
yann@1
  1568
    }
yann@1
  1569
yann@1
  1570
  if (yychar <= YYEOF)
yann@1
  1571
    {
yann@1
  1572
      yychar = yytoken = YYEOF;
yann@1
  1573
      YYDPRINTF ((stderr, "Now at end of input.\n"));
yann@1
  1574
    }
yann@1
  1575
  else
yann@1
  1576
    {
yann@1
  1577
      yytoken = YYTRANSLATE (yychar);
yann@1
  1578
      YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
yann@1
  1579
    }
yann@1
  1580
yann@1
  1581
  /* If the proper action on seeing token YYTOKEN is to reduce or to
yann@1
  1582
     detect an error, take that action.  */
yann@1
  1583
  yyn += yytoken;
yann@1
  1584
  if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
yann@1
  1585
    goto yydefault;
yann@1
  1586
  yyn = yytable[yyn];
yann@1
  1587
  if (yyn <= 0)
yann@1
  1588
    {
yann@1
  1589
      if (yyn == 0 || yyn == YYTABLE_NINF)
yann@1
  1590
	goto yyerrlab;
yann@1
  1591
      yyn = -yyn;
yann@1
  1592
      goto yyreduce;
yann@1
  1593
    }
yann@1
  1594
yann@1
  1595
  if (yyn == YYFINAL)
yann@1
  1596
    YYACCEPT;
yann@1
  1597
yann@1
  1598
  /* Count tokens shifted since error; after three, turn off error
yann@1
  1599
     status.  */
yann@1
  1600
  if (yyerrstatus)
yann@1
  1601
    yyerrstatus--;
yann@1
  1602
yann@943
  1603
  /* Shift the look-ahead token.  */
yann@943
  1604
  YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
yann@943
  1605
yann@943
  1606
  /* Discard the shifted token unless it is eof.  */
yann@943
  1607
  if (yychar != YYEOF)
yann@943
  1608
    yychar = YYEMPTY;
yann@943
  1609
yann@1
  1610
  yystate = yyn;
yann@943
  1611
  *++yyvsp = yylval;
yann@943
  1612
yann@1
  1613
  goto yynewstate;
yann@1
  1614
yann@1
  1615
yann@1
  1616
/*-----------------------------------------------------------.
yann@1
  1617
| yydefault -- do the default action for the current state.  |
yann@1
  1618
`-----------------------------------------------------------*/
yann@1
  1619
yydefault:
yann@1
  1620
  yyn = yydefact[yystate];
yann@1
  1621
  if (yyn == 0)
yann@1
  1622
    goto yyerrlab;
yann@1
  1623
  goto yyreduce;
yann@1
  1624
yann@1
  1625
yann@1
  1626
/*-----------------------------.
yann@1
  1627
| yyreduce -- Do a reduction.  |
yann@1
  1628
`-----------------------------*/
yann@1
  1629
yyreduce:
yann@1
  1630
  /* yyn is the number of a rule to reduce with.  */
yann@1
  1631
  yylen = yyr2[yyn];
yann@1
  1632
yann@1
  1633
  /* If YYLEN is nonzero, implement the default value of the action:
yann@1
  1634
     `$$ = $1'.
yann@1
  1635
yann@1
  1636
     Otherwise, the following line sets YYVAL to garbage.
yann@1
  1637
     This behavior is undocumented and Bison
yann@1
  1638
     users should not rely upon it.  Assigning to YYVAL
yann@1
  1639
     unconditionally makes the parser a bit smaller, and it avoids a
yann@1
  1640
     GCC warning that YYVAL may be used uninitialized.  */
yann@1
  1641
  yyval = yyvsp[1-yylen];
yann@1
  1642
yann@1
  1643
yann@1
  1644
  YY_REDUCE_PRINT (yyn);
yann@1
  1645
  switch (yyn)
yann@1
  1646
    {
yann@1
  1647
        case 8:
yann@1
  1648
yann@1
  1649
    { zconf_error("unexpected end statement"); ;}
yann@1
  1650
    break;
yann@1
  1651
yann@1
  1652
  case 9:
yann@1
  1653
yann@943
  1654
    { zconf_error("unknown statement \"%s\"", (yyvsp[(2) - (4)].string)); ;}
yann@1
  1655
    break;
yann@1
  1656
yann@1
  1657
  case 10:
yann@1
  1658
yann@1
  1659
    {
yann@943
  1660
	zconf_error("unexpected option \"%s\"", kconf_id_strings + (yyvsp[(2) - (4)].id)->name);
yann@1
  1661
;}
yann@1
  1662
    break;
yann@1
  1663
yann@1
  1664
  case 11:
yann@1
  1665
yann@1
  1666
    { zconf_error("invalid statement"); ;}
yann@1
  1667
    break;
yann@1
  1668
yann@1
  1669
  case 25:
yann@1
  1670
yann@943
  1671
    { zconf_error("unknown option \"%s\"", (yyvsp[(1) - (3)].string)); ;}
yann@1
  1672
    break;
yann@1
  1673
yann@1
  1674
  case 26:
yann@1
  1675
yann@1
  1676
    { zconf_error("invalid option"); ;}
yann@1
  1677
    break;
yann@1
  1678
yann@1
  1679
  case 27:
yann@1
  1680
yann@1
  1681
    {
yann@943
  1682
	struct symbol *sym = sym_lookup((yyvsp[(2) - (3)].string), 0);
yann@1
  1683
	sym->flags |= SYMBOL_OPTIONAL;
yann@1
  1684
	menu_add_entry(sym);
yann@943
  1685
	printd(DEBUG_PARSE, "%s:%d:config %s\n", zconf_curname(), zconf_lineno(), (yyvsp[(2) - (3)].string));
yann@1
  1686
;}
yann@1
  1687
    break;
yann@1
  1688
yann@1
  1689
  case 28:
yann@1
  1690
yann@1
  1691
    {
yann@1
  1692
	menu_end_entry();
yann@1
  1693
	printd(DEBUG_PARSE, "%s:%d:endconfig\n", zconf_curname(), zconf_lineno());
yann@1
  1694
;}
yann@1
  1695
    break;
yann@1
  1696
yann@1
  1697
  case 29:
yann@1
  1698
yann@1
  1699
    {
yann@943
  1700
	struct symbol *sym = sym_lookup((yyvsp[(2) - (3)].string), 0);
yann@1
  1701
	sym->flags |= SYMBOL_OPTIONAL;
yann@1
  1702
	menu_add_entry(sym);
yann@943
  1703
	printd(DEBUG_PARSE, "%s:%d:menuconfig %s\n", zconf_curname(), zconf_lineno(), (yyvsp[(2) - (3)].string));
yann@1
  1704
;}
yann@1
  1705
    break;
yann@1
  1706
yann@1
  1707
  case 30:
yann@1
  1708
yann@1
  1709
    {
yann@1
  1710
	if (current_entry->prompt)
yann@1
  1711
		current_entry->prompt->type = P_MENU;
yann@1
  1712
	else
yann@1
  1713
		zconfprint("warning: menuconfig statement without prompt");
yann@1
  1714
	menu_end_entry();
yann@1
  1715
	printd(DEBUG_PARSE, "%s:%d:endconfig\n", zconf_curname(), zconf_lineno());
yann@1
  1716
;}
yann@1
  1717
    break;
yann@1
  1718
yann@1
  1719
  case 38:
yann@1
  1720
yann@1
  1721
    {
yann@943
  1722
	menu_set_type((yyvsp[(1) - (3)].id)->stype);
yann@1
  1723
	printd(DEBUG_PARSE, "%s:%d:type(%u)\n",
yann@1
  1724
		zconf_curname(), zconf_lineno(),
yann@943
  1725
		(yyvsp[(1) - (3)].id)->stype);
yann@1
  1726
;}
yann@1
  1727
    break;
yann@1
  1728
yann@1
  1729
  case 39:
yann@1
  1730
yann@1
  1731
    {
yann@943
  1732
	menu_add_prompt(P_PROMPT, (yyvsp[(2) - (4)].string), (yyvsp[(3) - (4)].expr));
yann@1
  1733
	printd(DEBUG_PARSE, "%s:%d:prompt\n", zconf_curname(), zconf_lineno());
yann@1
  1734
;}
yann@1
  1735
    break;
yann@1
  1736
yann@1
  1737
  case 40:
yann@1
  1738
yann@1
  1739
    {
yann@943
  1740
	menu_add_expr(P_DEFAULT, (yyvsp[(2) - (4)].expr), (yyvsp[(3) - (4)].expr));
yann@943
  1741
	if ((yyvsp[(1) - (4)].id)->stype != S_UNKNOWN)
yann@943
  1742
		menu_set_type((yyvsp[(1) - (4)].id)->stype);
yann@1
  1743
	printd(DEBUG_PARSE, "%s:%d:default(%u)\n",
yann@1
  1744
		zconf_curname(), zconf_lineno(),
yann@943
  1745
		(yyvsp[(1) - (4)].id)->stype);
yann@1
  1746
;}
yann@1
  1747
    break;
yann@1
  1748
yann@1
  1749
  case 41:
yann@1
  1750
yann@1
  1751
    {
yann@943
  1752
	menu_add_symbol(P_SELECT, sym_lookup((yyvsp[(2) - (4)].string), 0), (yyvsp[(3) - (4)].expr));
yann@1
  1753
	printd(DEBUG_PARSE, "%s:%d:select\n", zconf_curname(), zconf_lineno());
yann@1
  1754
;}
yann@1
  1755
    break;
yann@1
  1756
yann@1
  1757
  case 42:
yann@1
  1758
yann@1
  1759
    {
yann@943
  1760
	menu_add_expr(P_RANGE, expr_alloc_comp(E_RANGE,(yyvsp[(2) - (5)].symbol), (yyvsp[(3) - (5)].symbol)), (yyvsp[(4) - (5)].expr));
yann@1
  1761
	printd(DEBUG_PARSE, "%s:%d:range\n", zconf_curname(), zconf_lineno());
yann@1
  1762
;}
yann@1
  1763
    break;
yann@1
  1764
yann@1
  1765
  case 45:
yann@1
  1766
yann@1
  1767
    {
yann@943
  1768
	struct kconf_id *id = kconf_id_lookup((yyvsp[(2) - (3)].string), strlen((yyvsp[(2) - (3)].string)));
yann@1
  1769
	if (id && id->flags & TF_OPTION)
yann@943
  1770
		menu_add_option(id->token, (yyvsp[(3) - (3)].string));
yann@1
  1771
	else
yann@943
  1772
		zconfprint("warning: ignoring unknown option %s", (yyvsp[(2) - (3)].string));
yann@943
  1773
	free((yyvsp[(2) - (3)].string));
yann@1
  1774
;}
yann@1
  1775
    break;
yann@1
  1776
yann@1
  1777
  case 46:
yann@1
  1778
yann@1
  1779
    { (yyval.string) = NULL; ;}
yann@1
  1780
    break;
yann@1
  1781
yann@1
  1782
  case 47:
yann@1
  1783
yann@943
  1784
    { (yyval.string) = (yyvsp[(2) - (2)].string); ;}
yann@1
  1785
    break;
yann@1
  1786
yann@1
  1787
  case 48:
yann@1
  1788
yann@1
  1789
    {
yann@943
  1790
	struct symbol *sym = sym_lookup((yyvsp[(2) - (3)].string), SYMBOL_CHOICE);
yann@943
  1791
	sym->flags |= SYMBOL_AUTO;
yann@1
  1792
	menu_add_entry(sym);
yann@1
  1793
	menu_add_expr(P_CHOICE, NULL, NULL);
yann@1
  1794
	printd(DEBUG_PARSE, "%s:%d:choice\n", zconf_curname(), zconf_lineno());
yann@1
  1795
;}
yann@1
  1796
    break;
yann@1
  1797
yann@1
  1798
  case 49:
yann@1
  1799
yann@1
  1800
    {
yann@1
  1801
	(yyval.menu) = menu_add_menu();
yann@1
  1802
;}
yann@1
  1803
    break;
yann@1
  1804
yann@1
  1805
  case 50:
yann@1
  1806
yann@1
  1807
    {
yann@943
  1808
	if (zconf_endtoken((yyvsp[(1) - (1)].id), T_CHOICE, T_ENDCHOICE)) {
yann@1
  1809
		menu_end_menu();
yann@1
  1810
		printd(DEBUG_PARSE, "%s:%d:endchoice\n", zconf_curname(), zconf_lineno());
yann@1
  1811
	}
yann@1
  1812
;}
yann@1
  1813
    break;
yann@1
  1814
yann@1
  1815
  case 58:
yann@1
  1816
yann@1
  1817
    {
yann@943
  1818
	menu_add_prompt(P_PROMPT, (yyvsp[(2) - (4)].string), (yyvsp[(3) - (4)].expr));
yann@1
  1819
	printd(DEBUG_PARSE, "%s:%d:prompt\n", zconf_curname(), zconf_lineno());
yann@1
  1820
;}
yann@1
  1821
    break;
yann@1
  1822
yann@1
  1823
  case 59:
yann@1
  1824
yann@1
  1825
    {
yann@943
  1826
	if ((yyvsp[(1) - (3)].id)->stype == S_BOOLEAN || (yyvsp[(1) - (3)].id)->stype == S_TRISTATE) {
yann@943
  1827
		menu_set_type((yyvsp[(1) - (3)].id)->stype);
yann@1
  1828
		printd(DEBUG_PARSE, "%s:%d:type(%u)\n",
yann@1
  1829
			zconf_curname(), zconf_lineno(),
yann@943
  1830
			(yyvsp[(1) - (3)].id)->stype);
yann@1
  1831
	} else
yann@1
  1832
		YYERROR;
yann@1
  1833
;}
yann@1
  1834
    break;
yann@1
  1835
yann@1
  1836
  case 60:
yann@1
  1837
yann@1
  1838
    {
yann@1
  1839
	current_entry->sym->flags |= SYMBOL_OPTIONAL;
yann@1
  1840
	printd(DEBUG_PARSE, "%s:%d:optional\n", zconf_curname(), zconf_lineno());
yann@1
  1841
;}
yann@1
  1842
    break;
yann@1
  1843
yann@1
  1844
  case 61:
yann@1
  1845
yann@1
  1846
    {
yann@943
  1847
	if ((yyvsp[(1) - (4)].id)->stype == S_UNKNOWN) {
yann@943
  1848
		menu_add_symbol(P_DEFAULT, sym_lookup((yyvsp[(2) - (4)].string), 0), (yyvsp[(3) - (4)].expr));
yann@1
  1849
		printd(DEBUG_PARSE, "%s:%d:default\n",
yann@1
  1850
			zconf_curname(), zconf_lineno());
yann@1
  1851
	} else
yann@1
  1852
		YYERROR;
yann@1
  1853
;}
yann@1
  1854
    break;
yann@1
  1855
yann@1
  1856
  case 64:
yann@1
  1857
yann@1
  1858
    {
yann@1
  1859
	printd(DEBUG_PARSE, "%s:%d:if\n", zconf_curname(), zconf_lineno());
yann@1
  1860
	menu_add_entry(NULL);
yann@943
  1861
	menu_add_dep((yyvsp[(2) - (3)].expr));
yann@1
  1862
	(yyval.menu) = menu_add_menu();
yann@1
  1863
;}
yann@1
  1864
    break;
yann@1
  1865
yann@1
  1866
  case 65:
yann@1
  1867
yann@1
  1868
    {
yann@943
  1869
	if (zconf_endtoken((yyvsp[(1) - (1)].id), T_IF, T_ENDIF)) {
yann@1
  1870
		menu_end_menu();
yann@1
  1871
		printd(DEBUG_PARSE, "%s:%d:endif\n", zconf_curname(), zconf_lineno());
yann@1
  1872
	}
yann@1
  1873
;}
yann@1
  1874
    break;
yann@1
  1875
yann@1
  1876
  case 71:
yann@1
  1877
yann@1
  1878
    {
yann@1
  1879
	menu_add_entry(NULL);
yann@943
  1880
	menu_add_prompt(P_MENU, (yyvsp[(2) - (3)].string), NULL);
yann@1
  1881
	printd(DEBUG_PARSE, "%s:%d:menu\n", zconf_curname(), zconf_lineno());
yann@1
  1882
;}
yann@1
  1883
    break;
yann@1
  1884
yann@1
  1885
  case 72:
yann@1
  1886
yann@1
  1887
    {
yann@1
  1888
	(yyval.menu) = menu_add_menu();
yann@1
  1889
;}
yann@1
  1890
    break;
yann@1
  1891
yann@1
  1892
  case 73:
yann@1
  1893
yann@1
  1894
    {
yann@943
  1895
	if (zconf_endtoken((yyvsp[(1) - (1)].id), T_MENU, T_ENDMENU)) {
yann@1
  1896
		menu_end_menu();
yann@1
  1897
		printd(DEBUG_PARSE, "%s:%d:endmenu\n", zconf_curname(), zconf_lineno());
yann@1
  1898
	}
yann@1
  1899
;}
yann@1
  1900
    break;
yann@1
  1901
yann@1
  1902
  case 79:
yann@1
  1903
yann@1
  1904
    {
yann@943
  1905
	printd(DEBUG_PARSE, "%s:%d:source %s\n", zconf_curname(), zconf_lineno(), (yyvsp[(2) - (3)].string));
yann@943
  1906
	zconf_nextfile((yyvsp[(2) - (3)].string));
yann@1
  1907
;}
yann@1
  1908
    break;
yann@1
  1909
yann@1
  1910
  case 80:
yann@1
  1911
yann@1
  1912
    {
yann@1
  1913
	menu_add_entry(NULL);
yann@943
  1914
	menu_add_prompt(P_COMMENT, (yyvsp[(2) - (3)].string), NULL);
yann@1
  1915
	printd(DEBUG_PARSE, "%s:%d:comment\n", zconf_curname(), zconf_lineno());
yann@1
  1916
;}
yann@1
  1917
    break;
yann@1
  1918
yann@1
  1919
  case 81:
yann@1
  1920
yann@1
  1921
    {
yann@1
  1922
	menu_end_entry();
yann@1
  1923
;}
yann@1
  1924
    break;
yann@1
  1925
yann@1
  1926
  case 82:
yann@1
  1927
yann@1
  1928
    {
yann@1
  1929
	printd(DEBUG_PARSE, "%s:%d:help\n", zconf_curname(), zconf_lineno());
yann@1
  1930
	zconf_starthelp();
yann@1
  1931
;}
yann@1
  1932
    break;
yann@1
  1933
yann@1
  1934
  case 83:
yann@1
  1935
yann@1
  1936
    {
yann@943
  1937
	current_entry->help = (yyvsp[(2) - (2)].string);
yann@1
  1938
;}
yann@1
  1939
    break;
yann@1
  1940
yann@1
  1941
  case 88:
yann@1
  1942
yann@1
  1943
    {
yann@943
  1944
	menu_add_dep((yyvsp[(3) - (4)].expr));
yann@1
  1945
	printd(DEBUG_PARSE, "%s:%d:depends on\n", zconf_curname(), zconf_lineno());
yann@1
  1946
;}
yann@1
  1947
    break;
yann@1
  1948
yann@1
  1949
  case 90:
yann@1
  1950
yann@1
  1951
    {
yann@943
  1952
	menu_add_prompt(P_PROMPT, (yyvsp[(1) - (2)].string), (yyvsp[(2) - (2)].expr));
yann@1
  1953
;}
yann@1
  1954
    break;
yann@1
  1955
yann@943
  1956
  case 93:
yann@1
  1957
yann@943
  1958
    { (yyval.id) = (yyvsp[(1) - (2)].id); ;}
yann@943
  1959
    break;
yann@943
  1960
yann@943
  1961
  case 94:
yann@943
  1962
yann@943
  1963
    { (yyval.id) = (yyvsp[(1) - (2)].id); ;}
yann@1
  1964
    break;
yann@1
  1965
yann@1
  1966
  case 95:
yann@1
  1967
yann@943
  1968
    { (yyval.id) = (yyvsp[(1) - (2)].id); ;}
yann@1
  1969
    break;
yann@1
  1970
yann@943
  1971
  case 98:
yann@1
  1972
yann@943
  1973
    { (yyval.expr) = NULL; ;}
yann@1
  1974
    break;
yann@1
  1975
yann@943
  1976
  case 99:
yann@1
  1977
yann@943
  1978
    { (yyval.expr) = (yyvsp[(2) - (2)].expr); ;}
yann@1
  1979
    break;
yann@1
  1980
yann@1
  1981
  case 100:
yann@1
  1982
yann@943
  1983
    { (yyval.expr) = expr_alloc_symbol((yyvsp[(1) - (1)].symbol)); ;}
yann@1
  1984
    break;
yann@1
  1985
yann@1
  1986
  case 101:
yann@1
  1987
yann@943
  1988
    { (yyval.expr) = expr_alloc_comp(E_EQUAL, (yyvsp[(1) - (3)].symbol), (yyvsp[(3) - (3)].symbol)); ;}
yann@1
  1989
    break;
yann@1
  1990
yann@1
  1991
  case 102:
yann@1
  1992
yann@943
  1993
    { (yyval.expr) = expr_alloc_comp(E_UNEQUAL, (yyvsp[(1) - (3)].symbol), (yyvsp[(3) - (3)].symbol)); ;}
yann@1
  1994
    break;
yann@1
  1995
yann@1
  1996
  case 103:
yann@1
  1997
yann@943
  1998
    { (yyval.expr) = (yyvsp[(2) - (3)].expr); ;}
yann@1
  1999
    break;
yann@1
  2000
yann@1
  2001
  case 104:
yann@1
  2002
yann@943
  2003
    { (yyval.expr) = expr_alloc_one(E_NOT, (yyvsp[(2) - (2)].expr)); ;}
yann@1
  2004
    break;
yann@1
  2005
yann@1
  2006
  case 105:
yann@1
  2007
yann@943
  2008
    { (yyval.expr) = expr_alloc_two(E_OR, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); ;}
yann@1
  2009
    break;
yann@1
  2010
yann@1
  2011
  case 106:
yann@1
  2012
yann@943
  2013
    { (yyval.expr) = expr_alloc_two(E_AND, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); ;}
yann@1
  2014
    break;
yann@1
  2015
yann@1
  2016
  case 107:
yann@1
  2017
yann@943
  2018
    { (yyval.symbol) = sym_lookup((yyvsp[(1) - (1)].string), 0); free((yyvsp[(1) - (1)].string)); ;}
yann@1
  2019
    break;
yann@1
  2020
yann@1
  2021
  case 108:
yann@1
  2022
yann@943
  2023
    { (yyval.symbol) = sym_lookup((yyvsp[(1) - (1)].string), SYMBOL_CONST); free((yyvsp[(1) - (1)].string)); ;}
yann@1
  2024
    break;
yann@1
  2025
yann@1
  2026
  case 109:
yann@1
  2027
yann@943
  2028
    { (yyval.string) = NULL; ;}
yann@1
  2029
    break;
yann@1
  2030
yann@1
  2031
yann@943
  2032
/* Line 1267 of yacc.c.  */
yann@1
  2033
yann@1
  2034
      default: break;
yann@1
  2035
    }
yann@943
  2036
  YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
yann@1
  2037
yann@943
  2038
  YYPOPSTACK (yylen);
yann@943
  2039
  yylen = 0;
yann@1
  2040
  YY_STACK_PRINT (yyss, yyssp);
yann@1
  2041
yann@1
  2042
  *++yyvsp = yyval;
yann@1
  2043
yann@1
  2044
yann@1
  2045
  /* Now `shift' the result of the reduction.  Determine what state
yann@1
  2046
     that goes to, based on the state we popped back to and the rule
yann@1
  2047
     number reduced by.  */
yann@1
  2048
yann@1
  2049
  yyn = yyr1[yyn];
yann@1
  2050
yann@1
  2051
  yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
yann@1
  2052
  if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
yann@1
  2053
    yystate = yytable[yystate];
yann@1
  2054
  else
yann@1
  2055
    yystate = yydefgoto[yyn - YYNTOKENS];
yann@1
  2056
yann@1
  2057
  goto yynewstate;
yann@1
  2058
yann@1
  2059
yann@1
  2060
/*------------------------------------.
yann@1
  2061
| yyerrlab -- here on detecting error |
yann@1
  2062
`------------------------------------*/
yann@1
  2063
yyerrlab:
yann@1
  2064
  /* If not already recovering from an error, report this error.  */
yann@1
  2065
  if (!yyerrstatus)
yann@1
  2066
    {
yann@1
  2067
      ++yynerrs;
yann@943
  2068
#if ! YYERROR_VERBOSE
yann@943
  2069
      yyerror (YY_("syntax error"));
yann@943
  2070
#else
yann@943
  2071
      {
yann@943
  2072
	YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
yann@943
  2073
	if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
yann@943
  2074
	  {
yann@943
  2075
	    YYSIZE_T yyalloc = 2 * yysize;
yann@943
  2076
	    if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
yann@943
  2077
	      yyalloc = YYSTACK_ALLOC_MAXIMUM;
yann@943
  2078
	    if (yymsg != yymsgbuf)
yann@943
  2079
	      YYSTACK_FREE (yymsg);
yann@943
  2080
	    yymsg = (char *) YYSTACK_ALLOC (yyalloc);
yann@943
  2081
	    if (yymsg)
yann@943
  2082
	      yymsg_alloc = yyalloc;
yann@943
  2083
	    else
yann@943
  2084
	      {
yann@943
  2085
		yymsg = yymsgbuf;
yann@943
  2086
		yymsg_alloc = sizeof yymsgbuf;
yann@943
  2087
	      }
yann@943
  2088
	  }
yann@1
  2089
yann@943
  2090
	if (0 < yysize && yysize <= yymsg_alloc)
yann@943
  2091
	  {
yann@943
  2092
	    (void) yysyntax_error (yymsg, yystate, yychar);
yann@943
  2093
	    yyerror (yymsg);
yann@943
  2094
	  }
yann@943
  2095
	else
yann@943
  2096
	  {
yann@943
  2097
	    yyerror (YY_("syntax error"));
yann@943
  2098
	    if (yysize != 0)
yann@943
  2099
	      goto yyexhaustedlab;
yann@943
  2100
	  }
yann@943
  2101
      }
yann@1
  2102
#endif
yann@1
  2103
    }
yann@1
  2104
yann@1
  2105
yann@1
  2106
yann@1
  2107
  if (yyerrstatus == 3)
yann@1
  2108
    {
yann@1
  2109
      /* If just tried and failed to reuse look-ahead token after an
yann@1
  2110
	 error, discard it.  */
yann@1
  2111
yann@1
  2112
      if (yychar <= YYEOF)
yann@943
  2113
	{
yann@1
  2114
	  /* Return failure if at end of input.  */
yann@1
  2115
	  if (yychar == YYEOF)
yann@1
  2116
	    YYABORT;
yann@943
  2117
	}
yann@1
  2118
      else
yann@1
  2119
	{
yann@943
  2120
	  yydestruct ("Error: discarding",
yann@943
  2121
		      yytoken, &yylval);
yann@1
  2122
	  yychar = YYEMPTY;
yann@1
  2123
	}
yann@1
  2124
    }
yann@1
  2125
yann@1
  2126
  /* Else will try to reuse look-ahead token after shifting the error
yann@1
  2127
     token.  */
yann@1
  2128
  goto yyerrlab1;
yann@1
  2129
yann@1
  2130
yann@1
  2131
/*---------------------------------------------------.
yann@1
  2132
| yyerrorlab -- error raised explicitly by YYERROR.  |
yann@1
  2133
`---------------------------------------------------*/
yann@1
  2134
yyerrorlab:
yann@1
  2135
yann@1
  2136
  /* Pacify compilers like GCC when the user code never invokes
yann@1
  2137
     YYERROR and the label yyerrorlab therefore never appears in user
yann@1
  2138
     code.  */
yann@943
  2139
  if (/*CONSTCOND*/ 0)
yann@1
  2140
     goto yyerrorlab;
yann@1
  2141
yann@943
  2142
  /* Do not reclaim the symbols of the rule which action triggered
yann@943
  2143
     this YYERROR.  */
yann@943
  2144
  YYPOPSTACK (yylen);
yann@943
  2145
  yylen = 0;
yann@943
  2146
  YY_STACK_PRINT (yyss, yyssp);
yann@1
  2147
  yystate = *yyssp;
yann@1
  2148
  goto yyerrlab1;
yann@1
  2149
yann@1
  2150
yann@1
  2151
/*-------------------------------------------------------------.
yann@1
  2152
| yyerrlab1 -- common code for both syntax error and YYERROR.  |
yann@1
  2153
`-------------------------------------------------------------*/
yann@1
  2154
yyerrlab1:
yann@1
  2155
  yyerrstatus = 3;	/* Each real token shifted decrements this.  */
yann@1
  2156
yann@1
  2157
  for (;;)
yann@1
  2158
    {
yann@1
  2159
      yyn = yypact[yystate];
yann@1
  2160
      if (yyn != YYPACT_NINF)
yann@1
  2161
	{
yann@1
  2162
	  yyn += YYTERROR;
yann@1
  2163
	  if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
yann@1
  2164
	    {
yann@1
  2165
	      yyn = yytable[yyn];
yann@1
  2166
	      if (0 < yyn)
yann@1
  2167
		break;
yann@1
  2168
	    }
yann@1
  2169
	}
yann@1
  2170
yann@1
  2171
      /* Pop the current state because it cannot handle the error token.  */
yann@1
  2172
      if (yyssp == yyss)
yann@1
  2173
	YYABORT;
yann@1
  2174
yann@1
  2175
yann@943
  2176
      yydestruct ("Error: popping",
yann@943
  2177
		  yystos[yystate], yyvsp);
yann@943
  2178
      YYPOPSTACK (1);
yann@1
  2179
      yystate = *yyssp;
yann@1
  2180
      YY_STACK_PRINT (yyss, yyssp);
yann@1
  2181
    }
yann@1
  2182
yann@1
  2183
  if (yyn == YYFINAL)
yann@1
  2184
    YYACCEPT;
yann@1
  2185
yann@1
  2186
  *++yyvsp = yylval;
yann@1
  2187
yann@1
  2188
yann@943
  2189
  /* Shift the error token.  */
yann@1
  2190
  YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
yann@1
  2191
yann@1
  2192
  yystate = yyn;
yann@1
  2193
  goto yynewstate;
yann@1
  2194
yann@1
  2195
yann@1
  2196
/*-------------------------------------.
yann@1
  2197
| yyacceptlab -- YYACCEPT comes here.  |
yann@1
  2198
`-------------------------------------*/
yann@1
  2199
yyacceptlab:
yann@1
  2200
  yyresult = 0;
yann@1
  2201
  goto yyreturn;
yann@1
  2202
yann@1
  2203
/*-----------------------------------.
yann@1
  2204
| yyabortlab -- YYABORT comes here.  |
yann@1
  2205
`-----------------------------------*/
yann@1
  2206
yyabortlab:
yann@1
  2207
  yyresult = 1;
yann@1
  2208
  goto yyreturn;
yann@1
  2209
yann@1
  2210
#ifndef yyoverflow
yann@1
  2211
/*-------------------------------------------------.
yann@1
  2212
| yyexhaustedlab -- memory exhaustion comes here.  |
yann@1
  2213
`-------------------------------------------------*/
yann@1
  2214
yyexhaustedlab:
yann@1
  2215
  yyerror (YY_("memory exhausted"));
yann@1
  2216
  yyresult = 2;
yann@1
  2217
  /* Fall through.  */
yann@1
  2218
#endif
yann@1
  2219
yann@1
  2220
yyreturn:
yann@1
  2221
  if (yychar != YYEOF && yychar != YYEMPTY)
yann@1
  2222
     yydestruct ("Cleanup: discarding lookahead",
yann@1
  2223
		 yytoken, &yylval);
yann@943
  2224
  /* Do not reclaim the symbols of the rule which action triggered
yann@943
  2225
     this YYABORT or YYACCEPT.  */
yann@943
  2226
  YYPOPSTACK (yylen);
yann@943
  2227
  YY_STACK_PRINT (yyss, yyssp);
yann@1
  2228
  while (yyssp != yyss)
yann@1
  2229
    {
yann@1
  2230
      yydestruct ("Cleanup: popping",
yann@1
  2231
		  yystos[*yyssp], yyvsp);
yann@943
  2232
      YYPOPSTACK (1);
yann@1
  2233
    }
yann@1
  2234
#ifndef yyoverflow
yann@1
  2235
  if (yyss != yyssa)
yann@1
  2236
    YYSTACK_FREE (yyss);
yann@1
  2237
#endif
yann@943
  2238
#if YYERROR_VERBOSE
yann@943
  2239
  if (yymsg != yymsgbuf)
yann@943
  2240
    YYSTACK_FREE (yymsg);
yann@943
  2241
#endif
yann@943
  2242
  /* Make sure YYID is used.  */
yann@943
  2243
  return YYID (yyresult);
yann@1
  2244
}
yann@1
  2245
yann@1
  2246
yann@1
  2247
yann@1
  2248
yann@1
  2249
yann@1
  2250
void conf_parse(const char *name)
yann@1
  2251
{
yann@1
  2252
	struct symbol *sym;
yann@1
  2253
	int i;
yann@1
  2254
yann@1
  2255
	zconf_initscan(name);
yann@1
  2256
yann@1
  2257
	sym_init();
yann@1
  2258
	menu_init();
yann@1
  2259
	modules_sym = sym_lookup(NULL, 0);
yann@1
  2260
	modules_sym->type = S_BOOLEAN;
yann@1
  2261
	modules_sym->flags |= SYMBOL_AUTO;
yann@943
  2262
	rootmenu.prompt = menu_add_prompt(P_MENU, PACKAGE, NULL);
yann@1
  2263
yann@1
  2264
#if YYDEBUG
yann@1
  2265
	if (getenv("ZCONF_DEBUG"))
yann@1
  2266
		zconfdebug = 1;
yann@1
  2267
#endif
yann@1
  2268
	zconfparse();
yann@1
  2269
	if (zconfnerrs)
yann@1
  2270
		exit(1);
yann@1
  2271
	if (!modules_sym->prop) {
yann@1
  2272
		struct property *prop;
yann@1
  2273
yann@1
  2274
		prop = prop_alloc(P_DEFAULT, modules_sym);
yann@1
  2275
		prop->expr = expr_alloc_symbol(sym_lookup("MODULES", 0));
yann@1
  2276
	}
yann@1
  2277
	menu_finalize(&rootmenu);
yann@1
  2278
	for_all_symbols(i, sym) {
yann@943
  2279
		if (sym_check_deps(sym))
yann@943
  2280
			zconfnerrs++;
yann@1
  2281
        }
yann@943
  2282
	if (zconfnerrs)
yann@943
  2283
		exit(1);
yann@39
  2284
	sym_set_change_count(1);
yann@1
  2285
}
yann@1
  2286
yann@1
  2287
const char *zconf_tokenname(int token)
yann@1
  2288
{
yann@1
  2289
	switch (token) {
yann@1
  2290
	case T_MENU:		return "menu";
yann@1
  2291
	case T_ENDMENU:		return "endmenu";
yann@1
  2292
	case T_CHOICE:		return "choice";
yann@1
  2293
	case T_ENDCHOICE:	return "endchoice";
yann@1
  2294
	case T_IF:		return "if";
yann@1
  2295
	case T_ENDIF:		return "endif";
yann@1
  2296
	case T_DEPENDS:		return "depends";
yann@1
  2297
	}
yann@1
  2298
	return "<token>";
yann@1
  2299
}
yann@1
  2300
yann@1
  2301
static bool zconf_endtoken(struct kconf_id *id, int starttoken, int endtoken)
yann@1
  2302
{
yann@1
  2303
	if (id->token != endtoken) {
yann@1
  2304
		zconf_error("unexpected '%s' within %s block",
yann@1
  2305
			kconf_id_strings + id->name, zconf_tokenname(starttoken));
yann@1
  2306
		zconfnerrs++;
yann@1
  2307
		return false;
yann@1
  2308
	}
yann@1
  2309
	if (current_menu->file != current_file) {
yann@1
  2310
		zconf_error("'%s' in different file than '%s'",
yann@1
  2311
			kconf_id_strings + id->name, zconf_tokenname(starttoken));
yann@1
  2312
		fprintf(stderr, "%s:%d: location of the '%s'\n",
yann@1
  2313
			current_menu->file->name, current_menu->lineno,
yann@1
  2314
			zconf_tokenname(starttoken));
yann@1
  2315
		zconfnerrs++;
yann@1
  2316
		return false;
yann@1
  2317
	}
yann@1
  2318
	return true;
yann@1
  2319
}
yann@1
  2320
yann@1
  2321
static void zconfprint(const char *err, ...)
yann@1
  2322
{
yann@1
  2323
	va_list ap;
yann@1
  2324
yann@1
  2325
	fprintf(stderr, "%s:%d: ", zconf_curname(), zconf_lineno());
yann@1
  2326
	va_start(ap, err);
yann@1
  2327
	vfprintf(stderr, err, ap);
yann@1
  2328
	va_end(ap);
yann@1
  2329
	fprintf(stderr, "\n");
yann@1
  2330
}
yann@1
  2331
yann@1
  2332
static void zconf_error(const char *err, ...)
yann@1
  2333
{
yann@1
  2334
	va_list ap;
yann@1
  2335
yann@1
  2336
	zconfnerrs++;
yann@1
  2337
	fprintf(stderr, "%s:%d: ", zconf_curname(), zconf_lineno());
yann@1
  2338
	va_start(ap, err);
yann@1
  2339
	vfprintf(stderr, err, ap);
yann@1
  2340
	va_end(ap);
yann@1
  2341
	fprintf(stderr, "\n");
yann@1
  2342
}
yann@1
  2343
yann@1
  2344
static void zconferror(const char *err)
yann@1
  2345
{
yann@1
  2346
#if YYDEBUG
yann@1
  2347
	fprintf(stderr, "%s:%d: %s\n", zconf_curname(), zconf_lineno() + 1, err);
yann@1
  2348
#endif
yann@1
  2349
}
yann@1
  2350
yann@1
  2351
void print_quoted_string(FILE *out, const char *str)
yann@1
  2352
{
yann@1
  2353
	const char *p;
yann@1
  2354
	int len;
yann@1
  2355
yann@1
  2356
	putc('"', out);
yann@1
  2357
	while ((p = strchr(str, '"'))) {
yann@1
  2358
		len = p - str;
yann@1
  2359
		if (len)
yann@1
  2360
			fprintf(out, "%.*s", len, str);
yann@1
  2361
		fputs("\\\"", out);
yann@1
  2362
		str = p + 1;
yann@1
  2363
	}
yann@1
  2364
	fputs(str, out);
yann@1
  2365
	putc('"', out);
yann@1
  2366
}
yann@1
  2367
yann@1
  2368
void print_symbol(FILE *out, struct menu *menu)
yann@1
  2369
{
yann@1
  2370
	struct symbol *sym = menu->sym;
yann@1
  2371
	struct property *prop;
yann@1
  2372
yann@1
  2373
	if (sym_is_choice(sym))
yann@1
  2374
		fprintf(out, "choice\n");
yann@1
  2375
	else
yann@1
  2376
		fprintf(out, "config %s\n", sym->name);
yann@1
  2377
	switch (sym->type) {
yann@1
  2378
	case S_BOOLEAN:
yann@1
  2379
		fputs("  boolean\n", out);
yann@1
  2380
		break;
yann@1
  2381
	case S_TRISTATE:
yann@1
  2382
		fputs("  tristate\n", out);
yann@1
  2383
		break;
yann@1
  2384
	case S_STRING:
yann@1
  2385
		fputs("  string\n", out);
yann@1
  2386
		break;
yann@1
  2387
	case S_INT:
yann@1
  2388
		fputs("  integer\n", out);
yann@1
  2389
		break;
yann@1
  2390
	case S_HEX:
yann@1
  2391
		fputs("  hex\n", out);
yann@1
  2392
		break;
yann@1
  2393
	default:
yann@1
  2394
		fputs("  ???\n", out);
yann@1
  2395
		break;
yann@1
  2396
	}
yann@1
  2397
	for (prop = sym->prop; prop; prop = prop->next) {
yann@1
  2398
		if (prop->menu != menu)
yann@1
  2399
			continue;
yann@1
  2400
		switch (prop->type) {
yann@1
  2401
		case P_PROMPT:
yann@1
  2402
			fputs("  prompt ", out);
yann@1
  2403
			print_quoted_string(out, prop->text);
yann@1
  2404
			if (!expr_is_yes(prop->visible.expr)) {
yann@1
  2405
				fputs(" if ", out);
yann@1
  2406
				expr_fprint(prop->visible.expr, out);
yann@1
  2407
			}
yann@1
  2408
			fputc('\n', out);
yann@1
  2409
			break;
yann@1
  2410
		case P_DEFAULT:
yann@1
  2411
			fputs( "  default ", out);
yann@1
  2412
			expr_fprint(prop->expr, out);
yann@1
  2413
			if (!expr_is_yes(prop->visible.expr)) {
yann@1
  2414
				fputs(" if ", out);
yann@1
  2415
				expr_fprint(prop->visible.expr, out);
yann@1
  2416
			}
yann@1
  2417
			fputc('\n', out);
yann@1
  2418
			break;
yann@1
  2419
		case P_CHOICE:
yann@1
  2420
			fputs("  #choice value\n", out);
yann@1
  2421
			break;
yann@1
  2422
		default:
yann@1
  2423
			fprintf(out, "  unknown prop %d!\n", prop->type);
yann@1
  2424
			break;
yann@1
  2425
		}
yann@1
  2426
	}
yann@943
  2427
	if (menu->help) {
yann@943
  2428
		int len = strlen(menu->help);
yann@943
  2429
		while (menu->help[--len] == '\n')
yann@943
  2430
			menu->help[len] = 0;
yann@943
  2431
		fprintf(out, "  help\n%s\n", menu->help);
yann@1
  2432
	}
yann@1
  2433
	fputc('\n', out);
yann@1
  2434
}
yann@1
  2435
yann@1
  2436
void zconfdump(FILE *out)
yann@1
  2437
{
yann@1
  2438
	struct property *prop;
yann@1
  2439
	struct symbol *sym;
yann@1
  2440
	struct menu *menu;
yann@1
  2441
yann@1
  2442
	menu = rootmenu.list;
yann@1
  2443
	while (menu) {
yann@1
  2444
		if ((sym = menu->sym))
yann@1
  2445
			print_symbol(out, menu);
yann@1
  2446
		else if ((prop = menu->prompt)) {
yann@1
  2447
			switch (prop->type) {
yann@1
  2448
			case P_COMMENT:
yann@1
  2449
				fputs("\ncomment ", out);
yann@1
  2450
				print_quoted_string(out, prop->text);
yann@1
  2451
				fputs("\n", out);
yann@1
  2452
				break;
yann@1
  2453
			case P_MENU:
yann@1
  2454
				fputs("\nmenu ", out);
yann@1
  2455
				print_quoted_string(out, prop->text);
yann@1
  2456
				fputs("\n", out);
yann@1
  2457
				break;
yann@1
  2458
			default:
yann@1
  2459
				;
yann@1
  2460
			}
yann@1
  2461
			if (!expr_is_yes(prop->visible.expr)) {
yann@1
  2462
				fputs("  depends ", out);
yann@1
  2463
				expr_fprint(prop->visible.expr, out);
yann@1
  2464
				fputc('\n', out);
yann@1
  2465
			}
yann@1
  2466
			fputs("\n", out);
yann@1
  2467
		}
yann@1
  2468
yann@1
  2469
		if (menu->list)
yann@1
  2470
			menu = menu->list;
yann@1
  2471
		else if (menu->next)
yann@1
  2472
			menu = menu->next;
yann@1
  2473
		else while ((menu = menu->parent)) {
yann@1
  2474
			if (menu->prompt && menu->prompt->type == P_MENU)
yann@1
  2475
				fputs("\nendmenu\n", out);
yann@1
  2476
			if (menu->next) {
yann@1
  2477
				menu = menu->next;
yann@1
  2478
				break;
yann@1
  2479
			}
yann@1
  2480
		}
yann@1
  2481
	}
yann@1
  2482
}
yann@1
  2483
yann@1
  2484
#include "lex.zconf.c"
yann@1
  2485
#include "util.c"
yann@1
  2486
#include "confdata.c"
yann@1
  2487
#include "expr.c"
yann@1
  2488
#include "symbol.c"
yann@1
  2489
#include "menu.c"
yann@1
  2490