Line data Source code
1 :
2 : #define YY_INT_ALIGNED short int
3 :
4 : /* A lexical scanner generated by flex */
5 :
6 : #define FLEX_SCANNER
7 : #define YY_FLEX_MAJOR_VERSION 2
8 : #define YY_FLEX_MINOR_VERSION 6
9 : #define YY_FLEX_SUBMINOR_VERSION 4
10 : #if YY_FLEX_SUBMINOR_VERSION > 0
11 : #define FLEX_BETA
12 : #endif
13 :
14 : /* First, we deal with platform-specific or compiler-specific issues. */
15 :
16 : /* begin standard C headers. */
17 : #include <stdio.h>
18 : #include <string.h>
19 : #include <errno.h>
20 : #include <stdlib.h>
21 :
22 : /* end standard C headers. */
23 :
24 : /* flex integer type definitions */
25 :
26 : #ifndef FLEXINT_H
27 : #define FLEXINT_H
28 :
29 : /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
30 :
31 : #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
32 :
33 : /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
34 : * if you want the limit (max/min) macros for int types.
35 : */
36 : #ifndef __STDC_LIMIT_MACROS
37 : #define __STDC_LIMIT_MACROS 1
38 : #endif
39 :
40 : #include <inttypes.h>
41 : typedef int8_t flex_int8_t;
42 : typedef uint8_t flex_uint8_t;
43 : typedef int16_t flex_int16_t;
44 : typedef uint16_t flex_uint16_t;
45 : typedef int32_t flex_int32_t;
46 : typedef uint32_t flex_uint32_t;
47 : #else
48 : typedef signed char flex_int8_t;
49 : typedef short int flex_int16_t;
50 : typedef int flex_int32_t;
51 : typedef unsigned char flex_uint8_t;
52 : typedef unsigned short int flex_uint16_t;
53 : typedef unsigned int flex_uint32_t;
54 :
55 : /* Limits of integral types. */
56 : #ifndef INT8_MIN
57 : #define INT8_MIN (-128)
58 : #endif
59 : #ifndef INT16_MIN
60 : #define INT16_MIN (-32767-1)
61 : #endif
62 : #ifndef INT32_MIN
63 : #define INT32_MIN (-2147483647-1)
64 : #endif
65 : #ifndef INT8_MAX
66 : #define INT8_MAX (127)
67 : #endif
68 : #ifndef INT16_MAX
69 : #define INT16_MAX (32767)
70 : #endif
71 : #ifndef INT32_MAX
72 : #define INT32_MAX (2147483647)
73 : #endif
74 : #ifndef UINT8_MAX
75 : #define UINT8_MAX (255U)
76 : #endif
77 : #ifndef UINT16_MAX
78 : #define UINT16_MAX (65535U)
79 : #endif
80 : #ifndef UINT32_MAX
81 : #define UINT32_MAX (4294967295U)
82 : #endif
83 :
84 : #ifndef SIZE_MAX
85 : #define SIZE_MAX (~(size_t)0)
86 : #endif
87 :
88 : #endif /* ! C99 */
89 :
90 : #endif /* ! FLEXINT_H */
91 :
92 : /* begin standard C++ headers. */
93 :
94 : /* TODO: this is always defined, so inline it */
95 : #define yyconst const
96 :
97 : #if defined(__GNUC__) && __GNUC__ >= 3
98 : #define yynoreturn __attribute__((__noreturn__))
99 : #else
100 : #define yynoreturn
101 : #endif
102 :
103 : /* Returned upon end-of-file. */
104 : #define YY_NULL 0
105 :
106 : /* Promotes a possibly negative, possibly signed char to an
107 : * integer in range [0..255] for use as an array index.
108 : */
109 : #define YY_SC_TO_UI(c) ((YY_CHAR) (c))
110 :
111 : /* Enter a start condition. This macro really ought to take a parameter,
112 : * but we do it the disgusting crufty way forced on us by the ()-less
113 : * definition of BEGIN.
114 : */
115 : #define BEGIN (yy_start) = 1 + 2 *
116 : /* Translate the current start state into a value that can be later handed
117 : * to BEGIN to return to the state. The YYSTATE alias is for lex
118 : * compatibility.
119 : */
120 : #define YY_START (((yy_start) - 1) / 2)
121 : #define YYSTATE YY_START
122 : /* Action number for EOF rule of a given start state. */
123 : #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
124 : /* Special action meaning "start processing a new file". */
125 : #define YY_NEW_FILE yyrestart( yyin )
126 : #define YY_END_OF_BUFFER_CHAR 0
127 :
128 : /* Size of default input buffer. */
129 : #ifndef YY_BUF_SIZE
130 : #ifdef __ia64__
131 : /* On IA-64, the buffer size is 16k, not 8k.
132 : * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
133 : * Ditto for the __ia64__ case accordingly.
134 : */
135 : #define YY_BUF_SIZE 32768
136 : #else
137 : #define YY_BUF_SIZE 16384
138 : #endif /* __ia64__ */
139 : #endif
140 :
141 : /* The state buf must be large enough to hold one state per character in the main buffer.
142 : */
143 : #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
144 :
145 : #ifndef YY_TYPEDEF_YY_BUFFER_STATE
146 : #define YY_TYPEDEF_YY_BUFFER_STATE
147 : typedef struct yy_buffer_state *YY_BUFFER_STATE;
148 : #endif
149 :
150 : #ifndef YY_TYPEDEF_YY_SIZE_T
151 : #define YY_TYPEDEF_YY_SIZE_T
152 : typedef size_t yy_size_t;
153 : #endif
154 :
155 : extern int yyleng;
156 :
157 : extern FILE *yyin, *yyout;
158 :
159 : #define EOB_ACT_CONTINUE_SCAN 0
160 : #define EOB_ACT_END_OF_FILE 1
161 : #define EOB_ACT_LAST_MATCH 2
162 :
163 : #define YY_LESS_LINENO(n)
164 : #define YY_LINENO_REWIND_TO(ptr)
165 :
166 : /* Return all but the first "n" matched characters back to the input stream. */
167 : #define yyless(n) \
168 : do \
169 : { \
170 : /* Undo effects of setting up yytext. */ \
171 : int yyless_macro_arg = (n); \
172 : YY_LESS_LINENO(yyless_macro_arg);\
173 : *yy_cp = (yy_hold_char); \
174 : YY_RESTORE_YY_MORE_OFFSET \
175 : (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
176 : YY_DO_BEFORE_ACTION; /* set up yytext again */ \
177 : } \
178 : while ( 0 )
179 : #define unput(c) yyunput( c, (yytext_ptr) )
180 :
181 : #ifndef YY_STRUCT_YY_BUFFER_STATE
182 : #define YY_STRUCT_YY_BUFFER_STATE
183 : struct yy_buffer_state
184 : {
185 : FILE *yy_input_file;
186 :
187 : char *yy_ch_buf; /* input buffer */
188 : char *yy_buf_pos; /* current position in input buffer */
189 :
190 : /* Size of input buffer in bytes, not including room for EOB
191 : * characters.
192 : */
193 : int yy_buf_size;
194 :
195 : /* Number of characters read into yy_ch_buf, not including EOB
196 : * characters.
197 : */
198 : int yy_n_chars;
199 :
200 : /* Whether we "own" the buffer - i.e., we know we created it,
201 : * and can realloc() it to grow it, and should free() it to
202 : * delete it.
203 : */
204 : int yy_is_our_buffer;
205 :
206 : /* Whether this is an "interactive" input source; if so, and
207 : * if we're using stdio for input, then we want to use getc()
208 : * instead of fread(), to make sure we stop fetching input after
209 : * each newline.
210 : */
211 : int yy_is_interactive;
212 :
213 : /* Whether we're considered to be at the beginning of a line.
214 : * If so, '^' rules will be active on the next match, otherwise
215 : * not.
216 : */
217 : int yy_at_bol;
218 :
219 : int yy_bs_lineno; /**< The line count. */
220 : int yy_bs_column; /**< The column count. */
221 :
222 : /* Whether to try to fill the input buffer when we reach the
223 : * end of it.
224 : */
225 : int yy_fill_buffer;
226 :
227 : int yy_buffer_status;
228 :
229 : #define YY_BUFFER_NEW 0
230 : #define YY_BUFFER_NORMAL 1
231 : /* When an EOF's been seen but there's still some text to process
232 : * then we mark the buffer as YY_EOF_PENDING, to indicate that we
233 : * shouldn't try reading from the input source any more. We might
234 : * still have a bunch of tokens to match, though, because of
235 : * possible backing-up.
236 : *
237 : * When we actually see the EOF, we change the status to "new"
238 : * (via yyrestart()), so that the user can continue scanning by
239 : * just pointing yyin at a new input file.
240 : */
241 : #define YY_BUFFER_EOF_PENDING 2
242 :
243 : };
244 : #endif /* !YY_STRUCT_YY_BUFFER_STATE */
245 :
246 : /* Stack of input buffers. */
247 : static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
248 : static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
249 : static YY_BUFFER_STATE * yy_buffer_stack = NULL; /**< Stack as an array. */
250 :
251 : /* We provide macros for accessing buffer states in case in the
252 : * future we want to put the buffer states in a more general
253 : * "scanner state".
254 : *
255 : * Returns the top of the stack, or NULL.
256 : */
257 : #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
258 : ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
259 : : NULL)
260 : /* Same as previous macro, but useful when we know that the buffer stack is not
261 : * NULL or when we need an lvalue. For internal use only.
262 : */
263 : #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
264 :
265 : /* yy_hold_char holds the character lost when yytext is formed. */
266 : static char yy_hold_char;
267 : static int yy_n_chars; /* number of characters read into yy_ch_buf */
268 : int yyleng;
269 :
270 : /* Points to current character in buffer. */
271 : static char *yy_c_buf_p = NULL;
272 : static int yy_init = 0; /* whether we need to initialize */
273 : static int yy_start = 0; /* start state number */
274 :
275 : /* Flag which is used to allow yywrap()'s to do buffer switches
276 : * instead of setting up a fresh yyin. A bit of a hack ...
277 : */
278 : static int yy_did_buffer_switch_on_eof;
279 :
280 : void yyrestart ( FILE *input_file );
281 : void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer );
282 : YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size );
283 : void yy_delete_buffer ( YY_BUFFER_STATE b );
284 : void yy_flush_buffer ( YY_BUFFER_STATE b );
285 : void yypush_buffer_state ( YY_BUFFER_STATE new_buffer );
286 : void yypop_buffer_state ( void );
287 :
288 : static void yyensure_buffer_stack ( void );
289 : static void yy_load_buffer_state ( void );
290 : static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file );
291 : #define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER )
292 :
293 : YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size );
294 : YY_BUFFER_STATE yy_scan_string ( const char *yy_str );
295 : YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len );
296 :
297 : void *yyalloc ( yy_size_t );
298 : void *yyrealloc ( void *, yy_size_t );
299 : void yyfree ( void * );
300 :
301 : #define yy_new_buffer yy_create_buffer
302 : #define yy_set_interactive(is_interactive) \
303 : { \
304 : if ( ! YY_CURRENT_BUFFER ){ \
305 : yyensure_buffer_stack (); \
306 : YY_CURRENT_BUFFER_LVALUE = \
307 : yy_create_buffer( yyin, YY_BUF_SIZE ); \
308 : } \
309 : YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
310 : }
311 : #define yy_set_bol(at_bol) \
312 : { \
313 : if ( ! YY_CURRENT_BUFFER ){\
314 : yyensure_buffer_stack (); \
315 : YY_CURRENT_BUFFER_LVALUE = \
316 : yy_create_buffer( yyin, YY_BUF_SIZE ); \
317 : } \
318 : YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
319 : }
320 : #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
321 :
322 : /* Begin user sect3 */
323 : typedef flex_uint8_t YY_CHAR;
324 :
325 : FILE *yyin = NULL, *yyout = NULL;
326 :
327 : typedef int yy_state_type;
328 :
329 : extern int yylineno;
330 : int yylineno = 1;
331 :
332 : extern char *yytext;
333 : #ifdef yytext_ptr
334 : #undef yytext_ptr
335 : #endif
336 : #define yytext_ptr yytext
337 :
338 : static yy_state_type yy_get_previous_state ( void );
339 : static yy_state_type yy_try_NUL_trans ( yy_state_type current_state );
340 : static int yy_get_next_buffer ( void );
341 : static void yynoreturn yy_fatal_error ( const char* msg );
342 :
343 : /* Done after the current pattern has been matched and before the
344 : * corresponding action - sets up yytext.
345 : */
346 : #define YY_DO_BEFORE_ACTION \
347 : (yytext_ptr) = yy_bp; \
348 : yyleng = (int) (yy_cp - yy_bp); \
349 : (yy_hold_char) = *yy_cp; \
350 : *yy_cp = '\0'; \
351 : (yy_c_buf_p) = yy_cp;
352 : #define YY_NUM_RULES 16
353 : #define YY_END_OF_BUFFER 17
354 : /* This struct is not used in this scanner,
355 : but its presence is necessary. */
356 : struct yy_trans_info
357 : {
358 : flex_int32_t yy_verify;
359 : flex_int32_t yy_nxt;
360 : };
361 : static const flex_int16_t yy_accept[46] =
362 : { 0,
363 : 0, 0, 17, 15, 11, 12, 13, 10, 9, 14,
364 : 14, 14, 14, 10, 9, 14, 3, 14, 14, 1,
365 : 7, 14, 14, 8, 14, 14, 14, 14, 14, 14,
366 : 14, 6, 14, 14, 5, 14, 14, 14, 14, 14,
367 : 14, 4, 14, 2, 0
368 : } ;
369 :
370 : static const YY_CHAR yy_ec[256] =
371 : { 0,
372 : 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
373 : 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
374 : 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
375 : 1, 2, 1, 4, 5, 1, 1, 1, 1, 1,
376 : 1, 1, 1, 1, 1, 1, 1, 6, 6, 6,
377 : 6, 6, 6, 6, 6, 6, 6, 1, 1, 1,
378 : 1, 1, 1, 1, 7, 7, 7, 7, 7, 7,
379 : 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
380 : 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
381 : 1, 1, 1, 1, 8, 1, 9, 10, 11, 12,
382 :
383 : 13, 14, 7, 7, 15, 7, 7, 16, 7, 17,
384 : 18, 19, 7, 20, 7, 21, 7, 7, 7, 22,
385 : 7, 7, 1, 1, 1, 1, 1, 1, 1, 1,
386 : 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
387 : 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
388 : 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
389 : 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
390 : 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
391 : 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
392 : 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
393 :
394 : 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
395 : 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
396 : 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
397 : 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
398 : 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
399 : 1, 1, 1, 1, 1
400 : } ;
401 :
402 : static const YY_CHAR yy_meta[23] =
403 : { 0,
404 : 1, 1, 2, 1, 1, 3, 3, 3, 3, 3,
405 : 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
406 : 3, 3
407 : } ;
408 :
409 : static const flex_int16_t yy_base[48] =
410 : { 0,
411 : 0, 0, 56, 57, 57, 57, 57, 0, 49, 0,
412 : 12, 13, 34, 0, 47, 0, 0, 40, 31, 0,
413 : 0, 38, 36, 0, 30, 34, 32, 25, 22, 28,
414 : 34, 0, 19, 13, 0, 22, 30, 26, 26, 18,
415 : 12, 0, 14, 0, 57, 34, 23
416 : } ;
417 :
418 : static const flex_int16_t yy_def[48] =
419 : { 0,
420 : 45, 1, 45, 45, 45, 45, 45, 46, 47, 47,
421 : 47, 47, 47, 46, 47, 47, 47, 47, 47, 47,
422 : 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
423 : 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
424 : 47, 47, 47, 47, 0, 45, 45
425 : } ;
426 :
427 : static const flex_int16_t yy_nxt[80] =
428 : { 0,
429 : 4, 5, 6, 7, 8, 9, 10, 10, 10, 10,
430 : 10, 10, 11, 10, 12, 10, 10, 10, 13, 10,
431 : 10, 10, 17, 36, 21, 16, 44, 43, 18, 22,
432 : 42, 19, 20, 37, 14, 41, 14, 40, 39, 38,
433 : 35, 34, 33, 32, 31, 30, 29, 28, 27, 26,
434 : 25, 24, 15, 23, 15, 45, 3, 45, 45, 45,
435 : 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
436 : 45, 45, 45, 45, 45, 45, 45, 45, 45
437 : } ;
438 :
439 : static const flex_int16_t yy_chk[80] =
440 : { 0,
441 : 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
442 : 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
443 : 1, 1, 11, 34, 12, 47, 43, 41, 11, 12,
444 : 40, 11, 11, 34, 46, 39, 46, 38, 37, 36,
445 : 33, 31, 30, 29, 28, 27, 26, 25, 23, 22,
446 : 19, 18, 15, 13, 9, 3, 45, 45, 45, 45,
447 : 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
448 : 45, 45, 45, 45, 45, 45, 45, 45, 45
449 : } ;
450 :
451 : static yy_state_type yy_last_accepting_state;
452 : static char *yy_last_accepting_cpos;
453 :
454 : extern int yy_flex_debug;
455 : int yy_flex_debug = 0;
456 :
457 : /* The intent behind this definition is that it'll catch
458 : * any uses of REJECT which flex missed.
459 : */
460 : #define REJECT reject_used_but_not_detected
461 : #define yymore() yymore_used_but_not_detected
462 : #define YY_MORE_ADJ 0
463 : #define YY_RESTORE_YY_MORE_OFFSET
464 : char *yytext;
465 : /*
466 : * Copyright (c) 1998 - 2000 Kungliga Tekniska Högskolan
467 : * (Royal Institute of Technology, Stockholm, Sweden).
468 : * All rights reserved.
469 : *
470 : * Redistribution and use in source and binary forms, with or without
471 : * modification, are permitted provided that the following conditions
472 : * are met:
473 : *
474 : * 1. Redistributions of source code must retain the above copyright
475 : * notice, this list of conditions and the following disclaimer.
476 : *
477 : * 2. Redistributions in binary form must reproduce the above copyright
478 : * notice, this list of conditions and the following disclaimer in the
479 : * documentation and/or other materials provided with the distribution.
480 : *
481 : * 3. Neither the name of the Institute nor the names of its contributors
482 : * may be used to endorse or promote products derived from this software
483 : * without specific prior written permission.
484 : *
485 : * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
486 : * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
487 : * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
488 : * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
489 : * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
490 : * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
491 : * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
492 : * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
493 : * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
494 : * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
495 : * SUCH DAMAGE.
496 : */
497 :
498 : /*
499 : * This is to handle the definition of this symbol in some AIX
500 : * headers, which will conflict with the definition that lex will
501 : * generate for it. It's only a problem for AIX lex.
502 : */
503 :
504 : #undef ECHO
505 :
506 : #include "compile_et.h"
507 : #include "parse.h"
508 : #include "lex.h"
509 :
510 : static unsigned lineno = 1;
511 : static int getstring(void);
512 :
513 : #define YY_NO_UNPUT
514 :
515 : #undef ECHO
516 :
517 : #define INITIAL 0
518 :
519 : #ifndef YY_NO_UNISTD_H
520 : /* Special case for "unistd.h", since it is non-ANSI. We include it way
521 : * down here because we want the user's section 1 to have been scanned first.
522 : * The user has a chance to override it with an option.
523 : */
524 : #include <unistd.h>
525 : #endif
526 :
527 : #ifndef YY_EXTRA_TYPE
528 : #define YY_EXTRA_TYPE void *
529 : #endif
530 :
531 : static int yy_init_globals ( void );
532 :
533 : /* Accessor methods to globals.
534 : These are made visible to non-reentrant scanners for convenience. */
535 :
536 : int yylex_destroy ( void );
537 :
538 : int yyget_debug ( void );
539 :
540 : void yyset_debug ( int debug_flag );
541 :
542 : YY_EXTRA_TYPE yyget_extra ( void );
543 :
544 : void yyset_extra ( YY_EXTRA_TYPE user_defined );
545 :
546 : FILE *yyget_in ( void );
547 :
548 : void yyset_in ( FILE * _in_str );
549 :
550 : FILE *yyget_out ( void );
551 :
552 : void yyset_out ( FILE * _out_str );
553 :
554 : int yyget_leng ( void );
555 :
556 : char *yyget_text ( void );
557 :
558 : int yyget_lineno ( void );
559 :
560 : void yyset_lineno ( int _line_number );
561 :
562 : /* Macros after this point can all be overridden by user definitions in
563 : * section 1.
564 : */
565 :
566 : #ifndef YY_SKIP_YYWRAP
567 : #ifdef __cplusplus
568 : extern "C" int yywrap ( void );
569 : #else
570 : extern int yywrap ( void );
571 : #endif
572 : #endif
573 :
574 : #ifndef YY_NO_UNPUT
575 :
576 : #endif
577 :
578 : #ifndef yytext_ptr
579 : static void yy_flex_strncpy ( char *, const char *, int );
580 : #endif
581 :
582 : #ifdef YY_NEED_STRLEN
583 : static int yy_flex_strlen ( const char * );
584 : #endif
585 :
586 : #ifndef YY_NO_INPUT
587 : #ifdef __cplusplus
588 : static int yyinput ( void );
589 : #else
590 : static int input ( void );
591 : #endif
592 :
593 : #endif
594 :
595 : /* Amount of stuff to slurp up with each read. */
596 : #ifndef YY_READ_BUF_SIZE
597 : #ifdef __ia64__
598 : /* On IA-64, the buffer size is 16k, not 8k */
599 : #define YY_READ_BUF_SIZE 16384
600 : #else
601 : #define YY_READ_BUF_SIZE 8192
602 : #endif /* __ia64__ */
603 : #endif
604 :
605 : /* Copy whatever the last rule matched to the standard output. */
606 : #ifndef ECHO
607 : /* This used to be an fputs(), but since the string might contain NUL's,
608 : * we now use fwrite().
609 : */
610 : #define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0)
611 : #endif
612 :
613 : /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
614 : * is returned in "result".
615 : */
616 : #ifndef YY_INPUT
617 : #define YY_INPUT(buf,result,max_size) \
618 : if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
619 : { \
620 : int c = '*'; \
621 : int n; \
622 : for ( n = 0; n < max_size && \
623 : (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
624 : buf[n] = (char) c; \
625 : if ( c == '\n' ) \
626 : buf[n++] = (char) c; \
627 : if ( c == EOF && ferror( yyin ) ) \
628 : YY_FATAL_ERROR( "input in flex scanner failed" ); \
629 : result = n; \
630 : } \
631 : else \
632 : { \
633 : errno=0; \
634 : while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \
635 : { \
636 : if( errno != EINTR) \
637 : { \
638 : YY_FATAL_ERROR( "input in flex scanner failed" ); \
639 : break; \
640 : } \
641 : errno=0; \
642 : clearerr(yyin); \
643 : } \
644 : }\
645 : \
646 :
647 : #endif
648 :
649 : /* No semi-colon after return; correct usage is to write "yyterminate();" -
650 : * we don't want an extra ';' after the "return" because that will cause
651 : * some compilers to complain about unreachable statements.
652 : */
653 : #ifndef yyterminate
654 : #define yyterminate() return YY_NULL
655 : #endif
656 :
657 : /* Number of entries by which start-condition stack grows. */
658 : #ifndef YY_START_STACK_INCR
659 : #define YY_START_STACK_INCR 25
660 : #endif
661 :
662 : /* Report a fatal error. */
663 : #ifndef YY_FATAL_ERROR
664 : #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
665 : #endif
666 :
667 : /* end tables serialization structures and prototypes */
668 :
669 : /* Default declaration of generated scanner - a define so the user can
670 : * easily add parameters.
671 : */
672 : #ifndef YY_DECL
673 : #define YY_DECL_IS_OURS 1
674 :
675 : extern int yylex (void);
676 :
677 : #define YY_DECL int yylex (void)
678 : #endif /* !YY_DECL */
679 :
680 : /* Code executed at the beginning of each rule, after yytext and yyleng
681 : * have been set up.
682 : */
683 : #ifndef YY_USER_ACTION
684 : #define YY_USER_ACTION
685 : #endif
686 :
687 : /* Code executed at the end of each rule. */
688 : #ifndef YY_BREAK
689 : #define YY_BREAK /*LINTED*/break;
690 : #endif
691 :
692 : #define YY_RULE_SETUP \
693 : YY_USER_ACTION
694 :
695 : /** The main scanner function which does all the work.
696 : */
697 34067 : YY_DECL
698 : {
699 : yy_state_type yy_current_state;
700 : char *yy_cp, *yy_bp;
701 : int yy_act;
702 :
703 34067 : if ( !(yy_init) )
704 : {
705 190 : (yy_init) = 1;
706 :
707 : #ifdef YY_USER_INIT
708 : YY_USER_INIT;
709 : #endif
710 :
711 190 : if ( ! (yy_start) )
712 190 : (yy_start) = 1; /* first start state */
713 :
714 190 : if ( ! yyin )
715 0 : yyin = stdin;
716 :
717 190 : if ( ! yyout )
718 190 : yyout = stdout;
719 :
720 190 : if ( ! YY_CURRENT_BUFFER ) {
721 190 : yyensure_buffer_stack ();
722 380 : YY_CURRENT_BUFFER_LVALUE =
723 380 : yy_create_buffer( yyin, YY_BUF_SIZE );
724 : }
725 :
726 180 : yy_load_buffer_state( );
727 : }
728 :
729 : {
730 :
731 : while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */
732 : {
733 101296 : yy_cp = (yy_c_buf_p);
734 :
735 : /* Support of yytext. */
736 68590 : *yy_cp = (yy_hold_char);
737 :
738 : /* yy_bp points to the position in yy_ch_buf of the start of
739 : * the current run.
740 : */
741 68590 : yy_bp = yy_cp;
742 :
743 68590 : yy_current_state = (yy_start);
744 514247 : yy_match:
745 : do
746 : {
747 299402 : YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
748 299402 : if ( yy_accept[yy_current_state] )
749 : {
750 230622 : (yy_last_accepting_state) = yy_current_state;
751 230622 : (yy_last_accepting_cpos) = yy_cp;
752 : }
753 762710 : while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
754 : {
755 179664 : yy_current_state = (int) yy_def[yy_current_state];
756 179664 : if ( yy_current_state >= 46 )
757 159771 : yy_c = yy_meta[yy_c];
758 : }
759 299402 : yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
760 299402 : ++yy_cp;
761 : }
762 299402 : while ( yy_base[yy_current_state] != 57 );
763 :
764 68799 : yy_find_action:
765 68799 : yy_act = yy_accept[yy_current_state];
766 68799 : if ( yy_act == 0 )
767 : { /* have to back up */
768 19893 : yy_cp = (yy_last_accepting_cpos);
769 19893 : yy_current_state = (yy_last_accepting_state);
770 19893 : yy_act = yy_accept[yy_current_state];
771 : }
772 :
773 68799 : YY_DO_BEFORE_ACTION;
774 :
775 68837 : do_action: /* This label is used only to access EOF actions. */
776 :
777 68837 : switch ( yy_act )
778 : { /* beginning of action switch */
779 0 : case 0: /* must back up */
780 : /* undo the effects of YY_DO_BEFORE_ACTION */
781 0 : *yy_cp = (yy_hold_char);
782 0 : yy_cp = (yy_last_accepting_cpos);
783 0 : yy_current_state = (yy_last_accepting_state);
784 0 : goto yy_find_action;
785 :
786 0 : case 1:
787 : YY_RULE_SETUP
788 0 : { return ET; }
789 : YY_BREAK
790 180 : case 2:
791 : YY_RULE_SETUP
792 180 : { return ET; }
793 : YY_BREAK
794 874 : case 3:
795 : YY_RULE_SETUP
796 874 : { return EC; }
797 : YY_BREAK
798 6954 : case 4:
799 : YY_RULE_SETUP
800 6954 : { return EC; }
801 : YY_BREAK
802 437 : case 5:
803 : YY_RULE_SETUP
804 437 : { return PREFIX; }
805 : YY_BREAK
806 494 : case 6:
807 : YY_RULE_SETUP
808 494 : { return INDEX; }
809 : YY_BREAK
810 171 : case 7:
811 : YY_RULE_SETUP
812 171 : { return ID; }
813 : YY_BREAK
814 152 : case 8:
815 : YY_RULE_SETUP
816 152 : { return END; }
817 : YY_BREAK
818 494 : case 9:
819 : YY_RULE_SETUP
820 520 : { yylval.number = atoi(yytext); return NUMBER; }
821 : YY_BREAK
822 1368 : case 10:
823 : YY_RULE_SETUP
824 : ;
825 1368 : YY_BREAK
826 19872 : case 11:
827 : YY_RULE_SETUP
828 : ;
829 19872 : YY_BREAK
830 12103 : case 12:
831 : /* rule 12 can match eol */
832 : YY_RULE_SETUP
833 12103 : { lineno++; }
834 12103 : YY_BREAK
835 7999 : case 13:
836 : YY_RULE_SETUP
837 7999 : { return getstring(); }
838 : YY_BREAK
839 8436 : case 14:
840 : YY_RULE_SETUP
841 8436 : { yylval.string = strdup(yytext); return STRING; }
842 : YY_BREAK
843 7828 : case 15:
844 : YY_RULE_SETUP
845 7828 : { return *yytext; }
846 : YY_BREAK
847 0 : case 16:
848 : YY_RULE_SETUP
849 0 : ECHO;
850 0 : YY_BREAK
851 38 : case YY_STATE_EOF(INITIAL):
852 38 : yyterminate();
853 :
854 247 : case YY_END_OF_BUFFER:
855 : {
856 : /* Amount of text matched not including the EOB char. */
857 247 : int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
858 :
859 : /* Undo the effects of YY_DO_BEFORE_ACTION. */
860 247 : *yy_cp = (yy_hold_char);
861 : YY_RESTORE_YY_MORE_OFFSET
862 :
863 247 : if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
864 : {
865 : /* We're scanning a new file or input source. It's
866 : * possible that this happened because the user
867 : * just pointed yyin at a new source and called
868 : * yylex(). If so, then we have to assure
869 : * consistency between YY_CURRENT_BUFFER and our
870 : * globals. Here is the right place to do so, because
871 : * this is the first action (other than possibly a
872 : * back-up) that will match for the new input source.
873 : */
874 190 : (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
875 190 : YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
876 190 : YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
877 : }
878 :
879 : /* Note that here we test for yy_c_buf_p "<=" to the position
880 : * of the first EOB in the buffer, since yy_c_buf_p will
881 : * already have been incremented past the NUL character
882 : * (since all states make transitions on EOB to the
883 : * end-of-buffer state). Contrast this with the test
884 : * in input().
885 : */
886 247 : if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
887 : { /* This was really a NUL. */
888 : yy_state_type yy_next_state;
889 :
890 0 : (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
891 :
892 0 : yy_current_state = yy_get_previous_state( );
893 :
894 : /* Okay, we're now positioned to make the NUL
895 : * transition. We couldn't have
896 : * yy_get_previous_state() go ahead and do it
897 : * for us because it doesn't know how to deal
898 : * with the possibility of jamming (and we don't
899 : * want to build jamming into it because then it
900 : * will run more slowly).
901 : */
902 :
903 0 : yy_next_state = yy_try_NUL_trans( yy_current_state );
904 :
905 0 : yy_bp = (yytext_ptr) + YY_MORE_ADJ;
906 :
907 0 : if ( yy_next_state )
908 : {
909 : /* Consume the NUL. */
910 0 : yy_cp = ++(yy_c_buf_p);
911 0 : yy_current_state = yy_next_state;
912 0 : goto yy_match;
913 : }
914 :
915 : else
916 : {
917 0 : yy_cp = (yy_c_buf_p);
918 0 : goto yy_find_action;
919 : }
920 : }
921 :
922 247 : else switch ( yy_get_next_buffer( ) )
923 : {
924 38 : case EOB_ACT_END_OF_FILE:
925 : {
926 38 : (yy_did_buffer_switch_on_eof) = 0;
927 :
928 38 : if ( yywrap( ) )
929 : {
930 : /* Note: because we've taken care in
931 : * yy_get_next_buffer() to have set up
932 : * yytext, we can now set up
933 : * yy_c_buf_p so that if some total
934 : * hoser (like flex itself) wants to
935 : * call the scanner after we return the
936 : * YY_NULL, it'll still work - another
937 : * YY_NULL will get returned.
938 : */
939 38 : (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
940 :
941 38 : yy_act = YY_STATE_EOF(YY_START);
942 38 : goto do_action;
943 : }
944 :
945 : else
946 : {
947 0 : if ( ! (yy_did_buffer_switch_on_eof) )
948 0 : YY_NEW_FILE;
949 : }
950 0 : break;
951 : }
952 :
953 209 : case EOB_ACT_CONTINUE_SCAN:
954 209 : (yy_c_buf_p) =
955 209 : (yytext_ptr) + yy_amount_of_matched_text;
956 :
957 209 : yy_current_state = yy_get_previous_state( );
958 :
959 209 : yy_cp = (yy_c_buf_p);
960 209 : yy_bp = (yytext_ptr) + YY_MORE_ADJ;
961 209 : goto yy_match;
962 :
963 0 : case EOB_ACT_LAST_MATCH:
964 0 : (yy_c_buf_p) =
965 0 : &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
966 :
967 0 : yy_current_state = yy_get_previous_state( );
968 :
969 0 : yy_cp = (yy_c_buf_p);
970 0 : yy_bp = (yytext_ptr) + YY_MORE_ADJ;
971 0 : goto yy_find_action;
972 : }
973 0 : break;
974 : }
975 :
976 0 : default:
977 0 : YY_FATAL_ERROR(
978 : "fatal flex scanner internal error--no action found" );
979 : } /* end of action switch */
980 : } /* end of scanning one token */
981 : } /* end of user's declarations */
982 : } /* end of yylex */
983 :
984 : /* yy_get_next_buffer - try to read in a new buffer
985 : *
986 : * Returns a code representing an action:
987 : * EOB_ACT_LAST_MATCH -
988 : * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
989 : * EOB_ACT_END_OF_FILE - end of file
990 : */
991 247 : static int yy_get_next_buffer (void)
992 : {
993 247 : char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
994 247 : char *source = (yytext_ptr);
995 : int number_to_move, i;
996 : int ret_val;
997 :
998 247 : if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
999 0 : YY_FATAL_ERROR(
1000 : "fatal flex scanner internal error--end of buffer missed" );
1001 :
1002 247 : if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1003 : { /* Don't try to fill the buffer, so this is an EOF. */
1004 0 : if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
1005 : {
1006 : /* We matched a single character, the EOB, so
1007 : * treat this as a final EOF.
1008 : */
1009 0 : return EOB_ACT_END_OF_FILE;
1010 : }
1011 :
1012 : else
1013 : {
1014 : /* We matched some text prior to the EOB, first
1015 : * process it.
1016 : */
1017 0 : return EOB_ACT_LAST_MATCH;
1018 : }
1019 : }
1020 :
1021 : /* Try to read more data. */
1022 :
1023 : /* First move last chars to start of buffer. */
1024 247 : number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr) - 1);
1025 :
1026 570 : for ( i = 0; i < number_to_move; ++i )
1027 323 : *(dest++) = *(source++);
1028 :
1029 247 : if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1030 : /* don't do the read, it's not guaranteed to return an EOF,
1031 : * just force an EOF
1032 : */
1033 0 : YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1034 :
1035 : else
1036 : {
1037 247 : int num_to_read =
1038 247 : YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1039 :
1040 494 : while ( num_to_read <= 0 )
1041 : { /* Not enough room in the buffer - grow it. */
1042 :
1043 : /* just a shorter name for the current buffer */
1044 0 : YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
1045 :
1046 0 : int yy_c_buf_p_offset =
1047 0 : (int) ((yy_c_buf_p) - b->yy_ch_buf);
1048 :
1049 0 : if ( b->yy_is_our_buffer )
1050 : {
1051 0 : int new_size = b->yy_buf_size * 2;
1052 :
1053 0 : if ( new_size <= 0 )
1054 0 : b->yy_buf_size += b->yy_buf_size / 8;
1055 : else
1056 0 : b->yy_buf_size *= 2;
1057 :
1058 0 : b->yy_ch_buf = (char *)
1059 : /* Include room in for 2 EOB chars. */
1060 0 : yyrealloc( (void *) b->yy_ch_buf,
1061 0 : (yy_size_t) (b->yy_buf_size + 2) );
1062 : }
1063 : else
1064 : /* Can't grow it, we don't own it. */
1065 0 : b->yy_ch_buf = NULL;
1066 :
1067 0 : if ( ! b->yy_ch_buf )
1068 0 : YY_FATAL_ERROR(
1069 : "fatal error - scanner input buffer overflow" );
1070 :
1071 0 : (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
1072 :
1073 0 : num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1074 : number_to_move - 1;
1075 :
1076 : }
1077 :
1078 247 : if ( num_to_read > YY_READ_BUF_SIZE )
1079 247 : num_to_read = YY_READ_BUF_SIZE;
1080 :
1081 : /* Read in more data. */
1082 260 : YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1083 : (yy_n_chars), num_to_read );
1084 :
1085 247 : YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1086 : }
1087 :
1088 247 : if ( (yy_n_chars) == 0 )
1089 : {
1090 38 : if ( number_to_move == YY_MORE_ADJ )
1091 : {
1092 38 : ret_val = EOB_ACT_END_OF_FILE;
1093 38 : yyrestart( yyin );
1094 : }
1095 :
1096 : else
1097 : {
1098 0 : ret_val = EOB_ACT_LAST_MATCH;
1099 0 : YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1100 : YY_BUFFER_EOF_PENDING;
1101 : }
1102 : }
1103 :
1104 : else
1105 198 : ret_val = EOB_ACT_CONTINUE_SCAN;
1106 :
1107 247 : if (((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1108 : /* Extend the array by 50%, plus the number we really need. */
1109 0 : int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
1110 0 : YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc(
1111 0 : (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size );
1112 0 : if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1113 0 : YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1114 : /* "- 2" to take care of EOB's */
1115 0 : YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2);
1116 : }
1117 :
1118 247 : (yy_n_chars) += number_to_move;
1119 247 : YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
1120 247 : YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
1121 :
1122 247 : (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1123 :
1124 247 : return ret_val;
1125 : }
1126 :
1127 : /* yy_get_previous_state - get the state just before the EOB char was reached */
1128 :
1129 209 : static yy_state_type yy_get_previous_state (void)
1130 : {
1131 : yy_state_type yy_current_state;
1132 : char *yy_cp;
1133 :
1134 209 : yy_current_state = (yy_start);
1135 :
1136 532 : for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
1137 : {
1138 323 : YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1139 323 : if ( yy_accept[yy_current_state] )
1140 : {
1141 304 : (yy_last_accepting_state) = yy_current_state;
1142 304 : (yy_last_accepting_cpos) = yy_cp;
1143 : }
1144 933 : while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1145 : {
1146 304 : yy_current_state = (int) yy_def[yy_current_state];
1147 304 : if ( yy_current_state >= 46 )
1148 304 : yy_c = yy_meta[yy_c];
1149 : }
1150 323 : yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
1151 : }
1152 :
1153 209 : return yy_current_state;
1154 : }
1155 :
1156 : /* yy_try_NUL_trans - try to make a transition on the NUL character
1157 : *
1158 : * synopsis
1159 : * next_state = yy_try_NUL_trans( current_state );
1160 : */
1161 0 : static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
1162 : {
1163 : int yy_is_jam;
1164 0 : char *yy_cp = (yy_c_buf_p);
1165 :
1166 0 : YY_CHAR yy_c = 1;
1167 0 : if ( yy_accept[yy_current_state] )
1168 : {
1169 0 : (yy_last_accepting_state) = yy_current_state;
1170 0 : (yy_last_accepting_cpos) = yy_cp;
1171 : }
1172 0 : while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1173 : {
1174 0 : yy_current_state = (int) yy_def[yy_current_state];
1175 0 : if ( yy_current_state >= 46 )
1176 0 : yy_c = yy_meta[yy_c];
1177 : }
1178 0 : yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
1179 0 : yy_is_jam = (yy_current_state == 45);
1180 :
1181 0 : return yy_is_jam ? 0 : yy_current_state;
1182 : }
1183 :
1184 : #ifndef YY_NO_UNPUT
1185 :
1186 : #endif
1187 :
1188 : #ifndef YY_NO_INPUT
1189 : #ifdef __cplusplus
1190 : static int yyinput (void)
1191 : #else
1192 257412 : static int input (void)
1193 : #endif
1194 :
1195 : {
1196 : int c;
1197 :
1198 257412 : *(yy_c_buf_p) = (yy_hold_char);
1199 :
1200 257412 : if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
1201 : {
1202 : /* yy_c_buf_p now points to the character we want to return.
1203 : * If this occurs *before* the EOB characters, then it's a
1204 : * valid NUL; if not, then we've hit the end of the buffer.
1205 : */
1206 0 : if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1207 : /* This was really a NUL. */
1208 0 : *(yy_c_buf_p) = '\0';
1209 :
1210 : else
1211 : { /* need more input */
1212 0 : int offset = (int) ((yy_c_buf_p) - (yytext_ptr));
1213 0 : ++(yy_c_buf_p);
1214 :
1215 0 : switch ( yy_get_next_buffer( ) )
1216 : {
1217 0 : case EOB_ACT_LAST_MATCH:
1218 : /* This happens because yy_g_n_b()
1219 : * sees that we've accumulated a
1220 : * token and flags that we need to
1221 : * try matching the token before
1222 : * proceeding. But for input(),
1223 : * there's no matching to consider.
1224 : * So convert the EOB_ACT_LAST_MATCH
1225 : * to EOB_ACT_END_OF_FILE.
1226 : */
1227 :
1228 : /* Reset buffer status. */
1229 0 : yyrestart( yyin );
1230 :
1231 : /*FALLTHROUGH*/
1232 :
1233 0 : case EOB_ACT_END_OF_FILE:
1234 : {
1235 0 : if ( yywrap( ) )
1236 0 : return 0;
1237 :
1238 0 : if ( ! (yy_did_buffer_switch_on_eof) )
1239 0 : YY_NEW_FILE;
1240 : #ifdef __cplusplus
1241 : return yyinput();
1242 : #else
1243 0 : return input();
1244 : #endif
1245 : }
1246 :
1247 0 : case EOB_ACT_CONTINUE_SCAN:
1248 0 : (yy_c_buf_p) = (yytext_ptr) + offset;
1249 0 : break;
1250 : }
1251 : }
1252 : }
1253 :
1254 257412 : c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
1255 257412 : *(yy_c_buf_p) = '\0'; /* preserve yytext */
1256 257412 : (yy_hold_char) = *++(yy_c_buf_p);
1257 :
1258 257412 : return c;
1259 : }
1260 : #endif /* ifndef YY_NO_INPUT */
1261 :
1262 : /** Immediately switch to a different input stream.
1263 : * @param input_file A readable stream.
1264 : *
1265 : * @note This function does not reset the start condition to @c INITIAL .
1266 : */
1267 38 : void yyrestart (FILE * input_file )
1268 : {
1269 :
1270 38 : if ( ! YY_CURRENT_BUFFER ){
1271 0 : yyensure_buffer_stack ();
1272 0 : YY_CURRENT_BUFFER_LVALUE =
1273 0 : yy_create_buffer( yyin, YY_BUF_SIZE );
1274 : }
1275 :
1276 38 : yy_init_buffer( YY_CURRENT_BUFFER, input_file );
1277 36 : yy_load_buffer_state( );
1278 38 : }
1279 :
1280 : /** Switch to a different input buffer.
1281 : * @param new_buffer The new input buffer.
1282 : *
1283 : */
1284 0 : void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer )
1285 : {
1286 :
1287 : /* TODO. We should be able to replace this entire function body
1288 : * with
1289 : * yypop_buffer_state();
1290 : * yypush_buffer_state(new_buffer);
1291 : */
1292 0 : yyensure_buffer_stack ();
1293 0 : if ( YY_CURRENT_BUFFER == new_buffer )
1294 0 : return;
1295 :
1296 0 : if ( YY_CURRENT_BUFFER )
1297 : {
1298 : /* Flush out information for old buffer. */
1299 0 : *(yy_c_buf_p) = (yy_hold_char);
1300 0 : YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1301 0 : YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1302 : }
1303 :
1304 0 : YY_CURRENT_BUFFER_LVALUE = new_buffer;
1305 0 : yy_load_buffer_state( );
1306 :
1307 : /* We don't actually know whether we did this switch during
1308 : * EOF (yywrap()) processing, but the only time this flag
1309 : * is looked at is after yywrap() is called, so it's safe
1310 : * to go ahead and always set it.
1311 : */
1312 0 : (yy_did_buffer_switch_on_eof) = 1;
1313 : }
1314 :
1315 252 : static void yy_load_buffer_state (void)
1316 : {
1317 266 : (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1318 266 : (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1319 266 : yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1320 266 : (yy_hold_char) = *(yy_c_buf_p);
1321 252 : }
1322 :
1323 : /** Allocate and initialize an input buffer state.
1324 : * @param file A readable stream.
1325 : * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
1326 : *
1327 : * @return the allocated buffer state.
1328 : */
1329 190 : YY_BUFFER_STATE yy_create_buffer (FILE * file, int size )
1330 : {
1331 : YY_BUFFER_STATE b;
1332 :
1333 190 : b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) );
1334 190 : if ( ! b )
1335 0 : YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1336 :
1337 190 : b->yy_buf_size = size;
1338 :
1339 : /* yy_ch_buf has to be 2 characters longer than the size given because
1340 : * we need to put in 2 end-of-buffer characters.
1341 : */
1342 190 : b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) );
1343 190 : if ( ! b->yy_ch_buf )
1344 0 : YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1345 :
1346 190 : b->yy_is_our_buffer = 1;
1347 :
1348 190 : yy_init_buffer( b, file );
1349 :
1350 190 : return b;
1351 : }
1352 :
1353 : /** Destroy the buffer.
1354 : * @param b a buffer created with yy_create_buffer()
1355 : *
1356 : */
1357 0 : void yy_delete_buffer (YY_BUFFER_STATE b )
1358 : {
1359 :
1360 0 : if ( ! b )
1361 0 : return;
1362 :
1363 0 : if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
1364 0 : YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
1365 :
1366 0 : if ( b->yy_is_our_buffer )
1367 0 : yyfree( (void *) b->yy_ch_buf );
1368 :
1369 0 : yyfree( (void *) b );
1370 : }
1371 :
1372 : /* Initializes or reinitializes a buffer.
1373 : * This function is sometimes called more than once on the same buffer,
1374 : * such as during a yyrestart() or at EOF.
1375 : */
1376 228 : static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file )
1377 :
1378 : {
1379 228 : int oerrno = errno;
1380 :
1381 228 : yy_flush_buffer( b );
1382 :
1383 228 : b->yy_input_file = file;
1384 228 : b->yy_fill_buffer = 1;
1385 :
1386 : /* If b is the current buffer, then yy_init_buffer was _probably_
1387 : * called from yyrestart() or through yy_get_next_buffer.
1388 : * In that case, we don't want to reset the lineno or column.
1389 : */
1390 228 : if (b != YY_CURRENT_BUFFER){
1391 190 : b->yy_bs_lineno = 1;
1392 190 : b->yy_bs_column = 0;
1393 : }
1394 :
1395 228 : b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1396 :
1397 228 : errno = oerrno;
1398 228 : }
1399 :
1400 : /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
1401 : * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
1402 : *
1403 : */
1404 228 : void yy_flush_buffer (YY_BUFFER_STATE b )
1405 : {
1406 228 : if ( ! b )
1407 0 : return;
1408 :
1409 228 : b->yy_n_chars = 0;
1410 :
1411 : /* We always need two end-of-buffer characters. The first causes
1412 : * a transition to the end-of-buffer state. The second causes
1413 : * a jam in that state.
1414 : */
1415 228 : b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1416 228 : b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1417 :
1418 228 : b->yy_buf_pos = &b->yy_ch_buf[0];
1419 :
1420 228 : b->yy_at_bol = 1;
1421 228 : b->yy_buffer_status = YY_BUFFER_NEW;
1422 :
1423 228 : if ( b == YY_CURRENT_BUFFER )
1424 36 : yy_load_buffer_state( );
1425 : }
1426 :
1427 : /** Pushes the new state onto the stack. The new state becomes
1428 : * the current state. This function will allocate the stack
1429 : * if necessary.
1430 : * @param new_buffer The new state.
1431 : *
1432 : */
1433 0 : void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
1434 : {
1435 0 : if (new_buffer == NULL)
1436 0 : return;
1437 :
1438 0 : yyensure_buffer_stack();
1439 :
1440 : /* This block is copied from yy_switch_to_buffer. */
1441 0 : if ( YY_CURRENT_BUFFER )
1442 : {
1443 : /* Flush out information for old buffer. */
1444 0 : *(yy_c_buf_p) = (yy_hold_char);
1445 0 : YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1446 0 : YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1447 : }
1448 :
1449 : /* Only push if top exists. Otherwise, replace top. */
1450 0 : if (YY_CURRENT_BUFFER)
1451 0 : (yy_buffer_stack_top)++;
1452 0 : YY_CURRENT_BUFFER_LVALUE = new_buffer;
1453 :
1454 : /* copied from yy_switch_to_buffer. */
1455 0 : yy_load_buffer_state( );
1456 0 : (yy_did_buffer_switch_on_eof) = 1;
1457 : }
1458 :
1459 : /** Removes and deletes the top of the stack, if present.
1460 : * The next element becomes the new top.
1461 : *
1462 : */
1463 0 : void yypop_buffer_state (void)
1464 : {
1465 0 : if (!YY_CURRENT_BUFFER)
1466 0 : return;
1467 :
1468 0 : yy_delete_buffer(YY_CURRENT_BUFFER );
1469 0 : YY_CURRENT_BUFFER_LVALUE = NULL;
1470 0 : if ((yy_buffer_stack_top) > 0)
1471 0 : --(yy_buffer_stack_top);
1472 :
1473 0 : if (YY_CURRENT_BUFFER) {
1474 0 : yy_load_buffer_state( );
1475 0 : (yy_did_buffer_switch_on_eof) = 1;
1476 : }
1477 : }
1478 :
1479 : /* Allocates the stack if it does not exist.
1480 : * Guarantees space for at least one push.
1481 : */
1482 190 : static void yyensure_buffer_stack (void)
1483 : {
1484 : yy_size_t num_to_alloc;
1485 :
1486 190 : if (!(yy_buffer_stack)) {
1487 :
1488 : /* First allocation is just for 2 elements, since we don't know if this
1489 : * scanner will even need a stack. We use 2 instead of 1 to avoid an
1490 : * immediate realloc on the next call.
1491 : */
1492 190 : num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */
1493 190 : (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
1494 : (num_to_alloc * sizeof(struct yy_buffer_state*)
1495 : );
1496 190 : if ( ! (yy_buffer_stack) )
1497 0 : YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
1498 :
1499 200 : memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
1500 :
1501 190 : (yy_buffer_stack_max) = num_to_alloc;
1502 190 : (yy_buffer_stack_top) = 0;
1503 190 : return;
1504 : }
1505 :
1506 0 : if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
1507 :
1508 : /* Increase the buffer to prepare for a possible push. */
1509 0 : yy_size_t grow_size = 8 /* arbitrary grow size */;
1510 :
1511 0 : num_to_alloc = (yy_buffer_stack_max) + grow_size;
1512 0 : (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
1513 : ((yy_buffer_stack),
1514 : num_to_alloc * sizeof(struct yy_buffer_state*)
1515 : );
1516 0 : if ( ! (yy_buffer_stack) )
1517 0 : YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
1518 :
1519 : /* zero only the new slots.*/
1520 0 : memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
1521 0 : (yy_buffer_stack_max) = num_to_alloc;
1522 : }
1523 : }
1524 :
1525 : /** Setup the input buffer state to scan directly from a user-specified character buffer.
1526 : * @param base the character buffer
1527 : * @param size the size in bytes of the character buffer
1528 : *
1529 : * @return the newly allocated buffer state object.
1530 : */
1531 0 : YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size )
1532 : {
1533 : YY_BUFFER_STATE b;
1534 :
1535 0 : if ( size < 2 ||
1536 0 : base[size-2] != YY_END_OF_BUFFER_CHAR ||
1537 0 : base[size-1] != YY_END_OF_BUFFER_CHAR )
1538 : /* They forgot to leave room for the EOB's. */
1539 0 : return NULL;
1540 :
1541 0 : b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) );
1542 0 : if ( ! b )
1543 0 : YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
1544 :
1545 0 : b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */
1546 0 : b->yy_buf_pos = b->yy_ch_buf = base;
1547 0 : b->yy_is_our_buffer = 0;
1548 0 : b->yy_input_file = NULL;
1549 0 : b->yy_n_chars = b->yy_buf_size;
1550 0 : b->yy_is_interactive = 0;
1551 0 : b->yy_at_bol = 1;
1552 0 : b->yy_fill_buffer = 0;
1553 0 : b->yy_buffer_status = YY_BUFFER_NEW;
1554 :
1555 0 : yy_switch_to_buffer( b );
1556 :
1557 0 : return b;
1558 : }
1559 :
1560 : /** Setup the input buffer state to scan a string. The next call to yylex() will
1561 : * scan from a @e copy of @a str.
1562 : * @param yystr a NUL-terminated string to scan
1563 : *
1564 : * @return the newly allocated buffer state object.
1565 : * @note If you want to scan bytes that may contain NUL values, then use
1566 : * yy_scan_bytes() instead.
1567 : */
1568 0 : YY_BUFFER_STATE yy_scan_string (const char * yystr )
1569 : {
1570 :
1571 0 : return yy_scan_bytes( yystr, (int) strlen(yystr) );
1572 : }
1573 :
1574 : /** Setup the input buffer state to scan the given bytes. The next call to yylex() will
1575 : * scan from a @e copy of @a bytes.
1576 : * @param yybytes the byte buffer to scan
1577 : * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
1578 : *
1579 : * @return the newly allocated buffer state object.
1580 : */
1581 0 : YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len )
1582 : {
1583 : YY_BUFFER_STATE b;
1584 : char *buf;
1585 : yy_size_t n;
1586 : int i;
1587 :
1588 : /* Get memory for full buffer, including space for trailing EOB's. */
1589 0 : n = (yy_size_t) (_yybytes_len + 2);
1590 0 : buf = (char *) yyalloc( n );
1591 0 : if ( ! buf )
1592 0 : YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
1593 :
1594 0 : for ( i = 0; i < _yybytes_len; ++i )
1595 0 : buf[i] = yybytes[i];
1596 :
1597 0 : buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
1598 :
1599 0 : b = yy_scan_buffer( buf, n );
1600 0 : if ( ! b )
1601 0 : YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
1602 :
1603 : /* It's okay to grow etc. this buffer, and we should throw it
1604 : * away when we're done.
1605 : */
1606 0 : b->yy_is_our_buffer = 1;
1607 :
1608 0 : return b;
1609 : }
1610 :
1611 : #ifndef YY_EXIT_FAILURE
1612 : #define YY_EXIT_FAILURE 2
1613 : #endif
1614 :
1615 0 : static void yynoreturn yy_fatal_error (const char* msg )
1616 : {
1617 0 : fprintf( stderr, "%s\n", msg );
1618 0 : exit( YY_EXIT_FAILURE );
1619 : }
1620 :
1621 : /* Redefine yyless() so it works in section 3 code. */
1622 :
1623 : #undef yyless
1624 : #define yyless(n) \
1625 : do \
1626 : { \
1627 : /* Undo effects of setting up yytext. */ \
1628 : int yyless_macro_arg = (n); \
1629 : YY_LESS_LINENO(yyless_macro_arg);\
1630 : yytext[yyleng] = (yy_hold_char); \
1631 : (yy_c_buf_p) = yytext + yyless_macro_arg; \
1632 : (yy_hold_char) = *(yy_c_buf_p); \
1633 : *(yy_c_buf_p) = '\0'; \
1634 : yyleng = yyless_macro_arg; \
1635 : } \
1636 : while ( 0 )
1637 :
1638 : /* Accessor methods (get/set functions) to struct members. */
1639 :
1640 : /** Get the current line number.
1641 : *
1642 : */
1643 0 : int yyget_lineno (void)
1644 : {
1645 :
1646 0 : return yylineno;
1647 : }
1648 :
1649 : /** Get the input stream.
1650 : *
1651 : */
1652 0 : FILE *yyget_in (void)
1653 : {
1654 0 : return yyin;
1655 : }
1656 :
1657 : /** Get the output stream.
1658 : *
1659 : */
1660 0 : FILE *yyget_out (void)
1661 : {
1662 0 : return yyout;
1663 : }
1664 :
1665 : /** Get the length of the current token.
1666 : *
1667 : */
1668 0 : int yyget_leng (void)
1669 : {
1670 0 : return yyleng;
1671 : }
1672 :
1673 : /** Get the current token.
1674 : *
1675 : */
1676 :
1677 0 : char *yyget_text (void)
1678 : {
1679 0 : return yytext;
1680 : }
1681 :
1682 : /** Set the current line number.
1683 : * @param _line_number line number
1684 : *
1685 : */
1686 0 : void yyset_lineno (int _line_number )
1687 : {
1688 :
1689 0 : yylineno = _line_number;
1690 0 : }
1691 :
1692 : /** Set the input stream. This does not discard the current
1693 : * input buffer.
1694 : * @param _in_str A readable stream.
1695 : *
1696 : * @see yy_switch_to_buffer
1697 : */
1698 0 : void yyset_in (FILE * _in_str )
1699 : {
1700 0 : yyin = _in_str ;
1701 0 : }
1702 :
1703 0 : void yyset_out (FILE * _out_str )
1704 : {
1705 0 : yyout = _out_str ;
1706 0 : }
1707 :
1708 0 : int yyget_debug (void)
1709 : {
1710 0 : return yy_flex_debug;
1711 : }
1712 :
1713 0 : void yyset_debug (int _bdebug )
1714 : {
1715 0 : yy_flex_debug = _bdebug ;
1716 0 : }
1717 :
1718 0 : static int yy_init_globals (void)
1719 : {
1720 : /* Initialization is the same as for the non-reentrant scanner.
1721 : * This function is called from yylex_destroy(), so don't allocate here.
1722 : */
1723 :
1724 0 : (yy_buffer_stack) = NULL;
1725 0 : (yy_buffer_stack_top) = 0;
1726 0 : (yy_buffer_stack_max) = 0;
1727 0 : (yy_c_buf_p) = NULL;
1728 0 : (yy_init) = 0;
1729 0 : (yy_start) = 0;
1730 :
1731 : /* Defined in main.c */
1732 : #ifdef YY_STDINIT
1733 : yyin = stdin;
1734 : yyout = stdout;
1735 : #else
1736 0 : yyin = NULL;
1737 0 : yyout = NULL;
1738 : #endif
1739 :
1740 : /* For future reference: Set errno on error, since we are called by
1741 : * yylex_init()
1742 : */
1743 0 : return 0;
1744 : }
1745 :
1746 : /* yylex_destroy is for both reentrant and non-reentrant scanners. */
1747 0 : int yylex_destroy (void)
1748 : {
1749 :
1750 : /* Pop the buffer stack, destroying each element. */
1751 0 : while(YY_CURRENT_BUFFER){
1752 0 : yy_delete_buffer( YY_CURRENT_BUFFER );
1753 0 : YY_CURRENT_BUFFER_LVALUE = NULL;
1754 0 : yypop_buffer_state();
1755 : }
1756 :
1757 : /* Destroy the stack itself. */
1758 0 : yyfree((yy_buffer_stack) );
1759 0 : (yy_buffer_stack) = NULL;
1760 :
1761 : /* Reset the globals. This is important in a non-reentrant scanner so the next time
1762 : * yylex() is called, initialization will occur. */
1763 0 : yy_init_globals( );
1764 :
1765 0 : return 0;
1766 : }
1767 :
1768 : /*
1769 : * Internal utility routines.
1770 : */
1771 :
1772 : #ifndef yytext_ptr
1773 : static void yy_flex_strncpy (char* s1, const char * s2, int n )
1774 : {
1775 :
1776 : int i;
1777 : for ( i = 0; i < n; ++i )
1778 : s1[i] = s2[i];
1779 : }
1780 : #endif
1781 :
1782 : #ifdef YY_NEED_STRLEN
1783 : static int yy_flex_strlen (const char * s )
1784 : {
1785 : int n;
1786 : for ( n = 0; s[n]; ++n )
1787 : ;
1788 :
1789 : return n;
1790 : }
1791 : #endif
1792 :
1793 570 : void *yyalloc (yy_size_t size )
1794 : {
1795 570 : return malloc(size);
1796 : }
1797 :
1798 0 : void *yyrealloc (void * ptr, yy_size_t size )
1799 : {
1800 :
1801 : /* The cast to (char *) in the following accommodates both
1802 : * implementations that use char* generic pointers, and those
1803 : * that use void* generic pointers. It works with the latter
1804 : * because both ANSI C and C++ allow castless assignment from
1805 : * any pointer type to void*, and deal with argument conversions
1806 : * as though doing an assignment.
1807 : */
1808 0 : return realloc(ptr, size);
1809 : }
1810 :
1811 0 : void yyfree (void * ptr )
1812 : {
1813 0 : free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
1814 0 : }
1815 :
1816 : #define YYTABLES_NAME "yytables"
1817 :
1818 : #ifndef yywrap /* XXX */
1819 : int
1820 38 : yywrap ()
1821 : {
1822 38 : return 1;
1823 : }
1824 : #endif
1825 :
1826 : static int
1827 7999 : getstring(void)
1828 : {
1829 : char x[128];
1830 7999 : int i = 0;
1831 : int c;
1832 7999 : int quote = 0;
1833 265411 : while(i < sizeof(x) - 1 && (c = input()) != EOF){
1834 257412 : if(quote) {
1835 19 : x[i++] = c;
1836 19 : quote = 0;
1837 19 : continue;
1838 : }
1839 257393 : if(c == '\n'){
1840 0 : _lex_error_message("unterminated string");
1841 0 : lineno++;
1842 0 : break;
1843 : }
1844 257393 : if(c == '\\'){
1845 19 : quote++;
1846 19 : continue;
1847 : }
1848 257374 : if(c == '\"')
1849 7578 : break;
1850 249375 : x[i++] = c;
1851 : }
1852 7999 : x[i] = '\0';
1853 7999 : yylval.string = strdup(x);
1854 7999 : if (yylval.string == NULL)
1855 0 : err(1, "malloc");
1856 7999 : return STRING;
1857 : }
1858 :
1859 : void
1860 0 : _lex_error_message (const char *format, ...)
1861 : {
1862 : va_list args;
1863 :
1864 0 : va_start (args, format);
1865 0 : fprintf (stderr, "%s:%d:", filename, lineno);
1866 0 : vfprintf (stderr, format, args);
1867 0 : va_end (args);
1868 0 : numerror++;
1869 0 : }
1870 :
|