Debian Codegraph @

src/tools/dlgedit/lex.loadcfg.cc

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