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