Revision 2b5ca73a

View differences:

.gitignore
1
CMakeLists.txt
2
bird-2.0.1/cmake-build-debug 
3

  
4
*/.idea
5

  
1 6
*.log
7
*.d
8
*.o
2 9

  
3 10
obj/conf/cf-parse.tab.h 
4 11
obj/conf/cf-parse.tab.c 
bird-2.0.1/obj/conf/cf-lex.c
1
#line 2 "obj/conf/cf-lex.c"
2

  
3
#line 4 "obj/conf/cf-lex.c"
4

  
5
#define  YY_INT_ALIGNED short int
6

  
7
/* A lexical scanner generated by flex */
8

  
9
#define yy_create_buffer cf__create_buffer
10
#define yy_delete_buffer cf__delete_buffer
11
#define yy_flex_debug cf__flex_debug
12
#define yy_init_buffer cf__init_buffer
13
#define yy_flush_buffer cf__flush_buffer
14
#define yy_load_buffer_state cf__load_buffer_state
15
#define yy_switch_to_buffer cf__switch_to_buffer
16
#define yyin cf_in
17
#define yyleng cf_leng
18
#define yylex cf_lex
19
#define yylineno cf_lineno
20
#define yyout cf_out
21
#define yyrestart cf_restart
22
#define yytext cf_text
23
#define yywrap cf_wrap
24
#define yyalloc cf_alloc
25
#define yyrealloc cf_realloc
26
#define yyfree cf_free
27

  
28
#define FLEX_SCANNER
29
#define YY_FLEX_MAJOR_VERSION 2
30
#define YY_FLEX_MINOR_VERSION 6
31
#define YY_FLEX_SUBMINOR_VERSION 1
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
/* TODO: this is always defined, so inline it */
111
#define yyconst const
112

  
113
#if defined(__GNUC__) && __GNUC__ >= 3
114
#define yynoreturn __attribute__((__noreturn__))
115
#else
116
#define yynoreturn
117
#endif
118

  
119
/* Returned upon end-of-file. */
120
#define YY_NULL 0
121

  
122
/* Promotes a possibly negative, possibly signed char to an unsigned
123
 * integer for use as an array index.  If the signed char is negative,
124
 * we want to instead treat it as an 8-bit unsigned char, hence the
125
 * double cast.
126
 */
127
#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
128

  
129
/* Enter a start condition.  This macro really ought to take a parameter,
130
 * but we do it the disgusting crufty way forced on us by the ()-less
131
 * definition of BEGIN.
132
 */
133
#define BEGIN (yy_start) = 1 + 2 *
134

  
135
/* Translate the current start state into a value that can be later handed
136
 * to BEGIN to return to the state.  The YYSTATE alias is for lex
137
 * compatibility.
138
 */
139
#define YY_START (((yy_start) - 1) / 2)
140
#define YYSTATE YY_START
141

  
142
/* Action number for EOF rule of a given start state. */
143
#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
144

  
145
/* Special action meaning "start processing a new file". */
146
#define YY_NEW_FILE cf_restart(cf_in  )
147

  
148
#define YY_END_OF_BUFFER_CHAR 0
149

  
150
/* Size of default input buffer. */
151
#ifndef YY_BUF_SIZE
152
#ifdef __ia64__
153
/* On IA-64, the buffer size is 16k, not 8k.
154
 * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
155
 * Ditto for the __ia64__ case accordingly.
156
 */
157
#define YY_BUF_SIZE 32768
158
#else
159
#define YY_BUF_SIZE 16384
160
#endif /* __ia64__ */
161
#endif
162

  
163
/* The state buf must be large enough to hold one state per character in the main buffer.
164
 */
165
#define YY_STATE_BUF_SIZE   ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
166

  
167
#ifndef YY_TYPEDEF_YY_BUFFER_STATE
168
#define YY_TYPEDEF_YY_BUFFER_STATE
169
typedef struct yy_buffer_state *YY_BUFFER_STATE;
170
#endif
171

  
172
#ifndef YY_TYPEDEF_YY_SIZE_T
173
#define YY_TYPEDEF_YY_SIZE_T
174
typedef size_t yy_size_t;
175
#endif
176

  
177
extern int cf_leng;
178

  
179
extern FILE *cf_in, *cf_out;
180

  
181
#define EOB_ACT_CONTINUE_SCAN 0
182
#define EOB_ACT_END_OF_FILE 1
183
#define EOB_ACT_LAST_MATCH 2
184

  
185
    #define YY_LESS_LINENO(n)
186
    #define YY_LINENO_REWIND_TO(ptr)
187
    
188
/* Return all but the first "n" matched characters back to the input stream. */
189
#define yyless(n) \
190
	do \
191
		{ \
192
		/* Undo effects of setting up cf_text. */ \
193
        int yyless_macro_arg = (n); \
194
        YY_LESS_LINENO(yyless_macro_arg);\
195
		*yy_cp = (yy_hold_char); \
196
		YY_RESTORE_YY_MORE_OFFSET \
197
		(yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
198
		YY_DO_BEFORE_ACTION; /* set up cf_text again */ \
199
		} \
200
	while ( 0 )
201

  
202
#define unput(c) yyunput( c, (yytext_ptr)  )
203

  
204
#ifndef YY_STRUCT_YY_BUFFER_STATE
205
#define YY_STRUCT_YY_BUFFER_STATE
206
struct yy_buffer_state
207
	{
208
	FILE *yy_input_file;
209

  
210
	char *yy_ch_buf;		/* input buffer */
211
	char *yy_buf_pos;		/* current position in input buffer */
212

  
213
	/* Size of input buffer in bytes, not including room for EOB
214
	 * characters.
215
	 */
216
	int yy_buf_size;
217

  
218
	/* Number of characters read into yy_ch_buf, not including EOB
219
	 * characters.
220
	 */
221
	int yy_n_chars;
222

  
223
	/* Whether we "own" the buffer - i.e., we know we created it,
224
	 * and can realloc() it to grow it, and should free() it to
225
	 * delete it.
226
	 */
227
	int yy_is_our_buffer;
228

  
229
	/* Whether this is an "interactive" input source; if so, and
230
	 * if we're using stdio for input, then we want to use getc()
231
	 * instead of fread(), to make sure we stop fetching input after
232
	 * each newline.
233
	 */
234
	int yy_is_interactive;
235

  
236
	/* Whether we're considered to be at the beginning of a line.
237
	 * If so, '^' rules will be active on the next match, otherwise
238
	 * not.
239
	 */
240
	int yy_at_bol;
241

  
242
    int yy_bs_lineno; /**< The line count. */
243
    int yy_bs_column; /**< The column count. */
244

  
245
	/* Whether to try to fill the input buffer when we reach the
246
	 * end of it.
247
	 */
248
	int yy_fill_buffer;
249

  
250
	int yy_buffer_status;
251

  
252
#define YY_BUFFER_NEW 0
253
#define YY_BUFFER_NORMAL 1
254
	/* When an EOF's been seen but there's still some text to process
255
	 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
256
	 * shouldn't try reading from the input source any more.  We might
257
	 * still have a bunch of tokens to match, though, because of
258
	 * possible backing-up.
259
	 *
260
	 * When we actually see the EOF, we change the status to "new"
261
	 * (via cf_restart()), so that the user can continue scanning by
262
	 * just pointing cf_in at a new input file.
263
	 */
264
#define YY_BUFFER_EOF_PENDING 2
265

  
266
	};
267
#endif /* !YY_STRUCT_YY_BUFFER_STATE */
268

  
269
/* Stack of input buffers. */
270
static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
271
static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
272
static YY_BUFFER_STATE * yy_buffer_stack = NULL; /**< Stack as an array. */
273

  
274
/* We provide macros for accessing buffer states in case in the
275
 * future we want to put the buffer states in a more general
276
 * "scanner state".
277
 *
278
 * Returns the top of the stack, or NULL.
279
 */
280
#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
281
                          ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
282
                          : NULL)
