1 /* A lexical scanner generated by flex */
3 /* scanner skeleton version:
5 Last change: JS 13 Jul 97 6:17 pm
7 /* Copyright: (c) Julian Smart */
8 /* Licence: wxWindows Licence */
15 /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
44 /* use prototypes in function declarations */
47 /* the "const" storage-class-modifier is valid */
50 #else /* ! __cplusplus */
71 #if defined(__MINGW32__) || defined(__WATCOMC__)
75 #endif /* ! __cplusplus */
89 #define YY_PROTO(proto) proto
91 #define YY_PROTO(proto) ()
92 /* we can't get here if it's an ANSI C compiler, or a C++ compiler,
93 * so it's got to be a K&R compiler, and therefore there's no standard
94 * place from which to include these definitions
103 /* amount of stuff to slurp up with each read */
104 #ifndef YY_READ_BUF_SIZE
105 #define YY_READ_BUF_SIZE 8192
109 /* returned upon end-of-file */
113 /* copy whatever the last rule matched to the standard output */
115 /* cast to (char *) is because for 8-bit chars, yytext is (unsigned char *) */
116 /* this used to be an fputs(), but since the string might contain NUL's,
117 * we now use fwrite()
119 #define ECHO (void) fwrite( (char *) yytext, yyleng, 1, yyout )
122 /* gets input and stuffs it into "buf". number of characters read, or YY_NULL,
123 * is returned in "result".
125 #define YY_INPUT(buf,result,max_size) \
126 if ( (result = read( fileno(yyin), (char *) buf, max_size )) < 0 ) \
127 YY_FATAL_ERROR( "read() in flex scanner failed" );
131 /* no semi-colon after return; correct usage is to write "yyterminate();" -
132 * we don't want an extra ';' after the "return" because that will cause
133 * some compilers to complain about unreachable statements.
135 #define yyterminate() return ( YY_NULL )
138 /* report a fatal error */
140 /* The funky do-while is used to turn this macro definition into
141 * a single C statement (which needs a semi-colon terminator).
142 * This avoids problems with code like:
144 * if ( something_happens )
145 * YY_FATAL_ERROR( "oops, the something happened" );
149 * Prior to using the do-while the compiler would get upset at the
150 * "else" because it interpreted the "if" statement as being all
151 * done when it reached the ';' after the YY_FATAL_ERROR() call.
154 #if !defined(__VISAGECPP__)
155 #define YY_FATAL_ERROR(msg) \
158 (void) fputs( msg, stderr ); \
159 (void) putc( '\n', stderr ); \
164 /* suppress expression always false warning */
166 #define YY_FATAL_ERROR(msg) \
169 (void) fputs( msg, stderr ); \
170 (void) putc( '\n', stderr ); \
173 while ( os2var == 0 )
177 /* default yywrap function - always treat EOF as an EOF */
178 int yywrap(void) { return 1; }
181 /* enter a start condition. This macro really ought to take a parameter,
182 * but we do it the disgusting crufty way forced on us by the ()-less
183 * definition of BEGIN
185 #define BEGIN yy_start = 1 + 2 *
187 /* action number for EOF rule of a given start state */
188 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
190 /* special action meaning "start processing a new file" */
191 #if !defined(__VISAGECPP__)
192 #define YY_NEW_FILE \
195 yy_init_buffer( yy_current_buffer, yyin ); \
196 yy_load_buffer_state(); \
200 #define YY_NEW_FILE \
203 yy_init_buffer( yy_current_buffer, yyin ); \
204 yy_load_buffer_state(); \
206 while ( os2var == 0 )
210 /* default declaration of generated scanner - a define so the user can
211 * easily add parameters
213 #define YY_DECL int yylex YY_PROTO(( void ))
216 #define YY_END_OF_BUFFER_CHAR 0
219 #define YY_BUF_SIZE (YY_READ_BUF_SIZE * 2) /* size of default input buffer */
222 typedef struct yy_buffer_state
*YY_BUFFER_STATE
;
224 #define YY_CHAR unsigned char
225 // # line 1 "lexer.l"
227 // # line 9 "lexer.l"
230 * Description: Lexical analyser for PROLOGIO; can be used with
231 * either lex and flex.
235 /* +++steve162e: added, otherwise, PROIO_input will be undefined (at least under LINUX)
236 please check, if this is also TRUE under other UNIXes.
239 #if defined(FLEX_SCANNER) && defined(_LINUX)
240 #define PROIO_input my_input
244 #include "wx/deprecated/expr.h"
246 extern char *malloc();
249 #if defined(VMS) && ( __VMS_VER < 70000000 )
250 #define strdup(s) (strcpy((char *)malloc(strlen(s)+1), s));
253 static size_t lex_buffer_length
= 0;
254 static const char *lex_buffer
= NULL
;
255 static size_t lex_string_ptr
= 0;
256 static int lex_read_from_string
= 0;
258 static int my_input(void);
260 static int my_unput(char);
265 #define YY_INPUT(buf,result,max_size) \
266 if (lex_read_from_string) \
268 int c = my_input(); \
269 result = (c == 0) ? YY_NULL : ((buf)[0]=(c), 1); \
272 if ( (result = read( fileno(yyin), (char *) buf, max_size )) < 0 ) \
273 YY_FATAL_ERROR( "read() in flex scanner failed" );
278 #define unput(_c) my_unput(_c)
281 // # line 58 "lexer.l"
283 /* done after the current pattern has been matched and before the
284 * corresponding action - sets up yytext
287 #define YY_DO_BEFORE_ACTION \
289 yyleng = yy_cp - yy_bp; \
290 yy_hold_char = *yy_cp; \
294 #define EOB_ACT_CONTINUE_SCAN 0
295 #define EOB_ACT_END_OF_FILE 1
296 #define EOB_ACT_LAST_MATCH 2
298 /* return all but the first 'n' matched characters back to the input stream */
299 #if !defined(__VISAGECPP__)
303 /* undo effects of setting up yytext */ \
304 *yy_cp = yy_hold_char; \
305 yy_c_buf_p = yy_cp = yy_bp + n; \
306 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
313 /* undo effects of setting up yytext */ \
314 *yy_cp = yy_hold_char; \
315 yy_c_buf_p = yy_cp = yy_bp + n; \
316 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
318 while ( os2var == 0 )
322 #define unput(c) yyunput( c, yytext )
324 struct yy_buffer_state
328 YY_CHAR
*yy_ch_buf
; /* input buffer */
329 YY_CHAR
*yy_buf_pos
; /* current position in input buffer */
331 /* size of input buffer in bytes, not including room for EOB characters*/
334 /* number of characters read into yy_ch_buf, not including EOB characters */
337 int yy_eof_status
; /* whether we've seen an EOF on this buffer */
339 #define EOF_NOT_SEEN 0
341 /* "pending" happens when the EOF has been seen but there's still
345 #define EOF_PENDING 1
349 static YY_BUFFER_STATE yy_current_buffer
;
351 /* we provide macros for accessing buffer states in case in the
352 * future we want to put the buffer states in a more general
355 #define YY_CURRENT_BUFFER yy_current_buffer
358 /* yy_hold_char holds the character lost when yytext is formed */
359 static YY_CHAR yy_hold_char
;
361 static int yy_n_chars
; /* number of characters read into yy_ch_buf */
365 #ifndef YY_USER_ACTION
366 #define YY_USER_ACTION
373 extern YY_CHAR
*yytext
;
375 extern FILE *yyin
, *yyout
;
380 FILE *yyin
= (FILE *) 0, *yyout
= (FILE *) 0;
382 #define YY_END_OF_BUFFER 18
383 typedef int yy_state_type
;
384 static const short int yy_accept
[34] =
386 0, 0, 18, 16, 13, 14, 16, 16, 6, 7,
387 16, 8, 12, 16, 1, 11, 3, 9, 10, 2,
388 0, 5, 0, 0, 0, 4, 1, 15, 3, 5,
392 static const YY_CHAR yy_ec
[256] =
394 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
395 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
396 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
397 1, 2, 1, 4, 1, 1, 1, 1, 5, 6,
398 7, 8, 9, 10, 9, 11, 12, 13, 13, 13,
399 13, 13, 13, 13, 13, 13, 13, 1, 1, 1,
400 14, 1, 1, 1, 15, 15, 15, 15, 15, 15,
401 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
402 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
403 16, 17, 18, 1, 15, 1, 15, 15, 15, 15,
405 19, 15, 15, 15, 15, 15, 15, 15, 15, 15,
406 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
407 15, 15, 1, 20, 1, 1, 1, 1, 1, 1,
408 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
409 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
410 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
411 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
412 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
413 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
414 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
416 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
417 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
418 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
419 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
420 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
424 static const YY_CHAR yy_meta
[21] =
426 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
427 1, 1, 2, 1, 2, 1, 3, 1, 2, 1
430 static const short int yy_base
[37] =
432 0, 0, 48, 55, 55, 55, 17, 42, 55, 55,
433 19, 55, 55, 23, 17, 55, 0, 55, 55, 0,
434 18, 55, 19, 23, 21, 55, 12, 55, 0, 24,
435 25, 29, 55, 49, 52, 22
438 static const short int yy_def
[37] =
440 33, 1, 33, 33, 33, 33, 34, 35, 33, 33,
441 33, 33, 33, 33, 33, 33, 36, 33, 33, 36,
442 34, 33, 34, 34, 35, 33, 33, 33, 36, 34,
443 34, 34, 0, 33, 33, 33
446 static const short int yy_nxt
[76] =
448 4, 5, 6, 7, 8, 9, 10, 4, 11, 12,
449 13, 14, 15, 16, 17, 18, 4, 19, 20, 4,
450 22, 22, 30, 29, 27, 26, 22, 22, 30, 27,
451 28, 27, 30, 23, 23, 23, 24, 24, 24, 31,
452 23, 32, 24, 24, 24, 23, 26, 33, 24, 21,
453 21, 21, 25, 25, 3, 33, 33, 33, 33, 33,
454 33, 33, 33, 33, 33, 33, 33, 33, 33, 33,
458 static const short int yy_chk
[76] =
460 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
461 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
462 7, 21, 23, 36, 27, 25, 24, 30, 31, 15,
463 14, 11, 32, 7, 21, 23, 7, 21, 23, 24,
464 30, 31, 24, 30, 31, 32, 8, 3, 32, 34,
465 34, 34, 35, 35, 33, 33, 33, 33, 33, 33,
466 33, 33, 33, 33, 33, 33, 33, 33, 33, 33,
470 static yy_state_type yy_last_accepting_state
;
471 static YY_CHAR
*yy_last_accepting_cpos
;
473 /* the intent behind this definition is that it'll catch
474 * any uses of REJECT which flex missed
476 #define REJECT reject_used_but_not_detected
477 #define yymore() yymore_used_but_not_detected
478 #define YY_MORE_ADJ 0
480 /* these variables are all declared out here so that section 3 code can
483 /* points to current character in buffer */
484 static YY_CHAR
*yy_c_buf_p
= (YY_CHAR
*) 0;
485 static int yy_init
= 1; /* whether we need to initialize */
486 static int yy_start
= 0; /* start state number */
488 /* flag which is used to allow yywrap()'s to do buffer switches
489 * instead of setting up a fresh yyin. A bit of a hack ...
491 static int yy_did_buffer_switch_on_eof
;
493 static yy_state_type yy_get_previous_state
YY_PROTO(( void ));
494 static yy_state_type yy_try_NUL_trans
YY_PROTO(( yy_state_type current_state
));
495 static int yy_get_next_buffer
YY_PROTO(( void ));
496 static void yyunput
YY_PROTO(( YY_CHAR c
, YY_CHAR
*buf_ptr
));
497 void yyrestart
YY_PROTO(( FILE *input_file
));
498 void yy_switch_to_buffer
YY_PROTO(( YY_BUFFER_STATE new_buffer
));
499 void yy_load_buffer_state
YY_PROTO(( void ));
500 YY_BUFFER_STATE yy_create_buffer
YY_PROTO(( FILE *file
, int size
));
501 void yy_delete_buffer
YY_PROTO(( YY_BUFFER_STATE b
));
502 void yy_init_buffer
YY_PROTO(( YY_BUFFER_STATE b
, FILE *file
));
504 #define yy_new_buffer yy_create_buffer
507 static int yyinput
YY_PROTO(( void ));
509 static int input
YY_PROTO(( void ));
514 register yy_state_type yy_current_state
;
515 register YY_CHAR
*yy_cp
, *yy_bp
;
526 yy_start
= 1; /* first start state */
534 if ( yy_current_buffer
)
535 yy_init_buffer( yy_current_buffer
, yyin
);
537 yy_current_buffer
= yy_create_buffer( yyin
, YY_BUF_SIZE
);
539 yy_load_buffer_state();
544 #if !defined(__VISAGECPP__)
545 while ( 1 ) /* loops until end-of-file is reached */
548 if (os2var
== 0) return 0;
549 while ( os2var
== 1 ) /* loops until end-of-file is reached */
554 /* support of yytext */
555 *yy_cp
= yy_hold_char
;
557 /* yy_bp points to the position in yy_ch_buf of the start of the
562 yy_current_state
= yy_start
;
566 register YY_CHAR yy_c
= yy_ec
[*yy_cp
];
567 if ( yy_accept
[yy_current_state
] )
569 yy_last_accepting_state
= yy_current_state
;
570 yy_last_accepting_cpos
= yy_cp
;
572 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
574 yy_current_state
= yy_def
[yy_current_state
];
575 if ( yy_current_state
>= 34 )
576 yy_c
= yy_meta
[yy_c
];
578 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + yy_c
];
581 while ( yy_current_state
!= 33 );
582 yy_cp
= yy_last_accepting_cpos
;
583 yy_current_state
= yy_last_accepting_state
;
586 yy_act
= yy_accept
[yy_current_state
];
591 do_action
: /* this label is used only to access EOF actions */
596 case 0: /* must backtrack */
598 /* undo the effects of YY_DO_BEFORE_ACTION */
599 *yy_cp
= yy_hold_char
;
600 yy_cp
= yy_last_accepting_cpos
;
601 yy_current_state
= yy_last_accepting_state
;
607 yylval
.s
= strdup((const char*) yytext
);
618 yylval
.s
= strdup((const char*) yytext
);
624 int len
= strlen((const char*) yytext
);
626 yylval
.s
= strdup((const char*) (yytext
+1));
632 yylval
.s
= strdup((const char*) yytext
);
685 while (yyinput() != '*') ;
688 while (input() != '*') ;
713 case YY_STATE_EOF(INITIAL
):
718 case YY_END_OF_BUFFER
:
720 /* amount of text matched not including the EOB char */
721 int yy_amount_of_matched_text
= yy_cp
- yytext
- 1;
723 /* undo the effects of YY_DO_BEFORE_ACTION */
724 *yy_cp
= yy_hold_char
;
726 /* note that here we test for yy_c_buf_p "<=" to the position
727 * of the first EOB in the buffer, since yy_c_buf_p will
728 * already have been incremented past the NUL character
729 * (since all states make transitions on EOB to the end-
730 * of-buffer state). Contrast this with the test in yyinput().
732 if ( yy_c_buf_p
<= &yy_current_buffer
->yy_ch_buf
[yy_n_chars
] )
733 /* this was really a NUL */
735 yy_state_type yy_next_state
;
737 yy_c_buf_p
= yytext
+ yy_amount_of_matched_text
;
739 yy_current_state
= yy_get_previous_state();
741 /* okay, we're now positioned to make the
742 * NUL transition. We couldn't have
743 * yy_get_previous_state() go ahead and do it
744 * for us because it doesn't know how to deal
745 * with the possibility of jamming (and we
746 * don't want to build jamming into it because
747 * then it will run more slowly)
750 yy_next_state
= yy_try_NUL_trans( yy_current_state
);
752 yy_bp
= yytext
+ YY_MORE_ADJ
;
756 /* consume the NUL */
757 yy_cp
= ++yy_c_buf_p
;
758 yy_current_state
= yy_next_state
;
763 yy_cp
= yy_last_accepting_cpos
;
764 yy_current_state
= yy_last_accepting_state
;
768 else switch ( yy_get_next_buffer() )
770 case EOB_ACT_END_OF_FILE
:
772 yy_did_buffer_switch_on_eof
= 0;
776 /* note: because we've taken care in
777 * yy_get_next_buffer() to have set up yytext,
778 * we can now set up yy_c_buf_p so that if some
779 * total hoser (like flex itself) wants
780 * to call the scanner after we return the
781 * YY_NULL, it'll still work - another YY_NULL
784 yy_c_buf_p
= yytext
+ YY_MORE_ADJ
;
786 yy_act
= YY_STATE_EOF((yy_start
- 1) / 2);
791 if ( ! yy_did_buffer_switch_on_eof
)
797 case EOB_ACT_CONTINUE_SCAN
:
798 yy_c_buf_p
= yytext
+ yy_amount_of_matched_text
;
800 yy_current_state
= yy_get_previous_state();
803 yy_bp
= yytext
+ YY_MORE_ADJ
;
806 case EOB_ACT_LAST_MATCH
:
807 yy_c_buf_p
= &yy_current_buffer
->yy_ch_buf
[yy_n_chars
];
809 yy_current_state
= yy_get_previous_state();
812 yy_bp
= yytext
+ YY_MORE_ADJ
;
820 printf( "action # %d\n", yy_act
);
822 YY_FATAL_ERROR("fatal flex scanner internal error--no action found" );
826 #if defined(__VISAGECPP__)
827 /* VA complains about proc maybe not returning a value so return one */
833 /* yy_get_next_buffer - try to read in a new buffer
836 * int yy_get_next_buffer();
838 * returns a code representing an action
839 * EOB_ACT_LAST_MATCH -
840 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
841 * EOB_ACT_END_OF_FILE - end of file
844 static int yy_get_next_buffer()
846 register YY_CHAR
*dest
= yy_current_buffer
->yy_ch_buf
;
847 register YY_CHAR
*source
= yytext
- 1; /* copy prev. char, too */
848 register int number_to_move
, i
;
851 if ( yy_c_buf_p
> &yy_current_buffer
->yy_ch_buf
[yy_n_chars
+ 1] )
853 "fatal flex scanner internal error--end of buffer missed" );
855 /* try to read more data */
857 /* first move last chars to start of buffer */
858 number_to_move
= yy_c_buf_p
- yytext
;
860 for ( i
= 0; i
< number_to_move
; ++i
)
861 *(dest
++) = *(source
++);
863 if ( yy_current_buffer
->yy_eof_status
!= EOF_NOT_SEEN
)
864 /* don't do the read, it's not guaranteed to return an EOF,
871 int num_to_read
= yy_current_buffer
->yy_buf_size
- number_to_move
- 1;
873 if ( num_to_read
> YY_READ_BUF_SIZE
)
874 num_to_read
= YY_READ_BUF_SIZE
;
876 else if ( num_to_read
<= 0 )
877 YY_FATAL_ERROR( "fatal error - scanner input buffer overflow" );
879 /* read in more data */
880 YY_INPUT( (&yy_current_buffer
->yy_ch_buf
[number_to_move
]),
881 yy_n_chars
, num_to_read
);
884 if ( yy_n_chars
== 0 )
886 if ( number_to_move
== 1 )
888 ret_val
= EOB_ACT_END_OF_FILE
;
889 yy_current_buffer
->yy_eof_status
= EOF_DONE
;
894 ret_val
= EOB_ACT_LAST_MATCH
;
895 yy_current_buffer
->yy_eof_status
= EOF_PENDING
;
900 ret_val
= EOB_ACT_CONTINUE_SCAN
;
902 yy_n_chars
+= number_to_move
;
903 yy_current_buffer
->yy_ch_buf
[yy_n_chars
] = YY_END_OF_BUFFER_CHAR
;
904 yy_current_buffer
->yy_ch_buf
[yy_n_chars
+ 1] = YY_END_OF_BUFFER_CHAR
;
906 /* yytext begins at the second character in yy_ch_buf; the first
907 * character is the one which preceded it before reading in the latest
908 * buffer; it needs to be kept around in case it's a newline, so
909 * yy_get_previous_state() will have with '^' rules active
912 yytext
= &yy_current_buffer
->yy_ch_buf
[1];
918 /* yy_get_previous_state - get the state just before the EOB char was reached
921 * yy_state_type yy_get_previous_state();
924 static yy_state_type
yy_get_previous_state()
926 register yy_state_type yy_current_state
;
927 register YY_CHAR
*yy_cp
;
929 yy_current_state
= yy_start
;
931 for ( yy_cp
= yytext
+ YY_MORE_ADJ
; yy_cp
< yy_c_buf_p
; ++yy_cp
)
933 register YY_CHAR yy_c
= (*yy_cp
? yy_ec
[*yy_cp
] : 1);
934 if ( yy_accept
[yy_current_state
] )
936 yy_last_accepting_state
= yy_current_state
;
937 yy_last_accepting_cpos
= yy_cp
;
939 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
941 yy_current_state
= yy_def
[yy_current_state
];
942 if ( yy_current_state
>= 34 )
943 yy_c
= yy_meta
[yy_c
];
945 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + yy_c
];
948 return ( yy_current_state
);
952 /* yy_try_NUL_trans - try to make a transition on the NUL character
955 * next_state = yy_try_NUL_trans( current_state );
959 static yy_state_type
yy_try_NUL_trans( register yy_state_type yy_current_state
)
961 static yy_state_type
yy_try_NUL_trans( yy_current_state
)
962 register yy_state_type yy_current_state
;
965 register int yy_is_jam
;
966 register YY_CHAR
*yy_cp
= yy_c_buf_p
;
968 register YY_CHAR yy_c
= 1;
969 if ( yy_accept
[yy_current_state
] )
971 yy_last_accepting_state
= yy_current_state
;
972 yy_last_accepting_cpos
= yy_cp
;
974 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
976 yy_current_state
= yy_def
[yy_current_state
];
977 if ( yy_current_state
>= 34 )
978 yy_c
= yy_meta
[yy_c
];
980 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + yy_c
];
981 yy_is_jam
= (yy_current_state
== 33);
983 return ( yy_is_jam
? 0 : yy_current_state
);
988 static void yyunput( YY_CHAR c
, register YY_CHAR
*yy_bp
)
990 static void yyunput( c
, yy_bp
)
992 register YY_CHAR
*yy_bp
;
995 register YY_CHAR
*yy_cp
= yy_c_buf_p
;
997 /* undo effects of setting up yytext */
998 *yy_cp
= yy_hold_char
;
1000 if ( yy_cp
< yy_current_buffer
->yy_ch_buf
+ 2 )
1001 { /* need to shift things up to make room */
1002 register int number_to_move
= yy_n_chars
+ 2; /* +2 for EOB chars */
1003 register YY_CHAR
*dest
=
1004 &yy_current_buffer
->yy_ch_buf
[yy_current_buffer
->yy_buf_size
+ 2];
1005 register YY_CHAR
*source
=
1006 &yy_current_buffer
->yy_ch_buf
[number_to_move
];
1008 while ( source
> yy_current_buffer
->yy_ch_buf
)
1009 *--dest
= *--source
;
1011 yy_cp
+= dest
- source
;
1012 yy_bp
+= dest
- source
;
1013 yy_n_chars
= yy_current_buffer
->yy_buf_size
;
1015 if ( yy_cp
< yy_current_buffer
->yy_ch_buf
+ 2 )
1016 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1019 if ( yy_cp
> yy_bp
&& yy_cp
[-1] == '\n' )
1024 /* note: the formal parameter *must* be called "yy_bp" for this
1025 * macro to now work correctly
1027 YY_DO_BEFORE_ACTION
; /* set up yytext again */
1032 static int yyinput()
1038 YY_CHAR
*yy_cp
= yy_c_buf_p
;
1040 *yy_cp
= yy_hold_char
;
1042 if ( *yy_c_buf_p
== YY_END_OF_BUFFER_CHAR
)
1044 /* yy_c_buf_p now points to the character we want to return.
1045 * If this occurs *before* the EOB characters, then it's a
1046 * valid NUL; if not, then we've hit the end of the buffer.
1048 if ( yy_c_buf_p
< &yy_current_buffer
->yy_ch_buf
[yy_n_chars
] )
1049 { /* this was really a NUL */
1053 { /* need more input */
1054 yytext
= yy_c_buf_p
;
1057 switch ( yy_get_next_buffer() )
1059 case EOB_ACT_END_OF_FILE
:
1063 yy_c_buf_p
= yytext
+ YY_MORE_ADJ
;
1069 return ( yyinput() );
1075 case EOB_ACT_CONTINUE_SCAN
:
1076 yy_c_buf_p
= yytext
+ YY_MORE_ADJ
;
1079 case EOB_ACT_LAST_MATCH
:
1081 YY_FATAL_ERROR( "unexpected last match in yyinput()" );
1083 YY_FATAL_ERROR( "unexpected last match in input()" );
1090 yy_hold_char
= *++yy_c_buf_p
;
1096 #ifdef YY_USE_PROTOS
1097 void yyrestart( FILE *input_file
)
1099 void yyrestart( input_file
)
1103 yy_init_buffer( yy_current_buffer
, input_file
);
1104 yy_load_buffer_state();
1108 #ifdef YY_USE_PROTOS
1109 void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer
)
1111 void yy_switch_to_buffer( new_buffer
)
1112 YY_BUFFER_STATE new_buffer
;
1115 if ( yy_current_buffer
== new_buffer
)
1118 if ( yy_current_buffer
)
1120 /* flush out information for old buffer */
1121 *yy_c_buf_p
= yy_hold_char
;
1122 yy_current_buffer
->yy_buf_pos
= yy_c_buf_p
;
1123 yy_current_buffer
->yy_n_chars
= yy_n_chars
;
1126 yy_current_buffer
= new_buffer
;
1127 yy_load_buffer_state();
1129 /* we don't actually know whether we did this switch during
1130 * EOF (yywrap()) processing, but the only time this flag
1131 * is looked at is after yywrap() is called, so it's safe
1132 * to go ahead and always set it.
1134 yy_did_buffer_switch_on_eof
= 1;
1138 #ifdef YY_USE_PROTOS
1139 void yy_load_buffer_state( void )
1141 void yy_load_buffer_state()
1144 yy_n_chars
= yy_current_buffer
->yy_n_chars
;
1145 yytext
= yy_c_buf_p
= yy_current_buffer
->yy_buf_pos
;
1146 yyin
= yy_current_buffer
->yy_input_file
;
1147 yy_hold_char
= *yy_c_buf_p
;
1151 #ifdef YY_USE_PROTOS
1152 YY_BUFFER_STATE
yy_create_buffer( FILE *file
, int size
)
1154 YY_BUFFER_STATE
yy_create_buffer( file
, size
)
1161 b
= (YY_BUFFER_STATE
) malloc( sizeof( struct yy_buffer_state
) );
1164 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1166 b
->yy_buf_size
= size
;
1168 /* yy_ch_buf has to be 2 characters longer than the size given because
1169 * we need to put in 2 end-of-buffer characters.
1171 b
->yy_ch_buf
= (YY_CHAR
*) malloc( (unsigned) (b
->yy_buf_size
+ 2) );
1173 if ( ! b
->yy_ch_buf
)
1174 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1176 yy_init_buffer( b
, file
);
1182 #ifdef YY_USE_PROTOS
1183 void yy_delete_buffer( YY_BUFFER_STATE b
)
1185 void yy_delete_buffer( b
)
1189 if ( b
== yy_current_buffer
)
1190 yy_current_buffer
= (YY_BUFFER_STATE
) 0;
1192 free( (char *) b
->yy_ch_buf
);
1197 #ifdef YY_USE_PROTOS
1198 void yy_init_buffer( YY_BUFFER_STATE b
, FILE *file
)
1200 void yy_init_buffer( b
, file
)
1205 b
->yy_input_file
= file
;
1207 /* we put in the '\n' and start reading from [1] so that an
1208 * initial match-at-newline will be true.
1211 b
->yy_ch_buf
[0] = '\n';
1214 /* we always need two end-of-buffer characters. The first causes
1215 * a transition to the end-of-buffer state. The second causes
1216 * a jam in that state.
1218 b
->yy_ch_buf
[1] = YY_END_OF_BUFFER_CHAR
;
1219 b
->yy_ch_buf
[2] = YY_END_OF_BUFFER_CHAR
;
1221 b
->yy_buf_pos
= &b
->yy_ch_buf
[1];
1223 b
->yy_eof_status
= EOF_NOT_SEEN
;
1225 // # line 108 "lexer.l"
1230 static int lex_input()
1234 #else /* BSD/AT&T lex */
1236 #error "Sorry, but need either flex or AT&T lex"
1238 static int lex_input() {
1244 # define unput(_c) my_unput(_c)
1248 # define input() my_input()
1249 static int my_unput(char c
)
1251 if (lex_read_from_string
)
1253 /* Make sure we have something */
1256 if (c
== '\n') yylineno
--;
1262 yytchar
= (c
);if(yytchar
=='\n')yylineno
--;*yysptr
++=yytchar
;
1263 /* unput(c); Causes infinite recursion! */
1270 void LexFromFile(FILE *fd
)
1272 lex_read_from_string
= 0;
1274 /* Don't know why this is necessary, but otherwise
1275 * lex only works _once_!
1282 void LexFromString(char *buffer
)
1284 lex_read_from_string
= 1;
1285 lex_buffer
= buffer
;
1286 lex_buffer_length
= strlen((const char*) buffer
);
1288 /* Don't know why this is necessary, but otherwise
1289 * lex only works _once_!
1296 static int my_input( void )
1298 if (lex_read_from_string
)
1300 if (lex_string_ptr
== lex_buffer_length
)
1306 char c
= lex_buffer
[lex_string_ptr
++];
1307 #ifndef FLEX_SCANNER
1308 if (c
== '\n') yylineno
++;
1319 void wxExprCleanUp()
1321 if (yy_current_buffer
)
1322 yy_delete_buffer(yy_current_buffer
);