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