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" );
258 # define unput(_c) my_unput(_c)
263 /* done after the current pattern has been matched and before the
264 * corresponding action - sets up yytext
266 #define YY_DO_BEFORE_ACTION \
268 yyleng = yy_cp - yy_bp; \
269 yy_hold_char = *yy_cp; \
273 #define EOB_ACT_CONTINUE_SCAN 0
274 #define EOB_ACT_END_OF_FILE 1
275 #define EOB_ACT_LAST_MATCH 2
277 /* return all but the first 'n' matched characters back to the input stream */
278 #if !defined(__VISAGECPP__)
282 /* undo effects of setting up yytext */ \
283 *yy_cp = yy_hold_char; \
284 yy_c_buf_p = yy_cp = yy_bp + n; \
285 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
292 /* undo effects of setting up yytext */ \
293 *yy_cp = yy_hold_char; \
294 yy_c_buf_p = yy_cp = yy_bp + n; \
295 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
297 while ( os2var == 0 )
301 #define unput(c) yyunput( c, yytext )
304 struct yy_buffer_state
308 YY_CHAR
*yy_ch_buf
; /* input buffer */
309 YY_CHAR
*yy_buf_pos
; /* current position in input buffer */
311 /* size of input buffer in bytes, not including room for EOB characters*/
314 /* number of characters read into yy_ch_buf, not including EOB characters */
317 int yy_eof_status
; /* whether we've seen an EOF on this buffer */
318 #define EOF_NOT_SEEN 0
319 /* "pending" happens when the EOF has been seen but there's still
322 #define EOF_PENDING 1
326 static YY_BUFFER_STATE yy_current_buffer
;
328 /* we provide macros for accessing buffer states in case in the
329 * future we want to put the buffer states in a more general
332 #define YY_CURRENT_BUFFER yy_current_buffer
335 /* yy_hold_char holds the character lost when yytext is formed */
336 static YY_CHAR yy_hold_char
;
338 static int yy_n_chars
; /* number of characters read into yy_ch_buf */
342 #ifndef YY_USER_ACTION
343 #define YY_USER_ACTION
350 extern YY_CHAR
*yytext
;
352 extern FILE *yyin
, *yyout
;
357 FILE *yyin
= (FILE *) 0, *yyout
= (FILE *) 0;
359 #define YY_END_OF_BUFFER 18
360 typedef int yy_state_type
;
361 static const short int yy_accept
[34] =
363 0, 0, 18, 16, 13, 14, 16, 16, 6, 7,
364 16, 8, 12, 16, 1, 11, 3, 9, 10, 2,
365 0, 5, 0, 0, 0, 4, 1, 15, 3, 5,
369 static const YY_CHAR yy_ec
[256] =
371 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
372 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
373 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
374 1, 2, 1, 4, 1, 1, 1, 1, 5, 6,
375 7, 8, 9, 10, 9, 11, 12, 13, 13, 13,
376 13, 13, 13, 13, 13, 13, 13, 1, 1, 1,
377 14, 1, 1, 1, 15, 15, 15, 15, 15, 15,
378 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
379 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
380 16, 17, 18, 1, 15, 1, 15, 15, 15, 15,
382 19, 15, 15, 15, 15, 15, 15, 15, 15, 15,
383 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
384 15, 15, 1, 20, 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,
390 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
391 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,
396 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
397 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
401 static const YY_CHAR yy_meta
[21] =
403 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
404 1, 1, 2, 1, 2, 1, 3, 1, 2, 1
407 static const short int yy_base
[37] =
409 0, 0, 48, 55, 55, 55, 17, 42, 55, 55,
410 19, 55, 55, 23, 17, 55, 0, 55, 55, 0,
411 18, 55, 19, 23, 21, 55, 12, 55, 0, 24,
412 25, 29, 55, 49, 52, 22
415 static const short int yy_def
[37] =
417 33, 1, 33, 33, 33, 33, 34, 35, 33, 33,
418 33, 33, 33, 33, 33, 33, 36, 33, 33, 36,
419 34, 33, 34, 34, 35, 33, 33, 33, 36, 34,
420 34, 34, 0, 33, 33, 33
423 static const short int yy_nxt
[76] =
425 4, 5, 6, 7, 8, 9, 10, 4, 11, 12,
426 13, 14, 15, 16, 17, 18, 4, 19, 20, 4,
427 22, 22, 30, 29, 27, 26, 22, 22, 30, 27,
428 28, 27, 30, 23, 23, 23, 24, 24, 24, 31,
429 23, 32, 24, 24, 24, 23, 26, 33, 24, 21,
430 21, 21, 25, 25, 3, 33, 33, 33, 33, 33,
431 33, 33, 33, 33, 33, 33, 33, 33, 33, 33,
435 static const short int yy_chk
[76] =
437 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
438 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
439 7, 21, 23, 36, 27, 25, 24, 30, 31, 15,
440 14, 11, 32, 7, 21, 23, 7, 21, 23, 24,
441 30, 31, 24, 30, 31, 32, 8, 3, 32, 34,
442 34, 34, 35, 35, 33, 33, 33, 33, 33, 33,
443 33, 33, 33, 33, 33, 33, 33, 33, 33, 33,
447 static yy_state_type yy_last_accepting_state
;
448 static YY_CHAR
*yy_last_accepting_cpos
;
450 /* the intent behind this definition is that it'll catch
451 * any uses of REJECT which flex missed
453 #define REJECT reject_used_but_not_detected
454 #define yymore() yymore_used_but_not_detected
455 #define YY_MORE_ADJ 0
457 /* these variables are all declared out here so that section 3 code can
460 /* points to current character in buffer */
461 static YY_CHAR
*yy_c_buf_p
= (YY_CHAR
*) 0;
462 static int yy_init
= 1; /* whether we need to initialize */
463 static int yy_start
= 0; /* start state number */
465 /* flag which is used to allow yywrap()'s to do buffer switches
466 * instead of setting up a fresh yyin. A bit of a hack ...
468 static int yy_did_buffer_switch_on_eof
;
470 static yy_state_type yy_get_previous_state
YY_PROTO(( void ));
471 static yy_state_type yy_try_NUL_trans
YY_PROTO(( yy_state_type current_state
));
472 static int yy_get_next_buffer
YY_PROTO(( void ));
473 static void yyunput
YY_PROTO(( YY_CHAR c
, YY_CHAR
*buf_ptr
));
474 void yyrestart
YY_PROTO(( FILE *input_file
));
475 void yy_switch_to_buffer
YY_PROTO(( YY_BUFFER_STATE new_buffer
));
476 void yy_load_buffer_state
YY_PROTO(( void ));
477 YY_BUFFER_STATE yy_create_buffer
YY_PROTO(( FILE *file
, int size
));
478 void yy_delete_buffer
YY_PROTO(( YY_BUFFER_STATE b
));
479 void yy_init_buffer
YY_PROTO(( YY_BUFFER_STATE b
, FILE *file
));
481 #define yy_new_buffer yy_create_buffer
484 static int yyinput
YY_PROTO(( void ));
486 static int input
YY_PROTO(( void ));
491 register yy_state_type yy_current_state
;
492 register YY_CHAR
*yy_cp
, *yy_bp
;
503 yy_start
= 1; /* first start state */
511 if ( yy_current_buffer
)
512 yy_init_buffer( yy_current_buffer
, yyin
);
514 yy_current_buffer
= yy_create_buffer( yyin
, YY_BUF_SIZE
);
516 yy_load_buffer_state();
521 #if !defined(__VISAGECPP__)
522 while ( 1 ) /* loops until end-of-file is reached */
525 if (os2var
== 0) return 0;
526 while ( os2var
== 1 ) /* loops until end-of-file is reached */
531 /* support of yytext */
532 *yy_cp
= yy_hold_char
;
534 /* yy_bp points to the position in yy_ch_buf of the start of the
539 yy_current_state
= yy_start
;
543 register YY_CHAR yy_c
= yy_ec
[*yy_cp
];
544 if ( yy_accept
[yy_current_state
] )
546 yy_last_accepting_state
= yy_current_state
;
547 yy_last_accepting_cpos
= yy_cp
;
549 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
551 yy_current_state
= yy_def
[yy_current_state
];
552 if ( yy_current_state
>= 34 )
553 yy_c
= yy_meta
[yy_c
];
555 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + yy_c
];
558 while ( yy_current_state
!= 33 );
559 yy_cp
= yy_last_accepting_cpos
;
560 yy_current_state
= yy_last_accepting_state
;
563 yy_act
= yy_accept
[yy_current_state
];
568 do_action
: /* this label is used only to access EOF actions */
573 case 0: /* must backtrack */
574 /* undo the effects of YY_DO_BEFORE_ACTION */
575 *yy_cp
= yy_hold_char
;
576 yy_cp
= yy_last_accepting_cpos
;
577 yy_current_state
= yy_last_accepting_state
;
582 {yylval
.s
= strdup((const char*) yytext
); Return(INTEGER
);}
590 {yylval
.s
= strdup((const char*) yytext
); Return(WORD
);}
594 {int len
= strlen((const char*) yytext
);
596 yylval
.s
= strdup((const char*) (yytext
+1));
601 {yylval
.s
= strdup((const char*) yytext
); Return(STRING
);}
621 Return(CLOSE_SQUARE
);
643 while (yyinput() != '*');
646 while (input() != '*');
651 case '*': unput('*');
664 case YY_STATE_EOF(INITIAL
):
667 case YY_END_OF_BUFFER
:
669 /* amount of text matched not including the EOB char */
670 int yy_amount_of_matched_text
= yy_cp
- yytext
- 1;
672 /* undo the effects of YY_DO_BEFORE_ACTION */
673 *yy_cp
= yy_hold_char
;
675 /* note that here we test for yy_c_buf_p "<=" to the position
676 * of the first EOB in the buffer, since yy_c_buf_p will
677 * already have been incremented past the NUL character
678 * (since all states make transitions on EOB to the end-
679 * of-buffer state). Contrast this with the test in yyinput().
681 if ( yy_c_buf_p
<= &yy_current_buffer
->yy_ch_buf
[yy_n_chars
] )
682 /* this was really a NUL */
684 yy_state_type yy_next_state
;
686 yy_c_buf_p
= yytext
+ yy_amount_of_matched_text
;
688 yy_current_state
= yy_get_previous_state();
690 /* okay, we're now positioned to make the
691 * NUL transition. We couldn't have
692 * yy_get_previous_state() go ahead and do it
693 * for us because it doesn't know how to deal
694 * with the possibility of jamming (and we
695 * don't want to build jamming into it because
696 * then it will run more slowly)
699 yy_next_state
= yy_try_NUL_trans( yy_current_state
);
701 yy_bp
= yytext
+ YY_MORE_ADJ
;
705 /* consume the NUL */
706 yy_cp
= ++yy_c_buf_p
;
707 yy_current_state
= yy_next_state
;
713 yy_cp
= yy_last_accepting_cpos
;
714 yy_current_state
= yy_last_accepting_state
;
719 else switch ( yy_get_next_buffer() )
721 case EOB_ACT_END_OF_FILE
:
723 yy_did_buffer_switch_on_eof
= 0;
727 /* note: because we've taken care in
728 * yy_get_next_buffer() to have set up yytext,
729 * we can now set up yy_c_buf_p so that if some
730 * total hoser (like flex itself) wants
731 * to call the scanner after we return the
732 * YY_NULL, it'll still work - another YY_NULL
735 yy_c_buf_p
= yytext
+ YY_MORE_ADJ
;
737 yy_act
= YY_STATE_EOF((yy_start
- 1) / 2);
743 if ( ! yy_did_buffer_switch_on_eof
)
749 case EOB_ACT_CONTINUE_SCAN
:
750 yy_c_buf_p
= yytext
+ yy_amount_of_matched_text
;
752 yy_current_state
= yy_get_previous_state();
755 yy_bp
= yytext
+ YY_MORE_ADJ
;
758 case EOB_ACT_LAST_MATCH
:
760 &yy_current_buffer
->yy_ch_buf
[yy_n_chars
];
762 yy_current_state
= yy_get_previous_state();
765 yy_bp
= yytext
+ YY_MORE_ADJ
;
773 printf( "action # %d\n", yy_act
);
776 "fatal flex scanner internal error--no action found" );
779 #if defined(__VISAGECPP__)
780 /* VA complains about proc maybe not returning a value so return one */
786 /* yy_get_next_buffer - try to read in a new buffer
789 * int yy_get_next_buffer();
791 * returns a code representing an action
792 * EOB_ACT_LAST_MATCH -
793 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
794 * EOB_ACT_END_OF_FILE - end of file
797 static int yy_get_next_buffer()
800 register YY_CHAR
*dest
= yy_current_buffer
->yy_ch_buf
;
801 register YY_CHAR
*source
= yytext
- 1; /* copy prev. char, too */
802 register int number_to_move
, i
;
805 if ( yy_c_buf_p
> &yy_current_buffer
->yy_ch_buf
[yy_n_chars
+ 1] )
807 "fatal flex scanner internal error--end of buffer missed" );
809 /* try to read more data */
811 /* first move last chars to start of buffer */
812 number_to_move
= yy_c_buf_p
- yytext
;
814 for ( i
= 0; i
< number_to_move
; ++i
)
815 *(dest
++) = *(source
++);
817 if ( yy_current_buffer
->yy_eof_status
!= EOF_NOT_SEEN
)
818 /* don't do the read, it's not guaranteed to return an EOF,
825 int num_to_read
= yy_current_buffer
->yy_buf_size
- number_to_move
- 1;
827 if ( num_to_read
> YY_READ_BUF_SIZE
)
828 num_to_read
= YY_READ_BUF_SIZE
;
830 else if ( num_to_read
<= 0 )
831 YY_FATAL_ERROR( "fatal error - scanner input buffer overflow" );
833 /* read in more data */
834 YY_INPUT( (&yy_current_buffer
->yy_ch_buf
[number_to_move
]),
835 yy_n_chars
, num_to_read
);
838 if ( yy_n_chars
== 0 )
840 if ( number_to_move
== 1 )
842 ret_val
= EOB_ACT_END_OF_FILE
;
843 yy_current_buffer
->yy_eof_status
= EOF_DONE
;
848 ret_val
= EOB_ACT_LAST_MATCH
;
849 yy_current_buffer
->yy_eof_status
= EOF_PENDING
;
854 ret_val
= EOB_ACT_CONTINUE_SCAN
;
856 yy_n_chars
+= number_to_move
;
857 yy_current_buffer
->yy_ch_buf
[yy_n_chars
] = YY_END_OF_BUFFER_CHAR
;
858 yy_current_buffer
->yy_ch_buf
[yy_n_chars
+ 1] = YY_END_OF_BUFFER_CHAR
;
860 /* yytext begins at the second character in yy_ch_buf; the first
861 * character is the one which preceded it before reading in the latest
862 * buffer; it needs to be kept around in case it's a newline, so
863 * yy_get_previous_state() will have with '^' rules active
866 yytext
= &yy_current_buffer
->yy_ch_buf
[1];
872 /* yy_get_previous_state - get the state just before the EOB char was reached
875 * yy_state_type yy_get_previous_state();
878 static yy_state_type
yy_get_previous_state()
881 register yy_state_type yy_current_state
;
882 register YY_CHAR
*yy_cp
;
884 yy_current_state
= yy_start
;
886 for ( yy_cp
= yytext
+ YY_MORE_ADJ
; yy_cp
< yy_c_buf_p
; ++yy_cp
)
888 register YY_CHAR yy_c
= (*yy_cp
? yy_ec
[*yy_cp
] : 1);
889 if ( yy_accept
[yy_current_state
] )
891 yy_last_accepting_state
= yy_current_state
;
892 yy_last_accepting_cpos
= yy_cp
;
894 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
896 yy_current_state
= yy_def
[yy_current_state
];
897 if ( yy_current_state
>= 34 )
898 yy_c
= yy_meta
[yy_c
];
900 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + yy_c
];
903 return ( yy_current_state
);
907 /* yy_try_NUL_trans - try to make a transition on the NUL character
910 * next_state = yy_try_NUL_trans( current_state );
914 static yy_state_type
yy_try_NUL_trans( register yy_state_type yy_current_state
)
916 static yy_state_type
yy_try_NUL_trans( yy_current_state
)
917 register yy_state_type yy_current_state
;
921 register int yy_is_jam
;
922 register YY_CHAR
*yy_cp
= yy_c_buf_p
;
924 register YY_CHAR yy_c
= 1;
925 if ( yy_accept
[yy_current_state
] )
927 yy_last_accepting_state
= yy_current_state
;
928 yy_last_accepting_cpos
= yy_cp
;
930 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
932 yy_current_state
= yy_def
[yy_current_state
];
933 if ( yy_current_state
>= 34 )
934 yy_c
= yy_meta
[yy_c
];
936 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + yy_c
];
937 yy_is_jam
= (yy_current_state
== 33);
939 return ( yy_is_jam
? 0 : yy_current_state
);
944 static void yyunput( YY_CHAR c
, register YY_CHAR
*yy_bp
)
946 static void yyunput( c
, yy_bp
)
948 register YY_CHAR
*yy_bp
;
952 register YY_CHAR
*yy_cp
= yy_c_buf_p
;
954 /* undo effects of setting up yytext */
955 *yy_cp
= yy_hold_char
;
957 if ( yy_cp
< yy_current_buffer
->yy_ch_buf
+ 2 )
958 { /* need to shift things up to make room */
959 register int number_to_move
= yy_n_chars
+ 2; /* +2 for EOB chars */
960 register YY_CHAR
*dest
=
961 &yy_current_buffer
->yy_ch_buf
[yy_current_buffer
->yy_buf_size
+ 2];
962 register YY_CHAR
*source
=
963 &yy_current_buffer
->yy_ch_buf
[number_to_move
];
965 while ( source
> yy_current_buffer
->yy_ch_buf
)
968 yy_cp
+= dest
- source
;
969 yy_bp
+= dest
- source
;
970 yy_n_chars
= yy_current_buffer
->yy_buf_size
;
972 if ( yy_cp
< yy_current_buffer
->yy_ch_buf
+ 2 )
973 YY_FATAL_ERROR( "flex scanner push-back overflow" );
976 if ( yy_cp
> yy_bp
&& yy_cp
[-1] == '\n' )
981 /* note: the formal parameter *must* be called "yy_bp" for this
982 * macro to now work correctly
984 YY_DO_BEFORE_ACTION
; /* set up yytext again */
996 YY_CHAR
*yy_cp
= yy_c_buf_p
;
998 *yy_cp
= yy_hold_char
;
1000 if ( *yy_c_buf_p
== YY_END_OF_BUFFER_CHAR
)
1002 /* yy_c_buf_p now points to the character we want to return.
1003 * If this occurs *before* the EOB characters, then it's a
1004 * valid NUL; if not, then we've hit the end of the buffer.
1006 if ( yy_c_buf_p
< &yy_current_buffer
->yy_ch_buf
[yy_n_chars
] )
1007 /* this was really a NUL */
1011 { /* need more input */
1012 yytext
= yy_c_buf_p
;
1015 switch ( yy_get_next_buffer() )
1017 case EOB_ACT_END_OF_FILE
:
1021 yy_c_buf_p
= yytext
+ YY_MORE_ADJ
;
1028 return ( yyinput() );
1035 case EOB_ACT_CONTINUE_SCAN
:
1036 yy_c_buf_p
= yytext
+ YY_MORE_ADJ
;
1039 case EOB_ACT_LAST_MATCH
:
1041 YY_FATAL_ERROR( "unexpected last match in yyinput()" );
1043 YY_FATAL_ERROR( "unexpected last match in input()" );
1050 yy_hold_char
= *++yy_c_buf_p
;
1056 #ifdef YY_USE_PROTOS
1057 void yyrestart( FILE *input_file
)
1059 void yyrestart( input_file
)
1064 yy_init_buffer( yy_current_buffer
, input_file
);
1065 yy_load_buffer_state();
1069 #ifdef YY_USE_PROTOS
1070 void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer
)
1072 void yy_switch_to_buffer( new_buffer
)
1073 YY_BUFFER_STATE new_buffer
;
1077 if ( yy_current_buffer
== new_buffer
)
1080 if ( yy_current_buffer
)
1082 /* flush out information for old buffer */
1083 *yy_c_buf_p
= yy_hold_char
;
1084 yy_current_buffer
->yy_buf_pos
= yy_c_buf_p
;
1085 yy_current_buffer
->yy_n_chars
= yy_n_chars
;
1088 yy_current_buffer
= new_buffer
;
1089 yy_load_buffer_state();
1091 /* we don't actually know whether we did this switch during
1092 * EOF (yywrap()) processing, but the only time this flag
1093 * is looked at is after yywrap() is called, so it's safe
1094 * to go ahead and always set it.
1096 yy_did_buffer_switch_on_eof
= 1;
1100 #ifdef YY_USE_PROTOS
1101 void yy_load_buffer_state( void )
1103 void yy_load_buffer_state()
1107 yy_n_chars
= yy_current_buffer
->yy_n_chars
;
1108 yytext
= yy_c_buf_p
= yy_current_buffer
->yy_buf_pos
;
1109 yyin
= yy_current_buffer
->yy_input_file
;
1110 yy_hold_char
= *yy_c_buf_p
;
1114 #ifdef YY_USE_PROTOS
1115 YY_BUFFER_STATE
yy_create_buffer( FILE *file
, int size
)
1117 YY_BUFFER_STATE
yy_create_buffer( file
, size
)
1125 b
= (YY_BUFFER_STATE
) malloc( sizeof( struct yy_buffer_state
) );
1128 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1130 b
->yy_buf_size
= size
;
1132 /* yy_ch_buf has to be 2 characters longer than the size given because
1133 * we need to put in 2 end-of-buffer characters.
1135 b
->yy_ch_buf
= (YY_CHAR
*) malloc( (unsigned) (b
->yy_buf_size
+ 2) );
1137 if ( ! b
->yy_ch_buf
)
1138 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1140 yy_init_buffer( b
, file
);
1146 #ifdef YY_USE_PROTOS
1147 void yy_delete_buffer( YY_BUFFER_STATE b
)
1149 void yy_delete_buffer( b
)
1154 if ( b
== yy_current_buffer
)
1155 yy_current_buffer
= (YY_BUFFER_STATE
) 0;
1157 free( (char *) b
->yy_ch_buf
);
1162 #ifdef YY_USE_PROTOS
1163 void yy_init_buffer( YY_BUFFER_STATE b
, FILE *file
)
1165 void yy_init_buffer( b
, file
)
1171 b
->yy_input_file
= file
;
1173 /* we put in the '\n' and start reading from [1] so that an
1174 * initial match-at-newline will be true.
1177 b
->yy_ch_buf
[0] = '\n';
1180 /* we always need two end-of-buffer characters. The first causes
1181 * a transition to the end-of-buffer state. The second causes
1182 * a jam in that state.
1184 b
->yy_ch_buf
[1] = YY_END_OF_BUFFER_CHAR
;
1185 b
->yy_ch_buf
[2] = YY_END_OF_BUFFER_CHAR
;
1187 b
->yy_buf_pos
= &b
->yy_ch_buf
[1];
1189 b
->yy_eof_status
= EOF_NOT_SEEN
;
1191 # line 108 "lexer.l"
1196 static int lex_input() {
1199 #else /* BSD/AT&T lex */
1201 # error "Sorry, but need either flex or AT&T lex"
1203 static int lex_input() {
1207 # define unput(_c) my_unput(_c)
1211 # define input() my_input()
1212 static int my_unput(char c
)
1214 if (lex_read_from_string
) {
1215 /* Make sure we have something */
1216 if (lex_string_ptr
) {
1217 if (c
== '\n') yylineno
--;
1221 yytchar
= (c
);if(yytchar
=='\n')yylineno
--;*yysptr
++=yytchar
;
1222 /* unput(c); Causes infinite recursion! */
1230 void LexFromFile(FILE *fd
)
1232 lex_read_from_string
= 0;
1234 /* Don't know why this is necessary, but otherwise
1235 * lex only works _once_!
1242 void LexFromString(char *buffer
)
1244 lex_read_from_string
= 1;
1245 lex_buffer
= buffer
;
1246 lex_buffer_length
= strlen((const char*) buffer
);
1248 /* Don't know why this is necessary, but otherwise
1249 * lex only works _once_!
1256 static int my_input( void )
1258 if (lex_read_from_string
) {
1259 if (lex_string_ptr
== lex_buffer_length
)
1262 char c
= lex_buffer
[lex_string_ptr
++];
1263 #ifndef FLEX_SCANNER
1264 if (c
== '\n') yylineno
++;
1273 void wxExprCleanUp()
1275 if (yy_current_buffer
)
1276 yy_delete_buffer(yy_current_buffer
);