home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / intercal.zip / src / ick.c < prev    next >
C/C++ Source or Header  |  1996-09-03  |  42KB  |  1,361 lines

  1.  
  2. /*  A Bison parser, made from ick.y with Bison version GNU Bison version 1.22
  3.   */
  4.  
  5. #define YYBISON 1  /* Identify Bison output.  */
  6.  
  7. #define    GETS    258
  8. #define    RESIZE    259
  9. #define    NEXT    260
  10. #define    FORGET    261
  11. #define    RESUME    262
  12. #define    STASH    263
  13. #define    RETRIEVE    264
  14. #define    IGNORE    265
  15. #define    REMEMBER    266
  16. #define    ABSTAIN    267
  17. #define    REINSTATE    268
  18. #define    DISABLE    269
  19. #define    ENABLE    270
  20. #define    GIVE_UP    271
  21. #define    READ_OUT    272
  22. #define    WRITE_IN    273
  23. #define    COME_FROM    274
  24. #define    DO    275
  25. #define    PLEASE    276
  26. #define    NOT    277
  27. #define    MESH    278
  28. #define    ONESPOT    279
  29. #define    TWOSPOT    280
  30. #define    TAIL    281
  31. #define    HYBRID    282
  32. #define    MINGLE    283
  33. #define    SELECT    284
  34. #define    SPARK    285
  35. #define    EARS    286
  36. #define    SUB    287
  37. #define    BY    288
  38. #define    BADCHAR    289
  39. #define    NUMBER    290
  40. #define    UNARY    291
  41. #define    OHOHSEVEN    292
  42. #define    GERUND    293
  43. #define    LABEL    294
  44. #define    INTERSECTION    295
  45. #define    SPLATTERED    296
  46. #define    TESTNZ    297
  47. #define    C_AND    298
  48. #define    C_OR    299
  49. #define    C_XOR    300
  50. #define    C_NOT    301
  51. #define    EQUALS    302
  52. #define    AND    303
  53. #define    OR    304
  54. #define    XOR    305
  55. #define    FIN    306
  56. #define    MESH32    307
  57. #define    WHIRL    308
  58. #define    WHIRL2    309
  59. #define    WHIRL3    310
  60. #define    WHIRL4    311
  61. #define    WHIRL5    312
  62. #define    HIGHPREC    313
  63.  
  64.  
  65. #include <stdio.h>
  66. #include "sizes.h"
  67. #include "ick.h"
  68. #include "feh.h"
  69. #include "lose.h"
  70.  
  71. extern int yyerror(char*);
  72.  
  73. /* Intervene our first-stage lexer. */
  74. extern int lexer(void);
  75. #define yylex() lexer()
  76.  
  77. static node *rlist;    /* pointer to current right-hand node list */
  78. /*static node *llist;*/    /* pointer to current left-hand node list */
  79. static node *np;    /* variable for building node lists */
  80.  
  81. extern int stbeginline;    /* line number of last seen preamble */
  82. static int thisline;    /* line number of beginning of current statement */
  83. static tuple *splat(void);
  84.  
  85. #define GETLINENO                    \
  86.     {if (stbeginline < 0) thisline = -stbeginline;    \
  87.      else {thisline = stbeginline; stbeginline = 0;}}
  88.  
  89. #define ACTION(x, nt, nn)    \
  90.     {x = newtuple(); x->type = nt; x->lineno = thisline; x->u.node = nn;}
  91. #define TARGET(x, nt, nn)    \
  92.     {x = newtuple(); x->type = nt; x->lineno = thisline; x->u.target = nn;}
  93. #define NEWFANGLED    if (traditional) lose(E111,yylineno,(char*)NULL); else
  94.  
  95.  
  96. typedef union
  97. {
  98.     int        numval;        /* a numeric value */
  99.     tuple    *tuple;        /* a code tuple */
  100.     node    *node;        /* an expression-tree node */
  101. } YYSTYPE;
  102.  
  103. #ifndef YYLTYPE
  104. typedef
  105.   struct yyltype
  106.     {
  107.       int timestamp;
  108.       int first_line;
  109.       int first_column;
  110.       int last_line;
  111.       int last_column;
  112.       char *text;
  113.    }
  114.   yyltype;
  115.  
  116. #define YYLTYPE yyltype
  117. #endif
  118.  
  119. #ifndef YYDEBUG
  120. #define YYDEBUG 1
  121. #endif
  122.  
  123. #include <stdio.h>
  124.  
  125. #ifndef __cplusplus
  126. #ifndef __STDC__
  127. #define const
  128. #endif
  129. #endif
  130.  
  131.  
  132.  
  133. #define    YYFINAL        144
  134. #define    YYFLAG        -32768
  135. #define    YYNTBASE    59
  136.  
  137. #define YYTRANSLATE(x) ((unsigned)(x) <= 313 ? yytranslate[x] : 85)
  138.  
  139. static const char yytranslate[] = {     0,
  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,     2,     2,     2,     2,     2,
  151.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  152.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  153.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  154.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  155.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  156.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  157.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  158.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  159.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  160.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  161.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  162.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  163.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  164.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  165.      2,     2,     2,     2,     2,     1,     2,     3,     4,     5,
  166.      6,     7,     8,     9,    10,    11,    12,    13,    14,    15,
  167.     16,    17,    18,    19,    20,    21,    22,    23,    24,    25,
  168.     26,    27,    28,    29,    30,    31,    32,    33,    34,    35,
  169.     36,    37,    38,    39,    40,    41,    42,    43,    44,    45,
  170.     46,    47,    48,    49,    50,    51,    52,    53,    54,    55,
  171.     56,    57,    58
  172. };
  173.  
  174. #if YYDEBUG != 0
  175. static const short yyprhs[] = {     0,
  176.      0,     1,     4,     7,    11,    15,    20,    22,    24,    27,
  177.     31,    35,    38,    41,    44,    47,    50,    53,    56,    59,
  178.     62,    65,    68,    71,    74,    76,    79,    81,    83,    85,
  179.     89,    91,    93,    95,    97,   100,   103,   106,   109,   113,
  180.    117,   120,   122,   126,   128,   130,   132,   136,   138,   140,
  181.    142,   144,   146,   150,   152,   156,   158,   160,   164,   168,
  182.    171,   174,   176,   178,   180,   182,   186,   190,   192,   196,
  183.    200,   204,   208,   212,   216,   218,   220,   222,   224,   226,
  184.    228,   230,   234,   239,   244,   248
  185. };
  186.  
  187. static const short yyrhs[] = {    -1,
  188.     59,    60,     0,    61,    62,     0,    61,    37,    62,     0,
  189.     39,    61,    62,     0,    39,    61,    37,    62,     0,     1,
  190.      0,    20,     0,    20,    22,     0,    65,     3,    82,     0,
  191.     67,     3,    75,     0,    39,     5,     0,     6,    82,     0,
  192.      7,    82,     0,     8,    70,     0,     9,    70,     0,    10,
  193.     70,     0,    11,    70,     0,    12,    39,     0,    12,    63,
  194.      0,    13,    39,     0,    13,    63,     0,    18,    72,     0,
  195.     17,    74,     0,    16,     0,    19,    39,     0,    34,     0,
  196.      1,     0,    38,     0,    63,    40,    38,     0,    66,     0,
  197.     67,     0,    66,     0,    76,     0,    24,    35,     0,    25,
  198.     35,     0,    26,    35,     0,    27,    35,     0,    26,    36,
  199.     35,     0,    27,    36,    35,     0,    23,    35,     0,    64,
  200.      0,    70,    40,    64,     0,    66,     0,    76,     0,    67,
  201.      0,    71,    40,    72,     0,    71,     0,    66,     0,    76,
  202.      0,    69,     0,    67,     0,    73,    40,    74,     0,    73,
  203.      0,    82,    33,    75,     0,    82,     0,    77,     0,    67,
  204.     32,    78,     0,    67,    32,    79,     0,    84,    78,     0,
  205.     84,    79,     0,    77,     0,    81,     0,    84,     0,    81,
  206.      0,    68,    32,    78,     0,    68,    32,    79,     0,    84,
  207.      0,    84,    29,    84,     0,    84,    29,    76,     0,    84,
  208.     29,    80,     0,    84,    28,    84,     0,    84,    28,    76,
  209.      0,    84,    28,    80,     0,    76,     0,    80,     0,    23,
  210.      0,    24,     0,    25,     0,    64,     0,    69,     0,    83,
  211.     36,    35,     0,    30,    36,    82,    30,     0,    31,    36,
  212.     82,    31,     0,    30,    82,    30,     0,    31,    82,    31,
  213.      0
  214. };
  215.  
  216. #endif
  217.  
  218. #if YYDEBUG != 0
  219. static const short yyrline[] = { 0,
  220.    108,   109,   118,   120,   122,   124,   126,   131,   132,   136,
  221.    137,   138,   139,   140,   141,   142,   143,   144,   145,   146,
  222.    147,   148,   149,   150,   151,   152,   153,   154,   158,   160,
  223.    169,   169,   171,   171,   173,   179,   187,   193,   203,   211,
  224.    222,   234,   235,   241,   241,   241,   242,   243,   247,   247,
  225.    247,   247,   248,   249,   255,   256,   260,   261,   263,   265,
  226.    266,   268,   269,   270,   274,   275,   278,   283,   284,   285,
  227.    286,   287,   288,   289,   290,   291,   294,   294,   294,   296,
  228.    297,   300,   318,   324,   331,   332
  229. };
  230.  
  231. static const char * const yytname[] = {   "$","error","$illegal.","GETS","RESIZE",
  232. "NEXT","FORGET","RESUME","STASH","RETRIEVE","IGNORE","REMEMBER","ABSTAIN","REINSTATE",
  233. "DISABLE","ENABLE","GIVE_UP","READ_OUT","WRITE_IN","COME_FROM","DO","PLEASE",
  234. "NOT","MESH","ONESPOT","TWOSPOT","TAIL","HYBRID","MINGLE","SELECT","SPARK","EARS",
  235. "SUB","BY","BADCHAR","NUMBER","UNARY","OHOHSEVEN","GERUND","LABEL","INTERSECTION",
  236. "SPLATTERED","TESTNZ","C_AND","C_OR","C_XOR","C_NOT","EQUALS","AND","OR","XOR",
  237. "FIN","MESH32","WHIRL","WHIRL2","WHIRL3","WHIRL4","WHIRL5","HIGHPREC","program",
  238. "command","please","perform","gerunds","variable","lvalue","scalar","array",
  239. "oparray","constant","varlist","initem","inlist","outitem","outlist","byexpr",
  240. "subscr","subscr1","sublist","sublist1","osubscr","osubscr1","expr","preftype",
  241. "unambig",""
  242. };
  243. #endif
  244.  
  245. static const short yyr1[] = {     0,
  246.     59,    59,    60,    60,    60,    60,    60,    61,    61,    62,
  247.     62,    62,    62,    62,    62,    62,    62,    62,    62,    62,
  248.     62,    62,    62,    62,    62,    62,    62,    62,    63,    63,
  249.     64,    64,    65,    65,    66,    66,    67,    67,    68,    68,
  250.     69,    70,    70,    71,    71,    71,    72,    72,    73,    73,
  251.     73,    73,    74,    74,    75,    75,    76,    76,    77,    78,
  252.     78,    79,    79,    79,    80,    80,    81,    82,    82,    82,
  253.     82,    82,    82,    82,    82,    82,    83,    83,    83,    84,
  254.     84,    84,    84,    84,    84,    84
  255. };
  256.  
  257. static const short yyr2[] = {     0,
  258.      0,     2,     2,     3,     3,     4,     1,     1,     2,     3,
  259.      3,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  260.      2,     2,     2,     2,     1,     2,     1,     1,     1,     3,
  261.      1,     1,     1,     1,     2,     2,     2,     2,     3,     3,
  262.      2,     1,     3,     1,     1,     1,     3,     1,     1,     1,
  263.      1,     1,     3,     1,     3,     1,     1,     3,     3,     2,
  264.      2,     1,     1,     1,     1,     3,     3,     1,     3,     3,
  265.      3,     3,     3,     3,     1,     1,     1,     1,     1,     1,
  266.      1,     3,     4,     4,     3,     3
  267. };
  268.  
  269. static const short yydefact[] = {     1,
  270.      0,     7,     8,     0,     2,     0,     9,     0,    28,     0,
  271.      0,     0,     0,     0,     0,     0,     0,    25,     0,     0,
  272.      0,     0,     0,     0,     0,    27,     0,     0,     3,     0,
  273.     33,     0,    34,    57,     0,     5,    77,    78,    79,     0,
  274.      0,     0,     0,    80,    31,    32,     0,    81,    75,    76,
  275.     65,    13,     0,    68,    14,    42,    32,    15,    16,    17,
  276.     18,    29,    19,    20,    21,    22,     0,    49,    52,    51,
  277.     54,    24,    50,    44,    46,    48,    23,    45,    26,    35,
  278.     36,    37,    38,     4,    12,     0,     0,     0,     6,    41,
  279.      0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
  280.      0,     0,     0,     0,    10,    11,    56,    32,     0,    62,
  281.     58,    59,    63,    64,    39,    40,     0,    85,     0,    86,
  282.     66,    67,    82,    73,    74,    72,    70,    71,    69,    43,
  283.     30,    53,    47,     0,     0,     0,    60,    61,    83,    84,
  284.     55,    64,     0,     0
  285. };
  286.  
  287. static const short yydefgoto[] = {     1,
  288.      5,     6,    29,    64,    44,    30,    45,    46,    47,    48,
  289.     58,    76,    77,    71,    72,   106,    49,    34,   111,   112,
  290.     50,    51,   107,    53,    54
  291. };
  292.  
  293. static const short yypact[] = {-32768,
  294.     57,-32768,   -17,    -4,-32768,   115,-32768,   149,-32768,   216,
  295.    216,    80,    80,    80,    80,    21,    27,-32768,   120,    80,
  296.    -16,     8,    13,    18,    32,-32768,   183,    45,-32768,    53,
  297. -32768,    15,-32768,-32768,   183,-32768,    39,     8,    13,    34,
  298.     37,   188,   202,-32768,-32768,    48,    51,-32768,-32768,-32768,
  299. -32768,-32768,    58,    64,-32768,-32768,-32768,    47,    47,    47,
  300.     47,-32768,-32768,    61,-32768,    61,    39,-32768,    48,-32768,
  301.     69,-32768,-32768,-32768,    48,    72,-32768,-32768,-32768,-32768,
  302. -32768,-32768,-32768,-32768,-32768,   216,   216,   216,-32768,-32768,
  303.    100,   101,   216,   107,   216,   117,   216,   103,   216,   216,
  304.     80,   113,   120,    80,-32768,-32768,   130,   121,   132,-32768,
  305. -32768,-32768,-32768,   154,-32768,-32768,   139,-32768,   140,-32768,
  306. -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
  307. -32768,-32768,-32768,   216,   216,   216,-32768,-32768,-32768,-32768,
  308. -32768,-32768,   170,-32768
  309. };
  310.  
  311. static const short yypgoto[] = {-32768,
  312. -32768,   168,    36,   165,    12,-32768,    14,    -6,   -46,   -18,
  313.     -3,-32768,    81,-32768,    84,    63,    11,   -36,   -82,   -52,
  314.     20,   -33,    -7,-32768,   -60
  315. };
  316.  
  317.  
  318. #define    YYLAST        247
  319.  
  320.  
  321. static const short yytable[] = {    32,
  322.     70,    32,    52,    55,     7,    57,    57,    57,    57,    59,
  323.     60,    61,    69,    75,   121,     3,    33,    87,    33,    31,
  324.     32,    31,    79,    56,    56,    56,    56,   114,    32,    73,
  325.     78,   137,    68,    74,    94,    96,   114,    33,   126,   129,
  326.     31,   109,    80,    36,   122,    33,    88,    81,    31,    85,
  327.    109,   110,    82,   114,   113,    86,   143,     2,    62,    63,
  328.    110,   138,    84,   113,    62,    65,    83,   109,    82,    91,
  329.     89,    83,    92,    90,   142,   142,     3,   110,   105,    88,
  330.    113,   108,    97,   122,    70,   117,   101,   119,   109,   109,
  331.    108,    99,   100,    98,    57,     4,    69,    75,   110,   110,
  332.    102,   113,   113,    22,    23,    24,    25,   108,   103,   124,
  333.    127,   104,   130,    73,    78,     9,    68,    74,   125,   128,
  334.     10,    11,    12,    13,    14,    15,    16,    17,   108,   108,
  335.     18,    19,    20,    21,   115,   116,   118,   123,    22,    23,
  336.     24,    25,    67,    22,    23,    24,    25,   120,    26,     9,
  337.    131,    27,   135,    28,    10,    11,    12,    13,    14,    15,
  338.     16,    17,   134,   136,    18,    19,    20,    21,   139,   144,
  339.    140,     8,    22,    23,    24,    25,    37,    38,    39,    40,
  340.     41,    66,    26,     9,   133,    35,   132,    28,    10,    11,
  341.     12,    13,    14,    15,    16,    17,   141,     0,    18,    19,
  342.     20,    21,     0,     0,     0,     0,    22,    23,    24,    25,
  343.     37,    38,    39,    40,    41,     0,    26,    42,    43,     0,
  344.      0,    28,     0,    93,    37,    38,    39,    40,    41,     0,
  345.      0,    42,    43,     0,     0,     0,     0,    95,    37,    38,
  346.     39,    40,    41,     0,     0,    42,    43
  347. };
  348.  
  349. static const short yycheck[] = {     6,
  350.     19,     8,    10,    11,    22,    12,    13,    14,    15,    13,
  351.     14,    15,    19,    20,    97,    20,     6,     3,     8,     6,
  352.     27,     8,    39,    12,    13,    14,    15,    88,    35,    19,
  353.     20,   114,    19,    20,    42,    43,    97,    27,    99,   100,
  354.     27,    88,    35,     8,    97,    35,    32,    35,    35,     5,
  355.     97,    88,    35,   114,    88,     3,     0,     1,    38,    39,
  356.     97,   114,    27,    97,    38,    39,    35,   114,    35,    36,
  357.     35,    35,    36,    35,   135,   136,    20,   114,    86,    32,
  358.    114,    88,    32,   136,   103,    93,    40,    95,   135,   136,
  359.     97,    28,    29,    36,   101,    39,   103,   104,   135,   136,
  360.     40,   135,   136,    24,    25,    26,    27,   114,    40,    99,
  361.    100,    40,   101,   103,   104,     1,   103,   104,    99,   100,
  362.      6,     7,     8,     9,    10,    11,    12,    13,   135,   136,
  363.     16,    17,    18,    19,    35,    35,    30,    35,    24,    25,
  364.     26,    27,    23,    24,    25,    26,    27,    31,    34,     1,
  365.     38,    37,    32,    39,     6,     7,     8,     9,    10,    11,
  366.     12,    13,    33,    32,    16,    17,    18,    19,    30,     0,
  367.     31,     4,    24,    25,    26,    27,    23,    24,    25,    26,
  368.     27,    17,    34,     1,   104,    37,   103,    39,     6,     7,
  369.      8,     9,    10,    11,    12,    13,   134,    -1,    16,    17,
  370.     18,    19,    -1,    -1,    -1,    -1,    24,    25,    26,    27,
  371.     23,    24,    25,    26,    27,    -1,    34,    30,    31,    -1,
  372.     -1,    39,    -1,    36,    23,    24,    25,    26,    27,    -1,
  373.     -1,    30,    31,    -1,    -1,    -1,    -1,    36,    23,    24,
  374.     25,    26,    27,    -1,    -1,    30,    31
  375. };
  376. /* -*-C-*-  Note some compilers choke on comments on `#line' lines.  */
  377.  
  378.  
  379. /* Skeleton output parser for bison,
  380.    Copyright (C) 1984, 1989, 1990 Bob Corbett and Richard Stallman
  381.  
  382.    This program is free software; you can redistribute it and/or modify
  383.    it under the terms of the GNU General Public License as published by
  384.    the Free Software Foundation; either version 1, or (at your option)
  385.    any later version.
  386.  
  387.    This program is distributed in the hope that it will be useful,
  388.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  389.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  390.    GNU General Public License for more details.
  391.  
  392.    You should have received a copy of the GNU General Public License
  393.    along with this program; if not, write to the Free Software
  394.    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
  395.  
  396.  
  397. #ifndef alloca
  398. #ifdef __GNUC__
  399. #define alloca __builtin_alloca
  400. #else /* not GNU C.  */
  401. #if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi)
  402. #include <alloca.h>
  403. #else /* not sparc */
  404. #if defined (MSDOS) && !defined (__TURBOC__)
  405. #include <malloc.h>
  406. #else /* not MSDOS, or __TURBOC__ */
  407. #if defined(_AIX)
  408. #include <malloc.h>
  409.  #pragma alloca
  410. #else /* not MSDOS, __TURBOC__, or _AIX */
  411. #ifdef __hpux
  412. #ifdef __cplusplus
  413. extern "C" {
  414. void *alloca (unsigned int);
  415. };
  416. #else /* not __cplusplus */
  417. void *alloca ();
  418. #endif /* not __cplusplus */
  419. #endif /* __hpux */
  420. #endif /* not _AIX */
  421. #endif /* not MSDOS, or __TURBOC__ */
  422. #endif /* not sparc.  */
  423. #endif /* not GNU C.  */
  424. #endif /* alloca not defined.  */
  425.  
  426. /* This is the parser code that is written into each bison parser
  427.   when the %semantic_parser declaration is not specified in the grammar.
  428.   It was written by Richard Stallman by simplifying the hairy parser
  429.   used when %semantic_parser is specified.  */
  430.  
  431. /* Note: there must be only one dollar sign in this file.
  432.    It is replaced by the list of actions, each action
  433.    as one case of the switch.  */
  434.  
  435. #define yyerrok        (yyerrstatus = 0)
  436. #define yyclearin    (yychar = YYEMPTY)
  437. #define YYEMPTY        -2
  438. #define YYEOF        0
  439. #define YYACCEPT    return(0)
  440. #define YYABORT     return(1)
  441. #define YYERROR        goto yyerrlab1
  442. /* Like YYERROR except do call yyerror.
  443.    This remains here temporarily to ease the
  444.    transition to the new meaning of YYERROR, for GCC.
  445.    Once GCC version 2 has supplanted version 1, this can go.  */
  446. #define YYFAIL        goto yyerrlab
  447. #define YYRECOVERING()  (!!yyerrstatus)
  448. #define YYBACKUP(token, value) \
  449. do                                \
  450.   if (yychar == YYEMPTY && yylen == 1)                \
  451.     { yychar = (token), yylval = (value);            \
  452.       yychar1 = YYTRANSLATE (yychar);                \
  453.       YYPOPSTACK;                        \
  454.       goto yybackup;                        \
  455.     }                                \
  456.   else                                \
  457.     { yyerror ("syntax error: cannot back up"); YYERROR; }    \
  458. while (0)
  459.  
  460. #define YYTERROR    1
  461. #define YYERRCODE    256
  462.  
  463. #ifndef YYPURE
  464. #define YYLEX        yylex()
  465. #endif
  466.  
  467. #ifdef YYPURE
  468. #ifdef YYLSP_NEEDED
  469. #define YYLEX        yylex(&yylval, &yylloc)
  470. #else
  471. #define YYLEX        yylex(&yylval)
  472. #endif
  473. #endif
  474.  
  475. /* If nonreentrant, generate the variables here */
  476.  
  477. #ifndef YYPURE
  478.  
  479. int    yychar;            /*  the lookahead symbol        */
  480. YYSTYPE    yylval;            /*  the semantic value of the        */
  481.                 /*  lookahead symbol            */
  482.  
  483. #ifdef YYLSP_NEEDED
  484. YYLTYPE yylloc;            /*  location data for the lookahead    */
  485.                 /*  symbol                */
  486. #endif
  487.  
  488. int yynerrs;            /*  number of parse errors so far       */
  489. #endif  /* not YYPURE */
  490.  
  491. #if YYDEBUG != 0
  492. int yydebug;            /*  nonzero means print parse trace    */
  493. /* Since this is uninitialized, it does not stop multiple parsers
  494.    from coexisting.  */
  495. #endif
  496.  
  497. /*  YYINITDEPTH indicates the initial size of the parser's stacks    */
  498.  
  499. #ifndef    YYINITDEPTH
  500. #define YYINITDEPTH 200
  501. #endif
  502.  
  503. /*  YYMAXDEPTH is the maximum size the stacks can grow to
  504.     (effective only if the built-in stack extension method is used).  */
  505.  
  506. #if YYMAXDEPTH == 0
  507. #undef YYMAXDEPTH
  508. #endif
  509.  
  510. #ifndef YYMAXDEPTH
  511. #define YYMAXDEPTH 10000
  512. #endif
  513.  
  514. /* Prevent warning if -Wstrict-prototypes.  */
  515. #ifdef __GNUC__
  516. int yyparse (void);
  517. #endif
  518.  
  519. #if __GNUC__ > 1        /* GNU C and GNU C++ define this.  */
  520. #define __yy_bcopy(FROM,TO,COUNT)    __builtin_memcpy(TO,FROM,COUNT)
  521. #else                /* not GNU C or C++ */
  522. #ifndef __cplusplus
  523.  
  524. /* This is the most reliable way to avoid incompatibilities
  525.    in available built-in functions on various systems.  */
  526. static void
  527. __yy_bcopy (from, to, count)
  528.      char *from;
  529.      char *to;
  530.      int count;
  531. {
  532.   register char *f = from;
  533.   register char *t = to;
  534.   register int i = count;
  535.  
  536.   while (i-- > 0)
  537.     *t++ = *f++;
  538. }
  539.  
  540. #else /* __cplusplus */
  541.  
  542. /* This is the most reliable way to avoid incompatibilities
  543.    in available built-in functions on various systems.  */
  544. static void
  545. __yy_bcopy (char *from, char *to, int count)
  546. {
  547.   register char *f = from;
  548.   register char *t = to;
  549.   register int i = count;
  550.  
  551.   while (i-- > 0)
  552.     *t++ = *f++;
  553. }
  554.  
  555. #endif
  556. #endif
  557.  
  558.  
  559. int
  560. yyparse()
  561. {
  562.   register int yystate;
  563.   register int yyn;
  564.   register short *yyssp;
  565.   register YYSTYPE *yyvsp;
  566.   int yyerrstatus;    /*  number of tokens to shift before error messages enabled */
  567.   int yychar1 = 0;        /*  lookahead token as an internal (translated) token number */
  568.  
  569.   short    yyssa[YYINITDEPTH];    /*  the state stack            */
  570.   YYSTYPE yyvsa[YYINITDEPTH];    /*  the semantic value stack        */
  571.  
  572.   short *yyss = yyssa;        /*  refer to the stacks thru separate pointers */
  573.   YYSTYPE *yyvs = yyvsa;    /*  to allow yyoverflow to reallocate them elsewhere */
  574.  
  575. #ifdef YYLSP_NEEDED
  576.   YYLTYPE yylsa[YYINITDEPTH];    /*  the location stack            */
  577.   YYLTYPE *yyls = yylsa;
  578.   YYLTYPE *yylsp;
  579.  
  580. #define YYPOPSTACK   (yyvsp--, yyssp--, yylsp--)
  581. #else
  582. #define YYPOPSTACK   (yyvsp--, yyssp--)
  583. #endif
  584.  
  585.   int yystacksize = YYINITDEPTH;
  586.  
  587. #ifdef YYPURE
  588.   int yychar;
  589.   YYSTYPE yylval;
  590.   int yynerrs;
  591. #ifdef YYLSP_NEEDED
  592.   YYLTYPE yylloc;
  593. #endif
  594. #endif
  595.  
  596.   YYSTYPE yyval;        /*  the variable used to return        */
  597.                 /*  semantic values from the action    */
  598.                 /*  routines                */
  599.  
  600.   int yylen;
  601.  
  602. #if YYDEBUG != 0
  603.   if (yydebug)
  604.     fprintf(stderr, "Starting parse\n");
  605. #endif
  606.  
  607.   yystate = 0;
  608.   yyerrstatus = 0;
  609.   yynerrs = 0;
  610.   yychar = YYEMPTY;        /* Cause a token to be read.  */
  611.  
  612.   /* Initialize stack pointers.
  613.      Waste one element of value and location stack
  614.      so that they stay on the same level as the state stack.
  615.      The wasted elements are never initialized.  */
  616.  
  617.   yyssp = yyss - 1;
  618.   yyvsp = yyvs;
  619. #ifdef YYLSP_NEEDED
  620.   yylsp = yyls;
  621. #endif
  622.  
  623. /* Push a new state, which is found in  yystate  .  */
  624. /* In all cases, when you get here, the value and location stacks
  625.    have just been pushed. so pushing a state here evens the stacks.  */
  626. yynewstate:
  627.  
  628.   *++yyssp = yystate;
  629.  
  630.   if (yyssp >= yyss + yystacksize - 1)
  631.     {
  632.       /* Give user a chance to reallocate the stack */
  633.       /* Use copies of these so that the &'s don't force the real ones into memory. */
  634.       YYSTYPE *yyvs1 = yyvs;
  635.       short *yyss1 = yyss;
  636. #ifdef YYLSP_NEEDED
  637.       YYLTYPE *yyls1 = yyls;
  638. #endif
  639.  
  640.       /* Get the current used size of the three stacks, in elements.  */
  641.       int size = yyssp - yyss + 1;
  642.  
  643. #ifdef yyoverflow
  644.       /* Each stack pointer address is followed by the size of
  645.      the data in use in that stack, in bytes.  */
  646. #ifdef YYLSP_NEEDED
  647.       /* This used to be a conditional around just the two extra args,
  648.      but that might be undefined if yyoverflow is a macro.  */
  649.       yyoverflow("parser stack overflow",
  650.          &yyss1, size * sizeof (*yyssp),
  651.          &yyvs1, size * sizeof (*yyvsp),
  652.          &yyls1, size * sizeof (*yylsp),
  653.          &yystacksize);
  654. #else
  655.       yyoverflow("parser stack overflow",
  656.          &yyss1, size * sizeof (*yyssp),
  657.          &yyvs1, size * sizeof (*yyvsp),
  658.          &yystacksize);
  659. #endif
  660.  
  661.       yyss = yyss1; yyvs = yyvs1;
  662. #ifdef YYLSP_NEEDED
  663.       yyls = yyls1;
  664. #endif
  665. #else /* no yyoverflow */
  666.       /* Extend the stack our own way.  */
  667.       if (yystacksize >= YYMAXDEPTH)
  668.     {
  669.       yyerror("parser stack overflow");
  670.       return 2;
  671.     }
  672.       yystacksize *= 2;
  673.       if (yystacksize > YYMAXDEPTH)
  674.     yystacksize = YYMAXDEPTH;
  675.       yyss = (short *) alloca (yystacksize * sizeof (*yyssp));
  676.       __yy_bcopy ((char *)yyss1, (char *)yyss, size * sizeof (*yyssp));
  677.       yyvs = (YYSTYPE *) alloca (yystacksize * sizeof (*yyvsp));
  678.       __yy_bcopy ((char *)yyvs1, (char *)yyvs, size * sizeof (*yyvsp));
  679. #ifdef YYLSP_NEEDED
  680.       yyls = (YYLTYPE *) alloca (yystacksize * sizeof (*yylsp));
  681.       __yy_bcopy ((char *)yyls1, (char *)yyls, size * sizeof (*yylsp));
  682. #endif
  683. #endif /* no yyoverflow */
  684.  
  685.       yyssp = yyss + size - 1;
  686.       yyvsp = yyvs + size - 1;
  687. #ifdef YYLSP_NEEDED
  688.       yylsp = yyls + size - 1;
  689. #endif
  690.  
  691. #if YYDEBUG != 0
  692.       if (yydebug)
  693.     fprintf(stderr, "Stack size increased to %d\n", yystacksize);
  694. #endif
  695.  
  696.       if (yyssp >= yyss + yystacksize - 1)
  697.     YYABORT;
  698.     }
  699.  
  700. #if YYDEBUG != 0
  701.   if (yydebug)
  702.     fprintf(stderr, "Entering state %d\n", yystate);
  703. #endif
  704.  
  705.   goto yybackup;
  706.  yybackup:
  707.  
  708. /* Do appropriate processing given the current state.  */
  709. /* Read a lookahead token if we need one and don't already have one.  */
  710. /* yyresume: */
  711.  
  712.   /* First try to decide what to do without reference to lookahead token.  */
  713.  
  714.   yyn = yypact[yystate];
  715.   if (yyn == YYFLAG)
  716.     goto yydefault;
  717.  
  718.   /* Not known => get a lookahead token if don't already have one.  */
  719.  
  720.   /* yychar is either YYEMPTY or YYEOF
  721.      or a valid token in external form.  */
  722.  
  723.   if (yychar == YYEMPTY)
  724.     {
  725. #if YYDEBUG != 0
  726.       if (yydebug)
  727.     fprintf(stderr, "Reading a token: ");
  728. #endif
  729.       yychar = YYLEX;
  730.     }
  731.  
  732.   /* Convert token to internal form (in yychar1) for indexing tables with */
  733.  
  734.   if (yychar <= 0)        /* This means end of input. */
  735.     {
  736.       yychar1 = 0;
  737.       yychar = YYEOF;        /* Don't call YYLEX any more */
  738.  
  739. #if YYDEBUG != 0
  740.       if (yydebug)
  741.     fprintf(stderr, "Now at end of input.\n");
  742. #endif
  743.     }
  744.   else
  745.     {
  746.       yychar1 = YYTRANSLATE(yychar);
  747.  
  748. #if YYDEBUG != 0
  749.       if (yydebug)
  750.     {
  751.       fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]);
  752.       /* Give the individual parser a way to print the precise meaning
  753.          of a token, for further debugging info.  */
  754. #ifdef YYPRINT
  755.       YYPRINT (stderr, yychar, yylval);
  756. #endif
  757.       fprintf (stderr, ")\n");
  758.     }
  759. #endif
  760.     }
  761.  
  762.   yyn += yychar1;
  763.   if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
  764.     goto yydefault;
  765.  
  766.   yyn = yytable[yyn];
  767.  
  768.   /* yyn is what to do for this token type in this state.
  769.      Negative => reduce, -yyn is rule number.
  770.      Positive => shift, yyn is new state.
  771.        New state is final state => don't bother to shift,
  772.        just return success.
  773.      0, or most negative number => error.  */
  774.  
  775.   if (yyn < 0)
  776.     {
  777.       if (yyn == YYFLAG)
  778.     goto yyerrlab;
  779.       yyn = -yyn;
  780.       goto yyreduce;
  781.     }
  782.   else if (yyn == 0)
  783.     goto yyerrlab;
  784.  
  785.   if (yyn == YYFINAL)
  786.     YYACCEPT;
  787.  
  788.   /* Shift the lookahead token.  */
  789.  
  790. #if YYDEBUG != 0
  791.   if (yydebug)
  792.     fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);
  793. #endif
  794.  
  795.   /* Discard the token being shifted unless it is eof.  */
  796.   if (yychar != YYEOF)
  797.     yychar = YYEMPTY;
  798.  
  799.   *++yyvsp = yylval;
  800. #ifdef YYLSP_NEEDED
  801.   *++yylsp = yylloc;
  802. #endif
  803.  
  804.   /* count tokens shifted since error; after three, turn off error status.  */
  805.   if (yyerrstatus) yyerrstatus--;
  806.  
  807.   yystate = yyn;
  808.   goto yynewstate;
  809.  
  810. /* Do the default action for the current state.  */
  811. yydefault:
  812.  
  813.   yyn = yydefact[yystate];
  814.   if (yyn == 0)
  815.     goto yyerrlab;
  816.  
  817. /* Do a reduction.  yyn is the number of a rule to reduce with.  */
  818. yyreduce:
  819.   yylen = yyr2[yyn];
  820.   if (yylen > 0)
  821.     yyval = yyvsp[1-yylen]; /* implement default value of the action */
  822.  
  823. #if YYDEBUG != 0
  824.   if (yydebug)
  825.     {
  826.       int i;
  827.  
  828.       fprintf (stderr, "Reducing via rule %d (line %d), ",
  829.            yyn, yyrline[yyn]);
  830.  
  831.       /* Print the symbols being reduced, and their result.  */
  832.       for (i = yyprhs[yyn]; yyrhs[i] > 0; i++)
  833.     fprintf (stderr, "%s ", yytname[yyrhs[i]]);
  834.       fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]);
  835.     }
  836. #endif
  837.  
  838.  
  839.   switch (yyn) {
  840.  
  841. case 3:
  842. {yyvsp[0].tuple->label = 0; yyvsp[0].tuple->exechance = yyvsp[-1].numval * 100;;
  843.     break;}
  844. case 4:
  845. {yyvsp[0].tuple->label = 0; yyvsp[0].tuple->exechance = yyvsp[-2].numval * yyvsp[-1].numval;;
  846.     break;}
  847. case 5:
  848. {checklabel(yyvsp[-2].numval); yyvsp[0].tuple->label = yyvsp[-2].numval; yyvsp[0].tuple->exechance = yyvsp[-1].numval * 100;;
  849.     break;}
  850. case 6:
  851. {checklabel(yyvsp[-3].numval); yyvsp[0].tuple->label = yyvsp[-3].numval; yyvsp[0].tuple->exechance = yyvsp[-2].numval * yyvsp[-1].numval;;
  852.     break;}
  853. case 7:
  854. {lose(E017, yylineno, (char *)NULL);;
  855.     break;}
  856. case 8:
  857. {GETLINENO; yyval.numval = 1;;
  858.     break;}
  859. case 9:
  860. {GETLINENO; yyval.numval = -1;;
  861.     break;}
  862. case 10:
  863. {ACTION(yyval.tuple, GETS,      cons(GETS,yyvsp[-2].node,yyvsp[0].node));;
  864.     break;}
  865. case 11:
  866. {ACTION(yyval.tuple, RESIZE,    cons(RESIZE,yyvsp[-2].node,yyvsp[0].node));;
  867.     break;}
  868. case 12:
  869. {TARGET(yyval.tuple, NEXT,      yyvsp[-1].numval);;
  870.     break;}
  871. case 13:
  872. {ACTION(yyval.tuple, FORGET,    yyvsp[0].node);;
  873.     break;}
  874. case 14:
  875. {ACTION(yyval.tuple, RESUME,    yyvsp[0].node);;
  876.     break;}
  877. case 15:
  878. {ACTION(yyval.tuple, STASH,     rlist);;
  879.     break;}
  880. case 16:
  881. {ACTION(yyval.tuple, RETRIEVE,  rlist);;
  882.     break;}
  883. case 17:
  884. {ACTION(yyval.tuple, IGNORE,    rlist);;
  885.     break;}
  886. case 18:
  887. {ACTION(yyval.tuple, REMEMBER,  rlist);;
  888.     break;}
  889. case 19:
  890. {TARGET(yyval.tuple, ABSTAIN,   yyvsp[0].numval);;
  891.     break;}
  892. case 20:
  893. {ACTION(yyval.tuple, DISABLE,   rlist);;
  894.     break;}
  895. case 21:
  896. {TARGET(yyval.tuple, REINSTATE, yyvsp[0].numval);;
  897.     break;}
  898. case 22:
  899. {ACTION(yyval.tuple, ENABLE,    rlist);;
  900.     break;}
  901. case 23:
  902. {ACTION(yyval.tuple, WRITE_IN,  yyvsp[0].node);;
  903.     break;}
  904. case 24:
  905. {ACTION(yyval.tuple, READ_OUT,  yyvsp[0].node);;
  906.     break;}
  907. case 25:
  908. {ACTION(yyval.tuple, GIVE_UP,   0);;
  909.     break;}
  910. case 26:
  911. {NEWFANGLED {TARGET(yyval.tuple,COME_FROM,yyvsp[0].numval)};
  912.     break;}
  913. case 27:
  914. {yyclearin; yyval.tuple = splat();;
  915.     break;}
  916. case 28:
  917. {yyclearin; yyval.tuple = splat();;
  918.     break;}
  919. case 29:
  920. {rlist = np = newnode(); np->constant = yyvsp[0].numval;;
  921.     break;}
  922. case 30:
  923. {
  924.             np->rval = newnode();
  925.             np = np->rval;
  926.             np->constant = yyvsp[0].numval;
  927.         ;
  928.     break;}
  929. case 35:
  930. {
  931.             yyval.node = newnode();
  932.             yyval.node->opcode = ONESPOT;
  933.             yyval.node->constant = intern(ONESPOT, yyvsp[0].numval);
  934.         ;
  935.     break;}
  936. case 36:
  937. {
  938.             yyval.node = newnode();
  939.             yyval.node->opcode = TWOSPOT;
  940.             yyval.node->constant = intern(TWOSPOT, yyvsp[0].numval);
  941.         ;
  942.     break;}
  943. case 37:
  944. {
  945.             yyval.node = newnode();
  946.             yyval.node->opcode = TAIL;
  947.             yyval.node->constant = intern(TAIL, yyvsp[0].numval);
  948.         ;
  949.     break;}
  950. case 38:
  951. {
  952.             yyval.node = newnode();
  953.             yyval.node->opcode = HYBRID;
  954.             yyval.node->constant = intern(HYBRID, yyvsp[0].numval);
  955.         ;
  956.     break;}
  957. case 39:
  958. {
  959.             yyval.node = newnode();
  960.             yyval.node->opcode = yyvsp[-1].numval;
  961.             yyval.node->rval = newnode();
  962.             yyval.node->rval->opcode = TAIL;
  963.             yyval.node->rval->constant = intern(TAIL, yyvsp[0].numval);
  964.         ;
  965.     break;}
  966. case 40:
  967. {
  968.             yyval.node = newnode();
  969.             yyval.node->opcode = yyvsp[-1].numval;
  970.             yyval.node->rval = newnode();
  971.             yyval.node->rval->opcode = HYBRID;
  972.             yyval.node->rval->constant = intern(HYBRID, yyvsp[0].numval);
  973.         ;
  974.     break;}
  975. case 41:
  976. {
  977.             /* enforce the 16-bit constant constraint */
  978.             if ((unsigned int)yyvsp[0].numval > Max_small)
  979.             lose(E017, yylineno, (char *)NULL);
  980.             yyval.node = newnode();
  981.             yyval.node->opcode = MESH;
  982.             yyval.node->constant = yyvsp[0].numval;
  983.         ;
  984.     break;}
  985. case 42:
  986. {rlist = np = yyvsp[0].node;;
  987.     break;}
  988. case 43:
  989. {np = np->rval = yyvsp[0].node;
  990.                             /* newnode(); */ ;
  991.     break;}
  992. case 47:
  993. {yyval.node=cons(INTERSECTION,yyvsp[-2].node,yyvsp[0].node);;
  994.     break;}
  995. case 48:
  996. {yyval.node=cons(INTERSECTION,yyvsp[0].node,0);;
  997.     break;}
  998. case 53:
  999. {yyval.node=cons(INTERSECTION,yyvsp[-2].node,yyvsp[0].node);;
  1000.     break;}
  1001. case 54:
  1002. {yyval.node=cons(INTERSECTION,yyvsp[0].node,0);;
  1003.     break;}
  1004. case 55:
  1005. {yyval.node = cons(BY, yyvsp[-2].node, yyvsp[0].node);;
  1006.     break;}
  1007. case 56:
  1008. {yyval.node = cons(BY, yyvsp[0].node, 0);;
  1009.     break;}
  1010. case 57:
  1011. {yyval.node = yyvsp[0].node;;
  1012.     break;}
  1013. case 58:
  1014. {yyval.node = cons(SUB, yyvsp[-2].node, yyvsp[0].node);;
  1015.     break;}
  1016. case 59:
  1017. {yyval.node = cons(SUB, yyvsp[-2].node, yyvsp[0].node);;
  1018.     break;}
  1019. case 60:
  1020. {yyval.node = cons(INTERSECTION, yyvsp[-1].node, yyvsp[0].node);;
  1021.     break;}
  1022. case 61:
  1023. {yyval.node = cons(INTERSECTION, yyvsp[-1].node, yyvsp[0].node);;
  1024.     break;}
  1025. case 62:
  1026. {yyval.node = cons(INTERSECTION, yyvsp[0].node, 0);;
  1027.     break;}
  1028. case 63:
  1029. {yyval.node = cons(INTERSECTION, yyvsp[0].node, 0);;
  1030.     break;}
  1031. case 64:
  1032. {yyval.node = cons(INTERSECTION, yyvsp[0].node, 0);;
  1033.     break;}
  1034. case 65:
  1035. {yyval.node = yyvsp[0].node;;
  1036.     break;}
  1037. case 66:
  1038. {yyval.node = yyvsp[-2].node; yyval.node->rval = cons(SUB, yyval.node->rval, yyvsp[0].node);;
  1039.     break;}
  1040. case 67:
  1041. {yyval.node = yyvsp[-2].node; yyval.node->rval = cons(SUB, yyval.node->rval, yyvsp[0].node);;
  1042.     break;}
  1043. case 68:
  1044. {yyval.node = yyvsp[0].node;;
  1045.     break;}
  1046. case 69:
  1047. {yyval.node = cons(SELECT, yyvsp[-2].node, yyvsp[0].node);;
  1048.     break;}
  1049. case 70:
  1050. {yyval.node = cons(SELECT, yyvsp[-2].node, yyvsp[0].node);;
  1051.     break;}
  1052. case 71:
  1053. {yyval.node = cons(SELECT, yyvsp[-2].node, yyvsp[0].node);;
  1054.     break;}
  1055. case 72:
  1056. {yyval.node = cons(MINGLE, yyvsp[-2].node, yyvsp[0].node);;
  1057.     break;}
  1058. case 73:
  1059. {yyval.node = cons(MINGLE, yyvsp[-2].node, yyvsp[0].node);;
  1060.     break;}
  1061. case 74:
  1062. {yyval.node = cons(MINGLE, yyvsp[-2].node, yyvsp[0].node);;
  1063.     break;}
  1064. case 75:
  1065. {yyval.node = yyvsp[0].node;;
  1066.     break;}
  1067. case 76:
  1068. {yyval.node = yyvsp[0].node;;
  1069.     break;}
  1070. case 77:
  1071. {yyval.numval=MESH; ;
  1072.     break;}
  1073. case 78:
  1074. {yyval.numval=ONESPOT;;
  1075.     break;}
  1076. case 79:
  1077. {yyval.numval=TWOSPOT;;
  1078.     break;}
  1079. case 80:
  1080. {yyval.node = yyvsp[0].node;;
  1081.     break;}
  1082. case 81:
  1083. {yyval.node = yyvsp[0].node;;
  1084.     break;}
  1085. case 82:
  1086. {
  1087.             yyval.node = newnode();
  1088.             yyval.node->opcode = yyvsp[-1].numval;
  1089.             yyval.node->rval = newnode();
  1090.             yyval.node->rval->opcode = yyvsp[-2].numval;
  1091.             if(yyvsp[-2].numval == MESH) {
  1092.                 /* enforce the 16-bit constant constraint */
  1093.                 if ((unsigned int)yyvsp[0].numval > Max_small)
  1094.                 lose(E017, yylineno, (char *)NULL);
  1095.                 yyval.node->rval->constant = yyvsp[0].numval;
  1096.             }
  1097.             else {
  1098.             yyval.node->rval->constant = intern(yyvsp[-2].numval, yyvsp[0].numval);
  1099.             }
  1100.         ;
  1101.     break;}
  1102. case 83:
  1103. {
  1104.             yyval.node = newnode();
  1105.             yyval.node->opcode = yyvsp[-2].numval;
  1106.             yyval.node->rval = yyvsp[-1].node;
  1107.         ;
  1108.     break;}
  1109. case 84:
  1110. {
  1111.             yyval.node = newnode();
  1112.             yyval.node->opcode = yyvsp[-2].numval;
  1113.             yyval.node->rval = yyvsp[-1].node;
  1114.         ;
  1115.     break;}
  1116. case 85:
  1117. {yyval.node = yyvsp[-1].node;;
  1118.     break;}
  1119. case 86:
  1120. {yyval.node = yyvsp[-1].node;;
  1121.     break;}
  1122. }
  1123.    /* the action file gets copied in in place of this dollarsign */
  1124.  
  1125.  
  1126.   yyvsp -= yylen;
  1127.   yyssp -= yylen;
  1128. #ifdef YYLSP_NEEDED
  1129.   yylsp -= yylen;
  1130. #endif
  1131.  
  1132. #if YYDEBUG != 0
  1133.   if (yydebug)
  1134.     {
  1135.       short *ssp1 = yyss - 1;
  1136.       fprintf (stderr, "state stack now");
  1137.       while (ssp1 != yyssp)
  1138.     fprintf (stderr, " %d", *++ssp1);
  1139.       fprintf (stderr, "\n");
  1140.     }
  1141. #endif
  1142.  
  1143.   *++yyvsp = yyval;
  1144.  
  1145. #ifdef YYLSP_NEEDED
  1146.   yylsp++;
  1147.   if (yylen == 0)
  1148.     {
  1149.       yylsp->first_line = yylloc.first_line;
  1150.       yylsp->first_column = yylloc.first_column;
  1151.       yylsp->last_line = (yylsp-1)->last_line;
  1152.       yylsp->last_column = (yylsp-1)->last_column;
  1153.       yylsp->text = 0;
  1154.     }
  1155.   else
  1156.     {
  1157.       yylsp->last_line = (yylsp+yylen-1)->last_line;
  1158.       yylsp->last_column = (yylsp+yylen-1)->last_column;
  1159.     }
  1160. #endif
  1161.  
  1162.   /* Now "shift" the result of the reduction.
  1163.      Determine what state that goes to,
  1164.      based on the state we popped back to
  1165.      and the rule number reduced by.  */
  1166.  
  1167.   yyn = yyr1[yyn];
  1168.  
  1169.   yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
  1170.   if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
  1171.     yystate = yytable[yystate];
  1172.   else
  1173.     yystate = yydefgoto[yyn - YYNTBASE];
  1174.  
  1175.   goto yynewstate;
  1176.  
  1177. yyerrlab:   /* here on detecting error */
  1178.  
  1179.   if (! yyerrstatus)
  1180.     /* If not already recovering from an error, report this error.  */
  1181.     {
  1182.       ++yynerrs;
  1183.  
  1184. #ifdef YYERROR_VERBOSE
  1185.       yyn = yypact[yystate];
  1186.  
  1187.       if (yyn > YYFLAG && yyn < YYLAST)
  1188.     {
  1189.       int size = 0;
  1190.       char *msg;
  1191.       int x, count;
  1192.  
  1193.       count = 0;
  1194.       /* Start X at -yyn if nec to avoid negative indexes in yycheck.  */
  1195.       for (x = (yyn < 0 ? -yyn : 0);
  1196.            x < (sizeof(yytname) / sizeof(char *)); x++)
  1197.         if (yycheck[x + yyn] == x)
  1198.           size += strlen(yytname[x]) + 15, count++;
  1199.       msg = (char *) malloc(size + 15);
  1200.       if (msg != 0)
  1201.         {
  1202.           strcpy(msg, "parse error");
  1203.  
  1204.           if (count < 5)
  1205.         {
  1206.           count = 0;
  1207.           for (x = (yyn < 0 ? -yyn : 0);
  1208.                x < (sizeof(yytname) / sizeof(char *)); x++)
  1209.             if (yycheck[x + yyn] == x)
  1210.               {
  1211.             strcat(msg, count == 0 ? ", expecting `" : " or `");
  1212.             strcat(msg, yytname[x]);
  1213.             strcat(msg, "'");
  1214.             count++;
  1215.               }
  1216.         }
  1217.           yyerror(msg);
  1218.           free(msg);
  1219.         }
  1220.       else
  1221.         yyerror ("parse error; also virtual memory exceeded");
  1222.     }
  1223.       else
  1224. #endif /* YYERROR_VERBOSE */
  1225.     yyerror("parse error");
  1226.     }
  1227.  
  1228.   goto yyerrlab1;
  1229. yyerrlab1:   /* here on error raised explicitly by an action */
  1230.  
  1231.   if (yyerrstatus == 3)
  1232.     {
  1233.       /* if just tried and failed to reuse lookahead token after an error, discard it.  */
  1234.  
  1235.       /* return failure if at end of input */
  1236.       if (yychar == YYEOF)
  1237.     YYABORT;
  1238.  
  1239. #if YYDEBUG != 0
  1240.       if (yydebug)
  1241.     fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);
  1242. #endif
  1243.  
  1244.       yychar = YYEMPTY;
  1245.     }
  1246.  
  1247.   /* Else will try to reuse lookahead token
  1248.      after shifting the error token.  */
  1249.  
  1250.   yyerrstatus = 3;        /* Each real token shifted decrements this */
  1251.  
  1252.   goto yyerrhandle;
  1253.  
  1254. yyerrdefault:  /* current state does not do anything special for the error token. */
  1255.  
  1256. #if 0
  1257.   /* This is wrong; only states that explicitly want error tokens
  1258.      should shift them.  */
  1259.   yyn = yydefact[yystate];  /* If its default is to accept any token, ok.  Otherwise pop it.*/
  1260.   if (yyn) goto yydefault;
  1261. #endif
  1262.  
  1263. yyerrpop:   /* pop the current state because it cannot handle the error token */
  1264.  
  1265.   if (yyssp == yyss) YYABORT;
  1266.   yyvsp--;
  1267.   yystate = *--yyssp;
  1268. #ifdef YYLSP_NEEDED
  1269.   yylsp--;
  1270. #endif
  1271.  
  1272. #if YYDEBUG != 0
  1273.   if (yydebug)
  1274.     {
  1275.       short *ssp1 = yyss - 1;
  1276.       fprintf (stderr, "Error: state stack now");
  1277.       while (ssp1 != yyssp)
  1278.     fprintf (stderr, " %d", *++ssp1);
  1279.       fprintf (stderr, "\n");
  1280.     }
  1281. #endif
  1282.  
  1283. yyerrhandle:
  1284.  
  1285.   yyn = yypact[yystate];
  1286.   if (yyn == YYFLAG)
  1287.     goto yyerrdefault;
  1288.  
  1289.   yyn += YYTERROR;
  1290.   if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
  1291.     goto yyerrdefault;
  1292.  
  1293.   yyn = yytable[yyn];
  1294.   if (yyn < 0)
  1295.     {
  1296.       if (yyn == YYFLAG)
  1297.     goto yyerrpop;
  1298.       yyn = -yyn;
  1299.       goto yyreduce;
  1300.     }
  1301.   else if (yyn == 0)
  1302.     goto yyerrpop;
  1303.  
  1304.   if (yyn == YYFINAL)
  1305.     YYACCEPT;
  1306.  
  1307. #if YYDEBUG != 0
  1308.   if (yydebug)
  1309.     fprintf(stderr, "Shifting error token, ");
  1310. #endif
  1311.  
  1312.   *++yyvsp = yylval;
  1313. #ifdef YYLSP_NEEDED
  1314.   *++yylsp = yylloc;
  1315. #endif
  1316.  
  1317.   yystate = yyn;
  1318.   goto yynewstate;
  1319. }
  1320.  
  1321.  
  1322. static tuple *splat(void)
  1323. /* try to recover from an invalid statement. */
  1324. {
  1325.     tuple *sp;
  1326.     int tok, i;
  1327.     extern bool re_send_token;
  1328.  
  1329.     /*
  1330.      * The idea
  1331.      * here is to skip to the next DO, PLEASE or label, then unget that token.
  1332.      * which we can do with a tricky flag on the lexer (re_send_token).
  1333.      */
  1334.  
  1335.     /*    fprintf(stderr,"attempting to splat at line %d....\n",yylineno); */
  1336.     for(i = 0,re_send_token = FALSE;;i++) {
  1337.     tok = lexer();
  1338.     if (!tok)
  1339.     {
  1340.         re_send_token = TRUE;
  1341.         tok = ' ';        /* scanner must not see a NUL */
  1342.         break;
  1343.     }
  1344.     else if (tok == DO || tok == PLEASE || tok == LABEL) {
  1345.         re_send_token = TRUE;
  1346.         break;
  1347.     }
  1348.     }
  1349.     /*
  1350.     fprintf(stderr,"found %d on line %d after %d other tokens.\n",
  1351.         tok,yylineno,i);
  1352.      */
  1353.  
  1354.     /* generate a placeholder tuple for the text line */
  1355.     TARGET(sp, SPLATTERED, 0);
  1356.  
  1357.     return(sp);
  1358. }
  1359.  
  1360. /* ick.y ends here */
  1361.