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