debuggers.hg

view tools/libxl/libxlu_cfg_l.c @ 22855:1d1eec7e1fb4

xl: Perform minimal validation of virtual disk file while parsing config file

This patch performs some very basic validation on the virtual disk
file passed through the config file. This validation ensures that we
don't go too far with the initialization like spawn qemu and more
while there could be some potentially fundamental issues.

[ Patch fixed up to work with PHYSTYPE_EMPTY 22808:6ec61438713a -iwj ]

Signed-off-by: Kamala Narasimhan <kamala.narasimhan@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
author Kamala Narasimhan <kamala.narasimhan@gmail.com>
date Tue Jan 25 18:09:49 2011 +0000 (2011-01-25)
parents 20b0f709153e
children
line source
1 #line 2 "libxlu_cfg_l.c"
3 #line 4 "libxlu_cfg_l.c"
5 #define YY_INT_ALIGNED short int
7 /* A lexical scanner generated by flex */
9 #define FLEX_SCANNER
10 #define YY_FLEX_MAJOR_VERSION 2
11 #define YY_FLEX_MINOR_VERSION 5
12 #define YY_FLEX_SUBMINOR_VERSION 35
13 #if YY_FLEX_SUBMINOR_VERSION > 0
14 #define FLEX_BETA
15 #endif
17 /* First, we deal with platform-specific or compiler-specific issues. */
19 /* begin standard C headers. */
20 #include <stdio.h>
21 #include <string.h>
22 #include <errno.h>
23 #include <stdlib.h>
25 /* end standard C headers. */
27 /* flex integer type definitions */
29 #ifndef FLEXINT_H
30 #define FLEXINT_H
32 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
34 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
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
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;
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
87 #endif /* ! C99 */
89 #endif /* ! FLEXINT_H */
91 #ifdef __cplusplus
93 /* The "const" storage-class-modifier is valid. */
94 #define YY_USE_CONST
96 #else /* ! __cplusplus */
98 /* C99 requires __STDC__ to be defined as 1. */
99 #if defined (__STDC__)
101 #define YY_USE_CONST
103 #endif /* defined (__STDC__) */
104 #endif /* ! __cplusplus */
106 #ifdef YY_USE_CONST
107 #define yyconst const
108 #else
109 #define yyconst
110 #endif
112 /* Returned upon end-of-file. */
113 #define YY_NULL 0
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)
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
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
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 *
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
152 /* Action number for EOF rule of a given start state. */
153 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
155 /* Special action meaning "start processing a new file". */
156 #define YY_NEW_FILE xlu__cfg_yyrestart(yyin ,yyscanner )
158 #define YY_END_OF_BUFFER_CHAR 0
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
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))
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
182 #define EOB_ACT_CONTINUE_SCAN 0
183 #define EOB_ACT_END_OF_FILE 1
184 #define EOB_ACT_LAST_MATCH 2
186 /* Note: We specifically omit the test for yy_rule_can_match_eol because it requires
187 * access to the local variable yy_act. Since yyless() is a macro, it would break
188 * existing scanners that call yyless() from OUTSIDE xlu__cfg_yylex.
189 * One obvious solution it to make yy_act a global. I tried that, and saw
190 * a 5% performance hit in a non-yylineno scanner, because yy_act is
191 * normally declared as a register variable-- so it is not worth it.
192 */
193 #define YY_LESS_LINENO(n) \
194 do { \
195 int yyl;\
196 for ( yyl = n; yyl < yyleng; ++yyl )\
197 if ( yytext[yyl] == '\n' )\
198 --yylineno;\
199 }while(0)
201 /* Return all but the first "n" matched characters back to the input stream. */
202 #define yyless(n) \
203 do \
204 { \
205 /* Undo effects of setting up yytext. */ \
206 int yyless_macro_arg = (n); \
207 YY_LESS_LINENO(yyless_macro_arg);\
208 *yy_cp = yyg->yy_hold_char; \
209 YY_RESTORE_YY_MORE_OFFSET \
210 yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
211 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
212 } \
213 while ( 0 )
215 #define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner )
217 #ifndef YY_TYPEDEF_YY_SIZE_T
218 #define YY_TYPEDEF_YY_SIZE_T
219 typedef size_t yy_size_t;
220 #endif
222 #ifndef YY_STRUCT_YY_BUFFER_STATE
223 #define YY_STRUCT_YY_BUFFER_STATE
224 struct yy_buffer_state
225 {
226 FILE *yy_input_file;
228 char *yy_ch_buf; /* input buffer */
229 char *yy_buf_pos; /* current position in input buffer */
231 /* Size of input buffer in bytes, not including room for EOB
232 * characters.
233 */
234 yy_size_t yy_buf_size;
236 /* Number of characters read into yy_ch_buf, not including EOB
237 * characters.
238 */
239 int yy_n_chars;
241 /* Whether we "own" the buffer - i.e., we know we created it,
242 * and can realloc() it to grow it, and should free() it to
243 * delete it.
244 */
245 int yy_is_our_buffer;
247 /* Whether this is an "interactive" input source; if so, and
248 * if we're using stdio for input, then we want to use getc()
249 * instead of fread(), to make sure we stop fetching input after
250 * each newline.
251 */
252 int yy_is_interactive;
254 /* Whether we're considered to be at the beginning of a line.
255 * If so, '^' rules will be active on the next match, otherwise
256 * not.
257 */
258 int yy_at_bol;
260 int yy_bs_lineno; /**< The line count. */
261 int yy_bs_column; /**< The column count. */
263 /* Whether to try to fill the input buffer when we reach the
264 * end of it.
265 */
266 int yy_fill_buffer;
268 int yy_buffer_status;
270 #define YY_BUFFER_NEW 0
271 #define YY_BUFFER_NORMAL 1
272 /* When an EOF's been seen but there's still some text to process
273 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
274 * shouldn't try reading from the input source any more. We might
275 * still have a bunch of tokens to match, though, because of
276 * possible backing-up.
277 *
278 * When we actually see the EOF, we change the status to "new"
279 * (via xlu__cfg_yyrestart()), so that the user can continue scanning by
280 * just pointing yyin at a new input file.
281 */
282 #define YY_BUFFER_EOF_PENDING 2
284 };
285 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
287 /* We provide macros for accessing buffer states in case in the
288 * future we want to put the buffer states in a more general
289 * "scanner state".
290 *
291 * Returns the top of the stack, or NULL.
292 */
293 #define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \
294 ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \
295 : NULL)
297 /* Same as previous macro, but useful when we know that the buffer stack is not
298 * NULL or when we need an lvalue. For internal use only.
299 */
300 #define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]
302 void xlu__cfg_yyrestart (FILE *input_file ,yyscan_t yyscanner );
303 void xlu__cfg_yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
304 YY_BUFFER_STATE xlu__cfg_yy_create_buffer (FILE *file,int size ,yyscan_t yyscanner );
305 void xlu__cfg_yy_delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
306 void xlu__cfg_yy_flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
307 void xlu__cfg_yypush_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
308 void xlu__cfg_yypop_buffer_state (yyscan_t yyscanner );
310 static void xlu__cfg_yyensure_buffer_stack (yyscan_t yyscanner );
311 static void xlu__cfg_yy_load_buffer_state (yyscan_t yyscanner );
312 static void xlu__cfg_yy_init_buffer (YY_BUFFER_STATE b,FILE *file ,yyscan_t yyscanner );
314 #define YY_FLUSH_BUFFER xlu__cfg_yy_flush_buffer(YY_CURRENT_BUFFER ,yyscanner)
316 YY_BUFFER_STATE xlu__cfg_yy_scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner );
317 YY_BUFFER_STATE xlu__cfg_yy_scan_string (yyconst char *yy_str ,yyscan_t yyscanner );
318 YY_BUFFER_STATE xlu__cfg_yy_scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner );
320 void *xlu__cfg_yyalloc (yy_size_t ,yyscan_t yyscanner );
321 void *xlu__cfg_yyrealloc (void *,yy_size_t ,yyscan_t yyscanner );
322 void xlu__cfg_yyfree (void * ,yyscan_t yyscanner );
324 #define yy_new_buffer xlu__cfg_yy_create_buffer
326 #define yy_set_interactive(is_interactive) \
327 { \
328 if ( ! YY_CURRENT_BUFFER ){ \
329 xlu__cfg_yyensure_buffer_stack (yyscanner); \
330 YY_CURRENT_BUFFER_LVALUE = \
331 xlu__cfg_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
332 } \
333 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
334 }
336 #define yy_set_bol(at_bol) \
337 { \
338 if ( ! YY_CURRENT_BUFFER ){\
339 xlu__cfg_yyensure_buffer_stack (yyscanner); \
340 YY_CURRENT_BUFFER_LVALUE = \
341 xlu__cfg_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
342 } \
343 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
344 }
346 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
348 #define xlu__cfg_yywrap(n) 1
349 #define YY_SKIP_YYWRAP
351 typedef unsigned char YY_CHAR;
353 typedef int yy_state_type;
355 #define yytext_ptr yytext_r
357 static yy_state_type yy_get_previous_state (yyscan_t yyscanner );
358 static yy_state_type yy_try_NUL_trans (yy_state_type current_state ,yyscan_t yyscanner);
359 static int yy_get_next_buffer (yyscan_t yyscanner );
360 static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner );
362 /* Done after the current pattern has been matched and before the
363 * corresponding action - sets up yytext.
364 */
365 #define YY_DO_BEFORE_ACTION \
366 yyg->yytext_ptr = yy_bp; \
367 yyg->yytext_ptr -= yyg->yy_more_len; \
368 yyleng = (size_t) (yy_cp - yyg->yytext_ptr); \
369 yyg->yy_hold_char = *yy_cp; \
370 *yy_cp = '\0'; \
371 yyg->yy_c_buf_p = yy_cp;
373 #define YY_NUM_RULES 16
374 #define YY_END_OF_BUFFER 17
375 /* This struct is not used in this scanner,
376 but its presence is necessary. */
377 struct yy_trans_info
378 {
379 flex_int32_t yy_verify;
380 flex_int32_t yy_nxt;
381 };
382 static yyconst flex_int16_t yy_accept[35] =
383 { 0,
384 0, 0, 14, 14, 17, 13, 3, 9, 13, 13,
385 13, 12, 4, 2, 8, 7, 5, 6, 1, 14,
386 14, 15, 0, 11, 0, 0, 9, 0, 10, 0,
387 2, 1, 14, 0
388 } ;
390 static yyconst flex_int32_t yy_ec[256] =
391 { 0,
392 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
393 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
394 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
395 1, 2, 1, 4, 5, 1, 1, 1, 6, 7,
396 7, 1, 7, 8, 7, 7, 1, 9, 9, 9,
397 9, 9, 9, 9, 9, 9, 9, 7, 10, 1,
398 11, 1, 1, 1, 1, 1, 1, 1, 1, 1,
399 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
400 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
401 12, 13, 14, 1, 15, 1, 16, 16, 16, 16,
403 16, 16, 17, 17, 17, 17, 17, 17, 17, 17,
404 17, 17, 17, 17, 17, 17, 17, 17, 17, 16,
405 17, 17, 1, 1, 1, 1, 1, 1, 1, 1,
406 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
407 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
408 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
409 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
410 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
411 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
412 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
420 } ;
422 static yyconst flex_int32_t yy_meta[18] =
423 { 0,
424 1, 2, 3, 1, 1, 1, 1, 1, 4, 1,
425 1, 1, 1, 1, 4, 4, 4
426 } ;
428 static yyconst flex_int16_t yy_base[41] =
429 { 0,
430 0, 0, 16, 18, 50, 56, 56, 56, 18, 39,
431 17, 56, 56, 16, 56, 56, 56, 56, 0, 0,
432 56, 56, 20, 56, 0, 26, 56, 21, 56, 0,
433 19, 0, 0, 56, 35, 39, 43, 47, 22, 51
434 } ;
436 static yyconst flex_int16_t yy_def[41] =
437 { 0,
438 34, 1, 35, 35, 34, 34, 34, 34, 36, 37,
439 38, 34, 34, 34, 34, 34, 34, 34, 39, 40,
440 34, 34, 36, 34, 36, 37, 34, 38, 34, 38,
441 34, 39, 40, 0, 34, 34, 34, 34, 34, 34
442 } ;
444 static yyconst flex_int16_t yy_nxt[74] =
445 { 0,
446 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
447 16, 17, 6, 18, 6, 19, 19, 21, 22, 21,
448 22, 24, 29, 24, 31, 32, 29, 31, 27, 30,
449 25, 31, 25, 30, 31, 20, 20, 20, 20, 23,
450 23, 27, 23, 26, 26, 26, 26, 28, 28, 34,
451 28, 33, 34, 34, 33, 5, 34, 34, 34, 34,
452 34, 34, 34, 34, 34, 34, 34, 34, 34, 34,
453 34, 34, 34
454 } ;
456 static yyconst flex_int16_t yy_chk[74] =
457 { 0,
458 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
459 1, 1, 1, 1, 1, 1, 1, 3, 3, 4,
460 4, 9, 11, 23, 14, 39, 28, 31, 26, 11,
461 9, 14, 23, 28, 31, 35, 35, 35, 35, 36,
462 36, 10, 36, 37, 37, 37, 37, 38, 38, 5,
463 38, 40, 0, 0, 40, 34, 34, 34, 34, 34,
464 34, 34, 34, 34, 34, 34, 34, 34, 34, 34,
465 34, 34, 34
466 } ;
468 /* Table of booleans, true if rule could match eol. */
469 static yyconst flex_int32_t yy_rule_can_match_eol[17] =
470 { 0,
471 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, };
473 /* The intent behind this definition is that it'll catch
474 * any uses of REJECT which flex missed.
475 */
476 #define REJECT reject_used_but_not_detected
477 #define yymore() (yyg->yy_more_flag = 1)
478 #define YY_MORE_ADJ yyg->yy_more_len
479 #define YY_RESTORE_YY_MORE_OFFSET
480 #line 1 "libxlu_cfg_l.l"
481 /* -*- fundamental -*- */
482 #line 4 "libxlu_cfg_l.l"
483 #include "libxlu_cfg_i.h"
485 #define ctx ((CfgParseContext*)yyextra)
486 #define YY_NO_INPUT
488 #define GOT(x) do{ \
489 yylloc->first_line= yylineno; \
490 return (x); \
491 }while(0)
493 /* Some versions of flex have a bug (Fedora bugzilla 612465) which causes
494 * it to fail to declare these functions, which it defines. So declare
495 * them ourselves. Hopefully we won't have to simultaneously support
496 * a flex version which declares these differently somehow. */
497 int xlu__cfg_yyget_column(yyscan_t yyscanner);
498 void xlu__cfg_yyset_column(int column_no, yyscan_t yyscanner);
501 #line 502 "libxlu_cfg_l.c"
503 #define INITIAL 0
504 #define lexerr 1
506 #ifndef YY_NO_UNISTD_H
507 /* Special case for "unistd.h", since it is non-ANSI. We include it way
508 * down here because we want the user's section 1 to have been scanned first.
509 * The user has a chance to override it with an option.
510 */
511 #include <unistd.h>
512 #endif
514 #ifndef YY_EXTRA_TYPE
515 #define YY_EXTRA_TYPE void *
516 #endif
518 /* Holds the entire state of the reentrant scanner. */
519 struct yyguts_t
520 {
522 /* User-defined. Not touched by flex. */
523 YY_EXTRA_TYPE yyextra_r;
525 /* The rest are the same as the globals declared in the non-reentrant scanner. */
526 FILE *yyin_r, *yyout_r;
527 size_t yy_buffer_stack_top; /**< index of top of stack. */
528 size_t yy_buffer_stack_max; /**< capacity of stack. */
529 YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */
530 char yy_hold_char;
531 int yy_n_chars;
532 int yyleng_r;
533 char *yy_c_buf_p;
534 int yy_init;
535 int yy_start;
536 int yy_did_buffer_switch_on_eof;
537 int yy_start_stack_ptr;
538 int yy_start_stack_depth;
539 int *yy_start_stack;
540 yy_state_type yy_last_accepting_state;
541 char* yy_last_accepting_cpos;
543 int yylineno_r;
544 int yy_flex_debug_r;
546 char *yytext_r;
547 int yy_more_flag;
548 int yy_more_len;
550 YYSTYPE * yylval_r;
552 YYLTYPE * yylloc_r;
554 }; /* end struct yyguts_t */
556 static int yy_init_globals (yyscan_t yyscanner );
558 /* This must go here because YYSTYPE and YYLTYPE are included
559 * from bison output in section 1.*/
560 # define yylval yyg->yylval_r
562 # define yylloc yyg->yylloc_r
564 int xlu__cfg_yylex_init (yyscan_t* scanner);
566 int xlu__cfg_yylex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner);
568 /* Accessor methods to globals.
569 These are made visible to non-reentrant scanners for convenience. */
571 int xlu__cfg_yylex_destroy (yyscan_t yyscanner );
573 int xlu__cfg_yyget_debug (yyscan_t yyscanner );
575 void xlu__cfg_yyset_debug (int debug_flag ,yyscan_t yyscanner );
577 YY_EXTRA_TYPE xlu__cfg_yyget_extra (yyscan_t yyscanner );
579 void xlu__cfg_yyset_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner );
581 FILE *xlu__cfg_yyget_in (yyscan_t yyscanner );
583 void xlu__cfg_yyset_in (FILE * in_str ,yyscan_t yyscanner );
585 FILE *xlu__cfg_yyget_out (yyscan_t yyscanner );
587 void xlu__cfg_yyset_out (FILE * out_str ,yyscan_t yyscanner );
589 int xlu__cfg_yyget_leng (yyscan_t yyscanner );
591 char *xlu__cfg_yyget_text (yyscan_t yyscanner );
593 int xlu__cfg_yyget_lineno (yyscan_t yyscanner );
595 void xlu__cfg_yyset_lineno (int line_number ,yyscan_t yyscanner );
597 YYSTYPE * xlu__cfg_yyget_lval (yyscan_t yyscanner );
599 void xlu__cfg_yyset_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner );
601 YYLTYPE *xlu__cfg_yyget_lloc (yyscan_t yyscanner );
603 void xlu__cfg_yyset_lloc (YYLTYPE * yylloc_param ,yyscan_t yyscanner );
605 /* Macros after this point can all be overridden by user definitions in
606 * section 1.
607 */
609 #ifndef YY_SKIP_YYWRAP
610 #ifdef __cplusplus
611 extern "C" int xlu__cfg_yywrap (yyscan_t yyscanner );
612 #else
613 extern int xlu__cfg_yywrap (yyscan_t yyscanner );
614 #endif
615 #endif
617 #ifndef yytext_ptr
618 static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner);
619 #endif
621 #ifdef YY_NEED_STRLEN
622 static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner);
623 #endif
625 #ifndef YY_NO_INPUT
627 #ifdef __cplusplus
628 static int yyinput (yyscan_t yyscanner );
629 #else
630 static int input (yyscan_t yyscanner );
631 #endif
633 #endif
635 /* Amount of stuff to slurp up with each read. */
636 #ifndef YY_READ_BUF_SIZE
637 #ifdef __ia64__
638 /* On IA-64, the buffer size is 16k, not 8k */
639 #define YY_READ_BUF_SIZE 16384
640 #else
641 #define YY_READ_BUF_SIZE 8192
642 #endif /* __ia64__ */
643 #endif
645 /* Copy whatever the last rule matched to the standard output. */
646 #ifndef ECHO
647 /* This used to be an fputs(), but since the string might contain NUL's,
648 * we now use fwrite().
649 */
650 #define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
651 #endif
653 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
654 * is returned in "result".
655 */
656 #ifndef YY_INPUT
657 #define YY_INPUT(buf,result,max_size) \
658 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
659 { \
660 int c = '*'; \
661 size_t n; \
662 for ( n = 0; n < max_size && \
663 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
664 buf[n] = (char) c; \
665 if ( c == '\n' ) \
666 buf[n++] = (char) c; \
667 if ( c == EOF && ferror( yyin ) ) \
668 YY_FATAL_ERROR( "input in flex scanner failed" ); \
669 result = n; \
670 } \
671 else \
672 { \
673 errno=0; \
674 while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
675 { \
676 if( errno != EINTR) \
677 { \
678 YY_FATAL_ERROR( "input in flex scanner failed" ); \
679 break; \
680 } \
681 errno=0; \
682 clearerr(yyin); \
683 } \
684 }\
685 \
687 #endif
689 /* No semi-colon after return; correct usage is to write "yyterminate();" -
690 * we don't want an extra ';' after the "return" because that will cause
691 * some compilers to complain about unreachable statements.
692 */
693 #ifndef yyterminate
694 #define yyterminate() return YY_NULL
695 #endif
697 /* Number of entries by which start-condition stack grows. */
698 #ifndef YY_START_STACK_INCR
699 #define YY_START_STACK_INCR 25
700 #endif
702 /* Report a fatal error. */
703 #ifndef YY_FATAL_ERROR
704 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner)
705 #endif
707 /* end tables serialization structures and prototypes */
709 /* Default declaration of generated scanner - a define so the user can
710 * easily add parameters.
711 */
712 #ifndef YY_DECL
713 #define YY_DECL_IS_OURS 1
715 extern int xlu__cfg_yylex \
716 (YYSTYPE * yylval_param,YYLTYPE * yylloc_param ,yyscan_t yyscanner);
718 #define YY_DECL int xlu__cfg_yylex \
719 (YYSTYPE * yylval_param, YYLTYPE * yylloc_param , yyscan_t yyscanner)
720 #endif /* !YY_DECL */
722 /* Code executed at the beginning of each rule, after yytext and yyleng
723 * have been set up.
724 */
725 #ifndef YY_USER_ACTION
726 #define YY_USER_ACTION
727 #endif
729 /* Code executed at the end of each rule. */
730 #ifndef YY_BREAK
731 #define YY_BREAK break;
732 #endif
734 #define YY_RULE_SETUP \
735 YY_USER_ACTION
737 /** The main scanner function which does all the work.
738 */
739 YY_DECL
740 {
741 register yy_state_type yy_current_state;
742 register char *yy_cp, *yy_bp;
743 register int yy_act;
744 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
746 #line 37 "libxlu_cfg_l.l"
749 #line 750 "libxlu_cfg_l.c"
751 yylval = yylval_param;
753 yylloc = yylloc_param;
755 if ( !yyg->yy_init )
756 {
757 yyg->yy_init = 1;
759 #ifdef YY_USER_INIT
760 YY_USER_INIT;
761 #endif
763 if ( ! yyg->yy_start )
764 yyg->yy_start = 1; /* first start state */
766 if ( ! yyin )
767 yyin = stdin;
769 if ( ! yyout )
770 yyout = stdout;
772 if ( ! YY_CURRENT_BUFFER ) {
773 xlu__cfg_yyensure_buffer_stack (yyscanner);
774 YY_CURRENT_BUFFER_LVALUE =
775 xlu__cfg_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
776 }
778 xlu__cfg_yy_load_buffer_state(yyscanner );
779 }
781 while ( 1 ) /* loops until end-of-file is reached */
782 {
783 yyg->yy_more_len = 0;
784 if ( yyg->yy_more_flag )
785 {
786 yyg->yy_more_len = yyg->yy_c_buf_p - yyg->yytext_ptr;
787 yyg->yy_more_flag = 0;
788 }
789 yy_cp = yyg->yy_c_buf_p;
791 /* Support of yytext. */
792 *yy_cp = yyg->yy_hold_char;
794 /* yy_bp points to the position in yy_ch_buf of the start of
795 * the current run.
796 */
797 yy_bp = yy_cp;
799 yy_current_state = yyg->yy_start;
800 yy_match:
801 do
802 {
803 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
804 if ( yy_accept[yy_current_state] )
805 {
806 yyg->yy_last_accepting_state = yy_current_state;
807 yyg->yy_last_accepting_cpos = yy_cp;
808 }
809 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
810 {
811 yy_current_state = (int) yy_def[yy_current_state];
812 if ( yy_current_state >= 35 )
813 yy_c = yy_meta[(unsigned int) yy_c];
814 }
815 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
816 ++yy_cp;
817 }
818 while ( yy_current_state != 34 );
819 yy_cp = yyg->yy_last_accepting_cpos;
820 yy_current_state = yyg->yy_last_accepting_state;
822 yy_find_action:
823 yy_act = yy_accept[yy_current_state];
825 YY_DO_BEFORE_ACTION;
827 if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] )
828 {
829 int yyl;
830 for ( yyl = yyg->yy_more_len; yyl < yyleng; ++yyl )
831 if ( yytext[yyl] == '\n' )
833 do{ yylineno++;
834 yycolumn=0;
835 }while(0)
836 ;
837 }
839 do_action: /* This label is used only to access EOF actions. */
841 switch ( yy_act )
842 { /* beginning of action switch */
843 case 0: /* must back up */
844 /* undo the effects of YY_DO_BEFORE_ACTION */
845 *yy_cp = yyg->yy_hold_char;
846 yy_cp = yyg->yy_last_accepting_cpos;
847 yy_current_state = yyg->yy_last_accepting_state;
848 goto yy_find_action;
850 case 1:
851 YY_RULE_SETUP
852 #line 39 "libxlu_cfg_l.l"
853 {
854 yylval->string= xlu__cfgl_strdup(ctx,yytext);
855 GOT(IDENT);
856 }
857 YY_BREAK
858 case 2:
859 YY_RULE_SETUP
860 #line 43 "libxlu_cfg_l.l"
861 {
862 yylval->string= xlu__cfgl_strdup(ctx,yytext);
863 GOT(NUMBER);
864 }
865 YY_BREAK
866 case 3:
867 YY_RULE_SETUP
868 #line 48 "libxlu_cfg_l.l"
870 YY_BREAK
871 case 4:
872 YY_RULE_SETUP
873 #line 50 "libxlu_cfg_l.l"
874 { GOT(','); }
875 YY_BREAK
876 case 5:
877 YY_RULE_SETUP
878 #line 51 "libxlu_cfg_l.l"
879 { GOT('['); }
880 YY_BREAK
881 case 6:
882 YY_RULE_SETUP
883 #line 52 "libxlu_cfg_l.l"
884 { GOT(']'); }
885 YY_BREAK
886 case 7:
887 YY_RULE_SETUP
888 #line 53 "libxlu_cfg_l.l"
889 { GOT('='); }
890 YY_BREAK
891 case 8:
892 YY_RULE_SETUP
893 #line 54 "libxlu_cfg_l.l"
894 { GOT(';'); }
895 YY_BREAK
896 case 9:
897 /* rule 9 can match eol */
898 YY_RULE_SETUP
899 #line 56 "libxlu_cfg_l.l"
900 { yylloc->first_line= yylineno-1; return NEWLINE; }
901 YY_BREAK
902 case 10:
903 YY_RULE_SETUP
904 #line 58 "libxlu_cfg_l.l"
905 {
906 yylval->string= xlu__cfgl_dequote(ctx,yytext);
907 GOT(STRING);
908 }
909 YY_BREAK
910 case 11:
911 YY_RULE_SETUP
912 #line 62 "libxlu_cfg_l.l"
913 {
914 yylval->string= xlu__cfgl_dequote(ctx,yytext);
915 GOT(STRING);
916 }
917 YY_BREAK
918 case 12:
919 YY_RULE_SETUP
920 #line 67 "libxlu_cfg_l.l"
921 {
922 ctx->likely_python= 1;
923 BEGIN(lexerr);
924 yymore();
925 }
926 YY_BREAK
927 case 13:
928 YY_RULE_SETUP
929 #line 73 "libxlu_cfg_l.l"
930 {
931 BEGIN(lexerr);
932 yymore();
933 }
934 YY_BREAK
935 case 14:
936 YY_RULE_SETUP
937 #line 78 "libxlu_cfg_l.l"
938 {
939 xlu__cfgl_lexicalerror(ctx,"lexical error");
940 BEGIN(0);
941 }
942 YY_BREAK
943 case 15:
944 /* rule 15 can match eol */
945 YY_RULE_SETUP
946 #line 83 "libxlu_cfg_l.l"
947 {
948 xlu__cfgl_lexicalerror(ctx,"lexical error");
949 BEGIN(0);
950 GOT(NEWLINE);
951 }
952 YY_BREAK
953 case 16:
954 YY_RULE_SETUP
955 #line 88 "libxlu_cfg_l.l"
956 YY_FATAL_ERROR( "flex scanner jammed" );
957 YY_BREAK
958 #line 959 "libxlu_cfg_l.c"
959 case YY_STATE_EOF(INITIAL):
960 case YY_STATE_EOF(lexerr):
961 yyterminate();
963 case YY_END_OF_BUFFER:
964 {
965 /* Amount of text matched not including the EOB char. */
966 int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1;
968 /* Undo the effects of YY_DO_BEFORE_ACTION. */
969 *yy_cp = yyg->yy_hold_char;
970 YY_RESTORE_YY_MORE_OFFSET
972 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
973 {
974 /* We're scanning a new file or input source. It's
975 * possible that this happened because the user
976 * just pointed yyin at a new source and called
977 * xlu__cfg_yylex(). If so, then we have to assure
978 * consistency between YY_CURRENT_BUFFER and our
979 * globals. Here is the right place to do so, because
980 * this is the first action (other than possibly a
981 * back-up) that will match for the new input source.
982 */
983 yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
984 YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
985 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
986 }
988 /* Note that here we test for yy_c_buf_p "<=" to the position
989 * of the first EOB in the buffer, since yy_c_buf_p will
990 * already have been incremented past the NUL character
991 * (since all states make transitions on EOB to the
992 * end-of-buffer state). Contrast this with the test
993 * in input().
994 */
995 if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
996 { /* This was really a NUL. */
997 yy_state_type yy_next_state;
999 yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text;
1001 yy_current_state = yy_get_previous_state( yyscanner );
1003 /* Okay, we're now positioned to make the NUL
1004 * transition. We couldn't have
1005 * yy_get_previous_state() go ahead and do it
1006 * for us because it doesn't know how to deal
1007 * with the possibility of jamming (and we don't
1008 * want to build jamming into it because then it
1009 * will run more slowly).
1010 */
1012 yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner);
1014 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1016 if ( yy_next_state )
1018 /* Consume the NUL. */
1019 yy_cp = ++yyg->yy_c_buf_p;
1020 yy_current_state = yy_next_state;
1021 goto yy_match;
1024 else
1026 yy_cp = yyg->yy_last_accepting_cpos;
1027 yy_current_state = yyg->yy_last_accepting_state;
1028 goto yy_find_action;
1032 else switch ( yy_get_next_buffer( yyscanner ) )
1034 case EOB_ACT_END_OF_FILE:
1036 yyg->yy_did_buffer_switch_on_eof = 0;
1038 if ( xlu__cfg_yywrap(yyscanner ) )
1040 /* Note: because we've taken care in
1041 * yy_get_next_buffer() to have set up
1042 * yytext, we can now set up
1043 * yy_c_buf_p so that if some total
1044 * hoser (like flex itself) wants to
1045 * call the scanner after we return the
1046 * YY_NULL, it'll still work - another
1047 * YY_NULL will get returned.
1048 */
1049 yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ;
1051 yy_act = YY_STATE_EOF(YY_START);
1052 goto do_action;
1055 else
1057 if ( ! yyg->yy_did_buffer_switch_on_eof )
1058 YY_NEW_FILE;
1060 break;
1063 case EOB_ACT_CONTINUE_SCAN:
1064 yyg->yy_c_buf_p =
1065 yyg->yytext_ptr + yy_amount_of_matched_text;
1067 yy_current_state = yy_get_previous_state( yyscanner );
1069 yy_cp = yyg->yy_c_buf_p;
1070 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1071 goto yy_match;
1073 case EOB_ACT_LAST_MATCH:
1074 yyg->yy_c_buf_p =
1075 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars];
1077 yy_current_state = yy_get_previous_state( yyscanner );
1079 yy_cp = yyg->yy_c_buf_p;
1080 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1081 goto yy_find_action;
1083 break;
1086 default:
1087 YY_FATAL_ERROR(
1088 "fatal flex scanner internal error--no action found" );
1089 } /* end of action switch */
1090 } /* end of scanning one token */
1091 } /* end of xlu__cfg_yylex */
1093 /* yy_get_next_buffer - try to read in a new buffer
1095 * Returns a code representing an action:
1096 * EOB_ACT_LAST_MATCH -
1097 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1098 * EOB_ACT_END_OF_FILE - end of file
1099 */
1100 static int yy_get_next_buffer (yyscan_t yyscanner)
1102 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1103 register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1104 register char *source = yyg->yytext_ptr;
1105 register int number_to_move, i;
1106 int ret_val;
1108 if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] )
1109 YY_FATAL_ERROR(
1110 "fatal flex scanner internal error--end of buffer missed" );
1112 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1113 { /* Don't try to fill the buffer, so this is an EOF. */
1114 if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 )
1116 /* We matched a single character, the EOB, so
1117 * treat this as a final EOF.
1118 */
1119 return EOB_ACT_END_OF_FILE;
1122 else
1124 /* We matched some text prior to the EOB, first
1125 * process it.
1126 */
1127 return EOB_ACT_LAST_MATCH;
1131 /* Try to read more data. */
1133 /* First move last chars to start of buffer. */
1134 number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr) - 1;
1136 for ( i = 0; i < number_to_move; ++i )
1137 *(dest++) = *(source++);
1139 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1140 /* don't do the read, it's not guaranteed to return an EOF,
1141 * just force an EOF
1142 */
1143 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0;
1145 else
1147 int num_to_read =
1148 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1150 while ( num_to_read <= 0 )
1151 { /* Not enough room in the buffer - grow it. */
1153 /* just a shorter name for the current buffer */
1154 YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
1156 int yy_c_buf_p_offset =
1157 (int) (yyg->yy_c_buf_p - b->yy_ch_buf);
1159 if ( b->yy_is_our_buffer )
1161 int new_size = b->yy_buf_size * 2;
1163 if ( new_size <= 0 )
1164 b->yy_buf_size += b->yy_buf_size / 8;
1165 else
1166 b->yy_buf_size *= 2;
1168 b->yy_ch_buf = (char *)
1169 /* Include room in for 2 EOB chars. */
1170 xlu__cfg_yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ,yyscanner );
1172 else
1173 /* Can't grow it, we don't own it. */
1174 b->yy_ch_buf = 0;
1176 if ( ! b->yy_ch_buf )
1177 YY_FATAL_ERROR(
1178 "fatal error - scanner input buffer overflow" );
1180 yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
1182 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1183 number_to_move - 1;
1187 if ( num_to_read > YY_READ_BUF_SIZE )
1188 num_to_read = YY_READ_BUF_SIZE;
1190 /* Read in more data. */
1191 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1192 yyg->yy_n_chars, (size_t) num_to_read );
1194 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
1197 if ( yyg->yy_n_chars == 0 )
1199 if ( number_to_move == YY_MORE_ADJ )
1201 ret_val = EOB_ACT_END_OF_FILE;
1202 xlu__cfg_yyrestart(yyin ,yyscanner);
1205 else
1207 ret_val = EOB_ACT_LAST_MATCH;
1208 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1209 YY_BUFFER_EOF_PENDING;
1213 else
1214 ret_val = EOB_ACT_CONTINUE_SCAN;
1216 if ((yy_size_t) (yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1217 /* Extend the array by 50%, plus the number we really need. */
1218 yy_size_t new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1);
1219 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) xlu__cfg_yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ,yyscanner );
1220 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1221 YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1224 yyg->yy_n_chars += number_to_move;
1225 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR;
1226 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
1228 yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1230 return ret_val;
1233 /* yy_get_previous_state - get the state just before the EOB char was reached */
1235 static yy_state_type yy_get_previous_state (yyscan_t yyscanner)
1237 register yy_state_type yy_current_state;
1238 register char *yy_cp;
1239 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1241 yy_current_state = yyg->yy_start;
1243 for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp )
1245 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1246 if ( yy_accept[yy_current_state] )
1248 yyg->yy_last_accepting_state = yy_current_state;
1249 yyg->yy_last_accepting_cpos = yy_cp;
1251 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1253 yy_current_state = (int) yy_def[yy_current_state];
1254 if ( yy_current_state >= 35 )
1255 yy_c = yy_meta[(unsigned int) yy_c];
1257 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1260 return yy_current_state;
1263 /* yy_try_NUL_trans - try to make a transition on the NUL character
1265 * synopsis
1266 * next_state = yy_try_NUL_trans( current_state );
1267 */
1268 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner)
1270 register int yy_is_jam;
1271 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */
1272 register char *yy_cp = yyg->yy_c_buf_p;
1274 register YY_CHAR yy_c = 1;
1275 if ( yy_accept[yy_current_state] )
1277 yyg->yy_last_accepting_state = yy_current_state;
1278 yyg->yy_last_accepting_cpos = yy_cp;
1280 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
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];
1286 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1287 yy_is_jam = (yy_current_state == 34);
1289 return yy_is_jam ? 0 : yy_current_state;
1292 #ifndef YY_NO_INPUT
1293 #ifdef __cplusplus
1294 static int yyinput (yyscan_t yyscanner)
1295 #else
1296 static int input (yyscan_t yyscanner)
1297 #endif
1300 int c;
1301 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1303 *yyg->yy_c_buf_p = yyg->yy_hold_char;
1305 if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
1307 /* yy_c_buf_p now points to the character we want to return.
1308 * If this occurs *before* the EOB characters, then it's a
1309 * valid NUL; if not, then we've hit the end of the buffer.
1310 */
1311 if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
1312 /* This was really a NUL. */
1313 *yyg->yy_c_buf_p = '\0';
1315 else
1316 { /* need more input */
1317 int offset = yyg->yy_c_buf_p - yyg->yytext_ptr;
1318 ++yyg->yy_c_buf_p;
1320 switch ( yy_get_next_buffer( yyscanner ) )
1322 case EOB_ACT_LAST_MATCH:
1323 /* This happens because yy_g_n_b()
1324 * sees that we've accumulated a
1325 * token and flags that we need to
1326 * try matching the token before
1327 * proceeding. But for input(),
1328 * there's no matching to consider.
1329 * So convert the EOB_ACT_LAST_MATCH
1330 * to EOB_ACT_END_OF_FILE.
1331 */
1333 /* Reset buffer status. */
1334 xlu__cfg_yyrestart(yyin ,yyscanner);
1336 /*FALLTHROUGH*/
1338 case EOB_ACT_END_OF_FILE:
1340 if ( xlu__cfg_yywrap(yyscanner ) )
1341 return EOF;
1343 if ( ! yyg->yy_did_buffer_switch_on_eof )
1344 YY_NEW_FILE;
1345 #ifdef __cplusplus
1346 return yyinput(yyscanner);
1347 #else
1348 return input(yyscanner);
1349 #endif
1352 case EOB_ACT_CONTINUE_SCAN:
1353 yyg->yy_c_buf_p = yyg->yytext_ptr + offset;
1354 break;
1359 c = *(unsigned char *) yyg->yy_c_buf_p; /* cast for 8-bit char's */
1360 *yyg->yy_c_buf_p = '\0'; /* preserve yytext */
1361 yyg->yy_hold_char = *++yyg->yy_c_buf_p;
1363 if ( c == '\n' )
1365 do{ yylineno++;
1366 yycolumn=0;
1367 }while(0)
1370 return c;
1372 #endif /* ifndef YY_NO_INPUT */
1374 /** Immediately switch to a different input stream.
1375 * @param input_file A readable stream.
1376 * @param yyscanner The scanner object.
1377 * @note This function does not reset the start condition to @c INITIAL .
1378 */
1379 void xlu__cfg_yyrestart (FILE * input_file , yyscan_t yyscanner)
1381 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1383 if ( ! YY_CURRENT_BUFFER ){
1384 xlu__cfg_yyensure_buffer_stack (yyscanner);
1385 YY_CURRENT_BUFFER_LVALUE =
1386 xlu__cfg_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
1389 xlu__cfg_yy_init_buffer(YY_CURRENT_BUFFER,input_file ,yyscanner);
1390 xlu__cfg_yy_load_buffer_state(yyscanner );
1393 /** Switch to a different input buffer.
1394 * @param new_buffer The new input buffer.
1395 * @param yyscanner The scanner object.
1396 */
1397 void xlu__cfg_yy_switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
1399 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1401 /* TODO. We should be able to replace this entire function body
1402 * with
1403 * xlu__cfg_yypop_buffer_state();
1404 * xlu__cfg_yypush_buffer_state(new_buffer);
1405 */
1406 xlu__cfg_yyensure_buffer_stack (yyscanner);
1407 if ( YY_CURRENT_BUFFER == new_buffer )
1408 return;
1410 if ( YY_CURRENT_BUFFER )
1412 /* Flush out information for old buffer. */
1413 *yyg->yy_c_buf_p = yyg->yy_hold_char;
1414 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
1415 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
1418 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1419 xlu__cfg_yy_load_buffer_state(yyscanner );
1421 /* We don't actually know whether we did this switch during
1422 * EOF (xlu__cfg_yywrap()) processing, but the only time this flag
1423 * is looked at is after xlu__cfg_yywrap() is called, so it's safe
1424 * to go ahead and always set it.
1425 */
1426 yyg->yy_did_buffer_switch_on_eof = 1;
1429 static void xlu__cfg_yy_load_buffer_state (yyscan_t yyscanner)
1431 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1432 yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1433 yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1434 yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1435 yyg->yy_hold_char = *yyg->yy_c_buf_p;
1438 /** Allocate and initialize an input buffer state.
1439 * @param file A readable stream.
1440 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
1441 * @param yyscanner The scanner object.
1442 * @return the allocated buffer state.
1443 */
1444 YY_BUFFER_STATE xlu__cfg_yy_create_buffer (FILE * file, int size , yyscan_t yyscanner)
1446 YY_BUFFER_STATE b;
1448 b = (YY_BUFFER_STATE) xlu__cfg_yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner );
1449 if ( ! b )
1450 YY_FATAL_ERROR( "out of dynamic memory in xlu__cfg_yy_create_buffer()" );
1452 b->yy_buf_size = size;
1454 /* yy_ch_buf has to be 2 characters longer than the size given because
1455 * we need to put in 2 end-of-buffer characters.
1456 */
1457 b->yy_ch_buf = (char *) xlu__cfg_yyalloc(b->yy_buf_size + 2 ,yyscanner );
1458 if ( ! b->yy_ch_buf )
1459 YY_FATAL_ERROR( "out of dynamic memory in xlu__cfg_yy_create_buffer()" );
1461 b->yy_is_our_buffer = 1;
1463 xlu__cfg_yy_init_buffer(b,file ,yyscanner);
1465 return b;
1468 /** Destroy the buffer.
1469 * @param b a buffer created with xlu__cfg_yy_create_buffer()
1470 * @param yyscanner The scanner object.
1471 */
1472 void xlu__cfg_yy_delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
1474 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1476 if ( ! b )
1477 return;
1479 if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
1480 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
1482 if ( b->yy_is_our_buffer )
1483 xlu__cfg_yyfree((void *) b->yy_ch_buf ,yyscanner );
1485 xlu__cfg_yyfree((void *) b ,yyscanner );
1488 #ifndef __cplusplus
1489 extern int isatty (int );
1490 #endif /* __cplusplus */
1492 /* Initializes or reinitializes a buffer.
1493 * This function is sometimes called more than once on the same buffer,
1494 * such as during a xlu__cfg_yyrestart() or at EOF.
1495 */
1496 static void xlu__cfg_yy_init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner)
1499 int oerrno = errno;
1500 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1502 xlu__cfg_yy_flush_buffer(b ,yyscanner);
1504 b->yy_input_file = file;
1505 b->yy_fill_buffer = 1;
1507 /* If b is the current buffer, then xlu__cfg_yy_init_buffer was _probably_
1508 * called from xlu__cfg_yyrestart() or through yy_get_next_buffer.
1509 * In that case, we don't want to reset the lineno or column.
1510 */
1511 if (b != YY_CURRENT_BUFFER){
1512 b->yy_bs_lineno = 1;
1513 b->yy_bs_column = 0;
1516 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1518 errno = oerrno;
1521 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
1522 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
1523 * @param yyscanner The scanner object.
1524 */
1525 void xlu__cfg_yy_flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
1527 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1528 if ( ! b )
1529 return;
1531 b->yy_n_chars = 0;
1533 /* We always need two end-of-buffer characters. The first causes
1534 * a transition to the end-of-buffer state. The second causes
1535 * a jam in that state.
1536 */
1537 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1538 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1540 b->yy_buf_pos = &b->yy_ch_buf[0];
1542 b->yy_at_bol = 1;
1543 b->yy_buffer_status = YY_BUFFER_NEW;
1545 if ( b == YY_CURRENT_BUFFER )
1546 xlu__cfg_yy_load_buffer_state(yyscanner );
1549 /** Pushes the new state onto the stack. The new state becomes
1550 * the current state. This function will allocate the stack
1551 * if necessary.
1552 * @param new_buffer The new state.
1553 * @param yyscanner The scanner object.
1554 */
1555 void xlu__cfg_yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
1557 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1558 if (new_buffer == NULL)
1559 return;
1561 xlu__cfg_yyensure_buffer_stack(yyscanner);
1563 /* This block is copied from xlu__cfg_yy_switch_to_buffer. */
1564 if ( YY_CURRENT_BUFFER )
1566 /* Flush out information for old buffer. */
1567 *yyg->yy_c_buf_p = yyg->yy_hold_char;
1568 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
1569 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
1572 /* Only push if top exists. Otherwise, replace top. */
1573 if (YY_CURRENT_BUFFER)
1574 yyg->yy_buffer_stack_top++;
1575 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1577 /* copied from xlu__cfg_yy_switch_to_buffer. */
1578 xlu__cfg_yy_load_buffer_state(yyscanner );
1579 yyg->yy_did_buffer_switch_on_eof = 1;
1582 /** Removes and deletes the top of the stack, if present.
1583 * The next element becomes the new top.
1584 * @param yyscanner The scanner object.
1585 */
1586 void xlu__cfg_yypop_buffer_state (yyscan_t yyscanner)
1588 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1589 if (!YY_CURRENT_BUFFER)
1590 return;
1592 xlu__cfg_yy_delete_buffer(YY_CURRENT_BUFFER ,yyscanner);
1593 YY_CURRENT_BUFFER_LVALUE = NULL;
1594 if (yyg->yy_buffer_stack_top > 0)
1595 --yyg->yy_buffer_stack_top;
1597 if (YY_CURRENT_BUFFER) {
1598 xlu__cfg_yy_load_buffer_state(yyscanner );
1599 yyg->yy_did_buffer_switch_on_eof = 1;
1603 /* Allocates the stack if it does not exist.
1604 * Guarantees space for at least one push.
1605 */
1606 static void xlu__cfg_yyensure_buffer_stack (yyscan_t yyscanner)
1608 int num_to_alloc;
1609 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1611 if (!yyg->yy_buffer_stack) {
1613 /* First allocation is just for 2 elements, since we don't know if this
1614 * scanner will even need a stack. We use 2 instead of 1 to avoid an
1615 * immediate realloc on the next call.
1616 */
1617 num_to_alloc = 1;
1618 yyg->yy_buffer_stack = (struct yy_buffer_state**)xlu__cfg_yyalloc
1619 (num_to_alloc * sizeof(struct yy_buffer_state*)
1620 , yyscanner);
1621 if ( ! yyg->yy_buffer_stack )
1622 YY_FATAL_ERROR( "out of dynamic memory in xlu__cfg_yyensure_buffer_stack()" );
1624 memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*));
1626 yyg->yy_buffer_stack_max = num_to_alloc;
1627 yyg->yy_buffer_stack_top = 0;
1628 return;
1631 if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){
1633 /* Increase the buffer to prepare for a possible push. */
1634 int grow_size = 8 /* arbitrary grow size */;
1636 num_to_alloc = yyg->yy_buffer_stack_max + grow_size;
1637 yyg->yy_buffer_stack = (struct yy_buffer_state**)xlu__cfg_yyrealloc
1638 (yyg->yy_buffer_stack,
1639 num_to_alloc * sizeof(struct yy_buffer_state*)
1640 , yyscanner);
1641 if ( ! yyg->yy_buffer_stack )
1642 YY_FATAL_ERROR( "out of dynamic memory in xlu__cfg_yyensure_buffer_stack()" );
1644 /* zero only the new slots.*/
1645 memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*));
1646 yyg->yy_buffer_stack_max = num_to_alloc;
1650 /** Setup the input buffer state to scan directly from a user-specified character buffer.
1651 * @param base the character buffer
1652 * @param size the size in bytes of the character buffer
1653 * @param yyscanner The scanner object.
1654 * @return the newly allocated buffer state object.
1655 */
1656 YY_BUFFER_STATE xlu__cfg_yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner)
1658 YY_BUFFER_STATE b;
1660 if ( size < 2 ||
1661 base[size-2] != YY_END_OF_BUFFER_CHAR ||
1662 base[size-1] != YY_END_OF_BUFFER_CHAR )
1663 /* They forgot to leave room for the EOB's. */
1664 return 0;
1666 b = (YY_BUFFER_STATE) xlu__cfg_yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner );
1667 if ( ! b )
1668 YY_FATAL_ERROR( "out of dynamic memory in xlu__cfg_yy_scan_buffer()" );
1670 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
1671 b->yy_buf_pos = b->yy_ch_buf = base;
1672 b->yy_is_our_buffer = 0;
1673 b->yy_input_file = 0;
1674 b->yy_n_chars = b->yy_buf_size;
1675 b->yy_is_interactive = 0;
1676 b->yy_at_bol = 1;
1677 b->yy_fill_buffer = 0;
1678 b->yy_buffer_status = YY_BUFFER_NEW;
1680 xlu__cfg_yy_switch_to_buffer(b ,yyscanner );
1682 return b;
1685 /** Setup the input buffer state to scan a string. The next call to xlu__cfg_yylex() will
1686 * scan from a @e copy of @a str.
1687 * @param yystr a NUL-terminated string to scan
1688 * @param yyscanner The scanner object.
1689 * @return the newly allocated buffer state object.
1690 * @note If you want to scan bytes that may contain NUL values, then use
1691 * xlu__cfg_yy_scan_bytes() instead.
1692 */
1693 YY_BUFFER_STATE xlu__cfg_yy_scan_string (yyconst char * yystr , yyscan_t yyscanner)
1696 return xlu__cfg_yy_scan_bytes(yystr,strlen(yystr) ,yyscanner);
1699 /** Setup the input buffer state to scan the given bytes. The next call to xlu__cfg_yylex() will
1700 * scan from a @e copy of @a bytes.
1701 * @param yybytes the byte buffer to scan
1702 * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
1703 * @param yyscanner The scanner object.
1704 * @return the newly allocated buffer state object.
1705 */
1706 YY_BUFFER_STATE xlu__cfg_yy_scan_bytes (yyconst char * yybytes, int _yybytes_len , yyscan_t yyscanner)
1708 YY_BUFFER_STATE b;
1709 char *buf;
1710 yy_size_t n;
1711 int i;
1713 /* Get memory for full buffer, including space for trailing EOB's. */
1714 n = _yybytes_len + 2;
1715 buf = (char *) xlu__cfg_yyalloc(n ,yyscanner );
1716 if ( ! buf )
1717 YY_FATAL_ERROR( "out of dynamic memory in xlu__cfg_yy_scan_bytes()" );
1719 for ( i = 0; i < _yybytes_len; ++i )
1720 buf[i] = yybytes[i];
1722 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
1724 b = xlu__cfg_yy_scan_buffer(buf,n ,yyscanner);
1725 if ( ! b )
1726 YY_FATAL_ERROR( "bad buffer in xlu__cfg_yy_scan_bytes()" );
1728 /* It's okay to grow etc. this buffer, and we should throw it
1729 * away when we're done.
1730 */
1731 b->yy_is_our_buffer = 1;
1733 return b;
1736 #ifndef YY_EXIT_FAILURE
1737 #define YY_EXIT_FAILURE 2
1738 #endif
1740 static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner)
1742 (void) fprintf( stderr, "%s\n", msg );
1743 exit( YY_EXIT_FAILURE );
1746 /* Redefine yyless() so it works in section 3 code. */
1748 #undef yyless
1749 #define yyless(n) \
1750 do \
1751 { \
1752 /* Undo effects of setting up yytext. */ \
1753 int yyless_macro_arg = (n); \
1754 YY_LESS_LINENO(yyless_macro_arg);\
1755 yytext[yyleng] = yyg->yy_hold_char; \
1756 yyg->yy_c_buf_p = yytext + yyless_macro_arg; \
1757 yyg->yy_hold_char = *yyg->yy_c_buf_p; \
1758 *yyg->yy_c_buf_p = '\0'; \
1759 yyleng = yyless_macro_arg; \
1760 } \
1761 while ( 0 )
1763 /* Accessor methods (get/set functions) to struct members. */
1765 /** Get the user-defined data for this scanner.
1766 * @param yyscanner The scanner object.
1767 */
1768 YY_EXTRA_TYPE xlu__cfg_yyget_extra (yyscan_t yyscanner)
1770 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1771 return yyextra;
1774 /** Get the current line number.
1775 * @param yyscanner The scanner object.
1776 */
1777 int xlu__cfg_yyget_lineno (yyscan_t yyscanner)
1779 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1781 if (! YY_CURRENT_BUFFER)
1782 return 0;
1784 return yylineno;
1787 /** Get the current column number.
1788 * @param yyscanner The scanner object.
1789 */
1790 int xlu__cfg_yyget_column (yyscan_t yyscanner)
1792 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1794 if (! YY_CURRENT_BUFFER)
1795 return 0;
1797 return yycolumn;
1800 /** Get the input stream.
1801 * @param yyscanner The scanner object.
1802 */
1803 FILE *xlu__cfg_yyget_in (yyscan_t yyscanner)
1805 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1806 return yyin;
1809 /** Get the output stream.
1810 * @param yyscanner The scanner object.
1811 */
1812 FILE *xlu__cfg_yyget_out (yyscan_t yyscanner)
1814 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1815 return yyout;
1818 /** Get the length of the current token.
1819 * @param yyscanner The scanner object.
1820 */
1821 int xlu__cfg_yyget_leng (yyscan_t yyscanner)
1823 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1824 return yyleng;
1827 /** Get the current token.
1828 * @param yyscanner The scanner object.
1829 */
1831 char *xlu__cfg_yyget_text (yyscan_t yyscanner)
1833 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1834 return yytext;
1837 /** Set the user-defined data. This data is never touched by the scanner.
1838 * @param user_defined The data to be associated with this scanner.
1839 * @param yyscanner The scanner object.
1840 */
1841 void xlu__cfg_yyset_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner)
1843 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1844 yyextra = user_defined ;
1847 /** Set the current line number.
1848 * @param line_number
1849 * @param yyscanner The scanner object.
1850 */
1851 void xlu__cfg_yyset_lineno (int line_number , yyscan_t yyscanner)
1853 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1855 /* lineno is only valid if an input buffer exists. */
1856 if (! YY_CURRENT_BUFFER )
1857 yy_fatal_error( "xlu__cfg_yyset_lineno called with no buffer" , yyscanner);
1859 yylineno = line_number;
1862 /** Set the current column.
1863 * @param line_number
1864 * @param yyscanner The scanner object.
1865 */
1866 void xlu__cfg_yyset_column (int column_no , yyscan_t yyscanner)
1868 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1870 /* column is only valid if an input buffer exists. */
1871 if (! YY_CURRENT_BUFFER )
1872 yy_fatal_error( "xlu__cfg_yyset_column called with no buffer" , yyscanner);
1874 yycolumn = column_no;
1877 /** Set the input stream. This does not discard the current
1878 * input buffer.
1879 * @param in_str A readable stream.
1880 * @param yyscanner The scanner object.
1881 * @see xlu__cfg_yy_switch_to_buffer
1882 */
1883 void xlu__cfg_yyset_in (FILE * in_str , yyscan_t yyscanner)
1885 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1886 yyin = in_str ;
1889 void xlu__cfg_yyset_out (FILE * out_str , yyscan_t yyscanner)
1891 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1892 yyout = out_str ;
1895 int xlu__cfg_yyget_debug (yyscan_t yyscanner)
1897 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1898 return yy_flex_debug;
1901 void xlu__cfg_yyset_debug (int bdebug , yyscan_t yyscanner)
1903 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1904 yy_flex_debug = bdebug ;
1907 /* Accessor methods for yylval and yylloc */
1909 YYSTYPE * xlu__cfg_yyget_lval (yyscan_t yyscanner)
1911 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1912 return yylval;
1915 void xlu__cfg_yyset_lval (YYSTYPE * yylval_param , yyscan_t yyscanner)
1917 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1918 yylval = yylval_param;
1921 YYLTYPE *xlu__cfg_yyget_lloc (yyscan_t yyscanner)
1923 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1924 return yylloc;
1927 void xlu__cfg_yyset_lloc (YYLTYPE * yylloc_param , yyscan_t yyscanner)
1929 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1930 yylloc = yylloc_param;
1933 /* User-visible API */
1935 /* xlu__cfg_yylex_init is special because it creates the scanner itself, so it is
1936 * the ONLY reentrant function that doesn't take the scanner as the last argument.
1937 * That's why we explicitly handle the declaration, instead of using our macros.
1938 */
1940 int xlu__cfg_yylex_init(yyscan_t* ptr_yy_globals)
1943 if (ptr_yy_globals == NULL){
1944 errno = EINVAL;
1945 return 1;
1948 *ptr_yy_globals = (yyscan_t) xlu__cfg_yyalloc ( sizeof( struct yyguts_t ), NULL );
1950 if (*ptr_yy_globals == NULL){
1951 errno = ENOMEM;
1952 return 1;
1955 /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */
1956 memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
1958 return yy_init_globals ( *ptr_yy_globals );
1961 /* xlu__cfg_yylex_init_extra has the same functionality as xlu__cfg_yylex_init, but follows the
1962 * convention of taking the scanner as the last argument. Note however, that
1963 * this is a *pointer* to a scanner, as it will be allocated by this call (and
1964 * is the reason, too, why this function also must handle its own declaration).
1965 * The user defined value in the first argument will be available to xlu__cfg_yyalloc in
1966 * the yyextra field.
1967 */
1969 int xlu__cfg_yylex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* ptr_yy_globals )
1972 struct yyguts_t dummy_yyguts;
1974 xlu__cfg_yyset_extra (yy_user_defined, &dummy_yyguts);
1976 if (ptr_yy_globals == NULL){
1977 errno = EINVAL;
1978 return 1;
1981 *ptr_yy_globals = (yyscan_t) xlu__cfg_yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts );
1983 if (*ptr_yy_globals == NULL){
1984 errno = ENOMEM;
1985 return 1;
1988 /* By setting to 0xAA, we expose bugs in
1989 yy_init_globals. Leave at 0x00 for releases. */
1990 memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
1992 xlu__cfg_yyset_extra (yy_user_defined, *ptr_yy_globals);
1994 return yy_init_globals ( *ptr_yy_globals );
1997 static int yy_init_globals (yyscan_t yyscanner)
1999 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2000 /* Initialization is the same as for the non-reentrant scanner.
2001 * This function is called from xlu__cfg_yylex_destroy(), so don't allocate here.
2002 */
2004 yyg->yy_buffer_stack = 0;
2005 yyg->yy_buffer_stack_top = 0;
2006 yyg->yy_buffer_stack_max = 0;
2007 yyg->yy_c_buf_p = (char *) 0;
2008 yyg->yy_init = 0;
2009 yyg->yy_start = 0;
2011 yyg->yy_start_stack_ptr = 0;
2012 yyg->yy_start_stack_depth = 0;
2013 yyg->yy_start_stack = NULL;
2015 /* Defined in main.c */
2016 #ifdef YY_STDINIT
2017 yyin = stdin;
2018 yyout = stdout;
2019 #else
2020 yyin = (FILE *) 0;
2021 yyout = (FILE *) 0;
2022 #endif
2024 /* For future reference: Set errno on error, since we are called by
2025 * xlu__cfg_yylex_init()
2026 */
2027 return 0;
2030 /* xlu__cfg_yylex_destroy is for both reentrant and non-reentrant scanners. */
2031 int xlu__cfg_yylex_destroy (yyscan_t yyscanner)
2033 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2035 /* Pop the buffer stack, destroying each element. */
2036 while(YY_CURRENT_BUFFER){
2037 xlu__cfg_yy_delete_buffer(YY_CURRENT_BUFFER ,yyscanner );
2038 YY_CURRENT_BUFFER_LVALUE = NULL;
2039 xlu__cfg_yypop_buffer_state(yyscanner);
2042 /* Destroy the stack itself. */
2043 xlu__cfg_yyfree(yyg->yy_buffer_stack ,yyscanner);
2044 yyg->yy_buffer_stack = NULL;
2046 /* Destroy the start condition stack. */
2047 xlu__cfg_yyfree(yyg->yy_start_stack ,yyscanner );
2048 yyg->yy_start_stack = NULL;
2050 /* Reset the globals. This is important in a non-reentrant scanner so the next time
2051 * xlu__cfg_yylex() is called, initialization will occur. */
2052 yy_init_globals( yyscanner);
2054 /* Destroy the main struct (reentrant only). */
2055 xlu__cfg_yyfree ( yyscanner , yyscanner );
2056 yyscanner = NULL;
2057 return 0;
2060 /*
2061 * Internal utility routines.
2062 */
2064 #ifndef yytext_ptr
2065 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner)
2067 register int i;
2068 for ( i = 0; i < n; ++i )
2069 s1[i] = s2[i];
2071 #endif
2073 #ifdef YY_NEED_STRLEN
2074 static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner)
2076 register int n;
2077 for ( n = 0; s[n]; ++n )
2080 return n;
2082 #endif
2084 void *xlu__cfg_yyalloc (yy_size_t size , yyscan_t yyscanner)
2086 return (void *) malloc( size );
2089 void *xlu__cfg_yyrealloc (void * ptr, yy_size_t size , yyscan_t yyscanner)
2091 /* The cast to (char *) in the following accommodates both
2092 * implementations that use char* generic pointers, and those
2093 * that use void* generic pointers. It works with the latter
2094 * because both ANSI C and C++ allow castless assignment from
2095 * any pointer type to void*, and deal with argument conversions
2096 * as though doing an assignment.
2097 */
2098 return (void *) realloc( (char *) ptr, size );
2101 void xlu__cfg_yyfree (void * ptr , yyscan_t yyscanner)
2103 free( (char *) ptr ); /* see xlu__cfg_yyrealloc() for (char *) cast */
2106 #define YYTABLES_NAME "yytables"
2108 #line 88 "libxlu_cfg_l.l"