283

  
284
/* Same as previous macro, but useful when we know that the buffer stack is not
285
 * NULL or when we need an lvalue. For internal use only.
286
 */
287
#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
288

  
289
/* yy_hold_char holds the character lost when cf_text is formed. */
290
static char yy_hold_char;
291
static int yy_n_chars;		/* number of characters read into yy_ch_buf */
292
int cf_leng;
293

  
294
/* Points to current character in buffer. */
295
static char *yy_c_buf_p = NULL;
296
static int yy_init = 0;		/* whether we need to initialize */
297
static int yy_start = 0;	/* start state number */
298

  
299
/* Flag which is used to allow cf_wrap()'s to do buffer switches
300
 * instead of setting up a fresh cf_in.  A bit of a hack ...
301
 */
302
static int yy_did_buffer_switch_on_eof;
303

  
304
void cf_restart (FILE *input_file  );
305
void cf__switch_to_buffer (YY_BUFFER_STATE new_buffer  );
306
YY_BUFFER_STATE cf__create_buffer (FILE *file,int size  );
307
void cf__delete_buffer (YY_BUFFER_STATE b  );
308
void cf__flush_buffer (YY_BUFFER_STATE b  );
309
void cf_push_buffer_state (YY_BUFFER_STATE new_buffer  );
310
void cf_pop_buffer_state (void );
311

  
312
static void cf_ensure_buffer_stack (void );
313
static void cf__load_buffer_state (void );
314
static void cf__init_buffer (YY_BUFFER_STATE b,FILE *file  );
315

  
316
#define YY_FLUSH_BUFFER cf__flush_buffer(YY_CURRENT_BUFFER )
317

  
318
YY_BUFFER_STATE cf__scan_buffer (char *base,yy_size_t size  );
319
YY_BUFFER_STATE cf__scan_string (yyconst char *yy_str  );
320
YY_BUFFER_STATE cf__scan_bytes (yyconst char *bytes,int len  );
321

  
322
void *cf_alloc (yy_size_t  );
323
void *cf_realloc (void *,yy_size_t  );
324
void cf_free (void *  );
325

  
326
#define yy_new_buffer cf__create_buffer
327

  
328
#define yy_set_interactive(is_interactive) \
329
	{ \
330
	if ( ! YY_CURRENT_BUFFER ){ \
331
        cf_ensure_buffer_stack (); \
332
		YY_CURRENT_BUFFER_LVALUE =    \
333
            cf__create_buffer(cf_in,YY_BUF_SIZE ); \
334
	} \
335
	YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
336
	}
337

  
338
#define yy_set_bol(at_bol) \
339
	{ \
340
	if ( ! YY_CURRENT_BUFFER ){\
341
        cf_ensure_buffer_stack (); \
342
		YY_CURRENT_BUFFER_LVALUE =    \
343
            cf__create_buffer(cf_in,YY_BUF_SIZE ); \
344
	} \
345
	YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
346
	}
347

  
348
#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
349

  
350
/* Begin user sect3 */
351

  
352
#define cf_wrap() (/*CONSTCOND*/1)
353
#define YY_SKIP_YYWRAP
354

  
355
typedef unsigned char YY_CHAR;
356

  
357
FILE *cf_in = NULL, *cf_out = NULL;
358

  
359
typedef int yy_state_type;
360

  
361
extern int cf_lineno;
362

  
363
int cf_lineno = 1;
364

  
365
extern char *cf_text;
366
#ifdef yytext_ptr
367
#undef yytext_ptr
368
#endif
369
#define yytext_ptr cf_text
370

  
371
static yy_state_type yy_get_previous_state (void );
372
static yy_state_type yy_try_NUL_trans (yy_state_type current_state  );
373
static int yy_get_next_buffer (void );
374
static void yynoreturn yy_fatal_error (yyconst char* msg  );
375

  
376
/* Done after the current pattern has been matched and before the
377
 * corresponding action - sets up cf_text.
378
 */
379
#define YY_DO_BEFORE_ACTION \
380
	(yytext_ptr) = yy_bp; \
381
	cf_leng = (int) (yy_cp - yy_bp); \
382
	(yy_hold_char) = *yy_cp; \
383
	*yy_cp = '\0'; \
384
	(yy_c_buf_p) = yy_cp;
385

  
386
#define YY_NUM_RULES 35
387
#define YY_END_OF_BUFFER 36
388
/* This struct is not used in this scanner,
389
   but its presence is necessary. */
390
struct yy_trans_info
391
	{
392
	flex_int32_t yy_verify;
393
	flex_int32_t yy_nxt;
394
	};
395
static yyconst flex_int16_t yy_accept[122] =
396
    {   0,
397
        0,    0,    0,    0,    0,    0,    0,    0,   36,   20,
398
       16,   17,   13,   20,   18,   13,   20,   20,   13,   13,
399
        8,    8,    8,   13,   13,   13,   13,   10,   10,   13,
400
       10,   13,   16,   10,   22,   21,   26,   24,   26,   26,
401
       11,   16,   27,   28,    0,   15,   14,   31,   10,    0,
402
       12,   19,    0,    8,    0,    0,    0,    0,    0,    6,
403
       29,   34,   30,   10,    0,   10,   33,   10,   32,   16,
404
        0,   10,   23,   25,    0,    2,    7,    2,    0,    6,
405
        6,    6,   10,    0,   10,    0,    0,    0,    0,    6,
406
        6,    6,   10,    0,   10,    0,    3,    0,    9,    0,
407

  
408
       10,    0,    0,    0,   10,    5,    0,    0,   10,    0,
409
        0,    0,    0,    0,    4,    6,    0,    0,    0,    1,
410
        0
411
    } ;
