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