]>
Commit | Line | Data |
---|---|---|
4a3bdee6 JS |
1 | /* A lexical scanner generated by flex */ |
2 | ||
3 | /* scanner skeleton version: | |
4 | * $Header$ | |
cde6d2e7 | 5 | Last change: JS 13 Jul 97 6:17 pm |
4a3bdee6 | 6 | */ |
99d80019 JS |
7 | /* Copyright: (c) Julian Smart */ |
8 | /* Licence: wxWindows Licence */ | |
4a3bdee6 | 9 | |
cde6d2e7 WS |
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 | ||
4a3bdee6 JS |
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 | |
5a410e44 JS |
23 | #ifndef __cplusplus |
24 | #define __cplusplus | |
25 | #endif | |
4a3bdee6 JS |
26 | #endif |
27 | ||
28 | ||
29 | #ifdef __cplusplus | |
30 | ||
5a410e44 | 31 | #include <stdlib.h> |
4a3bdee6 | 32 | |
5a410e44 JS |
33 | #ifdef __SALFORDC__ |
34 | #include <io.h> | |
35 | #include <clib.h> | |
36 | #else | |
37 | #include <osfcn.h> | |
38 | #endif | |
4a3bdee6 | 39 | |
5a410e44 JS |
40 | #ifdef __VISAGECPP__ |
41 | #include <io.h> | |
42 | #endif | |
4a3bdee6 | 43 | |
5a410e44 JS |
44 | #ifdef __cplusplus |
45 | static int yyinput() | |
46 | #else | |
47 | static int input() | |
48 | #endif | |
4a3bdee6 | 49 | |
5a410e44 JS |
50 | /* use prototypes in function declarations */ |
51 | #define YY_USE_PROTOS | |
4a3bdee6 | 52 | |
5a410e44 JS |
53 | /* the "const" storage-class-modifier is valid */ |
54 | #define YY_USE_CONST | |
4a3bdee6 | 55 | |
cde6d2e7 | 56 | #else /* ! __cplusplus */ |
4a3bdee6 | 57 | |
5a410e44 | 58 | #ifdef __STDC__ |
4a3bdee6 | 59 | |
5a410e44 JS |
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__ */ | |
4a3bdee6 | 70 | |
cde6d2e7 WS |
71 | #ifdef __VISUALC__ |
72 | #define YY_USE_PROTOS | |
73 | #endif | |
74 | ||
5a410e44 JS |
75 | #ifdef __BORLANDC__ |
76 | #include <io.h> | |
77 | #define YY_USE_PROTOS | |
78 | #define YY_USE_CONST | |
79 | #endif | |
80 | ||
1c9819e4 | 81 | #if defined(__MINGW32__) || defined(__WATCOMC__) |
5a410e44 JS |
82 | #include <io.h> |
83 | #endif | |
4a3bdee6 | 84 | |
cde6d2e7 | 85 | #endif /* ! __cplusplus */ |
4a3bdee6 JS |
86 | |
87 | ||
88 | #ifdef __TURBOC__ | |
5a410e44 | 89 | #define YY_USE_CONST |
4a3bdee6 JS |
90 | #endif |
91 | ||
92 | ||
93 | #ifndef YY_USE_CONST | |
5a410e44 | 94 | #define const |
4a3bdee6 JS |
95 | #endif |
96 | ||
97 | ||
98 | #ifdef YY_USE_PROTOS | |
5a410e44 | 99 | #define YY_PROTO(proto) proto |
4a3bdee6 | 100 | #else |
5a410e44 JS |
101 | #define YY_PROTO(proto) () |
102 | /* we can't get here if it's an ANSI C compiler, or a C++ compiler, | |
4a3bdee6 JS |
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 | */ | |
5a410e44 JS |
106 | /* |
107 | char *malloc(); | |
108 | int free(); | |
109 | */ | |
4a3bdee6 JS |
110 | #endif |
111 | ||
112 | ||
113 | /* amount of stuff to slurp up with each read */ | |
114 | #ifndef YY_READ_BUF_SIZE | |
5a410e44 | 115 | #define YY_READ_BUF_SIZE 8192 |
4a3bdee6 JS |
116 | #endif |
117 | ||
5a410e44 | 118 | |
4a3bdee6 JS |
119 | /* returned upon end-of-file */ |
120 | #define YY_END_TOK 0 | |
121 | ||
5a410e44 | 122 | |
4a3bdee6 JS |
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 | ||
5a410e44 | 131 | |
4a3bdee6 JS |
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) \ | |
cde6d2e7 WS |
136 | if ( (result = read( fileno(yyin), (char *) buf, max_size )) < 0 ) \ |
137 | YY_FATAL_ERROR( "read() in flex scanner failed" ); | |
4a3bdee6 JS |
138 | #define YY_NULL 0 |
139 | ||
5a410e44 | 140 | |
4a3bdee6 JS |
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 | ||
5a410e44 | 147 | |
4a3bdee6 JS |
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 | * | |
cde6d2e7 WS |
154 | * if ( something_happens ) |
155 | * YY_FATAL_ERROR( "oops, the something happened" ); | |
156 | * else | |
157 | * everything_okay(); | |
4a3bdee6 JS |
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__) | |
cde6d2e7 WS |
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 ) | |
4a3bdee6 | 173 | #else |
cde6d2e7 WS |
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 ) | |
4a3bdee6 JS |
184 | #endif |
185 | ||
5a410e44 | 186 | |
4a3bdee6 JS |
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__) | |
cde6d2e7 WS |
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 ) | |
4a3bdee6 | 209 | #else |
cde6d2e7 WS |
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 ) | |
4a3bdee6 JS |
217 | #endif |
218 | ||
5a410e44 | 219 | |
4a3bdee6 JS |
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 | ||
4a3bdee6 JS |
225 | |
226 | #define YY_END_OF_BUFFER_CHAR 0 | |
227 | ||
228 | #ifndef YY_BUF_SIZE | |
5a410e44 | 229 | #define YY_BUF_SIZE (YY_READ_BUF_SIZE * 2) /* size of default input buffer */ |
4a3bdee6 JS |
230 | #endif |
231 | ||
232 | typedef struct yy_buffer_state *YY_BUFFER_STATE; | |
233 | ||
234 | #define YY_CHAR unsigned char | |
cde6d2e7 | 235 | /* # line 1 "lexer.l" */ |
4a3bdee6 | 236 | #define INITIAL 0 |
cde6d2e7 | 237 | /* # line 9 "lexer.l" */ |
4a3bdee6 JS |
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) | |
5a410e44 | 250 | #define PROIO_input my_input |
4a3bdee6 JS |
251 | #endif |
252 | /* ---steve162e */ | |
253 | ||
254 | #include "wx/deprecated/expr.h" | |
255 | #ifdef wx_x | |
5a410e44 | 256 | extern char *malloc(); |
4a3bdee6 | 257 | #endif |
4a3bdee6 JS |
258 | |
259 | #if defined(VMS) && ( __VMS_VER < 70000000 ) | |
5a410e44 | 260 | #define strdup(s) (strcpy((char *)malloc(strlen(s)+1), s)); |
4a3bdee6 JS |
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); | |
5a410e44 JS |
269 | #ifndef FLEX_SCANNER |
270 | static int my_unput(char); | |
271 | #endif | |
4a3bdee6 JS |
272 | |
273 | #ifdef FLEX_SCANNER | |
5a410e44 | 274 | #undef YY_INPUT |
cde6d2e7 WS |
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" ); | |
4a3bdee6 | 284 | #else |
5a410e44 JS |
285 | #ifndef unput |
286 | #undef unput | |
287 | #endif | |
288 | #define unput(_c) my_unput(_c) | |
4a3bdee6 JS |
289 | #endif |
290 | ||
cde6d2e7 | 291 | /* # line 58 "lexer.l" */ |
4a3bdee6 JS |
292 | |
293 | /* done after the current pattern has been matched and before the | |
294 | * corresponding action - sets up yytext | |
295 | */ | |
5a410e44 | 296 | |
4a3bdee6 | 297 | #define YY_DO_BEFORE_ACTION \ |
cde6d2e7 WS |
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; | |
4a3bdee6 JS |
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__) | |
cde6d2e7 WS |
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 ) | |
4a3bdee6 | 319 | #else |
cde6d2e7 WS |
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 ) | |
4a3bdee6 JS |
329 | #endif |
330 | ||
331 | #undef unput | |
332 | #define unput(c) yyunput( c, yytext ) | |
333 | ||
4a3bdee6 | 334 | struct yy_buffer_state |
5a410e44 | 335 | { |
4a3bdee6 JS |
336 | FILE *yy_input_file; |
337 | ||
cde6d2e7 WS |
338 | YY_CHAR *yy_ch_buf; /* input buffer */ |
339 | YY_CHAR *yy_buf_pos; /* current position in input buffer */ | |
4a3bdee6 JS |
340 | |
341 | /* size of input buffer in bytes, not including room for EOB characters*/ | |
cde6d2e7 | 342 | int yy_buf_size; |
4a3bdee6 JS |
343 | |
344 | /* number of characters read into yy_ch_buf, not including EOB characters */ | |
345 | int yy_n_chars; | |
346 | ||
cde6d2e7 | 347 | int yy_eof_status; /* whether we've seen an EOF on this buffer */ |
5a410e44 | 348 | |
4a3bdee6 | 349 | #define EOF_NOT_SEEN 0 |
5a410e44 | 350 | |
4a3bdee6 JS |
351 | /* "pending" happens when the EOF has been seen but there's still |
352 | * some text process | |
353 | */ | |
5a410e44 | 354 | |
4a3bdee6 JS |
355 | #define EOF_PENDING 1 |
356 | #define EOF_DONE 2 | |
5a410e44 | 357 | }; |
4a3bdee6 JS |
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 | ||
cde6d2e7 | 371 | static int yy_n_chars; /* number of characters read into yy_ch_buf */ |
4a3bdee6 JS |
372 | |
373 | ||
374 | ||
375 | #ifndef YY_USER_ACTION | |
5a410e44 | 376 | #define YY_USER_ACTION |
4a3bdee6 JS |
377 | #endif |
378 | ||
379 | #ifndef YY_USER_INIT | |
5a410e44 | 380 | #define YY_USER_INIT |
4a3bdee6 JS |
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; | |
cde6d2e7 WS |
495 | static int yy_init = 1; /* whether we need to initialize */ |
496 | static int yy_start = 0; /* start state number */ | |
4a3bdee6 JS |
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 | |
5a410e44 | 517 | static int yyinput YY_PROTO(( void )); |
4a3bdee6 | 518 | #else |
5a410e44 | 519 | static int input YY_PROTO(( void )); |
4a3bdee6 JS |
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 ) | |
cde6d2e7 WS |
532 | { |
533 | YY_USER_INIT; | |
4a3bdee6 | 534 | |
cde6d2e7 WS |
535 | if ( ! yy_start ) |
536 | yy_start = 1; /* first start state */ | |
4a3bdee6 | 537 | |
cde6d2e7 WS |
538 | if ( ! yyin ) |
539 | yyin = stdin; | |
4a3bdee6 | 540 | |
cde6d2e7 WS |
541 | if ( ! yyout ) |
542 | yyout = stdout; | |
4a3bdee6 | 543 | |
cde6d2e7 WS |
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 ); | |
4a3bdee6 | 548 | |
cde6d2e7 | 549 | yy_load_buffer_state(); |
4a3bdee6 | 550 | |
cde6d2e7 WS |
551 | yy_init = 0; |
552 | } | |
4a3bdee6 JS |
553 | |
554 | #if !defined(__VISAGECPP__) | |
cde6d2e7 | 555 | while ( 1 ) /* loops until end-of-file is reached */ |
4a3bdee6 JS |
556 | #else |
557 | os2var = 1; | |
558 | if (os2var == 0) return 0; | |
cde6d2e7 | 559 | while ( os2var == 1 ) /* loops until end-of-file is reached */ |
4a3bdee6 | 560 | #endif |
cde6d2e7 WS |
561 | { |
562 | yy_cp = yy_c_buf_p; | |
4a3bdee6 | 563 | |
cde6d2e7 WS |
564 | /* support of yytext */ |
565 | *yy_cp = yy_hold_char; | |
4a3bdee6 | 566 | |
cde6d2e7 WS |
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; | |
4a3bdee6 | 571 | |
cde6d2e7 | 572 | yy_current_state = yy_start; |
4a3bdee6 | 573 | yy_match: |
cde6d2e7 WS |
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; | |
4a3bdee6 JS |
594 | |
595 | yy_find_action: | |
cde6d2e7 | 596 | yy_act = yy_accept[yy_current_state]; |
4a3bdee6 | 597 | |
cde6d2e7 WS |
598 | YY_DO_BEFORE_ACTION; |
599 | YY_USER_ACTION; | |
4a3bdee6 | 600 | |
cde6d2e7 | 601 | do_action: /* this label is used only to access EOF actions */ |
4a3bdee6 JS |
602 | |
603 | ||
cde6d2e7 | 604 | switch ( yy_act ) |
5a410e44 | 605 | { |
cde6d2e7 WS |
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 | } | |
5a410e44 | 620 | |
cde6d2e7 WS |
621 | case 2: |
622 | { | |
623 | return EXP; | |
624 | } | |
5a410e44 | 625 | |
cde6d2e7 WS |
626 | case 3: |
627 | { | |
628 | yylval.s = strdup((const char*) yytext); | |
629 | return WORD; | |
630 | } | |
5a410e44 | 631 | |
cde6d2e7 WS |
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 | } | |
5a410e44 | 639 | |
cde6d2e7 WS |
640 | case 5: |
641 | { | |
642 | yylval.s = strdup((const char*) yytext); | |
643 | return STRING; | |
644 | } | |
5a410e44 | 645 | |
cde6d2e7 WS |
646 | case 6: |
647 | { | |
648 | return OPEN; | |
649 | } | |
5a410e44 | 650 | |
cde6d2e7 WS |
651 | case 7: |
652 | { | |
653 | return CLOSE; | |
654 | } | |
5a410e44 | 655 | |
cde6d2e7 WS |
656 | case 8: |
657 | { | |
658 | return COMMA; | |
659 | } | |
5a410e44 | 660 | |
cde6d2e7 WS |
661 | case 9: |
662 | { | |
663 | return OPEN_SQUARE; | |
664 | } | |
5a410e44 | 665 | |
cde6d2e7 WS |
666 | case 10: |
667 | { | |
668 | return CLOSE_SQUARE; | |
669 | } | |
5a410e44 | 670 | |
cde6d2e7 WS |
671 | case 11: |
672 | { | |
673 | return EQUALS; | |
674 | } | |
5a410e44 | 675 | |
cde6d2e7 WS |
676 | case 12: |
677 | { | |
678 | return PERIOD; | |
679 | } | |
5a410e44 | 680 | |
cde6d2e7 WS |
681 | case 13: |
682 | { | |
683 | break; | |
684 | } | |
5a410e44 | 685 | |
cde6d2e7 WS |
686 | case 14: |
687 | { | |
688 | break; | |
689 | } | |
5a410e44 | 690 | |
cde6d2e7 WS |
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 | } | |
5a410e44 | 716 | |
cde6d2e7 WS |
717 | case 17: |
718 | { | |
719 | ECHO; | |
720 | break; | |
721 | } | |
5a410e44 | 722 | |
cde6d2e7 WS |
723 | case YY_STATE_EOF(INITIAL): |
724 | { | |
725 | yyterminate(); | |
726 | } | |
5a410e44 | 727 | |
cde6d2e7 WS |
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 | } | |
5a410e44 | 826 | break; |
4a3bdee6 | 827 | |
cde6d2e7 | 828 | default: |
4a3bdee6 | 829 | #ifdef FLEX_DEBUG |
cde6d2e7 | 830 | printf( "action # %d\n", yy_act ); |
4a3bdee6 | 831 | #endif |
cde6d2e7 WS |
832 | YY_FATAL_ERROR("fatal flex scanner internal error--no action found" ); |
833 | } | |
834 | } | |
5a410e44 | 835 | |
4a3bdee6 | 836 | #if defined(__VISAGECPP__) |
cde6d2e7 WS |
837 | /* VA complains about proc maybe not returning a value so return one */ |
838 | return 0; | |
4a3bdee6 | 839 | #endif |
cde6d2e7 | 840 | } |
4a3bdee6 JS |
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() | |
5a410e44 | 855 | { |
4a3bdee6 JS |
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] ) | |
cde6d2e7 | 862 | YY_FATAL_ERROR( "fatal flex scanner internal error--end of buffer missed" ); |
4a3bdee6 JS |
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 ) | |
cde6d2e7 | 870 | *(dest++) = *(source++); |
4a3bdee6 JS |
871 | |
872 | if ( yy_current_buffer->yy_eof_status != EOF_NOT_SEEN ) | |
cde6d2e7 WS |
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; | |
4a3bdee6 JS |
877 | |
878 | else | |
cde6d2e7 WS |
879 | { |
880 | int num_to_read = yy_current_buffer->yy_buf_size - number_to_move - 1; | |
4a3bdee6 | 881 | |
cde6d2e7 WS |
882 | if ( num_to_read > YY_READ_BUF_SIZE ) |
883 | num_to_read = YY_READ_BUF_SIZE; | |
4a3bdee6 | 884 | |
cde6d2e7 WS |
885 | else if ( num_to_read <= 0 ) |
886 | YY_FATAL_ERROR( "fatal error - scanner input buffer overflow" ); | |
4a3bdee6 | 887 | |
cde6d2e7 WS |
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 | } | |
4a3bdee6 JS |
892 | |
893 | if ( yy_n_chars == 0 ) | |
cde6d2e7 WS |
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 | } | |
4a3bdee6 JS |
907 | |
908 | else | |
cde6d2e7 | 909 | ret_val = EOB_ACT_CONTINUE_SCAN; |
4a3bdee6 JS |
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 ); | |
5a410e44 | 924 | } |
4a3bdee6 JS |
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() | |
5a410e44 | 934 | { |
4a3bdee6 JS |
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 ) | |
cde6d2e7 WS |
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 | } | |
4a3bdee6 JS |
956 | |
957 | return ( yy_current_state ); | |
5a410e44 | 958 | } |
4a3bdee6 JS |
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 | |
5a410e44 | 973 | { |
4a3bdee6 JS |
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] ) | |
cde6d2e7 WS |
979 | { |
980 | yy_last_accepting_state = yy_current_state; | |
981 | yy_last_accepting_cpos = yy_cp; | |
982 | } | |
4a3bdee6 | 983 | while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) |
cde6d2e7 WS |
984 | { |
985 | yy_current_state = yy_def[yy_current_state]; | |
986 | if ( yy_current_state >= 34 ) | |
987 | yy_c = yy_meta[yy_c]; | |
988 | } | |
4a3bdee6 JS |
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 ); | |
5a410e44 | 993 | } |
4a3bdee6 JS |
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 | |
5a410e44 | 1003 | { |
4a3bdee6 JS |
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 ) | |
cde6d2e7 WS |
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 | } | |
4a3bdee6 JS |
1027 | |
1028 | if ( yy_cp > yy_bp && yy_cp[-1] == '\n' ) | |
cde6d2e7 | 1029 | yy_cp[-2] = '\n'; |
4a3bdee6 JS |
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 */ | |
5a410e44 | 1037 | } |
4a3bdee6 JS |
1038 | |
1039 | ||
1040 | #ifdef __cplusplus | |
1041 | static int yyinput() | |
1042 | #else | |
1043 | static int input() | |
1044 | #endif | |
5a410e44 | 1045 | { |
4a3bdee6 JS |
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 ) | |
cde6d2e7 WS |
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] ) | |
5a410e44 | 1058 | { /* this was really a NUL */ |
cde6d2e7 | 1059 | *yy_c_buf_p = '\0'; |
5a410e44 | 1060 | } |
cde6d2e7 WS |
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 | } | |
4a3bdee6 JS |
1097 | |
1098 | c = *yy_c_buf_p; | |
1099 | yy_hold_char = *++yy_c_buf_p; | |
1100 | ||
1101 | return ( c ); | |
5a410e44 | 1102 | } |
4a3bdee6 JS |
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 | |
5a410e44 | 1111 | { |
4a3bdee6 JS |
1112 | yy_init_buffer( yy_current_buffer, input_file ); |
1113 | yy_load_buffer_state(); | |
5a410e44 | 1114 | } |
4a3bdee6 JS |
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 | |
5a410e44 | 1123 | { |
4a3bdee6 | 1124 | if ( yy_current_buffer == new_buffer ) |
cde6d2e7 | 1125 | return; |
4a3bdee6 JS |
1126 | |
1127 | if ( yy_current_buffer ) | |
cde6d2e7 WS |
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 | } | |
4a3bdee6 JS |
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; | |
5a410e44 | 1144 | } |
4a3bdee6 JS |
1145 | |
1146 | ||
1147 | #ifdef YY_USE_PROTOS | |
1148 | void yy_load_buffer_state( void ) | |
1149 | #else | |
1150 | void yy_load_buffer_state() | |
1151 | #endif | |
5a410e44 | 1152 | { |
4a3bdee6 JS |
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; | |
5a410e44 | 1157 | } |
4a3bdee6 JS |
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 | |
5a410e44 | 1167 | { |
4a3bdee6 JS |
1168 | YY_BUFFER_STATE b; |
1169 | ||
1170 | b = (YY_BUFFER_STATE) malloc( sizeof( struct yy_buffer_state ) ); | |
1171 | ||
1172 | if ( ! b ) | |
cde6d2e7 | 1173 | YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); |
4a3bdee6 JS |
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 ) | |
cde6d2e7 | 1183 | YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); |
4a3bdee6 JS |
1184 | |
1185 | yy_init_buffer( b, file ); | |
1186 | ||
1187 | return ( b ); | |
5a410e44 | 1188 | } |
4a3bdee6 JS |
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 | |
5a410e44 | 1197 | { |
4a3bdee6 | 1198 | if ( b == yy_current_buffer ) |
cde6d2e7 | 1199 | yy_current_buffer = (YY_BUFFER_STATE) 0; |
4a3bdee6 JS |
1200 | |
1201 | free( (char *) b->yy_ch_buf ); | |
1202 | free( (char *) b ); | |
5a410e44 | 1203 | } |
4a3bdee6 JS |
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 | |
5a410e44 | 1213 | { |
4a3bdee6 JS |
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; | |
5a410e44 | 1233 | } |
cde6d2e7 | 1234 | /* # line 108 "lexer.l" */ |
4a3bdee6 JS |
1235 | |
1236 | ||
1237 | ||
1238 | #ifdef FLEX_SCANNER | |
5a410e44 JS |
1239 | static int lex_input() |
1240 | { | |
4a3bdee6 | 1241 | return input(); |
5a410e44 | 1242 | } |
cde6d2e7 | 1243 | #else /* BSD/AT&T lex */ |
5a410e44 JS |
1244 | #ifndef input |
1245 | #error "Sorry, but need either flex or AT&T lex" | |
1246 | #endif | |
1247 | static int lex_input() { | |
4a3bdee6 | 1248 | return input(); |
5a410e44 | 1249 | } |
4a3bdee6 | 1250 | |
5a410e44 JS |
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 | { | |
4a3bdee6 | 1262 | /* Make sure we have something */ |
5a410e44 JS |
1263 | if (lex_string_ptr) |
1264 | { | |
4a3bdee6 JS |
1265 | if (c == '\n') yylineno--; |
1266 | lex_string_ptr--; | |
1267 | } | |
5a410e44 JS |
1268 | } |
1269 | else | |
1270 | { | |
4a3bdee6 | 1271 | yytchar= (c);if(yytchar=='\n')yylineno--;*yysptr++=yytchar; |
5a410e44 | 1272 | /* unput(c); Causes infinite recursion! */ |
4a3bdee6 JS |
1273 | } |
1274 | return c; | |
5a410e44 | 1275 | } |
4a3bdee6 JS |
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 | { | |
5a410e44 JS |
1307 | if (lex_read_from_string) |
1308 | { | |
cde6d2e7 | 1309 | if (lex_string_ptr == lex_buffer_length) |
5a410e44 | 1310 | { |
cde6d2e7 | 1311 | return 0; |
5a410e44 JS |
1312 | } |
1313 | else | |
1314 | { | |
cde6d2e7 | 1315 | char c = lex_buffer[lex_string_ptr++]; |
4a3bdee6 | 1316 | #ifndef FLEX_SCANNER |
cde6d2e7 | 1317 | if (c == '\n') yylineno++; |
4a3bdee6 | 1318 | #endif |
cde6d2e7 WS |
1319 | return c; |
1320 | } | |
5a410e44 JS |
1321 | } |
1322 | else | |
1323 | { | |
cde6d2e7 WS |
1324 | return lex_input(); |
1325 | } | |
4a3bdee6 JS |
1326 | } |
1327 | ||
1328 | void wxExprCleanUp() | |
1329 | { | |
cde6d2e7 WS |
1330 | if (yy_current_buffer) |
1331 | yy_delete_buffer(yy_current_buffer); | |
4a3bdee6 | 1332 | } |
5a410e44 | 1333 | |
cde6d2e7 WS |
1334 | #ifdef __VISUALC__ |
1335 | #pragma warning(pop) | |
1336 | #endif |