home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Tools / Languages / MacGofer 0.22d / MacGofer Sources / parser.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-08-25  |  64.0 KB  |  2,146 lines  |  [TEXT/MPS ]

  1. extern char *malloc(), *realloc();
  2.  
  3. # line 19 "parser.y"
  4. #ifndef lint
  5. #define lint
  6. #endif
  7. #define defTycon(n,l,lhs,rhs,w)     tyconDefn(intOf(l),lhs,rhs,w); sp-=n
  8. #define sigdecl(l,vs,t)         ap(SIGDECL,triple(l,vs,t))
  9. #define grded(gs)         ap(GUARDED,gs)
  10. #define letrec(bs,e)         (nonNull(bs) ? ap(LETREC,pair(bs,e)) : e)
  11. #define yyerror(s)         /* errors handled elsewhere */
  12. #define YYSTYPE             Cell
  13.  
  14. static Cell   local gcShadow     Args((Int,Cell));
  15. static Void   local syntaxError  Args((String));
  16. static String local unexpected   Args((Void));
  17. static Cell   local checkPrec    Args((Cell));
  18. static Void   local fixDefn      Args((Syntax,Cell,Cell,List));
  19. static Void   local setSyntax    Args((Int,Syntax,Cell));
  20. #if MAC
  21.        Cell   local buildTuple   Args((List));
  22. #else
  23. static Cell   local buildTuple   Args((List));
  24. #endif
  25. static Cell   local checkClass   Args((Cell));
  26. static List   local checkContext Args((List));
  27. static Cell   local tidyInfix    Args((Cell));
  28.  
  29. /* For the purposes of reasonably portable garbage collection, it is
  30.  * necessary to simulate the YACC stack on the Gofer stack to keep
  31.  * track of all intermediate constructs.  The lexical analyser
  32.  * pushes a token onto the stack for each token that is found, with
  33.  * these elements being removed as reduce actions are performed,
  34.  * taking account of look-ahead tokens as described by gcShadow()
  35.  * below.
  36.  *
  37.  * Of the non-terminals used below, only start, topDecl & begin do not leave
  38.  * any values on the Gofer stack.  The same is true for the terminals
  39.  * EVALEX and SCRIPT.  At the end of a successful parse, there should only
  40.  * be one element left on the stack, containing the result of the parse.
  41.  */
  42.  
  43. #define gc0(e)             gcShadow(0,e)
  44. #define gc1(e)             gcShadow(1,e)
  45. #define gc2(e)             gcShadow(2,e)
  46. #define gc3(e)             gcShadow(3,e)
  47. #define gc4(e)             gcShadow(4,e)
  48. #define gc5(e)             gcShadow(5,e)
  49. #define gc6(e)             gcShadow(6,e)
  50. #define gc7(e)             gcShadow(7,e)
  51.  
  52. # define EVALEX 257
  53. # define SCRIPT 258
  54. # define COCO 259
  55. # define INFIXL 260
  56. # define INFIXR 261
  57. # define INFIX 262
  58. # define FUNARROW 263
  59. # define UPTO 264
  60. # define CASEXP 265
  61. # define OF 266
  62. # define IF 267
  63. # define THEN 268
  64. # define ELSE 269
  65. # define WHERE 270
  66. # define TYPE 271
  67. # define DATA 272
  68. # define FROM 273
  69. # define LET 274
  70. # define IN 275
  71. # define VAROP 276
  72. # define VARID 277
  73. # define NUMLIT 278
  74. # define CHARLIT 279
  75. # define STRINGLIT 280
  76. # define REPEAT 281
  77. # define CONOP 282
  78. # define CONID 283
  79. # define TCLASS 284
  80. # define IMPLIES 285
  81. # define TINSTANCE 286
  82. # define DO 287
  83. # define END 288
  84. # define PRIMITIVE 289
  85. # define DEFAULT 290
  86. # define DERIVING 291
  87. # define HIDING 292
  88. # define IMPORT 293
  89. # define INTERFACE 294
  90. # define MODULE 295
  91. # define RENAMING 296
  92. # define TO 297
  93. #define yyclearin yychar = -1
  94. #define yyerrok yyerrflag = 0
  95. extern int yychar;
  96. extern int yyerrflag;
  97. #ifndef YYMAXDEPTH
  98. #define YYMAXDEPTH 150
  99. #endif
  100. #ifndef YYSTYPE
  101. #define YYSTYPE int
  102. #endif
  103. YYSTYPE yylval, yyval;
  104. # define YYERRCODE 256
  105.  
  106. # line 513 "parser.y"
  107.  
  108.  
  109. static Cell local gcShadow(n,e)        /* keep parsed fragments on stack  */
  110. Int  n;
  111. Cell e; {
  112.     /* If a look ahead token is held then the required stack transformation
  113.      * is:
  114.      *   pushed: n               1     0          1     0
  115.      *           x1  |  ...  |  xn  |  la   ===>  e  |  la
  116.      *                                top()            top()
  117.      *
  118.      * Othwerwise, the transformation is:
  119.      *   pushed: n-1             0        0
  120.      *           x1  |  ...  |  xn  ===>  e
  121.      *                         top()     top()
  122.      */
  123.     if (yychar>=0) {
  124.     pushed(n-1) = top();
  125.         pushed(n)   = e;
  126.     }
  127.     else
  128.     pushed(n-1) = e;
  129.     sp -= (n-1);
  130.     return e;
  131. }
  132.  
  133. static Void local syntaxError(s)       /* report on syntax error           */
  134. String s; {
  135.     ERROR(row) "Syntax error in %s (unexpected %s)", s, unexpected()
  136.     EEND;
  137. }
  138.  
  139. static String local unexpected() {    /* find name for unexpected token  */
  140.     static char buffer[100];
  141.     static char *fmt = "%s \"%s\"";
  142.     static char *kwd = "keyword";
  143.     static char *hkw = "(Haskell) keyword";
  144.  
  145.     switch (yychar) {
  146.     case 0           : return "end of input";
  147.  
  148. #define keyword(kw) sprintf(buffer,fmt,kwd,kw); return buffer;
  149.     case INFIXL    : keyword("infixl");
  150.     case INFIXR    : keyword("infixr");
  151.     case INFIX     : keyword("infix");
  152.     case TINSTANCE : keyword("instance");
  153.     case TCLASS    : keyword("class");
  154.     case PRIMITIVE : keyword("primitive");
  155.     case CASEXP    : keyword("case");
  156.     case OF        : keyword("of");
  157.     case DO        : keyword("do");
  158.     case END       : keyword("end");
  159.     case IF        : keyword("if");
  160.     case THEN      : keyword("then");
  161.     case ELSE      : keyword("else");
  162.     case WHERE     : keyword("where");
  163.     case TYPE      : keyword("type");
  164.     case DATA      : keyword("data");
  165.     case LET       : keyword("let");
  166.     case IN        : keyword("in");
  167. #undef keyword
  168.  
  169. #define hasword(kw) sprintf(buffer,fmt,hkw,kw); return buffer;
  170.     case DEFAULT   : hasword("default");
  171.     case DERIVING  : hasword("deriving");
  172.     case HIDING    : hasword("hiding");
  173.     case IMPORT    : hasword("import");
  174.     case INTERFACE : hasword("interface");
  175.     case MODULE    : hasword("module");
  176.     case RENAMING  : hasword("renaming");
  177.     case TO           : hasword("to");
  178. #undef hasword
  179.  
  180.     case FUNARROW  : return "`->'";
  181.     case '='       : return "`='";
  182.     case COCO      : return "`::'";
  183.     case '-'       : return "`-'";
  184.     case ','       : return "comma";
  185.     case '@'       : return "`@'";
  186.     case '('       : return "`('";
  187.     case ')'       : return "`)'";
  188.     case '|'       : return "`|'";
  189.     case ';'       : return "`;'";
  190.     case UPTO      : return "`..'";
  191.     case '['       : return "`['";
  192.     case ']'       : return "`]'";
  193.     case FROM      : return "`<-'";
  194.     case '\\'      : return "backslash (lambda)";
  195.     case '~'       : return "tilde";
  196.     case '`'       : return "backquote";
  197.     case VAROP     :
  198.     case VARID     :
  199.     case CONOP     :
  200.     case CONID     : sprintf(buffer,"symbol \"%s\"",
  201.                  textToStr(textOf(yylval)));
  202.              return buffer;
  203.     case NUMLIT    : return "numeric literal";
  204.     case CHARLIT   : return "character literal";
  205.     case STRINGLIT : return "string literal";
  206.     case IMPLIES   : return "`=>";
  207.     default           : return "token";
  208.     }
  209. }
  210.  
  211. static Cell local checkPrec(p)         /* Check for valid precedence value */
  212. Cell p; {
  213.     if (!isInt(p) || intOf(p)<MIN_PREC || intOf(p)>MAX_PREC) {
  214.         ERROR(row) "Precedence value must be an integer in the range [%d..%d]",
  215.                    MIN_PREC, MAX_PREC
  216.         EEND;
  217.     }
  218.     return p;
  219. }
  220.  
  221. static Void local fixDefn(a,line,p,ops)/* Declare syntax of operators      */
  222. Syntax a;
  223. Cell   line;
  224. Cell   p;
  225. List   ops; {
  226.     Int l = intOf(line);
  227.     a     = mkSyntax(a,intOf(p));
  228.     map2Proc(setSyntax,l,a,ops);
  229. }
  230.  
  231. static Void local setSyntax(line,sy,op)/* set syntax of individ. operator  */
  232. Int    line;
  233. Syntax sy;
  234. Cell   op; {
  235.     addSyntax(line,textOf(op),sy);
  236.     opDefns = cons(op,opDefns);
  237. }
  238.  
  239. #if MAC
  240.        Cell local buildTuple(tup) 
  241. #else
  242. static Cell local buildTuple(tup)      /* build tuple (x1,...,xn) from list*/
  243. #endif
  244. List tup; {                            /* [xn,...,x1]                      */
  245.     Int  n = 0;
  246.     Cell t = tup;
  247.     Cell x;
  248.  
  249.     do {                               /*     .                    .       */
  250.         x      = fst(t);               /*    / \                  / \      */
  251.         fst(t) = snd(t);               /*   xn  .                .   xn    */
  252.         snd(t) = x;                    /*        .    ===>      .          */
  253.         x      = t;                    /*         .            .           */
  254.         t      = fun(x);               /*          .          .            */
  255.         n++;                           /*         / \        / \           */
  256.     } while (nonNull(t));              /*        x1  NIL   (n)  x1         */
  257.     fst(x) = mkTuple(n);
  258.     return tup;
  259. }
  260.  
  261. /* The yacc parser presented above is not sufficiently powerful to
  262.  * determine whether a tuple at the front of a sigType is part of a
  263.  * context:    e.g. (Eq a, Num a) => a -> a -> a
  264.  * or a type:  e.g.  (Tree a, Tree a) -> Tree a
  265.  *
  266.  * Rather than complicate the grammar, both are parsed as tuples of types,
  267.  * using the following checks afterwards to ensure that the correct syntax
  268.  * is used in the case of a tupled context.
  269.  */
  270.  
  271. static List local checkContext(con)    /* validate type class context       */
  272. Type con; {
  273.     if (con==UNIT)            /* allows empty context ()       */
  274.     return NIL;
  275.     else if (whatIs(getHead(con))==TUPLE) {
  276.     List qs = NIL;
  277.  
  278.     while (isAp(con)) {        /* undo work of buildTuple  :-(    */
  279.         Cell temp = fun(con);
  280.         fun(con)  = arg(con);
  281.         arg(con)  = qs;
  282.         qs          = con;
  283.         con       = temp;
  284.         checkClass(hd(qs));
  285.     }
  286.     return qs;
  287.     }
  288.     else                /* single context expression       */
  289.     return singleton(checkClass(con));
  290. }
  291.  
  292. static Cell local checkClass(c)        /* check that type expr is a class */
  293. Cell c; {                /* constrnt of the form C t1 .. tn */
  294.     Cell cn = getHead(c);
  295.  
  296.     if (!isCon(cn))
  297.     syntaxError("class expression");
  298.     else if (argCount<1) {
  299.     ERROR(row) "Class \"%s\" must have at least one argument",
  300.            textToStr(textOf(cn))
  301.     EEND;
  302.     }
  303.     return c;
  304. }
  305.  
  306. /* expressions involving a sequence of two or more infix operator symbols
  307.  * are parsed as elements of type:
  308.  *    InfixExpr ::= [Expr]
  309.  *         |  ap(ap(Operator,InfixExpr),Expr)
  310.  *
  311.  * thus x0 +1 x1 ... +n xn is parsed as: +n (....(+1 [x0] x1)....) xn
  312.  *
  313.  * Once the expression has been completely parsed, this parsed form is
  314.  * `tidied' according to the precedences and associativities declared for
  315.  * each operator symbol.
  316.  *
  317.  * The tidy process uses a `stack' of type:
  318.  *    TidyStack ::= ap(ap(Operator,TidyStack),Expr)
  319.  *         |  NIL
  320.  * when the ith layer of an InfixExpr has been transferred to the stack, the
  321.  * stack is of the form: +i (....(+n NIL xn)....) xi
  322.  *
  323.  * The tidy function is based on a simple shift-reduce parser:
  324.  *
  325.  *  tidy                :: InfixExpr -> TidyStack -> Expr
  326.  *  tidy [m]   ss        = foldl (\x f-> f x) m ss
  327.  *  tidy (m*n) []        = tidy m [(*n)]
  328.  *  tidy (m*n) ((+o):ss)
  329.  *           | amb     = error "Ambiguous"
  330.  *           | shift   = tidy m ((*n):(+o):ss)
  331.  *           | reduce  = tidy (m*(n+o)) ss
  332.  *               where sye     = syntaxOf (*)
  333.  *                 (ae,pe) = sye
  334.  *                 sys     = syntaxOf (+)
  335.  *                 (as,ps) = sys
  336.  *                 amb     = pe==ps && (ae/=as || ae==NON_ASS)
  337.  *                 shift   = pe>ps || (ps==pe && ae==LEFT_ASS)
  338.  *                 reduce  = otherwise
  339.  *
  340.  * N.B. the conditions amb, shift, reduce are NOT mutually exclusive and
  341.  * must be tested in that order.
  342.  *
  343.  * As a concession to efficiency, we lower the number of calls to syntaxOf
  344.  * by keeping track of the values of sye, sys throughout the process.  The
  345.  * value APPLIC is used to indicate that the syntax value is unknown.
  346.  */
  347.  
  348. static Cell local tidyInfix(e)         /* convert InfixExpr to Expr        */
  349. Cell e; {                              /* :: InfixExpr                     */
  350.     Cell   s   = NIL;                  /* :: TidyStack                     */
  351.     Syntax sye = APPLIC;               /* Syntax of op in e (init unknown) */
  352.     Syntax sys = APPLIC;               /* Syntax of op in s (init unknown) */
  353.     Cell   temp;
  354.  
  355.     while (nonNull(tl(e))) {
  356.         if (isNull(s)) {
  357.             s           = e;
  358.             e           = arg(fun(s));
  359.             arg(fun(s)) = NIL;
  360.             sys         = sye;
  361.             sye         = APPLIC;
  362.         }
  363.         else {
  364.             if (sye==APPLIC) {         /* calculate sye (if unknown)       */
  365.                 sye = syntaxOf(textOf(fun(fun(e))));
  366.                 if (sye==APPLIC) sye=DEF_OPSYNTAX;
  367.             }
  368.             if (sys==APPLIC) {         /* calculate sys (if unknown)       */
  369.                 sys = syntaxOf(textOf(fun(fun(s))));
  370.                 if (sys==APPLIC) sys=DEF_OPSYNTAX;
  371.             }
  372.  
  373.             if (precOf(sye)==precOf(sys) &&                      /* amb    */
  374.                    (assocOf(sye)!=assocOf(sys) || assocOf(sye)==NON_ASS)) {
  375.                 ERROR(row) "Ambiguous use of operator \"%s\" with \"%s\"",
  376.                            textToStr(textOf(fun(fun(e)))),
  377.                            textToStr(textOf(fun(fun(s))))
  378.                 EEND;
  379.             }
  380.             else if (precOf(sye)>precOf(sys) ||                  /* shift  */
  381.                        (precOf(sye)==precOf(sys) && assocOf(sye)==LEFT_ASS)) {
  382.                 temp        = arg(fun(e));
  383.                 arg(fun(e)) = s;
  384.                 s           = e;
  385.                 e           = temp;
  386.                 sys         = sye;
  387.                 sye         = APPLIC;
  388.             }
  389.             else {                                               /* reduce */
  390.                 temp        = arg(fun(s));
  391.                 arg(fun(s)) = arg(e);
  392.                 arg(e)      = s;
  393.                 s           = temp;
  394.                 sys         = APPLIC;
  395.                 /* sye unchanged */
  396.             }
  397.         }
  398.     }
  399.  
  400.     e = hd(e);
  401.     while (nonNull(s)) {
  402.         temp        = arg(fun(s));
  403.         arg(fun(s)) = e;
  404.         e           = s;
  405.         s           = temp;
  406.     }
  407.  
  408.     return e;
  409. }
  410.  
  411. /*-------------------------------------------------------------------------*/
  412. int yyexca[] ={
  413. -1, 1,
  414.     0, -1,
  415.     -2, 0,
  416. -1, 27,
  417.     93, 195,
  418.     -2, 0,
  419. -1, 86,
  420.     259, 141,
  421.     44, 141,
  422.     -2, 166,
  423. -1, 95,
  424.     285, 74,
  425.     -2, 73,
  426. -1, 132,
  427.     93, 201,
  428.     -2, 0,
  429. -1, 155,
  430.     285, 74,
  431.     -2, 116,
  432. -1, 241,
  433.     264, 19,
  434.     -2, 41,
  435. -1, 263,
  436.     275, 220,
  437.     288, 220,
  438.     -2, 150,
  439. -1, 266,
  440.     93, 200,
  441.     -2, 0,
  442. -1, 282,
  443.     282, 77,
  444.     -2, 64,
  445.     };
  446. # define YYNPROD 221
  447. # define YYLAST 871
  448. int yyact[]={
  449.  
  450.     18,     6,    21,    93,    84,   358,   329,    95,   115,   352,
  451.    280,     5,   160,   308,   258,   380,   379,   272,   238,    34,
  452.     36,    37,    52,    53,   135,   324,   260,   237,   210,    43,
  453.    225,    62,   170,    86,    85,    70,    68,   398,   110,   261,
  454.    389,   139,    89,   142,   104,   385,   375,   326,   220,   145,
  455.    105,   213,    86,    85,   215,   255,   322,   191,    36,   109,
  456.    362,    38,   235,    40,    47,    91,    91,   133,    90,    90,
  457.    141,    72,   269,   227,   224,   256,   152,   111,   112,   275,
  458.     45,   151,   295,   221,   309,   266,   211,   376,   382,   155,
  459.    155,   157,    39,    86,    85,    71,   201,     4,     2,     3,
  460.    152,   163,   214,   165,   343,   309,   292,   233,   288,   175,
  461.    179,    98,   152,   183,   159,   286,   184,   270,   193,   126,
  462.    187,   188,   152,   182,    92,   192,   343,    55,    51,   153,
  463.    252,    56,   194,   397,   195,    86,    85,   129,   144,   199,
  464.    202,   204,   291,   377,    15,   381,   378,   219,   130,    94,
  465.    140,   159,   169,   149,   114,    48,   289,   320,   181,   207,
  466.    229,   239,   228,   159,   166,   283,   267,   396,   221,   240,
  467.    166,   372,   231,   206,   373,   234,   125,   186,   243,   244,
  468.    121,   189,   355,   230,   374,   320,    86,    85,   293,   371,
  469.    259,   294,   325,   319,    86,    85,    22,   134,    88,   250,
  470.    264,    10,   251,    48,   248,   120,   246,   249,   172,   247,
  471.    207,   240,   156,   185,   119,   207,   307,   146,   147,   278,
  472.    151,   281,   101,   306,   254,   245,   284,   143,   131,   276,
  473.    205,   154,   154,   287,   198,   124,   138,   242,   125,   197,
  474.    122,   296,   290,   123,   317,   273,   168,    27,    11,   216,
  475.    217,    20,   113,   265,   200,   297,   101,    22,   305,   298,
  476.     44,   304,    10,   136,   299,   300,    46,   212,   232,   310,
  477.    303,    86,    85,   102,   240,   312,   202,   314,   315,   136,
  478.    209,   136,    19,    29,   268,    22,   119,    86,   331,    86,
  479.     85,   330,   276,    86,    85,   240,   162,   344,   334,   341,
  480.    335,   342,   212,   361,   259,    22,    61,   102,    27,    11,
  481.     58,   349,    20,    30,   222,   348,   150,   345,   353,   347,
  482.    354,   240,   337,   359,   101,   301,   346,   207,   336,   366,
  483.    316,    72,   281,   311,   363,   360,    27,    30,   327,   356,
  484.     20,    30,   369,    19,   367,   262,    22,    29,   332,    30,
  485.    338,    10,    91,   318,    67,   241,    27,    11,    22,    30,
  486.     20,    45,   218,    30,   313,   277,    86,   331,   132,    29,
  487.    330,    19,   386,   285,   387,   102,   388,   180,   158,   353,
  488.    392,   354,   359,   393,   350,   390,   395,   394,   391,   257,
  489.    207,    19,    35,    49,   137,     9,   364,    27,    11,   222,
  490.    368,    20,    28,   164,   370,   375,    22,   161,   328,    27,
  491.    137,    10,   137,    20,   226,   223,    77,    78,    79,   365,
  492.    302,    14,    63,    13,   190,    22,    87,    75,    76,    42,
  493.     12,   136,    19,    30,    23,    24,    25,    26,    97,    29,
  494.     81,   148,    82,    16,    19,    80,    83,    41,   177,    74,
  495.     69,   176,    66,    96,   384,   383,   357,    27,    11,    99,
  496.    323,    20,   279,   321,    22,   100,   340,   339,   351,    10,
  497.     65,   274,   282,    73,   236,   271,    27,    77,    78,    79,
  498.     20,   208,    14,   101,    13,   136,   136,   167,    75,    76,
  499.    136,    12,    19,    99,    30,    23,    24,    25,    26,   100,
  500.     29,    81,    33,    82,    16,    32,    80,    83,    22,    31,
  501.     74,    19,     1,    10,     0,    27,    11,     0,     0,    20,
  502.      0,     7,    30,    23,    24,    25,    26,     0,    29,     0,
  503.     14,     0,    13,     0,   102,     0,     0,     0,     0,    12,
  504.     97,    59,    30,    23,    24,    25,    26,    60,    29,   136,
  505.     19,    22,    16,     0,     0,     0,    10,     0,     0,    27,
  506.     11,    99,   137,    20,     0,     0,     0,   100,     0,     0,
  507.      0,    14,     0,    13,    22,   196,     0,     0,     0,    10,
  508.     12,   107,     0,    30,    23,    24,    25,    26,     0,    29,
  509.      0,     8,     0,    16,    19,    30,    23,    24,    25,    26,
  510.     22,    29,    27,    11,     0,    10,    20,     0,   101,   173,
  511.      0,     0,   178,     0,    64,     0,   137,   137,     0,     0,
  512.      0,   137,     7,    22,     0,    27,    11,     0,    10,    20,
  513.      0,    14,   103,    13,     0,     0,     0,    19,     0,   106,
  514.     12,     0,     0,    30,    23,    24,    25,    26,     0,    29,
  515.      0,    27,    11,    16,     0,    20,     0,     0,     0,   102,
  516.     19,     0,    30,    23,    24,    25,    26,     0,    29,     0,
  517.      0,     0,    17,     0,    27,    11,     0,     0,    20,     0,
  518.    263,     0,     0,     0,    50,     0,    19,     0,    54,    14,
  519.      0,   116,    57,     0,     0,     0,     0,     0,   117,     0,
  520.      0,    30,    23,    24,    25,    26,   171,    29,     0,    19,
  521.      0,    16,     0,     0,     0,     0,     0,     0,   103,     0,
  522.     99,    54,   108,     0,     7,     0,   100,     0,     0,   118,
  523.      0,     0,     0,    14,     0,   333,     0,     0,   127,   128,
  524.      0,     0,    12,     0,     0,    30,    23,    24,    25,    26,
  525.      0,    29,     0,     0,     0,    16,     0,     0,     0,     0,
  526.      0,     0,     0,     0,     0,     0,     0,     7,     0,     0,
  527.      0,     0,     0,   253,     0,     0,    14,     0,    13,     0,
  528.      0,     0,     0,     0,     0,   203,     0,     0,    30,    23,
  529.     24,    25,    26,     0,    29,     0,     0,     0,    16,    14,
  530.      0,    13,     0,     0,     0,     0,     0,     0,    12,     0,
  531.      0,    30,    23,    24,    25,    26,     7,    29,     0,     0,
  532.      0,    16,     0,     0,    97,    14,     0,   116,     0,     0,
  533.      0,   174,     0,     0,   117,     0,     0,    30,    23,    24,
  534.     25,    26,     0,    29,     0,    99,     0,    16,    14,     0,
  535.     13,   100,     0,     0,     0,     0,     0,    12,     0,     0,
  536.     30,    23,    24,    25,    26,     0,    29,     0,     0,     0,
  537.     16 };
  538. int yypact[]={
  539.  
  540.   -159, -1000,   366,  -237, -1000,  -209,  -167, -1000,   -16,   -16,
  541.    385,   385,     5,   366,   366,   385,     4, -1000,    67,   385,
  542.  -1000, -1000,   265, -1000, -1000, -1000, -1000,   366, -1000, -1000,
  543.  -1000, -1000,   217,  -275, -1000, -1000,  -214, -1000,     1,   182,
  544.    583, -1000, -1000, -1000, -1000,  -233, -1000,   583,   385,   318,
  545.  -1000,   583,  -191,  -188, -1000,   560,   385, -1000,   245,   164,
  546.    139, -1000,   199,   194,   -16,   385,   385,    44,   104,   132,
  547.    138, -1000, -1000, -1000,  -215,  -213,  -213,  -229,  -229,  -229,
  548.     60,   182,   182,   182,   119,    40,    67, -1000,   206, -1000,
  549.  -1000, -1000,   583, -1000,  -253, -1000,   443, -1000, -1000, -1000,
  550.  -1000,   568,   284,   -16,    27,    17, -1000,   366, -1000,   154,
  551.  -1000,   366,    -2,   365, -1000,  -216,   366,    -5, -1000, -1000,
  552.  -1000, -1000, -1000,   366, -1000,   366,   534,   198,   193, -1000,
  553.    366,   511,   366, -1000,   156, -1000, -1000, -1000,   -12, -1000,
  554.     25, -1000, -1000,   -10,   -16, -1000,   -16,   -16,   103, -1000,
  555.  -1000,  -232,    38,  -196,  -255, -1000,  -197, -1000,   182,    36,
  556.  -1000,  -209, -1000,   366,    46, -1000,   366,  -208,    72,   154,
  557.    182,   182, -1000, -1000,   184,   165,   163,   158, -1000,    37,
  558.  -1000,   583, -1000, -1000, -1000,   306,  -220,  -194,   583,  -249,
  559.    424,   366,  -191,   583, -1000, -1000, -1000, -1000, -1000,  -179,
  560.    122, -1000,    11,    -6, -1000, -1000, -1000, -1000,  -279,   205,
  561.     82,   182, -1000,   216,   121, -1000,   121,   121,   182,    36,
  562.  -1000,   173,   164, -1000,    -8,   182, -1000,   -15, -1000, -1000,
  563.  -1000,   112, -1000,   366,    81,   -17,   147, -1000, -1000,  -182,
  564.  -1000,   201, -1000, -1000, -1000, -1000, -1000,   182, -1000, -1000,
  565.  -1000,   182, -1000, -1000, -1000,   366,   366,   361, -1000,   -40,
  566.    366, -1000, -1000, -1000, -1000,   154,   366,   511,   366,   366,
  567.    583, -1000,   204,    82,   152,   113, -1000,   201,  -219,   -99,
  568.  -1000,  -235, -1000,   -16, -1000, -1000,   583, -1000,   583,   468,
  569.    112,   366,   217, -1000,    72, -1000,    86, -1000, -1000, -1000,
  570.  -1000, -1000,   306, -1000,  -209,   -19,   366, -1000, -1000,   583,
  571.  -1000,  -220, -1000, -1000, -1000, -1000,   154,    64,   141, -1000,
  572.     82, -1000,    36, -1000,   216,    20,   182, -1000,   360, -1000,
  573.     70,    40,   154,   366, -1000, -1000,   138, -1000,   148,   130,
  574.    143, -1000,   107,   123, -1000, -1000, -1000, -1000, -1000,  -176,
  575.   -220,   102, -1000,  -281,  -282, -1000, -1000,   101, -1000,  -171,
  576.  -1000, -1000,  -238, -1000, -1000,   306,   182, -1000, -1000,  -191,
  577.  -1000, -1000, -1000,     0, -1000,   139,   366, -1000,    64,    36,
  578.      0,    36,   182,   126,    89, -1000, -1000, -1000, -1000,  -236,
  579.  -1000, -1000, -1000, -1000, -1000, -1000, -1000,  -246, -1000 };
  580. int yypgo[]={
  581.  
  582.      0,   512,     8,    21,   509,   505,    35,    67,   502,    95,
  583.     38,   392,   161,   487,   481,   475,   474,    27,    18,    79,
  584.    471,   468,     9,     0,     2,   467,   466,     4,   150,     7,
  585.    463,   462,   460,   456,     5,     3,    10,   455,   454,   149,
  586.    453,   111,   451,   448,   138,   102,    54,   447,   429,   441,
  587.    153,   129,   415,   414,   408,    59,     6,     1,    12,   407,
  588.    403,   103,   402,   591,   395,   144,   393,   389,   672,   422,
  589.    354,    14,   270,   261,   258,    13,   254,    96,   252,   154,
  590.     24 };
  591. int yyr1[]={
  592.  
  593.      0,     1,     1,     1,     1,     4,     4,     5,     6,     6,
  594.      6,     6,     6,     8,     8,    11,    11,     9,     9,    12,
  595.     12,    13,    13,    16,    16,    17,    17,    14,    14,    14,
  596.     20,    20,    19,    19,    15,    15,    21,    21,    22,    22,
  597.     18,    18,    18,    18,    18,    25,    25,    26,    26,     9,
  598.      9,    28,    28,    28,    30,    30,    33,    33,    34,    34,
  599.     31,    31,    36,    36,    36,    32,    32,    32,    37,    37,
  600.     38,    38,    35,    35,    39,    29,    29,    29,    40,    40,
  601.     41,    41,    41,    41,    41,    41,    41,    41,    41,    42,
  602.     42,    43,    43,     9,     9,     9,    44,    44,    45,    45,
  603.     46,    46,    46,    47,    47,    48,    48,     9,    49,    49,
  604.     49,    50,     9,     9,     9,    51,    51,    52,    52,    53,
  605.     53,    54,    54,    56,    56,    10,    10,    55,    55,    58,
  606.     58,    58,    59,    59,     3,    60,    60,    61,    61,    61,
  607.     27,    27,    23,    23,    62,    62,    24,    24,     2,     2,
  608.      2,    57,    57,    57,    64,    64,    63,    63,    63,    63,
  609.     63,    63,    66,    66,    65,    65,    68,    68,    68,    68,
  610.     68,    68,    68,    68,    68,    68,    68,    68,    68,    68,
  611.     68,    68,    69,    69,    67,    67,    71,    72,    72,    73,
  612.     73,    73,    74,    74,    75,    70,    70,    70,    70,    70,
  613.     70,    70,    70,    76,    76,    77,    77,    77,    77,    63,
  614.     63,    78,    78,    79,    79,    79,    79,     7,     7,    80,
  615.     80 };
  616. int yyr2[]={
  617.  
  618.      0,     5,     7,     5,     3,     7,     3,     3,     7,     7,
  619.      3,     3,     3,     5,     3,    15,     5,     9,     5,     3,
  620.      3,     1,     7,     7,     3,     3,     5,     1,     9,     7,
  621.      1,     3,     7,     3,     1,     9,     7,     3,     7,     7,
  622.      3,     3,     9,     9,     9,     7,     3,     1,     3,    11,
  623.     11,     5,     3,     3,     5,     1,     7,     3,     7,     3,
  624.      7,     3,     7,     3,     3,     1,     5,     9,     1,     3,
  625.      7,     3,     7,     3,     3,     3,     7,     3,     5,     3,
  626.      3,     3,     5,     7,     7,     7,     7,     7,     5,     5,
  627.      3,     7,     7,     7,     7,     7,     3,     1,     7,     3,
  628.      3,     3,     3,     3,     7,     3,     7,     9,     7,     3,
  629.      3,     5,     7,     7,     5,     7,     3,     9,     1,     9,
  630.      1,     7,     3,     7,     5,     7,     5,     7,     3,     5,
  631.      3,     3,     5,     3,     9,     5,     3,     9,    11,     9,
  632.      7,     3,     3,     7,     3,     7,     3,     7,     7,     3,
  633.      3,     3,     7,     3,     7,    11,     5,     9,    13,    13,
  634.     13,     3,     5,     3,     5,     3,     3,     7,     5,     3,
  635.      3,     5,     3,     3,     3,     3,     7,     7,     7,     9,
  636.      9,     9,     7,     7,     7,     3,     5,     5,     3,     3,
  637.      5,     3,     5,     3,     9,     1,     3,     3,     7,     7,
  638.      9,     5,    11,     7,     3,     7,     7,     3,     9,    13,
  639.     11,     7,     3,     7,     3,     5,     9,     5,     3,     3,
  640.      3 };
  641. int yychk[]={
  642.  
  643.  -1000,    -1,   257,   258,   256,    -2,   -57,   256,   -63,   -64,
  644.     45,    92,   274,   267,   265,   -65,   287,   -68,   -23,   126,
  645.     95,   -24,    40,   278,   279,   280,   281,    91,   -62,   283,
  646.    277,    -4,    -5,    -8,   256,   -11,   295,    -3,   270,   259,
  647.    -46,   -47,   -48,    45,   276,    96,   282,   -46,   -65,   -66,
  648.    -68,   123,    -2,    -2,   -68,   123,    64,   -68,    45,   276,
  649.    282,    41,    -2,   -69,   -63,   -47,   -48,   -70,    -2,   -69,
  650.     -6,    -9,   -10,   256,   293,   271,   272,   260,   261,   262,
  651.    289,   284,   286,   290,   -27,   -57,   -23,   -11,   -12,   256,
  652.    283,   280,   123,   -35,   -39,   -29,   -40,   256,   -41,   277,
  653.    283,    40,    91,   -63,   277,   283,   -63,   263,   -68,   -55,
  654.    -10,   268,   266,   -78,   -79,    -2,   267,   274,   -68,    41,
  655.     41,    41,    41,    44,    41,    44,   -46,   -68,   -68,    93,
  656.     44,   124,   264,    -7,    59,   -80,   125,   256,   -12,   256,
  657.    -28,   283,   256,   -28,   -44,   278,   -44,   -44,   -49,   -50,
  658.    256,   -23,    40,   -51,   -39,   -29,   -51,   -29,   259,    44,
  659.    -58,   -59,   256,    61,   -60,   -61,   124,   -13,    40,   -55,
  660.    285,   263,   -41,    41,   263,   -29,   -42,   -43,    44,   -29,
  661.     93,   -46,    96,    96,    -2,    59,    -7,    -2,   123,    -7,
  662.     59,   273,    -2,   123,    -2,    -2,    41,    41,    41,    -2,
  663.    -76,   -77,    -2,   274,    -2,    -9,   -10,   -80,   -14,   292,
  664.     40,    61,   277,    61,   -45,   -46,   -45,   -45,   259,    44,
  665.    280,    45,   276,   -52,   270,   285,   -53,   270,   -35,   -23,
  666.     -3,    -2,   -61,    61,    -2,   270,   -16,   -17,   -18,   -12,
  667.    -23,   283,    -7,   -29,   -29,    41,    41,    44,    41,    44,
  668.     41,    44,    93,   -63,   -10,   275,   269,   -67,   -71,   -57,
  669.    275,   288,   -79,   256,    -2,   -55,   264,    44,   273,    61,
  670.    123,   -15,   296,    40,   -20,   -19,   -18,   283,   -29,   -31,
  671.    -36,   -29,   256,    44,   -29,   -50,   123,   -29,   123,    44,
  672.     -2,    61,   123,    41,    44,   264,    40,   -29,   -29,    -2,
  673.     -2,    -7,    59,   -72,   -73,   -74,   263,   256,   -75,   124,
  674.     -2,    -7,    -2,   -77,    -2,    -2,   -55,    40,   -19,    41,
  675.     44,   -30,   275,   -32,   124,   291,   282,   -46,   -54,   -56,
  676.    -27,   -57,   -55,   267,    -2,    -2,    -6,   -17,   264,   -25,
  677.    -26,   -24,   -27,    40,   -23,   -71,    -3,   -75,    -2,   -57,
  678.     -7,   -21,   -22,   -23,   -24,    41,   -18,   -33,   -34,   -23,
  679.    -36,   283,    40,   -29,    -7,    59,   259,   -58,    -7,    -2,
  680.     -7,    41,    41,    44,    41,   282,   263,    41,    44,   297,
  681.    297,    44,   259,   -37,   -38,   283,   -56,   -29,   -24,    40,
  682.     -2,   -22,   -23,   -24,   -34,   -35,    41,    44,   283 };
  683. int yydef[]={
  684.  
  685.      0,    -2,     0,     0,     4,     1,   149,   150,   151,   153,
  686.      0,     0,     0,     0,     0,   161,     0,   165,   166,     0,
  687.    169,   170,     0,   172,   173,   174,   175,    -2,   142,   146,
  688.    144,     3,     0,     6,     7,    14,     0,     2,     0,     0,
  689.      0,   100,   101,   102,   103,     0,   105,     0,   156,     0,
  690.    163,     0,     0,     0,   164,     0,     0,   168,     0,   103,
  691.    105,   171,     0,     0,   151,     0,     0,     0,   196,   197,
  692.      0,    10,    11,    12,     0,     0,     0,    97,    97,    97,
  693.      0,     0,     0,     0,     0,     0,    -2,    13,    21,    16,
  694.     19,    20,     0,   148,     0,    -2,    75,    77,    79,    80,
  695.     81,     0,     0,   152,     0,     0,   154,     0,   162,     0,
  696.    128,     0,     0,     0,   212,   214,     0,     0,   167,   143,
  697.    145,   147,   176,     0,   177,     0,     0,     0,     0,   178,
  698.      0,     0,    -2,     5,     0,   218,   219,   220,    27,    18,
  699.      0,    52,    53,     0,     0,    96,     0,     0,     0,   109,
  700.    110,     0,     0,   118,     0,    -2,   120,   114,     0,     0,
  701.    126,   130,   131,     0,   133,   136,     0,     0,     0,     0,
  702.      0,     0,    78,    82,     0,     0,     0,     0,    90,     0,
  703.     88,     0,   104,   106,   157,     0,     0,     0,     0,     0,
  704.      0,     0,   215,     0,   183,   182,   179,   180,   181,   183,
  705.    198,   204,   207,     0,   199,     8,     9,   217,    34,     0,
  706.     30,     0,    51,     0,    93,    99,    94,    95,     0,     0,
  707.    111,     0,     0,   112,     0,     0,   113,     0,   125,   140,
  708.    129,   132,   135,     0,     0,     0,     0,    24,    25,     0,
  709.     40,    -2,   134,    72,    76,    83,    84,     0,    85,    89,
  710.     86,     0,    87,   155,   127,     0,     0,     0,   185,     0,
  711.      0,   210,   211,    -2,   213,     0,    -2,     0,     0,     0,
  712.      0,    17,     0,     0,     0,    31,    33,    41,    55,    65,
  713.     61,    63,    -2,     0,   107,   108,     0,   115,     0,     0,
  714.      0,     0,     0,    22,     0,    26,    47,    92,    91,   158,
  715.    159,   160,     0,   186,   188,   189,     0,   191,   193,     0,
  716.    209,   216,   202,   203,   205,   206,     0,     0,     0,    29,
  717.      0,    49,     0,    50,     0,     0,     0,    98,     0,   122,
  718.      0,     0,     0,     0,   139,   137,     0,    23,     0,     0,
  719.      0,    46,    48,     0,   141,   184,   187,   192,   190,     0,
  720.    208,     0,    37,     0,     0,    28,    32,    54,    57,    59,
  721.     60,    66,    68,    62,   117,     0,     0,   124,   119,   138,
  722.     15,    42,    43,     0,    44,     0,     0,    35,     0,     0,
  723.      0,     0,     0,     0,    69,    71,   121,   123,    45,     0,
  724.    194,    36,    38,    39,    56,    58,    67,     0,    70 };
  725. typedef struct { char *t_name; int t_val; } yytoktype;
  726. #ifndef YYDEBUG
  727. #    define YYDEBUG    0    /* don't allow debugging */
  728. #endif
  729.  
  730. #if YYDEBUG
  731.  
  732. yytoktype yytoks[] =
  733. {
  734.     "EVALEX",    257,
  735.     "SCRIPT",    258,
  736.     "=",    61,
  737.     "COCO",    259,
  738.     "INFIXL",    260,
  739.     "INFIXR",    261,
  740.     "INFIX",    262,
  741.     "FUNARROW",    263,
  742.     "-",    45,
  743.     ",",    44,
  744.     "@",    64,
  745.     "(",    40,
  746.     ")",    41,
  747.     "|",    124,
  748.     ";",    59,
  749.     "UPTO",    264,
  750.     "[",    91,
  751.     "]",    93,
  752.     "CASEXP",    265,
  753.     "OF",    266,
  754.     "IF",    267,
  755.     "THEN",    268,
  756.     "ELSE",    269,
  757.     "WHERE",    270,
  758.     "TYPE",    271,
  759.     "DATA",    272,
  760.     "FROM",    273,
  761.     "\\",    92,
  762.     "~",    126,
  763.     "LET",    274,
  764.     "IN",    275,
  765.     "`",    96,
  766.     "VAROP",    276,
  767.     "VARID",    277,
  768.     "NUMLIT",    278,
  769.     "CHARLIT",    279,
  770.     "STRINGLIT",    280,
  771.     "REPEAT",    281,
  772.     "CONOP",    282,
  773.     "CONID",    283,
  774.     "TCLASS",    284,
  775.     "IMPLIES",    285,
  776.     "TINSTANCE",    286,
  777.     "DO",    287,
  778.     "END",    288,
  779.     "PRIMITIVE",    289,
  780.     "DEFAULT",    290,
  781.     "DERIVING",    291,
  782.     "HIDING",    292,
  783.     "IMPORT",    293,
  784.     "INTERFACE",    294,
  785.     "MODULE",    295,
  786.     "RENAMING",    296,
  787.     "TO",    297,
  788.     "-unknown-",    -1    /* ends search */
  789. };
  790.  
  791. char * yyreds[] =
  792. {
  793.     "-no such reduction-",
  794.     "start : EVALEX exp",
  795.     "start : EVALEX exp wherePart",
  796.     "start : SCRIPT topModule",
  797.     "start : error",
  798.     "topModule : begin topDecls close",
  799.     "topModule : modules",
  800.     "begin : error",
  801.     "topDecls : topDecls ';' topDecl",
  802.     "topDecls : topDecls ';' decl",
  803.     "topDecls : topDecl",
  804.     "topDecls : decl",
  805.     "topDecls : error",
  806.     "modules : modules module",
  807.     "modules : module",
  808.     "module : MODULE modid expspec WHERE '{' topDecls close",
  809.     "module : MODULE error",
  810.     "topDecl : IMPORT modid impspec rename",
  811.     "topDecl : IMPORT error",
  812.     "modid : CONID",
  813.     "modid : STRINGLIT",
  814.     "expspec : /* empty */",
  815.     "expspec : '(' exports ')'",
  816.     "exports : exports ',' export",
  817.     "exports : export",
  818.     "export : entity",
  819.     "export : modid UPTO",
  820.     "impspec : /* empty */",
  821.     "impspec : HIDING '(' imports ')'",
  822.     "impspec : '(' imports0 ')'",
  823.     "imports0 : /* empty */",
  824.     "imports0 : imports",
  825.     "imports : imports ',' entity",
  826.     "imports : entity",
  827.     "rename : /* empty */",
  828.     "rename : RENAMING '(' renamings ')'",
  829.     "renamings : renamings ',' renaming",
  830.     "renamings : renaming",
  831.     "renaming : var TO var",
  832.     "renaming : conid TO conid",
  833.     "entity : var",
  834.     "entity : CONID",
  835.     "entity : CONID '(' UPTO ')'",
  836.     "entity : CONID '(' conids ')'",
  837.     "entity : CONID '(' vars0 ')'",
  838.     "conids : conids ',' conid",
  839.     "conids : conid",
  840.     "vars0 : /* empty */",
  841.     "vars0 : vars",
  842.     "topDecl : TYPE typeLhs '=' type invars",
  843.     "topDecl : DATA typeLhs '=' constrs deriving",
  844.     "typeLhs : typeLhs VARID",
  845.     "typeLhs : CONID",
  846.     "typeLhs : error",
  847.     "invars : IN rsvars",
  848.     "invars : /* empty */",
  849.     "rsvars : rsvars ',' rsvar",
  850.     "rsvars : rsvar",
  851.     "rsvar : var COCO sigType",
  852.     "rsvar : var",
  853.     "constrs : constrs '|' constr",
  854.     "constrs : constr",
  855.     "constr : type CONOP type",
  856.     "constr : type",
  857.     "constr : error",
  858.     "deriving : /* empty */",
  859.     "deriving : DERIVING CONID",
  860.     "deriving : DERIVING '(' derivs0 ')'",
  861.     "derivs0 : /* empty */",
  862.     "derivs0 : derivs",
  863.     "derivs : derivs ',' CONID",
  864.     "derivs : CONID",
  865.     "sigType : context IMPLIES type",
  866.     "sigType : type",
  867.     "context : type",
  868.     "type : ctype",
  869.     "type : ctype FUNARROW type",
  870.     "type : error",
  871.     "ctype : ctype atype",
  872.     "ctype : atype",
  873.     "atype : VARID",
  874.     "atype : CONID",
  875.     "atype : '(' ')'",
  876.     "atype : '(' FUNARROW ')'",
  877.     "atype : '(' type ')'",
  878.     "atype : '(' tupCommas ')'",
  879.     "atype : '(' typeTuple ')'",
  880.     "atype : '[' type ']'",
  881.     "atype : '[' ']'",
  882.     "tupCommas : tupCommas ','",
  883.     "tupCommas : ','",
  884.     "typeTuple : typeTuple ',' type",
  885.     "typeTuple : type ',' type",
  886.     "topDecl : INFIXL optdigit ops",
  887.     "topDecl : INFIXR optdigit ops",
  888.     "topDecl : INFIX optdigit ops",
  889.     "optdigit : NUMLIT",
  890.     "optdigit : /* empty */",
  891.     "ops : ops ',' op",
  892.     "ops : op",
  893.     "op : varop",
  894.     "op : conop",
  895.     "op : '-'",
  896.     "varop : VAROP",
  897.     "varop : '`' VARID '`'",
  898.     "conop : CONOP",
  899.     "conop : '`' CONID '`'",
  900.     "topDecl : PRIMITIVE prims COCO type",
  901.     "prims : prims ',' prim",
  902.     "prims : prim",
  903.     "prims : error",
  904.     "prim : var STRINGLIT",
  905.     "topDecl : TCLASS classHead classBody",
  906.     "topDecl : TINSTANCE classHead instBody",
  907.     "topDecl : DEFAULT type",
  908.     "classHead : context IMPLIES type",
  909.     "classHead : type",
  910.     "classBody : WHERE '{' csigdecls close",
  911.     "classBody : /* empty */",
  912.     "instBody : WHERE '{' decls close",
  913.     "instBody : /* empty */",
  914.     "csigdecls : csigdecls ';' csigdecl",
  915.     "csigdecls : csigdecl",
  916.     "csigdecl : vars COCO type",
  917.     "csigdecl : opExp rhs",
  918.     "decl : vars COCO sigType",
  919.     "decl : opExp rhs",
  920.     "decls : decls ';' decl",
  921.     "decls : decl",
  922.     "rhs : rhs1 wherePart",
  923.     "rhs : rhs1",
  924.     "rhs : error",
  925.     "rhs1 : '=' exp",
  926.     "rhs1 : gdefs",
  927.     "wherePart : WHERE '{' decls close",
  928.     "gdefs : gdefs gdef",
  929.     "gdefs : gdef",
  930.     "gdef : '|' exp '=' exp",
  931.     "gdef : '=' exp ',' IF exp",
  932.     "gdef : '=' exp ',' exp",
  933.     "vars : vars ',' var",
  934.     "vars : var",
  935.     "var : varid",
  936.     "var : '(' '-' ')'",
  937.     "varid : VARID",
  938.     "varid : '(' VAROP ')'",
  939.     "conid : CONID",
  940.     "conid : '(' CONOP ')'",
  941.     "exp : opExp COCO sigType",
  942.     "exp : opExp",
  943.     "exp : error",
  944.     "opExp : pfxExp",
  945.     "opExp : pfxExp op pfxExp",
  946.     "opExp : opExp0",
  947.     "opExp0 : opExp0 op pfxExp",
  948.     "opExp0 : pfxExp op pfxExp op pfxExp",
  949.     "pfxExp : '-' appExp",
  950.     "pfxExp : '\\' pats FUNARROW exp",
  951.     "pfxExp : LET '{' decls close IN exp",
  952.     "pfxExp : IF exp THEN exp ELSE exp",
  953.     "pfxExp : CASEXP exp OF '{' alts close",
  954.     "pfxExp : appExp",
  955.     "pats : pats atomic",
  956.     "pats : atomic",
  957.     "appExp : appExp atomic",
  958.     "appExp : atomic",
  959.     "atomic : var",
  960.     "atomic : var '@' atomic",
  961.     "atomic : '~' atomic",
  962.     "atomic : '_'",
  963.     "atomic : conid",
  964.     "atomic : '(' ')'",
  965.     "atomic : NUMLIT",
  966.     "atomic : CHARLIT",
  967.     "atomic : STRINGLIT",
  968.     "atomic : REPEAT",
  969.     "atomic : '(' exp ')'",
  970.     "atomic : '(' exps2 ')'",
  971.     "atomic : '[' list ']'",
  972.     "atomic : '(' pfxExp op ')'",
  973.     "atomic : '(' varop atomic ')'",
  974.     "atomic : '(' conop atomic ')'",
  975.     "exps2 : exps2 ',' exp",
  976.     "exps2 : exp ',' exp",
  977.     "alts : alts ';' alt",
  978.     "alts : alt",
  979.     "alt : opExp altRhs",
  980.     "altRhs : altRhs1 wherePart",
  981.     "altRhs : altRhs1",
  982.     "altRhs1 : guardAlts",
  983.     "altRhs1 : FUNARROW exp",
  984.     "altRhs1 : error",
  985.     "guardAlts : guardAlts guardAlt",
  986.     "guardAlts : guardAlt",
  987.     "guardAlt : '|' opExp FUNARROW exp",
  988.     "list : /* empty */",
  989.     "list : exp",
  990.     "list : exps2",
  991.     "list : exp '|' quals",
  992.     "list : exp UPTO exp",
  993.     "list : exp ',' exp UPTO",
  994.     "list : exp UPTO",
  995.     "list : exp ',' exp UPTO exp",
  996.     "quals : quals ',' qual",
  997.     "quals : qual",
  998.     "qual : exp FROM exp",
  999.     "qual : exp '=' exp",
  1000.     "qual : exp",
  1001.     "qual : LET '{' decls close",
  1002.     "pfxExp : DO '{' dquals close IN exp",
  1003.     "pfxExp : DO '{' dquals close END",
  1004.     "dquals : dquals ';' dqual",
  1005.     "dquals : dqual",
  1006.     "dqual : exp FROM exp",
  1007.     "dqual : exp",
  1008.     "dqual : IF exp",
  1009.     "dqual : LET '{' decls close",
  1010.     "close : ';' close1",
  1011.     "close : close1",
  1012.     "close1 : '}'",
  1013.     "close1 : error",
  1014. };
  1015. #endif /* YYDEBUG */
  1016. #line 1 "/usr/lib/yaccpar"
  1017. /*    @(#)yaccpar 1.10 89/04/04 SMI; from S5R3 1.10    */
  1018.  
  1019. /*
  1020. ** Skeleton parser driver for yacc output
  1021. */
  1022.  
  1023. /*
  1024. ** yacc user known macros and defines
  1025. */
  1026. #define YYERROR        goto yyerrlab
  1027. #define YYACCEPT    { free(yys); free(yyv); return(0); }
  1028. #define YYABORT        { free(yys); free(yyv); return(1); }
  1029. #define YYBACKUP( newtoken, newvalue )\
  1030. {\
  1031.     if ( yychar >= 0 || ( yyr2[ yytmp ] >> 1 ) != 1 )\
  1032.     {\
  1033.         yyerror( "syntax error - cannot backup" );\
  1034.         goto yyerrlab;\
  1035.     }\
  1036.     yychar = newtoken;\
  1037.     yystate = *yyps;\
  1038.     yylval = newvalue;\
  1039.     goto yynewstate;\
  1040. }
  1041. #define YYRECOVERING()    (!!yyerrflag)
  1042. #ifndef YYDEBUG
  1043. #    define YYDEBUG    1    /* make debugging available */
  1044. #endif
  1045.  
  1046. /*
  1047. ** user known globals
  1048. */
  1049. int yydebug;            /* set to 1 to get debugging */
  1050.  
  1051. /*
  1052. ** driver internal defines
  1053. */
  1054. #define YYFLAG        (-1000)
  1055.  
  1056. /*
  1057. ** static variables used by the parser
  1058. */
  1059. static YYSTYPE *yyv;            /* value stack */
  1060. static int *yys;            /* state stack */
  1061.  
  1062. static YYSTYPE *yypv;            /* top of value stack */
  1063. static int *yyps;            /* top of state stack */
  1064.  
  1065. static int yystate;            /* current state */
  1066. static int yytmp;            /* extra var (lasts between blocks) */
  1067.  
  1068. int yynerrs;            /* number of errors */
  1069.  
  1070. int yyerrflag;            /* error recovery flag */
  1071. int yychar;            /* current input token number */
  1072.  
  1073.  
  1074. /*
  1075. ** yyparse - return 0 if worked, 1 if syntax error not recovered from
  1076. */
  1077. int
  1078. yyparse()
  1079. {
  1080.     register YYSTYPE *yypvt;    /* top of value stack for $vars */
  1081.     unsigned yymaxdepth = YYMAXDEPTH;
  1082.  
  1083.     /*
  1084.     ** Initialize externals - yyparse may be called more than once
  1085.     */
  1086.     yyv = (YYSTYPE*)malloc(yymaxdepth*sizeof(YYSTYPE));
  1087.     yys = (int*)malloc(yymaxdepth*sizeof(int));
  1088.     if (!yyv || !yys)
  1089.     {
  1090.         yyerror( "out of memory" );
  1091.         return(1);
  1092.     }
  1093.     yypv = &yyv[-1];
  1094.     yyps = &yys[-1];
  1095.     yystate = 0;
  1096.     yytmp = 0;
  1097.     yynerrs = 0;
  1098.     yyerrflag = 0;
  1099.     yychar = -1;
  1100.  
  1101.     goto yystack;
  1102.     {
  1103.         register YYSTYPE *yy_pv;    /* top of value stack */
  1104.         register int *yy_ps;        /* top of state stack */
  1105.         register int yy_state;        /* current state */
  1106.         register int  yy_n;        /* internal state number info */
  1107.  
  1108.         /*
  1109.         ** get globals into registers.
  1110.         ** branch to here only if YYBACKUP was called.
  1111.         */
  1112.     yynewstate:
  1113.         yy_pv = yypv;
  1114.         yy_ps = yyps;
  1115.         yy_state = yystate;
  1116.         goto yy_newstate;
  1117.  
  1118.         /*
  1119.         ** get globals into registers.
  1120.         ** either we just started, or we just finished a reduction
  1121.         */
  1122.     yystack:
  1123.         yy_pv = yypv;
  1124.         yy_ps = yyps;
  1125.         yy_state = yystate;
  1126.  
  1127.         /*
  1128.         ** top of for (;;) loop while no reductions done
  1129.         */
  1130.     yy_stack:
  1131.         /*
  1132.         ** put a state and value onto the stacks
  1133.         */
  1134. #if YYDEBUG
  1135.         /*
  1136.         ** if debugging, look up token value in list of value vs.
  1137.         ** name pairs.  0 and negative (-1) are special values.
  1138.         ** Note: linear search is used since time is not a real
  1139.         ** consideration while debugging.
  1140.         */
  1141.         if ( yydebug )
  1142.         {
  1143.             register int yy_i;
  1144.  
  1145.             (void)printf( "State %d, token ", yy_state );
  1146.             if ( yychar == 0 )
  1147.                 (void)printf( "end-of-file\n" );
  1148.             else if ( yychar < 0 )
  1149.                 (void)printf( "-none-\n" );
  1150.             else
  1151.             {
  1152.                 for ( yy_i = 0; yytoks[yy_i].t_val >= 0;
  1153.                     yy_i++ )
  1154.                 {
  1155.                     if ( yytoks[yy_i].t_val == yychar )
  1156.                         break;
  1157.                 }
  1158.                 (void)printf( "%s\n", yytoks[yy_i].t_name );
  1159.             }
  1160.         }
  1161. #endif /* YYDEBUG */
  1162.         if ( ++yy_ps >= &yys[ yymaxdepth ] )    /* room on stack? */
  1163.         {
  1164.             /*
  1165.             ** reallocate and recover.  Note that pointers
  1166.             ** have to be reset, or bad things will happen
  1167.             */
  1168.             int yyps_index = (yy_ps - yys);
  1169.             int yypv_index = (yy_pv - yyv);
  1170.             int yypvt_index = (yypvt - yyv);
  1171.             yymaxdepth += YYMAXDEPTH;
  1172.             yyv = (YYSTYPE*)realloc((char*)yyv,
  1173.                 yymaxdepth * sizeof(YYSTYPE));
  1174.             yys = (int*)realloc((char*)yys,
  1175.                 yymaxdepth * sizeof(int));
  1176.             if (!yyv || !yys)
  1177.             {
  1178.                 yyerror( "yacc stack overflow" );
  1179.                 return(1);
  1180.             }
  1181.             yy_ps = yys + yyps_index;
  1182.             yy_pv = yyv + yypv_index;
  1183.             yypvt = yyv + yypvt_index;
  1184.         }
  1185.         *yy_ps = yy_state;
  1186.         *++yy_pv = yyval;
  1187.  
  1188.         /*
  1189.         ** we have a new state - find out what to do
  1190.         */
  1191.     yy_newstate:
  1192.         if ( ( yy_n = yypact[ yy_state ] ) <= YYFLAG )
  1193.             goto yydefault;        /* simple state */
  1194. #if YYDEBUG
  1195.         /*
  1196.         ** if debugging, need to mark whether new token grabbed
  1197.         */
  1198.         yytmp = yychar < 0;
  1199. #endif
  1200.         if ( ( yychar < 0 ) && ( ( yychar = yylex() ) < 0 ) )
  1201.             yychar = 0;        /* reached EOF */
  1202. #if YYDEBUG
  1203.         if ( yydebug && yytmp )
  1204.         {
  1205.             register int yy_i;
  1206.  
  1207.             (void)printf( "Received token " );
  1208.             if ( yychar == 0 )
  1209.                 (void)printf( "end-of-file\n" );
  1210.             else if ( yychar < 0 )
  1211.                 (void)printf( "-none-\n" );
  1212.             else
  1213.             {
  1214.                 for ( yy_i = 0; yytoks[yy_i].t_val >= 0;
  1215.                     yy_i++ )
  1216.                 {
  1217.                     if ( yytoks[yy_i].t_val == yychar )
  1218.                         break;
  1219.                 }
  1220.                 (void)printf( "%s\n", yytoks[yy_i].t_name );
  1221.             }
  1222.         }
  1223. #endif /* YYDEBUG */
  1224.         if ( ( ( yy_n += yychar ) < 0 ) || ( yy_n >= YYLAST ) )
  1225.             goto yydefault;
  1226.         if ( yychk[ yy_n = yyact[ yy_n ] ] == yychar )    /*valid shift*/
  1227.         {
  1228.             yychar = -1;
  1229.             yyval = yylval;
  1230.             yy_state = yy_n;
  1231.             if ( yyerrflag > 0 )
  1232.                 yyerrflag--;
  1233.             goto yy_stack;
  1234.         }
  1235.  
  1236.     yydefault:
  1237.         if ( ( yy_n = yydef[ yy_state ] ) == -2 )
  1238.         {
  1239. #if YYDEBUG
  1240.             yytmp = yychar < 0;
  1241. #endif
  1242.             if ( ( yychar < 0 ) && ( ( yychar = yylex() ) < 0 ) )
  1243.                 yychar = 0;        /* reached EOF */
  1244. #if YYDEBUG
  1245.             if ( yydebug && yytmp )
  1246.             {
  1247.                 register int yy_i;
  1248.  
  1249.                 (void)printf( "Received token " );
  1250.                 if ( yychar == 0 )
  1251.                     (void)printf( "end-of-file\n" );
  1252.                 else if ( yychar < 0 )
  1253.                     (void)printf( "-none-\n" );
  1254.                 else
  1255.                 {
  1256.                     for ( yy_i = 0;
  1257.                         yytoks[yy_i].t_val >= 0;
  1258.                         yy_i++ )
  1259.                     {
  1260.                         if ( yytoks[yy_i].t_val
  1261.                             == yychar )
  1262.                         {
  1263.                             break;
  1264.                         }
  1265.                     }
  1266.                     (void)printf( "%s\n", yytoks[yy_i].t_name );
  1267.                 }
  1268.             }
  1269. #endif /* YYDEBUG */
  1270.             /*
  1271.             ** look through exception table
  1272.             */
  1273.             {
  1274.                 register int *yyxi = yyexca;
  1275.  
  1276.                 while ( ( *yyxi != -1 ) ||
  1277.                     ( yyxi[1] != yy_state ) )
  1278.                 {
  1279.                     yyxi += 2;
  1280.                 }
  1281.                 while ( ( *(yyxi += 2) >= 0 ) &&
  1282.                     ( *yyxi != yychar ) )
  1283.                     ;
  1284.                 if ( ( yy_n = yyxi[1] ) < 0 )
  1285.                     YYACCEPT;
  1286.             }
  1287.         }
  1288.  
  1289.         /*
  1290.         ** check for syntax error
  1291.         */
  1292.         if ( yy_n == 0 )    /* have an error */
  1293.         {
  1294.             /* no worry about speed here! */
  1295.             switch ( yyerrflag )
  1296.             {
  1297.             case 0:        /* new error */
  1298.                 yyerror( "syntax error" );
  1299.                 goto skip_init;
  1300.             yyerrlab:
  1301.                 /*
  1302.                 ** get globals into registers.
  1303.                 ** we have a user generated syntax type error
  1304.                 */
  1305.                 yy_pv = yypv;
  1306.                 yy_ps = yyps;
  1307.                 yy_state = yystate;
  1308.                 yynerrs++;
  1309.             skip_init:
  1310.             case 1:
  1311.             case 2:        /* incompletely recovered error */
  1312.                     /* try again... */
  1313.                 yyerrflag = 3;
  1314.                 /*
  1315.                 ** find state where "error" is a legal
  1316.                 ** shift action
  1317.                 */
  1318.                 while ( yy_ps >= yys )
  1319.                 {
  1320.                     yy_n = yypact[ *yy_ps ] + YYERRCODE;
  1321.                     if ( yy_n >= 0 && yy_n < YYLAST &&
  1322.                         yychk[yyact[yy_n]] == YYERRCODE)                    {
  1323.                         /*
  1324.                         ** simulate shift of "error"
  1325.                         */
  1326.                         yy_state = yyact[ yy_n ];
  1327.                         goto yy_stack;
  1328.                     }
  1329.                     /*
  1330.                     ** current state has no shift on
  1331.                     ** "error", pop stack
  1332.                     */
  1333. #if YYDEBUG
  1334. #    define _POP_ "Error recovery pops state %d, uncovers state %d\n"
  1335.                     if ( yydebug )
  1336.                         (void)printf( _POP_, *yy_ps,
  1337.                             yy_ps[-1] );
  1338. #    undef _POP_
  1339. #endif
  1340.                     yy_ps--;
  1341.                     yy_pv--;
  1342.                 }
  1343.                 /*
  1344.                 ** there is no state on stack with "error" as
  1345.                 ** a valid shift.  give up.
  1346.                 */
  1347.                 YYABORT;
  1348.             case 3:        /* no shift yet; eat a token */
  1349. #if YYDEBUG
  1350.                 /*
  1351.                 ** if debugging, look up token in list of
  1352.                 ** pairs.  0 and negative shouldn't occur,
  1353.                 ** but since timing doesn't matter when
  1354.                 ** debugging, it doesn't hurt to leave the
  1355.                 ** tests here.
  1356.                 */
  1357.                 if ( yydebug )
  1358.                 {
  1359.                     register int yy_i;
  1360.  
  1361.                     (void)printf( "Error recovery discards " );
  1362.                     if ( yychar == 0 )
  1363.                         (void)printf( "token end-of-file\n" );
  1364.                     else if ( yychar < 0 )
  1365.                         (void)printf( "token -none-\n" );
  1366.                     else
  1367.                     {
  1368.                         for ( yy_i = 0;
  1369.                             yytoks[yy_i].t_val >= 0;
  1370.                             yy_i++ )
  1371.                         {
  1372.                             if ( yytoks[yy_i].t_val
  1373.                                 == yychar )
  1374.                             {
  1375.                                 break;
  1376.                             }
  1377.                         }
  1378.                         (void)printf( "token %s\n",
  1379.                             yytoks[yy_i].t_name );
  1380.                     }
  1381.                 }
  1382. #endif /* YYDEBUG */
  1383.                 if ( yychar == 0 )    /* reached EOF. quit */
  1384.                     YYABORT;
  1385.                 yychar = -1;
  1386.                 goto yy_newstate;
  1387.             }
  1388.         }/* end if ( yy_n == 0 ) */
  1389.         /*
  1390.         ** reduction by production yy_n
  1391.         ** put stack tops, etc. so things right after switch
  1392.         */
  1393. #if YYDEBUG
  1394.         /*
  1395.         ** if debugging, print the string that is the user's
  1396.         ** specification of the reduction which is just about
  1397.         ** to be done.
  1398.         */
  1399.         if ( yydebug )
  1400.             (void)printf( "Reduce by (%d) \"%s\"\n",
  1401.                 yy_n, yyreds[ yy_n ] );
  1402. #endif
  1403.         yytmp = yy_n;            /* value to switch over */
  1404.         yypvt = yy_pv;            /* $vars top of value stack */
  1405.         /*
  1406.         ** Look in goto table for next state
  1407.         ** Sorry about using yy_state here as temporary
  1408.         ** register variable, but why not, if it works...
  1409.         ** If yyr2[ yy_n ] doesn't have the low order bit
  1410.         ** set, then there is no action to be done for
  1411.         ** this reduction.  So, no saving & unsaving of
  1412.         ** registers done.  The only difference between the
  1413.         ** code just after the if and the body of the if is
  1414.         ** the goto yy_stack in the body.  This way the test
  1415.         ** can be made before the choice of what to do is needed.
  1416.         */
  1417.         {
  1418.             /* length of production doubled with extra bit */
  1419.             register int yy_len = yyr2[ yy_n ];
  1420.  
  1421.             if ( !( yy_len & 01 ) )
  1422.             {
  1423.                 yy_len >>= 1;
  1424.                 yyval = ( yy_pv -= yy_len )[1];    /* $$ = $1 */
  1425.                 yy_state = yypgo[ yy_n = yyr1[ yy_n ] ] +
  1426.                     *( yy_ps -= yy_len ) + 1;
  1427.                 if ( yy_state >= YYLAST ||
  1428.                     yychk[ yy_state =
  1429.                     yyact[ yy_state ] ] != -yy_n )
  1430.                 {
  1431.                     yy_state = yyact[ yypgo[ yy_n ] ];
  1432.                 }
  1433.                 goto yy_stack;
  1434.             }
  1435.             yy_len >>= 1;
  1436.             yyval = ( yy_pv -= yy_len )[1];    /* $$ = $1 */
  1437.             yy_state = yypgo[ yy_n = yyr1[ yy_n ] ] +
  1438.                 *( yy_ps -= yy_len ) + 1;
  1439.             if ( yy_state >= YYLAST ||
  1440.                 yychk[ yy_state = yyact[ yy_state ] ] != -yy_n )
  1441.             {
  1442.                 yy_state = yyact[ yypgo[ yy_n ] ];
  1443.             }
  1444.         }
  1445.                     /* save until reenter driver code */
  1446.         yystate = yy_state;
  1447.         yyps = yy_ps;
  1448.         yypv = yy_pv;
  1449.     }
  1450.     /*
  1451.     ** code supplied by user is placed in this switch
  1452.     */
  1453.     switch( yytmp )
  1454.     {
  1455.         
  1456. case 1:
  1457. # line 88 "parser.y"
  1458. {inputExpr = yypvt[-0];        sp-=1;} break;
  1459. case 2:
  1460. # line 89 "parser.y"
  1461. {inputExpr = letrec(yypvt[-0],yypvt[-1]); sp-=2;} break;
  1462. case 3:
  1463. # line 90 "parser.y"
  1464. {valDefns  = yypvt[-0];        sp-=1;} break;
  1465. case 4:
  1466. # line 91 "parser.y"
  1467. {syntaxError("input");} break;
  1468. case 5:
  1469. # line 104 "parser.y"
  1470. {yyval = gc2(yypvt[-1]);} break;
  1471. case 6:
  1472. # line 105 "parser.y"
  1473. {yyval = yypvt[-0];} break;
  1474. case 7:
  1475. # line 107 "parser.y"
  1476. {yyerrok; goOffside(startColumn);} break;
  1477. case 8:
  1478. # line 109 "parser.y"
  1479. {yyval = gc2(yypvt[-2]);} break;
  1480. case 9:
  1481. # line 110 "parser.y"
  1482. {yyval = gc3(cons(yypvt[-0],yypvt[-2]));} break;
  1483. case 10:
  1484. # line 111 "parser.y"
  1485. {yyval = gc0(NIL);} break;
  1486. case 11:
  1487. # line 112 "parser.y"
  1488. {yyval = gc1(cons(yypvt[-0],NIL));} break;
  1489. case 12:
  1490. # line 113 "parser.y"
  1491. {syntaxError("definition");} break;
  1492. case 13:
  1493. # line 115 "parser.y"
  1494. {yyval = gc2(appendOnto(yypvt[-0],yypvt[-1]));} break;
  1495. case 14:
  1496. # line 116 "parser.y"
  1497. {yyval = yypvt[-0];} break;
  1498. case 15:
  1499. # line 119 "parser.y"
  1500. {yyval = gc7(yypvt[-1]);} break;
  1501. case 16:
  1502. # line 120 "parser.y"
  1503. {syntaxError("module definition");} break;
  1504. case 17:
  1505. # line 122 "parser.y"
  1506. {sp-=4;} break;
  1507. case 18:
  1508. # line 123 "parser.y"
  1509. {syntaxError("import declaration");} break;
  1510. case 19:
  1511. # line 125 "parser.y"
  1512. {yyval = yypvt[-0];} break;
  1513. case 20:
  1514. # line 126 "parser.y"
  1515. {yyval = yypvt[-0];} break;
  1516. case 21:
  1517. # line 128 "parser.y"
  1518. {yyval = gc0(NIL);} break;
  1519. case 22:
  1520. # line 129 "parser.y"
  1521. {yyval = gc3(NIL);} break;
  1522. case 23:
  1523. # line 131 "parser.y"
  1524. {yyval = gc3(NIL);} break;
  1525. case 24:
  1526. # line 132 "parser.y"
  1527. {yyval = yypvt[-0];} break;
  1528. case 25:
  1529. # line 134 "parser.y"
  1530. {yyval = yypvt[-0];} break;
  1531. case 26:
  1532. # line 135 "parser.y"
  1533. {yyval = gc2(NIL);} break;
  1534. case 27:
  1535. # line 137 "parser.y"
  1536. {yyval = gc0(NIL);} break;
  1537. case 28:
  1538. # line 138 "parser.y"
  1539. {yyval = gc4(NIL);} break;
  1540. case 29:
  1541. # line 139 "parser.y"
  1542. {yyval = gc3(NIL);} break;
  1543. case 30:
  1544. # line 141 "parser.y"
  1545. {yyval = gc0(NIL);} break;
  1546. case 31:
  1547. # line 142 "parser.y"
  1548. {yyval = yypvt[-0];} break;
  1549. case 32:
  1550. # line 144 "parser.y"
  1551. {yyval = gc3(NIL);} break;
  1552. case 33:
  1553. # line 145 "parser.y"
  1554. {yyval = yypvt[-0];} break;
  1555. case 34:
  1556. # line 147 "parser.y"
  1557. {yyval = gc0(NIL);} break;
  1558. case 35:
  1559. # line 148 "parser.y"
  1560. {yyval = gc4(NIL);} break;
  1561. case 36:
  1562. # line 150 "parser.y"
  1563. {yyval = gc3(NIL);} break;
  1564. case 37:
  1565. # line 151 "parser.y"
  1566. {yyval = yypvt[-0];} break;
  1567. case 38:
  1568. # line 153 "parser.y"
  1569. {yyval = gc3(NIL);} break;
  1570. case 39:
  1571. # line 154 "parser.y"
  1572. {yyval = gc3(NIL);} break;
  1573. case 40:
  1574. # line 156 "parser.y"
  1575. {yyval = yypvt[-0];} break;
  1576. case 41:
  1577. # line 157 "parser.y"
  1578. {yyval = yypvt[-0];} break;
  1579. case 42:
  1580. # line 158 "parser.y"
  1581. {yyval = gc4(NIL);} break;
  1582. case 43:
  1583. # line 159 "parser.y"
  1584. {yyval = gc4(NIL);} break;
  1585. case 44:
  1586. # line 160 "parser.y"
  1587. {yyval = gc4(NIL);} break;
  1588. case 45:
  1589. # line 162 "parser.y"
  1590. {yyval = gc3(NIL);} break;
  1591. case 46:
  1592. # line 163 "parser.y"
  1593. {yyval = yypvt[-0];} break;
  1594. case 47:
  1595. # line 165 "parser.y"
  1596. {yyval = gc0(NIL);} break;
  1597. case 48:
  1598. # line 166 "parser.y"
  1599. {yyval = yypvt[-0];} break;
  1600. case 49:
  1601. # line 171 "parser.y"
  1602. {defTycon(5,yypvt[-2],yypvt[-3],yypvt[-1],yypvt[-0]);} break;
  1603. case 50:
  1604. # line 173 "parser.y"
  1605. {defTycon(5,yypvt[-2],yypvt[-3],rev(yypvt[-1]),DATATYPE);} break;
  1606. case 51:
  1607. # line 175 "parser.y"
  1608. {yyval = gc2(ap(yypvt[-1],yypvt[-0]));} break;
  1609. case 52:
  1610. # line 176 "parser.y"
  1611. {yyval = yypvt[-0];} break;
  1612. case 53:
  1613. # line 177 "parser.y"
  1614. {syntaxError("type defn lhs");} break;
  1615. case 54:
  1616. # line 179 "parser.y"
  1617. {yyval = gc2(yypvt[-0]);} break;
  1618. case 55:
  1619. # line 180 "parser.y"
  1620. {yyval = gc0(SYNONYM);} break;
  1621. case 56:
  1622. # line 182 "parser.y"
  1623. {yyval = gc3(cons(yypvt[-0],yypvt[-2]));} break;
  1624. case 57:
  1625. # line 183 "parser.y"
  1626. {yyval = gc1(cons(yypvt[-0],NIL));} break;
  1627. case 58:
  1628. # line 185 "parser.y"
  1629. {yyval = gc3(sigdecl(yypvt[-1],singleton(yypvt[-2]),
  1630.                                  yypvt[-0]));} break;
  1631. case 59:
  1632. # line 187 "parser.y"
  1633. {yyval = yypvt[-0];} break;
  1634. case 60:
  1635. # line 189 "parser.y"
  1636. {yyval = gc3(cons(yypvt[-0],yypvt[-2]));} break;
  1637. case 61:
  1638. # line 190 "parser.y"
  1639. {yyval = gc1(cons(yypvt[-0],NIL));} break;
  1640. case 62:
  1641. # line 192 "parser.y"
  1642. {yyval = gc3(ap(ap(yypvt[-1],yypvt[-2]),yypvt[-0]));} break;
  1643. case 63:
  1644. # line 193 "parser.y"
  1645. {if (!isCon(getHead(yypvt[-0])))
  1646.                          syntaxError("data constructor");
  1647.                      yyval = yypvt[-0];} break;
  1648. case 64:
  1649. # line 196 "parser.y"
  1650. {syntaxError("data type definition");} break;
  1651. case 65:
  1652. # line 198 "parser.y"
  1653. {yyval = gc0(NIL);} break;
  1654. case 66:
  1655. # line 199 "parser.y"
  1656. {yyval = gc2(singleton(yypvt[-0]));} break;
  1657. case 67:
  1658. # line 200 "parser.y"
  1659. {yyval = gc4(yypvt[-1]);} break;
  1660. case 68:
  1661. # line 202 "parser.y"
  1662. {yyval = gc0(NIL);} break;
  1663. case 69:
  1664. # line 203 "parser.y"
  1665. {yyval = yypvt[-0];} break;
  1666. case 70:
  1667. # line 205 "parser.y"
  1668. {yyval = gc3(cons(yypvt[-0],yypvt[-2]));} break;
  1669. case 71:
  1670. # line 206 "parser.y"
  1671. {yyval = gc1(singleton(yypvt[-0]));} break;
  1672. case 72:
  1673. # line 217 "parser.y"
  1674. {yyval = gc3(ap(QUAL,pair(yypvt[-2],yypvt[-0])));} break;
  1675. case 73:
  1676. # line 218 "parser.y"
  1677. {yyval = yypvt[-0];} break;
  1678. case 74:
  1679. # line 220 "parser.y"
  1680. {yyval = gc1(checkContext(yypvt[-0]));} break;
  1681. case 75:
  1682. # line 222 "parser.y"
  1683. {yyval = yypvt[-0];} break;
  1684. case 76:
  1685. # line 223 "parser.y"
  1686. {yyval = gc3(ap(ap(ARROW,yypvt[-2]),yypvt[-0]));} break;
  1687. case 77:
  1688. # line 224 "parser.y"
  1689. {syntaxError("type expression");} break;
  1690. case 78:
  1691. # line 226 "parser.y"
  1692. {yyval = gc2(ap(yypvt[-1],yypvt[-0]));} break;
  1693. case 79:
  1694. # line 227 "parser.y"
  1695. {yyval = yypvt[-0];} break;
  1696. case 80:
  1697. # line 229 "parser.y"
  1698. {yyval = yypvt[-0];} break;
  1699. case 81:
  1700. # line 230 "parser.y"
  1701. {yyval = yypvt[-0];} break;
  1702. case 82:
  1703. # line 231 "parser.y"
  1704. {yyval = gc2(UNIT);} break;
  1705. case 83:
  1706. # line 232 "parser.y"
  1707. {yyval = gc3(ARROW);} break;
  1708. case 84:
  1709. # line 233 "parser.y"
  1710. {yyval = gc3(yypvt[-1]);} break;
  1711. case 85:
  1712. # line 234 "parser.y"
  1713. {yyval = gc3(yypvt[-1]);} break;
  1714. case 86:
  1715. # line 235 "parser.y"
  1716. {yyval = gc3(buildTuple(yypvt[-1]));} break;
  1717. case 87:
  1718. # line 236 "parser.y"
  1719. {yyval = gc3(ap(LIST,yypvt[-1]));} break;
  1720. case 88:
  1721. # line 237 "parser.y"
  1722. {yyval = gc2(LIST);} break;
  1723. case 89:
  1724. # line 239 "parser.y"
  1725. {yyval = gc3(mkTuple(tupleOf(yypvt[-1])+1));} break;
  1726. case 90:
  1727. # line 240 "parser.y"
  1728. {yyval = gc1(mkTuple(2));} break;
  1729. case 91:
  1730. # line 242 "parser.y"
  1731. {yyval = gc3(cons(yypvt[-0],yypvt[-2]));} break;
  1732. case 92:
  1733. # line 243 "parser.y"
  1734. {yyval = gc3(cons(yypvt[-0],cons(yypvt[-2],NIL)));} break;
  1735. case 93:
  1736. # line 248 "parser.y"
  1737. {fixDefn(LEFT_ASS,yypvt[-2],yypvt[-1],yypvt[-0]); sp-=3;} break;
  1738. case 94:
  1739. # line 249 "parser.y"
  1740. {fixDefn(RIGHT_ASS,yypvt[-2],yypvt[-1],yypvt[-0]);sp-=3;} break;
  1741. case 95:
  1742. # line 250 "parser.y"
  1743. {fixDefn(NON_ASS,yypvt[-2],yypvt[-1],yypvt[-0]);  sp-=3;} break;
  1744. case 96:
  1745. # line 252 "parser.y"
  1746. {yyval = gc1(checkPrec(yypvt[-0]));} break;
  1747. case 97:
  1748. # line 253 "parser.y"
  1749. {yyval = gc0(mkInt(DEF_PREC));} break;
  1750. case 98:
  1751. # line 255 "parser.y"
  1752. {yyval = gc3(cons(yypvt[-0],yypvt[-2]));} break;
  1753. case 99:
  1754. # line 256 "parser.y"
  1755. {yyval = gc1(cons(yypvt[-0],NIL));} break;
  1756. case 100:
  1757. # line 258 "parser.y"
  1758. {yyval = yypvt[-0];} break;
  1759. case 101:
  1760. # line 259 "parser.y"
  1761. {yyval = yypvt[-0];} break;
  1762. case 102:
  1763. # line 260 "parser.y"
  1764. {yyval = gc1(varMinus);} break;
  1765. case 103:
  1766. # line 262 "parser.y"
  1767. {yyval = yypvt[-0];} break;
  1768. case 104:
  1769. # line 263 "parser.y"
  1770. {yyval = gc3(yypvt[-1]);} break;
  1771. case 105:
  1772. # line 265 "parser.y"
  1773. {yyval = yypvt[-0];} break;
  1774. case 106:
  1775. # line 266 "parser.y"
  1776. {yyval = gc3(yypvt[-1]);} break;
  1777. case 107:
  1778. # line 271 "parser.y"
  1779. {primDefn(intOf(yypvt[-3]),yypvt[-2],yypvt[-0]); sp-=4;} break;
  1780. case 108:
  1781. # line 273 "parser.y"
  1782. {yyval = gc3(cons(yypvt[-0],yypvt[-2]));} break;
  1783. case 109:
  1784. # line 274 "parser.y"
  1785. {yyval = gc1(cons(yypvt[-0],NIL));} break;
  1786. case 110:
  1787. # line 275 "parser.y"
  1788. {syntaxError("primitive defn");} break;
  1789. case 111:
  1790. # line 277 "parser.y"
  1791. {yyval = gc2(pair(yypvt[-1],yypvt[-0]));} break;
  1792. case 112:
  1793. # line 282 "parser.y"
  1794. {classDefn(intOf(yypvt[-2]),yypvt[-1],yypvt[-0]); sp-=3;} break;
  1795. case 113:
  1796. # line 283 "parser.y"
  1797. {instDefn(intOf(yypvt[-2]),yypvt[-1],yypvt[-0]);  sp-=3;} break;
  1798. case 114:
  1799. # line 284 "parser.y"
  1800. {sp-=2;} break;
  1801. case 115:
  1802. # line 286 "parser.y"
  1803. {yyval = gc3(pair(yypvt[-2],checkClass(yypvt[-0])));} break;
  1804. case 116:
  1805. # line 287 "parser.y"
  1806. {yyval = gc1(pair(NIL,checkClass(yypvt[-0])));} break;
  1807. case 117:
  1808. # line 289 "parser.y"
  1809. {yyval = gc4(yypvt[-1]);} break;
  1810. case 118:
  1811. # line 290 "parser.y"
  1812. {yyval = gc0(NIL);} break;
  1813. case 119:
  1814. # line 292 "parser.y"
  1815. {yyval = gc4(yypvt[-1]);} break;
  1816. case 120:
  1817. # line 293 "parser.y"
  1818. {yyval = gc0(NIL);} break;
  1819. case 121:
  1820. # line 295 "parser.y"
  1821. {yyval = gc3(cons(yypvt[-0],yypvt[-2]));} break;
  1822. case 122:
  1823. # line 296 "parser.y"
  1824. {yyval = gc1(cons(yypvt[-0],NIL));} break;
  1825. case 123:
  1826. # line 298 "parser.y"
  1827. {yyval = gc3(sigdecl(yypvt[-1],yypvt[-2],yypvt[-0]));} break;
  1828. case 124:
  1829. # line 299 "parser.y"
  1830. {yyval = gc2(pair(yypvt[-1],yypvt[-0]));} break;
  1831. case 125:
  1832. # line 304 "parser.y"
  1833. {yyval = gc3(sigdecl(yypvt[-1],yypvt[-2],yypvt[-0]));} break;
  1834. case 126:
  1835. # line 305 "parser.y"
  1836. {yyval = gc2(pair(yypvt[-1],yypvt[-0]));} break;
  1837. case 127:
  1838. # line 307 "parser.y"
  1839. {yyval = gc3(cons(yypvt[-0],yypvt[-2]));} break;
  1840. case 128:
  1841. # line 308 "parser.y"
  1842. {yyval = gc1(cons(yypvt[-0],NIL));} break;
  1843. case 129:
  1844. # line 310 "parser.y"
  1845. {yyval = gc2(letrec(yypvt[-0],yypvt[-1]));} break;
  1846. case 130:
  1847. # line 311 "parser.y"
  1848. {yyval = yypvt[-0];} break;
  1849. case 131:
  1850. # line 312 "parser.y"
  1851. {syntaxError("declaration");} break;
  1852. case 132:
  1853. # line 314 "parser.y"
  1854. {yyval = gc2(pair(yypvt[-1],yypvt[-0]));} break;
  1855. case 133:
  1856. # line 315 "parser.y"
  1857. {yyval = gc1(grded(rev(yypvt[-0])));} break;
  1858. case 134:
  1859. # line 317 "parser.y"
  1860. {yyval = gc4(yypvt[-1]);} break;
  1861. case 135:
  1862. # line 319 "parser.y"
  1863. {yyval = gc2(cons(yypvt[-0],yypvt[-1]));} break;
  1864. case 136:
  1865. # line 320 "parser.y"
  1866. {yyval = gc1(cons(yypvt[-0],NIL));} break;
  1867. case 137:
  1868. # line 322 "parser.y"
  1869. {yyval = gc4(pair(yypvt[-1],pair(yypvt[-2],yypvt[-0])));} break;
  1870. case 138:
  1871. # line 329 "parser.y"
  1872. {yyval = gc5(pair(yypvt[-4],pair(yypvt[-0],yypvt[-3])));} break;
  1873. case 139:
  1874. # line 330 "parser.y"
  1875. {yyval = gc4(pair(yypvt[-3],pair(yypvt[-0],yypvt[-2])));} break;
  1876. case 140:
  1877. # line 332 "parser.y"
  1878. {yyval = gc3(cons(yypvt[-0],yypvt[-2]));} break;
  1879. case 141:
  1880. # line 333 "parser.y"
  1881. {yyval = gc1(cons(yypvt[-0],NIL));} break;
  1882. case 142:
  1883. # line 335 "parser.y"
  1884. {yyval = yypvt[-0];} break;
  1885. case 143:
  1886. # line 336 "parser.y"
  1887. {yyval = gc3(varMinus);} break;
  1888. case 144:
  1889. # line 338 "parser.y"
  1890. {yyval = yypvt[-0];} break;
  1891. case 145:
  1892. # line 339 "parser.y"
  1893. {yyval = gc3(yypvt[-1]);} break;
  1894. case 146:
  1895. # line 341 "parser.y"
  1896. {yyval = yypvt[-0];} break;
  1897. case 147:
  1898. # line 342 "parser.y"
  1899. {yyval = gc3(yypvt[-1]);} break;
  1900. case 148:
  1901. # line 347 "parser.y"
  1902. {yyval = gc3(ap(ESIGN,pair(yypvt[-2],yypvt[-0])));} break;
  1903. case 149:
  1904. # line 348 "parser.y"
  1905. {yyval = yypvt[-0];} break;
  1906. case 150:
  1907. # line 349 "parser.y"
  1908. {syntaxError("expression");} break;
  1909. case 151:
  1910. # line 351 "parser.y"
  1911. {yyval = yypvt[-0];} break;
  1912. case 152:
  1913. # line 352 "parser.y"
  1914. {yyval = gc3(ap(ap(yypvt[-1],yypvt[-2]),yypvt[-0]));} break;
  1915. case 153:
  1916. # line 353 "parser.y"
  1917. {yyval = gc1(tidyInfix(yypvt[-0]));} break;
  1918. case 154:
  1919. # line 355 "parser.y"
  1920. {yyval = gc3(ap(ap(yypvt[-1],yypvt[-2]),yypvt[-0]));} break;
  1921. case 155:
  1922. # line 356 "parser.y"
  1923. {yyval = gc5(ap(ap(yypvt[-1],
  1924.                             ap(ap(yypvt[-3],singleton(yypvt[-4])),
  1925.                                                            yypvt[-2])),yypvt[-0]));} break;
  1926. case 156:
  1927. # line 360 "parser.y"
  1928. {if (isInt(yypvt[-0]))
  1929.                          yyval = gc2(mkInt(-intOf(yypvt[-0])));
  1930.                      else
  1931.                          yyval = gc2(ap(varNegate,yypvt[-0]));
  1932.                     } break;
  1933. case 157:
  1934. # line 365 "parser.y"
  1935. {yyval = gc4(ap(LAMBDA,
  1936.                              pair(rev(yypvt[-2]),
  1937.                                   pair(yypvt[-1],yypvt[-0]))));} break;
  1938. case 158:
  1939. # line 368 "parser.y"
  1940. {yyval = gc6(letrec(yypvt[-3],yypvt[-0]));} break;
  1941. case 159:
  1942. # line 369 "parser.y"
  1943. {yyval = gc6(ap(COND,triple(yypvt[-4],yypvt[-2],yypvt[-0])));} break;
  1944. case 160:
  1945. # line 370 "parser.y"
  1946. {yyval = gc6(ap(CASE,pair(yypvt[-4],rev(yypvt[-1]))));} break;
  1947. case 161:
  1948. # line 371 "parser.y"
  1949. {yyval = yypvt[-0];} break;
  1950. case 162:
  1951. # line 373 "parser.y"
  1952. {yyval = gc2(cons(yypvt[-0],yypvt[-1]));} break;
  1953. case 163:
  1954. # line 374 "parser.y"
  1955. {yyval = gc1(cons(yypvt[-0],NIL));} break;
  1956. case 164:
  1957. # line 376 "parser.y"
  1958. {yyval = gc2(ap(yypvt[-1],yypvt[-0]));} break;
  1959. case 165:
  1960. # line 377 "parser.y"
  1961. {yyval = yypvt[-0];} break;
  1962. case 166:
  1963. # line 379 "parser.y"
  1964. {yyval = yypvt[-0];} break;
  1965. case 167:
  1966. # line 380 "parser.y"
  1967. {yyval = gc3(ap(ASPAT,pair(yypvt[-2],yypvt[-0])));} break;
  1968. case 168:
  1969. # line 381 "parser.y"
  1970. {yyval = gc2(ap(LAZYPAT,yypvt[-0]));} break;
  1971. case 169:
  1972. # line 382 "parser.y"
  1973. {yyval = gc1(WILDCARD);} break;
  1974. case 170:
  1975. # line 383 "parser.y"
  1976. {yyval = yypvt[-0];} break;
  1977. case 171:
  1978. # line 384 "parser.y"
  1979. {yyval = gc2(UNIT);} break;
  1980. case 172:
  1981. # line 385 "parser.y"
  1982. {yyval = yypvt[-0];} break;
  1983. case 173:
  1984. # line 386 "parser.y"
  1985. {yyval = yypvt[-0];} break;
  1986. case 174:
  1987. # line 387 "parser.y"
  1988. {yyval = yypvt[-0];} break;
  1989. case 175:
  1990. # line 388 "parser.y"
  1991. {yyval = yypvt[-0];} break;
  1992. case 176:
  1993. # line 389 "parser.y"
  1994. {yyval = gc3(yypvt[-1]);} break;
  1995. case 177:
  1996. # line 390 "parser.y"
  1997. {yyval = gc3(buildTuple(yypvt[-1]));} break;
  1998. case 178:
  1999. # line 391 "parser.y"
  2000. {yyval = gc3(yypvt[-1]);} break;
  2001. case 179:
  2002. # line 392 "parser.y"
  2003. {yyval = gc4(ap(yypvt[-1],yypvt[-2]));} break;
  2004. case 180:
  2005. # line 393 "parser.y"
  2006. {yyval = gc4(ap(ap(varFlip,yypvt[-2]),yypvt[-1]));} break;
  2007. case 181:
  2008. # line 394 "parser.y"
  2009. {yyval = gc4(ap(ap(varFlip,yypvt[-2]),yypvt[-1]));} break;
  2010. case 182:
  2011. # line 396 "parser.y"
  2012. {yyval = gc3(cons(yypvt[-0],yypvt[-2]));} break;
  2013. case 183:
  2014. # line 397 "parser.y"
  2015. {yyval = gc3(cons(yypvt[-0],cons(yypvt[-2],NIL)));} break;
  2016. case 184:
  2017. # line 399 "parser.y"
  2018. {yyval = gc3(cons(yypvt[-0],yypvt[-2]));} break;
  2019. case 185:
  2020. # line 400 "parser.y"
  2021. {yyval = gc1(cons(yypvt[-0],NIL));} break;
  2022. case 186:
  2023. # line 402 "parser.y"
  2024. {yyval = gc2(pair(yypvt[-1],yypvt[-0]));} break;
  2025. case 187:
  2026. # line 404 "parser.y"
  2027. {yyval = gc2(letrec(yypvt[-0],yypvt[-1]));} break;
  2028. case 188:
  2029. # line 405 "parser.y"
  2030. {yyval = yypvt[-0];} break;
  2031. case 189:
  2032. # line 407 "parser.y"
  2033. {yyval = gc1(grded(rev(yypvt[-0])));} break;
  2034. case 190:
  2035. # line 408 "parser.y"
  2036. {yyval = gc2(pair(yypvt[-1],yypvt[-0]));} break;
  2037. case 191:
  2038. # line 409 "parser.y"
  2039. {syntaxError("case expression");} break;
  2040. case 192:
  2041. # line 411 "parser.y"
  2042. {yyval = gc2(cons(yypvt[-0],yypvt[-1]));} break;
  2043. case 193:
  2044. # line 412 "parser.y"
  2045. {yyval = gc1(cons(yypvt[-0],NIL));} break;
  2046. case 194:
  2047. # line 414 "parser.y"
  2048. {yyval = gc4(pair(yypvt[-1],pair(yypvt[-2],yypvt[-0])));} break;
  2049. case 195:
  2050. # line 419 "parser.y"
  2051. {yyval = gc0(nameNil);} break;
  2052. case 196:
  2053. # line 420 "parser.y"
  2054. {yyval = gc1(ap(FINLIST,cons(yypvt[-0],NIL)));} break;
  2055. case 197:
  2056. # line 421 "parser.y"
  2057. {yyval = gc1(ap(FINLIST,rev(yypvt[-0])));} break;
  2058. case 198:
  2059. # line 422 "parser.y"
  2060. {yyval = gc3(ap(COMP,pair(yypvt[-2],rev(yypvt[-0]))));} break;
  2061. case 199:
  2062. # line 423 "parser.y"
  2063. {yyval = gc3(ap(ap(varFromTo,yypvt[-2]),yypvt[-0]));} break;
  2064. case 200:
  2065. # line 424 "parser.y"
  2066. {yyval = gc4(ap(ap(varFromThen,yypvt[-3]),yypvt[-1]));} break;
  2067. case 201:
  2068. # line 425 "parser.y"
  2069. {yyval = gc2(ap(varFrom,yypvt[-1]));} break;
  2070. case 202:
  2071. # line 426 "parser.y"
  2072. {yyval = gc5(ap(ap(ap(varFromThenTo,
  2073.                                                                yypvt[-4]),yypvt[-2]),yypvt[-0]));} break;
  2074. case 203:
  2075. # line 429 "parser.y"
  2076. {yyval = gc3(cons(yypvt[-0],yypvt[-2]));} break;
  2077. case 204:
  2078. # line 430 "parser.y"
  2079. {yyval = gc1(cons(yypvt[-0],NIL));} break;
  2080. case 205:
  2081. # line 432 "parser.y"
  2082. {yyval = gc3(ap(FROMQUAL,pair(yypvt[-2],yypvt[-0])));} break;
  2083. case 206:
  2084. # line 433 "parser.y"
  2085. {yyval = gc3(ap(QWHERE,
  2086.                              singleton(
  2087.                             pair(yypvt[-2],pair(yypvt[-1],
  2088.                                      yypvt[-0])))));} break;
  2089. case 207:
  2090. # line 437 "parser.y"
  2091. {yyval = gc1(ap(BOOLQUAL,yypvt[-0]));} break;
  2092. case 208:
  2093. # line 438 "parser.y"
  2094. {yyval = gc4(ap(QWHERE,yypvt[-1]));} break;
  2095. case 209:
  2096. # line 478 "parser.y"
  2097. {yyval = gc6(ap(COMP,pair(yypvt[-0],rev(yypvt[-3]))));} break;
  2098. case 210:
  2099. # line 479 "parser.y"
  2100. {yyval = gc5(ap(COMP,pair(UNIT,rev(yypvt[-2]))));} break;
  2101. case 211:
  2102. # line 481 "parser.y"
  2103. {yyval = gc3(cons(yypvt[-0],yypvt[-2]));} break;
  2104. case 212:
  2105. # line 482 "parser.y"
  2106. {yyval = gc1(cons(yypvt[-0],NIL));} break;
  2107. case 213:
  2108. # line 484 "parser.y"
  2109. {yyval = gc3(ap(FROMQUAL,pair(yypvt[-2],yypvt[-0])));} break;
  2110. case 214:
  2111. # line 485 "parser.y"
  2112. {yyval = gc1(ap(FROMQUAL,
  2113.                              pair(WILDCARD,yypvt[-0])));} break;
  2114. case 215:
  2115. # line 487 "parser.y"
  2116. {yyval = gc2(ap(BOOLQUAL,yypvt[-0]));} break;
  2117. case 216:
  2118. # line 488 "parser.y"
  2119. {yyval = gc4(ap(QWHERE,yypvt[-1]));} break;
  2120. case 217:
  2121. # line 494 "parser.y"
  2122. {yyval = gc2(yypvt[-0]);} break;
  2123. case 218:
  2124. # line 495 "parser.y"
  2125. {yyval = yypvt[-0];} break;
  2126. case 219:
  2127. # line 497 "parser.y"
  2128. {yyval = yypvt[-0];} break;
  2129. case 220:
  2130. # line 498 "parser.y"
  2131. {yyerrok;
  2132.                                          if (canUnOffside()) {
  2133.                                              unOffside();
  2134.                          /* insert extra token on stack*/
  2135.                          push(NIL);
  2136.                          pushed(0) = pushed(1);
  2137.                          pushed(1) = mkInt(column);
  2138.                      }
  2139.                                          else
  2140.                                              syntaxError("definition");
  2141.                                         } break;
  2142.     }
  2143.     goto yystack;        /* reset registers in driver code */
  2144. }
  2145.  
  2146.