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