1
#line 2 "libxlu_disk_l.c"
2
#line 31 "libxlu_disk_l.l"
3
#include "libxl_osdeps.h" /* must come before any other headers */
7
#line 8 "libxlu_disk_l.c"
9
#define YY_INT_ALIGNED short int
11
/* A lexical scanner generated by flex */
14
#define YY_FLEX_MAJOR_VERSION 2
15
#define YY_FLEX_MINOR_VERSION 5
16
#define YY_FLEX_SUBMINOR_VERSION 35
17
#if YY_FLEX_SUBMINOR_VERSION > 0
21
/* First, we deal with platform-specific or compiler-specific issues. */
23
/* begin standard C headers. */
29
/* end standard C headers. */
31
/* flex integer type definitions */
36
/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
38
#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
40
/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
41
* if you want the limit (max/min) macros for int types.
43
#ifndef __STDC_LIMIT_MACROS
44
#define __STDC_LIMIT_MACROS 1
48
typedef int8_t flex_int8_t;
49
typedef uint8_t flex_uint8_t;
50
typedef int16_t flex_int16_t;
51
typedef uint16_t flex_uint16_t;
52
typedef int32_t flex_int32_t;
53
typedef uint32_t flex_uint32_t;
55
typedef signed char flex_int8_t;
56
typedef short int flex_int16_t;
57
typedef int flex_int32_t;
58
typedef unsigned char flex_uint8_t;
59
typedef unsigned short int flex_uint16_t;
60
typedef unsigned int flex_uint32_t;
62
/* Limits of integral types. */
64
#define INT8_MIN (-128)
67
#define INT16_MIN (-32767-1)
70
#define INT32_MIN (-2147483647-1)
73
#define INT8_MAX (127)
76
#define INT16_MAX (32767)
79
#define INT32_MAX (2147483647)
82
#define UINT8_MAX (255U)
85
#define UINT16_MAX (65535U)
88
#define UINT32_MAX (4294967295U)
93
#endif /* ! FLEXINT_H */
97
/* The "const" storage-class-modifier is valid. */
100
#else /* ! __cplusplus */
102
/* C99 requires __STDC__ to be defined as 1. */
103
#if defined (__STDC__)
107
#endif /* defined (__STDC__) */
108
#endif /* ! __cplusplus */
111
#define yyconst const
116
/* Returned upon end-of-file. */
119
/* Promotes a possibly negative, possibly signed char to an unsigned
120
* integer for use as an array index. If the signed char is negative,
121
* we want to instead treat it as an 8-bit unsigned char, hence the
124
#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
126
/* An opaque pointer. */
127
#ifndef YY_TYPEDEF_YY_SCANNER_T
128
#define YY_TYPEDEF_YY_SCANNER_T
129
typedef void* yyscan_t;
132
/* For convenience, these vars (plus the bison vars far below)
133
are macros in the reentrant scanner. */
134
#define yyin yyg->yyin_r
135
#define yyout yyg->yyout_r
136
#define yyextra yyg->yyextra_r
137
#define yyleng yyg->yyleng_r
138
#define yytext yyg->yytext_r
139
#define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno)
140
#define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column)
141
#define yy_flex_debug yyg->yy_flex_debug_r
143
/* Enter a start condition. This macro really ought to take a parameter,
144
* but we do it the disgusting crufty way forced on us by the ()-less
145
* definition of BEGIN.
147
#define BEGIN yyg->yy_start = 1 + 2 *
149
/* Translate the current start state into a value that can be later handed
150
* to BEGIN to return to the state. The YYSTATE alias is for lex
153
#define YY_START ((yyg->yy_start - 1) / 2)
154
#define YYSTATE YY_START
156
/* Action number for EOF rule of a given start state. */
157
#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
159
/* Special action meaning "start processing a new file". */
160
#define YY_NEW_FILE xlu__disk_yyrestart(yyin ,yyscanner )
162
#define YY_END_OF_BUFFER_CHAR 0
164
/* Size of default input buffer. */
167
/* On IA-64, the buffer size is 16k, not 8k.
168
* Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
169
* Ditto for the __ia64__ case accordingly.
171
#define YY_BUF_SIZE 32768
173
#define YY_BUF_SIZE 16384
174
#endif /* __ia64__ */
177
/* The state buf must be large enough to hold one state per character in the main buffer.
179
#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
181
#ifndef YY_TYPEDEF_YY_BUFFER_STATE
182
#define YY_TYPEDEF_YY_BUFFER_STATE
183
typedef struct yy_buffer_state *YY_BUFFER_STATE;
186
#define EOB_ACT_CONTINUE_SCAN 0
187
#define EOB_ACT_END_OF_FILE 1
188
#define EOB_ACT_LAST_MATCH 2
190
#define YY_LESS_LINENO(n)
192
/* Return all but the first "n" matched characters back to the input stream. */
196
/* Undo effects of setting up yytext. */ \
197
int yyless_macro_arg = (n); \
198
YY_LESS_LINENO(yyless_macro_arg);\
199
*yy_cp = yyg->yy_hold_char; \
200
YY_RESTORE_YY_MORE_OFFSET \
201
yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
202
YY_DO_BEFORE_ACTION; /* set up yytext again */ \
206
#define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner )
208
#ifndef YY_TYPEDEF_YY_SIZE_T
209
#define YY_TYPEDEF_YY_SIZE_T
210
typedef size_t yy_size_t;
213
#ifndef YY_STRUCT_YY_BUFFER_STATE
214
#define YY_STRUCT_YY_BUFFER_STATE
215
struct yy_buffer_state
219
char *yy_ch_buf; /* input buffer */
220
char *yy_buf_pos; /* current position in input buffer */
222
/* Size of input buffer in bytes, not including room for EOB
225
yy_size_t yy_buf_size;
227
/* Number of characters read into yy_ch_buf, not including EOB
232
/* Whether we "own" the buffer - i.e., we know we created it,
233
* and can realloc() it to grow it, and should free() it to
236
int yy_is_our_buffer;
238
/* Whether this is an "interactive" input source; if so, and
239
* if we're using stdio for input, then we want to use getc()
240
* instead of fread(), to make sure we stop fetching input after
243
int yy_is_interactive;
245
/* Whether we're considered to be at the beginning of a line.
246
* If so, '^' rules will be active on the next match, otherwise
251
int yy_bs_lineno; /**< The line count. */
252
int yy_bs_column; /**< The column count. */
254
/* Whether to try to fill the input buffer when we reach the
259
int yy_buffer_status;
261
#define YY_BUFFER_NEW 0
262
#define YY_BUFFER_NORMAL 1
263
/* When an EOF's been seen but there's still some text to process
264
* then we mark the buffer as YY_EOF_PENDING, to indicate that we
265
* shouldn't try reading from the input source any more. We might
266
* still have a bunch of tokens to match, though, because of
267
* possible backing-up.
269
* When we actually see the EOF, we change the status to "new"
270
* (via xlu__disk_yyrestart()), so that the user can continue scanning by
271
* just pointing yyin at a new input file.
273
#define YY_BUFFER_EOF_PENDING 2
276
#endif /* !YY_STRUCT_YY_BUFFER_STATE */
278
/* We provide macros for accessing buffer states in case in the
279
* future we want to put the buffer states in a more general
282
* Returns the top of the stack, or NULL.
284
#define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \
285
? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \
288
/* Same as previous macro, but useful when we know that the buffer stack is not
289
* NULL or when we need an lvalue. For internal use only.
291
#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]
293
void xlu__disk_yyrestart (FILE *input_file ,yyscan_t yyscanner );
294
void xlu__disk_yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
295
YY_BUFFER_STATE xlu__disk_yy_create_buffer (FILE *file,int size ,yyscan_t yyscanner );
296
void xlu__disk_yy_delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
297
void xlu__disk_yy_flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
298
void xlu__disk_yypush_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
299
void xlu__disk_yypop_buffer_state (yyscan_t yyscanner );
301
static void xlu__disk_yyensure_buffer_stack (yyscan_t yyscanner );
302
static void xlu__disk_yy_load_buffer_state (yyscan_t yyscanner );
303
static void xlu__disk_yy_init_buffer (YY_BUFFER_STATE b,FILE *file ,yyscan_t yyscanner );
305
#define YY_FLUSH_BUFFER xlu__disk_yy_flush_buffer(YY_CURRENT_BUFFER ,yyscanner)
307
YY_BUFFER_STATE xlu__disk_yy_scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner );
308
YY_BUFFER_STATE xlu__disk_yy_scan_string (yyconst char *yy_str ,yyscan_t yyscanner );
309
YY_BUFFER_STATE xlu__disk_yy_scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner );
311
void *xlu__disk_yyalloc (yy_size_t ,yyscan_t yyscanner );
312
void *xlu__disk_yyrealloc (void *,yy_size_t ,yyscan_t yyscanner );
313
void xlu__disk_yyfree (void * ,yyscan_t yyscanner );
315
#define yy_new_buffer xlu__disk_yy_create_buffer
317
#define yy_set_interactive(is_interactive) \
319
if ( ! YY_CURRENT_BUFFER ){ \
320
xlu__disk_yyensure_buffer_stack (yyscanner); \
321
YY_CURRENT_BUFFER_LVALUE = \
322
xlu__disk_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
324
YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
327
#define yy_set_bol(at_bol) \
329
if ( ! YY_CURRENT_BUFFER ){\
330
xlu__disk_yyensure_buffer_stack (yyscanner); \
331
YY_CURRENT_BUFFER_LVALUE = \
332
xlu__disk_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
334
YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
337
#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
339
#define xlu__disk_yywrap(n) 1
340
#define YY_SKIP_YYWRAP
342
typedef unsigned char YY_CHAR;
344
typedef int yy_state_type;
346
#define yytext_ptr yytext_r
348
static yy_state_type yy_get_previous_state (yyscan_t yyscanner );
349
static yy_state_type yy_try_NUL_trans (yy_state_type current_state ,yyscan_t yyscanner);
350
static int yy_get_next_buffer (yyscan_t yyscanner );
351
static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner );
353
/* Done after the current pattern has been matched and before the
354
* corresponding action - sets up yytext.
356
#define YY_DO_BEFORE_ACTION \
357
yyg->yytext_ptr = yy_bp; \
358
yyg->yytext_ptr -= yyg->yy_more_len; \
359
yyleng = (size_t) (yy_cp - yyg->yytext_ptr); \
360
yyg->yy_hold_char = *yy_cp; \
362
yyg->yy_c_buf_p = yy_cp;
364
#define YY_NUM_RULES 25
365
#define YY_END_OF_BUFFER 26
366
/* This struct is not used in this scanner,
367
but its presence is necessary. */
370
flex_int32_t yy_verify;
373
static yyconst flex_int16_t yy_acclist[447] =
375
24, 24, 26, 22, 23, 25, 8193, 22, 23, 25,
376
16385, 8193, 22, 25,16385, 22, 23, 25, 23, 25,
377
22, 23, 25, 22, 23, 25, 22, 23, 25, 22,
378
23, 25, 22, 23, 25, 22, 23, 25, 22, 23,
379
25, 22, 23, 25, 22, 23, 25, 22, 23, 25,
380
22, 23, 25, 22, 23, 25, 22, 23, 25, 22,
381
23, 25, 22, 23, 25, 24, 25, 25, 22, 22,
382
8193, 22, 8193, 22,16385, 8193, 22, 8193, 22, 22,
383
8213, 22,16405, 22, 22, 22, 22, 22, 22, 22,
384
22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
386
22, 22, 24, 8193, 22, 8193, 22, 8193, 8213, 22,
387
8213, 22, 8213, 12, 22, 22, 22, 22, 22, 22,
388
22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
389
22, 22, 8213, 22, 8213, 22, 8213, 12, 22, 17,
390
8213, 22,16405, 22, 22, 22, 22, 22, 22, 22,
391
8206, 8213, 22,16398,16405, 20, 8213, 22,16405, 22,
392
8205, 8213, 22,16397,16405, 22, 22, 8208, 8213, 22,
393
16400,16405, 22, 22, 22, 22, 17, 8213, 22, 17,
394
8213, 22, 17, 22, 17, 8213, 22, 3, 22, 22,
395
19, 8213, 22,16405, 22, 22, 8206, 8213, 22, 8206,
397
8213, 22, 8206, 22, 8206, 8213, 20, 8213, 22, 20,
398
8213, 22, 20, 22, 20, 8213, 8205, 8213, 22, 8205,
399
8213, 22, 8205, 22, 8205, 8213, 22, 8208, 8213, 22,
400
8208, 8213, 22, 8208, 22, 8208, 8213, 22, 22, 9,
401
22, 17, 8213, 22, 17, 8213, 22, 17, 8213, 17,
402
22, 17, 22, 3, 22, 22, 19, 8213, 22, 19,
403
8213, 22, 19, 22, 19, 8213, 22, 18, 8213, 22,
404
16405, 8206, 8213, 22, 8206, 8213, 22, 8206, 8213, 8206,
405
22, 8206, 20, 8213, 22, 20, 8213, 22, 20, 8213,
406
20, 22, 20, 8205, 8213, 22, 8205, 8213, 22, 8205,
408
8213, 8205, 22, 8205, 22, 8208, 8213, 22, 8208, 8213,
409
22, 8208, 8213, 8208, 22, 8208, 22, 22, 9, 12,
410
9, 7, 22, 22, 19, 8213, 22, 19, 8213, 22,
411
19, 8213, 19, 22, 19, 2, 18, 8213, 22, 18,
412
8213, 22, 18, 22, 18, 8213, 10, 22, 11, 9,
413
9, 12, 7, 12, 7, 22, 6, 2, 12, 2,
414
18, 8213, 22, 18, 8213, 22, 18, 8213, 18, 22,
415
18, 10, 12, 10, 15, 8213, 22,16405, 11, 12,
416
11, 7, 7, 12, 22, 6, 12, 6, 6, 12,
417
6, 12, 2, 2, 12, 10, 10, 12, 15, 8213,
419
22, 15, 8213, 22, 15, 22, 15, 8213, 11, 12,
420
22, 6, 6, 12, 6, 6, 15, 8213, 22, 15,
421
8213, 22, 15, 8213, 15, 22, 15, 22, 6, 6,
422
8, 6, 5, 6, 8, 12, 8, 4, 6, 5,
426
static yyconst flex_int16_t yy_accept[252] =
428
1, 1, 1, 2, 3, 4, 7, 12, 16, 19,
429
21, 24, 27, 30, 33, 36, 39, 42, 45, 48,
430
51, 54, 57, 60, 63, 66, 68, 69, 70, 71,
431
73, 76, 78, 79, 80, 81, 84, 84, 85, 86,
432
87, 88, 89, 90, 91, 92, 93, 94, 95, 96,
433
97, 98, 99, 100, 101, 102, 103, 104, 106, 108,
434
109, 111, 113, 114, 115, 116, 117, 118, 119, 120,
435
121, 122, 123, 124, 125, 126, 127, 128, 129, 130,
436
131, 132, 133, 135, 137, 138, 139, 140, 144, 145,
437
146, 147, 148, 149, 150, 151, 156, 160, 161, 166,
439
167, 168, 173, 174, 175, 176, 177, 180, 183, 185,
440
187, 188, 190, 191, 195, 196, 197, 200, 203, 205,
441
207, 210, 213, 215, 217, 220, 223, 225, 227, 228,
442
231, 234, 236, 238, 239, 240, 241, 242, 245, 248,
443
250, 252, 253, 254, 256, 257, 260, 263, 265, 267,
444
268, 272, 275, 278, 280, 282, 283, 286, 289, 291,
445
293, 294, 297, 300, 302, 304, 305, 306, 309, 312,
446
314, 316, 317, 318, 319, 321, 322, 323, 324, 325,
447
328, 331, 333, 335, 336, 337, 340, 343, 345, 347,
448
348, 349, 350, 351, 353, 355, 356, 357, 358, 360,
450
361, 364, 367, 369, 371, 372, 374, 375, 379, 381,
451
382, 383, 385, 386, 388, 389, 391, 393, 394, 396,
452
397, 399, 402, 405, 407, 409, 411, 412, 413, 415,
453
416, 417, 420, 423, 425, 427, 428, 429, 430, 431,
454
432, 433, 435, 437, 438, 440, 442, 443, 445, 447,
458
static yyconst flex_int32_t yy_ec[256] =
460
1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
461
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
462
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
463
1, 2, 1, 1, 1, 1, 1, 1, 1, 1,
464
1, 1, 1, 4, 5, 1, 1, 6, 6, 7,
465
6, 6, 6, 6, 6, 6, 6, 8, 1, 1,
466
9, 1, 1, 1, 1, 1, 1, 1, 1, 1,
467
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
468
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
469
1, 1, 1, 1, 1, 1, 10, 11, 12, 13,
471
14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
472
24, 25, 26, 27, 28, 29, 30, 31, 32, 19,
473
33, 19, 1, 1, 1, 1, 1, 1, 1, 1,
474
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
475
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
476
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
477
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
478
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
479
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
480
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
482
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
483
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
484
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
485
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
486
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
490
static yyconst flex_int32_t yy_meta[34] =
492
1, 1, 2, 3, 1, 1, 1, 1, 4, 1,
493
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
494
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
498
static yyconst flex_int16_t yy_base[308] =
500
0, 0, 546, 538, 533, 521, 32, 35, 656, 656,
501
44, 62, 30, 41, 50, 51, 507, 64, 47, 66,
502
67, 499, 68, 487, 72, 0, 656, 465, 656, 87,
503
91, 0, 0, 100, 452, 109, 0, 74, 95, 87,
504
32, 96, 105, 110, 77, 97, 40, 113, 116, 112,
505
118, 120, 121, 122, 123, 125, 0, 137, 0, 0,
506
147, 0, 0, 449, 129, 126, 134, 143, 145, 147,
507
148, 149, 151, 153, 156, 160, 155, 167, 162, 175,
508
168, 159, 188, 0, 0, 656, 166, 197, 179, 185,
509
176, 200, 435, 186, 193, 216, 225, 205, 234, 221,
511
237, 247, 204, 230, 244, 213, 254, 0, 256, 0,
512
251, 258, 254, 279, 256, 259, 267, 0, 269, 0,
513
286, 0, 288, 0, 290, 0, 297, 0, 267, 299,
514
0, 301, 0, 288, 297, 421, 302, 310, 0, 0,
515
0, 0, 305, 656, 307, 319, 0, 321, 0, 322,
516
332, 335, 0, 0, 0, 0, 339, 0, 0, 0,
517
0, 342, 0, 0, 0, 0, 340, 349, 0, 0,
518
0, 0, 337, 345, 420, 656, 419, 346, 350, 358,
519
0, 0, 0, 0, 418, 360, 0, 362, 0, 417,
520
319, 369, 416, 656, 415, 656, 276, 364, 414, 656,
522
375, 0, 0, 0, 0, 413, 656, 384, 412, 0,
523
410, 656, 370, 409, 656, 370, 378, 408, 656, 366,
524
656, 394, 0, 396, 0, 0, 380, 316, 656, 377,
525
387, 398, 0, 0, 0, 0, 399, 402, 407, 271,
526
406, 228, 200, 656, 175, 656, 77, 656, 656, 656,
527
428, 432, 435, 439, 443, 447, 451, 455, 459, 463,
528
467, 471, 475, 479, 483, 487, 491, 495, 499, 503,
529
507, 511, 515, 519, 523, 527, 531, 535, 539, 543,
530
547, 551, 555, 559, 563, 567, 571, 575, 579, 583,
531
587, 591, 595, 599, 603, 607, 611, 615, 619, 623,
533
627, 631, 635, 639, 643, 647, 651
536
static yyconst flex_int16_t yy_def[308] =
538
250, 1, 251, 251, 250, 252, 253, 253, 250, 250,
539
254, 254, 12, 12, 12, 12, 12, 12, 12, 12,
540
12, 12, 12, 12, 12, 255, 250, 252, 250, 256,
541
253, 257, 257, 258, 12, 252, 259, 12, 12, 12,
542
12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
543
12, 12, 12, 12, 12, 12, 255, 256, 257, 257,
544
260, 261, 261, 250, 12, 12, 12, 12, 12, 12,
545
12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
546
12, 12, 260, 261, 261, 250, 12, 262, 12, 12,
547
12, 12, 12, 12, 12, 263, 264, 12, 265, 12,
549
12, 266, 12, 12, 12, 12, 267, 268, 262, 268,
550
12, 12, 12, 269, 12, 12, 270, 271, 263, 271,
551
272, 273, 264, 273, 274, 275, 265, 275, 12, 276,
552
277, 266, 277, 12, 12, 278, 12, 267, 268, 268,
553
279, 279, 12, 250, 12, 280, 281, 269, 281, 12,
554
282, 270, 271, 271, 283, 283, 272, 273, 273, 284,
555
284, 274, 275, 275, 285, 285, 12, 276, 277, 277,
556
286, 286, 12, 12, 287, 250, 288, 12, 12, 280,
557
281, 281, 289, 289, 290, 291, 292, 282, 292, 293,
558
12, 294, 287, 250, 295, 250, 12, 296, 297, 250,
560
291, 292, 292, 298, 298, 299, 250, 300, 301, 301,
561
295, 250, 12, 302, 250, 302, 302, 297, 250, 299,
562
250, 303, 304, 300, 304, 301, 12, 302, 250, 302,
563
302, 303, 304, 304, 305, 305, 12, 302, 302, 306,
564
302, 302, 307, 250, 302, 250, 307, 250, 250, 0,
565
250, 250, 250, 250, 250, 250, 250, 250, 250, 250,
566
250, 250, 250, 250, 250, 250, 250, 250, 250, 250,
567
250, 250, 250, 250, 250, 250, 250, 250, 250, 250,
568
250, 250, 250, 250, 250, 250, 250, 250, 250, 250,
569
250, 250, 250, 250, 250, 250, 250, 250, 250, 250,
571
250, 250, 250, 250, 250, 250, 250
574
static yyconst flex_int16_t yy_nxt[690] =
576
6, 7, 8, 9, 6, 6, 6, 6, 10, 11,
577
12, 13, 14, 15, 16, 17, 17, 18, 17, 17,
578
17, 17, 19, 17, 20, 21, 22, 23, 24, 17,
579
25, 17, 17, 31, 31, 32, 31, 31, 32, 35,
580
33, 35, 41, 33, 28, 28, 28, 29, 34, 35,
581
35, 36, 37, 73, 42, 38, 35, 49, 68, 35,
582
35, 39, 28, 28, 28, 29, 34, 43, 45, 36,
583
37, 40, 44, 35, 46, 35, 35, 35, 51, 53,
584
244, 35, 50, 35, 55, 65, 35, 47, 56, 28,
585
59, 48, 31, 31, 32, 60, 35, 71, 67, 33,
587
28, 28, 28, 29, 35, 35, 35, 28, 37, 61,
588
61, 61, 62, 61, 35, 70, 61, 63, 66, 35,
589
49, 35, 35, 72, 74, 35, 69, 35, 75, 35,
590
35, 35, 35, 88, 35, 35, 82, 78, 35, 28,
591
59, 77, 87, 35, 76, 60, 80, 79, 81, 28,
592
84, 78, 35, 89, 35, 85, 35, 35, 35, 75,
593
35, 92, 35, 96, 35, 35, 90, 97, 35, 35,
594
93, 35, 94, 91, 99, 35, 35, 35, 249, 100,
595
95, 101, 102, 104, 35, 35, 98, 103, 35, 105,
596
28, 84, 111, 106, 35, 35, 85, 107, 107, 61,
598
108, 107, 35, 248, 107, 110, 112, 114, 113, 35,
599
75, 78, 99, 35, 35, 116, 117, 117, 61, 118,
600
117, 134, 35, 117, 120, 121, 121, 61, 122, 121,
601
35, 246, 121, 124, 125, 125, 61, 126, 125, 35,
602
137, 125, 128, 135, 102, 129, 35, 130, 130, 61,
603
131, 130, 136, 35, 130, 133, 28, 139, 28, 141,
604
35, 144, 140, 35, 142, 35, 151, 35, 35, 28,
605
153, 28, 155, 143, 244, 154, 35, 156, 145, 146,
606
146, 61, 147, 146, 150, 35, 146, 149, 28, 158,
607
28, 160, 28, 163, 159, 167, 161, 35, 164, 28,
609
165, 28, 169, 28, 171, 166, 35, 170, 213, 172,
610
177, 35, 28, 139, 35, 173, 35, 178, 140, 215,
611
179, 28, 181, 28, 183, 174, 208, 182, 35, 184,
612
185, 35, 186, 186, 61, 187, 186, 28, 153, 186,
613
189, 28, 158, 154, 28, 163, 35, 159, 190, 35,
614
164, 28, 169, 192, 35, 35, 191, 170, 198, 35,
615
28, 181, 28, 202, 28, 204, 182, 215, 203, 207,
616
205, 64, 210, 229, 197, 216, 217, 28, 202, 35,
617
215, 229, 230, 203, 222, 222, 61, 223, 222, 35,
618
215, 222, 225, 237, 227, 231, 28, 233, 28, 235,
620
28, 233, 234, 238, 236, 215, 234, 240, 35, 215,
621
215, 200, 229, 196, 239, 226, 221, 219, 212, 176,
622
207, 200, 196, 194, 176, 241, 242, 245, 26, 26,
623
26, 26, 28, 28, 28, 30, 30, 30, 30, 35,
624
35, 35, 35, 57, 115, 57, 57, 58, 58, 58,
625
58, 60, 86, 60, 60, 34, 34, 34, 34, 64,
626
64, 35, 64, 83, 83, 83, 83, 85, 29, 85,
627
85, 109, 109, 109, 109, 119, 119, 119, 119, 123,
628
123, 123, 123, 127, 127, 127, 127, 132, 132, 132,
629
132, 138, 138, 138, 138, 140, 54, 140, 140, 148,
631
148, 148, 148, 152, 152, 152, 152, 154, 52, 154,
632
154, 157, 157, 157, 157, 159, 35, 159, 159, 162,
633
162, 162, 162, 164, 29, 164, 164, 168, 168, 168,
634
168, 170, 250, 170, 170, 175, 175, 175, 175, 142,
635
27, 142, 142, 180, 180, 180, 180, 182, 27, 182,
636
182, 188, 188, 188, 188, 156, 250, 156, 156, 161,
637
250, 161, 161, 166, 250, 166, 166, 172, 250, 172,
638
172, 193, 193, 193, 193, 195, 195, 195, 195, 184,
639
250, 184, 184, 199, 199, 199, 199, 201, 201, 201,
640
201, 203, 250, 203, 203, 206, 206, 206, 206, 209,
642
209, 209, 209, 211, 211, 211, 211, 214, 214, 214,
643
214, 218, 218, 218, 218, 205, 250, 205, 205, 220,
644
220, 220, 220, 224, 224, 224, 224, 210, 250, 210,
645
210, 228, 228, 228, 228, 232, 232, 232, 232, 234,
646
250, 234, 234, 236, 250, 236, 236, 243, 243, 243,
647
243, 247, 247, 247, 247, 5, 250, 250, 250, 250,
648
250, 250, 250, 250, 250, 250, 250, 250, 250, 250,
649
250, 250, 250, 250, 250, 250, 250, 250, 250, 250,
650
250, 250, 250, 250, 250, 250, 250, 250, 250
653
static yyconst flex_int16_t yy_chk[690] =
655
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
656
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
657
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
658
1, 1, 1, 7, 7, 7, 8, 8, 8, 13,
659
7, 41, 13, 8, 11, 11, 11, 11, 11, 47,
660
14, 11, 11, 47, 14, 11, 19, 19, 41, 15,
661
16, 11, 12, 12, 12, 12, 12, 14, 16, 12,
662
12, 12, 15, 18, 16, 20, 21, 23, 21, 23,
663
247, 25, 20, 38, 25, 38, 45, 18, 25, 30,
664
30, 18, 31, 31, 31, 30, 40, 45, 40, 31,
666
34, 34, 34, 34, 39, 42, 46, 34, 34, 36,
667
36, 36, 36, 36, 43, 43, 36, 36, 39, 44,
668
44, 50, 48, 46, 48, 49, 42, 51, 49, 52,
669
53, 54, 55, 66, 56, 66, 55, 56, 65, 58,
670
58, 51, 65, 67, 50, 58, 54, 53, 54, 61,
671
61, 52, 68, 67, 69, 61, 70, 71, 72, 70,
672
73, 71, 74, 75, 77, 75, 68, 76, 82, 76,
673
72, 79, 73, 69, 78, 87, 78, 81, 245, 79,
674
74, 80, 80, 81, 80, 91, 77, 80, 89, 82,
675
83, 83, 89, 87, 90, 94, 83, 88, 88, 88,
677
88, 88, 95, 243, 88, 88, 90, 92, 91, 92,
678
95, 98, 98, 103, 98, 94, 96, 96, 96, 96,
679
96, 103, 106, 96, 96, 97, 97, 97, 97, 97,
680
100, 242, 97, 97, 99, 99, 99, 99, 99, 104,
681
106, 99, 99, 104, 101, 100, 101, 102, 102, 102,
682
102, 102, 105, 105, 102, 102, 107, 107, 109, 109,
683
111, 112, 107, 113, 109, 115, 116, 112, 116, 117,
684
117, 119, 119, 111, 240, 117, 129, 119, 113, 114,
685
114, 114, 114, 114, 115, 197, 114, 114, 121, 121,
686
123, 123, 125, 125, 121, 129, 123, 134, 125, 127,
688
127, 130, 130, 132, 132, 127, 135, 130, 197, 132,
689
137, 137, 138, 138, 143, 134, 145, 143, 138, 228,
690
145, 146, 146, 148, 148, 135, 191, 146, 191, 148,
691
150, 150, 151, 151, 151, 151, 151, 152, 152, 151,
692
151, 157, 157, 152, 162, 162, 173, 157, 167, 167,
693
162, 168, 168, 174, 174, 178, 173, 168, 179, 179,
694
180, 180, 186, 186, 188, 188, 180, 198, 186, 220,
695
188, 192, 192, 216, 178, 198, 198, 201, 201, 213,
696
230, 217, 216, 201, 208, 208, 208, 208, 208, 227,
697
231, 208, 208, 227, 213, 217, 222, 222, 224, 224,
699
232, 232, 222, 230, 224, 238, 232, 237, 237, 241,
700
239, 218, 214, 211, 231, 209, 206, 199, 195, 193,
701
190, 185, 177, 175, 136, 238, 239, 241, 251, 251,
702
251, 251, 252, 252, 252, 253, 253, 253, 253, 254,
703
254, 254, 254, 255, 93, 255, 255, 256, 256, 256,
704
256, 257, 64, 257, 257, 258, 258, 258, 258, 259,
705
259, 35, 259, 260, 260, 260, 260, 261, 28, 261,
706
261, 262, 262, 262, 262, 263, 263, 263, 263, 264,
707
264, 264, 264, 265, 265, 265, 265, 266, 266, 266,
708
266, 267, 267, 267, 267, 268, 24, 268, 268, 269,
710
269, 269, 269, 270, 270, 270, 270, 271, 22, 271,
711
271, 272, 272, 272, 272, 273, 17, 273, 273, 274,
712
274, 274, 274, 275, 6, 275, 275, 276, 276, 276,
713
276, 277, 5, 277, 277, 278, 278, 278, 278, 279,
714
4, 279, 279, 280, 280, 280, 280, 281, 3, 281,
715
281, 282, 282, 282, 282, 283, 0, 283, 283, 284,
716
0, 284, 284, 285, 0, 285, 285, 286, 0, 286,
717
286, 287, 287, 287, 287, 288, 288, 288, 288, 289,
718
0, 289, 289, 290, 290, 290, 290, 291, 291, 291,
719
291, 292, 0, 292, 292, 293, 293, 293, 293, 294,
721
294, 294, 294, 295, 295, 295, 295, 296, 296, 296,
722
296, 297, 297, 297, 297, 298, 0, 298, 298, 299,
723
299, 299, 299, 300, 300, 300, 300, 301, 0, 301,
724
301, 302, 302, 302, 302, 303, 303, 303, 303, 304,
725
0, 304, 304, 305, 0, 305, 305, 306, 306, 306,
726
306, 307, 307, 307, 307, 250, 250, 250, 250, 250,
727
250, 250, 250, 250, 250, 250, 250, 250, 250, 250,
728
250, 250, 250, 250, 250, 250, 250, 250, 250, 250,
729
250, 250, 250, 250, 250, 250, 250, 250, 250
732
#define YY_TRAILING_MASK 0x2000
733
#define YY_TRAILING_HEAD_MASK 0x4000
736
*yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */ \
737
yy_cp = yyg->yy_full_match; /* restore poss. backed-over text */ \
738
yyg->yy_lp = yyg->yy_full_lp; /* restore orig. accepting pos. */ \
739
yyg->yy_state_ptr = yyg->yy_full_state; /* restore orig. state */ \
740
yy_current_state = *yyg->yy_state_ptr; /* restore curr. state */ \
745
#define yymore() (yyg->yy_more_flag = 1)
746
#define YY_MORE_ADJ yyg->yy_more_len
747
#define YY_RESTORE_YY_MORE_OFFSET
748
#line 1 "libxlu_disk_l.l"
749
/* -*- fundamental -*- */
751
* libxlu_disk_l.l - parser for disk specification strings
753
* Copyright (C) 2011 Citrix Ltd.
754
* Author Ian Jackson <ian.jackson@eu.citrix.com>
756
* This program is free software; you can redistribute it and/or modify
757
* it under the terms of the GNU Lesser General Public License as published
758
* by the Free Software Foundation; version 2.1 only. with the special
759
* exception on linking described in file LICENSE.
761
* This program is distributed in the hope that it will be useful,
762
* but WITHOUT ANY WARRANTY; without even the implied warranty of
763
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
764
* GNU Lesser General Public License for more details.
767
* Parsing the old xm/xend/xl-4.1 disk specs is a tricky problem,
768
* because the target string might in theory contain "," which is the
769
* delimiter we use for stripping off things on the RHS, and ":",
770
* which is the delimiter we use for stripping off things on the LHS.
772
* In this parser we do not support such target strings in the old
773
* syntax; if the target string has to contain "," or ":" the new
774
* syntax's "target=" should be used.
777
#line 35 "libxlu_disk_l.l"
778
#include "libxlu_disk_i.h"
782
/* Some versions of flex have a bug (Fedora bugzilla 612465) which causes
783
* it to fail to declare these functions, which it defines. So declare
784
* them ourselves. Hopefully we won't have to simultaneously support
785
* a flex version which declares these differently somehow. */
786
int xlu__disk_yyget_column(yyscan_t yyscanner);
787
void xlu__disk_yyset_column(int column_no, yyscan_t yyscanner);
790
/*----- useful macros and functions used in actions -----
791
* we use macros in the actual rules to keep the actions short
792
* and particularly to avoid repeating boilerplate values such as
793
* DPC->disk, yytext, etc. */
795
/* Sets an enum, checking it hasn't already been set to a different value */
796
#define DSET(dpc,member,enumname,str,valname) do{ \
797
if (dpc->disk->member != LIBXL_DISK_##enumname##_UNKNOWN && \
798
dpc->disk->member != LIBXL_DISK_##enumname##_##valname) { \
799
xlu__disk_err(dpc, str, TOSTRING(member) " respecified"); \
801
dpc->disk->member = LIBXL_DISK_##enumname##_##valname; \
805
/* For actions whose patterns contain '=', finds the start of the value */
806
#define FROMEQUALS (strchr(yytext,'=')+1)
808
/* Chops the delimiter off, modifying yytext and yyleng. */
809
#define STRIP(delim) do{ \
810
if (yyleng>0 && yytext[yyleng-1]==(delim)) \
811
yytext[--yyleng] = 0; \
814
/* Sets a string value, checking it hasn't been set already. */
815
#define SAVESTRING(what,loc,val) do{ \
816
savestring(DPC, what " respecified", &DPC->disk->loc, (val)); \
818
static void savestring(DiskParseContext *dpc, const char *what_respecified,
819
char **update, const char *value) {
821
if (**update) { xlu__disk_err(dpc,value,what_respecified); return; }
822
free(*update); /* do not complain about overwriting empty strings */
824
*update = strdup(value);
827
#define DPC dpc /* our convention in lexer helper functions */
829
/* Sets ->readwrite from the string. This ought to be an enum, perhaps. */
830
static void setaccess(DiskParseContext *dpc, const char *str) {
831
if (!strcmp(str, "r") || !strcmp(str, "ro")) {
832
dpc->disk->readwrite = 0;
833
} else if (!strcmp(str, "rw") || !strcmp(str, "w") || !strcmp(str,"")) {
834
dpc->disk->readwrite = 1;
836
xlu__disk_err(dpc,str,"unknown value for access");
840
/* Sets ->format from the string. IDL should provide something for this. */
841
static void setformat(DiskParseContext *dpc, const char *str) {
842
if (!strcmp(str,"")) DSET(dpc,format,FORMAT,str,RAW);
843
else if (!strcmp(str,"raw")) DSET(dpc,format,FORMAT,str,RAW);
844
else if (!strcmp(str,"qcow")) DSET(dpc,format,FORMAT,str,QCOW);
845
else if (!strcmp(str,"qcow2")) DSET(dpc,format,FORMAT,str,QCOW2);
846
else if (!strcmp(str,"vhd")) DSET(dpc,format,FORMAT,str,VHD);
847
else if (!strcmp(str,"empty")) DSET(dpc,format,FORMAT,str,EMPTY);
848
else xlu__disk_err(dpc,str,"unknown value for format");
851
/* Sets ->backend from the string. IDL should provide something for this. */
852
static void setbackendtype(DiskParseContext *dpc, const char *str) {
853
if ( !strcmp(str,"phy")) DSET(dpc,backend,BACKEND,str,PHY);
854
else if (!strcmp(str,"tap")) DSET(dpc,backend,BACKEND,str,TAP);
855
else if (!strcmp(str,"qdisk")) DSET(dpc,backend,BACKEND,str,QDISK);
856
else xlu__disk_err(dpc,str,"unknown value for backendtype");
859
#define DEPRECATE(usewhatinstead) /* not currently reported */
861
/* Handles a vdev positional parameter which includes a devtype. */
862
static int vdev_and_devtype(DiskParseContext *dpc, char *str) {
863
/* returns 1 if it was <vdev>:<devtype>, 0 (doing nothing) otherwise */
864
char *colon = strrchr(str, ':');
868
DEPRECATE("use `devtype=...'");
870
SAVESTRING("vdev", vdev, str);
872
if (!strcmp(colon,"cdrom")) {
873
DPC->disk->is_cdrom = 1;
874
} else if (!strcmp(colon,"disk")) {
875
DPC->disk->is_cdrom = 0;
877
xlu__disk_err(DPC,colon,"unknown deprecated type");
882
#undef DPC /* needs to be defined differently the actual lexer */
883
#define DPC ((DiskParseContext*)yyextra)
886
#line 887 "libxlu_disk_l.c"
891
#ifndef YY_NO_UNISTD_H
892
/* Special case for "unistd.h", since it is non-ANSI. We include it way
893
* down here because we want the user's section 1 to have been scanned first.
894
* The user has a chance to override it with an option.
899
#ifndef YY_EXTRA_TYPE
900
#define YY_EXTRA_TYPE void *
903
/* Holds the entire state of the reentrant scanner. */
907
/* User-defined. Not touched by flex. */
908
YY_EXTRA_TYPE yyextra_r;
910
/* The rest are the same as the globals declared in the non-reentrant scanner. */
911
FILE *yyin_r, *yyout_r;
912
size_t yy_buffer_stack_top; /**< index of top of stack. */
913
size_t yy_buffer_stack_max; /**< capacity of stack. */
914
YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */
921
int yy_did_buffer_switch_on_eof;
922
int yy_start_stack_ptr;
923
int yy_start_stack_depth;
925
yy_state_type yy_last_accepting_state;
926
char* yy_last_accepting_cpos;
931
yy_state_type *yy_state_buf;
932
yy_state_type *yy_state_ptr;
936
/* These are only needed for trailing context rules,
937
* but there's no conditional variable for that yet. */
938
int yy_looking_for_trail_begin;
946
}; /* end struct yyguts_t */
948
static int yy_init_globals (yyscan_t yyscanner );
950
int xlu__disk_yylex_init (yyscan_t* scanner);
952
int xlu__disk_yylex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner);
954
/* Accessor methods to globals.
955
These are made visible to non-reentrant scanners for convenience. */
957
int xlu__disk_yylex_destroy (yyscan_t yyscanner );
959
int xlu__disk_yyget_debug (yyscan_t yyscanner );
961
void xlu__disk_yyset_debug (int debug_flag ,yyscan_t yyscanner );
963
YY_EXTRA_TYPE xlu__disk_yyget_extra (yyscan_t yyscanner );
965
void xlu__disk_yyset_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner );
967
FILE *xlu__disk_yyget_in (yyscan_t yyscanner );
969
void xlu__disk_yyset_in (FILE * in_str ,yyscan_t yyscanner );
971
FILE *xlu__disk_yyget_out (yyscan_t yyscanner );
973
void xlu__disk_yyset_out (FILE * out_str ,yyscan_t yyscanner );
975
int xlu__disk_yyget_leng (yyscan_t yyscanner );
977
char *xlu__disk_yyget_text (yyscan_t yyscanner );
979
int xlu__disk_yyget_lineno (yyscan_t yyscanner );
981
void xlu__disk_yyset_lineno (int line_number ,yyscan_t yyscanner );
983
/* Macros after this point can all be overridden by user definitions in
987
#ifndef YY_SKIP_YYWRAP
989
extern "C" int xlu__disk_yywrap (yyscan_t yyscanner );
991
extern int xlu__disk_yywrap (yyscan_t yyscanner );
996
static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner);
999
#ifdef YY_NEED_STRLEN
1000
static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner);
1006
static int yyinput (yyscan_t yyscanner );
1008
static int input (yyscan_t yyscanner );
1013
/* Amount of stuff to slurp up with each read. */
1014
#ifndef YY_READ_BUF_SIZE
1016
/* On IA-64, the buffer size is 16k, not 8k */
1017
#define YY_READ_BUF_SIZE 16384
1019
#define YY_READ_BUF_SIZE 8192
1020
#endif /* __ia64__ */
1023
/* Copy whatever the last rule matched to the standard output. */
1025
/* This used to be an fputs(), but since the string might contain NUL's,
1026
* we now use fwrite().
1028
#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
1031
/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
1032
* is returned in "result".
1035
#define YY_INPUT(buf,result,max_size) \
1036
if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
1040
for ( n = 0; n < max_size && \
1041
(c = getc( yyin )) != EOF && c != '\n'; ++n ) \
1042
buf[n] = (char) c; \
1044
buf[n++] = (char) c; \
1045
if ( c == EOF && ferror( yyin ) ) \
1046
YY_FATAL_ERROR( "input in flex scanner failed" ); \
1052
while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
1054
if( errno != EINTR) \
1056
YY_FATAL_ERROR( "input in flex scanner failed" ); \
1067
/* No semi-colon after return; correct usage is to write "yyterminate();" -
1068
* we don't want an extra ';' after the "return" because that will cause
1069
* some compilers to complain about unreachable statements.
1072
#define yyterminate() return YY_NULL
1075
/* Number of entries by which start-condition stack grows. */
1076
#ifndef YY_START_STACK_INCR
1077
#define YY_START_STACK_INCR 25
1080
/* Report a fatal error. */
1081
#ifndef YY_FATAL_ERROR
1082
#define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner)
1085
/* end tables serialization structures and prototypes */
1087
/* Default declaration of generated scanner - a define so the user can
1088
* easily add parameters.
1091
#define YY_DECL_IS_OURS 1
1093
extern int xlu__disk_yylex (yyscan_t yyscanner);
1095
#define YY_DECL int xlu__disk_yylex (yyscan_t yyscanner)
1096
#endif /* !YY_DECL */
1098
/* Code executed at the beginning of each rule, after yytext and yyleng
1101
#ifndef YY_USER_ACTION
1102
#define YY_USER_ACTION
1105
/* Code executed at the end of each rule. */
1107
#define YY_BREAK break;
1110
#define YY_RULE_SETUP \
1113
/** The main scanner function which does all the work.
1117
register yy_state_type yy_current_state;
1118
register char *yy_cp, *yy_bp;
1119
register int yy_act;
1120
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1122
#line 155 "libxlu_disk_l.l"
1125
/*----- the scanner rules which do the parsing -----*/
1127
#line 1128 "libxlu_disk_l.c"
1129
if ( !yyg->yy_init )
1137
/* Create the reject buffer large enough to save one state per allowed character. */
1138
if ( ! yyg->yy_state_buf )
1139
yyg->yy_state_buf = (yy_state_type *)xlu__disk_yyalloc(YY_STATE_BUF_SIZE ,yyscanner);
1140
if ( ! yyg->yy_state_buf )
1141
YY_FATAL_ERROR( "out of dynamic memory in xlu__disk_yylex()" );
1143
if ( ! yyg->yy_start )
1144
yyg->yy_start = 1; /* first start state */
1152
if ( ! YY_CURRENT_BUFFER ) {
1153
xlu__disk_yyensure_buffer_stack (yyscanner);
1154
YY_CURRENT_BUFFER_LVALUE =
1155
xlu__disk_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
1158
xlu__disk_yy_load_buffer_state(yyscanner );
1161
while ( 1 ) /* loops until end-of-file is reached */
1163
yyg->yy_more_len = 0;
1164
if ( yyg->yy_more_flag )
1166
yyg->yy_more_len = yyg->yy_c_buf_p - yyg->yytext_ptr;
1167
yyg->yy_more_flag = 0;
1169
yy_cp = yyg->yy_c_buf_p;
1171
/* Support of yytext. */
1172
*yy_cp = yyg->yy_hold_char;
1174
/* yy_bp points to the position in yy_ch_buf of the start of
1179
yy_current_state = yyg->yy_start;
1181
yyg->yy_state_ptr = yyg->yy_state_buf;
1182
*yyg->yy_state_ptr++ = yy_current_state;
1187
register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
1188
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1190
yy_current_state = (int) yy_def[yy_current_state];
1191
if ( yy_current_state >= 251 )
1192
yy_c = yy_meta[(unsigned int) yy_c];
1194
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1195
*yyg->yy_state_ptr++ = yy_current_state;
1198
while ( yy_current_state != 250 );
1201
yy_current_state = *--yyg->yy_state_ptr;
1202
yyg->yy_lp = yy_accept[yy_current_state];
1203
find_rule: /* we branch to this label when backing up */
1204
for ( ; ; ) /* until we find what rule we matched */
1206
if ( yyg->yy_lp && yyg->yy_lp < yy_accept[yy_current_state + 1] )
1208
yy_act = yy_acclist[yyg->yy_lp];
1209
if ( yy_act & YY_TRAILING_HEAD_MASK ||
1210
yyg->yy_looking_for_trail_begin )
1212
if ( yy_act == yyg->yy_looking_for_trail_begin )
1214
yyg->yy_looking_for_trail_begin = 0;
1215
yy_act &= ~YY_TRAILING_HEAD_MASK;
1219
else if ( yy_act & YY_TRAILING_MASK )
1221
yyg->yy_looking_for_trail_begin = yy_act & ~YY_TRAILING_MASK;
1222
yyg->yy_looking_for_trail_begin |= YY_TRAILING_HEAD_MASK;
1226
yyg->yy_full_match = yy_cp;
1227
yyg->yy_full_state = yyg->yy_state_ptr;
1228
yyg->yy_full_lp = yyg->yy_lp;
1235
yy_current_state = *--yyg->yy_state_ptr;
1236
yyg->yy_lp = yy_accept[yy_current_state];
1239
YY_DO_BEFORE_ACTION;
1241
do_action: /* This label is used only to access EOF actions. */
1244
{ /* beginning of action switch */
1246
/* rule 1 can match eol */
1248
#line 159 "libxlu_disk_l.l"
1249
{ /* ignore whitespace before parameters */ }
1251
/* ordinary parameters setting enums or strings */
1253
/* rule 2 can match eol */
1255
#line 163 "libxlu_disk_l.l"
1256
{ STRIP(','); setformat(DPC, FROMEQUALS); }
1260
#line 165 "libxlu_disk_l.l"
1261
{ DPC->disk->is_cdrom = 1; }
1265
#line 166 "libxlu_disk_l.l"
1266
{ DPC->disk->is_cdrom = 1; }
1270
#line 167 "libxlu_disk_l.l"
1271
{ DPC->disk->is_cdrom = 0; }
1274
/* rule 6 can match eol */
1276
#line 168 "libxlu_disk_l.l"
1277
{ xlu__disk_err(DPC,yytext,"unknown value for type"); }
1280
/* rule 7 can match eol */
1282
#line 170 "libxlu_disk_l.l"
1283
{ STRIP(','); setaccess(DPC, FROMEQUALS); }
1286
/* rule 8 can match eol */
1288
#line 171 "libxlu_disk_l.l"
1289
{ STRIP(','); setbackendtype(DPC,FROMEQUALS); }
1292
/* rule 9 can match eol */
1294
#line 173 "libxlu_disk_l.l"
1295
{ STRIP(','); SAVESTRING("vdev", vdev, FROMEQUALS); }
1298
/* rule 10 can match eol */
1300
#line 174 "libxlu_disk_l.l"
1301
{ STRIP(','); SAVESTRING("script", script, FROMEQUALS); }
1303
/* the target magic parameter, eats the rest of the string */
1306
#line 178 "libxlu_disk_l.l"
1307
{ STRIP(','); SAVESTRING("target", pdev_path, FROMEQUALS); }
1309
/* unknown parameters */
1311
/* rule 12 can match eol */
1313
#line 182 "libxlu_disk_l.l"
1314
{ xlu__disk_err(DPC,yytext,"unknown parameter"); }
1316
/* deprecated prefixes */
1317
/* the "/.*" in these patterns ensures that they count as if they
1318
* matched the whole string, so these patterns take precedence */
1321
#line 189 "libxlu_disk_l.l"
1324
DPC->had_depr_prefix=1; DEPRECATE("use `[format=]...,'");
1325
setformat(DPC, yytext);
1330
#line 195 "libxlu_disk_l.l"
1334
DPC->had_depr_prefix=1; DEPRECATE("use `script=...'");
1335
if (asprintf(&newscript, "block-%s", yytext) < 0) {
1336
xlu__disk_err(DPC,yytext,"unable to format script");
1339
savestring(DPC, "script respecified",
1340
&DPC->disk->script, newscript);
1345
*yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */
1346
yyg->yy_c_buf_p = yy_cp = yy_bp + 8;
1347
YY_DO_BEFORE_ACTION; /* set up yytext again */
1349
#line 208 "libxlu_disk_l.l"
1350
{ DPC->had_depr_prefix=1; DEPRECATE(0); }
1354
#line 209 "libxlu_disk_l.l"
1355
{ DPC->had_depr_prefix=1; DEPRECATE(0); }
1358
*yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */
1359
yyg->yy_c_buf_p = yy_cp = yy_bp + 4;
1360
YY_DO_BEFORE_ACTION; /* set up yytext again */
1362
#line 210 "libxlu_disk_l.l"
1363
{ DPC->had_depr_prefix=1; DEPRECATE(0); }
1366
*yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */
1367
yyg->yy_c_buf_p = yy_cp = yy_bp + 6;
1368
YY_DO_BEFORE_ACTION; /* set up yytext again */
1370
#line 211 "libxlu_disk_l.l"
1371
{ DPC->had_depr_prefix=1; DEPRECATE(0); }
1374
*yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */
1375
yyg->yy_c_buf_p = yy_cp = yy_bp + 5;
1376
YY_DO_BEFORE_ACTION; /* set up yytext again */
1378
#line 212 "libxlu_disk_l.l"
1379
{ DPC->had_depr_prefix=1; DEPRECATE(0); }
1382
*yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */
1383
yyg->yy_c_buf_p = yy_cp = yy_bp + 4;
1384
YY_DO_BEFORE_ACTION; /* set up yytext again */
1386
#line 213 "libxlu_disk_l.l"
1387
{ DPC->had_depr_prefix=1; DEPRECATE(0); }
1390
/* rule 21 can match eol */
1392
#line 215 "libxlu_disk_l.l"
1394
xlu__disk_err(DPC,yytext,"unknown deprecated disk prefix");
1398
/* positional parameters */
1400
/* rule 22 can match eol */
1402
#line 222 "libxlu_disk_l.l"
1407
/* previous errors may just lead to subsequent ones */
1408
} else if (!DPC->disk->pdev_path) {
1409
SAVESTRING("target", pdev_path, yytext);
1410
} else if (!DPC->had_depr_prefix &&
1411
DPC->disk->format == LIBXL_DISK_FORMAT_UNKNOWN) {
1412
if (!*DPC->disk->pdev_path && vdev_and_devtype(DPC,yytext)) {
1413
DPC->disk->format = LIBXL_DISK_FORMAT_EMPTY;
1415
setformat(DPC,yytext);
1417
} else if (!DPC->disk->vdev) {
1418
if (!vdev_and_devtype(DPC,yytext))
1419
SAVESTRING("vdev", vdev, yytext);
1420
} else if (!DPC->access_set) {
1421
DPC->access_set = 1;
1422
setaccess(DPC,yytext);
1424
xlu__disk_err(DPC,yytext,"too many positional parameters");
1425
return 0; /* don't print any more errors */
1431
#line 248 "libxlu_disk_l.l"
1439
#line 252 "libxlu_disk_l.l"
1441
xlu__disk_err(DPC,yytext,"bad disk syntax"); return 0;
1446
#line 255 "libxlu_disk_l.l"
1447
YY_FATAL_ERROR( "flex scanner jammed" );
1449
#line 1450 "libxlu_disk_l.c"
1450
case YY_STATE_EOF(INITIAL):
1451
case YY_STATE_EOF(LEXERR):
1454
case YY_END_OF_BUFFER:
1456
/* Amount of text matched not including the EOB char. */
1457
int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1;
1459
/* Undo the effects of YY_DO_BEFORE_ACTION. */
1460
*yy_cp = yyg->yy_hold_char;
1461
YY_RESTORE_YY_MORE_OFFSET
1463
if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
1465
/* We're scanning a new file or input source. It's
1466
* possible that this happened because the user
1467
* just pointed yyin at a new source and called
1468
* xlu__disk_yylex(). If so, then we have to assure
1469
* consistency between YY_CURRENT_BUFFER and our
1470
* globals. Here is the right place to do so, because
1471
* this is the first action (other than possibly a
1472
* back-up) that will match for the new input source.
1474
yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1475
YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
1476
YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
1479
/* Note that here we test for yy_c_buf_p "<=" to the position
1480
* of the first EOB in the buffer, since yy_c_buf_p will
1481
* already have been incremented past the NUL character
1482
* (since all states make transitions on EOB to the
1483
* end-of-buffer state). Contrast this with the test
1486
if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
1487
{ /* This was really a NUL. */
1488
yy_state_type yy_next_state;
1490
yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text;
1492
yy_current_state = yy_get_previous_state( yyscanner );
1494
/* Okay, we're now positioned to make the NUL
1495
* transition. We couldn't have
1496
* yy_get_previous_state() go ahead and do it
1497
* for us because it doesn't know how to deal
1498
* with the possibility of jamming (and we don't
1499
* want to build jamming into it because then it
1500
* will run more slowly).
1503
yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner);
1505
yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1507
if ( yy_next_state )
1509
/* Consume the NUL. */
1510
yy_cp = ++yyg->yy_c_buf_p;
1511
yy_current_state = yy_next_state;
1517
yy_cp = yyg->yy_c_buf_p;
1518
goto yy_find_action;
1522
else switch ( yy_get_next_buffer( yyscanner ) )
1524
case EOB_ACT_END_OF_FILE:
1526
yyg->yy_did_buffer_switch_on_eof = 0;
1528
if ( xlu__disk_yywrap(yyscanner ) )
1530
/* Note: because we've taken care in
1531
* yy_get_next_buffer() to have set up
1532
* yytext, we can now set up
1533
* yy_c_buf_p so that if some total
1534
* hoser (like flex itself) wants to
1535
* call the scanner after we return the
1536
* YY_NULL, it'll still work - another
1537
* YY_NULL will get returned.
1539
yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ;
1541
yy_act = YY_STATE_EOF(YY_START);
1547
if ( ! yyg->yy_did_buffer_switch_on_eof )
1553
case EOB_ACT_CONTINUE_SCAN:
1555
yyg->yytext_ptr + yy_amount_of_matched_text;
1557
yy_current_state = yy_get_previous_state( yyscanner );
1559
yy_cp = yyg->yy_c_buf_p;
1560
yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1563
case EOB_ACT_LAST_MATCH:
1565
&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars];
1567
yy_current_state = yy_get_previous_state( yyscanner );
1569
yy_cp = yyg->yy_c_buf_p;
1570
yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1571
goto yy_find_action;
1578
"fatal flex scanner internal error--no action found" );
1579
} /* end of action switch */
1580
} /* end of scanning one token */
1581
} /* end of xlu__disk_yylex */
1583
/* yy_get_next_buffer - try to read in a new buffer
1585
* Returns a code representing an action:
1586
* EOB_ACT_LAST_MATCH -
1587
* EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1588
* EOB_ACT_END_OF_FILE - end of file
1590
static int yy_get_next_buffer (yyscan_t yyscanner)
1592
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1593
register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1594
register char *source = yyg->yytext_ptr;
1595
register int number_to_move, i;
1598
if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] )
1600
"fatal flex scanner internal error--end of buffer missed" );
1602
if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1603
{ /* Don't try to fill the buffer, so this is an EOF. */
1604
if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 )
1606
/* We matched a single character, the EOB, so
1607
* treat this as a final EOF.
1609
return EOB_ACT_END_OF_FILE;
1614
/* We matched some text prior to the EOB, first
1617
return EOB_ACT_LAST_MATCH;
1621
/* Try to read more data. */
1623
/* First move last chars to start of buffer. */
1624
number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr) - 1;
1626
for ( i = 0; i < number_to_move; ++i )
1627
*(dest++) = *(source++);
1629
if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1630
/* don't do the read, it's not guaranteed to return an EOF,
1633
YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0;
1638
YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1640
while ( num_to_read <= 0 )
1641
{ /* Not enough room in the buffer - grow it. */
1644
"input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
1648
if ( num_to_read > YY_READ_BUF_SIZE )
1649
num_to_read = YY_READ_BUF_SIZE;
1651
/* Read in more data. */
1652
YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1653
yyg->yy_n_chars, (size_t) num_to_read );
1655
YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
1658
if ( yyg->yy_n_chars == 0 )
1660
if ( number_to_move == YY_MORE_ADJ )
1662
ret_val = EOB_ACT_END_OF_FILE;
1663
xlu__disk_yyrestart(yyin ,yyscanner);
1668
ret_val = EOB_ACT_LAST_MATCH;
1669
YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1670
YY_BUFFER_EOF_PENDING;
1675
ret_val = EOB_ACT_CONTINUE_SCAN;
1677
if ((yy_size_t) (yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1678
/* Extend the array by 50%, plus the number we really need. */
1679
yy_size_t new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1);
1680
YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) xlu__disk_yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ,yyscanner );
1681
if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1682
YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1685
yyg->yy_n_chars += number_to_move;
1686
YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR;
1687
YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
1689
yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1694
/* yy_get_previous_state - get the state just before the EOB char was reached */
1696
static yy_state_type yy_get_previous_state (yyscan_t yyscanner)
1698
register yy_state_type yy_current_state;
1699
register char *yy_cp;
1700
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1702
yy_current_state = yyg->yy_start;
1704
yyg->yy_state_ptr = yyg->yy_state_buf;
1705
*yyg->yy_state_ptr++ = yy_current_state;
1707
for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp )
1709
register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1710
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1712
yy_current_state = (int) yy_def[yy_current_state];
1713
if ( yy_current_state >= 251 )
1714
yy_c = yy_meta[(unsigned int) yy_c];
1716
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1717
*yyg->yy_state_ptr++ = yy_current_state;
1720
return yy_current_state;
1723
/* yy_try_NUL_trans - try to make a transition on the NUL character
1726
* next_state = yy_try_NUL_trans( current_state );
1728
static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner)
1730
register int yy_is_jam;
1731
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */
1733
register YY_CHAR yy_c = 1;
1734
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1736
yy_current_state = (int) yy_def[yy_current_state];
1737
if ( yy_current_state >= 251 )
1738
yy_c = yy_meta[(unsigned int) yy_c];
1740
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1741
yy_is_jam = (yy_current_state == 250);
1743
*yyg->yy_state_ptr++ = yy_current_state;
1745
return yy_is_jam ? 0 : yy_current_state;
1750
static int yyinput (yyscan_t yyscanner)
1752
static int input (yyscan_t yyscanner)
1757
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1759
*yyg->yy_c_buf_p = yyg->yy_hold_char;
1761
if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
1763
/* yy_c_buf_p now points to the character we want to return.
1764
* If this occurs *before* the EOB characters, then it's a
1765
* valid NUL; if not, then we've hit the end of the buffer.
1767
if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
1768
/* This was really a NUL. */
1769
*yyg->yy_c_buf_p = '\0';
1772
{ /* need more input */
1773
int offset = yyg->yy_c_buf_p - yyg->yytext_ptr;
1776
switch ( yy_get_next_buffer( yyscanner ) )
1778
case EOB_ACT_LAST_MATCH:
1779
/* This happens because yy_g_n_b()
1780
* sees that we've accumulated a
1781
* token and flags that we need to
1782
* try matching the token before
1783
* proceeding. But for input(),
1784
* there's no matching to consider.
1785
* So convert the EOB_ACT_LAST_MATCH
1786
* to EOB_ACT_END_OF_FILE.
1789
/* Reset buffer status. */
1790
xlu__disk_yyrestart(yyin ,yyscanner);
1794
case EOB_ACT_END_OF_FILE:
1796
if ( xlu__disk_yywrap(yyscanner ) )
1799
if ( ! yyg->yy_did_buffer_switch_on_eof )
1802
return yyinput(yyscanner);
1804
return input(yyscanner);
1808
case EOB_ACT_CONTINUE_SCAN:
1809
yyg->yy_c_buf_p = yyg->yytext_ptr + offset;
1815
c = *(unsigned char *) yyg->yy_c_buf_p; /* cast for 8-bit char's */
1816
*yyg->yy_c_buf_p = '\0'; /* preserve yytext */
1817
yyg->yy_hold_char = *++yyg->yy_c_buf_p;
1821
#endif /* ifndef YY_NO_INPUT */
1823
/** Immediately switch to a different input stream.
1824
* @param input_file A readable stream.
1825
* @param yyscanner The scanner object.
1826
* @note This function does not reset the start condition to @c INITIAL .
1828
void xlu__disk_yyrestart (FILE * input_file , yyscan_t yyscanner)
1830
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1832
if ( ! YY_CURRENT_BUFFER ){
1833
xlu__disk_yyensure_buffer_stack (yyscanner);
1834
YY_CURRENT_BUFFER_LVALUE =
1835
xlu__disk_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
1838
xlu__disk_yy_init_buffer(YY_CURRENT_BUFFER,input_file ,yyscanner);
1839
xlu__disk_yy_load_buffer_state(yyscanner );
1842
/** Switch to a different input buffer.
1843
* @param new_buffer The new input buffer.
1844
* @param yyscanner The scanner object.
1846
void xlu__disk_yy_switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
1848
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1850
/* TODO. We should be able to replace this entire function body
1852
* xlu__disk_yypop_buffer_state();
1853
* xlu__disk_yypush_buffer_state(new_buffer);
1855
xlu__disk_yyensure_buffer_stack (yyscanner);
1856
if ( YY_CURRENT_BUFFER == new_buffer )
1859
if ( YY_CURRENT_BUFFER )
1861
/* Flush out information for old buffer. */
1862
*yyg->yy_c_buf_p = yyg->yy_hold_char;
1863
YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
1864
YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
1867
YY_CURRENT_BUFFER_LVALUE = new_buffer;
1868
xlu__disk_yy_load_buffer_state(yyscanner );
1870
/* We don't actually know whether we did this switch during
1871
* EOF (xlu__disk_yywrap()) processing, but the only time this flag
1872
* is looked at is after xlu__disk_yywrap() is called, so it's safe
1873
* to go ahead and always set it.
1875
yyg->yy_did_buffer_switch_on_eof = 1;
1878
static void xlu__disk_yy_load_buffer_state (yyscan_t yyscanner)
1880
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1881
yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1882
yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1883
yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1884
yyg->yy_hold_char = *yyg->yy_c_buf_p;
1887
/** Allocate and initialize an input buffer state.
1888
* @param file A readable stream.
1889
* @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
1890
* @param yyscanner The scanner object.
1891
* @return the allocated buffer state.
1893
YY_BUFFER_STATE xlu__disk_yy_create_buffer (FILE * file, int size , yyscan_t yyscanner)
1897
b = (YY_BUFFER_STATE) xlu__disk_yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner );
1899
YY_FATAL_ERROR( "out of dynamic memory in xlu__disk_yy_create_buffer()" );
1901
b->yy_buf_size = size;
1903
/* yy_ch_buf has to be 2 characters longer than the size given because
1904
* we need to put in 2 end-of-buffer characters.
1906
b->yy_ch_buf = (char *) xlu__disk_yyalloc(b->yy_buf_size + 2 ,yyscanner );
1907
if ( ! b->yy_ch_buf )
1908
YY_FATAL_ERROR( "out of dynamic memory in xlu__disk_yy_create_buffer()" );
1910
b->yy_is_our_buffer = 1;
1912
xlu__disk_yy_init_buffer(b,file ,yyscanner);
1917
/** Destroy the buffer.
1918
* @param b a buffer created with xlu__disk_yy_create_buffer()
1919
* @param yyscanner The scanner object.
1921
void xlu__disk_yy_delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
1923
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1928
if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
1929
YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
1931
if ( b->yy_is_our_buffer )
1932
xlu__disk_yyfree((void *) b->yy_ch_buf ,yyscanner );
1934
xlu__disk_yyfree((void *) b ,yyscanner );
1938
extern int isatty (int );
1939
#endif /* __cplusplus */
1941
/* Initializes or reinitializes a buffer.
1942
* This function is sometimes called more than once on the same buffer,
1943
* such as during a xlu__disk_yyrestart() or at EOF.
1945
static void xlu__disk_yy_init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner)
1949
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1951
xlu__disk_yy_flush_buffer(b ,yyscanner);
1953
b->yy_input_file = file;
1954
b->yy_fill_buffer = 1;
1956
/* If b is the current buffer, then xlu__disk_yy_init_buffer was _probably_
1957
* called from xlu__disk_yyrestart() or through yy_get_next_buffer.
1958
* In that case, we don't want to reset the lineno or column.
1960
if (b != YY_CURRENT_BUFFER){
1961
b->yy_bs_lineno = 1;
1962
b->yy_bs_column = 0;
1965
b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1970
/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
1971
* @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
1972
* @param yyscanner The scanner object.
1974
void xlu__disk_yy_flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
1976
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1982
/* We always need two end-of-buffer characters. The first causes
1983
* a transition to the end-of-buffer state. The second causes
1984
* a jam in that state.
1986
b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1987
b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1989
b->yy_buf_pos = &b->yy_ch_buf[0];
1992
b->yy_buffer_status = YY_BUFFER_NEW;
1994
if ( b == YY_CURRENT_BUFFER )
1995
xlu__disk_yy_load_buffer_state(yyscanner );
1998
/** Pushes the new state onto the stack. The new state becomes
1999
* the current state. This function will allocate the stack
2001
* @param new_buffer The new state.
2002
* @param yyscanner The scanner object.
2004
void xlu__disk_yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
2006
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2007
if (new_buffer == NULL)
2010
xlu__disk_yyensure_buffer_stack(yyscanner);
2012
/* This block is copied from xlu__disk_yy_switch_to_buffer. */
2013
if ( YY_CURRENT_BUFFER )
2015
/* Flush out information for old buffer. */
2016
*yyg->yy_c_buf_p = yyg->yy_hold_char;
2017
YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
2018
YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
2021
/* Only push if top exists. Otherwise, replace top. */
2022
if (YY_CURRENT_BUFFER)
2023
yyg->yy_buffer_stack_top++;
2024
YY_CURRENT_BUFFER_LVALUE = new_buffer;
2026
/* copied from xlu__disk_yy_switch_to_buffer. */
2027
xlu__disk_yy_load_buffer_state(yyscanner );
2028
yyg->yy_did_buffer_switch_on_eof = 1;
2031
/** Removes and deletes the top of the stack, if present.
2032
* The next element becomes the new top.
2033
* @param yyscanner The scanner object.
2035
void xlu__disk_yypop_buffer_state (yyscan_t yyscanner)
2037
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2038
if (!YY_CURRENT_BUFFER)
2041
xlu__disk_yy_delete_buffer(YY_CURRENT_BUFFER ,yyscanner);
2042
YY_CURRENT_BUFFER_LVALUE = NULL;
2043
if (yyg->yy_buffer_stack_top > 0)
2044
--yyg->yy_buffer_stack_top;
2046
if (YY_CURRENT_BUFFER) {
2047
xlu__disk_yy_load_buffer_state(yyscanner );
2048
yyg->yy_did_buffer_switch_on_eof = 1;
2052
/* Allocates the stack if it does not exist.
2053
* Guarantees space for at least one push.
2055
static void xlu__disk_yyensure_buffer_stack (yyscan_t yyscanner)
2058
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2060
if (!yyg->yy_buffer_stack) {
2062
/* First allocation is just for 2 elements, since we don't know if this
2063
* scanner will even need a stack. We use 2 instead of 1 to avoid an
2064
* immediate realloc on the next call.
2067
yyg->yy_buffer_stack = (struct yy_buffer_state**)xlu__disk_yyalloc
2068
(num_to_alloc * sizeof(struct yy_buffer_state*)
2070
if ( ! yyg->yy_buffer_stack )
2071
YY_FATAL_ERROR( "out of dynamic memory in xlu__disk_yyensure_buffer_stack()" );
2073
memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*));
2075
yyg->yy_buffer_stack_max = num_to_alloc;
2076
yyg->yy_buffer_stack_top = 0;
2080
if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){
2082
/* Increase the buffer to prepare for a possible push. */
2083
int grow_size = 8 /* arbitrary grow size */;
2085
num_to_alloc = yyg->yy_buffer_stack_max + grow_size;
2086
yyg->yy_buffer_stack = (struct yy_buffer_state**)xlu__disk_yyrealloc
2087
(yyg->yy_buffer_stack,
2088
num_to_alloc * sizeof(struct yy_buffer_state*)
2090
if ( ! yyg->yy_buffer_stack )
2091
YY_FATAL_ERROR( "out of dynamic memory in xlu__disk_yyensure_buffer_stack()" );
2093
/* zero only the new slots.*/
2094
memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*));
2095
yyg->yy_buffer_stack_max = num_to_alloc;
2099
/** Setup the input buffer state to scan directly from a user-specified character buffer.
2100
* @param base the character buffer
2101
* @param size the size in bytes of the character buffer
2102
* @param yyscanner The scanner object.
2103
* @return the newly allocated buffer state object.
2105
YY_BUFFER_STATE xlu__disk_yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner)
2110
base[size-2] != YY_END_OF_BUFFER_CHAR ||
2111
base[size-1] != YY_END_OF_BUFFER_CHAR )
2112
/* They forgot to leave room for the EOB's. */
2115
b = (YY_BUFFER_STATE) xlu__disk_yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner );
2117
YY_FATAL_ERROR( "out of dynamic memory in xlu__disk_yy_scan_buffer()" );
2119
b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
2120
b->yy_buf_pos = b->yy_ch_buf = base;
2121
b->yy_is_our_buffer = 0;
2122
b->yy_input_file = 0;
2123
b->yy_n_chars = b->yy_buf_size;
2124
b->yy_is_interactive = 0;
2126
b->yy_fill_buffer = 0;
2127
b->yy_buffer_status = YY_BUFFER_NEW;
2129
xlu__disk_yy_switch_to_buffer(b ,yyscanner );
2134
/** Setup the input buffer state to scan a string. The next call to xlu__disk_yylex() will
2135
* scan from a @e copy of @a str.
2136
* @param yystr a NUL-terminated string to scan
2137
* @param yyscanner The scanner object.
2138
* @return the newly allocated buffer state object.
2139
* @note If you want to scan bytes that may contain NUL values, then use
2140
* xlu__disk_yy_scan_bytes() instead.
2142
YY_BUFFER_STATE xlu__disk_yy_scan_string (yyconst char * yystr , yyscan_t yyscanner)
2145
return xlu__disk_yy_scan_bytes(yystr,strlen(yystr) ,yyscanner);
2148
/** Setup the input buffer state to scan the given bytes. The next call to xlu__disk_yylex() will
2149
* scan from a @e copy of @a bytes.
2150
* @param yybytes the byte buffer to scan
2151
* @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
2152
* @param yyscanner The scanner object.
2153
* @return the newly allocated buffer state object.
2155
YY_BUFFER_STATE xlu__disk_yy_scan_bytes (yyconst char * yybytes, int _yybytes_len , yyscan_t yyscanner)
2162
/* Get memory for full buffer, including space for trailing EOB's. */
2163
n = _yybytes_len + 2;
2164
buf = (char *) xlu__disk_yyalloc(n ,yyscanner );
2166
YY_FATAL_ERROR( "out of dynamic memory in xlu__disk_yy_scan_bytes()" );
2168
for ( i = 0; i < _yybytes_len; ++i )
2169
buf[i] = yybytes[i];
2171
buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
2173
b = xlu__disk_yy_scan_buffer(buf,n ,yyscanner);
2175
YY_FATAL_ERROR( "bad buffer in xlu__disk_yy_scan_bytes()" );
2177
/* It's okay to grow etc. this buffer, and we should throw it
2178
* away when we're done.
2180
b->yy_is_our_buffer = 1;
2185
#ifndef YY_EXIT_FAILURE
2186
#define YY_EXIT_FAILURE 2
2189
static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner)
2191
(void) fprintf( stderr, "%s\n", msg );
2192
exit( YY_EXIT_FAILURE );
2195
/* Redefine yyless() so it works in section 3 code. */
2201
/* Undo effects of setting up yytext. */ \
2202
int yyless_macro_arg = (n); \
2203
YY_LESS_LINENO(yyless_macro_arg);\
2204
yytext[yyleng] = yyg->yy_hold_char; \
2205
yyg->yy_c_buf_p = yytext + yyless_macro_arg; \
2206
yyg->yy_hold_char = *yyg->yy_c_buf_p; \
2207
*yyg->yy_c_buf_p = '\0'; \
2208
yyleng = yyless_macro_arg; \
2212
/* Accessor methods (get/set functions) to struct members. */
2214
/** Get the user-defined data for this scanner.
2215
* @param yyscanner The scanner object.
2217
YY_EXTRA_TYPE xlu__disk_yyget_extra (yyscan_t yyscanner)
2219
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2223
/** Get the current line number.
2224
* @param yyscanner The scanner object.
2226
int xlu__disk_yyget_lineno (yyscan_t yyscanner)
2228
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2230
if (! YY_CURRENT_BUFFER)
2236
/** Get the current column number.
2237
* @param yyscanner The scanner object.
2239
int xlu__disk_yyget_column (yyscan_t yyscanner)
2241
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2243
if (! YY_CURRENT_BUFFER)
2249
/** Get the input stream.
2250
* @param yyscanner The scanner object.
2252
FILE *xlu__disk_yyget_in (yyscan_t yyscanner)
2254
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2258
/** Get the output stream.
2259
* @param yyscanner The scanner object.
2261
FILE *xlu__disk_yyget_out (yyscan_t yyscanner)
2263
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2267
/** Get the length of the current token.
2268
* @param yyscanner The scanner object.
2270
int xlu__disk_yyget_leng (yyscan_t yyscanner)
2272
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2276
/** Get the current token.
2277
* @param yyscanner The scanner object.
2280
char *xlu__disk_yyget_text (yyscan_t yyscanner)
2282
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2286
/** Set the user-defined data. This data is never touched by the scanner.
2287
* @param user_defined The data to be associated with this scanner.
2288
* @param yyscanner The scanner object.
2290
void xlu__disk_yyset_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner)
2292
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2293
yyextra = user_defined ;
2296
/** Set the current line number.
2297
* @param line_number
2298
* @param yyscanner The scanner object.
2300
void xlu__disk_yyset_lineno (int line_number , yyscan_t yyscanner)
2302
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2304
/* lineno is only valid if an input buffer exists. */
2305
if (! YY_CURRENT_BUFFER )
2306
yy_fatal_error( "xlu__disk_yyset_lineno called with no buffer" , yyscanner);
2308
yylineno = line_number;
2311
/** Set the current column.
2312
* @param line_number
2313
* @param yyscanner The scanner object.
2315
void xlu__disk_yyset_column (int column_no , yyscan_t yyscanner)
2317
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2319
/* column is only valid if an input buffer exists. */
2320
if (! YY_CURRENT_BUFFER )
2321
yy_fatal_error( "xlu__disk_yyset_column called with no buffer" , yyscanner);
2323
yycolumn = column_no;
2326
/** Set the input stream. This does not discard the current
2328
* @param in_str A readable stream.
2329
* @param yyscanner The scanner object.
2330
* @see xlu__disk_yy_switch_to_buffer
2332
void xlu__disk_yyset_in (FILE * in_str , yyscan_t yyscanner)
2334
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2338
void xlu__disk_yyset_out (FILE * out_str , yyscan_t yyscanner)
2340
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2344
int xlu__disk_yyget_debug (yyscan_t yyscanner)
2346
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2347
return yy_flex_debug;
2350
void xlu__disk_yyset_debug (int bdebug , yyscan_t yyscanner)
2352
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2353
yy_flex_debug = bdebug ;
2356
/* Accessor methods for yylval and yylloc */
2358
/* User-visible API */
2360
/* xlu__disk_yylex_init is special because it creates the scanner itself, so it is
2361
* the ONLY reentrant function that doesn't take the scanner as the last argument.
2362
* That's why we explicitly handle the declaration, instead of using our macros.
2365
int xlu__disk_yylex_init(yyscan_t* ptr_yy_globals)
2368
if (ptr_yy_globals == NULL){
2373
*ptr_yy_globals = (yyscan_t) xlu__disk_yyalloc ( sizeof( struct yyguts_t ), NULL );
2375
if (*ptr_yy_globals == NULL){
2380
/* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */
2381
memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
2383
return yy_init_globals ( *ptr_yy_globals );
2386
/* xlu__disk_yylex_init_extra has the same functionality as xlu__disk_yylex_init, but follows the
2387
* convention of taking the scanner as the last argument. Note however, that
2388
* this is a *pointer* to a scanner, as it will be allocated by this call (and
2389
* is the reason, too, why this function also must handle its own declaration).
2390
* The user defined value in the first argument will be available to xlu__disk_yyalloc in
2391
* the yyextra field.
2394
int xlu__disk_yylex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* ptr_yy_globals )
2397
struct yyguts_t dummy_yyguts;
2399
xlu__disk_yyset_extra (yy_user_defined, &dummy_yyguts);
2401
if (ptr_yy_globals == NULL){
2406
*ptr_yy_globals = (yyscan_t) xlu__disk_yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts );
2408
if (*ptr_yy_globals == NULL){
2413
/* By setting to 0xAA, we expose bugs in
2414
yy_init_globals. Leave at 0x00 for releases. */
2415
memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
2417
xlu__disk_yyset_extra (yy_user_defined, *ptr_yy_globals);
2419
return yy_init_globals ( *ptr_yy_globals );
2422
static int yy_init_globals (yyscan_t yyscanner)
2424
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2425
/* Initialization is the same as for the non-reentrant scanner.
2426
* This function is called from xlu__disk_yylex_destroy(), so don't allocate here.
2429
yyg->yy_buffer_stack = 0;
2430
yyg->yy_buffer_stack_top = 0;
2431
yyg->yy_buffer_stack_max = 0;
2432
yyg->yy_c_buf_p = (char *) 0;
2436
yyg->yy_start_stack_ptr = 0;
2437
yyg->yy_start_stack_depth = 0;
2438
yyg->yy_start_stack = NULL;
2440
yyg->yy_state_buf = 0;
2441
yyg->yy_state_ptr = 0;
2442
yyg->yy_full_match = 0;
2445
/* Defined in main.c */
2454
/* For future reference: Set errno on error, since we are called by
2455
* xlu__disk_yylex_init()
2460
/* xlu__disk_yylex_destroy is for both reentrant and non-reentrant scanners. */
2461
int xlu__disk_yylex_destroy (yyscan_t yyscanner)
2463
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2465
/* Pop the buffer stack, destroying each element. */
2466
while(YY_CURRENT_BUFFER){
2467
xlu__disk_yy_delete_buffer(YY_CURRENT_BUFFER ,yyscanner );
2468
YY_CURRENT_BUFFER_LVALUE = NULL;
2469
xlu__disk_yypop_buffer_state(yyscanner);
2472
/* Destroy the stack itself. */
2473
xlu__disk_yyfree(yyg->yy_buffer_stack ,yyscanner);
2474
yyg->yy_buffer_stack = NULL;
2476
/* Destroy the start condition stack. */
2477
xlu__disk_yyfree(yyg->yy_start_stack ,yyscanner );
2478
yyg->yy_start_stack = NULL;
2480
xlu__disk_yyfree ( yyg->yy_state_buf , yyscanner);
2481
yyg->yy_state_buf = NULL;
2483
/* Reset the globals. This is important in a non-reentrant scanner so the next time
2484
* xlu__disk_yylex() is called, initialization will occur. */
2485
yy_init_globals( yyscanner);
2487
/* Destroy the main struct (reentrant only). */
2488
xlu__disk_yyfree ( yyscanner , yyscanner );
2494
* Internal utility routines.
2498
static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner)
2501
for ( i = 0; i < n; ++i )
2506
#ifdef YY_NEED_STRLEN
2507
static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner)
2510
for ( n = 0; s[n]; ++n )
2517
void *xlu__disk_yyalloc (yy_size_t size , yyscan_t yyscanner)
2519
return (void *) malloc( size );
2522
void *xlu__disk_yyrealloc (void * ptr, yy_size_t size , yyscan_t yyscanner)
2524
/* The cast to (char *) in the following accommodates both
2525
* implementations that use char* generic pointers, and those
2526
* that use void* generic pointers. It works with the latter
2527
* because both ANSI C and C++ allow castless assignment from
2528
* any pointer type to void*, and deal with argument conversions
2529
* as though doing an assignment.
2531
return (void *) realloc( (char *) ptr, size );
2534
void xlu__disk_yyfree (void * ptr , yyscan_t yyscanner)
2536
free( (char *) ptr ); /* see xlu__disk_yyrealloc() for (char *) cast */
2539
#define YYTABLES_NAME "yytables"
2541
#line 255 "libxlu_disk_l.l"