/* */
This source file includes following definitions.
- yy_get_next_buffer
- yy_get_previous_state
- yy_try_NUL_trans
- yyunput
- yyinput
- c_restart
- c__switch_to_buffer
- c__load_buffer_state
- c__create_buffer
- c__delete_buffer
- c__init_buffer
- c__flush_buffer
- c_push_buffer_state
- c_pop_buffer_state
- c_ensure_buffer_stack
- c__scan_buffer
- c__scan_string
- c__scan_bytes
- yy_push_state
- yy_pop_state
- yy_fatal_error
- c_get_lineno
- c_get_in
- c_get_out
- c_get_leng
- c_get_text
- c_set_lineno
- c_set_in
- c_set_out
- c_get_debug
- c_set_debug
- yy_init_globals
- c_lex_destroy
- yy_flex_strncpy
- yy_flex_strlen
- c_alloc
- c_realloc
- c_free
- c_parser_init
- yacc_parser_init
1 #line 2 "c.c"
2
3 #line 4 "c.c"
4
5 #define YY_INT_ALIGNED short int
6
7 /* A lexical scanner generated by flex */
8
9 #define yy_create_buffer c__create_buffer
10 #define yy_delete_buffer c__delete_buffer
11 #define yy_flex_debug c__flex_debug
12 #define yy_init_buffer c__init_buffer
13 #define yy_flush_buffer c__flush_buffer
14 #define yy_load_buffer_state c__load_buffer_state
15 #define yy_switch_to_buffer c__switch_to_buffer
16 #define yyin c_in
17 #define yyleng c_leng
18 #define yylex c_lex
19 #define yylineno c_lineno
20 #define yyout c_out
21 #define yyrestart c_restart
22 #define yytext c_text
23 #define yywrap c_wrap
24 #define yyalloc c_alloc
25 #define yyrealloc c_realloc
26 #define yyfree c_free
27
28 #define FLEX_SCANNER
29 #define YY_FLEX_MAJOR_VERSION 2
30 #define YY_FLEX_MINOR_VERSION 5
31 #define YY_FLEX_SUBMINOR_VERSION 35
32 #if YY_FLEX_SUBMINOR_VERSION > 0
33 #define FLEX_BETA
34 #endif
35
36 /* First, we deal with platform-specific or compiler-specific issues. */
37
38 /* begin standard C headers. */
39 #include <stdio.h>
40 #include <string.h>
41 #include <errno.h>
42 #include <stdlib.h>
43
44 /* end standard C headers. */
45
46 /* flex integer type definitions */
47
48 #ifndef FLEXINT_H
49 #define FLEXINT_H
50
51 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
52
53 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
54
55 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
56 * if you want the limit (max/min) macros for int types.
57 */
58 #ifndef __STDC_LIMIT_MACROS
59 #define __STDC_LIMIT_MACROS 1
60 #endif
61
62 #include <inttypes.h>
63 typedef int8_t flex_int8_t;
64 typedef uint8_t flex_uint8_t;
65 typedef int16_t flex_int16_t;
66 typedef uint16_t flex_uint16_t;
67 typedef int32_t flex_int32_t;
68 typedef uint32_t flex_uint32_t;
69 #else
70 typedef signed char flex_int8_t;
71 typedef short int flex_int16_t;
72 typedef int flex_int32_t;
73 typedef unsigned char flex_uint8_t;
74 typedef unsigned short int flex_uint16_t;
75 typedef unsigned int flex_uint32_t;
76 #endif /* ! C99 */
77
78 /* Limits of integral types. */
79 #ifndef INT8_MIN
80 #define INT8_MIN (-128)
81 #endif
82 #ifndef INT16_MIN
83 #define INT16_MIN (-32767-1)
84 #endif
85 #ifndef INT32_MIN
86 #define INT32_MIN (-2147483647-1)
87 #endif
88 #ifndef INT8_MAX
89 #define INT8_MAX (127)
90 #endif
91 #ifndef INT16_MAX
92 #define INT16_MAX (32767)
93 #endif
94 #ifndef INT32_MAX
95 #define INT32_MAX (2147483647)
96 #endif
97 #ifndef UINT8_MAX
98 #define UINT8_MAX (255U)
99 #endif
100 #ifndef UINT16_MAX
101 #define UINT16_MAX (65535U)
102 #endif
103 #ifndef UINT32_MAX
104 #define UINT32_MAX (4294967295U)
105 #endif
106
107 #endif /* ! FLEXINT_H */
108
109 #ifdef __cplusplus
110
111 /* The "const" storage-class-modifier is valid. */
112 #define YY_USE_CONST
113
114 #else /* ! __cplusplus */
115
116 /* C99 requires __STDC__ to be defined as 1. */
117 #if defined (__STDC__)
118
119 #define YY_USE_CONST
120
121 #endif /* defined (__STDC__) */
122 #endif /* ! __cplusplus */
123
124 #ifdef YY_USE_CONST
125 #define yyconst const
126 #else
127 #define yyconst
128 #endif
129
130 /* Returned upon end-of-file. */
131 #define YY_NULL 0
132
133 /* Promotes a possibly negative, possibly signed char to an unsigned
134 * integer for use as an array index. If the signed char is negative,
135 * we want to instead treat it as an 8-bit unsigned char, hence the
136 * double cast.
137 */
138 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
139
140 /* Enter a start condition. This macro really ought to take a parameter,
141 * but we do it the disgusting crufty way forced on us by the ()-less
142 * definition of BEGIN.
143 */
144 #define BEGIN (yy_start) = 1 + 2 *
145
146 /* Translate the current start state into a value that can be later handed
147 * to BEGIN to return to the state. The YYSTATE alias is for lex
148 * compatibility.
149 */
150 #define YY_START (((yy_start) - 1) / 2)
151 #define YYSTATE YY_START
152
153 /* Action number for EOF rule of a given start state. */
154 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
155
156 /* Special action meaning "start processing a new file". */
157 #define YY_NEW_FILE c_restart(c_in )
158
159 #define YY_END_OF_BUFFER_CHAR 0
160
161 /* Size of default input buffer. */
162 #ifndef YY_BUF_SIZE
163 #define YY_BUF_SIZE 16384
164 #endif
165
166 /* The state buf must be large enough to hold one state per character in the main buffer.
167 */
168 #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
169
170 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
171 #define YY_TYPEDEF_YY_BUFFER_STATE
172 typedef struct yy_buffer_state *YY_BUFFER_STATE;
173 #endif
174
175 extern int c_leng;
176
177 extern FILE *c_in, *c_out;
178
179 #define EOB_ACT_CONTINUE_SCAN 0
180 #define EOB_ACT_END_OF_FILE 1
181 #define EOB_ACT_LAST_MATCH 2
182
183 #define YY_LESS_LINENO(n)
184
185 /* Return all but the first "n" matched characters back to the input stream. */
186 #define yyless(n) \
187 do \
188 { \
189 /* Undo effects of setting up c_text. */ \
190 int yyless_macro_arg = (n); \
191 YY_LESS_LINENO(yyless_macro_arg);\
192 *yy_cp = (yy_hold_char); \
193 YY_RESTORE_YY_MORE_OFFSET \
194 (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
195 YY_DO_BEFORE_ACTION; /* set up c_text again */ \
196 } \
197 while ( 0 )
198
199 #define unput(c) yyunput( c, (yytext_ptr) )
200
201 #ifndef YY_TYPEDEF_YY_SIZE_T
202 #define YY_TYPEDEF_YY_SIZE_T
203 typedef size_t yy_size_t;
204 #endif
205
206 #ifndef YY_STRUCT_YY_BUFFER_STATE
207 #define YY_STRUCT_YY_BUFFER_STATE
208 struct yy_buffer_state
209 {
210 FILE *yy_input_file;
211
212 char *yy_ch_buf; /* input buffer */
213 char *yy_buf_pos; /* current position in input buffer */
214
215 /* Size of input buffer in bytes, not including room for EOB
216 * characters.
217 */
218 yy_size_t yy_buf_size;
219
220 /* Number of characters read into yy_ch_buf, not including EOB
221 * characters.
222 */
223 int yy_n_chars;
224
225 /* Whether we "own" the buffer - i.e., we know we created it,
226 * and can realloc() it to grow it, and should free() it to
227 * delete it.
228 */
229 int yy_is_our_buffer;
230
231 /* Whether this is an "interactive" input source; if so, and
232 * if we're using stdio for input, then we want to use getc()
233 * instead of fread(), to make sure we stop fetching input after
234 * each newline.
235 */
236 int yy_is_interactive;
237
238 /* Whether we're considered to be at the beginning of a line.
239 * If so, '^' rules will be active on the next match, otherwise
240 * not.
241 */
242 int yy_at_bol;
243
244 int yy_bs_lineno; /**< The line count. */
245 int yy_bs_column; /**< The column count. */
246
247 /* Whether to try to fill the input buffer when we reach the
248 * end of it.
249 */
250 int yy_fill_buffer;
251
252 int yy_buffer_status;
253
254 #define YY_BUFFER_NEW 0
255 #define YY_BUFFER_NORMAL 1
256 /* When an EOF's been seen but there's still some text to process
257 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
258 * shouldn't try reading from the input source any more. We might
259 * still have a bunch of tokens to match, though, because of
260 * possible backing-up.
261 *
262 * When we actually see the EOF, we change the status to "new"
263 * (via c_restart()), so that the user can continue scanning by
264 * just pointing c_in at a new input file.
265 */
266 #define YY_BUFFER_EOF_PENDING 2
267
268 };
269 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
270
271 /* Stack of input buffers. */
272 static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
273 static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
274 static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
275
276 /* We provide macros for accessing buffer states in case in the
277 * future we want to put the buffer states in a more general
278 * "scanner state".
279 *
280 * Returns the top of the stack, or NULL.
281 */
282 #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
283 ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
284 : NULL)
285
286 /* Same as previous macro, but useful when we know that the buffer stack is not
287 * NULL or when we need an lvalue. For internal use only.
288 */
289 #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
290
291 /* yy_hold_char holds the character lost when c_text is formed. */
292 static char yy_hold_char;
293 static int yy_n_chars; /* number of characters read into yy_ch_buf */
294 int c_leng;
295
296 /* Points to current character in buffer. */
297 static char *yy_c_buf_p = (char *) 0;
298 static int yy_init = 0; /* whether we need to initialize */
299 static int yy_start = 0; /* start state number */
300
301 /* Flag which is used to allow c_wrap()'s to do buffer switches
302 * instead of setting up a fresh c_in. A bit of a hack ...
303 */
304 static int yy_did_buffer_switch_on_eof;
305
306 void c_restart (FILE *input_file );
307 void c__switch_to_buffer (YY_BUFFER_STATE new_buffer );
308 YY_BUFFER_STATE c__create_buffer (FILE *file,int size );
309 void c__delete_buffer (YY_BUFFER_STATE b );
310 void c__flush_buffer (YY_BUFFER_STATE b );
311 void c_push_buffer_state (YY_BUFFER_STATE new_buffer );
312 void c_pop_buffer_state (void );
313
314 static void c_ensure_buffer_stack (void );
315 static void c__load_buffer_state (void );
316 static void c__init_buffer (YY_BUFFER_STATE b,FILE *file );
317
318 #define YY_FLUSH_BUFFER c__flush_buffer(YY_CURRENT_BUFFER )
319
320 YY_BUFFER_STATE c__scan_buffer (char *base,yy_size_t size );
321 YY_BUFFER_STATE c__scan_string (yyconst char *yy_str );
322 YY_BUFFER_STATE c__scan_bytes (yyconst char *bytes,int len );
323
324 void *c_alloc (yy_size_t );
325 void *c_realloc (void *,yy_size_t );
326 void c_free (void * );
327
328 #define yy_new_buffer c__create_buffer
329
330 #define yy_set_interactive(is_interactive) \
331 { \
332 if ( ! YY_CURRENT_BUFFER ){ \
333 c_ensure_buffer_stack (); \
334 YY_CURRENT_BUFFER_LVALUE = \
335 c__create_buffer(c_in,YY_BUF_SIZE ); \
336 } \
337 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
338 }
339
340 #define yy_set_bol(at_bol) \
341 { \
342 if ( ! YY_CURRENT_BUFFER ){\
343 c_ensure_buffer_stack (); \
344 YY_CURRENT_BUFFER_LVALUE = \
345 c__create_buffer(c_in,YY_BUF_SIZE ); \
346 } \
347 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
348 }
349
350 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
351
352 /* Begin user sect3 */
353
354 #define c_wrap(n) 1
355 #define YY_SKIP_YYWRAP
356
357 typedef unsigned char YY_CHAR;
358
359 FILE *c_in = (FILE *) 0, *c_out = (FILE *) 0;
360
361 typedef int yy_state_type;
362
363 extern int c_lineno;
364
365 int c_lineno = 1;
366
367 extern char *c_text;
368 #define yytext_ptr c_text
369
370 static yy_state_type yy_get_previous_state (void );
371 static yy_state_type yy_try_NUL_trans (yy_state_type current_state );
372 static int yy_get_next_buffer (void );
373 static void yy_fatal_error (yyconst char msg[] );
374
375 /* Done after the current pattern has been matched and before the
376 * corresponding action - sets up c_text.
377 */
378 #define YY_DO_BEFORE_ACTION \
379 (yytext_ptr) = yy_bp; \
380 c_leng = (size_t) (yy_cp - yy_bp); \
381 (yy_hold_char) = *yy_cp; \
382 *yy_cp = '\0'; \
383 (yy_c_buf_p) = yy_cp;
384
385 #define YY_NUM_RULES 30
386 #define YY_END_OF_BUFFER 31
387 /* This struct is not used in this scanner,
388 but its presence is necessary. */
389 struct yy_trans_info
390 {
391 flex_int32_t yy_verify;
392 flex_int32_t yy_nxt;
393 };
394 static yyconst flex_int16_t yy_accept[106] =
395 { 0,
396 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
397 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
398 0, 0, 0, 0, 31, 29, 28, 29, 6, 9,
399 29, 29, 29, 25, 26, 27, 29, 14, 4, 4,
400 4, 7, 29, 10, 29, 29, 16, 16, 17, 18,
401 29, 29, 19, 20, 1, 0, 25, 25, 2, 5,
402 0, 25, 26, 0, 14, 0, 13, 13, 3, 8,
403 11, 23, 15, 21, 16, 16, 24, 22, 0, 25,
404 13, 13, 13, 15, 16, 0, 25, 0, 13, 13,
405 16, 0, 25, 13, 13, 13, 13, 12, 13, 12,
406
407 13, 13, 13, 13, 0
408 } ;
409
410 static yyconst flex_int32_t yy_ec[256] =
411 { 0,
412 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
413 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
414 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
415 1, 2, 1, 4, 5, 1, 6, 1, 7, 1,
416 1, 8, 9, 1, 10, 11, 12, 13, 13, 13,
417 13, 13, 13, 13, 13, 13, 13, 1, 1, 1,
418 1, 1, 1, 1, 14, 14, 14, 14, 15, 14,
419 14, 14, 14, 14, 14, 16, 14, 14, 14, 14,
420 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
421 1, 17, 1, 1, 18, 1, 14, 14, 19, 20,
422
423 21, 14, 14, 14, 22, 14, 14, 23, 24, 25,
424 26, 27, 14, 28, 14, 29, 30, 14, 14, 31,
425 14, 14, 32, 1, 33, 1, 1, 14, 14, 14,
426 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
427 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
428 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
429 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
430 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
431 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
432 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
433
434 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
435 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
436 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
437 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
438 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
439 14, 14, 14, 14, 14
440 } ;
441
442 static yyconst flex_int32_t yy_meta[34] =
443 { 0,
444 1, 2, 1, 1, 1, 3, 1, 1, 1, 4,
445 5, 1, 6, 7, 7, 7, 1, 7, 7, 7,
446 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
447 7, 3, 1
448 } ;
449
450 static yyconst flex_int16_t yy_base[116] =
451 { 0,
452 0, 1, 18, 0, 49, 50, 51, 52, 53, 56,
453 57, 59, 68, 74, 0, 0, 91, 0, 225, 224,
454 223, 4, 32, 123, 228, 232, 232, 224, 232, 232,
455 0, 213, 0, 67, 0, 232, 77, 124, 232, 213,
456 221, 232, 220, 232, 219, 121, 208, 0, 232, 232,
457 125, 187, 232, 232, 232, 206, 73, 117, 232, 232,
458 205, 232, 0, 85, 127, 132, 0, 111, 232, 232,
459 232, 232, 0, 232, 0, 124, 232, 232, 131, 137,
460 0, 190, 197, 0, 138, 202, 201, 150, 185, 180,
461 189, 188, 171, 155, 152, 152, 142, 0, 140, 125,
462
463 117, 112, 57, 43, 232, 163, 170, 172, 178, 185,
464 192, 197, 200, 202, 206
465 } ;
466
467 static yyconst flex_int16_t yy_def[116] =
468 { 0,
469 106, 106, 105, 3, 107, 107, 106, 106, 106, 106,
470 106, 106, 106, 106, 3, 3, 105, 17, 17, 17,
471 3, 3, 3, 3, 105, 105, 105, 105, 105, 105,
472 105, 105, 105, 105, 108, 105, 105, 109, 105, 105,
473 105, 105, 110, 105, 111, 112, 113, 113, 105, 105,
474 112, 105, 105, 105, 105, 105, 105, 105, 105, 105,
475 105, 105, 108, 105, 109, 109, 114, 114, 105, 105,
476 105, 105, 115, 105, 113, 113, 105, 105, 105, 105,
477 114, 114, 114, 115, 113, 105, 105, 105, 114, 114,
478 113, 105, 105, 114, 114, 114, 114, 114, 114, 114,
479
480 114, 114, 114, 114, 0, 105, 105, 105, 105, 105,
481 105, 105, 105, 105, 105
482 } ;
483
484 static yyconst flex_int16_t yy_nxt[266] =
485 { 0,
486 105, 37, 27, 27, 38, 37, 105, 59, 38, 52,
487 56, 60, 57, 105, 105, 105, 28, 28, 26, 26,
488 27, 29, 26, 26, 30, 26, 26, 31, 32, 33,
489 34, 35, 35, 35, 28, 35, 35, 35, 35, 35,
490 35, 35, 35, 35, 35, 35, 35, 35, 35, 36,
491 36, 27, 27, 27, 27, 27, 40, 40, 27, 27,
492 42, 27, 42, 53, 54, 41, 41, 28, 28, 28,
493 27, 98, 28, 43, 44, 43, 27, 61, 64, 57,
494 44, 65, 62, 61, 45, 57, 64, 104, 62, 65,
495 45, 26, 26, 27, 29, 26, 46, 30, 26, 26,
496
497 31, 47, 33, 34, 48, 48, 48, 28, 48, 48,
498 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
499 48, 48, 49, 50, 37, 66, 72, 38, 66, 58,
500 77, 79, 103, 66, 82, 83, 76, 79, 85, 86,
501 86, 102, 101, 87, 85, 68, 86, 86, 68, 80,
502 91, 88, 74, 68, 53, 54, 105, 88, 92, 92,
503 100, 99, 93, 26, 26, 26, 26, 26, 26, 26,
504 39, 39, 39, 39, 39, 39, 39, 63, 63, 67,
505 98, 97, 96, 93, 67, 70, 70, 70, 70, 70,
506 70, 70, 71, 71, 71, 71, 71, 71, 71, 73,
507
508 93, 91, 95, 73, 75, 75, 75, 81, 81, 84,
509 94, 84, 84, 87, 87, 90, 89, 80, 58, 78,
510 76, 55, 55, 55, 69, 58, 55, 105, 52, 51,
511 51, 25, 105, 105, 105, 105, 105, 105, 105, 105,
512 105, 105, 105, 105, 105, 105, 105, 105, 105, 105,
513 105, 105, 105, 105, 105, 105, 105, 105, 105, 105,
514 105, 105, 105, 105, 105
515 } ;
516
517 static yyconst flex_int16_t yy_chk[266] =
518 { 0,
519 0, 4, 1, 2, 4, 22, 0, 33, 22, 22,
520 31, 33, 31, 0, 0, 0, 1, 2, 3, 3,
521 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
522 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
523 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
524 3, 5, 6, 7, 8, 9, 5, 6, 10, 11,
525 11, 12, 12, 23, 23, 5, 6, 7, 8, 9,
526 13, 104, 10, 11, 13, 12, 14, 34, 37, 34,
527 14, 37, 34, 57, 13, 57, 64, 103, 57, 64,
528 14, 17, 17, 17, 17, 17, 17, 17, 17, 17,
529
530 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
531 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
532 17, 17, 17, 17, 24, 38, 46, 24, 65, 58,
533 51, 58, 102, 66, 68, 68, 76, 58, 76, 79,
534 79, 101, 100, 79, 76, 38, 85, 85, 65, 80,
535 85, 80, 46, 66, 24, 24, 51, 80, 88, 88,
536 99, 97, 88, 106, 106, 106, 106, 106, 106, 106,
537 107, 107, 107, 107, 107, 107, 107, 108, 108, 109,
538 96, 95, 94, 93, 109, 110, 110, 110, 110, 110,
539 110, 110, 111, 111, 111, 111, 111, 111, 111, 112,
540
541 92, 91, 90, 112, 113, 113, 113, 114, 114, 115,
542 89, 115, 115, 87, 86, 83, 82, 61, 56, 52,
543 47, 45, 43, 41, 40, 32, 28, 25, 21, 20,
544 19, 105, 105, 105, 105, 105, 105, 105, 105, 105,
545 105, 105, 105, 105, 105, 105, 105, 105, 105, 105,
546 105, 105, 105, 105, 105, 105, 105, 105, 105, 105,
547 105, 105, 105, 105, 105
548 } ;
549
550 static yy_state_type yy_last_accepting_state;
551 static char *yy_last_accepting_cpos;
552
553 extern int c__flex_debug;
554 int c__flex_debug = 0;
555
556 /* The intent behind this definition is that it'll catch
557 * any uses of REJECT which flex missed.
558 */
559 #define REJECT reject_used_but_not_detected
560 #define yymore() yymore_used_but_not_detected
561 #define YY_MORE_ADJ 0
562 #define YY_RESTORE_YY_MORE_OFFSET
563 char *c_text;
564 #line 1 "c.l"
565 #line 2 "c.l"
566 /*
567 * Copyright (c) 2002, 2004 Tama Communications Corporation
568 *
569 * This file is part of GNU GLOBAL.
570 *
571 * This program is free software: you can redistribute it and/or modify
572 * it under the terms of the GNU General Public License as published by
573 * the Free Software Foundation, either version 3 of the License, or
574 * (at your option) any later version.
575 *
576 * This program is distributed in the hope that it will be useful,
577 * but WITHOUT ANY WARRANTY; without even the implied warranty of
578 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
579 * GNU General Public License for more details.
580 *
581 * You should have received a copy of the GNU General Public License
582 * along with this program. If not, see <http://www.gnu.org/licenses/>.
583 */
584
585 /*
586 * scanner for C and yacc source code.
587 */
588 #ifdef HAVE_CONFIG_H
589 #include <config.h>
590 #endif
591 #include <stdio.h>
592 #ifdef STDC_HEADERS
593 #include <stdlib.h>
594 #endif
595 #include "global.h"
596 #include "anchor.h"
597 #include "incop.h"
598 #include "common.h"
599 #include "htags.h"
600 #include "../libparser/c_res.h"
601
602 #define lex_symbol_generation_rule(x) c_ ## x
603 #include "lexcommon.h"
604
605 #ifdef ECHO
606 #undef ECHO
607 #endif
608 #define ECHO echos(LEXTEXT)
609
610 #define YY_USER_ACTION DEFAULT_YY_USER_ACTION
611
612 static int last_directive;
613 static int brace_level;
614 /* Definitions */
615
616
617 #line 618 "c.c"
618
619 #define INITIAL 0
620 #define C 1
621 #define C_COMMENT 2
622 #define CPP_COMMENT 3
623 #define SHELL_COMMENT 4
624 #define STRING 5
625 #define LITERAL 6
626 #define PREPROCESSOR_LINE 7
627 #define YACC_DECLARATIONS 8
628 #define YACC_RULES 9
629 #define YACC_PROLOGUE 10
630 #define BRACED_CODE 11
631
632 #ifndef YY_NO_UNISTD_H
633 /* Special case for "unistd.h", since it is non-ANSI. We include it way
634 * down here because we want the user's section 1 to have been scanned first.
635 * The user has a chance to override it with an option.
636 */
637 #include <unistd.h>
638 #endif
639
640 #ifndef YY_EXTRA_TYPE
641 #define YY_EXTRA_TYPE void *
642 #endif
643
644 static int yy_init_globals (void );
645
646 /* Accessor methods to globals.
647 These are made visible to non-reentrant scanners for convenience. */
648
649 int c_lex_destroy (void );
650
651 int c_get_debug (void );
652
653 void c_set_debug (int debug_flag );
654
655 YY_EXTRA_TYPE c_get_extra (void );
656
657 void c_set_extra (YY_EXTRA_TYPE user_defined );
658
659 FILE *c_get_in (void );
660
661 void c_set_in (FILE * in_str );
662
663 FILE *c_get_out (void );
664
665 void c_set_out (FILE * out_str );
666
667 int c_get_leng (void );
668
669 char *c_get_text (void );
670
671 int c_get_lineno (void );
672
673 void c_set_lineno (int line_number );
674
675 /* Macros after this point can all be overridden by user definitions in
676 * section 1.
677 */
678
679 #ifndef YY_SKIP_YYWRAP
680 #ifdef __cplusplus
681 extern "C" int c_wrap (void );
682 #else
683 extern int c_wrap (void );
684 #endif
685 #endif
686
687 static void yyunput (int c,char *buf_ptr );
688
689 #ifndef yytext_ptr
690 static void yy_flex_strncpy (char *,yyconst char *,int );
691 #endif
692
693 #ifdef YY_NEED_STRLEN
694 static int yy_flex_strlen (yyconst char * );
695 #endif
696
697 #ifndef YY_NO_INPUT
698
699 #ifdef __cplusplus
700 static int yyinput (void );
701 #else
702 static int input (void );
703 #endif
704
705 #endif
706
707 static int yy_start_stack_ptr = 0;
708 static int yy_start_stack_depth = 0;
709 static int *yy_start_stack = NULL;
710
711 static void yy_push_state (int new_state );
712
713 static void yy_pop_state (void );
714
715 /* Amount of stuff to slurp up with each read. */
716 #ifndef YY_READ_BUF_SIZE
717 #define YY_READ_BUF_SIZE 8192
718 #endif
719
720 /* Copy whatever the last rule matched to the standard output. */
721 #ifndef ECHO
722 /* This used to be an fputs(), but since the string might contain NUL's,
723 * we now use fwrite().
724 */
725 #define ECHO fwrite( c_text, c_leng, 1, c_out )
726 #endif
727
728 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
729 * is returned in "result".
730 */
731 #ifndef YY_INPUT
732 #define YY_INPUT(buf,result,max_size) \
733 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
734 { \
735 int c = '*'; \
736 int n; \
737 for ( n = 0; n < max_size && \
738 (c = getc( c_in )) != EOF && c != '\n'; ++n ) \
739 buf[n] = (char) c; \
740 if ( c == '\n' ) \
741 buf[n++] = (char) c; \
742 if ( c == EOF && ferror( c_in ) ) \
743 YY_FATAL_ERROR( "input in flex scanner failed" ); \
744 result = n; \
745 } \
746 else \
747 { \
748 errno=0; \
749 while ( (result = fread(buf, 1, max_size, c_in))==0 && ferror(c_in)) \
750 { \
751 if( errno != EINTR) \
752 { \
753 YY_FATAL_ERROR( "input in flex scanner failed" ); \
754 break; \
755 } \
756 errno=0; \
757 clearerr(c_in); \
758 } \
759 }\
760 \
761
762 #endif
763
764 /* No semi-colon after return; correct usage is to write "yyterminate();" -
765 * we don't want an extra ';' after the "return" because that will cause
766 * some compilers to complain about unreachable statements.
767 */
768 #ifndef yyterminate
769 #define yyterminate() return YY_NULL
770 #endif
771
772 /* Number of entries by which start-condition stack grows. */
773 #ifndef YY_START_STACK_INCR
774 #define YY_START_STACK_INCR 25
775 #endif
776
777 /* Report a fatal error. */
778 #ifndef YY_FATAL_ERROR
779 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
780 #endif
781
782 /* end tables serialization structures and prototypes */
783
784 /* Default declaration of generated scanner - a define so the user can
785 * easily add parameters.
786 */
787 #ifndef YY_DECL
788 #define YY_DECL_IS_OURS 1
789
790 extern int c_lex (void);
791
792 #define YY_DECL int c_lex (void)
793 #endif /* !YY_DECL */
794
795 /* Code executed at the beginning of each rule, after c_text and c_leng
796 * have been set up.
797 */
798 #ifndef YY_USER_ACTION
799 #define YY_USER_ACTION
800 #endif
801
802 /* Code executed at the end of each rule. */
803 #ifndef YY_BREAK
804 #define YY_BREAK break;
805 #endif
806
807 #define YY_RULE_SETUP \
808 if ( c_leng > 0 ) \
809 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \
810 (c_text[c_leng - 1] == '\n'); \
811 YY_USER_ACTION
812
813 /** The main scanner function which does all the work.
814 */
815 YY_DECL
816 {
817 register yy_state_type yy_current_state;
818 register char *yy_cp, *yy_bp;
819 register int yy_act;
820
821 #line 67 "c.l"
822
823 /* Backslash-newline */
824 #line 825 "c.c"
825
826 if ( !(yy_init) )
827 {
828 (yy_init) = 1;
829
830 #ifdef YY_USER_INIT
831 YY_USER_INIT;
832 #endif
833
834 if ( ! (yy_start) )
835 (yy_start) = 1; /* first start state */
836
837 if ( ! c_in )
838 c_in = stdin;
839
840 if ( ! c_out )
841 c_out = stdout;
842
843 if ( ! YY_CURRENT_BUFFER ) {
844 c_ensure_buffer_stack ();
845 YY_CURRENT_BUFFER_LVALUE =
846 c__create_buffer(c_in,YY_BUF_SIZE );
847 }
848
849 c__load_buffer_state( );
850 }
851
852 while ( 1 ) /* loops until end-of-file is reached */
853 {
854 yy_cp = (yy_c_buf_p);
855
856 /* Support of c_text. */
857 *yy_cp = (yy_hold_char);
858
859 /* yy_bp points to the position in yy_ch_buf of the start of
860 * the current run.
861 */
862 yy_bp = yy_cp;
863
864 yy_current_state = (yy_start);
865 yy_current_state += YY_AT_BOL();
866 yy_match:
867 do
868 {
869 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
870 if ( yy_accept[yy_current_state] )
871 {
872 (yy_last_accepting_state) = yy_current_state;
873 (yy_last_accepting_cpos) = yy_cp;
874 }
875 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
876 {
877 yy_current_state = (int) yy_def[yy_current_state];
878 if ( yy_current_state >= 106 )
879 yy_c = yy_meta[(unsigned int) yy_c];
880 }
881 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
882 ++yy_cp;
883 }
884 while ( yy_current_state != 105 );
885 yy_cp = (yy_last_accepting_cpos);
886 yy_current_state = (yy_last_accepting_state);
887
888 yy_find_action:
889 yy_act = yy_accept[yy_current_state];
890
891 YY_DO_BEFORE_ACTION;
892
893 do_action: /* This label is used only to access EOF actions. */
894
895 switch ( yy_act )
896 { /* beginning of action switch */
897 case 0: /* must back up */
898 /* undo the effects of YY_DO_BEFORE_ACTION */
899 *yy_cp = (yy_hold_char);
900 yy_cp = (yy_last_accepting_cpos);
901 yy_current_state = (yy_last_accepting_state);
902 goto yy_find_action;
903
904 case 1:
905 /* rule 1 can match eol */
906 YY_RULE_SETUP
907 #line 69 "c.l"
908 DEFAULT_BACKSLASH_NEWLINE_ACTION
909 YY_BREAK
910 /* Comment */
911
912 case 2:
913 YY_RULE_SETUP
914 #line 73 "c.l"
915 { echos(comment_begin); ECHO; yy_push_state(C_COMMENT); }
916 YY_BREAK
917
918 case 3:
919 YY_RULE_SETUP
920 #line 75 "c.l"
921 { ECHO; echos(comment_end); yy_pop_state(); }
922 YY_BREAK
923 case 4:
924 YY_RULE_SETUP
925 #line 76 "c.l"
926 { put_char(LEXTEXT[0]); }
927 YY_BREAK
928 case YY_STATE_EOF(C_COMMENT):
929 #line 77 "c.l"
930 {
931 if (wflag)
932 unexpected_eof(LINENO);
933 yyterminate();
934 }
935 YY_BREAK
936
937 case 5:
938 YY_RULE_SETUP
939 #line 83 "c.l"
940 { echos(comment_begin); ECHO; yy_push_state(CPP_COMMENT); }
941 YY_BREAK
942
943 /* String */
944
945 case 6:
946 YY_RULE_SETUP
947 #line 88 "c.l"
948 { ECHO; yy_push_state(STRING); }
949 YY_BREAK
950
951 case 7:
952 YY_RULE_SETUP
953 #line 90 "c.l"
954 { ECHO; yy_pop_state(); }
955 YY_BREAK
956 case 8:
957 YY_RULE_SETUP
958 #line 91 "c.l"
959 { put_char(LEXTEXT[0]); put_char(LEXTEXT[1]); }
960 YY_BREAK
961 /* Literal */
962
963 case 9:
964 YY_RULE_SETUP
965 #line 95 "c.l"
966 { ECHO; yy_push_state(LITERAL); }
967 YY_BREAK
968
969 case 10:
970 YY_RULE_SETUP
971 #line 97 "c.l"
972 { ECHO; yy_pop_state(); }
973 YY_BREAK
974 case 11:
975 YY_RULE_SETUP
976 #line 98 "c.l"
977 { put_char(LEXTEXT[0]); put_char(LEXTEXT[1]); }
978 YY_BREAK
979 /* Preprocessing directive */
980
981 case 12:
982 YY_RULE_SETUP
983 #line 102 "c.l"
984 {
985 int c;
986
987 put_macro(LEXTEXT);
988 /*
989 * #include| <aaa/bbb.h>|
990 * ~~~~~~~~~~~~~~~~
991 */
992 while ((c = input()) && c != EOF && c != '\n' && isspace(c))
993 echoc(c);
994 if (c == EOF)
995 c = '\n';
996 if (c == '\n') {
997 unput(c);
998 } else if (c) {
999 char path[MAXPATHLEN], *p = path;
1000 int sep = 0;
1001
1002 if (c == '"')
1003 sep = c;
1004 else if (c == '<')
1005 sep = '>';
1006 put_char(c);
1007
1008 /* pick up path name */
1009 while ((c = input()) && c != EOF && c != '\n' && c != sep)
1010 *p++ = c;
1011 *p = '\0';
1012 if (c == EOF)
1013 c = '\n';
1014 if (c == sep) {
1015 struct data *inc;
1016 const char *basename = locatestring(path, "/", MATCH_LAST);
1017
1018 if (basename)
1019 basename++;
1020 else
1021 basename = path;
1022 inc = get_inc(basename);
1023 if (inc)
1024 put_include_anchor(inc, path);
1025 else
1026 echos(path);
1027 put_char(sep);
1028 } else {
1029 echos(path);
1030 if (c)
1031 unput(c);
1032 }
1033 }
1034 }
1035 YY_BREAK
1036 case 13:
1037 YY_RULE_SETUP
1038 #line 153 "c.l"
1039 {
1040 if ((last_directive = c_reserved_sharp(LEXTEXT, LEXLENG)) != 0)
1041 put_macro(LEXTEXT);
1042 else {
1043 ECHO;
1044 if (wflag)
1045 unknown_preprocessing_directive(LEXTEXT, LINENO);
1046 }
1047 yy_push_state(PREPROCESSOR_LINE);
1048 }
1049 YY_BREAK
1050 /* Null directive */
1051 case 14:
1052 YY_RULE_SETUP
1053 #line 164 "c.l"
1054 { put_macro(LEXTEXT); }
1055 YY_BREAK
1056
1057 /* Yacc directive */
1058
1059 case 15:
1060 YY_RULE_SETUP
1061 #line 169 "c.l"
1062 {
1063 if (c_reserved_yacc(LEXTEXT, LEXLENG))
1064 put_reserved_word(LEXTEXT);
1065 else {
1066 ECHO;
1067 if (wflag)
1068 unknown_yacc_directive(LEXTEXT, LINENO);
1069 }
1070 }
1071 YY_BREAK
1072 case 16:
1073 YY_RULE_SETUP
1074 #line 178 "c.l"
1075 {
1076 struct anchor *a = anchor_get(LEXTEXT, LEXLENG, 0, LINENO);
1077
1078 if (a) {
1079 put_anchor(gettag(a), a->type, LINENO);
1080 a->done = 1;
1081 } else if (grtags_is_empty) {
1082 put_anchor_force(LEXTEXT, LEXLENG, LINENO);
1083 } else {
1084 ECHO;
1085 }
1086 }
1087 YY_BREAK
1088 case 17:
1089 YY_RULE_SETUP
1090 #line 190 "c.l"
1091 { put_brace(LEXTEXT); brace_level = 1; yy_push_state(BRACED_CODE); }
1092 YY_BREAK
1093 case 18:
1094 YY_RULE_SETUP
1095 #line 191 "c.l"
1096 { put_brace(LEXTEXT); if (wflag) missing_left("{", LINENO); }
1097 YY_BREAK
1098
1099 case 19:
1100 YY_RULE_SETUP
1101 #line 193 "c.l"
1102 { put_brace(LEXTEXT); brace_level++; }
1103 YY_BREAK
1104 case 20:
1105 YY_RULE_SETUP
1106 #line 194 "c.l"
1107 { put_brace(LEXTEXT); if (--brace_level == 0) yy_pop_state(); }
1108 YY_BREAK
1109 case 21:
1110 YY_RULE_SETUP
1111 #line 195 "c.l"
1112 { put_reserved_word(LEXTEXT); yy_push_state(YACC_PROLOGUE); }
1113 YY_BREAK
1114 case 22:
1115 YY_RULE_SETUP
1116 #line 196 "c.l"
1117 { put_reserved_word(LEXTEXT); yy_pop_state(); }
1118 YY_BREAK
1119 case 23:
1120 YY_RULE_SETUP
1121 #line 197 "c.l"
1122 { put_reserved_word(LEXTEXT); BEGIN YACC_RULES; }
1123 YY_BREAK
1124 case 24:
1125 YY_RULE_SETUP
1126 #line 198 "c.l"
1127 { put_reserved_word(LEXTEXT); BEGIN C; }
1128 YY_BREAK
1129 case YY_STATE_EOF(YACC_DECLARATIONS):
1130 case YY_STATE_EOF(YACC_PROLOGUE):
1131 case YY_STATE_EOF(BRACED_CODE):
1132 #line 199 "c.l"
1133 {
1134 if (wflag)
1135 unexpected_eof(LINENO);
1136 yyterminate();
1137 }
1138 YY_BREAK
1139
1140 case 25:
1141 YY_RULE_SETUP
1142 #line 206 "c.l"
1143 ECHO;
1144 YY_BREAK
1145
1146
1147 case 26:
1148 YY_RULE_SETUP
1149 #line 209 "c.l"
1150 {
1151 if (c_reserved_word(LEXTEXT, LEXLENG))
1152 put_reserved_word(LEXTEXT);
1153 else if (YY_START == PREPROCESSOR_LINE
1154 && (last_directive == SHARP_IF || last_directive == SHARP_ELIF)
1155 && strcmp(LEXTEXT, "defined") == 0)
1156 put_reserved_word(LEXTEXT);
1157 else {
1158 struct anchor *a = anchor_get(LEXTEXT, LEXLENG, 0, LINENO);
1159 if (a) {
1160 put_anchor(gettag(a), a->type, LINENO);
1161 a->done = 1;
1162 } else if (grtags_is_empty) {
1163 put_anchor_force(LEXTEXT, LEXLENG, LINENO);
1164 } else {
1165 ECHO;
1166 }
1167 }
1168 }
1169 YY_BREAK
1170
1171
1172 case 27:
1173 YY_RULE_SETUP
1174 #line 230 "c.l"
1175 { put_brace(LEXTEXT); }
1176 YY_BREAK
1177
1178 /* New line */
1179 case 28:
1180 /* rule 28 can match eol */
1181 YY_RULE_SETUP
1182 #line 234 "c.l"
1183 DEFAULT_END_OF_LINE_ACTION
1184 YY_BREAK
1185 case 29:
1186 YY_RULE_SETUP
1187 #line 235 "c.l"
1188 { put_char(LEXTEXT[0]); }
1189 YY_BREAK
1190 case 30:
1191 YY_RULE_SETUP
1192 #line 237 "c.l"
1193 ECHO;
1194 YY_BREAK
1195 #line 1196 "c.c"
1196 case YY_STATE_EOF(INITIAL):
1197 case YY_STATE_EOF(C):
1198 case YY_STATE_EOF(CPP_COMMENT):
1199 case YY_STATE_EOF(SHELL_COMMENT):
1200 case YY_STATE_EOF(STRING):
1201 case YY_STATE_EOF(LITERAL):
1202 case YY_STATE_EOF(PREPROCESSOR_LINE):
1203 case YY_STATE_EOF(YACC_RULES):
1204 yyterminate();
1205
1206 case YY_END_OF_BUFFER:
1207 {
1208 /* Amount of text matched not including the EOB char. */
1209 int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
1210
1211 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1212 *yy_cp = (yy_hold_char);
1213 YY_RESTORE_YY_MORE_OFFSET
1214
1215 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
1216 {
1217 /* We're scanning a new file or input source. It's
1218 * possible that this happened because the user
1219 * just pointed c_in at a new source and called
1220 * c_lex(). If so, then we have to assure
1221 * consistency between YY_CURRENT_BUFFER and our
1222 * globals. Here is the right place to do so, because
1223 * this is the first action (other than possibly a
1224 * back-up) that will match for the new input source.
1225 */
1226 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1227 YY_CURRENT_BUFFER_LVALUE->yy_input_file = c_in;
1228 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
1229 }
1230
1231 /* Note that here we test for yy_c_buf_p "<=" to the position
1232 * of the first EOB in the buffer, since yy_c_buf_p will
1233 * already have been incremented past the NUL character
1234 * (since all states make transitions on EOB to the
1235 * end-of-buffer state). Contrast this with the test
1236 * in input().
1237 */
1238 if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1239 { /* This was really a NUL. */
1240 yy_state_type yy_next_state;
1241
1242 (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
1243
1244 yy_current_state = yy_get_previous_state( );
1245
1246 /* Okay, we're now positioned to make the NUL
1247 * transition. We couldn't have
1248 * yy_get_previous_state() go ahead and do it
1249 * for us because it doesn't know how to deal
1250 * with the possibility of jamming (and we don't
1251 * want to build jamming into it because then it
1252 * will run more slowly).
1253 */
1254
1255 yy_next_state = yy_try_NUL_trans( yy_current_state );
1256
1257 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1258
1259 if ( yy_next_state )
1260 {
1261 /* Consume the NUL. */
1262 yy_cp = ++(yy_c_buf_p);
1263 yy_current_state = yy_next_state;
1264 goto yy_match;
1265 }
1266
1267 else
1268 {
1269 yy_cp = (yy_last_accepting_cpos);
1270 yy_current_state = (yy_last_accepting_state);
1271 goto yy_find_action;
1272 }
1273 }
1274
1275 else switch ( yy_get_next_buffer( ) )
1276 {
1277 case EOB_ACT_END_OF_FILE:
1278 {
1279 (yy_did_buffer_switch_on_eof) = 0;
1280
1281 if ( c_wrap( ) )
1282 {
1283 /* Note: because we've taken care in
1284 * yy_get_next_buffer() to have set up
1285 * c_text, we can now set up
1286 * yy_c_buf_p so that if some total
1287 * hoser (like flex itself) wants to
1288 * call the scanner after we return the
1289 * YY_NULL, it'll still work - another
1290 * YY_NULL will get returned.
1291 */
1292 (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
1293
1294 yy_act = YY_STATE_EOF(YY_START);
1295 goto do_action;
1296 }
1297
1298 else
1299 {
1300 if ( ! (yy_did_buffer_switch_on_eof) )
1301 YY_NEW_FILE;
1302 }
1303 break;
1304 }
1305
1306 case EOB_ACT_CONTINUE_SCAN:
1307 (yy_c_buf_p) =
1308 (yytext_ptr) + yy_amount_of_matched_text;
1309
1310 yy_current_state = yy_get_previous_state( );
1311
1312 yy_cp = (yy_c_buf_p);
1313 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1314 goto yy_match;
1315
1316 case EOB_ACT_LAST_MATCH:
1317 (yy_c_buf_p) =
1318 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
1319
1320 yy_current_state = yy_get_previous_state( );
1321
1322 yy_cp = (yy_c_buf_p);
1323 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1324 goto yy_find_action;
1325 }
1326 break;
1327 }
1328
1329 default:
1330 YY_FATAL_ERROR(
1331 "fatal flex scanner internal error--no action found" );
1332 } /* end of action switch */
1333 } /* end of scanning one token */
1334 } /* end of c_lex */
1335
1336 /* yy_get_next_buffer - try to read in a new buffer
1337 *
1338 * Returns a code representing an action:
1339 * EOB_ACT_LAST_MATCH -
1340 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1341 * EOB_ACT_END_OF_FILE - end of file
1342 */
1343 static int yy_get_next_buffer (void)
1344 {
1345 register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1346 register char *source = (yytext_ptr);
1347 register int number_to_move, i;
1348 int ret_val;
1349
1350 if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
1351 YY_FATAL_ERROR(
1352 "fatal flex scanner internal error--end of buffer missed" );
1353
1354 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1355 { /* Don't try to fill the buffer, so this is an EOF. */
1356 if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
1357 {
1358 /* We matched a single character, the EOB, so
1359 * treat this as a final EOF.
1360 */
1361 return EOB_ACT_END_OF_FILE;
1362 }
1363
1364 else
1365 {
1366 /* We matched some text prior to the EOB, first
1367 * process it.
1368 */
1369 return EOB_ACT_LAST_MATCH;
1370 }
1371 }
1372
1373 /* Try to read more data. */
1374
1375 /* First move last chars to start of buffer. */
1376 number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
1377
1378 for ( i = 0; i < number_to_move; ++i )
1379 *(dest++) = *(source++);
1380
1381 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1382 /* don't do the read, it's not guaranteed to return an EOF,
1383 * just force an EOF
1384 */
1385 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1386
1387 else
1388 {
1389 int num_to_read =
1390 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1391
1392 while ( num_to_read <= 0 )
1393 { /* Not enough room in the buffer - grow it. */
1394
1395 /* just a shorter name for the current buffer */
1396 YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
1397
1398 int yy_c_buf_p_offset =
1399 (int) ((yy_c_buf_p) - b->yy_ch_buf);
1400
1401 if ( b->yy_is_our_buffer )
1402 {
1403 int new_size = b->yy_buf_size * 2;
1404
1405 if ( new_size <= 0 )
1406 b->yy_buf_size += b->yy_buf_size / 8;
1407 else
1408 b->yy_buf_size *= 2;
1409
1410 b->yy_ch_buf = (char *)
1411 /* Include room in for 2 EOB chars. */
1412 c_realloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 );
1413 }
1414 else
1415 /* Can't grow it, we don't own it. */
1416 b->yy_ch_buf = 0;
1417
1418 if ( ! b->yy_ch_buf )
1419 YY_FATAL_ERROR(
1420 "fatal error - scanner input buffer overflow" );
1421
1422 (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
1423
1424 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1425 number_to_move - 1;
1426
1427 }
1428
1429 if ( num_to_read > YY_READ_BUF_SIZE )
1430 num_to_read = YY_READ_BUF_SIZE;
1431
1432 /* Read in more data. */
1433 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1434 (yy_n_chars), (size_t) num_to_read );
1435
1436 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1437 }
1438
1439 if ( (yy_n_chars) == 0 )
1440 {
1441 if ( number_to_move == YY_MORE_ADJ )
1442 {
1443 ret_val = EOB_ACT_END_OF_FILE;
1444 c_restart(c_in );
1445 }
1446
1447 else
1448 {
1449 ret_val = EOB_ACT_LAST_MATCH;
1450 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1451 YY_BUFFER_EOF_PENDING;
1452 }
1453 }
1454
1455 else
1456 ret_val = EOB_ACT_CONTINUE_SCAN;
1457
1458 if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1459 /* Extend the array by 50%, plus the number we really need. */
1460 yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
1461 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) c_realloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size );
1462 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1463 YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1464 }
1465
1466 (yy_n_chars) += number_to_move;
1467 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
1468 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
1469
1470 (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1471
1472 return ret_val;
1473 }
1474
1475 /* yy_get_previous_state - get the state just before the EOB char was reached */
1476
1477 static yy_state_type yy_get_previous_state (void)
1478 {
1479 register yy_state_type yy_current_state;
1480 register char *yy_cp;
1481
1482 yy_current_state = (yy_start);
1483 yy_current_state += YY_AT_BOL();
1484
1485 for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
1486 {
1487 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1488 if ( yy_accept[yy_current_state] )
1489 {
1490 (yy_last_accepting_state) = yy_current_state;
1491 (yy_last_accepting_cpos) = yy_cp;
1492 }
1493 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1494 {
1495 yy_current_state = (int) yy_def[yy_current_state];
1496 if ( yy_current_state >= 106 )
1497 yy_c = yy_meta[(unsigned int) yy_c];
1498 }
1499 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1500 }
1501
1502 return yy_current_state;
1503 }
1504
1505 /* yy_try_NUL_trans - try to make a transition on the NUL character
1506 *
1507 * synopsis
1508 * next_state = yy_try_NUL_trans( current_state );
1509 */
1510 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
1511 {
1512 register int yy_is_jam;
1513 register char *yy_cp = (yy_c_buf_p);
1514
1515 register YY_CHAR yy_c = 1;
1516 if ( yy_accept[yy_current_state] )
1517 {
1518 (yy_last_accepting_state) = yy_current_state;
1519 (yy_last_accepting_cpos) = yy_cp;
1520 }
1521 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1522 {
1523 yy_current_state = (int) yy_def[yy_current_state];
1524 if ( yy_current_state >= 106 )
1525 yy_c = yy_meta[(unsigned int) yy_c];
1526 }
1527 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1528 yy_is_jam = (yy_current_state == 105);
1529
1530 return yy_is_jam ? 0 : yy_current_state;
1531 }
1532
1533 static void yyunput (int c, register char * yy_bp )
1534 {
1535 register char *yy_cp;
1536
1537 yy_cp = (yy_c_buf_p);
1538
1539 /* undo effects of setting up c_text */
1540 *yy_cp = (yy_hold_char);
1541
1542 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1543 { /* need to shift things up to make room */
1544 /* +2 for EOB chars. */
1545 register int number_to_move = (yy_n_chars) + 2;
1546 register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
1547 YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
1548 register char *source =
1549 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
1550
1551 while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1552 *--dest = *--source;
1553
1554 yy_cp += (int) (dest - source);
1555 yy_bp += (int) (dest - source);
1556 YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
1557 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
1558
1559 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1560 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1561 }
1562
1563 *--yy_cp = (char) c;
1564
1565 (yytext_ptr) = yy_bp;
1566 (yy_hold_char) = *yy_cp;
1567 (yy_c_buf_p) = yy_cp;
1568 }
1569
1570 #ifndef YY_NO_INPUT
1571 #ifdef __cplusplus
1572 static int yyinput (void)
1573 #else
1574 static int input (void)
1575 #endif
1576
1577 {
1578 int c;
1579
1580 *(yy_c_buf_p) = (yy_hold_char);
1581
1582 if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
1583 {
1584 /* yy_c_buf_p now points to the character we want to return.
1585 * If this occurs *before* the EOB characters, then it's a
1586 * valid NUL; if not, then we've hit the end of the buffer.
1587 */
1588 if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1589 /* This was really a NUL. */
1590 *(yy_c_buf_p) = '\0';
1591
1592 else
1593 { /* need more input */
1594 int offset = (yy_c_buf_p) - (yytext_ptr);
1595 ++(yy_c_buf_p);
1596
1597 switch ( yy_get_next_buffer( ) )
1598 {
1599 case EOB_ACT_LAST_MATCH:
1600 /* This happens because yy_g_n_b()
1601 * sees that we've accumulated a
1602 * token and flags that we need to
1603 * try matching the token before
1604 * proceeding. But for input(),
1605 * there's no matching to consider.
1606 * So convert the EOB_ACT_LAST_MATCH
1607 * to EOB_ACT_END_OF_FILE.
1608 */
1609
1610 /* Reset buffer status. */
1611 c_restart(c_in );
1612
1613 /*FALLTHROUGH*/
1614
1615 case EOB_ACT_END_OF_FILE:
1616 {
1617 if ( c_wrap( ) )
1618 return EOF;
1619
1620 if ( ! (yy_did_buffer_switch_on_eof) )
1621 YY_NEW_FILE;
1622 #ifdef __cplusplus
1623 return yyinput();
1624 #else
1625 return input();
1626 #endif
1627 }
1628
1629 case EOB_ACT_CONTINUE_SCAN:
1630 (yy_c_buf_p) = (yytext_ptr) + offset;
1631 break;
1632 }
1633 }
1634 }
1635
1636 c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
1637 *(yy_c_buf_p) = '\0'; /* preserve c_text */
1638 (yy_hold_char) = *++(yy_c_buf_p);
1639
1640 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n');
1641
1642 return c;
1643 }
1644 #endif /* ifndef YY_NO_INPUT */
1645
1646 /** Immediately switch to a different input stream.
1647 * @param input_file A readable stream.
1648 *
1649 * @note This function does not reset the start condition to @c INITIAL .
1650 */
1651 void c_restart (FILE * input_file )
1652 {
1653
1654 if ( ! YY_CURRENT_BUFFER ){
1655 c_ensure_buffer_stack ();
1656 YY_CURRENT_BUFFER_LVALUE =
1657 c__create_buffer(c_in,YY_BUF_SIZE );
1658 }
1659
1660 c__init_buffer(YY_CURRENT_BUFFER,input_file );
1661 c__load_buffer_state( );
1662 }
1663
1664 /** Switch to a different input buffer.
1665 * @param new_buffer The new input buffer.
1666 *
1667 */
1668 void c__switch_to_buffer (YY_BUFFER_STATE new_buffer )
1669 {
1670
1671 /* TODO. We should be able to replace this entire function body
1672 * with
1673 * c_pop_buffer_state();
1674 * c_push_buffer_state(new_buffer);
1675 */
1676 c_ensure_buffer_stack ();
1677 if ( YY_CURRENT_BUFFER == new_buffer )
1678 return;
1679
1680 if ( YY_CURRENT_BUFFER )
1681 {
1682 /* Flush out information for old buffer. */
1683 *(yy_c_buf_p) = (yy_hold_char);
1684 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1685 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1686 }
1687
1688 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1689 c__load_buffer_state( );
1690
1691 /* We don't actually know whether we did this switch during
1692 * EOF (c_wrap()) processing, but the only time this flag
1693 * is looked at is after c_wrap() is called, so it's safe
1694 * to go ahead and always set it.
1695 */
1696 (yy_did_buffer_switch_on_eof) = 1;
1697 }
1698
1699 static void c__load_buffer_state (void)
1700 {
1701 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1702 (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1703 c_in = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1704 (yy_hold_char) = *(yy_c_buf_p);
1705 }
1706
1707 /** Allocate and initialize an input buffer state.
1708 * @param file A readable stream.
1709 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
1710 *
1711 * @return the allocated buffer state.
1712 */
1713 YY_BUFFER_STATE c__create_buffer (FILE * file, int size )
1714 {
1715 YY_BUFFER_STATE b;
1716
1717 b = (YY_BUFFER_STATE) c_alloc(sizeof( struct yy_buffer_state ) );
1718 if ( ! b )
1719 YY_FATAL_ERROR( "out of dynamic memory in c__create_buffer()" );
1720
1721 b->yy_buf_size = size;
1722
1723 /* yy_ch_buf has to be 2 characters longer than the size given because
1724 * we need to put in 2 end-of-buffer characters.
1725 */
1726 b->yy_ch_buf = (char *) c_alloc(b->yy_buf_size + 2 );
1727 if ( ! b->yy_ch_buf )
1728 YY_FATAL_ERROR( "out of dynamic memory in c__create_buffer()" );
1729
1730 b->yy_is_our_buffer = 1;
1731
1732 c__init_buffer(b,file );
1733
1734 return b;
1735 }
1736
1737 /** Destroy the buffer.
1738 * @param b a buffer created with c__create_buffer()
1739 *
1740 */
1741 void c__delete_buffer (YY_BUFFER_STATE b )
1742 {
1743
1744 if ( ! b )
1745 return;
1746
1747 if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
1748 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
1749
1750 if ( b->yy_is_our_buffer )
1751 c_free((void *) b->yy_ch_buf );
1752
1753 c_free((void *) b );
1754 }
1755
1756 /* Initializes or reinitializes a buffer.
1757 * This function is sometimes called more than once on the same buffer,
1758 * such as during a c_restart() or at EOF.
1759 */
1760 static void c__init_buffer (YY_BUFFER_STATE b, FILE * file )
1761
1762 {
1763 int oerrno = errno;
1764
1765 c__flush_buffer(b );
1766
1767 b->yy_input_file = file;
1768 b->yy_fill_buffer = 1;
1769
1770 /* If b is the current buffer, then c__init_buffer was _probably_
1771 * called from c_restart() or through yy_get_next_buffer.
1772 * In that case, we don't want to reset the lineno or column.
1773 */
1774 if (b != YY_CURRENT_BUFFER){
1775 b->yy_bs_lineno = 1;
1776 b->yy_bs_column = 0;
1777 }
1778
1779 b->yy_is_interactive = 0;
1780
1781 errno = oerrno;
1782 }
1783
1784 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
1785 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
1786 *
1787 */
1788 void c__flush_buffer (YY_BUFFER_STATE b )
1789 {
1790 if ( ! b )
1791 return;
1792
1793 b->yy_n_chars = 0;
1794
1795 /* We always need two end-of-buffer characters. The first causes
1796 * a transition to the end-of-buffer state. The second causes
1797 * a jam in that state.
1798 */
1799 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1800 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1801
1802 b->yy_buf_pos = &b->yy_ch_buf[0];
1803
1804 b->yy_at_bol = 1;
1805 b->yy_buffer_status = YY_BUFFER_NEW;
1806
1807 if ( b == YY_CURRENT_BUFFER )
1808 c__load_buffer_state( );
1809 }
1810
1811 /** Pushes the new state onto the stack. The new state becomes
1812 * the current state. This function will allocate the stack
1813 * if necessary.
1814 * @param new_buffer The new state.
1815 *
1816 */
1817 void c_push_buffer_state (YY_BUFFER_STATE new_buffer )
1818 {
1819 if (new_buffer == NULL)
1820 return;
1821
1822 c_ensure_buffer_stack();
1823
1824 /* This block is copied from c__switch_to_buffer. */
1825 if ( YY_CURRENT_BUFFER )
1826 {
1827 /* Flush out information for old buffer. */
1828 *(yy_c_buf_p) = (yy_hold_char);
1829 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1830 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1831 }
1832
1833 /* Only push if top exists. Otherwise, replace top. */
1834 if (YY_CURRENT_BUFFER)
1835 (yy_buffer_stack_top)++;
1836 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1837
1838 /* copied from c__switch_to_buffer. */
1839 c__load_buffer_state( );
1840 (yy_did_buffer_switch_on_eof) = 1;
1841 }
1842
1843 /** Removes and deletes the top of the stack, if present.
1844 * The next element becomes the new top.
1845 *
1846 */
1847 void c_pop_buffer_state (void)
1848 {
1849 if (!YY_CURRENT_BUFFER)
1850 return;
1851
1852 c__delete_buffer(YY_CURRENT_BUFFER );
1853 YY_CURRENT_BUFFER_LVALUE = NULL;
1854 if ((yy_buffer_stack_top) > 0)
1855 --(yy_buffer_stack_top);
1856
1857 if (YY_CURRENT_BUFFER) {
1858 c__load_buffer_state( );
1859 (yy_did_buffer_switch_on_eof) = 1;
1860 }
1861 }
1862
1863 /* Allocates the stack if it does not exist.
1864 * Guarantees space for at least one push.
1865 */
1866 static void c_ensure_buffer_stack (void)
1867 {
1868 int num_to_alloc;
1869
1870 if (!(yy_buffer_stack)) {
1871
1872 /* First allocation is just for 2 elements, since we don't know if this
1873 * scanner will even need a stack. We use 2 instead of 1 to avoid an
1874 * immediate realloc on the next call.
1875 */
1876 num_to_alloc = 1;
1877 (yy_buffer_stack) = (struct yy_buffer_state**)c_alloc
1878 (num_to_alloc * sizeof(struct yy_buffer_state*)
1879 );
1880 if ( ! (yy_buffer_stack) )
1881 YY_FATAL_ERROR( "out of dynamic memory in c_ensure_buffer_stack()" );
1882
1883 memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
1884
1885 (yy_buffer_stack_max) = num_to_alloc;
1886 (yy_buffer_stack_top) = 0;
1887 return;
1888 }
1889
1890 if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
1891
1892 /* Increase the buffer to prepare for a possible push. */
1893 int grow_size = 8 /* arbitrary grow size */;
1894
1895 num_to_alloc = (yy_buffer_stack_max) + grow_size;
1896 (yy_buffer_stack) = (struct yy_buffer_state**)c_realloc
1897 ((yy_buffer_stack),
1898 num_to_alloc * sizeof(struct yy_buffer_state*)
1899 );
1900 if ( ! (yy_buffer_stack) )
1901 YY_FATAL_ERROR( "out of dynamic memory in c_ensure_buffer_stack()" );
1902
1903 /* zero only the new slots.*/
1904 memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
1905 (yy_buffer_stack_max) = num_to_alloc;
1906 }
1907 }
1908
1909 /** Setup the input buffer state to scan directly from a user-specified character buffer.
1910 * @param base the character buffer
1911 * @param size the size in bytes of the character buffer
1912 *
1913 * @return the newly allocated buffer state object.
1914 */
1915 YY_BUFFER_STATE c__scan_buffer (char * base, yy_size_t size )
1916 {
1917 YY_BUFFER_STATE b;
1918
1919 if ( size < 2 ||
1920 base[size-2] != YY_END_OF_BUFFER_CHAR ||
1921 base[size-1] != YY_END_OF_BUFFER_CHAR )
1922 /* They forgot to leave room for the EOB's. */
1923 return 0;
1924
1925 b = (YY_BUFFER_STATE) c_alloc(sizeof( struct yy_buffer_state ) );
1926 if ( ! b )
1927 YY_FATAL_ERROR( "out of dynamic memory in c__scan_buffer()" );
1928
1929 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
1930 b->yy_buf_pos = b->yy_ch_buf = base;
1931 b->yy_is_our_buffer = 0;
1932 b->yy_input_file = 0;
1933 b->yy_n_chars = b->yy_buf_size;
1934 b->yy_is_interactive = 0;
1935 b->yy_at_bol = 1;
1936 b->yy_fill_buffer = 0;
1937 b->yy_buffer_status = YY_BUFFER_NEW;
1938
1939 c__switch_to_buffer(b );
1940
1941 return b;
1942 }
1943
1944 /** Setup the input buffer state to scan a string. The next call to c_lex() will
1945 * scan from a @e copy of @a str.
1946 * @param yystr a NUL-terminated string to scan
1947 *
1948 * @return the newly allocated buffer state object.
1949 * @note If you want to scan bytes that may contain NUL values, then use
1950 * c__scan_bytes() instead.
1951 */
1952 YY_BUFFER_STATE c__scan_string (yyconst char * yystr )
1953 {
1954
1955 return c__scan_bytes(yystr,strlen(yystr) );
1956 }
1957
1958 /** Setup the input buffer state to scan the given bytes. The next call to c_lex() will
1959 * scan from a @e copy of @a bytes.
1960 * @param bytes the byte buffer to scan
1961 * @param len the number of bytes in the buffer pointed to by @a bytes.
1962 *
1963 * @return the newly allocated buffer state object.
1964 */
1965 YY_BUFFER_STATE c__scan_bytes (yyconst char * yybytes, int _yybytes_len )
1966 {
1967 YY_BUFFER_STATE b;
1968 char *buf;
1969 yy_size_t n;
1970 int i;
1971
1972 /* Get memory for full buffer, including space for trailing EOB's. */
1973 n = _yybytes_len + 2;
1974 buf = (char *) c_alloc(n );
1975 if ( ! buf )
1976 YY_FATAL_ERROR( "out of dynamic memory in c__scan_bytes()" );
1977
1978 for ( i = 0; i < _yybytes_len; ++i )
1979 buf[i] = yybytes[i];
1980
1981 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
1982
1983 b = c__scan_buffer(buf,n );
1984 if ( ! b )
1985 YY_FATAL_ERROR( "bad buffer in c__scan_bytes()" );
1986
1987 /* It's okay to grow etc. this buffer, and we should throw it
1988 * away when we're done.
1989 */
1990 b->yy_is_our_buffer = 1;
1991
1992 return b;
1993 }
1994
1995 static void yy_push_state (int new_state )
1996 {
1997 if ( (yy_start_stack_ptr) >= (yy_start_stack_depth) )
1998 {
1999 yy_size_t new_size;
2000
2001 (yy_start_stack_depth) += YY_START_STACK_INCR;
2002 new_size = (yy_start_stack_depth) * sizeof( int );
2003
2004 if ( ! (yy_start_stack) )
2005 (yy_start_stack) = (int *) c_alloc(new_size );
2006
2007 else
2008 (yy_start_stack) = (int *) c_realloc((void *) (yy_start_stack),new_size );
2009
2010 if ( ! (yy_start_stack) )
2011 YY_FATAL_ERROR( "out of memory expanding start-condition stack" );
2012 }
2013
2014 (yy_start_stack)[(yy_start_stack_ptr)++] = YY_START;
2015
2016 BEGIN(new_state);
2017 }
2018
2019 static void yy_pop_state (void)
2020 {
2021 if ( --(yy_start_stack_ptr) < 0 )
2022 YY_FATAL_ERROR( "start-condition stack underflow" );
2023
2024 BEGIN((yy_start_stack)[(yy_start_stack_ptr)]);
2025 }
2026
2027 #ifndef YY_EXIT_FAILURE
2028 #define YY_EXIT_FAILURE 2
2029 #endif
2030
2031 static void yy_fatal_error (yyconst char* msg )
2032 {
2033 (void) fprintf( stderr, "%s\n", msg );
2034 exit( YY_EXIT_FAILURE );
2035 }
2036
2037 /* Redefine yyless() so it works in section 3 code. */
2038
2039 #undef yyless
2040 #define yyless(n) \
2041 do \
2042 { \
2043 /* Undo effects of setting up c_text. */ \
2044 int yyless_macro_arg = (n); \
2045 YY_LESS_LINENO(yyless_macro_arg);\
2046 c_text[c_leng] = (yy_hold_char); \
2047 (yy_c_buf_p) = c_text + yyless_macro_arg; \
2048 (yy_hold_char) = *(yy_c_buf_p); \
2049 *(yy_c_buf_p) = '\0'; \
2050 c_leng = yyless_macro_arg; \
2051 } \
2052 while ( 0 )
2053
2054 /* Accessor methods (get/set functions) to struct members. */
2055
2056 /** Get the current line number.
2057 *
2058 */
2059 int c_get_lineno (void)
2060 {
2061
2062 return c_lineno;
2063 }
2064
2065 /** Get the input stream.
2066 *
2067 */
2068 FILE *c_get_in (void)
2069 {
2070 return c_in;
2071 }
2072
2073 /** Get the output stream.
2074 *
2075 */
2076 FILE *c_get_out (void)
2077 {
2078 return c_out;
2079 }
2080
2081 /** Get the length of the current token.
2082 *
2083 */
2084 int c_get_leng (void)
2085 {
2086 return c_leng;
2087 }
2088
2089 /** Get the current token.
2090 *
2091 */
2092
2093 char *c_get_text (void)
2094 {
2095 return c_text;
2096 }
2097
2098 /** Set the current line number.
2099 * @param line_number
2100 *
2101 */
2102 void c_set_lineno (int line_number )
2103 {
2104
2105 c_lineno = line_number;
2106 }
2107
2108 /** Set the input stream. This does not discard the current
2109 * input buffer.
2110 * @param in_str A readable stream.
2111 *
2112 * @see c__switch_to_buffer
2113 */
2114 void c_set_in (FILE * in_str )
2115 {
2116 c_in = in_str ;
2117 }
2118
2119 void c_set_out (FILE * out_str )
2120 {
2121 c_out = out_str ;
2122 }
2123
2124 int c_get_debug (void)
2125 {
2126 return c__flex_debug;
2127 }
2128
2129 void c_set_debug (int bdebug )
2130 {
2131 c__flex_debug = bdebug ;
2132 }
2133
2134 static int yy_init_globals (void)
2135 {
2136 /* Initialization is the same as for the non-reentrant scanner.
2137 * This function is called from c_lex_destroy(), so don't allocate here.
2138 */
2139
2140 (yy_buffer_stack) = 0;
2141 (yy_buffer_stack_top) = 0;
2142 (yy_buffer_stack_max) = 0;
2143 (yy_c_buf_p) = (char *) 0;
2144 (yy_init) = 0;
2145 (yy_start) = 0;
2146
2147 (yy_start_stack_ptr) = 0;
2148 (yy_start_stack_depth) = 0;
2149 (yy_start_stack) = NULL;
2150
2151 /* Defined in main.c */
2152 #ifdef YY_STDINIT
2153 c_in = stdin;
2154 c_out = stdout;
2155 #else
2156 c_in = (FILE *) 0;
2157 c_out = (FILE *) 0;
2158 #endif
2159
2160 /* For future reference: Set errno on error, since we are called by
2161 * c_lex_init()
2162 */
2163 return 0;
2164 }
2165
2166 /* c_lex_destroy is for both reentrant and non-reentrant scanners. */
2167 int c_lex_destroy (void)
2168 {
2169
2170 /* Pop the buffer stack, destroying each element. */
2171 while(YY_CURRENT_BUFFER){
2172 c__delete_buffer(YY_CURRENT_BUFFER );
2173 YY_CURRENT_BUFFER_LVALUE = NULL;
2174 c_pop_buffer_state();
2175 }
2176
2177 /* Destroy the stack itself. */
2178 c_free((yy_buffer_stack) );
2179 (yy_buffer_stack) = NULL;
2180
2181 /* Destroy the start condition stack. */
2182 c_free((yy_start_stack) );
2183 (yy_start_stack) = NULL;
2184
2185 /* Reset the globals. This is important in a non-reentrant scanner so the next time
2186 * c_lex() is called, initialization will occur. */
2187 yy_init_globals( );
2188
2189 return 0;
2190 }
2191
2192 /*
2193 * Internal utility routines.
2194 */
2195
2196 #ifndef yytext_ptr
2197 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
2198 {
2199 register int i;
2200 for ( i = 0; i < n; ++i )
2201 s1[i] = s2[i];
2202 }
2203 #endif
2204
2205 #ifdef YY_NEED_STRLEN
2206 static int yy_flex_strlen (yyconst char * s )
2207 {
2208 register int n;
2209 for ( n = 0; s[n]; ++n )
2210 ;
2211
2212 return n;
2213 }
2214 #endif
2215
2216 void *c_alloc (yy_size_t size )
2217 {
2218 return (void *) malloc( size );
2219 }
2220
2221 void *c_realloc (void * ptr, yy_size_t size )
2222 {
2223 /* The cast to (char *) in the following accommodates both
2224 * implementations that use char* generic pointers, and those
2225 * that use void* generic pointers. It works with the latter
2226 * because both ANSI C and C++ allow castless assignment from
2227 * any pointer type to void*, and deal with argument conversions
2228 * as though doing an assignment.
2229 */
2230 return (void *) realloc( (char *) ptr, size );
2231 }
2232
2233 void c_free (void * ptr )
2234 {
2235 free( (char *) ptr ); /* see c_realloc() for (char *) cast */
2236 }
2237
2238 #define YYTABLES_NAME "yytables"
2239
2240 #line 237 "c.l"
2241
2242
2243 void
2244 c_parser_init(FILE *ip)
2245 {
2246 newline_terminate_string = 1;
2247 DEFAULT_BEGIN_OF_FILE_ACTION
2248 BEGIN C;
2249 }
2250
2251 void
2252 yacc_parser_init(FILE *ip)
2253 {
2254 newline_terminate_string = 1;
2255 DEFAULT_BEGIN_OF_FILE_ACTION
2256 BEGIN YACC_DECLARATIONS;
2257 }
2258
/* */