412

  
413
static yyconst YY_CHAR yy_ec[256] =
414
    {   0,
415
        1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
416
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
417
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
418
        1,    2,    4,    5,    6,    1,    7,    8,    9,    7,
419
        7,   10,    7,    7,   11,   12,   13,   14,   15,   16,
420
       15,   15,   15,   15,   15,   15,   15,   17,   18,   19,
421
       20,   21,    7,    1,   22,   22,   22,   22,   22,   22,
422
       23,   23,   23,   23,   23,   23,   23,   23,   23,   23,
423
       23,   23,   23,   23,   23,   23,   23,   23,   23,   23,
424
       24,    1,   25,    1,   23,    1,   22,   22,   26,   27,
425

  
426
       28,   22,   23,   23,   29,   23,   23,   30,   23,   31,
427
       23,   23,   23,   23,   32,   23,   33,   23,   23,   34,
428
       23,   23,    7,   35,    7,   36,    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
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
434
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
435
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
436

  
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,    1,    1,    1,    1,    1,
440
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
441
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
442
        1,    1,    1,    1,    1
443
    } ;
444

  
445
static yyconst YY_CHAR yy_meta[37] =
446
    {   0,
447
        1,    1,    2,    1,    1,    1,    1,    1,    3,    1,
448
        3,    3,    1,    4,    4,    4,    5,    1,    1,    1,
449
        1,    4,    6,    1,    1,    4,    4,    4,    6,    6,
450
        6,    6,    6,    6,    1,    1
451
    } ;
452

  
453
static yyconst flex_uint16_t yy_base[133] =
454
    {   0,
455
        0,   35,  259,  258,   35,   36,    0,    0,  260,  263,
456
      257,  263,   20,   38,  263,  263,  250,  248,  244,  245,
457
       53,   25,  220,  236,  232,  226,  230,   74,    0,  229,
458
      218,  212,   42,  215,  263,  263,  263,  263,  232,  234,
459
      263,  241,  263,  263,   47,  263,  263,  263,  263,  233,
460
      263,  263,   39,    0,   46,  220,    0,   58,  213,   95,
461
      263,  263,  263,    0,  179,    0,  263,  163,  263,   49,
462
      163,  167,  263,  263,   70,  175,    0,  174,  173,  177,
463
      110,   78,  160,  161,  156,   99,  114,  166,  104,  160,
464
        0,  119,  143,  115,  107,  127,    0,  132,  263,   83,
465

  
466
       72,  135,  138,   56,   49,  141,  147,   48,   93,  150,
467
      153,  168,  169,   61,  161,  164,   53,  179,  180,   52,
468
      263,  198,  204,  210,  216,  220,  223,  225,  228,   43,
469
      230,  235
470
    } ;
471

  
472
static yyconst flex_int16_t yy_def[133] =
473
    {   0,
474
      121,    1,  122,  122,  123,  123,  124,  124,  121,  121,
475
      121,  121,  121,  125,  121,  121,  121,  126,  121,  121,
476
      121,   21,   21,  127,  121,  121,  121,  121,  128,  121,
477
       28,  121,  121,  128,  121,  121,  121,  121,  121,  121,
478
      121,  121,  121,  121,  125,  121,  121,  121,  121,  126,
479
      121,  121,  121,   22,  127,  129,  130,   55,  127,  121,
480
      121,  121,  121,   28,  127,  128,  121,  128,  121,  121,
481
      121,  128,  121,  121,  121,   55,  130,   58,  131,   60,
482
      121,   60,  128,  121,  128,  121,  131,  131,  121,   81,
483
       81,   81,  128,  121,  128,  121,   87,  121,  121,  121,
484

  
485
      128,  121,  121,  121,  128,  121,  121,  121,  128,  121,
486
      121,  121,  121,  132,  121,  121,  132,  132,  132,  132,
487
        0,  121,  121,  121,  121,  121,  121,  121,  121,  121,
488
      121,  121
489
    } ;
490

  
491
static yyconst flex_uint16_t yy_nxt[300] =
492
    {   0,
493
       10,   11,   12,   13,   14,   15,   16,   17,   18,   16,
494
       16,   19,   20,   21,   22,   23,   24,   16,   25,   26,
495
       27,   28,   29,   30,   16,   28,   28,   31,   29,   29,
496
       29,   29,   29,   29,   32,   16,   33,   38,   38,   43,
497
       46,   58,   47,   70,   39,   39,   77,   40,   40,   46,
498
       70,   47,   75,   75,   75,   44,  118,  118,  121,   76,
499
       76,   76,   60,   34,   53,  118,   54,   54,   54,   55,
500
       71,   78,   78,   78,   56,  112,  109,   71,   56,   56,
501
       56,   86,  108,   75,   75,   75,   57,   64,   64,   64,
502
       65,   82,   82,   82,  113,   64,   66,  114,  105,   64,
503

  
504
       64,   64,   66,   66,   66,   66,   66,   66,   80,   80,
505
       80,   81,   96,   96,   96,  104,   82,   98,   98,   98,
506
       82,   82,   82,   90,   90,   90,   91,   97,   97,   97,
507
       81,   92,   92,   92,   92,   92,   92,   92,  102,  101,
508
       96,   96,   96,  103,  100,   98,   98,   98,  106,  106,
509
      106,  107,  107,  107,  106,  106,  106,  110,  111,   99,
510
      107,  107,  107,  115,  115,  115,  116,  116,  116,  113,
511
      113,   89,  114,  114,  115,  115,  115,  116,  116,  116,
512
      119,  119,   81,  118,  118,   95,   94,   93,   89,   81,
513
       79,   87,   85,   84,   83,   60,  120,  120,   35,   35,
514

  
515
       35,   35,   35,   35,   37,   37,   37,   37,   37,   37,
516
       41,   41,   41,   41,   41,   41,   45,   45,   45,   45,
517
       45,   45,   50,   50,   50,   50,   59,   59,   66,   79,
518
       66,   56,   56,   88,   88,  117,   65,  117,  117,  117,
519
      117,   49,   42,   74,   73,   72,   69,   68,   67,   63,
520
       62,   61,   60,  121,   52,   51,   49,   48,   42,  121,
521
       36,   36,    9,  121,  121,  121,  121,  121,  121,  121,
522
      121,  121,  121,  121,  121,  121,  121,  121,  121,  121,
523
      121,  121,  121,  121,  121,  121,  121,  121,  121,  121,
524
      121,  121,  121,  121,  121,  121,  121,  121,  121
525

  
526
    } ;
