Merge remote-tracking branch 'origin/release-v4.6.1'
[WRF.git] / var / da / makedepf90-2.8.8 / lexer.c
blob24b99acd62344c41e804917aa394bfcd2e33f4f0
2 #line 3 "<stdout>"
4 #define YY_INT_ALIGNED short int
6 /* A lexical scanner generated by flex */
8 #define FLEX_SCANNER
9 #define YY_FLEX_MAJOR_VERSION 2
10 #define YY_FLEX_MINOR_VERSION 5
11 #define YY_FLEX_SUBMINOR_VERSION 33
12 #if YY_FLEX_SUBMINOR_VERSION > 0
13 #define FLEX_BETA
14 #endif
16 /* First, we deal with platform-specific or compiler-specific issues. */
18 /* begin standard C headers. */
19 #include <stdio.h>
20 #include <string.h>
21 #include <errno.h>
22 #include <stdlib.h>
24 /* end standard C headers. */
26 /* flex integer type definitions */
28 #ifndef FLEXINT_H
29 #define FLEXINT_H
31 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
33 #if __STDC_VERSION__ >= 199901L
35 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
36 * if you want the limit (max/min) macros for int types.
38 #ifndef __STDC_LIMIT_MACROS
39 #define __STDC_LIMIT_MACROS 1
40 #endif
42 #include <inttypes.h>
43 typedef int8_t flex_int8_t;
44 typedef uint8_t flex_uint8_t;
45 typedef int16_t flex_int16_t;
46 typedef uint16_t flex_uint16_t;
47 typedef int32_t flex_int32_t;
48 typedef uint32_t flex_uint32_t;
49 #else
50 typedef signed char flex_int8_t;
51 typedef short int flex_int16_t;
52 typedef int flex_int32_t;
53 typedef unsigned char flex_uint8_t;
54 typedef unsigned short int flex_uint16_t;
55 typedef unsigned int flex_uint32_t;
56 #endif /* ! C99 */
58 /* Limits of integral types. */
59 #ifndef INT8_MIN
60 #define INT8_MIN (-128)
61 #endif
62 #ifndef INT16_MIN
63 #define INT16_MIN (-32767-1)
64 #endif
65 #ifndef INT32_MIN
66 #define INT32_MIN (-2147483647-1)
67 #endif
68 #ifndef INT8_MAX
69 #define INT8_MAX (127)
70 #endif
71 #ifndef INT16_MAX
72 #define INT16_MAX (32767)
73 #endif
74 #ifndef INT32_MAX
75 #define INT32_MAX (2147483647)
76 #endif
77 #ifndef UINT8_MAX
78 #define UINT8_MAX (255U)
79 #endif
80 #ifndef UINT16_MAX
81 #define UINT16_MAX (65535U)
82 #endif
83 #ifndef UINT32_MAX
84 #define UINT32_MAX (4294967295U)
85 #endif
87 #endif /* ! FLEXINT_H */
89 #ifdef __cplusplus
91 /* The "const" storage-class-modifier is valid. */
92 #define YY_USE_CONST
94 #else /* ! __cplusplus */
96 #if __STDC__
98 #define YY_USE_CONST
100 #endif /* __STDC__ */
101 #endif /* ! __cplusplus */
103 #ifdef YY_USE_CONST
104 #define yyconst const
105 #else
106 #define yyconst
107 #endif
109 /* Returned upon end-of-file. */
110 #define YY_NULL 0
112 /* Promotes a possibly negative, possibly signed char to an unsigned
113 * integer for use as an array index. If the signed char is negative,
114 * we want to instead treat it as an 8-bit unsigned char, hence the
115 * double cast.
117 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
119 /* Enter a start condition. This macro really ought to take a parameter,
120 * but we do it the disgusting crufty way forced on us by the ()-less
121 * definition of BEGIN.
123 #define BEGIN (yy_start) = 1 + 2 *
125 /* Translate the current start state into a value that can be later handed
126 * to BEGIN to return to the state. The YYSTATE alias is for lex
127 * compatibility.
129 #define YY_START (((yy_start) - 1) / 2)
130 #define YYSTATE YY_START
132 /* Action number for EOF rule of a given start state. */
133 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
135 /* Special action meaning "start processing a new file". */
136 #define YY_NEW_FILE yyrestart(yyin )
138 #define YY_END_OF_BUFFER_CHAR 0
140 /* Size of default input buffer. */
141 #ifndef YY_BUF_SIZE
142 #define YY_BUF_SIZE 16384
143 #endif
145 /* The state buf must be large enough to hold one state per character in the main buffer.
147 #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
149 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
150 #define YY_TYPEDEF_YY_BUFFER_STATE
151 typedef struct yy_buffer_state *YY_BUFFER_STATE;
152 #endif
154 extern int yyleng;
156 extern FILE *yyin, *yyout;
158 #define EOB_ACT_CONTINUE_SCAN 0
159 #define EOB_ACT_END_OF_FILE 1
160 #define EOB_ACT_LAST_MATCH 2
162 /* Note: We specifically omit the test for yy_rule_can_match_eol because it requires
163 * access to the local variable yy_act. Since yyless() is a macro, it would break
164 * existing scanners that call yyless() from OUTSIDE yylex.
165 * One obvious solution it to make yy_act a global. I tried that, and saw
166 * a 5% performance hit in a non-yylineno scanner, because yy_act is
167 * normally declared as a register variable-- so it is not worth it.
169 #define YY_LESS_LINENO(n) \
170 do { \
171 int yyl;\
172 for ( yyl = n; yyl < yyleng; ++yyl )\
173 if ( yytext[yyl] == '\n' )\
174 --yylineno;\
175 }while(0)
177 /* Return all but the first "n" matched characters back to the input stream. */
178 #define yyless(n) \
179 do \
181 /* Undo effects of setting up yytext. */ \
182 int yyless_macro_arg = (n); \
183 YY_LESS_LINENO(yyless_macro_arg);\
184 *yy_cp = (yy_hold_char); \
185 YY_RESTORE_YY_MORE_OFFSET \
186 (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
187 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
189 while ( 0 )
191 #define unput(c) yyunput( c, (yytext_ptr) )
193 /* The following is because we cannot portably get our hands on size_t
194 * (without autoconf's help, which isn't available because we want
195 * flex-generated scanners to compile on their own).
198 #ifndef YY_TYPEDEF_YY_SIZE_T
199 #define YY_TYPEDEF_YY_SIZE_T
200 typedef unsigned int yy_size_t;
201 #endif
203 #ifndef YY_STRUCT_YY_BUFFER_STATE
204 #define YY_STRUCT_YY_BUFFER_STATE
205 struct yy_buffer_state
207 FILE *yy_input_file;
209 char *yy_ch_buf; /* input buffer */
210 char *yy_buf_pos; /* current position in input buffer */
212 /* Size of input buffer in bytes, not including room for EOB
213 * characters.
215 yy_size_t yy_buf_size;
217 /* Number of characters read into yy_ch_buf, not including EOB
218 * characters.
220 int yy_n_chars;
222 /* Whether we "own" the buffer - i.e., we know we created it,
223 * and can realloc() it to grow it, and should free() it to
224 * delete it.
226 int yy_is_our_buffer;
228 /* Whether this is an "interactive" input source; if so, and
229 * if we're using stdio for input, then we want to use getc()
230 * instead of fread(), to make sure we stop fetching input after
231 * each newline.
233 int yy_is_interactive;
235 /* Whether we're considered to be at the beginning of a line.
236 * If so, '^' rules will be active on the next match, otherwise
237 * not.
239 int yy_at_bol;
241 int yy_bs_lineno; /**< The line count. */
242 int yy_bs_column; /**< The column count. */
244 /* Whether to try to fill the input buffer when we reach the
245 * end of it.
247 int yy_fill_buffer;
249 int yy_buffer_status;
251 #define YY_BUFFER_NEW 0
252 #define YY_BUFFER_NORMAL 1
253 /* When an EOF's been seen but there's still some text to process
254 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
255 * shouldn't try reading from the input source any more. We might
256 * still have a bunch of tokens to match, though, because of
257 * possible backing-up.
259 * When we actually see the EOF, we change the status to "new"
260 * (via yyrestart()), so that the user can continue scanning by
261 * just pointing yyin at a new input file.
263 #define YY_BUFFER_EOF_PENDING 2
266 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
268 /* Stack of input buffers. */
269 static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
270 static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
271 static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
273 /* We provide macros for accessing buffer states in case in the
274 * future we want to put the buffer states in a more general
275 * "scanner state".
277 * Returns the top of the stack, or NULL.
279 #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
280 ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
281 : NULL)
283 /* Same as previous macro, but useful when we know that the buffer stack is not
284 * NULL or when we need an lvalue. For internal use only.
286 #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
288 /* yy_hold_char holds the character lost when yytext is formed. */
289 static char yy_hold_char;
290 static int yy_n_chars; /* number of characters read into yy_ch_buf */
291 int yyleng;
293 /* Points to current character in buffer. */
294 static char *yy_c_buf_p = (char *) 0;
295 static int yy_init = 0; /* whether we need to initialize */
296 static int yy_start = 0; /* start state number */
298 /* Flag which is used to allow yywrap()'s to do buffer switches
299 * instead of setting up a fresh yyin. A bit of a hack ...
301 static int yy_did_buffer_switch_on_eof;
303 void yyrestart (FILE *input_file );
304 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer );
305 YY_BUFFER_STATE yy_create_buffer (FILE *file,int size );
306 void yy_delete_buffer (YY_BUFFER_STATE b );
307 void yy_flush_buffer (YY_BUFFER_STATE b );
308 void yypush_buffer_state (YY_BUFFER_STATE new_buffer );
309 void yypop_buffer_state (void );
311 static void yyensure_buffer_stack (void );
312 static void yy_load_buffer_state (void );
313 static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file );
315 #define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER )
317 YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size );
318 YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str );
319 YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len );
321 void *yyalloc (yy_size_t );
322 void *yyrealloc (void *,yy_size_t );
323 void yyfree (void * );
325 #define yy_new_buffer yy_create_buffer
327 #define yy_set_interactive(is_interactive) \
329 if ( ! YY_CURRENT_BUFFER ){ \
330 yyensure_buffer_stack (); \
331 YY_CURRENT_BUFFER_LVALUE = \
332 yy_create_buffer(yyin,YY_BUF_SIZE ); \
334 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
337 #define yy_set_bol(at_bol) \
339 if ( ! YY_CURRENT_BUFFER ){\
340 yyensure_buffer_stack (); \
341 YY_CURRENT_BUFFER_LVALUE = \
342 yy_create_buffer(yyin,YY_BUF_SIZE ); \
344 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
347 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
349 /* Begin user sect3 */
351 typedef unsigned char YY_CHAR;
353 FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
355 typedef int yy_state_type;
357 extern int yylineno;
359 int yylineno = 1;
361 extern char *yytext;
362 #define yytext_ptr yytext
364 static yy_state_type yy_get_previous_state (void );
365 static yy_state_type yy_try_NUL_trans (yy_state_type current_state );
366 static int yy_get_next_buffer (void );
367 static void yy_fatal_error (yyconst char msg[] );
369 /* Done after the current pattern has been matched and before the
370 * corresponding action - sets up yytext.
372 #define YY_DO_BEFORE_ACTION \
373 (yytext_ptr) = yy_bp; \
374 yyleng = (size_t) (yy_cp - yy_bp); \
375 (yy_hold_char) = *yy_cp; \
376 *yy_cp = '\0'; \
377 (yy_c_buf_p) = yy_cp;
379 #define YY_NUM_RULES 41
380 #define YY_END_OF_BUFFER 42
381 /* This struct is not used in this scanner,
382 but its presence is necessary. */
383 struct yy_trans_info
385 flex_int32_t yy_verify;
386 flex_int32_t yy_nxt;
388 static yyconst flex_int16_t yy_accept[157] =
389 { 0,
390 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
391 42, 36, 38, 37, 10, 1, 36, 36, 31, 2,
392 37, 34, 36, 36, 35, 35, 37, 36, 35, 9,
393 8, 9, 4, 3, 36, 10, 0, 0, 0, 0,
394 0, 0, 0, 0, 0, 0, 31, 31, 32, 34,
395 36, 0, 39, 35, 35, 0, 36, 0, 11, 35,
396 0, 0, 5, 0, 0, 0, 0, 0, 0, 0,
397 0, 0, 27, 0, 0, 31, 31, 31, 31, 0,
398 0, 0, 0, 0, 6, 0, 0, 0, 0, 21,
399 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
401 0, 0, 0, 0, 0, 0, 0, 23, 0, 21,
402 0, 0, 0, 0, 0, 28, 29, 0, 0, 0,
403 0, 0, 0, 0, 0, 0, 22, 24, 19, 0,
404 0, 17, 0, 30, 25, 0, 0, 18, 0, 0,
405 0, 15, 22, 20, 0, 16, 26, 0, 0, 33,
406 7, 12, 13, 0, 14, 0
409 static yyconst flex_int32_t yy_ec[256] =
410 { 0,
411 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
412 1, 1, 4, 1, 1, 1, 1, 1, 1, 1,
413 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
414 1, 5, 6, 7, 8, 9, 1, 10, 11, 1,
415 1, 12, 1, 4, 1, 1, 1, 13, 13, 13,
416 13, 13, 13, 13, 13, 13, 13, 1, 14, 1,
417 15, 16, 17, 1, 20, 20, 21, 22, 23, 24,
418 20, 20, 25, 20, 20, 26, 20, 27, 20, 20,
419 20, 20, 28, 20, 29, 20, 20, 20, 20, 20,
420 1, 18, 1, 1, 19, 1, 20, 20, 21, 22,
422 23, 24, 20, 20, 25, 20, 20, 26, 20, 27,
423 20, 20, 20, 20, 28, 20, 29, 20, 20, 20,
424 20, 20, 1, 1, 1, 1, 1, 1, 1, 1,
425 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
426 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
427 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
428 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
429 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
430 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
431 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
433 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
434 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
435 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
436 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
437 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
438 1, 1, 1, 1, 1
441 static yyconst flex_int32_t yy_meta[30] =
442 { 0,
443 1, 2, 3, 4, 5, 6, 4, 1, 1, 6,
444 4, 1, 7, 4, 4, 1, 1, 1, 7, 8,
445 8, 8, 8, 8, 8, 8, 8, 8, 8
448 static yyconst flex_int16_t yy_base[168] =
449 { 0,
450 0, 0, 0, 0, 221, 27, 30, 32, 43, 44,
451 223, 0, 384, 384, 0, 384, 53, 81, 26, 384,
452 384, 206, 204, 54, 110, 0, 215, 139, 156, 384,
453 214, 58, 384, 384, 0, 0, 184, 195, 11, 7,
454 189, 212, 192, 18, 38, 185, 58, 240, 384, 384,
455 64, 68, 384, 0, 0, 206, 250, 207, 384, 0,
456 203, 82, 86, 181, 49, 182, 90, 182, 180, 177,
457 65, 178, 45, 178, 176, 268, 277, 286, 295, 95,
458 170, 191, 190, 97, 384, 169, 169, 169, 166, 0,
459 167, 166, 161, 151, 148, 148, 148, 145, 145, 145,
461 140, 142, 143, 158, 157, 134, 96, 384, 136, 0,
462 130, 130, 121, 125, 119, 384, 384, 121, 120, 120,
463 112, 101, 98, 116, 111, 92, 0, 384, 384, 90,
464 91, 384, 86, 384, 384, 84, 83, 384, 65, 0,
465 0, 384, 0, 384, 58, 384, 384, 57, 57, 384,
466 384, 384, 384, 29, 384, 384, 305, 313, 320, 327,
467 327, 335, 343, 351, 359, 367, 375
470 static yyconst flex_int16_t yy_def[168] =
471 { 0,
472 156, 1, 1, 1, 1, 1, 157, 157, 157, 157,
473 156, 158, 156, 156, 159, 156, 158, 158, 160, 156,
474 156, 156, 158, 158, 156, 161, 156, 162, 162, 156,
475 156, 156, 156, 156, 158, 159, 156, 156, 156, 156,
476 156, 156, 156, 156, 156, 156, 160, 163, 156, 156,
477 158, 156, 156, 25, 161, 156, 162, 162, 156, 29,
478 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
479 156, 156, 156, 156, 156, 163, 163, 163, 163, 156,
480 156, 156, 156, 156, 156, 156, 156, 156, 156, 164,
481 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
483 156, 156, 156, 156, 156, 156, 156, 156, 156, 164,
484 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
485 156, 156, 156, 156, 156, 156, 165, 156, 156, 156,
486 156, 156, 156, 156, 156, 156, 156, 156, 156, 166,
487 167, 156, 165, 156, 156, 156, 156, 156, 156, 156,
488 156, 156, 156, 156, 156, 0, 156, 156, 156, 156,
489 156, 156, 156, 156, 156, 156, 156
492 static yyconst flex_int16_t yy_nxt[414] =
493 { 0,
494 12, 13, 14, 13, 13, 15, 16, 17, 18, 19,
495 20, 12, 12, 21, 22, 12, 23, 24, 25, 26,
496 26, 26, 26, 26, 26, 26, 26, 26, 26, 27,
497 67, 48, 31, 68, 31, 49, 65, 66, 28, 32,
498 33, 32, 33, 71, 72, 31, 31, 29, 29, 34,
499 34, 155, 32, 32, 37, 52, 53, 37, 52, 62,
500 63, 73, 62, 48, 74, 80, 99, 49, 80, 52,
501 53, 100, 52, 87, 38, 39, 88, 40, 154, 153,
502 152, 41, 42, 62, 63, 42, 62, 84, 81, 96,
503 84, 90, 97, 149, 90, 85, 80, 127, 84, 80,
505 127, 84, 43, 44, 148, 45, 85, 147, 146, 46,
506 35, 91, 145, 144, 142, 141, 92, 35, 35, 81,
507 140, 35, 54, 139, 138, 35, 35, 35, 54, 55,
508 55, 55, 55, 55, 55, 55, 55, 55, 55, 57,
509 137, 59, 136, 135, 134, 133, 57, 57, 132, 131,
510 57, 57, 130, 129, 57, 57, 57, 57, 59, 128,
511 126, 125, 124, 123, 122, 121, 120, 119, 60, 118,
512 117, 116, 115, 114, 60, 60, 60, 60, 60, 60,
513 60, 60, 60, 60, 60, 37, 113, 112, 37, 111,
514 109, 108, 107, 106, 105, 104, 103, 102, 101, 98,
516 95, 94, 93, 89, 86, 38, 39, 83, 40, 59,
517 82, 75, 41, 42, 70, 69, 42, 64, 61, 56,
518 51, 50, 156, 27, 156, 156, 156, 156, 156, 156,
519 156, 156, 156, 43, 44, 156, 45, 156, 156, 156,
520 46, 77, 47, 156, 77, 78, 156, 156, 156, 79,
521 57, 156, 59, 156, 156, 156, 156, 57, 57, 156,
522 156, 57, 57, 156, 156, 57, 57, 57, 57, 77,
523 47, 156, 77, 78, 156, 156, 156, 79, 77, 47,
524 156, 77, 78, 156, 156, 156, 79, 77, 47, 156,
525 77, 78, 156, 156, 156, 79, 77, 47, 156, 77,
527 78, 156, 156, 156, 79, 30, 30, 30, 30, 30,
528 30, 30, 30, 35, 156, 156, 156, 156, 156, 35,
529 36, 36, 156, 36, 36, 36, 36, 36, 47, 47,
530 156, 47, 47, 55, 55, 58, 58, 58, 58, 58,
531 58, 58, 58, 76, 76, 76, 76, 76, 76, 76,
532 76, 110, 110, 156, 110, 110, 110, 110, 110, 143,
533 143, 156, 143, 143, 143, 143, 143, 150, 150, 150,
534 150, 156, 150, 150, 150, 151, 156, 156, 151, 156,
535 151, 151, 151, 11, 156, 156, 156, 156, 156, 156,
536 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
538 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
539 156, 156, 156
542 static yyconst flex_int16_t yy_chk[414] =
543 { 0,
544 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
545 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
546 1, 1, 1, 1, 1, 1, 1, 1, 1, 6,
547 40, 19, 7, 40, 8, 19, 39, 39, 6, 7,
548 7, 8, 8, 44, 44, 9, 10, 6, 6, 9,
549 10, 154, 9, 10, 17, 24, 24, 17, 24, 32,
550 32, 45, 32, 47, 45, 51, 73, 47, 51, 52,
551 52, 73, 52, 65, 17, 17, 65, 17, 149, 148,
552 145, 17, 18, 62, 62, 18, 62, 63, 51, 71,
553 63, 67, 71, 139, 67, 63, 80, 107, 84, 80,
555 107, 84, 18, 18, 137, 18, 84, 136, 133, 18,
556 25, 67, 131, 130, 126, 125, 67, 25, 25, 80,
557 124, 25, 25, 123, 122, 25, 25, 25, 25, 25,
558 25, 25, 25, 25, 25, 25, 25, 25, 25, 28,
559 121, 28, 120, 119, 118, 115, 28, 28, 114, 113,
560 28, 28, 112, 111, 28, 28, 28, 28, 29, 109,
561 106, 105, 104, 103, 102, 101, 100, 99, 29, 98,
562 97, 96, 95, 94, 29, 29, 29, 29, 29, 29,
563 29, 29, 29, 29, 29, 37, 93, 92, 37, 91,
564 89, 88, 87, 86, 83, 82, 81, 75, 74, 72,
566 70, 69, 68, 66, 64, 37, 37, 61, 37, 58,
567 56, 46, 37, 42, 43, 41, 42, 38, 31, 27,
568 23, 22, 11, 5, 0, 0, 0, 0, 0, 0,
569 0, 0, 0, 42, 42, 0, 42, 0, 0, 0,
570 42, 48, 48, 0, 48, 48, 0, 0, 0, 48,
571 57, 0, 57, 0, 0, 0, 0, 57, 57, 0,
572 0, 57, 57, 0, 0, 57, 57, 57, 57, 76,
573 76, 0, 76, 76, 0, 0, 0, 76, 77, 77,
574 0, 77, 77, 0, 0, 0, 77, 78, 78, 0,
575 78, 78, 0, 0, 0, 78, 79, 79, 0, 79,
577 79, 0, 0, 0, 79, 157, 157, 157, 157, 157,
578 157, 157, 157, 158, 0, 0, 0, 0, 0, 158,
579 159, 159, 0, 159, 159, 159, 159, 159, 160, 160,
580 0, 160, 160, 161, 161, 162, 162, 162, 162, 162,
581 162, 162, 162, 163, 163, 163, 163, 163, 163, 163,
582 163, 164, 164, 0, 164, 164, 164, 164, 164, 165,
583 165, 0, 165, 165, 165, 165, 165, 166, 166, 166,
584 166, 0, 166, 166, 166, 167, 0, 0, 167, 0,
585 167, 167, 167, 156, 156, 156, 156, 156, 156, 156,
586 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
588 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
589 156, 156, 156
592 /* Table of booleans, true if rule could match eol. */
593 static yyconst flex_int32_t yy_rule_can_match_eol[42] =
594 { 0,
595 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,
596 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1,
597 0, 0, };
599 static yy_state_type yy_last_accepting_state;
600 static char *yy_last_accepting_cpos;
602 extern int yy_flex_debug;
603 int yy_flex_debug = 0;
605 /* The intent behind this definition is that it'll catch
606 * any uses of REJECT which flex missed.
608 #define REJECT reject_used_but_not_detected
609 #define yymore() yymore_used_but_not_detected
610 #define YY_MORE_ADJ 0
611 #define YY_RESTORE_YY_MORE_OFFSET
612 char *yytext;
613 #line 1 "lexer.l"
614 #line 2 "lexer.l"
616 * Copyright (C) 2000-2006 Erik Edelmann <Erik.Edelmann@iki.fi>
618 * This program is free software; you can redistribute it
619 * and/or modify it under the terms of the GNU General Public
620 * License version 2 as published by the Free Software
621 * Foundation.
623 * This program is distributed in the hope that it will be
624 * useful, but WITHOUT ANY WARRANTY; without even the implied
625 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
626 * PURPOSE. See the GNU General Public License for more
627 * details.
629 * You should have received a copy of the GNU General Public
630 * License along with this program; if not, write to the Free
631 * Software Foundation, Inc., 59 Temple Place, Suite 330,
632 * Boston, MA 02111-1307 USA
636 #include <string.h>
637 #include <errno.h>
638 #include <assert.h>
639 #include "global.h"
640 #include "errormesg.h"
641 #include "find_dep.h"
642 #include "utils.h"
643 #include "xmalloc.h"
645 void yy_push_state(int new_state);
646 void yy_pop_state();
647 void pop_filestack();
650 static YY_BUFFER_STATE include_stack[INCLUDE_RECURSION_LIMIT];
651 static int line_num_stack[INCLUDE_RECURSION_LIMIT];
652 static int incl_buff = 0;
654 static char string_buf[MAX_STRING_LEN];
655 static char *string_buf_ptr;
657 static int old_startcond;
659 static int last_returned;
661 #define RETURN(n) last_returned = n; return n;
666 #line 667 "<stdout>"
668 #define INITIAL 0
669 #define free_fmt 1
670 #define fixed_fmt 2
671 #define str_sq 3
672 #define str_dq 4
674 #ifndef YY_NO_UNISTD_H
675 /* Special case for "unistd.h", since it is non-ANSI. We include it way
676 * down here because we want the user's section 1 to have been scanned first.
677 * The user has a chance to override it with an option.
679 #include <unistd.h>
680 #endif
682 #ifndef YY_EXTRA_TYPE
683 #define YY_EXTRA_TYPE void *
684 #endif
686 static int yy_init_globals (void );
688 /* Macros after this point can all be overridden by user definitions in
689 * section 1.
692 #ifndef YY_SKIP_YYWRAP
693 #ifdef __cplusplus
694 extern "C" int yywrap (void );
695 #else
696 extern int yywrap (void );
697 #endif
698 #endif
700 static void yyunput (int c,char *buf_ptr );
702 #ifndef yytext_ptr
703 static void yy_flex_strncpy (char *,yyconst char *,int );
704 #endif
706 #ifdef YY_NEED_STRLEN
707 static int yy_flex_strlen (yyconst char * );
708 #endif
710 #ifndef YY_NO_INPUT
712 #ifdef __cplusplus
713 static int yyinput (void );
714 #else
715 static int input (void );
716 #endif
718 #endif
720 /* Amount of stuff to slurp up with each read. */
721 #ifndef YY_READ_BUF_SIZE
722 #define YY_READ_BUF_SIZE 8192
723 #endif
725 /* Copy whatever the last rule matched to the standard output. */
726 #ifndef ECHO
727 /* This used to be an fputs(), but since the string might contain NUL's,
728 * we now use fwrite().
730 #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
731 #endif
733 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
734 * is returned in "result".
736 #ifndef YY_INPUT
737 #define YY_INPUT(buf,result,max_size) \
738 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
740 int c = '*'; \
741 size_t n; \
742 for ( n = 0; n < max_size && \
743 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
744 buf[n] = (char) c; \
745 if ( c == '\n' ) \
746 buf[n++] = (char) c; \
747 if ( c == EOF && ferror( yyin ) ) \
748 YY_FATAL_ERROR( "input in flex scanner failed" ); \
749 result = n; \
751 else \
753 errno=0; \
754 while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
756 if( errno != EINTR) \
758 YY_FATAL_ERROR( "input in flex scanner failed" ); \
759 break; \
761 errno=0; \
762 clearerr(yyin); \
767 #endif
769 /* No semi-colon after return; correct usage is to write "yyterminate();" -
770 * we don't want an extra ';' after the "return" because that will cause
771 * some compilers to complain about unreachable statements.
773 #ifndef yyterminate
774 #define yyterminate() return YY_NULL
775 #endif
777 /* Number of entries by which start-condition stack grows. */
778 #ifndef YY_START_STACK_INCR
779 #define YY_START_STACK_INCR 25
780 #endif
782 /* Report a fatal error. */
783 #ifndef YY_FATAL_ERROR
784 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
785 #endif
787 /* end tables serialization structures and prototypes */
789 /* Default declaration of generated scanner - a define so the user can
790 * easily add parameters.
792 #ifndef YY_DECL
793 #define YY_DECL_IS_OURS 1
795 extern int yylex (void);
797 #define YY_DECL int yylex (void)
798 #endif /* !YY_DECL */
800 /* Code executed at the beginning of each rule, after yytext and yyleng
801 * have been set up.
803 #ifndef YY_USER_ACTION
804 #define YY_USER_ACTION
805 #endif
807 /* Code executed at the end of each rule. */
808 #ifndef YY_BREAK
809 #define YY_BREAK break;
810 #endif
812 #define YY_RULE_SETUP \
813 if ( yyleng > 0 ) \
814 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \
815 (yytext[yyleng - 1] == '\n'); \
816 YY_USER_ACTION
818 /** The main scanner function which does all the work.
820 YY_DECL
822 register yy_state_type yy_current_state;
823 register char *yy_cp, *yy_bp;
824 register int yy_act;
826 #line 58 "lexer.l"
830 #line 831 "<stdout>"
832 if ( !(yy_init) )
834 (yy_init) = 1;
836 #ifdef YY_USER_INIT
837 YY_USER_INIT;
838 #endif
840 if ( ! (yy_start) )
841 (yy_start) = 1; /* first start state */
843 if ( ! yyin )
844 yyin = stdin;
846 if ( ! yyout )
847 yyout = stdout;
849 if ( ! YY_CURRENT_BUFFER ) {
850 yyensure_buffer_stack ();
851 YY_CURRENT_BUFFER_LVALUE =
852 yy_create_buffer(yyin,YY_BUF_SIZE );
855 yy_load_buffer_state( );
858 while ( 1 ) /* loops until end-of-file is reached */
860 yy_cp = (yy_c_buf_p);
862 /* Support of yytext. */
863 *yy_cp = (yy_hold_char);
865 /* yy_bp points to the position in yy_ch_buf of the start of
866 * the current run.
868 yy_bp = yy_cp;
870 yy_current_state = (yy_start);
871 yy_current_state += YY_AT_BOL();
872 yy_match:
875 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
876 if ( yy_accept[yy_current_state] )
878 (yy_last_accepting_state) = yy_current_state;
879 (yy_last_accepting_cpos) = yy_cp;
881 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
883 yy_current_state = (int) yy_def[yy_current_state];
884 if ( yy_current_state >= 157 )
885 yy_c = yy_meta[(unsigned int) yy_c];
887 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
888 ++yy_cp;
890 while ( yy_current_state != 156 );
891 yy_cp = (yy_last_accepting_cpos);
892 yy_current_state = (yy_last_accepting_state);
894 yy_find_action:
895 yy_act = yy_accept[yy_current_state];
897 YY_DO_BEFORE_ACTION;
899 if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] )
901 int yyl;
902 for ( yyl = 0; yyl < yyleng; ++yyl )
903 if ( yytext[yyl] == '\n' )
905 yylineno++;
909 do_action: /* This label is used only to access EOF actions. */
911 switch ( yy_act )
912 { /* beginning of action switch */
913 case 0: /* must back up */
914 /* undo the effects of YY_DO_BEFORE_ACTION */
915 *yy_cp = (yy_hold_char);
916 yy_cp = (yy_last_accepting_cpos);
917 yy_current_state = (yy_last_accepting_state);
918 goto yy_find_action;
920 case 1:
921 YY_RULE_SETUP
922 #line 61 "lexer.l"
923 { string_buf_ptr = string_buf; old_startcond = YY_START;
924 BEGIN(str_dq); }
925 YY_BREAK
926 case 2:
927 YY_RULE_SETUP
928 #line 63 "lexer.l"
929 { string_buf_ptr = string_buf; old_startcond = YY_START;
930 BEGIN(str_sq); }
931 YY_BREAK
932 case 3:
933 #line 67 "lexer.l"
934 case 4:
935 YY_RULE_SETUP
936 #line 67 "lexer.l"
938 BEGIN(old_startcond);
939 *string_buf_ptr = '\0';
940 yylval.string = xstrdup(string_buf);
941 DEBUG_PRINT("string: '%s'\n", yylval.string);
942 RETURN(STRING);
944 YY_BREAK
945 case 5:
946 /* rule 5 can match eol */
947 #line 76 "lexer.l"
948 case 6:
949 /* rule 6 can match eol */
950 YY_RULE_SETUP
951 #line 76 "lexer.l"
952 /* Ignore (continued strings, free fmt) */
953 YY_BREAK
954 case 7:
955 /* rule 7 can match eol */
956 YY_RULE_SETUP
957 #line 78 "lexer.l"
959 if (old_startcond == fixed_fmt)
960 ; /* Ignore (cont. strings, fixed fmt) */
961 else
962 unput(yytext[strlen(yytext)-1]);
964 YY_BREAK
965 case 8:
966 /* rule 8 can match eol */
967 YY_RULE_SETUP
968 #line 85 "lexer.l"
970 unput ('\n');
971 BEGIN(old_startcond);
972 yylval.number = yylineno;
973 RETURN(UNTERMINATED_STRING);
975 YY_BREAK
976 case 9:
977 YY_RULE_SETUP
978 #line 92 "lexer.l"
979 { *string_buf_ptr++ = yytext[0]; }
980 YY_BREAK
981 case 10:
982 YY_RULE_SETUP
983 #line 97 "lexer.l"
984 { RETURN(EOSTMT); } /* Treat comments like */
985 YY_BREAK
986 case 11:
987 /* rule 11 can match eol */
988 YY_RULE_SETUP
989 #line 98 "lexer.l"
990 { RETURN(EOSTMT); } /* empty lines */
991 YY_BREAK
992 case 12:
993 YY_RULE_SETUP
994 #line 100 "lexer.l"
995 { RETURN(CPP_INCLUDE); }
996 YY_BREAK
997 case 13:
998 YY_RULE_SETUP
999 #line 101 "lexer.l"
1000 { RETURN(F90PPR_INCLUDE); }
1001 YY_BREAK
1002 case 14:
1003 YY_RULE_SETUP
1004 #line 102 "lexer.l"
1005 { RETURN(COCO_INCLUDE); }
1006 YY_BREAK
1007 case 15:
1008 YY_RULE_SETUP
1009 #line 104 "lexer.l"
1010 { RETURN(CPP_DEFINE); }
1011 YY_BREAK
1012 case 16:
1013 YY_RULE_SETUP
1014 #line 105 "lexer.l"
1015 { RETURN(F90PPR_DEFINE); }
1016 YY_BREAK
1017 case 17:
1018 YY_RULE_SETUP
1019 #line 107 "lexer.l"
1020 { RETURN(CPP_UNDEF); }
1021 YY_BREAK
1022 case 18:
1023 YY_RULE_SETUP
1024 #line 108 "lexer.l"
1025 { RETURN(F90PPR_UNDEF); }
1026 YY_BREAK
1027 case 19:
1028 YY_RULE_SETUP
1029 #line 110 "lexer.l"
1030 { RETURN(CPP_IFDEF); }
1031 YY_BREAK
1032 case 20:
1033 YY_RULE_SETUP
1034 #line 111 "lexer.l"
1035 { RETURN(CPP_IFNDEF); }
1036 YY_BREAK
1037 case 21:
1038 YY_RULE_SETUP
1039 #line 112 "lexer.l"
1040 { RETURN(CPP_IF); }
1041 YY_BREAK
1042 case 22:
1043 YY_RULE_SETUP
1044 #line 113 "lexer.l"
1045 { RETURN(CPP_ELIF); }
1046 YY_BREAK
1047 case 23:
1048 YY_RULE_SETUP
1049 #line 114 "lexer.l"
1050 { RETURN(CPP_ELSE); }
1051 YY_BREAK
1052 case 24:
1053 YY_RULE_SETUP
1054 #line 115 "lexer.l"
1055 { RETURN(CPP_ENDIF); }
1056 YY_BREAK
1057 case 25:
1058 YY_RULE_SETUP
1059 #line 117 "lexer.l"
1060 { RETURN(F90PPR_IFDEF); }
1061 YY_BREAK
1062 case 26:
1063 YY_RULE_SETUP
1064 #line 118 "lexer.l"
1065 { RETURN(F90PPR_IFNDEF); }
1066 YY_BREAK
1067 case 27:
1068 YY_RULE_SETUP
1069 #line 119 "lexer.l"
1070 { RETURN(F90PPR_IF); }
1071 YY_BREAK
1072 case 28:
1073 YY_RULE_SETUP
1074 #line 120 "lexer.l"
1075 { RETURN(F90PPR_ELIF); }
1076 YY_BREAK
1077 case 29:
1078 YY_RULE_SETUP
1079 #line 121 "lexer.l"
1080 { RETURN(F90PPR_ELSE); }
1081 YY_BREAK
1082 case 30:
1083 YY_RULE_SETUP
1084 #line 122 "lexer.l"
1085 { RETURN(F90PPR_ENDIF); }
1086 YY_BREAK
1087 /* Line continuations, possible involving comments. */
1088 case 31:
1089 /* rule 31 can match eol */
1090 YY_RULE_SETUP
1091 #line 125 "lexer.l"
1093 YY_BREAK
1094 case 32:
1095 /* rule 32 can match eol */
1096 YY_RULE_SETUP
1097 #line 126 "lexer.l"
1099 YY_BREAK
1100 case 33:
1101 /* rule 33 can match eol */
1102 YY_RULE_SETUP
1103 #line 128 "lexer.l"
1104 { RETURN(GARBAGE); }
1105 YY_BREAK
1106 case 34:
1107 YY_RULE_SETUP
1108 #line 130 "lexer.l"
1109 { RETURN(ASSIGNMENT_OP); }
1110 YY_BREAK
1111 case 35:
1112 YY_RULE_SETUP
1113 #line 132 "lexer.l"
1114 { ;yylval.string = xstrdup(yytext); RETURN(WORD); }
1115 YY_BREAK
1116 case 36:
1117 YY_RULE_SETUP
1118 #line 134 "lexer.l"
1119 { RETURN(GARBAGE); }
1120 YY_BREAK
1121 case 37:
1122 /* rule 37 can match eol */
1123 YY_RULE_SETUP
1124 #line 136 "lexer.l"
1125 { RETURN(EOSTMT); }
1126 YY_BREAK
1127 case 38:
1128 YY_RULE_SETUP
1129 #line 138 "lexer.l"
1130 /* Ignore */
1131 YY_BREAK
1132 case 39:
1133 /* rule 39 can match eol */
1134 YY_RULE_SETUP
1135 #line 139 "lexer.l"
1136 /* Ignore line-endings preceeded by \ */
1137 YY_BREAK
1138 case 40:
1139 YY_RULE_SETUP
1140 #line 141 "lexer.l"
1141 { RETURN(*yytext); }
1142 YY_BREAK
1143 case YY_STATE_EOF(INITIAL):
1144 case YY_STATE_EOF(free_fmt):
1145 case YY_STATE_EOF(fixed_fmt):
1146 case YY_STATE_EOF(str_sq):
1147 case YY_STATE_EOF(str_dq):
1148 #line 144 "lexer.l"
1150 DEBUG_PRINT("EOF reached %i\n", incl_buff);
1151 incl_buff--;
1152 if (incl_buff < 0) {
1153 if (last_returned == EOSTMT) {
1154 incl_buff = 0;
1155 yyterminate();
1156 } else {
1157 /* "EOF without \n first" cases. */
1158 RETURN(EOSTMT);
1160 } else {
1161 fclose(yyin);
1162 yy_delete_buffer(YY_CURRENT_BUFFER);
1163 yy_switch_to_buffer (include_stack[incl_buff]);
1164 yylineno = line_num_stack[incl_buff];
1165 pop_filestack();
1168 YY_BREAK
1169 case 41:
1170 YY_RULE_SETUP
1171 #line 164 "lexer.l"
1172 ECHO;
1173 YY_BREAK
1174 #line 1175 "<stdout>"
1176 case YY_END_OF_BUFFER:
1178 /* Amount of text matched not including the EOB char. */
1179 int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
1181 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1182 *yy_cp = (yy_hold_char);
1183 YY_RESTORE_YY_MORE_OFFSET
1185 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
1187 /* We're scanning a new file or input source. It's
1188 * possible that this happened because the user
1189 * just pointed yyin at a new source and called
1190 * yylex(). If so, then we have to assure
1191 * consistency between YY_CURRENT_BUFFER and our
1192 * globals. Here is the right place to do so, because
1193 * this is the first action (other than possibly a
1194 * back-up) that will match for the new input source.
1196 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1197 YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
1198 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
1201 /* Note that here we test for yy_c_buf_p "<=" to the position
1202 * of the first EOB in the buffer, since yy_c_buf_p will
1203 * already have been incremented past the NUL character
1204 * (since all states make transitions on EOB to the
1205 * end-of-buffer state). Contrast this with the test
1206 * in input().
1208 if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1209 { /* This was really a NUL. */
1210 yy_state_type yy_next_state;
1212 (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
1214 yy_current_state = yy_get_previous_state( );
1216 /* Okay, we're now positioned to make the NUL
1217 * transition. We couldn't have
1218 * yy_get_previous_state() go ahead and do it
1219 * for us because it doesn't know how to deal
1220 * with the possibility of jamming (and we don't
1221 * want to build jamming into it because then it
1222 * will run more slowly).
1225 yy_next_state = yy_try_NUL_trans( yy_current_state );
1227 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1229 if ( yy_next_state )
1231 /* Consume the NUL. */
1232 yy_cp = ++(yy_c_buf_p);
1233 yy_current_state = yy_next_state;
1234 goto yy_match;
1237 else
1239 yy_cp = (yy_last_accepting_cpos);
1240 yy_current_state = (yy_last_accepting_state);
1241 goto yy_find_action;
1245 else switch ( yy_get_next_buffer( ) )
1247 case EOB_ACT_END_OF_FILE:
1249 (yy_did_buffer_switch_on_eof) = 0;
1251 if ( yywrap( ) )
1253 /* Note: because we've taken care in
1254 * yy_get_next_buffer() to have set up
1255 * yytext, we can now set up
1256 * yy_c_buf_p so that if some total
1257 * hoser (like flex itself) wants to
1258 * call the scanner after we return the
1259 * YY_NULL, it'll still work - another
1260 * YY_NULL will get returned.
1262 (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
1264 yy_act = YY_STATE_EOF(YY_START);
1265 goto do_action;
1268 else
1270 if ( ! (yy_did_buffer_switch_on_eof) )
1271 YY_NEW_FILE;
1273 break;
1276 case EOB_ACT_CONTINUE_SCAN:
1277 (yy_c_buf_p) =
1278 (yytext_ptr) + yy_amount_of_matched_text;
1280 yy_current_state = yy_get_previous_state( );
1282 yy_cp = (yy_c_buf_p);
1283 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1284 goto yy_match;
1286 case EOB_ACT_LAST_MATCH:
1287 (yy_c_buf_p) =
1288 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
1290 yy_current_state = yy_get_previous_state( );
1292 yy_cp = (yy_c_buf_p);
1293 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1294 goto yy_find_action;
1296 break;
1299 default:
1300 YY_FATAL_ERROR(
1301 "fatal flex scanner internal error--no action found" );
1302 } /* end of action switch */
1303 } /* end of scanning one token */
1304 } /* end of yylex */
1306 /* yy_get_next_buffer - try to read in a new buffer
1308 * Returns a code representing an action:
1309 * EOB_ACT_LAST_MATCH -
1310 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1311 * EOB_ACT_END_OF_FILE - end of file
1313 static int yy_get_next_buffer (void)
1315 register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1316 register char *source = (yytext_ptr);
1317 register int number_to_move, i;
1318 int ret_val;
1320 if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
1321 YY_FATAL_ERROR(
1322 "fatal flex scanner internal error--end of buffer missed" );
1324 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1325 { /* Don't try to fill the buffer, so this is an EOF. */
1326 if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
1328 /* We matched a single character, the EOB, so
1329 * treat this as a final EOF.
1331 return EOB_ACT_END_OF_FILE;
1334 else
1336 /* We matched some text prior to the EOB, first
1337 * process it.
1339 return EOB_ACT_LAST_MATCH;
1343 /* Try to read more data. */
1345 /* First move last chars to start of buffer. */
1346 number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
1348 for ( i = 0; i < number_to_move; ++i )
1349 *(dest++) = *(source++);
1351 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1352 /* don't do the read, it's not guaranteed to return an EOF,
1353 * just force an EOF
1355 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1357 else
1359 int num_to_read =
1360 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1362 while ( num_to_read <= 0 )
1363 { /* Not enough room in the buffer - grow it. */
1365 /* just a shorter name for the current buffer */
1366 YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
1368 int yy_c_buf_p_offset =
1369 (int) ((yy_c_buf_p) - b->yy_ch_buf);
1371 if ( b->yy_is_our_buffer )
1373 int new_size = b->yy_buf_size * 2;
1375 if ( new_size <= 0 )
1376 b->yy_buf_size += b->yy_buf_size / 8;
1377 else
1378 b->yy_buf_size *= 2;
1380 b->yy_ch_buf = (char *)
1381 /* Include room in for 2 EOB chars. */
1382 yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 );
1384 else
1385 /* Can't grow it, we don't own it. */
1386 b->yy_ch_buf = 0;
1388 if ( ! b->yy_ch_buf )
1389 YY_FATAL_ERROR(
1390 "fatal error - scanner input buffer overflow" );
1392 (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
1394 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1395 number_to_move - 1;
1399 if ( num_to_read > YY_READ_BUF_SIZE )
1400 num_to_read = YY_READ_BUF_SIZE;
1402 /* Read in more data. */
1403 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1404 (yy_n_chars), num_to_read );
1406 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1409 if ( (yy_n_chars) == 0 )
1411 if ( number_to_move == YY_MORE_ADJ )
1413 ret_val = EOB_ACT_END_OF_FILE;
1414 yyrestart(yyin );
1417 else
1419 ret_val = EOB_ACT_LAST_MATCH;
1420 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1421 YY_BUFFER_EOF_PENDING;
1425 else
1426 ret_val = EOB_ACT_CONTINUE_SCAN;
1428 (yy_n_chars) += number_to_move;
1429 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
1430 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
1432 (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1434 return ret_val;
1437 /* yy_get_previous_state - get the state just before the EOB char was reached */
1439 static yy_state_type yy_get_previous_state (void)
1441 register yy_state_type yy_current_state;
1442 register char *yy_cp;
1444 yy_current_state = (yy_start);
1445 yy_current_state += YY_AT_BOL();
1447 for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
1449 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1450 if ( yy_accept[yy_current_state] )
1452 (yy_last_accepting_state) = yy_current_state;
1453 (yy_last_accepting_cpos) = yy_cp;
1455 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1457 yy_current_state = (int) yy_def[yy_current_state];
1458 if ( yy_current_state >= 157 )
1459 yy_c = yy_meta[(unsigned int) yy_c];
1461 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1464 return yy_current_state;
1467 /* yy_try_NUL_trans - try to make a transition on the NUL character
1469 * synopsis
1470 * next_state = yy_try_NUL_trans( current_state );
1472 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
1474 register int yy_is_jam;
1475 register char *yy_cp = (yy_c_buf_p);
1477 register YY_CHAR yy_c = 1;
1478 if ( yy_accept[yy_current_state] )
1480 (yy_last_accepting_state) = yy_current_state;
1481 (yy_last_accepting_cpos) = yy_cp;
1483 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1485 yy_current_state = (int) yy_def[yy_current_state];
1486 if ( yy_current_state >= 157 )
1487 yy_c = yy_meta[(unsigned int) yy_c];
1489 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1490 yy_is_jam = (yy_current_state == 156);
1492 return yy_is_jam ? 0 : yy_current_state;
1495 static void yyunput (int c, register char * yy_bp )
1497 register char *yy_cp;
1499 yy_cp = (yy_c_buf_p);
1501 /* undo effects of setting up yytext */
1502 *yy_cp = (yy_hold_char);
1504 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1505 { /* need to shift things up to make room */
1506 /* +2 for EOB chars. */
1507 register int number_to_move = (yy_n_chars) + 2;
1508 register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
1509 YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
1510 register char *source =
1511 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
1513 while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1514 *--dest = *--source;
1516 yy_cp += (int) (dest - source);
1517 yy_bp += (int) (dest - source);
1518 YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
1519 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
1521 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1522 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1525 *--yy_cp = (char) c;
1527 if ( c == '\n' ){
1528 --yylineno;
1531 (yytext_ptr) = yy_bp;
1532 (yy_hold_char) = *yy_cp;
1533 (yy_c_buf_p) = yy_cp;
1536 #ifndef YY_NO_INPUT
1537 #ifdef __cplusplus
1538 static int yyinput (void)
1539 #else
1540 static int input (void)
1541 #endif
1544 int c;
1546 *(yy_c_buf_p) = (yy_hold_char);
1548 if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
1550 /* yy_c_buf_p now points to the character we want to return.
1551 * If this occurs *before* the EOB characters, then it's a
1552 * valid NUL; if not, then we've hit the end of the buffer.
1554 if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1555 /* This was really a NUL. */
1556 *(yy_c_buf_p) = '\0';
1558 else
1559 { /* need more input */
1560 int offset = (yy_c_buf_p) - (yytext_ptr);
1561 ++(yy_c_buf_p);
1563 switch ( yy_get_next_buffer( ) )
1565 case EOB_ACT_LAST_MATCH:
1566 /* This happens because yy_g_n_b()
1567 * sees that we've accumulated a
1568 * token and flags that we need to
1569 * try matching the token before
1570 * proceeding. But for input(),
1571 * there's no matching to consider.
1572 * So convert the EOB_ACT_LAST_MATCH
1573 * to EOB_ACT_END_OF_FILE.
1576 /* Reset buffer status. */
1577 yyrestart(yyin );
1579 /*FALLTHROUGH*/
1581 case EOB_ACT_END_OF_FILE:
1583 if ( yywrap( ) )
1584 return EOF;
1586 if ( ! (yy_did_buffer_switch_on_eof) )
1587 YY_NEW_FILE;
1588 #ifdef __cplusplus
1589 return yyinput();
1590 #else
1591 return input();
1592 #endif
1595 case EOB_ACT_CONTINUE_SCAN:
1596 (yy_c_buf_p) = (yytext_ptr) + offset;
1597 break;
1602 c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
1603 *(yy_c_buf_p) = '\0'; /* preserve yytext */
1604 (yy_hold_char) = *++(yy_c_buf_p);
1606 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n');
1607 if ( YY_CURRENT_BUFFER_LVALUE->yy_at_bol )
1609 yylineno++;
1612 return c;
1614 #endif /* ifndef YY_NO_INPUT */
1616 /** Immediately switch to a different input stream.
1617 * @param input_file A readable stream.
1619 * @note This function does not reset the start condition to @c INITIAL .
1621 void yyrestart (FILE * input_file )
1624 if ( ! YY_CURRENT_BUFFER ){
1625 yyensure_buffer_stack ();
1626 YY_CURRENT_BUFFER_LVALUE =
1627 yy_create_buffer(yyin,YY_BUF_SIZE );
1630 yy_init_buffer(YY_CURRENT_BUFFER,input_file );
1631 yy_load_buffer_state( );
1634 /** Switch to a different input buffer.
1635 * @param new_buffer The new input buffer.
1638 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer )
1641 /* TODO. We should be able to replace this entire function body
1642 * with
1643 * yypop_buffer_state();
1644 * yypush_buffer_state(new_buffer);
1646 yyensure_buffer_stack ();
1647 if ( YY_CURRENT_BUFFER == new_buffer )
1648 return;
1650 if ( YY_CURRENT_BUFFER )
1652 /* Flush out information for old buffer. */
1653 *(yy_c_buf_p) = (yy_hold_char);
1654 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1655 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1658 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1659 yy_load_buffer_state( );
1661 /* We don't actually know whether we did this switch during
1662 * EOF (yywrap()) processing, but the only time this flag
1663 * is looked at is after yywrap() is called, so it's safe
1664 * to go ahead and always set it.
1666 (yy_did_buffer_switch_on_eof) = 1;
1669 static void yy_load_buffer_state (void)
1671 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1672 (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1673 yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1674 (yy_hold_char) = *(yy_c_buf_p);
1677 /** Allocate and initialize an input buffer state.
1678 * @param file A readable stream.
1679 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
1681 * @return the allocated buffer state.
1683 YY_BUFFER_STATE yy_create_buffer (FILE * file, int size )
1685 YY_BUFFER_STATE b;
1687 b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
1688 if ( ! b )
1689 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1691 b->yy_buf_size = size;
1693 /* yy_ch_buf has to be 2 characters longer than the size given because
1694 * we need to put in 2 end-of-buffer characters.
1696 b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 );
1697 if ( ! b->yy_ch_buf )
1698 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1700 b->yy_is_our_buffer = 1;
1702 yy_init_buffer(b,file );
1704 return b;
1707 /** Destroy the buffer.
1708 * @param b a buffer created with yy_create_buffer()
1711 void yy_delete_buffer (YY_BUFFER_STATE b )
1714 if ( ! b )
1715 return;
1717 if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
1718 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
1720 if ( b->yy_is_our_buffer )
1721 yyfree((void *) b->yy_ch_buf );
1723 yyfree((void *) b );
1726 #ifndef _UNISTD_H /* assume unistd.h has isatty() for us */
1727 #ifdef __cplusplus
1728 extern "C" {
1729 #endif
1730 #ifdef __THROW /* this is a gnuism */
1731 extern int isatty (int ) __THROW;
1732 #else
1733 extern int isatty (int );
1734 #endif
1735 #ifdef __cplusplus
1737 #endif
1738 #endif
1740 /* Initializes or reinitializes a buffer.
1741 * This function is sometimes called more than once on the same buffer,
1742 * such as during a yyrestart() or at EOF.
1744 static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file )
1747 int oerrno = errno;
1749 yy_flush_buffer(b );
1751 b->yy_input_file = file;
1752 b->yy_fill_buffer = 1;
1754 /* If b is the current buffer, then yy_init_buffer was _probably_
1755 * called from yyrestart() or through yy_get_next_buffer.
1756 * In that case, we don't want to reset the lineno or column.
1758 if (b != YY_CURRENT_BUFFER){
1759 b->yy_bs_lineno = 1;
1760 b->yy_bs_column = 0;
1763 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1765 errno = oerrno;
1768 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
1769 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
1772 void yy_flush_buffer (YY_BUFFER_STATE b )
1774 if ( ! b )
1775 return;
1777 b->yy_n_chars = 0;
1779 /* We always need two end-of-buffer characters. The first causes
1780 * a transition to the end-of-buffer state. The second causes
1781 * a jam in that state.
1783 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1784 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1786 b->yy_buf_pos = &b->yy_ch_buf[0];
1788 b->yy_at_bol = 1;
1789 b->yy_buffer_status = YY_BUFFER_NEW;
1791 if ( b == YY_CURRENT_BUFFER )
1792 yy_load_buffer_state( );
1795 /** Pushes the new state onto the stack. The new state becomes
1796 * the current state. This function will allocate the stack
1797 * if necessary.
1798 * @param new_buffer The new state.
1801 void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
1803 if (new_buffer == NULL)
1804 return;
1806 yyensure_buffer_stack();
1808 /* This block is copied from yy_switch_to_buffer. */
1809 if ( YY_CURRENT_BUFFER )
1811 /* Flush out information for old buffer. */
1812 *(yy_c_buf_p) = (yy_hold_char);
1813 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1814 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1817 /* Only push if top exists. Otherwise, replace top. */
1818 if (YY_CURRENT_BUFFER)
1819 (yy_buffer_stack_top)++;
1820 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1822 /* copied from yy_switch_to_buffer. */
1823 yy_load_buffer_state( );
1824 (yy_did_buffer_switch_on_eof) = 1;
1827 /** Removes and deletes the top of the stack, if present.
1828 * The next element becomes the new top.
1831 void yypop_buffer_state (void)
1833 if (!YY_CURRENT_BUFFER)
1834 return;
1836 yy_delete_buffer(YY_CURRENT_BUFFER );
1837 YY_CURRENT_BUFFER_LVALUE = NULL;
1838 if ((yy_buffer_stack_top) > 0)
1839 --(yy_buffer_stack_top);
1841 if (YY_CURRENT_BUFFER) {
1842 yy_load_buffer_state( );
1843 (yy_did_buffer_switch_on_eof) = 1;
1847 /* Allocates the stack if it does not exist.
1848 * Guarantees space for at least one push.
1850 static void yyensure_buffer_stack (void)
1852 int num_to_alloc;
1854 if (!(yy_buffer_stack)) {
1856 /* First allocation is just for 2 elements, since we don't know if this
1857 * scanner will even need a stack. We use 2 instead of 1 to avoid an
1858 * immediate realloc on the next call.
1860 num_to_alloc = 1;
1861 (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
1862 (num_to_alloc * sizeof(struct yy_buffer_state*)
1865 memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
1867 (yy_buffer_stack_max) = num_to_alloc;
1868 (yy_buffer_stack_top) = 0;
1869 return;
1872 if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
1874 /* Increase the buffer to prepare for a possible push. */
1875 int grow_size = 8 /* arbitrary grow size */;
1877 num_to_alloc = (yy_buffer_stack_max) + grow_size;
1878 (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
1879 ((yy_buffer_stack),
1880 num_to_alloc * sizeof(struct yy_buffer_state*)
1883 /* zero only the new slots.*/
1884 memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
1885 (yy_buffer_stack_max) = num_to_alloc;
1889 /** Setup the input buffer state to scan directly from a user-specified character buffer.
1890 * @param base the character buffer
1891 * @param size the size in bytes of the character buffer
1893 * @return the newly allocated buffer state object.
1895 YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size )
1897 YY_BUFFER_STATE b;
1899 if ( size < 2 ||
1900 base[size-2] != YY_END_OF_BUFFER_CHAR ||
1901 base[size-1] != YY_END_OF_BUFFER_CHAR )
1902 /* They forgot to leave room for the EOB's. */
1903 return 0;
1905 b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
1906 if ( ! b )
1907 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
1909 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
1910 b->yy_buf_pos = b->yy_ch_buf = base;
1911 b->yy_is_our_buffer = 0;
1912 b->yy_input_file = 0;
1913 b->yy_n_chars = b->yy_buf_size;
1914 b->yy_is_interactive = 0;
1915 b->yy_at_bol = 1;
1916 b->yy_fill_buffer = 0;
1917 b->yy_buffer_status = YY_BUFFER_NEW;
1919 yy_switch_to_buffer(b );
1921 return b;
1924 /** Setup the input buffer state to scan a string. The next call to yylex() will
1925 * scan from a @e copy of @a str.
1926 * @param str a NUL-terminated string to scan
1928 * @return the newly allocated buffer state object.
1929 * @note If you want to scan bytes that may contain NUL values, then use
1930 * yy_scan_bytes() instead.
1932 YY_BUFFER_STATE yy_scan_string (yyconst char * __yystr )
1935 return yy_scan_bytes(__yystr,strlen(__yystr) );
1938 /** Setup the input buffer state to scan the given bytes. The next call to yylex() will
1939 * scan from a @e copy of @a bytes.
1940 * @param bytes the byte buffer to scan
1941 * @param len the number of bytes in the buffer pointed to by @a bytes.
1943 * @return the newly allocated buffer state object.
1945 YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, int _yybytes_len )
1947 YY_BUFFER_STATE b;
1948 char *buf;
1949 yy_size_t n;
1950 int i;
1952 /* Get memory for full buffer, including space for trailing EOB's. */
1953 n = _yybytes_len + 2;
1954 buf = (char *) yyalloc(n );
1955 if ( ! buf )
1956 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
1958 for ( i = 0; i < _yybytes_len; ++i )
1959 buf[i] = yybytes[i];
1961 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
1963 b = yy_scan_buffer(buf,n );
1964 if ( ! b )
1965 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
1967 /* It's okay to grow etc. this buffer, and we should throw it
1968 * away when we're done.
1970 b->yy_is_our_buffer = 1;
1972 return b;
1975 #ifndef YY_EXIT_FAILURE
1976 #define YY_EXIT_FAILURE 2
1977 #endif
1979 static void yy_fatal_error (yyconst char* msg )
1981 (void) fprintf( stderr, "%s\n", msg );
1982 exit( YY_EXIT_FAILURE );
1985 /* Redefine yyless() so it works in section 3 code. */
1987 #undef yyless
1988 #define yyless(n) \
1989 do \
1991 /* Undo effects of setting up yytext. */ \
1992 int yyless_macro_arg = (n); \
1993 YY_LESS_LINENO(yyless_macro_arg);\
1994 yytext[yyleng] = (yy_hold_char); \
1995 (yy_c_buf_p) = yytext + yyless_macro_arg; \
1996 (yy_hold_char) = *(yy_c_buf_p); \
1997 *(yy_c_buf_p) = '\0'; \
1998 yyleng = yyless_macro_arg; \
2000 while ( 0 )
2002 /* Accessor methods (get/set functions) to struct members. */
2004 /** Get the current line number.
2007 int yyget_lineno (void)
2010 return yylineno;
2013 /** Get the input stream.
2016 FILE *yyget_in (void)
2018 return yyin;
2021 /** Get the output stream.
2024 FILE *yyget_out (void)
2026 return yyout;
2029 /** Get the length of the current token.
2032 int yyget_leng (void)
2034 return yyleng;
2037 /** Get the current token.
2041 char *yyget_text (void)
2043 return yytext;
2046 /** Set the current line number.
2047 * @param line_number
2050 void yyset_lineno (int line_number )
2053 yylineno = line_number;
2056 /** Set the input stream. This does not discard the current
2057 * input buffer.
2058 * @param in_str A readable stream.
2060 * @see yy_switch_to_buffer
2062 void yyset_in (FILE * in_str )
2064 yyin = in_str ;
2067 void yyset_out (FILE * out_str )
2069 yyout = out_str ;
2072 int yyget_debug (void)
2074 return yy_flex_debug;
2077 void yyset_debug (int bdebug )
2079 yy_flex_debug = bdebug ;
2082 static int yy_init_globals (void)
2084 /* Initialization is the same as for the non-reentrant scanner.
2085 * This function is called from yylex_destroy(), so don't allocate here.
2088 /* We do not touch yylineno unless the option is enabled. */
2089 yylineno = 1;
2091 (yy_buffer_stack) = 0;
2092 (yy_buffer_stack_top) = 0;
2093 (yy_buffer_stack_max) = 0;
2094 (yy_c_buf_p) = (char *) 0;
2095 (yy_init) = 0;
2096 (yy_start) = 0;
2098 /* Defined in main.c */
2099 #ifdef YY_STDINIT
2100 yyin = stdin;
2101 yyout = stdout;
2102 #else
2103 yyin = (FILE *) 0;
2104 yyout = (FILE *) 0;
2105 #endif
2107 /* For future reference: Set errno on error, since we are called by
2108 * yylex_init()
2110 return 0;
2113 /* yylex_destroy is for both reentrant and non-reentrant scanners. */
2114 int yylex_destroy (void)
2117 /* Pop the buffer stack, destroying each element. */
2118 while(YY_CURRENT_BUFFER){
2119 yy_delete_buffer(YY_CURRENT_BUFFER );
2120 YY_CURRENT_BUFFER_LVALUE = NULL;
2121 yypop_buffer_state();
2124 /* Destroy the stack itself. */
2125 yyfree((yy_buffer_stack) );
2126 (yy_buffer_stack) = NULL;
2128 /* Reset the globals. This is important in a non-reentrant scanner so the next time
2129 * yylex() is called, initialization will occur. */
2130 yy_init_globals( );
2132 return 0;
2136 * Internal utility routines.
2139 #ifndef yytext_ptr
2140 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
2142 register int i;
2143 for ( i = 0; i < n; ++i )
2144 s1[i] = s2[i];
2146 #endif
2148 #ifdef YY_NEED_STRLEN
2149 static int yy_flex_strlen (yyconst char * s )
2151 register int n;
2152 for ( n = 0; s[n]; ++n )
2155 return n;
2157 #endif
2159 void *yyalloc (yy_size_t size )
2161 return (void *) malloc( size );
2164 void *yyrealloc (void * ptr, yy_size_t size )
2166 /* The cast to (char *) in the following accommodates both
2167 * implementations that use char* generic pointers, and those
2168 * that use void* generic pointers. It works with the latter
2169 * because both ANSI C and C++ allow castless assignment from
2170 * any pointer type to void*, and deal with argument conversions
2171 * as though doing an assignment.
2173 return (void *) realloc( (char *) ptr, size );
2176 void yyfree (void * ptr )
2178 free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
2181 #define YYTABLES_NAME "yytables"
2183 #line 164 "lexer.l"
2188 /* "Include" file 'incfile' here. Return false for failure, true for success. */
2190 bool lex_include_file(const char *incfile)
2192 FILE *bakup;
2194 DEBUG_PRINT("'%s'\n", incfile);
2196 if (incl_buff >= INCLUDE_RECURSION_LIMIT) {
2197 warning("Recursion limit reached in file '%s'", incfile);
2198 return false;
2201 bakup = yyin;
2202 yyin = open_src_file(incfile, options.src_path);
2203 if (yyin == NULL) {
2204 if (errno == ENOENT) {
2205 if (options.warn_missing)
2206 warning("Include file '%s' not found", incfile);
2207 } else
2208 warning("Skipping include file '%s': %s", incfile, strerror(errno));
2210 yyin = bakup;
2211 return false;
2214 include_stack[incl_buff] = YY_CURRENT_BUFFER;
2215 yy_switch_to_buffer(yy_create_buffer (yyin, YY_BUF_SIZE));
2217 line_num_stack[incl_buff++] = yylineno;
2218 yylineno = 1;
2220 return true;
2224 void lex_set_format(SourceFmt fmt)
2226 switch (fmt) {
2227 case UNKNOWN:
2228 case FREE:
2229 BEGIN(free_fmt); break;
2230 case FIXED:
2231 BEGIN(fixed_fmt); break;
2232 default:
2233 assert(0);
2238 int yywrap()
2240 return 1;