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