xref: /netbsd-src/external/bsd/flex/dist/src/initparse.c (revision 946379e7b37692fc43f68eb0d1c10daa0a7f3b6c)
1 /* original parser id follows */
2 /* yysccsid[] = "@(#)yaccpar	1.9 (Berkeley) 02/21/93" */
3 /* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */
4 
5 #define YYBYACC 1
6 #define YYMAJOR 1
7 #define YYMINOR 9
8 
9 #define YYEMPTY        (-1)
10 #define yyclearin      (yychar = YYEMPTY)
11 #define yyerrok        (yyerrflag = 0)
12 #define YYRECOVERING() (yyerrflag != 0)
13 #define YYENOMEM       (-2)
14 #define YYEOF          0
15 #undef YYBTYACC
16 #define YYBTYACC 0
17 #define YYDEBUGSTR YYPREFIX "debug"
18 #define YYPREFIX "yy"
19 
20 #define YYPURE 0
21 
22 #line 37 "/p/netbsd/cvsroot/src/external/bsd/flex/dist/src/parse.y"
23 /*  Copyright (c) 1990 The Regents of the University of California. */
24 /*  All rights reserved. */
25 
26 /*  This code is derived from software contributed to Berkeley by */
27 /*  Vern Paxson. */
28 
29 /*  The United States Government has rights in this work pursuant */
30 /*  to contract no. DE-AC03-76SF00098 between the United States */
31 /*  Department of Energy and the University of California. */
32 
33 /*  This file is part of flex. */
34 
35 /*  Redistribution and use in source and binary forms, with or without */
36 /*  modification, are permitted provided that the following conditions */
37 /*  are met: */
38 
39 /*  1. Redistributions of source code must retain the above copyright */
40 /*     notice, this list of conditions and the following disclaimer. */
41 /*  2. Redistributions in binary form must reproduce the above copyright */
42 /*     notice, this list of conditions and the following disclaimer in the */
43 /*     documentation and/or other materials provided with the distribution. */
44 
45 /*  Neither the name of the University nor the names of its contributors */
46 /*  may be used to endorse or promote products derived from this software */
47 /*  without specific prior written permission. */
48 
49 /*  THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR */
50 /*  IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED */
51 /*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR */
52 /*  PURPOSE. */
53 #include "flexdef.h"
54 __RCSID("$NetBSD: initparse.c,v 1.1 2016/01/09 17:39:52 christos Exp $");
55 
56 #include "tables.h"
57 
58 int pat, scnum, eps, headcnt, trailcnt, lastchar, i, rulelen;
59 int trlcontxt, xcluflg, currccl, cclsorted, varlength, variable_trail_rule;
60 
61 int *scon_stk;
62 int scon_stk_ptr;
63 
64 static int madeany = false;  /* whether we've made the '.' character class */
65 static int ccldot, cclany;
66 int previous_continued_action;	/* whether the previous rule's action was '|' */
67 
68 #define format_warn3(fmt, a1, a2) \
69 	do{ \
70         char fw3_msg[MAXLINE];\
71         snprintf( fw3_msg, MAXLINE,(fmt), (a1), (a2) );\
72         lwarn( fw3_msg );\
73 	}while(0)
74 
75 /* Expand a POSIX character class expression. */
76 #define CCL_EXPR(func) \
77 	do{ \
78 	int c; \
79 	for ( c = 0; c < csize; ++c ) \
80 		if ( isascii(c) && func(c) ) \
81 			ccladd( currccl, c ); \
82 	}while(0)
83 
84 /* negated class */
85 #define CCL_NEG_EXPR(func) \
86 	do{ \
87 	int c; \
88 	for ( c = 0; c < csize; ++c ) \
89 		if ( !func(c) ) \
90 			ccladd( currccl, c ); \
91 	}while(0)
92 
93 /* While POSIX defines isblank(), it's not ANSI C. */
94 #define IS_BLANK(c) ((c) == ' ' || (c) == '\t')
95 
96 /* On some over-ambitious machines, such as DEC Alpha's, the default
97  * token type is "long" instead of "int"; this leads to problems with
98  * declaring yylval in flexdef.h.  But so far, all the yacc's I've seen
99  * wrap their definitions of YYSTYPE with "#ifndef YYSTYPE"'s, so the
100  * following should ensure that the default token type is "int".
101  */
102 #define YYSTYPE int
103 
104 #line 105 "parse.c"
105 
106 #if ! defined(YYSTYPE) && ! defined(YYSTYPE_IS_DECLARED)
107 /* Default: YYSTYPE is the semantic value type. */
108 typedef int YYSTYPE;
109 # define YYSTYPE_IS_DECLARED 1
110 #endif
111 
112 /* compatibility with bison */
113 #ifdef YYPARSE_PARAM
114 /* compatibility with FreeBSD */
115 # ifdef YYPARSE_PARAM_TYPE
116 #  define YYPARSE_DECL() yyparse(YYPARSE_PARAM_TYPE YYPARSE_PARAM)
117 # else
118 #  define YYPARSE_DECL() yyparse(void *YYPARSE_PARAM)
119 # endif
120 #else
121 # define YYPARSE_DECL() yyparse(void)
122 #endif
123 
124 /* Parameters sent to lex. */
125 #ifdef YYLEX_PARAM
126 # define YYLEX_DECL() yylex(void *YYLEX_PARAM)
127 # define YYLEX yylex(YYLEX_PARAM)
128 #else
129 # define YYLEX_DECL() yylex(void)
130 # define YYLEX yylex()
131 #endif
132 
133 /* Parameters sent to yyerror. */
134 #ifndef YYERROR_DECL
135 #define YYERROR_DECL() yyerror(const char *s)
136 #endif
137 #ifndef YYERROR_CALL
138 #define YYERROR_CALL(msg) yyerror(msg)
139 #endif
140 
141 extern int YYPARSE_DECL();
142 
143 #define CHAR 257
144 #define NUMBER 258
145 #define SECTEND 259
146 #define SCDECL 260
147 #define XSCDECL 261
148 #define NAME 262
149 #define PREVCCL 263
150 #define EOF_OP 264
151 #define OPTION_OP 265
152 #define OPT_OUTFILE 266
153 #define OPT_PREFIX 267
154 #define OPT_YYCLASS 268
155 #define OPT_HEADER 269
156 #define OPT_EXTRA_TYPE 270
157 #define OPT_TABLES 271
158 #define CCE_ALNUM 272
159 #define CCE_ALPHA 273
160 #define CCE_BLANK 274
161 #define CCE_CNTRL 275
162 #define CCE_DIGIT 276
163 #define CCE_GRAPH 277
164 #define CCE_LOWER 278
165 #define CCE_PRINT 279
166 #define CCE_PUNCT 280
167 #define CCE_SPACE 281
168 #define CCE_UPPER 282
169 #define CCE_XDIGIT 283
170 #define CCE_NEG_ALNUM 284
171 #define CCE_NEG_ALPHA 285
172 #define CCE_NEG_BLANK 286
173 #define CCE_NEG_CNTRL 287
174 #define CCE_NEG_DIGIT 288
175 #define CCE_NEG_GRAPH 289
176 #define CCE_NEG_LOWER 290
177 #define CCE_NEG_PRINT 291
178 #define CCE_NEG_PUNCT 292
179 #define CCE_NEG_SPACE 293
180 #define CCE_NEG_UPPER 294
181 #define CCE_NEG_XDIGIT 295
182 #define CCL_OP_DIFF 296
183 #define CCL_OP_UNION 297
184 #define BEGIN_REPEAT_POSIX 298
185 #define END_REPEAT_POSIX 299
186 #define BEGIN_REPEAT_FLEX 300
187 #define END_REPEAT_FLEX 301
188 #define YYERRCODE 256
189 typedef int YYINT;
190 static const YYINT yylhs[] = {                           -1,
191     0,    1,    2,    2,    2,    2,    3,    6,    6,    7,
192     7,    7,    8,    9,    9,   10,   10,   10,   10,   10,
193    10,    4,    4,    4,    5,   12,   12,   12,   12,   14,
194    11,   11,   11,   15,   15,   15,   16,   13,   13,   13,
195    13,   18,   18,   17,   19,   19,   19,   19,   19,   20,
196    20,   20,   20,   20,   20,   20,   20,   20,   20,   20,
197    20,   21,   21,   21,   23,   23,   24,   24,   24,   24,
198    25,   25,   25,   25,   25,   25,   25,   25,   25,   25,
199    25,   25,   25,   25,   25,   25,   25,   25,   25,   25,
200    25,   25,   25,   25,   22,   22,
201 };
202 static const YYINT yylen[] = {                            2,
203     5,    0,    3,    2,    0,    1,    1,    1,    1,    2,
204     1,    1,    2,    2,    0,    3,    3,    3,    3,    3,
205     3,    5,    5,    0,    0,    2,    1,    1,    1,    0,
206     4,    3,    0,    3,    1,    1,    1,    2,    3,    2,
207     1,    3,    1,    2,    2,    1,    6,    5,    4,    2,
208     2,    2,    6,    5,    4,    1,    1,    1,    3,    3,
209     1,    3,    3,    1,    3,    4,    4,    2,    2,    0,
210     1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
211     1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
212     1,    1,    1,    1,    2,    0,
213 };
214 static const YYINT yydefred[] = {                         2,
215     0,    0,    6,    0,    7,    8,    9,   15,   24,    0,
216     4,    0,    0,   12,   11,    0,    0,    0,    0,    0,
217     0,    0,   14,    0,    1,    0,   10,    0,    0,    0,
218     0,    0,    0,    0,    0,   24,    0,   16,   18,   19,
219    20,   17,   21,   32,   36,   37,    0,   35,    0,   29,
220    61,   58,   28,    0,   56,   96,    0,    0,    0,   27,
221     0,    0,    0,    0,    0,   64,   31,    0,   23,   26,
222     0,    0,   70,    0,   22,    0,   40,    0,   44,    0,
223     0,    0,   50,   51,   52,    0,    0,   34,   95,   59,
224    60,    0,    0,   71,   72,   73,   74,   75,   76,   77,
225    78,   79,   80,   82,   81,   83,   84,   85,   86,   87,
226    88,   93,   89,   90,   91,   94,   92,   65,   69,   39,
227     0,    0,    0,   62,   63,   66,    0,   49,    0,   55,
228     0,   67,    0,   48,    0,   54,   47,   53,
229 };
230 #if defined(YYDESTRUCT_CALL) || defined(YYSTYPE_TOSTRING)
231 static const YYINT yystos[] = {                           0,
232   303,  304,  256,  305,  259,  260,  261,  265,  306,  309,
233   311,  312,  307,  256,  262,  310,  266,  267,  268,  269,
234   270,  271,  313,   60,  308,  314,  262,   61,   61,   61,
235    61,   61,   61,   42,  317,  123,  308,  262,  262,  262,
236   262,  262,  262,   62,  256,  262,  318,  319,  307,  256,
237   257,  263,  264,   94,   46,   34,   40,   91,  315,  316,
238   320,  321,  322,  323,  324,  326,   62,   44,  125,  316,
239   325,  321,   94,  327,   10,  321,   36,  124,   47,  298,
240   323,  300,   42,   43,   63,  296,  297,  319,  257,   34,
241    41,  327,  257,  272,  273,  274,  275,  276,  277,  278,
242   279,  280,  281,  282,  283,  284,  285,  286,  287,  288,
243   289,  290,  291,  292,  293,  294,  295,   93,  328,   36,
244   322,  258,  258,  326,  326,   93,   45,  299,   44,  301,
245    44,  257,  258,  299,  258,  301,  299,  301,
246 };
247 #endif /* YYDESTRUCT_CALL || YYSTYPE_TOSTRING */
248 static const YYINT yydgoto[] = {                          1,
249     2,    4,    9,   13,   25,   10,   16,   11,   12,   23,
250    26,   59,   60,   35,   47,   48,   61,   62,   63,   64,
251    65,   71,   66,   74,  119,
252 };
253 static const YYINT yysindex[] = {                         0,
254     0, -222,    0, -155,    0,    0,    0,    0,    0, -215,
255     0, -123,    6,    0,    0, -193,   10,   21,   26,   31,
256    35,   37,    0,   59,    0,  -44,    0, -147, -145, -140,
257  -133, -132, -129,   75, -214,    0,  -19,    0,    0,    0,
258     0,    0,    0,    0,    0,    0,   23,    0,  -48,    0,
259     0,    0,    0,  -17,    0,    0,  -17,   27,  128,    0,
260   -17,   -1,  -30,  -41, -189,    0,    0, -121,    0,    0,
261   -31,  -34,    0,  -87,    0,  -25,    0,  -17,    0, -109,
262   -41, -108,    0,    0,    0,   60,   60,    0,    0,    0,
263     0,   46,  107,    0,    0,    0,    0,    0,    0,    0,
264     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
265     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
266   -30,  -36,  -39,    0,    0,    0, -104,    0, -219,    0,
267  -238,    0, -144,    0, -143,    0,    0,    0,
268 };
269 static const YYINT yyrindex[] = {                         0,
270     0, -141,    0,    0,    0,    0,    0,    0,    0,    0,
271     0, -134,    9,    0,    0, -125,    0,    0,    0,    0,
272     0,    0,    0, -178,    0,   22,    0,    0,    0,    0,
273     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
274     0,    0,    0,    0,    0,    0,    0,    0,  -21,    0,
275     0,    0,    0,    0,    0,    0,    0,   85,    0,    0,
276     0,  144,   47,    4,  -10,    0,    0,    0,    0,    0,
277     0,    0,    0,    0,    0,  146,    0,    0,    0,    0,
278    18,    0,    0,    0,    0,    0,    0,    0,    0,    0,
279     0,    0,  124,    0,    0,    0,    0,    0,    0,    0,
280     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
281     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
282    50,    0,    0,    0,    0,    0,    0,    0,    0,    0,
283     0,    0,    0,    0,    0,    0,    0,    0,
284 };
285 #if YYBTYACC
286 static const YYINT yycindex[] = {                         0,
287     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
288     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
289     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
290     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
291     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
292     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
293     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
294     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
295     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
296     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
297     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
298     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
299     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
300     0,    0,    0,    0,    0,    0,    0,    0,
301 };
302 #endif
303 static const YYINT yygindex[] = {                         0,
304     0,    0,    0,  121,  133,    0,    0,    0,    0,    0,
305     0,    0,  106,    0,    0,   93,    0,   32,   84,  -45,
306     0,    0,   25,   90,    0,
307 };
308 #define YYTABLESIZE 419
309 static const YYINT yytable[] = {                         57,
310    83,   84,   90,   56,  131,  118,   91,  129,   25,   57,
311   120,   24,   33,   46,   56,   55,   56,   81,   33,  135,
312    57,   85,   57,   57,   33,   57,   55,   45,   55,   57,
313    57,   57,   57,    3,   77,   57,   57,   46,  133,   46,
314    14,   45,   33,   46,   46,   79,   15,   46,   33,   46,
315    46,   45,   57,   45,   33,   25,   43,   45,   45,   42,
316    58,   25,  136,   45,   45,   24,   68,   25,   27,   33,
317    28,   58,   33,   58,   54,   81,   69,   30,   36,  134,
318    57,   29,   43,   30,   67,   42,   30,   43,   72,   78,
319    42,   31,   76,   43,   46,   32,   42,   33,   78,   33,
320    34,   33,   33,    5,    6,    7,   86,   87,   45,    8,
321   124,  125,   25,   57,   38,   25,   39,    5,    5,    5,
322    73,   40,   78,    5,   13,   13,   13,   46,   41,   42,
323    13,   33,   43,    3,    3,    3,   44,   75,  126,    3,
324    46,   45,   17,   18,   19,   20,   21,   22,  122,  123,
325    58,  127,  132,   41,  137,   38,   49,  138,   37,   70,
326    88,  121,   92,    0,    0,    0,    0,    0,    0,   93,
327    43,    0,    0,   42,    0,    0,    0,   70,    0,    0,
328     0,    0,    0,    0,   94,   95,   96,   97,   98,   99,
329   100,  101,  102,  103,  104,  105,  106,  107,  108,  109,
330   110,  111,  112,  113,  114,  115,  116,  117,    0,    0,
331     0,    0,    0,    0,    0,    0,   68,    0,    0,    0,
332     0,    0,    0,    0,    0,   89,   51,    0,    0,    0,
333     0,    0,   52,    0,   33,   33,   50,   51,    0,   51,
334     0,   33,   33,   52,   53,   52,   57,    0,    0,    0,
335     0,    0,   57,    0,    0,    0,    0,    0,   82,    0,
336    46,  130,  128,    0,   33,   33,   46,   80,    0,    0,
337     0,   33,   33,    0,   45,    0,    0,   25,   25,    0,
338    45,    0,    0,    0,   25,   25,    0,   57,    0,   57,
339     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
340     0,   46,   93,    0,    0,    0,    0,    0,    0,    0,
341     0,    0,    0,    0,    0,   45,    0,   94,   95,   96,
342    97,   98,   99,  100,  101,  102,  103,  104,  105,  106,
343   107,  108,  109,  110,  111,  112,  113,  114,  115,  116,
344   117,   70,    0,    0,    0,    0,    0,    0,    0,    0,
345     0,    0,    0,    0,    0,    0,   70,   70,   70,   70,
346    70,   70,   70,   70,   70,   70,   70,   70,   70,   70,
347    70,   70,   70,   70,   70,   70,   70,   70,   70,   70,
348    68,    0,    0,    0,    0,    0,    0,    0,    0,    0,
349     0,    0,    0,    0,    0,   68,   68,   68,   68,   68,
350    68,   68,   68,   68,   68,   68,   68,   68,   68,   68,
351    68,   68,   68,   68,   68,   68,   68,   68,   68,
352 };
353 static const YYINT yycheck[] = {                         10,
354    42,   43,   34,   34,   44,   93,   41,   44,    0,   40,
355    36,   60,   34,   10,   34,   46,   34,   63,   40,  258,
356    40,   63,   40,   34,   46,   36,   46,   10,   46,   40,
357    41,   42,   43,  256,   36,   46,   47,   34,  258,   36,
358   256,  256,   34,   40,   41,   47,  262,  262,   40,   46,
359    47,   34,   63,   36,   46,   34,   10,   40,   41,   10,
360    91,   40,  301,   46,   47,   60,   44,   46,  262,   91,
361    61,   91,   94,   91,   94,  121,  125,  256,  123,  299,
362    91,   61,   36,  262,   62,   36,   61,   41,   57,  124,
363    41,   61,   61,   47,   91,   61,   47,   61,  124,   91,
364    42,  123,   94,  259,  260,  261,  296,  297,   91,  265,
365    86,   87,   91,  124,  262,   94,  262,  259,  260,  261,
366    94,  262,  124,  265,  259,  260,  261,  124,  262,  262,
367   265,  123,  262,  259,  260,  261,   62,   10,   93,  265,
368   262,  124,  266,  267,  268,  269,  270,  271,  258,  258,
369    91,   45,  257,   10,  299,   10,   36,  301,   26,   54,
370    68,   78,   73,   -1,   -1,   -1,   -1,   -1,   -1,  257,
371   124,   -1,   -1,  124,   -1,   -1,   -1,   93,   -1,   -1,
372    -1,   -1,   -1,   -1,  272,  273,  274,  275,  276,  277,
373   278,  279,  280,  281,  282,  283,  284,  285,  286,  287,
374   288,  289,  290,  291,  292,  293,  294,  295,   -1,   -1,
375    -1,   -1,   -1,   -1,   -1,   -1,   93,   -1,   -1,   -1,
376    -1,   -1,   -1,   -1,   -1,  257,  257,   -1,   -1,   -1,
377    -1,   -1,  263,   -1,  256,  257,  256,  257,   -1,  257,
378    -1,  263,  264,  263,  264,  263,  257,   -1,   -1,   -1,
379    -1,   -1,  263,   -1,   -1,   -1,   -1,   -1,  300,   -1,
380   257,  301,  299,   -1,  256,  257,  263,  298,   -1,   -1,
381    -1,  263,  264,   -1,  257,   -1,   -1,  256,  257,   -1,
382   263,   -1,   -1,   -1,  263,  264,   -1,  298,   -1,  300,
383    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
384    -1,  298,  257,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
385    -1,   -1,   -1,   -1,   -1,  298,   -1,  272,  273,  274,
386   275,  276,  277,  278,  279,  280,  281,  282,  283,  284,
387   285,  286,  287,  288,  289,  290,  291,  292,  293,  294,
388   295,  257,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
389    -1,   -1,   -1,   -1,   -1,   -1,  272,  273,  274,  275,
390   276,  277,  278,  279,  280,  281,  282,  283,  284,  285,
391   286,  287,  288,  289,  290,  291,  292,  293,  294,  295,
392   257,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
393    -1,   -1,   -1,   -1,   -1,  272,  273,  274,  275,  276,
394   277,  278,  279,  280,  281,  282,  283,  284,  285,  286,
395   287,  288,  289,  290,  291,  292,  293,  294,  295,
396 };
397 #if YYBTYACC
398 static const YYINT yyctable[] = {                        -1,
399    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
400    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
401    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
402    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
403    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
404    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
405    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
406    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
407    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
408    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
409    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
410    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
411    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
412    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
413    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
414    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
415    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
416    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
417    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
418    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
419    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
420    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
421    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
422    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
423    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
424    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
425    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
426    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
427    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
428    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
429    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
430    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
431    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
432    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
433    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
434    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
435    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
436    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
437    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
438    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
439    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
440    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
441 };
442 #endif
443 #define YYFINAL 1
444 #ifndef YYDEBUG
445 #define YYDEBUG 0
446 #endif
447 #define YYMAXTOKEN 301
448 #define YYUNDFTOKEN 329
449 #define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? YYUNDFTOKEN : (a))
450 #if YYDEBUG
451 static const char *const yyname[] = {
452 
453 "$end",0,0,0,0,0,0,0,0,0,"'\\n'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
454 "'\"'",0,"'$'",0,0,0,"'('","')'","'*'","'+'","','","'-'","'.'","'/'",0,0,0,0,0,
455 0,0,0,0,0,0,0,"'<'","'='","'>'","'?'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
456 0,0,0,0,0,0,"'['",0,"']'","'^'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
457 0,0,0,0,"'{'","'|'","'}'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
458 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
459 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
460 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"error","CHAR","NUMBER","SECTEND",
461 "SCDECL","XSCDECL","NAME","PREVCCL","EOF_OP","OPTION_OP","OPT_OUTFILE",
462 "OPT_PREFIX","OPT_YYCLASS","OPT_HEADER","OPT_EXTRA_TYPE","OPT_TABLES",
463 "CCE_ALNUM","CCE_ALPHA","CCE_BLANK","CCE_CNTRL","CCE_DIGIT","CCE_GRAPH",
464 "CCE_LOWER","CCE_PRINT","CCE_PUNCT","CCE_SPACE","CCE_UPPER","CCE_XDIGIT",
465 "CCE_NEG_ALNUM","CCE_NEG_ALPHA","CCE_NEG_BLANK","CCE_NEG_CNTRL","CCE_NEG_DIGIT",
466 "CCE_NEG_GRAPH","CCE_NEG_LOWER","CCE_NEG_PRINT","CCE_NEG_PUNCT","CCE_NEG_SPACE",
467 "CCE_NEG_UPPER","CCE_NEG_XDIGIT","CCL_OP_DIFF","CCL_OP_UNION",
468 "BEGIN_REPEAT_POSIX","END_REPEAT_POSIX","BEGIN_REPEAT_FLEX","END_REPEAT_FLEX",
469 "$accept","goal","initlex","sect1","sect1end","sect2","initforrule",
470 "startconddecl","namelist1","options","optionlist","option","scon","flexrule",
471 "rule","scon_stk_ptr","namelist2","sconname","re2","re","series","singleton",
472 "fullccl","string","braceccl","ccl","ccl_expr","illegal-symbol",
473 };
474 static const char *const yyrule[] = {
475 "$accept : goal",
476 "goal : initlex sect1 sect1end sect2 initforrule",
477 "initlex :",
478 "sect1 : sect1 startconddecl namelist1",
479 "sect1 : sect1 options",
480 "sect1 :",
481 "sect1 : error",
482 "sect1end : SECTEND",
483 "startconddecl : SCDECL",
484 "startconddecl : XSCDECL",
485 "namelist1 : namelist1 NAME",
486 "namelist1 : NAME",
487 "namelist1 : error",
488 "options : OPTION_OP optionlist",
489 "optionlist : optionlist option",
490 "optionlist :",
491 "option : OPT_OUTFILE '=' NAME",
492 "option : OPT_EXTRA_TYPE '=' NAME",
493 "option : OPT_PREFIX '=' NAME",
494 "option : OPT_YYCLASS '=' NAME",
495 "option : OPT_HEADER '=' NAME",
496 "option : OPT_TABLES '=' NAME",
497 "sect2 : sect2 scon initforrule flexrule '\\n'",
498 "sect2 : sect2 scon '{' sect2 '}'",
499 "sect2 :",
500 "initforrule :",
501 "flexrule : '^' rule",
502 "flexrule : rule",
503 "flexrule : EOF_OP",
504 "flexrule : error",
505 "scon_stk_ptr :",
506 "scon : '<' scon_stk_ptr namelist2 '>'",
507 "scon : '<' '*' '>'",
508 "scon :",
509 "namelist2 : namelist2 ',' sconname",
510 "namelist2 : sconname",
511 "namelist2 : error",
512 "sconname : NAME",
513 "rule : re2 re",
514 "rule : re2 re '$'",
515 "rule : re '$'",
516 "rule : re",
517 "re : re '|' series",
518 "re : series",
519 "re2 : re '/'",
520 "series : series singleton",
521 "series : singleton",
522 "series : series BEGIN_REPEAT_POSIX NUMBER ',' NUMBER END_REPEAT_POSIX",
523 "series : series BEGIN_REPEAT_POSIX NUMBER ',' END_REPEAT_POSIX",
524 "series : series BEGIN_REPEAT_POSIX NUMBER END_REPEAT_POSIX",
525 "singleton : singleton '*'",
526 "singleton : singleton '+'",
527 "singleton : singleton '?'",
528 "singleton : singleton BEGIN_REPEAT_FLEX NUMBER ',' NUMBER END_REPEAT_FLEX",
529 "singleton : singleton BEGIN_REPEAT_FLEX NUMBER ',' END_REPEAT_FLEX",
530 "singleton : singleton BEGIN_REPEAT_FLEX NUMBER END_REPEAT_FLEX",
531 "singleton : '.'",
532 "singleton : fullccl",
533 "singleton : PREVCCL",
534 "singleton : '\"' string '\"'",
535 "singleton : '(' re ')'",
536 "singleton : CHAR",
537 "fullccl : fullccl CCL_OP_DIFF braceccl",
538 "fullccl : fullccl CCL_OP_UNION braceccl",
539 "fullccl : braceccl",
540 "braceccl : '[' ccl ']'",
541 "braceccl : '[' '^' ccl ']'",
542 "ccl : ccl CHAR '-' CHAR",
543 "ccl : ccl CHAR",
544 "ccl : ccl ccl_expr",
545 "ccl :",
546 "ccl_expr : CCE_ALNUM",
547 "ccl_expr : CCE_ALPHA",
548 "ccl_expr : CCE_BLANK",
549 "ccl_expr : CCE_CNTRL",
550 "ccl_expr : CCE_DIGIT",
551 "ccl_expr : CCE_GRAPH",
552 "ccl_expr : CCE_LOWER",
553 "ccl_expr : CCE_PRINT",
554 "ccl_expr : CCE_PUNCT",
555 "ccl_expr : CCE_SPACE",
556 "ccl_expr : CCE_XDIGIT",
557 "ccl_expr : CCE_UPPER",
558 "ccl_expr : CCE_NEG_ALNUM",
559 "ccl_expr : CCE_NEG_ALPHA",
560 "ccl_expr : CCE_NEG_BLANK",
561 "ccl_expr : CCE_NEG_CNTRL",
562 "ccl_expr : CCE_NEG_DIGIT",
563 "ccl_expr : CCE_NEG_GRAPH",
564 "ccl_expr : CCE_NEG_PRINT",
565 "ccl_expr : CCE_NEG_PUNCT",
566 "ccl_expr : CCE_NEG_SPACE",
567 "ccl_expr : CCE_NEG_XDIGIT",
568 "ccl_expr : CCE_NEG_LOWER",
569 "ccl_expr : CCE_NEG_UPPER",
570 "string : string CHAR",
571 "string :",
572 
573 };
574 #endif
575 
576 int      yydebug;
577 int      yynerrs;
578 
579 int      yyerrflag;
580 int      yychar;
581 YYSTYPE  yyval;
582 YYSTYPE  yylval;
583 
584 /* define the initial stack-sizes */
585 #ifdef YYSTACKSIZE
586 #undef YYMAXDEPTH
587 #define YYMAXDEPTH  YYSTACKSIZE
588 #else
589 #ifdef YYMAXDEPTH
590 #define YYSTACKSIZE YYMAXDEPTH
591 #else
592 #define YYSTACKSIZE 10000
593 #define YYMAXDEPTH  10000
594 #endif
595 #endif
596 
597 #define YYINITSTACKSIZE 200
598 
599 typedef struct {
600     unsigned stacksize;
601     YYINT    *s_base;
602     YYINT    *s_mark;
603     YYINT    *s_last;
604     YYSTYPE  *l_base;
605     YYSTYPE  *l_mark;
606 } YYSTACKDATA;
607 /* variables for the parser stack */
608 static YYSTACKDATA yystack;
609 #line 951 "/p/netbsd/cvsroot/src/external/bsd/flex/dist/src/parse.y"
610 
611 
612 /* build_eof_action - build the "<<EOF>>" action for the active start
613  *                    conditions
614  */
615 
616 void build_eof_action()
617 	{
618 	int i;
619 	char action_text[MAXLINE];
620 
621 	for ( i = 1; i <= scon_stk_ptr; ++i )
622 		{
623 		if ( sceof[scon_stk[i]] )
624 			format_pinpoint_message(
625 				"multiple <<EOF>> rules for start condition %s",
626 				scname[scon_stk[i]] );
627 
628 		else
629 			{
630 			sceof[scon_stk[i]] = true;
631 
632 			if (previous_continued_action /* && previous action was regular */)
633 				add_action("YY_RULE_SETUP\n");
634 
635 			snprintf( action_text, sizeof(action_text), "case YY_STATE_EOF(%s):\n",
636 				scname[scon_stk[i]] );
637 			add_action( action_text );
638 			}
639 		}
640 
641 	line_directive_out( (FILE *) 0, 1 );
642 
643 	/* This isn't a normal rule after all - don't count it as
644 	 * such, so we don't have any holes in the rule numbering
645 	 * (which make generating "rule can never match" warnings
646 	 * more difficult.
647 	 */
648 	--num_rules;
649 	++num_eof_rules;
650 	}
651 
652 
653 /* format_synerr - write out formatted syntax error */
654 
655 void format_synerr( msg, arg )
656 const char *msg, arg[];
657 	{
658 	char errmsg[MAXLINE];
659 
660 	(void) snprintf( errmsg, sizeof(errmsg), msg, arg );
661 	synerr( errmsg );
662 	}
663 
664 
665 /* synerr - report a syntax error */
666 
667 void synerr( str )
668 const char *str;
669 	{
670 	syntaxerror = true;
671 	pinpoint_message( str );
672 	}
673 
674 
675 /* format_warn - write out formatted warning */
676 
677 void format_warn( msg, arg )
678 const char *msg, arg[];
679 	{
680 	char warn_msg[MAXLINE];
681 
682 	snprintf( warn_msg, sizeof(warn_msg), msg, arg );
683 	lwarn( warn_msg );
684 	}
685 
686 
687 /* lwarn - report a warning, unless -w was given */
688 
689 void lwarn( str )
690 const char *str;
691 	{
692 	line_warning( str, linenum );
693 	}
694 
695 /* format_pinpoint_message - write out a message formatted with one string,
696  *			     pinpointing its location
697  */
698 
699 void format_pinpoint_message( msg, arg )
700 const char *msg, arg[];
701 	{
702 	char errmsg[MAXLINE];
703 
704 	snprintf( errmsg, sizeof(errmsg), msg, arg );
705 	pinpoint_message( errmsg );
706 	}
707 
708 
709 /* pinpoint_message - write out a message, pinpointing its location */
710 
711 void pinpoint_message( str )
712 const char *str;
713 	{
714 	line_pinpoint( str, linenum );
715 	}
716 
717 
718 /* line_warning - report a warning at a given line, unless -w was given */
719 
720 void line_warning( str, line )
721 const char *str;
722 int line;
723 	{
724 	char warning[MAXLINE];
725 
726 	if ( ! nowarn )
727 		{
728 		snprintf( warning, sizeof(warning), "warning, %s", str );
729 		line_pinpoint( warning, line );
730 		}
731 	}
732 
733 
734 /* line_pinpoint - write out a message, pinpointing it at the given line */
735 
736 void line_pinpoint( str, line )
737 const char *str;
738 int line;
739 	{
740 	fprintf( stderr, "%s:%d: %s\n", infilename, line, str );
741 	}
742 
743 
744 /* yyerror - eat up an error message from the parser;
745  *	     currently, messages are ignore
746  */
747 
748 void yyerror( msg )
749 const char *msg;
750 	{
751 		(void)msg;
752 	}
753 #line 754 "parse.c"
754 
755 #if YYDEBUG
756 #include <stdio.h>		/* needed for printf */
757 #endif
758 
759 #include <stdlib.h>	/* needed for malloc, etc */
760 #include <string.h>	/* needed for memset */
761 
762 /* allocate initial stack or double stack size, up to YYMAXDEPTH */
763 static int yygrowstack(YYSTACKDATA *data)
764 {
765     int i;
766     unsigned newsize;
767     YYINT *newss;
768     YYSTYPE *newvs;
769 
770     if ((newsize = data->stacksize) == 0)
771         newsize = YYINITSTACKSIZE;
772     else if (newsize >= YYMAXDEPTH)
773         return YYENOMEM;
774     else if ((newsize *= 2) > YYMAXDEPTH)
775         newsize = YYMAXDEPTH;
776 
777     i = (int) (data->s_mark - data->s_base);
778     newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss));
779     if (newss == 0)
780         return YYENOMEM;
781 
782     data->s_base = newss;
783     data->s_mark = newss + i;
784 
785     newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs));
786     if (newvs == 0)
787         return YYENOMEM;
788 
789     data->l_base = newvs;
790     data->l_mark = newvs + i;
791 
792     data->stacksize = newsize;
793     data->s_last = data->s_base + newsize - 1;
794     return 0;
795 }
796 
797 #if YYPURE || defined(YY_NO_LEAKS)
798 static void yyfreestack(YYSTACKDATA *data)
799 {
800     free(data->s_base);
801     free(data->l_base);
802     memset(data, 0, sizeof(*data));
803 }
804 #else
805 #define yyfreestack(data) /* nothing */
806 #endif
807 
808 #define YYABORT  goto yyabort
809 #define YYREJECT goto yyabort
810 #define YYACCEPT goto yyaccept
811 #define YYERROR  goto yyerrlab
812 
813 int
814 YYPARSE_DECL()
815 {
816     int yym, yyn, yystate;
817 #if YYDEBUG
818     const char *yys;
819 
820     if ((yys = getenv("YYDEBUG")) != 0)
821     {
822         yyn = *yys;
823         if (yyn >= '0' && yyn <= '9')
824             yydebug = yyn - '0';
825     }
826 #endif
827 
828     yynerrs = 0;
829     yyerrflag = 0;
830     yychar = YYEMPTY;
831     yystate = 0;
832 
833 #if YYPURE
834     memset(&yystack, 0, sizeof(yystack));
835 #endif
836 
837     if (yystack.s_base == NULL && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
838     yystack.s_mark = yystack.s_base;
839     yystack.l_mark = yystack.l_base;
840     yystate = 0;
841     *yystack.s_mark = 0;
842 
843 yyloop:
844     if ((yyn = yydefred[yystate]) != 0) goto yyreduce;
845     if (yychar < 0)
846     {
847         if ((yychar = YYLEX) < 0) yychar = YYEOF;
848 #if YYDEBUG
849         if (yydebug)
850         {
851             yys = yyname[YYTRANSLATE(yychar)];
852             printf("%sdebug: state %d, reading %d (%s)\n",
853                     YYPREFIX, yystate, yychar, yys);
854         }
855 #endif
856     }
857     if ((yyn = yysindex[yystate]) && (yyn += yychar) >= 0 &&
858             yyn <= YYTABLESIZE && yycheck[yyn] == yychar)
859     {
860 #if YYDEBUG
861         if (yydebug)
862             printf("%sdebug: state %d, shifting to state %d\n",
863                     YYPREFIX, yystate, yytable[yyn]);
864 #endif
865         if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM)
866         {
867             goto yyoverflow;
868         }
869         yystate = yytable[yyn];
870         *++yystack.s_mark = yytable[yyn];
871         *++yystack.l_mark = yylval;
872         yychar = YYEMPTY;
873         if (yyerrflag > 0)  --yyerrflag;
874         goto yyloop;
875     }
876     if ((yyn = yyrindex[yystate]) && (yyn += yychar) >= 0 &&
877             yyn <= YYTABLESIZE && yycheck[yyn] == yychar)
878     {
879         yyn = yytable[yyn];
880         goto yyreduce;
881     }
882     if (yyerrflag) goto yyinrecovery;
883 
884     YYERROR_CALL("syntax error");
885 
886     goto yyerrlab;
887 
888 yyerrlab:
889     ++yynerrs;
890 
891 yyinrecovery:
892     if (yyerrflag < 3)
893     {
894         yyerrflag = 3;
895         for (;;)
896         {
897             if ((yyn = yysindex[*yystack.s_mark]) && (yyn += YYERRCODE) >= 0 &&
898                     yyn <= YYTABLESIZE && yycheck[yyn] == YYERRCODE)
899             {
900 #if YYDEBUG
901                 if (yydebug)
902                     printf("%sdebug: state %d, error recovery shifting\
903  to state %d\n", YYPREFIX, *yystack.s_mark, yytable[yyn]);
904 #endif
905                 if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM)
906                 {
907                     goto yyoverflow;
908                 }
909                 yystate = yytable[yyn];
910                 *++yystack.s_mark = yytable[yyn];
911                 *++yystack.l_mark = yylval;
912                 goto yyloop;
913             }
914             else
915             {
916 #if YYDEBUG
917                 if (yydebug)
918                     printf("%sdebug: error recovery discarding state %d\n",
919                             YYPREFIX, *yystack.s_mark);
920 #endif
921                 if (yystack.s_mark <= yystack.s_base) goto yyabort;
922                 --yystack.s_mark;
923                 --yystack.l_mark;
924             }
925         }
926     }
927     else
928     {
929         if (yychar == YYEOF) goto yyabort;
930 #if YYDEBUG
931         if (yydebug)
932         {
933             yys = yyname[YYTRANSLATE(yychar)];
934             printf("%sdebug: state %d, error recovery discards token %d (%s)\n",
935                     YYPREFIX, yystate, yychar, yys);
936         }
937 #endif
938         yychar = YYEMPTY;
939         goto yyloop;
940     }
941 
942 yyreduce:
943 #if YYDEBUG
944     if (yydebug)
945         printf("%sdebug: state %d, reducing by rule %d (%s)\n",
946                 YYPREFIX, yystate, yyn, yyrule[yyn]);
947 #endif
948     yym = yylen[yyn];
949     if (yym)
950         yyval = yystack.l_mark[1-yym];
951     else
952         memset(&yyval, 0, sizeof yyval);
953     switch (yyn)
954     {
955 case 1:
956 #line 122 "/p/netbsd/cvsroot/src/external/bsd/flex/dist/src/parse.y"
957 	{ /* add default rule */
958 			int def_rule;
959 
960 			pat = cclinit();
961 			cclnegate( pat );
962 
963 			def_rule = mkstate( -pat );
964 
965 			/* Remember the number of the default rule so we
966 			 * don't generate "can't match" warnings for it.
967 			 */
968 			default_rule = num_rules;
969 
970 			finish_rule( def_rule, false, 0, 0, 0);
971 
972 			for ( i = 1; i <= lastsc; ++i )
973 				scset[i] = mkbranch( scset[i], def_rule );
974 
975 			if ( spprdflt )
976 				add_action(
977 				"YY_FATAL_ERROR( \"flex scanner jammed\" )" );
978 			else
979 				add_action( "ECHO" );
980 
981 			add_action( ";\n\tYY_BREAK\n" );
982 			}
983 break;
984 case 2:
985 #line 151 "/p/netbsd/cvsroot/src/external/bsd/flex/dist/src/parse.y"
986 	{ /* initialize for processing rules */
987 
988 			/* Create default DFA start condition. */
989 			scinstal( "INITIAL", false );
990 			}
991 break;
992 case 6:
993 #line 162 "/p/netbsd/cvsroot/src/external/bsd/flex/dist/src/parse.y"
994 	{ synerr( _("unknown error processing section 1") ); }
995 break;
996 case 7:
997 #line 166 "/p/netbsd/cvsroot/src/external/bsd/flex/dist/src/parse.y"
998 	{
999 			check_options();
1000 			scon_stk = allocate_integer_array( lastsc + 1 );
1001 			scon_stk_ptr = 0;
1002 			}
1003 break;
1004 case 8:
1005 #line 174 "/p/netbsd/cvsroot/src/external/bsd/flex/dist/src/parse.y"
1006 	{ xcluflg = false; }
1007 break;
1008 case 9:
1009 #line 177 "/p/netbsd/cvsroot/src/external/bsd/flex/dist/src/parse.y"
1010 	{ xcluflg = true; }
1011 break;
1012 case 10:
1013 #line 181 "/p/netbsd/cvsroot/src/external/bsd/flex/dist/src/parse.y"
1014 	{ scinstal( nmstr, xcluflg ); }
1015 break;
1016 case 11:
1017 #line 184 "/p/netbsd/cvsroot/src/external/bsd/flex/dist/src/parse.y"
1018 	{ scinstal( nmstr, xcluflg ); }
1019 break;
1020 case 12:
1021 #line 187 "/p/netbsd/cvsroot/src/external/bsd/flex/dist/src/parse.y"
1022 	{ synerr( _("bad start condition list") ); }
1023 break;
1024 case 16:
1025 #line 198 "/p/netbsd/cvsroot/src/external/bsd/flex/dist/src/parse.y"
1026 	{
1027 			outfilename = copy_string( nmstr );
1028 			did_outfilename = 1;
1029 			}
1030 break;
1031 case 17:
1032 #line 203 "/p/netbsd/cvsroot/src/external/bsd/flex/dist/src/parse.y"
1033 	{ extra_type = copy_string( nmstr ); }
1034 break;
1035 case 18:
1036 #line 205 "/p/netbsd/cvsroot/src/external/bsd/flex/dist/src/parse.y"
1037 	{ prefix = copy_string( nmstr ); }
1038 break;
1039 case 19:
1040 #line 207 "/p/netbsd/cvsroot/src/external/bsd/flex/dist/src/parse.y"
1041 	{ yyclass = copy_string( nmstr ); }
1042 break;
1043 case 20:
1044 #line 209 "/p/netbsd/cvsroot/src/external/bsd/flex/dist/src/parse.y"
1045 	{ headerfilename = copy_string( nmstr ); }
1046 break;
1047 case 21:
1048 #line 211 "/p/netbsd/cvsroot/src/external/bsd/flex/dist/src/parse.y"
1049 	{ tablesext = true; tablesfilename = copy_string( nmstr ); }
1050 break;
1051 case 22:
1052 #line 215 "/p/netbsd/cvsroot/src/external/bsd/flex/dist/src/parse.y"
1053 	{ scon_stk_ptr = yystack.l_mark[-3]; }
1054 break;
1055 case 23:
1056 #line 217 "/p/netbsd/cvsroot/src/external/bsd/flex/dist/src/parse.y"
1057 	{ scon_stk_ptr = yystack.l_mark[-3]; }
1058 break;
1059 case 25:
1060 #line 222 "/p/netbsd/cvsroot/src/external/bsd/flex/dist/src/parse.y"
1061 	{
1062 			/* Initialize for a parse of one rule. */
1063 			trlcontxt = variable_trail_rule = varlength = false;
1064 			trailcnt = headcnt = rulelen = 0;
1065 			current_state_type = STATE_NORMAL;
1066 			previous_continued_action = continued_action;
1067 			in_rule = true;
1068 
1069 			new_rule();
1070 			}
1071 break;
1072 case 26:
1073 #line 235 "/p/netbsd/cvsroot/src/external/bsd/flex/dist/src/parse.y"
1074 	{
1075 			pat = yystack.l_mark[0];
1076 			finish_rule( pat, variable_trail_rule,
1077 				headcnt, trailcnt , previous_continued_action);
1078 
1079 			if ( scon_stk_ptr > 0 )
1080 				{
1081 				for ( i = 1; i <= scon_stk_ptr; ++i )
1082 					scbol[scon_stk[i]] =
1083 						mkbranch( scbol[scon_stk[i]],
1084 								pat );
1085 				}
1086 
1087 			else
1088 				{
1089 				/* Add to all non-exclusive start conditions,
1090 				 * including the default (0) start condition.
1091 				 */
1092 
1093 				for ( i = 1; i <= lastsc; ++i )
1094 					if ( ! scxclu[i] )
1095 						scbol[i] = mkbranch( scbol[i],
1096 									pat );
1097 				}
1098 
1099 			if ( ! bol_needed )
1100 				{
1101 				bol_needed = true;
1102 
1103 				if ( performance_report > 1 )
1104 					pinpoint_message(
1105 			"'^' operator results in sub-optimal performance" );
1106 				}
1107 			}
1108 break;
1109 case 27:
1110 #line 271 "/p/netbsd/cvsroot/src/external/bsd/flex/dist/src/parse.y"
1111 	{
1112 			pat = yystack.l_mark[0];
1113 			finish_rule( pat, variable_trail_rule,
1114 				headcnt, trailcnt , previous_continued_action);
1115 
1116 			if ( scon_stk_ptr > 0 )
1117 				{
1118 				for ( i = 1; i <= scon_stk_ptr; ++i )
1119 					scset[scon_stk[i]] =
1120 						mkbranch( scset[scon_stk[i]],
1121 								pat );
1122 				}
1123 
1124 			else
1125 				{
1126 				for ( i = 1; i <= lastsc; ++i )
1127 					if ( ! scxclu[i] )
1128 						scset[i] =
1129 							mkbranch( scset[i],
1130 								pat );
1131 				}
1132 			}
1133 break;
1134 case 28:
1135 #line 295 "/p/netbsd/cvsroot/src/external/bsd/flex/dist/src/parse.y"
1136 	{
1137 			if ( scon_stk_ptr > 0 )
1138 				build_eof_action();
1139 
1140 			else
1141 				{
1142 				/* This EOF applies to all start conditions
1143 				 * which don't already have EOF actions.
1144 				 */
1145 				for ( i = 1; i <= lastsc; ++i )
1146 					if ( ! sceof[i] )
1147 						scon_stk[++scon_stk_ptr] = i;
1148 
1149 				if ( scon_stk_ptr == 0 )
1150 					lwarn(
1151 			"all start conditions already have <<EOF>> rules" );
1152 
1153 				else
1154 					build_eof_action();
1155 				}
1156 			}
1157 break;
1158 case 29:
1159 #line 318 "/p/netbsd/cvsroot/src/external/bsd/flex/dist/src/parse.y"
1160 	{ synerr( _("unrecognized rule") ); }
1161 break;
1162 case 30:
1163 #line 322 "/p/netbsd/cvsroot/src/external/bsd/flex/dist/src/parse.y"
1164 	{ yyval = scon_stk_ptr; }
1165 break;
1166 case 31:
1167 #line 326 "/p/netbsd/cvsroot/src/external/bsd/flex/dist/src/parse.y"
1168 	{ yyval = yystack.l_mark[-2]; }
1169 break;
1170 case 32:
1171 #line 329 "/p/netbsd/cvsroot/src/external/bsd/flex/dist/src/parse.y"
1172 	{
1173 			yyval = scon_stk_ptr;
1174 
1175 			for ( i = 1; i <= lastsc; ++i )
1176 				{
1177 				int j;
1178 
1179 				for ( j = 1; j <= scon_stk_ptr; ++j )
1180 					if ( scon_stk[j] == i )
1181 						break;
1182 
1183 				if ( j > scon_stk_ptr )
1184 					scon_stk[++scon_stk_ptr] = i;
1185 				}
1186 			}
1187 break;
1188 case 33:
1189 #line 346 "/p/netbsd/cvsroot/src/external/bsd/flex/dist/src/parse.y"
1190 	{ yyval = scon_stk_ptr; }
1191 break;
1192 case 36:
1193 #line 354 "/p/netbsd/cvsroot/src/external/bsd/flex/dist/src/parse.y"
1194 	{ synerr( _("bad start condition list") ); }
1195 break;
1196 case 37:
1197 #line 358 "/p/netbsd/cvsroot/src/external/bsd/flex/dist/src/parse.y"
1198 	{
1199 			if ( (scnum = sclookup( nmstr )) == 0 )
1200 				format_pinpoint_message(
1201 					"undeclared start condition %s",
1202 					nmstr );
1203 			else
1204 				{
1205 				for ( i = 1; i <= scon_stk_ptr; ++i )
1206 					if ( scon_stk[i] == scnum )
1207 						{
1208 						format_warn(
1209 							"<%s> specified twice",
1210 							scname[scnum] );
1211 						break;
1212 						}
1213 
1214 				if ( i > scon_stk_ptr )
1215 					scon_stk[++scon_stk_ptr] = scnum;
1216 				}
1217 			}
1218 break;
1219 case 38:
1220 #line 381 "/p/netbsd/cvsroot/src/external/bsd/flex/dist/src/parse.y"
1221 	{
1222 			if ( transchar[lastst[yystack.l_mark[0]]] != SYM_EPSILON )
1223 				/* Provide final transition \now/ so it
1224 				 * will be marked as a trailing context
1225 				 * state.
1226 				 */
1227 				yystack.l_mark[0] = link_machines( yystack.l_mark[0],
1228 						mkstate( SYM_EPSILON ) );
1229 
1230 			mark_beginning_as_normal( yystack.l_mark[0] );
1231 			current_state_type = STATE_NORMAL;
1232 
1233 			if ( previous_continued_action )
1234 				{
1235 				/* We need to treat this as variable trailing
1236 				 * context so that the backup does not happen
1237 				 * in the action but before the action switch
1238 				 * statement.  If the backup happens in the
1239 				 * action, then the rules "falling into" this
1240 				 * one's action will *also* do the backup,
1241 				 * erroneously.
1242 				 */
1243 				if ( ! varlength || headcnt != 0 )
1244 					lwarn(
1245 		"trailing context made variable due to preceding '|' action" );
1246 
1247 				/* Mark as variable. */
1248 				varlength = true;
1249 				headcnt = 0;
1250 
1251 				}
1252 
1253 			if ( lex_compat || (varlength && headcnt == 0) )
1254 				{ /* variable trailing context rule */
1255 				/* Mark the first part of the rule as the
1256 				 * accepting "head" part of a trailing
1257 				 * context rule.
1258 				 *
1259 				 * By the way, we didn't do this at the
1260 				 * beginning of this production because back
1261 				 * then current_state_type was set up for a
1262 				 * trail rule, and add_accept() can create
1263 				 * a new state ...
1264 				 */
1265 				add_accept( yystack.l_mark[-1],
1266 					num_rules | YY_TRAILING_HEAD_MASK );
1267 				variable_trail_rule = true;
1268 				}
1269 
1270 			else
1271 				trailcnt = rulelen;
1272 
1273 			yyval = link_machines( yystack.l_mark[-1], yystack.l_mark[0] );
1274 			}
1275 break;
1276 case 39:
1277 #line 437 "/p/netbsd/cvsroot/src/external/bsd/flex/dist/src/parse.y"
1278 	{ synerr( _("trailing context used twice") ); }
1279 break;
1280 case 40:
1281 #line 440 "/p/netbsd/cvsroot/src/external/bsd/flex/dist/src/parse.y"
1282 	{
1283 			headcnt = 0;
1284 			trailcnt = 1;
1285 			rulelen = 1;
1286 			varlength = false;
1287 
1288 			current_state_type = STATE_TRAILING_CONTEXT;
1289 
1290 			if ( trlcontxt )
1291 				{
1292 				synerr( _("trailing context used twice") );
1293 				yyval = mkstate( SYM_EPSILON );
1294 				}
1295 
1296 			else if ( previous_continued_action )
1297 				{
1298 				/* See the comment in the rule for "re2 re"
1299 				 * above.
1300 				 */
1301 				lwarn(
1302 		"trailing context made variable due to preceding '|' action" );
1303 
1304 				varlength = true;
1305 				}
1306 
1307 			if ( lex_compat || varlength )
1308 				{
1309 				/* Again, see the comment in the rule for
1310 				 * "re2 re" above.
1311 				 */
1312 				add_accept( yystack.l_mark[-1],
1313 					num_rules | YY_TRAILING_HEAD_MASK );
1314 				variable_trail_rule = true;
1315 				}
1316 
1317 			trlcontxt = true;
1318 
1319 			eps = mkstate( SYM_EPSILON );
1320 			yyval = link_machines( yystack.l_mark[-1],
1321 				link_machines( eps, mkstate( '\n' ) ) );
1322 			}
1323 break;
1324 case 41:
1325 #line 483 "/p/netbsd/cvsroot/src/external/bsd/flex/dist/src/parse.y"
1326 	{
1327 			yyval = yystack.l_mark[0];
1328 
1329 			if ( trlcontxt )
1330 				{
1331 				if ( lex_compat || (varlength && headcnt == 0) )
1332 					/* Both head and trail are
1333 					 * variable-length.
1334 					 */
1335 					variable_trail_rule = true;
1336 				else
1337 					trailcnt = rulelen;
1338 				}
1339 			}
1340 break;
1341 case 42:
1342 #line 501 "/p/netbsd/cvsroot/src/external/bsd/flex/dist/src/parse.y"
1343 	{
1344 			varlength = true;
1345 			yyval = mkor( yystack.l_mark[-2], yystack.l_mark[0] );
1346 			}
1347 break;
1348 case 43:
1349 #line 507 "/p/netbsd/cvsroot/src/external/bsd/flex/dist/src/parse.y"
1350 	{ yyval = yystack.l_mark[0]; }
1351 break;
1352 case 44:
1353 #line 512 "/p/netbsd/cvsroot/src/external/bsd/flex/dist/src/parse.y"
1354 	{
1355 			/* This rule is written separately so the
1356 			 * reduction will occur before the trailing
1357 			 * series is parsed.
1358 			 */
1359 
1360 			if ( trlcontxt )
1361 				synerr( _("trailing context used twice") );
1362 			else
1363 				trlcontxt = true;
1364 
1365 			if ( varlength )
1366 				/* We hope the trailing context is
1367 				 * fixed-length.
1368 				 */
1369 				varlength = false;
1370 			else
1371 				headcnt = rulelen;
1372 
1373 			rulelen = 0;
1374 
1375 			current_state_type = STATE_TRAILING_CONTEXT;
1376 			yyval = yystack.l_mark[-1];
1377 			}
1378 break;
1379 case 45:
1380 #line 539 "/p/netbsd/cvsroot/src/external/bsd/flex/dist/src/parse.y"
1381 	{
1382 			/* This is where concatenation of adjacent patterns
1383 			 * gets done.
1384 			 */
1385 			yyval = link_machines( yystack.l_mark[-1], yystack.l_mark[0] );
1386 			}
1387 break;
1388 case 46:
1389 #line 547 "/p/netbsd/cvsroot/src/external/bsd/flex/dist/src/parse.y"
1390 	{ yyval = yystack.l_mark[0]; }
1391 break;
1392 case 47:
1393 #line 550 "/p/netbsd/cvsroot/src/external/bsd/flex/dist/src/parse.y"
1394 	{
1395 			varlength = true;
1396 
1397 			if ( yystack.l_mark[-3] > yystack.l_mark[-1] || yystack.l_mark[-3] < 0 )
1398 				{
1399 				synerr( _("bad iteration values") );
1400 				yyval = yystack.l_mark[-5];
1401 				}
1402 			else
1403 				{
1404 				if ( yystack.l_mark[-3] == 0 )
1405 					{
1406 					if ( yystack.l_mark[-1] <= 0 )
1407 						{
1408 						synerr(
1409 						_("bad iteration values") );
1410 						yyval = yystack.l_mark[-5];
1411 						}
1412 					else
1413 						yyval = mkopt(
1414 							mkrep( yystack.l_mark[-5], 1, yystack.l_mark[-1] ) );
1415 					}
1416 				else
1417 					yyval = mkrep( yystack.l_mark[-5], yystack.l_mark[-3], yystack.l_mark[-1] );
1418 				}
1419 			}
1420 break;
1421 case 48:
1422 #line 578 "/p/netbsd/cvsroot/src/external/bsd/flex/dist/src/parse.y"
1423 	{
1424 			varlength = true;
1425 
1426 			if ( yystack.l_mark[-2] <= 0 )
1427 				{
1428 				synerr( _("iteration value must be positive") );
1429 				yyval = yystack.l_mark[-4];
1430 				}
1431 
1432 			else
1433 				yyval = mkrep( yystack.l_mark[-4], yystack.l_mark[-2], INFINITE_REPEAT );
1434 			}
1435 break;
1436 case 49:
1437 #line 592 "/p/netbsd/cvsroot/src/external/bsd/flex/dist/src/parse.y"
1438 	{
1439 			/* The series could be something like "(foo)",
1440 			 * in which case we have no idea what its length
1441 			 * is, so we punt here.
1442 			 */
1443 			varlength = true;
1444 
1445 			if ( yystack.l_mark[-1] <= 0 )
1446 				{
1447 				  synerr( _("iteration value must be positive")
1448 					  );
1449 				yyval = yystack.l_mark[-3];
1450 				}
1451 
1452 			else
1453 				yyval = link_machines( yystack.l_mark[-3],
1454 						copysingl( yystack.l_mark[-3], yystack.l_mark[-1] - 1 ) );
1455 			}
1456 break;
1457 case 50:
1458 #line 614 "/p/netbsd/cvsroot/src/external/bsd/flex/dist/src/parse.y"
1459 	{
1460 			varlength = true;
1461 
1462 			yyval = mkclos( yystack.l_mark[-1] );
1463 			}
1464 break;
1465 case 51:
1466 #line 621 "/p/netbsd/cvsroot/src/external/bsd/flex/dist/src/parse.y"
1467 	{
1468 			varlength = true;
1469 			yyval = mkposcl( yystack.l_mark[-1] );
1470 			}
1471 break;
1472 case 52:
1473 #line 627 "/p/netbsd/cvsroot/src/external/bsd/flex/dist/src/parse.y"
1474 	{
1475 			varlength = true;
1476 			yyval = mkopt( yystack.l_mark[-1] );
1477 			}
1478 break;
1479 case 53:
1480 #line 633 "/p/netbsd/cvsroot/src/external/bsd/flex/dist/src/parse.y"
1481 	{
1482 			varlength = true;
1483 
1484 			if ( yystack.l_mark[-3] > yystack.l_mark[-1] || yystack.l_mark[-3] < 0 )
1485 				{
1486 				synerr( _("bad iteration values") );
1487 				yyval = yystack.l_mark[-5];
1488 				}
1489 			else
1490 				{
1491 				if ( yystack.l_mark[-3] == 0 )
1492 					{
1493 					if ( yystack.l_mark[-1] <= 0 )
1494 						{
1495 						synerr(
1496 						_("bad iteration values") );
1497 						yyval = yystack.l_mark[-5];
1498 						}
1499 					else
1500 						yyval = mkopt(
1501 							mkrep( yystack.l_mark[-5], 1, yystack.l_mark[-1] ) );
1502 					}
1503 				else
1504 					yyval = mkrep( yystack.l_mark[-5], yystack.l_mark[-3], yystack.l_mark[-1] );
1505 				}
1506 			}
1507 break;
1508 case 54:
1509 #line 661 "/p/netbsd/cvsroot/src/external/bsd/flex/dist/src/parse.y"
1510 	{
1511 			varlength = true;
1512 
1513 			if ( yystack.l_mark[-2] <= 0 )
1514 				{
1515 				synerr( _("iteration value must be positive") );
1516 				yyval = yystack.l_mark[-4];
1517 				}
1518 
1519 			else
1520 				yyval = mkrep( yystack.l_mark[-4], yystack.l_mark[-2], INFINITE_REPEAT );
1521 			}
1522 break;
1523 case 55:
1524 #line 675 "/p/netbsd/cvsroot/src/external/bsd/flex/dist/src/parse.y"
1525 	{
1526 			/* The singleton could be something like "(foo)",
1527 			 * in which case we have no idea what its length
1528 			 * is, so we punt here.
1529 			 */
1530 			varlength = true;
1531 
1532 			if ( yystack.l_mark[-1] <= 0 )
1533 				{
1534 				synerr( _("iteration value must be positive") );
1535 				yyval = yystack.l_mark[-3];
1536 				}
1537 
1538 			else
1539 				yyval = link_machines( yystack.l_mark[-3],
1540 						copysingl( yystack.l_mark[-3], yystack.l_mark[-1] - 1 ) );
1541 			}
1542 break;
1543 case 56:
1544 #line 694 "/p/netbsd/cvsroot/src/external/bsd/flex/dist/src/parse.y"
1545 	{
1546 			if ( ! madeany )
1547 				{
1548 				/* Create the '.' character class. */
1549                     ccldot = cclinit();
1550                     ccladd( ccldot, '\n' );
1551                     cclnegate( ccldot );
1552 
1553                     if ( useecs )
1554                         mkeccl( ccltbl + cclmap[ccldot],
1555                             ccllen[ccldot], nextecm,
1556                             ecgroup, csize, csize );
1557 
1558 				/* Create the (?s:'.') character class. */
1559                     cclany = cclinit();
1560                     cclnegate( cclany );
1561 
1562                     if ( useecs )
1563                         mkeccl( ccltbl + cclmap[cclany],
1564                             ccllen[cclany], nextecm,
1565                             ecgroup, csize, csize );
1566 
1567 				madeany = true;
1568 				}
1569 
1570 			++rulelen;
1571 
1572             if (sf_dot_all())
1573                 yyval = mkstate( -cclany );
1574             else
1575                 yyval = mkstate( -ccldot );
1576 			}
1577 break;
1578 case 57:
1579 #line 728 "/p/netbsd/cvsroot/src/external/bsd/flex/dist/src/parse.y"
1580 	{
1581 				/* Sort characters for fast searching.
1582 				 */
1583 				qsort( ccltbl + cclmap[yystack.l_mark[0]], ccllen[yystack.l_mark[0]], sizeof (*ccltbl), cclcmp );
1584 
1585 			if ( useecs )
1586 				mkeccl( ccltbl + cclmap[yystack.l_mark[0]], ccllen[yystack.l_mark[0]],
1587 					nextecm, ecgroup, csize, csize );
1588 
1589 			++rulelen;
1590 
1591 			if (ccl_has_nl[yystack.l_mark[0]])
1592 				rule_has_nl[num_rules] = true;
1593 
1594 			yyval = mkstate( -yystack.l_mark[0] );
1595 			}
1596 break;
1597 case 58:
1598 #line 746 "/p/netbsd/cvsroot/src/external/bsd/flex/dist/src/parse.y"
1599 	{
1600 			++rulelen;
1601 
1602 			if (ccl_has_nl[yystack.l_mark[0]])
1603 				rule_has_nl[num_rules] = true;
1604 
1605 			yyval = mkstate( -yystack.l_mark[0] );
1606 			}
1607 break;
1608 case 59:
1609 #line 756 "/p/netbsd/cvsroot/src/external/bsd/flex/dist/src/parse.y"
1610 	{ yyval = yystack.l_mark[-1]; }
1611 break;
1612 case 60:
1613 #line 759 "/p/netbsd/cvsroot/src/external/bsd/flex/dist/src/parse.y"
1614 	{ yyval = yystack.l_mark[-1]; }
1615 break;
1616 case 61:
1617 #line 762 "/p/netbsd/cvsroot/src/external/bsd/flex/dist/src/parse.y"
1618 	{
1619 			++rulelen;
1620 
1621 			if (yystack.l_mark[0] == nlch)
1622 				rule_has_nl[num_rules] = true;
1623 
1624             if (sf_case_ins() && has_case(yystack.l_mark[0]))
1625                 /* create an alternation, as in (a|A) */
1626                 yyval = mkor (mkstate(yystack.l_mark[0]), mkstate(reverse_case(yystack.l_mark[0])));
1627             else
1628                 yyval = mkstate( yystack.l_mark[0] );
1629 			}
1630 break;
1631 case 62:
1632 #line 776 "/p/netbsd/cvsroot/src/external/bsd/flex/dist/src/parse.y"
1633 	{ yyval = ccl_set_diff  (yystack.l_mark[-2], yystack.l_mark[0]); }
1634 break;
1635 case 63:
1636 #line 777 "/p/netbsd/cvsroot/src/external/bsd/flex/dist/src/parse.y"
1637 	{ yyval = ccl_set_union (yystack.l_mark[-2], yystack.l_mark[0]); }
1638 break;
1639 case 65:
1640 #line 783 "/p/netbsd/cvsroot/src/external/bsd/flex/dist/src/parse.y"
1641 	{ yyval = yystack.l_mark[-1]; }
1642 break;
1643 case 66:
1644 #line 786 "/p/netbsd/cvsroot/src/external/bsd/flex/dist/src/parse.y"
1645 	{
1646 			cclnegate( yystack.l_mark[-1] );
1647 			yyval = yystack.l_mark[-1];
1648 			}
1649 break;
1650 case 67:
1651 #line 793 "/p/netbsd/cvsroot/src/external/bsd/flex/dist/src/parse.y"
1652 	{
1653 
1654 			if (sf_case_ins())
1655 			  {
1656 
1657 			    /* If one end of the range has case and the other
1658 			     * does not, or the cases are different, then we're not
1659 			     * sure what range the user is trying to express.
1660 			     * Examples: [@-z] or [S-t]
1661 			     */
1662 			    if (has_case (yystack.l_mark[-2]) != has_case (yystack.l_mark[0])
1663 				     || (has_case (yystack.l_mark[-2]) && (b_islower (yystack.l_mark[-2]) != b_islower (yystack.l_mark[0])))
1664 				     || (has_case (yystack.l_mark[-2]) && (b_isupper (yystack.l_mark[-2]) != b_isupper (yystack.l_mark[0]))))
1665 			      format_warn3 (
1666 			      _("the character range [%c-%c] is ambiguous in a case-insensitive scanner"),
1667 					    yystack.l_mark[-2], yystack.l_mark[0]);
1668 
1669 			    /* If the range spans uppercase characters but not
1670 			     * lowercase (or vice-versa), then should we automatically
1671 			     * include lowercase characters in the range?
1672 			     * Example: [@-_] spans [a-z] but not [A-Z]
1673 			     */
1674 			    else if (!has_case (yystack.l_mark[-2]) && !has_case (yystack.l_mark[0]) && !range_covers_case (yystack.l_mark[-2], yystack.l_mark[0]))
1675 			      format_warn3 (
1676 			      _("the character range [%c-%c] is ambiguous in a case-insensitive scanner"),
1677 					    yystack.l_mark[-2], yystack.l_mark[0]);
1678 			  }
1679 
1680 			if ( yystack.l_mark[-2] > yystack.l_mark[0] )
1681 				synerr( _("negative range in character class") );
1682 
1683 			else
1684 				{
1685 				for ( i = yystack.l_mark[-2]; i <= yystack.l_mark[0]; ++i )
1686 					ccladd( yystack.l_mark[-3], i );
1687 
1688 				/* Keep track if this ccl is staying in
1689 				 * alphabetical order.
1690 				 */
1691 				cclsorted = cclsorted && (yystack.l_mark[-2] > lastchar);
1692 				lastchar = yystack.l_mark[0];
1693 
1694                 /* Do it again for upper/lowercase */
1695                 if (sf_case_ins() && has_case(yystack.l_mark[-2]) && has_case(yystack.l_mark[0])){
1696                     yystack.l_mark[-2] = reverse_case (yystack.l_mark[-2]);
1697                     yystack.l_mark[0] = reverse_case (yystack.l_mark[0]);
1698 
1699                     for ( i = yystack.l_mark[-2]; i <= yystack.l_mark[0]; ++i )
1700                         ccladd( yystack.l_mark[-3], i );
1701 
1702                     cclsorted = cclsorted && (yystack.l_mark[-2] > lastchar);
1703                     lastchar = yystack.l_mark[0];
1704                 }
1705 
1706 				}
1707 
1708 			yyval = yystack.l_mark[-3];
1709 			}
1710 break;
1711 case 68:
1712 #line 853 "/p/netbsd/cvsroot/src/external/bsd/flex/dist/src/parse.y"
1713 	{
1714 			ccladd( yystack.l_mark[-1], yystack.l_mark[0] );
1715 			cclsorted = cclsorted && (yystack.l_mark[0] > lastchar);
1716 			lastchar = yystack.l_mark[0];
1717 
1718             /* Do it again for upper/lowercase */
1719             if (sf_case_ins() && has_case(yystack.l_mark[0])){
1720                 yystack.l_mark[0] = reverse_case (yystack.l_mark[0]);
1721                 ccladd (yystack.l_mark[-1], yystack.l_mark[0]);
1722 
1723                 cclsorted = cclsorted && (yystack.l_mark[0] > lastchar);
1724                 lastchar = yystack.l_mark[0];
1725             }
1726 
1727 			yyval = yystack.l_mark[-1];
1728 			}
1729 break;
1730 case 69:
1731 #line 871 "/p/netbsd/cvsroot/src/external/bsd/flex/dist/src/parse.y"
1732 	{
1733 			/* Too hard to properly maintain cclsorted. */
1734 			cclsorted = false;
1735 			yyval = yystack.l_mark[-1];
1736 			}
1737 break;
1738 case 70:
1739 #line 878 "/p/netbsd/cvsroot/src/external/bsd/flex/dist/src/parse.y"
1740 	{
1741 			cclsorted = true;
1742 			lastchar = 0;
1743 			currccl = yyval = cclinit();
1744 			}
1745 break;
1746 case 71:
1747 #line 886 "/p/netbsd/cvsroot/src/external/bsd/flex/dist/src/parse.y"
1748 	{ CCL_EXPR(isalnum); }
1749 break;
1750 case 72:
1751 #line 887 "/p/netbsd/cvsroot/src/external/bsd/flex/dist/src/parse.y"
1752 	{ CCL_EXPR(isalpha); }
1753 break;
1754 case 73:
1755 #line 888 "/p/netbsd/cvsroot/src/external/bsd/flex/dist/src/parse.y"
1756 	{ CCL_EXPR(IS_BLANK); }
1757 break;
1758 case 74:
1759 #line 889 "/p/netbsd/cvsroot/src/external/bsd/flex/dist/src/parse.y"
1760 	{ CCL_EXPR(iscntrl); }
1761 break;
1762 case 75:
1763 #line 890 "/p/netbsd/cvsroot/src/external/bsd/flex/dist/src/parse.y"
1764 	{ CCL_EXPR(isdigit); }
1765 break;
1766 case 76:
1767 #line 891 "/p/netbsd/cvsroot/src/external/bsd/flex/dist/src/parse.y"
1768 	{ CCL_EXPR(isgraph); }
1769 break;
1770 case 77:
1771 #line 892 "/p/netbsd/cvsroot/src/external/bsd/flex/dist/src/parse.y"
1772 	{
1773                           CCL_EXPR(islower);
1774                           if (sf_case_ins())
1775                               CCL_EXPR(isupper);
1776                         }
1777 break;
1778 case 78:
1779 #line 897 "/p/netbsd/cvsroot/src/external/bsd/flex/dist/src/parse.y"
1780 	{ CCL_EXPR(isprint); }
1781 break;
1782 case 79:
1783 #line 898 "/p/netbsd/cvsroot/src/external/bsd/flex/dist/src/parse.y"
1784 	{ CCL_EXPR(ispunct); }
1785 break;
1786 case 80:
1787 #line 899 "/p/netbsd/cvsroot/src/external/bsd/flex/dist/src/parse.y"
1788 	{ CCL_EXPR(isspace); }
1789 break;
1790 case 81:
1791 #line 900 "/p/netbsd/cvsroot/src/external/bsd/flex/dist/src/parse.y"
1792 	{ CCL_EXPR(isxdigit); }
1793 break;
1794 case 82:
1795 #line 901 "/p/netbsd/cvsroot/src/external/bsd/flex/dist/src/parse.y"
1796 	{
1797                     CCL_EXPR(isupper);
1798                     if (sf_case_ins())
1799                         CCL_EXPR(islower);
1800 				}
1801 break;
1802 case 83:
1803 #line 907 "/p/netbsd/cvsroot/src/external/bsd/flex/dist/src/parse.y"
1804 	{ CCL_NEG_EXPR(isalnum); }
1805 break;
1806 case 84:
1807 #line 908 "/p/netbsd/cvsroot/src/external/bsd/flex/dist/src/parse.y"
1808 	{ CCL_NEG_EXPR(isalpha); }
1809 break;
1810 case 85:
1811 #line 909 "/p/netbsd/cvsroot/src/external/bsd/flex/dist/src/parse.y"
1812 	{ CCL_NEG_EXPR(IS_BLANK); }
1813 break;
1814 case 86:
1815 #line 910 "/p/netbsd/cvsroot/src/external/bsd/flex/dist/src/parse.y"
1816 	{ CCL_NEG_EXPR(iscntrl); }
1817 break;
1818 case 87:
1819 #line 911 "/p/netbsd/cvsroot/src/external/bsd/flex/dist/src/parse.y"
1820 	{ CCL_NEG_EXPR(isdigit); }
1821 break;
1822 case 88:
1823 #line 912 "/p/netbsd/cvsroot/src/external/bsd/flex/dist/src/parse.y"
1824 	{ CCL_NEG_EXPR(isgraph); }
1825 break;
1826 case 89:
1827 #line 913 "/p/netbsd/cvsroot/src/external/bsd/flex/dist/src/parse.y"
1828 	{ CCL_NEG_EXPR(isprint); }
1829 break;
1830 case 90:
1831 #line 914 "/p/netbsd/cvsroot/src/external/bsd/flex/dist/src/parse.y"
1832 	{ CCL_NEG_EXPR(ispunct); }
1833 break;
1834 case 91:
1835 #line 915 "/p/netbsd/cvsroot/src/external/bsd/flex/dist/src/parse.y"
1836 	{ CCL_NEG_EXPR(isspace); }
1837 break;
1838 case 92:
1839 #line 916 "/p/netbsd/cvsroot/src/external/bsd/flex/dist/src/parse.y"
1840 	{ CCL_NEG_EXPR(isxdigit); }
1841 break;
1842 case 93:
1843 #line 917 "/p/netbsd/cvsroot/src/external/bsd/flex/dist/src/parse.y"
1844 	{
1845 				if ( sf_case_ins() )
1846 					lwarn(_("[:^lower:] is ambiguous in case insensitive scanner"));
1847 				else
1848 					CCL_NEG_EXPR(islower);
1849 				}
1850 break;
1851 case 94:
1852 #line 923 "/p/netbsd/cvsroot/src/external/bsd/flex/dist/src/parse.y"
1853 	{
1854 				if ( sf_case_ins() )
1855 					lwarn(_("[:^upper:] ambiguous in case insensitive scanner"));
1856 				else
1857 					CCL_NEG_EXPR(isupper);
1858 				}
1859 break;
1860 case 95:
1861 #line 932 "/p/netbsd/cvsroot/src/external/bsd/flex/dist/src/parse.y"
1862 	{
1863 			if ( yystack.l_mark[0] == nlch )
1864 				rule_has_nl[num_rules] = true;
1865 
1866 			++rulelen;
1867 
1868             if (sf_case_ins() && has_case(yystack.l_mark[0]))
1869                 yyval = mkor (mkstate(yystack.l_mark[0]), mkstate(reverse_case(yystack.l_mark[0])));
1870             else
1871                 yyval = mkstate (yystack.l_mark[0]);
1872 
1873 			yyval = link_machines( yystack.l_mark[-1], yyval);
1874 			}
1875 break;
1876 case 96:
1877 #line 947 "/p/netbsd/cvsroot/src/external/bsd/flex/dist/src/parse.y"
1878 	{ yyval = mkstate( SYM_EPSILON ); }
1879 break;
1880 #line 1881 "parse.c"
1881     }
1882     yystack.s_mark -= yym;
1883     yystate = *yystack.s_mark;
1884     yystack.l_mark -= yym;
1885     yym = yylhs[yyn];
1886     if (yystate == 0 && yym == 0)
1887     {
1888 #if YYDEBUG
1889         if (yydebug)
1890             printf("%sdebug: after reduction, shifting from state 0 to\
1891  state %d\n", YYPREFIX, YYFINAL);
1892 #endif
1893         yystate = YYFINAL;
1894         *++yystack.s_mark = YYFINAL;
1895         *++yystack.l_mark = yyval;
1896         if (yychar < 0)
1897         {
1898             if ((yychar = YYLEX) < 0) yychar = YYEOF;
1899 #if YYDEBUG
1900             if (yydebug)
1901             {
1902                 yys = yyname[YYTRANSLATE(yychar)];
1903                 printf("%sdebug: state %d, reading %d (%s)\n",
1904                         YYPREFIX, YYFINAL, yychar, yys);
1905             }
1906 #endif
1907         }
1908         if (yychar == YYEOF) goto yyaccept;
1909         goto yyloop;
1910     }
1911     if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 &&
1912             yyn <= YYTABLESIZE && yycheck[yyn] == yystate)
1913         yystate = yytable[yyn];
1914     else
1915         yystate = yydgoto[yym];
1916 #if YYDEBUG
1917     if (yydebug)
1918         printf("%sdebug: after reduction, shifting from state %d \
1919 to state %d\n", YYPREFIX, *yystack.s_mark, yystate);
1920 #endif
1921     if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM)
1922     {
1923         goto yyoverflow;
1924     }
1925     *++yystack.s_mark = (YYINT) yystate;
1926     *++yystack.l_mark = yyval;
1927     goto yyloop;
1928 
1929 yyoverflow:
1930     YYERROR_CALL("yacc stack overflow");
1931 
1932 yyabort:
1933     yyfreestack(&yystack);
1934     return (1);
1935 
1936 yyaccept:
1937     yyfreestack(&yystack);
1938     return (0);
1939 }
1940