Pristine Ack-5.5
[Ack-5.5.git] / util / flex / flex.skel
1 /* A lexical scanner generated by flex */
2
3 /* scanner skeleton version:
4  * $Id: flex.skel,v 1.3 1994/06/24 10:56:48 ceriel Exp $
5  */
6
7 #define FLEX_SCANNER
8
9 #define ACK_MOD
10
11 #include <stdio.h>
12
13
14 /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
15 #ifdef c_plusplus
16 #ifndef __cplusplus
17 #define __cplusplus
18 #endif
19 #endif
20
21
22 #ifdef __cplusplus
23
24 #include <stdlib.h>
25 #include <osfcn.h>
26
27 /* use prototypes in function declarations */
28 #define YY_USE_PROTOS
29
30 /* the "const" storage-class-modifier is valid */
31 #define YY_USE_CONST
32
33 #else   /* ! __cplusplus */
34
35 #ifdef __STDC__
36
37 #ifdef __GNUC__
38 #include <stddef.h>
39 void *malloc( size_t );
40 void free( void* );
41 #else
42 #include <stdlib.h>
43 #endif  /* __GNUC__ */
44
45 #define YY_USE_PROTOS
46 #define YY_USE_CONST
47
48 #endif  /* __STDC__ */
49 #endif  /* ! __cplusplus */
50
51
52 #ifdef __TURBOC__
53 #define YY_USE_CONST
54 #endif
55
56
57 #ifndef YY_USE_CONST
58 #define const
59 #endif
60
61
62 #ifdef YY_USE_PROTOS
63 #define YY_PROTO(proto) proto
64 #else
65 #define YY_PROTO(proto) ()
66 /* we can't get here if it's an ANSI C compiler, or a C++ compiler,
67  * so it's got to be a K&R compiler, and therefore there's no standard
68  * place from which to include these definitions
69  */
70 char *malloc();
71 int free();
72 int read();
73 #endif
74
75
76 /* amount of stuff to slurp up with each read */
77 #ifndef YY_READ_BUF_SIZE
78 #define YY_READ_BUF_SIZE 8192
79 #endif
80
81 /* returned upon end-of-file */
82 #define YY_END_TOK 0
83
84 /* copy whatever the last rule matched to the standard output */
85
86 /* cast to (char *) is because for 8-bit chars, yytext is (unsigned char *) */
87 /* this used to be an fputs(), but since the string might contain NUL's,
88  * we now use fwrite()
89  */
90 #define ECHO (void) fwrite( (char *) yytext, yyleng, 1, yyout )
91
92 /* gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
93  * is returned in "result".
94  */
95 #define YY_INPUT(buf,result,max_size) \
96         if ( (result = read( fileno(yyin), (char *) buf, max_size )) < 0 ) \
97             YY_FATAL_ERROR( "read() in flex scanner failed" );
98 #define YY_NULL 0
99
100 /* no semi-colon after return; correct usage is to write "yyterminate();" -
101  * we don't want an extra ';' after the "return" because that will cause
102  * some compilers to complain about unreachable statements.
103  */
104 #define yyterminate() return ( YY_NULL )
105
106 /* report a fatal error */
107
108 /* The funky do-while is used to turn this macro definition into
109  * a single C statement (which needs a semi-colon terminator).
110  * This avoids problems with code like:
111  *
112  *      if ( something_happens )
113  *              YY_FATAL_ERROR( "oops, the something happened" );
114  *      else
115  *              everything_okay();
116  *
117  * Prior to using the do-while the compiler would get upset at the
118  * "else" because it interpreted the "if" statement as being all
119  * done when it reached the ';' after the YY_FATAL_ERROR() call.
120  */
121
122 #define YY_FATAL_ERROR(msg) \
123         do \
124                 { \
125                 (void) fputs( msg, stderr ); \
126                 (void) putc( '\n', stderr ); \
127                 exit( 1 ); \
128                 } \
129         while ( 0 )
130
131 /* default yywrap function - always treat EOF as an EOF */
132 #define yywrap() 1
133
134 /* enter a start condition.  This macro really ought to take a parameter,
135  * but we do it the disgusting crufty way forced on us by the ()-less
136  * definition of BEGIN
137  */
138 #define BEGIN yy_start = 1 + 2 *
139
140 /* action number for EOF rule of a given start state */
141 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
142
143 /* special action meaning "start processing a new file" */
144 #define YY_NEW_FILE \
145         do \
146                 { \
147                 yy_init_buffer( yy_current_buffer, yyin ); \
148                 yy_load_buffer_state(); \
149                 } \
150         while ( 0 )
151
152 /* default declaration of generated scanner - a define so the user can
153  * easily add parameters
154  */
155 #define YY_DECL int yylex YY_PROTO(( void )) 
156
157 /* code executed at the end of each rule */
158 #define YY_BREAK break;
159
160 #define YY_END_OF_BUFFER_CHAR 0
161
162 #ifndef YY_BUF_SIZE
163 #define YY_BUF_SIZE (YY_READ_BUF_SIZE * 2) /* size of default input buffer */
164 #endif
165
166 typedef struct yy_buffer_state *YY_BUFFER_STATE;
167
168 %% section 1 definitions go here
169
170 /* done after the current pattern has been matched and before the
171  * corresponding action - sets up yytext
172  */
173 #define YY_DO_BEFORE_ACTION \
174         yytext = yy_bp; \
175 %% code to fiddle yytext and yyleng for yymore() goes here
176         yy_hold_char = *yy_cp; \
177         *yy_cp = '\0'; \
178         yy_c_buf_p = yy_cp;
179
180 #define EOB_ACT_CONTINUE_SCAN 0
181 #define EOB_ACT_END_OF_FILE 1
182 #define EOB_ACT_LAST_MATCH 2
183
184 /* return all but the first 'n' matched characters back to the input stream */
185 #define yyless(n) \
186         do \
187                 { \
188                 /* undo effects of setting up yytext */ \
189                 *yy_cp = yy_hold_char; \
190                 yy_c_buf_p = yy_cp = yy_bp + n; \
191                 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
192                 } \
193         while ( 0 )
194
195 #define unput(c) yyunput( c, yytext )
196
197
198 struct yy_buffer_state
199     {
200     FILE *yy_input_file;
201
202     YY_CHAR *yy_ch_buf;         /* input buffer */
203     YY_CHAR *yy_buf_pos;        /* current position in input buffer */
204
205     /* size of input buffer in bytes, not including room for EOB characters*/
206     int yy_buf_size;    
207
208     /* number of characters read into yy_ch_buf, not including EOB characters */
209     int yy_n_chars;
210
211     int yy_eof_status;          /* whether we've seen an EOF on this buffer */
212 #define EOF_NOT_SEEN 0
213     /* "pending" happens when the EOF has been seen but there's still
214      * some text process
215      */
216 #define EOF_PENDING 1
217 #define EOF_DONE 2
218     };
219
220 static YY_BUFFER_STATE yy_current_buffer;
221
222 /* we provide macros for accessing buffer states in case in the
223  * future we want to put the buffer states in a more general
224  * "scanner state"
225  */
226 #define YY_CURRENT_BUFFER yy_current_buffer
227
228
229 /* yy_hold_char holds the character lost when yytext is formed */
230 static YY_CHAR yy_hold_char;
231
232 static int yy_n_chars;          /* number of characters read into yy_ch_buf */
233
234
235
236 #ifndef YY_USER_ACTION
237 #define YY_USER_ACTION
238 #endif
239
240 #ifndef YY_USER_INIT
241 #define YY_USER_INIT
242 #endif
243
244 extern YY_CHAR *yytext;
245 extern int yyleng;
246 extern FILE *yyin, *yyout;
247
248 YY_CHAR *yytext;
249 int yyleng;
250
251 FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
252
253 %% data tables for the DFA go here
254
255 /* these variables are all declared out here so that section 3 code can
256  * manipulate them
257  */
258 /* points to current character in buffer */
259 static YY_CHAR *yy_c_buf_p = (YY_CHAR *) 0;
260 static int yy_init = 1;         /* whether we need to initialize */
261 static int yy_start = 0;        /* start state number */
262
263 /* flag which is used to allow yywrap()'s to do buffer switches
264  * instead of setting up a fresh yyin.  A bit of a hack ...
265  */
266 static int yy_did_buffer_switch_on_eof;
267
268 static yy_state_type yy_get_previous_state YY_PROTO(( void ));
269 static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
270 static int yy_get_next_buffer YY_PROTO(( void ));
271 static void yyunput YY_PROTO(( YY_CHAR c, YY_CHAR *buf_ptr ));
272 void yyrestart YY_PROTO(( FILE *input_file ));
273 void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
274 void yy_load_buffer_state YY_PROTO(( void ));
275 YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
276 void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
277 void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
278
279 #define yy_new_buffer yy_create_buffer
280
281 #ifdef __cplusplus
282 static int yyinput YY_PROTO(( void ));
283 #else
284 static int input YY_PROTO(( void ));
285 #endif
286
287 YY_DECL
288     {
289     register yy_state_type yy_current_state;
290     register YY_CHAR *yy_cp, *yy_bp;
291     register int yy_act;
292
293 %% user's declarations go here
294
295     if ( yy_init )
296         {
297         YY_USER_INIT;
298
299         if ( ! yy_start )
300             yy_start = 1;       /* first start state */
301
302         if ( ! yyin )
303             yyin = stdin;
304
305         if ( ! yyout )
306             yyout = stdout;
307
308         if ( yy_current_buffer )
309             yy_init_buffer( yy_current_buffer, yyin );
310         else
311             yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
312
313         yy_load_buffer_state();
314
315         yy_init = 0;
316         }
317
318     while ( 1 )         /* loops until end-of-file is reached */
319         {
320 %% yymore()-related code goes here
321         yy_cp = yy_c_buf_p;
322
323         /* support of yytext */
324         *yy_cp = yy_hold_char;
325
326         /* yy_bp points to the position in yy_ch_buf of the start of the
327          * current run.
328          */
329         yy_bp = yy_cp;
330
331 %% code to set up and find next match goes here
332
333 yy_find_action:
334 %% code to find the action number goes here
335
336         YY_DO_BEFORE_ACTION;
337         YY_USER_ACTION;
338
339 do_action:      /* this label is used only to access EOF actions */
340
341 %% debug code goes here
342
343         switch ( yy_act )
344             {
345 %% actions go here
346
347             case YY_END_OF_BUFFER:
348                 {
349                 /* amount of text matched not including the EOB char */
350                 int yy_amount_of_matched_text = yy_cp - yytext - 1;
351
352                 /* undo the effects of YY_DO_BEFORE_ACTION */
353                 *yy_cp = yy_hold_char;
354
355                 /* note that here we test for yy_c_buf_p "<=" to the position
356                  * of the first EOB in the buffer, since yy_c_buf_p will
357                  * already have been incremented past the NUL character
358                  * (since all states make transitions on EOB to the end-
359                  * of-buffer state).  Contrast this with the test in yyinput().
360                  */
361                 if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
362                     /* this was really a NUL */
363                     {
364                     yy_state_type yy_next_state;
365
366                     yy_c_buf_p = yytext + yy_amount_of_matched_text;
367
368                     yy_current_state = yy_get_previous_state();
369
370                     /* okay, we're now positioned to make the
371                      * NUL transition.  We couldn't have
372                      * yy_get_previous_state() go ahead and do it
373                      * for us because it doesn't know how to deal
374                      * with the possibility of jamming (and we
375                      * don't want to build jamming into it because
376                      * then it will run more slowly)
377                      */
378
379                     yy_next_state = yy_try_NUL_trans( yy_current_state );
380
381                     yy_bp = yytext + YY_MORE_ADJ;
382
383                     if ( yy_next_state )
384                         {
385                         /* consume the NUL */
386                         yy_cp = ++yy_c_buf_p;
387                         yy_current_state = yy_next_state;
388                         goto yy_match;
389                         }
390
391                     else
392                         {
393 %% code to do backtracking for compressed tables and set up yy_cp goes here
394                         goto yy_find_action;
395                         }
396                     }
397
398                 else switch ( yy_get_next_buffer() )
399                     {
400                     case EOB_ACT_END_OF_FILE:
401                         {
402                         yy_did_buffer_switch_on_eof = 0;
403
404                         if ( yywrap() )
405                             {
406                             /* note: because we've taken care in
407                              * yy_get_next_buffer() to have set up yytext,
408                              * we can now set up yy_c_buf_p so that if some
409                              * total hoser (like flex itself) wants
410                              * to call the scanner after we return the
411                              * YY_NULL, it'll still work - another YY_NULL
412                              * will get returned.
413                              */
414                             yy_c_buf_p = yytext + YY_MORE_ADJ;
415
416                             yy_act = YY_STATE_EOF((yy_start - 1) / 2);
417                             goto do_action;
418                             }
419
420                         else
421                             {
422                             if ( ! yy_did_buffer_switch_on_eof )
423                                 YY_NEW_FILE;
424                             }
425                         }
426                         break;
427
428                     case EOB_ACT_CONTINUE_SCAN:
429                         yy_c_buf_p = yytext + yy_amount_of_matched_text;
430
431                         yy_current_state = yy_get_previous_state();
432
433                         yy_cp = yy_c_buf_p;
434                         yy_bp = yytext + YY_MORE_ADJ;
435                         goto yy_match;
436
437                     case EOB_ACT_LAST_MATCH:
438                         yy_c_buf_p =
439                             &yy_current_buffer->yy_ch_buf[yy_n_chars];
440
441                         yy_current_state = yy_get_previous_state();
442
443                         yy_cp = yy_c_buf_p;
444                         yy_bp = yytext + YY_MORE_ADJ;
445                         goto yy_find_action;
446                     }
447                 break;
448                 }
449
450             default:
451 #ifdef FLEX_DEBUG
452                 printf( "action # %d\n", yy_act );
453 #endif
454                 YY_FATAL_ERROR(
455                         "fatal flex scanner internal error--no action found" );
456             }
457         }
458     }
459
460
461 /* yy_get_next_buffer - try to read in a new buffer
462  *
463  * synopsis
464  *     int yy_get_next_buffer();
465  *     
466  * returns a code representing an action
467  *     EOB_ACT_LAST_MATCH - 
468  *     EOB_ACT_CONTINUE_SCAN - continue scanning from current position
469  *     EOB_ACT_END_OF_FILE - end of file
470  */
471
472 static int yy_get_next_buffer()
473
474     {
475     register YY_CHAR *dest = yy_current_buffer->yy_ch_buf;
476     register YY_CHAR *source = yytext - 1; /* copy prev. char, too */
477     register int number_to_move, i;
478     int ret_val;
479
480     if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
481         YY_FATAL_ERROR(
482                 "fatal flex scanner internal error--end of buffer missed" );
483
484     /* try to read more data */
485
486     /* first move last chars to start of buffer */
487     number_to_move = yy_c_buf_p - yytext;
488
489     for ( i = 0; i < number_to_move; ++i )
490         *(dest++) = *(source++);
491
492     if ( yy_current_buffer->yy_eof_status != EOF_NOT_SEEN )
493         /* don't do the read, it's not guaranteed to return an EOF,
494          * just force an EOF
495          */
496         yy_n_chars = 0;
497
498     else
499         {
500         int num_to_read = yy_current_buffer->yy_buf_size - number_to_move - 1;
501
502         if ( num_to_read > YY_READ_BUF_SIZE )
503             num_to_read = YY_READ_BUF_SIZE;
504
505         else if ( num_to_read <= 0 )
506             YY_FATAL_ERROR( "fatal error - scanner input buffer overflow" );
507
508         /* read in more data */
509         YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
510                   yy_n_chars, num_to_read );
511         }
512
513     if ( yy_n_chars == 0 )
514         {
515         if ( number_to_move == 1 )
516             {
517             ret_val = EOB_ACT_END_OF_FILE;
518             yy_current_buffer->yy_eof_status = EOF_DONE;
519             }
520
521         else
522             {
523             ret_val = EOB_ACT_LAST_MATCH;
524             yy_current_buffer->yy_eof_status = EOF_PENDING;
525             }
526         }
527
528     else
529         ret_val = EOB_ACT_CONTINUE_SCAN;
530
531     yy_n_chars += number_to_move;
532     yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
533     yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
534
535     /* yytext begins at the second character in yy_ch_buf; the first
536      * character is the one which preceded it before reading in the latest
537      * buffer; it needs to be kept around in case it's a newline, so
538      * yy_get_previous_state() will have with '^' rules active
539      */
540
541     yytext = &yy_current_buffer->yy_ch_buf[1];
542
543     return ( ret_val );
544     }
545
546
547 /* yy_get_previous_state - get the state just before the EOB char was reached
548  *
549  * synopsis
550  *     yy_state_type yy_get_previous_state();
551  */
552
553 static yy_state_type yy_get_previous_state()
554
555     {
556     register yy_state_type yy_current_state;
557     register YY_CHAR *yy_cp;
558
559 %% code to get the start state into yy_current_state goes here
560
561     for ( yy_cp = yytext + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
562         {
563 %% code to find the next state goes here
564         }
565
566     return ( yy_current_state );
567     }
568
569
570 /* yy_try_NUL_trans - try to make a transition on the NUL character
571  *
572  * synopsis
573  *     next_state = yy_try_NUL_trans( current_state );
574  */
575
576 #ifdef YY_USE_PROTOS
577 static yy_state_type yy_try_NUL_trans( register yy_state_type yy_current_state )
578 #else
579 static yy_state_type yy_try_NUL_trans( yy_current_state )
580 register yy_state_type yy_current_state;
581 #endif
582
583     {
584     register int yy_is_jam;
585 %% code to find the next state, and perhaps do backtracking, goes here
586
587     return ( yy_is_jam ? 0 : yy_current_state );
588     }
589
590
591 #ifdef YY_USE_PROTOS
592 static void yyunput( YY_CHAR c, register YY_CHAR *yy_bp )
593 #else
594 static void yyunput( c, yy_bp )
595 YY_CHAR c;
596 register YY_CHAR *yy_bp;
597 #endif
598
599     {
600     register YY_CHAR *yy_cp = yy_c_buf_p;
601
602     /* undo effects of setting up yytext */
603     *yy_cp = yy_hold_char;
604
605     if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
606         { /* need to shift things up to make room */
607         register int number_to_move = yy_n_chars + 2; /* +2 for EOB chars */
608         register YY_CHAR *dest =
609             &yy_current_buffer->yy_ch_buf[yy_current_buffer->yy_buf_size + 2];
610         register YY_CHAR *source =
611             &yy_current_buffer->yy_ch_buf[number_to_move];
612
613         while ( source > yy_current_buffer->yy_ch_buf )
614             *--dest = *--source;
615
616         yy_cp += dest - source;
617         yy_bp += dest - source;
618         yy_n_chars = yy_current_buffer->yy_buf_size;
619
620         if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
621             YY_FATAL_ERROR( "flex scanner push-back overflow" );
622         }
623
624     if ( yy_cp > yy_bp && yy_cp[-1] == '\n' )
625         yy_cp[-2] = '\n';
626
627     *--yy_cp = c;
628
629     /* note: the formal parameter *must* be called "yy_bp" for this
630      *       macro to now work correctly
631      */
632     YY_DO_BEFORE_ACTION; /* set up yytext again */
633     }
634
635
636 #ifdef __cplusplus
637 static int yyinput()
638 #else
639 static int input()
640 #endif
641
642     {
643     int c;
644     YY_CHAR *yy_cp = yy_c_buf_p;
645
646     *yy_cp = yy_hold_char;
647
648     if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
649         {
650         /* yy_c_buf_p now points to the character we want to return.
651          * If this occurs *before* the EOB characters, then it's a
652          * valid NUL; if not, then we've hit the end of the buffer.
653          */
654         if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
655             /* this was really a NUL */
656             *yy_c_buf_p = '\0';
657
658         else
659             { /* need more input */
660             yytext = yy_c_buf_p;
661             ++yy_c_buf_p;
662
663             switch ( yy_get_next_buffer() )
664                 {
665                 case EOB_ACT_END_OF_FILE:
666                     {
667                     if ( yywrap() )
668                         {
669                         yy_c_buf_p = yytext + YY_MORE_ADJ;
670                         return ( EOF );
671                         }
672
673                     YY_NEW_FILE;
674
675 #ifdef __cplusplus
676                     return ( yyinput() );
677 #else
678                     return ( input() );
679 #endif
680                     }
681                     break;
682
683                 case EOB_ACT_CONTINUE_SCAN:
684                     yy_c_buf_p = yytext + YY_MORE_ADJ;
685                     break;
686
687                 case EOB_ACT_LAST_MATCH:
688 #ifdef __cplusplus
689                     YY_FATAL_ERROR( "unexpected last match in yyinput()" );
690 #else
691                     YY_FATAL_ERROR( "unexpected last match in input()" );
692 #endif
693                 }
694             }
695         }
696
697     c = *yy_c_buf_p;
698     yy_hold_char = *++yy_c_buf_p;
699
700     return ( c );
701     }
702
703
704 #ifdef YY_USE_PROTOS
705 void yyrestart( FILE *input_file )
706 #else
707 void yyrestart( input_file )
708 FILE *input_file;
709 #endif
710
711     {
712     yy_init_buffer( yy_current_buffer, input_file );
713     yy_load_buffer_state();
714     }
715
716
717 #ifdef YY_USE_PROTOS
718 void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
719 #else
720 void yy_switch_to_buffer( new_buffer )
721 YY_BUFFER_STATE new_buffer;
722 #endif
723
724     {
725     if ( yy_current_buffer == new_buffer )
726         return;
727
728     if ( yy_current_buffer )
729         {
730         /* flush out information for old buffer */
731         *yy_c_buf_p = yy_hold_char;
732         yy_current_buffer->yy_buf_pos = yy_c_buf_p;
733         yy_current_buffer->yy_n_chars = yy_n_chars;
734         }
735
736     yy_current_buffer = new_buffer;
737     yy_load_buffer_state();
738
739     /* we don't actually know whether we did this switch during
740      * EOF (yywrap()) processing, but the only time this flag
741      * is looked at is after yywrap() is called, so it's safe
742      * to go ahead and always set it.
743      */
744     yy_did_buffer_switch_on_eof = 1;
745     }
746
747
748 #ifdef YY_USE_PROTOS
749 void yy_load_buffer_state( void )
750 #else
751 void yy_load_buffer_state()
752 #endif
753
754     {
755     yy_n_chars = yy_current_buffer->yy_n_chars;
756     yytext = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
757     yyin = yy_current_buffer->yy_input_file;
758     yy_hold_char = *yy_c_buf_p;
759     }
760
761
762 #ifdef YY_USE_PROTOS
763 YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
764 #else
765 YY_BUFFER_STATE yy_create_buffer( file, size )
766 FILE *file;
767 int size;
768 #endif
769
770     {
771     YY_BUFFER_STATE b;
772
773     b = (YY_BUFFER_STATE) malloc( sizeof( struct yy_buffer_state ) );
774
775     if ( ! b )
776         YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
777
778     b->yy_buf_size = size;
779
780     /* yy_ch_buf has to be 2 characters longer than the size given because
781      * we need to put in 2 end-of-buffer characters.
782      */
783     b->yy_ch_buf = (YY_CHAR *) malloc( (unsigned) (b->yy_buf_size + 2) );
784
785     if ( ! b->yy_ch_buf )
786         YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
787
788     yy_init_buffer( b, file );
789
790     return ( b );
791     }
792
793
794 #ifdef YY_USE_PROTOS
795 void yy_delete_buffer( YY_BUFFER_STATE b )
796 #else
797 void yy_delete_buffer( b )
798 YY_BUFFER_STATE b;
799 #endif
800
801     {
802     if ( b == yy_current_buffer )
803         yy_current_buffer = (YY_BUFFER_STATE) 0;
804
805     free( (char *) b->yy_ch_buf );
806     free( (char *) b );
807     }
808
809
810 #ifdef YY_USE_PROTOS
811 void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
812 #else
813 void yy_init_buffer( b, file )
814 YY_BUFFER_STATE b;
815 FILE *file;
816 #endif
817
818     {
819     b->yy_input_file = file;
820
821     /* we put in the '\n' and start reading from [1] so that an
822      * initial match-at-newline will be true.
823      */
824
825     b->yy_ch_buf[0] = '\n';
826     b->yy_n_chars = 1;
827
828     /* we always need two end-of-buffer characters.  The first causes
829      * a transition to the end-of-buffer state.  The second causes
830      * a jam in that state.
831      */
832     b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
833     b->yy_ch_buf[2] = YY_END_OF_BUFFER_CHAR;
834
835     b->yy_buf_pos = &b->yy_ch_buf[1];
836
837     b->yy_eof_status = EOF_NOT_SEEN;
838     }
839
840 #ifdef ACK_MOD
841 /* redefine yyless() so that it does not access local variables of YYDECL */
842
843 #undef yyless
844
845 /* return all but the first 'n' matched characters back to the input stream */
846 #define yyless(n) \
847         do \
848                 { \
849                 /* undo effects of setting up yytext */ \
850                 yytext[yyleng] = yy_hold_char; \
851                 yy_c_buf_p = yytext + n; \
852                 yy_hold_char = *yy_c_buf_p; \
853                 *yy_c_buf_p = '\0'; \
854                 yyleng = n; \
855                 } \
856         while ( 0 )
857
858 #endif /* ACK_MOD */