home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
rtsi.com
/
2014.01.www.rtsi.com.tar
/
www.rtsi.com
/
OS9
/
OSK
/
NETWORK
/
ISP
/
bind.4.8.3.lzh
/
BIND483
/
TOOLS
/
NSLOOKUP
/
commands.c
next >
Wrap
Text File
|
1994-08-29
|
33KB
|
1,070 lines
#define FLEX_COMPRESSED
/* A lexical scanner generated by flex */
/* scanner skeleton version:
* $Header: flex.skel,v 2.0 89/06/20 15:49:46 vern Locked $
*/
#include <stdio.h>
#define FLEX_SCANNER
/* amount of stuff to slurp up with each read */
#ifndef YY_READ_BUF_SIZE
#define YY_READ_BUF_SIZE 8192
#endif
#ifndef YY_BUF_SIZE
#define YY_BUF_SIZE (YY_READ_BUF_SIZE * 2) /* size of input buffer */
#endif
/* returned upon end-of-file */
#define YY_END_TOK 0
/* copy whatever the last rule matched to the standard output */
#define ECHO fputs( yytext, yyout )
/* gets input and stuffs it into "buf". number of characters read, or YY_NULL,
* is returned in "result".
*/
#define YY_INPUT(buf,result,max_size) \
if ( (result = readln( fileno(yyin), buf, max_size )) < 0 ) \
YY_FATAL_ERROR( "read() in flex scanner failed" );
#define YY_NULL 0
#define yyterminate() return ( YY_NULL )
/* report a fatal error */
#define YY_FATAL_ERROR(msg) \
{ \
fputs( msg, stderr ); \
putc( '\n', stderr ); \
exit( 1 ); \
}
/* default yywrap function - always treat EOF as an EOF */
#define yywrap() 1
/* enter a start condition. This macro really ought to take a parameter,
* but we do it the disgusting crufty way forced on us by the ()-less
* definition of BEGIN
*/
#define BEGIN yy_start = 1 + 2 *
/* action number for EOF rule of a given start state */
#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
/* special action meaning "start processing a new file" */
#define YY_NEW_FILE goto new_file
/* default declaration of generated scanner - a define so the user can
* easily add parameters
*/
#ifdef __STDC__
#define YY_DECL int yylex( void )
#else
#define YY_DECL int yylex()
#endif
/* code executed at the end of each rule */
#define YY_BREAK break;
#define YY_END_OF_BUFFER_CHAR 0
/* done after the current pattern has been matched and before the
* corresponding action - sets up yytext
*/
#define YY_DO_BEFORE_ACTION \
yytext = yy_bp; \
yy_hold_char = *yy_cp; \
*yy_cp = '\0'; \
yy_c_buf_p = yy_cp;
/* returns the length of the matched text */
#define yyleng (yy_cp - yy_bp)
#define EOB_ACT_RESTART_SCAN 0
#define EOB_ACT_END_OF_FILE 1
#define EOB_ACT_LAST_MATCH 2
/* return all but the first 'n' matched characters back to the input stream */
#define yyless(n) \
{ \
*yy_cp = yy_hold_char; /* undo effects of setting up yytext */ \
yy_c_buf_p = yy_cp = yy_bp + n; \
YY_DO_BEFORE_ACTION; /* set up yytext again */ \
}
#define unput(c) yyunput( c, yy_bp )
#define YY_USER_ACTION
FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
char *yytext;
#ifndef __STDC__
#define const
#endif
#define INITIAL 0
/*-
* Copyright (c) 1985 The Regents of the University of California.
* All rights reserved.
*
* Redistribution and use in source and binary forms are permitted provided
* that: (1) source distributions retain this entire copyright notice and
* comment, and (2) distributions including binaries display the following
* acknowledgement: ``This product includes software developed by the
* University of California, Berkeley and its contributors'' in the
* documentation or other materials provided with the distribution and in
* all advertising materials mentioning features or use of this software.
* Neither the name of the University nor the names of its contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
#ifndef lint
static char sccsid[] = "@(#)commands.l 5.13 (Berkeley) 7/24/90";
#endif /* not lint */
/*
*******************************************************************************
*
* commands.l
*
* Andrew Cherenson CS298-26 Fall 1985
*
* Lex input file for the nslookup program command interpreter.
* When a sequence is recognized, the associated action
* routine is called. The action routine may need to
* parse the string for additional information.
*
* Recognized commands: (identifiers are shown in uppercase)
*
* server NAME - set default server to NAME, using default server
* lserver NAME - set default server to NAME, using initial server
* finger [NAME] - finger the optional NAME
* exit - exit the program
* root - set default server to the root
* ls NAME - list the domain NAME
* view FILE - sorts and view the file with more
* set OPTION - set an option
* help - print help information
* ? - print help information
* NAME - print info about the host/domain NAME
* using default server.
* NAME1 NAME2 - as above, but use NAME2 as server
*
*
* yylex Results:
* 0 upon end-of-file.
* 1 after each command.
*
*******************************************************************************
*/
#include "res.h"
extern char rootServerName[];
#define YY_END_OF_BUFFER 23
typedef int yy_state_type;
static const short int yy_accept[171] =
{ 0,
0, 0, 23, 22, 21, 22, 22, 19, 22, 22,
22, 22, 22, 22, 22, 22, 22, 0, 20, 0,
19, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 16, 0, 0, 14, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 18, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 15, 0, 3, 0, 0, 13, 0, 9, 0,
0, 0, 0, 0, 4, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 12,
0, 0, 12, 0, 0, 0, 17, 0, 6, 0,
0, 0, 0, 0, 0, 0, 7, 0, 0, 7,
0, 0, 0, 0, 9, 0, 0, 11, 0, 0,
0, 0, 6, 0, 0, 0, 0, 0, 8, 0,
0, 0, 0, 0, 1, 0, 0, 0, 5, 0,
0, 0, 0, 0, 0, 0, 2, 0, 0, 0,
0, 0, 0, 0, 5, 0, 8, 0, 10, 0
} ;
static const char yy_ec[128] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 2, 1,
1, 1, 3, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 2, 1, 1, 1, 1, 1, 1, 1, 1,
1, 4, 1, 1, 5, 4, 6, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 1, 1, 1,
6, 7, 8, 1, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
1, 9, 1, 1, 6, 1, 10, 4, 4, 11,
12, 13, 14, 15, 16, 4, 4, 17, 18, 19,
20, 21, 4, 22, 23, 24, 4, 25, 26, 27,
4, 4, 1, 1, 1, 1, 1
} ;
static const char yy_meta[28] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1
} ;
static const short int yy_base[203] =
{ 0,
491, 0, 493, 611, 611, 489, 27, 611, 54, 56,
63, 51, 48, 46, 54, 56, 60, 479, 611, 0,
611, 446, 77, 0, 61, 70, 62, 64, 74, 76,
103, 611, 439, 91, 611, 80, 94, 97, 113, 75,
95, 104, 140, 149, 96, 112, 106, 158, 107, 108,
73, 126, 110, 166, 611, 173, 182, 142, 0, 152,
150, 168, 195, 202, 161, 191, 160, 226, 197, 235,
198, 611, 244, 611, 184, 205, 611, 207, 611, 253,
213, 219, 236, 237, 611, 237, 264, 273, 282, 291,
255, 0, 275, 294, 302, 311, 299, 268, 320, 611,
327, 266, 611, 336, 345, 322, 611, 354, 611, 363,
463, 372, 381, 304, 390, 398, 611, 405, 330, 611,
414, 423, 432, 435, 611, 442, 451, 611, 460, 469,
478, 481, 611, 488, 497, 338, 0, 347, 611, 500,
507, 510, 517, 520, 611, 527, 536, 365, 611, 545,
374, 548, 555, 564, 383, 567, 611, 574, 583, 400,
0, 592, 601, 407, 611, 416, 611, 425, 611, 611,
463, 454, 447, 446, 445, 435, 428, 419, 410, 403,
393, 386, 377, 368, 357, 350, 341, 314, 296, 285,
278, 240, 229, 222, 218, 191, 177, 145, 137, 129,
117, 98
} ;
static const short int yy_def[203] =
{ 0,
171, 170, 170, 170, 170, 172, 170, 170, 173, 172,
173, 11, 11, 11, 11, 11, 11, 172, 170, 7,
170, 11, 172, 11, 11, 11, 11, 11, 11, 11,
174, 170, 11, 172, 170, 11, 11, 11, 11, 11,
11, 11, 175, 176, 11, 11, 11, 177, 11, 11,
11, 11, 11, 172, 170, 175, 176, 57, 57, 11,
11, 11, 178, 172, 11, 11, 11, 179, 11, 180,
172, 170, 174, 170, 11, 73, 170, 172, 170, 178,
172, 172, 11, 73, 170, 11, 181, 182, 183, 180,
90, 90, 11, 90, 184, 185, 11, 11, 172, 170,
181, 172, 170, 186, 187, 172, 170, 188, 170, 189,
90, 190, 191, 11, 192, 172, 170, 186, 172, 170,
193, 194, 189, 172, 170, 190, 195, 170, 191, 196,
197, 172, 170, 193, 194, 135, 135, 172, 170, 172,
198, 172, 199, 172, 170, 197, 200, 172, 170, 201,
172, 172, 198, 202, 172, 172, 170, 199, 200, 159,
159, 201, 202, 172, 170, 172, 170, 172, 170, 0,
170, 170, 170, 170, 170, 170, 170, 170, 170, 170,
170, 170, 170, 170, 170, 170, 170, 170, 170, 170,
170, 170, 170, 170, 170, 170, 170, 170, 170, 170,
170, 170
} ;
static const short int yy_nxt[639] =
{ 0,
6, 7, 8, 9, 6, 6, 6, 10, 9, 9,
9, 11, 12, 9, 13, 9, 14, 9, 9, 9,
9, 15, 16, 9, 17, 9, 9, 18, 20, 21,
22, 18, 18, 18, 23, 22, 22, 22, 24, 25,
22, 26, 22, 27, 22, 22, 22, 22, 28, 29,
22, 30, 22, 22, 18, 31, 32, 34, 35, 38,
18, 18, 18, 18, 31, 32, 37, 41, 39, 18,
18, 18, 33, 40, 33, 42, 37, 33, 34, 35,
33, 38, 33, 40, 39, 41, 33, 33, 33, 36,
33, 42, 34, 35, 50, 45, 33, 67, 163, 33,
33, 33, 33, 18, 31, 32, 33, 18, 18, 44,
18, 18, 46, 47, 48, 53, 51, 162, 52, 60,
33, 33, 33, 33, 49, 61, 62, 68, 65, 160,
33, 66, 33, 33, 33, 69, 33, 158, 33, 33,
18, 54, 55, 71, 72, 153, 18, 18, 18, 18,
57, 19, 33, 73, 74, 59, 18, 18, 18, 48,
32, 75, 64, 18, 44, 18, 18, 54, 55, 76,
77, 86, 70, 18, 54, 55, 33, 146, 33, 18,
18, 18, 18, 57, 19, 83, 33, 33, 18, 18,
18, 143, 84, 85, 33, 18, 78, 79, 89, 71,
72, 18, 18, 18, 19, 93, 76, 77, 78, 79,
33, 81, 81, 94, 95, 19, 81, 33, 141, 81,
96, 19, 136, 33, 81, 82, 18, 68, 32, 134,
88, 88, 44, 18, 18, 18, 90, 19, 84, 85,
131, 92, 18, 18, 18, 73, 74, 97, 18, 18,
44, 18, 18, 18, 78, 79, 106, 107, 98, 18,
18, 18, 33, 33, 18, 99, 100, 102, 103, 115,
18, 18, 18, 18, 102, 103, 108, 109, 129, 18,
18, 18, 18, 89, 32, 126, 105, 105, 44, 18,
18, 18, 90, 19, 33, 110, 123, 18, 18, 18,
111, 33, 18, 95, 19, 130, 18, 18, 18, 18,
18, 18, 96, 19, 121, 18, 18, 18, 18, 18,
114, 99, 100, 106, 107, 33, 70, 18, 99, 100,
33, 119, 120, 18, 18, 18, 18, 116, 117, 148,
149, 105, 18, 18, 18, 18, 119, 120, 138, 139,
118, 18, 18, 18, 18, 108, 109, 113, 18, 18,
122, 18, 18, 18, 110, 19, 148, 149, 112, 18,
18, 18, 18, 124, 125, 150, 19, 104, 18, 18,
18, 18, 127, 128, 154, 19, 88, 18, 18, 18,
18, 115, 32, 101, 18, 18, 44, 18, 18, 116,
117, 164, 165, 91, 70, 18, 116, 117, 164, 165,
87, 18, 18, 18, 18, 132, 133, 166, 167, 80,
18, 18, 18, 18, 135, 19, 168, 169, 63, 137,
18, 18, 18, 138, 139, 58, 124, 125, 18, 18,
18, 140, 18, 124, 125, 56, 43, 33, 18, 18,
18, 18, 127, 128, 18, 18, 18, 142, 18, 18,
18, 127, 128, 4, 110, 33, 18, 18, 18, 18,
130, 32, 33, 18, 18, 44, 18, 18, 18, 144,
145, 19, 132, 133, 18, 18, 18, 147, 18, 132,
133, 19, 170, 5, 18, 18, 18, 18, 135, 19,
170, 150, 19, 18, 18, 18, 151, 18, 152, 128,
170, 154, 19, 18, 18, 18, 155, 18, 156, 157,
170, 144, 145, 18, 18, 18, 70, 18, 144, 145,
170, 170, 170, 18, 18, 18, 18, 159, 19, 170,
170, 170, 161, 18, 18, 18, 150, 19, 170, 152,
128, 18, 18, 18, 142, 18, 152, 128, 170, 170,
170, 18, 18, 18, 18, 154, 19, 170, 156, 157,
18, 18, 18, 70, 18, 156, 157, 170, 170, 170,
18, 18, 18, 18, 159, 19, 170, 170, 170, 18,
18, 18, 18, 166, 167, 170, 170, 170, 18, 18,
18, 18, 168, 169, 170, 170, 170, 18, 18, 18,
3, 170, 170, 170, 170, 170, 170, 170, 170, 170,
170, 170, 170, 170, 170, 170, 170, 170, 170, 170,
170, 170, 170, 170, 170, 170, 170, 170
} ;
static const short int yy_chk[639] =
{ 0,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 9, 9, 9, 10, 10, 13,
9, 9, 9, 11, 11, 11, 12, 16, 14, 11,
11, 11, 14, 15, 13, 17, 25, 12, 23, 23,
15, 26, 16, 28, 27, 29, 17, 25, 27, 11,
28, 30, 34, 34, 40, 36, 26, 51, 202, 51,
29, 40, 30, 31, 31, 31, 36, 31, 31, 31,
31, 31, 37, 38, 39, 42, 41, 201, 41, 45,
37, 41, 45, 38, 39, 46, 47, 52, 49, 200,
42, 50, 47, 49, 50, 53, 53, 199, 46, 39,
43, 43, 43, 58, 58, 198, 43, 43, 43, 44,
44, 44, 52, 60, 60, 44, 44, 44, 48, 48,
48, 61, 48, 48, 48, 48, 48, 54, 54, 62,
62, 67, 54, 56, 56, 56, 61, 197, 60, 56,
56, 56, 57, 57, 57, 65, 67, 65, 57, 57,
57, 196, 66, 66, 62, 63, 63, 63, 69, 71,
71, 63, 63, 63, 64, 75, 76, 76, 78, 78,
75, 64, 64, 78, 81, 81, 64, 66, 195, 64,
82, 82, 194, 69, 64, 64, 68, 68, 68, 193,
68, 68, 68, 68, 68, 70, 70, 70, 84, 84,
192, 70, 70, 70, 73, 73, 73, 83, 73, 73,
73, 73, 73, 80, 80, 80, 91, 91, 86, 80,
80, 80, 83, 86, 87, 87, 87, 102, 102, 98,
87, 87, 87, 88, 88, 88, 93, 93, 191, 88,
88, 88, 89, 89, 89, 190, 89, 89, 89, 89,
89, 90, 90, 90, 98, 94, 189, 90, 90, 90,
94, 93, 95, 95, 95, 114, 95, 95, 95, 95,
95, 96, 96, 96, 188, 96, 96, 96, 96, 96,
97, 99, 99, 106, 106, 97, 99, 101, 101, 101,
114, 119, 119, 101, 101, 101, 104, 104, 104, 136,
136, 187, 104, 104, 104, 105, 105, 105, 138, 138,
186, 105, 105, 105, 108, 108, 108, 185, 108, 108,
108, 108, 108, 110, 110, 110, 148, 148, 184, 110,
110, 110, 112, 112, 112, 151, 151, 183, 112, 112,
112, 113, 113, 113, 155, 155, 182, 113, 113, 113,
115, 115, 115, 181, 115, 115, 115, 115, 115, 116,
116, 160, 160, 180, 116, 118, 118, 118, 164, 164,
179, 118, 118, 118, 121, 121, 121, 166, 166, 178,
121, 121, 121, 122, 122, 122, 168, 168, 177, 122,
122, 122, 123, 123, 123, 176, 124, 124, 123, 123,
123, 124, 126, 126, 126, 175, 174, 173, 126, 126,
126, 127, 127, 127, 172, 127, 127, 127, 127, 127,
129, 129, 129, 171, 111, 33, 129, 129, 129, 130,
130, 130, 22, 130, 130, 130, 130, 130, 131, 131,
131, 18, 132, 132, 131, 131, 131, 132, 134, 134,
134, 6, 3, 1, 134, 134, 134, 135, 135, 135,
0, 140, 140, 135, 135, 135, 140, 141, 141, 141,
0, 142, 142, 141, 141, 141, 142, 143, 143, 143,
0, 144, 144, 143, 143, 143, 144, 146, 146, 146,
0, 0, 0, 146, 146, 146, 147, 147, 147, 0,
0, 0, 147, 147, 147, 150, 150, 150, 0, 152,
152, 150, 150, 150, 152, 153, 153, 153, 0, 0,
0, 153, 153, 153, 154, 154, 154, 0, 156, 156,
154, 154, 154, 156, 158, 158, 158, 0, 0, 0,
158, 158, 158, 159, 159, 159, 0, 0, 0, 159,
159, 159, 162, 162, 162, 0, 0, 0, 162, 162,
162, 163, 163, 163, 0, 0, 0, 163, 163, 163,
170, 170, 170, 170, 170, 170, 170, 170, 170, 170,
170, 170, 170, 170, 170, 170, 170, 170, 170, 170,
170, 170, 170, 170, 170, 170, 170, 170
} ;
/* the intent behind this definition is that it'll catch
* any uses of REJECT which flex missed
*/
#define REJECT reject_used_but_not_detected
#define yymore() yymore_used_but_not_detected
/* these variables are all declared out here so that section 3 code can
* manipulate them
*/
static char *yy_c_buf_p; /* points to current character in buffer */
static int yy_init = 1; /* whether we need to initialize */
static int yy_start = 0; /* start state number */
/* true when we've seen an EOF for the current input file */
static int yy_eof_has_been_seen;
static int yy_n_chars; /* number of characters read into yy_ch_buf */
/* yy_ch_buf has to be 2 characters longer than YY_BUF_SIZE because we need
* to put in 2 end-of-buffer characters (this is explained where it is
* done) at the end of yy_ch_buf
*/
static char yy_ch_buf[YY_BUF_SIZE + 2];
/* yy_hold_char holds the character lost when yytext is formed */
static char yy_hold_char;
static yy_state_type yy_last_accepting_state;
static char *yy_last_accepting_cpos;
#ifdef __STDC__
static yy_state_type yy_get_previous_state( void );
int yy_get_next_buffer( void );
void yyunput( int c, char *buf_ptr );
int input( void );
void yyrestart( FILE *input_file );
#else
yy_state_type yy_get_previous_state();
int yy_get_next_buffer();
void yyunput();
int input();
void yyrestart();
#endif
YY_DECL
{
register yy_state_type yy_current_state;
register char *yy_cp, *yy_bp;
register int yy_act;
if ( yy_init )
{
if ( ! yy_start )
yy_start = 1; /* first start state */
if ( ! yyin )
yyin = stdin;
if ( ! yyout )
yyout = stdout;
new_file:
/* this is where we enter upon encountering an end-of-file and
* yywrap() indicating that we should continue processing
*/
/* we put in the '\n' and start reading from [1] so that an
*/
yy_ch_buf[0] = '\n';
yy_n_chars = 1;
/* we always need two end-of-buffer characters. The first causes
* a transition to the end-of-buffer state. The second causes
* a jam in that state.
*/
yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
yy_eof_has_been_seen = 0;
yytext = yy_c_buf_p = &yy_ch_buf[1];
yy_hold_char = *yy_c_buf_p;
yy_init = 0;
}
while ( 1 ) /* loops until end-of-file is reached */
{
yy_cp = yy_c_buf_p;
/* support of yytext */
*yy_cp = yy_hold_char;
/* yy_bp points to the position in yy_ch_buf of the start of the
* current run.
*/
yy_bp = yy_cp;
yy_current_state = yy_start;
if ( yy_bp[-1] == '\n' )
++yy_current_state;
do
{
register char yy_c = yy_ec[*yy_cp];
if ( yy_accept[yy_current_state] )
{
yy_last_accepting_state = yy_current_state;
yy_last_accepting_cpos = yy_cp;
}
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = yy_def[yy_current_state];
if ( yy_current_state >= 171 )
yy_c = yy_meta[yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
++yy_cp;
}
while ( yy_current_state != 170 );
yy_cp = yy_last_accepting_cpos;
yy_current_state = yy_last_accepting_state;
/* bogus while loop to let YY_BACK_TRACK, EOB_ACT_LAST_MATCH,
* and EOF actions branch here without introducing an optimizer-
* daunting goto
*/
while ( 1 )
{
yy_act = yy_accept[yy_current_state];
YY_DO_BEFORE_ACTION;
YY_USER_ACTION;
#ifdef FLEX_DEBUG
fprintf( stderr, "--accepting rule #%d (\"%s\")\n",
yy_act, yytext );
#endif
do_action: /* this label is used only to access EOF actions */
switch ( yy_act )
{
case 0: /* must backtrack */
/* undo the effects of YY_DO_BEFORE_ACTION */
*yy_cp = yy_hold_char;
yy_cp = yy_last_accepting_cpos;
yy_current_state = yy_last_accepting_state;
continue; /* go to "YY_DO_BEFORE_ACTION" */
case 1:
*yy_cp = yy_hold_char; /* undo effects of setting up yytext */
yy_c_buf_p = yy_cp -= 1;
YY_DO_BEFORE_ACTION; /* set up yytext again */
{
/*
* 0 == use current server to find
* the new one.
* 1 == use original server to find
* the new one.
*/
SetDefaultServer(yytext, 0);
return(1);
}
YY_BREAK
case 2:
*yy_cp = yy_hold_char; /* undo effects of setting up yytext */
yy_c_buf_p = yy_cp -= 1;
YY_DO_BEFORE_ACTION; /* set up yytext again */
{
SetDefaultServer(yytext, 1);
return(1);
}
YY_BREAK
case 3:
*yy_cp = yy_hold_char; /* undo effects of setting up yytext */
yy_c_buf_p = yy_cp -= 1;
YY_DO_BEFORE_ACTION; /* set up yytext again */
{
return(0);
}
YY_BREAK
case 4:
*yy_cp = yy_hold_char; /* undo effects of setting up yytext */
yy_c_buf_p = yy_cp -= 1;
YY_DO_BEFORE_ACTION; /* set up yytext again */
{
SetDefaultServer(rootServerName, 1);
return(1);
}
YY_BREAK
case 5:
*yy_cp = yy_hold_char; /* undo effects of setting up yytext */
yy_c_buf_p = yy_cp -= 1;
YY_DO_BEFORE_ACTION; /* set up yytext again */
{
/*
* 2nd arg.
* 0 == output to stdout
* 1 == output to file
*/
Finger(yytext, 1);
return(1);
}
YY_BREAK
case 6:
*yy_cp = yy_hold_char; /* undo effects of setting up yytext */
yy_c_buf_p = yy_cp -= 1;
YY_DO_BEFORE_ACTION; /* set up yytext again */
{
Finger(yytext, 0);
return(1);
}
YY_BREAK
case 7:
*yy_cp = yy_hold_char; /* undo effects of setting up yytext */
yy_c_buf_p = yy_cp -= 1;
YY_DO_BEFORE_ACTION; /* set up yytext again */
{
ViewList(yytext);
return(1);
}
YY_BREAK
case 8:
*yy_cp = yy_hold_char; /* undo effects of setting up yytext */
yy_c_buf_p = yy_cp -= 1;
YY_DO_BEFORE_ACTION; /* set up yytext again */
{
/*
* 2nd arg.
* 0 == output to stdout
* 1 == output to file
*/
ListHosts(yytext, 1);
return(1);
}
YY_BREAK
case 9:
*yy_cp = yy_hold_char; /* undo effects of setting up yytext */
yy_c_buf_p = yy_cp -= 1;
YY_DO_BEFORE_ACTION; /* set up yytext again */
{
ListHosts(yytext, 0);
return(1);
}
YY_BREAK
case 10:
*yy_cp = yy_hold_char; /* undo effects of setting up yytext */
yy_c_buf_p = yy_cp -= 1;
YY_DO_BEFORE_ACTION; /* set up yytext again */
{
/*
* 2nd arg.
* 0 == output to stdout
* 1 == output to file
*/
ListHostsByType(yytext, 1);
return(1);
}
YY_BREAK
case 11:
*yy_cp = yy_hold_char; /* undo effects of setting up yytext */
yy_c_buf_p = yy_cp -= 1;
YY_DO_BEFORE_ACTION; /* set up yytext again */
{
ListHostsByType(yytext, 0);
return(1);
}
YY_BREAK
case 12:
*yy_cp = yy_hold_char; /* undo effects of setting up yytext */
yy_c_buf_p = yy_cp -= 1;
YY_DO_BEFORE_ACTION; /* set up yytext again */
{
SetOption(yytext);
return(1);
}
YY_BREAK
case 13:
*yy_cp = yy_hold_char; /* undo effects of setting up yytext */
yy_c_buf_p = yy_cp -= 1;
YY_DO_BEFORE_ACTION; /* set up yytext again */
{
extern void PrintHelp();
PrintHelp();
return(1);
}
YY_BREAK
case 14:
*yy_cp = yy_hold_char; /* undo effects of setting up yytext */
yy_c_buf_p = yy_cp -= 1;
YY_DO_BEFORE_ACTION; /* set up yytext again */
{
PrintHelp();
return(1);
}
YY_BREAK
case 15:
*yy_cp = yy_hold_char; /* undo effects of setting up yytext */
yy_c_buf_p = yy_cp -= 1;
YY_DO_BEFORE_ACTION; /* set up yytext again */
{
/*
* 0 == output to stdout
* 1 == output to file
*/
LookupHost(yytext, 1);
return(1);
}
YY_BREAK
case 16:
*yy_cp = yy_hold_char; /* undo effects of setting up yytext */
yy_c_buf_p = yy_cp -= 1;
YY_DO_BEFORE_ACTION; /* set up yytext again */
{
LookupHost(yytext, 0);
return(1);
}
YY_BREAK
case 17:
*yy_cp = yy_hold_char; /* undo effects of setting up yytext */
yy_c_buf_p = yy_cp -= 1;
YY_DO_BEFORE_ACTION; /* set up yytext again */
{
/*
* 0 == output to stdout
* 1 == output to file
*/
LookupHostWithServer(yytext, 1);
return(1);
}
YY_BREAK
case 18:
*yy_cp = yy_hold_char; /* undo effects of setting up yytext */
yy_c_buf_p = yy_cp -= 1;
YY_DO_BEFORE_ACTION; /* set up yytext again */
{
LookupHostWithServer(yytext, 0);
return(1);
}
YY_BREAK
case 19:
{
return(1);
}
YY_BREAK
case 20:
{
printf("Unrecognized command: %s",
yytext);
return(1);
}
YY_BREAK
case 21:
{ ; }
YY_BREAK
case 22:
ECHO;
YY_BREAK
case YY_STATE_EOF(INITIAL):
yyterminate();
case YY_END_OF_BUFFER:
/* undo the effects of YY_DO_BEFORE_ACTION */
*yy_cp = yy_hold_char;
yytext = yy_bp;
switch ( yy_get_next_buffer() )
{
case EOB_ACT_END_OF_FILE:
{
if ( yywrap() )
{
/* note: because we've taken care in
* yy_get_next_buffer() to have set up yytext,
* we can now set up yy_c_buf_p so that if some
* total hoser (like flex itself) wants
* to call the scanner after we return the
* YY_NULL, it'll still work - another YY_NULL
* will get returned.
*/
yy_c_buf_p = yytext;
yy_act = YY_STATE_EOF((yy_start - 1) / 2);
goto do_action;
}
else
YY_NEW_FILE;
}
break;
case EOB_ACT_RESTART_SCAN:
yy_c_buf_p = yytext;
yy_hold_char = *yy_c_buf_p;
break;
case EOB_ACT_LAST_MATCH:
yy_c_buf_p = &yy_ch_buf[yy_n_chars];
yy_current_state = yy_get_previous_state();
yy_cp = yy_c_buf_p;
yy_bp = yytext;
continue; /* go to "YY_DO_BEFORE_ACTION" */
}
break;
default:
printf( "action # %d\n", yy_act );
YY_FATAL_ERROR( "fatal flex scanner internal error" );
}
break; /* exit bogus while loop */
}
}
}
/* yy_get_next_buffer - try to read in new buffer
*
* synopsis
* int yy_get_next_buffer();
*
* returns a code representing an action
* EOB_ACT_LAST_MATCH -
* EOB_ACT_RESTART_SCAN - restart the scanner
* EOB_ACT_END_OF_FILE - end of file
*/
int yy_get_next_buffer()
{
register char *dest = yy_ch_buf;
register char *source = yytext - 1; /* copy prev. char, too */
register int number_to_move, i;
int ret_val;
if ( yy_c_buf_p != &yy_ch_buf[yy_n_chars + 1] )
{
YY_FATAL_ERROR( "NULL in input" );
/*NOTREACHED*/
}
/* try to read more data */
/* first move last chars to start of buffer */
number_to_move = yy_c_buf_p - yytext;
for ( i = 0; i < number_to_move; ++i )
*(dest++) = *(source++);
if ( yy_eof_has_been_seen )
/* don't do the read, it's not guaranteed to return an EOF,
* just force an EOF
*/
yy_n_chars = 0;
else
{
int num_to_read = YY_BUF_SIZE - number_to_move - 1;
if ( num_to_read > YY_READ_BUF_SIZE )
num_to_read = YY_READ_BUF_SIZE;
/* read in more data */
YY_INPUT( (&yy_ch_buf[number_to_move]), yy_n_chars, num_to_read );
}
if ( yy_n_chars == 0 )
{
if ( number_to_move == 1 )
ret_val = EOB_ACT_END_OF_FILE;
else
ret_val = EOB_ACT_LAST_MATCH;
yy_eof_has_been_seen = 1;
}
else
ret_val = EOB_ACT_RESTART_SCAN;
yy_n_chars += number_to_move;
yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
/* yytext begins at the second character in
* yy_ch_buf; the first character is the one which
* preceded it before reading in the latest buffer;
* it needs to be kept around in case it's a
* with '^' rules active
*/
yytext = &yy_ch_buf[1];
return ( ret_val );
}
/* yy_get_previous_state - get the state just before the EOB char was reached
*
* synopsis
* yy_state_type yy_get_previous_state();
*/
yy_state_type yy_get_previous_state()
{
register yy_state_type yy_current_state;
register char *yy_cp;
register char *yy_bp = yytext;
yy_current_state = yy_start;
if ( yy_bp[-1] == '\n' )
++yy_current_state;
for ( yy_cp = yytext; yy_cp < yy_c_buf_p; ++yy_cp )
{
register char yy_c = yy_ec[*yy_cp];
if ( yy_accept[yy_current_state] )
{
yy_last_accepting_state = yy_current_state;
yy_last_accepting_cpos = yy_cp;
}
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = yy_def[yy_current_state];
if ( yy_current_state >= 171 )
yy_c = yy_meta[yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
}
return ( yy_current_state );
}
#ifdef __STDC__
void yyunput( int c, register char *yy_bp )
#else
void yyunput( c, yy_bp )
int c;
register char *yy_bp;
#endif
{
register char *yy_cp = yy_c_buf_p;
*yy_cp = yy_hold_char; /* undo effects of setting up yytext */
if ( yy_cp < yy_ch_buf + 2 )
{ /* need to shift things up to make room */
register int number_to_move = yy_n_chars + 2; /* +2 for EOB chars */
register char *dest = &yy_ch_buf[YY_BUF_SIZE + 2];
register char *source = &yy_ch_buf[number_to_move];
while ( source > yy_ch_buf )
*--dest = *--source;
yy_cp += dest - source;
yy_bp += dest - source;
if ( yy_cp < yy_ch_buf + 2 )
YY_FATAL_ERROR( "flex scanner push-back overflow" );
}
if ( yy_cp > yy_bp && yy_cp[-1] == '\n' )
yy_cp[-2] = '\n';
*--yy_cp = c;
YY_DO_BEFORE_ACTION; /* set up yytext again */
}
int input()
{
int c;
char *yy_cp = yy_c_buf_p;
*yy_cp = yy_hold_char;
if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
{ /* need more input */
yytext = yy_c_buf_p;
++yy_c_buf_p;
switch ( yy_get_next_buffer() )
{
/* this code, unfortunately, is somewhat redundant with
* that above
*/
case EOB_ACT_END_OF_FILE:
{
if ( yywrap() )
{
yy_c_buf_p = yytext;
return ( EOF );
}
yy_ch_buf[0] = '\n';
yy_n_chars = 1;
yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
yy_eof_has_been_seen = 0;
yytext = yy_c_buf_p = &yy_ch_buf[1];
yy_hold_char = *yy_c_buf_p;
return ( input() );
}
break;
case EOB_ACT_RESTART_SCAN:
yy_c_buf_p = yytext;
break;
case EOB_ACT_LAST_MATCH:
YY_FATAL_ERROR( "unexpected last match in input()" );
}
}
c = *yy_c_buf_p;
yy_hold_char = *++yy_c_buf_p;
return ( c );
}
#ifdef __STDC__
void yyrestart( FILE *input_file )
#else
void yyrestart( input_file )
FILE *input_file;
#endif
{
if ( yyin != stdin )
fclose( yyin );
yyin = input_file;
yy_init = 1;
}