/* -------------------------------------------------------------------------- * Hugs parser (included as part of input.c) * * Expect 16 shift/reduce conflicts when passing this grammar through yacc, * but don't worry; they should all be resolved in an appropriate manner. * * The Hugs 98 system is Copyright (c) Mark P Jones, Alastair Reid, the * Yale Haskell Group, and the OGI School of Science & Engineering at OHSU, * 1994-2003, All rights reserved. It is distributed as free software under * the license in the file "License", which is included in the distribution. * * $RCSfile: parser.y,v $ * $Revision: 1.50 $ * $Date: 2006/08/30 18:57:13 $ * ------------------------------------------------------------------------*/ %{ %} %token EXPR CTXT SCRIPT %token CASEXP OF DATA TYPE IF_T %token THEN ELSE_T WHERE LET IN %token INFIXN INFIXL INFIXR PRIMITIVE TNEWTYPE %token DEFAULT_T DERIVING DO_T TCLASS TINSTANCE /*#if MUDO*/ %token MDO /*#endif*/ %token REPEAT ALL NUMLIT CHARLIT STRINGLIT %token VAROP VARID CONOP CONID %token QVAROP QVARID QCONOP QCONID /*#if TREX*/ %token RECSELID IPVARID /*#endif*/ %token COCO '=' UPTO '@' '\\' %token '|' '-' FROM ARROW '~' %token '!' IMPLIES '(' ',' ')' %token '[' ';' ']' '`' '.' %token TMODULE IMPORT HIDING QUALIFIED ASMOD %token NEEDPRIMS %token FOREIGN %% /*- Top level script/module structure -------------------------------------*/ /* start : EXPR exp lwherePart { $$ = haskellParser::execute('start', array($1, $2, $3)); } | CTXT context { $$ = haskellParser::execute('start', array($1, $2)); } | SCRIPT topModule { $$ = haskellParser::execute('start', array($1, $2)); } | error { $$ = haskellParser::execute('start', array($1)); } ; */ start : topModule { $$ = haskellParser::execute('start', array($1)); } | modBody { $$ = haskellParser::execute('start', array($1)); } ; /*- Haskell module header/import parsing: ----------------------------------- * Syntax for Haskell modules (module headers and imports) is parsed but * most of it is ignored. However, module names in import declarations * are used, of course, if import chasing is turned on. *-------------------------------------------------------------------------*/ /* In Haskell 1.2, the default module header was "module Main where" * In 1.3, this changed to "module Main(main) where". * We use the 1.2 header because it breaks much less pre-module code. */ topModule : startMain begin modBody end { $$ = haskellParser::execute('topModule', array($1, $2, $3, $4)); } | startMain '{' modBody '}' { $$ = haskellParser::execute('topModule', array($1, $2, $3, $4)); } | TMODULE modname expspec WHERE '{' modBody end { $$ = haskellParser::execute('topModule', array($1, $2, $3, $4, $5, $6, $7)); } | TMODULE modname expspec WHERE error { $$ = haskellParser::execute('topModule', array($1, $2, $3, $4, $5)); } | TMODULE error { $$ = haskellParser::execute('topModule', array($1, $2)); } ; /* To implement the Haskell module system, we have to keep track of the * current module. We rely on the use of LALR parsing to ensure that this * side effect happens before any declarations within the module. */ startMain : /* empty */ { $$ = haskellParser::execute('startMain', array()); } ; modname : qconid { $$ = haskellParser::execute('modname', array($1)); } ; modid : qconid { $$ = haskellParser::execute('modid', array($1)); } | STRINGLIT { $$ = haskellParser::execute('modid', array($1)); } ; modBody : /* empty */ { $$ = haskellParser::execute('modBody', array()); } | ';' modBody { $$ = haskellParser::execute('modBody', array($1, $2)); } | topDecls { $$ = haskellParser::execute('modBody', array($1)); } | impDecls chase { $$ = haskellParser::execute('modBody', array($1, $2)); } | impDecls ';' chase topDecls { $$ = haskellParser::execute('modBody', array($1, $2, $3, $4)); } ; /*- Exports: --------------------------------------------------------------*/ expspec : /* empty */ { $$ = haskellParser::execute('expspec', array()); } | '(' ')' { $$ = haskellParser::execute('expspec', array($1, $2)); } | '(' ',' ')' { $$ = haskellParser::execute('expspec', array($1, $2, $3)); } | '(' exports ')' { $$ = haskellParser::execute('expspec', array($1, $2, $3)); } | '(' exports ',' ')' { $$ = haskellParser::execute('expspec', array($1, $2, $3, $4)); } ; exports : exports ',' export { $$ = haskellParser::execute('exports', array($1, $2, $3)); } | export { $$ = haskellParser::execute('exports', array($1)); } ; /* The qcon should be qconid. * Relaxing the rule lets us explicitly export (:) from the Prelude. */ export : qvar { $$ = haskellParser::execute('export', array($1)); } | qcon { $$ = haskellParser::execute('export', array($1)); } | qconid '(' UPTO ')' { $$ = haskellParser::execute('export', array($1, $2, $3, $4)); } | qconid '(' qnames ')' { $$ = haskellParser::execute('export', array($1, $2, $3, $4)); } | TMODULE modid { $$ = haskellParser::execute('export', array($1, $2)); } ; qnames : /* empty */ { $$ = haskellParser::execute('qnames', array()); } | ',' { $$ = haskellParser::execute('qnames', array($1)); } | qnames1 { $$ = haskellParser::execute('qnames', array($1)); } | qnames1 ',' { $$ = haskellParser::execute('qnames', array($1, $2)); } ; qnames1 : qnames1 ',' qname { $$ = haskellParser::execute('qnames1', array($1, $2, $3)); } | qname { $$ = haskellParser::execute('qnames1', array($1)); } ; qname : qvar { $$ = haskellParser::execute('qname', array($1)); } | qcon { $$ = haskellParser::execute('qname', array($1)); } ; /*- Import declarations: --------------------------------------------------*/ impDecls : impDecls ';' impDecl { $$ = haskellParser::execute('impDecls', array($1, $2, $3)); } | impDecls ';' { $$ = haskellParser::execute('impDecls', array($1, $2)); } | impDecl { $$ = haskellParser::execute('impDecls', array($1)); } ; chase : /* empty */ { $$ = haskellParser::execute('chase', array()); } ; /* Note that qualified import ignores the import list. */ impDecl : IMPORT modid impspec { $$ = haskellParser::execute('impDecl', array($1, $2, $3)); } | IMPORT modid ASMOD modid impspec { $$ = haskellParser::execute('impDecl', array($1, $2, $3, $4, $5)); } | IMPORT QUALIFIED modid ASMOD modid impspec { $$ = haskellParser::execute('impDecl', array($1, $2, $3, $4, $5, $6)); } | IMPORT QUALIFIED modid impspec { $$ = haskellParser::execute('impDecl', array($1, $2, $3, $4)); } | IMPORT error { $$ = haskellParser::execute('impDecl', array($1, $2)); } ; impspec : /* empty */ { $$ = haskellParser::execute('impspec', array()); } | HIDING '(' imports ')' { $$ = haskellParser::execute('impspec', array($1, $2, $3, $4)); } | '(' imports ')' { $$ = haskellParser::execute('impspec', array($1, $2, $3)); } ; imports : /* empty */ { $$ = haskellParser::execute('imports', array()); } | ',' { $$ = haskellParser::execute('imports', array($1)); } | imports1 { $$ = haskellParser::execute('imports', array($1)); } | imports1 ',' { $$ = haskellParser::execute('imports', array($1, $2)); } ; imports1 : imports1 ',' import { $$ = haskellParser::execute('imports1', array($1, $2, $3)); } | import { $$ = haskellParser::execute('imports1', array($1)); } ; import : var { $$ = haskellParser::execute('import', array($1)); } | CONID { $$ = haskellParser::execute('import', array($1)); } | CONID '(' UPTO ')' { $$ = haskellParser::execute('import', array($1, $2, $3, $4)); } | CONID '(' names ')' { $$ = haskellParser::execute('import', array($1, $2, $3, $4)); } ; names : /* empty */ { $$ = haskellParser::execute('names', array()); } | ',' { $$ = haskellParser::execute('names', array($1)); } | names1 { $$ = haskellParser::execute('names', array($1)); } | names1 ',' { $$ = haskellParser::execute('names', array($1, $2)); } ; names1 : names1 ',' name { $$ = haskellParser::execute('names1', array($1, $2, $3)); } | name { $$ = haskellParser::execute('names1', array($1)); } ; name : var { $$ = haskellParser::execute('name', array($1)); } | con { $$ = haskellParser::execute('name', array($1)); } ; /*- Top-level declarations: -----------------------------------------------*/ topDecls : topDecls ';' { $$ = haskellParser::execute('topDecls', array($1, $2)); } | topDecls ';' topDecl { $$ = haskellParser::execute('topDecls', array($1, $2, $3)); } | topDecls ';' decl { $$ = haskellParser::execute('topDecls', array($1, $2, $3)); } | topDecl { $$ = haskellParser::execute('topDecls', array($1)); } | decl { $$ = haskellParser::execute('topDecls', array($1)); } ; /*- Type declarations: ----------------------------------------------------*/ topDecl : TYPE tyLhs '=' type { $$ = haskellParser::execute('topDecl', array($1, $2, $3, $4)); } | TYPE tyLhs '=' type IN invars { $$ = haskellParser::execute('topDecl', array($1, $2, $3, $4, $5, $6)); } | TYPE error { $$ = haskellParser::execute('topDecl', array($1, $2)); } | DATA btype2 '=' constrs deriving { $$ = haskellParser::execute('topDecl', array($1, $2, $3, $4, $5)); } | DATA context IMPLIES tyLhs '=' constrs deriving { $$ = haskellParser::execute('topDecl', array($1, $2, $3, $4, $5, $6, $7)); } | DATA btype2 { $$ = haskellParser::execute('topDecl', array($1, $2)); } | DATA context IMPLIES tyLhs { $$ = haskellParser::execute('topDecl', array($1, $2, $3, $4)); } | DATA error { $$ = haskellParser::execute('topDecl', array($1, $2)); } | TNEWTYPE btype2 '=' nconstr deriving { $$ = haskellParser::execute('topDecl', array($1, $2, $3, $4, $5)); } | TNEWTYPE context IMPLIES tyLhs '=' nconstr deriving { $$ = haskellParser::execute('topDecl', array($1, $2, $3, $4, $5, $6, $7)); } | TNEWTYPE error { $$ = haskellParser::execute('topDecl', array($1, $2)); } | NEEDPRIMS NUMLIT { $$ = haskellParser::execute('topDecl', array($1, $2)); } | NEEDPRIMS error { $$ = haskellParser::execute('topDecl', array($1, $2)); } ; tyLhs : tyLhs varid { $$ = haskellParser::execute('tyLhs', array($1, $2)); } | CONID { $$ = haskellParser::execute('tyLhs', array($1)); } | error { $$ = haskellParser::execute('tyLhs', array($1)); } ; invars : invars ',' invar { $$ = haskellParser::execute('invars', array($1, $2, $3)); } | invar { $$ = haskellParser::execute('invars', array($1)); } ; invar : var COCO topType { $$ = haskellParser::execute('invar', array($1, $2, $3)); } | var { $$ = haskellParser::execute('invar', array($1)); } ; constrs : constrs '|' pconstr { $$ = haskellParser::execute('constrs', array($1, $2, $3)); } | pconstr { $$ = haskellParser::execute('constrs', array($1)); } ; pconstr : ALL varids '.' qconstr { $$ = haskellParser::execute('pconstr', array($1, $2, $3, $4)); } | constr { $$ = haskellParser::execute('pconstr', array($1)); } ; qconstr : context IMPLIES constr { $$ = haskellParser::execute('qconstr', array($1, $2, $3)); } | constr { $$ = haskellParser::execute('qconstr', array($1)); } ; constr : '!' btype conop bbtype { $$ = haskellParser::execute('constr', array($1, $2, $3, $4)); } | btype1 conop bbtype { $$ = haskellParser::execute('constr', array($1, $2, $3)); } | btype2 conop bbtype { $$ = haskellParser::execute('constr', array($1, $2, $3)); } | bpolyType conop bbtype { $$ = haskellParser::execute('constr', array($1, $2, $3)); } | btype2 { $$ = haskellParser::execute('constr', array($1)); } | btype3 { $$ = haskellParser::execute('constr', array($1)); } | con '{' fieldspecs '}' { $$ = haskellParser::execute('constr', array($1, $2, $3, $4)); } | con '{' '}' { $$ = haskellParser::execute('constr', array($1, $2, $3)); } | error { $$ = haskellParser::execute('constr', array($1)); } ; btype3 : btype2 '!' atype { $$ = haskellParser::execute('btype3', array($1, $2, $3)); } | btype2 bpolyType { $$ = haskellParser::execute('btype3', array($1, $2)); } | btype3 atype { $$ = haskellParser::execute('btype3', array($1, $2)); } | btype3 '!' atype { $$ = haskellParser::execute('btype3', array($1, $2, $3)); } | btype3 bpolyType { $$ = haskellParser::execute('btype3', array($1, $2)); } | '(' CONOP ')' { $$ = haskellParser::execute('btype3', array($1, $2, $3)); } ; bbtype : '!' btype { $$ = haskellParser::execute('bbtype', array($1, $2)); } | btype { $$ = haskellParser::execute('bbtype', array($1)); } | bpolyType { $$ = haskellParser::execute('bbtype', array($1)); } ; nconstr : pconstr { $$ = haskellParser::execute('nconstr', array($1)); } ; fieldspecs: fieldspecs ',' fieldspec { $$ = haskellParser::execute('fieldspecs', array($1, $2, $3)); } | fieldspec { $$ = haskellParser::execute('fieldspecs', array($1)); } ; fieldspec : vars COCO polyType { $$ = haskellParser::execute('fieldspec', array($1, $2, $3)); } | vars COCO type { $$ = haskellParser::execute('fieldspec', array($1, $2, $3)); } | vars COCO '!' type { $$ = haskellParser::execute('fieldspec', array($1, $2, $3, $4)); } ; deriving : /* empty */ { $$ = haskellParser::execute('deriving', array()); } | DERIVING qconid { $$ = haskellParser::execute('deriving', array($1, $2)); } | DERIVING '(' derivs0 ')' { $$ = haskellParser::execute('deriving', array($1, $2, $3, $4)); } ; derivs0 : /* empty */ { $$ = haskellParser::execute('derivs0', array()); } | derivs { $$ = haskellParser::execute('derivs0', array($1)); } ; derivs : derivs ',' qconid { $$ = haskellParser::execute('derivs', array($1, $2, $3)); } | qconid { $$ = haskellParser::execute('derivs', array($1)); } ; /*- Processing definitions of primitives ----------------------------------*/ topDecl : PRIMITIVE prims COCO topType { $$ = haskellParser::execute('topDecl', array($1, $2, $3, $4)); } ; prims : prims ',' prim { $$ = haskellParser::execute('prims', array($1, $2, $3)); } | prim { $$ = haskellParser::execute('prims', array($1)); } | error { $$ = haskellParser::execute('prims', array($1)); } ; prim : var STRINGLIT { $$ = haskellParser::execute('prim', array($1, $2)); } | var { $$ = haskellParser::execute('prim', array($1)); } ; /*- Foreign Function Interface --------------------------------------------*/ topDecl : FOREIGN IMPORT var STRINGLIT var COCO topType { $$ = haskellParser::execute('topDecl', array($1, $2, $3, $4, $5, $6, $7)); } | FOREIGN IMPORT var var COCO topType { $$ = haskellParser::execute('topDecl', array($1, $2, $3, $4, $5, $6)); } | FOREIGN IMPORT var var STRINGLIT var COCO topType { $$ = haskellParser::execute('topDecl', array($1, $2, $3, $4, $5, $6, $7, $8)); } | FOREIGN IMPORT var var var COCO topType { $$ = haskellParser::execute('topDecl', array($1, $2, $3, $4, $5, $6, $7)); } | FOREIGN var var STRINGLIT var COCO topType { $$ = haskellParser::execute('topDecl', array($1, $2, $3, $4, $5, $6, $7)); } ; /*- Class declarations: ---------------------------------------------------*/ topDecl : TCLASS crule fds wherePart { $$ = haskellParser::execute('topDecl', array($1, $2, $3, $4)); } | TINSTANCE irule wherePart { $$ = haskellParser::execute('topDecl', array($1, $2, $3)); } | DEFAULT_T '(' dtypes ')' { $$ = haskellParser::execute('topDecl', array($1, $2, $3, $4)); } | TCLASS error { $$ = haskellParser::execute('topDecl', array($1, $2)); } | TINSTANCE error { $$ = haskellParser::execute('topDecl', array($1, $2)); } | DEFAULT_T error { $$ = haskellParser::execute('topDecl', array($1, $2)); } ; crule : context IMPLIES btype2 { $$ = haskellParser::execute('crule', array($1, $2, $3)); } | btype2 { $$ = haskellParser::execute('crule', array($1)); } ; irule : context IMPLIES btype2 { $$ = haskellParser::execute('irule', array($1, $2, $3)); } | btype2 { $$ = haskellParser::execute('irule', array($1)); } ; dtypes : /* empty */ { $$ = haskellParser::execute('dtypes', array()); } | dtypes1 { $$ = haskellParser::execute('dtypes', array($1)); } ; dtypes1 : dtypes1 ',' type { $$ = haskellParser::execute('dtypes1', array($1, $2, $3)); } | type { $$ = haskellParser::execute('dtypes1', array($1)); } ; fds : /* empty */ { $$ = haskellParser::execute('fds', array()); } | '|' fds1 { $$ = haskellParser::execute('fds', array($1, $2)); } ; fds1 : fds1 ',' fd { $$ = haskellParser::execute('fds1', array($1, $2, $3)); } | fd { $$ = haskellParser::execute('fds1', array($1)); } ; fd : varids0 ARROW varids0 { $$ = haskellParser::execute('fd', array($1, $2, $3)); } | error { $$ = haskellParser::execute('fd', array($1)); } ; varids0 : /* empty */ { $$ = haskellParser::execute('varids0', array()); } | varids0 varid { $$ = haskellParser::execute('varids0', array($1, $2)); } ; /*- Type expressions: -----------------------------------------------------*/ topType : ALL varids '.' topType0 { $$ = haskellParser::execute('topType', array($1, $2, $3, $4)); } | topType0 { $$ = haskellParser::execute('topType', array($1)); } ; topType0 : context IMPLIES topType1 { $$ = haskellParser::execute('topType0', array($1, $2, $3)); } | topType1 { $$ = haskellParser::execute('topType0', array($1)); } ; topType1 : bpolyType ARROW topType1 { $$ = haskellParser::execute('topType1', array($1, $2, $3)); } | btype1 ARROW topType1 { $$ = haskellParser::execute('topType1', array($1, $2, $3)); } | btype2 ARROW topType1 { $$ = haskellParser::execute('topType1', array($1, $2, $3)); } | btype { $$ = haskellParser::execute('topType1', array($1)); } ; polyType : ALL varids '.' sigType { $$ = haskellParser::execute('polyType', array($1, $2, $3, $4)); } | bpolyType { $$ = haskellParser::execute('polyType', array($1)); } ; bpolyType : '(' polyType ')' { $$ = haskellParser::execute('bpolyType', array($1, $2, $3)); } | '(' lcontext IMPLIES type ')' { $$ = haskellParser::execute('bpolyType', array($1, $2, $3, $4, $5)); } ; varids : varids varid { $$ = haskellParser::execute('varids', array($1, $2)); } | varid { $$ = haskellParser::execute('varids', array($1)); } ; sigType : context IMPLIES type { $$ = haskellParser::execute('sigType', array($1, $2, $3)); } | type { $$ = haskellParser::execute('sigType', array($1)); } ; context : '(' ')' { $$ = haskellParser::execute('context', array($1, $2)); } | btype2 { $$ = haskellParser::execute('context', array($1)); } | '(' btype2 ')' { $$ = haskellParser::execute('context', array($1, $2, $3)); } | '(' btypes2 ')' { $$ = haskellParser::execute('context', array($1, $2, $3)); } | lacks { $$ = haskellParser::execute('context', array($1)); } | '(' lacks1 ')' { $$ = haskellParser::execute('context', array($1, $2, $3)); } ; lcontext : lacks { $$ = haskellParser::execute('lcontext', array($1)); } | '(' lacks1 ')' { $$ = haskellParser::execute('lcontext', array($1, $2, $3)); } ; lacks : varid '\\' varid { $$ = haskellParser::execute('lacks', array($1, $2, $3)); } | IPVARID COCO type { $$ = haskellParser::execute('lacks', array($1, $2, $3)); } ; lacks1 : btypes2 ',' lacks { $$ = haskellParser::execute('lacks1', array($1, $2, $3)); } | lacks1 ',' btype2 { $$ = haskellParser::execute('lacks1', array($1, $2, $3)); } | lacks1 ',' lacks { $$ = haskellParser::execute('lacks1', array($1, $2, $3)); } | btype2 ',' lacks { $$ = haskellParser::execute('lacks1', array($1, $2, $3)); } | lacks { $$ = haskellParser::execute('lacks1', array($1)); } ; type : type1 { $$ = haskellParser::execute('type', array($1)); } | btype2 { $$ = haskellParser::execute('type', array($1)); } ; type1 : btype1 { $$ = haskellParser::execute('type1', array($1)); } | bpolyType ARROW type { $$ = haskellParser::execute('type1', array($1, $2, $3)); } | btype1 ARROW type { $$ = haskellParser::execute('type1', array($1, $2, $3)); } | btype2 ARROW type { $$ = haskellParser::execute('type1', array($1, $2, $3)); } | error { $$ = haskellParser::execute('type1', array($1)); } ; btype : btype1 { $$ = haskellParser::execute('btype', array($1)); } | btype2 { $$ = haskellParser::execute('btype', array($1)); } ; btype1 : btype1 atype { $$ = haskellParser::execute('btype1', array($1, $2)); } | atype1 { $$ = haskellParser::execute('btype1', array($1)); } ; btype2 : btype2 atype { $$ = haskellParser::execute('btype2', array($1, $2)); } | qconid { $$ = haskellParser::execute('btype2', array($1)); } ; atype : atype1 { $$ = haskellParser::execute('atype', array($1)); } | qconid { $$ = haskellParser::execute('atype', array($1)); } ; atype1 : varid { $$ = haskellParser::execute('atype1', array($1)); } | '(' ')' { $$ = haskellParser::execute('atype1', array($1, $2)); } | '(' ARROW ')' { $$ = haskellParser::execute('atype1', array($1, $2, $3)); } | '(' type1 ')' { $$ = haskellParser::execute('atype1', array($1, $2, $3)); } | '(' btype2 ')' { $$ = haskellParser::execute('atype1', array($1, $2, $3)); } | '(' tupCommas ')' { $$ = haskellParser::execute('atype1', array($1, $2, $3)); } | '(' btypes2 ')' { $$ = haskellParser::execute('atype1', array($1, $2, $3)); } | '(' typeTuple ')' { $$ = haskellParser::execute('atype1', array($1, $2, $3)); } | '(' tfields ')' { $$ = haskellParser::execute('atype1', array($1, $2, $3)); } | '(' tfields '|' type ')' { $$ = haskellParser::execute('atype1', array($1, $2, $3, $4, $5)); } | '[' type ']' { $$ = haskellParser::execute('atype1', array($1, $2, $3)); } | '[' ']' { $$ = haskellParser::execute('atype1', array($1, $2)); } | '_' { $$ = haskellParser::execute('atype1', array($1)); } ; btypes2 : btypes2 ',' btype2 { $$ = haskellParser::execute('btypes2', array($1, $2, $3)); } | btype2 ',' btype2 { $$ = haskellParser::execute('btypes2', array($1, $2, $3)); } ; typeTuple : type1 ',' type { $$ = haskellParser::execute('typeTuple', array($1, $2, $3)); } | btype2 ',' type1 { $$ = haskellParser::execute('typeTuple', array($1, $2, $3)); } | btypes2 ',' type1 { $$ = haskellParser::execute('typeTuple', array($1, $2, $3)); } | typeTuple ',' type { $$ = haskellParser::execute('typeTuple', array($1, $2, $3)); } ; /*#if TREX*/ tfields : tfields ',' tfield { $$ = haskellParser::execute('tfields', array($1, $2, $3)); } | tfield { $$ = haskellParser::execute('tfields', array($1)); } ; tfield : varid COCO type { $$ = haskellParser::execute('tfield', array($1, $2, $3)); } ; /*#endif*/ /*- Value declarations: ---------------------------------------------------*/ gendecl : INFIXN optDigit ops { $$ = haskellParser::execute('gendecl', array($1, $2, $3)); } | INFIXN error { $$ = haskellParser::execute('gendecl', array($1, $2)); } | INFIXL optDigit ops { $$ = haskellParser::execute('gendecl', array($1, $2, $3)); } | INFIXL error { $$ = haskellParser::execute('gendecl', array($1, $2)); } | INFIXR optDigit ops { $$ = haskellParser::execute('gendecl', array($1, $2, $3)); } | INFIXR error { $$ = haskellParser::execute('gendecl', array($1, $2)); } | vars COCO topType { $$ = haskellParser::execute('gendecl', array($1, $2, $3)); } | vars COCO error { $$ = haskellParser::execute('gendecl', array($1, $2, $3)); } ; optDigit : NUMLIT { $$ = haskellParser::execute('optDigit', array($1)); } | /* empty */ { $$ = haskellParser::execute('optDigit', array()); } ; ops : ops ',' op { $$ = haskellParser::execute('ops', array($1, $2, $3)); } | op { $$ = haskellParser::execute('ops', array($1)); } ; vars : vars ',' var { $$ = haskellParser::execute('vars', array($1, $2, $3)); } | var { $$ = haskellParser::execute('vars', array($1)); } ; decls : '{' decls0 end { $$ = haskellParser::execute('decls', array($1, $2, $3)); } | '{' decls1 end { $$ = haskellParser::execute('decls', array($1, $2, $3)); } ; decls0 : /* empty */ { $$ = haskellParser::execute('decls0', array()); } | decls0 ';' { $$ = haskellParser::execute('decls0', array($1, $2)); } | decls1 ';' { $$ = haskellParser::execute('decls0', array($1, $2)); } ; decls1 : decls0 decl { $$ = haskellParser::execute('decls1', array($1, $2)); } ; decl : gendecl { $$ = haskellParser::execute('decl', array($1)); } | funlhs rhs { $$ = haskellParser::execute('decl', array($1, $2)); } | funlhs COCO type rhs { $$ = haskellParser::execute('decl', array($1, $2, $3, $4)); } | pat0 rhs { $$ = haskellParser::execute('decl', array($1, $2)); } ; funlhs : funlhs0 { $$ = haskellParser::execute('funlhs', array($1)); } | funlhs1 { $$ = haskellParser::execute('funlhs', array($1)); } | npk { $$ = haskellParser::execute('funlhs', array($1)); } ; funlhs0 : pat10_vI varop pat0 { $$ = haskellParser::execute('funlhs0', array($1, $2, $3)); } | infixPat varop pat0 { $$ = haskellParser::execute('funlhs0', array($1, $2, $3)); } | NUMLIT varop pat0 { $$ = haskellParser::execute('funlhs0', array($1, $2, $3)); } | var varop_pl pat0 { $$ = haskellParser::execute('funlhs0', array($1, $2, $3)); } | var '+' pat0_INT { $$ = haskellParser::execute('funlhs0', array($1, $2, $3)); } ; funlhs1 : '(' funlhs0 ')' apat { $$ = haskellParser::execute('funlhs1', array($1, $2, $3, $4)); } | '(' funlhs1 ')' apat { $$ = haskellParser::execute('funlhs1', array($1, $2, $3, $4)); } | '(' npk ')' apat { $$ = haskellParser::execute('funlhs1', array($1, $2, $3, $4)); } | var apat { $$ = haskellParser::execute('funlhs1', array($1, $2)); } | funlhs1 apat { $$ = haskellParser::execute('funlhs1', array($1, $2)); } ; rhs : rhs1 wherePart { $$ = haskellParser::execute('rhs', array($1, $2)); } | error { $$ = haskellParser::execute('rhs', array($1)); } ; rhs1 : '=' exp { $$ = haskellParser::execute('rhs1', array($1, $2)); } | gdrhs { $$ = haskellParser::execute('rhs1', array($1)); } ; gdrhs : gdrhs gddef { $$ = haskellParser::execute('gdrhs', array($1, $2)); } | gddef { $$ = haskellParser::execute('gdrhs', array($1)); } ; gddef : '|' exp0 '=' exp { $$ = haskellParser::execute('gddef', array($1, $2, $3, $4)); } ; wherePart : /* empty */ { $$ = haskellParser::execute('wherePart', array()); } | WHERE decls { $$ = haskellParser::execute('wherePart', array($1, $2)); } ; /* lwherePart and ldecls permit the binding of both 'normal' * and implicit parameter bindings. */ lwherePart : /* empty */ { $$ = haskellParser::execute('lwherePart', array()); } | WHERE ldecls { $$ = haskellParser::execute('lwherePart', array($1, $2)); } ; ldecls : '{' ldecls0 end { $$ = haskellParser::execute('ldecls', array($1, $2, $3)); } | '{' ldecls1 end { $$ = haskellParser::execute('ldecls', array($1, $2, $3)); } ; ldecls0 : /* empty */ { $$ = haskellParser::execute('ldecls0', array()); } | ldecls0 ';' { $$ = haskellParser::execute('ldecls0', array($1, $2)); } | ldecls1 ';' { $$ = haskellParser::execute('ldecls0', array($1, $2)); } ; ldecls1 : ldecls0 ldecl { $$ = haskellParser::execute('ldecls1', array($1, $2)); } ; ldecl : IPVARID '=' exp { $$ = haskellParser::execute('ldecl', array($1, $2, $3)); } | IPVARID error { $$ = haskellParser::execute('ldecl', array($1, $2)); } | decl { $$ = haskellParser::execute('ldecl', array($1)); } ; /*- Patterns: -------------------------------------------------------------*/ pat : npk { $$ = haskellParser::execute('pat', array($1)); } | pat_npk { $$ = haskellParser::execute('pat', array($1)); } ; pat_npk : pat0 COCO type { $$ = haskellParser::execute('pat_npk', array($1, $2, $3)); } | pat0 { $$ = haskellParser::execute('pat_npk', array($1)); } ; npk : var '+' NUMLIT { $$ = haskellParser::execute('npk', array($1, $2, $3)); } ; pat0 : var { $$ = haskellParser::execute('pat0', array($1)); } | NUMLIT { $$ = haskellParser::execute('pat0', array($1)); } | pat0_vI { $$ = haskellParser::execute('pat0', array($1)); } ; pat0_INT : var { $$ = haskellParser::execute('pat0_INT', array($1)); } | pat0_vI { $$ = haskellParser::execute('pat0_INT', array($1)); } ; pat0_vI : pat10_vI { $$ = haskellParser::execute('pat0_vI', array($1)); } | infixPat { $$ = haskellParser::execute('pat0_vI', array($1)); } ; infixPat : '-' pat10 { $$ = haskellParser::execute('infixPat', array($1, $2)); } | '-' error { $$ = haskellParser::execute('infixPat', array($1, $2)); } | var qconop pat10 { $$ = haskellParser::execute('infixPat', array($1, $2, $3)); } | var qconop '-' pat10 { $$ = haskellParser::execute('infixPat', array($1, $2, $3, $4)); } | NUMLIT qconop pat10 { $$ = haskellParser::execute('infixPat', array($1, $2, $3)); } | NUMLIT qconop '-' pat10 { $$ = haskellParser::execute('infixPat', array($1, $2, $3, $4)); } | pat10_vI qconop pat10 { $$ = haskellParser::execute('infixPat', array($1, $2, $3)); } | pat10_vI qconop '-' pat10 { $$ = haskellParser::execute('infixPat', array($1, $2, $3, $4)); } | infixPat qconop pat10 { $$ = haskellParser::execute('infixPat', array($1, $2, $3)); } | infixPat qconop '-' pat10 { $$ = haskellParser::execute('infixPat', array($1, $2, $3, $4)); } ; pat10 : fpat { $$ = haskellParser::execute('pat10', array($1)); } | apat { $$ = haskellParser::execute('pat10', array($1)); } ; pat10_vI : fpat { $$ = haskellParser::execute('pat10_vI', array($1)); } | apat_vI { $$ = haskellParser::execute('pat10_vI', array($1)); } ; fpat : fpat apat { $$ = haskellParser::execute('fpat', array($1, $2)); } | gcon apat { $$ = haskellParser::execute('fpat', array($1, $2)); } ; apat : NUMLIT { $$ = haskellParser::execute('apat', array($1)); } | var { $$ = haskellParser::execute('apat', array($1)); } | apat_vI { $$ = haskellParser::execute('apat', array($1)); } ; apat_vI : var '@' apat { $$ = haskellParser::execute('apat_vI', array($1, $2, $3)); } | gcon { $$ = haskellParser::execute('apat_vI', array($1)); } | qcon '{' patbinds '}' { $$ = haskellParser::execute('apat_vI', array($1, $2, $3, $4)); } | CHARLIT { $$ = haskellParser::execute('apat_vI', array($1)); } | STRINGLIT { $$ = haskellParser::execute('apat_vI', array($1)); } | '_' { $$ = haskellParser::execute('apat_vI', array($1)); } | '(' pat_npk ')' { $$ = haskellParser::execute('apat_vI', array($1, $2, $3)); } | '(' npk ')' { $$ = haskellParser::execute('apat_vI', array($1, $2, $3)); } | '(' pats2 ')' { $$ = haskellParser::execute('apat_vI', array($1, $2, $3)); } | '[' pats1 ']' { $$ = haskellParser::execute('apat_vI', array($1, $2, $3)); } | '~' apat /*#if TREX*/ { $$ = haskellParser::execute('apat_vI', array($1, $2)); } | '(' patfields ')' { $$ = haskellParser::execute('apat_vI', array($1, $2, $3)); } | '(' patfields '|' pat ')' /*#endif TREX*/ { $$ = haskellParser::execute('apat_vI', array($1, $2, $3, $4, $5)); } ; pats2 : pats2 ',' pat { $$ = haskellParser::execute('pats2', array($1, $2, $3)); } | pat ',' pat { $$ = haskellParser::execute('pats2', array($1, $2, $3)); } ; pats1 : pats1 ',' pat { $$ = haskellParser::execute('pats1', array($1, $2, $3)); } | pat { $$ = haskellParser::execute('pats1', array($1)); } ; patbinds : /* empty */ { $$ = haskellParser::execute('patbinds', array()); } | patbinds1 { $$ = haskellParser::execute('patbinds', array($1)); } ; patbinds1 : patbinds1 ',' patbind { $$ = haskellParser::execute('patbinds1', array($1, $2, $3)); } | patbind { $$ = haskellParser::execute('patbinds1', array($1)); } ; patbind : qvar '=' pat { $$ = haskellParser::execute('patbind', array($1, $2, $3)); } | var { $$ = haskellParser::execute('patbind', array($1)); } ; /*#if TREX*/ patfields : patfields ',' patfield { $$ = haskellParser::execute('patfields', array($1, $2, $3)); } | patfield { $$ = haskellParser::execute('patfields', array($1)); } ; patfield : varid '=' pat { $$ = haskellParser::execute('patfield', array($1, $2, $3)); } ; /*#endif TREX*/ /*- Expressions: ----------------------------------------------------------*/ exp : exp_err { $$ = haskellParser::execute('exp', array($1)); } | error { $$ = haskellParser::execute('exp', array($1)); } ; exp_err : exp0a COCO sigType { $$ = haskellParser::execute('exp_err', array($1, $2, $3)); } | exp0 { $$ = haskellParser::execute('exp_err', array($1)); } ; exp0 : exp0a { $$ = haskellParser::execute('exp0', array($1)); } | exp0b { $$ = haskellParser::execute('exp0', array($1)); } ; exp0a : infixExpa { $$ = haskellParser::execute('exp0a', array($1)); } | exp10a { $$ = haskellParser::execute('exp0a', array($1)); } ; exp0b : infixExpb { $$ = haskellParser::execute('exp0b', array($1)); } | exp10b { $$ = haskellParser::execute('exp0b', array($1)); } ; infixExpa : infixExpa qop '-' exp10a { $$ = haskellParser::execute('infixExpa', array($1, $2, $3, $4)); } | infixExpa qop exp10a { $$ = haskellParser::execute('infixExpa', array($1, $2, $3)); } | '-' exp10a { $$ = haskellParser::execute('infixExpa', array($1, $2)); } | exp10a qop '-' exp10a { $$ = haskellParser::execute('infixExpa', array($1, $2, $3, $4)); } | exp10a qop exp10a { $$ = haskellParser::execute('infixExpa', array($1, $2, $3)); } ; infixExpb : infixExpa qop '-' exp10b { $$ = haskellParser::execute('infixExpb', array($1, $2, $3, $4)); } | infixExpa qop exp10b { $$ = haskellParser::execute('infixExpb', array($1, $2, $3)); } | '-' exp10b { $$ = haskellParser::execute('infixExpb', array($1, $2)); } | exp10a qop '-' exp10b { $$ = haskellParser::execute('infixExpb', array($1, $2, $3, $4)); } | exp10a qop exp10b { $$ = haskellParser::execute('infixExpb', array($1, $2, $3)); } ; exp10a : CASEXP exp OF '{' alts end { $$ = haskellParser::execute('exp10a', array($1, $2, $3, $4, $5, $6)); } | DO_T '{' stmts end { $$ = haskellParser::execute('exp10a', array($1, $2, $3, $4)); } | MDO '{' stmts end { $$ = haskellParser::execute('exp10a', array($1, $2, $3, $4)); } | appExp { $$ = haskellParser::execute('exp10a', array($1)); } ; exp10b : '\\' pats ARROW exp { $$ = haskellParser::execute('exp10b', array($1, $2, $3, $4)); } | LET ldecls IN exp { $$ = haskellParser::execute('exp10b', array($1, $2, $3, $4)); } | IF_T exp then_exp else_exp { $$ = haskellParser::execute('exp10b', array($1, $2, $3, $4)); } ; /* Allow optional semicolons before 'then' and 'else' (as suggested by John Meacham), to remove a common pitfall when using if-then-else inside do expressions with implicit layout. */ then_exp : ';' THEN exp { $$ = haskellParser::execute('then_exp', array($1, $2, $3)); } | THEN exp { $$ = haskellParser::execute('then_exp', array($1, $2)); } ; else_exp : ';' ELSE_T exp { $$ = haskellParser::execute('else_exp', array($1, $2, $3)); } | ELSE_T exp { $$ = haskellParser::execute('else_exp', array($1, $2)); } ; pats : pats apat { $$ = haskellParser::execute('pats', array($1, $2)); } | apat { $$ = haskellParser::execute('pats', array($1)); } ; appExp : appExp aexp { $$ = haskellParser::execute('appExp', array($1, $2)); } | aexp { $$ = haskellParser::execute('appExp', array($1)); } ; aexp : qvar { $$ = haskellParser::execute('aexp', array($1)); } | qvar '@' aexp { $$ = haskellParser::execute('aexp', array($1, $2, $3)); } | '~' aexp { $$ = haskellParser::execute('aexp', array($1, $2)); } | IPVARID { $$ = haskellParser::execute('aexp', array($1)); } | '_' { $$ = haskellParser::execute('aexp', array($1)); } | gcon { $$ = haskellParser::execute('aexp', array($1)); } | qcon '{' fbinds '}' { $$ = haskellParser::execute('aexp', array($1, $2, $3, $4)); } | aexp '{' fbinds '}' { $$ = haskellParser::execute('aexp', array($1, $2, $3, $4)); } | NUMLIT { $$ = haskellParser::execute('aexp', array($1)); } | CHARLIT { $$ = haskellParser::execute('aexp', array($1)); } | STRINGLIT { $$ = haskellParser::execute('aexp', array($1)); } | REPEAT { $$ = haskellParser::execute('aexp', array($1)); } | '(' exp ')' { $$ = haskellParser::execute('aexp', array($1, $2, $3)); } | '(' exps2 ')' /*#if TREX*/ { $$ = haskellParser::execute('aexp', array($1, $2, $3)); } | '(' vfields ')' { $$ = haskellParser::execute('aexp', array($1, $2, $3)); } | '(' vfields '|' exp ')' { $$ = haskellParser::execute('aexp', array($1, $2, $3, $4, $5)); } | RECSELID /*#endif*/ { $$ = haskellParser::execute('aexp', array($1)); } | '[' list ']' { $$ = haskellParser::execute('aexp', array($1, $2, $3)); } | '(' exp10a qop ')' { $$ = haskellParser::execute('aexp', array($1, $2, $3, $4)); } | '(' qvarop_mi exp0 ')' { $$ = haskellParser::execute('aexp', array($1, $2, $3, $4)); } | '(' qconop exp0 ')' { $$ = haskellParser::execute('aexp', array($1, $2, $3, $4)); } ; exps2 : exps2 ',' exp { $$ = haskellParser::execute('exps2', array($1, $2, $3)); } | exp ',' exp { $$ = haskellParser::execute('exps2', array($1, $2, $3)); } ; /*#if TREX*/ vfields : vfields ',' vfield { $$ = haskellParser::execute('vfields', array($1, $2, $3)); } | vfield { $$ = haskellParser::execute('vfields', array($1)); } ; vfield : varid '=' exp { $$ = haskellParser::execute('vfield', array($1, $2, $3)); } ; /*#endif*/ alts : alts1 { $$ = haskellParser::execute('alts', array($1)); } | ';' alts { $$ = haskellParser::execute('alts', array($1, $2)); } ; alts1 : alts1 ';' alt { $$ = haskellParser::execute('alts1', array($1, $2, $3)); } | alts1 ';' { $$ = haskellParser::execute('alts1', array($1, $2)); } | alt { $$ = haskellParser::execute('alts1', array($1)); } ; alt : pat altRhs wherePart { $$ = haskellParser::execute('alt', array($1, $2, $3)); } ; altRhs : guardAlts { $$ = haskellParser::execute('altRhs', array($1)); } | ARROW exp { $$ = haskellParser::execute('altRhs', array($1, $2)); } | error { $$ = haskellParser::execute('altRhs', array($1)); } ; guardAlts : guardAlts guardAlt { $$ = haskellParser::execute('guardAlts', array($1, $2)); } | guardAlt { $$ = haskellParser::execute('guardAlts', array($1)); } ; guardAlt : '|' exp0 ARROW exp { $$ = haskellParser::execute('guardAlt', array($1, $2, $3, $4)); } ; stmts : stmts1 { $$ = haskellParser::execute('stmts', array($1)); } | ';' stmts { $$ = haskellParser::execute('stmts', array($1, $2)); } ; stmts1 : stmts1 ';' stmt { $$ = haskellParser::execute('stmts1', array($1, $2, $3)); } | stmts1 ';' { $$ = haskellParser::execute('stmts1', array($1, $2)); } | stmt { $$ = haskellParser::execute('stmts1', array($1)); } ; stmt : exp_err FROM exp { $$ = haskellParser::execute('stmt', array($1, $2, $3)); } | LET ldecls /* | IF_T exp */ { $$ = haskellParser::execute('stmt', array($1, $2)); } | exp_err { $$ = haskellParser::execute('stmt', array($1)); } ; fbinds : /* empty */ { $$ = haskellParser::execute('fbinds', array()); } | fbinds1 { $$ = haskellParser::execute('fbinds', array($1)); } ; fbinds1 : fbinds1 ',' fbind { $$ = haskellParser::execute('fbinds1', array($1, $2, $3)); } | fbind { $$ = haskellParser::execute('fbinds1', array($1)); } ; fbind : var { $$ = haskellParser::execute('fbind', array($1)); } | qvar '=' exp { $$ = haskellParser::execute('fbind', array($1, $2, $3)); } ; /*- List Expressions: -------------------------------------------------------*/ list : exp { $$ = haskellParser::execute('list', array($1)); } | exps2 { $$ = haskellParser::execute('list', array($1)); } | exp zipquals { $$ = haskellParser::execute('list', array($1, $2)); } | exp UPTO exp { $$ = haskellParser::execute('list', array($1, $2, $3)); } | exp ',' exp UPTO { $$ = haskellParser::execute('list', array($1, $2, $3, $4)); } | exp UPTO { $$ = haskellParser::execute('list', array($1, $2)); } | exp ',' exp UPTO exp { $$ = haskellParser::execute('list', array($1, $2, $3, $4, $5)); } ; zipquals : zipquals '|' quals { $$ = haskellParser::execute('zipquals', array($1, $2, $3)); } | '|' quals { $$ = haskellParser::execute('zipquals', array($1, $2)); } ; quals : quals ',' qual { $$ = haskellParser::execute('quals', array($1, $2, $3)); } | qual { $$ = haskellParser::execute('quals', array($1)); } ; qual : exp FROM exp { $$ = haskellParser::execute('qual', array($1, $2, $3)); } | exp { $$ = haskellParser::execute('qual', array($1)); } | LET ldecls { $$ = haskellParser::execute('qual', array($1, $2)); } ; /*- Identifiers and symbols: ----------------------------------------------*/ gcon : qcon { $$ = haskellParser::execute('gcon', array($1)); } | '(' ')' { $$ = haskellParser::execute('gcon', array($1, $2)); } | '[' ']' { $$ = haskellParser::execute('gcon', array($1, $2)); } | '(' tupCommas ')' { $$ = haskellParser::execute('gcon', array($1, $2, $3)); } ; tupCommas : tupCommas ',' { $$ = haskellParser::execute('tupCommas', array($1, $2)); } | ',' { $$ = haskellParser::execute('tupCommas', array($1)); } ; varid : VARID { $$ = haskellParser::execute('varid', array($1)); } | HIDING { $$ = haskellParser::execute('varid', array($1)); } | QUALIFIED { $$ = haskellParser::execute('varid', array($1)); } | ASMOD { $$ = haskellParser::execute('varid', array($1)); } ; qconid : QCONID { $$ = haskellParser::execute('qconid', array($1)); } | CONID { $$ = haskellParser::execute('qconid', array($1)); } ; var : varid { $$ = haskellParser::execute('var', array($1)); } | '(' VAROP ')' { $$ = haskellParser::execute('var', array($1, $2, $3)); } | '(' '+' ')' { $$ = haskellParser::execute('var', array($1, $2, $3)); } | '(' '-' ')' { $$ = haskellParser::execute('var', array($1, $2, $3)); } | '(' '!' ')' { $$ = haskellParser::execute('var', array($1, $2, $3)); } | '(' '.' ')' { $$ = haskellParser::execute('var', array($1, $2, $3)); } ; qvar : QVARID { $$ = haskellParser::execute('qvar', array($1)); } | '(' QVAROP ')' { $$ = haskellParser::execute('qvar', array($1, $2, $3)); } | var { $$ = haskellParser::execute('qvar', array($1)); } ; con : CONID { $$ = haskellParser::execute('con', array($1)); } | '(' CONOP ')' { $$ = haskellParser::execute('con', array($1, $2, $3)); } ; qcon : QCONID { $$ = haskellParser::execute('qcon', array($1)); } | '(' QCONOP ')' { $$ = haskellParser::execute('qcon', array($1, $2, $3)); } | con { $$ = haskellParser::execute('qcon', array($1)); } ; varop : '+' { $$ = haskellParser::execute('varop', array($1)); } | '-' { $$ = haskellParser::execute('varop', array($1)); } | varop_mipl { $$ = haskellParser::execute('varop', array($1)); } ; varop_mi : '+' { $$ = haskellParser::execute('varop_mi', array($1)); } | varop_mipl { $$ = haskellParser::execute('varop_mi', array($1)); } ; varop_pl : '-' { $$ = haskellParser::execute('varop_pl', array($1)); } | varop_mipl { $$ = haskellParser::execute('varop_pl', array($1)); } ; varop_mipl: VAROP { $$ = haskellParser::execute('varop_mipl', array($1)); } | '`' varid '`' { $$ = haskellParser::execute('varop_mipl', array($1, $2, $3)); } | '!' { $$ = haskellParser::execute('varop_mipl', array($1)); } | '.' { $$ = haskellParser::execute('varop_mipl', array($1)); } ; qvarop : '-' { $$ = haskellParser::execute('qvarop', array($1)); } | qvarop_mi { $$ = haskellParser::execute('qvarop', array($1)); } ; qvarop_mi : QVAROP { $$ = haskellParser::execute('qvarop_mi', array($1)); } | '`' QVARID '`' { $$ = haskellParser::execute('qvarop_mi', array($1, $2, $3)); } | varop_mi { $$ = haskellParser::execute('qvarop_mi', array($1)); } ; conop : CONOP { $$ = haskellParser::execute('conop', array($1)); } | '`' CONID '`' { $$ = haskellParser::execute('conop', array($1, $2, $3)); } ; qconop : QCONOP { $$ = haskellParser::execute('qconop', array($1)); } | '`' QCONID '`' { $$ = haskellParser::execute('qconop', array($1, $2, $3)); } | conop { $$ = haskellParser::execute('qconop', array($1)); } ; op : varop { $$ = haskellParser::execute('op', array($1)); } | conop { $$ = haskellParser::execute('op', array($1)); } ; qop : qvarop { $$ = haskellParser::execute('qop', array($1)); } | qconop { $$ = haskellParser::execute('qop', array($1)); } ; /*- Tricks to force insertion of leading and closing braces ---------------*/ begin : /* empty */ { $$ = haskellParser::execute('begin', array()); } ; /* deal with trailing semicolon */ end : '}' { $$ = haskellParser::execute('end', array($1)); } | error { $$ = haskellParser::execute('end', array($1)); } ; /*-------------------------------------------------------------------------*/ %%