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