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