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