Do not use macro for installation
[profile/ivi/flex.git] / parse.c
1 /* A Bison parser, made by GNU Bison 2.1.  */
2
3 /* Skeleton parser for Yacc-like parsing with Bison,
4    Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
5
6    This program is free software; you can redistribute it and/or modify
7    it under the terms of the GNU General Public License as published by
8    the Free Software Foundation; either version 2, or (at your option)
9    any later version.
10
11    This program is distributed in the hope that it will be useful,
12    but WITHOUT ANY WARRANTY; without even the implied warranty of
13    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14    GNU General Public License for more details.
15
16    You should have received a copy of the GNU General Public License
17    along with this program; if not, write to the Free Software
18    Foundation, Inc., 51 Franklin Street, Fifth Floor,
19    Boston, MA 02110-1301, USA.  */
20
21 /* As a special exception, when this file is copied by Bison into a
22    Bison output file, you may use that output file without restriction.
23    This special exception was added by the Free Software Foundation
24    in version 1.24 of Bison.  */
25
26 /* Written by Richard Stallman by simplifying the original so called
27    ``semantic'' parser.  */
28
29 /* All symbols defined below should begin with yy or YY, to avoid
30    infringing on user name space.  This should be done even for local
31    variables, as they might otherwise be expanded by user macros.
32    There are some unavoidable exceptions within include files to
33    define necessary library symbols; they are noted "INFRINGES ON
34    USER NAME SPACE" below.  */
35
36 /* Identify Bison output.  */
37 #define YYBISON 1
38
39 /* Bison version.  */
40 #define YYBISON_VERSION "2.1"
41
42 /* Skeleton name.  */
43 #define YYSKELETON_NAME "yacc.c"
44
45 /* Pure parsers.  */
46 #define YYPURE 0
47
48 /* Using locations.  */
49 #define YYLSP_NEEDED 0
50
51
52
53 /* Tokens.  */
54 #ifndef YYTOKENTYPE
55 # define YYTOKENTYPE
56    /* Put the tokens into the symbol table, so that GDB and other debuggers
57       know about them.  */
58    enum yytokentype {
59      CHAR = 258,
60      NUMBER = 259,
61      SECTEND = 260,
62      SCDECL = 261,
63      XSCDECL = 262,
64      NAME = 263,
65      PREVCCL = 264,
66      EOF_OP = 265,
67      OPTION_OP = 266,
68      OPT_OUTFILE = 267,
69      OPT_PREFIX = 268,
70      OPT_YYCLASS = 269,
71      OPT_HEADER = 270,
72      OPT_EXTRA_TYPE = 271,
73      OPT_TABLES = 272,
74      CCE_ALNUM = 273,
75      CCE_ALPHA = 274,
76      CCE_BLANK = 275,
77      CCE_CNTRL = 276,
78      CCE_DIGIT = 277,
79      CCE_GRAPH = 278,
80      CCE_LOWER = 279,
81      CCE_PRINT = 280,
82      CCE_PUNCT = 281,
83      CCE_SPACE = 282,
84      CCE_UPPER = 283,
85      CCE_XDIGIT = 284,
86      CCE_NEG_ALNUM = 285,
87      CCE_NEG_ALPHA = 286,
88      CCE_NEG_BLANK = 287,
89      CCE_NEG_CNTRL = 288,
90      CCE_NEG_DIGIT = 289,
91      CCE_NEG_GRAPH = 290,
92      CCE_NEG_LOWER = 291,
93      CCE_NEG_PRINT = 292,
94      CCE_NEG_PUNCT = 293,
95      CCE_NEG_SPACE = 294,
96      CCE_NEG_UPPER = 295,
97      CCE_NEG_XDIGIT = 296,
98      CCL_OP_UNION = 297,
99      CCL_OP_DIFF = 298,
100      BEGIN_REPEAT_POSIX = 299,
101      END_REPEAT_POSIX = 300,
102      BEGIN_REPEAT_FLEX = 301,
103      END_REPEAT_FLEX = 302
104    };
105 #endif
106 /* Tokens.  */
107 #define CHAR 258
108 #define NUMBER 259
109 #define SECTEND 260
110 #define SCDECL 261
111 #define XSCDECL 262
112 #define NAME 263
113 #define PREVCCL 264
114 #define EOF_OP 265
115 #define OPTION_OP 266
116 #define OPT_OUTFILE 267
117 #define OPT_PREFIX 268
118 #define OPT_YYCLASS 269
119 #define OPT_HEADER 270
120 #define OPT_EXTRA_TYPE 271
121 #define OPT_TABLES 272
122 #define CCE_ALNUM 273
123 #define CCE_ALPHA 274
124 #define CCE_BLANK 275
125 #define CCE_CNTRL 276
126 #define CCE_DIGIT 277
127 #define CCE_GRAPH 278
128 #define CCE_LOWER 279
129 #define CCE_PRINT 280
130 #define CCE_PUNCT 281
131 #define CCE_SPACE 282
132 #define CCE_UPPER 283
133 #define CCE_XDIGIT 284
134 #define CCE_NEG_ALNUM 285
135 #define CCE_NEG_ALPHA 286
136 #define CCE_NEG_BLANK 287
137 #define CCE_NEG_CNTRL 288
138 #define CCE_NEG_DIGIT 289
139 #define CCE_NEG_GRAPH 290
140 #define CCE_NEG_LOWER 291
141 #define CCE_NEG_PRINT 292
142 #define CCE_NEG_PUNCT 293
143 #define CCE_NEG_SPACE 294
144 #define CCE_NEG_UPPER 295
145 #define CCE_NEG_XDIGIT 296
146 #define CCL_OP_UNION 297
147 #define CCL_OP_DIFF 298
148 #define BEGIN_REPEAT_POSIX 299
149 #define END_REPEAT_POSIX 300
150 #define BEGIN_REPEAT_FLEX 301
151 #define END_REPEAT_FLEX 302
152
153
154
155
156 /* Copy the first part of user declarations.  */
157 #line 34 "parse.y"
158
159 /*  Copyright (c) 1990 The Regents of the University of California. */
160 /*  All rights reserved. */
161
162 /*  This code is derived from software contributed to Berkeley by */
163 /*  Vern Paxson. */
164
165 /*  The United States Government has rights in this work pursuant */
166 /*  to contract no. DE-AC03-76SF00098 between the United States */
167 /*  Department of Energy and the University of California. */
168
169 /*  This file is part of flex. */
170
171 /*  Redistribution and use in source and binary forms, with or without */
172 /*  modification, are permitted provided that the following conditions */
173 /*  are met: */
174
175 /*  1. Redistributions of source code must retain the above copyright */
176 /*     notice, this list of conditions and the following disclaimer. */
177 /*  2. Redistributions in binary form must reproduce the above copyright */
178 /*     notice, this list of conditions and the following disclaimer in the */
179 /*     documentation and/or other materials provided with the distribution. */
180
181 /*  Neither the name of the University nor the names of its contributors */
182 /*  may be used to endorse or promote products derived from this software */
183 /*  without specific prior written permission. */
184
185 /*  THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR */
186 /*  IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED */
187 /*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR */
188 /*  PURPOSE. */
189
190 #include "flexdef.h"
191 #include "tables.h"
192
193 int pat, scnum, eps, headcnt, trailcnt, lastchar, i, rulelen;
194 int trlcontxt, xcluflg, currccl, cclsorted, varlength, variable_trail_rule;
195
196 int *scon_stk;
197 int scon_stk_ptr;
198
199 static int madeany = false;  /* whether we've made the '.' character class */
200 static int ccldot, cclany;
201 int previous_continued_action;  /* whether the previous rule's action was '|' */
202
203 #define format_warn3(fmt, a1, a2) \
204         do{ \
205         char fw3_msg[MAXLINE];\
206         snprintf( fw3_msg, MAXLINE,(fmt), (a1), (a2) );\
207         warn( fw3_msg );\
208         }while(0)
209
210 /* Expand a POSIX character class expression. */
211 #define CCL_EXPR(func) \
212         do{ \
213         int c; \
214         for ( c = 0; c < csize; ++c ) \
215                 if ( isascii(c) && func(c) ) \
216                         ccladd( currccl, c ); \
217         }while(0)
218
219 /* negated class */
220 #define CCL_NEG_EXPR(func) \
221         do{ \
222         int c; \
223         for ( c = 0; c < csize; ++c ) \
224                 if ( !func(c) ) \
225                         ccladd( currccl, c ); \
226         }while(0)
227
228 /* While POSIX defines isblank(), it's not ANSI C. */
229 #define IS_BLANK(c) ((c) == ' ' || (c) == '\t')
230
231 /* On some over-ambitious machines, such as DEC Alpha's, the default
232  * token type is "long" instead of "int"; this leads to problems with
233  * declaring yylval in flexdef.h.  But so far, all the yacc's I've seen
234  * wrap their definitions of YYSTYPE with "#ifndef YYSTYPE"'s, so the
235  * following should ensure that the default token type is "int".
236  */
237 #define YYSTYPE int
238
239
240
241 /* Enabling traces.  */
242 #ifndef YYDEBUG
243 # define YYDEBUG 0
244 #endif
245
246 /* Enabling verbose error messages.  */
247 #ifdef YYERROR_VERBOSE
248 # undef YYERROR_VERBOSE
249 # define YYERROR_VERBOSE 1
250 #else
251 # define YYERROR_VERBOSE 0
252 #endif
253
254 /* Enabling the token table.  */
255 #ifndef YYTOKEN_TABLE
256 # define YYTOKEN_TABLE 0
257 #endif
258
259 #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
260 typedef int YYSTYPE;
261 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
262 # define YYSTYPE_IS_DECLARED 1
263 # define YYSTYPE_IS_TRIVIAL 1
264 #endif
265
266
267
268 /* Copy the second part of user declarations.  */
269
270
271 /* Line 219 of yacc.c.  */
272 #line 273 "parse.c"
273
274 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
275 # define YYSIZE_T __SIZE_TYPE__
276 #endif
277 #if ! defined (YYSIZE_T) && defined (size_t)
278 # define YYSIZE_T size_t
279 #endif
280 #if ! defined (YYSIZE_T) && (defined (__STDC__) || defined (__cplusplus))
281 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
282 # define YYSIZE_T size_t
283 #endif
284 #if ! defined (YYSIZE_T)
285 # define YYSIZE_T unsigned int
286 #endif
287
288 #ifndef YY_
289 # if YYENABLE_NLS
290 #  if ENABLE_NLS
291 #   include <libintl.h> /* INFRINGES ON USER NAME SPACE */
292 #   define YY_(msgid) dgettext ("bison-runtime", msgid)
293 #  endif
294 # endif
295 # ifndef YY_
296 #  define YY_(msgid) msgid
297 # endif
298 #endif
299
300 #if ! defined (yyoverflow) || YYERROR_VERBOSE
301
302 /* The parser invokes alloca or malloc; define the necessary symbols.  */
303
304 # ifdef YYSTACK_USE_ALLOCA
305 #  if YYSTACK_USE_ALLOCA
306 #   ifdef __GNUC__
307 #    define YYSTACK_ALLOC __builtin_alloca
308 #   else
309 #    define YYSTACK_ALLOC alloca
310 #    if defined (__STDC__) || defined (__cplusplus)
311 #     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
312 #     define YYINCLUDED_STDLIB_H
313 #    endif
314 #   endif
315 #  endif
316 # endif
317
318 # ifdef YYSTACK_ALLOC
319    /* Pacify GCC's `empty if-body' warning. */
320 #  define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
321 #  ifndef YYSTACK_ALLOC_MAXIMUM
322     /* The OS might guarantee only one guard page at the bottom of the stack,
323        and a page size can be as small as 4096 bytes.  So we cannot safely
324        invoke alloca (N) if N exceeds 4096.  Use a slightly smaller number
325        to allow for a few compiler-allocated temporary stack slots.  */
326 #   define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2005 */
327 #  endif
328 # else
329 #  define YYSTACK_ALLOC YYMALLOC
330 #  define YYSTACK_FREE YYFREE
331 #  ifndef YYSTACK_ALLOC_MAXIMUM
332 #   define YYSTACK_ALLOC_MAXIMUM ((YYSIZE_T) -1)
333 #  endif
334 #  ifdef __cplusplus
335 extern "C" {
336 #  endif
337 #  ifndef YYMALLOC
338 #   define YYMALLOC malloc
339 #   if (! defined (malloc) && ! defined (YYINCLUDED_STDLIB_H) \
340         && (defined (__STDC__) || defined (__cplusplus)))
341 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
342 #   endif
343 #  endif
344 #  ifndef YYFREE
345 #   define YYFREE free
346 #   if (! defined (free) && ! defined (YYINCLUDED_STDLIB_H) \
347         && (defined (__STDC__) || defined (__cplusplus)))
348 void free (void *); /* INFRINGES ON USER NAME SPACE */
349 #   endif
350 #  endif
351 #  ifdef __cplusplus
352 }
353 #  endif
354 # endif
355 #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
356
357
358 #if (! defined (yyoverflow) \
359      && (! defined (__cplusplus) \
360          || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL)))
361
362 /* A type that is properly aligned for any stack member.  */
363 union yyalloc
364 {
365   short int yyss;
366   YYSTYPE yyvs;
367   };
368
369 /* The size of the maximum gap between one aligned stack and the next.  */
370 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
371
372 /* The size of an array large to enough to hold all stacks, each with
373    N elements.  */
374 # define YYSTACK_BYTES(N) \
375      ((N) * (sizeof (short int) + sizeof (YYSTYPE))                     \
376       + YYSTACK_GAP_MAXIMUM)
377
378 /* Copy COUNT objects from FROM to TO.  The source and destination do
379    not overlap.  */
380 # ifndef YYCOPY
381 #  if defined (__GNUC__) && 1 < __GNUC__
382 #   define YYCOPY(To, From, Count) \
383       __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
384 #  else
385 #   define YYCOPY(To, From, Count)              \
386       do                                        \
387         {                                       \
388           YYSIZE_T yyi;                         \
389           for (yyi = 0; yyi < (Count); yyi++)   \
390             (To)[yyi] = (From)[yyi];            \
391         }                                       \
392       while (0)
393 #  endif
394 # endif
395
396 /* Relocate STACK from its old location to the new one.  The
397    local variables YYSIZE and YYSTACKSIZE give the old and new number of
398    elements in the stack, and YYPTR gives the new location of the
399    stack.  Advance YYPTR to a properly aligned location for the next
400    stack.  */
401 # define YYSTACK_RELOCATE(Stack)                                        \
402     do                                                                  \
403       {                                                                 \
404         YYSIZE_T yynewbytes;                                            \
405         YYCOPY (&yyptr->Stack, Stack, yysize);                          \
406         Stack = &yyptr->Stack;                                          \
407         yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
408         yyptr += yynewbytes / sizeof (*yyptr);                          \
409       }                                                                 \
410     while (0)
411
412 #endif
413
414 #if defined (__STDC__) || defined (__cplusplus)
415    typedef signed char yysigned_char;
416 #else
417    typedef short int yysigned_char;
418 #endif
419
420 /* YYFINAL -- State number of the termination state. */
421 #define YYFINAL  3
422 /* YYLAST -- Last index in YYTABLE.  */
423 #define YYLAST   161
424
425 /* YYNTOKENS -- Number of terminals. */
426 #define YYNTOKENS  69
427 /* YYNNTS -- Number of nonterminals. */
428 #define YYNNTS  27
429 /* YYNRULES -- Number of rules. */
430 #define YYNRULES  97
431 /* YYNRULES -- Number of states. */
432 #define YYNSTATES  140
433
434 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
435 #define YYUNDEFTOK  2
436 #define YYMAXUTOK   302
437
438 #define YYTRANSLATE(YYX)                                                \
439   ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
440
441 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX.  */
442 static const unsigned char yytranslate[] =
443 {
444        0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
445       49,     2,     2,     2,     2,     2,     2,     2,     2,     2,
446        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
447        2,     2,     2,     2,    63,     2,    57,     2,     2,     2,
448       64,    65,    55,    60,    56,    68,    62,    59,     2,     2,
449        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
450       53,    48,    54,    61,     2,     2,     2,     2,     2,     2,
451        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
452        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
453        2,    66,     2,    67,    52,     2,     2,     2,     2,     2,
454        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
455        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
456        2,     2,     2,    50,    58,    51,     2,     2,     2,     2,
457        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
458        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
459        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
460        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
461        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
462        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
463        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
464        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
465        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
466        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
467        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
468        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
469        2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
470        5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
471       15,    16,    17,    18,    19,    20,    21,    22,    23,    24,
472       25,    26,    27,    28,    29,    30,    31,    32,    33,    34,
473       35,    36,    37,    38,    39,    40,    41,    42,    43,    44,
474       45,    46,    47
475 };
476
477 #if YYDEBUG
478 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
479    YYRHS.  */
480 static const unsigned short int yyprhs[] =
481 {
482        0,     0,     3,     9,    10,    14,    17,    18,    20,    22,
483       24,    26,    29,    31,    33,    36,    39,    40,    44,    48,
484       52,    56,    60,    64,    70,    76,    77,    78,    81,    83,
485       85,    87,    88,    93,    97,    98,   102,   104,   106,   108,
486      111,   115,   118,   120,   124,   126,   129,   132,   134,   141,
487      147,   152,   155,   158,   161,   168,   174,   179,   181,   183,
488      185,   189,   193,   195,   199,   203,   205,   209,   214,   219,
489      222,   225,   226,   228,   230,   232,   234,   236,   238,   240,
490      242,   244,   246,   248,   250,   252,   254,   256,   258,   260,
491      262,   264,   266,   268,   270,   272,   274,   277
492 };
493
494 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
495 static const yysigned_char yyrhs[] =
496 {
497       70,     0,    -1,    71,    72,    73,    79,    80,    -1,    -1,
498       72,    74,    75,    -1,    72,    76,    -1,    -1,     1,    -1,
499        5,    -1,     6,    -1,     7,    -1,    75,     8,    -1,     8,
500       -1,     1,    -1,    11,    77,    -1,    77,    78,    -1,    -1,
501       12,    48,     8,    -1,    16,    48,     8,    -1,    13,    48,
502        8,    -1,    14,    48,     8,    -1,    15,    48,     8,    -1,
503       17,    48,     8,    -1,    79,    83,    80,    81,    49,    -1,
504       79,    83,    50,    79,    51,    -1,    -1,    -1,    52,    86,
505       -1,    86,    -1,    10,    -1,     1,    -1,    -1,    53,    82,
506       84,    54,    -1,    53,    55,    54,    -1,    -1,    84,    56,
507       85,    -1,    85,    -1,     1,    -1,     8,    -1,    88,    87,
508       -1,    88,    87,    57,    -1,    87,    57,    -1,    87,    -1,
509       87,    58,    89,    -1,    89,    -1,    87,    59,    -1,    89,
510       90,    -1,    90,    -1,    89,    44,     4,    56,     4,    45,
511       -1,    89,    44,     4,    56,    45,    -1,    89,    44,     4,
512       45,    -1,    90,    55,    -1,    90,    60,    -1,    90,    61,
513       -1,    90,    46,     4,    56,     4,    47,    -1,    90,    46,
514        4,    56,    47,    -1,    90,    46,     4,    47,    -1,    62,
515       -1,    91,    -1,     9,    -1,    63,    95,    63,    -1,    64,
516       87,    65,    -1,     3,    -1,    91,    43,    92,    -1,    91,
517       42,    92,    -1,    92,    -1,    66,    93,    67,    -1,    66,
518       52,    93,    67,    -1,    93,     3,    68,     3,    -1,    93,
519        3,    -1,    93,    94,    -1,    -1,    18,    -1,    19,    -1,
520       20,    -1,    21,    -1,    22,    -1,    23,    -1,    24,    -1,
521       25,    -1,    26,    -1,    27,    -1,    29,    -1,    28,    -1,
522       30,    -1,    31,    -1,    32,    -1,    33,    -1,    34,    -1,
523       35,    -1,    37,    -1,    38,    -1,    39,    -1,    41,    -1,
524       36,    -1,    40,    -1,    95,     3,    -1,    -1
525 };
526
527 /* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
528 static const unsigned short int yyrline[] =
529 {
530        0,   118,   118,   148,   155,   156,   157,   158,   162,   170,
531      173,   177,   180,   183,   187,   190,   191,   194,   199,   201,
532      203,   205,   207,   211,   213,   215,   219,   231,   267,   291,
533      314,   319,   322,   325,   343,   346,   348,   350,   354,   377,
534      433,   436,   479,   497,   503,   508,   535,   543,   546,   574,
535      588,   610,   617,   623,   629,   657,   671,   690,   724,   744,
536      754,   757,   760,   775,   776,   777,   782,   784,   791,   851,
537      869,   877,   885,   886,   887,   888,   889,   890,   891,   896,
538      897,   898,   899,   900,   906,   907,   908,   909,   910,   911,
539      912,   913,   914,   915,   916,   922,   930,   946
540 };
541 #endif
542
543 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
544 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
545    First, the terminals, then, starting at YYNTOKENS, nonterminals. */
546 static const char *const yytname[] =
547 {
548   "$end", "error", "$undefined", "CHAR", "NUMBER", "SECTEND", "SCDECL",
549   "XSCDECL", "NAME", "PREVCCL", "EOF_OP", "OPTION_OP", "OPT_OUTFILE",
550   "OPT_PREFIX", "OPT_YYCLASS", "OPT_HEADER", "OPT_EXTRA_TYPE",
551   "OPT_TABLES", "CCE_ALNUM", "CCE_ALPHA", "CCE_BLANK", "CCE_CNTRL",
552   "CCE_DIGIT", "CCE_GRAPH", "CCE_LOWER", "CCE_PRINT", "CCE_PUNCT",
553   "CCE_SPACE", "CCE_UPPER", "CCE_XDIGIT", "CCE_NEG_ALNUM", "CCE_NEG_ALPHA",
554   "CCE_NEG_BLANK", "CCE_NEG_CNTRL", "CCE_NEG_DIGIT", "CCE_NEG_GRAPH",
555   "CCE_NEG_LOWER", "CCE_NEG_PRINT", "CCE_NEG_PUNCT", "CCE_NEG_SPACE",
556   "CCE_NEG_UPPER", "CCE_NEG_XDIGIT", "CCL_OP_UNION", "CCL_OP_DIFF",
557   "BEGIN_REPEAT_POSIX", "END_REPEAT_POSIX", "BEGIN_REPEAT_FLEX",
558   "END_REPEAT_FLEX", "'='", "'\\n'", "'{'", "'}'", "'^'", "'<'", "'>'",
559   "'*'", "','", "'$'", "'|'", "'/'", "'+'", "'?'", "'.'", "'\"'", "'('",
560   "')'", "'['", "']'", "'-'", "$accept", "goal", "initlex", "sect1",
561   "sect1end", "startconddecl", "namelist1", "options", "optionlist",
562   "option", "sect2", "initforrule", "flexrule", "scon_stk_ptr", "scon",
563   "namelist2", "sconname", "rule", "re", "re2", "series", "singleton",
564   "fullccl", "braceccl", "ccl", "ccl_expr", "string", 0
565 };
566 #endif
567
568 # ifdef YYPRINT
569 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
570    token YYLEX-NUM.  */
571 static const unsigned short int yytoknum[] =
572 {
573        0,   256,   257,   258,   259,   260,   261,   262,   263,   264,
574      265,   266,   267,   268,   269,   270,   271,   272,   273,   274,
575      275,   276,   277,   278,   279,   280,   281,   282,   283,   284,
576      285,   286,   287,   288,   289,   290,   291,   292,   293,   294,
577      295,   296,   297,   298,   299,   300,   301,   302,    61,    10,
578      123,   125,    94,    60,    62,    42,    44,    36,   124,    47,
579       43,    63,    46,    34,    40,    41,    91,    93,    45
580 };
581 # endif
582
583 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
584 static const unsigned char yyr1[] =
585 {
586        0,    69,    70,    71,    72,    72,    72,    72,    73,    74,
587       74,    75,    75,    75,    76,    77,    77,    78,    78,    78,
588       78,    78,    78,    79,    79,    79,    80,    81,    81,    81,
589       81,    82,    83,    83,    83,    84,    84,    84,    85,    86,
590       86,    86,    86,    87,    87,    88,    89,    89,    89,    89,
591       89,    90,    90,    90,    90,    90,    90,    90,    90,    90,
592       90,    90,    90,    91,    91,    91,    92,    92,    93,    93,
593       93,    93,    94,    94,    94,    94,    94,    94,    94,    94,
594       94,    94,    94,    94,    94,    94,    94,    94,    94,    94,
595       94,    94,    94,    94,    94,    94,    95,    95
596 };
597
598 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
599 static const unsigned char yyr2[] =
600 {
601        0,     2,     5,     0,     3,     2,     0,     1,     1,     1,
602        1,     2,     1,     1,     2,     2,     0,     3,     3,     3,
603        3,     3,     3,     5,     5,     0,     0,     2,     1,     1,
604        1,     0,     4,     3,     0,     3,     1,     1,     1,     2,
605        3,     2,     1,     3,     1,     2,     2,     1,     6,     5,
606        4,     2,     2,     2,     6,     5,     4,     1,     1,     1,
607        3,     3,     1,     3,     3,     1,     3,     4,     4,     2,
608        2,     0,     1,     1,     1,     1,     1,     1,     1,     1,
609        1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
610        1,     1,     1,     1,     1,     1,     2,     0
611 };
612
613 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
614    STATE-NUM when YYTABLE doesn't specify something else to do.  Zero
615    means the default is an error.  */
616 static const unsigned char yydefact[] =
617 {
618        3,     0,     0,     1,     7,     0,     8,     9,    10,    16,
619       25,     0,     5,    14,    34,    13,    12,     4,     0,     0,
620        0,     0,     0,     0,    15,    31,     2,    26,    11,     0,
621        0,     0,     0,     0,     0,     0,     0,    25,     0,    17,
622       19,    20,    21,    18,    22,    33,    37,    38,     0,    36,
623       34,    30,    62,    59,    29,     0,    57,    97,     0,    71,
624        0,    28,    42,     0,    44,    47,    58,    65,    32,     0,
625       24,    27,     0,     0,    71,     0,    23,    41,     0,    45,
626       39,     0,    46,     0,    51,    52,    53,     0,     0,    35,
627       96,    60,    61,     0,    69,    72,    73,    74,    75,    76,
628       77,    78,    79,    80,    81,    83,    82,    84,    85,    86,
629       87,    88,    89,    94,    90,    91,    92,    95,    93,    66,
630       70,    43,    40,     0,     0,    64,    63,    67,     0,    50,
631        0,    56,     0,    68,     0,    49,     0,    55,    48,    54
632 };
633
634 /* YYDEFGOTO[NTERM-NUM]. */
635 static const yysigned_char yydefgoto[] =
636 {
637       -1,     1,     2,     5,    10,    11,    17,    12,    13,    24,
638       14,    26,    60,    36,    27,    48,    49,    61,    62,    63,
639       64,    65,    66,    67,    75,   120,    72
640 };
641
642 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
643    STATE-NUM.  */
644 #define YYPACT_NINF -52
645 static const short int yypact[] =
646 {
647      -52,    17,   103,   -52,   -52,   113,   -52,   -52,   -52,   -52,
648      -52,    48,   -52,   114,     6,   -52,   -52,    42,     7,    12,
649       58,    77,    88,    89,   -52,    43,   -52,    73,   -52,   130,
650      131,   132,   133,   134,   135,    90,    91,   -52,    -1,   -52,
651      -52,   -52,   -52,   -52,   -52,   -52,   -52,   -52,    40,   -52,
652       44,   -52,   -52,   -52,   -52,    39,   -52,   -52,    39,    93,
653       97,   -52,   -12,    39,    49,    61,   -31,   -52,   -52,   139,
654      -52,   -52,     1,   -51,   -52,     0,   -52,   -52,    39,   -52,
655       75,   144,    61,   145,   -52,   -52,   -52,    84,    84,   -52,
656      -52,   -52,   -52,    50,    83,   -52,   -52,   -52,   -52,   -52,
657      -52,   -52,   -52,   -52,   -52,   -52,   -52,   -52,   -52,   -52,
658      -52,   -52,   -52,   -52,   -52,   -52,   -52,   -52,   -52,   -52,
659      -52,    49,   -52,   -40,    10,   -52,   -52,   -52,   149,   -52,
660        9,   -52,    -3,   -52,   108,   -52,   107,   -52,   -52,   -52
661 };
662
663 /* YYPGOTO[NTERM-NUM].  */
664 static const short int yypgoto[] =
665 {
666      -52,   -52,   -52,   -52,   -52,   -52,   -52,   -52,   -52,   -52,
667      118,   129,   -52,   -52,   -52,   -52,    92,   102,   -48,   -52,
668       80,   -21,   -52,    47,    85,   -52,   -52
669 };
670
671 /* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
672    positive, shift that token.  If negative, reduce the rule which
673    number is the opposite.  If zero, do what YYDEFACT says.
674    If YYTABLE_NINF, syntax error.  */
675 #define YYTABLE_NINF -27
676 static const short int yytable[] =
677 {
678       51,   136,    52,    94,    90,   129,   -26,    78,    53,    54,
679       73,    87,    88,   134,    92,    80,   130,     3,    95,    96,
680       97,    98,    99,   100,   101,   102,   103,   104,   105,   106,
681      107,   108,   109,   110,   111,   112,   113,   114,   115,   116,
682      117,   118,    52,    82,   137,    77,    78,    79,    53,    15,
683       28,    55,    52,    94,   135,    29,    16,   131,    53,    25,
684       30,    56,    57,    58,    91,    59,   132,   119,    95,    96,
685       97,    98,    99,   100,   101,   102,   103,   104,   105,   106,
686      107,   108,   109,   110,   111,   112,   113,   114,   115,   116,
687      117,   118,    46,    81,    68,    70,    69,    25,    35,    47,
688       82,    56,    57,    58,     4,    59,    31,    83,    -6,    -6,
689       -6,    56,    57,    58,    -6,    59,    84,   127,     6,     7,
690        8,    85,    86,    37,     9,    32,    18,    19,    20,    21,
691       22,    23,   122,    78,   125,   126,    33,    34,    39,    40,
692       41,    42,    43,    44,    45,    74,    76,    47,   123,   124,
693       59,   128,   133,   138,   139,    50,    38,    71,   121,    93,
694        0,    89
695 };
696
697 static const yysigned_char yycheck[] =
698 {
699        1,     4,     3,     3,     3,    45,     0,    58,     9,    10,
700       58,    42,    43,     4,    65,    63,    56,     0,    18,    19,
701       20,    21,    22,    23,    24,    25,    26,    27,    28,    29,
702       30,    31,    32,    33,    34,    35,    36,    37,    38,    39,
703       40,    41,     3,    64,    47,    57,    58,    59,     9,     1,
704        8,    52,     3,     3,    45,    48,     8,    47,     9,    53,
705       48,    62,    63,    64,    63,    66,    56,    67,    18,    19,
706       20,    21,    22,    23,    24,    25,    26,    27,    28,    29,
707       30,    31,    32,    33,    34,    35,    36,    37,    38,    39,
708       40,    41,     1,    44,    54,    51,    56,    53,    55,     8,
709      121,    62,    63,    64,     1,    66,    48,    46,     5,     6,
710        7,    62,    63,    64,    11,    66,    55,    67,     5,     6,
711        7,    60,    61,    50,    11,    48,    12,    13,    14,    15,
712       16,    17,    57,    58,    87,    88,    48,    48,     8,     8,
713        8,     8,     8,     8,    54,    52,    49,     8,     4,     4,
714       66,    68,     3,    45,    47,    37,    27,    55,    78,    74,
715       -1,    69
716 };
717
718 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
719    symbol of state STATE-NUM.  */
720 static const unsigned char yystos[] =
721 {
722        0,    70,    71,     0,     1,    72,     5,     6,     7,    11,
723       73,    74,    76,    77,    79,     1,     8,    75,    12,    13,
724       14,    15,    16,    17,    78,    53,    80,    83,     8,    48,
725       48,    48,    48,    48,    48,    55,    82,    50,    80,     8,
726        8,     8,     8,     8,     8,    54,     1,     8,    84,    85,
727       79,     1,     3,     9,    10,    52,    62,    63,    64,    66,
728       81,    86,    87,    88,    89,    90,    91,    92,    54,    56,
729       51,    86,    95,    87,    52,    93,    49,    57,    58,    59,
730       87,    44,    90,    46,    55,    60,    61,    42,    43,    85,
731        3,    63,    65,    93,     3,    18,    19,    20,    21,    22,
732       23,    24,    25,    26,    27,    28,    29,    30,    31,    32,
733       33,    34,    35,    36,    37,    38,    39,    40,    41,    67,
734       94,    89,    57,     4,     4,    92,    92,    67,    68,    45,
735       56,    47,    56,     3,     4,    45,     4,    47,    45,    47
736 };
737
738 #define yyerrok         (yyerrstatus = 0)
739 #define yyclearin       (yychar = YYEMPTY)
740 #define YYEMPTY         (-2)
741 #define YYEOF           0
742
743 #define YYACCEPT        goto yyacceptlab
744 #define YYABORT         goto yyabortlab
745 #define YYERROR         goto yyerrorlab
746
747
748 /* Like YYERROR except do call yyerror.  This remains here temporarily
749    to ease the transition to the new meaning of YYERROR, for GCC.
750    Once GCC version 2 has supplanted version 1, this can go.  */
751
752 #define YYFAIL          goto yyerrlab
753
754 #define YYRECOVERING()  (!!yyerrstatus)
755
756 #define YYBACKUP(Token, Value)                                  \
757 do                                                              \
758   if (yychar == YYEMPTY && yylen == 1)                          \
759     {                                                           \
760       yychar = (Token);                                         \
761       yylval = (Value);                                         \
762       yytoken = YYTRANSLATE (yychar);                           \
763       YYPOPSTACK;                                               \
764       goto yybackup;                                            \
765     }                                                           \
766   else                                                          \
767     {                                                           \
768       yyerror (YY_("syntax error: cannot back up")); \
769       YYERROR;                                                  \
770     }                                                           \
771 while (0)
772
773
774 #define YYTERROR        1
775 #define YYERRCODE       256
776
777
778 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
779    If N is 0, then set CURRENT to the empty location which ends
780    the previous symbol: RHS[0] (always defined).  */
781
782 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
783 #ifndef YYLLOC_DEFAULT
784 # define YYLLOC_DEFAULT(Current, Rhs, N)                                \
785     do                                                                  \
786       if (N)                                                            \
787         {                                                               \
788           (Current).first_line   = YYRHSLOC (Rhs, 1).first_line;        \
789           (Current).first_column = YYRHSLOC (Rhs, 1).first_column;      \
790           (Current).last_line    = YYRHSLOC (Rhs, N).last_line;         \
791           (Current).last_column  = YYRHSLOC (Rhs, N).last_column;       \
792         }                                                               \
793       else                                                              \
794         {                                                               \
795           (Current).first_line   = (Current).last_line   =              \
796             YYRHSLOC (Rhs, 0).last_line;                                \
797           (Current).first_column = (Current).last_column =              \
798             YYRHSLOC (Rhs, 0).last_column;                              \
799         }                                                               \
800     while (0)
801 #endif
802
803
804 /* YY_LOCATION_PRINT -- Print the location on the stream.
805    This macro was not mandated originally: define only if we know
806    we won't break user code: when these are the locations we know.  */
807
808 #ifndef YY_LOCATION_PRINT
809 # if YYLTYPE_IS_TRIVIAL
810 #  define YY_LOCATION_PRINT(File, Loc)                  \
811      fprintf (File, "%d.%d-%d.%d",                      \
812               (Loc).first_line, (Loc).first_column,     \
813               (Loc).last_line,  (Loc).last_column)
814 # else
815 #  define YY_LOCATION_PRINT(File, Loc) ((void) 0)
816 # endif
817 #endif
818
819
820 /* YYLEX -- calling `yylex' with the right arguments.  */
821
822 #ifdef YYLEX_PARAM
823 # define YYLEX yylex (YYLEX_PARAM)
824 #else
825 # define YYLEX yylex ()
826 #endif
827
828 /* Enable debugging if requested.  */
829 #if YYDEBUG
830
831 # ifndef YYFPRINTF
832 #  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
833 #  define YYFPRINTF fprintf
834 # endif
835
836 # define YYDPRINTF(Args)                        \
837 do {                                            \
838   if (yydebug)                                  \
839     YYFPRINTF Args;                             \
840 } while (0)
841
842 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)          \
843 do {                                                            \
844   if (yydebug)                                                  \
845     {                                                           \
846       YYFPRINTF (stderr, "%s ", Title);                         \
847       yysymprint (stderr,                                       \
848                   Type, Value); \
849       YYFPRINTF (stderr, "\n");                                 \
850     }                                                           \
851 } while (0)
852
853 /*------------------------------------------------------------------.
854 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
855 | TOP (included).                                                   |
856 `------------------------------------------------------------------*/
857
858 #if defined (__STDC__) || defined (__cplusplus)
859 static void
860 yy_stack_print (short int *bottom, short int *top)
861 #else
862 static void
863 yy_stack_print (bottom, top)
864     short int *bottom;
865     short int *top;
866 #endif
867 {
868   YYFPRINTF (stderr, "Stack now");
869   for (/* Nothing. */; bottom <= top; ++bottom)
870     YYFPRINTF (stderr, " %d", *bottom);
871   YYFPRINTF (stderr, "\n");
872 }
873
874 # define YY_STACK_PRINT(Bottom, Top)                            \
875 do {                                                            \
876   if (yydebug)                                                  \
877     yy_stack_print ((Bottom), (Top));                           \
878 } while (0)
879
880
881 /*------------------------------------------------.
882 | Report that the YYRULE is going to be reduced.  |
883 `------------------------------------------------*/
884
885 #if defined (__STDC__) || defined (__cplusplus)
886 static void
887 yy_reduce_print (int yyrule)
888 #else
889 static void
890 yy_reduce_print (yyrule)
891     int yyrule;
892 #endif
893 {
894   int yyi;
895   unsigned long int yylno = yyrline[yyrule];
896   YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu), ",
897              yyrule - 1, yylno);
898   /* Print the symbols being reduced, and their result.  */
899   for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
900     YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]);
901   YYFPRINTF (stderr, "-> %s\n", yytname[yyr1[yyrule]]);
902 }
903
904 # define YY_REDUCE_PRINT(Rule)          \
905 do {                                    \
906   if (yydebug)                          \
907     yy_reduce_print (Rule);             \
908 } while (0)
909
910 /* Nonzero means print parse trace.  It is left uninitialized so that
911    multiple parsers can coexist.  */
912 int yydebug;
913 #else /* !YYDEBUG */
914 # define YYDPRINTF(Args)
915 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
916 # define YY_STACK_PRINT(Bottom, Top)
917 # define YY_REDUCE_PRINT(Rule)
918 #endif /* !YYDEBUG */
919
920
921 /* YYINITDEPTH -- initial size of the parser's stacks.  */
922 #ifndef YYINITDEPTH
923 # define YYINITDEPTH 200
924 #endif
925
926 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
927    if the built-in stack extension method is used).
928
929    Do not make this value too large; the results are undefined if
930    YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
931    evaluated with infinite-precision integer arithmetic.  */
932
933 #ifndef YYMAXDEPTH
934 # define YYMAXDEPTH 10000
935 #endif
936
937 \f
938
939 #if YYERROR_VERBOSE
940
941 # ifndef yystrlen
942 #  if defined (__GLIBC__) && defined (_STRING_H)
943 #   define yystrlen strlen
944 #  else
945 /* Return the length of YYSTR.  */
946 static YYSIZE_T
947 #   if defined (__STDC__) || defined (__cplusplus)
948 yystrlen (const char *yystr)
949 #   else
950 yystrlen (yystr)
951      const char *yystr;
952 #   endif
953 {
954   const char *yys = yystr;
955
956   while (*yys++ != '\0')
957     continue;
958
959   return yys - yystr - 1;
960 }
961 #  endif
962 # endif
963
964 # ifndef yystpcpy
965 #  if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
966 #   define yystpcpy stpcpy
967 #  else
968 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
969    YYDEST.  */
970 static char *
971 #   if defined (__STDC__) || defined (__cplusplus)
972 yystpcpy (char *yydest, const char *yysrc)
973 #   else
974 yystpcpy (yydest, yysrc)
975      char *yydest;
976      const char *yysrc;
977 #   endif
978 {
979   char *yyd = yydest;
980   const char *yys = yysrc;
981
982   while ((*yyd++ = *yys++) != '\0')
983     continue;
984
985   return yyd - 1;
986 }
987 #  endif
988 # endif
989
990 # ifndef yytnamerr
991 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
992    quotes and backslashes, so that it's suitable for yyerror.  The
993    heuristic is that double-quoting is unnecessary unless the string
994    contains an apostrophe, a comma, or backslash (other than
995    backslash-backslash).  YYSTR is taken from yytname.  If YYRES is
996    null, do not copy; instead, return the length of what the result
997    would have been.  */
998 static YYSIZE_T
999 yytnamerr (char *yyres, const char *yystr)
1000 {
1001   if (*yystr == '"')
1002     {
1003       size_t yyn = 0;
1004       char const *yyp = yystr;
1005
1006       for (;;)
1007         switch (*++yyp)
1008           {
1009           case '\'':
1010           case ',':
1011             goto do_not_strip_quotes;
1012
1013           case '\\':
1014             if (*++yyp != '\\')
1015               goto do_not_strip_quotes;
1016             /* Fall through.  */
1017           default:
1018             if (yyres)
1019               yyres[yyn] = *yyp;
1020             yyn++;
1021             break;
1022
1023           case '"':
1024             if (yyres)
1025               yyres[yyn] = '\0';
1026             return yyn;
1027           }
1028     do_not_strip_quotes: ;
1029     }
1030
1031   if (! yyres)
1032     return yystrlen (yystr);
1033
1034   return yystpcpy (yyres, yystr) - yyres;
1035 }
1036 # endif
1037
1038 #endif /* YYERROR_VERBOSE */
1039
1040 \f
1041
1042 #if YYDEBUG
1043 /*--------------------------------.
1044 | Print this symbol on YYOUTPUT.  |
1045 `--------------------------------*/
1046
1047 #if defined (__STDC__) || defined (__cplusplus)
1048 static void
1049 yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
1050 #else
1051 static void
1052 yysymprint (yyoutput, yytype, yyvaluep)
1053     FILE *yyoutput;
1054     int yytype;
1055     YYSTYPE *yyvaluep;
1056 #endif
1057 {
1058   /* Pacify ``unused variable'' warnings.  */
1059   (void) yyvaluep;
1060
1061   if (yytype < YYNTOKENS)
1062     YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
1063   else
1064     YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
1065
1066
1067 # ifdef YYPRINT
1068   if (yytype < YYNTOKENS)
1069     YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
1070 # endif
1071   switch (yytype)
1072     {
1073       default:
1074         break;
1075     }
1076   YYFPRINTF (yyoutput, ")");
1077 }
1078
1079 #endif /* ! YYDEBUG */
1080 /*-----------------------------------------------.
1081 | Release the memory associated to this symbol.  |
1082 `-----------------------------------------------*/
1083
1084 #if defined (__STDC__) || defined (__cplusplus)
1085 static void
1086 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
1087 #else
1088 static void
1089 yydestruct (yymsg, yytype, yyvaluep)
1090     const char *yymsg;
1091     int yytype;
1092     YYSTYPE *yyvaluep;
1093 #endif
1094 {
1095   /* Pacify ``unused variable'' warnings.  */
1096   (void) yyvaluep;
1097
1098   if (!yymsg)
1099     yymsg = "Deleting";
1100   YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1101
1102   switch (yytype)
1103     {
1104
1105       default:
1106         break;
1107     }
1108 }
1109 \f
1110
1111 /* Prevent warnings from -Wmissing-prototypes.  */
1112
1113 #ifdef YYPARSE_PARAM
1114 # if defined (__STDC__) || defined (__cplusplus)
1115 int yyparse (void *YYPARSE_PARAM);
1116 # else
1117 int yyparse ();
1118 # endif
1119 #else /* ! YYPARSE_PARAM */
1120 #if defined (__STDC__) || defined (__cplusplus)
1121 int yyparse (void);
1122 #else
1123 int yyparse ();
1124 #endif
1125 #endif /* ! YYPARSE_PARAM */
1126
1127
1128
1129 /* The look-ahead symbol.  */
1130 int yychar;
1131
1132 /* The semantic value of the look-ahead symbol.  */
1133 YYSTYPE yylval;
1134
1135 /* Number of syntax errors so far.  */
1136 int yynerrs;
1137
1138
1139
1140 /*----------.
1141 | yyparse.  |
1142 `----------*/
1143
1144 #ifdef YYPARSE_PARAM
1145 # if defined (__STDC__) || defined (__cplusplus)
1146 int yyparse (void *YYPARSE_PARAM)
1147 # else
1148 int yyparse (YYPARSE_PARAM)
1149   void *YYPARSE_PARAM;
1150 # endif
1151 #else /* ! YYPARSE_PARAM */
1152 #if defined (__STDC__) || defined (__cplusplus)
1153 int
1154 yyparse (void)
1155 #else
1156 int
1157 yyparse ()
1158     ;
1159 #endif
1160 #endif
1161 {
1162   
1163   int yystate;
1164   int yyn;
1165   int yyresult;
1166   /* Number of tokens to shift before error messages enabled.  */
1167   int yyerrstatus;
1168   /* Look-ahead token as an internal (translated) token number.  */
1169   int yytoken = 0;
1170
1171   /* Three stacks and their tools:
1172      `yyss': related to states,
1173      `yyvs': related to semantic values,
1174      `yyls': related to locations.
1175
1176      Refer to the stacks thru separate pointers, to allow yyoverflow
1177      to reallocate them elsewhere.  */
1178
1179   /* The state stack.  */
1180   short int yyssa[YYINITDEPTH];
1181   short int *yyss = yyssa;
1182   short int *yyssp;
1183
1184   /* The semantic value stack.  */
1185   YYSTYPE yyvsa[YYINITDEPTH];
1186   YYSTYPE *yyvs = yyvsa;
1187   YYSTYPE *yyvsp;
1188
1189
1190
1191 #define YYPOPSTACK   (yyvsp--, yyssp--)
1192
1193   YYSIZE_T yystacksize = YYINITDEPTH;
1194
1195   /* The variables used to return semantic value and location from the
1196      action routines.  */
1197   YYSTYPE yyval;
1198
1199
1200   /* When reducing, the number of symbols on the RHS of the reduced
1201      rule.  */
1202   int yylen;
1203
1204   YYDPRINTF ((stderr, "Starting parse\n"));
1205
1206   yystate = 0;
1207   yyerrstatus = 0;
1208   yynerrs = 0;
1209   yychar = YYEMPTY;             /* Cause a token to be read.  */
1210
1211   /* Initialize stack pointers.
1212      Waste one element of value and location stack
1213      so that they stay on the same level as the state stack.
1214      The wasted elements are never initialized.  */
1215
1216   yyssp = yyss;
1217   yyvsp = yyvs;
1218
1219   goto yysetstate;
1220
1221 /*------------------------------------------------------------.
1222 | yynewstate -- Push a new state, which is found in yystate.  |
1223 `------------------------------------------------------------*/
1224  yynewstate:
1225   /* In all cases, when you get here, the value and location stacks
1226      have just been pushed. so pushing a state here evens the stacks.
1227      */
1228   yyssp++;
1229
1230  yysetstate:
1231   *yyssp = yystate;
1232
1233   if (yyss + yystacksize - 1 <= yyssp)
1234     {
1235       /* Get the current used size of the three stacks, in elements.  */
1236       YYSIZE_T yysize = yyssp - yyss + 1;
1237
1238 #ifdef yyoverflow
1239       {
1240         /* Give user a chance to reallocate the stack. Use copies of
1241            these so that the &'s don't force the real ones into
1242            memory.  */
1243         YYSTYPE *yyvs1 = yyvs;
1244         short int *yyss1 = yyss;
1245
1246
1247         /* Each stack pointer address is followed by the size of the
1248            data in use in that stack, in bytes.  This used to be a
1249            conditional around just the two extra args, but that might
1250            be undefined if yyoverflow is a macro.  */
1251         yyoverflow (YY_("memory exhausted"),
1252                     &yyss1, yysize * sizeof (*yyssp),
1253                     &yyvs1, yysize * sizeof (*yyvsp),
1254
1255                     &yystacksize);
1256
1257         yyss = yyss1;
1258         yyvs = yyvs1;
1259       }
1260 #else /* no yyoverflow */
1261 # ifndef YYSTACK_RELOCATE
1262       goto yyexhaustedlab;
1263 # else
1264       /* Extend the stack our own way.  */
1265       if (YYMAXDEPTH <= yystacksize)
1266         goto yyexhaustedlab;
1267       yystacksize *= 2;
1268       if (YYMAXDEPTH < yystacksize)
1269         yystacksize = YYMAXDEPTH;
1270
1271       {
1272         short int *yyss1 = yyss;
1273         union yyalloc *yyptr =
1274           (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1275         if (! yyptr)
1276           goto yyexhaustedlab;
1277         YYSTACK_RELOCATE (yyss);
1278         YYSTACK_RELOCATE (yyvs);
1279
1280 #  undef YYSTACK_RELOCATE
1281         if (yyss1 != yyssa)
1282           YYSTACK_FREE (yyss1);
1283       }
1284 # endif
1285 #endif /* no yyoverflow */
1286
1287       yyssp = yyss + yysize - 1;
1288       yyvsp = yyvs + yysize - 1;
1289
1290
1291       YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1292                   (unsigned long int) yystacksize));
1293
1294       if (yyss + yystacksize - 1 <= yyssp)
1295         YYABORT;
1296     }
1297
1298   YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1299
1300   goto yybackup;
1301
1302 /*-----------.
1303 | yybackup.  |
1304 `-----------*/
1305 yybackup:
1306
1307 /* Do appropriate processing given the current state.  */
1308 /* Read a look-ahead token if we need one and don't already have one.  */
1309 /* yyresume: */
1310
1311   /* First try to decide what to do without reference to look-ahead token.  */
1312
1313   yyn = yypact[yystate];
1314   if (yyn == YYPACT_NINF)
1315     goto yydefault;
1316
1317   /* Not known => get a look-ahead token if don't already have one.  */
1318
1319   /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol.  */
1320   if (yychar == YYEMPTY)
1321     {
1322       YYDPRINTF ((stderr, "Reading a token: "));
1323       yychar = YYLEX;
1324     }
1325
1326   if (yychar <= YYEOF)
1327     {
1328       yychar = yytoken = YYEOF;
1329       YYDPRINTF ((stderr, "Now at end of input.\n"));
1330     }
1331   else
1332     {
1333       yytoken = YYTRANSLATE (yychar);
1334       YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1335     }
1336
1337   /* If the proper action on seeing token YYTOKEN is to reduce or to
1338      detect an error, take that action.  */
1339   yyn += yytoken;
1340   if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1341     goto yydefault;
1342   yyn = yytable[yyn];
1343   if (yyn <= 0)
1344     {
1345       if (yyn == 0 || yyn == YYTABLE_NINF)
1346         goto yyerrlab;
1347       yyn = -yyn;
1348       goto yyreduce;
1349     }
1350
1351   if (yyn == YYFINAL)
1352     YYACCEPT;
1353
1354   /* Shift the look-ahead token.  */
1355   YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1356
1357   /* Discard the token being shifted unless it is eof.  */
1358   if (yychar != YYEOF)
1359     yychar = YYEMPTY;
1360
1361   *++yyvsp = yylval;
1362
1363
1364   /* Count tokens shifted since error; after three, turn off error
1365      status.  */
1366   if (yyerrstatus)
1367     yyerrstatus--;
1368
1369   yystate = yyn;
1370   goto yynewstate;
1371
1372
1373 /*-----------------------------------------------------------.
1374 | yydefault -- do the default action for the current state.  |
1375 `-----------------------------------------------------------*/
1376 yydefault:
1377   yyn = yydefact[yystate];
1378   if (yyn == 0)
1379     goto yyerrlab;
1380   goto yyreduce;
1381
1382
1383 /*-----------------------------.
1384 | yyreduce -- Do a reduction.  |
1385 `-----------------------------*/
1386 yyreduce:
1387   /* yyn is the number of a rule to reduce with.  */
1388   yylen = yyr2[yyn];
1389
1390   /* If YYLEN is nonzero, implement the default value of the action:
1391      `$$ = $1'.
1392
1393      Otherwise, the following line sets YYVAL to garbage.
1394      This behavior is undocumented and Bison
1395      users should not rely upon it.  Assigning to YYVAL
1396      unconditionally makes the parser a bit smaller, and it avoids a
1397      GCC warning that YYVAL may be used uninitialized.  */
1398   yyval = yyvsp[1-yylen];
1399
1400
1401   YY_REDUCE_PRINT (yyn);
1402   switch (yyn)
1403     {
1404         case 2:
1405 #line 119 "parse.y"
1406     { /* add default rule */
1407                         int def_rule;
1408
1409                         pat = cclinit();
1410                         cclnegate( pat );
1411
1412                         def_rule = mkstate( -pat );
1413
1414                         /* Remember the number of the default rule so we
1415                          * don't generate "can't match" warnings for it.
1416                          */
1417                         default_rule = num_rules;
1418
1419                         finish_rule( def_rule, false, 0, 0, 0);
1420
1421                         for ( i = 1; i <= lastsc; ++i )
1422                                 scset[i] = mkbranch( scset[i], def_rule );
1423
1424                         if ( spprdflt )
1425                                 add_action(
1426                                 "YY_FATAL_ERROR( \"flex scanner jammed\" )" );
1427                         else
1428                                 add_action( "ECHO" );
1429
1430                         add_action( ";\n\tYY_BREAK\n" );
1431                         }
1432     break;
1433
1434   case 3:
1435 #line 148 "parse.y"
1436     { /* initialize for processing rules */
1437
1438                         /* Create default DFA start condition. */
1439                         scinstal( "INITIAL", false );
1440                         }
1441     break;
1442
1443   case 7:
1444 #line 159 "parse.y"
1445     { synerr( _("unknown error processing section 1") ); }
1446     break;
1447
1448   case 8:
1449 #line 163 "parse.y"
1450     {
1451                         check_options();
1452                         scon_stk = allocate_integer_array( lastsc + 1 );
1453                         scon_stk_ptr = 0;
1454                         }
1455     break;
1456
1457   case 9:
1458 #line 171 "parse.y"
1459     { xcluflg = false; }
1460     break;
1461
1462   case 10:
1463 #line 174 "parse.y"
1464     { xcluflg = true; }
1465     break;
1466
1467   case 11:
1468 #line 178 "parse.y"
1469     { scinstal( nmstr, xcluflg ); }
1470     break;
1471
1472   case 12:
1473 #line 181 "parse.y"
1474     { scinstal( nmstr, xcluflg ); }
1475     break;
1476
1477   case 13:
1478 #line 184 "parse.y"
1479     { synerr( _("bad start condition list") ); }
1480     break;
1481
1482   case 17:
1483 #line 195 "parse.y"
1484     {
1485                         outfilename = copy_string( nmstr );
1486                         did_outfilename = 1;
1487                         }
1488     break;
1489
1490   case 18:
1491 #line 200 "parse.y"
1492     { extra_type = copy_string( nmstr ); }
1493     break;
1494
1495   case 19:
1496 #line 202 "parse.y"
1497     { prefix = copy_string( nmstr ); }
1498     break;
1499
1500   case 20:
1501 #line 204 "parse.y"
1502     { yyclass = copy_string( nmstr ); }
1503     break;
1504
1505   case 21:
1506 #line 206 "parse.y"
1507     { headerfilename = copy_string( nmstr ); }
1508     break;
1509
1510   case 22:
1511 #line 208 "parse.y"
1512     { tablesext = true; tablesfilename = copy_string( nmstr ); }
1513     break;
1514
1515   case 23:
1516 #line 212 "parse.y"
1517     { scon_stk_ptr = (yyvsp[-3]); }
1518     break;
1519
1520   case 24:
1521 #line 214 "parse.y"
1522     { scon_stk_ptr = (yyvsp[-3]); }
1523     break;
1524
1525   case 26:
1526 #line 219 "parse.y"
1527     {
1528                         /* Initialize for a parse of one rule. */
1529                         trlcontxt = variable_trail_rule = varlength = false;
1530                         trailcnt = headcnt = rulelen = 0;
1531                         current_state_type = STATE_NORMAL;
1532                         previous_continued_action = continued_action;
1533                         in_rule = true;
1534
1535                         new_rule();
1536                         }
1537     break;
1538
1539   case 27:
1540 #line 232 "parse.y"
1541     {
1542                         pat = (yyvsp[0]);
1543                         finish_rule( pat, variable_trail_rule,
1544                                 headcnt, trailcnt , previous_continued_action);
1545
1546                         if ( scon_stk_ptr > 0 )
1547                                 {
1548                                 for ( i = 1; i <= scon_stk_ptr; ++i )
1549                                         scbol[scon_stk[i]] =
1550                                                 mkbranch( scbol[scon_stk[i]],
1551                                                                 pat );
1552                                 }
1553
1554                         else
1555                                 {
1556                                 /* Add to all non-exclusive start conditions,
1557                                  * including the default (0) start condition.
1558                                  */
1559
1560                                 for ( i = 1; i <= lastsc; ++i )
1561                                         if ( ! scxclu[i] )
1562                                                 scbol[i] = mkbranch( scbol[i],
1563                                                                         pat );
1564                                 }
1565
1566                         if ( ! bol_needed )
1567                                 {
1568                                 bol_needed = true;
1569
1570                                 if ( performance_report > 1 )
1571                                         pinpoint_message(
1572                         "'^' operator results in sub-optimal performance" );
1573                                 }
1574                         }
1575     break;
1576
1577   case 28:
1578 #line 268 "parse.y"
1579     {
1580                         pat = (yyvsp[0]);
1581                         finish_rule( pat, variable_trail_rule,
1582                                 headcnt, trailcnt , previous_continued_action);
1583
1584                         if ( scon_stk_ptr > 0 )
1585                                 {
1586                                 for ( i = 1; i <= scon_stk_ptr; ++i )
1587                                         scset[scon_stk[i]] =
1588                                                 mkbranch( scset[scon_stk[i]],
1589                                                                 pat );
1590                                 }
1591
1592                         else
1593                                 {
1594                                 for ( i = 1; i <= lastsc; ++i )
1595                                         if ( ! scxclu[i] )
1596                                                 scset[i] =
1597                                                         mkbranch( scset[i],
1598                                                                 pat );
1599                                 }
1600                         }
1601     break;
1602
1603   case 29:
1604 #line 292 "parse.y"
1605     {
1606                         if ( scon_stk_ptr > 0 )
1607                                 build_eof_action();
1608         
1609                         else
1610                                 {
1611                                 /* This EOF applies to all start conditions
1612                                  * which don't already have EOF actions.
1613                                  */
1614                                 for ( i = 1; i <= lastsc; ++i )
1615                                         if ( ! sceof[i] )
1616                                                 scon_stk[++scon_stk_ptr] = i;
1617
1618                                 if ( scon_stk_ptr == 0 )
1619                                         warn(
1620                         "all start conditions already have <<EOF>> rules" );
1621
1622                                 else
1623                                         build_eof_action();
1624                                 }
1625                         }
1626     break;
1627
1628   case 30:
1629 #line 315 "parse.y"
1630     { synerr( _("unrecognized rule") ); }
1631     break;
1632
1633   case 31:
1634 #line 319 "parse.y"
1635     { (yyval) = scon_stk_ptr; }
1636     break;
1637
1638   case 32:
1639 #line 323 "parse.y"
1640     { (yyval) = (yyvsp[-2]); }
1641     break;
1642
1643   case 33:
1644 #line 326 "parse.y"
1645     {
1646                         (yyval) = scon_stk_ptr;
1647
1648                         for ( i = 1; i <= lastsc; ++i )
1649                                 {
1650                                 int j;
1651
1652                                 for ( j = 1; j <= scon_stk_ptr; ++j )
1653                                         if ( scon_stk[j] == i )
1654                                                 break;
1655
1656                                 if ( j > scon_stk_ptr )
1657                                         scon_stk[++scon_stk_ptr] = i;
1658                                 }
1659                         }
1660     break;
1661
1662   case 34:
1663 #line 343 "parse.y"
1664     { (yyval) = scon_stk_ptr; }
1665     break;
1666
1667   case 37:
1668 #line 351 "parse.y"
1669     { synerr( _("bad start condition list") ); }
1670     break;
1671
1672   case 38:
1673 #line 355 "parse.y"
1674     {
1675                         if ( (scnum = sclookup( nmstr )) == 0 )
1676                                 format_pinpoint_message(
1677                                         "undeclared start condition %s",
1678                                         nmstr );
1679                         else
1680                                 {
1681                                 for ( i = 1; i <= scon_stk_ptr; ++i )
1682                                         if ( scon_stk[i] == scnum )
1683                                                 {
1684                                                 format_warn(
1685                                                         "<%s> specified twice",
1686                                                         scname[scnum] );
1687                                                 break;
1688                                                 }
1689
1690                                 if ( i > scon_stk_ptr )
1691                                         scon_stk[++scon_stk_ptr] = scnum;
1692                                 }
1693                         }
1694     break;
1695
1696   case 39:
1697 #line 378 "parse.y"
1698     {
1699                         if ( transchar[lastst[(yyvsp[0])]] != SYM_EPSILON )
1700                                 /* Provide final transition \now/ so it
1701                                  * will be marked as a trailing context
1702                                  * state.
1703                                  */
1704                                 (yyvsp[0]) = link_machines( (yyvsp[0]),
1705                                                 mkstate( SYM_EPSILON ) );
1706
1707                         mark_beginning_as_normal( (yyvsp[0]) );
1708                         current_state_type = STATE_NORMAL;
1709
1710                         if ( previous_continued_action )
1711                                 {
1712                                 /* We need to treat this as variable trailing
1713                                  * context so that the backup does not happen
1714                                  * in the action but before the action switch
1715                                  * statement.  If the backup happens in the
1716                                  * action, then the rules "falling into" this
1717                                  * one's action will *also* do the backup,
1718                                  * erroneously.
1719                                  */
1720                                 if ( ! varlength || headcnt != 0 )
1721                                         warn(
1722                 "trailing context made variable due to preceding '|' action" );
1723
1724                                 /* Mark as variable. */
1725                                 varlength = true;
1726                                 headcnt = 0;
1727
1728                                 }
1729
1730                         if ( lex_compat || (varlength && headcnt == 0) )
1731                                 { /* variable trailing context rule */
1732                                 /* Mark the first part of the rule as the
1733                                  * accepting "head" part of a trailing
1734                                  * context rule.
1735                                  *
1736                                  * By the way, we didn't do this at the
1737                                  * beginning of this production because back
1738                                  * then current_state_type was set up for a
1739                                  * trail rule, and add_accept() can create
1740                                  * a new state ...
1741                                  */
1742                                 add_accept( (yyvsp[-1]),
1743                                         num_rules | YY_TRAILING_HEAD_MASK );
1744                                 variable_trail_rule = true;
1745                                 }
1746                         
1747                         else
1748                                 trailcnt = rulelen;
1749
1750                         (yyval) = link_machines( (yyvsp[-1]), (yyvsp[0]) );
1751                         }
1752     break;
1753
1754   case 40:
1755 #line 434 "parse.y"
1756     { synerr( _("trailing context used twice") ); }
1757     break;
1758
1759   case 41:
1760 #line 437 "parse.y"
1761     {
1762                         headcnt = 0;
1763                         trailcnt = 1;
1764                         rulelen = 1;
1765                         varlength = false;
1766
1767                         current_state_type = STATE_TRAILING_CONTEXT;
1768
1769                         if ( trlcontxt )
1770                                 {
1771                                 synerr( _("trailing context used twice") );
1772                                 (yyval) = mkstate( SYM_EPSILON );
1773                                 }
1774
1775                         else if ( previous_continued_action )
1776                                 {
1777                                 /* See the comment in the rule for "re2 re"
1778                                  * above.
1779                                  */
1780                                 warn(
1781                 "trailing context made variable due to preceding '|' action" );
1782
1783                                 varlength = true;
1784                                 }
1785
1786                         if ( lex_compat || varlength )
1787                                 {
1788                                 /* Again, see the comment in the rule for
1789                                  * "re2 re" above.
1790                                  */
1791                                 add_accept( (yyvsp[-1]),
1792                                         num_rules | YY_TRAILING_HEAD_MASK );
1793                                 variable_trail_rule = true;
1794                                 }
1795
1796                         trlcontxt = true;
1797
1798                         eps = mkstate( SYM_EPSILON );
1799                         (yyval) = link_machines( (yyvsp[-1]),
1800                                 link_machines( eps, mkstate( '\n' ) ) );
1801                         }
1802     break;
1803
1804   case 42:
1805 #line 480 "parse.y"
1806     {
1807                         (yyval) = (yyvsp[0]);
1808
1809                         if ( trlcontxt )
1810                                 {
1811                                 if ( lex_compat || (varlength && headcnt == 0) )
1812                                         /* Both head and trail are
1813                                          * variable-length.
1814                                          */
1815                                         variable_trail_rule = true;
1816                                 else
1817                                         trailcnt = rulelen;
1818                                 }
1819                         }
1820     break;
1821
1822   case 43:
1823 #line 498 "parse.y"
1824     {
1825                         varlength = true;
1826                         (yyval) = mkor( (yyvsp[-2]), (yyvsp[0]) );
1827                         }
1828     break;
1829
1830   case 44:
1831 #line 504 "parse.y"
1832     { (yyval) = (yyvsp[0]); }
1833     break;
1834
1835   case 45:
1836 #line 509 "parse.y"
1837     {
1838                         /* This rule is written separately so the
1839                          * reduction will occur before the trailing
1840                          * series is parsed.
1841                          */
1842
1843                         if ( trlcontxt )
1844                                 synerr( _("trailing context used twice") );
1845                         else
1846                                 trlcontxt = true;
1847
1848                         if ( varlength )
1849                                 /* We hope the trailing context is
1850                                  * fixed-length.
1851                                  */
1852                                 varlength = false;
1853                         else
1854                                 headcnt = rulelen;
1855
1856                         rulelen = 0;
1857
1858                         current_state_type = STATE_TRAILING_CONTEXT;
1859                         (yyval) = (yyvsp[-1]);
1860                         }
1861     break;
1862
1863   case 46:
1864 #line 536 "parse.y"
1865     {
1866                         /* This is where concatenation of adjacent patterns
1867                          * gets done.
1868                          */
1869                         (yyval) = link_machines( (yyvsp[-1]), (yyvsp[0]) );
1870                         }
1871     break;
1872
1873   case 47:
1874 #line 544 "parse.y"
1875     { (yyval) = (yyvsp[0]); }
1876     break;
1877
1878   case 48:
1879 #line 547 "parse.y"
1880     {
1881                         varlength = true;
1882
1883                         if ( (yyvsp[-3]) > (yyvsp[-1]) || (yyvsp[-3]) < 0 )
1884                                 {
1885                                 synerr( _("bad iteration values") );
1886                                 (yyval) = (yyvsp[-5]);
1887                                 }
1888                         else
1889                                 {
1890                                 if ( (yyvsp[-3]) == 0 )
1891                                         {
1892                                         if ( (yyvsp[-1]) <= 0 )
1893                                                 {
1894                                                 synerr(
1895                                                 _("bad iteration values") );
1896                                                 (yyval) = (yyvsp[-5]);
1897                                                 }
1898                                         else
1899                                                 (yyval) = mkopt(
1900                                                         mkrep( (yyvsp[-5]), 1, (yyvsp[-1]) ) );
1901                                         }
1902                                 else
1903                                         (yyval) = mkrep( (yyvsp[-5]), (yyvsp[-3]), (yyvsp[-1]) );
1904                                 }
1905                         }
1906     break;
1907
1908   case 49:
1909 #line 575 "parse.y"
1910     {
1911                         varlength = true;
1912
1913                         if ( (yyvsp[-2]) <= 0 )
1914                                 {
1915                                 synerr( _("iteration value must be positive") );
1916                                 (yyval) = (yyvsp[-4]);
1917                                 }
1918
1919                         else
1920                                 (yyval) = mkrep( (yyvsp[-4]), (yyvsp[-2]), INFINITE_REPEAT );
1921                         }
1922     break;
1923
1924   case 50:
1925 #line 589 "parse.y"
1926     {
1927                         /* The series could be something like "(foo)",
1928                          * in which case we have no idea what its length
1929                          * is, so we punt here.
1930                          */
1931                         varlength = true;
1932
1933                         if ( (yyvsp[-1]) <= 0 )
1934                                 {
1935                                   synerr( _("iteration value must be positive")
1936                                           );
1937                                 (yyval) = (yyvsp[-3]);
1938                                 }
1939
1940                         else
1941                                 (yyval) = link_machines( (yyvsp[-3]),
1942                                                 copysingl( (yyvsp[-3]), (yyvsp[-1]) - 1 ) );
1943                         }
1944     break;
1945
1946   case 51:
1947 #line 611 "parse.y"
1948     {
1949                         varlength = true;
1950
1951                         (yyval) = mkclos( (yyvsp[-1]) );
1952                         }
1953     break;
1954
1955   case 52:
1956 #line 618 "parse.y"
1957     {
1958                         varlength = true;
1959                         (yyval) = mkposcl( (yyvsp[-1]) );
1960                         }
1961     break;
1962
1963   case 53:
1964 #line 624 "parse.y"
1965     {
1966                         varlength = true;
1967                         (yyval) = mkopt( (yyvsp[-1]) );
1968                         }
1969     break;
1970
1971   case 54:
1972 #line 630 "parse.y"
1973     {
1974                         varlength = true;
1975
1976                         if ( (yyvsp[-3]) > (yyvsp[-1]) || (yyvsp[-3]) < 0 )
1977                                 {
1978                                 synerr( _("bad iteration values") );
1979                                 (yyval) = (yyvsp[-5]);
1980                                 }
1981                         else
1982                                 {
1983                                 if ( (yyvsp[-3]) == 0 )
1984                                         {
1985                                         if ( (yyvsp[-1]) <= 0 )
1986                                                 {
1987                                                 synerr(
1988                                                 _("bad iteration values") );
1989                                                 (yyval) = (yyvsp[-5]);
1990                                                 }
1991                                         else
1992                                                 (yyval) = mkopt(
1993                                                         mkrep( (yyvsp[-5]), 1, (yyvsp[-1]) ) );
1994                                         }
1995                                 else
1996                                         (yyval) = mkrep( (yyvsp[-5]), (yyvsp[-3]), (yyvsp[-1]) );
1997                                 }
1998                         }
1999     break;
2000
2001   case 55:
2002 #line 658 "parse.y"
2003     {
2004                         varlength = true;
2005
2006                         if ( (yyvsp[-2]) <= 0 )
2007                                 {
2008                                 synerr( _("iteration value must be positive") );
2009                                 (yyval) = (yyvsp[-4]);
2010                                 }
2011
2012                         else
2013                                 (yyval) = mkrep( (yyvsp[-4]), (yyvsp[-2]), INFINITE_REPEAT );
2014                         }
2015     break;
2016
2017   case 56:
2018 #line 672 "parse.y"
2019     {
2020                         /* The singleton could be something like "(foo)",
2021                          * in which case we have no idea what its length
2022                          * is, so we punt here.
2023                          */
2024                         varlength = true;
2025
2026                         if ( (yyvsp[-1]) <= 0 )
2027                                 {
2028                                 synerr( _("iteration value must be positive") );
2029                                 (yyval) = (yyvsp[-3]);
2030                                 }
2031
2032                         else
2033                                 (yyval) = link_machines( (yyvsp[-3]),
2034                                                 copysingl( (yyvsp[-3]), (yyvsp[-1]) - 1 ) );
2035                         }
2036     break;
2037
2038   case 57:
2039 #line 691 "parse.y"
2040     {
2041                         if ( ! madeany )
2042                                 {
2043                                 /* Create the '.' character class. */
2044                     ccldot = cclinit();
2045                     ccladd( ccldot, '\n' );
2046                     cclnegate( ccldot );
2047
2048                     if ( useecs )
2049                         mkeccl( ccltbl + cclmap[ccldot],
2050                             ccllen[ccldot], nextecm,
2051                             ecgroup, csize, csize );
2052
2053                                 /* Create the (?s:'.') character class. */
2054                     cclany = cclinit();
2055                     cclnegate( cclany );
2056
2057                     if ( useecs )
2058                         mkeccl( ccltbl + cclmap[cclany],
2059                             ccllen[cclany], nextecm,
2060                             ecgroup, csize, csize );
2061
2062                                 madeany = true;
2063                                 }
2064
2065                         ++rulelen;
2066
2067             if (sf_dot_all())
2068                 (yyval) = mkstate( -cclany );
2069             else
2070                 (yyval) = mkstate( -ccldot );
2071                         }
2072     break;
2073
2074   case 58:
2075 #line 725 "parse.y"
2076     {
2077                                 /* Sort characters for fast searching.  We
2078                                  * use a shell sort since this list could
2079                                  * be large.
2080                                  */
2081                                 cshell( ccltbl + cclmap[(yyvsp[0])], ccllen[(yyvsp[0])], true );
2082
2083                         if ( useecs )
2084                                 mkeccl( ccltbl + cclmap[(yyvsp[0])], ccllen[(yyvsp[0])],
2085                                         nextecm, ecgroup, csize, csize );
2086
2087                         ++rulelen;
2088
2089                         if (ccl_has_nl[(yyvsp[0])])
2090                                 rule_has_nl[num_rules] = true;
2091
2092                         (yyval) = mkstate( -(yyvsp[0]) );
2093                         }
2094     break;
2095
2096   case 59:
2097 #line 745 "parse.y"
2098     {
2099                         ++rulelen;
2100
2101                         if (ccl_has_nl[(yyvsp[0])])
2102                                 rule_has_nl[num_rules] = true;
2103
2104                         (yyval) = mkstate( -(yyvsp[0]) );
2105                         }
2106     break;
2107
2108   case 60:
2109 #line 755 "parse.y"
2110     { (yyval) = (yyvsp[-1]); }
2111     break;
2112
2113   case 61:
2114 #line 758 "parse.y"
2115     { (yyval) = (yyvsp[-1]); }
2116     break;
2117
2118   case 62:
2119 #line 761 "parse.y"
2120     {
2121                         ++rulelen;
2122
2123                         if ((yyvsp[0]) == nlch)
2124                                 rule_has_nl[num_rules] = true;
2125
2126             if (sf_case_ins() && has_case((yyvsp[0])))
2127                 /* create an alternation, as in (a|A) */
2128                 (yyval) = mkor (mkstate((yyvsp[0])), mkstate(reverse_case((yyvsp[0]))));
2129             else
2130                 (yyval) = mkstate( (yyvsp[0]) );
2131                         }
2132     break;
2133
2134   case 63:
2135 #line 775 "parse.y"
2136     { (yyval) = ccl_set_diff  ((yyvsp[-2]), (yyvsp[0])); }
2137     break;
2138
2139   case 64:
2140 #line 776 "parse.y"
2141     { (yyval) = ccl_set_union ((yyvsp[-2]), (yyvsp[0])); }
2142     break;
2143
2144   case 66:
2145 #line 782 "parse.y"
2146     { (yyval) = (yyvsp[-1]); }
2147     break;
2148
2149   case 67:
2150 #line 785 "parse.y"
2151     {
2152                         cclnegate( (yyvsp[-1]) );
2153                         (yyval) = (yyvsp[-1]);
2154                         }
2155     break;
2156
2157   case 68:
2158 #line 792 "parse.y"
2159     {
2160
2161                         if (sf_case_ins())
2162                           {
2163
2164                             /* If one end of the range has case and the other
2165                              * does not, or the cases are different, then we're not
2166                              * sure what range the user is trying to express.
2167                              * Examples: [@-z] or [S-t]
2168                              */
2169                             if (has_case ((yyvsp[-2])) != has_case ((yyvsp[0]))
2170                                      || (has_case ((yyvsp[-2])) && (b_islower ((yyvsp[-2])) != b_islower ((yyvsp[0]))))
2171                                      || (has_case ((yyvsp[-2])) && (b_isupper ((yyvsp[-2])) != b_isupper ((yyvsp[0])))))
2172                               format_warn3 (
2173                               _("the character range [%c-%c] is ambiguous in a case-insensitive scanner"),
2174                                             (yyvsp[-2]), (yyvsp[0]));
2175
2176                             /* If the range spans uppercase characters but not
2177                              * lowercase (or vice-versa), then should we automatically
2178                              * include lowercase characters in the range?
2179                              * Example: [@-_] spans [a-z] but not [A-Z]
2180                              */
2181                             else if (!has_case ((yyvsp[-2])) && !has_case ((yyvsp[0])) && !range_covers_case ((yyvsp[-2]), (yyvsp[0])))
2182                               format_warn3 (
2183                               _("the character range [%c-%c] is ambiguous in a case-insensitive scanner"),
2184                                             (yyvsp[-2]), (yyvsp[0]));
2185                           }
2186
2187                         if ( (yyvsp[-2]) > (yyvsp[0]) )
2188                                 synerr( _("negative range in character class") );
2189
2190                         else
2191                                 {
2192                                 for ( i = (yyvsp[-2]); i <= (yyvsp[0]); ++i )
2193                                         ccladd( (yyvsp[-3]), i );
2194
2195                                 /* Keep track if this ccl is staying in
2196                                  * alphabetical order.
2197                                  */
2198                                 cclsorted = cclsorted && ((yyvsp[-2]) > lastchar);
2199                                 lastchar = (yyvsp[0]);
2200
2201                 /* Do it again for upper/lowercase */
2202                 if (sf_case_ins() && has_case((yyvsp[-2])) && has_case((yyvsp[0]))){
2203                     (yyvsp[-2]) = reverse_case ((yyvsp[-2]));
2204                     (yyvsp[0]) = reverse_case ((yyvsp[0]));
2205                     
2206                     for ( i = (yyvsp[-2]); i <= (yyvsp[0]); ++i )
2207                         ccladd( (yyvsp[-3]), i );
2208
2209                     cclsorted = cclsorted && ((yyvsp[-2]) > lastchar);
2210                     lastchar = (yyvsp[0]);
2211                 }
2212
2213                                 }
2214
2215                         (yyval) = (yyvsp[-3]);
2216                         }
2217     break;
2218
2219   case 69:
2220 #line 852 "parse.y"
2221     {
2222                         ccladd( (yyvsp[-1]), (yyvsp[0]) );
2223                         cclsorted = cclsorted && ((yyvsp[0]) > lastchar);
2224                         lastchar = (yyvsp[0]);
2225
2226             /* Do it again for upper/lowercase */
2227             if (sf_case_ins() && has_case((yyvsp[0]))){
2228                 (yyvsp[0]) = reverse_case ((yyvsp[0]));
2229                 ccladd ((yyvsp[-1]), (yyvsp[0]));
2230
2231                 cclsorted = cclsorted && ((yyvsp[0]) > lastchar);
2232                 lastchar = (yyvsp[0]);
2233             }
2234
2235                         (yyval) = (yyvsp[-1]);
2236                         }
2237     break;
2238
2239   case 70:
2240 #line 870 "parse.y"
2241     {
2242                         /* Too hard to properly maintain cclsorted. */
2243                         cclsorted = false;
2244                         (yyval) = (yyvsp[-1]);
2245                         }
2246     break;
2247
2248   case 71:
2249 #line 877 "parse.y"
2250     {
2251                         cclsorted = true;
2252                         lastchar = 0;
2253                         currccl = (yyval) = cclinit();
2254                         }
2255     break;
2256
2257   case 72:
2258 #line 885 "parse.y"
2259     { CCL_EXPR(isalnum); }
2260     break;
2261
2262   case 73:
2263 #line 886 "parse.y"
2264     { CCL_EXPR(isalpha); }
2265     break;
2266
2267   case 74:
2268 #line 887 "parse.y"
2269     { CCL_EXPR(IS_BLANK); }
2270     break;
2271
2272   case 75:
2273 #line 888 "parse.y"
2274     { CCL_EXPR(iscntrl); }
2275     break;
2276
2277   case 76:
2278 #line 889 "parse.y"
2279     { CCL_EXPR(isdigit); }
2280     break;
2281
2282   case 77:
2283 #line 890 "parse.y"
2284     { CCL_EXPR(isgraph); }
2285     break;
2286
2287   case 78:
2288 #line 891 "parse.y"
2289     { 
2290                           CCL_EXPR(islower);
2291                           if (sf_case_ins())
2292                               CCL_EXPR(isupper);
2293                         }
2294     break;
2295
2296   case 79:
2297 #line 896 "parse.y"
2298     { CCL_EXPR(isprint); }
2299     break;
2300
2301   case 80:
2302 #line 897 "parse.y"
2303     { CCL_EXPR(ispunct); }
2304     break;
2305
2306   case 81:
2307 #line 898 "parse.y"
2308     { CCL_EXPR(isspace); }
2309     break;
2310
2311   case 82:
2312 #line 899 "parse.y"
2313     { CCL_EXPR(isxdigit); }
2314     break;
2315
2316   case 83:
2317 #line 900 "parse.y"
2318     {
2319                     CCL_EXPR(isupper);
2320                     if (sf_case_ins())
2321                         CCL_EXPR(islower);
2322                                 }
2323     break;
2324
2325   case 84:
2326 #line 906 "parse.y"
2327     { CCL_NEG_EXPR(isalnum); }
2328     break;
2329
2330   case 85:
2331 #line 907 "parse.y"
2332     { CCL_NEG_EXPR(isalpha); }
2333     break;
2334
2335   case 86:
2336 #line 908 "parse.y"
2337     { CCL_NEG_EXPR(IS_BLANK); }
2338     break;
2339
2340   case 87:
2341 #line 909 "parse.y"
2342     { CCL_NEG_EXPR(iscntrl); }
2343     break;
2344
2345   case 88:
2346 #line 910 "parse.y"
2347     { CCL_NEG_EXPR(isdigit); }
2348     break;
2349
2350   case 89:
2351 #line 911 "parse.y"
2352     { CCL_NEG_EXPR(isgraph); }
2353     break;
2354
2355   case 90:
2356 #line 912 "parse.y"
2357     { CCL_NEG_EXPR(isprint); }
2358     break;
2359
2360   case 91:
2361 #line 913 "parse.y"
2362     { CCL_NEG_EXPR(ispunct); }
2363     break;
2364
2365   case 92:
2366 #line 914 "parse.y"
2367     { CCL_NEG_EXPR(isspace); }
2368     break;
2369
2370   case 93:
2371 #line 915 "parse.y"
2372     { CCL_NEG_EXPR(isxdigit); }
2373     break;
2374
2375   case 94:
2376 #line 916 "parse.y"
2377     { 
2378                                 if ( sf_case_ins() )
2379                                         warn(_("[:^lower:] is ambiguous in case insensitive scanner"));
2380                                 else
2381                                         CCL_NEG_EXPR(islower);
2382                                 }
2383     break;
2384
2385   case 95:
2386 #line 922 "parse.y"
2387     {
2388                                 if ( sf_case_ins() )
2389                                         warn(_("[:^upper:] ambiguous in case insensitive scanner"));
2390                                 else
2391                                         CCL_NEG_EXPR(isupper);
2392                                 }
2393     break;
2394
2395   case 96:
2396 #line 931 "parse.y"
2397     {
2398                         if ( (yyvsp[0]) == nlch )
2399                                 rule_has_nl[num_rules] = true;
2400
2401                         ++rulelen;
2402
2403             if (sf_case_ins() && has_case((yyvsp[0])))
2404                 (yyval) = mkor (mkstate((yyvsp[0])), mkstate(reverse_case((yyvsp[0]))));
2405             else
2406                 (yyval) = mkstate ((yyvsp[0]));
2407
2408                         (yyval) = link_machines( (yyvsp[-1]), (yyval));
2409                         }
2410     break;
2411
2412   case 97:
2413 #line 946 "parse.y"
2414     { (yyval) = mkstate( SYM_EPSILON ); }
2415     break;
2416
2417
2418       default: break;
2419     }
2420
2421 /* Line 1126 of yacc.c.  */
2422 #line 2423 "parse.c"
2423 \f
2424   yyvsp -= yylen;
2425   yyssp -= yylen;
2426
2427
2428   YY_STACK_PRINT (yyss, yyssp);
2429
2430   *++yyvsp = yyval;
2431
2432
2433   /* Now `shift' the result of the reduction.  Determine what state
2434      that goes to, based on the state we popped back to and the rule
2435      number reduced by.  */
2436
2437   yyn = yyr1[yyn];
2438
2439   yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
2440   if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
2441     yystate = yytable[yystate];
2442   else
2443     yystate = yydefgoto[yyn - YYNTOKENS];
2444
2445   goto yynewstate;
2446
2447
2448 /*------------------------------------.
2449 | yyerrlab -- here on detecting error |
2450 `------------------------------------*/
2451 yyerrlab:
2452   /* If not already recovering from an error, report this error.  */
2453   if (!yyerrstatus)
2454     {
2455       ++yynerrs;
2456 #if YYERROR_VERBOSE
2457       yyn = yypact[yystate];
2458
2459       if (YYPACT_NINF < yyn && yyn < YYLAST)
2460         {
2461           int yytype = YYTRANSLATE (yychar);
2462           YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
2463           YYSIZE_T yysize = yysize0;
2464           YYSIZE_T yysize1;
2465           int yysize_overflow = 0;
2466           char *yymsg = 0;
2467 #         define YYERROR_VERBOSE_ARGS_MAXIMUM 5
2468           char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
2469           int yyx;
2470
2471 #if 0
2472           /* This is so xgettext sees the translatable formats that are
2473              constructed on the fly.  */
2474           YY_("syntax error, unexpected %s");
2475           YY_("syntax error, unexpected %s, expecting %s");
2476           YY_("syntax error, unexpected %s, expecting %s or %s");
2477           YY_("syntax error, unexpected %s, expecting %s or %s or %s");
2478           YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
2479 #endif
2480           char *yyfmt;
2481           char const *yyf;
2482           static char const yyunexpected[] = "syntax error, unexpected %s";
2483           static char const yyexpecting[] = ", expecting %s";
2484           static char const yyor[] = " or %s";
2485           char yyformat[sizeof yyunexpected
2486                         + sizeof yyexpecting - 1
2487                         + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
2488                            * (sizeof yyor - 1))];
2489           char const *yyprefix = yyexpecting;
2490
2491           /* Start YYX at -YYN if negative to avoid negative indexes in
2492              YYCHECK.  */
2493           int yyxbegin = yyn < 0 ? -yyn : 0;
2494
2495           /* Stay within bounds of both yycheck and yytname.  */
2496           int yychecklim = YYLAST - yyn;
2497           int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
2498           int yycount = 1;
2499
2500           yyarg[0] = yytname[yytype];
2501           yyfmt = yystpcpy (yyformat, yyunexpected);
2502
2503           for (yyx = yyxbegin; yyx < yyxend; ++yyx)
2504             if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
2505               {
2506                 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
2507                   {
2508                     yycount = 1;
2509                     yysize = yysize0;
2510                     yyformat[sizeof yyunexpected - 1] = '\0';
2511                     break;
2512                   }
2513                 yyarg[yycount++] = yytname[yyx];
2514                 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
2515                 yysize_overflow |= yysize1 < yysize;
2516                 yysize = yysize1;
2517                 yyfmt = yystpcpy (yyfmt, yyprefix);
2518                 yyprefix = yyor;
2519               }
2520
2521           yyf = YY_(yyformat);
2522           yysize1 = yysize + yystrlen (yyf);
2523           yysize_overflow |= yysize1 < yysize;
2524           yysize = yysize1;
2525
2526           if (!yysize_overflow && yysize <= YYSTACK_ALLOC_MAXIMUM)
2527             yymsg = (char *) YYSTACK_ALLOC (yysize);
2528           if (yymsg)
2529             {
2530               /* Avoid sprintf, as that infringes on the user's name space.
2531                  Don't have undefined behavior even if the translation
2532                  produced a string with the wrong number of "%s"s.  */
2533               char *yyp = yymsg;
2534               int yyi = 0;
2535               while ((*yyp = *yyf))
2536                 {
2537                   if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
2538                     {
2539                       yyp += yytnamerr (yyp, yyarg[yyi++]);
2540                       yyf += 2;
2541                     }
2542                   else
2543                     {
2544                       yyp++;
2545                       yyf++;
2546                     }
2547                 }
2548               yyerror (yymsg);
2549               YYSTACK_FREE (yymsg);
2550             }
2551           else
2552             {
2553               yyerror (YY_("syntax error"));
2554               goto yyexhaustedlab;
2555             }
2556         }
2557       else
2558 #endif /* YYERROR_VERBOSE */
2559         yyerror (YY_("syntax error"));
2560     }
2561
2562
2563
2564   if (yyerrstatus == 3)
2565     {
2566       /* If just tried and failed to reuse look-ahead token after an
2567          error, discard it.  */
2568
2569       if (yychar <= YYEOF)
2570         {
2571           /* Return failure if at end of input.  */
2572           if (yychar == YYEOF)
2573             YYABORT;
2574         }
2575       else
2576         {
2577           yydestruct ("Error: discarding", yytoken, &yylval);
2578           yychar = YYEMPTY;
2579         }
2580     }
2581
2582   /* Else will try to reuse look-ahead token after shifting the error
2583      token.  */
2584   goto yyerrlab1;
2585
2586
2587 /*---------------------------------------------------.
2588 | yyerrorlab -- error raised explicitly by YYERROR.  |
2589 `---------------------------------------------------*/
2590 yyerrorlab:
2591
2592   /* Pacify compilers like GCC when the user code never invokes
2593      YYERROR and the label yyerrorlab therefore never appears in user
2594      code.  */
2595   if (0)
2596      goto yyerrorlab;
2597
2598 yyvsp -= yylen;
2599   yyssp -= yylen;
2600   yystate = *yyssp;
2601   goto yyerrlab1;
2602
2603
2604 /*-------------------------------------------------------------.
2605 | yyerrlab1 -- common code for both syntax error and YYERROR.  |
2606 `-------------------------------------------------------------*/
2607 yyerrlab1:
2608   yyerrstatus = 3;      /* Each real token shifted decrements this.  */
2609
2610   for (;;)
2611     {
2612       yyn = yypact[yystate];
2613       if (yyn != YYPACT_NINF)
2614         {
2615           yyn += YYTERROR;
2616           if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
2617             {
2618               yyn = yytable[yyn];
2619               if (0 < yyn)
2620                 break;
2621             }
2622         }
2623
2624       /* Pop the current state because it cannot handle the error token.  */
2625       if (yyssp == yyss)
2626         YYABORT;
2627
2628
2629       yydestruct ("Error: popping", yystos[yystate], yyvsp);
2630       YYPOPSTACK;
2631       yystate = *yyssp;
2632       YY_STACK_PRINT (yyss, yyssp);
2633     }
2634
2635   if (yyn == YYFINAL)
2636     YYACCEPT;
2637
2638   *++yyvsp = yylval;
2639
2640
2641   /* Shift the error token. */
2642   YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
2643
2644   yystate = yyn;
2645   goto yynewstate;
2646
2647
2648 /*-------------------------------------.
2649 | yyacceptlab -- YYACCEPT comes here.  |
2650 `-------------------------------------*/
2651 yyacceptlab:
2652   yyresult = 0;
2653   goto yyreturn;
2654
2655 /*-----------------------------------.
2656 | yyabortlab -- YYABORT comes here.  |
2657 `-----------------------------------*/
2658 yyabortlab:
2659   yyresult = 1;
2660   goto yyreturn;
2661
2662 #ifndef yyoverflow
2663 /*-------------------------------------------------.
2664 | yyexhaustedlab -- memory exhaustion comes here.  |
2665 `-------------------------------------------------*/
2666 yyexhaustedlab:
2667   yyerror (YY_("memory exhausted"));
2668   yyresult = 2;
2669   /* Fall through.  */
2670 #endif
2671
2672 yyreturn:
2673   if (yychar != YYEOF && yychar != YYEMPTY)
2674      yydestruct ("Cleanup: discarding lookahead",
2675                  yytoken, &yylval);
2676   while (yyssp != yyss)
2677     {
2678       yydestruct ("Cleanup: popping",
2679                   yystos[*yyssp], yyvsp);
2680       YYPOPSTACK;
2681     }
2682 #ifndef yyoverflow
2683   if (yyss != yyssa)
2684     YYSTACK_FREE (yyss);
2685 #endif
2686   return yyresult;
2687 }
2688
2689
2690 #line 949 "parse.y"
2691
2692
2693
2694 /* build_eof_action - build the "<<EOF>>" action for the active start
2695  *                    conditions
2696  */
2697
2698 void build_eof_action()
2699         {
2700         register int i;
2701         char action_text[MAXLINE];
2702
2703         for ( i = 1; i <= scon_stk_ptr; ++i )
2704                 {
2705                 if ( sceof[scon_stk[i]] )
2706                         format_pinpoint_message(
2707                                 "multiple <<EOF>> rules for start condition %s",
2708                                 scname[scon_stk[i]] );
2709
2710                 else
2711                         {
2712                         sceof[scon_stk[i]] = true;
2713                         snprintf( action_text, sizeof(action_text), "case YY_STATE_EOF(%s):\n",
2714                                 scname[scon_stk[i]] );
2715                         add_action( action_text );
2716                         }
2717                 }
2718
2719         line_directive_out( (FILE *) 0, 1 );
2720
2721         /* This isn't a normal rule after all - don't count it as
2722          * such, so we don't have any holes in the rule numbering
2723          * (which make generating "rule can never match" warnings
2724          * more difficult.
2725          */
2726         --num_rules;
2727         ++num_eof_rules;
2728         }
2729
2730
2731 /* format_synerr - write out formatted syntax error */
2732
2733 void format_synerr( msg, arg )
2734 const char *msg, arg[];
2735         {
2736         char errmsg[MAXLINE];
2737
2738         (void) snprintf( errmsg, sizeof(errmsg), msg, arg );
2739         synerr( errmsg );
2740         }
2741
2742
2743 /* synerr - report a syntax error */
2744
2745 void synerr( str )
2746 const char *str;
2747         {
2748         syntaxerror = true;
2749         pinpoint_message( str );
2750         }
2751
2752
2753 /* format_warn - write out formatted warning */
2754
2755 void format_warn( msg, arg )
2756 const char *msg, arg[];
2757         {
2758         char warn_msg[MAXLINE];
2759
2760         snprintf( warn_msg, sizeof(warn_msg), msg, arg );
2761         warn( warn_msg );
2762         }
2763
2764
2765 /* warn - report a warning, unless -w was given */
2766
2767 void warn( str )
2768 const char *str;
2769         {
2770         line_warning( str, linenum );
2771         }
2772
2773 /* format_pinpoint_message - write out a message formatted with one string,
2774  *                           pinpointing its location
2775  */
2776
2777 void format_pinpoint_message( msg, arg )
2778 const char *msg, arg[];
2779         {
2780         char errmsg[MAXLINE];
2781
2782         snprintf( errmsg, sizeof(errmsg), msg, arg );
2783         pinpoint_message( errmsg );
2784         }
2785
2786
2787 /* pinpoint_message - write out a message, pinpointing its location */
2788
2789 void pinpoint_message( str )
2790 const char *str;
2791         {
2792         line_pinpoint( str, linenum );
2793         }
2794
2795
2796 /* line_warning - report a warning at a given line, unless -w was given */
2797
2798 void line_warning( str, line )
2799 const char *str;
2800 int line;
2801         {
2802         char warning[MAXLINE];
2803
2804         if ( ! nowarn )
2805                 {
2806                 snprintf( warning, sizeof(warning), "warning, %s", str );
2807                 line_pinpoint( warning, line );
2808                 }
2809         }
2810
2811
2812 /* line_pinpoint - write out a message, pinpointing it at the given line */
2813
2814 void line_pinpoint( str, line )
2815 const char *str;
2816 int line;
2817         {
2818         fprintf( stderr, "%s:%d: %s\n", infilename, line, str );
2819         }
2820
2821
2822 /* yyerror - eat up an error message from the parser;
2823  *           currently, messages are ignore
2824  */
2825
2826 void yyerror( msg )
2827 const char *msg;
2828         {
2829         }
2830