1 #define yy_create_buffer _nsyy_create_buffer
2 #define yy_delete_buffer _nsyy_delete_buffer
3 #define yy_scan_buffer _nsyy_scan_buffer
4 #define yy_scan_string _nsyy_scan_string
5 #define yy_scan_bytes _nsyy_scan_bytes
6 #define yy_flex_debug _nsyy_flex_debug
7 #define yy_init_buffer _nsyy_init_buffer
8 #define yy_flush_buffer _nsyy_flush_buffer
9 #define yy_load_buffer_state _nsyy_load_buffer_state
10 #define yy_switch_to_buffer _nsyy_switch_to_buffer
12 #define yyleng _nsyyleng
13 #define yylex _nsyylex
14 #define yyout _nsyyout
15 #define yyrestart _nsyyrestart
16 #define yytext _nsyytext
17 #define yylineno _nsyylineno
18 #define yywrap _nsyywrap
20 /* A lexical scanner generated by flex */
22 /* Scanner skeleton version:
27 #define YY_FLEX_MAJOR_VERSION 2
28 #define YY_FLEX_MINOR_VERSION 5
34 /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
46 /* Use prototypes in function declarations. */
49 /* The "const" storage-class-modifier is valid. */
52 #else /* ! __cplusplus */
60 #endif /* ! __cplusplus */
79 #define YY_PROTO(proto) proto
81 #define YY_PROTO(proto) ()
84 /* Returned upon end-of-file. */
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
92 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
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.
98 #define BEGIN yy_start = 1 + 2 *
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
104 #define YY_START ((yy_start - 1) / 2)
105 #define YYSTATE YY_START
107 /* Action number for EOF rule of a given start state. */
108 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
110 /* Special action meaning "start processing a new file". */
111 #define YY_NEW_FILE yyrestart( yyin )
113 #define YY_END_OF_BUFFER_CHAR 0
115 /* Size of default input buffer. */
116 #define YY_BUF_SIZE 1024
118 typedef struct yy_buffer_state *YY_BUFFER_STATE;
121 extern FILE *yyin, *yyout;
123 #define EOB_ACT_CONTINUE_SCAN 0
124 #define EOB_ACT_END_OF_FILE 1
125 #define EOB_ACT_LAST_MATCH 2
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:
131 * if ( condition_holds )
134 * do_something_else();
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.
141 /* Return all but the first 'n' matched characters back to the input stream. */
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 */ \
154 #define unput(c) yyunput( c, yytext_ptr )
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).
160 typedef unsigned int yy_size_t;
163 struct yy_buffer_state
167 char *yy_ch_buf; /* input buffer */
168 char *yy_buf_pos; /* current position in input buffer */
170 /* Size of input buffer in bytes, not including room for EOB
173 yy_size_t yy_buf_size;
175 /* Number of characters read into yy_ch_buf, not including EOB
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
184 int yy_is_our_buffer;
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
191 int yy_is_interactive;
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
199 /* Whether to try to fill the input buffer when we reach the
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.
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.
217 #define YY_BUFFER_EOF_PENDING 2
220 static YY_BUFFER_STATE yy_current_buffer = 0;
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
226 #define YY_CURRENT_BUFFER yy_current_buffer
229 /* yy_hold_char holds the character lost when yytext is formed. */
230 static char yy_hold_char;
232 static int yy_n_chars; /* number of characters read into yy_ch_buf */
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 */
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 ...
245 static int yy_did_buffer_switch_on_eof;
247 void yyrestart YY_PROTO(( FILE *input_file ));
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 )
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 ));
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 * ));
265 #define yy_new_buffer yy_create_buffer
267 #define yy_set_interactive(is_interactive) \
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; \
274 #define yy_set_bol(at_bol) \
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; \
281 #define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
284 #define YY_USES_REJECT
285 typedef unsigned char YY_CHAR;
286 FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
287 typedef int yy_state_type;
291 #define yytext_ptr yytext
293 static yy_state_type yy_get_previous_state YY_PROTO(( void ));
294 static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
295 static int yy_get_next_buffer YY_PROTO(( void ));
296 static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
298 /* Done after the current pattern has been matched and before the
299 * corresponding action - sets up yytext.
301 #define YY_DO_BEFORE_ACTION \
302 yytext_ptr = yy_bp; \
303 yyleng = (int) (yy_cp - yy_bp); \
304 yy_hold_char = *yy_cp; \
308 #define YY_NUM_RULES 13
309 #define YY_END_OF_BUFFER 14
310 static yyconst short int yy_acclist[83] =
312 14, 12, 13, 1, 12, 13, 4, 13, 2, 12,
313 13, 11, 12, 13, 11, 12, 13, 11, 12, 13,
314 11, 12, 13, 11, 12, 13, 11, 12, 13, 11,
315 12, 13, 12, 13, 1, 2, 11, 11, 11, 11,
316 11, 11, 11, 3, 11, 11, 11, 11, 11, 11,
317 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
318 11, 11, 11, 11, 9, 11, 11, 11, 11, 11,
319 11, 5, 11, 11, 6, 11, 10, 11, 7, 11,
323 static yyconst short int yy_accept[60] =
325 1, 1, 1, 2, 4, 7, 9, 12, 15, 18,
326 21, 24, 27, 30, 33, 35, 36, 37, 38, 39,
327 40, 41, 42, 43, 44, 45, 46, 47, 48, 49,
328 50, 51, 52, 53, 54, 55, 56, 57, 58, 59,
329 60, 61, 62, 63, 64, 65, 67, 68, 69, 70,
330 71, 72, 74, 75, 77, 79, 81, 83, 83
333 static yyconst int yy_ec[256] =
335 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
336 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
337 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
338 1, 2, 1, 1, 4, 1, 1, 1, 1, 1,
339 1, 1, 1, 1, 1, 1, 1, 5, 5, 5,
340 5, 5, 5, 5, 5, 5, 5, 1, 1, 1,
341 1, 1, 1, 1, 6, 7, 8, 9, 10, 11,
342 12, 7, 13, 7, 7, 14, 7, 15, 16, 7,
343 7, 17, 18, 19, 20, 21, 7, 7, 22, 7,
344 1, 23, 1, 1, 5, 1, 6, 7, 8, 9,
346 10, 11, 12, 7, 13, 7, 7, 14, 7, 15,
347 16, 7, 7, 17, 18, 19, 20, 21, 7, 7,
348 22, 7, 1, 1, 1, 1, 1, 1, 1, 1,
349 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
350 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
351 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
352 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
353 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
354 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
355 1, 1, 1, 1, 1, 1, 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,
365 static yyconst int yy_meta[24] =
367 1, 1, 2, 1, 3, 3, 3, 3, 3, 3,
368 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
372 static yyconst short int yy_base[61] =
374 0, 0, 68, 69, 65, 69, 0, 0, 50, 49,
375 54, 43, 45, 46, 57, 57, 0, 0, 43, 38,
376 37, 47, 32, 47, 69, 33, 40, 30, 41, 42,
377 26, 33, 29, 27, 33, 30, 35, 25, 19, 23,
378 19, 30, 22, 14, 18, 0, 14, 18, 16, 19,
379 19, 0, 12, 0, 0, 0, 0, 69, 23, 22
382 static yyconst short int yy_def[61] =
384 58, 1, 58, 58, 58, 58, 59, 60, 60, 60,
385 60, 60, 60, 60, 58, 58, 59, 60, 60, 60,
386 60, 60, 60, 60, 58, 60, 60, 60, 60, 60,
387 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
388 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
389 60, 60, 60, 60, 60, 60, 60, 0, 58, 58
392 static yyconst short int yy_nxt[93] =
394 4, 5, 6, 7, 4, 8, 8, 9, 8, 8,
395 8, 8, 8, 8, 10, 8, 11, 12, 13, 14,
396 8, 8, 15, 17, 18, 17, 57, 56, 55, 54,
397 53, 52, 51, 50, 49, 48, 47, 46, 45, 44,
398 43, 42, 41, 40, 39, 38, 37, 36, 35, 34,
399 33, 32, 31, 30, 29, 28, 27, 26, 16, 25,
400 24, 23, 22, 21, 20, 19, 16, 58, 3, 58,
401 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
402 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
407 static yyconst short int yy_chk[93] =
409 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
410 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
411 1, 1, 1, 59, 60, 59, 53, 51, 50, 49,
412 48, 47, 45, 44, 43, 42, 41, 40, 39, 38,
413 37, 36, 35, 34, 33, 32, 31, 30, 29, 28,
414 27, 26, 24, 23, 22, 21, 20, 19, 16, 15,
415 14, 13, 12, 11, 10, 9, 5, 3, 58, 58,
416 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
417 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
422 static yy_state_type yy_state_buf[YY_BUF_SIZE + 2], *yy_state_ptr;
423 static char *yy_full_match;
427 *yy_cp = yy_hold_char; /* undo effects of setting up yytext */ \
428 yy_cp = yy_full_match; /* restore poss. backed-over text */ \
432 #define yymore() yymore_used_but_not_detected
433 #define YY_MORE_ADJ 0
434 #define YY_RESTORE_YY_MORE_OFFSET
439 /* $NetBSD: nslexer.l,v 1.3 1999/01/25 00:16:17 lukem Exp $ */
442 * Copyright (c) 1997, 1998, 1999 The NetBSD Foundation, Inc.
443 * All rights reserved.
445 * This code is derived from software contributed to The NetBSD Foundation
448 * Redistribution and use in source and binary forms, with or without
449 * modification, are permitted provided that the following conditions
451 * 1. Redistributions of source code must retain the above copyright
452 * notice, this list of conditions and the following disclaimer.
453 * 2. Redistributions in binary form must reproduce the above copyright
454 * notice, this list of conditions and the following disclaimer in the
455 * documentation and/or other materials provided with the distribution.
456 * 3. All advertising materials mentioning features or use of this software
457 * must display the following acknowledgement:
458 * This product includes software developed by the NetBSD
459 * Foundation, Inc. and its contributors.
460 * 4. Neither the name of The NetBSD Foundation nor the names of its
461 * contributors may be used to endorse or promote products derived
462 * from this software without specific prior written permission.
464 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
465 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
466 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
467 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
468 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
469 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
470 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
471 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
472 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
473 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
474 * POSSIBILITY OF SUCH DAMAGE.
478 #include <sys/cdefs.h>
479 #if defined(LIBC_SCCS) && !defined(lint)
481 "$FreeBSD: src/lib/libc/net/nslexer.l,v 1.3 2001/11/11 02:48:09 bde Exp $";
482 #endif /* LIBC_SCCS and not lint */
486 #include <nsswitch.h>
489 #include "nsparser.h"
494 /* Macros after this point can all be overridden by user definitions in
498 #ifndef YY_SKIP_YYWRAP
500 extern "C" int yywrap YY_PROTO(( void ));
502 extern int yywrap YY_PROTO(( void ));
507 static void yyunput YY_PROTO(( int c, char *buf_ptr ));
511 static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
514 #ifdef YY_NEED_STRLEN
515 static int yy_flex_strlen YY_PROTO(( yyconst char * ));
520 static int yyinput YY_PROTO(( void ));
522 static int input YY_PROTO(( void ));
527 static int yy_start_stack_ptr = 0;
528 static int yy_start_stack_depth = 0;
529 static int *yy_start_stack = 0;
530 #ifndef YY_NO_PUSH_STATE
531 static void yy_push_state YY_PROTO(( int new_state ));
533 #ifndef YY_NO_POP_STATE
534 static void yy_pop_state YY_PROTO(( void ));
536 #ifndef YY_NO_TOP_STATE
537 static int yy_top_state YY_PROTO(( void ));
541 #define YY_NO_PUSH_STATE 1
542 #define YY_NO_POP_STATE 1
543 #define YY_NO_TOP_STATE 1
546 #ifdef YY_MALLOC_DECL
554 /* Just try to get by without declaring the routines. This will fail
555 * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
556 * or sizeof(void*) != sizeof(int).
561 /* Amount of stuff to slurp up with each read. */
562 #ifndef YY_READ_BUF_SIZE
563 #define YY_READ_BUF_SIZE 8192
566 /* Copy whatever the last rule matched to the standard output. */
569 /* This used to be an fputs(), but since the string might contain NUL's,
570 * we now use fwrite().
572 #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
575 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
576 * is returned in "result".
579 #define YY_INPUT(buf,result,max_size) \
580 if ( yy_current_buffer->yy_is_interactive ) \
583 for ( n = 0; n < max_size && \
584 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
587 buf[n++] = (char) c; \
588 if ( c == EOF && ferror( yyin ) ) \
589 YY_FATAL_ERROR( "input in flex scanner failed" ); \
592 else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
593 && ferror( yyin ) ) \
594 YY_FATAL_ERROR( "input in flex scanner failed" );
597 /* No semi-colon after return; correct usage is to write "yyterminate();" -
598 * we don't want an extra ';' after the "return" because that will cause
599 * some compilers to complain about unreachable statements.
602 #define yyterminate() return YY_NULL
605 /* Number of entries by which start-condition stack grows. */
606 #ifndef YY_START_STACK_INCR
607 #define YY_START_STACK_INCR 25
610 /* Report a fatal error. */
611 #ifndef YY_FATAL_ERROR
612 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
615 /* Default declaration of generated scanner - a define so the user can
616 * easily add parameters.
619 #define YY_DECL int yylex YY_PROTO(( void ))
622 /* Code executed at the beginning of each rule, after yytext and yyleng
625 #ifndef YY_USER_ACTION
626 #define YY_USER_ACTION
629 /* Code executed at the end of each rule. */
631 #define YY_BREAK break;
634 #define YY_RULE_SETUP \
639 register yy_state_type yy_current_state;
640 register char *yy_cp = NULL, *yy_bp = NULL;
656 yy_start = 1; /* first start state */
664 if ( ! yy_current_buffer )
666 yy_create_buffer( yyin, YY_BUF_SIZE );
668 yy_load_buffer_state();
671 while ( 1 ) /* loops until end-of-file is reached */
675 /* Support of yytext. */
676 *yy_cp = yy_hold_char;
678 /* yy_bp points to the position in yy_ch_buf of the start of
683 yy_current_state = yy_start;
684 yy_state_ptr = yy_state_buf;
685 *yy_state_ptr++ = yy_current_state;
689 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
690 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
692 yy_current_state = (int) yy_def[yy_current_state];
693 if ( yy_current_state >= 59 )
694 yy_c = yy_meta[(unsigned int) yy_c];
696 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
697 *yy_state_ptr++ = yy_current_state;
700 while ( yy_base[yy_current_state] != 69 );
703 yy_current_state = *--yy_state_ptr;
704 yy_lp = yy_accept[yy_current_state];
705 find_rule: /* we branch to this label when backing up */
706 for ( ; ; ) /* until we find what rule we matched */
708 if ( yy_lp && yy_lp < yy_accept[yy_current_state + 1] )
710 yy_act = yy_acclist[yy_lp];
712 yy_full_match = yy_cp;
717 yy_current_state = *--yy_state_ptr;
718 yy_lp = yy_accept[yy_current_state];
723 if ( yy_act != YY_END_OF_BUFFER )
726 for ( yyl = 0; yyl < yyleng; ++yyl )
727 if ( yytext[yyl] == '\n' )
731 do_action: /* This label is used only to access EOF actions. */
735 { /* beginning of action switch */
739 ; /* skip whitespace */
744 ; /* skip comments */
749 ; /* allow continuation */
794 len = strlen (yytext) + 1;
795 if ((p = malloc (len)) == NULL)
796 printf("nsdispatch: memory allocation failure\n");
798 memcpy (p, yytext, len);
800 for (i = 0; i < strlen(p); i++) {
801 if (isupper((unsigned char)p[i]))
802 p[i] = tolower((unsigned char)p[i]);
815 #line 101 "nslexer.l"
818 case YY_STATE_EOF(INITIAL):
821 case YY_END_OF_BUFFER:
823 /* Amount of text matched not including the EOB char. */
824 int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
826 /* Undo the effects of YY_DO_BEFORE_ACTION. */
827 *yy_cp = yy_hold_char;
828 YY_RESTORE_YY_MORE_OFFSET
830 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
832 /* We're scanning a new file or input source. It's
833 * possible that this happened because the user
834 * just pointed yyin at a new source and called
835 * yylex(). If so, then we have to assure
836 * consistency between yy_current_buffer and our
837 * globals. Here is the right place to do so, because
838 * this is the first action (other than possibly a
839 * back-up) that will match for the new input source.
841 yy_n_chars = yy_current_buffer->yy_n_chars;
842 yy_current_buffer->yy_input_file = yyin;
843 yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
846 /* Note that here we test for yy_c_buf_p "<=" to the position
847 * of the first EOB in the buffer, since yy_c_buf_p will
848 * already have been incremented past the NUL character
849 * (since all states make transitions on EOB to the
850 * end-of-buffer state). Contrast this with the test
853 if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
854 { /* This was really a NUL. */
855 yy_state_type yy_next_state;
857 yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
859 yy_current_state = yy_get_previous_state();
861 /* Okay, we're now positioned to make the NUL
862 * transition. We couldn't have
863 * yy_get_previous_state() go ahead and do it
864 * for us because it doesn't know how to deal
865 * with the possibility of jamming (and we don't
866 * want to build jamming into it because then it
867 * will run more slowly).
870 yy_next_state = yy_try_NUL_trans( yy_current_state );
872 yy_bp = yytext_ptr + YY_MORE_ADJ;
876 /* Consume the NUL. */
877 yy_cp = ++yy_c_buf_p;
878 yy_current_state = yy_next_state;
889 else switch ( yy_get_next_buffer() )
891 case EOB_ACT_END_OF_FILE:
893 yy_did_buffer_switch_on_eof = 0;
897 /* Note: because we've taken care in
898 * yy_get_next_buffer() to have set up
899 * yytext, we can now set up
900 * yy_c_buf_p so that if some total
901 * hoser (like flex itself) wants to
902 * call the scanner after we return the
903 * YY_NULL, it'll still work - another
904 * YY_NULL will get returned.
906 yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
908 yy_act = YY_STATE_EOF(YY_START);
914 if ( ! yy_did_buffer_switch_on_eof )
920 case EOB_ACT_CONTINUE_SCAN:
922 yytext_ptr + yy_amount_of_matched_text;
924 yy_current_state = yy_get_previous_state();
927 yy_bp = yytext_ptr + YY_MORE_ADJ;
930 case EOB_ACT_LAST_MATCH:
932 &yy_current_buffer->yy_ch_buf[yy_n_chars];
934 yy_current_state = yy_get_previous_state();
937 yy_bp = yytext_ptr + YY_MORE_ADJ;
945 "fatal flex scanner internal error--no action found" );
946 } /* end of action switch */
947 } /* end of scanning one token */
951 /* yy_get_next_buffer - try to read in a new buffer
953 * Returns a code representing an action:
954 * EOB_ACT_LAST_MATCH -
955 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
956 * EOB_ACT_END_OF_FILE - end of file
959 static int yy_get_next_buffer()
961 register char *dest = yy_current_buffer->yy_ch_buf;
962 register char *source = yytext_ptr;
963 register int number_to_move, i;
966 if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
968 "fatal flex scanner internal error--end of buffer missed" );
970 if ( yy_current_buffer->yy_fill_buffer == 0 )
971 { /* Don't try to fill the buffer, so this is an EOF. */
972 if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
974 /* We matched a single character, the EOB, so
975 * treat this as a final EOF.
977 return EOB_ACT_END_OF_FILE;
982 /* We matched some text prior to the EOB, first
985 return EOB_ACT_LAST_MATCH;
989 /* Try to read more data. */
991 /* First move last chars to start of buffer. */
992 number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
994 for ( i = 0; i < number_to_move; ++i )
995 *(dest++) = *(source++);
997 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
998 /* don't do the read, it's not guaranteed to return an EOF,
1001 yy_current_buffer->yy_n_chars = yy_n_chars = 0;
1006 yy_current_buffer->yy_buf_size - number_to_move - 1;
1008 while ( num_to_read <= 0 )
1009 { /* Not enough room in the buffer - grow it. */
1010 #ifdef YY_USES_REJECT
1012 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
1015 /* just a shorter name for the current buffer */
1016 YY_BUFFER_STATE b = yy_current_buffer;
1018 int yy_c_buf_p_offset =
1019 (int) (yy_c_buf_p - b->yy_ch_buf);
1021 if ( b->yy_is_our_buffer )
1023 int new_size = b->yy_buf_size * 2;
1025 if ( new_size <= 0 )
1026 b->yy_buf_size += b->yy_buf_size / 8;
1028 b->yy_buf_size *= 2;
1030 b->yy_ch_buf = (char *)
1031 /* Include room in for 2 EOB chars. */
1032 yy_flex_realloc( (void *) b->yy_ch_buf,
1033 b->yy_buf_size + 2 );
1036 /* Can't grow it, we don't own it. */
1039 if ( ! b->yy_ch_buf )
1041 "fatal error - scanner input buffer overflow" );
1043 yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
1045 num_to_read = yy_current_buffer->yy_buf_size -
1050 if ( num_to_read > YY_READ_BUF_SIZE )
1051 num_to_read = YY_READ_BUF_SIZE;
1053 /* Read in more data. */
1054 YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
1055 yy_n_chars, num_to_read );
1057 yy_current_buffer->yy_n_chars = yy_n_chars;
1060 if ( yy_n_chars == 0 )
1062 if ( number_to_move == YY_MORE_ADJ )
1064 ret_val = EOB_ACT_END_OF_FILE;
1070 ret_val = EOB_ACT_LAST_MATCH;
1071 yy_current_buffer->yy_buffer_status =
1072 YY_BUFFER_EOF_PENDING;
1077 ret_val = EOB_ACT_CONTINUE_SCAN;
1079 yy_n_chars += number_to_move;
1080 yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
1081 yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
1083 yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
1089 /* yy_get_previous_state - get the state just before the EOB char was reached */
1091 static yy_state_type yy_get_previous_state()
1093 register yy_state_type yy_current_state;
1094 register char *yy_cp;
1096 yy_current_state = yy_start;
1097 yy_state_ptr = yy_state_buf;
1098 *yy_state_ptr++ = yy_current_state;
1100 for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
1102 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1103 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1105 yy_current_state = (int) yy_def[yy_current_state];
1106 if ( yy_current_state >= 59 )
1107 yy_c = yy_meta[(unsigned int) yy_c];
1109 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1110 *yy_state_ptr++ = yy_current_state;
1113 return yy_current_state;
1117 /* yy_try_NUL_trans - try to make a transition on the NUL character
1120 * next_state = yy_try_NUL_trans( current_state );
1123 #ifdef YY_USE_PROTOS
1124 static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
1126 static yy_state_type yy_try_NUL_trans( yy_current_state )
1127 yy_state_type yy_current_state;
1130 register int yy_is_jam;
1132 register YY_CHAR yy_c = 1;
1133 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1135 yy_current_state = (int) yy_def[yy_current_state];
1136 if ( yy_current_state >= 59 )
1137 yy_c = yy_meta[(unsigned int) yy_c];
1139 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1140 yy_is_jam = (yy_current_state == 58);
1142 *yy_state_ptr++ = yy_current_state;
1144 return yy_is_jam ? 0 : yy_current_state;
1149 #ifdef YY_USE_PROTOS
1150 static void yyunput( int c, register char *yy_bp )
1152 static void yyunput( c, yy_bp )
1154 register char *yy_bp;
1157 register char *yy_cp = yy_c_buf_p;
1159 /* undo effects of setting up yytext */
1160 *yy_cp = yy_hold_char;
1162 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1163 { /* need to shift things up to make room */
1164 /* +2 for EOB chars. */
1165 register int number_to_move = yy_n_chars + 2;
1166 register char *dest = &yy_current_buffer->yy_ch_buf[
1167 yy_current_buffer->yy_buf_size + 2];
1168 register char *source =
1169 &yy_current_buffer->yy_ch_buf[number_to_move];
1171 while ( source > yy_current_buffer->yy_ch_buf )
1172 *--dest = *--source;
1174 yy_cp += (int) (dest - source);
1175 yy_bp += (int) (dest - source);
1176 yy_current_buffer->yy_n_chars =
1177 yy_n_chars = yy_current_buffer->yy_buf_size;
1179 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1180 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1183 *--yy_cp = (char) c;
1189 yy_hold_char = *yy_cp;
1192 #endif /* ifndef YY_NO_UNPUT */
1196 static int yyinput()
1203 *yy_c_buf_p = yy_hold_char;
1205 if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
1207 /* yy_c_buf_p now points to the character we want to return.
1208 * If this occurs *before* the EOB characters, then it's a
1209 * valid NUL; if not, then we've hit the end of the buffer.
1211 if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
1212 /* This was really a NUL. */
1216 { /* need more input */
1217 int offset = yy_c_buf_p - yytext_ptr;
1220 switch ( yy_get_next_buffer() )
1222 case EOB_ACT_LAST_MATCH:
1223 /* This happens because yy_g_n_b()
1224 * sees that we've accumulated a
1225 * token and flags that we need to
1226 * try matching the token before
1227 * proceeding. But for input(),
1228 * there's no matching to consider.
1229 * So convert the EOB_ACT_LAST_MATCH
1230 * to EOB_ACT_END_OF_FILE.
1233 /* Reset buffer status. */
1238 case EOB_ACT_END_OF_FILE:
1243 if ( ! yy_did_buffer_switch_on_eof )
1252 case EOB_ACT_CONTINUE_SCAN:
1253 yy_c_buf_p = yytext_ptr + offset;
1259 c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */
1260 *yy_c_buf_p = '\0'; /* preserve yytext */
1261 yy_hold_char = *++yy_c_buf_p;
1270 #ifdef YY_USE_PROTOS
1271 void yyrestart( FILE *input_file )
1273 void yyrestart( input_file )
1277 if ( ! yy_current_buffer )
1278 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
1280 yy_init_buffer( yy_current_buffer, input_file );
1281 yy_load_buffer_state();
1285 #ifdef YY_USE_PROTOS
1286 void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
1288 void yy_switch_to_buffer( new_buffer )
1289 YY_BUFFER_STATE new_buffer;
1292 if ( yy_current_buffer == new_buffer )
1295 if ( yy_current_buffer )
1297 /* Flush out information for old buffer. */
1298 *yy_c_buf_p = yy_hold_char;
1299 yy_current_buffer->yy_buf_pos = yy_c_buf_p;
1300 yy_current_buffer->yy_n_chars = yy_n_chars;
1303 yy_current_buffer = new_buffer;
1304 yy_load_buffer_state();
1306 /* We don't actually know whether we did this switch during
1307 * EOF (yywrap()) processing, but the only time this flag
1308 * is looked at is after yywrap() is called, so it's safe
1309 * to go ahead and always set it.
1311 yy_did_buffer_switch_on_eof = 1;
1315 #ifdef YY_USE_PROTOS
1316 void yy_load_buffer_state( void )
1318 void yy_load_buffer_state()
1321 yy_n_chars = yy_current_buffer->yy_n_chars;
1322 yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
1323 yyin = yy_current_buffer->yy_input_file;
1324 yy_hold_char = *yy_c_buf_p;
1328 #ifdef YY_USE_PROTOS
1329 YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
1331 YY_BUFFER_STATE yy_create_buffer( file, size )
1338 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
1340 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1342 b->yy_buf_size = size;
1344 /* yy_ch_buf has to be 2 characters longer than the size given because
1345 * we need to put in 2 end-of-buffer characters.
1347 b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
1348 if ( ! b->yy_ch_buf )
1349 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1351 b->yy_is_our_buffer = 1;
1353 yy_init_buffer( b, file );
1359 #ifdef YY_USE_PROTOS
1360 void yy_delete_buffer( YY_BUFFER_STATE b )
1362 void yy_delete_buffer( b )
1369 if ( b == yy_current_buffer )
1370 yy_current_buffer = (YY_BUFFER_STATE) 0;
1372 if ( b->yy_is_our_buffer )
1373 yy_flex_free( (void *) b->yy_ch_buf );
1375 yy_flex_free( (void *) b );
1380 #ifdef YY_USE_PROTOS
1381 void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
1383 void yy_init_buffer( b, file )
1390 yy_flush_buffer( b );
1392 b->yy_input_file = file;
1393 b->yy_fill_buffer = 1;
1395 #if YY_ALWAYS_INTERACTIVE
1396 b->yy_is_interactive = 1;
1398 #if YY_NEVER_INTERACTIVE
1399 b->yy_is_interactive = 0;
1401 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1407 #ifdef YY_USE_PROTOS
1408 void yy_flush_buffer( YY_BUFFER_STATE b )
1410 void yy_flush_buffer( b )
1420 /* We always need two end-of-buffer characters. The first causes
1421 * a transition to the end-of-buffer state. The second causes
1422 * a jam in that state.
1424 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1425 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1427 b->yy_buf_pos = &b->yy_ch_buf[0];
1430 b->yy_buffer_status = YY_BUFFER_NEW;
1432 if ( b == yy_current_buffer )
1433 yy_load_buffer_state();
1437 #ifndef YY_NO_SCAN_BUFFER
1438 #ifdef YY_USE_PROTOS
1439 YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
1441 YY_BUFFER_STATE yy_scan_buffer( base, size )
1449 base[size-2] != YY_END_OF_BUFFER_CHAR ||
1450 base[size-1] != YY_END_OF_BUFFER_CHAR )
1451 /* They forgot to leave room for the EOB's. */
1454 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
1456 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
1458 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
1459 b->yy_buf_pos = b->yy_ch_buf = base;
1460 b->yy_is_our_buffer = 0;
1461 b->yy_input_file = 0;
1462 b->yy_n_chars = b->yy_buf_size;
1463 b->yy_is_interactive = 0;
1465 b->yy_fill_buffer = 0;
1466 b->yy_buffer_status = YY_BUFFER_NEW;
1468 yy_switch_to_buffer( b );
1475 #ifndef YY_NO_SCAN_STRING
1476 #ifdef YY_USE_PROTOS
1477 YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
1479 YY_BUFFER_STATE yy_scan_string( yy_str )
1480 yyconst char *yy_str;
1484 for ( len = 0; yy_str[len]; ++len )
1487 return yy_scan_bytes( yy_str, len );
1492 #ifndef YY_NO_SCAN_BYTES
1493 #ifdef YY_USE_PROTOS
1494 YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
1496 YY_BUFFER_STATE yy_scan_bytes( bytes, len )
1497 yyconst char *bytes;
1506 /* Get memory for full buffer, including space for trailing EOB's. */
1508 buf = (char *) yy_flex_alloc( n );
1510 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
1512 for ( i = 0; i < len; ++i )
1515 buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
1517 b = yy_scan_buffer( buf, n );
1519 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
1521 /* It's okay to grow etc. this buffer, and we should throw it
1522 * away when we're done.
1524 b->yy_is_our_buffer = 1;
1531 #ifndef YY_NO_PUSH_STATE
1532 #ifdef YY_USE_PROTOS
1533 static void yy_push_state( int new_state )
1535 static void yy_push_state( new_state )
1539 if ( yy_start_stack_ptr >= yy_start_stack_depth )
1543 yy_start_stack_depth += YY_START_STACK_INCR;
1544 new_size = yy_start_stack_depth * sizeof( int );
1546 if ( ! yy_start_stack )
1547 yy_start_stack = (int *) yy_flex_alloc( new_size );
1550 yy_start_stack = (int *) yy_flex_realloc(
1551 (void *) yy_start_stack, new_size );
1553 if ( ! yy_start_stack )
1555 "out of memory expanding start-condition stack" );
1558 yy_start_stack[yy_start_stack_ptr++] = YY_START;
1565 #ifndef YY_NO_POP_STATE
1566 static void yy_pop_state()
1568 if ( --yy_start_stack_ptr < 0 )
1569 YY_FATAL_ERROR( "start-condition stack underflow" );
1571 BEGIN(yy_start_stack[yy_start_stack_ptr]);
1576 #ifndef YY_NO_TOP_STATE
1577 static int yy_top_state()
1579 return yy_start_stack[yy_start_stack_ptr - 1];
1583 #ifndef YY_EXIT_FAILURE
1584 #define YY_EXIT_FAILURE 2
1587 #ifdef YY_USE_PROTOS
1588 static void yy_fatal_error( yyconst char msg[] )
1590 static void yy_fatal_error( msg )
1594 (void) fprintf( stderr, "%s\n", msg );
1595 exit( YY_EXIT_FAILURE );
1600 /* Redefine yyless() so it works in section 3 code. */
1606 /* Undo effects of setting up yytext. */ \
1607 yytext[yyleng] = yy_hold_char; \
1608 yy_c_buf_p = yytext + n; \
1609 yy_hold_char = *yy_c_buf_p; \
1610 *yy_c_buf_p = '\0'; \
1616 /* Internal utility routines. */
1619 #ifdef YY_USE_PROTOS
1620 static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
1622 static void yy_flex_strncpy( s1, s2, n )
1629 for ( i = 0; i < n; ++i )
1634 #ifdef YY_NEED_STRLEN
1635 #ifdef YY_USE_PROTOS
1636 static int yy_flex_strlen( yyconst char *s )
1638 static int yy_flex_strlen( s )
1643 for ( n = 0; s[n]; ++n )
1651 #ifdef YY_USE_PROTOS
1652 static void *yy_flex_alloc( yy_size_t size )
1654 static void *yy_flex_alloc( size )
1658 return (void *) malloc( size );
1661 #ifdef YY_USE_PROTOS
1662 static void *yy_flex_realloc( void *ptr, yy_size_t size )
1664 static void *yy_flex_realloc( ptr, size )
1669 /* The cast to (char *) in the following accommodates both
1670 * implementations that use char* generic pointers, and those
1671 * that use void* generic pointers. It works with the latter
1672 * because both ANSI C and C++ allow castless assignment from
1673 * any pointer type to void*, and deal with argument conversions
1674 * as though doing an assignment.
1676 return (void *) realloc( (char *) ptr, size );
1679 #ifdef YY_USE_PROTOS
1680 static void yy_flex_free( void *ptr )
1682 static void yy_flex_free( ptr )
1696 #line 101 "nslexer.l"
1711 printf("Error in nslexer\n");