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