[Fencommits] fenfire-hs: integrate the haskell-src-exts code into the fenfire-hs repository
Benja Fallenstein
benja.fallenstein at gmail.com
Mon Feb 12 19:32:19 EET 2007
Mon Feb 12 19:27:43 EET 2007 Benja Fallenstein <benja.fallenstein at gmail.com>
* integrate the haskell-src-exts code into the fenfire-hs repository
diff -rN -u old-fenfire-hs/fenfire.cabal new-fenfire-hs/fenfire.cabal
--- old-fenfire-hs/fenfire.cabal 2007-02-12 19:32:17.000000000 +0200
+++ new-fenfire-hs/fenfire.cabal 2007-02-12 19:32:17.000000000 +0200
@@ -6,14 +6,13 @@
Synopsis: Notetaking system
Stability: alpha
Homepage: http://fenfire.org/
-Build-Depends: base, HaXml, haskell-src-exts, purefun, gtk, mtl, unix, cairo,
- harp
+Build-Depends: base, HaXml, gtk, mtl, unix, cairo, harp, template-haskell
Data-Files: data/logo.svg data/logo48.png
Extra-Source-Files: README
Executable: fenfire
Main-Is: Fenfire.hs
-Other-Modules: Fenfire, Vobs, RDF, Cache, Cairo, Utils, Raptor
+Other-Modules: Fenfire, Vobs, RDF, Cache, Cairo, Utils, Raptor, FunctorSugar
GHC-Options: -fglasgow-exts -hide-package haskell98 -Wall
-fno-warn-unused-imports -fno-warn-missing-signatures
-fno-warn-orphans -fno-warn-deprecations -main-is Fenfire.main
@@ -21,7 +20,7 @@
Executable: functortest
Main-Is: FunctorTest.hs
-Other-Modules: FunctorTest
+Other-Modules: FunctorTest, FunctorSugar
GHC-Options: -fglasgow-exts -hide-package haskell98 -Wall
-fno-warn-unused-imports -fno-warn-missing-signatures
-fno-warn-orphans -fno-warn-deprecations
@@ -29,14 +28,14 @@
Executable: vobtest
Main-Is: VobTest.hs
-Other-Modules: VobTest, Vobs, Cairo, Utils
+Other-Modules: VobTest, Vobs, Cairo, Utils, FunctorSugar
GHC-Options: -fglasgow-exts -hide-package haskell98 -Wall
-fno-warn-unused-imports -fno-warn-missing-signatures
-fno-warn-orphans -fno-warn-deprecations -main-is VobTest.main
Executable: darcs2rdf
Main-Is: Darcs2RDF.hs
-Other-Modules: Darcs2RDF
+Other-Modules: Darcs2RDF, FunctorSugar
GHC-Options: -fglasgow-exts -hide-package haskell98 -Wall
-fno-warn-unused-imports -fno-warn-missing-signatures
-fno-warn-orphans -fno-warn-deprecations
diff -rN -u old-fenfire-hs/FunctorSugar.hs new-fenfire-hs/FunctorSugar.hs
--- old-fenfire-hs/FunctorSugar.hs 1970-01-01 02:00:00.000000000 +0200
+++ new-fenfire-hs/FunctorSugar.hs 2007-02-12 19:32:17.000000000 +0200
@@ -0,0 +1,100 @@
+{-# OPTIONS_GHC -fth #-}
+module FunctorSugar where
+
+import Control.Applicative
+import Control.Monad
+import Control.Monad.Writer
+import Data.Maybe
+import Language.Haskell.TH
+import System.IO.Unsafe
+
+functorCall :: Functor f => f a -> a
+functorCall x = error "Eeene meene miste es rappelt in der kiste"
+
+fzip :: Applicative f => f a -> f b -> f (a,b)
+fzip a b = pure (\x y -> (x,y)) <*> a <*> b
+
+fcurry :: Applicative f => (f (a,b) -> c) -> f a -> f b -> c
+fcurry f x y = f (fzip x y)
+
+functorSugar :: ExpQ -> ExpQ
+functorSugar expQ = do exp <- expQ
+ (exp', calls) <- runWriterT (traverse exp)
+ appsE ([mkFMap $ length calls,
+ lamE (map (varP . fst) calls) $ return exp']
+ ++ map (return . snd) calls)
+
+mkFMap :: Int -> ExpQ
+mkFMap 0 = [| pure |]
+mkFMap 1 = [| fmap |]
+mkFMap n = [| \f -> $(repeatFn (n-1) [| fcurry |])
+ (fmap ($(repeatFn (n-1) [| uncurry |]) f)) |]
+ where repeatFn :: Int -> ExpQ -> ExpQ
+ repeatFn 1 e = e
+ repeatFn n e = [| $e . $(repeatFn (n-1) e) |]
+
+callExpr :: Exp
+callExpr = unsafePerformIO $ runQ [| FunctorSugar.functorCall |]
+
+type Binds = [(Name, Exp)]
+type Traverse a = a -> WriterT Binds Q a
+
+traverse :: Traverse Exp
+traverse e = case e of
+ VarE name -> return (VarE name)
+ ConE name -> return (ConE name)
+ LitE lit -> return (LitE lit)
+ AppE e1 e2 | e1 == callExpr -> do name <- lift $ newName "call"
+ tell [(name, e2)]
+ return (VarE name)
+ AppE e1 e2 -> liftM2 AppE (traverse e1) (traverse e2)
+ InfixE el ei er -> do ei' <- traverse ei
+ el' <- maybe (return Nothing)
+ (liftM Just . traverse) el
+ er' <- maybe (return Nothing)
+ (liftM Just . traverse) er
+ return (InfixE el' ei' er')
+ LamE pats e -> liftM (LamE pats) (traverse e)
+ TupE exps -> liftM TupE (mapM traverse exps)
+ LetE decls e -> liftM2 LetE (mapM traverseDec decls) (traverse e)
+ ListE exps -> liftM ListE (mapM traverse exps)
+ SigE e type' -> liftM (flip SigE type') (traverse e)
+ DoE stmts -> liftM DoE (mapM traverseStmt stmts)
+ CompE stmts -> liftM CompE (mapM traverseStmt stmts)
+ e -> error ("expression type not implemented yet: " ++ show e)
+
+traverseDec :: Traverse Dec
+traverseDec decl = case decl of
+ FunD name clauses -> liftM (FunD name) (mapM traverseClause clauses)
+ ValD pat body decls -> liftM2 (ValD pat) (traverseBody body)
+ (mapM traverseDec decls)
+ SigD name type' -> return (SigD name type')
+ -- ... possibly other things but I <benja> think not ... --
+ d -> error ("declaration type not implemented: " ++ show d)
+
+traverseClause :: Traverse Clause
+traverseClause (Clause pats body decls) =
+ liftM2 (Clause pats) (traverseBody body) (mapM traverseDec decls)
+
+traverseBody :: Traverse Body
+traverseBody (NormalB e) = liftM NormalB (traverse e)
+traverseBody (GuardedB bs) = liftM GuardedB $ forM bs $ \(g,e) ->
+ do e' <- traverse e; return (g,e')
+
+traverseStmt :: Traverse Stmt
+traverseStmt stmt = case stmt of
+ BindS pat exp -> liftM (BindS pat) (traverse exp)
+ LetS decs -> liftM LetS (mapM traverseDec decs)
+ NoBindS exp -> liftM NoBindS (traverse exp)
+ ParS stmts -> liftM ParS (mapM (mapM traverseStmt) stmts)
+
+{-
+CondE Exp Exp Exp
+LetE [Dec] Exp
+CaseE Exp [Match]
+ArithSeqE Range
+ListE [Exp]
+SigE Exp Type
+RecConE Name [FieldExp]
+RecUpdE Exp [FieldExp]
+-}
diff -rN -u old-fenfire-hs/Preprocessor/Hsx/Build.hs new-fenfire-hs/Preprocessor/Hsx/Build.hs
--- old-fenfire-hs/Preprocessor/Hsx/Build.hs 1970-01-01 02:00:00.000000000 +0200
+++ new-fenfire-hs/Preprocessor/Hsx/Build.hs 2007-02-12 19:32:17.000000000 +0200
@@ -0,0 +1,235 @@
+-----------------------------------------------------------------------------
+-- |
+-- Module : Preprocessor.Hsx.Build
+-- Original : Language.Haskell.Syntax
+-- Copyright : (c) The GHC Team, 1997-2000,
+-- (c) Niklas Broberg 2004
+-- License : BSD-style (see the file LICENSE.txt)
+--
+-- Maintainer : Niklas Broberg, d00nibro at dtek.chalmers.se
+-- Stability : experimental
+-- Portability : portable
+--
+-----------------------------------------------------------------------------
+
+module Preprocessor.Hsx.Build (
+
+ -- * Syntax building functions
+ name, -- :: String -> HsName
+ sym, -- :: String -> HsName
+ var, -- :: HsName -> HsExp
+ op, -- :: HsName -> HsQOp
+ qvar, -- :: Module -> HsName -> HsExp
+ pvar, -- :: HsName -> HsPat
+ app, -- :: HsExp -> HsExp -> HsExp
+ infixApp, -- :: HsExp -> HsQOp -> HsExp -> HsExp
+ appFun, -- :: HsExp -> [HsExp] -> HsExp
+ pApp, -- :: HsName -> [HsPat] -> HsPat
+ tuple, -- :: [HsExp] -> HsExp
+ pTuple, -- :: [HsPat] -> HsPat
+ varTuple, -- :: [HsName] -> HsExp
+ pvarTuple, -- :: [HsName] -> HsPat
+ function, -- :: String -> HsExp
+ strE, -- :: String -> HsExp
+ charE, -- :: Char -> HsExp
+ intE, -- :: Integer -> HsExp
+ strP, -- :: String -> HsPat
+ charP, -- :: Char -> HsPat
+ intP, -- :: Integer -> HsPat
+ doE, -- :: [HsStmt] -> HsExp
+ lamE, -- :: SrcLoc -> [HsPat] -> HsExp -> HsExp
+ letE, -- :: [HsDecl] -> HsExp -> HsExp
+ caseE, -- :: HsExp -> [HsAlt] -> HsExp
+ alt, -- :: SrcLoc -> HsPat -> HsExp -> HsAlt
+ altGW, -- :: SrcLoc -> HsPat -> [HsStmt] -> HsExp -> HsBinds -> HsAlt
+ listE, -- :: [HsExp] -> HsExp
+ eList, -- :: HsExp
+ peList, -- :: HsPat
+ paren, -- :: HsExp -> HsExp
+ pParen, -- :: HsPat -> HsPat
+ qualStmt, -- :: HsExp -> HsStmt
+ genStmt, -- :: SrcLoc -> HsPat -> HsExp -> HsStmt
+ letStmt, -- :: [HsDecl] -> HsStmt
+ binds, -- :: [HsDecl] -> HsBinds
+ noBinds, -- :: HsBinds
+ wildcard, -- :: HsPat
+ genNames, -- :: String -> Int -> [HsName]
+
+ -- * More advanced building
+ sfun, -- :: SrcLoc -> HsName -> [HsName] -> HsRhs -> HsBinds -> HsDecl
+ simpleFun, -- :: SrcLoc -> HsName -> HsName -> HsExp -> HsDecl
+ patBind, -- :: SrcLoc -> HsPat -> HsExp -> HsDecl
+ patBindWhere, -- :: SrcLoc -> HsPat -> HsExp -> [HsDecl] -> HsDecl
+ nameBind, -- :: SrcLoc -> HsName -> HsExp -> HsDecl
+ metaFunction, -- :: String -> [HsExp] -> HsExp
+ metaConPat -- :: String -> [HsPat] -> HsPat
+ ) where
+
+import Preprocessor.Hsx.Syntax
+
+-----------------------------------------------------------------------------
+-- Help functions for Abstract syntax
+
+name :: String -> HsName
+name = HsIdent
+
+sym :: String -> HsName
+sym = HsSymbol
+
+var :: HsName -> HsExp
+var = HsVar . UnQual
+
+op :: HsName -> HsQOp
+op = HsQVarOp . UnQual
+
+qvar :: Module -> HsName -> HsExp
+qvar m n = HsVar $ Qual m n
+
+pvar :: HsName -> HsPat
+pvar = HsPVar
+
+app :: HsExp -> HsExp -> HsExp
+app = HsApp
+
+infixApp :: HsExp -> HsQOp -> HsExp -> HsExp
+infixApp = HsInfixApp
+
+appFun :: HsExp -> [HsExp] -> HsExp
+appFun f [] = f
+appFun f (a:as) = appFun (app f a) as
+
+pApp :: HsName -> [HsPat] -> HsPat
+pApp n ps = HsPApp (UnQual n) ps
+
+tuple :: [HsExp] -> HsExp
+tuple = HsTuple
+
+pTuple :: [HsPat] -> HsPat
+pTuple = HsPTuple
+
+varTuple :: [HsName] -> HsExp
+varTuple ns = tuple $ map var ns
+
+pvarTuple :: [HsName] -> HsPat
+pvarTuple ns = pTuple $ map pvar ns
+
+function :: String -> HsExp
+function = var . HsIdent
+
+strE :: String -> HsExp
+strE = HsLit . HsString
+
+charE :: Char -> HsExp
+charE = HsLit . HsChar
+
+intE :: Integer -> HsExp
+intE = HsLit . HsInt
+
+strP :: String -> HsPat
+strP = HsPLit . HsString
+
+charP :: Char -> HsPat
+charP = HsPLit . HsChar
+
+intP :: Integer -> HsPat
+intP = HsPLit . HsInt
+
+doE :: [HsStmt] -> HsExp
+doE = HsDo
+
+lamE :: SrcLoc -> [HsPat] -> HsExp -> HsExp
+lamE = HsLambda
+
+letE :: [HsDecl] -> HsExp -> HsExp
+letE ds e = HsLet (binds ds) e
+
+caseE :: HsExp -> [HsAlt] -> HsExp
+caseE = HsCase
+
+alt :: SrcLoc -> HsPat -> HsExp -> HsAlt
+alt s p e = HsAlt s p (HsUnGuardedAlt e) noBinds
+
+altGW :: SrcLoc -> HsPat -> [HsStmt] -> HsExp -> HsBinds -> HsAlt
+altGW s p gs e w = HsAlt s p (gAlt s gs e) w
+
+unGAlt :: HsExp -> HsGuardedAlts
+unGAlt = HsUnGuardedAlt
+
+gAlts :: SrcLoc -> [([HsStmt],HsExp)] -> HsGuardedAlts
+gAlts s as = HsGuardedAlts $ map (\(gs,e) -> HsGuardedAlt s gs e) as
+
+gAlt :: SrcLoc -> [HsStmt] -> HsExp -> HsGuardedAlts
+gAlt s gs e = gAlts s [(gs,e)]
+
+listE :: [HsExp] -> HsExp
+listE = HsList
+
+eList :: HsExp
+eList = HsList []
+
+peList :: HsPat
+peList = HsPList []
+
+paren :: HsExp -> HsExp
+paren = HsParen
+
+pParen :: HsPat -> HsPat
+pParen = HsPParen
+
+qualStmt :: HsExp -> HsStmt
+qualStmt = HsQualifier
+
+genStmt :: SrcLoc -> HsPat -> HsExp -> HsStmt
+genStmt = HsGenerator
+
+letStmt :: [HsDecl] -> HsStmt
+letStmt ds = HsLetStmt $ binds ds
+
+binds :: [HsDecl] -> HsBinds
+binds = HsBDecls
+
+noBinds :: HsBinds
+noBinds = binds []
+
+wildcard :: HsPat
+wildcard = HsPWildCard
+
+genNames :: String -> Int -> [HsName]
+genNames s k = [ HsIdent $ s ++ show i | i <- [1..k] ]
+
+-------------------------------------------------------------------------------
+-- Some more specialised help functions
+
+-- | A function with a single "match"
+sfun :: SrcLoc -> HsName -> [HsName] -> HsRhs -> HsBinds -> HsDecl
+sfun s f pvs rhs bs = HsFunBind [HsMatch s f (map pvar pvs) rhs bs]
+
+-- | A function with a single "match", a single argument, no guards
+-- and no where declarations
+simpleFun :: SrcLoc -> HsName -> HsName -> HsExp -> HsDecl
+simpleFun s f a e = let rhs = HsUnGuardedRhs e
+ in sfun s f [a] rhs noBinds
+
+-- | A pattern bind where the pattern is a variable, and where
+-- there are no guards and no 'where' clause.
+patBind :: SrcLoc -> HsPat -> HsExp -> HsDecl
+patBind s p e = let rhs = HsUnGuardedRhs e
+ in HsPatBind s p rhs noBinds
+
+patBindWhere :: SrcLoc -> HsPat -> HsExp -> [HsDecl] -> HsDecl
+patBindWhere s p e ds = let rhs = HsUnGuardedRhs e
+ in HsPatBind s p rhs (binds ds)
+
+nameBind :: SrcLoc -> HsName -> HsExp -> HsDecl
+nameBind s n e = patBind s (pvar n) e
+
+-- meta-level functions, i.e. functions that represent functions,
+-- and that take arguments representing arguments... whew!
+metaFunction :: String -> [HsExp] -> HsExp
+metaFunction s es = mf s (reverse es)
+ where mf s [] = var $ name s
+ mf s (e:es) = app (mf s es) e
+
+
+metaConPat :: String -> [HsPat] -> HsPat
+metaConPat s ps = pApp (name s) ps
diff -rN -u old-fenfire-hs/Preprocessor/Hsx/Lexer.hs new-fenfire-hs/Preprocessor/Hsx/Lexer.hs
--- old-fenfire-hs/Preprocessor/Hsx/Lexer.hs 1970-01-01 02:00:00.000000000 +0200
+++ new-fenfire-hs/Preprocessor/Hsx/Lexer.hs 2007-02-12 19:32:17.000000000 +0200
@@ -0,0 +1,829 @@
+-- #hide
+-----------------------------------------------------------------------------
+-- |
+-- Module : Preprocessor.Hsx.Lexer
+-- Original : Language.Haskell.Lexer
+-- Copyright : (c) The GHC Team, 1997-2000
+-- (c) Niklas Broberg, 2004
+-- License : BSD-style (see the file LICENSE.txt)
+--
+-- Maintainer : Niklas Broberg, d00nibro at dtek.chalmers.se
+-- Stability : experimental
+-- Portability : portable
+--
+-- Lexer for Haskell, with some extensions.
+--
+-----------------------------------------------------------------------------
+
+-- ToDo: Introduce different tokens for decimal, octal and hexadecimal (?)
+-- ToDo: FloatTok should have three parts (integer part, fraction, exponent) (?)
+-- ToDo: Use a lexical analyser generator (lx?)
+
+module Preprocessor.Hsx.Lexer (Token(..), lexer) where
+
+import Preprocessor.Hsx.ParseMonad
+
+import Data.Char
+import Data.Ratio
+
+data Token
+ = VarId String
+ | QVarId (String,String)
+ | IDupVarId (String) -- duplicable implicit parameter
+ | ILinVarId (String) -- linear implicit parameter
+ | ConId String
+ | QConId (String,String)
+ | DVarId [String] -- to enable varid's with '-' in them
+ | VarSym String
+ | ConSym String
+ | QVarSym (String,String)
+ | QConSym (String,String)
+ | IntTok Integer
+ | FloatTok Rational
+ | Character Char
+ | StringTok String
+ | Pragma String
+
+-- Symbols
+
+ | LeftParen
+ | RightParen
+ | LeftHashParen
+ | RightHashParen
+ | SemiColon
+ | LeftCurly
+ | RightCurly
+ | VRightCurly -- a virtual close brace
+ | LeftSquare
+ | RightSquare
+ | Comma
+ | Underscore
+ | BackQuote
+
+-- Reserved operators
+
+ | Dot -- reserved for use with 'forall x . x'
+ | DotDot
+ | Colon
+ | DoubleColon
+ | Equals
+ | Backslash
+ | Bar
+ | LeftArrow
+ | RightArrow
+ | At
+ | Tilde
+ | DoubleArrow
+ | Minus
+ | Exclamation
+
+-- Template Haskell
+ | THExpQuote -- [| or [e|
+ | THPatQuote -- [p|
+ | THDecQuote -- [d|
+ | THTypQuote -- [t|
+ | THCloseQuote -- |]
+ | THIdEscape (String) -- $x
+ | THParenEscape -- $(
+ | THReifyType
+ | THReifyDecl
+ | THReifyFixity
+
+-- HaRP
+ | RPOpen -- [/
+ | RPClose -- /]
+ | RPSeqOpen -- (/
+ | RPSeqClose -- /)
+ | RPStar -- *
+ | RPStarG -- *!
+ | RPOpt -- ?
+ | RPOptG -- ?!
+ | RPPlus -- +
+ | RPPlusG -- +!
+ | RPEither -- |
+ | RPCAt -- @:
+
+-- Hsx
+ | XCodeTagOpen -- <%
+ | XCodeTagClose -- %>
+ | XStdTagOpen -- <
+ | XStdTagClose -- >
+ | XCloseTagOpen -- </
+ | XEmptyTagClose -- />
+ | XPcdata String
+
+-- Functor sugar
+ | Hash -- #
+
+-- Reserved Ids
+
+ | KW_As
+ | KW_Case
+ | KW_Class
+ | KW_Data
+ | KW_Default
+ | KW_Deriving
+ | KW_DLet -- implictit parameter binding
+ | KW_Do
+ | KW_MDo
+ | KW_Else
+ | KW_Forall -- universal/existential types
+ | KW_Hiding
+ | KW_If
+ | KW_Import
+ | KW_In
+ | KW_Infix
+ | KW_InfixL
+ | KW_InfixR
+ | KW_Instance
+ | KW_Let
+ | KW_Module
+ | KW_NewType
+ | KW_Of
+ | KW_Then
+ | KW_Type
+ | KW_Where
+ | KW_With -- implicit parameter binding
+ | KW_Qualified
+
+ -- FFI
+ | KW_Foreign
+ | KW_Export
+ | KW_Safe
+ | KW_Unsafe
+ | KW_Threadsafe
+ | KW_StdCall
+ | KW_CCall
+
+ | EOF
+ deriving (Eq,Show)
+
+reserved_ops :: [(String,Token)]
+reserved_ops = [
+ ( ".", Dot ),
+ ( "..", DotDot ),
+ ( ":", Colon ),
+ ( "::", DoubleColon ),
+ ( "=", Equals ),
+ ( "\\", Backslash ),
+ ( "|", Bar ),
+ ( "<-", LeftArrow ),
+ ( "->", RightArrow ),
+ ( "@", At ),
+ ( "~", Tilde ),
+ ( "=>", DoubleArrow ),
+ ( "#", Hash )
+ ]
+
+special_varops :: [(String,Token)]
+special_varops = [
+ ( "-", Minus ), --ToDo: shouldn't be here
+ ( "!", Exclamation ) --ditto
+ ]
+
+reserved_ids :: [(String,Token)]
+reserved_ids = [
+ ( "_", Underscore ),
+ ( "case", KW_Case ),
+ ( "class", KW_Class ),
+ ( "data", KW_Data ),
+ ( "default", KW_Default ),
+ ( "deriving", KW_Deriving ),
+ ( "dlet", KW_DLet ), -- implicit parameters (hugs)
+ ( "do", KW_Do ),
+ ( "else", KW_Else ),
+ ( "forall", KW_Forall ), -- universal/existential quantification
+ ( "if", KW_If ),
+ ( "import", KW_Import ),
+ ( "in", KW_In ),
+ ( "infix", KW_Infix ),
+ ( "infixl", KW_InfixL ),
+ ( "infixr", KW_InfixR ),
+ ( "instance", KW_Instance ),
+ ( "let", KW_Let ),
+ ( "mdo", KW_MDo ),
+ ( "module", KW_Module ),
+ ( "newtype", KW_NewType ),
+ ( "of", KW_Of ),
+ ( "then", KW_Then ),
+ ( "type", KW_Type ),
+ ( "where", KW_Where ),
+ ( "with", KW_With ), -- implicit parameters
+
+-- Template Haskell
+ ( "reifyDecl", THReifyDecl ),
+ ( "reifyType", THReifyType ),
+ ( "reifyFixity", THReifyFixity ),
+
+-- FFI
+ ( "foreign", KW_Foreign )
+ ]
+
+
+special_varids :: [(String,Token)]
+special_varids = [
+ ( "as", KW_As ),
+ ( "qualified", KW_Qualified ),
+ ( "hiding", KW_Hiding ),
+
+-- FFI
+ ( "export", KW_Export),
+ ( "safe", KW_Safe),
+ ( "unsafe", KW_Unsafe),
+ ( "threadsafe", KW_Threadsafe),
+ ( "stdcall", KW_StdCall),
+ ( "ccall", KW_CCall)
+ ]
+
+isIdent, isHSymbol :: Char -> Bool
+isIdent c = isAlpha c || isDigit c || c == '\'' || c == '_'
+isHSymbol c = elem c ":!#$%&*+./<=>?@\\^|-~"
+
+matchChar :: Char -> String -> Lex a ()
+matchChar c msg = do
+ s <- getInput
+ if null s || head s /= c then fail msg else discard 1
+
+-- The top-level lexer.
+-- We need to know whether we are at the beginning of the line to decide
+-- whether to insert layout tokens.
+
+lexer :: (Token -> P a) -> P a
+lexer = runL $ do
+ bol <- checkBOL
+ (bol, ws) <- lexWhiteSpace bol
+ -- take care of whitespace in PCDATA
+ ec <- getExtContext
+ case ec of
+ -- if there was no linebreak, and we are lexing PCDATA,
+ -- then we want to care about the whitespace
+ Just ChildCtxt | not bol && ws -> return $ XPcdata " "
+ _ -> do startToken
+ if bol then lexBOL else lexToken
+
+lexWhiteSpace :: Bool -> Lex a (Bool, Bool)
+lexWhiteSpace bol = do
+ s <- getInput
+ case s of
+ '{':'-':c:_ | c /= '#' -> do
+ discard 2
+ bol <- lexNestedComment bol
+ (bol, _) <- lexWhiteSpace bol
+ return (bol, True)
+ '-':'-':s | all (== '-') (takeWhile isHSymbol s) -> do
+ lexWhile (== '-')
+ lexWhile (/= '\n')
+ lexNewline
+ lexWhiteSpace True
+ return (True, True)
+ '\n':_ -> do
+ lexNewline
+ lexWhiteSpace True
+ return (True, True)
+ '\t':_ -> do
+ lexTab
+ (bol, _) <- lexWhiteSpace bol
+ return (bol, True)
+ c:_ | isSpace c -> do
+ discard 1
+ (bol, _) <- lexWhiteSpace bol
+ return (bol, True)
+ _ -> return (bol, False)
+
+lexPragma :: String -> Lex a String
+lexPragma str = do
+ s <- getInput
+ case s of
+ '#':'-':'}':_ -> do
+ discard 3 >> return str
+ '\t':_ -> lexTab >> lexPragma (str ++ "\t")
+ '\n':_ -> lexNewline >> lexPragma (str ++ "\n")
+ c:_ -> discard 1 >> lexPragma (str ++ [c])
+ [] -> fail "Unterminated pragma"
+
+lexNestedComment :: Bool -> Lex a Bool
+lexNestedComment bol = do
+ s <- getInput
+ case s of
+ '-':'}':_ -> discard 2 >> return bol
+ '{':'-':_ -> do
+ discard 2
+ bol <- lexNestedComment bol -- rest of the subcomment
+ lexNestedComment bol -- rest of this comment
+ '\t':_ -> lexTab >> lexNestedComment bol
+ '\n':_ -> lexNewline >> lexNestedComment True
+ _:_ -> discard 1 >> lexNestedComment bol
+ [] -> fail "Unterminated nested comment"
+
+-- When we are lexing the first token of a line, check whether we need to
+-- insert virtual semicolons or close braces due to layout.
+
+lexBOL :: Lex a Token
+lexBOL = do
+ pos <- getOffside
+ case pos of
+ LT -> do
+ -- trace "layout: inserting '}'\n" $
+ -- Set col to 0, indicating that we're still at the
+ -- beginning of the line, in case we need a semi-colon too.
+ -- Also pop the context here, so that we don't insert
+ -- another close brace before the parser can pop it.
+ setBOL
+ popContextL "lexBOL"
+ return VRightCurly
+ EQ ->
+ -- trace "layout: inserting ';'\n" $
+ return SemiColon
+ GT ->
+ lexToken
+
+lexToken :: Lex a Token
+lexToken = do
+ ec <- getExtContext
+ case ec of
+ Just HarpCtxt -> lexHarpToken
+ Just TagCtxt -> lexTagCtxt
+ Just CloseTagCtxt -> lexCloseTagCtxt
+ Just ChildCtxt -> lexChildCtxt
+ Just CodeTagCtxt -> lexCodeTagCtxt
+ _ -> lexStdToken
+
+
+lexChildCtxt :: Lex a Token
+lexChildCtxt = do
+ s <- getInput
+ case s of
+ '<':'%':_ -> do discard 2
+ pushExtContextL CodeTagCtxt
+ return XCodeTagOpen
+ '<':'/':_ -> do discard 2
+ popExtContextL "lexChildCtxt"
+ pushExtContextL CloseTagCtxt
+ return XCloseTagOpen
+ '<':_ -> do discard 1
+ pushExtContextL TagCtxt
+ return XStdTagOpen
+ '[':'/':_ -> do discard 2
+ pushExtContextL HarpCtxt
+ return RPOpen
+ _ -> lexPCDATA
+
+
+lexPCDATA :: Lex a Token
+lexPCDATA = do
+ s <- getInput
+ case s of
+ [] -> return EOF
+ _ -> case s of
+ '\n':_ -> do
+ x <- lexNewline >> lexPCDATA
+ case x of
+ XPcdata p -> return $ XPcdata $ '\n':p
+ EOF -> return EOF
+ '<':_ -> return $ XPcdata ""
+ '[':'/':_ -> return $ XPcdata ""
+ '[':s' -> do discard 1
+ pcd <- lexPCDATA
+ case pcd of
+ XPcdata pcd' -> return $ XPcdata $ '[':pcd'
+ EOF -> return EOF
+ _ -> do let pcd = takeWhile (\c -> not $ elem c "<[\n") s
+ l = length pcd
+ discard l
+ x <- lexPCDATA
+ case x of
+ XPcdata pcd' -> return $ XPcdata $ pcd ++ pcd'
+ EOF -> return EOF
+
+
+lexCodeTagCtxt :: Lex a Token
+lexCodeTagCtxt = do
+ s <- getInput
+ case s of
+ '%':'>':_ -> do discard 2
+ popExtContextL "lexCodeTagContext"
+ return XCodeTagClose
+ _ -> lexStdToken
+
+lexCloseTagCtxt :: Lex a Token
+lexCloseTagCtxt = do
+ s <- getInput
+ case s of
+ '>':_ -> do discard 1
+ popExtContextL "lexCloseTagCtxt"
+ return XStdTagClose
+ _ -> lexStdToken
+
+lexTagCtxt :: Lex a Token
+lexTagCtxt = do
+ s <- getInput
+ case s of
+ '/':'>':_ -> do discard 2
+ popExtContextL "lexTagCtxt: Empty tag"
+ return XEmptyTagClose
+ '>':_ -> do discard 1
+ popExtContextL "lexTagCtxt: Standard tag"
+ pushExtContextL ChildCtxt
+ return XStdTagClose
+ _ -> lexStdToken
+
+lexHarpToken :: Lex a Token
+lexHarpToken = do
+ s <- getInput
+ case s of
+ '[':'/':_ -> do discard 2
+ pushExtContextL HarpCtxt
+ return RPOpen
+ '/':']':_ -> do discard 2
+ popExtContextL "lexHarpToken"
+ return RPClose
+ '(':'/':_ -> do discard 2
+ return RPSeqOpen
+ '/':')':_ -> do discard 2
+ return RPSeqClose
+ '*':'!':_ -> do discard 2
+ return RPStarG
+ '*':_ -> do discard 1
+ return RPStar
+ '+':'!':_ -> do discard 2
+ return RPPlusG
+ '+':_ -> do discard 1
+ return RPPlus
+ '|':_ -> do discard 1
+ return RPEither
+ '?':'!':_ -> do discard 2
+ return RPOptG
+ '?':_ -> do discard 1
+ return RPOpt
+ '@':':':_ -> do discard 2
+ return RPCAt
+ _ -> lexStdToken
+
+lexStdToken :: Lex a Token
+lexStdToken = do
+ s <- getInput
+ case s of
+ [] -> return EOF
+
+ '{':'-':'#':_ -> do
+ discard 3
+ pragma <- lexPragma ""
+ return (Pragma pragma)
+
+ '0':c:d:_ | toLower c == 'o' && isOctDigit d -> do
+ discard 2
+ n <- lexOctal
+ return (IntTok n)
+ | toLower c == 'x' && isHexDigit d -> do
+ discard 2
+ n <- lexHexadecimal
+ return (IntTok n)
+
+ -- implicit parameters
+ '?':c:_ | isLower c -> do
+ discard 1
+ id <- lexWhile isIdent
+ return $ IDupVarId id
+
+ '%':c:_ | isLower c -> do
+ discard 1
+ id <- lexWhile isIdent
+ return $ ILinVarId id
+ -- end implicit parameters
+
+ -- harp
+ '[':'/':_ -> do
+ discard 2
+ pushExtContextL HarpCtxt
+ return RPOpen
+
+ -- template haskell
+ '[':'|':_ -> do
+ discard 2
+ return $ THExpQuote
+
+ '[':c:'|':_ | c == 'e' -> do
+ discard 3
+ return $ THExpQuote
+ | c == 'p' -> do
+ discard 3
+ return THPatQuote
+ | c == 'd' -> do
+ discard 3
+ return THDecQuote
+ | c == 't' -> do
+ discard 3
+ return THTypQuote
+
+ '|':']':_ -> do discard 2
+ return THCloseQuote
+
+ '$':c:_ | isLower c -> do
+ discard 1
+ id <- lexWhile isIdent
+ return $ THIdEscape id
+ | c == '(' -> do
+ discard 2
+ return THParenEscape
+ -- end template haskell
+
+ -- hsx
+ '<':'%':_ -> do discard 2
+ pushExtContextL CodeTagCtxt
+ return XCodeTagOpen
+ '<':c:_ | isAlpha c -> do discard 1
+ pushExtContextL TagCtxt
+ return XStdTagOpen
+ -- end hsx
+
+ '(':'#':_ -> do discard 2 >> return LeftHashParen
+
+ '#':')':_ -> do discard 2 >> return RightHashParen
+
+ c:_ | isDigit c -> lexDecimalOrFloat
+
+ | isUpper c -> lexConIdOrQual ""
+
+ | isLower c || c == '_' -> do
+ idents <- lexIdents
+ case idents of
+ [ident] -> return $ case lookup ident (reserved_ids ++ special_varids) of
+ Just keyword -> keyword
+ Nothing -> VarId ident
+ _ -> return $ DVarId idents
+
+ | isHSymbol c -> do
+ sym <- lexWhile isHSymbol
+ return $ case lookup sym (reserved_ops ++ special_varops) of
+ Just t -> t
+ Nothing -> case c of
+ ':' -> ConSym sym
+ _ -> VarSym sym
+
+ | otherwise -> do
+ discard 1
+ case c of
+
+ -- First the special symbols
+ '(' -> return LeftParen
+ ')' -> return RightParen
+ ',' -> return Comma
+ ';' -> return SemiColon
+ '[' -> return LeftSquare
+ ']' -> return RightSquare
+ '`' -> return BackQuote
+ '{' -> do
+ pushContextL NoLayout
+ return LeftCurly
+ '}' -> do
+ popContextL "lexStdToken"
+ return RightCurly
+
+ '\'' -> do
+ c2 <- lexChar
+ matchChar '\'' "Improperly terminated character constant"
+ return (Character c2)
+
+ '"' -> lexString
+
+ _ -> fail ("Illegal character \'" ++ show c ++ "\'\n")
+
+ where lexIdents :: Lex a [String]
+ lexIdents = do
+ ident <- lexWhile isIdent
+ s <- getInput
+ case s of
+ '-':c:_ | isIdent c -> do
+ discard 1
+ idents <- lexIdents
+ return $ ident : idents
+ _ -> return [ident]
+
+
+
+lexDecimalOrFloat :: Lex a Token
+lexDecimalOrFloat = do
+ ds <- lexWhile isDigit
+ rest <- getInput
+ case rest of
+ ('.':d:_) | isDigit d -> do
+ discard 1
+ frac <- lexWhile isDigit
+ let num = parseInteger 10 (ds ++ frac)
+ decimals = toInteger (length frac)
+ exponent <- do
+ rest2 <- getInput
+ case rest2 of
+ 'e':_ -> lexExponent
+ 'E':_ -> lexExponent
+ _ -> return 0
+ return (FloatTok ((num%1) * 10^^(exponent - decimals)))
+ e:_ | toLower e == 'e' -> do
+ exponent <- lexExponent
+ return (FloatTok ((parseInteger 10 ds%1) * 10^^exponent))
+ _ -> return (IntTok (parseInteger 10 ds))
+
+ where
+ lexExponent :: Lex a Integer
+ lexExponent = do
+ discard 1 -- 'e' or 'E'
+ r <- getInput
+ case r of
+ '+':d:_ | isDigit d -> do
+ discard 1
+ lexDecimal
+ '-':d:_ | isDigit d -> do
+ discard 1
+ n <- lexDecimal
+ return (negate n)
+ d:_ | isDigit d -> lexDecimal
+ _ -> fail "Float with missing exponent"
+
+lexConIdOrQual :: String -> Lex a Token
+lexConIdOrQual qual = do
+ con <- lexWhile isIdent
+ let conid | null qual = ConId con
+ | otherwise = QConId (qual,con)
+ qual' | null qual = con
+ | otherwise = qual ++ '.':con
+ just_a_conid <- alternative (return conid)
+ rest <- getInput
+ case rest of
+ '.':c:_
+ | isLower c || c == '_' -> do -- qualified varid?
+ discard 1
+ ident <- lexWhile isIdent
+ case lookup ident reserved_ids of
+ -- cannot qualify a reserved word
+ Just _ -> just_a_conid
+ Nothing -> return (QVarId (qual', ident))
+
+ | isUpper c -> do -- qualified conid?
+ discard 1
+ lexConIdOrQual qual'
+
+ | isHSymbol c -> do -- qualified symbol?
+ discard 1
+ sym <- lexWhile isHSymbol
+ case lookup sym reserved_ops of
+ -- cannot qualify a reserved operator
+ Just _ -> just_a_conid
+ Nothing -> return $ case c of
+ ':' -> QConSym (qual', sym)
+ _ -> QVarSym (qual', sym)
+
+ _ -> return conid -- not a qualified thing
+
+lexChar :: Lex a Char
+lexChar = do
+ r <- getInput
+ case r of
+ '\\':_ -> lexEscape
+ c:_ -> discard 1 >> return c
+ [] -> fail "Incomplete character constant"
+
+lexString :: Lex a Token
+lexString = loop ""
+ where
+ loop s = do
+ r <- getInput
+ case r of
+ '\\':'&':_ -> do
+ discard 2
+ loop s
+ '\\':c:_ | isSpace c -> do
+ discard 1
+ lexWhiteChars
+ matchChar '\\' "Illegal character in string gap"
+ loop s
+ | otherwise -> do
+ ce <- lexEscape
+ loop (ce:s)
+ '"':_ -> do
+ discard 1
+ return (StringTok (reverse s))
+ c:_ -> do
+ discard 1
+ loop (c:s)
+ [] -> fail "Improperly terminated string"
+
+ lexWhiteChars :: Lex a ()
+ lexWhiteChars = do
+ s <- getInput
+ case s of
+ '\n':_ -> do
+ lexNewline
+ lexWhiteChars
+ '\t':_ -> do
+ lexTab
+ lexWhiteChars
+ c:_ | isSpace c -> do
+ discard 1
+ lexWhiteChars
+ _ -> return ()
+
+lexEscape :: Lex a Char
+lexEscape = do
+ discard 1
+ r <- getInput
+ case r of
+
+-- Production charesc from section B.2 (Note: \& is handled by caller)
+
+ 'a':_ -> discard 1 >> return '\a'
+ 'b':_ -> discard 1 >> return '\b'
+ 'f':_ -> discard 1 >> return '\f'
+ 'n':_ -> discard 1 >> return '\n'
+ 'r':_ -> discard 1 >> return '\r'
+ 't':_ -> discard 1 >> return '\t'
+ 'v':_ -> discard 1 >> return '\v'
+ '\\':_ -> discard 1 >> return '\\'
+ '"':_ -> discard 1 >> return '\"'
+ '\'':_ -> discard 1 >> return '\''
+
+-- Production ascii from section B.2
+
+ '^':c:_ -> discard 2 >> cntrl c
+ 'N':'U':'L':_ -> discard 3 >> return '\NUL'
+ 'S':'O':'H':_ -> discard 3 >> return '\SOH'
+ 'S':'T':'X':_ -> discard 3 >> return '\STX'
+ 'E':'T':'X':_ -> discard 3 >> return '\ETX'
+ 'E':'O':'T':_ -> discard 3 >> return '\EOT'
+ 'E':'N':'Q':_ -> discard 3 >> return '\ENQ'
+ 'A':'C':'K':_ -> discard 3 >> return '\ACK'
+ 'B':'E':'L':_ -> discard 3 >> return '\BEL'
+ 'B':'S':_ -> discard 2 >> return '\BS'
+ 'H':'T':_ -> discard 2 >> return '\HT'
+ 'L':'F':_ -> discard 2 >> return '\LF'
+ 'V':'T':_ -> discard 2 >> return '\VT'
+ 'F':'F':_ -> discard 2 >> return '\FF'
+ 'C':'R':_ -> discard 2 >> return '\CR'
+ 'S':'O':_ -> discard 2 >> return '\SO'
+ 'S':'I':_ -> discard 2 >> return '\SI'
+ 'D':'L':'E':_ -> discard 3 >> return '\DLE'
+ 'D':'C':'1':_ -> discard 3 >> return '\DC1'
+ 'D':'C':'2':_ -> discard 3 >> return '\DC2'
+ 'D':'C':'3':_ -> discard 3 >> return '\DC3'
+ 'D':'C':'4':_ -> discard 3 >> return '\DC4'
+ 'N':'A':'K':_ -> discard 3 >> return '\NAK'
+ 'S':'Y':'N':_ -> discard 3 >> return '\SYN'
+ 'E':'T':'B':_ -> discard 3 >> return '\ETB'
+ 'C':'A':'N':_ -> discard 3 >> return '\CAN'
+ 'E':'M':_ -> discard 2 >> return '\EM'
+ 'S':'U':'B':_ -> discard 3 >> return '\SUB'
+ 'E':'S':'C':_ -> discard 3 >> return '\ESC'
+ 'F':'S':_ -> discard 2 >> return '\FS'
+ 'G':'S':_ -> discard 2 >> return '\GS'
+ 'R':'S':_ -> discard 2 >> return '\RS'
+ 'U':'S':_ -> discard 2 >> return '\US'
+ 'S':'P':_ -> discard 2 >> return '\SP'
+ 'D':'E':'L':_ -> discard 3 >> return '\DEL'
+
+-- Escaped numbers
+
+ 'o':c:_ | isOctDigit c -> do
+ discard 1
+ n <- lexOctal
+ checkChar n
+ 'x':c:_ | isHexDigit c -> do
+ discard 1
+ n <- lexHexadecimal
+ checkChar n
+ c:_ | isDigit c -> do
+ n <- lexDecimal
+ checkChar n
+
+ _ -> fail "Illegal escape sequence"
+
+ where
+ checkChar n | n <= 0x01FFFF = return (chr (fromInteger n))
+ checkChar _ = fail "Character constant out of range"
+
+-- Production cntrl from section B.2
+
+ cntrl :: Char -> Lex a Char
+ cntrl c | c >= '@' && c <= '_' = return (chr (ord c - ord '@'))
+ cntrl _ = fail "Illegal control character"
+
+-- assumes at least one octal digit
+lexOctal :: Lex a Integer
+lexOctal = do
+ ds <- lexWhile isOctDigit
+ return (parseInteger 8 ds)
+
+-- assumes at least one hexadecimal digit
+lexHexadecimal :: Lex a Integer
+lexHexadecimal = do
+ ds <- lexWhile isHexDigit
+ return (parseInteger 16 ds)
+
+-- assumes at least one decimal digit
+lexDecimal :: Lex a Integer
+lexDecimal = do
+ ds <- lexWhile isDigit
+ return (parseInteger 10 ds)
+
+-- Stolen from Hugs's Prelude
+parseInteger :: Integer -> String -> Integer
+parseInteger radix ds =
+ foldl1 (\n d -> n * radix + d) (map (toInteger . digitToInt) ds)
diff -rN -u old-fenfire-hs/Preprocessor/Hsx/ParseMonad.hs new-fenfire-hs/Preprocessor/Hsx/ParseMonad.hs
--- old-fenfire-hs/Preprocessor/Hsx/ParseMonad.hs 1970-01-01 02:00:00.000000000 +0200
+++ new-fenfire-hs/Preprocessor/Hsx/ParseMonad.hs 2007-02-12 19:32:17.000000000 +0200
@@ -0,0 +1,292 @@
+-- #hide
+-----------------------------------------------------------------------------
+-- |
+-- Module : Preprocessor.Hsx.ParseMonad
+-- Original : Language.Haskell.ParseMonad
+-- Copyright : (c) The GHC Team, 1997-2000
+-- License : BSD-style (see the file libraries/base/LICENSE)
+--
+-- Maintainer : libraries at haskell.org
+-- Stability : experimental
+-- Portability : portable
+--
+-- Monads for the Haskell parser and lexer.
+--
+-----------------------------------------------------------------------------
+
+module Preprocessor.Hsx.ParseMonad(
+ -- * Parsing
+ P, ParseResult(..), atSrcLoc, LexContext(..),
+ ParseMode(..), defaultParseMode,
+ runParserWithMode, runParser,
+ getSrcLoc, pushCurrentContext, popContext,
+ -- * Lexing
+ Lex(runL), getInput, discard, lexNewline, lexTab, lexWhile,
+ alternative, checkBOL, setBOL, startToken, getOffside,
+ pushContextL, popContextL,
+ -- * Harp/Hsx
+ ExtContext(..),
+ pushExtContextL, popExtContextL, getExtContext,
+ getModuleName
+ ) where
+
+import Preprocessor.Hsx.Syntax(SrcLoc(..))
+
+import Data.List ( intersperse )
+
+-- | The result of a parse.
+data ParseResult a
+ = ParseOk a -- ^ The parse succeeded, yielding a value.
+ | ParseFailed SrcLoc String
+ -- ^ The parse failed at the specified
+ -- source location, with an error message.
+ deriving Show
+
+-- internal version
+data ParseStatus a = Ok ParseState a | Failed SrcLoc String
+ deriving Show
+
+data LexContext = NoLayout | Layout Int
+ deriving (Eq,Ord,Show)
+
+data ExtContext = CodeCtxt | HarpCtxt | TagCtxt | ChildCtxt
+ | CloseTagCtxt | CodeTagCtxt
+ deriving (Eq,Ord,Show)
+
+type ParseState = ([LexContext],[ExtContext])
+
+indentOfParseState :: ParseState -> Int
+indentOfParseState (Layout n:_,_) = n
+indentOfParseState _ = 0
+
+-- | Static parameters governing a parse.
+-- More to come later, e.g. literate mode, language extensions.
+
+data ParseMode = ParseMode {
+ -- | original name of the file being parsed
+ parseFilename :: String
+ }
+
+-- | Default parameters for a parse,
+-- currently just a marker for an unknown filename.
+
+defaultParseMode :: ParseMode
+defaultParseMode = ParseMode {
+ parseFilename = "<unknown>.hs"
+ }
+
+-- | Monad for parsing
+
+newtype P a = P { runP ::
+ String -- input string
+ -> Int -- current column
+ -> Int -- current line
+ -> SrcLoc -- location of last token read
+ -> ParseState -- layout info.
+ -> ParseMode -- parse parameters
+ -> ParseStatus a
+ }
+
+runParserWithMode :: ParseMode -> P a -> String -> ParseResult a
+runParserWithMode mode (P m) s = case m s 0 1 start ([],[]) mode of
+ Ok _ a -> ParseOk a
+ Failed loc msg -> ParseFailed loc msg
+ where start = SrcLoc {
+ srcFilename = parseFilename mode,
+ srcLine = 1,
+ srcColumn = 1
+ }
+
+runParser :: P a -> String -> ParseResult a
+runParser = runParserWithMode defaultParseMode
+
+instance Monad P where
+ return a = P $ \_i _x _y _l s _m -> Ok s a
+ P m >>= k = P $ \i x y l s mode ->
+ case m i x y l s mode of
+ Failed loc msg -> Failed loc msg
+ Ok s' a -> runP (k a) i x y l s' mode
+ fail s = P $ \_r _col _line loc _stk _m -> Failed loc s
+
+atSrcLoc :: P a -> SrcLoc -> P a
+P m `atSrcLoc` loc = P $ \i x y _l -> m i x y loc
+
+getSrcLoc :: P SrcLoc
+getSrcLoc = P $ \_i _x _y l s _m -> Ok s l
+
+getModuleName :: P String
+getModuleName = P $ \_i _x _y _l s m ->
+ let fn = parseFilename m
+ mn = concat $ intersperse "." $ splitPath fn
+
+ splitPath :: String -> [String]
+ splitPath "" = []
+ splitPath str = let (l,str') = break ('\\'==) str
+ in case str' of
+ [] -> [removeSuffix l]
+ (_:str'') -> l : splitPath str''
+
+ removeSuffix l = reverse $ tail $ dropWhile ('.'/=) $ reverse l
+
+ in Ok s mn
+
+-- Enter a new layout context. If we are already in a layout context,
+-- ensure that the new indent is greater than the indent of that context.
+-- (So if the source loc is not to the right of the current indent, an
+-- empty list {} will be inserted.)
+
+pushCurrentContext :: P ()
+pushCurrentContext = do
+ loc <- getSrcLoc
+ indent <- currentIndent
+ pushContext (Layout (srcColumn loc))
+
+currentIndent :: P Int
+currentIndent = P $ \_r _x _y loc stk _mode -> Ok stk (indentOfParseState stk)
+
+pushContext :: LexContext -> P ()
+pushContext ctxt =
+--trace ("pushing lexical scope: " ++ show ctxt ++"\n") $
+ P $ \_i _x _y _l (s, e) _m -> Ok (ctxt:s, e) ()
+
+popContext :: P ()
+popContext = P $ \_i _x _y _l stk _m ->
+ case stk of
+ (_:s, e) -> --trace ("popping lexical scope, context now "++show s ++ "\n") $
+ Ok (s, e) ()
+ ([],_) -> error "Internal error: empty context in popContext"
+
+
+-- HaRP/Hsx
+pushExtContext :: ExtContext -> P ()
+pushExtContext ctxt = P $ \_i _x _y _l (s, e) _m -> Ok (s, ctxt:e) ()
+
+popExtContext :: P ()
+popExtContext = P $ \_i _x _y _l (s, e) _m ->
+ case e of
+ (_:e') ->
+ Ok (s, e') ()
+ [] -> error "Internal error: empty context in popExtContext"
+
+
+-- Monad for lexical analysis:
+-- a continuation-passing version of the parsing monad
+
+newtype Lex r a = Lex { runL :: (a -> P r) -> P r }
+
+instance Monad (Lex r) where
+ return a = Lex $ \k -> k a
+ Lex v >>= f = Lex $ \k -> v (\a -> runL (f a) k)
+ Lex v >> Lex w = Lex $ \k -> v (\_ -> w k)
+ fail s = Lex $ \_ -> fail s
+
+-- Operations on this monad
+
+getInput :: Lex r String
+getInput = Lex $ \cont -> P $ \r -> runP (cont r) r
+
+-- | Discard some input characters (these must not include tabs or newlines).
+
+discard :: Int -> Lex r ()
+discard n = Lex $ \cont -> P $ \r x -> runP (cont ()) (drop n r) (x+n)
+
+-- | Discard the next character, which must be a newline.
+
+lexNewline :: Lex a ()
+lexNewline = Lex $ \cont -> P $ \(_:r) _x y -> runP (cont ()) r 1 (y+1)
+
+-- | Discard the next character, which must be a tab.
+
+lexTab :: Lex a ()
+lexTab = Lex $ \cont -> P $ \(_:r) x -> runP (cont ()) r (nextTab x)
+
+nextTab :: Int -> Int
+nextTab x = x + (tAB_LENGTH - (x-1) `mod` tAB_LENGTH)
+
+tAB_LENGTH :: Int
+tAB_LENGTH = 8 :: Int
+
+-- Consume and return the largest string of characters satisfying p
+
+lexWhile :: (Char -> Bool) -> Lex a String
+lexWhile p = Lex $ \cont -> P $ \r x ->
+ let (cs,rest) = span p r in
+ runP (cont cs) rest (x + length cs)
+
+-- An alternative scan, to which we can return if subsequent scanning
+-- is unsuccessful.
+
+alternative :: Lex a v -> Lex a (Lex a v)
+alternative (Lex v) = Lex $ \cont -> P $ \r x y ->
+ runP (cont (Lex $ \cont' -> P $ \_r _x _y ->
+ runP (v cont') r x y)) r x y
+
+-- The source location is the coordinates of the previous token,
+-- or, while scanning a token, the start of the current token.
+
+-- col is the current column in the source file.
+-- We also need to remember between scanning tokens whether we are
+-- somewhere at the beginning of the line before the first token.
+-- This could be done with an extra Bool argument to the P monad,
+-- but as a hack we use a col value of 0 to indicate this situation.
+
+-- Setting col to 0 is used in two places: just after emitting a virtual
+-- close brace due to layout, so that next time through we check whether
+-- we also need to emit a semi-colon, and at the beginning of the file,
+-- by runParser, to kick off the lexer.
+-- Thus when col is zero, the true column can be taken from the loc.
+
+checkBOL :: Lex a Bool
+checkBOL = Lex $ \cont -> P $ \r x y loc ->
+ if x == 0 then runP (cont True) r (srcColumn loc) y loc
+ else runP (cont False) r x y loc
+
+setBOL :: Lex a ()
+setBOL = Lex $ \cont -> P $ \r _ -> runP (cont ()) r 0
+
+-- Set the loc to the current position
+
+startToken :: Lex a ()
+startToken = Lex $ \cont -> P $ \s x y _ stk mode ->
+ let loc = SrcLoc {
+ srcFilename = parseFilename mode,
+ srcLine = y,
+ srcColumn = x
+ } in
+ runP (cont ()) s x y loc stk mode
+
+-- Current status with respect to the offside (layout) rule:
+-- LT: we are to the left of the current indent (if any)
+-- EQ: we are at the current indent (if any)
+-- GT: we are to the right of the current indent, or not subject to layout
+
+getOffside :: Lex a Ordering
+getOffside = Lex $ \cont -> P $ \r x y loc stk ->
+ runP (cont (compare x (indentOfParseState stk))) r x y loc stk
+
+pushContextL :: LexContext -> Lex a ()
+pushContextL ctxt = Lex $ \cont -> P $ \r x y loc (stk, e) ->
+ runP (cont ()) r x y loc (ctxt:stk, e)
+
+popContextL :: String -> Lex a ()
+popContextL fn = Lex $ \cont -> P $ \r x y loc stk -> case stk of
+ (_:ctxt, e) -> runP (cont ()) r x y loc (ctxt, e)
+ ([], _) -> error ("Internal error: empty context in " ++ fn)
+
+-- Harp/Hsx
+
+getExtContext :: Lex a (Maybe ExtContext)
+getExtContext = Lex $ \cont -> P $ \r x y loc stk@(_, e) ->
+ let me = case e of
+ [] -> Nothing
+ (c:_) -> Just c
+ in runP (cont me) r x y loc stk
+
+pushExtContextL :: ExtContext -> Lex a ()
+pushExtContextL ec = Lex $ \cont -> P $ \r x y loc (s, e) ->
+ runP (cont ()) r x y loc (s, ec:e)
+
+popExtContextL :: String -> Lex a ()
+popExtContextL fn = Lex $ \cont -> P $ \r x y loc stk@(s,e) -> case e of
+ (_:ec) -> runP (cont ()) r x y loc (s,ec)
+ [] -> error ("Internal error: empty tag context in " ++ fn)
diff -rN -u old-fenfire-hs/Preprocessor/Hsx/Parser.hs new-fenfire-hs/Preprocessor/Hsx/Parser.hs
--- old-fenfire-hs/Preprocessor/Hsx/Parser.hs 1970-01-01 02:00:00.000000000 +0200
+++ new-fenfire-hs/Preprocessor/Hsx/Parser.hs 2007-02-12 19:32:17.000000000 +0200
@@ -0,0 +1,13771 @@
+-----------------------------------------------------------------------------
+-- |
+-- Module : Preprocessor.Hsx.Parser
+-- Original : Language.Haskell.Parser
+-- Copyright : (c) Niklas Broberg 2004,
+-- Original (c) Simon Marlow, Sven Panne 1997-2000
+-- License : BSD-style (see the file LICENSE.txt)
+--
+-- Maintainer : Niklas Broberg, d00nibro at dtek.chalmers.se
+-- Stability : experimental
+-- Portability : portable
+--
+--
+-----------------------------------------------------------------------------
+module Preprocessor.Hsx.Parser (
+ parseModule, parseModuleWithMode,
+ ParseMode(..), defaultParseMode, ParseResult(..)) where
+
+import Preprocessor.Hsx.Syntax
+import Preprocessor.Hsx.ParseMonad
+import Preprocessor.Hsx.Lexer
+import Preprocessor.Hsx.ParseUtils
+
+-- parser produced by Happy Version 1.15
+
+data HappyAbsSyn
+ = HappyTerminal Token
+ | HappyErrorToken Int
+ | HappyAbsSyn4 (HsModule)
+ | HappyAbsSyn5 (HsExp)
+ | HappyAbsSyn7 ([HsPragma])
+ | HappyAbsSyn8 (([HsImportDecl],[HsDecl]))
+ | HappyAbsSyn10 (())
+ | HappyAbsSyn12 (Maybe [HsExportSpec])
+ | HappyAbsSyn13 ([HsExportSpec])
+ | HappyAbsSyn16 (HsExportSpec)
+ | HappyAbsSyn17 ([HsImportDecl])
+ | HappyAbsSyn18 (HsImportDecl)
+ | HappyAbsSyn19 (Bool)
+ | HappyAbsSyn20 (Maybe Module)
+ | HappyAbsSyn21 (Maybe (Bool, [HsImportSpec]))
+ | HappyAbsSyn22 ((Bool, [HsImportSpec]))
+ | HappyAbsSyn24 ([HsImportSpec])
+ | HappyAbsSyn25 (HsImportSpec)
+ | HappyAbsSyn26 ([HsCName])
+ | HappyAbsSyn27 (HsCName)
+ | HappyAbsSyn28 (HsDecl)
+ | HappyAbsSyn29 (Int)
+ | HappyAbsSyn30 (HsAssoc)
+ | HappyAbsSyn31 ([HsOp])
+ | HappyAbsSyn32 ([HsDecl])
+ | HappyAbsSyn35 ([HsType])
+ | HappyAbsSyn41 (HsBinds)
+ | HappyAbsSyn42 ([HsName])
+ | HappyAbsSyn43 (HsCallConv)
+ | HappyAbsSyn44 (HsSafety)
+ | HappyAbsSyn45 ((String, HsName, HsType))
+ | HappyAbsSyn46 (HsType)
+ | HappyAbsSyn50 (HsQName)
+ | HappyAbsSyn53 (HsContext)
+ | HappyAbsSyn56 ((HsName, [HsName]))
+ | HappyAbsSyn58 ([HsFunDep])
+ | HappyAbsSyn60 (HsFunDep)
+ | HappyAbsSyn61 ([HsGadtDecl])
+ | HappyAbsSyn64 (HsGadtDecl)
+ | HappyAbsSyn65 ([HsQualConDecl])
+ | HappyAbsSyn67 (HsQualConDecl)
+ | HappyAbsSyn69 (HsConDecl)
+ | HappyAbsSyn70 ((HsName, [HsBangType]))
+ | HappyAbsSyn72 (HsBangType)
+ | HappyAbsSyn74 ([([HsName],HsBangType)])
+ | HappyAbsSyn75 (([HsName],HsBangType))
+ | HappyAbsSyn77 ([HsQName])
+ | HappyAbsSyn85 (HsRhs)
+ | HappyAbsSyn86 ([HsGuardedRhs])
+ | HappyAbsSyn87 (HsGuardedRhs)
+ | HappyAbsSyn95 ([HsPat])
+ | HappyAbsSyn96 (HsPat)
+ | HappyAbsSyn100 (HsReify)
+ | HappyAbsSyn103 ([HsExp])
+ | HappyAbsSyn110 (HsXName)
+ | HappyAbsSyn111 (String)
+ | HappyAbsSyn112 ([HsXAttr])
+ | HappyAbsSyn113 (HsXAttr)
+ | HappyAbsSyn114 (Maybe HsExp)
+ | HappyAbsSyn118 ([HsStmt])
+ | HappyAbsSyn119 (HsStmt)
+ | HappyAbsSyn120 ([HsAlt])
+ | HappyAbsSyn123 (HsAlt)
+ | HappyAbsSyn124 (HsGuardedAlts)
+ | HappyAbsSyn125 ([HsGuardedAlt])
+ | HappyAbsSyn126 (HsGuardedAlt)
+ | HappyAbsSyn130 ([HsFieldUpdate])
+ | HappyAbsSyn131 (HsFieldUpdate)
+ | HappyAbsSyn132 ([HsIPBind])
+ | HappyAbsSyn135 (HsIPBind)
+ | HappyAbsSyn137 (HsName)
+ | HappyAbsSyn140 (HsIPName)
+ | HappyAbsSyn148 (HsOp)
+ | HappyAbsSyn149 (HsQOp)
+ | HappyAbsSyn165 (HsLiteral)
+ | HappyAbsSyn166 (SrcLoc)
+ | HappyAbsSyn169 (Module)
+
+type HappyReduction m =
+ Int
+ -> (Token)
+ -> HappyState (Token) (HappyStk HappyAbsSyn -> m HappyAbsSyn)
+ -> [HappyState (Token) (HappyStk HappyAbsSyn -> m HappyAbsSyn)]
+ -> HappyStk HappyAbsSyn
+ -> m HappyAbsSyn
+
+action_0,
+ action_1,
+ action_2,
+ action_3,
+ action_4,
+ action_5,
+ action_6,
+ action_7,
+ action_8,
+ action_9,
+ action_10,
+ action_11,
+ action_12,
+ action_13,
+ action_14,
+ action_15,
+ action_16,
+ action_17,
+ action_18,
+ action_19,
+ action_20,
+ action_21,
+ action_22,
+ action_23,
+ action_24,
+ action_25,
+ action_26,
+ action_27,
+ action_28,
+ action_29,
+ action_30,
+ action_31,
+ action_32,
+ action_33,
+ action_34,
+ action_35,
+ action_36,
+ action_37,
+ action_38,
+ action_39,
+ action_40,
+ action_41,
+ action_42,
+ action_43,
+ action_44,
+ action_45,
+ action_46,
+ action_47,
+ action_48,
+ action_49,
+ action_50,
+ action_51,
+ action_52,
+ action_53,
+ action_54,
+ action_55,
+ action_56,
+ action_57,
+ action_58,
+ action_59,
+ action_60,
+ action_61,
+ action_62,
+ action_63,
+ action_64,
+ action_65,
+ action_66,
+ action_67,
+ action_68,
+ action_69,
+ action_70,
+ action_71,
+ action_72,
+ action_73,
+ action_74,
+ action_75,
+ action_76,
+ action_77,
+ action_78,
+ action_79,
+ action_80,
+ action_81,
+ action_82,
+ action_83,
+ action_84,
+ action_85,
+ action_86,
+ action_87,
+ action_88,
+ action_89,
+ action_90,
+ action_91,
+ action_92,
+ action_93,
+ action_94,
+ action_95,
+ action_96,
+ action_97,
+ action_98,
+ action_99,
+ action_100,
+ action_101,
+ action_102,
+ action_103,
+ action_104,
+ action_105,
+ action_106,
+ action_107,
+ action_108,
+ action_109,
+ action_110,
+ action_111,
+ action_112,
+ action_113,
+ action_114,
+ action_115,
+ action_116,
+ action_117,
+ action_118,
+ action_119,
+ action_120,
+ action_121,
+ action_122,
+ action_123,
+ action_124,
+ action_125,
+ action_126,
+ action_127,
+ action_128,
+ action_129,
+ action_130,
+ action_131,
+ action_132,
+ action_133,
+ action_134,
+ action_135,
+ action_136,
+ action_137,
+ action_138,
+ action_139,
+ action_140,
+ action_141,
+ action_142,
+ action_143,
+ action_144,
+ action_145,
+ action_146,
+ action_147,
+ action_148,
+ action_149,
+ action_150,
+ action_151,
+ action_152,
+ action_153,
+ action_154,
+ action_155,
+ action_156,
+ action_157,
+ action_158,
+ action_159,
+ action_160,
+ action_161,
+ action_162,
+ action_163,
+ action_164,
+ action_165,
+ action_166,
+ action_167,
+ action_168,
+ action_169,
+ action_170,
+ action_171,
+ action_172,
+ action_173,
+ action_174,
+ action_175,
+ action_176,
+ action_177,
+ action_178,
+ action_179,
+ action_180,
+ action_181,
+ action_182,
+ action_183,
+ action_184,
+ action_185,
+ action_186,
+ action_187,
+ action_188,
+ action_189,
+ action_190,
+ action_191,
+ action_192,
+ action_193,
+ action_194,
+ action_195,
+ action_196,
+ action_197,
+ action_198,
+ action_199,
+ action_200,
+ action_201,
+ action_202,
+ action_203,
+ action_204,
+ action_205,
+ action_206,
+ action_207,
+ action_208,
+ action_209,
+ action_210,
+ action_211,
+ action_212,
+ action_213,
+ action_214,
+ action_215,
+ action_216,
+ action_217,
+ action_218,
+ action_219,
+ action_220,
+ action_221,
+ action_222,
+ action_223,
+ action_224,
+ action_225,
+ action_226,
+ action_227,
+ action_228,
+ action_229,
+ action_230,
+ action_231,
+ action_232,
+ action_233,
+ action_234,
+ action_235,
+ action_236,
+ action_237,
+ action_238,
+ action_239,
+ action_240,
+ action_241,
+ action_242,
+ action_243,
+ action_244,
+ action_245,
+ action_246,
+ action_247,
+ action_248,
+ action_249,
+ action_250,
+ action_251,
+ action_252,
+ action_253,
+ action_254,
+ action_255,
+ action_256,
+ action_257,
+ action_258,
+ action_259,
+ action_260,
+ action_261,
+ action_262,
+ action_263,
+ action_264,
+ action_265,
+ action_266,
+ action_267,
+ action_268,
+ action_269,
+ action_270,
+ action_271,
+ action_272,
+ action_273,
+ action_274,
+ action_275,
+ action_276,
+ action_277,
+ action_278,
+ action_279,
+ action_280,
+ action_281,
+ action_282,
+ action_283,
+ action_284,
+ action_285,
+ action_286,
+ action_287,
+ action_288,
+ action_289,
+ action_290,
+ action_291,
+ action_292,
+ action_293,
+ action_294,
+ action_295,
+ action_296,
+ action_297,
+ action_298,
+ action_299,
+ action_300,
+ action_301,
+ action_302,
+ action_303,
+ action_304,
+ action_305,
+ action_306,
+ action_307,
+ action_308,
+ action_309,
+ action_310,
+ action_311,
+ action_312,
+ action_313,
+ action_314,
+ action_315,
+ action_316,
+ action_317,
+ action_318,
+ action_319,
+ action_320,
+ action_321,
+ action_322,
+ action_323,
+ action_324,
+ action_325,
+ action_326,
+ action_327,
+ action_328,
+ action_329,
+ action_330,
+ action_331,
+ action_332,
+ action_333,
+ action_334,
+ action_335,
+ action_336,
+ action_337,
+ action_338,
+ action_339,
+ action_340,
+ action_341,
+ action_342,
+ action_343,
+ action_344,
+ action_345,
+ action_346,
+ action_347,
+ action_348,
+ action_349,
+ action_350,
+ action_351,
+ action_352,
+ action_353,
+ action_354,
+ action_355,
+ action_356,
+ action_357,
+ action_358,
+ action_359,
+ action_360,
+ action_361,
+ action_362,
+ action_363,
+ action_364,
+ action_365,
+ action_366,
+ action_367,
+ action_368,
+ action_369,
+ action_370,
+ action_371,
+ action_372,
+ action_373,
+ action_374,
+ action_375,
+ action_376,
+ action_377,
+ action_378,
+ action_379,
+ action_380,
+ action_381,
+ action_382,
+ action_383,
+ action_384,
+ action_385,
+ action_386,
+ action_387,
+ action_388,
+ action_389,
+ action_390,
+ action_391,
+ action_392,
+ action_393,
+ action_394,
+ action_395,
+ action_396,
+ action_397,
+ action_398,
+ action_399,
+ action_400,
+ action_401,
+ action_402,
+ action_403,
+ action_404,
+ action_405,
+ action_406,
+ action_407,
+ action_408,
+ action_409,
+ action_410,
+ action_411,
+ action_412,
+ action_413,
+ action_414,
+ action_415,
+ action_416,
+ action_417,
+ action_418,
+ action_419,
+ action_420,
+ action_421,
+ action_422,
+ action_423,
+ action_424,
+ action_425,
+ action_426,
+ action_427,
+ action_428,
+ action_429,
+ action_430,
+ action_431,
+ action_432,
+ action_433,
+ action_434,
+ action_435,
+ action_436,
+ action_437,
+ action_438,
+ action_439,
+ action_440,
+ action_441,
+ action_442,
+ action_443,
+ action_444,
+ action_445,
+ action_446,
+ action_447,
+ action_448,
+ action_449,
+ action_450,
+ action_451,
+ action_452,
+ action_453,
+ action_454,
+ action_455,
+ action_456,
+ action_457,
+ action_458,
+ action_459,
+ action_460,
+ action_461,
+ action_462,
+ action_463,
+ action_464,
+ action_465,
+ action_466,
+ action_467,
+ action_468,
+ action_469,
+ action_470,
+ action_471,
+ action_472,
+ action_473,
+ action_474,
+ action_475,
+ action_476,
+ action_477,
+ action_478,
+ action_479,
+ action_480,
+ action_481,
+ action_482,
+ action_483,
+ action_484,
+ action_485,
+ action_486,
+ action_487,
+ action_488,
+ action_489,
+ action_490,
+ action_491,
+ action_492,
+ action_493,
+ action_494,
+ action_495,
+ action_496,
+ action_497,
+ action_498,
+ action_499,
+ action_500,
+ action_501,
+ action_502,
+ action_503,
+ action_504,
+ action_505,
+ action_506,
+ action_507,
+ action_508,
+ action_509,
+ action_510,
+ action_511,
+ action_512,
+ action_513,
+ action_514,
+ action_515,
+ action_516,
+ action_517,
+ action_518,
+ action_519,
+ action_520,
+ action_521,
+ action_522,
+ action_523,
+ action_524,
+ action_525,
+ action_526,
+ action_527,
+ action_528,
+ action_529,
+ action_530,
+ action_531,
+ action_532,
+ action_533,
+ action_534,
+ action_535,
+ action_536,
+ action_537,
+ action_538,
+ action_539,
+ action_540,
+ action_541,
+ action_542,
+ action_543,
+ action_544,
+ action_545,
+ action_546,
+ action_547,
+ action_548,
+ action_549,
+ action_550,
+ action_551,
+ action_552,
+ action_553,
+ action_554,
+ action_555,
+ action_556,
+ action_557,
+ action_558,
+ action_559,
+ action_560,
+ action_561,
+ action_562,
+ action_563,
+ action_564,
+ action_565,
+ action_566,
+ action_567,
+ action_568,
+ action_569,
+ action_570,
+ action_571,
+ action_572,
+ action_573,
+ action_574,
+ action_575,
+ action_576,
+ action_577,
+ action_578,
+ action_579,
+ action_580,
+ action_581,
+ action_582,
+ action_583,
+ action_584,
+ action_585,
+ action_586,
+ action_587,
+ action_588,
+ action_589,
+ action_590,
+ action_591,
+ action_592,
+ action_593,
+ action_594,
+ action_595,
+ action_596,
+ action_597,
+ action_598,
+ action_599,
+ action_600,
+ action_601,
+ action_602,
+ action_603,
+ action_604,
+ action_605,
+ action_606,
+ action_607,
+ action_608,
+ action_609,
+ action_610,
+ action_611,
+ action_612,
+ action_613,
+ action_614,
+ action_615,
+ action_616,
+ action_617,
+ action_618,
+ action_619,
+ action_620,
+ action_621,
+ action_622,
+ action_623,
+ action_624,
+ action_625,
+ action_626,
+ action_627,
+ action_628,
+ action_629,
+ action_630,
+ action_631,
+ action_632,
+ action_633,
+ action_634,
+ action_635,
+ action_636,
+ action_637,
+ action_638,
+ action_639,
+ action_640,
+ action_641,
+ action_642,
+ action_643,
+ action_644,
+ action_645,
+ action_646,
+ action_647,
+ action_648,
+ action_649,
+ action_650,
+ action_651,
+ action_652,
+ action_653,
+ action_654,
+ action_655,
+ action_656,
+ action_657,
+ action_658,
+ action_659,
+ action_660,
+ action_661,
+ action_662,
+ action_663,
+ action_664,
+ action_665,
+ action_666,
+ action_667,
+ action_668,
+ action_669,
+ action_670,
+ action_671,
+ action_672,
+ action_673,
+ action_674,
+ action_675,
+ action_676,
+ action_677,
+ action_678,
+ action_679,
+ action_680,
+ action_681,
+ action_682,
+ action_683,
+ action_684,
+ action_685,
+ action_686,
+ action_687,
+ action_688,
+ action_689,
+ action_690,
+ action_691,
+ action_692,
+ action_693,
+ action_694,
+ action_695,
+ action_696,
+ action_697,
+ action_698,
+ action_699,
+ action_700,
+ action_701,
+ action_702,
+ action_703,
+ action_704,
+ action_705,
+ action_706,
+ action_707,
+ action_708,
+ action_709,
+ action_710,
+ action_711,
+ action_712,
+ action_713,
+ action_714,
+ action_715,
+ action_716,
+ action_717,
+ action_718,
+ action_719,
+ action_720,
+ action_721,
+ action_722,
+ action_723,
+ action_724,
+ action_725,
+ action_726,
+ action_727,
+ action_728,
+ action_729,
+ action_730,
+ action_731,
+ action_732,
+ action_733,
+ action_734,
+ action_735,
+ action_736,
+ action_737,
+ action_738,
+ action_739,
+ action_740,
+ action_741,
+ action_742,
+ action_743,
+ action_744,
+ action_745,
+ action_746,
+ action_747 :: () => Int -> HappyReduction (P)
+
+happyReduce_1,
+ happyReduce_2,
+ happyReduce_3,
+ happyReduce_4,
+ happyReduce_5,
+ happyReduce_6,
+ happyReduce_7,
+ happyReduce_8,
+ happyReduce_9,
+ happyReduce_10,
+ happyReduce_11,
+ happyReduce_12,
+ happyReduce_13,
+ happyReduce_14,
+ happyReduce_15,
+ happyReduce_16,
+ happyReduce_17,
+ happyReduce_18,
+ happyReduce_19,
+ happyReduce_20,
+ happyReduce_21,
+ happyReduce_22,
+ happyReduce_23,
+ happyReduce_24,
+ happyReduce_25,
+ happyReduce_26,
+ happyReduce_27,
+ happyReduce_28,
+ happyReduce_29,
+ happyReduce_30,
+ happyReduce_31,
+ happyReduce_32,
+ happyReduce_33,
+ happyReduce_34,
+ happyReduce_35,
+ happyReduce_36,
+ happyReduce_37,
+ happyReduce_38,
+ happyReduce_39,
+ happyReduce_40,
+ happyReduce_41,
+ happyReduce_42,
+ happyReduce_43,
+ happyReduce_44,
+ happyReduce_45,
+ happyReduce_46,
+ happyReduce_47,
+ happyReduce_48,
+ happyReduce_49,
+ happyReduce_50,
+ happyReduce_51,
+ happyReduce_52,
+ happyReduce_53,
+ happyReduce_54,
+ happyReduce_55,
+ happyReduce_56,
+ happyReduce_57,
+ happyReduce_58,
+ happyReduce_59,
+ happyReduce_60,
+ happyReduce_61,
+ happyReduce_62,
+ happyReduce_63,
+ happyReduce_64,
+ happyReduce_65,
+ happyReduce_66,
+ happyReduce_67,
+ happyReduce_68,
+ happyReduce_69,
+ happyReduce_70,
+ happyReduce_71,
+ happyReduce_72,
+ happyReduce_73,
+ happyReduce_74,
+ happyReduce_75,
+ happyReduce_76,
+ happyReduce_77,
+ happyReduce_78,
+ happyReduce_79,
+ happyReduce_80,
+ happyReduce_81,
+ happyReduce_82,
+ happyReduce_83,
+ happyReduce_84,
+ happyReduce_85,
+ happyReduce_86,
+ happyReduce_87,
+ happyReduce_88,
+ happyReduce_89,
+ happyReduce_90,
+ happyReduce_91,
+ happyReduce_92,
+ happyReduce_93,
+ happyReduce_94,
+ happyReduce_95,
+ happyReduce_96,
+ happyReduce_97,
+ happyReduce_98,
+ happyReduce_99,
+ happyReduce_100,
+ happyReduce_101,
+ happyReduce_102,
+ happyReduce_103,
+ happyReduce_104,
+ happyReduce_105,
+ happyReduce_106,
+ happyReduce_107,
+ happyReduce_108,
+ happyReduce_109,
+ happyReduce_110,
+ happyReduce_111,
+ happyReduce_112,
+ happyReduce_113,
+ happyReduce_114,
+ happyReduce_115,
+ happyReduce_116,
+ happyReduce_117,
+ happyReduce_118,
+ happyReduce_119,
+ happyReduce_120,
+ happyReduce_121,
+ happyReduce_122,
+ happyReduce_123,
+ happyReduce_124,
+ happyReduce_125,
+ happyReduce_126,
+ happyReduce_127,
+ happyReduce_128,
+ happyReduce_129,
+ happyReduce_130,
+ happyReduce_131,
+ happyReduce_132,
+ happyReduce_133,
+ happyReduce_134,
+ happyReduce_135,
+ happyReduce_136,
+ happyReduce_137,
+ happyReduce_138,
+ happyReduce_139,
+ happyReduce_140,
+ happyReduce_141,
+ happyReduce_142,
+ happyReduce_143,
+ happyReduce_144,
+ happyReduce_145,
+ happyReduce_146,
+ happyReduce_147,
+ happyReduce_148,
+ happyReduce_149,
+ happyReduce_150,
+ happyReduce_151,
+ happyReduce_152,
+ happyReduce_153,
+ happyReduce_154,
+ happyReduce_155,
+ happyReduce_156,
+ happyReduce_157,
+ happyReduce_158,
+ happyReduce_159,
+ happyReduce_160,
+ happyReduce_161,
+ happyReduce_162,
+ happyReduce_163,
+ happyReduce_164,
+ happyReduce_165,
+ happyReduce_166,
+ happyReduce_167,
+ happyReduce_168,
+ happyReduce_169,
+ happyReduce_170,
+ happyReduce_171,
+ happyReduce_172,
+ happyReduce_173,
+ happyReduce_174,
+ happyReduce_175,
+ happyReduce_176,
+ happyReduce_177,
+ happyReduce_178,
+ happyReduce_179,
+ happyReduce_180,
+ happyReduce_181,
+ happyReduce_182,
+ happyReduce_183,
+ happyReduce_184,
+ happyReduce_185,
+ happyReduce_186,
+ happyReduce_187,
+ happyReduce_188,
+ happyReduce_189,
+ happyReduce_190,
+ happyReduce_191,
+ happyReduce_192,
+ happyReduce_193,
+ happyReduce_194,
+ happyReduce_195,
+ happyReduce_196,
+ happyReduce_197,
+ happyReduce_198,
+ happyReduce_199,
+ happyReduce_200,
+ happyReduce_201,
+ happyReduce_202,
+ happyReduce_203,
+ happyReduce_204,
+ happyReduce_205,
+ happyReduce_206,
+ happyReduce_207,
+ happyReduce_208,
+ happyReduce_209,
+ happyReduce_210,
+ happyReduce_211,
+ happyReduce_212,
+ happyReduce_213,
+ happyReduce_214,
+ happyReduce_215,
+ happyReduce_216,
+ happyReduce_217,
+ happyReduce_218,
+ happyReduce_219,
+ happyReduce_220,
+ happyReduce_221,
+ happyReduce_222,
+ happyReduce_223,
+ happyReduce_224,
+ happyReduce_225,
+ happyReduce_226,
+ happyReduce_227,
+ happyReduce_228,
+ happyReduce_229,
+ happyReduce_230,
+ happyReduce_231,
+ happyReduce_232,
+ happyReduce_233,
+ happyReduce_234,
+ happyReduce_235,
+ happyReduce_236,
+ happyReduce_237,
+ happyReduce_238,
+ happyReduce_239,
+ happyReduce_240,
+ happyReduce_241,
+ happyReduce_242,
+ happyReduce_243,
+ happyReduce_244,
+ happyReduce_245,
+ happyReduce_246,
+ happyReduce_247,
+ happyReduce_248,
+ happyReduce_249,
+ happyReduce_250,
+ happyReduce_251,
+ happyReduce_252,
+ happyReduce_253,
+ happyReduce_254,
+ happyReduce_255,
+ happyReduce_256,
+ happyReduce_257,
+ happyReduce_258,
+ happyReduce_259,
+ happyReduce_260,
+ happyReduce_261,
+ happyReduce_262,
+ happyReduce_263,
+ happyReduce_264,
+ happyReduce_265,
+ happyReduce_266,
+ happyReduce_267,
+ happyReduce_268,
+ happyReduce_269,
+ happyReduce_270,
+ happyReduce_271,
+ happyReduce_272,
+ happyReduce_273,
+ happyReduce_274,
+ happyReduce_275,
+ happyReduce_276,
+ happyReduce_277,
+ happyReduce_278,
+ happyReduce_279,
+ happyReduce_280,
+ happyReduce_281,
+ happyReduce_282,
+ happyReduce_283,
+ happyReduce_284,
+ happyReduce_285,
+ happyReduce_286,
+ happyReduce_287,
+ happyReduce_288,
+ happyReduce_289,
+ happyReduce_290,
+ happyReduce_291,
+ happyReduce_292,
+ happyReduce_293,
+ happyReduce_294,
+ happyReduce_295,
+ happyReduce_296,
+ happyReduce_297,
+ happyReduce_298,
+ happyReduce_299,
+ happyReduce_300,
+ happyReduce_301,
+ happyReduce_302,
+ happyReduce_303,
+ happyReduce_304,
+ happyReduce_305,
+ happyReduce_306,
+ happyReduce_307,
+ happyReduce_308,
+ happyReduce_309,
+ happyReduce_310,
+ happyReduce_311,
+ happyReduce_312,
+ happyReduce_313,
+ happyReduce_314,
+ happyReduce_315,
+ happyReduce_316,
+ happyReduce_317,
+ happyReduce_318,
+ happyReduce_319,
+ happyReduce_320,
+ happyReduce_321,
+ happyReduce_322,
+ happyReduce_323,
+ happyReduce_324,
+ happyReduce_325,
+ happyReduce_326,
+ happyReduce_327,
+ happyReduce_328,
+ happyReduce_329,
+ happyReduce_330,
+ happyReduce_331,
+ happyReduce_332,
+ happyReduce_333,
+ happyReduce_334,
+ happyReduce_335,
+ happyReduce_336,
+ happyReduce_337,
+ happyReduce_338,
+ happyReduce_339,
+ happyReduce_340,
+ happyReduce_341,
+ happyReduce_342,
+ happyReduce_343,
+ happyReduce_344,
+ happyReduce_345,
+ happyReduce_346,
+ happyReduce_347,
+ happyReduce_348,
+ happyReduce_349,
+ happyReduce_350,
+ happyReduce_351,
+ happyReduce_352,
+ happyReduce_353,
+ happyReduce_354,
+ happyReduce_355,
+ happyReduce_356,
+ happyReduce_357,
+ happyReduce_358,
+ happyReduce_359,
+ happyReduce_360,
+ happyReduce_361,
+ happyReduce_362,
+ happyReduce_363,
+ happyReduce_364,
+ happyReduce_365,
+ happyReduce_366,
+ happyReduce_367,
+ happyReduce_368,
+ happyReduce_369,
+ happyReduce_370,
+ happyReduce_371,
+ happyReduce_372,
+ happyReduce_373,
+ happyReduce_374,
+ happyReduce_375,
+ happyReduce_376,
+ happyReduce_377,
+ happyReduce_378,
+ happyReduce_379,
+ happyReduce_380,
+ happyReduce_381,
+ happyReduce_382,
+ happyReduce_383,
+ happyReduce_384,
+ happyReduce_385,
+ happyReduce_386,
+ happyReduce_387,
+ happyReduce_388,
+ happyReduce_389,
+ happyReduce_390,
+ happyReduce_391,
+ happyReduce_392,
+ happyReduce_393,
+ happyReduce_394,
+ happyReduce_395,
+ happyReduce_396,
+ happyReduce_397,
+ happyReduce_398,
+ happyReduce_399,
+ happyReduce_400,
+ happyReduce_401,
+ happyReduce_402,
+ happyReduce_403,
+ happyReduce_404,
+ happyReduce_405,
+ happyReduce_406,
+ happyReduce_407,
+ happyReduce_408,
+ happyReduce_409,
+ happyReduce_410,
+ happyReduce_411,
+ happyReduce_412,
+ happyReduce_413,
+ happyReduce_414,
+ happyReduce_415,
+ happyReduce_416,
+ happyReduce_417 :: () => HappyReduction (P)
+
+action_0 (246) = happyShift action_7
+action_0 (4) = happyGoto action_4
+action_0 (5) = happyGoto action_2
+action_0 (6) = happyGoto action_5
+action_0 (166) = happyGoto action_6
+action_0 _ = happyReduce_404
+
+action_1 (5) = happyGoto action_2
+action_1 (166) = happyGoto action_3
+action_1 _ = happyFail
+
+action_2 _ = happyReduce_1
+
+action_3 (244) = happyShift action_12
+action_3 _ = happyFail
+
+action_4 (285) = happyAccept
+action_4 _ = happyFail
+
+action_5 _ = happyReduce_3
+
+action_6 (192) = happyShift action_11
+action_6 (244) = happyShift action_12
+action_6 (7) = happyGoto action_10
+action_6 _ = happyReduce_9
+
+action_7 (6) = happyGoto action_8
+action_7 (166) = happyGoto action_9
+action_7 _ = happyReduce_404
+
+action_8 (249) = happyShift action_25
+action_8 _ = happyFail
+
+action_9 (192) = happyShift action_11
+action_9 (7) = happyGoto action_10
+action_9 _ = happyReduce_9
+
+action_10 (198) = happyShift action_23
+action_10 (277) = happyShift action_24
+action_10 (8) = happyGoto action_21
+action_10 (167) = happyGoto action_22
+action_10 _ = happyReduce_405
+
+action_11 (192) = happyShift action_11
+action_11 (7) = happyGoto action_20
+action_11 _ = happyReduce_9
+
+action_12 (177) = happyShift action_15
+action_12 (181) = happyShift action_16
+action_12 (183) = happyShift action_17
+action_12 (259) = happyShift action_18
+action_12 (281) = happyShift action_19
+action_12 (110) = happyGoto action_13
+action_12 (111) = happyGoto action_14
+action_12 _ = happyFail
+
+action_13 (112) = happyGoto action_35
+action_13 _ = happyReduce_286
+
+action_14 (208) = happyShift action_34
+action_14 _ = happyReduce_279
+
+action_15 _ = happyReduce_280
+
+action_16 _ = happyReduce_281
+
+action_17 _ = happyReduce_282
+
+action_18 _ = happyReduce_284
+
+action_19 _ = happyReduce_283
+
+action_20 _ = happyReduce_8
+
+action_21 _ = happyReduce_7
+
+action_22 (9) = happyGoto action_33
+action_22 (10) = happyGoto action_31
+action_22 (11) = happyGoto action_32
+action_22 _ = happyReduce_18
+
+action_23 (9) = happyGoto action_30
+action_23 (10) = happyGoto action_31
+action_23 (11) = happyGoto action_32
+action_23 _ = happyReduce_18
+
+action_24 (181) = happyShift action_28
+action_24 (182) = happyShift action_29
+action_24 (169) = happyGoto action_27
+action_24 _ = happyFail
+
+action_25 (166) = happyGoto action_26
+action_25 _ = happyReduce_404
+
+action_26 (5) = happyGoto action_107
+action_26 (166) = happyGoto action_3
+action_26 _ = happyReduce_404
+
+action_27 (193) = happyShift action_106
+action_27 (12) = happyGoto action_104
+action_27 (13) = happyGoto action_105
+action_27 _ = happyReduce_20
+
+action_28 _ = happyReduce_408
+
+action_29 _ = happyReduce_409
+
+action_30 (199) = happyShift action_103
+action_30 _ = happyFail
+
+action_31 _ = happyReduce_17
+
+action_32 (177) = happyReduce_404
+action_32 (178) = happyReduce_404
+action_32 (179) = happyReduce_404
+action_32 (180) = happyReduce_404
+action_32 (181) = happyReduce_404
+action_32 (182) = happyReduce_404
+action_32 (183) = happyReduce_404
+action_32 (188) = happyReduce_404
+action_32 (189) = happyReduce_404
+action_32 (190) = happyReduce_404
+action_32 (191) = happyReduce_404
+action_32 (193) = happyReduce_404
+action_32 (197) = happyShift action_102
+action_32 (201) = happyReduce_404
+action_32 (204) = happyReduce_404
+action_32 (216) = happyReduce_404
+action_32 (218) = happyReduce_404
+action_32 (219) = happyReduce_404
+action_32 (220) = happyReduce_404
+action_32 (221) = happyReduce_404
+action_32 (223) = happyReduce_404
+action_32 (233) = happyReduce_404
+action_32 (234) = happyReduce_404
+action_32 (235) = happyReduce_404
+action_32 (236) = happyReduce_404
+action_32 (237) = happyReduce_404
+action_32 (238) = happyReduce_404
+action_32 (240) = happyReduce_404
+action_32 (241) = happyReduce_404
+action_32 (242) = happyReduce_404
+action_32 (244) = happyReduce_404
+action_32 (246) = happyReduce_404
+action_32 (250) = happyReduce_404
+action_32 (251) = happyReduce_404
+action_32 (252) = happyReduce_404
+action_32 (253) = happyReduce_404
+action_32 (254) = happyReduce_404
+action_32 (255) = happyReduce_404
+action_32 (256) = happyReduce_404
+action_32 (257) = happyReduce_404
+action_32 (258) = happyReduce_404
+action_32 (259) = happyReduce_404
+action_32 (260) = happyReduce_404
+action_32 (261) = happyReduce_404
+action_32 (264) = happyReduce_404
+action_32 (267) = happyReduce_404
+action_32 (269) = happyReduce_404
+action_32 (271) = happyReduce_404
+action_32 (272) = happyReduce_404
+action_32 (273) = happyReduce_404
+action_32 (274) = happyReduce_404
+action_32 (276) = happyReduce_404
+action_32 (278) = happyReduce_404
+action_32 (281) = happyReduce_404
+action_32 (284) = happyReduce_404
+action_32 (17) = happyGoto action_92
+action_32 (18) = happyGoto action_93
+action_32 (28) = happyGoto action_94
+action_32 (32) = happyGoto action_95
+action_32 (33) = happyGoto action_96
+action_32 (34) = happyGoto action_97
+action_32 (38) = happyGoto action_98
+action_32 (40) = happyGoto action_99
+action_32 (83) = happyGoto action_100
+action_32 (166) = happyGoto action_101
+action_32 _ = happyReduce_15
+
+action_33 (1) = happyShift action_90
+action_33 (200) = happyShift action_91
+action_33 (168) = happyGoto action_89
+action_33 _ = happyFail
+
+action_34 (177) = happyShift action_15
+action_34 (181) = happyShift action_16
+action_34 (183) = happyShift action_17
+action_34 (259) = happyShift action_18
+action_34 (281) = happyShift action_19
+action_34 (111) = happyGoto action_88
+action_34 _ = happyFail
+
+action_35 (177) = happyShift action_55
+action_35 (178) = happyShift action_56
+action_35 (179) = happyShift action_57
+action_35 (180) = happyShift action_58
+action_35 (181) = happyShift action_59
+action_35 (182) = happyShift action_60
+action_35 (183) = happyShift action_17
+action_35 (188) = happyShift action_61
+action_35 (189) = happyShift action_62
+action_35 (190) = happyShift action_63
+action_35 (191) = happyShift action_64
+action_35 (193) = happyShift action_65
+action_35 (201) = happyShift action_66
+action_35 (204) = happyShift action_67
+action_35 (216) = happyShift action_68
+action_35 (219) = happyShift action_69
+action_35 (220) = happyShift action_70
+action_35 (223) = happyShift action_71
+action_35 (233) = happyShift action_72
+action_35 (234) = happyShift action_73
+action_35 (235) = happyShift action_74
+action_35 (236) = happyShift action_75
+action_35 (237) = happyShift action_76
+action_35 (238) = happyShift action_77
+action_35 (246) = happyShift action_78
+action_35 (247) = happyReduce_289
+action_35 (248) = happyReduce_289
+action_35 (251) = happyShift action_79
+action_35 (252) = happyShift action_80
+action_35 (253) = happyShift action_81
+action_35 (254) = happyShift action_82
+action_35 (255) = happyShift action_83
+action_35 (256) = happyShift action_84
+action_35 (257) = happyShift action_85
+action_35 (259) = happyShift action_18
+action_35 (267) = happyShift action_86
+action_35 (281) = happyShift action_19
+action_35 (284) = happyShift action_87
+action_35 (97) = happyGoto action_36
+action_35 (98) = happyGoto action_37
+action_35 (99) = happyGoto action_38
+action_35 (107) = happyGoto action_39
+action_35 (110) = happyGoto action_40
+action_35 (111) = happyGoto action_14
+action_35 (113) = happyGoto action_41
+action_35 (114) = happyGoto action_42
+action_35 (136) = happyGoto action_43
+action_35 (139) = happyGoto action_44
+action_35 (140) = happyGoto action_45
+action_35 (142) = happyGoto action_46
+action_35 (152) = happyGoto action_47
+action_35 (153) = happyGoto action_48
+action_35 (154) = happyGoto action_49
+action_35 (155) = happyGoto action_50
+action_35 (156) = happyGoto action_51
+action_35 (157) = happyGoto action_52
+action_35 (165) = happyGoto action_53
+action_35 (166) = happyGoto action_54
+action_35 _ = happyReduce_404
+
+action_36 _ = happyReduce_288
+
+action_37 (198) = happyShift action_228
+action_37 (225) = happyShift action_229
+action_37 (226) = happyShift action_230
+action_37 (227) = happyShift action_231
+action_37 (228) = happyShift action_232
+action_37 (229) = happyShift action_233
+action_37 (230) = happyShift action_234
+action_37 _ = happyReduce_224
+
+action_38 _ = happyReduce_233
+
+action_39 _ = happyReduce_247
+
+action_40 (210) = happyShift action_227
+action_40 _ = happyFail
+
+action_41 _ = happyReduce_285
+
+action_42 (247) = happyShift action_225
+action_42 (248) = happyShift action_226
+action_42 _ = happyFail
+
+action_43 _ = happyReduce_236
+
+action_44 (215) = happyShift action_223
+action_44 (232) = happyShift action_224
+action_44 _ = happyReduce_235
+
+action_45 _ = happyReduce_234
+
+action_46 _ = happyReduce_337
+
+action_47 _ = happyReduce_342
+
+action_48 _ = happyReduce_376
+
+action_49 _ = happyReduce_367
+
+action_50 _ = happyReduce_344
+
+action_51 _ = happyReduce_347
+
+action_52 _ = happyReduce_382
+
+action_53 _ = happyReduce_237
+
+action_54 (221) = happyShift action_221
+action_54 (244) = happyShift action_222
+action_54 _ = happyFail
+
+action_55 (208) = happyReduce_280
+action_55 (210) = happyReduce_280
+action_55 _ = happyReduce_369
+
+action_56 _ = happyReduce_368
+
+action_57 _ = happyReduce_380
+
+action_58 _ = happyReduce_381
+
+action_59 (208) = happyReduce_281
+action_59 (210) = happyReduce_281
+action_59 _ = happyReduce_384
+
+action_60 _ = happyReduce_383
+
+action_61 _ = happyReduce_400
+
+action_62 _ = happyReduce_402
+
+action_63 _ = happyReduce_401
+
+action_64 _ = happyReduce_403
+
+action_65 (177) = happyShift action_114
+action_65 (178) = happyShift action_56
+action_65 (179) = happyShift action_57
+action_65 (180) = happyShift action_58
+action_65 (181) = happyShift action_115
+action_65 (182) = happyShift action_60
+action_65 (183) = happyShift action_129
+action_65 (184) = happyShift action_210
+action_65 (185) = happyShift action_211
+action_65 (186) = happyShift action_212
+action_65 (187) = happyShift action_213
+action_65 (188) = happyShift action_61
+action_65 (189) = happyShift action_62
+action_65 (190) = happyShift action_63
+action_65 (191) = happyShift action_64
+action_65 (193) = happyShift action_65
+action_65 (194) = happyShift action_214
+action_65 (201) = happyShift action_66
+action_65 (203) = happyShift action_215
+action_65 (204) = happyShift action_67
+action_65 (205) = happyShift action_216
+action_65 (206) = happyShift action_217
+action_65 (208) = happyShift action_218
+action_65 (211) = happyShift action_158
+action_65 (216) = happyShift action_68
+action_65 (218) = happyShift action_219
+action_65 (219) = happyShift action_220
+action_65 (220) = happyShift action_70
+action_65 (223) = happyShift action_71
+action_65 (233) = happyShift action_72
+action_65 (234) = happyShift action_73
+action_65 (235) = happyShift action_74
+action_65 (236) = happyShift action_75
+action_65 (237) = happyShift action_76
+action_65 (238) = happyShift action_77
+action_65 (240) = happyShift action_132
+action_65 (241) = happyShift action_133
+action_65 (242) = happyShift action_134
+action_65 (246) = happyShift action_78
+action_65 (251) = happyShift action_79
+action_65 (252) = happyShift action_80
+action_65 (253) = happyShift action_81
+action_65 (254) = happyShift action_82
+action_65 (255) = happyShift action_83
+action_65 (256) = happyShift action_84
+action_65 (257) = happyShift action_85
+action_65 (258) = happyShift action_136
+action_65 (263) = happyShift action_159
+action_65 (264) = happyShift action_140
+action_65 (267) = happyShift action_86
+action_65 (268) = happyShift action_160
+action_65 (275) = happyShift action_161
+action_65 (276) = happyShift action_146
+action_65 (284) = happyShift action_87
+action_65 (88) = happyGoto action_194
+action_65 (89) = happyGoto action_154
+action_65 (90) = happyGoto action_155
+action_65 (91) = happyGoto action_195
+action_65 (92) = happyGoto action_157
+action_65 (93) = happyGoto action_123
+action_65 (94) = happyGoto action_124
+action_65 (97) = happyGoto action_125
+action_65 (98) = happyGoto action_37
+action_65 (99) = happyGoto action_38
+action_65 (100) = happyGoto action_126
+action_65 (102) = happyGoto action_196
+action_65 (103) = happyGoto action_197
+action_65 (106) = happyGoto action_198
+action_65 (107) = happyGoto action_39
+action_65 (115) = happyGoto action_127
+action_65 (136) = happyGoto action_43
+action_65 (139) = happyGoto action_44
+action_65 (140) = happyGoto action_45
+action_65 (142) = happyGoto action_46
+action_65 (145) = happyGoto action_199
+action_65 (147) = happyGoto action_200
+action_65 (150) = happyGoto action_201
+action_65 (151) = happyGoto action_202
+action_65 (152) = happyGoto action_47
+action_65 (153) = happyGoto action_48
+action_65 (154) = happyGoto action_49
+action_65 (155) = happyGoto action_50
+action_65 (156) = happyGoto action_51
+action_65 (157) = happyGoto action_52
+action_65 (158) = happyGoto action_203
+action_65 (159) = happyGoto action_204
+action_65 (160) = happyGoto action_205
+action_65 (161) = happyGoto action_206
+action_65 (162) = happyGoto action_207
+action_65 (163) = happyGoto action_208
+action_65 (164) = happyGoto action_209
+action_65 (165) = happyGoto action_53
+action_65 (166) = happyGoto action_54
+action_65 _ = happyReduce_404
+
+action_66 (177) = happyShift action_114
+action_66 (178) = happyShift action_56
+action_66 (179) = happyShift action_57
+action_66 (180) = happyShift action_58
+action_66 (181) = happyShift action_115
+action_66 (182) = happyShift action_60
+action_66 (183) = happyShift action_129
+action_66 (188) = happyShift action_61
+action_66 (189) = happyShift action_62
+action_66 (190) = happyShift action_63
+action_66 (191) = happyShift action_64
+action_66 (193) = happyShift action_65
+action_66 (201) = happyShift action_66
+action_66 (202) = happyShift action_193
+action_66 (204) = happyShift action_67
+action_66 (211) = happyShift action_158
+action_66 (216) = happyShift action_68
+action_66 (218) = happyShift action_130
+action_66 (219) = happyShift action_69
+action_66 (220) = happyShift action_70
+action_66 (223) = happyShift action_71
+action_66 (233) = happyShift action_72
+action_66 (234) = happyShift action_73
+action_66 (235) = happyShift action_74
+action_66 (236) = happyShift action_75
+action_66 (237) = happyShift action_76
+action_66 (238) = happyShift action_77
+action_66 (240) = happyShift action_132
+action_66 (241) = happyShift action_133
+action_66 (242) = happyShift action_134
+action_66 (246) = happyShift action_78
+action_66 (251) = happyShift action_79
+action_66 (252) = happyShift action_80
+action_66 (253) = happyShift action_81
+action_66 (254) = happyShift action_82
+action_66 (255) = happyShift action_83
+action_66 (256) = happyShift action_84
+action_66 (257) = happyShift action_85
+action_66 (258) = happyShift action_136
+action_66 (263) = happyShift action_159
+action_66 (264) = happyShift action_140
+action_66 (267) = happyShift action_86
+action_66 (268) = happyShift action_160
+action_66 (275) = happyShift action_161
+action_66 (276) = happyShift action_146
+action_66 (284) = happyShift action_87
+action_66 (88) = happyGoto action_190
+action_66 (89) = happyGoto action_154
+action_66 (90) = happyGoto action_155
+action_66 (91) = happyGoto action_156
+action_66 (92) = happyGoto action_157
+action_66 (93) = happyGoto action_123
+action_66 (94) = happyGoto action_124
+action_66 (97) = happyGoto action_125
+action_66 (98) = happyGoto action_37
+action_66 (99) = happyGoto action_38
+action_66 (100) = happyGoto action_126
+action_66 (107) = happyGoto action_39
+action_66 (115) = happyGoto action_127
+action_66 (116) = happyGoto action_191
+action_66 (117) = happyGoto action_192
+action_66 (136) = happyGoto action_43
+action_66 (139) = happyGoto action_44
+action_66 (140) = happyGoto action_45
+action_66 (142) = happyGoto action_46
+action_66 (152) = happyGoto action_47
+action_66 (153) = happyGoto action_48
+action_66 (154) = happyGoto action_49
+action_66 (155) = happyGoto action_50
+action_66 (156) = happyGoto action_51
+action_66 (157) = happyGoto action_52
+action_66 (165) = happyGoto action_53
+action_66 (166) = happyGoto action_54
+action_66 _ = happyReduce_404
+
+action_67 _ = happyReduce_243
+
+action_68 (177) = happyShift action_114
+action_68 (178) = happyShift action_56
+action_68 (179) = happyShift action_57
+action_68 (180) = happyShift action_58
+action_68 (181) = happyShift action_115
+action_68 (182) = happyShift action_60
+action_68 (188) = happyShift action_61
+action_68 (189) = happyShift action_62
+action_68 (190) = happyShift action_63
+action_68 (191) = happyShift action_64
+action_68 (193) = happyShift action_65
+action_68 (201) = happyShift action_66
+action_68 (204) = happyShift action_67
+action_68 (216) = happyShift action_68
+action_68 (219) = happyShift action_69
+action_68 (220) = happyShift action_70
+action_68 (223) = happyShift action_71
+action_68 (233) = happyShift action_72
+action_68 (234) = happyShift action_73
+action_68 (235) = happyShift action_74
+action_68 (236) = happyShift action_75
+action_68 (237) = happyShift action_76
+action_68 (238) = happyShift action_77
+action_68 (246) = happyShift action_78
+action_68 (251) = happyShift action_79
+action_68 (252) = happyShift action_80
+action_68 (253) = happyShift action_81
+action_68 (254) = happyShift action_82
+action_68 (255) = happyShift action_83
+action_68 (256) = happyShift action_84
+action_68 (257) = happyShift action_85
+action_68 (267) = happyShift action_86
+action_68 (284) = happyShift action_87
+action_68 (97) = happyGoto action_189
+action_68 (98) = happyGoto action_37
+action_68 (99) = happyGoto action_38
+action_68 (107) = happyGoto action_39
+action_68 (136) = happyGoto action_43
+action_68 (139) = happyGoto action_44
+action_68 (140) = happyGoto action_45
+action_68 (142) = happyGoto action_46
+action_68 (152) = happyGoto action_47
+action_68 (153) = happyGoto action_48
+action_68 (154) = happyGoto action_49
+action_68 (155) = happyGoto action_50
+action_68 (156) = happyGoto action_51
+action_68 (157) = happyGoto action_52
+action_68 (165) = happyGoto action_53
+action_68 (166) = happyGoto action_54
+action_68 _ = happyReduce_404
+
+action_69 (177) = happyShift action_114
+action_69 (178) = happyShift action_56
+action_69 (179) = happyShift action_57
+action_69 (180) = happyShift action_58
+action_69 (181) = happyShift action_115
+action_69 (182) = happyShift action_60
+action_69 (188) = happyShift action_61
+action_69 (189) = happyShift action_62
+action_69 (190) = happyShift action_63
+action_69 (191) = happyShift action_64
+action_69 (193) = happyShift action_65
+action_69 (201) = happyShift action_66
+action_69 (204) = happyShift action_67
+action_69 (216) = happyShift action_68
+action_69 (219) = happyShift action_69
+action_69 (220) = happyShift action_70
+action_69 (223) = happyShift action_71
+action_69 (233) = happyShift action_72
+action_69 (234) = happyShift action_73
+action_69 (235) = happyShift action_74
+action_69 (236) = happyShift action_75
+action_69 (237) = happyShift action_76
+action_69 (238) = happyShift action_77
+action_69 (246) = happyShift action_78
+action_69 (251) = happyShift action_79
+action_69 (252) = happyShift action_80
+action_69 (253) = happyShift action_81
+action_69 (254) = happyShift action_82
+action_69 (255) = happyShift action_83
+action_69 (256) = happyShift action_84
+action_69 (257) = happyShift action_85
+action_69 (267) = happyShift action_86
+action_69 (284) = happyShift action_87
+action_69 (97) = happyGoto action_188
+action_69 (98) = happyGoto action_37
+action_69 (99) = happyGoto action_38
+action_69 (107) = happyGoto action_39
+action_69 (136) = happyGoto action_43
+action_69 (139) = happyGoto action_44
+action_69 (140) = happyGoto action_45
+action_69 (142) = happyGoto action_46
+action_69 (152) = happyGoto action_47
+action_69 (153) = happyGoto action_48
+action_69 (154) = happyGoto action_49
+action_69 (155) = happyGoto action_50
+action_69 (156) = happyGoto action_51
+action_69 (157) = happyGoto action_52
+action_69 (165) = happyGoto action_53
+action_69 (166) = happyGoto action_54
+action_69 _ = happyReduce_404
+
+action_70 (177) = happyShift action_114
+action_70 (178) = happyShift action_56
+action_70 (179) = happyShift action_57
+action_70 (180) = happyShift action_58
+action_70 (181) = happyShift action_115
+action_70 (182) = happyShift action_60
+action_70 (188) = happyShift action_61
+action_70 (189) = happyShift action_62
+action_70 (190) = happyShift action_63
+action_70 (191) = happyShift action_64
+action_70 (193) = happyShift action_65
+action_70 (201) = happyShift action_66
+action_70 (204) = happyShift action_67
+action_70 (216) = happyShift action_68
+action_70 (219) = happyShift action_69
+action_70 (220) = happyShift action_70
+action_70 (223) = happyShift action_71
+action_70 (233) = happyShift action_72
+action_70 (234) = happyShift action_73
+action_70 (235) = happyShift action_74
+action_70 (236) = happyShift action_75
+action_70 (237) = happyShift action_76
+action_70 (238) = happyShift action_77
+action_70 (246) = happyShift action_78
+action_70 (251) = happyShift action_79
+action_70 (252) = happyShift action_80
+action_70 (253) = happyShift action_81
+action_70 (254) = happyShift action_82
+action_70 (255) = happyShift action_83
+action_70 (256) = happyShift action_84
+action_70 (257) = happyShift action_85
+action_70 (267) = happyShift action_86
+action_70 (284) = happyShift action_87
+action_70 (97) = happyGoto action_187
+action_70 (98) = happyGoto action_37
+action_70 (99) = happyGoto action_38
+action_70 (107) = happyGoto action_39
+action_70 (136) = happyGoto action_43
+action_70 (139) = happyGoto action_44
+action_70 (140) = happyGoto action_45
+action_70 (142) = happyGoto action_46
+action_70 (152) = happyGoto action_47
+action_70 (153) = happyGoto action_48
+action_70 (154) = happyGoto action_49
+action_70 (155) = happyGoto action_50
+action_70 (156) = happyGoto action_51
+action_70 (157) = happyGoto action_52
+action_70 (165) = happyGoto action_53
+action_70 (166) = happyGoto action_54
+action_70 _ = happyReduce_404
+
+action_71 (177) = happyShift action_114
+action_71 (178) = happyShift action_56
+action_71 (179) = happyShift action_57
+action_71 (180) = happyShift action_58
+action_71 (181) = happyShift action_115
+action_71 (182) = happyShift action_60
+action_71 (183) = happyShift action_129
+action_71 (188) = happyShift action_61
+action_71 (189) = happyShift action_62
+action_71 (190) = happyShift action_63
+action_71 (191) = happyShift action_64
+action_71 (193) = happyShift action_65
+action_71 (201) = happyShift action_66
+action_71 (204) = happyShift action_67
+action_71 (211) = happyShift action_158
+action_71 (216) = happyShift action_68
+action_71 (218) = happyShift action_130
+action_71 (219) = happyShift action_69
+action_71 (220) = happyShift action_70
+action_71 (223) = happyShift action_71
+action_71 (233) = happyShift action_72
+action_71 (234) = happyShift action_73
+action_71 (235) = happyShift action_74
+action_71 (236) = happyShift action_75
+action_71 (237) = happyShift action_76
+action_71 (238) = happyShift action_77
+action_71 (240) = happyShift action_132
+action_71 (241) = happyShift action_133
+action_71 (242) = happyShift action_134
+action_71 (246) = happyShift action_78
+action_71 (251) = happyShift action_79
+action_71 (252) = happyShift action_80
+action_71 (253) = happyShift action_81
+action_71 (254) = happyShift action_82
+action_71 (255) = happyShift action_83
+action_71 (256) = happyShift action_84
+action_71 (257) = happyShift action_85
+action_71 (258) = happyShift action_136
+action_71 (263) = happyShift action_159
+action_71 (264) = happyShift action_140
+action_71 (267) = happyShift action_86
+action_71 (268) = happyShift action_160
+action_71 (275) = happyShift action_161
+action_71 (276) = happyShift action_146
+action_71 (284) = happyShift action_87
+action_71 (88) = happyGoto action_183
+action_71 (89) = happyGoto action_154
+action_71 (90) = happyGoto action_155
+action_71 (91) = happyGoto action_156
+action_71 (92) = happyGoto action_157
+action_71 (93) = happyGoto action_123
+action_71 (94) = happyGoto action_124
+action_71 (97) = happyGoto action_125
+action_71 (98) = happyGoto action_37
+action_71 (99) = happyGoto action_38
+action_71 (100) = happyGoto action_126
+action_71 (104) = happyGoto action_184
+action_71 (105) = happyGoto action_185
+action_71 (106) = happyGoto action_186
+action_71 (107) = happyGoto action_39
+action_71 (115) = happyGoto action_127
+action_71 (136) = happyGoto action_43
+action_71 (139) = happyGoto action_44
+action_71 (140) = happyGoto action_45
+action_71 (142) = happyGoto action_46
+action_71 (152) = happyGoto action_47
+action_71 (153) = happyGoto action_48
+action_71 (154) = happyGoto action_49
+action_71 (155) = happyGoto action_50
+action_71 (156) = happyGoto action_51
+action_71 (157) = happyGoto action_52
+action_71 (165) = happyGoto action_53
+action_71 (166) = happyGoto action_54
+action_71 _ = happyReduce_404
+
+action_72 _ = happyReduce_248
+
+action_73 (177) = happyShift action_114
+action_73 (178) = happyShift action_56
+action_73 (179) = happyShift action_57
+action_73 (180) = happyShift action_58
+action_73 (181) = happyShift action_115
+action_73 (182) = happyShift action_60
+action_73 (183) = happyShift action_129
+action_73 (188) = happyShift action_61
+action_73 (189) = happyShift action_62
+action_73 (190) = happyShift action_63
+action_73 (191) = happyShift action_64
+action_73 (193) = happyShift action_65
+action_73 (201) = happyShift action_66
+action_73 (204) = happyShift action_67
+action_73 (211) = happyShift action_158
+action_73 (216) = happyShift action_68
+action_73 (218) = happyShift action_130
+action_73 (219) = happyShift action_69
+action_73 (220) = happyShift action_70
+action_73 (223) = happyShift action_71
+action_73 (233) = happyShift action_72
+action_73 (234) = happyShift action_73
+action_73 (235) = happyShift action_74
+action_73 (236) = happyShift action_75
+action_73 (237) = happyShift action_76
+action_73 (238) = happyShift action_77
+action_73 (240) = happyShift action_132
+action_73 (241) = happyShift action_133
+action_73 (242) = happyShift action_134
+action_73 (246) = happyShift action_78
+action_73 (251) = happyShift action_79
+action_73 (252) = happyShift action_80
+action_73 (253) = happyShift action_81
+action_73 (254) = happyShift action_82
+action_73 (255) = happyShift action_83
+action_73 (256) = happyShift action_84
+action_73 (257) = happyShift action_85
+action_73 (258) = happyShift action_136
+action_73 (263) = happyShift action_159
+action_73 (264) = happyShift action_140
+action_73 (267) = happyShift action_86
+action_73 (268) = happyShift action_160
+action_73 (275) = happyShift action_161
+action_73 (276) = happyShift action_146
+action_73 (284) = happyShift action_87
+action_73 (88) = happyGoto action_182
+action_73 (89) = happyGoto action_154
+action_73 (90) = happyGoto action_155
+action_73 (91) = happyGoto action_156
+action_73 (92) = happyGoto action_157
+action_73 (93) = happyGoto action_123
+action_73 (94) = happyGoto action_124
+action_73 (97) = happyGoto action_125
+action_73 (98) = happyGoto action_37
+action_73 (99) = happyGoto action_38
+action_73 (100) = happyGoto action_126
+action_73 (107) = happyGoto action_39
+action_73 (115) = happyGoto action_127
+action_73 (136) = happyGoto action_43
+action_73 (139) = happyGoto action_44
+action_73 (140) = happyGoto action_45
+action_73 (142) = happyGoto action_46
+action_73 (152) = happyGoto action_47
+action_73 (153) = happyGoto action_48
+action_73 (154) = happyGoto action_49
+action_73 (155) = happyGoto action_50
+action_73 (156) = happyGoto action_51
+action_73 (157) = happyGoto action_52
+action_73 (165) = happyGoto action_53
+action_73 (166) = happyGoto action_54
+action_73 _ = happyReduce_404
+
+action_74 (177) = happyShift action_114
+action_74 (178) = happyShift action_56
+action_74 (179) = happyShift action_57
+action_74 (180) = happyShift action_58
+action_74 (181) = happyShift action_115
+action_74 (182) = happyShift action_60
+action_74 (183) = happyShift action_129
+action_74 (188) = happyShift action_61
+action_74 (189) = happyShift action_62
+action_74 (190) = happyShift action_63
+action_74 (191) = happyShift action_64
+action_74 (193) = happyShift action_65
+action_74 (201) = happyShift action_66
+action_74 (204) = happyShift action_67
+action_74 (211) = happyShift action_158
+action_74 (216) = happyShift action_68
+action_74 (218) = happyShift action_130
+action_74 (219) = happyShift action_69
+action_74 (220) = happyShift action_70
+action_74 (223) = happyShift action_71
+action_74 (233) = happyShift action_72
+action_74 (234) = happyShift action_73
+action_74 (235) = happyShift action_74
+action_74 (236) = happyShift action_75
+action_74 (237) = happyShift action_76
+action_74 (238) = happyShift action_77
+action_74 (240) = happyShift action_132
+action_74 (241) = happyShift action_133
+action_74 (242) = happyShift action_134
+action_74 (246) = happyShift action_78
+action_74 (251) = happyShift action_79
+action_74 (252) = happyShift action_80
+action_74 (253) = happyShift action_81
+action_74 (254) = happyShift action_82
+action_74 (255) = happyShift action_83
+action_74 (256) = happyShift action_84
+action_74 (257) = happyShift action_85
+action_74 (258) = happyShift action_136
+action_74 (263) = happyShift action_159
+action_74 (264) = happyShift action_140
+action_74 (267) = happyShift action_86
+action_74 (268) = happyShift action_160
+action_74 (275) = happyShift action_161
+action_74 (276) = happyShift action_146
+action_74 (284) = happyShift action_87
+action_74 (88) = happyGoto action_181
+action_74 (89) = happyGoto action_154
+action_74 (90) = happyGoto action_155
+action_74 (91) = happyGoto action_156
+action_74 (92) = happyGoto action_157
+action_74 (93) = happyGoto action_123
+action_74 (94) = happyGoto action_124
+action_74 (97) = happyGoto action_125
+action_74 (98) = happyGoto action_37
+action_74 (99) = happyGoto action_38
+action_74 (100) = happyGoto action_126
+action_74 (107) = happyGoto action_39
+action_74 (115) = happyGoto action_127
+action_74 (136) = happyGoto action_43
+action_74 (139) = happyGoto action_44
+action_74 (140) = happyGoto action_45
+action_74 (142) = happyGoto action_46
+action_74 (152) = happyGoto action_47
+action_74 (153) = happyGoto action_48
+action_74 (154) = happyGoto action_49
+action_74 (155) = happyGoto action_50
+action_74 (156) = happyGoto action_51
+action_74 (157) = happyGoto action_52
+action_74 (165) = happyGoto action_53
+action_74 (166) = happyGoto action_54
+action_74 _ = happyReduce_404
+
+action_75 (177) = happyShift action_114
+action_75 (178) = happyShift action_56
+action_75 (179) = happyShift action_57
+action_75 (180) = happyShift action_58
+action_75 (181) = happyShift action_115
+action_75 (182) = happyShift action_60
+action_75 (183) = happyShift action_129
+action_75 (188) = happyShift action_61
+action_75 (189) = happyShift action_62
+action_75 (190) = happyShift action_63
+action_75 (191) = happyShift action_64
+action_75 (193) = happyShift action_65
+action_75 (201) = happyShift action_66
+action_75 (204) = happyShift action_67
+action_75 (211) = happyShift action_158
+action_75 (216) = happyShift action_68
+action_75 (218) = happyShift action_130
+action_75 (219) = happyShift action_69
+action_75 (220) = happyShift action_70
+action_75 (223) = happyShift action_71
+action_75 (233) = happyShift action_72
+action_75 (234) = happyShift action_73
+action_75 (235) = happyShift action_74
+action_75 (236) = happyShift action_75
+action_75 (237) = happyShift action_76
+action_75 (238) = happyShift action_77
+action_75 (240) = happyShift action_132
+action_75 (241) = happyShift action_133
+action_75 (242) = happyShift action_134
+action_75 (246) = happyShift action_78
+action_75 (251) = happyShift action_79
+action_75 (252) = happyShift action_80
+action_75 (253) = happyShift action_81
+action_75 (254) = happyShift action_82
+action_75 (255) = happyShift action_83
+action_75 (256) = happyShift action_84
+action_75 (257) = happyShift action_85
+action_75 (258) = happyShift action_136
+action_75 (263) = happyShift action_159
+action_75 (264) = happyShift action_140
+action_75 (267) = happyShift action_86
+action_75 (268) = happyShift action_160
+action_75 (275) = happyShift action_161
+action_75 (276) = happyShift action_146
+action_75 (284) = happyShift action_87
+action_75 (89) = happyGoto action_179
+action_75 (90) = happyGoto action_155
+action_75 (91) = happyGoto action_180
+action_75 (92) = happyGoto action_157
+action_75 (93) = happyGoto action_123
+action_75 (94) = happyGoto action_124
+action_75 (97) = happyGoto action_125
+action_75 (98) = happyGoto action_37
+action_75 (99) = happyGoto action_38
+action_75 (100) = happyGoto action_126
+action_75 (107) = happyGoto action_39
+action_75 (115) = happyGoto action_127
+action_75 (136) = happyGoto action_43
+action_75 (139) = happyGoto action_44
+action_75 (140) = happyGoto action_45
+action_75 (142) = happyGoto action_46
+action_75 (152) = happyGoto action_47
+action_75 (153) = happyGoto action_48
+action_75 (154) = happyGoto action_49
+action_75 (155) = happyGoto action_50
+action_75 (156) = happyGoto action_51
+action_75 (157) = happyGoto action_52
+action_75 (165) = happyGoto action_53
+action_75 (166) = happyGoto action_54
+action_75 _ = happyReduce_404
+
+action_76 (177) = happyShift action_114
+action_76 (179) = happyShift action_57
+action_76 (180) = happyShift action_58
+action_76 (181) = happyShift action_115
+action_76 (182) = happyShift action_60
+action_76 (193) = happyShift action_175
+action_76 (195) = happyShift action_176
+action_76 (201) = happyShift action_177
+action_76 (251) = happyShift action_79
+action_76 (252) = happyShift action_80
+action_76 (253) = happyShift action_81
+action_76 (254) = happyShift action_82
+action_76 (255) = happyShift action_83
+action_76 (256) = happyShift action_84
+action_76 (257) = happyShift action_85
+action_76 (266) = happyShift action_178
+action_76 (267) = happyShift action_86
+action_76 (284) = happyShift action_87
+action_76 (46) = happyGoto action_164
+action_76 (47) = happyGoto action_165
+action_76 (48) = happyGoto action_166
+action_76 (49) = happyGoto action_167
+action_76 (50) = happyGoto action_168
+action_76 (52) = happyGoto action_169
+action_76 (53) = happyGoto action_170
+action_76 (140) = happyGoto action_171
+action_76 (153) = happyGoto action_48
+action_76 (154) = happyGoto action_172
+action_76 (155) = happyGoto action_50
+action_76 (156) = happyGoto action_173
+action_76 (157) = happyGoto action_52
+action_76 (174) = happyGoto action_174
+action_76 _ = happyFail
+
+action_77 (28) = happyGoto action_94
+action_77 (32) = happyGoto action_162
+action_77 (33) = happyGoto action_96
+action_77 (34) = happyGoto action_97
+action_77 (38) = happyGoto action_98
+action_77 (40) = happyGoto action_99
+action_77 (83) = happyGoto action_100
+action_77 (166) = happyGoto action_163
+action_77 _ = happyReduce_404
+
+action_78 (177) = happyShift action_114
+action_78 (178) = happyShift action_56
+action_78 (179) = happyShift action_57
+action_78 (180) = happyShift action_58
+action_78 (181) = happyShift action_115
+action_78 (182) = happyShift action_60
+action_78 (183) = happyShift action_129
+action_78 (188) = happyShift action_61
+action_78 (189) = happyShift action_62
+action_78 (190) = happyShift action_63
+action_78 (191) = happyShift action_64
+action_78 (193) = happyShift action_65
+action_78 (201) = happyShift action_66
+action_78 (204) = happyShift action_67
+action_78 (211) = happyShift action_158
+action_78 (216) = happyShift action_68
+action_78 (218) = happyShift action_130
+action_78 (219) = happyShift action_69
+action_78 (220) = happyShift action_70
+action_78 (223) = happyShift action_71
+action_78 (233) = happyShift action_72
+action_78 (234) = happyShift action_73
+action_78 (235) = happyShift action_74
+action_78 (236) = happyShift action_75
+action_78 (237) = happyShift action_76
+action_78 (238) = happyShift action_77
+action_78 (240) = happyShift action_132
+action_78 (241) = happyShift action_133
+action_78 (242) = happyShift action_134
+action_78 (246) = happyShift action_78
+action_78 (251) = happyShift action_79
+action_78 (252) = happyShift action_80
+action_78 (253) = happyShift action_81
+action_78 (254) = happyShift action_82
+action_78 (255) = happyShift action_83
+action_78 (256) = happyShift action_84
+action_78 (257) = happyShift action_85
+action_78 (258) = happyShift action_136
+action_78 (263) = happyShift action_159
+action_78 (264) = happyShift action_140
+action_78 (267) = happyShift action_86
+action_78 (268) = happyShift action_160
+action_78 (275) = happyShift action_161
+action_78 (276) = happyShift action_146
+action_78 (284) = happyShift action_87
+action_78 (88) = happyGoto action_153
+action_78 (89) = happyGoto action_154
+action_78 (90) = happyGoto action_155
+action_78 (91) = happyGoto action_156
+action_78 (92) = happyGoto action_157
+action_78 (93) = happyGoto action_123
+action_78 (94) = happyGoto action_124
+action_78 (97) = happyGoto action_125
+action_78 (98) = happyGoto action_37
+action_78 (99) = happyGoto action_38
+action_78 (100) = happyGoto action_126
+action_78 (107) = happyGoto action_39
+action_78 (115) = happyGoto action_127
+action_78 (136) = happyGoto action_43
+action_78 (139) = happyGoto action_44
+action_78 (140) = happyGoto action_45
+action_78 (142) = happyGoto action_46
+action_78 (152) = happyGoto action_47
+action_78 (153) = happyGoto action_48
+action_78 (154) = happyGoto action_49
+action_78 (155) = happyGoto action_50
+action_78 (156) = happyGoto action_51
+action_78 (157) = happyGoto action_52
+action_78 (165) = happyGoto action_53
+action_78 (166) = happyGoto action_54
+action_78 _ = happyReduce_404
+
+action_79 _ = happyReduce_373
+
+action_80 _ = happyReduce_377
+
+action_81 _ = happyReduce_378
+
+action_82 _ = happyReduce_379
+
+action_83 _ = happyReduce_374
+
+action_84 _ = happyReduce_375
+
+action_85 _ = happyReduce_370
+
+action_86 _ = happyReduce_372
+
+action_87 _ = happyReduce_371
+
+action_88 _ = happyReduce_278
+
+action_89 _ = happyReduce_11
+
+action_90 _ = happyReduce_407
+
+action_91 _ = happyReduce_406
+
+action_92 (10) = happyGoto action_151
+action_92 (11) = happyGoto action_152
+action_92 _ = happyReduce_18
+
+action_93 _ = happyReduce_34
+
+action_94 _ = happyReduce_87
+
+action_95 _ = happyReduce_13
+
+action_96 (10) = happyGoto action_149
+action_96 (11) = happyGoto action_150
+action_96 _ = happyReduce_18
+
+action_97 _ = happyReduce_67
+
+action_98 _ = happyReduce_78
+
+action_99 _ = happyReduce_86
+
+action_100 _ = happyReduce_88
+
+action_101 (177) = happyShift action_114
+action_101 (178) = happyShift action_56
+action_101 (179) = happyShift action_57
+action_101 (180) = happyShift action_58
+action_101 (181) = happyShift action_115
+action_101 (182) = happyShift action_60
+action_101 (183) = happyShift action_129
+action_101 (188) = happyShift action_61
+action_101 (189) = happyShift action_62
+action_101 (190) = happyShift action_63
+action_101 (191) = happyShift action_64
+action_101 (193) = happyShift action_65
+action_101 (201) = happyShift action_66
+action_101 (204) = happyShift action_67
+action_101 (216) = happyShift action_68
+action_101 (218) = happyShift action_130
+action_101 (219) = happyShift action_69
+action_101 (220) = happyShift action_70
+action_101 (223) = happyShift action_71
+action_101 (233) = happyShift action_72
+action_101 (234) = happyShift action_131
+action_101 (235) = happyShift action_74
+action_101 (236) = happyShift action_75
+action_101 (237) = happyShift action_76
+action_101 (238) = happyShift action_77
+action_101 (240) = happyShift action_132
+action_101 (241) = happyShift action_133
+action_101 (242) = happyShift action_134
+action_101 (246) = happyShift action_78
+action_101 (250) = happyShift action_135
+action_101 (251) = happyShift action_79
+action_101 (252) = happyShift action_80
+action_101 (253) = happyShift action_81
+action_101 (254) = happyShift action_82
+action_101 (255) = happyShift action_83
+action_101 (256) = happyShift action_84
+action_101 (257) = happyShift action_85
+action_101 (258) = happyShift action_136
+action_101 (259) = happyShift action_137
+action_101 (260) = happyShift action_138
+action_101 (261) = happyShift action_139
+action_101 (264) = happyShift action_140
+action_101 (267) = happyShift action_86
+action_101 (269) = happyShift action_141
+action_101 (271) = happyShift action_142
+action_101 (272) = happyShift action_143
+action_101 (273) = happyShift action_144
+action_101 (274) = happyShift action_145
+action_101 (276) = happyShift action_146
+action_101 (278) = happyShift action_147
+action_101 (281) = happyShift action_148
+action_101 (284) = happyShift action_87
+action_101 (30) = happyGoto action_120
+action_101 (42) = happyGoto action_121
+action_101 (91) = happyGoto action_122
+action_101 (93) = happyGoto action_123
+action_101 (94) = happyGoto action_124
+action_101 (97) = happyGoto action_125
+action_101 (98) = happyGoto action_37
+action_101 (99) = happyGoto action_38
+action_101 (100) = happyGoto action_126
+action_101 (107) = happyGoto action_39
+action_101 (115) = happyGoto action_127
+action_101 (136) = happyGoto action_43
+action_101 (139) = happyGoto action_128
+action_101 (140) = happyGoto action_45
+action_101 (142) = happyGoto action_46
+action_101 (152) = happyGoto action_47
+action_101 (153) = happyGoto action_48
+action_101 (154) = happyGoto action_49
+action_101 (155) = happyGoto action_50
+action_101 (156) = happyGoto action_51
+action_101 (157) = happyGoto action_52
+action_101 (165) = happyGoto action_53
+action_101 (166) = happyGoto action_54
+action_101 _ = happyReduce_404
+
+action_102 _ = happyReduce_16
+
+action_103 _ = happyReduce_10
+
+action_104 (282) = happyShift action_119
+action_104 _ = happyFail
+
+action_105 _ = happyReduce_19
+
+action_106 (177) = happyShift action_114
+action_106 (178) = happyShift action_56
+action_106 (181) = happyShift action_115
+action_106 (182) = happyShift action_60
+action_106 (193) = happyShift action_116
+action_106 (203) = happyShift action_117
+action_106 (251) = happyShift action_79
+action_106 (252) = happyShift action_80
+action_106 (253) = happyShift action_81
+action_106 (254) = happyShift action_82
+action_106 (255) = happyShift action_83
+action_106 (256) = happyShift action_84
+action_106 (257) = happyShift action_85
+action_106 (267) = happyShift action_86
+action_106 (277) = happyShift action_118
+action_106 (284) = happyShift action_87
+action_106 (14) = happyGoto action_108
+action_106 (15) = happyGoto action_109
+action_106 (16) = happyGoto action_110
+action_106 (139) = happyGoto action_111
+action_106 (152) = happyGoto action_47
+action_106 (153) = happyGoto action_48
+action_106 (154) = happyGoto action_49
+action_106 (156) = happyGoto action_112
+action_106 (157) = happyGoto action_52
+action_106 (172) = happyGoto action_113
+action_106 _ = happyReduce_24
+
+action_107 _ = happyReduce_2
+
+action_108 (194) = happyShift action_365
+action_108 _ = happyFail
+
+action_109 (203) = happyShift action_364
+action_109 (14) = happyGoto action_363
+action_109 _ = happyReduce_24
+
+action_110 _ = happyReduce_26
+
+action_111 _ = happyReduce_27
+
+action_112 _ = happyReduce_412
+
+action_113 (193) = happyShift action_362
+action_113 _ = happyReduce_28
+
+action_114 _ = happyReduce_369
+
+action_115 _ = happyReduce_384
+
+action_116 (184) = happyShift action_262
+action_116 (186) = happyShift action_212
+action_116 (206) = happyShift action_264
+action_116 (218) = happyShift action_266
+action_116 (219) = happyShift action_267
+action_116 (160) = happyGoto action_205
+action_116 (162) = happyGoto action_207
+action_116 (164) = happyGoto action_261
+action_116 _ = happyFail
+
+action_117 _ = happyReduce_23
+
+action_118 (181) = happyShift action_28
+action_118 (182) = happyShift action_29
+action_118 (169) = happyGoto action_361
+action_118 _ = happyFail
+
+action_119 (198) = happyShift action_23
+action_119 (8) = happyGoto action_360
+action_119 (167) = happyGoto action_22
+action_119 _ = happyReduce_405
+
+action_120 (188) = happyShift action_359
+action_120 (29) = happyGoto action_358
+action_120 _ = happyReduce_58
+
+action_121 (203) = happyShift action_356
+action_121 (209) = happyShift action_357
+action_121 _ = happyFail
+
+action_122 (184) = happyShift action_262
+action_122 (185) = happyShift action_211
+action_122 (186) = happyShift action_212
+action_122 (187) = happyShift action_213
+action_122 (205) = happyShift action_263
+action_122 (206) = happyShift action_264
+action_122 (208) = happyShift action_218
+action_122 (210) = happyShift action_355
+action_122 (218) = happyShift action_266
+action_122 (219) = happyShift action_267
+action_122 (85) = happyGoto action_350
+action_122 (86) = happyGoto action_351
+action_122 (87) = happyGoto action_352
+action_122 (144) = happyGoto action_256
+action_122 (147) = happyGoto action_257
+action_122 (149) = happyGoto action_353
+action_122 (151) = happyGoto action_259
+action_122 (158) = happyGoto action_203
+action_122 (159) = happyGoto action_204
+action_122 (160) = happyGoto action_260
+action_122 (162) = happyGoto action_207
+action_122 (164) = happyGoto action_261
+action_122 (166) = happyGoto action_354
+action_122 _ = happyReduce_404
+
+action_123 _ = happyReduce_203
+
+action_124 (177) = happyShift action_114
+action_124 (178) = happyShift action_56
+action_124 (179) = happyShift action_57
+action_124 (180) = happyShift action_58
+action_124 (181) = happyShift action_115
+action_124 (182) = happyShift action_60
+action_124 (188) = happyShift action_61
+action_124 (189) = happyShift action_62
+action_124 (190) = happyShift action_63
+action_124 (191) = happyShift action_64
+action_124 (193) = happyShift action_65
+action_124 (201) = happyShift action_66
+action_124 (204) = happyShift action_67
+action_124 (216) = happyShift action_68
+action_124 (219) = happyShift action_69
+action_124 (220) = happyShift action_70
+action_124 (221) = happyReduce_404
+action_124 (223) = happyShift action_71
+action_124 (233) = happyShift action_72
+action_124 (234) = happyShift action_73
+action_124 (235) = happyShift action_74
+action_124 (236) = happyShift action_75
+action_124 (237) = happyShift action_76
+action_124 (238) = happyShift action_77
+action_124 (244) = happyReduce_404
+action_124 (246) = happyShift action_78
+action_124 (251) = happyShift action_79
+action_124 (252) = happyShift action_80
+action_124 (253) = happyShift action_81
+action_124 (254) = happyShift action_82
+action_124 (255) = happyShift action_83
+action_124 (256) = happyShift action_84
+action_124 (257) = happyShift action_85
+action_124 (267) = happyShift action_86
+action_124 (284) = happyShift action_87
+action_124 (97) = happyGoto action_349
+action_124 (98) = happyGoto action_37
+action_124 (99) = happyGoto action_38
+action_124 (107) = happyGoto action_39
+action_124 (136) = happyGoto action_43
+action_124 (139) = happyGoto action_44
+action_124 (140) = happyGoto action_45
+action_124 (142) = happyGoto action_46
+action_124 (152) = happyGoto action_47
+action_124 (153) = happyGoto action_48
+action_124 (154) = happyGoto action_49
+action_124 (155) = happyGoto action_50
+action_124 (156) = happyGoto action_51
+action_124 (157) = happyGoto action_52
+action_124 (165) = happyGoto action_53
+action_124 (166) = happyGoto action_54
+action_124 _ = happyReduce_213
+
+action_125 _ = happyReduce_215
+
+action_126 _ = happyReduce_212
+
+action_127 _ = happyReduce_202
+
+action_128 (203) = happyReduce_96
+action_128 (209) = happyReduce_96
+action_128 (215) = happyShift action_223
+action_128 (232) = happyShift action_224
+action_128 _ = happyReduce_235
+
+action_129 _ = happyReduce_290
+
+action_130 (177) = happyShift action_114
+action_130 (178) = happyShift action_56
+action_130 (179) = happyShift action_57
+action_130 (180) = happyShift action_58
+action_130 (181) = happyShift action_115
+action_130 (182) = happyShift action_60
+action_130 (188) = happyShift action_61
+action_130 (189) = happyShift action_62
+action_130 (190) = happyShift action_63
+action_130 (191) = happyShift action_64
+action_130 (193) = happyShift action_65
+action_130 (201) = happyShift action_66
+action_130 (204) = happyShift action_67
+action_130 (216) = happyShift action_68
+action_130 (219) = happyShift action_69
+action_130 (220) = happyShift action_70
+action_130 (223) = happyShift action_71
+action_130 (233) = happyShift action_72
+action_130 (234) = happyShift action_73
+action_130 (235) = happyShift action_74
+action_130 (236) = happyShift action_75
+action_130 (237) = happyShift action_76
+action_130 (238) = happyShift action_77
+action_130 (246) = happyShift action_78
+action_130 (251) = happyShift action_79
+action_130 (252) = happyShift action_80
+action_130 (253) = happyShift action_81
+action_130 (254) = happyShift action_82
+action_130 (255) = happyShift action_83
+action_130 (256) = happyShift action_84
+action_130 (257) = happyShift action_85
+action_130 (267) = happyShift action_86
+action_130 (284) = happyShift action_87
+action_130 (94) = happyGoto action_245
+action_130 (97) = happyGoto action_125
+action_130 (98) = happyGoto action_37
+action_130 (99) = happyGoto action_38
+action_130 (107) = happyGoto action_39
+action_130 (136) = happyGoto action_43
+action_130 (139) = happyGoto action_44
+action_130 (140) = happyGoto action_45
+action_130 (142) = happyGoto action_46
+action_130 (152) = happyGoto action_47
+action_130 (153) = happyGoto action_48
+action_130 (154) = happyGoto action_49
+action_130 (155) = happyGoto action_50
+action_130 (156) = happyGoto action_51
+action_130 (157) = happyGoto action_52
+action_130 (165) = happyGoto action_53
+action_130 (166) = happyGoto action_54
+action_130 _ = happyReduce_404
+
+action_131 (177) = happyShift action_114
+action_131 (178) = happyShift action_56
+action_131 (179) = happyShift action_57
+action_131 (180) = happyShift action_58
+action_131 (181) = happyShift action_115
+action_131 (182) = happyShift action_60
+action_131 (183) = happyShift action_129
+action_131 (188) = happyShift action_61
+action_131 (189) = happyShift action_62
+action_131 (190) = happyShift action_63
+action_131 (191) = happyShift action_64
+action_131 (193) = happyShift action_65
+action_131 (201) = happyShift action_66
+action_131 (204) = happyShift action_67
+action_131 (211) = happyShift action_158
+action_131 (216) = happyShift action_68
+action_131 (218) = happyShift action_130
+action_131 (219) = happyShift action_69
+action_131 (220) = happyShift action_70
+action_131 (223) = happyShift action_71
+action_131 (233) = happyShift action_72
+action_131 (234) = happyShift action_73
+action_131 (235) = happyShift action_74
+action_131 (236) = happyShift action_75
+action_131 (237) = happyShift action_76
+action_131 (238) = happyShift action_77
+action_131 (240) = happyShift action_132
+action_131 (241) = happyShift action_133
+action_131 (242) = happyShift action_134
+action_131 (246) = happyShift action_78
+action_131 (251) = happyShift action_79
+action_131 (252) = happyShift action_80
+action_131 (253) = happyShift action_81
+action_131 (254) = happyShift action_82
+action_131 (255) = happyShift action_83
+action_131 (256) = happyShift action_84
+action_131 (257) = happyShift action_85
+action_131 (258) = happyShift action_136
+action_131 (263) = happyShift action_159
+action_131 (264) = happyShift action_140
+action_131 (267) = happyShift action_86
+action_131 (268) = happyShift action_160
+action_131 (275) = happyShift action_161
+action_131 (276) = happyShift action_146
+action_131 (284) = happyShift action_87
+action_131 (88) = happyGoto action_348
+action_131 (89) = happyGoto action_154
+action_131 (90) = happyGoto action_155
+action_131 (91) = happyGoto action_156
+action_131 (92) = happyGoto action_157
+action_131 (93) = happyGoto action_123
+action_131 (94) = happyGoto action_124
+action_131 (97) = happyGoto action_125
+action_131 (98) = happyGoto action_37
+action_131 (99) = happyGoto action_38
+action_131 (100) = happyGoto action_126
+action_131 (107) = happyGoto action_39
+action_131 (115) = happyGoto action_127
+action_131 (136) = happyGoto action_43
+action_131 (139) = happyGoto action_44
+action_131 (140) = happyGoto action_45
+action_131 (142) = happyGoto action_46
+action_131 (152) = happyGoto action_47
+action_131 (153) = happyGoto action_48
+action_131 (154) = happyGoto action_49
+action_131 (155) = happyGoto action_50
+action_131 (156) = happyGoto action_51
+action_131 (157) = happyGoto action_52
+action_131 (165) = happyGoto action_53
+action_131 (166) = happyGoto action_54
+action_131 _ = happyReduce_404
+
+action_132 (177) = happyShift action_114
+action_132 (178) = happyShift action_56
+action_132 (181) = happyShift action_115
+action_132 (182) = happyShift action_60
+action_132 (193) = happyShift action_346
+action_132 (201) = happyShift action_347
+action_132 (251) = happyShift action_79
+action_132 (252) = happyShift action_80
+action_132 (253) = happyShift action_81
+action_132 (254) = happyShift action_82
+action_132 (255) = happyShift action_83
+action_132 (256) = happyShift action_84
+action_132 (257) = happyShift action_85
+action_132 (267) = happyShift action_86
+action_132 (284) = happyShift action_87
+action_132 (50) = happyGoto action_344
+action_132 (139) = happyGoto action_345
+action_132 (152) = happyGoto action_47
+action_132 (153) = happyGoto action_48
+action_132 (154) = happyGoto action_49
+action_132 (156) = happyGoto action_173
+action_132 (157) = happyGoto action_52
+action_132 _ = happyFail
+
+action_133 (177) = happyShift action_114
+action_133 (178) = happyShift action_56
+action_133 (181) = happyShift action_115
+action_133 (182) = happyShift action_60
+action_133 (193) = happyShift action_341
+action_133 (201) = happyShift action_342
+action_133 (251) = happyShift action_79
+action_133 (252) = happyShift action_80
+action_133 (253) = happyShift action_81
+action_133 (254) = happyShift action_82
+action_133 (255) = happyShift action_83
+action_133 (256) = happyShift action_84
+action_133 (257) = happyShift action_85
+action_133 (267) = happyShift action_86
+action_133 (284) = happyShift action_87
+action_133 (101) = happyGoto action_343
+action_133 (136) = happyGoto action_339
+action_133 (139) = happyGoto action_340
+action_133 (142) = happyGoto action_46
+action_133 (152) = happyGoto action_47
+action_133 (153) = happyGoto action_48
+action_133 (154) = happyGoto action_49
+action_133 (156) = happyGoto action_51
+action_133 (157) = happyGoto action_52
+action_133 _ = happyFail
+
+action_134 (177) = happyShift action_114
+action_134 (178) = happyShift action_56
+action_134 (181) = happyShift action_115
+action_134 (182) = happyShift action_60
+action_134 (193) = happyShift action_341
+action_134 (201) = happyShift action_342
+action_134 (251) = happyShift action_79
+action_134 (252) = happyShift action_80
+action_134 (253) = happyShift action_81
+action_134 (254) = happyShift action_82
+action_134 (255) = happyShift action_83
+action_134 (256) = happyShift action_84
+action_134 (257) = happyShift action_85
+action_134 (267) = happyShift action_86
+action_134 (284) = happyShift action_87
+action_134 (101) = happyGoto action_338
+action_134 (136) = happyGoto action_339
+action_134 (139) = happyGoto action_340
+action_134 (142) = happyGoto action_46
+action_134 (152) = happyGoto action_47
+action_134 (153) = happyGoto action_48
+action_134 (154) = happyGoto action_49
+action_134 (156) = happyGoto action_51
+action_134 (157) = happyGoto action_52
+action_134 _ = happyFail
+
+action_135 (251) = happyShift action_336
+action_135 (269) = happyShift action_337
+action_135 _ = happyFail
+
+action_136 (177) = happyShift action_114
+action_136 (178) = happyShift action_56
+action_136 (179) = happyShift action_57
+action_136 (180) = happyShift action_58
+action_136 (181) = happyShift action_115
+action_136 (182) = happyShift action_60
+action_136 (183) = happyShift action_129
+action_136 (188) = happyShift action_61
+action_136 (189) = happyShift action_62
+action_136 (190) = happyShift action_63
+action_136 (191) = happyShift action_64
+action_136 (193) = happyShift action_65
+action_136 (201) = happyShift action_66
+action_136 (204) = happyShift action_67
+action_136 (211) = happyShift action_158
+action_136 (216) = happyShift action_68
+action_136 (218) = happyShift action_130
+action_136 (219) = happyShift action_69
+action_136 (220) = happyShift action_70
+action_136 (223) = happyShift action_71
+action_136 (233) = happyShift action_72
+action_136 (234) = happyShift action_73
+action_136 (235) = happyShift action_74
+action_136 (236) = happyShift action_75
+action_136 (237) = happyShift action_76
+action_136 (238) = happyShift action_77
+action_136 (240) = happyShift action_132
+action_136 (241) = happyShift action_133
+action_136 (242) = happyShift action_134
+action_136 (246) = happyShift action_78
+action_136 (251) = happyShift action_79
+action_136 (252) = happyShift action_80
+action_136 (253) = happyShift action_81
+action_136 (254) = happyShift action_82
+action_136 (255) = happyShift action_83
+action_136 (256) = happyShift action_84
+action_136 (257) = happyShift action_85
+action_136 (258) = happyShift action_136
+action_136 (263) = happyShift action_159
+action_136 (264) = happyShift action_140
+action_136 (267) = happyShift action_86
+action_136 (268) = happyShift action_160
+action_136 (275) = happyShift action_161
+action_136 (276) = happyShift action_146
+action_136 (284) = happyShift action_87
+action_136 (88) = happyGoto action_335
+action_136 (89) = happyGoto action_154
+action_136 (90) = happyGoto action_155
+action_136 (91) = happyGoto action_156
+action_136 (92) = happyGoto action_157
+action_136 (93) = happyGoto action_123
+action_136 (94) = happyGoto action_124
+action_136 (97) = happyGoto action_125
+action_136 (98) = happyGoto action_37
+action_136 (99) = happyGoto action_38
+action_136 (100) = happyGoto action_126
+action_136 (107) = happyGoto action_39
+action_136 (115) = happyGoto action_127
+action_136 (136) = happyGoto action_43
+action_136 (139) = happyGoto action_44
+action_136 (140) = happyGoto action_45
+action_136 (142) = happyGoto action_46
+action_136 (152) = happyGoto action_47
+action_136 (153) = happyGoto action_48
+action_136 (154) = happyGoto action_49
+action_136 (155) = happyGoto action_50
+action_136 (156) = happyGoto action_51
+action_136 (157) = happyGoto action_52
+action_136 (165) = happyGoto action_53
+action_136 (166) = happyGoto action_54
+action_136 _ = happyReduce_404
+
+action_137 (177) = happyShift action_114
+action_137 (179) = happyShift action_57
+action_137 (180) = happyShift action_58
+action_137 (181) = happyShift action_115
+action_137 (182) = happyShift action_60
+action_137 (193) = happyShift action_175
+action_137 (195) = happyShift action_176
+action_137 (201) = happyShift action_177
+action_137 (251) = happyShift action_79
+action_137 (252) = happyShift action_80
+action_137 (253) = happyShift action_81
+action_137 (254) = happyShift action_82
+action_137 (255) = happyShift action_83
+action_137 (256) = happyShift action_84
+action_137 (257) = happyShift action_85
+action_137 (266) = happyShift action_178
+action_137 (267) = happyShift action_86
+action_137 (284) = happyShift action_87
+action_137 (46) = happyGoto action_164
+action_137 (47) = happyGoto action_165
+action_137 (48) = happyGoto action_166
+action_137 (49) = happyGoto action_167
+action_137 (50) = happyGoto action_168
+action_137 (52) = happyGoto action_334
+action_137 (53) = happyGoto action_170
+action_137 (140) = happyGoto action_171
+action_137 (153) = happyGoto action_48
+action_137 (154) = happyGoto action_172
+action_137 (155) = happyGoto action_50
+action_137 (156) = happyGoto action_173
+action_137 (157) = happyGoto action_52
+action_137 (174) = happyGoto action_174
+action_137 _ = happyFail
+
+action_138 (177) = happyShift action_114
+action_138 (179) = happyShift action_57
+action_138 (180) = happyShift action_58
+action_138 (181) = happyShift action_115
+action_138 (182) = happyShift action_60
+action_138 (193) = happyShift action_175
+action_138 (195) = happyShift action_176
+action_138 (201) = happyShift action_177
+action_138 (251) = happyShift action_79
+action_138 (252) = happyShift action_80
+action_138 (253) = happyShift action_81
+action_138 (254) = happyShift action_82
+action_138 (255) = happyShift action_83
+action_138 (256) = happyShift action_84
+action_138 (257) = happyShift action_85
+action_138 (266) = happyShift action_178
+action_138 (267) = happyShift action_86
+action_138 (284) = happyShift action_87
+action_138 (46) = happyGoto action_164
+action_138 (47) = happyGoto action_165
+action_138 (48) = happyGoto action_166
+action_138 (49) = happyGoto action_167
+action_138 (50) = happyGoto action_168
+action_138 (52) = happyGoto action_333
+action_138 (53) = happyGoto action_170
+action_138 (140) = happyGoto action_171
+action_138 (153) = happyGoto action_48
+action_138 (154) = happyGoto action_172
+action_138 (155) = happyGoto action_50
+action_138 (156) = happyGoto action_173
+action_138 (157) = happyGoto action_52
+action_138 (174) = happyGoto action_174
+action_138 _ = happyFail
+
+action_139 (193) = happyShift action_332
+action_139 _ = happyFail
+
+action_140 (198) = happyShift action_327
+action_140 (128) = happyGoto action_331
+action_140 (167) = happyGoto action_326
+action_140 _ = happyReduce_405
+
+action_141 (284) = happyShift action_330
+action_141 (19) = happyGoto action_329
+action_141 _ = happyReduce_37
+
+action_142 _ = happyReduce_60
+
+action_143 _ = happyReduce_61
+
+action_144 _ = happyReduce_62
+
+action_145 (177) = happyShift action_114
+action_145 (179) = happyShift action_57
+action_145 (180) = happyShift action_58
+action_145 (181) = happyShift action_115
+action_145 (182) = happyShift action_60
+action_145 (193) = happyShift action_175
+action_145 (195) = happyShift action_176
+action_145 (201) = happyShift action_177
+action_145 (251) = happyShift action_79
+action_145 (252) = happyShift action_80
+action_145 (253) = happyShift action_81
+action_145 (254) = happyShift action_82
+action_145 (255) = happyShift action_83
+action_145 (256) = happyShift action_84
+action_145 (257) = happyShift action_85
+action_145 (266) = happyShift action_178
+action_145 (267) = happyShift action_86
+action_145 (284) = happyShift action_87
+action_145 (46) = happyGoto action_164
+action_145 (47) = happyGoto action_165
+action_145 (48) = happyGoto action_166
+action_145 (49) = happyGoto action_167
+action_145 (50) = happyGoto action_168
+action_145 (52) = happyGoto action_328
+action_145 (53) = happyGoto action_170
+action_145 (140) = happyGoto action_171
+action_145 (153) = happyGoto action_48
+action_145 (154) = happyGoto action_172
+action_145 (155) = happyGoto action_50
+action_145 (156) = happyGoto action_173
+action_145 (157) = happyGoto action_52
+action_145 (174) = happyGoto action_174
+action_145 _ = happyFail
+
+action_146 (198) = happyShift action_327
+action_146 (128) = happyGoto action_325
+action_146 (167) = happyGoto action_326
+action_146 _ = happyReduce_405
+
+action_147 (177) = happyShift action_114
+action_147 (179) = happyShift action_57
+action_147 (180) = happyShift action_58
+action_147 (181) = happyShift action_115
+action_147 (182) = happyShift action_60
+action_147 (193) = happyShift action_175
+action_147 (195) = happyShift action_176
+action_147 (201) = happyShift action_177
+action_147 (251) = happyShift action_79
+action_147 (252) = happyShift action_80
+action_147 (253) = happyShift action_81
+action_147 (254) = happyShift action_82
+action_147 (255) = happyShift action_83
+action_147 (256) = happyShift action_84
+action_147 (257) = happyShift action_85
+action_147 (266) = happyShift action_178
+action_147 (267) = happyShift action_86
+action_147 (284) = happyShift action_87
+action_147 (46) = happyGoto action_164
+action_147 (47) = happyGoto action_165
+action_147 (48) = happyGoto action_166
+action_147 (49) = happyGoto action_167
+action_147 (50) = happyGoto action_168
+action_147 (52) = happyGoto action_324
+action_147 (53) = happyGoto action_170
+action_147 (140) = happyGoto action_171
+action_147 (153) = happyGoto action_48
+action_147 (154) = happyGoto action_172
+action_147 (155) = happyGoto action_50
+action_147 (156) = happyGoto action_173
+action_147 (157) = happyGoto action_52
+action_147 (174) = happyGoto action_174
+action_147 _ = happyFail
+
+action_148 (181) = happyShift action_115
+action_148 (56) = happyGoto action_321
+action_148 (157) = happyGoto action_322
+action_148 (171) = happyGoto action_323
+action_148 _ = happyFail
+
+action_149 (177) = happyReduce_404
+action_149 (178) = happyReduce_404
+action_149 (179) = happyReduce_404
+action_149 (180) = happyReduce_404
+action_149 (181) = happyReduce_404
+action_149 (182) = happyReduce_404
+action_149 (183) = happyReduce_404
+action_149 (188) = happyReduce_404
+action_149 (189) = happyReduce_404
+action_149 (190) = happyReduce_404
+action_149 (191) = happyReduce_404
+action_149 (193) = happyReduce_404
+action_149 (201) = happyReduce_404
+action_149 (204) = happyReduce_404
+action_149 (216) = happyReduce_404
+action_149 (218) = happyReduce_404
+action_149 (219) = happyReduce_404
+action_149 (220) = happyReduce_404
+action_149 (221) = happyReduce_404
+action_149 (223) = happyReduce_404
+action_149 (233) = happyReduce_404
+action_149 (234) = happyReduce_404
+action_149 (235) = happyReduce_404
+action_149 (236) = happyReduce_404
+action_149 (237) = happyReduce_404
+action_149 (238) = happyReduce_404
+action_149 (240) = happyReduce_404
+action_149 (241) = happyReduce_404
+action_149 (242) = happyReduce_404
+action_149 (244) = happyReduce_404
+action_149 (246) = happyReduce_404
+action_149 (250) = happyReduce_404
+action_149 (251) = happyReduce_404
+action_149 (252) = happyReduce_404
+action_149 (253) = happyReduce_404
+action_149 (254) = happyReduce_404
+action_149 (255) = happyReduce_404
+action_149 (256) = happyReduce_404
+action_149 (257) = happyReduce_404
+action_149 (258) = happyReduce_404
+action_149 (259) = happyReduce_404
+action_149 (260) = happyReduce_404
+action_149 (261) = happyReduce_404
+action_149 (264) = happyReduce_404
+action_149 (267) = happyReduce_404
+action_149 (271) = happyReduce_404
+action_149 (272) = happyReduce_404
+action_149 (273) = happyReduce_404
+action_149 (274) = happyReduce_404
+action_149 (276) = happyReduce_404
+action_149 (278) = happyReduce_404
+action_149 (281) = happyReduce_404
+action_149 (284) = happyReduce_404
+action_149 (28) = happyGoto action_94
+action_149 (34) = happyGoto action_320
+action_149 (38) = happyGoto action_98
+action_149 (40) = happyGoto action_99
+action_149 (83) = happyGoto action_100
+action_149 (166) = happyGoto action_163
+action_149 _ = happyReduce_17
+
+action_150 (197) = happyShift action_102
+action_150 _ = happyReduce_65
+
+action_151 (177) = happyReduce_404
+action_151 (178) = happyReduce_404
+action_151 (179) = happyReduce_404
+action_151 (180) = happyReduce_404
+action_151 (181) = happyReduce_404
+action_151 (182) = happyReduce_404
+action_151 (183) = happyReduce_404
+action_151 (188) = happyReduce_404
+action_151 (189) = happyReduce_404
+action_151 (190) = happyReduce_404
+action_151 (191) = happyReduce_404
+action_151 (193) = happyReduce_404
+action_151 (201) = happyReduce_404
+action_151 (204) = happyReduce_404
+action_151 (216) = happyReduce_404
+action_151 (218) = happyReduce_404
+action_151 (219) = happyReduce_404
+action_151 (220) = happyReduce_404
+action_151 (221) = happyReduce_404
+action_151 (223) = happyReduce_404
+action_151 (233) = happyReduce_404
+action_151 (234) = happyReduce_404
+action_151 (235) = happyReduce_404
+action_151 (236) = happyReduce_404
+action_151 (237) = happyReduce_404
+action_151 (238) = happyReduce_404
+action_151 (240) = happyReduce_404
+action_151 (241) = happyReduce_404
+action_151 (242) = happyReduce_404
+action_151 (244) = happyReduce_404
+action_151 (246) = happyReduce_404
+action_151 (250) = happyReduce_404
+action_151 (251) = happyReduce_404
+action_151 (252) = happyReduce_404
+action_151 (253) = happyReduce_404
+action_151 (254) = happyReduce_404
+action_151 (255) = happyReduce_404
+action_151 (256) = happyReduce_404
+action_151 (257) = happyReduce_404
+action_151 (258) = happyReduce_404
+action_151 (259) = happyReduce_404
+action_151 (260) = happyReduce_404
+action_151 (261) = happyReduce_404
+action_151 (264) = happyReduce_404
+action_151 (267) = happyReduce_404
+action_151 (269) = happyReduce_404
+action_151 (271) = happyReduce_404
+action_151 (272) = happyReduce_404
+action_151 (273) = happyReduce_404
+action_151 (274) = happyReduce_404
+action_151 (276) = happyReduce_404
+action_151 (278) = happyReduce_404
+action_151 (281) = happyReduce_404
+action_151 (284) = happyReduce_404
+action_151 (18) = happyGoto action_318
+action_151 (28) = happyGoto action_94
+action_151 (32) = happyGoto action_319
+action_151 (33) = happyGoto action_96
+action_151 (34) = happyGoto action_97
+action_151 (38) = happyGoto action_98
+action_151 (40) = happyGoto action_99
+action_151 (83) = happyGoto action_100
+action_151 (166) = happyGoto action_101
+action_151 _ = happyReduce_17
+
+action_152 (197) = happyShift action_102
+action_152 _ = happyReduce_14
+
+action_153 (249) = happyShift action_317
+action_153 _ = happyFail
+
+action_154 _ = happyReduce_196
+
+action_155 _ = happyReduce_197
+
+action_156 (184) = happyShift action_262
+action_156 (185) = happyShift action_211
+action_156 (186) = happyShift action_212
+action_156 (187) = happyShift action_213
+action_156 (205) = happyShift action_263
+action_156 (206) = happyShift action_264
+action_156 (208) = happyShift action_218
+action_156 (209) = happyShift action_265
+action_156 (218) = happyShift action_266
+action_156 (219) = happyShift action_267
+action_156 (283) = happyShift action_268
+action_156 (144) = happyGoto action_256
+action_156 (147) = happyGoto action_257
+action_156 (149) = happyGoto action_281
+action_156 (151) = happyGoto action_259
+action_156 (158) = happyGoto action_203
+action_156 (159) = happyGoto action_204
+action_156 (160) = happyGoto action_260
+action_156 (162) = happyGoto action_207
+action_156 (164) = happyGoto action_261
+action_156 _ = happyReduce_198
+
+action_157 _ = happyReduce_200
+
+action_158 (166) = happyGoto action_316
+action_158 _ = happyReduce_404
+
+action_159 (198) = happyShift action_315
+action_159 (132) = happyGoto action_313
+action_159 (167) = happyGoto action_314
+action_159 _ = happyReduce_405
+
+action_160 (177) = happyShift action_114
+action_160 (178) = happyShift action_56
+action_160 (179) = happyShift action_57
+action_160 (180) = happyShift action_58
+action_160 (181) = happyShift action_115
+action_160 (182) = happyShift action_60
+action_160 (183) = happyShift action_129
+action_160 (188) = happyShift action_61
+action_160 (189) = happyShift action_62
+action_160 (190) = happyShift action_63
+action_160 (191) = happyShift action_64
+action_160 (193) = happyShift action_65
+action_160 (201) = happyShift action_66
+action_160 (204) = happyShift action_67
+action_160 (211) = happyShift action_158
+action_160 (216) = happyShift action_68
+action_160 (218) = happyShift action_130
+action_160 (219) = happyShift action_69
+action_160 (220) = happyShift action_70
+action_160 (223) = happyShift action_71
+action_160 (233) = happyShift action_72
+action_160 (234) = happyShift action_73
+action_160 (235) = happyShift action_74
+action_160 (236) = happyShift action_75
+action_160 (237) = happyShift action_76
+action_160 (238) = happyShift action_77
+action_160 (240) = happyShift action_132
+action_160 (241) = happyShift action_133
+action_160 (242) = happyShift action_134
+action_160 (246) = happyShift action_78
+action_160 (251) = happyShift action_79
+action_160 (252) = happyShift action_80
+action_160 (253) = happyShift action_81
+action_160 (254) = happyShift action_82
+action_160 (255) = happyShift action_83
+action_160 (256) = happyShift action_84
+action_160 (257) = happyShift action_85
+action_160 (258) = happyShift action_136
+action_160 (263) = happyShift action_159
+action_160 (264) = happyShift action_140
+action_160 (267) = happyShift action_86
+action_160 (268) = happyShift action_160
+action_160 (275) = happyShift action_161
+action_160 (276) = happyShift action_146
+action_160 (284) = happyShift action_87
+action_160 (88) = happyGoto action_312
+action_160 (89) = happyGoto action_154
+action_160 (90) = happyGoto action_155
+action_160 (91) = happyGoto action_156
+action_160 (92) = happyGoto action_157
+action_160 (93) = happyGoto action_123
+action_160 (94) = happyGoto action_124
+action_160 (97) = happyGoto action_125
+action_160 (98) = happyGoto action_37
+action_160 (99) = happyGoto action_38
+action_160 (100) = happyGoto action_126
+action_160 (107) = happyGoto action_39
+action_160 (115) = happyGoto action_127
+action_160 (136) = happyGoto action_43
+action_160 (139) = happyGoto action_44
+action_160 (140) = happyGoto action_45
+action_160 (142) = happyGoto action_46
+action_160 (152) = happyGoto action_47
+action_160 (153) = happyGoto action_48
+action_160 (154) = happyGoto action_49
+action_160 (155) = happyGoto action_50
+action_160 (156) = happyGoto action_51
+action_160 (157) = happyGoto action_52
+action_160 (165) = happyGoto action_53
+action_160 (166) = happyGoto action_54
+action_160 _ = happyReduce_404
+
+action_161 (198) = happyShift action_311
+action_161 (39) = happyGoto action_308
+action_161 (41) = happyGoto action_309
+action_161 (167) = happyGoto action_310
+action_161 _ = happyReduce_405
+
+action_162 (239) = happyShift action_307
+action_162 _ = happyFail
+
+action_163 (177) = happyShift action_114
+action_163 (178) = happyShift action_56
+action_163 (179) = happyShift action_57
+action_163 (180) = happyShift action_58
+action_163 (181) = happyShift action_115
+action_163 (182) = happyShift action_60
+action_163 (183) = happyShift action_129
+action_163 (188) = happyShift action_61
+action_163 (189) = happyShift action_62
+action_163 (190) = happyShift action_63
+action_163 (191) = happyShift action_64
+action_163 (193) = happyShift action_65
+action_163 (201) = happyShift action_66
+action_163 (204) = happyShift action_67
+action_163 (216) = happyShift action_68
+action_163 (218) = happyShift action_130
+action_163 (219) = happyShift action_69
+action_163 (220) = happyShift action_70
+action_163 (223) = happyShift action_71
+action_163 (233) = happyShift action_72
+action_163 (234) = happyShift action_131
+action_163 (235) = happyShift action_74
+action_163 (236) = happyShift action_75
+action_163 (237) = happyShift action_76
+action_163 (238) = happyShift action_77
+action_163 (240) = happyShift action_132
+action_163 (241) = happyShift action_133
+action_163 (242) = happyShift action_134
+action_163 (246) = happyShift action_78
+action_163 (250) = happyShift action_135
+action_163 (251) = happyShift action_79
+action_163 (252) = happyShift action_80
+action_163 (253) = happyShift action_81
+action_163 (254) = happyShift action_82
+action_163 (255) = happyShift action_83
+action_163 (256) = happyShift action_84
+action_163 (257) = happyShift action_85
+action_163 (258) = happyShift action_136
+action_163 (259) = happyShift action_137
+action_163 (260) = happyShift action_138
+action_163 (261) = happyShift action_139
+action_163 (264) = happyShift action_140
+action_163 (267) = happyShift action_86
+action_163 (271) = happyShift action_142
+action_163 (272) = happyShift action_143
+action_163 (273) = happyShift action_144
+action_163 (274) = happyShift action_145
+action_163 (276) = happyShift action_146
+action_163 (278) = happyShift action_147
+action_163 (281) = happyShift action_148
+action_163 (284) = happyShift action_87
+action_163 (30) = happyGoto action_120
+action_163 (42) = happyGoto action_121
+action_163 (91) = happyGoto action_122
+action_163 (93) = happyGoto action_123
+action_163 (94) = happyGoto action_124
+action_163 (97) = happyGoto action_125
+action_163 (98) = happyGoto action_37
+action_163 (99) = happyGoto action_38
+action_163 (100) = happyGoto action_126
+action_163 (107) = happyGoto action_39
+action_163 (115) = happyGoto action_127
+action_163 (136) = happyGoto action_43
+action_163 (139) = happyGoto action_128
+action_163 (140) = happyGoto action_45
+action_163 (142) = happyGoto action_46
+action_163 (152) = happyGoto action_47
+action_163 (153) = happyGoto action_48
+action_163 (154) = happyGoto action_49
+action_163 (155) = happyGoto action_50
+action_163 (156) = happyGoto action_51
+action_163 (157) = happyGoto action_52
+action_163 (165) = happyGoto action_53
+action_163 (166) = happyGoto action_54
+action_163 _ = happyReduce_404
+
+action_164 _ = happyReduce_110
+
+action_165 _ = happyReduce_127
+
+action_166 (177) = happyShift action_114
+action_166 (181) = happyShift action_115
+action_166 (182) = happyShift action_60
+action_166 (184) = happyShift action_304
+action_166 (185) = happyShift action_211
+action_166 (187) = happyShift action_213
+action_166 (193) = happyShift action_175
+action_166 (195) = happyShift action_176
+action_166 (201) = happyShift action_177
+action_166 (205) = happyShift action_305
+action_166 (208) = happyShift action_218
+action_166 (214) = happyShift action_306
+action_166 (217) = happyReduce_128
+action_166 (251) = happyShift action_79
+action_166 (252) = happyShift action_80
+action_166 (253) = happyShift action_81
+action_166 (254) = happyShift action_82
+action_166 (255) = happyShift action_83
+action_166 (256) = happyShift action_84
+action_166 (257) = happyShift action_85
+action_166 (267) = happyShift action_86
+action_166 (284) = happyShift action_87
+action_166 (49) = happyGoto action_299
+action_166 (50) = happyGoto action_168
+action_166 (51) = happyGoto action_300
+action_166 (147) = happyGoto action_301
+action_166 (151) = happyGoto action_259
+action_166 (153) = happyGoto action_48
+action_166 (154) = happyGoto action_172
+action_166 (156) = happyGoto action_173
+action_166 (157) = happyGoto action_52
+action_166 (158) = happyGoto action_203
+action_166 (159) = happyGoto action_204
+action_166 (174) = happyGoto action_174
+action_166 (175) = happyGoto action_302
+action_166 (176) = happyGoto action_303
+action_166 _ = happyReduce_105
+
+action_167 _ = happyReduce_112
+
+action_168 _ = happyReduce_113
+
+action_169 (239) = happyShift action_298
+action_169 _ = happyFail
+
+action_170 (217) = happyShift action_297
+action_170 _ = happyFail
+
+action_171 (209) = happyShift action_296
+action_171 _ = happyFail
+
+action_172 _ = happyReduce_414
+
+action_173 _ = happyReduce_119
+
+action_174 _ = happyReduce_114
+
+action_175 (177) = happyShift action_114
+action_175 (179) = happyShift action_57
+action_175 (180) = happyShift action_58
+action_175 (181) = happyShift action_115
+action_175 (182) = happyShift action_60
+action_175 (193) = happyShift action_175
+action_175 (194) = happyShift action_294
+action_175 (195) = happyShift action_176
+action_175 (201) = happyShift action_177
+action_175 (203) = happyShift action_215
+action_175 (214) = happyShift action_295
+action_175 (251) = happyShift action_79
+action_175 (252) = happyShift action_80
+action_175 (253) = happyShift action_81
+action_175 (254) = happyShift action_82
+action_175 (255) = happyShift action_83
+action_175 (256) = happyShift action_84
+action_175 (257) = happyShift action_85
+action_175 (266) = happyShift action_178
+action_175 (267) = happyShift action_86
+action_175 (284) = happyShift action_87
+action_175 (46) = happyGoto action_164
+action_175 (47) = happyGoto action_289
+action_175 (48) = happyGoto action_166
+action_175 (49) = happyGoto action_167
+action_175 (50) = happyGoto action_168
+action_175 (52) = happyGoto action_290
+action_175 (53) = happyGoto action_170
+action_175 (54) = happyGoto action_291
+action_175 (55) = happyGoto action_292
+action_175 (102) = happyGoto action_293
+action_175 (140) = happyGoto action_171
+action_175 (153) = happyGoto action_48
+action_175 (154) = happyGoto action_172
+action_175 (155) = happyGoto action_50
+action_175 (156) = happyGoto action_173
+action_175 (157) = happyGoto action_52
+action_175 (174) = happyGoto action_174
+action_175 _ = happyFail
+
+action_176 (177) = happyShift action_114
+action_176 (179) = happyShift action_57
+action_176 (180) = happyShift action_58
+action_176 (181) = happyShift action_115
+action_176 (182) = happyShift action_60
+action_176 (193) = happyShift action_175
+action_176 (195) = happyShift action_176
+action_176 (201) = happyShift action_177
+action_176 (251) = happyShift action_79
+action_176 (252) = happyShift action_80
+action_176 (253) = happyShift action_81
+action_176 (254) = happyShift action_82
+action_176 (255) = happyShift action_83
+action_176 (256) = happyShift action_84
+action_176 (257) = happyShift action_85
+action_176 (267) = happyShift action_86
+action_176 (284) = happyShift action_87
+action_176 (46) = happyGoto action_164
+action_176 (47) = happyGoto action_287
+action_176 (48) = happyGoto action_285
+action_176 (49) = happyGoto action_167
+action_176 (50) = happyGoto action_168
+action_176 (55) = happyGoto action_288
+action_176 (140) = happyGoto action_171
+action_176 (153) = happyGoto action_48
+action_176 (154) = happyGoto action_172
+action_176 (155) = happyGoto action_50
+action_176 (156) = happyGoto action_173
+action_176 (157) = happyGoto action_52
+action_176 (174) = happyGoto action_174
+action_176 _ = happyFail
+
+action_177 (177) = happyShift action_114
+action_177 (179) = happyShift action_57
+action_177 (180) = happyShift action_58
+action_177 (181) = happyShift action_115
+action_177 (182) = happyShift action_60
+action_177 (193) = happyShift action_175
+action_177 (195) = happyShift action_176
+action_177 (201) = happyShift action_177
+action_177 (202) = happyShift action_286
+action_177 (251) = happyShift action_79
+action_177 (252) = happyShift action_80
+action_177 (253) = happyShift action_81
+action_177 (254) = happyShift action_82
+action_177 (255) = happyShift action_83
+action_177 (256) = happyShift action_84
+action_177 (257) = happyShift action_85
+action_177 (267) = happyShift action_86
+action_177 (284) = happyShift action_87
+action_177 (46) = happyGoto action_164
+action_177 (47) = happyGoto action_284
+action_177 (48) = happyGoto action_285
+action_177 (49) = happyGoto action_167
+action_177 (50) = happyGoto action_168
+action_177 (140) = happyGoto action_171
+action_177 (153) = happyGoto action_48
+action_177 (154) = happyGoto action_172
+action_177 (155) = happyGoto action_50
+action_177 (156) = happyGoto action_173
+action_177 (157) = happyGoto action_52
+action_177 (174) = happyGoto action_174
+action_177 _ = happyFail
+
+action_178 (57) = happyGoto action_283
+action_178 _ = happyReduce_134
+
+action_179 (239) = happyShift action_282
+action_179 _ = happyFail
+
+action_180 (184) = happyShift action_262
+action_180 (185) = happyShift action_211
+action_180 (186) = happyShift action_212
+action_180 (187) = happyShift action_213
+action_180 (205) = happyShift action_263
+action_180 (206) = happyShift action_264
+action_180 (208) = happyShift action_218
+action_180 (218) = happyShift action_266
+action_180 (219) = happyShift action_267
+action_180 (144) = happyGoto action_256
+action_180 (147) = happyGoto action_257
+action_180 (149) = happyGoto action_281
+action_180 (151) = happyGoto action_259
+action_180 (158) = happyGoto action_203
+action_180 (159) = happyGoto action_204
+action_180 (160) = happyGoto action_260
+action_180 (162) = happyGoto action_207
+action_180 (164) = happyGoto action_261
+action_180 _ = happyReduce_198
+
+action_181 (239) = happyShift action_280
+action_181 _ = happyFail
+
+action_182 (194) = happyShift action_279
+action_182 _ = happyFail
+
+action_183 (231) = happyShift action_271
+action_183 _ = happyReduce_267
+
+action_184 (203) = happyShift action_277
+action_184 (224) = happyShift action_278
+action_184 _ = happyFail
+
+action_185 _ = happyReduce_265
+
+action_186 _ = happyReduce_266
+
+action_187 _ = happyReduce_222
+
+action_188 _ = happyReduce_223
+
+action_189 _ = happyReduce_221
+
+action_190 (203) = happyShift action_274
+action_190 (207) = happyShift action_275
+action_190 (212) = happyShift action_276
+action_190 _ = happyReduce_291
+
+action_191 (202) = happyShift action_273
+action_191 _ = happyFail
+
+action_192 (203) = happyShift action_272
+action_192 _ = happyReduce_292
+
+action_193 _ = happyReduce_335
+
+action_194 (194) = happyShift action_269
+action_194 (203) = happyShift action_270
+action_194 (231) = happyShift action_271
+action_194 _ = happyFail
+
+action_195 (184) = happyShift action_262
+action_195 (185) = happyShift action_211
+action_195 (186) = happyShift action_212
+action_195 (187) = happyShift action_213
+action_195 (205) = happyShift action_263
+action_195 (206) = happyShift action_264
+action_195 (208) = happyShift action_218
+action_195 (209) = happyShift action_265
+action_195 (218) = happyShift action_266
+action_195 (219) = happyShift action_267
+action_195 (283) = happyShift action_268
+action_195 (144) = happyGoto action_256
+action_195 (147) = happyGoto action_257
+action_195 (149) = happyGoto action_258
+action_195 (151) = happyGoto action_259
+action_195 (158) = happyGoto action_203
+action_195 (159) = happyGoto action_204
+action_195 (160) = happyGoto action_260
+action_195 (162) = happyGoto action_207
+action_195 (164) = happyGoto action_261
+action_195 _ = happyReduce_198
+
+action_196 (194) = happyShift action_254
+action_196 (203) = happyShift action_255
+action_196 _ = happyFail
+
+action_197 (194) = happyShift action_252
+action_197 (203) = happyShift action_253
+action_197 _ = happyFail
+
+action_198 (194) = happyShift action_251
+action_198 _ = happyFail
+
+action_199 _ = happyReduce_363
+
+action_200 _ = happyReduce_364
+
+action_201 (177) = happyShift action_114
+action_201 (178) = happyShift action_56
+action_201 (179) = happyShift action_57
+action_201 (180) = happyShift action_58
+action_201 (181) = happyShift action_115
+action_201 (182) = happyShift action_60
+action_201 (183) = happyShift action_129
+action_201 (188) = happyShift action_61
+action_201 (189) = happyShift action_62
+action_201 (190) = happyShift action_63
+action_201 (191) = happyShift action_64
+action_201 (193) = happyShift action_65
+action_201 (201) = happyShift action_66
+action_201 (204) = happyShift action_67
+action_201 (211) = happyShift action_158
+action_201 (216) = happyShift action_68
+action_201 (218) = happyShift action_130
+action_201 (219) = happyShift action_69
+action_201 (220) = happyShift action_70
+action_201 (223) = happyShift action_71
+action_201 (233) = happyShift action_72
+action_201 (234) = happyShift action_73
+action_201 (235) = happyShift action_74
+action_201 (236) = happyShift action_75
+action_201 (237) = happyShift action_76
+action_201 (238) = happyShift action_77
+action_201 (240) = happyShift action_132
+action_201 (241) = happyShift action_133
+action_201 (242) = happyShift action_134
+action_201 (246) = happyShift action_78
+action_201 (251) = happyShift action_79
+action_201 (252) = happyShift action_80
+action_201 (253) = happyShift action_81
+action_201 (254) = happyShift action_82
+action_201 (255) = happyShift action_83
+action_201 (256) = happyShift action_84
+action_201 (257) = happyShift action_85
+action_201 (258) = happyShift action_136
+action_201 (263) = happyShift action_159
+action_201 (264) = happyShift action_140
+action_201 (267) = happyShift action_86
+action_201 (268) = happyShift action_160
+action_201 (275) = happyShift action_161
+action_201 (276) = happyShift action_146
+action_201 (284) = happyShift action_87
+action_201 (89) = happyGoto action_250
+action_201 (90) = happyGoto action_155
+action_201 (91) = happyGoto action_180
+action_201 (92) = happyGoto action_157
+action_201 (93) = happyGoto action_123
+action_201 (94) = happyGoto action_124
+action_201 (97) = happyGoto action_125
+action_201 (98) = happyGoto action_37
+action_201 (99) = happyGoto action_38
+action_201 (100) = happyGoto action_126
+action_201 (107) = happyGoto action_39
+action_201 (115) = happyGoto action_127
+action_201 (136) = happyGoto action_43
+action_201 (139) = happyGoto action_44
+action_201 (140) = happyGoto action_45
+action_201 (142) = happyGoto action_46
+action_201 (152) = happyGoto action_47
+action_201 (153) = happyGoto action_48
+action_201 (154) = happyGoto action_49
+action_201 (155) = happyGoto action_50
+action_201 (156) = happyGoto action_51
+action_201 (157) = happyGoto action_52
+action_201 (165) = happyGoto action_53
+action_201 (166) = happyGoto action_54
+action_201 _ = happyReduce_404
+
+action_202 (194) = happyShift action_249
+action_202 _ = happyReduce_357
+
+action_203 _ = happyReduce_366
+
+action_204 _ = happyReduce_385
+
+action_205 (194) = happyShift action_248
+action_205 _ = happyFail
+
+action_206 _ = happyReduce_353
+
+action_207 _ = happyReduce_388
+
+action_208 _ = happyReduce_390
+
+action_209 (194) = happyReduce_389
+action_209 _ = happyReduce_391
+
+action_210 (194) = happyReduce_392
+action_210 _ = happyReduce_396
+
+action_211 _ = happyReduce_387
+
+action_212 _ = happyReduce_399
+
+action_213 _ = happyReduce_386
+
+action_214 _ = happyReduce_334
+
+action_215 _ = happyReduce_261
+
+action_216 (177) = happyShift action_114
+action_216 (178) = happyShift action_56
+action_216 (181) = happyShift action_115
+action_216 (182) = happyShift action_60
+action_216 (251) = happyShift action_79
+action_216 (252) = happyShift action_80
+action_216 (253) = happyShift action_81
+action_216 (254) = happyShift action_82
+action_216 (255) = happyShift action_83
+action_216 (256) = happyShift action_84
+action_216 (257) = happyShift action_85
+action_216 (267) = happyShift action_86
+action_216 (284) = happyShift action_87
+action_216 (152) = happyGoto action_246
+action_216 (153) = happyGoto action_48
+action_216 (154) = happyGoto action_49
+action_216 (156) = happyGoto action_247
+action_216 (157) = happyGoto action_52
+action_216 _ = happyFail
+
+action_217 (194) = happyReduce_395
+action_217 _ = happyReduce_398
+
+action_218 _ = happyReduce_365
+
+action_219 (177) = happyShift action_114
+action_219 (178) = happyShift action_56
+action_219 (179) = happyShift action_57
+action_219 (180) = happyShift action_58
+action_219 (181) = happyShift action_115
+action_219 (182) = happyShift action_60
+action_219 (188) = happyShift action_61
+action_219 (189) = happyShift action_62
+action_219 (190) = happyShift action_63
+action_219 (191) = happyShift action_64
+action_219 (193) = happyShift action_65
+action_219 (201) = happyShift action_66
+action_219 (204) = happyShift action_67
+action_219 (216) = happyShift action_68
+action_219 (219) = happyShift action_69
+action_219 (220) = happyShift action_70
+action_219 (221) = happyReduce_404
+action_219 (223) = happyShift action_71
+action_219 (233) = happyShift action_72
+action_219 (234) = happyShift action_73
+action_219 (235) = happyShift action_74
+action_219 (236) = happyShift action_75
+action_219 (237) = happyShift action_76
+action_219 (238) = happyShift action_77
+action_219 (244) = happyReduce_404
+action_219 (246) = happyShift action_78
+action_219 (251) = happyShift action_79
+action_219 (252) = happyShift action_80
+action_219 (253) = happyShift action_81
+action_219 (254) = happyShift action_82
+action_219 (255) = happyShift action_83
+action_219 (256) = happyShift action_84
+action_219 (257) = happyShift action_85
+action_219 (267) = happyShift action_86
+action_219 (284) = happyShift action_87
+action_219 (94) = happyGoto action_245
+action_219 (97) = happyGoto action_125
+action_219 (98) = happyGoto action_37
+action_219 (99) = happyGoto action_38
+action_219 (107) = happyGoto action_39
+action_219 (136) = happyGoto action_43
+action_219 (139) = happyGoto action_44
+action_219 (140) = happyGoto action_45
+action_219 (142) = happyGoto action_46
+action_219 (152) = happyGoto action_47
+action_219 (153) = happyGoto action_48
+action_219 (154) = happyGoto action_49
+action_219 (155) = happyGoto action_50
+action_219 (156) = happyGoto action_51
+action_219 (157) = happyGoto action_52
+action_219 (165) = happyGoto action_53
+action_219 (166) = happyGoto action_54
+action_219 _ = happyReduce_393
+
+action_220 (177) = happyShift action_114
+action_220 (178) = happyShift action_56
+action_220 (179) = happyShift action_57
+action_220 (180) = happyShift action_58
+action_220 (181) = happyShift action_115
+action_220 (182) = happyShift action_60
+action_220 (188) = happyShift action_61
+action_220 (189) = happyShift action_62
+action_220 (190) = happyShift action_63
+action_220 (191) = happyShift action_64
+action_220 (193) = happyShift action_65
+action_220 (194) = happyReduce_394
+action_220 (201) = happyShift action_66
+action_220 (204) = happyShift action_67
+action_220 (216) = happyShift action_68
+action_220 (219) = happyShift action_69
+action_220 (220) = happyShift action_70
+action_220 (221) = happyReduce_404
+action_220 (223) = happyShift action_71
+action_220 (233) = happyShift action_72
+action_220 (234) = happyShift action_73
+action_220 (235) = happyShift action_74
+action_220 (236) = happyShift action_75
+action_220 (237) = happyShift action_76
+action_220 (238) = happyShift action_77
+action_220 (244) = happyReduce_404
+action_220 (246) = happyShift action_78
+action_220 (251) = happyShift action_79
+action_220 (252) = happyShift action_80
+action_220 (253) = happyShift action_81
+action_220 (254) = happyShift action_82
+action_220 (255) = happyShift action_83
+action_220 (256) = happyShift action_84
+action_220 (257) = happyShift action_85
+action_220 (267) = happyShift action_86
+action_220 (284) = happyShift action_87
+action_220 (97) = happyGoto action_188
+action_220 (98) = happyGoto action_37
+action_220 (99) = happyGoto action_38
+action_220 (107) = happyGoto action_39
+action_220 (136) = happyGoto action_43
+action_220 (139) = happyGoto action_44
+action_220 (140) = happyGoto action_45
+action_220 (142) = happyGoto action_46
+action_220 (152) = happyGoto action_47
+action_220 (153) = happyGoto action_48
+action_220 (154) = happyGoto action_49
+action_220 (155) = happyGoto action_50
+action_220 (156) = happyGoto action_51
+action_220 (157) = happyGoto action_52
+action_220 (165) = happyGoto action_53
+action_220 (166) = happyGoto action_54
+action_220 _ = happyReduce_397
+
+action_221 (177) = happyShift action_114
+action_221 (178) = happyShift action_56
+action_221 (179) = happyShift action_57
+action_221 (180) = happyShift action_58
+action_221 (181) = happyShift action_115
+action_221 (182) = happyShift action_60
+action_221 (183) = happyShift action_129
+action_221 (188) = happyShift action_61
+action_221 (189) = happyShift action_62
+action_221 (190) = happyShift action_63
+action_221 (191) = happyShift action_64
+action_221 (193) = happyShift action_65
+action_221 (201) = happyShift action_66
+action_221 (204) = happyShift action_67
+action_221 (211) = happyShift action_158
+action_221 (216) = happyShift action_68
+action_221 (218) = happyShift action_130
+action_221 (219) = happyShift action_69
+action_221 (220) = happyShift action_70
+action_221 (223) = happyShift action_71
+action_221 (233) = happyShift action_72
+action_221 (234) = happyShift action_73
+action_221 (235) = happyShift action_74
+action_221 (236) = happyShift action_75
+action_221 (237) = happyShift action_76
+action_221 (238) = happyShift action_77
+action_221 (240) = happyShift action_132
+action_221 (241) = happyShift action_133
+action_221 (242) = happyShift action_134
+action_221 (246) = happyShift action_78
+action_221 (251) = happyShift action_79
+action_221 (252) = happyShift action_80
+action_221 (253) = happyShift action_81
+action_221 (254) = happyShift action_82
+action_221 (255) = happyShift action_83
+action_221 (256) = happyShift action_84
+action_221 (257) = happyShift action_85
+action_221 (258) = happyShift action_136
+action_221 (263) = happyShift action_159
+action_221 (264) = happyShift action_140
+action_221 (267) = happyShift action_86
+action_221 (268) = happyShift action_160
+action_221 (275) = happyShift action_161
+action_221 (276) = happyShift action_146
+action_221 (284) = happyShift action_87
+action_221 (88) = happyGoto action_183
+action_221 (89) = happyGoto action_154
+action_221 (90) = happyGoto action_155
+action_221 (91) = happyGoto action_156
+action_221 (92) = happyGoto action_157
+action_221 (93) = happyGoto action_123
+action_221 (94) = happyGoto action_124
+action_221 (97) = happyGoto action_125
+action_221 (98) = happyGoto action_37
+action_221 (99) = happyGoto action_38
+action_221 (100) = happyGoto action_126
+action_221 (104) = happyGoto action_244
+action_221 (105) = happyGoto action_185
+action_221 (106) = happyGoto action_186
+action_221 (107) = happyGoto action_39
+action_221 (115) = happyGoto action_127
+action_221 (136) = happyGoto action_43
+action_221 (139) = happyGoto action_44
+action_221 (140) = happyGoto action_45
+action_221 (142) = happyGoto action_46
+action_221 (152) = happyGoto action_47
+action_221 (153) = happyGoto action_48
+action_221 (154) = happyGoto action_49
+action_221 (155) = happyGoto action_50
+action_221 (156) = happyGoto action_51
+action_221 (157) = happyGoto action_52
+action_221 (165) = happyGoto action_53
+action_221 (166) = happyGoto action_54
+action_221 _ = happyReduce_404
+
+action_222 (177) = happyShift action_15
+action_222 (181) = happyShift action_16
+action_222 (183) = happyShift action_17
+action_222 (259) = happyShift action_18
+action_222 (281) = happyShift action_19
+action_222 (110) = happyGoto action_243
+action_222 (111) = happyGoto action_14
+action_222 _ = happyFail
+
+action_223 (177) = happyShift action_114
+action_223 (178) = happyShift action_56
+action_223 (179) = happyShift action_57
+action_223 (180) = happyShift action_58
+action_223 (181) = happyShift action_115
+action_223 (182) = happyShift action_60
+action_223 (188) = happyShift action_61
+action_223 (189) = happyShift action_62
+action_223 (190) = happyShift action_63
+action_223 (191) = happyShift action_64
+action_223 (193) = happyShift action_65
+action_223 (201) = happyShift action_66
+action_223 (204) = happyShift action_67
+action_223 (216) = happyShift action_68
+action_223 (219) = happyShift action_69
+action_223 (220) = happyShift action_70
+action_223 (223) = happyShift action_71
+action_223 (233) = happyShift action_72
+action_223 (234) = happyShift action_73
+action_223 (235) = happyShift action_74
+action_223 (236) = happyShift action_75
+action_223 (237) = happyShift action_76
+action_223 (238) = happyShift action_77
+action_223 (246) = happyShift action_78
+action_223 (251) = happyShift action_79
+action_223 (252) = happyShift action_80
+action_223 (253) = happyShift action_81
+action_223 (254) = happyShift action_82
+action_223 (255) = happyShift action_83
+action_223 (256) = happyShift action_84
+action_223 (257) = happyShift action_85
+action_223 (267) = happyShift action_86
+action_223 (284) = happyShift action_87
+action_223 (97) = happyGoto action_242
+action_223 (98) = happyGoto action_37
+action_223 (99) = happyGoto action_38
+action_223 (107) = happyGoto action_39
+action_223 (136) = happyGoto action_43
+action_223 (139) = happyGoto action_44
+action_223 (140) = happyGoto action_45
+action_223 (142) = happyGoto action_46
+action_223 (152) = happyGoto action_47
+action_223 (153) = happyGoto action_48
+action_223 (154) = happyGoto action_49
+action_223 (155) = happyGoto action_50
+action_223 (156) = happyGoto action_51
+action_223 (157) = happyGoto action_52
+action_223 (165) = happyGoto action_53
+action_223 (166) = happyGoto action_54
+action_223 _ = happyReduce_404
+
+action_224 (177) = happyShift action_114
+action_224 (178) = happyShift action_56
+action_224 (179) = happyShift action_57
+action_224 (180) = happyShift action_58
+action_224 (181) = happyShift action_115
+action_224 (182) = happyShift action_60
+action_224 (188) = happyShift action_61
+action_224 (189) = happyShift action_62
+action_224 (190) = happyShift action_63
+action_224 (191) = happyShift action_64
+action_224 (193) = happyShift action_65
+action_224 (201) = happyShift action_66
+action_224 (204) = happyShift action_67
+action_224 (216) = happyShift action_68
+action_224 (219) = happyShift action_69
+action_224 (220) = happyShift action_70
+action_224 (223) = happyShift action_71
+action_224 (233) = happyShift action_72
+action_224 (234) = happyShift action_73
+action_224 (235) = happyShift action_74
+action_224 (236) = happyShift action_75
+action_224 (237) = happyShift action_76
+action_224 (238) = happyShift action_77
+action_224 (246) = happyShift action_78
+action_224 (251) = happyShift action_79
+action_224 (252) = happyShift action_80
+action_224 (253) = happyShift action_81
+action_224 (254) = happyShift action_82
+action_224 (255) = happyShift action_83
+action_224 (256) = happyShift action_84
+action_224 (257) = happyShift action_85
+action_224 (267) = happyShift action_86
+action_224 (284) = happyShift action_87
+action_224 (97) = happyGoto action_241
+action_224 (98) = happyGoto action_37
+action_224 (99) = happyGoto action_38
+action_224 (107) = happyGoto action_39
+action_224 (136) = happyGoto action_43
+action_224 (139) = happyGoto action_44
+action_224 (140) = happyGoto action_45
+action_224 (142) = happyGoto action_46
+action_224 (152) = happyGoto action_47
+action_224 (153) = happyGoto action_48
+action_224 (154) = happyGoto action_49
+action_224 (155) = happyGoto action_50
+action_224 (156) = happyGoto action_51
+action_224 (157) = happyGoto action_52
+action_224 (165) = happyGoto action_53
+action_224 (166) = happyGoto action_54
+action_224 _ = happyReduce_404
+
+action_225 (108) = happyGoto action_240
+action_225 _ = happyReduce_274
+
+action_226 _ = happyReduce_5
+
+action_227 (177) = happyShift action_114
+action_227 (178) = happyShift action_56
+action_227 (179) = happyShift action_57
+action_227 (180) = happyShift action_58
+action_227 (181) = happyShift action_115
+action_227 (182) = happyShift action_60
+action_227 (188) = happyShift action_61
+action_227 (189) = happyShift action_62
+action_227 (190) = happyShift action_63
+action_227 (191) = happyShift action_64
+action_227 (193) = happyShift action_65
+action_227 (201) = happyShift action_66
+action_227 (204) = happyShift action_67
+action_227 (216) = happyShift action_68
+action_227 (219) = happyShift action_69
+action_227 (220) = happyShift action_70
+action_227 (223) = happyShift action_71
+action_227 (233) = happyShift action_72
+action_227 (234) = happyShift action_73
+action_227 (235) = happyShift action_74
+action_227 (236) = happyShift action_75
+action_227 (237) = happyShift action_76
+action_227 (238) = happyShift action_77
+action_227 (246) = happyShift action_78
+action_227 (251) = happyShift action_79
+action_227 (252) = happyShift action_80
+action_227 (253) = happyShift action_81
+action_227 (254) = happyShift action_82
+action_227 (255) = happyShift action_83
+action_227 (256) = happyShift action_84
+action_227 (257) = happyShift action_85
+action_227 (267) = happyShift action_86
+action_227 (284) = happyShift action_87
+action_227 (97) = happyGoto action_239
+action_227 (98) = happyGoto action_37
+action_227 (99) = happyGoto action_38
+action_227 (107) = happyGoto action_39
+action_227 (136) = happyGoto action_43
+action_227 (139) = happyGoto action_44
+action_227 (140) = happyGoto action_45
+action_227 (142) = happyGoto action_46
+action_227 (152) = happyGoto action_47
+action_227 (153) = happyGoto action_48
+action_227 (154) = happyGoto action_49
+action_227 (155) = happyGoto action_50
+action_227 (156) = happyGoto action_51
+action_227 (157) = happyGoto action_52
+action_227 (165) = happyGoto action_53
+action_227 (166) = happyGoto action_54
+action_227 _ = happyReduce_404
+
+action_228 (177) = happyShift action_114
+action_228 (178) = happyShift action_56
+action_228 (193) = happyShift action_116
+action_228 (199) = happyShift action_238
+action_228 (251) = happyShift action_79
+action_228 (252) = happyShift action_80
+action_228 (253) = happyShift action_81
+action_228 (254) = happyShift action_82
+action_228 (255) = happyShift action_83
+action_228 (256) = happyShift action_84
+action_228 (257) = happyShift action_85
+action_228 (267) = happyShift action_86
+action_228 (284) = happyShift action_87
+action_228 (130) = happyGoto action_235
+action_228 (131) = happyGoto action_236
+action_228 (139) = happyGoto action_237
+action_228 (152) = happyGoto action_47
+action_228 (153) = happyGoto action_48
+action_228 (154) = happyGoto action_49
+action_228 _ = happyFail
+
+action_229 _ = happyReduce_227
+
+action_230 _ = happyReduce_228
+
+action_231 _ = happyReduce_229
+
+action_232 _ = happyReduce_230
+
+action_233 _ = happyReduce_231
+
+action_234 _ = happyReduce_232
+
+action_235 (199) = happyShift action_480
+action_235 (203) = happyShift action_481
+action_235 _ = happyFail
+
+action_236 _ = happyReduce_326
+
+action_237 (210) = happyShift action_479
+action_237 _ = happyFail
+
+action_238 _ = happyReduce_225
+
+action_239 _ = happyReduce_287
+
+action_240 (243) = happyShift action_477
+action_240 (245) = happyShift action_478
+action_240 (246) = happyShift action_78
+action_240 (107) = happyGoto action_474
+action_240 (109) = happyGoto action_475
+action_240 (166) = happyGoto action_476
+action_240 _ = happyReduce_404
+
+action_241 _ = happyReduce_220
+
+action_242 _ = happyReduce_219
+
+action_243 (112) = happyGoto action_473
+action_243 _ = happyReduce_286
+
+action_244 (203) = happyShift action_277
+action_244 (222) = happyShift action_472
+action_244 _ = happyFail
+
+action_245 (177) = happyShift action_114
+action_245 (178) = happyShift action_56
+action_245 (179) = happyShift action_57
+action_245 (180) = happyShift action_58
+action_245 (181) = happyShift action_115
+action_245 (182) = happyShift action_60
+action_245 (188) = happyShift action_61
+action_245 (189) = happyShift action_62
+action_245 (190) = happyShift action_63
+action_245 (191) = happyShift action_64
+action_245 (193) = happyShift action_65
+action_245 (201) = happyShift action_66
+action_245 (204) = happyShift action_67
+action_245 (216) = happyShift action_68
+action_245 (219) = happyShift action_69
+action_245 (220) = happyShift action_70
+action_245 (221) = happyReduce_404
+action_245 (223) = happyShift action_71
+action_245 (233) = happyShift action_72
+action_245 (234) = happyShift action_73
+action_245 (235) = happyShift action_74
+action_245 (236) = happyShift action_75
+action_245 (237) = happyShift action_76
+action_245 (238) = happyShift action_77
+action_245 (244) = happyReduce_404
+action_245 (246) = happyShift action_78
+action_245 (251) = happyShift action_79
+action_245 (252) = happyShift action_80
+action_245 (253) = happyShift action_81
+action_245 (254) = happyShift action_82
+action_245 (255) = happyShift action_83
+action_245 (256) = happyShift action_84
+action_245 (257) = happyShift action_85
+action_245 (267) = happyShift action_86
+action_245 (284) = happyShift action_87
+action_245 (97) = happyGoto action_349
+action_245 (98) = happyGoto action_37
+action_245 (99) = happyGoto action_38
+action_245 (107) = happyGoto action_39
+action_245 (136) = happyGoto action_43
+action_245 (139) = happyGoto action_44
+action_245 (140) = happyGoto action_45
+action_245 (142) = happyGoto action_46
+action_245 (152) = happyGoto action_47
+action_245 (153) = happyGoto action_48
+action_245 (154) = happyGoto action_49
+action_245 (155) = happyGoto action_50
+action_245 (156) = happyGoto action_51
+action_245 (157) = happyGoto action_52
+action_245 (165) = happyGoto action_53
+action_245 (166) = happyGoto action_54
+action_245 _ = happyReduce_209
+
+action_246 (205) = happyShift action_471
+action_246 _ = happyFail
+
+action_247 (205) = happyShift action_470
+action_247 _ = happyFail
+
+action_248 _ = happyReduce_343
+
+action_249 _ = happyReduce_348
+
+action_250 (194) = happyShift action_469
+action_250 _ = happyFail
+
+action_251 _ = happyReduce_244
+
+action_252 _ = happyReduce_239
+
+action_253 (177) = happyShift action_114
+action_253 (178) = happyShift action_56
+action_253 (179) = happyShift action_57
+action_253 (180) = happyShift action_58
+action_253 (181) = happyShift action_115
+action_253 (182) = happyShift action_60
+action_253 (183) = happyShift action_129
+action_253 (188) = happyShift action_61
+action_253 (189) = happyShift action_62
+action_253 (190) = happyShift action_63
+action_253 (191) = happyShift action_64
+action_253 (193) = happyShift action_65
+action_253 (201) = happyShift action_66
+action_253 (204) = happyShift action_67
+action_253 (211) = happyShift action_158
+action_253 (216) = happyShift action_68
+action_253 (218) = happyShift action_130
+action_253 (219) = happyShift action_69
+action_253 (220) = happyShift action_70
+action_253 (223) = happyShift action_71
+action_253 (233) = happyShift action_72
+action_253 (234) = happyShift action_73
+action_253 (235) = happyShift action_74
+action_253 (236) = happyShift action_75
+action_253 (237) = happyShift action_76
+action_253 (238) = happyShift action_77
+action_253 (240) = happyShift action_132
+action_253 (241) = happyShift action_133
+action_253 (242) = happyShift action_134
+action_253 (246) = happyShift action_78
+action_253 (251) = happyShift action_79
+action_253 (252) = happyShift action_80
+action_253 (253) = happyShift action_81
+action_253 (254) = happyShift action_82
+action_253 (255) = happyShift action_83
+action_253 (256) = happyShift action_84
+action_253 (257) = happyShift action_85
+action_253 (258) = happyShift action_136
+action_253 (263) = happyShift action_159
+action_253 (264) = happyShift action_140
+action_253 (267) = happyShift action_86
+action_253 (268) = happyShift action_160
+action_253 (275) = happyShift action_161
+action_253 (276) = happyShift action_146
+action_253 (284) = happyShift action_87
+action_253 (88) = happyGoto action_468
+action_253 (89) = happyGoto action_154
+action_253 (90) = happyGoto action_155
+action_253 (91) = happyGoto action_156
+action_253 (92) = happyGoto action_157
+action_253 (93) = happyGoto action_123
+action_253 (94) = happyGoto action_124
+action_253 (97) = happyGoto action_125
+action_253 (98) = happyGoto action_37
+action_253 (99) = happyGoto action_38
+action_253 (100) = happyGoto action_126
+action_253 (107) = happyGoto action_39
+action_253 (115) = happyGoto action_127
+action_253 (136) = happyGoto action_43
+action_253 (139) = happyGoto action_44
+action_253 (140) = happyGoto action_45
+action_253 (142) = happyGoto action_46
+action_253 (152) = happyGoto action_47
+action_253 (153) = happyGoto action_48
+action_253 (154) = happyGoto action_49
+action_253 (155) = happyGoto action_50
+action_253 (156) = happyGoto action_51
+action_253 (157) = happyGoto action_52
+action_253 (165) = happyGoto action_53
+action_253 (166) = happyGoto action_54
+action_253 _ = happyReduce_404
+
+action_254 _ = happyReduce_336
+
+action_255 _ = happyReduce_260
+
+action_256 _ = happyReduce_361
+
+action_257 _ = happyReduce_362
+
+action_258 (177) = happyShift action_114
+action_258 (178) = happyShift action_56
+action_258 (179) = happyShift action_57
+action_258 (180) = happyShift action_58
+action_258 (181) = happyShift action_115
+action_258 (182) = happyShift action_60
+action_258 (188) = happyShift action_61
+action_258 (189) = happyShift action_62
+action_258 (190) = happyShift action_63
+action_258 (191) = happyShift action_64
+action_258 (193) = happyShift action_65
+action_258 (194) = happyShift action_467
+action_258 (201) = happyShift action_66
+action_258 (204) = happyShift action_67
+action_258 (211) = happyShift action_158
+action_258 (216) = happyShift action_68
+action_258 (218) = happyShift action_130
+action_258 (219) = happyShift action_69
+action_258 (220) = happyShift action_70
+action_258 (223) = happyShift action_71
+action_258 (233) = happyShift action_72
+action_258 (234) = happyShift action_73
+action_258 (235) = happyShift action_74
+action_258 (236) = happyShift action_75
+action_258 (237) = happyShift action_76
+action_258 (238) = happyShift action_77
+action_258 (240) = happyShift action_132
+action_258 (241) = happyShift action_133
+action_258 (242) = happyShift action_134
+action_258 (246) = happyShift action_78
+action_258 (251) = happyShift action_79
+action_258 (252) = happyShift action_80
+action_258 (253) = happyShift action_81
+action_258 (254) = happyShift action_82
+action_258 (255) = happyShift action_83
+action_258 (256) = happyShift action_84
+action_258 (257) = happyShift action_85
+action_258 (258) = happyShift action_136
+action_258 (263) = happyShift action_159
+action_258 (264) = happyShift action_140
+action_258 (267) = happyShift action_86
+action_258 (268) = happyShift action_160
+action_258 (275) = happyShift action_161
+action_258 (276) = happyShift action_146
+action_258 (284) = happyShift action_87
+action_258 (92) = happyGoto action_451
+action_258 (93) = happyGoto action_389
+action_258 (94) = happyGoto action_124
+action_258 (97) = happyGoto action_125
+action_258 (98) = happyGoto action_37
+action_258 (99) = happyGoto action_38
+action_258 (100) = happyGoto action_126
+action_258 (107) = happyGoto action_39
+action_258 (136) = happyGoto action_43
+action_258 (139) = happyGoto action_44
+action_258 (140) = happyGoto action_45
+action_258 (142) = happyGoto action_46
+action_258 (152) = happyGoto action_47
+action_258 (153) = happyGoto action_48
+action_258 (154) = happyGoto action_49
+action_258 (155) = happyGoto action_50
+action_258 (156) = happyGoto action_51
+action_258 (157) = happyGoto action_52
+action_258 (165) = happyGoto action_53
+action_258 (166) = happyGoto action_54
+action_258 _ = happyReduce_404
+
+action_259 _ = happyReduce_357
+
+action_260 _ = happyReduce_351
+
+action_261 _ = happyReduce_389
+
+action_262 _ = happyReduce_392
+
+action_263 (177) = happyShift action_114
+action_263 (178) = happyShift action_56
+action_263 (181) = happyShift action_115
+action_263 (182) = happyShift action_60
+action_263 (251) = happyShift action_79
+action_263 (252) = happyShift action_80
+action_263 (253) = happyShift action_81
+action_263 (254) = happyShift action_82
+action_263 (255) = happyShift action_83
+action_263 (256) = happyShift action_84
+action_263 (257) = happyShift action_85
+action_263 (267) = happyShift action_86
+action_263 (284) = happyShift action_87
+action_263 (152) = happyGoto action_466
+action_263 (153) = happyGoto action_48
+action_263 (154) = happyGoto action_49
+action_263 (156) = happyGoto action_247
+action_263 (157) = happyGoto action_52
+action_263 _ = happyFail
+
+action_264 _ = happyReduce_395
+
+action_265 (166) = happyGoto action_465
+action_265 _ = happyReduce_404
+
+action_266 _ = happyReduce_393
+
+action_267 _ = happyReduce_394
+
+action_268 (198) = happyShift action_315
+action_268 (132) = happyGoto action_464
+action_268 (167) = happyGoto action_314
+action_268 _ = happyReduce_405
+
+action_269 _ = happyReduce_238
+
+action_270 (177) = happyShift action_114
+action_270 (178) = happyShift action_56
+action_270 (179) = happyShift action_57
+action_270 (180) = happyShift action_58
+action_270 (181) = happyShift action_115
+action_270 (182) = happyShift action_60
+action_270 (183) = happyShift action_129
+action_270 (188) = happyShift action_61
+action_270 (189) = happyShift action_62
+action_270 (190) = happyShift action_63
+action_270 (191) = happyShift action_64
+action_270 (193) = happyShift action_65
+action_270 (201) = happyShift action_66
+action_270 (204) = happyShift action_67
+action_270 (211) = happyShift action_158
+action_270 (216) = happyShift action_68
+action_270 (218) = happyShift action_130
+action_270 (219) = happyShift action_69
+action_270 (220) = happyShift action_70
+action_270 (223) = happyShift action_71
+action_270 (233) = happyShift action_72
+action_270 (234) = happyShift action_73
+action_270 (235) = happyShift action_74
+action_270 (236) = happyShift action_75
+action_270 (237) = happyShift action_76
+action_270 (238) = happyShift action_77
+action_270 (240) = happyShift action_132
+action_270 (241) = happyShift action_133
+action_270 (242) = happyShift action_134
+action_270 (246) = happyShift action_78
+action_270 (251) = happyShift action_79
+action_270 (252) = happyShift action_80
+action_270 (253) = happyShift action_81
+action_270 (254) = happyShift action_82
+action_270 (255) = happyShift action_83
+action_270 (256) = happyShift action_84
+action_270 (257) = happyShift action_85
+action_270 (258) = happyShift action_136
+action_270 (263) = happyShift action_159
+action_270 (264) = happyShift action_140
+action_270 (267) = happyShift action_86
+action_270 (268) = happyShift action_160
+action_270 (275) = happyShift action_161
+action_270 (276) = happyShift action_146
+action_270 (284) = happyShift action_87
+action_270 (88) = happyGoto action_463
+action_270 (89) = happyGoto action_154
+action_270 (90) = happyGoto action_155
+action_270 (91) = happyGoto action_156
+action_270 (92) = happyGoto action_157
+action_270 (93) = happyGoto action_123
+action_270 (94) = happyGoto action_124
+action_270 (97) = happyGoto action_125
+action_270 (98) = happyGoto action_37
+action_270 (99) = happyGoto action_38
+action_270 (100) = happyGoto action_126
+action_270 (107) = happyGoto action_39
+action_270 (115) = happyGoto action_127
+action_270 (136) = happyGoto action_43
+action_270 (139) = happyGoto action_44
+action_270 (140) = happyGoto action_45
+action_270 (142) = happyGoto action_46
+action_270 (152) = happyGoto action_47
+action_270 (153) = happyGoto action_48
+action_270 (154) = happyGoto action_49
+action_270 (155) = happyGoto action_50
+action_270 (156) = happyGoto action_51
+action_270 (157) = happyGoto action_52
+action_270 (165) = happyGoto action_53
+action_270 (166) = happyGoto action_54
+action_270 _ = happyReduce_404
+
+action_271 (177) = happyShift action_114
+action_271 (178) = happyShift action_56
+action_271 (179) = happyShift action_57
+action_271 (180) = happyShift action_58
+action_271 (181) = happyShift action_115
+action_271 (182) = happyShift action_60
+action_271 (183) = happyShift action_129
+action_271 (188) = happyShift action_61
+action_271 (189) = happyShift action_62
+action_271 (190) = happyShift action_63
+action_271 (191) = happyShift action_64
+action_271 (193) = happyShift action_65
+action_271 (201) = happyShift action_66
+action_271 (204) = happyShift action_67
+action_271 (211) = happyShift action_158
+action_271 (216) = happyShift action_68
+action_271 (218) = happyShift action_130
+action_271 (219) = happyShift action_69
+action_271 (220) = happyShift action_70
+action_271 (223) = happyShift action_71
+action_271 (233) = happyShift action_72
+action_271 (234) = happyShift action_73
+action_271 (235) = happyShift action_74
+action_271 (236) = happyShift action_75
+action_271 (237) = happyShift action_76
+action_271 (238) = happyShift action_77
+action_271 (240) = happyShift action_132
+action_271 (241) = happyShift action_133
+action_271 (242) = happyShift action_134
+action_271 (246) = happyShift action_78
+action_271 (251) = happyShift action_79
+action_271 (252) = happyShift action_80
+action_271 (253) = happyShift action_81
+action_271 (254) = happyShift action_82
+action_271 (255) = happyShift action_83
+action_271 (256) = happyShift action_84
+action_271 (257) = happyShift action_85
+action_271 (258) = happyShift action_136
+action_271 (263) = happyShift action_159
+action_271 (264) = happyShift action_140
+action_271 (267) = happyShift action_86
+action_271 (268) = happyShift action_160
+action_271 (275) = happyShift action_161
+action_271 (276) = happyShift action_146
+action_271 (284) = happyShift action_87
+action_271 (88) = happyGoto action_461
+action_271 (89) = happyGoto action_154
+action_271 (90) = happyGoto action_155
+action_271 (91) = happyGoto action_156
+action_271 (92) = happyGoto action_157
+action_271 (93) = happyGoto action_123
+action_271 (94) = happyGoto action_124
+action_271 (97) = happyGoto action_125
+action_271 (98) = happyGoto action_37
+action_271 (99) = happyGoto action_38
+action_271 (100) = happyGoto action_126
+action_271 (106) = happyGoto action_462
+action_271 (107) = happyGoto action_39
+action_271 (115) = happyGoto action_127
+action_271 (136) = happyGoto action_43
+action_271 (139) = happyGoto action_44
+action_271 (140) = happyGoto action_45
+action_271 (142) = happyGoto action_46
+action_271 (152) = happyGoto action_47
+action_271 (153) = happyGoto action_48
+action_271 (154) = happyGoto action_49
+action_271 (155) = happyGoto action_50
+action_271 (156) = happyGoto action_51
+action_271 (157) = happyGoto action_52
+action_271 (165) = happyGoto action_53
+action_271 (166) = happyGoto action_54
+action_271 _ = happyReduce_404
+
+action_272 (177) = happyShift action_114
+action_272 (178) = happyShift action_56
+action_272 (179) = happyShift action_57
+action_272 (180) = happyShift action_58
+action_272 (181) = happyShift action_115
+action_272 (182) = happyShift action_60
+action_272 (183) = happyShift action_129
+action_272 (188) = happyShift action_61
+action_272 (189) = happyShift action_62
+action_272 (190) = happyShift action_63
+action_272 (191) = happyShift action_64
+action_272 (193) = happyShift action_65
+action_272 (201) = happyShift action_66
+action_272 (204) = happyShift action_67
+action_272 (211) = happyShift action_158
+action_272 (216) = happyShift action_68
+action_272 (218) = happyShift action_130
+action_272 (219) = happyShift action_69
+action_272 (220) = happyShift action_70
+action_272 (223) = happyShift action_71
+action_272 (233) = happyShift action_72
+action_272 (234) = happyShift action_73
+action_272 (235) = happyShift action_74
+action_272 (236) = happyShift action_75
+action_272 (237) = happyShift action_76
+action_272 (238) = happyShift action_77
+action_272 (240) = happyShift action_132
+action_272 (241) = happyShift action_133
+action_272 (242) = happyShift action_134
+action_272 (246) = happyShift action_78
+action_272 (251) = happyShift action_79
+action_272 (252) = happyShift action_80
+action_272 (253) = happyShift action_81
+action_272 (254) = happyShift action_82
+action_272 (255) = happyShift action_83
+action_272 (256) = happyShift action_84
+action_272 (257) = happyShift action_85
+action_272 (258) = happyShift action_136
+action_272 (263) = happyShift action_159
+action_272 (264) = happyShift action_140
+action_272 (267) = happyShift action_86
+action_272 (268) = happyShift action_160
+action_272 (275) = happyShift action_161
+action_272 (276) = happyShift action_146
+action_272 (284) = happyShift action_87
+action_272 (88) = happyGoto action_460
+action_272 (89) = happyGoto action_154
+action_272 (90) = happyGoto action_155
+action_272 (91) = happyGoto action_156
+action_272 (92) = happyGoto action_157
+action_272 (93) = happyGoto action_123
+action_272 (94) = happyGoto action_124
+action_272 (97) = happyGoto action_125
+action_272 (98) = happyGoto action_37
+action_272 (99) = happyGoto action_38
+action_272 (100) = happyGoto action_126
+action_272 (107) = happyGoto action_39
+action_272 (115) = happyGoto action_127
+action_272 (136) = happyGoto action_43
+action_272 (139) = happyGoto action_44
+action_272 (140) = happyGoto action_45
+action_272 (142) = happyGoto action_46
+action_272 (152) = happyGoto action_47
+action_272 (153) = happyGoto action_48
+action_272 (154) = happyGoto action_49
+action_272 (155) = happyGoto action_50
+action_272 (156) = happyGoto action_51
+action_272 (157) = happyGoto action_52
+action_272 (165) = happyGoto action_53
+action_272 (166) = happyGoto action_54
+action_272 _ = happyReduce_404
+
+action_273 _ = happyReduce_240
+
+action_274 (177) = happyShift action_114
+action_274 (178) = happyShift action_56
+action_274 (179) = happyShift action_57
+action_274 (180) = happyShift action_58
+action_274 (181) = happyShift action_115
+action_274 (182) = happyShift action_60
+action_274 (183) = happyShift action_129
+action_274 (188) = happyShift action_61
+action_274 (189) = happyShift action_62
+action_274 (190) = happyShift action_63
+action_274 (191) = happyShift action_64
+action_274 (193) = happyShift action_65
+action_274 (201) = happyShift action_66
+action_274 (204) = happyShift action_67
+action_274 (211) = happyShift action_158
+action_274 (216) = happyShift action_68
+action_274 (218) = happyShift action_130
+action_274 (219) = happyShift action_69
+action_274 (220) = happyShift action_70
+action_274 (223) = happyShift action_71
+action_274 (233) = happyShift action_72
+action_274 (234) = happyShift action_73
+action_274 (235) = happyShift action_74
+action_274 (236) = happyShift action_75
+action_274 (237) = happyShift action_76
+action_274 (238) = happyShift action_77
+action_274 (240) = happyShift action_132
+action_274 (241) = happyShift action_133
+action_274 (242) = happyShift action_134
+action_274 (246) = happyShift action_78
+action_274 (251) = happyShift action_79
+action_274 (252) = happyShift action_80
+action_274 (253) = happyShift action_81
+action_274 (254) = happyShift action_82
+action_274 (255) = happyShift action_83
+action_274 (256) = happyShift action_84
+action_274 (257) = happyShift action_85
+action_274 (258) = happyShift action_136
+action_274 (263) = happyShift action_159
+action_274 (264) = happyShift action_140
+action_274 (267) = happyShift action_86
+action_274 (268) = happyShift action_160
+action_274 (275) = happyShift action_161
+action_274 (276) = happyShift action_146
+action_274 (284) = happyShift action_87
+action_274 (88) = happyGoto action_459
+action_274 (89) = happyGoto action_154
+action_274 (90) = happyGoto action_155
+action_274 (91) = happyGoto action_156
+action_274 (92) = happyGoto action_157
+action_274 (93) = happyGoto action_123
+action_274 (94) = happyGoto action_124
+action_274 (97) = happyGoto action_125
+action_274 (98) = happyGoto action_37
+action_274 (99) = happyGoto action_38
+action_274 (100) = happyGoto action_126
+action_274 (107) = happyGoto action_39
+action_274 (115) = happyGoto action_127
+action_274 (136) = happyGoto action_43
+action_274 (139) = happyGoto action_44
+action_274 (140) = happyGoto action_45
+action_274 (142) = happyGoto action_46
+action_274 (152) = happyGoto action_47
+action_274 (153) = happyGoto action_48
+action_274 (154) = happyGoto action_49
+action_274 (155) = happyGoto action_50
+action_274 (156) = happyGoto action_51
+action_274 (157) = happyGoto action_52
+action_274 (165) = happyGoto action_53
+action_274 (166) = happyGoto action_54
+action_274 _ = happyReduce_404
+
+action_275 (177) = happyShift action_114
+action_275 (178) = happyShift action_56
+action_275 (179) = happyShift action_57
+action_275 (180) = happyShift action_58
+action_275 (181) = happyShift action_115
+action_275 (182) = happyShift action_60
+action_275 (183) = happyShift action_129
+action_275 (188) = happyShift action_61
+action_275 (189) = happyShift action_62
+action_275 (190) = happyShift action_63
+action_275 (191) = happyShift action_64
+action_275 (193) = happyShift action_65
+action_275 (201) = happyShift action_66
+action_275 (204) = happyShift action_67
+action_275 (211) = happyShift action_158
+action_275 (216) = happyShift action_68
+action_275 (218) = happyShift action_130
+action_275 (219) = happyShift action_69
+action_275 (220) = happyShift action_70
+action_275 (221) = happyReduce_404
+action_275 (223) = happyShift action_71
+action_275 (233) = happyShift action_72
+action_275 (234) = happyShift action_73
+action_275 (235) = happyShift action_74
+action_275 (236) = happyShift action_75
+action_275 (237) = happyShift action_76
+action_275 (238) = happyShift action_77
+action_275 (240) = happyShift action_132
+action_275 (241) = happyShift action_133
+action_275 (242) = happyShift action_134
+action_275 (244) = happyReduce_404
+action_275 (246) = happyShift action_78
+action_275 (251) = happyShift action_79
+action_275 (252) = happyShift action_80
+action_275 (253) = happyShift action_81
+action_275 (254) = happyShift action_82
+action_275 (255) = happyShift action_83
+action_275 (256) = happyShift action_84
+action_275 (257) = happyShift action_85
+action_275 (258) = happyShift action_136
+action_275 (263) = happyShift action_159
+action_275 (264) = happyShift action_140
+action_275 (267) = happyShift action_86
+action_275 (268) = happyShift action_160
+action_275 (275) = happyShift action_161
+action_275 (276) = happyShift action_146
+action_275 (284) = happyShift action_87
+action_275 (88) = happyGoto action_458
+action_275 (89) = happyGoto action_154
+action_275 (90) = happyGoto action_155
+action_275 (91) = happyGoto action_156
+action_275 (92) = happyGoto action_157
+action_275 (93) = happyGoto action_123
+action_275 (94) = happyGoto action_124
+action_275 (97) = happyGoto action_125
+action_275 (98) = happyGoto action_37
+action_275 (99) = happyGoto action_38
+action_275 (100) = happyGoto action_126
+action_275 (107) = happyGoto action_39
+action_275 (115) = happyGoto action_127
+action_275 (136) = happyGoto action_43
+action_275 (139) = happyGoto action_44
+action_275 (140) = happyGoto action_45
+action_275 (142) = happyGoto action_46
+action_275 (152) = happyGoto action_47
+action_275 (153) = happyGoto action_48
+action_275 (154) = happyGoto action_49
+action_275 (155) = happyGoto action_50
+action_275 (156) = happyGoto action_51
+action_275 (157) = happyGoto action_52
+action_275 (165) = happyGoto action_53
+action_275 (166) = happyGoto action_54
+action_275 _ = happyReduce_293
+
+action_276 (177) = happyShift action_114
+action_276 (178) = happyShift action_56
+action_276 (179) = happyShift action_57
+action_276 (180) = happyShift action_58
+action_276 (181) = happyShift action_115
+action_276 (182) = happyShift action_60
+action_276 (183) = happyShift action_129
+action_276 (188) = happyShift action_61
+action_276 (189) = happyShift action_62
+action_276 (190) = happyShift action_63
+action_276 (191) = happyShift action_64
+action_276 (193) = happyShift action_65
+action_276 (201) = happyShift action_66
+action_276 (204) = happyShift action_67
+action_276 (211) = happyShift action_158
+action_276 (216) = happyShift action_68
+action_276 (218) = happyShift action_130
+action_276 (219) = happyShift action_69
+action_276 (220) = happyShift action_70
+action_276 (223) = happyShift action_71
+action_276 (233) = happyShift action_72
+action_276 (234) = happyShift action_73
+action_276 (235) = happyShift action_74
+action_276 (236) = happyShift action_75
+action_276 (237) = happyShift action_76
+action_276 (238) = happyShift action_77
+action_276 (240) = happyShift action_132
+action_276 (241) = happyShift action_133
+action_276 (242) = happyShift action_134
+action_276 (246) = happyShift action_78
+action_276 (251) = happyShift action_79
+action_276 (252) = happyShift action_80
+action_276 (253) = happyShift action_81
+action_276 (254) = happyShift action_82
+action_276 (255) = happyShift action_83
+action_276 (256) = happyShift action_84
+action_276 (257) = happyShift action_85
+action_276 (258) = happyShift action_136
+action_276 (263) = happyShift action_159
+action_276 (264) = happyShift action_140
+action_276 (267) = happyShift action_86
+action_276 (268) = happyShift action_160
+action_276 (275) = happyShift action_457
+action_276 (276) = happyShift action_146
+action_276 (284) = happyShift action_87
+action_276 (88) = happyGoto action_453
+action_276 (89) = happyGoto action_154
+action_276 (90) = happyGoto action_155
+action_276 (91) = happyGoto action_412
+action_276 (92) = happyGoto action_157
+action_276 (93) = happyGoto action_123
+action_276 (94) = happyGoto action_124
+action_276 (97) = happyGoto action_125
+action_276 (98) = happyGoto action_37
+action_276 (99) = happyGoto action_38
+action_276 (100) = happyGoto action_126
+action_276 (107) = happyGoto action_39
+action_276 (115) = happyGoto action_127
+action_276 (118) = happyGoto action_454
+action_276 (119) = happyGoto action_455
+action_276 (127) = happyGoto action_456
+action_276 (136) = happyGoto action_43
+action_276 (139) = happyGoto action_44
+action_276 (140) = happyGoto action_45
+action_276 (142) = happyGoto action_46
+action_276 (152) = happyGoto action_47
+action_276 (153) = happyGoto action_48
+action_276 (154) = happyGoto action_49
+action_276 (155) = happyGoto action_50
+action_276 (156) = happyGoto action_51
+action_276 (157) = happyGoto action_52
+action_276 (165) = happyGoto action_53
+action_276 (166) = happyGoto action_54
+action_276 _ = happyReduce_404
+
+action_277 (177) = happyShift action_114
+action_277 (178) = happyShift action_56
+action_277 (179) = happyShift action_57
+action_277 (180) = happyShift action_58
+action_277 (181) = happyShift action_115
+action_277 (182) = happyShift action_60
+action_277 (183) = happyShift action_129
+action_277 (188) = happyShift action_61
+action_277 (189) = happyShift action_62
+action_277 (190) = happyShift action_63
+action_277 (191) = happyShift action_64
+action_277 (193) = happyShift action_65
+action_277 (201) = happyShift action_66
+action_277 (204) = happyShift action_67
+action_277 (211) = happyShift action_158
+action_277 (216) = happyShift action_68
+action_277 (218) = happyShift action_130
+action_277 (219) = happyShift action_69
+action_277 (220) = happyShift action_70
+action_277 (223) = happyShift action_71
+action_277 (233) = happyShift action_72
+action_277 (234) = happyShift action_73
+action_277 (235) = happyShift action_74
+action_277 (236) = happyShift action_75
+action_277 (237) = happyShift action_76
+action_277 (238) = happyShift action_77
+action_277 (240) = happyShift action_132
+action_277 (241) = happyShift action_133
+action_277 (242) = happyShift action_134
+action_277 (246) = happyShift action_78
+action_277 (251) = happyShift action_79
+action_277 (252) = happyShift action_80
+action_277 (253) = happyShift action_81
+action_277 (254) = happyShift action_82
+action_277 (255) = happyShift action_83
+action_277 (256) = happyShift action_84
+action_277 (257) = happyShift action_85
+action_277 (258) = happyShift action_136
+action_277 (263) = happyShift action_159
+action_277 (264) = happyShift action_140
+action_277 (267) = happyShift action_86
+action_277 (268) = happyShift action_160
+action_277 (275) = happyShift action_161
+action_277 (276) = happyShift action_146
+action_277 (284) = happyShift action_87
+action_277 (88) = happyGoto action_183
+action_277 (89) = happyGoto action_154
+action_277 (90) = happyGoto action_155
+action_277 (91) = happyGoto action_156
+action_277 (92) = happyGoto action_157
+action_277 (93) = happyGoto action_123
+action_277 (94) = happyGoto action_124
+action_277 (97) = happyGoto action_125
+action_277 (98) = happyGoto action_37
+action_277 (99) = happyGoto action_38
+action_277 (100) = happyGoto action_126
+action_277 (105) = happyGoto action_452
+action_277 (106) = happyGoto action_186
+action_277 (107) = happyGoto action_39
+action_277 (115) = happyGoto action_127
+action_277 (136) = happyGoto action_43
+action_277 (139) = happyGoto action_44
+action_277 (140) = happyGoto action_45
+action_277 (142) = happyGoto action_46
+action_277 (152) = happyGoto action_47
+action_277 (153) = happyGoto action_48
+action_277 (154) = happyGoto action_49
+action_277 (155) = happyGoto action_50
+action_277 (156) = happyGoto action_51
+action_277 (157) = happyGoto action_52
+action_277 (165) = happyGoto action_53
+action_277 (166) = happyGoto action_54
+action_277 _ = happyReduce_404
+
+action_278 _ = happyReduce_245
+
+action_279 _ = happyReduce_249
+
+action_280 _ = happyReduce_250
+
+action_281 (177) = happyShift action_114
+action_281 (178) = happyShift action_56
+action_281 (179) = happyShift action_57
+action_281 (180) = happyShift action_58
+action_281 (181) = happyShift action_115
+action_281 (182) = happyShift action_60
+action_281 (188) = happyShift action_61
+action_281 (189) = happyShift action_62
+action_281 (190) = happyShift action_63
+action_281 (191) = happyShift action_64
+action_281 (193) = happyShift action_65
+action_281 (201) = happyShift action_66
+action_281 (204) = happyShift action_67
+action_281 (211) = happyShift action_158
+action_281 (216) = happyShift action_68
+action_281 (218) = happyShift action_130
+action_281 (219) = happyShift action_69
+action_281 (220) = happyShift action_70
+action_281 (223) = happyShift action_71
+action_281 (233) = happyShift action_72
+action_281 (234) = happyShift action_73
+action_281 (235) = happyShift action_74
+action_281 (236) = happyShift action_75
+action_281 (237) = happyShift action_76
+action_281 (238) = happyShift action_77
+action_281 (240) = happyShift action_132
+action_281 (241) = happyShift action_133
+action_281 (242) = happyShift action_134
+action_281 (246) = happyShift action_78
+action_281 (251) = happyShift action_79
+action_281 (252) = happyShift action_80
+action_281 (253) = happyShift action_81
+action_281 (254) = happyShift action_82
+action_281 (255) = happyShift action_83
+action_281 (256) = happyShift action_84
+action_281 (257) = happyShift action_85
+action_281 (258) = happyShift action_136
+action_281 (263) = happyShift action_159
+action_281 (264) = happyShift action_140
+action_281 (267) = happyShift action_86
+action_281 (268) = happyShift action_160
+action_281 (275) = happyShift action_161
+action_281 (276) = happyShift action_146
+action_281 (284) = happyShift action_87
+action_281 (92) = happyGoto action_451
+action_281 (93) = happyGoto action_389
+action_281 (94) = happyGoto action_124
+action_281 (97) = happyGoto action_125
+action_281 (98) = happyGoto action_37
+action_281 (99) = happyGoto action_38
+action_281 (100) = happyGoto action_126
+action_281 (107) = happyGoto action_39
+action_281 (136) = happyGoto action_43
+action_281 (139) = happyGoto action_44
+action_281 (140) = happyGoto action_45
+action_281 (142) = happyGoto action_46
+action_281 (152) = happyGoto action_47
+action_281 (153) = happyGoto action_48
+action_281 (154) = happyGoto action_49
+action_281 (155) = happyGoto action_50
+action_281 (156) = happyGoto action_51
+action_281 (157) = happyGoto action_52
+action_281 (165) = happyGoto action_53
+action_281 (166) = happyGoto action_54
+action_281 _ = happyReduce_404
+
+action_282 _ = happyReduce_251
+
+action_283 (177) = happyShift action_114
+action_283 (206) = happyShift action_450
+action_283 (251) = happyShift action_79
+action_283 (252) = happyShift action_80
+action_283 (253) = happyShift action_81
+action_283 (254) = happyShift action_82
+action_283 (255) = happyShift action_83
+action_283 (256) = happyShift action_84
+action_283 (257) = happyShift action_85
+action_283 (267) = happyShift action_86
+action_283 (284) = happyShift action_87
+action_283 (153) = happyGoto action_48
+action_283 (154) = happyGoto action_172
+action_283 (174) = happyGoto action_449
+action_283 _ = happyFail
+
+action_284 (202) = happyShift action_448
+action_284 _ = happyFail
+
+action_285 (177) = happyShift action_114
+action_285 (181) = happyShift action_115
+action_285 (182) = happyShift action_60
+action_285 (184) = happyShift action_304
+action_285 (185) = happyShift action_211
+action_285 (187) = happyShift action_213
+action_285 (193) = happyShift action_175
+action_285 (195) = happyShift action_176
+action_285 (201) = happyShift action_177
+action_285 (205) = happyShift action_305
+action_285 (208) = happyShift action_218
+action_285 (214) = happyShift action_306
+action_285 (251) = happyShift action_79
+action_285 (252) = happyShift action_80
+action_285 (253) = happyShift action_81
+action_285 (254) = happyShift action_82
+action_285 (255) = happyShift action_83
+action_285 (256) = happyShift action_84
+action_285 (257) = happyShift action_85
+action_285 (267) = happyShift action_86
+action_285 (284) = happyShift action_87
+action_285 (49) = happyGoto action_299
+action_285 (50) = happyGoto action_168
+action_285 (51) = happyGoto action_300
+action_285 (147) = happyGoto action_301
+action_285 (151) = happyGoto action_259
+action_285 (153) = happyGoto action_48
+action_285 (154) = happyGoto action_172
+action_285 (156) = happyGoto action_173
+action_285 (157) = happyGoto action_52
+action_285 (158) = happyGoto action_203
+action_285 (159) = happyGoto action_204
+action_285 (174) = happyGoto action_174
+action_285 (175) = happyGoto action_302
+action_285 (176) = happyGoto action_303
+action_285 _ = happyReduce_105
+
+action_286 _ = happyReduce_122
+
+action_287 _ = happyReduce_130
+
+action_288 (196) = happyShift action_446
+action_288 (203) = happyShift action_447
+action_288 _ = happyFail
+
+action_289 (203) = happyReduce_130
+action_289 _ = happyReduce_127
+
+action_290 (194) = happyShift action_445
+action_290 _ = happyFail
+
+action_291 (194) = happyShift action_444
+action_291 _ = happyFail
+
+action_292 (203) = happyShift action_443
+action_292 _ = happyFail
+
+action_293 (194) = happyShift action_442
+action_293 (203) = happyShift action_255
+action_293 _ = happyFail
+
+action_294 _ = happyReduce_120
+
+action_295 (194) = happyShift action_441
+action_295 _ = happyFail
+
+action_296 (177) = happyShift action_114
+action_296 (181) = happyShift action_115
+action_296 (182) = happyShift action_60
+action_296 (193) = happyShift action_175
+action_296 (195) = happyShift action_176
+action_296 (201) = happyShift action_177
+action_296 (251) = happyShift action_79
+action_296 (252) = happyShift action_80
+action_296 (253) = happyShift action_81
+action_296 (254) = happyShift action_82
+action_296 (255) = happyShift action_83
+action_296 (256) = happyShift action_84
+action_296 (257) = happyShift action_85
+action_296 (267) = happyShift action_86
+action_296 (284) = happyShift action_87
+action_296 (46) = happyGoto action_440
+action_296 (48) = happyGoto action_285
+action_296 (49) = happyGoto action_167
+action_296 (50) = happyGoto action_168
+action_296 (153) = happyGoto action_48
+action_296 (154) = happyGoto action_172
+action_296 (156) = happyGoto action_173
+action_296 (157) = happyGoto action_52
+action_296 (174) = happyGoto action_174
+action_296 _ = happyFail
+
+action_297 (177) = happyShift action_114
+action_297 (179) = happyShift action_57
+action_297 (180) = happyShift action_58
+action_297 (181) = happyShift action_115
+action_297 (182) = happyShift action_60
+action_297 (193) = happyShift action_175
+action_297 (195) = happyShift action_176
+action_297 (201) = happyShift action_177
+action_297 (251) = happyShift action_79
+action_297 (252) = happyShift action_80
+action_297 (253) = happyShift action_81
+action_297 (254) = happyShift action_82
+action_297 (255) = happyShift action_83
+action_297 (256) = happyShift action_84
+action_297 (257) = happyShift action_85
+action_297 (267) = happyShift action_86
+action_297 (284) = happyShift action_87
+action_297 (46) = happyGoto action_164
+action_297 (47) = happyGoto action_439
+action_297 (48) = happyGoto action_285
+action_297 (49) = happyGoto action_167
+action_297 (50) = happyGoto action_168
+action_297 (140) = happyGoto action_171
+action_297 (153) = happyGoto action_48
+action_297 (154) = happyGoto action_172
+action_297 (155) = happyGoto action_50
+action_297 (156) = happyGoto action_173
+action_297 (157) = happyGoto action_52
+action_297 (174) = happyGoto action_174
+action_297 _ = happyFail
+
+action_298 _ = happyReduce_252
+
+action_299 _ = happyReduce_111
+
+action_300 (177) = happyShift action_114
+action_300 (181) = happyShift action_115
+action_300 (182) = happyShift action_60
+action_300 (193) = happyShift action_175
+action_300 (195) = happyShift action_176
+action_300 (201) = happyShift action_177
+action_300 (251) = happyShift action_79
+action_300 (252) = happyShift action_80
+action_300 (253) = happyShift action_81
+action_300 (254) = happyShift action_82
+action_300 (255) = happyShift action_83
+action_300 (256) = happyShift action_84
+action_300 (257) = happyShift action_85
+action_300 (267) = happyShift action_86
+action_300 (284) = happyShift action_87
+action_300 (46) = happyGoto action_438
+action_300 (48) = happyGoto action_285
+action_300 (49) = happyGoto action_167
+action_300 (50) = happyGoto action_168
+action_300 (153) = happyGoto action_48
+action_300 (154) = happyGoto action_172
+action_300 (156) = happyGoto action_173
+action_300 (157) = happyGoto action_52
+action_300 (174) = happyGoto action_174
+action_300 _ = happyFail
+
+action_301 _ = happyReduce_124
+
+action_302 (177) = happyShift action_114
+action_302 (181) = happyShift action_115
+action_302 (182) = happyShift action_60
+action_302 (193) = happyShift action_175
+action_302 (195) = happyShift action_176
+action_302 (201) = happyShift action_177
+action_302 (251) = happyShift action_79
+action_302 (252) = happyShift action_80
+action_302 (253) = happyShift action_81
+action_302 (254) = happyShift action_82
+action_302 (255) = happyShift action_83
+action_302 (256) = happyShift action_84
+action_302 (257) = happyShift action_85
+action_302 (267) = happyShift action_86
+action_302 (284) = happyShift action_87
+action_302 (46) = happyGoto action_437
+action_302 (48) = happyGoto action_285
+action_302 (49) = happyGoto action_167
+action_302 (50) = happyGoto action_168
+action_302 (153) = happyGoto action_48
+action_302 (154) = happyGoto action_172
+action_302 (156) = happyGoto action_173
+action_302 (157) = happyGoto action_52
+action_302 (174) = happyGoto action_174
+action_302 _ = happyFail
+
+action_303 _ = happyReduce_416
+
+action_304 _ = happyReduce_417
+
+action_305 (177) = happyShift action_114
+action_305 (181) = happyShift action_115
+action_305 (182) = happyShift action_60
+action_305 (251) = happyShift action_79
+action_305 (252) = happyShift action_80
+action_305 (253) = happyShift action_81
+action_305 (254) = happyShift action_82
+action_305 (255) = happyShift action_83
+action_305 (256) = happyShift action_84
+action_305 (257) = happyShift action_85
+action_305 (267) = happyShift action_86
+action_305 (284) = happyShift action_87
+action_305 (153) = happyGoto action_48
+action_305 (154) = happyGoto action_172
+action_305 (156) = happyGoto action_247
+action_305 (157) = happyGoto action_52
+action_305 (174) = happyGoto action_436
+action_305 _ = happyFail
+
+action_306 (177) = happyShift action_114
+action_306 (181) = happyShift action_115
+action_306 (182) = happyShift action_60
+action_306 (193) = happyShift action_175
+action_306 (195) = happyShift action_176
+action_306 (201) = happyShift action_177
+action_306 (251) = happyShift action_79
+action_306 (252) = happyShift action_80
+action_306 (253) = happyShift action_81
+action_306 (254) = happyShift action_82
+action_306 (255) = happyShift action_83
+action_306 (256) = happyShift action_84
+action_306 (257) = happyShift action_85
+action_306 (267) = happyShift action_86
+action_306 (284) = happyShift action_87
+action_306 (46) = happyGoto action_435
+action_306 (48) = happyGoto action_285
+action_306 (49) = happyGoto action_167
+action_306 (50) = happyGoto action_168
+action_306 (153) = happyGoto action_48
+action_306 (154) = happyGoto action_172
+action_306 (156) = happyGoto action_173
+action_306 (157) = happyGoto action_52
+action_306 (174) = happyGoto action_174
+action_306 _ = happyFail
+
+action_307 _ = happyReduce_253
+
+action_308 _ = happyReduce_92
+
+action_309 (270) = happyShift action_434
+action_309 _ = happyFail
+
+action_310 (10) = happyGoto action_31
+action_310 (11) = happyGoto action_429
+action_310 (36) = happyGoto action_432
+action_310 (133) = happyGoto action_433
+action_310 _ = happyReduce_18
+
+action_311 (10) = happyGoto action_31
+action_311 (11) = happyGoto action_429
+action_311 (36) = happyGoto action_430
+action_311 (133) = happyGoto action_431
+action_311 _ = happyReduce_18
+
+action_312 (280) = happyShift action_428
+action_312 _ = happyFail
+
+action_313 (270) = happyShift action_427
+action_313 _ = happyFail
+
+action_314 (10) = happyGoto action_31
+action_314 (11) = happyGoto action_424
+action_314 (133) = happyGoto action_426
+action_314 _ = happyReduce_18
+
+action_315 (10) = happyGoto action_31
+action_315 (11) = happyGoto action_424
+action_315 (133) = happyGoto action_425
+action_315 _ = happyReduce_18
+
+action_316 (177) = happyShift action_114
+action_316 (178) = happyShift action_56
+action_316 (179) = happyShift action_57
+action_316 (180) = happyShift action_58
+action_316 (181) = happyShift action_115
+action_316 (182) = happyShift action_60
+action_316 (188) = happyShift action_61
+action_316 (189) = happyShift action_62
+action_316 (190) = happyShift action_63
+action_316 (191) = happyShift action_64
+action_316 (193) = happyShift action_65
+action_316 (201) = happyShift action_66
+action_316 (204) = happyShift action_67
+action_316 (216) = happyShift action_68
+action_316 (219) = happyShift action_69
+action_316 (220) = happyShift action_70
+action_316 (223) = happyShift action_71
+action_316 (233) = happyShift action_72
+action_316 (234) = happyShift action_73
+action_316 (235) = happyShift action_74
+action_316 (236) = happyShift action_75
+action_316 (237) = happyShift action_76
+action_316 (238) = happyShift action_77
+action_316 (246) = happyShift action_78
+action_316 (251) = happyShift action_79
+action_316 (252) = happyShift action_80
+action_316 (253) = happyShift action_81
+action_316 (254) = happyShift action_82
+action_316 (255) = happyShift action_83
+action_316 (256) = happyShift action_84
+action_316 (257) = happyShift action_85
+action_316 (267) = happyShift action_86
+action_316 (284) = happyShift action_87
+action_316 (95) = happyGoto action_421
+action_316 (96) = happyGoto action_422
+action_316 (97) = happyGoto action_423
+action_316 (98) = happyGoto action_37
+action_316 (99) = happyGoto action_38
+action_316 (107) = happyGoto action_39
+action_316 (136) = happyGoto action_43
+action_316 (139) = happyGoto action_44
+action_316 (140) = happyGoto action_45
+action_316 (142) = happyGoto action_46
+action_316 (152) = happyGoto action_47
+action_316 (153) = happyGoto action_48
+action_316 (154) = happyGoto action_49
+action_316 (155) = happyGoto action_50
+action_316 (156) = happyGoto action_51
+action_316 (157) = happyGoto action_52
+action_316 (165) = happyGoto action_53
+action_316 (166) = happyGoto action_54
+action_316 _ = happyReduce_404
+
+action_317 _ = happyReduce_272
+
+action_318 _ = happyReduce_33
+
+action_319 _ = happyReduce_12
+
+action_320 _ = happyReduce_66
+
+action_321 (210) = happyShift action_420
+action_321 _ = happyFail
+
+action_322 _ = happyReduce_411
+
+action_323 (57) = happyGoto action_419
+action_323 _ = happyReduce_134
+
+action_324 (210) = happyShift action_418
+action_324 _ = happyFail
+
+action_325 _ = happyReduce_211
+
+action_326 (177) = happyShift action_114
+action_326 (178) = happyShift action_56
+action_326 (179) = happyShift action_57
+action_326 (180) = happyShift action_58
+action_326 (181) = happyShift action_115
+action_326 (182) = happyShift action_60
+action_326 (183) = happyShift action_129
+action_326 (188) = happyShift action_61
+action_326 (189) = happyShift action_62
+action_326 (190) = happyShift action_63
+action_326 (191) = happyShift action_64
+action_326 (193) = happyShift action_65
+action_326 (197) = happyShift action_415
+action_326 (201) = happyShift action_66
+action_326 (204) = happyShift action_67
+action_326 (211) = happyShift action_158
+action_326 (216) = happyShift action_68
+action_326 (218) = happyShift action_130
+action_326 (219) = happyShift action_69
+action_326 (220) = happyShift action_70
+action_326 (223) = happyShift action_71
+action_326 (233) = happyShift action_72
+action_326 (234) = happyShift action_73
+action_326 (235) = happyShift action_74
+action_326 (236) = happyShift action_75
+action_326 (237) = happyShift action_76
+action_326 (238) = happyShift action_77
+action_326 (240) = happyShift action_132
+action_326 (241) = happyShift action_133
+action_326 (242) = happyShift action_134
+action_326 (246) = happyShift action_78
+action_326 (251) = happyShift action_79
+action_326 (252) = happyShift action_80
+action_326 (253) = happyShift action_81
+action_326 (254) = happyShift action_82
+action_326 (255) = happyShift action_83
+action_326 (256) = happyShift action_84
+action_326 (257) = happyShift action_85
+action_326 (258) = happyShift action_136
+action_326 (263) = happyShift action_159
+action_326 (264) = happyShift action_140
+action_326 (267) = happyShift action_86
+action_326 (268) = happyShift action_160
+action_326 (275) = happyShift action_416
+action_326 (276) = happyShift action_146
+action_326 (284) = happyShift action_87
+action_326 (88) = happyGoto action_411
+action_326 (89) = happyGoto action_154
+action_326 (90) = happyGoto action_155
+action_326 (91) = happyGoto action_412
+action_326 (92) = happyGoto action_157
+action_326 (93) = happyGoto action_123
+action_326 (94) = happyGoto action_124
+action_326 (97) = happyGoto action_125
+action_326 (98) = happyGoto action_37
+action_326 (99) = happyGoto action_38
+action_326 (100) = happyGoto action_126
+action_326 (107) = happyGoto action_39
+action_326 (115) = happyGoto action_127
+action_326 (127) = happyGoto action_413
+action_326 (129) = happyGoto action_417
+action_326 (136) = happyGoto action_43
+action_326 (139) = happyGoto action_44
+action_326 (140) = happyGoto action_45
+action_326 (142) = happyGoto action_46
+action_326 (152) = happyGoto action_47
+action_326 (153) = happyGoto action_48
+action_326 (154) = happyGoto action_49
+action_326 (155) = happyGoto action_50
+action_326 (156) = happyGoto action_51
+action_326 (157) = happyGoto action_52
+action_326 (165) = happyGoto action_53
+action_326 (166) = happyGoto action_54
+action_326 _ = happyReduce_404
+
+action_327 (177) = happyShift action_114
+action_327 (178) = happyShift action_56
+action_327 (179) = happyShift action_57
+action_327 (180) = happyShift action_58
+action_327 (181) = happyShift action_115
+action_327 (182) = happyShift action_60
+action_327 (183) = happyShift action_129
+action_327 (188) = happyShift action_61
+action_327 (189) = happyShift action_62
+action_327 (190) = happyShift action_63
+action_327 (191) = happyShift action_64
+action_327 (193) = happyShift action_65
+action_327 (197) = happyShift action_415
+action_327 (201) = happyShift action_66
+action_327 (204) = happyShift action_67
+action_327 (211) = happyShift action_158
+action_327 (216) = happyShift action_68
+action_327 (218) = happyShift action_130
+action_327 (219) = happyShift action_69
+action_327 (220) = happyShift action_70
+action_327 (223) = happyShift action_71
+action_327 (233) = happyShift action_72
+action_327 (234) = happyShift action_73
+action_327 (235) = happyShift action_74
+action_327 (236) = happyShift action_75
+action_327 (237) = happyShift action_76
+action_327 (238) = happyShift action_77
+action_327 (240) = happyShift action_132
+action_327 (241) = happyShift action_133
+action_327 (242) = happyShift action_134
+action_327 (246) = happyShift action_78
+action_327 (251) = happyShift action_79
+action_327 (252) = happyShift action_80
+action_327 (253) = happyShift action_81
+action_327 (254) = happyShift action_82
+action_327 (255) = happyShift action_83
+action_327 (256) = happyShift action_84
+action_327 (257) = happyShift action_85
+action_327 (258) = happyShift action_136
+action_327 (263) = happyShift action_159
+action_327 (264) = happyShift action_140
+action_327 (267) = happyShift action_86
+action_327 (268) = happyShift action_160
+action_327 (275) = happyShift action_416
+action_327 (276) = happyShift action_146
+action_327 (284) = happyShift action_87
+action_327 (88) = happyGoto action_411
+action_327 (89) = happyGoto action_154
+action_327 (90) = happyGoto action_155
+action_327 (91) = happyGoto action_412
+action_327 (92) = happyGoto action_157
+action_327 (93) = happyGoto action_123
+action_327 (94) = happyGoto action_124
+action_327 (97) = happyGoto action_125
+action_327 (98) = happyGoto action_37
+action_327 (99) = happyGoto action_38
+action_327 (100) = happyGoto action_126
+action_327 (107) = happyGoto action_39
+action_327 (115) = happyGoto action_127
+action_327 (127) = happyGoto action_413
+action_327 (129) = happyGoto action_414
+action_327 (136) = happyGoto action_43
+action_327 (139) = happyGoto action_44
+action_327 (140) = happyGoto action_45
+action_327 (142) = happyGoto action_46
+action_327 (152) = happyGoto action_47
+action_327 (153) = happyGoto action_48
+action_327 (154) = happyGoto action_49
+action_327 (155) = happyGoto action_50
+action_327 (156) = happyGoto action_51
+action_327 (157) = happyGoto action_52
+action_327 (165) = happyGoto action_53
+action_327 (166) = happyGoto action_54
+action_327 _ = happyReduce_404
+
+action_328 (282) = happyShift action_410
+action_328 (80) = happyGoto action_409
+action_328 _ = happyReduce_181
+
+action_329 (181) = happyShift action_28
+action_329 (182) = happyShift action_29
+action_329 (169) = happyGoto action_408
+action_329 _ = happyFail
+
+action_330 _ = happyReduce_36
+
+action_331 _ = happyReduce_210
+
+action_332 (177) = happyShift action_114
+action_332 (179) = happyShift action_57
+action_332 (180) = happyShift action_58
+action_332 (181) = happyShift action_115
+action_332 (182) = happyShift action_60
+action_332 (193) = happyShift action_175
+action_332 (195) = happyShift action_176
+action_332 (201) = happyShift action_177
+action_332 (251) = happyShift action_79
+action_332 (252) = happyShift action_80
+action_332 (253) = happyShift action_81
+action_332 (254) = happyShift action_82
+action_332 (255) = happyShift action_83
+action_332 (256) = happyShift action_84
+action_332 (257) = happyShift action_85
+action_332 (267) = happyShift action_86
+action_332 (284) = happyShift action_87
+action_332 (35) = happyGoto action_405
+action_332 (46) = happyGoto action_164
+action_332 (47) = happyGoto action_406
+action_332 (48) = happyGoto action_285
+action_332 (49) = happyGoto action_167
+action_332 (50) = happyGoto action_168
+action_332 (54) = happyGoto action_407
+action_332 (55) = happyGoto action_292
+action_332 (140) = happyGoto action_171
+action_332 (153) = happyGoto action_48
+action_332 (154) = happyGoto action_172
+action_332 (155) = happyGoto action_50
+action_332 (156) = happyGoto action_173
+action_332 (157) = happyGoto action_52
+action_332 (174) = happyGoto action_174
+action_332 _ = happyReduce_81
+
+action_333 (210) = happyShift action_403
+action_333 (282) = happyShift action_404
+action_333 (65) = happyGoto action_402
+action_333 _ = happyReduce_146
+
+action_334 (212) = happyShift action_401
+action_334 (58) = happyGoto action_400
+action_334 _ = happyReduce_135
+
+action_335 (279) = happyShift action_399
+action_335 _ = happyFail
+
+action_336 (255) = happyShift action_396
+action_336 (256) = happyShift action_397
+action_336 (43) = happyGoto action_398
+action_336 _ = happyFail
+
+action_337 (255) = happyShift action_396
+action_337 (256) = happyShift action_397
+action_337 (43) = happyGoto action_395
+action_337 _ = happyFail
+
+action_338 _ = happyReduce_257
+
+action_339 _ = happyReduce_259
+
+action_340 _ = happyReduce_258
+
+action_341 (184) = happyShift action_262
+action_341 (185) = happyShift action_211
+action_341 (186) = happyShift action_212
+action_341 (187) = happyShift action_213
+action_341 (194) = happyShift action_214
+action_341 (203) = happyShift action_215
+action_341 (206) = happyShift action_264
+action_341 (208) = happyShift action_218
+action_341 (218) = happyShift action_266
+action_341 (219) = happyShift action_267
+action_341 (102) = happyGoto action_196
+action_341 (151) = happyGoto action_394
+action_341 (158) = happyGoto action_203
+action_341 (159) = happyGoto action_204
+action_341 (160) = happyGoto action_205
+action_341 (162) = happyGoto action_207
+action_341 (164) = happyGoto action_261
+action_341 _ = happyFail
+
+action_342 (202) = happyShift action_193
+action_342 _ = happyFail
+
+action_343 _ = happyReduce_256
+
+action_344 _ = happyReduce_254
+
+action_345 _ = happyReduce_255
+
+action_346 (184) = happyShift action_262
+action_346 (186) = happyShift action_212
+action_346 (194) = happyShift action_294
+action_346 (203) = happyShift action_215
+action_346 (206) = happyShift action_264
+action_346 (214) = happyShift action_295
+action_346 (218) = happyShift action_266
+action_346 (219) = happyShift action_267
+action_346 (102) = happyGoto action_293
+action_346 (160) = happyGoto action_205
+action_346 (162) = happyGoto action_207
+action_346 (164) = happyGoto action_261
+action_346 _ = happyFail
+
+action_347 (202) = happyShift action_286
+action_347 _ = happyFail
+
+action_348 (194) = happyShift action_393
+action_348 _ = happyFail
+
+action_349 _ = happyReduce_214
+
+action_350 (282) = happyShift action_392
+action_350 (84) = happyGoto action_391
+action_350 _ = happyReduce_188
+
+action_351 (212) = happyReduce_404
+action_351 (87) = happyGoto action_390
+action_351 (166) = happyGoto action_354
+action_351 _ = happyReduce_190
+
+action_352 _ = happyReduce_192
+
+action_353 (177) = happyShift action_114
+action_353 (178) = happyShift action_56
+action_353 (179) = happyShift action_57
+action_353 (180) = happyShift action_58
+action_353 (181) = happyShift action_115
+action_353 (182) = happyShift action_60
+action_353 (188) = happyShift action_61
+action_353 (189) = happyShift action_62
+action_353 (190) = happyShift action_63
+action_353 (191) = happyShift action_64
+action_353 (193) = happyShift action_65
+action_353 (201) = happyShift action_66
+action_353 (204) = happyShift action_67
+action_353 (216) = happyShift action_68
+action_353 (218) = happyShift action_130
+action_353 (219) = happyShift action_69
+action_353 (220) = happyShift action_70
+action_353 (223) = happyShift action_71
+action_353 (233) = happyShift action_72
+action_353 (234) = happyShift action_73
+action_353 (235) = happyShift action_74
+action_353 (236) = happyShift action_75
+action_353 (237) = happyShift action_76
+action_353 (238) = happyShift action_77
+action_353 (240) = happyShift action_132
+action_353 (241) = happyShift action_133
+action_353 (242) = happyShift action_134
+action_353 (246) = happyShift action_78
+action_353 (251) = happyShift action_79
+action_353 (252) = happyShift action_80
+action_353 (253) = happyShift action_81
+action_353 (254) = happyShift action_82
+action_353 (255) = happyShift action_83
+action_353 (256) = happyShift action_84
+action_353 (257) = happyShift action_85
+action_353 (258) = happyShift action_136
+action_353 (264) = happyShift action_140
+action_353 (267) = happyShift action_86
+action_353 (276) = happyShift action_146
+action_353 (284) = happyShift action_87
+action_353 (93) = happyGoto action_389
+action_353 (94) = happyGoto action_124
+action_353 (97) = happyGoto action_125
+action_353 (98) = happyGoto action_37
+action_353 (99) = happyGoto action_38
+action_353 (100) = happyGoto action_126
+action_353 (107) = happyGoto action_39
+action_353 (136) = happyGoto action_43
+action_353 (139) = happyGoto action_44
+action_353 (140) = happyGoto action_45
+action_353 (142) = happyGoto action_46
+action_353 (152) = happyGoto action_47
+action_353 (153) = happyGoto action_48
+action_353 (154) = happyGoto action_49
+action_353 (155) = happyGoto action_50
+action_353 (156) = happyGoto action_51
+action_353 (157) = happyGoto action_52
+action_353 (165) = happyGoto action_53
+action_353 (166) = happyGoto action_54
+action_353 _ = happyReduce_404
+
+action_354 (212) = happyShift action_388
+action_354 _ = happyFail
+
+action_355 (177) = happyShift action_114
+action_355 (178) = happyShift action_56
+action_355 (179) = happyShift action_57
+action_355 (180) = happyShift action_58
+action_355 (181) = happyShift action_115
+action_355 (182) = happyShift action_60
+action_355 (183) = happyShift action_129
+action_355 (188) = happyShift action_61
+action_355 (189) = happyShift action_62
+action_355 (190) = happyShift action_63
+action_355 (191) = happyShift action_64
+action_355 (193) = happyShift action_65
+action_355 (201) = happyShift action_66
+action_355 (204) = happyShift action_67
+action_355 (211) = happyShift action_158
+action_355 (216) = happyShift action_68
+action_355 (218) = happyShift action_130
+action_355 (219) = happyShift action_69
+action_355 (220) = happyShift action_70
+action_355 (223) = happyShift action_71
+action_355 (233) = happyShift action_72
+action_355 (234) = happyShift action_73
+action_355 (235) = happyShift action_74
+action_355 (236) = happyShift action_75
+action_355 (237) = happyShift action_76
+action_355 (238) = happyShift action_77
+action_355 (240) = happyShift action_132
+action_355 (241) = happyShift action_133
+action_355 (242) = happyShift action_134
+action_355 (246) = happyShift action_78
+action_355 (251) = happyShift action_79
+action_355 (252) = happyShift action_80
+action_355 (253) = happyShift action_81
+action_355 (254) = happyShift action_82
+action_355 (255) = happyShift action_83
+action_355 (256) = happyShift action_84
+action_355 (257) = happyShift action_85
+action_355 (258) = happyShift action_136
+action_355 (263) = happyShift action_159
+action_355 (264) = happyShift action_140
+action_355 (267) = happyShift action_86
+action_355 (268) = happyShift action_160
+action_355 (275) = happyShift action_161
+action_355 (276) = happyShift action_146
+action_355 (284) = happyShift action_87
+action_355 (88) = happyGoto action_387
+action_355 (89) = happyGoto action_154
+action_355 (90) = happyGoto action_155
+action_355 (91) = happyGoto action_156
+action_355 (92) = happyGoto action_157
+action_355 (93) = happyGoto action_123
+action_355 (94) = happyGoto action_124
+action_355 (97) = happyGoto action_125
+action_355 (98) = happyGoto action_37
+action_355 (99) = happyGoto action_38
+action_355 (100) = happyGoto action_126
+action_355 (107) = happyGoto action_39
+action_355 (115) = happyGoto action_127
+action_355 (136) = happyGoto action_43
+action_355 (139) = happyGoto action_44
+action_355 (140) = happyGoto action_45
+action_355 (142) = happyGoto action_46
+action_355 (152) = happyGoto action_47
+action_355 (153) = happyGoto action_48
+action_355 (154) = happyGoto action_49
+action_355 (155) = happyGoto action_50
+action_355 (156) = happyGoto action_51
+action_355 (157) = happyGoto action_52
+action_355 (165) = happyGoto action_53
+action_355 (166) = happyGoto action_54
+action_355 _ = happyReduce_404
+
+action_356 (177) = happyShift action_114
+action_356 (193) = happyShift action_386
+action_356 (251) = happyShift action_79
+action_356 (252) = happyShift action_80
+action_356 (253) = happyShift action_81
+action_356 (254) = happyShift action_82
+action_356 (255) = happyShift action_83
+action_356 (256) = happyShift action_84
+action_356 (257) = happyShift action_85
+action_356 (267) = happyShift action_86
+action_356 (284) = happyShift action_87
+action_356 (137) = happyGoto action_385
+action_356 (153) = happyGoto action_48
+action_356 (154) = happyGoto action_372
+action_356 _ = happyFail
+
+action_357 (177) = happyShift action_114
+action_357 (179) = happyShift action_57
+action_357 (180) = happyShift action_58
+action_357 (181) = happyShift action_115
+action_357 (182) = happyShift action_60
+action_357 (193) = happyShift action_175
+action_357 (195) = happyShift action_176
+action_357 (201) = happyShift action_177
+action_357 (251) = happyShift action_79
+action_357 (252) = happyShift action_80
+action_357 (253) = happyShift action_81
+action_357 (254) = happyShift action_82
+action_357 (255) = happyShift action_83
+action_357 (256) = happyShift action_84
+action_357 (257) = happyShift action_85
+action_357 (266) = happyShift action_178
+action_357 (267) = happyShift action_86
+action_357 (284) = happyShift action_87
+action_357 (46) = happyGoto action_164
+action_357 (47) = happyGoto action_165
+action_357 (48) = happyGoto action_166
+action_357 (49) = happyGoto action_167
+action_357 (50) = happyGoto action_168
+action_357 (52) = happyGoto action_384
+action_357 (53) = happyGoto action_170
+action_357 (140) = happyGoto action_171
+action_357 (153) = happyGoto action_48
+action_357 (154) = happyGoto action_172
+action_357 (155) = happyGoto action_50
+action_357 (156) = happyGoto action_173
+action_357 (157) = happyGoto action_52
+action_357 (174) = happyGoto action_174
+action_357 _ = happyFail
+
+action_358 (184) = happyShift action_262
+action_358 (185) = happyShift action_211
+action_358 (205) = happyShift action_383
+action_358 (206) = happyShift action_264
+action_358 (218) = happyShift action_266
+action_358 (219) = happyShift action_267
+action_358 (31) = happyGoto action_377
+action_358 (143) = happyGoto action_378
+action_358 (146) = happyGoto action_379
+action_358 (148) = happyGoto action_380
+action_358 (159) = happyGoto action_381
+action_358 (162) = happyGoto action_382
+action_358 _ = happyFail
+
+action_359 _ = happyReduce_59
+
+action_360 _ = happyReduce_6
+
+action_361 _ = happyReduce_32
+
+action_362 (177) = happyShift action_114
+action_362 (181) = happyShift action_115
+action_362 (193) = happyShift action_374
+action_362 (194) = happyShift action_375
+action_362 (207) = happyShift action_376
+action_362 (251) = happyShift action_79
+action_362 (252) = happyShift action_80
+action_362 (253) = happyShift action_81
+action_362 (254) = happyShift action_82
+action_362 (255) = happyShift action_83
+action_362 (256) = happyShift action_84
+action_362 (257) = happyShift action_85
+action_362 (267) = happyShift action_86
+action_362 (284) = happyShift action_87
+action_362 (26) = happyGoto action_368
+action_362 (27) = happyGoto action_369
+action_362 (137) = happyGoto action_370
+action_362 (141) = happyGoto action_371
+action_362 (153) = happyGoto action_48
+action_362 (154) = happyGoto action_372
+action_362 (157) = happyGoto action_373
+action_362 _ = happyFail
+
+action_363 (194) = happyShift action_367
+action_363 _ = happyFail
+
+action_364 (177) = happyShift action_114
+action_364 (178) = happyShift action_56
+action_364 (181) = happyShift action_115
+action_364 (182) = happyShift action_60
+action_364 (193) = happyShift action_116
+action_364 (251) = happyShift action_79
+action_364 (252) = happyShift action_80
+action_364 (253) = happyShift action_81
+action_364 (254) = happyShift action_82
+action_364 (255) = happyShift action_83
+action_364 (256) = happyShift action_84
+action_364 (257) = happyShift action_85
+action_364 (267) = happyShift action_86
+action_364 (277) = happyShift action_118
+action_364 (284) = happyShift action_87
+action_364 (16) = happyGoto action_366
+action_364 (139) = happyGoto action_111
+action_364 (152) = happyGoto action_47
+action_364 (153) = happyGoto action_48
+action_364 (154) = happyGoto action_49
+action_364 (156) = happyGoto action_112
+action_364 (157) = happyGoto action_52
+action_364 (172) = happyGoto action_113
+action_364 _ = happyReduce_23
+
+action_365 _ = happyReduce_22
+
+action_366 _ = happyReduce_25
+
+action_367 _ = happyReduce_21
+
+action_368 (194) = happyShift action_560
+action_368 (203) = happyShift action_561
+action_368 _ = happyFail
+
+action_369 _ = happyReduce_54
+
+action_370 _ = happyReduce_55
+
+action_371 _ = happyReduce_56
+
+action_372 _ = happyReduce_338
+
+action_373 _ = happyReduce_345
+
+action_374 (184) = happyShift action_262
+action_374 (185) = happyShift action_211
+action_374 (206) = happyShift action_264
+action_374 (218) = happyShift action_266
+action_374 (219) = happyShift action_267
+action_374 (159) = happyGoto action_559
+action_374 (162) = happyGoto action_554
+action_374 _ = happyFail
+
+action_375 _ = happyReduce_30
+
+action_376 (194) = happyShift action_558
+action_376 _ = happyFail
+
+action_377 (203) = happyShift action_557
+action_377 _ = happyReduce_57
+
+action_378 _ = happyReduce_359
+
+action_379 _ = happyReduce_360
+
+action_380 _ = happyReduce_64
+
+action_381 _ = happyReduce_355
+
+action_382 _ = happyReduce_349
+
+action_383 (177) = happyShift action_114
+action_383 (181) = happyShift action_115
+action_383 (251) = happyShift action_79
+action_383 (252) = happyShift action_80
+action_383 (253) = happyShift action_81
+action_383 (254) = happyShift action_82
+action_383 (255) = happyShift action_83
+action_383 (256) = happyShift action_84
+action_383 (257) = happyShift action_85
+action_383 (267) = happyShift action_86
+action_383 (284) = happyShift action_87
+action_383 (153) = happyGoto action_48
+action_383 (154) = happyGoto action_555
+action_383 (157) = happyGoto action_556
+action_383 _ = happyFail
+
+action_384 _ = happyReduce_91
+
+action_385 _ = happyReduce_95
+
+action_386 (184) = happyShift action_262
+action_386 (206) = happyShift action_264
+action_386 (218) = happyShift action_266
+action_386 (219) = happyShift action_267
+action_386 (162) = happyGoto action_554
+action_386 _ = happyFail
+
+action_387 _ = happyReduce_189
+
+action_388 (177) = happyShift action_114
+action_388 (178) = happyShift action_56
+action_388 (179) = happyShift action_57
+action_388 (180) = happyShift action_58
+action_388 (181) = happyShift action_115
+action_388 (182) = happyShift action_60
+action_388 (183) = happyShift action_129
+action_388 (188) = happyShift action_61
+action_388 (189) = happyShift action_62
+action_388 (190) = happyShift action_63
+action_388 (191) = happyShift action_64
+action_388 (193) = happyShift action_65
+action_388 (201) = happyShift action_66
+action_388 (204) = happyShift action_67
+action_388 (211) = happyShift action_158
+action_388 (216) = happyShift action_68
+action_388 (218) = happyShift action_130
+action_388 (219) = happyShift action_69
+action_388 (220) = happyShift action_70
+action_388 (223) = happyShift action_71
+action_388 (233) = happyShift action_72
+action_388 (234) = happyShift action_73
+action_388 (235) = happyShift action_74
+action_388 (236) = happyShift action_75
+action_388 (237) = happyShift action_76
+action_388 (238) = happyShift action_77
+action_388 (240) = happyShift action_132
+action_388 (241) = happyShift action_133
+action_388 (242) = happyShift action_134
+action_388 (246) = happyShift action_78
+action_388 (251) = happyShift action_79
+action_388 (252) = happyShift action_80
+action_388 (253) = happyShift action_81
+action_388 (254) = happyShift action_82
+action_388 (255) = happyShift action_83
+action_388 (256) = happyShift action_84
+action_388 (257) = happyShift action_85
+action_388 (258) = happyShift action_136
+action_388 (263) = happyShift action_159
+action_388 (264) = happyShift action_140
+action_388 (267) = happyShift action_86
+action_388 (268) = happyShift action_160
+action_388 (275) = happyShift action_457
+action_388 (276) = happyShift action_146
+action_388 (284) = happyShift action_87
+action_388 (88) = happyGoto action_453
+action_388 (89) = happyGoto action_154
+action_388 (90) = happyGoto action_155
+action_388 (91) = happyGoto action_412
+action_388 (92) = happyGoto action_157
+action_388 (93) = happyGoto action_123
+action_388 (94) = happyGoto action_124
+action_388 (97) = happyGoto action_125
+action_388 (98) = happyGoto action_37
+action_388 (99) = happyGoto action_38
+action_388 (100) = happyGoto action_126
+action_388 (107) = happyGoto action_39
+action_388 (115) = happyGoto action_127
+action_388 (118) = happyGoto action_553
+action_388 (119) = happyGoto action_455
+action_388 (127) = happyGoto action_456
+action_388 (136) = happyGoto action_43
+action_388 (139) = happyGoto action_44
+action_388 (140) = happyGoto action_45
+action_388 (142) = happyGoto action_46
+action_388 (152) = happyGoto action_47
+action_388 (153) = happyGoto action_48
+action_388 (154) = happyGoto action_49
+action_388 (155) = happyGoto action_50
+action_388 (156) = happyGoto action_51
+action_388 (157) = happyGoto action_52
+action_388 (165) = happyGoto action_53
+action_388 (166) = happyGoto action_54
+action_388 _ = happyReduce_404
+
+action_389 _ = happyReduce_201
+
+action_390 _ = happyReduce_191
+
+action_391 _ = happyReduce_186
+
+action_392 (198) = happyShift action_311
+action_392 (39) = happyGoto action_308
+action_392 (41) = happyGoto action_552
+action_392 (167) = happyGoto action_310
+action_392 _ = happyReduce_405
+
+action_393 (177) = happyReduce_249
+action_393 (178) = happyReduce_249
+action_393 (179) = happyReduce_249
+action_393 (180) = happyReduce_249
+action_393 (181) = happyReduce_249
+action_393 (182) = happyReduce_249
+action_393 (184) = happyReduce_249
+action_393 (185) = happyReduce_249
+action_393 (186) = happyReduce_249
+action_393 (187) = happyReduce_249
+action_393 (188) = happyReduce_249
+action_393 (189) = happyReduce_249
+action_393 (190) = happyReduce_249
+action_393 (191) = happyReduce_249
+action_393 (193) = happyReduce_249
+action_393 (198) = happyReduce_249
+action_393 (201) = happyReduce_249
+action_393 (204) = happyReduce_249
+action_393 (205) = happyReduce_249
+action_393 (206) = happyReduce_249
+action_393 (208) = happyReduce_249
+action_393 (210) = happyReduce_249
+action_393 (212) = happyReduce_249
+action_393 (216) = happyReduce_249
+action_393 (218) = happyReduce_249
+action_393 (219) = happyReduce_249
+action_393 (220) = happyReduce_249
+action_393 (221) = happyReduce_249
+action_393 (223) = happyReduce_249
+action_393 (225) = happyReduce_249
+action_393 (226) = happyReduce_249
+action_393 (227) = happyReduce_249
+action_393 (228) = happyReduce_249
+action_393 (229) = happyReduce_249
+action_393 (230) = happyReduce_249
+action_393 (233) = happyReduce_249
+action_393 (234) = happyReduce_249
+action_393 (235) = happyReduce_249
+action_393 (236) = happyReduce_249
+action_393 (237) = happyReduce_249
+action_393 (238) = happyReduce_249
+action_393 (244) = happyReduce_249
+action_393 (246) = happyReduce_249
+action_393 (251) = happyReduce_249
+action_393 (252) = happyReduce_249
+action_393 (253) = happyReduce_249
+action_393 (254) = happyReduce_249
+action_393 (255) = happyReduce_249
+action_393 (256) = happyReduce_249
+action_393 (257) = happyReduce_249
+action_393 (267) = happyReduce_249
+action_393 (284) = happyReduce_249
+action_393 _ = happyReduce_75
+
+action_394 (194) = happyShift action_249
+action_394 _ = happyFail
+
+action_395 (252) = happyShift action_549
+action_395 (253) = happyShift action_550
+action_395 (254) = happyShift action_551
+action_395 (44) = happyGoto action_548
+action_395 _ = happyReduce_102
+
+action_396 _ = happyReduce_97
+
+action_397 _ = happyReduce_98
+
+action_398 (177) = happyShift action_114
+action_398 (191) = happyShift action_546
+action_398 (193) = happyShift action_547
+action_398 (251) = happyShift action_79
+action_398 (255) = happyShift action_83
+action_398 (256) = happyShift action_84
+action_398 (257) = happyShift action_85
+action_398 (267) = happyShift action_86
+action_398 (284) = happyShift action_87
+action_398 (45) = happyGoto action_543
+action_398 (138) = happyGoto action_544
+action_398 (153) = happyGoto action_545
+action_398 _ = happyFail
+
+action_399 (198) = happyShift action_542
+action_399 (120) = happyGoto action_540
+action_399 (167) = happyGoto action_541
+action_399 _ = happyReduce_405
+
+action_400 (282) = happyShift action_539
+action_400 (79) = happyGoto action_538
+action_400 _ = happyReduce_178
+
+action_401 (57) = happyGoto action_535
+action_401 (59) = happyGoto action_536
+action_401 (60) = happyGoto action_537
+action_401 _ = happyReduce_134
+
+action_402 (262) = happyShift action_534
+action_402 (77) = happyGoto action_533
+action_402 _ = happyReduce_171
+
+action_403 (66) = happyGoto action_531
+action_403 (67) = happyGoto action_532
+action_403 (166) = happyGoto action_516
+action_403 _ = happyReduce_404
+
+action_404 (198) = happyShift action_530
+action_404 (61) = happyGoto action_528
+action_404 (167) = happyGoto action_529
+action_404 _ = happyReduce_405
+
+action_405 (194) = happyShift action_527
+action_405 _ = happyFail
+
+action_406 (203) = happyReduce_130
+action_406 _ = happyReduce_80
+
+action_407 _ = happyReduce_79
+
+action_408 (257) = happyShift action_526
+action_408 (20) = happyGoto action_525
+action_408 _ = happyReduce_39
+
+action_409 _ = happyReduce_73
+
+action_410 (198) = happyShift action_524
+action_410 (167) = happyGoto action_523
+action_410 _ = happyReduce_405
+
+action_411 (197) = happyShift action_522
+action_411 _ = happyReduce_324
+
+action_412 (184) = happyShift action_262
+action_412 (185) = happyShift action_211
+action_412 (186) = happyShift action_212
+action_412 (187) = happyShift action_213
+action_412 (205) = happyShift action_263
+action_412 (206) = happyShift action_264
+action_412 (208) = happyShift action_218
+action_412 (209) = happyShift action_265
+action_412 (213) = happyReduce_316
+action_412 (218) = happyShift action_266
+action_412 (219) = happyShift action_267
+action_412 (283) = happyShift action_268
+action_412 (144) = happyGoto action_256
+action_412 (147) = happyGoto action_257
+action_412 (149) = happyGoto action_281
+action_412 (151) = happyGoto action_259
+action_412 (158) = happyGoto action_203
+action_412 (159) = happyGoto action_204
+action_412 (160) = happyGoto action_260
+action_412 (162) = happyGoto action_207
+action_412 (164) = happyGoto action_261
+action_412 _ = happyReduce_198
+
+action_413 (166) = happyGoto action_521
+action_413 _ = happyReduce_404
+
+action_414 (199) = happyShift action_520
+action_414 _ = happyFail
+
+action_415 (177) = happyShift action_114
+action_415 (178) = happyShift action_56
+action_415 (179) = happyShift action_57
+action_415 (180) = happyShift action_58
+action_415 (181) = happyShift action_115
+action_415 (182) = happyShift action_60
+action_415 (183) = happyShift action_129
+action_415 (188) = happyShift action_61
+action_415 (189) = happyShift action_62
+action_415 (190) = happyShift action_63
+action_415 (191) = happyShift action_64
+action_415 (193) = happyShift action_65
+action_415 (197) = happyShift action_415
+action_415 (201) = happyShift action_66
+action_415 (204) = happyShift action_67
+action_415 (211) = happyShift action_158
+action_415 (216) = happyShift action_68
+action_415 (218) = happyShift action_130
+action_415 (219) = happyShift action_69
+action_415 (220) = happyShift action_70
+action_415 (223) = happyShift action_71
+action_415 (233) = happyShift action_72
+action_415 (234) = happyShift action_73
+action_415 (235) = happyShift action_74
+action_415 (236) = happyShift action_75
+action_415 (237) = happyShift action_76
+action_415 (238) = happyShift action_77
+action_415 (240) = happyShift action_132
+action_415 (241) = happyShift action_133
+action_415 (242) = happyShift action_134
+action_415 (246) = happyShift action_78
+action_415 (251) = happyShift action_79
+action_415 (252) = happyShift action_80
+action_415 (253) = happyShift action_81
+action_415 (254) = happyShift action_82
+action_415 (255) = happyShift action_83
+action_415 (256) = happyShift action_84
+action_415 (257) = happyShift action_85
+action_415 (258) = happyShift action_136
+action_415 (263) = happyShift action_159
+action_415 (264) = happyShift action_140
+action_415 (267) = happyShift action_86
+action_415 (268) = happyShift action_160
+action_415 (275) = happyShift action_416
+action_415 (276) = happyShift action_146
+action_415 (284) = happyShift action_87
+action_415 (88) = happyGoto action_411
+action_415 (89) = happyGoto action_154
+action_415 (90) = happyGoto action_155
+action_415 (91) = happyGoto action_412
+action_415 (92) = happyGoto action_157
+action_415 (93) = happyGoto action_123
+action_415 (94) = happyGoto action_124
+action_415 (97) = happyGoto action_125
+action_415 (98) = happyGoto action_37
+action_415 (99) = happyGoto action_38
+action_415 (100) = happyGoto action_126
+action_415 (107) = happyGoto action_39
+action_415 (115) = happyGoto action_127
+action_415 (127) = happyGoto action_413
+action_415 (129) = happyGoto action_519
+action_415 (136) = happyGoto action_43
+action_415 (139) = happyGoto action_44
+action_415 (140) = happyGoto action_45
+action_415 (142) = happyGoto action_46
+action_415 (152) = happyGoto action_47
+action_415 (153) = happyGoto action_48
+action_415 (154) = happyGoto action_49
+action_415 (155) = happyGoto action_50
+action_415 (156) = happyGoto action_51
+action_415 (157) = happyGoto action_52
+action_415 (165) = happyGoto action_53
+action_415 (166) = happyGoto action_54
+action_415 _ = happyReduce_404
+
+action_416 (198) = happyShift action_311
+action_416 (39) = happyGoto action_308
+action_416 (41) = happyGoto action_518
+action_416 (167) = happyGoto action_310
+action_416 _ = happyReduce_405
+
+action_417 (1) = happyShift action_90
+action_417 (200) = happyShift action_91
+action_417 (168) = happyGoto action_517
+action_417 _ = happyFail
+
+action_418 (67) = happyGoto action_515
+action_418 (166) = happyGoto action_516
+action_418 _ = happyReduce_404
+
+action_419 (177) = happyShift action_114
+action_419 (251) = happyShift action_79
+action_419 (252) = happyShift action_80
+action_419 (253) = happyShift action_81
+action_419 (254) = happyShift action_82
+action_419 (255) = happyShift action_83
+action_419 (256) = happyShift action_84
+action_419 (257) = happyShift action_85
+action_419 (267) = happyShift action_86
+action_419 (284) = happyShift action_87
+action_419 (153) = happyGoto action_48
+action_419 (154) = happyGoto action_172
+action_419 (174) = happyGoto action_449
+action_419 _ = happyReduce_132
+
+action_420 (177) = happyShift action_114
+action_420 (179) = happyShift action_57
+action_420 (180) = happyShift action_58
+action_420 (181) = happyShift action_115
+action_420 (182) = happyShift action_60
+action_420 (193) = happyShift action_175
+action_420 (195) = happyShift action_176
+action_420 (201) = happyShift action_177
+action_420 (251) = happyShift action_79
+action_420 (252) = happyShift action_80
+action_420 (253) = happyShift action_81
+action_420 (254) = happyShift action_82
+action_420 (255) = happyShift action_83
+action_420 (256) = happyShift action_84
+action_420 (257) = happyShift action_85
+action_420 (266) = happyShift action_178
+action_420 (267) = happyShift action_86
+action_420 (284) = happyShift action_87
+action_420 (46) = happyGoto action_164
+action_420 (47) = happyGoto action_165
+action_420 (48) = happyGoto action_166
+action_420 (49) = happyGoto action_167
+action_420 (50) = happyGoto action_168
+action_420 (52) = happyGoto action_514
+action_420 (53) = happyGoto action_170
+action_420 (140) = happyGoto action_171
+action_420 (153) = happyGoto action_48
+action_420 (154) = happyGoto action_172
+action_420 (155) = happyGoto action_50
+action_420 (156) = happyGoto action_173
+action_420 (157) = happyGoto action_52
+action_420 (174) = happyGoto action_174
+action_420 _ = happyFail
+
+action_421 (177) = happyShift action_114
+action_421 (178) = happyShift action_56
+action_421 (179) = happyShift action_57
+action_421 (180) = happyShift action_58
+action_421 (181) = happyShift action_115
+action_421 (182) = happyShift action_60
+action_421 (188) = happyShift action_61
+action_421 (189) = happyShift action_62
+action_421 (190) = happyShift action_63
+action_421 (191) = happyShift action_64
+action_421 (193) = happyShift action_65
+action_421 (201) = happyShift action_66
+action_421 (204) = happyShift action_67
+action_421 (214) = happyShift action_513
+action_421 (216) = happyShift action_68
+action_421 (219) = happyShift action_69
+action_421 (220) = happyShift action_70
+action_421 (223) = happyShift action_71
+action_421 (233) = happyShift action_72
+action_421 (234) = happyShift action_73
+action_421 (235) = happyShift action_74
+action_421 (236) = happyShift action_75
+action_421 (237) = happyShift action_76
+action_421 (238) = happyShift action_77
+action_421 (246) = happyShift action_78
+action_421 (251) = happyShift action_79
+action_421 (252) = happyShift action_80
+action_421 (253) = happyShift action_81
+action_421 (254) = happyShift action_82
+action_421 (255) = happyShift action_83
+action_421 (256) = happyShift action_84
+action_421 (257) = happyShift action_85
+action_421 (267) = happyShift action_86
+action_421 (284) = happyShift action_87
+action_421 (96) = happyGoto action_512
+action_421 (97) = happyGoto action_423
+action_421 (98) = happyGoto action_37
+action_421 (99) = happyGoto action_38
+action_421 (107) = happyGoto action_39
+action_421 (136) = happyGoto action_43
+action_421 (139) = happyGoto action_44
+action_421 (140) = happyGoto action_45
+action_421 (142) = happyGoto action_46
+action_421 (152) = happyGoto action_47
+action_421 (153) = happyGoto action_48
+action_421 (154) = happyGoto action_49
+action_421 (155) = happyGoto action_50
+action_421 (156) = happyGoto action_51
+action_421 (157) = happyGoto action_52
+action_421 (165) = happyGoto action_53
+action_421 (166) = happyGoto action_54
+action_421 _ = happyReduce_404
+
+action_422 _ = happyReduce_217
+
+action_423 _ = happyReduce_218
+
+action_424 (197) = happyShift action_102
+action_424 (134) = happyGoto action_504
+action_424 (135) = happyGoto action_505
+action_424 (166) = happyGoto action_511
+action_424 _ = happyReduce_404
+
+action_425 (199) = happyShift action_510
+action_425 _ = happyFail
+
+action_426 (1) = happyShift action_90
+action_426 (200) = happyShift action_91
+action_426 (168) = happyGoto action_509
+action_426 _ = happyFail
+
+action_427 (177) = happyShift action_114
+action_427 (178) = happyShift action_56
+action_427 (179) = happyShift action_57
+action_427 (180) = happyShift action_58
+action_427 (181) = happyShift action_115
+action_427 (182) = happyShift action_60
+action_427 (183) = happyShift action_129
+action_427 (188) = happyShift action_61
+action_427 (189) = happyShift action_62
+action_427 (190) = happyShift action_63
+action_427 (191) = happyShift action_64
+action_427 (193) = happyShift action_65
+action_427 (201) = happyShift action_66
+action_427 (204) = happyShift action_67
+action_427 (211) = happyShift action_158
+action_427 (216) = happyShift action_68
+action_427 (218) = happyShift action_130
+action_427 (219) = happyShift action_69
+action_427 (220) = happyShift action_70
+action_427 (223) = happyShift action_71
+action_427 (233) = happyShift action_72
+action_427 (234) = happyShift action_73
+action_427 (235) = happyShift action_74
+action_427 (236) = happyShift action_75
+action_427 (237) = happyShift action_76
+action_427 (238) = happyShift action_77
+action_427 (240) = happyShift action_132
+action_427 (241) = happyShift action_133
+action_427 (242) = happyShift action_134
+action_427 (246) = happyShift action_78
+action_427 (251) = happyShift action_79
+action_427 (252) = happyShift action_80
+action_427 (253) = happyShift action_81
+action_427 (254) = happyShift action_82
+action_427 (255) = happyShift action_83
+action_427 (256) = happyShift action_84
+action_427 (257) = happyShift action_85
+action_427 (258) = happyShift action_136
+action_427 (263) = happyShift action_159
+action_427 (264) = happyShift action_140
+action_427 (267) = happyShift action_86
+action_427 (268) = happyShift action_160
+action_427 (275) = happyShift action_161
+action_427 (276) = happyShift action_146
+action_427 (284) = happyShift action_87
+action_427 (88) = happyGoto action_508
+action_427 (89) = happyGoto action_154
+action_427 (90) = happyGoto action_155
+action_427 (91) = happyGoto action_156
+action_427 (92) = happyGoto action_157
+action_427 (93) = happyGoto action_123
+action_427 (94) = happyGoto action_124
+action_427 (97) = happyGoto action_125
+action_427 (98) = happyGoto action_37
+action_427 (99) = happyGoto action_38
+action_427 (100) = happyGoto action_126
+action_427 (107) = happyGoto action_39
+action_427 (115) = happyGoto action_127
+action_427 (136) = happyGoto action_43
+action_427 (139) = happyGoto action_44
+action_427 (140) = happyGoto action_45
+action_427 (142) = happyGoto action_46
+action_427 (152) = happyGoto action_47
+action_427 (153) = happyGoto action_48
+action_427 (154) = happyGoto action_49
+action_427 (155) = happyGoto action_50
+action_427 (156) = happyGoto action_51
+action_427 (157) = happyGoto action_52
+action_427 (165) = happyGoto action_53
+action_427 (166) = happyGoto action_54
+action_427 _ = happyReduce_404
+
+action_428 (177) = happyShift action_114
+action_428 (178) = happyShift action_56
+action_428 (179) = happyShift action_57
+action_428 (180) = happyShift action_58
+action_428 (181) = happyShift action_115
+action_428 (182) = happyShift action_60
+action_428 (183) = happyShift action_129
+action_428 (188) = happyShift action_61
+action_428 (189) = happyShift action_62
+action_428 (190) = happyShift action_63
+action_428 (191) = happyShift action_64
+action_428 (193) = happyShift action_65
+action_428 (201) = happyShift action_66
+action_428 (204) = happyShift action_67
+action_428 (211) = happyShift action_158
+action_428 (216) = happyShift action_68
+action_428 (218) = happyShift action_130
+action_428 (219) = happyShift action_69
+action_428 (220) = happyShift action_70
+action_428 (223) = happyShift action_71
+action_428 (233) = happyShift action_72
+action_428 (234) = happyShift action_73
+action_428 (235) = happyShift action_74
+action_428 (236) = happyShift action_75
+action_428 (237) = happyShift action_76
+action_428 (238) = happyShift action_77
+action_428 (240) = happyShift action_132
+action_428 (241) = happyShift action_133
+action_428 (242) = happyShift action_134
+action_428 (246) = happyShift action_78
+action_428 (251) = happyShift action_79
+action_428 (252) = happyShift action_80
+action_428 (253) = happyShift action_81
+action_428 (254) = happyShift action_82
+action_428 (255) = happyShift action_83
+action_428 (256) = happyShift action_84
+action_428 (257) = happyShift action_85
+action_428 (258) = happyShift action_136
+action_428 (263) = happyShift action_159
+action_428 (264) = happyShift action_140
+action_428 (267) = happyShift action_86
+action_428 (268) = happyShift action_160
+action_428 (275) = happyShift action_161
+action_428 (276) = happyShift action_146
+action_428 (284) = happyShift action_87
+action_428 (88) = happyGoto action_507
+action_428 (89) = happyGoto action_154
+action_428 (90) = happyGoto action_155
+action_428 (91) = happyGoto action_156
+action_428 (92) = happyGoto action_157
+action_428 (93) = happyGoto action_123
+action_428 (94) = happyGoto action_124
+action_428 (97) = happyGoto action_125
+action_428 (98) = happyGoto action_37
+action_428 (99) = happyGoto action_38
+action_428 (100) = happyGoto action_126
+action_428 (107) = happyGoto action_39
+action_428 (115) = happyGoto action_127
+action_428 (136) = happyGoto action_43
+action_428 (139) = happyGoto action_44
+action_428 (140) = happyGoto action_45
+action_428 (142) = happyGoto action_46
+action_428 (152) = happyGoto action_47
+action_428 (153) = happyGoto action_48
+action_428 (154) = happyGoto action_49
+action_428 (155) = happyGoto action_50
+action_428 (156) = happyGoto action_51
+action_428 (157) = happyGoto action_52
+action_428 (165) = happyGoto action_53
+action_428 (166) = happyGoto action_54
+action_428 _ = happyReduce_404
+
+action_429 (177) = happyReduce_404
+action_429 (178) = happyReduce_404
+action_429 (179) = happyReduce_404
+action_429 (180) = happyReduce_404
+action_429 (181) = happyReduce_404
+action_429 (182) = happyReduce_404
+action_429 (183) = happyReduce_404
+action_429 (188) = happyReduce_404
+action_429 (189) = happyReduce_404
+action_429 (190) = happyReduce_404
+action_429 (191) = happyReduce_404
+action_429 (193) = happyReduce_404
+action_429 (197) = happyShift action_102
+action_429 (201) = happyReduce_404
+action_429 (204) = happyReduce_404
+action_429 (216) = happyReduce_404
+action_429 (218) = happyReduce_404
+action_429 (219) = happyReduce_404
+action_429 (220) = happyReduce_404
+action_429 (221) = happyReduce_404
+action_429 (223) = happyReduce_404
+action_429 (233) = happyReduce_404
+action_429 (234) = happyReduce_404
+action_429 (235) = happyReduce_404
+action_429 (236) = happyReduce_404
+action_429 (237) = happyReduce_404
+action_429 (238) = happyReduce_404
+action_429 (240) = happyReduce_404
+action_429 (241) = happyReduce_404
+action_429 (242) = happyReduce_404
+action_429 (244) = happyReduce_404
+action_429 (246) = happyReduce_404
+action_429 (251) = happyReduce_404
+action_429 (252) = happyReduce_404
+action_429 (253) = happyReduce_404
+action_429 (254) = happyReduce_404
+action_429 (255) = happyReduce_404
+action_429 (256) = happyReduce_404
+action_429 (257) = happyReduce_404
+action_429 (258) = happyReduce_404
+action_429 (264) = happyReduce_404
+action_429 (267) = happyReduce_404
+action_429 (271) = happyReduce_404
+action_429 (272) = happyReduce_404
+action_429 (273) = happyReduce_404
+action_429 (276) = happyReduce_404
+action_429 (284) = happyReduce_404
+action_429 (28) = happyGoto action_94
+action_429 (37) = happyGoto action_502
+action_429 (38) = happyGoto action_503
+action_429 (40) = happyGoto action_99
+action_429 (83) = happyGoto action_100
+action_429 (134) = happyGoto action_504
+action_429 (135) = happyGoto action_505
+action_429 (166) = happyGoto action_506
+action_429 _ = happyReduce_83
+
+action_430 (199) = happyShift action_501
+action_430 _ = happyFail
+
+action_431 (199) = happyShift action_500
+action_431 _ = happyFail
+
+action_432 (1) = happyShift action_90
+action_432 (200) = happyShift action_91
+action_432 (168) = happyGoto action_499
+action_432 _ = happyFail
+
+action_433 (1) = happyShift action_90
+action_433 (200) = happyShift action_91
+action_433 (168) = happyGoto action_498
+action_433 _ = happyFail
+
+action_434 (177) = happyShift action_114
+action_434 (178) = happyShift action_56
+action_434 (179) = happyShift action_57
+action_434 (180) = happyShift action_58
+action_434 (181) = happyShift action_115
+action_434 (182) = happyShift action_60
+action_434 (183) = happyShift action_129
+action_434 (188) = happyShift action_61
+action_434 (189) = happyShift action_62
+action_434 (190) = happyShift action_63
+action_434 (191) = happyShift action_64
+action_434 (193) = happyShift action_65
+action_434 (201) = happyShift action_66
+action_434 (204) = happyShift action_67
+action_434 (211) = happyShift action_158
+action_434 (216) = happyShift action_68
+action_434 (218) = happyShift action_130
+action_434 (219) = happyShift action_69
+action_434 (220) = happyShift action_70
+action_434 (223) = happyShift action_71
+action_434 (233) = happyShift action_72
+action_434 (234) = happyShift action_73
+action_434 (235) = happyShift action_74
+action_434 (236) = happyShift action_75
+action_434 (237) = happyShift action_76
+action_434 (238) = happyShift action_77
+action_434 (240) = happyShift action_132
+action_434 (241) = happyShift action_133
+action_434 (242) = happyShift action_134
+action_434 (246) = happyShift action_78
+action_434 (251) = happyShift action_79
+action_434 (252) = happyShift action_80
+action_434 (253) = happyShift action_81
+action_434 (254) = happyShift action_82
+action_434 (255) = happyShift action_83
+action_434 (256) = happyShift action_84
+action_434 (257) = happyShift action_85
+action_434 (258) = happyShift action_136
+action_434 (263) = happyShift action_159
+action_434 (264) = happyShift action_140
+action_434 (267) = happyShift action_86
+action_434 (268) = happyShift action_160
+action_434 (275) = happyShift action_161
+action_434 (276) = happyShift action_146
+action_434 (284) = happyShift action_87
+action_434 (88) = happyGoto action_497
+action_434 (89) = happyGoto action_154
+action_434 (90) = happyGoto action_155
+action_434 (91) = happyGoto action_156
+action_434 (92) = happyGoto action_157
+action_434 (93) = happyGoto action_123
+action_434 (94) = happyGoto action_124
+action_434 (97) = happyGoto action_125
+action_434 (98) = happyGoto action_37
+action_434 (99) = happyGoto action_38
+action_434 (100) = happyGoto action_126
+action_434 (107) = happyGoto action_39
+action_434 (115) = happyGoto action_127
+action_434 (136) = happyGoto action_43
+action_434 (139) = happyGoto action_44
+action_434 (140) = happyGoto action_45
+action_434 (142) = happyGoto action_46
+action_434 (152) = happyGoto action_47
+action_434 (153) = happyGoto action_48
+action_434 (154) = happyGoto action_49
+action_434 (155) = happyGoto action_50
+action_434 (156) = happyGoto action_51
+action_434 (157) = happyGoto action_52
+action_434 (165) = happyGoto action_53
+action_434 (166) = happyGoto action_54
+action_434 _ = happyReduce_404
+
+action_435 _ = happyReduce_108
+
+action_436 (205) = happyShift action_496
+action_436 _ = happyFail
+
+action_437 _ = happyReduce_107
+
+action_438 _ = happyReduce_106
+
+action_439 _ = happyReduce_126
+
+action_440 _ = happyReduce_109
+
+action_441 _ = happyReduce_121
+
+action_442 _ = happyReduce_123
+
+action_443 (177) = happyShift action_114
+action_443 (179) = happyShift action_57
+action_443 (180) = happyShift action_58
+action_443 (181) = happyShift action_115
+action_443 (182) = happyShift action_60
+action_443 (193) = happyShift action_175
+action_443 (195) = happyShift action_176
+action_443 (201) = happyShift action_177
+action_443 (251) = happyShift action_79
+action_443 (252) = happyShift action_80
+action_443 (253) = happyShift action_81
+action_443 (254) = happyShift action_82
+action_443 (255) = happyShift action_83
+action_443 (256) = happyShift action_84
+action_443 (257) = happyShift action_85
+action_443 (267) = happyShift action_86
+action_443 (284) = happyShift action_87
+action_443 (46) = happyGoto action_164
+action_443 (47) = happyGoto action_495
+action_443 (48) = happyGoto action_285
+action_443 (49) = happyGoto action_167
+action_443 (50) = happyGoto action_168
+action_443 (140) = happyGoto action_171
+action_443 (153) = happyGoto action_48
+action_443 (154) = happyGoto action_172
+action_443 (155) = happyGoto action_50
+action_443 (156) = happyGoto action_173
+action_443 (157) = happyGoto action_52
+action_443 (174) = happyGoto action_174
+action_443 _ = happyFail
+
+action_444 _ = happyReduce_115
+
+action_445 _ = happyReduce_118
+
+action_446 _ = happyReduce_116
+
+action_447 (177) = happyShift action_114
+action_447 (179) = happyShift action_57
+action_447 (180) = happyShift action_58
+action_447 (181) = happyShift action_115
+action_447 (182) = happyShift action_60
+action_447 (193) = happyShift action_175
+action_447 (195) = happyShift action_176
+action_447 (201) = happyShift action_177
+action_447 (251) = happyShift action_79
+action_447 (252) = happyShift action_80
+action_447 (253) = happyShift action_81
+action_447 (254) = happyShift action_82
+action_447 (255) = happyShift action_83
+action_447 (256) = happyShift action_84
+action_447 (257) = happyShift action_85
+action_447 (267) = happyShift action_86
+action_447 (284) = happyShift action_87
+action_447 (46) = happyGoto action_164
+action_447 (47) = happyGoto action_494
+action_447 (48) = happyGoto action_285
+action_447 (49) = happyGoto action_167
+action_447 (50) = happyGoto action_168
+action_447 (140) = happyGoto action_171
+action_447 (153) = happyGoto action_48
+action_447 (154) = happyGoto action_172
+action_447 (155) = happyGoto action_50
+action_447 (156) = happyGoto action_173
+action_447 (157) = happyGoto action_52
+action_447 (174) = happyGoto action_174
+action_447 _ = happyFail
+
+action_448 _ = happyReduce_117
+
+action_449 _ = happyReduce_133
+
+action_450 (177) = happyShift action_114
+action_450 (179) = happyShift action_57
+action_450 (180) = happyShift action_58
+action_450 (181) = happyShift action_115
+action_450 (182) = happyShift action_60
+action_450 (193) = happyShift action_175
+action_450 (195) = happyShift action_176
+action_450 (201) = happyShift action_177
+action_450 (251) = happyShift action_79
+action_450 (252) = happyShift action_80
+action_450 (253) = happyShift action_81
+action_450 (254) = happyShift action_82
+action_450 (255) = happyShift action_83
+action_450 (256) = happyShift action_84
+action_450 (257) = happyShift action_85
+action_450 (266) = happyShift action_178
+action_450 (267) = happyShift action_86
+action_450 (284) = happyShift action_87
+action_450 (46) = happyGoto action_164
+action_450 (47) = happyGoto action_165
+action_450 (48) = happyGoto action_166
+action_450 (49) = happyGoto action_167
+action_450 (50) = happyGoto action_168
+action_450 (52) = happyGoto action_493
+action_450 (53) = happyGoto action_170
+action_450 (140) = happyGoto action_171
+action_450 (153) = happyGoto action_48
+action_450 (154) = happyGoto action_172
+action_450 (155) = happyGoto action_50
+action_450 (156) = happyGoto action_173
+action_450 (157) = happyGoto action_52
+action_450 (174) = happyGoto action_174
+action_450 _ = happyFail
+
+action_451 _ = happyReduce_199
+
+action_452 _ = happyReduce_264
+
+action_453 _ = happyReduce_303
+
+action_454 (203) = happyShift action_492
+action_454 _ = happyReduce_297
+
+action_455 _ = happyReduce_301
+
+action_456 (166) = happyGoto action_491
+action_456 _ = happyReduce_404
+
+action_457 (198) = happyShift action_311
+action_457 (39) = happyGoto action_308
+action_457 (41) = happyGoto action_490
+action_457 (167) = happyGoto action_310
+action_457 _ = happyReduce_405
+
+action_458 _ = happyReduce_295
+
+action_459 (207) = happyShift action_489
+action_459 _ = happyReduce_299
+
+action_460 _ = happyReduce_298
+
+action_461 (231) = happyShift action_271
+action_461 _ = happyReduce_269
+
+action_462 _ = happyReduce_268
+
+action_463 _ = happyReduce_263
+
+action_464 _ = happyReduce_195
+
+action_465 (177) = happyShift action_114
+action_465 (179) = happyShift action_57
+action_465 (180) = happyShift action_58
+action_465 (181) = happyShift action_115
+action_465 (182) = happyShift action_60
+action_465 (193) = happyShift action_175
+action_465 (195) = happyShift action_176
+action_465 (201) = happyShift action_177
+action_465 (251) = happyShift action_79
+action_465 (252) = happyShift action_80
+action_465 (253) = happyShift action_81
+action_465 (254) = happyShift action_82
+action_465 (255) = happyShift action_83
+action_465 (256) = happyShift action_84
+action_465 (257) = happyShift action_85
+action_465 (266) = happyShift action_178
+action_465 (267) = happyShift action_86
+action_465 (284) = happyShift action_87
+action_465 (46) = happyGoto action_164
+action_465 (47) = happyGoto action_165
+action_465 (48) = happyGoto action_166
+action_465 (49) = happyGoto action_167
+action_465 (50) = happyGoto action_168
+action_465 (52) = happyGoto action_488
+action_465 (53) = happyGoto action_170
+action_465 (140) = happyGoto action_171
+action_465 (153) = happyGoto action_48
+action_465 (154) = happyGoto action_172
+action_465 (155) = happyGoto action_50
+action_465 (156) = happyGoto action_173
+action_465 (157) = happyGoto action_52
+action_465 (174) = happyGoto action_174
+action_465 _ = happyFail
+
+action_466 (205) = happyShift action_487
+action_466 _ = happyFail
+
+action_467 _ = happyReduce_241
+
+action_468 _ = happyReduce_262
+
+action_469 _ = happyReduce_242
+
+action_470 _ = happyReduce_358
+
+action_471 _ = happyReduce_354
+
+action_472 _ = happyReduce_246
+
+action_473 (177) = happyShift action_55
+action_473 (178) = happyShift action_56
+action_473 (179) = happyShift action_57
+action_473 (180) = happyShift action_58
+action_473 (181) = happyShift action_59
+action_473 (182) = happyShift action_60
+action_473 (183) = happyShift action_17
+action_473 (188) = happyShift action_61
+action_473 (189) = happyShift action_62
+action_473 (190) = happyShift action_63
+action_473 (191) = happyShift action_64
+action_473 (193) = happyShift action_65
+action_473 (201) = happyShift action_66
+action_473 (204) = happyShift action_67
+action_473 (216) = happyShift action_68
+action_473 (219) = happyShift action_69
+action_473 (220) = happyShift action_70
+action_473 (223) = happyShift action_71
+action_473 (233) = happyShift action_72
+action_473 (234) = happyShift action_73
+action_473 (235) = happyShift action_74
+action_473 (236) = happyShift action_75
+action_473 (237) = happyShift action_76
+action_473 (238) = happyShift action_77
+action_473 (246) = happyShift action_78
+action_473 (247) = happyReduce_289
+action_473 (248) = happyReduce_289
+action_473 (251) = happyShift action_79
+action_473 (252) = happyShift action_80
+action_473 (253) = happyShift action_81
+action_473 (254) = happyShift action_82
+action_473 (255) = happyShift action_83
+action_473 (256) = happyShift action_84
+action_473 (257) = happyShift action_85
+action_473 (259) = happyShift action_18
+action_473 (267) = happyShift action_86
+action_473 (281) = happyShift action_19
+action_473 (284) = happyShift action_87
+action_473 (97) = happyGoto action_36
+action_473 (98) = happyGoto action_37
+action_473 (99) = happyGoto action_38
+action_473 (107) = happyGoto action_39
+action_473 (110) = happyGoto action_40
+action_473 (111) = happyGoto action_14
+action_473 (113) = happyGoto action_41
+action_473 (114) = happyGoto action_486
+action_473 (136) = happyGoto action_43
+action_473 (139) = happyGoto action_44
+action_473 (140) = happyGoto action_45
+action_473 (142) = happyGoto action_46
+action_473 (152) = happyGoto action_47
+action_473 (153) = happyGoto action_48
+action_473 (154) = happyGoto action_49
+action_473 (155) = happyGoto action_50
+action_473 (156) = happyGoto action_51
+action_473 (157) = happyGoto action_52
+action_473 (165) = happyGoto action_53
+action_473 (166) = happyGoto action_54
+action_473 _ = happyReduce_404
+
+action_474 _ = happyReduce_277
+
+action_475 _ = happyReduce_273
+
+action_476 (221) = happyShift action_485
+action_476 (244) = happyShift action_222
+action_476 _ = happyFail
+
+action_477 _ = happyReduce_275
+
+action_478 (177) = happyShift action_15
+action_478 (181) = happyShift action_16
+action_478 (183) = happyShift action_17
+action_478 (259) = happyShift action_18
+action_478 (281) = happyShift action_19
+action_478 (110) = happyGoto action_484
+action_478 (111) = happyGoto action_14
+action_478 _ = happyFail
+
+action_479 (177) = happyShift action_114
+action_479 (178) = happyShift action_56
+action_479 (179) = happyShift action_57
+action_479 (180) = happyShift action_58
+action_479 (181) = happyShift action_115
+action_479 (182) = happyShift action_60
+action_479 (183) = happyShift action_129
+action_479 (188) = happyShift action_61
+action_479 (189) = happyShift action_62
+action_479 (190) = happyShift action_63
+action_479 (191) = happyShift action_64
+action_479 (193) = happyShift action_65
+action_479 (201) = happyShift action_66
+action_479 (204) = happyShift action_67
+action_479 (211) = happyShift action_158
+action_479 (216) = happyShift action_68
+action_479 (218) = happyShift action_130
+action_479 (219) = happyShift action_69
+action_479 (220) = happyShift action_70
+action_479 (223) = happyShift action_71
+action_479 (233) = happyShift action_72
+action_479 (234) = happyShift action_73
+action_479 (235) = happyShift action_74
+action_479 (236) = happyShift action_75
+action_479 (237) = happyShift action_76
+action_479 (238) = happyShift action_77
+action_479 (240) = happyShift action_132
+action_479 (241) = happyShift action_133
+action_479 (242) = happyShift action_134
+action_479 (246) = happyShift action_78
+action_479 (251) = happyShift action_79
+action_479 (252) = happyShift action_80
+action_479 (253) = happyShift action_81
+action_479 (254) = happyShift action_82
+action_479 (255) = happyShift action_83
+action_479 (256) = happyShift action_84
+action_479 (257) = happyShift action_85
+action_479 (258) = happyShift action_136
+action_479 (263) = happyShift action_159
+action_479 (264) = happyShift action_140
+action_479 (267) = happyShift action_86
+action_479 (268) = happyShift action_160
+action_479 (275) = happyShift action_161
+action_479 (276) = happyShift action_146
+action_479 (284) = happyShift action_87
+action_479 (88) = happyGoto action_483
+action_479 (89) = happyGoto action_154
+action_479 (90) = happyGoto action_155
+action_479 (91) = happyGoto action_156
+action_479 (92) = happyGoto action_157
+action_479 (93) = happyGoto action_123
+action_479 (94) = happyGoto action_124
+action_479 (97) = happyGoto action_125
+action_479 (98) = happyGoto action_37
+action_479 (99) = happyGoto action_38
+action_479 (100) = happyGoto action_126
+action_479 (107) = happyGoto action_39
+action_479 (115) = happyGoto action_127
+action_479 (136) = happyGoto action_43
+action_479 (139) = happyGoto action_44
+action_479 (140) = happyGoto action_45
+action_479 (142) = happyGoto action_46
+action_479 (152) = happyGoto action_47
+action_479 (153) = happyGoto action_48
+action_479 (154) = happyGoto action_49
+action_479 (155) = happyGoto action_50
+action_479 (156) = happyGoto action_51
+action_479 (157) = happyGoto action_52
+action_479 (165) = happyGoto action_53
+action_479 (166) = happyGoto action_54
+action_479 _ = happyReduce_404
+
+action_480 _ = happyReduce_226
+
+action_481 (177) = happyShift action_114
+action_481 (178) = happyShift action_56
+action_481 (193) = happyShift action_116
+action_481 (251) = happyShift action_79
+action_481 (252) = happyShift action_80
+action_481 (253) = happyShift action_81
+action_481 (254) = happyShift action_82
+action_481 (255) = happyShift action_83
+action_481 (256) = happyShift action_84
+action_481 (257) = happyShift action_85
+action_481 (267) = happyShift action_86
+action_481 (284) = happyShift action_87
+action_481 (131) = happyGoto action_482
+action_481 (139) = happyGoto action_237
+action_481 (152) = happyGoto action_47
+action_481 (153) = happyGoto action_48
+action_481 (154) = happyGoto action_49
+action_481 _ = happyFail
+
+action_482 _ = happyReduce_325
+
+action_483 _ = happyReduce_327
+
+action_484 (247) = happyShift action_616
+action_484 _ = happyFail
+
+action_485 (177) = happyShift action_114
+action_485 (178) = happyShift action_56
+action_485 (179) = happyShift action_57
+action_485 (180) = happyShift action_58
+action_485 (181) = happyShift action_115
+action_485 (182) = happyShift action_60
+action_485 (183) = happyShift action_129
+action_485 (188) = happyShift action_61
+action_485 (189) = happyShift action_62
+action_485 (190) = happyShift action_63
+action_485 (191) = happyShift action_64
+action_485 (193) = happyShift action_65
+action_485 (201) = happyShift action_66
+action_485 (204) = happyShift action_67
+action_485 (211) = happyShift action_158
+action_485 (216) = happyShift action_68
+action_485 (218) = happyShift action_130
+action_485 (219) = happyShift action_69
+action_485 (220) = happyShift action_70
+action_485 (223) = happyShift action_71
+action_485 (233) = happyShift action_72
+action_485 (234) = happyShift action_73
+action_485 (235) = happyShift action_74
+action_485 (236) = happyShift action_75
+action_485 (237) = happyShift action_76
+action_485 (238) = happyShift action_77
+action_485 (240) = happyShift action_132
+action_485 (241) = happyShift action_133
+action_485 (242) = happyShift action_134
+action_485 (246) = happyShift action_78
+action_485 (251) = happyShift action_79
+action_485 (252) = happyShift action_80
+action_485 (253) = happyShift action_81
+action_485 (254) = happyShift action_82
+action_485 (255) = happyShift action_83
+action_485 (256) = happyShift action_84
+action_485 (257) = happyShift action_85
+action_485 (258) = happyShift action_136
+action_485 (263) = happyShift action_159
+action_485 (264) = happyShift action_140
+action_485 (267) = happyShift action_86
+action_485 (268) = happyShift action_160
+action_485 (275) = happyShift action_161
+action_485 (276) = happyShift action_146
+action_485 (284) = happyShift action_87
+action_485 (88) = happyGoto action_183
+action_485 (89) = happyGoto action_154
+action_485 (90) = happyGoto action_155
+action_485 (91) = happyGoto action_156
+action_485 (92) = happyGoto action_157
+action_485 (93) = happyGoto action_123
+action_485 (94) = happyGoto action_124
+action_485 (97) = happyGoto action_125
+action_485 (98) = happyGoto action_37
+action_485 (99) = happyGoto action_38
+action_485 (100) = happyGoto action_126
+action_485 (104) = happyGoto action_615
+action_485 (105) = happyGoto action_185
+action_485 (106) = happyGoto action_186
+action_485 (107) = happyGoto action_39
+action_485 (115) = happyGoto action_127
+action_485 (136) = happyGoto action_43
+action_485 (139) = happyGoto action_44
+action_485 (140) = happyGoto action_45
+action_485 (142) = happyGoto action_46
+action_485 (152) = happyGoto action_47
+action_485 (153) = happyGoto action_48
+action_485 (154) = happyGoto action_49
+action_485 (155) = happyGoto action_50
+action_485 (156) = happyGoto action_51
+action_485 (157) = happyGoto action_52
+action_485 (165) = happyGoto action_53
+action_485 (166) = happyGoto action_54
+action_485 _ = happyReduce_404
+
+action_486 (247) = happyShift action_613
+action_486 (248) = happyShift action_614
+action_486 _ = happyFail
+
+action_487 _ = happyReduce_352
+
+action_488 _ = happyReduce_194
+
+action_489 (177) = happyShift action_114
+action_489 (178) = happyShift action_56
+action_489 (179) = happyShift action_57
+action_489 (180) = happyShift action_58
+action_489 (181) = happyShift action_115
+action_489 (182) = happyShift action_60
+action_489 (183) = happyShift action_129
+action_489 (188) = happyShift action_61
+action_489 (189) = happyShift action_62
+action_489 (190) = happyShift action_63
+action_489 (191) = happyShift action_64
+action_489 (193) = happyShift action_65
+action_489 (201) = happyShift action_66
+action_489 (204) = happyShift action_67
+action_489 (211) = happyShift action_158
+action_489 (216) = happyShift action_68
+action_489 (218) = happyShift action_130
+action_489 (219) = happyShift action_69
+action_489 (220) = happyShift action_70
+action_489 (221) = happyReduce_404
+action_489 (223) = happyShift action_71
+action_489 (233) = happyShift action_72
+action_489 (234) = happyShift action_73
+action_489 (235) = happyShift action_74
+action_489 (236) = happyShift action_75
+action_489 (237) = happyShift action_76
+action_489 (238) = happyShift action_77
+action_489 (240) = happyShift action_132
+action_489 (241) = happyShift action_133
+action_489 (242) = happyShift action_134
+action_489 (244) = happyReduce_404
+action_489 (246) = happyShift action_78
+action_489 (251) = happyShift action_79
+action_489 (252) = happyShift action_80
+action_489 (253) = happyShift action_81
+action_489 (254) = happyShift action_82
+action_489 (255) = happyShift action_83
+action_489 (256) = happyShift action_84
+action_489 (257) = happyShift action_85
+action_489 (258) = happyShift action_136
+action_489 (263) = happyShift action_159
+action_489 (264) = happyShift action_140
+action_489 (267) = happyShift action_86
+action_489 (268) = happyShift action_160
+action_489 (275) = happyShift action_161
+action_489 (276) = happyShift action_146
+action_489 (284) = happyShift action_87
+action_489 (88) = happyGoto action_612
+action_489 (89) = happyGoto action_154
+action_489 (90) = happyGoto action_155
+action_489 (91) = happyGoto action_156
+action_489 (92) = happyGoto action_157
+action_489 (93) = happyGoto action_123
+action_489 (94) = happyGoto action_124
+action_489 (97) = happyGoto action_125
+action_489 (98) = happyGoto action_37
+action_489 (99) = happyGoto action_38
+action_489 (100) = happyGoto action_126
+action_489 (107) = happyGoto action_39
+action_489 (115) = happyGoto action_127
+action_489 (136) = happyGoto action_43
+action_489 (139) = happyGoto action_44
+action_489 (140) = happyGoto action_45
+action_489 (142) = happyGoto action_46
+action_489 (152) = happyGoto action_47
+action_489 (153) = happyGoto action_48
+action_489 (154) = happyGoto action_49
+action_489 (155) = happyGoto action_50
+action_489 (156) = happyGoto action_51
+action_489 (157) = happyGoto action_52
+action_489 (165) = happyGoto action_53
+action_489 (166) = happyGoto action_54
+action_489 _ = happyReduce_294
+
+action_490 (270) = happyShift action_434
+action_490 _ = happyReduce_304
+
+action_491 (213) = happyShift action_611
+action_491 _ = happyFail
+
+action_492 (177) = happyShift action_114
+action_492 (178) = happyShift action_56
+action_492 (179) = happyShift action_57
+action_492 (180) = happyShift action_58
+action_492 (181) = happyShift action_115
+action_492 (182) = happyShift action_60
+action_492 (183) = happyShift action_129
+action_492 (188) = happyShift action_61
+action_492 (189) = happyShift action_62
+action_492 (190) = happyShift action_63
+action_492 (191) = happyShift action_64
+action_492 (193) = happyShift action_65
+action_492 (201) = happyShift action_66
+action_492 (204) = happyShift action_67
+action_492 (211) = happyShift action_158
+action_492 (216) = happyShift action_68
+action_492 (218) = happyShift action_130
+action_492 (219) = happyShift action_69
+action_492 (220) = happyShift action_70
+action_492 (223) = happyShift action_71
+action_492 (233) = happyShift action_72
+action_492 (234) = happyShift action_73
+action_492 (235) = happyShift action_74
+action_492 (236) = happyShift action_75
+action_492 (237) = happyShift action_76
+action_492 (238) = happyShift action_77
+action_492 (240) = happyShift action_132
+action_492 (241) = happyShift action_133
+action_492 (242) = happyShift action_134
+action_492 (246) = happyShift action_78
+action_492 (251) = happyShift action_79
+action_492 (252) = happyShift action_80
+action_492 (253) = happyShift action_81
+action_492 (254) = happyShift action_82
+action_492 (255) = happyShift action_83
+action_492 (256) = happyShift action_84
+action_492 (257) = happyShift action_85
+action_492 (258) = happyShift action_136
+action_492 (263) = happyShift action_159
+action_492 (264) = happyShift action_140
+action_492 (267) = happyShift action_86
+action_492 (268) = happyShift action_160
+action_492 (275) = happyShift action_457
+action_492 (276) = happyShift action_146
+action_492 (284) = happyShift action_87
+action_492 (88) = happyGoto action_453
+action_492 (89) = happyGoto action_154
+action_492 (90) = happyGoto action_155
+action_492 (91) = happyGoto action_412
+action_492 (92) = happyGoto action_157
+action_492 (93) = happyGoto action_123
+action_492 (94) = happyGoto action_124
+action_492 (97) = happyGoto action_125
+action_492 (98) = happyGoto action_37
+action_492 (99) = happyGoto action_38
+action_492 (100) = happyGoto action_126
+action_492 (107) = happyGoto action_39
+action_492 (115) = happyGoto action_127
+action_492 (119) = happyGoto action_610
+action_492 (127) = happyGoto action_456
+action_492 (136) = happyGoto action_43
+action_492 (139) = happyGoto action_44
+action_492 (140) = happyGoto action_45
+action_492 (142) = happyGoto action_46
+action_492 (152) = happyGoto action_47
+action_492 (153) = happyGoto action_48
+action_492 (154) = happyGoto action_49
+action_492 (155) = happyGoto action_50
+action_492 (156) = happyGoto action_51
+action_492 (157) = happyGoto action_52
+action_492 (165) = happyGoto action_53
+action_492 (166) = happyGoto action_54
+action_492 _ = happyReduce_404
+
+action_493 _ = happyReduce_125
+
+action_494 _ = happyReduce_131
+
+action_495 (203) = happyReduce_131
+action_495 _ = happyReduce_129
+
+action_496 _ = happyReduce_415
+
+action_497 _ = happyReduce_205
+
+action_498 _ = happyReduce_94
+
+action_499 _ = happyReduce_90
+
+action_500 _ = happyReduce_93
+
+action_501 _ = happyReduce_89
+
+action_502 (10) = happyGoto action_608
+action_502 (11) = happyGoto action_609
+action_502 _ = happyReduce_18
+
+action_503 _ = happyReduce_85
+
+action_504 (10) = happyGoto action_606
+action_504 (11) = happyGoto action_607
+action_504 _ = happyReduce_18
+
+action_505 _ = happyReduce_332
+
+action_506 (177) = happyShift action_114
+action_506 (178) = happyShift action_56
+action_506 (179) = happyShift action_57
+action_506 (180) = happyShift action_58
+action_506 (181) = happyShift action_115
+action_506 (182) = happyShift action_60
+action_506 (183) = happyShift action_129
+action_506 (188) = happyShift action_61
+action_506 (189) = happyShift action_62
+action_506 (190) = happyShift action_63
+action_506 (191) = happyShift action_64
+action_506 (193) = happyShift action_65
+action_506 (201) = happyShift action_66
+action_506 (204) = happyShift action_67
+action_506 (216) = happyShift action_68
+action_506 (218) = happyShift action_130
+action_506 (219) = happyShift action_69
+action_506 (220) = happyShift action_70
+action_506 (223) = happyShift action_71
+action_506 (233) = happyShift action_72
+action_506 (234) = happyShift action_73
+action_506 (235) = happyShift action_74
+action_506 (236) = happyShift action_75
+action_506 (237) = happyShift action_76
+action_506 (238) = happyShift action_77
+action_506 (240) = happyShift action_132
+action_506 (241) = happyShift action_133
+action_506 (242) = happyShift action_134
+action_506 (246) = happyShift action_78
+action_506 (251) = happyShift action_79
+action_506 (252) = happyShift action_80
+action_506 (253) = happyShift action_81
+action_506 (254) = happyShift action_82
+action_506 (255) = happyShift action_83
+action_506 (256) = happyShift action_84
+action_506 (257) = happyShift action_85
+action_506 (258) = happyShift action_136
+action_506 (264) = happyShift action_140
+action_506 (267) = happyShift action_86
+action_506 (271) = happyShift action_142
+action_506 (272) = happyShift action_143
+action_506 (273) = happyShift action_144
+action_506 (276) = happyShift action_146
+action_506 (284) = happyShift action_87
+action_506 (30) = happyGoto action_120
+action_506 (42) = happyGoto action_121
+action_506 (91) = happyGoto action_122
+action_506 (93) = happyGoto action_123
+action_506 (94) = happyGoto action_124
+action_506 (97) = happyGoto action_125
+action_506 (98) = happyGoto action_37
+action_506 (99) = happyGoto action_38
+action_506 (100) = happyGoto action_126
+action_506 (107) = happyGoto action_39
+action_506 (115) = happyGoto action_127
+action_506 (136) = happyGoto action_43
+action_506 (139) = happyGoto action_128
+action_506 (140) = happyGoto action_605
+action_506 (142) = happyGoto action_46
+action_506 (152) = happyGoto action_47
+action_506 (153) = happyGoto action_48
+action_506 (154) = happyGoto action_49
+action_506 (155) = happyGoto action_50
+action_506 (156) = happyGoto action_51
+action_506 (157) = happyGoto action_52
+action_506 (165) = happyGoto action_53
+action_506 (166) = happyGoto action_54
+action_506 _ = happyReduce_404
+
+action_507 (265) = happyShift action_604
+action_507 _ = happyFail
+
+action_508 _ = happyReduce_206
+
+action_509 _ = happyReduce_329
+
+action_510 _ = happyReduce_328
+
+action_511 (179) = happyShift action_57
+action_511 (180) = happyShift action_58
+action_511 (140) = happyGoto action_603
+action_511 (155) = happyGoto action_50
+action_511 _ = happyFail
+
+action_512 _ = happyReduce_216
+
+action_513 (177) = happyShift action_114
+action_513 (178) = happyShift action_56
+action_513 (179) = happyShift action_57
+action_513 (180) = happyShift action_58
+action_513 (181) = happyShift action_115
+action_513 (182) = happyShift action_60
+action_513 (183) = happyShift action_129
+action_513 (188) = happyShift action_61
+action_513 (189) = happyShift action_62
+action_513 (190) = happyShift action_63
+action_513 (191) = happyShift action_64
+action_513 (193) = happyShift action_65
+action_513 (201) = happyShift action_66
+action_513 (204) = happyShift action_67
+action_513 (211) = happyShift action_158
+action_513 (216) = happyShift action_68
+action_513 (218) = happyShift action_130
+action_513 (219) = happyShift action_69
+action_513 (220) = happyShift action_70
+action_513 (223) = happyShift action_71
+action_513 (233) = happyShift action_72
+action_513 (234) = happyShift action_73
+action_513 (235) = happyShift action_74
+action_513 (236) = happyShift action_75
+action_513 (237) = happyShift action_76
+action_513 (238) = happyShift action_77
+action_513 (240) = happyShift action_132
+action_513 (241) = happyShift action_133
+action_513 (242) = happyShift action_134
+action_513 (246) = happyShift action_78
+action_513 (251) = happyShift action_79
+action_513 (252) = happyShift action_80
+action_513 (253) = happyShift action_81
+action_513 (254) = happyShift action_82
+action_513 (255) = happyShift action_83
+action_513 (256) = happyShift action_84
+action_513 (257) = happyShift action_85
+action_513 (258) = happyShift action_136
+action_513 (263) = happyShift action_159
+action_513 (264) = happyShift action_140
+action_513 (267) = happyShift action_86
+action_513 (268) = happyShift action_160
+action_513 (275) = happyShift action_161
+action_513 (276) = happyShift action_146
+action_513 (284) = happyShift action_87
+action_513 (88) = happyGoto action_602
+action_513 (89) = happyGoto action_154
+action_513 (90) = happyGoto action_155
+action_513 (91) = happyGoto action_156
+action_513 (92) = happyGoto action_157
+action_513 (93) = happyGoto action_123
+action_513 (94) = happyGoto action_124
+action_513 (97) = happyGoto action_125
+action_513 (98) = happyGoto action_37
+action_513 (99) = happyGoto action_38
+action_513 (100) = happyGoto action_126
+action_513 (107) = happyGoto action_39
+action_513 (115) = happyGoto action_127
+action_513 (136) = happyGoto action_43
+action_513 (139) = happyGoto action_44
+action_513 (140) = happyGoto action_45
+action_513 (142) = happyGoto action_46
+action_513 (152) = happyGoto action_47
+action_513 (153) = happyGoto action_48
+action_513 (154) = happyGoto action_49
+action_513 (155) = happyGoto action_50
+action_513 (156) = happyGoto action_51
+action_513 (157) = happyGoto action_52
+action_513 (165) = happyGoto action_53
+action_513 (166) = happyGoto action_54
+action_513 _ = happyReduce_404
+
+action_514 _ = happyReduce_68
+
+action_515 (262) = happyShift action_534
+action_515 (77) = happyGoto action_601
+action_515 _ = happyReduce_171
+
+action_516 (266) = happyShift action_600
+action_516 (68) = happyGoto action_599
+action_516 _ = happyReduce_153
+
+action_517 _ = happyReduce_318
+
+action_518 (197) = happyShift action_598
+action_518 (270) = happyShift action_434
+action_518 _ = happyFail
+
+action_519 _ = happyReduce_322
+
+action_520 _ = happyReduce_317
+
+action_521 (213) = happyShift action_597
+action_521 _ = happyFail
+
+action_522 (177) = happyShift action_114
+action_522 (178) = happyShift action_56
+action_522 (179) = happyShift action_57
+action_522 (180) = happyShift action_58
+action_522 (181) = happyShift action_115
+action_522 (182) = happyShift action_60
+action_522 (183) = happyShift action_129
+action_522 (188) = happyShift action_61
+action_522 (189) = happyShift action_62
+action_522 (190) = happyShift action_63
+action_522 (191) = happyShift action_64
+action_522 (193) = happyShift action_65
+action_522 (197) = happyShift action_415
+action_522 (201) = happyShift action_66
+action_522 (204) = happyShift action_67
+action_522 (211) = happyShift action_158
+action_522 (216) = happyShift action_68
+action_522 (218) = happyShift action_130
+action_522 (219) = happyShift action_69
+action_522 (220) = happyShift action_70
+action_522 (221) = happyReduce_404
+action_522 (223) = happyShift action_71
+action_522 (233) = happyShift action_72
+action_522 (234) = happyShift action_73
+action_522 (235) = happyShift action_74
+action_522 (236) = happyShift action_75
+action_522 (237) = happyShift action_76
+action_522 (238) = happyShift action_77
+action_522 (240) = happyShift action_132
+action_522 (241) = happyShift action_133
+action_522 (242) = happyShift action_134
+action_522 (244) = happyReduce_404
+action_522 (246) = happyShift action_78
+action_522 (251) = happyShift action_79
+action_522 (252) = happyShift action_80
+action_522 (253) = happyShift action_81
+action_522 (254) = happyShift action_82
+action_522 (255) = happyShift action_83
+action_522 (256) = happyShift action_84
+action_522 (257) = happyShift action_85
+action_522 (258) = happyShift action_136
+action_522 (263) = happyShift action_159
+action_522 (264) = happyShift action_140
+action_522 (267) = happyShift action_86
+action_522 (268) = happyShift action_160
+action_522 (275) = happyShift action_416
+action_522 (276) = happyShift action_146
+action_522 (284) = happyShift action_87
+action_522 (88) = happyGoto action_411
+action_522 (89) = happyGoto action_154
+action_522 (90) = happyGoto action_155
+action_522 (91) = happyGoto action_412
+action_522 (92) = happyGoto action_157
+action_522 (93) = happyGoto action_123
+action_522 (94) = happyGoto action_124
+action_522 (97) = happyGoto action_125
+action_522 (98) = happyGoto action_37
+action_522 (99) = happyGoto action_38
+action_522 (100) = happyGoto action_126
+action_522 (107) = happyGoto action_39
+action_522 (115) = happyGoto action_127
+action_522 (127) = happyGoto action_413
+action_522 (129) = happyGoto action_596
+action_522 (136) = happyGoto action_43
+action_522 (139) = happyGoto action_44
+action_522 (140) = happyGoto action_45
+action_522 (142) = happyGoto action_46
+action_522 (152) = happyGoto action_47
+action_522 (153) = happyGoto action_48
+action_522 (154) = happyGoto action_49
+action_522 (155) = happyGoto action_50
+action_522 (156) = happyGoto action_51
+action_522 (157) = happyGoto action_52
+action_522 (165) = happyGoto action_53
+action_522 (166) = happyGoto action_54
+action_522 _ = happyReduce_323
+
+action_523 (10) = happyGoto action_31
+action_523 (11) = happyGoto action_593
+action_523 (81) = happyGoto action_595
+action_523 _ = happyReduce_18
+
+action_524 (10) = happyGoto action_31
+action_524 (11) = happyGoto action_593
+action_524 (81) = happyGoto action_594
+action_524 _ = happyReduce_18
+
+action_525 (193) = happyReduce_45
+action_525 (267) = happyShift action_592
+action_525 (21) = happyGoto action_589
+action_525 (22) = happyGoto action_590
+action_525 (23) = happyGoto action_591
+action_525 _ = happyReduce_41
+
+action_526 (181) = happyShift action_28
+action_526 (182) = happyShift action_29
+action_526 (169) = happyGoto action_588
+action_526 _ = happyFail
+
+action_527 _ = happyReduce_74
+
+action_528 _ = happyReduce_70
+
+action_529 (10) = happyGoto action_31
+action_529 (11) = happyGoto action_585
+action_529 (62) = happyGoto action_587
+action_529 _ = happyReduce_18
+
+action_530 (10) = happyGoto action_31
+action_530 (11) = happyGoto action_585
+action_530 (62) = happyGoto action_586
+action_530 _ = happyReduce_18
+
+action_531 (212) = happyShift action_584
+action_531 _ = happyReduce_147
+
+action_532 _ = happyReduce_149
+
+action_533 _ = happyReduce_69
+
+action_534 (181) = happyShift action_115
+action_534 (182) = happyShift action_60
+action_534 (193) = happyShift action_583
+action_534 (156) = happyGoto action_581
+action_534 (157) = happyGoto action_52
+action_534 (173) = happyGoto action_582
+action_534 _ = happyFail
+
+action_535 (177) = happyShift action_114
+action_535 (214) = happyShift action_580
+action_535 (251) = happyShift action_79
+action_535 (252) = happyShift action_80
+action_535 (253) = happyShift action_81
+action_535 (254) = happyShift action_82
+action_535 (255) = happyShift action_83
+action_535 (256) = happyShift action_84
+action_535 (257) = happyShift action_85
+action_535 (267) = happyShift action_86
+action_535 (284) = happyShift action_87
+action_535 (153) = happyGoto action_48
+action_535 (154) = happyGoto action_172
+action_535 (174) = happyGoto action_449
+action_535 _ = happyFail
+
+action_536 (203) = happyShift action_579
+action_536 _ = happyReduce_136
+
+action_537 _ = happyReduce_138
+
+action_538 _ = happyReduce_72
+
+action_539 (198) = happyShift action_578
+action_539 (39) = happyGoto action_576
+action_539 (167) = happyGoto action_577
+action_539 _ = happyReduce_405
+
+action_540 _ = happyReduce_208
+
+action_541 (10) = happyGoto action_31
+action_541 (11) = happyGoto action_573
+action_541 (121) = happyGoto action_575
+action_541 _ = happyReduce_18
+
+action_542 (10) = happyGoto action_31
+action_542 (11) = happyGoto action_573
+action_542 (121) = happyGoto action_574
+action_542 _ = happyReduce_18
+
+action_543 _ = happyReduce_77
+
+action_544 (209) = happyShift action_572
+action_544 _ = happyFail
+
+action_545 _ = happyReduce_340
+
+action_546 (177) = happyShift action_114
+action_546 (193) = happyShift action_547
+action_546 (251) = happyShift action_79
+action_546 (255) = happyShift action_83
+action_546 (256) = happyShift action_84
+action_546 (257) = happyShift action_85
+action_546 (267) = happyShift action_86
+action_546 (284) = happyShift action_87
+action_546 (138) = happyGoto action_571
+action_546 (153) = happyGoto action_545
+action_546 _ = happyFail
+
+action_547 (184) = happyShift action_262
+action_547 (206) = happyShift action_264
+action_547 (218) = happyShift action_266
+action_547 (219) = happyShift action_267
+action_547 (162) = happyGoto action_570
+action_547 _ = happyFail
+
+action_548 (177) = happyShift action_114
+action_548 (191) = happyShift action_546
+action_548 (193) = happyShift action_547
+action_548 (251) = happyShift action_79
+action_548 (255) = happyShift action_83
+action_548 (256) = happyShift action_84
+action_548 (257) = happyShift action_85
+action_548 (267) = happyShift action_86
+action_548 (284) = happyShift action_87
+action_548 (45) = happyGoto action_569
+action_548 (138) = happyGoto action_544
+action_548 (153) = happyGoto action_545
+action_548 _ = happyFail
+
+action_549 _ = happyReduce_99
+
+action_550 _ = happyReduce_100
+
+action_551 _ = happyReduce_101
+
+action_552 _ = happyReduce_187
+
+action_553 (203) = happyShift action_492
+action_553 (210) = happyShift action_568
+action_553 _ = happyFail
+
+action_554 (194) = happyShift action_567
+action_554 _ = happyFail
+
+action_555 (205) = happyShift action_566
+action_555 _ = happyFail
+
+action_556 (205) = happyShift action_565
+action_556 _ = happyFail
+
+action_557 (184) = happyShift action_262
+action_557 (185) = happyShift action_211
+action_557 (205) = happyShift action_383
+action_557 (206) = happyShift action_264
+action_557 (218) = happyShift action_266
+action_557 (219) = happyShift action_267
+action_557 (143) = happyGoto action_378
+action_557 (146) = happyGoto action_379
+action_557 (148) = happyGoto action_564
+action_557 (159) = happyGoto action_381
+action_557 (162) = happyGoto action_382
+action_557 _ = happyFail
+
+action_558 _ = happyReduce_29
+
+action_559 (194) = happyShift action_563
+action_559 _ = happyFail
+
+action_560 _ = happyReduce_31
+
+action_561 (177) = happyShift action_114
+action_561 (181) = happyShift action_115
+action_561 (193) = happyShift action_374
+action_561 (251) = happyShift action_79
+action_561 (252) = happyShift action_80
+action_561 (253) = happyShift action_81
+action_561 (254) = happyShift action_82
+action_561 (255) = happyShift action_83
+action_561 (256) = happyShift action_84
+action_561 (257) = happyShift action_85
+action_561 (267) = happyShift action_86
+action_561 (284) = happyShift action_87
+action_561 (27) = happyGoto action_562
+action_561 (137) = happyGoto action_370
+action_561 (141) = happyGoto action_371
+action_561 (153) = happyGoto action_48
+action_561 (154) = happyGoto action_372
+action_561 (157) = happyGoto action_373
+action_561 _ = happyFail
+
+action_562 _ = happyReduce_53
+
+action_563 _ = happyReduce_346
+
+action_564 _ = happyReduce_63
+
+action_565 _ = happyReduce_356
+
+action_566 _ = happyReduce_350
+
+action_567 _ = happyReduce_339
+
+action_568 (177) = happyShift action_114
+action_568 (178) = happyShift action_56
+action_568 (179) = happyShift action_57
+action_568 (180) = happyShift action_58
+action_568 (181) = happyShift action_115
+action_568 (182) = happyShift action_60
+action_568 (183) = happyShift action_129
+action_568 (188) = happyShift action_61
+action_568 (189) = happyShift action_62
+action_568 (190) = happyShift action_63
+action_568 (191) = happyShift action_64
+action_568 (193) = happyShift action_65
+action_568 (201) = happyShift action_66
+action_568 (204) = happyShift action_67
+action_568 (211) = happyShift action_158
+action_568 (216) = happyShift action_68
+action_568 (218) = happyShift action_130
+action_568 (219) = happyShift action_69
+action_568 (220) = happyShift action_70
+action_568 (223) = happyShift action_71
+action_568 (233) = happyShift action_72
+action_568 (234) = happyShift action_73
+action_568 (235) = happyShift action_74
+action_568 (236) = happyShift action_75
+action_568 (237) = happyShift action_76
+action_568 (238) = happyShift action_77
+action_568 (240) = happyShift action_132
+action_568 (241) = happyShift action_133
+action_568 (242) = happyShift action_134
+action_568 (246) = happyShift action_78
+action_568 (251) = happyShift action_79
+action_568 (252) = happyShift action_80
+action_568 (253) = happyShift action_81
+action_568 (254) = happyShift action_82
+action_568 (255) = happyShift action_83
+action_568 (256) = happyShift action_84
+action_568 (257) = happyShift action_85
+action_568 (258) = happyShift action_136
+action_568 (263) = happyShift action_159
+action_568 (264) = happyShift action_140
+action_568 (267) = happyShift action_86
+action_568 (268) = happyShift action_160
+action_568 (275) = happyShift action_161
+action_568 (276) = happyShift action_146
+action_568 (284) = happyShift action_87
+action_568 (88) = happyGoto action_664
+action_568 (89) = happyGoto action_154
+action_568 (90) = happyGoto action_155
+action_568 (91) = happyGoto action_156
+action_568 (92) = happyGoto action_157
+action_568 (93) = happyGoto action_123
+action_568 (94) = happyGoto action_124
+action_568 (97) = happyGoto action_125
+action_568 (98) = happyGoto action_37
+action_568 (99) = happyGoto action_38
+action_568 (100) = happyGoto action_126
+action_568 (107) = happyGoto action_39
+action_568 (115) = happyGoto action_127
+action_568 (136) = happyGoto action_43
+action_568 (139) = happyGoto action_44
+action_568 (140) = happyGoto action_45
+action_568 (142) = happyGoto action_46
+action_568 (152) = happyGoto action_47
+action_568 (153) = happyGoto action_48
+action_568 (154) = happyGoto action_49
+action_568 (155) = happyGoto action_50
+action_568 (156) = happyGoto action_51
+action_568 (157) = happyGoto action_52
+action_568 (165) = happyGoto action_53
+action_568 (166) = happyGoto action_54
+action_568 _ = happyReduce_404
+
+action_569 _ = happyReduce_76
+
+action_570 (194) = happyShift action_663
+action_570 _ = happyFail
+
+action_571 (209) = happyShift action_662
+action_571 _ = happyFail
+
+action_572 (177) = happyShift action_114
+action_572 (181) = happyShift action_115
+action_572 (182) = happyShift action_60
+action_572 (193) = happyShift action_175
+action_572 (195) = happyShift action_176
+action_572 (201) = happyShift action_177
+action_572 (251) = happyShift action_79
+action_572 (252) = happyShift action_80
+action_572 (253) = happyShift action_81
+action_572 (254) = happyShift action_82
+action_572 (255) = happyShift action_83
+action_572 (256) = happyShift action_84
+action_572 (257) = happyShift action_85
+action_572 (267) = happyShift action_86
+action_572 (284) = happyShift action_87
+action_572 (46) = happyGoto action_661
+action_572 (48) = happyGoto action_285
+action_572 (49) = happyGoto action_167
+action_572 (50) = happyGoto action_168
+action_572 (153) = happyGoto action_48
+action_572 (154) = happyGoto action_172
+action_572 (156) = happyGoto action_173
+action_572 (157) = happyGoto action_52
+action_572 (174) = happyGoto action_174
+action_572 _ = happyFail
+
+action_573 (197) = happyShift action_102
+action_573 (122) = happyGoto action_658
+action_573 (123) = happyGoto action_659
+action_573 (166) = happyGoto action_660
+action_573 _ = happyReduce_404
+
+action_574 (199) = happyShift action_657
+action_574 _ = happyFail
+
+action_575 (1) = happyShift action_90
+action_575 (200) = happyShift action_91
+action_575 (168) = happyGoto action_656
+action_575 _ = happyFail
+
+action_576 _ = happyReduce_177
+
+action_577 (10) = happyGoto action_31
+action_577 (11) = happyGoto action_655
+action_577 (36) = happyGoto action_432
+action_577 _ = happyReduce_18
+
+action_578 (10) = happyGoto action_31
+action_578 (11) = happyGoto action_655
+action_578 (36) = happyGoto action_430
+action_578 _ = happyReduce_18
+
+action_579 (57) = happyGoto action_535
+action_579 (60) = happyGoto action_654
+action_579 _ = happyReduce_134
+
+action_580 (57) = happyGoto action_653
+action_580 _ = happyReduce_134
+
+action_581 _ = happyReduce_413
+
+action_582 _ = happyReduce_172
+
+action_583 (181) = happyShift action_115
+action_583 (182) = happyShift action_60
+action_583 (194) = happyShift action_652
+action_583 (78) = happyGoto action_650
+action_583 (156) = happyGoto action_581
+action_583 (157) = happyGoto action_52
+action_583 (173) = happyGoto action_651
+action_583 _ = happyFail
+
+action_584 (67) = happyGoto action_649
+action_584 (166) = happyGoto action_516
+action_584 _ = happyReduce_404
+
+action_585 (197) = happyShift action_102
+action_585 (63) = happyGoto action_646
+action_585 (64) = happyGoto action_647
+action_585 (166) = happyGoto action_648
+action_585 _ = happyReduce_404
+
+action_586 (199) = happyShift action_645
+action_586 _ = happyFail
+
+action_587 (1) = happyShift action_90
+action_587 (200) = happyShift action_91
+action_587 (168) = happyGoto action_644
+action_587 _ = happyFail
+
+action_588 _ = happyReduce_38
+
+action_589 _ = happyReduce_35
+
+action_590 _ = happyReduce_40
+
+action_591 (193) = happyShift action_643
+action_591 _ = happyFail
+
+action_592 _ = happyReduce_44
+
+action_593 (177) = happyReduce_404
+action_593 (178) = happyReduce_404
+action_593 (179) = happyReduce_404
+action_593 (180) = happyReduce_404
+action_593 (181) = happyReduce_404
+action_593 (182) = happyReduce_404
+action_593 (183) = happyReduce_404
+action_593 (188) = happyReduce_404
+action_593 (189) = happyReduce_404
+action_593 (190) = happyReduce_404
+action_593 (191) = happyReduce_404
+action_593 (193) = happyReduce_404
+action_593 (197) = happyShift action_102
+action_593 (201) = happyReduce_404
+action_593 (204) = happyReduce_404
+action_593 (216) = happyReduce_404
+action_593 (218) = happyReduce_404
+action_593 (219) = happyReduce_404
+action_593 (220) = happyReduce_404
+action_593 (221) = happyReduce_404
+action_593 (223) = happyReduce_404
+action_593 (233) = happyReduce_404
+action_593 (234) = happyReduce_404
+action_593 (235) = happyReduce_404
+action_593 (236) = happyReduce_404
+action_593 (237) = happyReduce_404
+action_593 (238) = happyReduce_404
+action_593 (240) = happyReduce_404
+action_593 (241) = happyReduce_404
+action_593 (242) = happyReduce_404
+action_593 (244) = happyReduce_404
+action_593 (246) = happyReduce_404
+action_593 (251) = happyReduce_404
+action_593 (252) = happyReduce_404
+action_593 (253) = happyReduce_404
+action_593 (254) = happyReduce_404
+action_593 (255) = happyReduce_404
+action_593 (256) = happyReduce_404
+action_593 (257) = happyReduce_404
+action_593 (258) = happyReduce_404
+action_593 (264) = happyReduce_404
+action_593 (267) = happyReduce_404
+action_593 (276) = happyReduce_404
+action_593 (284) = happyReduce_404
+action_593 (82) = happyGoto action_640
+action_593 (83) = happyGoto action_641
+action_593 (166) = happyGoto action_642
+action_593 _ = happyReduce_183
+
+action_594 (199) = happyShift action_639
+action_594 _ = happyFail
+
+action_595 (1) = happyShift action_90
+action_595 (200) = happyShift action_91
+action_595 (168) = happyGoto action_638
+action_595 _ = happyFail
+
+action_596 _ = happyReduce_321
+
+action_597 (177) = happyShift action_114
+action_597 (178) = happyShift action_56
+action_597 (179) = happyShift action_57
+action_597 (180) = happyShift action_58
+action_597 (181) = happyShift action_115
+action_597 (182) = happyShift action_60
+action_597 (183) = happyShift action_129
+action_597 (188) = happyShift action_61
+action_597 (189) = happyShift action_62
+action_597 (190) = happyShift action_63
+action_597 (191) = happyShift action_64
+action_597 (193) = happyShift action_65
+action_597 (201) = happyShift action_66
+action_597 (204) = happyShift action_67
+action_597 (211) = happyShift action_158
+action_597 (216) = happyShift action_68
+action_597 (218) = happyShift action_130
+action_597 (219) = happyShift action_69
+action_597 (220) = happyShift action_70
+action_597 (223) = happyShift action_71
+action_597 (233) = happyShift action_72
+action_597 (234) = happyShift action_73
+action_597 (235) = happyShift action_74
+action_597 (236) = happyShift action_75
+action_597 (237) = happyShift action_76
+action_597 (238) = happyShift action_77
+action_597 (240) = happyShift action_132
+action_597 (241) = happyShift action_133
+action_597 (242) = happyShift action_134
+action_597 (246) = happyShift action_78
+action_597 (251) = happyShift action_79
+action_597 (252) = happyShift action_80
+action_597 (253) = happyShift action_81
+action_597 (254) = happyShift action_82
+action_597 (255) = happyShift action_83
+action_597 (256) = happyShift action_84
+action_597 (257) = happyShift action_85
+action_597 (258) = happyShift action_136
+action_597 (263) = happyShift action_159
+action_597 (264) = happyShift action_140
+action_597 (267) = happyShift action_86
+action_597 (268) = happyShift action_160
+action_597 (275) = happyShift action_161
+action_597 (276) = happyShift action_146
+action_597 (284) = happyShift action_87
+action_597 (88) = happyGoto action_637
+action_597 (89) = happyGoto action_154
+action_597 (90) = happyGoto action_155
+action_597 (91) = happyGoto action_156
+action_597 (92) = happyGoto action_157
+action_597 (93) = happyGoto action_123
+action_597 (94) = happyGoto action_124
+action_597 (97) = happyGoto action_125
+action_597 (98) = happyGoto action_37
+action_597 (99) = happyGoto action_38
+action_597 (100) = happyGoto action_126
+action_597 (107) = happyGoto action_39
+action_597 (115) = happyGoto action_127
+action_597 (136) = happyGoto action_43
+action_597 (139) = happyGoto action_44
+action_597 (140) = happyGoto action_45
+action_597 (142) = happyGoto action_46
+action_597 (152) = happyGoto action_47
+action_597 (153) = happyGoto action_48
+action_597 (154) = happyGoto action_49
+action_597 (155) = happyGoto action_50
+action_597 (156) = happyGoto action_51
+action_597 (157) = happyGoto action_52
+action_597 (165) = happyGoto action_53
+action_597 (166) = happyGoto action_54
+action_597 _ = happyReduce_404
+
+action_598 (177) = happyShift action_114
+action_598 (178) = happyShift action_56
+action_598 (179) = happyShift action_57
+action_598 (180) = happyShift action_58
+action_598 (181) = happyShift action_115
+action_598 (182) = happyShift action_60
+action_598 (183) = happyShift action_129
+action_598 (188) = happyShift action_61
+action_598 (189) = happyShift action_62
+action_598 (190) = happyShift action_63
+action_598 (191) = happyShift action_64
+action_598 (193) = happyShift action_65
+action_598 (197) = happyShift action_415
+action_598 (201) = happyShift action_66
+action_598 (204) = happyShift action_67
+action_598 (211) = happyShift action_158
+action_598 (216) = happyShift action_68
+action_598 (218) = happyShift action_130
+action_598 (219) = happyShift action_69
+action_598 (220) = happyShift action_70
+action_598 (223) = happyShift action_71
+action_598 (233) = happyShift action_72
+action_598 (234) = happyShift action_73
+action_598 (235) = happyShift action_74
+action_598 (236) = happyShift action_75
+action_598 (237) = happyShift action_76
+action_598 (238) = happyShift action_77
+action_598 (240) = happyShift action_132
+action_598 (241) = happyShift action_133
+action_598 (242) = happyShift action_134
+action_598 (246) = happyShift action_78
+action_598 (251) = happyShift action_79
+action_598 (252) = happyShift action_80
+action_598 (253) = happyShift action_81
+action_598 (254) = happyShift action_82
+action_598 (255) = happyShift action_83
+action_598 (256) = happyShift action_84
+action_598 (257) = happyShift action_85
+action_598 (258) = happyShift action_136
+action_598 (263) = happyShift action_159
+action_598 (264) = happyShift action_140
+action_598 (267) = happyShift action_86
+action_598 (268) = happyShift action_160
+action_598 (275) = happyShift action_416
+action_598 (276) = happyShift action_146
+action_598 (284) = happyShift action_87
+action_598 (88) = happyGoto action_411
+action_598 (89) = happyGoto action_154
+action_598 (90) = happyGoto action_155
+action_598 (91) = happyGoto action_412
+action_598 (92) = happyGoto action_157
+action_598 (93) = happyGoto action_123
+action_598 (94) = happyGoto action_124
+action_598 (97) = happyGoto action_125
+action_598 (98) = happyGoto action_37
+action_598 (99) = happyGoto action_38
+action_598 (100) = happyGoto action_126
+action_598 (107) = happyGoto action_39
+action_598 (115) = happyGoto action_127
+action_598 (127) = happyGoto action_413
+action_598 (129) = happyGoto action_636
+action_598 (136) = happyGoto action_43
+action_598 (139) = happyGoto action_44
+action_598 (140) = happyGoto action_45
+action_598 (142) = happyGoto action_46
+action_598 (152) = happyGoto action_47
+action_598 (153) = happyGoto action_48
+action_598 (154) = happyGoto action_49
+action_598 (155) = happyGoto action_50
+action_598 (156) = happyGoto action_51
+action_598 (157) = happyGoto action_52
+action_598 (165) = happyGoto action_53
+action_598 (166) = happyGoto action_54
+action_598 _ = happyReduce_404
+
+action_599 (177) = happyShift action_114
+action_599 (181) = happyShift action_115
+action_599 (182) = happyShift action_60
+action_599 (193) = happyShift action_634
+action_599 (195) = happyShift action_176
+action_599 (201) = happyShift action_177
+action_599 (219) = happyShift action_635
+action_599 (251) = happyShift action_79
+action_599 (252) = happyShift action_80
+action_599 (253) = happyShift action_81
+action_599 (254) = happyShift action_82
+action_599 (255) = happyShift action_83
+action_599 (256) = happyShift action_84
+action_599 (257) = happyShift action_85
+action_599 (267) = happyShift action_86
+action_599 (284) = happyShift action_87
+action_599 (48) = happyGoto action_626
+action_599 (49) = happyGoto action_167
+action_599 (50) = happyGoto action_168
+action_599 (53) = happyGoto action_627
+action_599 (69) = happyGoto action_628
+action_599 (70) = happyGoto action_629
+action_599 (71) = happyGoto action_630
+action_599 (73) = happyGoto action_631
+action_599 (141) = happyGoto action_632
+action_599 (153) = happyGoto action_48
+action_599 (154) = happyGoto action_172
+action_599 (156) = happyGoto action_173
+action_599 (157) = happyGoto action_633
+action_599 (174) = happyGoto action_174
+action_599 _ = happyFail
+
+action_600 (57) = happyGoto action_625
+action_600 _ = happyReduce_134
+
+action_601 _ = happyReduce_71
+
+action_602 _ = happyReduce_204
+
+action_603 (210) = happyShift action_623
+action_603 _ = happyFail
+
+action_604 (177) = happyShift action_114
+action_604 (178) = happyShift action_56
+action_604 (179) = happyShift action_57
+action_604 (180) = happyShift action_58
+action_604 (181) = happyShift action_115
+action_604 (182) = happyShift action_60
+action_604 (183) = happyShift action_129
+action_604 (188) = happyShift action_61
+action_604 (189) = happyShift action_62
+action_604 (190) = happyShift action_63
+action_604 (191) = happyShift action_64
+action_604 (193) = happyShift action_65
+action_604 (201) = happyShift action_66
+action_604 (204) = happyShift action_67
+action_604 (211) = happyShift action_158
+action_604 (216) = happyShift action_68
+action_604 (218) = happyShift action_130
+action_604 (219) = happyShift action_69
+action_604 (220) = happyShift action_70
+action_604 (223) = happyShift action_71
+action_604 (233) = happyShift action_72
+action_604 (234) = happyShift action_73
+action_604 (235) = happyShift action_74
+action_604 (236) = happyShift action_75
+action_604 (237) = happyShift action_76
+action_604 (238) = happyShift action_77
+action_604 (240) = happyShift action_132
+action_604 (241) = happyShift action_133
+action_604 (242) = happyShift action_134
+action_604 (246) = happyShift action_78
+action_604 (251) = happyShift action_79
+action_604 (252) = happyShift action_80
+action_604 (253) = happyShift action_81
+action_604 (254) = happyShift action_82
+action_604 (255) = happyShift action_83
+action_604 (256) = happyShift action_84
+action_604 (257) = happyShift action_85
+action_604 (258) = happyShift action_136
+action_604 (263) = happyShift action_159
+action_604 (264) = happyShift action_140
+action_604 (267) = happyShift action_86
+action_604 (268) = happyShift action_160
+action_604 (275) = happyShift action_161
+action_604 (276) = happyShift action_146
+action_604 (284) = happyShift action_87
+action_604 (88) = happyGoto action_624
+action_604 (89) = happyGoto action_154
+action_604 (90) = happyGoto action_155
+action_604 (91) = happyGoto action_156
+action_604 (92) = happyGoto action_157
+action_604 (93) = happyGoto action_123
+action_604 (94) = happyGoto action_124
+action_604 (97) = happyGoto action_125
+action_604 (98) = happyGoto action_37
+action_604 (99) = happyGoto action_38
+action_604 (100) = happyGoto action_126
+action_604 (107) = happyGoto action_39
+action_604 (115) = happyGoto action_127
+action_604 (136) = happyGoto action_43
+action_604 (139) = happyGoto action_44
+action_604 (140) = happyGoto action_45
+action_604 (142) = happyGoto action_46
+action_604 (152) = happyGoto action_47
+action_604 (153) = happyGoto action_48
+action_604 (154) = happyGoto action_49
+action_604 (155) = happyGoto action_50
+action_604 (156) = happyGoto action_51
+action_604 (157) = happyGoto action_52
+action_604 (165) = happyGoto action_53
+action_604 (166) = happyGoto action_54
+action_604 _ = happyReduce_404
+
+action_605 (210) = happyShift action_623
+action_605 _ = happyReduce_234
+
+action_606 (179) = happyReduce_404
+action_606 (180) = happyReduce_404
+action_606 (135) = happyGoto action_622
+action_606 (166) = happyGoto action_511
+action_606 _ = happyReduce_17
+
+action_607 (197) = happyShift action_102
+action_607 _ = happyReduce_330
+
+action_608 (177) = happyReduce_404
+action_608 (178) = happyReduce_404
+action_608 (179) = happyReduce_404
+action_608 (180) = happyReduce_404
+action_608 (181) = happyReduce_404
+action_608 (182) = happyReduce_404
+action_608 (183) = happyReduce_404
+action_608 (188) = happyReduce_404
+action_608 (189) = happyReduce_404
+action_608 (190) = happyReduce_404
+action_608 (191) = happyReduce_404
+action_608 (193) = happyReduce_404
+action_608 (201) = happyReduce_404
+action_608 (204) = happyReduce_404
+action_608 (216) = happyReduce_404
+action_608 (218) = happyReduce_404
+action_608 (219) = happyReduce_404
+action_608 (220) = happyReduce_404
+action_608 (221) = happyReduce_404
+action_608 (223) = happyReduce_404
+action_608 (233) = happyReduce_404
+action_608 (234) = happyReduce_404
+action_608 (235) = happyReduce_404
+action_608 (236) = happyReduce_404
+action_608 (237) = happyReduce_404
+action_608 (238) = happyReduce_404
+action_608 (240) = happyReduce_404
+action_608 (241) = happyReduce_404
+action_608 (242) = happyReduce_404
+action_608 (244) = happyReduce_404
+action_608 (246) = happyReduce_404
+action_608 (251) = happyReduce_404
+action_608 (252) = happyReduce_404
+action_608 (253) = happyReduce_404
+action_608 (254) = happyReduce_404
+action_608 (255) = happyReduce_404
+action_608 (256) = happyReduce_404
+action_608 (257) = happyReduce_404
+action_608 (258) = happyReduce_404
+action_608 (264) = happyReduce_404
+action_608 (267) = happyReduce_404
+action_608 (271) = happyReduce_404
+action_608 (272) = happyReduce_404
+action_608 (273) = happyReduce_404
+action_608 (276) = happyReduce_404
+action_608 (284) = happyReduce_404
+action_608 (28) = happyGoto action_94
+action_608 (38) = happyGoto action_620
+action_608 (40) = happyGoto action_99
+action_608 (83) = happyGoto action_100
+action_608 (166) = happyGoto action_621
+action_608 _ = happyReduce_17
+
+action_609 (197) = happyShift action_102
+action_609 _ = happyReduce_82
+
+action_610 _ = happyReduce_300
+
+action_611 (177) = happyShift action_114
+action_611 (178) = happyShift action_56
+action_611 (179) = happyShift action_57
+action_611 (180) = happyShift action_58
+action_611 (181) = happyShift action_115
+action_611 (182) = happyShift action_60
+action_611 (183) = happyShift action_129
+action_611 (188) = happyShift action_61
+action_611 (189) = happyShift action_62
+action_611 (190) = happyShift action_63
+action_611 (191) = happyShift action_64
+action_611 (193) = happyShift action_65
+action_611 (201) = happyShift action_66
+action_611 (204) = happyShift action_67
+action_611 (211) = happyShift action_158
+action_611 (216) = happyShift action_68
+action_611 (218) = happyShift action_130
+action_611 (219) = happyShift action_69
+action_611 (220) = happyShift action_70
+action_611 (223) = happyShift action_71
+action_611 (233) = happyShift action_72
+action_611 (234) = happyShift action_73
+action_611 (235) = happyShift action_74
+action_611 (236) = happyShift action_75
+action_611 (237) = happyShift action_76
+action_611 (238) = happyShift action_77
+action_611 (240) = happyShift action_132
+action_611 (241) = happyShift action_133
+action_611 (242) = happyShift action_134
+action_611 (246) = happyShift action_78
+action_611 (251) = happyShift action_79
+action_611 (252) = happyShift action_80
+action_611 (253) = happyShift action_81
+action_611 (254) = happyShift action_82
+action_611 (255) = happyShift action_83
+action_611 (256) = happyShift action_84
+action_611 (257) = happyShift action_85
+action_611 (258) = happyShift action_136
+action_611 (263) = happyShift action_159
+action_611 (264) = happyShift action_140
+action_611 (267) = happyShift action_86
+action_611 (268) = happyShift action_160
+action_611 (275) = happyShift action_161
+action_611 (276) = happyShift action_146
+action_611 (284) = happyShift action_87
+action_611 (88) = happyGoto action_619
+action_611 (89) = happyGoto action_154
+action_611 (90) = happyGoto action_155
+action_611 (91) = happyGoto action_156
+action_611 (92) = happyGoto action_157
+action_611 (93) = happyGoto action_123
+action_611 (94) = happyGoto action_124
+action_611 (97) = happyGoto action_125
+action_611 (98) = happyGoto action_37
+action_611 (99) = happyGoto action_38
+action_611 (100) = happyGoto action_126
+action_611 (107) = happyGoto action_39
+action_611 (115) = happyGoto action_127
+action_611 (136) = happyGoto action_43
+action_611 (139) = happyGoto action_44
+action_611 (140) = happyGoto action_45
+action_611 (142) = happyGoto action_46
+action_611 (152) = happyGoto action_47
+action_611 (153) = happyGoto action_48
+action_611 (154) = happyGoto action_49
+action_611 (155) = happyGoto action_50
+action_611 (156) = happyGoto action_51
+action_611 (157) = happyGoto action_52
+action_611 (165) = happyGoto action_53
+action_611 (166) = happyGoto action_54
+action_611 _ = happyReduce_404
+
+action_612 _ = happyReduce_296
+
+action_613 (108) = happyGoto action_618
+action_613 _ = happyReduce_274
+
+action_614 _ = happyReduce_271
+
+action_615 (203) = happyShift action_277
+action_615 (222) = happyShift action_617
+action_615 _ = happyFail
+
+action_616 _ = happyReduce_4
+
+action_617 _ = happyReduce_276
+
+action_618 (243) = happyShift action_477
+action_618 (245) = happyShift action_696
+action_618 (246) = happyShift action_78
+action_618 (107) = happyGoto action_474
+action_618 (109) = happyGoto action_475
+action_618 (166) = happyGoto action_476
+action_618 _ = happyReduce_404
+
+action_619 _ = happyReduce_302
+
+action_620 _ = happyReduce_84
+
+action_621 (177) = happyShift action_114
+action_621 (178) = happyShift action_56
+action_621 (179) = happyShift action_57
+action_621 (180) = happyShift action_58
+action_621 (181) = happyShift action_115
+action_621 (182) = happyShift action_60
+action_621 (183) = happyShift action_129
+action_621 (188) = happyShift action_61
+action_621 (189) = happyShift action_62
+action_621 (190) = happyShift action_63
+action_621 (191) = happyShift action_64
+action_621 (193) = happyShift action_65
+action_621 (201) = happyShift action_66
+action_621 (204) = happyShift action_67
+action_621 (216) = happyShift action_68
+action_621 (218) = happyShift action_130
+action_621 (219) = happyShift action_69
+action_621 (220) = happyShift action_70
+action_621 (223) = happyShift action_71
+action_621 (233) = happyShift action_72
+action_621 (234) = happyShift action_73
+action_621 (235) = happyShift action_74
+action_621 (236) = happyShift action_75
+action_621 (237) = happyShift action_76
+action_621 (238) = happyShift action_77
+action_621 (240) = happyShift action_132
+action_621 (241) = happyShift action_133
+action_621 (242) = happyShift action_134
+action_621 (246) = happyShift action_78
+action_621 (251) = happyShift action_79
+action_621 (252) = happyShift action_80
+action_621 (253) = happyShift action_81
+action_621 (254) = happyShift action_82
+action_621 (255) = happyShift action_83
+action_621 (256) = happyShift action_84
+action_621 (257) = happyShift action_85
+action_621 (258) = happyShift action_136
+action_621 (264) = happyShift action_140
+action_621 (267) = happyShift action_86
+action_621 (271) = happyShift action_142
+action_621 (272) = happyShift action_143
+action_621 (273) = happyShift action_144
+action_621 (276) = happyShift action_146
+action_621 (284) = happyShift action_87
+action_621 (30) = happyGoto action_120
+action_621 (42) = happyGoto action_121
+action_621 (91) = happyGoto action_122
+action_621 (93) = happyGoto action_123
+action_621 (94) = happyGoto action_124
+action_621 (97) = happyGoto action_125
+action_621 (98) = happyGoto action_37
+action_621 (99) = happyGoto action_38
+action_621 (100) = happyGoto action_126
+action_621 (107) = happyGoto action_39
+action_621 (115) = happyGoto action_127
+action_621 (136) = happyGoto action_43
+action_621 (139) = happyGoto action_128
+action_621 (140) = happyGoto action_45
+action_621 (142) = happyGoto action_46
+action_621 (152) = happyGoto action_47
+action_621 (153) = happyGoto action_48
+action_621 (154) = happyGoto action_49
+action_621 (155) = happyGoto action_50
+action_621 (156) = happyGoto action_51
+action_621 (157) = happyGoto action_52
+action_621 (165) = happyGoto action_53
+action_621 (166) = happyGoto action_54
+action_621 _ = happyReduce_404
+
+action_622 _ = happyReduce_331
+
+action_623 (177) = happyShift action_114
+action_623 (178) = happyShift action_56
+action_623 (179) = happyShift action_57
+action_623 (180) = happyShift action_58
+action_623 (181) = happyShift action_115
+action_623 (182) = happyShift action_60
+action_623 (183) = happyShift action_129
+action_623 (188) = happyShift action_61
+action_623 (189) = happyShift action_62
+action_623 (190) = happyShift action_63
+action_623 (191) = happyShift action_64
+action_623 (193) = happyShift action_65
+action_623 (201) = happyShift action_66
+action_623 (204) = happyShift action_67
+action_623 (211) = happyShift action_158
+action_623 (216) = happyShift action_68
+action_623 (218) = happyShift action_130
+action_623 (219) = happyShift action_69
+action_623 (220) = happyShift action_70
+action_623 (223) = happyShift action_71
+action_623 (233) = happyShift action_72
+action_623 (234) = happyShift action_73
+action_623 (235) = happyShift action_74
+action_623 (236) = happyShift action_75
+action_623 (237) = happyShift action_76
+action_623 (238) = happyShift action_77
+action_623 (240) = happyShift action_132
+action_623 (241) = happyShift action_133
+action_623 (242) = happyShift action_134
+action_623 (246) = happyShift action_78
+action_623 (251) = happyShift action_79
+action_623 (252) = happyShift action_80
+action_623 (253) = happyShift action_81
+action_623 (254) = happyShift action_82
+action_623 (255) = happyShift action_83
+action_623 (256) = happyShift action_84
+action_623 (257) = happyShift action_85
+action_623 (258) = happyShift action_136
+action_623 (263) = happyShift action_159
+action_623 (264) = happyShift action_140
+action_623 (267) = happyShift action_86
+action_623 (268) = happyShift action_160
+action_623 (275) = happyShift action_161
+action_623 (276) = happyShift action_146
+action_623 (284) = happyShift action_87
+action_623 (88) = happyGoto action_695
+action_623 (89) = happyGoto action_154
+action_623 (90) = happyGoto action_155
+action_623 (91) = happyGoto action_156
+action_623 (92) = happyGoto action_157
+action_623 (93) = happyGoto action_123
+action_623 (94) = happyGoto action_124
+action_623 (97) = happyGoto action_125
+action_623 (98) = happyGoto action_37
+action_623 (99) = happyGoto action_38
+action_623 (100) = happyGoto action_126
+action_623 (107) = happyGoto action_39
+action_623 (115) = happyGoto action_127
+action_623 (136) = happyGoto action_43
+action_623 (139) = happyGoto action_44
+action_623 (140) = happyGoto action_45
+action_623 (142) = happyGoto action_46
+action_623 (152) = happyGoto action_47
+action_623 (153) = happyGoto action_48
+action_623 (154) = happyGoto action_49
+action_623 (155) = happyGoto action_50
+action_623 (156) = happyGoto action_51
+action_623 (157) = happyGoto action_52
+action_623 (165) = happyGoto action_53
+action_623 (166) = happyGoto action_54
+action_623 _ = happyReduce_404
+
+action_624 _ = happyReduce_207
+
+action_625 (177) = happyShift action_114
+action_625 (206) = happyShift action_694
+action_625 (251) = happyShift action_79
+action_625 (252) = happyShift action_80
+action_625 (253) = happyShift action_81
+action_625 (254) = happyShift action_82
+action_625 (255) = happyShift action_83
+action_625 (256) = happyShift action_84
+action_625 (257) = happyShift action_85
+action_625 (267) = happyShift action_86
+action_625 (284) = happyShift action_87
+action_625 (153) = happyGoto action_48
+action_625 (154) = happyGoto action_172
+action_625 (174) = happyGoto action_449
+action_625 _ = happyFail
+
+action_626 (177) = happyShift action_114
+action_626 (181) = happyShift action_115
+action_626 (182) = happyShift action_60
+action_626 (185) = happyReduce_164
+action_626 (193) = happyShift action_175
+action_626 (195) = happyShift action_176
+action_626 (201) = happyShift action_177
+action_626 (205) = happyReduce_164
+action_626 (217) = happyReduce_128
+action_626 (219) = happyShift action_693
+action_626 (251) = happyShift action_79
+action_626 (252) = happyShift action_80
+action_626 (253) = happyShift action_81
+action_626 (254) = happyShift action_82
+action_626 (255) = happyShift action_83
+action_626 (256) = happyShift action_84
+action_626 (257) = happyShift action_85
+action_626 (267) = happyShift action_86
+action_626 (284) = happyShift action_87
+action_626 (49) = happyGoto action_299
+action_626 (50) = happyGoto action_168
+action_626 (153) = happyGoto action_48
+action_626 (154) = happyGoto action_172
+action_626 (156) = happyGoto action_173
+action_626 (157) = happyGoto action_52
+action_626 (174) = happyGoto action_174
+action_626 _ = happyReduce_158
+
+action_627 (217) = happyShift action_692
+action_627 _ = happyFail
+
+action_628 _ = happyReduce_151
+
+action_629 _ = happyReduce_154
+
+action_630 (177) = happyShift action_114
+action_630 (181) = happyShift action_115
+action_630 (182) = happyShift action_60
+action_630 (193) = happyShift action_175
+action_630 (195) = happyShift action_176
+action_630 (201) = happyShift action_177
+action_630 (219) = happyShift action_691
+action_630 (251) = happyShift action_79
+action_630 (252) = happyShift action_80
+action_630 (253) = happyShift action_81
+action_630 (254) = happyShift action_82
+action_630 (255) = happyShift action_83
+action_630 (256) = happyShift action_84
+action_630 (257) = happyShift action_85
+action_630 (267) = happyShift action_86
+action_630 (284) = happyShift action_87
+action_630 (49) = happyGoto action_689
+action_630 (50) = happyGoto action_168
+action_630 (72) = happyGoto action_690
+action_630 (153) = happyGoto action_48
+action_630 (154) = happyGoto action_172
+action_630 (156) = happyGoto action_173
+action_630 (157) = happyGoto action_52
+action_630 (174) = happyGoto action_174
+action_630 _ = happyReduce_159
+
+action_631 (185) = happyShift action_211
+action_631 (205) = happyShift action_688
+action_631 (146) = happyGoto action_687
+action_631 (159) = happyGoto action_381
+action_631 _ = happyFail
+
+action_632 (198) = happyShift action_686
+action_632 _ = happyFail
+
+action_633 (198) = happyReduce_345
+action_633 _ = happyReduce_382
+
+action_634 (177) = happyShift action_114
+action_634 (179) = happyShift action_57
+action_634 (180) = happyShift action_58
+action_634 (181) = happyShift action_115
+action_634 (182) = happyShift action_60
+action_634 (185) = happyShift action_211
+action_634 (193) = happyShift action_175
+action_634 (194) = happyShift action_294
+action_634 (195) = happyShift action_176
+action_634 (201) = happyShift action_177
+action_634 (203) = happyShift action_215
+action_634 (214) = happyShift action_295
+action_634 (251) = happyShift action_79
+action_634 (252) = happyShift action_80
+action_634 (253) = happyShift action_81
+action_634 (254) = happyShift action_82
+action_634 (255) = happyShift action_83
+action_634 (256) = happyShift action_84
+action_634 (257) = happyShift action_85
+action_634 (266) = happyShift action_178
+action_634 (267) = happyShift action_86
+action_634 (284) = happyShift action_87
+action_634 (46) = happyGoto action_164
+action_634 (47) = happyGoto action_289
+action_634 (48) = happyGoto action_166
+action_634 (49) = happyGoto action_167
+action_634 (50) = happyGoto action_168
+action_634 (52) = happyGoto action_290
+action_634 (53) = happyGoto action_170
+action_634 (54) = happyGoto action_291
+action_634 (55) = happyGoto action_292
+action_634 (102) = happyGoto action_293
+action_634 (140) = happyGoto action_171
+action_634 (153) = happyGoto action_48
+action_634 (154) = happyGoto action_172
+action_634 (155) = happyGoto action_50
+action_634 (156) = happyGoto action_173
+action_634 (157) = happyGoto action_52
+action_634 (159) = happyGoto action_559
+action_634 (174) = happyGoto action_174
+action_634 _ = happyFail
+
+action_635 (177) = happyShift action_114
+action_635 (181) = happyShift action_115
+action_635 (182) = happyShift action_60
+action_635 (193) = happyShift action_175
+action_635 (195) = happyShift action_176
+action_635 (201) = happyShift action_177
+action_635 (251) = happyShift action_79
+action_635 (252) = happyShift action_80
+action_635 (253) = happyShift action_81
+action_635 (254) = happyShift action_82
+action_635 (255) = happyShift action_83
+action_635 (256) = happyShift action_84
+action_635 (257) = happyShift action_85
+action_635 (267) = happyShift action_86
+action_635 (284) = happyShift action_87
+action_635 (49) = happyGoto action_685
+action_635 (50) = happyGoto action_168
+action_635 (153) = happyGoto action_48
+action_635 (154) = happyGoto action_172
+action_635 (156) = happyGoto action_173
+action_635 (157) = happyGoto action_52
+action_635 (174) = happyGoto action_174
+action_635 _ = happyFail
+
+action_636 _ = happyReduce_319
+
+action_637 (197) = happyShift action_684
+action_637 _ = happyFail
+
+action_638 _ = happyReduce_180
+
+action_639 _ = happyReduce_179
+
+action_640 (10) = happyGoto action_682
+action_640 (11) = happyGoto action_683
+action_640 _ = happyReduce_18
+
+action_641 _ = happyReduce_185
+
+action_642 (177) = happyShift action_114
+action_642 (178) = happyShift action_56
+action_642 (179) = happyShift action_57
+action_642 (180) = happyShift action_58
+action_642 (181) = happyShift action_115
+action_642 (182) = happyShift action_60
+action_642 (183) = happyShift action_129
+action_642 (188) = happyShift action_61
+action_642 (189) = happyShift action_62
+action_642 (190) = happyShift action_63
+action_642 (191) = happyShift action_64
+action_642 (193) = happyShift action_65
+action_642 (201) = happyShift action_66
+action_642 (204) = happyShift action_67
+action_642 (216) = happyShift action_68
+action_642 (218) = happyShift action_130
+action_642 (219) = happyShift action_69
+action_642 (220) = happyShift action_70
+action_642 (223) = happyShift action_71
+action_642 (233) = happyShift action_72
+action_642 (234) = happyShift action_73
+action_642 (235) = happyShift action_74
+action_642 (236) = happyShift action_75
+action_642 (237) = happyShift action_76
+action_642 (238) = happyShift action_77
+action_642 (240) = happyShift action_132
+action_642 (241) = happyShift action_133
+action_642 (242) = happyShift action_134
+action_642 (246) = happyShift action_78
+action_642 (251) = happyShift action_79
+action_642 (252) = happyShift action_80
+action_642 (253) = happyShift action_81
+action_642 (254) = happyShift action_82
+action_642 (255) = happyShift action_83
+action_642 (256) = happyShift action_84
+action_642 (257) = happyShift action_85
+action_642 (258) = happyShift action_136
+action_642 (264) = happyShift action_140
+action_642 (267) = happyShift action_86
+action_642 (276) = happyShift action_146
+action_642 (284) = happyShift action_87
+action_642 (91) = happyGoto action_122
+action_642 (93) = happyGoto action_123
+action_642 (94) = happyGoto action_124
+action_642 (97) = happyGoto action_125
+action_642 (98) = happyGoto action_37
+action_642 (99) = happyGoto action_38
+action_642 (100) = happyGoto action_126
+action_642 (107) = happyGoto action_39
+action_642 (115) = happyGoto action_127
+action_642 (136) = happyGoto action_43
+action_642 (139) = happyGoto action_44
+action_642 (140) = happyGoto action_45
+action_642 (142) = happyGoto action_46
+action_642 (152) = happyGoto action_47
+action_642 (153) = happyGoto action_48
+action_642 (154) = happyGoto action_49
+action_642 (155) = happyGoto action_50
+action_642 (156) = happyGoto action_51
+action_642 (157) = happyGoto action_52
+action_642 (165) = happyGoto action_53
+action_642 (166) = happyGoto action_54
+action_642 _ = happyReduce_404
+
+action_643 (177) = happyShift action_114
+action_643 (181) = happyShift action_115
+action_643 (193) = happyShift action_386
+action_643 (203) = happyShift action_117
+action_643 (251) = happyShift action_79
+action_643 (252) = happyShift action_80
+action_643 (253) = happyShift action_81
+action_643 (254) = happyShift action_82
+action_643 (255) = happyShift action_83
+action_643 (256) = happyShift action_84
+action_643 (257) = happyShift action_85
+action_643 (267) = happyShift action_86
+action_643 (284) = happyShift action_87
+action_643 (14) = happyGoto action_676
+action_643 (24) = happyGoto action_677
+action_643 (25) = happyGoto action_678
+action_643 (137) = happyGoto action_679
+action_643 (153) = happyGoto action_48
+action_643 (154) = happyGoto action_372
+action_643 (157) = happyGoto action_680
+action_643 (170) = happyGoto action_681
+action_643 _ = happyReduce_24
+
+action_644 _ = happyReduce_141
+
+action_645 _ = happyReduce_140
+
+action_646 (10) = happyGoto action_674
+action_646 (11) = happyGoto action_675
+action_646 _ = happyReduce_18
+
+action_647 _ = happyReduce_144
+
+action_648 (181) = happyShift action_115
+action_648 (182) = happyShift action_60
+action_648 (193) = happyShift action_673
+action_648 (142) = happyGoto action_672
+action_648 (156) = happyGoto action_51
+action_648 (157) = happyGoto action_52
+action_648 _ = happyFail
+
+action_649 _ = happyReduce_148
+
+action_650 (194) = happyShift action_670
+action_650 (203) = happyShift action_671
+action_650 _ = happyFail
+
+action_651 _ = happyReduce_176
+
+action_652 _ = happyReduce_173
+
+action_653 (177) = happyShift action_114
+action_653 (251) = happyShift action_79
+action_653 (252) = happyShift action_80
+action_653 (253) = happyShift action_81
+action_653 (254) = happyShift action_82
+action_653 (255) = happyShift action_83
+action_653 (256) = happyShift action_84
+action_653 (257) = happyShift action_85
+action_653 (267) = happyShift action_86
+action_653 (284) = happyShift action_87
+action_653 (153) = happyGoto action_48
+action_653 (154) = happyGoto action_172
+action_653 (174) = happyGoto action_449
+action_653 _ = happyReduce_139
+
+action_654 _ = happyReduce_137
+
+action_655 (177) = happyReduce_404
+action_655 (178) = happyReduce_404
+action_655 (179) = happyReduce_404
+action_655 (180) = happyReduce_404
+action_655 (181) = happyReduce_404
+action_655 (182) = happyReduce_404
+action_655 (183) = happyReduce_404
+action_655 (188) = happyReduce_404
+action_655 (189) = happyReduce_404
+action_655 (190) = happyReduce_404
+action_655 (191) = happyReduce_404
+action_655 (193) = happyReduce_404
+action_655 (197) = happyShift action_102
+action_655 (201) = happyReduce_404
+action_655 (204) = happyReduce_404
+action_655 (216) = happyReduce_404
+action_655 (218) = happyReduce_404
+action_655 (219) = happyReduce_404
+action_655 (220) = happyReduce_404
+action_655 (221) = happyReduce_404
+action_655 (223) = happyReduce_404
+action_655 (233) = happyReduce_404
+action_655 (234) = happyReduce_404
+action_655 (235) = happyReduce_404
+action_655 (236) = happyReduce_404
+action_655 (237) = happyReduce_404
+action_655 (238) = happyReduce_404
+action_655 (240) = happyReduce_404
+action_655 (241) = happyReduce_404
+action_655 (242) = happyReduce_404
+action_655 (244) = happyReduce_404
+action_655 (246) = happyReduce_404
+action_655 (251) = happyReduce_404
+action_655 (252) = happyReduce_404
+action_655 (253) = happyReduce_404
+action_655 (254) = happyReduce_404
+action_655 (255) = happyReduce_404
+action_655 (256) = happyReduce_404
+action_655 (257) = happyReduce_404
+action_655 (258) = happyReduce_404
+action_655 (264) = happyReduce_404
+action_655 (267) = happyReduce_404
+action_655 (271) = happyReduce_404
+action_655 (272) = happyReduce_404
+action_655 (273) = happyReduce_404
+action_655 (276) = happyReduce_404
+action_655 (284) = happyReduce_404
+action_655 (28) = happyGoto action_94
+action_655 (37) = happyGoto action_502
+action_655 (38) = happyGoto action_503
+action_655 (40) = happyGoto action_99
+action_655 (83) = happyGoto action_100
+action_655 (166) = happyGoto action_621
+action_655 _ = happyReduce_83
+
+action_656 _ = happyReduce_306
+
+action_657 _ = happyReduce_305
+
+action_658 (10) = happyGoto action_668
+action_658 (11) = happyGoto action_669
+action_658 _ = happyReduce_18
+
+action_659 _ = happyReduce_309
+
+action_660 (177) = happyShift action_114
+action_660 (178) = happyShift action_56
+action_660 (179) = happyShift action_57
+action_660 (180) = happyShift action_58
+action_660 (181) = happyShift action_115
+action_660 (182) = happyShift action_60
+action_660 (183) = happyShift action_129
+action_660 (188) = happyShift action_61
+action_660 (189) = happyShift action_62
+action_660 (190) = happyShift action_63
+action_660 (191) = happyShift action_64
+action_660 (193) = happyShift action_65
+action_660 (201) = happyShift action_66
+action_660 (204) = happyShift action_67
+action_660 (216) = happyShift action_68
+action_660 (218) = happyShift action_130
+action_660 (219) = happyShift action_69
+action_660 (220) = happyShift action_70
+action_660 (223) = happyShift action_71
+action_660 (233) = happyShift action_72
+action_660 (234) = happyShift action_73
+action_660 (235) = happyShift action_74
+action_660 (236) = happyShift action_75
+action_660 (237) = happyShift action_76
+action_660 (238) = happyShift action_77
+action_660 (240) = happyShift action_132
+action_660 (241) = happyShift action_133
+action_660 (242) = happyShift action_134
+action_660 (246) = happyShift action_78
+action_660 (251) = happyShift action_79
+action_660 (252) = happyShift action_80
+action_660 (253) = happyShift action_81
+action_660 (254) = happyShift action_82
+action_660 (255) = happyShift action_83
+action_660 (256) = happyShift action_84
+action_660 (257) = happyShift action_85
+action_660 (258) = happyShift action_136
+action_660 (264) = happyShift action_140
+action_660 (267) = happyShift action_86
+action_660 (276) = happyShift action_146
+action_660 (284) = happyShift action_87
+action_660 (91) = happyGoto action_666
+action_660 (93) = happyGoto action_123
+action_660 (94) = happyGoto action_124
+action_660 (97) = happyGoto action_125
+action_660 (98) = happyGoto action_37
+action_660 (99) = happyGoto action_38
+action_660 (100) = happyGoto action_126
+action_660 (107) = happyGoto action_39
+action_660 (115) = happyGoto action_127
+action_660 (127) = happyGoto action_667
+action_660 (136) = happyGoto action_43
+action_660 (139) = happyGoto action_44
+action_660 (140) = happyGoto action_45
+action_660 (142) = happyGoto action_46
+action_660 (152) = happyGoto action_47
+action_660 (153) = happyGoto action_48
+action_660 (154) = happyGoto action_49
+action_660 (155) = happyGoto action_50
+action_660 (156) = happyGoto action_51
+action_660 (157) = happyGoto action_52
+action_660 (165) = happyGoto action_53
+action_660 (166) = happyGoto action_54
+action_660 _ = happyReduce_404
+
+action_661 _ = happyReduce_104
+
+action_662 (177) = happyShift action_114
+action_662 (181) = happyShift action_115
+action_662 (182) = happyShift action_60
+action_662 (193) = happyShift action_175
+action_662 (195) = happyShift action_176
+action_662 (201) = happyShift action_177
+action_662 (251) = happyShift action_79
+action_662 (252) = happyShift action_80
+action_662 (253) = happyShift action_81
+action_662 (254) = happyShift action_82
+action_662 (255) = happyShift action_83
+action_662 (256) = happyShift action_84
+action_662 (257) = happyShift action_85
+action_662 (267) = happyShift action_86
+action_662 (284) = happyShift action_87
+action_662 (46) = happyGoto action_665
+action_662 (48) = happyGoto action_285
+action_662 (49) = happyGoto action_167
+action_662 (50) = happyGoto action_168
+action_662 (153) = happyGoto action_48
+action_662 (154) = happyGoto action_172
+action_662 (156) = happyGoto action_173
+action_662 (157) = happyGoto action_52
+action_662 (174) = happyGoto action_174
+action_662 _ = happyFail
+
+action_663 _ = happyReduce_341
+
+action_664 _ = happyReduce_193
+
+action_665 _ = happyReduce_103
+
+action_666 (184) = happyShift action_262
+action_666 (185) = happyShift action_211
+action_666 (186) = happyShift action_212
+action_666 (187) = happyShift action_213
+action_666 (205) = happyShift action_263
+action_666 (206) = happyShift action_264
+action_666 (208) = happyShift action_218
+action_666 (218) = happyShift action_266
+action_666 (219) = happyShift action_267
+action_666 (144) = happyGoto action_256
+action_666 (147) = happyGoto action_257
+action_666 (149) = happyGoto action_353
+action_666 (151) = happyGoto action_259
+action_666 (158) = happyGoto action_203
+action_666 (159) = happyGoto action_204
+action_666 (160) = happyGoto action_260
+action_666 (162) = happyGoto action_207
+action_666 (164) = happyGoto action_261
+action_666 _ = happyReduce_316
+
+action_667 (214) = happyShift action_723
+action_667 (124) = happyGoto action_719
+action_667 (125) = happyGoto action_720
+action_667 (126) = happyGoto action_721
+action_667 (166) = happyGoto action_722
+action_667 _ = happyReduce_404
+
+action_668 (177) = happyReduce_404
+action_668 (178) = happyReduce_404
+action_668 (179) = happyReduce_404
+action_668 (180) = happyReduce_404
+action_668 (181) = happyReduce_404
+action_668 (182) = happyReduce_404
+action_668 (183) = happyReduce_404
+action_668 (188) = happyReduce_404
+action_668 (189) = happyReduce_404
+action_668 (190) = happyReduce_404
+action_668 (191) = happyReduce_404
+action_668 (193) = happyReduce_404
+action_668 (201) = happyReduce_404
+action_668 (204) = happyReduce_404
+action_668 (216) = happyReduce_404
+action_668 (218) = happyReduce_404
+action_668 (219) = happyReduce_404
+action_668 (220) = happyReduce_404
+action_668 (221) = happyReduce_404
+action_668 (223) = happyReduce_404
+action_668 (233) = happyReduce_404
+action_668 (234) = happyReduce_404
+action_668 (235) = happyReduce_404
+action_668 (236) = happyReduce_404
+action_668 (237) = happyReduce_404
+action_668 (238) = happyReduce_404
+action_668 (240) = happyReduce_404
+action_668 (241) = happyReduce_404
+action_668 (242) = happyReduce_404
+action_668 (244) = happyReduce_404
+action_668 (246) = happyReduce_404
+action_668 (251) = happyReduce_404
+action_668 (252) = happyReduce_404
+action_668 (253) = happyReduce_404
+action_668 (254) = happyReduce_404
+action_668 (255) = happyReduce_404
+action_668 (256) = happyReduce_404
+action_668 (257) = happyReduce_404
+action_668 (258) = happyReduce_404
+action_668 (264) = happyReduce_404
+action_668 (267) = happyReduce_404
+action_668 (276) = happyReduce_404
+action_668 (284) = happyReduce_404
+action_668 (123) = happyGoto action_718
+action_668 (166) = happyGoto action_660
+action_668 _ = happyReduce_17
+
+action_669 (197) = happyShift action_102
+action_669 _ = happyReduce_307
+
+action_670 _ = happyReduce_174
+
+action_671 (181) = happyShift action_115
+action_671 (182) = happyShift action_60
+action_671 (156) = happyGoto action_581
+action_671 (157) = happyGoto action_52
+action_671 (173) = happyGoto action_717
+action_671 _ = happyFail
+
+action_672 (209) = happyShift action_716
+action_672 _ = happyFail
+
+action_673 (185) = happyShift action_211
+action_673 (187) = happyShift action_213
+action_673 (208) = happyShift action_218
+action_673 (151) = happyGoto action_394
+action_673 (158) = happyGoto action_203
+action_673 (159) = happyGoto action_204
+action_673 _ = happyFail
+
+action_674 (181) = happyReduce_404
+action_674 (182) = happyReduce_404
+action_674 (193) = happyReduce_404
+action_674 (64) = happyGoto action_715
+action_674 (166) = happyGoto action_648
+action_674 _ = happyReduce_17
+
+action_675 (197) = happyShift action_102
+action_675 _ = happyReduce_142
+
+action_676 (194) = happyShift action_714
+action_676 _ = happyFail
+
+action_677 (203) = happyShift action_713
+action_677 (14) = happyGoto action_712
+action_677 _ = happyReduce_24
+
+action_678 _ = happyReduce_47
+
+action_679 _ = happyReduce_48
+
+action_680 _ = happyReduce_410
+
+action_681 (193) = happyShift action_711
+action_681 _ = happyReduce_49
+
+action_682 (177) = happyReduce_404
+action_682 (178) = happyReduce_404
+action_682 (179) = happyReduce_404
+action_682 (180) = happyReduce_404
+action_682 (181) = happyReduce_404
+action_682 (182) = happyReduce_404
+action_682 (183) = happyReduce_404
+action_682 (188) = happyReduce_404
+action_682 (189) = happyReduce_404
+action_682 (190) = happyReduce_404
+action_682 (191) = happyReduce_404
+action_682 (193) = happyReduce_404
+action_682 (201) = happyReduce_404
+action_682 (204) = happyReduce_404
+action_682 (216) = happyReduce_404
+action_682 (218) = happyReduce_404
+action_682 (219) = happyReduce_404
+action_682 (220) = happyReduce_404
+action_682 (221) = happyReduce_404
+action_682 (223) = happyReduce_404
+action_682 (233) = happyReduce_404
+action_682 (234) = happyReduce_404
+action_682 (235) = happyReduce_404
+action_682 (236) = happyReduce_404
+action_682 (237) = happyReduce_404
+action_682 (238) = happyReduce_404
+action_682 (240) = happyReduce_404
+action_682 (241) = happyReduce_404
+action_682 (242) = happyReduce_404
+action_682 (244) = happyReduce_404
+action_682 (246) = happyReduce_404
+action_682 (251) = happyReduce_404
+action_682 (252) = happyReduce_404
+action_682 (253) = happyReduce_404
+action_682 (254) = happyReduce_404
+action_682 (255) = happyReduce_404
+action_682 (256) = happyReduce_404
+action_682 (257) = happyReduce_404
+action_682 (258) = happyReduce_404
+action_682 (264) = happyReduce_404
+action_682 (267) = happyReduce_404
+action_682 (276) = happyReduce_404
+action_682 (284) = happyReduce_404
+action_682 (83) = happyGoto action_710
+action_682 (166) = happyGoto action_642
+action_682 _ = happyReduce_17
+
+action_683 (197) = happyShift action_102
+action_683 _ = happyReduce_182
+
+action_684 (177) = happyShift action_114
+action_684 (178) = happyShift action_56
+action_684 (179) = happyShift action_57
+action_684 (180) = happyShift action_58
+action_684 (181) = happyShift action_115
+action_684 (182) = happyShift action_60
+action_684 (183) = happyShift action_129
+action_684 (188) = happyShift action_61
+action_684 (189) = happyShift action_62
+action_684 (190) = happyShift action_63
+action_684 (191) = happyShift action_64
+action_684 (193) = happyShift action_65
+action_684 (197) = happyShift action_415
+action_684 (201) = happyShift action_66
+action_684 (204) = happyShift action_67
+action_684 (211) = happyShift action_158
+action_684 (216) = happyShift action_68
+action_684 (218) = happyShift action_130
+action_684 (219) = happyShift action_69
+action_684 (220) = happyShift action_70
+action_684 (223) = happyShift action_71
+action_684 (233) = happyShift action_72
+action_684 (234) = happyShift action_73
+action_684 (235) = happyShift action_74
+action_684 (236) = happyShift action_75
+action_684 (237) = happyShift action_76
+action_684 (238) = happyShift action_77
+action_684 (240) = happyShift action_132
+action_684 (241) = happyShift action_133
+action_684 (242) = happyShift action_134
+action_684 (246) = happyShift action_78
+action_684 (251) = happyShift action_79
+action_684 (252) = happyShift action_80
+action_684 (253) = happyShift action_81
+action_684 (254) = happyShift action_82
+action_684 (255) = happyShift action_83
+action_684 (256) = happyShift action_84
+action_684 (257) = happyShift action_85
+action_684 (258) = happyShift action_136
+action_684 (263) = happyShift action_159
+action_684 (264) = happyShift action_140
+action_684 (267) = happyShift action_86
+action_684 (268) = happyShift action_160
+action_684 (275) = happyShift action_416
+action_684 (276) = happyShift action_146
+action_684 (284) = happyShift action_87
+action_684 (88) = happyGoto action_411
+action_684 (89) = happyGoto action_154
+action_684 (90) = happyGoto action_155
+action_684 (91) = happyGoto action_412
+action_684 (92) = happyGoto action_157
+action_684 (93) = happyGoto action_123
+action_684 (94) = happyGoto action_124
+action_684 (97) = happyGoto action_125
+action_684 (98) = happyGoto action_37
+action_684 (99) = happyGoto action_38
+action_684 (100) = happyGoto action_126
+action_684 (107) = happyGoto action_39
+action_684 (115) = happyGoto action_127
+action_684 (127) = happyGoto action_413
+action_684 (129) = happyGoto action_709
+action_684 (136) = happyGoto action_43
+action_684 (139) = happyGoto action_44
+action_684 (140) = happyGoto action_45
+action_684 (142) = happyGoto action_46
+action_684 (152) = happyGoto action_47
+action_684 (153) = happyGoto action_48
+action_684 (154) = happyGoto action_49
+action_684 (155) = happyGoto action_50
+action_684 (156) = happyGoto action_51
+action_684 (157) = happyGoto action_52
+action_684 (165) = happyGoto action_53
+action_684 (166) = happyGoto action_54
+action_684 _ = happyReduce_404
+
+action_685 _ = happyReduce_165
+
+action_686 (177) = happyShift action_114
+action_686 (178) = happyShift action_56
+action_686 (193) = happyShift action_116
+action_686 (199) = happyShift action_708
+action_686 (251) = happyShift action_79
+action_686 (252) = happyShift action_80
+action_686 (253) = happyShift action_81
+action_686 (254) = happyShift action_82
+action_686 (255) = happyShift action_83
+action_686 (256) = happyShift action_84
+action_686 (257) = happyShift action_85
+action_686 (267) = happyShift action_86
+action_686 (284) = happyShift action_87
+action_686 (42) = happyGoto action_704
+action_686 (74) = happyGoto action_705
+action_686 (75) = happyGoto action_706
+action_686 (139) = happyGoto action_707
+action_686 (152) = happyGoto action_47
+action_686 (153) = happyGoto action_48
+action_686 (154) = happyGoto action_49
+action_686 _ = happyFail
+
+action_687 (177) = happyShift action_114
+action_687 (181) = happyShift action_115
+action_687 (182) = happyShift action_60
+action_687 (193) = happyShift action_175
+action_687 (195) = happyShift action_176
+action_687 (201) = happyShift action_177
+action_687 (219) = happyShift action_635
+action_687 (251) = happyShift action_79
+action_687 (252) = happyShift action_80
+action_687 (253) = happyShift action_81
+action_687 (254) = happyShift action_82
+action_687 (255) = happyShift action_83
+action_687 (256) = happyShift action_84
+action_687 (257) = happyShift action_85
+action_687 (267) = happyShift action_86
+action_687 (284) = happyShift action_87
+action_687 (48) = happyGoto action_702
+action_687 (49) = happyGoto action_167
+action_687 (50) = happyGoto action_168
+action_687 (73) = happyGoto action_703
+action_687 (153) = happyGoto action_48
+action_687 (154) = happyGoto action_172
+action_687 (156) = happyGoto action_173
+action_687 (157) = happyGoto action_52
+action_687 (174) = happyGoto action_174
+action_687 _ = happyFail
+
+action_688 (181) = happyShift action_115
+action_688 (157) = happyGoto action_556
+action_688 _ = happyFail
+
+action_689 _ = happyReduce_162
+
+action_690 _ = happyReduce_161
+
+action_691 (177) = happyShift action_114
+action_691 (181) = happyShift action_115
+action_691 (182) = happyShift action_60
+action_691 (193) = happyShift action_175
+action_691 (195) = happyShift action_176
+action_691 (201) = happyShift action_177
+action_691 (251) = happyShift action_79
+action_691 (252) = happyShift action_80
+action_691 (253) = happyShift action_81
+action_691 (254) = happyShift action_82
+action_691 (255) = happyShift action_83
+action_691 (256) = happyShift action_84
+action_691 (257) = happyShift action_85
+action_691 (267) = happyShift action_86
+action_691 (284) = happyShift action_87
+action_691 (49) = happyGoto action_701
+action_691 (50) = happyGoto action_168
+action_691 (153) = happyGoto action_48
+action_691 (154) = happyGoto action_172
+action_691 (156) = happyGoto action_173
+action_691 (157) = happyGoto action_52
+action_691 (174) = happyGoto action_174
+action_691 _ = happyFail
+
+action_692 (177) = happyShift action_114
+action_692 (181) = happyShift action_115
+action_692 (182) = happyShift action_60
+action_692 (193) = happyShift action_634
+action_692 (195) = happyShift action_176
+action_692 (201) = happyShift action_177
+action_692 (219) = happyShift action_635
+action_692 (251) = happyShift action_79
+action_692 (252) = happyShift action_80
+action_692 (253) = happyShift action_81
+action_692 (254) = happyShift action_82
+action_692 (255) = happyShift action_83
+action_692 (256) = happyShift action_84
+action_692 (257) = happyShift action_85
+action_692 (267) = happyShift action_86
+action_692 (284) = happyShift action_87
+action_692 (48) = happyGoto action_699
+action_692 (49) = happyGoto action_167
+action_692 (50) = happyGoto action_168
+action_692 (69) = happyGoto action_700
+action_692 (70) = happyGoto action_629
+action_692 (71) = happyGoto action_630
+action_692 (73) = happyGoto action_631
+action_692 (141) = happyGoto action_632
+action_692 (153) = happyGoto action_48
+action_692 (154) = happyGoto action_172
+action_692 (156) = happyGoto action_173
+action_692 (157) = happyGoto action_633
+action_692 (174) = happyGoto action_174
+action_692 _ = happyFail
+
+action_693 (177) = happyShift action_114
+action_693 (181) = happyShift action_115
+action_693 (182) = happyShift action_60
+action_693 (193) = happyShift action_175
+action_693 (195) = happyShift action_176
+action_693 (201) = happyShift action_177
+action_693 (251) = happyShift action_79
+action_693 (252) = happyShift action_80
+action_693 (253) = happyShift action_81
+action_693 (254) = happyShift action_82
+action_693 (255) = happyShift action_83
+action_693 (256) = happyShift action_84
+action_693 (257) = happyShift action_85
+action_693 (267) = happyShift action_86
+action_693 (284) = happyShift action_87
+action_693 (49) = happyGoto action_698
+action_693 (50) = happyGoto action_168
+action_693 (153) = happyGoto action_48
+action_693 (154) = happyGoto action_172
+action_693 (156) = happyGoto action_173
+action_693 (157) = happyGoto action_52
+action_693 (174) = happyGoto action_174
+action_693 _ = happyFail
+
+action_694 _ = happyReduce_152
+
+action_695 _ = happyReduce_333
+
+action_696 (177) = happyShift action_15
+action_696 (181) = happyShift action_16
+action_696 (183) = happyShift action_17
+action_696 (259) = happyShift action_18
+action_696 (281) = happyShift action_19
+action_696 (110) = happyGoto action_697
+action_696 (111) = happyGoto action_14
+action_696 _ = happyFail
+
+action_697 (247) = happyShift action_737
+action_697 _ = happyFail
+
+action_698 _ = happyReduce_160
+
+action_699 (177) = happyShift action_114
+action_699 (181) = happyShift action_115
+action_699 (182) = happyShift action_60
+action_699 (185) = happyReduce_164
+action_699 (193) = happyShift action_175
+action_699 (195) = happyShift action_176
+action_699 (201) = happyShift action_177
+action_699 (205) = happyReduce_164
+action_699 (219) = happyShift action_693
+action_699 (251) = happyShift action_79
+action_699 (252) = happyShift action_80
+action_699 (253) = happyShift action_81
+action_699 (254) = happyShift action_82
+action_699 (255) = happyShift action_83
+action_699 (256) = happyShift action_84
+action_699 (257) = happyShift action_85
+action_699 (267) = happyShift action_86
+action_699 (284) = happyShift action_87
+action_699 (49) = happyGoto action_299
+action_699 (50) = happyGoto action_168
+action_699 (153) = happyGoto action_48
+action_699 (154) = happyGoto action_172
+action_699 (156) = happyGoto action_173
+action_699 (157) = happyGoto action_52
+action_699 (174) = happyGoto action_174
+action_699 _ = happyReduce_158
+
+action_700 _ = happyReduce_150
+
+action_701 _ = happyReduce_163
+
+action_702 (177) = happyShift action_114
+action_702 (181) = happyShift action_115
+action_702 (182) = happyShift action_60
+action_702 (193) = happyShift action_175
+action_702 (195) = happyShift action_176
+action_702 (201) = happyShift action_177
+action_702 (251) = happyShift action_79
+action_702 (252) = happyShift action_80
+action_702 (253) = happyShift action_81
+action_702 (254) = happyShift action_82
+action_702 (255) = happyShift action_83
+action_702 (256) = happyShift action_84
+action_702 (257) = happyShift action_85
+action_702 (267) = happyShift action_86
+action_702 (284) = happyShift action_87
+action_702 (49) = happyGoto action_299
+action_702 (50) = happyGoto action_168
+action_702 (153) = happyGoto action_48
+action_702 (154) = happyGoto action_172
+action_702 (156) = happyGoto action_173
+action_702 (157) = happyGoto action_52
+action_702 (174) = happyGoto action_174
+action_702 _ = happyReduce_164
+
+action_703 _ = happyReduce_155
+
+action_704 (203) = happyShift action_356
+action_704 (209) = happyShift action_736
+action_704 _ = happyFail
+
+action_705 (199) = happyShift action_734
+action_705 (203) = happyShift action_735
+action_705 _ = happyFail
+
+action_706 _ = happyReduce_167
+
+action_707 _ = happyReduce_96
+
+action_708 _ = happyReduce_156
+
+action_709 _ = happyReduce_320
+
+action_710 _ = happyReduce_184
+
+action_711 (177) = happyShift action_114
+action_711 (181) = happyShift action_115
+action_711 (193) = happyShift action_374
+action_711 (194) = happyShift action_732
+action_711 (207) = happyShift action_733
+action_711 (251) = happyShift action_79
+action_711 (252) = happyShift action_80
+action_711 (253) = happyShift action_81
+action_711 (254) = happyShift action_82
+action_711 (255) = happyShift action_83
+action_711 (256) = happyShift action_84
+action_711 (257) = happyShift action_85
+action_711 (267) = happyShift action_86
+action_711 (284) = happyShift action_87
+action_711 (26) = happyGoto action_731
+action_711 (27) = happyGoto action_369
+action_711 (137) = happyGoto action_370
+action_711 (141) = happyGoto action_371
+action_711 (153) = happyGoto action_48
+action_711 (154) = happyGoto action_372
+action_711 (157) = happyGoto action_373
+action_711 _ = happyFail
+
+action_712 (194) = happyShift action_730
+action_712 _ = happyFail
+
+action_713 (177) = happyShift action_114
+action_713 (181) = happyShift action_115
+action_713 (193) = happyShift action_386
+action_713 (251) = happyShift action_79
+action_713 (252) = happyShift action_80
+action_713 (253) = happyShift action_81
+action_713 (254) = happyShift action_82
+action_713 (255) = happyShift action_83
+action_713 (256) = happyShift action_84
+action_713 (257) = happyShift action_85
+action_713 (267) = happyShift action_86
+action_713 (284) = happyShift action_87
+action_713 (25) = happyGoto action_729
+action_713 (137) = happyGoto action_679
+action_713 (153) = happyGoto action_48
+action_713 (154) = happyGoto action_372
+action_713 (157) = happyGoto action_680
+action_713 (170) = happyGoto action_681
+action_713 _ = happyReduce_23
+
+action_714 _ = happyReduce_43
+
+action_715 _ = happyReduce_143
+
+action_716 (177) = happyShift action_114
+action_716 (179) = happyShift action_57
+action_716 (180) = happyShift action_58
+action_716 (181) = happyShift action_115
+action_716 (182) = happyShift action_60
+action_716 (193) = happyShift action_175
+action_716 (195) = happyShift action_176
+action_716 (201) = happyShift action_177
+action_716 (251) = happyShift action_79
+action_716 (252) = happyShift action_80
+action_716 (253) = happyShift action_81
+action_716 (254) = happyShift action_82
+action_716 (255) = happyShift action_83
+action_716 (256) = happyShift action_84
+action_716 (257) = happyShift action_85
+action_716 (266) = happyShift action_178
+action_716 (267) = happyShift action_86
+action_716 (284) = happyShift action_87
+action_716 (46) = happyGoto action_164
+action_716 (47) = happyGoto action_165
+action_716 (48) = happyGoto action_166
+action_716 (49) = happyGoto action_167
+action_716 (50) = happyGoto action_168
+action_716 (52) = happyGoto action_728
+action_716 (53) = happyGoto action_170
+action_716 (140) = happyGoto action_171
+action_716 (153) = happyGoto action_48
+action_716 (154) = happyGoto action_172
+action_716 (155) = happyGoto action_50
+action_716 (156) = happyGoto action_173
+action_716 (157) = happyGoto action_52
+action_716 (174) = happyGoto action_174
+action_716 _ = happyFail
+
+action_717 _ = happyReduce_175
+
+action_718 _ = happyReduce_308
+
+action_719 (282) = happyShift action_392
+action_719 (84) = happyGoto action_727
+action_719 _ = happyReduce_188
+
+action_720 (212) = happyReduce_404
+action_720 (126) = happyGoto action_726
+action_720 (166) = happyGoto action_722
+action_720 _ = happyReduce_312
+
+action_721 _ = happyReduce_314
+
+action_722 (212) = happyShift action_725
+action_722 _ = happyFail
+
+action_723 (177) = happyShift action_114
+action_723 (178) = happyShift action_56
+action_723 (179) = happyShift action_57
+action_723 (180) = happyShift action_58
+action_723 (181) = happyShift action_115
+action_723 (182) = happyShift action_60
+action_723 (183) = happyShift action_129
+action_723 (188) = happyShift action_61
+action_723 (189) = happyShift action_62
+action_723 (190) = happyShift action_63
+action_723 (191) = happyShift action_64
+action_723 (193) = happyShift action_65
+action_723 (201) = happyShift action_66
+action_723 (204) = happyShift action_67
+action_723 (211) = happyShift action_158
+action_723 (216) = happyShift action_68
+action_723 (218) = happyShift action_130
+action_723 (219) = happyShift action_69
+action_723 (220) = happyShift action_70
+action_723 (223) = happyShift action_71
+action_723 (233) = happyShift action_72
+action_723 (234) = happyShift action_73
+action_723 (235) = happyShift action_74
+action_723 (236) = happyShift action_75
+action_723 (237) = happyShift action_76
+action_723 (238) = happyShift action_77
+action_723 (240) = happyShift action_132
+action_723 (241) = happyShift action_133
+action_723 (242) = happyShift action_134
+action_723 (246) = happyShift action_78
+action_723 (251) = happyShift action_79
+action_723 (252) = happyShift action_80
+action_723 (253) = happyShift action_81
+action_723 (254) = happyShift action_82
+action_723 (255) = happyShift action_83
+action_723 (256) = happyShift action_84
+action_723 (257) = happyShift action_85
+action_723 (258) = happyShift action_136
+action_723 (263) = happyShift action_159
+action_723 (264) = happyShift action_140
+action_723 (267) = happyShift action_86
+action_723 (268) = happyShift action_160
+action_723 (275) = happyShift action_161
+action_723 (276) = happyShift action_146
+action_723 (284) = happyShift action_87
+action_723 (88) = happyGoto action_724
+action_723 (89) = happyGoto action_154
+action_723 (90) = happyGoto action_155
+action_723 (91) = happyGoto action_156
+action_723 (92) = happyGoto action_157
+action_723 (93) = happyGoto action_123
+action_723 (94) = happyGoto action_124
+action_723 (97) = happyGoto action_125
+action_723 (98) = happyGoto action_37
+action_723 (99) = happyGoto action_38
+action_723 (100) = happyGoto action_126
+action_723 (107) = happyGoto action_39
+action_723 (115) = happyGoto action_127
+action_723 (136) = happyGoto action_43
+action_723 (139) = happyGoto action_44
+action_723 (140) = happyGoto action_45
+action_723 (142) = happyGoto action_46
+action_723 (152) = happyGoto action_47
+action_723 (153) = happyGoto action_48
+action_723 (154) = happyGoto action_49
+action_723 (155) = happyGoto action_50
+action_723 (156) = happyGoto action_51
+action_723 (157) = happyGoto action_52
+action_723 (165) = happyGoto action_53
+action_723 (166) = happyGoto action_54
+action_723 _ = happyReduce_404
+
+action_724 _ = happyReduce_311
+
+action_725 (177) = happyShift action_114
+action_725 (178) = happyShift action_56
+action_725 (179) = happyShift action_57
+action_725 (180) = happyShift action_58
+action_725 (181) = happyShift action_115
+action_725 (182) = happyShift action_60
+action_725 (183) = happyShift action_129
+action_725 (188) = happyShift action_61
+action_725 (189) = happyShift action_62
+action_725 (190) = happyShift action_63
+action_725 (191) = happyShift action_64
+action_725 (193) = happyShift action_65
+action_725 (201) = happyShift action_66
+action_725 (204) = happyShift action_67
+action_725 (211) = happyShift action_158
+action_725 (216) = happyShift action_68
+action_725 (218) = happyShift action_130
+action_725 (219) = happyShift action_69
+action_725 (220) = happyShift action_70
+action_725 (223) = happyShift action_71
+action_725 (233) = happyShift action_72
+action_725 (234) = happyShift action_73
+action_725 (235) = happyShift action_74
+action_725 (236) = happyShift action_75
+action_725 (237) = happyShift action_76
+action_725 (238) = happyShift action_77
+action_725 (240) = happyShift action_132
+action_725 (241) = happyShift action_133
+action_725 (242) = happyShift action_134
+action_725 (246) = happyShift action_78
+action_725 (251) = happyShift action_79
+action_725 (252) = happyShift action_80
+action_725 (253) = happyShift action_81
+action_725 (254) = happyShift action_82
+action_725 (255) = happyShift action_83
+action_725 (256) = happyShift action_84
+action_725 (257) = happyShift action_85
+action_725 (258) = happyShift action_136
+action_725 (263) = happyShift action_159
+action_725 (264) = happyShift action_140
+action_725 (267) = happyShift action_86
+action_725 (268) = happyShift action_160
+action_725 (275) = happyShift action_457
+action_725 (276) = happyShift action_146
+action_725 (284) = happyShift action_87
+action_725 (88) = happyGoto action_453
+action_725 (89) = happyGoto action_154
+action_725 (90) = happyGoto action_155
+action_725 (91) = happyGoto action_412
+action_725 (92) = happyGoto action_157
+action_725 (93) = happyGoto action_123
+action_725 (94) = happyGoto action_124
+action_725 (97) = happyGoto action_125
+action_725 (98) = happyGoto action_37
+action_725 (99) = happyGoto action_38
+action_725 (100) = happyGoto action_126
+action_725 (107) = happyGoto action_39
+action_725 (115) = happyGoto action_127
+action_725 (118) = happyGoto action_744
+action_725 (119) = happyGoto action_455
+action_725 (127) = happyGoto action_456
+action_725 (136) = happyGoto action_43
+action_725 (139) = happyGoto action_44
+action_725 (140) = happyGoto action_45
+action_725 (142) = happyGoto action_46
+action_725 (152) = happyGoto action_47
+action_725 (153) = happyGoto action_48
+action_725 (154) = happyGoto action_49
+action_725 (155) = happyGoto action_50
+action_725 (156) = happyGoto action_51
+action_725 (157) = happyGoto action_52
+action_725 (165) = happyGoto action_53
+action_725 (166) = happyGoto action_54
+action_725 _ = happyReduce_404
+
+action_726 _ = happyReduce_313
+
+action_727 _ = happyReduce_310
+
+action_728 _ = happyReduce_145
+
+action_729 _ = happyReduce_46
+
+action_730 _ = happyReduce_42
+
+action_731 (194) = happyShift action_743
+action_731 (203) = happyShift action_561
+action_731 _ = happyFail
+
+action_732 _ = happyReduce_51
+
+action_733 (194) = happyShift action_742
+action_733 _ = happyFail
+
+action_734 _ = happyReduce_157
+
+action_735 (177) = happyShift action_114
+action_735 (178) = happyShift action_56
+action_735 (193) = happyShift action_116
+action_735 (251) = happyShift action_79
+action_735 (252) = happyShift action_80
+action_735 (253) = happyShift action_81
+action_735 (254) = happyShift action_82
+action_735 (255) = happyShift action_83
+action_735 (256) = happyShift action_84
+action_735 (257) = happyShift action_85
+action_735 (267) = happyShift action_86
+action_735 (284) = happyShift action_87
+action_735 (42) = happyGoto action_704
+action_735 (75) = happyGoto action_741
+action_735 (139) = happyGoto action_707
+action_735 (152) = happyGoto action_47
+action_735 (153) = happyGoto action_48
+action_735 (154) = happyGoto action_49
+action_735 _ = happyFail
+
+action_736 (177) = happyShift action_114
+action_736 (179) = happyShift action_57
+action_736 (180) = happyShift action_58
+action_736 (181) = happyShift action_115
+action_736 (182) = happyShift action_60
+action_736 (193) = happyShift action_175
+action_736 (195) = happyShift action_176
+action_736 (201) = happyShift action_177
+action_736 (219) = happyShift action_740
+action_736 (251) = happyShift action_79
+action_736 (252) = happyShift action_80
+action_736 (253) = happyShift action_81
+action_736 (254) = happyShift action_82
+action_736 (255) = happyShift action_83
+action_736 (256) = happyShift action_84
+action_736 (257) = happyShift action_85
+action_736 (266) = happyShift action_178
+action_736 (267) = happyShift action_86
+action_736 (284) = happyShift action_87
+action_736 (46) = happyGoto action_164
+action_736 (47) = happyGoto action_165
+action_736 (48) = happyGoto action_166
+action_736 (49) = happyGoto action_167
+action_736 (50) = happyGoto action_168
+action_736 (52) = happyGoto action_738
+action_736 (53) = happyGoto action_170
+action_736 (76) = happyGoto action_739
+action_736 (140) = happyGoto action_171
+action_736 (153) = happyGoto action_48
+action_736 (154) = happyGoto action_172
+action_736 (155) = happyGoto action_50
+action_736 (156) = happyGoto action_173
+action_736 (157) = happyGoto action_52
+action_736 (174) = happyGoto action_174
+action_736 _ = happyFail
+
+action_737 _ = happyReduce_270
+
+action_738 _ = happyReduce_169
+
+action_739 _ = happyReduce_168
+
+action_740 (177) = happyShift action_114
+action_740 (181) = happyShift action_115
+action_740 (182) = happyShift action_60
+action_740 (193) = happyShift action_175
+action_740 (195) = happyShift action_176
+action_740 (201) = happyShift action_177
+action_740 (251) = happyShift action_79
+action_740 (252) = happyShift action_80
+action_740 (253) = happyShift action_81
+action_740 (254) = happyShift action_82
+action_740 (255) = happyShift action_83
+action_740 (256) = happyShift action_84
+action_740 (257) = happyShift action_85
+action_740 (267) = happyShift action_86
+action_740 (284) = happyShift action_87
+action_740 (49) = happyGoto action_746
+action_740 (50) = happyGoto action_168
+action_740 (153) = happyGoto action_48
+action_740 (154) = happyGoto action_172
+action_740 (156) = happyGoto action_173
+action_740 (157) = happyGoto action_52
+action_740 (174) = happyGoto action_174
+action_740 _ = happyFail
+
+action_741 _ = happyReduce_166
+
+action_742 _ = happyReduce_50
+
+action_743 _ = happyReduce_52
+
+action_744 (203) = happyShift action_492
+action_744 (214) = happyShift action_745
+action_744 _ = happyFail
+
+action_745 (177) = happyShift action_114
+action_745 (178) = happyShift action_56
+action_745 (179) = happyShift action_57
+action_745 (180) = happyShift action_58
+action_745 (181) = happyShift action_115
+action_745 (182) = happyShift action_60
+action_745 (183) = happyShift action_129
+action_745 (188) = happyShift action_61
+action_745 (189) = happyShift action_62
+action_745 (190) = happyShift action_63
+action_745 (191) = happyShift action_64
+action_745 (193) = happyShift action_65
+action_745 (201) = happyShift action_66
+action_745 (204) = happyShift action_67
+action_745 (211) = happyShift action_158
+action_745 (216) = happyShift action_68
+action_745 (218) = happyShift action_130
+action_745 (219) = happyShift action_69
+action_745 (220) = happyShift action_70
+action_745 (223) = happyShift action_71
+action_745 (233) = happyShift action_72
+action_745 (234) = happyShift action_73
+action_745 (235) = happyShift action_74
+action_745 (236) = happyShift action_75
+action_745 (237) = happyShift action_76
+action_745 (238) = happyShift action_77
+action_745 (240) = happyShift action_132
+action_745 (241) = happyShift action_133
+action_745 (242) = happyShift action_134
+action_745 (246) = happyShift action_78
+action_745 (251) = happyShift action_79
+action_745 (252) = happyShift action_80
+action_745 (253) = happyShift action_81
+action_745 (254) = happyShift action_82
+action_745 (255) = happyShift action_83
+action_745 (256) = happyShift action_84
+action_745 (257) = happyShift action_85
+action_745 (258) = happyShift action_136
+action_745 (263) = happyShift action_159
+action_745 (264) = happyShift action_140
+action_745 (267) = happyShift action_86
+action_745 (268) = happyShift action_160
+action_745 (275) = happyShift action_161
+action_745 (276) = happyShift action_146
+action_745 (284) = happyShift action_87
+action_745 (88) = happyGoto action_747
+action_745 (89) = happyGoto action_154
+action_745 (90) = happyGoto action_155
+action_745 (91) = happyGoto action_156
+action_745 (92) = happyGoto action_157
+action_745 (93) = happyGoto action_123
+action_745 (94) = happyGoto action_124
+action_745 (97) = happyGoto action_125
+action_745 (98) = happyGoto action_37
+action_745 (99) = happyGoto action_38
+action_745 (100) = happyGoto action_126
+action_745 (107) = happyGoto action_39
+action_745 (115) = happyGoto action_127
+action_745 (136) = happyGoto action_43
+action_745 (139) = happyGoto action_44
+action_745 (140) = happyGoto action_45
+action_745 (142) = happyGoto action_46
+action_745 (152) = happyGoto action_47
+action_745 (153) = happyGoto action_48
+action_745 (154) = happyGoto action_49
+action_745 (155) = happyGoto action_50
+action_745 (156) = happyGoto action_51
+action_745 (157) = happyGoto action_52
+action_745 (165) = happyGoto action_53
+action_745 (166) = happyGoto action_54
+action_745 _ = happyReduce_404
+
+action_746 _ = happyReduce_170
+
+action_747 _ = happyReduce_315
+
+happyReduce_1 = happyMonadReduce 1 4 happyReduction_1
+happyReduction_1 ((HappyAbsSyn5 happy_var_1) `HappyStk`
+ happyRest)
+ = happyThen ( mkPageModule happy_var_1
+ ) (\r -> happyReturn (HappyAbsSyn4 r))
+
+happyReduce_2 = happyMonadReduce 5 4 happyReduction_2
+happyReduction_2 ((HappyAbsSyn5 happy_var_5) `HappyStk`
+ (HappyAbsSyn166 happy_var_4) `HappyStk`
+ _ `HappyStk`
+ (HappyAbsSyn4 happy_var_2) `HappyStk`
+ _ `HappyStk`
+ happyRest)
+ = happyThen ( mkPage happy_var_2 happy_var_4 happy_var_5
+ ) (\r -> happyReturn (HappyAbsSyn4 r))
+
+happyReduce_3 = happySpecReduce_1 4 happyReduction_3
+happyReduction_3 (HappyAbsSyn4 happy_var_1)
+ = HappyAbsSyn4
+ (happy_var_1
+ )
+happyReduction_3 _ = notHappyAtAll
+
+happyReduce_4 = happyMonadReduce 10 5 happyReduction_4
+happyReduction_4 (_ `HappyStk`
+ (HappyAbsSyn110 happy_var_9) `HappyStk`
+ _ `HappyStk`
+ (HappyAbsSyn103 happy_var_7) `HappyStk`
+ _ `HappyStk`
+ (HappyAbsSyn114 happy_var_5) `HappyStk`
+ (HappyAbsSyn112 happy_var_4) `HappyStk`
+ (HappyAbsSyn110 happy_var_3) `HappyStk`
+ _ `HappyStk`
+ (HappyAbsSyn166 happy_var_1) `HappyStk`
+ happyRest)
+ = happyThen ( do { n <- checkEqNames happy_var_3 happy_var_9;
+ let { cn = reverse happy_var_7;
+ as = reverse happy_var_4; };
+ return $ HsXTag happy_var_1 n as happy_var_5 cn }
+ ) (\r -> happyReturn (HappyAbsSyn5 r))
+
+happyReduce_5 = happyReduce 6 5 happyReduction_5
+happyReduction_5 (_ `HappyStk`
+ (HappyAbsSyn114 happy_var_5) `HappyStk`
+ (HappyAbsSyn112 happy_var_4) `HappyStk`
+ (HappyAbsSyn110 happy_var_3) `HappyStk`
+ _ `HappyStk`
+ (HappyAbsSyn166 happy_var_1) `HappyStk`
+ happyRest)
+ = HappyAbsSyn5
+ (HsXETag happy_var_1 happy_var_3 (reverse happy_var_4) happy_var_5
+ ) `HappyStk` happyRest
+
+happyReduce_6 = happyReduce 7 6 happyReduction_6
+happyReduction_6 ((HappyAbsSyn8 happy_var_7) `HappyStk`
+ _ `HappyStk`
+ (HappyAbsSyn12 happy_var_5) `HappyStk`
+ (HappyAbsSyn169 happy_var_4) `HappyStk`
+ _ `HappyStk`
+ (HappyAbsSyn7 happy_var_2) `HappyStk`
+ (HappyAbsSyn166 happy_var_1) `HappyStk`
+ happyRest)
+ = HappyAbsSyn4
+ (HsModule happy_var_1 happy_var_2 happy_var_4 happy_var_5 (fst happy_var_7) (snd happy_var_7)
+ ) `HappyStk` happyRest
+
+happyReduce_7 = happySpecReduce_3 6 happyReduction_7
+happyReduction_7 (HappyAbsSyn8 happy_var_3)
+ (HappyAbsSyn7 happy_var_2)
+ (HappyAbsSyn166 happy_var_1)
+ = HappyAbsSyn4
+ (HsModule happy_var_1 happy_var_2 main_mod (Just [HsEVar (UnQual main_name)])
+ (fst happy_var_3) (snd happy_var_3)
+ )
+happyReduction_7 _ _ _ = notHappyAtAll
+
+happyReduce_8 = happySpecReduce_2 7 happyReduction_8
+happyReduction_8 (HappyAbsSyn7 happy_var_2)
+ (HappyTerminal (Pragma happy_var_1))
+ = HappyAbsSyn7
+ (HsPragma happy_var_1 : happy_var_2
+ )
+happyReduction_8 _ _ = notHappyAtAll
+
+happyReduce_9 = happySpecReduce_0 7 happyReduction_9
+happyReduction_9 = HappyAbsSyn7
+ ([]
+ )
+
+happyReduce_10 = happySpecReduce_3 8 happyReduction_10
+happyReduction_10 _
+ (HappyAbsSyn8 happy_var_2)
+ _
+ = HappyAbsSyn8
+ (happy_var_2
+ )
+happyReduction_10 _ _ _ = notHappyAtAll
+
+happyReduce_11 = happySpecReduce_3 8 happyReduction_11
+happyReduction_11 _
+ (HappyAbsSyn8 happy_var_2)
+ _
+ = HappyAbsSyn8
+ (happy_var_2
+ )
+happyReduction_11 _ _ _ = notHappyAtAll
+
+happyReduce_12 = happyReduce 4 9 happyReduction_12
+happyReduction_12 ((HappyAbsSyn32 happy_var_4) `HappyStk`
+ _ `HappyStk`
+ (HappyAbsSyn17 happy_var_2) `HappyStk`
+ _ `HappyStk`
+ happyRest)
+ = HappyAbsSyn8
+ ((reverse happy_var_2, happy_var_4)
+ ) `HappyStk` happyRest
+
+happyReduce_13 = happySpecReduce_2 9 happyReduction_13
+happyReduction_13 (HappyAbsSyn32 happy_var_2)
+ _
+ = HappyAbsSyn8
+ (([], happy_var_2)
+ )
+happyReduction_13 _ _ = notHappyAtAll
+
+happyReduce_14 = happySpecReduce_3 9 happyReduction_14
+happyReduction_14 _
+ (HappyAbsSyn17 happy_var_2)
+ _
+ = HappyAbsSyn8
+ ((reverse happy_var_2, [])
+ )
+happyReduction_14 _ _ _ = notHappyAtAll
+
+happyReduce_15 = happySpecReduce_1 9 happyReduction_15
+happyReduction_15 _
+ = HappyAbsSyn8
+ (([], [])
+ )
+
+happyReduce_16 = happySpecReduce_2 10 happyReduction_16
+happyReduction_16 _
+ _
+ = HappyAbsSyn10
+ (()
+ )
+
+happyReduce_17 = happySpecReduce_1 11 happyReduction_17
+happyReduction_17 _
+ = HappyAbsSyn10
+ (()
+ )
+
+happyReduce_18 = happySpecReduce_0 11 happyReduction_18
+happyReduction_18 = HappyAbsSyn10
+ (()
+ )
+
+happyReduce_19 = happySpecReduce_1 12 happyReduction_19
+happyReduction_19 (HappyAbsSyn13 happy_var_1)
+ = HappyAbsSyn12
+ (Just happy_var_1
+ )
+happyReduction_19 _ = notHappyAtAll
+
+happyReduce_20 = happySpecReduce_0 12 happyReduction_20
+happyReduction_20 = HappyAbsSyn12
+ (Nothing
+ )
+
+happyReduce_21 = happyReduce 4 13 happyReduction_21
+happyReduction_21 (_ `HappyStk`
+ _ `HappyStk`
+ (HappyAbsSyn13 happy_var_2) `HappyStk`
+ _ `HappyStk`
+ happyRest)
+ = HappyAbsSyn13
+ (reverse happy_var_2
+ ) `HappyStk` happyRest
+
+happyReduce_22 = happySpecReduce_3 13 happyReduction_22
+happyReduction_22 _
+ _
+ _
+ = HappyAbsSyn13
+ ([]
+ )
+
+happyReduce_23 = happySpecReduce_1 14 happyReduction_23
+happyReduction_23 _
+ = HappyAbsSyn10
+ (()
+ )
+
+happyReduce_24 = happySpecReduce_0 14 happyReduction_24
+happyReduction_24 = HappyAbsSyn10
+ (()
+ )
+
+happyReduce_25 = happySpecReduce_3 15 happyReduction_25
+happyReduction_25 (HappyAbsSyn16 happy_var_3)
+ _
+ (HappyAbsSyn13 happy_var_1)
+ = HappyAbsSyn13
+ (happy_var_3 : happy_var_1
+ )
+happyReduction_25 _ _ _ = notHappyAtAll
+
+happyReduce_26 = happySpecReduce_1 15 happyReduction_26
+happyReduction_26 (HappyAbsSyn16 happy_var_1)
+ = HappyAbsSyn13
+ ([happy_var_1]
+ )
+happyReduction_26 _ = notHappyAtAll
+
+happyReduce_27 = happySpecReduce_1 16 happyReduction_27
+happyReduction_27 (HappyAbsSyn50 happy_var_1)
+ = HappyAbsSyn16
+ (HsEVar happy_var_1
+ )
+happyReduction_27 _ = notHappyAtAll
+
+happyReduce_28 = happySpecReduce_1 16 happyReduction_28
+happyReduction_28 (HappyAbsSyn50 happy_var_1)
+ = HappyAbsSyn16
+ (HsEAbs happy_var_1
+ )
+happyReduction_28 _ = notHappyAtAll
+
+happyReduce_29 = happyReduce 4 16 happyReduction_29
+happyReduction_29 (_ `HappyStk`
+ _ `HappyStk`
+ _ `HappyStk`
+ (HappyAbsSyn50 happy_var_1) `HappyStk`
+ happyRest)
+ = HappyAbsSyn16
+ (HsEThingAll happy_var_1
+ ) `HappyStk` happyRest
+
+happyReduce_30 = happySpecReduce_3 16 happyReduction_30
+happyReduction_30 _
+ _
+ (HappyAbsSyn50 happy_var_1)
+ = HappyAbsSyn16
+ (HsEThingWith happy_var_1 []
+ )
+happyReduction_30 _ _ _ = notHappyAtAll
+
+happyReduce_31 = happyReduce 4 16 happyReduction_31
+happyReduction_31 (_ `HappyStk`
+ (HappyAbsSyn26 happy_var_3) `HappyStk`
+ _ `HappyStk`
+ (HappyAbsSyn50 happy_var_1) `HappyStk`
+ happyRest)
+ = HappyAbsSyn16
+ (HsEThingWith happy_var_1 (reverse happy_var_3)
+ ) `HappyStk` happyRest
+
+happyReduce_32 = happySpecReduce_2 16 happyReduction_32
+happyReduction_32 (HappyAbsSyn169 happy_var_2)
+ _
+ = HappyAbsSyn16
+ (HsEModuleContents happy_var_2
+ )
+happyReduction_32 _ _ = notHappyAtAll
+
+happyReduce_33 = happySpecReduce_3 17 happyReduction_33
+happyReduction_33 (HappyAbsSyn18 happy_var_3)
+ _
+ (HappyAbsSyn17 happy_var_1)
+ = HappyAbsSyn17
+ (happy_var_3 : happy_var_1
+ )
+happyReduction_33 _ _ _ = notHappyAtAll
+
+happyReduce_34 = happySpecReduce_1 17 happyReduction_34
+happyReduction_34 (HappyAbsSyn18 happy_var_1)
+ = HappyAbsSyn17
+ ([happy_var_1]
+ )
+happyReduction_34 _ = notHappyAtAll
+
+happyReduce_35 = happyReduce 6 18 happyReduction_35
+happyReduction_35 ((HappyAbsSyn21 happy_var_6) `HappyStk`
+ (HappyAbsSyn20 happy_var_5) `HappyStk`
+ (HappyAbsSyn169 happy_var_4) `HappyStk`
+ (HappyAbsSyn19 happy_var_3) `HappyStk`
+ _ `HappyStk`
+ (HappyAbsSyn166 happy_var_1) `HappyStk`
+ happyRest)
+ = HappyAbsSyn18
+ (HsImportDecl happy_var_1 happy_var_4 happy_var_3 happy_var_5 happy_var_6
+ ) `HappyStk` happyRest
+
+happyReduce_36 = happySpecReduce_1 19 happyReduction_36
+happyReduction_36 _
+ = HappyAbsSyn19
+ (True
+ )
+
+happyReduce_37 = happySpecReduce_0 19 happyReduction_37
+happyReduction_37 = HappyAbsSyn19
+ (False
+ )
+
+happyReduce_38 = happySpecReduce_2 20 happyReduction_38
+happyReduction_38 (HappyAbsSyn169 happy_var_2)
+ _
+ = HappyAbsSyn20
+ (Just happy_var_2
+ )
+happyReduction_38 _ _ = notHappyAtAll
+
+happyReduce_39 = happySpecReduce_0 20 happyReduction_39
+happyReduction_39 = HappyAbsSyn20
+ (Nothing
+ )
+
+happyReduce_40 = happySpecReduce_1 21 happyReduction_40
+happyReduction_40 (HappyAbsSyn22 happy_var_1)
+ = HappyAbsSyn21
+ (Just happy_var_1
+ )
+happyReduction_40 _ = notHappyAtAll
+
+happyReduce_41 = happySpecReduce_0 21 happyReduction_41
+happyReduction_41 = HappyAbsSyn21
+ (Nothing
+ )
+
+happyReduce_42 = happyReduce 5 22 happyReduction_42
+happyReduction_42 (_ `HappyStk`
+ _ `HappyStk`
+ (HappyAbsSyn24 happy_var_3) `HappyStk`
+ _ `HappyStk`
+ (HappyAbsSyn19 happy_var_1) `HappyStk`
+ happyRest)
+ = HappyAbsSyn22
+ ((happy_var_1, reverse happy_var_3)
+ ) `HappyStk` happyRest
+
+happyReduce_43 = happyReduce 4 22 happyReduction_43
+happyReduction_43 (_ `HappyStk`
+ _ `HappyStk`
+ _ `HappyStk`
+ (HappyAbsSyn19 happy_var_1) `HappyStk`
+ happyRest)
+ = HappyAbsSyn22
+ ((happy_var_1, [])
+ ) `HappyStk` happyRest
+
+happyReduce_44 = happySpecReduce_1 23 happyReduction_44
+happyReduction_44 _
+ = HappyAbsSyn19
+ (True
+ )
+
+happyReduce_45 = happySpecReduce_0 23 happyReduction_45
+happyReduction_45 = HappyAbsSyn19
+ (False
+ )
+
+happyReduce_46 = happySpecReduce_3 24 happyReduction_46
+happyReduction_46 (HappyAbsSyn25 happy_var_3)
+ _
+ (HappyAbsSyn24 happy_var_1)
+ = HappyAbsSyn24
+ (happy_var_3 : happy_var_1
+ )
+happyReduction_46 _ _ _ = notHappyAtAll
+
+happyReduce_47 = happySpecReduce_1 24 happyReduction_47
+happyReduction_47 (HappyAbsSyn25 happy_var_1)
+ = HappyAbsSyn24
+ ([happy_var_1]
+ )
+happyReduction_47 _ = notHappyAtAll
+
+happyReduce_48 = happySpecReduce_1 25 happyReduction_48
+happyReduction_48 (HappyAbsSyn137 happy_var_1)
+ = HappyAbsSyn25
+ (HsIVar happy_var_1
+ )
+happyReduction_48 _ = notHappyAtAll
+
+happyReduce_49 = happySpecReduce_1 25 happyReduction_49
+happyReduction_49 (HappyAbsSyn137 happy_var_1)
+ = HappyAbsSyn25
+ (HsIAbs happy_var_1
+ )
+happyReduction_49 _ = notHappyAtAll
+
+happyReduce_50 = happyReduce 4 25 happyReduction_50
+happyReduction_50 (_ `HappyStk`
+ _ `HappyStk`
+ _ `HappyStk`
+ (HappyAbsSyn137 happy_var_1) `HappyStk`
+ happyRest)
+ = HappyAbsSyn25
+ (HsIThingAll happy_var_1
+ ) `HappyStk` happyRest
+
+happyReduce_51 = happySpecReduce_3 25 happyReduction_51
+happyReduction_51 _
+ _
+ (HappyAbsSyn137 happy_var_1)
+ = HappyAbsSyn25
+ (HsIThingWith happy_var_1 []
+ )
+happyReduction_51 _ _ _ = notHappyAtAll
+
+happyReduce_52 = happyReduce 4 25 happyReduction_52
+happyReduction_52 (_ `HappyStk`
+ (HappyAbsSyn26 happy_var_3) `HappyStk`
+ _ `HappyStk`
+ (HappyAbsSyn137 happy_var_1) `HappyStk`
+ happyRest)
+ = HappyAbsSyn25
+ (HsIThingWith happy_var_1 (reverse happy_var_3)
+ ) `HappyStk` happyRest
+
+happyReduce_53 = happySpecReduce_3 26 happyReduction_53
+happyReduction_53 (HappyAbsSyn27 happy_var_3)
+ _
+ (HappyAbsSyn26 happy_var_1)
+ = HappyAbsSyn26
+ (happy_var_3 : happy_var_1
+ )
+happyReduction_53 _ _ _ = notHappyAtAll
+
+happyReduce_54 = happySpecReduce_1 26 happyReduction_54
+happyReduction_54 (HappyAbsSyn27 happy_var_1)
+ = HappyAbsSyn26
+ ([happy_var_1]
+ )
+happyReduction_54 _ = notHappyAtAll
+
+happyReduce_55 = happySpecReduce_1 27 happyReduction_55
+happyReduction_55 (HappyAbsSyn137 happy_var_1)
+ = HappyAbsSyn27
+ (HsVarName happy_var_1
+ )
+happyReduction_55 _ = notHappyAtAll
+
+happyReduce_56 = happySpecReduce_1 27 happyReduction_56
+happyReduction_56 (HappyAbsSyn137 happy_var_1)
+ = HappyAbsSyn27
+ (HsConName happy_var_1
+ )
+happyReduction_56 _ = notHappyAtAll
+
+happyReduce_57 = happyReduce 4 28 happyReduction_57
+happyReduction_57 ((HappyAbsSyn31 happy_var_4) `HappyStk`
+ (HappyAbsSyn29 happy_var_3) `HappyStk`
+ (HappyAbsSyn30 happy_var_2) `HappyStk`
+ (HappyAbsSyn166 happy_var_1) `HappyStk`
+ happyRest)
+ = HappyAbsSyn28
+ (HsInfixDecl happy_var_1 happy_var_2 happy_var_3 (reverse happy_var_4)
+ ) `HappyStk` happyRest
+
+happyReduce_58 = happySpecReduce_0 29 happyReduction_58
+happyReduction_58 = HappyAbsSyn29
+ (9
+ )
+
+happyReduce_59 = happyMonadReduce 1 29 happyReduction_59
+happyReduction_59 ((HappyTerminal (IntTok happy_var_1)) `HappyStk`
+ happyRest)
+ = happyThen ( checkPrec happy_var_1
+ ) (\r -> happyReturn (HappyAbsSyn29 r))
+
+happyReduce_60 = happySpecReduce_1 30 happyReduction_60
+happyReduction_60 _
+ = HappyAbsSyn30
+ (HsAssocNone
+ )
+
+happyReduce_61 = happySpecReduce_1 30 happyReduction_61
+happyReduction_61 _
+ = HappyAbsSyn30
+ (HsAssocLeft
+ )
+
+happyReduce_62 = happySpecReduce_1 30 happyReduction_62
+happyReduction_62 _
+ = HappyAbsSyn30
+ (HsAssocRight
+ )
+
+happyReduce_63 = happySpecReduce_3 31 happyReduction_63
+happyReduction_63 (HappyAbsSyn148 happy_var_3)
+ _
+ (HappyAbsSyn31 happy_var_1)
+ = HappyAbsSyn31
+ (happy_var_3 : happy_var_1
+ )
+happyReduction_63 _ _ _ = notHappyAtAll
+
+happyReduce_64 = happySpecReduce_1 31 happyReduction_64
+happyReduction_64 (HappyAbsSyn148 happy_var_1)
+ = HappyAbsSyn31
+ ([happy_var_1]
+ )
+happyReduction_64 _ = notHappyAtAll
+
+happyReduce_65 = happyMonadReduce 2 32 happyReduction_65
+happyReduction_65 (_ `HappyStk`
+ (HappyAbsSyn32 happy_var_1) `HappyStk`
+ happyRest)
+ = happyThen ( checkRevDecls happy_var_1
+ ) (\r -> happyReturn (HappyAbsSyn32 r))
+
+happyReduce_66 = happySpecReduce_3 33 happyReduction_66
+happyReduction_66 (HappyAbsSyn28 happy_var_3)
+ _
+ (HappyAbsSyn32 happy_var_1)
+ = HappyAbsSyn32
+ (happy_var_3 : happy_var_1
+ )
+happyReduction_66 _ _ _ = notHappyAtAll
+
+happyReduce_67 = happySpecReduce_1 33 happyReduction_67
+happyReduction_67 (HappyAbsSyn28 happy_var_1)
+ = HappyAbsSyn32
+ ([happy_var_1]
+ )
+happyReduction_67 _ = notHappyAtAll
+
+happyReduce_68 = happyReduce 5 34 happyReduction_68
+happyReduction_68 ((HappyAbsSyn46 happy_var_5) `HappyStk`
+ _ `HappyStk`
+ (HappyAbsSyn56 happy_var_3) `HappyStk`
+ _ `HappyStk`
+ (HappyAbsSyn166 happy_var_1) `HappyStk`
+ happyRest)
+ = HappyAbsSyn28
+ (HsTypeDecl happy_var_1 (fst happy_var_3) (snd happy_var_3) happy_var_5
+ ) `HappyStk` happyRest
+
+happyReduce_69 = happyMonadReduce 5 34 happyReduction_69
+happyReduction_69 ((HappyAbsSyn77 happy_var_5) `HappyStk`
+ (HappyAbsSyn65 happy_var_4) `HappyStk`
+ (HappyAbsSyn46 happy_var_3) `HappyStk`
+ _ `HappyStk`
+ (HappyAbsSyn166 happy_var_1) `HappyStk`
+ happyRest)
+ = happyThen ( do { (cs,c,t) <- checkDataHeader happy_var_3;
+ return (HsDataDecl happy_var_1 cs c t (reverse happy_var_4) happy_var_5) }
+ ) (\r -> happyReturn (HappyAbsSyn28 r))
+
+happyReduce_70 = happyMonadReduce 5 34 happyReduction_70
+happyReduction_70 ((HappyAbsSyn61 happy_var_5) `HappyStk`
+ _ `HappyStk`
+ (HappyAbsSyn46 happy_var_3) `HappyStk`
+ _ `HappyStk`
+ (HappyAbsSyn166 happy_var_1) `HappyStk`
+ happyRest)
+ = happyThen ( do { (cs,c,t) <- checkDataHeader happy_var_3;
+ return (HsGDataDecl happy_var_1 cs c t (reverse happy_var_5)) }
+ ) (\r -> happyReturn (HappyAbsSyn28 r))
+
+happyReduce_71 = happyMonadReduce 6 34 happyReduction_71
+happyReduction_71 ((HappyAbsSyn77 happy_var_6) `HappyStk`
+ (HappyAbsSyn67 happy_var_5) `HappyStk`
+ _ `HappyStk`
+ (HappyAbsSyn46 happy_var_3) `HappyStk`
+ _ `HappyStk`
+ (HappyAbsSyn166 happy_var_1) `HappyStk`
+ happyRest)
+ = happyThen ( do { (cs,c,t) <- checkDataHeader happy_var_3;
+ return (HsNewTypeDecl happy_var_1 cs c t happy_var_5 happy_var_6) }
+ ) (\r -> happyReturn (HappyAbsSyn28 r))
+
+happyReduce_72 = happyMonadReduce 5 34 happyReduction_72
+happyReduction_72 ((HappyAbsSyn32 happy_var_5) `HappyStk`
+ (HappyAbsSyn58 happy_var_4) `HappyStk`
+ (HappyAbsSyn46 happy_var_3) `HappyStk`
+ _ `HappyStk`
+ (HappyAbsSyn166 happy_var_1) `HappyStk`
+ happyRest)
+ = happyThen ( do { (cs,c,vs) <- checkClassHeader happy_var_3;
+ return (HsClassDecl happy_var_1 cs c vs happy_var_4 happy_var_5) }
+ ) (\r -> happyReturn (HappyAbsSyn28 r))
+
+happyReduce_73 = happyMonadReduce 4 34 happyReduction_73
+happyReduction_73 ((HappyAbsSyn32 happy_var_4) `HappyStk`
+ (HappyAbsSyn46 happy_var_3) `HappyStk`
+ _ `HappyStk`
+ (HappyAbsSyn166 happy_var_1) `HappyStk`
+ happyRest)
+ = happyThen ( do { (cs,c,ts) <- checkInstHeader happy_var_3;
+ return (HsInstDecl happy_var_1 cs c ts happy_var_4) }
+ ) (\r -> happyReturn (HappyAbsSyn28 r))
+
+happyReduce_74 = happyReduce 5 34 happyReduction_74
+happyReduction_74 (_ `HappyStk`
+ (HappyAbsSyn35 happy_var_4) `HappyStk`
+ _ `HappyStk`
+ _ `HappyStk`
+ (HappyAbsSyn166 happy_var_1) `HappyStk`
+ happyRest)
+ = HappyAbsSyn28
+ (HsDefaultDecl happy_var_1 happy_var_4
+ ) `HappyStk` happyRest
+
+happyReduce_75 = happyMonadReduce 4 34 happyReduction_75
+happyReduction_75 (_ `HappyStk`
+ (HappyAbsSyn5 happy_var_3) `HappyStk`
+ _ `HappyStk`
+ (HappyAbsSyn166 happy_var_1) `HappyStk`
+ happyRest)
+ = happyThen ( do { e <- checkExpr happy_var_3;
+ return $ HsSpliceDecl happy_var_1 $ HsParenSplice e }
+ ) (\r -> happyReturn (HappyAbsSyn28 r))
+
+happyReduce_76 = happyReduce 6 34 happyReduction_76
+happyReduction_76 ((HappyAbsSyn45 happy_var_6) `HappyStk`
+ (HappyAbsSyn44 happy_var_5) `HappyStk`
+ (HappyAbsSyn43 happy_var_4) `HappyStk`
+ _ `HappyStk`
+ _ `HappyStk`
+ (HappyAbsSyn166 happy_var_1) `HappyStk`
+ happyRest)
+ = HappyAbsSyn28
+ (let (s,n,t) = happy_var_6 in HsForImp happy_var_1 happy_var_4 happy_var_5 s n t
+ ) `HappyStk` happyRest
+
+happyReduce_77 = happyReduce 5 34 happyReduction_77
+happyReduction_77 ((HappyAbsSyn45 happy_var_5) `HappyStk`
+ (HappyAbsSyn43 happy_var_4) `HappyStk`
+ _ `HappyStk`
+ _ `HappyStk`
+ (HappyAbsSyn166 happy_var_1) `HappyStk`
+ happyRest)
+ = HappyAbsSyn28
+ (let (s,n,t) = happy_var_5 in HsForExp happy_var_1 happy_var_4 s n t
+ ) `HappyStk` happyRest
+
+happyReduce_78 = happySpecReduce_1 34 happyReduction_78
+happyReduction_78 (HappyAbsSyn28 happy_var_1)
+ = HappyAbsSyn28
+ (happy_var_1
+ )
+happyReduction_78 _ = notHappyAtAll
+
+happyReduce_79 = happySpecReduce_1 35 happyReduction_79
+happyReduction_79 (HappyAbsSyn35 happy_var_1)
+ = HappyAbsSyn35
+ (reverse happy_var_1
+ )
+happyReduction_79 _ = notHappyAtAll
+
+happyReduce_80 = happySpecReduce_1 35 happyReduction_80
+happyReduction_80 (HappyAbsSyn46 happy_var_1)
+ = HappyAbsSyn35
+ ([happy_var_1]
+ )
+happyReduction_80 _ = notHappyAtAll
+
+happyReduce_81 = happySpecReduce_0 35 happyReduction_81
+happyReduction_81 = HappyAbsSyn35
+ ([]
+ )
+
+happyReduce_82 = happyMonadReduce 3 36 happyReduction_82
+happyReduction_82 (_ `HappyStk`
+ (HappyAbsSyn32 happy_var_2) `HappyStk`
+ _ `HappyStk`
+ happyRest)
+ = happyThen ( checkRevDecls happy_var_2
+ ) (\r -> happyReturn (HappyAbsSyn32 r))
+
+happyReduce_83 = happySpecReduce_1 36 happyReduction_83
+happyReduction_83 _
+ = HappyAbsSyn32
+ ([]
+ )
+
+happyReduce_84 = happySpecReduce_3 37 happyReduction_84
+happyReduction_84 (HappyAbsSyn28 happy_var_3)
+ _
+ (HappyAbsSyn32 happy_var_1)
+ = HappyAbsSyn32
+ (happy_var_3 : happy_var_1
+ )
+happyReduction_84 _ _ _ = notHappyAtAll
+
+happyReduce_85 = happySpecReduce_1 37 happyReduction_85
+happyReduction_85 (HappyAbsSyn28 happy_var_1)
+ = HappyAbsSyn32
+ ([happy_var_1]
+ )
+happyReduction_85 _ = notHappyAtAll
+
+happyReduce_86 = happySpecReduce_1 38 happyReduction_86
+happyReduction_86 (HappyAbsSyn28 happy_var_1)
+ = HappyAbsSyn28
+ (happy_var_1
+ )
+happyReduction_86 _ = notHappyAtAll
+
+happyReduce_87 = happySpecReduce_1 38 happyReduction_87
+happyReduction_87 (HappyAbsSyn28 happy_var_1)
+ = HappyAbsSyn28
+ (happy_var_1
+ )
+happyReduction_87 _ = notHappyAtAll
+
+happyReduce_88 = happySpecReduce_1 38 happyReduction_88
+happyReduction_88 (HappyAbsSyn28 happy_var_1)
+ = HappyAbsSyn28
+ (happy_var_1
+ )
+happyReduction_88 _ = notHappyAtAll
+
+happyReduce_89 = happySpecReduce_3 39 happyReduction_89
+happyReduction_89 _
+ (HappyAbsSyn32 happy_var_2)
+ _
+ = HappyAbsSyn32
+ (happy_var_2
+ )
+happyReduction_89 _ _ _ = notHappyAtAll
+
+happyReduce_90 = happySpecReduce_3 39 happyReduction_90
+happyReduction_90 _
+ (HappyAbsSyn32 happy_var_2)
+ _
+ = HappyAbsSyn32
+ (happy_var_2
+ )
+happyReduction_90 _ _ _ = notHappyAtAll
+
+happyReduce_91 = happyReduce 4 40 happyReduction_91
+happyReduction_91 ((HappyAbsSyn46 happy_var_4) `HappyStk`
+ _ `HappyStk`
+ (HappyAbsSyn42 happy_var_2) `HappyStk`
+ (HappyAbsSyn166 happy_var_1) `HappyStk`
+ happyRest)
+ = HappyAbsSyn28
+ (HsTypeSig happy_var_1 (reverse happy_var_2) happy_var_4
+ ) `HappyStk` happyRest
+
+happyReduce_92 = happySpecReduce_1 41 happyReduction_92
+happyReduction_92 (HappyAbsSyn32 happy_var_1)
+ = HappyAbsSyn41
+ (HsBDecls happy_var_1
+ )
+happyReduction_92 _ = notHappyAtAll
+
+happyReduce_93 = happySpecReduce_3 41 happyReduction_93
+happyReduction_93 _
+ (HappyAbsSyn132 happy_var_2)
+ _
+ = HappyAbsSyn41
+ (HsIPBinds happy_var_2
+ )
+happyReduction_93 _ _ _ = notHappyAtAll
+
+happyReduce_94 = happySpecReduce_3 41 happyReduction_94
+happyReduction_94 _
+ (HappyAbsSyn132 happy_var_2)
+ _
+ = HappyAbsSyn41
+ (HsIPBinds happy_var_2
+ )
+happyReduction_94 _ _ _ = notHappyAtAll
+
+happyReduce_95 = happySpecReduce_3 42 happyReduction_95
+happyReduction_95 (HappyAbsSyn137 happy_var_3)
+ _
+ (HappyAbsSyn42 happy_var_1)
+ = HappyAbsSyn42
+ (happy_var_3 : happy_var_1
+ )
+happyReduction_95 _ _ _ = notHappyAtAll
+
+happyReduce_96 = happyMonadReduce 1 42 happyReduction_96
+happyReduction_96 ((HappyAbsSyn50 happy_var_1) `HappyStk`
+ happyRest)
+ = happyThen ( do { n <- checkUnQual happy_var_1;
+ return [n] }
+ ) (\r -> happyReturn (HappyAbsSyn42 r))
+
+happyReduce_97 = happySpecReduce_1 43 happyReduction_97
+happyReduction_97 _
+ = HappyAbsSyn43
+ (StdCall
+ )
+
+happyReduce_98 = happySpecReduce_1 43 happyReduction_98
+happyReduction_98 _
+ = HappyAbsSyn43
+ (CCall
+ )
+
+happyReduce_99 = happySpecReduce_1 44 happyReduction_99
+happyReduction_99 _
+ = HappyAbsSyn44
+ (PlaySafe False
+ )
+
+happyReduce_100 = happySpecReduce_1 44 happyReduction_100
+happyReduction_100 _
+ = HappyAbsSyn44
+ (PlayRisky
+ )
+
+happyReduce_101 = happySpecReduce_1 44 happyReduction_101
+happyReduction_101 _
+ = HappyAbsSyn44
+ (PlaySafe True
+ )
+
+happyReduce_102 = happySpecReduce_0 44 happyReduction_102
+happyReduction_102 = HappyAbsSyn44
+ (PlaySafe False
+ )
+
+happyReduce_103 = happyReduce 4 45 happyReduction_103
+happyReduction_103 ((HappyAbsSyn46 happy_var_4) `HappyStk`
+ _ `HappyStk`
+ (HappyAbsSyn137 happy_var_2) `HappyStk`
+ (HappyTerminal (StringTok happy_var_1)) `HappyStk`
+ happyRest)
+ = HappyAbsSyn45
+ ((happy_var_1, happy_var_2, happy_var_4)
+ ) `HappyStk` happyRest
+
+happyReduce_104 = happySpecReduce_3 45 happyReduction_104
+happyReduction_104 (HappyAbsSyn46 happy_var_3)
+ _
+ (HappyAbsSyn137 happy_var_1)
+ = HappyAbsSyn45
+ (("", happy_var_1, happy_var_3)
+ )
+happyReduction_104 _ _ _ = notHappyAtAll
+
+happyReduce_105 = happySpecReduce_1 46 happyReduction_105
+happyReduction_105 (HappyAbsSyn46 happy_var_1)
+ = HappyAbsSyn46
+ (happy_var_1
+ )
+happyReduction_105 _ = notHappyAtAll
+
+happyReduce_106 = happySpecReduce_3 46 happyReduction_106
+happyReduction_106 (HappyAbsSyn46 happy_var_3)
+ (HappyAbsSyn50 happy_var_2)
+ (HappyAbsSyn46 happy_var_1)
+ = HappyAbsSyn46
+ (HsTyInfix happy_var_1 happy_var_2 happy_var_3
+ )
+happyReduction_106 _ _ _ = notHappyAtAll
+
+happyReduce_107 = happySpecReduce_3 46 happyReduction_107
+happyReduction_107 (HappyAbsSyn46 happy_var_3)
+ (HappyAbsSyn50 happy_var_2)
+ (HappyAbsSyn46 happy_var_1)
+ = HappyAbsSyn46
+ (HsTyInfix happy_var_1 happy_var_2 happy_var_3
+ )
+happyReduction_107 _ _ _ = notHappyAtAll
+
+happyReduce_108 = happySpecReduce_3 46 happyReduction_108
+happyReduction_108 (HappyAbsSyn46 happy_var_3)
+ _
+ (HappyAbsSyn46 happy_var_1)
+ = HappyAbsSyn46
+ (HsTyFun happy_var_1 happy_var_3
+ )
+happyReduction_108 _ _ _ = notHappyAtAll
+
+happyReduce_109 = happySpecReduce_3 47 happyReduction_109
+happyReduction_109 (HappyAbsSyn46 happy_var_3)
+ _
+ (HappyAbsSyn140 happy_var_1)
+ = HappyAbsSyn46
+ (HsTyPred $ HsIParam happy_var_1 happy_var_3
+ )
+happyReduction_109 _ _ _ = notHappyAtAll
+
+happyReduce_110 = happySpecReduce_1 47 happyReduction_110
+happyReduction_110 (HappyAbsSyn46 happy_var_1)
+ = HappyAbsSyn46
+ (happy_var_1
+ )
+happyReduction_110 _ = notHappyAtAll
+
+happyReduce_111 = happySpecReduce_2 48 happyReduction_111
+happyReduction_111 (HappyAbsSyn46 happy_var_2)
+ (HappyAbsSyn46 happy_var_1)
+ = HappyAbsSyn46
+ (HsTyApp happy_var_1 happy_var_2
+ )
+happyReduction_111 _ _ = notHappyAtAll
+
+happyReduce_112 = happySpecReduce_1 48 happyReduction_112
+happyReduction_112 (HappyAbsSyn46 happy_var_1)
+ = HappyAbsSyn46
+ (happy_var_1
+ )
+happyReduction_112 _ = notHappyAtAll
+
+happyReduce_113 = happySpecReduce_1 49 happyReduction_113
+happyReduction_113 (HappyAbsSyn50 happy_var_1)
+ = HappyAbsSyn46
+ (HsTyCon happy_var_1
+ )
+happyReduction_113 _ = notHappyAtAll
+
+happyReduce_114 = happySpecReduce_1 49 happyReduction_114
+happyReduction_114 (HappyAbsSyn137 happy_var_1)
+ = HappyAbsSyn46
+ (HsTyVar happy_var_1
+ )
+happyReduction_114 _ = notHappyAtAll
+
+happyReduce_115 = happySpecReduce_3 49 happyReduction_115
+happyReduction_115 _
+ (HappyAbsSyn35 happy_var_2)
+ _
+ = HappyAbsSyn46
+ (HsTyTuple Boxed (reverse happy_var_2)
+ )
+happyReduction_115 _ _ _ = notHappyAtAll
+
+happyReduce_116 = happySpecReduce_3 49 happyReduction_116
+happyReduction_116 _
+ (HappyAbsSyn35 happy_var_2)
+ _
+ = HappyAbsSyn46
+ (HsTyTuple Unboxed (reverse happy_var_2)
+ )
+happyReduction_116 _ _ _ = notHappyAtAll
+
+happyReduce_117 = happySpecReduce_3 49 happyReduction_117
+happyReduction_117 _
+ (HappyAbsSyn46 happy_var_2)
+ _
+ = HappyAbsSyn46
+ (HsTyApp list_tycon happy_var_2
+ )
+happyReduction_117 _ _ _ = notHappyAtAll
+
+happyReduce_118 = happySpecReduce_3 49 happyReduction_118
+happyReduction_118 _
+ (HappyAbsSyn46 happy_var_2)
+ _
+ = HappyAbsSyn46
+ (happy_var_2
+ )
+happyReduction_118 _ _ _ = notHappyAtAll
+
+happyReduce_119 = happySpecReduce_1 50 happyReduction_119
+happyReduction_119 (HappyAbsSyn50 happy_var_1)
+ = HappyAbsSyn50
+ (happy_var_1
+ )
+happyReduction_119 _ = notHappyAtAll
+
+happyReduce_120 = happySpecReduce_2 50 happyReduction_120
+happyReduction_120 _
+ _
+ = HappyAbsSyn50
+ (unit_tycon_name
+ )
+
+happyReduce_121 = happySpecReduce_3 50 happyReduction_121
+happyReduction_121 _
+ _
+ _
+ = HappyAbsSyn50
+ (fun_tycon_name
+ )
+
+happyReduce_122 = happySpecReduce_2 50 happyReduction_122
+happyReduction_122 _
+ _
+ = HappyAbsSyn50
+ (list_tycon_name
+ )
+
+happyReduce_123 = happySpecReduce_3 50 happyReduction_123
+happyReduction_123 _
+ (HappyAbsSyn29 happy_var_2)
+ _
+ = HappyAbsSyn50
+ (tuple_tycon_name happy_var_2
+ )
+happyReduction_123 _ _ _ = notHappyAtAll
+
+happyReduce_124 = happySpecReduce_1 51 happyReduction_124
+happyReduction_124 (HappyAbsSyn50 happy_var_1)
+ = HappyAbsSyn50
+ (happy_var_1
+ )
+happyReduction_124 _ = notHappyAtAll
+
+happyReduce_125 = happyReduce 4 52 happyReduction_125
+happyReduction_125 ((HappyAbsSyn46 happy_var_4) `HappyStk`
+ _ `HappyStk`
+ (HappyAbsSyn42 happy_var_2) `HappyStk`
+ _ `HappyStk`
+ happyRest)
+ = HappyAbsSyn46
+ (mkHsTyForall (Just happy_var_2) [] happy_var_4
+ ) `HappyStk` happyRest
+
+happyReduce_126 = happySpecReduce_3 52 happyReduction_126
+happyReduction_126 (HappyAbsSyn46 happy_var_3)
+ _
+ (HappyAbsSyn53 happy_var_1)
+ = HappyAbsSyn46
+ (mkHsTyForall Nothing happy_var_1 happy_var_3
+ )
+happyReduction_126 _ _ _ = notHappyAtAll
+
+happyReduce_127 = happySpecReduce_1 52 happyReduction_127
+happyReduction_127 (HappyAbsSyn46 happy_var_1)
+ = HappyAbsSyn46
+ (happy_var_1
+ )
+happyReduction_127 _ = notHappyAtAll
+
+happyReduce_128 = happyMonadReduce 1 53 happyReduction_128
+happyReduction_128 ((HappyAbsSyn46 happy_var_1) `HappyStk`
+ happyRest)
+ = happyThen ( checkContext happy_var_1
+ ) (\r -> happyReturn (HappyAbsSyn53 r))
+
+happyReduce_129 = happySpecReduce_3 54 happyReduction_129
+happyReduction_129 (HappyAbsSyn46 happy_var_3)
+ _
+ (HappyAbsSyn35 happy_var_1)
+ = HappyAbsSyn35
+ (happy_var_3 : happy_var_1
+ )
+happyReduction_129 _ _ _ = notHappyAtAll
+
+happyReduce_130 = happySpecReduce_1 55 happyReduction_130
+happyReduction_130 (HappyAbsSyn46 happy_var_1)
+ = HappyAbsSyn35
+ ([happy_var_1]
+ )
+happyReduction_130 _ = notHappyAtAll
+
+happyReduce_131 = happySpecReduce_3 55 happyReduction_131
+happyReduction_131 (HappyAbsSyn46 happy_var_3)
+ _
+ (HappyAbsSyn35 happy_var_1)
+ = HappyAbsSyn35
+ (happy_var_3 : happy_var_1
+ )
+happyReduction_131 _ _ _ = notHappyAtAll
+
+happyReduce_132 = happySpecReduce_2 56 happyReduction_132
+happyReduction_132 (HappyAbsSyn42 happy_var_2)
+ (HappyAbsSyn137 happy_var_1)
+ = HappyAbsSyn56
+ ((happy_var_1,reverse happy_var_2)
+ )
+happyReduction_132 _ _ = notHappyAtAll
+
+happyReduce_133 = happySpecReduce_2 57 happyReduction_133
+happyReduction_133 (HappyAbsSyn137 happy_var_2)
+ (HappyAbsSyn42 happy_var_1)
+ = HappyAbsSyn42
+ (happy_var_2 : happy_var_1
+ )
+happyReduction_133 _ _ = notHappyAtAll
+
+happyReduce_134 = happySpecReduce_0 57 happyReduction_134
+happyReduction_134 = HappyAbsSyn42
+ ([]
+ )
+
+happyReduce_135 = happySpecReduce_0 58 happyReduction_135
+happyReduction_135 = HappyAbsSyn58
+ ([]
+ )
+
+happyReduce_136 = happySpecReduce_2 58 happyReduction_136
+happyReduction_136 (HappyAbsSyn58 happy_var_2)
+ _
+ = HappyAbsSyn58
+ (reverse happy_var_2
+ )
+happyReduction_136 _ _ = notHappyAtAll
+
+happyReduce_137 = happySpecReduce_3 59 happyReduction_137
+happyReduction_137 (HappyAbsSyn60 happy_var_3)
+ _
+ (HappyAbsSyn58 happy_var_1)
+ = HappyAbsSyn58
+ (happy_var_3 : happy_var_1
+ )
+happyReduction_137 _ _ _ = notHappyAtAll
+
+happyReduce_138 = happySpecReduce_1 59 happyReduction_138
+happyReduction_138 (HappyAbsSyn60 happy_var_1)
+ = HappyAbsSyn58
+ ([happy_var_1]
+ )
+happyReduction_138 _ = notHappyAtAll
+
+happyReduce_139 = happySpecReduce_3 60 happyReduction_139
+happyReduction_139 (HappyAbsSyn42 happy_var_3)
+ _
+ (HappyAbsSyn42 happy_var_1)
+ = HappyAbsSyn60
+ (HsFunDep (reverse happy_var_1) (reverse happy_var_3)
+ )
+happyReduction_139 _ _ _ = notHappyAtAll
+
+happyReduce_140 = happySpecReduce_3 61 happyReduction_140
+happyReduction_140 _
+ (HappyAbsSyn61 happy_var_2)
+ _
+ = HappyAbsSyn61
+ (happy_var_2
+ )
+happyReduction_140 _ _ _ = notHappyAtAll
+
+happyReduce_141 = happySpecReduce_3 61 happyReduction_141
+happyReduction_141 _
+ (HappyAbsSyn61 happy_var_2)
+ _
+ = HappyAbsSyn61
+ (happy_var_2
+ )
+happyReduction_141 _ _ _ = notHappyAtAll
+
+happyReduce_142 = happySpecReduce_3 62 happyReduction_142
+happyReduction_142 _
+ (HappyAbsSyn61 happy_var_2)
+ _
+ = HappyAbsSyn61
+ (happy_var_2
+ )
+happyReduction_142 _ _ _ = notHappyAtAll
+
+happyReduce_143 = happySpecReduce_3 63 happyReduction_143
+happyReduction_143 (HappyAbsSyn64 happy_var_3)
+ _
+ (HappyAbsSyn61 happy_var_1)
+ = HappyAbsSyn61
+ (happy_var_3 : happy_var_1
+ )
+happyReduction_143 _ _ _ = notHappyAtAll
+
+happyReduce_144 = happySpecReduce_1 63 happyReduction_144
+happyReduction_144 (HappyAbsSyn64 happy_var_1)
+ = HappyAbsSyn61
+ ([happy_var_1]
+ )
+happyReduction_144 _ = notHappyAtAll
+
+happyReduce_145 = happyMonadReduce 4 64 happyReduction_145
+happyReduction_145 ((HappyAbsSyn46 happy_var_4) `HappyStk`
+ _ `HappyStk`
+ (HappyAbsSyn50 happy_var_2) `HappyStk`
+ (HappyAbsSyn166 happy_var_1) `HappyStk`
+ happyRest)
+ = happyThen ( do { c <- checkUnQual happy_var_2;
+ return $ HsGadtDecl happy_var_1 c happy_var_4 }
+ ) (\r -> happyReturn (HappyAbsSyn64 r))
+
+happyReduce_146 = happySpecReduce_0 65 happyReduction_146
+happyReduction_146 = HappyAbsSyn65
+ ([]
+ )
+
+happyReduce_147 = happySpecReduce_2 65 happyReduction_147
+happyReduction_147 (HappyAbsSyn65 happy_var_2)
+ _
+ = HappyAbsSyn65
+ (happy_var_2
+ )
+happyReduction_147 _ _ = notHappyAtAll
+
+happyReduce_148 = happySpecReduce_3 66 happyReduction_148
+happyReduction_148 (HappyAbsSyn67 happy_var_3)
+ _
+ (HappyAbsSyn65 happy_var_1)
+ = HappyAbsSyn65
+ (happy_var_3 : happy_var_1
+ )
+happyReduction_148 _ _ _ = notHappyAtAll
+
+happyReduce_149 = happySpecReduce_1 66 happyReduction_149
+happyReduction_149 (HappyAbsSyn67 happy_var_1)
+ = HappyAbsSyn65
+ ([happy_var_1]
+ )
+happyReduction_149 _ = notHappyAtAll
+
+happyReduce_150 = happyReduce 5 67 happyReduction_150
+happyReduction_150 ((HappyAbsSyn69 happy_var_5) `HappyStk`
+ _ `HappyStk`
+ (HappyAbsSyn53 happy_var_3) `HappyStk`
+ (HappyAbsSyn42 happy_var_2) `HappyStk`
+ (HappyAbsSyn166 happy_var_1) `HappyStk`
+ happyRest)
+ = HappyAbsSyn67
+ (HsQualConDecl happy_var_1 happy_var_2 happy_var_3 happy_var_5
+ ) `HappyStk` happyRest
+
+happyReduce_151 = happySpecReduce_3 67 happyReduction_151
+happyReduction_151 (HappyAbsSyn69 happy_var_3)
+ (HappyAbsSyn42 happy_var_2)
+ (HappyAbsSyn166 happy_var_1)
+ = HappyAbsSyn67
+ (HsQualConDecl happy_var_1 happy_var_2 [] happy_var_3
+ )
+happyReduction_151 _ _ _ = notHappyAtAll
+
+happyReduce_152 = happySpecReduce_3 68 happyReduction_152
+happyReduction_152 _
+ (HappyAbsSyn42 happy_var_2)
+ _
+ = HappyAbsSyn42
+ (happy_var_2
+ )
+happyReduction_152 _ _ _ = notHappyAtAll
+
+happyReduce_153 = happySpecReduce_0 68 happyReduction_153
+happyReduction_153 = HappyAbsSyn42
+ ([]
+ )
+
+happyReduce_154 = happySpecReduce_1 69 happyReduction_154
+happyReduction_154 (HappyAbsSyn70 happy_var_1)
+ = HappyAbsSyn69
+ (HsConDecl (fst happy_var_1) (snd happy_var_1)
+ )
+happyReduction_154 _ = notHappyAtAll
+
+happyReduce_155 = happySpecReduce_3 69 happyReduction_155
+happyReduction_155 (HappyAbsSyn72 happy_var_3)
+ (HappyAbsSyn137 happy_var_2)
+ (HappyAbsSyn72 happy_var_1)
+ = HappyAbsSyn69
+ (HsConDecl happy_var_2 [happy_var_1,happy_var_3]
+ )
+happyReduction_155 _ _ _ = notHappyAtAll
+
+happyReduce_156 = happySpecReduce_3 69 happyReduction_156
+happyReduction_156 _
+ _
+ (HappyAbsSyn137 happy_var_1)
+ = HappyAbsSyn69
+ (HsRecDecl happy_var_1 []
+ )
+happyReduction_156 _ _ _ = notHappyAtAll
+
+happyReduce_157 = happyReduce 4 69 happyReduction_157
+happyReduction_157 (_ `HappyStk`
+ (HappyAbsSyn74 happy_var_3) `HappyStk`
+ _ `HappyStk`
+ (HappyAbsSyn137 happy_var_1) `HappyStk`
+ happyRest)
+ = HappyAbsSyn69
+ (HsRecDecl happy_var_1 (reverse happy_var_3)
+ ) `HappyStk` happyRest
+
+happyReduce_158 = happyMonadReduce 1 70 happyReduction_158
+happyReduction_158 ((HappyAbsSyn46 happy_var_1) `HappyStk`
+ happyRest)
+ = happyThen ( do { (c,ts) <- splitTyConApp happy_var_1;
+ return (c,map HsUnBangedTy ts) }
+ ) (\r -> happyReturn (HappyAbsSyn70 r))
+
+happyReduce_159 = happySpecReduce_1 70 happyReduction_159
+happyReduction_159 (HappyAbsSyn70 happy_var_1)
+ = HappyAbsSyn70
+ (happy_var_1
+ )
+happyReduction_159 _ = notHappyAtAll
+
+happyReduce_160 = happyMonadReduce 3 71 happyReduction_160
+happyReduction_160 ((HappyAbsSyn46 happy_var_3) `HappyStk`
+ _ `HappyStk`
+ (HappyAbsSyn46 happy_var_1) `HappyStk`
+ happyRest)
+ = happyThen ( do { (c,ts) <- splitTyConApp happy_var_1;
+ return (c,map HsUnBangedTy ts++
+ [HsBangedTy happy_var_3]) }
+ ) (\r -> happyReturn (HappyAbsSyn70 r))
+
+happyReduce_161 = happySpecReduce_2 71 happyReduction_161
+happyReduction_161 (HappyAbsSyn72 happy_var_2)
+ (HappyAbsSyn70 happy_var_1)
+ = HappyAbsSyn70
+ ((fst happy_var_1, snd happy_var_1 ++ [happy_var_2] )
+ )
+happyReduction_161 _ _ = notHappyAtAll
+
+happyReduce_162 = happySpecReduce_1 72 happyReduction_162
+happyReduction_162 (HappyAbsSyn46 happy_var_1)
+ = HappyAbsSyn72
+ (HsUnBangedTy happy_var_1
+ )
+happyReduction_162 _ = notHappyAtAll
+
+happyReduce_163 = happySpecReduce_2 72 happyReduction_163
+happyReduction_163 (HappyAbsSyn46 happy_var_2)
+ _
+ = HappyAbsSyn72
+ (HsBangedTy happy_var_2
+ )
+happyReduction_163 _ _ = notHappyAtAll
+
+happyReduce_164 = happySpecReduce_1 73 happyReduction_164
+happyReduction_164 (HappyAbsSyn46 happy_var_1)
+ = HappyAbsSyn72
+ (HsUnBangedTy happy_var_1
+ )
+happyReduction_164 _ = notHappyAtAll
+
+happyReduce_165 = happySpecReduce_2 73 happyReduction_165
+happyReduction_165 (HappyAbsSyn46 happy_var_2)
+ _
+ = HappyAbsSyn72
+ (HsBangedTy happy_var_2
+ )
+happyReduction_165 _ _ = notHappyAtAll
+
+happyReduce_166 = happySpecReduce_3 74 happyReduction_166
+happyReduction_166 (HappyAbsSyn75 happy_var_3)
+ _
+ (HappyAbsSyn74 happy_var_1)
+ = HappyAbsSyn74
+ (happy_var_3 : happy_var_1
+ )
+happyReduction_166 _ _ _ = notHappyAtAll
+
+happyReduce_167 = happySpecReduce_1 74 happyReduction_167
+happyReduction_167 (HappyAbsSyn75 happy_var_1)
+ = HappyAbsSyn74
+ ([happy_var_1]
+ )
+happyReduction_167 _ = notHappyAtAll
+
+happyReduce_168 = happySpecReduce_3 75 happyReduction_168
+happyReduction_168 (HappyAbsSyn72 happy_var_3)
+ _
+ (HappyAbsSyn42 happy_var_1)
+ = HappyAbsSyn75
+ ((reverse happy_var_1, happy_var_3)
+ )
+happyReduction_168 _ _ _ = notHappyAtAll
+
+happyReduce_169 = happySpecReduce_1 76 happyReduction_169
+happyReduction_169 (HappyAbsSyn46 happy_var_1)
+ = HappyAbsSyn72
+ (HsUnBangedTy happy_var_1
+ )
+happyReduction_169 _ = notHappyAtAll
+
+happyReduce_170 = happySpecReduce_2 76 happyReduction_170
+happyReduction_170 (HappyAbsSyn46 happy_var_2)
+ _
+ = HappyAbsSyn72
+ (HsBangedTy happy_var_2
+ )
+happyReduction_170 _ _ = notHappyAtAll
+
+happyReduce_171 = happySpecReduce_0 77 happyReduction_171
+happyReduction_171 = HappyAbsSyn77
+ ([]
+ )
+
+happyReduce_172 = happySpecReduce_2 77 happyReduction_172
+happyReduction_172 (HappyAbsSyn50 happy_var_2)
+ _
+ = HappyAbsSyn77
+ ([happy_var_2]
+ )
+happyReduction_172 _ _ = notHappyAtAll
+
+happyReduce_173 = happySpecReduce_3 77 happyReduction_173
+happyReduction_173 _
+ _
+ _
+ = HappyAbsSyn77
+ ([]
+ )
+
+happyReduce_174 = happyReduce 4 77 happyReduction_174
+happyReduction_174 (_ `HappyStk`
+ (HappyAbsSyn77 happy_var_3) `HappyStk`
+ _ `HappyStk`
+ _ `HappyStk`
+ happyRest)
+ = HappyAbsSyn77
+ (reverse happy_var_3
+ ) `HappyStk` happyRest
+
+happyReduce_175 = happySpecReduce_3 78 happyReduction_175
+happyReduction_175 (HappyAbsSyn50 happy_var_3)
+ _
+ (HappyAbsSyn77 happy_var_1)
+ = HappyAbsSyn77
+ (happy_var_3 : happy_var_1
+ )
+happyReduction_175 _ _ _ = notHappyAtAll
+
+happyReduce_176 = happySpecReduce_1 78 happyReduction_176
+happyReduction_176 (HappyAbsSyn50 happy_var_1)
+ = HappyAbsSyn77
+ ([happy_var_1]
+ )
+happyReduction_176 _ = notHappyAtAll
+
+happyReduce_177 = happyMonadReduce 2 79 happyReduction_177
+happyReduction_177 ((HappyAbsSyn32 happy_var_2) `HappyStk`
+ _ `HappyStk`
+ happyRest)
+ = happyThen ( checkClassBody happy_var_2
+ ) (\r -> happyReturn (HappyAbsSyn32 r))
+
+happyReduce_178 = happySpecReduce_0 79 happyReduction_178
+happyReduction_178 = HappyAbsSyn32
+ ([]
+ )
+
+happyReduce_179 = happyMonadReduce 4 80 happyReduction_179
+happyReduction_179 (_ `HappyStk`
+ (HappyAbsSyn32 happy_var_3) `HappyStk`
+ _ `HappyStk`
+ _ `HappyStk`
+ happyRest)
+ = happyThen ( checkClassBody happy_var_3
+ ) (\r -> happyReturn (HappyAbsSyn32 r))
+
+happyReduce_180 = happyMonadReduce 4 80 happyReduction_180
+happyReduction_180 (_ `HappyStk`
+ (HappyAbsSyn32 happy_var_3) `HappyStk`
+ _ `HappyStk`
+ _ `HappyStk`
+ happyRest)
+ = happyThen ( checkClassBody happy_var_3
+ ) (\r -> happyReturn (HappyAbsSyn32 r))
+
+happyReduce_181 = happySpecReduce_0 80 happyReduction_181
+happyReduction_181 = HappyAbsSyn32
+ ([]
+ )
+
+happyReduce_182 = happyMonadReduce 3 81 happyReduction_182
+happyReduction_182 (_ `HappyStk`
+ (HappyAbsSyn32 happy_var_2) `HappyStk`
+ _ `HappyStk`
+ happyRest)
+ = happyThen ( checkRevDecls happy_var_2
+ ) (\r -> happyReturn (HappyAbsSyn32 r))
+
+happyReduce_183 = happySpecReduce_1 81 happyReduction_183
+happyReduction_183 _
+ = HappyAbsSyn32
+ ([]
+ )
+
+happyReduce_184 = happySpecReduce_3 82 happyReduction_184
+happyReduction_184 (HappyAbsSyn28 happy_var_3)
+ _
+ (HappyAbsSyn32 happy_var_1)
+ = HappyAbsSyn32
+ (happy_var_3 : happy_var_1
+ )
+happyReduction_184 _ _ _ = notHappyAtAll
+
+happyReduce_185 = happySpecReduce_1 82 happyReduction_185
+happyReduction_185 (HappyAbsSyn28 happy_var_1)
+ = HappyAbsSyn32
+ ([happy_var_1]
+ )
+happyReduction_185 _ = notHappyAtAll
+
+happyReduce_186 = happyMonadReduce 4 83 happyReduction_186
+happyReduction_186 ((HappyAbsSyn41 happy_var_4) `HappyStk`
+ (HappyAbsSyn85 happy_var_3) `HappyStk`
+ (HappyAbsSyn5 happy_var_2) `HappyStk`
+ (HappyAbsSyn166 happy_var_1) `HappyStk`
+ happyRest)
+ = happyThen ( checkValDef happy_var_1 happy_var_2 happy_var_3 happy_var_4
+ ) (\r -> happyReturn (HappyAbsSyn28 r))
+
+happyReduce_187 = happySpecReduce_2 84 happyReduction_187
+happyReduction_187 (HappyAbsSyn41 happy_var_2)
+ _
+ = HappyAbsSyn41
+ (happy_var_2
+ )
+happyReduction_187 _ _ = notHappyAtAll
+
+happyReduce_188 = happySpecReduce_0 84 happyReduction_188
+happyReduction_188 = HappyAbsSyn41
+ (HsBDecls []
+ )
+
+happyReduce_189 = happyMonadReduce 2 85 happyReduction_189
+happyReduction_189 ((HappyAbsSyn5 happy_var_2) `HappyStk`
+ _ `HappyStk`
+ happyRest)
+ = happyThen ( do { e <- checkExpr happy_var_2;
+ return (HsUnGuardedRhs e) }
+ ) (\r -> happyReturn (HappyAbsSyn85 r))
+
+happyReduce_190 = happySpecReduce_1 85 happyReduction_190
+happyReduction_190 (HappyAbsSyn86 happy_var_1)
+ = HappyAbsSyn85
+ (HsGuardedRhss (reverse happy_var_1)
+ )
+happyReduction_190 _ = notHappyAtAll
+
+happyReduce_191 = happySpecReduce_2 86 happyReduction_191
+happyReduction_191 (HappyAbsSyn87 happy_var_2)
+ (HappyAbsSyn86 happy_var_1)
+ = HappyAbsSyn86
+ (happy_var_2 : happy_var_1
+ )
+happyReduction_191 _ _ = notHappyAtAll
+
+happyReduce_192 = happySpecReduce_1 86 happyReduction_192
+happyReduction_192 (HappyAbsSyn87 happy_var_1)
+ = HappyAbsSyn86
+ ([happy_var_1]
+ )
+happyReduction_192 _ = notHappyAtAll
+
+happyReduce_193 = happyMonadReduce 5 87 happyReduction_193
+happyReduction_193 ((HappyAbsSyn5 happy_var_5) `HappyStk`
+ _ `HappyStk`
+ (HappyAbsSyn118 happy_var_3) `HappyStk`
+ _ `HappyStk`
+ (HappyAbsSyn166 happy_var_1) `HappyStk`
+ happyRest)
+ = happyThen ( do { e <- checkExpr happy_var_5;
+ return (HsGuardedRhs happy_var_1 (reverse happy_var_3) e) }
+ ) (\r -> happyReturn (HappyAbsSyn87 r))
+
+happyReduce_194 = happyReduce 4 88 happyReduction_194
+happyReduction_194 ((HappyAbsSyn46 happy_var_4) `HappyStk`
+ (HappyAbsSyn166 happy_var_3) `HappyStk`
+ _ `HappyStk`
+ (HappyAbsSyn5 happy_var_1) `HappyStk`
+ happyRest)
+ = HappyAbsSyn5
+ (HsExpTypeSig happy_var_3 happy_var_1 happy_var_4
+ ) `HappyStk` happyRest
+
+happyReduce_195 = happySpecReduce_3 88 happyReduction_195
+happyReduction_195 (HappyAbsSyn132 happy_var_3)
+ _
+ (HappyAbsSyn5 happy_var_1)
+ = HappyAbsSyn5
+ (HsWith happy_var_1 happy_var_3
+ )
+happyReduction_195 _ _ _ = notHappyAtAll
+
+happyReduce_196 = happySpecReduce_1 88 happyReduction_196
+happyReduction_196 (HappyAbsSyn5 happy_var_1)
+ = HappyAbsSyn5
+ (happy_var_1
+ )
+happyReduction_196 _ = notHappyAtAll
+
+happyReduce_197 = happySpecReduce_1 89 happyReduction_197
+happyReduction_197 (HappyAbsSyn5 happy_var_1)
+ = HappyAbsSyn5
+ (happy_var_1
+ )
+happyReduction_197 _ = notHappyAtAll
+
+happyReduce_198 = happySpecReduce_1 89 happyReduction_198
+happyReduction_198 (HappyAbsSyn5 happy_var_1)
+ = HappyAbsSyn5
+ (happy_var_1
+ )
+happyReduction_198 _ = notHappyAtAll
+
+happyReduce_199 = happySpecReduce_3 90 happyReduction_199
+happyReduction_199 (HappyAbsSyn5 happy_var_3)
+ (HappyAbsSyn149 happy_var_2)
+ (HappyAbsSyn5 happy_var_1)
+ = HappyAbsSyn5
+ (HsInfixApp happy_var_1 happy_var_2 happy_var_3
+ )
+happyReduction_199 _ _ _ = notHappyAtAll
+
+happyReduce_200 = happySpecReduce_1 90 happyReduction_200
+happyReduction_200 (HappyAbsSyn5 happy_var_1)
+ = HappyAbsSyn5
+ (happy_var_1
+ )
+happyReduction_200 _ = notHappyAtAll
+
+happyReduce_201 = happySpecReduce_3 91 happyReduction_201
+happyReduction_201 (HappyAbsSyn5 happy_var_3)
+ (HappyAbsSyn149 happy_var_2)
+ (HappyAbsSyn5 happy_var_1)
+ = HappyAbsSyn5
+ (HsInfixApp happy_var_1 happy_var_2 happy_var_3
+ )
+happyReduction_201 _ _ _ = notHappyAtAll
+
+happyReduce_202 = happySpecReduce_1 91 happyReduction_202
+happyReduction_202 (HappyAbsSyn5 happy_var_1)
+ = HappyAbsSyn5
+ (happy_var_1
+ )
+happyReduction_202 _ = notHappyAtAll
+
+happyReduce_203 = happySpecReduce_1 91 happyReduction_203
+happyReduction_203 (HappyAbsSyn5 happy_var_1)
+ = HappyAbsSyn5
+ (happy_var_1
+ )
+happyReduction_203 _ = notHappyAtAll
+
+happyReduce_204 = happyReduce 5 92 happyReduction_204
+happyReduction_204 ((HappyAbsSyn5 happy_var_5) `HappyStk`
+ _ `HappyStk`
+ (HappyAbsSyn95 happy_var_3) `HappyStk`
+ (HappyAbsSyn166 happy_var_2) `HappyStk`
+ _ `HappyStk`
+ happyRest)
+ = HappyAbsSyn5
+ (HsLambda happy_var_2 (reverse happy_var_3) happy_var_5
+ ) `HappyStk` happyRest
+
+happyReduce_205 = happyReduce 4 92 happyReduction_205
+happyReduction_205 ((HappyAbsSyn5 happy_var_4) `HappyStk`
+ _ `HappyStk`
+ (HappyAbsSyn41 happy_var_2) `HappyStk`
+ _ `HappyStk`
+ happyRest)
+ = HappyAbsSyn5
+ (HsLet happy_var_2 happy_var_4
+ ) `HappyStk` happyRest
+
+happyReduce_206 = happyReduce 4 92 happyReduction_206
+happyReduction_206 ((HappyAbsSyn5 happy_var_4) `HappyStk`
+ _ `HappyStk`
+ (HappyAbsSyn132 happy_var_2) `HappyStk`
+ _ `HappyStk`
+ happyRest)
+ = HappyAbsSyn5
+ (HsDLet happy_var_2 happy_var_4
+ ) `HappyStk` happyRest
+
+happyReduce_207 = happyReduce 6 92 happyReduction_207
+happyReduction_207 ((HappyAbsSyn5 happy_var_6) `HappyStk`
+ _ `HappyStk`
+ (HappyAbsSyn5 happy_var_4) `HappyStk`
+ _ `HappyStk`
+ (HappyAbsSyn5 happy_var_2) `HappyStk`
+ _ `HappyStk`
+ happyRest)
+ = HappyAbsSyn5
+ (HsIf happy_var_2 happy_var_4 happy_var_6
+ ) `HappyStk` happyRest
+
+happyReduce_208 = happyReduce 4 93 happyReduction_208
+happyReduction_208 ((HappyAbsSyn120 happy_var_4) `HappyStk`
+ _ `HappyStk`
+ (HappyAbsSyn5 happy_var_2) `HappyStk`
+ _ `HappyStk`
+ happyRest)
+ = HappyAbsSyn5
+ (HsCase happy_var_2 happy_var_4
+ ) `HappyStk` happyRest
+
+happyReduce_209 = happySpecReduce_2 93 happyReduction_209
+happyReduction_209 (HappyAbsSyn5 happy_var_2)
+ _
+ = HappyAbsSyn5
+ (HsNegApp happy_var_2
+ )
+happyReduction_209 _ _ = notHappyAtAll
+
+happyReduce_210 = happySpecReduce_2 93 happyReduction_210
+happyReduction_210 (HappyAbsSyn118 happy_var_2)
+ _
+ = HappyAbsSyn5
+ (HsDo happy_var_2
+ )
+happyReduction_210 _ _ = notHappyAtAll
+
+happyReduce_211 = happySpecReduce_2 93 happyReduction_211
+happyReduction_211 (HappyAbsSyn118 happy_var_2)
+ _
+ = HappyAbsSyn5
+ (HsMDo happy_var_2
+ )
+happyReduction_211 _ _ = notHappyAtAll
+
+happyReduce_212 = happySpecReduce_1 93 happyReduction_212
+happyReduction_212 (HappyAbsSyn100 happy_var_1)
+ = HappyAbsSyn5
+ (HsReifyExp happy_var_1
+ )
+happyReduction_212 _ = notHappyAtAll
+
+happyReduce_213 = happySpecReduce_1 93 happyReduction_213
+happyReduction_213 (HappyAbsSyn5 happy_var_1)
+ = HappyAbsSyn5
+ (happy_var_1
+ )
+happyReduction_213 _ = notHappyAtAll
+
+happyReduce_214 = happySpecReduce_2 94 happyReduction_214
+happyReduction_214 (HappyAbsSyn5 happy_var_2)
+ (HappyAbsSyn5 happy_var_1)
+ = HappyAbsSyn5
+ (HsApp happy_var_1 happy_var_2
+ )
+happyReduction_214 _ _ = notHappyAtAll
+
+happyReduce_215 = happySpecReduce_1 94 happyReduction_215
+happyReduction_215 (HappyAbsSyn5 happy_var_1)
+ = HappyAbsSyn5
+ (happy_var_1
+ )
+happyReduction_215 _ = notHappyAtAll
+
+happyReduce_216 = happySpecReduce_2 95 happyReduction_216
+happyReduction_216 (HappyAbsSyn96 happy_var_2)
+ (HappyAbsSyn95 happy_var_1)
+ = HappyAbsSyn95
+ (happy_var_2 : happy_var_1
+ )
+happyReduction_216 _ _ = notHappyAtAll
+
+happyReduce_217 = happySpecReduce_1 95 happyReduction_217
+happyReduction_217 (HappyAbsSyn96 happy_var_1)
+ = HappyAbsSyn95
+ ([happy_var_1]
+ )
+happyReduction_217 _ = notHappyAtAll
+
+happyReduce_218 = happyMonadReduce 1 96 happyReduction_218
+happyReduction_218 ((HappyAbsSyn5 happy_var_1) `HappyStk`
+ happyRest)
+ = happyThen ( checkPattern happy_var_1
+ ) (\r -> happyReturn (HappyAbsSyn96 r))
+
+happyReduce_219 = happyMonadReduce 3 97 happyReduction_219
+happyReduction_219 ((HappyAbsSyn5 happy_var_3) `HappyStk`
+ _ `HappyStk`
+ (HappyAbsSyn50 happy_var_1) `HappyStk`
+ happyRest)
+ = happyThen ( do { n <- checkUnQual happy_var_1;
+ return (HsAsPat n happy_var_3) }
+ ) (\r -> happyReturn (HappyAbsSyn5 r))
+
+happyReduce_220 = happyMonadReduce 3 97 happyReduction_220
+happyReduction_220 ((HappyAbsSyn5 happy_var_3) `HappyStk`
+ _ `HappyStk`
+ (HappyAbsSyn50 happy_var_1) `HappyStk`
+ happyRest)
+ = happyThen ( do { n <- checkUnQual happy_var_1;
+ return (HsCAsRP n happy_var_3) }
+ ) (\r -> happyReturn (HappyAbsSyn5 r))
+
+happyReduce_221 = happySpecReduce_2 97 happyReduction_221
+happyReduction_221 (HappyAbsSyn5 happy_var_2)
+ _
+ = HappyAbsSyn5
+ (HsIrrPat happy_var_2
+ )
+happyReduction_221 _ _ = notHappyAtAll
+
+happyReduce_222 = happySpecReduce_2 97 happyReduction_222
+happyReduction_222 (HappyAbsSyn5 happy_var_2)
+ _
+ = HappyAbsSyn5
+ (HsFunctorUnit happy_var_2
+ )
+happyReduction_222 _ _ = notHappyAtAll
+
+happyReduce_223 = happySpecReduce_2 97 happyReduction_223
+happyReduction_223 (HappyAbsSyn5 happy_var_2)
+ _
+ = HappyAbsSyn5
+ (HsFunctorCall happy_var_2
+ )
+happyReduction_223 _ _ = notHappyAtAll
+
+happyReduce_224 = happySpecReduce_1 97 happyReduction_224
+happyReduction_224 (HappyAbsSyn5 happy_var_1)
+ = HappyAbsSyn5
+ (happy_var_1
+ )
+happyReduction_224 _ = notHappyAtAll
+
+happyReduce_225 = happyMonadReduce 3 98 happyReduction_225
+happyReduction_225 (_ `HappyStk`
+ _ `HappyStk`
+ (HappyAbsSyn5 happy_var_1) `HappyStk`
+ happyRest)
+ = happyThen ( mkRecConstrOrUpdate happy_var_1 []
+ ) (\r -> happyReturn (HappyAbsSyn5 r))
+
+happyReduce_226 = happyMonadReduce 4 98 happyReduction_226
+happyReduction_226 (_ `HappyStk`
+ (HappyAbsSyn130 happy_var_3) `HappyStk`
+ _ `HappyStk`
+ (HappyAbsSyn5 happy_var_1) `HappyStk`
+ happyRest)
+ = happyThen ( mkRecConstrOrUpdate happy_var_1 (reverse happy_var_3)
+ ) (\r -> happyReturn (HappyAbsSyn5 r))
+
+happyReduce_227 = happySpecReduce_2 98 happyReduction_227
+happyReduction_227 _
+ (HappyAbsSyn5 happy_var_1)
+ = HappyAbsSyn5
+ (HsStarRP happy_var_1
+ )
+happyReduction_227 _ _ = notHappyAtAll
+
+happyReduce_228 = happySpecReduce_2 98 happyReduction_228
+happyReduction_228 _
+ (HappyAbsSyn5 happy_var_1)
+ = HappyAbsSyn5
+ (HsStarGRP happy_var_1
+ )
+happyReduction_228 _ _ = notHappyAtAll
+
+happyReduce_229 = happySpecReduce_2 98 happyReduction_229
+happyReduction_229 _
+ (HappyAbsSyn5 happy_var_1)
+ = HappyAbsSyn5
+ (HsPlusRP happy_var_1
+ )
+happyReduction_229 _ _ = notHappyAtAll
+
+happyReduce_230 = happySpecReduce_2 98 happyReduction_230
+happyReduction_230 _
+ (HappyAbsSyn5 happy_var_1)
+ = HappyAbsSyn5
+ (HsPlusGRP happy_var_1
+ )
+happyReduction_230 _ _ = notHappyAtAll
+
+happyReduce_231 = happySpecReduce_2 98 happyReduction_231
+happyReduction_231 _
+ (HappyAbsSyn5 happy_var_1)
+ = HappyAbsSyn5
+ (HsOptRP happy_var_1
+ )
+happyReduction_231 _ _ = notHappyAtAll
+
+happyReduce_232 = happySpecReduce_2 98 happyReduction_232
+happyReduction_232 _
+ (HappyAbsSyn5 happy_var_1)
+ = HappyAbsSyn5
+ (HsOptGRP happy_var_1
+ )
+happyReduction_232 _ _ = notHappyAtAll
+
+happyReduce_233 = happySpecReduce_1 98 happyReduction_233
+happyReduction_233 (HappyAbsSyn5 happy_var_1)
+ = HappyAbsSyn5
+ (happy_var_1
+ )
+happyReduction_233 _ = notHappyAtAll
+
+happyReduce_234 = happySpecReduce_1 99 happyReduction_234
+happyReduction_234 (HappyAbsSyn140 happy_var_1)
+ = HappyAbsSyn5
+ (HsIPVar happy_var_1
+ )
+happyReduction_234 _ = notHappyAtAll
+
+happyReduce_235 = happySpecReduce_1 99 happyReduction_235
+happyReduction_235 (HappyAbsSyn50 happy_var_1)
+ = HappyAbsSyn5
+ (HsVar happy_var_1
+ )
+happyReduction_235 _ = notHappyAtAll
+
+happyReduce_236 = happySpecReduce_1 99 happyReduction_236
+happyReduction_236 (HappyAbsSyn5 happy_var_1)
+ = HappyAbsSyn5
+ (happy_var_1
+ )
+happyReduction_236 _ = notHappyAtAll
+
+happyReduce_237 = happySpecReduce_1 99 happyReduction_237
+happyReduction_237 (HappyAbsSyn165 happy_var_1)
+ = HappyAbsSyn5
+ (HsLit happy_var_1
+ )
+happyReduction_237 _ = notHappyAtAll
+
+happyReduce_238 = happySpecReduce_3 99 happyReduction_238
+happyReduction_238 _
+ (HappyAbsSyn5 happy_var_2)
+ _
+ = HappyAbsSyn5
+ (HsParen happy_var_2
+ )
+happyReduction_238 _ _ _ = notHappyAtAll
+
+happyReduce_239 = happySpecReduce_3 99 happyReduction_239
+happyReduction_239 _
+ (HappyAbsSyn103 happy_var_2)
+ _
+ = HappyAbsSyn5
+ (HsTuple (reverse happy_var_2)
+ )
+happyReduction_239 _ _ _ = notHappyAtAll
+
+happyReduce_240 = happySpecReduce_3 99 happyReduction_240
+happyReduction_240 _
+ (HappyAbsSyn5 happy_var_2)
+ _
+ = HappyAbsSyn5
+ (happy_var_2
+ )
+happyReduction_240 _ _ _ = notHappyAtAll
+
+happyReduce_241 = happyReduce 4 99 happyReduction_241
+happyReduction_241 (_ `HappyStk`
+ (HappyAbsSyn149 happy_var_3) `HappyStk`
+ (HappyAbsSyn5 happy_var_2) `HappyStk`
+ _ `HappyStk`
+ happyRest)
+ = HappyAbsSyn5
+ (HsLeftSection happy_var_2 happy_var_3
+ ) `HappyStk` happyRest
+
+happyReduce_242 = happyReduce 4 99 happyReduction_242
+happyReduction_242 (_ `HappyStk`
+ (HappyAbsSyn5 happy_var_3) `HappyStk`
+ (HappyAbsSyn149 happy_var_2) `HappyStk`
+ _ `HappyStk`
+ happyRest)
+ = HappyAbsSyn5
+ (HsRightSection happy_var_2 happy_var_3
+ ) `HappyStk` happyRest
+
+happyReduce_243 = happySpecReduce_1 99 happyReduction_243
+happyReduction_243 _
+ = HappyAbsSyn5
+ (HsWildCard
+ )
+
+happyReduce_244 = happySpecReduce_3 99 happyReduction_244
+happyReduction_244 _
+ (HappyAbsSyn5 happy_var_2)
+ _
+ = HappyAbsSyn5
+ (happy_var_2
+ )
+happyReduction_244 _ _ _ = notHappyAtAll
+
+happyReduce_245 = happySpecReduce_3 99 happyReduction_245
+happyReduction_245 _
+ (HappyAbsSyn103 happy_var_2)
+ _
+ = HappyAbsSyn5
+ (HsSeqRP $ reverse happy_var_2
+ )
+happyReduction_245 _ _ _ = notHappyAtAll
+
+happyReduce_246 = happyReduce 4 99 happyReduction_246
+happyReduction_246 (_ `HappyStk`
+ (HappyAbsSyn103 happy_var_3) `HappyStk`
+ _ `HappyStk`
+ (HappyAbsSyn166 happy_var_1) `HappyStk`
+ happyRest)
+ = HappyAbsSyn5
+ (HsRPats happy_var_1 $ reverse happy_var_3
+ ) `HappyStk` happyRest
+
+happyReduce_247 = happySpecReduce_1 99 happyReduction_247
+happyReduction_247 (HappyAbsSyn5 happy_var_1)
+ = HappyAbsSyn5
+ (happy_var_1
+ )
+happyReduction_247 _ = notHappyAtAll
+
+happyReduce_248 = happySpecReduce_1 99 happyReduction_248
+happyReduction_248 (HappyTerminal (THIdEscape happy_var_1))
+ = HappyAbsSyn5
+ (HsSpliceExp $ HsIdSplice happy_var_1
+ )
+happyReduction_248 _ = notHappyAtAll
+
+happyReduce_249 = happyMonadReduce 3 99 happyReduction_249
+happyReduction_249 (_ `HappyStk`
+ (HappyAbsSyn5 happy_var_2) `HappyStk`
+ _ `HappyStk`
+ happyRest)
+ = happyThen ( do { e <- checkExpr happy_var_2;
+ return $ HsSpliceExp $ HsParenSplice e }
+ ) (\r -> happyReturn (HappyAbsSyn5 r))
+
+happyReduce_250 = happyMonadReduce 3 99 happyReduction_250
+happyReduction_250 (_ `HappyStk`
+ (HappyAbsSyn5 happy_var_2) `HappyStk`
+ _ `HappyStk`
+ happyRest)
+ = happyThen ( do { e <- checkExpr happy_var_2;
+ return $ HsBracketExp $ HsExpBracket e }
+ ) (\r -> happyReturn (HappyAbsSyn5 r))
+
+happyReduce_251 = happyMonadReduce 3 99 happyReduction_251
+happyReduction_251 (_ `HappyStk`
+ (HappyAbsSyn5 happy_var_2) `HappyStk`
+ _ `HappyStk`
+ happyRest)
+ = happyThen ( do { p <- checkPattern happy_var_2;
+ return $ HsBracketExp $ HsPatBracket p }
+ ) (\r -> happyReturn (HappyAbsSyn5 r))
+
+happyReduce_252 = happySpecReduce_3 99 happyReduction_252
+happyReduction_252 _
+ (HappyAbsSyn46 happy_var_2)
+ _
+ = HappyAbsSyn5
+ (HsBracketExp $ HsTypeBracket happy_var_2
+ )
+happyReduction_252 _ _ _ = notHappyAtAll
+
+happyReduce_253 = happySpecReduce_3 99 happyReduction_253
+happyReduction_253 _
+ (HappyAbsSyn32 happy_var_2)
+ _
+ = HappyAbsSyn5
+ (HsBracketExp $ HsDeclBracket happy_var_2
+ )
+happyReduction_253 _ _ _ = notHappyAtAll
+
+happyReduce_254 = happySpecReduce_2 100 happyReduction_254
+happyReduction_254 (HappyAbsSyn50 happy_var_2)
+ _
+ = HappyAbsSyn100
+ (HsReifyDecl happy_var_2
+ )
+happyReduction_254 _ _ = notHappyAtAll
+
+happyReduce_255 = happySpecReduce_2 100 happyReduction_255
+happyReduction_255 (HappyAbsSyn50 happy_var_2)
+ _
+ = HappyAbsSyn100
+ (HsReifyDecl happy_var_2
+ )
+happyReduction_255 _ _ = notHappyAtAll
+
+happyReduce_256 = happySpecReduce_2 100 happyReduction_256
+happyReduction_256 (HappyAbsSyn50 happy_var_2)
+ _
+ = HappyAbsSyn100
+ (HsReifyType happy_var_2
+ )
+happyReduction_256 _ _ = notHappyAtAll
+
+happyReduce_257 = happySpecReduce_2 100 happyReduction_257
+happyReduction_257 (HappyAbsSyn50 happy_var_2)
+ _
+ = HappyAbsSyn100
+ (HsReifyFixity happy_var_2
+ )
+happyReduction_257 _ _ = notHappyAtAll
+
+happyReduce_258 = happySpecReduce_1 101 happyReduction_258
+happyReduction_258 (HappyAbsSyn50 happy_var_1)
+ = HappyAbsSyn50
+ (happy_var_1
+ )
+happyReduction_258 _ = notHappyAtAll
+
+happyReduce_259 = happyMonadReduce 1 101 happyReduction_259
+happyReduction_259 ((HappyAbsSyn5 happy_var_1) `HappyStk`
+ happyRest)
+ = happyThen ( getGConName happy_var_1
+ ) (\r -> happyReturn (HappyAbsSyn50 r))
+
+happyReduce_260 = happySpecReduce_2 102 happyReduction_260
+happyReduction_260 _
+ (HappyAbsSyn29 happy_var_1)
+ = HappyAbsSyn29
+ (happy_var_1 + 1
+ )
+happyReduction_260 _ _ = notHappyAtAll
+
+happyReduce_261 = happySpecReduce_1 102 happyReduction_261
+happyReduction_261 _
+ = HappyAbsSyn29
+ (1
+ )
+
+happyReduce_262 = happySpecReduce_3 103 happyReduction_262
+happyReduction_262 (HappyAbsSyn5 happy_var_3)
+ _
+ (HappyAbsSyn103 happy_var_1)
+ = HappyAbsSyn103
+ (happy_var_3 : happy_var_1
+ )
+happyReduction_262 _ _ _ = notHappyAtAll
+
+happyReduce_263 = happySpecReduce_3 103 happyReduction_263
+happyReduction_263 (HappyAbsSyn5 happy_var_3)
+ _
+ (HappyAbsSyn5 happy_var_1)
+ = HappyAbsSyn103
+ ([happy_var_3,happy_var_1]
+ )
+happyReduction_263 _ _ _ = notHappyAtAll
+
+happyReduce_264 = happySpecReduce_3 104 happyReduction_264
+happyReduction_264 (HappyAbsSyn5 happy_var_3)
+ _
+ (HappyAbsSyn103 happy_var_1)
+ = HappyAbsSyn103
+ (happy_var_3 : happy_var_1
+ )
+happyReduction_264 _ _ _ = notHappyAtAll
+
+happyReduce_265 = happySpecReduce_1 104 happyReduction_265
+happyReduction_265 (HappyAbsSyn5 happy_var_1)
+ = HappyAbsSyn103
+ ([happy_var_1]
+ )
+happyReduction_265 _ = notHappyAtAll
+
+happyReduce_266 = happySpecReduce_1 105 happyReduction_266
+happyReduction_266 (HappyAbsSyn5 happy_var_1)
+ = HappyAbsSyn5
+ (happy_var_1
+ )
+happyReduction_266 _ = notHappyAtAll
+
+happyReduce_267 = happySpecReduce_1 105 happyReduction_267
+happyReduction_267 (HappyAbsSyn5 happy_var_1)
+ = HappyAbsSyn5
+ (happy_var_1
+ )
+happyReduction_267 _ = notHappyAtAll
+
+happyReduce_268 = happySpecReduce_3 106 happyReduction_268
+happyReduction_268 (HappyAbsSyn5 happy_var_3)
+ _
+ (HappyAbsSyn5 happy_var_1)
+ = HappyAbsSyn5
+ (HsEitherRP happy_var_1 happy_var_3
+ )
+happyReduction_268 _ _ _ = notHappyAtAll
+
+happyReduce_269 = happySpecReduce_3 106 happyReduction_269
+happyReduction_269 (HappyAbsSyn5 happy_var_3)
+ _
+ (HappyAbsSyn5 happy_var_1)
+ = HappyAbsSyn5
+ (HsEitherRP happy_var_1 happy_var_3
+ )
+happyReduction_269 _ _ _ = notHappyAtAll
+
+happyReduce_270 = happyMonadReduce 10 107 happyReduction_270
+happyReduction_270 (_ `HappyStk`
+ (HappyAbsSyn110 happy_var_9) `HappyStk`
+ _ `HappyStk`
+ (HappyAbsSyn103 happy_var_7) `HappyStk`
+ _ `HappyStk`
+ (HappyAbsSyn114 happy_var_5) `HappyStk`
+ (HappyAbsSyn112 happy_var_4) `HappyStk`
+ (HappyAbsSyn110 happy_var_3) `HappyStk`
+ _ `HappyStk`
+ (HappyAbsSyn166 happy_var_1) `HappyStk`
+ happyRest)
+ = happyThen ( do { n <- checkEqNames happy_var_3 happy_var_9;
+ let { cn = reverse happy_var_7;
+ as = reverse happy_var_4; };
+ return $ HsXTag happy_var_1 n as happy_var_5 cn }
+ ) (\r -> happyReturn (HappyAbsSyn5 r))
+
+happyReduce_271 = happyReduce 6 107 happyReduction_271
+happyReduction_271 (_ `HappyStk`
+ (HappyAbsSyn114 happy_var_5) `HappyStk`
+ (HappyAbsSyn112 happy_var_4) `HappyStk`
+ (HappyAbsSyn110 happy_var_3) `HappyStk`
+ _ `HappyStk`
+ (HappyAbsSyn166 happy_var_1) `HappyStk`
+ happyRest)
+ = HappyAbsSyn5
+ (HsXETag happy_var_1 happy_var_3 (reverse happy_var_4) happy_var_5
+ ) `HappyStk` happyRest
+
+happyReduce_272 = happySpecReduce_3 107 happyReduction_272
+happyReduction_272 _
+ (HappyAbsSyn5 happy_var_2)
+ _
+ = HappyAbsSyn5
+ (HsXExpTag happy_var_2
+ )
+happyReduction_272 _ _ _ = notHappyAtAll
+
+happyReduce_273 = happySpecReduce_2 108 happyReduction_273
+happyReduction_273 (HappyAbsSyn5 happy_var_2)
+ (HappyAbsSyn103 happy_var_1)
+ = HappyAbsSyn103
+ (happy_var_2 : happy_var_1
+ )
+happyReduction_273 _ _ = notHappyAtAll
+
+happyReduce_274 = happySpecReduce_0 108 happyReduction_274
+happyReduction_274 = HappyAbsSyn103
+ ([]
+ )
+
+happyReduce_275 = happySpecReduce_1 109 happyReduction_275
+happyReduction_275 (HappyTerminal (XPcdata happy_var_1))
+ = HappyAbsSyn5
+ (HsXPcdata happy_var_1
+ )
+happyReduction_275 _ = notHappyAtAll
+
+happyReduce_276 = happyReduce 4 109 happyReduction_276
+happyReduction_276 (_ `HappyStk`
+ (HappyAbsSyn103 happy_var_3) `HappyStk`
+ _ `HappyStk`
+ (HappyAbsSyn166 happy_var_1) `HappyStk`
+ happyRest)
+ = HappyAbsSyn5
+ (HsRPats happy_var_1 $ reverse happy_var_3
+ ) `HappyStk` happyRest
+
+happyReduce_277 = happySpecReduce_1 109 happyReduction_277
+happyReduction_277 (HappyAbsSyn5 happy_var_1)
+ = HappyAbsSyn5
+ (happy_var_1
+ )
+happyReduction_277 _ = notHappyAtAll
+
+happyReduce_278 = happySpecReduce_3 110 happyReduction_278
+happyReduction_278 (HappyAbsSyn111 happy_var_3)
+ _
+ (HappyAbsSyn111 happy_var_1)
+ = HappyAbsSyn110
+ (HsXDomName happy_var_1 happy_var_3
+ )
+happyReduction_278 _ _ _ = notHappyAtAll
+
+happyReduce_279 = happySpecReduce_1 110 happyReduction_279
+happyReduction_279 (HappyAbsSyn111 happy_var_1)
+ = HappyAbsSyn110
+ (HsXName happy_var_1
+ )
+happyReduction_279 _ = notHappyAtAll
+
+happyReduce_280 = happySpecReduce_1 111 happyReduction_280
+happyReduction_280 (HappyTerminal (VarId happy_var_1))
+ = HappyAbsSyn111
+ (happy_var_1
+ )
+happyReduction_280 _ = notHappyAtAll
+
+happyReduce_281 = happySpecReduce_1 111 happyReduction_281
+happyReduction_281 (HappyTerminal (ConId happy_var_1))
+ = HappyAbsSyn111
+ (happy_var_1
+ )
+happyReduction_281 _ = notHappyAtAll
+
+happyReduce_282 = happySpecReduce_1 111 happyReduction_282
+happyReduction_282 (HappyTerminal (DVarId happy_var_1))
+ = HappyAbsSyn111
+ (mkDVar happy_var_1
+ )
+happyReduction_282 _ = notHappyAtAll
+
+happyReduce_283 = happySpecReduce_1 111 happyReduction_283
+happyReduction_283 _
+ = HappyAbsSyn111
+ ("type"
+ )
+
+happyReduce_284 = happySpecReduce_1 111 happyReduction_284
+happyReduction_284 _
+ = HappyAbsSyn111
+ ("class"
+ )
+
+happyReduce_285 = happySpecReduce_2 112 happyReduction_285
+happyReduction_285 (HappyAbsSyn113 happy_var_2)
+ (HappyAbsSyn112 happy_var_1)
+ = HappyAbsSyn112
+ (happy_var_2 : happy_var_1
+ )
+happyReduction_285 _ _ = notHappyAtAll
+
+happyReduce_286 = happySpecReduce_0 112 happyReduction_286
+happyReduction_286 = HappyAbsSyn112
+ ([]
+ )
+
+happyReduce_287 = happySpecReduce_3 113 happyReduction_287
+happyReduction_287 (HappyAbsSyn5 happy_var_3)
+ _
+ (HappyAbsSyn110 happy_var_1)
+ = HappyAbsSyn113
+ (HsXAttr happy_var_1 happy_var_3
+ )
+happyReduction_287 _ _ _ = notHappyAtAll
+
+happyReduce_288 = happySpecReduce_1 114 happyReduction_288
+happyReduction_288 (HappyAbsSyn5 happy_var_1)
+ = HappyAbsSyn114
+ (Just happy_var_1
+ )
+happyReduction_288 _ = notHappyAtAll
+
+happyReduce_289 = happySpecReduce_0 114 happyReduction_289
+happyReduction_289 = HappyAbsSyn114
+ (Nothing
+ )
+
+happyReduce_290 = happySpecReduce_1 115 happyReduction_290
+happyReduction_290 (HappyTerminal (DVarId happy_var_1))
+ = HappyAbsSyn5
+ (mkDVarExpr happy_var_1
+ )
+happyReduction_290 _ = notHappyAtAll
+
+happyReduce_291 = happySpecReduce_1 116 happyReduction_291
+happyReduction_291 (HappyAbsSyn5 happy_var_1)
+ = HappyAbsSyn5
+ (HsList [happy_var_1]
+ )
+happyReduction_291 _ = notHappyAtAll
+
+happyReduce_292 = happySpecReduce_1 116 happyReduction_292
+happyReduction_292 (HappyAbsSyn103 happy_var_1)
+ = HappyAbsSyn5
+ (HsList (reverse happy_var_1)
+ )
+happyReduction_292 _ = notHappyAtAll
+
+happyReduce_293 = happySpecReduce_2 116 happyReduction_293
+happyReduction_293 _
+ (HappyAbsSyn5 happy_var_1)
+ = HappyAbsSyn5
+ (HsEnumFrom happy_var_1
+ )
+happyReduction_293 _ _ = notHappyAtAll
+
+happyReduce_294 = happyReduce 4 116 happyReduction_294
+happyReduction_294 (_ `HappyStk`
+ (HappyAbsSyn5 happy_var_3) `HappyStk`
+ _ `HappyStk`
+ (HappyAbsSyn5 happy_var_1) `HappyStk`
+ happyRest)
+ = HappyAbsSyn5
+ (HsEnumFromThen happy_var_1 happy_var_3
+ ) `HappyStk` happyRest
+
+happyReduce_295 = happySpecReduce_3 116 happyReduction_295
+happyReduction_295 (HappyAbsSyn5 happy_var_3)
+ _
+ (HappyAbsSyn5 happy_var_1)
+ = HappyAbsSyn5
+ (HsEnumFromTo happy_var_1 happy_var_3
+ )
+happyReduction_295 _ _ _ = notHappyAtAll
+
+happyReduce_296 = happyReduce 5 116 happyReduction_296
+happyReduction_296 ((HappyAbsSyn5 happy_var_5) `HappyStk`
+ _ `HappyStk`
+ (HappyAbsSyn5 happy_var_3) `HappyStk`
+ _ `HappyStk`
+ (HappyAbsSyn5 happy_var_1) `HappyStk`
+ happyRest)
+ = HappyAbsSyn5
+ (HsEnumFromThenTo happy_var_1 happy_var_3 happy_var_5
+ ) `HappyStk` happyRest
+
+happyReduce_297 = happySpecReduce_3 116 happyReduction_297
+happyReduction_297 (HappyAbsSyn118 happy_var_3)
+ _
+ (HappyAbsSyn5 happy_var_1)
+ = HappyAbsSyn5
+ (HsListComp happy_var_1 (reverse happy_var_3)
+ )
+happyReduction_297 _ _ _ = notHappyAtAll
+
+happyReduce_298 = happySpecReduce_3 117 happyReduction_298
+happyReduction_298 (HappyAbsSyn5 happy_var_3)
+ _
+ (HappyAbsSyn103 happy_var_1)
+ = HappyAbsSyn103
+ (happy_var_3 : happy_var_1
+ )
+happyReduction_298 _ _ _ = notHappyAtAll
+
+happyReduce_299 = happySpecReduce_3 117 happyReduction_299
+happyReduction_299 (HappyAbsSyn5 happy_var_3)
+ _
+ (HappyAbsSyn5 happy_var_1)
+ = HappyAbsSyn103
+ ([happy_var_3,happy_var_1]
+ )
+happyReduction_299 _ _ _ = notHappyAtAll
+
+happyReduce_300 = happySpecReduce_3 118 happyReduction_300
+happyReduction_300 (HappyAbsSyn119 happy_var_3)
+ _
+ (HappyAbsSyn118 happy_var_1)
+ = HappyAbsSyn118
+ (happy_var_3 : happy_var_1
+ )
+happyReduction_300 _ _ _ = notHappyAtAll
+
+happyReduce_301 = happySpecReduce_1 118 happyReduction_301
+happyReduction_301 (HappyAbsSyn119 happy_var_1)
+ = HappyAbsSyn118
+ ([happy_var_1]
+ )
+happyReduction_301 _ = notHappyAtAll
+
+happyReduce_302 = happyReduce 4 119 happyReduction_302
+happyReduction_302 ((HappyAbsSyn5 happy_var_4) `HappyStk`
+ _ `HappyStk`
+ (HappyAbsSyn166 happy_var_2) `HappyStk`
+ (HappyAbsSyn96 happy_var_1) `HappyStk`
+ happyRest)
+ = HappyAbsSyn119
+ (HsGenerator happy_var_2 happy_var_1 happy_var_4
+ ) `HappyStk` happyRest
+
+happyReduce_303 = happySpecReduce_1 119 happyReduction_303
+happyReduction_303 (HappyAbsSyn5 happy_var_1)
+ = HappyAbsSyn119
+ (HsQualifier happy_var_1
+ )
+happyReduction_303 _ = notHappyAtAll
+
+happyReduce_304 = happySpecReduce_2 119 happyReduction_304
+happyReduction_304 (HappyAbsSyn41 happy_var_2)
+ _
+ = HappyAbsSyn119
+ (HsLetStmt happy_var_2
+ )
+happyReduction_304 _ _ = notHappyAtAll
+
+happyReduce_305 = happySpecReduce_3 120 happyReduction_305
+happyReduction_305 _
+ (HappyAbsSyn120 happy_var_2)
+ _
+ = HappyAbsSyn120
+ (happy_var_2
+ )
+happyReduction_305 _ _ _ = notHappyAtAll
+
+happyReduce_306 = happySpecReduce_3 120 happyReduction_306
+happyReduction_306 _
+ (HappyAbsSyn120 happy_var_2)
+ _
+ = HappyAbsSyn120
+ (happy_var_2
+ )
+happyReduction_306 _ _ _ = notHappyAtAll
+
+happyReduce_307 = happySpecReduce_3 121 happyReduction_307
+happyReduction_307 _
+ (HappyAbsSyn120 happy_var_2)
+ _
+ = HappyAbsSyn120
+ (reverse happy_var_2
+ )
+happyReduction_307 _ _ _ = notHappyAtAll
+
+happyReduce_308 = happySpecReduce_3 122 happyReduction_308
+happyReduction_308 (HappyAbsSyn123 happy_var_3)
+ _
+ (HappyAbsSyn120 happy_var_1)
+ = HappyAbsSyn120
+ (happy_var_3 : happy_var_1
+ )
+happyReduction_308 _ _ _ = notHappyAtAll
+
+happyReduce_309 = happySpecReduce_1 122 happyReduction_309
+happyReduction_309 (HappyAbsSyn123 happy_var_1)
+ = HappyAbsSyn120
+ ([happy_var_1]
+ )
+happyReduction_309 _ = notHappyAtAll
+
+happyReduce_310 = happyReduce 4 123 happyReduction_310
+happyReduction_310 ((HappyAbsSyn41 happy_var_4) `HappyStk`
+ (HappyAbsSyn124 happy_var_3) `HappyStk`
+ (HappyAbsSyn96 happy_var_2) `HappyStk`
+ (HappyAbsSyn166 happy_var_1) `HappyStk`
+ happyRest)
+ = HappyAbsSyn123
+ (HsAlt happy_var_1 happy_var_2 happy_var_3 happy_var_4
+ ) `HappyStk` happyRest
+
+happyReduce_311 = happySpecReduce_2 124 happyReduction_311
+happyReduction_311 (HappyAbsSyn5 happy_var_2)
+ _
+ = HappyAbsSyn124
+ (HsUnGuardedAlt happy_var_2
+ )
+happyReduction_311 _ _ = notHappyAtAll
+
+happyReduce_312 = happySpecReduce_1 124 happyReduction_312
+happyReduction_312 (HappyAbsSyn125 happy_var_1)
+ = HappyAbsSyn124
+ (HsGuardedAlts (reverse happy_var_1)
+ )
+happyReduction_312 _ = notHappyAtAll
+
+happyReduce_313 = happySpecReduce_2 125 happyReduction_313
+happyReduction_313 (HappyAbsSyn126 happy_var_2)
+ (HappyAbsSyn125 happy_var_1)
+ = HappyAbsSyn125
+ (happy_var_2 : happy_var_1
+ )
+happyReduction_313 _ _ = notHappyAtAll
+
+happyReduce_314 = happySpecReduce_1 125 happyReduction_314
+happyReduction_314 (HappyAbsSyn126 happy_var_1)
+ = HappyAbsSyn125
+ ([happy_var_1]
+ )
+happyReduction_314 _ = notHappyAtAll
+
+happyReduce_315 = happyReduce 5 126 happyReduction_315
+happyReduction_315 ((HappyAbsSyn5 happy_var_5) `HappyStk`
+ _ `HappyStk`
+ (HappyAbsSyn118 happy_var_3) `HappyStk`
+ _ `HappyStk`
+ (HappyAbsSyn166 happy_var_1) `HappyStk`
+ happyRest)
+ = HappyAbsSyn126
+ (HsGuardedAlt happy_var_1 (reverse happy_var_3) happy_var_5
+ ) `HappyStk` happyRest
+
+happyReduce_316 = happyMonadReduce 1 127 happyReduction_316
+happyReduction_316 ((HappyAbsSyn5 happy_var_1) `HappyStk`
+ happyRest)
+ = happyThen ( checkPattern happy_var_1
+ ) (\r -> happyReturn (HappyAbsSyn96 r))
+
+happyReduce_317 = happySpecReduce_3 128 happyReduction_317
+happyReduction_317 _
+ (HappyAbsSyn118 happy_var_2)
+ _
+ = HappyAbsSyn118
+ (happy_var_2
+ )
+happyReduction_317 _ _ _ = notHappyAtAll
+
+happyReduce_318 = happySpecReduce_3 128 happyReduction_318
+happyReduction_318 _
+ (HappyAbsSyn118 happy_var_2)
+ _
+ = HappyAbsSyn118
+ (happy_var_2
+ )
+happyReduction_318 _ _ _ = notHappyAtAll
+
+happyReduce_319 = happyReduce 4 129 happyReduction_319
+happyReduction_319 ((HappyAbsSyn118 happy_var_4) `HappyStk`
+ _ `HappyStk`
+ (HappyAbsSyn41 happy_var_2) `HappyStk`
+ _ `HappyStk`
+ happyRest)
+ = HappyAbsSyn118
+ (HsLetStmt happy_var_2 : happy_var_4
+ ) `HappyStk` happyRest
+
+happyReduce_320 = happyReduce 6 129 happyReduction_320
+happyReduction_320 ((HappyAbsSyn118 happy_var_6) `HappyStk`
+ _ `HappyStk`
+ (HappyAbsSyn5 happy_var_4) `HappyStk`
+ _ `HappyStk`
+ (HappyAbsSyn166 happy_var_2) `HappyStk`
+ (HappyAbsSyn96 happy_var_1) `HappyStk`
+ happyRest)
+ = HappyAbsSyn118
+ (HsGenerator happy_var_2 happy_var_1 happy_var_4 : happy_var_6
+ ) `HappyStk` happyRest
+
+happyReduce_321 = happySpecReduce_3 129 happyReduction_321
+happyReduction_321 (HappyAbsSyn118 happy_var_3)
+ _
+ (HappyAbsSyn5 happy_var_1)
+ = HappyAbsSyn118
+ (HsQualifier happy_var_1 : happy_var_3
+ )
+happyReduction_321 _ _ _ = notHappyAtAll
+
+happyReduce_322 = happySpecReduce_2 129 happyReduction_322
+happyReduction_322 (HappyAbsSyn118 happy_var_2)
+ _
+ = HappyAbsSyn118
+ (happy_var_2
+ )
+happyReduction_322 _ _ = notHappyAtAll
+
+happyReduce_323 = happySpecReduce_2 129 happyReduction_323
+happyReduction_323 _
+ (HappyAbsSyn5 happy_var_1)
+ = HappyAbsSyn118
+ ([HsQualifier happy_var_1]
+ )
+happyReduction_323 _ _ = notHappyAtAll
+
+happyReduce_324 = happySpecReduce_1 129 happyReduction_324
+happyReduction_324 (HappyAbsSyn5 happy_var_1)
+ = HappyAbsSyn118
+ ([HsQualifier happy_var_1]
+ )
+happyReduction_324 _ = notHappyAtAll
+
+happyReduce_325 = happySpecReduce_3 130 happyReduction_325
+happyReduction_325 (HappyAbsSyn131 happy_var_3)
+ _
+ (HappyAbsSyn130 happy_var_1)
+ = HappyAbsSyn130
+ (happy_var_3 : happy_var_1
+ )
+happyReduction_325 _ _ _ = notHappyAtAll
+
+happyReduce_326 = happySpecReduce_1 130 happyReduction_326
+happyReduction_326 (HappyAbsSyn131 happy_var_1)
+ = HappyAbsSyn130
+ ([happy_var_1]
+ )
+happyReduction_326 _ = notHappyAtAll
+
+happyReduce_327 = happySpecReduce_3 131 happyReduction_327
+happyReduction_327 (HappyAbsSyn5 happy_var_3)
+ _
+ (HappyAbsSyn50 happy_var_1)
+ = HappyAbsSyn131
+ (HsFieldUpdate happy_var_1 happy_var_3
+ )
+happyReduction_327 _ _ _ = notHappyAtAll
+
+happyReduce_328 = happySpecReduce_3 132 happyReduction_328
+happyReduction_328 _
+ (HappyAbsSyn132 happy_var_2)
+ _
+ = HappyAbsSyn132
+ (happy_var_2
+ )
+happyReduction_328 _ _ _ = notHappyAtAll
+
+happyReduce_329 = happySpecReduce_3 132 happyReduction_329
+happyReduction_329 _
+ (HappyAbsSyn132 happy_var_2)
+ _
+ = HappyAbsSyn132
+ (happy_var_2
+ )
+happyReduction_329 _ _ _ = notHappyAtAll
+
+happyReduce_330 = happySpecReduce_3 133 happyReduction_330
+happyReduction_330 _
+ (HappyAbsSyn132 happy_var_2)
+ _
+ = HappyAbsSyn132
+ (reverse happy_var_2
+ )
+happyReduction_330 _ _ _ = notHappyAtAll
+
+happyReduce_331 = happySpecReduce_3 134 happyReduction_331
+happyReduction_331 (HappyAbsSyn135 happy_var_3)
+ _
+ (HappyAbsSyn132 happy_var_1)
+ = HappyAbsSyn132
+ (happy_var_3 : happy_var_1
+ )
+happyReduction_331 _ _ _ = notHappyAtAll
+
+happyReduce_332 = happySpecReduce_1 134 happyReduction_332
+happyReduction_332 (HappyAbsSyn135 happy_var_1)
+ = HappyAbsSyn132
+ ([happy_var_1]
+ )
+happyReduction_332 _ = notHappyAtAll
+
+happyReduce_333 = happyReduce 4 135 happyReduction_333
+happyReduction_333 ((HappyAbsSyn5 happy_var_4) `HappyStk`
+ _ `HappyStk`
+ (HappyAbsSyn140 happy_var_2) `HappyStk`
+ (HappyAbsSyn166 happy_var_1) `HappyStk`
+ happyRest)
+ = HappyAbsSyn135
+ (HsIPBind happy_var_1 happy_var_2 happy_var_4
+ ) `HappyStk` happyRest
+
+happyReduce_334 = happySpecReduce_2 136 happyReduction_334
+happyReduction_334 _
+ _
+ = HappyAbsSyn5
+ (unit_con
+ )
+
+happyReduce_335 = happySpecReduce_2 136 happyReduction_335
+happyReduction_335 _
+ _
+ = HappyAbsSyn5
+ (HsList []
+ )
+
+happyReduce_336 = happySpecReduce_3 136 happyReduction_336
+happyReduction_336 _
+ (HappyAbsSyn29 happy_var_2)
+ _
+ = HappyAbsSyn5
+ (tuple_con happy_var_2
+ )
+happyReduction_336 _ _ _ = notHappyAtAll
+
+happyReduce_337 = happySpecReduce_1 136 happyReduction_337
+happyReduction_337 (HappyAbsSyn50 happy_var_1)
+ = HappyAbsSyn5
+ (HsCon happy_var_1
+ )
+happyReduction_337 _ = notHappyAtAll
+
+happyReduce_338 = happySpecReduce_1 137 happyReduction_338
+happyReduction_338 (HappyAbsSyn137 happy_var_1)
+ = HappyAbsSyn137
+ (happy_var_1
+ )
+happyReduction_338 _ = notHappyAtAll
+
+happyReduce_339 = happySpecReduce_3 137 happyReduction_339
+happyReduction_339 _
+ (HappyAbsSyn137 happy_var_2)
+ _
+ = HappyAbsSyn137
+ (happy_var_2
+ )
+happyReduction_339 _ _ _ = notHappyAtAll
+
+happyReduce_340 = happySpecReduce_1 138 happyReduction_340
+happyReduction_340 (HappyAbsSyn137 happy_var_1)
+ = HappyAbsSyn137
+ (happy_var_1
+ )
+happyReduction_340 _ = notHappyAtAll
+
+happyReduce_341 = happySpecReduce_3 138 happyReduction_341
+happyReduction_341 _
+ (HappyAbsSyn137 happy_var_2)
+ _
+ = HappyAbsSyn137
+ (happy_var_2
+ )
+happyReduction_341 _ _ _ = notHappyAtAll
+
+happyReduce_342 = happySpecReduce_1 139 happyReduction_342
+happyReduction_342 (HappyAbsSyn50 happy_var_1)
+ = HappyAbsSyn50
+ (happy_var_1
+ )
+happyReduction_342 _ = notHappyAtAll
+
+happyReduce_343 = happySpecReduce_3 139 happyReduction_343
+happyReduction_343 _
+ (HappyAbsSyn50 happy_var_2)
+ _
+ = HappyAbsSyn50
+ (happy_var_2
+ )
+happyReduction_343 _ _ _ = notHappyAtAll
+
+happyReduce_344 = happySpecReduce_1 140 happyReduction_344
+happyReduction_344 (HappyAbsSyn140 happy_var_1)
+ = HappyAbsSyn140
+ (happy_var_1
+ )
+happyReduction_344 _ = notHappyAtAll
+
+happyReduce_345 = happySpecReduce_1 141 happyReduction_345
+happyReduction_345 (HappyAbsSyn137 happy_var_1)
+ = HappyAbsSyn137
+ (happy_var_1
+ )
+happyReduction_345 _ = notHappyAtAll
+
+happyReduce_346 = happySpecReduce_3 141 happyReduction_346
+happyReduction_346 _
+ (HappyAbsSyn137 happy_var_2)
+ _
+ = HappyAbsSyn137
+ (happy_var_2
+ )
+happyReduction_346 _ _ _ = notHappyAtAll
+
+happyReduce_347 = happySpecReduce_1 142 happyReduction_347
+happyReduction_347 (HappyAbsSyn50 happy_var_1)
+ = HappyAbsSyn50
+ (happy_var_1
+ )
+happyReduction_347 _ = notHappyAtAll
+
+happyReduce_348 = happySpecReduce_3 142 happyReduction_348
+happyReduction_348 _
+ (HappyAbsSyn50 happy_var_2)
+ _
+ = HappyAbsSyn50
+ (happy_var_2
+ )
+happyReduction_348 _ _ _ = notHappyAtAll
+
+happyReduce_349 = happySpecReduce_1 143 happyReduction_349
+happyReduction_349 (HappyAbsSyn137 happy_var_1)
+ = HappyAbsSyn137
+ (happy_var_1
+ )
+happyReduction_349 _ = notHappyAtAll
+
+happyReduce_350 = happySpecReduce_3 143 happyReduction_350
+happyReduction_350 _
+ (HappyAbsSyn137 happy_var_2)
+ _
+ = HappyAbsSyn137
+ (happy_var_2
+ )
+happyReduction_350 _ _ _ = notHappyAtAll
+
+happyReduce_351 = happySpecReduce_1 144 happyReduction_351
+happyReduction_351 (HappyAbsSyn50 happy_var_1)
+ = HappyAbsSyn50
+ (happy_var_1
+ )
+happyReduction_351 _ = notHappyAtAll
+
+happyReduce_352 = happySpecReduce_3 144 happyReduction_352
+happyReduction_352 _
+ (HappyAbsSyn50 happy_var_2)
+ _
+ = HappyAbsSyn50
+ (happy_var_2
+ )
+happyReduction_352 _ _ _ = notHappyAtAll
+
+happyReduce_353 = happySpecReduce_1 145 happyReduction_353
+happyReduction_353 (HappyAbsSyn50 happy_var_1)
+ = HappyAbsSyn50
+ (happy_var_1
+ )
+happyReduction_353 _ = notHappyAtAll
+
+happyReduce_354 = happySpecReduce_3 145 happyReduction_354
+happyReduction_354 _
+ (HappyAbsSyn50 happy_var_2)
+ _
+ = HappyAbsSyn50
+ (happy_var_2
+ )
+happyReduction_354 _ _ _ = notHappyAtAll
+
+happyReduce_355 = happySpecReduce_1 146 happyReduction_355
+happyReduction_355 (HappyAbsSyn137 happy_var_1)
+ = HappyAbsSyn137
+ (happy_var_1
+ )
+happyReduction_355 _ = notHappyAtAll
+
+happyReduce_356 = happySpecReduce_3 146 happyReduction_356
+happyReduction_356 _
+ (HappyAbsSyn137 happy_var_2)
+ _
+ = HappyAbsSyn137
+ (happy_var_2
+ )
+happyReduction_356 _ _ _ = notHappyAtAll
+
+happyReduce_357 = happySpecReduce_1 147 happyReduction_357
+happyReduction_357 (HappyAbsSyn50 happy_var_1)
+ = HappyAbsSyn50
+ (happy_var_1
+ )
+happyReduction_357 _ = notHappyAtAll
+
+happyReduce_358 = happySpecReduce_3 147 happyReduction_358
+happyReduction_358 _
+ (HappyAbsSyn50 happy_var_2)
+ _
+ = HappyAbsSyn50
+ (happy_var_2
+ )
+happyReduction_358 _ _ _ = notHappyAtAll
+
+happyReduce_359 = happySpecReduce_1 148 happyReduction_359
+happyReduction_359 (HappyAbsSyn137 happy_var_1)
+ = HappyAbsSyn148
+ (HsVarOp happy_var_1
+ )
+happyReduction_359 _ = notHappyAtAll
+
+happyReduce_360 = happySpecReduce_1 148 happyReduction_360
+happyReduction_360 (HappyAbsSyn137 happy_var_1)
+ = HappyAbsSyn148
+ (HsConOp happy_var_1
+ )
+happyReduction_360 _ = notHappyAtAll
+
+happyReduce_361 = happySpecReduce_1 149 happyReduction_361
+happyReduction_361 (HappyAbsSyn50 happy_var_1)
+ = HappyAbsSyn149
+ (HsQVarOp happy_var_1
+ )
+happyReduction_361 _ = notHappyAtAll
+
+happyReduce_362 = happySpecReduce_1 149 happyReduction_362
+happyReduction_362 (HappyAbsSyn50 happy_var_1)
+ = HappyAbsSyn149
+ (HsQConOp happy_var_1
+ )
+happyReduction_362 _ = notHappyAtAll
+
+happyReduce_363 = happySpecReduce_1 150 happyReduction_363
+happyReduction_363 (HappyAbsSyn50 happy_var_1)
+ = HappyAbsSyn149
+ (HsQVarOp happy_var_1
+ )
+happyReduction_363 _ = notHappyAtAll
+
+happyReduce_364 = happySpecReduce_1 150 happyReduction_364
+happyReduction_364 (HappyAbsSyn50 happy_var_1)
+ = HappyAbsSyn149
+ (HsQConOp happy_var_1
+ )
+happyReduction_364 _ = notHappyAtAll
+
+happyReduce_365 = happySpecReduce_1 151 happyReduction_365
+happyReduction_365 _
+ = HappyAbsSyn50
+ (list_cons_name
+ )
+
+happyReduce_366 = happySpecReduce_1 151 happyReduction_366
+happyReduction_366 (HappyAbsSyn50 happy_var_1)
+ = HappyAbsSyn50
+ (happy_var_1
+ )
+happyReduction_366 _ = notHappyAtAll
+
+happyReduce_367 = happySpecReduce_1 152 happyReduction_367
+happyReduction_367 (HappyAbsSyn137 happy_var_1)
+ = HappyAbsSyn50
+ (UnQual happy_var_1
+ )
+happyReduction_367 _ = notHappyAtAll
+
+happyReduce_368 = happySpecReduce_1 152 happyReduction_368
+happyReduction_368 (HappyTerminal (QVarId happy_var_1))
+ = HappyAbsSyn50
+ (Qual (Module (fst happy_var_1)) (HsIdent (snd happy_var_1))
+ )
+happyReduction_368 _ = notHappyAtAll
+
+happyReduce_369 = happySpecReduce_1 153 happyReduction_369
+happyReduction_369 (HappyTerminal (VarId happy_var_1))
+ = HappyAbsSyn137
+ (HsIdent happy_var_1
+ )
+happyReduction_369 _ = notHappyAtAll
+
+happyReduce_370 = happySpecReduce_1 153 happyReduction_370
+happyReduction_370 _
+ = HappyAbsSyn137
+ (as_name
+ )
+
+happyReduce_371 = happySpecReduce_1 153 happyReduction_371
+happyReduction_371 _
+ = HappyAbsSyn137
+ (qualified_name
+ )
+
+happyReduce_372 = happySpecReduce_1 153 happyReduction_372
+happyReduction_372 _
+ = HappyAbsSyn137
+ (hiding_name
+ )
+
+happyReduce_373 = happySpecReduce_1 153 happyReduction_373
+happyReduction_373 _
+ = HappyAbsSyn137
+ (export_name
+ )
+
+happyReduce_374 = happySpecReduce_1 153 happyReduction_374
+happyReduction_374 _
+ = HappyAbsSyn137
+ (stdcall_name
+ )
+
+happyReduce_375 = happySpecReduce_1 153 happyReduction_375
+happyReduction_375 _
+ = HappyAbsSyn137
+ (ccall_name
+ )
+
+happyReduce_376 = happySpecReduce_1 154 happyReduction_376
+happyReduction_376 (HappyAbsSyn137 happy_var_1)
+ = HappyAbsSyn137
+ (happy_var_1
+ )
+happyReduction_376 _ = notHappyAtAll
+
+happyReduce_377 = happySpecReduce_1 154 happyReduction_377
+happyReduction_377 _
+ = HappyAbsSyn137
+ (safe_name
+ )
+
+happyReduce_378 = happySpecReduce_1 154 happyReduction_378
+happyReduction_378 _
+ = HappyAbsSyn137
+ (unsafe_name
+ )
+
+happyReduce_379 = happySpecReduce_1 154 happyReduction_379
+happyReduction_379 _
+ = HappyAbsSyn137
+ (threadsafe_name
+ )
+
+happyReduce_380 = happySpecReduce_1 155 happyReduction_380
+happyReduction_380 (HappyTerminal (IDupVarId happy_var_1))
+ = HappyAbsSyn140
+ (HsIPDup happy_var_1
+ )
+happyReduction_380 _ = notHappyAtAll
+
+happyReduce_381 = happySpecReduce_1 155 happyReduction_381
+happyReduction_381 (HappyTerminal (ILinVarId happy_var_1))
+ = HappyAbsSyn140
+ (HsIPLin happy_var_1
+ )
+happyReduction_381 _ = notHappyAtAll
+
+happyReduce_382 = happySpecReduce_1 156 happyReduction_382
+happyReduction_382 (HappyAbsSyn137 happy_var_1)
+ = HappyAbsSyn50
+ (UnQual happy_var_1
+ )
+happyReduction_382 _ = notHappyAtAll
+
+happyReduce_383 = happySpecReduce_1 156 happyReduction_383
+happyReduction_383 (HappyTerminal (QConId happy_var_1))
+ = HappyAbsSyn50
+ (Qual (Module (fst happy_var_1)) (HsIdent (snd happy_var_1))
+ )
+happyReduction_383 _ = notHappyAtAll
+
+happyReduce_384 = happySpecReduce_1 157 happyReduction_384
+happyReduction_384 (HappyTerminal (ConId happy_var_1))
+ = HappyAbsSyn137
+ (HsIdent happy_var_1
+ )
+happyReduction_384 _ = notHappyAtAll
+
+happyReduce_385 = happySpecReduce_1 158 happyReduction_385
+happyReduction_385 (HappyAbsSyn137 happy_var_1)
+ = HappyAbsSyn50
+ (UnQual happy_var_1
+ )
+happyReduction_385 _ = notHappyAtAll
+
+happyReduce_386 = happySpecReduce_1 158 happyReduction_386
+happyReduction_386 (HappyTerminal (QConSym happy_var_1))
+ = HappyAbsSyn50
+ (Qual (Module (fst happy_var_1)) (HsSymbol (snd happy_var_1))
+ )
+happyReduction_386 _ = notHappyAtAll
+
+happyReduce_387 = happySpecReduce_1 159 happyReduction_387
+happyReduction_387 (HappyTerminal (ConSym happy_var_1))
+ = HappyAbsSyn137
+ (HsSymbol happy_var_1
+ )
+happyReduction_387 _ = notHappyAtAll
+
+happyReduce_388 = happySpecReduce_1 160 happyReduction_388
+happyReduction_388 (HappyAbsSyn137 happy_var_1)
+ = HappyAbsSyn50
+ (UnQual happy_var_1
+ )
+happyReduction_388 _ = notHappyAtAll
+
+happyReduce_389 = happySpecReduce_1 160 happyReduction_389
+happyReduction_389 (HappyAbsSyn50 happy_var_1)
+ = HappyAbsSyn50
+ (happy_var_1
+ )
+happyReduction_389 _ = notHappyAtAll
+
+happyReduce_390 = happySpecReduce_1 161 happyReduction_390
+happyReduction_390 (HappyAbsSyn137 happy_var_1)
+ = HappyAbsSyn50
+ (UnQual happy_var_1
+ )
+happyReduction_390 _ = notHappyAtAll
+
+happyReduce_391 = happySpecReduce_1 161 happyReduction_391
+happyReduction_391 (HappyAbsSyn50 happy_var_1)
+ = HappyAbsSyn50
+ (happy_var_1
+ )
+happyReduction_391 _ = notHappyAtAll
+
+happyReduce_392 = happySpecReduce_1 162 happyReduction_392
+happyReduction_392 (HappyTerminal (VarSym happy_var_1))
+ = HappyAbsSyn137
+ (HsSymbol happy_var_1
+ )
+happyReduction_392 _ = notHappyAtAll
+
+happyReduce_393 = happySpecReduce_1 162 happyReduction_393
+happyReduction_393 _
+ = HappyAbsSyn137
+ (minus_name
+ )
+
+happyReduce_394 = happySpecReduce_1 162 happyReduction_394
+happyReduction_394 _
+ = HappyAbsSyn137
+ (pling_name
+ )
+
+happyReduce_395 = happySpecReduce_1 162 happyReduction_395
+happyReduction_395 _
+ = HappyAbsSyn137
+ (dot_name
+ )
+
+happyReduce_396 = happySpecReduce_1 163 happyReduction_396
+happyReduction_396 (HappyTerminal (VarSym happy_var_1))
+ = HappyAbsSyn137
+ (HsSymbol happy_var_1
+ )
+happyReduction_396 _ = notHappyAtAll
+
+happyReduce_397 = happySpecReduce_1 163 happyReduction_397
+happyReduction_397 _
+ = HappyAbsSyn137
+ (pling_name
+ )
+
+happyReduce_398 = happySpecReduce_1 163 happyReduction_398
+happyReduction_398 _
+ = HappyAbsSyn137
+ (dot_name
+ )
+
+happyReduce_399 = happySpecReduce_1 164 happyReduction_399
+happyReduction_399 (HappyTerminal (QVarSym happy_var_1))
+ = HappyAbsSyn50
+ (Qual (Module (fst happy_var_1)) (HsSymbol (snd happy_var_1))
+ )
+happyReduction_399 _ = notHappyAtAll
+
+happyReduce_400 = happySpecReduce_1 165 happyReduction_400
+happyReduction_400 (HappyTerminal (IntTok happy_var_1))
+ = HappyAbsSyn165
+ (HsInt happy_var_1
+ )
+happyReduction_400 _ = notHappyAtAll
+
+happyReduce_401 = happySpecReduce_1 165 happyReduction_401
+happyReduction_401 (HappyTerminal (Character happy_var_1))
+ = HappyAbsSyn165
+ (HsChar happy_var_1
+ )
+happyReduction_401 _ = notHappyAtAll
+
+happyReduce_402 = happySpecReduce_1 165 happyReduction_402
+happyReduction_402 (HappyTerminal (FloatTok happy_var_1))
+ = HappyAbsSyn165
+ (HsFrac happy_var_1
+ )
+happyReduction_402 _ = notHappyAtAll
+
+happyReduce_403 = happySpecReduce_1 165 happyReduction_403
+happyReduction_403 (HappyTerminal (StringTok happy_var_1))
+ = HappyAbsSyn165
+ (HsString happy_var_1
+ )
+happyReduction_403 _ = notHappyAtAll
+
+happyReduce_404 = happyMonadReduce 0 166 happyReduction_404
+happyReduction_404 (happyRest)
+ = happyThen ( getSrcLoc
+ ) (\r -> happyReturn (HappyAbsSyn166 r))
+
+happyReduce_405 = happyMonadReduce 0 167 happyReduction_405
+happyReduction_405 (happyRest)
+ = happyThen ( pushCurrentContext
+ ) (\r -> happyReturn (HappyAbsSyn10 r))
+
+happyReduce_406 = happySpecReduce_1 168 happyReduction_406
+happyReduction_406 _
+ = HappyAbsSyn10
+ (()
+ )
+
+happyReduce_407 = happyMonadReduce 1 168 happyReduction_407
+happyReduction_407 (_ `HappyStk`
+ happyRest)
+ = happyThen ( popContext
+ ) (\r -> happyReturn (HappyAbsSyn10 r))
+
+happyReduce_408 = happySpecReduce_1 169 happyReduction_408
+happyReduction_408 (HappyTerminal (ConId happy_var_1))
+ = HappyAbsSyn169
+ (Module happy_var_1
+ )
+happyReduction_408 _ = notHappyAtAll
+
+happyReduce_409 = happySpecReduce_1 169 happyReduction_409
+happyReduction_409 (HappyTerminal (QConId happy_var_1))
+ = HappyAbsSyn169
+ (Module (fst happy_var_1 ++ '.':snd happy_var_1)
+ )
+happyReduction_409 _ = notHappyAtAll
+
+happyReduce_410 = happySpecReduce_1 170 happyReduction_410
+happyReduction_410 (HappyAbsSyn137 happy_var_1)
+ = HappyAbsSyn137
+ (happy_var_1
+ )
+happyReduction_410 _ = notHappyAtAll
+
+happyReduce_411 = happySpecReduce_1 171 happyReduction_411
+happyReduction_411 (HappyAbsSyn137 happy_var_1)
+ = HappyAbsSyn137
+ (happy_var_1
+ )
+happyReduction_411 _ = notHappyAtAll
+
+happyReduce_412 = happySpecReduce_1 172 happyReduction_412
+happyReduction_412 (HappyAbsSyn50 happy_var_1)
+ = HappyAbsSyn50
+ (happy_var_1
+ )
+happyReduction_412 _ = notHappyAtAll
+
+happyReduce_413 = happySpecReduce_1 173 happyReduction_413
+happyReduction_413 (HappyAbsSyn50 happy_var_1)
+ = HappyAbsSyn50
+ (happy_var_1
+ )
+happyReduction_413 _ = notHappyAtAll
+
+happyReduce_414 = happySpecReduce_1 174 happyReduction_414
+happyReduction_414 (HappyAbsSyn137 happy_var_1)
+ = HappyAbsSyn137
+ (happy_var_1
+ )
+happyReduction_414 _ = notHappyAtAll
+
+happyReduce_415 = happySpecReduce_3 175 happyReduction_415
+happyReduction_415 _
+ (HappyAbsSyn137 happy_var_2)
+ _
+ = HappyAbsSyn50
+ (UnQual happy_var_2
+ )
+happyReduction_415 _ _ _ = notHappyAtAll
+
+happyReduce_416 = happySpecReduce_1 175 happyReduction_416
+happyReduction_416 (HappyAbsSyn137 happy_var_1)
+ = HappyAbsSyn50
+ (UnQual happy_var_1
+ )
+happyReduction_416 _ = notHappyAtAll
+
+happyReduce_417 = happySpecReduce_1 176 happyReduction_417
+happyReduction_417 (HappyTerminal (VarSym happy_var_1))
+ = HappyAbsSyn137
+ (HsSymbol happy_var_1
+ )
+happyReduction_417 _ = notHappyAtAll
+
+happyNewToken action sts stk
+ = lexer(\tk ->
+ let cont i = action i i tk (HappyState action) sts stk in
+ case tk of {
+ EOF -> action 285 285 (error "reading EOF!") (HappyState action) sts stk;
+ VarId happy_dollar_dollar -> cont 177;
+ QVarId happy_dollar_dollar -> cont 178;
+ IDupVarId happy_dollar_dollar -> cont 179;
+ ILinVarId happy_dollar_dollar -> cont 180;
+ ConId happy_dollar_dollar -> cont 181;
+ QConId happy_dollar_dollar -> cont 182;
+ DVarId happy_dollar_dollar -> cont 183;
+ VarSym happy_dollar_dollar -> cont 184;
+ ConSym happy_dollar_dollar -> cont 185;
+ QVarSym happy_dollar_dollar -> cont 186;
+ QConSym happy_dollar_dollar -> cont 187;
+ IntTok happy_dollar_dollar -> cont 188;
+ FloatTok happy_dollar_dollar -> cont 189;
+ Character happy_dollar_dollar -> cont 190;
+ StringTok happy_dollar_dollar -> cont 191;
+ Pragma happy_dollar_dollar -> cont 192;
+ LeftParen -> cont 193;
+ RightParen -> cont 194;
+ LeftHashParen -> cont 195;
+ RightHashParen -> cont 196;
+ SemiColon -> cont 197;
+ LeftCurly -> cont 198;
+ RightCurly -> cont 199;
+ VRightCurly -> cont 200;
+ LeftSquare -> cont 201;
+ RightSquare -> cont 202;
+ Comma -> cont 203;
+ Underscore -> cont 204;
+ BackQuote -> cont 205;
+ Dot -> cont 206;
+ DotDot -> cont 207;
+ Colon -> cont 208;
+ DoubleColon -> cont 209;
+ Equals -> cont 210;
+ Backslash -> cont 211;
+ Bar -> cont 212;
+ LeftArrow -> cont 213;
+ RightArrow -> cont 214;
+ At -> cont 215;
+ Tilde -> cont 216;
+ DoubleArrow -> cont 217;
+ Minus -> cont 218;
+ Exclamation -> cont 219;
+ Hash -> cont 220;
+ RPOpen -> cont 221;
+ RPClose -> cont 222;
+ RPSeqOpen -> cont 223;
+ RPSeqClose -> cont 224;
+ RPStar -> cont 225;
+ RPStarG -> cont 226;
+ RPPlus -> cont 227;
+ RPPlusG -> cont 228;
+ RPOpt -> cont 229;
+ RPOptG -> cont 230;
+ RPEither -> cont 231;
+ RPCAt -> cont 232;
+ THIdEscape happy_dollar_dollar -> cont 233;
+ THParenEscape -> cont 234;
+ THExpQuote -> cont 235;
+ THPatQuote -> cont 236;
+ THTypQuote -> cont 237;
+ THDecQuote -> cont 238;
+ THCloseQuote -> cont 239;
+ THReifyDecl -> cont 240;
+ THReifyType -> cont 241;
+ THReifyFixity -> cont 242;
+ XPcdata happy_dollar_dollar -> cont 243;
+ XStdTagOpen -> cont 244;
+ XCloseTagOpen -> cont 245;
+ XCodeTagOpen -> cont 246;
+ XStdTagClose -> cont 247;
+ XEmptyTagClose -> cont 248;
+ XCodeTagClose -> cont 249;
+ KW_Foreign -> cont 250;
+ KW_Export -> cont 251;
+ KW_Safe -> cont 252;
+ KW_Unsafe -> cont 253;
+ KW_Threadsafe -> cont 254;
+ KW_StdCall -> cont 255;
+ KW_CCall -> cont 256;
+ KW_As -> cont 257;
+ KW_Case -> cont 258;
+ KW_Class -> cont 259;
+ KW_Data -> cont 260;
+ KW_Default -> cont 261;
+ KW_Deriving -> cont 262;
+ KW_DLet -> cont 263;
+ KW_Do -> cont 264;
+ KW_Else -> cont 265;
+ KW_Forall -> cont 266;
+ KW_Hiding -> cont 267;
+ KW_If -> cont 268;
+ KW_Import -> cont 269;
+ KW_In -> cont 270;
+ KW_Infix -> cont 271;
+ KW_InfixL -> cont 272;
+ KW_InfixR -> cont 273;
+ KW_Instance -> cont 274;
+ KW_Let -> cont 275;
+ KW_MDo -> cont 276;
+ KW_Module -> cont 277;
+ KW_NewType -> cont 278;
+ KW_Of -> cont 279;
+ KW_Then -> cont 280;
+ KW_Type -> cont 281;
+ KW_Where -> cont 282;
+ KW_With -> cont 283;
+ KW_Qualified -> cont 284;
+ _ -> happyError'
+ })
+
+happyError_ tk = happyError'
+
+happyThen :: () => P a -> (a -> P b) -> P b
+happyThen = (>>=)
+happyReturn :: () => a -> P a
+happyReturn = (return)
+happyThen1 = happyThen
+happyReturn1 :: () => a -> P a
+happyReturn1 = happyReturn
+happyError' :: () => P a
+happyError' = happyError
+
+parse = happySomeParser where
+ happySomeParser = happyThen (happyParse action_0) (\x -> case x of {HappyAbsSyn4 z -> happyReturn z; _other -> notHappyAtAll })
+
+happySeq = happyDontSeq
+
+happyError :: P a
+happyError = fail "Parse error"
+
+-- | Parse of a string, which should contain a complete Haskell 98 module.
+parseModule :: String -> ParseResult HsModule
+parseModule = runParser parse
+
+-- | Parse of a string, which should contain a complete Haskell 98 module.
+parseModuleWithMode :: ParseMode -> String -> ParseResult HsModule
+parseModuleWithMode mode = runParserWithMode mode parse
+{-# LINE 1 "GenericTemplate.hs" #-}
+{-# LINE 1 "<built-in>" #-}
+{-# LINE 1 "<command line>" #-}
+{-# LINE 1 "GenericTemplate.hs" #-}
+-- $Id$
+
+{-# LINE 16 "GenericTemplate.hs" #-}
+{-# LINE 28 "GenericTemplate.hs" #-}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+infixr 9 `HappyStk`
+data HappyStk a = HappyStk a (HappyStk a)
+
+-----------------------------------------------------------------------------
+-- starting the parse
+
+happyParse start_state = happyNewToken start_state notHappyAtAll notHappyAtAll
+
+-----------------------------------------------------------------------------
+-- Accepting the parse
+
+-- If the current token is (1), it means we've just accepted a partial
+-- parse (a %partial parser). We must ignore the saved token on the top of
+-- the stack in this case.
+happyAccept (1) tk st sts (_ `HappyStk` ans `HappyStk` _) =
+ happyReturn1 ans
+happyAccept j tk st sts (HappyStk ans _) =
+ (happyReturn1 ans)
+
+-----------------------------------------------------------------------------
+-- Arrays only: do the next action
+
+{-# LINE 155 "GenericTemplate.hs" #-}
+
+-----------------------------------------------------------------------------
+-- HappyState data type (not arrays)
+
+
+
+newtype HappyState b c = HappyState
+ (Int -> -- token number
+ Int -> -- token number (yes, again)
+ b -> -- token semantic value
+ HappyState b c -> -- current state
+ [HappyState b c] -> -- state stack
+ c)
+
+
+
+-----------------------------------------------------------------------------
+-- Shifting a token
+
+happyShift new_state (1) tk st sts stk@(x `HappyStk` _) =
+ let i = (case x of { HappyErrorToken (i) -> i }) in
+-- trace "shifting the error token" $
+ new_state i i tk (HappyState (new_state)) ((st):(sts)) (stk)
+
+happyShift new_state i tk st sts stk =
+ happyNewToken new_state ((st):(sts)) ((HappyTerminal (tk))`HappyStk`stk)
+
+-- happyReduce is specialised for the common cases.
+
+happySpecReduce_0 i fn (1) tk st sts stk
+ = happyFail (1) tk st sts stk
+happySpecReduce_0 nt fn j tk st@((HappyState (action))) sts stk
+ = action nt j tk st ((st):(sts)) (fn `HappyStk` stk)
+
+happySpecReduce_1 i fn (1) tk st sts stk
+ = happyFail (1) tk st sts stk
+happySpecReduce_1 nt fn j tk _ sts@(((st@(HappyState (action))):(_))) (v1`HappyStk`stk')
+ = let r = fn v1 in
+ happySeq r (action nt j tk st sts (r `HappyStk` stk'))
+
+happySpecReduce_2 i fn (1) tk st sts stk
+ = happyFail (1) tk st sts stk
+happySpecReduce_2 nt fn j tk _ ((_):(sts@(((st@(HappyState (action))):(_))))) (v1`HappyStk`v2`HappyStk`stk')
+ = let r = fn v1 v2 in
+ happySeq r (action nt j tk st sts (r `HappyStk` stk'))
+
+happySpecReduce_3 i fn (1) tk st sts stk
+ = happyFail (1) tk st sts stk
+happySpecReduce_3 nt fn j tk _ ((_):(((_):(sts@(((st@(HappyState (action))):(_))))))) (v1`HappyStk`v2`HappyStk`v3`HappyStk`stk')
+ = let r = fn v1 v2 v3 in
+ happySeq r (action nt j tk st sts (r `HappyStk` stk'))
+
+happyReduce k i fn (1) tk st sts stk
+ = happyFail (1) tk st sts stk
+happyReduce k nt fn j tk st sts stk
+ = case happyDrop (k - ((1) :: Int)) sts of
+ sts1@(((st1@(HappyState (action))):(_))) ->
+ let r = fn stk in -- it doesn't hurt to always seq here...
+ happyDoSeq r (action nt j tk st1 sts1 r)
+
+happyMonadReduce k nt fn (1) tk st sts stk
+ = happyFail (1) tk st sts stk
+happyMonadReduce k nt fn j tk st sts stk =
+ happyThen1 (fn stk) (\r -> action nt j tk st1 sts1 (r `HappyStk` drop_stk))
+ where sts1@(((st1@(HappyState (action))):(_))) = happyDrop k ((st):(sts))
+ drop_stk = happyDropStk k stk
+
+happyDrop (0) l = l
+happyDrop n ((_):(t)) = happyDrop (n - ((1) :: Int)) t
+
+happyDropStk (0) l = l
+happyDropStk n (x `HappyStk` xs) = happyDropStk (n - ((1)::Int)) xs
+
+-----------------------------------------------------------------------------
+-- Moving to a new state after a reduction
+
+{-# LINE 239 "GenericTemplate.hs" #-}
+happyGoto action j tk st = action j j tk (HappyState action)
+
+
+-----------------------------------------------------------------------------
+-- Error recovery ((1) is the error token)
+
+-- parse error if we are in recovery and we fail again
+happyFail (1) tk old_st _ stk =
+-- trace "failing" $
+ happyError_ tk
+
+{- We don't need state discarding for our restricted implementation of
+ "error". In fact, it can cause some bogus parses, so I've disabled it
+ for now --SDM
+
+-- discard a state
+happyFail (1) tk old_st (((HappyState (action))):(sts))
+ (saved_tok `HappyStk` _ `HappyStk` stk) =
+-- trace ("discarding state, depth " ++ show (length stk)) $
+ action (1) (1) tk (HappyState (action)) sts ((saved_tok`HappyStk`stk))
+-}
+
+-- Enter error recovery: generate an error token,
+-- save the old token and carry on.
+happyFail i tk (HappyState (action)) sts stk =
+-- trace "entering error recovery" $
+ action (1) (1) tk (HappyState (action)) sts ( (HappyErrorToken (i)) `HappyStk` stk)
+
+-- Internal happy errors:
+
+notHappyAtAll = error "Internal Happy error\n"
+
+-----------------------------------------------------------------------------
+-- Hack to get the typechecker to accept our action functions
+
+
+
+
+
+
+
+-----------------------------------------------------------------------------
+-- Seq-ing. If the --strict flag is given, then Happy emits
+-- happySeq = happyDoSeq
+-- otherwise it emits
+-- happySeq = happyDontSeq
+
+happyDoSeq, happyDontSeq :: a -> b -> b
+happyDoSeq a b = a `seq` b
+happyDontSeq a b = b
+
+-----------------------------------------------------------------------------
+-- Don't inline any functions from the template. GHC has a nasty habit
+-- of deciding to inline happyGoto everywhere, which increases the size of
+-- the generated parser quite a bit.
+
+{-# LINE 303 "GenericTemplate.hs" #-}
+{-# NOINLINE happyShift #-}
+{-# NOINLINE happySpecReduce_0 #-}
+{-# NOINLINE happySpecReduce_1 #-}
+{-# NOINLINE happySpecReduce_2 #-}
+{-# NOINLINE happySpecReduce_3 #-}
+{-# NOINLINE happyReduce #-}
+{-# NOINLINE happyMonadReduce #-}
+{-# NOINLINE happyGoto #-}
+{-# NOINLINE happyFail #-}
+
+-- end of Happy Template.
diff -rN -u old-fenfire-hs/Preprocessor/Hsx/Parser.ly new-fenfire-hs/Preprocessor/Hsx/Parser.ly
--- old-fenfire-hs/Preprocessor/Hsx/Parser.ly 1970-01-01 02:00:00.000000000 +0200
+++ new-fenfire-hs/Preprocessor/Hsx/Parser.ly 2007-02-12 19:32:17.000000000 +0200
@@ -0,0 +1,1175 @@
+> {
+> -----------------------------------------------------------------------------
+> -- |
+> -- Module : Preprocessor.Hsx.Parser
+> -- Original : Language.Haskell.Parser
+> -- Copyright : (c) Niklas Broberg 2004,
+> -- Original (c) Simon Marlow, Sven Panne 1997-2000
+> -- License : BSD-style (see the file LICENSE.txt)
+> --
+> -- Maintainer : Niklas Broberg, d00nibro at dtek.chalmers.se
+> -- Stability : experimental
+> -- Portability : portable
+> --
+> --
+> -----------------------------------------------------------------------------
+>
+> module Preprocessor.Hsx.Parser (
+> parseModule, parseModuleWithMode,
+> ParseMode(..), defaultParseMode, ParseResult(..)) where
+>
+> import Preprocessor.Hsx.Syntax
+> import Preprocessor.Hsx.ParseMonad
+> import Preprocessor.Hsx.Lexer
+> import Preprocessor.Hsx.ParseUtils
+> }
+
+-----------------------------------------------------------------------------
+This module comprises a parser for Haskell 98 with the following extensions
+
+* Multi-parameter type classes with functional dependencies
+* Implicit parameters
+* Pattern guards
+* Mdo notation
+* FFI
+* HaRP
+* HSP
+
+Most of the code is blatantly stolen from the GHC module Preprocessor.Parser.
+Some of the code for extensions is greatly influenced by GHC's internal parser
+library, ghc/compiler/parser/Parser.y.
+-----------------------------------------------------------------------------
+Conflicts: 3 shift/reduce
+
+2 for ambiguity in 'case x of y | let z = y in z :: Bool -> b'
+ (don't know whether to reduce 'Bool' as a btype or shift the '->'.
+ Similarly lambda and if. The default resolution in favour of the
+ shift means that a guard can never end with a type signature.
+ In mitigation: it's a rare case and no Haskell implementation
+ allows these, because it would require unbounded lookahead.)
+ There are 2 conflicts rather than one because contexts are parsed
+ as btypes (cf ctype).
+
+1 for ambiguity in 'let ?x ...'
+ the parser can't tell whether the ?x is the lhs of a normal binding or
+ an implicit binding. Fortunately resolving as shift gives it the only
+ sensible meaning, namely the lhs of an implicit binding.
+
+-----------------------------------------------------------------------------
+
+> %token
+> VARID { VarId $$ }
+> QVARID { QVarId $$ }
+> IDUPID { IDupVarId $$ } -- duplicable implicit parameter ?x
+> ILINID { ILinVarId $$ } -- linear implicit parameter %x
+> CONID { ConId $$ }
+> QCONID { QConId $$ }
+> DVARID { DVarId $$ } -- VARID containing dashes
+> VARSYM { VarSym $$ }
+> CONSYM { ConSym $$ }
+> QVARSYM { QVarSym $$ }
+> QCONSYM { QConSym $$ }
+> INT { IntTok $$ }
+> RATIONAL { FloatTok $$ }
+> CHAR { Character $$ }
+> STRING { StringTok $$ }
+> PRAGMA { Pragma $$ }
+
+Symbols
+
+> '(' { LeftParen }
+> ')' { RightParen }
+> '(#' { LeftHashParen }
+> '#)' { RightHashParen }
+> ';' { SemiColon }
+> '{' { LeftCurly }
+> '}' { RightCurly }
+> vccurly { VRightCurly } -- a virtual close brace
+> '[' { LeftSquare }
+> ']' { RightSquare }
+> ',' { Comma }
+> '_' { Underscore }
+> '`' { BackQuote }
+
+Reserved operators
+
+> '.' { Dot }
+> '..' { DotDot }
+> ':' { Colon }
+> '::' { DoubleColon }
+> '=' { Equals }
+> '\\' { Backslash }
+> '|' { Bar }
+> '<-' { LeftArrow }
+> '->' { RightArrow }
+> '@' { At }
+> '~' { Tilde }
+> '=>' { DoubleArrow }
+> '-' { Minus }
+> '!' { Exclamation }
+> '#' { Hash }
+
+Harp
+
+> '[/' { RPOpen }
+> '/]' { RPClose }
+> '(/' { RPSeqOpen }
+> '/)' { RPSeqClose }
+> '*' { RPStar }
+> '*!' { RPStarG }
+> '+' { RPPlus }
+> '+!' { RPPlusG }
+> '?' { RPOpt }
+> '?!' { RPOptG }
+> 'rp|' { RPEither } -- '|' already taken
+> '@:' { RPCAt }
+
+Template Haskell
+
+> IDSPLICE { THIdEscape $$ }
+> '$(' { THParenEscape }
+> '[|' { THExpQuote }
+> '[p|' { THPatQuote }
+> '[t|' { THTypQuote }
+> '[d|' { THDecQuote }
+> '|]' { THCloseQuote }
+> 'reifyDecl' { THReifyDecl }
+> 'reifyType' { THReifyType }
+> 'reifyFixity' { THReifyFixity }
+
+Hsx
+
+> PCDATA { XPcdata $$ }
+> '<' { XStdTagOpen }
+> '</' { XCloseTagOpen }
+> '<%' { XCodeTagOpen }
+> '>' { XStdTagClose }
+> '/>' { XEmptyTagClose }
+> '%>' { XCodeTagClose }
+
+FFI
+
+> 'foreign' { KW_Foreign }
+> 'export' { KW_Export }
+> 'safe' { KW_Safe }
+> 'unsafe' { KW_Unsafe }
+> 'threadsafe' { KW_Threadsafe }
+> 'stdcall' { KW_StdCall }
+> 'ccall' { KW_CCall }
+
+Reserved Ids
+
+> 'as' { KW_As }
+> 'case' { KW_Case }
+> 'class' { KW_Class }
+> 'data' { KW_Data }
+> 'default' { KW_Default }
+> 'deriving' { KW_Deriving }
+> 'dlet' { KW_DLet } -- implicit parameter binding clause
+> 'do' { KW_Do }
+> 'else' { KW_Else }
+> 'forall' { KW_Forall } -- universal/existential qualification
+> 'hiding' { KW_Hiding }
+> 'if' { KW_If }
+> 'import' { KW_Import }
+> 'in' { KW_In }
+> 'infix' { KW_Infix }
+> 'infixl' { KW_InfixL }
+> 'infixr' { KW_InfixR }
+> 'instance' { KW_Instance }
+> 'let' { KW_Let }
+> 'mdo' { KW_MDo }
+> 'module' { KW_Module }
+> 'newtype' { KW_NewType }
+> 'of' { KW_Of }
+> 'then' { KW_Then }
+> 'type' { KW_Type }
+> 'where' { KW_Where }
+> 'with' { KW_With } -- implicit parameter binding clause
+> 'qualified' { KW_Qualified }
+
+> %monad { P }
+> %lexer { lexer } { EOF }
+> %name parse
+> %tokentype { Token }
+> %%
+
+-----------------------------------------------------------------------------
+HSP Pages
+
+> page :: { HsModule }
+> : topxml {% mkPageModule $1 }
+> | '<%' module '%>' srcloc topxml {% mkPage $2 $4 $5 }
+> | module { $1 }
+
+> topxml :: { HsExp }
+> : srcloc '<' name attrs mattr '>' children '</' name '>' {% do { n <- checkEqNames $3 $9;
+> let { cn = reverse $7;
+> as = reverse $4; };
+> return $ HsXTag $1 n as $5 cn } }
+> | srcloc '<' name attrs mattr '/>' { HsXETag $1 $3 (reverse $4) $5 }
+
+
+-----------------------------------------------------------------------------
+Module Header
+
+> module :: { HsModule }
+> : srcloc pragmas 'module' modid maybeexports 'where' body
+> { HsModule $1 $2 $4 $5 (fst $7) (snd $7) }
+> | srcloc pragmas body
+> { HsModule $1 $2 main_mod (Just [HsEVar (UnQual main_name)])
+> (fst $3) (snd $3) }
+
+> pragmas :: { [HsPragma] }
+> : PRAGMA pragmas { HsPragma $1 : $2 }
+> | {- empty -} { [] }
+
+> body :: { ([HsImportDecl],[HsDecl]) }
+> : '{' bodyaux '}' { $2 }
+> | open bodyaux close { $2 }
+
+> bodyaux :: { ([HsImportDecl],[HsDecl]) }
+> : optsemis impdecls semis topdecls { (reverse $2, $4) }
+> | optsemis topdecls { ([], $2) }
+> | optsemis impdecls optsemis { (reverse $2, []) }
+> | optsemis { ([], []) }
+
+> semis :: { () }
+> : optsemis ';' { () }
+
+> optsemis :: { () }
+> : semis { () }
+> | {- empty -} { () }
+
+-----------------------------------------------------------------------------
+The Export List
+
+> maybeexports :: { Maybe [HsExportSpec] }
+> : exports { Just $1 }
+> | {- empty -} { Nothing }
+
+> exports :: { [HsExportSpec] }
+> : '(' exportlist optcomma ')' { reverse $2 }
+> | '(' optcomma ')' { [] }
+
+> optcomma :: { () }
+> : ',' { () }
+> | {- empty -} { () }
+
+> exportlist :: { [HsExportSpec] }
+> : exportlist ',' export { $3 : $1 }
+> | export { [$1] }
+
+> export :: { HsExportSpec }
+> : qvar { HsEVar $1 }
+> | qtyconorcls { HsEAbs $1 }
+> | qtyconorcls '(' '..' ')' { HsEThingAll $1 }
+> | qtyconorcls '(' ')' { HsEThingWith $1 [] }
+> | qtyconorcls '(' cnames ')' { HsEThingWith $1 (reverse $3) }
+> | 'module' modid { HsEModuleContents $2 }
+
+-----------------------------------------------------------------------------
+Import Declarations
+
+> impdecls :: { [HsImportDecl] }
+> : impdecls semis impdecl { $3 : $1 }
+> | impdecl { [$1] }
+
+> impdecl :: { HsImportDecl }
+> : srcloc 'import' optqualified modid maybeas maybeimpspec
+> { HsImportDecl $1 $4 $3 $5 $6 }
+
+> optqualified :: { Bool }
+> : 'qualified' { True }
+> | {- empty -} { False }
+
+> maybeas :: { Maybe Module }
+> : 'as' modid { Just $2 }
+> | {- empty -} { Nothing }
+
+
+> maybeimpspec :: { Maybe (Bool, [HsImportSpec]) }
+> : impspec { Just $1 }
+> | {- empty -} { Nothing }
+
+> impspec :: { (Bool, [HsImportSpec]) }
+> : opthiding '(' importlist optcomma ')' { ($1, reverse $3) }
+> | opthiding '(' optcomma ')' { ($1, []) }
+
+> opthiding :: { Bool }
+> : 'hiding' { True }
+> | {- empty -} { False }
+
+> importlist :: { [HsImportSpec] }
+> : importlist ',' importspec { $3 : $1 }
+> | importspec { [$1] }
+
+> importspec :: { HsImportSpec }
+> : var { HsIVar $1 }
+> | tyconorcls { HsIAbs $1 }
+> | tyconorcls '(' '..' ')' { HsIThingAll $1 }
+> | tyconorcls '(' ')' { HsIThingWith $1 [] }
+> | tyconorcls '(' cnames ')' { HsIThingWith $1 (reverse $3) }
+
+> cnames :: { [HsCName] }
+> : cnames ',' cname { $3 : $1 }
+> | cname { [$1] }
+
+> cname :: { HsCName }
+> : var { HsVarName $1 }
+> | con { HsConName $1 }
+
+-----------------------------------------------------------------------------
+Fixity Declarations
+
+> fixdecl :: { HsDecl }
+> : srcloc infix prec ops { HsInfixDecl $1 $2 $3 (reverse $4) }
+
+> prec :: { Int }
+> : {- empty -} { 9 }
+> | INT {% checkPrec $1 }
+
+> infix :: { HsAssoc }
+> : 'infix' { HsAssocNone }
+> | 'infixl' { HsAssocLeft }
+> | 'infixr' { HsAssocRight }
+
+> ops :: { [HsOp] }
+> : ops ',' op { $3 : $1 }
+> | op { [$1] }
+
+-----------------------------------------------------------------------------
+Top-Level Declarations
+
+Note: The report allows topdecls to be empty. This would result in another
+shift/reduce-conflict, so we don't handle this case here, but in bodyaux.
+
+> topdecls :: { [HsDecl] }
+> : topdecls1 optsemis {% checkRevDecls $1 }
+
+> topdecls1 :: { [HsDecl] }
+> : topdecls1 semis topdecl { $3 : $1 }
+> | topdecl { [$1] }
+
+> topdecl :: { HsDecl }
+> : srcloc 'type' simpletype '=' ctype
+> { HsTypeDecl $1 (fst $3) (snd $3) $5 }
+> | srcloc 'data' ctype constrs0 deriving
+> {% do { (cs,c,t) <- checkDataHeader $3;
+> return (HsDataDecl $1 cs c t (reverse $4) $5) } }
+> | srcloc 'data' ctype 'where' gadtlist
+> {% do { (cs,c,t) <- checkDataHeader $3;
+> return (HsGDataDecl $1 cs c t (reverse $5)) } }
+> | srcloc 'newtype' ctype '=' constr deriving
+> {% do { (cs,c,t) <- checkDataHeader $3;
+> return (HsNewTypeDecl $1 cs c t $5 $6) } }
+
+A class declaration may include functional dependencies.
+> | srcloc 'class' ctype fds optcbody
+> {% do { (cs,c,vs) <- checkClassHeader $3;
+> return (HsClassDecl $1 cs c vs $4 $5) } }
+> | srcloc 'instance' ctype optvaldefs
+> {% do { (cs,c,ts) <- checkInstHeader $3;
+> return (HsInstDecl $1 cs c ts $4) } }
+> | srcloc 'default' '(' typelist ')'
+> { HsDefaultDecl $1 $4 }
+> | srcloc '$(' exp ')'
+> {% do { e <- checkExpr $3;
+> return $ HsSpliceDecl $1 $ HsParenSplice e } }
+>
+> | srcloc 'foreign' 'import' callconv safety fspec
+> { let (s,n,t) = $6 in HsForImp $1 $4 $5 s n t }
+> | srcloc 'foreign' 'export' callconv fspec
+> { let (s,n,t) = $5 in HsForExp $1 $4 s n t }
+> | decl { $1 }
+
+> typelist :: { [HsType] }
+> : types { reverse $1 }
+> | type { [$1] }
+> | {- empty -} { [] }
+
+> decls :: { [HsDecl] }
+> : optsemis decls1 optsemis {% checkRevDecls $2 }
+> | optsemis { [] }
+
+> decls1 :: { [HsDecl] }
+> : decls1 semis decl { $3 : $1 }
+> | decl { [$1] }
+
+> decl :: { HsDecl }
+> : signdecl { $1 }
+> | fixdecl { $1 }
+> | valdef { $1 }
+
+> decllist :: { [HsDecl] }
+> : '{' decls '}' { $2 }
+> | open decls close { $2 }
+
+> signdecl :: { HsDecl }
+> : srcloc vars '::' ctype { HsTypeSig $1 (reverse $2) $4 }
+
+Binding can be either of implicit parameters, or it can be a normal sequence
+of declarations. The two kinds cannot be mixed within the same block of
+binding.
+
+> binds :: { HsBinds }
+> : decllist { HsBDecls $1 }
+> | '{' ipbinds '}' { HsIPBinds $2 }
+> | open ipbinds close { HsIPBinds $2 }
+
+ATTENTION: Dirty Hackery Ahead! If the second alternative of vars is var
+instead of qvar, we get another shift/reduce-conflict. Consider the
+following programs:
+
+ { (+) :: ... } only var
+ { (+) x y = ... } could (incorrectly) be qvar
+
+We re-use expressions for patterns, so a qvar would be allowed in patterns
+instead of a var only (which would be correct). But deciding what the + is,
+would require more lookahead. So let's check for ourselves...
+
+> vars :: { [HsName] }
+> : vars ',' var { $3 : $1 }
+> | qvar {% do { n <- checkUnQual $1;
+> return [n] } }
+
+-----------------------------------------------------------------------------
+FFI
+
+> callconv :: { HsCallConv }
+> : 'stdcall' { StdCall }
+> | 'ccall' { CCall }
+
+> safety :: { HsSafety }
+> : 'safe' { PlaySafe False }
+> | 'unsafe' { PlayRisky }
+> | 'threadsafe' { PlaySafe True }
+> | {- empty -} { PlaySafe False }
+
+> fspec :: { (String, HsName, HsType) }
+> : STRING var_no_safety '::' dtype { ($1, $2, $4) }
+> | var_no_safety '::' dtype { ("", $1, $3) }
+
+-----------------------------------------------------------------------------
+Types
+
+> dtype :: { HsType }
+> : btype { $1 }
+> | btype qtyconop dtype { HsTyInfix $1 $2 $3 }
+> | btype qtyvarop dtype { HsTyInfix $1 $2 $3 }
+> | btype '->' dtype { HsTyFun $1 $3 }
+
+Implicit parameters can occur in normal types, as well as in contexts.
+
+> type :: { HsType }
+> : ivar '::' dtype { HsTyPred $ HsIParam $1 $3 }
+> | dtype { $1 }
+
+> btype :: { HsType }
+> : btype atype { HsTyApp $1 $2 }
+> | atype { $1 }
+
+> atype :: { HsType }
+> : gtycon { HsTyCon $1 }
+> | tyvar { HsTyVar $1 }
+> | '(' types ')' { HsTyTuple Boxed (reverse $2) }
+> | '(#' types1 '#)' { HsTyTuple Unboxed (reverse $2) }
+> | '[' type ']' { HsTyApp list_tycon $2 }
+> | '(' ctype ')' { $2 }
+
+> gtycon :: { HsQName }
+> : qconid { $1 }
+> | '(' ')' { unit_tycon_name }
+> | '(' '->' ')' { fun_tycon_name }
+> | '[' ']' { list_tycon_name }
+> | '(' commas ')' { tuple_tycon_name $2 }
+
+These are for infix types
+
+> qtyconop :: { HsQName }
+> : qconop { $1 }
+
+
+
+
+
+(Slightly edited) Comment from GHC's hsparser.y:
+"context => type" vs "type" is a problem, because you can't distinguish between
+
+ foo :: (Baz a, Baz a)
+ bar :: (Baz a, Baz a) => [a] -> [a] -> [a]
+
+with one token of lookahead. The HACK is to parse the context as a btype
+(more specifically as a tuple type), then check that it has the right form
+C a, or (C1 a, C2 b, ... Cn z) and convert it into a context. Blaach!
+
+> ctype :: { HsType }
+> : 'forall' tyvars '.' ctype { mkHsTyForall (Just $2) [] $4 }
+> | context '=>' type { mkHsTyForall Nothing $1 $3 }
+> | type { $1 }
+
+> context :: { HsContext }
+> : btype {% checkContext $1 }
+
+> types :: { [HsType] }
+> : types1 ',' type { $3 : $1 }
+
+> types1 :: { [HsType] }
+> : type { [$1] }
+> | types1 ',' type { $3 : $1 }
+
+> simpletype :: { (HsName, [HsName]) }
+> : tycon tyvars { ($1,reverse $2) }
+
+> tyvars :: { [HsName] }
+> : tyvars tyvar { $2 : $1 }
+> | {- empty -} { [] }
+
+-----------------------------------------------------------------------------
+Functional Dependencies
+
+> fds :: { [HsFunDep] }
+> : {- empty -} { [] }
+> | '|' fds1 { reverse $2 }
+
+> fds1 :: { [HsFunDep] }
+> : fds1 ',' fd { $3 : $1 }
+> | fd { [$1] }
+
+> fd :: { HsFunDep }
+> : tyvars '->' tyvars { HsFunDep (reverse $1) (reverse $3) }
+
+-----------------------------------------------------------------------------
+Datatype declarations
+
+GADTs
+
+> gadtlist :: { [HsGadtDecl] }
+> : '{' gadtconstrs1 '}' { $2 }
+> | open gadtconstrs1 close { $2 }
+
+> gadtconstrs1 :: { [HsGadtDecl] }
+> : optsemis gadtconstrs optsemis { $2 }
+
+> gadtconstrs :: { [HsGadtDecl] }
+> : gadtconstrs semis gadtconstr { $3 : $1 }
+> | gadtconstr { [$1] }
+
+> gadtconstr :: { HsGadtDecl }
+> : srcloc qcon '::' ctype {% do { c <- checkUnQual $2;
+> return $ HsGadtDecl $1 c $4 } }
+
+> constrs0 :: { [HsQualConDecl] }
+> : {- empty -} { [] }
+> | '=' constrs { $2 }
+
+> constrs :: { [HsQualConDecl] }
+> : constrs '|' constr { $3 : $1 }
+> | constr { [$1] }
+
+> constr :: { HsQualConDecl }
+> : srcloc forall context '=>' constr1 { HsQualConDecl $1 $2 $3 $5 }
+> | srcloc forall constr1 { HsQualConDecl $1 $2 [] $3 }
+
+> forall :: { [HsName] }
+> : 'forall' tyvars '.' { $2 }
+> | {- empty -} { [] }
+
+> constr1 :: { HsConDecl }
+> : scontype { HsConDecl (fst $1) (snd $1) }
+> | sbtype conop sbtype { HsConDecl $2 [$1,$3] }
+> | con '{' '}' { HsRecDecl $1 [] }
+> | con '{' fielddecls '}' { HsRecDecl $1 (reverse $3) }
+
+> scontype :: { (HsName, [HsBangType]) }
+> : btype {% do { (c,ts) <- splitTyConApp $1;
+> return (c,map HsUnBangedTy ts) } }
+> | scontype1 { $1 }
+
+> scontype1 :: { (HsName, [HsBangType]) }
+> : btype '!' atype {% do { (c,ts) <- splitTyConApp $1;
+> return (c,map HsUnBangedTy ts++
+> [HsBangedTy $3]) } }
+> | scontype1 satype { (fst $1, snd $1 ++ [$2] ) }
+
+> satype :: { HsBangType }
+> : atype { HsUnBangedTy $1 }
+> | '!' atype { HsBangedTy $2 }
+
+> sbtype :: { HsBangType }
+> : btype { HsUnBangedTy $1 }
+> | '!' atype { HsBangedTy $2 }
+
+> fielddecls :: { [([HsName],HsBangType)] }
+> : fielddecls ',' fielddecl { $3 : $1 }
+> | fielddecl { [$1] }
+
+> fielddecl :: { ([HsName],HsBangType) }
+> : vars '::' stype { (reverse $1, $3) }
+
+> stype :: { HsBangType }
+> : ctype { HsUnBangedTy $1 }
+> | '!' atype { HsBangedTy $2 }
+
+> deriving :: { [HsQName] }
+> : {- empty -} { [] }
+> | 'deriving' qtycls { [$2] }
+> | 'deriving' '(' ')' { [] }
+> | 'deriving' '(' dclasses ')' { reverse $3 }
+
+> dclasses :: { [HsQName] }
+> : dclasses ',' qtycls { $3 : $1 }
+> | qtycls { [$1] }
+
+-----------------------------------------------------------------------------
+Class declarations
+
+No implicit parameters in the where clause of a class declaration.
+> optcbody :: { [HsDecl] }
+> : 'where' decllist {% checkClassBody $2 }
+> | {- empty -} { [] }
+
+-----------------------------------------------------------------------------
+Instance declarations
+
+> optvaldefs :: { [HsDecl] }
+> : 'where' '{' valdefs '}' {% checkClassBody $3 }
+> | 'where' open valdefs close {% checkClassBody $3 }
+> | {- empty -} { [] }
+
+> valdefs :: { [HsDecl] }
+> : optsemis valdefs1 optsemis {% checkRevDecls $2 }
+> | optsemis { [] }
+
+> valdefs1 :: { [HsDecl] }
+> : valdefs1 semis valdef { $3 : $1 }
+> | valdef { [$1] }
+
+-----------------------------------------------------------------------------
+Value definitions
+
+> valdef :: { HsDecl }
+> : srcloc exp0b rhs optwhere {% checkValDef $1 $2 $3 $4 }
+
+May bind implicit parameters
+> optwhere :: { HsBinds }
+> : 'where' binds { $2 }
+> | {- empty -} { HsBDecls [] }
+
+> rhs :: { HsRhs }
+> : '=' exp {% do { e <- checkExpr $2;
+> return (HsUnGuardedRhs e) } }
+> | gdrhs { HsGuardedRhss (reverse $1) }
+
+> gdrhs :: { [HsGuardedRhs] }
+> : gdrhs gdrh { $2 : $1 }
+> | gdrh { [$1] }
+
+Guards may contain patterns, hence quals instead of exp.
+> gdrh :: { HsGuardedRhs }
+> : srcloc '|' quals '=' exp {% do { e <- checkExpr $5;
+> return (HsGuardedRhs $1 (reverse $3) e) } }
+
+-----------------------------------------------------------------------------
+Expressions
+
+Note: The Report specifies a meta-rule for lambda, let and if expressions
+(the exp's that end with a subordinate exp): they extend as far to
+the right as possible. That means they cannot be followed by a type
+signature or infix application. To implement this without shift/reduce
+conflicts, we split exp10 into these expressions (exp10a) and the others
+(exp10b). That also means that only an exp0 ending in an exp10b (an exp0b)
+can followed by a type signature or infix application. So we duplicate
+the exp0 productions to distinguish these from the others (exp0a).
+
+> exp :: { HsExp }
+> : exp0b '::' srcloc ctype { HsExpTypeSig $3 $1 $4 }
+> | exp0b 'with' ipbinding { HsWith $1 $3 } -- implicit parameters
+> | exp0 { $1 }
+
+> exp0 :: { HsExp }
+> : exp0a { $1 }
+> | exp0b { $1 }
+
+> exp0a :: { HsExp }
+> : exp0b qop exp10a { HsInfixApp $1 $2 $3 }
+> | exp10a { $1 }
+
+> exp0b :: { HsExp }
+> : exp0b qop exp10b { HsInfixApp $1 $2 $3 }
+> | dvarexp { $1 }
+> | exp10b { $1 }
+
+> exp10a :: { HsExp }
+> : '\\' srcloc apats '->' exp { HsLambda $2 (reverse $3) $5 }
+A let may bind implicit parameters
+> | 'let' binds 'in' exp { HsLet $2 $4 }
+> | 'dlet' ipbinding 'in' exp { HsDLet $2 $4 }
+> | 'if' exp 'then' exp 'else' exp { HsIf $2 $4 $6 }
+
+> exp10b :: { HsExp }
+> : 'case' exp 'of' altslist { HsCase $2 $4 }
+> | '-' fexp { HsNegApp $2 }
+> | 'do' stmtlist { HsDo $2 }
+> | 'mdo' stmtlist { HsMDo $2 }
+> | reifyexp { HsReifyExp $1 }
+> | fexp { $1 }
+
+> fexp :: { HsExp }
+> : fexp aexp { HsApp $1 $2 }
+> | aexp { $1 }
+
+> apats :: { [HsPat] }
+> : apats apat { $2 : $1 }
+> | apat { [$1] }
+
+> apat :: { HsPat }
+> : aexp {% checkPattern $1 }
+
+UGLY: Because patterns and expressions are mixed, aexp has to be split into
+two rules: One right-recursive and one left-recursive. Otherwise we get two
+reduce/reduce-errors (for as-patterns and irrefutable patters).
+
+Even though the variable in an as-pattern cannot be qualified, we use
+qvar here to avoid a shift/reduce conflict, and then check it ourselves
+(as for vars above).
+
+> aexp :: { HsExp }
+> : qvar '@' aexp {% do { n <- checkUnQual $1;
+> return (HsAsPat n $3) } }
+> | qvar '@:' aexp {% do { n <- checkUnQual $1;
+> return (HsCAsRP n $3) } }
+> | '~' aexp { HsIrrPat $2 }
+> | '#' aexp { HsFunctorUnit $2 }
+> | '!' aexp { HsFunctorCall $2 }
+> | aexp1 { $1 }
+
+Note: The first two alternatives of aexp1 are not necessarily record
+updates: they could be labeled constructions.
+
+> aexp1 :: { HsExp }
+> : aexp1 '{' '}' {% mkRecConstrOrUpdate $1 [] }
+> | aexp1 '{' fbinds '}' {% mkRecConstrOrUpdate $1 (reverse $3) }
+> | aexp1 '*' { HsStarRP $1 }
+> | aexp1 '*!' { HsStarGRP $1 }
+> | aexp1 '+' { HsPlusRP $1 }
+> | aexp1 '+!' { HsPlusGRP $1 }
+> | aexp1 '?' { HsOptRP $1 }
+> | aexp1 '?!' { HsOptGRP $1 }
+> | aexp2 { $1 }
+
+According to the Report, the left section (e op) is legal iff (e op x)
+parses equivalently to ((e) op x). Thus e must be an exp0b.
+An implicit parameter can be used as an expression.
+
+> aexp2 :: { HsExp }
+> : ivar { HsIPVar $1 }
+> | qvar { HsVar $1 }
+> | gcon { $1 }
+> | literal { HsLit $1 }
+> | '(' exp ')' { HsParen $2 }
+> | '(' texps ')' { HsTuple (reverse $2) }
+> | '[' list ']' { $2 }
+> | '(' exp0b qop ')' { HsLeftSection $2 $3 }
+> | '(' qopm exp0 ')' { HsRightSection $2 $3 }
+> | '_' { HsWildCard }
+> | '(' erpats ')' { $2 }
+> | '(/' rpats '/)' { HsSeqRP $ reverse $2 }
+> | srcloc '[/' rpats '/]' { HsRPats $1 $ reverse $3 }
+> | xml { $1 }
+
+Template Haskell
+> | IDSPLICE { HsSpliceExp $ HsIdSplice $1 }
+> | '$(' exp ')' {% do { e <- checkExpr $2;
+> return $ HsSpliceExp $ HsParenSplice e } }
+> | '[|' exp '|]' {% do { e <- checkExpr $2;
+> return $ HsBracketExp $ HsExpBracket e } }
+> | '[p|' exp0 '|]' {% do { p <- checkPattern $2;
+> return $ HsBracketExp $ HsPatBracket p } }
+> | '[t|' ctype '|]' { HsBracketExp $ HsTypeBracket $2 }
+> | '[d|' topdecls '|]' { HsBracketExp $ HsDeclBracket $2 }
+
+> reifyexp :: { HsReify }
+> : 'reifyDecl' gtycon { HsReifyDecl $2 }
+> | 'reifyDecl' qvar { HsReifyDecl $2 }
+> | 'reifyType' qcname { HsReifyType $2 }
+> | 'reifyFixity' qcname { HsReifyFixity $2 }
+
+> qcname :: { HsQName }
+> : qvar { $1 }
+> | gcon {% getGConName $1 }
+End Template Haskell
+
+> commas :: { Int }
+> : commas ',' { $1 + 1 }
+> | ',' { 1 }
+
+> texps :: { [HsExp] }
+> : texps ',' exp { $3 : $1 }
+> | exp ',' exp { [$3,$1] }
+
+-----------------------------------------------------------------------------
+Harp Extensions
+
+> rpats :: { [HsExp] }
+> : rpats ',' rpat { $3 : $1 }
+> | rpat { [$1] }
+
+> rpat :: { HsExp }
+> : erpats { $1 }
+> | exp { $1 }
+
+Either patterns are left associative
+> erpats :: { HsExp }
+> : exp 'rp|' erpats { HsEitherRP $1 $3 }
+> | exp 'rp|' exp { HsEitherRP $1 $3 }
+
+-----------------------------------------------------------------------------
+Hsx Extensions
+
+> xml :: { HsExp }
+> : srcloc '<' name attrs mattr '>' children '</' name '>' {% do { n <- checkEqNames $3 $9;
+> let { cn = reverse $7;
+> as = reverse $4; };
+> return $ HsXTag $1 n as $5 cn } }
+> | srcloc '<' name attrs mattr '/>' { HsXETag $1 $3 (reverse $4) $5 }
+> | '<%' exp '%>' { HsXExpTag $2 }
+
+> children :: { [HsExp] }
+> : children child { $2 : $1 }
+> | {- empty -} { [] }
+
+> child :: { HsExp }
+> : PCDATA { HsXPcdata $1 }
+> | srcloc '[/' rpats '/]' { HsRPats $1 $ reverse $3 }
+> | xml { $1 }
+
+> name :: { HsXName }
+> : xmlname ':' xmlname { HsXDomName $1 $3 }
+> | xmlname { HsXName $1 }
+
+> xmlname :: { String }
+> : VARID { $1 }
+> | CONID { $1 }
+> | DVARID { mkDVar $1 }
+> | 'type' { "type" }
+> | 'class' { "class" }
+
+> attrs :: { [HsXAttr] }
+> : attrs attr { $2 : $1 }
+> | {- empty -} { [] }
+
+> attr :: { HsXAttr }
+> : name '=' aexp { HsXAttr $1 $3 }
+
+> mattr :: { Maybe HsExp }
+> : aexp { Just $1 }
+> | {-empty-} { Nothing }
+
+Turning dash variables into infix expressions with '-'
+> dvarexp :: { HsExp }
+> : DVARID { mkDVarExpr $1 }
+
+-----------------------------------------------------------------------------
+List expressions
+
+The rules below are little bit contorted to keep lexps left-recursive while
+avoiding another shift/reduce-conflict.
+
+> list :: { HsExp }
+> : exp { HsList [$1] }
+> | lexps { HsList (reverse $1) }
+> | exp '..' { HsEnumFrom $1 }
+> | exp ',' exp '..' { HsEnumFromThen $1 $3 }
+> | exp '..' exp { HsEnumFromTo $1 $3 }
+> | exp ',' exp '..' exp { HsEnumFromThenTo $1 $3 $5 }
+> | exp '|' quals { HsListComp $1 (reverse $3) }
+
+> lexps :: { [HsExp] }
+> : lexps ',' exp { $3 : $1 }
+> | exp ',' exp { [$3,$1] }
+
+-----------------------------------------------------------------------------
+List comprehensions
+
+> quals :: { [HsStmt] }
+> : quals ',' qual { $3 : $1 }
+> | qual { [$1] }
+
+> qual :: { HsStmt }
+> : pat srcloc '<-' exp { HsGenerator $2 $1 $4 }
+> | exp { HsQualifier $1 }
+> | 'let' binds { HsLetStmt $2 }
+
+-----------------------------------------------------------------------------
+Case alternatives
+
+> altslist :: { [HsAlt] }
+> : '{' alts '}' { $2 }
+> | open alts close { $2 }
+
+> alts :: { [HsAlt] }
+> : optsemis alts1 optsemis { reverse $2 }
+
+> alts1 :: { [HsAlt] }
+> : alts1 semis alt { $3 : $1 }
+> | alt { [$1] }
+
+> alt :: { HsAlt }
+> : srcloc pat ralt optwhere { HsAlt $1 $2 $3 $4 }
+
+> ralt :: { HsGuardedAlts }
+> : '->' exp { HsUnGuardedAlt $2 }
+> | gdpats { HsGuardedAlts (reverse $1) }
+
+> gdpats :: { [HsGuardedAlt] }
+> : gdpats gdpat { $2 : $1 }
+> | gdpat { [$1] }
+
+A guard can be a pattern guard, hence quals instead of exp0.
+> gdpat :: { HsGuardedAlt }
+> : srcloc '|' quals '->' exp { HsGuardedAlt $1 (reverse $3) $5 }
+
+> pat :: { HsPat }
+> : exp0b {% checkPattern $1 }
+
+-----------------------------------------------------------------------------
+Statement sequences
+
+As per the Report, but with stmt expanded to simplify building the list
+without introducing conflicts. This also ensures that the last stmt is
+an expression.
+
+> stmtlist :: { [HsStmt] }
+> : '{' stmts '}' { $2 }
+> | open stmts close { $2 }
+
+A let statement may bind implicit parameters.
+> stmts :: { [HsStmt] }
+> : 'let' binds ';' stmts { HsLetStmt $2 : $4 }
+> | pat srcloc '<-' exp ';' stmts { HsGenerator $2 $1 $4 : $6 }
+> | exp ';' stmts { HsQualifier $1 : $3 }
+> | ';' stmts { $2 }
+> | exp ';' { [HsQualifier $1] }
+> | exp { [HsQualifier $1] }
+
+-----------------------------------------------------------------------------
+Record Field Update/Construction
+
+> fbinds :: { [HsFieldUpdate] }
+> : fbinds ',' fbind { $3 : $1 }
+> | fbind { [$1] }
+
+> fbind :: { HsFieldUpdate }
+> : qvar '=' exp { HsFieldUpdate $1 $3 }
+
+-----------------------------------------------------------------------------
+Implicit parameter bindings
+
+> ipbinding :: { [HsIPBind] }
+> : '{' ipbinds '}' { $2 }
+> | open ipbinds close { $2 }
+
+> ipbinds :: { [HsIPBind] }
+> : optsemis ipbinds1 optsemis { reverse $2 }
+
+> ipbinds1 :: { [HsIPBind] }
+> : ipbinds1 semis ipbind { $3 : $1 }
+> | ipbind { [$1] }
+
+> ipbind :: { HsIPBind }
+> : srcloc ivar '=' exp { HsIPBind $1 $2 $4 }
+
+-----------------------------------------------------------------------------
+Variables, Constructors and Operators.
+
+> gcon :: { HsExp }
+> : '(' ')' { unit_con }
+> | '[' ']' { HsList [] }
+> | '(' commas ')' { tuple_con $2 }
+> | qcon { HsCon $1 }
+
+> var :: { HsName }
+> : varid { $1 }
+> | '(' varsym ')' { $2 }
+
+> var_no_safety :: { HsName }
+> : varid_no_safety { $1 }
+> | '(' varsym ')' { $2 }
+
+> qvar :: { HsQName }
+> : qvarid { $1 }
+> | '(' qvarsym ')' { $2 }
+
+Implicit parameter
+> ivar :: { HsIPName }
+> : ivarid { $1 }
+
+> con :: { HsName }
+> : conid { $1 }
+> | '(' consym ')' { $2 }
+
+> qcon :: { HsQName }
+> : qconid { $1 }
+> | '(' gconsym ')' { $2 }
+
+> varop :: { HsName }
+> : varsym { $1 }
+> | '`' varid '`' { $2 }
+
+> qvarop :: { HsQName }
+> : qvarsym { $1 }
+> | '`' qvarid '`' { $2 }
+
+> qvaropm :: { HsQName }
+> : qvarsymm { $1 }
+> | '`' qvarid '`' { $2 }
+
+> conop :: { HsName }
+> : consym { $1 }
+> | '`' conid '`' { $2 }
+
+> qconop :: { HsQName }
+> : gconsym { $1 }
+> | '`' qconid '`' { $2 }
+
+> op :: { HsOp }
+> : varop { HsVarOp $1 }
+> | conop { HsConOp $1 }
+
+> qop :: { HsQOp }
+> : qvarop { HsQVarOp $1 }
+> | qconop { HsQConOp $1 }
+
+> qopm :: { HsQOp }
+> : qvaropm { HsQVarOp $1 }
+> | qconop { HsQConOp $1 }
+
+> gconsym :: { HsQName }
+> : ':' { list_cons_name }
+> | qconsym { $1 }
+
+-----------------------------------------------------------------------------
+Identifiers and Symbols
+
+> qvarid :: { HsQName }
+> : varid { UnQual $1 }
+> | QVARID { Qual (Module (fst $1)) (HsIdent (snd $1)) }
+
+> varid_no_safety :: { HsName }
+> : VARID { HsIdent $1 }
+> | 'as' { as_name }
+> | 'qualified' { qualified_name }
+> | 'hiding' { hiding_name }
+> | 'export' { export_name }
+> | 'stdcall' { stdcall_name }
+> | 'ccall' { ccall_name }
+
+> varid :: { HsName }
+> : varid_no_safety { $1 }
+> | 'safe' { safe_name }
+> | 'unsafe' { unsafe_name }
+> | 'threadsafe' { threadsafe_name }
+
+
+Implicit parameter
+> ivarid :: { HsIPName }
+> : IDUPID { HsIPDup $1 }
+> | ILINID { HsIPLin $1 }
+
+> qconid :: { HsQName }
+> : conid { UnQual $1 }
+> | QCONID { Qual (Module (fst $1)) (HsIdent (snd $1)) }
+
+> conid :: { HsName }
+> : CONID { HsIdent $1 }
+
+> qconsym :: { HsQName }
+> : consym { UnQual $1 }
+> | QCONSYM { Qual (Module (fst $1)) (HsSymbol (snd $1)) }
+
+> consym :: { HsName }
+> : CONSYM { HsSymbol $1 }
+
+> qvarsym :: { HsQName }
+> : varsym { UnQual $1 }
+> | qvarsym1 { $1 }
+
+> qvarsymm :: { HsQName }
+> : varsymm { UnQual $1 }
+> | qvarsym1 { $1 }
+
+> varsym :: { HsName }
+> : VARSYM { HsSymbol $1 }
+> | '-' { minus_name }
+> | '!' { pling_name }
+> | '.' { dot_name }
+
+> varsymm :: { HsName } -- varsym not including '-'
+> : VARSYM { HsSymbol $1 }
+> | '!' { pling_name }
+> | '.' { dot_name }
+
+> qvarsym1 :: { HsQName }
+> : QVARSYM { Qual (Module (fst $1)) (HsSymbol (snd $1)) }
+
+> literal :: { HsLiteral }
+> : INT { HsInt $1 }
+> | CHAR { HsChar $1 }
+> | RATIONAL { HsFrac $1 }
+> | STRING { HsString $1 }
+
+> srcloc :: { SrcLoc } : {% getSrcLoc }
+
+-----------------------------------------------------------------------------
+Layout
+
+> open :: { () } : {% pushCurrentContext }
+
+> close :: { () }
+> : vccurly { () } -- context popped in lexer.
+> | error {% popContext }
+
+-----------------------------------------------------------------------------
+Miscellaneous (mostly renamings)
+
+> modid :: { Module }
+> : CONID { Module $1 }
+> | QCONID { Module (fst $1 ++ '.':snd $1) }
+
+> tyconorcls :: { HsName }
+> : conid { $1 }
+
+> tycon :: { HsName }
+> : conid { $1 }
+
+> qtyconorcls :: { HsQName }
+> : qconid { $1 }
+
+> qtycls :: { HsQName }
+> : qconid { $1 }
+
+> tyvar :: { HsName }
+> : varid { $1 }
+
+> qtyvarop :: { HsQName }
+> qtyvarop : '`' tyvar '`' { UnQual $2 }
+> | tyvarsym { UnQual $1 }
+
+> tyvarsym :: { HsName }
+> tyvarsym : VARSYM { HsSymbol $1 }
+
+-----------------------------------------------------------------------------
+
+> {
+> happyError :: P a
+> happyError = fail "Parse error"
+
+> -- | Parse of a string, which should contain a complete Haskell 98 module.
+> parseModule :: String -> ParseResult HsModule
+> parseModule = runParser parse
+
+> -- | Parse of a string, which should contain a complete Haskell 98 module.
+> parseModuleWithMode :: ParseMode -> String -> ParseResult HsModule
+> parseModuleWithMode mode = runParserWithMode mode parse
+> }
diff -rN -u old-fenfire-hs/Preprocessor/Hsx/ParseUtils.hs new-fenfire-hs/Preprocessor/Hsx/ParseUtils.hs
--- old-fenfire-hs/Preprocessor/Hsx/ParseUtils.hs 1970-01-01 02:00:00.000000000 +0200
+++ new-fenfire-hs/Preprocessor/Hsx/ParseUtils.hs 2007-02-12 19:32:17.000000000 +0200
@@ -0,0 +1,548 @@
+-- #hide
+-----------------------------------------------------------------------------
+-- |
+-- Module : Preprocessor.Hsx.ParseUtils
+-- Original : Language.Haskell.ParseUtils
+-- Copyright : (c) Niklas Broberg 2004,
+-- (c) The GHC Team, 1997-2000
+-- License : BSD-style (see the file LICENSE.txt)
+--
+-- Maintainer : Niklas Broberg, d00nibro at dtek.chalmers.se
+-- Stability : experimental
+-- Portability : portable
+--
+-- Utilities for the Haskell-exts parser.
+--
+-----------------------------------------------------------------------------
+
+module Preprocessor.Hsx.ParseUtils (
+ splitTyConApp -- HsType -> P (HsName,[HsType])
+ , mkRecConstrOrUpdate -- HsExp -> [HsFieldUpdate] -> P HsExp
+ , checkPrec -- Integer -> P Int
+ , checkContext -- HsType -> P HsContext
+ , checkAssertion -- HsType -> P HsAsst
+ , checkDataHeader -- HsType -> P (HsContext,HsName,[HsName])
+ , checkClassHeader -- HsType -> P (HsContext,HsName,[HsName])
+ , checkInstHeader -- HsType -> P (HsContext,HsQName,[HsType])
+ , checkPattern -- HsExp -> P HsPat
+ , checkExpr -- HsExp -> P HsExp
+ , checkValDef -- SrcLoc -> HsExp -> HsRhs -> [HsDecl] -> P HsDecl
+ , checkClassBody -- [HsDecl] -> P [HsDecl]
+ , checkUnQual -- HsQName -> P HsName
+ , checkRevDecls -- [HsDecl] -> P [HsDecl]
+ , getGConName -- HsExp -> P HsQName
+ , mkHsTyForall -- Maybe [HsName] -> HsContext -> HsType -> HsType
+ -- HaRP
+ , checkRPattern -- HsExp -> P HsRPat
+ -- Hsx
+ , checkEqNames -- HsXName -> HsXName -> P HsXName
+ , mkPageModule -- HsExp -> P HsModule
+ , mkPage -- HsModule -> SrcLoc -> HsExp -> P HsModule
+ , mkDVar -- [String] -> String
+ , mkDVarExpr -- [String] -> HsExp
+ ) where
+
+import Preprocessor.Hsx.Syntax
+import Preprocessor.Hsx.ParseMonad
+import Preprocessor.Hsx.Pretty
+import Preprocessor.Hsx.Build
+
+import Data.List (intersperse)
+
+splitTyConApp :: HsType -> P (HsName,[HsType])
+splitTyConApp t0 = split t0 []
+ where
+ split :: HsType -> [HsType] -> P (HsName,[HsType])
+ split (HsTyApp t u) ts = split t (u:ts)
+ split (HsTyCon (UnQual t)) ts = return (t,ts)
+ split (HsTyInfix a op b) ts = split (HsTyCon op) (a:b:ts)
+ split _ _ = fail "Illegal data/newtype declaration"
+
+-----------------------------------------------------------------------------
+-- Various Syntactic Checks
+
+checkContext :: HsType -> P HsContext
+checkContext (HsTyTuple Boxed ts) =
+ mapM checkAssertion ts
+checkContext t = do
+ c <- checkAssertion t
+ return [c]
+
+-- Changed for multi-parameter type classes.
+-- Further changed for implicit parameters.
+
+checkAssertion :: HsType -> P HsAsst
+checkAssertion (HsTyPred p@(HsIParam n t)) = return p
+checkAssertion t = checkAssertion' [] t
+ where checkAssertion' ts (HsTyCon c) = return $ HsClassA c ts
+ checkAssertion' ts (HsTyApp a t) = checkAssertion' (t:ts) a
+ checkAssertion' ts (HsTyInfix a op b) = checkAssertion' (a:b:ts) (HsTyCon op)
+ checkAssertion' _ _ = fail "Illegal class assertion"
+
+
+checkDataHeader :: HsType -> P (HsContext,HsName,[HsName])
+checkDataHeader (HsTyForall Nothing cs t) = do
+ (c,ts) <- checkSimple "data/newtype" t []
+ return (cs,c,ts)
+checkDataHeader t = do
+ (c,ts) <- checkSimple "data/newtype" t []
+ return ([],c,ts)
+
+checkClassHeader :: HsType -> P (HsContext,HsName,[HsName])
+checkClassHeader (HsTyForall Nothing cs t) = do
+ (c,ts) <- checkSimple "class" t []
+ return (cs,c,ts)
+checkClassHeader t = do
+ (c,ts) <- checkSimple "class" t []
+ return ([],c,ts)
+
+checkSimple :: String -> HsType -> [HsName] -> P (HsName,[HsName])
+checkSimple kw (HsTyApp l (HsTyVar a)) xs = checkSimple kw l (a:xs)
+checkSimple _ (HsTyInfix (HsTyVar a) (UnQual t) (HsTyVar b)) xs = return (t,a:b:xs)
+checkSimple _kw (HsTyCon (UnQual t)) xs = return (t,xs)
+checkSimple kw _ _ = fail ("Illegal " ++ kw ++ " declaration")
+
+checkInstHeader :: HsType -> P (HsContext,HsQName,[HsType])
+checkInstHeader (HsTyForall Nothing cs t) = do
+ (c,ts) <- checkInsts t []
+ return (cs,c,ts)
+checkInstHeader t = do
+ (c,ts) <- checkInsts t []
+ return ([],c,ts)
+
+
+checkInsts :: HsType -> [HsType] -> P ((HsQName,[HsType]))
+checkInsts (HsTyApp l t) ts = checkInsts l (t:ts)
+checkInsts (HsTyCon c) ts = return (c,ts)
+checkInsts _ _ = fail "Illegal instance declaration"
+
+{-
+checkInst :: HsType -> P ()
+checkInst (HsTyApp l _) = checkInst l
+checkInst (HsTyVar _) = fail "Illegal instance declaration"
+checkInst _ = return ()
+-}
+
+-----------------------------------------------------------------------------
+-- Checking Patterns.
+
+-- We parse patterns as expressions and check for valid patterns below,
+-- converting the expression into a pattern at the same time.
+
+checkPattern :: HsExp -> P HsPat
+checkPattern e = checkPat e []
+
+checkPat :: HsExp -> [HsPat] -> P HsPat
+checkPat (HsCon c) args = return (HsPApp c args)
+checkPat (HsApp f x) args = do
+ x <- checkPat x []
+ checkPat f (x:args)
+checkPat e [] = case e of
+ HsVar (UnQual x) -> return (HsPVar x)
+ HsLit l -> return (HsPLit l)
+ HsInfixApp l op r -> do
+ l <- checkPat l []
+ r <- checkPat r []
+ case op of
+ HsQConOp c -> return (HsPInfixApp l c r)
+ _ -> patFail ""
+ HsTuple es -> do
+ ps <- mapM (\e -> checkPat e []) es
+ return (HsPTuple ps)
+ HsList es -> do
+ ps <- mapM (\e -> checkPat e []) es
+ return (HsPList ps)
+ HsParen e -> do
+ p <- checkPat e []
+ return (HsPParen p)
+ HsAsPat n e -> do
+ p <- checkPat e []
+ return (HsPAsPat n p)
+ HsWildCard -> return HsPWildCard
+ HsIrrPat e -> do
+ p <- checkPat e []
+ return (HsPIrrPat p)
+ HsRecConstr c fs -> do
+ fs <- mapM checkPatField fs
+ return (HsPRec c fs)
+ HsNegApp (HsLit l) -> return (HsPNeg (HsPLit l))
+ HsRPats s es -> do
+ rps <- mapM checkRPattern es
+ return (HsPRPat s rps)
+ HsExpTypeSig s e t -> do
+ p <- checkPat e []
+ return (HsPatTypeSig s p t)
+
+ -- Hsx
+ HsXTag s n attrs mattr cs -> do
+ pattrs <- mapM checkPAttr attrs
+ pcs <- mapM (\c -> checkPat c []) cs
+ mpattr <- maybe (return Nothing)
+ (\e -> do p <- checkPat e []
+ return $ Just p)
+ mattr
+ let cp = mkChildrenPat pcs
+ return $ HsPXTag s n pattrs mpattr cp
+ HsXETag s n attrs mattr -> do
+ pattrs <- mapM checkPAttr attrs
+ mpattr <- maybe (return Nothing)
+ (\e -> do p <- checkPat e []
+ return $ Just p)
+ mattr
+ return $ HsPXETag s n pattrs mpattr
+ HsXPcdata pcdata -> return $ HsPXPcdata pcdata
+ HsXExpTag e -> do
+ p <- checkPat e []
+ return $ HsPXPatTag p
+ e -> patFail $ show e
+
+checkPat e _ = patFail $ show e
+
+checkPatField :: HsFieldUpdate -> P HsPatField
+checkPatField (HsFieldUpdate n e) = do
+ p <- checkPat e []
+ return (HsPFieldPat n p)
+
+checkPAttr :: HsXAttr -> P HsPXAttr
+checkPAttr (HsXAttr n v) = do p <- checkPat v []
+ return $ HsPXAttr n p
+
+patFail :: String -> P a
+patFail s = fail $ "Parse error in pattern: " ++ s
+
+checkRPattern :: HsExp -> P HsRPat
+checkRPattern e = case e of
+ HsSeqRP es -> do
+ rps <- mapM checkRPattern es
+ return $ HsRPSeq rps
+ HsStarRP e -> do
+ rp <- checkRPattern e
+ return $ HsRPStar rp
+ HsPlusRP e -> do
+ rp <- checkRPattern e
+ return $ HsRPPlus rp
+ HsOptRP e -> do
+ rp <- checkRPattern e
+ return $ HsRPOpt rp
+ HsStarGRP e -> do
+ rp <- checkRPattern e
+ return $ HsRPStarG rp
+ HsPlusGRP e -> do
+ rp <- checkRPattern e
+ return $ HsRPPlusG rp
+ HsOptGRP e -> do
+ rp <- checkRPattern e
+ return $ HsRPOptG rp
+ HsEitherRP e1 e2 -> do
+ rp1 <- checkRPattern e1
+ rp2 <- checkRPattern e2
+ return $ HsRPEither rp1 rp2
+ HsCAsRP n e -> do
+ rp <- checkRPattern e
+ return $ HsRPCAs n rp
+ HsAsPat n e -> do
+ rp <- checkRPattern e
+ return $ HsRPAs n rp
+ HsParen e -> do
+ rp <- checkRPattern e
+ return $ HsRPParen rp
+ _ -> do
+ p <- checkPattern e
+ return $ HsRPPat p
+
+
+mkChildrenPat :: [HsPat] -> HsPat
+mkChildrenPat ps = mkCPAux ps []
+ where mkCPAux :: [HsPat] -> [HsPat] -> HsPat
+ mkCPAux [] qs = HsPList $ reverse qs
+ mkCPAux (p:ps) qs = case p of
+ (HsPRPat s rps) -> mkCRP s ps (reverse rps ++ map HsRPPat qs)
+ _ -> mkCPAux ps (p:qs)
+
+ mkCRP :: SrcLoc -> [HsPat] -> [HsRPat] -> HsPat
+ mkCRP s [] rps = HsPRPat s $ reverse rps
+ mkCRP s (p:ps) rps = case p of
+ (HsPRPat _ rqs) -> mkCRP s ps (reverse rqs ++ rps)
+ _ -> mkCRP s ps (HsRPPat p : rps)
+
+-----------------------------------------------------------------------------
+-- Check Expression Syntax
+
+checkExpr :: HsExp -> P HsExp
+checkExpr e = case e of
+ HsVar _ -> return e
+ HsIPVar _ -> return e
+ HsCon _ -> return e
+ HsLit _ -> return e
+ HsInfixApp e1 op e2 -> check2Exprs e1 e2 (flip HsInfixApp op)
+ HsApp e1 e2 -> check2Exprs e1 e2 HsApp
+ HsNegApp e -> check1Expr e HsNegApp
+ HsLambda loc ps e -> check1Expr e (HsLambda loc ps)
+ HsLet bs e -> check1Expr e (HsLet bs)
+ HsDLet bs e -> check1Expr e (HsDLet bs)
+ HsWith e bs -> check1Expr e (flip HsWith bs)
+ HsIf e1 e2 e3 -> check3Exprs e1 e2 e3 HsIf
+ HsCase e alts -> do
+ alts <- mapM checkAlt alts
+ e <- checkExpr e
+ return (HsCase e alts)
+ HsDo stmts -> do
+ stmts <- mapM checkStmt stmts
+ return (HsDo stmts)
+ HsMDo stmts -> do
+ stmts <- mapM checkStmt stmts
+ return (HsMDo stmts)
+ HsTuple es -> checkManyExprs es HsTuple
+ HsList es -> checkManyExprs es HsList
+ HsParen e -> check1Expr e HsParen
+ HsLeftSection e op -> check1Expr e (flip HsLeftSection op)
+ HsRightSection op e -> check1Expr e (HsRightSection op)
+ HsRecConstr c fields -> do
+ fields <- mapM checkField fields
+ return (HsRecConstr c fields)
+ HsRecUpdate e fields -> do
+ fields <- mapM checkField fields
+ e <- checkExpr e
+ return (HsRecUpdate e fields)
+ HsEnumFrom e -> check1Expr e HsEnumFrom
+ HsEnumFromTo e1 e2 -> check2Exprs e1 e2 HsEnumFromTo
+ HsEnumFromThen e1 e2 -> check2Exprs e1 e2 HsEnumFromThen
+ HsEnumFromThenTo e1 e2 e3 -> check3Exprs e1 e2 e3 HsEnumFromThenTo
+ HsListComp e stmts -> do
+ stmts <- mapM checkStmt stmts
+ e <- checkExpr e
+ return (HsListComp e stmts)
+ HsExpTypeSig loc e ty -> do
+ e <- checkExpr e
+ return (HsExpTypeSig loc e ty)
+
+ --Template Haskell
+ HsReifyExp _ -> return e
+ HsBracketExp _ -> return e
+ HsSpliceExp _ -> return e
+
+ -- Hsx
+ HsXTag s n attrs mattr cs -> do attrs <- mapM checkAttr attrs
+ cs <- mapM checkExpr cs
+ mattr <- maybe (return Nothing)
+ (\e -> checkExpr e >>= return . Just)
+ mattr
+ return $ HsXTag s n attrs mattr cs
+ HsXETag s n attrs mattr -> do attrs <- mapM checkAttr attrs
+ mattr <- maybe (return Nothing)
+ (\e -> checkExpr e >>= return . Just)
+ mattr
+ return $ HsXETag s n attrs mattr
+ HsXPcdata _ -> return e
+ HsXExpTag e -> do e <- checkExpr e
+ return $ HsXExpTag e
+ -- Functor sugar
+ HsFunctorUnit e -> do e <- checkExpr e
+ return $ HsFunctorUnit e
+ HsFunctorCall e -> do e <- checkExpr e
+ return $ HsFunctorCall e
+ _ -> fail $ "Parse error in expression: " ++ show e
+
+checkAttr :: HsXAttr -> P HsXAttr
+checkAttr (HsXAttr n v) = do v <- checkExpr v
+ return $ HsXAttr n v
+
+-- type signature for polymorphic recursion!!
+check1Expr :: HsExp -> (HsExp -> a) -> P a
+check1Expr e1 f = do
+ e1 <- checkExpr e1
+ return (f e1)
+
+check2Exprs :: HsExp -> HsExp -> (HsExp -> HsExp -> a) -> P a
+check2Exprs e1 e2 f = do
+ e1 <- checkExpr e1
+ e2 <- checkExpr e2
+ return (f e1 e2)
+
+check3Exprs :: HsExp -> HsExp -> HsExp -> (HsExp -> HsExp -> HsExp -> a) -> P a
+check3Exprs e1 e2 e3 f = do
+ e1 <- checkExpr e1
+ e2 <- checkExpr e2
+ e3 <- checkExpr e3
+ return (f e1 e2 e3)
+
+checkManyExprs :: [HsExp] -> ([HsExp] -> a) -> P a
+checkManyExprs es f = do
+ es <- mapM checkExpr es
+ return (f es)
+
+checkAlt :: HsAlt -> P HsAlt
+checkAlt (HsAlt loc p galts bs) = do
+ galts <- checkGAlts galts
+ return (HsAlt loc p galts bs)
+
+checkGAlts :: HsGuardedAlts -> P HsGuardedAlts
+checkGAlts (HsUnGuardedAlt e) = check1Expr e HsUnGuardedAlt
+checkGAlts (HsGuardedAlts galts) = do
+ galts <- mapM checkGAlt galts
+ return (HsGuardedAlts galts)
+
+checkGAlt :: HsGuardedAlt -> P HsGuardedAlt
+checkGAlt (HsGuardedAlt loc g e) = check1Expr e (HsGuardedAlt loc g)
+
+checkStmt :: HsStmt -> P HsStmt
+checkStmt (HsGenerator loc p e) = check1Expr e (HsGenerator loc p)
+checkStmt (HsQualifier e) = check1Expr e HsQualifier
+checkStmt s@(HsLetStmt _) = return s
+
+checkField :: HsFieldUpdate -> P HsFieldUpdate
+checkField (HsFieldUpdate n e) = check1Expr e (HsFieldUpdate n)
+
+getGConName :: HsExp -> P HsQName
+getGConName (HsCon n) = return n
+getGConName (HsList []) = return list_cons_name
+getGConName _ = fail "Expression in reification is not a name"
+
+-----------------------------------------------------------------------------
+-- Check Equation Syntax
+
+checkValDef :: SrcLoc -> HsExp -> HsRhs -> HsBinds -> P HsDecl
+checkValDef srcloc lhs rhs whereBinds =
+ case isFunLhs lhs [] of
+ Just (f,es) -> do
+ ps <- mapM checkPattern es
+ return (HsFunBind [HsMatch srcloc f ps rhs whereBinds])
+ Nothing -> do
+ lhs <- checkPattern lhs
+ return (HsPatBind srcloc lhs rhs whereBinds)
+
+-- A variable binding is parsed as an HsPatBind.
+
+isFunLhs :: HsExp -> [HsExp] -> Maybe (HsName, [HsExp])
+isFunLhs (HsInfixApp l (HsQVarOp (UnQual op)) r) es = Just (op, l:r:es)
+isFunLhs (HsApp (HsVar (UnQual f)) e) es = Just (f, e:es)
+isFunLhs (HsApp (HsParen f) e) es = isFunLhs f (e:es)
+isFunLhs (HsApp f e) es = isFunLhs f (e:es)
+isFunLhs _ _ = Nothing
+
+-----------------------------------------------------------------------------
+-- In a class or instance body, a pattern binding must be of a variable.
+
+checkClassBody :: [HsDecl] -> P [HsDecl]
+checkClassBody decls = do
+ mapM_ checkMethodDef decls
+ return decls
+
+checkMethodDef :: HsDecl -> P ()
+checkMethodDef (HsPatBind _ (HsPVar _) _ _) = return ()
+checkMethodDef (HsPatBind loc _ _ _) =
+ fail "illegal method definition" `atSrcLoc` loc
+checkMethodDef _ = return ()
+
+-----------------------------------------------------------------------------
+-- Check that an identifier or symbol is unqualified.
+-- For occasions when doing this in the grammar would cause conflicts.
+
+checkUnQual :: HsQName -> P HsName
+checkUnQual (Qual _ _) = fail "Illegal qualified name"
+checkUnQual (UnQual n) = return n
+checkUnQual (Special _) = fail "Illegal special name"
+
+-----------------------------------------------------------------------------
+-- Check that two xml tag names are equal
+-- Could use Eq directly, but I am not sure whether <dom:name>...</name>
+-- would be valid, in that case Eq won't work. TODO
+
+checkEqNames :: HsXName -> HsXName -> P HsXName
+checkEqNames n@(HsXName n1) (HsXName n2)
+ | n1 == n2 = return n
+ | otherwise = fail "names in matching xml tags are not equal"
+checkEqNames n@(HsXDomName d1 n1) (HsXDomName d2 n2)
+ | n1 == n2 && d1 == d2 = return n
+ | otherwise = fail "names in matching xml tags are not equal"
+checkEqNames _ _ = fail "names in matching xml tags are not equal"
+
+
+-----------------------------------------------------------------------------
+-- Miscellaneous utilities
+
+checkPrec :: Integer -> P Int
+checkPrec i | 0 <= i && i <= 9 = return (fromInteger i)
+checkPrec i | otherwise = fail ("Illegal precedence " ++ show i)
+
+mkRecConstrOrUpdate :: HsExp -> [HsFieldUpdate] -> P HsExp
+mkRecConstrOrUpdate (HsCon c) fs = return (HsRecConstr c fs)
+mkRecConstrOrUpdate e fs@(_:_) = return (HsRecUpdate e fs)
+mkRecConstrOrUpdate _ _ = fail "Empty record update"
+
+-----------------------------------------------------------------------------
+-- Reverse a list of declarations, merging adjacent HsFunBinds of the
+-- same name and checking that their arities match.
+
+checkRevDecls :: [HsDecl] -> P [HsDecl]
+checkRevDecls = mergeFunBinds []
+ where
+ mergeFunBinds revDs [] = return revDs
+ mergeFunBinds revDs (HsFunBind ms1@(HsMatch _ name ps _ _:_):ds1) =
+ mergeMatches ms1 ds1
+ where
+ arity = length ps
+ mergeMatches ms' (HsFunBind ms@(HsMatch loc name' ps' _ _:_):ds)
+ | name' == name =
+ if length ps' /= arity
+ then fail ("arity mismatch for '" ++ prettyPrint name ++ "'")
+ `atSrcLoc` loc
+ else mergeMatches (ms++ms') ds
+ mergeMatches ms' ds = mergeFunBinds (HsFunBind ms':revDs) ds
+ mergeFunBinds revDs (d:ds) = mergeFunBinds (d:revDs) ds
+
+
+---------------------------------------
+-- Converting a complete page
+
+pageFun :: SrcLoc -> HsExp -> HsDecl
+pageFun loc e = HsPatBind loc namePat rhs (HsBDecls [])
+ where namePat = HsPVar $ HsIdent "page"
+ rhs = HsUnGuardedRhs e
+
+mkPage :: HsModule -> SrcLoc -> HsExp -> P HsModule
+mkPage (HsModule src prags md exps imps decls) loc xml = do
+ let page = pageFun loc xml
+ return $ HsModule src prags md exps imps (decls ++ [page])
+
+mkPageModule :: HsExp -> P HsModule
+mkPageModule xml = do
+ do loc <- case xml of
+ HsXTag l _ _ _ _ -> return l
+ HsXETag l _ _ _ -> return l
+ _ -> fail "Will not happen since mkPageModule is only called on XML expressions"
+ mod <- getModuleName
+ return $ (HsModule
+ loc
+ []
+ (Module mod)
+ (Just [HsEVar $ UnQual $ HsIdent "page"])
+ []
+ [pageFun loc xml])
+
+---------------------------------------
+-- Handle dash-identifiers
+
+mkDVar :: [String] -> String
+mkDVar = concat . intersperse "-"
+
+mkDVarExpr :: [String] -> HsExp
+mkDVarExpr = foldl1 (\x y -> infixApp x (op $ sym "-") y) . map (var . name)
+
+---------------------------------------
+-- Combine adjacent for-alls.
+--
+-- A valid type must have one for-all at the top of the type, or of the fn arg types
+
+mkHsTyForall :: Maybe [HsName] -> HsContext -> HsType -> HsType
+mkHsTyForall mtvs [] ty = mk_forall_ty mtvs ty
+mkHsTyForall mtvs ctxt ty = HsTyForall mtvs ctxt ty
+
+-- mk_forall_ty makes a pure for-all type (no context)
+mk_forall_ty (Just []) ty = ty -- Explicit for-all with no tyvars
+mk_forall_ty mtvs1 (HsTyForall mtvs2 ctxt ty) = mkHsTyForall (mtvs1 `plus` mtvs2) ctxt ty
+mk_forall_ty mtvs1 ty = HsTyForall mtvs1 [] ty
+
+mtvs1 `plus` Nothing = mtvs1
+Nothing `plus` mtvs2 = mtvs2
+(Just tvs1) `plus` (Just tvs2) = Just (tvs1 ++ tvs2)
diff -rN -u old-fenfire-hs/Preprocessor/Hsx/Pretty.hs new-fenfire-hs/Preprocessor/Hsx/Pretty.hs
--- old-fenfire-hs/Preprocessor/Hsx/Pretty.hs 1970-01-01 02:00:00.000000000 +0200
+++ new-fenfire-hs/Preprocessor/Hsx/Pretty.hs 2007-02-12 19:32:17.000000000 +0200
@@ -0,0 +1,986 @@
+{-# OPTIONS_GHC -w #-}
+-----------------------------------------------------------------------------
+-- |
+-- Module : Preprocessor.Hsx.Pretty
+-- Original : Language.Haskell.Pretty
+-- Copyright : (c) Niklas Broberg 2004,
+-- (c) The GHC Team, Noel Winstanley 1997-2000
+-- License : BSD-style (see the file LICENSE.txt)
+--
+-- Maintainer : Niklas Broberg, d00nibro at dtek.chalmers.se
+-- Stability : experimental
+-- Portability : portable
+--
+-- Pretty printer for Haskell with extensions.
+--
+-----------------------------------------------------------------------------
+
+module Preprocessor.Hsx.Pretty (
+ -- * Pretty printing
+ Pretty,
+ prettyPrintStyleMode, prettyPrintWithMode, prettyPrint,
+ -- * Pretty-printing styles (from "Text.PrettyPrint.HughesPJ")
+ P.Style(..), P.style, P.Mode(..),
+ -- * Haskell formatting modes
+ PPHsMode(..), Indent, PPLayout(..), defaultMode) where
+
+import Preprocessor.Hsx.Syntax
+
+import qualified Text.PrettyPrint as P
+
+infixl 5 $$$
+
+-----------------------------------------------------------------------------
+
+-- | Varieties of layout we can use.
+data PPLayout = PPOffsideRule -- ^ classical layout
+ | PPSemiColon -- ^ classical layout made explicit
+ | PPInLine -- ^ inline decls, with newlines between them
+ | PPNoLayout -- ^ everything on a single line
+ deriving Eq
+
+type Indent = Int
+
+-- | Pretty-printing parameters.
+--
+-- /Note:/ the 'onsideIndent' must be positive and less than all other indents.
+data PPHsMode = PPHsMode {
+ -- | indentation of a class or instance
+ classIndent :: Indent,
+ -- | indentation of a @do at -expression
+ doIndent :: Indent,
+ -- | indentation of the body of a
+ -- @case@ expression
+ caseIndent :: Indent,
+ -- | indentation of the declarations in a
+ -- @let@ expression
+ letIndent :: Indent,
+ -- | indentation of the declarations in a
+ -- @where@ clause
+ whereIndent :: Indent,
+ -- | indentation added for continuation
+ -- lines that would otherwise be offside
+ onsideIndent :: Indent,
+ -- | blank lines between statements?
+ spacing :: Bool,
+ -- | Pretty-printing style to use
+ layout :: PPLayout,
+ -- | add GHC-style @LINE@ pragmas to output?
+ linePragmas :: Bool,
+ -- | not implemented yet
+ comments :: Bool
+ }
+
+-- | The default mode: pretty-print using the offside rule and sensible
+-- defaults.
+defaultMode :: PPHsMode
+defaultMode = PPHsMode{
+ classIndent = 8,
+ doIndent = 3,
+ caseIndent = 4,
+ letIndent = 4,
+ whereIndent = 6,
+ onsideIndent = 2,
+ spacing = True,
+ layout = PPOffsideRule,
+ linePragmas = False,
+ comments = True
+ }
+
+-- | Pretty printing monad
+newtype DocM s a = DocM (s -> a)
+
+instance Functor (DocM s) where
+ fmap f xs = do x <- xs; return (f x)
+
+instance Monad (DocM s) where
+ (>>=) = thenDocM
+ (>>) = then_DocM
+ return = retDocM
+
+{-# INLINE thenDocM #-}
+{-# INLINE then_DocM #-}
+{-# INLINE retDocM #-}
+{-# INLINE unDocM #-}
+{-# INLINE getPPEnv #-}
+
+thenDocM :: DocM s a -> (a -> DocM s b) -> DocM s b
+thenDocM m k = DocM $ (\s -> case unDocM m $ s of a -> unDocM (k a) $ s)
+
+then_DocM :: DocM s a -> DocM s b -> DocM s b
+then_DocM m k = DocM $ (\s -> case unDocM m $ s of _ -> unDocM k $ s)
+
+retDocM :: a -> DocM s a
+retDocM a = DocM (\_s -> a)
+
+unDocM :: DocM s a -> (s -> a)
+unDocM (DocM f) = f
+
+-- all this extra stuff, just for this one function.
+getPPEnv :: DocM s s
+getPPEnv = DocM id
+
+-- So that pp code still looks the same
+-- this means we lose some generality though
+
+-- | The document type produced by these pretty printers uses a 'PPHsMode'
+-- environment.
+type Doc = DocM PPHsMode P.Doc
+
+-- | Things that can be pretty-printed, including all the syntactic objects
+-- in "Preprocessor.Syntax".
+class Pretty a where
+ -- | Pretty-print something in isolation.
+ pretty :: a -> Doc
+ -- | Pretty-print something in a precedence context.
+ prettyPrec :: Int -> a -> Doc
+ pretty = prettyPrec 0
+ prettyPrec _ = pretty
+
+-- The pretty printing combinators
+
+empty :: Doc
+empty = return P.empty
+
+nest :: Int -> Doc -> Doc
+nest i m = m >>= return . P.nest i
+
+
+-- Literals
+
+text, ptext :: String -> Doc
+text = return . P.text
+ptext = return . P.text
+
+char :: Char -> Doc
+char = return . P.char
+
+int :: Int -> Doc
+int = return . P.int
+
+integer :: Integer -> Doc
+integer = return . P.integer
+
+float :: Float -> Doc
+float = return . P.float
+
+double :: Double -> Doc
+double = return . P.double
+
+rational :: Rational -> Doc
+rational = return . P.rational
+
+-- Simple Combining Forms
+
+parens, brackets, braces,quotes,doubleQuotes :: Doc -> Doc
+parens d = d >>= return . P.parens
+brackets d = d >>= return . P.brackets
+braces d = d >>= return . P.braces
+quotes d = d >>= return . P.quotes
+doubleQuotes d = d >>= return . P.doubleQuotes
+
+parensIf :: Bool -> Doc -> Doc
+parensIf True = parens
+parensIf False = id
+
+-- Constants
+
+semi,comma,colon,space,equals :: Doc
+semi = return P.semi
+comma = return P.comma
+colon = return P.colon
+space = return P.space
+equals = return P.equals
+
+lparen,rparen,lbrack,rbrack,lbrace,rbrace :: Doc
+lparen = return P.lparen
+rparen = return P.rparen
+lbrack = return P.lbrack
+rbrack = return P.rbrack
+lbrace = return P.lbrace
+rbrace = return P.rbrace
+
+-- Combinators
+
+(<>),(<+>),($$),($+$) :: Doc -> Doc -> Doc
+aM <> bM = do{a<-aM;b<-bM;return (a P.<> b)}
+aM <+> bM = do{a<-aM;b<-bM;return (a P.<+> b)}
+aM $$ bM = do{a<-aM;b<-bM;return (a P.$$ b)}
+aM $+$ bM = do{a<-aM;b<-bM;return (a P.$+$ b)}
+
+hcat,hsep,vcat,sep,cat,fsep,fcat :: [Doc] -> Doc
+hcat dl = sequence dl >>= return . P.hcat
+hsep dl = sequence dl >>= return . P.hsep
+vcat dl = sequence dl >>= return . P.vcat
+sep dl = sequence dl >>= return . P.sep
+cat dl = sequence dl >>= return . P.cat
+fsep dl = sequence dl >>= return . P.fsep
+fcat dl = sequence dl >>= return . P.fcat
+
+-- Some More
+
+hang :: Doc -> Int -> Doc -> Doc
+hang dM i rM = do{d<-dM;r<-rM;return $ P.hang d i r}
+
+-- Yuk, had to cut-n-paste this one from Pretty.hs
+punctuate :: Doc -> [Doc] -> [Doc]
+punctuate _ [] = []
+punctuate p (d1:ds) = go d1 ds
+ where
+ go d [] = [d]
+ go d (e:es) = (d <> p) : go e es
+
+-- | render the document with a given style and mode.
+renderStyleMode :: P.Style -> PPHsMode -> Doc -> String
+renderStyleMode ppStyle ppMode d = P.renderStyle ppStyle . unDocM d $ ppMode
+
+-- | render the document with a given mode.
+renderWithMode :: PPHsMode -> Doc -> String
+renderWithMode = renderStyleMode P.style
+
+-- | render the document with 'defaultMode'.
+render :: Doc -> String
+render = renderWithMode defaultMode
+
+-- | pretty-print with a given style and mode.
+prettyPrintStyleMode :: Pretty a => P.Style -> PPHsMode -> a -> String
+prettyPrintStyleMode ppStyle ppMode = renderStyleMode ppStyle ppMode . pretty
+
+-- | pretty-print with the default style and a given mode.
+prettyPrintWithMode :: Pretty a => PPHsMode -> a -> String
+prettyPrintWithMode = prettyPrintStyleMode P.style
+
+-- | pretty-print with the default style and 'defaultMode'.
+prettyPrint :: Pretty a => a -> String
+prettyPrint = prettyPrintWithMode defaultMode
+
+fullRenderWithMode :: PPHsMode -> P.Mode -> Int -> Float ->
+ (P.TextDetails -> a -> a) -> a -> Doc -> a
+fullRenderWithMode ppMode m i f fn e mD =
+ P.fullRender m i f fn e $ (unDocM mD) ppMode
+
+
+fullRender :: P.Mode -> Int -> Float -> (P.TextDetails -> a -> a)
+ -> a -> Doc -> a
+fullRender = fullRenderWithMode defaultMode
+
+------------------------- Pretty-Print a Module --------------------
+instance Pretty HsModule where
+ pretty (HsModule pos prags m mbExports imp decls) =
+ markLine pos $
+ topLevel (ppHsModuleHeader prags m mbExports)
+ (map pretty imp ++ map pretty decls)
+
+-------------------------- Module Header ------------------------------
+ppHsModuleHeader :: [HsPragma] -> Module -> Maybe [HsExportSpec] -> Doc
+ppHsModuleHeader prags m mbExportList = mySep $ prags' ++ [
+ text "module",
+ pretty m,
+ maybePP (parenList . map pretty) mbExportList,
+ text "where"]
+ where prags' = map (\(HsPragma s) -> text $ "{-#" ++ s ++ "#-}") prags
+
+instance Pretty Module where
+ pretty (Module modName) = text modName
+
+instance Pretty HsExportSpec where
+ pretty (HsEVar name) = pretty name
+ pretty (HsEAbs name) = pretty name
+ pretty (HsEThingAll name) = pretty name <> text "(..)"
+ pretty (HsEThingWith name nameList) =
+ pretty name <> (parenList . map pretty $ nameList)
+ pretty (HsEModuleContents m) = text "module" <+> pretty m
+
+instance Pretty HsImportDecl where
+ pretty (HsImportDecl pos m qual mbName mbSpecs) =
+ markLine pos $
+ mySep [text "import",
+ if qual then text "qualified" else empty,
+ pretty m,
+ maybePP (\m' -> text "as" <+> pretty m') mbName,
+ maybePP exports mbSpecs]
+ where
+ exports (b,specList) =
+ if b then text "hiding" <+> specs else specs
+ where specs = parenList . map pretty $ specList
+
+instance Pretty HsImportSpec where
+ pretty (HsIVar name) = pretty name
+ pretty (HsIAbs name) = pretty name
+ pretty (HsIThingAll name) = pretty name <> text "(..)"
+ pretty (HsIThingWith name nameList) =
+ pretty name <> (parenList . map pretty $ nameList)
+
+------------------------- Declarations ------------------------------
+instance Pretty HsDecl where
+ pretty (HsTypeDecl loc name nameList htype) =
+ blankline $
+ markLine loc $
+ mySep ( [text "type", pretty name]
+ ++ map pretty nameList
+ ++ [equals, pretty htype])
+
+ pretty (HsDataDecl loc context name nameList constrList derives) =
+ blankline $
+ markLine loc $
+ mySep ( [text "data", ppHsContext context, pretty name]
+ ++ map pretty nameList)
+ <+> (myVcat (zipWith (<+>) (equals : repeat (char '|'))
+ (map pretty constrList))
+ $$$ ppHsDeriving derives)
+
+ pretty (HsGDataDecl loc context name nameList gadtList) =
+ blankline $
+ markLine loc $
+ mySep ( [text "data", ppHsContext context, pretty name]
+ ++ map pretty nameList ++ [text "where"])
+ $$$ ppBody classIndent (map pretty gadtList)
+
+ pretty (HsNewTypeDecl pos context name nameList constr derives) =
+ blankline $
+ markLine pos $
+ mySep ( [text "newtype", ppHsContext context, pretty name]
+ ++ map pretty nameList)
+ <+> equals <+> (pretty constr $$$ ppHsDeriving derives)
+
+ --m{spacing=False}
+ -- special case for empty class declaration
+ pretty (HsClassDecl pos context name nameList fundeps []) =
+ blankline $
+ markLine pos $
+ mySep ( [text "class", ppHsContext context, pretty name]
+ ++ map pretty nameList ++ [ppFunDeps fundeps])
+ pretty (HsClassDecl pos context name nameList fundeps declList) =
+ blankline $
+ markLine pos $
+ mySep ( [text "class", ppHsContext context, pretty name]
+ ++ map pretty nameList ++ [ppFunDeps fundeps, text "where"])
+ $$$ ppBody classIndent (map pretty declList)
+
+ -- m{spacing=False}
+ -- special case for empty instance declaration
+ pretty (HsInstDecl pos context name args []) =
+ blankline $
+ markLine pos $
+ mySep ( [text "instance", ppHsContext context, pretty name]
+ ++ map ppHsAType args)
+ pretty (HsInstDecl pos context name args declList) =
+ blankline $
+ markLine pos $
+ mySep ( [text "instance", ppHsContext context, pretty name]
+ ++ map ppHsAType args ++ [text "where"])
+ $$$ ppBody classIndent (map pretty declList)
+
+ pretty (HsDefaultDecl pos htypes) =
+ blankline $
+ markLine pos $
+ text "default" <+> parenList (map pretty htypes)
+
+ pretty (HsSpliceDecl pos splice) =
+ blankline $
+ markLine pos $
+ pretty splice
+
+ pretty (HsTypeSig pos nameList qualType) =
+ blankline $
+ markLine pos $
+ mySep ((punctuate comma . map pretty $ nameList)
+ ++ [text "::", pretty qualType])
+
+ pretty (HsFunBind matches) =
+ foldr ($$$) empty (map pretty matches)
+
+ pretty (HsPatBind pos pat rhs whereBinds) =
+ markLine pos $
+ myFsep [pretty pat, pretty rhs] $$$ ppWhere whereBinds
+
+ pretty (HsInfixDecl pos assoc prec opList) =
+ blankline $
+ markLine pos $
+ mySep ([pretty assoc, int prec]
+ ++ (punctuate comma . map pretty $ opList))
+
+ pretty (HsForImp pos cconv saf str name typ) =
+ blankline $
+ markLine pos $
+ mySep [text "foreign import", pretty cconv, pretty saf,
+ text (show str), pretty name, text "::", pretty typ]
+
+ pretty (HsForExp pos cconv str name typ) =
+ blankline $
+ markLine pos $
+ mySep [text "foreign export", pretty cconv,
+ text (show str), pretty name, text "::", pretty typ]
+
+instance Pretty HsAssoc where
+ pretty HsAssocNone = text "infix"
+ pretty HsAssocLeft = text "infixl"
+ pretty HsAssocRight = text "infixr"
+
+instance Pretty HsMatch where
+ pretty (HsMatch pos f ps rhs whereBinds) =
+ markLine pos $
+ myFsep (lhs ++ [pretty rhs])
+ $$$ ppWhere whereBinds
+ where
+ lhs = case ps of
+ l:r:ps' | isSymbolName f ->
+ let hd = [pretty l, ppHsName f, pretty r] in
+ if null ps' then hd
+ else parens (myFsep hd) : map (prettyPrec 2) ps'
+ _ -> pretty f : map (prettyPrec 2) ps
+
+ppWhere :: HsBinds -> Doc
+ppWhere (HsBDecls []) = empty
+ppWhere (HsBDecls l) = nest 2 (text "where" $$$ ppBody whereIndent (map pretty l))
+ppWhere (HsIPBinds b) = nest 2 (text "where" $$$ ppBody whereIndent (map pretty b))
+
+------------------------- FFI stuff -------------------------------------
+instance Pretty HsSafety where
+ pretty PlayRisky = text "unsafe"
+ pretty (PlaySafe b) = text $ if b then "threadsafe" else "safe"
+
+instance Pretty HsCallConv where
+ pretty StdCall = text "stdcall"
+ pretty CCall = text "ccall"
+
+------------------------- Data & Newtype Bodies -------------------------
+instance Pretty HsQualConDecl where
+ pretty (HsQualConDecl _pos tvs ctxt con) =
+ myFsep [ppForall (Just tvs), ppHsContext ctxt, pretty con]
+
+instance Pretty HsGadtDecl where
+ pretty (HsGadtDecl _pos name ty) =
+ myFsep [pretty name, text "::", pretty ty]
+
+instance Pretty HsConDecl where
+ pretty (HsRecDecl name fieldList) =
+ pretty name <> (braceList . map ppField $ fieldList)
+
+ pretty (HsConDecl name@(HsSymbol _) [l, r]) =
+ myFsep [prettyPrec prec_btype l, ppHsName name,
+ prettyPrec prec_btype r]
+ pretty (HsConDecl name typeList) =
+ mySep $ ppHsName name : map (prettyPrec prec_atype) typeList
+
+ppField :: ([HsName],HsBangType) -> Doc
+ppField (names, ty) =
+ myFsepSimple $ (punctuate comma . map pretty $ names) ++
+ [text "::", pretty ty]
+
+instance Pretty HsBangType where
+ prettyPrec _ (HsBangedTy ty) = char '!' <> ppHsAType ty
+ prettyPrec p (HsUnBangedTy ty) = prettyPrec p ty
+
+ppHsDeriving :: [HsQName] -> Doc
+ppHsDeriving [] = empty
+ppHsDeriving [d] = text "deriving" <+> ppHsQName d
+ppHsDeriving ds = text "deriving" <+> parenList (map ppHsQName ds)
+
+------------------------- Types -------------------------
+{-
+instance Pretty HsQualType where
+ pretty (HsQualType context htype) =
+ myFsep [ppHsContext context, pretty htype]
+-}
+ppHsBType :: HsType -> Doc
+ppHsBType = prettyPrec prec_btype
+
+ppHsAType :: HsType -> Doc
+ppHsAType = prettyPrec prec_atype
+
+-- precedences for types
+prec_btype, prec_atype :: Int
+prec_btype = 1 -- left argument of ->,
+ -- or either argument of an infix data constructor
+prec_atype = 2 -- argument of type or data constructor, or of a class
+
+instance Pretty HsType where
+ prettyPrec p (HsTyForall mtvs ctxt htype) = parensIf (p > 0) $
+ myFsep [ppForall mtvs, ppHsContext ctxt, pretty htype]
+ prettyPrec p (HsTyFun a b) = parensIf (p > 0) $
+ myFsep [ppHsBType a, text "->", pretty b]
+ prettyPrec _ (HsTyTuple bxd l) =
+ let ds = map pretty l
+ in case bxd of
+ Boxed -> parenList ds
+ Unboxed -> hashParenList ds
+ prettyPrec p (HsTyApp a b)
+ | a == list_tycon = brackets $ pretty b -- special case
+ | otherwise = parensIf (p > prec_btype) $
+ myFsep [pretty a, ppHsAType b]
+ prettyPrec _ (HsTyVar name) = pretty name
+ prettyPrec _ (HsTyCon name) = pretty name
+ prettyPrec _ (HsTyPred asst) = pretty asst
+ prettyPrec _ (HsTyInfix a op b) = parens (myFsep [pretty op, parens (pretty a), parens (pretty b)])
+
+
+ppForall :: Maybe [HsName] -> Doc
+ppForall Nothing = empty
+ppForall (Just []) = empty
+ppForall (Just vs) = myFsep (text "forall" : map pretty vs ++ [char '.'])
+
+------------------- Functional Dependencies -------------------
+instance Pretty HsFunDep where
+ pretty (HsFunDep from to) =
+ myFsep $ map pretty from ++ [text "->"] ++ map pretty to
+
+
+ppFunDeps :: [HsFunDep] -> Doc
+ppFunDeps [] = empty
+ppFunDeps fds = myFsep $ (char '|':) . punctuate comma . map pretty $ fds
+
+------------------------- Expressions -------------------------
+instance Pretty HsRhs where
+ pretty (HsUnGuardedRhs e) = equals <+> pretty e
+ pretty (HsGuardedRhss guardList) = myVcat . map pretty $ guardList
+
+instance Pretty HsGuardedRhs where
+ pretty (HsGuardedRhs _pos guards ppBody) =
+ myFsep $ [char '|'] ++ (punctuate comma . map pretty $ guards) ++ [equals, pretty ppBody]
+
+instance Pretty HsLiteral where
+ pretty (HsInt i) = integer i
+ pretty (HsChar c) = text (show c)
+ pretty (HsString s) = text (show s)
+ pretty (HsFrac r) = double (fromRational r)
+ -- GHC unboxed literals:
+ pretty (HsCharPrim c) = text (show c) <> char '#'
+ pretty (HsStringPrim s) = text (show s) <> char '#'
+ pretty (HsIntPrim i) = integer i <> char '#'
+ pretty (HsFloatPrim r) = float (fromRational r) <> char '#'
+ pretty (HsDoublePrim r) = double (fromRational r) <> text "##"
+
+instance Pretty HsExp where
+ pretty (HsLit l) = pretty l
+ -- lambda stuff
+ pretty (HsInfixApp a op b) = myFsep [pretty a, pretty op, pretty b]
+ pretty (HsNegApp e) = myFsep [char '-', pretty e]
+ pretty (HsApp a b) = myFsep [pretty a, pretty b]
+ pretty (HsLambda _loc expList ppBody) = myFsep $
+ char '\\' : map pretty expList ++ [text "->", pretty ppBody]
+ -- keywords
+ -- two cases for lets
+ pretty (HsLet (HsBDecls declList) letBody) =
+ ppLetExp declList letBody
+ pretty (HsLet (HsIPBinds bindList) letBody) =
+ ppLetExp bindList letBody
+ pretty (HsDLet bindList letBody) =
+ myFsep [text "dlet" <+> ppBody letIndent (map pretty bindList),
+ text "in", pretty letBody]
+ pretty (HsWith exp bindList) =
+ pretty exp $$$ ppWith bindList
+ pretty (HsIf cond thenexp elsexp) =
+ myFsep [text "if", pretty cond,
+ text "then", pretty thenexp,
+ text "else", pretty elsexp]
+ pretty (HsCase cond altList) =
+ myFsep [text "case", pretty cond, text "of"]
+ $$$ ppBody caseIndent (map pretty altList)
+ pretty (HsDo stmtList) =
+ text "do" $$$ ppBody doIndent (map pretty stmtList)
+ pretty (HsMDo stmtList) =
+ text "mdo" $$$ ppBody doIndent (map pretty stmtList)
+ -- Constructors & Vars
+ pretty (HsVar name) = pretty name
+ pretty (HsIPVar ipname) = pretty ipname
+ pretty (HsCon name) = pretty name
+ pretty (HsTuple expList) = parenList . map pretty $ expList
+ -- weird stuff
+ pretty (HsParen e) = parens . pretty $ e
+ pretty (HsLeftSection e op) = parens (pretty e <+> pretty op)
+ pretty (HsRightSection op e) = parens (pretty op <+> pretty e)
+ pretty (HsRecConstr c fieldList) =
+ pretty c <> (braceList . map pretty $ fieldList)
+ pretty (HsRecUpdate e fieldList) =
+ pretty e <> (braceList . map pretty $ fieldList)
+ -- patterns
+ -- special case that would otherwise be buggy
+ pretty (HsAsPat name (HsIrrPat e)) =
+ myFsep [pretty name <> char '@', char '~' <> pretty e]
+ pretty (HsAsPat name e) = hcat [pretty name, char '@', pretty e]
+ pretty HsWildCard = char '_'
+ pretty (HsIrrPat e) = char '~' <> pretty e
+ -- Lists
+ pretty (HsList list) =
+ bracketList . punctuate comma . map pretty $ list
+ pretty (HsEnumFrom e) =
+ bracketList [pretty e, text ".."]
+ pretty (HsEnumFromTo from to) =
+ bracketList [pretty from, text "..", pretty to]
+ pretty (HsEnumFromThen from thenE) =
+ bracketList [pretty from <> comma, pretty thenE, text ".."]
+ pretty (HsEnumFromThenTo from thenE to) =
+ bracketList [pretty from <> comma, pretty thenE,
+ text "..", pretty to]
+ pretty (HsListComp e stmtList) =
+ bracketList ([pretty e, char '|']
+ ++ (punctuate comma . map pretty $ stmtList))
+ pretty (HsExpTypeSig _pos e ty) =
+ myFsep [pretty e, text "::", pretty ty]
+ -- Template Haskell
+ pretty (HsReifyExp r) = pretty r
+ pretty (HsBracketExp b) = pretty b
+ pretty (HsSpliceExp s) = pretty s
+ -- regular patterns
+ pretty (HsRPats _ rs) =
+ myFsep $ text "[/" : map pretty rs ++ [text "/]"]
+ pretty (HsSeqRP rs) =
+ myFsep $ text "(/" : map pretty rs ++ [text "/)"]
+ pretty (HsStarRP r) = pretty r <> char '*'
+ pretty (HsStarGRP r) = pretty r <> text "*!"
+ pretty (HsPlusRP r) = pretty r <> char '+'
+ pretty (HsPlusGRP r) = pretty r <> text "+!"
+ pretty (HsOptRP r) = pretty r <> char '?'
+ pretty (HsOptGRP r) = pretty r <> text "?!"
+ pretty (HsEitherRP r1 r2) = parens . myFsep $
+ [pretty r1, char '|', pretty r2]
+ -- special case that would otherwise be buggy
+ pretty (HsCAsRP n (HsIrrPat e)) =
+ myFsep [pretty n <> text "@:", char '~' <> pretty e]
+ pretty (HsCAsRP n r) = hcat [pretty n, text "@:", pretty r]
+ -- Hsx
+ pretty (HsXTag _ n attrs mattr cs) =
+ let ax = maybe [] (return . pretty) mattr
+ in hcat $
+ (myFsep $ (char '<' <> pretty n): map pretty attrs ++ ax ++ [char '>']):
+ map pretty cs ++ [myFsep $ [text "</" <> pretty n, char '>']]
+ pretty (HsXETag _ n attrs mattr) =
+ let ax = maybe [] (return . pretty) mattr
+ in myFsep $ (char '<' <> pretty n): map pretty attrs ++ ax ++ [text "/>"]
+ pretty (HsXPcdata s) = text s
+ pretty (HsXExpTag e) =
+ myFsep $ [text "<%", pretty e, text "%>"]
+
+instance Pretty HsXAttr where
+ pretty (HsXAttr n v) =
+ myFsep [pretty n, char '=', pretty v]
+
+instance Pretty HsXName where
+ pretty (HsXName n) = text n
+ pretty (HsXDomName d n) = text d <> char ':' <> text n
+
+--ppLetExp :: [HsDecl] -> HsExp -> Doc
+ppLetExp l b = myFsep [text "let" <+> ppBody letIndent (map pretty l),
+ text "in", pretty b]
+
+ppWith binds = nest 2 (text "with" $$$ ppBody withIndent (map pretty binds))
+withIndent = whereIndent
+
+--------------------- Template Haskell -------------------------
+instance Pretty HsReify where
+ pretty (HsReifyDecl name) = ppReify "reifyDecl" name
+ pretty (HsReifyType name) = ppReify "reifyType" name
+ pretty (HsReifyFixity name) = ppReify "reifyFixity" name
+
+ppReify t n = myFsep [text t, pretty n]
+
+instance Pretty HsBracket where
+ pretty (HsExpBracket e) = ppBracket "[|" e
+ pretty (HsPatBracket p) = ppBracket "[p|" p
+ pretty (HsTypeBracket t) = ppBracket "[t|" t
+ pretty (HsDeclBracket d) =
+ myFsep $ text "[d|" : map pretty d ++ [text "|]"]
+
+ppBracket o x = myFsep [text o, pretty x, text "|]"]
+
+instance Pretty HsSplice where
+ pretty (HsIdSplice s) = char '$' <> text s
+ pretty (HsParenSplice e) =
+ myFsep [text "$(", pretty e, char ')']
+
+------------------------- Patterns -----------------------------
+
+instance Pretty HsPat where
+ prettyPrec _ (HsPVar name) = pretty name
+ prettyPrec _ (HsPLit lit) = pretty lit
+ prettyPrec _ (HsPNeg p) = myFsep [char '-', pretty p]
+ prettyPrec p (HsPInfixApp a op b) = parensIf (p > 0) $
+ myFsep [pretty a, pretty (HsQConOp op), pretty b]
+ prettyPrec p (HsPApp n ps) = parensIf (p > 1) $
+ myFsep (pretty n : map pretty ps)
+ prettyPrec _ (HsPTuple ps) = parenList . map pretty $ ps
+ prettyPrec _ (HsPList ps) =
+ bracketList . punctuate comma . map pretty $ ps
+ prettyPrec _ (HsPParen p) = parens . pretty $ p
+ prettyPrec _ (HsPRec c fields) =
+ pretty c <> (braceList . map pretty $ fields)
+ -- special case that would otherwise be buggy
+ prettyPrec _ (HsPAsPat name (HsPIrrPat pat)) =
+ myFsep [pretty name <> char '@', char '~' <> pretty pat]
+ prettyPrec _ (HsPAsPat name pat) =
+ hcat [pretty name, char '@', pretty pat]
+ prettyPrec _ HsPWildCard = char '_'
+ prettyPrec _ (HsPIrrPat pat) = char '~' <> pretty pat
+ prettyPrec _ (HsPRPat _ rs) =
+ myFsep $ text "[/" : map pretty rs ++ [text "/]"]
+ prettyPrec _ (HsPatTypeSig _pos pat ty) =
+ myFsep [pretty pat, text "::", pretty ty]
+
+ -- Hsx
+ prettyPrec _ (HsPXTag _ n attrs mattr cp) =
+ let ap = maybe [] (return . pretty) mattr
+ in hcat $ -- TODO: should not introduce blanks
+ (myFsep $ (char '<' <> pretty n): map pretty attrs ++ ap ++ [char '>']):
+ prettyChildren cp ++ [myFsep $ [text "</" <> pretty n, char '>']]
+ prettyPrec _ (HsPXETag _ n attrs mattr) =
+ let ap = maybe [] (return . pretty) mattr
+ in myFsep $ (char '<' <> pretty n): map pretty attrs ++ ap ++ [text "/>"]
+ prettyPrec _ (HsPXPcdata s) = text s
+ prettyPrec _ (HsPXPatTag p) =
+ myFsep $ [text "<%", pretty p, text "%>"]
+
+prettyChildren :: HsPat -> [Doc]
+prettyChildren p = case p of
+ HsPList ps -> map prettyChild ps
+ HsPRPat _ _ -> [pretty p]
+ _ -> error "The pattern representing the children of an xml pattern\
+ \ should always be a list."
+
+prettyChild :: HsPat -> Doc
+prettyChild p = case p of
+ HsPXTag _ _ _ _ _ -> pretty p
+ HsPXETag _ _ _ _ -> pretty p
+ HsPXPatTag _ -> pretty p
+ HsPXPcdata _ -> pretty p
+ _ -> pretty $ HsPXPatTag p
+
+instance Pretty HsPXAttr where
+ pretty (HsPXAttr n p) =
+ myFsep [pretty n, char '=', pretty p]
+
+instance Pretty HsPatField where
+ pretty (HsPFieldPat name pat) =
+ myFsep [pretty name, equals, pretty pat]
+
+--------------------- Regular Patterns -------------------------
+
+instance Pretty HsRPat where
+ pretty (HsRPStar r) = pretty r <> char '*'
+ pretty (HsRPStarG r) = pretty r <> text "*!"
+ pretty (HsRPPlus r) = pretty r <> char '+'
+ pretty (HsRPPlusG r) = pretty r <> text "+!"
+ pretty (HsRPOpt r) = pretty r <> char '?'
+ pretty (HsRPOptG r) = pretty r <> text "?!"
+ pretty (HsRPEither r1 r2) = parens . myFsep $
+ [pretty r1, char '|', pretty r2]
+ pretty (HsRPSeq rs) =
+ myFsep $ text "(/" : map pretty rs ++ [text "/)"]
+ -- special case that would otherwise be buggy
+ pretty (HsRPCAs n (HsRPPat (HsPIrrPat p))) =
+ myFsep [pretty n <> text "@:", char '~' <> pretty p]
+ pretty (HsRPCAs n r) = hcat [pretty n, text "@:", pretty r]
+ -- special case that would otherwise be buggy
+ pretty (HsRPAs n (HsRPPat (HsPIrrPat p))) =
+ myFsep [pretty n <> text "@:", char '~' <> pretty p]
+ pretty (HsRPAs n r) = hcat [pretty n, char '@', pretty r]
+ pretty (HsRPPat p) = pretty p
+ pretty (HsRPParen rp) = parens . pretty $ rp
+
+------------------------- Case bodies -------------------------
+instance Pretty HsAlt where
+ pretty (HsAlt _pos e gAlts binds) =
+ pretty e <+> pretty gAlts $$$ ppWhere binds
+
+instance Pretty HsGuardedAlts where
+ pretty (HsUnGuardedAlt e) = text "->" <+> pretty e
+ pretty (HsGuardedAlts altList) = myVcat . map pretty $ altList
+
+instance Pretty HsGuardedAlt where
+ pretty (HsGuardedAlt _pos guards body) =
+ myFsep $ char '|': (punctuate comma . map pretty $ guards) ++ [text "->", pretty body]
+
+------------------------- Statements in monads, guards & list comprehensions -----
+instance Pretty HsStmt where
+ pretty (HsGenerator _loc e from) =
+ pretty e <+> text "<-" <+> pretty from
+ pretty (HsQualifier e) = pretty e
+ -- two cases for lets
+ pretty (HsLetStmt (HsBDecls declList)) =
+ ppLetStmt declList
+ pretty (HsLetStmt (HsIPBinds bindList)) =
+ ppLetStmt bindList
+
+ppLetStmt l = text "let" $$$ ppBody letIndent (map pretty l)
+
+------------------------- Record updates
+instance Pretty HsFieldUpdate where
+ pretty (HsFieldUpdate name e) =
+ myFsep [pretty name, equals, pretty e]
+
+------------------------- Names -------------------------
+instance Pretty HsQOp where
+ pretty (HsQVarOp n) = ppHsQNameInfix n
+ pretty (HsQConOp n) = ppHsQNameInfix n
+
+ppHsQNameInfix :: HsQName -> Doc
+ppHsQNameInfix name
+ | isSymbolName (getName name) = ppHsQName name
+ | otherwise = char '`' <> ppHsQName name <> char '`'
+
+instance Pretty HsQName where
+ pretty name = case name of
+ UnQual (HsSymbol ('#':_)) -> char '(' <+> ppHsQName name <+> char ')'
+ _ -> parensIf (isSymbolName (getName name)) (ppHsQName name)
+
+ppHsQName :: HsQName -> Doc
+ppHsQName (UnQual name) = ppHsName name
+ppHsQName (Qual m name) = pretty m <> char '.' <> ppHsName name
+ppHsQName (Special sym) = text (specialName sym)
+
+instance Pretty HsOp where
+ pretty (HsVarOp n) = ppHsNameInfix n
+ pretty (HsConOp n) = ppHsNameInfix n
+
+ppHsNameInfix :: HsName -> Doc
+ppHsNameInfix name
+ | isSymbolName name = ppHsName name
+ | otherwise = char '`' <> ppHsName name <> char '`'
+
+instance Pretty HsName where
+ pretty name = case name of
+ HsSymbol ('#':_) -> char '(' <+> ppHsName name <+> char ')'
+ _ -> parensIf (isSymbolName name) (ppHsName name)
+
+ppHsName :: HsName -> Doc
+ppHsName (HsIdent s) = text s
+ppHsName (HsSymbol s) = text s
+
+instance Pretty HsIPName where
+ pretty (HsIPDup s) = char '?' <> text s
+ pretty (HsIPLin s) = char '%' <> text s
+
+instance Pretty HsIPBind where
+ pretty (HsIPBind _loc ipname exp) =
+ myFsep [pretty ipname, equals, pretty exp]
+
+instance Pretty HsCName where
+ pretty (HsVarName n) = pretty n
+ pretty (HsConName n) = pretty n
+
+isSymbolName :: HsName -> Bool
+isSymbolName (HsSymbol _) = True
+isSymbolName _ = False
+
+getName :: HsQName -> HsName
+getName (UnQual s) = s
+getName (Qual _ s) = s
+getName (Special HsCons) = HsSymbol ":"
+getName (Special HsFunCon) = HsSymbol "->"
+getName (Special s) = HsIdent (specialName s)
+
+specialName :: HsSpecialCon -> String
+specialName HsUnitCon = "()"
+specialName HsListCon = "[]"
+specialName HsFunCon = "->"
+specialName (HsTupleCon n) = "(" ++ replicate (n-1) ',' ++ ")"
+specialName HsCons = ":"
+
+ppHsContext :: HsContext -> Doc
+ppHsContext [] = empty
+ppHsContext context = mySep [parenList (map pretty context), text "=>"]
+
+-- hacked for multi-parameter type classes
+instance Pretty HsAsst where
+ pretty (HsClassA a ts) = myFsep $ ppHsQName a : map ppHsAType ts
+ pretty (HsIParam i t) = myFsep $ [pretty i, text "::", pretty t]
+
+------------------------- pp utils -------------------------
+maybePP :: (a -> Doc) -> Maybe a -> Doc
+maybePP pp Nothing = empty
+maybePP pp (Just a) = pp a
+
+parenList :: [Doc] -> Doc
+parenList = parens . myFsepSimple . punctuate comma
+
+hashParenList :: [Doc] -> Doc
+hashParenList = hashParens . myFsepSimple . punctuate comma
+ where hashParens = parens . hashes
+ hashes = \doc -> char '#' <> doc <> char '#'
+
+braceList :: [Doc] -> Doc
+braceList = braces . myFsepSimple . punctuate comma
+
+bracketList :: [Doc] -> Doc
+bracketList = brackets . myFsepSimple
+
+-- Wrap in braces and semicolons, with an extra space at the start in
+-- case the first doc begins with "-", which would be scanned as {-
+flatBlock :: [Doc] -> Doc
+flatBlock = braces . (space <>) . hsep . punctuate semi
+
+-- Same, but put each thing on a separate line
+prettyBlock :: [Doc] -> Doc
+prettyBlock = braces . (space <>) . vcat . punctuate semi
+
+-- Monadic PP Combinators -- these examine the env
+
+blankline :: Doc -> Doc
+blankline dl = do{e<-getPPEnv;if spacing e && layout e /= PPNoLayout
+ then space $$ dl else dl}
+topLevel :: Doc -> [Doc] -> Doc
+topLevel header dl = do
+ e <- fmap layout getPPEnv
+ case e of
+ PPOffsideRule -> header $$ vcat dl
+ PPSemiColon -> header $$ prettyBlock dl
+ PPInLine -> header $$ prettyBlock dl
+ PPNoLayout -> header <+> flatBlock dl
+
+ppBody :: (PPHsMode -> Int) -> [Doc] -> Doc
+ppBody f dl = do
+ e <- fmap layout getPPEnv
+ case e of PPOffsideRule -> indent
+ PPSemiColon -> indentExplicit
+ _ -> flatBlock dl
+ where
+ indent = do{i <-fmap f getPPEnv;nest i . vcat $ dl}
+ indentExplicit = do {i <- fmap f getPPEnv;
+ nest i . prettyBlock $ dl}
+
+($$$) :: Doc -> Doc -> Doc
+a $$$ b = layoutChoice (a $$) (a <+>) b
+
+mySep :: [Doc] -> Doc
+mySep = layoutChoice mySep' hsep
+ where
+ -- ensure paragraph fills with indentation.
+ mySep' [x] = x
+ mySep' (x:xs) = x <+> fsep xs
+ mySep' [] = error "Internal error: mySep"
+
+myVcat :: [Doc] -> Doc
+myVcat = layoutChoice vcat hsep
+
+myFsepSimple :: [Doc] -> Doc
+myFsepSimple = layoutChoice fsep hsep
+
+-- same, except that continuation lines are indented,
+-- which is necessary to avoid triggering the offside rule.
+myFsep :: [Doc] -> Doc
+myFsep = layoutChoice fsep' hsep
+ where fsep' [] = empty
+ fsep' (d:ds) = do
+ e <- getPPEnv
+ let n = onsideIndent e
+ nest n (fsep (nest (-n) d:ds))
+
+layoutChoice :: (a -> Doc) -> (a -> Doc) -> a -> Doc
+layoutChoice a b dl = do e <- getPPEnv
+ if layout e == PPOffsideRule ||
+ layout e == PPSemiColon
+ then a dl else b dl
+
+-- Prefix something with a LINE pragma, if requested.
+-- GHC's LINE pragma actually sets the current line number to n-1, so
+-- that the following line is line n. But if there's no newline before
+-- the line we're talking about, we need to compensate by adding 1.
+
+markLine :: SrcLoc -> Doc -> Doc
+markLine loc doc = do
+ e <- getPPEnv
+ let y = srcLine loc
+ let line l =
+ text ("{-# LINE " ++ show l ++ " \"" ++ srcFilename loc ++ "\" #-}")
+ if linePragmas e then layoutChoice (line y $$) (line (y+1) <+>) doc
+ else doc
diff -rN -u old-fenfire-hs/Preprocessor/Hsx/Syntax.hs new-fenfire-hs/Preprocessor/Hsx/Syntax.hs
--- old-fenfire-hs/Preprocessor/Hsx/Syntax.hs 1970-01-01 02:00:00.000000000 +0200
+++ new-fenfire-hs/Preprocessor/Hsx/Syntax.hs 2007-02-12 19:32:17.000000000 +0200
@@ -0,0 +1,806 @@
+{-# OPTIONS_GHC -fglasgow-exts -cpp #-}
+-----------------------------------------------------------------------------
+-- |
+-- Module : Preprocessor.Hsx.Syntax
+-- Original : Language.Haskell.Syntax
+-- Copyright : (c) Niklas Broberg 2004,
+-- (c) The GHC Team, 1997-2000
+-- License : BSD-style (see the file LICENSE.txt)
+--
+-- Maintainer : Niklas Broberg, d00nibro at dtek.chalmers.se
+-- Stability : experimental
+-- Portability : portable
+--
+-- A suite of datatypes describing the abstract syntax of Haskell 98
+-- <http://www.haskell.org/onlinereport/> plus some extensions:
+--
+-- * multi-parameter type classes with functional dependencies
+--
+-- * parameters of type class assertions are unrestricted
+--
+-- * 'forall' types as universal and existential quantification
+--
+-- * pattern guards
+--
+-- * implicit parameters
+--
+-- * generalised algebraic data types
+--
+-- * template haskell
+--
+-- * empty data type declarations
+--
+-- * unboxed tuples
+--
+-- * regular patterns (HaRP)
+--
+-- * HSP-style XML expressions and patterns (HSP)
+--
+-- Also worth noting is that (n+k) patterns from Haskell 98 are not supported
+-----------------------------------------------------------------------------
+
+module Preprocessor.Hsx.Syntax (
+ -- * Modules
+ HsModule(..), HsPragma(..), HsExportSpec(..),
+ HsImportDecl(..), HsImportSpec(..), HsAssoc(..),
+ -- * Declarations
+ HsDecl(..), HsBinds(..), HsIPBind(..),
+ HsGadtDecl(..), HsConDecl(..), HsQualConDecl(..), HsBangType(..),
+ HsMatch(..), HsRhs(..), HsGuardedRhs(..),
+ -- * Class Assertions and Contexts
+ HsContext, HsFunDep(..), HsAsst(..),
+ -- * Types
+ HsType(..), HsBoxed(..),
+ -- * Expressions
+ HsExp(..), HsStmt(..), HsFieldUpdate(..),
+ HsAlt(..), HsGuardedAlts(..), HsGuardedAlt(..),
+ -- * Patterns
+ HsPat(..), HsPatField(..),
+ -- * Literals
+ HsLiteral(..),
+ -- * Variables, Constructors and Operators
+ Module(..), HsQName(..), HsName(..), HsQOp(..), HsOp(..),
+ HsSpecialCon(..), HsCName(..), HsIPName(..),
+
+ -- * Template Haskell
+ HsReify(..), HsBracket(..), HsSplice(..),
+
+ -- * HaRP
+ HsRPat(..),
+
+ -- * Hsx
+ HsXAttr(..), HsXName(..), HsPXAttr(..),
+
+ -- * FFI
+ HsSafety(..), HsCallConv(..),
+
+ -- * Builtin names
+
+ -- ** Modules
+ prelude_mod, main_mod,
+ -- ** Main function of a program
+ main_name,
+ -- ** Constructors
+ unit_con_name, tuple_con_name, list_cons_name,
+ unit_con, tuple_con,
+ -- ** Special identifiers
+ as_name, qualified_name, hiding_name, minus_name, pling_name, dot_name,
+ export_name, safe_name, unsafe_name, threadsafe_name, stdcall_name, ccall_name,
+ -- ** Type constructors
+ unit_tycon_name, fun_tycon_name, list_tycon_name, tuple_tycon_name,
+ unit_tycon, fun_tycon, list_tycon, tuple_tycon,
+
+ -- * Source coordinates
+ SrcLoc(..),
+ ) where
+
+
+#ifdef __GLASGOW_HASKELL__
+import Data.Generics.Basics
+import Data.Generics.Instances
+#endif
+
+-- | A position in the source.
+data SrcLoc = SrcLoc {
+ srcFilename :: String,
+ srcLine :: Int,
+ srcColumn :: Int
+ }
+#ifdef __GLASGOW_HASKELL__
+ deriving (Eq,Ord,Show,Typeable,Data)
+#else
+ deriving (Eq,Ord,Show)
+#endif
+
+-- | The name of a Haskell module.
+newtype Module = Module String
+#ifdef __GLASGOW_HASKELL__
+ deriving (Eq,Ord,Show,Typeable,Data)
+#else
+ deriving (Eq,Ord,Show)
+#endif
+
+-- | Constructors with special syntax.
+-- These names are never qualified, and always refer to builtin type or
+-- data constructors.
+
+data HsSpecialCon
+ = HsUnitCon -- ^ unit type and data constructor @()@
+ | HsListCon -- ^ list type constructor @[]@
+ | HsFunCon -- ^ function type constructor @->@
+ | HsTupleCon Int -- ^ /n/-ary tuple type and data
+ -- constructors @(,)@ etc
+ | HsCons -- ^ list data constructor @(:)@
+#ifdef __GLASGOW_HASKELL__
+ deriving (Eq,Ord,Show,Typeable,Data)
+#else
+ deriving (Eq,Ord,Show)
+#endif
+
+-- | This type is used to represent qualified variables, and also
+-- qualified constructors.
+data HsQName
+ = Qual Module HsName -- ^ name qualified with a module name
+ | UnQual HsName -- ^ unqualified name
+ | Special HsSpecialCon -- ^ built-in constructor with special syntax
+#ifdef __GLASGOW_HASKELL__
+ deriving (Eq,Ord,Show,Typeable,Data)
+#else
+ deriving (Eq,Ord,Show)
+#endif
+
+-- | This type is used to represent variables, and also constructors.
+data HsName
+ = HsIdent String -- ^ /varid/ or /conid/.
+ | HsSymbol String -- ^ /varsym/ or /consym/
+#ifdef __GLASGOW_HASKELL__
+ deriving (Eq,Ord,Show,Typeable,Data)
+#else
+ deriving (Eq,Ord,Show)
+#endif
+
+-- | This type is used to represent implicit parameter names.
+data HsIPName
+ = HsIPDup String -- ?x
+ | HsIPLin String -- %x
+#ifdef __GLASGOW_HASKELL__
+ deriving (Eq,Ord,Show,Typeable,Data)
+#else
+ deriving (Eq,Ord,Show)
+#endif
+
+-- | Possibly qualified infix operators (/qop/), appearing in expressions.
+data HsQOp
+ = HsQVarOp HsQName -- ^ variable operator (/qvarop/)
+ | HsQConOp HsQName -- ^ constructor operator (/qconop/)
+#ifdef __GLASGOW_HASKELL__
+ deriving (Eq,Ord,Show,Typeable,Data)
+#else
+ deriving (Eq,Ord,Show)
+#endif
+
+-- | Operators, appearing in @infix@ declarations.
+data HsOp
+ = HsVarOp HsName -- ^ variable operator (/varop/)
+ | HsConOp HsName -- ^ constructor operator (/conop/)
+#ifdef __GLASGOW_HASKELL__
+ deriving (Eq,Ord,Show,Typeable,Data)
+#else
+ deriving (Eq,Ord,Show)
+#endif
+
+-- | A name (/cname/) of a component of a class or data type in an @import@
+-- or export specification.
+data HsCName
+ = HsVarName HsName -- ^ name of a method or field
+ | HsConName HsName -- ^ name of a data constructor
+#ifdef __GLASGOW_HASKELL__
+ deriving (Eq,Ord,Show,Typeable,Data)
+#else
+ deriving (Eq,Ord,Show)
+#endif
+
+-- | A Haskell source module.
+data HsModule = HsModule SrcLoc [HsPragma] Module (Maybe [HsExportSpec])
+ [HsImportDecl] [HsDecl]
+#ifdef __GLASGOW_HASKELL__
+ deriving (Show,Typeable,Data)
+#else
+ deriving (Show)
+#endif
+
+-- | A pragma at the beginning of a module.
+data HsPragma = HsPragma String
+#ifdef __GLASGOW_HASKELL__
+ deriving (Show,Typeable,Data)
+#else
+ deriving (Show)
+#endif
+
+-- | Export specification.
+data HsExportSpec
+ = HsEVar HsQName -- ^ variable
+ | HsEAbs HsQName -- ^ @T@:
+ -- a class or datatype exported abstractly,
+ -- or a type synonym.
+ | HsEThingAll HsQName -- ^ @T(..)@:
+ -- a class exported with all of its methods, or
+ -- a datatype exported with all of its constructors.
+ | HsEThingWith HsQName [HsCName] -- ^ @T(C_1,...,C_n)@:
+ -- a class exported with some of its methods, or
+ -- a datatype exported with some of its constructors.
+ | HsEModuleContents Module -- ^ @module M@:
+ -- re-export a module.
+#ifdef __GLASGOW_HASKELL__
+ deriving (Eq,Show,Typeable,Data)
+#else
+ deriving (Eq,Show)
+#endif
+
+-- | Import declaration.
+data HsImportDecl = HsImportDecl
+ { importLoc :: SrcLoc -- ^ position of the @import@ keyword.
+ , importModule :: Module -- ^ name of the module imported.
+ , importQualified :: Bool -- ^ imported @qualified@?
+ , importAs :: Maybe Module -- ^ optional alias name in an
+ -- @as@ clause.
+ , importSpecs :: Maybe (Bool,[HsImportSpec])
+ -- ^ optional list of import specifications.
+ -- The 'Bool' is 'True' if the names are excluded
+ -- by @hiding at .
+ }
+#ifdef __GLASGOW_HASKELL__
+ deriving (Eq,Show,Typeable,Data)
+#else
+ deriving (Eq,Show)
+#endif
+
+-- | Import specification.
+data HsImportSpec
+ = HsIVar HsName -- ^ variable
+ | HsIAbs HsName -- ^ @T@:
+ -- the name of a class, datatype or type synonym.
+ | HsIThingAll HsName -- ^ @T(..)@:
+ -- a class imported with all of its methods, or
+ -- a datatype imported with all of its constructors.
+ | HsIThingWith HsName [HsCName] -- ^ @T(C_1,...,C_n)@:
+ -- a class imported with some of its methods, or
+ -- a datatype imported with some of its constructors.
+#ifdef __GLASGOW_HASKELL__
+ deriving (Eq,Show,Typeable,Data)
+#else
+ deriving (Eq,Show)
+#endif
+
+-- | Associativity of an operator.
+data HsAssoc
+ = HsAssocNone -- ^ non-associative operator (declared with @infix@)
+ | HsAssocLeft -- ^ left-associative operator (declared with @infixl@).
+ | HsAssocRight -- ^ right-associative operator (declared with @infixr@)
+#ifdef __GLASGOW_HASKELL__
+ deriving (Eq,Show,Typeable,Data)
+#else
+ deriving (Eq,Show)
+#endif
+
+data HsDecl
+ = HsTypeDecl SrcLoc HsName [HsName] HsType
+ | HsDataDecl SrcLoc HsContext HsName [HsName] [HsQualConDecl] [HsQName]
+ | HsGDataDecl SrcLoc HsContext HsName [HsName] [HsGadtDecl] {-no deriving-}
+ | HsInfixDecl SrcLoc HsAssoc Int [HsOp]
+ | HsNewTypeDecl SrcLoc HsContext HsName [HsName] HsQualConDecl [HsQName]
+ | HsClassDecl SrcLoc HsContext HsName [HsName] [HsFunDep] [HsDecl]
+ | HsInstDecl SrcLoc HsContext HsQName [HsType] [HsDecl]
+ | HsDefaultDecl SrcLoc [HsType]
+ | HsSpliceDecl SrcLoc HsSplice
+ | HsTypeSig SrcLoc [HsName] HsType
+ | HsFunBind [HsMatch]
+ | HsPatBind SrcLoc HsPat HsRhs {-where-} HsBinds
+ | HsForImp SrcLoc HsCallConv HsSafety String HsName HsType
+ | HsForExp SrcLoc HsCallConv String HsName HsType
+#ifdef __GLASGOW_HASKELL__
+ deriving (Eq,Show,Typeable,Data)
+#else
+ deriving (Eq,Show)
+#endif
+
+data HsBinds
+ = HsBDecls [HsDecl]
+ | HsIPBinds [HsIPBind]
+#ifdef __GLASGOW_HASKELL__
+ deriving (Eq,Show,Typeable,Data)
+#else
+ deriving (Eq,Show)
+#endif
+
+data HsIPBind = HsIPBind SrcLoc HsIPName HsExp
+#ifdef __GLASGOW_HASKELL__
+ deriving (Eq,Show,Typeable,Data)
+#else
+ deriving (Eq,Show)
+#endif
+
+-- | Clauses of a function binding.
+data HsMatch
+ = HsMatch SrcLoc HsName [HsPat] HsRhs {-where-} HsBinds
+#ifdef __GLASGOW_HASKELL__
+ deriving (Eq,Show,Typeable,Data)
+#else
+ deriving (Eq,Show)
+#endif
+
+data HsQualConDecl
+ = HsQualConDecl SrcLoc
+ {-forall-} [HsName] {- . -} HsContext
+ {- => -} HsConDecl
+#ifdef __GLASGOW_HASKELL__
+ deriving (Eq,Show,Typeable,Data)
+#else
+ deriving (Eq,Show)
+#endif
+
+data HsGadtDecl
+ = HsGadtDecl SrcLoc HsName HsType
+#ifdef __GLASGOW_HASKELL__
+ deriving (Eq,Show,Typeable,Data)
+#else
+ deriving (Eq,Show)
+#endif
+
+-- | Declaration of a data constructor.
+data HsConDecl
+ = HsConDecl HsName [HsBangType]
+ -- ^ ordinary data constructor
+ | HsRecDecl HsName [([HsName],HsBangType)]
+ -- ^ record constructor
+#ifdef __GLASGOW_HASKELL__
+ deriving (Eq,Show,Typeable,Data)
+#else
+ deriving (Eq,Show)
+#endif
+
+-- | The type of a constructor argument or field, optionally including
+-- a strictness annotation.
+data HsBangType
+ = HsBangedTy HsType -- ^ strict component, marked with \"@!@\"
+ | HsUnBangedTy HsType -- ^ non-strict component
+#ifdef __GLASGOW_HASKELL__
+ deriving (Eq,Show,Typeable,Data)
+#else
+ deriving (Eq,Show)
+#endif
+
+-- | The right hand side of a function or pattern binding.
+data HsRhs
+ = HsUnGuardedRhs HsExp -- ^ unguarded right hand side (/exp/)
+ | HsGuardedRhss [HsGuardedRhs]
+ -- ^ guarded right hand side (/gdrhs/)
+#ifdef __GLASGOW_HASKELL__
+ deriving (Eq,Show,Typeable,Data)
+#else
+ deriving (Eq,Show)
+#endif
+-- | A guarded right hand side @|@ /exp/ @=@ /exp/.
+-- The first expression will be Boolean-valued.
+data HsGuardedRhs
+ = HsGuardedRhs SrcLoc [HsStmt] HsExp
+#ifdef __GLASGOW_HASKELL__
+ deriving (Eq,Show,Typeable,Data)
+#else
+ deriving (Eq,Show)
+#endif
+
+-- | A type qualified with a context.
+-- An unqualified type has an empty context.
+
+data HsType
+ = HsTyForall
+ (Maybe [HsName])
+ HsContext
+ HsType
+ | HsTyFun HsType HsType -- ^ function type
+ | HsTyTuple HsBoxed [HsType] -- ^ tuple type, possibly boxed
+ | HsTyApp HsType HsType -- ^ application of a type constructor
+ | HsTyVar HsName -- ^ type variable
+ | HsTyCon HsQName -- ^ named type or type constructor
+ | HsTyPred HsAsst -- ^ assertion of an implicit parameter
+ | HsTyInfix HsType HsQName HsType -- ^ infix type constructor
+#ifdef __GLASGOW_HASKELL__
+ deriving (Eq,Show,Typeable,Data)
+#else
+ deriving (Eq,Show)
+#endif
+
+data HsBoxed = Boxed | Unboxed
+#ifdef __GLASGOW_HASKELL__
+ deriving (Eq,Show,Typeable,Data)
+#else
+ deriving (Eq,Show)
+#endif
+
+
+-- | A functional dependency, given on the form
+-- l1 l2 ... ln -> r2 r3 .. rn
+data HsFunDep
+ = HsFunDep [HsName] [HsName]
+#ifdef __GLASGOW_HASKELL__
+ deriving (Eq,Show,Typeable,Data)
+#else
+ deriving (Eq,Show)
+#endif
+
+
+type HsContext = [HsAsst]
+
+-- | Class assertions.
+-- In Haskell 98, the argument would be a /tyvar/, but this definition
+-- allows multiple parameters, and allows them to be /type/s.
+-- Also extended with support for implicit parameters.
+data HsAsst = HsClassA HsQName [HsType]
+ | HsIParam HsIPName HsType
+#ifdef __GLASGOW_HASKELL__
+ deriving (Eq,Show,Typeable,Data)
+#else
+ deriving (Eq,Show)
+#endif
+
+-- | /literal/
+-- Values of this type hold the abstract value of the literal, not the
+-- precise string representation used. For example, @10@, @0o12@ and @0xa@
+-- have the same representation.
+data HsLiteral
+ = HsChar Char -- ^ character literal
+ | HsString String -- ^ string literal
+ | HsInt Integer -- ^ integer literal
+ | HsFrac Rational -- ^ floating point literal
+ | HsCharPrim Char -- ^ GHC unboxed character literal
+ | HsStringPrim String -- ^ GHC unboxed string literal
+ | HsIntPrim Integer -- ^ GHC unboxed integer literal
+ | HsFloatPrim Rational -- ^ GHC unboxed float literal
+ | HsDoublePrim Rational -- ^ GHC unboxed double literal
+#ifdef __GLASGOW_HASKELL__
+ deriving (Eq,Show,Typeable,Data)
+#else
+ deriving (Eq,Show)
+#endif
+
+-- | Haskell expressions.
+--
+-- /Notes:/
+--
+-- * Because it is difficult for parsers to distinguish patterns from
+-- expressions, they typically parse them in the same way and then check
+-- that they have the appropriate form. Hence the expression type
+-- includes some forms that are found only in patterns. After these
+-- checks, these constructors should not be used.
+--
+-- * The parser does not take precedence and associativity into account,
+-- so it will leave 'HsInfixApp's associated to the left.
+--
+-- * The 'Preprocessor.Pretty.Pretty' instance for 'HsExp' does not
+-- add parentheses in printing.
+
+data HsExp
+ = HsVar HsQName -- ^ variable
+ | HsIPVar HsIPName -- ^ implicit parameter variable
+ | HsCon HsQName -- ^ data constructor
+ | HsLit HsLiteral -- ^ literal constant
+ | HsInfixApp HsExp HsQOp HsExp -- ^ infix application
+ | HsApp HsExp HsExp -- ^ ordinary application
+ | HsNegApp HsExp -- ^ negation expression @-@ /exp/
+ | HsLambda SrcLoc [HsPat] HsExp -- ^ lambda expression
+ | HsLet HsBinds HsExp -- ^ local declarations with @let@
+ | HsDLet [HsIPBind] HsExp -- ^ local declarations of implicit parameters (hugs)
+ | HsWith HsExp [HsIPBind] -- ^ local declarations of implicit parameters
+ | HsIf HsExp HsExp HsExp -- ^ @if@ /exp/ @then@ /exp/ @else@ /exp/
+ | HsCase HsExp [HsAlt] -- ^ @case@ /exp/ @of@ /alts/
+ | HsDo [HsStmt] -- ^ @do at -expression:
+ -- the last statement in the list
+ -- should be an expression.
+ | HsMDo [HsStmt] -- ^ @mdo at -expression
+ | HsTuple [HsExp] -- ^ tuple expression
+ | HsList [HsExp] -- ^ list expression
+ | HsParen HsExp -- ^ parenthesized expression
+ | HsLeftSection HsExp HsQOp -- ^ left section @(@/exp/ /qop/@)@
+ | HsRightSection HsQOp HsExp -- ^ right section @(@/qop/ /exp/@)@
+ | HsRecConstr HsQName [HsFieldUpdate]
+ -- ^ record construction expression
+ | HsRecUpdate HsExp [HsFieldUpdate]
+ -- ^ record update expression
+ | HsEnumFrom HsExp -- ^ unbounded arithmetic sequence,
+ -- incrementing by 1
+ | HsEnumFromTo HsExp HsExp -- ^ bounded arithmetic sequence,
+ -- incrementing by 1
+ | HsEnumFromThen HsExp HsExp -- ^ unbounded arithmetic sequence,
+ -- with first two elements given
+ | HsEnumFromThenTo HsExp HsExp HsExp
+ -- ^ bounded arithmetic sequence,
+ -- with first two elements given
+ | HsListComp HsExp [HsStmt] -- ^ list comprehension
+ | HsExpTypeSig SrcLoc HsExp HsType
+ -- ^ expression type signature
+ | HsAsPat HsName HsExp -- ^ patterns only
+ | HsWildCard -- ^ patterns only
+ | HsIrrPat HsExp -- ^ patterns only
+
+-- HaRP
+ | HsRPats SrcLoc [HsExp] -- ^ regular patterns only
+ | HsSeqRP [HsExp] -- ^ regular patterns only
+ | HsStarRP HsExp -- ^ regular patterns only
+ | HsStarGRP HsExp -- ^ regular patterns only
+ | HsPlusRP HsExp -- ^ regular patterns only
+ | HsPlusGRP HsExp -- ^ regular patterns only
+ | HsOptRP HsExp -- ^ regular patterns only
+ | HsOptGRP HsExp -- ^ regular patterns only
+ | HsEitherRP HsExp HsExp -- ^ regular patterns only
+ | HsCAsRP HsName HsExp -- ^ regular patterns only
+
+-- Template Haskell
+ | HsReifyExp HsReify
+ | HsBracketExp HsBracket
+ | HsSpliceExp HsSplice
+
+-- Hsx
+ | HsXTag SrcLoc HsXName [HsXAttr] (Maybe HsExp) [HsExp]
+ | HsXETag SrcLoc HsXName [HsXAttr] (Maybe HsExp)
+ | HsXPcdata String
+ | HsXExpTag HsExp
+
+-- Functor sugar
+ | HsFunctorUnit HsExp
+ | HsFunctorCall HsExp
+#ifdef __GLASGOW_HASKELL__
+ deriving (Eq,Show,Typeable,Data)
+#else
+ deriving (Eq,Show)
+#endif
+
+data HsXName
+ = HsXName String -- <name ...
+ | HsXDomName String String -- <dom:name ...
+#ifdef __GLASGOW_HASKELL__
+ deriving (Eq,Show,Typeable,Data)
+#else
+ deriving (Eq,Show)
+#endif
+
+data HsXAttr = HsXAttr HsXName HsExp
+#ifdef __GLASGOW_HASKELL__
+ deriving (Eq,Show,Typeable,Data)
+#else
+ deriving (Eq,Show)
+#endif
+
+data HsReify
+ = HsReifyType HsQName
+ | HsReifyDecl HsQName
+ | HsReifyFixity HsQName
+#ifdef __GLASGOW_HASKELL__
+ deriving (Eq,Show,Typeable,Data)
+#else
+ deriving (Eq,Show)
+#endif
+
+data HsBracket
+ = HsExpBracket HsExp
+ | HsPatBracket HsPat
+ | HsTypeBracket HsType
+ | HsDeclBracket [HsDecl]
+#ifdef __GLASGOW_HASKELL__
+ deriving (Eq,Show,Typeable,Data)
+#else
+ deriving (Eq,Show)
+#endif
+
+data HsSplice
+ = HsIdSplice String
+ | HsParenSplice HsExp
+#ifdef __GLASGOW_HASKELL__
+ deriving (Eq,Show,Typeable,Data)
+#else
+ deriving (Eq,Show)
+#endif
+
+
+-- FFI stuff
+data HsSafety
+ = PlayRisky
+ | PlaySafe Bool
+#ifdef __GLASGOW_HASKELL__
+ deriving (Eq,Show,Typeable,Data)
+#else
+ deriving (Eq,Show)
+#endif
+
+data HsCallConv
+ = StdCall
+ | CCall
+#ifdef __GLASGOW_HASKELL__
+ deriving (Eq,Show,Typeable,Data)
+#else
+ deriving (Eq,Show)
+#endif
+
+
+
+-- | A pattern, to be matched against a value.
+data HsPat
+ = HsPVar HsName -- ^ variable
+ | HsPLit HsLiteral -- ^ literal constant
+ | HsPNeg HsPat -- ^ negated pattern
+ | HsPInfixApp HsPat HsQName HsPat
+ -- ^ pattern with infix data constructor
+ | HsPApp HsQName [HsPat] -- ^ data constructor and argument
+ -- patterns
+ | HsPTuple [HsPat] -- ^ tuple pattern
+ | HsPList [HsPat] -- ^ list pattern
+ | HsPParen HsPat -- ^ parenthesized pattern
+ | HsPRec HsQName [HsPatField] -- ^ labelled pattern
+ | HsPAsPat HsName HsPat -- ^ @\@@-pattern
+ | HsPWildCard -- ^ wildcard pattern (@_@)
+ | HsPIrrPat HsPat -- ^ irrefutable pattern (@~@)
+ | HsPatTypeSig SrcLoc HsPat HsType
+ -- ^ pattern type signature
+
+-- HaRP
+ | HsPRPat SrcLoc [HsRPat] -- ^ regular pattern (HaRP)
+-- Hsx
+ | HsPXTag SrcLoc HsXName [HsPXAttr] (Maybe HsPat) HsPat
+ -- ^ XML tag pattern
+ | HsPXETag SrcLoc HsXName [HsPXAttr] (Maybe HsPat)
+ -- ^ XML singleton tag pattern
+ | HsPXPcdata String
+ -- ^ XML PCDATA pattern
+ | HsPXPatTag HsPat
+ -- ^ XML embedded pattern
+#ifdef __GLASGOW_HASKELL__
+ deriving (Eq,Show,Typeable,Data)
+#else
+ deriving (Eq,Show)
+#endif
+
+-- | An XML attribute in an XML tag pattern
+data HsPXAttr = HsPXAttr HsXName HsPat
+#ifdef __GLASGOW_HASKELL__
+ deriving (Eq,Show,Typeable,Data)
+#else
+ deriving (Eq,Show)
+#endif
+
+-- | An entity in a regular pattern (HaRP)
+data HsRPat
+ = HsRPStar HsRPat
+ | HsRPStarG HsRPat
+ | HsRPPlus HsRPat
+ | HsRPPlusG HsRPat
+ | HsRPOpt HsRPat
+ | HsRPOptG HsRPat
+ | HsRPEither HsRPat HsRPat
+ | HsRPSeq [HsRPat]
+ | HsRPCAs HsName HsRPat
+ | HsRPAs HsName HsRPat
+ | HsRPParen HsRPat
+ | HsRPPat HsPat
+#ifdef __GLASGOW_HASKELL__
+ deriving (Eq,Show,Typeable,Data)
+#else
+ deriving (Eq,Show)
+#endif
+
+-- | An /fpat/ in a labeled record pattern.
+data HsPatField
+ = HsPFieldPat HsQName HsPat
+#ifdef __GLASGOW_HASKELL__
+ deriving (Eq,Show,Typeable,Data)
+#else
+ deriving (Eq,Show)
+#endif
+
+-- | This type represents both /stmt/ in a @do at -expression,
+-- and /qual/ in a list comprehension, as well as /stmt/
+-- in a pattern guard.
+data HsStmt
+ = HsGenerator SrcLoc HsPat HsExp
+ -- ^ a generator /pat/ @<-@ /exp/
+ | HsQualifier HsExp -- ^ an /exp/ by itself: in a @do at -expression,
+ -- an action whose result is discarded;
+ -- in a list comprehension, a guard expression
+ | HsLetStmt HsBinds -- ^ local bindings
+#ifdef __GLASGOW_HASKELL__
+ deriving (Eq,Show,Typeable,Data)
+#else
+ deriving (Eq,Show)
+#endif
+
+-- | An /fbind/ in a labeled construction or update.
+data HsFieldUpdate
+ = HsFieldUpdate HsQName HsExp
+#ifdef __GLASGOW_HASKELL__
+ deriving (Eq,Show,Typeable,Data)
+#else
+ deriving (Eq,Show)
+#endif
+
+-- | An /alt/ in a @case@ expression.
+data HsAlt
+ = HsAlt SrcLoc HsPat HsGuardedAlts HsBinds
+#ifdef __GLASGOW_HASKELL__
+ deriving (Eq,Show,Typeable,Data)
+#else
+ deriving (Eq,Show)
+#endif
+
+data HsGuardedAlts
+ = HsUnGuardedAlt HsExp -- ^ @->@ /exp/
+ | HsGuardedAlts [HsGuardedAlt] -- ^ /gdpat/
+#ifdef __GLASGOW_HASKELL__
+ deriving (Eq,Show,Typeable,Data)
+#else
+ deriving (Eq,Show)
+#endif
+
+-- | A guarded alternative @|@ /stmt/, ... , /stmt/ @->@ /exp/.
+data HsGuardedAlt
+ = HsGuardedAlt SrcLoc [HsStmt] HsExp
+#ifdef __GLASGOW_HASKELL__
+ deriving (Eq,Show,Typeable,Data)
+#else
+ deriving (Eq,Show)
+#endif
+
+-----------------------------------------------------------------------------
+-- Builtin names.
+
+prelude_mod, main_mod :: Module
+prelude_mod = Module "Prelude"
+main_mod = Module "Main"
+
+main_name :: HsName
+main_name = HsIdent "main"
+
+unit_con_name :: HsQName
+unit_con_name = Special HsUnitCon
+
+tuple_con_name :: Int -> HsQName
+tuple_con_name i = Special (HsTupleCon (i+1))
+
+list_cons_name :: HsQName
+list_cons_name = Special HsCons
+
+unit_con :: HsExp
+unit_con = HsCon unit_con_name
+
+tuple_con :: Int -> HsExp
+tuple_con i = HsCon (tuple_con_name i)
+
+as_name, qualified_name, hiding_name, minus_name, pling_name, dot_name :: HsName
+as_name = HsIdent "as"
+qualified_name = HsIdent "qualified"
+hiding_name = HsIdent "hiding"
+minus_name = HsSymbol "-"
+pling_name = HsSymbol "!"
+dot_name = HsSymbol "."
+
+export_name, safe_name, unsafe_name, threadsafe_name, stdcall_name, ccall_name :: HsName
+export_name = HsIdent "export"
+safe_name = HsIdent "safe"
+unsafe_name = HsIdent "unsafe"
+threadsafe_name = HsIdent "threadsafe"
+stdcall_name = HsIdent "stdcall"
+ccall_name = HsIdent "ccall"
+
+unit_tycon_name, fun_tycon_name, list_tycon_name :: HsQName
+unit_tycon_name = unit_con_name
+fun_tycon_name = Special HsFunCon
+list_tycon_name = Special HsListCon
+
+tuple_tycon_name :: Int -> HsQName
+tuple_tycon_name i = tuple_con_name i
+
+unit_tycon, fun_tycon, list_tycon :: HsType
+unit_tycon = HsTyCon unit_tycon_name
+fun_tycon = HsTyCon fun_tycon_name
+list_tycon = HsTyCon list_tycon_name
+
+tuple_tycon :: Int -> HsType
+tuple_tycon i = HsTyCon (tuple_tycon_name i)
diff -rN -u old-fenfire-hs/Preprocessor/Hsx/Transform.hs new-fenfire-hs/Preprocessor/Hsx/Transform.hs
--- old-fenfire-hs/Preprocessor/Hsx/Transform.hs 1970-01-01 02:00:00.000000000 +0200
+++ new-fenfire-hs/Preprocessor/Hsx/Transform.hs 2007-02-12 19:32:17.000000000 +0200
@@ -0,0 +1,1797 @@
+-----------------------------------------------------------------------------
+-- |
+-- Module : Preprocessor.Harp.Tranform
+-- Copyright : (c) Niklas Broberg 2004,
+-- License : BSD-style (see the file LICENSE.txt)
+--
+-- Maintainer : Niklas Broberg, d00nibro at dtek.chalmers.se
+-- Stability : experimental
+-- Portability : portable
+--
+-- Functions for transforming abstract Haskell code extended with regular
+-- patterns into semantically equivalent normal abstract Haskell code. In
+-- other words, we transform away regular patterns.
+-----------------------------------------------------------------------------
+
+module Preprocessor.Hsx.Transform (
+ transform -- :: HsModule -> HsModule
+ ) where
+
+import Preprocessor.Hsx.Syntax
+import Preprocessor.Hsx.Build
+import Data.List (union)
+
+import Debug.Trace (trace)
+
+-----------------------------------------------------------------------------
+-- A monad for threading a boolean value through the boilerplate code,
+-- to signal whether a transformation has taken place or not.
+
+newtype HsxM a = MkHsxM (HsxState -> (a, HsxState))
+
+instance Monad HsxM where
+ return x = MkHsxM (\s -> (x,s))
+ (MkHsxM f) >>= k = MkHsxM (\s -> let (a, s') = f s
+ (MkHsxM f') = k a
+ in f' s')
+
+getHsxState :: HsxM HsxState
+getHsxState = MkHsxM (\s -> (s, s))
+
+setHsxState :: HsxState -> HsxM ()
+setHsxState s = MkHsxM (\_ -> ((),s))
+
+instance Functor HsxM where
+ fmap f hma = do a <- hma
+ return $ f a
+
+-----
+
+type HsxState = (Bool, Bool)
+
+initHsxState :: HsxState
+initHsxState = (False, False)
+
+setHarpTransformed :: HsxM ()
+setHarpTransformed =
+ do (_,x) <- getHsxState
+ setHsxState (True,x)
+
+setXmlTransformed :: HsxM ()
+setXmlTransformed =
+ do (h,_) <- getHsxState
+ setHsxState (h,True)
+
+runHsxM :: HsxM a -> (a, (Bool, Bool))
+runHsxM (MkHsxM f) = f initHsxState
+
+-----------------------------------------------------------------------------
+-- Traversing and transforming the syntax tree
+
+
+-- | Transform away occurences of regular patterns from an abstract
+-- Haskell module, preserving semantics.
+transform :: HsModule -> HsModule
+transform (HsModule s prags m mes is decls) =
+ let (decls', (harp, hsx)) = runHsxM $ mapM transformDecl decls
+ -- We may need to add an import for Match.hs that defines the matcher monad
+ imps1 = if harp
+ then (:) $ HsImportDecl s match_mod True
+ (Just match_qual_mod)
+ Nothing
+ else id
+ imps2 = {- if hsx
+ then (:) $ HsImportDecl s hsx_data_mod False
+ Nothing
+ Nothing
+ else -} id -- we no longer want to import HSP.Data
+ imps3 = if True --functor
+ then (:) $ HsImportDecl s functor_qual_mod True
+ Nothing
+ Nothing
+ else id
+ prags' = HsPragma " OPTIONS_GHC -fth " : prags
+ in HsModule s prags' m mes (imps1 $ imps2 $ imps3 is) decls'
+
+-----------------------------------------------------------------------------
+-- Declarations
+
+-- | Transform a declaration by transforming subterms that could
+-- contain regular patterns.
+transformDecl :: HsDecl -> HsxM HsDecl
+transformDecl d = case d of
+ -- Pattern binds can contain regular patterns in the pattern being bound
+ -- as well as on the right-hand side and in declarations in a where clause
+ HsPatBind srcloc pat rhs decls -> do
+ -- Preserve semantics of irrefutable regular patterns by postponing
+ -- their evaluation to a let-expression on the right-hand side
+ let ([pat'], rnpss) = unzip $ renameIrrPats [pat]
+ -- Transform the pattern itself
+ ([pat''], attrGuards, guards, decls'') <- transformPatterns [pat']
+ -- Transform the right-hand side, and add any generated guards
+ -- and let expressions to it
+ rhs' <- mkRhs srcloc (attrGuards ++ guards) (concat rnpss) rhs
+ -- Transform declarations in the where clause, adding any generated
+ -- declarations to it
+ decls' <- case decls of
+ HsBDecls ds -> do ds' <- transformLetDecls ds
+ return $ HsBDecls $ decls'' ++ ds'
+ _ -> error "Cannot bind implicit parameters in the \
+ \ \'where\' clause of a function using regular patterns."
+ return $ HsPatBind srcloc pat'' rhs' decls'
+
+ -- Function binds can contain regular patterns in their matches
+ HsFunBind ms -> fmap HsFunBind $ mapM transformMatch ms
+ -- Instance declarations can contain regular patterns in the
+ -- declarations of functions inside it
+ HsInstDecl s c n ts decls ->
+ fmap (HsInstDecl s c n ts) $ mapM transformDecl decls
+ -- Class declarations can contain regular patterns in the
+ -- declarations of automatically instantiated functions
+ HsClassDecl s c n ns ds decls ->
+ fmap (HsClassDecl s c n ns ds) $ mapM transformDecl decls
+ -- Type signatures, type, newtype or data declarations, infix declarations
+ -- and default declarations; none can contain regular patterns
+ _ -> return d
+
+
+-- | Transform a function "match" by generating pattern guards and
+-- declarations representing regular patterns in the argument list.
+-- Subterms, such as guards and the right-hand side, are also traversed
+-- transformed.
+transformMatch :: HsMatch -> HsxM HsMatch
+transformMatch (HsMatch srcloc name pats rhs decls) = do
+ -- Preserve semantics of irrefutable regular patterns by postponing
+ -- their evaluation to a let-expression on the right-hand side
+ let (pats', rnpss) = unzip $ renameIrrPats pats
+ -- Transform the patterns that stand as arguments to the function
+ (pats'', attrGuards, guards, decls'') <- transformPatterns pats'
+ -- Transform the right-hand side, and add any generated guards
+ -- and let expressions to it
+ rhs' <- mkRhs srcloc (attrGuards ++ guards) (concat rnpss) rhs
+ -- Transform declarations in the where clause, adding any generated
+ -- declarations to it
+ decls' <- case decls of
+ HsBDecls ds -> do ds' <- transformLetDecls ds
+ return $ HsBDecls $ decls'' ++ ds'
+ _ -> error "Cannot bind implicit parameters in the \
+ \ \'where\' clause of a function using regular patterns."
+
+ return $ HsMatch srcloc name pats'' rhs' decls'
+-- | Transform and update guards and right-hand side of a function or
+-- pattern binding. The supplied list of guards is prepended to the
+-- original guards, and subterms are traversed and transformed.
+mkRhs :: SrcLoc -> [Guard] -> [(HsName, HsPat)] -> HsRhs -> HsxM HsRhs
+mkRhs srcloc guards rnps (HsUnGuardedRhs rhs) = do
+ -- Add the postponed patterns to the right-hand side by placing
+ -- them in a let-expression to make them lazily evaluated.
+ -- Then transform the whole right-hand side as an expression.
+ rhs' <- transformExp $ addLetDecls srcloc rnps rhs
+ case guards of
+ -- There were no guards before, and none should be added,
+ -- so we still have an unguarded right-hand side
+ [] -> return $ HsUnGuardedRhs rhs'
+ -- There are guards to add. These should be added as pattern
+ -- guards, i.e. as statements.
+ _ -> return $ HsGuardedRhss [HsGuardedRhs srcloc (map mkStmtGuard guards) rhs']
+mkRhs _ guards rnps (HsGuardedRhss gdrhss) = fmap HsGuardedRhss $ mapM (mkGRhs guards rnps) gdrhss
+ where mkGRhs :: [Guard] -> [(HsName, HsPat)] -> HsGuardedRhs -> HsxM HsGuardedRhs
+ mkGRhs gs rnps (HsGuardedRhs s oldgs rhs) = do
+ -- Add the postponed patterns to the right-hand side by placing
+ -- them in a let-expression to make them lazily evaluated.
+ -- Then transform the whole right-hand side as an expression.
+ rhs' <- transformExp $ addLetDecls s rnps rhs
+ -- Now there are guards, so first we need to transform those
+ oldgs' <- fmap concat $ mapM (transformStmt Guard) oldgs
+ -- ... and then prepend the newly generated ones, as statements
+ return $ HsGuardedRhs s ((map mkStmtGuard gs) ++ oldgs') rhs'
+
+-- | Place declarations of postponed regular patterns in a let-expression to
+-- make them lazy, in order to make them behave as irrefutable patterns.
+addLetDecls :: SrcLoc -> [(HsName, HsPat)] -> HsExp -> HsExp
+addLetDecls s [] e = e -- no declarations to add
+addLetDecls s rnps e =
+ -- Place all postponed patterns in the same let-expression
+ letE (map (mkDecl s) rnps) e
+
+-- | Make pattern binds from postponed regular patterns
+mkDecl :: SrcLoc -> (HsName, HsPat) -> HsDecl
+mkDecl srcloc (n,p) = patBind srcloc p (var n)
+
+------------------------------------------------------------------------------------
+-- Expressions
+
+-- | Transform expressions by traversing subterms.
+-- Of special interest are expressions that contain patterns as subterms,
+-- i.e. @let@, @case@ and lambda expressions, and also list comprehensions
+-- and @do at -expressions. All other expressions simply transform their
+-- sub-expressions, if any.
+-- Of special interest are of course also any xml expressions.
+transformExp :: HsExp -> HsxM HsExp
+transformExp e = case e of
+ -- A standard xml tag should be transformed into an element of the
+ -- XML datatype. Attributes should be made into a set of mappings,
+ -- and children should be transformed.
+ HsXTag _ name attrs mattr cs -> do
+ -- Hey Pluto, look, we have XML in our syntax tree!
+ setXmlTransformed
+ let -- ... make tuples of the attributes
+ as = map mkAttr attrs
+ -- ... transform the children
+ cs' <- mapM transformChild cs
+ -- ... and lift the values into the XML datatype.
+ return $ paren $ metaMkTag name as mattr cs'
+
+ where -- | Transform expressions appearing in child position of an xml tag.
+ -- Expressions are first transformed, then wrapped in a call to
+ -- @toXml at .
+ transformChild :: HsExp -> HsxM HsExp
+ transformChild e = do
+ -- Transform the expression
+ te <- transformExp e
+ -- ... and apply the overloaded toXMLs to it
+ return $ metaToXmls te
+
+ -- An empty xml tag should be transformed just as a standard tag,
+ -- only that there are no children,
+ HsXETag _ name attrs mattr -> do
+ -- ... 'tis the season to be jolly, falalalalaaaa....
+ setXmlTransformed
+ let -- ... make tuples of the attributes
+ as = map mkAttr attrs
+ -- ... and lift the values into the XML datatype.
+ return $ paren $ metaMkETag name as mattr
+ -- PCDATA should be lifted as a string into the XML datatype.
+ HsXPcdata pcdata -> do setXmlTransformed
+ return $ metaMkPcdata pcdata
+ -- Escaped expressions should be treated as just expressions.
+ HsXExpTag e -> do setXmlTransformed
+ transformExp e
+
+ -- Patterns as arguments to a lambda expression could be regular,
+ -- but we cannot put the evaluation here since a lambda expression
+ -- can have neither guards nor a where clause. Thus we must postpone
+ -- them to a case expressions on the right-hand side.
+ HsLambda s pats rhs -> do
+ let -- First rename regular patterns
+ (ps, rnpss) = unzip $ renameRPats pats
+ -- ... group them up to one big tuple
+ (rns, rps) = unzip (concat rnpss)
+ alt1 = alt s (pTuple rps) rhs
+ texp = varTuple rns
+ -- ... and put it all in a case expression, which
+ -- can then be transformed in the normal way.
+ e = if null rns then rhs else caseE texp [alt1]
+ rhs' <- transformExp e
+ return $ HsLambda s ps rhs'
+ -- A let expression can contain regular patterns in the declarations,
+ -- or in the expression that makes up the body of the let.
+ HsLet (HsBDecls ds) e -> do
+ -- Declarations appearing in a let expression must be transformed
+ -- in a special way due to scoping, see later documentation.
+ -- The body is transformed as a normal expression.
+ ds' <- transformLetDecls ds
+ e' <- transformExp e
+ return $ letE ds' e'
+ -- Bindings of implicit parameters can appear either in ordinary let
+ -- expressions (GHC), in dlet expressions (Hugs) or in a with clause
+ -- (both). Such bindings are transformed in a special way. The body
+ -- is transformed as a normal expression in all cases.
+ HsLet (HsIPBinds is) e -> do
+ is' <- mapM transformIPBind is
+ e' <- transformExp e
+ return $ HsLet (HsIPBinds is') e'
+ HsDLet ipbs e -> do
+ ipbs' <- mapM transformIPBind ipbs
+ e' <- transformExp e
+ return $ HsDLet ipbs' e'
+ HsWith e ipbs -> do
+ ipbs' <- mapM transformIPBind ipbs
+ e' <- transformExp e
+ return $ HsWith e' ipbs'
+ -- A case expression can contain regular patterns in the expression
+ -- that is the subject of the casing, or in either of the alternatives.
+ HsCase e alts -> do
+ e' <- transformExp e
+ alts' <- mapM transformAlt alts
+ return $ HsCase e' alts'
+ -- A do expression can contain regular patterns in its statements.
+ HsDo stmts -> do
+ stmts' <- fmap concat $ mapM (transformStmt Do) stmts
+ return $ HsDo stmts'
+ HsMDo stmts -> do
+ stmts' <- fmap concat $ mapM (transformStmt Do) stmts
+ return $ HsMDo stmts'
+ -- A list comprehension can contain regular patterns in the result
+ -- expression, or in any of its statements.
+ HsListComp e stmts -> do
+ e' <- transformExp e
+ stmts' <- fmap concat $ mapM (transformStmt ListComp) stmts
+ return $ HsListComp e' stmts'
+ -- All other expressions simply transform their immediate subterms.
+ HsInfixApp e1 op e2 -> transform2exp e1 e2
+ (\e1 e2 -> HsInfixApp e1 op e2)
+ HsApp e1 e2 -> transform2exp e1 e2 HsApp
+ HsNegApp e -> fmap HsNegApp $ transformExp e
+ HsIf e1 e2 e3 -> transform3exp e1 e2 e3 HsIf
+ HsTuple es -> fmap HsTuple $ mapM transformExp es
+ HsList es -> fmap HsList $ mapM transformExp es
+ HsParen e -> fmap HsParen $ transformExp e
+ HsLeftSection e op -> do e' <- transformExp e
+ return $ HsLeftSection e' op
+ HsRightSection op e -> fmap (HsRightSection op) $ transformExp e
+ HsRecConstr n fus -> fmap (HsRecConstr n) $ mapM transformFieldUpdate fus
+ HsRecUpdate e fus -> do e' <- transformExp e
+ fus' <- mapM transformFieldUpdate fus
+ return $ HsRecUpdate e' fus'
+ HsEnumFrom e -> fmap HsEnumFrom $ transformExp e
+ HsEnumFromTo e1 e2 -> transform2exp e1 e2 HsEnumFromTo
+ HsEnumFromThen e1 e2 -> transform2exp e1 e2 HsEnumFromThen
+ HsEnumFromThenTo e1 e2 e3 -> transform3exp e1 e2 e3 HsEnumFromThenTo
+ HsExpTypeSig s e t -> do e' <- transformExp e
+ return $ HsExpTypeSig s e' t
+ HsFunctorUnit e -> do e' <- transformExp e
+ return $ HsSpliceExp $ HsParenSplice $
+ app sugarFun $ HsBracketExp $
+ HsExpBracket e'
+ HsFunctorCall e -> do e' <- transformExp e
+ return $ paren $ app callFun e'
+ _ -> return e -- Warning! Does not work with TH bracketed expressions ([| ... |])
+
+ where transformFieldUpdate :: HsFieldUpdate -> HsxM HsFieldUpdate
+ transformFieldUpdate (HsFieldUpdate n e) =
+ fmap (HsFieldUpdate n) $ transformExp e
+
+ transform2exp :: HsExp -> HsExp -> (HsExp -> HsExp -> HsExp) -> HsxM HsExp
+ transform2exp e1 e2 f = do e1' <- transformExp e1
+ e2' <- transformExp e2
+ return $ f e1' e2'
+
+ transform3exp :: HsExp -> HsExp -> HsExp -> (HsExp -> HsExp -> HsExp -> HsExp) -> HsxM HsExp
+ transform3exp e1 e2 e3 f = do e1' <- transformExp e1
+ e2' <- transformExp e2
+ e3' <- transformExp e3
+ return $ f e1' e2' e3'
+
+ mkAttr :: HsXAttr -> HsExp
+ mkAttr (HsXAttr name e) =
+ paren (metaMkName name `metaAssign` e)
+
+
+-- | Transform pattern bind declarations inside a @let at -expression by transforming
+-- subterms that could appear as regular patterns, as well as transforming the bound
+-- pattern itself. The reason we need to do this in a special way is scoping, i.e.
+-- in the expression @let a | Just b <- match a = list in b@ the variable b will not
+-- be in scope after the @in at . And besides, we would be on thin ice even if it was in
+-- scope since we are referring to the pattern being bound in the guard that will
+-- decide if the pattern will be bound... yikes, why does Haskell allow guards on
+-- pattern binds to refer to the patterns being bound, could that ever lead to anything
+-- but an infinite loop??
+transformLetDecls :: [HsDecl] -> HsxM [HsDecl]
+transformLetDecls ds = do
+ -- We need to rename regular patterns in pattern bindings, since we need to
+ -- separate the generated declaration sets. This since we need to add them not
+ -- to the actual binding but rather to the declaration that will be the guard
+ -- of the binding.
+ let ds' = renameLetDecls ds
+ transformLDs 0 0 ds'
+ where transformLDs :: Int -> Int -> [HsDecl] -> HsxM [HsDecl]
+ transformLDs k l ds = case ds of
+ [] -> return []
+ (d:ds) -> case d of
+ HsPatBind srcloc pat rhs decls -> do
+ -- We need to transform all pattern bindings in a set of
+ -- declarations in the same context w.r.t. generating fresh
+ -- variable names, since they will all be in scope at the same time.
+ ([pat'], ags, gs, ws, k', l') <- runTrFromTo k l (trPatterns [pat])
+ decls' <- case decls of
+ -- Any declarations already in place should be left where they
+ -- are since they probably refer to the generating right-hand
+ -- side of the pattern bind. If they don't, we're in trouble...
+ HsBDecls decls -> fmap HsBDecls $ transformLetDecls decls
+ -- If they are implicit parameter bindings we simply transform
+ -- them as such.
+ HsIPBinds decls -> fmap HsIPBinds $ mapM transformIPBind decls
+ -- The generated guard, if any, should be a declaration, and the
+ -- generated declarations should be associated with it.
+ let gs' = case gs of
+ [] -> []
+ [g] -> [mkDeclGuard g ws]
+ _ -> error "This should not happen since we \
+ \ have called renameLetDecls already!"
+ -- Generated attribute guards should also be added as declarations,
+ -- but with no where clauses.
+ ags' = map (flip mkDeclGuard $ []) ags
+ -- We must transform the right-hand side as well, but there are
+ -- no new guards, nor any postponed patterns, to supply at this time.
+ rhs' <- mkRhs srcloc [] [] rhs
+ -- ... and then we should recurse with the new gensym argument.
+ ds' <- transformLDs k' l' ds
+ -- The generated guards, which should be at most one, should be
+ -- added as declarations rather than as guards due to the
+ -- scoping issue described above.
+ return $ (HsPatBind srcloc pat' rhs' decls') : ags' ++ gs' ++ ds'
+
+ -- We only need to treat pattern binds separately, other declarations
+ -- can be transformed normally.
+ d -> do d' <- transformDecl d
+ ds' <- transformLDs k l ds
+ return $ d':ds'
+
+
+-- | Transform binding of implicit parameters by transforming the expression on the
+-- right-hand side. The left-hand side can only be an implicit parameter, so no
+-- regular patterns there...
+transformIPBind :: HsIPBind -> HsxM HsIPBind
+transformIPBind (HsIPBind s n e) =
+ fmap (HsIPBind s n) $ transformExp e
+
+------------------------------------------------------------------------------------
+-- Statements of various kinds
+
+-- | A simple annotation datatype for statement contexts.
+data StmtType = Do | Guard | ListComp
+
+-- | Transform statements by traversing and transforming subterms.
+-- Since generator statements have slightly different semantics
+-- depending on their context, statements are annotated with their
+-- context to ensure that the semantics of the resulting statement
+-- sequence is correct. The return type is a list since generated
+-- guards will be added as statements on the same level as the
+-- statement to be transformed.
+transformStmt :: StmtType -> HsStmt -> HsxM [HsStmt]
+transformStmt t s = case s of
+ -- Generators can have regular patterns in the result pattern on the
+ -- left-hand side and in the generating expression.
+ HsGenerator s p e -> do
+ let -- We need to treat generated guards differently depending
+ -- on the context of the statement.
+ guardFun = case t of
+ Do -> monadify
+ ListComp -> monadify
+ Guard -> mkStmtGuard
+ -- Preserve semantics of irrefutable regular patterns by postponing
+ -- their evaluation to a let-expression on the right-hand side
+ ([p'], rnpss) = unzip $ renameIrrPats [p]
+ -- Transform the pattern itself
+ ([p''], ags, gs, ds) <- transformPatterns [p']
+ -- Put the generated declarations in a let-statement
+ let lt = case ds of
+ [] -> []
+ _ -> [letStmt ds]
+ -- Perform the designated trick on the generated guards.
+ gs' = map guardFun (ags ++ gs)
+ -- Add the postponed patterns to the right-hand side by placing
+ -- them in a let-expression to make them lazily evaluated.
+ -- Then transform the whole right-hand side as an expression.
+ e' <- transformExp $ addLetDecls s (concat rnpss) e
+ return $ HsGenerator s p'' e':lt ++ gs'
+ where monadify :: Guard -> HsStmt
+ -- To monadify is to create a statement guard, only that the
+ -- generation must take place in a monad, so we need to "return"
+ -- the value gotten from the guard.
+ monadify (s,p,e) = genStmt s p (metaReturn $ paren e)
+ -- Qualifiers are simply wrapped expressions and are treated as such.
+ HsQualifier e -> fmap (\e -> [HsQualifier $ e]) $ transformExp e
+ -- Let statements suffer from the same problem as let expressions, so
+ -- the declarations should be treated in the same special way.
+ HsLetStmt (HsBDecls ds) ->
+ fmap (\ds -> [letStmt ds]) $ transformLetDecls ds
+ -- If the bindings are of implicit parameters we simply transform them as such.
+ HsLetStmt (HsIPBinds is) ->
+ fmap (\is -> [HsLetStmt (HsIPBinds is)]) $ mapM transformIPBind is
+
+
+------------------------------------------------------------------------------------------
+-- Case alternatives
+
+-- | Transform alternatives in a @case at -expression. Patterns are
+-- transformed, while other subterms are traversed further.
+transformAlt :: HsAlt -> HsxM HsAlt
+transformAlt (HsAlt srcloc pat rhs decls) = do
+ -- Preserve semantics of irrefutable regular patterns by postponing
+ -- their evaluation to a let-expression on the right-hand side
+ let ([pat'], rnpss) = unzip $ renameIrrPats [pat]
+ -- Transform the pattern itself
+ ([pat''], attrGuards, guards, decls'') <- transformPatterns [pat']
+ -- Transform the right-hand side, and add any generated guards
+ -- and let expressions to it.
+ rhs' <- mkGAlts srcloc (attrGuards ++ guards) (concat rnpss) rhs
+ -- Transform declarations in the where clause, adding any generated
+ -- declarations to it.
+ decls' <- case decls of
+ HsBDecls ds -> do ds' <- mapM transformDecl ds
+ return $ HsBDecls $ decls'' ++ ds
+ _ -> error "Cannot bind implicit parameters in the \
+ \ \'where\' clause of a function using regular patterns."
+
+ return $ HsAlt srcloc pat'' rhs' decls'
+
+ -- Transform and update guards and right-hand side of a case-expression.
+ -- The supplied list of guards is prepended to the original guards, and
+ -- subterms are traversed and transformed.
+ where mkGAlts :: SrcLoc -> [Guard] -> [(HsName, HsPat)] -> HsGuardedAlts -> HsxM HsGuardedAlts
+ mkGAlts s guards rnps (HsUnGuardedAlt rhs) = do
+ -- Add the postponed patterns to the right-hand side by placing
+ -- them in a let-expression to make them lazily evaluated.
+ -- Then transform the whole right-hand side as an expression.
+ rhs' <- transformExp $ addLetDecls s rnps rhs
+ case guards of
+ -- There were no guards before, and none should be added,
+ -- so we still have an unguarded right-hand side
+ [] -> return $ HsUnGuardedAlt rhs'
+ -- There are guards to add. These should be added as pattern
+ -- guards, i.e. as statements.
+ _ -> return $ HsGuardedAlts [HsGuardedAlt s (map mkStmtGuard guards) rhs']
+ mkGAlts s gs rnps (HsGuardedAlts galts) =
+ fmap HsGuardedAlts $ mapM (mkGAlt gs rnps) galts
+ where mkGAlt :: [Guard] -> [(HsName, HsPat)] -> HsGuardedAlt -> HsxM HsGuardedAlt
+ mkGAlt gs rnps (HsGuardedAlt s oldgs rhs) = do
+ -- Add the postponed patterns to the right-hand side by placing
+ -- them in a let-expression to make them lazily evaluated.
+ -- Then transform the whole right-hand side as an expression.
+ do rhs' <- transformExp $ addLetDecls s rnps rhs
+ -- Now there are guards, so first we need to transform those
+ oldgs' <- fmap concat $ mapM (transformStmt Guard) oldgs
+ -- ... and then prepend the newly generated ones, as statements
+ return $ HsGuardedAlt s ((map mkStmtGuard gs) ++ oldgs') rhs'
+
+----------------------------------------------------------------------------------
+-- Guards
+
+-- In some places, a guard will be a declaration instead of the
+-- normal statement, so we represent it in a generic fashion.
+type Guard = (SrcLoc, HsPat, HsExp)
+
+mkStmtGuard :: Guard -> HsStmt
+mkStmtGuard (s, p, e) = genStmt s p e
+
+mkDeclGuard :: Guard -> [HsDecl] -> HsDecl
+mkDeclGuard (s, p, e) ds = patBindWhere s p e ds
+
+----------------------------------------------------------------------------------
+-- Rewriting expressions before transformation.
+-- Done in a monad for gensym capability.
+
+newtype RN a = RN (RNState -> (a, RNState))
+
+type RNState = Int
+
+initRNState = 0
+
+instance Monad RN where
+ return a = RN $ \s -> (a,s)
+ (RN f) >>= k = RN $ \s -> let (a,s') = f s
+ (RN g) = k a
+ in g s'
+
+instance Functor RN where
+ fmap f rna = do a <- rna
+ return $ f a
+
+
+runRename :: RN a -> a
+runRename (RN f) = let (a,_) = f initRNState
+ in a
+
+getRNState :: RN RNState
+getRNState = RN $ \s -> (s,s)
+
+setRNState :: RNState -> RN ()
+setRNState s = RN $ \_ -> ((), s)
+
+genVarName :: RN HsName
+genVarName = do
+ k <- getRNState
+ setRNState $ k+1
+ return $ name $ "harp_rnvar" ++ show k
+
+
+type NameBind = (HsName, HsPat)
+
+-- Some generic functions on monads for traversing subterms
+
+rename1pat :: a -> (b -> c) -> (a -> RN (b, [d])) -> RN (c, [d])
+rename1pat p f rn = do (q, ms) <- rn p
+ return (f q, ms)
+
+rename2pat :: a -> a -> (b -> b -> c) -> (a -> RN (b, [d])) -> RN (c, [d])
+rename2pat p1 p2 f rn = do (q1, ms1) <- rn p1
+ (q2, ms2) <- rn p2
+ return $ (f q1 q2, ms1 ++ ms2)
+
+renameNpat :: [a] -> ([b] -> c) -> (a -> RN (b, [d])) -> RN (c, [d])
+renameNpat ps f rn = do (qs, mss) <- fmap unzip $ mapM rn ps
+ return (f qs, concat mss)
+
+
+
+
+-- | Generate variables as placeholders for any regular patterns, in order
+-- to place their evaluation elsewhere. We must likewise move the evaluation
+-- of Tags because attribute lookups are force evaluation.
+renameRPats :: [HsPat] -> [(HsPat, [NameBind])]
+renameRPats ps = runRename $ mapM renameRP ps
+
+renameRP :: HsPat -> RN (HsPat, [NameBind])
+renameRP p = case p of
+ -- We must rename regular patterns and Tag expressions
+ HsPRPat _ _ -> rename p
+ HsPXTag _ _ _ _ _ -> rename p
+ HsPXETag _ _ _ _ -> rename p
+ -- The rest of the rules simply try to rename regular patterns in
+ -- their immediate subpatterns.
+ HsPNeg p -> rename1pat p HsPNeg renameRP
+ HsPInfixApp p1 n p2 -> rename2pat p1 p2
+ (\p1 p2 -> HsPInfixApp p1 n p2)
+ renameRP
+ HsPApp n ps -> renameNpat ps (HsPApp n) renameRP
+ HsPTuple ps -> renameNpat ps HsPTuple renameRP
+ HsPList ps -> renameNpat ps HsPList renameRP
+ HsPParen p -> rename1pat p HsPParen renameRP
+ HsPRec n pfs -> renameNpat pfs (HsPRec n) renameRPf
+ HsPAsPat n p -> rename1pat p (HsPAsPat n) renameRP
+ HsPIrrPat p -> rename1pat p HsPIrrPat renameRP
+ HsPXPatTag p -> rename1pat p HsPXPatTag renameRP
+ HsPatTypeSig s p t -> rename1pat p (\p -> HsPatTypeSig s p t) renameRP
+ _ -> return (p, [])
+
+ where renameRPf :: HsPatField -> RN (HsPatField, [NameBind])
+ renameRPf (HsPFieldPat n p) = rename1pat p (HsPFieldPat n) renameRP
+
+ renameAttr :: HsPXAttr -> RN (HsPXAttr, [NameBind])
+ renameAttr (HsPXAttr s p) = rename1pat p (HsPXAttr s) renameRP
+
+ rename :: HsPat -> RN (HsPat, [NameBind])
+ rename p = do -- Generate a fresh variable
+ n <- genVarName
+ -- ... and return that, along with the association of
+ -- the variable with the old pattern
+ return (pvar n, [(n,p)])
+
+-- | Rename declarations appearing in @let at s or @where@ clauses.
+renameLetDecls :: [HsDecl] -> [HsDecl]
+renameLetDecls ds =
+ let -- Rename all regular patterns bound in pattern bindings.
+ (ds', smss) = unzip $ runRename $ mapM renameLetDecl ds
+ -- ... and then generate declarations for the associations
+ gs = map (\(s,n,p) -> mkDecl s (n,p)) (concat smss)
+ -- ... which should be added to the original list of declarations.
+ in ds' ++ gs
+
+ where renameLetDecl :: HsDecl -> RN (HsDecl, [(SrcLoc, HsName, HsPat)])
+ renameLetDecl d = case d of
+ -- We need only bother about pattern bindings.
+ HsPatBind srcloc pat rhs decls -> do
+ -- Rename any regular patterns that appear in the
+ -- pattern being bound.
+ (p, ms) <- renameRP pat
+ let sms = map (\(n,p) -> (srcloc, n, p)) ms
+ return $ (HsPatBind srcloc p rhs decls, sms)
+ _ -> return (d, [])
+
+
+-- | Move irrefutable regular patterns into a @let at -expression instead,
+-- to make sure that the semantics of @~@ are preserved.
+renameIrrPats :: [HsPat] -> [(HsPat, [NameBind])]
+renameIrrPats ps = runRename (mapM renameIrrP ps)
+
+renameIrrP :: HsPat -> RN (HsPat, [(HsName, HsPat)])
+renameIrrP p = case p of
+ -- We should rename any regular pattern appearing
+ -- inside an irrefutable pattern.
+ HsPIrrPat p -> do (q, ms) <- renameRP p
+ return $ (HsPIrrPat q, ms)
+ -- The rest of the rules simply try to rename regular patterns in
+ -- irrefutable patterns in their immediate subpatterns.
+ HsPNeg p -> rename1pat p HsPNeg renameIrrP
+ HsPInfixApp p1 n p2 -> rename2pat p1 p2
+ (\p1 p2 -> HsPInfixApp p1 n p2)
+ renameIrrP
+ HsPApp n ps -> renameNpat ps (HsPApp n) renameIrrP
+ HsPTuple ps -> renameNpat ps HsPTuple renameIrrP
+ HsPList ps -> renameNpat ps HsPList renameIrrP
+ HsPParen p -> rename1pat p HsPParen renameIrrP
+ HsPRec n pfs -> renameNpat pfs (HsPRec n) renameIrrPf
+ HsPAsPat n p -> rename1pat p (HsPAsPat n) renameIrrP
+ HsPatTypeSig s p t -> rename1pat p (\p -> HsPatTypeSig s p t) renameIrrP
+
+ -- Hsx
+ HsPXTag s n attrs mat p -> do (attrs', nss) <- fmap unzip $ mapM renameIrrAttr attrs
+ (mat', ns1) <- case mat of
+ Nothing -> return (Nothing, [])
+ Just at -> do (at', ns) <- renameIrrP at
+ return (Just at', ns)
+ (q, ns) <- rename1pat p (HsPXTag s n attrs' mat') renameIrrP
+ return (q, concat nss ++ ns1 ++ ns)
+ HsPXETag s n attrs mat -> do (as, nss) <- fmap unzip $ mapM renameIrrAttr attrs
+ (mat', ns1) <- case mat of
+ Nothing -> return (Nothing, [])
+ Just at -> do (at', ns) <- renameIrrP at
+ return (Just at', ns)
+ return $ (HsPXETag s n as mat', concat nss ++ ns1)
+ HsPXPatTag p -> rename1pat p HsPXPatTag renameIrrP
+ -- End Hsx
+
+ _ -> return (p, [])
+
+ where renameIrrPf :: HsPatField -> RN (HsPatField, [NameBind])
+ renameIrrPf (HsPFieldPat n p) = rename1pat p (HsPFieldPat n) renameIrrP
+
+ renameIrrAttr :: HsPXAttr -> RN (HsPXAttr, [NameBind])
+ renameIrrAttr (HsPXAttr s p) = rename1pat p (HsPXAttr s) renameIrrP
+-----------------------------------------------------------------------------------
+-- Transforming Patterns: the real stuff
+
+-- | Transform several patterns in the same context, thereby
+-- generating any code for matching regular patterns.
+transformPatterns :: [HsPat] -> HsxM ([HsPat], [Guard], [Guard], [HsDecl])
+transformPatterns ps = runTr (trPatterns ps)
+
+---------------------------------------------------
+-- The transformation monad
+
+type State = (Int, Int, Int, [Guard], [Guard], [HsDecl])
+
+newtype Tr a = Tr (State -> HsxM (a, State))
+
+instance Monad Tr where
+ return a = Tr $ \s -> return (a, s)
+ (Tr f) >>= k = Tr $ \s ->
+ do (a, s') <- f s
+ let (Tr f') = k a
+ f' s'
+
+instance Functor Tr where
+ fmap f tra = tra >>= (return . f)
+
+liftTr :: HsxM a -> Tr a
+liftTr hma = Tr $ \s -> do a <- hma
+ return (a, s)
+
+initState = initStateFrom 0 0
+
+initStateFrom k l = (0, k, l, [], [], [])
+
+runTr :: Tr a -> HsxM (a, [Guard], [Guard], [HsDecl])
+runTr (Tr f) = do (a, (_,_,_,gs1,gs2,ds)) <- f initState
+ return (a, reverse gs1, reverse gs2, reverse ds)
+
+
+runTrFromTo :: Int -> Int -> Tr a -> HsxM (a, [Guard], [Guard], [HsDecl], Int, Int)
+runTrFromTo k l (Tr f) = do (a, (_,k',l',gs1,gs2,ds)) <- f $ initStateFrom k l
+ return (a, reverse gs1, reverse gs2, reverse ds, k', l')
+
+
+-- manipulating the state
+getState :: Tr State
+getState = Tr $ \s -> return (s,s)
+
+setState :: State -> Tr ()
+setState s = Tr $ \_ -> return ((),s)
+
+updateState :: (State -> (a,State)) -> Tr a
+updateState f = do s <- getState
+ let (a,s') = f s
+ setState s'
+ return a
+
+-- specific state manipulating functions
+pushGuard :: SrcLoc -> HsPat -> HsExp -> Tr ()
+pushGuard s p e = updateState $ \(n,m,a,gs1,gs2,ds) -> ((),(n,m,a,gs1,(s,p,e):gs2,ds))
+
+pushDecl :: HsDecl -> Tr ()
+pushDecl d = updateState $ \(n,m,a,gs1,gs2,ds) -> ((),(n,m,a,gs1,gs2,d:ds))
+
+pushAttrGuard :: SrcLoc -> HsPat -> HsExp -> Tr ()
+pushAttrGuard s p e = updateState $ \(n,m,a,gs1,gs2,ds) -> ((),(n,m,a,(s,p,e):gs1,gs2,ds))
+
+genMatchName :: Tr HsName
+genMatchName = do k <- updateState $ \(n,m,a,gs1,gs2,ds) -> (n,(n+1,m,a,gs1,gs2,ds))
+ return $ HsIdent $ "harp_match" ++ show k
+
+genPatName :: Tr HsName
+genPatName = do k <- updateState $ \(n,m,a,gs1,gs2,ds) -> (m,(n,m+1,a,gs1,gs2,ds))
+ return $ HsIdent $ "harp_pat" ++ show k
+
+genAttrName :: Tr HsName
+genAttrName = do k <- updateState $ \(n,m,a,gs1,gs2,ds) -> (m,(n,m,a+1,gs1,gs2,ds))
+ return $ HsIdent $ "hsx_attrs" ++ show k
+
+
+setHarpTransformedT, setXmlTransformedT :: Tr ()
+setHarpTransformedT = liftTr setHarpTransformed
+setXmlTransformedT = liftTr setXmlTransformed
+
+
+-------------------------------------------------------------------
+-- Some generic functions for computations in the Tr monad. Could
+-- be made even more general, but there's really no point right now...
+
+tr1pat :: a -> (b -> c) -> (a -> Tr b) -> Tr c
+tr1pat p f tr = do q <- tr p
+ return $ f q
+
+tr2pat :: a -> a -> (b -> b -> c) -> (a -> Tr b) -> Tr c
+tr2pat p1 p2 f tr = do q1 <- tr p1
+ q2 <- tr p2
+ return $ f q1 q2
+
+trNpat :: [a] -> ([b] -> c) -> (a -> Tr b) -> Tr c
+trNpat ps f tr = do qs <- mapM tr ps
+ return $ f qs
+
+-----------------------------------------------------------------------------
+-- The *real* transformations
+-- Transforming patterns
+
+-- | Transform several patterns in the same context
+trPatterns :: [HsPat] -> Tr [HsPat]
+trPatterns = mapM trPattern
+
+-- | Transform a pattern by traversing the syntax tree.
+-- A regular pattern is translated, other patterns are
+-- simply left as is.
+trPattern :: HsPat -> Tr HsPat
+trPattern p = case p of
+ -- This is where the fun starts. =)
+ -- Regular patterns must be transformed of course.
+ HsPRPat s rps -> do
+ -- First we need a name for the placeholder pattern.
+ n <- genPatName
+ -- A top-level regular pattern is a sequence in linear
+ -- context, so we can simply translate it as if it was one.
+ (mname, vars, _) <- trRPat s True (HsRPSeq rps)
+ -- Generate a top level declaration.
+ topmname <- mkTopDecl s mname vars
+ -- Generate a pattern guard for this regular pattern,
+ -- that will match the generated declaration to the
+ -- value of the placeholder, and bind all variables.
+ mkGuard s vars topmname n
+ -- And indeed, we have made a transformation!
+ setHarpTransformedT
+ -- Return the placeholder pattern.
+ return $ pvar n
+ -- Tag patterns should be transformed
+ HsPXTag s name attrs mattr cpat -> do
+ -- We need a name for the attribute list, if there are lookups
+ an <- case (mattr, attrs) of
+ -- ... if there is one already, and there are no lookups
+ -- we can just return that
+ (Just ap, []) -> return $ ap
+ -- ... if there are none, we dont' care
+ (_, []) -> return wildcard
+ (_, _) -> do -- ... but if there are, we want a name for that list
+ n <- genAttrName
+ -- ... we must turn attribute lookups into guards
+ mkAttrGuards s n attrs mattr
+ -- ... and we return the pattern
+ return $ pvar n
+ -- ... the pattern representing children should be transformed
+ cpat' <- trPattern cpat
+ -- ... we have made a transformation and should report that
+ setHarpTransformedT
+ -- ... and we return a Tag pattern.
+ let (dom, n) = xNameParts name
+ return $ metaTag dom n an cpat'
+ -- ... as should empty Tag patterns
+ HsPXETag s name attrs mattr -> do
+ -- We need a name for the attribute list, if there are lookups
+ an <- case (mattr, attrs) of
+ -- ... if there is a pattern already, and there are no lookups
+ -- we can just return that
+ (Just ap, []) -> return $ ap
+ -- ... if there are none, we dont' care
+ (_, []) -> return wildcard
+ (_, _) -> do -- ... but if there are, we want a name for that list
+ n <- genAttrName
+ -- ... we must turn attribute lookups into guards
+ mkAttrGuards s n attrs mattr
+ -- ... and we return the pattern
+ return $ pvar n
+ -- ... we have made a transformation and should report that
+ setHarpTransformedT
+ -- ... and we return an ETag pattern.
+ let (dom, n) = xNameParts name
+ return $ metaTag dom n an peList
+ -- PCDATA patterns are strings in the xml datatype.
+ HsPXPcdata s -> setHarpTransformedT >> (return $ metaPcdata s)
+ -- XML comments are likewise just treated as strings.
+ HsPXPatTag p -> setHarpTransformedT >> trPattern p
+
+ -- Transforming any other patterns simply means transforming
+ -- their subparts.
+ HsPVar _ -> return p
+ HsPLit _ -> return p
+ HsPNeg q -> tr1pat q HsPNeg trPattern
+ HsPInfixApp p1 op p2 -> tr2pat p1 p2 (\p1 p2 -> HsPInfixApp p1 op p2) trPattern
+ HsPApp n ps -> trNpat ps (HsPApp n) trPattern
+ HsPTuple ps -> trNpat ps HsPTuple trPattern
+ HsPList ps -> trNpat ps HsPList trPattern
+ HsPParen p -> tr1pat p HsPParen trPattern
+ HsPRec n pfs -> trNpat pfs (HsPRec n) trPatternField
+ HsPAsPat n p -> tr1pat p (HsPAsPat n) trPattern
+ HsPWildCard -> return p
+ HsPIrrPat p -> tr1pat p HsPIrrPat trPattern
+ HsPatTypeSig s p t -> tr1pat p (\p -> HsPatTypeSig s p t) trPattern
+
+ where -- Transform a pattern field.
+ trPatternField :: HsPatField -> Tr HsPatField
+ trPatternField (HsPFieldPat n p) =
+ tr1pat p (HsPFieldPat n) trPattern
+
+ -- Deconstruct an xml tag name into its parts.
+ xNameParts :: HsXName -> (Maybe String, String)
+ xNameParts n = case n of
+ HsXName s -> (Nothing, s)
+ HsXDomName d s -> (Just d, s)
+
+ -- | Generate a guard for looking up xml attributes.
+ mkAttrGuards :: SrcLoc -> HsName -> [HsPXAttr] -> Maybe HsPat -> Tr ()
+ mkAttrGuards s attrs [HsPXAttr n q] mattr = do
+ -- Apply lookupAttr to the attribute name and
+ -- attribute set
+ let rhs = metaExtract n attrs
+ -- ... catch the result
+ pat = metaPJust q
+ -- ... catch the remainder list
+ rml = case mattr of
+ Nothing -> wildcard
+ Just ap -> ap
+ -- ... and add the generated guard to the store.
+ pushAttrGuard s (pTuple [pat, rml]) rhs
+
+ mkAttrGuards s attrs ((HsPXAttr a q):xs) mattr = do
+ -- Apply lookupAttr to the attribute name and
+ -- attribute set
+ let rhs = metaExtract a attrs
+ -- ... catch the result
+ pat = metaPJust q
+ -- ... catch the remainder list
+ newAttrs <- genAttrName
+ -- ... and add the generated guard to the store.
+ pushAttrGuard s (pTuple [pat, pvar newAttrs]) rhs
+ -- ... and finally recurse
+ mkAttrGuards s newAttrs xs mattr
+
+ -- | Generate a declaration at top level that will finalise all
+ -- variable continuations, and then return all bound variables.
+ mkTopDecl :: SrcLoc -> HsName -> [HsName] -> Tr HsName
+ mkTopDecl s mname vars =
+ do -- Give the match function a name
+ n <- genMatchName
+ -- Create the declaration and add it to the store.
+ pushDecl $ topDecl s n mname vars
+ -- Return the name of the match function so that the
+ -- guard that will be generated can call it.
+ return n
+
+ topDecl :: SrcLoc -> HsName -> HsName -> [HsName] -> HsDecl
+ topDecl s n mname vs =
+ let pat = pTuple [wildcard, pvarTuple vs] -- (_, (foo, bar, ...))
+ g = var mname -- harp_matchX
+ a = genStmt s pat g -- (_, (foo, ...)) <- harp_matchX
+ vars = map (\v -> app (var v) eList) vs -- (foo [], bar [], ...)
+ b = qualStmt $ metaReturn $ tuple vars -- return (foo [], bar [], ...)
+ e = doE [a,b] -- do (...) <- harp_matchX
+ -- return (foo [], bar [], ...)
+ in nameBind s n e -- harp_matchY = do ....
+
+ -- | Generate a pattern guard that will apply the @runMatch@
+ -- function on the top-level match function and the input list,
+ -- thereby binding all variables.
+ mkGuard :: SrcLoc -> [HsName] -> HsName -> HsName -> Tr ()
+ mkGuard s vars mname n = do
+ let tvs = pvarTuple vars -- (foo, bar, ...)
+ ge = appFun runMatchFun [var mname, var n] -- runMatch harp_matchX harp_patY
+ pushGuard s (pApp just_name [tvs]) ge -- Just (foo, bar, ...) , runMatch ...
+
+
+--------------------------------------------------------------------------------
+-- Transforming regular patterns
+
+-- | A simple datatype to annotate return values from sub-patterns
+data MType = S -- Single element
+ | L MType -- List of ... , (/ /), *, +
+ | E MType MType -- Either ... or ... , ( | )
+ | M MType -- Maybe ... , ?
+
+
+-- When transforming a regular sub-pattern, we need to know the
+-- name of the function generated to match it, the names of all
+-- variables it binds, and the type of its returned value.
+type MFunMetaInfo = (HsName, [HsName], MType)
+
+
+-- | Transform away a regular pattern, generating code
+-- to replace it.
+trRPat :: SrcLoc -> Bool -> HsRPat -> Tr MFunMetaInfo
+trRPat s linear rp = case rp of
+ -- For an ordinary Haskell pattern we need to generate a
+ -- base match function for the pattern, and a declaration
+ -- that lifts that function into the matcher monad.
+ HsRPPat p -> do mkBaseDecl s linear p
+
+ where -- | Generate declarations for matching ordinary Haskell patterns
+ mkBaseDecl :: SrcLoc -> Bool -> HsPat -> Tr MFunMetaInfo
+ mkBaseDecl s linear p = case p of
+ -- We can simplify a lot if the pattern is a wildcard or a variable
+ HsPWildCard -> mkWCMatch s
+ HsPVar v -> mkVarMatch s linear v
+ -- ... and if it is an embedded pattern tag, we can just skip it
+ HsPXPatTag q -> mkBaseDecl s linear q
+
+ -- ... otherwise we'll have to take the long way...
+ p -> do -- First do a case match on a single element
+ (name, vars, _) <- mkBasePat s linear p
+ -- ... apply baseMatch to the case matcher to
+ -- lift it into the matcher monad.
+ newname <- mkBaseMatch s name
+ -- ... and return the meta-info gathered.
+ return (newname, vars, S)
+
+ -- | Generate a declaration for matching a variable.
+ mkVarMatch :: SrcLoc -> Bool -> HsName -> Tr MFunMetaInfo
+ mkVarMatch s linear v = do
+ -- First we need a name for the new match function.
+ n <- genMatchName
+ -- Then we need a basic matching function that always matches,
+ -- and that binds the value matched to the variable in question.
+ let e = paren $ lamE s [pvar v] $ -- (\v -> Just (mf v))
+ app (var just_name)
+ (paren $ retVar linear v)
+ -- Lift the function into the matcher monad, and bind it to its name,
+ -- then add it the declaration to the store.
+ pushDecl $ nameBind s n $
+ app baseMatchFun e -- harp_matchX = baseMatch (\v -> Just (mf v))
+ return (n, [v], S) -- always binds v and only v
+
+ where retVar :: Bool -> HsName -> HsExp
+ retVar linear v
+ -- if bound in linear context, apply const
+ | linear = metaConst (var v)
+ -- if bound in non-linear context, apply (:)
+ | otherwise = app consFun (var v)
+
+ -- | Generate a declaration for matching a wildcard
+ mkWCMatch :: SrcLoc -> Tr MFunMetaInfo
+ mkWCMatch s = do
+ -- First we need a name...
+ n <- genMatchName
+ -- ... and then a function that always matches, discarding the result
+ let e = paren $ lamE s [wildcard] $ -- (\_ -> Just ())
+ app (var just_name) unit_con
+ -- ... which we lift, bind, and add to the store.
+ pushDecl $ nameBind s n $ -- harp_matchX = baseMatch (\_ -> Just ())
+ app baseMatchFun e
+ return (n, [], S) -- no variables bound, hence []
+
+ -- | Generate a basic function that cases on a single element,
+ -- returning Just (all bound variables) on a match, and
+ -- Nothing on a mismatch.
+ mkBasePat :: SrcLoc -> Bool -> HsPat -> Tr MFunMetaInfo
+ mkBasePat s b p =
+ do -- First we need a name...
+ n <- genMatchName
+ -- ... and then we need to know what variables that
+ -- will be bound by this match.
+ let vs = gatherPVars p
+ -- ... and then we can create and store away a casing function.
+ basePatDecl s b n vs p >>= pushDecl
+ return (n, vs, S)
+
+ where -- | Gather up the names of all variables in a pattern,
+ -- using a simple fold over the syntax structure.
+ gatherPVars :: HsPat -> [HsName]
+ gatherPVars p = case p of
+ HsPVar v -> [v]
+ HsPNeg q -> gatherPVars q
+ HsPInfixApp p1 _ p2 -> gatherPVars p1 ++
+ gatherPVars p2
+ HsPApp _ ps -> concatMap gatherPVars ps
+ HsPTuple ps -> concatMap gatherPVars ps
+ HsPList ps -> concatMap gatherPVars ps
+ HsPParen p -> gatherPVars p
+ HsPRec _ pfs -> concatMap help pfs
+ where help (HsPFieldPat _ p) = gatherPVars p
+ HsPAsPat n p -> n : gatherPVars p
+ HsPWildCard -> []
+ HsPIrrPat p -> gatherPVars p
+ HsPatTypeSig _ p _ -> gatherPVars p
+ HsPRPat _ rps -> concatMap gatherRPVars rps
+ HsPXTag _ _ attrs mattr cp ->
+ concatMap gatherAttrVars attrs ++ gatherPVars cp ++
+ case mattr of
+ Nothing -> []
+ Just ap -> gatherPVars ap
+ HsPXETag _ _ attrs mattr ->
+ concatMap gatherAttrVars attrs ++
+ case mattr of
+ Nothing -> []
+ Just ap -> gatherPVars ap
+ HsPXPatTag p -> gatherPVars p
+ _ -> []
+
+ gatherRPVars :: HsRPat -> [HsName]
+ gatherRPVars rp = case rp of
+ HsRPStar rq -> gatherRPVars rq
+ HsRPStarG rq -> gatherRPVars rq
+ HsRPPlus rq -> gatherRPVars rq
+ HsRPPlusG rq -> gatherRPVars rq
+ HsRPOpt rq -> gatherRPVars rq
+ HsRPOptG rq -> gatherRPVars rq
+ HsRPEither rq1 rq2 -> gatherRPVars rq1 ++ gatherRPVars rq2
+ HsRPSeq rqs -> concatMap gatherRPVars rqs
+ HsRPCAs n rq -> n : gatherRPVars rq
+ HsRPAs n rq -> n : gatherRPVars rq
+ HsRPParen rq -> gatherRPVars rq
+ HsRPPat q -> gatherPVars q
+
+ gatherAttrVars :: HsPXAttr -> [HsName]
+ gatherAttrVars (HsPXAttr _ p) = gatherPVars p
+
+ -- | Generate a basic casing function for a given pattern.
+ basePatDecl :: SrcLoc -> Bool -> HsName -> [HsName] -> HsPat -> Tr HsDecl
+ basePatDecl s linear f vs p = do
+ -- We can use the magic variable harp_a since nothing else needs to
+ -- be in scope at this time (we could use just a, or foo, or whatever)
+ let a = HsIdent $ "harp_a"
+ -- ... and we should case on that variable on the right-hand side.
+ rhs <- baseCaseE s linear p a vs -- case harp_a of ...
+ -- The result is a simple function with one paramenter and
+ -- the right-hand side we just generated.
+ return $ simpleFun s f a rhs
+ where baseCaseE :: SrcLoc -> Bool -> HsPat -> HsName -> [HsName] -> Tr HsExp
+ baseCaseE s b p a vs = do
+ -- First the alternative if we actually
+ -- match the given pattern
+ let alt1 = alt s p -- foo -> Just (mf foo)
+ (app (var just_name) $
+ tuple (map (retVar b) vs))
+ -- .. and finally an alternative for not matching the pattern.
+ alt2 = alt s wildcard (var nothing_name) -- _ -> Nothing
+ -- ... and that pattern could itself contain regular patterns
+ -- so we must transform away these.
+ alt1' <- liftTr $ transformAlt alt1
+ return $ caseE (var a) [alt1', alt2]
+ retVar :: Bool -> HsName -> HsExp
+ retVar linear v
+ -- if bound in linear context, apply const
+ | linear = metaConst (var v)
+ -- if bound in non-linear context, apply (:)
+ | otherwise = app consFun (var v)
+
+ -- | Generate a match function that lift the result of the
+ -- basic casing function into the matcher monad.
+ mkBaseMatch :: SrcLoc -> HsName -> Tr HsName
+ mkBaseMatch s name =
+ do -- First we need a name...
+ n <- genMatchName
+ -- ... to which we bind the lifting function
+ pushDecl $ baseMatchDecl s n name
+ -- and then return for others to use.
+ return n
+
+ -- | Generate a declaration for the function that lifts a simple
+ -- casing function into the matcher monad.
+ baseMatchDecl :: SrcLoc -> HsName -> HsName -> HsDecl
+ baseMatchDecl s newname oldname =
+ -- Apply the lifting function "baseMatch" to the casing function
+ let e = app baseMatchFun (var oldname)
+ -- ... and bind it to the new name.
+ in nameBind s newname e -- harp_matchX = baseMatch harp_matchY
+
+
+ -- For a sequence of regular patterns, we should transform all
+ -- sub-patterns and then generate a function for sequencing them.
+ HsRPSeq rps -> do
+ nvts <- mapM (trRPat s linear) rps
+ mkSeqDecl s nvts
+
+ where -- | Generate a match function for a sequence of regular patterns,
+ -- flattening any special sub-patterns into normal elements of the list
+ mkSeqDecl :: SrcLoc -> [MFunMetaInfo] -> Tr MFunMetaInfo
+ mkSeqDecl s nvts = do
+ -- First, as always, we need a name...
+ name <- genMatchName
+ let -- We need a generating statement for each sub-pattern.
+ (gs, vals) = unzip $ mkGenExps s 0 nvts -- (harp_valX, (foo, ...)) <- harp_matchY
+ -- Gather up all variables from all sub-patterns.
+ vars = concatMap (\(_,vars,_) -> vars) nvts
+ -- ... flatten all values to simple lists, and concatenate
+ -- the lists to a new return value
+ fldecls = flattenVals s vals -- harp_valXf = $flatten harp_valX
+ -- harp_ret = foldComp [harp_val1f, ...]
+ -- ... return the value along with all variables
+ ret = qualStmt $ metaReturn $ -- return (harp_ret, (foo, .....))
+ tuple [var retname, varTuple vars]
+ -- ... do all these steps in a do expression
+ rhs = doE $ gs ++ -- do (harp_valX, (foo, ...)) <- harpMatchY
+ [letStmt fldecls, ret] -- let harp_valXf = $flatten harp_valX
+ -- return (harp_ret, (foo, .....))
+ -- ... bind it to its name, and add the declaration
+ -- to the store.
+ pushDecl $ nameBind s name rhs -- harp_matchZ = do ....
+ -- The return value of a sequence is always a list of elements.
+ return (name, vars, L S)
+
+ -- | Flatten values of all sub-patterns into normal elements of the list
+ flattenVals :: SrcLoc -> [(HsName, MType)] -> [HsDecl]
+ flattenVals s nts =
+ let -- Flatten the values of all sub-patterns to
+ -- lists of elements
+ (nns, ds) = unzip $ map (flVal s) nts
+ -- ... and concatenate their results.
+ ret = nameBind s retname $ app
+ (paren $ app foldCompFun
+ (listE $ map var nns)) $ eList
+ in ds ++ [ret]
+
+
+ flVal :: SrcLoc -> (HsName, MType) -> (HsName, HsDecl)
+ flVal s (name, mt) =
+ let -- We reuse the old names, we just extend them a bit.
+ newname = extendVar name "f" -- harp_valXf
+ -- Create the appropriate flattening function depending
+ -- on the type of the value
+ f = flatten mt
+ -- ... apply it to the value and bind it to its new name.
+ in (newname, nameBind s newname $ -- harp_valXf = $flatten harp_valX
+ app f (var name))
+
+ -- | Generate a flattening function for a given type structure.
+ flatten :: MType -> HsExp
+ flatten S = consFun -- (:)
+ flatten (L mt) =
+ let f = flatten mt
+ r = paren $ metaMap f
+ in paren $ foldCompFun `metaComp` r -- (foldComp . (map $flatten))
+ flatten (E mt1 mt2) =
+ let f1 = flatten mt1
+ f2 = flatten mt2
+ in paren $ metaEither f1 f2 -- (either $flatten $flatten)
+ flatten (M mt) =
+ let f = flatten mt
+ in paren $ metaMaybe idFun f -- (maybe id $flatten)
+
+ -- For accumulating as-patterns we should transform the subpattern, and then generate
+ -- a declaration that supplies the value to be bound to the variable in question.
+ -- The variable should be bound non-linearly.
+ HsRPCAs v rp -> do
+ -- Transform the subpattern
+ nvt@(name, vs, mt) <- trRPat s linear rp
+ -- ... and create a declaration to bind its value.
+ n <- mkCAsDecl s nvt
+ -- The type of the value is unchanged.
+ return (n, (v:vs), mt)
+
+ where -- | Generate a declaration for a @: binding.
+ mkCAsDecl :: SrcLoc -> MFunMetaInfo -> Tr HsName
+ mkCAsDecl = asDecl $ app consFun -- should become lists when applied to []
+
+
+ -- For ordinary as-patterns we should transform the subpattern, and then generate
+ -- a declaration that supplies the value to be bound to the variable in question.
+ -- The variable should be bound linearly.
+ HsRPAs v rp
+ | linear ->
+ do -- Transform the subpattern
+ nvt@(name, vs, mt) <- trRPat s linear rp
+ -- ... and create a declaration to bind its value
+ n <- mkAsDecl s nvt
+ -- The type of the value is unchanged.
+ return (n, (v:vs), mt)
+ -- We may not use an @ bind in non-linear context
+ | otherwise -> case v of
+ HsIdent n -> fail $ "Attempting to bind variable "++n++
+ " inside the context of a numerable regular pattern"
+ _ -> fail $ "This should never ever ever happen...\
+ \ how the #% did you do it??!?"
+
+ where -- | Generate a declaration for a @ binding.
+ mkAsDecl :: SrcLoc -> MFunMetaInfo -> Tr HsName
+ mkAsDecl = asDecl metaConst -- should be constant when applied to []
+
+
+ -- For regular patterns, parentheses have no real meaning
+ -- so at this point we can just skip them.
+ HsRPParen rp -> trRPat s linear rp
+
+ -- For (possibly non-greedy) optional regular patterns we need to
+ -- transform the subpattern, and the generate a function that can
+ -- choose to match or not to match, that is the question...
+ HsRPOpt rp ->
+ do -- Transform the subpattern
+ nvt <- trRPat s False rp
+ -- ... and create a declaration that can optionally match it.
+ mkOptDecl s False nvt
+ -- ... similarly for the non-greedy version.
+ HsRPOptG rp ->
+ do -- Transform the subpattern
+ nvt <- trRPat s False rp
+ -- ... and create a declaration that can optionally match it.
+ mkOptDecl s True nvt
+
+
+ -- For union patterns, we should transform both subexpressions,
+ -- and generate a function that chooses between them.
+ HsRPEither rp1 rp2 ->
+ do -- Transform the subpatterns
+ nvt1 <- trRPat s False rp1
+ nvt2 <- trRPat s False rp2
+ -- ... and create a declaration that can choose between them.
+ mkEitherDecl s nvt1 nvt2
+ -- | Generate declarations for either patterns, i.e. ( | )
+ where mkEitherDecl :: SrcLoc -> MFunMetaInfo -> MFunMetaInfo -> Tr MFunMetaInfo
+ mkEitherDecl s nvt1@(_, vs1, t1) nvt2@(_, vs2, t2) = do
+ -- Eine namen, bitte!
+ n <- genMatchName
+ let -- Generate generators for the subpatterns
+ (g1, v1) = mkGenExp s nvt1
+ (g2, v2) = mkGenExp s nvt2 -- (harp_valX, (foo, bar, ...)) <- harp_matchY
+ -- ... gather all variables from both sides
+ allvs = vs1 `union` vs2
+ -- ... some may be bound on both sides, so we
+ -- need to check which ones are bound on each,
+ -- supplying empty value for those that are not
+ vals1 = map (varOrId vs1) allvs
+ vals2 = map (varOrId vs2) allvs
+ -- ... apply either Left or Right to the returned value
+ ret1 = metaReturn $ tuple -- return (Left harp_val1, (foo, id, ...))
+ [app (var left_name)
+ (var v1), tuple vals1]
+ ret2 = metaReturn $ tuple -- return (Right harp_val2, (id, bar, ...))
+ [app (var right_name)
+ (var v2), tuple vals2]
+ -- ... and do all these things in do-expressions
+ exp1 = doE [g1, qualStmt ret1]
+ exp2 = doE [g2, qualStmt ret2]
+ -- ... and choose between them using the choice (+++) operator.
+ rhs = (paren exp1) `metaChoice` -- (do ...) +++
+ (paren exp2) -- (do ...)
+ -- Finally we create a declaration for this function and
+ -- add it to the store.
+ pushDecl $ nameBind s n rhs -- harp_matchZ = (do ...) ...
+ -- The type of the returned value is Either the type of the first
+ -- or the second subpattern.
+ return (n, allvs, E t1 t2)
+
+ varOrId :: [HsName] -> HsName -> HsExp
+ varOrId vs v = if v `elem` vs -- the variable is indeed bound in this branch
+ then var v -- ... so it should be added to the result
+ else idFun -- ... else it should be empty.
+
+ -- For (possibly non-greedy) repeating regular patterns we need to transform the subpattern,
+ -- and then generate a function to handle many matches of it.
+ HsRPStar rp ->
+ do -- Transform the subpattern
+ nvt <- trRPat s False rp
+ -- ... and create a declaration that can match it many times.
+ mkStarDecl s False nvt
+ -- ... and similarly for the non-greedy version.
+ HsRPStarG rp ->
+ do -- Transform the subpattern
+ nvt <- trRPat s False rp
+ -- ... and create a declaration that can match it many times.
+ mkStarDecl s True nvt
+
+ -- For (possibly non-greedy) non-empty repeating patterns we need to transform the subpattern,
+ -- and then generate a function to handle one or more matches of it.
+ HsRPPlus rp ->
+ do -- Transform the subpattern
+ nvt <- trRPat s False rp
+ -- ... and create a declaration that can match it one or more times.
+ mkPlusDecl s False nvt
+ -- ... and similarly for the non-greedy version.
+ HsRPPlusG rp ->
+ do -- Transform the subpattern
+ nvt <- trRPat s False rp
+ -- ... and create a declaration that can match it one or more times.
+ mkPlusDecl s True nvt
+
+
+ where -- These are the functions that must be in scope for more than one case alternative above.
+
+ -- | Generate the generators that call sub-matching functions, and
+ -- annotate names with types for future flattening of values.
+ -- Iterate to enable gensym-like behavior.
+ mkGenExps :: SrcLoc -> Int -> [MFunMetaInfo] -> [(HsStmt, (HsName, MType))]
+ mkGenExps _ _ [] = []
+ mkGenExps s k ((name, vars, t):nvs) =
+ let valname = mkValName k -- harp_valX
+ pat = pTuple [pvar valname, pvarTuple vars] -- (harp_valX, (foo, bar, ...))
+ g = var name
+ in (genStmt s pat g, (valname, t)) : -- (harp_valX, (foo, ...)) <- harp_matchY
+ mkGenExps s (k+1) nvs
+
+ -- | Create a single generator.
+ mkGenExp :: SrcLoc -> MFunMetaInfo -> (HsStmt, HsName)
+ mkGenExp s nvt = let [(g, (name, _t))] = mkGenExps s 0 [nvt]
+ in (g, name)
+
+ -- | Generate a single generator with a call to (ng)manyMatch,
+ -- and an extra variable name to use after unzipping.
+ mkManyGen :: SrcLoc -> Bool -> HsName -> HsStmt
+ mkManyGen s greedy mname =
+ -- Choose which repeater function to use, determined by greed
+ let mf = if greedy then gManyMatchFun else manyMatchFun
+ -- ... and create a generator that applies it to the
+ -- matching function in question.
+ in genStmt s (pvar valsvarsname) $
+ app mf (var mname)
+
+ -- | Generate declarations for @: and @ bindings.
+ asDecl :: (HsExp -> HsExp) -> SrcLoc -> MFunMetaInfo -> Tr HsName
+ asDecl mf s nvt@(_, vs, _) = do
+ -- A name, if you would
+ n <- genMatchName -- harp_matchX
+ let -- Generate a generator for matching the subpattern
+ (g, val) = mkGenExp s nvt -- (harp_valY, (foo, ...)) <- harp_matchZ
+ -- ... fix the old variables
+ vars = map var vs -- (apa, bepa, ...)
+ -- ... and return the generated value, along with the
+ -- new set of variables which is the old set prepended
+ -- by the variable currently being bound.
+ ret = qualStmt $ metaReturn $ tuple -- return (harp_valY, ($mf harp_valY, apa, ...))
+ [var val, tuple $ mf (var val) : vars] -- mf in the line above is what separates
+ -- @: ((:)) from @ (const)
+ -- Finally we create a declaration for this function and
+ -- add it to the store.
+ pushDecl $ nameBind s n $ doE [g, ret] -- harp_matchX = do ...
+ return n
+
+ -- | Generate declarations for optional patterns, ? and #?.
+ -- (Unfortunally we must place this function here since both variations
+ -- of transformations of optional patterns should be able to call it...)
+ mkOptDecl :: SrcLoc -> Bool -> MFunMetaInfo -> Tr MFunMetaInfo
+ mkOptDecl s greedy nvt@(_, vs, t) = do
+ -- Un nome, s'il vouz plaît.
+ n <- genMatchName
+ let -- Generate a generator for matching the subpattern
+ (g, val) = mkGenExp s nvt -- (harp_valX, (foo, bar, ...)) <- harp_matchY
+ -- ... and apply a Just to its value
+ ret1 = metaReturn $ tuple -- return (Just harp_val1, (foo, bar, ...))
+ [app (var just_name)
+ (var val), varTuple vs]
+ -- ... and do those two steps in a do-expression
+ exp1 = doE [g, qualStmt ret1] -- do ....
+ -- For the non-matching branch, all the variables should be empty
+ ids = map (const idFun) vs -- (id, id, ...)
+ -- ... and the value should be Nothing.
+ ret2 = metaReturn $ tuple -- return (Nothing, (id, id, ...))
+ [var nothing_name, tuple ids] -- i.e. no vars were bound
+ -- The order of the arguments to the choice (+++) operator
+ -- is determined by greed...
+ mc = if greedy
+ then metaChoice -- standard order
+ else (flip metaChoice) -- reversed order
+ -- ... and then apply it to the branches.
+ rhs = (paren exp1) `mc` -- (do ....) +++
+ (paren ret2) -- (return (Nothing, .....))
+ -- Finally we create a declaration for this function and
+ -- add it to the store.
+ pushDecl $ nameBind s n rhs -- harp_matchZ = (do ....) +++ (return ....)
+ -- The type of the returned value will be Maybe the type
+ -- of the value of the subpattern.
+ return (n, vs, M t)
+
+ -- | Generate declarations for star patterns, * and #*
+ -- (Unfortunally we must place this function here since both variations
+ -- of transformations of repeating patterns should be able to call it...)
+ mkStarDecl :: SrcLoc -> Bool -> MFunMetaInfo -> Tr MFunMetaInfo
+ mkStarDecl s greedy (mname, vs, t) = do
+ -- Ett namn, tack!
+ n <- genMatchName
+ let -- Create a generator that matches the subpattern
+ -- many times, either greedily or non-greedily
+ g = mkManyGen s greedy mname
+ -- ... and unzip the result, choosing the proper unzip
+ -- function depending on the number of variables returned.
+ metaUnzipK = mkMetaUnzip s (length vs)
+ -- ... first unzip values from variables
+ dec1 = patBind s (pvarTuple [valname, varsname])
+ (metaUnzip $ var valsvarsname)
+ -- ... and then unzip the variables
+ dec2 = patBind s (pvarTuple vs)
+ (metaUnzipK $ var varsname)
+ -- ... fold all the values for variables
+ retExps = map ((app foldCompFun) . var) vs
+ -- ... and return value and variables
+ ret = metaReturn $ tuple $
+ [var valname, tuple retExps]
+ -- Finally we need to generate a function that does all this,
+ -- using a let-statement for the non-monadic stuff and a
+ -- do-expression to wrap it all in.
+ pushDecl $ nameBind s n $
+ doE [g, letStmt [dec1, dec2], qualStmt ret]
+ -- The type of the returned value is a list ([]) of the
+ -- type of the subpattern.
+ return (n, vs, L t)
+
+ -- | Generate declarations for plus patterns, + and #+
+ -- (Unfortunally we must place this function here since both variations
+ -- of transformations of non-empty repeating patterns should be able to call it...)
+ mkPlusDecl :: SrcLoc -> Bool -> MFunMetaInfo -> Tr MFunMetaInfo
+ mkPlusDecl s greedy nvt@(mname, vs, t) = do
+ -- and now I've run out of languages...
+ n <- genMatchName
+ let k = length vs
+ -- First we want a generator to match the
+ -- subpattern exactly one time
+ (g1, val1) = mkGenExp s nvt -- (harp_valX, (foo, ...)) <- harpMatchY
+ -- ... and then one that matches it many times.
+ g2 = mkManyGen s greedy mname -- harp_vvs <- manyMatch harpMatchY
+ -- ... we want to unzip the result, using
+ -- the proper unzip function
+ metaUnzipK = mkMetaUnzip s k
+ -- ... first unzip values from variables
+ dec1 = patBind s -- (harp_vals, harp_vars) = unzip harp_vvs
+ (pvarTuple [valsname, varsname])
+ (metaUnzip $ var valsvarsname)
+ -- .. now we need new fresh names for variables
+ -- since the ordinary ones are already taken.
+ vlvars = genNames "harp_vl" k
+ -- ... and then we can unzip the variables
+ dec2 = patBind s (pvarTuple vlvars) -- (harp_vl1, ...) = unzipK harp_vars
+ (metaUnzipK $ var varsname)
+ -- .. and do the unzipping in a let-statement
+ letSt = letStmt [dec1, dec2]
+ -- ... fold variables from the many-match,
+ -- prepending the variables from the single match
+ retExps = map mkRetFormat $ zip vs vlvars -- foo . (foldComp harp_vl1), ...
+ -- ... prepend values from the single match to
+ -- those of the many-match.
+ retVal = (var val1) `metaCons`
+ (var valsname) -- harp_valX : harp_vals
+ -- ... return all values and variables
+ ret = metaReturn $ tuple $ -- return (harp_valX:harpVals,
+ [retVal, tuple retExps] -- (foo . (...), ...))
+ -- ... and wrap all of it in a do-expression.
+ rhs = doE [g1, g2, letSt, qualStmt ret]
+ -- Finally we create a declaration for this function and
+ -- add it to the store.
+ pushDecl $ nameBind s n rhs
+ -- The type of the returned value is a list ([]) of the
+ -- type of the subpattern.
+ return (n, vs, L t)
+
+ where mkRetFormat :: (HsName, HsName) -> HsExp
+ mkRetFormat (v, vl) =
+ -- Prepend variables using function composition.
+ (var v) `metaComp`
+ (paren $ (app foldCompFun) $ var vl)
+
+
+--------------------------------------------------------------------------
+-- HaRP-specific functions and ids
+
+-- | Functions and ids from the @Match@ module,
+-- used in the generated matching functions
+runMatchFun, baseMatchFun, manyMatchFun, gManyMatchFun :: HsExp
+runMatchFun = match_qual runMatch_name
+baseMatchFun = match_qual baseMatch_name
+manyMatchFun = match_qual manyMatch_name
+gManyMatchFun = match_qual gManyMatch_name
+
+runMatch_name, baseMatch_name, manyMatch_name, gManyMatch_name :: HsName
+runMatch_name = HsIdent "runMatch"
+baseMatch_name = HsIdent "baseMatch"
+manyMatch_name = HsIdent "manyMatch"
+gManyMatch_name = HsIdent "gManyMatch"
+
+match_mod, match_qual_mod :: Module
+match_mod = Module "Harp.Match"
+match_qual_mod = Module "HaRPMatch"
+
+functor_qual_mod = Module "FunctorSugar"
+
+sugarFun = qvar functor_qual_mod $ HsIdent "functorSugar"
+callFun = qvar functor_qual_mod $ HsIdent "functorCall"
+
+match_qual :: HsName -> HsExp
+match_qual = qvar match_qual_mod
+
+choiceOp :: HsQOp
+choiceOp = HsQVarOp $ Qual match_qual_mod choice
+
+appendOp :: HsQOp
+appendOp = HsQVarOp $ UnQual append
+
+-- foldComp = foldl (.) id, i.e. fold by composing
+foldCompFun :: HsExp
+foldCompFun = match_qual $ HsIdent "foldComp"
+
+mkMetaUnzip :: SrcLoc -> Int -> HsExp -> HsExp
+mkMetaUnzip s k | k <= 7 = let n = "unzip" ++ show k
+ in (\e -> matchFunction n [e])
+ | otherwise =
+ let vs = genNames "x" k
+ lvs = genNames "xs" k
+ uz = name $ "unzip" ++ show k
+ ys = name "ys"
+ xs = name "xs"
+ alt1 = alt s peList $ tuple $ replicate k eList -- [] -> ([], [], ...)
+ pat2 = (pvarTuple vs) `metaPCons` (pvar xs) -- (x1, x2, ...)
+ ret2 = tuple $ map appCons $ zip vs lvs -- (x1:xs1, x2:xs2, ...)
+ rhs2 = app (var uz) (var xs) -- unzipK xs
+ dec2 = patBind s (pvarTuple lvs) rhs2 -- (xs1, xs2, ...) = unzipK xs
+ exp2 = letE [dec2] ret2
+ alt2 = alt s pat2 exp2
+ topexp = lamE s [pvar ys] $ caseE (var ys) [alt1, alt2]
+ topbind = nameBind s uz topexp
+ in app (paren $ letE [topbind] (var uz))
+ where appCons :: (HsName, HsName) -> HsExp
+ appCons (x, xs) = metaCons (var x) (var xs)
+
+matchFunction :: String -> [HsExp] -> HsExp
+matchFunction s es = mf s (reverse es)
+ where mf s [] = match_qual $ HsIdent s
+ mf s (e:es) = app (mf s es) e
+
+-- | Some 'magic' gensym-like functions, and functions
+-- with related functionality.
+retname :: HsName
+retname = name "harp_ret"
+
+varsname :: HsName
+varsname = name "harp_vars"
+
+valname :: HsName
+valname = name "harp_val"
+
+valsname :: HsName
+valsname = name "harp_vals"
+
+valsvarsname :: HsName
+valsvarsname = name "harp_vvs"
+
+mkValName :: Int -> HsName
+mkValName k = name $ "harp_val" ++ show k
+
+extendVar :: HsName -> String -> HsName
+extendVar (HsIdent n) s = HsIdent $ n ++ s
+extendVar n _ = n
+
+xNameParts :: HsXName -> (Maybe String, String)
+xNameParts n = case n of
+ HsXName s -> (Nothing, s)
+ HsXDomName d s -> (Just d, s)
+
+---------------------------------------------------------
+-- meta-level functions, i.e. functions that represent functions,
+-- and that take arguments representing arguments... whew!
+
+metaReturn, metaConst, metaMap, metaUnzip :: HsExp -> HsExp
+metaReturn e = metaFunction "return" [e]
+metaConst e = metaFunction "const" [e]
+metaMap e = metaFunction "map" [e]
+metaUnzip e = metaFunction "unzip" [e]
+
+metaEither, metaMaybe :: HsExp -> HsExp -> HsExp
+metaEither e1 e2 = metaFunction "either" [e1,e2]
+metaMaybe e1 e2 = metaFunction "maybe" [e1,e2]
+
+metaConcat :: [HsExp] -> HsExp
+metaConcat es = metaFunction "concat" [listE es]
+
+metaAppend :: HsExp -> HsExp -> HsExp
+metaAppend l1 l2 = infixApp l1 appendOp l2
+
+-- the +++ choice operator
+metaChoice :: HsExp -> HsExp -> HsExp
+metaChoice e1 e2 = infixApp e1 choiceOp e2
+
+metaPCons :: HsPat -> HsPat -> HsPat
+metaPCons p1 p2 = HsPInfixApp p1 cons p2
+
+metaCons, metaComp :: HsExp -> HsExp -> HsExp
+metaCons e1 e2 = infixApp e1 (HsQConOp cons) e2
+metaComp e1 e2 = infixApp e1 (op fcomp) e2
+
+metaPJust :: HsPat -> HsPat
+metaPJust p = pApp just_name [p]
+
+metaPNothing :: HsPat
+metaPNothing = pvar nothing_name
+
+metaPMkMaybe :: Maybe HsPat -> HsPat
+metaPMkMaybe mp = case mp of
+ Nothing -> metaPNothing
+ Just p -> pParen $ metaPJust p
+
+metaJust :: HsExp -> HsExp
+metaJust e = app (var just_name) e
+
+metaNothing :: HsExp
+metaNothing = var nothing_name
+
+metaMkMaybe :: Maybe HsExp -> HsExp
+metaMkMaybe me = case me of
+ Nothing -> metaNothing
+ Just e -> paren $ metaJust e
+
+---------------------------------------------------
+-- some other useful functions at abstract level
+consFun, idFun :: HsExp
+consFun = HsCon cons
+idFun = function "id"
+
+cons :: HsQName
+cons = Special HsCons
+
+fcomp, choice, append :: HsName
+fcomp = HsSymbol "."
+choice = HsSymbol "+++"
+append = HsSymbol "++"
+
+just_name, nothing_name, left_name, right_name :: HsName
+just_name = HsIdent "Just"
+nothing_name = HsIdent "Nothing"
+left_name = HsIdent "Left"
+right_name = HsIdent "Right"
+
+------------------------------------------------------------------------
+-- Help functions for meta programming xml
+
+hsx_data_mod :: Module
+hsx_data_mod = Module "HSP.Data"
+
+-- | Create an xml PCDATA value
+metaMkPcdata :: String -> HsExp
+metaMkPcdata s = metaFunction "pcdata" [strE s]
+
+-- | Create an xml tag, given its domain, name, attributes and
+-- children.
+metaMkTag :: HsXName -> [HsExp] -> Maybe HsExp -> [HsExp] -> HsExp
+metaMkTag name ats mat cs =
+ let (d,n) = xNameParts name
+ ne = tuple [metaMkMaybe $ fmap strE d, strE n]
+ m = maybe id (\x y -> paren $ y `metaAppend` (metaMap $ metaToAttribute x)) mat
+ attrs = m $ listE $ map metaToAttribute ats
+ in metaFunction "genTag" [ne, attrs, listE cs]
+
+-- | Create an empty xml tag, given its domain, name and attributes.
+metaMkETag :: HsXName -> [HsExp] -> Maybe HsExp -> HsExp
+metaMkETag name ats mat =
+ let (d,n) = xNameParts name
+ ne = tuple [metaMkMaybe $ fmap strE d, strE n]
+ m = maybe id (\x y -> paren $ y `metaAppend` (metaMap $ metaToAttribute x)) mat
+ attrs = m $ listE $ map metaToAttribute ats
+ in metaFunction "genETag" [ne, attrs]
+
+-- | Create an attribute by applying the overloaded @toAttribute@
+metaToAttribute :: HsExp -> HsExp
+metaToAttribute e = metaFunction "toAttribute" [e]
+
+-- | Create a property from an attribute and a value.
+metaAssign :: HsExp -> HsExp -> HsExp
+metaAssign e1 e2 = infixApp e1 assignOp e2
+ where assignOp = HsQVarOp $ UnQual $ HsSymbol ":="
+
+-- | Make xml out of some expression by applying the overloaded function
+-- @toXml at .
+metaToXmls :: HsExp -> HsExp
+metaToXmls e = metaFunction "toXMLs" [paren e]
+
+-- | Lookup an attribute in the set of attributes.
+metaExtract :: HsXName -> HsName -> HsExp
+metaExtract name attrs =
+ let (d,n) = xNameParts name
+ np = tuple [metaMkMaybe $ fmap strE d, strE n]
+ in metaFunction "extract" [np, var attrs]
+
+-- | Generate a pattern under the Tag data constructor.
+metaTag :: (Maybe String) -> String -> HsPat -> HsPat -> HsPat
+metaTag dom name ats cpat =
+ let d = metaPMkMaybe $ fmap strP dom
+ n = pTuple [d, strP name]
+ in metaConPat "Tag" [n, ats, cpat]
+
+-- | Generate a pattern under the PCDATA data constructor.
+metaPcdata :: String -> HsPat
+metaPcdata s = metaConPat "PCDATA" [strP s]
+
+metaMkName :: HsXName -> HsExp
+metaMkName n = case n of
+ HsXName s -> strE s
+ HsXDomName d s -> tuple [strE d, strE s]
diff -rN -u old-fenfire-hs/Preprocessor/Hsx.hs new-fenfire-hs/Preprocessor/Hsx.hs
--- old-fenfire-hs/Preprocessor/Hsx.hs 1970-01-01 02:00:00.000000000 +0200
+++ new-fenfire-hs/Preprocessor/Hsx.hs 2007-02-12 19:32:17.000000000 +0200
@@ -0,0 +1,27 @@
+module Preprocessor.Hsx (
+ module Preprocessor.Hsx.Syntax
+ , module Preprocessor.Hsx.Build
+ , module Preprocessor.Hsx.Parser
+ , module Preprocessor.Hsx.Pretty
+ , module Preprocessor.Hsx.Transform
+ , parseFileContents
+ , parseFileContentsWithMode
+ , parseFile
+ ) where
+
+import Preprocessor.Hsx.Build
+import Preprocessor.Hsx.Syntax
+import Preprocessor.Hsx.Parser
+import Preprocessor.Hsx.Pretty
+import Preprocessor.Hsx.Transform
+
+parseFile :: FilePath -> IO (ParseResult HsModule)
+parseFile fp = readFile fp >>= (return . parseFileContentsWithMode (ParseMode fp))
+
+parseFileContents :: String -> ParseResult HsModule
+parseFileContents = parseFileContentsWithMode defaultParseMode
+
+parseFileContentsWithMode :: ParseMode -> String -> ParseResult HsModule
+parseFileContentsWithMode p rawStr =
+ let cleanStr = unlines [ s | s@(c:_) <- lines rawStr, c /= '#' ]
+ in parseModuleWithMode p cleanStr
diff -rN -u old-fenfire-hs/Preprocessor/Main.hs new-fenfire-hs/Preprocessor/Main.hs
--- old-fenfire-hs/Preprocessor/Main.hs 1970-01-01 02:00:00.000000000 +0200
+++ new-fenfire-hs/Preprocessor/Main.hs 2007-02-12 19:32:17.000000000 +0200
@@ -0,0 +1,56 @@
+module Main where
+
+import Preprocessor.Hsx
+
+import System.Environment (getArgs)
+import Data.List (intersperse, isPrefixOf)
+
+checkParse p = case p of
+ ParseOk m -> m
+ ParseFailed loc s -> error $ "Error at " ++ show loc ++ ":\n" ++ s
+
+transformFile :: String -> String -> String -> IO ()
+transformFile origfile infile outfile = do
+ f <- readFile infile
+ let fm = process origfile f
+ writeFile outfile fm
+
+testFile :: String -> IO ()
+testFile file = do
+ f <- readFile file
+ putStrLn $ process file f
+
+
+testTransform :: String -> IO ()
+testTransform file = do
+ f <- readFile file
+ putStrLn $ show $ transform $ checkParse $ parse file f
+
+testPretty :: String -> IO ()
+testPretty file = do
+ f <- readFile file
+ putStrLn $ prettyPrint $ checkParse $ parse file f
+
+testParse :: String -> IO ()
+testParse file = do
+ f <- readFile file
+ putStrLn $ show $ parse file f
+
+main :: IO ()
+main = do args <- getArgs
+ case args of
+ [origfile, infile, outfile] -> transformFile origfile infile outfile
+ [infile, outfile] -> transformFile infile infile outfile
+ [infile] -> testFile infile
+ _ -> putStrLn usageString
+
+
+process :: FilePath -> String -> String
+process fp fc = prettyPrintWithMode (defaultMode {linePragmas=True}) $
+ transform $ checkParse $ parse fp fc
+
+parse fn fc = parseModuleWithMode (ParseMode fn) fcuc
+ where fcuc= unlines $ filter (not . isPrefixOf "#") $ lines fc
+
+
+usageString = "Usage: trhsx <infile> [<outfile>]"
diff -rN -u old-fenfire-hs/Setup.hs new-fenfire-hs/Setup.hs
--- old-fenfire-hs/Setup.hs 2007-02-12 19:32:17.000000000 +0200
+++ new-fenfire-hs/Setup.hs 2007-02-12 19:32:17.000000000 +0200
@@ -12,11 +12,15 @@
trhsx :: PPSuffixHandler
trhsx = ("fhs", f) where
f buildInfo localBuildInfo inFile outFile verbose = do
+ when (verbose > 3) $
+ putStrLn ("checking that preprocessor is up-to-date")
+ system ("ghc --make Preprocessor/Main.hs -o preprocessor")
+
when (verbose > 0) $
putStrLn ("preprocessing "++inFile++" to "++outFile)
writeFile outFile ("-- GENERATED file. Edit the ORIGINAL "++inFile++
" instead.\n")
- system ("trhsx "++inFile++" >> "++outFile)
+ system ("./preprocessor "++inFile++" >> "++outFile)
c2hs :: PPSuffixHandler
c2hs = ("chs", f) where
More information about the Fencommits
mailing list