1 /* A lexical scanner generated by flex */
2 
3 
4 #define FLEX_SCANNER
5 
6 #ifdef _WIN32
7 #include <io.h>
8 #else
9 #include <unistd.h>
10 #endif
11 #include <stdlib.h>
12 #include <stdio.h>
13 
14 
15 /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
16 #ifdef c_plusplus
17 #ifndef __cplusplus
18 #define __cplusplus
19 #endif
20 #endif
21 
22 
23 #ifdef __cplusplus
24 
25 #include <stdlib.h>
26 
27 /* Use prototypes in function declarations. */
28 #define YY_USE_PROTOS
29 
30 /* The "const" storage-class-modifier is valid. */
31 #define YY_USE_CONST
32 
33 #else	/* ! __cplusplus */
34 
35 #ifdef __STDC__
36 
37 #define YY_USE_PROTOS
38 #define YY_USE_CONST
39 
40 #endif	/* __STDC__ */
41 #endif	/* ! __cplusplus */
42 
43 
44 #ifdef __TURBOC__
45 #define YY_USE_CONST
46 #endif
47 
48 
49 #ifndef YY_USE_CONST
50 #ifndef const
51 #define const
52 #endif
53 #endif
54 
55 
56 #ifdef YY_USE_PROTOS
57 #define YY_PROTO(proto) proto
58 #else
59 #define YY_PROTO(proto) ()
60 #endif
61 
62 /* Returned upon end-of-file. */
63 #define YY_NULL 0
64 
65 /* Promotes a possibly negative, possibly signed char to an unsigned
66  * integer for use as an array index.  If the signed char is negative,
67  * we want to instead treat it as an 8-bit unsigned char, hence the
68  * double cast.
69  */
70 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
71 
72 /* Enter a start condition.  This macro really ought to take a parameter,
73  * but we do it the disgusting crufty way forced on us by the ()-less
74  * definition of BEGIN.
75  */
76 #define BEGIN yy_start = 1 + 2 *
77 
78 /* Translate the current start state into a value that can be later handed
79  * to BEGIN to return to the state.
80  */
81 #define YY_START ((yy_start - 1) / 2)
82 
83 /* Action number for EOF rule of a given start state. */
84 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
85 
86 /* Special action meaning "start processing a new file".  Now included
87  * only for backward compatibility with previous versions of flex.
88  */
89 #define YY_NEW_FILE yyrestart( yyin )
90 
91 #define YY_END_OF_BUFFER_CHAR 0
92 
93 /* Size of default input buffer. */
94 #define YY_BUF_SIZE 16384
95 
96 typedef struct yy_buffer_state *YY_BUFFER_STATE;
97 
98 extern int yyleng;
99 extern FILE *yyin, *yyout;
100 
101 #ifdef __cplusplus
102 extern "C" {
103 #endif
104 	extern int yywrap YY_PROTO(( void ));
105 #ifdef __cplusplus
106 	}
107 #endif
108 
109 #define EOB_ACT_CONTINUE_SCAN 0
110 #define EOB_ACT_END_OF_FILE 1
111 #define EOB_ACT_LAST_MATCH 2
112 
113 /* The funky do-while in the following #define is used to turn the definition
114  * int a single C statement (which needs a semi-colon terminator).  This
115  * avoids problems with code like:
116  *
117  * 	if ( condition_holds )
118  *		yyless( 5 );
119  *	else
120  *		do_something_else();
121  *
122  * Prior to using the do-while the compiler would get upset at the
123  * "else" because it interpreted the "if" statement as being all
124  * done when it reached the ';' after the yyless() call.
125  */
126 
127 /* Return all but the first 'n' matched characters back to the input stream. */
128 
129 #define yyless(n) \
130 	do \
131 		{ \
132 		/* Undo effects of setting up yytext. */ \
133 		*yy_cp = yy_hold_char; \
134 		yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
135 		YY_DO_BEFORE_ACTION; /* set up yytext again */ \
136 		} \
137 	while ( 0 )
138 
139 #define unput(c) yyunput( c, yytext_ptr )
140 
141 
142 struct yy_buffer_state
143 	{
144 	FILE *yy_input_file;
145 
146 	char *yy_ch_buf;		/* input buffer */
147 	char *yy_buf_pos;		/* current position in input buffer */
148 
149 	/* Size of input buffer in bytes, not including room for EOB
150 	 * characters.
151 	 */
152 	int yy_buf_size;
153 
154 	/* Number of characters read into yy_ch_buf, not including EOB
155 	 * characters.
156 	 */
157 	int yy_n_chars;
158 
159 	/* Whether this is an "interactive" input source; if so, and
160 	 * if we're using stdio for input, then we want to use getc()
161 	 * instead of fread(), to make sure we stop fetching input after
162 	 * each newline.
163 	 */
164 	int yy_is_interactive;
165 
166 	/* Whether to try to fill the input buffer when we reach the
167 	 * end of it.
168 	 */
169 	int yy_fill_buffer;
170 
171 	int yy_buffer_status;
172 #define YY_BUFFER_NEW 0
173 #define YY_BUFFER_NORMAL 1
174 	/* When an EOF's been seen but there's still some text to process
175 	 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
176 	 * shouldn't try reading from the input source any more.  We might
177 	 * still have a bunch of tokens to match, though, because of
178 	 * possible backing-up.
179 	 *
180 	 * When we actually see the EOF, we change the status to "new"
181 	 * (via yyrestart()), so that the user can continue scanning by
182 	 * just pointing yyin at a new input file.
183 	 */
184 #define YY_BUFFER_EOF_PENDING 2
185 	};
186 
187 static YY_BUFFER_STATE yy_current_buffer = 0;
188 
189 /* We provide macros for accessing buffer states in case in the
190  * future we want to put the buffer states in a more general
191  * "scanner state".
192  */
193 #define YY_CURRENT_BUFFER yy_current_buffer
194 
195 
196 /* yy_hold_char holds the character lost when yytext is formed. */
197 static char yy_hold_char;
198 
199 static int yy_n_chars;		/* number of characters read into yy_ch_buf */
200 
201 
202 int yyleng;
203 
204 /* Points to current character in buffer. */
205 static char *yy_c_buf_p = (char *) 0;
206 static int yy_init = 1;		/* whether we need to initialize */
207 static int yy_start = 0;	/* start state number */
208 
209 /* Flag which is used to allow yywrap()'s to do buffer switches
210  * instead of setting up a fresh yyin.  A bit of a hack ...
211  */
212 static int yy_did_buffer_switch_on_eof;
213 
214 static void yyunput YY_PROTO(( int c, char *buf_ptr ));
215 void yyrestart YY_PROTO(( FILE *input_file ));
216 void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
217 void yy_load_buffer_state YY_PROTO(( void ));
218 YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
219 void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
220 void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
221 
222 static int yy_start_stack_ptr = 0;
223 static int yy_start_stack_depth = 0;
224 static int *yy_start_stack = 0;
225 static void yy_push_state YY_PROTO(( int new_state ));
226 static void yy_pop_state YY_PROTO(( void ));
227 static int yy_top_state YY_PROTO(( void ));
228 
229 static void *yy_flex_alloc YY_PROTO(( unsigned int ));
230 static void *yy_flex_realloc YY_PROTO(( void *, unsigned int ));
231 static void yy_flex_free YY_PROTO(( void * ));
232 
233 #define yy_new_buffer yy_create_buffer
234 
235 #define INITIAL 0
236 typedef unsigned char YY_CHAR;
237 typedef int yy_state_type;
238 FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
239 extern char *yytext;
240 #define yytext_ptr yytext
241 
242 #ifndef yytext_ptr
243 static void yy_flex_strncpy YY_PROTO(( char *, const char *, int ));
244 #endif
245 
246 #ifdef __cplusplus
247 static int yyinput YY_PROTO(( void ));
248 #else
249 static int input YY_PROTO(( void ));
250 #endif
251 
252 static yy_state_type yy_get_previous_state YY_PROTO(( void ));
253 static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
254 static int yy_get_next_buffer YY_PROTO(( void ));
255 static void yy_fatal_error YY_PROTO(( const char msg[] ));
256 
257 /* Done after the current pattern has been matched and before the
258  * corresponding action - sets up yytext.
259  */
260 #define YY_DO_BEFORE_ACTION \
261 	yytext_ptr = yy_bp; \
262 	yyleng = yy_cp - yy_bp; \
263 	yy_hold_char = *yy_cp; \
264 	*yy_cp = '\0'; \
265 	yy_c_buf_p = yy_cp;
266 
267 #define YY_END_OF_BUFFER 34
268 static const short int yy_accept[94] =
269     {   0,
270         0,    0,   34,   32,    1,   31,   31,   32,    2,    5,
271         6,    7,   32,    4,    8,   10,    9,   30,   30,   30,
272        30,   30,   30,   30,   30,   30,   30,   30,   30,    1,
273         0,    3,    2,    4,   12,   11,   13,   30,   30,   30,
274        30,   30,   30,   30,   30,   30,   30,   30,   30,   26,
275        30,   30,   30,   25,   30,   30,   30,   30,   30,   30,
276        30,   30,   30,   27,   30,   30,   30,   30,   30,   30,
277        30,   30,   17,   22,   24,   23,   30,   15,   29,   30,
278        30,   16,   30,   21,   30,   30,   30,   28,   14,   19,
279        18,   20,    0
280 
281     } ;
282 
283 static const int yy_ec[256] =
284     {   0,
285         1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
286         1,    1,    4,    1,    1,    1,    1,    1,    1,    1,
287         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
288         1,    2,    1,    5,    6,    1,    1,    1,    1,    7,
289         8,    1,    1,    9,   10,    1,    1,   11,   11,   11,
290        11,   11,   11,   11,   11,   11,   11,    1,    1,   12,
291        13,   14,    1,    1,   15,   15,   15,   15,   15,   15,
292        15,   15,   15,   15,   15,   15,   15,   15,   15,   15,
293        15,   15,   15,   15,   15,   15,   15,   15,   15,   15,
294         1,    1,    1,    1,    1,    1,   16,   17,   18,   19,
295 
296        20,   21,   22,   23,   24,   15,   15,   25,   26,   27,
297        28,   29,   30,   31,   32,   33,   34,   15,   35,   15,
298        15,   15,    1,    1,    1,    1,    1,    1,    1,    1,
299         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
300         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
301         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
302         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
303         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
304         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
305         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
306 
307         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
308         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
309         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
310         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
311         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
312         1,    1,    1,    1,    1
313     } ;
314 
315 static const int yy_meta[36] =
316     {   0,
317         1,    1,    2,    1,    1,    1,    1,    1,    1,    1,
318         3,    1,    1,    1,    3,    3,    3,    3,    3,    3,
319         3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
320         3,    3,    3,    3,    3
321     } ;
322 
323 static const short int yy_base[97] =
324     {   0,
325         0,    0,  108,  109,  105,  109,  109,   33,    0,  109,
326       109,  109,   95,   94,   26,  109,   91,    0,   76,   12,
327        21,   71,   81,   73,   71,   13,   64,   77,   73,   93,
328        42,  109,    0,   83,  109,  109,  109,    0,   74,   64,
329        71,   29,   62,   63,   60,   62,   54,   52,   64,    0,
330        59,   57,   61,    0,   48,   63,   44,   57,   47,   46,
331        48,   44,   52,    0,   44,   37,   49,   37,   47,   33,
332        43,   31,    0,    0,    0,    0,   32,    0,    0,   44,
333        40,    0,   33,    0,   31,   17,   16,    0,    0,    0,
334         0,    0,  109,   55,   58,   45
335 
336     } ;
337 
338 static const short int yy_def[97] =
339     {   0,
340        93,    1,   93,   93,   93,   93,   93,   94,   95,   93,
341        93,   93,   93,   93,   93,   93,   93,   96,   96,   96,
342        96,   96,   96,   96,   96,   96,   96,   96,   96,   93,
343        94,   93,   95,   93,   93,   93,   93,   96,   96,   96,
344        96,   96,   96,   96,   96,   96,   96,   96,   96,   96,
345        96,   96,   96,   96,   96,   96,   96,   96,   96,   96,
346        96,   96,   96,   96,   96,   96,   96,   96,   96,   96,
347        96,   96,   96,   96,   96,   96,   96,   96,   96,   96,
348        96,   96,   96,   96,   96,   96,   96,   96,   96,   96,
349        96,   96,    0,   93,   93,   93
350 
351     } ;
352 
353 static const short int yy_nxt[145] =
354     {   0,
355         4,    5,    6,    7,    8,    9,   10,   11,   12,   13,
356        14,   15,   16,   17,   18,   19,   18,   20,   21,   18,
357        22,   18,   23,   24,   18,   18,   25,   26,   18,   27,
358        18,   28,   18,   18,   29,   32,   40,   32,   35,   36,
359        42,   49,   41,   50,   32,   57,   32,   38,   92,   91,
360        90,   43,   89,   58,   44,   31,   31,   31,   33,   88,
361        33,   87,   86,   85,   84,   83,   82,   81,   80,   79,
362        78,   77,   76,   75,   74,   73,   72,   71,   70,   69,
363        68,   67,   66,   65,   64,   63,   62,   61,   60,   59,
364        56,   55,   54,   34,   30,   53,   52,   51,   48,   47,
365 
366        46,   45,   39,   37,   34,   34,   30,   93,    3,   93,
367        93,   93,   93,   93,   93,   93,   93,   93,   93,   93,
368        93,   93,   93,   93,   93,   93,   93,   93,   93,   93,
369        93,   93,   93,   93,   93,   93,   93,   93,   93,   93,
370        93,   93,   93,   93
371     } ;
372 
373 static const short int yy_chk[145] =
374     {   0,
375         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
376         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
377         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
378         1,    1,    1,    1,    1,    8,   20,    8,   15,   15,
379        21,   26,   20,   26,   31,   42,   31,   96,   87,   86,
380        85,   21,   83,   42,   21,   94,   94,   94,   95,   81,
381        95,   80,   77,   72,   71,   70,   69,   68,   67,   66,
382        65,   63,   62,   61,   60,   59,   58,   57,   56,   55,
383        53,   52,   51,   49,   48,   47,   46,   45,   44,   43,
384        41,   40,   39,   34,   30,   29,   28,   27,   25,   24,
385 
386        23,   22,   19,   17,   14,   13,    5,    3,   93,   93,
387        93,   93,   93,   93,   93,   93,   93,   93,   93,   93,
388        93,   93,   93,   93,   93,   93,   93,   93,   93,   93,
389        93,   93,   93,   93,   93,   93,   93,   93,   93,   93,
390        93,   93,   93,   93
391     } ;
392 
393 static yy_state_type yy_last_accepting_state;
394 static char *yy_last_accepting_cpos;
395 
396 /* The intent behind this definition is that it'll catch
397  * any uses of REJECT which flex missed.
398  */
399 #define REJECT reject_used_but_not_detected
400 #define yymore() yymore_used_but_not_detected
401 #define YY_MORE_ADJ 0
402 char *yytext;
403 # line 1 "scan.l"
404 # line 2 "scan.l"
405 #include <iostream.h>
406 #include "BT.h"
407 #include "gram.tab.h"
408 
409 /* Macros after this point can all be overridden by user definitions in
410  * section 1.
411  */
412 
413 #ifdef YY_MALLOC_DECL
414 YY_MALLOC_DECL
415 #else
416 #if __STDC__
417 #ifndef __cplusplus
418 #include <stdlib.h>
419 #endif
420 #else
421 /* Just try to get by without declaring the routines.  This will fail
422  * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
423  * or sizeof(void*) != sizeof(int).
424  */
425 #endif
426 #endif
427 
428 /* Amount of stuff to slurp up with each read. */
429 #ifndef YY_READ_BUF_SIZE
430 #define YY_READ_BUF_SIZE 8192
431 #endif
432 
433 /* Copy whatever the last rule matched to the standard output. */
434 
435 #ifndef ECHO
436 /* This used to be an fputs(), but since the string might contain NUL's,
437  * we now use fwrite().
438  */
439 #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
440 #endif
441 
442 /* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
443  * is returned in "result".
444  */
445 #ifndef YY_INPUT
446 #define YY_INPUT(buf,result,max_size) \
447 	if ( yy_current_buffer->yy_is_interactive ) \
448 		{ \
449 		int c = getc( yyin ); \
450 		result = c == EOF ? 0 : 1; \
451 		buf[0] = (char) c; \
452 		} \
453 	else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
454 		  && ferror( yyin ) ) \
455 		YY_FATAL_ERROR( "input in flex scanner failed" );
456 #endif
457 
458 /* No semi-colon after return; correct usage is to write "yyterminate();" -
459  * we don't want an extra ';' after the "return" because that will cause
460  * some compilers to complain about unreachable statements.
461  */
462 #ifndef yyterminate
463 #define yyterminate() return YY_NULL
464 #endif
465 
466 /* Number of entries by which start-condition stack grows. */
467 #ifndef YY_START_STACK_INCR
468 #define YY_START_STACK_INCR 25
469 #endif
470 
471 /* Report a fatal error. */
472 #ifndef YY_FATAL_ERROR
473 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
474 #endif
475 
476 /* Default declaration of generated scanner - a define so the user can
477  * easily add parameters.
478  */
479 #ifndef YY_DECL
480 #define YY_DECL int yylex YY_PROTO(( void ))
481 #endif
482 
483 /* Code executed at the beginning of each rule, after yytext and yyleng
484  * have been set up.
485  */
486 #ifndef YY_USER_ACTION
487 #define YY_USER_ACTION
488 #endif
489 
490 /* Code executed at the end of each rule. */
491 #ifndef YY_BREAK
492 #define YY_BREAK break;
493 #endif
494 
495 YY_DECL
496 	{
497 	register yy_state_type yy_current_state;
498 	register char *yy_cp, *yy_bp;
499 	register int yy_act;
500 
501 # line 14 "scan.l"
502 
503 
504 
505 	if ( yy_init )
506 		{
507 #ifdef YY_USER_INIT
508 		YY_USER_INIT;
509 #endif
510 
511 		if ( ! yy_start )
512 			yy_start = 1;	/* first start state */
513 
514 		if ( ! yyin )
515 			yyin = stdin;
516 
517 		if ( ! yyout )
518 			yyout = stdout;
519 
520 		if ( yy_current_buffer )
521 			yy_init_buffer( yy_current_buffer, yyin );
522 		else
523 			yy_current_buffer =
524 				yy_create_buffer( yyin, YY_BUF_SIZE );
525 
526 		yy_load_buffer_state();
527 
528 		yy_init = 0;
529 		}
530 
531 	while ( 1 )		/* loops until end-of-file is reached */
532 		{
533 		yy_cp = yy_c_buf_p;
534 
535 		/* Support of yytext. */
536 		*yy_cp = yy_hold_char;
537 
538 		/* yy_bp points to the position in yy_ch_buf of the start of
539 		 * the current run.
540 		 */
541 		yy_bp = yy_cp;
542 
543 		yy_current_state = yy_start;
544 yy_match:
545 		do
546 			{
547 			register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
548 			if ( yy_accept[yy_current_state] )
549 				{
550 				yy_last_accepting_state = yy_current_state;
551 				yy_last_accepting_cpos = yy_cp;
552 				}
553 			while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
554 				{
555 				yy_current_state = (int) yy_def[yy_current_state];
556 				if ( yy_current_state >= 94 )
557 					yy_c = yy_meta[(unsigned int) yy_c];
558 				}
559 			yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
560 			++yy_cp;
561 			}
562 		while ( yy_base[yy_current_state] != 109 );
563 
564 yy_find_action:
565 		yy_act = yy_accept[yy_current_state];
566 
567 		YY_DO_BEFORE_ACTION;
568 
569 
570 do_action:	/* This label is used only to access EOF actions. */
571 
572 
573 		switch ( yy_act )
574 	{ /* beginning of action switch */
575 			case 0: /* must back up */
576 			/* undo the effects of YY_DO_BEFORE_ACTION */
577 			*yy_cp = yy_hold_char;
578 			yy_cp = yy_last_accepting_cpos;
579 			yy_current_state = yy_last_accepting_state;
580 			goto yy_find_action;
581 
582 case 1:
583 YY_USER_ACTION
584 # line 16 "scan.l"
585 ;
586 	YY_BREAK
587 case 2:
588 YY_USER_ACTION
589 # line 17 "scan.l"
590 ;
591 	YY_BREAK
592 case 3:
593 YY_USER_ACTION
594 # line 18 "scan.l"
595 { yylval.key = new BTkey((char *)(yytext+1), strlen(yytext+1));
596             if(yylval.key->key[yyleng-2] != '"') {
597 		cerr << "Scanner - Unterminated character string.\n";
598 		return ERROR;
599 	    } else {
600 yylval.key->len--;
601 		    return STRCONST;
602 	    }
603 	  }
604 	YY_BREAK
605 case 4:
606 YY_USER_ACTION
607 # line 27 "scan.l"
608 { yylval.number = atoi((const char *)yytext);
609 	    return INTCONST;
610 	  }
611 	YY_BREAK
612 case 5:
613 # line 31 "scan.l"
614 case 6:
615 # line 32 "scan.l"
616 case 7:
617 # line 33 "scan.l"
618 case 8:
619 # line 34 "scan.l"
620 case 9:
621 # line 35 "scan.l"
622 case 10:
623 YY_USER_ACTION
624 # line 35 "scan.l"
625 { return yytext[0]; }
626 	YY_BREAK
627 case 11:
628 YY_USER_ACTION
629 # line 36 "scan.l"
630 { return opNE; }
631 	YY_BREAK
632 case 12:
633 YY_USER_ACTION
634 # line 37 "scan.l"
635 { return opLE; }
636 	YY_BREAK
637 case 13:
638 YY_USER_ACTION
639 # line 38 "scan.l"
640 { return opGE; }
641 	YY_BREAK
642 case 14:
643 YY_USER_ACTION
644 # line 40 "scan.l"
645 { return CREATE; }
646 	YY_BREAK
647 case 15:
648 YY_USER_ACTION
649 # line 41 "scan.l"
650 { return OPEN; }
651 	YY_BREAK
652 case 16:
653 YY_USER_ACTION
654 # line 42 "scan.l"
655 { return CLOSE; }
656 	YY_BREAK
657 case 17:
658 YY_USER_ACTION
659 # line 43 "scan.l"
660 { return DROP; }
661 	YY_BREAK
662 case 18:
663 YY_USER_ACTION
664 # line 44 "scan.l"
665 { return INSERT; }
666 	YY_BREAK
667 case 19:
668 YY_USER_ACTION
669 # line 45 "scan.l"
670 { return DELETE; }
671 	YY_BREAK
672 case 20:
673 YY_USER_ACTION
674 # line 46 "scan.l"
675 { return SELECT; }
676 	YY_BREAK
677 case 21:
678 YY_USER_ACTION
679 # line 47 "scan.l"
680 { return DEBUG; }
681 	YY_BREAK
682 case 22:
683 YY_USER_ACTION
684 # line 48 "scan.l"
685 { return DUMP; }
686 	YY_BREAK
687 case 23:
688 YY_USER_ACTION
689 # line 49 "scan.l"
690 { return HELP; }
691 	YY_BREAK
692 case 24:
693 YY_USER_ACTION
694 # line 50 "scan.l"
695 { return FROM; }
696 	YY_BREAK
697 case 25:
698 YY_USER_ACTION
699 # line 51 "scan.l"
700 { return AND; }
701 	YY_BREAK
702 case 26:
703 YY_USER_ACTION
704 # line 52 "scan.l"
705 { return OR; }
706 	YY_BREAK
707 case 27:
708 YY_USER_ACTION
709 # line 53 "scan.l"
710 { return NOT; }
711 	YY_BREAK
712 case 28:
713 YY_USER_ACTION
714 # line 54 "scan.l"
715 { return WHERE; }
716 	YY_BREAK
717 case 29:
718 YY_USER_ACTION
719 # line 55 "scan.l"
720 { return QUIT; }
721 	YY_BREAK
722 case 30:
723 YY_USER_ACTION
724 # line 56 "scan.l"
725 { yylval.string = strdup((const char *)yytext); return ID; }
726 	YY_BREAK
727 case 31:
728 YY_USER_ACTION
729 # line 57 "scan.l"
730 { return NL; }
731 	YY_BREAK
732 case YY_STATE_EOF(INITIAL):
733 # line 58 "scan.l"
734 { yyterminate(); }
735 	YY_BREAK
736 case 32:
737 YY_USER_ACTION
738 # line 59 "scan.l"
739 { cerr << "Lexical error in input string: invalid character\n";
740 		  return ERROR; }
741 	YY_BREAK
742 case 33:
743 YY_USER_ACTION
744 # line 62 "scan.l"
745 ECHO;
746 	YY_BREAK
747 
748 	case YY_END_OF_BUFFER:
749 		{
750 		/* Amount of text matched not including the EOB char. */
751 		int yy_amount_of_matched_text = yy_cp - yytext_ptr - 1;
752 
753 		/* Undo the effects of YY_DO_BEFORE_ACTION. */
754 		*yy_cp = yy_hold_char;
755 
756 		if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
757 			{
758 			/* We're scanning a new file or input source.  It's
759 			 * possible that this happened because the user
760 			 * just pointed yyin at a new source and called
761 			 * yylex().  If so, then we have to assure
762 			 * consistency between yy_current_buffer and our
763 			 * globals.  Here is the right place to do so, because
764 			 * this is the first action (other than possibly a
765 			 * back-up) that will match for the new input source.
766 			 */
767 			yy_n_chars = yy_current_buffer->yy_n_chars;
768 			yy_current_buffer->yy_input_file = yyin;
769 			yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
770 			}
771 
772 		/* Note that here we test for yy_c_buf_p "<=" to the position
773 		 * of the first EOB in the buffer, since yy_c_buf_p will
774 		 * already have been incremented past the NUL character
775 		 * (since all states make transitions on EOB to the
776 		 * end-of-buffer state).  Contrast this with the test
777 		 * in input().
778 		 */
779 		if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
780 			{ /* This was really a NUL. */
781 			yy_state_type yy_next_state;
782 
783 			yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
784 
785 			yy_current_state = yy_get_previous_state();
786 
787 			/* Okay, we're now positioned to make the NUL
788 			 * transition.  We couldn't have
789 			 * yy_get_previous_state() go ahead and do it
790 			 * for us because it doesn't know how to deal
791 			 * with the possibility of jamming (and we don't
792 			 * want to build jamming into it because then it
793 			 * will run more slowly).
794 			 */
795 
796 			yy_next_state = yy_try_NUL_trans( yy_current_state );
797 
798 			yy_bp = yytext_ptr + YY_MORE_ADJ;
799 
800 			if ( yy_next_state )
801 				{
802 				/* Consume the NUL. */
803 				yy_cp = ++yy_c_buf_p;
804 				yy_current_state = yy_next_state;
805 				goto yy_match;
806 				}
807 
808 			else
809 				{
810 							yy_cp = yy_c_buf_p;
811 				goto yy_find_action;
812 				}
813 			}
814 
815 		else switch ( yy_get_next_buffer() )
816 			{
817 			case EOB_ACT_END_OF_FILE:
818 				{
819 				yy_did_buffer_switch_on_eof = 0;
820 
821 				if ( yywrap() )
822 					{
823 					/* Note: because we've taken care in
824 					 * yy_get_next_buffer() to have set up
825 					 * yytext, we can now set up
826 					 * yy_c_buf_p so that if some total
827 					 * hoser (like flex itself) wants to
828 					 * call the scanner after we return the
829 					 * YY_NULL, it'll still work - another
830 					 * YY_NULL will get returned.
831 					 */
832 					yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
833 
834 					yy_act = YY_STATE_EOF(YY_START);
835 					goto do_action;
836 					}
837 
838 				else
839 					{
840 					if ( ! yy_did_buffer_switch_on_eof )
841 						YY_NEW_FILE;
842 					}
843 				break;
844 				}
845 
846 			case EOB_ACT_CONTINUE_SCAN:
847 				yy_c_buf_p =
848 					yytext_ptr + yy_amount_of_matched_text;
849 
850 				yy_current_state = yy_get_previous_state();
851 
852 				yy_cp = yy_c_buf_p;
853 				yy_bp = yytext_ptr + YY_MORE_ADJ;
854 				goto yy_match;
855 
856 			case EOB_ACT_LAST_MATCH:
857 				yy_c_buf_p =
858 				&yy_current_buffer->yy_ch_buf[yy_n_chars];
859 
860 				yy_current_state = yy_get_previous_state();
861 
862 				yy_cp = yy_c_buf_p;
863 				yy_bp = yytext_ptr + YY_MORE_ADJ;
864 				goto yy_find_action;
865 			}
866 		break;
867 		}
868 
869 	default:
870 		YY_FATAL_ERROR(
871 			"fatal flex scanner internal error--no action found" );
872 	} /* end of action switch */
873 		} /* end of scanning one token */
874 	} /* end of yylex */
875 
876 
877 /* yy_get_next_buffer - try to read in a new buffer
878  *
879  * Returns a code representing an action:
880  *	EOB_ACT_LAST_MATCH -
881  *	EOB_ACT_CONTINUE_SCAN - continue scanning from current position
882  *	EOB_ACT_END_OF_FILE - end of file
883  */
884 
885 static int yy_get_next_buffer()
886 	{
887 	register char *dest = yy_current_buffer->yy_ch_buf;
888 	register char *source = yytext_ptr - 1; /* copy prev. char, too */
889 	register int number_to_move, i;
890 	int ret_val;
891 
892 	if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
893 		YY_FATAL_ERROR(
894 		"fatal flex scanner internal error--end of buffer missed" );
895 
896 	if ( yy_current_buffer->yy_fill_buffer == 0 )
897 		{ /* Don't try to fill the buffer, so this is an EOF. */
898 		if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
899 			{
900 			/* We matched a singled characater, the EOB, so
901 			 * treat this as a final EOF.
902 			 */
903 			return EOB_ACT_END_OF_FILE;
904 			}
905 
906 		else
907 			{
908 			/* We matched some text prior to the EOB, first
909 			 * process it.
910 			 */
911 			return EOB_ACT_LAST_MATCH;
912 			}
913 		}
914 
915 	/* Try to read more data. */
916 
917 	/* First move last chars to start of buffer. */
918 	number_to_move = yy_c_buf_p - yytext_ptr;
919 
920 	for ( i = 0; i < number_to_move; ++i )
921 		*(dest++) = *(source++);
922 
923 	if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
924 		/* don't do the read, it's not guaranteed to return an EOF,
925 		 * just force an EOF
926 		 */
927 		yy_n_chars = 0;
928 
929 	else
930 		{
931 		int num_to_read =
932 			yy_current_buffer->yy_buf_size - number_to_move - 1;
933 
934 		while ( num_to_read <= 0 )
935 			{ /* Not enough room in the buffer - grow it. */
936 #ifdef YY_USES_REJECT
937 			YY_FATAL_ERROR(
938 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
939 #else
940 
941 			/* just a shorter name for the current buffer */
942 			YY_BUFFER_STATE b = yy_current_buffer;
943 
944 			int yy_c_buf_p_offset = yy_c_buf_p - b->yy_ch_buf;
945 
946 			b->yy_buf_size *= 2;
947 			b->yy_ch_buf = (char *)
948 				yy_flex_realloc( (void *) b->yy_ch_buf,
949 						 b->yy_buf_size );
950 
951 			if ( ! b->yy_ch_buf )
952 				YY_FATAL_ERROR(
953 				"fatal error - scanner input buffer overflow" );
954 
955 			yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
956 
957 			num_to_read = yy_current_buffer->yy_buf_size -
958 						number_to_move - 1;
959 #endif
960 			}
961 
962 		if ( num_to_read > YY_READ_BUF_SIZE )
963 			num_to_read = YY_READ_BUF_SIZE;
964 
965 		/* Read in more data. */
966 		YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
967 			yy_n_chars, num_to_read );
968 		}
969 
970 	if ( yy_n_chars == 0 )
971 		{
972 		if ( number_to_move - YY_MORE_ADJ == 1 )
973 			{
974 			ret_val = EOB_ACT_END_OF_FILE;
975 			yyrestart( yyin );
976 			}
977 
978 		else
979 			{
980 			ret_val = EOB_ACT_LAST_MATCH;
981 			yy_current_buffer->yy_buffer_status =
982 				YY_BUFFER_EOF_PENDING;
983 			}
984 		}
985 
986 	else
987 		ret_val = EOB_ACT_CONTINUE_SCAN;
988 
989 	yy_n_chars += number_to_move;
990 	yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
991 	yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
992 
993 	/* yytext begins at the second character in yy_ch_buf; the first
994 	 * character is the one which preceded it before reading in the latest
995 	 * buffer; it needs to be kept around in case it's a newline, so
996 	 * yy_get_previous_state() will have with '^' rules active.
997 	 */
998 
999 	yytext_ptr = &yy_current_buffer->yy_ch_buf[1];
1000 
1001 	return ret_val;
1002 	}
1003 
1004 
1005 /* yy_get_previous_state - get the state just before the EOB char was reached */
1006 
yy_get_previous_state()1007 static yy_state_type yy_get_previous_state()
1008 	{
1009 	register yy_state_type yy_current_state;
1010 	register char *yy_cp;
1011 
1012 	yy_current_state = yy_start;
1013 
1014 	for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
1015 		{
1016 		register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1017 		if ( yy_accept[yy_current_state] )
1018 			{
1019 			yy_last_accepting_state = yy_current_state;
1020 			yy_last_accepting_cpos = yy_cp;
1021 			}
1022 		while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1023 			{
1024 			yy_current_state = (int) yy_def[yy_current_state];
1025 			if ( yy_current_state >= 94 )
1026 				yy_c = yy_meta[(unsigned int) yy_c];
1027 			}
1028 		yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1029 		}
1030 
1031 	return yy_current_state;
1032 	}
1033 
1034 
1035 /* yy_try_NUL_trans - try to make a transition on the NUL character
1036  *
1037  * synopsis
1038  *	next_state = yy_try_NUL_trans( current_state );
1039  */
1040 
1041 #ifdef YY_USE_PROTOS
yy_try_NUL_trans(yy_state_type yy_current_state)1042 static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
1043 #else
1044 static yy_state_type yy_try_NUL_trans( yy_current_state )
1045 yy_state_type yy_current_state;
1046 #endif
1047 	{
1048 	register int yy_is_jam;
1049 	register char *yy_cp = yy_c_buf_p;
1050 
1051 	register YY_CHAR yy_c = 1;
1052 	if ( yy_accept[yy_current_state] )
1053 		{
1054 		yy_last_accepting_state = yy_current_state;
1055 		yy_last_accepting_cpos = yy_cp;
1056 		}
1057 	while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1058 		{
1059 		yy_current_state = (int) yy_def[yy_current_state];
1060 		if ( yy_current_state >= 94 )
1061 			yy_c = yy_meta[(unsigned int) yy_c];
1062 		}
1063 	yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1064 	yy_is_jam = (yy_current_state == 93);
1065 
1066 	return yy_is_jam ? 0 : yy_current_state;
1067 	}
1068 
1069 
1070 #ifdef YY_USE_PROTOS
yyunput(int c,register char * yy_bp)1071 static void yyunput( int c, register char *yy_bp )
1072 #else
1073 static void yyunput( c, yy_bp )
1074 int c;
1075 register char *yy_bp;
1076 #endif
1077 	{
1078 	register char *yy_cp = yy_c_buf_p;
1079 
1080 	/* undo effects of setting up yytext */
1081 	*yy_cp = yy_hold_char;
1082 
1083 	if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1084 		{ /* need to shift things up to make room */
1085 		/* +2 for EOB chars. */
1086 		register int number_to_move = yy_n_chars + 2;
1087 		register char *dest = &yy_current_buffer->yy_ch_buf[
1088 					yy_current_buffer->yy_buf_size + 2];
1089 		register char *source =
1090 				&yy_current_buffer->yy_ch_buf[number_to_move];
1091 
1092 		while ( source > yy_current_buffer->yy_ch_buf )
1093 			*--dest = *--source;
1094 
1095 		yy_cp += dest - source;
1096 		yy_bp += dest - source;
1097 		yy_n_chars = yy_current_buffer->yy_buf_size;
1098 
1099 		if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1100 			YY_FATAL_ERROR( "flex scanner push-back overflow" );
1101 		}
1102 
1103 	if ( yy_cp > yy_bp && yy_cp[-1] == '\n' )
1104 		yy_cp[-2] = '\n';
1105 
1106 	*--yy_cp = (char) c;
1107 
1108 
1109 	/* Note: the formal parameter *must* be called "yy_bp" for this
1110 	 * macro to now work correctly.
1111 	 */
1112 	YY_DO_BEFORE_ACTION; /* set up yytext again */
1113 	}
1114 
1115 
1116 #ifdef __cplusplus
yyinput()1117 static int yyinput()
1118 #else
1119 static int input()
1120 #endif
1121 	{
1122 	int c;
1123 
1124 	*yy_c_buf_p = yy_hold_char;
1125 
1126 	if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
1127 		{
1128 		/* yy_c_buf_p now points to the character we want to return.
1129 		 * If this occurs *before* the EOB characters, then it's a
1130 		 * valid NUL; if not, then we've hit the end of the buffer.
1131 		 */
1132 		if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
1133 			/* This was really a NUL. */
1134 			*yy_c_buf_p = '\0';
1135 
1136 		else
1137 			{ /* need more input */
1138 			yytext_ptr = yy_c_buf_p;
1139 			++yy_c_buf_p;
1140 
1141 			switch ( yy_get_next_buffer() )
1142 				{
1143 				case EOB_ACT_END_OF_FILE:
1144 					{
1145 					if ( yywrap() )
1146 						{
1147 						yy_c_buf_p =
1148 						yytext_ptr + YY_MORE_ADJ;
1149 						return EOF;
1150 						}
1151 
1152 					YY_NEW_FILE;
1153 #ifdef __cplusplus
1154 					return yyinput();
1155 #else
1156 					return input();
1157 #endif
1158 					}
1159 
1160 				case EOB_ACT_CONTINUE_SCAN:
1161 					yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
1162 					break;
1163 
1164 				case EOB_ACT_LAST_MATCH:
1165 #ifdef __cplusplus
1166 					YY_FATAL_ERROR(
1167 					"unexpected last match in yyinput()" );
1168 #else
1169 					YY_FATAL_ERROR(
1170 					"unexpected last match in input()" );
1171 #endif
1172 				}
1173 			}
1174 		}
1175 
1176 	c = *(unsigned char *) yy_c_buf_p;	/* cast for 8-bit char's */
1177 	*yy_c_buf_p = '\0';	/* preserve yytext */
1178 	yy_hold_char = *++yy_c_buf_p;
1179 
1180 	return c;
1181 	}
1182 
1183 
1184 #ifdef YY_USE_PROTOS
yyrestart(FILE * input_file)1185 void yyrestart( FILE *input_file )
1186 #else
1187 void yyrestart( input_file )
1188 FILE *input_file;
1189 #endif
1190 	{
1191 	if ( ! yy_current_buffer )
1192 		yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
1193 
1194 	yy_init_buffer( yy_current_buffer, input_file );
1195 	yy_load_buffer_state();
1196 	}
1197 
1198 
1199 #ifdef YY_USE_PROTOS
yy_switch_to_buffer(YY_BUFFER_STATE new_buffer)1200 void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
1201 #else
1202 void yy_switch_to_buffer( new_buffer )
1203 YY_BUFFER_STATE new_buffer;
1204 #endif
1205 	{
1206 	if ( yy_current_buffer == new_buffer )
1207 		return;
1208 
1209 	if ( yy_current_buffer )
1210 		{
1211 		/* Flush out information for old buffer. */
1212 		*yy_c_buf_p = yy_hold_char;
1213 		yy_current_buffer->yy_buf_pos = yy_c_buf_p;
1214 		yy_current_buffer->yy_n_chars = yy_n_chars;
1215 		}
1216 
1217 	yy_current_buffer = new_buffer;
1218 	yy_load_buffer_state();
1219 
1220 	/* We don't actually know whether we did this switch during
1221 	 * EOF (yywrap()) processing, but the only time this flag
1222 	 * is looked at is after yywrap() is called, so it's safe
1223 	 * to go ahead and always set it.
1224 	 */
1225 	yy_did_buffer_switch_on_eof = 1;
1226 	}
1227 
1228 
1229 #ifdef YY_USE_PROTOS
yy_load_buffer_state(void)1230 void yy_load_buffer_state( void )
1231 #else
1232 void yy_load_buffer_state()
1233 #endif
1234 	{
1235 	yy_n_chars = yy_current_buffer->yy_n_chars;
1236 	yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
1237 	yyin = yy_current_buffer->yy_input_file;
1238 	yy_hold_char = *yy_c_buf_p;
1239 	}
1240 
1241 
1242 #ifdef YY_USE_PROTOS
yy_create_buffer(FILE * file,int size)1243 YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
1244 #else
1245 YY_BUFFER_STATE yy_create_buffer( file, size )
1246 FILE *file;
1247 int size;
1248 #endif
1249 	{
1250 	YY_BUFFER_STATE b;
1251 
1252 	b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
1253 
1254 	if ( ! b )
1255 		YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1256 
1257 	b->yy_buf_size = size;
1258 
1259 	/* yy_ch_buf has to be 2 characters longer than the size given because
1260 	 * we need to put in 2 end-of-buffer characters.
1261 	 */
1262 	b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
1263 
1264 	if ( ! b->yy_ch_buf )
1265 		YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1266 
1267 	yy_init_buffer( b, file );
1268 
1269 	return b;
1270 	}
1271 
1272 
1273 #ifdef YY_USE_PROTOS
yy_delete_buffer(YY_BUFFER_STATE b)1274 void yy_delete_buffer( YY_BUFFER_STATE b )
1275 #else
1276 void yy_delete_buffer( b )
1277 YY_BUFFER_STATE b;
1278 #endif
1279 	{
1280 	if ( b == yy_current_buffer )
1281 		yy_current_buffer = (YY_BUFFER_STATE) 0;
1282 
1283 	yy_flex_free( (void *) b->yy_ch_buf );
1284 	yy_flex_free( (void *) b );
1285 	}
1286 
1287 
1288 #ifdef YY_USE_PROTOS
yy_init_buffer(YY_BUFFER_STATE b,FILE * file)1289 void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
1290 #else
1291 void yy_init_buffer( b, file )
1292 YY_BUFFER_STATE b;
1293 FILE *file;
1294 #endif
1295 	{
1296 	b->yy_input_file = file;
1297 
1298 	/* We put in the '\n' and start reading from [1] so that an
1299 	 * initial match-at-newline will be true.
1300 	 */
1301 
1302 	b->yy_ch_buf[0] = '\n';
1303 	b->yy_n_chars = 1;
1304 
1305 	/* We always need two end-of-buffer characters.  The first causes
1306 	 * a transition to the end-of-buffer state.  The second causes
1307 	 * a jam in that state.
1308 	 */
1309 	b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1310 	b->yy_ch_buf[2] = YY_END_OF_BUFFER_CHAR;
1311 
1312 	b->yy_buf_pos = &b->yy_ch_buf[1];
1313 
1314 	b->yy_is_interactive = file ? isatty( fileno(file) ) : 0;
1315 
1316 	b->yy_fill_buffer = 1;
1317 
1318 	b->yy_buffer_status = YY_BUFFER_NEW;
1319 	}
1320 
1321 
1322 #ifdef YY_USE_PROTOS
yy_push_state(int new_state)1323 static void yy_push_state( int new_state )
1324 #else
1325 static void yy_push_state( new_state )
1326 int new_state;
1327 #endif
1328 	{
1329 	if ( yy_start_stack_ptr >= yy_start_stack_depth )
1330 		{
1331 		int new_size;
1332 
1333 		yy_start_stack_depth += YY_START_STACK_INCR;
1334 		new_size = yy_start_stack_depth * sizeof( int );
1335 
1336 		if ( ! yy_start_stack )
1337 			yy_start_stack = (int *) yy_flex_alloc( new_size );
1338 
1339 		else
1340 			yy_start_stack = (int *) yy_flex_realloc(
1341 					(void *) yy_start_stack, new_size );
1342 
1343 		if ( ! yy_start_stack )
1344 			YY_FATAL_ERROR(
1345 			"out of memory expanding start-condition stack" );
1346 		}
1347 
1348 	yy_start_stack[yy_start_stack_ptr++] = YY_START;
1349 
1350 	BEGIN(new_state);
1351 	}
1352 
1353 
yy_pop_state()1354 static void yy_pop_state()
1355 	{
1356 	if ( --yy_start_stack_ptr < 0 )
1357 		YY_FATAL_ERROR( "start-condition stack underflow" );
1358 
1359 	BEGIN(yy_start_stack[yy_start_stack_ptr]);
1360 	}
1361 
1362 
yy_top_state()1363 static int yy_top_state()
1364 	{
1365 	return yy_start_stack[yy_start_stack_ptr - 1];
1366 	}
1367 
1368 
1369 #ifdef YY_USE_PROTOS
yy_fatal_error(const char msg[])1370 static void yy_fatal_error( const char msg[] )
1371 #else
1372 static void yy_fatal_error( msg )
1373 char msg[];
1374 #endif
1375 	{
1376 	(void) fprintf( stderr, "%s\n", msg );
1377 	exit( 1 );
1378 	}
1379 
1380 
1381 
1382 /* Redefine yyless() so it works in section 3 code. */
1383 
1384 #undef yyless
1385 #define yyless(n) \
1386 	do \
1387 		{ \
1388 		/* Undo effects of setting up yytext. */ \
1389 		yytext[yyleng] = yy_hold_char; \
1390 		yy_c_buf_p = yytext + n - YY_MORE_ADJ; \
1391 		yy_hold_char = *yy_c_buf_p; \
1392 		*yy_c_buf_p = '\0'; \
1393 		yyleng = n; \
1394 		} \
1395 	while ( 0 )
1396 
1397 
1398 /* Internal utility routines. */
1399 
1400 #ifndef yytext_ptr
1401 #ifdef YY_USE_PROTOS
yy_flex_strncpy(char * s1,const char * s2,int n)1402 static void yy_flex_strncpy( char *s1, const char *s2, int n )
1403 #else
1404 static void yy_flex_strncpy( s1, s2, n )
1405 char *s1;
1406 const char *s2;
1407 int n;
1408 #endif
1409 	{
1410 	register int i;
1411 	for ( i = 0; i < n; ++i )
1412 		s1[i] = s2[i];
1413 	}
1414 #endif
1415 
1416 
1417 #ifdef YY_USE_PROTOS
yy_flex_alloc(unsigned int size)1418 static void *yy_flex_alloc( unsigned int size )
1419 #else
1420 static void *yy_flex_alloc( size )
1421 unsigned int size;
1422 #endif
1423 	{
1424 	return (void *) malloc( size );
1425 	}
1426 
1427 #ifdef YY_USE_PROTOS
yy_flex_realloc(void * ptr,unsigned int size)1428 static void *yy_flex_realloc( void *ptr, unsigned int size )
1429 #else
1430 static void *yy_flex_realloc( ptr, size )
1431 void *ptr;
1432 unsigned int size;
1433 #endif
1434 	{
1435 	return (void *) realloc( ptr, size );
1436 	}
1437 
1438 #ifdef YY_USE_PROTOS
yy_flex_free(void * ptr)1439 static void yy_flex_free( void *ptr )
1440 #else
1441 static void yy_flex_free( ptr )
1442 void *ptr;
1443 #endif
1444 	{
1445 	free( ptr );
1446 	}
1447 # line 62 "scan.l"
1448 
1449