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 */
12 #pragma warning(disable:4127) /* warning C4127: conditional expression is constant [about while ( 0 | 1 )] */
13 #pragma warning(disable:4244) /* warning C4244: '=' : conversion from 'A' to 'B', possible loss of data */
21 /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
50 /* use prototypes in function declarations */
53 /* the "const" storage-class-modifier is valid */
56 #else /* ! __cplusplus */
81 #if defined(__MINGW32__) || defined(__WATCOMC__)
85 #endif /* ! __cplusplus */
99 #define YY_PROTO(proto) proto
101 #define YY_PROTO(proto) ()
102 /* we can't get here if it's an ANSI C compiler, or a C++ compiler,
103 * so it's got to be a K&R compiler, and therefore there's no standard
104 * place from which to include these definitions
113 /* amount of stuff to slurp up with each read */
114 #ifndef YY_READ_BUF_SIZE
115 #define YY_READ_BUF_SIZE 8192
119 /* returned upon end-of-file */
123 /* copy whatever the last rule matched to the standard output */
125 /* cast to (char *) is because for 8-bit chars, yytext is (unsigned char *) */
126 /* this used to be an fputs(), but since the string might contain NUL's,
127 * we now use fwrite()
129 #define ECHO (void) fwrite( (char *) yytext, yyleng, 1, yyout )
132 /* gets input and stuffs it into "buf". number of characters read, or YY_NULL,
133 * is returned in "result".
135 #define YY_INPUT(buf,result,max_size) \
136 if ( (result = read( fileno(yyin), (char *) buf, max_size )) < 0 ) \
137 YY_FATAL_ERROR( "read() in flex scanner failed" );
141 /* no semi-colon after return; correct usage is to write "yyterminate();" -
142 * we don't want an extra ';' after the "return" because that will cause
143 * some compilers to complain about unreachable statements.
145 #define yyterminate() return ( YY_NULL )
148 /* report a fatal error */
150 /* The funky do-while is used to turn this macro definition into
151 * a single C statement (which needs a semi-colon terminator).
152 * This avoids problems with code like:
154 * if ( something_happens )
155 * YY_FATAL_ERROR( "oops, the something happened" );
159 * Prior to using the do-while the compiler would get upset at the
160 * "else" because it interpreted the "if" statement as being all
161 * done when it reached the ';' after the YY_FATAL_ERROR() call.
164 #if !defined(__VISAGECPP__)
165 #define YY_FATAL_ERROR(msg) \
168 (void) fputs( msg, stderr ); \
169 (void) putc( '\n', stderr ); \
174 /* suppress expression always false warning */
176 #define YY_FATAL_ERROR(msg) \
179 (void) fputs( msg, stderr ); \
180 (void) putc( '\n', stderr ); \
183 while ( os2var == 0 )
187 /* default yywrap function - always treat EOF as an EOF */
188 int yywrap(void) { return 1; }
191 /* enter a start condition. This macro really ought to take a parameter,
192 * but we do it the disgusting crufty way forced on us by the ()-less
193 * definition of BEGIN
195 #define BEGIN yy_start = 1 + 2 *
197 /* action number for EOF rule of a given start state */
198 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
200 /* special action meaning "start processing a new file" */
201 #if !defined(__VISAGECPP__)
202 #define YY_NEW_FILE \
205 yy_init_buffer( yy_current_buffer, yyin ); \
206 yy_load_buffer_state(); \
210 #define YY_NEW_FILE \
213 yy_init_buffer( yy_current_buffer, yyin ); \
214 yy_load_buffer_state(); \
216 while ( os2var == 0 )
220 /* default declaration of generated scanner - a define so the user can
221 * easily add parameters
223 #define YY_DECL int yylex YY_PROTO(( void ))
226 #define YY_END_OF_BUFFER_CHAR 0
229 #define YY_BUF_SIZE (YY_READ_BUF_SIZE * 2) /* size of default input buffer */
232 typedef struct yy_buffer_state
*YY_BUFFER_STATE
;
234 #define YY_CHAR unsigned char
235 /* # line 1 "lexer.l" */
237 /* # line 9 "lexer.l" */
240 * Description: Lexical analyser for PROLOGIO; can be used with
241 * either lex and flex.
245 /* +++steve162e: added, otherwise, PROIO_input will be undefined (at least under LINUX)
246 please check, if this is also TRUE under other UNIXes.
249 #if defined(FLEX_SCANNER) && defined(_LINUX)
250 #define PROIO_input my_input
254 #include "wx/deprecated/expr.h"
256 extern char *malloc();
259 #if defined(VMS) && ( __VMS_VER < 70000000 )
260 #define strdup(s) (strcpy((char *)malloc(strlen(s)+1), s));
263 static size_t lex_buffer_length
= 0;
264 static const char *lex_buffer
= NULL
;
265 static size_t lex_string_ptr
= 0;
266 static int lex_read_from_string
= 0;
268 static int my_input(void);
270 static int my_unput(char);
275 #define YY_INPUT(buf,result,max_size) \
276 if (lex_read_from_string) \
278 int c = my_input(); \
279 result = (c == 0) ? YY_NULL : ((buf)[0]=(c), 1); \
282 if ( (result = read( fileno(yyin), (char *) buf, max_size )) < 0 ) \
283 YY_FATAL_ERROR( "read() in flex scanner failed" );
288 #define unput(_c) my_unput(_c)
291 /* # line 58 "lexer.l" */
293 /* done after the current pattern has been matched and before the
294 * corresponding action - sets up yytext
297 #define YY_DO_BEFORE_ACTION \
299 yyleng = yy_cp - yy_bp; \
300 yy_hold_char = *yy_cp; \
304 #define EOB_ACT_CONTINUE_SCAN 0
305 #define EOB_ACT_END_OF_FILE 1
306 #define EOB_ACT_LAST_MATCH 2
308 /* return all but the first 'n' matched characters back to the input stream */
309 #if !defined(__VISAGECPP__)
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 */ \
323 /* undo effects of setting up yytext */ \
324 *yy_cp = yy_hold_char; \
325 yy_c_buf_p = yy_cp = yy_bp + n; \
326 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
328 while ( os2var == 0 )
332 #define unput(c) yyunput( c, yytext )
334 struct yy_buffer_state
338 YY_CHAR
*yy_ch_buf
; /* input buffer */
339 YY_CHAR
*yy_buf_pos
; /* current position in input buffer */
341 /* size of input buffer in bytes, not including room for EOB characters*/
344 /* number of characters read into yy_ch_buf, not including EOB characters */
347 int yy_eof_status
; /* whether we've seen an EOF on this buffer */
349 #define EOF_NOT_SEEN 0
351 /* "pending" happens when the EOF has been seen but there's still
355 #define EOF_PENDING 1
359 static YY_BUFFER_STATE yy_current_buffer
;
361 /* we provide macros for accessing buffer states in case in the
362 * future we want to put the buffer states in a more general
365 #define YY_CURRENT_BUFFER yy_current_buffer
368 /* yy_hold_char holds the character lost when yytext is formed */
369 static YY_CHAR yy_hold_char
;
371 static int yy_n_chars
; /* number of characters read into yy_ch_buf */
375 #ifndef YY_USER_ACTION
376 #define YY_USER_ACTION
383 extern YY_CHAR
*yytext
;
385 extern FILE *yyin
, *yyout
;
390 FILE *yyin
= (FILE *) 0, *yyout
= (FILE *) 0;
392 #define YY_END_OF_BUFFER 18
393 typedef int yy_state_type
;
394 static const short int yy_accept
[34] =
396 0, 0, 18, 16, 13, 14, 16, 16, 6, 7,
397 16, 8, 12, 16, 1, 11, 3, 9, 10, 2,
398 0, 5, 0, 0, 0, 4, 1, 15, 3, 5,
402 static const YY_CHAR yy_ec
[256] =
404 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
405 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
406 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
407 1, 2, 1, 4, 1, 1, 1, 1, 5, 6,
408 7, 8, 9, 10, 9, 11, 12, 13, 13, 13,
409 13, 13, 13, 13, 13, 13, 13, 1, 1, 1,
410 14, 1, 1, 1, 15, 15, 15, 15, 15, 15,
411 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
412 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
413 16, 17, 18, 1, 15, 1, 15, 15, 15, 15,
415 19, 15, 15, 15, 15, 15, 15, 15, 15, 15,
416 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
417 15, 15, 1, 20, 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,
421 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
422 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
423 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
424 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
426 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
427 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
428 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
429 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
430 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
434 static const YY_CHAR yy_meta
[21] =
436 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
437 1, 1, 2, 1, 2, 1, 3, 1, 2, 1
440 static const short int yy_base
[37] =
442 0, 0, 48, 55, 55, 55, 17, 42, 55, 55,
443 19, 55, 55, 23, 17, 55, 0, 55, 55, 0,
444 18, 55, 19, 23, 21, 55, 12, 55, 0, 24,
445 25, 29, 55, 49, 52, 22
448 static const short int yy_def
[37] =
450 33, 1, 33, 33, 33, 33, 34, 35, 33, 33,
451 33, 33, 33, 33, 33, 33, 36, 33, 33, 36,
452 34, 33, 34, 34, 35, 33, 33, 33, 36, 34,
453 34, 34, 0, 33, 33, 33
456 static const short int yy_nxt
[76] =
458 4, 5, 6, 7, 8, 9, 10, 4, 11, 12,
459 13, 14, 15, 16, 17, 18, 4, 19, 20, 4,
460 22, 22, 30, 29, 27, 26, 22, 22, 30, 27,
461 28, 27, 30, 23, 23, 23, 24, 24, 24, 31,
462 23, 32, 24, 24, 24, 23, 26, 33, 24, 21,
463 21, 21, 25, 25, 3, 33, 33, 33, 33, 33,
464 33, 33, 33, 33, 33, 33, 33, 33, 33, 33,
468 static const short int yy_chk
[76] =
470 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
471 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
472 7, 21, 23, 36, 27, 25, 24, 30, 31, 15,
473 14, 11, 32, 7, 21, 23, 7, 21, 23, 24,
474 30, 31, 24, 30, 31, 32, 8, 3, 32, 34,
475 34, 34, 35, 35, 33, 33, 33, 33, 33, 33,
476 33, 33, 33, 33, 33, 33, 33, 33, 33, 33,
480 static yy_state_type yy_last_accepting_state
;
481 static YY_CHAR
*yy_last_accepting_cpos
;
483 /* the intent behind this definition is that it'll catch
484 * any uses of REJECT which flex missed
486 #define REJECT reject_used_but_not_detected
487 #define yymore() yymore_used_but_not_detected
488 #define YY_MORE_ADJ 0
490 /* these variables are all declared out here so that section 3 code can
493 /* points to current character in buffer */
494 static YY_CHAR
*yy_c_buf_p
= (YY_CHAR
*) 0;
495 static int yy_init
= 1; /* whether we need to initialize */
496 static int yy_start
= 0; /* start state number */
498 /* flag which is used to allow yywrap()'s to do buffer switches
499 * instead of setting up a fresh yyin. A bit of a hack ...
501 static int yy_did_buffer_switch_on_eof
;
503 static yy_state_type yy_get_previous_state
YY_PROTO(( void ));
504 static yy_state_type yy_try_NUL_trans
YY_PROTO(( yy_state_type current_state
));
505 static int yy_get_next_buffer
YY_PROTO(( void ));
506 static void yyunput
YY_PROTO(( YY_CHAR c
, YY_CHAR
*buf_ptr
));
507 void yyrestart
YY_PROTO(( FILE *input_file
));
508 void yy_switch_to_buffer
YY_PROTO(( YY_BUFFER_STATE new_buffer
));
509 void yy_load_buffer_state
YY_PROTO(( void ));
510 YY_BUFFER_STATE yy_create_buffer
YY_PROTO(( FILE *file
, int size
));
511 void yy_delete_buffer
YY_PROTO(( YY_BUFFER_STATE b
));
512 void yy_init_buffer
YY_PROTO(( YY_BUFFER_STATE b
, FILE *file
));
514 #define yy_new_buffer yy_create_buffer
517 static int yyinput
YY_PROTO(( void ));
519 static int input
YY_PROTO(( void ));
524 register yy_state_type yy_current_state
;
525 register YY_CHAR
*yy_cp
, *yy_bp
;
536 yy_start
= 1; /* first start state */
544 if ( yy_current_buffer
)
545 yy_init_buffer( yy_current_buffer
, yyin
);
547 yy_current_buffer
= yy_create_buffer( yyin
, YY_BUF_SIZE
);
549 yy_load_buffer_state();
554 #if !defined(__VISAGECPP__)
555 while ( 1 ) /* loops until end-of-file is reached */
558 if (os2var
== 0) return 0;
559 while ( os2var
== 1 ) /* loops until end-of-file is reached */
564 /* support of yytext */
565 *yy_cp
= yy_hold_char
;
567 /* yy_bp points to the position in yy_ch_buf of the start of the
572 yy_current_state
= yy_start
;
576 register YY_CHAR yy_c
= yy_ec
[*yy_cp
];
577 if ( yy_accept
[yy_current_state
] )
579 yy_last_accepting_state
= yy_current_state
;
580 yy_last_accepting_cpos
= yy_cp
;
582 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
584 yy_current_state
= yy_def
[yy_current_state
];
585 if ( yy_current_state
>= 34 )
586 yy_c
= yy_meta
[yy_c
];
588 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + yy_c
];
591 while ( yy_current_state
!= 33 );
592 yy_cp
= yy_last_accepting_cpos
;
593 yy_current_state
= yy_last_accepting_state
;
596 yy_act
= yy_accept
[yy_current_state
];
601 do_action
: /* this label is used only to access EOF actions */
606 case 0: /* must backtrack */
608 /* undo the effects of YY_DO_BEFORE_ACTION */
609 *yy_cp
= yy_hold_char
;
610 yy_cp
= yy_last_accepting_cpos
;
611 yy_current_state
= yy_last_accepting_state
;
617 yylval
.s
= strdup((const char*) yytext
);
628 yylval
.s
= strdup((const char*) yytext
);
634 int len
= strlen((const char*) yytext
);
636 yylval
.s
= strdup((const char*) (yytext
+1));
642 yylval
.s
= strdup((const char*) yytext
);
695 while (yyinput() != '*') ;
698 while (input() != '*') ;
723 case YY_STATE_EOF(INITIAL
):
728 case YY_END_OF_BUFFER
:
730 /* amount of text matched not including the EOB char */
731 int yy_amount_of_matched_text
= yy_cp
- yytext
- 1;
733 /* undo the effects of YY_DO_BEFORE_ACTION */
734 *yy_cp
= yy_hold_char
;
736 /* note that here we test for yy_c_buf_p "<=" to the position
737 * of the first EOB in the buffer, since yy_c_buf_p will
738 * already have been incremented past the NUL character
739 * (since all states make transitions on EOB to the end-
740 * of-buffer state). Contrast this with the test in yyinput().
742 if ( yy_c_buf_p
<= &yy_current_buffer
->yy_ch_buf
[yy_n_chars
] )
743 /* this was really a NUL */
745 yy_state_type yy_next_state
;
747 yy_c_buf_p
= yytext
+ yy_amount_of_matched_text
;
749 yy_current_state
= yy_get_previous_state();
751 /* okay, we're now positioned to make the
752 * NUL transition. We couldn't have
753 * yy_get_previous_state() go ahead and do it
754 * for us because it doesn't know how to deal
755 * with the possibility of jamming (and we
756 * don't want to build jamming into it because
757 * then it will run more slowly)
760 yy_next_state
= yy_try_NUL_trans( yy_current_state
);
762 yy_bp
= yytext
+ YY_MORE_ADJ
;
766 /* consume the NUL */
767 yy_cp
= ++yy_c_buf_p
;
768 yy_current_state
= yy_next_state
;
773 yy_cp
= yy_last_accepting_cpos
;
774 yy_current_state
= yy_last_accepting_state
;
778 else switch ( yy_get_next_buffer() )
780 case EOB_ACT_END_OF_FILE
:
782 yy_did_buffer_switch_on_eof
= 0;
786 /* note: because we've taken care in
787 * yy_get_next_buffer() to have set up yytext,
788 * we can now set up yy_c_buf_p so that if some
789 * total hoser (like flex itself) wants
790 * to call the scanner after we return the
791 * YY_NULL, it'll still work - another YY_NULL
794 yy_c_buf_p
= yytext
+ YY_MORE_ADJ
;
796 yy_act
= YY_STATE_EOF((yy_start
- 1) / 2);
801 if ( ! yy_did_buffer_switch_on_eof
)
807 case EOB_ACT_CONTINUE_SCAN
:
808 yy_c_buf_p
= yytext
+ yy_amount_of_matched_text
;
810 yy_current_state
= yy_get_previous_state();
813 yy_bp
= yytext
+ YY_MORE_ADJ
;
816 case EOB_ACT_LAST_MATCH
:
817 yy_c_buf_p
= &yy_current_buffer
->yy_ch_buf
[yy_n_chars
];
819 yy_current_state
= yy_get_previous_state();
822 yy_bp
= yytext
+ YY_MORE_ADJ
;
830 printf( "action # %d\n", yy_act
);
832 YY_FATAL_ERROR("fatal flex scanner internal error--no action found" );
836 #if defined(__VISAGECPP__)
837 /* VA complains about proc maybe not returning a value so return one */
843 /* yy_get_next_buffer - try to read in a new buffer
846 * int yy_get_next_buffer();
848 * returns a code representing an action
849 * EOB_ACT_LAST_MATCH -
850 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
851 * EOB_ACT_END_OF_FILE - end of file
854 static int yy_get_next_buffer()
856 register YY_CHAR
*dest
= yy_current_buffer
->yy_ch_buf
;
857 register YY_CHAR
*source
= yytext
- 1; /* copy prev. char, too */
858 register int number_to_move
, i
;
861 if ( yy_c_buf_p
> &yy_current_buffer
->yy_ch_buf
[yy_n_chars
+ 1] )
862 YY_FATAL_ERROR( "fatal flex scanner internal error--end of buffer missed" );
864 /* try to read more data */
866 /* first move last chars to start of buffer */
867 number_to_move
= yy_c_buf_p
- yytext
;
869 for ( i
= 0; i
< number_to_move
; ++i
)
870 *(dest
++) = *(source
++);
872 if ( yy_current_buffer
->yy_eof_status
!= EOF_NOT_SEEN
)
873 /* don't do the read, it's not guaranteed to return an EOF,
880 int num_to_read
= yy_current_buffer
->yy_buf_size
- number_to_move
- 1;
882 if ( num_to_read
> YY_READ_BUF_SIZE
)
883 num_to_read
= YY_READ_BUF_SIZE
;
885 else if ( num_to_read
<= 0 )
886 YY_FATAL_ERROR( "fatal error - scanner input buffer overflow" );
888 /* read in more data */
889 YY_INPUT( (&yy_current_buffer
->yy_ch_buf
[number_to_move
]),
890 yy_n_chars
, num_to_read
);
893 if ( yy_n_chars
== 0 )
895 if ( number_to_move
== 1 )
897 ret_val
= EOB_ACT_END_OF_FILE
;
898 yy_current_buffer
->yy_eof_status
= EOF_DONE
;
903 ret_val
= EOB_ACT_LAST_MATCH
;
904 yy_current_buffer
->yy_eof_status
= EOF_PENDING
;
909 ret_val
= EOB_ACT_CONTINUE_SCAN
;
911 yy_n_chars
+= number_to_move
;
912 yy_current_buffer
->yy_ch_buf
[yy_n_chars
] = YY_END_OF_BUFFER_CHAR
;
913 yy_current_buffer
->yy_ch_buf
[yy_n_chars
+ 1] = YY_END_OF_BUFFER_CHAR
;
915 /* yytext begins at the second character in yy_ch_buf; the first
916 * character is the one which preceded it before reading in the latest
917 * buffer; it needs to be kept around in case it's a newline, so
918 * yy_get_previous_state() will have with '^' rules active
921 yytext
= &yy_current_buffer
->yy_ch_buf
[1];
927 /* yy_get_previous_state - get the state just before the EOB char was reached
930 * yy_state_type yy_get_previous_state();
933 static yy_state_type
yy_get_previous_state()
935 register yy_state_type yy_current_state
;
936 register YY_CHAR
*yy_cp
;
938 yy_current_state
= yy_start
;
940 for ( yy_cp
= yytext
+ YY_MORE_ADJ
; yy_cp
< yy_c_buf_p
; ++yy_cp
)
942 register YY_CHAR yy_c
= (*yy_cp
? yy_ec
[*yy_cp
] : 1);
943 if ( yy_accept
[yy_current_state
] )
945 yy_last_accepting_state
= yy_current_state
;
946 yy_last_accepting_cpos
= yy_cp
;
948 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
950 yy_current_state
= yy_def
[yy_current_state
];
951 if ( yy_current_state
>= 34 )
952 yy_c
= yy_meta
[yy_c
];
954 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + yy_c
];
957 return ( yy_current_state
);
961 /* yy_try_NUL_trans - try to make a transition on the NUL character
964 * next_state = yy_try_NUL_trans( current_state );
968 static yy_state_type
yy_try_NUL_trans( register yy_state_type yy_current_state
)
970 static yy_state_type
yy_try_NUL_trans( yy_current_state
)
971 register yy_state_type yy_current_state
;
974 register int yy_is_jam
;
975 register YY_CHAR
*yy_cp
= yy_c_buf_p
;
977 register YY_CHAR yy_c
= 1;
978 if ( yy_accept
[yy_current_state
] )
980 yy_last_accepting_state
= yy_current_state
;
981 yy_last_accepting_cpos
= yy_cp
;
983 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
985 yy_current_state
= yy_def
[yy_current_state
];
986 if ( yy_current_state
>= 34 )
987 yy_c
= yy_meta
[yy_c
];
989 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + yy_c
];
990 yy_is_jam
= (yy_current_state
== 33);
992 return ( yy_is_jam
? 0 : yy_current_state
);
997 static void yyunput( YY_CHAR c
, register YY_CHAR
*yy_bp
)
999 static void yyunput( c
, yy_bp
)
1001 register YY_CHAR
*yy_bp
;
1004 register YY_CHAR
*yy_cp
= yy_c_buf_p
;
1006 /* undo effects of setting up yytext */
1007 *yy_cp
= yy_hold_char
;
1009 if ( yy_cp
< yy_current_buffer
->yy_ch_buf
+ 2 )
1010 { /* need to shift things up to make room */
1011 register int number_to_move
= yy_n_chars
+ 2; /* +2 for EOB chars */
1012 register YY_CHAR
*dest
=
1013 &yy_current_buffer
->yy_ch_buf
[yy_current_buffer
->yy_buf_size
+ 2];
1014 register YY_CHAR
*source
=
1015 &yy_current_buffer
->yy_ch_buf
[number_to_move
];
1017 while ( source
> yy_current_buffer
->yy_ch_buf
)
1018 *--dest
= *--source
;
1020 yy_cp
+= dest
- source
;
1021 yy_bp
+= dest
- source
;
1022 yy_n_chars
= yy_current_buffer
->yy_buf_size
;
1024 if ( yy_cp
< yy_current_buffer
->yy_ch_buf
+ 2 )
1025 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1028 if ( yy_cp
> yy_bp
&& yy_cp
[-1] == '\n' )
1033 /* note: the formal parameter *must* be called "yy_bp" for this
1034 * macro to now work correctly
1036 YY_DO_BEFORE_ACTION
; /* set up yytext again */
1041 static int yyinput()
1047 YY_CHAR
*yy_cp
= yy_c_buf_p
;
1049 *yy_cp
= yy_hold_char
;
1051 if ( *yy_c_buf_p
== YY_END_OF_BUFFER_CHAR
)
1053 /* yy_c_buf_p now points to the character we want to return.
1054 * If this occurs *before* the EOB characters, then it's a
1055 * valid NUL; if not, then we've hit the end of the buffer.
1057 if ( yy_c_buf_p
< &yy_current_buffer
->yy_ch_buf
[yy_n_chars
] )
1058 { /* this was really a NUL */
1062 { /* need more input */
1063 yytext
= yy_c_buf_p
;
1066 switch ( yy_get_next_buffer() )
1068 case EOB_ACT_END_OF_FILE
:
1072 yy_c_buf_p
= yytext
+ YY_MORE_ADJ
;
1078 return ( yyinput() );
1084 case EOB_ACT_CONTINUE_SCAN
:
1085 yy_c_buf_p
= yytext
+ YY_MORE_ADJ
;
1088 case EOB_ACT_LAST_MATCH
:
1090 YY_FATAL_ERROR( "unexpected last match in yyinput()" );
1092 YY_FATAL_ERROR( "unexpected last match in input()" );
1099 yy_hold_char
= *++yy_c_buf_p
;
1105 #ifdef YY_USE_PROTOS
1106 void yyrestart( FILE *input_file
)
1108 void yyrestart( input_file
)
1112 yy_init_buffer( yy_current_buffer
, input_file
);
1113 yy_load_buffer_state();
1117 #ifdef YY_USE_PROTOS
1118 void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer
)
1120 void yy_switch_to_buffer( new_buffer
)
1121 YY_BUFFER_STATE new_buffer
;
1124 if ( yy_current_buffer
== new_buffer
)
1127 if ( yy_current_buffer
)
1129 /* flush out information for old buffer */
1130 *yy_c_buf_p
= yy_hold_char
;
1131 yy_current_buffer
->yy_buf_pos
= yy_c_buf_p
;
1132 yy_current_buffer
->yy_n_chars
= yy_n_chars
;
1135 yy_current_buffer
= new_buffer
;
1136 yy_load_buffer_state();
1138 /* we don't actually know whether we did this switch during
1139 * EOF (yywrap()) processing, but the only time this flag
1140 * is looked at is after yywrap() is called, so it's safe
1141 * to go ahead and always set it.
1143 yy_did_buffer_switch_on_eof
= 1;
1147 #ifdef YY_USE_PROTOS
1148 void yy_load_buffer_state( void )
1150 void yy_load_buffer_state()
1153 yy_n_chars
= yy_current_buffer
->yy_n_chars
;
1154 yytext
= yy_c_buf_p
= yy_current_buffer
->yy_buf_pos
;
1155 yyin
= yy_current_buffer
->yy_input_file
;
1156 yy_hold_char
= *yy_c_buf_p
;
1160 #ifdef YY_USE_PROTOS
1161 YY_BUFFER_STATE
yy_create_buffer( FILE *file
, int size
)
1163 YY_BUFFER_STATE
yy_create_buffer( file
, size
)
1170 b
= (YY_BUFFER_STATE
) malloc( sizeof( struct yy_buffer_state
) );
1173 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1175 b
->yy_buf_size
= size
;
1177 /* yy_ch_buf has to be 2 characters longer than the size given because
1178 * we need to put in 2 end-of-buffer characters.
1180 b
->yy_ch_buf
= (YY_CHAR
*) malloc( (unsigned) (b
->yy_buf_size
+ 2) );
1182 if ( ! b
->yy_ch_buf
)
1183 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1185 yy_init_buffer( b
, file
);
1191 #ifdef YY_USE_PROTOS
1192 void yy_delete_buffer( YY_BUFFER_STATE b
)
1194 void yy_delete_buffer( b
)
1198 if ( b
== yy_current_buffer
)
1199 yy_current_buffer
= (YY_BUFFER_STATE
) 0;
1201 free( (char *) b
->yy_ch_buf
);
1206 #ifdef YY_USE_PROTOS
1207 void yy_init_buffer( YY_BUFFER_STATE b
, FILE *file
)
1209 void yy_init_buffer( b
, file
)
1214 b
->yy_input_file
= file
;
1216 /* we put in the '\n' and start reading from [1] so that an
1217 * initial match-at-newline will be true.
1220 b
->yy_ch_buf
[0] = '\n';
1223 /* we always need two end-of-buffer characters. The first causes
1224 * a transition to the end-of-buffer state. The second causes
1225 * a jam in that state.
1227 b
->yy_ch_buf
[1] = YY_END_OF_BUFFER_CHAR
;
1228 b
->yy_ch_buf
[2] = YY_END_OF_BUFFER_CHAR
;
1230 b
->yy_buf_pos
= &b
->yy_ch_buf
[1];
1232 b
->yy_eof_status
= EOF_NOT_SEEN
;
1234 /* # line 108 "lexer.l" */
1239 static int lex_input()
1243 #else /* BSD/AT&T lex */
1245 #error "Sorry, but need either flex or AT&T lex"
1247 static int lex_input() {
1253 # define unput(_c) my_unput(_c)
1257 # define input() my_input()
1258 static int my_unput(char c
)
1260 if (lex_read_from_string
)
1262 /* Make sure we have something */
1265 if (c
== '\n') yylineno
--;
1271 yytchar
= (c
);if(yytchar
=='\n')yylineno
--;*yysptr
++=yytchar
;
1272 /* unput(c); Causes infinite recursion! */
1279 void LexFromFile(FILE *fd
)
1281 lex_read_from_string
= 0;
1283 /* Don't know why this is necessary, but otherwise
1284 * lex only works _once_!
1291 void LexFromString(char *buffer
)
1293 lex_read_from_string
= 1;
1294 lex_buffer
= buffer
;
1295 lex_buffer_length
= strlen((const char*) buffer
);
1297 /* Don't know why this is necessary, but otherwise
1298 * lex only works _once_!
1305 static int my_input( void )
1307 if (lex_read_from_string
)
1309 if (lex_string_ptr
== lex_buffer_length
)
1315 char c
= lex_buffer
[lex_string_ptr
++];
1316 #ifndef FLEX_SCANNER
1317 if (c
== '\n') yylineno
++;
1328 void wxExprCleanUp()
1330 if (yy_current_buffer
)
1331 yy_delete_buffer(yy_current_buffer
);
1335 #pragma warning(pop)