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