Import flex-2.5.37 to new vendor branch
[dragonfly.git] / contrib / flex / parse.c
1
2 /* A Bison parser, made by GNU Bison 2.4.1.  */
3
4 /* Skeleton implementation for Bison's Yacc-like parsers in C
5    
6       Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
7    Free Software Foundation, Inc.
8    
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.
13    
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.
18    
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/>.  */
21
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.
31    
32    This special exception was added by the Free Software Foundation in
33    version 2.2 of Bison.  */
34
35 /* C LALR(1) parser skeleton written by Richard Stallman, by
36    simplifying the original so-called "semantic" parser.  */
37
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.  */
44
45 /* Identify Bison output.  */
46 #define YYBISON 1
47
48 /* Bison version.  */
49 #define YYBISON_VERSION "2.4.1"
50
51 /* Skeleton name.  */
52 #define YYSKELETON_NAME "yacc.c"
53
54 /* Pure parsers.  */
55 #define YYPURE 0
56
57 /* Push parsers.  */
58 #define YYPUSH 0
59
60 /* Pull parsers.  */
61 #define YYPULL 1
62
63 /* Using locations.  */
64 #define YYLSP_NEEDED 0
65
66
67
68 /* Copy the first part of user declarations.  */
69
70 /* Line 189 of yacc.c  */
71 #line 34 "parse.y"
72
73 /*  Copyright (c) 1990 The Regents of the University of California. */
74 /*  All rights reserved. */
75
76 /*  This code is derived from software contributed to Berkeley by */
77 /*  Vern Paxson. */
78
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. */
82
83 /*  This file is part of flex. */
84
85 /*  Redistribution and use in source and binary forms, with or without */
86 /*  modification, are permitted provided that the following conditions */
87 /*  are met: */
88
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. */
94
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. */
98
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. */
103
104 #include "flexdef.h"
105 #include "tables.h"
106
107 int pat, scnum, eps, headcnt, trailcnt, lastchar, i, rulelen;
108 int trlcontxt, xcluflg, currccl, cclsorted, varlength, variable_trail_rule;
109
110 int *scon_stk;
111 int scon_stk_ptr;
112
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 '|' */
116
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)
123
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)
132
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)
141
142 /* While POSIX defines isblank(), it's not ANSI C. */
143 #define IS_BLANK(c) ((c) == ' ' || (c) == '\t')
144
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".
150  */
151 #define YYSTYPE int
152
153
154
155 /* Line 189 of yacc.c  */
156 #line 157 "parse.c"
157
158 /* Enabling traces.  */
159 #ifndef YYDEBUG
160 # define YYDEBUG 0
161 #endif
162
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
170
171 /* Enabling the token table.  */
172 #ifndef YYTOKEN_TABLE
173 # define YYTOKEN_TABLE 0
174 #endif
175
176
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
228    };
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
276
277
278
279
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
286
287
288 /* Copy the second part of user declarations.  */
289
290
291 /* Line 264 of yacc.c  */
292 #line 293 "parse.c"
293
294 #ifdef short
295 # undef short
296 #endif
297
298 #ifdef YYTYPE_UINT8
299 typedef YYTYPE_UINT8 yytype_uint8;
300 #else
301 typedef unsigned char yytype_uint8;
302 #endif
303
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
312
313 #ifdef YYTYPE_UINT16
314 typedef YYTYPE_UINT16 yytype_uint16;
315 #else
316 typedef unsigned short int yytype_uint16;
317 #endif
318
319 #ifdef YYTYPE_INT16
320 typedef YYTYPE_INT16 yytype_int16;
321 #else
322 typedef short int yytype_int16;
323 #endif
324
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
338
339 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
340
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
352
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
359
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
373 {
374   return yyi;
375 }
376 #endif
377
378 #if ! defined yyoverflow || YYERROR_VERBOSE
379
380 /* The parser invokes alloca or malloc; define the necessary symbols.  */
381
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
405
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 */
446
447
448 #if (! defined yyoverflow \
449      && (! defined __cplusplus \
450          || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
451
452 /* A type that is properly aligned for any stack member.  */
453 union yyalloc
454 {
455   yytype_int16 yyss_alloc;
456   YYSTYPE yyvs_alloc;
457 };
458
459 /* The size of the maximum gap between one aligned stack and the next.  */
460 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
461
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)
467
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                                        \
477         {                                       \
478           YYSIZE_T yyi;                         \
479           for (yyi = 0; yyi < (Count); yyi++)   \
480             (To)[yyi] = (From)[yyi];            \
481         }                                       \
482       while (YYID (0))
483 #  endif
484 # endif
485
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                                                                  \
493       {                                                                 \
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);                          \
499       }                                                                 \
500     while (YYID (0))
501
502 #endif
503
504 /* YYFINAL -- State number of the termination state.  */
505 #define YYFINAL  3
506 /* YYLAST -- Last index in YYTABLE.  */
507 #define YYLAST   161
508
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
517
518 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
519 #define YYUNDEFTOK  2
520 #define YYMAXUTOK   302
521
522 #define YYTRANSLATE(YYX)                                                \
523   ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
524
525 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX.  */
526 static const yytype_uint8 yytranslate[] =
527 {
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
559 };
560
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[] =
565 {
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
576 };
577
578 /* YYRHS -- A `-1'-separated list of the rules' RHS.  */
579 static const yytype_int8 yyrhs[] =
580 {
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
609 };
610
611 /* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
612 static const yytype_uint16 yyrline[] =
613 {
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
624 };
625 #endif
626
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[] =
631 {
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
649 };
650 #endif
651
652 # ifdef YYPRINT
653 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
654    token YYLEX-NUM.  */
655 static const yytype_uint16 yytoknum[] =
656 {
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
664 };
665 # endif
666
667 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
668 static const yytype_uint8 yyr1[] =
669 {
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
680 };
681
682 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
683 static const yytype_uint8 yyr2[] =
684 {
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
695 };
696
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[] =
701 {
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
716 };
717
718 /* YYDEFGOTO[NTERM-NUM].  */
719 static const yytype_int8 yydefgoto[] =
720 {
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
724 };
725
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[] =
730 {
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
745 };
746
747 /* YYPGOTO[NTERM-NUM].  */
748 static const yytype_int16 yypgoto[] =
749 {
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
753 };
754
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[] =
761 {
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
779 };
780
781 static const yytype_int8 yycheck[] =
782 {
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
800 };
801
802 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
803    symbol of state STATE-NUM.  */
804 static const yytype_uint8 yystos[] =
805 {
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
820 };
821
822 #define yyerrok         (yyerrstatus = 0)
823 #define yyclearin       (yychar = YYEMPTY)
824 #define YYEMPTY         (-2)
825 #define YYEOF           0
826
827 #define YYACCEPT        goto yyacceptlab
828 #define YYABORT         goto yyabortlab
829 #define YYERROR         goto yyerrorlab
830
831
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.  */
835
836 #define YYFAIL          goto yyerrlab
837
838 #define YYRECOVERING()  (!!yyerrstatus)
839
840 #define YYBACKUP(Token, Value)                                  \
841 do                                                              \
842   if (yychar == YYEMPTY && yylen == 1)                          \
843     {                                                           \
844       yychar = (Token);                                         \
845       yylval = (Value);                                         \
846       yytoken = YYTRANSLATE (yychar);                           \
847       YYPOPSTACK (1);                                           \
848       goto yybackup;                                            \
849     }                                                           \
850   else                                                          \
851     {                                                           \
852       yyerror (YY_("syntax error: cannot back up")); \
853       YYERROR;                                                  \
854     }                                                           \
855 while (YYID (0))
856
857
858 #define YYTERROR        1
859 #define YYERRCODE       256
860
861
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).  */
865
866 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
867 #ifndef YYLLOC_DEFAULT
868 # define YYLLOC_DEFAULT(Current, Rhs, N)                                \
869     do                                                                  \
870       if (YYID (N))                                                    \
871         {                                                               \
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;       \
876         }                                                               \
877       else                                                              \
878         {                                                               \
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;                              \
883         }                                                               \
884     while (YYID (0))
885 #endif
886
887
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.  */
891
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
902
903
904 /* YYLEX -- calling `yylex' with the right arguments.  */
905
906 #ifdef YYLEX_PARAM
907 # define YYLEX yylex (YYLEX_PARAM)
908 #else
909 # define YYLEX yylex ()
910 #endif
911
912 /* Enable debugging if requested.  */
913 #if YYDEBUG
914
915 # ifndef YYFPRINTF
916 #  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
917 #  define YYFPRINTF fprintf
918 # endif
919
920 # define YYDPRINTF(Args)                        \
921 do {                                            \
922   if (yydebug)                                  \
923     YYFPRINTF Args;                             \
924 } while (YYID (0))
925
926 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)                    \
927 do {                                                                      \
928   if (yydebug)                                                            \
929     {                                                                     \
930       YYFPRINTF (stderr, "%s ", Title);                                   \
931       yy_symbol_print (stderr,                                            \
932                   Type, Value); \
933       YYFPRINTF (stderr, "\n");                                           \
934     }                                                                     \
935 } while (YYID (0))
936
937
938 /*--------------------------------.
939 | Print this symbol on YYOUTPUT.  |
940 `--------------------------------*/
941
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
954 {
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)
964     {
965       default:
966         break;
967     }
968 }
969
970
971 /*--------------------------------.
972 | Print this symbol on YYOUTPUT.  |
973 `--------------------------------*/
974
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
986 {
987   if (yytype < YYNTOKENS)
988     YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
989   else
990     YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
991
992   yy_symbol_value_print (yyoutput, yytype, yyvaluep);
993   YYFPRINTF (yyoutput, ")");
994 }
995
996 /*------------------------------------------------------------------.
997 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
998 | TOP (included).                                                   |
999 `------------------------------------------------------------------*/
1000
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
1011 {
1012   YYFPRINTF (stderr, "Stack now");
1013   for (; yybottom <= yytop; yybottom++)
1014     {
1015       int yybot = *yybottom;
1016       YYFPRINTF (stderr, " %d", yybot);
1017     }
1018   YYFPRINTF (stderr, "\n");
1019 }
1020
1021 # define YY_STACK_PRINT(Bottom, Top)                            \
1022 do {                                                            \
1023   if (yydebug)                                                  \
1024     yy_stack_print ((Bottom), (Top));                           \
1025 } while (YYID (0))
1026
1027
1028 /*------------------------------------------------.
1029 | Report that the YYRULE is going to be reduced.  |
1030 `------------------------------------------------*/
1031
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
1042 {
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++)
1050     {
1051       YYFPRINTF (stderr, "   $%d = ", yyi + 1);
1052       yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
1053                        &(yyvsp[(yyi + 1) - (yynrhs)])
1054                                        );
1055       YYFPRINTF (stderr, "\n");
1056     }
1057 }
1058
1059 # define YY_REDUCE_PRINT(Rule)          \
1060 do {                                    \
1061   if (yydebug)                          \
1062     yy_reduce_print (yyvsp, Rule); \
1063 } while (YYID (0))
1064
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 */
1074
1075
1076 /* YYINITDEPTH -- initial size of the parser's stacks.  */
1077 #ifndef YYINITDEPTH
1078 # define YYINITDEPTH 200
1079 #endif
1080
1081 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1082    if the built-in stack extension method is used).
1083
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.  */
1087
1088 #ifndef YYMAXDEPTH
1089 # define YYMAXDEPTH 10000
1090 #endif
1091
1092 \f
1093
1094 #if YYERROR_VERBOSE
1095
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
1110 {
1111   YYSIZE_T yylen;
1112   for (yylen = 0; yystr[yylen]; yylen++)
1113     continue;
1114   return yylen;
1115 }
1116 #  endif
1117 # endif
1118
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
1135 {
1136   char *yyd = yydest;
1137   const char *yys = yysrc;
1138
1139   while ((*yyd++ = *yys++) != '\0')
1140     continue;
1141
1142   return yyd - 1;
1143 }
1144 #  endif
1145 # endif
1146
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)
1157 {
1158   if (*yystr == '"')
1159     {
1160       YYSIZE_T yyn = 0;
1161       char const *yyp = yystr;
1162
1163       for (;;)
1164         switch (*++yyp)
1165           {
1166           case '\'':
1167           case ',':
1168             goto do_not_strip_quotes;
1169
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;
1179
1180           case '"':
1181             if (yyres)
1182               yyres[yyn] = '\0';
1183             return yyn;
1184           }
1185     do_not_strip_quotes: ;
1186     }
1187
1188   if (! yyres)
1189     return yystrlen (yystr);
1190
1191   return yystpcpy (yyres, yystr) - yyres;
1192 }
1193 # endif
1194
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)
1204 {
1205   int yyn = yypact[yystate];
1206
1207   if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
1208     return 0;
1209   else
1210     {
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;
1219
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;
1239
1240       /* Start YYX at -YYN if negative to avoid negative indexes in
1241          YYCHECK.  */
1242       int yyxbegin = yyn < 0 ? -yyn : 0;
1243
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;
1248
1249       yyarg[0] = yytname[yytype];
1250       yyfmt = yystpcpy (yyformat, yyunexpected);
1251
1252       for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1253         if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1254           {
1255             if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1256               {
1257                 yycount = 1;
1258                 yysize = yysize0;
1259                 yyformat[sizeof yyunexpected - 1] = '\0';
1260                 break;
1261               }
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;
1268           }
1269
1270       yyf = YY_(yyformat);
1271       yysize1 = yysize + yystrlen (yyf);
1272       yysize_overflow |= (yysize1 < yysize);
1273       yysize = yysize1;
1274
1275       if (yysize_overflow)
1276         return YYSIZE_MAXIMUM;
1277
1278       if (yyresult)
1279         {
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')
1286             {
1287               if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
1288                 {
1289                   yyp += yytnamerr (yyp, yyarg[yyi++]);
1290                   yyf += 2;
1291                 }
1292               else
1293                 {
1294                   yyp++;
1295                   yyf++;
1296                 }
1297             }
1298         }
1299       return yysize;
1300     }
1301 }
1302 #endif /* YYERROR_VERBOSE */
1303 \f
1304
1305 /*-----------------------------------------------.
1306 | Release the memory associated to this symbol.  |
1307 `-----------------------------------------------*/
1308
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
1321 {
1322   YYUSE (yyvaluep);
1323
1324   if (!yymsg)
1325     yymsg = "Deleting";
1326   YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1327
1328   switch (yytype)
1329     {
1330
1331       default:
1332         break;
1333     }
1334 }
1335
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 */
1350
1351
1352 /* The lookahead symbol.  */
1353 int yychar;
1354
1355 /* The semantic value of the lookahead symbol.  */
1356 YYSTYPE yylval;
1357
1358 /* Number of syntax errors so far.  */
1359 int yynerrs;
1360
1361
1362
1363 /*-------------------------.
1364 | yyparse or yypush_parse.  |
1365 `-------------------------*/
1366
1367 #ifdef YYPARSE_PARAM
1368 #if (defined __STDC__ || defined __C99__FUNC__ \
1369      || defined __cplusplus || defined _MSC_VER)
1370 int
1371 yyparse (void *YYPARSE_PARAM)
1372 #else
1373 int
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)
1380 int
1381 yyparse (void)
1382 #else
1383 int
1384 yyparse ()
1385
1386 #endif
1387 #endif
1388 {
1389
1390
1391     int yystate;
1392     /* Number of tokens to shift before error messages enabled.  */
1393     int yyerrstatus;
1394
1395     /* The stacks and their tools:
1396        `yyss': related to states.
1397        `yyvs': related to semantic values.
1398
1399        Refer to the stacks thru separate pointers, to allow yyoverflow
1400        to reallocate them elsewhere.  */
1401
1402     /* The state stack.  */
1403     yytype_int16 yyssa[YYINITDEPTH];
1404     yytype_int16 *yyss;
1405     yytype_int16 *yyssp;
1406
1407     /* The semantic value stack.  */
1408     YYSTYPE yyvsa[YYINITDEPTH];
1409     YYSTYPE *yyvs;
1410     YYSTYPE *yyvsp;
1411
1412     YYSIZE_T yystacksize;
1413
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;
1421
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
1428
1429 #define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N))
1430
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;
1434
1435   yytoken = 0;
1436   yyss = yyssa;
1437   yyvs = yyvsa;
1438   yystacksize = YYINITDEPTH;
1439
1440   YYDPRINTF ((stderr, "Starting parse\n"));
1441
1442   yystate = 0;
1443   yyerrstatus = 0;
1444   yynerrs = 0;
1445   yychar = YYEMPTY; /* Cause a token to be read.  */
1446
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;
1453
1454   goto yysetstate;
1455
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++;
1463
1464  yysetstate:
1465   *yyssp = yystate;
1466
1467   if (yyss + yystacksize - 1 <= yyssp)
1468     {
1469       /* Get the current used size of the three stacks, in elements.  */
1470       YYSIZE_T yysize = yyssp - yyss + 1;
1471
1472 #ifdef yyoverflow
1473       {
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;
1479
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);
1488
1489         yyss = yyss1;
1490         yyvs = yyvs1;
1491       }
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;
1502
1503       {
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);
1514       }
1515 # endif
1516 #endif /* no yyoverflow */
1517
1518       yyssp = yyss + yysize - 1;
1519       yyvsp = yyvs + yysize - 1;
1520
1521       YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1522                   (unsigned long int) yystacksize));
1523
1524       if (yyss + yystacksize - 1 <= yyssp)
1525         YYABORT;
1526     }
1527
1528   YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1529
1530   if (yystate == YYFINAL)
1531     YYACCEPT;
1532
1533   goto yybackup;
1534
1535 /*-----------.
1536 | yybackup.  |
1537 `-----------*/
1538 yybackup:
1539
1540   /* Do appropriate processing given the current state.  Read a
1541      lookahead token if we need one and don't already have one.  */
1542
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;
1547
1548   /* Not known => get a lookahead token if don't already have one.  */
1549
1550   /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol.  */
1551   if (yychar == YYEMPTY)
1552     {
1553       YYDPRINTF ((stderr, "Reading a token: "));
1554       yychar = YYLEX;
1555     }
1556
1557   if (yychar <= YYEOF)
1558     {
1559       yychar = yytoken = YYEOF;
1560       YYDPRINTF ((stderr, "Now at end of input.\n"));
1561     }
1562   else
1563     {
1564       yytoken = YYTRANSLATE (yychar);
1565       YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1566     }
1567
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)
1575     {
1576       if (yyn == 0 || yyn == YYTABLE_NINF)
1577         goto yyerrlab;
1578       yyn = -yyn;
1579       goto yyreduce;
1580     }
1581
1582   /* Count tokens shifted since error; after three, turn off error
1583      status.  */
1584   if (yyerrstatus)
1585     yyerrstatus--;
1586
1587   /* Shift the lookahead token.  */
1588   YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1589
1590   /* Discard the shifted token.  */
1591   yychar = YYEMPTY;
1592
1593   yystate = yyn;
1594   *++yyvsp = yylval;
1595
1596   goto yynewstate;
1597
1598
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;
1607
1608
1609 /*-----------------------------.
1610 | yyreduce -- Do a reduction.  |
1611 `-----------------------------*/
1612 yyreduce:
1613   /* yyn is the number of a rule to reduce with.  */
1614   yylen = yyr2[yyn];
1615
1616   /* If YYLEN is nonzero, implement the default value of the action:
1617      `$$ = $1'.
1618
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];
1625
1626
1627   YY_REDUCE_PRINT (yyn);
1628   switch (yyn)
1629     {
1630         case 2:
1631
1632 /* Line 1455 of yacc.c  */
1633 #line 119 "parse.y"
1634     { /* add default rule */
1635                         int def_rule;
1636
1637                         pat = cclinit();
1638                         cclnegate( pat );
1639
1640                         def_rule = mkstate( -pat );
1641
1642                         /* Remember the number of the default rule so we
1643                          * don't generate "can't match" warnings for it.
1644                          */
1645                         default_rule = num_rules;
1646
1647                         finish_rule( def_rule, false, 0, 0, 0);
1648
1649                         for ( i = 1; i <= lastsc; ++i )
1650                                 scset[i] = mkbranch( scset[i], def_rule );
1651
1652                         if ( spprdflt )
1653                                 add_action(
1654                                 "YY_FATAL_ERROR( \"flex scanner jammed\" )" );
1655                         else
1656                                 add_action( "ECHO" );
1657
1658                         add_action( ";\n\tYY_BREAK\n" );
1659                         }
1660     break;
1661
1662   case 3:
1663
1664 /* Line 1455 of yacc.c  */
1665 #line 148 "parse.y"
1666     { /* initialize for processing rules */
1667
1668                         /* Create default DFA start condition. */
1669                         scinstal( "INITIAL", false );
1670                         }
1671     break;
1672
1673   case 7:
1674
1675 /* Line 1455 of yacc.c  */
1676 #line 159 "parse.y"
1677     { synerr( _("unknown error processing section 1") ); }
1678     break;
1679
1680   case 8:
1681
1682 /* Line 1455 of yacc.c  */
1683 #line 163 "parse.y"
1684     {
1685                         check_options();
1686                         scon_stk = allocate_integer_array( lastsc + 1 );
1687                         scon_stk_ptr = 0;
1688                         }
1689     break;
1690
1691   case 9:
1692
1693 /* Line 1455 of yacc.c  */
1694 #line 171 "parse.y"
1695     { xcluflg = false; }
1696     break;
1697
1698   case 10:
1699
1700 /* Line 1455 of yacc.c  */
1701 #line 174 "parse.y"
1702     { xcluflg = true; }
1703     break;
1704
1705   case 11:
1706
1707 /* Line 1455 of yacc.c  */
1708 #line 178 "parse.y"
1709     { scinstal( nmstr, xcluflg ); }
1710     break;
1711
1712   case 12:
1713
1714 /* Line 1455 of yacc.c  */
1715 #line 181 "parse.y"
1716     { scinstal( nmstr, xcluflg ); }
1717     break;
1718
1719   case 13:
1720
1721 /* Line 1455 of yacc.c  */
1722 #line 184 "parse.y"
1723     { synerr( _("bad start condition list") ); }
1724     break;
1725
1726   case 17:
1727
1728 /* Line 1455 of yacc.c  */
1729 #line 195 "parse.y"
1730     {
1731                         outfilename = copy_string( nmstr );
1732                         did_outfilename = 1;
1733                         }
1734     break;
1735
1736   case 18:
1737
1738 /* Line 1455 of yacc.c  */
1739 #line 200 "parse.y"
1740     { extra_type = copy_string( nmstr ); }
1741     break;
1742
1743   case 19:
1744
1745 /* Line 1455 of yacc.c  */
1746 #line 202 "parse.y"
1747     { prefix = copy_string( nmstr ); }
1748     break;
1749
1750   case 20:
1751
1752 /* Line 1455 of yacc.c  */
1753 #line 204 "parse.y"
1754     { yyclass = copy_string( nmstr ); }
1755     break;
1756
1757   case 21:
1758
1759 /* Line 1455 of yacc.c  */
1760 #line 206 "parse.y"
1761     { headerfilename = copy_string( nmstr ); }
1762     break;
1763
1764   case 22:
1765
1766 /* Line 1455 of yacc.c  */
1767 #line 208 "parse.y"
1768     { tablesext = true; tablesfilename = copy_string( nmstr ); }
1769     break;
1770
1771   case 23:
1772
1773 /* Line 1455 of yacc.c  */
1774 #line 212 "parse.y"
1775     { scon_stk_ptr = (yyvsp[(2) - (5)]); }
1776     break;
1777
1778   case 24:
1779
1780 /* Line 1455 of yacc.c  */
1781 #line 214 "parse.y"
1782     { scon_stk_ptr = (yyvsp[(2) - (5)]); }
1783     break;
1784
1785   case 26:
1786
1787 /* Line 1455 of yacc.c  */
1788 #line 219 "parse.y"
1789     {
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;
1796
1797                         new_rule();
1798                         }
1799     break;
1800
1801   case 27:
1802
1803 /* Line 1455 of yacc.c  */
1804 #line 232 "parse.y"
1805     {
1806                         pat = (yyvsp[(2) - (2)]);
1807                         finish_rule( pat, variable_trail_rule,
1808                                 headcnt, trailcnt , previous_continued_action);
1809
1810                         if ( scon_stk_ptr > 0 )
1811                                 {
1812                                 for ( i = 1; i <= scon_stk_ptr; ++i )
1813                                         scbol[scon_stk[i]] =
1814                                                 mkbranch( scbol[scon_stk[i]],
1815                                                                 pat );
1816                                 }
1817
1818                         else
1819                                 {
1820                                 /* Add to all non-exclusive start conditions,
1821                                  * including the default (0) start condition.
1822                                  */
1823
1824                                 for ( i = 1; i <= lastsc; ++i )
1825                                         if ( ! scxclu[i] )
1826                                                 scbol[i] = mkbranch( scbol[i],
1827                                                                         pat );
1828                                 }
1829
1830                         if ( ! bol_needed )
1831                                 {
1832                                 bol_needed = true;
1833
1834                                 if ( performance_report > 1 )
1835                                         pinpoint_message(
1836                         "'^' operator results in sub-optimal performance" );
1837                                 }
1838                         }
1839     break;
1840
1841   case 28:
1842
1843 /* Line 1455 of yacc.c  */
1844 #line 268 "parse.y"
1845     {
1846                         pat = (yyvsp[(1) - (1)]);
1847                         finish_rule( pat, variable_trail_rule,
1848                                 headcnt, trailcnt , previous_continued_action);
1849
1850                         if ( scon_stk_ptr > 0 )
1851                                 {
1852                                 for ( i = 1; i <= scon_stk_ptr; ++i )
1853                                         scset[scon_stk[i]] =
1854                                                 mkbranch( scset[scon_stk[i]],
1855                                                                 pat );
1856                                 }
1857
1858                         else
1859                                 {
1860                                 for ( i = 1; i <= lastsc; ++i )
1861                                         if ( ! scxclu[i] )
1862                                                 scset[i] =
1863                                                         mkbranch( scset[i],
1864                                                                 pat );
1865                                 }
1866                         }
1867     break;
1868
1869   case 29:
1870
1871 /* Line 1455 of yacc.c  */
1872 #line 292 "parse.y"
1873     {
1874                         if ( scon_stk_ptr > 0 )
1875                                 build_eof_action();
1876         
1877                         else
1878                                 {
1879                                 /* This EOF applies to all start conditions
1880                                  * which don't already have EOF actions.
1881                                  */
1882                                 for ( i = 1; i <= lastsc; ++i )
1883                                         if ( ! sceof[i] )
1884                                                 scon_stk[++scon_stk_ptr] = i;
1885
1886                                 if ( scon_stk_ptr == 0 )
1887                                         warn(
1888                         "all start conditions already have <<EOF>> rules" );
1889
1890                                 else
1891                                         build_eof_action();
1892                                 }
1893                         }
1894     break;
1895
1896   case 30:
1897
1898 /* Line 1455 of yacc.c  */
1899 #line 315 "parse.y"
1900     { synerr( _("unrecognized rule") ); }
1901     break;
1902
1903   case 31:
1904
1905 /* Line 1455 of yacc.c  */
1906 #line 319 "parse.y"
1907     { (yyval) = scon_stk_ptr; }
1908     break;
1909
1910   case 32:
1911
1912 /* Line 1455 of yacc.c  */
1913 #line 323 "parse.y"
1914     { (yyval) = (yyvsp[(2) - (4)]); }
1915     break;
1916
1917   case 33:
1918
1919 /* Line 1455 of yacc.c  */
1920 #line 326 "parse.y"
1921     {
1922                         (yyval) = scon_stk_ptr;
1923
1924                         for ( i = 1; i <= lastsc; ++i )
1925                                 {
1926                                 int j;
1927
1928                                 for ( j = 1; j <= scon_stk_ptr; ++j )
1929                                         if ( scon_stk[j] == i )
1930                                                 break;
1931
1932                                 if ( j > scon_stk_ptr )
1933                                         scon_stk[++scon_stk_ptr] = i;
1934                                 }
1935                         }
1936     break;
1937
1938   case 34:
1939
1940 /* Line 1455 of yacc.c  */
1941 #line 343 "parse.y"
1942     { (yyval) = scon_stk_ptr; }
1943     break;
1944
1945   case 37:
1946
1947 /* Line 1455 of yacc.c  */
1948 #line 351 "parse.y"
1949     { synerr( _("bad start condition list") ); }
1950     break;
1951
1952   case 38:
1953
1954 /* Line 1455 of yacc.c  */
1955 #line 355 "parse.y"
1956     {
1957                         if ( (scnum = sclookup( nmstr )) == 0 )
1958                                 format_pinpoint_message(
1959                                         "undeclared start condition %s",
1960                                         nmstr );
1961                         else
1962                                 {
1963                                 for ( i = 1; i <= scon_stk_ptr; ++i )
1964                                         if ( scon_stk[i] == scnum )
1965                                                 {
1966                                                 format_warn(
1967                                                         "<%s> specified twice",
1968                                                         scname[scnum] );
1969                                                 break;
1970                                                 }
1971
1972                                 if ( i > scon_stk_ptr )
1973                                         scon_stk[++scon_stk_ptr] = scnum;
1974                                 }
1975                         }
1976     break;
1977
1978   case 39:
1979
1980 /* Line 1455 of yacc.c  */
1981 #line 378 "parse.y"
1982     {
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.
1987                                  */
1988                                 (yyvsp[(2) - (2)]) = link_machines( (yyvsp[(2) - (2)]),
1989                                                 mkstate( SYM_EPSILON ) );
1990
1991                         mark_beginning_as_normal( (yyvsp[(2) - (2)]) );
1992                         current_state_type = STATE_NORMAL;
1993
1994                         if ( previous_continued_action )
1995                                 {
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.
2003                                  */
2004                                 if ( ! varlength || headcnt != 0 )
2005                                         warn(
2006                 "trailing context made variable due to preceding '|' action" );
2007
2008                                 /* Mark as variable. */
2009                                 varlength = true;
2010                                 headcnt = 0;
2011
2012                                 }
2013
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.
2019                                  *
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 ...
2025                                  */
2026                                 add_accept( (yyvsp[(1) - (2)]),
2027                                         num_rules | YY_TRAILING_HEAD_MASK );
2028                                 variable_trail_rule = true;
2029                                 }
2030                         
2031                         else
2032                                 trailcnt = rulelen;
2033
2034                         (yyval) = link_machines( (yyvsp[(1) - (2)]), (yyvsp[(2) - (2)]) );
2035                         }
2036     break;
2037
2038   case 40:
2039
2040 /* Line 1455 of yacc.c  */
2041 #line 434 "parse.y"
2042     { synerr( _("trailing context used twice") ); }
2043     break;
2044
2045   case 41:
2046
2047 /* Line 1455 of yacc.c  */
2048 #line 437 "parse.y"
2049     {
2050                         headcnt = 0;
2051                         trailcnt = 1;
2052                         rulelen = 1;
2053                         varlength = false;
2054
2055                         current_state_type = STATE_TRAILING_CONTEXT;
2056
2057                         if ( trlcontxt )
2058                                 {
2059                                 synerr( _("trailing context used twice") );
2060                                 (yyval) = mkstate( SYM_EPSILON );
2061                                 }
2062
2063                         else if ( previous_continued_action )
2064                                 {
2065                                 /* See the comment in the rule for "re2 re"
2066                                  * above.
2067                                  */
2068                                 warn(
2069                 "trailing context made variable due to preceding '|' action" );
2070
2071                                 varlength = true;
2072                                 }
2073
2074                         if ( lex_compat || varlength )
2075                                 {
2076                                 /* Again, see the comment in the rule for
2077                                  * "re2 re" above.
2078                                  */
2079                                 add_accept( (yyvsp[(1) - (2)]),
2080                                         num_rules | YY_TRAILING_HEAD_MASK );
2081                                 variable_trail_rule = true;
2082                                 }
2083
2084                         trlcontxt = true;
2085
2086                         eps = mkstate( SYM_EPSILON );
2087                         (yyval) = link_machines( (yyvsp[(1) - (2)]),
2088                                 link_machines( eps, mkstate( '\n' ) ) );
2089                         }
2090     break;
2091
2092   case 42:
2093
2094 /* Line 1455 of yacc.c  */
2095 #line 480 "parse.y"
2096     {
2097                         (yyval) = (yyvsp[(1) - (1)]);
2098
2099                         if ( trlcontxt )
2100                                 {
2101                                 if ( lex_compat || (varlength && headcnt == 0) )
2102                                         /* Both head and trail are
2103                                          * variable-length.
2104                                          */
2105                                         variable_trail_rule = true;
2106                                 else
2107                                         trailcnt = rulelen;
2108                                 }
2109                         }
2110     break;
2111
2112   case 43:
2113
2114 /* Line 1455 of yacc.c  */
2115 #line 498 "parse.y"
2116     {
2117                         varlength = true;
2118                         (yyval) = mkor( (yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]) );
2119                         }
2120     break;
2121
2122   case 44:
2123
2124 /* Line 1455 of yacc.c  */
2125 #line 504 "parse.y"
2126     { (yyval) = (yyvsp[(1) - (1)]); }
2127     break;
2128
2129   case 45:
2130
2131 /* Line 1455 of yacc.c  */
2132 #line 509 "parse.y"
2133     {
2134                         /* This rule is written separately so the
2135                          * reduction will occur before the trailing
2136                          * series is parsed.
2137                          */
2138
2139                         if ( trlcontxt )
2140                                 synerr( _("trailing context used twice") );
2141                         else
2142                                 trlcontxt = true;
2143
2144                         if ( varlength )
2145                                 /* We hope the trailing context is
2146                                  * fixed-length.
2147                                  */
2148                                 varlength = false;
2149                         else
2150                                 headcnt = rulelen;
2151
2152                         rulelen = 0;
2153
2154                         current_state_type = STATE_TRAILING_CONTEXT;
2155                         (yyval) = (yyvsp[(1) - (2)]);
2156                         }
2157     break;
2158
2159   case 46:
2160
2161 /* Line 1455 of yacc.c  */
2162 #line 536 "parse.y"
2163     {
2164                         /* This is where concatenation of adjacent patterns
2165                          * gets done.
2166                          */
2167                         (yyval) = link_machines( (yyvsp[(1) - (2)]), (yyvsp[(2) - (2)]) );
2168                         }
2169     break;
2170
2171   case 47:
2172
2173 /* Line 1455 of yacc.c  */
2174 #line 544 "parse.y"
2175     { (yyval) = (yyvsp[(1) - (1)]); }
2176     break;
2177
2178   case 48:
2179
2180 /* Line 1455 of yacc.c  */
2181 #line 547 "parse.y"
2182     {
2183                         varlength = true;
2184
2185                         if ( (yyvsp[(3) - (6)]) > (yyvsp[(5) - (6)]) || (yyvsp[(3) - (6)]) < 0 )
2186                                 {
2187                                 synerr( _("bad iteration values") );
2188                                 (yyval) = (yyvsp[(1) - (6)]);
2189                                 }
2190                         else
2191                                 {
2192                                 if ( (yyvsp[(3) - (6)]) == 0 )
2193                                         {
2194                                         if ( (yyvsp[(5) - (6)]) <= 0 )
2195                                                 {
2196                                                 synerr(
2197                                                 _("bad iteration values") );
2198                                                 (yyval) = (yyvsp[(1) - (6)]);
2199                                                 }
2200                                         else
2201                                                 (yyval) = mkopt(
2202                                                         mkrep( (yyvsp[(1) - (6)]), 1, (yyvsp[(5) - (6)]) ) );
2203                                         }
2204                                 else
2205                                         (yyval) = mkrep( (yyvsp[(1) - (6)]), (yyvsp[(3) - (6)]), (yyvsp[(5) - (6)]) );
2206                                 }
2207                         }
2208     break;
2209
2210   case 49:
2211
2212 /* Line 1455 of yacc.c  */
2213 #line 575 "parse.y"
2214     {
2215                         varlength = true;
2216
2217                         if ( (yyvsp[(3) - (5)]) <= 0 )
2218                                 {
2219                                 synerr( _("iteration value must be positive") );
2220                                 (yyval) = (yyvsp[(1) - (5)]);
2221                                 }
2222
2223                         else
2224                                 (yyval) = mkrep( (yyvsp[(1) - (5)]), (yyvsp[(3) - (5)]), INFINITE_REPEAT );
2225                         }
2226     break;
2227
2228   case 50:
2229
2230 /* Line 1455 of yacc.c  */
2231 #line 589 "parse.y"
2232     {
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.
2236                          */
2237                         varlength = true;
2238
2239                         if ( (yyvsp[(3) - (4)]) <= 0 )
2240                                 {
2241                                   synerr( _("iteration value must be positive")
2242                                           );
2243                                 (yyval) = (yyvsp[(1) - (4)]);
2244                                 }
2245
2246                         else
2247                                 (yyval) = link_machines( (yyvsp[(1) - (4)]),
2248                                                 copysingl( (yyvsp[(1) - (4)]), (yyvsp[(3) - (4)]) - 1 ) );
2249                         }
2250     break;
2251
2252   case 51:
2253
2254 /* Line 1455 of yacc.c  */
2255 #line 611 "parse.y"
2256     {
2257                         varlength = true;
2258
2259                         (yyval) = mkclos( (yyvsp[(1) - (2)]) );
2260                         }
2261     break;
2262
2263   case 52:
2264
2265 /* Line 1455 of yacc.c  */
2266 #line 618 "parse.y"
2267     {
2268                         varlength = true;
2269                         (yyval) = mkposcl( (yyvsp[(1) - (2)]) );
2270                         }
2271     break;
2272
2273   case 53:
2274
2275 /* Line 1455 of yacc.c  */
2276 #line 624 "parse.y"
2277     {
2278                         varlength = true;
2279                         (yyval) = mkopt( (yyvsp[(1) - (2)]) );
2280                         }
2281     break;
2282
2283   case 54:
2284
2285 /* Line 1455 of yacc.c  */
2286 #line 630 "parse.y"
2287     {
2288                         varlength = true;
2289
2290                         if ( (yyvsp[(3) - (6)]) > (yyvsp[(5) - (6)]) || (yyvsp[(3) - (6)]) < 0 )
2291                                 {
2292                                 synerr( _("bad iteration values") );
2293                                 (yyval) = (yyvsp[(1) - (6)]);
2294                                 }
2295                         else
2296                                 {
2297                                 if ( (yyvsp[(3) - (6)]) == 0 )
2298                                         {
2299                                         if ( (yyvsp[(5) - (6)]) <= 0 )
2300                                                 {
2301                                                 synerr(
2302                                                 _("bad iteration values") );
2303                                                 (yyval) = (yyvsp[(1) - (6)]);
2304                                                 }
2305                                         else
2306                                                 (yyval) = mkopt(
2307                                                         mkrep( (yyvsp[(1) - (6)]), 1, (yyvsp[(5) - (6)]) ) );
2308                                         }
2309                                 else
2310                                         (yyval) = mkrep( (yyvsp[(1) - (6)]), (yyvsp[(3) - (6)]), (yyvsp[(5) - (6)]) );
2311                                 }
2312                         }
2313     break;
2314
2315   case 55:
2316
2317 /* Line 1455 of yacc.c  */
2318 #line 658 "parse.y"
2319     {
2320                         varlength = true;
2321
2322                         if ( (yyvsp[(3) - (5)]) <= 0 )
2323                                 {
2324                                 synerr( _("iteration value must be positive") );
2325                                 (yyval) = (yyvsp[(1) - (5)]);
2326                                 }
2327
2328                         else
2329                                 (yyval) = mkrep( (yyvsp[(1) - (5)]), (yyvsp[(3) - (5)]), INFINITE_REPEAT );
2330                         }
2331     break;
2332
2333   case 56:
2334
2335 /* Line 1455 of yacc.c  */
2336 #line 672 "parse.y"
2337     {
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.
2341                          */
2342                         varlength = true;
2343
2344                         if ( (yyvsp[(3) - (4)]) <= 0 )
2345                                 {
2346                                 synerr( _("iteration value must be positive") );
2347                                 (yyval) = (yyvsp[(1) - (4)]);
2348                                 }
2349
2350                         else
2351                                 (yyval) = link_machines( (yyvsp[(1) - (4)]),
2352                                                 copysingl( (yyvsp[(1) - (4)]), (yyvsp[(3) - (4)]) - 1 ) );
2353                         }
2354     break;
2355
2356   case 57:
2357
2358 /* Line 1455 of yacc.c  */
2359 #line 691 "parse.y"
2360     {
2361                         if ( ! madeany )
2362                                 {
2363                                 /* Create the '.' character class. */
2364                     ccldot = cclinit();
2365                     ccladd( ccldot, '\n' );
2366                     cclnegate( ccldot );
2367
2368                     if ( useecs )
2369                         mkeccl( ccltbl + cclmap[ccldot],
2370                             ccllen[ccldot], nextecm,
2371                             ecgroup, csize, csize );
2372
2373                                 /* Create the (?s:'.') character class. */
2374                     cclany = cclinit();
2375                     cclnegate( cclany );
2376
2377                     if ( useecs )
2378                         mkeccl( ccltbl + cclmap[cclany],
2379                             ccllen[cclany], nextecm,
2380                             ecgroup, csize, csize );
2381
2382                                 madeany = true;
2383                                 }
2384
2385                         ++rulelen;
2386
2387             if (sf_dot_all())
2388                 (yyval) = mkstate( -cclany );
2389             else
2390                 (yyval) = mkstate( -ccldot );
2391                         }
2392     break;
2393
2394   case 58:
2395
2396 /* Line 1455 of yacc.c  */
2397 #line 725 "parse.y"
2398     {
2399                                 /* Sort characters for fast searching.
2400                                  */
2401                                 qsort( ccltbl + cclmap[(yyvsp[(1) - (1)])], ccllen[(yyvsp[(1) - (1)])], sizeof (*ccltbl), cclcmp );
2402
2403                         if ( useecs )
2404                                 mkeccl( ccltbl + cclmap[(yyvsp[(1) - (1)])], ccllen[(yyvsp[(1) - (1)])],
2405                                         nextecm, ecgroup, csize, csize );
2406
2407                         ++rulelen;
2408
2409                         if (ccl_has_nl[(yyvsp[(1) - (1)])])
2410                                 rule_has_nl[num_rules] = true;
2411
2412                         (yyval) = mkstate( -(yyvsp[(1) - (1)]) );
2413                         }
2414     break;
2415
2416   case 59:
2417
2418 /* Line 1455 of yacc.c  */
2419 #line 743 "parse.y"
2420     {
2421                         ++rulelen;
2422
2423                         if (ccl_has_nl[(yyvsp[(1) - (1)])])
2424                                 rule_has_nl[num_rules] = true;
2425
2426                         (yyval) = mkstate( -(yyvsp[(1) - (1)]) );
2427                         }
2428     break;
2429
2430   case 60:
2431
2432 /* Line 1455 of yacc.c  */
2433 #line 753 "parse.y"
2434     { (yyval) = (yyvsp[(2) - (3)]); }
2435     break;
2436
2437   case 61:
2438
2439 /* Line 1455 of yacc.c  */
2440 #line 756 "parse.y"
2441     { (yyval) = (yyvsp[(2) - (3)]); }
2442     break;
2443
2444   case 62:
2445
2446 /* Line 1455 of yacc.c  */
2447 #line 759 "parse.y"
2448     {
2449                         ++rulelen;
2450
2451                         if ((yyvsp[(1) - (1)]) == nlch)
2452                                 rule_has_nl[num_rules] = true;
2453
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)]) );
2459                         }
2460     break;
2461
2462   case 63:
2463
2464 /* Line 1455 of yacc.c  */
2465 #line 773 "parse.y"
2466     { (yyval) = ccl_set_diff  ((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)])); }
2467     break;
2468
2469   case 64:
2470
2471 /* Line 1455 of yacc.c  */
2472 #line 774 "parse.y"
2473     { (yyval) = ccl_set_union ((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)])); }
2474     break;
2475
2476   case 66:
2477
2478 /* Line 1455 of yacc.c  */
2479 #line 780 "parse.y"
2480     { (yyval) = (yyvsp[(2) - (3)]); }
2481     break;
2482
2483   case 67:
2484
2485 /* Line 1455 of yacc.c  */
2486 #line 783 "parse.y"
2487     {
2488                         cclnegate( (yyvsp[(3) - (4)]) );
2489                         (yyval) = (yyvsp[(3) - (4)]);
2490                         }
2491     break;
2492
2493   case 68:
2494
2495 /* Line 1455 of yacc.c  */
2496 #line 790 "parse.y"
2497     {
2498
2499                         if (sf_case_ins())
2500                           {
2501
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]
2506                              */
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)]));
2513
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]
2518                              */
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)]));
2523                           }
2524
2525                         if ( (yyvsp[(2) - (4)]) > (yyvsp[(4) - (4)]) )
2526                                 synerr( _("negative range in character class") );
2527
2528                         else
2529                                 {
2530                                 for ( i = (yyvsp[(2) - (4)]); i <= (yyvsp[(4) - (4)]); ++i )
2531                                         ccladd( (yyvsp[(1) - (4)]), i );
2532
2533                                 /* Keep track if this ccl is staying in
2534                                  * alphabetical order.
2535                                  */
2536                                 cclsorted = cclsorted && ((yyvsp[(2) - (4)]) > lastchar);
2537                                 lastchar = (yyvsp[(4) - (4)]);
2538
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)]));
2543                     
2544                     for ( i = (yyvsp[(2) - (4)]); i <= (yyvsp[(4) - (4)]); ++i )
2545                         ccladd( (yyvsp[(1) - (4)]), i );
2546
2547                     cclsorted = cclsorted && ((yyvsp[(2) - (4)]) > lastchar);
2548                     lastchar = (yyvsp[(4) - (4)]);
2549                 }
2550
2551                                 }
2552
2553                         (yyval) = (yyvsp[(1) - (4)]);
2554                         }
2555     break;
2556
2557   case 69:
2558
2559 /* Line 1455 of yacc.c  */
2560 #line 850 "parse.y"
2561     {
2562                         ccladd( (yyvsp[(1) - (2)]), (yyvsp[(2) - (2)]) );
2563                         cclsorted = cclsorted && ((yyvsp[(2) - (2)]) > lastchar);
2564                         lastchar = (yyvsp[(2) - (2)]);
2565
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)]));
2570
2571                 cclsorted = cclsorted && ((yyvsp[(2) - (2)]) > lastchar);
2572                 lastchar = (yyvsp[(2) - (2)]);
2573             }
2574
2575                         (yyval) = (yyvsp[(1) - (2)]);
2576                         }
2577     break;
2578
2579   case 70:
2580
2581 /* Line 1455 of yacc.c  */
2582 #line 868 "parse.y"
2583     {
2584                         /* Too hard to properly maintain cclsorted. */
2585                         cclsorted = false;
2586                         (yyval) = (yyvsp[(1) - (2)]);
2587                         }
2588     break;
2589
2590   case 71:
2591
2592 /* Line 1455 of yacc.c  */
2593 #line 875 "parse.y"
2594     {
2595                         cclsorted = true;
2596                         lastchar = 0;
2597                         currccl = (yyval) = cclinit();
2598                         }
2599     break;
2600
2601   case 72:
2602
2603 /* Line 1455 of yacc.c  */
2604 #line 883 "parse.y"
2605     { CCL_EXPR(isalnum); }
2606     break;
2607
2608   case 73:
2609
2610 /* Line 1455 of yacc.c  */
2611 #line 884 "parse.y"
2612     { CCL_EXPR(isalpha); }
2613     break;
2614
2615   case 74:
2616
2617 /* Line 1455 of yacc.c  */
2618 #line 885 "parse.y"
2619     { CCL_EXPR(IS_BLANK); }
2620     break;
2621
2622   case 75:
2623
2624 /* Line 1455 of yacc.c  */
2625 #line 886 "parse.y"
2626     { CCL_EXPR(iscntrl); }
2627     break;
2628
2629   case 76:
2630
2631 /* Line 1455 of yacc.c  */
2632 #line 887 "parse.y"
2633     { CCL_EXPR(isdigit); }
2634     break;
2635
2636   case 77:
2637
2638 /* Line 1455 of yacc.c  */
2639 #line 888 "parse.y"
2640     { CCL_EXPR(isgraph); }
2641     break;
2642
2643   case 78:
2644
2645 /* Line 1455 of yacc.c  */
2646 #line 889 "parse.y"
2647     { 
2648                           CCL_EXPR(islower);
2649                           if (sf_case_ins())
2650                               CCL_EXPR(isupper);
2651                         }
2652     break;
2653
2654   case 79:
2655
2656 /* Line 1455 of yacc.c  */
2657 #line 894 "parse.y"
2658     { CCL_EXPR(isprint); }
2659     break;
2660
2661   case 80:
2662
2663 /* Line 1455 of yacc.c  */
2664 #line 895 "parse.y"
2665     { CCL_EXPR(ispunct); }
2666     break;
2667
2668   case 81:
2669
2670 /* Line 1455 of yacc.c  */
2671 #line 896 "parse.y"
2672     { CCL_EXPR(isspace); }
2673     break;
2674
2675   case 82:
2676
2677 /* Line 1455 of yacc.c  */
2678 #line 897 "parse.y"
2679     { CCL_EXPR(isxdigit); }
2680     break;
2681
2682   case 83:
2683
2684 /* Line 1455 of yacc.c  */
2685 #line 898 "parse.y"
2686     {
2687                     CCL_EXPR(isupper);
2688                     if (sf_case_ins())
2689                         CCL_EXPR(islower);
2690                                 }
2691     break;
2692
2693   case 84:
2694
2695 /* Line 1455 of yacc.c  */
2696 #line 904 "parse.y"
2697     { CCL_NEG_EXPR(isalnum); }
2698     break;
2699
2700   case 85:
2701
2702 /* Line 1455 of yacc.c  */
2703 #line 905 "parse.y"
2704     { CCL_NEG_EXPR(isalpha); }
2705     break;
2706
2707   case 86:
2708
2709 /* Line 1455 of yacc.c  */
2710 #line 906 "parse.y"
2711     { CCL_NEG_EXPR(IS_BLANK); }
2712     break;
2713
2714   case 87:
2715
2716 /* Line 1455 of yacc.c  */
2717 #line 907 "parse.y"
2718     { CCL_NEG_EXPR(iscntrl); }
2719     break;
2720
2721   case 88:
2722
2723 /* Line 1455 of yacc.c  */
2724 #line 908 "parse.y"
2725     { CCL_NEG_EXPR(isdigit); }
2726     break;
2727
2728   case 89:
2729
2730 /* Line 1455 of yacc.c  */
2731 #line 909 "parse.y"
2732     { CCL_NEG_EXPR(isgraph); }
2733     break;
2734
2735   case 90:
2736
2737 /* Line 1455 of yacc.c  */
2738 #line 910 "parse.y"
2739     { CCL_NEG_EXPR(isprint); }
2740     break;
2741
2742   case 91:
2743
2744 /* Line 1455 of yacc.c  */
2745 #line 911 "parse.y"
2746     { CCL_NEG_EXPR(ispunct); }
2747     break;
2748
2749   case 92:
2750
2751 /* Line 1455 of yacc.c  */
2752 #line 912 "parse.y"
2753     { CCL_NEG_EXPR(isspace); }
2754     break;
2755
2756   case 93:
2757
2758 /* Line 1455 of yacc.c  */
2759 #line 913 "parse.y"
2760     { CCL_NEG_EXPR(isxdigit); }
2761     break;
2762
2763   case 94:
2764
2765 /* Line 1455 of yacc.c  */
2766 #line 914 "parse.y"
2767     { 
2768                                 if ( sf_case_ins() )
2769                                         warn(_("[:^lower:] is ambiguous in case insensitive scanner"));
2770                                 else
2771                                         CCL_NEG_EXPR(islower);
2772                                 }
2773     break;
2774
2775   case 95:
2776
2777 /* Line 1455 of yacc.c  */
2778 #line 920 "parse.y"
2779     {
2780                                 if ( sf_case_ins() )
2781                                         warn(_("[:^upper:] ambiguous in case insensitive scanner"));
2782                                 else
2783                                         CCL_NEG_EXPR(isupper);
2784                                 }
2785     break;
2786
2787   case 96:
2788
2789 /* Line 1455 of yacc.c  */
2790 #line 929 "parse.y"
2791     {
2792                         if ( (yyvsp[(2) - (2)]) == nlch )
2793                                 rule_has_nl[num_rules] = true;
2794
2795                         ++rulelen;
2796
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)]));
2801
2802                         (yyval) = link_machines( (yyvsp[(1) - (2)]), (yyval));
2803                         }
2804     break;
2805
2806   case 97:
2807
2808 /* Line 1455 of yacc.c  */
2809 #line 944 "parse.y"
2810     { (yyval) = mkstate( SYM_EPSILON ); }
2811     break;
2812
2813
2814
2815 /* Line 1455 of yacc.c  */
2816 #line 2817 "parse.c"
2817       default: break;
2818     }
2819   YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
2820
2821   YYPOPSTACK (yylen);
2822   yylen = 0;
2823   YY_STACK_PRINT (yyss, yyssp);
2824
2825   *++yyvsp = yyval;
2826
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.  */
2830
2831   yyn = yyr1[yyn];
2832
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];
2838
2839   goto yynewstate;
2840
2841
2842 /*------------------------------------.
2843 | yyerrlab -- here on detecting error |
2844 `------------------------------------*/
2845 yyerrlab:
2846   /* If not already recovering from an error, report this error.  */
2847   if (!yyerrstatus)
2848     {
2849       ++yynerrs;
2850 #if ! YYERROR_VERBOSE
2851       yyerror (YY_("syntax error"));
2852 #else
2853       {
2854         YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
2855         if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
2856           {
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
2866               {
2867                 yymsg = yymsgbuf;
2868                 yymsg_alloc = sizeof yymsgbuf;
2869               }
2870           }
2871
2872         if (0 < yysize && yysize <= yymsg_alloc)
2873           {
2874             (void) yysyntax_error (yymsg, yystate, yychar);
2875             yyerror (yymsg);
2876           }
2877         else
2878           {
2879             yyerror (YY_("syntax error"));
2880             if (yysize != 0)
2881               goto yyexhaustedlab;
2882           }
2883       }
2884 #endif
2885     }
2886
2887
2888
2889   if (yyerrstatus == 3)
2890     {
2891       /* If just tried and failed to reuse lookahead token after an
2892          error, discard it.  */
2893
2894       if (yychar <= YYEOF)
2895         {
2896           /* Return failure if at end of input.  */
2897           if (yychar == YYEOF)
2898             YYABORT;
2899         }
2900       else
2901         {
2902           yydestruct ("Error: discarding",
2903                       yytoken, &yylval);
2904           yychar = YYEMPTY;
2905         }
2906     }
2907
2908   /* Else will try to reuse lookahead token after shifting the error
2909      token.  */
2910   goto yyerrlab1;
2911
2912
2913 /*---------------------------------------------------.
2914 | yyerrorlab -- error raised explicitly by YYERROR.  |
2915 `---------------------------------------------------*/
2916 yyerrorlab:
2917
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;
2923
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;
2931
2932
2933 /*-------------------------------------------------------------.
2934 | yyerrlab1 -- common code for both syntax error and YYERROR.  |
2935 `-------------------------------------------------------------*/
2936 yyerrlab1:
2937   yyerrstatus = 3;      /* Each real token shifted decrements this.  */
2938
2939   for (;;)
2940     {
2941       yyn = yypact[yystate];
2942       if (yyn != YYPACT_NINF)
2943         {
2944           yyn += YYTERROR;
2945           if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
2946             {
2947               yyn = yytable[yyn];
2948               if (0 < yyn)
2949                 break;
2950             }
2951         }
2952
2953       /* Pop the current state because it cannot handle the error token.  */
2954       if (yyssp == yyss)
2955         YYABORT;
2956
2957
2958       yydestruct ("Error: popping",
2959                   yystos[yystate], yyvsp);
2960       YYPOPSTACK (1);
2961       yystate = *yyssp;
2962       YY_STACK_PRINT (yyss, yyssp);
2963     }
2964
2965   *++yyvsp = yylval;
2966
2967
2968   /* Shift the error token.  */
2969   YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
2970
2971   yystate = yyn;
2972   goto yynewstate;
2973
2974
2975 /*-------------------------------------.
2976 | yyacceptlab -- YYACCEPT comes here.  |
2977 `-------------------------------------*/
2978 yyacceptlab:
2979   yyresult = 0;
2980   goto yyreturn;
2981
2982 /*-----------------------------------.
2983 | yyabortlab -- YYABORT comes here.  |
2984 `-----------------------------------*/
2985 yyabortlab:
2986   yyresult = 1;
2987   goto yyreturn;
2988
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
2998
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)
3008     {
3009       yydestruct ("Cleanup: popping",
3010                   yystos[*yyssp], yyvsp);
3011       YYPOPSTACK (1);
3012     }
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);
3023 }
3024
3025
3026
3027 /* Line 1675 of yacc.c  */
3028 #line 947 "parse.y"
3029
3030
3031
3032 /* build_eof_action - build the "<<EOF>>" action for the active start
3033  *                    conditions
3034  */
3035
3036 void build_eof_action()
3037         {
3038         register int i;
3039         char action_text[MAXLINE];
3040
3041         for ( i = 1; i <= scon_stk_ptr; ++i )
3042                 {
3043                 if ( sceof[scon_stk[i]] )
3044                         format_pinpoint_message(
3045                                 "multiple <<EOF>> rules for start condition %s",
3046                                 scname[scon_stk[i]] );
3047
3048                 else
3049                         {
3050                         sceof[scon_stk[i]] = true;
3051
3052                         if (previous_continued_action /* && previous action was regular */)
3053                                 add_action("YY_RULE_SETUP\n");
3054
3055                         snprintf( action_text, sizeof(action_text), "case YY_STATE_EOF(%s):\n",
3056                                 scname[scon_stk[i]] );
3057                         add_action( action_text );
3058                         }
3059                 }
3060
3061         line_directive_out( (FILE *) 0, 1 );
3062
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.
3067          */
3068         --num_rules;
3069         ++num_eof_rules;
3070         }
3071
3072
3073 /* format_synerr - write out formatted syntax error */
3074
3075 void format_synerr( msg, arg )
3076 const char *msg, arg[];
3077         {
3078         char errmsg[MAXLINE];
3079
3080         (void) snprintf( errmsg, sizeof(errmsg), msg, arg );
3081         synerr( errmsg );
3082         }
3083
3084
3085 /* synerr - report a syntax error */
3086
3087 void synerr( str )
3088 const char *str;
3089         {
3090         syntaxerror = true;
3091         pinpoint_message( str );
3092         }
3093
3094
3095 /* format_warn - write out formatted warning */
3096
3097 void format_warn( msg, arg )
3098 const char *msg, arg[];
3099         {
3100         char warn_msg[MAXLINE];
3101
3102         snprintf( warn_msg, sizeof(warn_msg), msg, arg );
3103         warn( warn_msg );
3104         }
3105
3106
3107 /* warn - report a warning, unless -w was given */
3108
3109 void warn( str )
3110 const char *str;
3111         {
3112         line_warning( str, linenum );
3113         }
3114
3115 /* format_pinpoint_message - write out a message formatted with one string,
3116  *                           pinpointing its location
3117  */
3118
3119 void format_pinpoint_message( msg, arg )
3120 const char *msg, arg[];
3121         {
3122         char errmsg[MAXLINE];
3123
3124         snprintf( errmsg, sizeof(errmsg), msg, arg );
3125         pinpoint_message( errmsg );
3126         }
3127
3128
3129 /* pinpoint_message - write out a message, pinpointing its location */
3130
3131 void pinpoint_message( str )
3132 const char *str;
3133         {
3134         line_pinpoint( str, linenum );
3135         }
3136
3137
3138 /* line_warning - report a warning at a given line, unless -w was given */
3139
3140 void line_warning( str, line )
3141 const char *str;
3142 int line;
3143         {
3144         char warning[MAXLINE];
3145
3146         if ( ! nowarn )
3147                 {
3148                 snprintf( warning, sizeof(warning), "warning, %s", str );
3149                 line_pinpoint( warning, line );
3150                 }
3151         }
3152
3153
3154 /* line_pinpoint - write out a message, pinpointing it at the given line */
3155
3156 void line_pinpoint( str, line )
3157 const char *str;
3158 int line;
3159         {
3160         fprintf( stderr, "%s:%d: %s\n", infilename, line, str );
3161         }
3162
3163
3164 /* yyerror - eat up an error message from the parser;
3165  *           currently, messages are ignore
3166  */
3167
3168 void yyerror( msg )
3169 const char *msg;
3170         {
3171         }
3172