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