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