1 /* A lexical scanner generated by flex */
3 /* scanner skeleton version:
5 Last change: JS 13 Jul 97 6:17 pm
13 /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
42 /* use prototypes in function declarations */
45 /* the "const" storage-class-modifier is valid */
48 #else /* ! __cplusplus */
62 #endif /* ! __cplusplus */
76 #define YY_PROTO(proto) proto
78 #define YY_PROTO(proto) ()
79 /* we can't get here if it's an ANSI C compiler, or a C++ compiler,
80 * so it's got to be a K&R compiler, and therefore there's no standard
81 * place from which to include these definitions
92 /* amount of stuff to slurp up with each read */
93 #ifndef YY_READ_BUF_SIZE
94 #define YY_READ_BUF_SIZE 8192
97 /* returned upon end-of-file */
100 /* copy whatever the last rule matched to the standard output */
102 /* cast to (char *) is because for 8-bit chars, yytext is (unsigned char *) */
103 /* this used to be an fputs(), but since the string might contain NUL's,
104 * we now use fwrite()
106 #define ECHO (void) fwrite( (char *) yytext, yyleng, 1, yyout )
108 /* gets input and stuffs it into "buf". number of characters read, or YY_NULL,
109 * is returned in "result".
111 #define YY_INPUT(buf,result,max_size) \
112 if ( (result = read( fileno(yyin), (char *) buf, max_size )) < 0 ) \
113 YY_FATAL_ERROR( "read() in flex scanner failed" );
116 /* no semi-colon after return; correct usage is to write "yyterminate();" -
117 * we don't want an extra ';' after the "return" because that will cause
118 * some compilers to complain about unreachable statements.
120 #define yyterminate() return ( YY_NULL )
122 /* report a fatal error */
124 /* The funky do-while is used to turn this macro definition into
125 * a single C statement (which needs a semi-colon terminator).
126 * This avoids problems with code like:
128 * if ( something_happens )
129 * YY_FATAL_ERROR( "oops, the something happened" );
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 YY_FATAL_ERROR() call.
138 #if !defined(__VISAGECPP__)
139 #define YY_FATAL_ERROR(msg) \
142 (void) fputs( msg, stderr ); \
143 (void) putc( '\n', stderr ); \
148 // suppress expression always false warning
150 #define YY_FATAL_ERROR(msg) \
153 (void) fputs( msg, stderr ); \
154 (void) putc( '\n', stderr ); \
157 while ( os2var == 0 )
160 /* default yywrap function - always treat EOF as an EOF */
161 int yywrap(void) { return 1; }
164 /* enter a start condition. This macro really ought to take a parameter,
165 * but we do it the disgusting crufty way forced on us by the ()-less
166 * definition of BEGIN
168 #define BEGIN yy_start = 1 + 2 *
170 /* action number for EOF rule of a given start state */
171 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
173 /* special action meaning "start processing a new file" */
174 #if !defined(__VISAGECPP__)
175 #define YY_NEW_FILE \
178 yy_init_buffer( yy_current_buffer, yyin ); \
179 yy_load_buffer_state(); \
183 #define YY_NEW_FILE \
186 yy_init_buffer( yy_current_buffer, yyin ); \
187 yy_load_buffer_state(); \
189 while ( os2var == 0 )
192 /* default declaration of generated scanner - a define so the user can
193 * easily add parameters
195 #define YY_DECL int yylex YY_PROTO(( void ))
197 /* code executed at the end of each rule */
198 #define YY_BREAK break;
200 #define YY_END_OF_BUFFER_CHAR 0
203 #define YY_BUF_SIZE (YY_READ_BUF_SIZE * 2) /* size of default input buffer */
206 typedef struct yy_buffer_state
*YY_BUFFER_STATE
;
208 #define YY_CHAR unsigned char
214 * Description: Lexical analyser for PROLOGIO; can be used with
215 * either lex and flex.
219 /* +++steve162e: added, otherwise, PROIO_input will be undefined (at least under LINUX)
220 please check, if this is also TRUE under other UNIXes.
223 #if defined(FLEX_SCANNER) && defined(_LINUX)
224 #define PROIO_input my_input
230 extern char *malloc();
232 #define Return(x) return x;
234 #if defined(VMS) && ( __VMS_VER < 70000000 )
235 #define strdup(s) (strcpy((char *)malloc(strlen(s)+1), s));
238 static size_t lex_buffer_length
= 0;
239 static const char *lex_buffer
= NULL
;
240 static size_t lex_string_ptr
= 0;
241 static int lex_read_from_string
= 0;
243 static int my_input(void);
244 static int my_unput(char);
248 # define YY_INPUT(buf,result,max_size) \
249 if (lex_read_from_string) \
250 { int c = my_input(); result = (c == 0) ? YY_NULL : ((buf)[0]=(c), 1); } \
252 if ( (result = read( fileno(yyin), (char *) buf, max_size )) < 0 ) \
253 YY_FATAL_ERROR( "read() in flex scanner failed" );
256 # define unput(_c) my_unput(_c)
261 /* done after the current pattern has been matched and before the
262 * corresponding action - sets up yytext
264 #define YY_DO_BEFORE_ACTION \
266 yyleng = yy_cp - yy_bp; \
267 yy_hold_char = *yy_cp; \
271 #define EOB_ACT_CONTINUE_SCAN 0
272 #define EOB_ACT_END_OF_FILE 1
273 #define EOB_ACT_LAST_MATCH 2
275 /* return all but the first 'n' matched characters back to the input stream */
276 #if !defined(__VISAGECPP__)
280 /* undo effects of setting up yytext */ \
281 *yy_cp = yy_hold_char; \
282 yy_c_buf_p = yy_cp = yy_bp + n; \
283 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
290 /* undo effects of setting up yytext */ \
291 *yy_cp = yy_hold_char; \
292 yy_c_buf_p = yy_cp = yy_bp + n; \
293 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
295 while ( os2var == 0 )
299 #define unput(c) yyunput( c, yytext )
302 struct yy_buffer_state
306 YY_CHAR
*yy_ch_buf
; /* input buffer */
307 YY_CHAR
*yy_buf_pos
; /* current position in input buffer */
309 /* size of input buffer in bytes, not including room for EOB characters*/
312 /* number of characters read into yy_ch_buf, not including EOB characters */
315 int yy_eof_status
; /* whether we've seen an EOF on this buffer */
316 #define EOF_NOT_SEEN 0
317 /* "pending" happens when the EOF has been seen but there's still
320 #define EOF_PENDING 1
324 static YY_BUFFER_STATE yy_current_buffer
;
326 /* we provide macros for accessing buffer states in case in the
327 * future we want to put the buffer states in a more general
330 #define YY_CURRENT_BUFFER yy_current_buffer
333 /* yy_hold_char holds the character lost when yytext is formed */
334 static YY_CHAR yy_hold_char
;
336 static int yy_n_chars
; /* number of characters read into yy_ch_buf */
340 #ifndef YY_USER_ACTION
341 #define YY_USER_ACTION
348 extern YY_CHAR
*yytext
;
350 extern FILE *yyin
, *yyout
;
355 FILE *yyin
= (FILE *) 0, *yyout
= (FILE *) 0;
357 #define YY_END_OF_BUFFER 18
358 typedef int yy_state_type
;
359 static const short int yy_accept
[34] =
361 0, 0, 18, 16, 13, 14, 16, 16, 6, 7,
362 16, 8, 12, 16, 1, 11, 3, 9, 10, 2,
363 0, 5, 0, 0, 0, 4, 1, 15, 3, 5,
367 static const YY_CHAR yy_ec
[256] =
369 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
370 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
371 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
372 1, 2, 1, 4, 1, 1, 1, 1, 5, 6,
373 7, 8, 9, 10, 9, 11, 12, 13, 13, 13,
374 13, 13, 13, 13, 13, 13, 13, 1, 1, 1,
375 14, 1, 1, 1, 15, 15, 15, 15, 15, 15,
376 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
377 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
378 16, 17, 18, 1, 15, 1, 15, 15, 15, 15,
380 19, 15, 15, 15, 15, 15, 15, 15, 15, 15,
381 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
382 15, 15, 1, 20, 1, 1, 1, 1, 1, 1,
383 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
384 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
385 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
386 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
387 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
388 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
389 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
391 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
392 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
393 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
394 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
395 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
399 static const YY_CHAR yy_meta
[21] =
401 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
402 1, 1, 2, 1, 2, 1, 3, 1, 2, 1
405 static const short int yy_base
[37] =
407 0, 0, 48, 55, 55, 55, 17, 42, 55, 55,
408 19, 55, 55, 23, 17, 55, 0, 55, 55, 0,
409 18, 55, 19, 23, 21, 55, 12, 55, 0, 24,
410 25, 29, 55, 49, 52, 22
413 static const short int yy_def
[37] =
415 33, 1, 33, 33, 33, 33, 34, 35, 33, 33,
416 33, 33, 33, 33, 33, 33, 36, 33, 33, 36,
417 34, 33, 34, 34, 35, 33, 33, 33, 36, 34,
418 34, 34, 0, 33, 33, 33
421 static const short int yy_nxt
[76] =
423 4, 5, 6, 7, 8, 9, 10, 4, 11, 12,
424 13, 14, 15, 16, 17, 18, 4, 19, 20, 4,
425 22, 22, 30, 29, 27, 26, 22, 22, 30, 27,
426 28, 27, 30, 23, 23, 23, 24, 24, 24, 31,
427 23, 32, 24, 24, 24, 23, 26, 33, 24, 21,
428 21, 21, 25, 25, 3, 33, 33, 33, 33, 33,
429 33, 33, 33, 33, 33, 33, 33, 33, 33, 33,
433 static const short int yy_chk
[76] =
435 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
436 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
437 7, 21, 23, 36, 27, 25, 24, 30, 31, 15,
438 14, 11, 32, 7, 21, 23, 7, 21, 23, 24,
439 30, 31, 24, 30, 31, 32, 8, 3, 32, 34,
440 34, 34, 35, 35, 33, 33, 33, 33, 33, 33,
441 33, 33, 33, 33, 33, 33, 33, 33, 33, 33,
445 static yy_state_type yy_last_accepting_state
;
446 static YY_CHAR
*yy_last_accepting_cpos
;
448 /* the intent behind this definition is that it'll catch
449 * any uses of REJECT which flex missed
451 #define REJECT reject_used_but_not_detected
452 #define yymore() yymore_used_but_not_detected
453 #define YY_MORE_ADJ 0
455 /* these variables are all declared out here so that section 3 code can
458 /* points to current character in buffer */
459 static YY_CHAR
*yy_c_buf_p
= (YY_CHAR
*) 0;
460 static int yy_init
= 1; /* whether we need to initialize */
461 static int yy_start
= 0; /* start state number */
463 /* flag which is used to allow yywrap()'s to do buffer switches
464 * instead of setting up a fresh yyin. A bit of a hack ...
466 static int yy_did_buffer_switch_on_eof
;
468 static yy_state_type yy_get_previous_state
YY_PROTO(( void ));
469 static yy_state_type yy_try_NUL_trans
YY_PROTO(( yy_state_type current_state
));
470 static int yy_get_next_buffer
YY_PROTO(( void ));
471 static void yyunput
YY_PROTO(( YY_CHAR c
, YY_CHAR
*buf_ptr
));
472 void yyrestart
YY_PROTO(( FILE *input_file
));
473 void yy_switch_to_buffer
YY_PROTO(( YY_BUFFER_STATE new_buffer
));
474 void yy_load_buffer_state
YY_PROTO(( void ));
475 YY_BUFFER_STATE yy_create_buffer
YY_PROTO(( FILE *file
, int size
));
476 void yy_delete_buffer
YY_PROTO(( YY_BUFFER_STATE b
));
477 void yy_init_buffer
YY_PROTO(( YY_BUFFER_STATE b
, FILE *file
));
479 #define yy_new_buffer yy_create_buffer
482 static int yyinput
YY_PROTO(( void ));
484 static int input
YY_PROTO(( void ));
489 register yy_state_type yy_current_state
;
490 register YY_CHAR
*yy_cp
, *yy_bp
;
501 yy_start
= 1; /* first start state */
509 if ( yy_current_buffer
)
510 yy_init_buffer( yy_current_buffer
, yyin
);
512 yy_current_buffer
= yy_create_buffer( yyin
, YY_BUF_SIZE
);
514 yy_load_buffer_state();
519 #if !defined(__VISAGECPP__)
520 while ( 1 ) /* loops until end-of-file is reached */
523 if (os2var
== 0) return 0;
524 while ( os2var
== 1 ) /* loops until end-of-file is reached */
529 /* support of yytext */
530 *yy_cp
= yy_hold_char
;
532 /* yy_bp points to the position in yy_ch_buf of the start of the
537 yy_current_state
= yy_start
;
541 register YY_CHAR yy_c
= yy_ec
[*yy_cp
];
542 if ( yy_accept
[yy_current_state
] )
544 yy_last_accepting_state
= yy_current_state
;
545 yy_last_accepting_cpos
= yy_cp
;
547 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
549 yy_current_state
= yy_def
[yy_current_state
];
550 if ( yy_current_state
>= 34 )
551 yy_c
= yy_meta
[yy_c
];
553 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + yy_c
];
556 while ( yy_current_state
!= 33 );
557 yy_cp
= yy_last_accepting_cpos
;
558 yy_current_state
= yy_last_accepting_state
;
561 yy_act
= yy_accept
[yy_current_state
];
566 do_action
: /* this label is used only to access EOF actions */
571 case 0: /* must backtrack */
572 /* undo the effects of YY_DO_BEFORE_ACTION */
573 *yy_cp
= yy_hold_char
;
574 yy_cp
= yy_last_accepting_cpos
;
575 yy_current_state
= yy_last_accepting_state
;
580 {yylval
.s
= strdup((const char*) yytext
); Return(INTEGER
);}
588 {yylval
.s
= strdup((const char*) yytext
); Return(WORD
);}
592 {int len
= strlen((const char*) yytext
);
594 yylval
.s
= strdup((const char*) (yytext
+1));
599 {yylval
.s
= strdup((const char*) yytext
); Return(STRING
);}
619 Return(CLOSE_SQUARE
);
641 while (yyinput() != '*');
644 while (input() != '*');
649 case '*': unput('*');
662 case YY_STATE_EOF(INITIAL
):
665 case YY_END_OF_BUFFER
:
667 /* amount of text matched not including the EOB char */
668 int yy_amount_of_matched_text
= yy_cp
- yytext
- 1;
670 /* undo the effects of YY_DO_BEFORE_ACTION */
671 *yy_cp
= yy_hold_char
;
673 /* note that here we test for yy_c_buf_p "<=" to the position
674 * of the first EOB in the buffer, since yy_c_buf_p will
675 * already have been incremented past the NUL character
676 * (since all states make transitions on EOB to the end-
677 * of-buffer state). Contrast this with the test in yyinput().
679 if ( yy_c_buf_p
<= &yy_current_buffer
->yy_ch_buf
[yy_n_chars
] )
680 /* this was really a NUL */
682 yy_state_type yy_next_state
;
684 yy_c_buf_p
= yytext
+ yy_amount_of_matched_text
;
686 yy_current_state
= yy_get_previous_state();
688 /* okay, we're now positioned to make the
689 * NUL transition. We couldn't have
690 * yy_get_previous_state() go ahead and do it
691 * for us because it doesn't know how to deal
692 * with the possibility of jamming (and we
693 * don't want to build jamming into it because
694 * then it will run more slowly)
697 yy_next_state
= yy_try_NUL_trans( yy_current_state
);
699 yy_bp
= yytext
+ YY_MORE_ADJ
;
703 /* consume the NUL */
704 yy_cp
= ++yy_c_buf_p
;
705 yy_current_state
= yy_next_state
;
711 yy_cp
= yy_last_accepting_cpos
;
712 yy_current_state
= yy_last_accepting_state
;
717 else switch ( yy_get_next_buffer() )
719 case EOB_ACT_END_OF_FILE
:
721 yy_did_buffer_switch_on_eof
= 0;
725 /* note: because we've taken care in
726 * yy_get_next_buffer() to have set up yytext,
727 * we can now set up yy_c_buf_p so that if some
728 * total hoser (like flex itself) wants
729 * to call the scanner after we return the
730 * YY_NULL, it'll still work - another YY_NULL
733 yy_c_buf_p
= yytext
+ YY_MORE_ADJ
;
735 yy_act
= YY_STATE_EOF((yy_start
- 1) / 2);
741 if ( ! yy_did_buffer_switch_on_eof
)
747 case EOB_ACT_CONTINUE_SCAN
:
748 yy_c_buf_p
= yytext
+ yy_amount_of_matched_text
;
750 yy_current_state
= yy_get_previous_state();
753 yy_bp
= yytext
+ YY_MORE_ADJ
;
756 case EOB_ACT_LAST_MATCH
:
758 &yy_current_buffer
->yy_ch_buf
[yy_n_chars
];
760 yy_current_state
= yy_get_previous_state();
763 yy_bp
= yytext
+ YY_MORE_ADJ
;
771 printf( "action # %d\n", yy_act
);
774 "fatal flex scanner internal error--no action found" );
777 #if defined(__VISAGECPP__)
778 // VA complains about proc maybe not returning a value so return one
784 /* yy_get_next_buffer - try to read in a new buffer
787 * int yy_get_next_buffer();
789 * returns a code representing an action
790 * EOB_ACT_LAST_MATCH -
791 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
792 * EOB_ACT_END_OF_FILE - end of file
795 static int yy_get_next_buffer()
798 register YY_CHAR
*dest
= yy_current_buffer
->yy_ch_buf
;
799 register YY_CHAR
*source
= yytext
- 1; /* copy prev. char, too */
800 register int number_to_move
, i
;
803 if ( yy_c_buf_p
> &yy_current_buffer
->yy_ch_buf
[yy_n_chars
+ 1] )
805 "fatal flex scanner internal error--end of buffer missed" );
807 /* try to read more data */
809 /* first move last chars to start of buffer */
810 number_to_move
= yy_c_buf_p
- yytext
;
812 for ( i
= 0; i
< number_to_move
; ++i
)
813 *(dest
++) = *(source
++);
815 if ( yy_current_buffer
->yy_eof_status
!= EOF_NOT_SEEN
)
816 /* don't do the read, it's not guaranteed to return an EOF,
823 int num_to_read
= yy_current_buffer
->yy_buf_size
- number_to_move
- 1;
825 if ( num_to_read
> YY_READ_BUF_SIZE
)
826 num_to_read
= YY_READ_BUF_SIZE
;
828 else if ( num_to_read
<= 0 )
829 YY_FATAL_ERROR( "fatal error - scanner input buffer overflow" );
831 /* read in more data */
832 YY_INPUT( (&yy_current_buffer
->yy_ch_buf
[number_to_move
]),
833 yy_n_chars
, num_to_read
);
836 if ( yy_n_chars
== 0 )
838 if ( number_to_move
== 1 )
840 ret_val
= EOB_ACT_END_OF_FILE
;
841 yy_current_buffer
->yy_eof_status
= EOF_DONE
;
846 ret_val
= EOB_ACT_LAST_MATCH
;
847 yy_current_buffer
->yy_eof_status
= EOF_PENDING
;
852 ret_val
= EOB_ACT_CONTINUE_SCAN
;
854 yy_n_chars
+= number_to_move
;
855 yy_current_buffer
->yy_ch_buf
[yy_n_chars
] = YY_END_OF_BUFFER_CHAR
;
856 yy_current_buffer
->yy_ch_buf
[yy_n_chars
+ 1] = YY_END_OF_BUFFER_CHAR
;
858 /* yytext begins at the second character in yy_ch_buf; the first
859 * character is the one which preceded it before reading in the latest
860 * buffer; it needs to be kept around in case it's a newline, so
861 * yy_get_previous_state() will have with '^' rules active
864 yytext
= &yy_current_buffer
->yy_ch_buf
[1];
870 /* yy_get_previous_state - get the state just before the EOB char was reached
873 * yy_state_type yy_get_previous_state();
876 static yy_state_type
yy_get_previous_state()
879 register yy_state_type yy_current_state
;
880 register YY_CHAR
*yy_cp
;
882 yy_current_state
= yy_start
;
884 for ( yy_cp
= yytext
+ YY_MORE_ADJ
; yy_cp
< yy_c_buf_p
; ++yy_cp
)
886 register YY_CHAR yy_c
= (*yy_cp
? yy_ec
[*yy_cp
] : 1);
887 if ( yy_accept
[yy_current_state
] )
889 yy_last_accepting_state
= yy_current_state
;
890 yy_last_accepting_cpos
= yy_cp
;
892 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
894 yy_current_state
= yy_def
[yy_current_state
];
895 if ( yy_current_state
>= 34 )
896 yy_c
= yy_meta
[yy_c
];
898 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + yy_c
];
901 return ( yy_current_state
);
905 /* yy_try_NUL_trans - try to make a transition on the NUL character
908 * next_state = yy_try_NUL_trans( current_state );
912 static yy_state_type
yy_try_NUL_trans( register yy_state_type yy_current_state
)
914 static yy_state_type
yy_try_NUL_trans( yy_current_state
)
915 register yy_state_type yy_current_state
;
919 register int yy_is_jam
;
920 register YY_CHAR
*yy_cp
= yy_c_buf_p
;
922 register YY_CHAR yy_c
= 1;
923 if ( yy_accept
[yy_current_state
] )
925 yy_last_accepting_state
= yy_current_state
;
926 yy_last_accepting_cpos
= yy_cp
;
928 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
930 yy_current_state
= yy_def
[yy_current_state
];
931 if ( yy_current_state
>= 34 )
932 yy_c
= yy_meta
[yy_c
];
934 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + yy_c
];
935 yy_is_jam
= (yy_current_state
== 33);
937 return ( yy_is_jam
? 0 : yy_current_state
);
942 static void yyunput( YY_CHAR c
, register YY_CHAR
*yy_bp
)
944 static void yyunput( c
, yy_bp
)
946 register YY_CHAR
*yy_bp
;
950 register YY_CHAR
*yy_cp
= yy_c_buf_p
;
952 /* undo effects of setting up yytext */
953 *yy_cp
= yy_hold_char
;
955 if ( yy_cp
< yy_current_buffer
->yy_ch_buf
+ 2 )
956 { /* need to shift things up to make room */
957 register int number_to_move
= yy_n_chars
+ 2; /* +2 for EOB chars */
958 register YY_CHAR
*dest
=
959 &yy_current_buffer
->yy_ch_buf
[yy_current_buffer
->yy_buf_size
+ 2];
960 register YY_CHAR
*source
=
961 &yy_current_buffer
->yy_ch_buf
[number_to_move
];
963 while ( source
> yy_current_buffer
->yy_ch_buf
)
966 yy_cp
+= dest
- source
;
967 yy_bp
+= dest
- source
;
968 yy_n_chars
= yy_current_buffer
->yy_buf_size
;
970 if ( yy_cp
< yy_current_buffer
->yy_ch_buf
+ 2 )
971 YY_FATAL_ERROR( "flex scanner push-back overflow" );
974 if ( yy_cp
> yy_bp
&& yy_cp
[-1] == '\n' )
979 /* note: the formal parameter *must* be called "yy_bp" for this
980 * macro to now work correctly
982 YY_DO_BEFORE_ACTION
; /* set up yytext again */
994 YY_CHAR
*yy_cp
= yy_c_buf_p
;
996 *yy_cp
= yy_hold_char
;
998 if ( *yy_c_buf_p
== YY_END_OF_BUFFER_CHAR
)
1000 /* yy_c_buf_p now points to the character we want to return.
1001 * If this occurs *before* the EOB characters, then it's a
1002 * valid NUL; if not, then we've hit the end of the buffer.
1004 if ( yy_c_buf_p
< &yy_current_buffer
->yy_ch_buf
[yy_n_chars
] )
1005 /* this was really a NUL */
1009 { /* need more input */
1010 yytext
= yy_c_buf_p
;
1013 switch ( yy_get_next_buffer() )
1015 case EOB_ACT_END_OF_FILE
:
1019 yy_c_buf_p
= yytext
+ YY_MORE_ADJ
;
1026 return ( yyinput() );
1033 case EOB_ACT_CONTINUE_SCAN
:
1034 yy_c_buf_p
= yytext
+ YY_MORE_ADJ
;
1037 case EOB_ACT_LAST_MATCH
:
1039 YY_FATAL_ERROR( "unexpected last match in yyinput()" );
1041 YY_FATAL_ERROR( "unexpected last match in input()" );
1048 yy_hold_char
= *++yy_c_buf_p
;
1054 #ifdef YY_USE_PROTOS
1055 void yyrestart( FILE *input_file
)
1057 void yyrestart( input_file
)
1062 yy_init_buffer( yy_current_buffer
, input_file
);
1063 yy_load_buffer_state();
1067 #ifdef YY_USE_PROTOS
1068 void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer
)
1070 void yy_switch_to_buffer( new_buffer
)
1071 YY_BUFFER_STATE new_buffer
;
1075 if ( yy_current_buffer
== new_buffer
)
1078 if ( yy_current_buffer
)
1080 /* flush out information for old buffer */
1081 *yy_c_buf_p
= yy_hold_char
;
1082 yy_current_buffer
->yy_buf_pos
= yy_c_buf_p
;
1083 yy_current_buffer
->yy_n_chars
= yy_n_chars
;
1086 yy_current_buffer
= new_buffer
;
1087 yy_load_buffer_state();
1089 /* we don't actually know whether we did this switch during
1090 * EOF (yywrap()) processing, but the only time this flag
1091 * is looked at is after yywrap() is called, so it's safe
1092 * to go ahead and always set it.
1094 yy_did_buffer_switch_on_eof
= 1;
1098 #ifdef YY_USE_PROTOS
1099 void yy_load_buffer_state( void )
1101 void yy_load_buffer_state()
1105 yy_n_chars
= yy_current_buffer
->yy_n_chars
;
1106 yytext
= yy_c_buf_p
= yy_current_buffer
->yy_buf_pos
;
1107 yyin
= yy_current_buffer
->yy_input_file
;
1108 yy_hold_char
= *yy_c_buf_p
;
1112 #ifdef YY_USE_PROTOS
1113 YY_BUFFER_STATE
yy_create_buffer( FILE *file
, int size
)
1115 YY_BUFFER_STATE
yy_create_buffer( file
, size
)
1123 b
= (YY_BUFFER_STATE
) malloc( sizeof( struct yy_buffer_state
) );
1126 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1128 b
->yy_buf_size
= size
;
1130 /* yy_ch_buf has to be 2 characters longer than the size given because
1131 * we need to put in 2 end-of-buffer characters.
1133 b
->yy_ch_buf
= (YY_CHAR
*) malloc( (unsigned) (b
->yy_buf_size
+ 2) );
1135 if ( ! b
->yy_ch_buf
)
1136 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1138 yy_init_buffer( b
, file
);
1144 #ifdef YY_USE_PROTOS
1145 void yy_delete_buffer( YY_BUFFER_STATE b
)
1147 void yy_delete_buffer( b
)
1152 if ( b
== yy_current_buffer
)
1153 yy_current_buffer
= (YY_BUFFER_STATE
) 0;
1155 free( (char *) b
->yy_ch_buf
);
1160 #ifdef YY_USE_PROTOS
1161 void yy_init_buffer( YY_BUFFER_STATE b
, FILE *file
)
1163 void yy_init_buffer( b
, file
)
1169 b
->yy_input_file
= file
;
1171 /* we put in the '\n' and start reading from [1] so that an
1172 * initial match-at-newline will be true.
1175 b
->yy_ch_buf
[0] = '\n';
1178 /* we always need two end-of-buffer characters. The first causes
1179 * a transition to the end-of-buffer state. The second causes
1180 * a jam in that state.
1182 b
->yy_ch_buf
[1] = YY_END_OF_BUFFER_CHAR
;
1183 b
->yy_ch_buf
[2] = YY_END_OF_BUFFER_CHAR
;
1185 b
->yy_buf_pos
= &b
->yy_ch_buf
[1];
1187 b
->yy_eof_status
= EOF_NOT_SEEN
;
1189 # line 108 "lexer.l"
1194 static int lex_input() {
1197 #else /* BSD/AT&T lex */
1199 # error "Sorry, but need either flex or AT&T lex"
1201 static int lex_input() {
1205 # define unput(_c) my_unput(_c)
1209 # define input() my_input()
1210 static int my_unput(char c
)
1212 if (lex_read_from_string
) {
1213 /* Make sure we have something */
1214 if (lex_string_ptr
) {
1215 if (c
== '\n') yylineno
--;
1219 yytchar
= (c
);if(yytchar
=='\n')yylineno
--;*yysptr
++=yytchar
;
1220 /* unput(c); Causes infinite recursion! */
1228 void LexFromFile(FILE *fd
)
1230 lex_read_from_string
= 0;
1232 /* Don't know why this is necessary, but otherwise
1233 * lex only works _once_!
1240 void LexFromString(char *buffer
)
1242 lex_read_from_string
= 1;
1243 lex_buffer
= buffer
;
1244 lex_buffer_length
= strlen((const char*) buffer
);
1246 /* Don't know why this is necessary, but otherwise
1247 * lex only works _once_!
1254 static int my_input( void )
1256 if (lex_read_from_string
) {
1257 if (lex_string_ptr
== lex_buffer_length
)
1260 char c
= lex_buffer
[lex_string_ptr
++];
1261 #ifndef FLEX_SCANNER
1262 if (c
== '\n') yylineno
++;
1271 void wxExprCleanUp()
1273 if (yy_current_buffer
)
1274 yy_delete_buffer(yy_current_buffer
);