]> git.saurik.com Git - wxWidgets.git/blob - contrib/src/deprecated/doslex.c
Added licence/copyright information
[wxWidgets.git] / contrib / src / deprecated / doslex.c
1 /* A lexical scanner generated by flex */
2
3 /* scanner skeleton version:
4 * $Header$
5 Last change: JS 13 Jul 97 6:17 pm
6 */
7 /* Copyright: (c) Julian Smart */
8 /* Licence: wxWindows Licence */
9
10 #define FLEX_SCANNER
11
12 #include <stdio.h>
13
14
15 /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
16 #ifdef c_plusplus
17 #ifndef __cplusplus
18 #define __cplusplus
19 #endif
20 #endif
21
22
23 #ifdef __cplusplus
24
25 #include <stdlib.h>
26
27 #ifdef __SALFORDC__
28 #include <io.h>
29 #include <clib.h>
30 #else
31 #include <osfcn.h>
32 #endif
33
34 #ifdef __VISAGECPP__
35 #include <io.h>
36 #endif
37
38 #ifdef __cplusplus
39 static int yyinput()
40 #else
41 static int input()
42 #endif
43
44 /* use prototypes in function declarations */
45 #define YY_USE_PROTOS
46
47 /* the "const" storage-class-modifier is valid */
48 #define YY_USE_CONST
49
50 #else /* ! __cplusplus */
51
52 #ifdef __STDC__
53
54 #ifdef __GNUC__
55 #include <stddef.h>
56 #else
57 #include <stdlib.h>
58 #endif /* __GNUC__ */
59
60 #define YY_USE_PROTOS
61 #define YY_USE_CONST
62
63 #endif /* __STDC__ */
64
65 #ifdef __BORLANDC__
66 #include <io.h>
67 #define YY_USE_PROTOS
68 #define YY_USE_CONST
69 #endif
70
71 #if defined(__MINGW32__) || defined(__WATCOMC__)
72 #include <io.h>
73 #endif
74
75 #endif /* ! __cplusplus */
76
77
78 #ifdef __TURBOC__
79 #define YY_USE_CONST
80 #endif
81
82
83 #ifndef YY_USE_CONST
84 #define const
85 #endif
86
87
88 #ifdef YY_USE_PROTOS
89 #define YY_PROTO(proto) proto
90 #else
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
95 */
96 /*
97 char *malloc();
98 int free();
99 */
100 #endif
101
102
103 /* amount of stuff to slurp up with each read */
104 #ifndef YY_READ_BUF_SIZE
105 #define YY_READ_BUF_SIZE 8192
106 #endif
107
108
109 /* returned upon end-of-file */
110 #define YY_END_TOK 0
111
112
113 /* copy whatever the last rule matched to the standard output */
114
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()
118 */
119 #define ECHO (void) fwrite( (char *) yytext, yyleng, 1, yyout )
120
121
122 /* gets input and stuffs it into "buf". number of characters read, or YY_NULL,
123 * is returned in "result".
124 */
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" );
128 #define YY_NULL 0
129
130
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.
134 */
135 #define yyterminate() return ( YY_NULL )
136
137
138 /* report a fatal error */
139
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:
143 *
144 * if ( something_happens )
145 * YY_FATAL_ERROR( "oops, the something happened" );
146 * else
147 * everything_okay();
148 *
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.
152 */
153
154 #if !defined(__VISAGECPP__)
155 #define YY_FATAL_ERROR(msg) \
156 do \
157 { \
158 (void) fputs( msg, stderr ); \
159 (void) putc( '\n', stderr ); \
160 exit( 1 ); \
161 } \
162 while ( 0 )
163 #else
164 /* suppress expression always false warning */
165 int os2var = 0;
166 #define YY_FATAL_ERROR(msg) \
167 do \
168 { \
169 (void) fputs( msg, stderr ); \
170 (void) putc( '\n', stderr ); \
171 exit( 1 ); \
172 } \
173 while ( os2var == 0 )
174 #endif
175
176
177 /* default yywrap function - always treat EOF as an EOF */
178 int yywrap(void) { return 1; }
179
180
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
184 */
185 #define BEGIN yy_start = 1 + 2 *
186
187 /* action number for EOF rule of a given start state */
188 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
189
190 /* special action meaning "start processing a new file" */
191 #if !defined(__VISAGECPP__)
192 #define YY_NEW_FILE \
193 do \
194 { \
195 yy_init_buffer( yy_current_buffer, yyin ); \
196 yy_load_buffer_state(); \
197 } \
198 while ( 0 )
199 #else
200 #define YY_NEW_FILE \
201 do \
202 { \
203 yy_init_buffer( yy_current_buffer, yyin ); \
204 yy_load_buffer_state(); \
205 } \
206 while ( os2var == 0 )
207 #endif
208
209
210 /* default declaration of generated scanner - a define so the user can
211 * easily add parameters
212 */
213 #define YY_DECL int yylex YY_PROTO(( void ))
214
215
216 #define YY_END_OF_BUFFER_CHAR 0
217
218 #ifndef YY_BUF_SIZE
219 #define YY_BUF_SIZE (YY_READ_BUF_SIZE * 2) /* size of default input buffer */
220 #endif
221
222 typedef struct yy_buffer_state *YY_BUFFER_STATE;
223
224 #define YY_CHAR unsigned char
225 // # line 1 "lexer.l"
226 #define INITIAL 0
227 // # line 9 "lexer.l"
228 /*
229 * File: lexer.l
230 * Description: Lexical analyser for PROLOGIO; can be used with
231 * either lex and flex.
232 */
233 #include <string.h>
234
235 /* +++steve162e: added, otherwise, PROIO_input will be undefined (at least under LINUX)
236 please check, if this is also TRUE under other UNIXes.
237 */
238
239 #if defined(FLEX_SCANNER) && defined(_LINUX)
240 #define PROIO_input my_input
241 #endif
242 /* ---steve162e */
243
244 #include "wx/deprecated/expr.h"
245 #ifdef wx_x
246 extern char *malloc();
247 #endif
248
249 #if defined(VMS) && ( __VMS_VER < 70000000 )
250 #define strdup(s) (strcpy((char *)malloc(strlen(s)+1), s));
251 #endif
252
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;
257
258 static int my_input(void);
259 #ifndef FLEX_SCANNER
260 static int my_unput(char);
261 #endif
262
263 #ifdef FLEX_SCANNER
264 #undef YY_INPUT
265 #define YY_INPUT(buf,result,max_size) \
266 if (lex_read_from_string) \
267 { \
268 int c = my_input(); \
269 result = (c == 0) ? YY_NULL : ((buf)[0]=(c), 1); \
270 } \
271 else \
272 if ( (result = read( fileno(yyin), (char *) buf, max_size )) < 0 ) \
273 YY_FATAL_ERROR( "read() in flex scanner failed" );
274 #else
275 #ifndef unput
276 #undef unput
277 #endif
278 #define unput(_c) my_unput(_c)
279 #endif
280
281 // # line 58 "lexer.l"
282
283 /* done after the current pattern has been matched and before the
284 * corresponding action - sets up yytext
285 */
286
287 #define YY_DO_BEFORE_ACTION \
288 yytext = yy_bp; \
289 yyleng = yy_cp - yy_bp; \
290 yy_hold_char = *yy_cp; \
291 *yy_cp = '\0'; \
292 yy_c_buf_p = yy_cp;
293
294 #define EOB_ACT_CONTINUE_SCAN 0
295 #define EOB_ACT_END_OF_FILE 1
296 #define EOB_ACT_LAST_MATCH 2
297
298 /* return all but the first 'n' matched characters back to the input stream */
299 #if !defined(__VISAGECPP__)
300 #define yyless(n) \
301 do \
302 { \
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 */ \
307 } \
308 while ( 0 )
309 #else
310 #define yyless(n) \
311 do \
312 { \
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 */ \
317 } \
318 while ( os2var == 0 )
319 #endif
320
321 #undef unput
322 #define unput(c) yyunput( c, yytext )
323
324 struct yy_buffer_state
325 {
326 FILE *yy_input_file;
327
328 YY_CHAR *yy_ch_buf; /* input buffer */
329 YY_CHAR *yy_buf_pos; /* current position in input buffer */
330
331 /* size of input buffer in bytes, not including room for EOB characters*/
332 int yy_buf_size;
333
334 /* number of characters read into yy_ch_buf, not including EOB characters */
335 int yy_n_chars;
336
337 int yy_eof_status; /* whether we've seen an EOF on this buffer */
338
339 #define EOF_NOT_SEEN 0
340
341 /* "pending" happens when the EOF has been seen but there's still
342 * some text process
343 */
344
345 #define EOF_PENDING 1
346 #define EOF_DONE 2
347 };
348
349 static YY_BUFFER_STATE yy_current_buffer;
350
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
353 * "scanner state"
354 */
355 #define YY_CURRENT_BUFFER yy_current_buffer
356
357
358 /* yy_hold_char holds the character lost when yytext is formed */
359 static YY_CHAR yy_hold_char;
360
361 static int yy_n_chars; /* number of characters read into yy_ch_buf */
362
363
364
365 #ifndef YY_USER_ACTION
366 #define YY_USER_ACTION
367 #endif
368
369 #ifndef YY_USER_INIT
370 #define YY_USER_INIT
371 #endif
372
373 extern YY_CHAR *yytext;
374 extern int yyleng;
375 extern FILE *yyin, *yyout;
376
377 YY_CHAR *yytext;
378 int yyleng;
379
380 FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
381
382 #define YY_END_OF_BUFFER 18
383 typedef int yy_state_type;
384 static const short int yy_accept[34] =
385 { 0,
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,
389 0, 0, 0
390 } ;
391
392 static const YY_CHAR yy_ec[256] =
393 { 0,
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,
404
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,
415
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,
421 1, 1, 1, 1, 1
422 } ;
423
424 static const YY_CHAR yy_meta[21] =
425 { 0,
426 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
427 1, 1, 2, 1, 2, 1, 3, 1, 2, 1
428 } ;
429
430 static const short int yy_base[37] =
431 { 0,
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
436 } ;
437
438 static const short int yy_def[37] =
439 { 0,
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
444 } ;
445
446 static const short int yy_nxt[76] =
447 { 0,
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,
455 33, 33, 33, 33, 33
456 } ;
457
458 static const short int yy_chk[76] =
459 { 0,
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,
467 33, 33, 33, 33, 33
468 } ;
469
470 static yy_state_type yy_last_accepting_state;
471 static YY_CHAR *yy_last_accepting_cpos;
472
473 /* the intent behind this definition is that it'll catch
474 * any uses of REJECT which flex missed
475 */
476 #define REJECT reject_used_but_not_detected
477 #define yymore() yymore_used_but_not_detected
478 #define YY_MORE_ADJ 0
479
480 /* these variables are all declared out here so that section 3 code can
481 * manipulate them
482 */
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 */
487
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 ...
490 */
491 static int yy_did_buffer_switch_on_eof;
492
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 ));
503
504 #define yy_new_buffer yy_create_buffer
505
506 #ifdef __cplusplus
507 static int yyinput YY_PROTO(( void ));
508 #else
509 static int input YY_PROTO(( void ));
510 #endif
511
512 YY_DECL
513 {
514 register yy_state_type yy_current_state;
515 register YY_CHAR *yy_cp, *yy_bp;
516 register int yy_act;
517
518
519
520
521 if ( yy_init )
522 {
523 YY_USER_INIT;
524
525 if ( ! yy_start )
526 yy_start = 1; /* first start state */
527
528 if ( ! yyin )
529 yyin = stdin;
530
531 if ( ! yyout )
532 yyout = stdout;
533
534 if ( yy_current_buffer )
535 yy_init_buffer( yy_current_buffer, yyin );
536 else
537 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
538
539 yy_load_buffer_state();
540
541 yy_init = 0;
542 }
543
544 #if !defined(__VISAGECPP__)
545 while ( 1 ) /* loops until end-of-file is reached */
546 #else
547 os2var = 1;
548 if (os2var == 0) return 0;
549 while ( os2var == 1 ) /* loops until end-of-file is reached */
550 #endif
551 {
552 yy_cp = yy_c_buf_p;
553
554 /* support of yytext */
555 *yy_cp = yy_hold_char;
556
557 /* yy_bp points to the position in yy_ch_buf of the start of the
558 * current run.
559 */
560 yy_bp = yy_cp;
561
562 yy_current_state = yy_start;
563 yy_match:
564 do
565 {
566 register YY_CHAR yy_c = yy_ec[*yy_cp];
567 if ( yy_accept[yy_current_state] )
568 {
569 yy_last_accepting_state = yy_current_state;
570 yy_last_accepting_cpos = yy_cp;
571 }
572 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
573 {
574 yy_current_state = yy_def[yy_current_state];
575 if ( yy_current_state >= 34 )
576 yy_c = yy_meta[yy_c];
577 }
578 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
579 ++yy_cp;
580 }
581 while ( yy_current_state != 33 );
582 yy_cp = yy_last_accepting_cpos;
583 yy_current_state = yy_last_accepting_state;
584
585 yy_find_action:
586 yy_act = yy_accept[yy_current_state];
587
588 YY_DO_BEFORE_ACTION;
589 YY_USER_ACTION;
590
591 do_action: /* this label is used only to access EOF actions */
592
593
594 switch ( yy_act )
595 {
596 case 0: /* must backtrack */
597 {
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;
602 goto yy_find_action;
603 }
604
605 case 1:
606 {
607 yylval.s = strdup((const char*) yytext);
608 return INTEGER;
609 }
610
611 case 2:
612 {
613 return EXP;
614 }
615
616 case 3:
617 {
618 yylval.s = strdup((const char*) yytext);
619 return WORD;
620 }
621
622 case 4:
623 {
624 int len = strlen((const char*) yytext);
625 yytext[len-1] = 0;
626 yylval.s = strdup((const char*) (yytext+1));
627 return WORD;
628 }
629
630 case 5:
631 {
632 yylval.s = strdup((const char*) yytext);
633 return STRING;
634 }
635
636 case 6:
637 {
638 return OPEN;
639 }
640
641 case 7:
642 {
643 return CLOSE;
644 }
645
646 case 8:
647 {
648 return COMMA;
649 }
650
651 case 9:
652 {
653 return OPEN_SQUARE;
654 }
655
656 case 10:
657 {
658 return CLOSE_SQUARE;
659 }
660
661 case 11:
662 {
663 return EQUALS;
664 }
665
666 case 12:
667 {
668 return PERIOD;
669 }
670
671 case 13:
672 {
673 break;
674 }
675
676 case 14:
677 {
678 break;
679 }
680
681 case 15:
682 {
683 loop:
684 #ifdef __cplusplus
685 while (yyinput() != '*') ;
686 switch (yyinput())
687 #else
688 while (input() != '*') ;
689 switch (input())
690 #endif
691 {
692 case '/':
693 break;
694 case '*':
695 unput('*');
696 default:
697 goto loop;
698 }
699 break;
700 }
701
702 case 16:
703 {
704 return ERROR;
705 }
706
707 case 17:
708 {
709 ECHO;
710 break;
711 }
712
713 case YY_STATE_EOF(INITIAL):
714 {
715 yyterminate();
716 }
717
718 case YY_END_OF_BUFFER:
719 {
720 /* amount of text matched not including the EOB char */
721 int yy_amount_of_matched_text = yy_cp - yytext - 1;
722
723 /* undo the effects of YY_DO_BEFORE_ACTION */
724 *yy_cp = yy_hold_char;
725
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().
731 */
732 if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
733 /* this was really a NUL */
734 {
735 yy_state_type yy_next_state;
736
737 yy_c_buf_p = yytext + yy_amount_of_matched_text;
738
739 yy_current_state = yy_get_previous_state();
740
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)
748 */
749
750 yy_next_state = yy_try_NUL_trans( yy_current_state );
751
752 yy_bp = yytext + YY_MORE_ADJ;
753
754 if ( yy_next_state )
755 {
756 /* consume the NUL */
757 yy_cp = ++yy_c_buf_p;
758 yy_current_state = yy_next_state;
759 goto yy_match;
760 }
761 else
762 {
763 yy_cp = yy_last_accepting_cpos;
764 yy_current_state = yy_last_accepting_state;
765 goto yy_find_action;
766 }
767 }
768 else switch ( yy_get_next_buffer() )
769 {
770 case EOB_ACT_END_OF_FILE:
771 {
772 yy_did_buffer_switch_on_eof = 0;
773
774 if ( yywrap() )
775 {
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
782 * will get returned.
783 */
784 yy_c_buf_p = yytext + YY_MORE_ADJ;
785
786 yy_act = YY_STATE_EOF((yy_start - 1) / 2);
787 goto do_action;
788 }
789 else
790 {
791 if ( ! yy_did_buffer_switch_on_eof )
792 YY_NEW_FILE;
793 }
794 }
795 break;
796
797 case EOB_ACT_CONTINUE_SCAN:
798 yy_c_buf_p = yytext + yy_amount_of_matched_text;
799
800 yy_current_state = yy_get_previous_state();
801
802 yy_cp = yy_c_buf_p;
803 yy_bp = yytext + YY_MORE_ADJ;
804 goto yy_match;
805
806 case EOB_ACT_LAST_MATCH:
807 yy_c_buf_p = &yy_current_buffer->yy_ch_buf[yy_n_chars];
808
809 yy_current_state = yy_get_previous_state();
810
811 yy_cp = yy_c_buf_p;
812 yy_bp = yytext + YY_MORE_ADJ;
813 goto yy_find_action;
814 }
815 break;
816 }
817
818 default:
819 #ifdef FLEX_DEBUG
820 printf( "action # %d\n", yy_act );
821 #endif
822 YY_FATAL_ERROR("fatal flex scanner internal error--no action found" );
823 }
824 }
825
826 #if defined(__VISAGECPP__)
827 /* VA complains about proc maybe not returning a value so return one */
828 return 0;
829 #endif
830 }
831
832
833 /* yy_get_next_buffer - try to read in a new buffer
834 *
835 * synopsis
836 * int yy_get_next_buffer();
837 *
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
842 */
843
844 static int yy_get_next_buffer()
845 {
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;
849 int ret_val;
850
851 if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
852 YY_FATAL_ERROR(
853 "fatal flex scanner internal error--end of buffer missed" );
854
855 /* try to read more data */
856
857 /* first move last chars to start of buffer */
858 number_to_move = yy_c_buf_p - yytext;
859
860 for ( i = 0; i < number_to_move; ++i )
861 *(dest++) = *(source++);
862
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,
865 * just force an EOF
866 */
867 yy_n_chars = 0;
868
869 else
870 {
871 int num_to_read = yy_current_buffer->yy_buf_size - number_to_move - 1;
872
873 if ( num_to_read > YY_READ_BUF_SIZE )
874 num_to_read = YY_READ_BUF_SIZE;
875
876 else if ( num_to_read <= 0 )
877 YY_FATAL_ERROR( "fatal error - scanner input buffer overflow" );
878
879 /* read in more data */
880 YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
881 yy_n_chars, num_to_read );
882 }
883
884 if ( yy_n_chars == 0 )
885 {
886 if ( number_to_move == 1 )
887 {
888 ret_val = EOB_ACT_END_OF_FILE;
889 yy_current_buffer->yy_eof_status = EOF_DONE;
890 }
891
892 else
893 {
894 ret_val = EOB_ACT_LAST_MATCH;
895 yy_current_buffer->yy_eof_status = EOF_PENDING;
896 }
897 }
898
899 else
900 ret_val = EOB_ACT_CONTINUE_SCAN;
901
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;
905
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
910 */
911
912 yytext = &yy_current_buffer->yy_ch_buf[1];
913
914 return ( ret_val );
915 }
916
917
918 /* yy_get_previous_state - get the state just before the EOB char was reached
919 *
920 * synopsis
921 * yy_state_type yy_get_previous_state();
922 */
923
924 static yy_state_type yy_get_previous_state()
925 {
926 register yy_state_type yy_current_state;
927 register YY_CHAR *yy_cp;
928
929 yy_current_state = yy_start;
930
931 for ( yy_cp = yytext + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
932 {
933 register YY_CHAR yy_c = (*yy_cp ? yy_ec[*yy_cp] : 1);
934 if ( yy_accept[yy_current_state] )
935 {
936 yy_last_accepting_state = yy_current_state;
937 yy_last_accepting_cpos = yy_cp;
938 }
939 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
940 {
941 yy_current_state = yy_def[yy_current_state];
942 if ( yy_current_state >= 34 )
943 yy_c = yy_meta[yy_c];
944 }
945 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
946 }
947
948 return ( yy_current_state );
949 }
950
951
952 /* yy_try_NUL_trans - try to make a transition on the NUL character
953 *
954 * synopsis
955 * next_state = yy_try_NUL_trans( current_state );
956 */
957
958 #ifdef YY_USE_PROTOS
959 static yy_state_type yy_try_NUL_trans( register yy_state_type yy_current_state )
960 #else
961 static yy_state_type yy_try_NUL_trans( yy_current_state )
962 register yy_state_type yy_current_state;
963 #endif
964 {
965 register int yy_is_jam;
966 register YY_CHAR *yy_cp = yy_c_buf_p;
967
968 register YY_CHAR yy_c = 1;
969 if ( yy_accept[yy_current_state] )
970 {
971 yy_last_accepting_state = yy_current_state;
972 yy_last_accepting_cpos = yy_cp;
973 }
974 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
975 {
976 yy_current_state = yy_def[yy_current_state];
977 if ( yy_current_state >= 34 )
978 yy_c = yy_meta[yy_c];
979 }
980 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
981 yy_is_jam = (yy_current_state == 33);
982
983 return ( yy_is_jam ? 0 : yy_current_state );
984 }
985
986
987 #ifdef YY_USE_PROTOS
988 static void yyunput( YY_CHAR c, register YY_CHAR *yy_bp )
989 #else
990 static void yyunput( c, yy_bp )
991 YY_CHAR c;
992 register YY_CHAR *yy_bp;
993 #endif
994 {
995 register YY_CHAR *yy_cp = yy_c_buf_p;
996
997 /* undo effects of setting up yytext */
998 *yy_cp = yy_hold_char;
999
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];
1007
1008 while ( source > yy_current_buffer->yy_ch_buf )
1009 *--dest = *--source;
1010
1011 yy_cp += dest - source;
1012 yy_bp += dest - source;
1013 yy_n_chars = yy_current_buffer->yy_buf_size;
1014
1015 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1016 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1017 }
1018
1019 if ( yy_cp > yy_bp && yy_cp[-1] == '\n' )
1020 yy_cp[-2] = '\n';
1021
1022 *--yy_cp = c;
1023
1024 /* note: the formal parameter *must* be called "yy_bp" for this
1025 * macro to now work correctly
1026 */
1027 YY_DO_BEFORE_ACTION; /* set up yytext again */
1028 }
1029
1030
1031 #ifdef __cplusplus
1032 static int yyinput()
1033 #else
1034 static int input()
1035 #endif
1036 {
1037 int c;
1038 YY_CHAR *yy_cp = yy_c_buf_p;
1039
1040 *yy_cp = yy_hold_char;
1041
1042 if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
1043 {
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.
1047 */
1048 if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
1049 { /* this was really a NUL */
1050 *yy_c_buf_p = '\0';
1051 }
1052 else
1053 { /* need more input */
1054 yytext = yy_c_buf_p;
1055 ++yy_c_buf_p;
1056
1057 switch ( yy_get_next_buffer() )
1058 {
1059 case EOB_ACT_END_OF_FILE:
1060 {
1061 if ( yywrap() )
1062 {
1063 yy_c_buf_p = yytext + YY_MORE_ADJ;
1064 return ( EOF );
1065 }
1066 YY_NEW_FILE;
1067
1068 #ifdef __cplusplus
1069 return ( yyinput() );
1070 #else
1071 return ( input() );
1072 #endif
1073 }
1074
1075 case EOB_ACT_CONTINUE_SCAN:
1076 yy_c_buf_p = yytext + YY_MORE_ADJ;
1077 break;
1078
1079 case EOB_ACT_LAST_MATCH:
1080 #ifdef __cplusplus
1081 YY_FATAL_ERROR( "unexpected last match in yyinput()" );
1082 #else
1083 YY_FATAL_ERROR( "unexpected last match in input()" );
1084 #endif
1085 }
1086 }
1087 }
1088
1089 c = *yy_c_buf_p;
1090 yy_hold_char = *++yy_c_buf_p;
1091
1092 return ( c );
1093 }
1094
1095
1096 #ifdef YY_USE_PROTOS
1097 void yyrestart( FILE *input_file )
1098 #else
1099 void yyrestart( input_file )
1100 FILE *input_file;
1101 #endif
1102 {
1103 yy_init_buffer( yy_current_buffer, input_file );
1104 yy_load_buffer_state();
1105 }
1106
1107
1108 #ifdef YY_USE_PROTOS
1109 void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
1110 #else
1111 void yy_switch_to_buffer( new_buffer )
1112 YY_BUFFER_STATE new_buffer;
1113 #endif
1114 {
1115 if ( yy_current_buffer == new_buffer )
1116 return;
1117
1118 if ( yy_current_buffer )
1119 {
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;
1124 }
1125
1126 yy_current_buffer = new_buffer;
1127 yy_load_buffer_state();
1128
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.
1133 */
1134 yy_did_buffer_switch_on_eof = 1;
1135 }
1136
1137
1138 #ifdef YY_USE_PROTOS
1139 void yy_load_buffer_state( void )
1140 #else
1141 void yy_load_buffer_state()
1142 #endif
1143 {
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;
1148 }
1149
1150
1151 #ifdef YY_USE_PROTOS
1152 YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
1153 #else
1154 YY_BUFFER_STATE yy_create_buffer( file, size )
1155 FILE *file;
1156 int size;
1157 #endif
1158 {
1159 YY_BUFFER_STATE b;
1160
1161 b = (YY_BUFFER_STATE) malloc( sizeof( struct yy_buffer_state ) );
1162
1163 if ( ! b )
1164 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1165
1166 b->yy_buf_size = size;
1167
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.
1170 */
1171 b->yy_ch_buf = (YY_CHAR *) malloc( (unsigned) (b->yy_buf_size + 2) );
1172
1173 if ( ! b->yy_ch_buf )
1174 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1175
1176 yy_init_buffer( b, file );
1177
1178 return ( b );
1179 }
1180
1181
1182 #ifdef YY_USE_PROTOS
1183 void yy_delete_buffer( YY_BUFFER_STATE b )
1184 #else
1185 void yy_delete_buffer( b )
1186 YY_BUFFER_STATE b;
1187 #endif
1188 {
1189 if ( b == yy_current_buffer )
1190 yy_current_buffer = (YY_BUFFER_STATE) 0;
1191
1192 free( (char *) b->yy_ch_buf );
1193 free( (char *) b );
1194 }
1195
1196
1197 #ifdef YY_USE_PROTOS
1198 void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
1199 #else
1200 void yy_init_buffer( b, file )
1201 YY_BUFFER_STATE b;
1202 FILE *file;
1203 #endif
1204 {
1205 b->yy_input_file = file;
1206
1207 /* we put in the '\n' and start reading from [1] so that an
1208 * initial match-at-newline will be true.
1209 */
1210
1211 b->yy_ch_buf[0] = '\n';
1212 b->yy_n_chars = 1;
1213
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.
1217 */
1218 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1219 b->yy_ch_buf[2] = YY_END_OF_BUFFER_CHAR;
1220
1221 b->yy_buf_pos = &b->yy_ch_buf[1];
1222
1223 b->yy_eof_status = EOF_NOT_SEEN;
1224 }
1225 // # line 108 "lexer.l"
1226
1227
1228
1229 #ifdef FLEX_SCANNER
1230 static int lex_input()
1231 {
1232 return input();
1233 }
1234 #else /* BSD/AT&T lex */
1235 #ifndef input
1236 #error "Sorry, but need either flex or AT&T lex"
1237 #endif
1238 static int lex_input() {
1239 return input();
1240 }
1241
1242 /*
1243 # undef unput
1244 # define unput(_c) my_unput(_c)
1245 */
1246
1247 # undef input
1248 # define input() my_input()
1249 static int my_unput(char c)
1250 {
1251 if (lex_read_from_string)
1252 {
1253 /* Make sure we have something */
1254 if (lex_string_ptr)
1255 {
1256 if (c == '\n') yylineno--;
1257 lex_string_ptr--;
1258 }
1259 }
1260 else
1261 {
1262 yytchar= (c);if(yytchar=='\n')yylineno--;*yysptr++=yytchar;
1263 /* unput(c); Causes infinite recursion! */
1264 }
1265 return c;
1266 }
1267 #endif
1268
1269 /* Public */
1270 void LexFromFile(FILE *fd)
1271 {
1272 lex_read_from_string = 0;
1273 yyin = fd;
1274 /* Don't know why this is necessary, but otherwise
1275 * lex only works _once_!
1276 */
1277 #ifdef FLEX_SCANNER
1278 yy_init = 1;
1279 #endif
1280 }
1281
1282 void LexFromString(char *buffer)
1283 {
1284 lex_read_from_string = 1;
1285 lex_buffer = buffer;
1286 lex_buffer_length = strlen((const char*) buffer);
1287 lex_string_ptr = 0;
1288 /* Don't know why this is necessary, but otherwise
1289 * lex only works _once_!
1290 */
1291 #ifdef FLEX_SCANNER
1292 yy_init = 1;
1293 #endif
1294 }
1295
1296 static int my_input( void )
1297 {
1298 if (lex_read_from_string)
1299 {
1300 if (lex_string_ptr == lex_buffer_length)
1301 {
1302 return 0;
1303 }
1304 else
1305 {
1306 char c = lex_buffer[lex_string_ptr++];
1307 #ifndef FLEX_SCANNER
1308 if (c == '\n') yylineno++;
1309 #endif
1310 return c;
1311 }
1312 }
1313 else
1314 {
1315 return lex_input();
1316 }
1317 }
1318
1319 void wxExprCleanUp()
1320 {
1321 if (yy_current_buffer)
1322 yy_delete_buffer(yy_current_buffer);
1323 }
1324