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