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