ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/hopm/trunk/src/config-lexer.c
Revision: 7714
Committed: Mon Sep 26 11:54:52 2016 UTC (7 years, 6 months ago) by michael
Content type: text/x-csrc
File size: 79228 byte(s)
Log Message:
- Rebuilt src/config-lexer.c

File Contents

# Content
1
2 #line 3 "config-lexer.c"
3
4 #define YY_INT_ALIGNED short int
5
6 /* A lexical scanner generated by flex */
7
8 #define FLEX_SCANNER
9 #define YY_FLEX_MAJOR_VERSION 2
10 #define YY_FLEX_MINOR_VERSION 6
11 #define YY_FLEX_SUBMINOR_VERSION 1
12 #if YY_FLEX_SUBMINOR_VERSION > 0
13 #define FLEX_BETA
14 #endif
15
16 /* First, we deal with platform-specific or compiler-specific issues. */
17
18 /* begin standard C headers. */
19 #include <stdio.h>
20 #include <string.h>
21 #include <errno.h>
22 #include <stdlib.h>
23
24 /* end standard C headers. */
25
26 /* flex integer type definitions */
27
28 #ifndef FLEXINT_H
29 #define FLEXINT_H
30
31 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
32
33 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
34
35 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
36 * if you want the limit (max/min) macros for int types.
37 */
38 #ifndef __STDC_LIMIT_MACROS
39 #define __STDC_LIMIT_MACROS 1
40 #endif
41
42 #include <inttypes.h>
43 typedef int8_t flex_int8_t;
44 typedef uint8_t flex_uint8_t;
45 typedef int16_t flex_int16_t;
46 typedef uint16_t flex_uint16_t;
47 typedef int32_t flex_int32_t;
48 typedef uint32_t flex_uint32_t;
49 #else
50 typedef signed char flex_int8_t;
51 typedef short int flex_int16_t;
52 typedef int flex_int32_t;
53 typedef unsigned char flex_uint8_t;
54 typedef unsigned short int flex_uint16_t;
55 typedef unsigned int flex_uint32_t;
56
57 /* Limits of integral types. */
58 #ifndef INT8_MIN
59 #define INT8_MIN (-128)
60 #endif
61 #ifndef INT16_MIN
62 #define INT16_MIN (-32767-1)
63 #endif
64 #ifndef INT32_MIN
65 #define INT32_MIN (-2147483647-1)
66 #endif
67 #ifndef INT8_MAX
68 #define INT8_MAX (127)
69 #endif
70 #ifndef INT16_MAX
71 #define INT16_MAX (32767)
72 #endif
73 #ifndef INT32_MAX
74 #define INT32_MAX (2147483647)
75 #endif
76 #ifndef UINT8_MAX
77 #define UINT8_MAX (255U)
78 #endif
79 #ifndef UINT16_MAX
80 #define UINT16_MAX (65535U)
81 #endif
82 #ifndef UINT32_MAX
83 #define UINT32_MAX (4294967295U)
84 #endif
85
86 #endif /* ! C99 */
87
88 #endif /* ! FLEXINT_H */
89
90 /* TODO: this is always defined, so inline it */
91 #define yyconst const
92
93 #if defined(__GNUC__) && __GNUC__ >= 3
94 #define yynoreturn __attribute__((__noreturn__))
95 #else
96 #define yynoreturn
97 #endif
98
99 /* Returned upon end-of-file. */
100 #define YY_NULL 0
101
102 /* Promotes a possibly negative, possibly signed char to an unsigned
103 * integer for use as an array index. If the signed char is negative,
104 * we want to instead treat it as an 8-bit unsigned char, hence the
105 * double cast.
106 */
107 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
108
109 /* Enter a start condition. This macro really ought to take a parameter,
110 * but we do it the disgusting crufty way forced on us by the ()-less
111 * definition of BEGIN.
112 */
113 #define BEGIN (yy_start) = 1 + 2 *
114
115 /* Translate the current start state into a value that can be later handed
116 * to BEGIN to return to the state. The YYSTATE alias is for lex
117 * compatibility.
118 */
119 #define YY_START (((yy_start) - 1) / 2)
120 #define YYSTATE YY_START
121
122 /* Action number for EOF rule of a given start state. */
123 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
124
125 /* Special action meaning "start processing a new file". */
126 #define YY_NEW_FILE yyrestart(yyin )
127
128 #define YY_END_OF_BUFFER_CHAR 0
129
130 /* Size of default input buffer. */
131 #ifndef YY_BUF_SIZE
132 #ifdef __ia64__
133 /* On IA-64, the buffer size is 16k, not 8k.
134 * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
135 * Ditto for the __ia64__ case accordingly.
136 */
137 #define YY_BUF_SIZE 32768
138 #else
139 #define YY_BUF_SIZE 16384
140 #endif /* __ia64__ */
141 #endif
142
143 /* The state buf must be large enough to hold one state per character in the main buffer.
144 */
145 #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
146
147 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
148 #define YY_TYPEDEF_YY_BUFFER_STATE
149 typedef struct yy_buffer_state *YY_BUFFER_STATE;
150 #endif
151
152 #ifndef YY_TYPEDEF_YY_SIZE_T
153 #define YY_TYPEDEF_YY_SIZE_T
154 typedef size_t yy_size_t;
155 #endif
156
157 extern int yyleng;
158
159 extern FILE *yyin, *yyout;
160
161 #define EOB_ACT_CONTINUE_SCAN 0
162 #define EOB_ACT_END_OF_FILE 1
163 #define EOB_ACT_LAST_MATCH 2
164
165 #define YY_LESS_LINENO(n)
166 #define YY_LINENO_REWIND_TO(ptr)
167
168 /* Return all but the first "n" matched characters back to the input stream. */
169 #define yyless(n) \
170 do \
171 { \
172 /* Undo effects of setting up yytext. */ \
173 int yyless_macro_arg = (n); \
174 YY_LESS_LINENO(yyless_macro_arg);\
175 *yy_cp = (yy_hold_char); \
176 YY_RESTORE_YY_MORE_OFFSET \
177 (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
178 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
179 } \
180 while ( 0 )
181
182 #define unput(c) yyunput( c, (yytext_ptr) )
183
184 #ifndef YY_STRUCT_YY_BUFFER_STATE
185 #define YY_STRUCT_YY_BUFFER_STATE
186 struct yy_buffer_state
187 {
188 FILE *yy_input_file;
189
190 char *yy_ch_buf; /* input buffer */
191 char *yy_buf_pos; /* current position in input buffer */
192
193 /* Size of input buffer in bytes, not including room for EOB
194 * characters.
195 */
196 int yy_buf_size;
197
198 /* Number of characters read into yy_ch_buf, not including EOB
199 * characters.
200 */
201 int yy_n_chars;
202
203 /* Whether we "own" the buffer - i.e., we know we created it,
204 * and can realloc() it to grow it, and should free() it to
205 * delete it.
206 */
207 int yy_is_our_buffer;
208
209 /* Whether this is an "interactive" input source; if so, and
210 * if we're using stdio for input, then we want to use getc()
211 * instead of fread(), to make sure we stop fetching input after
212 * each newline.
213 */
214 int yy_is_interactive;
215
216 /* Whether we're considered to be at the beginning of a line.
217 * If so, '^' rules will be active on the next match, otherwise
218 * not.
219 */
220 int yy_at_bol;
221
222 int yy_bs_lineno; /**< The line count. */
223 int yy_bs_column; /**< The column count. */
224
225 /* Whether to try to fill the input buffer when we reach the
226 * end of it.
227 */
228 int yy_fill_buffer;
229
230 int yy_buffer_status;
231
232 #define YY_BUFFER_NEW 0
233 #define YY_BUFFER_NORMAL 1
234 /* When an EOF's been seen but there's still some text to process
235 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
236 * shouldn't try reading from the input source any more. We might
237 * still have a bunch of tokens to match, though, because of
238 * possible backing-up.
239 *
240 * When we actually see the EOF, we change the status to "new"
241 * (via yyrestart()), so that the user can continue scanning by
242 * just pointing yyin at a new input file.
243 */
244 #define YY_BUFFER_EOF_PENDING 2
245
246 };
247 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
248
249 /* Stack of input buffers. */
250 static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
251 static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
252 static YY_BUFFER_STATE * yy_buffer_stack = NULL; /**< Stack as an array. */
253
254 /* We provide macros for accessing buffer states in case in the
255 * future we want to put the buffer states in a more general
256 * "scanner state".
257 *
258 * Returns the top of the stack, or NULL.
259 */
260 #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
261 ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
262 : NULL)
263
264 /* Same as previous macro, but useful when we know that the buffer stack is not
265 * NULL or when we need an lvalue. For internal use only.
266 */
267 #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
268
269 /* yy_hold_char holds the character lost when yytext is formed. */
270 static char yy_hold_char;
271 static int yy_n_chars; /* number of characters read into yy_ch_buf */
272 int yyleng;
273
274 /* Points to current character in buffer. */
275 static char *yy_c_buf_p = NULL;
276 static int yy_init = 0; /* whether we need to initialize */
277 static int yy_start = 0; /* start state number */
278
279 /* Flag which is used to allow yywrap()'s to do buffer switches
280 * instead of setting up a fresh yyin. A bit of a hack ...
281 */
282 static int yy_did_buffer_switch_on_eof;
283
284 void yyrestart (FILE *input_file );
285 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer );
286 YY_BUFFER_STATE yy_create_buffer (FILE *file,int size );
287 void yy_delete_buffer (YY_BUFFER_STATE b );
288 void yy_flush_buffer (YY_BUFFER_STATE b );
289 void yypush_buffer_state (YY_BUFFER_STATE new_buffer );
290 void yypop_buffer_state (void );
291
292 static void yyensure_buffer_stack (void );
293 static void yy_load_buffer_state (void );
294 static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file );
295
296 #define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER )
297
298 YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size );
299 YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str );
300 YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len );
301
302 void *yyalloc (yy_size_t );
303 void *yyrealloc (void *,yy_size_t );
304 void yyfree (void * );
305
306 #define yy_new_buffer yy_create_buffer
307
308 #define yy_set_interactive(is_interactive) \
309 { \
310 if ( ! YY_CURRENT_BUFFER ){ \
311 yyensure_buffer_stack (); \
312 YY_CURRENT_BUFFER_LVALUE = \
313 yy_create_buffer(yyin,YY_BUF_SIZE ); \
314 } \
315 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
316 }
317
318 #define yy_set_bol(at_bol) \
319 { \
320 if ( ! YY_CURRENT_BUFFER ){\
321 yyensure_buffer_stack (); \
322 YY_CURRENT_BUFFER_LVALUE = \
323 yy_create_buffer(yyin,YY_BUF_SIZE ); \
324 } \
325 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
326 }
327
328 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
329
330 /* Begin user sect3 */
331
332 #define yywrap() (/*CONSTCOND*/1)
333 #define YY_SKIP_YYWRAP
334
335 typedef unsigned char YY_CHAR;
336
337 FILE *yyin = NULL, *yyout = NULL;
338
339 typedef int yy_state_type;
340
341 extern int yylineno;
342
343 int yylineno = 1;
344
345 extern char *yytext;
346 #ifdef yytext_ptr
347 #undef yytext_ptr
348 #endif
349 #define yytext_ptr yytext
350
351 static yy_state_type yy_get_previous_state (void );
352 static yy_state_type yy_try_NUL_trans (yy_state_type current_state );
353 static int yy_get_next_buffer (void );
354 static void yynoreturn yy_fatal_error (yyconst char* msg );
355
356 /* Done after the current pattern has been matched and before the
357 * corresponding action - sets up yytext.
358 */
359 #define YY_DO_BEFORE_ACTION \
360 (yytext_ptr) = yy_bp; \
361 (yytext_ptr) -= (yy_more_len); \
362 yyleng = (int) (yy_cp - (yytext_ptr)); \
363 (yy_hold_char) = *yy_cp; \
364 *yy_cp = '\0'; \
365 (yy_c_buf_p) = yy_cp;
366
367 #define YY_NUM_RULES 100
368 #define YY_END_OF_BUFFER 101
369 /* This struct is not used in this scanner,
370 but its presence is necessary. */
371 struct yy_trans_info
372 {
373 flex_int32_t yy_verify;
374 flex_int32_t yy_nxt;
375 };
376 static yyconst flex_int16_t yy_accept[429] =
377 { 0,
378 98, 98, 101, 99, 98, 97, 99, 2, 99, 90,
379 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
380 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
381 98, 97, 0, 3, 2, 1, 2, 90, 0, 0,
382 0, 0, 0, 0, 0, 0, 0, 0, 0, 17,
383 0, 0, 0, 0, 75, 0, 0, 0, 0, 80,
384 0, 0, 0, 0, 0, 0, 95, 0, 93, 0,
385 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
386 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
387 0, 0, 0, 0, 0, 0, 62, 0, 0, 0,
388
389 0, 0, 0, 0, 19, 0, 21, 0, 0, 0,
390 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
391 96, 0, 32, 0, 0, 0, 0, 0, 0, 0,
392 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
393 0, 0, 0, 0, 0, 0, 0, 92, 4, 0,
394 0, 70, 0, 0, 0, 61, 0, 0, 0, 0,
395 0, 64, 81, 0, 0, 0, 0, 22, 0, 0,
396 0, 0, 24, 0, 25, 0, 28, 0, 31, 0,
397 0, 0, 0, 37, 0, 0, 0, 0, 0, 0,
398 0, 0, 0, 0, 0, 0, 0, 91, 51, 52,
399
400 0, 60, 0, 56, 0, 0, 69, 0, 0, 0,
401 0, 0, 0, 0, 0, 94, 63, 0, 83, 0,
402 74, 0, 20, 0, 79, 0, 0, 58, 0, 0,
403 0, 0, 0, 0, 0, 0, 0, 0, 0, 42,
404 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
405 54, 59, 0, 55, 0, 0, 0, 0, 0, 0,
406 0, 0, 0, 16, 0, 0, 18, 73, 0, 0,
407 78, 0, 66, 57, 0, 0, 30, 0, 0, 0,
408 0, 0, 0, 0, 0, 88, 0, 0, 68, 0,
409 46, 85, 86, 0, 0, 0, 0, 0, 0, 7,
410
411 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
412 0, 0, 65, 0, 0, 33, 0, 35, 36, 0,
413 0, 0, 0, 43, 44, 67, 0, 0, 50, 0,
414 87, 0, 0, 0, 0, 0, 15, 0, 0, 89,
415 82, 0, 72, 23, 77, 26, 29, 34, 38, 0,
416 40, 0, 45, 0, 0, 0, 53, 0, 6, 0,
417 0, 0, 11, 0, 0, 0, 84, 71, 76, 0,
418 0, 0, 47, 0, 0, 0, 0, 0, 0, 14,
419 0, 0, 0, 0, 0, 0, 0, 5, 0, 0,
420 0, 12, 13, 0, 39, 0, 48, 0, 0, 0,
421
422 0, 0, 0, 0, 0, 0, 0, 0, 0, 49,
423 0, 0, 0, 0, 0, 0, 0, 10, 0, 0,
424 8, 0, 27, 0, 0, 41, 9, 0
425 } ;
426
427 static yyconst YY_CHAR yy_ec[256] =
428 { 0,
429 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
430 1, 1, 2, 1, 1, 1, 1, 1, 1, 1,
431 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
432 1, 2, 1, 4, 5, 1, 1, 1, 1, 1,
433 1, 6, 1, 1, 1, 1, 7, 8, 8, 8,
434 8, 9, 10, 8, 8, 8, 8, 1, 1, 1,
435 1, 1, 1, 1, 11, 12, 13, 14, 15, 16,
436 17, 18, 19, 1, 20, 21, 22, 23, 24, 25,
437 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
438 1, 1, 1, 1, 36, 1, 37, 38, 39, 40,
439
440 41, 42, 43, 44, 45, 1, 46, 47, 48, 49,
441 50, 51, 52, 53, 54, 55, 56, 57, 58, 59,
442 60, 61, 1, 1, 1, 1, 1, 1, 1, 1,
443 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
444 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
445 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
446 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
447 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
448 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
449 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
450
451 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
452 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
453 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
454 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
455 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
456 1, 1, 1, 1, 1
457 } ;
458
459 static yyconst YY_CHAR yy_meta[62] =
460 { 0,
461 1, 1, 2, 1, 1, 1, 1, 1, 1, 1,
462 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
463 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
464 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
465 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
466 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
467 1
468 } ;
469
470 static yyconst flex_uint16_t yy_base[432] =
471 { 0,
472 0, 0, 848, 849, 845, 0, 59, 0, 58, 58,
473 37, 59, 53, 61, 40, 64, 50, 58, 71, 109,
474 111, 66, 151, 108, 114, 146, 48, 69, 122, 110,
475 844, 0, 136, 849, 0, 849, 0, 134, 123, 122,
476 157, 140, 161, 154, 140, 151, 166, 167, 163, 849,
477 155, 157, 156, 176, 156, 159, 176, 190, 189, 180,
478 201, 197, 207, 202, 208, 213, 198, 212, 849, 216,
479 201, 205, 219, 207, 212, 250, 209, 230, 253, 229,
480 242, 248, 242, 248, 259, 253, 263, 256, 279, 248,
481 799, 270, 269, 262, 264, 265, 263, 282, 282, 275,
482
483 285, 288, 296, 303, 849, 295, 849, 301, 303, 307,
484 797, 299, 318, 300, 316, 303, 319, 322, 316, 318,
485 849, 311, 849, 321, 314, 327, 328, 316, 317, 353,
486 325, 338, 336, 350, 352, 363, 347, 359, 363, 366,
487 367, 368, 357, 358, 367, 371, 362, 849, 849, 360,
488 372, 366, 372, 385, 370, 849, 377, 401, 379, 386,
489 404, 397, 401, 399, 416, 420, 418, 849, 407, 420,
490 424, 409, 849, 421, 849, 429, 413, 429, 849, 420,
491 414, 423, 429, 849, 425, 421, 430, 440, 435, 456,
492 457, 454, 459, 467, 455, 469, 461, 849, 849, 463,
493
494 458, 460, 479, 463, 469, 472, 849, 479, 473, 483,
495 791, 485, 481, 489, 473, 849, 849, 481, 490, 506,
496 495, 495, 849, 515, 504, 499, 519, 507, 523, 522,
497 523, 516, 516, 515, 522, 531, 526, 535, 525, 849,
498 523, 527, 537, 539, 543, 530, 572, 538, 543, 564,
499 849, 849, 555, 849, 565, 567, 566, 574, 572, 574,
500 570, 570, 570, 849, 567, 572, 849, 849, 568, 587,
501 849, 571, 574, 849, 586, 578, 849, 578, 580, 586,
502 594, 595, 603, 605, 621, 849, 620, 611, 611, 621,
503 849, 849, 849, 245, 612, 620, 628, 621, 618, 849,
504
505 213, 632, 621, 625, 631, 637, 621, 626, 628, 642,
506 644, 644, 849, 645, 630, 849, 657, 849, 849, 656,
507 664, 673, 676, 849, 849, 849, 669, 673, 849, 676,
508 849, 669, 665, 680, 662, 672, 849, 678, 678, 849,
509 849, 675, 679, 849, 680, 201, 849, 849, 849, 686,
510 849, 682, 849, 687, 689, 694, 849, 697, 849, 708,
511 710, 722, 849, 720, 724, 714, 849, 849, 849, 718,
512 716, 728, 849, 721, 723, 728, 723, 738, 732, 849,
513 727, 729, 744, 731, 738, 733, 744, 849, 749, 735,
514 760, 849, 849, 769, 849, 754, 849, 769, 766, 779,
515
516 771, 766, 782, 781, 768, 100, 770, 783, 776, 849,
517 793, 777, 777, 787, 779, 790, 793, 849, 799, 803,
518 849, 780, 849, 795, 802, 849, 849, 849, 130, 843,
519 93
520 } ;
521
522 static yyconst flex_int16_t yy_def[432] =
523 { 0,
524 428, 1, 428, 428, 428, 429, 430, 431, 428, 428,
525 428, 428, 428, 428, 428, 428, 428, 428, 428, 428,
526 428, 428, 428, 428, 428, 428, 428, 428, 428, 428,
527 428, 429, 430, 428, 431, 428, 431, 428, 428, 428,
528 428, 428, 428, 428, 428, 428, 428, 428, 428, 428,
529 428, 428, 428, 428, 428, 428, 428, 428, 428, 428,
530 428, 428, 428, 428, 428, 428, 428, 428, 428, 428,
531 428, 428, 428, 428, 428, 428, 428, 428, 428, 428,
532 428, 428, 428, 428, 428, 428, 428, 428, 428, 428,
533 428, 428, 428, 428, 428, 428, 428, 428, 428, 428,
534
535 428, 428, 428, 428, 428, 428, 428, 428, 428, 428,
536 428, 428, 428, 428, 428, 428, 428, 428, 428, 428,
537 428, 428, 428, 428, 428, 428, 428, 428, 428, 428,
538 428, 428, 428, 428, 428, 428, 428, 428, 428, 428,
539 428, 428, 428, 428, 428, 428, 428, 428, 428, 428,
540 428, 428, 428, 428, 428, 428, 428, 428, 428, 428,
541 428, 428, 428, 428, 428, 428, 428, 428, 428, 428,
542 428, 428, 428, 428, 428, 428, 428, 428, 428, 428,
543 428, 428, 428, 428, 428, 428, 428, 428, 428, 428,
544 428, 428, 428, 428, 428, 428, 428, 428, 428, 428,
545
546 428, 428, 428, 428, 428, 428, 428, 428, 428, 428,
547 428, 428, 428, 428, 428, 428, 428, 428, 428, 428,
548 428, 428, 428, 428, 428, 428, 428, 428, 428, 428,
549 428, 428, 428, 428, 428, 428, 428, 428, 428, 428,
550 428, 428, 428, 428, 428, 428, 428, 428, 428, 428,
551 428, 428, 428, 428, 428, 428, 428, 428, 428, 428,
552 428, 428, 428, 428, 428, 428, 428, 428, 428, 428,
553 428, 428, 428, 428, 428, 428, 428, 428, 428, 428,
554 428, 428, 428, 428, 428, 428, 428, 428, 428, 428,
555 428, 428, 428, 428, 428, 428, 428, 428, 428, 428,
556
557 428, 428, 428, 428, 428, 428, 428, 428, 428, 428,
558 428, 428, 428, 428, 428, 428, 428, 428, 428, 428,
559 428, 428, 428, 428, 428, 428, 428, 428, 428, 428,
560 428, 428, 428, 428, 428, 428, 428, 428, 428, 428,
561 428, 428, 428, 428, 428, 428, 428, 428, 428, 428,
562 428, 428, 428, 428, 428, 428, 428, 428, 428, 428,
563 428, 428, 428, 428, 428, 428, 428, 428, 428, 428,
564 428, 428, 428, 428, 428, 428, 428, 428, 428, 428,
565 428, 428, 428, 428, 428, 428, 428, 428, 428, 428,
566 428, 428, 428, 428, 428, 428, 428, 428, 428, 428,
567
568 428, 428, 428, 428, 428, 428, 428, 428, 428, 428,
569 428, 428, 428, 428, 428, 428, 428, 428, 428, 428,
570 428, 428, 428, 428, 428, 428, 428, 0, 428, 428,
571 428
572 } ;
573
574 static yyconst flex_uint16_t yy_nxt[911] =
575 { 0,
576 4, 5, 6, 7, 8, 4, 9, 10, 10, 10,
577 11, 12, 13, 14, 15, 16, 4, 17, 18, 19,
578 4, 20, 21, 22, 23, 4, 24, 25, 26, 27,
579 28, 29, 4, 30, 4, 4, 11, 12, 13, 14,
580 15, 16, 4, 17, 18, 19, 4, 20, 21, 22,
581 23, 4, 24, 25, 26, 27, 28, 29, 4, 30,
582 4, 34, 34, 36, 37, 38, 38, 38, 39, 40,
583 43, 45, 48, 51, 49, 85, 44, 50, 52, 41,
584 53, 68, 55, 46, 54, 56, 86, 47, 69, 57,
585 70, 58, 42, 35, 39, 40, 43, 45, 48, 51,
586
587 49, 85, 44, 50, 52, 41, 53, 68, 55, 46,
588 54, 56, 86, 47, 69, 57, 70, 58, 42, 59,
589 60, 64, 76, 61, 89, 65, 78, 62, 79, 66,
590 32, 77, 63, 90, 67, 412, 87, 80, 34, 34,
591 88, 38, 38, 38, 91, 59, 60, 64, 76, 61,
592 89, 65, 78, 62, 79, 66, 81, 77, 63, 90,
593 67, 71, 87, 80, 82, 72, 88, 92, 93, 73,
594 91, 94, 83, 97, 74, 95, 96, 75, 98, 84,
595 99, 100, 81, 101, 102, 103, 104, 71, 105, 106,
596 82, 72, 107, 92, 93, 73, 108, 94, 83, 97,
597
598 74, 95, 96, 75, 98, 84, 99, 100, 109, 101,
599 102, 103, 104, 112, 105, 106, 110, 113, 107, 114,
600 115, 111, 108, 117, 118, 119, 120, 121, 125, 116,
601 122, 126, 127, 128, 109, 129, 370, 123, 133, 112,
602 134, 138, 110, 113, 124, 114, 115, 111, 334, 117,
603 118, 119, 120, 121, 125, 116, 122, 126, 127, 128,
604 130, 129, 131, 123, 133, 135, 134, 138, 139, 140,
605 124, 141, 142, 143, 132, 136, 144, 145, 146, 137,
606 328, 149, 151, 152, 153, 154, 130, 155, 131, 147,
607 156, 135, 159, 157, 139, 140, 160, 141, 142, 143,
608
609 132, 136, 144, 145, 146, 137, 148, 149, 151, 152,
610 153, 154, 161, 155, 162, 147, 156, 158, 159, 157,
611 163, 164, 160, 165, 166, 167, 168, 170, 171, 172,
612 173, 174, 148, 175, 176, 177, 178, 179, 161, 180,
613 162, 181, 182, 183, 184, 185, 163, 164, 188, 165,
614 166, 167, 168, 170, 171, 172, 173, 174, 189, 175,
615 176, 177, 178, 179, 190, 180, 186, 181, 182, 183,
616 184, 185, 191, 187, 188, 192, 193, 194, 195, 196,
617 197, 198, 199, 200, 189, 201, 202, 203, 204, 205,
618 190, 206, 186, 207, 208, 209, 210, 211, 191, 187,
619
620 214, 192, 193, 194, 195, 196, 197, 198, 199, 200,
621 215, 201, 202, 203, 204, 205, 212, 206, 216, 207,
622 208, 209, 210, 211, 217, 218, 214, 220, 219, 213,
623 221, 222, 223, 224, 225, 226, 215, 227, 228, 229,
624 230, 231, 212, 232, 216, 233, 234, 235, 236, 237,
625 217, 218, 238, 220, 219, 213, 221, 222, 223, 224,
626 225, 226, 239, 227, 228, 229, 230, 231, 240, 232,
627 241, 233, 234, 235, 236, 237, 244, 242, 238, 243,
628 245, 246, 247, 248, 249, 250, 251, 252, 239, 253,
629 254, 255, 256, 257, 240, 258, 241, 259, 261, 262,
630
631 263, 264, 244, 242, 265, 243, 245, 246, 247, 248,
632 249, 250, 251, 252, 266, 253, 254, 255, 256, 257,
633 267, 258, 268, 259, 261, 262, 263, 264, 269, 270,
634 265, 271, 272, 273, 274, 275, 276, 277, 278, 279,
635 266, 280, 281, 282, 283, 284, 267, 285, 268, 286,
636 287, 288, 289, 290, 269, 270, 291, 271, 272, 273,
637 274, 275, 276, 277, 278, 279, 294, 280, 281, 282,
638 283, 284, 295, 285, 296, 286, 287, 288, 289, 290,
639 292, 293, 291, 297, 298, 299, 300, 301, 302, 303,
640 305, 306, 294, 307, 308, 309, 310, 311, 295, 312,
641
642 296, 313, 304, 314, 315, 316, 317, 318, 319, 297,
643 298, 299, 300, 301, 302, 303, 305, 306, 320, 307,
644 308, 309, 310, 311, 321, 312, 322, 313, 304, 314,
645 315, 316, 317, 318, 319, 323, 324, 325, 326, 327,
646 329, 330, 331, 332, 320, 333, 335, 336, 337, 338,
647 321, 339, 322, 340, 341, 342, 343, 344, 345, 346,
648 347, 323, 324, 325, 326, 327, 329, 330, 331, 332,
649 348, 333, 335, 336, 337, 338, 349, 339, 350, 340,
650 341, 342, 343, 344, 345, 346, 347, 351, 352, 353,
651 357, 354, 358, 359, 363, 364, 348, 355, 360, 365,
652
653 356, 366, 349, 367, 350, 361, 368, 369, 362, 371,
654 372, 373, 374, 351, 352, 353, 357, 354, 358, 359,
655 363, 364, 375, 355, 360, 365, 356, 366, 376, 367,
656 377, 361, 368, 369, 362, 371, 372, 373, 374, 378,
657 379, 380, 381, 382, 383, 384, 385, 386, 375, 387,
658 388, 389, 390, 391, 376, 392, 377, 393, 394, 395,
659 396, 397, 398, 399, 400, 378, 379, 380, 381, 382,
660 383, 384, 385, 386, 401, 387, 388, 389, 390, 391,
661 402, 392, 403, 393, 394, 395, 396, 397, 398, 399,
662 400, 404, 405, 406, 407, 408, 409, 410, 411, 413,
663
664 401, 414, 415, 416, 417, 418, 402, 419, 403, 420,
665 421, 422, 423, 424, 425, 426, 427, 404, 405, 406,
666 407, 408, 409, 410, 411, 413, 260, 414, 415, 416,
667 417, 418, 169, 419, 150, 420, 421, 422, 423, 424,
668 425, 426, 427, 33, 33, 31, 31, 428, 3, 428,
669 428, 428, 428, 428, 428, 428, 428, 428, 428, 428,
670 428, 428, 428, 428, 428, 428, 428, 428, 428, 428,
671 428, 428, 428, 428, 428, 428, 428, 428, 428, 428,
672 428, 428, 428, 428, 428, 428, 428, 428, 428, 428,
673 428, 428, 428, 428, 428, 428, 428, 428, 428, 428,
674
675 428, 428, 428, 428, 428, 428, 428, 428, 428, 428
676 } ;
677
678 static yyconst flex_int16_t yy_chk[911] =
679 { 0,
680 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
681 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
682 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
683 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
684 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
685 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
686 1, 7, 7, 9, 9, 10, 10, 10, 11, 12,
687 13, 14, 15, 17, 16, 27, 13, 16, 17, 12,
688 18, 22, 19, 14, 18, 19, 28, 14, 22, 19,
689 22, 19, 12, 431, 11, 12, 13, 14, 15, 17,
690
691 16, 27, 13, 16, 17, 12, 18, 22, 19, 14,
692 18, 19, 28, 14, 22, 19, 22, 19, 12, 20,
693 20, 21, 24, 20, 30, 21, 25, 20, 25, 21,
694 429, 24, 20, 39, 21, 406, 29, 25, 33, 33,
695 29, 38, 38, 38, 40, 20, 20, 21, 24, 20,
696 30, 21, 25, 20, 25, 21, 26, 24, 20, 39,
697 21, 23, 29, 25, 26, 23, 29, 41, 42, 23,
698 40, 43, 26, 45, 23, 44, 44, 23, 46, 26,
699 47, 48, 26, 49, 51, 52, 53, 23, 54, 55,
700 26, 23, 56, 41, 42, 23, 57, 43, 26, 45,
701
702 23, 44, 44, 23, 46, 26, 47, 48, 58, 49,
703 51, 52, 53, 60, 54, 55, 59, 61, 56, 62,
704 63, 59, 57, 64, 65, 66, 67, 68, 71, 63,
705 70, 72, 73, 74, 58, 75, 346, 70, 77, 60,
706 78, 80, 59, 61, 70, 62, 63, 59, 301, 64,
707 65, 66, 67, 68, 71, 63, 70, 72, 73, 74,
708 76, 75, 76, 70, 77, 79, 78, 80, 81, 82,
709 70, 83, 84, 85, 76, 79, 86, 87, 88, 79,
710 294, 90, 92, 93, 94, 95, 76, 96, 76, 89,
711 97, 79, 99, 98, 81, 82, 100, 83, 84, 85,
712
713 76, 79, 86, 87, 88, 79, 89, 90, 92, 93,
714 94, 95, 101, 96, 102, 89, 97, 98, 99, 98,
715 103, 104, 100, 106, 108, 109, 110, 112, 113, 114,
716 115, 116, 89, 117, 118, 119, 120, 122, 101, 124,
717 102, 125, 126, 127, 128, 129, 103, 104, 131, 106,
718 108, 109, 110, 112, 113, 114, 115, 116, 132, 117,
719 118, 119, 120, 122, 133, 124, 130, 125, 126, 127,
720 128, 129, 134, 130, 131, 135, 136, 137, 138, 139,
721 140, 141, 142, 143, 132, 144, 145, 146, 147, 150,
722 133, 151, 130, 152, 153, 154, 155, 157, 134, 130,
723
724 159, 135, 136, 137, 138, 139, 140, 141, 142, 143,
725 160, 144, 145, 146, 147, 150, 158, 151, 161, 152,
726 153, 154, 155, 157, 162, 163, 159, 164, 163, 158,
727 165, 166, 167, 169, 170, 171, 160, 172, 174, 176,
728 177, 178, 158, 180, 161, 181, 182, 183, 185, 186,
729 162, 163, 187, 164, 163, 158, 165, 166, 167, 169,
730 170, 171, 188, 172, 174, 176, 177, 178, 189, 180,
731 190, 181, 182, 183, 185, 186, 192, 191, 187, 191,
732 193, 194, 195, 196, 197, 200, 201, 202, 188, 203,
733 204, 205, 206, 208, 189, 209, 190, 210, 212, 213,
734
735 214, 215, 192, 191, 218, 191, 193, 194, 195, 196,
736 197, 200, 201, 202, 219, 203, 204, 205, 206, 208,
737 220, 209, 221, 210, 212, 213, 214, 215, 222, 224,
738 218, 225, 226, 227, 228, 229, 230, 231, 232, 233,
739 219, 234, 235, 236, 237, 238, 220, 239, 221, 241,
740 242, 243, 244, 245, 222, 224, 246, 225, 226, 227,
741 228, 229, 230, 231, 232, 233, 248, 234, 235, 236,
742 237, 238, 249, 239, 250, 241, 242, 243, 244, 245,
743 247, 247, 246, 253, 255, 256, 257, 258, 259, 260,
744 261, 262, 248, 263, 265, 266, 269, 270, 249, 272,
745
746 250, 273, 260, 275, 276, 278, 279, 280, 281, 253,
747 255, 256, 257, 258, 259, 260, 261, 262, 282, 263,
748 265, 266, 269, 270, 283, 272, 284, 273, 260, 275,
749 276, 278, 279, 280, 281, 285, 287, 288, 289, 290,
750 295, 296, 297, 298, 282, 299, 302, 303, 304, 305,
751 283, 306, 284, 307, 308, 309, 310, 311, 312, 314,
752 315, 285, 287, 288, 289, 290, 295, 296, 297, 298,
753 317, 299, 302, 303, 304, 305, 320, 306, 321, 307,
754 308, 309, 310, 311, 312, 314, 315, 322, 323, 327,
755 330, 328, 332, 333, 335, 336, 317, 328, 334, 338,
756
757 328, 339, 320, 342, 321, 334, 343, 345, 334, 350,
758 352, 354, 355, 322, 323, 327, 330, 328, 332, 333,
759 335, 336, 356, 328, 334, 338, 328, 339, 358, 342,
760 360, 334, 343, 345, 334, 350, 352, 354, 355, 361,
761 362, 364, 365, 366, 370, 371, 372, 374, 356, 375,
762 376, 377, 378, 379, 358, 381, 360, 382, 383, 384,
763 385, 386, 387, 389, 390, 361, 362, 364, 365, 366,
764 370, 371, 372, 374, 391, 375, 376, 377, 378, 379,
765 394, 381, 396, 382, 383, 384, 385, 386, 387, 389,
766 390, 398, 399, 400, 401, 402, 403, 404, 405, 407,
767
768 391, 408, 409, 411, 412, 413, 394, 414, 396, 415,
769 416, 417, 419, 420, 422, 424, 425, 398, 399, 400,
770 401, 402, 403, 404, 405, 407, 211, 408, 409, 411,
771 412, 413, 111, 414, 91, 415, 416, 417, 419, 420,
772 422, 424, 425, 430, 430, 31, 5, 3, 428, 428,
773 428, 428, 428, 428, 428, 428, 428, 428, 428, 428,
774 428, 428, 428, 428, 428, 428, 428, 428, 428, 428,
775 428, 428, 428, 428, 428, 428, 428, 428, 428, 428,
776 428, 428, 428, 428, 428, 428, 428, 428, 428, 428,
777 428, 428, 428, 428, 428, 428, 428, 428, 428, 428,
778
779 428, 428, 428, 428, 428, 428, 428, 428, 428, 428
780 } ;
781
782 static yy_state_type yy_last_accepting_state;
783 static char *yy_last_accepting_cpos;
784
785 extern int yy_flex_debug;
786 int yy_flex_debug = 0;
787
788 /* The intent behind this definition is that it'll catch
789 * any uses of REJECT which flex missed.
790 */
791 #define REJECT reject_used_but_not_detected
792 static int yy_more_flag = 0;
793 static int yy_more_len = 0;
794 #define yymore() ((yy_more_flag) = 1)
795 #define YY_MORE_ADJ (yy_more_len)
796 #define YY_RESTORE_YY_MORE_OFFSET
797 char *yytext;
798 #line 1 "config-lexer.l"
799 /*
800 * Copyright (c) 2002 Erik Fears
801 * Copyright (c) 2014-2016 ircd-hybrid development team
802 *
803 * This program is free software; you can redistribute it and/or modify
804 * it under the terms of the GNU General Public License as published by
805 * the Free Software Foundation; either version 2 of the License, or
806 * (at your option) any later version.
807 *
808 * This program is distributed in the hope that it will be useful,
809 * but WITHOUT ANY WARRANTY; without even the implied warranty of
810 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
811 * GNU General Public License for more details.
812 *
813 * You should have received a copy of the GNU General Public License
814 * along with this program; if not, write to the Free Software
815 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
816 * USA
817 */
818 #line 27 "config-lexer.l"
819 #include <stdio.h>
820 #include <string.h>
821
822 #include "compat.h"
823 #include "config.h"
824 #include "config-parser.h" /* autogenerated header file */
825 #include "log.h"
826
827
828 #undef YY_INPUT
829 #define YY_INPUT(buf,result,max_size) \
830 if (!(result = conf_yy_input(buf, max_size))) \
831 YY_FATAL_ERROR("input in flex scanner failed");
832 #define MAX_INCLUDE_DEPTH 10
833
834
835 unsigned int lineno = 1;
836 char linebuf[512];
837 char conffilebuf[512];
838
839 static struct included_file
840 {
841 YY_BUFFER_STATE state;
842 unsigned int lineno;
843 FILE *file;
844 char conffile[512];
845 } include_stack[MAX_INCLUDE_DEPTH];
846
847 static unsigned int include_stack_ptr;
848
849
850 static void ccomment(void);
851 static void conf_include(void);
852 static int conf_eof(void);
853
854 static int
855 conf_yy_input(char *lbuf, unsigned int max_size)
856 {
857 return !fgets(lbuf, max_size, conf_file) ? 0 : strlen(lbuf);
858 }
859
860
861 #line 862 "config-lexer.c"
862
863 #define INITIAL 0
864
865 #ifndef YY_NO_UNISTD_H
866 /* Special case for "unistd.h", since it is non-ANSI. We include it way
867 * down here because we want the user's section 1 to have been scanned first.
868 * The user has a chance to override it with an option.
869 */
870 #include <unistd.h>
871 #endif
872
873 #ifndef YY_EXTRA_TYPE
874 #define YY_EXTRA_TYPE void *
875 #endif
876
877 static int yy_init_globals (void );
878
879 /* Accessor methods to globals.
880 These are made visible to non-reentrant scanners for convenience. */
881
882 int yylex_destroy (void );
883
884 int yyget_debug (void );
885
886 void yyset_debug (int debug_flag );
887
888 YY_EXTRA_TYPE yyget_extra (void );
889
890 void yyset_extra (YY_EXTRA_TYPE user_defined );
891
892 FILE *yyget_in (void );
893
894 void yyset_in (FILE * _in_str );
895
896 FILE *yyget_out (void );
897
898 void yyset_out (FILE * _out_str );
899
900 int yyget_leng (void );
901
902 char *yyget_text (void );
903
904 int yyget_lineno (void );
905
906 void yyset_lineno (int _line_number );
907
908 /* Macros after this point can all be overridden by user definitions in
909 * section 1.
910 */
911
912 #ifndef YY_SKIP_YYWRAP
913 #ifdef __cplusplus
914 extern "C" int yywrap (void );
915 #else
916 extern int yywrap (void );
917 #endif
918 #endif
919
920 #ifndef YY_NO_UNPUT
921
922 #endif
923
924 #ifndef yytext_ptr
925 static void yy_flex_strncpy (char *,yyconst char *,int );
926 #endif
927
928 #ifdef YY_NEED_STRLEN
929 static int yy_flex_strlen (yyconst char * );
930 #endif
931
932 #ifndef YY_NO_INPUT
933
934 #ifdef __cplusplus
935 static int yyinput (void );
936 #else
937 static int input (void );
938 #endif
939
940 #endif
941
942 /* Amount of stuff to slurp up with each read. */
943 #ifndef YY_READ_BUF_SIZE
944 #ifdef __ia64__
945 /* On IA-64, the buffer size is 16k, not 8k */
946 #define YY_READ_BUF_SIZE 16384
947 #else
948 #define YY_READ_BUF_SIZE 8192
949 #endif /* __ia64__ */
950 #endif
951
952 /* Copy whatever the last rule matched to the standard output. */
953 #ifndef ECHO
954 /* This used to be an fputs(), but since the string might contain NUL's,
955 * we now use fwrite().
956 */
957 #define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0)
958 #endif
959
960 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
961 * is returned in "result".
962 */
963 #ifndef YY_INPUT
964 #define YY_INPUT(buf,result,max_size) \
965 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
966 { \
967 int c = '*'; \
968 size_t n; \
969 for ( n = 0; n < max_size && \
970 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
971 buf[n] = (char) c; \
972 if ( c == '\n' ) \
973 buf[n++] = (char) c; \
974 if ( c == EOF && ferror( yyin ) ) \
975 YY_FATAL_ERROR( "input in flex scanner failed" ); \
976 result = n; \
977 } \
978 else \
979 { \
980 errno=0; \
981 while ( (result = (int) fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
982 { \
983 if( errno != EINTR) \
984 { \
985 YY_FATAL_ERROR( "input in flex scanner failed" ); \
986 break; \
987 } \
988 errno=0; \
989 clearerr(yyin); \
990 } \
991 }\
992 \
993
994 #endif
995
996 /* No semi-colon after return; correct usage is to write "yyterminate();" -
997 * we don't want an extra ';' after the "return" because that will cause
998 * some compilers to complain about unreachable statements.
999 */
1000 #ifndef yyterminate
1001 #define yyterminate() return YY_NULL
1002 #endif
1003
1004 /* Number of entries by which start-condition stack grows. */
1005 #ifndef YY_START_STACK_INCR
1006 #define YY_START_STACK_INCR 25
1007 #endif
1008
1009 /* Report a fatal error. */
1010 #ifndef YY_FATAL_ERROR
1011 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
1012 #endif
1013
1014 /* end tables serialization structures and prototypes */
1015
1016 /* Default declaration of generated scanner - a define so the user can
1017 * easily add parameters.
1018 */
1019 #ifndef YY_DECL
1020 #define YY_DECL_IS_OURS 1
1021
1022 extern int yylex (void);
1023
1024 #define YY_DECL int yylex (void)
1025 #endif /* !YY_DECL */
1026
1027 /* Code executed at the beginning of each rule, after yytext and yyleng
1028 * have been set up.
1029 */
1030 #ifndef YY_USER_ACTION
1031 #define YY_USER_ACTION
1032 #endif
1033
1034 /* Code executed at the end of each rule. */
1035 #ifndef YY_BREAK
1036 #define YY_BREAK /*LINTED*/break;
1037 #endif
1038
1039 #define YY_RULE_SETUP \
1040 YY_USER_ACTION
1041
1042 /** The main scanner function which does all the work.
1043 */
1044 YY_DECL
1045 {
1046 yy_state_type yy_current_state;
1047 char *yy_cp, *yy_bp;
1048 int yy_act;
1049
1050 if ( !(yy_init) )
1051 {
1052 (yy_init) = 1;
1053
1054 #ifdef YY_USER_INIT
1055 YY_USER_INIT;
1056 #endif
1057
1058 if ( ! (yy_start) )
1059 (yy_start) = 1; /* first start state */
1060
1061 if ( ! yyin )
1062 yyin = stdin;
1063
1064 if ( ! yyout )
1065 yyout = stdout;
1066
1067 if ( ! YY_CURRENT_BUFFER ) {
1068 yyensure_buffer_stack ();
1069 YY_CURRENT_BUFFER_LVALUE =
1070 yy_create_buffer(yyin,YY_BUF_SIZE );
1071 }
1072
1073 yy_load_buffer_state( );
1074 }
1075
1076 {
1077 #line 76 "config-lexer.l"
1078
1079
1080 #line 1081 "config-lexer.c"
1081
1082 while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */
1083 {
1084 (yy_more_len) = 0;
1085 if ( (yy_more_flag) )
1086 {
1087 (yy_more_len) = (yy_c_buf_p) - (yytext_ptr);
1088 (yy_more_flag) = 0;
1089 }
1090 yy_cp = (yy_c_buf_p);
1091
1092 /* Support of yytext. */
1093 *yy_cp = (yy_hold_char);
1094
1095 /* yy_bp points to the position in yy_ch_buf of the start of
1096 * the current run.
1097 */
1098 yy_bp = yy_cp;
1099
1100 yy_current_state = (yy_start);
1101 yy_match:
1102 do
1103 {
1104 YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
1105 if ( yy_accept[yy_current_state] )
1106 {
1107 (yy_last_accepting_state) = yy_current_state;
1108 (yy_last_accepting_cpos) = yy_cp;
1109 }
1110 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1111 {
1112 yy_current_state = (int) yy_def[yy_current_state];
1113 if ( yy_current_state >= 429 )
1114 yy_c = yy_meta[(unsigned int) yy_c];
1115 }
1116 yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c];
1117 ++yy_cp;
1118 }
1119 while ( yy_current_state != 428 );
1120 yy_cp = (yy_last_accepting_cpos);
1121 yy_current_state = (yy_last_accepting_state);
1122
1123 yy_find_action:
1124 yy_act = yy_accept[yy_current_state];
1125
1126 YY_DO_BEFORE_ACTION;
1127
1128 do_action: /* This label is used only to access EOF actions. */
1129
1130 switch ( yy_act )
1131 { /* beginning of action switch */
1132 case 0: /* must back up */
1133 /* undo the effects of YY_DO_BEFORE_ACTION */
1134 *yy_cp = (yy_hold_char);
1135 yy_cp = (yy_last_accepting_cpos);
1136 yy_current_state = (yy_last_accepting_state);
1137 goto yy_find_action;
1138
1139 case 1:
1140 YY_RULE_SETUP
1141 #line 78 "config-lexer.l"
1142 { ccomment(); }
1143 YY_BREAK
1144 case 2:
1145 YY_RULE_SETUP
1146 #line 80 "config-lexer.l"
1147 ;
1148 YY_BREAK
1149 case 3:
1150 /* rule 3 can match eol */
1151 YY_RULE_SETUP
1152 #line 82 "config-lexer.l"
1153 {
1154 /* QSTRING from Hybrid7. Why re-invent the wheel? */
1155
1156 if(yytext[yyleng-2] == '\\')
1157 {
1158 yyless(yyleng-1); /* return last quote */
1159 yymore(); /* append next string */
1160 }
1161 else
1162 {
1163 yylval.string = yytext+1;
1164 if(yylval.string[yyleng-2] != '"') ; /* log error */
1165 else
1166 {
1167 int i,j;
1168
1169 yylval.string[yyleng-2] = '\0'; /* remove close
1170 * quote
1171 */
1172
1173 for (j=i=0 ;yylval.string[i] != '\0'; i++,j++)
1174 {
1175 if (yylval.string[i] != '\\')
1176 {
1177 yylval.string[j] = yylval.string[i];
1178 }
1179 else
1180 {
1181 i++;
1182 yylval.string[j] = yylval.string[i];
1183 }
1184 }
1185 yylval.string[j] = '\0';
1186 return STRING;
1187 }
1188 }
1189 }
1190 YY_BREAK
1191 case 4:
1192 YY_RULE_SETUP
1193 #line 120 "config-lexer.l"
1194 { return AWAY; }
1195 YY_BREAK
1196 case 5:
1197 YY_RULE_SETUP
1198 #line 121 "config-lexer.l"
1199 { return BAN_UNKNOWN; }
1200 YY_BREAK
1201 case 6:
1202 YY_RULE_SETUP
1203 #line 122 "config-lexer.l"
1204 { return BLACKLIST; }
1205 YY_BREAK
1206 case 7:
1207 YY_RULE_SETUP
1208 #line 123 "config-lexer.l"
1209 { return CHANNEL; }
1210 YY_BREAK
1211 case 8:
1212 YY_RULE_SETUP
1213 #line 124 "config-lexer.l"
1214 { return COMMAND_INTERVAL; }
1215 YY_BREAK
1216 case 9:
1217 YY_RULE_SETUP
1218 #line 125 "config-lexer.l"
1219 { return COMMAND_QUEUE_SIZE; }
1220 YY_BREAK
1221 case 10:
1222 YY_RULE_SETUP
1223 #line 126 "config-lexer.l"
1224 { return COMMAND_TIMEOUT; }
1225 YY_BREAK
1226 case 11:
1227 YY_RULE_SETUP
1228 #line 127 "config-lexer.l"
1229 { return CONNREGEX; }
1230 YY_BREAK
1231 case 12:
1232 YY_RULE_SETUP
1233 #line 128 "config-lexer.l"
1234 { return DNS_FDLIMIT; }
1235 YY_BREAK
1236 case 13:
1237 YY_RULE_SETUP
1238 #line 129 "config-lexer.l"
1239 { return DNS_TIMEOUT; }
1240 YY_BREAK
1241 case 14:
1242 YY_RULE_SETUP
1243 #line 130 "config-lexer.l"
1244 { return DNSBL_FROM; }
1245 YY_BREAK
1246 case 15:
1247 YY_RULE_SETUP
1248 #line 131 "config-lexer.l"
1249 { return DNSBL_TO; }
1250 YY_BREAK
1251 case 16:
1252 YY_RULE_SETUP
1253 #line 132 "config-lexer.l"
1254 { return EXEMPT; }
1255 YY_BREAK
1256 case 17:
1257 YY_RULE_SETUP
1258 #line 133 "config-lexer.l"
1259 { return FD; }
1260 YY_BREAK
1261 case 18:
1262 YY_RULE_SETUP
1263 #line 134 "config-lexer.l"
1264 { return INVITE; }
1265 YY_BREAK
1266 case 19:
1267 YY_RULE_SETUP
1268 #line 135 "config-lexer.l"
1269 { return IRC; }
1270 YY_BREAK
1271 case 20:
1272 YY_RULE_SETUP
1273 #line 136 "config-lexer.l"
1274 { return KLINE; }
1275 YY_BREAK
1276 case 21:
1277 YY_RULE_SETUP
1278 #line 137 "config-lexer.l"
1279 { return KEY; }
1280 YY_BREAK
1281 case 22:
1282 YY_RULE_SETUP
1283 #line 138 "config-lexer.l"
1284 { return MASK; }
1285 YY_BREAK
1286 case 23:
1287 YY_RULE_SETUP
1288 #line 139 "config-lexer.l"
1289 { return MAX_READ; }
1290 YY_BREAK
1291 case 24:
1292 YY_RULE_SETUP
1293 #line 140 "config-lexer.l"
1294 { return MODE; }
1295 YY_BREAK
1296 case 25:
1297 YY_RULE_SETUP
1298 #line 141 "config-lexer.l"
1299 { return NAME; }
1300 YY_BREAK
1301 case 26:
1302 YY_RULE_SETUP
1303 #line 142 "config-lexer.l"
1304 { return NEGCACHE; }
1305 YY_BREAK
1306 case 27:
1307 YY_RULE_SETUP
1308 #line 143 "config-lexer.l"
1309 { return NEGCACHE_REBUILD; }
1310 YY_BREAK
1311 case 28:
1312 YY_RULE_SETUP
1313 #line 144 "config-lexer.l"
1314 { return NICK; }
1315 YY_BREAK
1316 case 29:
1317 YY_RULE_SETUP
1318 #line 145 "config-lexer.l"
1319 { return NICKSERV; }
1320 YY_BREAK
1321 case 30:
1322 YY_RULE_SETUP
1323 #line 146 "config-lexer.l"
1324 { return NOTICE; }
1325 YY_BREAK
1326 case 31:
1327 YY_RULE_SETUP
1328 #line 147 "config-lexer.l"
1329 { return OPER; }
1330 YY_BREAK
1331 case 32:
1332 YY_RULE_SETUP
1333 #line 148 "config-lexer.l"
1334 { return OPM; }
1335 YY_BREAK
1336 case 33:
1337 YY_RULE_SETUP
1338 #line 149 "config-lexer.l"
1339 { return OPTIONS; }
1340 YY_BREAK
1341 case 34:
1342 YY_RULE_SETUP
1343 #line 150 "config-lexer.l"
1344 { return PASSWORD; }
1345 YY_BREAK
1346 case 35:
1347 YY_RULE_SETUP
1348 #line 151 "config-lexer.l"
1349 { return PERFORM; }
1350 YY_BREAK
1351 case 36:
1352 YY_RULE_SETUP
1353 #line 152 "config-lexer.l"
1354 { return PIDFILE; }
1355 YY_BREAK
1356 case 37:
1357 YY_RULE_SETUP
1358 #line 153 "config-lexer.l"
1359 { return PORT; }
1360 YY_BREAK
1361 case 38:
1362 YY_RULE_SETUP
1363 #line 154 "config-lexer.l"
1364 { return PROTOCOL; }
1365 YY_BREAK
1366 case 39:
1367 YY_RULE_SETUP
1368 #line 155 "config-lexer.l"
1369 { return READTIMEOUT; }
1370 YY_BREAK
1371 case 40:
1372 YY_RULE_SETUP
1373 #line 156 "config-lexer.l"
1374 { return REALNAME; }
1375 YY_BREAK
1376 case 41:
1377 YY_RULE_SETUP
1378 #line 157 "config-lexer.l"
1379 { return RECONNECTINTERVAL; }
1380 YY_BREAK
1381 case 42:
1382 YY_RULE_SETUP
1383 #line 158 "config-lexer.l"
1384 { return REPLY; }
1385 YY_BREAK
1386 case 43:
1387 YY_RULE_SETUP
1388 #line 159 "config-lexer.l"
1389 { return SCANLOG; }
1390 YY_BREAK
1391 case 44:
1392 YY_RULE_SETUP
1393 #line 160 "config-lexer.l"
1394 { return SCANNER; }
1395 YY_BREAK
1396 case 45:
1397 YY_RULE_SETUP
1398 #line 161 "config-lexer.l"
1399 { return SENDMAIL; }
1400 YY_BREAK
1401 case 46:
1402 YY_RULE_SETUP
1403 #line 162 "config-lexer.l"
1404 { return SERVER; }
1405 YY_BREAK
1406 case 47:
1407 YY_RULE_SETUP
1408 #line 163 "config-lexer.l"
1409 { return TARGET_IP; }
1410 YY_BREAK
1411 case 48:
1412 YY_RULE_SETUP
1413 #line 164 "config-lexer.l"
1414 { return TARGET_PORT; }
1415 YY_BREAK
1416 case 49:
1417 YY_RULE_SETUP
1418 #line 165 "config-lexer.l"
1419 { return TARGET_STRING;}
1420 YY_BREAK
1421 case 50:
1422 YY_RULE_SETUP
1423 #line 166 "config-lexer.l"
1424 { return TIMEOUT; }
1425 YY_BREAK
1426 case 51:
1427 YY_RULE_SETUP
1428 #line 167 "config-lexer.l"
1429 { return TYPE; }
1430 YY_BREAK
1431 case 52:
1432 YY_RULE_SETUP
1433 #line 168 "config-lexer.l"
1434 { return USER; }
1435 YY_BREAK
1436 case 53:
1437 YY_RULE_SETUP
1438 #line 169 "config-lexer.l"
1439 { return USERNAME; }
1440 YY_BREAK
1441 case 54:
1442 YY_RULE_SETUP
1443 #line 170 "config-lexer.l"
1444 { return VHOST; }
1445 YY_BREAK
1446 case 55:
1447 YY_RULE_SETUP
1448 #line 172 "config-lexer.l"
1449 { return YEARS; }
1450 YY_BREAK
1451 case 56:
1452 YY_RULE_SETUP
1453 #line 173 "config-lexer.l"
1454 { return YEARS; }
1455 YY_BREAK
1456 case 57:
1457 YY_RULE_SETUP
1458 #line 174 "config-lexer.l"
1459 { return MONTHS; }
1460 YY_BREAK
1461 case 58:
1462 YY_RULE_SETUP
1463 #line 175 "config-lexer.l"
1464 { return MONTHS; }
1465 YY_BREAK
1466 case 59:
1467 YY_RULE_SETUP
1468 #line 176 "config-lexer.l"
1469 { return WEEKS; }
1470 YY_BREAK
1471 case 60:
1472 YY_RULE_SETUP
1473 #line 177 "config-lexer.l"
1474 { return WEEKS; }
1475 YY_BREAK
1476 case 61:
1477 YY_RULE_SETUP
1478 #line 178 "config-lexer.l"
1479 { return DAYS; }
1480 YY_BREAK
1481 case 62:
1482 YY_RULE_SETUP
1483 #line 179 "config-lexer.l"
1484 { return DAYS; }
1485 YY_BREAK
1486 case 63:
1487 YY_RULE_SETUP
1488 #line 180 "config-lexer.l"
1489 { return HOURS; }
1490 YY_BREAK
1491 case 64:
1492 YY_RULE_SETUP
1493 #line 181 "config-lexer.l"
1494 { return HOURS; }
1495 YY_BREAK
1496 case 65:
1497 YY_RULE_SETUP
1498 #line 182 "config-lexer.l"
1499 { return MINUTES; }
1500 YY_BREAK
1501 case 66:
1502 YY_RULE_SETUP
1503 #line 183 "config-lexer.l"
1504 { return MINUTES; }
1505 YY_BREAK
1506 case 67:
1507 YY_RULE_SETUP
1508 #line 184 "config-lexer.l"
1509 { return SECONDS; }
1510 YY_BREAK
1511 case 68:
1512 YY_RULE_SETUP
1513 #line 185 "config-lexer.l"
1514 { return SECONDS; }
1515 YY_BREAK
1516 case 69:
1517 YY_RULE_SETUP
1518 #line 187 "config-lexer.l"
1519 { return BYTES; }
1520 YY_BREAK
1521 case 70:
1522 YY_RULE_SETUP
1523 #line 188 "config-lexer.l"
1524 { return BYTES; }
1525 YY_BREAK
1526 case 71:
1527 YY_RULE_SETUP
1528 #line 189 "config-lexer.l"
1529 { return KBYTES; }
1530 YY_BREAK
1531 case 72:
1532 YY_RULE_SETUP
1533 #line 190 "config-lexer.l"
1534 { return KBYTES; }
1535 YY_BREAK
1536 case 73:
1537 YY_RULE_SETUP
1538 #line 191 "config-lexer.l"
1539 { return KBYTES; }
1540 YY_BREAK
1541 case 74:
1542 YY_RULE_SETUP
1543 #line 192 "config-lexer.l"
1544 { return KBYTES; }
1545 YY_BREAK
1546 case 75:
1547 YY_RULE_SETUP
1548 #line 193 "config-lexer.l"
1549 { return KBYTES; }
1550 YY_BREAK
1551 case 76:
1552 YY_RULE_SETUP
1553 #line 194 "config-lexer.l"
1554 { return MBYTES; }
1555 YY_BREAK
1556 case 77:
1557 YY_RULE_SETUP
1558 #line 195 "config-lexer.l"
1559 { return MBYTES; }
1560 YY_BREAK
1561 case 78:
1562 YY_RULE_SETUP
1563 #line 196 "config-lexer.l"
1564 { return MBYTES; }
1565 YY_BREAK
1566 case 79:
1567 YY_RULE_SETUP
1568 #line 197 "config-lexer.l"
1569 { return MBYTES; }
1570 YY_BREAK
1571 case 80:
1572 YY_RULE_SETUP
1573 #line 198 "config-lexer.l"
1574 { return MBYTES; }
1575 YY_BREAK
1576 case 81:
1577 YY_RULE_SETUP
1578 #line 200 "config-lexer.l"
1579 {
1580 yylval.number = OPM_TYPE_HTTP;
1581 return PROTOCOLTYPE;
1582 }
1583 YY_BREAK
1584 case 82:
1585 YY_RULE_SETUP
1586 #line 205 "config-lexer.l"
1587 {
1588 yylval.number = OPM_TYPE_HTTPPOST;
1589 return PROTOCOLTYPE;
1590 }
1591 YY_BREAK
1592 case 83:
1593 YY_RULE_SETUP
1594 #line 210 "config-lexer.l"
1595 {
1596 yylval.number = OPM_TYPE_HTTPS;
1597 return PROTOCOLTYPE;
1598 }
1599 YY_BREAK
1600 case 84:
1601 YY_RULE_SETUP
1602 #line 215 "config-lexer.l"
1603 {
1604 yylval.number = OPM_TYPE_HTTPSPOST;
1605 return PROTOCOLTYPE;
1606 }
1607 YY_BREAK
1608 case 85:
1609 YY_RULE_SETUP
1610 #line 220 "config-lexer.l"
1611 {
1612 yylval.number = OPM_TYPE_SOCKS4;
1613 return PROTOCOLTYPE;
1614 }
1615 YY_BREAK
1616 case 86:
1617 YY_RULE_SETUP
1618 #line 225 "config-lexer.l"
1619 {
1620 yylval.number = OPM_TYPE_SOCKS5;
1621 return PROTOCOLTYPE;
1622 }
1623 YY_BREAK
1624 case 87:
1625 YY_RULE_SETUP
1626 #line 230 "config-lexer.l"
1627 {
1628 yylval.number = OPM_TYPE_WINGATE;
1629 return PROTOCOLTYPE;
1630 }
1631 YY_BREAK
1632 case 88:
1633 YY_RULE_SETUP
1634 #line 235 "config-lexer.l"
1635 {
1636 yylval.number = OPM_TYPE_ROUTER;
1637 return PROTOCOLTYPE;
1638 }
1639 YY_BREAK
1640 case 89:
1641 YY_RULE_SETUP
1642 #line 240 "config-lexer.l"
1643 {
1644 yylval.number = OPM_TYPE_DREAMBOX;
1645 return PROTOCOLTYPE;
1646 }
1647 YY_BREAK
1648 case 90:
1649 YY_RULE_SETUP
1650 #line 247 "config-lexer.l"
1651 {
1652 yylval.number=atoi(yytext);
1653 return NUMBER;
1654 }
1655 YY_BREAK
1656 case 91:
1657 YY_RULE_SETUP
1658 #line 256 "config-lexer.l"
1659 {
1660 yylval.number=1;
1661 return NUMBER;
1662 }
1663 YY_BREAK
1664 case 92:
1665 YY_RULE_SETUP
1666 #line 260 "config-lexer.l"
1667 {
1668 yylval.number=1;
1669 return NUMBER;
1670 }
1671 YY_BREAK
1672 case 93:
1673 YY_RULE_SETUP
1674 #line 264 "config-lexer.l"
1675 {
1676 yylval.number=1;
1677 return NUMBER;
1678 }
1679 YY_BREAK
1680 case 94:
1681 YY_RULE_SETUP
1682 #line 271 "config-lexer.l"
1683 {
1684 yylval.number=0;
1685 return NUMBER;
1686 }
1687 YY_BREAK
1688 case 95:
1689 YY_RULE_SETUP
1690 #line 276 "config-lexer.l"
1691 {
1692 yylval.number=0;
1693 return NUMBER;
1694 }
1695 YY_BREAK
1696 case 96:
1697 YY_RULE_SETUP
1698 #line 281 "config-lexer.l"
1699 {
1700 yylval.number=0;
1701 return NUMBER;
1702 }
1703 YY_BREAK
1704 case 97:
1705 /* rule 97 can match eol */
1706 YY_RULE_SETUP
1707 #line 287 "config-lexer.l"
1708 {
1709 strlcpy(linebuf, yytext + 1, sizeof(linebuf));
1710 ++lineno;
1711 yyless(1);
1712 }
1713 YY_BREAK
1714 case 98:
1715 YY_RULE_SETUP
1716 #line 293 "config-lexer.l"
1717 /* ignore whitespace */;
1718 YY_BREAK
1719 case 99:
1720 YY_RULE_SETUP
1721 #line 295 "config-lexer.l"
1722 return yytext[0];
1723 YY_BREAK
1724 case YY_STATE_EOF(INITIAL):
1725 #line 296 "config-lexer.l"
1726 { if (conf_eof()) yyterminate(); }
1727 YY_BREAK
1728 case 100:
1729 YY_RULE_SETUP
1730 #line 298 "config-lexer.l"
1731 ECHO;
1732 YY_BREAK
1733 #line 1734 "config-lexer.c"
1734
1735 case YY_END_OF_BUFFER:
1736 {
1737 /* Amount of text matched not including the EOB char. */
1738 int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
1739
1740 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1741 *yy_cp = (yy_hold_char);
1742 YY_RESTORE_YY_MORE_OFFSET
1743
1744 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
1745 {
1746 /* We're scanning a new file or input source. It's
1747 * possible that this happened because the user
1748 * just pointed yyin at a new source and called
1749 * yylex(). If so, then we have to assure
1750 * consistency between YY_CURRENT_BUFFER and our
1751 * globals. Here is the right place to do so, because
1752 * this is the first action (other than possibly a
1753 * back-up) that will match for the new input source.
1754 */
1755 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1756 YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
1757 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
1758 }
1759
1760 /* Note that here we test for yy_c_buf_p "<=" to the position
1761 * of the first EOB in the buffer, since yy_c_buf_p will
1762 * already have been incremented past the NUL character
1763 * (since all states make transitions on EOB to the
1764 * end-of-buffer state). Contrast this with the test
1765 * in input().
1766 */
1767 if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1768 { /* This was really a NUL. */
1769 yy_state_type yy_next_state;
1770
1771 (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
1772
1773 yy_current_state = yy_get_previous_state( );
1774
1775 /* Okay, we're now positioned to make the NUL
1776 * transition. We couldn't have
1777 * yy_get_previous_state() go ahead and do it
1778 * for us because it doesn't know how to deal
1779 * with the possibility of jamming (and we don't
1780 * want to build jamming into it because then it
1781 * will run more slowly).
1782 */
1783
1784 yy_next_state = yy_try_NUL_trans( yy_current_state );
1785
1786 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1787
1788 if ( yy_next_state )
1789 {
1790 /* Consume the NUL. */
1791 yy_cp = ++(yy_c_buf_p);
1792 yy_current_state = yy_next_state;
1793 goto yy_match;
1794 }
1795
1796 else
1797 {
1798 yy_cp = (yy_last_accepting_cpos);
1799 yy_current_state = (yy_last_accepting_state);
1800 goto yy_find_action;
1801 }
1802 }
1803
1804 else switch ( yy_get_next_buffer( ) )
1805 {
1806 case EOB_ACT_END_OF_FILE:
1807 {
1808 (yy_did_buffer_switch_on_eof) = 0;
1809
1810 if ( yywrap( ) )
1811 {
1812 /* Note: because we've taken care in
1813 * yy_get_next_buffer() to have set up
1814 * yytext, we can now set up
1815 * yy_c_buf_p so that if some total
1816 * hoser (like flex itself) wants to
1817 * call the scanner after we return the
1818 * YY_NULL, it'll still work - another
1819 * YY_NULL will get returned.
1820 */
1821 (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
1822
1823 yy_act = YY_STATE_EOF(YY_START);
1824 goto do_action;
1825 }
1826
1827 else
1828 {
1829 if ( ! (yy_did_buffer_switch_on_eof) )
1830 YY_NEW_FILE;
1831 }
1832 break;
1833 }
1834
1835 case EOB_ACT_CONTINUE_SCAN:
1836 (yy_c_buf_p) =
1837 (yytext_ptr) + yy_amount_of_matched_text;
1838
1839 yy_current_state = yy_get_previous_state( );
1840
1841 yy_cp = (yy_c_buf_p);
1842 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1843 goto yy_match;
1844
1845 case EOB_ACT_LAST_MATCH:
1846 (yy_c_buf_p) =
1847 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
1848
1849 yy_current_state = yy_get_previous_state( );
1850
1851 yy_cp = (yy_c_buf_p);
1852 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1853 goto yy_find_action;
1854 }
1855 break;
1856 }
1857
1858 default:
1859 YY_FATAL_ERROR(
1860 "fatal flex scanner internal error--no action found" );
1861 } /* end of action switch */
1862 } /* end of scanning one token */
1863 } /* end of user's declarations */
1864 } /* end of yylex */
1865
1866 /* yy_get_next_buffer - try to read in a new buffer
1867 *
1868 * Returns a code representing an action:
1869 * EOB_ACT_LAST_MATCH -
1870 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1871 * EOB_ACT_END_OF_FILE - end of file
1872 */
1873 static int yy_get_next_buffer (void)
1874 {
1875 char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1876 char *source = (yytext_ptr);
1877 yy_size_t number_to_move, i;
1878 int ret_val;
1879
1880 if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
1881 YY_FATAL_ERROR(
1882 "fatal flex scanner internal error--end of buffer missed" );
1883
1884 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1885 { /* Don't try to fill the buffer, so this is an EOF. */
1886 if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
1887 {
1888 /* We matched a single character, the EOB, so
1889 * treat this as a final EOF.
1890 */
1891 return EOB_ACT_END_OF_FILE;
1892 }
1893
1894 else
1895 {
1896 /* We matched some text prior to the EOB, first
1897 * process it.
1898 */
1899 return EOB_ACT_LAST_MATCH;
1900 }
1901 }
1902
1903 /* Try to read more data. */
1904
1905 /* First move last chars to start of buffer. */
1906 number_to_move = (yy_size_t) ((yy_c_buf_p) - (yytext_ptr)) - 1;
1907
1908 for ( i = 0; i < number_to_move; ++i )
1909 *(dest++) = *(source++);
1910
1911 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1912 /* don't do the read, it's not guaranteed to return an EOF,
1913 * just force an EOF
1914 */
1915 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1916
1917 else
1918 {
1919 int num_to_read =
1920 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1921
1922 while ( num_to_read <= 0 )
1923 { /* Not enough room in the buffer - grow it. */
1924
1925 /* just a shorter name for the current buffer */
1926 YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
1927
1928 int yy_c_buf_p_offset =
1929 (int) ((yy_c_buf_p) - b->yy_ch_buf);
1930
1931 if ( b->yy_is_our_buffer )
1932 {
1933 int new_size = b->yy_buf_size * 2;
1934
1935 if ( new_size <= 0 )
1936 b->yy_buf_size += b->yy_buf_size / 8;
1937 else
1938 b->yy_buf_size *= 2;
1939
1940 b->yy_ch_buf = (char *)
1941 /* Include room in for 2 EOB chars. */
1942 yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 );
1943 }
1944 else
1945 /* Can't grow it, we don't own it. */
1946 b->yy_ch_buf = NULL;
1947
1948 if ( ! b->yy_ch_buf )
1949 YY_FATAL_ERROR(
1950 "fatal error - scanner input buffer overflow" );
1951
1952 (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
1953
1954 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1955 number_to_move - 1;
1956
1957 }
1958
1959 if ( num_to_read > YY_READ_BUF_SIZE )
1960 num_to_read = YY_READ_BUF_SIZE;
1961
1962 /* Read in more data. */
1963 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1964 (yy_n_chars), num_to_read );
1965
1966 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1967 }
1968
1969 if ( (yy_n_chars) == 0 )
1970 {
1971 if ( number_to_move == YY_MORE_ADJ )
1972 {
1973 ret_val = EOB_ACT_END_OF_FILE;
1974 yyrestart(yyin );
1975 }
1976
1977 else
1978 {
1979 ret_val = EOB_ACT_LAST_MATCH;
1980 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1981 YY_BUFFER_EOF_PENDING;
1982 }
1983 }
1984
1985 else
1986 ret_val = EOB_ACT_CONTINUE_SCAN;
1987
1988 if ((int) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1989 /* Extend the array by 50%, plus the number we really need. */
1990 int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
1991 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size );
1992 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1993 YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1994 }
1995
1996 (yy_n_chars) += number_to_move;
1997 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
1998 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
1999
2000 (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
2001
2002 return ret_val;
2003 }
2004
2005 /* yy_get_previous_state - get the state just before the EOB char was reached */
2006
2007 static yy_state_type yy_get_previous_state (void)
2008 {
2009 yy_state_type yy_current_state;
2010 char *yy_cp;
2011
2012 yy_current_state = (yy_start);
2013
2014 for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
2015 {
2016 YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
2017 if ( yy_accept[yy_current_state] )
2018 {
2019 (yy_last_accepting_state) = yy_current_state;
2020 (yy_last_accepting_cpos) = yy_cp;
2021 }
2022 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
2023 {
2024 yy_current_state = (int) yy_def[yy_current_state];
2025 if ( yy_current_state >= 429 )
2026 yy_c = yy_meta[(unsigned int) yy_c];
2027 }
2028 yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c];
2029 }
2030
2031 return yy_current_state;
2032 }
2033
2034 /* yy_try_NUL_trans - try to make a transition on the NUL character
2035 *
2036 * synopsis
2037 * next_state = yy_try_NUL_trans( current_state );
2038 */
2039 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
2040 {
2041 int yy_is_jam;
2042 char *yy_cp = (yy_c_buf_p);
2043
2044 YY_CHAR yy_c = 1;
2045 if ( yy_accept[yy_current_state] )
2046 {
2047 (yy_last_accepting_state) = yy_current_state;
2048 (yy_last_accepting_cpos) = yy_cp;
2049 }
2050 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
2051 {
2052 yy_current_state = (int) yy_def[yy_current_state];
2053 if ( yy_current_state >= 429 )
2054 yy_c = yy_meta[(unsigned int) yy_c];
2055 }
2056 yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c];
2057 yy_is_jam = (yy_current_state == 428);
2058
2059 return yy_is_jam ? 0 : yy_current_state;
2060 }
2061
2062 #ifndef YY_NO_UNPUT
2063
2064 #endif
2065
2066 #ifndef YY_NO_INPUT
2067 #ifdef __cplusplus
2068 static int yyinput (void)
2069 #else
2070 static int input (void)
2071 #endif
2072
2073 {
2074 int c;
2075
2076 *(yy_c_buf_p) = (yy_hold_char);
2077
2078 if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
2079 {
2080 /* yy_c_buf_p now points to the character we want to return.
2081 * If this occurs *before* the EOB characters, then it's a
2082 * valid NUL; if not, then we've hit the end of the buffer.
2083 */
2084 if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
2085 /* This was really a NUL. */
2086 *(yy_c_buf_p) = '\0';
2087
2088 else
2089 { /* need more input */
2090 int offset = (yy_c_buf_p) - (yytext_ptr);
2091 ++(yy_c_buf_p);
2092
2093 switch ( yy_get_next_buffer( ) )
2094 {
2095 case EOB_ACT_LAST_MATCH:
2096 /* This happens because yy_g_n_b()
2097 * sees that we've accumulated a
2098 * token and flags that we need to
2099 * try matching the token before
2100 * proceeding. But for input(),
2101 * there's no matching to consider.
2102 * So convert the EOB_ACT_LAST_MATCH
2103 * to EOB_ACT_END_OF_FILE.
2104 */
2105
2106 /* Reset buffer status. */
2107 yyrestart(yyin );
2108
2109 /*FALLTHROUGH*/
2110
2111 case EOB_ACT_END_OF_FILE:
2112 {
2113 if ( yywrap( ) )
2114 return 0;
2115
2116 if ( ! (yy_did_buffer_switch_on_eof) )
2117 YY_NEW_FILE;
2118 #ifdef __cplusplus
2119 return yyinput();
2120 #else
2121 return input();
2122 #endif
2123 }
2124
2125 case EOB_ACT_CONTINUE_SCAN:
2126 (yy_c_buf_p) = (yytext_ptr) + offset;
2127 break;
2128 }
2129 }
2130 }
2131
2132 c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
2133 *(yy_c_buf_p) = '\0'; /* preserve yytext */
2134 (yy_hold_char) = *++(yy_c_buf_p);
2135
2136 return c;
2137 }
2138 #endif /* ifndef YY_NO_INPUT */
2139
2140 /** Immediately switch to a different input stream.
2141 * @param input_file A readable stream.
2142 *
2143 * @note This function does not reset the start condition to @c INITIAL .
2144 */
2145 void yyrestart (FILE * input_file )
2146 {
2147
2148 if ( ! YY_CURRENT_BUFFER ){
2149 yyensure_buffer_stack ();
2150 YY_CURRENT_BUFFER_LVALUE =
2151 yy_create_buffer(yyin,YY_BUF_SIZE );
2152 }
2153
2154 yy_init_buffer(YY_CURRENT_BUFFER,input_file );
2155 yy_load_buffer_state( );
2156 }
2157
2158 /** Switch to a different input buffer.
2159 * @param new_buffer The new input buffer.
2160 *
2161 */
2162 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer )
2163 {
2164
2165 /* TODO. We should be able to replace this entire function body
2166 * with
2167 * yypop_buffer_state();
2168 * yypush_buffer_state(new_buffer);
2169 */
2170 yyensure_buffer_stack ();
2171 if ( YY_CURRENT_BUFFER == new_buffer )
2172 return;
2173
2174 if ( YY_CURRENT_BUFFER )
2175 {
2176 /* Flush out information for old buffer. */
2177 *(yy_c_buf_p) = (yy_hold_char);
2178 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
2179 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
2180 }
2181
2182 YY_CURRENT_BUFFER_LVALUE = new_buffer;
2183 yy_load_buffer_state( );
2184
2185 /* We don't actually know whether we did this switch during
2186 * EOF (yywrap()) processing, but the only time this flag
2187 * is looked at is after yywrap() is called, so it's safe
2188 * to go ahead and always set it.
2189 */
2190 (yy_did_buffer_switch_on_eof) = 1;
2191 }
2192
2193 static void yy_load_buffer_state (void)
2194 {
2195 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
2196 (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
2197 yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
2198 (yy_hold_char) = *(yy_c_buf_p);
2199 }
2200
2201 /** Allocate and initialize an input buffer state.
2202 * @param file A readable stream.
2203 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
2204 *
2205 * @return the allocated buffer state.
2206 */
2207 YY_BUFFER_STATE yy_create_buffer (FILE * file, int size )
2208 {
2209 YY_BUFFER_STATE b;
2210
2211 b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
2212 if ( ! b )
2213 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
2214
2215 b->yy_buf_size = (yy_size_t)size;
2216
2217 /* yy_ch_buf has to be 2 characters longer than the size given because
2218 * we need to put in 2 end-of-buffer characters.
2219 */
2220 b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 );
2221 if ( ! b->yy_ch_buf )
2222 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
2223
2224 b->yy_is_our_buffer = 1;
2225
2226 yy_init_buffer(b,file );
2227
2228 return b;
2229 }
2230
2231 /** Destroy the buffer.
2232 * @param b a buffer created with yy_create_buffer()
2233 *
2234 */
2235 void yy_delete_buffer (YY_BUFFER_STATE b )
2236 {
2237
2238 if ( ! b )
2239 return;
2240
2241 if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
2242 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
2243
2244 if ( b->yy_is_our_buffer )
2245 yyfree((void *) b->yy_ch_buf );
2246
2247 yyfree((void *) b );
2248 }
2249
2250 /* Initializes or reinitializes a buffer.
2251 * This function is sometimes called more than once on the same buffer,
2252 * such as during a yyrestart() or at EOF.
2253 */
2254 static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file )
2255
2256 {
2257 int oerrno = errno;
2258
2259 yy_flush_buffer(b );
2260
2261 b->yy_input_file = file;
2262 b->yy_fill_buffer = 1;
2263
2264 /* If b is the current buffer, then yy_init_buffer was _probably_
2265 * called from yyrestart() or through yy_get_next_buffer.
2266 * In that case, we don't want to reset the lineno or column.
2267 */
2268 if (b != YY_CURRENT_BUFFER){
2269 b->yy_bs_lineno = 1;
2270 b->yy_bs_column = 0;
2271 }
2272
2273 b->yy_is_interactive = 0;
2274
2275 errno = oerrno;
2276 }
2277
2278 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
2279 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
2280 *
2281 */
2282 void yy_flush_buffer (YY_BUFFER_STATE b )
2283 {
2284 if ( ! b )
2285 return;
2286
2287 b->yy_n_chars = 0;
2288
2289 /* We always need two end-of-buffer characters. The first causes
2290 * a transition to the end-of-buffer state. The second causes
2291 * a jam in that state.
2292 */
2293 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
2294 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
2295
2296 b->yy_buf_pos = &b->yy_ch_buf[0];
2297
2298 b->yy_at_bol = 1;
2299 b->yy_buffer_status = YY_BUFFER_NEW;
2300
2301 if ( b == YY_CURRENT_BUFFER )
2302 yy_load_buffer_state( );
2303 }
2304
2305 /** Pushes the new state onto the stack. The new state becomes
2306 * the current state. This function will allocate the stack
2307 * if necessary.
2308 * @param new_buffer The new state.
2309 *
2310 */
2311 void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
2312 {
2313 if (new_buffer == NULL)
2314 return;
2315
2316 yyensure_buffer_stack();
2317
2318 /* This block is copied from yy_switch_to_buffer. */
2319 if ( YY_CURRENT_BUFFER )
2320 {
2321 /* Flush out information for old buffer. */
2322 *(yy_c_buf_p) = (yy_hold_char);
2323 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
2324 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
2325 }
2326
2327 /* Only push if top exists. Otherwise, replace top. */
2328 if (YY_CURRENT_BUFFER)
2329 (yy_buffer_stack_top)++;
2330 YY_CURRENT_BUFFER_LVALUE = new_buffer;
2331
2332 /* copied from yy_switch_to_buffer. */
2333 yy_load_buffer_state( );
2334 (yy_did_buffer_switch_on_eof) = 1;
2335 }
2336
2337 /** Removes and deletes the top of the stack, if present.
2338 * The next element becomes the new top.
2339 *
2340 */
2341 void yypop_buffer_state (void)
2342 {
2343 if (!YY_CURRENT_BUFFER)
2344 return;
2345
2346 yy_delete_buffer(YY_CURRENT_BUFFER );
2347 YY_CURRENT_BUFFER_LVALUE = NULL;
2348 if ((yy_buffer_stack_top) > 0)
2349 --(yy_buffer_stack_top);
2350
2351 if (YY_CURRENT_BUFFER) {
2352 yy_load_buffer_state( );
2353 (yy_did_buffer_switch_on_eof) = 1;
2354 }
2355 }
2356
2357 /* Allocates the stack if it does not exist.
2358 * Guarantees space for at least one push.
2359 */
2360 static void yyensure_buffer_stack (void)
2361 {
2362 int num_to_alloc;
2363
2364 if (!(yy_buffer_stack)) {
2365
2366 /* First allocation is just for 2 elements, since we don't know if this
2367 * scanner will even need a stack. We use 2 instead of 1 to avoid an
2368 * immediate realloc on the next call.
2369 */
2370 num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */
2371 (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
2372 (num_to_alloc * sizeof(struct yy_buffer_state*)
2373 );
2374 if ( ! (yy_buffer_stack) )
2375 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
2376
2377 memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
2378
2379 (yy_buffer_stack_max) = num_to_alloc;
2380 (yy_buffer_stack_top) = 0;
2381 return;
2382 }
2383
2384 if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
2385
2386 /* Increase the buffer to prepare for a possible push. */
2387 yy_size_t grow_size = 8 /* arbitrary grow size */;
2388
2389 num_to_alloc = (yy_buffer_stack_max) + grow_size;
2390 (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
2391 ((yy_buffer_stack),
2392 num_to_alloc * sizeof(struct yy_buffer_state*)
2393 );
2394 if ( ! (yy_buffer_stack) )
2395 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
2396
2397 /* zero only the new slots.*/
2398 memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
2399 (yy_buffer_stack_max) = num_to_alloc;
2400 }
2401 }
2402
2403 /** Setup the input buffer state to scan directly from a user-specified character buffer.
2404 * @param base the character buffer
2405 * @param size the size in bytes of the character buffer
2406 *
2407 * @return the newly allocated buffer state object.
2408 */
2409 YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size )
2410 {
2411 YY_BUFFER_STATE b;
2412
2413 if ( size < 2 ||
2414 base[size-2] != YY_END_OF_BUFFER_CHAR ||
2415 base[size-1] != YY_END_OF_BUFFER_CHAR )
2416 /* They forgot to leave room for the EOB's. */
2417 return NULL;
2418
2419 b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
2420 if ( ! b )
2421 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
2422
2423 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
2424 b->yy_buf_pos = b->yy_ch_buf = base;
2425 b->yy_is_our_buffer = 0;
2426 b->yy_input_file = NULL;
2427 b->yy_n_chars = b->yy_buf_size;
2428 b->yy_is_interactive = 0;
2429 b->yy_at_bol = 1;
2430 b->yy_fill_buffer = 0;
2431 b->yy_buffer_status = YY_BUFFER_NEW;
2432
2433 yy_switch_to_buffer(b );
2434
2435 return b;
2436 }
2437
2438 /** Setup the input buffer state to scan a string. The next call to yylex() will
2439 * scan from a @e copy of @a str.
2440 * @param yystr a NUL-terminated string to scan
2441 *
2442 * @return the newly allocated buffer state object.
2443 * @note If you want to scan bytes that may contain NUL values, then use
2444 * yy_scan_bytes() instead.
2445 */
2446 YY_BUFFER_STATE yy_scan_string (yyconst char * yystr )
2447 {
2448
2449 return yy_scan_bytes(yystr,(int) strlen(yystr) );
2450 }
2451
2452 /** Setup the input buffer state to scan the given bytes. The next call to yylex() will
2453 * scan from a @e copy of @a bytes.
2454 * @param yybytes the byte buffer to scan
2455 * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
2456 *
2457 * @return the newly allocated buffer state object.
2458 */
2459 YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, int _yybytes_len )
2460 {
2461 YY_BUFFER_STATE b;
2462 char *buf;
2463 yy_size_t n;
2464 yy_size_t i;
2465
2466 /* Get memory for full buffer, including space for trailing EOB's. */
2467 n = (yy_size_t) _yybytes_len + 2;
2468 buf = (char *) yyalloc(n );
2469 if ( ! buf )
2470 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
2471
2472 for ( i = 0; i < _yybytes_len; ++i )
2473 buf[i] = yybytes[i];
2474
2475 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
2476
2477 b = yy_scan_buffer(buf,n );
2478 if ( ! b )
2479 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
2480
2481 /* It's okay to grow etc. this buffer, and we should throw it
2482 * away when we're done.
2483 */
2484 b->yy_is_our_buffer = 1;
2485
2486 return b;
2487 }
2488
2489 #ifndef YY_EXIT_FAILURE
2490 #define YY_EXIT_FAILURE 2
2491 #endif
2492
2493 static void yynoreturn yy_fatal_error (yyconst char* msg )
2494 {
2495 (void) fprintf( stderr, "%s\n", msg );
2496 exit( YY_EXIT_FAILURE );
2497 }
2498
2499 /* Redefine yyless() so it works in section 3 code. */
2500
2501 #undef yyless
2502 #define yyless(n) \
2503 do \
2504 { \
2505 /* Undo effects of setting up yytext. */ \
2506 int yyless_macro_arg = (n); \
2507 YY_LESS_LINENO(yyless_macro_arg);\
2508 yytext[yyleng] = (yy_hold_char); \
2509 (yy_c_buf_p) = yytext + yyless_macro_arg; \
2510 (yy_hold_char) = *(yy_c_buf_p); \
2511 *(yy_c_buf_p) = '\0'; \
2512 yyleng = yyless_macro_arg; \
2513 } \
2514 while ( 0 )
2515
2516 /* Accessor methods (get/set functions) to struct members. */
2517
2518 /** Get the current line number.
2519 *
2520 */
2521 int yyget_lineno (void)
2522 {
2523
2524 return yylineno;
2525 }
2526
2527 /** Get the input stream.
2528 *
2529 */
2530 FILE *yyget_in (void)
2531 {
2532 return yyin;
2533 }
2534
2535 /** Get the output stream.
2536 *
2537 */
2538 FILE *yyget_out (void)
2539 {
2540 return yyout;
2541 }
2542
2543 /** Get the length of the current token.
2544 *
2545 */
2546 int yyget_leng (void)
2547 {
2548 return yyleng;
2549 }
2550
2551 /** Get the current token.
2552 *
2553 */
2554
2555 char *yyget_text (void)
2556 {
2557 return yytext;
2558 }
2559
2560 /** Set the current line number.
2561 * @param _line_number line number
2562 *
2563 */
2564 void yyset_lineno (int _line_number )
2565 {
2566
2567 yylineno = _line_number;
2568 }
2569
2570 /** Set the input stream. This does not discard the current
2571 * input buffer.
2572 * @param _in_str A readable stream.
2573 *
2574 * @see yy_switch_to_buffer
2575 */
2576 void yyset_in (FILE * _in_str )
2577 {
2578 yyin = _in_str ;
2579 }
2580
2581 void yyset_out (FILE * _out_str )
2582 {
2583 yyout = _out_str ;
2584 }
2585
2586 int yyget_debug (void)
2587 {
2588 return yy_flex_debug;
2589 }
2590
2591 void yyset_debug (int _bdebug )
2592 {
2593 yy_flex_debug = _bdebug ;
2594 }
2595
2596 static int yy_init_globals (void)
2597 {
2598 /* Initialization is the same as for the non-reentrant scanner.
2599 * This function is called from yylex_destroy(), so don't allocate here.
2600 */
2601
2602 (yy_buffer_stack) = NULL;
2603 (yy_buffer_stack_top) = 0;
2604 (yy_buffer_stack_max) = 0;
2605 (yy_c_buf_p) = NULL;
2606 (yy_init) = 0;
2607 (yy_start) = 0;
2608
2609 /* Defined in main.c */
2610 #ifdef YY_STDINIT
2611 yyin = stdin;
2612 yyout = stdout;
2613 #else
2614 yyin = NULL;
2615 yyout = NULL;
2616 #endif
2617
2618 /* For future reference: Set errno on error, since we are called by
2619 * yylex_init()
2620 */
2621 return 0;
2622 }
2623
2624 /* yylex_destroy is for both reentrant and non-reentrant scanners. */
2625 int yylex_destroy (void)
2626 {
2627
2628 /* Pop the buffer stack, destroying each element. */
2629 while(YY_CURRENT_BUFFER){
2630 yy_delete_buffer(YY_CURRENT_BUFFER );
2631 YY_CURRENT_BUFFER_LVALUE = NULL;
2632 yypop_buffer_state();
2633 }
2634
2635 /* Destroy the stack itself. */
2636 yyfree((yy_buffer_stack) );
2637 (yy_buffer_stack) = NULL;
2638
2639 /* Reset the globals. This is important in a non-reentrant scanner so the next time
2640 * yylex() is called, initialization will occur. */
2641 yy_init_globals( );
2642
2643 return 0;
2644 }
2645
2646 /*
2647 * Internal utility routines.
2648 */
2649
2650 #ifndef yytext_ptr
2651 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
2652 {
2653
2654 int i;
2655 for ( i = 0; i < n; ++i )
2656 s1[i] = s2[i];
2657 }
2658 #endif
2659
2660 #ifdef YY_NEED_STRLEN
2661 static int yy_flex_strlen (yyconst char * s )
2662 {
2663 int n;
2664 for ( n = 0; s[n]; ++n )
2665 ;
2666
2667 return n;
2668 }
2669 #endif
2670
2671 void *yyalloc (yy_size_t size )
2672 {
2673 return malloc(size);
2674 }
2675
2676 void *yyrealloc (void * ptr, yy_size_t size )
2677 {
2678
2679 /* The cast to (char *) in the following accommodates both
2680 * implementations that use char* generic pointers, and those
2681 * that use void* generic pointers. It works with the latter
2682 * because both ANSI C and C++ allow castless assignment from
2683 * any pointer type to void*, and deal with argument conversions
2684 * as though doing an assignment.
2685 */
2686 return realloc(ptr, size);
2687 }
2688
2689 void yyfree (void * ptr )
2690 {
2691 free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
2692 }
2693
2694 #define YYTABLES_NAME "yytables"
2695
2696 #line 298 "config-lexer.l"
2697
2698
2699
2700
2701 /* C-comment ignoring routine -kre*/
2702 static void
2703 ccomment(void)
2704 {
2705 int c = 0;
2706
2707 /* log(L_NOTICE, "got comment"); */
2708 while (1)
2709 {
2710 while ((c = input()) != '*' && c != EOF)
2711 if (c == '\n')
2712 ++lineno;
2713
2714 if (c == '*')
2715 {
2716 while ((c = input()) == '*')
2717 /* Nothing */ ;
2718 if (c == '/')
2719 break;
2720 else if (c == '\n')
2721 ++lineno;
2722 }
2723
2724 if (c == EOF)
2725 {
2726 YY_FATAL_ERROR("EOF in comment");
2727
2728 /* XXX hack alert this disables
2729 * the stupid unused function warning
2730 * gcc generates
2731 */
2732 if (1 == 0)
2733 yy_fatal_error("EOF in comment");
2734 break;
2735 }
2736 }
2737 }
2738
2739 static void
2740 conf_include(void)
2741 {
2742 char *p = NULL;
2743 char filenamebuf[512];
2744
2745 if ((p = strchr(yytext, '<')) == NULL)
2746 *strchr(p = strchr(yytext, '"') + 1, '"') = '\0';
2747 else
2748 *strchr(++p, '>') = '\0';
2749
2750 /* do stacking and co. */
2751 if (include_stack_ptr >= MAX_INCLUDE_DEPTH)
2752 {
2753 log_printf("CONFIG -> Includes nested too deep in %s", p);
2754 return;
2755 }
2756
2757 if (*p == '/') /* if it is an absolute path */
2758 snprintf(filenamebuf, sizeof(filenamebuf), "%s", p);
2759 else
2760 snprintf(filenamebuf, sizeof(filenamebuf), "%s/%s", HOPM_ETCDIR, p);
2761
2762 FILE *tmp_fbfile_in = fopen(filenamebuf, "r");
2763 if (!tmp_fbfile_in)
2764 {
2765 log_printf("CONFIG -> Unable to read configuration file '%s': %s",
2766 filenamebuf, strerror(errno));
2767 return;
2768 }
2769
2770 struct included_file *file = &include_stack[include_stack_ptr++];
2771 file->lineno = lineno;
2772 file->file = conf_file;
2773 file->state = YY_CURRENT_BUFFER;
2774 strlcpy(file->conffile, conffilebuf, sizeof(file->conffile));
2775
2776 lineno = 1;
2777 conf_file = tmp_fbfile_in;
2778
2779 snprintf(conffilebuf, sizeof(conffilebuf), "%s", filenamebuf);
2780 yy_switch_to_buffer(yy_create_buffer(yyin,YY_BUF_SIZE));
2781 }
2782
2783 static int
2784 conf_eof(void)
2785 {
2786 if (include_stack_ptr == 0)
2787 {
2788 lineno = 1;
2789 return 1;
2790 }
2791
2792 /* switch buffer */
2793 struct included_file *file = &include_stack[--include_stack_ptr];
2794
2795 /* close current file */
2796 fclose(conf_file);
2797
2798 /* switch buffers */
2799 yy_delete_buffer(YY_CURRENT_BUFFER);
2800 yy_switch_to_buffer(file->state);
2801
2802 /* switch lineno */
2803 lineno = file->lineno;
2804
2805 /* switch file */
2806 conf_file = file->file;
2807
2808 strlcpy(conffilebuf, file->conffile, sizeof(conffilebuf));
2809 return 0;
2810 }
2811

Properties

Name Value
svn:eol-style native
svn:keywords Id