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