Debian Codegraph @

src/testpattern/testpatterny.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 "testpatterny.y"
71
72
73 #ifdef HAVE_CONFIG_H
74 #include <config.h>
75 #endif
76
77 #include <string.h>
78 #include <strings.h>
79 #include <stdio.h>
80 #include <stdlib.h>
81 #include "testpattern.h"
82
83 extern int mylineno;
84
85 extern int yylex(void);
86 char *quotestrip(const char *i);
87 char *endstrip(const char *i);
88
89 extern char* yytext;
90
91 static int yyerror( const char *s )
92 {
93 fprintf(stderr,"stdin:%d: %s before '%s'\n",mylineno,s,yytext);
94 return 0;
95 }
96
97 typedef struct
98 {
99 const char *name;
100 int channel;
101 } color_t;
102
103 static color_t color_map[] =
104 {
105 { "black", 0 },
106 { "cyan", 1 },
107 { "red", 1 },
108 { "magenta", 2 },
109 { "green", 2 },
110 { "yellow", 3 },
111 { "blue", 3 },
112 { "l_black", 4 },
113 { "l_cyan", 5 },
114 { "l_magenta", 6 },
115 { "d_yellow", 4 },
116 { "l_l_black", 7 },
117 { NULL, -1 }
118 };
119
120 static int current_index = 0;
121 static testpattern_t *current_testpattern;
122 extern FILE *yyin;
123
124 static int
125 find_color(const char *name)
126 {
127 int i = 0;
128 while (color_map[i].name)
129 {
130 if (strcasecmp(color_map[i].name, name) == 0)
131 return color_map[i].channel;
132 i++;
133 }
134 return -1;
135 }
136
137
138 #line 139 "testpatterny.c"
139
140 # ifndef YY_CAST
141 # ifdef __cplusplus
142 # define YY_CAST(Type, Val) static_cast<Type> (Val)
143 # define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast<Type> (Val)
144 # else
145 # define YY_CAST(Type, Val) ((Type) (Val))
146 # define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val))
147 # endif
148 # endif
149 # ifndef YY_NULLPTR
150 # if defined __cplusplus
151 # if 201103L <= __cplusplus
152 # define YY_NULLPTR nullptr
153 # else
154 # define YY_NULLPTR 0
155 # endif
156 # else
157 # define YY_NULLPTR ((void*)0)
158 # endif
159 # endif
160
161 /* Use api.header.include to #include this header
162 instead of duplicating it here. */
163 #ifndef YY_YY_TESTPATTERNY_H_INCLUDED
164 # define YY_YY_TESTPATTERNY_H_INCLUDED
165 /* Debug traces. */
166 #ifndef YYDEBUG
167 # define YYDEBUG 0
168 #endif
169 #if YYDEBUG
170 extern int yydebug;
171 #endif
172
173 /* Token kinds. */
174 #ifndef YYTOKENTYPE
175 # define YYTOKENTYPE
176 enum yytokentype
177 {
178 YYEMPTY = -2,
179 YYEOF = 0, /* "end of file" */
180 YYerror = 256, /* error */
181 YYUNDEF = 257, /* "invalid token" */
182 tINT = 258, /* tINT */
183 tDOUBLE = 259, /* tDOUBLE */
184 tSTRING = 260, /* tSTRING */
185 COLOR = 261, /* COLOR */
186 GAMMA = 262, /* GAMMA */
187 LEVEL = 263, /* LEVEL */
188 STEPS = 264, /* STEPS */
189 INK_LIMIT = 265, /* INK_LIMIT */
190 PRINTER = 266, /* PRINTER */
191 PARAMETER = 267, /* PARAMETER */
192 PARAMETER_INT = 268, /* PARAMETER_INT */
193 PARAMETER_BOOL = 269, /* PARAMETER_BOOL */
194 PARAMETER_FLOAT = 270, /* PARAMETER_FLOAT */
195 PARAMETER_CURVE = 271, /* PARAMETER_CURVE */
196 DENSITY = 272, /* DENSITY */
197 TOP = 273, /* TOP */
198 LEFT = 274, /* LEFT */
199 SIZE_MODE = 275, /* SIZE_MODE */
200 RELATIVE = 276, /* RELATIVE */
201 PT = 277, /* PT */
202 IN = 278, /* IN */
203 MM = 279, /* MM */
204 HSIZE = 280, /* HSIZE */
205 VSIZE = 281, /* VSIZE */
206 BLACKLINE = 282, /* BLACKLINE */
207 COLORLINE = 283, /* COLORLINE */
208 NOSCALE = 284, /* NOSCALE */
209 PATTERN = 285, /* PATTERN */
210 XPATTERN = 286, /* XPATTERN */
211 EXTENDED = 287, /* EXTENDED */
212 IMAGE = 288, /* IMAGE */
213 GRID = 289, /* GRID */
214 SEMI = 290, /* SEMI */
215 CHANNEL = 291, /* CHANNEL */
216 CMYK = 292, /* CMYK */
217 KCMY = 293, /* KCMY */
218 RGB = 294, /* RGB */
219 CMY = 295, /* CMY */
220 GRAY = 296, /* GRAY */
221 WHITE = 297, /* WHITE */
222 MODE = 298, /* MODE */
223 PAGESIZE = 299, /* PAGESIZE */
224 ROUND = 300, /* ROUND */
225 MESSAGE = 301, /* MESSAGE */
226 OUTPUT = 302, /* OUTPUT */
227 START_JOB = 303, /* START_JOB */
228 END_JOB = 304, /* END_JOB */
229 END = 305 /* END */
230 };
231 typedef enum yytokentype yytoken_kind_t;
232 #endif
233 /* Token kinds. */
234 #define YYEMPTY -2
235 #define YYEOF 0
236 #define YYerror 256
237 #define YYUNDEF 257
238 #define tINT 258
239 #define tDOUBLE 259
240 #define tSTRING 260
241 #define COLOR 261
242 #define GAMMA 262
243 #define LEVEL 263
244 #define STEPS 264
245 #define INK_LIMIT 265
246 #define PRINTER 266
247 #define PARAMETER 267
248 #define PARAMETER_INT 268
249 #define PARAMETER_BOOL 269
250 #define PARAMETER_FLOAT 270
251 #define PARAMETER_CURVE 271
252 #define DENSITY 272
253 #define TOP 273
254 #define LEFT 274
255 #define SIZE_MODE 275
256 #define RELATIVE 276
257 #define PT 277
258 #define IN 278
259 #define MM 279
260 #define HSIZE 280
261 #define VSIZE 281
262 #define BLACKLINE 282
263 #define COLORLINE 283
264 #define NOSCALE 284
265 #define PATTERN 285
266 #define XPATTERN 286
267 #define EXTENDED 287
268 #define IMAGE 288
269 #define GRID 289
270 #define SEMI 290
271 #define CHANNEL 291
272 #define CMYK 292
273 #define KCMY 293
274 #define RGB 294
275 #define CMY 295
276 #define GRAY 296
277 #define WHITE 297
278 #define MODE 298
279 #define PAGESIZE 299
280 #define ROUND 300
281 #define MESSAGE 301
282 #define OUTPUT 302
283 #define START_JOB 303
284 #define END_JOB 304
285 #define END 305
286
287 /* Value type. */
288
289
290 extern YYSTYPE yylval;
291
292
293 int yyparse (void);
294
295
296 #endif /* !YY_YY_TESTPATTERNY_H_INCLUDED */
297 /* Symbol kind. */
298 enum yysymbol_kind_t
299 {
300 YYSYMBOL_YYEMPTY = -2,
301 YYSYMBOL_YYEOF = 0, /* "end of file" */
302 YYSYMBOL_YYerror = 1, /* error */
303 YYSYMBOL_YYUNDEF = 2, /* "invalid token" */
304 YYSYMBOL_tINT = 3, /* tINT */
305 YYSYMBOL_tDOUBLE = 4, /* tDOUBLE */
306 YYSYMBOL_tSTRING = 5, /* tSTRING */
307 YYSYMBOL_COLOR = 6, /* COLOR */
308 YYSYMBOL_GAMMA = 7, /* GAMMA */
309 YYSYMBOL_LEVEL = 8, /* LEVEL */
310 YYSYMBOL_STEPS = 9, /* STEPS */
311 YYSYMBOL_INK_LIMIT = 10, /* INK_LIMIT */
312 YYSYMBOL_PRINTER = 11, /* PRINTER */
313 YYSYMBOL_PARAMETER = 12, /* PARAMETER */
314 YYSYMBOL_PARAMETER_INT = 13, /* PARAMETER_INT */
315 YYSYMBOL_PARAMETER_BOOL = 14, /* PARAMETER_BOOL */
316 YYSYMBOL_PARAMETER_FLOAT = 15, /* PARAMETER_FLOAT */
317 YYSYMBOL_PARAMETER_CURVE = 16, /* PARAMETER_CURVE */
318 YYSYMBOL_DENSITY = 17, /* DENSITY */
319 YYSYMBOL_TOP = 18, /* TOP */
320 YYSYMBOL_LEFT = 19, /* LEFT */
321 YYSYMBOL_SIZE_MODE = 20, /* SIZE_MODE */
322 YYSYMBOL_RELATIVE = 21, /* RELATIVE */
323 YYSYMBOL_PT = 22, /* PT */
324 YYSYMBOL_IN = 23, /* IN */
325 YYSYMBOL_MM = 24, /* MM */
326 YYSYMBOL_HSIZE = 25, /* HSIZE */
327 YYSYMBOL_VSIZE = 26, /* VSIZE */
328 YYSYMBOL_BLACKLINE = 27, /* BLACKLINE */
329 YYSYMBOL_COLORLINE = 28, /* COLORLINE */
330 YYSYMBOL_NOSCALE = 29, /* NOSCALE */
331 YYSYMBOL_PATTERN = 30, /* PATTERN */
332 YYSYMBOL_XPATTERN = 31, /* XPATTERN */
333 YYSYMBOL_EXTENDED = 32, /* EXTENDED */
334 YYSYMBOL_IMAGE = 33, /* IMAGE */
335 YYSYMBOL_GRID = 34, /* GRID */
336 YYSYMBOL_SEMI = 35, /* SEMI */
337 YYSYMBOL_CHANNEL = 36, /* CHANNEL */
338 YYSYMBOL_CMYK = 37, /* CMYK */
339 YYSYMBOL_KCMY = 38, /* KCMY */
340 YYSYMBOL_RGB = 39, /* RGB */
341 YYSYMBOL_CMY = 40, /* CMY */
342 YYSYMBOL_GRAY = 41, /* GRAY */
343 YYSYMBOL_WHITE = 42, /* WHITE */
344 YYSYMBOL_MODE = 43, /* MODE */
345 YYSYMBOL_PAGESIZE = 44, /* PAGESIZE */
346 YYSYMBOL_ROUND = 45, /* ROUND */
347 YYSYMBOL_MESSAGE = 46, /* MESSAGE */
348 YYSYMBOL_OUTPUT = 47, /* OUTPUT */
349 YYSYMBOL_START_JOB = 48, /* START_JOB */
350 YYSYMBOL_END_JOB = 49, /* END_JOB */
351 YYSYMBOL_END = 50, /* END */
352 YYSYMBOL_YYACCEPT = 51, /* $accept */
353 YYSYMBOL_NUMBER = 52, /* NUMBER */
354 YYSYMBOL_cmykspec = 53, /* cmykspec */
355 YYSYMBOL_kcmyspec = 54, /* kcmyspec */
356 YYSYMBOL_rgbspec = 55, /* rgbspec */
357 YYSYMBOL_cmyspec = 56, /* cmyspec */
358 YYSYMBOL_grayspec = 57, /* grayspec */
359 YYSYMBOL_whitespec = 58, /* whitespec */
360 YYSYMBOL_extendedspec = 59, /* extendedspec */
361 YYSYMBOL_modespec1 = 60, /* modespec1 */
362 YYSYMBOL_modespec2 = 61, /* modespec2 */
363 YYSYMBOL_modespec = 62, /* modespec */
364 YYSYMBOL_round = 63, /* round */
365 YYSYMBOL_inputspec = 64, /* inputspec */
366 YYSYMBOL_level = 65, /* level */
367 YYSYMBOL_channel_level = 66, /* channel_level */
368 YYSYMBOL_gamma = 67, /* gamma */
369 YYSYMBOL_channel_gamma = 68, /* channel_gamma */
370 YYSYMBOL_global_gamma = 69, /* global_gamma */
371 YYSYMBOL_steps = 70, /* steps */
372 YYSYMBOL_ink_limit = 71, /* ink_limit */
373 YYSYMBOL_printer = 72, /* printer */
374 YYSYMBOL_page_size_name = 73, /* page_size_name */
375 YYSYMBOL_page_size_custom = 74, /* page_size_custom */
376 YYSYMBOL_page_size = 75, /* page_size */
377 YYSYMBOL_parameter_string = 76, /* parameter_string */
378 YYSYMBOL_parameter_int = 77, /* parameter_int */
379 YYSYMBOL_parameter_bool = 78, /* parameter_bool */
380 YYSYMBOL_parameter_float = 79, /* parameter_float */
381 YYSYMBOL_parameter_curve = 80, /* parameter_curve */
382 YYSYMBOL_parameter = 81, /* parameter */
383 YYSYMBOL_density = 82, /* density */
384 YYSYMBOL_top = 83, /* top */
385 YYSYMBOL_left = 84, /* left */
386 YYSYMBOL_size_relative = 85, /* size_relative */
387 YYSYMBOL_size_in = 86, /* size_in */
388 YYSYMBOL_size_pt = 87, /* size_pt */
389 YYSYMBOL_size_mm = 88, /* size_mm */
390 YYSYMBOL_size_mode_1 = 89, /* size_mode_1 */
391 YYSYMBOL_size_mode = 90, /* size_mode */
392 YYSYMBOL_hsize = 91, /* hsize */
393 YYSYMBOL_vsize = 92, /* vsize */
394 YYSYMBOL_blackline = 93, /* blackline */
395 YYSYMBOL_colorline = 94, /* colorline */
396 YYSYMBOL_noscale = 95, /* noscale */
397 YYSYMBOL_color_block1 = 96, /* color_block1 */
398 YYSYMBOL_color_blocks1a = 97, /* color_blocks1a */
399 YYSYMBOL_color_blocks1b = 98, /* color_blocks1b */
400 YYSYMBOL_color_blocks1 = 99, /* color_blocks1 */
401 YYSYMBOL_color_block2a = 100, /* color_block2a */
402 YYSYMBOL_color_block2b = 101, /* color_block2b */
403 YYSYMBOL_color_block2 = 102, /* color_block2 */
404 YYSYMBOL_color_blocks2a = 103, /* color_blocks2a */
405 YYSYMBOL_color_blocks2 = 104, /* color_blocks2 */
406 YYSYMBOL_color_blocks = 105, /* color_blocks */
407 YYSYMBOL_patvars = 106, /* patvars */
408 YYSYMBOL_pattern = 107, /* pattern */
409 YYSYMBOL_xpattern = 108, /* xpattern */
410 YYSYMBOL_grid = 109, /* grid */
411 YYSYMBOL_image = 110, /* image */
412 YYSYMBOL_Message = 111, /* Message */
413 YYSYMBOL_Messages = 112, /* Messages */
414 YYSYMBOL_message = 113, /* message */
415 YYSYMBOL_Output0 = 114, /* Output0 */
416 YYSYMBOL_Output1 = 115, /* Output1 */
417 YYSYMBOL_output = 116, /* output */
418 YYSYMBOL_start_job = 117, /* start_job */
419 YYSYMBOL_end_job = 118, /* end_job */
420 YYSYMBOL_A_Rule = 119, /* A_Rule */
421 YYSYMBOL_Rule = 120, /* Rule */
422 YYSYMBOL_A_Pattern = 121, /* A_Pattern */
423 YYSYMBOL_Pattern = 122, /* Pattern */
424 YYSYMBOL_Patterns = 123, /* Patterns */
425 YYSYMBOL_Image = 124, /* Image */
426 YYSYMBOL_Rules = 125, /* Rules */
427 YYSYMBOL_Print = 126, /* Print */
428 YYSYMBOL_EOF = 127, /* EOF */
429 YYSYMBOL_Thing = 128, /* Thing */
430 YYSYMBOL_129_1 = 129 /* $@1 */
431 };
432 typedef enum yysymbol_kind_t yysymbol_kind_t;
433
434
435
436
437 #ifdef short
438 # undef short
439 #endif
440
441 /* On compilers that do not define __PTRDIFF_MAX__ etc., make sure
442 <limits.h> and (if available) <stdint.h> are included
443 so that the code can choose integer types of a good width. */
444
445 #ifndef __PTRDIFF_MAX__
446 # include <limits.h> /* INFRINGES ON USER NAME SPACE */
447 # if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
448 # include <stdint.h> /* INFRINGES ON USER NAME SPACE */
449 # define YY_STDINT_H
450 # endif
451 #endif
452
453 /* Narrow types that promote to a signed type and that can represent a
454 signed or unsigned integer of at least N bits. In tables they can
455 save space and decrease cache pressure. Promoting to a signed type
456 helps avoid bugs in integer arithmetic. */
457
458 #ifdef __INT_LEAST8_MAX__
459 typedef __INT_LEAST8_TYPE__ yytype_int8;
460 #elif defined YY_STDINT_H
461 typedef int_least8_t yytype_int8;
462 #else
463 typedef signed char yytype_int8;
464 #endif
465
466 #ifdef __INT_LEAST16_MAX__
467 typedef __INT_LEAST16_TYPE__ yytype_int16;
468 #elif defined YY_STDINT_H
469 typedef int_least16_t yytype_int16;
470 #else
471 typedef short yytype_int16;
472 #endif
473
474 /* Work around bug in HP-UX 11.23, which defines these macros
475 incorrectly for preprocessor constants. This workaround can likely
476 be removed in 2023, as HPE has promised support for HP-UX 11.23
477 (aka HP-UX 11i v2) only through the end of 2022; see Table 2 of
478 <https://h20195.www2.hpe.com/V2/getpdf.aspx/4AA4-7673ENW.pdf>. */
479 #ifdef __hpux
480 # undef UINT_LEAST8_MAX
481 # undef UINT_LEAST16_MAX
482 # define UINT_LEAST8_MAX 255
483 # define UINT_LEAST16_MAX 65535
484 #endif
485
486 #if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__
487 typedef __UINT_LEAST8_TYPE__ yytype_uint8;
488 #elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \
489 && UINT_LEAST8_MAX <= INT_MAX)
490 typedef uint_least8_t yytype_uint8;
491 #elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX
492 typedef unsigned char yytype_uint8;
493 #else
494 typedef short yytype_uint8;
495 #endif
496
497 #if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__
498 typedef __UINT_LEAST16_TYPE__ yytype_uint16;
499 #elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \
500 && UINT_LEAST16_MAX <= INT_MAX)
501 typedef uint_least16_t yytype_uint16;
502 #elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX
503 typedef unsigned short yytype_uint16;
504 #else
505 typedef int yytype_uint16;
506 #endif
507
508 #ifndef YYPTRDIFF_T
509 # if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__
510 # define YYPTRDIFF_T __PTRDIFF_TYPE__
511 # define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__
512 # elif defined PTRDIFF_MAX
513 # ifndef ptrdiff_t
514 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
515 # endif
516 # define YYPTRDIFF_T ptrdiff_t
517 # define YYPTRDIFF_MAXIMUM PTRDIFF_MAX
518 # else
519 # define YYPTRDIFF_T long
520 # define YYPTRDIFF_MAXIMUM LONG_MAX
521 # endif
522 #endif
523
524 #ifndef YYSIZE_T
525 # ifdef __SIZE_TYPE__
526 # define YYSIZE_T __SIZE_TYPE__
527 # elif defined size_t
528 # define YYSIZE_T size_t
529 # elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
530 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
531 # define YYSIZE_T size_t
532 # else
533 # define YYSIZE_T unsigned
534 # endif
535 #endif
536
537 #define YYSIZE_MAXIMUM \
538 YY_CAST (YYPTRDIFF_T, \
539 (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1) \
540 ? YYPTRDIFF_MAXIMUM \
541 : YY_CAST (YYSIZE_T, -1)))
542
543 #define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X))
544
545
546 /* Stored state numbers (used for stacks). */
547 typedef yytype_uint8 yy_state_t;
548
549 /* State numbers in computations. */
550 typedef int yy_state_fast_t;
551
552 #ifndef YY_
553 # if defined YYENABLE_NLS && YYENABLE_NLS
554 # if ENABLE_NLS
555 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
556 # define YY_(Msgid) dgettext ("bison-runtime", Msgid)
557 # endif
558 # endif
559 # ifndef YY_
560 # define YY_(Msgid) Msgid
561 # endif
562 #endif
563
564
565 #ifndef YY_ATTRIBUTE_PURE
566 # if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__)
567 # define YY_ATTRIBUTE_PURE __attribute__ ((__pure__))
568 # else
569 # define YY_ATTRIBUTE_PURE
570 # endif
571 #endif
572
573 #ifndef YY_ATTRIBUTE_UNUSED
574 # if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__)
575 # define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__))
576 # else
577 # define YY_ATTRIBUTE_UNUSED
578 # endif
579 #endif
580
581 /* Suppress unused-variable warnings by "using" E. */
582 #if ! defined lint || defined __GNUC__
583 # define YY_USE(E) ((void) (E))
584 #else
585 # define YY_USE(E) /* empty */
586 #endif
587
588 /* Suppress an incorrect diagnostic about yylval being uninitialized. */
589 #if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__
590 # if __GNUC__ * 100 + __GNUC_MINOR__ < 407
591 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
592 _Pragma ("GCC diagnostic push") \
593 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")
594 # else
595 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
596 _Pragma ("GCC diagnostic push") \
597 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \
598 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
599 # endif
600 # define YY_IGNORE_MAYBE_UNINITIALIZED_END \
601 _Pragma ("GCC diagnostic pop")
602 #else
603 # define YY_INITIAL_VALUE(Value) Value
604 #endif
605 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
606 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
607 # define YY_IGNORE_MAYBE_UNINITIALIZED_END
608 #endif
609 #ifndef YY_INITIAL_VALUE
610 # define YY_INITIAL_VALUE(Value) /* Nothing. */
611 #endif
612
613 #if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__
614 # define YY_IGNORE_USELESS_CAST_BEGIN \
615 _Pragma ("GCC diagnostic push") \
616 _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"")
617 # define YY_IGNORE_USELESS_CAST_END \
618 _Pragma ("GCC diagnostic pop")
619 #endif
620 #ifndef YY_IGNORE_USELESS_CAST_BEGIN
621 # define YY_IGNORE_USELESS_CAST_BEGIN
622 # define YY_IGNORE_USELESS_CAST_END
623 #endif
624
625
626 #define YY_ASSERT(E) ((void) (0 && (E)))
627
628 #if !defined yyoverflow
629
630 /* The parser invokes alloca or malloc; define the necessary symbols. */
631
632 # ifdef YYSTACK_USE_ALLOCA
633 # if YYSTACK_USE_ALLOCA
634 # ifdef __GNUC__
635 # define YYSTACK_ALLOC __builtin_alloca
636 # elif defined __BUILTIN_VA_ARG_INCR
637 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
638 # elif defined _AIX
639 # define YYSTACK_ALLOC __alloca
640 # elif defined _MSC_VER
641 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
642 # define alloca _alloca
643 # else
644 # define YYSTACK_ALLOC alloca
645 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
646 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
647 /* Use EXIT_SUCCESS as a witness for stdlib.h. */
648 # ifndef EXIT_SUCCESS
649 # define EXIT_SUCCESS 0
650 # endif
651 # endif
652 # endif
653 # endif
654 # endif
655
656 # ifdef YYSTACK_ALLOC
657 /* Pacify GCC's 'empty if-body' warning. */
658 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
659 # ifndef YYSTACK_ALLOC_MAXIMUM
660 /* The OS might guarantee only one guard page at the bottom of the stack,
661 and a page size can be as small as 4096 bytes. So we cannot safely
662 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
663 to allow for a few compiler-allocated temporary stack slots. */
664 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
665 # endif
666 # else
667 # define YYSTACK_ALLOC YYMALLOC
668 # define YYSTACK_FREE YYFREE
669 # ifndef YYSTACK_ALLOC_MAXIMUM
670 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
671 # endif
672 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
673 && ! ((defined YYMALLOC || defined malloc) \
674 && (defined YYFREE || defined free)))
675 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
676 # ifndef EXIT_SUCCESS
677 # define EXIT_SUCCESS 0
678 # endif
679 # endif
680 # ifndef YYMALLOC
681 # define YYMALLOC malloc
682 # if ! defined malloc && ! defined EXIT_SUCCESS
683 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
684 # endif
685 # endif
686 # ifndef YYFREE
687 # define YYFREE free
688 # if ! defined free && ! defined EXIT_SUCCESS
689 void free (void *); /* INFRINGES ON USER NAME SPACE */
690 # endif
691 # endif
692 # endif
693 #endif /* !defined yyoverflow */
694
695 #if (! defined yyoverflow \
696 && (! defined __cplusplus \
697 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
698
699 /* A type that is properly aligned for any stack member. */
700 union yyalloc
701 {
702 yy_state_t yyss_alloc;
703 YYSTYPE yyvs_alloc;
704 };
705
706 /* The size of the maximum gap between one aligned stack and the next. */
707 # define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1)
708
709 /* The size of an array large to enough to hold all stacks, each with
710 N elements. */
711 # define YYSTACK_BYTES(N) \
712 ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE)) \
713 + YYSTACK_GAP_MAXIMUM)
714
715 # define YYCOPY_NEEDED 1
716
717 /* Relocate STACK from its old location to the new one. The
718 local variables YYSIZE and YYSTACKSIZE give the old and new number of
719 elements in the stack, and YYPTR gives the new location of the
720 stack. Advance YYPTR to a properly aligned location for the next
721 stack. */
722 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
723 do \
724 { \
725 YYPTRDIFF_T yynewbytes; \
726 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
727 Stack = &yyptr->Stack_alloc; \
728 yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \
729 yyptr += yynewbytes / YYSIZEOF (*yyptr); \
730 } \
731 while (0)
732
733 #endif
734
735 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
736 /* Copy COUNT objects from SRC to DST. The source and destination do
737 not overlap. */
738 # ifndef YYCOPY
739 # if defined __GNUC__ && 1 < __GNUC__
740 # define YYCOPY(Dst, Src, Count) \
741 __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src)))
742 # else
743 # define YYCOPY(Dst, Src, Count) \
744 do \
745 { \
746 YYPTRDIFF_T yyi; \
747 for (yyi = 0; yyi < (Count); yyi++) \
748 (Dst)[yyi] = (Src)[yyi]; \
749 } \
750 while (0)
751 # endif
752 # endif
753 #endif /* !YYCOPY_NEEDED */
754
755 /* YYFINAL -- State number of the termination state. */
756 #define YYFINAL 66
757 /* YYLAST -- Last index in YYTABLE. */
758 #define YYLAST 182
759
760 /* YYNTOKENS -- Number of terminals. */
761 #define YYNTOKENS 51
762 /* YYNNTS -- Number of nonterminals. */
763 #define YYNNTS 79
764 /* YYNRULES -- Number of rules. */
765 #define YYNRULES 134
766 /* YYNSTATES -- Number of states. */
767 #define YYNSTATES 188
768
769 /* YYMAXUTOK -- Last valid token kind. */
770 #define YYMAXUTOK 305
771
772
773 /* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM
774 as returned by yylex, with out-of-bounds checking. */
775 #define YYTRANSLATE(YYX) \
776 (0 <= (YYX) && (YYX) <= YYMAXUTOK \
777 ? YY_CAST (yysymbol_kind_t, yytranslate[YYX]) \
778 : YYSYMBOL_YYUNDEF)
779
780 /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
781 as returned by yylex. */
782 static const yytype_int8 yytranslate[] =
783 {
784 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
785 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
786 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
787 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
788 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
789 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
790 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
791 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
792 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
793 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
794 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
795 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
796 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
797 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
798 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
799 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
800 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
801 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
802 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
803 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
804 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
805 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
806 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
807 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
808 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
809 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
810 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
811 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
812 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
813 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
814 45, 46, 47, 48, 49, 50
815 };
816
817 #if YYDEBUG
818 /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
819 static const yytype_int16 yyrline[] =
820 {
821 0, 145, 145, 145, 150, 160, 170, 180, 190, 200,
822 210, 220, 220, 220, 220, 220, 220, 220, 223, 231,
823 231, 234, 241, 244, 254, 263, 273, 282, 289, 296,
824 303, 312, 321, 330, 330, 333, 343, 352, 361, 370,
825 384, 384, 384, 384, 384, 386, 393, 400, 407, 414,
826 421, 428, 435, 435, 435, 435, 437, 439, 446, 453,
827 461, 469, 477, 492, 492, 495, 495, 498, 501, 515,
828 528, 528, 531, 531, 534, 534, 537, 537, 540, 555,
829 558, 573, 584, 601, 608, 608, 611, 614, 624, 630,
830 630, 633, 637, 641, 641, 641, 641, 641, 641, 642,
831 642, 642, 642, 642, 642, 642, 643, 643, 643, 643,
832 643, 643, 644, 644, 644, 644, 644, 644, 647, 651,
833 651, 651, 651, 654, 658, 658, 661, 665, 665, 668,
834 668, 671, 671, 676, 675
835 };
836 #endif
837
838 /** Accessing symbol of state STATE. */
839 #define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State])
840
841 #if YYDEBUG || 0
842 /* The user-facing name of the symbol whose (internal) number is
843 YYSYMBOL. No bounds checking. */
844 static const char *yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED;
845
846 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
847 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
848 static const char *const yytname[] =
849 {
850 "\"end of file\"", "error", "\"invalid token\"", "tINT", "tDOUBLE",
851 "tSTRING", "COLOR", "GAMMA", "LEVEL", "STEPS", "INK_LIMIT", "PRINTER",
852 "PARAMETER", "PARAMETER_INT", "PARAMETER_BOOL", "PARAMETER_FLOAT",
853 "PARAMETER_CURVE", "DENSITY", "TOP", "LEFT", "SIZE_MODE", "RELATIVE",
854 "PT", "IN", "MM", "HSIZE", "VSIZE", "BLACKLINE", "COLORLINE", "NOSCALE",
855 "PATTERN", "XPATTERN", "EXTENDED", "IMAGE", "GRID", "SEMI", "CHANNEL",
856 "CMYK", "KCMY", "RGB", "CMY", "GRAY", "WHITE", "MODE", "PAGESIZE",
857 "ROUND", "MESSAGE", "OUTPUT", "START_JOB", "END_JOB", "END", "$accept",
858 "NUMBER", "cmykspec", "kcmyspec", "rgbspec", "cmyspec", "grayspec",
859 "whitespec", "extendedspec", "modespec1", "modespec2", "modespec",
860 "round", "inputspec", "level", "channel_level", "gamma", "channel_gamma",
861 "global_gamma", "steps", "ink_limit", "printer", "page_size_name",
862 "page_size_custom", "page_size", "parameter_string", "parameter_int",
863 "parameter_bool", "parameter_float", "parameter_curve", "parameter",
864 "density", "top", "left", "size_relative", "size_in", "size_pt",
865 "size_mm", "size_mode_1", "size_mode", "hsize", "vsize", "blackline",
866 "colorline", "noscale", "color_block1", "color_blocks1a",
867 "color_blocks1b", "color_blocks1", "color_block2a", "color_block2b",
868 "color_block2", "color_blocks2a", "color_blocks2", "color_blocks",
869 "patvars", "pattern", "xpattern", "grid", "image", "Message", "Messages",
870 "message", "Output0", "Output1", "output", "start_job", "end_job",
871 "A_Rule", "Rule", "A_Pattern", "Pattern", "Patterns", "Image", "Rules",
872 "Print", "EOF", "Thing", "$@1", YY_NULLPTR
873 };
874
875 static const char *
876 yysymbol_name (yysymbol_kind_t yysymbol)
877 {
878 return yytname[yysymbol];
879 }
880 #endif
881
882 #define YYPACT_NINF (-146)
883
884 #define yypact_value_is_default(Yyn) \
885 ((Yyn) == YYPACT_NINF)
886
887 #define YYTABLE_NINF (-1)
888
889 #define yytable_value_is_error(Yyn) \
890 0
891
892 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
893 STATE-NUM. */
894 static const yytype_int16 yypact[] =
895 {
896 -146, 9, 4, 57, -1, 5, 29, 36, 40, 41,
897 62, 71, 73, 29, 29, 29, 27, 29, 29, 59,
898 76, 77, 33, 37, -146, -146, 78, -146, -146, -146,
899 -146, -146, -146, -146, -146, -146, -146, -146, -146, -146,
900 -146, -146, -146, -146, -146, -146, -146, -146, -146, -146,
901 -146, -146, -146, -146, -146, -146, -146, -146, -146, -146,
902 -146, -146, -146, 46, -146, 49, -146, 29, -146, 29,
903 -146, 29, 29, -146, -146, -146, -146, 79, 82, 83,
904 29, 84, -146, -146, -146, -146, -146, -146, -146, -146,
905 -146, -146, -146, -146, -146, -146, -146, -146, -146, 85,
906 -146, -146, -146, -146, -146, -146, -146, -146, -146, -146,
907 -146, -146, -146, 87, -146, -146, 88, -146, 89, -146,
908 -146, 90, -146, 13, -146, 42, -146, -146, -146, -146,
909 -146, -146, -146, -146, -146, -146, -146, -146, -146, -146,
910 92, 29, 3, 93, -146, -146, -146, -146, 52, -146,
911 63, -146, -146, 29, 3, 29, 94, 29, 29, -146,
912 -146, -146, -146, -5, -146, -146, -146, -146, -146, 29,
913 -146, 29, 29, 29, -146, 29, -146, -146, 29, 29,
914 29, -146, -146, 29, -146, 29, -146, -146
915 };
916
917 /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
918 Performed when YYTABLE does not specify something else to do. Zero
919 means the default is an error. */
920 static const yytype_uint8 yydefact[] =
921 {
922 127, 133, 0, 0, 0, 0, 0, 0, 0, 0,
923 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
924 0, 0, 0, 0, 21, 84, 87, 91, 92, 116,
925 109, 95, 96, 93, 94, 97, 98, 99, 100, 33,
926 34, 110, 40, 41, 44, 42, 43, 101, 102, 103,
927 104, 115, 105, 106, 107, 117, 108, 111, 89, 90,
928 112, 113, 114, 0, 128, 124, 1, 3, 2, 0,
929 27, 0, 0, 28, 3, 29, 30, 0, 0, 0,
930 0, 0, 45, 46, 47, 48, 50, 49, 51, 52,
931 54, 53, 55, 56, 57, 58, 59, 60, 61, 0,
932 4, 5, 6, 7, 8, 9, 11, 12, 13, 14,
933 15, 16, 17, 19, 20, 22, 0, 31, 86, 88,
934 118, 0, 126, 129, 130, 131, 26, 25, 24, 23,
935 35, 36, 37, 38, 39, 10, 18, 32, 83, 85,
936 0, 0, 74, 0, 119, 120, 121, 122, 0, 125,
937 0, 134, 82, 0, 74, 0, 0, 0, 65, 76,
938 70, 71, 72, 75, 77, 80, 81, 123, 132, 0,
939 79, 0, 0, 0, 63, 66, 67, 73, 0, 0,
940 0, 62, 64, 0, 68, 0, 78, 69
941 };
942
943 /* YYPGOTO[NTERM-NUM]. */
944 static const yytype_int16 yypgoto[] =
945 {
946 -146, -3, -146, -146, -146, -146, -146, -146, -146, -146,
947 -146, -146, -146, -146, -146, -146, -146, -146, -146, -146,
948 -146, -146, -146, -146, -146, -146, -146, -146, -146, -146,
949 -146, -146, -146, -146, -146, -146, -146, -146, -146, -146,
950 -146, -146, -146, -146, -146, -145, -146, -146, -146, -146,
951 -146, -64, -146, -146, -54, -146, -146, -146, -146, -146,
952 -146, -146, -22, -146, -146, -146, -146, -146, -146, -146,
953 -146, -146, -146, -146, -146, -146, -146, -146, -146
954 };
955
956 /* YYDEFGOTO[NTERM-NUM]. */
957 static const yytype_uint8 yydefgoto[] =
958 {
959 0, 157, 106, 107, 108, 109, 110, 111, 112, 113,
960 114, 115, 29, 30, 31, 32, 33, 34, 35, 36,
961 37, 38, 39, 40, 41, 42, 43, 44, 45, 46,
962 47, 48, 49, 50, 89, 90, 91, 92, 93, 51,
963 52, 53, 54, 55, 56, 158, 175, 176, 159, 160,
964 161, 162, 163, 164, 165, 154, 144, 145, 146, 122,
965 139, 118, 57, 58, 59, 60, 61, 62, 63, 64,
966 148, 149, 123, 124, 1, 125, 151, 2, 65
967 };
968
969 /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
970 positive, shift that token. If negative, reduce the rule whose
971 number is the opposite. If YYTABLE_NINF, syntax error. */
972 static const yytype_uint8 yytable[] =
973 {
974 70, 155, 71, 75, 66, 72, 74, 68, 73, 155,
975 82, 83, 84, 174, 94, 95, 3, 4, 5, 6,
976 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
977 182, 156, 74, 68, 17, 18, 19, 20, 21, 156,
978 116, 76, 117, 141, 142, 77, 78, 143, 85, 86,
979 87, 88, 22, 23, 24, 25, 26, 27, 28, 25,
980 67, 68, 96, 69, 126, 99, 127, 79, 128, 129,
981 100, 101, 102, 103, 104, 105, 80, 133, 81, 97,
982 98, 120, 121, 119, 130, 131, 132, 167, 135, 134,
983 136, 137, 150, 140, 138, 152, 166, 172, 168, 177,
984 170, 147, 0, 0, 0, 0, 0, 0, 0, 0,
985 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
986 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
987 0, 0, 0, 0, 0, 0, 0, 0, 153, 0,
988 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
989 169, 0, 171, 0, 173, 0, 0, 0, 0, 0,
990 0, 0, 0, 0, 0, 0, 178, 0, 179, 180,
991 181, 0, 0, 0, 0, 183, 184, 185, 0, 0,
992 186, 0, 187
993 };
994
995 static const yytype_int16 yycheck[] =
996 {
997 3, 6, 3, 6, 0, 6, 3, 4, 3, 6,
998 13, 14, 15, 158, 17, 18, 7, 8, 9, 10,
999 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
1000 175, 36, 3, 4, 25, 26, 27, 28, 29, 36,
1001 3, 5, 5, 30, 31, 5, 5, 34, 21, 22,
1002 23, 24, 43, 44, 45, 46, 47, 48, 49, 46,
1003 3, 4, 3, 6, 67, 32, 69, 5, 71, 72,
1004 37, 38, 39, 40, 41, 42, 5, 80, 5, 3,
1005 3, 35, 33, 5, 5, 3, 3, 35, 3, 5,
1006 3, 3, 50, 3, 5, 3, 3, 3, 35, 163,
1007 154, 123, -1, -1, -1, -1, -1, -1, -1, -1,
1008 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1009 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1010 -1, -1, -1, -1, -1, -1, -1, -1, 141, -1,
1011 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1012 153, -1, 155, -1, 157, -1, -1, -1, -1, -1,
1013 -1, -1, -1, -1, -1, -1, 169, -1, 171, 172,
1014 173, -1, -1, -1, -1, 178, 179, 180, -1, -1,
1015 183, -1, 185
1016 };
1017
1018 /* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of
1019 state STATE-NUM. */
1020 static const yytype_uint8 yystos[] =
1021 {
1022 0, 125, 128, 7, 8, 9, 10, 11, 12, 13,
1023 14, 15, 16, 17, 18, 19, 20, 25, 26, 27,
1024 28, 29, 43, 44, 45, 46, 47, 48, 49, 63,
1025 64, 65, 66, 67, 68, 69, 70, 71, 72, 73,
1026 74, 75, 76, 77, 78, 79, 80, 81, 82, 83,
1027 84, 90, 91, 92, 93, 94, 95, 113, 114, 115,
1028 116, 117, 118, 119, 120, 129, 0, 3, 4, 6,
1029 52, 3, 6, 3, 3, 52, 5, 5, 5, 5,
1030 5, 5, 52, 52, 52, 21, 22, 23, 24, 85,
1031 86, 87, 88, 89, 52, 52, 3, 3, 3, 32,
1032 37, 38, 39, 40, 41, 42, 53, 54, 55, 56,
1033 57, 58, 59, 60, 61, 62, 3, 5, 112, 5,
1034 35, 33, 110, 123, 124, 126, 52, 52, 52, 52,
1035 5, 3, 3, 52, 5, 3, 3, 3, 5, 111,
1036 3, 30, 31, 34, 107, 108, 109, 113, 121, 122,
1037 50, 127, 3, 52, 106, 6, 36, 52, 96, 99,
1038 100, 101, 102, 103, 104, 105, 3, 35, 35, 52,
1039 105, 52, 3, 52, 96, 97, 98, 102, 52, 52,
1040 52, 52, 96, 52, 52, 52, 52, 52
1041 };
1042
1043 /* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. */
1044 static const yytype_uint8 yyr1[] =
1045 {
1046 0, 51, 52, 52, 53, 54, 55, 56, 57, 58,
1047 59, 60, 60, 60, 60, 60, 60, 60, 61, 62,
1048 62, 63, 64, 65, 66, 67, 68, 69, 70, 71,
1049 72, 73, 74, 75, 75, 76, 77, 78, 79, 80,
1050 81, 81, 81, 81, 81, 82, 83, 84, 85, 86,
1051 87, 88, 89, 89, 89, 89, 90, 91, 92, 93,
1052 94, 95, 96, 97, 97, 98, 98, 99, 100, 101,
1053 102, 102, 103, 103, 104, 104, 105, 105, 106, 107,
1054 108, 109, 110, 111, 112, 112, 113, 114, 115, 116,
1055 116, 117, 118, 119, 119, 119, 119, 119, 119, 119,
1056 119, 119, 119, 119, 119, 119, 119, 119, 119, 119,
1057 119, 119, 119, 119, 119, 119, 119, 119, 120, 121,
1058 121, 121, 121, 122, 123, 123, 124, 125, 125, 126,
1059 126, 127, 127, 129, 128
1060 };
1061
1062 /* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. */
1063 static const yytype_int8 yyr2[] =
1064 {
1065 0, 2, 1, 1, 1, 1, 1, 1, 1, 1,
1066 2, 1, 1, 1, 1, 1, 1, 1, 2, 1,
1067 1, 1, 2, 3, 3, 3, 3, 2, 2, 2,
1068 2, 2, 3, 1, 1, 3, 3, 3, 3, 3,
1069 1, 1, 1, 1, 1, 2, 2, 2, 1, 1,
1070 1, 1, 1, 1, 1, 1, 2, 2, 2, 2,
1071 2, 2, 3, 1, 2, 0, 1, 2, 4, 5,
1072 1, 1, 1, 2, 0, 1, 1, 1, 5, 3,
1073 2, 2, 3, 1, 0, 2, 2, 1, 2, 1,
1074 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1075 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1076 1, 1, 1, 1, 1, 1, 1, 1, 2, 1,
1077 1, 1, 1, 2, 0, 2, 1, 0, 2, 1,
1078 1, 0, 2, 0, 4
1079 };
1080
1081
1082 enum { YYENOMEM = -2 };
1083
1084 #define yyerrok (yyerrstatus = 0)
1085 #define yyclearin (yychar = YYEMPTY)
1086
1087 #define YYACCEPT goto yyacceptlab
1088 #define YYABORT goto yyabortlab
1089 #define YYERROR goto yyerrorlab
1090 #define YYNOMEM goto yyexhaustedlab
1091
1092
1093 #define YYRECOVERING() (!!yyerrstatus)
1094
1095 #define YYBACKUP(Token, Value) \
1096 do \
1097 if (yychar == YYEMPTY) \
1098 { \
1099 yychar = (Token); \
1100 yylval = (Value); \
1101 YYPOPSTACK (yylen); \
1102 yystate = *yyssp; \
1103 goto yybackup; \
1104 } \
1105 else \
1106 { \
1107 yyerror (YY_("syntax error: cannot back up")); \
1108 YYERROR; \
1109 } \
1110 while (0)
1111
1112 /* Backward compatibility with an undocumented macro.
1113 Use YYerror or YYUNDEF. */
1114 #define YYERRCODE YYUNDEF
1115
1116
1117 /* Enable debugging if requested. */
1118 #if YYDEBUG
1119
1120 # ifndef YYFPRINTF
1121 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1122 # define YYFPRINTF fprintf
1123 # endif
1124
1125 # define YYDPRINTF(Args) \
1126 do { \
1127 if (yydebug) \
1128 YYFPRINTF Args; \
1129 } while (0)
1130
1131
1132
1133
1134 # define YY_SYMBOL_PRINT(Title, Kind, Value, Location) \
1135 do { \
1136 if (yydebug) \
1137 { \
1138 YYFPRINTF (stderr, "%s ", Title); \
1139 yy_symbol_print (stderr, \
1140 Kind, Value); \
1141 YYFPRINTF (stderr, "\n"); \
1142 } \
1143 } while (0)
1144
1145
1146 /*-----------------------------------.
1147 | Print this symbol's value on YYO. |
1148 `-----------------------------------*/
1149
1150 static void
1151 yy_symbol_value_print (FILE *yyo,
1152 yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep)
1153 {
1154 FILE *yyoutput = yyo;
1155 YY_USE (yyoutput);
1156 if (!yyvaluep)
1157 return;
1158 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1159 YY_USE (yykind);
1160 YY_IGNORE_MAYBE_UNINITIALIZED_END
1161 }
1162
1163
1164 /*---------------------------.
1165 | Print this symbol on YYO. |
1166 `---------------------------*/
1167
1168 static void
1169 yy_symbol_print (FILE *yyo,
1170 yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep)
1171 {
1172 YYFPRINTF (yyo, "%s %s (",
1173 yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind));
1174
1175 yy_symbol_value_print (yyo, yykind, yyvaluep);
1176 YYFPRINTF (yyo, ")");
1177 }
1178
1179 /*------------------------------------------------------------------.
1180 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1181 | TOP (included). |
1182 `------------------------------------------------------------------*/
1183
1184 static void
1185 yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop)
1186 {
1187 YYFPRINTF (stderr, "Stack now");
1188 for (; yybottom <= yytop; yybottom++)
1189 {
1190 int yybot = *yybottom;
1191 YYFPRINTF (stderr, " %d", yybot);
1192 }
1193 YYFPRINTF (stderr, "\n");
1194 }
1195
1196 # define YY_STACK_PRINT(Bottom, Top) \
1197 do { \
1198 if (yydebug) \
1199 yy_stack_print ((Bottom), (Top)); \
1200 } while (0)
1201
1202
1203 /*------------------------------------------------.
1204 | Report that the YYRULE is going to be reduced. |
1205 `------------------------------------------------*/
1206
1207 static void
1208 yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp,
1209 int yyrule)
1210 {
1211 int yylno = yyrline[yyrule];
1212 int yynrhs = yyr2[yyrule];
1213 int yyi;
1214 YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n",
1215 yyrule - 1, yylno);
1216 /* The symbols being reduced. */
1217 for (yyi = 0; yyi < yynrhs; yyi++)
1218 {
1219 YYFPRINTF (stderr, " $%d = ", yyi + 1);
1220 yy_symbol_print (stderr,
1221 YY_ACCESSING_SYMBOL (+yyssp[yyi + 1 - yynrhs]),
1222 &yyvsp[(yyi + 1) - (yynrhs)]);
1223 YYFPRINTF (stderr, "\n");
1224 }
1225 }
1226
1227 # define YY_REDUCE_PRINT(Rule) \
1228 do { \
1229 if (yydebug) \
1230 yy_reduce_print (yyssp, yyvsp, Rule); \
1231 } while (0)
1232
1233 /* Nonzero means print parse trace. It is left uninitialized so that
1234 multiple parsers can coexist. */
1235 int yydebug;
1236 #else /* !YYDEBUG */
1237 # define YYDPRINTF(Args) ((void) 0)
1238 # define YY_SYMBOL_PRINT(Title, Kind, Value, Location)
1239 # define YY_STACK_PRINT(Bottom, Top)
1240 # define YY_REDUCE_PRINT(Rule)
1241 #endif /* !YYDEBUG */
1242
1243
1244 /* YYINITDEPTH -- initial size of the parser's stacks. */
1245 #ifndef YYINITDEPTH
1246 # define YYINITDEPTH 200
1247 #endif
1248
1249 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1250 if the built-in stack extension method is used).
1251
1252 Do not make this value too large; the results are undefined if
1253 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1254 evaluated with infinite-precision integer arithmetic. */
1255
1256 #ifndef YYMAXDEPTH
1257 # define YYMAXDEPTH 10000
1258 #endif
1259
1260
1261
1262
1263
1264
1265 /*-----------------------------------------------.
1266 | Release the memory associated to this symbol. |
1267 `-----------------------------------------------*/
1268
1269 static void
1270 yydestruct (const char *yymsg,
1271 yysymbol_kind_t yykind, YYSTYPE *yyvaluep)
1272 {
1273 YY_USE (yyvaluep);
1274 if (!yymsg)
1275 yymsg = "Deleting";
1276 YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp);
1277
1278 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1279 YY_USE (yykind);
1280 YY_IGNORE_MAYBE_UNINITIALIZED_END
1281 }
1282
1283
1284 /* Lookahead token kind. */
1285 int yychar;
1286
1287 /* The semantic value of the lookahead symbol. */
1288 YYSTYPE yylval;
1289 /* Number of syntax errors so far. */
1290 int yynerrs;
1291
1292
1293
1294
1295 /*----------.
1296 | yyparse. |
1297 `----------*/
1298
1299 int
1300 yyparse (void)
1301 {
1302 yy_state_fast_t yystate = 0;
1303 /* Number of tokens to shift before error messages enabled. */
1304 int yyerrstatus = 0;
1305
1306 /* Refer to the stacks through separate pointers, to allow yyoverflow
1307 to reallocate them elsewhere. */
1308
1309 /* Their size. */
1310 YYPTRDIFF_T yystacksize = YYINITDEPTH;
1311
1312 /* The state stack: array, bottom, top. */
1313 yy_state_t yyssa[YYINITDEPTH];
1314 yy_state_t *yyss = yyssa;
1315 yy_state_t *yyssp = yyss;
1316
1317 /* The semantic value stack: array, bottom, top. */
1318 YYSTYPE yyvsa[YYINITDEPTH];
1319 YYSTYPE *yyvs = yyvsa;
1320 YYSTYPE *yyvsp = yyvs;
1321
1322 int yyn;
1323 /* The return value of yyparse. */
1324 int yyresult;
1325 /* Lookahead symbol kind. */
1326 yysymbol_kind_t yytoken = YYSYMBOL_YYEMPTY;
1327 /* The variables used to return semantic value and location from the
1328 action routines. */
1329 YYSTYPE yyval;
1330
1331
1332
1333 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1334
1335 /* The number of symbols on the RHS of the reduced rule.
1336 Keep to zero when no symbol should be popped. */
1337 int yylen = 0;
1338
1339 YYDPRINTF ((stderr, "Starting parse\n"));
1340
1341 yychar = YYEMPTY; /* Cause a token to be read. */
1342
1343 goto yysetstate;
1344
1345
1346 /*------------------------------------------------------------.
1347 | yynewstate -- push a new state, which is found in yystate. |
1348 `------------------------------------------------------------*/
1349 yynewstate:
1350 /* In all cases, when you get here, the value and location stacks
1351 have just been pushed. So pushing a state here evens the stacks. */
1352 yyssp++;
1353
1354
1355 /*--------------------------------------------------------------------.
1356 | yysetstate -- set current state (the top of the stack) to yystate. |
1357 `--------------------------------------------------------------------*/
1358 yysetstate:
1359 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1360 YY_ASSERT (0 <= yystate && yystate < YYNSTATES);
1361 YY_IGNORE_USELESS_CAST_BEGIN
1362 *yyssp = YY_CAST (yy_state_t, yystate);
1363 YY_IGNORE_USELESS_CAST_END
1364 YY_STACK_PRINT (yyss, yyssp);
1365
1366 if (yyss + yystacksize - 1 <= yyssp)
1367 #if !defined yyoverflow && !defined YYSTACK_RELOCATE
1368 YYNOMEM;
1369 #else
1370 {
1371 /* Get the current used size of the three stacks, in elements. */
1372 YYPTRDIFF_T yysize = yyssp - yyss + 1;
1373
1374 # if defined yyoverflow
1375 {
1376 /* Give user a chance to reallocate the stack. Use copies of
1377 these so that the &'s don't force the real ones into
1378 memory. */
1379 yy_state_t *yyss1 = yyss;
1380 YYSTYPE *yyvs1 = yyvs;
1381
1382 /* Each stack pointer address is followed by the size of the
1383 data in use in that stack, in bytes. This used to be a
1384 conditional around just the two extra args, but that might
1385 be undefined if yyoverflow is a macro. */
1386 yyoverflow (YY_("memory exhausted"),
1387 &yyss1, yysize * YYSIZEOF (*yyssp),
1388 &yyvs1, yysize * YYSIZEOF (*yyvsp),
1389 &yystacksize);
1390 yyss = yyss1;
1391 yyvs = yyvs1;
1392 }
1393 # else /* defined YYSTACK_RELOCATE */
1394 /* Extend the stack our own way. */
1395 if (YYMAXDEPTH <= yystacksize)
1396 YYNOMEM;
1397 yystacksize *= 2;
1398 if (YYMAXDEPTH < yystacksize)
1399 yystacksize = YYMAXDEPTH;
1400
1401 {
1402 yy_state_t *yyss1 = yyss;
1403 union yyalloc *yyptr =
1404 YY_CAST (union yyalloc *,
1405 YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize))));
1406 if (! yyptr)
1407 YYNOMEM;
1408 YYSTACK_RELOCATE (yyss_alloc, yyss);
1409 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1410 # undef YYSTACK_RELOCATE
1411 if (yyss1 != yyssa)
1412 YYSTACK_FREE (yyss1);
1413 }
1414 # endif
1415
1416 yyssp = yyss + yysize - 1;
1417 yyvsp = yyvs + yysize - 1;
1418
1419 YY_IGNORE_USELESS_CAST_BEGIN
1420 YYDPRINTF ((stderr, "Stack size increased to %ld\n",
1421 YY_CAST (long, yystacksize)));
1422 YY_IGNORE_USELESS_CAST_END
1423
1424 if (yyss + yystacksize - 1 <= yyssp)
1425 YYABORT;
1426 }
1427 #endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */
1428
1429
1430 if (yystate == YYFINAL)
1431 YYACCEPT;
1432
1433 goto yybackup;
1434
1435
1436 /*-----------.
1437 | yybackup. |
1438 `-----------*/
1439 yybackup:
1440 /* Do appropriate processing given the current state. Read a
1441 lookahead token if we need one and don't already have one. */
1442
1443 /* First try to decide what to do without reference to lookahead token. */
1444 yyn = yypact[yystate];
1445 if (yypact_value_is_default (yyn))
1446 goto yydefault;
1447
1448 /* Not known => get a lookahead token if don't already have one. */
1449
1450 /* YYCHAR is either empty, or end-of-input, or a valid lookahead. */
1451 if (yychar == YYEMPTY)
1452 {
1453 YYDPRINTF ((stderr, "Reading a token\n"));
1454 yychar = yylex ();
1455 }
1456
1457 if (yychar <= YYEOF)
1458 {
1459 yychar = YYEOF;
1460 yytoken = YYSYMBOL_YYEOF;
1461 YYDPRINTF ((stderr, "Now at end of input.\n"));
1462 }
1463 else if (yychar == YYerror)
1464 {
1465 /* The scanner already issued an error message, process directly
1466 to error recovery. But do not keep the error token as
1467 lookahead, it is too special and may lead us to an endless
1468 loop in error recovery. */
1469 yychar = YYUNDEF;
1470 yytoken = YYSYMBOL_YYerror;
1471 goto yyerrlab1;
1472 }
1473 else
1474 {
1475 yytoken = YYTRANSLATE (yychar);
1476 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1477 }
1478
1479 /* If the proper action on seeing token YYTOKEN is to reduce or to
1480 detect an error, take that action. */
1481 yyn += yytoken;
1482 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1483 goto yydefault;
1484 yyn = yytable[yyn];
1485 if (yyn <= 0)
1486 {
1487 if (yytable_value_is_error (yyn))
1488 goto yyerrlab;
1489 yyn = -yyn;
1490 goto yyreduce;
1491 }
1492
1493 /* Count tokens shifted since error; after three, turn off error
1494 status. */
1495 if (yyerrstatus)
1496 yyerrstatus--;
1497
1498 /* Shift the lookahead token. */
1499 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1500 yystate = yyn;
1501 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1502 *++yyvsp = yylval;
1503 YY_IGNORE_MAYBE_UNINITIALIZED_END
1504
1505 /* Discard the shifted token. */
1506 yychar = YYEMPTY;
1507 goto yynewstate;
1508
1509
1510 /*-----------------------------------------------------------.
1511 | yydefault -- do the default action for the current state. |
1512 `-----------------------------------------------------------*/
1513 yydefault:
1514 yyn = yydefact[yystate];
1515 if (yyn == 0)
1516 goto yyerrlab;
1517 goto yyreduce;
1518
1519
1520 /*-----------------------------.
1521 | yyreduce -- do a reduction. |
1522 `-----------------------------*/
1523 yyreduce:
1524 /* yyn is the number of a rule to reduce with. */
1525 yylen = yyr2[yyn];
1526
1527 /* If YYLEN is nonzero, implement the default value of the action:
1528 '$$ = $1'.
1529
1530 Otherwise, the following line sets YYVAL to garbage.
1531 This behavior is undocumented and Bison
1532 users should not rely upon it. Assigning to YYVAL
1533 unconditionally makes the parser a bit smaller, and it avoids a
1534 GCC warning that YYVAL may be used uninitialized. */
1535 yyval = yyvsp[1-yylen];
1536
1537
1538 YY_REDUCE_PRINT (yyn);
1539 switch (yyn)
1540 {
1541 case 3: /* NUMBER: tINT */
1542 #line 146 "testpatterny.y"
1543 {
1544 }
1545 #line 1546 "testpatterny.c"
1546 break;
1547
1548 case 4: /* cmykspec: CMYK */
1549 #line 151 "testpatterny.y"
1550 {
1551 if (getenv("STP_TESTPATTERN_DEBUG"))
1552 fprintf(stderr, ">>>cmykspec\n");
1553 global_image_type = "CMYK";
1554 global_channel_depth = 4;
1555 global_invert_data = 0;
1556 }
1557 #line 1558 "testpatterny.c"
1558 break;
1559
1560 case 5: /* kcmyspec: KCMY */
1561 #line 161 "testpatterny.y"
1562 {
1563 if (getenv("STP_TESTPATTERN_DEBUG"))
1564 fprintf(stderr, ">>>kcmyspec\n");
1565 global_image_type = "KCMY";
1566 global_channel_depth = 4;
1567 global_invert_data = 0;
1568 }
1569 #line 1570 "testpatterny.c"
1570 break;
1571
1572 case 6: /* rgbspec: RGB */
1573 #line 171 "testpatterny.y"
1574 {
1575 if (getenv("STP_TESTPATTERN_DEBUG"))
1576 fprintf(stderr, ">>>rgbspec\n");
1577 global_image_type = "RGB";
1578 global_channel_depth = 3;
1579 global_invert_data = 1;
1580 }
1581 #line 1582 "testpatterny.c"
1582 break;
1583
1584 case 7: /* cmyspec: CMY */
1585 #line 181 "testpatterny.y"
1586 {
1587 if (getenv("STP_TESTPATTERN_DEBUG"))
1588 fprintf(stderr, ">>>cmyspec\n");
1589 global_image_type = "CMY";
1590 global_channel_depth = 3;
1591 global_invert_data = 0;
1592 }
1593 #line 1594 "testpatterny.c"
1594 break;
1595
1596 case 8: /* grayspec: GRAY */
1597 #line 191 "testpatterny.y"
1598 {
1599 if (getenv("STP_TESTPATTERN_DEBUG"))
1600 fprintf(stderr, ">>>grayspec\n");
1601 global_image_type = "Grayscale";
1602 global_channel_depth = 1;
1603 global_invert_data = 0;
1604 }
1605 #line 1606 "testpatterny.c"
1606 break;
1607
1608 case 9: /* whitespec: WHITE */
1609 #line 201 "testpatterny.y"
1610 {
1611 if (getenv("STP_TESTPATTERN_DEBUG"))
1612 fprintf(stderr, ">>>whitespec\n");
1613 global_image_type = "Whitescale";
1614 global_channel_depth = 1;
1615 global_invert_data = 1;
1616 }
1617 #line 1618 "testpatterny.c"
1618 break;
1619
1620 case 10: /* extendedspec: EXTENDED tINT */
1621 #line 211 "testpatterny.y"
1622 {
1623 if (getenv("STP_TESTPATTERN_DEBUG"))
1624 fprintf(stderr, ">>>extendedspec %d\n", (yyvsp[0].ival));
1625 global_image_type = "Raw";
1626 global_invert_data = 0;
1627 global_channel_depth = (yyvsp[0].ival);
1628 }
1629 #line 1630 "testpatterny.c"
1630 break;
1631
1632 case 18: /* modespec2: modespec1 tINT */
1633 #line 224 "testpatterny.y"
1634 {
1635 if (getenv("STP_TESTPATTERN_DEBUG"))
1636 fprintf(stderr, ">>>modespec2 %d\n", (yyvsp[0].ival));
1637 if ((yyvsp[0].ival) == 8 || (yyvsp[0].ival) == 16)
1638 global_bit_depth = (yyvsp[0].ival);
1639 }
1640 #line 1641 "testpatterny.c"
1641 break;
1642
1643 case 21: /* round: ROUND */
1644 #line 235 "testpatterny.y"
1645 {
1646 if (getenv("STP_TESTPATTERN_DEBUG"))
1647 fprintf(stderr, ">>>round\n");
1648 global_round_size = 1;
1649 }
1650 #line 1651 "testpatterny.c"
1651 break;
1652
1653 case 23: /* level: LEVEL COLOR NUMBER */
1654 #line 245 "testpatterny.y"
1655 {
1656 int channel = find_color((yyvsp[-1].sval));
1657 if (getenv("STP_TESTPATTERN_DEBUG"))
1658 fprintf(stderr, ">>>level %s %f\n", (yyvsp[-1].sval), (yyvsp[0].dval));
1659 if (channel >= 0)
1660 global_levels[channel] = (yyvsp[0].dval);
1661 }
1662 #line 1663 "testpatterny.c"
1663 break;
1664
1665 case 24: /* channel_level: LEVEL tINT NUMBER */
1666 #line 255 "testpatterny.y"
1667 {
1668 if (getenv("STP_TESTPATTERN_DEBUG"))
1669 fprintf(stderr, ">>>channel_level %d %f\n", (yyvsp[-1].ival), (yyvsp[0].dval));
1670 if ((yyvsp[-1].ival) >= 0 && (yyvsp[-1].ival) <= STP_CHANNEL_LIMIT)
1671 global_levels[(yyvsp[-1].ival)] = (yyvsp[0].dval);
1672 }
1673 #line 1674 "testpatterny.c"
1674 break;
1675
1676 case 25: /* gamma: GAMMA COLOR NUMBER */
1677 #line 264 "testpatterny.y"
1678 {
1679 int channel = find_color((yyvsp[-1].sval));
1680 if (getenv("STP_TESTPATTERN_DEBUG"))
1681 fprintf(stderr, ">>>gamma %s %f\n", (yyvsp[-1].sval), (yyvsp[0].dval));
1682 if (channel >= 0)
1683 global_gammas[channel] = (yyvsp[0].dval);
1684 }
1685 #line 1686 "testpatterny.c"
1686 break;
1687
1688 case 26: /* channel_gamma: GAMMA tINT NUMBER */
1689 #line 274 "testpatterny.y"
1690 {
1691 if (getenv("STP_TESTPATTERN_DEBUG"))
1692 fprintf(stderr, ">>>channel_gamma %d %f\n", (yyvsp[-1].ival), (yyvsp[0].dval));
1693 if ((yyvsp[-1].ival) >= 0 && (yyvsp[-1].ival) <= STP_CHANNEL_LIMIT)
1694 global_gammas[(yyvsp[-1].ival)] = (yyvsp[0].dval);
1695 }
1696 #line 1697 "testpatterny.c"
1697 break;
1698
1699 case 27: /* global_gamma: GAMMA NUMBER */
1700 #line 283 "testpatterny.y"
1701 {
1702 if (getenv("STP_TESTPATTERN_DEBUG"))
1703 fprintf(stderr, ">>>global_gamma %f\n", (yyvsp[0].dval));
1704 global_gamma = (yyvsp[0].dval);
1705 }
1706 #line 1707 "testpatterny.c"
1707 break;
1708
1709 case 28: /* steps: STEPS tINT */
1710 #line 290 "testpatterny.y"
1711 {
1712 if (getenv("STP_TESTPATTERN_DEBUG"))
1713 fprintf(stderr, ">>>steps %d\n", (yyvsp[0].ival));
1714 global_steps = (yyvsp[0].ival);
1715 }
1716 #line 1717 "testpatterny.c"
1717 break;
1718
1719 case 29: /* ink_limit: INK_LIMIT NUMBER */
1720 #line 297 "testpatterny.y"
1721 {
1722 if (getenv("STP_TESTPATTERN_DEBUG"))
1723 fprintf(stderr, ">>>ink_limit %f\n", (yyvsp[0].dval));
1724 global_ink_limit = (yyvsp[0].dval);
1725 }
1726 #line 1727 "testpatterny.c"
1727 break;
1728
1729 case 30: /* printer: PRINTER tSTRING */
1730 #line 304 "testpatterny.y"
1731 {
1732 if (getenv("STP_TESTPATTERN_DEBUG"))
1733 fprintf(stderr, ">>>printer %s\n", (yyvsp[0].sval));
1734 global_printer = stp_strdup((yyvsp[0].sval));
1735 free((yyvsp[0].sval));
1736 }
1737 #line 1738 "testpatterny.c"
1738 break;
1739
1740 case 31: /* page_size_name: PAGESIZE tSTRING */
1741 #line 313 "testpatterny.y"
1742 {
1743 if (getenv("STP_TESTPATTERN_DEBUG"))
1744 fprintf(stderr, ">>>page_size_name %s\n", (yyvsp[0].sval));
1745 stp_set_string_parameter(global_vars, "PageSize", (yyvsp[0].sval));
1746 free((yyvsp[0].sval));
1747 }
1748 #line 1749 "testpatterny.c"
1749 break;
1750
1751 case 32: /* page_size_custom: PAGESIZE tINT tINT */
1752 #line 322 "testpatterny.y"
1753 {
1754 if (getenv("STP_TESTPATTERN_DEBUG"))
1755 fprintf(stderr, ">>>page_size_custom %d %d\n", (yyvsp[-1].ival), (yyvsp[0].ival));
1756 stp_set_page_width(global_vars, (yyvsp[-1].ival));
1757 stp_set_page_height(global_vars, (yyvsp[0].ival));
1758 }
1759 #line 1760 "testpatterny.c"
1760 break;
1761
1762 case 35: /* parameter_string: PARAMETER tSTRING tSTRING */
1763 #line 334 "testpatterny.y"
1764 {
1765 if (getenv("STP_TESTPATTERN_DEBUG"))
1766 fprintf(stderr, ">>>parameter_string %s %s\n", (yyvsp[-1].sval), (yyvsp[0].sval));
1767 stp_set_string_parameter(global_vars, (yyvsp[-1].sval), (yyvsp[0].sval));
1768 free((yyvsp[-1].sval));
1769 free((yyvsp[0].sval));
1770 }
1771 #line 1772 "testpatterny.c"
1772 break;
1773
1774 case 36: /* parameter_int: PARAMETER_INT tSTRING tINT */
1775 #line 344 "testpatterny.y"
1776 {
1777 if (getenv("STP_TESTPATTERN_DEBUG"))
1778 fprintf(stderr, ">>>parameter_int %s %d\n", (yyvsp[-1].sval), (yyvsp[0].ival));
1779 stp_set_int_parameter(global_vars, (yyvsp[-1].sval), (yyvsp[0].ival));
1780 free((yyvsp[-1].sval));
1781 }
1782 #line 1783 "testpatterny.c"
1783 break;
1784
1785 case 37: /* parameter_bool: PARAMETER_BOOL tSTRING tINT */
1786 #line 353 "testpatterny.y"
1787 {
1788 if (getenv("STP_TESTPATTERN_DEBUG"))
1789 fprintf(stderr, ">>>parameter_bool %s %d\n", (yyvsp[-1].sval), (yyvsp[0].ival));
1790 stp_set_boolean_parameter(global_vars, (yyvsp[-1].sval), (yyvsp[0].ival));
1791 free((yyvsp[-1].sval));
1792 }
1793 #line 1794 "testpatterny.c"
1794 break;
1795
1796 case 38: /* parameter_float: PARAMETER_FLOAT tSTRING NUMBER */
1797 #line 362 "testpatterny.y"
1798 {
1799 if (getenv("STP_TESTPATTERN_DEBUG"))
1800 fprintf(stderr, ">>>parameter_float %s %f\n", (yyvsp[-1].sval), (yyvsp[0].dval));
1801 stp_set_float_parameter(global_vars, (yyvsp[-1].sval), (yyvsp[0].dval));
1802 free((yyvsp[-1].sval));
1803 }
1804 #line 1805 "testpatterny.c"
1805 break;
1806
1807 case 39: /* parameter_curve: PARAMETER_CURVE tSTRING tSTRING */
1808 #line 371 "testpatterny.y"
1809 {
1810 stp_curve_t *curve = stp_curve_create_from_string((yyvsp[0].sval));
1811 if (getenv("STP_TESTPATTERN_DEBUG"))
1812 fprintf(stderr, ">>>parameter_curve %s %s\n", (yyvsp[-1].sval), (yyvsp[0].sval));
1813 if (curve)
1814 {
1815 stp_set_curve_parameter(global_vars, (yyvsp[-1].sval), curve);
1816 stp_curve_destroy(curve);
1817 }
1818 free((yyvsp[-1].sval));
1819 }
1820 #line 1821 "testpatterny.c"
1821 break;
1822
1823 case 45: /* density: DENSITY NUMBER */
1824 #line 387 "testpatterny.y"
1825 {
1826 if (getenv("STP_TESTPATTERN_DEBUG"))
1827 fprintf(stderr, ">>>density %f\n", (yyvsp[0].dval));
1828 global_density = (yyvsp[0].dval);
1829 }
1830 #line 1831 "testpatterny.c"
1831 break;
1832
1833 case 46: /* top: TOP NUMBER */
1834 #line 394 "testpatterny.y"
1835 {
1836 if (getenv("STP_TESTPATTERN_DEBUG"))
1837 fprintf(stderr, ">>>top %f\n", (yyvsp[0].dval));
1838 global_xtop = (yyvsp[0].dval);
1839 }
1840 #line 1841 "testpatterny.c"
1841 break;
1842
1843 case 47: /* left: LEFT NUMBER */
1844 #line 401 "testpatterny.y"
1845 {
1846 if (getenv("STP_TESTPATTERN_DEBUG"))
1847 fprintf(stderr, ">>>left %f\n", (yyvsp[0].dval));
1848 global_xleft = (yyvsp[0].dval);
1849 }
1850 #line 1851 "testpatterny.c"
1851 break;
1852
1853 case 48: /* size_relative: RELATIVE */
1854 #line 408 "testpatterny.y"
1855 {
1856 if (getenv("STP_TESTPATTERN_DEBUG"))
1857 fprintf(stderr, ">>>relative size\n");
1858 global_size_mode = SIZE_RELATIVE;
1859 }
1860 #line 1861 "testpatterny.c"
1861 break;
1862
1863 case 49: /* size_in: IN */
1864 #line 415 "testpatterny.y"
1865 {
1866 if (getenv("STP_TESTPATTERN_DEBUG"))
1867 fprintf(stderr, ">>>size inches\n");
1868 global_size_mode = SIZE_IN;
1869 }
1870 #line 1871 "testpatterny.c"
1871 break;
1872
1873 case 50: /* size_pt: PT */
1874 #line 422 "testpatterny.y"
1875 {
1876 if (getenv("STP_TESTPATTERN_DEBUG"))
1877 fprintf(stderr, ">>>size pt\n");
1878 global_size_mode = SIZE_PT;
1879 }
1880 #line 1881 "testpatterny.c"
1881 break;
1882
1883 case 51: /* size_mm: MM */
1884 #line 429 "testpatterny.y"
1885 {
1886 if (getenv("STP_TESTPATTERN_DEBUG"))
1887 fprintf(stderr, ">>>size mm\n");
1888 global_size_mode = SIZE_MM;
1889 }
1890 #line 1891 "testpatterny.c"
1891 break;
1892
1893 case 57: /* hsize: HSIZE NUMBER */
1894 #line 440 "testpatterny.y"
1895 {
1896 if (getenv("STP_TESTPATTERN_DEBUG"))
1897 fprintf(stderr, ">>>hsize %f\n", (yyvsp[0].dval));
1898 global_hsize = (yyvsp[0].dval);
1899 }
1900 #line 1901 "testpatterny.c"
1901 break;
1902
1903 case 58: /* vsize: VSIZE NUMBER */
1904 #line 447 "testpatterny.y"
1905 {
1906 if (getenv("STP_TESTPATTERN_DEBUG"))
1907 fprintf(stderr, ">>>vsize %f\n", (yyvsp[0].dval));
1908 global_vsize = (yyvsp[0].dval);
1909 }
1910 #line 1911 "testpatterny.c"
1911 break;
1912
1913 case 59: /* blackline: BLACKLINE tINT */
1914 #line 454 "testpatterny.y"
1915 {
1916 if (getenv("STP_TESTPATTERN_DEBUG"))
1917 fprintf(stderr, ">>>blackline %d\n", (yyvsp[0].ival));
1918 global_noblackline = !((yyvsp[0].ival));
1919 }
1920 #line 1921 "testpatterny.c"
1921 break;
1922
1923 case 60: /* colorline: COLORLINE tINT */
1924 #line 462 "testpatterny.y"
1925 {
1926 if (getenv("STP_TESTPATTERN_DEBUG"))
1927 fprintf(stderr, ">>>colorline %d\n", (yyvsp[0].ival));
1928 global_colorline = ((yyvsp[0].ival) != 0);
1929 }
1930 #line 1931 "testpatterny.c"
1931 break;
1932
1933 case 61: /* noscale: NOSCALE tINT */
1934 #line 470 "testpatterny.y"
1935 {
1936 if (getenv("STP_TESTPATTERN_DEBUG"))
1937 fprintf(stderr, ">>>noscale %d\n", (yyvsp[0].ival));
1938 global_noscale = (yyvsp[0].ival);
1939 }
1940 #line 1941 "testpatterny.c"
1941 break;
1942
1943 case 62: /* color_block1: NUMBER NUMBER NUMBER */
1944 #line 478 "testpatterny.y"
1945 {
1946 if (getenv("STP_TESTPATTERN_DEBUG"))
1947 fprintf(stderr, ">>>color_block1 %f %f %f (%d)\n", (yyvsp[-2].dval), (yyvsp[-1].dval), (yyvsp[0].dval),
1948 current_index);
1949 if (current_index < STP_CHANNEL_LIMIT)
1950 {
1951 current_testpattern->d.pattern.mins[current_index] = (yyvsp[-2].dval);
1952 current_testpattern->d.pattern.vals[current_index] = (yyvsp[-1].dval);
1953 current_testpattern->d.pattern.gammas[current_index] = (yyvsp[0].dval);
1954 current_index++;
1955 }
1956 }
1957 #line 1958 "testpatterny.c"
1958 break;
1959
1960 case 68: /* color_block2a: COLOR NUMBER NUMBER NUMBER */
1961 #line 502 "testpatterny.y"
1962 {
1963 int channel = find_color((yyvsp[-3].sval));
1964 if (getenv("STP_TESTPATTERN_DEBUG"))
1965 fprintf(stderr, ">>>color_block2a %s %f %f %f\n", (yyvsp[-3].sval), (yyvsp[-2].dval), (yyvsp[-1].dval), (yyvsp[0].dval));
1966 if (channel >= 0 && channel < STP_CHANNEL_LIMIT)
1967 {
1968 current_testpattern->d.pattern.mins[channel] = (yyvsp[-2].dval);
1969 current_testpattern->d.pattern.vals[channel] = (yyvsp[-1].dval);
1970 current_testpattern->d.pattern.gammas[channel] = (yyvsp[0].dval);
1971 }
1972 }
1973 #line 1974 "testpatterny.c"
1974 break;
1975
1976 case 69: /* color_block2b: CHANNEL tINT NUMBER NUMBER NUMBER */
1977 #line 516 "testpatterny.y"
1978 {
1979 if (getenv("STP_TESTPATTERN_DEBUG"))
1980 fprintf(stderr, ">>>color_block2b %d %f %f %f\n", (yyvsp[-3].ival), (yyvsp[-2].dval), (yyvsp[-1].dval), (yyvsp[0].dval));
1981 if ((yyvsp[-3].ival) >= 0 && (yyvsp[-3].ival) < STP_CHANNEL_LIMIT)
1982 {
1983 current_testpattern->d.pattern.mins[(yyvsp[-3].ival)] = (yyvsp[-2].dval);
1984 current_testpattern->d.pattern.vals[(yyvsp[-3].ival)] = (yyvsp[-1].dval);
1985 current_testpattern->d.pattern.gammas[(yyvsp[-3].ival)] = (yyvsp[0].dval);
1986 }
1987 }
1988 #line 1989 "testpatterny.c"
1989 break;
1990
1991 case 78: /* patvars: NUMBER NUMBER NUMBER NUMBER NUMBER */
1992 #line 541 "testpatterny.y"
1993 {
1994 if (getenv("STP_TESTPATTERN_DEBUG"))
1995 fprintf(stderr, ">>>patvars %f %f %f %f %f\n", (yyvsp[-4].dval), (yyvsp[-3].dval), (yyvsp[-2].dval), (yyvsp[-1].dval), (yyvsp[0].dval));
1996 current_testpattern->type = E_PATTERN;
1997 current_testpattern->d.pattern.lower = (yyvsp[-4].dval);
1998 current_testpattern->d.pattern.upper = (yyvsp[-3].dval);
1999 current_testpattern->d.pattern.levels[1] = (yyvsp[-2].dval);
2000 current_testpattern->d.pattern.levels[2] = (yyvsp[-1].dval);
2001 current_testpattern->d.pattern.levels[3] = (yyvsp[0].dval);
2002 current_testpattern = get_next_testpattern();
2003 current_index = 0;
2004 }
2005 #line 2006 "testpatterny.c"
2006 break;
2007
2008 case 80: /* xpattern: XPATTERN color_blocks */
2009 #line 559 "testpatterny.y"
2010 {
2011 if (getenv("STP_TESTPATTERN_DEBUG"))
2012 fprintf(stderr, ">>>xpattern\n");
2013 if (global_channel_depth == 0)
2014 {
2015 fprintf(stderr, "xpattern may only be used with extended color depth\n");
2016 exit(1);
2017 }
2018 current_testpattern->type = E_XPATTERN;
2019 current_testpattern = get_next_testpattern();
2020 current_index = 0;
2021 }
2022 #line 2023 "testpatterny.c"
2023 break;
2024
2025 case 81: /* grid: GRID tINT */
2026 #line 574 "testpatterny.y"
2027 {
2028 if (getenv("STP_TESTPATTERN_DEBUG"))
2029 fprintf(stderr, ">>>grid %d\n", (yyvsp[0].ival));
2030 current_testpattern->type = E_GRID;
2031 current_testpattern->d.grid.ticks = (yyvsp[0].ival);
2032 current_testpattern = get_next_testpattern();
2033 current_index = 0;
2034 }
2035 #line 2036 "testpatterny.c"
2036 break;
2037
2038 case 82: /* image: IMAGE tINT tINT */
2039 #line 585 "testpatterny.y"
2040 {
2041 if (getenv("STP_TESTPATTERN_DEBUG"))
2042 fprintf(stderr, ">>>image %d %d\n", (yyvsp[-1].ival), (yyvsp[0].ival));
2043 current_testpattern->type = E_IMAGE;
2044 current_testpattern->d.image.x = (yyvsp[-1].ival);
2045 current_testpattern->d.image.y = (yyvsp[0].ival);
2046 if (current_testpattern->d.image.x <= 0 ||
2047 current_testpattern->d.image.y <= 0)
2048 {
2049 fprintf(stderr, "image width and height must be greater than zero\n");
2050 exit(1);
2051 }
2052 return 0;
2053 }
2054 #line 2055 "testpatterny.c"
2055 break;
2056
2057 case 83: /* Message: tSTRING */
2058 #line 602 "testpatterny.y"
2059 {
2060 fprintf(stderr,"%s",(yyvsp[0].sval));
2061 free((yyvsp[0].sval));
2062 }
2063 #line 2064 "testpatterny.c"
2064 break;
2065
2066 case 87: /* Output0: OUTPUT */
2067 #line 615 "testpatterny.y"
2068 {
2069 close_output();
2070 if (global_output)
2071 free(global_output);
2072 global_output = NULL;
2073 output = stdout;
2074 }
2075 #line 2076 "testpatterny.c"
2076 break;
2077
2078 case 88: /* Output1: OUTPUT tSTRING */
2079 #line 625 "testpatterny.y"
2080 {
2081 global_output = (yyvsp[0].sval);
2082 }
2083 #line 2084 "testpatterny.c"
2084 break;
2085
2086 case 91: /* start_job: START_JOB */
2087 #line 634 "testpatterny.y"
2088 { start_job = 1; }
2089 #line 2090 "testpatterny.c"
2090 break;
2091
2092 case 92: /* end_job: END_JOB */
2093 #line 638 "testpatterny.y"
2094 { end_job = 1; }
2095 #line 2096 "testpatterny.c"
2096 break;
2097
2098 case 118: /* Rule: A_Rule SEMI */
2099 #line 648 "testpatterny.y"
2100 { global_did_something = 1; }
2101 #line 2102 "testpatterny.c"
2102 break;
2103
2104 case 123: /* Pattern: A_Pattern SEMI */
2105 #line 655 "testpatterny.y"
2106 { global_did_something = 1; }
2107 #line 2108 "testpatterny.c"
2108 break;
2109
2110 case 126: /* Image: image */
2111 #line 662 "testpatterny.y"
2112 { global_did_something = 1; }
2113 #line 2114 "testpatterny.c"
2114 break;
2115
2116 case 132: /* EOF: END SEMI */
2117 #line 672 "testpatterny.y"
2118 { return 0; }
2119 #line 2120 "testpatterny.c"
2120 break;
2121
2122 case 133: /* $@1: %empty */
2123 #line 676 "testpatterny.y"
2124 {
2125 current_testpattern = get_next_testpattern();
2126 }
2127 #line 2128 "testpatterny.c"
2128 break;
2129
2130
2131 #line 2132 "testpatterny.c"
2132
2133 default: break;
2134 }
2135 /* User semantic actions sometimes alter yychar, and that requires
2136 that yytoken be updated with the new translation. We take the
2137 approach of translating immediately before every use of yytoken.
2138 One alternative is translating here after every semantic action,
2139 but that translation would be missed if the semantic action invokes
2140 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
2141 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
2142 incorrect destructor might then be invoked immediately. In the
2143 case of YYERROR or YYBACKUP, subsequent parser actions might lead
2144 to an incorrect destructor call or verbose syntax error message
2145 before the lookahead is translated. */
2146 YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc);
2147
2148 YYPOPSTACK (yylen);
2149 yylen = 0;
2150
2151 *++yyvsp = yyval;
2152
2153 /* Now 'shift' the result of the reduction. Determine what state
2154 that goes to, based on the state we popped back to and the rule
2155 number reduced by. */
2156 {
2157 const int yylhs = yyr1[yyn] - YYNTOKENS;
2158 const int yyi = yypgoto[yylhs] + *yyssp;
2159 yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp
2160 ? yytable[yyi]
2161 : yydefgoto[yylhs]);
2162 }
2163
2164 goto yynewstate;
2165
2166
2167 /*--------------------------------------.
2168 | yyerrlab -- here on detecting error. |
2169 `--------------------------------------*/
2170 yyerrlab:
2171 /* Make sure we have latest lookahead translation. See comments at
2172 user semantic actions for why this is necessary. */
2173 yytoken = yychar == YYEMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar);
2174 /* If not already recovering from an error, report this error. */
2175 if (!yyerrstatus)
2176 {
2177 ++yynerrs;
2178 yyerror (YY_("syntax error"));
2179 }
2180
2181 if (yyerrstatus == 3)
2182 {
2183 /* If just tried and failed to reuse lookahead token after an
2184 error, discard it. */
2185
2186 if (yychar <= YYEOF)
2187 {
2188 /* Return failure if at end of input. */
2189 if (yychar == YYEOF)
2190 YYABORT;
2191 }
2192 else
2193 {
2194 yydestruct ("Error: discarding",
2195 yytoken, &yylval);
2196 yychar = YYEMPTY;
2197 }
2198 }
2199
2200 /* Else will try to reuse lookahead token after shifting the error
2201 token. */
2202 goto yyerrlab1;
2203
2204
2205 /*---------------------------------------------------.
2206 | yyerrorlab -- error raised explicitly by YYERROR. |
2207 `---------------------------------------------------*/
2208 yyerrorlab:
2209 /* Pacify compilers when the user code never invokes YYERROR and the
2210 label yyerrorlab therefore never appears in user code. */
2211 if (0)
2212 YYERROR;
2213 ++yynerrs;
2214
2215 /* Do not reclaim the symbols of the rule whose action triggered
2216 this YYERROR. */
2217 YYPOPSTACK (yylen);
2218 yylen = 0;
2219 YY_STACK_PRINT (yyss, yyssp);
2220 yystate = *yyssp;
2221 goto yyerrlab1;
2222
2223
2224 /*-------------------------------------------------------------.
2225 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2226 `-------------------------------------------------------------*/
2227 yyerrlab1:
2228 yyerrstatus = 3; /* Each real token shifted decrements this. */
2229
2230 /* Pop stack until we find a state that shifts the error token. */
2231 for (;;)
2232 {
2233 yyn = yypact[yystate];
2234 if (!yypact_value_is_default (yyn))
2235 {
2236 yyn += YYSYMBOL_YYerror;
2237 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror)
2238 {
2239 yyn = yytable[yyn];
2240 if (0 < yyn)
2241 break;
2242 }
2243 }
2244
2245 /* Pop the current state because it cannot handle the error token. */
2246 if (yyssp == yyss)
2247 YYABORT;
2248
2249
2250 yydestruct ("Error: popping",
2251 YY_ACCESSING_SYMBOL (yystate), yyvsp);
2252 YYPOPSTACK (1);
2253 yystate = *yyssp;
2254 YY_STACK_PRINT (yyss, yyssp);
2255 }
2256
2257 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
2258 *++yyvsp = yylval;
2259 YY_IGNORE_MAYBE_UNINITIALIZED_END
2260
2261
2262 /* Shift the error token. */
2263 YY_SYMBOL_PRINT ("Shifting", YY_ACCESSING_SYMBOL (yyn), yyvsp, yylsp);
2264
2265 yystate = yyn;
2266 goto yynewstate;
2267
2268
2269 /*-------------------------------------.
2270 | yyacceptlab -- YYACCEPT comes here. |
2271 `-------------------------------------*/
2272 yyacceptlab:
2273 yyresult = 0;
2274 goto yyreturnlab;
2275
2276
2277 /*-----------------------------------.
2278 | yyabortlab -- YYABORT comes here. |
2279 `-----------------------------------*/
2280 yyabortlab:
2281 yyresult = 1;
2282 goto yyreturnlab;
2283
2284
2285 /*-----------------------------------------------------------.
2286 | yyexhaustedlab -- YYNOMEM (memory exhaustion) comes here. |
2287 `-----------------------------------------------------------*/
2288 yyexhaustedlab:
2289 yyerror (YY_("memory exhausted"));
2290 yyresult = 2;
2291 goto yyreturnlab;
2292
2293
2294 /*----------------------------------------------------------.
2295 | yyreturnlab -- parsing is finished, clean up and return. |
2296 `----------------------------------------------------------*/
2297 yyreturnlab:
2298 if (yychar != YYEMPTY)
2299 {
2300 /* Make sure we have latest lookahead translation. See comments at
2301 user semantic actions for why this is necessary. */
2302 yytoken = YYTRANSLATE (yychar);
2303 yydestruct ("Cleanup: discarding lookahead",
2304 yytoken, &yylval);
2305 }
2306 /* Do not reclaim the symbols of the rule whose action triggered
2307 this YYABORT or YYACCEPT. */
2308 YYPOPSTACK (yylen);
2309 YY_STACK_PRINT (yyss, yyssp);
2310 while (yyssp != yyss)
2311 {
2312 yydestruct ("Cleanup: popping",
2313 YY_ACCESSING_SYMBOL (+*yyssp), yyvsp);
2314 YYPOPSTACK (1);
2315 }
2316 #ifndef yyoverflow
2317 if (yyss != yyssa)
2318 YYSTACK_FREE (yyss);
2319 #endif
2320
2321 return yyresult;
2322 }
2323
2324 #line 682 "testpatterny.y"
2325