5 #define YY_INT_ALIGNED short int
7 /* A lexical scanner generated by flex */
12 /* %if-not-reentrant */
13 #define yy_create_buffer skel__create_buffer
14 #define yy_delete_buffer skel__delete_buffer
15 #define yy_flex_debug skel__flex_debug
16 #define yy_init_buffer skel__init_buffer
17 #define yy_flush_buffer skel__flush_buffer
18 #define yy_load_buffer_state skel__load_buffer_state
19 #define yy_switch_to_buffer skel__switch_to_buffer
21 #define yyleng skel_leng
22 #define yylex skel_lex
23 #define yylineno skel_lineno
24 #define yyout skel_out
25 #define yyrestart skel_restart
26 #define yytext skel_text
27 #define yywrap skel_wrap
28 #define yyalloc skel_alloc
29 #define yyrealloc skel_realloc
30 #define yyfree skel_free
37 #define YY_FLEX_MAJOR_VERSION 2
38 #define YY_FLEX_MINOR_VERSION 5
39 #define YY_FLEX_SUBMINOR_VERSION 37
40 #if YY_FLEX_SUBMINOR_VERSION > 0
55 /* First, we deal with platform-specific or compiler-specific issues. */
57 /* begin standard C headers. */
65 /* %if-tables-serialization */
67 /* end standard C headers. */
70 /* flex integer type definitions */
75 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
77 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
79 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
80 * if you want the limit (max/min) macros for int types.
82 #ifndef __STDC_LIMIT_MACROS
83 #define __STDC_LIMIT_MACROS 1
87 typedef int8_t flex_int8_t;
88 typedef uint8_t flex_uint8_t;
89 typedef int16_t flex_int16_t;
90 typedef uint16_t flex_uint16_t;
91 typedef int32_t flex_int32_t;
92 typedef uint32_t flex_uint32_t;
94 typedef signed char flex_int8_t;
95 typedef short int flex_int16_t;
96 typedef int flex_int32_t;
97 typedef unsigned char flex_uint8_t;
98 typedef unsigned short int flex_uint16_t;
99 typedef unsigned int flex_uint32_t;
101 /* Limits of integral types. */
103 #define INT8_MIN (-128)
106 #define INT16_MIN (-32767-1)
109 #define INT32_MIN (-2147483647-1)
112 #define INT8_MAX (127)
115 #define INT16_MAX (32767)
118 #define INT32_MAX (2147483647)
121 #define UINT8_MAX (255U)
124 #define UINT16_MAX (65535U)
127 #define UINT32_MAX (4294967295U)
132 #endif /* ! FLEXINT_H */
141 /* The "const" storage-class-modifier is valid. */
144 #else /* ! __cplusplus */
146 /* C99 requires __STDC__ to be defined as 1. */
147 #if defined (__STDC__)
151 #endif /* defined (__STDC__) */
152 #endif /* ! __cplusplus */
155 #define yyconst const
160 /* %not-for-header */
162 /* Returned upon end-of-file. */
166 /* %not-for-header */
168 /* Promotes a possibly negative, possibly signed char to an unsigned
169 * integer for use as an array index. If the signed char is negative,
170 * we want to instead treat it as an 8-bit unsigned char, hence the
173 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
179 /* %if-not-reentrant */
183 /* Enter a start condition. This macro really ought to take a parameter,
184 * but we do it the disgusting crufty way forced on us by the ()-less
185 * definition of BEGIN.
187 #define BEGIN (yy_start) = 1 + 2 *
189 /* Translate the current start state into a value that can be later handed
190 * to BEGIN to return to the state. The YYSTATE alias is for lex
193 #define YY_START (((yy_start) - 1) / 2)
194 #define YYSTATE YY_START
196 /* Action number for EOF rule of a given start state. */
197 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
199 /* Special action meaning "start processing a new file". */
200 #define YY_NEW_FILE skel_restart(skel_in )
202 #define YY_END_OF_BUFFER_CHAR 0
204 /* Size of default input buffer. */
206 #define YY_BUF_SIZE 16384
209 /* The state buf must be large enough to hold one state per character in the main buffer.
211 #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
213 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
214 #define YY_TYPEDEF_YY_BUFFER_STATE
215 typedef struct yy_buffer_state *YY_BUFFER_STATE;
218 #ifndef YY_TYPEDEF_YY_SIZE_T
219 #define YY_TYPEDEF_YY_SIZE_T
220 typedef size_t yy_size_t;
223 /* %if-not-reentrant */
224 extern yy_size_t skel_leng;
228 /* %if-not-reentrant */
229 extern FILE *skel_in, *skel_out;
233 #define EOB_ACT_CONTINUE_SCAN 0
234 #define EOB_ACT_END_OF_FILE 1
235 #define EOB_ACT_LAST_MATCH 2
237 #define YY_LESS_LINENO(n)
239 /* Return all but the first "n" matched characters back to the input stream. */
243 /* Undo effects of setting up skel_text. */ \
244 int yyless_macro_arg = (n); \
245 YY_LESS_LINENO(yyless_macro_arg);\
246 *yy_cp = (yy_hold_char); \
247 YY_RESTORE_YY_MORE_OFFSET \
248 (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
249 YY_DO_BEFORE_ACTION; /* set up skel_text again */ \
253 #define unput(c) yyunput( c, (yytext_ptr) )
255 #ifndef YY_STRUCT_YY_BUFFER_STATE
256 #define YY_STRUCT_YY_BUFFER_STATE
257 struct yy_buffer_state
266 char *yy_ch_buf; /* input buffer */
267 char *yy_buf_pos; /* current position in input buffer */
269 /* Size of input buffer in bytes, not including room for EOB
272 yy_size_t yy_buf_size;
274 /* Number of characters read into yy_ch_buf, not including EOB
277 yy_size_t yy_n_chars;
279 /* Whether we "own" the buffer - i.e., we know we created it,
280 * and can realloc() it to grow it, and should free() it to
283 int yy_is_our_buffer;
285 /* Whether this is an "interactive" input source; if so, and
286 * if we're using stdio for input, then we want to use getc()
287 * instead of fread(), to make sure we stop fetching input after
290 int yy_is_interactive;
292 /* Whether we're considered to be at the beginning of a line.
293 * If so, '^' rules will be active on the next match, otherwise
298 int yy_bs_lineno; /**< The line count. */
299 int yy_bs_column; /**< The column count. */
301 /* Whether to try to fill the input buffer when we reach the
306 int yy_buffer_status;
308 #define YY_BUFFER_NEW 0
309 #define YY_BUFFER_NORMAL 1
310 /* When an EOF's been seen but there's still some text to process
311 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
312 * shouldn't try reading from the input source any more. We might
313 * still have a bunch of tokens to match, though, because of
314 * possible backing-up.
316 * When we actually see the EOF, we change the status to "new"
317 * (via skel_restart()), so that the user can continue scanning by
318 * just pointing skel_in at a new input file.
320 #define YY_BUFFER_EOF_PENDING 2
323 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
325 /* %if-c-only Standard (non-C++) definition */
326 /* %not-for-header */
328 /* %if-not-reentrant */
330 /* Stack of input buffers. */
331 static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
332 static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
333 static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
339 /* We provide macros for accessing buffer states in case in the
340 * future we want to put the buffer states in a more general
343 * Returns the top of the stack, or NULL.
345 #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
346 ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
349 /* Same as previous macro, but useful when we know that the buffer stack is not
350 * NULL or when we need an lvalue. For internal use only.
352 #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
354 /* %if-c-only Standard (non-C++) definition */
356 /* %if-not-reentrant */
357 /* %not-for-header */
359 /* yy_hold_char holds the character lost when skel_text is formed. */
360 static char yy_hold_char;
361 static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */
364 /* Points to current character in buffer. */
365 static char *yy_c_buf_p = (char *) 0;
366 static int yy_init = 0; /* whether we need to initialize */
367 static int yy_start = 0; /* start state number */
369 /* Flag which is used to allow skel_wrap()'s to do buffer switches
370 * instead of setting up a fresh skel_in. A bit of a hack ...
372 static int yy_did_buffer_switch_on_eof;
377 void skel_restart (FILE *input_file );
378 void skel__switch_to_buffer (YY_BUFFER_STATE new_buffer );
379 YY_BUFFER_STATE skel__create_buffer (FILE *file,int size );
380 void skel__delete_buffer (YY_BUFFER_STATE b );
381 void skel__flush_buffer (YY_BUFFER_STATE b );
382 void skel_push_buffer_state (YY_BUFFER_STATE new_buffer );
383 void skel_pop_buffer_state (void );
385 static void skel_ensure_buffer_stack (void );
386 static void skel__load_buffer_state (void );
387 static void skel__init_buffer (YY_BUFFER_STATE b,FILE *file );
389 #define YY_FLUSH_BUFFER skel__flush_buffer(YY_CURRENT_BUFFER )
391 YY_BUFFER_STATE skel__scan_buffer (char *base,yy_size_t size );
392 YY_BUFFER_STATE skel__scan_string (yyconst char *yy_str );
393 YY_BUFFER_STATE skel__scan_bytes (yyconst char *bytes,yy_size_t len );
397 void *skel_alloc (yy_size_t );
398 void *skel_realloc (void *,yy_size_t );
399 void skel_free (void * );
401 #define yy_new_buffer skel__create_buffer
403 #define yy_set_interactive(is_interactive) \
405 if ( ! YY_CURRENT_BUFFER ){ \
406 skel_ensure_buffer_stack (); \
407 YY_CURRENT_BUFFER_LVALUE = \
408 skel__create_buffer(skel_in,YY_BUF_SIZE ); \
410 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
413 #define yy_set_bol(at_bol) \
415 if ( ! YY_CURRENT_BUFFER ){\
416 skel_ensure_buffer_stack (); \
417 YY_CURRENT_BUFFER_LVALUE = \
418 skel__create_buffer(skel_in,YY_BUF_SIZE ); \
420 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
423 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
425 /* %% [1.0] skel_text/skel_in/skel_out/yy_state_type/skel_lineno etc. def's & init go here */
426 /* Begin user sect3 */
428 #define skel_wrap() 1
429 #define YY_SKIP_YYWRAP
433 typedef unsigned char YY_CHAR;
435 FILE *skel_in = (FILE *) 0, *skel_out = (FILE *) 0;
437 typedef int yy_state_type;
439 extern int skel_lineno;
443 extern char *skel_text;
444 #define yytext_ptr skel_text
446 /* %if-c-only Standard (non-C++) definition */
448 static yy_state_type yy_get_previous_state (void );
449 static yy_state_type yy_try_NUL_trans (yy_state_type current_state );
450 static int yy_get_next_buffer (void );
451 static void yy_fatal_error (yyconst char msg[] );
455 /* Done after the current pattern has been matched and before the
456 * corresponding action - sets up skel_text.
458 #define YY_DO_BEFORE_ACTION \
459 (yytext_ptr) = yy_bp; \
460 /* %% [2.0] code to fiddle skel_text and skel_leng for yymore() goes here \ */\
461 skel_leng = (size_t) (yy_cp - yy_bp); \
462 (yy_hold_char) = *yy_cp; \
464 /* %% [3.0] code to copy yytext_ptr to skel_text[] goes here, if %array \ */\
465 (yy_c_buf_p) = yy_cp;
467 /* %% [4.0] data tables for the DFA and the user's section 1 definitions go here */
468 #define YY_NUM_RULES 22
469 #define YY_END_OF_BUFFER 23
470 /* This struct is not used in this scanner,
471 but its presence is necessary. */
474 flex_int32_t yy_verify;
477 static yyconst flex_int16_t yy_accept[45] =
479 0, 0, 0, 0, 0, 0, 23, 11, 10, 9,
480 12, 19, 21, 20, 20, 11, 9, 5, 1, 9,
481 4, 9, 2, 3, 12, 19, 17, 18, 13, 16,
482 14, 15, 8, 9, 9, 9, 9, 9, 9, 9,
486 static yyconst flex_int32_t yy_ec[256] =
488 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
489 1, 1, 2, 1, 1, 1, 1, 1, 1, 1,
490 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
491 1, 2, 1, 1, 1, 1, 1, 1, 1, 4,
492 5, 1, 1, 5, 1, 1, 1, 1, 1, 1,
493 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
494 1, 1, 1, 6, 1, 1, 1, 1, 1, 1,
495 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
496 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
497 1, 1, 1, 1, 7, 8, 7, 7, 7, 7,
499 9, 10, 7, 7, 11, 7, 7, 12, 7, 13,
500 14, 7, 7, 7, 7, 7, 7, 7, 7, 7,
501 7, 7, 15, 1, 16, 1, 1, 1, 1, 1,
502 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
503 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
504 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
505 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
506 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
507 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
508 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
510 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
511 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
512 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
513 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
514 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
518 static yyconst flex_int32_t yy_meta[17] =
520 1, 1, 2, 3, 1, 4, 1, 5, 1, 1,
524 static yyconst flex_int16_t yy_base[53] =
526 0, 1, 60, 26, 6, 8, 29, 0, 105, 11,
527 0, 25, 105, 105, 105, 0, 0, 105, 105, 41,
528 105, 46, 105, 105, 0, 105, 105, 105, 105, 105,
529 105, 105, 105, 60, 4, 23, 25, 28, 43, 38,
530 57, 105, 105, 105, 71, 76, 81, 86, 91, 96,
534 static yyconst flex_int16_t yy_def[53] =
536 45, 45, 46, 46, 47, 47, 44, 48, 44, 44,
537 49, 50, 44, 44, 44, 48, 51, 44, 44, 52,
538 44, 44, 44, 44, 49, 44, 44, 44, 44, 44,
539 44, 44, 44, 52, 34, 34, 34, 34, 34, 34,
540 34, 44, 44, 0, 44, 44, 44, 44, 44, 44,
544 static yyconst flex_int16_t yy_nxt[122] =
546 17, 44, 9, 9, 44, 10, 10, 14, 15, 14,
547 15, 17, 17, 18, 37, 17, 19, 20, 21, 20,
548 20, 20, 20, 20, 22, 23, 24, 27, 44, 28,
549 29, 12, 30, 20, 38, 20, 40, 39, 20, 31,
550 32, 17, 17, 42, 33, 17, 17, 17, 20, 33,
551 17, 41, 20, 20, 20, 34, 20, 35, 20, 20,
552 17, 17, 43, 33, 17, 12, 44, 20, 44, 44,
553 36, 8, 8, 8, 8, 8, 11, 11, 11, 11,
554 11, 13, 13, 13, 13, 13, 16, 44, 16, 44,
555 16, 25, 25, 25, 44, 25, 26, 26, 26, 26,
557 26, 20, 44, 20, 7, 44, 44, 44, 44, 44,
558 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
562 static yyconst flex_int16_t yy_chk[122] =
564 51, 0, 1, 2, 0, 1, 2, 5, 5, 6,
565 6, 10, 10, 10, 35, 10, 10, 10, 10, 10,
566 10, 10, 10, 10, 10, 10, 10, 12, 7, 12,
567 12, 4, 12, 36, 36, 37, 38, 37, 38, 12,
568 12, 20, 20, 40, 20, 20, 22, 22, 40, 22,
569 22, 39, 22, 39, 22, 22, 22, 22, 22, 22,
570 34, 34, 41, 34, 34, 3, 0, 41, 0, 0,
571 34, 45, 45, 45, 45, 45, 46, 46, 46, 46,
572 46, 47, 47, 47, 47, 47, 48, 0, 48, 0,
573 48, 49, 49, 49, 0, 49, 50, 50, 50, 50,
575 50, 52, 0, 52, 44, 44, 44, 44, 44, 44,
576 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
580 static yy_state_type yy_last_accepting_state;
581 static char *yy_last_accepting_cpos;
583 extern int skel__flex_debug;
584 int skel__flex_debug = 1;
586 static yyconst flex_int16_t yy_rule_linenum[22] =
588 72, 73, 74, 75, 76, 78, 79, 81, 90, 91,
589 92, 105, 107, 108, 109, 110, 111, 113, 134, 139,
593 /* The intent behind this definition is that it'll catch
594 * any uses of REJECT which flex missed.
596 #define REJECT reject_used_but_not_detected
597 #define yymore() yymore_used_but_not_detected
598 #define YY_MORE_ADJ 0
599 #define YY_RESTORE_YY_MORE_OFFSET
601 #line 1 "../../../src/scan-skel.l"
602 /* Scan Bison Skeletons. -*- C -*-
604 Copyright (C) 2001-2007, 2009-2013 Free Software Foundation, Inc.
606 This file is part of Bison, the GNU Compiler Compiler.
608 This program is free software: you can redistribute it and/or modify
609 it under the terms of the GNU General Public License as published by
610 the Free Software Foundation, either version 3 of the License, or
611 (at your option) any later version.
613 This program is distributed in the hope that it will be useful,
614 but WITHOUT ANY WARRANTY; without even the implied warranty of
615 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
616 GNU General Public License for more details.
618 You should have received a copy of the GNU General Public License
619 along with this program. If not, see <http://www.gnu.org/licenses/>. */
620 #define YY_NO_INPUT 1
621 #line 24 "../../../src/scan-skel.l"
622 /* Work around a bug in flex 2.5.31. See Debian bug 333231
623 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=333231>. */
625 #define skel_wrap() 1
627 #define FLEX_PREFIX(Id) skel_ ## Id
628 #include "flex-scanner.h"
632 #include <quotearg.h>
634 #include "complain.h"
637 #include "scan-skel.h"
639 #define YY_DECL static int skel_lex (void)
642 #define QPUTS(String) \
643 fputs (quotearg_style (c_quoting_style, String), skel_out)
645 static void at_directive_perform (int at_directive_argc,
646 char *at_directive_argv[],
647 char **outnamep, int *out_linenop);
648 static void fail_for_at_directive_too_many_args (char const *at_directive_name);
649 static void fail_for_at_directive_too_few_args (char const *at_directive_name);
650 static void fail_for_invalid_at (char const *at);
653 #line 654 "scan-skel.c"
656 #define SC_AT_DIRECTIVE_ARGS 1
657 #define SC_AT_DIRECTIVE_SKIP_WS 2
659 #ifndef YY_NO_UNISTD_H
660 /* Special case for "unistd.h", since it is non-ANSI. We include it way
661 * down here because we want the user's section 1 to have been scanned first.
662 * The user has a chance to override it with an option.
671 #ifndef YY_EXTRA_TYPE
672 #define YY_EXTRA_TYPE void *
675 /* %if-c-only Reentrant structure and macros (non-C++). */
679 static int yy_init_globals (void );
684 /* %endif End reentrant structures and macros. */
686 /* Accessor methods to globals.
687 These are made visible to non-reentrant scanners for convenience. */
689 int skel_lex_destroy (void );
691 int skel_get_debug (void );
693 void skel_set_debug (int debug_flag );
695 YY_EXTRA_TYPE skel_get_extra (void );
697 void skel_set_extra (YY_EXTRA_TYPE user_defined );
699 FILE *skel_get_in (void );
701 void skel_set_in (FILE * in_str );
703 FILE *skel_get_out (void );
705 void skel_set_out (FILE * out_str );
707 yy_size_t skel_get_leng (void );
709 char *skel_get_text (void );
711 int skel_get_lineno (void );
713 void skel_set_lineno (int line_number );
715 /* %if-bison-bridge */
718 /* Macros after this point can all be overridden by user definitions in
722 #ifndef YY_SKIP_YYWRAP
724 extern "C" int skel_wrap (void );
726 extern int skel_wrap (void );
730 /* %not-for-header */
737 static void yy_flex_strncpy (char *,yyconst char *,int );
740 #ifdef YY_NEED_STRLEN
741 static int yy_flex_strlen (yyconst char * );
745 /* %if-c-only Standard (non-C++) definition */
746 /* %not-for-header */
749 static int yyinput (void );
751 static int input (void );
762 /* Amount of stuff to slurp up with each read. */
763 #ifndef YY_READ_BUF_SIZE
764 #define YY_READ_BUF_SIZE 8192
767 /* Copy whatever the last rule matched to the standard output. */
769 /* %if-c-only Standard (non-C++) definition */
770 /* This used to be an fputs(), but since the string might contain NUL's,
771 * we now use fwrite().
773 #define ECHO do { if (fwrite( skel_text, skel_leng, 1, skel_out )) {} } while (0)
775 /* %if-c++-only C++ definition */
779 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
780 * is returned in "result".
783 #define YY_INPUT(buf,result,max_size) \
784 /* %% [5.0] fread()/read() definition of YY_INPUT goes here unless we're doing C++ \ */\
785 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
789 for ( n = 0; n < max_size && \
790 (c = getc( skel_in )) != EOF && c != '\n'; ++n ) \
793 buf[n++] = (char) c; \
794 if ( c == EOF && ferror( skel_in ) ) \
795 YY_FATAL_ERROR( "input in flex scanner failed" ); \
801 while ( (result = fread(buf, 1, max_size, skel_in))==0 && ferror(skel_in)) \
803 if( errno != EINTR) \
805 YY_FATAL_ERROR( "input in flex scanner failed" ); \
813 /* %if-c++-only C++ definition \ */\
818 /* No semi-colon after return; correct usage is to write "yyterminate();" -
819 * we don't want an extra ';' after the "return" because that will cause
820 * some compilers to complain about unreachable statements.
823 #define yyterminate() return YY_NULL
826 /* Number of entries by which start-condition stack grows. */
827 #ifndef YY_START_STACK_INCR
828 #define YY_START_STACK_INCR 25
831 /* Report a fatal error. */
832 #ifndef YY_FATAL_ERROR
834 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
840 /* %if-tables-serialization structures and prototypes */
841 /* %not-for-header */
845 /* %not-for-header */
847 /* %tables-yydmap generated elements */
849 /* end tables serialization structures and prototypes */
853 /* Default declaration of generated scanner - a define so the user can
854 * easily add parameters.
857 #define YY_DECL_IS_OURS 1
858 /* %if-c-only Standard (non-C++) definition */
860 extern int skel_lex (void);
862 #define YY_DECL int skel_lex (void)
864 /* %if-c++-only C++ definition */
866 #endif /* !YY_DECL */
868 /* Code executed at the beginning of each rule, after skel_text and skel_leng
871 #ifndef YY_USER_ACTION
872 #define YY_USER_ACTION
875 /* Code executed at the end of each rule. */
877 #define YY_BREAK break;
880 /* %% [6.0] YY_RULE_SETUP definition goes here */
881 #define YY_RULE_SETUP \
884 /* %not-for-header */
886 /** The main scanner function which does all the work.
890 register yy_state_type yy_current_state;
891 register char *yy_cp, *yy_bp;
894 /* %% [7.0] user's declarations go here */
895 #line 58 "../../../src/scan-skel.l"
899 int out_lineno PACIFY_CC (= 0);
900 char *outname = NULL;
902 /* Currently, only the @warn, @complain, @fatal, @warn_at, @complain_at, and
903 @fatal_at directives take multiple arguments, and the last three already
904 can't take more than 7. at_directive_argv[0] is the directive name. */
905 #define AT_DIRECTIVE_ARGC_MAX 8
906 int at_directive_argc = 0;
907 char *at_directive_argv[AT_DIRECTIVE_ARGC_MAX];
910 #line 911 "scan-skel.c"
921 (yy_start) = 1; /* first start state */
937 if ( ! YY_CURRENT_BUFFER ) {
938 skel_ensure_buffer_stack ();
939 YY_CURRENT_BUFFER_LVALUE =
940 skel__create_buffer(skel_in,YY_BUF_SIZE );
943 skel__load_buffer_state( );
946 while ( 1 ) /* loops until end-of-file is reached */
948 /* %% [8.0] yymore()-related code goes here */
949 yy_cp = (yy_c_buf_p);
951 /* Support of skel_text. */
952 *yy_cp = (yy_hold_char);
954 /* yy_bp points to the position in yy_ch_buf of the start of
959 /* %% [9.0] code to set up and find next match goes here */
960 yy_current_state = (yy_start);
964 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
965 if ( yy_accept[yy_current_state] )
967 (yy_last_accepting_state) = yy_current_state;
968 (yy_last_accepting_cpos) = yy_cp;
970 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
972 yy_current_state = (int) yy_def[yy_current_state];
973 if ( yy_current_state >= 45 )
974 yy_c = yy_meta[(unsigned int) yy_c];
976 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
979 while ( yy_current_state != 44 );
980 yy_cp = (yy_last_accepting_cpos);
981 yy_current_state = (yy_last_accepting_state);
984 /* %% [10.0] code to find the action number goes here */
985 yy_act = yy_accept[yy_current_state];
989 /* %% [11.0] code for skel_lineno update goes here */
991 do_action: /* This label is used only to access EOF actions. */
993 /* %% [12.0] debug code goes here */
994 if ( skel__flex_debug )
997 fprintf( stderr, "--scanner backing up\n" );
998 else if ( yy_act < 22 )
999 fprintf( stderr, "--accepting rule at line %ld (\"%s\")\n",
1000 (long)yy_rule_linenum[yy_act], skel_text );
1001 else if ( yy_act == 22 )
1002 fprintf( stderr, "--accepting default rule (\"%s\")\n",
1004 else if ( yy_act == 23 )
1005 fprintf( stderr, "--(end of buffer or a NUL)\n" );
1007 fprintf( stderr, "--EOF (start condition %d)\n", YY_START );
1011 { /* beginning of action switch */
1012 /* %% [13.0] actions go here */
1013 case 0: /* must back up */
1014 /* undo the effects of YY_DO_BEFORE_ACTION */
1015 *yy_cp = (yy_hold_char);
1016 yy_cp = (yy_last_accepting_cpos);
1017 yy_current_state = (yy_last_accepting_state);
1018 goto yy_find_action;
1022 #line 72 "../../../src/scan-skel.l"
1023 fputc ('@', skel_out);
1027 #line 73 "../../../src/scan-skel.l"
1028 fputc ('[', skel_out);
1032 #line 74 "../../../src/scan-skel.l"
1033 fputc (']', skel_out);
1037 #line 75 "../../../src/scan-skel.l"
1038 continue; /* Used by b4_cat in ../data/bison.m4. */
1041 /* rule 5 can match eol */
1043 #line 76 "../../../src/scan-skel.l"
1048 #line 78 "../../../src/scan-skel.l"
1049 fprintf (skel_out, "%d", out_lineno + 1);
1053 #line 79 "../../../src/scan-skel.l"
1058 #line 81 "../../../src/scan-skel.l"
1060 skel_text[skel_leng-1] = '\0';
1061 obstack_grow (&obstack_for_string, skel_text, skel_leng);
1062 at_directive_argv[at_directive_argc++] =
1063 obstack_finish (&obstack_for_string);
1064 BEGIN SC_AT_DIRECTIVE_ARGS;
1067 /* This pattern must not match more than the previous @ patterns. */
1070 #line 90 "../../../src/scan-skel.l"
1071 fail_for_invalid_at (skel_text);
1074 /* rule 10 can match eol */
1076 #line 91 "../../../src/scan-skel.l"
1081 #line 92 "../../../src/scan-skel.l"
1084 case YY_STATE_EOF(INITIAL):
1085 #line 94 "../../../src/scan-skel.l"
1098 /* rule 12 can match eol */
1100 #line 105 "../../../src/scan-skel.l"
1105 #line 107 "../../../src/scan-skel.l"
1106 obstack_1grow (&obstack_for_string, '@');
1110 #line 108 "../../../src/scan-skel.l"
1111 obstack_1grow (&obstack_for_string, '[');
1115 #line 109 "../../../src/scan-skel.l"
1116 obstack_1grow (&obstack_for_string, ']');
1120 #line 110 "../../../src/scan-skel.l"
1121 continue; /* For starting an argument that begins with whitespace. */
1124 /* rule 17 can match eol */
1126 #line 111 "../../../src/scan-skel.l"
1131 #line 113 "../../../src/scan-skel.l"
1133 if (at_directive_argc >= AT_DIRECTIVE_ARGC_MAX)
1134 fail_for_at_directive_too_many_args (at_directive_argv[0]);
1136 obstack_1grow (&obstack_for_string, '\0');
1137 at_directive_argv[at_directive_argc++] =
1138 obstack_finish (&obstack_for_string);
1140 /* Like M4, skip whitespace after a comma. */
1141 if (skel_text[1] == ',')
1142 BEGIN SC_AT_DIRECTIVE_SKIP_WS;
1145 at_directive_perform (at_directive_argc, at_directive_argv,
1146 &outname, &out_lineno);
1147 obstack_free (&obstack_for_string, at_directive_argv[0]);
1148 at_directive_argc = 0;
1155 #line 134 "../../../src/scan-skel.l"
1156 fail_for_invalid_at (skel_text);
1162 /* rule 20 can match eol */
1164 #line 139 "../../../src/scan-skel.l"
1169 #line 140 "../../../src/scan-skel.l"
1170 { yyless (0); BEGIN SC_AT_DIRECTIVE_ARGS; }
1175 case YY_STATE_EOF(SC_AT_DIRECTIVE_ARGS):
1176 case YY_STATE_EOF(SC_AT_DIRECTIVE_SKIP_WS):
1177 #line 145 "../../../src/scan-skel.l"
1179 fatal (_("unclosed %s directive in skeleton"), at_directive_argv[0]);
1185 #line 150 "../../../src/scan-skel.l"
1186 YY_FATAL_ERROR( "flex scanner jammed" );
1188 #line 1189 "scan-skel.c"
1190 case YY_END_OF_BUFFER:
1192 /* Amount of text matched not including the EOB char. */
1193 int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
1195 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1196 *yy_cp = (yy_hold_char);
1197 YY_RESTORE_YY_MORE_OFFSET
1199 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
1201 /* We're scanning a new file or input source. It's
1202 * possible that this happened because the user
1203 * just pointed skel_in at a new source and called
1204 * skel_lex(). If so, then we have to assure
1205 * consistency between YY_CURRENT_BUFFER and our
1206 * globals. Here is the right place to do so, because
1207 * this is the first action (other than possibly a
1208 * back-up) that will match for the new input source.
1210 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1211 YY_CURRENT_BUFFER_LVALUE->yy_input_file = skel_in;
1212 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
1215 /* Note that here we test for yy_c_buf_p "<=" to the position
1216 * of the first EOB in the buffer, since yy_c_buf_p will
1217 * already have been incremented past the NUL character
1218 * (since all states make transitions on EOB to the
1219 * end-of-buffer state). Contrast this with the test
1222 if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1223 { /* This was really a NUL. */
1224 yy_state_type yy_next_state;
1226 (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
1228 yy_current_state = yy_get_previous_state( );
1230 /* Okay, we're now positioned to make the NUL
1231 * transition. We couldn't have
1232 * yy_get_previous_state() go ahead and do it
1233 * for us because it doesn't know how to deal
1234 * with the possibility of jamming (and we don't
1235 * want to build jamming into it because then it
1236 * will run more slowly).
1239 yy_next_state = yy_try_NUL_trans( yy_current_state );
1241 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1243 if ( yy_next_state )
1245 /* Consume the NUL. */
1246 yy_cp = ++(yy_c_buf_p);
1247 yy_current_state = yy_next_state;
1253 /* %% [14.0] code to do back-up for compressed tables and set up yy_cp goes here */
1254 yy_cp = (yy_last_accepting_cpos);
1255 yy_current_state = (yy_last_accepting_state);
1256 goto yy_find_action;
1260 else switch ( yy_get_next_buffer( ) )
1262 case EOB_ACT_END_OF_FILE:
1264 (yy_did_buffer_switch_on_eof) = 0;
1268 /* Note: because we've taken care in
1269 * yy_get_next_buffer() to have set up
1270 * skel_text, we can now set up
1271 * yy_c_buf_p so that if some total
1272 * hoser (like flex itself) wants to
1273 * call the scanner after we return the
1274 * YY_NULL, it'll still work - another
1275 * YY_NULL will get returned.
1277 (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
1279 yy_act = YY_STATE_EOF(YY_START);
1285 if ( ! (yy_did_buffer_switch_on_eof) )
1291 case EOB_ACT_CONTINUE_SCAN:
1293 (yytext_ptr) + yy_amount_of_matched_text;
1295 yy_current_state = yy_get_previous_state( );
1297 yy_cp = (yy_c_buf_p);
1298 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1301 case EOB_ACT_LAST_MATCH:
1303 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
1305 yy_current_state = yy_get_previous_state( );
1307 yy_cp = (yy_c_buf_p);
1308 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1309 goto yy_find_action;
1316 "fatal flex scanner internal error--no action found" );
1317 } /* end of action switch */
1318 } /* end of scanning one token */
1319 } /* end of skel_lex */
1320 /* %ok-for-header */
1323 /* %not-for-header */
1325 /* %ok-for-header */
1329 /* yy_get_next_buffer - try to read in a new buffer
1331 * Returns a code representing an action:
1332 * EOB_ACT_LAST_MATCH -
1333 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1334 * EOB_ACT_END_OF_FILE - end of file
1337 static int yy_get_next_buffer (void)
1342 register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1343 register char *source = (yytext_ptr);
1344 register int number_to_move, i;
1347 if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
1349 "fatal flex scanner internal error--end of buffer missed" );
1351 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1352 { /* Don't try to fill the buffer, so this is an EOF. */
1353 if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
1355 /* We matched a single character, the EOB, so
1356 * treat this as a final EOF.
1358 return EOB_ACT_END_OF_FILE;
1363 /* We matched some text prior to the EOB, first
1366 return EOB_ACT_LAST_MATCH;
1370 /* Try to read more data. */
1372 /* First move last chars to start of buffer. */
1373 number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
1375 for ( i = 0; i < number_to_move; ++i )
1376 *(dest++) = *(source++);
1378 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1379 /* don't do the read, it's not guaranteed to return an EOF,
1382 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1386 yy_size_t num_to_read =
1387 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1389 while ( num_to_read <= 0 )
1390 { /* Not enough room in the buffer - grow it. */
1392 /* just a shorter name for the current buffer */
1393 YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
1395 int yy_c_buf_p_offset =
1396 (int) ((yy_c_buf_p) - b->yy_ch_buf);
1398 if ( b->yy_is_our_buffer )
1400 yy_size_t new_size = b->yy_buf_size * 2;
1402 if ( new_size <= 0 )
1403 b->yy_buf_size += b->yy_buf_size / 8;
1405 b->yy_buf_size *= 2;
1407 b->yy_ch_buf = (char *)
1408 /* Include room in for 2 EOB chars. */
1409 skel_realloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 );
1412 /* Can't grow it, we don't own it. */
1415 if ( ! b->yy_ch_buf )
1417 "fatal error - scanner input buffer overflow" );
1419 (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
1421 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1426 if ( num_to_read > YY_READ_BUF_SIZE )
1427 num_to_read = YY_READ_BUF_SIZE;
1429 /* Read in more data. */
1430 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1431 (yy_n_chars), num_to_read );
1433 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1436 if ( (yy_n_chars) == 0 )
1438 if ( number_to_move == YY_MORE_ADJ )
1440 ret_val = EOB_ACT_END_OF_FILE;
1441 skel_restart(skel_in );
1446 ret_val = EOB_ACT_LAST_MATCH;
1447 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1448 YY_BUFFER_EOF_PENDING;
1453 ret_val = EOB_ACT_CONTINUE_SCAN;
1455 if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1456 /* Extend the array by 50%, plus the number we really need. */
1457 yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
1458 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) skel_realloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size );
1459 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1460 YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1463 (yy_n_chars) += number_to_move;
1464 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
1465 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
1467 (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1472 /* yy_get_previous_state - get the state just before the EOB char was reached */
1475 /* %not-for-header */
1477 static yy_state_type yy_get_previous_state (void)
1482 register yy_state_type yy_current_state;
1483 register char *yy_cp;
1485 /* %% [15.0] code to get the start state into yy_current_state goes here */
1486 yy_current_state = (yy_start);
1488 for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
1490 /* %% [16.0] code to find the next state goes here */
1491 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1492 if ( yy_accept[yy_current_state] )
1494 (yy_last_accepting_state) = yy_current_state;
1495 (yy_last_accepting_cpos) = yy_cp;
1497 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1499 yy_current_state = (int) yy_def[yy_current_state];
1500 if ( yy_current_state >= 45 )
1501 yy_c = yy_meta[(unsigned int) yy_c];
1503 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1506 return yy_current_state;
1509 /* yy_try_NUL_trans - try to make a transition on the NUL character
1512 * next_state = yy_try_NUL_trans( current_state );
1515 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
1520 register int yy_is_jam;
1521 /* %% [17.0] code to find the next state, and perhaps do backing up, goes here */
1522 register char *yy_cp = (yy_c_buf_p);
1524 register YY_CHAR yy_c = 1;
1525 if ( yy_accept[yy_current_state] )
1527 (yy_last_accepting_state) = yy_current_state;
1528 (yy_last_accepting_cpos) = yy_cp;
1530 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1532 yy_current_state = (int) yy_def[yy_current_state];
1533 if ( yy_current_state >= 45 )
1534 yy_c = yy_meta[(unsigned int) yy_c];
1536 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1537 yy_is_jam = (yy_current_state == 44);
1539 return yy_is_jam ? 0 : yy_current_state;
1549 static int yyinput (void)
1551 static int input (void)
1560 *(yy_c_buf_p) = (yy_hold_char);
1562 if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
1564 /* yy_c_buf_p now points to the character we want to return.
1565 * If this occurs *before* the EOB characters, then it's a
1566 * valid NUL; if not, then we've hit the end of the buffer.
1568 if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1569 /* This was really a NUL. */
1570 *(yy_c_buf_p) = '\0';
1573 { /* need more input */
1574 yy_size_t offset = (yy_c_buf_p) - (yytext_ptr);
1577 switch ( yy_get_next_buffer( ) )
1579 case EOB_ACT_LAST_MATCH:
1580 /* This happens because yy_g_n_b()
1581 * sees that we've accumulated a
1582 * token and flags that we need to
1583 * try matching the token before
1584 * proceeding. But for input(),
1585 * there's no matching to consider.
1586 * So convert the EOB_ACT_LAST_MATCH
1587 * to EOB_ACT_END_OF_FILE.
1590 /* Reset buffer status. */
1591 skel_restart(skel_in );
1595 case EOB_ACT_END_OF_FILE:
1600 if ( ! (yy_did_buffer_switch_on_eof) )
1609 case EOB_ACT_CONTINUE_SCAN:
1610 (yy_c_buf_p) = (yytext_ptr) + offset;
1616 c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
1617 *(yy_c_buf_p) = '\0'; /* preserve skel_text */
1618 (yy_hold_char) = *++(yy_c_buf_p);
1620 /* %% [19.0] update BOL and skel_lineno */
1625 #endif /* ifndef YY_NO_INPUT */
1628 /** Immediately switch to a different input stream.
1629 * @param input_file A readable stream.
1631 * @note This function does not reset the start condition to @c INITIAL .
1634 void skel_restart (FILE * input_file )
1640 if ( ! YY_CURRENT_BUFFER ){
1641 skel_ensure_buffer_stack ();
1642 YY_CURRENT_BUFFER_LVALUE =
1643 skel__create_buffer(skel_in,YY_BUF_SIZE );
1646 skel__init_buffer(YY_CURRENT_BUFFER,input_file );
1647 skel__load_buffer_state( );
1650 /** Switch to a different input buffer.
1651 * @param new_buffer The new input buffer.
1655 void skel__switch_to_buffer (YY_BUFFER_STATE new_buffer )
1661 /* TODO. We should be able to replace this entire function body
1663 * skel_pop_buffer_state();
1664 * skel_push_buffer_state(new_buffer);
1666 skel_ensure_buffer_stack ();
1667 if ( YY_CURRENT_BUFFER == new_buffer )
1670 if ( YY_CURRENT_BUFFER )
1672 /* Flush out information for old buffer. */
1673 *(yy_c_buf_p) = (yy_hold_char);
1674 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1675 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1678 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1679 skel__load_buffer_state( );
1681 /* We don't actually know whether we did this switch during
1682 * EOF (skel_wrap()) processing, but the only time this flag
1683 * is looked at is after skel_wrap() is called, so it's safe
1684 * to go ahead and always set it.
1686 (yy_did_buffer_switch_on_eof) = 1;
1690 static void skel__load_buffer_state (void)
1695 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1696 (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1697 skel_in = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1698 (yy_hold_char) = *(yy_c_buf_p);
1701 /** Allocate and initialize an input buffer state.
1702 * @param file A readable stream.
1703 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
1705 * @return the allocated buffer state.
1708 YY_BUFFER_STATE skel__create_buffer (FILE * file, int size )
1715 b = (YY_BUFFER_STATE) skel_alloc(sizeof( struct yy_buffer_state ) );
1717 YY_FATAL_ERROR( "out of dynamic memory in skel__create_buffer()" );
1719 b->yy_buf_size = size;
1721 /* yy_ch_buf has to be 2 characters longer than the size given because
1722 * we need to put in 2 end-of-buffer characters.
1724 b->yy_ch_buf = (char *) skel_alloc(b->yy_buf_size + 2 );
1725 if ( ! b->yy_ch_buf )
1726 YY_FATAL_ERROR( "out of dynamic memory in skel__create_buffer()" );
1728 b->yy_is_our_buffer = 1;
1730 skel__init_buffer(b,file );
1735 /** Destroy the buffer.
1736 * @param b a buffer created with skel__create_buffer()
1740 void skel__delete_buffer (YY_BUFFER_STATE b )
1749 if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
1750 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
1752 if ( b->yy_is_our_buffer )
1753 skel_free((void *) b->yy_ch_buf );
1755 skel_free((void *) b );
1758 /* Initializes or reinitializes a buffer.
1759 * This function is sometimes called more than once on the same buffer,
1760 * such as during a skel_restart() or at EOF.
1763 static void skel__init_buffer (YY_BUFFER_STATE b, FILE * file )
1771 skel__flush_buffer(b );
1773 b->yy_input_file = file;
1774 b->yy_fill_buffer = 1;
1776 /* If b is the current buffer, then skel__init_buffer was _probably_
1777 * called from skel_restart() or through yy_get_next_buffer.
1778 * In that case, we don't want to reset the lineno or column.
1780 if (b != YY_CURRENT_BUFFER){
1781 b->yy_bs_lineno = 1;
1782 b->yy_bs_column = 0;
1787 b->yy_is_interactive = 0;
1795 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
1796 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
1800 void skel__flush_buffer (YY_BUFFER_STATE b )
1810 /* We always need two end-of-buffer characters. The first causes
1811 * a transition to the end-of-buffer state. The second causes
1812 * a jam in that state.
1814 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1815 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1817 b->yy_buf_pos = &b->yy_ch_buf[0];
1820 b->yy_buffer_status = YY_BUFFER_NEW;
1822 if ( b == YY_CURRENT_BUFFER )
1823 skel__load_buffer_state( );
1827 /** Pushes the new state onto the stack. The new state becomes
1828 * the current state. This function will allocate the stack
1830 * @param new_buffer The new state.
1834 void skel_push_buffer_state (YY_BUFFER_STATE new_buffer )
1839 if (new_buffer == NULL)
1842 skel_ensure_buffer_stack();
1844 /* This block is copied from skel__switch_to_buffer. */
1845 if ( YY_CURRENT_BUFFER )
1847 /* Flush out information for old buffer. */
1848 *(yy_c_buf_p) = (yy_hold_char);
1849 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1850 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1853 /* Only push if top exists. Otherwise, replace top. */
1854 if (YY_CURRENT_BUFFER)
1855 (yy_buffer_stack_top)++;
1856 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1858 /* copied from skel__switch_to_buffer. */
1859 skel__load_buffer_state( );
1860 (yy_did_buffer_switch_on_eof) = 1;
1865 /** Removes and deletes the top of the stack, if present.
1866 * The next element becomes the new top.
1870 void skel_pop_buffer_state (void)
1875 if (!YY_CURRENT_BUFFER)
1878 skel__delete_buffer(YY_CURRENT_BUFFER );
1879 YY_CURRENT_BUFFER_LVALUE = NULL;
1880 if ((yy_buffer_stack_top) > 0)
1881 --(yy_buffer_stack_top);
1883 if (YY_CURRENT_BUFFER) {
1884 skel__load_buffer_state( );
1885 (yy_did_buffer_switch_on_eof) = 1;
1891 /* Allocates the stack if it does not exist.
1892 * Guarantees space for at least one push.
1895 static void skel_ensure_buffer_stack (void)
1900 yy_size_t num_to_alloc;
1902 if (!(yy_buffer_stack)) {
1904 /* First allocation is just for 2 elements, since we don't know if this
1905 * scanner will even need a stack. We use 2 instead of 1 to avoid an
1906 * immediate realloc on the next call.
1909 (yy_buffer_stack) = (struct yy_buffer_state**)skel_alloc
1910 (num_to_alloc * sizeof(struct yy_buffer_state*)
1912 if ( ! (yy_buffer_stack) )
1913 YY_FATAL_ERROR( "out of dynamic memory in skel_ensure_buffer_stack()" );
1915 memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
1917 (yy_buffer_stack_max) = num_to_alloc;
1918 (yy_buffer_stack_top) = 0;
1922 if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
1924 /* Increase the buffer to prepare for a possible push. */
1925 int grow_size = 8 /* arbitrary grow size */;
1927 num_to_alloc = (yy_buffer_stack_max) + grow_size;
1928 (yy_buffer_stack) = (struct yy_buffer_state**)skel_realloc
1930 num_to_alloc * sizeof(struct yy_buffer_state*)
1932 if ( ! (yy_buffer_stack) )
1933 YY_FATAL_ERROR( "out of dynamic memory in skel_ensure_buffer_stack()" );
1935 /* zero only the new slots.*/
1936 memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
1937 (yy_buffer_stack_max) = num_to_alloc;
1943 /** Setup the input buffer state to scan directly from a user-specified character buffer.
1944 * @param base the character buffer
1945 * @param size the size in bytes of the character buffer
1947 * @return the newly allocated buffer state object.
1949 YY_BUFFER_STATE skel__scan_buffer (char * base, yy_size_t size )
1954 base[size-2] != YY_END_OF_BUFFER_CHAR ||
1955 base[size-1] != YY_END_OF_BUFFER_CHAR )
1956 /* They forgot to leave room for the EOB's. */
1959 b = (YY_BUFFER_STATE) skel_alloc(sizeof( struct yy_buffer_state ) );
1961 YY_FATAL_ERROR( "out of dynamic memory in skel__scan_buffer()" );
1963 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
1964 b->yy_buf_pos = b->yy_ch_buf = base;
1965 b->yy_is_our_buffer = 0;
1966 b->yy_input_file = 0;
1967 b->yy_n_chars = b->yy_buf_size;
1968 b->yy_is_interactive = 0;
1970 b->yy_fill_buffer = 0;
1971 b->yy_buffer_status = YY_BUFFER_NEW;
1973 skel__switch_to_buffer(b );
1980 /** Setup the input buffer state to scan a string. The next call to skel_lex() will
1981 * scan from a @e copy of @a str.
1982 * @param yystr a NUL-terminated string to scan
1984 * @return the newly allocated buffer state object.
1985 * @note If you want to scan bytes that may contain NUL values, then use
1986 * skel__scan_bytes() instead.
1988 YY_BUFFER_STATE skel__scan_string (yyconst char * yystr )
1991 return skel__scan_bytes(yystr,strlen(yystr) );
1996 /** Setup the input buffer state to scan the given bytes. The next call to skel_lex() will
1997 * scan from a @e copy of @a bytes.
1998 * @param yybytes the byte buffer to scan
1999 * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
2001 * @return the newly allocated buffer state object.
2003 YY_BUFFER_STATE skel__scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len )
2010 /* Get memory for full buffer, including space for trailing EOB's. */
2011 n = _yybytes_len + 2;
2012 buf = (char *) skel_alloc(n );
2014 YY_FATAL_ERROR( "out of dynamic memory in skel__scan_bytes()" );
2016 for ( i = 0; i < _yybytes_len; ++i )
2017 buf[i] = yybytes[i];
2019 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
2021 b = skel__scan_buffer(buf,n );
2023 YY_FATAL_ERROR( "bad buffer in skel__scan_bytes()" );
2025 /* It's okay to grow etc. this buffer, and we should throw it
2026 * away when we're done.
2028 b->yy_is_our_buffer = 1;
2034 #ifndef YY_EXIT_FAILURE
2035 #define YY_EXIT_FAILURE 2
2039 static void yy_fatal_error (yyconst char* msg )
2041 (void) fprintf( stderr, "%s\n", msg );
2042 exit( YY_EXIT_FAILURE );
2048 /* Redefine yyless() so it works in section 3 code. */
2054 /* Undo effects of setting up skel_text. */ \
2055 int yyless_macro_arg = (n); \
2056 YY_LESS_LINENO(yyless_macro_arg);\
2057 skel_text[skel_leng] = (yy_hold_char); \
2058 (yy_c_buf_p) = skel_text + yyless_macro_arg; \
2059 (yy_hold_char) = *(yy_c_buf_p); \
2060 *(yy_c_buf_p) = '\0'; \
2061 skel_leng = yyless_macro_arg; \
2065 /* Accessor methods (get/set functions) to struct members. */
2071 /** Get the current line number.
2074 int skel_get_lineno (void)
2080 /** Get the input stream.
2083 FILE *skel_get_in (void)
2088 /** Get the output stream.
2091 FILE *skel_get_out (void)
2096 /** Get the length of the current token.
2099 yy_size_t skel_get_leng (void)
2104 /** Get the current token.
2108 char *skel_get_text (void)
2116 /** Set the current line number.
2117 * @param line_number
2120 void skel_set_lineno (int line_number )
2123 skel_lineno = line_number;
2126 /** Set the input stream. This does not discard the current
2128 * @param in_str A readable stream.
2130 * @see skel__switch_to_buffer
2132 void skel_set_in (FILE * in_str )
2137 void skel_set_out (FILE * out_str )
2139 skel_out = out_str ;
2142 int skel_get_debug (void)
2144 return skel__flex_debug;
2147 void skel_set_debug (int bdebug )
2149 skel__flex_debug = bdebug ;
2155 /* %if-bison-bridge */
2157 /* %endif if-c-only */
2160 static int yy_init_globals (void)
2162 /* Initialization is the same as for the non-reentrant scanner.
2163 * This function is called from skel_lex_destroy(), so don't allocate here.
2166 (yy_buffer_stack) = 0;
2167 (yy_buffer_stack_top) = 0;
2168 (yy_buffer_stack_max) = 0;
2169 (yy_c_buf_p) = (char *) 0;
2173 /* Defined in main.c */
2178 skel_in = (FILE *) 0;
2179 skel_out = (FILE *) 0;
2182 /* For future reference: Set errno on error, since we are called by
2189 /* %if-c-only SNIP! this currently causes conflicts with the c++ scanner */
2190 /* skel_lex_destroy is for both reentrant and non-reentrant scanners. */
2191 int skel_lex_destroy (void)
2194 /* Pop the buffer stack, destroying each element. */
2195 while(YY_CURRENT_BUFFER){
2196 skel__delete_buffer(YY_CURRENT_BUFFER );
2197 YY_CURRENT_BUFFER_LVALUE = NULL;
2198 skel_pop_buffer_state();
2201 /* Destroy the stack itself. */
2202 skel_free((yy_buffer_stack) );
2203 (yy_buffer_stack) = NULL;
2205 /* Reset the globals. This is important in a non-reentrant scanner so the next time
2206 * skel_lex() is called, initialization will occur. */
2216 * Internal utility routines.
2220 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
2223 for ( i = 0; i < n; ++i )
2228 #ifdef YY_NEED_STRLEN
2229 static int yy_flex_strlen (yyconst char * s )
2232 for ( n = 0; s[n]; ++n )
2239 void *skel_alloc (yy_size_t size )
2241 return (void *) malloc( size );
2244 void *skel_realloc (void * ptr, yy_size_t size )
2246 /* The cast to (char *) in the following accommodates both
2247 * implementations that use char* generic pointers, and those
2248 * that use void* generic pointers. It works with the latter
2249 * because both ANSI C and C++ allow castless assignment from
2250 * any pointer type to void*, and deal with argument conversions
2251 * as though doing an assignment.
2253 return (void *) realloc( (char *) ptr, size );
2256 void skel_free (void * ptr )
2258 free( (char *) ptr ); /* see skel_realloc() for (char *) cast */
2261 /* %if-tables-serialization definitions */
2262 /* %define-yytables The name for this specific scanner's tables. */
2263 #define YYTABLES_NAME "yytables"
2266 /* %ok-for-header */
2268 #line 150 "../../../src/scan-skel.l"
2272 /*------------------------.
2273 | Scan a Bison skeleton. |
2274 `------------------------*/
2277 scan_skel (FILE *in)
2279 static bool initialized = false;
2283 obstack_init (&obstack_for_string);
2286 skel__flex_debug = trace_flag & trace_skeleton;
2291 skel_scanner_free (void)
2293 obstack_free (&obstack_for_string, 0);
2294 /* Reclaim Flex's buffers. */
2295 skel_lex_destroy ();
2299 at_directive_perform (int at_directive_argc,
2300 char *at_directive_argv[],
2301 char **outnamep, int *out_linenop)
2303 if (0 == strcmp (at_directive_argv[0], "@basename"))
2305 if (at_directive_argc > 2)
2306 fail_for_at_directive_too_many_args (at_directive_argv[0]);
2307 fputs (last_component (at_directive_argv[1]), skel_out);
2309 else if (0 == strcmp (at_directive_argv[0], "@warn")
2310 || 0 == strcmp (at_directive_argv[0], "@complain")
2311 || 0 == strcmp (at_directive_argv[0], "@fatal"))
2313 void (*func)(char const *, ...);
2314 switch (at_directive_argv[0][1])
2316 case 'w': func = warn; break;
2317 case 'c': func = complain; break;
2318 case 'f': func = fatal; break;
2319 default: aver (false); break;
2321 switch (at_directive_argc)
2324 func (_(at_directive_argv[1]));
2327 func (_(at_directive_argv[1]), at_directive_argv[2]);
2330 func (_(at_directive_argv[1]), at_directive_argv[2],
2331 at_directive_argv[3]);
2334 func (_(at_directive_argv[1]), at_directive_argv[2],
2335 at_directive_argv[3], at_directive_argv[4]);
2338 func (_(at_directive_argv[1]), at_directive_argv[2],
2339 at_directive_argv[3], at_directive_argv[4],
2340 at_directive_argv[5]);
2343 fail_for_at_directive_too_many_args (at_directive_argv[0]);
2347 else if (0 == strcmp (at_directive_argv[0], "@warn_at")
2348 || 0 == strcmp (at_directive_argv[0], "@complain_at")
2349 || 0 == strcmp (at_directive_argv[0], "@fatal_at"))
2351 void (*func)(location, char const *, ...);
2353 if (at_directive_argc < 4)
2354 fail_for_at_directive_too_few_args (at_directive_argv[0]);
2355 switch (at_directive_argv[0][1])
2357 case 'w': func = warn_at; break;
2358 case 'c': func = complain_at; break;
2359 case 'f': func = fatal_at; break;
2360 default: aver (false); break;
2362 boundary_set_from_string (&loc.start, at_directive_argv[1]);
2363 boundary_set_from_string (&loc.end, at_directive_argv[2]);
2364 switch (at_directive_argc)
2367 func (loc, _(at_directive_argv[3]));
2370 func (loc, _(at_directive_argv[3]), at_directive_argv[4]);
2373 func (loc, _(at_directive_argv[3]), at_directive_argv[4],
2374 at_directive_argv[5]);
2377 func (loc, _(at_directive_argv[3]), at_directive_argv[4],
2378 at_directive_argv[5], at_directive_argv[6]);
2381 func (loc, _(at_directive_argv[3]), at_directive_argv[4],
2382 at_directive_argv[5], at_directive_argv[6],
2383 at_directive_argv[7]);
2386 fail_for_at_directive_too_many_args (at_directive_argv[0]);
2390 else if (0 == strcmp (at_directive_argv[0], "@output"))
2392 if (at_directive_argc > 2)
2393 fail_for_at_directive_too_many_args (at_directive_argv[0]);
2399 *outnamep = xstrdup (at_directive_argv[1]);
2400 output_file_name_check (outnamep);
2401 skel_out = xfopen (*outnamep, "w");
2405 fail_for_invalid_at (at_directive_argv[0]);
2409 fail_for_at_directive_too_few_args (char const *at_directive_name)
2411 fatal (_("too few arguments for %s directive in skeleton"),
2416 fail_for_at_directive_too_many_args (char const *at_directive_name)
2418 fatal (_("too many arguments for %s directive in skeleton"),
2423 fail_for_invalid_at (char const *at)
2425 fatal ("invalid @ in skeleton: %s", at);