527

  
528
static yyconst flex_int16_t yy_chk[300] =
529
    {   0,
530
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
531
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
532
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
533
        1,    1,    1,    1,    1,    1,    2,    5,    6,   13,
534
       14,   22,   14,   33,    5,    6,  130,    5,    6,   45,
535
       70,   45,   53,   53,   53,   13,  120,  117,   22,   55,
536
       55,   55,   55,    2,   21,  114,   21,   21,   21,   21,
537
       33,   58,   58,   58,   21,  108,  105,   70,   21,   21,
538
       21,   75,  104,   75,   75,   75,   21,   28,   28,   28,
539
       28,   82,   82,   82,  109,   28,   28,  109,  101,   28,
540

  
541
       28,   28,   28,   28,   28,   28,   28,   28,   60,   60,
542
       60,   60,   86,   86,   86,  100,   60,   89,   89,   89,
543
       60,   60,   60,   81,   81,   81,   81,   87,   87,   87,
544
       87,   81,   92,   92,   92,   81,   81,   81,   96,   95,
545
       96,   96,   96,   98,   94,   98,   98,   98,  102,  102,
546
      102,  103,  103,  103,  106,  106,  106,  106,  107,   93,
547
      107,  107,  107,  110,  110,  110,  111,  111,  111,  112,
548
      113,   90,  112,  113,  115,  115,  115,  116,  116,  116,
549
      118,  119,   88,  118,  119,   85,   84,   83,   80,   79,
550
       78,   76,   72,   71,   68,   65,  118,  119,  122,  122,
551

  
552
      122,  122,  122,  122,  123,  123,  123,  123,  123,  123,
553
      124,  124,  124,  124,  124,  124,  125,  125,  125,  125,
554
      125,  125,  126,  126,  126,  126,  127,  127,  128,   59,
555
      128,  129,  129,  131,  131,  132,   56,  132,  132,  132,
556
      132,   50,   42,   40,   39,   34,   32,   31,   30,   27,
557
       26,   25,   24,   23,   20,   19,   18,   17,   11,    9,
558
        4,    3,  121,  121,  121,  121,  121,  121,  121,  121,
559
      121,  121,  121,  121,  121,  121,  121,  121,  121,  121,
560
      121,  121,  121,  121,  121,  121,  121,  121,  121,  121,
561
      121,  121,  121,  121,  121,  121,  121,  121,  121
562

  
563
    } ;
564

  
565
static yy_state_type yy_last_accepting_state;
566
static char *yy_last_accepting_cpos;
567

  
568
extern int cf__flex_debug;
569
int cf__flex_debug = 0;
570

  
571
/* The intent behind this definition is that it'll catch
572
 * any uses of REJECT which flex missed.
573
 */
574
#define REJECT reject_used_but_not_detected
575
#define yymore() yymore_used_but_not_detected
576
#define YY_MORE_ADJ 0
577
#define YY_RESTORE_YY_MORE_OFFSET
578
char *cf_text;
579
#line 1 "conf/cf-lex.l"
580
/*
581
 *	BIRD -- Configuration Lexer
582
 *
583
 *	(c) 1998--2000 Martin Mares <mj@ucw.cz>
584
 *
585
 *	Can be freely distributed and used under the terms of the GNU GPL.
586
 */
587
/**
588
 * DOC: Lexical analyzer
589
 *
590
 * The lexical analyzer used for configuration files and CLI commands
591
 * is generated using the |flex| tool accompanied by a couple of
592
 * functions maintaining the hash tables containing information about
593
 * symbols and keywords.
594
 *
595
 * Each symbol is represented by a &symbol structure containing name
596
 * of the symbol, its lexical scope, symbol class (%SYM_PROTO for a
597
 * name of a protocol, %SYM_CONSTANT for a constant etc.) and class
598
 * dependent data.  When an unknown symbol is encountered, it's
599
 * automatically added to the symbol table with class %SYM_VOID.
600
 *
601
 * The keyword tables are generated from the grammar templates
602
 * using the |gen_keywords.m4| script.
603
 */
604
#line 28 "conf/cf-lex.l"
605
#undef REJECT     /* Avoid name clashes */
606

  
607
#include <errno.h>
608
#include <stdlib.h>
609
#include <stdarg.h>
610
#include <stdint.h>
611
#include <unistd.h>
612
#include <libgen.h>
613
#include <glob.h>
614
#include <fcntl.h>
615
#include <sys/stat.h>
616
#include <sys/types.h>
617
#include <sys/stat.h>
618

  
619
#define PARSER 1
620

  
621
#include "nest/bird.h"
622
#include "nest/route.h"
623
#include "nest/protocol.h"
624
#include "filter/filter.h"
625
#include "conf/conf.h"
626
#include "conf/cf-parse.tab.h"
627
#include "lib/string.h"
628
#include "lib/hash.h"
629

  
630
struct keyword {
631
  byte *name;
632
  int value;
633
  struct keyword *next;
634
};
635

  
636
#include "conf/keywords.h"
637

  
638
/* Could be defined by Bison in cf-parse.tab.h, inteferes with SYM hash */
639
#ifdef SYM
640
#undef SYM
641
#endif
642

  
643

  
644
static uint cf_hash(byte *c);
645

  
646
#define KW_KEY(n)		n->name
647
#define KW_NEXT(n)		n->next
648
#define KW_EQ(a,b)		!strcmp(a,b)
649
#define KW_FN(k)		cf_hash(k)
650
#define KW_ORDER		8 /* Fixed */
651

  
652
#define SYM_KEY(n)		n->name, n->scope->active
653
#define SYM_NEXT(n)		n->next
654
#define SYM_EQ(a,s1,b,s2)	!strcmp(a,b) && s1 == s2
655
#define SYM_FN(k,s)		cf_hash(k)
656
#define SYM_ORDER		6 /* Initial */
657

  
658
#define SYM_REHASH		sym_rehash
659
#define SYM_PARAMS		/8, *1, 2, 2, 6, 20
660

  
661

  
662
HASH_DEFINE_REHASH_FN(SYM, struct symbol)
663

  
664
HASH(struct keyword) kw_hash;
665

  
666

  
667
static struct sym_scope *conf_this_scope;
668

  
669
linpool *cfg_mem;
670

  
671
int (*cf_read_hook)(byte *buf, unsigned int max, int fd);
672
struct include_file_stack *ifs;
673
static struct include_file_stack *ifs_head;
674

  
675
#define MAX_INCLUDE_DEPTH 8
676

  
677
#define YY_INPUT(buf,result,max) result = cf_read_hook(buf, max, ifs->fd);
678
#define YY_NO_UNPUT
679
#define YY_FATAL_ERROR(msg) cf_error(msg)
680

  
681
static void cf_include(char *arg, int alen);
682
static int check_eof(void);
683

  
684
#define YY_NO_INPUT 1
685

  
686
#line 687 "obj/conf/cf-lex.c"
687

  
688
#define INITIAL 0
689
#define COMMENT 1
690
#define CCOMM 2
691
#define CLI 3
692

  
693
#ifndef YY_NO_UNISTD_H
694
/* Special case for "unistd.h", since it is non-ANSI. We include it way
695
 * down here because we want the user's section 1 to have been scanned first.
696
 * The user has a chance to override it with an option.
697
 */
