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