1 /* A lexical scanner generated by flex */
2 /* Copyright: (c) Julian Smart */
3 /* Licence: wxWindows Licence */
5 /* scanner skeleton version:
7 Last change: JS 13 Jul 97 6:17 pm
15 /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
28 /* use prototypes in function declarations */
31 /* the "const" storage-class-modifier is valid */
34 #else /* ! __cplusplus */
48 #endif /* ! __cplusplus */
62 #define YY_PROTO(proto) proto
64 #define YY_PROTO(proto) ()
65 /* we can't get here if it's an ANSI C compiler, or a C++ compiler,
66 * so it's got to be a K&R compiler, and therefore there's no standard
67 * place from which to include these definitions
78 /* amount of stuff to slurp up with each read */
79 #ifndef YY_READ_BUF_SIZE
80 #define YY_READ_BUF_SIZE 8192
83 /* returned upon end-of-file */
86 /* copy whatever the last rule matched to the standard output */
88 /* cast to (char *) is because for 8-bit chars, yytext is (unsigned char *) */
89 /* this used to be an fputs(), but since the string might contain NUL's,
92 #define ECHO (void) fwrite( (char *) yytext, yyleng, 1, yyout )
94 /* gets input and stuffs it into "buf". number of characters read, or YY_NULL,
95 * is returned in "result".
97 #define YY_INPUT(buf,result,max_size) \
98 if ( (result = read( fileno(yyin), (char *) buf, max_size )) < 0 ) \
99 YY_FATAL_ERROR( "read() in flex scanner failed" );
102 /* no semi-colon after return; correct usage is to write "yyterminate();" -
103 * we don't want an extra ';' after the "return" because that will cause
104 * some compilers to complain about unreachable statements.
106 #define yyterminate() return ( YY_NULL )
108 /* report a fatal error */
110 /* The funky do-while is used to turn this macro definition into
111 * a single C statement (which needs a semi-colon terminator).
112 * This avoids problems with code like:
114 * if ( something_happens )
115 * YY_FATAL_ERROR( "oops, the something happened" );
119 * Prior to using the do-while the compiler would get upset at the
120 * "else" because it interpreted the "if" statement as being all
121 * done when it reached the ';' after the YY_FATAL_ERROR() call.
124 #define YY_FATAL_ERROR(msg) \
127 (void) fputs( msg, stderr ); \
128 (void) putc( '\n', stderr ); \
133 /* default yywrap function - always treat EOF as an EOF */
134 int yywrap(void) { return 1; }
137 /* enter a start condition. This macro really ought to take a parameter,
138 * but we do it the disgusting crufty way forced on us by the ()-less
139 * definition of BEGIN
141 #define BEGIN yy_start = 1 + 2 *
143 /* action number for EOF rule of a given start state */
144 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
146 /* special action meaning "start processing a new file" */
147 #define YY_NEW_FILE \
150 yy_init_buffer( yy_current_buffer, yyin ); \
151 yy_load_buffer_state(); \
155 /* default declaration of generated scanner - a define so the user can
156 * easily add parameters
158 #define YY_DECL int yylex YY_PROTO(( void ))
160 /* code executed at the end of each rule */
161 #define YY_BREAK break;
163 #define YY_END_OF_BUFFER_CHAR 0
166 #define YY_BUF_SIZE (YY_READ_BUF_SIZE * 2) /* size of default input buffer */
169 typedef struct yy_buffer_state
*YY_BUFFER_STATE
;
171 #define YY_CHAR unsigned char
177 * Description: Lexical analyser for PROLOGIO; can be used with
178 * either lex and flex.
182 /* +++steve162e: added, otherwise, PROIO_input will be undefined (at least under LINUX)
183 please check, if this is also TRUE under other UNIXes.
186 #if defined(FLEX_SCANNER) && defined(_LINUX)
187 #define PROIO_input my_input
193 extern char *malloc();
195 #define Return(x) return x;
197 #if defined(VMS) && ( __VMS_VER < 70000000 )
198 #define strdup(s) (strcpy((char *)malloc(strlen(s)+1), s));
201 static size_t lex_buffer_length
= 0;
202 static const char *lex_buffer
= NULL
;
203 static size_t lex_string_ptr
= 0;
204 static int lex_read_from_string
= 0;
206 static int my_input(void);
207 static int my_unput(char);
211 # define YY_INPUT(buf,result,max_size) \
212 if (lex_read_from_string) \
213 { int c = my_input(); result = (c == 0) ? YY_NULL : ((buf)[0]=(c), 1); } \
215 if ( (result = read( fileno(yyin), (char *) buf, max_size )) < 0 ) \
216 YY_FATAL_ERROR( "read() in flex scanner failed" );
219 # define unput(_c) my_unput(_c)
224 /* done after the current pattern has been matched and before the
225 * corresponding action - sets up yytext
227 #define YY_DO_BEFORE_ACTION \
229 yyleng = yy_cp - yy_bp; \
230 yy_hold_char = *yy_cp; \
234 #define EOB_ACT_CONTINUE_SCAN 0
235 #define EOB_ACT_END_OF_FILE 1
236 #define EOB_ACT_LAST_MATCH 2
238 /* return all but the first 'n' matched characters back to the input stream */
242 /* undo effects of setting up yytext */ \
243 *yy_cp = yy_hold_char; \
244 yy_c_buf_p = yy_cp = yy_bp + n; \
245 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
250 #define unput(c) yyunput( c, yytext )
253 struct yy_buffer_state
257 YY_CHAR
*yy_ch_buf
; /* input buffer */
258 YY_CHAR
*yy_buf_pos
; /* current position in input buffer */
260 /* size of input buffer in bytes, not including room for EOB characters*/
263 /* number of characters read into yy_ch_buf, not including EOB characters */
266 int yy_eof_status
; /* whether we've seen an EOF on this buffer */
267 #define EOF_NOT_SEEN 0
268 /* "pending" happens when the EOF has been seen but there's still
271 #define EOF_PENDING 1
275 static YY_BUFFER_STATE yy_current_buffer
;
277 /* we provide macros for accessing buffer states in case in the
278 * future we want to put the buffer states in a more general
281 #define YY_CURRENT_BUFFER yy_current_buffer
284 /* yy_hold_char holds the character lost when yytext is formed */
285 static YY_CHAR yy_hold_char
;
287 static int yy_n_chars
; /* number of characters read into yy_ch_buf */
291 #ifndef YY_USER_ACTION
292 #define YY_USER_ACTION
299 extern YY_CHAR
*yytext
;
301 extern FILE *yyin
, *yyout
;
306 FILE *yyin
= (FILE *) 0, *yyout
= (FILE *) 0;
308 #define YY_END_OF_BUFFER 18
309 typedef int yy_state_type
;
310 static const short int yy_accept
[34] =
312 0, 0, 18, 16, 13, 14, 16, 16, 6, 7,
313 16, 8, 12, 16, 1, 11, 3, 9, 10, 2,
314 0, 5, 0, 0, 0, 4, 1, 15, 3, 5,
318 static const YY_CHAR yy_ec
[256] =
320 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
321 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
322 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
323 1, 2, 1, 4, 1, 1, 1, 1, 5, 6,
324 7, 8, 9, 10, 9, 11, 12, 13, 13, 13,
325 13, 13, 13, 13, 13, 13, 13, 1, 1, 1,
326 14, 1, 1, 1, 15, 15, 15, 15, 15, 15,
327 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
328 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
329 16, 17, 18, 1, 15, 1, 15, 15, 15, 15,
331 19, 15, 15, 15, 15, 15, 15, 15, 15, 15,
332 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
333 15, 15, 1, 20, 1, 1, 1, 1, 1, 1,
334 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
335 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
336 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
337 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
338 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
339 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
340 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
342 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
343 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
344 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
345 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
346 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
350 static const YY_CHAR yy_meta
[21] =
352 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
353 1, 1, 2, 1, 2, 1, 3, 1, 2, 1
356 static const short int yy_base
[37] =
358 0, 0, 48, 55, 55, 55, 17, 42, 55, 55,
359 19, 55, 55, 23, 17, 55, 0, 55, 55, 0,
360 18, 55, 19, 23, 21, 55, 12, 55, 0, 24,
361 25, 29, 55, 49, 52, 22
364 static const short int yy_def
[37] =
366 33, 1, 33, 33, 33, 33, 34, 35, 33, 33,
367 33, 33, 33, 33, 33, 33, 36, 33, 33, 36,
368 34, 33, 34, 34, 35, 33, 33, 33, 36, 34,
369 34, 34, 0, 33, 33, 33
372 static const short int yy_nxt
[76] =
374 4, 5, 6, 7, 8, 9, 10, 4, 11, 12,
375 13, 14, 15, 16, 17, 18, 4, 19, 20, 4,
376 22, 22, 30, 29, 27, 26, 22, 22, 30, 27,
377 28, 27, 30, 23, 23, 23, 24, 24, 24, 31,
378 23, 32, 24, 24, 24, 23, 26, 33, 24, 21,
379 21, 21, 25, 25, 3, 33, 33, 33, 33, 33,
380 33, 33, 33, 33, 33, 33, 33, 33, 33, 33,
384 static const short int yy_chk
[76] =
386 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
387 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
388 7, 21, 23, 36, 27, 25, 24, 30, 31, 15,
389 14, 11, 32, 7, 21, 23, 7, 21, 23, 24,
390 30, 31, 24, 30, 31, 32, 8, 3, 32, 34,
391 34, 34, 35, 35, 33, 33, 33, 33, 33, 33,
392 33, 33, 33, 33, 33, 33, 33, 33, 33, 33,
396 static yy_state_type yy_last_accepting_state
;
397 static YY_CHAR
*yy_last_accepting_cpos
;
399 /* the intent behind this definition is that it'll catch
400 * any uses of REJECT which flex missed
402 #define REJECT reject_used_but_not_detected
403 #define yymore() yymore_used_but_not_detected
404 #define YY_MORE_ADJ 0
406 /* these variables are all declared out here so that section 3 code can
409 /* points to current character in buffer */
410 static YY_CHAR
*yy_c_buf_p
= (YY_CHAR
*) 0;
411 static int yy_init
= 1; /* whether we need to initialize */
412 static int yy_start
= 0; /* start state number */
414 /* flag which is used to allow yywrap()'s to do buffer switches
415 * instead of setting up a fresh yyin. A bit of a hack ...
417 static int yy_did_buffer_switch_on_eof
;
419 static yy_state_type yy_get_previous_state
YY_PROTO(( void ));
420 static yy_state_type yy_try_NUL_trans
YY_PROTO(( yy_state_type current_state
));
421 static int yy_get_next_buffer
YY_PROTO(( void ));
422 static void yyunput
YY_PROTO(( YY_CHAR c
, YY_CHAR
*buf_ptr
));
423 void yyrestart
YY_PROTO(( FILE *input_file
));
424 void yy_switch_to_buffer
YY_PROTO(( YY_BUFFER_STATE new_buffer
));
425 void yy_load_buffer_state
YY_PROTO(( void ));
426 YY_BUFFER_STATE yy_create_buffer
YY_PROTO(( FILE *file
, int size
));
427 void yy_delete_buffer
YY_PROTO(( YY_BUFFER_STATE b
));
428 void yy_init_buffer
YY_PROTO(( YY_BUFFER_STATE b
, FILE *file
));
430 #define yy_new_buffer yy_create_buffer
433 static int yyinput
YY_PROTO(( void ));
435 static int input
YY_PROTO(( void ));
440 register yy_state_type yy_current_state
;
441 register YY_CHAR
*yy_cp
, *yy_bp
;
452 yy_start
= 1; /* first start state */
460 if ( yy_current_buffer
)
461 yy_init_buffer( yy_current_buffer
, yyin
);
463 yy_current_buffer
= yy_create_buffer( yyin
, YY_BUF_SIZE
);
465 yy_load_buffer_state();
470 while ( 1 ) /* loops until end-of-file is reached */
474 /* support of yytext */
475 *yy_cp
= yy_hold_char
;
477 /* yy_bp points to the position in yy_ch_buf of the start of the
482 yy_current_state
= yy_start
;
486 register YY_CHAR yy_c
= yy_ec
[*yy_cp
];
487 if ( yy_accept
[yy_current_state
] )
489 yy_last_accepting_state
= yy_current_state
;
490 yy_last_accepting_cpos
= yy_cp
;
492 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
494 yy_current_state
= yy_def
[yy_current_state
];
495 if ( yy_current_state
>= 34 )
496 yy_c
= yy_meta
[yy_c
];
498 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + yy_c
];
501 while ( yy_current_state
!= 33 );
502 yy_cp
= yy_last_accepting_cpos
;
503 yy_current_state
= yy_last_accepting_state
;
506 yy_act
= yy_accept
[yy_current_state
];
511 do_action
: /* this label is used only to access EOF actions */
516 case 0: /* must backtrack */
517 /* undo the effects of YY_DO_BEFORE_ACTION */
518 *yy_cp
= yy_hold_char
;
519 yy_cp
= yy_last_accepting_cpos
;
520 yy_current_state
= yy_last_accepting_state
;
525 {yylval
.s
= strdup(yytext
); Return(INTEGER
);}
533 {yylval
.s
= strdup(yytext
); Return(WORD
);}
537 {int len
= strlen(yytext
);
539 yylval
.s
= strdup(yytext
+1);
544 {yylval
.s
= strdup(yytext
); Return(STRING
);}
564 Return(CLOSE_SQUARE
);
586 while (yyinput() != '*');
589 while (input() != '*');
594 case '*': unput('*');
607 case YY_STATE_EOF(INITIAL
):
610 case YY_END_OF_BUFFER
:
612 /* amount of text matched not including the EOB char */
613 int yy_amount_of_matched_text
= yy_cp
- yytext
- 1;
615 /* undo the effects of YY_DO_BEFORE_ACTION */
616 *yy_cp
= yy_hold_char
;
618 /* note that here we test for yy_c_buf_p "<=" to the position
619 * of the first EOB in the buffer, since yy_c_buf_p will
620 * already have been incremented past the NUL character
621 * (since all states make transitions on EOB to the end-
622 * of-buffer state). Contrast this with the test in yyinput().
624 if ( yy_c_buf_p
<= &yy_current_buffer
->yy_ch_buf
[yy_n_chars
] )
625 /* this was really a NUL */
627 yy_state_type yy_next_state
;
629 yy_c_buf_p
= yytext
+ yy_amount_of_matched_text
;
631 yy_current_state
= yy_get_previous_state();
633 /* okay, we're now positioned to make the
634 * NUL transition. We couldn't have
635 * yy_get_previous_state() go ahead and do it
636 * for us because it doesn't know how to deal
637 * with the possibility of jamming (and we
638 * don't want to build jamming into it because
639 * then it will run more slowly)
642 yy_next_state
= yy_try_NUL_trans( yy_current_state
);
644 yy_bp
= yytext
+ YY_MORE_ADJ
;
648 /* consume the NUL */
649 yy_cp
= ++yy_c_buf_p
;
650 yy_current_state
= yy_next_state
;
656 yy_cp
= yy_last_accepting_cpos
;
657 yy_current_state
= yy_last_accepting_state
;
662 else switch ( yy_get_next_buffer() )
664 case EOB_ACT_END_OF_FILE
:
666 yy_did_buffer_switch_on_eof
= 0;
670 /* note: because we've taken care in
671 * yy_get_next_buffer() to have set up yytext,
672 * we can now set up yy_c_buf_p so that if some
673 * total hoser (like flex itself) wants
674 * to call the scanner after we return the
675 * YY_NULL, it'll still work - another YY_NULL
678 yy_c_buf_p
= yytext
+ YY_MORE_ADJ
;
680 yy_act
= YY_STATE_EOF((yy_start
- 1) / 2);
686 if ( ! yy_did_buffer_switch_on_eof
)
692 case EOB_ACT_CONTINUE_SCAN
:
693 yy_c_buf_p
= yytext
+ yy_amount_of_matched_text
;
695 yy_current_state
= yy_get_previous_state();
698 yy_bp
= yytext
+ YY_MORE_ADJ
;
701 case EOB_ACT_LAST_MATCH
:
703 &yy_current_buffer
->yy_ch_buf
[yy_n_chars
];
705 yy_current_state
= yy_get_previous_state();
708 yy_bp
= yytext
+ YY_MORE_ADJ
;
716 printf( "action # %d\n", yy_act
);
719 "fatal flex scanner internal error--no action found" );
725 /* yy_get_next_buffer - try to read in a new buffer
728 * int yy_get_next_buffer();
730 * returns a code representing an action
731 * EOB_ACT_LAST_MATCH -
732 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
733 * EOB_ACT_END_OF_FILE - end of file
736 static int yy_get_next_buffer()
739 register YY_CHAR
*dest
= yy_current_buffer
->yy_ch_buf
;
740 register YY_CHAR
*source
= yytext
- 1; /* copy prev. char, too */
741 register int number_to_move
, i
;
744 if ( yy_c_buf_p
> &yy_current_buffer
->yy_ch_buf
[yy_n_chars
+ 1] )
746 "fatal flex scanner internal error--end of buffer missed" );
748 /* try to read more data */
750 /* first move last chars to start of buffer */
751 number_to_move
= yy_c_buf_p
- yytext
;
753 for ( i
= 0; i
< number_to_move
; ++i
)
754 *(dest
++) = *(source
++);
756 if ( yy_current_buffer
->yy_eof_status
!= EOF_NOT_SEEN
)
757 /* don't do the read, it's not guaranteed to return an EOF,
764 int num_to_read
= yy_current_buffer
->yy_buf_size
- number_to_move
- 1;
766 if ( num_to_read
> YY_READ_BUF_SIZE
)
767 num_to_read
= YY_READ_BUF_SIZE
;
769 else if ( num_to_read
<= 0 )
770 YY_FATAL_ERROR( "fatal error - scanner input buffer overflow" );
772 /* read in more data */
773 YY_INPUT( (&yy_current_buffer
->yy_ch_buf
[number_to_move
]),
774 yy_n_chars
, num_to_read
);
777 if ( yy_n_chars
== 0 )
779 if ( number_to_move
== 1 )
781 ret_val
= EOB_ACT_END_OF_FILE
;
782 yy_current_buffer
->yy_eof_status
= EOF_DONE
;
787 ret_val
= EOB_ACT_LAST_MATCH
;
788 yy_current_buffer
->yy_eof_status
= EOF_PENDING
;
793 ret_val
= EOB_ACT_CONTINUE_SCAN
;
795 yy_n_chars
+= number_to_move
;
796 yy_current_buffer
->yy_ch_buf
[yy_n_chars
] = YY_END_OF_BUFFER_CHAR
;
797 yy_current_buffer
->yy_ch_buf
[yy_n_chars
+ 1] = YY_END_OF_BUFFER_CHAR
;
799 /* yytext begins at the second character in yy_ch_buf; the first
800 * character is the one which preceded it before reading in the latest
801 * buffer; it needs to be kept around in case it's a newline, so
802 * yy_get_previous_state() will have with '^' rules active
805 yytext
= &yy_current_buffer
->yy_ch_buf
[1];
811 /* yy_get_previous_state - get the state just before the EOB char was reached
814 * yy_state_type yy_get_previous_state();
817 static yy_state_type
yy_get_previous_state()
820 register yy_state_type yy_current_state
;
821 register YY_CHAR
*yy_cp
;
823 yy_current_state
= yy_start
;
825 for ( yy_cp
= yytext
+ YY_MORE_ADJ
; yy_cp
< yy_c_buf_p
; ++yy_cp
)
827 register YY_CHAR yy_c
= (*yy_cp
? yy_ec
[*yy_cp
] : 1);
828 if ( yy_accept
[yy_current_state
] )
830 yy_last_accepting_state
= yy_current_state
;
831 yy_last_accepting_cpos
= yy_cp
;
833 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
835 yy_current_state
= yy_def
[yy_current_state
];
836 if ( yy_current_state
>= 34 )
837 yy_c
= yy_meta
[yy_c
];
839 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + yy_c
];
842 return ( yy_current_state
);
846 /* yy_try_NUL_trans - try to make a transition on the NUL character
849 * next_state = yy_try_NUL_trans( current_state );
853 static yy_state_type
yy_try_NUL_trans( register yy_state_type yy_current_state
)
855 static yy_state_type
yy_try_NUL_trans( yy_current_state
)
856 register yy_state_type yy_current_state
;
860 register int yy_is_jam
;
861 register YY_CHAR
*yy_cp
= yy_c_buf_p
;
863 register YY_CHAR yy_c
= 1;
864 if ( yy_accept
[yy_current_state
] )
866 yy_last_accepting_state
= yy_current_state
;
867 yy_last_accepting_cpos
= yy_cp
;
869 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
871 yy_current_state
= yy_def
[yy_current_state
];
872 if ( yy_current_state
>= 34 )
873 yy_c
= yy_meta
[yy_c
];
875 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + yy_c
];
876 yy_is_jam
= (yy_current_state
== 33);
878 return ( yy_is_jam
? 0 : yy_current_state
);
883 static void yyunput( YY_CHAR c
, register YY_CHAR
*yy_bp
)
885 static void yyunput( c
, yy_bp
)
887 register YY_CHAR
*yy_bp
;
891 register YY_CHAR
*yy_cp
= yy_c_buf_p
;
893 /* undo effects of setting up yytext */
894 *yy_cp
= yy_hold_char
;
896 if ( yy_cp
< yy_current_buffer
->yy_ch_buf
+ 2 )
897 { /* need to shift things up to make room */
898 register int number_to_move
= yy_n_chars
+ 2; /* +2 for EOB chars */
899 register YY_CHAR
*dest
=
900 &yy_current_buffer
->yy_ch_buf
[yy_current_buffer
->yy_buf_size
+ 2];
901 register YY_CHAR
*source
=
902 &yy_current_buffer
->yy_ch_buf
[number_to_move
];
904 while ( source
> yy_current_buffer
->yy_ch_buf
)
907 yy_cp
+= dest
- source
;
908 yy_bp
+= dest
- source
;
909 yy_n_chars
= yy_current_buffer
->yy_buf_size
;
911 if ( yy_cp
< yy_current_buffer
->yy_ch_buf
+ 2 )
912 YY_FATAL_ERROR( "flex scanner push-back overflow" );
915 if ( yy_cp
> yy_bp
&& yy_cp
[-1] == '\n' )
920 /* note: the formal parameter *must* be called "yy_bp" for this
921 * macro to now work correctly
923 YY_DO_BEFORE_ACTION
; /* set up yytext again */
935 YY_CHAR
*yy_cp
= yy_c_buf_p
;
937 *yy_cp
= yy_hold_char
;
939 if ( *yy_c_buf_p
== YY_END_OF_BUFFER_CHAR
)
941 /* yy_c_buf_p now points to the character we want to return.
942 * If this occurs *before* the EOB characters, then it's a
943 * valid NUL; if not, then we've hit the end of the buffer.
945 if ( yy_c_buf_p
< &yy_current_buffer
->yy_ch_buf
[yy_n_chars
] )
946 /* this was really a NUL */
950 { /* need more input */
954 switch ( yy_get_next_buffer() )
956 case EOB_ACT_END_OF_FILE
:
960 yy_c_buf_p
= yytext
+ YY_MORE_ADJ
;
967 return ( yyinput() );
974 case EOB_ACT_CONTINUE_SCAN
:
975 yy_c_buf_p
= yytext
+ YY_MORE_ADJ
;
978 case EOB_ACT_LAST_MATCH
:
980 YY_FATAL_ERROR( "unexpected last match in yyinput()" );
982 YY_FATAL_ERROR( "unexpected last match in input()" );
989 yy_hold_char
= *++yy_c_buf_p
;
996 void yyrestart( FILE *input_file
)
998 void yyrestart( input_file
)
1003 yy_init_buffer( yy_current_buffer
, input_file
);
1004 yy_load_buffer_state();
1008 #ifdef YY_USE_PROTOS
1009 void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer
)
1011 void yy_switch_to_buffer( new_buffer
)
1012 YY_BUFFER_STATE new_buffer
;
1016 if ( yy_current_buffer
== new_buffer
)
1019 if ( yy_current_buffer
)
1021 /* flush out information for old buffer */
1022 *yy_c_buf_p
= yy_hold_char
;
1023 yy_current_buffer
->yy_buf_pos
= yy_c_buf_p
;
1024 yy_current_buffer
->yy_n_chars
= yy_n_chars
;
1027 yy_current_buffer
= new_buffer
;
1028 yy_load_buffer_state();
1030 /* we don't actually know whether we did this switch during
1031 * EOF (yywrap()) processing, but the only time this flag
1032 * is looked at is after yywrap() is called, so it's safe
1033 * to go ahead and always set it.
1035 yy_did_buffer_switch_on_eof
= 1;
1039 #ifdef YY_USE_PROTOS
1040 void yy_load_buffer_state( void )
1042 void yy_load_buffer_state()
1046 yy_n_chars
= yy_current_buffer
->yy_n_chars
;
1047 yytext
= yy_c_buf_p
= yy_current_buffer
->yy_buf_pos
;
1048 yyin
= yy_current_buffer
->yy_input_file
;
1049 yy_hold_char
= *yy_c_buf_p
;
1053 #ifdef YY_USE_PROTOS
1054 YY_BUFFER_STATE
yy_create_buffer( FILE *file
, int size
)
1056 YY_BUFFER_STATE
yy_create_buffer( file
, size
)
1064 b
= (YY_BUFFER_STATE
) malloc( sizeof( struct yy_buffer_state
) );
1067 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1069 b
->yy_buf_size
= size
;
1071 /* yy_ch_buf has to be 2 characters longer than the size given because
1072 * we need to put in 2 end-of-buffer characters.
1074 b
->yy_ch_buf
= (YY_CHAR
*) malloc( (unsigned) (b
->yy_buf_size
+ 2) );
1076 if ( ! b
->yy_ch_buf
)
1077 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1079 yy_init_buffer( b
, file
);
1085 #ifdef YY_USE_PROTOS
1086 void yy_delete_buffer( YY_BUFFER_STATE b
)
1088 void yy_delete_buffer( b
)
1093 if ( b
== yy_current_buffer
)
1094 yy_current_buffer
= (YY_BUFFER_STATE
) 0;
1096 free( (char *) b
->yy_ch_buf
);
1101 #ifdef YY_USE_PROTOS
1102 void yy_init_buffer( YY_BUFFER_STATE b
, FILE *file
)
1104 void yy_init_buffer( b
, file
)
1110 b
->yy_input_file
= file
;
1112 /* we put in the '\n' and start reading from [1] so that an
1113 * initial match-at-newline will be true.
1116 b
->yy_ch_buf
[0] = '\n';
1119 /* we always need two end-of-buffer characters. The first causes
1120 * a transition to the end-of-buffer state. The second causes
1121 * a jam in that state.
1123 b
->yy_ch_buf
[1] = YY_END_OF_BUFFER_CHAR
;
1124 b
->yy_ch_buf
[2] = YY_END_OF_BUFFER_CHAR
;
1126 b
->yy_buf_pos
= &b
->yy_ch_buf
[1];
1128 b
->yy_eof_status
= EOF_NOT_SEEN
;
1130 # line 108 "lexer.l"
1135 static int lex_input() {
1138 #else /* BSD/AT&T lex */
1140 # error "Sorry, but need either flex or AT&T lex"
1142 static int lex_input() {
1146 # define unput(_c) my_unput(_c)
1150 # define input() my_input()
1151 static int my_unput(char c
)
1153 if (lex_read_from_string
) {
1154 /* Make sure we have something */
1155 if (lex_string_ptr
) {
1156 if (c
== '\n') yylineno
--;
1160 yytchar
= (c
);if(yytchar
=='\n')yylineno
--;*yysptr
++=yytchar
;
1161 /* unput(c); Causes infinite recursion! */
1169 void LexFromFile(FILE *fd
)
1171 lex_read_from_string
= 0;
1173 /* Don't know why this is necessary, but otherwise
1174 * lex only works _once_!
1181 void LexFromString(char *buffer
)
1183 lex_read_from_string
= 1;
1184 lex_buffer
= buffer
;
1185 lex_buffer_length
= strlen(buffer
);
1187 /* Don't know why this is necessary, but otherwise
1188 * lex only works _once_!
1195 static int my_input( void )
1197 if (lex_read_from_string
) {
1198 if (lex_string_ptr
== lex_buffer_length
)
1201 char c
= lex_buffer
[lex_string_ptr
++];
1202 #ifndef FLEX_SCANNER
1203 if (c
== '\n') yylineno
++;
1212 void wxExprCleanUp()
1214 if (yy_current_buffer
)
1215 yy_delete_buffer(yy_current_buffer
);