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