ipfw: Support all possible ICMP types.
[dragonfly.git] / contrib / flex / parse.c
bloba884a9a40880018b8cebbe98b524d7b9a8e92d06
2 /* A Bison parser, made by GNU Bison 2.4.1. */
4 /* Skeleton implementation for Bison's Yacc-like parsers in C
6 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
7 Free Software Foundation, Inc.
9 This program is free software: you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation, either version 3 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with this program. If not, see <http://www.gnu.org/licenses/>. */
22 /* As a special exception, you may create a larger work that contains
23 part or all of the Bison parser skeleton and distribute that work
24 under terms of your choice, so long as that work isn't itself a
25 parser generator using the skeleton or a modified version thereof
26 as a parser skeleton. Alternatively, if you modify or redistribute
27 the parser skeleton itself, you may (at your option) remove this
28 special exception, which will cause the skeleton and the resulting
29 Bison output files to be licensed under the GNU General Public
30 License without this special exception.
32 This special exception was added by the Free Software Foundation in
33 version 2.2 of Bison. */
35 /* C LALR(1) parser skeleton written by Richard Stallman, by
36 simplifying the original so-called "semantic" parser. */
38 /* All symbols defined below should begin with yy or YY, to avoid
39 infringing on user name space. This should be done even for local
40 variables, as they might otherwise be expanded by user macros.
41 There are some unavoidable exceptions within include files to
42 define necessary library symbols; they are noted "INFRINGES ON
43 USER NAME SPACE" below. */
45 /* Identify Bison output. */
46 #define YYBISON 1
48 /* Bison version. */
49 #define YYBISON_VERSION "2.4.1"
51 /* Skeleton name. */
52 #define YYSKELETON_NAME "yacc.c"
54 /* Pure parsers. */
55 #define YYPURE 0
57 /* Push parsers. */
58 #define YYPUSH 0
60 /* Pull parsers. */
61 #define YYPULL 1
63 /* Using locations. */
64 #define YYLSP_NEEDED 0
68 /* Copy the first part of user declarations. */
70 /* Line 189 of yacc.c */
71 #line 34 "parse.y"
73 /* Copyright (c) 1990 The Regents of the University of California. */
74 /* All rights reserved. */
76 /* This code is derived from software contributed to Berkeley by */
77 /* Vern Paxson. */
79 /* The United States Government has rights in this work pursuant */
80 /* to contract no. DE-AC03-76SF00098 between the United States */
81 /* Department of Energy and the University of California. */
83 /* This file is part of flex. */
85 /* Redistribution and use in source and binary forms, with or without */
86 /* modification, are permitted provided that the following conditions */
87 /* are met: */
89 /* 1. Redistributions of source code must retain the above copyright */
90 /* notice, this list of conditions and the following disclaimer. */
91 /* 2. Redistributions in binary form must reproduce the above copyright */
92 /* notice, this list of conditions and the following disclaimer in the */
93 /* documentation and/or other materials provided with the distribution. */
95 /* Neither the name of the University nor the names of its contributors */
96 /* may be used to endorse or promote products derived from this software */
97 /* without specific prior written permission. */
99 /* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR */
100 /* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED */
101 /* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR */
102 /* PURPOSE. */
104 #include "flexdef.h"
105 #include "tables.h"
107 int pat, scnum, eps, headcnt, trailcnt, lastchar, i, rulelen;
108 int trlcontxt, xcluflg, currccl, cclsorted, varlength, variable_trail_rule;
110 int *scon_stk;
111 int scon_stk_ptr;
113 static int madeany = false; /* whether we've made the '.' character class */
114 static int ccldot, cclany;
115 int previous_continued_action; /* whether the previous rule's action was '|' */
117 #define format_warn3(fmt, a1, a2) \
118 do{ \
119 char fw3_msg[MAXLINE];\
120 snprintf( fw3_msg, MAXLINE,(fmt), (a1), (a2) );\
121 warn( fw3_msg );\
122 }while(0)
124 /* Expand a POSIX character class expression. */
125 #define CCL_EXPR(func) \
126 do{ \
127 int c; \
128 for ( c = 0; c < csize; ++c ) \
129 if ( isascii(c) && func(c) ) \
130 ccladd( currccl, c ); \
131 }while(0)
133 /* negated class */
134 #define CCL_NEG_EXPR(func) \
135 do{ \
136 int c; \
137 for ( c = 0; c < csize; ++c ) \
138 if ( !func(c) ) \
139 ccladd( currccl, c ); \
140 }while(0)
142 /* While POSIX defines isblank(), it's not ANSI C. */
143 #define IS_BLANK(c) ((c) == ' ' || (c) == '\t')
145 /* On some over-ambitious machines, such as DEC Alpha's, the default
146 * token type is "long" instead of "int"; this leads to problems with
147 * declaring yylval in flexdef.h. But so far, all the yacc's I've seen
148 * wrap their definitions of YYSTYPE with "#ifndef YYSTYPE"'s, so the
149 * following should ensure that the default token type is "int".
151 #define YYSTYPE int
155 /* Line 189 of yacc.c */
156 #line 157 "parse.c"
158 /* Enabling traces. */
159 #ifndef YYDEBUG
160 # define YYDEBUG 0
161 #endif
163 /* Enabling verbose error messages. */
164 #ifdef YYERROR_VERBOSE
165 # undef YYERROR_VERBOSE
166 # define YYERROR_VERBOSE 1
167 #else
168 # define YYERROR_VERBOSE 0
169 #endif
171 /* Enabling the token table. */
172 #ifndef YYTOKEN_TABLE
173 # define YYTOKEN_TABLE 0
174 #endif
177 /* Tokens. */
178 #ifndef YYTOKENTYPE
179 # define YYTOKENTYPE
180 /* Put the tokens into the symbol table, so that GDB and other debuggers
181 know about them. */
182 enum yytokentype {
183 CHAR = 258,
184 NUMBER = 259,
185 SECTEND = 260,
186 SCDECL = 261,
187 XSCDECL = 262,
188 NAME = 263,
189 PREVCCL = 264,
190 EOF_OP = 265,
191 OPTION_OP = 266,
192 OPT_OUTFILE = 267,
193 OPT_PREFIX = 268,
194 OPT_YYCLASS = 269,
195 OPT_HEADER = 270,
196 OPT_EXTRA_TYPE = 271,
197 OPT_TABLES = 272,
198 CCE_ALNUM = 273,
199 CCE_ALPHA = 274,
200 CCE_BLANK = 275,
201 CCE_CNTRL = 276,
202 CCE_DIGIT = 277,
203 CCE_GRAPH = 278,
204 CCE_LOWER = 279,
205 CCE_PRINT = 280,
206 CCE_PUNCT = 281,
207 CCE_SPACE = 282,
208 CCE_UPPER = 283,
209 CCE_XDIGIT = 284,
210 CCE_NEG_ALNUM = 285,
211 CCE_NEG_ALPHA = 286,
212 CCE_NEG_BLANK = 287,
213 CCE_NEG_CNTRL = 288,
214 CCE_NEG_DIGIT = 289,
215 CCE_NEG_GRAPH = 290,
216 CCE_NEG_LOWER = 291,
217 CCE_NEG_PRINT = 292,
218 CCE_NEG_PUNCT = 293,
219 CCE_NEG_SPACE = 294,
220 CCE_NEG_UPPER = 295,
221 CCE_NEG_XDIGIT = 296,
222 CCL_OP_UNION = 297,
223 CCL_OP_DIFF = 298,
224 BEGIN_REPEAT_POSIX = 299,
225 END_REPEAT_POSIX = 300,
226 BEGIN_REPEAT_FLEX = 301,
227 END_REPEAT_FLEX = 302
229 #endif
230 /* Tokens. */
231 #define CHAR 258
232 #define NUMBER 259
233 #define SECTEND 260
234 #define SCDECL 261
235 #define XSCDECL 262
236 #define NAME 263
237 #define PREVCCL 264
238 #define EOF_OP 265
239 #define OPTION_OP 266
240 #define OPT_OUTFILE 267
241 #define OPT_PREFIX 268
242 #define OPT_YYCLASS 269
243 #define OPT_HEADER 270
244 #define OPT_EXTRA_TYPE 271
245 #define OPT_TABLES 272
246 #define CCE_ALNUM 273
247 #define CCE_ALPHA 274
248 #define CCE_BLANK 275
249 #define CCE_CNTRL 276
250 #define CCE_DIGIT 277
251 #define CCE_GRAPH 278
252 #define CCE_LOWER 279
253 #define CCE_PRINT 280
254 #define CCE_PUNCT 281
255 #define CCE_SPACE 282
256 #define CCE_UPPER 283
257 #define CCE_XDIGIT 284
258 #define CCE_NEG_ALNUM 285
259 #define CCE_NEG_ALPHA 286
260 #define CCE_NEG_BLANK 287
261 #define CCE_NEG_CNTRL 288
262 #define CCE_NEG_DIGIT 289
263 #define CCE_NEG_GRAPH 290
264 #define CCE_NEG_LOWER 291
265 #define CCE_NEG_PRINT 292
266 #define CCE_NEG_PUNCT 293
267 #define CCE_NEG_SPACE 294
268 #define CCE_NEG_UPPER 295
269 #define CCE_NEG_XDIGIT 296
270 #define CCL_OP_UNION 297
271 #define CCL_OP_DIFF 298
272 #define BEGIN_REPEAT_POSIX 299
273 #define END_REPEAT_POSIX 300
274 #define BEGIN_REPEAT_FLEX 301
275 #define END_REPEAT_FLEX 302
280 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
281 typedef int YYSTYPE;
282 # define YYSTYPE_IS_TRIVIAL 1
283 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
284 # define YYSTYPE_IS_DECLARED 1
285 #endif
288 /* Copy the second part of user declarations. */
291 /* Line 264 of yacc.c */
292 #line 293 "parse.c"
294 #ifdef short
295 # undef short
296 #endif
298 #ifdef YYTYPE_UINT8
299 typedef YYTYPE_UINT8 yytype_uint8;
300 #else
301 typedef unsigned char yytype_uint8;
302 #endif
304 #ifdef YYTYPE_INT8
305 typedef YYTYPE_INT8 yytype_int8;
306 #elif (defined __STDC__ || defined __C99__FUNC__ \
307 || defined __cplusplus || defined _MSC_VER)
308 typedef signed char yytype_int8;
309 #else
310 typedef short int yytype_int8;
311 #endif
313 #ifdef YYTYPE_UINT16
314 typedef YYTYPE_UINT16 yytype_uint16;
315 #else
316 typedef unsigned short int yytype_uint16;
317 #endif
319 #ifdef YYTYPE_INT16
320 typedef YYTYPE_INT16 yytype_int16;
321 #else
322 typedef short int yytype_int16;
323 #endif
325 #ifndef YYSIZE_T
326 # ifdef __SIZE_TYPE__
327 # define YYSIZE_T __SIZE_TYPE__
328 # elif defined size_t
329 # define YYSIZE_T size_t
330 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
331 || defined __cplusplus || defined _MSC_VER)
332 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
333 # define YYSIZE_T size_t
334 # else
335 # define YYSIZE_T unsigned int
336 # endif
337 #endif
339 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
341 #ifndef YY_
342 # if YYENABLE_NLS
343 # if ENABLE_NLS
344 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
345 # define YY_(msgid) dgettext ("bison-runtime", msgid)
346 # endif
347 # endif
348 # ifndef YY_
349 # define YY_(msgid) msgid
350 # endif
351 #endif
353 /* Suppress unused-variable warnings by "using" E. */
354 #if ! defined lint || defined __GNUC__
355 # define YYUSE(e) ((void) (e))
356 #else
357 # define YYUSE(e) /* empty */
358 #endif
360 /* Identity function, used to suppress warnings about constant conditions. */
361 #ifndef lint
362 # define YYID(n) (n)
363 #else
364 #if (defined __STDC__ || defined __C99__FUNC__ \
365 || defined __cplusplus || defined _MSC_VER)
366 static int
367 YYID (int yyi)
368 #else
369 static int
370 YYID (yyi)
371 int yyi;
372 #endif
374 return yyi;
376 #endif
378 #if ! defined yyoverflow || YYERROR_VERBOSE
380 /* The parser invokes alloca or malloc; define the necessary symbols. */
382 # ifdef YYSTACK_USE_ALLOCA
383 # if YYSTACK_USE_ALLOCA
384 # ifdef __GNUC__
385 # define YYSTACK_ALLOC __builtin_alloca
386 # elif defined __BUILTIN_VA_ARG_INCR
387 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
388 # elif defined _AIX
389 # define YYSTACK_ALLOC __alloca
390 # elif defined _MSC_VER
391 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
392 # define alloca _alloca
393 # else
394 # define YYSTACK_ALLOC alloca
395 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
396 || defined __cplusplus || defined _MSC_VER)
397 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
398 # ifndef _STDLIB_H
399 # define _STDLIB_H 1
400 # endif
401 # endif
402 # endif
403 # endif
404 # endif
406 # ifdef YYSTACK_ALLOC
407 /* Pacify GCC's `empty if-body' warning. */
408 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
409 # ifndef YYSTACK_ALLOC_MAXIMUM
410 /* The OS might guarantee only one guard page at the bottom of the stack,
411 and a page size can be as small as 4096 bytes. So we cannot safely
412 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
413 to allow for a few compiler-allocated temporary stack slots. */
414 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
415 # endif
416 # else
417 # define YYSTACK_ALLOC YYMALLOC
418 # define YYSTACK_FREE YYFREE
419 # ifndef YYSTACK_ALLOC_MAXIMUM
420 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
421 # endif
422 # if (defined __cplusplus && ! defined _STDLIB_H \
423 && ! ((defined YYMALLOC || defined malloc) \
424 && (defined YYFREE || defined free)))
425 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
426 # ifndef _STDLIB_H
427 # define _STDLIB_H 1
428 # endif
429 # endif
430 # ifndef YYMALLOC
431 # define YYMALLOC malloc
432 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
433 || defined __cplusplus || defined _MSC_VER)
434 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
435 # endif
436 # endif
437 # ifndef YYFREE
438 # define YYFREE free
439 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
440 || defined __cplusplus || defined _MSC_VER)
441 void free (void *); /* INFRINGES ON USER NAME SPACE */
442 # endif
443 # endif
444 # endif
445 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
448 #if (! defined yyoverflow \
449 && (! defined __cplusplus \
450 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
452 /* A type that is properly aligned for any stack member. */
453 union yyalloc
455 yytype_int16 yyss_alloc;
456 YYSTYPE yyvs_alloc;
459 /* The size of the maximum gap between one aligned stack and the next. */
460 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
462 /* The size of an array large to enough to hold all stacks, each with
463 N elements. */
464 # define YYSTACK_BYTES(N) \
465 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
466 + YYSTACK_GAP_MAXIMUM)
468 /* Copy COUNT objects from FROM to TO. The source and destination do
469 not overlap. */
470 # ifndef YYCOPY
471 # if defined __GNUC__ && 1 < __GNUC__
472 # define YYCOPY(To, From, Count) \
473 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
474 # else
475 # define YYCOPY(To, From, Count) \
476 do \
478 YYSIZE_T yyi; \
479 for (yyi = 0; yyi < (Count); yyi++) \
480 (To)[yyi] = (From)[yyi]; \
482 while (YYID (0))
483 # endif
484 # endif
486 /* Relocate STACK from its old location to the new one. The
487 local variables YYSIZE and YYSTACKSIZE give the old and new number of
488 elements in the stack, and YYPTR gives the new location of the
489 stack. Advance YYPTR to a properly aligned location for the next
490 stack. */
491 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
492 do \
494 YYSIZE_T yynewbytes; \
495 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
496 Stack = &yyptr->Stack_alloc; \
497 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
498 yyptr += yynewbytes / sizeof (*yyptr); \
500 while (YYID (0))
502 #endif
504 /* YYFINAL -- State number of the termination state. */
505 #define YYFINAL 3
506 /* YYLAST -- Last index in YYTABLE. */
507 #define YYLAST 161
509 /* YYNTOKENS -- Number of terminals. */
510 #define YYNTOKENS 69
511 /* YYNNTS -- Number of nonterminals. */
512 #define YYNNTS 27
513 /* YYNRULES -- Number of rules. */
514 #define YYNRULES 97
515 /* YYNRULES -- Number of states. */
516 #define YYNSTATES 140
518 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
519 #define YYUNDEFTOK 2
520 #define YYMAXUTOK 302
522 #define YYTRANSLATE(YYX) \
523 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
525 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
526 static const yytype_uint8 yytranslate[] =
528 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
529 49, 2, 2, 2, 2, 2, 2, 2, 2, 2,
530 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
531 2, 2, 2, 2, 63, 2, 57, 2, 2, 2,
532 64, 65, 55, 60, 56, 68, 62, 59, 2, 2,
533 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
534 53, 48, 54, 61, 2, 2, 2, 2, 2, 2,
535 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
536 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
537 2, 66, 2, 67, 52, 2, 2, 2, 2, 2,
538 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
539 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
540 2, 2, 2, 50, 58, 51, 2, 2, 2, 2,
541 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
542 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
543 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
544 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
545 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
546 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
547 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
548 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
549 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
550 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
551 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
552 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
553 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
554 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
555 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
556 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
557 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
558 45, 46, 47
561 #if YYDEBUG
562 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
563 YYRHS. */
564 static const yytype_uint16 yyprhs[] =
566 0, 0, 3, 9, 10, 14, 17, 18, 20, 22,
567 24, 26, 29, 31, 33, 36, 39, 40, 44, 48,
568 52, 56, 60, 64, 70, 76, 77, 78, 81, 83,
569 85, 87, 88, 93, 97, 98, 102, 104, 106, 108,
570 111, 115, 118, 120, 124, 126, 129, 132, 134, 141,
571 147, 152, 155, 158, 161, 168, 174, 179, 181, 183,
572 185, 189, 193, 195, 199, 203, 205, 209, 214, 219,
573 222, 225, 226, 228, 230, 232, 234, 236, 238, 240,
574 242, 244, 246, 248, 250, 252, 254, 256, 258, 260,
575 262, 264, 266, 268, 270, 272, 274, 277
578 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
579 static const yytype_int8 yyrhs[] =
581 70, 0, -1, 71, 72, 73, 79, 80, -1, -1,
582 72, 74, 75, -1, 72, 76, -1, -1, 1, -1,
583 5, -1, 6, -1, 7, -1, 75, 8, -1, 8,
584 -1, 1, -1, 11, 77, -1, 77, 78, -1, -1,
585 12, 48, 8, -1, 16, 48, 8, -1, 13, 48,
586 8, -1, 14, 48, 8, -1, 15, 48, 8, -1,
587 17, 48, 8, -1, 79, 83, 80, 81, 49, -1,
588 79, 83, 50, 79, 51, -1, -1, -1, 52, 86,
589 -1, 86, -1, 10, -1, 1, -1, -1, 53, 82,
590 84, 54, -1, 53, 55, 54, -1, -1, 84, 56,
591 85, -1, 85, -1, 1, -1, 8, -1, 88, 87,
592 -1, 88, 87, 57, -1, 87, 57, -1, 87, -1,
593 87, 58, 89, -1, 89, -1, 87, 59, -1, 89,
594 90, -1, 90, -1, 89, 44, 4, 56, 4, 45,
595 -1, 89, 44, 4, 56, 45, -1, 89, 44, 4,
596 45, -1, 90, 55, -1, 90, 60, -1, 90, 61,
597 -1, 90, 46, 4, 56, 4, 47, -1, 90, 46,
598 4, 56, 47, -1, 90, 46, 4, 47, -1, 62,
599 -1, 91, -1, 9, -1, 63, 95, 63, -1, 64,
600 87, 65, -1, 3, -1, 91, 43, 92, -1, 91,
601 42, 92, -1, 92, -1, 66, 93, 67, -1, 66,
602 52, 93, 67, -1, 93, 3, 68, 3, -1, 93,
603 3, -1, 93, 94, -1, -1, 18, -1, 19, -1,
604 20, -1, 21, -1, 22, -1, 23, -1, 24, -1,
605 25, -1, 26, -1, 27, -1, 29, -1, 28, -1,
606 30, -1, 31, -1, 32, -1, 33, -1, 34, -1,
607 35, -1, 37, -1, 38, -1, 39, -1, 41, -1,
608 36, -1, 40, -1, 95, 3, -1, -1
611 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
612 static const yytype_uint16 yyrline[] =
614 0, 118, 118, 148, 155, 156, 157, 158, 162, 170,
615 173, 177, 180, 183, 187, 190, 191, 194, 199, 201,
616 203, 205, 207, 211, 213, 215, 219, 231, 267, 291,
617 314, 319, 322, 325, 343, 346, 348, 350, 354, 377,
618 433, 436, 479, 497, 503, 508, 535, 543, 546, 574,
619 588, 610, 617, 623, 629, 657, 671, 690, 724, 742,
620 752, 755, 758, 773, 774, 775, 780, 782, 789, 849,
621 867, 875, 883, 884, 885, 886, 887, 888, 889, 894,
622 895, 896, 897, 898, 904, 905, 906, 907, 908, 909,
623 910, 911, 912, 913, 914, 920, 928, 944
625 #endif
627 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
628 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
629 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
630 static const char *const yytname[] =
632 "$end", "error", "$undefined", "CHAR", "NUMBER", "SECTEND", "SCDECL",
633 "XSCDECL", "NAME", "PREVCCL", "EOF_OP", "OPTION_OP", "OPT_OUTFILE",
634 "OPT_PREFIX", "OPT_YYCLASS", "OPT_HEADER", "OPT_EXTRA_TYPE",
635 "OPT_TABLES", "CCE_ALNUM", "CCE_ALPHA", "CCE_BLANK", "CCE_CNTRL",
636 "CCE_DIGIT", "CCE_GRAPH", "CCE_LOWER", "CCE_PRINT", "CCE_PUNCT",
637 "CCE_SPACE", "CCE_UPPER", "CCE_XDIGIT", "CCE_NEG_ALNUM", "CCE_NEG_ALPHA",
638 "CCE_NEG_BLANK", "CCE_NEG_CNTRL", "CCE_NEG_DIGIT", "CCE_NEG_GRAPH",
639 "CCE_NEG_LOWER", "CCE_NEG_PRINT", "CCE_NEG_PUNCT", "CCE_NEG_SPACE",
640 "CCE_NEG_UPPER", "CCE_NEG_XDIGIT", "CCL_OP_UNION", "CCL_OP_DIFF",
641 "BEGIN_REPEAT_POSIX", "END_REPEAT_POSIX", "BEGIN_REPEAT_FLEX",
642 "END_REPEAT_FLEX", "'='", "'\\n'", "'{'", "'}'", "'^'", "'<'", "'>'",
643 "'*'", "','", "'$'", "'|'", "'/'", "'+'", "'?'", "'.'", "'\"'", "'('",
644 "')'", "'['", "']'", "'-'", "$accept", "goal", "initlex", "sect1",
645 "sect1end", "startconddecl", "namelist1", "options", "optionlist",
646 "option", "sect2", "initforrule", "flexrule", "scon_stk_ptr", "scon",
647 "namelist2", "sconname", "rule", "re", "re2", "series", "singleton",
648 "fullccl", "braceccl", "ccl", "ccl_expr", "string", 0
650 #endif
652 # ifdef YYPRINT
653 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
654 token YYLEX-NUM. */
655 static const yytype_uint16 yytoknum[] =
657 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
658 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
659 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
660 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
661 295, 296, 297, 298, 299, 300, 301, 302, 61, 10,
662 123, 125, 94, 60, 62, 42, 44, 36, 124, 47,
663 43, 63, 46, 34, 40, 41, 91, 93, 45
665 # endif
667 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
668 static const yytype_uint8 yyr1[] =
670 0, 69, 70, 71, 72, 72, 72, 72, 73, 74,
671 74, 75, 75, 75, 76, 77, 77, 78, 78, 78,
672 78, 78, 78, 79, 79, 79, 80, 81, 81, 81,
673 81, 82, 83, 83, 83, 84, 84, 84, 85, 86,
674 86, 86, 86, 87, 87, 88, 89, 89, 89, 89,
675 89, 90, 90, 90, 90, 90, 90, 90, 90, 90,
676 90, 90, 90, 91, 91, 91, 92, 92, 93, 93,
677 93, 93, 94, 94, 94, 94, 94, 94, 94, 94,
678 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
679 94, 94, 94, 94, 94, 94, 95, 95
682 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
683 static const yytype_uint8 yyr2[] =
685 0, 2, 5, 0, 3, 2, 0, 1, 1, 1,
686 1, 2, 1, 1, 2, 2, 0, 3, 3, 3,
687 3, 3, 3, 5, 5, 0, 0, 2, 1, 1,
688 1, 0, 4, 3, 0, 3, 1, 1, 1, 2,
689 3, 2, 1, 3, 1, 2, 2, 1, 6, 5,
690 4, 2, 2, 2, 6, 5, 4, 1, 1, 1,
691 3, 3, 1, 3, 3, 1, 3, 4, 4, 2,
692 2, 0, 1, 1, 1, 1, 1, 1, 1, 1,
693 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
694 1, 1, 1, 1, 1, 1, 2, 0
697 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
698 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
699 means the default is an error. */
700 static const yytype_uint8 yydefact[] =
702 3, 0, 0, 1, 7, 0, 8, 9, 10, 16,
703 25, 0, 5, 14, 34, 13, 12, 4, 0, 0,
704 0, 0, 0, 0, 15, 31, 2, 26, 11, 0,
705 0, 0, 0, 0, 0, 0, 0, 25, 0, 17,
706 19, 20, 21, 18, 22, 33, 37, 38, 0, 36,
707 34, 30, 62, 59, 29, 0, 57, 97, 0, 71,
708 0, 28, 42, 0, 44, 47, 58, 65, 32, 0,
709 24, 27, 0, 0, 71, 0, 23, 41, 0, 45,
710 39, 0, 46, 0, 51, 52, 53, 0, 0, 35,
711 96, 60, 61, 0, 69, 72, 73, 74, 75, 76,
712 77, 78, 79, 80, 81, 83, 82, 84, 85, 86,
713 87, 88, 89, 94, 90, 91, 92, 95, 93, 66,
714 70, 43, 40, 0, 0, 64, 63, 67, 0, 50,
715 0, 56, 0, 68, 0, 49, 0, 55, 48, 54
718 /* YYDEFGOTO[NTERM-NUM]. */
719 static const yytype_int8 yydefgoto[] =
721 -1, 1, 2, 5, 10, 11, 17, 12, 13, 24,
722 14, 26, 60, 36, 27, 48, 49, 61, 62, 63,
723 64, 65, 66, 67, 75, 120, 72
726 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
727 STATE-NUM. */
728 #define YYPACT_NINF -52
729 static const yytype_int16 yypact[] =
731 -52, 17, 103, -52, -52, 113, -52, -52, -52, -52,
732 -52, 48, -52, 114, 6, -52, -52, 42, 7, 12,
733 58, 77, 88, 89, -52, 43, -52, 73, -52, 130,
734 131, 132, 133, 134, 135, 90, 91, -52, -1, -52,
735 -52, -52, -52, -52, -52, -52, -52, -52, 40, -52,
736 44, -52, -52, -52, -52, 39, -52, -52, 39, 93,
737 97, -52, -12, 39, 49, 61, -31, -52, -52, 139,
738 -52, -52, 1, -51, -52, 0, -52, -52, 39, -52,
739 75, 144, 61, 145, -52, -52, -52, 84, 84, -52,
740 -52, -52, -52, 50, 83, -52, -52, -52, -52, -52,
741 -52, -52, -52, -52, -52, -52, -52, -52, -52, -52,
742 -52, -52, -52, -52, -52, -52, -52, -52, -52, -52,
743 -52, 49, -52, -40, 10, -52, -52, -52, 149, -52,
744 9, -52, -3, -52, 108, -52, 107, -52, -52, -52
747 /* YYPGOTO[NTERM-NUM]. */
748 static const yytype_int16 yypgoto[] =
750 -52, -52, -52, -52, -52, -52, -52, -52, -52, -52,
751 118, 129, -52, -52, -52, -52, 92, 102, -48, -52,
752 80, -21, -52, 47, 85, -52, -52
755 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
756 positive, shift that token. If negative, reduce the rule which
757 number is the opposite. If zero, do what YYDEFACT says.
758 If YYTABLE_NINF, syntax error. */
759 #define YYTABLE_NINF -27
760 static const yytype_int16 yytable[] =
762 51, 136, 52, 94, 90, 129, -26, 78, 53, 54,
763 73, 87, 88, 134, 92, 80, 130, 3, 95, 96,
764 97, 98, 99, 100, 101, 102, 103, 104, 105, 106,
765 107, 108, 109, 110, 111, 112, 113, 114, 115, 116,
766 117, 118, 52, 82, 137, 77, 78, 79, 53, 15,
767 28, 55, 52, 94, 135, 29, 16, 131, 53, 25,
768 30, 56, 57, 58, 91, 59, 132, 119, 95, 96,
769 97, 98, 99, 100, 101, 102, 103, 104, 105, 106,
770 107, 108, 109, 110, 111, 112, 113, 114, 115, 116,
771 117, 118, 46, 81, 68, 70, 69, 25, 35, 47,
772 82, 56, 57, 58, 4, 59, 31, 83, -6, -6,
773 -6, 56, 57, 58, -6, 59, 84, 127, 6, 7,
774 8, 85, 86, 37, 9, 32, 18, 19, 20, 21,
775 22, 23, 122, 78, 125, 126, 33, 34, 39, 40,
776 41, 42, 43, 44, 45, 74, 76, 47, 123, 124,
777 59, 128, 133, 138, 139, 50, 38, 71, 121, 93,
778 0, 89
781 static const yytype_int8 yycheck[] =
783 1, 4, 3, 3, 3, 45, 0, 58, 9, 10,
784 58, 42, 43, 4, 65, 63, 56, 0, 18, 19,
785 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
786 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
787 40, 41, 3, 64, 47, 57, 58, 59, 9, 1,
788 8, 52, 3, 3, 45, 48, 8, 47, 9, 53,
789 48, 62, 63, 64, 63, 66, 56, 67, 18, 19,
790 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
791 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
792 40, 41, 1, 44, 54, 51, 56, 53, 55, 8,
793 121, 62, 63, 64, 1, 66, 48, 46, 5, 6,
794 7, 62, 63, 64, 11, 66, 55, 67, 5, 6,
795 7, 60, 61, 50, 11, 48, 12, 13, 14, 15,
796 16, 17, 57, 58, 87, 88, 48, 48, 8, 8,
797 8, 8, 8, 8, 54, 52, 49, 8, 4, 4,
798 66, 68, 3, 45, 47, 37, 27, 55, 78, 74,
799 -1, 69
802 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
803 symbol of state STATE-NUM. */
804 static const yytype_uint8 yystos[] =
806 0, 70, 71, 0, 1, 72, 5, 6, 7, 11,
807 73, 74, 76, 77, 79, 1, 8, 75, 12, 13,
808 14, 15, 16, 17, 78, 53, 80, 83, 8, 48,
809 48, 48, 48, 48, 48, 55, 82, 50, 80, 8,
810 8, 8, 8, 8, 8, 54, 1, 8, 84, 85,
811 79, 1, 3, 9, 10, 52, 62, 63, 64, 66,
812 81, 86, 87, 88, 89, 90, 91, 92, 54, 56,
813 51, 86, 95, 87, 52, 93, 49, 57, 58, 59,
814 87, 44, 90, 46, 55, 60, 61, 42, 43, 85,
815 3, 63, 65, 93, 3, 18, 19, 20, 21, 22,
816 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
817 33, 34, 35, 36, 37, 38, 39, 40, 41, 67,
818 94, 89, 57, 4, 4, 92, 92, 67, 68, 45,
819 56, 47, 56, 3, 4, 45, 4, 47, 45, 47
822 #define yyerrok (yyerrstatus = 0)
823 #define yyclearin (yychar = YYEMPTY)
824 #define YYEMPTY (-2)
825 #define YYEOF 0
827 #define YYACCEPT goto yyacceptlab
828 #define YYABORT goto yyabortlab
829 #define YYERROR goto yyerrorlab
832 /* Like YYERROR except do call yyerror. This remains here temporarily
833 to ease the transition to the new meaning of YYERROR, for GCC.
834 Once GCC version 2 has supplanted version 1, this can go. */
836 #define YYFAIL goto yyerrlab
838 #define YYRECOVERING() (!!yyerrstatus)
840 #define YYBACKUP(Token, Value) \
841 do \
842 if (yychar == YYEMPTY && yylen == 1) \
844 yychar = (Token); \
845 yylval = (Value); \
846 yytoken = YYTRANSLATE (yychar); \
847 YYPOPSTACK (1); \
848 goto yybackup; \
850 else \
852 yyerror (YY_("syntax error: cannot back up")); \
853 YYERROR; \
855 while (YYID (0))
858 #define YYTERROR 1
859 #define YYERRCODE 256
862 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
863 If N is 0, then set CURRENT to the empty location which ends
864 the previous symbol: RHS[0] (always defined). */
866 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
867 #ifndef YYLLOC_DEFAULT
868 # define YYLLOC_DEFAULT(Current, Rhs, N) \
869 do \
870 if (YYID (N)) \
872 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
873 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
874 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
875 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
877 else \
879 (Current).first_line = (Current).last_line = \
880 YYRHSLOC (Rhs, 0).last_line; \
881 (Current).first_column = (Current).last_column = \
882 YYRHSLOC (Rhs, 0).last_column; \
884 while (YYID (0))
885 #endif
888 /* YY_LOCATION_PRINT -- Print the location on the stream.
889 This macro was not mandated originally: define only if we know
890 we won't break user code: when these are the locations we know. */
892 #ifndef YY_LOCATION_PRINT
893 # if YYLTYPE_IS_TRIVIAL
894 # define YY_LOCATION_PRINT(File, Loc) \
895 fprintf (File, "%d.%d-%d.%d", \
896 (Loc).first_line, (Loc).first_column, \
897 (Loc).last_line, (Loc).last_column)
898 # else
899 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
900 # endif
901 #endif
904 /* YYLEX -- calling `yylex' with the right arguments. */
906 #ifdef YYLEX_PARAM
907 # define YYLEX yylex (YYLEX_PARAM)
908 #else
909 # define YYLEX yylex ()
910 #endif
912 /* Enable debugging if requested. */
913 #if YYDEBUG
915 # ifndef YYFPRINTF
916 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
917 # define YYFPRINTF fprintf
918 # endif
920 # define YYDPRINTF(Args) \
921 do { \
922 if (yydebug) \
923 YYFPRINTF Args; \
924 } while (YYID (0))
926 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
927 do { \
928 if (yydebug) \
930 YYFPRINTF (stderr, "%s ", Title); \
931 yy_symbol_print (stderr, \
932 Type, Value); \
933 YYFPRINTF (stderr, "\n"); \
935 } while (YYID (0))
938 /*--------------------------------.
939 | Print this symbol on YYOUTPUT. |
940 `--------------------------------*/
942 /*ARGSUSED*/
943 #if (defined __STDC__ || defined __C99__FUNC__ \
944 || defined __cplusplus || defined _MSC_VER)
945 static void
946 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
947 #else
948 static void
949 yy_symbol_value_print (yyoutput, yytype, yyvaluep)
950 FILE *yyoutput;
951 int yytype;
952 YYSTYPE const * const yyvaluep;
953 #endif
955 if (!yyvaluep)
956 return;
957 # ifdef YYPRINT
958 if (yytype < YYNTOKENS)
959 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
960 # else
961 YYUSE (yyoutput);
962 # endif
963 switch (yytype)
965 default:
966 break;
971 /*--------------------------------.
972 | Print this symbol on YYOUTPUT. |
973 `--------------------------------*/
975 #if (defined __STDC__ || defined __C99__FUNC__ \
976 || defined __cplusplus || defined _MSC_VER)
977 static void
978 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
979 #else
980 static void
981 yy_symbol_print (yyoutput, yytype, yyvaluep)
982 FILE *yyoutput;
983 int yytype;
984 YYSTYPE const * const yyvaluep;
985 #endif
987 if (yytype < YYNTOKENS)
988 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
989 else
990 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
992 yy_symbol_value_print (yyoutput, yytype, yyvaluep);
993 YYFPRINTF (yyoutput, ")");
996 /*------------------------------------------------------------------.
997 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
998 | TOP (included). |
999 `------------------------------------------------------------------*/
1001 #if (defined __STDC__ || defined __C99__FUNC__ \
1002 || defined __cplusplus || defined _MSC_VER)
1003 static void
1004 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
1005 #else
1006 static void
1007 yy_stack_print (yybottom, yytop)
1008 yytype_int16 *yybottom;
1009 yytype_int16 *yytop;
1010 #endif
1012 YYFPRINTF (stderr, "Stack now");
1013 for (; yybottom <= yytop; yybottom++)
1015 int yybot = *yybottom;
1016 YYFPRINTF (stderr, " %d", yybot);
1018 YYFPRINTF (stderr, "\n");
1021 # define YY_STACK_PRINT(Bottom, Top) \
1022 do { \
1023 if (yydebug) \
1024 yy_stack_print ((Bottom), (Top)); \
1025 } while (YYID (0))
1028 /*------------------------------------------------.
1029 | Report that the YYRULE is going to be reduced. |
1030 `------------------------------------------------*/
1032 #if (defined __STDC__ || defined __C99__FUNC__ \
1033 || defined __cplusplus || defined _MSC_VER)
1034 static void
1035 yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
1036 #else
1037 static void
1038 yy_reduce_print (yyvsp, yyrule)
1039 YYSTYPE *yyvsp;
1040 int yyrule;
1041 #endif
1043 int yynrhs = yyr2[yyrule];
1044 int yyi;
1045 unsigned long int yylno = yyrline[yyrule];
1046 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
1047 yyrule - 1, yylno);
1048 /* The symbols being reduced. */
1049 for (yyi = 0; yyi < yynrhs; yyi++)
1051 YYFPRINTF (stderr, " $%d = ", yyi + 1);
1052 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
1053 &(yyvsp[(yyi + 1) - (yynrhs)])
1055 YYFPRINTF (stderr, "\n");
1059 # define YY_REDUCE_PRINT(Rule) \
1060 do { \
1061 if (yydebug) \
1062 yy_reduce_print (yyvsp, Rule); \
1063 } while (YYID (0))
1065 /* Nonzero means print parse trace. It is left uninitialized so that
1066 multiple parsers can coexist. */
1067 int yydebug;
1068 #else /* !YYDEBUG */
1069 # define YYDPRINTF(Args)
1070 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1071 # define YY_STACK_PRINT(Bottom, Top)
1072 # define YY_REDUCE_PRINT(Rule)
1073 #endif /* !YYDEBUG */
1076 /* YYINITDEPTH -- initial size of the parser's stacks. */
1077 #ifndef YYINITDEPTH
1078 # define YYINITDEPTH 200
1079 #endif
1081 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1082 if the built-in stack extension method is used).
1084 Do not make this value too large; the results are undefined if
1085 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1086 evaluated with infinite-precision integer arithmetic. */
1088 #ifndef YYMAXDEPTH
1089 # define YYMAXDEPTH 10000
1090 #endif
1094 #if YYERROR_VERBOSE
1096 # ifndef yystrlen
1097 # if defined __GLIBC__ && defined _STRING_H
1098 # define yystrlen strlen
1099 # else
1100 /* Return the length of YYSTR. */
1101 #if (defined __STDC__ || defined __C99__FUNC__ \
1102 || defined __cplusplus || defined _MSC_VER)
1103 static YYSIZE_T
1104 yystrlen (const char *yystr)
1105 #else
1106 static YYSIZE_T
1107 yystrlen (yystr)
1108 const char *yystr;
1109 #endif
1111 YYSIZE_T yylen;
1112 for (yylen = 0; yystr[yylen]; yylen++)
1113 continue;
1114 return yylen;
1116 # endif
1117 # endif
1119 # ifndef yystpcpy
1120 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1121 # define yystpcpy stpcpy
1122 # else
1123 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1124 YYDEST. */
1125 #if (defined __STDC__ || defined __C99__FUNC__ \
1126 || defined __cplusplus || defined _MSC_VER)
1127 static char *
1128 yystpcpy (char *yydest, const char *yysrc)
1129 #else
1130 static char *
1131 yystpcpy (yydest, yysrc)
1132 char *yydest;
1133 const char *yysrc;
1134 #endif
1136 char *yyd = yydest;
1137 const char *yys = yysrc;
1139 while ((*yyd++ = *yys++) != '\0')
1140 continue;
1142 return yyd - 1;
1144 # endif
1145 # endif
1147 # ifndef yytnamerr
1148 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1149 quotes and backslashes, so that it's suitable for yyerror. The
1150 heuristic is that double-quoting is unnecessary unless the string
1151 contains an apostrophe, a comma, or backslash (other than
1152 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1153 null, do not copy; instead, return the length of what the result
1154 would have been. */
1155 static YYSIZE_T
1156 yytnamerr (char *yyres, const char *yystr)
1158 if (*yystr == '"')
1160 YYSIZE_T yyn = 0;
1161 char const *yyp = yystr;
1163 for (;;)
1164 switch (*++yyp)
1166 case '\'':
1167 case ',':
1168 goto do_not_strip_quotes;
1170 case '\\':
1171 if (*++yyp != '\\')
1172 goto do_not_strip_quotes;
1173 /* Fall through. */
1174 default:
1175 if (yyres)
1176 yyres[yyn] = *yyp;
1177 yyn++;
1178 break;
1180 case '"':
1181 if (yyres)
1182 yyres[yyn] = '\0';
1183 return yyn;
1185 do_not_strip_quotes: ;
1188 if (! yyres)
1189 return yystrlen (yystr);
1191 return yystpcpy (yyres, yystr) - yyres;
1193 # endif
1195 /* Copy into YYRESULT an error message about the unexpected token
1196 YYCHAR while in state YYSTATE. Return the number of bytes copied,
1197 including the terminating null byte. If YYRESULT is null, do not
1198 copy anything; just return the number of bytes that would be
1199 copied. As a special case, return 0 if an ordinary "syntax error"
1200 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
1201 size calculation. */
1202 static YYSIZE_T
1203 yysyntax_error (char *yyresult, int yystate, int yychar)
1205 int yyn = yypact[yystate];
1207 if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
1208 return 0;
1209 else
1211 int yytype = YYTRANSLATE (yychar);
1212 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
1213 YYSIZE_T yysize = yysize0;
1214 YYSIZE_T yysize1;
1215 int yysize_overflow = 0;
1216 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1217 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1218 int yyx;
1220 # if 0
1221 /* This is so xgettext sees the translatable formats that are
1222 constructed on the fly. */
1223 YY_("syntax error, unexpected %s");
1224 YY_("syntax error, unexpected %s, expecting %s");
1225 YY_("syntax error, unexpected %s, expecting %s or %s");
1226 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
1227 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
1228 # endif
1229 char *yyfmt;
1230 char const *yyf;
1231 static char const yyunexpected[] = "syntax error, unexpected %s";
1232 static char const yyexpecting[] = ", expecting %s";
1233 static char const yyor[] = " or %s";
1234 char yyformat[sizeof yyunexpected
1235 + sizeof yyexpecting - 1
1236 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
1237 * (sizeof yyor - 1))];
1238 char const *yyprefix = yyexpecting;
1240 /* Start YYX at -YYN if negative to avoid negative indexes in
1241 YYCHECK. */
1242 int yyxbegin = yyn < 0 ? -yyn : 0;
1244 /* Stay within bounds of both yycheck and yytname. */
1245 int yychecklim = YYLAST - yyn + 1;
1246 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1247 int yycount = 1;
1249 yyarg[0] = yytname[yytype];
1250 yyfmt = yystpcpy (yyformat, yyunexpected);
1252 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1253 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1255 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1257 yycount = 1;
1258 yysize = yysize0;
1259 yyformat[sizeof yyunexpected - 1] = '\0';
1260 break;
1262 yyarg[yycount++] = yytname[yyx];
1263 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
1264 yysize_overflow |= (yysize1 < yysize);
1265 yysize = yysize1;
1266 yyfmt = yystpcpy (yyfmt, yyprefix);
1267 yyprefix = yyor;
1270 yyf = YY_(yyformat);
1271 yysize1 = yysize + yystrlen (yyf);
1272 yysize_overflow |= (yysize1 < yysize);
1273 yysize = yysize1;
1275 if (yysize_overflow)
1276 return YYSIZE_MAXIMUM;
1278 if (yyresult)
1280 /* Avoid sprintf, as that infringes on the user's name space.
1281 Don't have undefined behavior even if the translation
1282 produced a string with the wrong number of "%s"s. */
1283 char *yyp = yyresult;
1284 int yyi = 0;
1285 while ((*yyp = *yyf) != '\0')
1287 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
1289 yyp += yytnamerr (yyp, yyarg[yyi++]);
1290 yyf += 2;
1292 else
1294 yyp++;
1295 yyf++;
1299 return yysize;
1302 #endif /* YYERROR_VERBOSE */
1305 /*-----------------------------------------------.
1306 | Release the memory associated to this symbol. |
1307 `-----------------------------------------------*/
1309 /*ARGSUSED*/
1310 #if (defined __STDC__ || defined __C99__FUNC__ \
1311 || defined __cplusplus || defined _MSC_VER)
1312 static void
1313 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
1314 #else
1315 static void
1316 yydestruct (yymsg, yytype, yyvaluep)
1317 const char *yymsg;
1318 int yytype;
1319 YYSTYPE *yyvaluep;
1320 #endif
1322 YYUSE (yyvaluep);
1324 if (!yymsg)
1325 yymsg = "Deleting";
1326 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1328 switch (yytype)
1331 default:
1332 break;
1336 /* Prevent warnings from -Wmissing-prototypes. */
1337 #ifdef YYPARSE_PARAM
1338 #if defined __STDC__ || defined __cplusplus
1339 int yyparse (void *YYPARSE_PARAM);
1340 #else
1341 int yyparse ();
1342 #endif
1343 #else /* ! YYPARSE_PARAM */
1344 #if defined __STDC__ || defined __cplusplus
1345 int yyparse (void);
1346 #else
1347 int yyparse ();
1348 #endif
1349 #endif /* ! YYPARSE_PARAM */
1352 /* The lookahead symbol. */
1353 int yychar;
1355 /* The semantic value of the lookahead symbol. */
1356 YYSTYPE yylval;
1358 /* Number of syntax errors so far. */
1359 int yynerrs;
1363 /*-------------------------.
1364 | yyparse or yypush_parse. |
1365 `-------------------------*/
1367 #ifdef YYPARSE_PARAM
1368 #if (defined __STDC__ || defined __C99__FUNC__ \
1369 || defined __cplusplus || defined _MSC_VER)
1371 yyparse (void *YYPARSE_PARAM)
1372 #else
1374 yyparse (YYPARSE_PARAM)
1375 void *YYPARSE_PARAM;
1376 #endif
1377 #else /* ! YYPARSE_PARAM */
1378 #if (defined __STDC__ || defined __C99__FUNC__ \
1379 || defined __cplusplus || defined _MSC_VER)
1381 yyparse (void)
1382 #else
1384 yyparse ()
1386 #endif
1387 #endif
1391 int yystate;
1392 /* Number of tokens to shift before error messages enabled. */
1393 int yyerrstatus;
1395 /* The stacks and their tools:
1396 `yyss': related to states.
1397 `yyvs': related to semantic values.
1399 Refer to the stacks thru separate pointers, to allow yyoverflow
1400 to reallocate them elsewhere. */
1402 /* The state stack. */
1403 yytype_int16 yyssa[YYINITDEPTH];
1404 yytype_int16 *yyss;
1405 yytype_int16 *yyssp;
1407 /* The semantic value stack. */
1408 YYSTYPE yyvsa[YYINITDEPTH];
1409 YYSTYPE *yyvs;
1410 YYSTYPE *yyvsp;
1412 YYSIZE_T yystacksize;
1414 int yyn;
1415 int yyresult;
1416 /* Lookahead token as an internal (translated) token number. */
1417 int yytoken;
1418 /* The variables used to return semantic value and location from the
1419 action routines. */
1420 YYSTYPE yyval;
1422 #if YYERROR_VERBOSE
1423 /* Buffer for error messages, and its allocated size. */
1424 char yymsgbuf[128];
1425 char *yymsg = yymsgbuf;
1426 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1427 #endif
1429 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1431 /* The number of symbols on the RHS of the reduced rule.
1432 Keep to zero when no symbol should be popped. */
1433 int yylen = 0;
1435 yytoken = 0;
1436 yyss = yyssa;
1437 yyvs = yyvsa;
1438 yystacksize = YYINITDEPTH;
1440 YYDPRINTF ((stderr, "Starting parse\n"));
1442 yystate = 0;
1443 yyerrstatus = 0;
1444 yynerrs = 0;
1445 yychar = YYEMPTY; /* Cause a token to be read. */
1447 /* Initialize stack pointers.
1448 Waste one element of value and location stack
1449 so that they stay on the same level as the state stack.
1450 The wasted elements are never initialized. */
1451 yyssp = yyss;
1452 yyvsp = yyvs;
1454 goto yysetstate;
1456 /*------------------------------------------------------------.
1457 | yynewstate -- Push a new state, which is found in yystate. |
1458 `------------------------------------------------------------*/
1459 yynewstate:
1460 /* In all cases, when you get here, the value and location stacks
1461 have just been pushed. So pushing a state here evens the stacks. */
1462 yyssp++;
1464 yysetstate:
1465 *yyssp = yystate;
1467 if (yyss + yystacksize - 1 <= yyssp)
1469 /* Get the current used size of the three stacks, in elements. */
1470 YYSIZE_T yysize = yyssp - yyss + 1;
1472 #ifdef yyoverflow
1474 /* Give user a chance to reallocate the stack. Use copies of
1475 these so that the &'s don't force the real ones into
1476 memory. */
1477 YYSTYPE *yyvs1 = yyvs;
1478 yytype_int16 *yyss1 = yyss;
1480 /* Each stack pointer address is followed by the size of the
1481 data in use in that stack, in bytes. This used to be a
1482 conditional around just the two extra args, but that might
1483 be undefined if yyoverflow is a macro. */
1484 yyoverflow (YY_("memory exhausted"),
1485 &yyss1, yysize * sizeof (*yyssp),
1486 &yyvs1, yysize * sizeof (*yyvsp),
1487 &yystacksize);
1489 yyss = yyss1;
1490 yyvs = yyvs1;
1492 #else /* no yyoverflow */
1493 # ifndef YYSTACK_RELOCATE
1494 goto yyexhaustedlab;
1495 # else
1496 /* Extend the stack our own way. */
1497 if (YYMAXDEPTH <= yystacksize)
1498 goto yyexhaustedlab;
1499 yystacksize *= 2;
1500 if (YYMAXDEPTH < yystacksize)
1501 yystacksize = YYMAXDEPTH;
1504 yytype_int16 *yyss1 = yyss;
1505 union yyalloc *yyptr =
1506 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1507 if (! yyptr)
1508 goto yyexhaustedlab;
1509 YYSTACK_RELOCATE (yyss_alloc, yyss);
1510 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1511 # undef YYSTACK_RELOCATE
1512 if (yyss1 != yyssa)
1513 YYSTACK_FREE (yyss1);
1515 # endif
1516 #endif /* no yyoverflow */
1518 yyssp = yyss + yysize - 1;
1519 yyvsp = yyvs + yysize - 1;
1521 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1522 (unsigned long int) yystacksize));
1524 if (yyss + yystacksize - 1 <= yyssp)
1525 YYABORT;
1528 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1530 if (yystate == YYFINAL)
1531 YYACCEPT;
1533 goto yybackup;
1535 /*-----------.
1536 | yybackup. |
1537 `-----------*/
1538 yybackup:
1540 /* Do appropriate processing given the current state. Read a
1541 lookahead token if we need one and don't already have one. */
1543 /* First try to decide what to do without reference to lookahead token. */
1544 yyn = yypact[yystate];
1545 if (yyn == YYPACT_NINF)
1546 goto yydefault;
1548 /* Not known => get a lookahead token if don't already have one. */
1550 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1551 if (yychar == YYEMPTY)
1553 YYDPRINTF ((stderr, "Reading a token: "));
1554 yychar = YYLEX;
1557 if (yychar <= YYEOF)
1559 yychar = yytoken = YYEOF;
1560 YYDPRINTF ((stderr, "Now at end of input.\n"));
1562 else
1564 yytoken = YYTRANSLATE (yychar);
1565 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1568 /* If the proper action on seeing token YYTOKEN is to reduce or to
1569 detect an error, take that action. */
1570 yyn += yytoken;
1571 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1572 goto yydefault;
1573 yyn = yytable[yyn];
1574 if (yyn <= 0)
1576 if (yyn == 0 || yyn == YYTABLE_NINF)
1577 goto yyerrlab;
1578 yyn = -yyn;
1579 goto yyreduce;
1582 /* Count tokens shifted since error; after three, turn off error
1583 status. */
1584 if (yyerrstatus)
1585 yyerrstatus--;
1587 /* Shift the lookahead token. */
1588 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1590 /* Discard the shifted token. */
1591 yychar = YYEMPTY;
1593 yystate = yyn;
1594 *++yyvsp = yylval;
1596 goto yynewstate;
1599 /*-----------------------------------------------------------.
1600 | yydefault -- do the default action for the current state. |
1601 `-----------------------------------------------------------*/
1602 yydefault:
1603 yyn = yydefact[yystate];
1604 if (yyn == 0)
1605 goto yyerrlab;
1606 goto yyreduce;
1609 /*-----------------------------.
1610 | yyreduce -- Do a reduction. |
1611 `-----------------------------*/
1612 yyreduce:
1613 /* yyn is the number of a rule to reduce with. */
1614 yylen = yyr2[yyn];
1616 /* If YYLEN is nonzero, implement the default value of the action:
1617 `$$ = $1'.
1619 Otherwise, the following line sets YYVAL to garbage.
1620 This behavior is undocumented and Bison
1621 users should not rely upon it. Assigning to YYVAL
1622 unconditionally makes the parser a bit smaller, and it avoids a
1623 GCC warning that YYVAL may be used uninitialized. */
1624 yyval = yyvsp[1-yylen];
1627 YY_REDUCE_PRINT (yyn);
1628 switch (yyn)
1630 case 2:
1632 /* Line 1455 of yacc.c */
1633 #line 119 "parse.y"
1634 { /* add default rule */
1635 int def_rule;
1637 pat = cclinit();
1638 cclnegate( pat );
1640 def_rule = mkstate( -pat );
1642 /* Remember the number of the default rule so we
1643 * don't generate "can't match" warnings for it.
1645 default_rule = num_rules;
1647 finish_rule( def_rule, false, 0, 0, 0);
1649 for ( i = 1; i <= lastsc; ++i )
1650 scset[i] = mkbranch( scset[i], def_rule );
1652 if ( spprdflt )
1653 add_action(
1654 "YY_FATAL_ERROR( \"flex scanner jammed\" )" );
1655 else
1656 add_action( "ECHO" );
1658 add_action( ";\n\tYY_BREAK\n" );
1660 break;
1662 case 3:
1664 /* Line 1455 of yacc.c */
1665 #line 148 "parse.y"
1666 { /* initialize for processing rules */
1668 /* Create default DFA start condition. */
1669 scinstal( "INITIAL", false );
1671 break;
1673 case 7:
1675 /* Line 1455 of yacc.c */
1676 #line 159 "parse.y"
1677 { synerr( _("unknown error processing section 1") ); }
1678 break;
1680 case 8:
1682 /* Line 1455 of yacc.c */
1683 #line 163 "parse.y"
1685 check_options();
1686 scon_stk = allocate_integer_array( lastsc + 1 );
1687 scon_stk_ptr = 0;
1689 break;
1691 case 9:
1693 /* Line 1455 of yacc.c */
1694 #line 171 "parse.y"
1695 { xcluflg = false; }
1696 break;
1698 case 10:
1700 /* Line 1455 of yacc.c */
1701 #line 174 "parse.y"
1702 { xcluflg = true; }
1703 break;
1705 case 11:
1707 /* Line 1455 of yacc.c */
1708 #line 178 "parse.y"
1709 { scinstal( nmstr, xcluflg ); }
1710 break;
1712 case 12:
1714 /* Line 1455 of yacc.c */
1715 #line 181 "parse.y"
1716 { scinstal( nmstr, xcluflg ); }
1717 break;
1719 case 13:
1721 /* Line 1455 of yacc.c */
1722 #line 184 "parse.y"
1723 { synerr( _("bad start condition list") ); }
1724 break;
1726 case 17:
1728 /* Line 1455 of yacc.c */
1729 #line 195 "parse.y"
1731 outfilename = copy_string( nmstr );
1732 did_outfilename = 1;
1734 break;
1736 case 18:
1738 /* Line 1455 of yacc.c */
1739 #line 200 "parse.y"
1740 { extra_type = copy_string( nmstr ); }
1741 break;
1743 case 19:
1745 /* Line 1455 of yacc.c */
1746 #line 202 "parse.y"
1747 { prefix = copy_string( nmstr ); }
1748 break;
1750 case 20:
1752 /* Line 1455 of yacc.c */
1753 #line 204 "parse.y"
1754 { yyclass = copy_string( nmstr ); }
1755 break;
1757 case 21:
1759 /* Line 1455 of yacc.c */
1760 #line 206 "parse.y"
1761 { headerfilename = copy_string( nmstr ); }
1762 break;
1764 case 22:
1766 /* Line 1455 of yacc.c */
1767 #line 208 "parse.y"
1768 { tablesext = true; tablesfilename = copy_string( nmstr ); }
1769 break;
1771 case 23:
1773 /* Line 1455 of yacc.c */
1774 #line 212 "parse.y"
1775 { scon_stk_ptr = (yyvsp[(2) - (5)]); }
1776 break;
1778 case 24:
1780 /* Line 1455 of yacc.c */
1781 #line 214 "parse.y"
1782 { scon_stk_ptr = (yyvsp[(2) - (5)]); }
1783 break;
1785 case 26:
1787 /* Line 1455 of yacc.c */
1788 #line 219 "parse.y"
1790 /* Initialize for a parse of one rule. */
1791 trlcontxt = variable_trail_rule = varlength = false;
1792 trailcnt = headcnt = rulelen = 0;
1793 current_state_type = STATE_NORMAL;
1794 previous_continued_action = continued_action;
1795 in_rule = true;
1797 new_rule();
1799 break;
1801 case 27:
1803 /* Line 1455 of yacc.c */
1804 #line 232 "parse.y"
1806 pat = (yyvsp[(2) - (2)]);
1807 finish_rule( pat, variable_trail_rule,
1808 headcnt, trailcnt , previous_continued_action);
1810 if ( scon_stk_ptr > 0 )
1812 for ( i = 1; i <= scon_stk_ptr; ++i )
1813 scbol[scon_stk[i]] =
1814 mkbranch( scbol[scon_stk[i]],
1815 pat );
1818 else
1820 /* Add to all non-exclusive start conditions,
1821 * including the default (0) start condition.
1824 for ( i = 1; i <= lastsc; ++i )
1825 if ( ! scxclu[i] )
1826 scbol[i] = mkbranch( scbol[i],
1827 pat );
1830 if ( ! bol_needed )
1832 bol_needed = true;
1834 if ( performance_report > 1 )
1835 pinpoint_message(
1836 "'^' operator results in sub-optimal performance" );
1839 break;
1841 case 28:
1843 /* Line 1455 of yacc.c */
1844 #line 268 "parse.y"
1846 pat = (yyvsp[(1) - (1)]);
1847 finish_rule( pat, variable_trail_rule,
1848 headcnt, trailcnt , previous_continued_action);
1850 if ( scon_stk_ptr > 0 )
1852 for ( i = 1; i <= scon_stk_ptr; ++i )
1853 scset[scon_stk[i]] =
1854 mkbranch( scset[scon_stk[i]],
1855 pat );
1858 else
1860 for ( i = 1; i <= lastsc; ++i )
1861 if ( ! scxclu[i] )
1862 scset[i] =
1863 mkbranch( scset[i],
1864 pat );
1867 break;
1869 case 29:
1871 /* Line 1455 of yacc.c */
1872 #line 292 "parse.y"
1874 if ( scon_stk_ptr > 0 )
1875 build_eof_action();
1877 else
1879 /* This EOF applies to all start conditions
1880 * which don't already have EOF actions.
1882 for ( i = 1; i <= lastsc; ++i )
1883 if ( ! sceof[i] )
1884 scon_stk[++scon_stk_ptr] = i;
1886 if ( scon_stk_ptr == 0 )
1887 warn(
1888 "all start conditions already have <<EOF>> rules" );
1890 else
1891 build_eof_action();
1894 break;
1896 case 30:
1898 /* Line 1455 of yacc.c */
1899 #line 315 "parse.y"
1900 { synerr( _("unrecognized rule") ); }
1901 break;
1903 case 31:
1905 /* Line 1455 of yacc.c */
1906 #line 319 "parse.y"
1907 { (yyval) = scon_stk_ptr; }
1908 break;
1910 case 32:
1912 /* Line 1455 of yacc.c */
1913 #line 323 "parse.y"
1914 { (yyval) = (yyvsp[(2) - (4)]); }
1915 break;
1917 case 33:
1919 /* Line 1455 of yacc.c */
1920 #line 326 "parse.y"
1922 (yyval) = scon_stk_ptr;
1924 for ( i = 1; i <= lastsc; ++i )
1926 int j;
1928 for ( j = 1; j <= scon_stk_ptr; ++j )
1929 if ( scon_stk[j] == i )
1930 break;
1932 if ( j > scon_stk_ptr )
1933 scon_stk[++scon_stk_ptr] = i;
1936 break;
1938 case 34:
1940 /* Line 1455 of yacc.c */
1941 #line 343 "parse.y"
1942 { (yyval) = scon_stk_ptr; }
1943 break;
1945 case 37:
1947 /* Line 1455 of yacc.c */
1948 #line 351 "parse.y"
1949 { synerr( _("bad start condition list") ); }
1950 break;
1952 case 38:
1954 /* Line 1455 of yacc.c */
1955 #line 355 "parse.y"
1957 if ( (scnum = sclookup( nmstr )) == 0 )
1958 format_pinpoint_message(
1959 "undeclared start condition %s",
1960 nmstr );
1961 else
1963 for ( i = 1; i <= scon_stk_ptr; ++i )
1964 if ( scon_stk[i] == scnum )
1966 format_warn(
1967 "<%s> specified twice",
1968 scname[scnum] );
1969 break;
1972 if ( i > scon_stk_ptr )
1973 scon_stk[++scon_stk_ptr] = scnum;
1976 break;
1978 case 39:
1980 /* Line 1455 of yacc.c */
1981 #line 378 "parse.y"
1983 if ( transchar[lastst[(yyvsp[(2) - (2)])]] != SYM_EPSILON )
1984 /* Provide final transition \now/ so it
1985 * will be marked as a trailing context
1986 * state.
1988 (yyvsp[(2) - (2)]) = link_machines( (yyvsp[(2) - (2)]),
1989 mkstate( SYM_EPSILON ) );
1991 mark_beginning_as_normal( (yyvsp[(2) - (2)]) );
1992 current_state_type = STATE_NORMAL;
1994 if ( previous_continued_action )
1996 /* We need to treat this as variable trailing
1997 * context so that the backup does not happen
1998 * in the action but before the action switch
1999 * statement. If the backup happens in the
2000 * action, then the rules "falling into" this
2001 * one's action will *also* do the backup,
2002 * erroneously.
2004 if ( ! varlength || headcnt != 0 )
2005 warn(
2006 "trailing context made variable due to preceding '|' action" );
2008 /* Mark as variable. */
2009 varlength = true;
2010 headcnt = 0;
2014 if ( lex_compat || (varlength && headcnt == 0) )
2015 { /* variable trailing context rule */
2016 /* Mark the first part of the rule as the
2017 * accepting "head" part of a trailing
2018 * context rule.
2020 * By the way, we didn't do this at the
2021 * beginning of this production because back
2022 * then current_state_type was set up for a
2023 * trail rule, and add_accept() can create
2024 * a new state ...
2026 add_accept( (yyvsp[(1) - (2)]),
2027 num_rules | YY_TRAILING_HEAD_MASK );
2028 variable_trail_rule = true;
2031 else
2032 trailcnt = rulelen;
2034 (yyval) = link_machines( (yyvsp[(1) - (2)]), (yyvsp[(2) - (2)]) );
2036 break;
2038 case 40:
2040 /* Line 1455 of yacc.c */
2041 #line 434 "parse.y"
2042 { synerr( _("trailing context used twice") ); }
2043 break;
2045 case 41:
2047 /* Line 1455 of yacc.c */
2048 #line 437 "parse.y"
2050 headcnt = 0;
2051 trailcnt = 1;
2052 rulelen = 1;
2053 varlength = false;
2055 current_state_type = STATE_TRAILING_CONTEXT;
2057 if ( trlcontxt )
2059 synerr( _("trailing context used twice") );
2060 (yyval) = mkstate( SYM_EPSILON );
2063 else if ( previous_continued_action )
2065 /* See the comment in the rule for "re2 re"
2066 * above.
2068 warn(
2069 "trailing context made variable due to preceding '|' action" );
2071 varlength = true;
2074 if ( lex_compat || varlength )
2076 /* Again, see the comment in the rule for
2077 * "re2 re" above.
2079 add_accept( (yyvsp[(1) - (2)]),
2080 num_rules | YY_TRAILING_HEAD_MASK );
2081 variable_trail_rule = true;
2084 trlcontxt = true;
2086 eps = mkstate( SYM_EPSILON );
2087 (yyval) = link_machines( (yyvsp[(1) - (2)]),
2088 link_machines( eps, mkstate( '\n' ) ) );
2090 break;
2092 case 42:
2094 /* Line 1455 of yacc.c */
2095 #line 480 "parse.y"
2097 (yyval) = (yyvsp[(1) - (1)]);
2099 if ( trlcontxt )
2101 if ( lex_compat || (varlength && headcnt == 0) )
2102 /* Both head and trail are
2103 * variable-length.
2105 variable_trail_rule = true;
2106 else
2107 trailcnt = rulelen;
2110 break;
2112 case 43:
2114 /* Line 1455 of yacc.c */
2115 #line 498 "parse.y"
2117 varlength = true;
2118 (yyval) = mkor( (yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]) );
2120 break;
2122 case 44:
2124 /* Line 1455 of yacc.c */
2125 #line 504 "parse.y"
2126 { (yyval) = (yyvsp[(1) - (1)]); }
2127 break;
2129 case 45:
2131 /* Line 1455 of yacc.c */
2132 #line 509 "parse.y"
2134 /* This rule is written separately so the
2135 * reduction will occur before the trailing
2136 * series is parsed.
2139 if ( trlcontxt )
2140 synerr( _("trailing context used twice") );
2141 else
2142 trlcontxt = true;
2144 if ( varlength )
2145 /* We hope the trailing context is
2146 * fixed-length.
2148 varlength = false;
2149 else
2150 headcnt = rulelen;
2152 rulelen = 0;
2154 current_state_type = STATE_TRAILING_CONTEXT;
2155 (yyval) = (yyvsp[(1) - (2)]);
2157 break;
2159 case 46:
2161 /* Line 1455 of yacc.c */
2162 #line 536 "parse.y"
2164 /* This is where concatenation of adjacent patterns
2165 * gets done.
2167 (yyval) = link_machines( (yyvsp[(1) - (2)]), (yyvsp[(2) - (2)]) );
2169 break;
2171 case 47:
2173 /* Line 1455 of yacc.c */
2174 #line 544 "parse.y"
2175 { (yyval) = (yyvsp[(1) - (1)]); }
2176 break;
2178 case 48:
2180 /* Line 1455 of yacc.c */
2181 #line 547 "parse.y"
2183 varlength = true;
2185 if ( (yyvsp[(3) - (6)]) > (yyvsp[(5) - (6)]) || (yyvsp[(3) - (6)]) < 0 )
2187 synerr( _("bad iteration values") );
2188 (yyval) = (yyvsp[(1) - (6)]);
2190 else
2192 if ( (yyvsp[(3) - (6)]) == 0 )
2194 if ( (yyvsp[(5) - (6)]) <= 0 )
2196 synerr(
2197 _("bad iteration values") );
2198 (yyval) = (yyvsp[(1) - (6)]);
2200 else
2201 (yyval) = mkopt(
2202 mkrep( (yyvsp[(1) - (6)]), 1, (yyvsp[(5) - (6)]) ) );
2204 else
2205 (yyval) = mkrep( (yyvsp[(1) - (6)]), (yyvsp[(3) - (6)]), (yyvsp[(5) - (6)]) );
2208 break;
2210 case 49:
2212 /* Line 1455 of yacc.c */
2213 #line 575 "parse.y"
2215 varlength = true;
2217 if ( (yyvsp[(3) - (5)]) <= 0 )
2219 synerr( _("iteration value must be positive") );
2220 (yyval) = (yyvsp[(1) - (5)]);
2223 else
2224 (yyval) = mkrep( (yyvsp[(1) - (5)]), (yyvsp[(3) - (5)]), INFINITE_REPEAT );
2226 break;
2228 case 50:
2230 /* Line 1455 of yacc.c */
2231 #line 589 "parse.y"
2233 /* The series could be something like "(foo)",
2234 * in which case we have no idea what its length
2235 * is, so we punt here.
2237 varlength = true;
2239 if ( (yyvsp[(3) - (4)]) <= 0 )
2241 synerr( _("iteration value must be positive")
2243 (yyval) = (yyvsp[(1) - (4)]);
2246 else
2247 (yyval) = link_machines( (yyvsp[(1) - (4)]),
2248 copysingl( (yyvsp[(1) - (4)]), (yyvsp[(3) - (4)]) - 1 ) );
2250 break;
2252 case 51:
2254 /* Line 1455 of yacc.c */
2255 #line 611 "parse.y"
2257 varlength = true;
2259 (yyval) = mkclos( (yyvsp[(1) - (2)]) );
2261 break;
2263 case 52:
2265 /* Line 1455 of yacc.c */
2266 #line 618 "parse.y"
2268 varlength = true;
2269 (yyval) = mkposcl( (yyvsp[(1) - (2)]) );
2271 break;
2273 case 53:
2275 /* Line 1455 of yacc.c */
2276 #line 624 "parse.y"
2278 varlength = true;
2279 (yyval) = mkopt( (yyvsp[(1) - (2)]) );
2281 break;
2283 case 54:
2285 /* Line 1455 of yacc.c */
2286 #line 630 "parse.y"
2288 varlength = true;
2290 if ( (yyvsp[(3) - (6)]) > (yyvsp[(5) - (6)]) || (yyvsp[(3) - (6)]) < 0 )
2292 synerr( _("bad iteration values") );
2293 (yyval) = (yyvsp[(1) - (6)]);
2295 else
2297 if ( (yyvsp[(3) - (6)]) == 0 )
2299 if ( (yyvsp[(5) - (6)]) <= 0 )
2301 synerr(
2302 _("bad iteration values") );
2303 (yyval) = (yyvsp[(1) - (6)]);
2305 else
2306 (yyval) = mkopt(
2307 mkrep( (yyvsp[(1) - (6)]), 1, (yyvsp[(5) - (6)]) ) );
2309 else
2310 (yyval) = mkrep( (yyvsp[(1) - (6)]), (yyvsp[(3) - (6)]), (yyvsp[(5) - (6)]) );
2313 break;
2315 case 55:
2317 /* Line 1455 of yacc.c */
2318 #line 658 "parse.y"
2320 varlength = true;
2322 if ( (yyvsp[(3) - (5)]) <= 0 )
2324 synerr( _("iteration value must be positive") );
2325 (yyval) = (yyvsp[(1) - (5)]);
2328 else
2329 (yyval) = mkrep( (yyvsp[(1) - (5)]), (yyvsp[(3) - (5)]), INFINITE_REPEAT );
2331 break;
2333 case 56:
2335 /* Line 1455 of yacc.c */
2336 #line 672 "parse.y"
2338 /* The singleton could be something like "(foo)",
2339 * in which case we have no idea what its length
2340 * is, so we punt here.
2342 varlength = true;
2344 if ( (yyvsp[(3) - (4)]) <= 0 )
2346 synerr( _("iteration value must be positive") );
2347 (yyval) = (yyvsp[(1) - (4)]);
2350 else
2351 (yyval) = link_machines( (yyvsp[(1) - (4)]),
2352 copysingl( (yyvsp[(1) - (4)]), (yyvsp[(3) - (4)]) - 1 ) );
2354 break;
2356 case 57:
2358 /* Line 1455 of yacc.c */
2359 #line 691 "parse.y"
2361 if ( ! madeany )
2363 /* Create the '.' character class. */
2364 ccldot = cclinit();
2365 ccladd( ccldot, '\n' );
2366 cclnegate( ccldot );
2368 if ( useecs )
2369 mkeccl( ccltbl + cclmap[ccldot],
2370 ccllen[ccldot], nextecm,
2371 ecgroup, csize, csize );
2373 /* Create the (?s:'.') character class. */
2374 cclany = cclinit();
2375 cclnegate( cclany );
2377 if ( useecs )
2378 mkeccl( ccltbl + cclmap[cclany],
2379 ccllen[cclany], nextecm,
2380 ecgroup, csize, csize );
2382 madeany = true;
2385 ++rulelen;
2387 if (sf_dot_all())
2388 (yyval) = mkstate( -cclany );
2389 else
2390 (yyval) = mkstate( -ccldot );
2392 break;
2394 case 58:
2396 /* Line 1455 of yacc.c */
2397 #line 725 "parse.y"
2399 /* Sort characters for fast searching.
2401 qsort( ccltbl + cclmap[(yyvsp[(1) - (1)])], ccllen[(yyvsp[(1) - (1)])], sizeof (*ccltbl), cclcmp );
2403 if ( useecs )
2404 mkeccl( ccltbl + cclmap[(yyvsp[(1) - (1)])], ccllen[(yyvsp[(1) - (1)])],
2405 nextecm, ecgroup, csize, csize );
2407 ++rulelen;
2409 if (ccl_has_nl[(yyvsp[(1) - (1)])])
2410 rule_has_nl[num_rules] = true;
2412 (yyval) = mkstate( -(yyvsp[(1) - (1)]) );
2414 break;
2416 case 59:
2418 /* Line 1455 of yacc.c */
2419 #line 743 "parse.y"
2421 ++rulelen;
2423 if (ccl_has_nl[(yyvsp[(1) - (1)])])
2424 rule_has_nl[num_rules] = true;
2426 (yyval) = mkstate( -(yyvsp[(1) - (1)]) );
2428 break;
2430 case 60:
2432 /* Line 1455 of yacc.c */
2433 #line 753 "parse.y"
2434 { (yyval) = (yyvsp[(2) - (3)]); }
2435 break;
2437 case 61:
2439 /* Line 1455 of yacc.c */
2440 #line 756 "parse.y"
2441 { (yyval) = (yyvsp[(2) - (3)]); }
2442 break;
2444 case 62:
2446 /* Line 1455 of yacc.c */
2447 #line 759 "parse.y"
2449 ++rulelen;
2451 if ((yyvsp[(1) - (1)]) == nlch)
2452 rule_has_nl[num_rules] = true;
2454 if (sf_case_ins() && has_case((yyvsp[(1) - (1)])))
2455 /* create an alternation, as in (a|A) */
2456 (yyval) = mkor (mkstate((yyvsp[(1) - (1)])), mkstate(reverse_case((yyvsp[(1) - (1)]))));
2457 else
2458 (yyval) = mkstate( (yyvsp[(1) - (1)]) );
2460 break;
2462 case 63:
2464 /* Line 1455 of yacc.c */
2465 #line 773 "parse.y"
2466 { (yyval) = ccl_set_diff ((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)])); }
2467 break;
2469 case 64:
2471 /* Line 1455 of yacc.c */
2472 #line 774 "parse.y"
2473 { (yyval) = ccl_set_union ((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)])); }
2474 break;
2476 case 66:
2478 /* Line 1455 of yacc.c */
2479 #line 780 "parse.y"
2480 { (yyval) = (yyvsp[(2) - (3)]); }
2481 break;
2483 case 67:
2485 /* Line 1455 of yacc.c */
2486 #line 783 "parse.y"
2488 cclnegate( (yyvsp[(3) - (4)]) );
2489 (yyval) = (yyvsp[(3) - (4)]);
2491 break;
2493 case 68:
2495 /* Line 1455 of yacc.c */
2496 #line 790 "parse.y"
2499 if (sf_case_ins())
2502 /* If one end of the range has case and the other
2503 * does not, or the cases are different, then we're not
2504 * sure what range the user is trying to express.
2505 * Examples: [@-z] or [S-t]
2507 if (has_case ((yyvsp[(2) - (4)])) != has_case ((yyvsp[(4) - (4)]))
2508 || (has_case ((yyvsp[(2) - (4)])) && (b_islower ((yyvsp[(2) - (4)])) != b_islower ((yyvsp[(4) - (4)]))))
2509 || (has_case ((yyvsp[(2) - (4)])) && (b_isupper ((yyvsp[(2) - (4)])) != b_isupper ((yyvsp[(4) - (4)])))))
2510 format_warn3 (
2511 _("the character range [%c-%c] is ambiguous in a case-insensitive scanner"),
2512 (yyvsp[(2) - (4)]), (yyvsp[(4) - (4)]));
2514 /* If the range spans uppercase characters but not
2515 * lowercase (or vice-versa), then should we automatically
2516 * include lowercase characters in the range?
2517 * Example: [@-_] spans [a-z] but not [A-Z]
2519 else if (!has_case ((yyvsp[(2) - (4)])) && !has_case ((yyvsp[(4) - (4)])) && !range_covers_case ((yyvsp[(2) - (4)]), (yyvsp[(4) - (4)])))
2520 format_warn3 (
2521 _("the character range [%c-%c] is ambiguous in a case-insensitive scanner"),
2522 (yyvsp[(2) - (4)]), (yyvsp[(4) - (4)]));
2525 if ( (yyvsp[(2) - (4)]) > (yyvsp[(4) - (4)]) )
2526 synerr( _("negative range in character class") );
2528 else
2530 for ( i = (yyvsp[(2) - (4)]); i <= (yyvsp[(4) - (4)]); ++i )
2531 ccladd( (yyvsp[(1) - (4)]), i );
2533 /* Keep track if this ccl is staying in
2534 * alphabetical order.
2536 cclsorted = cclsorted && ((yyvsp[(2) - (4)]) > lastchar);
2537 lastchar = (yyvsp[(4) - (4)]);
2539 /* Do it again for upper/lowercase */
2540 if (sf_case_ins() && has_case((yyvsp[(2) - (4)])) && has_case((yyvsp[(4) - (4)]))){
2541 (yyvsp[(2) - (4)]) = reverse_case ((yyvsp[(2) - (4)]));
2542 (yyvsp[(4) - (4)]) = reverse_case ((yyvsp[(4) - (4)]));
2544 for ( i = (yyvsp[(2) - (4)]); i <= (yyvsp[(4) - (4)]); ++i )
2545 ccladd( (yyvsp[(1) - (4)]), i );
2547 cclsorted = cclsorted && ((yyvsp[(2) - (4)]) > lastchar);
2548 lastchar = (yyvsp[(4) - (4)]);
2553 (yyval) = (yyvsp[(1) - (4)]);
2555 break;
2557 case 69:
2559 /* Line 1455 of yacc.c */
2560 #line 850 "parse.y"
2562 ccladd( (yyvsp[(1) - (2)]), (yyvsp[(2) - (2)]) );
2563 cclsorted = cclsorted && ((yyvsp[(2) - (2)]) > lastchar);
2564 lastchar = (yyvsp[(2) - (2)]);
2566 /* Do it again for upper/lowercase */
2567 if (sf_case_ins() && has_case((yyvsp[(2) - (2)]))){
2568 (yyvsp[(2) - (2)]) = reverse_case ((yyvsp[(2) - (2)]));
2569 ccladd ((yyvsp[(1) - (2)]), (yyvsp[(2) - (2)]));
2571 cclsorted = cclsorted && ((yyvsp[(2) - (2)]) > lastchar);
2572 lastchar = (yyvsp[(2) - (2)]);
2575 (yyval) = (yyvsp[(1) - (2)]);
2577 break;
2579 case 70:
2581 /* Line 1455 of yacc.c */
2582 #line 868 "parse.y"
2584 /* Too hard to properly maintain cclsorted. */
2585 cclsorted = false;
2586 (yyval) = (yyvsp[(1) - (2)]);
2588 break;
2590 case 71:
2592 /* Line 1455 of yacc.c */
2593 #line 875 "parse.y"
2595 cclsorted = true;
2596 lastchar = 0;
2597 currccl = (yyval) = cclinit();
2599 break;
2601 case 72:
2603 /* Line 1455 of yacc.c */
2604 #line 883 "parse.y"
2605 { CCL_EXPR(isalnum); }
2606 break;
2608 case 73:
2610 /* Line 1455 of yacc.c */
2611 #line 884 "parse.y"
2612 { CCL_EXPR(isalpha); }
2613 break;
2615 case 74:
2617 /* Line 1455 of yacc.c */
2618 #line 885 "parse.y"
2619 { CCL_EXPR(IS_BLANK); }
2620 break;
2622 case 75:
2624 /* Line 1455 of yacc.c */
2625 #line 886 "parse.y"
2626 { CCL_EXPR(iscntrl); }
2627 break;
2629 case 76:
2631 /* Line 1455 of yacc.c */
2632 #line 887 "parse.y"
2633 { CCL_EXPR(isdigit); }
2634 break;
2636 case 77:
2638 /* Line 1455 of yacc.c */
2639 #line 888 "parse.y"
2640 { CCL_EXPR(isgraph); }
2641 break;
2643 case 78:
2645 /* Line 1455 of yacc.c */
2646 #line 889 "parse.y"
2648 CCL_EXPR(islower);
2649 if (sf_case_ins())
2650 CCL_EXPR(isupper);
2652 break;
2654 case 79:
2656 /* Line 1455 of yacc.c */
2657 #line 894 "parse.y"
2658 { CCL_EXPR(isprint); }
2659 break;
2661 case 80:
2663 /* Line 1455 of yacc.c */
2664 #line 895 "parse.y"
2665 { CCL_EXPR(ispunct); }
2666 break;
2668 case 81:
2670 /* Line 1455 of yacc.c */
2671 #line 896 "parse.y"
2672 { CCL_EXPR(isspace); }
2673 break;
2675 case 82:
2677 /* Line 1455 of yacc.c */
2678 #line 897 "parse.y"
2679 { CCL_EXPR(isxdigit); }
2680 break;
2682 case 83:
2684 /* Line 1455 of yacc.c */
2685 #line 898 "parse.y"
2687 CCL_EXPR(isupper);
2688 if (sf_case_ins())
2689 CCL_EXPR(islower);
2691 break;
2693 case 84:
2695 /* Line 1455 of yacc.c */
2696 #line 904 "parse.y"
2697 { CCL_NEG_EXPR(isalnum); }
2698 break;
2700 case 85:
2702 /* Line 1455 of yacc.c */
2703 #line 905 "parse.y"
2704 { CCL_NEG_EXPR(isalpha); }
2705 break;
2707 case 86:
2709 /* Line 1455 of yacc.c */
2710 #line 906 "parse.y"
2711 { CCL_NEG_EXPR(IS_BLANK); }
2712 break;
2714 case 87:
2716 /* Line 1455 of yacc.c */
2717 #line 907 "parse.y"
2718 { CCL_NEG_EXPR(iscntrl); }
2719 break;
2721 case 88:
2723 /* Line 1455 of yacc.c */
2724 #line 908 "parse.y"
2725 { CCL_NEG_EXPR(isdigit); }
2726 break;
2728 case 89:
2730 /* Line 1455 of yacc.c */
2731 #line 909 "parse.y"
2732 { CCL_NEG_EXPR(isgraph); }
2733 break;
2735 case 90:
2737 /* Line 1455 of yacc.c */
2738 #line 910 "parse.y"
2739 { CCL_NEG_EXPR(isprint); }
2740 break;
2742 case 91:
2744 /* Line 1455 of yacc.c */
2745 #line 911 "parse.y"
2746 { CCL_NEG_EXPR(ispunct); }
2747 break;
2749 case 92:
2751 /* Line 1455 of yacc.c */
2752 #line 912 "parse.y"
2753 { CCL_NEG_EXPR(isspace); }
2754 break;
2756 case 93:
2758 /* Line 1455 of yacc.c */
2759 #line 913 "parse.y"
2760 { CCL_NEG_EXPR(isxdigit); }
2761 break;
2763 case 94:
2765 /* Line 1455 of yacc.c */
2766 #line 914 "parse.y"
2768 if ( sf_case_ins() )
2769 warn(_("[:^lower:] is ambiguous in case insensitive scanner"));
2770 else
2771 CCL_NEG_EXPR(islower);
2773 break;
2775 case 95:
2777 /* Line 1455 of yacc.c */
2778 #line 920 "parse.y"
2780 if ( sf_case_ins() )
2781 warn(_("[:^upper:] ambiguous in case insensitive scanner"));
2782 else
2783 CCL_NEG_EXPR(isupper);
2785 break;
2787 case 96:
2789 /* Line 1455 of yacc.c */
2790 #line 929 "parse.y"
2792 if ( (yyvsp[(2) - (2)]) == nlch )
2793 rule_has_nl[num_rules] = true;
2795 ++rulelen;
2797 if (sf_case_ins() && has_case((yyvsp[(2) - (2)])))
2798 (yyval) = mkor (mkstate((yyvsp[(2) - (2)])), mkstate(reverse_case((yyvsp[(2) - (2)]))));
2799 else
2800 (yyval) = mkstate ((yyvsp[(2) - (2)]));
2802 (yyval) = link_machines( (yyvsp[(1) - (2)]), (yyval));
2804 break;
2806 case 97:
2808 /* Line 1455 of yacc.c */
2809 #line 944 "parse.y"
2810 { (yyval) = mkstate( SYM_EPSILON ); }
2811 break;
2815 /* Line 1455 of yacc.c */
2816 #line 2817 "parse.c"
2817 default: break;
2819 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
2821 YYPOPSTACK (yylen);
2822 yylen = 0;
2823 YY_STACK_PRINT (yyss, yyssp);
2825 *++yyvsp = yyval;
2827 /* Now `shift' the result of the reduction. Determine what state
2828 that goes to, based on the state we popped back to and the rule
2829 number reduced by. */
2831 yyn = yyr1[yyn];
2833 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
2834 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
2835 yystate = yytable[yystate];
2836 else
2837 yystate = yydefgoto[yyn - YYNTOKENS];
2839 goto yynewstate;
2842 /*------------------------------------.
2843 | yyerrlab -- here on detecting error |
2844 `------------------------------------*/
2845 yyerrlab:
2846 /* If not already recovering from an error, report this error. */
2847 if (!yyerrstatus)
2849 ++yynerrs;
2850 #if ! YYERROR_VERBOSE
2851 yyerror (YY_("syntax error"));
2852 #else
2854 YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
2855 if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
2857 YYSIZE_T yyalloc = 2 * yysize;
2858 if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
2859 yyalloc = YYSTACK_ALLOC_MAXIMUM;
2860 if (yymsg != yymsgbuf)
2861 YYSTACK_FREE (yymsg);
2862 yymsg = (char *) YYSTACK_ALLOC (yyalloc);
2863 if (yymsg)
2864 yymsg_alloc = yyalloc;
2865 else
2867 yymsg = yymsgbuf;
2868 yymsg_alloc = sizeof yymsgbuf;
2872 if (0 < yysize && yysize <= yymsg_alloc)
2874 (void) yysyntax_error (yymsg, yystate, yychar);
2875 yyerror (yymsg);
2877 else
2879 yyerror (YY_("syntax error"));
2880 if (yysize != 0)
2881 goto yyexhaustedlab;
2884 #endif
2889 if (yyerrstatus == 3)
2891 /* If just tried and failed to reuse lookahead token after an
2892 error, discard it. */
2894 if (yychar <= YYEOF)
2896 /* Return failure if at end of input. */
2897 if (yychar == YYEOF)
2898 YYABORT;
2900 else
2902 yydestruct ("Error: discarding",
2903 yytoken, &yylval);
2904 yychar = YYEMPTY;
2908 /* Else will try to reuse lookahead token after shifting the error
2909 token. */
2910 goto yyerrlab1;
2913 /*---------------------------------------------------.
2914 | yyerrorlab -- error raised explicitly by YYERROR. |
2915 `---------------------------------------------------*/
2916 yyerrorlab:
2918 /* Pacify compilers like GCC when the user code never invokes
2919 YYERROR and the label yyerrorlab therefore never appears in user
2920 code. */
2921 if (/*CONSTCOND*/ 0)
2922 goto yyerrorlab;
2924 /* Do not reclaim the symbols of the rule which action triggered
2925 this YYERROR. */
2926 YYPOPSTACK (yylen);
2927 yylen = 0;
2928 YY_STACK_PRINT (yyss, yyssp);
2929 yystate = *yyssp;
2930 goto yyerrlab1;
2933 /*-------------------------------------------------------------.
2934 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2935 `-------------------------------------------------------------*/
2936 yyerrlab1:
2937 yyerrstatus = 3; /* Each real token shifted decrements this. */
2939 for (;;)
2941 yyn = yypact[yystate];
2942 if (yyn != YYPACT_NINF)
2944 yyn += YYTERROR;
2945 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
2947 yyn = yytable[yyn];
2948 if (0 < yyn)
2949 break;
2953 /* Pop the current state because it cannot handle the error token. */
2954 if (yyssp == yyss)
2955 YYABORT;
2958 yydestruct ("Error: popping",
2959 yystos[yystate], yyvsp);
2960 YYPOPSTACK (1);
2961 yystate = *yyssp;
2962 YY_STACK_PRINT (yyss, yyssp);
2965 *++yyvsp = yylval;
2968 /* Shift the error token. */
2969 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
2971 yystate = yyn;
2972 goto yynewstate;
2975 /*-------------------------------------.
2976 | yyacceptlab -- YYACCEPT comes here. |
2977 `-------------------------------------*/
2978 yyacceptlab:
2979 yyresult = 0;
2980 goto yyreturn;
2982 /*-----------------------------------.
2983 | yyabortlab -- YYABORT comes here. |
2984 `-----------------------------------*/
2985 yyabortlab:
2986 yyresult = 1;
2987 goto yyreturn;
2989 #if !defined(yyoverflow) || YYERROR_VERBOSE
2990 /*-------------------------------------------------.
2991 | yyexhaustedlab -- memory exhaustion comes here. |
2992 `-------------------------------------------------*/
2993 yyexhaustedlab:
2994 yyerror (YY_("memory exhausted"));
2995 yyresult = 2;
2996 /* Fall through. */
2997 #endif
2999 yyreturn:
3000 if (yychar != YYEMPTY)
3001 yydestruct ("Cleanup: discarding lookahead",
3002 yytoken, &yylval);
3003 /* Do not reclaim the symbols of the rule which action triggered
3004 this YYABORT or YYACCEPT. */
3005 YYPOPSTACK (yylen);
3006 YY_STACK_PRINT (yyss, yyssp);
3007 while (yyssp != yyss)
3009 yydestruct ("Cleanup: popping",
3010 yystos[*yyssp], yyvsp);
3011 YYPOPSTACK (1);
3013 #ifndef yyoverflow
3014 if (yyss != yyssa)
3015 YYSTACK_FREE (yyss);
3016 #endif
3017 #if YYERROR_VERBOSE
3018 if (yymsg != yymsgbuf)
3019 YYSTACK_FREE (yymsg);
3020 #endif
3021 /* Make sure YYID is used. */
3022 return YYID (yyresult);
3027 /* Line 1675 of yacc.c */
3028 #line 947 "parse.y"
3032 /* build_eof_action - build the "<<EOF>>" action for the active start
3033 * conditions
3036 void build_eof_action()
3038 register int i;
3039 char action_text[MAXLINE];
3041 for ( i = 1; i <= scon_stk_ptr; ++i )
3043 if ( sceof[scon_stk[i]] )
3044 format_pinpoint_message(
3045 "multiple <<EOF>> rules for start condition %s",
3046 scname[scon_stk[i]] );
3048 else
3050 sceof[scon_stk[i]] = true;
3052 if (previous_continued_action /* && previous action was regular */)
3053 add_action("YY_RULE_SETUP\n");
3055 snprintf( action_text, sizeof(action_text), "case YY_STATE_EOF(%s):\n",
3056 scname[scon_stk[i]] );
3057 add_action( action_text );
3061 line_directive_out( (FILE *) 0, 1 );
3063 /* This isn't a normal rule after all - don't count it as
3064 * such, so we don't have any holes in the rule numbering
3065 * (which make generating "rule can never match" warnings
3066 * more difficult.
3068 --num_rules;
3069 ++num_eof_rules;
3073 /* format_synerr - write out formatted syntax error */
3075 void format_synerr( msg, arg )
3076 const char *msg, arg[];
3078 char errmsg[MAXLINE];
3080 (void) snprintf( errmsg, sizeof(errmsg), msg, arg );
3081 synerr( errmsg );
3085 /* synerr - report a syntax error */
3087 void synerr( str )
3088 const char *str;
3090 syntaxerror = true;
3091 pinpoint_message( str );
3095 /* format_warn - write out formatted warning */
3097 void format_warn( msg, arg )
3098 const char *msg, arg[];
3100 char warn_msg[MAXLINE];
3102 snprintf( warn_msg, sizeof(warn_msg), msg, arg );
3103 warn( warn_msg );
3107 /* warn - report a warning, unless -w was given */
3109 void warn( str )
3110 const char *str;
3112 line_warning( str, linenum );
3115 /* format_pinpoint_message - write out a message formatted with one string,
3116 * pinpointing its location
3119 void format_pinpoint_message( msg, arg )
3120 const char *msg, arg[];
3122 char errmsg[MAXLINE];
3124 snprintf( errmsg, sizeof(errmsg), msg, arg );
3125 pinpoint_message( errmsg );
3129 /* pinpoint_message - write out a message, pinpointing its location */
3131 void pinpoint_message( str )
3132 const char *str;
3134 line_pinpoint( str, linenum );
3138 /* line_warning - report a warning at a given line, unless -w was given */
3140 void line_warning( str, line )
3141 const char *str;
3142 int line;
3144 char warning[MAXLINE];
3146 if ( ! nowarn )
3148 snprintf( warning, sizeof(warning), "warning, %s", str );
3149 line_pinpoint( warning, line );
3154 /* line_pinpoint - write out a message, pinpointing it at the given line */
3156 void line_pinpoint( str, line )
3157 const char *str;
3158 int line;
3160 fprintf( stderr, "%s:%d: %s\n", infilename, line, str );
3164 /* yyerror - eat up an error message from the parser;
3165 * currently, messages are ignore
3168 void yyerror( msg )
3169 const char *msg;