Debian Codegraph @

src/gutenprintui2/printrcy.c

raw symbols SCIP
1 /* A Bison parser, made by GNU Bison 3.8.2. */
2
3 /* Bison implementation for Yacc-like parsers in C
4
5 Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation,
6 Inc.
7
8 This program is free software: you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation, either version 3 of the License, or
11 (at your option) any later version.
12
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with this program. If not, see <https://www.gnu.org/licenses/>. */
20
21 /* As a special exception, you may create a larger work that contains
22 part or all of the Bison parser skeleton and distribute that work
23 under terms of your choice, so long as that work isn't itself a
24 parser generator using the skeleton or a modified version thereof
25 as a parser skeleton. Alternatively, if you modify or redistribute
26 the parser skeleton itself, you may (at your option) remove this
27 special exception, which will cause the skeleton and the resulting
28 Bison output files to be licensed under the GNU General Public
29 License without this special exception.
30
31 This special exception was added by the Free Software Foundation in
32 version 2.2 of Bison. */
33
34 /* C LALR(1) parser skeleton written by Richard Stallman, by
35 simplifying the original so-called "semantic" parser. */
36
37 /* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual,
38 especially those whose name start with YY_ or yy_. They are
39 private implementation details that can be changed or removed. */
40
41 /* All symbols defined below should begin with yy or YY, to avoid
42 infringing on user name space. This should be done even for local
43 variables, as they might otherwise be expanded by user macros.
44 There are some unavoidable exceptions within include files to
45 define necessary library symbols; they are noted "INFRINGES ON
46 USER NAME SPACE" below. */
47
48 /* Identify Bison output, and Bison version. */
49 #define YYBISON 30802
50
51 /* Bison version string. */
52 #define YYBISON_VERSION "3.8.2"
53
54 /* Skeleton name. */
55 #define YYSKELETON_NAME "yacc.c"
56
57 /* Pure parsers. */
58 #define YYPURE 0
59
60 /* Push parsers. */
61 #define YYPUSH 0
62
63 /* Pull parsers. */
64 #define YYPULL 1
65
66
67
68
69 /* First part of user prologue. */
70 #line 21 "printrcy.y"
71
72
73 #ifdef HAVE_CONFIG_H
74 #include <config.h>
75 #endif
76
77 #include <gutenprint/gutenprint-intl-internal.h>
78 #include <gutenprintui2/gutenprintui.h>
79 #include "gutenprintui-internal.h"
80 #include "printrc.h"
81
82 #include <string.h>
83 #include <stdio.h>
84 #include <stdlib.h>
85
86 extern int mylineno;
87
88 extern int yylex(void);
89 char *quotestrip(const char *i);
90 char *endstrip(const char *i);
91
92 extern char* yytext;
93
94 static int yyerror( const char *s )
95 {
96 fprintf(stderr,"stdin:%d: %s before '%s'\n", mylineno, s, yytext);
97 return 0;
98 }
99
100 static stpui_plist_t *current_printer = NULL;
101
102
103 #line 104 "printrcy.c"
104
105 # ifndef YY_CAST
106 # ifdef __cplusplus
107 # define YY_CAST(Type, Val) static_cast<Type> (Val)
108 # define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast<Type> (Val)
109 # else
110 # define YY_CAST(Type, Val) ((Type) (Val))
111 # define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val))
112 # endif
113 # endif
114 # ifndef YY_NULLPTR
115 # if defined __cplusplus
116 # if 201103L <= __cplusplus
117 # define YY_NULLPTR nullptr
118 # else
119 # define YY_NULLPTR 0
120 # endif
121 # else
122 # define YY_NULLPTR ((void*)0)
123 # endif
124 # endif
125
126 /* Use api.header.include to #include this header
127 instead of duplicating it here. */
128 #ifndef YY_YY_PRINTRCY_H_INCLUDED
129 # define YY_YY_PRINTRCY_H_INCLUDED
130 /* Debug traces. */
131 #ifndef YYDEBUG
132 # define YYDEBUG 0
133 #endif
134 #if YYDEBUG
135 extern int yydebug;
136 #endif
137
138 /* Token kinds. */
139 #ifndef YYTOKENTYPE
140 # define YYTOKENTYPE
141 enum yytokentype
142 {
143 YYEMPTY = -2,
144 YYEOF = 0, /* "end of file" */
145 YYerror = 256, /* error */
146 YYUNDEF = 257, /* "invalid token" */
147 tNUMBER = 258, /* tNUMBER */
148 tBOOLEAN = 259, /* tBOOLEAN */
149 tSTRING = 260, /* tSTRING */
150 tWORD = 261, /* tWORD */
151 tGSWORD = 262, /* tGSWORD */
152 CURRENT_PRINTER = 263, /* CURRENT_PRINTER */
153 SHOW_ALL_PAPER_SIZES = 264, /* SHOW_ALL_PAPER_SIZES */
154 PRINTER = 265, /* PRINTER */
155 DESTINATION = 266, /* DESTINATION */
156 SCALING = 267, /* SCALING */
157 ORIENTATION = 268, /* ORIENTATION */
158 AUTOSIZE_ROLL_PAPER = 269, /* AUTOSIZE_ROLL_PAPER */
159 UNIT = 270, /* UNIT */
160 DRIVER = 271, /* DRIVER */
161 LEFT = 272, /* LEFT */
162 TOP = 273, /* TOP */
163 CUSTOM_PAGE_WIDTH = 274, /* CUSTOM_PAGE_WIDTH */
164 CUSTOM_PAGE_HEIGHT = 275, /* CUSTOM_PAGE_HEIGHT */
165 OUTPUT_TYPE = 276, /* OUTPUT_TYPE */
166 PRINTRC_HDR = 277, /* PRINTRC_HDR */
167 PARAMETER = 278, /* PARAMETER */
168 QUEUE_NAME = 279, /* QUEUE_NAME */
169 OUTPUT_FILENAME = 280, /* OUTPUT_FILENAME */
170 EXTRA_PRINTER_OPTIONS = 281, /* EXTRA_PRINTER_OPTIONS */
171 CUSTOM_COMMAND = 282, /* CUSTOM_COMMAND */
172 COMMAND_TYPE = 283, /* COMMAND_TYPE */
173 GLOBAL_SETTINGS = 284, /* GLOBAL_SETTINGS */
174 GLOBAL = 285, /* GLOBAL */
175 END_GLOBAL_SETTINGS = 286, /* END_GLOBAL_SETTINGS */
176 pINT = 287, /* pINT */
177 pSTRING_LIST = 288, /* pSTRING_LIST */
178 pFILE = 289, /* pFILE */
179 pDOUBLE = 290, /* pDOUBLE */
180 pDIMENSION = 291, /* pDIMENSION */
181 pBOOLEAN = 292, /* pBOOLEAN */
182 pCURVE = 293 /* pCURVE */
183 };
184 typedef enum yytokentype yytoken_kind_t;
185 #endif
186 /* Token kinds. */
187 #define YYEMPTY -2
188 #define YYEOF 0
189 #define YYerror 256
190 #define YYUNDEF 257
191 #define tNUMBER 258
192 #define tBOOLEAN 259
193 #define tSTRING 260
194 #define tWORD 261
195 #define tGSWORD 262
196 #define CURRENT_PRINTER 263
197 #define SHOW_ALL_PAPER_SIZES 264
198 #define PRINTER 265
199 #define DESTINATION 266
200 #define SCALING 267
201 #define ORIENTATION 268
202 #define AUTOSIZE_ROLL_PAPER 269
203 #define UNIT 270
204 #define DRIVER 271
205 #define LEFT 272
206 #define TOP 273
207 #define CUSTOM_PAGE_WIDTH 274
208 #define CUSTOM_PAGE_HEIGHT 275
209 #define OUTPUT_TYPE 276
210 #define PRINTRC_HDR 277
211 #define PARAMETER 278
212 #define QUEUE_NAME 279
213 #define OUTPUT_FILENAME 280
214 #define EXTRA_PRINTER_OPTIONS 281
215 #define CUSTOM_COMMAND 282
216 #define COMMAND_TYPE 283
217 #define GLOBAL_SETTINGS 284
218 #define GLOBAL 285
219 #define END_GLOBAL_SETTINGS 286
220 #define pINT 287
221 #define pSTRING_LIST 288
222 #define pFILE 289
223 #define pDOUBLE 290
224 #define pDIMENSION 291
225 #define pBOOLEAN 292
226 #define pCURVE 293
227
228 /* Value type. */
229
230
231 extern YYSTYPE yylval;
232
233
234 int yyparse (void);
235
236
237 #endif /* !YY_YY_PRINTRCY_H_INCLUDED */
238 /* Symbol kind. */
239 enum yysymbol_kind_t
240 {
241 YYSYMBOL_YYEMPTY = -2,
242 YYSYMBOL_YYEOF = 0, /* "end of file" */
243 YYSYMBOL_YYerror = 1, /* error */
244 YYSYMBOL_YYUNDEF = 2, /* "invalid token" */
245 YYSYMBOL_tNUMBER = 3, /* tNUMBER */
246 YYSYMBOL_tBOOLEAN = 4, /* tBOOLEAN */
247 YYSYMBOL_tSTRING = 5, /* tSTRING */
248 YYSYMBOL_tWORD = 6, /* tWORD */
249 YYSYMBOL_tGSWORD = 7, /* tGSWORD */
250 YYSYMBOL_CURRENT_PRINTER = 8, /* CURRENT_PRINTER */
251 YYSYMBOL_SHOW_ALL_PAPER_SIZES = 9, /* SHOW_ALL_PAPER_SIZES */
252 YYSYMBOL_PRINTER = 10, /* PRINTER */
253 YYSYMBOL_DESTINATION = 11, /* DESTINATION */
254 YYSYMBOL_SCALING = 12, /* SCALING */
255 YYSYMBOL_ORIENTATION = 13, /* ORIENTATION */
256 YYSYMBOL_AUTOSIZE_ROLL_PAPER = 14, /* AUTOSIZE_ROLL_PAPER */
257 YYSYMBOL_UNIT = 15, /* UNIT */
258 YYSYMBOL_DRIVER = 16, /* DRIVER */
259 YYSYMBOL_LEFT = 17, /* LEFT */
260 YYSYMBOL_TOP = 18, /* TOP */
261 YYSYMBOL_CUSTOM_PAGE_WIDTH = 19, /* CUSTOM_PAGE_WIDTH */
262 YYSYMBOL_CUSTOM_PAGE_HEIGHT = 20, /* CUSTOM_PAGE_HEIGHT */
263 YYSYMBOL_OUTPUT_TYPE = 21, /* OUTPUT_TYPE */
264 YYSYMBOL_PRINTRC_HDR = 22, /* PRINTRC_HDR */
265 YYSYMBOL_PARAMETER = 23, /* PARAMETER */
266 YYSYMBOL_QUEUE_NAME = 24, /* QUEUE_NAME */
267 YYSYMBOL_OUTPUT_FILENAME = 25, /* OUTPUT_FILENAME */
268 YYSYMBOL_EXTRA_PRINTER_OPTIONS = 26, /* EXTRA_PRINTER_OPTIONS */
269 YYSYMBOL_CUSTOM_COMMAND = 27, /* CUSTOM_COMMAND */
270 YYSYMBOL_COMMAND_TYPE = 28, /* COMMAND_TYPE */
271 YYSYMBOL_GLOBAL_SETTINGS = 29, /* GLOBAL_SETTINGS */
272 YYSYMBOL_GLOBAL = 30, /* GLOBAL */
273 YYSYMBOL_END_GLOBAL_SETTINGS = 31, /* END_GLOBAL_SETTINGS */
274 YYSYMBOL_pINT = 32, /* pINT */
275 YYSYMBOL_pSTRING_LIST = 33, /* pSTRING_LIST */
276 YYSYMBOL_pFILE = 34, /* pFILE */
277 YYSYMBOL_pDOUBLE = 35, /* pDOUBLE */
278 YYSYMBOL_pDIMENSION = 36, /* pDIMENSION */
279 YYSYMBOL_pBOOLEAN = 37, /* pBOOLEAN */
280 YYSYMBOL_pCURVE = 38, /* pCURVE */
281 YYSYMBOL_YYACCEPT = 39, /* $accept */
282 YYSYMBOL_Printer = 40, /* Printer */
283 YYSYMBOL_Destination = 41, /* Destination */
284 YYSYMBOL_Queue_Name = 42, /* Queue_Name */
285 YYSYMBOL_Output_Filename = 43, /* Output_Filename */
286 YYSYMBOL_Extra_Printer_Options = 44, /* Extra_Printer_Options */
287 YYSYMBOL_Custom_Command = 45, /* Custom_Command */
288 YYSYMBOL_Command_Type = 46, /* Command_Type */
289 YYSYMBOL_Scaling = 47, /* Scaling */
290 YYSYMBOL_Orientation = 48, /* Orientation */
291 YYSYMBOL_Autosize_Roll_Paper = 49, /* Autosize_Roll_Paper */
292 YYSYMBOL_Unit = 50, /* Unit */
293 YYSYMBOL_Left = 51, /* Left */
294 YYSYMBOL_Top = 52, /* Top */
295 YYSYMBOL_Output_Type = 53, /* Output_Type */
296 YYSYMBOL_Custom_Page_Width = 54, /* Custom_Page_Width */
297 YYSYMBOL_Custom_Page_Height = 55, /* Custom_Page_Height */
298 YYSYMBOL_Empty = 56, /* Empty */
299 YYSYMBOL_Int_Param = 57, /* Int_Param */
300 YYSYMBOL_String_List_Param = 58, /* String_List_Param */
301 YYSYMBOL_File_Param = 59, /* File_Param */
302 YYSYMBOL_Double_Param = 60, /* Double_Param */
303 YYSYMBOL_Dimension_Param = 61, /* Dimension_Param */
304 YYSYMBOL_Boolean_Param = 62, /* Boolean_Param */
305 YYSYMBOL_Curve_Param = 63, /* Curve_Param */
306 YYSYMBOL_Typed_Param = 64, /* Typed_Param */
307 YYSYMBOL_Parameter = 65, /* Parameter */
308 YYSYMBOL_Parameters = 66, /* Parameters */
309 YYSYMBOL_Standard_Value = 67, /* Standard_Value */
310 YYSYMBOL_Standard_Values = 68, /* Standard_Values */
311 YYSYMBOL_A_Printer = 69, /* A_Printer */
312 YYSYMBOL_Printers = 70, /* Printers */
313 YYSYMBOL_Current_Printer = 71, /* Current_Printer */
314 YYSYMBOL_Show_All_Paper_Sizes = 72, /* Show_All_Paper_Sizes */
315 YYSYMBOL_Global = 73, /* Global */
316 YYSYMBOL_Old_Globals = 74, /* Old_Globals */
317 YYSYMBOL_New_Global_Setting = 75, /* New_Global_Setting */
318 YYSYMBOL_Global_Setting = 76, /* Global_Setting */
319 YYSYMBOL_Global_Settings = 77, /* Global_Settings */
320 YYSYMBOL_Global_Subblock = 78, /* Global_Subblock */
321 YYSYMBOL_Global_Block = 79, /* Global_Block */
322 YYSYMBOL_Thing = 80 /* Thing */
323 };
324 typedef enum yysymbol_kind_t yysymbol_kind_t;
325
326
327
328
329 #ifdef short
330 # undef short
331 #endif
332
333 /* On compilers that do not define __PTRDIFF_MAX__ etc., make sure
334 <limits.h> and (if available) <stdint.h> are included
335 so that the code can choose integer types of a good width. */
336
337 #ifndef __PTRDIFF_MAX__
338 # include <limits.h> /* INFRINGES ON USER NAME SPACE */
339 # if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
340 # include <stdint.h> /* INFRINGES ON USER NAME SPACE */
341 # define YY_STDINT_H
342 # endif
343 #endif
344
345 /* Narrow types that promote to a signed type and that can represent a
346 signed or unsigned integer of at least N bits. In tables they can
347 save space and decrease cache pressure. Promoting to a signed type
348 helps avoid bugs in integer arithmetic. */
349
350 #ifdef __INT_LEAST8_MAX__
351 typedef __INT_LEAST8_TYPE__ yytype_int8;
352 #elif defined YY_STDINT_H
353 typedef int_least8_t yytype_int8;
354 #else
355 typedef signed char yytype_int8;
356 #endif
357
358 #ifdef __INT_LEAST16_MAX__
359 typedef __INT_LEAST16_TYPE__ yytype_int16;
360 #elif defined YY_STDINT_H
361 typedef int_least16_t yytype_int16;
362 #else
363 typedef short yytype_int16;
364 #endif
365
366 /* Work around bug in HP-UX 11.23, which defines these macros
367 incorrectly for preprocessor constants. This workaround can likely
368 be removed in 2023, as HPE has promised support for HP-UX 11.23
369 (aka HP-UX 11i v2) only through the end of 2022; see Table 2 of
370 <https://h20195.www2.hpe.com/V2/getpdf.aspx/4AA4-7673ENW.pdf>. */
371 #ifdef __hpux
372 # undef UINT_LEAST8_MAX
373 # undef UINT_LEAST16_MAX
374 # define UINT_LEAST8_MAX 255
375 # define UINT_LEAST16_MAX 65535
376 #endif
377
378 #if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__
379 typedef __UINT_LEAST8_TYPE__ yytype_uint8;
380 #elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \
381 && UINT_LEAST8_MAX <= INT_MAX)
382 typedef uint_least8_t yytype_uint8;
383 #elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX
384 typedef unsigned char yytype_uint8;
385 #else
386 typedef short yytype_uint8;
387 #endif
388
389 #if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__
390 typedef __UINT_LEAST16_TYPE__ yytype_uint16;
391 #elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \
392 && UINT_LEAST16_MAX <= INT_MAX)
393 typedef uint_least16_t yytype_uint16;
394 #elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX
395 typedef unsigned short yytype_uint16;
396 #else
397 typedef int yytype_uint16;
398 #endif
399
400 #ifndef YYPTRDIFF_T
401 # if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__
402 # define YYPTRDIFF_T __PTRDIFF_TYPE__
403 # define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__
404 # elif defined PTRDIFF_MAX
405 # ifndef ptrdiff_t
406 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
407 # endif
408 # define YYPTRDIFF_T ptrdiff_t
409 # define YYPTRDIFF_MAXIMUM PTRDIFF_MAX
410 # else
411 # define YYPTRDIFF_T long
412 # define YYPTRDIFF_MAXIMUM LONG_MAX
413 # endif
414 #endif
415
416 #ifndef YYSIZE_T
417 # ifdef __SIZE_TYPE__
418 # define YYSIZE_T __SIZE_TYPE__
419 # elif defined size_t
420 # define YYSIZE_T size_t
421 # elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
422 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
423 # define YYSIZE_T size_t
424 # else
425 # define YYSIZE_T unsigned
426 # endif
427 #endif
428
429 #define YYSIZE_MAXIMUM \
430 YY_CAST (YYPTRDIFF_T, \
431 (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1) \
432 ? YYPTRDIFF_MAXIMUM \
433 : YY_CAST (YYSIZE_T, -1)))
434
435 #define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X))
436
437
438 /* Stored state numbers (used for stacks). */
439 typedef yytype_int8 yy_state_t;
440
441 /* State numbers in computations. */
442 typedef int yy_state_fast_t;
443
444 #ifndef YY_
445 # if defined YYENABLE_NLS && YYENABLE_NLS
446 # if ENABLE_NLS
447 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
448 # define YY_(Msgid) dgettext ("bison-runtime", Msgid)
449 # endif
450 # endif
451 # ifndef YY_
452 # define YY_(Msgid) Msgid
453 # endif
454 #endif
455
456
457 #ifndef YY_ATTRIBUTE_PURE
458 # if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__)
459 # define YY_ATTRIBUTE_PURE __attribute__ ((__pure__))
460 # else
461 # define YY_ATTRIBUTE_PURE
462 # endif
463 #endif
464
465 #ifndef YY_ATTRIBUTE_UNUSED
466 # if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__)
467 # define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__))
468 # else
469 # define YY_ATTRIBUTE_UNUSED
470 # endif
471 #endif
472
473 /* Suppress unused-variable warnings by "using" E. */
474 #if ! defined lint || defined __GNUC__
475 # define YY_USE(E) ((void) (E))
476 #else
477 # define YY_USE(E) /* empty */
478 #endif
479
480 /* Suppress an incorrect diagnostic about yylval being uninitialized. */
481 #if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__
482 # if __GNUC__ * 100 + __GNUC_MINOR__ < 407
483 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
484 _Pragma ("GCC diagnostic push") \
485 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")
486 # else
487 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
488 _Pragma ("GCC diagnostic push") \
489 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \
490 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
491 # endif
492 # define YY_IGNORE_MAYBE_UNINITIALIZED_END \
493 _Pragma ("GCC diagnostic pop")
494 #else
495 # define YY_INITIAL_VALUE(Value) Value
496 #endif
497 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
498 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
499 # define YY_IGNORE_MAYBE_UNINITIALIZED_END
500 #endif
501 #ifndef YY_INITIAL_VALUE
502 # define YY_INITIAL_VALUE(Value) /* Nothing. */
503 #endif
504
505 #if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__
506 # define YY_IGNORE_USELESS_CAST_BEGIN \
507 _Pragma ("GCC diagnostic push") \
508 _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"")
509 # define YY_IGNORE_USELESS_CAST_END \
510 _Pragma ("GCC diagnostic pop")
511 #endif
512 #ifndef YY_IGNORE_USELESS_CAST_BEGIN
513 # define YY_IGNORE_USELESS_CAST_BEGIN
514 # define YY_IGNORE_USELESS_CAST_END
515 #endif
516
517
518 #define YY_ASSERT(E) ((void) (0 && (E)))
519
520 #if !defined yyoverflow
521
522 /* The parser invokes alloca or malloc; define the necessary symbols. */
523
524 # ifdef YYSTACK_USE_ALLOCA
525 # if YYSTACK_USE_ALLOCA
526 # ifdef __GNUC__
527 # define YYSTACK_ALLOC __builtin_alloca
528 # elif defined __BUILTIN_VA_ARG_INCR
529 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
530 # elif defined _AIX
531 # define YYSTACK_ALLOC __alloca
532 # elif defined _MSC_VER
533 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
534 # define alloca _alloca
535 # else
536 # define YYSTACK_ALLOC alloca
537 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
538 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
539 /* Use EXIT_SUCCESS as a witness for stdlib.h. */
540 # ifndef EXIT_SUCCESS
541 # define EXIT_SUCCESS 0
542 # endif
543 # endif
544 # endif
545 # endif
546 # endif
547
548 # ifdef YYSTACK_ALLOC
549 /* Pacify GCC's 'empty if-body' warning. */
550 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
551 # ifndef YYSTACK_ALLOC_MAXIMUM
552 /* The OS might guarantee only one guard page at the bottom of the stack,
553 and a page size can be as small as 4096 bytes. So we cannot safely
554 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
555 to allow for a few compiler-allocated temporary stack slots. */
556 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
557 # endif
558 # else
559 # define YYSTACK_ALLOC YYMALLOC
560 # define YYSTACK_FREE YYFREE
561 # ifndef YYSTACK_ALLOC_MAXIMUM
562 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
563 # endif
564 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
565 && ! ((defined YYMALLOC || defined malloc) \
566 && (defined YYFREE || defined free)))
567 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
568 # ifndef EXIT_SUCCESS
569 # define EXIT_SUCCESS 0
570 # endif
571 # endif
572 # ifndef YYMALLOC
573 # define YYMALLOC malloc
574 # if ! defined malloc && ! defined EXIT_SUCCESS
575 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
576 # endif
577 # endif
578 # ifndef YYFREE
579 # define YYFREE free
580 # if ! defined free && ! defined EXIT_SUCCESS
581 void free (void *); /* INFRINGES ON USER NAME SPACE */
582 # endif
583 # endif
584 # endif
585 #endif /* !defined yyoverflow */
586
587 #if (! defined yyoverflow \
588 && (! defined __cplusplus \
589 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
590
591 /* A type that is properly aligned for any stack member. */
592 union yyalloc
593 {
594 yy_state_t yyss_alloc;
595 YYSTYPE yyvs_alloc;
596 };
597
598 /* The size of the maximum gap between one aligned stack and the next. */
599 # define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1)
600
601 /* The size of an array large to enough to hold all stacks, each with
602 N elements. */
603 # define YYSTACK_BYTES(N) \
604 ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE)) \
605 + YYSTACK_GAP_MAXIMUM)
606
607 # define YYCOPY_NEEDED 1
608
609 /* Relocate STACK from its old location to the new one. The
610 local variables YYSIZE and YYSTACKSIZE give the old and new number of
611 elements in the stack, and YYPTR gives the new location of the
612 stack. Advance YYPTR to a properly aligned location for the next
613 stack. */
614 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
615 do \
616 { \
617 YYPTRDIFF_T yynewbytes; \
618 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
619 Stack = &yyptr->Stack_alloc; \
620 yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \
621 yyptr += yynewbytes / YYSIZEOF (*yyptr); \
622 } \
623 while (0)
624
625 #endif
626
627 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
628 /* Copy COUNT objects from SRC to DST. The source and destination do
629 not overlap. */
630 # ifndef YYCOPY
631 # if defined __GNUC__ && 1 < __GNUC__
632 # define YYCOPY(Dst, Src, Count) \
633 __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src)))
634 # else
635 # define YYCOPY(Dst, Src, Count) \
636 do \
637 { \
638 YYPTRDIFF_T yyi; \
639 for (yyi = 0; yyi < (Count); yyi++) \
640 (Dst)[yyi] = (Src)[yyi]; \
641 } \
642 while (0)
643 # endif
644 # endif
645 #endif /* !YYCOPY_NEEDED */
646
647 /* YYFINAL -- State number of the termination state. */
648 #define YYFINAL 10
649 /* YYLAST -- Last index in YYTABLE. */
650 #define YYLAST 73
651
652 /* YYNTOKENS -- Number of terminals. */
653 #define YYNTOKENS 39
654 /* YYNNTS -- Number of nonterminals. */
655 #define YYNNTS 42
656 /* YYNRULES -- Number of rules. */
657 #define YYNRULES 70
658 /* YYNSTATES -- Number of states. */
659 #define YYNSTATES 114
660
661 /* YYMAXUTOK -- Last valid token kind. */
662 #define YYMAXUTOK 293
663
664
665 /* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM
666 as returned by yylex, with out-of-bounds checking. */
667 #define YYTRANSLATE(YYX) \
668 (0 <= (YYX) && (YYX) <= YYMAXUTOK \
669 ? YY_CAST (yysymbol_kind_t, yytranslate[YYX]) \
670 : YYSYMBOL_YYUNDEF)
671
672 /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
673 as returned by yylex. */
674 static const yytype_int8 yytranslate[] =
675 {
676 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
677 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
678 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
679 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
680 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
681 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
682 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
683 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
684 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
685 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
686 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
687 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
688 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
689 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
690 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
691 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
692 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
693 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
694 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
695 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
696 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
697 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
698 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
699 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
700 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
701 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
702 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
703 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
704 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
705 35, 36, 37, 38
706 };
707
708 #if YYDEBUG
709 /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
710 static const yytype_int16 yyrline[] =
711 {
712 0, 96, 96, 107, 114, 124, 134, 144, 154, 161,
713 168, 175, 182, 189, 196, 203, 224, 231, 238, 241,
714 258, 276, 294, 311, 328, 349, 372, 372, 372, 372,
715 373, 373, 373, 376, 379, 379, 382, 382, 382, 382,
716 383, 383, 383, 383, 383, 384, 384, 384, 384, 385,
717 385, 388, 388, 391, 394, 394, 397, 401, 411, 411,
718 414, 417, 428, 428, 431, 431, 434, 437, 437, 437,
719 440
720 };
721 #endif
722
723 /** Accessing symbol of state STATE. */
724 #define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State])
725
726 #if YYDEBUG || 0
727 /* The user-facing name of the symbol whose (internal) number is
728 YYSYMBOL. No bounds checking. */
729 static const char *yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED;
730
731 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
732 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
733 static const char *const yytname[] =
734 {
735 "\"end of file\"", "error", "\"invalid token\"", "tNUMBER", "tBOOLEAN",
736 "tSTRING", "tWORD", "tGSWORD", "CURRENT_PRINTER", "SHOW_ALL_PAPER_SIZES",
737 "PRINTER", "DESTINATION", "SCALING", "ORIENTATION",
738 "AUTOSIZE_ROLL_PAPER", "UNIT", "DRIVER", "LEFT", "TOP",
739 "CUSTOM_PAGE_WIDTH", "CUSTOM_PAGE_HEIGHT", "OUTPUT_TYPE", "PRINTRC_HDR",
740 "PARAMETER", "QUEUE_NAME", "OUTPUT_FILENAME", "EXTRA_PRINTER_OPTIONS",
741 "CUSTOM_COMMAND", "COMMAND_TYPE", "GLOBAL_SETTINGS", "GLOBAL",
742 "END_GLOBAL_SETTINGS", "pINT", "pSTRING_LIST", "pFILE", "pDOUBLE",
743 "pDIMENSION", "pBOOLEAN", "pCURVE", "$accept", "Printer", "Destination",
744 "Queue_Name", "Output_Filename", "Extra_Printer_Options",
745 "Custom_Command", "Command_Type", "Scaling", "Orientation",
746 "Autosize_Roll_Paper", "Unit", "Left", "Top", "Output_Type",
747 "Custom_Page_Width", "Custom_Page_Height", "Empty", "Int_Param",
748 "String_List_Param", "File_Param", "Double_Param", "Dimension_Param",
749 "Boolean_Param", "Curve_Param", "Typed_Param", "Parameter", "Parameters",
750 "Standard_Value", "Standard_Values", "A_Printer", "Printers",
751 "Current_Printer", "Show_All_Paper_Sizes", "Global", "Old_Globals",
752 "New_Global_Setting", "Global_Setting", "Global_Settings",
753 "Global_Subblock", "Global_Block", "Thing", YY_NULLPTR
754 };
755
756 static const char *
757 yysymbol_name (yysymbol_kind_t yysymbol)
758 {
759 return yytname[yysymbol];
760 }
761 #endif
762
763 #define YYPACT_NINF (-26)
764
765 #define yypact_value_is_default(Yyn) \
766 ((Yyn) == YYPACT_NINF)
767
768 #define YYTABLE_NINF (-1)
769
770 #define yytable_value_is_error(Yyn) \
771 0
772
773 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
774 STATE-NUM. */
775 static const yytype_int8 yypact[] =
776 {
777 -20, -2, 14, 10, -26, -26, 7, -26, -26, -26,
778 -26, -26, -26, -5, 13, -26, -26, 8, 15, -26,
779 -26, -26, -26, -26, -26, -26, 16, -26, -26, -26,
780 17, -26, 18, -26, 19, 22, 31, 37, 38, 44,
781 45, 46, 47, 48, 49, 50, 51, 52, 55, -26,
782 -26, -26, -26, -26, -26, -26, -26, -26, -26, -26,
783 -26, -26, -26, -26, -26, 29, -26, -26, -26, -26,
784 -26, -26, -26, -26, -26, -26, -26, -26, -26, -26,
785 -26, -26, 53, -26, -25, -26, -26, -26, -26, -26,
786 -26, -26, -26, 56, 57, 58, 59, 60, 61, 62,
787 64, 63, 65, 66, 68, 69, 67, -26, -26, -26,
788 -26, -26, -26, -26
789 };
790
791 /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
792 Performed when YYTABLE does not specify something else to do. Zero
793 means the default is an error. */
794 static const yytype_int8 yydefact[] =
795 {
796 0, 18, 0, 0, 18, 69, 0, 68, 67, 18,
797 1, 56, 65, 0, 0, 60, 55, 70, 0, 66,
798 58, 59, 62, 63, 64, 57, 0, 18, 54, 61,
799 0, 52, 18, 2, 0, 0, 0, 0, 0, 0,
800 0, 0, 0, 0, 0, 0, 0, 0, 0, 36,
801 46, 47, 48, 49, 50, 37, 38, 39, 40, 41,
802 42, 45, 43, 44, 35, 53, 51, 3, 9, 10,
803 11, 12, 13, 14, 16, 17, 15, 4, 5, 6,
804 7, 8, 0, 34, 0, 26, 27, 28, 29, 32,
805 30, 31, 33, 0, 0, 0, 0, 0, 0, 0,
806 0, 0, 0, 0, 0, 0, 0, 19, 20, 21,
807 22, 23, 24, 25
808 };
809
810 /* YYPGOTO[NTERM-NUM]. */
811 static const yytype_int8 yypgoto[] =
812 {
813 -26, -26, -26, -26, -26, -26, -26, -26, -26, -26,
814 -26, -26, -26, -26, -26, -26, -26, -4, -26, -26,
815 -26, -26, -26, -26, -26, -26, -26, -26, -26, -26,
816 -26, -26, 6, 40, -26, -26, -26, -26, -26, -26,
817 -26, -26
818 };
819
820 /* YYDEFGOTO[NTERM-NUM]. */
821 static const yytype_int8 yydefgoto[] =
822 {
823 0, 27, 49, 50, 51, 52, 53, 54, 55, 56,
824 57, 58, 59, 60, 61, 62, 63, 5, 85, 86,
825 87, 88, 89, 90, 91, 92, 83, 65, 66, 32,
826 28, 17, 6, 15, 22, 7, 23, 24, 13, 8,
827 9, 2
828 };
829
830 /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
831 positive, shift that token. If negative, reduce the rule whose
832 number is the opposite. If YYTABLE_NINF, syntax error. */
833 static const yytype_int8 yytable[] =
834 {
835 12, 18, 1, 3, 14, 16, 3, 93, 94, 95,
836 96, 97, 98, 99, 10, 11, 14, 25, 26, 20,
837 29, 30, 33, 31, 67, 68, 19, 4, 64, 34,
838 35, 36, 37, 38, 69, 39, 40, 41, 42, 43,
839 70, 71, 44, 45, 46, 47, 48, 72, 73, 74,
840 75, 76, 82, 21, 77, 78, 79, 80, 81, 84,
841 100, 101, 102, 103, 104, 105, 106, 107, 108, 110,
842 109, 111, 113, 112
843 };
844
845 static const yytype_int8 yycheck[] =
846 {
847 4, 6, 22, 8, 9, 9, 8, 32, 33, 34,
848 35, 36, 37, 38, 0, 5, 9, 4, 10, 13,
849 5, 5, 5, 27, 5, 3, 31, 29, 32, 11,
850 12, 13, 14, 15, 3, 17, 18, 19, 20, 21,
851 3, 3, 24, 25, 26, 27, 28, 3, 3, 3,
852 3, 3, 23, 13, 5, 5, 5, 5, 3, 6,
853 4, 4, 4, 4, 4, 4, 4, 3, 5, 3,
854 5, 3, 5, 4
855 };
856
857 /* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of
858 state STATE-NUM. */
859 static const yytype_int8 yystos[] =
860 {
861 0, 22, 80, 8, 29, 56, 71, 74, 78, 79,
862 0, 5, 56, 77, 9, 72, 56, 70, 6, 31,
863 71, 72, 73, 75, 76, 4, 10, 40, 69, 5,
864 5, 56, 68, 5, 11, 12, 13, 14, 15, 17,
865 18, 19, 20, 21, 24, 25, 26, 27, 28, 41,
866 42, 43, 44, 45, 46, 47, 48, 49, 50, 51,
867 52, 53, 54, 55, 56, 66, 67, 5, 3, 3,
868 3, 3, 3, 3, 3, 3, 3, 5, 5, 5,
869 5, 3, 23, 65, 6, 57, 58, 59, 60, 61,
870 62, 63, 64, 32, 33, 34, 35, 36, 37, 38,
871 4, 4, 4, 4, 4, 4, 4, 3, 5, 5,
872 3, 3, 4, 5
873 };
874
875 /* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. */
876 static const yytype_int8 yyr1[] =
877 {
878 0, 39, 40, 41, 42, 43, 44, 45, 46, 47,
879 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
880 58, 59, 60, 61, 62, 63, 64, 64, 64, 64,
881 64, 64, 64, 65, 66, 66, 67, 67, 67, 67,
882 67, 67, 67, 67, 67, 67, 67, 67, 67, 67,
883 67, 68, 68, 69, 70, 70, 71, 72, 73, 73,
884 74, 75, 76, 76, 77, 77, 78, 79, 79, 79,
885 80
886 };
887
888 /* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. */
889 static const yytype_int8 yyr2[] =
890 {
891 0, 2, 3, 2, 2, 2, 2, 2, 2, 2,
892 2, 2, 2, 2, 2, 2, 2, 2, 0, 4,
893 4, 4, 4, 4, 4, 4, 1, 1, 1, 1,
894 1, 1, 1, 2, 2, 1, 1, 1, 1, 1,
895 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
896 1, 2, 1, 3, 2, 1, 2, 2, 1, 1,
897 2, 2, 1, 1, 2, 1, 3, 1, 1, 1,
898 3
899 };
900
901
902 enum { YYENOMEM = -2 };
903
904 #define yyerrok (yyerrstatus = 0)
905 #define yyclearin (yychar = YYEMPTY)
906
907 #define YYACCEPT goto yyacceptlab
908 #define YYABORT goto yyabortlab
909 #define YYERROR goto yyerrorlab
910 #define YYNOMEM goto yyexhaustedlab
911
912
913 #define YYRECOVERING() (!!yyerrstatus)
914
915 #define YYBACKUP(Token, Value) \
916 do \
917 if (yychar == YYEMPTY) \
918 { \
919 yychar = (Token); \
920 yylval = (Value); \
921 YYPOPSTACK (yylen); \
922 yystate = *yyssp; \
923 goto yybackup; \
924 } \
925 else \
926 { \
927 yyerror (YY_("syntax error: cannot back up")); \
928 YYERROR; \
929 } \
930 while (0)
931
932 /* Backward compatibility with an undocumented macro.
933 Use YYerror or YYUNDEF. */
934 #define YYERRCODE YYUNDEF
935
936
937 /* Enable debugging if requested. */
938 #if YYDEBUG
939
940 # ifndef YYFPRINTF
941 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
942 # define YYFPRINTF fprintf
943 # endif
944
945 # define YYDPRINTF(Args) \
946 do { \
947 if (yydebug) \
948 YYFPRINTF Args; \
949 } while (0)
950
951
952
953
954 # define YY_SYMBOL_PRINT(Title, Kind, Value, Location) \
955 do { \
956 if (yydebug) \
957 { \
958 YYFPRINTF (stderr, "%s ", Title); \
959 yy_symbol_print (stderr, \
960 Kind, Value); \
961 YYFPRINTF (stderr, "\n"); \
962 } \
963 } while (0)
964
965
966 /*-----------------------------------.
967 | Print this symbol's value on YYO. |
968 `-----------------------------------*/
969
970 static void
971 yy_symbol_value_print (FILE *yyo,
972 yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep)
973 {
974 FILE *yyoutput = yyo;
975 YY_USE (yyoutput);
976 if (!yyvaluep)
977 return;
978 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
979 YY_USE (yykind);
980 YY_IGNORE_MAYBE_UNINITIALIZED_END
981 }
982
983
984 /*---------------------------.
985 | Print this symbol on YYO. |
986 `---------------------------*/
987
988 static void
989 yy_symbol_print (FILE *yyo,
990 yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep)
991 {
992 YYFPRINTF (yyo, "%s %s (",
993 yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind));
994
995 yy_symbol_value_print (yyo, yykind, yyvaluep);
996 YYFPRINTF (yyo, ")");
997 }
998
999 /*------------------------------------------------------------------.
1000 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1001 | TOP (included). |
1002 `------------------------------------------------------------------*/
1003
1004 static void
1005 yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop)
1006 {
1007 YYFPRINTF (stderr, "Stack now");
1008 for (; yybottom <= yytop; yybottom++)
1009 {
1010 int yybot = *yybottom;
1011 YYFPRINTF (stderr, " %d", yybot);
1012 }
1013 YYFPRINTF (stderr, "\n");
1014 }
1015
1016 # define YY_STACK_PRINT(Bottom, Top) \
1017 do { \
1018 if (yydebug) \
1019 yy_stack_print ((Bottom), (Top)); \
1020 } while (0)
1021
1022
1023 /*------------------------------------------------.
1024 | Report that the YYRULE is going to be reduced. |
1025 `------------------------------------------------*/
1026
1027 static void
1028 yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp,
1029 int yyrule)
1030 {
1031 int yylno = yyrline[yyrule];
1032 int yynrhs = yyr2[yyrule];
1033 int yyi;
1034 YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n",
1035 yyrule - 1, yylno);
1036 /* The symbols being reduced. */
1037 for (yyi = 0; yyi < yynrhs; yyi++)
1038 {
1039 YYFPRINTF (stderr, " $%d = ", yyi + 1);
1040 yy_symbol_print (stderr,
1041 YY_ACCESSING_SYMBOL (+yyssp[yyi + 1 - yynrhs]),
1042 &yyvsp[(yyi + 1) - (yynrhs)]);
1043 YYFPRINTF (stderr, "\n");
1044 }
1045 }
1046
1047 # define YY_REDUCE_PRINT(Rule) \
1048 do { \
1049 if (yydebug) \
1050 yy_reduce_print (yyssp, yyvsp, Rule); \
1051 } while (0)
1052
1053 /* Nonzero means print parse trace. It is left uninitialized so that
1054 multiple parsers can coexist. */
1055 int yydebug;
1056 #else /* !YYDEBUG */
1057 # define YYDPRINTF(Args) ((void) 0)
1058 # define YY_SYMBOL_PRINT(Title, Kind, Value, Location)
1059 # define YY_STACK_PRINT(Bottom, Top)
1060 # define YY_REDUCE_PRINT(Rule)
1061 #endif /* !YYDEBUG */
1062
1063
1064 /* YYINITDEPTH -- initial size of the parser's stacks. */
1065 #ifndef YYINITDEPTH
1066 # define YYINITDEPTH 200
1067 #endif
1068
1069 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1070 if the built-in stack extension method is used).
1071
1072 Do not make this value too large; the results are undefined if
1073 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1074 evaluated with infinite-precision integer arithmetic. */
1075
1076 #ifndef YYMAXDEPTH
1077 # define YYMAXDEPTH 10000
1078 #endif
1079
1080
1081
1082
1083
1084
1085 /*-----------------------------------------------.
1086 | Release the memory associated to this symbol. |
1087 `-----------------------------------------------*/
1088
1089 static void
1090 yydestruct (const char *yymsg,
1091 yysymbol_kind_t yykind, YYSTYPE *yyvaluep)
1092 {
1093 YY_USE (yyvaluep);
1094 if (!yymsg)
1095 yymsg = "Deleting";
1096 YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp);
1097
1098 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1099 YY_USE (yykind);
1100 YY_IGNORE_MAYBE_UNINITIALIZED_END
1101 }
1102
1103
1104 /* Lookahead token kind. */
1105 int yychar;
1106
1107 /* The semantic value of the lookahead symbol. */
1108 YYSTYPE yylval;
1109 /* Number of syntax errors so far. */
1110 int yynerrs;
1111
1112
1113
1114
1115 /*----------.
1116 | yyparse. |
1117 `----------*/
1118
1119 int
1120 yyparse (void)
1121 {
1122 yy_state_fast_t yystate = 0;
1123 /* Number of tokens to shift before error messages enabled. */
1124 int yyerrstatus = 0;
1125
1126 /* Refer to the stacks through separate pointers, to allow yyoverflow
1127 to reallocate them elsewhere. */
1128
1129 /* Their size. */
1130 YYPTRDIFF_T yystacksize = YYINITDEPTH;
1131
1132 /* The state stack: array, bottom, top. */
1133 yy_state_t yyssa[YYINITDEPTH];
1134 yy_state_t *yyss = yyssa;
1135 yy_state_t *yyssp = yyss;
1136
1137 /* The semantic value stack: array, bottom, top. */
1138 YYSTYPE yyvsa[YYINITDEPTH];
1139 YYSTYPE *yyvs = yyvsa;
1140 YYSTYPE *yyvsp = yyvs;
1141
1142 int yyn;
1143 /* The return value of yyparse. */
1144 int yyresult;
1145 /* Lookahead symbol kind. */
1146 yysymbol_kind_t yytoken = YYSYMBOL_YYEMPTY;
1147 /* The variables used to return semantic value and location from the
1148 action routines. */
1149 YYSTYPE yyval;
1150
1151
1152
1153 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1154
1155 /* The number of symbols on the RHS of the reduced rule.
1156 Keep to zero when no symbol should be popped. */
1157 int yylen = 0;
1158
1159 YYDPRINTF ((stderr, "Starting parse\n"));
1160
1161 yychar = YYEMPTY; /* Cause a token to be read. */
1162
1163 goto yysetstate;
1164
1165
1166 /*------------------------------------------------------------.
1167 | yynewstate -- push a new state, which is found in yystate. |
1168 `------------------------------------------------------------*/
1169 yynewstate:
1170 /* In all cases, when you get here, the value and location stacks
1171 have just been pushed. So pushing a state here evens the stacks. */
1172 yyssp++;
1173
1174
1175 /*--------------------------------------------------------------------.
1176 | yysetstate -- set current state (the top of the stack) to yystate. |
1177 `--------------------------------------------------------------------*/
1178 yysetstate:
1179 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1180 YY_ASSERT (0 <= yystate && yystate < YYNSTATES);
1181 YY_IGNORE_USELESS_CAST_BEGIN
1182 *yyssp = YY_CAST (yy_state_t, yystate);
1183 YY_IGNORE_USELESS_CAST_END
1184 YY_STACK_PRINT (yyss, yyssp);
1185
1186 if (yyss + yystacksize - 1 <= yyssp)
1187 #if !defined yyoverflow && !defined YYSTACK_RELOCATE
1188 YYNOMEM;
1189 #else
1190 {
1191 /* Get the current used size of the three stacks, in elements. */
1192 YYPTRDIFF_T yysize = yyssp - yyss + 1;
1193
1194 # if defined yyoverflow
1195 {
1196 /* Give user a chance to reallocate the stack. Use copies of
1197 these so that the &'s don't force the real ones into
1198 memory. */
1199 yy_state_t *yyss1 = yyss;
1200 YYSTYPE *yyvs1 = yyvs;
1201
1202 /* Each stack pointer address is followed by the size of the
1203 data in use in that stack, in bytes. This used to be a
1204 conditional around just the two extra args, but that might
1205 be undefined if yyoverflow is a macro. */
1206 yyoverflow (YY_("memory exhausted"),
1207 &yyss1, yysize * YYSIZEOF (*yyssp),
1208 &yyvs1, yysize * YYSIZEOF (*yyvsp),
1209 &yystacksize);
1210 yyss = yyss1;
1211 yyvs = yyvs1;
1212 }
1213 # else /* defined YYSTACK_RELOCATE */
1214 /* Extend the stack our own way. */
1215 if (YYMAXDEPTH <= yystacksize)
1216 YYNOMEM;
1217 yystacksize *= 2;
1218 if (YYMAXDEPTH < yystacksize)
1219 yystacksize = YYMAXDEPTH;
1220
1221 {
1222 yy_state_t *yyss1 = yyss;
1223 union yyalloc *yyptr =
1224 YY_CAST (union yyalloc *,
1225 YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize))));
1226 if (! yyptr)
1227 YYNOMEM;
1228 YYSTACK_RELOCATE (yyss_alloc, yyss);
1229 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1230 # undef YYSTACK_RELOCATE
1231 if (yyss1 != yyssa)
1232 YYSTACK_FREE (yyss1);
1233 }
1234 # endif
1235
1236 yyssp = yyss + yysize - 1;
1237 yyvsp = yyvs + yysize - 1;
1238
1239 YY_IGNORE_USELESS_CAST_BEGIN
1240 YYDPRINTF ((stderr, "Stack size increased to %ld\n",
1241 YY_CAST (long, yystacksize)));
1242 YY_IGNORE_USELESS_CAST_END
1243
1244 if (yyss + yystacksize - 1 <= yyssp)
1245 YYABORT;
1246 }
1247 #endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */
1248
1249
1250 if (yystate == YYFINAL)
1251 YYACCEPT;
1252
1253 goto yybackup;
1254
1255
1256 /*-----------.
1257 | yybackup. |
1258 `-----------*/
1259 yybackup:
1260 /* Do appropriate processing given the current state. Read a
1261 lookahead token if we need one and don't already have one. */
1262
1263 /* First try to decide what to do without reference to lookahead token. */
1264 yyn = yypact[yystate];
1265 if (yypact_value_is_default (yyn))
1266 goto yydefault;
1267
1268 /* Not known => get a lookahead token if don't already have one. */
1269
1270 /* YYCHAR is either empty, or end-of-input, or a valid lookahead. */
1271 if (yychar == YYEMPTY)
1272 {
1273 YYDPRINTF ((stderr, "Reading a token\n"));
1274 yychar = yylex ();
1275 }
1276
1277 if (yychar <= YYEOF)
1278 {
1279 yychar = YYEOF;
1280 yytoken = YYSYMBOL_YYEOF;
1281 YYDPRINTF ((stderr, "Now at end of input.\n"));
1282 }
1283 else if (yychar == YYerror)
1284 {
1285 /* The scanner already issued an error message, process directly
1286 to error recovery. But do not keep the error token as
1287 lookahead, it is too special and may lead us to an endless
1288 loop in error recovery. */
1289 yychar = YYUNDEF;
1290 yytoken = YYSYMBOL_YYerror;
1291 goto yyerrlab1;
1292 }
1293 else
1294 {
1295 yytoken = YYTRANSLATE (yychar);
1296 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1297 }
1298
1299 /* If the proper action on seeing token YYTOKEN is to reduce or to
1300 detect an error, take that action. */
1301 yyn += yytoken;
1302 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1303 goto yydefault;
1304 yyn = yytable[yyn];
1305 if (yyn <= 0)
1306 {
1307 if (yytable_value_is_error (yyn))
1308 goto yyerrlab;
1309 yyn = -yyn;
1310 goto yyreduce;
1311 }
1312
1313 /* Count tokens shifted since error; after three, turn off error
1314 status. */
1315 if (yyerrstatus)
1316 yyerrstatus--;
1317
1318 /* Shift the lookahead token. */
1319 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1320 yystate = yyn;
1321 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1322 *++yyvsp = yylval;
1323 YY_IGNORE_MAYBE_UNINITIALIZED_END
1324
1325 /* Discard the shifted token. */
1326 yychar = YYEMPTY;
1327 goto yynewstate;
1328
1329
1330 /*-----------------------------------------------------------.
1331 | yydefault -- do the default action for the current state. |
1332 `-----------------------------------------------------------*/
1333 yydefault:
1334 yyn = yydefact[yystate];
1335 if (yyn == 0)
1336 goto yyerrlab;
1337 goto yyreduce;
1338
1339
1340 /*-----------------------------.
1341 | yyreduce -- do a reduction. |
1342 `-----------------------------*/
1343 yyreduce:
1344 /* yyn is the number of a rule to reduce with. */
1345 yylen = yyr2[yyn];
1346
1347 /* If YYLEN is nonzero, implement the default value of the action:
1348 '$$ = $1'.
1349
1350 Otherwise, the following line sets YYVAL to garbage.
1351 This behavior is undocumented and Bison
1352 users should not rely upon it. Assigning to YYVAL
1353 unconditionally makes the parser a bit smaller, and it avoids a
1354 GCC warning that YYVAL may be used uninitialized. */
1355 yyval = yyvsp[1-yylen];
1356
1357
1358 YY_REDUCE_PRINT (yyn);
1359 switch (yyn)
1360 {
1361 case 2: /* Printer: PRINTER tSTRING tSTRING */
1362 #line 97 "printrcy.y"
1363 {
1364 current_printer = stpui_plist_create((yyvsp[-1].sval), (yyvsp[0].sval));
1365 g_free((yyvsp[-1].sval));
1366 g_free((yyvsp[0].sval));
1367 }
1368 #line 1369 "printrcy.c"
1369 break;
1370
1371 case 3: /* Destination: DESTINATION tSTRING */
1372 #line 108 "printrcy.y"
1373 {
1374 if ((yyvsp[0].sval))
1375 g_free((yyvsp[0].sval));
1376 }
1377 #line 1378 "printrcy.c"
1378 break;
1379
1380 case 4: /* Queue_Name: QUEUE_NAME tSTRING */
1381 #line 115 "printrcy.y"
1382 {
1383 if (current_printer && (yyvsp[0].sval))
1384 {
1385 stpui_plist_set_queue_name(current_printer, (yyvsp[0].sval));
1386 g_free((yyvsp[0].sval));
1387 }
1388 }
1389 #line 1390 "printrcy.c"
1390 break;
1391
1392 case 5: /* Output_Filename: OUTPUT_FILENAME tSTRING */
1393 #line 125 "printrcy.y"
1394 {
1395 if (current_printer && (yyvsp[0].sval))
1396 {
1397 stpui_plist_set_output_filename(current_printer, (yyvsp[0].sval));
1398 g_free((yyvsp[0].sval));
1399 }
1400 }
1401 #line 1402 "printrcy.c"
1402 break;
1403
1404 case 6: /* Extra_Printer_Options: EXTRA_PRINTER_OPTIONS tSTRING */
1405 #line 135 "printrcy.y"
1406 {
1407 if (current_printer && (yyvsp[0].sval))
1408 {
1409 stpui_plist_set_extra_printer_options(current_printer, (yyvsp[0].sval));
1410 g_free((yyvsp[0].sval));
1411 }
1412 }
1413 #line 1414 "printrcy.c"
1414 break;
1415
1416 case 7: /* Custom_Command: CUSTOM_COMMAND tSTRING */
1417 #line 145 "printrcy.y"
1418 {
1419 if (current_printer && (yyvsp[0].sval))
1420 {
1421 stpui_plist_set_custom_command(current_printer, (yyvsp[0].sval));
1422 g_free((yyvsp[0].sval));
1423 }
1424 }
1425 #line 1426 "printrcy.c"
1426 break;
1427
1428 case 8: /* Command_Type: COMMAND_TYPE tNUMBER */
1429 #line 155 "printrcy.y"
1430 {
1431 if (current_printer)
1432 stpui_plist_set_command_type(current_printer, (int) (yyvsp[0].dval));
1433 }
1434 #line 1435 "printrcy.c"
1435 break;
1436
1437 case 9: /* Scaling: SCALING tNUMBER */
1438 #line 162 "printrcy.y"
1439 {
1440 if (current_printer)
1441 current_printer->scaling = (yyvsp[0].dval);
1442 }
1443 #line 1444 "printrcy.c"
1444 break;
1445
1446 case 10: /* Orientation: ORIENTATION tNUMBER */
1447 #line 169 "printrcy.y"
1448 {
1449 if (current_printer)
1450 current_printer->orientation = (int) (yyvsp[0].dval);
1451 }
1452 #line 1453 "printrcy.c"
1453 break;
1454
1455 case 11: /* Autosize_Roll_Paper: AUTOSIZE_ROLL_PAPER tNUMBER */
1456 #line 176 "printrcy.y"
1457 {
1458 if (current_printer)
1459 current_printer->auto_size_roll_feed_paper = (int) (yyvsp[0].dval);
1460 }
1461 #line 1462 "printrcy.c"
1462 break;
1463
1464 case 12: /* Unit: UNIT tNUMBER */
1465 #line 183 "printrcy.y"
1466 {
1467 if (current_printer)
1468 current_printer->unit = (int) (yyvsp[0].dval);
1469 }
1470 #line 1471 "printrcy.c"
1471 break;
1472
1473 case 13: /* Left: LEFT tNUMBER */
1474 #line 190 "printrcy.y"
1475 {
1476 if (current_printer)
1477 stp_set_left(current_printer->v, (yyvsp[0].dval));
1478 }
1479 #line 1480 "printrcy.c"
1480 break;
1481
1482 case 14: /* Top: TOP tNUMBER */
1483 #line 197 "printrcy.y"
1484 {
1485 if (current_printer)
1486 stp_set_top(current_printer->v, (yyvsp[0].dval));
1487 }
1488 #line 1489 "printrcy.c"
1489 break;
1490
1491 case 15: /* Output_Type: OUTPUT_TYPE tNUMBER */
1492 #line 204 "printrcy.y"
1493 {
1494 if (current_printer)
1495 {
1496 switch ((int) (yyvsp[0].dval))
1497 {
1498 case 0:
1499 stp_set_string_parameter
1500 (current_printer->v, "PrintingMode", "BW");
1501 break;
1502 case 1:
1503 case 2:
1504 default:
1505 stp_set_string_parameter
1506 (current_printer->v, "PrintingMode", "Color");
1507 break;
1508 }
1509 }
1510 }
1511 #line 1512 "printrcy.c"
1512 break;
1513
1514 case 16: /* Custom_Page_Width: CUSTOM_PAGE_WIDTH tNUMBER */
1515 #line 225 "printrcy.y"
1516 {
1517 if (current_printer)
1518 stp_set_page_width(current_printer->v, (yyvsp[0].dval));
1519 }
1520 #line 1521 "printrcy.c"
1521 break;
1522
1523 case 17: /* Custom_Page_Height: CUSTOM_PAGE_HEIGHT tNUMBER */
1524 #line 232 "printrcy.y"
1525 {
1526 if (current_printer)
1527 stp_set_page_height(current_printer->v, (yyvsp[0].dval));
1528 }
1529 #line 1530 "printrcy.c"
1530 break;
1531
1532 case 19: /* Int_Param: tWORD pINT tBOOLEAN tNUMBER */
1533 #line 242 "printrcy.y"
1534 {
1535 if (current_printer)
1536 {
1537 stp_set_int_parameter(current_printer->v, (yyvsp[-3].sval), (int) (yyvsp[0].dval));
1538 if (strcmp((yyvsp[-1].sval), "False") == 0)
1539 stp_set_int_parameter_active(current_printer->v, (yyvsp[-3].sval),
1540 STP_PARAMETER_INACTIVE);
1541 else
1542 stp_set_int_parameter_active(current_printer->v, (yyvsp[-3].sval),
1543 STP_PARAMETER_ACTIVE);
1544 }
1545 g_free((yyvsp[-3].sval));
1546 g_free((yyvsp[-1].sval));
1547 }
1548 #line 1549 "printrcy.c"
1549 break;
1550
1551 case 20: /* String_List_Param: tWORD pSTRING_LIST tBOOLEAN tSTRING */
1552 #line 259 "printrcy.y"
1553 {
1554 if (current_printer)
1555 {
1556 stp_set_string_parameter(current_printer->v, (yyvsp[-3].sval), (yyvsp[0].sval));
1557 if (strcmp((yyvsp[-1].sval), "False") == 0)
1558 stp_set_string_parameter_active(current_printer->v, (yyvsp[-3].sval),
1559 STP_PARAMETER_INACTIVE);
1560 else
1561 stp_set_string_parameter_active(current_printer->v, (yyvsp[-3].sval),
1562 STP_PARAMETER_ACTIVE);
1563 }
1564 g_free((yyvsp[-3].sval));
1565 g_free((yyvsp[-1].sval));
1566 g_free((yyvsp[0].sval));
1567 }
1568 #line 1569 "printrcy.c"
1569 break;
1570
1571 case 21: /* File_Param: tWORD pFILE tBOOLEAN tSTRING */
1572 #line 277 "printrcy.y"
1573 {
1574 if (current_printer)
1575 {
1576 stp_set_file_parameter(current_printer->v, (yyvsp[-3].sval), (yyvsp[0].sval));
1577 if (strcmp((yyvsp[-1].sval), "False") == 0)
1578 stp_set_file_parameter_active(current_printer->v, (yyvsp[-3].sval),
1579 STP_PARAMETER_INACTIVE);
1580 else
1581 stp_set_file_parameter_active(current_printer->v, (yyvsp[-3].sval),
1582 STP_PARAMETER_ACTIVE);
1583 }
1584 g_free((yyvsp[-3].sval));
1585 g_free((yyvsp[-1].sval));
1586 g_free((yyvsp[0].sval));
1587 }
1588 #line 1589 "printrcy.c"
1589 break;
1590
1591 case 22: /* Double_Param: tWORD pDOUBLE tBOOLEAN tNUMBER */
1592 #line 295 "printrcy.y"
1593 {
1594 if (current_printer)
1595 {
1596 stp_set_float_parameter(current_printer->v, (yyvsp[-3].sval), (yyvsp[0].dval));
1597 if (strcmp((yyvsp[-1].sval), "False") == 0)
1598 stp_set_float_parameter_active(current_printer->v, (yyvsp[-3].sval),
1599 STP_PARAMETER_INACTIVE);
1600 else
1601 stp_set_float_parameter_active(current_printer->v, (yyvsp[-3].sval),
1602 STP_PARAMETER_ACTIVE);
1603 }
1604 g_free((yyvsp[-3].sval));
1605 g_free((yyvsp[-1].sval));
1606 }
1607 #line 1608 "printrcy.c"
1608 break;
1609
1610 case 23: /* Dimension_Param: tWORD pDIMENSION tBOOLEAN tNUMBER */
1611 #line 312 "printrcy.y"
1612 {
1613 if (current_printer)
1614 {
1615 stp_set_dimension_parameter(current_printer->v, (yyvsp[-3].sval), (yyvsp[0].dval));
1616 if (strcmp((yyvsp[-1].sval), "False") == 0)
1617 stp_set_dimension_parameter_active(current_printer->v, (yyvsp[-3].sval),
1618 STP_PARAMETER_INACTIVE);
1619 else
1620 stp_set_dimension_parameter_active(current_printer->v, (yyvsp[-3].sval),
1621 STP_PARAMETER_ACTIVE);
1622 }
1623 g_free((yyvsp[-3].sval));
1624 g_free((yyvsp[-1].sval));
1625 }
1626 #line 1627 "printrcy.c"
1627 break;
1628
1629 case 24: /* Boolean_Param: tWORD pBOOLEAN tBOOLEAN tBOOLEAN */
1630 #line 329 "printrcy.y"
1631 {
1632 if (current_printer)
1633 {
1634 if (strcmp((yyvsp[0].sval), "False") == 0)
1635 stp_set_boolean_parameter(current_printer->v, (yyvsp[-3].sval), 0);
1636 else
1637 stp_set_boolean_parameter(current_printer->v, (yyvsp[-3].sval), 1);
1638 if (strcmp((yyvsp[-1].sval), "False") == 0)
1639 stp_set_boolean_parameter_active(current_printer->v, (yyvsp[-3].sval),
1640 STP_PARAMETER_INACTIVE);
1641 else
1642 stp_set_boolean_parameter_active(current_printer->v, (yyvsp[-3].sval),
1643 STP_PARAMETER_ACTIVE);
1644 }
1645 g_free((yyvsp[-3].sval));
1646 g_free((yyvsp[-1].sval));
1647 g_free((yyvsp[0].sval));
1648 }
1649 #line 1650 "printrcy.c"
1650 break;
1651
1652 case 25: /* Curve_Param: tWORD pCURVE tBOOLEAN tSTRING */
1653 #line 350 "printrcy.y"
1654 {
1655 if (current_printer)
1656 {
1657 stp_curve_t *curve = stp_curve_create_from_string((yyvsp[0].sval));
1658 if (curve)
1659 {
1660 stp_set_curve_parameter(current_printer->v, (yyvsp[-3].sval), curve);
1661 if (strcmp((yyvsp[-1].sval), "False") == 0)
1662 stp_set_curve_parameter_active(current_printer->v, (yyvsp[-3].sval),
1663 STP_PARAMETER_INACTIVE);
1664 else
1665 stp_set_curve_parameter_active(current_printer->v, (yyvsp[-3].sval),
1666 STP_PARAMETER_ACTIVE);
1667 stp_curve_destroy(curve);
1668 }
1669 }
1670 g_free((yyvsp[-3].sval));
1671 g_free((yyvsp[-1].sval));
1672 g_free((yyvsp[0].sval));
1673 }
1674 #line 1675 "printrcy.c"
1675 break;
1676
1677 case 56: /* Current_Printer: CURRENT_PRINTER tSTRING */
1678 #line 398 "printrcy.y"
1679 { stpui_printrc_current_printer = (yyvsp[0].sval); }
1680 #line 1681 "printrcy.c"
1681 break;
1682
1683 case 57: /* Show_All_Paper_Sizes: SHOW_ALL_PAPER_SIZES tBOOLEAN */
1684 #line 402 "printrcy.y"
1685 {
1686 if (strcmp((yyvsp[0].sval), "True") == 0)
1687 stpui_show_all_paper_sizes = 1;
1688 else
1689 stpui_show_all_paper_sizes = 0;
1690 g_free((yyvsp[0].sval));
1691 }
1692 #line 1693 "printrcy.c"
1693 break;
1694
1695 case 61: /* New_Global_Setting: tWORD tSTRING */
1696 #line 418 "printrcy.y"
1697 {
1698 if ((yyvsp[0].sval))
1699 {
1700 stpui_set_global_parameter((yyvsp[-1].sval), (yyvsp[0].sval));
1701 g_free((yyvsp[0].sval));
1702 }
1703 g_free((yyvsp[-1].sval));
1704 }
1705 #line 1706 "printrcy.c"
1706 break;
1707
1708
1709 #line 1710 "printrcy.c"
1710
1711 default: break;
1712 }
1713 /* User semantic actions sometimes alter yychar, and that requires
1714 that yytoken be updated with the new translation. We take the
1715 approach of translating immediately before every use of yytoken.
1716 One alternative is translating here after every semantic action,
1717 but that translation would be missed if the semantic action invokes
1718 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
1719 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
1720 incorrect destructor might then be invoked immediately. In the
1721 case of YYERROR or YYBACKUP, subsequent parser actions might lead
1722 to an incorrect destructor call or verbose syntax error message
1723 before the lookahead is translated. */
1724 YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc);
1725
1726 YYPOPSTACK (yylen);
1727 yylen = 0;
1728
1729 *++yyvsp = yyval;
1730
1731 /* Now 'shift' the result of the reduction. Determine what state
1732 that goes to, based on the state we popped back to and the rule
1733 number reduced by. */
1734 {
1735 const int yylhs = yyr1[yyn] - YYNTOKENS;
1736 const int yyi = yypgoto[yylhs] + *yyssp;
1737 yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp
1738 ? yytable[yyi]
1739 : yydefgoto[yylhs]);
1740 }
1741
1742 goto yynewstate;
1743
1744
1745 /*--------------------------------------.
1746 | yyerrlab -- here on detecting error. |
1747 `--------------------------------------*/
1748 yyerrlab:
1749 /* Make sure we have latest lookahead translation. See comments at
1750 user semantic actions for why this is necessary. */
1751 yytoken = yychar == YYEMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar);
1752 /* If not already recovering from an error, report this error. */
1753 if (!yyerrstatus)
1754 {
1755 ++yynerrs;
1756 yyerror (YY_("syntax error"));
1757 }
1758
1759 if (yyerrstatus == 3)
1760 {
1761 /* If just tried and failed to reuse lookahead token after an
1762 error, discard it. */
1763
1764 if (yychar <= YYEOF)
1765 {
1766 /* Return failure if at end of input. */
1767 if (yychar == YYEOF)
1768 YYABORT;
1769 }
1770 else
1771 {
1772 yydestruct ("Error: discarding",
1773 yytoken, &yylval);
1774 yychar = YYEMPTY;
1775 }
1776 }
1777
1778 /* Else will try to reuse lookahead token after shifting the error
1779 token. */
1780 goto yyerrlab1;
1781
1782
1783 /*---------------------------------------------------.
1784 | yyerrorlab -- error raised explicitly by YYERROR. |
1785 `---------------------------------------------------*/
1786 yyerrorlab:
1787 /* Pacify compilers when the user code never invokes YYERROR and the
1788 label yyerrorlab therefore never appears in user code. */
1789 if (0)
1790 YYERROR;
1791 ++yynerrs;
1792
1793 /* Do not reclaim the symbols of the rule whose action triggered
1794 this YYERROR. */
1795 YYPOPSTACK (yylen);
1796 yylen = 0;
1797 YY_STACK_PRINT (yyss, yyssp);
1798 yystate = *yyssp;
1799 goto yyerrlab1;
1800
1801
1802 /*-------------------------------------------------------------.
1803 | yyerrlab1 -- common code for both syntax error and YYERROR. |
1804 `-------------------------------------------------------------*/
1805 yyerrlab1:
1806 yyerrstatus = 3; /* Each real token shifted decrements this. */
1807
1808 /* Pop stack until we find a state that shifts the error token. */
1809 for (;;)
1810 {
1811 yyn = yypact[yystate];
1812 if (!yypact_value_is_default (yyn))
1813 {
1814 yyn += YYSYMBOL_YYerror;
1815 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror)
1816 {
1817 yyn = yytable[yyn];
1818 if (0 < yyn)
1819 break;
1820 }
1821 }
1822
1823 /* Pop the current state because it cannot handle the error token. */
1824 if (yyssp == yyss)
1825 YYABORT;
1826
1827
1828 yydestruct ("Error: popping",
1829 YY_ACCESSING_SYMBOL (yystate), yyvsp);
1830 YYPOPSTACK (1);
1831 yystate = *yyssp;
1832 YY_STACK_PRINT (yyss, yyssp);
1833 }
1834
1835 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1836 *++yyvsp = yylval;
1837 YY_IGNORE_MAYBE_UNINITIALIZED_END
1838
1839
1840 /* Shift the error token. */
1841 YY_SYMBOL_PRINT ("Shifting", YY_ACCESSING_SYMBOL (yyn), yyvsp, yylsp);
1842
1843 yystate = yyn;
1844 goto yynewstate;
1845
1846
1847 /*-------------------------------------.
1848 | yyacceptlab -- YYACCEPT comes here. |
1849 `-------------------------------------*/
1850 yyacceptlab:
1851 yyresult = 0;
1852 goto yyreturnlab;
1853
1854
1855 /*-----------------------------------.
1856 | yyabortlab -- YYABORT comes here. |
1857 `-----------------------------------*/
1858 yyabortlab:
1859 yyresult = 1;
1860 goto yyreturnlab;
1861
1862
1863 /*-----------------------------------------------------------.
1864 | yyexhaustedlab -- YYNOMEM (memory exhaustion) comes here. |
1865 `-----------------------------------------------------------*/
1866 yyexhaustedlab:
1867 yyerror (YY_("memory exhausted"));
1868 yyresult = 2;
1869 goto yyreturnlab;
1870
1871
1872 /*----------------------------------------------------------.
1873 | yyreturnlab -- parsing is finished, clean up and return. |
1874 `----------------------------------------------------------*/
1875 yyreturnlab:
1876 if (yychar != YYEMPTY)
1877 {
1878 /* Make sure we have latest lookahead translation. See comments at
1879 user semantic actions for why this is necessary. */
1880 yytoken = YYTRANSLATE (yychar);
1881 yydestruct ("Cleanup: discarding lookahead",
1882 yytoken, &yylval);
1883 }
1884 /* Do not reclaim the symbols of the rule whose action triggered
1885 this YYABORT or YYACCEPT. */
1886 YYPOPSTACK (yylen);
1887 YY_STACK_PRINT (yyss, yyssp);
1888 while (yyssp != yyss)
1889 {
1890 yydestruct ("Cleanup: popping",
1891 YY_ACCESSING_SYMBOL (+*yyssp), yyvsp);
1892 YYPOPSTACK (1);
1893 }
1894 #ifndef yyoverflow
1895 if (yyss != yyssa)
1896 YYSTACK_FREE (yyss);
1897 #endif
1898
1899 return yyresult;
1900 }
1901
1902 #line 443 "printrcy.y"
1903