1 /* A Bison parser, made by GNU Bison 2.6.2.  */
2 
3 /* Bison implementation for Yacc-like parsers in C
4 
5       Copyright (C) 1984, 1989-1990, 2000-2012 Free Software Foundation, Inc.
6 
7    This program is free software: you can redistribute it and/or modify
8    it under the terms of the GNU General Public License as published by
9    the Free Software Foundation, either version 3 of the License, or
10    (at your option) any later version.
11 
12    This program is distributed in the hope that it will be useful,
13    but WITHOUT ANY WARRANTY; without even the implied warranty of
14    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15    GNU General Public License for more details.
16 
17    You should have received a copy of the GNU General Public License
18    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
19 
20 /* As a special exception, you may create a larger work that contains
21    part or all of the Bison parser skeleton and distribute that work
22    under terms of your choice, so long as that work isn't itself a
23    parser generator using the skeleton or a modified version thereof
24    as a parser skeleton.  Alternatively, if you modify or redistribute
25    the parser skeleton itself, you may (at your option) remove this
26    special exception, which will cause the skeleton and the resulting
27    Bison output files to be licensed under the GNU General Public
28    License without this special exception.
29 
30    This special exception was added by the Free Software Foundation in
31    version 2.2 of Bison.  */
32 
33 /* C LALR(1) parser skeleton written by Richard Stallman, by
34    simplifying the original so-called "semantic" parser.  */
35 
36 /* All symbols defined below should begin with yy or YY, to avoid
37    infringing on user name space.  This should be done even for local
38    variables, as they might otherwise be expanded by user macros.
39    There are some unavoidable exceptions within include files to
40    define necessary library symbols; they are noted "INFRINGES ON
41    USER NAME SPACE" below.  */
42 
43 /* Identify Bison output.  */
44 #define YYBISON 1
45 
46 /* Bison version.  */
47 #define YYBISON_VERSION "2.6.2"
48 
49 /* Skeleton name.  */
50 #define YYSKELETON_NAME "yacc.c"
51 
52 /* Pure parsers.  */
53 #define YYPURE 0
54 
55 /* Push parsers.  */
56 #define YYPUSH 0
57 
58 /* Pull parsers.  */
59 #define YYPULL 1
60 
61 
62 
63 
64 /* Copy the first part of user declarations.  */
65 /* Line 336 of yacc.c  */
66 #line 15 "fbset_modes_y.y"
67 
68 
69 #include <stdio.h>
70 #include <stdlib.h>
71 #include <string.h>
72 
73 #define Die Sys_Error
74 
75 #include "fbset.h"
76 
77 extern int yylex(void);
78 extern void yyerror(const char *s);
79 extern int line;
80 
81 
82 static struct VideoMode VideoMode;
83 
ClearVideoMode(void)84 static void ClearVideoMode(void)
85 {
86     memset(&VideoMode, 0, sizeof(VideoMode));
87     VideoMode.accel_flags = FB_ACCELF_TEXT;
88 }
89 
90 
91 /* Line 336 of yacc.c  */
92 #line 93 "fbset_modes_y.c"
93 
94 # ifndef YY_NULL
95 #  if defined __cplusplus && 201103L <= __cplusplus
96 #   define YY_NULL nullptr
97 #  else
98 #   define YY_NULL 0
99 #  endif
100 # endif
101 
102 /* Enabling verbose error messages.  */
103 #ifdef YYERROR_VERBOSE
104 # undef YYERROR_VERBOSE
105 # define YYERROR_VERBOSE 1
106 #else
107 # define YYERROR_VERBOSE 0
108 #endif
109 
110 /* In a future release of Bison, this section will be replaced
111    by #include "y.tab.h".  */
112 #ifndef YY_Y_TAB_H
113 # define YY_Y_TAB_H
114 /* Enabling traces.  */
115 #ifndef YYDEBUG
116 # define YYDEBUG 0
117 #endif
118 #if YYDEBUG
119 extern int yydebug;
120 #endif
121 
122 /* Tokens.  */
123 #ifndef YYTOKENTYPE
124 # define YYTOKENTYPE
125    /* Put the tokens into the symbol table, so that GDB and other debuggers
126       know about them.  */
127    enum yytokentype {
128      MODE = 258,
129      GEOMETRY = 259,
130      TIMINGS = 260,
131      HSYNC = 261,
132      VSYNC = 262,
133      CSYNC = 263,
134      GSYNC = 264,
135      EXTSYNC = 265,
136      BCAST = 266,
137      LACED = 267,
138      DOUBLE = 268,
139      RGBA = 269,
140      NONSTD = 270,
141      ACCEL = 271,
142      GRAYSCALE = 272,
143      ENDMODE = 273,
144      POLARITY = 274,
145      BOOLEAN = 275,
146      NUMBER = 276,
147      STRING = 277
148    };
149 #endif
150 /* Tokens.  */
151 #define MODE 258
152 #define GEOMETRY 259
153 #define TIMINGS 260
154 #define HSYNC 261
155 #define VSYNC 262
156 #define CSYNC 263
157 #define GSYNC 264
158 #define EXTSYNC 265
159 #define BCAST 266
160 #define LACED 267
161 #define DOUBLE 268
162 #define RGBA 269
163 #define NONSTD 270
164 #define ACCEL 271
165 #define GRAYSCALE 272
166 #define ENDMODE 273
167 #define POLARITY 274
168 #define BOOLEAN 275
169 #define NUMBER 276
170 #define STRING 277
171 
172 
173 
174 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
175 typedef union YYSTYPE
176 {
177 /* Line 350 of yacc.c  */
178 #line 42 "fbset_modes_y.y"
179 
180 	int		int_val;
181 	const char	*string;
182 
183 
184 /* Line 350 of yacc.c  */
185 #line 186 "fbset_modes_y.c"
186 } YYSTYPE;
187 # define YYSTYPE_IS_TRIVIAL 1
188 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
189 # define YYSTYPE_IS_DECLARED 1
190 #endif
191 
192 extern YYSTYPE yylval;
193 
194 #ifdef YYPARSE_PARAM
195 #if defined __STDC__ || defined __cplusplus
196 int yyparse (void *YYPARSE_PARAM);
197 #else
198 int yyparse ();
199 #endif
200 #else /* ! YYPARSE_PARAM */
201 #if defined __STDC__ || defined __cplusplus
202 int yyparse (void);
203 #else
204 int yyparse ();
205 #endif
206 #endif /* ! YYPARSE_PARAM */
207 
208 #endif /* !YY_Y_TAB_H  */
209 
210 /* Copy the second part of user declarations.  */
211 
212 /* Line 353 of yacc.c  */
213 #line 214 "fbset_modes_y.c"
214 
215 #ifdef short
216 # undef short
217 #endif
218 
219 #ifdef YYTYPE_UINT8
220 typedef YYTYPE_UINT8 yytype_uint8;
221 #else
222 typedef unsigned char yytype_uint8;
223 #endif
224 
225 #ifdef YYTYPE_INT8
226 typedef YYTYPE_INT8 yytype_int8;
227 #elif (defined __STDC__ || defined __C99__FUNC__ \
228      || defined __cplusplus || defined _MSC_VER)
229 typedef signed char yytype_int8;
230 #else
231 typedef short int yytype_int8;
232 #endif
233 
234 #ifdef YYTYPE_UINT16
235 typedef YYTYPE_UINT16 yytype_uint16;
236 #else
237 typedef unsigned short int yytype_uint16;
238 #endif
239 
240 #ifdef YYTYPE_INT16
241 typedef YYTYPE_INT16 yytype_int16;
242 #else
243 typedef short int yytype_int16;
244 #endif
245 
246 #ifndef YYSIZE_T
247 # ifdef __SIZE_TYPE__
248 #  define YYSIZE_T __SIZE_TYPE__
249 # elif defined size_t
250 #  define YYSIZE_T size_t
251 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
252      || defined __cplusplus || defined _MSC_VER)
253 #  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
254 #  define YYSIZE_T size_t
255 # else
256 #  define YYSIZE_T unsigned int
257 # endif
258 #endif
259 
260 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
261 
262 #ifndef YY_
263 # if defined YYENABLE_NLS && YYENABLE_NLS
264 #  if ENABLE_NLS
265 #   include <libintl.h> /* INFRINGES ON USER NAME SPACE */
266 #   define YY_(msgid) dgettext ("bison-runtime", msgid)
267 #  endif
268 # endif
269 # ifndef YY_
270 #  define YY_(msgid) msgid
271 # endif
272 #endif
273 
274 /* Suppress unused-variable warnings by "using" E.  */
275 #if ! defined lint || defined __GNUC__
276 # define YYUSE(e) ((void) (e))
277 #else
278 # define YYUSE(e) /* empty */
279 #endif
280 
281 /* Identity function, used to suppress warnings about constant conditions.  */
282 #ifndef lint
283 # define YYID(n) (n)
284 #else
285 #if (defined __STDC__ || defined __C99__FUNC__ \
286      || defined __cplusplus || defined _MSC_VER)
287 static int
YYID(int yyi)288 YYID (int yyi)
289 #else
290 static int
291 YYID (yyi)
292     int yyi;
293 #endif
294 {
295   return yyi;
296 }
297 #endif
298 
299 #if ! defined yyoverflow || YYERROR_VERBOSE
300 
301 /* The parser invokes alloca or malloc; define the necessary symbols.  */
302 
303 # ifdef YYSTACK_USE_ALLOCA
304 #  if YYSTACK_USE_ALLOCA
305 #   ifdef __GNUC__
306 #    define YYSTACK_ALLOC __builtin_alloca
307 #   elif defined __BUILTIN_VA_ARG_INCR
308 #    include <alloca.h> /* INFRINGES ON USER NAME SPACE */
309 #   elif defined _AIX
310 #    define YYSTACK_ALLOC __alloca
311 #   elif defined _MSC_VER
312 #    include <malloc.h> /* INFRINGES ON USER NAME SPACE */
313 #    define alloca _alloca
314 #   else
315 #    define YYSTACK_ALLOC alloca
316 #    if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
317      || defined __cplusplus || defined _MSC_VER)
318 #     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
319       /* Use EXIT_SUCCESS as a witness for stdlib.h.  */
320 #     ifndef EXIT_SUCCESS
321 #      define EXIT_SUCCESS 0
322 #     endif
323 #    endif
324 #   endif
325 #  endif
326 # endif
327 
328 # ifdef YYSTACK_ALLOC
329    /* Pacify GCC's `empty if-body' warning.  */
330 #  define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
331 #  ifndef YYSTACK_ALLOC_MAXIMUM
332     /* The OS might guarantee only one guard page at the bottom of the stack,
333        and a page size can be as small as 4096 bytes.  So we cannot safely
334        invoke alloca (N) if N exceeds 4096.  Use a slightly smaller number
335        to allow for a few compiler-allocated temporary stack slots.  */
336 #   define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
337 #  endif
338 # else
339 #  define YYSTACK_ALLOC YYMALLOC
340 #  define YYSTACK_FREE YYFREE
341 #  ifndef YYSTACK_ALLOC_MAXIMUM
342 #   define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
343 #  endif
344 #  if (defined __cplusplus && ! defined EXIT_SUCCESS \
345        && ! ((defined YYMALLOC || defined malloc) \
346 	     && (defined YYFREE || defined free)))
347 #   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
348 #   ifndef EXIT_SUCCESS
349 #    define EXIT_SUCCESS 0
350 #   endif
351 #  endif
352 #  ifndef YYMALLOC
353 #   define YYMALLOC malloc
354 #   if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
355      || defined __cplusplus || defined _MSC_VER)
356 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
357 #   endif
358 #  endif
359 #  ifndef YYFREE
360 #   define YYFREE free
361 #   if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
362      || defined __cplusplus || defined _MSC_VER)
363 void free (void *); /* INFRINGES ON USER NAME SPACE */
364 #   endif
365 #  endif
366 # endif
367 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
368 
369 
370 #if (! defined yyoverflow \
371      && (! defined __cplusplus \
372 	 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
373 
374 /* A type that is properly aligned for any stack member.  */
375 union yyalloc
376 {
377   yytype_int16 yyss_alloc;
378   YYSTYPE yyvs_alloc;
379 };
380 
381 /* The size of the maximum gap between one aligned stack and the next.  */
382 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
383 
384 /* The size of an array large to enough to hold all stacks, each with
385    N elements.  */
386 # define YYSTACK_BYTES(N) \
387      ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
388       + YYSTACK_GAP_MAXIMUM)
389 
390 # define YYCOPY_NEEDED 1
391 
392 /* Relocate STACK from its old location to the new one.  The
393    local variables YYSIZE and YYSTACKSIZE give the old and new number of
394    elements in the stack, and YYPTR gives the new location of the
395    stack.  Advance YYPTR to a properly aligned location for the next
396    stack.  */
397 # define YYSTACK_RELOCATE(Stack_alloc, Stack)				\
398     do									\
399       {									\
400 	YYSIZE_T yynewbytes;						\
401 	YYCOPY (&yyptr->Stack_alloc, Stack, yysize);			\
402 	Stack = &yyptr->Stack_alloc;					\
403 	yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
404 	yyptr += yynewbytes / sizeof (*yyptr);				\
405       }									\
406     while (YYID (0))
407 
408 #endif
409 
410 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
411 /* Copy COUNT objects from SRC to DST.  The source and destination do
412    not overlap.  */
413 # ifndef YYCOPY
414 #  if defined __GNUC__ && 1 < __GNUC__
415 #   define YYCOPY(Dst, Src, Count) \
416       __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
417 #  else
418 #   define YYCOPY(Dst, Src, Count)              \
419       do                                        \
420         {                                       \
421           YYSIZE_T yyi;                         \
422           for (yyi = 0; yyi < (Count); yyi++)   \
423             (Dst)[yyi] = (Src)[yyi];            \
424         }                                       \
425       while (YYID (0))
426 #  endif
427 # endif
428 #endif /* !YYCOPY_NEEDED */
429 
430 /* YYFINAL -- State number of the termination state.  */
431 #define YYFINAL  3
432 /* YYLAST -- Last index in YYTABLE.  */
433 #define YYLAST   48
434 
435 /* YYNTOKENS -- Number of terminals.  */
436 #define YYNTOKENS  23
437 /* YYNNTS -- Number of nonterminals.  */
438 #define YYNNTS  19
439 /* YYNRULES -- Number of rules.  */
440 #define YYNRULES  32
441 /* YYNRULES -- Number of states.  */
442 #define YYNSTATES  61
443 
444 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
445 #define YYUNDEFTOK  2
446 #define YYMAXUTOK   277
447 
448 #define YYTRANSLATE(YYX)						\
449   ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
450 
451 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX.  */
452 static const yytype_uint8 yytranslate[] =
453 {
454        0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
455        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
456        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
457        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
458        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
459        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
460        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
461        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
462        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
463        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
464        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
465        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
466        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
467        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
468        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
469        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
470        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
471        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
472        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
473        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
474        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
475        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
476        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
477        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
478        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
479        2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
480        5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
481       15,    16,    17,    18,    19,    20,    21,    22
482 };
483 
484 #if YYDEBUG
485 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
486    YYRHS.  */
487 static const yytype_uint8 yyprhs[] =
488 {
489        0,     0,     3,     5,     6,     9,    16,    23,    32,    33,
490       36,    39,    42,    45,    48,    51,    54,    57,    60,    63,
491       66,    69,    72,    75,    78,    81,    84,    87,    90,    93,
492       96,    99,   102
493 };
494 
495 /* YYRHS -- A `-1'-separated list of the rules' RHS.  */
496 static const yytype_int8 yyrhs[] =
497 {
498       24,     0,    -1,    25,    -1,    -1,    25,    26,    -1,     3,
499       22,    27,    28,    29,    18,    -1,     4,    21,    21,    21,
500       21,    21,    -1,     5,    21,    21,    21,    21,    21,    21,
501       21,    -1,    -1,    29,    30,    -1,    29,    31,    -1,    29,
502       32,    -1,    29,    33,    -1,    29,    34,    -1,    29,    35,
503       -1,    29,    36,    -1,    29,    37,    -1,    29,    38,    -1,
504       29,    39,    -1,    29,    40,    -1,    29,    41,    -1,     6,
505       19,    -1,     7,    19,    -1,     8,    19,    -1,     9,    19,
506       -1,    10,    20,    -1,    11,    20,    -1,    12,    20,    -1,
507       13,    20,    -1,    14,    22,    -1,    15,    21,    -1,    16,
508       20,    -1,    17,    20,    -1
509 };
510 
511 /* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
512 static const yytype_uint8 yyrline[] =
513 {
514        0,    53,    53,    57,    58,    61,    69,    80,    92,    93,
515       94,    95,    96,    97,    98,    99,   100,   101,   102,   103,
516      104,   107,   113,   119,   125,   131,   137,   143,   149,   155,
517      161,   167,   173
518 };
519 #endif
520 
521 #if YYDEBUG || YYERROR_VERBOSE || 0
522 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
523    First, the terminals, then, starting at YYNTOKENS, nonterminals.  */
524 static const char *const yytname[] =
525 {
526   "$end", "error", "$undefined", "MODE", "GEOMETRY", "TIMINGS", "HSYNC",
527   "VSYNC", "CSYNC", "GSYNC", "EXTSYNC", "BCAST", "LACED", "DOUBLE", "RGBA",
528   "NONSTD", "ACCEL", "GRAYSCALE", "ENDMODE", "POLARITY", "BOOLEAN",
529   "NUMBER", "STRING", "$accept", "file", "vmodes", "vmode", "geometry",
530   "timings", "options", "hsync", "vsync", "csync", "gsync", "extsync",
531   "bcast", "laced", "double", "rgba", "nonstd", "accel", "grayscale", YY_NULL
532 };
533 #endif
534 
535 # ifdef YYPRINT
536 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
537    token YYLEX-NUM.  */
538 static const yytype_uint16 yytoknum[] =
539 {
540        0,   256,   257,   258,   259,   260,   261,   262,   263,   264,
541      265,   266,   267,   268,   269,   270,   271,   272,   273,   274,
542      275,   276,   277
543 };
544 # endif
545 
546 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
547 static const yytype_uint8 yyr1[] =
548 {
549        0,    23,    24,    25,    25,    26,    27,    28,    29,    29,
550       29,    29,    29,    29,    29,    29,    29,    29,    29,    29,
551       29,    30,    31,    32,    33,    34,    35,    36,    37,    38,
552       39,    40,    41
553 };
554 
555 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
556 static const yytype_uint8 yyr2[] =
557 {
558        0,     2,     1,     0,     2,     6,     6,     8,     0,     2,
559        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
560        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
561        2,     2,     2
562 };
563 
564 /* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM.
565    Performed when YYTABLE doesn't specify something else to do.  Zero
566    means the default is an error.  */
567 static const yytype_uint8 yydefact[] =
568 {
569        3,     0,     2,     1,     0,     4,     0,     0,     0,     0,
570        0,     8,     0,     0,     0,     0,     0,     0,     0,     0,
571        0,     0,     0,     0,     0,     0,     0,     0,     0,     5,
572        9,    10,    11,    12,    13,    14,    15,    16,    17,    18,
573       19,    20,     0,     0,    21,    22,    23,    24,    25,    26,
574       27,    28,    29,    30,    31,    32,     6,     0,     0,     0,
575        7
576 };
577 
578 /* YYDEFGOTO[NTERM-NUM].  */
579 static const yytype_int8 yydefgoto[] =
580 {
581       -1,     1,     2,     5,     8,    11,    14,    30,    31,    32,
582       33,    34,    35,    36,    37,    38,    39,    40,    41
583 };
584 
585 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
586    STATE-NUM.  */
587 #define YYPACT_NINF -8
588 static const yytype_int8 yypact[] =
589 {
590       -8,    13,    11,    -8,    -7,    -8,    12,    -4,    14,    -3,
591       -1,    -8,     0,     1,    -6,     2,     3,     6,     7,     8,
592        9,    10,    15,    16,    17,    18,    20,    19,    22,    -8,
593       -8,    -8,    -8,    -8,    -8,    -8,    -8,    -8,    -8,    -8,
594       -8,    -8,    23,    24,    -8,    -8,    -8,    -8,    -8,    -8,
595       -8,    -8,    -8,    -8,    -8,    -8,    -8,    25,    26,    27,
596       -8
597 };
598 
599 /* YYPGOTO[NTERM-NUM].  */
600 static const yytype_int8 yypgoto[] =
601 {
602       -8,    -8,    -8,    -8,    -8,    -8,    -8,    -8,    -8,    -8,
603       -8,    -8,    -8,    -8,    -8,    -8,    -8,    -8,    -8
604 };
605 
606 /* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
607    positive, shift that token.  If negative, reduce the rule which
608    number is the opposite.  If YYTABLE_NINF, syntax error.  */
609 #define YYTABLE_NINF -1
610 static const yytype_uint8 yytable[] =
611 {
612       17,    18,    19,    20,    21,    22,    23,    24,    25,    26,
613       27,    28,    29,     3,     4,     6,     7,     9,    12,    10,
614       13,    15,    16,    42,    43,    44,    45,    46,    47,     0,
615       48,     0,     0,     0,     0,    49,    50,    51,     0,    54,
616       52,    53,    55,     0,    56,    57,    58,    59,    60
617 };
618 
619 #define yypact_value_is_default(yystate) \
620   ((yystate) == (-8))
621 
622 #define yytable_value_is_error(yytable_value) \
623   YYID (0)
624 
625 static const yytype_int8 yycheck[] =
626 {
627        6,     7,     8,     9,    10,    11,    12,    13,    14,    15,
628       16,    17,    18,     0,     3,    22,     4,    21,    21,     5,
629       21,    21,    21,    21,    21,    19,    19,    19,    19,    -1,
630       20,    -1,    -1,    -1,    -1,    20,    20,    20,    -1,    20,
631       22,    21,    20,    -1,    21,    21,    21,    21,    21
632 };
633 
634 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
635    symbol of state STATE-NUM.  */
636 static const yytype_uint8 yystos[] =
637 {
638        0,    24,    25,     0,     3,    26,    22,     4,    27,    21,
639        5,    28,    21,    21,    29,    21,    21,     6,     7,     8,
640        9,    10,    11,    12,    13,    14,    15,    16,    17,    18,
641       30,    31,    32,    33,    34,    35,    36,    37,    38,    39,
642       40,    41,    21,    21,    19,    19,    19,    19,    20,    20,
643       20,    20,    22,    21,    20,    20,    21,    21,    21,    21,
644       21
645 };
646 
647 #define yyerrok		(yyerrstatus = 0)
648 #define yyclearin	(yychar = YYEMPTY)
649 #define YYEMPTY		(-2)
650 #define YYEOF		0
651 
652 #define YYACCEPT	goto yyacceptlab
653 #define YYABORT		goto yyabortlab
654 #define YYERROR		goto yyerrorlab
655 
656 
657 /* Like YYERROR except do call yyerror.  This remains here temporarily
658    to ease the transition to the new meaning of YYERROR, for GCC.
659    Once GCC version 2 has supplanted version 1, this can go.  However,
660    YYFAIL appears to be in use.  Nevertheless, it is formally deprecated
661    in Bison 2.4.2's NEWS entry, where a plan to phase it out is
662    discussed.  */
663 
664 #define YYFAIL		goto yyerrlab
665 #if defined YYFAIL
666   /* This is here to suppress warnings from the GCC cpp's
667      -Wunused-macros.  Normally we don't worry about that warning, but
668      some users do, and we want to make it easy for users to remove
669      YYFAIL uses, which will produce warnings from Bison 2.5.  */
670 #endif
671 
672 #define YYRECOVERING()  (!!yyerrstatus)
673 
674 #define YYBACKUP(Token, Value)                                  \
675 do                                                              \
676   if (yychar == YYEMPTY)                                        \
677     {                                                           \
678       yychar = (Token);                                         \
679       yylval = (Value);                                         \
680       YYPOPSTACK (yylen);                                       \
681       yystate = *yyssp;                                         \
682       goto yybackup;                                            \
683     }                                                           \
684   else                                                          \
685     {                                                           \
686       yyerror (YY_("syntax error: cannot back up")); \
687       YYERROR;							\
688     }								\
689 while (YYID (0))
690 
691 
692 #define YYTERROR	1
693 #define YYERRCODE	256
694 
695 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
696    If N is 0, then set CURRENT to the empty location which ends
697    the previous symbol: RHS[0] (always defined).  */
698 
699 #ifndef YYLLOC_DEFAULT
700 # define YYLLOC_DEFAULT(Current, Rhs, N)                                \
701     do                                                                  \
702       if (YYID (N))                                                     \
703         {                                                               \
704           (Current).first_line   = YYRHSLOC (Rhs, 1).first_line;        \
705           (Current).first_column = YYRHSLOC (Rhs, 1).first_column;      \
706           (Current).last_line    = YYRHSLOC (Rhs, N).last_line;         \
707           (Current).last_column  = YYRHSLOC (Rhs, N).last_column;       \
708         }                                                               \
709       else                                                              \
710         {                                                               \
711           (Current).first_line   = (Current).last_line   =              \
712             YYRHSLOC (Rhs, 0).last_line;                                \
713           (Current).first_column = (Current).last_column =              \
714             YYRHSLOC (Rhs, 0).last_column;                              \
715         }                                                               \
716     while (YYID (0))
717 #endif
718 
719 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
720 
721 
722 
723 /* This macro is provided for backward compatibility. */
724 
725 #ifndef YY_LOCATION_PRINT
726 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
727 #endif
728 
729 
730 /* YYLEX -- calling `yylex' with the right arguments.  */
731 
732 #ifdef YYLEX_PARAM
733 # define YYLEX yylex (YYLEX_PARAM)
734 #else
735 # define YYLEX yylex ()
736 #endif
737 
738 /* Enable debugging if requested.  */
739 #if YYDEBUG
740 
741 # ifndef YYFPRINTF
742 #  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
743 #  define YYFPRINTF fprintf
744 # endif
745 
746 # define YYDPRINTF(Args)			\
747 do {						\
748   if (yydebug)					\
749     YYFPRINTF Args;				\
750 } while (YYID (0))
751 
752 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)			  \
753 do {									  \
754   if (yydebug)								  \
755     {									  \
756       YYFPRINTF (stderr, "%s ", Title);					  \
757       yy_symbol_print (stderr,						  \
758 		  Type, Value); \
759       YYFPRINTF (stderr, "\n");						  \
760     }									  \
761 } while (YYID (0))
762 
763 
764 /*--------------------------------.
765 | Print this symbol on YYOUTPUT.  |
766 `--------------------------------*/
767 
768 /*ARGSUSED*/
769 #if (defined __STDC__ || defined __C99__FUNC__ \
770      || defined __cplusplus || defined _MSC_VER)
771 static void
yy_symbol_value_print(FILE * yyoutput,int yytype,YYSTYPE const * const yyvaluep)772 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
773 #else
774 static void
775 yy_symbol_value_print (yyoutput, yytype, yyvaluep)
776     FILE *yyoutput;
777     int yytype;
778     YYSTYPE const * const yyvaluep;
779 #endif
780 {
781   FILE *yyo = yyoutput;
782   YYUSE (yyo);
783   if (!yyvaluep)
784     return;
785 # ifdef YYPRINT
786   if (yytype < YYNTOKENS)
787     YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
788 # else
789   YYUSE (yyoutput);
790 # endif
791   switch (yytype)
792     {
793       default:
794 	break;
795     }
796 }
797 
798 
799 /*--------------------------------.
800 | Print this symbol on YYOUTPUT.  |
801 `--------------------------------*/
802 
803 #if (defined __STDC__ || defined __C99__FUNC__ \
804      || defined __cplusplus || defined _MSC_VER)
805 static void
yy_symbol_print(FILE * yyoutput,int yytype,YYSTYPE const * const yyvaluep)806 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
807 #else
808 static void
809 yy_symbol_print (yyoutput, yytype, yyvaluep)
810     FILE *yyoutput;
811     int yytype;
812     YYSTYPE const * const yyvaluep;
813 #endif
814 {
815   if (yytype < YYNTOKENS)
816     YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
817   else
818     YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
819 
820   yy_symbol_value_print (yyoutput, yytype, yyvaluep);
821   YYFPRINTF (yyoutput, ")");
822 }
823 
824 /*------------------------------------------------------------------.
825 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
826 | TOP (included).                                                   |
827 `------------------------------------------------------------------*/
828 
829 #if (defined __STDC__ || defined __C99__FUNC__ \
830      || defined __cplusplus || defined _MSC_VER)
831 static void
yy_stack_print(yytype_int16 * yybottom,yytype_int16 * yytop)832 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
833 #else
834 static void
835 yy_stack_print (yybottom, yytop)
836     yytype_int16 *yybottom;
837     yytype_int16 *yytop;
838 #endif
839 {
840   YYFPRINTF (stderr, "Stack now");
841   for (; yybottom <= yytop; yybottom++)
842     {
843       int yybot = *yybottom;
844       YYFPRINTF (stderr, " %d", yybot);
845     }
846   YYFPRINTF (stderr, "\n");
847 }
848 
849 # define YY_STACK_PRINT(Bottom, Top)				\
850 do {								\
851   if (yydebug)							\
852     yy_stack_print ((Bottom), (Top));				\
853 } while (YYID (0))
854 
855 
856 /*------------------------------------------------.
857 | Report that the YYRULE is going to be reduced.  |
858 `------------------------------------------------*/
859 
860 #if (defined __STDC__ || defined __C99__FUNC__ \
861      || defined __cplusplus || defined _MSC_VER)
862 static void
yy_reduce_print(YYSTYPE * yyvsp,int yyrule)863 yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
864 #else
865 static void
866 yy_reduce_print (yyvsp, yyrule)
867     YYSTYPE *yyvsp;
868     int yyrule;
869 #endif
870 {
871   int yynrhs = yyr2[yyrule];
872   int yyi;
873   unsigned long int yylno = yyrline[yyrule];
874   YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
875 	     yyrule - 1, yylno);
876   /* The symbols being reduced.  */
877   for (yyi = 0; yyi < yynrhs; yyi++)
878     {
879       YYFPRINTF (stderr, "   $%d = ", yyi + 1);
880       yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
881 		       &(yyvsp[(yyi + 1) - (yynrhs)])
882 		       		       );
883       YYFPRINTF (stderr, "\n");
884     }
885 }
886 
887 # define YY_REDUCE_PRINT(Rule)		\
888 do {					\
889   if (yydebug)				\
890     yy_reduce_print (yyvsp, Rule); \
891 } while (YYID (0))
892 
893 /* Nonzero means print parse trace.  It is left uninitialized so that
894    multiple parsers can coexist.  */
895 int yydebug;
896 #else /* !YYDEBUG */
897 # define YYDPRINTF(Args)
898 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
899 # define YY_STACK_PRINT(Bottom, Top)
900 # define YY_REDUCE_PRINT(Rule)
901 #endif /* !YYDEBUG */
902 
903 
904 /* YYINITDEPTH -- initial size of the parser's stacks.  */
905 #ifndef	YYINITDEPTH
906 # define YYINITDEPTH 200
907 #endif
908 
909 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
910    if the built-in stack extension method is used).
911 
912    Do not make this value too large; the results are undefined if
913    YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
914    evaluated with infinite-precision integer arithmetic.  */
915 
916 #ifndef YYMAXDEPTH
917 # define YYMAXDEPTH 10000
918 #endif
919 
920 
921 #if YYERROR_VERBOSE
922 
923 # ifndef yystrlen
924 #  if defined __GLIBC__ && defined _STRING_H
925 #   define yystrlen strlen
926 #  else
927 /* Return the length of YYSTR.  */
928 #if (defined __STDC__ || defined __C99__FUNC__ \
929      || defined __cplusplus || defined _MSC_VER)
930 static YYSIZE_T
yystrlen(const char * yystr)931 yystrlen (const char *yystr)
932 #else
933 static YYSIZE_T
934 yystrlen (yystr)
935     const char *yystr;
936 #endif
937 {
938   YYSIZE_T yylen;
939   for (yylen = 0; yystr[yylen]; yylen++)
940     continue;
941   return yylen;
942 }
943 #  endif
944 # endif
945 
946 # ifndef yystpcpy
947 #  if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
948 #   define yystpcpy stpcpy
949 #  else
950 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
951    YYDEST.  */
952 #if (defined __STDC__ || defined __C99__FUNC__ \
953      || defined __cplusplus || defined _MSC_VER)
954 static char *
yystpcpy(char * yydest,const char * yysrc)955 yystpcpy (char *yydest, const char *yysrc)
956 #else
957 static char *
958 yystpcpy (yydest, yysrc)
959     char *yydest;
960     const char *yysrc;
961 #endif
962 {
963   char *yyd = yydest;
964   const char *yys = yysrc;
965 
966   while ((*yyd++ = *yys++) != '\0')
967     continue;
968 
969   return yyd - 1;
970 }
971 #  endif
972 # endif
973 
974 # ifndef yytnamerr
975 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
976    quotes and backslashes, so that it's suitable for yyerror.  The
977    heuristic is that double-quoting is unnecessary unless the string
978    contains an apostrophe, a comma, or backslash (other than
979    backslash-backslash).  YYSTR is taken from yytname.  If YYRES is
980    null, do not copy; instead, return the length of what the result
981    would have been.  */
982 static YYSIZE_T
yytnamerr(char * yyres,const char * yystr)983 yytnamerr (char *yyres, const char *yystr)
984 {
985   if (*yystr == '"')
986     {
987       YYSIZE_T yyn = 0;
988       char const *yyp = yystr;
989 
990       for (;;)
991 	switch (*++yyp)
992 	  {
993 	  case '\'':
994 	  case ',':
995 	    goto do_not_strip_quotes;
996 
997 	  case '\\':
998 	    if (*++yyp != '\\')
999 	      goto do_not_strip_quotes;
1000 	    /* Fall through.  */
1001 	  default:
1002 	    if (yyres)
1003 	      yyres[yyn] = *yyp;
1004 	    yyn++;
1005 	    break;
1006 
1007 	  case '"':
1008 	    if (yyres)
1009 	      yyres[yyn] = '\0';
1010 	    return yyn;
1011 	  }
1012     do_not_strip_quotes: ;
1013     }
1014 
1015   if (! yyres)
1016     return yystrlen (yystr);
1017 
1018   return yystpcpy (yyres, yystr) - yyres;
1019 }
1020 # endif
1021 
1022 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
1023    about the unexpected token YYTOKEN for the state stack whose top is
1024    YYSSP.
1025 
1026    Return 0 if *YYMSG was successfully written.  Return 1 if *YYMSG is
1027    not large enough to hold the message.  In that case, also set
1028    *YYMSG_ALLOC to the required number of bytes.  Return 2 if the
1029    required number of bytes is too large to store.  */
1030 static int
yysyntax_error(YYSIZE_T * yymsg_alloc,char ** yymsg,yytype_int16 * yyssp,int yytoken)1031 yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
1032                 yytype_int16 *yyssp, int yytoken)
1033 {
1034   YYSIZE_T yysize0 = yytnamerr (YY_NULL, yytname[yytoken]);
1035   YYSIZE_T yysize = yysize0;
1036   YYSIZE_T yysize1;
1037   enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1038   /* Internationalized format string. */
1039   const char *yyformat = YY_NULL;
1040   /* Arguments of yyformat. */
1041   char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1042   /* Number of reported tokens (one for the "unexpected", one per
1043      "expected"). */
1044   int yycount = 0;
1045 
1046   /* There are many possibilities here to consider:
1047      - Assume YYFAIL is not used.  It's too flawed to consider.  See
1048        <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html>
1049        for details.  YYERROR is fine as it does not invoke this
1050        function.
1051      - If this state is a consistent state with a default action, then
1052        the only way this function was invoked is if the default action
1053        is an error action.  In that case, don't check for expected
1054        tokens because there are none.
1055      - The only way there can be no lookahead present (in yychar) is if
1056        this state is a consistent state with a default action.  Thus,
1057        detecting the absence of a lookahead is sufficient to determine
1058        that there is no unexpected or expected token to report.  In that
1059        case, just report a simple "syntax error".
1060      - Don't assume there isn't a lookahead just because this state is a
1061        consistent state with a default action.  There might have been a
1062        previous inconsistent state, consistent state with a non-default
1063        action, or user semantic action that manipulated yychar.
1064      - Of course, the expected token list depends on states to have
1065        correct lookahead information, and it depends on the parser not
1066        to perform extra reductions after fetching a lookahead from the
1067        scanner and before detecting a syntax error.  Thus, state merging
1068        (from LALR or IELR) and default reductions corrupt the expected
1069        token list.  However, the list is correct for canonical LR with
1070        one exception: it will still contain any token that will not be
1071        accepted due to an error action in a later state.
1072   */
1073   if (yytoken != YYEMPTY)
1074     {
1075       int yyn = yypact[*yyssp];
1076       yyarg[yycount++] = yytname[yytoken];
1077       if (!yypact_value_is_default (yyn))
1078         {
1079           /* Start YYX at -YYN if negative to avoid negative indexes in
1080              YYCHECK.  In other words, skip the first -YYN actions for
1081              this state because they are default actions.  */
1082           int yyxbegin = yyn < 0 ? -yyn : 0;
1083           /* Stay within bounds of both yycheck and yytname.  */
1084           int yychecklim = YYLAST - yyn + 1;
1085           int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1086           int yyx;
1087 
1088           for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1089             if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
1090                 && !yytable_value_is_error (yytable[yyx + yyn]))
1091               {
1092                 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1093                   {
1094                     yycount = 1;
1095                     yysize = yysize0;
1096                     break;
1097                   }
1098                 yyarg[yycount++] = yytname[yyx];
1099                 yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]);
1100                 if (! (yysize <= yysize1
1101                        && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1102                   return 2;
1103                 yysize = yysize1;
1104               }
1105         }
1106     }
1107 
1108   switch (yycount)
1109     {
1110 # define YYCASE_(N, S)                      \
1111       case N:                               \
1112         yyformat = S;                       \
1113       break
1114       YYCASE_(0, YY_("syntax error"));
1115       YYCASE_(1, YY_("syntax error, unexpected %s"));
1116       YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1117       YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1118       YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1119       YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1120 # undef YYCASE_
1121     }
1122 
1123   yysize1 = yysize + yystrlen (yyformat);
1124   if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1125     return 2;
1126   yysize = yysize1;
1127 
1128   if (*yymsg_alloc < yysize)
1129     {
1130       *yymsg_alloc = 2 * yysize;
1131       if (! (yysize <= *yymsg_alloc
1132              && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
1133         *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
1134       return 1;
1135     }
1136 
1137   /* Avoid sprintf, as that infringes on the user's name space.
1138      Don't have undefined behavior even if the translation
1139      produced a string with the wrong number of "%s"s.  */
1140   {
1141     char *yyp = *yymsg;
1142     int yyi = 0;
1143     while ((*yyp = *yyformat) != '\0')
1144       if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
1145         {
1146           yyp += yytnamerr (yyp, yyarg[yyi++]);
1147           yyformat += 2;
1148         }
1149       else
1150         {
1151           yyp++;
1152           yyformat++;
1153         }
1154   }
1155   return 0;
1156 }
1157 #endif /* YYERROR_VERBOSE */
1158 
1159 /*-----------------------------------------------.
1160 | Release the memory associated to this symbol.  |
1161 `-----------------------------------------------*/
1162 
1163 /*ARGSUSED*/
1164 #if (defined __STDC__ || defined __C99__FUNC__ \
1165      || defined __cplusplus || defined _MSC_VER)
1166 static void
yydestruct(const char * yymsg,int yytype,YYSTYPE * yyvaluep)1167 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
1168 #else
1169 static void
1170 yydestruct (yymsg, yytype, yyvaluep)
1171     const char *yymsg;
1172     int yytype;
1173     YYSTYPE *yyvaluep;
1174 #endif
1175 {
1176   YYUSE (yyvaluep);
1177 
1178   if (!yymsg)
1179     yymsg = "Deleting";
1180   YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1181 
1182   switch (yytype)
1183     {
1184 
1185       default:
1186 	break;
1187     }
1188 }
1189 
1190 
1191 
1192 
1193 /* The lookahead symbol.  */
1194 int yychar;
1195 
1196 /* The semantic value of the lookahead symbol.  */
1197 YYSTYPE yylval;
1198 
1199 /* Number of syntax errors so far.  */
1200 int yynerrs;
1201 
1202 
1203 /*----------.
1204 | yyparse.  |
1205 `----------*/
1206 
1207 #ifdef YYPARSE_PARAM
1208 #if (defined __STDC__ || defined __C99__FUNC__ \
1209      || defined __cplusplus || defined _MSC_VER)
1210 int
yyparse(void * YYPARSE_PARAM)1211 yyparse (void *YYPARSE_PARAM)
1212 #else
1213 int
1214 yyparse (YYPARSE_PARAM)
1215     void *YYPARSE_PARAM;
1216 #endif
1217 #else /* ! YYPARSE_PARAM */
1218 #if (defined __STDC__ || defined __C99__FUNC__ \
1219      || defined __cplusplus || defined _MSC_VER)
1220 int
1221 yyparse (void)
1222 #else
1223 int
1224 yyparse ()
1225 
1226 #endif
1227 #endif
1228 {
1229     int yystate;
1230     /* Number of tokens to shift before error messages enabled.  */
1231     int yyerrstatus;
1232 
1233     /* The stacks and their tools:
1234        `yyss': related to states.
1235        `yyvs': related to semantic values.
1236 
1237        Refer to the stacks through separate pointers, to allow yyoverflow
1238        to reallocate them elsewhere.  */
1239 
1240     /* The state stack.  */
1241     yytype_int16 yyssa[YYINITDEPTH];
1242     yytype_int16 *yyss;
1243     yytype_int16 *yyssp;
1244 
1245     /* The semantic value stack.  */
1246     YYSTYPE yyvsa[YYINITDEPTH];
1247     YYSTYPE *yyvs;
1248     YYSTYPE *yyvsp;
1249 
1250     YYSIZE_T yystacksize;
1251 
1252   int yyn;
1253   int yyresult;
1254   /* Lookahead token as an internal (translated) token number.  */
1255   int yytoken;
1256   /* The variables used to return semantic value and location from the
1257      action routines.  */
1258   YYSTYPE yyval;
1259 
1260 #if YYERROR_VERBOSE
1261   /* Buffer for error messages, and its allocated size.  */
1262   char yymsgbuf[128];
1263   char *yymsg = yymsgbuf;
1264   YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1265 #endif
1266 
1267 #define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N))
1268 
1269   /* The number of symbols on the RHS of the reduced rule.
1270      Keep to zero when no symbol should be popped.  */
1271   int yylen = 0;
1272 
1273   yytoken = 0;
1274   yyss = yyssa;
1275   yyvs = yyvsa;
1276   yystacksize = YYINITDEPTH;
1277 
1278   YYDPRINTF ((stderr, "Starting parse\n"));
1279 
1280   yystate = 0;
1281   yyerrstatus = 0;
1282   yynerrs = 0;
1283   yychar = YYEMPTY; /* Cause a token to be read.  */
1284 
1285   /* Initialize stack pointers.
1286      Waste one element of value and location stack
1287      so that they stay on the same level as the state stack.
1288      The wasted elements are never initialized.  */
1289   yyssp = yyss;
1290   yyvsp = yyvs;
1291   goto yysetstate;
1292 
1293 /*------------------------------------------------------------.
1294 | yynewstate -- Push a new state, which is found in yystate.  |
1295 `------------------------------------------------------------*/
1296  yynewstate:
1297   /* In all cases, when you get here, the value and location stacks
1298      have just been pushed.  So pushing a state here evens the stacks.  */
1299   yyssp++;
1300 
1301  yysetstate:
1302   *yyssp = yystate;
1303 
1304   if (yyss + yystacksize - 1 <= yyssp)
1305     {
1306       /* Get the current used size of the three stacks, in elements.  */
1307       YYSIZE_T yysize = yyssp - yyss + 1;
1308 
1309 #ifdef yyoverflow
1310       {
1311 	/* Give user a chance to reallocate the stack.  Use copies of
1312 	   these so that the &'s don't force the real ones into
1313 	   memory.  */
1314 	YYSTYPE *yyvs1 = yyvs;
1315 	yytype_int16 *yyss1 = yyss;
1316 
1317 	/* Each stack pointer address is followed by the size of the
1318 	   data in use in that stack, in bytes.  This used to be a
1319 	   conditional around just the two extra args, but that might
1320 	   be undefined if yyoverflow is a macro.  */
1321 	yyoverflow (YY_("memory exhausted"),
1322 		    &yyss1, yysize * sizeof (*yyssp),
1323 		    &yyvs1, yysize * sizeof (*yyvsp),
1324 		    &yystacksize);
1325 
1326 	yyss = yyss1;
1327 	yyvs = yyvs1;
1328       }
1329 #else /* no yyoverflow */
1330 # ifndef YYSTACK_RELOCATE
1331       goto yyexhaustedlab;
1332 # else
1333       /* Extend the stack our own way.  */
1334       if (YYMAXDEPTH <= yystacksize)
1335 	goto yyexhaustedlab;
1336       yystacksize *= 2;
1337       if (YYMAXDEPTH < yystacksize)
1338 	yystacksize = YYMAXDEPTH;
1339 
1340       {
1341 	yytype_int16 *yyss1 = yyss;
1342 	union yyalloc *yyptr =
1343 	  (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1344 	if (! yyptr)
1345 	  goto yyexhaustedlab;
1346 	YYSTACK_RELOCATE (yyss_alloc, yyss);
1347 	YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1348 #  undef YYSTACK_RELOCATE
1349 	if (yyss1 != yyssa)
1350 	  YYSTACK_FREE (yyss1);
1351       }
1352 # endif
1353 #endif /* no yyoverflow */
1354 
1355       yyssp = yyss + yysize - 1;
1356       yyvsp = yyvs + yysize - 1;
1357 
1358       YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1359 		  (unsigned long int) yystacksize));
1360 
1361       if (yyss + yystacksize - 1 <= yyssp)
1362 	YYABORT;
1363     }
1364 
1365   YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1366 
1367   if (yystate == YYFINAL)
1368     YYACCEPT;
1369 
1370   goto yybackup;
1371 
1372 /*-----------.
1373 | yybackup.  |
1374 `-----------*/
1375 yybackup:
1376 
1377   /* Do appropriate processing given the current state.  Read a
1378      lookahead token if we need one and don't already have one.  */
1379 
1380   /* First try to decide what to do without reference to lookahead token.  */
1381   yyn = yypact[yystate];
1382   if (yypact_value_is_default (yyn))
1383     goto yydefault;
1384 
1385   /* Not known => get a lookahead token if don't already have one.  */
1386 
1387   /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol.  */
1388   if (yychar == YYEMPTY)
1389     {
1390       YYDPRINTF ((stderr, "Reading a token: "));
1391       yychar = YYLEX;
1392     }
1393 
1394   if (yychar <= YYEOF)
1395     {
1396       yychar = yytoken = YYEOF;
1397       YYDPRINTF ((stderr, "Now at end of input.\n"));
1398     }
1399   else
1400     {
1401       yytoken = YYTRANSLATE (yychar);
1402       YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1403     }
1404 
1405   /* If the proper action on seeing token YYTOKEN is to reduce or to
1406      detect an error, take that action.  */
1407   yyn += yytoken;
1408   if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1409     goto yydefault;
1410   yyn = yytable[yyn];
1411   if (yyn <= 0)
1412     {
1413       if (yytable_value_is_error (yyn))
1414         goto yyerrlab;
1415       yyn = -yyn;
1416       goto yyreduce;
1417     }
1418 
1419   /* Count tokens shifted since error; after three, turn off error
1420      status.  */
1421   if (yyerrstatus)
1422     yyerrstatus--;
1423 
1424   /* Shift the lookahead token.  */
1425   YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1426 
1427   /* Discard the shifted token.  */
1428   yychar = YYEMPTY;
1429 
1430   yystate = yyn;
1431   *++yyvsp = yylval;
1432 
1433   goto yynewstate;
1434 
1435 
1436 /*-----------------------------------------------------------.
1437 | yydefault -- do the default action for the current state.  |
1438 `-----------------------------------------------------------*/
1439 yydefault:
1440   yyn = yydefact[yystate];
1441   if (yyn == 0)
1442     goto yyerrlab;
1443   goto yyreduce;
1444 
1445 
1446 /*-----------------------------.
1447 | yyreduce -- Do a reduction.  |
1448 `-----------------------------*/
1449 yyreduce:
1450   /* yyn is the number of a rule to reduce with.  */
1451   yylen = yyr2[yyn];
1452 
1453   /* If YYLEN is nonzero, implement the default value of the action:
1454      `$$ = $1'.
1455 
1456      Otherwise, the following line sets YYVAL to garbage.
1457      This behavior is undocumented and Bison
1458      users should not rely upon it.  Assigning to YYVAL
1459      unconditionally makes the parser a bit smaller, and it avoids a
1460      GCC warning that YYVAL may be used uninitialized.  */
1461   yyval = yyvsp[1-yylen];
1462 
1463 
1464   YY_REDUCE_PRINT (yyn);
1465   switch (yyn)
1466     {
1467         case 5:
1468 /* Line 1787 of yacc.c  */
1469 #line 62 "fbset_modes_y.y"
1470     {
1471 		VideoMode.name = (yyvsp[(2) - (6)].string);
1472 		AddVideoMode(&VideoMode);
1473 		ClearVideoMode();
1474 	    }
1475     break;
1476 
1477   case 6:
1478 /* Line 1787 of yacc.c  */
1479 #line 70 "fbset_modes_y.y"
1480     {
1481 		ClearVideoMode();
1482 		VideoMode.xres = (yyvsp[(2) - (6)].int_val);
1483 		VideoMode.yres = (yyvsp[(3) - (6)].int_val);
1484 		VideoMode.vxres = (yyvsp[(4) - (6)].int_val);
1485 		VideoMode.vyres = (yyvsp[(5) - (6)].int_val);
1486 		VideoMode.depth = (yyvsp[(6) - (6)].int_val);
1487 	    }
1488     break;
1489 
1490   case 7:
1491 /* Line 1787 of yacc.c  */
1492 #line 81 "fbset_modes_y.y"
1493     {
1494 		VideoMode.pixclock = (yyvsp[(2) - (8)].int_val);
1495 		VideoMode.left = (yyvsp[(3) - (8)].int_val);
1496 		VideoMode.right = (yyvsp[(4) - (8)].int_val);
1497 		VideoMode.upper = (yyvsp[(5) - (8)].int_val);
1498 		VideoMode.lower = (yyvsp[(6) - (8)].int_val);
1499 		VideoMode.hslen = (yyvsp[(7) - (8)].int_val);
1500 		VideoMode.vslen = (yyvsp[(8) - (8)].int_val);
1501 	    }
1502     break;
1503 
1504   case 21:
1505 /* Line 1787 of yacc.c  */
1506 #line 108 "fbset_modes_y.y"
1507     {
1508 		VideoMode.hsync = (yyvsp[(2) - (2)].int_val);
1509 	    }
1510     break;
1511 
1512   case 22:
1513 /* Line 1787 of yacc.c  */
1514 #line 114 "fbset_modes_y.y"
1515     {
1516 		VideoMode.vsync = (yyvsp[(2) - (2)].int_val);
1517 	    }
1518     break;
1519 
1520   case 23:
1521 /* Line 1787 of yacc.c  */
1522 #line 120 "fbset_modes_y.y"
1523     {
1524 		VideoMode.csync = (yyvsp[(2) - (2)].int_val);
1525 	    }
1526     break;
1527 
1528   case 24:
1529 /* Line 1787 of yacc.c  */
1530 #line 126 "fbset_modes_y.y"
1531     {
1532 		VideoMode.gsync = (yyvsp[(2) - (2)].int_val);
1533 	    }
1534     break;
1535 
1536   case 25:
1537 /* Line 1787 of yacc.c  */
1538 #line 132 "fbset_modes_y.y"
1539     {
1540 		VideoMode.extsync = (yyvsp[(2) - (2)].int_val);
1541 	    }
1542     break;
1543 
1544   case 26:
1545 /* Line 1787 of yacc.c  */
1546 #line 138 "fbset_modes_y.y"
1547     {
1548 		VideoMode.bcast = (yyvsp[(2) - (2)].int_val);
1549 	    }
1550     break;
1551 
1552   case 27:
1553 /* Line 1787 of yacc.c  */
1554 #line 144 "fbset_modes_y.y"
1555     {
1556 		VideoMode.laced = (yyvsp[(2) - (2)].int_val);
1557 	    }
1558     break;
1559 
1560   case 28:
1561 /* Line 1787 of yacc.c  */
1562 #line 150 "fbset_modes_y.y"
1563     {
1564 		VideoMode.dblscan = (yyvsp[(2) - (2)].int_val);
1565 	    }
1566     break;
1567 
1568   case 29:
1569 /* Line 1787 of yacc.c  */
1570 #line 156 "fbset_modes_y.y"
1571     {
1572 		makeRGBA(&VideoMode, (const char*)(yyvsp[(2) - (2)].string));
1573 	    }
1574     break;
1575 
1576   case 30:
1577 /* Line 1787 of yacc.c  */
1578 #line 162 "fbset_modes_y.y"
1579     {
1580 	    	VideoMode.nonstd = (yyvsp[(2) - (2)].int_val);
1581 	    }
1582     break;
1583 
1584   case 31:
1585 /* Line 1787 of yacc.c  */
1586 #line 168 "fbset_modes_y.y"
1587     {
1588 		VideoMode.accel_flags = (yyvsp[(2) - (2)].int_val);
1589 	    }
1590     break;
1591 
1592   case 32:
1593 /* Line 1787 of yacc.c  */
1594 #line 174 "fbset_modes_y.y"
1595     {
1596 		VideoMode.grayscale = (yyvsp[(2) - (2)].int_val);
1597 	    }
1598     break;
1599 
1600 
1601 /* Line 1787 of yacc.c  */
1602 #line 1603 "fbset_modes_y.c"
1603       default: break;
1604     }
1605   /* User semantic actions sometimes alter yychar, and that requires
1606      that yytoken be updated with the new translation.  We take the
1607      approach of translating immediately before every use of yytoken.
1608      One alternative is translating here after every semantic action,
1609      but that translation would be missed if the semantic action invokes
1610      YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
1611      if it invokes YYBACKUP.  In the case of YYABORT or YYACCEPT, an
1612      incorrect destructor might then be invoked immediately.  In the
1613      case of YYERROR or YYBACKUP, subsequent parser actions might lead
1614      to an incorrect destructor call or verbose syntax error message
1615      before the lookahead is translated.  */
1616   YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
1617 
1618   YYPOPSTACK (yylen);
1619   yylen = 0;
1620   YY_STACK_PRINT (yyss, yyssp);
1621 
1622   *++yyvsp = yyval;
1623 
1624   /* Now `shift' the result of the reduction.  Determine what state
1625      that goes to, based on the state we popped back to and the rule
1626      number reduced by.  */
1627 
1628   yyn = yyr1[yyn];
1629 
1630   yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
1631   if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1632     yystate = yytable[yystate];
1633   else
1634     yystate = yydefgoto[yyn - YYNTOKENS];
1635 
1636   goto yynewstate;
1637 
1638 
1639 /*------------------------------------.
1640 | yyerrlab -- here on detecting error |
1641 `------------------------------------*/
1642 yyerrlab:
1643   /* Make sure we have latest lookahead translation.  See comments at
1644      user semantic actions for why this is necessary.  */
1645   yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
1646 
1647   /* If not already recovering from an error, report this error.  */
1648   if (!yyerrstatus)
1649     {
1650       ++yynerrs;
1651 #if ! YYERROR_VERBOSE
1652       yyerror (YY_("syntax error"));
1653 #else
1654 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
1655                                         yyssp, yytoken)
1656       {
1657         char const *yymsgp = YY_("syntax error");
1658         int yysyntax_error_status;
1659         yysyntax_error_status = YYSYNTAX_ERROR;
1660         if (yysyntax_error_status == 0)
1661           yymsgp = yymsg;
1662         else if (yysyntax_error_status == 1)
1663           {
1664             if (yymsg != yymsgbuf)
1665               YYSTACK_FREE (yymsg);
1666             yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
1667             if (!yymsg)
1668               {
1669                 yymsg = yymsgbuf;
1670                 yymsg_alloc = sizeof yymsgbuf;
1671                 yysyntax_error_status = 2;
1672               }
1673             else
1674               {
1675                 yysyntax_error_status = YYSYNTAX_ERROR;
1676                 yymsgp = yymsg;
1677               }
1678           }
1679         yyerror (yymsgp);
1680         if (yysyntax_error_status == 2)
1681           goto yyexhaustedlab;
1682       }
1683 # undef YYSYNTAX_ERROR
1684 #endif
1685     }
1686 
1687 
1688 
1689   if (yyerrstatus == 3)
1690     {
1691       /* If just tried and failed to reuse lookahead token after an
1692 	 error, discard it.  */
1693 
1694       if (yychar <= YYEOF)
1695 	{
1696 	  /* Return failure if at end of input.  */
1697 	  if (yychar == YYEOF)
1698 	    YYABORT;
1699 	}
1700       else
1701 	{
1702 	  yydestruct ("Error: discarding",
1703 		      yytoken, &yylval);
1704 	  yychar = YYEMPTY;
1705 	}
1706     }
1707 
1708   /* Else will try to reuse lookahead token after shifting the error
1709      token.  */
1710   goto yyerrlab1;
1711 
1712 
1713 /*---------------------------------------------------.
1714 | yyerrorlab -- error raised explicitly by YYERROR.  |
1715 `---------------------------------------------------*/
1716 yyerrorlab:
1717 
1718   /* Pacify compilers like GCC when the user code never invokes
1719      YYERROR and the label yyerrorlab therefore never appears in user
1720      code.  */
1721   if (/*CONSTCOND*/ 0)
1722      goto yyerrorlab;
1723 
1724   /* Do not reclaim the symbols of the rule which action triggered
1725      this YYERROR.  */
1726   YYPOPSTACK (yylen);
1727   yylen = 0;
1728   YY_STACK_PRINT (yyss, yyssp);
1729   yystate = *yyssp;
1730   goto yyerrlab1;
1731 
1732 
1733 /*-------------------------------------------------------------.
1734 | yyerrlab1 -- common code for both syntax error and YYERROR.  |
1735 `-------------------------------------------------------------*/
1736 yyerrlab1:
1737   yyerrstatus = 3;	/* Each real token shifted decrements this.  */
1738 
1739   for (;;)
1740     {
1741       yyn = yypact[yystate];
1742       if (!yypact_value_is_default (yyn))
1743 	{
1744 	  yyn += YYTERROR;
1745 	  if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
1746 	    {
1747 	      yyn = yytable[yyn];
1748 	      if (0 < yyn)
1749 		break;
1750 	    }
1751 	}
1752 
1753       /* Pop the current state because it cannot handle the error token.  */
1754       if (yyssp == yyss)
1755 	YYABORT;
1756 
1757 
1758       yydestruct ("Error: popping",
1759 		  yystos[yystate], yyvsp);
1760       YYPOPSTACK (1);
1761       yystate = *yyssp;
1762       YY_STACK_PRINT (yyss, yyssp);
1763     }
1764 
1765   *++yyvsp = yylval;
1766 
1767 
1768   /* Shift the error token.  */
1769   YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
1770 
1771   yystate = yyn;
1772   goto yynewstate;
1773 
1774 
1775 /*-------------------------------------.
1776 | yyacceptlab -- YYACCEPT comes here.  |
1777 `-------------------------------------*/
1778 yyacceptlab:
1779   yyresult = 0;
1780   goto yyreturn;
1781 
1782 /*-----------------------------------.
1783 | yyabortlab -- YYABORT comes here.  |
1784 `-----------------------------------*/
1785 yyabortlab:
1786   yyresult = 1;
1787   goto yyreturn;
1788 
1789 #if !defined yyoverflow || YYERROR_VERBOSE
1790 /*-------------------------------------------------.
1791 | yyexhaustedlab -- memory exhaustion comes here.  |
1792 `-------------------------------------------------*/
1793 yyexhaustedlab:
1794   yyerror (YY_("memory exhausted"));
1795   yyresult = 2;
1796   /* Fall through.  */
1797 #endif
1798 
1799 yyreturn:
1800   if (yychar != YYEMPTY)
1801     {
1802       /* Make sure we have latest lookahead translation.  See comments at
1803          user semantic actions for why this is necessary.  */
1804       yytoken = YYTRANSLATE (yychar);
1805       yydestruct ("Cleanup: discarding lookahead",
1806                   yytoken, &yylval);
1807     }
1808   /* Do not reclaim the symbols of the rule which action triggered
1809      this YYABORT or YYACCEPT.  */
1810   YYPOPSTACK (yylen);
1811   YY_STACK_PRINT (yyss, yyssp);
1812   while (yyssp != yyss)
1813     {
1814       yydestruct ("Cleanup: popping",
1815 		  yystos[*yyssp], yyvsp);
1816       YYPOPSTACK (1);
1817     }
1818 #ifndef yyoverflow
1819   if (yyss != yyssa)
1820     YYSTACK_FREE (yyss);
1821 #endif
1822 #if YYERROR_VERBOSE
1823   if (yymsg != yymsgbuf)
1824     YYSTACK_FREE (yymsg);
1825 #endif
1826   /* Make sure YYID is used.  */
1827   return YYID (yyresult);
1828 }
1829 
1830 
1831 /* Line 2048 of yacc.c  */
1832 #line 179 "fbset_modes_y.y"
1833 
1834