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
91 /* amount of stuff to slurp up with each read */
92 #ifndef YY_READ_BUF_SIZE
93 #define YY_READ_BUF_SIZE 8192
96 /* returned upon end-of-file */
99 /* copy whatever the last rule matched to the standard output */
101 /* cast to (char *) is because for 8-bit chars, yytext is (unsigned char *) */
102 /* this used to be an fputs(), but since the string might contain NUL's,
103 * we now use fwrite()
105 #define ECHO (void) fwrite( (char *) yytext, yyleng, 1, yyout )
107 /* gets input and stuffs it into "buf". number of characters read, or YY_NULL,
108 * is returned in "result".
110 #define YY_INPUT(buf,result,max_size) \
111 if ( (result = read( fileno(yyin), (char *) buf, max_size )) < 0 ) \
112 YY_FATAL_ERROR( "read() in flex scanner failed" );
115 /* no semi-colon after return; correct usage is to write "yyterminate();" -
116 * we don't want an extra ';' after the "return" because that will cause
117 * some compilers to complain about unreachable statements.
119 #define yyterminate() return ( YY_NULL )
121 /* report a fatal error */
123 /* The funky do-while is used to turn this macro definition into
124 * a single C statement (which needs a semi-colon terminator).
125 * This avoids problems with code like:
127 * if ( something_happens )
128 * YY_FATAL_ERROR( "oops, the something happened" );
132 * Prior to using the do-while the compiler would get upset at the
133 * "else" because it interpreted the "if" statement as being all
134 * done when it reached the ';' after the YY_FATAL_ERROR() call.
137 #if !defined(__VISAGECPP__)
138 #define YY_FATAL_ERROR(msg) \
141 (void) fputs( msg, stderr ); \
142 (void) putc( '\n', stderr ); \
147 /* suppress expression always false warning */
149 #define YY_FATAL_ERROR(msg) \
152 (void) fputs( msg, stderr ); \
153 (void) putc( '\n', stderr ); \
156 while ( os2var == 0 )
159 /* default yywrap function - always treat EOF as an EOF */
160 int yywrap(void) { return 1; }
163 /* enter a start condition. This macro really ought to take a parameter,
164 * but we do it the disgusting crufty way forced on us by the ()-less
165 * definition of BEGIN
167 #define BEGIN yy_start = 1 + 2 *
169 /* action number for EOF rule of a given start state */
170 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
172 /* special action meaning "start processing a new file" */
173 #if !defined(__VISAGECPP__)
174 #define YY_NEW_FILE \
177 yy_init_buffer( yy_current_buffer, yyin ); \
178 yy_load_buffer_state(); \
182 #define YY_NEW_FILE \
185 yy_init_buffer( yy_current_buffer, yyin ); \
186 yy_load_buffer_state(); \
188 while ( os2var == 0 )
191 /* default declaration of generated scanner - a define so the user can
192 * easily add parameters
194 #define YY_DECL int yylex YY_PROTO(( void ))
196 /* code executed at the end of each rule */
197 #define YY_BREAK break;
199 #define YY_END_OF_BUFFER_CHAR 0
202 #define YY_BUF_SIZE (YY_READ_BUF_SIZE * 2) /* size of default input buffer */
205 typedef struct yy_buffer_state
*YY_BUFFER_STATE
;
207 #define YY_CHAR unsigned char
213 * Description: Lexical analyser for PROLOGIO; can be used with
214 * either lex and flex.
218 /* +++steve162e: added, otherwise, PROIO_input will be undefined (at least under LINUX)
219 please check, if this is also TRUE under other UNIXes.
222 #if defined(FLEX_SCANNER) && defined(_LINUX)
223 #define PROIO_input my_input
227 #include "wx/deprecated/expr.h"
229 extern char *malloc();
231 #define Return(x) return x;
233 #if defined(VMS) && ( __VMS_VER < 70000000 )
234 #define strdup(s) (strcpy((char *)malloc(strlen(s)+1), s));
237 static size_t lex_buffer_length
= 0;
238 static const char *lex_buffer
= NULL
;
239 static size_t lex_string_ptr
= 0;
240 static int lex_read_from_string
= 0;
242 static int my_input(void);
243 static int my_unput(char);
247 # define YY_INPUT(buf,result,max_size) \
248 if (lex_read_from_string) \
249 { int c = my_input(); result = (c == 0) ? YY_NULL : ((buf)[0]=(c), 1); } \
251 if ( (result = read( fileno(yyin), (char *) buf, max_size )) < 0 ) \
252 YY_FATAL_ERROR( "read() in flex scanner failed" );
257 # define unput(_c) my_unput(_c)
262 /* done after the current pattern has been matched and before the
263 * corresponding action - sets up yytext
265 #define YY_DO_BEFORE_ACTION \
267 yyleng = yy_cp - yy_bp; \
268 yy_hold_char = *yy_cp; \
272 #define EOB_ACT_CONTINUE_SCAN 0
273 #define EOB_ACT_END_OF_FILE 1
274 #define EOB_ACT_LAST_MATCH 2
276 /* return all but the first 'n' matched characters back to the input stream */
277 #if !defined(__VISAGECPP__)
281 /* undo effects of setting up yytext */ \
282 *yy_cp = yy_hold_char; \
283 yy_c_buf_p = yy_cp = yy_bp + n; \
284 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
291 /* undo effects of setting up yytext */ \
292 *yy_cp = yy_hold_char; \
293 yy_c_buf_p = yy_cp = yy_bp + n; \
294 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
296 while ( os2var == 0 )
300 #define unput(c) yyunput( c, yytext )
303 struct yy_buffer_state
307 YY_CHAR
*yy_ch_buf
; /* input buffer */
308 YY_CHAR
*yy_buf_pos
; /* current position in input buffer */
310 /* size of input buffer in bytes, not including room for EOB characters*/
313 /* number of characters read into yy_ch_buf, not including EOB characters */
316 int yy_eof_status
; /* whether we've seen an EOF on this buffer */
317 #define EOF_NOT_SEEN 0
318 /* "pending" happens when the EOF has been seen but there's still
321 #define EOF_PENDING 1
325 static YY_BUFFER_STATE yy_current_buffer
;
327 /* we provide macros for accessing buffer states in case in the
328 * future we want to put the buffer states in a more general
331 #define YY_CURRENT_BUFFER yy_current_buffer
334 /* yy_hold_char holds the character lost when yytext is formed */
335 static YY_CHAR yy_hold_char
;
337 static int yy_n_chars
; /* number of characters read into yy_ch_buf */
341 #ifndef YY_USER_ACTION
342 #define YY_USER_ACTION
349 extern YY_CHAR
*yytext
;
351 extern FILE *yyin
, *yyout
;
356 FILE *yyin
= (FILE *) 0, *yyout
= (FILE *) 0;
358 #define YY_END_OF_BUFFER 18
359 typedef int yy_state_type
;
360 static const short int yy_accept
[34] =
362 0, 0, 18, 16, 13, 14, 16, 16, 6, 7,
363 16, 8, 12, 16, 1, 11, 3, 9, 10, 2,
364 0, 5, 0, 0, 0, 4, 1, 15, 3, 5,
368 static const YY_CHAR yy_ec
[256] =
370 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
371 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
372 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
373 1, 2, 1, 4, 1, 1, 1, 1, 5, 6,
374 7, 8, 9, 10, 9, 11, 12, 13, 13, 13,
375 13, 13, 13, 13, 13, 13, 13, 1, 1, 1,
376 14, 1, 1, 1, 15, 15, 15, 15, 15, 15,
377 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
378 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
379 16, 17, 18, 1, 15, 1, 15, 15, 15, 15,
381 19, 15, 15, 15, 15, 15, 15, 15, 15, 15,
382 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
383 15, 15, 1, 20, 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,
390 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,
396 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
400 static const YY_CHAR yy_meta
[21] =
402 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
403 1, 1, 2, 1, 2, 1, 3, 1, 2, 1
406 static const short int yy_base
[37] =
408 0, 0, 48, 55, 55, 55, 17, 42, 55, 55,
409 19, 55, 55, 23, 17, 55, 0, 55, 55, 0,
410 18, 55, 19, 23, 21, 55, 12, 55, 0, 24,
411 25, 29, 55, 49, 52, 22
414 static const short int yy_def
[37] =
416 33, 1, 33, 33, 33, 33, 34, 35, 33, 33,
417 33, 33, 33, 33, 33, 33, 36, 33, 33, 36,
418 34, 33, 34, 34, 35, 33, 33, 33, 36, 34,
419 34, 34, 0, 33, 33, 33
422 static const short int yy_nxt
[76] =
424 4, 5, 6, 7, 8, 9, 10, 4, 11, 12,
425 13, 14, 15, 16, 17, 18, 4, 19, 20, 4,
426 22, 22, 30, 29, 27, 26, 22, 22, 30, 27,
427 28, 27, 30, 23, 23, 23, 24, 24, 24, 31,
428 23, 32, 24, 24, 24, 23, 26, 33, 24, 21,
429 21, 21, 25, 25, 3, 33, 33, 33, 33, 33,
430 33, 33, 33, 33, 33, 33, 33, 33, 33, 33,
434 static const short int yy_chk
[76] =
436 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
437 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
438 7, 21, 23, 36, 27, 25, 24, 30, 31, 15,
439 14, 11, 32, 7, 21, 23, 7, 21, 23, 24,
440 30, 31, 24, 30, 31, 32, 8, 3, 32, 34,
441 34, 34, 35, 35, 33, 33, 33, 33, 33, 33,
442 33, 33, 33, 33, 33, 33, 33, 33, 33, 33,
446 static yy_state_type yy_last_accepting_state
;
447 static YY_CHAR
*yy_last_accepting_cpos
;
449 /* the intent behind this definition is that it'll catch
450 * any uses of REJECT which flex missed
452 #define REJECT reject_used_but_not_detected
453 #define yymore() yymore_used_but_not_detected
454 #define YY_MORE_ADJ 0
456 /* these variables are all declared out here so that section 3 code can
459 /* points to current character in buffer */
460 static YY_CHAR
*yy_c_buf_p
= (YY_CHAR
*) 0;
461 static int yy_init
= 1; /* whether we need to initialize */
462 static int yy_start
= 0; /* start state number */
464 /* flag which is used to allow yywrap()'s to do buffer switches
465 * instead of setting up a fresh yyin. A bit of a hack ...
467 static int yy_did_buffer_switch_on_eof
;
469 static yy_state_type yy_get_previous_state
YY_PROTO(( void ));
470 static yy_state_type yy_try_NUL_trans
YY_PROTO(( yy_state_type current_state
));
471 static int yy_get_next_buffer
YY_PROTO(( void ));
472 static void yyunput
YY_PROTO(( YY_CHAR c
, YY_CHAR
*buf_ptr
));
473 void yyrestart
YY_PROTO(( FILE *input_file
));
474 void yy_switch_to_buffer
YY_PROTO(( YY_BUFFER_STATE new_buffer
));
475 void yy_load_buffer_state
YY_PROTO(( void ));
476 YY_BUFFER_STATE yy_create_buffer
YY_PROTO(( FILE *file
, int size
));
477 void yy_delete_buffer
YY_PROTO(( YY_BUFFER_STATE b
));
478 void yy_init_buffer
YY_PROTO(( YY_BUFFER_STATE b
, FILE *file
));
480 #define yy_new_buffer yy_create_buffer
483 static int yyinput
YY_PROTO(( void ));
485 static int input
YY_PROTO(( void ));
490 register yy_state_type yy_current_state
;
491 register YY_CHAR
*yy_cp
, *yy_bp
;
502 yy_start
= 1; /* first start state */
510 if ( yy_current_buffer
)
511 yy_init_buffer( yy_current_buffer
, yyin
);
513 yy_current_buffer
= yy_create_buffer( yyin
, YY_BUF_SIZE
);
515 yy_load_buffer_state();
520 #if !defined(__VISAGECPP__)
521 while ( 1 ) /* loops until end-of-file is reached */
524 if (os2var
== 0) return 0;
525 while ( os2var
== 1 ) /* loops until end-of-file is reached */
530 /* support of yytext */
531 *yy_cp
= yy_hold_char
;
533 /* yy_bp points to the position in yy_ch_buf of the start of the
538 yy_current_state
= yy_start
;
542 register YY_CHAR yy_c
= yy_ec
[*yy_cp
];
543 if ( yy_accept
[yy_current_state
] )
545 yy_last_accepting_state
= yy_current_state
;
546 yy_last_accepting_cpos
= yy_cp
;
548 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
550 yy_current_state
= yy_def
[yy_current_state
];
551 if ( yy_current_state
>= 34 )
552 yy_c
= yy_meta
[yy_c
];
554 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + yy_c
];
557 while ( yy_current_state
!= 33 );
558 yy_cp
= yy_last_accepting_cpos
;
559 yy_current_state
= yy_last_accepting_state
;
562 yy_act
= yy_accept
[yy_current_state
];
567 do_action
: /* this label is used only to access EOF actions */
572 case 0: /* must backtrack */
573 /* undo the effects of YY_DO_BEFORE_ACTION */
574 *yy_cp
= yy_hold_char
;
575 yy_cp
= yy_last_accepting_cpos
;
576 yy_current_state
= yy_last_accepting_state
;
581 {yylval
.s
= strdup((const char*) yytext
); Return(INTEGER
);}
589 {yylval
.s
= strdup((const char*) yytext
); Return(WORD
);}
593 {int len
= strlen((const char*) yytext
);
595 yylval
.s
= strdup((const char*) (yytext
+1));
600 {yylval
.s
= strdup((const char*) yytext
); Return(STRING
);}
620 Return(CLOSE_SQUARE
);
642 while (yyinput() != '*');
645 while (input() != '*');
650 case '*': unput('*');
663 case YY_STATE_EOF(INITIAL
):
666 case YY_END_OF_BUFFER
:
668 /* amount of text matched not including the EOB char */
669 int yy_amount_of_matched_text
= yy_cp
- yytext
- 1;
671 /* undo the effects of YY_DO_BEFORE_ACTION */
672 *yy_cp
= yy_hold_char
;
674 /* note that here we test for yy_c_buf_p "<=" to the position
675 * of the first EOB in the buffer, since yy_c_buf_p will
676 * already have been incremented past the NUL character
677 * (since all states make transitions on EOB to the end-
678 * of-buffer state). Contrast this with the test in yyinput().
680 if ( yy_c_buf_p
<= &yy_current_buffer
->yy_ch_buf
[yy_n_chars
] )
681 /* this was really a NUL */
683 yy_state_type yy_next_state
;
685 yy_c_buf_p
= yytext
+ yy_amount_of_matched_text
;
687 yy_current_state
= yy_get_previous_state();
689 /* okay, we're now positioned to make the
690 * NUL transition. We couldn't have
691 * yy_get_previous_state() go ahead and do it
692 * for us because it doesn't know how to deal
693 * with the possibility of jamming (and we
694 * don't want to build jamming into it because
695 * then it will run more slowly)
698 yy_next_state
= yy_try_NUL_trans( yy_current_state
);
700 yy_bp
= yytext
+ YY_MORE_ADJ
;
704 /* consume the NUL */
705 yy_cp
= ++yy_c_buf_p
;
706 yy_current_state
= yy_next_state
;
712 yy_cp
= yy_last_accepting_cpos
;
713 yy_current_state
= yy_last_accepting_state
;
718 else switch ( yy_get_next_buffer() )
720 case EOB_ACT_END_OF_FILE
:
722 yy_did_buffer_switch_on_eof
= 0;
726 /* note: because we've taken care in
727 * yy_get_next_buffer() to have set up yytext,
728 * we can now set up yy_c_buf_p so that if some
729 * total hoser (like flex itself) wants
730 * to call the scanner after we return the
731 * YY_NULL, it'll still work - another YY_NULL
734 yy_c_buf_p
= yytext
+ YY_MORE_ADJ
;
736 yy_act
= YY_STATE_EOF((yy_start
- 1) / 2);
742 if ( ! yy_did_buffer_switch_on_eof
)
748 case EOB_ACT_CONTINUE_SCAN
:
749 yy_c_buf_p
= yytext
+ yy_amount_of_matched_text
;
751 yy_current_state
= yy_get_previous_state();
754 yy_bp
= yytext
+ YY_MORE_ADJ
;
757 case EOB_ACT_LAST_MATCH
:
759 &yy_current_buffer
->yy_ch_buf
[yy_n_chars
];
761 yy_current_state
= yy_get_previous_state();
764 yy_bp
= yytext
+ YY_MORE_ADJ
;
772 printf( "action # %d\n", yy_act
);
775 "fatal flex scanner internal error--no action found" );
778 #if defined(__VISAGECPP__)
779 /* VA complains about proc maybe not returning a value so return one */
785 /* yy_get_next_buffer - try to read in a new buffer
788 * int yy_get_next_buffer();
790 * returns a code representing an action
791 * EOB_ACT_LAST_MATCH -
792 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
793 * EOB_ACT_END_OF_FILE - end of file
796 static int yy_get_next_buffer()
799 register YY_CHAR
*dest
= yy_current_buffer
->yy_ch_buf
;
800 register YY_CHAR
*source
= yytext
- 1; /* copy prev. char, too */
801 register int number_to_move
, i
;
804 if ( yy_c_buf_p
> &yy_current_buffer
->yy_ch_buf
[yy_n_chars
+ 1] )
806 "fatal flex scanner internal error--end of buffer missed" );
808 /* try to read more data */
810 /* first move last chars to start of buffer */
811 number_to_move
= yy_c_buf_p
- yytext
;
813 for ( i
= 0; i
< number_to_move
; ++i
)
814 *(dest
++) = *(source
++);
816 if ( yy_current_buffer
->yy_eof_status
!= EOF_NOT_SEEN
)
817 /* don't do the read, it's not guaranteed to return an EOF,
824 int num_to_read
= yy_current_buffer
->yy_buf_size
- number_to_move
- 1;
826 if ( num_to_read
> YY_READ_BUF_SIZE
)
827 num_to_read
= YY_READ_BUF_SIZE
;
829 else if ( num_to_read
<= 0 )
830 YY_FATAL_ERROR( "fatal error - scanner input buffer overflow" );
832 /* read in more data */
833 YY_INPUT( (&yy_current_buffer
->yy_ch_buf
[number_to_move
]),
834 yy_n_chars
, num_to_read
);
837 if ( yy_n_chars
== 0 )
839 if ( number_to_move
== 1 )
841 ret_val
= EOB_ACT_END_OF_FILE
;
842 yy_current_buffer
->yy_eof_status
= EOF_DONE
;
847 ret_val
= EOB_ACT_LAST_MATCH
;
848 yy_current_buffer
->yy_eof_status
= EOF_PENDING
;
853 ret_val
= EOB_ACT_CONTINUE_SCAN
;
855 yy_n_chars
+= number_to_move
;
856 yy_current_buffer
->yy_ch_buf
[yy_n_chars
] = YY_END_OF_BUFFER_CHAR
;
857 yy_current_buffer
->yy_ch_buf
[yy_n_chars
+ 1] = YY_END_OF_BUFFER_CHAR
;
859 /* yytext begins at the second character in yy_ch_buf; the first
860 * character is the one which preceded it before reading in the latest
861 * buffer; it needs to be kept around in case it's a newline, so
862 * yy_get_previous_state() will have with '^' rules active
865 yytext
= &yy_current_buffer
->yy_ch_buf
[1];
871 /* yy_get_previous_state - get the state just before the EOB char was reached
874 * yy_state_type yy_get_previous_state();
877 static yy_state_type
yy_get_previous_state()
880 register yy_state_type yy_current_state
;
881 register YY_CHAR
*yy_cp
;
883 yy_current_state
= yy_start
;
885 for ( yy_cp
= yytext
+ YY_MORE_ADJ
; yy_cp
< yy_c_buf_p
; ++yy_cp
)
887 register YY_CHAR yy_c
= (*yy_cp
? yy_ec
[*yy_cp
] : 1);
888 if ( yy_accept
[yy_current_state
] )
890 yy_last_accepting_state
= yy_current_state
;
891 yy_last_accepting_cpos
= yy_cp
;
893 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
895 yy_current_state
= yy_def
[yy_current_state
];
896 if ( yy_current_state
>= 34 )
897 yy_c
= yy_meta
[yy_c
];
899 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + yy_c
];
902 return ( yy_current_state
);
906 /* yy_try_NUL_trans - try to make a transition on the NUL character
909 * next_state = yy_try_NUL_trans( current_state );
913 static yy_state_type
yy_try_NUL_trans( register yy_state_type yy_current_state
)
915 static yy_state_type
yy_try_NUL_trans( yy_current_state
)
916 register yy_state_type yy_current_state
;
920 register int yy_is_jam
;
921 register YY_CHAR
*yy_cp
= yy_c_buf_p
;
923 register YY_CHAR yy_c
= 1;
924 if ( yy_accept
[yy_current_state
] )
926 yy_last_accepting_state
= yy_current_state
;
927 yy_last_accepting_cpos
= yy_cp
;
929 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
931 yy_current_state
= yy_def
[yy_current_state
];
932 if ( yy_current_state
>= 34 )
933 yy_c
= yy_meta
[yy_c
];
935 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + yy_c
];
936 yy_is_jam
= (yy_current_state
== 33);
938 return ( yy_is_jam
? 0 : yy_current_state
);
943 static void yyunput( YY_CHAR c
, register YY_CHAR
*yy_bp
)
945 static void yyunput( c
, yy_bp
)
947 register YY_CHAR
*yy_bp
;
951 register YY_CHAR
*yy_cp
= yy_c_buf_p
;
953 /* undo effects of setting up yytext */
954 *yy_cp
= yy_hold_char
;
956 if ( yy_cp
< yy_current_buffer
->yy_ch_buf
+ 2 )
957 { /* need to shift things up to make room */
958 register int number_to_move
= yy_n_chars
+ 2; /* +2 for EOB chars */
959 register YY_CHAR
*dest
=
960 &yy_current_buffer
->yy_ch_buf
[yy_current_buffer
->yy_buf_size
+ 2];
961 register YY_CHAR
*source
=
962 &yy_current_buffer
->yy_ch_buf
[number_to_move
];
964 while ( source
> yy_current_buffer
->yy_ch_buf
)
967 yy_cp
+= dest
- source
;
968 yy_bp
+= dest
- source
;
969 yy_n_chars
= yy_current_buffer
->yy_buf_size
;
971 if ( yy_cp
< yy_current_buffer
->yy_ch_buf
+ 2 )
972 YY_FATAL_ERROR( "flex scanner push-back overflow" );
975 if ( yy_cp
> yy_bp
&& yy_cp
[-1] == '\n' )
980 /* note: the formal parameter *must* be called "yy_bp" for this
981 * macro to now work correctly
983 YY_DO_BEFORE_ACTION
; /* set up yytext again */
995 YY_CHAR
*yy_cp
= yy_c_buf_p
;
997 *yy_cp
= yy_hold_char
;
999 if ( *yy_c_buf_p
== YY_END_OF_BUFFER_CHAR
)
1001 /* yy_c_buf_p now points to the character we want to return.
1002 * If this occurs *before* the EOB characters, then it's a
1003 * valid NUL; if not, then we've hit the end of the buffer.
1005 if ( yy_c_buf_p
< &yy_current_buffer
->yy_ch_buf
[yy_n_chars
] )
1006 /* this was really a NUL */
1010 { /* need more input */
1011 yytext
= yy_c_buf_p
;
1014 switch ( yy_get_next_buffer() )
1016 case EOB_ACT_END_OF_FILE
:
1020 yy_c_buf_p
= yytext
+ YY_MORE_ADJ
;
1027 return ( yyinput() );
1034 case EOB_ACT_CONTINUE_SCAN
:
1035 yy_c_buf_p
= yytext
+ YY_MORE_ADJ
;
1038 case EOB_ACT_LAST_MATCH
:
1040 YY_FATAL_ERROR( "unexpected last match in yyinput()" );
1042 YY_FATAL_ERROR( "unexpected last match in input()" );
1049 yy_hold_char
= *++yy_c_buf_p
;
1055 #ifdef YY_USE_PROTOS
1056 void yyrestart( FILE *input_file
)
1058 void yyrestart( input_file
)
1063 yy_init_buffer( yy_current_buffer
, input_file
);
1064 yy_load_buffer_state();
1068 #ifdef YY_USE_PROTOS
1069 void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer
)
1071 void yy_switch_to_buffer( new_buffer
)
1072 YY_BUFFER_STATE new_buffer
;
1076 if ( yy_current_buffer
== new_buffer
)
1079 if ( yy_current_buffer
)
1081 /* flush out information for old buffer */
1082 *yy_c_buf_p
= yy_hold_char
;
1083 yy_current_buffer
->yy_buf_pos
= yy_c_buf_p
;
1084 yy_current_buffer
->yy_n_chars
= yy_n_chars
;
1087 yy_current_buffer
= new_buffer
;
1088 yy_load_buffer_state();
1090 /* we don't actually know whether we did this switch during
1091 * EOF (yywrap()) processing, but the only time this flag
1092 * is looked at is after yywrap() is called, so it's safe
1093 * to go ahead and always set it.
1095 yy_did_buffer_switch_on_eof
= 1;
1099 #ifdef YY_USE_PROTOS
1100 void yy_load_buffer_state( void )
1102 void yy_load_buffer_state()
1106 yy_n_chars
= yy_current_buffer
->yy_n_chars
;
1107 yytext
= yy_c_buf_p
= yy_current_buffer
->yy_buf_pos
;
1108 yyin
= yy_current_buffer
->yy_input_file
;
1109 yy_hold_char
= *yy_c_buf_p
;
1113 #ifdef YY_USE_PROTOS
1114 YY_BUFFER_STATE
yy_create_buffer( FILE *file
, int size
)
1116 YY_BUFFER_STATE
yy_create_buffer( file
, size
)
1124 b
= (YY_BUFFER_STATE
) malloc( sizeof( struct yy_buffer_state
) );
1127 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1129 b
->yy_buf_size
= size
;
1131 /* yy_ch_buf has to be 2 characters longer than the size given because
1132 * we need to put in 2 end-of-buffer characters.
1134 b
->yy_ch_buf
= (YY_CHAR
*) malloc( (unsigned) (b
->yy_buf_size
+ 2) );
1136 if ( ! b
->yy_ch_buf
)
1137 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1139 yy_init_buffer( b
, file
);
1145 #ifdef YY_USE_PROTOS
1146 void yy_delete_buffer( YY_BUFFER_STATE b
)
1148 void yy_delete_buffer( b
)
1153 if ( b
== yy_current_buffer
)
1154 yy_current_buffer
= (YY_BUFFER_STATE
) 0;
1156 free( (char *) b
->yy_ch_buf
);
1161 #ifdef YY_USE_PROTOS
1162 void yy_init_buffer( YY_BUFFER_STATE b
, FILE *file
)
1164 void yy_init_buffer( b
, file
)
1170 b
->yy_input_file
= file
;
1172 /* we put in the '\n' and start reading from [1] so that an
1173 * initial match-at-newline will be true.
1176 b
->yy_ch_buf
[0] = '\n';
1179 /* we always need two end-of-buffer characters. The first causes
1180 * a transition to the end-of-buffer state. The second causes
1181 * a jam in that state.
1183 b
->yy_ch_buf
[1] = YY_END_OF_BUFFER_CHAR
;
1184 b
->yy_ch_buf
[2] = YY_END_OF_BUFFER_CHAR
;
1186 b
->yy_buf_pos
= &b
->yy_ch_buf
[1];
1188 b
->yy_eof_status
= EOF_NOT_SEEN
;
1190 # line 108 "lexer.l"
1195 static int lex_input() {
1198 #else /* BSD/AT&T lex */
1200 # error "Sorry, but need either flex or AT&T lex"
1202 static int lex_input() {
1206 # define unput(_c) my_unput(_c)
1210 # define input() my_input()
1211 static int my_unput(char c
)
1213 if (lex_read_from_string
) {
1214 /* Make sure we have something */
1215 if (lex_string_ptr
) {
1216 if (c
== '\n') yylineno
--;
1220 yytchar
= (c
);if(yytchar
=='\n')yylineno
--;*yysptr
++=yytchar
;
1221 /* unput(c); Causes infinite recursion! */
1229 void LexFromFile(FILE *fd
)
1231 lex_read_from_string
= 0;
1233 /* Don't know why this is necessary, but otherwise
1234 * lex only works _once_!
1241 void LexFromString(char *buffer
)
1243 lex_read_from_string
= 1;
1244 lex_buffer
= buffer
;
1245 lex_buffer_length
= strlen((const char*) buffer
);
1247 /* Don't know why this is necessary, but otherwise
1248 * lex only works _once_!
1255 static int my_input( void )
1257 if (lex_read_from_string
) {
1258 if (lex_string_ptr
== lex_buffer_length
)
1261 char c
= lex_buffer
[lex_string_ptr
++];
1262 #ifndef FLEX_SCANNER
1263 if (c
== '\n') yylineno
++;
1272 void wxExprCleanUp()
1274 if (yy_current_buffer
)
1275 yy_delete_buffer(yy_current_buffer
);