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 */
73 #endif /* ! __cplusplus */
87 #define YY_PROTO(proto) proto
89 #define YY_PROTO(proto) ()
90 /* we can't get here if it's an ANSI C compiler, or a C++ compiler,
91 * so it's got to be a K&R compiler, and therefore there's no standard
92 * place from which to include these definitions
101 /* amount of stuff to slurp up with each read */
102 #ifndef YY_READ_BUF_SIZE
103 #define YY_READ_BUF_SIZE 8192
107 /* returned upon end-of-file */
111 /* copy whatever the last rule matched to the standard output */
113 /* cast to (char *) is because for 8-bit chars, yytext is (unsigned char *) */
114 /* this used to be an fputs(), but since the string might contain NUL's,
115 * we now use fwrite()
117 #define ECHO (void) fwrite( (char *) yytext, yyleng, 1, yyout )
120 /* gets input and stuffs it into "buf". number of characters read, or YY_NULL,
121 * is returned in "result".
123 #define YY_INPUT(buf,result,max_size) \
124 if ( (result = read( fileno(yyin), (char *) buf, max_size )) < 0 ) \
125 YY_FATAL_ERROR( "read() in flex scanner failed" );
129 /* no semi-colon after return; correct usage is to write "yyterminate();" -
130 * we don't want an extra ';' after the "return" because that will cause
131 * some compilers to complain about unreachable statements.
133 #define yyterminate() return ( YY_NULL )
136 /* report a fatal error */
138 /* The funky do-while is used to turn this macro definition into
139 * a single C statement (which needs a semi-colon terminator).
140 * This avoids problems with code like:
142 * if ( something_happens )
143 * YY_FATAL_ERROR( "oops, the something happened" );
147 * Prior to using the do-while the compiler would get upset at the
148 * "else" because it interpreted the "if" statement as being all
149 * done when it reached the ';' after the YY_FATAL_ERROR() call.
152 #if !defined(__VISAGECPP__)
153 #define YY_FATAL_ERROR(msg) \
156 (void) fputs( msg, stderr ); \
157 (void) putc( '\n', stderr ); \
162 /* suppress expression always false warning */
164 #define YY_FATAL_ERROR(msg) \
167 (void) fputs( msg, stderr ); \
168 (void) putc( '\n', stderr ); \
171 while ( os2var == 0 )
175 /* default yywrap function - always treat EOF as an EOF */
176 int yywrap(void) { return 1; }
179 /* enter a start condition. This macro really ought to take a parameter,
180 * but we do it the disgusting crufty way forced on us by the ()-less
181 * definition of BEGIN
183 #define BEGIN yy_start = 1 + 2 *
185 /* action number for EOF rule of a given start state */
186 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
188 /* special action meaning "start processing a new file" */
189 #if !defined(__VISAGECPP__)
190 #define YY_NEW_FILE \
193 yy_init_buffer( yy_current_buffer, yyin ); \
194 yy_load_buffer_state(); \
198 #define YY_NEW_FILE \
201 yy_init_buffer( yy_current_buffer, yyin ); \
202 yy_load_buffer_state(); \
204 while ( os2var == 0 )
208 /* default declaration of generated scanner - a define so the user can
209 * easily add parameters
211 #define YY_DECL int yylex YY_PROTO(( void ))
214 #define YY_END_OF_BUFFER_CHAR 0
217 #define YY_BUF_SIZE (YY_READ_BUF_SIZE * 2) /* size of default input buffer */
220 typedef struct yy_buffer_state
*YY_BUFFER_STATE
;
222 #define YY_CHAR unsigned char
223 // # line 1 "lexer.l"
225 // # line 9 "lexer.l"
228 * Description: Lexical analyser for PROLOGIO; can be used with
229 * either lex and flex.
233 /* +++steve162e: added, otherwise, PROIO_input will be undefined (at least under LINUX)
234 please check, if this is also TRUE under other UNIXes.
237 #if defined(FLEX_SCANNER) && defined(_LINUX)
238 #define PROIO_input my_input
242 #include "wx/deprecated/expr.h"
244 extern char *malloc();
247 #if defined(VMS) && ( __VMS_VER < 70000000 )
248 #define strdup(s) (strcpy((char *)malloc(strlen(s)+1), s));
251 static size_t lex_buffer_length
= 0;
252 static const char *lex_buffer
= NULL
;
253 static size_t lex_string_ptr
= 0;
254 static int lex_read_from_string
= 0;
256 static int my_input(void);
258 static int my_unput(char);
263 #define YY_INPUT(buf,result,max_size) \
264 if (lex_read_from_string) \
266 int c = my_input(); \
267 result = (c == 0) ? YY_NULL : ((buf)[0]=(c), 1); \
270 if ( (result = read( fileno(yyin), (char *) buf, max_size )) < 0 ) \
271 YY_FATAL_ERROR( "read() in flex scanner failed" );
276 #define unput(_c) my_unput(_c)
279 // # line 58 "lexer.l"
281 /* done after the current pattern has been matched and before the
282 * corresponding action - sets up yytext
285 #define YY_DO_BEFORE_ACTION \
287 yyleng = yy_cp - yy_bp; \
288 yy_hold_char = *yy_cp; \
292 #define EOB_ACT_CONTINUE_SCAN 0
293 #define EOB_ACT_END_OF_FILE 1
294 #define EOB_ACT_LAST_MATCH 2
296 /* return all but the first 'n' matched characters back to the input stream */
297 #if !defined(__VISAGECPP__)
301 /* undo effects of setting up yytext */ \
302 *yy_cp = yy_hold_char; \
303 yy_c_buf_p = yy_cp = yy_bp + n; \
304 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
311 /* undo effects of setting up yytext */ \
312 *yy_cp = yy_hold_char; \
313 yy_c_buf_p = yy_cp = yy_bp + n; \
314 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
316 while ( os2var == 0 )
320 #define unput(c) yyunput( c, yytext )
322 struct yy_buffer_state
326 YY_CHAR
*yy_ch_buf
; /* input buffer */
327 YY_CHAR
*yy_buf_pos
; /* current position in input buffer */
329 /* size of input buffer in bytes, not including room for EOB characters*/
332 /* number of characters read into yy_ch_buf, not including EOB characters */
335 int yy_eof_status
; /* whether we've seen an EOF on this buffer */
337 #define EOF_NOT_SEEN 0
339 /* "pending" happens when the EOF has been seen but there's still
343 #define EOF_PENDING 1
347 static YY_BUFFER_STATE yy_current_buffer
;
349 /* we provide macros for accessing buffer states in case in the
350 * future we want to put the buffer states in a more general
353 #define YY_CURRENT_BUFFER yy_current_buffer
356 /* yy_hold_char holds the character lost when yytext is formed */
357 static YY_CHAR yy_hold_char
;
359 static int yy_n_chars
; /* number of characters read into yy_ch_buf */
363 #ifndef YY_USER_ACTION
364 #define YY_USER_ACTION
371 extern YY_CHAR
*yytext
;
373 extern FILE *yyin
, *yyout
;
378 FILE *yyin
= (FILE *) 0, *yyout
= (FILE *) 0;
380 #define YY_END_OF_BUFFER 18
381 typedef int yy_state_type
;
382 static const short int yy_accept
[34] =
384 0, 0, 18, 16, 13, 14, 16, 16, 6, 7,
385 16, 8, 12, 16, 1, 11, 3, 9, 10, 2,
386 0, 5, 0, 0, 0, 4, 1, 15, 3, 5,
390 static const YY_CHAR yy_ec
[256] =
392 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
393 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
394 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
395 1, 2, 1, 4, 1, 1, 1, 1, 5, 6,
396 7, 8, 9, 10, 9, 11, 12, 13, 13, 13,
397 13, 13, 13, 13, 13, 13, 13, 1, 1, 1,
398 14, 1, 1, 1, 15, 15, 15, 15, 15, 15,
399 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
400 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
401 16, 17, 18, 1, 15, 1, 15, 15, 15, 15,
403 19, 15, 15, 15, 15, 15, 15, 15, 15, 15,
404 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
405 15, 15, 1, 20, 1, 1, 1, 1, 1, 1,
406 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
407 1, 1, 1, 1, 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,
414 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
415 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,
422 static const YY_CHAR yy_meta
[21] =
424 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
425 1, 1, 2, 1, 2, 1, 3, 1, 2, 1
428 static const short int yy_base
[37] =
430 0, 0, 48, 55, 55, 55, 17, 42, 55, 55,
431 19, 55, 55, 23, 17, 55, 0, 55, 55, 0,
432 18, 55, 19, 23, 21, 55, 12, 55, 0, 24,
433 25, 29, 55, 49, 52, 22
436 static const short int yy_def
[37] =
438 33, 1, 33, 33, 33, 33, 34, 35, 33, 33,
439 33, 33, 33, 33, 33, 33, 36, 33, 33, 36,
440 34, 33, 34, 34, 35, 33, 33, 33, 36, 34,
441 34, 34, 0, 33, 33, 33
444 static const short int yy_nxt
[76] =
446 4, 5, 6, 7, 8, 9, 10, 4, 11, 12,
447 13, 14, 15, 16, 17, 18, 4, 19, 20, 4,
448 22, 22, 30, 29, 27, 26, 22, 22, 30, 27,
449 28, 27, 30, 23, 23, 23, 24, 24, 24, 31,
450 23, 32, 24, 24, 24, 23, 26, 33, 24, 21,
451 21, 21, 25, 25, 3, 33, 33, 33, 33, 33,
452 33, 33, 33, 33, 33, 33, 33, 33, 33, 33,
456 static const short int yy_chk
[76] =
458 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
459 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
460 7, 21, 23, 36, 27, 25, 24, 30, 31, 15,
461 14, 11, 32, 7, 21, 23, 7, 21, 23, 24,
462 30, 31, 24, 30, 31, 32, 8, 3, 32, 34,
463 34, 34, 35, 35, 33, 33, 33, 33, 33, 33,
464 33, 33, 33, 33, 33, 33, 33, 33, 33, 33,
468 static yy_state_type yy_last_accepting_state
;
469 static YY_CHAR
*yy_last_accepting_cpos
;
471 /* the intent behind this definition is that it'll catch
472 * any uses of REJECT which flex missed
474 #define REJECT reject_used_but_not_detected
475 #define yymore() yymore_used_but_not_detected
476 #define YY_MORE_ADJ 0
478 /* these variables are all declared out here so that section 3 code can
481 /* points to current character in buffer */
482 static YY_CHAR
*yy_c_buf_p
= (YY_CHAR
*) 0;
483 static int yy_init
= 1; /* whether we need to initialize */
484 static int yy_start
= 0; /* start state number */
486 /* flag which is used to allow yywrap()'s to do buffer switches
487 * instead of setting up a fresh yyin. A bit of a hack ...
489 static int yy_did_buffer_switch_on_eof
;
491 static yy_state_type yy_get_previous_state
YY_PROTO(( void ));
492 static yy_state_type yy_try_NUL_trans
YY_PROTO(( yy_state_type current_state
));
493 static int yy_get_next_buffer
YY_PROTO(( void ));
494 static void yyunput
YY_PROTO(( YY_CHAR c
, YY_CHAR
*buf_ptr
));
495 void yyrestart
YY_PROTO(( FILE *input_file
));
496 void yy_switch_to_buffer
YY_PROTO(( YY_BUFFER_STATE new_buffer
));
497 void yy_load_buffer_state
YY_PROTO(( void ));
498 YY_BUFFER_STATE yy_create_buffer
YY_PROTO(( FILE *file
, int size
));
499 void yy_delete_buffer
YY_PROTO(( YY_BUFFER_STATE b
));
500 void yy_init_buffer
YY_PROTO(( YY_BUFFER_STATE b
, FILE *file
));
502 #define yy_new_buffer yy_create_buffer
505 static int yyinput
YY_PROTO(( void ));
507 static int input
YY_PROTO(( void ));
512 register yy_state_type yy_current_state
;
513 register YY_CHAR
*yy_cp
, *yy_bp
;
524 yy_start
= 1; /* first start state */
532 if ( yy_current_buffer
)
533 yy_init_buffer( yy_current_buffer
, yyin
);
535 yy_current_buffer
= yy_create_buffer( yyin
, YY_BUF_SIZE
);
537 yy_load_buffer_state();
542 #if !defined(__VISAGECPP__)
543 while ( 1 ) /* loops until end-of-file is reached */
546 if (os2var
== 0) return 0;
547 while ( os2var
== 1 ) /* loops until end-of-file is reached */
552 /* support of yytext */
553 *yy_cp
= yy_hold_char
;
555 /* yy_bp points to the position in yy_ch_buf of the start of the
560 yy_current_state
= yy_start
;
564 register YY_CHAR yy_c
= yy_ec
[*yy_cp
];
565 if ( yy_accept
[yy_current_state
] )
567 yy_last_accepting_state
= yy_current_state
;
568 yy_last_accepting_cpos
= yy_cp
;
570 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
572 yy_current_state
= yy_def
[yy_current_state
];
573 if ( yy_current_state
>= 34 )
574 yy_c
= yy_meta
[yy_c
];
576 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + yy_c
];
579 while ( yy_current_state
!= 33 );
580 yy_cp
= yy_last_accepting_cpos
;
581 yy_current_state
= yy_last_accepting_state
;
584 yy_act
= yy_accept
[yy_current_state
];
589 do_action
: /* this label is used only to access EOF actions */
594 case 0: /* must backtrack */
596 /* undo the effects of YY_DO_BEFORE_ACTION */
597 *yy_cp
= yy_hold_char
;
598 yy_cp
= yy_last_accepting_cpos
;
599 yy_current_state
= yy_last_accepting_state
;
605 yylval
.s
= strdup((const char*) yytext
);
616 yylval
.s
= strdup((const char*) yytext
);
622 int len
= strlen((const char*) yytext
);
624 yylval
.s
= strdup((const char*) (yytext
+1));
630 yylval
.s
= strdup((const char*) yytext
);
683 while (yyinput() != '*');
686 while (input() != '*');
711 case YY_STATE_EOF(INITIAL
):
716 case YY_END_OF_BUFFER
:
718 /* amount of text matched not including the EOB char */
719 int yy_amount_of_matched_text
= yy_cp
- yytext
- 1;
721 /* undo the effects of YY_DO_BEFORE_ACTION */
722 *yy_cp
= yy_hold_char
;
724 /* note that here we test for yy_c_buf_p "<=" to the position
725 * of the first EOB in the buffer, since yy_c_buf_p will
726 * already have been incremented past the NUL character
727 * (since all states make transitions on EOB to the end-
728 * of-buffer state). Contrast this with the test in yyinput().
730 if ( yy_c_buf_p
<= &yy_current_buffer
->yy_ch_buf
[yy_n_chars
] )
731 /* this was really a NUL */
733 yy_state_type yy_next_state
;
735 yy_c_buf_p
= yytext
+ yy_amount_of_matched_text
;
737 yy_current_state
= yy_get_previous_state();
739 /* okay, we're now positioned to make the
740 * NUL transition. We couldn't have
741 * yy_get_previous_state() go ahead and do it
742 * for us because it doesn't know how to deal
743 * with the possibility of jamming (and we
744 * don't want to build jamming into it because
745 * then it will run more slowly)
748 yy_next_state
= yy_try_NUL_trans( yy_current_state
);
750 yy_bp
= yytext
+ YY_MORE_ADJ
;
754 /* consume the NUL */
755 yy_cp
= ++yy_c_buf_p
;
756 yy_current_state
= yy_next_state
;
761 yy_cp
= yy_last_accepting_cpos
;
762 yy_current_state
= yy_last_accepting_state
;
766 else switch ( yy_get_next_buffer() )
768 case EOB_ACT_END_OF_FILE
:
770 yy_did_buffer_switch_on_eof
= 0;
774 /* note: because we've taken care in
775 * yy_get_next_buffer() to have set up yytext,
776 * we can now set up yy_c_buf_p so that if some
777 * total hoser (like flex itself) wants
778 * to call the scanner after we return the
779 * YY_NULL, it'll still work - another YY_NULL
782 yy_c_buf_p
= yytext
+ YY_MORE_ADJ
;
784 yy_act
= YY_STATE_EOF((yy_start
- 1) / 2);
789 if ( ! yy_did_buffer_switch_on_eof
)
795 case EOB_ACT_CONTINUE_SCAN
:
796 yy_c_buf_p
= yytext
+ yy_amount_of_matched_text
;
798 yy_current_state
= yy_get_previous_state();
801 yy_bp
= yytext
+ YY_MORE_ADJ
;
804 case EOB_ACT_LAST_MATCH
:
805 yy_c_buf_p
= &yy_current_buffer
->yy_ch_buf
[yy_n_chars
];
807 yy_current_state
= yy_get_previous_state();
810 yy_bp
= yytext
+ YY_MORE_ADJ
;
818 printf( "action # %d\n", yy_act
);
820 YY_FATAL_ERROR("fatal flex scanner internal error--no action found" );
824 #if defined(__VISAGECPP__)
825 /* VA complains about proc maybe not returning a value so return one */
831 /* yy_get_next_buffer - try to read in a new buffer
834 * int yy_get_next_buffer();
836 * returns a code representing an action
837 * EOB_ACT_LAST_MATCH -
838 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
839 * EOB_ACT_END_OF_FILE - end of file
842 static int yy_get_next_buffer()
844 register YY_CHAR
*dest
= yy_current_buffer
->yy_ch_buf
;
845 register YY_CHAR
*source
= yytext
- 1; /* copy prev. char, too */
846 register int number_to_move
, i
;
849 if ( yy_c_buf_p
> &yy_current_buffer
->yy_ch_buf
[yy_n_chars
+ 1] )
851 "fatal flex scanner internal error--end of buffer missed" );
853 /* try to read more data */
855 /* first move last chars to start of buffer */
856 number_to_move
= yy_c_buf_p
- yytext
;
858 for ( i
= 0; i
< number_to_move
; ++i
)
859 *(dest
++) = *(source
++);
861 if ( yy_current_buffer
->yy_eof_status
!= EOF_NOT_SEEN
)
862 /* don't do the read, it's not guaranteed to return an EOF,
869 int num_to_read
= yy_current_buffer
->yy_buf_size
- number_to_move
- 1;
871 if ( num_to_read
> YY_READ_BUF_SIZE
)
872 num_to_read
= YY_READ_BUF_SIZE
;
874 else if ( num_to_read
<= 0 )
875 YY_FATAL_ERROR( "fatal error - scanner input buffer overflow" );
877 /* read in more data */
878 YY_INPUT( (&yy_current_buffer
->yy_ch_buf
[number_to_move
]),
879 yy_n_chars
, num_to_read
);
882 if ( yy_n_chars
== 0 )
884 if ( number_to_move
== 1 )
886 ret_val
= EOB_ACT_END_OF_FILE
;
887 yy_current_buffer
->yy_eof_status
= EOF_DONE
;
892 ret_val
= EOB_ACT_LAST_MATCH
;
893 yy_current_buffer
->yy_eof_status
= EOF_PENDING
;
898 ret_val
= EOB_ACT_CONTINUE_SCAN
;
900 yy_n_chars
+= number_to_move
;
901 yy_current_buffer
->yy_ch_buf
[yy_n_chars
] = YY_END_OF_BUFFER_CHAR
;
902 yy_current_buffer
->yy_ch_buf
[yy_n_chars
+ 1] = YY_END_OF_BUFFER_CHAR
;
904 /* yytext begins at the second character in yy_ch_buf; the first
905 * character is the one which preceded it before reading in the latest
906 * buffer; it needs to be kept around in case it's a newline, so
907 * yy_get_previous_state() will have with '^' rules active
910 yytext
= &yy_current_buffer
->yy_ch_buf
[1];
916 /* yy_get_previous_state - get the state just before the EOB char was reached
919 * yy_state_type yy_get_previous_state();
922 static yy_state_type
yy_get_previous_state()
924 register yy_state_type yy_current_state
;
925 register YY_CHAR
*yy_cp
;
927 yy_current_state
= yy_start
;
929 for ( yy_cp
= yytext
+ YY_MORE_ADJ
; yy_cp
< yy_c_buf_p
; ++yy_cp
)
931 register YY_CHAR yy_c
= (*yy_cp
? yy_ec
[*yy_cp
] : 1);
932 if ( yy_accept
[yy_current_state
] )
934 yy_last_accepting_state
= yy_current_state
;
935 yy_last_accepting_cpos
= yy_cp
;
937 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
939 yy_current_state
= yy_def
[yy_current_state
];
940 if ( yy_current_state
>= 34 )
941 yy_c
= yy_meta
[yy_c
];
943 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + yy_c
];
946 return ( yy_current_state
);
950 /* yy_try_NUL_trans - try to make a transition on the NUL character
953 * next_state = yy_try_NUL_trans( current_state );
957 static yy_state_type
yy_try_NUL_trans( register yy_state_type yy_current_state
)
959 static yy_state_type
yy_try_NUL_trans( yy_current_state
)
960 register yy_state_type yy_current_state
;
963 register int yy_is_jam
;
964 register YY_CHAR
*yy_cp
= yy_c_buf_p
;
966 register YY_CHAR yy_c
= 1;
967 if ( yy_accept
[yy_current_state
] )
969 yy_last_accepting_state
= yy_current_state
;
970 yy_last_accepting_cpos
= yy_cp
;
972 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
974 yy_current_state
= yy_def
[yy_current_state
];
975 if ( yy_current_state
>= 34 )
976 yy_c
= yy_meta
[yy_c
];
978 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + yy_c
];
979 yy_is_jam
= (yy_current_state
== 33);
981 return ( yy_is_jam
? 0 : yy_current_state
);
986 static void yyunput( YY_CHAR c
, register YY_CHAR
*yy_bp
)
988 static void yyunput( c
, yy_bp
)
990 register YY_CHAR
*yy_bp
;
993 register YY_CHAR
*yy_cp
= yy_c_buf_p
;
995 /* undo effects of setting up yytext */
996 *yy_cp
= yy_hold_char
;
998 if ( yy_cp
< yy_current_buffer
->yy_ch_buf
+ 2 )
999 { /* need to shift things up to make room */
1000 register int number_to_move
= yy_n_chars
+ 2; /* +2 for EOB chars */
1001 register YY_CHAR
*dest
=
1002 &yy_current_buffer
->yy_ch_buf
[yy_current_buffer
->yy_buf_size
+ 2];
1003 register YY_CHAR
*source
=
1004 &yy_current_buffer
->yy_ch_buf
[number_to_move
];
1006 while ( source
> yy_current_buffer
->yy_ch_buf
)
1007 *--dest
= *--source
;
1009 yy_cp
+= dest
- source
;
1010 yy_bp
+= dest
- source
;
1011 yy_n_chars
= yy_current_buffer
->yy_buf_size
;
1013 if ( yy_cp
< yy_current_buffer
->yy_ch_buf
+ 2 )
1014 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1017 if ( yy_cp
> yy_bp
&& yy_cp
[-1] == '\n' )
1022 /* note: the formal parameter *must* be called "yy_bp" for this
1023 * macro to now work correctly
1025 YY_DO_BEFORE_ACTION
; /* set up yytext again */
1030 static int yyinput()
1036 YY_CHAR
*yy_cp
= yy_c_buf_p
;
1038 *yy_cp
= yy_hold_char
;
1040 if ( *yy_c_buf_p
== YY_END_OF_BUFFER_CHAR
)
1042 /* yy_c_buf_p now points to the character we want to return.
1043 * If this occurs *before* the EOB characters, then it's a
1044 * valid NUL; if not, then we've hit the end of the buffer.
1046 if ( yy_c_buf_p
< &yy_current_buffer
->yy_ch_buf
[yy_n_chars
] )
1047 { /* this was really a NUL */
1051 { /* need more input */
1052 yytext
= yy_c_buf_p
;
1055 switch ( yy_get_next_buffer() )
1057 case EOB_ACT_END_OF_FILE
:
1061 yy_c_buf_p
= yytext
+ YY_MORE_ADJ
;
1067 return ( yyinput() );
1073 case EOB_ACT_CONTINUE_SCAN
:
1074 yy_c_buf_p
= yytext
+ YY_MORE_ADJ
;
1077 case EOB_ACT_LAST_MATCH
:
1079 YY_FATAL_ERROR( "unexpected last match in yyinput()" );
1081 YY_FATAL_ERROR( "unexpected last match in input()" );
1088 yy_hold_char
= *++yy_c_buf_p
;
1094 #ifdef YY_USE_PROTOS
1095 void yyrestart( FILE *input_file
)
1097 void yyrestart( input_file
)
1101 yy_init_buffer( yy_current_buffer
, input_file
);
1102 yy_load_buffer_state();
1106 #ifdef YY_USE_PROTOS
1107 void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer
)
1109 void yy_switch_to_buffer( new_buffer
)
1110 YY_BUFFER_STATE new_buffer
;
1113 if ( yy_current_buffer
== new_buffer
)
1116 if ( yy_current_buffer
)
1118 /* flush out information for old buffer */
1119 *yy_c_buf_p
= yy_hold_char
;
1120 yy_current_buffer
->yy_buf_pos
= yy_c_buf_p
;
1121 yy_current_buffer
->yy_n_chars
= yy_n_chars
;
1124 yy_current_buffer
= new_buffer
;
1125 yy_load_buffer_state();
1127 /* we don't actually know whether we did this switch during
1128 * EOF (yywrap()) processing, but the only time this flag
1129 * is looked at is after yywrap() is called, so it's safe
1130 * to go ahead and always set it.
1132 yy_did_buffer_switch_on_eof
= 1;
1136 #ifdef YY_USE_PROTOS
1137 void yy_load_buffer_state( void )
1139 void yy_load_buffer_state()
1142 yy_n_chars
= yy_current_buffer
->yy_n_chars
;
1143 yytext
= yy_c_buf_p
= yy_current_buffer
->yy_buf_pos
;
1144 yyin
= yy_current_buffer
->yy_input_file
;
1145 yy_hold_char
= *yy_c_buf_p
;
1149 #ifdef YY_USE_PROTOS
1150 YY_BUFFER_STATE
yy_create_buffer( FILE *file
, int size
)
1152 YY_BUFFER_STATE
yy_create_buffer( file
, size
)
1159 b
= (YY_BUFFER_STATE
) malloc( sizeof( struct yy_buffer_state
) );
1162 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1164 b
->yy_buf_size
= size
;
1166 /* yy_ch_buf has to be 2 characters longer than the size given because
1167 * we need to put in 2 end-of-buffer characters.
1169 b
->yy_ch_buf
= (YY_CHAR
*) malloc( (unsigned) (b
->yy_buf_size
+ 2) );
1171 if ( ! b
->yy_ch_buf
)
1172 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1174 yy_init_buffer( b
, file
);
1180 #ifdef YY_USE_PROTOS
1181 void yy_delete_buffer( YY_BUFFER_STATE b
)
1183 void yy_delete_buffer( b
)
1187 if ( b
== yy_current_buffer
)
1188 yy_current_buffer
= (YY_BUFFER_STATE
) 0;
1190 free( (char *) b
->yy_ch_buf
);
1195 #ifdef YY_USE_PROTOS
1196 void yy_init_buffer( YY_BUFFER_STATE b
, FILE *file
)
1198 void yy_init_buffer( b
, file
)
1203 b
->yy_input_file
= file
;
1205 /* we put in the '\n' and start reading from [1] so that an
1206 * initial match-at-newline will be true.
1209 b
->yy_ch_buf
[0] = '\n';
1212 /* we always need two end-of-buffer characters. The first causes
1213 * a transition to the end-of-buffer state. The second causes
1214 * a jam in that state.
1216 b
->yy_ch_buf
[1] = YY_END_OF_BUFFER_CHAR
;
1217 b
->yy_ch_buf
[2] = YY_END_OF_BUFFER_CHAR
;
1219 b
->yy_buf_pos
= &b
->yy_ch_buf
[1];
1221 b
->yy_eof_status
= EOF_NOT_SEEN
;
1223 // # line 108 "lexer.l"
1228 static int lex_input()
1232 #else /* BSD/AT&T lex */
1234 #error "Sorry, but need either flex or AT&T lex"
1236 static int lex_input() {
1242 # define unput(_c) my_unput(_c)
1246 # define input() my_input()
1247 static int my_unput(char c
)
1249 if (lex_read_from_string
)
1251 /* Make sure we have something */
1254 if (c
== '\n') yylineno
--;
1260 yytchar
= (c
);if(yytchar
=='\n')yylineno
--;*yysptr
++=yytchar
;
1261 /* unput(c); Causes infinite recursion! */
1268 void LexFromFile(FILE *fd
)
1270 lex_read_from_string
= 0;
1272 /* Don't know why this is necessary, but otherwise
1273 * lex only works _once_!
1280 void LexFromString(char *buffer
)
1282 lex_read_from_string
= 1;
1283 lex_buffer
= buffer
;
1284 lex_buffer_length
= strlen((const char*) buffer
);
1286 /* Don't know why this is necessary, but otherwise
1287 * lex only works _once_!
1294 static int my_input( void )
1296 if (lex_read_from_string
)
1298 if (lex_string_ptr
== lex_buffer_length
)
1304 char c
= lex_buffer
[lex_string_ptr
++];
1305 #ifndef FLEX_SCANNER
1306 if (c
== '\n') yylineno
++;
1317 void wxExprCleanUp()
1319 if (yy_current_buffer
)
1320 yy_delete_buffer(yy_current_buffer
);