Root/jzboot/src/shell_lex.c

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

Archive Download this file



interactive