source: trunk/orbital/generated/gun-scanner.cpp @ 1416

Last change on this file since 1416 was 1416, checked in by sam, 8 years ago

orbital: parser for the gun commands... fails to link because of flex.

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