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" */
38 /* use prototypes in function declarations */
41 /* the "const" storage-class-modifier is valid */
44 #else /* ! __cplusplus */
58 #endif /* ! __cplusplus */
72 #define YY_PROTO(proto) proto
74 #define YY_PROTO(proto) ()
75 /* we can't get here if it's an ANSI C compiler, or a C++ compiler,
76 * so it's got to be a K&R compiler, and therefore there's no standard
77 * place from which to include these definitions
88 /* amount of stuff to slurp up with each read */
89 #ifndef YY_READ_BUF_SIZE
90 #define YY_READ_BUF_SIZE 8192
93 /* returned upon end-of-file */
96 /* copy whatever the last rule matched to the standard output */
98 /* cast to (char *) is because for 8-bit chars, yytext is (unsigned char *) */
99 /* this used to be an fputs(), but since the string might contain NUL's,
100 * we now use fwrite()
102 #define ECHO (void) fwrite( (char *) yytext, yyleng, 1, yyout )
104 /* gets input and stuffs it into "buf". number of characters read, or YY_NULL,
105 * is returned in "result".
107 #define YY_INPUT(buf,result,max_size) \
108 if ( (result = read( fileno(yyin), (char *) buf, max_size )) < 0 ) \
109 YY_FATAL_ERROR( "read() in flex scanner failed" );
112 /* no semi-colon after return; correct usage is to write "yyterminate();" -
113 * we don't want an extra ';' after the "return" because that will cause
114 * some compilers to complain about unreachable statements.
116 #define yyterminate() return ( YY_NULL )
118 /* report a fatal error */
120 /* The funky do-while is used to turn this macro definition into
121 * a single C statement (which needs a semi-colon terminator).
122 * This avoids problems with code like:
124 * if ( something_happens )
125 * YY_FATAL_ERROR( "oops, the something happened" );
129 * Prior to using the do-while the compiler would get upset at the
130 * "else" because it interpreted the "if" statement as being all
131 * done when it reached the ';' after the YY_FATAL_ERROR() call.
134 #define YY_FATAL_ERROR(msg) \
137 (void) fputs( msg, stderr ); \
138 (void) putc( '\n', stderr ); \
143 /* default yywrap function - always treat EOF as an EOF */
144 int yywrap(void) { return 1; }
147 /* enter a start condition. This macro really ought to take a parameter,
148 * but we do it the disgusting crufty way forced on us by the ()-less
149 * definition of BEGIN
151 #define BEGIN yy_start = 1 + 2 *
153 /* action number for EOF rule of a given start state */
154 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
156 /* special action meaning "start processing a new file" */
157 #define YY_NEW_FILE \
160 yy_init_buffer( yy_current_buffer, yyin ); \
161 yy_load_buffer_state(); \
165 /* default declaration of generated scanner - a define so the user can
166 * easily add parameters
168 #define YY_DECL int yylex YY_PROTO(( void ))
170 /* code executed at the end of each rule */
171 #define YY_BREAK break;
173 #define YY_END_OF_BUFFER_CHAR 0
176 #define YY_BUF_SIZE (YY_READ_BUF_SIZE * 2) /* size of default input buffer */
179 typedef struct yy_buffer_state
*YY_BUFFER_STATE
;
181 #define YY_CHAR unsigned char
187 * Description: Lexical analyser for PROLOGIO; can be used with
188 * either lex and flex.
192 /* +++steve162e: added, otherwise, PROIO_input will be undefined (at least under LINUX)
193 please check, if this is also TRUE under other UNIXes.
196 #if defined(FLEX_SCANNER) && defined(_LINUX)
197 #define PROIO_input my_input
203 extern char *malloc();
205 #define Return(x) return x;
207 #if defined(VMS) && !defined(strdup)
208 #define strdup(s) (strcpy((char *)malloc(strlen(s)+1), s));
211 static size_t lex_buffer_length
= 0;
212 static const char *lex_buffer
= NULL
;
213 static size_t lex_string_ptr
= 0;
214 static int lex_read_from_string
= 0;
216 static int my_input(void);
217 static int my_unput(char);
221 # define YY_INPUT(buf,result,max_size) \
222 if (lex_read_from_string) \
223 { int c = my_input(); result = (c == 0) ? YY_NULL : ((buf)[0]=(c), 1); } \
225 if ( (result = read( fileno(yyin), (char *) buf, max_size )) < 0 ) \
226 YY_FATAL_ERROR( "read() in flex scanner failed" );
229 # define unput(_c) my_unput(_c)
234 /* done after the current pattern has been matched and before the
235 * corresponding action - sets up yytext
237 #define YY_DO_BEFORE_ACTION \
239 yyleng = yy_cp - yy_bp; \
240 yy_hold_char = *yy_cp; \
244 #define EOB_ACT_CONTINUE_SCAN 0
245 #define EOB_ACT_END_OF_FILE 1
246 #define EOB_ACT_LAST_MATCH 2
248 /* return all but the first 'n' matched characters back to the input stream */
252 /* undo effects of setting up yytext */ \
253 *yy_cp = yy_hold_char; \
254 yy_c_buf_p = yy_cp = yy_bp + n; \
255 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
260 #define unput(c) yyunput( c, yytext )
263 struct yy_buffer_state
267 YY_CHAR
*yy_ch_buf
; /* input buffer */
268 YY_CHAR
*yy_buf_pos
; /* current position in input buffer */
270 /* size of input buffer in bytes, not including room for EOB characters*/
273 /* number of characters read into yy_ch_buf, not including EOB characters */
276 int yy_eof_status
; /* whether we've seen an EOF on this buffer */
277 #define EOF_NOT_SEEN 0
278 /* "pending" happens when the EOF has been seen but there's still
281 #define EOF_PENDING 1
285 static YY_BUFFER_STATE yy_current_buffer
;
287 /* we provide macros for accessing buffer states in case in the
288 * future we want to put the buffer states in a more general
291 #define YY_CURRENT_BUFFER yy_current_buffer
294 /* yy_hold_char holds the character lost when yytext is formed */
295 static YY_CHAR yy_hold_char
;
297 static int yy_n_chars
; /* number of characters read into yy_ch_buf */
301 #ifndef YY_USER_ACTION
302 #define YY_USER_ACTION
309 extern YY_CHAR
*yytext
;
311 extern FILE *yyin
, *yyout
;
316 FILE *yyin
= (FILE *) 0, *yyout
= (FILE *) 0;
318 #define YY_END_OF_BUFFER 18
319 typedef int yy_state_type
;
320 static const short int yy_accept
[34] =
322 0, 0, 18, 16, 13, 14, 16, 16, 6, 7,
323 16, 8, 12, 16, 1, 11, 3, 9, 10, 2,
324 0, 5, 0, 0, 0, 4, 1, 15, 3, 5,
328 static const YY_CHAR yy_ec
[256] =
330 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
331 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
332 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
333 1, 2, 1, 4, 1, 1, 1, 1, 5, 6,
334 7, 8, 9, 10, 9, 11, 12, 13, 13, 13,
335 13, 13, 13, 13, 13, 13, 13, 1, 1, 1,
336 14, 1, 1, 1, 15, 15, 15, 15, 15, 15,
337 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
338 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
339 16, 17, 18, 1, 15, 1, 15, 15, 15, 15,
341 19, 15, 15, 15, 15, 15, 15, 15, 15, 15,
342 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
343 15, 15, 1, 20, 1, 1, 1, 1, 1, 1,
344 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
345 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
346 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
347 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
348 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
349 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
350 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
352 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
353 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
354 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
355 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
356 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
360 static const YY_CHAR yy_meta
[21] =
362 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
363 1, 1, 2, 1, 2, 1, 3, 1, 2, 1
366 static const short int yy_base
[37] =
368 0, 0, 48, 55, 55, 55, 17, 42, 55, 55,
369 19, 55, 55, 23, 17, 55, 0, 55, 55, 0,
370 18, 55, 19, 23, 21, 55, 12, 55, 0, 24,
371 25, 29, 55, 49, 52, 22
374 static const short int yy_def
[37] =
376 33, 1, 33, 33, 33, 33, 34, 35, 33, 33,
377 33, 33, 33, 33, 33, 33, 36, 33, 33, 36,
378 34, 33, 34, 34, 35, 33, 33, 33, 36, 34,
379 34, 34, 0, 33, 33, 33
382 static const short int yy_nxt
[76] =
384 4, 5, 6, 7, 8, 9, 10, 4, 11, 12,
385 13, 14, 15, 16, 17, 18, 4, 19, 20, 4,
386 22, 22, 30, 29, 27, 26, 22, 22, 30, 27,
387 28, 27, 30, 23, 23, 23, 24, 24, 24, 31,
388 23, 32, 24, 24, 24, 23, 26, 33, 24, 21,
389 21, 21, 25, 25, 3, 33, 33, 33, 33, 33,
390 33, 33, 33, 33, 33, 33, 33, 33, 33, 33,
394 static const short int yy_chk
[76] =
396 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
397 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
398 7, 21, 23, 36, 27, 25, 24, 30, 31, 15,
399 14, 11, 32, 7, 21, 23, 7, 21, 23, 24,
400 30, 31, 24, 30, 31, 32, 8, 3, 32, 34,
401 34, 34, 35, 35, 33, 33, 33, 33, 33, 33,
402 33, 33, 33, 33, 33, 33, 33, 33, 33, 33,
406 static yy_state_type yy_last_accepting_state
;
407 static YY_CHAR
*yy_last_accepting_cpos
;
409 /* the intent behind this definition is that it'll catch
410 * any uses of REJECT which flex missed
412 #define REJECT reject_used_but_not_detected
413 #define yymore() yymore_used_but_not_detected
414 #define YY_MORE_ADJ 0
416 /* these variables are all declared out here so that section 3 code can
419 /* points to current character in buffer */
420 static YY_CHAR
*yy_c_buf_p
= (YY_CHAR
*) 0;
421 static int yy_init
= 1; /* whether we need to initialize */
422 static int yy_start
= 0; /* start state number */
424 /* flag which is used to allow yywrap()'s to do buffer switches
425 * instead of setting up a fresh yyin. A bit of a hack ...
427 static int yy_did_buffer_switch_on_eof
;
429 static yy_state_type yy_get_previous_state
YY_PROTO(( void ));
430 static yy_state_type yy_try_NUL_trans
YY_PROTO(( yy_state_type current_state
));
431 static int yy_get_next_buffer
YY_PROTO(( void ));
432 static void yyunput
YY_PROTO(( YY_CHAR c
, YY_CHAR
*buf_ptr
));
433 void yyrestart
YY_PROTO(( FILE *input_file
));
434 void yy_switch_to_buffer
YY_PROTO(( YY_BUFFER_STATE new_buffer
));
435 void yy_load_buffer_state
YY_PROTO(( void ));
436 YY_BUFFER_STATE yy_create_buffer
YY_PROTO(( FILE *file
, int size
));
437 void yy_delete_buffer
YY_PROTO(( YY_BUFFER_STATE b
));
438 void yy_init_buffer
YY_PROTO(( YY_BUFFER_STATE b
, FILE *file
));
440 #define yy_new_buffer yy_create_buffer
443 static int yyinput
YY_PROTO(( void ));
445 static int input
YY_PROTO(( void ));
450 register yy_state_type yy_current_state
;
451 register YY_CHAR
*yy_cp
, *yy_bp
;
462 yy_start
= 1; /* first start state */
470 if ( yy_current_buffer
)
471 yy_init_buffer( yy_current_buffer
, yyin
);
473 yy_current_buffer
= yy_create_buffer( yyin
, YY_BUF_SIZE
);
475 yy_load_buffer_state();
480 while ( 1 ) /* loops until end-of-file is reached */
484 /* support of yytext */
485 *yy_cp
= yy_hold_char
;
487 /* yy_bp points to the position in yy_ch_buf of the start of the
492 yy_current_state
= yy_start
;
496 register YY_CHAR yy_c
= yy_ec
[*yy_cp
];
497 if ( yy_accept
[yy_current_state
] )
499 yy_last_accepting_state
= yy_current_state
;
500 yy_last_accepting_cpos
= yy_cp
;
502 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
504 yy_current_state
= yy_def
[yy_current_state
];
505 if ( yy_current_state
>= 34 )
506 yy_c
= yy_meta
[yy_c
];
508 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + yy_c
];
511 while ( yy_current_state
!= 33 );
512 yy_cp
= yy_last_accepting_cpos
;
513 yy_current_state
= yy_last_accepting_state
;
516 yy_act
= yy_accept
[yy_current_state
];
521 do_action
: /* this label is used only to access EOF actions */
526 case 0: /* must backtrack */
527 /* undo the effects of YY_DO_BEFORE_ACTION */
528 *yy_cp
= yy_hold_char
;
529 yy_cp
= yy_last_accepting_cpos
;
530 yy_current_state
= yy_last_accepting_state
;
535 {yylval
.s
= strdup((const char*) yytext
); Return(INTEGER
);}
543 {yylval
.s
= strdup((const char*) yytext
); Return(WORD
);}
547 {int len
= strlen((const char*) yytext
);
549 yylval
.s
= strdup((const char*) (yytext
+1));
554 {yylval
.s
= strdup((const char*) yytext
); Return(STRING
);}
574 Return(CLOSE_SQUARE
);
596 while (yyinput() != '*');
599 while (input() != '*');
604 case '*': unput('*');
617 case YY_STATE_EOF(INITIAL
):
620 case YY_END_OF_BUFFER
:
622 /* amount of text matched not including the EOB char */
623 int yy_amount_of_matched_text
= yy_cp
- yytext
- 1;
625 /* undo the effects of YY_DO_BEFORE_ACTION */
626 *yy_cp
= yy_hold_char
;
628 /* note that here we test for yy_c_buf_p "<=" to the position
629 * of the first EOB in the buffer, since yy_c_buf_p will
630 * already have been incremented past the NUL character
631 * (since all states make transitions on EOB to the end-
632 * of-buffer state). Contrast this with the test in yyinput().
634 if ( yy_c_buf_p
<= &yy_current_buffer
->yy_ch_buf
[yy_n_chars
] )
635 /* this was really a NUL */
637 yy_state_type yy_next_state
;
639 yy_c_buf_p
= yytext
+ yy_amount_of_matched_text
;
641 yy_current_state
= yy_get_previous_state();
643 /* okay, we're now positioned to make the
644 * NUL transition. We couldn't have
645 * yy_get_previous_state() go ahead and do it
646 * for us because it doesn't know how to deal
647 * with the possibility of jamming (and we
648 * don't want to build jamming into it because
649 * then it will run more slowly)
652 yy_next_state
= yy_try_NUL_trans( yy_current_state
);
654 yy_bp
= yytext
+ YY_MORE_ADJ
;
658 /* consume the NUL */
659 yy_cp
= ++yy_c_buf_p
;
660 yy_current_state
= yy_next_state
;
666 yy_cp
= yy_last_accepting_cpos
;
667 yy_current_state
= yy_last_accepting_state
;
672 else switch ( yy_get_next_buffer() )
674 case EOB_ACT_END_OF_FILE
:
676 yy_did_buffer_switch_on_eof
= 0;
680 /* note: because we've taken care in
681 * yy_get_next_buffer() to have set up yytext,
682 * we can now set up yy_c_buf_p so that if some
683 * total hoser (like flex itself) wants
684 * to call the scanner after we return the
685 * YY_NULL, it'll still work - another YY_NULL
688 yy_c_buf_p
= yytext
+ YY_MORE_ADJ
;
690 yy_act
= YY_STATE_EOF((yy_start
- 1) / 2);
696 if ( ! yy_did_buffer_switch_on_eof
)
702 case EOB_ACT_CONTINUE_SCAN
:
703 yy_c_buf_p
= yytext
+ yy_amount_of_matched_text
;
705 yy_current_state
= yy_get_previous_state();
708 yy_bp
= yytext
+ YY_MORE_ADJ
;
711 case EOB_ACT_LAST_MATCH
:
713 &yy_current_buffer
->yy_ch_buf
[yy_n_chars
];
715 yy_current_state
= yy_get_previous_state();
718 yy_bp
= yytext
+ YY_MORE_ADJ
;
726 printf( "action # %d\n", yy_act
);
729 "fatal flex scanner internal error--no action found" );
735 /* yy_get_next_buffer - try to read in a new buffer
738 * int yy_get_next_buffer();
740 * returns a code representing an action
741 * EOB_ACT_LAST_MATCH -
742 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
743 * EOB_ACT_END_OF_FILE - end of file
746 static int yy_get_next_buffer()
749 register YY_CHAR
*dest
= yy_current_buffer
->yy_ch_buf
;
750 register YY_CHAR
*source
= yytext
- 1; /* copy prev. char, too */
751 register int number_to_move
, i
;
754 if ( yy_c_buf_p
> &yy_current_buffer
->yy_ch_buf
[yy_n_chars
+ 1] )
756 "fatal flex scanner internal error--end of buffer missed" );
758 /* try to read more data */
760 /* first move last chars to start of buffer */
761 number_to_move
= yy_c_buf_p
- yytext
;
763 for ( i
= 0; i
< number_to_move
; ++i
)
764 *(dest
++) = *(source
++);
766 if ( yy_current_buffer
->yy_eof_status
!= EOF_NOT_SEEN
)
767 /* don't do the read, it's not guaranteed to return an EOF,
774 int num_to_read
= yy_current_buffer
->yy_buf_size
- number_to_move
- 1;
776 if ( num_to_read
> YY_READ_BUF_SIZE
)
777 num_to_read
= YY_READ_BUF_SIZE
;
779 else if ( num_to_read
<= 0 )
780 YY_FATAL_ERROR( "fatal error - scanner input buffer overflow" );
782 /* read in more data */
783 YY_INPUT( (&yy_current_buffer
->yy_ch_buf
[number_to_move
]),
784 yy_n_chars
, num_to_read
);
787 if ( yy_n_chars
== 0 )
789 if ( number_to_move
== 1 )
791 ret_val
= EOB_ACT_END_OF_FILE
;
792 yy_current_buffer
->yy_eof_status
= EOF_DONE
;
797 ret_val
= EOB_ACT_LAST_MATCH
;
798 yy_current_buffer
->yy_eof_status
= EOF_PENDING
;
803 ret_val
= EOB_ACT_CONTINUE_SCAN
;
805 yy_n_chars
+= number_to_move
;
806 yy_current_buffer
->yy_ch_buf
[yy_n_chars
] = YY_END_OF_BUFFER_CHAR
;
807 yy_current_buffer
->yy_ch_buf
[yy_n_chars
+ 1] = YY_END_OF_BUFFER_CHAR
;
809 /* yytext begins at the second character in yy_ch_buf; the first
810 * character is the one which preceded it before reading in the latest
811 * buffer; it needs to be kept around in case it's a newline, so
812 * yy_get_previous_state() will have with '^' rules active
815 yytext
= &yy_current_buffer
->yy_ch_buf
[1];
821 /* yy_get_previous_state - get the state just before the EOB char was reached
824 * yy_state_type yy_get_previous_state();
827 static yy_state_type
yy_get_previous_state()
830 register yy_state_type yy_current_state
;
831 register YY_CHAR
*yy_cp
;
833 yy_current_state
= yy_start
;
835 for ( yy_cp
= yytext
+ YY_MORE_ADJ
; yy_cp
< yy_c_buf_p
; ++yy_cp
)
837 register YY_CHAR yy_c
= (*yy_cp
? yy_ec
[*yy_cp
] : 1);
838 if ( yy_accept
[yy_current_state
] )
840 yy_last_accepting_state
= yy_current_state
;
841 yy_last_accepting_cpos
= yy_cp
;
843 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
845 yy_current_state
= yy_def
[yy_current_state
];
846 if ( yy_current_state
>= 34 )
847 yy_c
= yy_meta
[yy_c
];
849 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + yy_c
];
852 return ( yy_current_state
);
856 /* yy_try_NUL_trans - try to make a transition on the NUL character
859 * next_state = yy_try_NUL_trans( current_state );
863 static yy_state_type
yy_try_NUL_trans( register yy_state_type yy_current_state
)
865 static yy_state_type
yy_try_NUL_trans( yy_current_state
)
866 register yy_state_type yy_current_state
;
870 register int yy_is_jam
;
871 register YY_CHAR
*yy_cp
= yy_c_buf_p
;
873 register YY_CHAR yy_c
= 1;
874 if ( yy_accept
[yy_current_state
] )
876 yy_last_accepting_state
= yy_current_state
;
877 yy_last_accepting_cpos
= yy_cp
;
879 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
881 yy_current_state
= yy_def
[yy_current_state
];
882 if ( yy_current_state
>= 34 )
883 yy_c
= yy_meta
[yy_c
];
885 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + yy_c
];
886 yy_is_jam
= (yy_current_state
== 33);
888 return ( yy_is_jam
? 0 : yy_current_state
);
893 static void yyunput( YY_CHAR c
, register YY_CHAR
*yy_bp
)
895 static void yyunput( c
, yy_bp
)
897 register YY_CHAR
*yy_bp
;
901 register YY_CHAR
*yy_cp
= yy_c_buf_p
;
903 /* undo effects of setting up yytext */
904 *yy_cp
= yy_hold_char
;
906 if ( yy_cp
< yy_current_buffer
->yy_ch_buf
+ 2 )
907 { /* need to shift things up to make room */
908 register int number_to_move
= yy_n_chars
+ 2; /* +2 for EOB chars */
909 register YY_CHAR
*dest
=
910 &yy_current_buffer
->yy_ch_buf
[yy_current_buffer
->yy_buf_size
+ 2];
911 register YY_CHAR
*source
=
912 &yy_current_buffer
->yy_ch_buf
[number_to_move
];
914 while ( source
> yy_current_buffer
->yy_ch_buf
)
917 yy_cp
+= dest
- source
;
918 yy_bp
+= dest
- source
;
919 yy_n_chars
= yy_current_buffer
->yy_buf_size
;
921 if ( yy_cp
< yy_current_buffer
->yy_ch_buf
+ 2 )
922 YY_FATAL_ERROR( "flex scanner push-back overflow" );
925 if ( yy_cp
> yy_bp
&& yy_cp
[-1] == '\n' )
930 /* note: the formal parameter *must* be called "yy_bp" for this
931 * macro to now work correctly
933 YY_DO_BEFORE_ACTION
; /* set up yytext again */
945 YY_CHAR
*yy_cp
= yy_c_buf_p
;
947 *yy_cp
= yy_hold_char
;
949 if ( *yy_c_buf_p
== YY_END_OF_BUFFER_CHAR
)
951 /* yy_c_buf_p now points to the character we want to return.
952 * If this occurs *before* the EOB characters, then it's a
953 * valid NUL; if not, then we've hit the end of the buffer.
955 if ( yy_c_buf_p
< &yy_current_buffer
->yy_ch_buf
[yy_n_chars
] )
956 /* this was really a NUL */
960 { /* need more input */
964 switch ( yy_get_next_buffer() )
966 case EOB_ACT_END_OF_FILE
:
970 yy_c_buf_p
= yytext
+ YY_MORE_ADJ
;
977 return ( yyinput() );
984 case EOB_ACT_CONTINUE_SCAN
:
985 yy_c_buf_p
= yytext
+ YY_MORE_ADJ
;
988 case EOB_ACT_LAST_MATCH
:
990 YY_FATAL_ERROR( "unexpected last match in yyinput()" );
992 YY_FATAL_ERROR( "unexpected last match in input()" );
999 yy_hold_char
= *++yy_c_buf_p
;
1005 #ifdef YY_USE_PROTOS
1006 void yyrestart( FILE *input_file
)
1008 void yyrestart( input_file
)
1013 yy_init_buffer( yy_current_buffer
, input_file
);
1014 yy_load_buffer_state();
1018 #ifdef YY_USE_PROTOS
1019 void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer
)
1021 void yy_switch_to_buffer( new_buffer
)
1022 YY_BUFFER_STATE new_buffer
;
1026 if ( yy_current_buffer
== new_buffer
)
1029 if ( yy_current_buffer
)
1031 /* flush out information for old buffer */
1032 *yy_c_buf_p
= yy_hold_char
;
1033 yy_current_buffer
->yy_buf_pos
= yy_c_buf_p
;
1034 yy_current_buffer
->yy_n_chars
= yy_n_chars
;
1037 yy_current_buffer
= new_buffer
;
1038 yy_load_buffer_state();
1040 /* we don't actually know whether we did this switch during
1041 * EOF (yywrap()) processing, but the only time this flag
1042 * is looked at is after yywrap() is called, so it's safe
1043 * to go ahead and always set it.
1045 yy_did_buffer_switch_on_eof
= 1;
1049 #ifdef YY_USE_PROTOS
1050 void yy_load_buffer_state( void )
1052 void yy_load_buffer_state()
1056 yy_n_chars
= yy_current_buffer
->yy_n_chars
;
1057 yytext
= yy_c_buf_p
= yy_current_buffer
->yy_buf_pos
;
1058 yyin
= yy_current_buffer
->yy_input_file
;
1059 yy_hold_char
= *yy_c_buf_p
;
1063 #ifdef YY_USE_PROTOS
1064 YY_BUFFER_STATE
yy_create_buffer( FILE *file
, int size
)
1066 YY_BUFFER_STATE
yy_create_buffer( file
, size
)
1074 b
= (YY_BUFFER_STATE
) malloc( sizeof( struct yy_buffer_state
) );
1077 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1079 b
->yy_buf_size
= size
;
1081 /* yy_ch_buf has to be 2 characters longer than the size given because
1082 * we need to put in 2 end-of-buffer characters.
1084 b
->yy_ch_buf
= (YY_CHAR
*) malloc( (unsigned) (b
->yy_buf_size
+ 2) );
1086 if ( ! b
->yy_ch_buf
)
1087 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1089 yy_init_buffer( b
, file
);
1095 #ifdef YY_USE_PROTOS
1096 void yy_delete_buffer( YY_BUFFER_STATE b
)
1098 void yy_delete_buffer( b
)
1103 if ( b
== yy_current_buffer
)
1104 yy_current_buffer
= (YY_BUFFER_STATE
) 0;
1106 free( (char *) b
->yy_ch_buf
);
1111 #ifdef YY_USE_PROTOS
1112 void yy_init_buffer( YY_BUFFER_STATE b
, FILE *file
)
1114 void yy_init_buffer( b
, file
)
1120 b
->yy_input_file
= file
;
1122 /* we put in the '\n' and start reading from [1] so that an
1123 * initial match-at-newline will be true.
1126 b
->yy_ch_buf
[0] = '\n';
1129 /* we always need two end-of-buffer characters. The first causes
1130 * a transition to the end-of-buffer state. The second causes
1131 * a jam in that state.
1133 b
->yy_ch_buf
[1] = YY_END_OF_BUFFER_CHAR
;
1134 b
->yy_ch_buf
[2] = YY_END_OF_BUFFER_CHAR
;
1136 b
->yy_buf_pos
= &b
->yy_ch_buf
[1];
1138 b
->yy_eof_status
= EOF_NOT_SEEN
;
1140 # line 108 "lexer.l"
1145 static int lex_input() {
1148 #else /* BSD/AT&T lex */
1150 # error "Sorry, but need either flex or AT&T lex"
1152 static int lex_input() {
1156 # define unput(_c) my_unput(_c)
1160 # define input() my_input()
1161 static int my_unput(char c
)
1163 if (lex_read_from_string
) {
1164 /* Make sure we have something */
1165 if (lex_string_ptr
) {
1166 if (c
== '\n') yylineno
--;
1170 yytchar
= (c
);if(yytchar
=='\n')yylineno
--;*yysptr
++=yytchar
;
1171 /* unput(c); Causes infinite recursion! */
1179 void LexFromFile(FILE *fd
)
1181 lex_read_from_string
= 0;
1183 /* Don't know why this is necessary, but otherwise
1184 * lex only works _once_!
1191 void LexFromString(char *buffer
)
1193 lex_read_from_string
= 1;
1194 lex_buffer
= buffer
;
1195 lex_buffer_length
= strlen((const char*) buffer
);
1197 /* Don't know why this is necessary, but otherwise
1198 * lex only works _once_!
1205 static int my_input( void )
1207 if (lex_read_from_string
) {
1208 if (lex_string_ptr
== lex_buffer_length
)
1211 char c
= lex_buffer
[lex_string_ptr
++];
1212 #ifndef FLEX_SCANNER
1213 if (c
== '\n') yylineno
++;
1222 void wxExprCleanUp()
1224 if (yy_current_buffer
)
1225 yy_delete_buffer(yy_current_buffer
);