Debian Codegraph @

contrib/flex.skl

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