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 >
Text File  |  1994-08-29  |  33KB  |  1,070 lines

  1. #define FLEX_COMPRESSED
  2. /* A lexical scanner generated by flex */
  3.  
  4. /* scanner skeleton version:
  5.  * $Header: flex.skel,v 2.0 89/06/20 15:49:46 vern Locked $
  6.  */
  7.  
  8. #include <stdio.h>
  9.  
  10. #define FLEX_SCANNER
  11.  
  12. /* amount of stuff to slurp up with each read */
  13. #ifndef YY_READ_BUF_SIZE
  14. #define YY_READ_BUF_SIZE 8192
  15. #endif
  16.  
  17. #ifndef YY_BUF_SIZE
  18. #define YY_BUF_SIZE (YY_READ_BUF_SIZE * 2) /* size of input buffer */
  19. #endif
  20.  
  21. /* returned upon end-of-file */
  22. #define YY_END_TOK 0
  23.  
  24. /* copy whatever the last rule matched to the standard output */
  25.  
  26. #define ECHO fputs( yytext, yyout )
  27.  
  28. /* gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
  29.  * is returned in "result".
  30.  */
  31. #define YY_INPUT(buf,result,max_size) \
  32.     if ( (result = readln( fileno(yyin), buf, max_size )) < 0 ) \
  33.         YY_FATAL_ERROR( "read() in flex scanner failed" );
  34. #define YY_NULL 0
  35. #define yyterminate() return ( YY_NULL )
  36.  
  37. /* report a fatal error */
  38. #define YY_FATAL_ERROR(msg) \
  39.     { \
  40.     fputs( msg, stderr ); \
  41.     putc( '\n', stderr ); \
  42.     exit( 1 ); \
  43.     }
  44.  
  45. /* default yywrap function - always treat EOF as an EOF */
  46. #define yywrap() 1
  47.  
  48. /* enter a start condition.  This macro really ought to take a parameter,
  49.  * but we do it the disgusting crufty way forced on us by the ()-less
  50.  * definition of BEGIN
  51.  */
  52. #define BEGIN yy_start = 1 + 2 *
  53.  
  54. /* action number for EOF rule of a given start state */
  55. #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
  56.  
  57. /* special action meaning "start processing a new file" */
  58. #define YY_NEW_FILE goto new_file
  59.  
  60. /* default declaration of generated scanner - a define so the user can
  61.  * easily add parameters
  62.  */
  63. #ifdef __STDC__
  64. #define YY_DECL int yylex( void )
  65. #else
  66. #define YY_DECL int yylex()
  67. #endif
  68.  
  69. /* code executed at the end of each rule */
  70. #define YY_BREAK break;
  71.  
  72. #define YY_END_OF_BUFFER_CHAR 0
  73.  
  74. /* done after the current pattern has been matched and before the
  75.  * corresponding action - sets up yytext
  76.  */
  77. #define YY_DO_BEFORE_ACTION \
  78.     yytext = yy_bp; \
  79.     yy_hold_char = *yy_cp; \
  80.     *yy_cp = '\0'; \
  81.     yy_c_buf_p = yy_cp;
  82.  
  83. /* returns the length of the matched text */
  84. #define yyleng (yy_cp - yy_bp)
  85.  
  86. #define EOB_ACT_RESTART_SCAN 0
  87. #define EOB_ACT_END_OF_FILE 1
  88. #define EOB_ACT_LAST_MATCH 2
  89.  
  90. /* return all but the first 'n' matched characters back to the input stream */
  91. #define yyless(n) \
  92.     { \
  93.     *yy_cp = yy_hold_char; /* undo effects of setting up yytext */ \
  94.     yy_c_buf_p = yy_cp = yy_bp + n; \
  95.     YY_DO_BEFORE_ACTION; /* set up yytext again */ \
  96.     }
  97.  
  98. #define unput(c) yyunput( c, yy_bp )
  99.  
  100. #define YY_USER_ACTION
  101.  
  102. FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
  103. char *yytext;
  104.  
  105. #ifndef __STDC__
  106. #define const
  107. #endif
  108.  
  109. #define INITIAL 0
  110.  
  111. /*-
  112.  * Copyright (c) 1985 The Regents of the University of California.
  113.  * All rights reserved.
  114.  *
  115.  * Redistribution and use in source and binary forms are permitted provided
  116.  * that: (1) source distributions retain this entire copyright notice and
  117.  * comment, and (2) distributions including binaries display the following
  118.  * acknowledgement:  ``This product includes software developed by the
  119.  * University of California, Berkeley and its contributors'' in the
  120.  * documentation or other materials provided with the distribution and in
  121.  * all advertising materials mentioning features or use of this software.
  122.  * Neither the name of the University nor the names of its contributors may
  123.  * be used to endorse or promote products derived from this software without
  124.  * specific prior written permission.
  125.  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
  126.  * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
  127.  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  128.  */
  129.  
  130. #ifndef lint
  131. static char sccsid[] = "@(#)commands.l    5.13 (Berkeley) 7/24/90";
  132. #endif /* not lint */
  133.  
  134. /*
  135.  *******************************************************************************
  136.  *
  137.  *  commands.l
  138.  *
  139.  *    Andrew Cherenson    CS298-26  Fall 1985
  140.  *
  141.  *    Lex input file for the nslookup program command interpreter.
  142.  *    When a sequence is recognized, the associated action
  143.  *    routine is called. The action routine may need to
  144.  *    parse the string for additional information.
  145.  *
  146.  *  Recognized commands: (identifiers are shown in uppercase)
  147.  *
  148.  *    server NAME    - set default server to NAME, using default server
  149.  *    lserver NAME    - set default server to NAME, using initial server
  150.  *    finger [NAME]    - finger the optional NAME
  151.  *    exit        - exit the program
  152.  *    root        - set default server to the root
  153.  *    ls NAME        - list the domain NAME
  154.  *    view FILE    - sorts and view the file with more
  155.  *    set OPTION    - set an option
  156.  *    help        - print help information
  157.  *    ?        - print help information
  158.  *    NAME        - print info about the host/domain NAME
  159.  *              using default server.
  160.  *    NAME1 NAME2    - as above, but use NAME2 as server
  161.  *
  162.  *
  163.  *   yylex Results:
  164.  *    0        upon end-of-file.
  165.  *    1        after each command.
  166.  *
  167.  *******************************************************************************
  168.  */
  169.  
  170. #include "res.h"
  171. extern char rootServerName[];
  172.  
  173. #define YY_END_OF_BUFFER 23
  174. typedef int yy_state_type;
  175. static const short int yy_accept[171] =
  176.     {   0,
  177.         0,    0,   23,   22,   21,   22,   22,   19,   22,   22,
  178.        22,   22,   22,   22,   22,   22,   22,    0,   20,    0,
  179.        19,    0,    0,    0,    0,    0,    0,    0,    0,    0,
  180.         0,   16,    0,    0,   14,    0,    0,    0,    0,    0,
  181.         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
  182.         0,    0,    0,    0,   18,    0,    0,    0,    0,    0,
  183.         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
  184.         0,   15,    0,    3,    0,    0,   13,    0,    9,    0,
  185.         0,    0,    0,    0,    4,    0,    0,    0,    0,    0,
  186.         0,    0,    0,    0,    0,    0,    0,    0,    0,   12,
  187.  
  188.         0,    0,   12,    0,    0,    0,   17,    0,    6,    0,
  189.         0,    0,    0,    0,    0,    0,    7,    0,    0,    7,
  190.         0,    0,    0,    0,    9,    0,    0,   11,    0,    0,
  191.         0,    0,    6,    0,    0,    0,    0,    0,    8,    0,
  192.         0,    0,    0,    0,    1,    0,    0,    0,    5,    0,
  193.         0,    0,    0,    0,    0,    0,    2,    0,    0,    0,
  194.         0,    0,    0,    0,    5,    0,    8,    0,   10,    0
  195.     } ;
  196.  
  197. static const char yy_ec[128] =
  198.     {   0,
  199.         1,    1,    1,    1,    1,    1,    1,    1,    2,    1,
  200.         1,    1,    3,    1,    1,    1,    1,    1,    1,    1,
  201.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  202.         1,    2,    1,    1,    1,    1,    1,    1,    1,    1,
  203.         1,    4,    1,    1,    5,    4,    6,    4,    4,    4,
  204.         4,    4,    4,    4,    4,    4,    4,    1,    1,    1,
  205.         6,    7,    8,    1,    4,    4,    4,    4,    4,    4,
  206.         4,    4,    4,    4,    4,    4,    4,    4,    4,    4,
  207.         4,    4,    4,    4,    4,    4,    4,    4,    4,    4,
  208.         1,    9,    1,    1,    6,    1,   10,    4,    4,   11,
  209.  
  210.        12,   13,   14,   15,   16,    4,    4,   17,   18,   19,
  211.        20,   21,    4,   22,   23,   24,    4,   25,   26,   27,
  212.         4,    4,    1,    1,    1,    1,    1
  213.     } ;
  214.  
  215. static const char yy_meta[28] =
  216.     {   0,
  217.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  218.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  219.         1,    1,    1,    1,    1,    1,    1
  220.     } ;
  221.  
  222. static const short int yy_base[203] =
  223.     {   0,
  224.       491,    0,  493,  611,  611,  489,   27,  611,   54,   56,
  225.        63,   51,   48,   46,   54,   56,   60,  479,  611,    0,
  226.       611,  446,   77,    0,   61,   70,   62,   64,   74,   76,
  227.       103,  611,  439,   91,  611,   80,   94,   97,  113,   75,
  228.        95,  104,  140,  149,   96,  112,  106,  158,  107,  108,
  229.        73,  126,  110,  166,  611,  173,  182,  142,    0,  152,
  230.       150,  168,  195,  202,  161,  191,  160,  226,  197,  235,
  231.       198,  611,  244,  611,  184,  205,  611,  207,  611,  253,
  232.       213,  219,  236,  237,  611,  237,  264,  273,  282,  291,
  233.       255,    0,  275,  294,  302,  311,  299,  268,  320,  611,
  234.  
  235.       327,  266,  611,  336,  345,  322,  611,  354,  611,  363,
  236.       463,  372,  381,  304,  390,  398,  611,  405,  330,  611,
  237.       414,  423,  432,  435,  611,  442,  451,  611,  460,  469,
  238.       478,  481,  611,  488,  497,  338,    0,  347,  611,  500,
  239.       507,  510,  517,  520,  611,  527,  536,  365,  611,  545,
  240.       374,  548,  555,  564,  383,  567,  611,  574,  583,  400,
  241.         0,  592,  601,  407,  611,  416,  611,  425,  611,  611,
  242.       463,  454,  447,  446,  445,  435,  428,  419,  410,  403,
  243.       393,  386,  377,  368,  357,  350,  341,  314,  296,  285,
  244.       278,  240,  229,  222,  218,  191,  177,  145,  137,  129,
  245.  
  246.       117,   98
  247.     } ;
  248.  
  249. static const short int yy_def[203] =
  250.     {   0,
  251.       171,  170,  170,  170,  170,  172,  170,  170,  173,  172,
  252.       173,   11,   11,   11,   11,   11,   11,  172,  170,    7,
  253.       170,   11,  172,   11,   11,   11,   11,   11,   11,   11,
  254.       174,  170,   11,  172,  170,   11,   11,   11,   11,   11,
  255.        11,   11,  175,  176,   11,   11,   11,  177,   11,   11,
  256.        11,   11,   11,  172,  170,  175,  176,   57,   57,   11,
  257.        11,   11,  178,  172,   11,   11,   11,  179,   11,  180,
  258.       172,  170,  174,  170,   11,   73,  170,  172,  170,  178,
  259.       172,  172,   11,   73,  170,   11,  181,  182,  183,  180,
  260.        90,   90,   11,   90,  184,  185,   11,   11,  172,  170,
  261.  
  262.       181,  172,  170,  186,  187,  172,  170,  188,  170,  189,
  263.        90,  190,  191,   11,  192,  172,  170,  186,  172,  170,
  264.       193,  194,  189,  172,  170,  190,  195,  170,  191,  196,
  265.       197,  172,  170,  193,  194,  135,  135,  172,  170,  172,
  266.       198,  172,  199,  172,  170,  197,  200,  172,  170,  201,
  267.       172,  172,  198,  202,  172,  172,  170,  199,  200,  159,
  268.       159,  201,  202,  172,  170,  172,  170,  172,  170,    0,
  269.       170,  170,  170,  170,  170,  170,  170,  170,  170,  170,
  270.       170,  170,  170,  170,  170,  170,  170,  170,  170,  170,
  271.       170,  170,  170,  170,  170,  170,  170,  170,  170,  170,
  272.  
  273.       170,  170
  274.     } ;
  275.  
  276. static const short int yy_nxt[639] =
  277.     {   0,
  278.         6,    7,    8,    9,    6,    6,    6,   10,    9,    9,
  279.         9,   11,   12,    9,   13,    9,   14,    9,    9,    9,
  280.         9,   15,   16,    9,   17,    9,    9,   18,   20,   21,
  281.        22,   18,   18,   18,   23,   22,   22,   22,   24,   25,
  282.        22,   26,   22,   27,   22,   22,   22,   22,   28,   29,
  283.        22,   30,   22,   22,   18,   31,   32,   34,   35,   38,
  284.        18,   18,   18,   18,   31,   32,   37,   41,   39,   18,
  285.        18,   18,   33,   40,   33,   42,   37,   33,   34,   35,
  286.        33,   38,   33,   40,   39,   41,   33,   33,   33,   36,
  287.        33,   42,   34,   35,   50,   45,   33,   67,  163,   33,
  288.  
  289.        33,   33,   33,   18,   31,   32,   33,   18,   18,   44,
  290.        18,   18,   46,   47,   48,   53,   51,  162,   52,   60,
  291.        33,   33,   33,   33,   49,   61,   62,   68,   65,  160,
  292.        33,   66,   33,   33,   33,   69,   33,  158,   33,   33,
  293.        18,   54,   55,   71,   72,  153,   18,   18,   18,   18,
  294.        57,   19,   33,   73,   74,   59,   18,   18,   18,   48,
  295.        32,   75,   64,   18,   44,   18,   18,   54,   55,   76,
  296.        77,   86,   70,   18,   54,   55,   33,  146,   33,   18,
  297.        18,   18,   18,   57,   19,   83,   33,   33,   18,   18,
  298.        18,  143,   84,   85,   33,   18,   78,   79,   89,   71,
  299.  
  300.        72,   18,   18,   18,   19,   93,   76,   77,   78,   79,
  301.        33,   81,   81,   94,   95,   19,   81,   33,  141,   81,
  302.        96,   19,  136,   33,   81,   82,   18,   68,   32,  134,
  303.        88,   88,   44,   18,   18,   18,   90,   19,   84,   85,
  304.       131,   92,   18,   18,   18,   73,   74,   97,   18,   18,
  305.        44,   18,   18,   18,   78,   79,  106,  107,   98,   18,
  306.        18,   18,   33,   33,   18,   99,  100,  102,  103,  115,
  307.        18,   18,   18,   18,  102,  103,  108,  109,  129,   18,
  308.        18,   18,   18,   89,   32,  126,  105,  105,   44,   18,
  309.        18,   18,   90,   19,   33,  110,  123,   18,   18,   18,
  310.  
  311.       111,   33,   18,   95,   19,  130,   18,   18,   18,   18,
  312.        18,   18,   96,   19,  121,   18,   18,   18,   18,   18,
  313.       114,   99,  100,  106,  107,   33,   70,   18,   99,  100,
  314.        33,  119,  120,   18,   18,   18,   18,  116,  117,  148,
  315.       149,  105,   18,   18,   18,   18,  119,  120,  138,  139,
  316.       118,   18,   18,   18,   18,  108,  109,  113,   18,   18,
  317.       122,   18,   18,   18,  110,   19,  148,  149,  112,   18,
  318.        18,   18,   18,  124,  125,  150,   19,  104,   18,   18,
  319.        18,   18,  127,  128,  154,   19,   88,   18,   18,   18,
  320.        18,  115,   32,  101,   18,   18,   44,   18,   18,  116,
  321.  
  322.       117,  164,  165,   91,   70,   18,  116,  117,  164,  165,
  323.        87,   18,   18,   18,   18,  132,  133,  166,  167,   80,
  324.        18,   18,   18,   18,  135,   19,  168,  169,   63,  137,
  325.        18,   18,   18,  138,  139,   58,  124,  125,   18,   18,
  326.        18,  140,   18,  124,  125,   56,   43,   33,   18,   18,
  327.        18,   18,  127,  128,   18,   18,   18,  142,   18,   18,
  328.        18,  127,  128,    4,  110,   33,   18,   18,   18,   18,
  329.       130,   32,   33,   18,   18,   44,   18,   18,   18,  144,
  330.       145,   19,  132,  133,   18,   18,   18,  147,   18,  132,
  331.       133,   19,  170,    5,   18,   18,   18,   18,  135,   19,
  332.  
  333.       170,  150,   19,   18,   18,   18,  151,   18,  152,  128,
  334.       170,  154,   19,   18,   18,   18,  155,   18,  156,  157,
  335.       170,  144,  145,   18,   18,   18,   70,   18,  144,  145,
  336.       170,  170,  170,   18,   18,   18,   18,  159,   19,  170,
  337.       170,  170,  161,   18,   18,   18,  150,   19,  170,  152,
  338.       128,   18,   18,   18,  142,   18,  152,  128,  170,  170,
  339.       170,   18,   18,   18,   18,  154,   19,  170,  156,  157,
  340.        18,   18,   18,   70,   18,  156,  157,  170,  170,  170,
  341.        18,   18,   18,   18,  159,   19,  170,  170,  170,   18,
  342.        18,   18,   18,  166,  167,  170,  170,  170,   18,   18,
  343.  
  344.        18,   18,  168,  169,  170,  170,  170,   18,   18,   18,
  345.         3,  170,  170,  170,  170,  170,  170,  170,  170,  170,
  346.       170,  170,  170,  170,  170,  170,  170,  170,  170,  170,
  347.       170,  170,  170,  170,  170,  170,  170,  170
  348.     } ;
  349.  
  350. static const short int yy_chk[639] =
  351.     {   0,
  352.         2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
  353.         2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
  354.         2,    2,    2,    2,    2,    2,    2,    7,    7,    7,
  355.         7,    7,    7,    7,    7,    7,    7,    7,    7,    7,
  356.         7,    7,    7,    7,    7,    7,    7,    7,    7,    7,
  357.         7,    7,    7,    7,    9,    9,    9,   10,   10,   13,
  358.         9,    9,    9,   11,   11,   11,   12,   16,   14,   11,
  359.        11,   11,   14,   15,   13,   17,   25,   12,   23,   23,
  360.        15,   26,   16,   28,   27,   29,   17,   25,   27,   11,
  361.        28,   30,   34,   34,   40,   36,   26,   51,  202,   51,
  362.  
  363.        29,   40,   30,   31,   31,   31,   36,   31,   31,   31,
  364.        31,   31,   37,   38,   39,   42,   41,  201,   41,   45,
  365.        37,   41,   45,   38,   39,   46,   47,   52,   49,  200,
  366.        42,   50,   47,   49,   50,   53,   53,  199,   46,   39,
  367.        43,   43,   43,   58,   58,  198,   43,   43,   43,   44,
  368.        44,   44,   52,   60,   60,   44,   44,   44,   48,   48,
  369.        48,   61,   48,   48,   48,   48,   48,   54,   54,   62,
  370.        62,   67,   54,   56,   56,   56,   61,  197,   60,   56,
  371.        56,   56,   57,   57,   57,   65,   67,   65,   57,   57,
  372.        57,  196,   66,   66,   62,   63,   63,   63,   69,   71,
  373.  
  374.        71,   63,   63,   63,   64,   75,   76,   76,   78,   78,
  375.        75,   64,   64,   78,   81,   81,   64,   66,  195,   64,
  376.        82,   82,  194,   69,   64,   64,   68,   68,   68,  193,
  377.        68,   68,   68,   68,   68,   70,   70,   70,   84,   84,
  378.       192,   70,   70,   70,   73,   73,   73,   83,   73,   73,
  379.        73,   73,   73,   80,   80,   80,   91,   91,   86,   80,
  380.        80,   80,   83,   86,   87,   87,   87,  102,  102,   98,
  381.        87,   87,   87,   88,   88,   88,   93,   93,  191,   88,
  382.        88,   88,   89,   89,   89,  190,   89,   89,   89,   89,
  383.        89,   90,   90,   90,   98,   94,  189,   90,   90,   90,
  384.  
  385.        94,   93,   95,   95,   95,  114,   95,   95,   95,   95,
  386.        95,   96,   96,   96,  188,   96,   96,   96,   96,   96,
  387.        97,   99,   99,  106,  106,   97,   99,  101,  101,  101,
  388.       114,  119,  119,  101,  101,  101,  104,  104,  104,  136,
  389.       136,  187,  104,  104,  104,  105,  105,  105,  138,  138,
  390.       186,  105,  105,  105,  108,  108,  108,  185,  108,  108,
  391.       108,  108,  108,  110,  110,  110,  148,  148,  184,  110,
  392.       110,  110,  112,  112,  112,  151,  151,  183,  112,  112,
  393.       112,  113,  113,  113,  155,  155,  182,  113,  113,  113,
  394.       115,  115,  115,  181,  115,  115,  115,  115,  115,  116,
  395.  
  396.       116,  160,  160,  180,  116,  118,  118,  118,  164,  164,
  397.       179,  118,  118,  118,  121,  121,  121,  166,  166,  178,
  398.       121,  121,  121,  122,  122,  122,  168,  168,  177,  122,
  399.       122,  122,  123,  123,  123,  176,  124,  124,  123,  123,
  400.       123,  124,  126,  126,  126,  175,  174,  173,  126,  126,
  401.       126,  127,  127,  127,  172,  127,  127,  127,  127,  127,
  402.       129,  129,  129,  171,  111,   33,  129,  129,  129,  130,
  403.       130,  130,   22,  130,  130,  130,  130,  130,  131,  131,
  404.       131,   18,  132,  132,  131,  131,  131,  132,  134,  134,
  405.       134,    6,    3,    1,  134,  134,  134,  135,  135,  135,
  406.  
  407.         0,  140,  140,  135,  135,  135,  140,  141,  141,  141,
  408.         0,  142,  142,  141,  141,  141,  142,  143,  143,  143,
  409.         0,  144,  144,  143,  143,  143,  144,  146,  146,  146,
  410.         0,    0,    0,  146,  146,  146,  147,  147,  147,    0,
  411.         0,    0,  147,  147,  147,  150,  150,  150,    0,  152,
  412.       152,  150,  150,  150,  152,  153,  153,  153,    0,    0,
  413.         0,  153,  153,  153,  154,  154,  154,    0,  156,  156,
  414.       154,  154,  154,  156,  158,  158,  158,    0,    0,    0,
  415.       158,  158,  158,  159,  159,  159,    0,    0,    0,  159,
  416.       159,  159,  162,  162,  162,    0,    0,    0,  162,  162,
  417.  
  418.       162,  163,  163,  163,    0,    0,    0,  163,  163,  163,
  419.       170,  170,  170,  170,  170,  170,  170,  170,  170,  170,
  420.       170,  170,  170,  170,  170,  170,  170,  170,  170,  170,
  421.       170,  170,  170,  170,  170,  170,  170,  170
  422.     } ;
  423.  
  424. /* the intent behind this definition is that it'll catch
  425.  * any uses of REJECT which flex missed
  426.  */
  427. #define REJECT reject_used_but_not_detected
  428. #define yymore() yymore_used_but_not_detected
  429.  
  430. /* these variables are all declared out here so that section 3 code can
  431.  * manipulate them
  432.  */
  433. static char *yy_c_buf_p;    /* points to current character in buffer */
  434. static int yy_init = 1;        /* whether we need to initialize */
  435. static int yy_start = 0;    /* start state number */
  436.  
  437. /* true when we've seen an EOF for the current input file */
  438. static int yy_eof_has_been_seen;
  439.  
  440. static int yy_n_chars;        /* number of characters read into yy_ch_buf */
  441.  
  442. /* yy_ch_buf has to be 2 characters longer than YY_BUF_SIZE because we need
  443.  * to put in 2 end-of-buffer characters (this is explained where it is
  444.  * done) at the end of yy_ch_buf
  445.  */
  446. static char yy_ch_buf[YY_BUF_SIZE + 2];
  447.  
  448. /* yy_hold_char holds the character lost when yytext is formed */
  449. static char yy_hold_char;
  450.  
  451. static yy_state_type yy_last_accepting_state;
  452. static char *yy_last_accepting_cpos;
  453.  
  454. #ifdef __STDC__
  455. static yy_state_type yy_get_previous_state( void );
  456. int yy_get_next_buffer( void );
  457. void yyunput( int c, char *buf_ptr );
  458. int input( void );
  459. void yyrestart( FILE *input_file );
  460. #else
  461. yy_state_type yy_get_previous_state();
  462. int yy_get_next_buffer();
  463. void yyunput();
  464. int input();
  465. void yyrestart();
  466. #endif
  467.  
  468. YY_DECL
  469.     {
  470.     register yy_state_type yy_current_state;
  471.     register char *yy_cp, *yy_bp;
  472.     register int yy_act;
  473.  
  474.  
  475.  
  476.     if ( yy_init )
  477.     {
  478.     if ( ! yy_start )
  479.         yy_start = 1;    /* first start state */
  480.  
  481.     if ( ! yyin )
  482.         yyin = stdin;
  483.  
  484.     if ( ! yyout )
  485.         yyout = stdout;
  486.  
  487. new_file:
  488.     /* this is where we enter upon encountering an end-of-file and
  489.      * yywrap() indicating that we should continue processing
  490.      */
  491.  
  492.     /* we put in the '\n' and start reading from [1] so that an
  493.      */
  494.  
  495.     yy_ch_buf[0] = '\n';
  496.     yy_n_chars = 1;
  497.  
  498.     /* we always need two end-of-buffer characters.  The first causes
  499.      * a transition to the end-of-buffer state.  The second causes
  500.      * a jam in that state.
  501.      */
  502.     yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
  503.     yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
  504.  
  505.     yy_eof_has_been_seen = 0;
  506.  
  507.     yytext = yy_c_buf_p = &yy_ch_buf[1];
  508.     yy_hold_char = *yy_c_buf_p;
  509.     yy_init = 0;
  510.     }
  511.  
  512.     while ( 1 )        /* loops until end-of-file is reached */
  513.     {
  514.     yy_cp = yy_c_buf_p;
  515.  
  516.     /* support of yytext */
  517.     *yy_cp = yy_hold_char;
  518.  
  519.     /* yy_bp points to the position in yy_ch_buf of the start of the
  520.      * current run.
  521.      */
  522.     yy_bp = yy_cp;
  523.  
  524.     yy_current_state = yy_start;
  525.     if ( yy_bp[-1] == '\n' )
  526.         ++yy_current_state;
  527.     do
  528.         {
  529.         register char yy_c = yy_ec[*yy_cp];
  530.         if ( yy_accept[yy_current_state] )
  531.         {
  532.         yy_last_accepting_state = yy_current_state;
  533.         yy_last_accepting_cpos = yy_cp;
  534.         }
  535.         while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
  536.         {
  537.         yy_current_state = yy_def[yy_current_state];
  538.         if ( yy_current_state >= 171 )
  539.             yy_c = yy_meta[yy_c];
  540.         }
  541.         yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
  542.         ++yy_cp;
  543.         }
  544.     while ( yy_current_state != 170 );
  545.     yy_cp = yy_last_accepting_cpos;
  546.     yy_current_state = yy_last_accepting_state;
  547.  
  548.     /* bogus while loop to let YY_BACK_TRACK, EOB_ACT_LAST_MATCH,
  549.      * and EOF actions branch here without introducing an optimizer-
  550.      * daunting goto
  551.      */
  552.     while ( 1 )
  553.         {
  554.         yy_act = yy_accept[yy_current_state];
  555.  
  556.         YY_DO_BEFORE_ACTION;
  557.         YY_USER_ACTION;
  558.  
  559. #ifdef FLEX_DEBUG
  560.         fprintf( stderr, "--accepting rule #%d (\"%s\")\n",
  561.              yy_act, yytext );
  562. #endif
  563.  
  564. do_action:    /* this label is used only to access EOF actions */
  565.         switch ( yy_act )
  566.         {
  567.         case 0: /* must backtrack */
  568.         /* undo the effects of YY_DO_BEFORE_ACTION */
  569.         *yy_cp = yy_hold_char;
  570.         yy_cp = yy_last_accepting_cpos;
  571.         yy_current_state = yy_last_accepting_state;
  572.         continue; /* go to "YY_DO_BEFORE_ACTION" */
  573.  
  574. case 1:
  575. *yy_cp = yy_hold_char; /* undo effects of setting up yytext */
  576. yy_c_buf_p = yy_cp -= 1;
  577. YY_DO_BEFORE_ACTION; /* set up yytext again */
  578. {
  579.                         /*
  580.                          * 0 == use current server to find
  581.                          *        the new one.
  582.                          * 1 == use original server to find
  583.                          *        the new one.
  584.                          */
  585.                         SetDefaultServer(yytext, 0);
  586.                         return(1);
  587.                     }
  588.     YY_BREAK
  589. case 2:
  590. *yy_cp = yy_hold_char; /* undo effects of setting up yytext */
  591. yy_c_buf_p = yy_cp -= 1;
  592. YY_DO_BEFORE_ACTION; /* set up yytext again */
  593. {
  594.                         SetDefaultServer(yytext, 1);
  595.                         return(1);
  596.                     }
  597.     YY_BREAK
  598. case 3:
  599. *yy_cp = yy_hold_char; /* undo effects of setting up yytext */
  600. yy_c_buf_p = yy_cp -= 1;
  601. YY_DO_BEFORE_ACTION; /* set up yytext again */
  602. {
  603.                         return(0);
  604.                     }
  605.     YY_BREAK
  606. case 4:
  607. *yy_cp = yy_hold_char; /* undo effects of setting up yytext */
  608. yy_c_buf_p = yy_cp -= 1;
  609. YY_DO_BEFORE_ACTION; /* set up yytext again */
  610. {
  611.                         SetDefaultServer(rootServerName, 1);
  612.                         return(1);
  613.                     }
  614.     YY_BREAK
  615. case 5:
  616. *yy_cp = yy_hold_char; /* undo effects of setting up yytext */
  617. yy_c_buf_p = yy_cp -= 1;
  618. YY_DO_BEFORE_ACTION; /* set up yytext again */
  619. {
  620.                         /*
  621.                          * 2nd arg.
  622.                          *  0 == output to stdout
  623.                          *  1 == output to file
  624.                          */
  625.                         Finger(yytext, 1);
  626.                         return(1);
  627.                     }
  628.     YY_BREAK
  629. case 6:
  630. *yy_cp = yy_hold_char; /* undo effects of setting up yytext */
  631. yy_c_buf_p = yy_cp -= 1;
  632. YY_DO_BEFORE_ACTION; /* set up yytext again */
  633. {
  634.                         Finger(yytext, 0);
  635.                         return(1);
  636.                     }
  637.     YY_BREAK
  638. case 7:
  639. *yy_cp = yy_hold_char; /* undo effects of setting up yytext */
  640. yy_c_buf_p = yy_cp -= 1;
  641. YY_DO_BEFORE_ACTION; /* set up yytext again */
  642. {
  643.                         ViewList(yytext);
  644.                         return(1);
  645.                     }
  646.     YY_BREAK
  647. case 8:
  648. *yy_cp = yy_hold_char; /* undo effects of setting up yytext */
  649. yy_c_buf_p = yy_cp -= 1;
  650. YY_DO_BEFORE_ACTION; /* set up yytext again */
  651. {
  652.                         /*
  653.                          * 2nd arg.
  654.                          *  0 == output to stdout
  655.                          *  1 == output to file
  656.                          */
  657.                         ListHosts(yytext, 1);
  658.                         return(1);
  659.                     }
  660.     YY_BREAK
  661. case 9:
  662. *yy_cp = yy_hold_char; /* undo effects of setting up yytext */
  663. yy_c_buf_p = yy_cp -= 1;
  664. YY_DO_BEFORE_ACTION; /* set up yytext again */
  665. {
  666.                         ListHosts(yytext, 0);
  667.                         return(1);
  668.                     }
  669.     YY_BREAK
  670. case 10:
  671. *yy_cp = yy_hold_char; /* undo effects of setting up yytext */
  672. yy_c_buf_p = yy_cp -= 1;
  673. YY_DO_BEFORE_ACTION; /* set up yytext again */
  674. {
  675.                         /*
  676.                          * 2nd arg.
  677.                          *  0 == output to stdout
  678.                          *  1 == output to file
  679.                          */
  680.                         ListHostsByType(yytext, 1);
  681.                         return(1);
  682.                     }
  683.     YY_BREAK
  684. case 11:
  685. *yy_cp = yy_hold_char; /* undo effects of setting up yytext */
  686. yy_c_buf_p = yy_cp -= 1;
  687. YY_DO_BEFORE_ACTION; /* set up yytext again */
  688. {
  689.                         ListHostsByType(yytext, 0);
  690.                         return(1);
  691.                     }
  692.     YY_BREAK
  693. case 12:
  694. *yy_cp = yy_hold_char; /* undo effects of setting up yytext */
  695. yy_c_buf_p = yy_cp -= 1;
  696. YY_DO_BEFORE_ACTION; /* set up yytext again */
  697. {
  698.                         SetOption(yytext);
  699.                         return(1);
  700.                     }
  701.     YY_BREAK
  702. case 13:
  703. *yy_cp = yy_hold_char; /* undo effects of setting up yytext */
  704. yy_c_buf_p = yy_cp -= 1;
  705. YY_DO_BEFORE_ACTION; /* set up yytext again */
  706. {
  707.                         extern void PrintHelp();
  708.  
  709.                         PrintHelp();
  710.                         return(1);
  711.                     }
  712.     YY_BREAK
  713. case 14:
  714. *yy_cp = yy_hold_char; /* undo effects of setting up yytext */
  715. yy_c_buf_p = yy_cp -= 1;
  716. YY_DO_BEFORE_ACTION; /* set up yytext again */
  717. {
  718.                         PrintHelp();
  719.                         return(1);
  720.                     }
  721.     YY_BREAK
  722. case 15:
  723. *yy_cp = yy_hold_char; /* undo effects of setting up yytext */
  724. yy_c_buf_p = yy_cp -= 1;
  725. YY_DO_BEFORE_ACTION; /* set up yytext again */
  726. {
  727.                         /*
  728.                          * 0 == output to stdout
  729.                          * 1 == output to file
  730.                          */
  731.                         LookupHost(yytext, 1);
  732.                         return(1);
  733.                     }
  734.     YY_BREAK
  735. case 16:
  736. *yy_cp = yy_hold_char; /* undo effects of setting up yytext */
  737. yy_c_buf_p = yy_cp -= 1;
  738. YY_DO_BEFORE_ACTION; /* set up yytext again */
  739. {
  740.                         LookupHost(yytext, 0);
  741.                         return(1);
  742.                     }
  743.     YY_BREAK
  744. case 17:
  745. *yy_cp = yy_hold_char; /* undo effects of setting up yytext */
  746. yy_c_buf_p = yy_cp -= 1;
  747. YY_DO_BEFORE_ACTION; /* set up yytext again */
  748. {
  749.                         /*
  750.                          * 0 == output to stdout
  751.                          * 1 == output to file
  752.                          */
  753.                         LookupHostWithServer(yytext, 1);
  754.                         return(1);
  755.                     }
  756.     YY_BREAK
  757. case 18:
  758. *yy_cp = yy_hold_char; /* undo effects of setting up yytext */
  759. yy_c_buf_p = yy_cp -= 1;
  760. YY_DO_BEFORE_ACTION; /* set up yytext again */
  761. {
  762.                         LookupHostWithServer(yytext, 0);
  763.                         return(1);
  764.                     }
  765.     YY_BREAK
  766. case 19:
  767. {
  768.                         return(1);
  769.                     }
  770.     YY_BREAK
  771. case 20:
  772. {
  773.                         printf("Unrecognized command: %s",
  774.                             yytext);
  775.                         return(1);
  776.                     }
  777.     YY_BREAK
  778. case 21:
  779. { ; }
  780.     YY_BREAK
  781. case 22:
  782. ECHO;
  783.     YY_BREAK
  784. case YY_STATE_EOF(INITIAL):
  785.     yyterminate();
  786.  
  787.         case YY_END_OF_BUFFER:
  788.             /* undo the effects of YY_DO_BEFORE_ACTION */
  789.             *yy_cp = yy_hold_char;
  790.  
  791.             yytext = yy_bp;
  792.  
  793.             switch ( yy_get_next_buffer() )
  794.             {
  795.             case EOB_ACT_END_OF_FILE:
  796.                 {
  797.                 if ( yywrap() )
  798.                 {
  799.                 /* note: because we've taken care in
  800.                  * yy_get_next_buffer() to have set up yytext,
  801.                  * we can now set up yy_c_buf_p so that if some
  802.                  * total hoser (like flex itself) wants
  803.                  * to call the scanner after we return the
  804.                  * YY_NULL, it'll still work - another YY_NULL
  805.                  * will get returned.
  806.                  */
  807.                 yy_c_buf_p = yytext;
  808.  
  809.                 yy_act = YY_STATE_EOF((yy_start - 1) / 2);
  810.                 goto do_action;
  811.                 }
  812.  
  813.                 else
  814.                 YY_NEW_FILE;
  815.                 }
  816.                 break;
  817.  
  818.             case EOB_ACT_RESTART_SCAN:
  819.                 yy_c_buf_p = yytext;
  820.                 yy_hold_char = *yy_c_buf_p;
  821.                 break;
  822.  
  823.             case EOB_ACT_LAST_MATCH:
  824.                 yy_c_buf_p = &yy_ch_buf[yy_n_chars];
  825.  
  826.                 yy_current_state = yy_get_previous_state();
  827.  
  828.                 yy_cp = yy_c_buf_p;
  829.                 yy_bp = yytext;
  830.                 continue; /* go to "YY_DO_BEFORE_ACTION" */
  831.             }
  832.             break;
  833.  
  834.         default:
  835.             printf( "action # %d\n", yy_act );
  836.             YY_FATAL_ERROR( "fatal flex scanner internal error" );
  837.         }
  838.  
  839.         break; /* exit bogus while loop */
  840.         }
  841.     }
  842.     }
  843.  
  844.  
  845. /* yy_get_next_buffer - try to read in new buffer
  846.  *
  847.  * synopsis
  848.  *     int yy_get_next_buffer();
  849.  *     
  850.  * returns a code representing an action
  851.  *     EOB_ACT_LAST_MATCH - 
  852.  *     EOB_ACT_RESTART_SCAN - restart the scanner
  853.  *     EOB_ACT_END_OF_FILE - end of file
  854.  */
  855.  
  856. int yy_get_next_buffer()
  857.  
  858.     {
  859.     register char *dest = yy_ch_buf;
  860.     register char *source = yytext - 1; /* copy prev. char, too */
  861.     register int number_to_move, i;
  862.     int ret_val;
  863.     
  864.     if ( yy_c_buf_p != &yy_ch_buf[yy_n_chars + 1] )
  865.     {
  866.     YY_FATAL_ERROR( "NULL in input" );
  867.     /*NOTREACHED*/
  868.     }
  869.  
  870.     /* try to read more data */
  871.  
  872.     /* first move last chars to start of buffer */
  873.     number_to_move = yy_c_buf_p - yytext;
  874.  
  875.     for ( i = 0; i < number_to_move; ++i )
  876.     *(dest++) = *(source++);
  877.  
  878.     if ( yy_eof_has_been_seen )
  879.     /* don't do the read, it's not guaranteed to return an EOF,
  880.      * just force an EOF
  881.      */
  882.     yy_n_chars = 0;
  883.  
  884.     else
  885.     {
  886.     int num_to_read = YY_BUF_SIZE - number_to_move - 1;
  887.  
  888.     if ( num_to_read > YY_READ_BUF_SIZE )
  889.         num_to_read = YY_READ_BUF_SIZE;
  890.  
  891.     /* read in more data */
  892.     YY_INPUT( (&yy_ch_buf[number_to_move]), yy_n_chars, num_to_read );
  893.     }
  894.  
  895.     if ( yy_n_chars == 0 )
  896.     {
  897.     if ( number_to_move == 1 )
  898.         ret_val = EOB_ACT_END_OF_FILE;
  899.     else
  900.         ret_val = EOB_ACT_LAST_MATCH;
  901.  
  902.     yy_eof_has_been_seen = 1;
  903.     }
  904.  
  905.     else
  906.     ret_val = EOB_ACT_RESTART_SCAN;
  907.  
  908.     yy_n_chars += number_to_move;
  909.     yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
  910.     yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
  911.  
  912.     /* yytext begins at the second character in
  913.      * yy_ch_buf; the first character is the one which
  914.      * preceded it before reading in the latest buffer;
  915.      * it needs to be kept around in case it's a
  916.      * with '^' rules active
  917.      */
  918.  
  919.     yytext = &yy_ch_buf[1];
  920.  
  921.     return ( ret_val );
  922.     }
  923.  
  924.  
  925. /* yy_get_previous_state - get the state just before the EOB char was reached
  926.  *
  927.  * synopsis
  928.  *     yy_state_type yy_get_previous_state();
  929.  */
  930.  
  931. yy_state_type yy_get_previous_state()
  932.  
  933.     {
  934.     register yy_state_type yy_current_state;
  935.     register char *yy_cp;
  936.  
  937.     register char *yy_bp = yytext;
  938.  
  939.     yy_current_state = yy_start;
  940.     if ( yy_bp[-1] == '\n' )
  941.     ++yy_current_state;
  942.  
  943.     for ( yy_cp = yytext; yy_cp < yy_c_buf_p; ++yy_cp )
  944.     {
  945.     register char yy_c = yy_ec[*yy_cp];
  946.     if ( yy_accept[yy_current_state] )
  947.         {
  948.         yy_last_accepting_state = yy_current_state;
  949.         yy_last_accepting_cpos = yy_cp;
  950.         }
  951.     while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
  952.         {
  953.         yy_current_state = yy_def[yy_current_state];
  954.         if ( yy_current_state >= 171 )
  955.         yy_c = yy_meta[yy_c];
  956.         }
  957.     yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
  958.     }
  959.  
  960.     return ( yy_current_state );
  961.     }
  962.  
  963.  
  964. #ifdef __STDC__
  965. void yyunput( int c, register char *yy_bp )
  966. #else
  967. void yyunput( c, yy_bp )
  968. int c;
  969. register char *yy_bp;
  970. #endif
  971.  
  972.     {
  973.     register char *yy_cp = yy_c_buf_p;
  974.  
  975.     *yy_cp = yy_hold_char; /* undo effects of setting up yytext */
  976.  
  977.     if ( yy_cp < yy_ch_buf + 2 )
  978.     { /* need to shift things up to make room */
  979.     register int number_to_move = yy_n_chars + 2; /* +2 for EOB chars */
  980.     register char *dest = &yy_ch_buf[YY_BUF_SIZE + 2];
  981.     register char *source = &yy_ch_buf[number_to_move];
  982.  
  983.     while ( source > yy_ch_buf )
  984.         *--dest = *--source;
  985.  
  986.     yy_cp += dest - source;
  987.     yy_bp += dest - source;
  988.  
  989.     if ( yy_cp < yy_ch_buf + 2 )
  990.         YY_FATAL_ERROR( "flex scanner push-back overflow" );
  991.     }
  992.  
  993.     if ( yy_cp > yy_bp && yy_cp[-1] == '\n' )
  994.     yy_cp[-2] = '\n';
  995.  
  996.     *--yy_cp = c;
  997.  
  998.     YY_DO_BEFORE_ACTION; /* set up yytext again */
  999.     }
  1000.  
  1001.  
  1002. int input()
  1003.  
  1004.     {
  1005.     int c;
  1006.     char *yy_cp = yy_c_buf_p;
  1007.  
  1008.     *yy_cp = yy_hold_char;
  1009.  
  1010.     if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
  1011.     { /* need more input */
  1012.     yytext = yy_c_buf_p;
  1013.     ++yy_c_buf_p;
  1014.  
  1015.     switch ( yy_get_next_buffer() )
  1016.         {
  1017.         /* this code, unfortunately, is somewhat redundant with
  1018.          * that above
  1019.          */
  1020.         case EOB_ACT_END_OF_FILE:
  1021.         {
  1022.         if ( yywrap() )
  1023.             {
  1024.             yy_c_buf_p = yytext;
  1025.             return ( EOF );
  1026.             }
  1027.  
  1028.         yy_ch_buf[0] = '\n';
  1029.         yy_n_chars = 1;
  1030.         yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
  1031.         yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
  1032.         yy_eof_has_been_seen = 0;
  1033.         yytext = yy_c_buf_p = &yy_ch_buf[1];
  1034.         yy_hold_char = *yy_c_buf_p;
  1035.  
  1036.         return ( input() );
  1037.         }
  1038.         break;
  1039.  
  1040.         case EOB_ACT_RESTART_SCAN:
  1041.         yy_c_buf_p = yytext;
  1042.         break;
  1043.  
  1044.         case EOB_ACT_LAST_MATCH:
  1045.         YY_FATAL_ERROR( "unexpected last match in input()" );
  1046.         }
  1047.     }
  1048.  
  1049.     c = *yy_c_buf_p;
  1050.     yy_hold_char = *++yy_c_buf_p;
  1051.  
  1052.     return ( c );
  1053.     }
  1054.  
  1055.  
  1056. #ifdef __STDC__
  1057. void yyrestart( FILE *input_file )
  1058. #else
  1059. void yyrestart( input_file )
  1060. FILE *input_file;
  1061. #endif
  1062.  
  1063.     {
  1064.     if ( yyin != stdin )
  1065.     fclose( yyin );
  1066.  
  1067.     yyin = input_file;
  1068.     yy_init = 1;
  1069.     }
  1070.