home *** CD-ROM | disk | FTP | other *** search
/ ftp.uni-stuttgart.de/pub/systems/acorn/ / Acorn.tar / Acorn / acornet / dev / gawk.spk / gawk-2154 / c / awktab < prev    next >
Text File  |  1994-02-25  |  101KB  |  3,123 lines

  1. /*  A Bison parser, made from awk.y  */
  2.  
  3. #define YYBISON 1  /* Identify Bison output.  */
  4.  
  5. #define    FUNC_CALL    258
  6. #define    NAME    259
  7. #define    REGEXP    260
  8. #define    ERROR    261
  9. #define    YNUMBER    262
  10. #define    YSTRING    263
  11. #define    RELOP    264
  12. #define    APPEND_OP    265
  13. #define    ASSIGNOP    266
  14. #define    MATCHOP    267
  15. #define    NEWLINE    268
  16. #define    CONCAT_OP    269
  17. #define    LEX_BEGIN    270
  18. #define    LEX_END    271
  19. #define    LEX_IF    272
  20. #define    LEX_ELSE    273
  21. #define    LEX_RETURN    274
  22. #define    LEX_DELETE    275
  23. #define    LEX_WHILE    276
  24. #define    LEX_DO    277
  25. #define    LEX_FOR    278
  26. #define    LEX_BREAK    279
  27. #define    LEX_CONTINUE    280
  28. #define    LEX_PRINT    281
  29. #define    LEX_PRINTF    282
  30. #define    LEX_NEXT    283
  31. #define    LEX_EXIT    284
  32. #define    LEX_FUNCTION    285
  33. #define    LEX_GETLINE    286
  34. #define    LEX_IN    287
  35. #define    LEX_AND    288
  36. #define    LEX_OR    289
  37. #define    INCREMENT    290
  38. #define    DECREMENT    291
  39. #define    LEX_BUILTIN    292
  40. #define    LEX_LENGTH    293
  41. #define    UNARY    294
  42.  
  43. #include "awk.h"
  44.  
  45. static void yyerror (); /* va_alist */
  46. static char *get_src_buf P((void));
  47. static int yylex P((void));
  48. static NODE *node_common P((NODETYPE op));
  49. static NODE *snode P((NODE *subn, NODETYPE op, int sindex));
  50. static NODE *mkrangenode P((NODE *cpair));
  51. static NODE *make_for_loop P((NODE *init, NODE *cond, NODE *incr));
  52. static NODE *append_right P((NODE *list, NODE *new));
  53. static void func_install P((NODE *params, NODE *def));
  54. static void pop_var P((NODE *np, int freeit));
  55. static void pop_params P((NODE *params));
  56. static NODE *make_param P((char *name));
  57. static NODE *mk_rexp P((NODE *exp));
  58.  
  59. static int want_assign;        /* lexical scanning kludge */
  60. static int want_regexp;        /* lexical scanning kludge */
  61. static int can_return;        /* lexical scanning kludge */
  62. static int io_allowed = 1;    /* lexical scanning kludge */
  63. static char *lexptr;        /* pointer to next char during parsing */
  64. static char *lexend;
  65. static char *lexptr_begin;    /* keep track of where we were for error msgs */
  66. static char *lexeme;        /* beginning of lexeme for debugging */
  67. static char *thisline = NULL;
  68. #define YYDEBUG_LEXER_TEXT (lexeme)
  69. static int param_counter;
  70. static char *tokstart = NULL;
  71. static char *tok = NULL;
  72. static char *tokend;
  73.  
  74. #define HASHSIZE    1021    /* this constant only used here */
  75. NODE *variables[HASHSIZE];
  76.  
  77. extern char *source;
  78. extern int sourceline;
  79. extern struct src *srcfiles;
  80. extern int numfiles;
  81. extern int errcount;
  82. extern NODE *begin_block;
  83. extern NODE *end_block;
  84.  
  85. typedef union {
  86.     long lval;
  87.     AWKNUM fval;
  88.     NODE *nodeval;
  89.     NODETYPE nodetypeval;
  90.     char *sval;
  91.     NODE *(*ptrval)();
  92. } YYSTYPE;
  93.  
  94. #ifndef YYLTYPE
  95. typedef
  96.   struct yyltype
  97.     {
  98.       int timestamp;
  99.       int first_line;
  100.       int first_column;
  101.       int last_line;
  102.       int last_column;
  103.       char *text;
  104.    }
  105.   yyltype;
  106.  
  107. #define YYLTYPE yyltype
  108. #endif
  109.  
  110. #include <stdio.h>
  111.  
  112. #ifndef __STDC__
  113. #define const
  114. #endif
  115.  
  116.  
  117.  
  118. #define    YYFINAL        307
  119. #define    YYFLAG        -32768
  120. #define    YYNTBASE    61
  121.  
  122. #define YYTRANSLATE(x) ((unsigned)(x) <= 294 ? yytranslate[x] : 106)
  123.  
  124. static const char yytranslate[] = {     0,
  125.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  126.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  127.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  128.      2,     2,    50,     2,     2,    53,    49,     2,     2,    54,
  129.     55,    47,    45,    41,    46,     2,    48,     2,     2,     2,
  130.      2,     2,     2,     2,     2,     2,     2,    40,    60,    42,
  131.      2,    43,    39,     2,     2,     2,     2,     2,     2,     2,
  132.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  133.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  134.     56,     2,    57,    52,     2,     2,     2,     2,     2,     2,
  135.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  136.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  137.      2,     2,    58,    44,    59,     2,     2,     2,     2,     2,
  138.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  139.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  140.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  141.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  142.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  143.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  144.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  145.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  146.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  147.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  148.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  149.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  150.      2,     2,     2,     2,     2,     1,     2,     3,     4,     5,
  151.      6,     7,     8,     9,    10,    11,    12,    13,    14,    15,
  152.     16,    17,    18,    19,    20,    21,    22,    23,    24,    25,
  153.     26,    27,    28,    29,    30,    31,    32,    33,    34,    35,
  154.     36,    37,    38,    51
  155. };
  156.  
  157. #if YYDEBUG != 0
  158. static const short yyprhs[] = {     0,
  159.      0,     4,     6,     9,    11,    14,    15,    19,    20,    24,
  160.     27,    30,    33,    35,    38,    41,    43,    45,    47,    49,
  161.     51,    52,    60,    65,    67,    71,    72,    77,    83,    88,
  162.     90,    93,    95,    98,   100,   103,   106,   109,   113,   115,
  163.    122,   131,   140,   151,   161,   164,   167,   174,   179,   183,
  164.    187,   188,   193,   200,   204,   207,   209,   211,   218,   228,
  165.    230,   233,   234,   236,   237,   240,   241,   244,   247,   250,
  166.    251,   253,   255,   259,   261,   264,   268,   269,   271,   272,
  167.    274,   276,   280,   282,   285,   289,   293,   294,   296,   298,
  168.    302,   304,   307,   311,   315,   316,   321,   327,   332,   336,
  169.    340,   344,   348,   350,   353,   357,   361,   365,   369,   375,
  170.    377,   380,   381,   386,   390,   394,   398,   400,   403,   407,
  171.    411,   415,   421,   423,   426,   428,   432,   436,   440,   444,
  172.    448,   452,   455,   458,   461,   465,   470,   475,   477,   482,
  173.    484,   487,   490,   492,   494,   497,   500,   501,   503,   505,
  174.    510,   513,   516,   519,   521,   522,   524,   526
  175. };
  176.  
  177. #endif
  178.  
  179. static const short yyrhs[] = {    82,
  180.     62,    82,     0,    63,     0,    62,    63,     0,     1,     0,
  181.     62,     1,     0,     0,    15,    64,    74,     0,     0,    16,
  182.     65,    74,     0,    15,    76,     0,    16,    76,     0,    71,
  183.     74,     0,    74,     0,    71,    76,     0,    68,    70,     0,
  184.      4,     0,     3,     0,    67,     0,    37,     0,    38,     0,
  185.      0,    30,    69,    66,    54,    85,   102,    82,     0,   100,
  186.     75,   101,   103,     0,    92,     0,    92,    41,    92,     0,
  187.      0,    48,    73,     5,    48,     0,   100,    75,   101,   103,
  188.     82,     0,   100,   101,   103,    82,     0,    77,     0,    75,
  189.     77,     0,     1,     0,    75,     1,     0,    81,     0,   104,
  190.     82,     0,   104,    82,     0,   100,   101,     0,   100,    75,
  191.    101,     0,    80,     0,    21,    54,    92,   102,    82,    77,
  192.      0,    22,    82,    77,    21,    54,    92,   102,    82,     0,
  193.     23,    54,     4,    32,     4,   102,    82,    77,     0,    23,
  194.     54,    87,   104,    92,   104,    87,   102,    82,    77,     0,
  195.     23,    54,    87,   104,   104,    87,   102,    82,    77,     0,
  196.     24,    76,     0,    25,    76,     0,    79,    54,    91,   102,
  197.     84,    76,     0,    79,    88,    84,    76,     0,    28,    87,
  198.     76,     0,    29,    87,    76,     0,     0,    19,    78,    87,
  199.     76,     0,    20,     4,    56,    91,    57,    76,     0,    20,
  200.      4,    76,     0,    92,    76,     0,    26,     0,    27,     0,
  201.     17,    54,    92,   102,    82,    77,     0,    17,    54,    92,
  202.    102,    82,    77,    18,    82,    77,     0,    13,     0,    81,
  203.     13,     0,     0,    81,     0,     0,    42,    96,     0,     0,
  204.     43,    92,     0,    10,    92,     0,    44,    92,     0,     0,
  205.     86,     0,     4,     0,    86,   105,     4,     0,     1,     0,
  206.     86,     1,     0,    86,   105,     1,     0,     0,    92,     0,
  207.      0,    89,     0,    94,     0,    89,   105,    94,     0,     1,
  208.      0,    89,     1,     0,    89,     1,    94,     0,    89,   105,
  209.      1,     0,     0,    91,     0,    92,     0,    91,   105,    92,
  210.      0,     1,     0,    91,     1,     0,    91,     1,    92,     0,
  211.     91,   105,     1,     0,     0,    99,    11,    93,    92,     0,
  212.     54,    91,   102,    32,     4,     0,    92,    44,    31,    98,
  213.      0,    31,    98,    83,     0,    92,    33,    92,     0,    92,
  214.     34,    92,     0,    92,    12,    92,     0,    72,     0,    50,
  215.     72,     0,    92,    32,     4,     0,    92,     9,    92,     0,
  216.     92,    42,    92,     0,    92,    43,    92,     0,    92,    39,
  217.     92,    40,    92,     0,    96,     0,    92,    96,     0,     0,
  218.     99,    11,    95,    94,     0,    94,    33,    94,     0,    94,
  219.     34,    94,     0,    31,    98,    83,     0,    72,     0,    50,
  220.     72,     0,    94,    12,    94,     0,    94,    32,     4,     0,
  221.     94,     9,    94,     0,    94,    39,    94,    40,    94,     0,
  222.     96,     0,    94,    96,     0,    97,     0,    96,    52,    96,
  223.      0,    96,    47,    96,     0,    96,    48,    96,     0,    96,
  224.     49,    96,     0,    96,    45,    96,     0,    96,    46,    96,
  225.      0,    99,    35,     0,    99,    36,     0,    50,    96,     0,
  226.     54,    92,   102,     0,    37,    54,    90,   102,     0,    38,
  227.     54,    90,   102,     0,    38,     0,     3,    54,    90,   102,
  228.      0,    99,     0,    35,    99,     0,    36,    99,     0,     7,
  229.      0,     8,     0,    46,    96,     0,    45,    96,     0,     0,
  230.     99,     0,     4,     0,     4,    56,    91,    57,     0,    53,
  231.     97,     0,    58,    82,     0,    59,    82,     0,    55,     0,
  232.      0,   104,     0,    60,     0,    41,    82,     0
  233. };
  234.  
  235. #if YYDEBUG != 0
  236. static const short yyrline[] = { 0,
  237.    135,   140,   148,   164,   165,   169,   171,   185,   187,   201,
  238.    207,   213,   215,   217,   230,   239,   241,   243,   253,   254,
  239.    258,   262,   270,   279,   281,   290,   292,   310,   312,   317,
  240.    319,   327,   329,   334,   335,   339,   341,   343,   345,   347,
  241.    349,   351,   356,   360,   365,   368,   371,   373,   384,   411,
  242.    413,   415,   417,   419,   433,   438,   440,   445,   450,   457,
  243.    459,   463,   464,   468,   470,   475,   477,   479,   481,   486,
  244.    488,   493,   495,   497,   499,   501,   507,   509,   514,   516,
  245.    521,   523,   529,   531,   533,   535,   540,   542,   547,   549,
  246.    555,   557,   559,   561,   566,   569,   574,   576,   581,   587,
  247.    589,   591,   597,   599,   607,   609,   615,   617,   619,   621,
  248.    623,   628,   631,   632,   634,   636,   642,   644,   646,   648,
  249.    650,   652,   654,   656,   661,   663,   665,   667,   669,   671,
  250.    673,   675,   677,   682,   684,   686,   689,   691,   699,   703,
  251.    704,   706,   708,   710,   713,   720,   725,   727,   732,   734,
  252.    742,   747,   751,   755,   759,   760,   764,   767
  253. };
  254.  
  255. static const char * const yytname[] = {   "$","error","$illegal.","FUNC_CALL",
  256. "NAME","REGEXP","ERROR","YNUMBER","YSTRING","RELOP","APPEND_OP","ASSIGNOP","MATCHOP",
  257. "NEWLINE","CONCAT_OP","LEX_BEGIN","LEX_END","LEX_IF","LEX_ELSE","LEX_RETURN",
  258. "LEX_DELETE","LEX_WHILE","LEX_DO","LEX_FOR","LEX_BREAK","LEX_CONTINUE","LEX_PRINT",
  259. "LEX_PRINTF","LEX_NEXT","LEX_EXIT","LEX_FUNCTION","LEX_GETLINE","LEX_IN","LEX_AND",
  260. "LEX_OR","INCREMENT","DECREMENT","LEX_BUILTIN","LEX_LENGTH","'?'","':'","','",
  261. "'<'","'>'","'|'","'+'","'-'","'*'","'/'","'%'","'!'","UNARY","'^'","'$'","'('",
  262. "')'","'['","']'","'{'","'}'","';'","start","program","rule","@1","@2","func_name",
  263. "lex_builtin","function_prologue","@3","function_body","pattern","regexp","@4",
  264. "action","statements","statement_term","statement","@5","print","if_statement",
  265. "nls","opt_nls","input_redir","output_redir","opt_param_list","param_list","opt_exp",
  266. "opt_rexpression_list","rexpression_list","opt_expression_list","expression_list",
  267. "exp","@6","rexp","@7","simp_exp","non_post_simp_exp","opt_variable","variable",
  268. "l_brace","r_brace","r_paren","opt_semi","semi","comma",""
  269. };
  270. #endif
  271.  
  272. static const short yyr1[] = {     0,
  273.     61,    62,    62,    62,    62,    64,    63,    65,    63,    63,
  274.     63,    63,    63,    63,    63,    66,    66,    66,    67,    67,
  275.     69,    68,    70,    71,    71,    73,    72,    74,    74,    75,
  276.     75,    75,    75,    76,    76,    77,    77,    77,    77,    77,
  277.     77,    77,    77,    77,    77,    77,    77,    77,    77,    77,
  278.     78,    77,    77,    77,    77,    79,    79,    80,    80,    81,
  279.     81,    82,    82,    83,    83,    84,    84,    84,    84,    85,
  280.     85,    86,    86,    86,    86,    86,    87,    87,    88,    88,
  281.     89,    89,    89,    89,    89,    89,    90,    90,    91,    91,
  282.     91,    91,    91,    91,    93,    92,    92,    92,    92,    92,
  283.     92,    92,    92,    92,    92,    92,    92,    92,    92,    92,
  284.     92,    95,    94,    94,    94,    94,    94,    94,    94,    94,
  285.     94,    94,    94,    94,    96,    96,    96,    96,    96,    96,
  286.     96,    96,    96,    97,    97,    97,    97,    97,    97,    97,
  287.     97,    97,    97,    97,    97,    97,    98,    98,    99,    99,
  288.     99,   100,   101,   102,   103,   103,   104,   105
  289. };
  290.  
  291. static const short yyr2[] = {     0,
  292.      3,     1,     2,     1,     2,     0,     3,     0,     3,     2,
  293.      2,     2,     1,     2,     2,     1,     1,     1,     1,     1,
  294.      0,     7,     4,     1,     3,     0,     4,     5,     4,     1,
  295.      2,     1,     2,     1,     2,     2,     2,     3,     1,     6,
  296.      8,     8,    10,     9,     2,     2,     6,     4,     3,     3,
  297.      0,     4,     6,     3,     2,     1,     1,     6,     9,     1,
  298.      2,     0,     1,     0,     2,     0,     2,     2,     2,     0,
  299.      1,     1,     3,     1,     2,     3,     0,     1,     0,     1,
  300.      1,     3,     1,     2,     3,     3,     0,     1,     1,     3,
  301.      1,     2,     3,     3,     0,     4,     5,     4,     3,     3,
  302.      3,     3,     1,     2,     3,     3,     3,     3,     5,     1,
  303.      2,     0,     4,     3,     3,     3,     1,     2,     3,     3,
  304.      3,     5,     1,     2,     1,     3,     3,     3,     3,     3,
  305.      3,     2,     2,     2,     3,     4,     4,     1,     4,     1,
  306.      2,     2,     1,     1,     2,     2,     0,     1,     1,     4,
  307.      2,     2,     2,     1,     0,     1,     1,     2
  308. };
  309.  
  310. static const short yydefact[] = {    62,
  311.     60,    63,     0,    61,     4,     0,   149,   143,   144,     6,
  312.      8,    21,   147,     0,     0,     0,   138,     0,     0,    26,
  313.      0,     0,     0,    62,     0,     2,     0,     0,   103,    13,
  314.     24,   110,   125,   140,     0,     0,     0,   157,     0,    10,
  315.     34,    62,     0,    11,     0,    64,   148,   141,   142,     0,
  316.      0,     0,     0,   146,   140,   145,     0,   104,   134,   151,
  317.    140,    91,     0,    89,   152,     5,     3,     1,    15,     0,
  318.     12,    14,     0,     0,     0,     0,     0,     0,     0,     0,
  319.      0,     0,   111,     0,     0,     0,     0,     0,     0,    95,
  320.    132,   133,    32,     0,    51,     0,     0,    62,     0,     0,
  321.      0,    56,    57,    77,    77,    62,     0,    30,     0,    39,
  322.      0,     0,   155,    62,     0,     0,    89,     0,     7,    35,
  323.      9,    17,    16,    19,    20,     0,    18,     0,    99,     0,
  324.      0,     0,     0,    92,    62,   154,     0,     0,   135,     0,
  325.    106,   102,   105,   100,   101,     0,    25,   107,   108,   147,
  326.    130,   131,   127,   128,   129,   126,     0,     0,    77,     0,
  327.      0,     0,    77,    45,    46,     0,    78,     0,   153,    33,
  328.     31,   155,    83,   147,     0,     0,   117,    66,     0,    81,
  329.    123,   140,    55,     0,    37,    62,   156,    36,   139,   150,
  330.      0,    65,   136,   137,    27,    93,   158,     0,    94,    90,
  331.    155,     0,    98,    96,     0,     0,     0,    54,     0,     0,
  332.    149,     0,    49,    50,    62,    64,   118,     0,     0,     0,
  333.      0,     0,    84,     0,     0,     0,     0,     0,     0,     0,
  334.    124,   112,    38,    29,    74,    72,     0,     0,    97,    23,
  335.    109,    62,    52,     0,    62,     0,     0,     0,    28,   116,
  336.     66,    68,    67,    69,    48,    85,    86,    82,   121,   119,
  337.    120,   114,   115,     0,     0,    62,    75,     0,     0,     0,
  338.      0,     0,     0,     0,    77,     0,     0,   113,    22,    76,
  339.     73,    58,    53,    40,     0,    62,    77,     0,    47,   122,
  340.     62,    62,     0,     0,    62,     0,    41,    42,    62,     0,
  341.     59,     0,    44,    43,     0,     0,     0
  342. };
  343.  
  344. static const short yydefgoto[] = {   305,
  345.     25,    26,    39,    43,   126,   127,    27,    45,    69,    28,
  346.     29,    57,    30,   107,    40,   108,   159,   109,   110,     2,
  347.      3,   129,   222,   237,   238,   166,   178,   179,   115,   116,
  348.    111,   157,   180,   265,    32,    33,    46,    34,   112,   113,
  349.    139,   186,    42,   138
  350. };
  351.  
  352. static const short yypact[] = {     6,
  353. -32768,    10,  1082,-32768,-32768,   -33,   -16,-32768,-32768,     4,
  354.      4,-32768,    31,    31,    31,    14,    44,  1746,  1746,-32768,
  355.   1740,  1746,  1155,     6,   874,-32768,    46,     0,-32768,-32768,
  356.   1324,   284,-32768,    18,   654,   433,  1155,-32768,    46,-32768,
  357.     10,     6,    46,-32768,    88,    65,-32768,-32768,-32768,   433,
  358.    433,  1746,  1536,    59,    58,    59,   111,-32768,    59,-32768,
  359. -32768,-32768,    40,  1271,-32768,-32768,-32768,-32768,-32768,   790,
  360. -32768,-32768,  1536,  1536,   117,  1536,  1536,  1536,  1536,  1536,
  361.   1536,    99,   284,  1746,  1746,  1746,  1746,  1746,  1746,-32768,
  362. -32768,-32768,-32768,    69,-32768,   132,    79,     6,    83,     4,
  363.      4,-32768,-32768,  1536,  1536,     6,   742,-32768,   848,-32768,
  364.    980,   654,    80,     6,    84,    42,  1420,     8,-32768,-32768,
  365. -32768,-32768,-32768,-32768,-32768,    90,-32768,  1746,-32768,    84,
  366.     84,  1271,    97,  1536,     6,-32768,   106,  1175,-32768,   742,
  367.   1807,  1794,-32768,  1556,  1468,  1372,  1420,  1807,  1807,    31,
  368.    129,   129,    59,    59,    59,    59,  1536,  1536,  1536,    50,
  369.   1536,   922,  1664,-32768,-32768,     4,  1420,     4,-32768,-32768,
  370. -32768,    80,-32768,    31,  1740,  1155,-32768,    75,     1,  1604,
  371.    284,    92,-32768,   742,-32768,     6,-32768,-32768,-32768,-32768,
  372.     11,   284,-32768,-32768,-32768,  1420,-32768,   145,-32768,  1420,
  373.     80,  1536,-32768,  1420,  1271,     4,  1155,-32768,  1271,   138,
  374.     57,    80,-32768,-32768,     6,    65,-32768,    40,  1536,  1536,
  375.   1536,     4,  1720,  1223,  1720,  1720,   146,  1720,  1720,  1720,
  376.    284,-32768,-32768,-32768,-32768,-32768,    84,    45,-32768,-32768,
  377.   1420,     6,-32768,    15,     6,   110,   149,  1107,-32768,-32768,
  378.     75,  1420,  1420,  1420,-32768,  1604,-32768,  1604,   549,   139,
  379. -32768,  1684,  1644,  1516,  1720,     6,-32768,    35,   922,     4,
  380.    922,  1536,    84,  1034,  1536,     4,  1720,  1604,-32768,-32768,
  381. -32768,   147,-32768,-32768,  1271,     6,  1536,    84,-32768,  1604,
  382.      6,     6,   922,    84,     6,   922,-32768,-32768,     6,   922,
  383. -32768,   922,-32768,-32768,   172,   180,-32768
  384. };
  385.  
  386. static const short yypgoto[] = {-32768,
  387. -32768,   157,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
  388.     78,-32768,    81,    17,    94,   -50,-32768,-32768,-32768,    41,
  389.    -18,   -26,   -60,-32768,-32768,  -104,-32768,-32768,    64,   -19,
  390.     -3,-32768,  -198,-32768,   363,   174,   -42,   148,   183,  -102,
  391.    324,  -164,   458,  -176
  392. };
  393.  
  394.  
  395. #define    YYLAST        1861
  396.  
  397.  
  398. static const short yytable[] = {    31,
  399.    168,   223,   224,    63,   172,    65,    68,   215,   134,   185,
  400.    -80,   235,     1,   -80,   236,   134,     1,   118,     1,    64,
  401.     36,    31,     4,   120,   256,   258,   259,   260,    90,   262,
  402.    263,   264,   117,   117,     7,   280,   240,   201,   281,    37,
  403.    134,   135,   134,   -80,   -80,   267,   117,   117,   135,   132,
  404.     41,    41,    91,    92,   206,   135,   171,    24,   212,    38,
  405.    -80,   268,     1,    38,   190,   -70,   278,    50,    41,   141,
  406.    142,   270,   144,   145,   146,   147,   148,   149,   290,   162,
  407.    135,   233,   135,    22,   219,   135,   140,   169,   247,   171,
  408.    122,   123,    91,    92,   136,   188,   -88,    51,    58,   -71,
  409.    167,   167,   232,    24,    44,   207,   128,   203,    71,    38,
  410.     89,   210,    37,   130,   131,   133,   197,   220,   221,   119,
  411.    143,    72,   158,   121,   124,   125,    91,    92,   184,   150,
  412.    196,   216,   161,   171,   200,   160,   163,   198,   136,    38,
  413.     41,    41,     7,   191,   195,     8,     9,   225,   239,   261,
  414. -32768,    41,   273,   204,   205,   167,   218,   209,   246,   167,
  415.     47,    48,    49,   272,   291,    55,    55,   234,    55,    61,
  416.    288,   306,    64,    14,    15,    86,    87,    88,    55,   307,
  417.     89,    67,   294,    18,    19,    35,   177,   244,    52,   250,
  418.    276,    22,    53,   164,   165,    60,   249,     0,   241,    55,
  419.     41,     0,     0,   117,   183,     0,    41,    35,    41,    70,
  420.     35,    55,     0,     0,     0,   252,   253,   254,   282,     0,
  421.    284,    35,     0,   269,     0,    35,   271,     0,     0,     0,
  422.      0,    55,    55,    55,    55,    55,    55,     0,     0,     0,
  423.      0,     0,   298,     0,   274,   301,    41,   279,     0,   303,
  424.      0,   304,   217,   208,     0,     0,   182,     0,    55,   213,
  425.      0,   214,    41,     0,    55,     0,     0,   293,   285,     0,
  426.      0,   167,   296,   297,     0,    55,   300,     0,     0,    55,
  427.    302,     0,     0,   167,     0,     0,     0,     0,    55,    55,
  428.      0,    55,    55,    55,    55,    55,    55,    47,     0,   243,
  429.    177,   177,   177,   177,     0,   177,   177,   177,     0,     0,
  430.     41,     0,     0,     0,    55,   255,    41,     0,     0,     0,
  431.      0,    47,    55,     0,     0,     0,     0,    55,    84,    85,
  432.     86,    87,    88,     0,     0,    89,     0,     0,     0,     0,
  433.      0,     0,   177,    55,     0,     0,     0,    55,     0,     0,
  434.      0,    55,    55,     0,   177,     0,    55,     0,     0,     0,
  435.      0,     0,     0,   283,     0,     0,     0,     0,     0,   289,
  436.    182,   182,   182,   182,     0,   182,   182,   182,     0,     0,
  437.     54,    56,     0,    59,     0,     0,   137,     0,    55,     0,
  438.      0,     0,     0,    83,     0,     0,     0,     0,     0,    55,
  439.     55,    55,     0,    55,     0,    55,    55,    55,     0,    55,
  440.     55,    55,   182,     0,    59,     0,     0,     0,     0,     0,
  441.      0,    55,     0,     0,   182,    55,    83,     0,     0,     0,
  442.      0,     0,    55,    62,     0,     6,     7,    55,   189,     8,
  443.      9,     0,     0,     0,     0,     0,   151,   152,   153,   154,
  444.    155,   156,     0,   193,   194,     0,     0,     0,     0,     0,
  445.      0,     0,     0,    13,     0,     0,     0,    14,    15,    16,
  446.     17,   181,     0,    83,     0,     0,     0,    18,    19,    83,
  447.     20,     0,    21,     0,     0,    22,    23,   -87,     0,     0,
  448.    192,     0,   114,     0,    83,     0,     0,     0,     0,     0,
  449.      0,     0,     0,    83,    83,     0,    83,    83,    83,    83,
  450.     83,    83,     0,     0,     0,     0,     0,     0,     0,     0,
  451.      0,     0,     0,     0,     0,     0,     0,   114,   242,    83,
  452.      0,     0,   245,     0,     0,     0,     0,    59,     0,     0,
  453.      0,   251,   231,     0,     0,     0,     0,     0,     0,     0,
  454.      0,     0,     7,     0,     0,     8,     9,-32768,    83,     0,
  455.    266,     0,    83,     0,   114,     0,    83,    83,     0,   114,
  456.    187,    83,     0,     0,     0,     0,     0,     0,     0,     0,
  457.      0,     0,     0,    14,    15,   181,   181,   181,   181,     0,
  458.    181,   181,   181,    18,    19,     0,   286,   114,    52,     0,
  459.      0,    22,    53,    83,     0,     0,     0,     0,   292,     0,
  460.      0,   295,     0,     0,    83,    83,    83,   299,   231,   114,
  461.    231,   231,   231,     0,   231,   231,   231,   181,     0,   187,
  462.      0,     0,     0,     0,     0,     0,    83,     0,     0,   181,
  463.    231,   114,     0,     0,     0,     0,     0,    83,     0,     0,
  464.      0,     0,   231,     0,    93,     0,     6,     7,   187,     0,
  465.      8,     9,     0,     0,     0,     0,     0,     0,     0,   248,
  466.     94,     0,    95,    96,    97,    98,    99,   100,   101,   102,
  467.    103,   104,   105,     0,    13,     0,     0,     0,    14,    15,
  468.     16,    17,     0,     0,     0,     0,     0,     0,    18,    19,
  469.      0,    20,     0,    21,     0,   275,    22,    23,     0,     0,
  470.      0,    24,   106,    38,     0,     0,     0,     0,     0,     0,
  471.      0,     0,     0,     0,     0,     0,   114,     0,   114,     0,
  472.      0,   287,     0,     0,     0,     0,     0,     0,     0,     0,
  473.      0,     0,   170,     0,     6,     7,     0,     0,     8,     9,
  474.    114,     0,     0,   114,     0,     0,     0,   114,    94,   114,
  475.     95,    96,    97,    98,    99,   100,   101,   102,   103,   104,
  476.    105,     0,    13,     0,     0,     0,    14,    15,    16,    17,
  477.      0,     0,     0,     0,     0,     0,    18,    19,     0,    20,
  478.     93,    21,     6,     7,    22,    23,     8,     9,     0,    24,
  479.    106,    38,     0,     0,     0,     0,    94,     0,    95,    96,
  480.     97,    98,    99,   100,   101,   102,   103,   104,   105,     0,
  481.     13,     0,     0,     0,    14,    15,    16,    17,     0,     0,
  482.      0,     0,     0,     0,    18,    19,     0,    20,     0,    21,
  483.      0,     0,    22,    23,     0,     0,     0,    24,   173,    38,
  484.      6,     7,     0,     0,     8,     9,     0,   -79,     0,     0,
  485.    -79,     0,     0,     0,     0,     0,     0,     0,     0,     0,
  486.      0,     0,     0,   -62,    66,     0,     6,     7,   174,     0,
  487.      8,     9,    14,    15,    16,    17,     1,     0,    10,    11,
  488.    -79,   -79,    18,    19,     0,    20,     0,   175,     0,     0,
  489.     22,   176,     0,    12,    13,     0,     0,   -79,    14,    15,
  490.     16,    17,     0,     0,     0,     0,     0,     0,    18,    19,
  491.      0,    20,     0,    21,     6,     7,    22,    23,     8,     9,
  492.      0,    24,     0,     0,     0,     0,     0,     0,    94,     0,
  493.     95,    96,    97,    98,    99,   100,   101,   102,   103,   104,
  494.    105,     0,    13,     0,     0,     0,    14,    15,    16,    17,
  495.      0,     0,     0,     0,     0,     0,    18,    19,     0,    20,
  496.      0,    21,     0,     0,    22,    23,     0,     0,     0,    24,
  497.      0,    38,     6,     7,     0,     0,     8,     9,    73,     0,
  498.      0,    74,     1,     0,     0,     0,     0,     0,     0,     0,
  499.      0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
  500.      0,    75,    76,    77,    14,    15,    16,    17,    78,     0,
  501.      0,    80,    81,    82,    18,    19,     0,     0,     0,    52,
  502.      0,     0,    22,    53,     0,     0,     6,     7,     0,    38,
  503.      8,     9,    73,     0,     0,    74,     0,     0,     0,     0,
  504.      0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
  505.      0,     0,     0,     0,     0,    75,    76,    77,    14,    15,
  506.     16,    17,    78,     0,     0,    80,    81,    82,    18,    19,
  507.      0,     0,     5,    52,     6,     7,    22,    53,     8,     9,
  508.      0,     0,     0,    38,     0,     0,    10,    11,     0,     0,
  509.      0,     0,     0,     0,     0,     0,     0,     0,     0,     6,
  510.      7,    12,    13,     8,     9,     0,    14,    15,    16,    17,
  511.      0,     0,     0,     0,     0,     0,    18,    19,     0,    20,
  512.      0,    21,     0,     0,    22,    23,     0,    13,     0,    24,
  513.      0,    14,    15,    16,    17,     0,     0,     0,     0,     0,
  514.      0,    18,    19,     0,    20,    62,    21,     6,     7,    22,
  515.     23,     8,     9,     0,     0,     0,    38,     0,     0,     0,
  516.      0,     0,     0,     0,     0,   199,     0,     6,     7,     0,
  517.      0,     8,     9,     0,     0,    13,     0,     0,     0,    14,
  518.     15,    16,    17,     0,     0,     0,     0,     0,     0,    18,
  519.     19,     0,    20,     0,    21,    13,     0,    22,    23,    14,
  520.     15,    16,    17,     0,     0,     0,     0,     0,     0,    18,
  521.     19,     0,    20,   257,    21,     6,     7,    22,    23,     8,
  522.      9,     0,     0,     0,     0,     0,     0,     0,     0,     0,
  523.      0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
  524.      0,     0,     0,   174,     0,     0,     0,    14,    15,    16,
  525.     17,     0,     0,     0,     0,     0,     0,    18,    19,     0,
  526.     20,     0,   175,     6,     7,    22,    53,     8,     9,    73,
  527.      0,     0,    74,     0,     0,     0,     0,     0,     0,     0,
  528.      0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
  529.      0,     0,    75,    76,    77,    14,    15,    16,    17,    78,
  530.      0,     0,    80,    81,    82,    18,    19,     0,     0,     0,
  531.     52,     0,     0,    22,    53,   136,     6,     7,     0,     0,
  532.      8,     9,    73,     0,     0,    74,     0,     0,     0,     0,
  533.      0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
  534.      0,     0,     0,     0,     0,    75,    76,    77,    14,    15,
  535.     16,    17,    78,     0,    79,    80,    81,    82,    18,    19,
  536.      0,     0,     0,    52,     6,     7,    22,    53,     8,     9,
  537.     73,     0,     0,    74,     0,     0,     0,     0,     0,     0,
  538.      0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
  539.      0,     0,     0,    75,    76,    77,    14,    15,    16,    17,
  540.     78,   202,     0,    80,    81,    82,    18,    19,     0,     0,
  541.      0,    52,     6,     7,    22,    53,     8,     9,    73,     0,
  542.      0,    74,     0,     0,     0,     0,     0,     0,     0,     0,
  543.      0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
  544.      0,    75,    76,    77,    14,    15,    16,    17,    78,     0,
  545.      0,    80,    81,    82,    18,    19,     0,     0,     0,    52,
  546.      6,     7,    22,    53,     8,     9,    73,     0,     0,    74,
  547.      0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
  548.      0,     0,     0,     0,     0,     0,     0,     0,     0,    75,
  549.     76,     0,    14,    15,    16,    17,     0,     0,     0,    80,
  550.     81,    82,    18,    19,     0,     0,     0,    52,     6,     7,
  551.     22,    53,     8,     9,   225,     0,     0,   226,     0,     0,
  552.      0,     0,     0,     0,     0,     0,     0,     0,     6,     7,
  553.      0,     0,     8,     9,     0,     0,     0,   227,   228,   229,
  554.     14,    15,    16,    17,   230,   277,     0,     0,     6,     7,
  555.     18,    19,     8,     9,    73,    52,    13,    74,    22,    53,
  556.     14,    15,    16,    17,     0,     0,     0,     0,     0,     0,
  557.     18,    19,     0,    20,     0,    21,     0,    75,    22,    23,
  558.     14,    15,    16,    17,     0,     0,     0,    80,    81,    82,
  559.     18,    19,     0,     0,     0,    52,     6,     7,    22,    53,
  560.      8,     9,   225,     0,     0,   226,     0,     0,     0,     0,
  561.      0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
  562.      0,     0,     0,     0,     0,   227,   228,   229,    14,    15,
  563.     16,    17,   230,     0,     0,     0,     6,     7,    18,    19,
  564.      8,     9,   225,    52,     0,   226,    22,    53,     0,     0,
  565.      0,     0,     0,     0,     0,     0,     6,   211,     0,     0,
  566.      8,     9,     0,     0,     0,   227,   228,     0,    14,    15,
  567.     16,    17,     0,     0,     0,     0,     6,     7,    18,    19,
  568.      8,     9,   225,    52,    13,   226,    22,    53,    14,    15,
  569.     16,    17,     0,     0,     0,     0,     0,     0,    18,    19,
  570.      0,    20,     0,    21,     0,   227,    22,    23,    14,    15,
  571.     16,    17,     6,     7,     0,     0,     8,     9,    18,    19,
  572.      0,     0,     0,    52,     0,     0,    22,    53,     0,     0,
  573.      0,     0,     6,     7,     0,     0,     8,     9,     6,     7,
  574.    174,     0,     8,     9,    14,    15,    16,    17,     0,     0,
  575.      0,     0,     0,     0,    18,    19,     0,    20,     0,   175,
  576.      0,     0,    22,    53,    14,    15,    16,    17,     0,     0,
  577.     14,    15,    16,    17,    18,    19,     0,    20,     0,    52,
  578.     18,    19,    22,    53,     0,    52,     0,     7,    22,    53,
  579.      8,     9,    73,     0,     0,-32768,     0,     0,     0,     0,
  580.      7,     0,     0,     8,     9,-32768,     0,     0,     0,     0,
  581.      0,     0,     0,     0,     0,     0,     0,     0,    14,    15,
  582.      0,     0,     0,     0,     0,    80,    81,    82,    18,    19,
  583.      0,    14,    15,    52,     0,     0,    22,    53,-32768,-32768,
  584. -32768,    18,    19,     0,     0,     0,    52,     0,     0,    22,
  585.     53
  586. };
  587.  
  588. static const short yycheck[] = {     3,
  589.    105,     1,   179,    23,   107,    24,    25,   172,     1,   112,
  590.     10,     1,    13,    13,     4,     1,    13,    37,    13,    23,
  591.     54,    25,    13,    42,   223,   224,   225,   226,    11,   228,
  592.    229,   230,    36,    37,     4,     1,   201,   140,     4,    56,
  593.      1,    41,     1,    43,    44,     1,    50,    51,    41,    53,
  594.     10,    11,    35,    36,   159,    41,   107,    58,   163,    60,
  595.     60,   238,    13,    60,    57,    55,   265,    54,    28,    73,
  596.     74,    57,    76,    77,    78,    79,    80,    81,   277,    98,
  597.     41,   184,    41,    53,    10,    41,    70,   106,    32,   140,
  598.      3,     4,    35,    36,    55,   114,    55,    54,    21,    55,
  599.    104,   105,    11,    58,    11,    56,    42,   150,    28,    60,
  600.     52,   162,    56,    50,    51,     5,   135,    43,    44,    39,
  601.      4,    28,    54,    43,    37,    38,    35,    36,   112,    31,
  602.    134,   174,    54,   184,   138,     4,    54,    32,    55,    60,
  603.    100,   101,     4,    54,    48,     7,     8,     9,     4,     4,
  604.     12,   111,     4,   157,   158,   159,   176,   161,    21,   163,
  605.     13,    14,    15,    54,    18,    18,    19,   186,    21,    22,
  606.    275,     0,   176,    35,    36,    47,    48,    49,    31,     0,
  607.     52,    25,   287,    45,    46,     3,   109,   207,    50,   216,
  608.    251,    53,    54,   100,   101,    22,   215,    -1,   202,    52,
  609.    160,    -1,    -1,   207,   111,    -1,   166,    25,   168,    27,
  610.     28,    64,    -1,    -1,    -1,   219,   220,   221,   269,    -1,
  611.    271,    39,    -1,   242,    -1,    43,   245,    -1,    -1,    -1,
  612.     -1,    84,    85,    86,    87,    88,    89,    -1,    -1,    -1,
  613.     -1,    -1,   293,    -1,   248,   296,   206,   266,    -1,   300,
  614.     -1,   302,   175,   160,    -1,    -1,   109,    -1,   111,   166,
  615.     -1,   168,   222,    -1,   117,    -1,    -1,   286,   272,    -1,
  616.     -1,   275,   291,   292,    -1,   128,   295,    -1,    -1,   132,
  617.    299,    -1,    -1,   287,    -1,    -1,    -1,    -1,   141,   142,
  618.     -1,   144,   145,   146,   147,   148,   149,   150,    -1,   206,
  619.    223,   224,   225,   226,    -1,   228,   229,   230,    -1,    -1,
  620.    270,    -1,    -1,    -1,   167,   222,   276,    -1,    -1,    -1,
  621.     -1,   174,   175,    -1,    -1,    -1,    -1,   180,    45,    46,
  622.     47,    48,    49,    -1,    -1,    52,    -1,    -1,    -1,    -1,
  623.     -1,    -1,   265,   196,    -1,    -1,    -1,   200,    -1,    -1,
  624.     -1,   204,   205,    -1,   277,    -1,   209,    -1,    -1,    -1,
  625.     -1,    -1,    -1,   270,    -1,    -1,    -1,    -1,    -1,   276,
  626.    223,   224,   225,   226,    -1,   228,   229,   230,    -1,    -1,
  627.     18,    19,    -1,    21,    -1,    -1,    63,    -1,   241,    -1,
  628.     -1,    -1,    -1,    31,    -1,    -1,    -1,    -1,    -1,   252,
  629.    253,   254,    -1,   256,    -1,   258,   259,   260,    -1,   262,
  630.    263,   264,   265,    -1,    52,    -1,    -1,    -1,    -1,    -1,
  631.     -1,   274,    -1,    -1,   277,   278,    64,    -1,    -1,    -1,
  632.     -1,    -1,   285,     1,    -1,     3,     4,   290,   115,     7,
  633.      8,    -1,    -1,    -1,    -1,    -1,    84,    85,    86,    87,
  634.     88,    89,    -1,   130,   131,    -1,    -1,    -1,    -1,    -1,
  635.     -1,    -1,    -1,    31,    -1,    -1,    -1,    35,    36,    37,
  636.     38,   109,    -1,   111,    -1,    -1,    -1,    45,    46,   117,
  637.     48,    -1,    50,    -1,    -1,    53,    54,    55,    -1,    -1,
  638.    128,    -1,    35,    -1,   132,    -1,    -1,    -1,    -1,    -1,
  639.     -1,    -1,    -1,   141,   142,    -1,   144,   145,   146,   147,
  640.    148,   149,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
  641.     -1,    -1,    -1,    -1,    -1,    -1,    -1,    70,   205,   167,
  642.     -1,    -1,   209,    -1,    -1,    -1,    -1,   175,    -1,    -1,
  643.     -1,   218,   180,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
  644.     -1,    -1,     4,    -1,    -1,     7,     8,     9,   196,    -1,
  645.    237,    -1,   200,    -1,   107,    -1,   204,   205,    -1,   112,
  646.    113,   209,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
  647.     -1,    -1,    -1,    35,    36,   223,   224,   225,   226,    -1,
  648.    228,   229,   230,    45,    46,    -1,   273,   140,    50,    -1,
  649.     -1,    53,    54,   241,    -1,    -1,    -1,    -1,   285,    -1,
  650.     -1,   288,    -1,    -1,   252,   253,   254,   294,   256,   162,
  651.    258,   259,   260,    -1,   262,   263,   264,   265,    -1,   172,
  652.     -1,    -1,    -1,    -1,    -1,    -1,   274,    -1,    -1,   277,
  653.    278,   184,    -1,    -1,    -1,    -1,    -1,   285,    -1,    -1,
  654.     -1,    -1,   290,    -1,     1,    -1,     3,     4,   201,    -1,
  655.      7,     8,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   212,
  656.     17,    -1,    19,    20,    21,    22,    23,    24,    25,    26,
  657.     27,    28,    29,    -1,    31,    -1,    -1,    -1,    35,    36,
  658.     37,    38,    -1,    -1,    -1,    -1,    -1,    -1,    45,    46,
  659.     -1,    48,    -1,    50,    -1,   248,    53,    54,    -1,    -1,
  660.     -1,    58,    59,    60,    -1,    -1,    -1,    -1,    -1,    -1,
  661.     -1,    -1,    -1,    -1,    -1,    -1,   269,    -1,   271,    -1,
  662.     -1,   274,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
  663.     -1,    -1,     1,    -1,     3,     4,    -1,    -1,     7,     8,
  664.    293,    -1,    -1,   296,    -1,    -1,    -1,   300,    17,   302,
  665.     19,    20,    21,    22,    23,    24,    25,    26,    27,    28,
  666.     29,    -1,    31,    -1,    -1,    -1,    35,    36,    37,    38,
  667.     -1,    -1,    -1,    -1,    -1,    -1,    45,    46,    -1,    48,
  668.      1,    50,     3,     4,    53,    54,     7,     8,    -1,    58,
  669.     59,    60,    -1,    -1,    -1,    -1,    17,    -1,    19,    20,
  670.     21,    22,    23,    24,    25,    26,    27,    28,    29,    -1,
  671.     31,    -1,    -1,    -1,    35,    36,    37,    38,    -1,    -1,
  672.     -1,    -1,    -1,    -1,    45,    46,    -1,    48,    -1,    50,
  673.     -1,    -1,    53,    54,    -1,    -1,    -1,    58,     1,    60,
  674.      3,     4,    -1,    -1,     7,     8,    -1,    10,    -1,    -1,
  675.     13,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
  676.     -1,    -1,    -1,     0,     1,    -1,     3,     4,    31,    -1,
  677.      7,     8,    35,    36,    37,    38,    13,    -1,    15,    16,
  678.     43,    44,    45,    46,    -1,    48,    -1,    50,    -1,    -1,
  679.     53,    54,    -1,    30,    31,    -1,    -1,    60,    35,    36,
  680.     37,    38,    -1,    -1,    -1,    -1,    -1,    -1,    45,    46,
  681.     -1,    48,    -1,    50,     3,     4,    53,    54,     7,     8,
  682.     -1,    58,    -1,    -1,    -1,    -1,    -1,    -1,    17,    -1,
  683.     19,    20,    21,    22,    23,    24,    25,    26,    27,    28,
  684.     29,    -1,    31,    -1,    -1,    -1,    35,    36,    37,    38,
  685.     -1,    -1,    -1,    -1,    -1,    -1,    45,    46,    -1,    48,
  686.     -1,    50,    -1,    -1,    53,    54,    -1,    -1,    -1,    58,
  687.     -1,    60,     3,     4,    -1,    -1,     7,     8,     9,    -1,
  688.     -1,    12,    13,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
  689.     -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
  690.     -1,    32,    33,    34,    35,    36,    37,    38,    39,    -1,
  691.     -1,    42,    43,    44,    45,    46,    -1,    -1,    -1,    50,
  692.     -1,    -1,    53,    54,    -1,    -1,     3,     4,    -1,    60,
  693.      7,     8,     9,    -1,    -1,    12,    -1,    -1,    -1,    -1,
  694.     -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
  695.     -1,    -1,    -1,    -1,    -1,    32,    33,    34,    35,    36,
  696.     37,    38,    39,    -1,    -1,    42,    43,    44,    45,    46,
  697.     -1,    -1,     1,    50,     3,     4,    53,    54,     7,     8,
  698.     -1,    -1,    -1,    60,    -1,    -1,    15,    16,    -1,    -1,
  699.     -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,     3,
  700.      4,    30,    31,     7,     8,    -1,    35,    36,    37,    38,
  701.     -1,    -1,    -1,    -1,    -1,    -1,    45,    46,    -1,    48,
  702.     -1,    50,    -1,    -1,    53,    54,    -1,    31,    -1,    58,
  703.     -1,    35,    36,    37,    38,    -1,    -1,    -1,    -1,    -1,
  704.     -1,    45,    46,    -1,    48,     1,    50,     3,     4,    53,
  705.     54,     7,     8,    -1,    -1,    -1,    60,    -1,    -1,    -1,
  706.     -1,    -1,    -1,    -1,    -1,     1,    -1,     3,     4,    -1,
  707.     -1,     7,     8,    -1,    -1,    31,    -1,    -1,    -1,    35,
  708.     36,    37,    38,    -1,    -1,    -1,    -1,    -1,    -1,    45,
  709.     46,    -1,    48,    -1,    50,    31,    -1,    53,    54,    35,
  710.     36,    37,    38,    -1,    -1,    -1,    -1,    -1,    -1,    45,
  711.     46,    -1,    48,     1,    50,     3,     4,    53,    54,     7,
  712.      8,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
  713.     -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
  714.     -1,    -1,    -1,    31,    -1,    -1,    -1,    35,    36,    37,
  715.     38,    -1,    -1,    -1,    -1,    -1,    -1,    45,    46,    -1,
  716.     48,    -1,    50,     3,     4,    53,    54,     7,     8,     9,
  717.     -1,    -1,    12,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
  718.     -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
  719.     -1,    -1,    32,    33,    34,    35,    36,    37,    38,    39,
  720.     -1,    -1,    42,    43,    44,    45,    46,    -1,    -1,    -1,
  721.     50,    -1,    -1,    53,    54,    55,     3,     4,    -1,    -1,
  722.      7,     8,     9,    -1,    -1,    12,    -1,    -1,    -1,    -1,
  723.     -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
  724.     -1,    -1,    -1,    -1,    -1,    32,    33,    34,    35,    36,
  725.     37,    38,    39,    -1,    41,    42,    43,    44,    45,    46,
  726.     -1,    -1,    -1,    50,     3,     4,    53,    54,     7,     8,
  727.      9,    -1,    -1,    12,    -1,    -1,    -1,    -1,    -1,    -1,
  728.     -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
  729.     -1,    -1,    -1,    32,    33,    34,    35,    36,    37,    38,
  730.     39,    40,    -1,    42,    43,    44,    45,    46,    -1,    -1,
  731.     -1,    50,     3,     4,    53,    54,     7,     8,     9,    -1,
  732.     -1,    12,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
  733.     -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
  734.     -1,    32,    33,    34,    35,    36,    37,    38,    39,    -1,
  735.     -1,    42,    43,    44,    45,    46,    -1,    -1,    -1,    50,
  736.      3,     4,    53,    54,     7,     8,     9,    -1,    -1,    12,
  737.     -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
  738.     -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    32,
  739.     33,    -1,    35,    36,    37,    38,    -1,    -1,    -1,    42,
  740.     43,    44,    45,    46,    -1,    -1,    -1,    50,     3,     4,
  741.     53,    54,     7,     8,     9,    -1,    -1,    12,    -1,    -1,
  742.     -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,     3,     4,
  743.     -1,    -1,     7,     8,    -1,    -1,    -1,    32,    33,    34,
  744.     35,    36,    37,    38,    39,    40,    -1,    -1,     3,     4,
  745.     45,    46,     7,     8,     9,    50,    31,    12,    53,    54,
  746.     35,    36,    37,    38,    -1,    -1,    -1,    -1,    -1,    -1,
  747.     45,    46,    -1,    48,    -1,    50,    -1,    32,    53,    54,
  748.     35,    36,    37,    38,    -1,    -1,    -1,    42,    43,    44,
  749.     45,    46,    -1,    -1,    -1,    50,     3,     4,    53,    54,
  750.      7,     8,     9,    -1,    -1,    12,    -1,    -1,    -1,    -1,
  751.     -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
  752.     -1,    -1,    -1,    -1,    -1,    32,    33,    34,    35,    36,
  753.     37,    38,    39,    -1,    -1,    -1,     3,     4,    45,    46,
  754.      7,     8,     9,    50,    -1,    12,    53,    54,    -1,    -1,
  755.     -1,    -1,    -1,    -1,    -1,    -1,     3,     4,    -1,    -1,
  756.      7,     8,    -1,    -1,    -1,    32,    33,    -1,    35,    36,
  757.     37,    38,    -1,    -1,    -1,    -1,     3,     4,    45,    46,
  758.      7,     8,     9,    50,    31,    12,    53,    54,    35,    36,
  759.     37,    38,    -1,    -1,    -1,    -1,    -1,    -1,    45,    46,
  760.     -1,    48,    -1,    50,    -1,    32,    53,    54,    35,    36,
  761.     37,    38,     3,     4,    -1,    -1,     7,     8,    45,    46,
  762.     -1,    -1,    -1,    50,    -1,    -1,    53,    54,    -1,    -1,
  763.     -1,    -1,     3,     4,    -1,    -1,     7,     8,     3,     4,
  764.     31,    -1,     7,     8,    35,    36,    37,    38,    -1,    -1,
  765.     -1,    -1,    -1,    -1,    45,    46,    -1,    48,    -1,    50,
  766.     -1,    -1,    53,    54,    35,    36,    37,    38,    -1,    -1,
  767.     35,    36,    37,    38,    45,    46,    -1,    48,    -1,    50,
  768.     45,    46,    53,    54,    -1,    50,    -1,     4,    53,    54,
  769.      7,     8,     9,    -1,    -1,    12,    -1,    -1,    -1,    -1,
  770.      4,    -1,    -1,     7,     8,     9,    -1,    -1,    -1,    -1,
  771.     -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    35,    36,
  772.     -1,    -1,    -1,    -1,    -1,    42,    43,    44,    45,    46,
  773.     -1,    35,    36,    50,    -1,    -1,    53,    54,    42,    43,
  774.     44,    45,    46,    -1,    -1,    -1,    50,    -1,    -1,    53,
  775.     54
  776. };
  777. /* -*-C-*-  Note some compilers choke on comments on `#line' lines.  */
  778.  
  779. /* Skeleton output parser for bison,
  780.    Copyright (C) 1984, 1989, 1990 Bob Corbett and Richard Stallman
  781.  
  782.    This program is free software; you can redistribute it and/or modify
  783.    it under the terms of the GNU General Public License as published by
  784.    the Free Software Foundation; either version 1, or (at your option)
  785.    any later version.
  786.  
  787.    This program is distributed in the hope that it will be useful,
  788.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  789.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  790.    GNU General Public License for more details.
  791.  
  792.    You should have received a copy of the GNU General Public License
  793.    along with this program; if not, write to the Free Software
  794.    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
  795.  
  796. #include <alloca.h>
  797.  
  798. /* This is the parser code that is written into each bison parser
  799.   when the %semantic_parser declaration is not specified in the grammar.
  800.   It was written by Richard Stallman by simplifying the hairy parser
  801.   used when %semantic_parser is specified.  */
  802.  
  803. /* Note: there must be only one dollar sign in this file.
  804.    It is replaced by the list of actions, each action
  805.    as one case of the switch.  */
  806.  
  807. #define yyerrok        (yyerrstatus = 0)
  808. #define yyclearin    (yychar = YYEMPTY)
  809. #define YYEMPTY        -2
  810. #define YYEOF        0
  811. #define YYACCEPT    return(0)
  812. #define YYABORT     return(1)
  813. #define YYERROR        goto yyerrlab1
  814. /* Like YYERROR except do call yyerror.
  815.    This remains here temporarily to ease the
  816.    transition to the new meaning of YYERROR, for GCC.
  817.    Once GCC version 2 has supplanted version 1, this can go.  */
  818. #define YYFAIL        goto yyerrlab
  819. #define YYRECOVERING()  (!!yyerrstatus)
  820. #define YYBACKUP(token, value) \
  821. do                                \
  822.   if (yychar == YYEMPTY && yylen == 1)                \
  823.     { yychar = (token), yylval = (value);            \
  824.       yychar1 = YYTRANSLATE (yychar);                \
  825.       YYPOPSTACK;                        \
  826.       goto yybackup;                        \
  827.     }                                \
  828.   else                                \
  829.     { yyerror ("syntax error: cannot back up"); YYERROR; }    \
  830. while (0)
  831.  
  832. #define YYTERROR    1
  833. #define YYERRCODE    256
  834.  
  835. #ifndef YYPURE
  836. #define YYLEX        yylex()
  837. #endif
  838.  
  839. #ifdef YYPURE
  840. #ifdef YYLSP_NEEDED
  841. #define YYLEX        yylex(&yylval, &yylloc)
  842. #else
  843. #define YYLEX        yylex(&yylval)
  844. #endif
  845. #endif
  846.  
  847. /* If nonreentrant, generate the variables here */
  848.  
  849. #ifndef YYPURE
  850.  
  851. int    yychar;            /*  the lookahead symbol        */
  852. YYSTYPE    yylval;            /*  the semantic value of the        */
  853.                 /*  lookahead symbol            */
  854.  
  855. #ifdef YYLSP_NEEDED
  856. YYLTYPE yylloc;            /*  location data for the lookahead    */
  857.                 /*  symbol                */
  858. #endif
  859.  
  860. int yynerrs;            /*  number of parse errors so far       */
  861. #endif  /* not YYPURE */
  862.  
  863. #if YYDEBUG != 0
  864. int yydebug;            /*  nonzero means print parse trace    */
  865. /* Since this is uninitialized, it does not stop multiple parsers
  866.    from coexisting.  */
  867. #endif
  868.  
  869. /*  YYINITDEPTH indicates the initial size of the parser's stacks    */
  870.  
  871. #ifndef    YYINITDEPTH
  872. #define YYINITDEPTH 200
  873. #endif
  874.  
  875. /*  YYMAXDEPTH is the maximum size the stacks can grow to
  876.     (effective only if the built-in stack extension method is used).  */
  877.  
  878. #if YYMAXDEPTH == 0
  879. #undef YYMAXDEPTH
  880. #endif
  881.  
  882. #ifndef YYMAXDEPTH
  883. #define YYMAXDEPTH 10000
  884. #endif
  885.  
  886. #if __GNUC__ > 1        /* GNU C and GNU C++ define this.  */
  887. #define __yy_bcopy(FROM,TO,COUNT)    __builtin_memcpy(TO,FROM,COUNT)
  888. #else                /* not GNU C or C++ */
  889. #ifndef __cplusplus
  890.  
  891. /* This is the most reliable way to avoid incompatibilities
  892.    in available built-in functions on various systems.  */
  893. static void
  894. __yy_bcopy (from, to, count)
  895.      char *from;
  896.      char *to;
  897.      int count;
  898. {
  899.   register char *f = from;
  900.   register char *t = to;
  901.   register int i = count;
  902.  
  903.   while (i-- > 0)
  904.     *t++ = *f++;
  905. }
  906.  
  907. #else /* __cplusplus */
  908.  
  909. /* This is the most reliable way to avoid incompatibilities
  910.    in available built-in functions on various systems.  */
  911. static void
  912. __yy_bcopy (char *from, char *to, int count)
  913. {
  914.   register char *f = from;
  915.   register char *t = to;
  916.   register int i = count;
  917.  
  918.   while (i-- > 0)
  919.     *t++ = *f++;
  920. }
  921.  
  922. #endif
  923. #endif
  924.  
  925. int
  926. yyparse()
  927. {
  928.   register int yystate;
  929.   register int yyn;
  930.   register short *yyssp;
  931.   register YYSTYPE *yyvsp;
  932.   int yyerrstatus;    /*  number of tokens to shift before error messages enabled */
  933.   int yychar1;        /*  lookahead token as an internal (translated) token number */
  934.  
  935.   short    yyssa[YYINITDEPTH];    /*  the state stack            */
  936.   YYSTYPE yyvsa[YYINITDEPTH];    /*  the semantic value stack        */
  937.  
  938.   short *yyss = yyssa;        /*  refer to the stacks thru separate pointers */
  939.   YYSTYPE *yyvs = yyvsa;    /*  to allow yyoverflow to reallocate them elsewhere */
  940.  
  941. #ifdef YYLSP_NEEDED
  942.   YYLTYPE yylsa[YYINITDEPTH];    /*  the location stack            */
  943.   YYLTYPE *yyls = yylsa;
  944.   YYLTYPE *yylsp;
  945.  
  946. #define YYPOPSTACK   (yyvsp--, yyssp--, yylsp--)
  947. #else
  948. #define YYPOPSTACK   (yyvsp--, yyssp--)
  949. #endif
  950.  
  951.   int yystacksize = YYINITDEPTH;
  952.  
  953. #ifdef YYPURE
  954.   int yychar;
  955.   YYSTYPE yylval;
  956.   int yynerrs;
  957. #ifdef YYLSP_NEEDED
  958.   YYLTYPE yylloc;
  959. #endif
  960. #endif
  961.  
  962.   YYSTYPE yyval;        /*  the variable used to return        */
  963.                 /*  semantic values from the action    */
  964.                 /*  routines                */
  965.  
  966.   int yylen;
  967.  
  968. #if YYDEBUG != 0
  969.   if (yydebug)
  970.     fprintf(stderr, "Starting parse\n");
  971. #endif
  972.  
  973.   yystate = 0;
  974.   yyerrstatus = 0;
  975.   yynerrs = 0;
  976.   yychar = YYEMPTY;        /* Cause a token to be read.  */
  977.  
  978.   /* Initialize stack pointers.
  979.      Waste one element of value and location stack
  980.      so that they stay on the same level as the state stack.  */
  981.  
  982.   yyssp = yyss - 1;
  983.   yyvsp = yyvs;
  984. #ifdef YYLSP_NEEDED
  985.   yylsp = yyls;
  986. #endif
  987.  
  988. /* Push a new state, which is found in  yystate  .  */
  989. /* In all cases, when you get here, the value and location stacks
  990.    have just been pushed. so pushing a state here evens the stacks.  */
  991. yynewstate:
  992.  
  993.   *++yyssp = yystate;
  994.  
  995.   if (yyssp >= yyss + yystacksize - 1)
  996.     {
  997.       /* Give user a chance to reallocate the stack */
  998.       /* Use copies of these so that the &'s don't force the real ones into memory. */
  999.       YYSTYPE *yyvs1 = yyvs;
  1000.       short *yyss1 = yyss;
  1001. #ifdef YYLSP_NEEDED
  1002.       YYLTYPE *yyls1 = yyls;
  1003. #endif
  1004.  
  1005.       /* Get the current used size of the three stacks, in elements.  */
  1006.       int size = yyssp - yyss + 1;
  1007.  
  1008. #ifdef yyoverflow
  1009.       /* Each stack pointer address is followed by the size of
  1010.      the data in use in that stack, in bytes.  */
  1011.       yyoverflow("parser stack overflow",
  1012.          &yyss1, size * sizeof (*yyssp),
  1013.          &yyvs1, size * sizeof (*yyvsp),
  1014. #ifdef YYLSP_NEEDED
  1015.          &yyls1, size * sizeof (*yylsp),
  1016. #endif
  1017.          &yystacksize);
  1018.  
  1019.       yyss = yyss1; yyvs = yyvs1;
  1020. #ifdef YYLSP_NEEDED
  1021.       yyls = yyls1;
  1022. #endif
  1023. #else /* no yyoverflow */
  1024.       /* Extend the stack our own way.  */
  1025.       if (yystacksize >= YYMAXDEPTH)
  1026.     {
  1027.       yyerror("parser stack overflow");
  1028.       return 2;
  1029.     }
  1030.       yystacksize *= 2;
  1031.       if (yystacksize > YYMAXDEPTH)
  1032.     yystacksize = YYMAXDEPTH;
  1033.       yyss = (short *) alloca (yystacksize * sizeof (*yyssp));
  1034.       __yy_bcopy ((char *)yyss1, (char *)yyss, size * sizeof (*yyssp));
  1035.       yyvs = (YYSTYPE *) alloca (yystacksize * sizeof (*yyvsp));
  1036.       __yy_bcopy ((char *)yyvs1, (char *)yyvs, size * sizeof (*yyvsp));
  1037. #ifdef YYLSP_NEEDED
  1038.       yyls = (YYLTYPE *) alloca (yystacksize * sizeof (*yylsp));
  1039.       __yy_bcopy ((char *)yyls1, (char *)yyls, size * sizeof (*yylsp));
  1040. #endif
  1041. #endif /* no yyoverflow */
  1042.  
  1043.       yyssp = yyss + size - 1;
  1044.       yyvsp = yyvs + size - 1;
  1045. #ifdef YYLSP_NEEDED
  1046.       yylsp = yyls + size - 1;
  1047. #endif
  1048.  
  1049. #if YYDEBUG != 0
  1050.       if (yydebug)
  1051.     fprintf(stderr, "Stack size increased to %d\n", yystacksize);
  1052. #endif
  1053.  
  1054.       if (yyssp >= yyss + yystacksize - 1)
  1055.     YYABORT;
  1056.     }
  1057.  
  1058. #if YYDEBUG != 0
  1059.   if (yydebug)
  1060.     fprintf(stderr, "Entering state %d\n", yystate);
  1061. #endif
  1062.  
  1063.  yybackup:
  1064.  
  1065. /* Do appropriate processing given the current state.  */
  1066. /* Read a lookahead token if we need one and don't already have one.  */
  1067. /* yyresume: */
  1068.  
  1069.   /* First try to decide what to do without reference to lookahead token.  */
  1070.  
  1071.   yyn = yypact[yystate];
  1072.   if (yyn == YYFLAG)
  1073.     goto yydefault;
  1074.  
  1075.   /* Not known => get a lookahead token if don't already have one.  */
  1076.  
  1077.   /* yychar is either YYEMPTY or YYEOF
  1078.      or a valid token in external form.  */
  1079.  
  1080.   if (yychar == YYEMPTY)
  1081.     {
  1082. #if YYDEBUG != 0
  1083.       if (yydebug)
  1084.     fprintf(stderr, "Reading a token: ");
  1085. #endif
  1086.       yychar = YYLEX;
  1087.     }
  1088.  
  1089.   /* Convert token to internal form (in yychar1) for indexing tables with */
  1090.  
  1091.   if (yychar <= 0)        /* This means end of input. */
  1092.     {
  1093.       yychar1 = 0;
  1094.       yychar = YYEOF;        /* Don't call YYLEX any more */
  1095.  
  1096. #if YYDEBUG != 0
  1097.       if (yydebug)
  1098.     fprintf(stderr, "Now at end of input.\n");
  1099. #endif
  1100.     }
  1101.   else
  1102.     {
  1103.       yychar1 = YYTRANSLATE(yychar);
  1104.  
  1105. #if YYDEBUG != 0
  1106.       if (yydebug)
  1107.     {
  1108.       fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]);
  1109.       /* Give the individual parser a way to print the precise meaning
  1110.          of a token, for further debugging info.  */
  1111. #ifdef YYPRINT
  1112.       YYPRINT (stderr, yychar, yylval);
  1113. #endif
  1114.       fprintf (stderr, ")\n");
  1115.     }
  1116. #endif
  1117.     }
  1118.  
  1119.   yyn += yychar1;
  1120.   if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
  1121.     goto yydefault;
  1122.  
  1123.   yyn = yytable[yyn];
  1124.  
  1125.   /* yyn is what to do for this token type in this state.
  1126.      Negative => reduce, -yyn is rule number.
  1127.      Positive => shift, yyn is new state.
  1128.        New state is final state => don't bother to shift,
  1129.        just return success.
  1130.      0, or most negative number => error.  */
  1131.  
  1132.   if (yyn < 0)
  1133.     {
  1134.       if (yyn == YYFLAG)
  1135.     goto yyerrlab;
  1136.       yyn = -yyn;
  1137.       goto yyreduce;
  1138.     }
  1139.   else if (yyn == 0)
  1140.     goto yyerrlab;
  1141.  
  1142.   if (yyn == YYFINAL)
  1143.     YYACCEPT;
  1144.  
  1145.   /* Shift the lookahead token.  */
  1146.  
  1147. #if YYDEBUG != 0
  1148.   if (yydebug)
  1149.     fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);
  1150. #endif
  1151.  
  1152.   /* Discard the token being shifted unless it is eof.  */
  1153.   if (yychar != YYEOF)
  1154.     yychar = YYEMPTY;
  1155.  
  1156.   *++yyvsp = yylval;
  1157. #ifdef YYLSP_NEEDED
  1158.   *++yylsp = yylloc;
  1159. #endif
  1160.  
  1161.   /* count tokens shifted since error; after three, turn off error status.  */
  1162.   if (yyerrstatus) yyerrstatus--;
  1163.  
  1164.   yystate = yyn;
  1165.   goto yynewstate;
  1166.  
  1167. /* Do the default action for the current state.  */
  1168. yydefault:
  1169.  
  1170.   yyn = yydefact[yystate];
  1171.   if (yyn == 0)
  1172.     goto yyerrlab;
  1173.  
  1174. /* Do a reduction.  yyn is the number of a rule to reduce with.  */
  1175. yyreduce:
  1176.   yylen = yyr2[yyn];
  1177.   yyval = yyvsp[1-yylen]; /* implement default value of the action */
  1178.  
  1179. #if YYDEBUG != 0
  1180.   if (yydebug)
  1181.     {
  1182.       int i;
  1183.  
  1184.       fprintf (stderr, "Reducing via rule %d (line %d), ",
  1185.            yyn, yyrline[yyn]);
  1186.  
  1187.       /* Print the symboles being reduced, and their result.  */
  1188.       for (i = yyprhs[yyn]; yyrhs[i] > 0; i++)
  1189.     fprintf (stderr, "%s ", yytname[yyrhs[i]]);
  1190.       fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]);
  1191.     }
  1192. #endif
  1193.  
  1194.  
  1195.   switch (yyn) {
  1196.  
  1197. case 1:
  1198. { expression_value = yyvsp[-1].nodeval; ;
  1199.     break;}
  1200. case 2:
  1201.             if (yyvsp[0].nodeval != NULL)
  1202.                 yyval.nodeval = yyvsp[0].nodeval;
  1203.             else
  1204.                 yyval.nodeval = NULL;
  1205.             yyerrok;
  1206.         ;
  1207.     break;}
  1208. case 3:
  1209. {
  1210.             if (yyvsp[0].nodeval == NULL)
  1211.                 yyval.nodeval = yyvsp[-1].nodeval;
  1212.             else if (yyvsp[-1].nodeval == NULL)
  1213.                 yyval.nodeval = yyvsp[0].nodeval;
  1214.             else {
  1215.                 if (yyvsp[-1].nodeval->type != Node_rule_list)
  1216.                     yyvsp[-1].nodeval = node(yyvsp[-1].nodeval, Node_rule_list,
  1217.                         (NODE*)NULL);
  1218.                 yyval.nodeval = append_right (yyvsp[-1].nodeval,
  1219.                    node(yyvsp[0].nodeval, Node_rule_list,(NODE *) NULL));
  1220.             }
  1221.             yyerrok;
  1222.         ;
  1223.     break;}
  1224. case 4:
  1225. { yyval.nodeval = NULL; ;
  1226.     break;}
  1227. case 5:
  1228. { yyval.nodeval = NULL; ;
  1229.     break;}
  1230. case 6:
  1231. { io_allowed = 0; ;
  1232.     break;}
  1233. case 7:
  1234. {
  1235.         if (begin_block) {
  1236.             if (begin_block->type != Node_rule_list)
  1237.                 begin_block = node(begin_block, Node_rule_list,
  1238.                     (NODE *)NULL);
  1239.             (void) append_right (begin_block, node(
  1240.                 node((NODE *)NULL, Node_rule_node, yyvsp[0].nodeval),
  1241.                 Node_rule_list, (NODE *)NULL) );
  1242.         } else
  1243.             begin_block = node((NODE *)NULL, Node_rule_node, yyvsp[0].nodeval);
  1244.         yyval.nodeval = NULL;
  1245.         io_allowed = 1;
  1246.         yyerrok;
  1247.       ;
  1248.     break;}
  1249. case 8:
  1250. { io_allowed = 0; ;
  1251.     break;}
  1252. case 9:
  1253. {
  1254.         if (end_block) {
  1255.             if (end_block->type != Node_rule_list)
  1256.                 end_block = node(end_block, Node_rule_list,
  1257.                     (NODE *)NULL);
  1258.             (void) append_right (end_block, node(
  1259.                 node((NODE *)NULL, Node_rule_node, yyvsp[0].nodeval),
  1260.                 Node_rule_list, (NODE *)NULL));
  1261.         } else
  1262.             end_block = node((NODE *)NULL, Node_rule_node, yyvsp[0].nodeval);
  1263.         yyval.nodeval = NULL;
  1264.         io_allowed = 1;
  1265.         yyerrok;
  1266.       ;
  1267.     break;}
  1268. case 10:
  1269. {
  1270.         warning("BEGIN blocks must have an action part");
  1271.         errcount++;
  1272.         yyerrok;
  1273.       ;
  1274.     break;}
  1275. case 11:
  1276. {
  1277.         warning("END blocks must have an action part");
  1278.         errcount++;
  1279.         yyerrok;
  1280.       ;
  1281.     break;}
  1282. case 12:
  1283. { yyval.nodeval = node (yyvsp[-1].nodeval, Node_rule_node, yyvsp[0].nodeval); yyerrok; ;
  1284.     break;}
  1285. case 13:
  1286. { yyval.nodeval = node ((NODE *)NULL, Node_rule_node, yyvsp[0].nodeval); yyerrok; ;
  1287.     break;}
  1288. case 14:
  1289. {
  1290.           yyval.nodeval = node (yyvsp[-1].nodeval,
  1291.                  Node_rule_node,
  1292.                  node(node(node(make_number(0.0),
  1293.                         Node_field_spec,
  1294.                         (NODE *) NULL),
  1295.                     Node_expression_list,
  1296.                     (NODE *) NULL),
  1297.                   Node_K_print,
  1298.                   (NODE *) NULL));
  1299.           yyerrok;
  1300.         ;
  1301.     break;}
  1302. case 15:
  1303. {
  1304.             func_install(yyvsp[-1].nodeval, yyvsp[0].nodeval);
  1305.             yyval.nodeval = NULL;
  1306.             yyerrok;
  1307.         ;
  1308.     break;}
  1309. case 16:
  1310. { yyval.sval = yyvsp[0].sval; ;
  1311.     break;}
  1312. case 17:
  1313. { yyval.sval = yyvsp[0].sval; ;
  1314.     break;}
  1315. case 18:
  1316. {
  1317.         yyerror("%s() is a built-in function, it cannot be redefined",
  1318.             tokstart);
  1319.         errcount++;
  1320.         /* yyerrok; */
  1321.       ;
  1322.     break;}
  1323. case 21:
  1324. {
  1325.             param_counter = 0;
  1326.         ;
  1327.     break;}
  1328. case 22:
  1329. {
  1330.             yyval.nodeval = append_right(make_param(yyvsp[-4].sval), yyvsp[-2].nodeval);
  1331.             can_return = 1;
  1332.         ;
  1333.     break;}
  1334. case 23:
  1335. {
  1336.         yyval.nodeval = yyvsp[-2].nodeval;
  1337.         can_return = 0;
  1338.       ;
  1339.     break;}
  1340. case 24:
  1341. { yyval.nodeval = yyvsp[0].nodeval; ;
  1342.     break;}
  1343. case 25:
  1344. { yyval.nodeval = mkrangenode ( node(yyvsp[-2].nodeval, Node_cond_pair, yyvsp[0].nodeval) ); ;
  1345.     break;}
  1346. case 26:
  1347. { ++want_regexp; ;
  1348.     break;}
  1349. case 27:
  1350. {
  1351.           NODE *n;
  1352.           size_t len;
  1353.  
  1354.           getnode(n);
  1355.           n->type = Node_regex;
  1356.           len = strlen(yyvsp[-1].sval);
  1357.           n->re_exp = make_string(yyvsp[-1].sval, len);
  1358.           n->re_reg = make_regexp(yyvsp[-1].sval, len, 0, 1);
  1359.           n->re_text = NULL;
  1360.           n->re_flags = CONST;
  1361.           n->re_cnt = 1;
  1362.           yyval.nodeval = n;
  1363.         ;
  1364.     break;}
  1365. case 28:
  1366. { yyval.nodeval = yyvsp[-3].nodeval ; ;
  1367.     break;}
  1368. case 29:
  1369. { yyval.nodeval = NULL; ;
  1370.     break;}
  1371. case 30:
  1372. { yyval.nodeval = yyvsp[0].nodeval; ;
  1373.     break;}
  1374. case 31:
  1375. {
  1376.             if (yyvsp[-1].nodeval == NULL || yyvsp[-1].nodeval->type != Node_statement_list)
  1377.                 yyvsp[-1].nodeval = node(yyvsp[-1].nodeval, Node_statement_list,(NODE *)NULL);
  1378.                 yyval.nodeval = append_right(yyvsp[-1].nodeval,
  1379.                 node( yyvsp[0].nodeval, Node_statement_list, (NODE *)NULL));
  1380.                 yyerrok;
  1381.         ;
  1382.     break;}
  1383. case 32:
  1384. { yyval.nodeval = NULL; ;
  1385.     break;}
  1386. case 33:
  1387. { yyval.nodeval = NULL; ;
  1388.     break;}
  1389. case 36:
  1390. { yyval.nodeval = NULL; ;
  1391.     break;}
  1392. case 37:
  1393. { yyval.nodeval = NULL; ;
  1394.     break;}
  1395. case 38:
  1396. { yyval.nodeval = yyvsp[-1].nodeval; ;
  1397.     break;}
  1398. case 39:
  1399. { yyval.nodeval = yyvsp[0].nodeval; ;
  1400.     break;}
  1401. case 40:
  1402. { yyval.nodeval = node (yyvsp[-3].nodeval, Node_K_while, yyvsp[0].nodeval); ;
  1403.     break;}
  1404. case 41:
  1405. { yyval.nodeval = node (yyvsp[-2].nodeval, Node_K_do, yyvsp[-5].nodeval); ;
  1406.     break;}
  1407. case 42:
  1408. {
  1409.         yyval.nodeval = node (yyvsp[0].nodeval, Node_K_arrayfor, make_for_loop(variable(yyvsp[-5].sval,1),
  1410.             (NODE *)NULL, variable(yyvsp[-3].sval,1)));
  1411.       ;
  1412.     break;}
  1413. case 43:
  1414. {
  1415.         yyval.nodeval = node(yyvsp[0].nodeval, Node_K_for, (NODE *)make_for_loop(yyvsp[-7].nodeval, yyvsp[-5].nodeval, yyvsp[-3].nodeval));
  1416.       ;
  1417.     break;}
  1418. case 44:
  1419. {
  1420.         yyval.nodeval = node (yyvsp[0].nodeval, Node_K_for,
  1421.             (NODE *)make_for_loop(yyvsp[-6].nodeval, (NODE *)NULL, yyvsp[-3].nodeval));
  1422.       ;
  1423.     break;}
  1424. case 45:
  1425. { yyval.nodeval = node ((NODE *)NULL, Node_K_break, (NODE *)NULL); ;
  1426.     break;}
  1427. case 46:
  1428. { yyval.nodeval = node ((NODE *)NULL, Node_K_continue, (NODE *)NULL); ;
  1429.     break;}
  1430. case 47:
  1431. { yyval.nodeval = node (yyvsp[-3].nodeval, yyvsp[-5].nodetypeval, yyvsp[-1].nodeval); ;
  1432.     break;}
  1433. case 48:
  1434. {
  1435.             if (yyvsp[-3].nodetypeval == Node_K_print && yyvsp[-2].nodeval == NULL)
  1436.                 yyvsp[-2].nodeval = node(node(make_number(0.0),
  1437.                            Node_field_spec,
  1438.                            (NODE *) NULL),
  1439.                       Node_expression_list,
  1440.                       (NODE *) NULL);
  1441.  
  1442.             yyval.nodeval = node (yyvsp[-2].nodeval, yyvsp[-3].nodetypeval, yyvsp[-1].nodeval);
  1443.         ;
  1444.     break;}
  1445. case 49:
  1446. { NODETYPE type;
  1447.  
  1448.           if (yyvsp[-1].nodeval && yyvsp[-1].nodeval == lookup("file")) {
  1449.             if (do_lint)
  1450.                 warning("`next file' is a gawk extension");
  1451.             if (do_unix || do_posix) {
  1452.                 /*
  1453.                  * can't use yyerror, since may have overshot
  1454.                  * the source line
  1455.                  */
  1456.                 errcount++;
  1457.                 msg("`next file' is a gawk extension");
  1458.             }
  1459.             if (! io_allowed) {
  1460.                 /* same thing */
  1461.                 errcount++;
  1462.                 msg("`next file' used in BEGIN or END action");
  1463.             }
  1464.             type = Node_K_nextfile;
  1465.           } else {
  1466.             if (! io_allowed)
  1467.                 yyerror("next used in BEGIN or END action");
  1468.             type = Node_K_next;
  1469.         }
  1470.           yyval.nodeval = node ((NODE *)NULL, type, (NODE *)NULL);
  1471.         ;
  1472.     break;}
  1473. case 50:
  1474. { yyval.nodeval = node (yyvsp[-1].nodeval, Node_K_exit, (NODE *)NULL); ;
  1475.     break;}
  1476. case 51:
  1477. { if (! can_return) yyerror("return used outside function context"); ;
  1478.     break;}
  1479. case 52:
  1480. { yyval.nodeval = node (yyvsp[-1].nodeval, Node_K_return, (NODE *)NULL); ;
  1481.     break;}
  1482. case 53:
  1483. { yyval.nodeval = node (variable(yyvsp[-4].sval,1), Node_K_delete, yyvsp[-2].nodeval); ;
  1484.     break;}
  1485. case 54:
  1486. {
  1487.           if (do_lint)
  1488.             warning("`delete array' is a gawk extension");
  1489.           if (do_unix || do_posix) {
  1490.             /*
  1491.              * can't use yyerror, since may have overshot
  1492.              * the source line
  1493.              */
  1494.             errcount++;
  1495.             msg("`delete array' is a gawk extension");
  1496.           }
  1497.           yyval.nodeval = node (variable(yyvsp[-1].sval,1), Node_K_delete, (NODE *) NULL);
  1498.         ;
  1499.     break;}
  1500. case 55:
  1501. { yyval.nodeval = yyvsp[-1].nodeval; ;
  1502.     break;}
  1503. case 56:
  1504. { yyval.nodetypeval = yyvsp[0].nodetypeval; ;
  1505.     break;}
  1506. case 57:
  1507. { yyval.nodetypeval = yyvsp[0].nodetypeval; ;
  1508.     break;}
  1509. case 58:
  1510. {
  1511.         yyval.nodeval = node(yyvsp[-3].nodeval, Node_K_if, 
  1512.             node(yyvsp[0].nodeval, Node_if_branches, (NODE *)NULL));
  1513.       ;
  1514.     break;}
  1515. case 59:
  1516. { yyval.nodeval = node (yyvsp[-6].nodeval, Node_K_if,
  1517.                 node (yyvsp[-3].nodeval, Node_if_branches, yyvsp[0].nodeval)); ;
  1518.     break;}
  1519. case 60:
  1520. { want_assign = 0; ;
  1521.     break;}
  1522. case 64:
  1523. { yyval.nodeval = NULL; ;
  1524.     break;}
  1525. case 65:
  1526. { yyval.nodeval = node (yyvsp[0].nodeval, Node_redirect_input, (NODE *)NULL); ;
  1527.     break;}
  1528. case 66:
  1529. { yyval.nodeval = NULL; ;
  1530.     break;}
  1531. case 67:
  1532. { yyval.nodeval = node (yyvsp[0].nodeval, Node_redirect_output, (NODE *)NULL); ;
  1533.     break;}
  1534. case 68:
  1535. { yyval.nodeval = node (yyvsp[0].nodeval, Node_redirect_append, (NODE *)NULL); ;
  1536.     break;}
  1537. case 69:
  1538. { yyval.nodeval = node (yyvsp[0].nodeval, Node_redirect_pipe, (NODE *)NULL); ;
  1539.     break;}
  1540. case 70:
  1541. { yyval.nodeval = NULL; ;
  1542.     break;}
  1543. case 71:
  1544. { yyval.nodeval = yyvsp[0].nodeval; ;
  1545.     break;}
  1546. case 72:
  1547. { yyval.nodeval = make_param(yyvsp[0].sval); ;
  1548.     break;}
  1549. case 73:
  1550. { yyval.nodeval = append_right(yyvsp[-2].nodeval, make_param(yyvsp[0].sval)); yyerrok; ;
  1551.     break;}
  1552. case 74:
  1553. { yyval.nodeval = NULL; ;
  1554.     break;}
  1555. case 75:
  1556. { yyval.nodeval = NULL; ;
  1557.     break;}
  1558. case 76:
  1559. { yyval.nodeval = NULL; ;
  1560.     break;}
  1561. case 77:
  1562. { yyval.nodeval = NULL; ;
  1563.     break;}
  1564. case 78:
  1565. { yyval.nodeval = yyvsp[0].nodeval; ;
  1566.     break;}
  1567. case 79:
  1568. { yyval.nodeval = NULL; ;
  1569.     break;}
  1570. case 80:
  1571. { yyval.nodeval = yyvsp[0].nodeval; ;
  1572.     break;}
  1573. case 81:
  1574. { yyval.nodeval = node (yyvsp[0].nodeval, Node_expression_list, (NODE *)NULL); ;
  1575.     break;}
  1576. case 82:
  1577. {
  1578.         yyval.nodeval = append_right(yyvsp[-2].nodeval,
  1579.             node( yyvsp[0].nodeval, Node_expression_list, (NODE *)NULL));
  1580.         yyerrok;
  1581.       ;
  1582.     break;}
  1583. case 83:
  1584. { yyval.nodeval = NULL; ;
  1585.     break;}
  1586. case 84:
  1587. { yyval.nodeval = NULL; ;
  1588.     break;}
  1589. case 85:
  1590. { yyval.nodeval = NULL; ;
  1591.     break;}
  1592. case 86:
  1593. { yyval.nodeval = NULL; ;
  1594.     break;}
  1595. case 87:
  1596. { yyval.nodeval = NULL; ;
  1597.     break;}
  1598. case 88:
  1599. { yyval.nodeval = yyvsp[0].nodeval; ;
  1600.     break;}
  1601. case 89:
  1602. { yyval.nodeval = node (yyvsp[0].nodeval, Node_expression_list, (NODE *)NULL); ;
  1603.     break;}
  1604. case 90:
  1605. {
  1606.             yyval.nodeval = append_right(yyvsp[-2].nodeval,
  1607.                 node( yyvsp[0].nodeval, Node_expression_list, (NODE *)NULL));
  1608.             yyerrok;
  1609.         ;
  1610.     break;}
  1611. case 91:
  1612. { yyval.nodeval = NULL; ;
  1613.     break;}
  1614. case 92:
  1615. { yyval.nodeval = NULL; ;
  1616.     break;}
  1617. case 93:
  1618. { yyval.nodeval = NULL; ;
  1619.     break;}
  1620. case 94:
  1621. { yyval.nodeval = NULL; ;
  1622.     break;}
  1623. case 95:
  1624. { want_assign = 0; ;
  1625.     break;}
  1626. case 96:
  1627. {
  1628.           if (do_lint && yyvsp[0].nodeval->type == Node_regex)
  1629.             warning("Regular expression on left of assignment.");
  1630.           yyval.nodeval = node (yyvsp[-3].nodeval, yyvsp[-2].nodetypeval, yyvsp[0].nodeval);
  1631.         ;
  1632.     break;}
  1633. case 97:
  1634. { yyval.nodeval = node (variable(yyvsp[0].sval,1), Node_in_array, yyvsp[-3].nodeval); ;
  1635.     break;}
  1636. case 98:
  1637. {
  1638.           yyval.nodeval = node (yyvsp[0].nodeval, Node_K_getline,
  1639.              node (yyvsp[-3].nodeval, Node_redirect_pipein, (NODE *)NULL));
  1640.         ;
  1641.     break;}
  1642. case 99:
  1643. {
  1644.           if (do_lint && ! io_allowed && yyvsp[0].nodeval == NULL)
  1645.             warning("non-redirected getline undefined inside BEGIN or END action");
  1646.           yyval.nodeval = node (yyvsp[-1].nodeval, Node_K_getline, yyvsp[0].nodeval);
  1647.         ;
  1648.     break;}
  1649. case 100:
  1650. { yyval.nodeval = node (yyvsp[-2].nodeval, Node_and, yyvsp[0].nodeval); ;
  1651.     break;}
  1652. case 101:
  1653. { yyval.nodeval = node (yyvsp[-2].nodeval, Node_or, yyvsp[0].nodeval); ;
  1654.     break;}
  1655. case 102:
  1656. {
  1657.           if (yyvsp[-2].nodeval->type == Node_regex)
  1658.             warning("Regular expression on left of MATCH operator.");
  1659.           yyval.nodeval = node (yyvsp[-2].nodeval, yyvsp[-1].nodetypeval, mk_rexp(yyvsp[0].nodeval));
  1660.         ;
  1661.     break;}
  1662. case 103:
  1663. { yyval.nodeval = yyvsp[0].nodeval; ;
  1664.     break;}
  1665. case 104:
  1666. {
  1667.           yyval.nodeval = node(node(make_number(0.0),
  1668.                  Node_field_spec,
  1669.                  (NODE *) NULL),
  1670.                     Node_nomatch,
  1671.                 yyvsp[0].nodeval);
  1672.         ;
  1673.     break;}
  1674. case 105:
  1675. { yyval.nodeval = node (variable(yyvsp[0].sval,1), Node_in_array, yyvsp[-2].nodeval); ;
  1676.     break;}
  1677. case 106:
  1678. {
  1679.           if (do_lint && yyvsp[0].nodeval->type == Node_regex)
  1680.             warning("Regular expression on left of comparison.");
  1681.           yyval.nodeval = node (yyvsp[-2].nodeval, yyvsp[-1].nodetypeval, yyvsp[0].nodeval);
  1682.         ;
  1683.     break;}
  1684. case 107:
  1685. { yyval.nodeval = node (yyvsp[-2].nodeval, Node_less, yyvsp[0].nodeval); ;
  1686.     break;}
  1687. case 108:
  1688. { yyval.nodeval = node (yyvsp[-2].nodeval, Node_greater, yyvsp[0].nodeval); ;
  1689.     break;}
  1690. case 109:
  1691. { yyval.nodeval = node(yyvsp[-4].nodeval, Node_cond_exp, node(yyvsp[-2].nodeval, Node_if_branches, yyvsp[0].nodeval));;
  1692.     break;}
  1693. case 110:
  1694. { yyval.nodeval = yyvsp[0].nodeval; ;
  1695.     break;}
  1696. case 111:
  1697. { yyval.nodeval = node (yyvsp[-1].nodeval, Node_concat, yyvsp[0].nodeval); ;
  1698.     break;}
  1699. case 112:
  1700. { want_assign = 0; ;
  1701.     break;}
  1702. case 113:
  1703. { yyval.nodeval = node (yyvsp[-3].nodeval, yyvsp[-2].nodetypeval, yyvsp[0].nodeval); ;
  1704.     break;}
  1705. case 114:
  1706. { yyval.nodeval = node (yyvsp[-2].nodeval, Node_and, yyvsp[0].nodeval); ;
  1707.     break;}
  1708. case 115:
  1709. { yyval.nodeval = node (yyvsp[-2].nodeval, Node_or, yyvsp[0].nodeval); ;
  1710.     break;}
  1711. case 116:
  1712. {
  1713.           if (do_lint && ! io_allowed && yyvsp[0].nodeval == NULL)
  1714.             warning("non-redirected getline undefined inside BEGIN or END action");
  1715.           yyval.nodeval = node (yyvsp[-1].nodeval, Node_K_getline, yyvsp[0].nodeval);
  1716.         ;
  1717.     break;}
  1718. case 117:
  1719. { yyval.nodeval = yyvsp[0].nodeval; ;
  1720.     break;}
  1721. case 118:
  1722. { yyval.nodeval = node((NODE *) NULL, Node_nomatch, yyvsp[0].nodeval); ;
  1723.     break;}
  1724. case 119:
  1725. { yyval.nodeval = node (yyvsp[-2].nodeval, yyvsp[-1].nodetypeval, mk_rexp(yyvsp[0].nodeval)); ;
  1726.     break;}
  1727. case 120:
  1728. { yyval.nodeval = node (variable(yyvsp[0].sval,1), Node_in_array, yyvsp[-2].nodeval); ;
  1729.     break;}
  1730. case 121:
  1731. { yyval.nodeval = node (yyvsp[-2].nodeval, yyvsp[-1].nodetypeval, yyvsp[0].nodeval); ;
  1732.     break;}
  1733. case 122:
  1734. { yyval.nodeval = node(yyvsp[-4].nodeval, Node_cond_exp, node(yyvsp[-2].nodeval, Node_if_branches, yyvsp[0].nodeval));;
  1735.     break;}
  1736. case 123:
  1737. { yyval.nodeval = yyvsp[0].nodeval; ;
  1738.     break;}
  1739. case 124:
  1740. { yyval.nodeval = node (yyvsp[-1].nodeval, Node_concat, yyvsp[0].nodeval); ;
  1741.     break;}
  1742. case 126:
  1743. { yyval.nodeval = node (yyvsp[-2].nodeval, Node_exp, yyvsp[0].nodeval); ;
  1744.     break;}
  1745. case 127:
  1746. { yyval.nodeval = node (yyvsp[-2].nodeval, Node_times, yyvsp[0].nodeval); ;
  1747.     break;}
  1748. case 128:
  1749. { yyval.nodeval = node (yyvsp[-2].nodeval, Node_quotient, yyvsp[0].nodeval); ;
  1750.     break;}
  1751. case 129:
  1752. { yyval.nodeval = node (yyvsp[-2].nodeval, Node_mod, yyvsp[0].nodeval); ;
  1753.     break;}
  1754. case 130:
  1755. { yyval.nodeval = node (yyvsp[-2].nodeval, Node_plus, yyvsp[0].nodeval); ;
  1756.     break;}
  1757. case 131:
  1758. { yyval.nodeval = node (yyvsp[-2].nodeval, Node_minus, yyvsp[0].nodeval); ;
  1759.     break;}
  1760. case 132:
  1761. { yyval.nodeval = node (yyvsp[-1].nodeval, Node_postincrement, (NODE *)NULL); ;
  1762.     break;}
  1763. case 133:
  1764. { yyval.nodeval = node (yyvsp[-1].nodeval, Node_postdecrement, (NODE *)NULL); ;
  1765.     break;}
  1766. case 134:
  1767. { yyval.nodeval = node (yyvsp[0].nodeval, Node_not,(NODE *) NULL); ;
  1768.     break;}
  1769. case 135:
  1770. { yyval.nodeval = yyvsp[-1].nodeval; ;
  1771.     break;}
  1772. case 136:
  1773. { yyval.nodeval = snode (yyvsp[-1].nodeval, Node_builtin, (int) yyvsp[-3].lval); ;
  1774.     break;}
  1775. case 137:
  1776. { yyval.nodeval = snode (yyvsp[-1].nodeval, Node_builtin, (int) yyvsp[-3].lval); ;
  1777.     break;}
  1778. case 138:
  1779. {
  1780.         if (do_lint)
  1781.             warning("call of `length' without parentheses is not portable");
  1782.         yyval.nodeval = snode ((NODE *)NULL, Node_builtin, (int) yyvsp[0].lval);
  1783.         if (do_posix)
  1784.             warning( "call of `length' without parentheses is deprecated by POSIX");
  1785.       ;
  1786.     break;}
  1787. case 139:
  1788. {
  1789.         yyval.nodeval = node (yyvsp[-1].nodeval, Node_func_call, make_string(yyvsp[-3].sval, strlen(yyvsp[-3].sval)));
  1790.       ;
  1791.     break;}
  1792. case 141:
  1793. { yyval.nodeval = node (yyvsp[0].nodeval, Node_preincrement, (NODE *)NULL); ;
  1794.     break;}
  1795. case 142:
  1796. { yyval.nodeval = node (yyvsp[0].nodeval, Node_predecrement, (NODE *)NULL); ;
  1797.     break;}
  1798. case 143:
  1799. { yyval.nodeval = yyvsp[0].nodeval; ;
  1800.     break;}
  1801. case 144:
  1802. { yyval.nodeval = yyvsp[0].nodeval; ;
  1803.     break;}
  1804. case 145:
  1805. { if (yyvsp[0].nodeval->type == Node_val) {
  1806.             yyvsp[0].nodeval->numbr = -(force_number(yyvsp[0].nodeval));
  1807.             yyval.nodeval = yyvsp[0].nodeval;
  1808.           } else
  1809.             yyval.nodeval = node (yyvsp[0].nodeval, Node_unary_minus, (NODE *)NULL);
  1810.         ;
  1811.     break;}
  1812. case 146:
  1813. { yyval.nodeval = yyvsp[0].nodeval; ;
  1814.     break;}
  1815. case 147:
  1816. { yyval.nodeval = NULL; ;
  1817.     break;}
  1818. case 148:
  1819. { yyval.nodeval = yyvsp[0].nodeval; ;
  1820.     break;}
  1821. case 149:
  1822. { yyval.nodeval = variable(yyvsp[0].sval,1); ;
  1823.     break;}
  1824. case 150:
  1825. {
  1826.         if (yyvsp[-1].nodeval->rnode == NULL) {
  1827.             yyval.nodeval = node (variable(yyvsp[-3].sval,1), Node_subscript, yyvsp[-1].nodeval->lnode);
  1828.             freenode(yyvsp[-1].nodeval);
  1829.         } else
  1830.             yyval.nodeval = node (variable(yyvsp[-3].sval,1), Node_subscript, yyvsp[-1].nodeval);
  1831.         ;
  1832.     break;}
  1833. case 151:
  1834. { yyval.nodeval = node (yyvsp[0].nodeval, Node_field_spec, (NODE *)NULL); ;
  1835.     break;}
  1836. case 153:
  1837. { yyerrok; ;
  1838.     break;}
  1839. case 154:
  1840. { yyerrok; ;
  1841.     break;}
  1842. case 157:
  1843. { yyerrok; want_assign = 0; ;
  1844.     break;}
  1845. case 158:
  1846. { yyerrok; ;
  1847.     break;}
  1848. }
  1849.    /* the action file gets copied in in place of this dollarsign */
  1850.  
  1851.   yyvsp -= yylen;
  1852.   yyssp -= yylen;
  1853. #ifdef YYLSP_NEEDED
  1854.   yylsp -= yylen;
  1855. #endif
  1856.  
  1857. #if YYDEBUG != 0
  1858.   if (yydebug)
  1859.     {
  1860.       short *ssp1 = yyss - 1;
  1861.       fprintf (stderr, "state stack now");
  1862.       while (ssp1 != yyssp)
  1863.     fprintf (stderr, " %d", *++ssp1);
  1864.       fprintf (stderr, "\n");
  1865.     }
  1866. #endif
  1867.  
  1868.   *++yyvsp = yyval;
  1869.  
  1870. #ifdef YYLSP_NEEDED
  1871.   yylsp++;
  1872.   if (yylen == 0)
  1873.     {
  1874.       yylsp->first_line = yylloc.first_line;
  1875.       yylsp->first_column = yylloc.first_column;
  1876.       yylsp->last_line = (yylsp-1)->last_line;
  1877.       yylsp->last_column = (yylsp-1)->last_column;
  1878.       yylsp->text = 0;
  1879.     }
  1880.   else
  1881.     {
  1882.       yylsp->last_line = (yylsp+yylen-1)->last_line;
  1883.       yylsp->last_column = (yylsp+yylen-1)->last_column;
  1884.     }
  1885. #endif
  1886.  
  1887.   /* Now "shift" the result of the reduction.
  1888.      Determine what state that goes to,
  1889.      based on the state we popped back to
  1890.      and the rule number reduced by.  */
  1891.  
  1892.   yyn = yyr1[yyn];
  1893.  
  1894.   yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
  1895.   if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
  1896.     yystate = yytable[yystate];
  1897.   else
  1898.     yystate = yydefgoto[yyn - YYNTBASE];
  1899.  
  1900.   goto yynewstate;
  1901.  
  1902. yyerrlab:   /* here on detecting error */
  1903.  
  1904.   if (! yyerrstatus)
  1905.     /* If not already recovering from an error, report this error.  */
  1906.     {
  1907.       ++yynerrs;
  1908.  
  1909. #ifdef YYERROR_VERBOSE
  1910.       yyn = yypact[yystate];
  1911.  
  1912.       if (yyn > YYFLAG && yyn < YYLAST)
  1913.     {
  1914.       int size = 0;
  1915.       char *msg;
  1916.       int x, count;
  1917.  
  1918.       count = 0;
  1919.       for (x = 0; x < (sizeof(yytname) / sizeof(char *)); x++)
  1920.         if (yycheck[x + yyn] == x)
  1921.           size += strlen(yytname[x]) + 15, count++;
  1922.       msg = (char *) malloc(size + 15);
  1923.       if (msg != 0)
  1924.         {
  1925.           strcpy(msg, "parse error");
  1926.  
  1927.           if (count < 5)
  1928.         {
  1929.           count = 0;
  1930.           for (x = 0; x < (sizeof(yytname) / sizeof(char *)); x++)
  1931.             if (yycheck[x + yyn] == x)
  1932.               {
  1933.             strcat(msg, count == 0 ? ", expecting `" : " or `");
  1934.             strcat(msg, yytname[x]);
  1935.             strcat(msg, "'");
  1936.             count++;
  1937.               }
  1938.         }
  1939.           yyerror(msg);
  1940.           free(msg);
  1941.         }
  1942.       else
  1943.         yyerror ("parse error; also virtual memory exceeded");
  1944.     }
  1945.       else
  1946. #endif /* YYERROR_VERBOSE */
  1947.     yyerror("parse error");
  1948.     }
  1949.  
  1950. yyerrlab1:   /* here on error raised explicitly by an action */
  1951.  
  1952.   if (yyerrstatus == 3)
  1953.     {
  1954.       /* if just tried and failed to reuse lookahead token after an error, discard it.  */
  1955.  
  1956.       /* return failure if at end of input */
  1957.       if (yychar == YYEOF)
  1958.     YYABORT;
  1959.  
  1960. #if YYDEBUG != 0
  1961.       if (yydebug)
  1962.     fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);
  1963. #endif
  1964.  
  1965.       yychar = YYEMPTY;
  1966.     }
  1967.  
  1968.   /* Else will try to reuse lookahead token
  1969.      after shifting the error token.  */
  1970.  
  1971.   yyerrstatus = 3;        /* Each real token shifted decrements this */
  1972.  
  1973.   goto yyerrhandle;
  1974.  
  1975. yyerrdefault:  /* current state does not do anything special for the error token. */
  1976.  
  1977. #if 0
  1978.   /* This is wrong; only states that explicitly want error tokens
  1979.      should shift them.  */
  1980.   yyn = yydefact[yystate];  /* If its default is to accept any token, ok.  Otherwise pop it.*/
  1981.   if (yyn) goto yydefault;
  1982. #endif
  1983.  
  1984. yyerrpop:   /* pop the current state because it cannot handle the error token */
  1985.  
  1986.   if (yyssp == yyss) YYABORT;
  1987.   yyvsp--;
  1988.   yystate = *--yyssp;
  1989. #ifdef YYLSP_NEEDED
  1990.   yylsp--;
  1991. #endif
  1992.  
  1993. #if YYDEBUG != 0
  1994.   if (yydebug)
  1995.     {
  1996.       short *ssp1 = yyss - 1;
  1997.       fprintf (stderr, "Error: state stack now");
  1998.       while (ssp1 != yyssp)
  1999.     fprintf (stderr, " %d", *++ssp1);
  2000.       fprintf (stderr, "\n");
  2001.     }
  2002. #endif
  2003.  
  2004. yyerrhandle:
  2005.  
  2006.   yyn = yypact[yystate];
  2007.   if (yyn == YYFLAG)
  2008.     goto yyerrdefault;
  2009.  
  2010.   yyn += YYTERROR;
  2011.   if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
  2012.     goto yyerrdefault;
  2013.  
  2014.   yyn = yytable[yyn];
  2015.   if (yyn < 0)
  2016.     {
  2017.       if (yyn == YYFLAG)
  2018.     goto yyerrpop;
  2019.       yyn = -yyn;
  2020.       goto yyreduce;
  2021.     }
  2022.   else if (yyn == 0)
  2023.     goto yyerrpop;
  2024.  
  2025.   if (yyn == YYFINAL)
  2026.     YYACCEPT;
  2027.  
  2028. #if YYDEBUG != 0
  2029.   if (yydebug)
  2030.     fprintf(stderr, "Shifting error token, ");
  2031. #endif
  2032.  
  2033.   *++yyvsp = yylval;
  2034. #ifdef YYLSP_NEEDED
  2035.   *++yylsp = yylloc;
  2036. #endif
  2037.  
  2038.   yystate = yyn;
  2039.   goto yynewstate;
  2040. }
  2041.  
  2042.  
  2043. struct token {
  2044.     const char *operator;        /* text to match */
  2045.     NODETYPE value;        /* node type */
  2046.     int class;        /* lexical class */
  2047.     unsigned flags;        /* # of args. allowed and compatability */
  2048. #    define    ARGS    0xFF    /* 0, 1, 2, 3 args allowed (any combination */
  2049. #    define    A(n)    (1<<(n))
  2050. #    define    VERSION    0xFF00    /* old awk is zero */
  2051. #    define    NOT_OLD        0x0100    /* feature not in old awk */
  2052. #    define    NOT_POSIX    0x0200    /* feature not in POSIX */
  2053. #    define    GAWKX        0x0400    /* gawk extension */
  2054.     NODE *(*ptr) ();    /* function that implements this keyword */
  2055. };
  2056.  
  2057. extern NODE
  2058.     *do_exp(),    *do_getline(),    *do_index(),    *do_length(),
  2059.     *do_sqrt(),    *do_log(),    *do_sprintf(),    *do_substr(),
  2060.     *do_split(),    *do_system(),    *do_int(),    *do_close(),
  2061.     *do_atan2(),    *do_sin(),    *do_cos(),    *do_rand(),
  2062.     *do_srand(),    *do_match(),    *do_tolower(),    *do_toupper(),
  2063.     *do_sub(),    *do_gsub(),    *do_strftime(),    *do_systime();
  2064.  
  2065. /* Tokentab is sorted ascii ascending order, so it can be binary searched. */
  2066.  
  2067. static struct token tokentab[] = {
  2068. {"BEGIN",    Node_illegal,     LEX_BEGIN,    0,        0},
  2069. {"END",        Node_illegal,     LEX_END,    0,        0},
  2070. {"atan2",    Node_builtin,     LEX_BUILTIN,    NOT_OLD|A(2),    do_atan2},
  2071. {"break",    Node_K_break,     LEX_BREAK,    0,        0},
  2072. {"close",    Node_builtin,     LEX_BUILTIN,    NOT_OLD|A(1),    do_close},
  2073. {"continue",    Node_K_continue, LEX_CONTINUE,    0,        0},
  2074. {"cos",        Node_builtin,     LEX_BUILTIN,    NOT_OLD|A(1),    do_cos},
  2075. {"delete",    Node_K_delete,     LEX_DELETE,    NOT_OLD,    0},
  2076. {"do",        Node_K_do,     LEX_DO,    NOT_OLD,    0},
  2077. {"else",    Node_illegal,     LEX_ELSE,    0,        0},
  2078. {"exit",    Node_K_exit,     LEX_EXIT,    0,        0},
  2079. {"exp",        Node_builtin,     LEX_BUILTIN,    A(1),        do_exp},
  2080. {"for",        Node_K_for,     LEX_FOR,    0,        0},
  2081. {"func",    Node_K_function, LEX_FUNCTION,    NOT_POSIX|NOT_OLD,    0},
  2082. {"function",    Node_K_function, LEX_FUNCTION,    NOT_OLD,    0},
  2083. {"getline",    Node_K_getline,     LEX_GETLINE,    NOT_OLD,    0},
  2084. {"gsub",    Node_builtin,     LEX_BUILTIN,    NOT_OLD|A(2)|A(3), do_gsub},
  2085. {"if",        Node_K_if,     LEX_IF,    0,        0},
  2086. {"in",        Node_illegal,     LEX_IN,    0,        0},
  2087. {"index",    Node_builtin,     LEX_BUILTIN,    A(2),        do_index},
  2088. {"int",        Node_builtin,     LEX_BUILTIN,    A(1),        do_int},
  2089. {"length",    Node_builtin,     LEX_LENGTH,    A(0)|A(1),    do_length},
  2090. {"log",        Node_builtin,     LEX_BUILTIN,    A(1),        do_log},
  2091. {"match",    Node_builtin,     LEX_BUILTIN,    NOT_OLD|A(2),    do_match},
  2092. {"next",    Node_K_next,     LEX_NEXT,    0,        0},
  2093. {"print",    Node_K_print,     LEX_PRINT,    0,        0},
  2094. {"printf",    Node_K_printf,     LEX_PRINTF,    0,        0},
  2095. {"rand",    Node_builtin,     LEX_BUILTIN,    NOT_OLD|A(0),    do_rand},
  2096. {"return",    Node_K_return,     LEX_RETURN,    NOT_OLD,    0},
  2097. {"sin",        Node_builtin,     LEX_BUILTIN,    NOT_OLD|A(1),    do_sin},
  2098. {"split",    Node_builtin,     LEX_BUILTIN,    A(2)|A(3),    do_split},
  2099. {"sprintf",    Node_builtin,     LEX_BUILTIN,    0,        do_sprintf},
  2100. {"sqrt",    Node_builtin,     LEX_BUILTIN,    A(1),        do_sqrt},
  2101. {"srand",    Node_builtin,     LEX_BUILTIN,    NOT_OLD|A(0)|A(1), do_srand},
  2102. {"strftime",    Node_builtin,     LEX_BUILTIN,    GAWKX|A(1)|A(2), do_strftime},
  2103. {"sub",        Node_builtin,     LEX_BUILTIN,    NOT_OLD|A(2)|A(3), do_sub},
  2104. {"substr",    Node_builtin,     LEX_BUILTIN,    A(2)|A(3),    do_substr},
  2105. {"system",    Node_builtin,     LEX_BUILTIN,    NOT_OLD|A(1),    do_system},
  2106. {"systime",    Node_builtin,     LEX_BUILTIN,    GAWKX|A(0),    do_systime},
  2107. {"tolower",    Node_builtin,     LEX_BUILTIN,    NOT_OLD|A(1),    do_tolower},
  2108. {"toupper",    Node_builtin,     LEX_BUILTIN,    NOT_OLD|A(1),    do_toupper},
  2109. {"while",    Node_K_while,     LEX_WHILE,    0,        0},
  2110. };
  2111.  
  2112. static void
  2113. yyerror(va_alist)
  2114. va_dcl
  2115. {
  2116.     va_list args;
  2117.     const char *mesg = NULL;
  2118.     register char *bp, *cp;
  2119.     char *scan;
  2120.     char buf[120];
  2121.     static char end_of_file_line[] = "(END OF FILE)";
  2122.  
  2123.     errcount++;
  2124.     /* Find the current line in the input file */
  2125.     if (lexptr) {
  2126.         if (!thisline) {
  2127.             cp = lexeme;
  2128.             if (*cp == '\n') {
  2129.                 cp--;
  2130.                 mesg = "unexpected newline";
  2131.             }
  2132.             for ( ; cp != lexptr_begin && *cp != '\n'; --cp)
  2133.                 ;
  2134.             if (*cp == '\n')
  2135.                 cp++;
  2136.             thisline = cp;
  2137.         }
  2138.         /* NL isn't guaranteed */
  2139.         bp = lexeme;
  2140.         while (bp < lexend && *bp && *bp != '\n')
  2141.             bp++;
  2142.     } else {
  2143.         thisline = end_of_file_line;
  2144.         bp = thisline + strlen(thisline);
  2145.     }
  2146.     msg("%.*s", (int) (bp - thisline), thisline);
  2147.     bp = buf;
  2148.     cp = buf + sizeof(buf) - 24;    /* 24 more than longest msg. input */
  2149.     if (lexptr) {
  2150.         scan = thisline;
  2151.         while (bp < cp && scan < lexeme)
  2152.             if (*scan++ == '\t')
  2153.                 *bp++ = '\t';
  2154.             else
  2155.                 *bp++ = ' ';
  2156.         *bp++ = '^';
  2157.         *bp++ = ' ';
  2158.     }
  2159.     va_start(args);
  2160.     if (mesg == NULL)
  2161.         mesg = va_arg(args, char *);
  2162.     strcpy(bp, mesg);
  2163.     err("", buf, args);
  2164.     va_end(args);
  2165.     exit(2);
  2166. }
  2167.  
  2168. static char *
  2169. get_src_buf()
  2170. {
  2171.     static int samefile = 0;
  2172.     static int nextfile = 0;
  2173.     static char *buf = NULL;
  2174.     static int fd;
  2175.     int n;
  2176.     register char *scan;
  2177.     static int len = 0;
  2178.     static int did_newline = 0;
  2179. #    define    SLOP    128    /* enough space to hold most source lines */
  2180.  
  2181.     if (nextfile > numfiles)
  2182.         return NULL;
  2183.  
  2184.     if (srcfiles[nextfile].stype == CMDLINE) {
  2185.         if (len == 0) {
  2186.             len = strlen(srcfiles[nextfile].val);
  2187.             sourceline = 1;
  2188.             lexptr = lexptr_begin = srcfiles[nextfile].val;
  2189.             lexend = lexptr + len;
  2190.         } else if (!did_newline && *(lexptr-1) != '\n') {
  2191.             /*
  2192.              * The following goop is to ensure that the source
  2193.              * ends with a newline and that the entire current
  2194.              * line is available for error messages.
  2195.              */
  2196.             int offset;
  2197.  
  2198.             did_newline = 1;
  2199.             offset = lexptr - lexeme;
  2200.             for (scan = lexeme; scan > lexptr_begin; scan--)
  2201.                 if (*scan == '\n') {
  2202.                     scan++;
  2203.                     break;
  2204.                 }
  2205.             len = lexptr - scan;
  2206.             emalloc(buf, char *, len+1, "get_src_buf");
  2207.             memcpy(buf, scan, len);
  2208.             thisline = buf;
  2209.             lexptr = buf + len;
  2210.             *lexptr = '\n';
  2211.             lexeme = lexptr - offset;
  2212.             lexptr_begin = buf;
  2213.             lexend = lexptr + 1;
  2214.         } else {
  2215.             len = 0;
  2216.             lexeme = lexptr = lexptr_begin = NULL;
  2217.         }
  2218.         if (lexptr == NULL && ++nextfile <= numfiles)
  2219.             return get_src_buf();
  2220.         return lexptr;
  2221.     }
  2222.     if (!samefile) {
  2223.         source = srcfiles[nextfile].val;
  2224.         if (source == NULL) {
  2225.             if (buf) {
  2226.                 free(buf);
  2227.                 buf = NULL;
  2228.             }
  2229.             len = 0;
  2230.             return lexeme = lexptr = lexptr_begin = NULL;
  2231.         }
  2232.         fd = pathopen(source);
  2233.         if (fd == -1)
  2234.             fatal("can't open source file \"%s\" for reading (%s)",
  2235.                 source, strerror(errno));
  2236.         len = optimal_bufsize(fd);
  2237.         if (buf)
  2238.             free(buf);
  2239.         emalloc(buf, char *, len + SLOP, "get_src_buf");
  2240.         lexptr_begin = buf + SLOP;
  2241.         samefile = 1;
  2242.         sourceline = 1;
  2243.     } else {
  2244.         /*
  2245.          * Here, we retain the current source line (up to length SLOP)
  2246.          * in the beginning of the buffer that was overallocated above
  2247.          */
  2248.         int offset;
  2249.         int linelen;
  2250.  
  2251.         offset = lexptr - lexeme;
  2252.         for (scan = lexeme; scan > lexptr_begin; scan--)
  2253.             if (*scan == '\n') {
  2254.                 scan++;
  2255.                 break;
  2256.             }
  2257.         linelen = lexptr - scan;
  2258.         if (linelen > SLOP)
  2259.             linelen = SLOP;
  2260.         thisline = buf + SLOP - linelen;
  2261.         memcpy(thisline, scan, linelen);
  2262.         lexeme = buf + SLOP - offset;
  2263.         lexptr_begin = thisline;
  2264.     }
  2265.     n = read(fd, buf + SLOP, len);
  2266.     if (n == -1)
  2267.         fatal("can't read sourcefile \"%s\" (%s)",
  2268.             source, strerror(errno));
  2269.     if (n == 0) {
  2270.         samefile = 0;
  2271.         nextfile++;
  2272.         len = 0;
  2273.         return get_src_buf();
  2274.     }
  2275.     lexptr = buf + SLOP;
  2276.     lexend = lexptr + n;
  2277.     return buf;
  2278. }
  2279.  
  2280. #define    tokadd(x) (*tok++ = (x), tok == tokend ? tokexpand() : tok)
  2281.  
  2282. char *
  2283. tokexpand()
  2284. {
  2285.     static int toksize = 60;
  2286.     int tokoffset;
  2287.  
  2288.     tokoffset = tok - tokstart;
  2289.     toksize *= 2;
  2290.     if (tokstart)
  2291.         erealloc(tokstart, char *, toksize, "tokexpand");
  2292.     else
  2293.         emalloc(tokstart, char *, toksize, "tokexpand");
  2294.     tokend = tokstart + toksize;
  2295.     tok = tokstart + tokoffset;
  2296.     return tok;
  2297. }
  2298.  
  2299. #if DEBUG
  2300. char
  2301. nextc() {
  2302.     if (lexptr && lexptr < lexend)
  2303.         return *lexptr++;
  2304.     else if (get_src_buf())
  2305.         return *lexptr++;
  2306.     else
  2307.         return '\0';
  2308. }
  2309. #else
  2310. #define    nextc()    ((lexptr && lexptr < lexend) ? \
  2311.             *lexptr++ : \
  2312.             (get_src_buf() ? *lexptr++ : '\0') \
  2313.         )
  2314. #endif
  2315. #define pushback() (lexptr && lexptr > lexptr_begin ? lexptr-- : lexptr)
  2316.  
  2317. /*
  2318.  * Read the input and turn it into tokens.
  2319.  */
  2320.  
  2321. static int
  2322. yylex()
  2323. {
  2324.     register int c;
  2325.     int seen_e = 0;        /* These are for numbers */
  2326.     int seen_point = 0;
  2327.     int esc_seen;        /* for literal strings */
  2328.     int low, mid, high;
  2329.     static int did_newline = 0;
  2330.     char *tokkey;
  2331.  
  2332.     if (!nextc())
  2333.         return 0;
  2334.     pushback();
  2335. #ifdef OS2
  2336.     /*
  2337.      * added for OS/2's extproc feature of cmd.exe
  2338.      * (like #! in BSD sh)
  2339.      */
  2340.     if (strncasecmp(lexptr, "extproc ", 8) == 0) {
  2341.         while (*lexptr && *lexptr != '\n')
  2342.             lexptr++;
  2343.     }
  2344. #endif
  2345.     lexeme = lexptr;
  2346.     thisline = NULL;
  2347.     if (want_regexp) {
  2348.         int in_brack = 0;
  2349.  
  2350.         want_regexp = 0;
  2351.         tok = tokstart;
  2352.         while ((c = nextc()) != 0) {
  2353.             switch (c) {
  2354.             case '[':
  2355.                 in_brack = 1;
  2356.                 break;
  2357.             case ']':
  2358.                 in_brack = 0;
  2359.                 break;
  2360.             case '\\':
  2361.                 if ((c = nextc()) == '\0') {
  2362.                     yyerror("unterminated regexp ends with \\ at end of file");
  2363.                 } else if (c == '\n') {
  2364.                     sourceline++;
  2365.                     continue;
  2366.                 } else
  2367.                     tokadd('\\');
  2368.                 break;
  2369.             case '/':    /* end of the regexp */
  2370.                 if (in_brack)
  2371.                     break;
  2372.  
  2373.                 pushback();
  2374.                 tokadd('\0');
  2375.                 yylval.sval = tokstart;
  2376.                 return REGEXP;
  2377.             case '\n':
  2378.                 pushback();
  2379.                 yyerror("unterminated regexp");
  2380.             case '\0':
  2381.                 yyerror("unterminated regexp at end of file");
  2382.             }
  2383.             tokadd(c);
  2384.         }
  2385.     }
  2386. retry:
  2387.     while ((c = nextc()) == ' ' || c == '\t')
  2388.         ;
  2389.  
  2390.     lexeme = lexptr ? lexptr - 1 : lexptr;
  2391.     thisline = NULL;
  2392.     tok = tokstart;
  2393.     yylval.nodetypeval = Node_illegal;
  2394.  
  2395.     switch (c) {
  2396.     case 0:
  2397.         return 0;
  2398.  
  2399.     case '\n':
  2400.         sourceline++;
  2401.         return NEWLINE;
  2402.  
  2403.     case '#':        /* it's a comment */
  2404.         while ((c = nextc()) != '\n') {
  2405.             if (c == '\0')
  2406.                 return 0;
  2407.         }
  2408.         sourceline++;
  2409.         return NEWLINE;
  2410.  
  2411.     case '\\':
  2412. #ifdef RELAXED_CONTINUATION
  2413.         /*
  2414.          * This code puports to allow comments and/or whitespace
  2415.          * after the `\' at the end of a line used for continuation.
  2416.          * Use it at your own risk. We think it's a bad idea, which
  2417.          * is why it's not on by default.
  2418.          */
  2419.         if (!do_unix) {
  2420.             /* strip trailing white-space and/or comment */
  2421.             while ((c = nextc()) == ' ' || c == '\t')
  2422.                 continue;
  2423.             if (c == '#')
  2424.                 while ((c = nextc()) != '\n')
  2425.                     if (c == '\0')
  2426.                         break;
  2427.             pushback();
  2428.         }
  2429. #endif /* RELAXED_CONTINUATION */
  2430.         if (nextc() == '\n') {
  2431.             sourceline++;
  2432.             goto retry;
  2433.         } else
  2434.             yyerror("backslash not last character on line");
  2435.         break;
  2436.  
  2437.     case '$':
  2438.         want_assign = 1;
  2439.         return '$';
  2440.  
  2441.     case ')':
  2442.     case ']':
  2443.     case '(':    
  2444.     case '[':
  2445.     case ';':
  2446.     case ':':
  2447.     case '?':
  2448.     case '{':
  2449.     case ',':
  2450.         return c;
  2451.  
  2452.     case '*':
  2453.         if ((c = nextc()) == '=') {
  2454.             yylval.nodetypeval = Node_assign_times;
  2455.             return ASSIGNOP;
  2456.         } else if (do_posix) {
  2457.             pushback();
  2458.             return '*';
  2459.         } else if (c == '*') {
  2460.             /* make ** and **= aliases for ^ and ^= */
  2461.             static int did_warn_op = 0, did_warn_assgn = 0;
  2462.  
  2463.             if (nextc() == '=') {
  2464.                 if (do_lint && ! did_warn_assgn) {
  2465.                     did_warn_assgn = 1;
  2466.                     warning("**= is not allowed by POSIX");
  2467.                 }
  2468.                 yylval.nodetypeval = Node_assign_exp;
  2469.                 return ASSIGNOP;
  2470.             } else {
  2471.                 pushback();
  2472.                 if (do_lint && ! did_warn_op) {
  2473.                     did_warn_op = 1;
  2474.                     warning("** is not allowed by POSIX");
  2475.                 }
  2476.                 return '^';
  2477.             }
  2478.         }
  2479.         pushback();
  2480.         return '*';
  2481.  
  2482.     case '/':
  2483.         if (want_assign) {
  2484.             if (nextc() == '=') {
  2485.                 yylval.nodetypeval = Node_assign_quotient;
  2486.                 return ASSIGNOP;
  2487.             }
  2488.             pushback();
  2489.         }
  2490.         return '/';
  2491.  
  2492.     case '%':
  2493.         if (nextc() == '=') {
  2494.             yylval.nodetypeval = Node_assign_mod;
  2495.             return ASSIGNOP;
  2496.         }
  2497.         pushback();
  2498.         return '%';
  2499.  
  2500.     case '^':
  2501.     {
  2502.         static int did_warn_op = 0, did_warn_assgn = 0;
  2503.  
  2504.         if (nextc() == '=') {
  2505.  
  2506.             if (do_lint && ! did_warn_assgn) {
  2507.                 did_warn_assgn = 1;
  2508.                 warning("operator `^=' is not supported in old awk");
  2509.             }
  2510.             yylval.nodetypeval = Node_assign_exp;
  2511.             return ASSIGNOP;
  2512.         }
  2513.         pushback();
  2514.         if (do_lint && ! did_warn_op) {
  2515.             did_warn_op = 1;
  2516.             warning("operator `^' is not supported in old awk");
  2517.         }
  2518.         return '^';
  2519.     }
  2520.  
  2521.     case '+':
  2522.         if ((c = nextc()) == '=') {
  2523.             yylval.nodetypeval = Node_assign_plus;
  2524.             return ASSIGNOP;
  2525.         }
  2526.         if (c == '+')
  2527.             return INCREMENT;
  2528.         pushback();
  2529.         return '+';
  2530.  
  2531.     case '!':
  2532.         if ((c = nextc()) == '=') {
  2533.             yylval.nodetypeval = Node_notequal;
  2534.             return RELOP;
  2535.         }
  2536.         if (c == '~') {
  2537.             yylval.nodetypeval = Node_nomatch;
  2538.             want_assign = 0;
  2539.             return MATCHOP;
  2540.         }
  2541.         pushback();
  2542.         return '!';
  2543.  
  2544.     case '<':
  2545.         if (nextc() == '=') {
  2546.             yylval.nodetypeval = Node_leq;
  2547.             return RELOP;
  2548.         }
  2549.         yylval.nodetypeval = Node_less;
  2550.         pushback();
  2551.         return '<';
  2552.  
  2553.     case '=':
  2554.         if (nextc() == '=') {
  2555.             yylval.nodetypeval = Node_equal;
  2556.             return RELOP;
  2557.         }
  2558.         yylval.nodetypeval = Node_assign;
  2559.         pushback();
  2560.         return ASSIGNOP;
  2561.  
  2562.     case '>':
  2563.         if ((c = nextc()) == '=') {
  2564.             yylval.nodetypeval = Node_geq;
  2565.             return RELOP;
  2566.         } else if (c == '>') {
  2567.             yylval.nodetypeval = Node_redirect_append;
  2568.             return APPEND_OP;
  2569.         }
  2570.         yylval.nodetypeval = Node_greater;
  2571.         pushback();
  2572.         return '>';
  2573.  
  2574.     case '~':
  2575.         yylval.nodetypeval = Node_match;
  2576.         want_assign = 0;
  2577.         return MATCHOP;
  2578.  
  2579.     case '}':
  2580.         /*
  2581.          * Added did newline stuff.  Easier than
  2582.          * hacking the grammar
  2583.          */
  2584.         if (did_newline) {
  2585.             did_newline = 0;
  2586.             return c;
  2587.         }
  2588.         did_newline++;
  2589.         --lexptr;    /* pick up } next time */
  2590.         return NEWLINE;
  2591.  
  2592.     case '"':
  2593.         esc_seen = 0;
  2594.         while ((c = nextc()) != '"') {
  2595.             if (c == '\n') {
  2596.                 pushback();
  2597.                 yyerror("unterminated string");
  2598.             }
  2599.             if (c == '\\') {
  2600.                 c = nextc();
  2601.                 if (c == '\n') {
  2602.                     sourceline++;
  2603.                     continue;
  2604.                 }
  2605.                 esc_seen = 1;
  2606.                 tokadd('\\');
  2607.             }
  2608.             if (c == '\0') {
  2609.                 pushback();
  2610.                 yyerror("unterminated string");
  2611.             }
  2612.             tokadd(c);
  2613.         }
  2614.         yylval.nodeval = make_str_node(tokstart,
  2615.                     tok - tokstart, esc_seen ? SCAN : 0);
  2616.         yylval.nodeval->flags |= PERM;
  2617.         return YSTRING;
  2618.  
  2619.     case '-':
  2620.         if ((c = nextc()) == '=') {
  2621.             yylval.nodetypeval = Node_assign_minus;
  2622.             return ASSIGNOP;
  2623.         }
  2624.         if (c == '-')
  2625.             return DECREMENT;
  2626.         pushback();
  2627.         return '-';
  2628.  
  2629.     case '.':
  2630.         c = nextc();
  2631.         pushback();
  2632.         if (!isdigit(c))
  2633.             return '.';
  2634.         else
  2635.             c = '.';    /* FALL THROUGH */
  2636.     case '0':
  2637.     case '1':
  2638.     case '2':
  2639.     case '3':
  2640.     case '4':
  2641.     case '5':
  2642.     case '6':
  2643.     case '7':
  2644.     case '8':
  2645.     case '9':
  2646.         /* It's a number */
  2647.         for (;;) {
  2648.             int gotnumber = 0;
  2649.  
  2650.             tokadd(c);
  2651.             switch (c) {
  2652.             case '.':
  2653.                 if (seen_point) {
  2654.                     gotnumber++;
  2655.                     break;
  2656.                 }
  2657.                 ++seen_point;
  2658.                 break;
  2659.             case 'e':
  2660.             case 'E':
  2661.                 if (seen_e) {
  2662.                     gotnumber++;
  2663.                     break;
  2664.                 }
  2665.                 ++seen_e;
  2666.                 if ((c = nextc()) == '-' || c == '+')
  2667.                     tokadd(c);
  2668.                 else
  2669.                     pushback();
  2670.                 break;
  2671.             case '0':
  2672.             case '1':
  2673.             case '2':
  2674.             case '3':
  2675.             case '4':
  2676.             case '5':
  2677.             case '6':
  2678.             case '7':
  2679.             case '8':
  2680.             case '9':
  2681.                 break;
  2682.             default:
  2683.                 gotnumber++;
  2684.             }
  2685.             if (gotnumber)
  2686.                 break;
  2687.             c = nextc();
  2688.         }
  2689.         pushback();
  2690.         yylval.nodeval = make_number(atof(tokstart));
  2691.         yylval.nodeval->flags |= PERM;
  2692.         return YNUMBER;
  2693.  
  2694.     case '&':
  2695.         if ((c = nextc()) == '&') {
  2696.             yylval.nodetypeval = Node_and;
  2697.             for (;;) {
  2698.                 c = nextc();
  2699.                 if (c == '\0')
  2700.                     break;
  2701.                 if (c == '#') {
  2702.                     while ((c = nextc()) != '\n' && c != '\0')
  2703.                         ;
  2704.                     if (c == '\0')
  2705.                         break;
  2706.                 }
  2707.                 if (c == '\n')
  2708.                     sourceline++;
  2709.                 if (! isspace(c)) {
  2710.                     pushback();
  2711.                     break;
  2712.                 }
  2713.             }
  2714.             want_assign = 0;
  2715.             return LEX_AND;
  2716.         }
  2717.         pushback();
  2718.         return '&';
  2719.  
  2720.     case '|':
  2721.         if ((c = nextc()) == '|') {
  2722.             yylval.nodetypeval = Node_or;
  2723.             for (;;) {
  2724.                 c = nextc();
  2725.                 if (c == '\0')
  2726.                     break;
  2727.                 if (c == '#') {
  2728.                     while ((c = nextc()) != '\n' && c != '\0')
  2729.                         ;
  2730.                     if (c == '\0')
  2731.                         break;
  2732.                 }
  2733.                 if (c == '\n')
  2734.                     sourceline++;
  2735.                 if (! isspace(c)) {
  2736.                     pushback();
  2737.                     break;
  2738.                 }
  2739.             }
  2740.             want_assign = 0;
  2741.             return LEX_OR;
  2742.         }
  2743.         pushback();
  2744.         return '|';
  2745.     }
  2746.  
  2747.     if (c != '_' && ! isalpha(c))
  2748.         yyerror("Invalid char '%c' in expression\n", c);
  2749.  
  2750.     /* it's some type of name-type-thing.  Find its length */
  2751.     tok = tokstart;
  2752.     while (is_identchar(c)) {
  2753.         tokadd(c);
  2754.         c = nextc();
  2755.     }
  2756.     tokadd('\0');
  2757.     emalloc(tokkey, char *, tok - tokstart, "yylex");
  2758.     memcpy(tokkey, tokstart, tok - tokstart);
  2759.     pushback();
  2760.  
  2761.     /* See if it is a special token.  */
  2762.     low = 0;
  2763.     high = (sizeof (tokentab) / sizeof (tokentab[0])) - 1;
  2764.     while (low <= high) {
  2765.         int i/* , c */;
  2766.  
  2767.         mid = (low + high) / 2;
  2768.         c = *tokstart - tokentab[mid].operator[0];
  2769.         i = c ? c : strcmp (tokstart, tokentab[mid].operator);
  2770.  
  2771.         if (i < 0) {        /* token < mid */
  2772.             high = mid - 1;
  2773.         } else if (i > 0) {    /* token > mid */
  2774.             low = mid + 1;
  2775.         } else {
  2776.             if (do_lint) {
  2777.                 if (tokentab[mid].flags & GAWKX)
  2778.                     warning("%s() is a gawk extension",
  2779.                         tokentab[mid].operator);
  2780.                 if (tokentab[mid].flags & NOT_POSIX)
  2781.                     warning("POSIX does not allow %s",
  2782.                         tokentab[mid].operator);
  2783.                 if (tokentab[mid].flags & NOT_OLD)
  2784.                     warning("%s is not supported in old awk",
  2785.                         tokentab[mid].operator);
  2786.             }
  2787.             if ((do_unix && (tokentab[mid].flags & GAWKX))
  2788.                 || (do_posix && (tokentab[mid].flags & NOT_POSIX)))
  2789.                 break;
  2790.             if (tokentab[mid].class == LEX_BUILTIN
  2791.                 || tokentab[mid].class == LEX_LENGTH
  2792.                )
  2793.                 yylval.lval = mid;
  2794.             else
  2795.                 yylval.nodetypeval = tokentab[mid].value;
  2796.  
  2797.             return tokentab[mid].class;
  2798.         }
  2799.     }
  2800.  
  2801.     yylval.sval = tokkey;
  2802.     if (*lexptr == '(')
  2803.         return FUNC_CALL;
  2804.     else {
  2805.         want_assign = 1;
  2806.         return NAME;
  2807.     }
  2808. }
  2809.  
  2810. static NODE *
  2811. node_common(op)
  2812. NODETYPE op;
  2813. {
  2814.     register NODE *r;
  2815.  
  2816.     getnode(r);
  2817.     r->type = op;
  2818.     r->flags = MALLOC;
  2819.     /* if lookahead is NL, lineno is 1 too high */
  2820.     if (lexeme && *lexeme == '\n')
  2821.         r->source_line = sourceline - 1;
  2822.     else
  2823.         r->source_line = sourceline;
  2824.     r->source_file = source;
  2825.     return r;
  2826. }
  2827.  
  2828. /*
  2829.  * This allocates a node with defined lnode and rnode. 
  2830.  */
  2831. NODE *
  2832. node(left, op, right)
  2833. NODE *left, *right;
  2834. NODETYPE op;
  2835. {
  2836.     register NODE *r;
  2837.  
  2838.     r = node_common(op);
  2839.     r->lnode = left;
  2840.     r->rnode = right;
  2841.     return r;
  2842. }
  2843.  
  2844. /*
  2845.  * This allocates a node with defined subnode and proc for builtin functions
  2846.  * Checks for arg. count and supplies defaults where possible.
  2847.  */
  2848. static NODE *
  2849. snode(subn, op, idx)
  2850. NODETYPE op;
  2851. int idx;
  2852. NODE *subn;
  2853. {
  2854.     register NODE *r;
  2855.     register NODE *n;
  2856.     int nexp = 0;
  2857.     int args_allowed;
  2858.  
  2859.     r = node_common(op);
  2860.  
  2861.     /* traverse expression list to see how many args. given */
  2862.     for (n= subn; n; n= n->rnode) {
  2863.         nexp++;
  2864.         if (nexp > 3)
  2865.             break;
  2866.     }
  2867.  
  2868.     /* check against how many args. are allowed for this builtin */
  2869.     args_allowed = tokentab[idx].flags & ARGS;
  2870.     if (args_allowed && !(args_allowed & A(nexp)))
  2871.         fatal("%s() cannot have %d argument%c",
  2872.             tokentab[idx].operator, nexp, nexp == 1 ? ' ' : 's');
  2873.  
  2874.     r->proc = tokentab[idx].ptr;
  2875.  
  2876.     /* special case processing for a few builtins */
  2877.     if (nexp == 0 && r->proc == do_length) {
  2878.         subn = node(node(make_number(0.0),Node_field_spec,(NODE *)NULL),
  2879.                     Node_expression_list,
  2880.                 (NODE *) NULL);
  2881.     } else if (r->proc == do_match) {
  2882.         if (subn->rnode->lnode->type != Node_regex)
  2883.             subn->rnode->lnode = mk_rexp(subn->rnode->lnode);
  2884.     } else if (r->proc == do_sub || r->proc == do_gsub) {
  2885.         if (subn->lnode->type != Node_regex)
  2886.             subn->lnode = mk_rexp(subn->lnode);
  2887.         if (nexp == 2)
  2888.             append_right(subn, node(node(make_number(0.0),
  2889.                              Node_field_spec,
  2890.                              (NODE *) NULL),
  2891.                             Node_expression_list,
  2892.                         (NODE *) NULL));
  2893.         else if (do_lint && subn->rnode->rnode->lnode->type == Node_val)
  2894.             warning("string literal as last arg of substitute");
  2895.     } else if (r->proc == do_split) {
  2896.         if (nexp == 2)
  2897.             append_right(subn,
  2898.                 node(FS_node, Node_expression_list, (NODE *) NULL));
  2899.         n = subn->rnode->rnode->lnode;
  2900.         if (n->type != Node_regex)
  2901.             subn->rnode->rnode->lnode = mk_rexp(n);
  2902.         if (nexp == 2)
  2903.             subn->rnode->rnode->lnode->re_flags |= FS_DFLT;
  2904.     }
  2905.  
  2906.     r->subnode = subn;
  2907.     return r;
  2908. }
  2909.  
  2910. /*
  2911.  * This allocates a Node_line_range node with defined condpair and
  2912.  * zeroes the trigger word to avoid the temptation of assuming that calling
  2913.  * 'node( foo, Node_line_range, 0)' will properly initialize 'triggered'. 
  2914.  */
  2915. /* Otherwise like node() */
  2916. static NODE *
  2917. mkrangenode(cpair)
  2918. NODE *cpair;
  2919. {
  2920.     register NODE *r;
  2921.  
  2922.     getnode(r);
  2923.     r->type = Node_line_range;
  2924.     r->condpair = cpair;
  2925.     r->triggered = 0;
  2926.     return r;
  2927. }
  2928.  
  2929. /* Build a for loop */
  2930. static NODE *
  2931. make_for_loop(init, cond, incr)
  2932. NODE *init, *cond, *incr;
  2933. {
  2934.     register FOR_LOOP_HEADER *r;
  2935.     NODE *n;
  2936.  
  2937.     emalloc(r, FOR_LOOP_HEADER *, sizeof(FOR_LOOP_HEADER), "make_for_loop");
  2938.     getnode(n);
  2939.     n->type = Node_illegal;
  2940.     r->init = init;
  2941.     r->cond = cond;
  2942.     r->incr = incr;
  2943.     n->sub.nodep.r.hd = r;
  2944.     return n;
  2945. }
  2946.  
  2947. /*
  2948.  * Install a name in the symbol table, even if it is already there.
  2949.  * Caller must check against redefinition if that is desired. 
  2950.  */
  2951. NODE *
  2952. install(name, value)
  2953. char *name;
  2954. NODE *value;
  2955. {
  2956.     register NODE *hp;
  2957.     register size_t len;
  2958.     register int bucket;
  2959.  
  2960.     len = strlen(name);
  2961.     bucket = hash(name, len, (unsigned long) HASHSIZE);
  2962.     getnode(hp);
  2963.     hp->type = Node_hashnode;
  2964.     hp->hnext = variables[bucket];
  2965.     variables[bucket] = hp;
  2966.     hp->hlength = len;
  2967.     hp->hvalue = value;
  2968.     hp->hname = name;
  2969.     hp->hvalue->vname = name;
  2970.     return hp->hvalue;
  2971. }
  2972.  
  2973. /* find the most recent hash node for name installed by install */
  2974. NODE *
  2975. lookup(name)
  2976. const char *name;
  2977. {
  2978.     register NODE *bucket;
  2979.     register size_t len;
  2980.  
  2981.     len = strlen(name);
  2982.     bucket = variables[hash(name, len, (unsigned long) HASHSIZE)];
  2983.     while (bucket) {
  2984.         if (bucket->hlength == len && STREQN(bucket->hname, name, len))
  2985.             return bucket->hvalue;
  2986.         bucket = bucket->hnext;
  2987.     }
  2988.     return NULL;
  2989. }
  2990.  
  2991. /*
  2992.  * Add new to the rightmost branch of LIST.  This uses n^2 time, so we make
  2993.  * a simple attempt at optimizing it.
  2994.  */
  2995. static NODE *
  2996. append_right(list, new)
  2997. NODE *list, *new;
  2998. {
  2999.     register NODE *oldlist;
  3000.     static NODE *savefront = NULL, *savetail = NULL;
  3001.  
  3002.     oldlist = list;
  3003.     if (savefront == oldlist) {
  3004.         savetail = savetail->rnode = new;
  3005.         return oldlist;
  3006.     } else
  3007.         savefront = oldlist;
  3008.     while (list->rnode != NULL)
  3009.         list = list->rnode;
  3010.     savetail = list->rnode = new;
  3011.     return oldlist;
  3012. }
  3013.  
  3014. /*
  3015.  * check if name is already installed;  if so, it had better have Null value,
  3016.  * in which case def is added as the value. Otherwise, install name with def
  3017.  * as value. 
  3018.  */
  3019. static void
  3020. func_install(params, def)
  3021. NODE *params;
  3022. NODE *def;
  3023. {
  3024.     NODE *r;
  3025.  
  3026.     pop_params(params->rnode);
  3027.     pop_var(params, 0);
  3028.     r = lookup(params->param);
  3029.     if (r != NULL) {
  3030.         fatal("function name `%s' previously defined", params->param);
  3031.     } else
  3032.         (void) install(params->param, node(params, Node_func, def));
  3033. }
  3034.  
  3035. static void
  3036. pop_var(np, freeit)
  3037. NODE *np;
  3038. int freeit;
  3039. {
  3040.     register NODE *bucket, **save;
  3041.     register size_t len;
  3042.     char *name;
  3043.  
  3044.     name = np->param;
  3045.     len = strlen(name);
  3046.     save = &(variables[hash(name, len, (unsigned long) HASHSIZE)]);
  3047.     for (bucket = *save; bucket; bucket = bucket->hnext) {
  3048.         if (len == bucket->hlength && STREQN(bucket->hname, name, len)) {
  3049.             *save = bucket->hnext;
  3050.             freenode(bucket);
  3051.             if (freeit)
  3052.                 free(np->param);
  3053.             return;
  3054.         }
  3055.         save = &(bucket->hnext);
  3056.     }
  3057. }
  3058.  
  3059. static void
  3060. pop_params(params)
  3061. NODE *params;
  3062. {
  3063.     register NODE *np;
  3064.  
  3065.     for (np = params; np != NULL; np = np->rnode)
  3066.         pop_var(np, 1);
  3067. }
  3068.  
  3069. static NODE *
  3070. make_param(name)
  3071. char *name;
  3072. {
  3073.     NODE *r;
  3074.  
  3075.     getnode(r);
  3076.     r->type = Node_param_list;
  3077.     r->rnode = NULL;
  3078.     r->param = name;
  3079.     r->param_cnt = param_counter++;
  3080.     return (install(name, r));
  3081. }
  3082.  
  3083. /* Name points to a variable name.  Make sure its in the symbol table */
  3084. NODE *
  3085. variable(name, can_free)
  3086. char *name;
  3087. int can_free;
  3088. {
  3089.     register NODE *r;
  3090.     static int env_loaded = 0;
  3091.  
  3092.     if (!env_loaded && STREQ(name, "ENVIRON")) {
  3093.         load_environ();
  3094.         env_loaded = 1;
  3095.     }
  3096.     if ((r = lookup(name)) == NULL)
  3097.         r = install(name, node(Nnull_string, Node_var, (NODE *) NULL));
  3098.     else if (can_free)
  3099.         free(name);
  3100.     return r;
  3101. }
  3102.  
  3103. static NODE *
  3104. mk_rexp(exp)
  3105. NODE *exp;
  3106. {
  3107.     if (exp->type == Node_regex)
  3108.         return exp;
  3109.     else {
  3110.         NODE *n;
  3111.  
  3112.         getnode(n);
  3113.         n->type = Node_regex;
  3114.         n->re_exp = exp;
  3115.         n->re_text = NULL;
  3116.         n->re_reg = NULL;
  3117.         n->re_flags = 0;
  3118.         n->re_cnt = 1;
  3119.         return n;
  3120.     }
  3121. }
  3122.