698
#include <unistd.h>
699
#endif
700

  
701
#ifndef YY_EXTRA_TYPE
702
#define YY_EXTRA_TYPE void *
703
#endif
704

  
705
static int yy_init_globals (void );
706

  
707
/* Accessor methods to globals.
708
   These are made visible to non-reentrant scanners for convenience. */
709

  
710
int cf_lex_destroy (void );
711

  
712
int cf_get_debug (void );
713

  
714
void cf_set_debug (int debug_flag  );
715

  
716
YY_EXTRA_TYPE cf_get_extra (void );
717

  
718
void cf_set_extra (YY_EXTRA_TYPE user_defined  );
719

  
720
FILE *cf_get_in (void );
721

  
722
void cf_set_in  (FILE * _in_str  );
723

  
724
FILE *cf_get_out (void );
725

  
726
void cf_set_out  (FILE * _out_str  );
727

  
728
			int cf_get_leng (void );
729

  
730
char *cf_get_text (void );
731

  
732
int cf_get_lineno (void );
733

  
734
void cf_set_lineno (int _line_number  );
735

  
736
/* Macros after this point can all be overridden by user definitions in
737
 * section 1.
738
 */
739

  
740
#ifndef YY_SKIP_YYWRAP
741
#ifdef __cplusplus
742
extern "C" int cf_wrap (void );
743
#else
744
extern int cf_wrap (void );
745
#endif
746
#endif
747

  
748
#ifndef YY_NO_UNPUT
749
    
750
#endif
751

  
752
#ifndef yytext_ptr
753
static void yy_flex_strncpy (char *,yyconst char *,int );
754
#endif
755

  
756
#ifdef YY_NEED_STRLEN
757
static int yy_flex_strlen (yyconst char * );
758
#endif
759

  
760
#ifndef YY_NO_INPUT
761

  
762
#ifdef __cplusplus
763
static int yyinput (void );
764
#else
765
static int input (void );
766
#endif
767

  
768
#endif
769

  
770
/* Amount of stuff to slurp up with each read. */
771
#ifndef YY_READ_BUF_SIZE
772
#ifdef __ia64__
773
/* On IA-64, the buffer size is 16k, not 8k */
774
#define YY_READ_BUF_SIZE 16384
775
#else
776
#define YY_READ_BUF_SIZE 8192
777
#endif /* __ia64__ */
778
#endif
779

  
780
/* Copy whatever the last rule matched to the standard output. */
781
#ifndef ECHO
782
/* This used to be an fputs(), but since the string might contain NUL's,
783
 * we now use fwrite().
784
 */
785
#define ECHO do { if (fwrite( cf_text, (size_t) cf_leng, 1, cf_out )) {} } while (0)
786
#endif
787

  
788
/* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
789
 * is returned in "result".
790
 */
791
#ifndef YY_INPUT
792
#define YY_INPUT(buf,result,max_size) \
793
	if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
794
		{ \
795
		int c = '*'; \
796
		size_t n; \
797
		for ( n = 0; n < max_size && \
798
			     (c = getc( cf_in )) != EOF && c != '\n'; ++n ) \
799
			buf[n] = (char) c; \
800
		if ( c == '\n' ) \
801
			buf[n++] = (char) c; \
802
		if ( c == EOF && ferror( cf_in ) ) \
803
			YY_FATAL_ERROR( "input in flex scanner failed" ); \
804
		result = n; \
805
		} \
806
	else \
807
		{ \
808
		errno=0; \
809
		while ( (result = (int) fread(buf, 1, max_size, cf_in))==0 && ferror(cf_in)) \
810
			{ \
811
			if( errno != EINTR) \
812
				{ \
813
				YY_FATAL_ERROR( "input in flex scanner failed" ); \
814
				break; \
815
				} \
816
			errno=0; \
817
			clearerr(cf_in); \
818
			} \
819
		}\
820
\
821

  
822
#endif
823

  
824
/* No semi-colon after return; correct usage is to write "yyterminate();" -
825
 * we don't want an extra ';' after the "return" because that will cause
826
 * some compilers to complain about unreachable statements.
827
 */
828
#ifndef yyterminate
829
#define yyterminate() return YY_NULL
830
#endif
831

  
832
/* Number of entries by which start-condition stack grows. */
833
#ifndef YY_START_STACK_INCR
834
#define YY_START_STACK_INCR 25
835
#endif
836

  
837
/* Report a fatal error. */
838
#ifndef YY_FATAL_ERROR
839
#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
840
#endif
841

  
842
/* end tables serialization structures and prototypes */
843

  
844
/* Default declaration of generated scanner - a define so the user can
845
 * easily add parameters.
846
 */
847
#ifndef YY_DECL
848
#define YY_DECL_IS_OURS 1
849

  
850
extern int cf_lex (void);
851

  
852
#define YY_DECL int cf_lex (void)
853
#endif /* !YY_DECL */
854

  
855
/* Code executed at the beginning of each rule, after cf_text and cf_leng
856
 * have been set up.
857
 */
858
#ifndef YY_USER_ACTION
859
#define YY_USER_ACTION
860
#endif
861

  
862
/* Code executed at the end of each rule. */
863
#ifndef YY_BREAK
864
#define YY_BREAK /*LINTED*/break;
865
#endif
866

  
867
#define YY_RULE_SETUP \
868
	if ( cf_leng > 0 ) \
869
		YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \
870
				(cf_text[cf_leng - 1] == '\n'); \
871
	YY_USER_ACTION
872

  
873
/** The main scanner function which does all the work.
874
 */
875
YY_DECL
876
{
877
	yy_state_type yy_current_state;
878
	char *yy_cp, *yy_bp;
879
	int yy_act;
880
    
881
	if ( !(yy_init) )
882
		{
883
		(yy_init) = 1;
884

  
885
#ifdef YY_USER_INIT
886
		YY_USER_INIT;
887
#endif
888

  
889
		if ( ! (yy_start) )
890
			(yy_start) = 1;	/* first start state */
891

  
892
		if ( ! cf_in )
893
			cf_in = stdin;
894

  
895
		if ( ! cf_out )
896
			cf_out = stdout;
897

  
898
		if ( ! YY_CURRENT_BUFFER ) {
899
			cf_ensure_buffer_stack ();
900
			YY_CURRENT_BUFFER_LVALUE =
901
				cf__create_buffer(cf_in,YY_BUF_SIZE );
902
		}
903

  
904
		cf__load_buffer_state( );
905
		}
906

  
907
	{
908
#line 123 "conf/cf-lex.l"
909

  
910
#line 911 "obj/conf/cf-lex.c"
911

  
912
	while ( /*CONSTCOND*/1 )		/* loops until end-of-file is reached */
913
		{
914
		yy_cp = (yy_c_buf_p);
915

  
916
		/* Support of cf_text. */
917
		*yy_cp = (yy_hold_char);
918

  
919
		/* yy_bp points to the position in yy_ch_buf of the start of
920
		 * the current run.
921
		 */
922
		yy_bp = yy_cp;
923

  
924
		yy_current_state = (yy_start);
925
		yy_current_state += YY_AT_BOL();
926
yy_match:
927
		do
928
			{
929
			YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
930
			if ( yy_accept[yy_current_state] )
931
				{
932
				(yy_last_accepting_state) = yy_current_state;
933
				(yy_last_accepting_cpos) = yy_cp;
934
				}
935
			while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
936
				{
937
				yy_current_state = (int) yy_def[yy_current_state];
938
				if ( yy_current_state >= 122 )
939
					yy_c = yy_meta[(unsigned int) yy_c];
940
				}
941
			yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c];
942
			++yy_cp;
943
			}
944
		while ( yy_current_state != 121 );
945
		yy_cp = (yy_last_accepting_cpos);
946
		yy_current_state = (yy_last_accepting_state);
947

  
948
yy_find_action:
949
		yy_act = yy_accept[yy_current_state];
950

  
951
		YY_DO_BEFORE_ACTION;
952

  
953
do_action:	/* This label is used only to access EOF actions. */
954

  
955
		switch ( yy_act )
956
	{ /* beginning of action switch */
957
			case 0: /* must back up */
958
			/* undo the effects of YY_DO_BEFORE_ACTION */
959
			*yy_cp = (yy_hold_char);
960
			yy_cp = (yy_last_accepting_cpos);
961
			yy_current_state = (yy_last_accepting_state);
962
			goto yy_find_action;
963

  
964
case 1:
965
YY_RULE_SETUP
966
#line 124 "conf/cf-lex.l"
967
{
968
  char *start, *end;
969

  
970
  if (!ifs->depth)
971
    cf_error("Include not allowed in CLI");
972

  
973
  start = strchr(cf_text, '"');
974
  start++;
975

  
976
  end = strchr(start, '"');
977
  *end = 0;
978

  
979
  if (start == end)
980
    cf_error("Include with empty argument");
981

  
982
  cf_include(start, end-start);
983
}
984
	YY_BREAK
985
case 2:
986
YY_RULE_SETUP
987
#line 142 "conf/cf-lex.l"
988
{
989
  uint len1 UNUSED, len2;
990
  u64 l;
991
  char *e;
992

  
993
  errno = 0;
994
  l = strtoul(cf_text, &e, 10);
995
  if (e && (*e != ':') || (errno == ERANGE) || (l >> 32))
996
    cf_error("ASN out of range");
997

  
998
  if (l >> 16)
999
  {
1000
    len1 = 32;
1001
    len2 = 16;
1002
    cf_lval.i64 = (2ULL << 48) | (((u64) l) << len2);
1003
  }
1004
  else
1005
  {
1006
    len1 = 16;
1007
    len2 = 32;
1008
    cf_lval.i64 = 0 | (((u64) l) << len2);
1009
  }
1010

  
1011
  errno = 0;
1012
  l = strtoul(e+1, &e, 10);
1013
  if (e && *e || (errno == ERANGE) || (l >> len2))
1014
    cf_error("Number out of range");
1015
  cf_lval.i64 |= l;
1016

  
1017
  return VPN_RD;
1018
}
1019
	YY_BREAK
1020
case 3:
1021
YY_RULE_SETUP
1022
#line 174 "conf/cf-lex.l"
1023
{
1024
  uint len1, len2;
1025
  u64 l;
1026
  char *e;
1027

  
1028
  if (cf_text[0] == '0')
1029
  {
1030
    cf_lval.i64 = 0;
1031
    len1 = 16;
1032
    len2 = 32;
1033
  }
1034
  else
1035
  {
1036
    cf_lval.i64 = 2ULL << 48;
1037
    len1 = 32;
1038
    len2 = 16;
1039
  }
1040

  
1041
  errno = 0;
1042
  l = strtoul(cf_text+2, &e, 10);
1043
  if (e && (*e != ':') || (errno == ERANGE) || (l >> len1))
1044
    cf_error("ASN out of range");
1045
  cf_lval.i64 |= ((u64) l) << len2;
1046

  
1047
  errno = 0;
1048
  l = strtoul(e+1, &e, 10);
1049
  if (e && *e || (errno == ERANGE) || (l >> len2))
1050
    cf_error("Number out of range");
1051
  cf_lval.i64 |= l;
1052

  
1053
  return VPN_RD;
1054
}
1055
	YY_BREAK
1056
case 4:
1057
YY_RULE_SETUP
1058
#line 207 "conf/cf-lex.l"
1059
{
1060
  unsigned long int l;
1061
  ip4_addr ip4;
1062
  char *e;
1063

  
1064
  cf_lval.i64 = 1ULL << 48;
1065

  
1066
  e = strchr(cf_text, ':');
1067
  *e++ = '\0';
1068
  if (!ip4_pton(cf_text, &ip4))
1069
    cf_error("Invalid IPv4 address %s in Route Distinguisher", cf_text);
1070
  cf_lval.i64 |= ((u64) ip4_to_u32(ip4)) << 16;
1071

  
1072
  errno = 0;
1073
  l = strtoul(e, &e, 10);
1074
  if (e && *e || (errno == ERANGE) || (l >> 16))
1075
    cf_error("Number out of range");
1076
  cf_lval.i64 |= l;
1077

  
1078
  return VPN_RD;
1079
}
1080
	YY_BREAK
1081
case 5:
1082
YY_RULE_SETUP
1083
#line 229 "conf/cf-lex.l"
1084
{
1085
  if (!ip4_pton(cf_text, &cf_lval.ip4))
1086
    cf_error("Invalid IPv4 address %s", cf_text);
1087
  return IP4;
1088
}
1089
	YY_BREAK
1090
case 6:
1091
YY_RULE_SETUP
1092
#line 235 "conf/cf-lex.l"
1093
{
1094
  if (!ip6_pton(cf_text, &cf_lval.ip6))
1095
    cf_error("Invalid IPv6 address %s", cf_text);
1096
  return IP6;
1097
}
1098
	YY_BREAK
1099
case 7:
1100
YY_RULE_SETUP
1101
#line 241 "conf/cf-lex.l"
1102
{
1103
  char *e;
1104
  unsigned long int l;
1105
  errno = 0;
1106
  l = strtoul(cf_text+2, &e, 16);
1107
  if (e && *e || errno == ERANGE || (unsigned long int)(unsigned int) l != l)
1108
    cf_error("Number out of range");
1109
  cf_lval.i = l;
1110
  return NUM;
1111
}
1112
	YY_BREAK
1113
case 8:
1114
YY_RULE_SETUP
1115
#line 252 "conf/cf-lex.l"
1116
{
1117
  char *e;
1118
  unsigned long int l;
1119
  errno = 0;
1120
  l = strtoul(cf_text, &e, 10);
1121
  if (e && *e || errno == ERANGE || (unsigned long int)(unsigned int) l != l)
1122
    cf_error("Number out of range");
1123
  cf_lval.i = l;
1124
  return NUM;
1125
}
1126
	YY_BREAK
1127
case 9:
1128
YY_RULE_SETUP
1129
#line 263 "conf/cf-lex.l"
1130
{
1131
  /* Hack to distinguish if..else from else: in case */
1132
  return ELSECOL;
1133
}
1134
	YY_BREAK
1135
case 10:
1136
YY_RULE_SETUP
1137
#line 268 "conf/cf-lex.l"
1138
{
1139
  if(*cf_text == '\'') {
1140
    cf_text[cf_leng-1] = 0;
1141
    cf_text++;
1142
  }
1143

  
1144
  struct keyword *k = HASH_FIND(kw_hash, KW, cf_text);
1145
  if (k)
1146
  {
1147
    if (k->value > 0)
1148
      return k->value;
1149
    else
1150
    {
1151
      cf_lval.i = -k->value;
1152
      return ENUM;
1153
    }
1154
  }
1155

  
1156
  cf_lval.s = cf_get_symbol(cf_text);
1157
  return SYM;
1158
}
1159
	YY_BREAK
1160
case 11:
1161
/* rule 11 can match eol */
1162
YY_RULE_SETUP
1163
#line 290 "conf/cf-lex.l"
1164
{
1165
  BEGIN(INITIAL);
1166
  return CLI_MARKER;
1167
}
1168
	YY_BREAK
1169
case 12:
1170
YY_RULE_SETUP
1171
#line 295 "conf/cf-lex.l"
1172
{
1173
  return DDOT;
1174
}
1175
	YY_BREAK
1176
case 13:
1177
YY_RULE_SETUP
1178
#line 299 "conf/cf-lex.l"
1179
{
1180
  return cf_text[0];
1181
}
1182
	YY_BREAK
1183
case 14:
1184
YY_RULE_SETUP
1185
#line 303 "conf/cf-lex.l"
1186
{
1187
  cf_text[cf_leng-1] = 0;
1188
  cf_lval.t = cfg_strdup(cf_text+1);
1189
  cf_text[cf_leng-1] = '"';
1190
  return TEXT;
1191
}
1192
	YY_BREAK
1193
case 15:
1194
/* rule 15 can match eol */
1195
YY_RULE_SETUP
1196
#line 310 "conf/cf-lex.l"
1197
cf_error("Unterminated string");
1198
	YY_BREAK
1199
case YY_STATE_EOF(INITIAL):
1200
case YY_STATE_EOF(COMMENT):
1201
#line 312 "conf/cf-lex.l"
1202
{ if (check_eof()) return END; }
1203
	YY_BREAK
1204
case 16:
1205
YY_RULE_SETUP
1206
#line 314 "conf/cf-lex.l"
1207

  
1208
	YY_BREAK
1209
case 17:
1210
/* rule 17 can match eol */
1211
YY_RULE_SETUP
1212
#line 316 "conf/cf-lex.l"
1213
ifs->lino++;
1214
	YY_BREAK
1215
case 18:
1216
YY_RULE_SETUP
1217
#line 318 "conf/cf-lex.l"
1218
BEGIN(COMMENT);
1219
	YY_BREAK
1220
case 19:
1221
YY_RULE_SETUP
1222
#line 320 "conf/cf-lex.l"
1223
BEGIN(CCOMM);
1224
	YY_BREAK
1225
case 20:
1226
YY_RULE_SETUP
1227
#line 322 "conf/cf-lex.l"
1228
cf_error("Unknown character");
1229
	YY_BREAK
1230
case 21:
1231
/* rule 21 can match eol */
1232
YY_RULE_SETUP
1233
#line 324 "conf/cf-lex.l"
1234
{
1235
  ifs->lino++;
1236
  BEGIN(INITIAL);
1237
}
1238
	YY_BREAK
1239
case 22:
1240
YY_RULE_SETUP
1241
#line 329 "conf/cf-lex.l"
1242

  
1243
	YY_BREAK
1244
case 23:
1245
YY_RULE_SETUP
1246
#line 331 "conf/cf-lex.l"
1247
BEGIN(INITIAL);
1248
	YY_BREAK
1249
case 24:
1250
/* rule 24 can match eol */
1251
YY_RULE_SETUP
1252
#line 332 "conf/cf-lex.l"
1253
ifs->lino++;
1254
	YY_BREAK
1255
case 25:
1256
YY_RULE_SETUP
1257
#line 333 "conf/cf-lex.l"
1258
cf_error("Comment nesting not supported");
1259
	YY_BREAK
1260
case YY_STATE_EOF(CCOMM):
1261
#line 334 "conf/cf-lex.l"
1262
cf_error("Unterminated comment");
1263
	YY_BREAK
1264
case 26:
1265
YY_RULE_SETUP
1266
#line 335 "conf/cf-lex.l"
1267

  
1268
	YY_BREAK
1269
case 27:
1270
YY_RULE_SETUP
1271
#line 337 "conf/cf-lex.l"
1272
return NEQ;
1273
	YY_BREAK
1274
case 28:
1275
YY_RULE_SETUP
1276
#line 338 "conf/cf-lex.l"
1277
return NMA;
1278
	YY_BREAK
1279
case 29:
1280
YY_RULE_SETUP
1281
#line 339 "conf/cf-lex.l"
1282
return LEQ;
1283
	YY_BREAK
1284
case 30:
1285
YY_RULE_SETUP
1286
#line 340 "conf/cf-lex.l"
1287
return GEQ;
1288
	YY_BREAK
1289
case 31:
1290
YY_RULE_SETUP
1291
#line 341 "conf/cf-lex.l"
1292
return AND;
1293
	YY_BREAK
1294
case 32:
1295
YY_RULE_SETUP
1296
#line 342 "conf/cf-lex.l"
1297
return OR;
1298
	YY_BREAK
1299
case 33:
1300
YY_RULE_SETUP
1301
#line 344 "conf/cf-lex.l"
1302
return PO;
1303
	YY_BREAK
1304
case 34:
1305
YY_RULE_SETUP
1306
#line 345 "conf/cf-lex.l"
1307
return PC;
1308
	YY_BREAK
1309
case 35:
1310
YY_RULE_SETUP
1311
#line 347 "conf/cf-lex.l"
1312
YY_FATAL_ERROR( "flex scanner jammed" );
1313
	YY_BREAK
1314
#line 1315 "obj/conf/cf-lex.c"
1315
case YY_STATE_EOF(CLI):
1316
	yyterminate();
1317

  
1318
	case YY_END_OF_BUFFER:
1319
		{
1320
		/* Amount of text matched not including the EOB char. */
1321
		int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
1322

  
1323
		/* Undo the effects of YY_DO_BEFORE_ACTION. */
1324
		*yy_cp = (yy_hold_char);
1325
		YY_RESTORE_YY_MORE_OFFSET
1326

  
1327
		if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
1328
			{
1329
			/* We're scanning a new file or input source.  It's
1330
			 * possible that this happened because the user
1331
			 * just pointed cf_in at a new source and called
1332
			 * cf_lex().  If so, then we have to assure
1333
			 * consistency between YY_CURRENT_BUFFER and our
1334
			 * globals.  Here is the right place to do so, because
1335
			 * this is the first action (other than possibly a
1336
			 * back-up) that will match for the new input source.
1337
			 */
1338
			(yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1339
			YY_CURRENT_BUFFER_LVALUE->yy_input_file = cf_in;
1340
			YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
1341
			}
1342

  
1343
		/* Note that here we test for yy_c_buf_p "<=" to the position
1344
		 * of the first EOB in the buffer, since yy_c_buf_p will
1345
		 * already have been incremented past the NUL character
1346
		 * (since all states make transitions on EOB to the
1347
		 * end-of-buffer state).  Contrast this with the test
1348
		 * in input().
1349
		 */
1350
		if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1351
			{ /* This was really a NUL. */
1352
			yy_state_type yy_next_state;
1353

  
1354
			(yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
1355

  
1356
			yy_current_state = yy_get_previous_state(  );
1357

  
1358
			/* Okay, we're now positioned to make the NUL
1359
			 * transition.  We couldn't have
1360
			 * yy_get_previous_state() go ahead and do it
1361
			 * for us because it doesn't know how to deal
1362
			 * with the possibility of jamming (and we don't
1363
			 * want to build jamming into it because then it
1364
			 * will run more slowly).
1365
			 */
1366

  
1367
			yy_next_state = yy_try_NUL_trans( yy_current_state );
1368

  
1369
			yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1370

  
1371
			if ( yy_next_state )
1372
				{
1373
				/* Consume the NUL. */
1374
				yy_cp = ++(yy_c_buf_p);
1375
				yy_current_state = yy_next_state;
1376
				goto yy_match;
1377
				}
1378

  
1379
			else
1380
				{
1381
				yy_cp = (yy_last_accepting_cpos);
1382
				yy_current_state = (yy_last_accepting_state);
1383
				goto yy_find_action;
1384
				}
1385
			}
1386

  
1387
		else switch ( yy_get_next_buffer(  ) )
1388
			{
1389
			case EOB_ACT_END_OF_FILE:
1390
				{
1391
				(yy_did_buffer_switch_on_eof) = 0;
1392

  
1393
				if ( cf_wrap( ) )
1394
					{
1395
					/* Note: because we've taken care in
1396
					 * yy_get_next_buffer() to have set up
1397
					 * cf_text, we can now set up
1398
					 * yy_c_buf_p so that if some total
1399
					 * hoser (like flex itself) wants to
1400
					 * call the scanner after we return the
1401
					 * YY_NULL, it'll still work - another
1402
					 * YY_NULL will get returned.
1403
					 */
1404
					(yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
1405

  
1406
					yy_act = YY_STATE_EOF(YY_START);
1407
					goto do_action;
1408
					}
1409

  
1410
				else
1411
					{
1412
					if ( ! (yy_did_buffer_switch_on_eof) )
1413
						YY_NEW_FILE;
1414
					}
1415
				break;
1416
				}
1417

  
1418
			case EOB_ACT_CONTINUE_SCAN:
1419
				(yy_c_buf_p) =
1420
					(yytext_ptr) + yy_amount_of_matched_text;
1421

  
1422
				yy_current_state = yy_get_previous_state(  );
1423

  
1424
				yy_cp = (yy_c_buf_p);
1425
				yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1426
				goto yy_match;
1427

  
1428
			case EOB_ACT_LAST_MATCH:
1429
				(yy_c_buf_p) =
1430
				&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
1431

  
1432
				yy_current_state = yy_get_previous_state(  );
1433

  
1434
				yy_cp = (yy_c_buf_p);
1435
				yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1436
				goto yy_find_action;
1437
			}
1438
		break;
1439
		}
1440

  
1441
	default:
1442
		YY_FATAL_ERROR(
1443
			"fatal flex scanner internal error--no action found" );
1444
	} /* end of action switch */
1445
		} /* end of scanning one token */
1446
	} /* end of user's declarations */
1447
} /* end of cf_lex */
1448

  
1449
/* yy_get_next_buffer - try to read in a new buffer
1450
 *
1451
 * Returns a code representing an action:
1452
 *	EOB_ACT_LAST_MATCH -
1453
 *	EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1454
 *	EOB_ACT_END_OF_FILE - end of file
1455
 */
1456
static int yy_get_next_buffer (void)
1457
{
1458
    	char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1459
	char *source = (yytext_ptr);
1460
	int number_to_move, i;
1461
	int ret_val;
1462

  
1463
	if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
1464
		YY_FATAL_ERROR(
1465
		"fatal flex scanner internal error--end of buffer missed" );
1466

  
1467
	if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1468
		{ /* Don't try to fill the buffer, so this is an EOF. */
1469
		if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
1470
			{
1471
			/* We matched a single character, the EOB, so
1472
			 * treat this as a final EOF.
1473
			 */
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff