diff --git a/src-3.0/GF/CF/CFtoGrammar.hs b/src-3.0/GF/CF/CFtoGrammar.hs index 5e73aec31..ebf97db91 100644 --- a/src-3.0/GF/CF/CFtoGrammar.hs +++ b/src-3.0/GF/CF/CFtoGrammar.hs @@ -46,7 +46,7 @@ cf2rule :: CFRule -> ((Ident,Info),(Ident,Info)) cf2rule (fun, (cat, items)) = (def,ldef) where f = cfFun2Ident fun def = (f, AbsFun (yes (mkProd (args', Cn (cfCat2Ident cat), []))) nope) - args0 = zip (map (mkIdent "x") [0..]) items + args0 = zip (map (identV "x") [0..]) items args = [(v, Cn (cfCat2Ident c)) | (v, CFNonterm c) <- args0] args' = [(zIdent "_", Cn (cfCat2Ident c)) | (_, CFNonterm c) <- args0] ldef = (f, CncFun diff --git a/src-3.0/GF/Canon/GFC.hs b/src-3.0/GF/Canon/GFC.hs index ae9097c44..9e93835f7 100644 --- a/src-3.0/GF/Canon/GFC.hs +++ b/src-3.0/GF/Canon/GFC.hs @@ -39,6 +39,7 @@ import GF.Data.Operations import qualified GF.Infra.Modules as M import Data.Char +import qualified Data.ByteString.Char8 as BS import Control.Arrow (first) type Context = [(Ident,Exp)] @@ -73,7 +74,7 @@ mapInfoTerms f i = case i of _ -> i setFlag :: String -> String -> [Flag] -> [Flag] -setFlag n v fs = flagCanon n v : [f | f@(Flg (IC n') _) <- fs, n' /= n] +setFlag n v fs = flagCanon n v : [f | f@(Flg (IC n') _) <- fs, n' /= BS.pack n] flagIncomplete :: Flag flagIncomplete = flagCanon "incomplete" "true" @@ -86,7 +87,7 @@ hasFlagCanon f (_,M.ModMod mo) = elem f $ M.flags mo hasFlagCanon f _ = True ---- safe, useless flagCanon :: String -> String -> Flag -flagCanon f v = Flg (identC f) (identC v) +flagCanon f v = Flg (identC (BS.pack f)) (identC (BS.pack v)) -- for Ha-Jo 20/2/2005 diff --git a/src-3.0/GF/Command/Commands.hs b/src-3.0/GF/Command/Commands.hs index d5b5a8768..7f84805f6 100644 --- a/src-3.0/GF/Command/Commands.hs +++ b/src-3.0/GF/Command/Commands.hs @@ -12,6 +12,7 @@ module GF.Command.Commands ( import GF.Command.AbsGFShell hiding (Tree) import GF.Command.PPrTree import GF.Command.ParGFShell +import GF.GFCC.CId import GF.GFCC.ShowLinearize import GF.GFCC.API import GF.GFCC.Macros @@ -131,10 +132,10 @@ allCommands mgr = Map.fromAscList [ optLin opts t = unlines [linea lang t | lang <- optLangs opts] where linea lang = case opts of - _ | isOpt "all" opts -> allLinearize gr (cid lang) - _ | isOpt "table" opts -> tableLinearize gr (cid lang) - _ | isOpt "term" opts -> termLinearize gr (cid lang) - _ | isOpt "record" opts -> recordLinearize gr (cid lang) + _ | isOpt "all" opts -> allLinearize gr (mkCId lang) + _ | isOpt "table" opts -> tableLinearize gr (mkCId lang) + _ | isOpt "term" opts -> termLinearize gr (mkCId lang) + _ | isOpt "record" opts -> recordLinearize gr (mkCId lang) _ -> linearize mgr lang diff --git a/src-3.0/GF/Command/PPrTree.hs b/src-3.0/GF/Command/PPrTree.hs index 7372c722d..f80484799 100644 --- a/src-3.0/GF/Command/PPrTree.hs +++ b/src-3.0/GF/Command/PPrTree.hs @@ -21,7 +21,7 @@ tree2exp t = case t of TStr s -> tree (AS s) [] TFloat d -> tree (AF d) [] where - i2i (Ident s) = CId s + i2i (Ident s) = mkCId s prExp :: Exp -> String prExp = printTree . exp2tree @@ -36,4 +36,4 @@ exp2tree (DTr xs at ts) = tabs (map i4i xs) (tapp at (map exp2tree ts)) tapp (AS i) [] = TStr i tapp (AF i) [] = TFloat i tapp (AM i) [] = TId (Ident "?") ---- - i4i (CId s) = Ident s + i4i s = Ident (prCId s) diff --git a/src-3.0/GF/Compile/API.hs b/src-3.0/GF/Compile/API.hs index 242a9e87a..7e852cf7a 100644 --- a/src-3.0/GF/Compile/API.hs +++ b/src-3.0/GF/Compile/API.hs @@ -10,7 +10,7 @@ import GF.Devel.UseIO -- | Compiles a number of source files and builds a 'GFCC' structure for them. compileToGFCC :: Options -> [FilePath] -> IOE GFCC -compileToGFCC opts fs = +compileToGFCC opts fs = do gr <- batchCompile opts fs let name = justModuleName (last fs) gc1 <- putPointE opts "linking ... " $ diff --git a/src-3.0/GF/Compile/BackOpt.hs b/src-3.0/GF/Compile/BackOpt.hs index 8356f2ba2..0f74bbf92 100644 --- a/src-3.0/GF/Compile/BackOpt.hs +++ b/src-3.0/GF/Compile/BackOpt.hs @@ -24,6 +24,7 @@ import GF.Grammar.PrGrammar (prt) import GF.Data.Operations import Data.List import qualified GF.Infra.Modules as M +import qualified Data.ByteString.Char8 as BS type OptSpec = [Integer] --- @@ -110,7 +111,7 @@ factor c i t = case t of --- we hope this will be fresh and don't check... in GFC would be safe -qqIdent c i = identC ("q_" ++ prt c ++ "__" ++ show i) +qqIdent c i = identC (BS.pack ("q_" ++ prt c ++ "__" ++ show i)) -- we need to replace subterms diff --git a/src-3.0/GF/Compile/Flatten.hs b/src-3.0/GF/Compile/Flatten.hs index 6b25edebb..1168ca6da 100644 --- a/src-3.0/GF/Compile/Flatten.hs +++ b/src-3.0/GF/Compile/Flatten.hs @@ -42,7 +42,7 @@ mkRules conf f t = (fun f ty, lin f (takeWhile (/=':') t)) where args = mkArgs conf ts ty = concat [a ++ " -> " | a <- map snd args] ++ val (ts,val) = let tt = lexTerm t in (init tt,last tt) ---- f = mkIdent t +--- f = identV t fun c a = unwords [" fun", c, ":",a,";"] lin c a = unwords $ [" lin", c] ++ map fst args ++ ["=",a,";"] diff --git a/src-3.0/GF/Compile/Optimize.hs b/src-3.0/GF/Compile/Optimize.hs index a540ee715..8931cb6a2 100644 --- a/src-3.0/GF/Compile/Optimize.hs +++ b/src-3.0/GF/Compile/Optimize.hs @@ -130,9 +130,9 @@ evalCncInfo opts gr cnc abs (c,info) = do CncCat ptyp pde ppr -> do pde' <- case (ptyp,pde) of (Yes typ, Yes de) -> - liftM yes $ pEval ([(strVar, typeStr)], typ) de + liftM yes $ pEval ([(varStr, typeStr)], typ) de (Yes typ, Nope) -> - liftM yes $ mkLinDefault gr typ >>= partEval noOptions gr ([(strVar, typeStr)],typ) + liftM yes $ mkLinDefault gr typ >>= partEval noOptions gr ([(varStr, typeStr)],typ) (May b, Nope) -> return $ May b _ -> return pde -- indirection @@ -248,7 +248,7 @@ recordExpand typ trm = case unComputed typ of mkLinDefault :: SourceGrammar -> Type -> Err Term mkLinDefault gr typ = do case unComputed typ of - RecType lts -> mapPairsM mkDefField lts >>= (return . Abs strVar . R . mkAssign) + RecType lts -> mapPairsM mkDefField lts >>= (return . Abs varStr . R . mkAssign) _ -> prtBad "linearization type must be a record type, not" typ where mkDefField typ = case unComputed typ of @@ -256,7 +256,7 @@ mkLinDefault gr typ = do t' <- mkDefField t let T _ cs = mkWildCases t' return $ T (TWild p) cs - Sort "Str" -> return $ Vr strVar + Sort "Str" -> return $ Vr varStr QC q p -> lookupFirstTag gr q p RecType r -> do let (ls,ts) = unzip r diff --git a/src-3.0/GF/Compile/RemoveLiT.hs b/src-3.0/GF/Compile/RemoveLiT.hs index 28aae9b84..02ff58bc7 100644 --- a/src-3.0/GF/Compile/RemoveLiT.hs +++ b/src-3.0/GF/Compile/RemoveLiT.hs @@ -23,6 +23,7 @@ import GF.Infra.Ident import GF.Infra.Modules import GF.Grammar.Macros import GF.Grammar.Lookup +import GF.Grammar.Predef import GF.Data.Operations @@ -60,4 +61,4 @@ remlTerm gr trm = case trm of look c = err (const $ return defLinType) return $ lookupLincat gr m c m = case [cnc | (cnc,ModMod m) <- modules gr, isModCnc m] of cnc:_ -> cnc -- actually there is always exactly one - _ -> zIdent "CNC" + _ -> cCNC diff --git a/src-3.0/GF/Compile/Rename.hs b/src-3.0/GF/Compile/Rename.hs index c3fef557b..68f4d754f 100644 --- a/src-3.0/GF/Compile/Rename.hs +++ b/src-3.0/GF/Compile/Rename.hs @@ -29,6 +29,7 @@ module GF.Compile.Rename (renameGrammar, import GF.Grammar.Grammar import GF.Grammar.Values +import GF.Grammar.Predef import GF.Infra.Modules import GF.Infra.Ident import GF.Grammar.Macros @@ -90,11 +91,9 @@ renameIdentTerm env@(act,imps) t = [(m, st) | (OSimple _ m, st) <- imps] -- qualif is always possible -- this facility is mainly for BWC with GF1: you need not import PredefAbs - predefAbs c s = case c of - IC "Int" -> return $ Q cPredefAbs cInt - IC "Float" -> return $ Q cPredefAbs cFloat - IC "String" -> return $ Q cPredefAbs cString - _ -> Bad s + predefAbs c s + | isPredefCat c = return $ Q cPredefAbs c + | otherwise = Bad s ident alt c = case lookupTree prt c act of Ok f -> return $ f c @@ -104,7 +103,6 @@ renameIdentTerm env@(act,imps) t = fs -> case nub [f c | f <- fs] of [tr] -> return tr ts@(t:_) -> trace ("WARNING: conflict" +++ unwords (map prt ts)) (return t) ----- ts -> return $ Strs $ (cnIC "#conflict") : reverse ts -- a warning will be generated in CheckGrammar, and the head returned -- in next V: -- Bad $ "conflicting imports:" +++ unwords (map prt ts) diff --git a/src-3.0/GF/Conversion/SimpleToFCFG.hs b/src-3.0/GF/Conversion/SimpleToFCFG.hs index 4ff5781f9..554150658 100644 --- a/src-3.0/GF/Conversion/SimpleToFCFG.hs +++ b/src-3.0/GF/Conversion/SimpleToFCFG.hs @@ -33,6 +33,7 @@ import GF.Data.Utilities (updateNthM, sortNub) import qualified Data.Map as Map import qualified Data.Set as Set import qualified Data.List as List +import qualified Data.ByteString.Char8 as BS import Data.Array import Data.Maybe @@ -81,24 +82,24 @@ expandHOAS funs lins lincats = (funs' ++ hoFuns ++ varFuns, modifyRec f (R xs) = R (f xs) modifyRec _ t = error $ "Not a record: " ++ show t - varCat = CId "_Var" + varCat = mkCId "_Var" catName :: (Int,CId) -> CId catName (0,c) = c - catName (n,CId c) = CId ("_" ++ show n ++ c) + catName (n,c) = mkCId ("_" ++ show n ++ prt c) funName :: (Int,CId) -> CId - funName (n,CId c) = CId ("__" ++ show n ++ c) + funName (n,c) = mkCId ("__" ++ show n ++ prt c) varFunName :: CId -> CId - varFunName (CId c) = CId ("_Var_" ++ c) + varFunName c = mkCId ("_Var_" ++ prt c) -- replaces __NCat with _B and _Var_Cat with _. -- the temporary names are just there to avoid name collisions. fixHoasFuns :: FGrammar -> FGrammar fixHoasFuns (rs, cs) = ([FRule (fixName n) args cat lins | FRule n args cat lins <- rs], cs) - where fixName (Name (CId ('_':'_':_)) p) = Name (CId "_B") p - fixName (Name (CId n) p) | "_Var_" `List.isPrefixOf` n = Name wildCId p + where fixName (Name (CId n) p) | BS.pack "__" `BS.isPrefixOf` n = Name (mkCId "_B") p + | BS.pack "_Var_" `BS.isPrefixOf` n = Name wildCId p fixName n = n convert :: [(CId,(Type,Exp))] -> TermMap -> TermMap -> FGrammar @@ -291,10 +292,10 @@ data ProtoFCat = PFCat CId [FPath] [(FPath,FIndex)] protoFCat :: CId -> ProtoFCat protoFCat cat = PFCat cat [] [] -emptyFRulesEnv = FRulesEnv 0 (ins fcatString (CId "String") [[0]] [] $ - ins fcatInt (CId "Int") [[0]] [] $ - ins fcatFloat (CId "Float") [[0]] [] $ - ins fcatVar (CId "_Var") [[0]] [] $ +emptyFRulesEnv = FRulesEnv 0 (ins fcatString (mkCId "String") [[0]] [] $ + ins fcatInt (mkCId "Int") [[0]] [] $ + ins fcatFloat (mkCId "Float") [[0]] [] $ + ins fcatVar (mkCId "_Var") [[0]] [] $ Map.empty) [] where ins fcat cat rcs tcs fcatSet = @@ -340,7 +341,7 @@ genFCatArg cnc_defs ctype env@(FRulesEnv last_id fcatSet rules) (PFCat cat rcs t (either_fcat,last_id1,tmap1,rules1) = foldBM (\tcs st (either_fcat,last_id,tmap,rules) -> let (last_id1,tmap1,fcat_arg) = addArg tcs last_id tmap - rule = FRule (Name (CId "_") [Unify [0]]) [fcat_arg] fcat + rule = FRule (Name wildCId [Unify [0]]) [fcat_arg] fcat (listArray (0,length rcs-1) [listArray (0,0) [FSymCat fcat_arg lbl 0] | lbl <- [0..length rcs-1]]) in if st then (Right fcat, last_id1,tmap1,rule:rules) diff --git a/src-3.0/GF/Conversion/Types.hs b/src-3.0/GF/Conversion/Types.hs index 97c2ace05..3fdb3c5e4 100644 --- a/src-3.0/GF/Conversion/Types.hs +++ b/src-3.0/GF/Conversion/Types.hs @@ -89,7 +89,7 @@ sameECat :: ECat -> ECat -> Bool sameECat ec1 ec2 = ecat2scat ec1 == ecat2scat ec2 coercionName :: Name -coercionName = Name Ident.wildIdent [Unify [0]] +coercionName = Name Ident.identW [Unify [0]] isCoercion :: Name -> Bool isCoercion (Name fun [Unify [0]]) = Ident.isWildIdent fun diff --git a/src-3.0/GF/Devel/CheckGrammar.hs b/src-3.0/GF/Devel/CheckGrammar.hs index 0910802d1..c88bc250e 100644 --- a/src-3.0/GF/Devel/CheckGrammar.hs +++ b/src-3.0/GF/Devel/CheckGrammar.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE PatternGuards #-} ---------------------------------------------------------------------- -- | -- Module : CheckGrammar @@ -29,11 +30,12 @@ import GF.Infra.Modules import GF.Grammar.Refresh ---- import GF.Devel.TypeCheck -import GF.Grammar.Values (cPredefAbs) --- +import GF.Grammar.Predef (cPredef, cPredefAbs) --- import GF.Grammar.PrGrammar import GF.Grammar.Lookup import GF.Grammar.LookAbs +import GF.Grammar.Predef import GF.Grammar.Macros import GF.Grammar.ReservedWords ---- import GF.Grammar.PatternMatch @@ -334,16 +336,10 @@ computeLType gr t = do checkInContext g $ comp t where comp ty = case ty of - - App (Q (IC "Predef") (IC "Ints")) _ -> return ty ---- shouldn't be needed - Q (IC "Predef") (IC "Int") -> return ty ---- shouldn't be needed - Q (IC "Predef") (IC "Float") -> return ty ---- shouldn't be needed - Q (IC "Predef") (IC "Error") -> return ty ---- shouldn't be needed - - Q m c | elem c [cPredef,cPredefAbs] -> return ty - Q m c | elem c [zIdent "Int"] -> - return $ linTypeInt - Q m c | elem c [zIdent "Float",zIdent "String"] -> return defLinType ---- + _ | Just _ <- isTypeInts ty -> return ty ---- shouldn't be needed + | ty == typeInt -> return ty ---- shouldn't be needed + | ty == typeFloat -> return ty ---- shouldn't be needed + | ty == typeError -> return ty ---- shouldn't be needed Q m ident -> checkIn ("module" +++ prt m) $ do ty' <- checkErr (lookupResDef gr m ident) @@ -525,7 +521,7 @@ inferLType gr trm = case trm of check2 (flip justCheck typeStr) Glue s1 s2 typeStr ---- typeTok ---- hack from Rename.identRenameTerm, to live with files with naming conflicts 18/6/2007 - Strs (Cn (IC "#conflict") : ts) -> do + Strs (Cn c : ts) | c == cConflict -> do trace ("WARNING: unresolved constant, could be any of" +++ unwords (map prt ts)) (infer $ head ts) -- checkWarn ("WARNING: unresolved constant, could be any of" +++ unwords (map prt ts)) -- infer $ head ts @@ -964,7 +960,7 @@ checkIfEqLType env t u trm = do alpha g t u = case (t,u) of -- error (the empty type!) is subtype of any other type - (_,Q (IC "Predef") (IC "Error")) -> True + (_,u) | u == typeError -> True -- contravariance (Prod x a b, Prod y c d) -> alpha g c a && alpha ((x,y):g) b d @@ -976,13 +972,9 @@ checkIfEqLType env t u trm = do (ExtR r s, t) -> alpha g r t || alpha g s t -- the following say that Ints n is a subset of Int and of Ints m >= n - (App (Q (IC "Predef") (IC "Ints")) (EInt n), - App (Q (IC "Predef") (IC "Ints")) (EInt m)) -> m >= n - (App (Q (IC "Predef") (IC "Ints")) (EInt n), - Q (IC "Predef") (IC "Int")) -> True ---- check size! - - (Q (IC "Predef") (IC "Int"), ---- why this ???? AR 11/12/2005 - App (Q (IC "Predef") (IC "Ints")) (EInt n)) -> True + (t,u) | Just m <- isTypeInts t, Just n <- isTypeInts t -> m >= n + | Just _ <- isTypeInts t, u == typeInt -> True ---- check size! + | t == typeInt, Just _ <- isTypeInts t -> True ---- why this ???? AR 11/12/2005 ---- this should be made in Rename (Q m a, Q n b) | a == b -> elem m (allExtendsPlus env n) diff --git a/src-3.0/GF/Devel/Compile/SourceToGF.hs b/src-3.0/GF/Devel/Compile/SourceToGF.hs index a62179c18..3b7daa970 100644 --- a/src-3.0/GF/Devel/Compile/SourceToGF.hs +++ b/src-3.0/GF/Devel/Compile/SourceToGF.hs @@ -235,7 +235,7 @@ transCatDef x = case x of constyp = mkProd (cont ++ [cd, M.mkDecl lc]) lc consfund = (consId, absFun constyp) ---- (yes constyp) (yes G.EData)) return [catd,nilfund,consfund] - mkId x i = if isWildIdent x then (mkIdent "x" i) else x + mkId x i = if isWildIdent x then (identV "x" i) else x transFunDef :: FunDef -> Err ([Ident], G.Type) transFunDef x = case x of diff --git a/src-3.0/GF/Devel/Compute.hs b/src-3.0/GF/Devel/Compute.hs index a9081c28a..a44ee5424 100644 --- a/src-3.0/GF/Devel/Compute.hs +++ b/src-3.0/GF/Devel/Compute.hs @@ -21,6 +21,7 @@ import GF.Infra.Option import GF.Data.Str import GF.Grammar.PrGrammar import GF.Infra.Modules +import GF.Grammar.Predef import GF.Grammar.Macros import GF.Grammar.Lookup import GF.Grammar.Refresh @@ -50,8 +51,8 @@ computeTermOpt rec gr = comput True where comput full g t = ---- errIn ("subterm" +++ prt t) $ --- for debugging case t of - Q (IC "Predef") _ -> return t - Q p c -> look p c + Q p c | p == cPredef -> return t + | otherwise -> look p c -- if computed do nothing Computed t' -> return $ unComputed t' @@ -89,7 +90,7 @@ computeTermOpt rec gr = comput True where _ | not (null [() | FV _ <- as']) -> compApp g (mkApp h' as') c@(QC _ _) -> do return $ mkApp c as' - Q (IC "Predef") f -> do + Q mod f | mod == cPredef -> do (t',b) <- appPredefined (mkApp h' as') if b then return t' else comp g t' @@ -446,8 +447,8 @@ computeTermOpt rec gr = comput True where -- | argument variables cannot be glued checkNoArgVars :: Term -> Err Term checkNoArgVars t = case t of - Vr (IA _) -> Bad $ glueErrorMsg $ prt t - Vr (IAV _) -> Bad $ glueErrorMsg $ prt t + Vr (IA _ _) -> Bad $ glueErrorMsg $ prt t + Vr (IAV _ _ _) -> Bad $ glueErrorMsg $ prt t _ -> composOp checkNoArgVars t glueErrorMsg s = diff --git a/src-3.0/GF/Devel/GFC.hs b/src-3.0/GF/Devel/GFC.hs index 27e0e3ae2..13e47e788 100644 --- a/src-3.0/GF/Devel/GFC.hs +++ b/src-3.0/GF/Devel/GFC.hs @@ -40,7 +40,7 @@ mainGFC xx = do targetName :: Options -> CId -> String targetName opts abs = case getOptVal opts (aOpt "target") of Just n -> n - _ -> prIdent abs + _ -> prCId abs targetNameGFCC :: Options -> CId -> FilePath targetNameGFCC opts abs = targetName opts abs ++ ".gfcc" diff --git a/src-3.0/GF/Devel/GFCCtoHaskell.hs b/src-3.0/GF/Devel/GFCCtoHaskell.hs index aa3eebe58..4b042d9ec 100644 --- a/src-3.0/GF/Devel/GFCCtoHaskell.hs +++ b/src-3.0/GF/Devel/GFCCtoHaskell.hs @@ -175,15 +175,14 @@ fInstance m (cat,rules) = --type HSkeleton = [(OIdent, [(OIdent, [OIdent])])] hSkeleton :: GFCC -> (String,HSkeleton) hSkeleton gr = - (pr (absname gr), - [(pr c, [(pr f, map pr cs) | (f, (cs,_)) <- fs]) | + (prCId (absname gr), + [(prCId c, [(prCId f, map prCId cs) | (f, (cs,_)) <- fs]) | fs@((_, (_,c)):_) <- fns] ) where fns = groupBy valtypg (sortBy valtyps (map jty (Map.assocs (funs (abstract gr))))) valtyps (_, (_,x)) (_, (_,y)) = compare x y valtypg (_, (_,x)) (_, (_,y)) = x == y - pr (CId c) = c jty (f,(ty,_)) = (f,catSkeleton ty) updateSkeleton :: OIdent -> HSkeleton -> (OIdent, [OIdent]) -> HSkeleton diff --git a/src-3.0/GF/Devel/GFCCtoJS.hs b/src-3.0/GF/Devel/GFCCtoJS.hs index c61ad08d5..80a4115d2 100644 --- a/src-3.0/GF/Devel/GFCCtoJS.hs +++ b/src-3.0/GF/Devel/GFCCtoJS.hs @@ -24,7 +24,7 @@ gfcc2js :: D.GFCC -> String gfcc2js gfcc = encodeUTF8 $ JS.printTree $ JS.Program [JS.ElStmt $ JS.SDeclOrExpr $ JS.Decl [JS.DInit (JS.Ident n) grammar]] where - n = D.printCId $ D.absname gfcc + n = prCId $ D.absname gfcc as = D.abstract gfcc cs = Map.assocs (D.concretes gfcc) start = M.lookStartCat gfcc @@ -36,16 +36,16 @@ abstract2js :: String -> D.Abstr -> JS.Expr abstract2js start ds = new "GFAbstract" [JS.EStr start, JS.EObj $ map absdef2js (Map.assocs (D.funs ds))] absdef2js :: (CId,(D.Type,D.Exp)) -> JS.Property -absdef2js (CId f,(typ,_)) = - let (args,CId cat) = M.catSkeleton typ in - JS.Prop (JS.StringPropName f) (new "Type" [JS.EArray [JS.EStr x | CId x <- args], JS.EStr cat]) +absdef2js (f,(typ,_)) = + let (args,cat) = M.catSkeleton typ in + JS.Prop (JS.IdentPropName (JS.Ident (prCId f))) (new "Type" [JS.EArray [JS.EStr (prCId x) | x <- args], JS.EStr (prCId cat)]) concrete2js :: String -> String -> (CId,D.Concr) -> JS.Property -concrete2js start n (CId c, cnc) = - JS.Prop l (new "GFConcrete" ([(JS.EObj $ ((map (cncdef2js n c) ds) ++ litslins))] ++ +concrete2js start n (c, cnc) = + JS.Prop l (new "GFConcrete" ([(JS.EObj $ ((map (cncdef2js n (prCId c)) ds) ++ litslins))] ++ maybe [] (parser2js start) (D.parser cnc))) where - l = JS.StringPropName c + l = JS.IdentPropName (JS.Ident (prCId c)) ds = concatMap Map.assocs [D.lins cnc, D.opers cnc, D.lindefs cnc] litslins = [JS.Prop (JS.StringPropName "Int") (JS.EFun [children] [JS.SReturn $ new "Arr" [JS.EIndex (JS.EVar children) (JS.EInt 0)]]), JS.Prop (JS.StringPropName "Float") (JS.EFun [children] [JS.SReturn $ new "Arr" [JS.EIndex (JS.EVar children) (JS.EInt 0)]]), @@ -53,7 +53,7 @@ concrete2js start n (CId c, cnc) = cncdef2js :: String -> String -> (CId,D.Term) -> JS.Property -cncdef2js n l (CId f, t) = JS.Prop (JS.StringPropName f) (JS.EFun [children] [JS.SReturn (term2js n l t)]) +cncdef2js n l (f, t) = JS.Prop (JS.IdentPropName (JS.Ident (prCId f))) (JS.EFun [children] [JS.SReturn (term2js n l t)]) term2js :: String -> String -> D.Term -> JS.Expr term2js n l t = f t @@ -66,7 +66,7 @@ term2js n l t = f t D.K t -> tokn2js t D.V i -> JS.EIndex (JS.EVar children) (JS.EInt i) D.C i -> new "Int" [JS.EInt i] - D.F (CId f) -> JS.ECall (JS.EMember (JS.EIndex (JS.EMember (JS.EVar $ JS.Ident n) (JS.Ident "concretes")) (JS.EStr l)) (JS.Ident "rule")) [JS.EStr f, JS.EVar children] + D.F f -> JS.ECall (JS.EMember (JS.EIndex (JS.EMember (JS.EVar $ JS.Ident n) (JS.Ident "concretes")) (JS.EStr l)) (JS.Ident "rule")) [JS.EStr (prCId f), JS.EVar children] D.FV xs -> new "Variants" (map f xs) D.W str x -> new "Suffix" [JS.EStr str, f x] D.RP x y -> new "Rp" [f x, f y] @@ -95,15 +95,15 @@ parser2js start p = [new "Parser" [JS.EStr start, JS.EArray $ map frule2js (Array.elems (allRules p)), JS.EObj $ map cats (Map.assocs (startupCats p))]] where - cats (CId c,is) = JS.Prop (JS.StringPropName c) (JS.EArray (map JS.EInt is)) + cats (c,is) = JS.Prop (JS.IdentPropName (JS.Ident (prCId c))) (JS.EArray (map JS.EInt is)) frule2js :: FRule -> JS.Expr frule2js (FRule n args res lins) = new "Rule" [JS.EInt res, name2js n, JS.EArray (map JS.EInt args), lins2js lins] name2js :: FName -> JS.Expr name2js n = case n of - Name (CId "_") [p] -> fromProfile p - Name f ps -> new "FunApp" $ [JS.EStr $ prCId f, JS.EArray (map fromProfile ps)] + Name f [p] | f == wildCId -> fromProfile p + Name f ps -> new "FunApp" $ [JS.EStr $ prCId f, JS.EArray (map fromProfile ps)] where fromProfile :: Profile (SyntaxForest CId) -> JS.Expr fromProfile (Unify []) = new "MetaVar" [] diff --git a/src-3.0/GF/Devel/GFI.hs b/src-3.0/GF/Devel/GFI.hs index e68bbb077..f59bd15e6 100644 --- a/src-3.0/GF/Devel/GFI.hs +++ b/src-3.0/GF/Devel/GFI.hs @@ -5,7 +5,6 @@ import GF.Command.Importing import GF.Command.Commands import GF.GFCC.API -import GF.System.Arch (fetchCommand) import GF.Devel.UseIO import GF.Devel.Arch import GF.Infra.Option ---- Haskell's option lib @@ -21,7 +20,8 @@ mainGFI xx = do loop :: GFEnv -> IO GFEnv loop gfenv0 = do let env = commandenv gfenv0 - s <- fetchCommand (prompt env) + putStrFlush (prompt env) + s <- getLine let gfenv = gfenv0 {history = s : history gfenv0} case words s of diff --git a/src-3.0/GF/Devel/Grammar/AppPredefined.hs b/src-3.0/GF/Devel/Grammar/AppPredefined.hs index c8d2988fd..2c07b0d83 100644 --- a/src-3.0/GF/Devel/Grammar/AppPredefined.hs +++ b/src-3.0/GF/Devel/Grammar/AppPredefined.hs @@ -53,13 +53,13 @@ typPredefined c@(IC f) = case f of "plus" -> return $ mkFunType [cnPredef "Int",cnPredef "Int"] (cnPredef "Int") ---- "read" -> (P : Type) -> Tok -> P "show" -> return $ mkProds -- (P : PType) -> P -> Tok - ([(identC "P",typePType),(wildIdent,Vr (identC "P"))],typeStr,[]) + ([(identC "P",typePType),(identW,Vr (identC "P"))],typeStr,[]) "toStr" -> return $ mkProds -- (L : Type) -> L -> Str - ([(identC "L",typeType),(wildIdent,Vr (identC "L"))],typeStr,[]) + ([(identC "L",typeType),(identW,Vr (identC "L"))],typeStr,[]) "mapStr" -> let ty = identC "L" in return $ mkProds -- (L : Type) -> (Str -> Str) -> L -> L - ([(ty,typeType),(wildIdent,mkFunType [typeStr] typeStr),(wildIdent,Vr ty)],Vr ty,[]) + ([(ty,typeType),(identW,mkFunType [typeStr] typeStr),(identW,Vr ty)],Vr ty,[]) "take" -> return $ mkFunType [cnPredef "Int",typeStr] typeStr "tk" -> return $ mkFunType [cnPredef "Int",typeStr] typeStr _ -> prtBad "unknown in Predef:" c diff --git a/src-3.0/GF/Devel/Grammar/Macros.hs b/src-3.0/GF/Devel/Grammar/Macros.hs index 1a7a3582c..c1833c62c 100644 --- a/src-3.0/GF/Devel/Grammar/Macros.hs +++ b/src-3.0/GF/Devel/Grammar/Macros.hs @@ -81,7 +81,7 @@ typeSkeleton typ = do -- construct types and terms mkFunType :: [Type] -> Type -> Type -mkFunType tt t = mkProd ([(wildIdent, ty) | ty <- tt]) t -- nondep prod +mkFunType tt t = mkProd ([(identW, ty) | ty <- tt]) t -- nondep prod mkApp :: Term -> [Term] -> Term mkApp = foldl App @@ -121,7 +121,7 @@ unzipR :: [Assign] -> ([Label],[Term]) unzipR r = (ls, map snd ts) where (ls,ts) = unzip r mkDecl :: Term -> Decl -mkDecl typ = (wildIdent, typ) +mkDecl typ = (identW, typ) mkLet :: [LocalDef] -> Term -> Term mkLet defs t = foldr Let t defs @@ -336,7 +336,7 @@ changeTableType co i = case i of patt2term :: Patt -> Term patt2term pt = case pt of PV x -> Vr x - PW -> Vr wildIdent --- not parsable, should not occur + PW -> Vr identW --- not parsable, should not occur PC c pp -> mkApp (Con c) (map patt2term pp) PP p c pp -> mkApp (QC p c) (map patt2term pp) PR r -> R [assign l (patt2term p) | (l,p) <- r] diff --git a/src-3.0/GF/Devel/Grammar/PrGF.hs b/src-3.0/GF/Devel/Grammar/PrGF.hs index 221a0ac61..cd55e9d67 100644 --- a/src-3.0/GF/Devel/Grammar/PrGF.hs +++ b/src-3.0/GF/Devel/Grammar/PrGF.hs @@ -71,7 +71,7 @@ prModule :: SourceModule -> String prModule = cprintTree . trModule instance Print Judgement where - prt j = cprintTree $ trAnyDef (wildIdent, j) + prt j = cprintTree $ trAnyDef (identW, j) ---- prt_ = prExp instance Print Term where diff --git a/src-3.0/GF/Devel/GrammarToGFCC.hs b/src-3.0/GF/Devel/GrammarToGFCC.hs index 2c1bbc169..8f6a95c4e 100644 --- a/src-3.0/GF/Devel/GrammarToGFCC.hs +++ b/src-3.0/GF/Devel/GrammarToGFCC.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE PatternGuards #-} module GF.Devel.GrammarToGFCC (prGrammar2gfcc,mkCanon2gfcc,addParsers) where import GF.Devel.OptimizeGF (unshareModule) @@ -9,6 +10,7 @@ import qualified GF.GFCC.Macros as CM import qualified GF.GFCC.DataGFCC as C import qualified GF.GFCC.DataGFCC as D import GF.GFCC.CId +import GF.Grammar.Predef import qualified GF.Grammar.Abstract as A import qualified GF.Grammar.Macros as GM --import qualified GF.Grammar.Compute as Compute @@ -28,6 +30,7 @@ import GF.Text.UTF8 import Data.List import Data.Char (isDigit,isSpace) import qualified Data.Map as Map +import qualified Data.ByteString.Char8 as BS import Debug.Trace ---- -- when developing, swap commenting @@ -46,7 +49,7 @@ mkCanon2gfcc :: Options -> String -> SourceGrammar -> (String,D.GFCC) mkCanon2gfcc opts cnc gr = (prIdent abs, (canon2gfcc opts pars . reorder abs . canon2canon abs) gr) where - abs = err error id $ M.abstractOfConcrete gr (identC cnc) + abs = err error id $ M.abstractOfConcrete gr (identC (BS.pack cnc)) pars = mkParamLincat gr -- Adds parsers for all concretes @@ -67,9 +70,9 @@ canon2gfcc opts pars cgr@(M.MGrammar ((a,M.ModMod abm):cms)) = an = (i2i a) cns = map (i2i . fst) cms abs = D.Abstr aflags funs cats catfuns - gflags = Map.fromList [(CId fg,x) | Just x <- [getOptVal opts (aOpt fg)]] + gflags = Map.fromList [(mkCId fg,x) | Just x <- [getOptVal opts (aOpt fg)]] where fg = "firstlang" - aflags = Map.fromList [(CId f,x) | Opt (f,[x]) <- M.flags abm] + aflags = Map.fromList [(mkCId f,x) | Opt (f,[x]) <- M.flags abm] mkDef pty = case pty of Yes t -> mkExp t _ -> CM.primNotion @@ -89,7 +92,7 @@ canon2gfcc opts pars cgr@(M.MGrammar ((a,M.ModMod abm):cms)) = (lang,D.Concr flags lins opers lincats lindefs printnames params fcfg) where js = tree2list (M.jments mo) - flags = Map.fromList [(CId f,x) | Opt (f,[x]) <- M.flags mo] + flags = Map.fromList [(mkCId f,x) | Opt (f,[x]) <- M.flags mo] opers = Map.fromAscList [] -- opers will be created as optimization utf = if elem (Opt ("coding",["utf8"])) (M.flags mo) then D.convertStringsInTerm decodeUTF8 else id @@ -107,7 +110,7 @@ canon2gfcc opts pars cgr@(M.MGrammar ((a,M.ModMod abm):cms)) = fcfg = Nothing i2i :: Ident -> CId -i2i = CId . prIdent +i2i = CId . ident2bs mkType :: A.Type -> C.Type mkType t = case GM.typeForm t of @@ -131,7 +134,7 @@ mkExp t = case t of mkPatt p = uncurry CM.tree $ case p of A.PP _ c ps -> (C.AC (i2i c), map mkPatt ps) A.PV x -> (C.AV (i2i x), []) - A.PW -> (C.AV CM.wildCId, []) + A.PW -> (C.AV wildCId, []) A.PInt i -> (C.AI i, []) mkContext :: A.Context -> [C.Hypo] @@ -139,10 +142,10 @@ mkContext hyps = [C.Hyp (i2i x) (mkType ty) | (x,ty) <- hyps] mkTerm :: Term -> C.Term mkTerm tr = case tr of - Vr (IA (_,i)) -> C.V i - Vr (IAV (_,_,i)) -> C.V i - Vr (IC s) | isDigit (last s) -> - C.V (read (reverse (takeWhile (/='_') (reverse s)))) + Vr (IA _ i) -> C.V i + Vr (IAV _ _ i) -> C.V i + Vr (IC s) | isDigit (BS.last s) -> + C.V ((read . BS.unpack . snd . BS.spanEnd isDigit) s) ---- from gf parser of gfc EInt i -> C.C $ fromInteger i R rs -> C.R [mkTerm t | (_, (_,t)) <- rs] @@ -162,7 +165,7 @@ mkTerm tr = case tr of C.K (C.KP (strings td) [C.Var (strings u) (strings v) | (u,v) <- tvs]) _ -> prtTrace tr $ C.S [C.K (C.KS (A.prt tr +++ "66662"))] ---- for debugging where - mkLab (LIdent l) = case l of + mkLab (LIdent l) = case BS.unpack l of '_':ds -> (read ds) :: Int _ -> prtTrace tr $ 66663 strings t = case t of @@ -182,8 +185,8 @@ mkCType t = case t of Table pt vt -> case pt of EInt i -> C.R $ replicate (1 + fromInteger i) $ mkCType vt RecType rs -> mkCType $ foldr Table vt (map snd rs) - Sort "Str" -> C.S [] --- Str only - App (Q (IC "Predef") (IC "Ints")) (EInt i) -> C.C $ fromInteger i + Sort s | s == cStr -> C.S [] --- Str only + _ | Just i <- GM.isTypeInts t -> C.C $ fromInteger i _ -> error $ "mkCType " ++ show t -- encoding showable lincats (as in source gf) as terms @@ -204,7 +207,7 @@ mkParamLincat sgr lang cat = errVal (C.R [C.S []]) $ do p' <- mkPType p v' <- mkPType v return $ C.S [p',v'] - Sort "Str" -> return $ C.S [] + Sort s | s == cStr -> return $ C.S [] _ -> return $ C.FV $ map (kks . filter showable . prt_) $ errVal [] $ Look.allParamValues sgr typ @@ -225,7 +228,7 @@ reorder abs cg = M.MGrammar $ adefs = sorted2tree $ sortIds $ predefADefs ++ Look.allOrigInfos cg abs predefADefs = - [(IC c, AbsCat (Yes []) Nope) | c <- ["Float","Int","String"]] + [(c, AbsCat (Yes []) Nope) | c <- [cFloat,cInt,cString]] aflags = nubFlags $ concat [M.flags mo | (_,mo) <- M.allModMod cg, M.isModAbs mo] @@ -238,10 +241,7 @@ reorder abs cg = M.MGrammar $ Just r <- [lookup i (M.allExtendSpecs cg la)]] predefCDefs = - (IC "Int", CncCat (Yes Look.linTypeInt) Nope Nope) : - [(IC c, CncCat (Yes GM.defLinType) Nope Nope) | - ---- lindef,printname - c <- ["Float","String"]] + [(c, CncCat (Yes GM.defLinType) Nope Nope) | c <- [cInt,cFloat,cString]] sortIds = sortBy (\ (f,_) (g,_) -> compare f g) nubFlags = nubBy (\ (Opt (f,_)) (Opt (g,_)) -> f == g) @@ -369,13 +369,11 @@ paramValues cgr = (labels,untyps,typs) where untyps = Map.fromList $ concatMap Map.toList [typ | (_,typ) <- Map.toList typs] lincats = - [(IC "Int",[f | let RecType fs = Look.linTypeInt, f <- fs])] ++ - [(IC cat,[(LIdent "s",GM.typeStr)]) | cat <- ["Float", "String"]] ++ + [(cat,[f | let RecType fs = GM.defLinType, f <- fs]) | cat <- [cInt,cFloat, cString]] ++ reverse ---- TODO: really those lincats that are reached ---- reverse is enough to expel overshadowed ones... [(cat,ls) | (_,(cat,CncCat (Yes ty) _ _)) <- jments, RecType ls <- [unlockTy ty]] ----- [(cat,(unlockTyp ls)) | (_,(cat,CncCat (Yes (RecType ls)) _ _)) <- jments] labels = Map.fromList $ concat [((cat,[lab]),(typ,i)): [((cat,[LVar v]),(typ,toInteger (mx + v))) | v <- [0,1]] ++ ---- 1 or 2 vars @@ -449,7 +447,7 @@ term2term cgr env@(labels,untyps,typs) tr = case tr of doVar tr = case getLab tr of Ok (cat, lab) -> do k <- readSTM >>= return . length - let tr' = Vr $ identC $ show k ----- + let tr' = Vr $ identC $ (BS.pack (show k)) ----- let tyvs = case Map.lookup (cat,lab) labels of Just (ty,_) -> case Map.lookup ty typs of @@ -472,10 +470,10 @@ term2term cgr env@(labels,untyps,typs) tr = case tr of -- this goes recursively into tables (ignored) and records (accumulated) getLab tr = case tr of - Vr (IA (cat, _)) -> return (identC cat,[]) - Vr (IAV (cat,_,_)) -> return (identC cat,[]) + Vr (IA cat _) -> return (identC cat,[]) + Vr (IAV cat _ _) -> return (identC cat,[]) Vr (IC s) -> return (identC cat,[]) where - cat = takeWhile (/='_') s ---- also to match IAVs; no _ in a cat tolerated + cat = BS.takeWhile (/='_') s ---- also to match IAVs; no _ in a cat tolerated ---- init (reverse (dropWhile (/='_') (reverse s))) ---- from gf parser ---- Vr _ -> error $ "getLab " ++ show tr P p lab2 -> do @@ -518,7 +516,7 @@ term2term cgr env@(labels,untyps,typs) tr = case tr of mkCurrySel t p = S t p -- done properly in CheckGFCC -mkLab k = LIdent (("_" ++ show k)) +mkLab k = LIdent (BS.pack ("_" ++ show k)) -- remove lock fields; in fact, any empty records and record types unlock = filter notlock where diff --git a/src-3.0/GF/Devel/Optimize.hs b/src-3.0/GF/Devel/Optimize.hs index b44f6a53d..73da712a5 100644 --- a/src-3.0/GF/Devel/Optimize.hs +++ b/src-3.0/GF/Devel/Optimize.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE PatternGuards #-} ---------------------------------------------------------------------- -- | -- Module : Optimize @@ -20,6 +21,7 @@ import GF.Infra.Modules import GF.Grammar.PrGrammar import GF.Grammar.Macros import GF.Grammar.Lookup +import GF.Grammar.Predef import GF.Grammar.Refresh import GF.Devel.Compute import GF.Compile.BackOpt @@ -128,9 +130,9 @@ evalCncInfo opts gr cnc abs (c,info) = do CncCat ptyp pde ppr -> do pde' <- case (ptyp,pde) of (Yes typ, Yes de) -> - liftM yes $ pEval ([(strVar, typeStr)], typ) de + liftM yes $ pEval ([(varStr, typeStr)], typ) de (Yes typ, Nope) -> - liftM yes $ mkLinDefault gr typ >>= partEval noOptions gr ([(strVar, typeStr)],typ) + liftM yes $ mkLinDefault gr typ >>= partEval noOptions gr ([(varStr, typeStr)],typ) (May b, Nope) -> return $ May b _ -> return pde -- indirection @@ -161,72 +163,20 @@ partEval opts gr (context, val) trm = errIn ("parteval" +++ prt_ trm) $ do let vars = map fst context args = map Vr vars subst = [(v, Vr v) | v <- vars] - trm1 = mkApp trm args - trm3 <- if globalTable - then etaExpand subst trm1 >>= outCase subst - else etaExpand subst trm1 + trm1 = mkApp trm args + trm2 <- computeTerm gr subst trm1 + trm3 <- if rightType trm2 + then computeTerm gr subst trm2 + else recordExpand val trm2 >>= computeTerm gr subst return $ mkAbs vars trm3 + where + -- don't eta expand records of right length (correct by type checking) + rightType (R rs) = case val of + RecType ts -> length rs == length ts + _ -> False + rightType _ = False - where - globalTable = oElem showAll opts --- i -all - - comp g t = {- refreshTerm t >>= -} computeTerm gr g t - - etaExpand su t = do - t' <- comp su t - case t' of - R _ | rightType t' -> comp su t' --- return t' wo noexpand... - _ -> recordExpand val t' >>= comp su - -- don't eta expand records of right length (correct by type checking) - rightType t = case (t,val) of - (R rs, RecType ts) -> length rs == length ts - _ -> False - - outCase subst t = do - pts <- getParams context - let (args,ptyps) = unzip $ filter (flip occur t . fst) pts - if null args - then return t - else do - let argtyp = RecType $ tuple2recordType ptyps - let pvars = map (Vr . zIdent . prt) args -- gets eliminated - patt <- term2patt $ R $ tuple2record $ pvars - let t' = replace (zip args pvars) t - t1 <- comp subst $ T (TTyped argtyp) [(patt, t')] - return $ S t1 $ R $ tuple2record args - - --- notice: this assumes that all lin types follow the "old JFP style" - getParams = liftM concat . mapM getParam - getParam (argv,RecType rs) = return - [(P (Vr argv) lab, ptyp) | (lab,ptyp) <- rs, not (isLinLabel lab)] - ---getParam (_,ty) | ty==typeStr = return [] --- in lindef - getParam (av,ty) = - Bad ("record type expected not" +++ prt ty +++ "for" +++ prt av) - --- all lin types are rec types - - replace :: [(Term,Term)] -> Term -> Term - replace reps trm = case trm of - -- this is the important case - P _ _ -> maybe trm id $ lookup trm reps - _ -> composSafeOp (replace reps) trm - - occur t trm = case trm of - - -- this is the important case - P _ _ -> t == trm - S x y -> occur t y || occur t x - App f x -> occur t x || occur t f - Abs _ f -> occur t f - R rs -> any (occur t) (map (snd . snd) rs) - T _ cs -> any (occur t) (map snd cs) - C x y -> occur t x || occur t y - Glue x y -> occur t x || occur t y - ExtR x y -> occur t x || occur t y - FV ts -> any (occur t) ts - V _ ts -> any (occur t) ts - Let (_,(_,x)) y -> occur t x || occur t y - _ -> False -- here we must be careful not to reduce @@ -246,8 +196,8 @@ recordExpand typ trm = case unComputed typ of mkLinDefault :: SourceGrammar -> Type -> Err Term mkLinDefault gr typ = do case unComputed typ of - RecType lts -> mapPairsM mkDefField lts >>= (return . Abs strVar . R . mkAssign) - _ -> liftM (Abs strVar) $ mkDefField typ + RecType lts -> mapPairsM mkDefField lts >>= (return . Abs varStr . R . mkAssign) + _ -> liftM (Abs varStr) $ mkDefField typ ---- _ -> prtBad "linearization type must be a record type, not" typ where mkDefField typ = case unComputed typ of @@ -255,13 +205,13 @@ mkLinDefault gr typ = do t' <- mkDefField t let T _ cs = mkWildCases t' return $ T (TWild p) cs - Sort "Str" -> return $ Vr strVar - QC q p -> lookupFirstTag gr q p + Sort s | s == cStr -> return $ Vr varStr + QC q p -> lookupFirstTag gr q p RecType r -> do let (ls,ts) = unzip r ts' <- mapM mkDefField ts return $ R $ [assign l t | (l,t) <- zip ls ts'] - _ | isTypeInts typ -> return $ EInt 0 -- exists in all as first val + _ | Just _ <- isTypeInts typ -> return $ EInt 0 -- exists in all as first val _ -> prtBad "linearization type field cannot be" typ -- | Form the printname: if given, compute. If not, use the computed diff --git a/src-3.0/GF/Devel/OptimizeGF.hs b/src-3.0/GF/Devel/OptimizeGF.hs index 99e33941f..e45e67584 100644 --- a/src-3.0/GF/Devel/OptimizeGF.hs +++ b/src-3.0/GF/Devel/OptimizeGF.hs @@ -30,6 +30,7 @@ import GF.Data.Operations import Control.Monad import Data.Map (Map) import qualified Data.Map as Map +import qualified Data.ByteString.Char8 as BS import Data.List optModule :: (Ident, SourceModInfo) -> (Ident, SourceModInfo) @@ -88,7 +89,7 @@ factor c i t = case t of --- we hope this will be fresh and don't check... in GFC would be safe -qqIdent c i = identC ("q_" ++ prt c ++ "__" ++ show i) +qqIdent c i = identC (BS.pack ("q_" ++ prt c ++ "__" ++ show i)) -- we need to replace subterms @@ -190,7 +191,7 @@ unsubexpModule mo@(i,m) = case m of ResOper pty (Yes t) -> [(c, ResOper pty (Yes (unparTerm t)))] _ -> [(c,info)] unparTerm t = case t of - Q m c@(IC ('A':'\'':'\'':_)) -> --- name convention of subexp opers + Q m c | isOperIdent c -> --- name convention of subexp opers errVal t $ liftM unparTerm $ lookupResDef gr m c _ -> C.composSafeOp unparTerm t gr = M.MGrammar [mo] @@ -217,12 +218,12 @@ addSubexpConsts mo tree lins = do return (f,ResOper ty (Yes trm')) _ -> return (f,def) recomp f t = case Map.lookup t tree of - Just (_,id) | ident id /= f -> return $ Q mo (ident id) + Just (_,id) | operIdent id /= f -> return $ Q mo (operIdent id) _ -> C.composOp (recomp f) t list = Map.toList tree - oper id trm = (ident id, ResOper (Yes (EInt 8)) (Yes trm)) + oper id trm = (operIdent id, ResOper (Yes (EInt 8)) (Yes trm)) --- impossible type encoding generated opers getSubtermsMod :: Ident -> [(Ident,Info)] -> TermM (Map Term (Int,Int)) @@ -266,6 +267,10 @@ collectSubterms mo t = case t of writeSTM (Map.insert t (count,id) ts, next) return t --- only because of composOp -ident :: Int -> Ident -ident i = identC ("A''" ++ show i) --- +operIdent :: Int -> Ident +operIdent i = identC (operPrefix `BS.append` (BS.pack (show i))) --- +isOperIdent :: Ident -> Bool +isOperIdent id = BS.isPrefixOf operPrefix (ident2bs id) + +operPrefix = BS.pack ("A''") diff --git a/src-3.0/GF/Devel/ReadFiles.hs b/src-3.0/GF/Devel/ReadFiles.hs index a10ee1991..dcae2eeba 100644 --- a/src-3.0/GF/Devel/ReadFiles.hs +++ b/src-3.0/GF/Devel/ReadFiles.hs @@ -185,7 +185,7 @@ importsOfModule (MModule _ typ body) = modType typ (modBody body []) opens NoOpens xs = xs opens (OpenIn os) xs = foldr open xs os - modName (PIdent (_,s)) = s + modName (PIdent (_,s)) = BS.unpack s -- | options can be passed to the compiler by comments in @--#@, in the main file diff --git a/src-3.0/GF/Devel/TC.hs b/src-3.0/GF/Devel/TC.hs index 5c439f671..bdb0a6fd1 100644 --- a/src-3.0/GF/Devel/TC.hs +++ b/src-3.0/GF/Devel/TC.hs @@ -22,6 +22,7 @@ module GF.Devel.TC (AExp(..), ) where import GF.Data.Operations +import GF.Grammar.Predef import GF.Grammar.Abstract import GF.Devel.AbsCompute @@ -145,10 +146,9 @@ checkInferExp th tenv@(k,_,_) e typ = do inferExp :: Theory -> TCEnv -> Exp -> Err (AExp, Val, [(Val,Val)]) inferExp th tenv@(k,rho,gamma) e = case e of Vr x -> mkAnnot (AVr x) $ noConstr $ lookupVar gamma x - Q m c - | m == cPredefAbs && (elem c (map identC ["Int","String","Float"])) -> - return (ACn (m,c) vType, vType, []) - | otherwise -> mkAnnot (ACn (m,c)) $ noConstr $ lookupConst th (m,c) + Q m c | m == cPredefAbs && isPredefCat c + -> return (ACn (m,c) vType, vType, []) + | otherwise -> mkAnnot (ACn (m,c)) $ noConstr $ lookupConst th (m,c) QC m c -> mkAnnot (ACn (m,c)) $ noConstr $ lookupConst th (m,c) ---- EInt i -> return (AInt i, valAbsInt, []) EFloat i -> return (AFloat i, valAbsFloat, []) @@ -164,12 +164,6 @@ inferExp th tenv@(k,rho,gamma) e = case e of return $ (AApp f' a' b', b', csf ++ csa) _ -> prtBad ("Prod expected for function" +++ prt f +++ "instead of") typ _ -> prtBad "cannot infer type of expression" e - where - predefAbs c s = case c of - IC "Int" -> return $ const $ Q cPredefAbs cInt - IC "Float" -> return $ const $ Q cPredefAbs cFloat - IC "String" -> return $ const $ Q cPredefAbs cString - _ -> Bad s checkEqs :: Theory -> TCEnv -> (Fun,Trm) -> Val -> Err [(Val,Val)] checkEqs th tenv@(k,rho,gamma) (fun@(m,f),def) val = case def of @@ -188,9 +182,9 @@ checkEqs th tenv@(k,rho,gamma) (fun@(m,f),def) val = case def of (_,cs2) <- errIn (show bds) $ checkExp th tenv' df typ return $ (cs1 ++ cs2) p2t p (ps,i,g) = case p of - PW -> (meta (MetaSymb i) : ps, i+1, g) - PV IW -> (meta (MetaSymb i) : ps, i+1, g) - PV x -> (meta (MetaSymb i) : ps, i+1,upd x i g) + PW -> (Meta (MetaSymb i) : ps, i+1, g) + PV IW -> (Meta (MetaSymb i) : ps, i+1, g) + PV x -> (Meta (MetaSymb i) : ps, i+1,upd x i g) PString s -> ( K s : ps, i, g) PInt n -> (EInt n : ps, i, g) PFloat n -> (EFloat n : ps, i, g) @@ -238,9 +232,9 @@ checkBranch th tenv b@(ps,t) ty = errIn ("branch" +++ show b) $ ps2ts k = foldr p2t ([],0,[],k) p2t p (ps,i,g,k) = case p of - PW -> (meta (MetaSymb i) : ps, i+1,g,k) - PV IW -> (meta (MetaSymb i) : ps, i+1,g,k) - PV x -> (vr x : ps, i, upd x k g,k+1) + PW -> (Meta (MetaSymb i) : ps, i+1,g,k) + PV IW -> (Meta (MetaSymb i) : ps, i+1,g,k) + PV x -> (Vr x : ps, i, upd x k g,k+1) PString s -> (K s : ps, i, g, k) PInt n -> (EInt n : ps, i, g, k) PFloat n -> (EFloat n : ps, i, g, k) diff --git a/src-3.0/GF/Formalism/FCFG.hs b/src-3.0/GF/Formalism/FCFG.hs index 5f9656658..2f3994b6c 100644 --- a/src-3.0/GF/Formalism/FCFG.hs +++ b/src-3.0/GF/Formalism/FCFG.hs @@ -41,7 +41,6 @@ import GF.Formalism.Utilities import qualified GF.GFCC.CId as AbsGFCC import GF.Infra.PrintClass - ------------------------------------------------------------ -- Token type FToken = String @@ -72,7 +71,7 @@ data FSymbol type FName = NameProfile AbsGFCC.CId isCoercionF :: FName -> Bool -isCoercionF (Name fun [Unify [0]]) = fun == AbsGFCC.CId "_" +isCoercionF (Name fun [Unify [0]]) = fun == AbsGFCC.wildCId isCoercionF _ = False @@ -87,7 +86,7 @@ data FRule = FRule FName [FCat] FCat (Array FIndex (Array FPointPos FSymbol) -- pretty-printing instance Print AbsGFCC.CId where - prt (AbsGFCC.CId s) = s + prt = AbsGFCC.prCId instance Print FSymbol where prt (FSymCat c l n) = "($" ++ prt n ++ "!" ++ prt l ++ ")" diff --git a/src-3.0/GF/Formalism/SimpleGFC.hs b/src-3.0/GF/Formalism/SimpleGFC.hs index ea1f9dc12..22298eece 100644 --- a/src-3.0/GF/Formalism/SimpleGFC.hs +++ b/src-3.0/GF/Formalism/SimpleGFC.hs @@ -27,7 +27,7 @@ type Var = Ident.Ident type Label = AbsGFC.Label anyVar :: Var -anyVar = Ident.wildIdent +anyVar = Ident.identW ---------------------------------------------------------------------- -- * simple GFC diff --git a/src-3.0/GF/GFCC/API.hs b/src-3.0/GF/GFCC/API.hs index c266a5553..7c5c6da77 100644 --- a/src-3.0/GF/GFCC/API.hs +++ b/src-3.0/GF/GFCC/API.hs @@ -84,12 +84,12 @@ file2gfcc f = do g <- parseGrammar s return $ toGFCC g -linearize mgr lang = GF.GFCC.Linearize.linearize (gfcc mgr) (CId lang) +linearize mgr lang = GF.GFCC.Linearize.linearize (gfcc mgr) (mkCId lang) parse mgr lang cat s = - case lookParser (gfcc mgr) (CId lang) of + case lookParser (gfcc mgr) (mkCId lang) of Nothing -> error "no parser" - Just pinfo -> case parseFCF "bottomup" pinfo (CId cat) (words s) of + Just pinfo -> case parseFCF "bottomup" pinfo (mkCId cat) (words s) of Ok x -> x Bad s -> error s @@ -104,23 +104,20 @@ parseAllLang mgr cat s = generateRandom mgr cat = do gen <- newStdGen - return $ genRandom gen (gfcc mgr) (CId cat) + return $ genRandom gen (gfcc mgr) (mkCId cat) -generateAll mgr cat = generate (gfcc mgr) (CId cat) Nothing -generateAllDepth mgr cat = generate (gfcc mgr) (CId cat) +generateAll mgr cat = generate (gfcc mgr) (mkCId cat) Nothing +generateAllDepth mgr cat = generate (gfcc mgr) (mkCId cat) readTree _ = pTree showTree = prExp -prIdent :: CId -> String -prIdent (CId s) = s +abstractName mgr = prCId (absname (gfcc mgr)) -abstractName mgr = prIdent (absname (gfcc mgr)) +languages mgr = [prCId l | l <- cncnames (gfcc mgr)] -languages mgr = [l | CId l <- cncnames (gfcc mgr)] - -categories mgr = [c | CId c <- Map.keys (cats (abstract (gfcc mgr)))] +categories mgr = [prCId c | c <- Map.keys (cats (abstract (gfcc mgr)))] startCat mgr = lookStartCat (gfcc mgr) diff --git a/src-3.0/GF/GFCC/CId.hs b/src-3.0/GF/GFCC/CId.hs index e4efa98ba..928dc18e2 100644 --- a/src-3.0/GF/GFCC/CId.hs +++ b/src-3.0/GF/GFCC/CId.hs @@ -1,14 +1,15 @@ -module GF.GFCC.CId ( - module GF.GFCC.Raw.AbsGFCCRaw, - prCId, - cId - ) where +module GF.GFCC.CId (CId(..), wildCId, mkCId, prCId) where -import GF.GFCC.Raw.AbsGFCCRaw (CId(CId)) +import GF.Infra.PrintClass +import Data.ByteString.Char8 as BS + +newtype CId = CId BS.ByteString deriving (Eq,Ord,Show) + +wildCId :: CId +wildCId = CId (BS.singleton '_') + +mkCId :: String -> CId +mkCId s = CId (BS.pack s) prCId :: CId -> String -prCId (CId s) = s - -cId :: String -> CId -cId = CId - +prCId (CId x) = BS.unpack x diff --git a/src-3.0/GF/GFCC/CheckGFCC.hs b/src-3.0/GF/GFCC/CheckGFCC.hs index d59dba1a9..33143c9ad 100644 --- a/src-3.0/GF/GFCC/CheckGFCC.hs +++ b/src-3.0/GF/GFCC/CheckGFCC.hs @@ -45,7 +45,7 @@ labelBoolErr ms iob = do checkConcrete :: GFCC -> (CId,Concr) -> Err ((CId,Concr),Bool) checkConcrete gfcc (lang,cnc) = - labelBoolErr ("happened in language " ++ printCId lang) $ do + labelBoolErr ("happened in language " ++ prCId lang) $ do (rs,bs) <- mapM checkl (Map.assocs (lins cnc)) >>= return . unzip return ((lang,cnc{lins = Map.fromAscList rs}),and bs) where @@ -53,7 +53,7 @@ checkConcrete gfcc (lang,cnc) = checkLin :: GFCC -> CId -> (CId,Term) -> Err ((CId,Term),Bool) checkLin gfcc lang (f,t) = - labelBoolErr ("happened in function " ++ printCId f) $ do + labelBoolErr ("happened in function " ++ prCId f) $ do (t',b) <- checkTerm (lintype gfcc lang f) t --- $ inline gfcc lang t return ((f,t'),b) diff --git a/src-3.0/GF/GFCC/DataGFCC.hs b/src-3.0/GF/GFCC/DataGFCC.hs index 077d62b19..6d6fd0b86 100644 --- a/src-3.0/GF/GFCC/DataGFCC.hs +++ b/src-3.0/GF/GFCC/DataGFCC.hs @@ -1,6 +1,7 @@ module GF.GFCC.DataGFCC where import GF.GFCC.CId +import GF.Infra.PrintClass(prt) import GF.Infra.CompactPrint import GF.Text.UTF8 import GF.Formalism.FCFG @@ -90,21 +91,17 @@ data Equation = statGFCC :: GFCC -> String statGFCC gfcc = unlines [ - "Abstract\t" ++ pr (absname gfcc), - "Concretes\t" ++ unwords (lmap pr (cncnames gfcc)), - "Categories\t" ++ unwords (lmap pr (keys (cats (abstract gfcc)))) + "Abstract\t" ++ prt (absname gfcc), + "Concretes\t" ++ unwords (lmap prt (cncnames gfcc)), + "Categories\t" ++ unwords (lmap prt (keys (cats (abstract gfcc)))) ] - where pr (CId s) = s - -printCId :: CId -> String -printCId (CId s) = s -- merge two GFCCs; fails is differens absnames; priority to second arg unionGFCC :: GFCC -> GFCC -> GFCC unionGFCC one two = case absname one of - CId "" -> two -- extending empty grammar - n | n == absname two -> one { -- extending grammar with same abstract + n | n == wildCId -> two -- extending empty grammar + | n == absname two -> one { -- extending grammar with same abstract concretes = Data.Map.union (concretes two) (concretes one), cncnames = Data.List.union (cncnames two) (cncnames one) } @@ -112,7 +109,7 @@ unionGFCC one two = case absname one of emptyGFCC :: GFCC emptyGFCC = GFCC { - absname = CId "", + absname = wildCId, cncnames = [] , gflags = empty, abstract = error "empty grammar, no abstract", diff --git a/src-3.0/GF/GFCC/Generate.hs b/src-3.0/GF/GFCC/Generate.hs index 63bdb3b9a..0c02f2034 100644 --- a/src-3.0/GF/GFCC/Generate.hs +++ b/src-3.0/GF/GFCC/Generate.hs @@ -36,8 +36,8 @@ genRandom gen gfcc cat = genTrees (randomRs (0.0, 1.0 :: Double) gen) cat where (genTrees ds2 cat) -- else (drop k ds) genTree rs = gett rs where - gett ds (CId "String") = (tree (AS "foo") [], 1) - gett ds (CId "Int") = (tree (AI 12345) [], 1) + gett ds cid | cid == mkCId "String" = (tree (AS "foo") [], 1) + gett ds cid | cid == mkCId "Int" = (tree (AI 12345) [], 1) gett [] _ = (tree (AS "TIMEOUT") [], 1) ---- gett ds cat = case fns cat of [] -> (tree (AM 0) [],1) diff --git a/src-3.0/GF/GFCC/Linearize.hs b/src-3.0/GF/GFCC/Linearize.hs index c66ff93c1..255b141b0 100644 --- a/src-3.0/GF/GFCC/Linearize.hs +++ b/src-3.0/GF/GFCC/Linearize.hs @@ -3,6 +3,7 @@ module GF.GFCC.Linearize where import GF.GFCC.Macros import GF.GFCC.DataGFCC import GF.GFCC.CId +import GF.Infra.PrintClass import Data.Map import Data.List @@ -35,7 +36,7 @@ linExp mcfg lang tree@(DTr xs at trees) = --- [C lst, kks (show i), C size] where --- lst = mod (fromInteger i) 10 ; size = if i < 10 then 0 else 1 AF d -> R [kks (show d)] - AV x -> TM (prCId x) + AV x -> TM (prt x) AM i -> TM (show i) where lin = linExp mcfg lang @@ -44,8 +45,8 @@ linExp mcfg lang tree@(DTr xs at trees) = addB t | Data.List.null xs = t | otherwise = case t of - R ts -> R $ ts ++ (Data.List.map (kks . prCId) xs) - TM s -> R $ t : (Data.List.map (kks . prCId) xs) + R ts -> R $ ts ++ (Data.List.map (kks . prt) xs) + TM s -> R $ t : (Data.List.map (kks . prt) xs) compute :: GFCC -> CId -> [Term] -> Term -> Term compute mcfg lang args = comp where diff --git a/src-3.0/GF/GFCC/Macros.hs b/src-3.0/GF/GFCC/Macros.hs index 4897aa667..5eaa4bdb3 100644 --- a/src-3.0/GF/GFCC/Macros.hs +++ b/src-3.0/GF/GFCC/Macros.hs @@ -4,7 +4,7 @@ import GF.GFCC.CId import GF.GFCC.DataGFCC import GF.Formalism.FCFG (FGrammar) import GF.Parsing.FCFG.PInfo (FCFPInfo, fcfPInfoToFGrammar) -----import GF.GFCC.PrintGFCC +import GF.Infra.PrintClass import Control.Monad import Data.Map import Data.Maybe @@ -39,7 +39,7 @@ lookFCFG :: GFCC -> CId -> Maybe FGrammar lookFCFG gfcc lang = fmap fcfPInfoToFGrammar $ lookParser gfcc lang lookStartCat :: GFCC -> String -lookStartCat gfcc = fromMaybe "S" $ msum $ Data.List.map (Data.Map.lookup (CId "startcat")) +lookStartCat gfcc = fromMaybe "S" $ msum $ Data.List.map (Data.Map.lookup (mkCId "startcat")) [gflags gfcc, aflags (abstract gfcc)] lookGlobalFlag :: GFCC -> CId -> String @@ -87,12 +87,6 @@ contextLength :: Type -> Int contextLength ty = case ty of DTyp hyps _ _ -> length hyps -cid :: String -> CId -cid = CId - -wildCId :: CId -wildCId = cid "_" - exp0 :: Exp exp0 = tree (AM 0) [] @@ -100,7 +94,7 @@ primNotion :: Exp primNotion = EEq [] term0 :: CId -> Term -term0 = TM . prCId +term0 = TM . prt tm0 :: Term tm0 = TM "?" diff --git a/src-3.0/GF/GFCC/OptimizeGFCC.hs b/src-3.0/GF/GFCC/OptimizeGFCC.hs index 394458041..59fb93ffd 100644 --- a/src-3.0/GF/GFCC/OptimizeGFCC.hs +++ b/src-3.0/GF/GFCC/OptimizeGFCC.hs @@ -75,7 +75,7 @@ addSubexpConsts tree cnc = cnc { W s t -> W s (recomp f t) P t p -> P (recomp f t) (recomp f p) _ -> t - fid n = CId $ "_" ++ show n + fid n = mkCId $ "_" ++ show n rec field = Map.fromAscList [(f,recomp f trm) | (f,trm) <- Map.assocs (field cnc)] diff --git a/src-3.0/GF/GFCC/Raw/AbsGFCCRaw.hs b/src-3.0/GF/GFCC/Raw/AbsGFCCRaw.hs index ab5f184a8..2be8537eb 100644 --- a/src-3.0/GF/GFCC/Raw/AbsGFCCRaw.hs +++ b/src-3.0/GF/GFCC/Raw/AbsGFCCRaw.hs @@ -1,14 +1,11 @@ module GF.GFCC.Raw.AbsGFCCRaw where --- Haskell module generated by the BNF converter - -newtype CId = CId String deriving (Eq,Ord,Show) data Grammar = Grm [RExp] deriving (Eq,Ord,Show) data RExp = - App CId [RExp] + App String [RExp] | AInt Integer | AStr String | AFlt Double diff --git a/src-3.0/GF/GFCC/Raw/ConvertGFCC.hs b/src-3.0/GF/GFCC/Raw/ConvertGFCC.hs index 0b010d604..d72d74b77 100644 --- a/src-3.0/GF/GFCC/Raw/ConvertGFCC.hs +++ b/src-3.0/GF/GFCC/Raw/ConvertGFCC.hs @@ -1,8 +1,10 @@ module GF.GFCC.Raw.ConvertGFCC (toGFCC,fromGFCC) where +import GF.GFCC.CId import GF.GFCC.DataGFCC import GF.GFCC.Raw.AbsGFCCRaw +import GF.Infra.PrintClass import GF.Data.Assoc import GF.Formalism.FCFG import GF.Formalism.Utilities (NameProfile(..), Profile(..), SyntaxForest(..)) @@ -18,29 +20,29 @@ pgfMajorVersion, pgfMinorVersion :: Integer toGFCC :: Grammar -> GFCC toGFCC (Grm [ - App (CId "pgf") (AInt v1 : AInt v2 : App a []:cs), - App (CId "flags") gfs, + App "pgf" (AInt v1 : AInt v2 : App a []:cs), + App "flags" gfs, ab@( - App (CId "abstract") [ - App (CId "fun") fs, - App (CId "cat") cts + App "abstract" [ + App "fun" fs, + App "cat" cts ]), - App (CId "concrete") ccs + App "concrete" ccs ]) = GFCC { - absname = a, - cncnames = [c | App c [] <- cs], - gflags = fromAscList [(f,v) | App f [AStr v] <- gfs], + absname = mkCId a, + cncnames = [mkCId c | App c [] <- cs], + gflags = fromAscList [(mkCId f,v) | App f [AStr v] <- gfs], abstract = let - aflags = fromAscList [(f,v) | App f [AStr v] <- gfs] - lfuns = [(f,(toType typ,toExp def)) | App f [typ, def] <- fs] + aflags = fromAscList [(mkCId f,v) | App f [AStr v] <- gfs] + lfuns = [(mkCId f,(toType typ,toExp def)) | App f [typ, def] <- fs] funs = fromAscList lfuns - lcats = [(c, Prelude.map toHypo hyps) | App c hyps <- cts] + lcats = [(mkCId c, Prelude.map toHypo hyps) | App c hyps <- cts] cats = fromAscList lcats catfuns = fromAscList [(cat,[f | (f, (DTyp _ c _,_)) <- lfuns, c==cat]) | (cat,_) <- lcats] in Abstr aflags funs cats catfuns, - concretes = fromAscList [(lang, toConcr ts) | App lang ts <- ccs] + concretes = fromAscList [(mkCId lang, toConcr ts) | App lang ts <- ccs] } where @@ -57,71 +59,71 @@ toConcr = foldl add (Concr { }) where add :: Concr -> RExp -> Concr - add cnc (App (CId "flags") ts) = cnc { cflags = fromAscList [(f,v) | App f [AStr v] <- ts] } - add cnc (App (CId "lin") ts) = cnc { lins = mkTermMap ts } - add cnc (App (CId "oper") ts) = cnc { opers = mkTermMap ts } - add cnc (App (CId "lincat") ts) = cnc { lincats = mkTermMap ts } - add cnc (App (CId "lindef") ts) = cnc { lindefs = mkTermMap ts } - add cnc (App (CId "printname") ts) = cnc { printnames = mkTermMap ts } - add cnc (App (CId "param") ts) = cnc { paramlincats = mkTermMap ts } - add cnc (App (CId "parser") ts) = cnc { parser = Just (toPInfo ts) } + add cnc (App "flags" ts) = cnc { cflags = fromAscList [(mkCId f,v) | App f [AStr v] <- ts] } + add cnc (App "lin" ts) = cnc { lins = mkTermMap ts } + add cnc (App "oper" ts) = cnc { opers = mkTermMap ts } + add cnc (App "lincat" ts) = cnc { lincats = mkTermMap ts } + add cnc (App "lindef" ts) = cnc { lindefs = mkTermMap ts } + add cnc (App "printname" ts) = cnc { printnames = mkTermMap ts } + add cnc (App "param" ts) = cnc { paramlincats = mkTermMap ts } + add cnc (App "parser" ts) = cnc { parser = Just (toPInfo ts) } toPInfo :: [RExp] -> FCFPInfo -toPInfo [App (CId "rules") rs, App (CId "startupcats") cs] = buildFCFPInfo (rules, cats) +toPInfo [App "rules" rs, App "startupcats" cs] = buildFCFPInfo (rules, cats) where rules = lmap toFRule rs - cats = fromList [(c, lmap expToInt fs) | App c fs <- cs] + cats = fromList [(mkCId c, lmap expToInt fs) | App c fs <- cs] toFRule :: RExp -> FRule - toFRule (App (CId "rule") + toFRule (App "rule" [n, - App (CId "cats") (rt:at), - App (CId "R") ls]) = FRule name args res lins + App "cats" (rt:at), + App "R" ls]) = FRule name args res lins where name = toFName n args = lmap expToInt at res = expToInt rt - lins = mkArray [mkArray [toSymbol s | s <- l] | App (CId "S") l <- ls] + lins = mkArray [mkArray [toSymbol s | s <- l] | App "S" l <- ls] toFName :: RExp -> FName -toFName (App (CId "_A") [x]) = Name (CId "_") [Unify [expToInt x]] -toFName (App f ts) = Name f (lmap toProfile ts) +toFName (App "_A" [x]) = Name wildCId [Unify [expToInt x]] +toFName (App f ts) = Name (mkCId f) (lmap toProfile ts) where toProfile :: RExp -> Profile (SyntaxForest CId) toProfile AMet = Unify [] - toProfile (App (CId "_A") [t]) = Unify [expToInt t] - toProfile (App (CId "_U") ts) = Unify [expToInt t | App (CId "_A") [t] <- ts] + toProfile (App "_A" [t]) = Unify [expToInt t] + toProfile (App "_U" ts) = Unify [expToInt t | App "_A" [t] <- ts] toProfile t = Constant (toSyntaxForest t) toSyntaxForest :: RExp -> SyntaxForest CId toSyntaxForest AMet = FMeta - toSyntaxForest (App n ts) = FNode n [lmap toSyntaxForest ts] + toSyntaxForest (App n ts) = FNode (mkCId n) [lmap toSyntaxForest ts] toSyntaxForest (AStr s) = FString s toSyntaxForest (AInt i) = FInt i toSyntaxForest (AFlt f) = FFloat f toSymbol :: RExp -> FSymbol -toSymbol (App (CId "P") [c,n,l]) = FSymCat (expToInt c) (expToInt l) (expToInt n) +toSymbol (App "P" [c,n,l]) = FSymCat (expToInt c) (expToInt l) (expToInt n) toSymbol (AStr t) = FSymTok t toType :: RExp -> Type toType e = case e of - App cat [App (CId "H") hypos, App (CId "X") exps] -> - DTyp (lmap toHypo hypos) cat (lmap toExp exps) + App cat [App "H" hypos, App "X" exps] -> + DTyp (lmap toHypo hypos) (mkCId cat) (lmap toExp exps) _ -> error $ "type " ++ show e toHypo :: RExp -> Hypo toHypo e = case e of - App x [typ] -> Hyp x (toType typ) + App x [typ] -> Hyp (mkCId x) (toType typ) _ -> error $ "hypo " ++ show e toExp :: RExp -> Exp toExp e = case e of - App (CId "App") [App fun [], App (CId "B") xs, App (CId "X") exps] -> - DTr [x | App x [] <- xs] (AC fun) (lmap toExp exps) - App (CId "Eq") eqs -> - EEq [Equ (lmap toExp ps) (toExp v) | App (CId "E") (v:ps) <- eqs] - App (CId "Var") [App i []] -> DTr [] (AV i) [] + App "App" [App fun [], App "B" xs, App "X" exps] -> + DTr [mkCId x | App x [] <- xs] (AC (mkCId fun)) (lmap toExp exps) + App "Eq" eqs -> + EEq [Equ (lmap toExp ps) (toExp v) | App "E" (v:ps) <- eqs] + App "Var" [App i []] -> DTr [] (AV (mkCId i)) [] AMet -> DTr [] (AM 0) [] AInt i -> DTr [] (AI i) [] AFlt i -> DTr [] (AF i) [] @@ -130,14 +132,14 @@ toExp e = case e of toTerm :: RExp -> Term toTerm e = case e of - App (CId "R") es -> R (lmap toTerm es) - App (CId "S") es -> S (lmap toTerm es) - App (CId "FV") es -> FV (lmap toTerm es) - App (CId "P") [e,v] -> P (toTerm e) (toTerm v) - App (CId "RP") [e,v] -> RP (toTerm e) (toTerm v) ---- - App (CId "W") [AStr s,v] -> W s (toTerm v) - App (CId "A") [AInt i] -> V (fromInteger i) - App f [] -> F f + App "R" es -> R (lmap toTerm es) + App "S" es -> S (lmap toTerm es) + App "FV" es -> FV (lmap toTerm es) + App "P" [e,v] -> P (toTerm e) (toTerm v) + App "RP" [e,v] -> RP (toTerm e) (toTerm v) ---- + App "W" [AStr s,v] -> W s (toTerm v) + App "A" [AInt i] -> V (fromInteger i) + App f [] -> F (mkCId f) AInt i -> C (fromInteger i) AMet -> TM "?" AStr s -> K (KS s) ---- @@ -149,129 +151,124 @@ toTerm e = case e of fromGFCC :: GFCC -> Grammar fromGFCC gfcc0 = Grm [ - app "pgf" (AInt pgfMajorVersion:AInt pgfMinorVersion - : App (absname gfcc) [] : lmap (flip App []) (cncnames gfcc)), - app "flags" [App f [AStr v] | (f,v) <- toList (gflags gfcc `union` aflags agfcc)], - app "abstract" [ - app "fun" [App f [fromType t,fromExp d] | (f,(t,d)) <- toList (funs agfcc)], - app "cat" [App f (lmap fromHypo hs) | (f,hs) <- toList (cats agfcc)] + App "pgf" (AInt pgfMajorVersion:AInt pgfMinorVersion + : App (prCId (absname gfcc)) [] : lmap (flip App [] . prCId) (cncnames gfcc)), + App "flags" [App (prCId f) [AStr v] | (f,v) <- toList (gflags gfcc `union` aflags agfcc)], + App "abstract" [ + App "fun" [App (prCId f) [fromType t,fromExp d] | (f,(t,d)) <- toList (funs agfcc)], + App "cat" [App (prCId f) (lmap fromHypo hs) | (f,hs) <- toList (cats agfcc)] ], - app "concrete" [App lang (fromConcrete c) | (lang,c) <- toList (concretes gfcc)] + App "concrete" [App (prCId lang) (fromConcrete c) | (lang,c) <- toList (concretes gfcc)] ] where gfcc = utf8GFCC gfcc0 - app s = App (CId s) agfcc = abstract gfcc fromConcrete cnc = [ - app "flags" [App f [AStr v] | (f,v) <- toList (cflags cnc)], - app "lin" [App f [fromTerm v] | (f,v) <- toList (lins cnc)], - app "oper" [App f [fromTerm v] | (f,v) <- toList (opers cnc)], - app "lincat" [App f [fromTerm v] | (f,v) <- toList (lincats cnc)], - app "lindef" [App f [fromTerm v] | (f,v) <- toList (lindefs cnc)], - app "printname" [App f [fromTerm v] | (f,v) <- toList (printnames cnc)], - app "param" [App f [fromTerm v] | (f,v) <- toList (paramlincats cnc)] + App "flags" [App (prCId f) [AStr v] | (f,v) <- toList (cflags cnc)], + App "lin" [App (prCId f) [fromTerm v] | (f,v) <- toList (lins cnc)], + App "oper" [App (prCId f) [fromTerm v] | (f,v) <- toList (opers cnc)], + App "lincat" [App (prCId f) [fromTerm v] | (f,v) <- toList (lincats cnc)], + App "lindef" [App (prCId f) [fromTerm v] | (f,v) <- toList (lindefs cnc)], + App "printname" [App (prCId f) [fromTerm v] | (f,v) <- toList (printnames cnc)], + App "param" [App (prCId f) [fromTerm v] | (f,v) <- toList (paramlincats cnc)] ] ++ maybe [] (\p -> [fromPInfo p]) (parser cnc) fromType :: Type -> RExp fromType e = case e of DTyp hypos cat exps -> - App cat [ - App (CId "H") (lmap fromHypo hypos), - App (CId "X") (lmap fromExp exps)] + App (prCId cat) [ + App "H" (lmap fromHypo hypos), + App "X" (lmap fromExp exps)] fromHypo :: Hypo -> RExp fromHypo e = case e of - Hyp x typ -> App x [fromType typ] + Hyp x typ -> App (prCId x) [fromType typ] fromExp :: Exp -> RExp fromExp e = case e of DTr xs (AC fun) exps -> - App (CId "App") [App fun [], App (CId "B") (lmap (flip App []) xs), App (CId "X") (lmap fromExp exps)] - DTr [] (AV x) [] -> App (CId "Var") [App x []] + App "App" [App (prCId fun) [], App "B" (lmap (flip App [] . prCId) xs), App "X" (lmap fromExp exps)] + DTr [] (AV x) [] -> App "Var" [App (prCId x) []] DTr [] (AS s) [] -> AStr s DTr [] (AF d) [] -> AFlt d DTr [] (AI i) [] -> AInt (toInteger i) DTr [] (AM _) [] -> AMet ---- EEq eqs -> - App (CId "Eq") [App (CId "E") (lmap fromExp (v:ps)) | Equ ps v <- eqs] + App "Eq" [App "E" (lmap fromExp (v:ps)) | Equ ps v <- eqs] _ -> error $ "exp " ++ show e fromTerm :: Term -> RExp fromTerm e = case e of - R es -> app "R" (lmap fromTerm es) - S es -> app "S" (lmap fromTerm es) - FV es -> app "FV" (lmap fromTerm es) - P e v -> app "P" [fromTerm e, fromTerm v] - RP e v -> app "RP" [fromTerm e, fromTerm v] ---- - W s v -> app "W" [AStr s, fromTerm v] + R es -> App "R" (lmap fromTerm es) + S es -> App "S" (lmap fromTerm es) + FV es -> App "FV" (lmap fromTerm es) + P e v -> App "P" [fromTerm e, fromTerm v] + RP e v -> App "RP" [fromTerm e, fromTerm v] ---- + W s v -> App "W" [AStr s, fromTerm v] C i -> AInt (toInteger i) TM _ -> AMet - F f -> App f [] - V i -> App (CId "A") [AInt (toInteger i)] + F f -> App (prCId f) [] + V i -> App "A" [AInt (toInteger i)] K (KS s) -> AStr s ---- - K (KP d vs) -> app "FV" (str d : [str v | Var v _ <- vs]) ---- + K (KP d vs) -> App "FV" (str d : [str v | Var v _ <- vs]) ---- where - app = App . CId - str v = app "S" (lmap AStr v) + str v = App "S" (lmap AStr v) -- ** Parsing info fromPInfo :: FCFPInfo -> RExp -fromPInfo p = app "parser" [ - app "rules" [fromFRule rule | rule <- Array.elems (allRules p)], - app "startupcats" [App f (lmap intToExp cs) | (f,cs) <- toList (startupCats p)] +fromPInfo p = App "parser" [ + App "rules" [fromFRule rule | rule <- Array.elems (allRules p)], + App "startupcats" [App (prCId f) (lmap intToExp cs) | (f,cs) <- toList (startupCats p)] ] fromFRule :: FRule -> RExp fromFRule (FRule n args res lins) = - app "rule" [fromFName n, - app "cats" (intToExp res:lmap intToExp args), - app "R" [app "S" [fromSymbol s | s <- Array.elems l] | l <- Array.elems lins] + App "rule" [fromFName n, + App "cats" (intToExp res:lmap intToExp args), + App "R" [App "S" [fromSymbol s | s <- Array.elems l] | l <- Array.elems lins] ] fromFName :: FName -> RExp fromFName n = case n of - Name (CId "_") [p] -> fromProfile p - Name f ps -> App f (lmap fromProfile ps) + Name f ps | f == wildCId -> fromProfile (head ps) + | otherwise -> App (prCId f) (lmap fromProfile ps) where fromProfile :: Profile (SyntaxForest CId) -> RExp fromProfile (Unify []) = AMet fromProfile (Unify [x]) = daughter x - fromProfile (Unify args) = app "_U" (lmap daughter args) + fromProfile (Unify args) = App "_U" (lmap daughter args) fromProfile (Constant forest) = fromSyntaxForest forest - daughter n = app "_A" [intToExp n] + daughter n = App "_A" [intToExp n] fromSyntaxForest :: SyntaxForest CId -> RExp fromSyntaxForest FMeta = AMet -- FIXME: is there always just one element here? - fromSyntaxForest (FNode n [args]) = App n (lmap fromSyntaxForest args) + fromSyntaxForest (FNode n [args]) = App (prCId n) (lmap fromSyntaxForest args) fromSyntaxForest (FString s) = AStr s fromSyntaxForest (FInt i) = AInt i fromSyntaxForest (FFloat f) = AFlt f fromSymbol :: FSymbol -> RExp -fromSymbol (FSymCat c l n) = app "P" [intToExp c, intToExp n, intToExp l] +fromSymbol (FSymCat c l n) = App "P" [intToExp c, intToExp n, intToExp l] fromSymbol (FSymTok t) = AStr t -- ** Utilities mkTermMap :: [RExp] -> Map CId Term -mkTermMap ts = fromAscList [(f,toTerm v) | App f [v] <- ts] - -app :: String -> [RExp] -> RExp -app = App . CId +mkTermMap ts = fromAscList [(mkCId f,toTerm v) | App f [v] <- ts] mkArray :: [a] -> Array.Array Int a mkArray xs = Array.listArray (0, length xs - 1) xs expToInt :: Integral a => RExp -> a -expToInt (App (CId "neg") [AInt i]) = fromIntegral (negate i) +expToInt (App "neg" [AInt i]) = fromIntegral (negate i) expToInt (AInt i) = fromIntegral i expToStr :: RExp -> String expToStr (AStr s) = s intToExp :: Integral a => a -> RExp -intToExp x | x < 0 = App (CId "neg") [AInt (fromIntegral (negate x))] +intToExp x | x < 0 = App "neg" [AInt (fromIntegral (negate x))] | otherwise = AInt (fromIntegral x) diff --git a/src-3.0/GF/GFCC/Raw/ParGFCCRaw.hs b/src-3.0/GF/GFCC/Raw/ParGFCCRaw.hs index b71904948..159eea5fb 100644 --- a/src-3.0/GF/GFCC/Raw/ParGFCCRaw.hs +++ b/src-3.0/GF/GFCC/Raw/ParGFCCRaw.hs @@ -1,9 +1,11 @@ module GF.GFCC.Raw.ParGFCCRaw (parseGrammar) where +import GF.GFCC.CId import GF.GFCC.Raw.AbsGFCCRaw import Control.Monad import Data.Char +import qualified Data.ByteString.Char8 as BS parseGrammar :: String -> IO Grammar parseGrammar s = case runP pGrammar s of @@ -27,7 +29,7 @@ pTerm n = skipSpaces >> (pParen <++ pApp <++ pNum <++ pStr <++ pMeta) <++ return (AInt (read x))) pMeta = char '?' >> return AMet - pIdent = liftM CId $ liftM2 (:) (satisfy isIdentFirst) (munch isIdentRest) + pIdent = liftM2 (:) (satisfy isIdentFirst) (munch isIdentRest) isIdentFirst c = c == '_' || isAlpha c isIdentRest c = c == '_' || c == '\'' || isAlphaNum c diff --git a/src-3.0/GF/GFCC/Raw/PrintGFCCRaw.hs b/src-3.0/GF/GFCC/Raw/PrintGFCCRaw.hs index d46d8096f..23bb8a542 100644 --- a/src-3.0/GF/GFCC/Raw/PrintGFCCRaw.hs +++ b/src-3.0/GF/GFCC/Raw/PrintGFCCRaw.hs @@ -1,9 +1,11 @@ module GF.GFCC.Raw.PrintGFCCRaw (printTree) where +import GF.GFCC.CId import GF.GFCC.Raw.AbsGFCCRaw import Data.List (intersperse) import Numeric (showFFloat) +import qualified Data.ByteString.Char8 as BS printTree :: Grammar -> String printTree g = prGrammar g "" @@ -12,8 +14,8 @@ prGrammar :: Grammar -> ShowS prGrammar (Grm xs) = prRExpList xs prRExp :: Int -> RExp -> ShowS -prRExp _ (App x []) = prCId x -prRExp n (App x xs) = p (prCId x . showChar ' ' . prRExpList xs) +prRExp _ (App x []) = showString x +prRExp n (App x xs) = p (showString x . showChar ' ' . prRExpList xs) where p s = if n == 0 then s else showChar '(' . s . showChar ')' prRExp _ (AInt x) = shows x prRExp _ (AStr x) = showChar '"' . concatS (map mkEsc x) . showChar '"' @@ -29,8 +31,5 @@ mkEsc s = case s of prRExpList :: [RExp] -> ShowS prRExpList = concatS . intersperse (showChar ' ') . map (prRExp 1) -prCId :: CId -> ShowS -prCId (CId x) = showString x - concatS :: [ShowS] -> ShowS concatS = foldr (.) id diff --git a/src-3.0/GF/Grammar/AppPredefined.hs b/src-3.0/GF/Grammar/AppPredefined.hs index fa0048c80..452050ac8 100644 --- a/src-3.0/GF/Grammar/AppPredefined.hs +++ b/src-3.0/GF/Grammar/AppPredefined.hs @@ -15,12 +15,13 @@ module GF.Grammar.AppPredefined (isInPredefined, typPredefined, appPredefined ) where -import GF.Data.Operations -import GF.Grammar.Grammar import GF.Infra.Ident +import GF.Data.Operations +import GF.Grammar.Predef +import GF.Grammar.Grammar import GF.Grammar.Macros import GF.Grammar.PrGrammar (prt,prt_,prtBad) ----- import PGrammar (pTrm) +import qualified Data.ByteString.Char8 as BS -- predefined function type signatures and definitions. AR 12/3/2003. @@ -28,75 +29,77 @@ isInPredefined :: Ident -> Bool isInPredefined = err (const True) (const False) . typPredefined typPredefined :: Ident -> Err Type -typPredefined c@(IC f) = case f of - "Int" -> return typePType - "Float" -> return typePType - "Error" -> return typeType - "Ints" -> return $ mkFunType [cnPredef "Int"] typePType - "PBool" -> return typePType - "error" -> return $ mkFunType [typeStr] (cnPredef "Error") -- non-can. of empty set - "PFalse" -> return $ cnPredef "PBool" - "PTrue" -> return $ cnPredef "PBool" - "dp" -> return $ mkFunType [cnPredef "Int",typeTok] typeTok - "drop" -> return $ mkFunType [cnPredef "Int",typeTok] typeTok - "eqInt" -> return $ mkFunType [cnPredef "Int",cnPredef "Int"] (cnPredef "PBool") - "lessInt"-> return $ mkFunType [cnPredef "Int",cnPredef "Int"] (cnPredef "PBool") - "eqStr" -> return $ mkFunType [typeTok,typeTok] (cnPredef "PBool") - "length" -> return $ mkFunType [typeTok] (cnPredef "Int") - "occur" -> return $ mkFunType [typeTok,typeTok] (cnPredef "PBool") - "occurs" -> return $ mkFunType [typeTok,typeTok] (cnPredef "PBool") - "plus" -> return $ mkFunType [cnPredef "Int",cnPredef "Int"] (cnPredef "Int") +typPredefined f + | f == cInt = return typePType + | f == cFloat = return typePType + | f == cErrorType = return typeType + | f == cInts = return $ mkFunType [typeInt] typePType + | f == cPBool = return typePType + | f == cError = return $ mkFunType [typeStr] typeError -- non-can. of empty set + | f == cPFalse = return $ typePBool + | f == cPTrue = return $ typePBool + | f == cDp = return $ mkFunType [typeInt,typeTok] typeTok + | f == cDrop = return $ mkFunType [typeInt,typeTok] typeTok + | f == cEqInt = return $ mkFunType [typeInt,typeInt] typePBool + | f == cLessInt = return $ mkFunType [typeInt,typeInt] typePBool + | f == cEqStr = return $ mkFunType [typeTok,typeTok] typePBool + | f == cLength = return $ mkFunType [typeTok] typeInt + | f == cOccur = return $ mkFunType [typeTok,typeTok] typePBool + | f == cOccurs = return $ mkFunType [typeTok,typeTok] typePBool + | f == cPlus = return $ mkFunType [typeInt,typeInt] (typeInt) ---- "read" -> (P : Type) -> Tok -> P - "show" -> return $ mkProd -- (P : PType) -> P -> Tok - ([(zIdent "P",typePType),(wildIdent,Vr (zIdent "P"))],typeStr,[]) - "toStr" -> return $ mkProd -- (L : Type) -> L -> Str - ([(zIdent "L",typeType),(wildIdent,Vr (zIdent "L"))],typeStr,[]) - "mapStr" -> - let ty = zIdent "L" in - return $ mkProd -- (L : Type) -> (Str -> Str) -> L -> L - ([(ty,typeType),(wildIdent,mkFunType [typeStr] typeStr),(wildIdent,Vr ty)],Vr ty,[]) - "take" -> return $ mkFunType [cnPredef "Int",typeTok] typeTok - "tk" -> return $ mkFunType [cnPredef "Int",typeTok] typeTok - _ -> prtBad "unknown in Predef:" c -typPredefined c = prtBad "unknown in Predef:" c + | f == cShow = return $ mkProd -- (P : PType) -> P -> Tok + ([(varP,typePType),(identW,Vr varP)],typeStr,[]) + | f == cToStr = return $ mkProd -- (L : Type) -> L -> Str + ([(varL,typeType),(identW,Vr varL)],typeStr,[]) + | f == cMapStr = return $ mkProd -- (L : Type) -> (Str -> Str) -> L -> L + ([(varL,typeType),(identW,mkFunType [typeStr] typeStr),(identW,Vr varL)],Vr varL,[]) + | f == cTake = return $ mkFunType [typeInt,typeTok] typeTok + | f == cTk = return $ mkFunType [typeInt,typeTok] typeTok + | otherwise = prtBad "unknown in Predef:" f + +varL :: Ident +varL = identC (BS.pack "L") + +varP :: Ident +varP = identC (BS.pack "P") appPredefined :: Term -> Err (Term,Bool) appPredefined t = case t of - App f x0 -> do (x,_) <- appPredefined x0 case f of -- one-place functions - Q (IC "Predef") (IC f) -> case (f, x) of - ("length", K s) -> retb $ EInt $ toInteger $ length s - _ -> retb t ---- prtBad "cannot compute predefined" t + Q mod f | mod == cPredef -> + case x of + (K s) | f == cLength -> retb $ EInt $ toInteger $ length s + _ -> retb t -- two-place functions - App (Q (IC "Predef") (IC f)) z0 -> do + App (Q mod f) z0 | mod == cPredef -> do (z,_) <- appPredefined z0 - case (f, norm z, norm x) of - ("drop", EInt i, K s) -> retb $ K (drop (fi i) s) - ("take", EInt i, K s) -> retb $ K (take (fi i) s) - ("tk", EInt i, K s) -> retb $ K (take (max 0 (length s - fi i)) s) - ("dp", EInt i, K s) -> retb $ K (drop (max 0 (length s - fi i)) s) - ("eqStr",K s, K t) -> retb $ if s == t then predefTrue else predefFalse - ("occur",K s, K t) -> retb $ if substring s t then predefTrue else predefFalse - ("occurs",K s, K t) -> retb $ if any (flip elem t) s then predefTrue else predefFalse - ("eqInt",EInt i, EInt j) -> retb $ if i==j then predefTrue else predefFalse - ("lessInt",EInt i, EInt j) -> retb $ if i retb $ EInt $ i+j - ("show", _, t) -> retb $ foldr C Empty $ map K $ words $ prt t - ("read", _, K s) -> retb $ str2tag s --- because of K, only works for atomic tags - ("toStr", _, t) -> trm2str t >>= retb - + case (norm z, norm x) of + (EInt i, K s) | f == cDrop -> retb $ K (drop (fi i) s) + (EInt i, K s) | f == cTake -> retb $ K (take (fi i) s) + (EInt i, K s) | f == cTk -> retb $ K (take (max 0 (length s - fi i)) s) + (EInt i, K s) | f == cDp -> retb $ K (drop (max 0 (length s - fi i)) s) + (K s, K t) | f == cEqStr -> retb $ if s == t then predefTrue else predefFalse + (K s, K t) | f == cOccur -> retb $ if substring s t then predefTrue else predefFalse + (K s, K t) | f == cOccurs -> retb $ if any (flip elem t) s then predefTrue else predefFalse + (EInt i, EInt j) | f == cEqInt -> retb $ if i==j then predefTrue else predefFalse + (EInt i, EInt j) | f == cLessInt -> retb $ if i retb $ EInt $ i+j + (_, t) | f == cShow -> retb $ foldr C Empty $ map K $ words $ prt t + (_, K s) | f == cRead -> retb $ Cn (identC (BS.pack s)) --- because of K, only works for atomic tags + (_, t) | f == cToStr -> trm2str t >>= retb _ -> retb t ---- prtBad "cannot compute predefined" t -- three-place functions - App (App (Q (IC "Predef") (IC f)) z0) y0 -> do + App (App (Q mod f) z0) y0 | mod == cPredef -> do (y,_) <- appPredefined y0 (z,_) <- appPredefined z0 - case (f, z, y, x) of - ("mapStr",ty,op,t) -> retf $ mapStr ty op t + case (z, y, x) of + (ty,op,t) | f == cMapStr -> retf $ mapStr ty op t _ -> retb t ---- prtBad "cannot compute predefined" t _ -> retb t ---- prtBad "cannot compute predefined" t @@ -112,19 +115,8 @@ appPredefined t = case t of -- read makes variables into constants -str2tag :: String -> Term -str2tag s = case s of ----- '\'' : cs -> mkCn $ pTrm $ init cs - _ -> Cn $ IC s --- - where - mkCn t = case t of - Vr i -> Cn i - App c a -> App (mkCn c) (mkCn a) - _ -> t - - -predefTrue = Q (IC "Predef") (IC "PTrue") -predefFalse = Q (IC "Predef") (IC "PFalse") +predefTrue = Q cPredef cPTrue +predefFalse = Q cPredef cPFalse substring :: String -> String -> Bool substring s t = case (s,t) of diff --git a/src-3.0/GF/Grammar/Grammar.hs b/src-3.0/GF/Grammar/Grammar.hs index 95fdce611..6431b33e9 100644 --- a/src-3.0/GF/Grammar/Grammar.hs +++ b/src-3.0/GF/Grammar/Grammar.hs @@ -48,7 +48,8 @@ module GF.Grammar.Grammar (SourceGrammar, Con, Trm, wildPatt, - varLabel + varLabel, tupleLabel, linLabel, theLinLabel, + ident2label, label2ident ) where import GF.Data.Str @@ -58,6 +59,8 @@ import GF.Infra.Modules import GF.Data.Operations +import qualified Data.ByteString.Char8 as BS + -- | grammar as presented to the compiler type SourceGrammar = MGrammar Ident Option Info @@ -119,7 +122,7 @@ data Term = | Cn Ident -- ^ constant | Con Ident -- ^ constructor | EData -- ^ to mark in definition that a fun is a constructor - | Sort String -- ^ basic type + | Sort Ident -- ^ basic type | EInt Integer -- ^ integer literal | EFloat Double -- ^ floating point literal | K String -- ^ string literal or token: @\"foo\"@ @@ -210,7 +213,7 @@ data TInfo = -- | record label data Label = - LIdent String + LIdent BS.ByteString | LVar Int deriving (Read, Show, Eq, Ord) @@ -238,7 +241,21 @@ type Con = Ident --- varLabel :: Int -> Label varLabel = LVar +tupleLabel, linLabel :: Int -> Label +tupleLabel i = LIdent $! BS.pack ('p':show i) +linLabel i = LIdent $! BS.pack ('s':show i) + +theLinLabel :: Label +theLinLabel = LIdent (BS.singleton 's') + +ident2label :: Ident -> Label +ident2label c = LIdent (ident2bs c) + +label2ident :: Label -> Ident +label2ident (LIdent s) = identC s +label2ident (LVar i) = identC (BS.pack ('$':show i)) + wildPatt :: Patt -wildPatt = PV wildIdent +wildPatt = PV identW type Trm = Term diff --git a/src-3.0/GF/Grammar/Lockfield.hs b/src-3.0/GF/Grammar/Lockfield.hs index 960b12983..12b78ab9b 100644 --- a/src-3.0/GF/Grammar/Lockfield.hs +++ b/src-3.0/GF/Grammar/Lockfield.hs @@ -16,8 +16,10 @@ module GF.Grammar.Lockfield (lockRecType, unlockRecord, lockLabel, isLockLabel) where -import GF.Grammar.Grammar +import qualified Data.ByteString.Char8 as BS + import GF.Infra.Ident +import GF.Grammar.Grammar import GF.Grammar.Macros import GF.Grammar.PrGrammar @@ -38,9 +40,12 @@ unlockRecord c ft = do return $ mkAbs xs t' lockLabel :: Ident -> Label -lockLabel c = LIdent $ "lock_" ++ prt c ---- +lockLabel c = LIdent $! BS.append lockPrefix (ident2bs c) isLockLabel :: Label -> Bool isLockLabel l = case l of - LIdent c -> take 5 c == "lock_" - _ -> False + LIdent c -> BS.isPrefixOf lockPrefix c + _ -> False + + +lockPrefix = BS.pack "lock_" diff --git a/src-3.0/GF/Grammar/LookAbs.hs b/src-3.0/GF/Grammar/LookAbs.hs index 5bd4c1e41..665c6b0b7 100644 --- a/src-3.0/GF/Grammar/LookAbs.hs +++ b/src-3.0/GF/Grammar/LookAbs.hs @@ -115,7 +115,7 @@ lookupRef gr binds at = case at of refsForType :: (Val -> Type -> Bool) -> GFCGrammar -> Binds -> Val -> [(Term,(Val,Bool))] refsForType compat gr binds val = -- bound variables --- never recursive? - [(vr i, (t,False)) | (i,t) <- binds, Ok ty <- [val2exp t], compat val ty] ++ + [(Vr i, (t,False)) | (i,t) <- binds, Ok ty <- [val2exp t], compat val ty] ++ -- integer and string literals [(EInt i, (val,False)) | val == valAbsInt, i <- [0,1,2,5,11,1978]] ++ [(EFloat i, (val,False)) | val == valAbsFloat, i <- [3.1415926]] ++ diff --git a/src-3.0/GF/Grammar/Lookup.hs b/src-3.0/GF/Grammar/Lookup.hs index 81a62decf..3c308a539 100644 --- a/src-3.0/GF/Grammar/Lookup.hs +++ b/src-3.0/GF/Grammar/Lookup.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE PatternGuards #-} ---------------------------------------------------------------------- -- | -- Module : Lookup @@ -28,13 +29,13 @@ module GF.Grammar.Lookup ( allParamValues, lookupAbsDef, lookupLincat, - opersForType, - linTypeInt + opersForType ) where import GF.Data.Operations import GF.Grammar.Abstract import GF.Infra.Modules +import GF.Grammar.Predef import GF.Grammar.Lockfield import Data.List (nub,sortBy) @@ -192,8 +193,7 @@ allOrigInfos gr m = errVal [] $ do allParamValues :: SourceGrammar -> Type -> Err [Term] allParamValues cnc ptyp = case ptyp of - App (Q (IC "Predef") (IC "Ints")) (EInt n) -> - return [EInt i | i <- [0..n]] + _ | Just n <- isTypeInts ptyp -> return [EInt i | i <- [0..n]] QC p c -> lookupParamValues cnc p c Q p c -> lookupParamValues cnc p c ---- RecType r -> do @@ -230,17 +230,8 @@ lookupAbsDef gr m c = errIn ("looking up absdef of" +++ prt c) $ do _ -> return Nothing _ -> Bad $ prt m +++ "is not an abstract module" -linTypeInt :: Type -linTypeInt = defLinType ---- let ints k = App (Q (IC "Predef") (IC "Ints")) (EInt k) in ---- RecType [ ---- (LIdent "last",ints 9),(LIdent "s", typeStr), (LIdent "size",ints 1)] - lookupLincat :: SourceGrammar -> Ident -> Ident -> Err Type -lookupLincat gr m c | elem c [zIdent "Int"] = return linTypeInt -lookupLincat gr m c | elem c [zIdent "String", zIdent "Float"] = - return defLinType --- ad hoc; not needed? - +lookupLincat gr m c | isPredefCat c = return defLinType --- ad hoc; not needed? lookupLincat gr m c = do mi <- lookupModule gr m case mi of @@ -265,7 +256,7 @@ opersForType gr orig val = Ok valt <- [valTypeCnc ty], elem valt [val,orig] ] ++ - let cat = err zIdent snd (valCat orig) in --- ignore module + let cat = err error snd (valCat orig) in --- ignore module [(f,ty) | Ok a <- [abstractOfConcrete gr i >>= lookupModMod gr], (f, AbsFun (Yes ty0) _) <- tree2list $ jments a, diff --git a/src-3.0/GF/Grammar/MMacros.hs b/src-3.0/GF/Grammar/MMacros.hs index dd7331685..a7b9bad94 100644 --- a/src-3.0/GF/Grammar/MMacros.hs +++ b/src-3.0/GF/Grammar/MMacros.hs @@ -26,6 +26,7 @@ import GF.Grammar.Values import GF.Grammar.Macros import Control.Monad +import qualified Data.ByteString.Char8 as BS nodeTree :: Tree -> TrNode argsTree :: Tree -> [Tree] @@ -120,9 +121,6 @@ funAtom a = case a of AtC f -> return f _ -> prtBad "not function head" a -uBoundVar :: Ident -uBoundVar = zIdent "#h" -- used for suppressed bindings - atomIsMeta :: Atom -> Bool atomIsMeta atom = case atom of AtM _ -> True @@ -186,7 +184,7 @@ val2expP safe v = case v of VCn c -> return $ qq c VGen i x -> if safe then prtBad "unsafe val2exp" v - else return $ vr $ x --- in editing, no alpha conversions presentv + else return $ Vr $ x --- in editing, no alpha conversions presentv where substVal g e = mapPairsM (val2expP safe) g >>= return . (\s -> substTerm [] s e) @@ -278,7 +276,7 @@ mkJustProd :: Context -> Term -> Term mkJustProd cont typ = mkProd (cont,typ,[]) int2var :: Int -> Ident -int2var = zIdent . ('$':) . show +int2var = identC . BS.pack . ('$':) . show meta0 :: Meta meta0 = int2meta 0 @@ -301,12 +299,12 @@ qualifTerm m = qualif [] where Cn c -> Q m c Con c -> QC m c _ -> composSafeOp (qualif xs) t - chV x = string2var $ prIdent x + chV x = string2var $ ident2bs x -string2var :: String -> Ident -string2var s = case s of - c:'_':i -> identV (readIntArg i,[c]) --- - _ -> zIdent s +string2var :: BS.ByteString -> Ident +string2var s = case BS.unpack s of + c:'_':i -> identV (BS.singleton c) (readIntArg i) --- + _ -> identC s -- | reindex variables so that they tell nesting depth level reindexTerm :: Term -> Term @@ -317,7 +315,7 @@ reindexTerm = qualif (0,[]) where Vr x -> Vr $ look x g _ -> composSafeOp (qualif dg) t look x = maybe x id . lookup x --- if x is not in scope it is unchanged - ind x d = identC $ prIdent x ++ "_" ++ show d + ind x d = identC $ ident2bs x `BS.append` BS.singleton '_' `BS.append` BS.pack (show d) -- this method works for context-free abstract syntax diff --git a/src-3.0/GF/Grammar/Macros.hs b/src-3.0/GF/Grammar/Macros.hs index 7a48e7c3a..f6543ea6c 100644 --- a/src-3.0/GF/Grammar/Macros.hs +++ b/src-3.0/GF/Grammar/Macros.hs @@ -20,8 +20,10 @@ module GF.Grammar.Macros where import GF.Data.Operations import GF.Data.Str -import GF.Grammar.Grammar import GF.Infra.Ident +import GF.Grammar.Grammar +import GF.Grammar.Values +import GF.Grammar.Predef import GF.Grammar.PrGrammar import Control.Monad (liftM, liftM2) @@ -55,12 +57,6 @@ qq (m,c) = Q m c typeForm :: Type -> Err (Context, Cat, [Term]) typeForm = qTypeForm ---- no need to distinguish any more -cPredef :: Ident -cPredef = identC "Predef" - -cnPredef :: String -> Term -cnPredef f = Q cPredef (identC f) - typeFormCnc :: Type -> Err (Context, Type) typeFormCnc t = case t of Prod x a b -> do @@ -91,18 +87,11 @@ typeRawSkeleton typ = type MCat = (Ident,Ident) -sortMCat :: String -> MCat -sortMCat s = (zIdent "_", zIdent s) - ---- hack for Editing.actCat in empty state -errorCat :: MCat -errorCat = (zIdent "?", zIdent "?") - getMCat :: Term -> Err MCat getMCat t = case t of Q m c -> return (m,c) QC m c -> return (m,c) - Sort s -> return $ sortMCat s + Sort c -> return (identW, c) App f _ -> getMCat f _ -> prtBad "no qualified constant" t @@ -213,12 +202,6 @@ mkAbs xx t = foldr Abs t xx appCons :: Ident -> [Term] -> Term appCons = mkApp . Cn -appc :: String -> [Term] -> Term -appc = appCons . zIdent - -appqc :: String -> String -> [Term] -> Term -appqc q c = mkApp (Q (zIdent q) (zIdent c)) - mkLet :: [LocalDef] -> Term -> Term mkLet defs t = foldr Let t defs @@ -232,11 +215,8 @@ isVariable _ = False eqIdent :: Ident -> Ident -> Bool eqIdent = (==) -zIdent :: String -> Ident -zIdent s = identC s - uType :: Type -uType = Cn (zIdent "UndefinedType") +uType = Cn cUndefinedType assign :: Label -> Term -> Assign assign l t = (l,(Nothing,t)) @@ -253,15 +233,6 @@ mkAssign lts = [assign l t | (l,t) <- lts] zipAssign :: [Label] -> [Term] -> [Assign] zipAssign ls ts = [assign l t | (l,t) <- zip ls ts] -ident2label :: Ident -> Label -ident2label c = LIdent (prIdent c) - -label2ident :: Label -> Ident -label2ident = identC . prLabel - -prLabel :: Label -> String -prLabel = prt - mapAssignM :: Monad m => (Term -> m c) -> [Assign] -> m [(Label,(Maybe c,c))] mapAssignM f = mapM (\ (ls,tv) -> liftM ((,) ls) (g tv)) where g (t,v) = liftM2 (,) (maybe (return Nothing) (liftM Just . f) t) (f v) @@ -280,41 +251,40 @@ mkRecType = mkRecTypeN 0 record2subst :: Term -> Err Substitution record2subst t = case t of - R fs -> return [(zIdent x, t) | (LIdent x,(_,t)) <- fs] + R fs -> return [(identC x, t) | (LIdent x,(_,t)) <- fs] _ -> prtBad "record expected, found" t typeType, typePType, typeStr, typeTok, typeStrs :: Term -typeType = srt "Type" -typePType = srt "PType" -typeStr = srt "Str" -typeTok = srt "Tok" -typeStrs = srt "Strs" +typeType = Sort cType +typePType = Sort cPType +typeStr = Sort cStr +typeTok = Sort cTok +typeStrs = Sort cStrs typeString, typeFloat, typeInt :: Term typeInts :: Integer -> Term +typePBool :: Term +typeError :: Term -typeString = constPredefRes "String" -typeInt = constPredefRes "Int" -typeFloat = constPredefRes "Float" -typeInts i = App (constPredefRes "Ints") (EInt i) +typeString = cnPredef cString +typeInt = cnPredef cInt +typeFloat = cnPredef cFloat +typeInts i = App (cnPredef cInts) (EInt i) +typePBool = cnPredef cPBool +typeError = cnPredef cErrorType -isTypeInts :: Term -> Bool -isTypeInts ty = case ty of - App c _ -> c == constPredefRes "Ints" - _ -> False - -constPredefRes :: String -> Term -constPredefRes s = Q (IC "Predef") (zIdent s) +isTypeInts :: Term -> Maybe Integer +isTypeInts (App c (EInt i)) | c == cnPredef cInts = Just i +isTypeInts _ = Nothing isPredefConstant :: Term -> Bool isPredefConstant t = case t of - Q (IC "Predef") _ -> True - Q (IC "PredefAbs") _ -> True - _ -> False + Q mod _ | mod == cPredef || mod == cPredefAbs -> True + _ -> False -isPredefAbsType :: Ident -> Bool -isPredefAbsType c = elem c [zIdent "Int", zIdent "String"] +cnPredef :: Ident -> Term +cnPredef f = Q cPredef f mkSelects :: Term -> [Term] -> Term mkSelects t tt = foldl S t tt @@ -327,18 +297,11 @@ mkCTable ids v = foldr ccase v ids where ccase x t = T TRaw [(PV x,t)] mkDecl :: Term -> Decl -mkDecl typ = (wildIdent, typ) +mkDecl typ = (identW, typ) eqStrIdent :: Ident -> Ident -> Bool eqStrIdent = (==) -tupleLabel, linLabel :: Int -> Label -tupleLabel i = LIdent $ "p" ++ show i -linLabel i = LIdent $ "s" ++ show i - -theLinLabel :: Label -theLinLabel = LIdent "s" - tuple2record :: [Term] -> [Assign] tuple2record ts = [assign (tupleLabel i) t | (i,t) <- zip [1..] ts] @@ -352,10 +315,10 @@ mkCases :: Ident -> Term -> Term mkCases x t = T TRaw [(PV x, t)] mkWildCases :: Term -> Term -mkWildCases = mkCases wildIdent +mkWildCases = mkCases identW mkFunType :: [Type] -> Type -> Type -mkFunType tt t = mkProd ([(wildIdent, ty) | ty <- tt], t, []) -- nondep prod +mkFunType tt t = mkProd ([(identW, ty) | ty <- tt], t, []) -- nondep prod plusRecType :: Type -> Type -> Err Type plusRecType t1 t2 = case (unComputed t1, unComputed t2) of @@ -376,11 +339,7 @@ plusRecord t1 t2 = -- | default linearization type defLinType :: Type -defLinType = RecType [(LIdent "s", typeStr)] - --- | refreshing variables -varX :: Int -> Ident -varX i = identV (i,"x") +defLinType = RecType [(theLinLabel, typeStr)] -- | refreshing variables mkFreshVar :: [Ident] -> Ident @@ -414,28 +373,12 @@ float2term = EFloat ident2terminal :: Ident -> Term ident2terminal = K . prIdent --- | create a constant -string2CnTrm :: String -> Term -string2CnTrm = Cn . zIdent - symbolOfIdent :: Ident -> String symbolOfIdent = prIdent symid :: Ident -> String symid = symbolOfIdent -vr :: Ident -> Term -cn :: Ident -> Term -srt :: String -> Term -meta :: MetaSymb -> Term -cnIC :: String -> Term - -vr = Vr -cn = Cn -srt = Sort -meta = Meta -cnIC = cn . IC - justIdentOf :: Term -> Maybe Ident justIdentOf (Vr x) = Just x justIdentOf (Cn x) = Just x @@ -490,9 +433,6 @@ linTypeStr = mkRecType linLabel [typeStr] -- default lintype {s :: Str} linAsStr :: String -> Term linAsStr s = mkRecord linLabel [K s] -- default linearization {s = s} -linDefStr :: Term -linDefStr = Abs s (R [assign (linLabel 0) (Vr s)]) where s = zIdent "s" - term2patt :: Term -> Err Patt term2patt trm = case termForm trm of Ok ([], Vr x, []) -> return (PV x) @@ -516,24 +456,24 @@ term2patt trm = case termForm trm of Ok ([],K s, []) -> return $ PString s --- encodings due to excessive use of term-patt convs. AR 7/1/2005 - Ok ([], Cn (IC "@"), [Vr a,b]) -> do + Ok ([], Cn id, [Vr a,b]) | id == cAs -> do b' <- term2patt b return (PAs a b') - Ok ([], Cn (IC "-"), [a]) -> do + Ok ([], Cn id, [a]) | id == cNeg -> do a' <- term2patt a return (PNeg a') - Ok ([], Cn (IC "*"), [a]) -> do + Ok ([], Cn id, [a]) | id == cRep -> do a' <- term2patt a return (PRep a') - Ok ([], Cn (IC "?"), []) -> do + Ok ([], Cn id, []) | id == cRep -> do return PChar - Ok ([], Cn (IC "[]"),[K s]) -> do + Ok ([], Cn id,[K s]) | id == cChars -> do return $ PChars s - Ok ([], Cn (IC "+"), [a,b]) -> do + Ok ([], Cn id, [a,b]) | id == cSeq -> do a' <- term2patt a b' <- term2patt b return (PSeq a' b') - Ok ([], Cn (IC "|"), [a,b]) -> do + Ok ([], Cn id, [a,b]) | id == cAlt -> do a' <- term2patt a b' <- term2patt b return (PAlt a' b') @@ -546,7 +486,7 @@ term2patt trm = case termForm trm of patt2term :: Patt -> Term patt2term pt = case pt of PV x -> Vr x - PW -> Vr wildIdent --- not parsable, should not occur + PW -> Vr identW --- not parsable, should not occur PVal t i -> Val t i PMacro c -> Cn c PM p c -> Q p c @@ -560,13 +500,13 @@ patt2term pt = case pt of PFloat i -> EFloat i PString s -> K s - PAs x p -> appc "@" [Vr x, patt2term p] --- an encoding - PChar -> appc "?" [] --- an encoding - PChars s -> appc "[]" [K s] --- an encoding - PSeq a b -> appc "+" [(patt2term a), (patt2term b)] --- an encoding - PAlt a b -> appc "|" [(patt2term a), (patt2term b)] --- an encoding - PRep a -> appc "*" [(patt2term a)] --- an encoding - PNeg a -> appc "-" [(patt2term a)] --- an encoding + PAs x p -> appCons cAs [Vr x, patt2term p] --- an encoding + PChar -> appCons cChar [] --- an encoding + PChars s -> appCons cChars [K s] --- an encoding + PSeq a b -> appCons cSeq [(patt2term a), (patt2term b)] --- an encoding + PAlt a b -> appCons cAlt [(patt2term a), (patt2term b)] --- an encoding + PRep a -> appCons cRep [(patt2term a)] --- an encoding + PNeg a -> appCons cNeg [(patt2term a)] --- an encoding redirectTerm :: Ident -> Term -> Term @@ -575,45 +515,12 @@ redirectTerm n t = case t of Q _ f -> Q n f _ -> composSafeOp (redirectTerm n) t --- | to gather s-fields; assumes term in normal form, preserves label -allLinFields :: Term -> Err [[(Label,Term)]] -allLinFields trm = case unComputed trm of ----- R rs -> return [[(l,t) | (l,(Just ty,t)) <- rs, isStrType ty]] -- good - R rs -> return [[(l,t) | (l,(_,t)) <- rs, isLinLabel l]] ---- bad - FV ts -> do - lts <- mapM allLinFields ts - return $ concat lts - _ -> prtBad "fields can only be sought in a record not in" trm - --- | deprecated -isLinLabel :: Label -> Bool -isLinLabel l = case l of - LIdent ('s':cs) | all isDigit cs -> True - _ -> False - -- | to gather ultimate cases in a table; preserves pattern list allCaseValues :: Term -> [([Patt],Term)] allCaseValues trm = case unComputed trm of T _ cs -> [(p:ps, t) | (p,t0) <- cs, (ps,t) <- allCaseValues t0] _ -> [([],trm)] --- | to gather all linearizations; assumes normal form, preserves label and args -allLinValues :: Term -> Err [[(Label,[([Patt],Term)])]] -allLinValues trm = do - lts <- allLinFields trm - mapM (mapPairsM (return . allCaseValues)) lts - --- | to mark str parts of fields in a record f by a function f -markLinFields :: (Term -> Term) -> Term -> Term -markLinFields f t = case t of - R r -> R $ map mkField r - _ -> t - where - mkField (l,(_,t)) = if (isLinLabel l) then (assign l (mkTbl t)) else (assign l t) - mkTbl t = case t of - T i cs -> T i [(p, mkTbl v) | (p,v) <- cs] - _ -> f t - -- | to get a string from a term that represents a sequence of terminals strsFromTerm :: Term -> Err [Str] strsFromTerm t = case unComputed t of diff --git a/src-3.0/GF/Grammar/Values.hs b/src-3.0/GF/Grammar/Values.hs index 6e029d98b..ab7d874da 100644 --- a/src-3.0/GF/Grammar/Values.hs +++ b/src-3.0/GF/Grammar/Values.hs @@ -19,15 +19,15 @@ module GF.Grammar.Values (-- * values used in TC type checking -- * for TC valAbsInt, valAbsFloat, valAbsString, vType, isPredefCat, - cType, cPredefAbs, cInt, cFloat, cString, eType, tree2exp, loc2treeFocus ) where import GF.Data.Operations import GF.Data.Zipper -import GF.Grammar.Grammar import GF.Infra.Ident +import GF.Grammar.Grammar +import GF.Grammar.Predef -- values used in TC type checking @@ -67,26 +67,8 @@ valAbsString = VCn (cPredefAbs, cString) vType :: Val vType = VType -cType :: Ident -cType = identC "Type" --- #0 - -cPredefAbs :: Ident -cPredefAbs = identC "PredefAbs" - -cInt :: Ident -cInt = identC "Int" - -cFloat :: Ident -cFloat = identC "Float" - -cString :: Ident -cString = identC "String" - -isPredefCat :: Ident -> Bool -isPredefCat c = elem c [cInt,cString,cFloat] - eType :: Exp -eType = Sort "Type" +eType = Sort cType tree2exp :: Tree -> Exp tree2exp (Tr (N (bi,at,_,_,_),ts)) = foldr Abs (foldl App at' ts') bi' where diff --git a/src-3.0/GF/Infra/Ident.hs b/src-3.0/GF/Infra/Ident.hs index 5ed860990..afe41f190 100644 --- a/src-3.0/GF/Infra/Ident.hs +++ b/src-3.0/GF/Infra/Ident.hs @@ -13,45 +13,48 @@ ----------------------------------------------------------------------------- module GF.Infra.Ident (-- * Identifiers - Ident(..), prIdent, + Ident(..), ident2bs, prIdent, identC, identV, identA, identAV, identW, - argIdent, strVar, wildIdent, isWildIdent, - newIdent, mkIdent, varIndex, + argIdent, varStr, varX, isWildIdent, varIndex, -- * refreshing identifiers IdState, initIdStateN, initIdState, lookVar, refVar, refVarPlus ) where import GF.Data.Operations +import qualified Data.ByteString.Char8 as BS -- import Monad -- | the constructors labelled /INTERNAL/ are -- internal representation never returned by the parser data Ident = - IC String -- ^ raw identifier after parsing, resolved in Rename - | IW -- ^ wildcard + IC !BS.ByteString -- ^ raw identifier after parsing, resolved in Rename + | IW -- ^ wildcard -- -- below this constructor: internal representation never returned by the parser - | IV (Int,String) -- ^ /INTERNAL/ variable - | IA (String,Int) -- ^ /INTERNAL/ argument of cat at position - | IAV (String,Int,Int) -- ^ /INTERNAL/ argument of cat with bindings at position + | IV !BS.ByteString Int -- ^ /INTERNAL/ variable + | IA !BS.ByteString Int -- ^ /INTERNAL/ argument of cat at position + | IAV !BS.ByteString Int Int -- ^ /INTERNAL/ argument of cat with bindings at position -- deriving (Eq, Ord, Show, Read) -prIdent :: Ident -> String -prIdent i = case i of +ident2bs :: Ident -> BS.ByteString +ident2bs i = case i of IC s -> s - IV (n,s) -> s ++ "_" ++ show n - IA (s,j) -> s ++ "_" ++ show j - IAV (s,b,j) -> s ++ "_" ++ show b ++ "_" ++ show j - IW -> "_" + IV s n -> BS.append s (BS.pack ('_':show n)) + IA s j -> BS.append s (BS.pack ('_':show j)) + IAV s b j -> BS.append s (BS.pack ('_':show b ++ '_':show j)) + IW -> BS.singleton '_' -identC :: String -> Ident -identV :: (Int, String) -> Ident -identA :: (String, Int) -> Ident -identAV:: (String, Int, Int) -> Ident +prIdent :: Ident -> String +prIdent i = BS.unpack $! ident2bs i + +identC :: BS.ByteString -> Ident +identV :: BS.ByteString -> Int -> Ident +identA :: BS.ByteString -> Int -> Ident +identAV:: BS.ByteString -> Int -> Int -> Ident identW :: Ident (identC, identV, identA, identAV, identW) = (IC, IV, IA, IAV, IW) @@ -61,31 +64,25 @@ identW :: Ident -- | to mark argument variables argIdent :: Int -> Ident -> Int -> Ident -argIdent 0 (IC c) i = identA (c,i) -argIdent b (IC c) i = identAV (c,b,i) +argIdent 0 (IC c) i = identA c i +argIdent b (IC c) i = identAV c b i -- | used in lin defaults -strVar :: Ident -strVar = identA ("str",0) +varStr :: Ident +varStr = identA (BS.pack "str") 0 --- | wild card -wildIdent :: Ident -wildIdent = identW +-- | refreshing variables +varX :: Int -> Ident +varX = identV (BS.singleton 'x') isWildIdent :: Ident -> Bool isWildIdent x = case x of IW -> True - IC "_" -> True + IC s | s == BS.pack "_" -> True _ -> False -newIdent :: Ident -newIdent = identC "#h" - -mkIdent :: String -> Int -> Ident -mkIdent s i = identV (i,s) - varIndex :: Ident -> Int -varIndex (IV (n,_)) = n +varIndex (IV _ n) = n varIndex _ = -1 --- other than IV should not count -- refreshing identifiers @@ -99,7 +96,7 @@ initIdState :: IdState initIdState = initIdStateN 0 lookVar :: Ident -> STM IdState Ident -lookVar a@(IA _) = return a +lookVar a@(IA _ _) = return a lookVar x = do (sys,_) <- readSTM stm (\s -> maybe (Bad ("cannot find" +++ show x +++ prParenth (show sys))) @@ -110,8 +107,8 @@ refVar :: Ident -> STM IdState Ident ----refVar IW = return IW --- no update of wildcard refVar x = do (_,m) <- readSTM - let x' = IV (m, prIdent x) - updateSTM (\ (sys,mx) -> ((x, x'):sys, mx + 1)) + let x' = IV (ident2bs x) m + updateSTM (\(sys,mx) -> ((x, x'):sys, mx + 1)) return x' refVarPlus :: Ident -> STM IdState Ident diff --git a/src-3.0/GF/Source/AbsGF.hs b/src-3.0/GF/Source/AbsGF.hs index 63cc43006..86e521318 100644 --- a/src-3.0/GF/Source/AbsGF.hs +++ b/src-3.0/GF/Source/AbsGF.hs @@ -1,306 +1,307 @@ -module GF.Source.AbsGF where - --- Haskell module generated by the BNF converter - -newtype LString = LString String deriving (Eq,Ord,Show) -newtype PIdent = PIdent ((Int,Int),String) deriving (Eq,Ord,Show) -data Grammar = - Gr [ModDef] - deriving (Eq,Ord,Show) - -data ModDef = - MMain PIdent PIdent [ConcSpec] - | MModule ComplMod ModType ModBody - deriving (Eq,Ord,Show) - -data ConcSpec = - ConcSpec PIdent ConcExp - deriving (Eq,Ord,Show) - -data ConcExp = - ConcExp PIdent [Transfer] - deriving (Eq,Ord,Show) - -data Transfer = - TransferIn Open - | TransferOut Open - deriving (Eq,Ord,Show) - -data ModType = - MTAbstract PIdent - | MTResource PIdent - | MTInterface PIdent - | MTConcrete PIdent PIdent - | MTInstance PIdent PIdent - | MTTransfer PIdent Open Open - deriving (Eq,Ord,Show) - -data ModBody = - MBody Extend Opens [TopDef] - | MNoBody [Included] - | MWith Included [Open] - | MWithBody Included [Open] Opens [TopDef] - | MWithE [Included] Included [Open] - | MWithEBody [Included] Included [Open] Opens [TopDef] - | MReuse PIdent - | MUnion [Included] - deriving (Eq,Ord,Show) - -data Extend = - Ext [Included] - | NoExt - deriving (Eq,Ord,Show) - -data Opens = - NoOpens - | OpenIn [Open] - deriving (Eq,Ord,Show) - -data Open = - OName PIdent - | OQualQO QualOpen PIdent - | OQual QualOpen PIdent PIdent - deriving (Eq,Ord,Show) - -data ComplMod = - CMCompl - | CMIncompl - deriving (Eq,Ord,Show) - -data QualOpen = - QOCompl - | QOIncompl - | QOInterface - deriving (Eq,Ord,Show) - -data Included = - IAll PIdent - | ISome PIdent [PIdent] - | IMinus PIdent [PIdent] - deriving (Eq,Ord,Show) - -data Def = - DDecl [Name] Exp - | DDef [Name] Exp - | DPatt Name [Patt] Exp - | DFull [Name] Exp Exp - deriving (Eq,Ord,Show) - -data TopDef = - DefCat [CatDef] - | DefFun [FunDef] - | DefFunData [FunDef] - | DefDef [Def] - | DefData [DataDef] - | DefTrans [Def] - | DefPar [ParDef] - | DefOper [Def] - | DefLincat [PrintDef] - | DefLindef [Def] - | DefLin [Def] - | DefPrintCat [PrintDef] - | DefPrintFun [PrintDef] - | DefFlag [FlagDef] - | DefPrintOld [PrintDef] - | DefLintype [Def] - | DefPattern [Def] - | DefPackage PIdent [TopDef] - | DefVars [Def] - | DefTokenizer PIdent - deriving (Eq,Ord,Show) - -data CatDef = - SimpleCatDef PIdent [DDecl] - | ListCatDef PIdent [DDecl] - | ListSizeCatDef PIdent [DDecl] Integer - deriving (Eq,Ord,Show) - -data FunDef = - FunDef [PIdent] Exp - deriving (Eq,Ord,Show) - -data DataDef = - DataDef PIdent [DataConstr] - deriving (Eq,Ord,Show) - -data DataConstr = - DataId PIdent - | DataQId PIdent PIdent - deriving (Eq,Ord,Show) - -data ParDef = - ParDefDir PIdent [ParConstr] - | ParDefIndir PIdent PIdent - | ParDefAbs PIdent - deriving (Eq,Ord,Show) - -data ParConstr = - ParConstr PIdent [DDecl] - deriving (Eq,Ord,Show) - -data PrintDef = - PrintDef [Name] Exp - deriving (Eq,Ord,Show) - -data FlagDef = - FlagDef PIdent PIdent - deriving (Eq,Ord,Show) - -data Name = - IdentName PIdent - | ListName PIdent - deriving (Eq,Ord,Show) - -data LocDef = - LDDecl [PIdent] Exp - | LDDef [PIdent] Exp - | LDFull [PIdent] Exp Exp - deriving (Eq,Ord,Show) - -data Exp = - EIdent PIdent - | EConstr PIdent - | ECons PIdent - | ESort Sort - | EString String - | EInt Integer - | EFloat Double - | EMeta - | EEmpty - | EData - | EList PIdent Exps - | EStrings String - | ERecord [LocDef] - | ETuple [TupleComp] - | EIndir PIdent - | ETyped Exp Exp - | EProj Exp Label - | EQConstr PIdent PIdent - | EQCons PIdent PIdent - | EApp Exp Exp - | ETable [Case] - | ETTable Exp [Case] - | EVTable Exp [Exp] - | ECase Exp [Case] - | EVariants [Exp] - | EPre Exp [Altern] - | EStrs [Exp] - | EConAt PIdent Exp - | EPatt Patt - | EPattType Exp - | ESelect Exp Exp - | ETupTyp Exp Exp - | EExtend Exp Exp - | EGlue Exp Exp - | EConcat Exp Exp - | EAbstr [Bind] Exp - | ECTable [Bind] Exp - | EProd Decl Exp - | ETType Exp Exp - | ELet [LocDef] Exp - | ELetb [LocDef] Exp - | EWhere Exp [LocDef] - | EEqs [Equation] - | EExample Exp String - | ELString LString - | ELin PIdent - deriving (Eq,Ord,Show) - -data Exps = - NilExp - | ConsExp Exp Exps - deriving (Eq,Ord,Show) - -data Patt = - PChar - | PChars String - | PMacro PIdent - | PM PIdent PIdent - | PW - | PV PIdent - | PCon PIdent - | PQ PIdent PIdent - | PInt Integer - | PFloat Double - | PStr String - | PR [PattAss] - | PTup [PattTupleComp] - | PC PIdent [Patt] - | PQC PIdent PIdent [Patt] - | PDisj Patt Patt - | PSeq Patt Patt - | PRep Patt - | PAs PIdent Patt - | PNeg Patt - deriving (Eq,Ord,Show) - -data PattAss = - PA [PIdent] Patt - deriving (Eq,Ord,Show) - -data Label = - LIdent PIdent - | LVar Integer - deriving (Eq,Ord,Show) - -data Sort = - Sort_Type - | Sort_PType - | Sort_Tok - | Sort_Str - | Sort_Strs - deriving (Eq,Ord,Show) - -data Bind = - BIdent PIdent - | BWild - deriving (Eq,Ord,Show) - -data Decl = - DDec [Bind] Exp - | DExp Exp - deriving (Eq,Ord,Show) - -data TupleComp = - TComp Exp - deriving (Eq,Ord,Show) - -data PattTupleComp = - PTComp Patt - deriving (Eq,Ord,Show) - -data Case = - Case Patt Exp - deriving (Eq,Ord,Show) - -data Equation = - Equ [Patt] Exp - deriving (Eq,Ord,Show) - -data Altern = - Alt Exp Exp - deriving (Eq,Ord,Show) - -data DDecl = - DDDec [Bind] Exp - | DDExp Exp - deriving (Eq,Ord,Show) - -data OldGrammar = - OldGr Include [TopDef] - deriving (Eq,Ord,Show) - -data Include = - NoIncl - | Incl [FileName] - deriving (Eq,Ord,Show) - -data FileName = - FString String - | FIdent PIdent - | FSlash FileName - | FDot FileName - | FMinus FileName - | FAddId PIdent FileName - deriving (Eq,Ord,Show) - +module GF.Source.AbsGF where + +-- Haskell module generated by the BNF converter + +import qualified Data.ByteString.Char8 as BS +newtype LString = LString BS.ByteString deriving (Eq,Ord,Show) +newtype PIdent = PIdent ((Int,Int),BS.ByteString) deriving (Eq,Ord,Show) +data Grammar = + Gr [ModDef] + deriving (Eq,Ord,Show) + +data ModDef = + MMain PIdent PIdent [ConcSpec] + | MModule ComplMod ModType ModBody + deriving (Eq,Ord,Show) + +data ConcSpec = + ConcSpec PIdent ConcExp + deriving (Eq,Ord,Show) + +data ConcExp = + ConcExp PIdent [Transfer] + deriving (Eq,Ord,Show) + +data Transfer = + TransferIn Open + | TransferOut Open + deriving (Eq,Ord,Show) + +data ModType = + MTAbstract PIdent + | MTResource PIdent + | MTInterface PIdent + | MTConcrete PIdent PIdent + | MTInstance PIdent PIdent + | MTTransfer PIdent Open Open + deriving (Eq,Ord,Show) + +data ModBody = + MBody Extend Opens [TopDef] + | MNoBody [Included] + | MWith Included [Open] + | MWithBody Included [Open] Opens [TopDef] + | MWithE [Included] Included [Open] + | MWithEBody [Included] Included [Open] Opens [TopDef] + | MReuse PIdent + | MUnion [Included] + deriving (Eq,Ord,Show) + +data Extend = + Ext [Included] + | NoExt + deriving (Eq,Ord,Show) + +data Opens = + NoOpens + | OpenIn [Open] + deriving (Eq,Ord,Show) + +data Open = + OName PIdent + | OQualQO QualOpen PIdent + | OQual QualOpen PIdent PIdent + deriving (Eq,Ord,Show) + +data ComplMod = + CMCompl + | CMIncompl + deriving (Eq,Ord,Show) + +data QualOpen = + QOCompl + | QOIncompl + | QOInterface + deriving (Eq,Ord,Show) + +data Included = + IAll PIdent + | ISome PIdent [PIdent] + | IMinus PIdent [PIdent] + deriving (Eq,Ord,Show) + +data Def = + DDecl [Name] Exp + | DDef [Name] Exp + | DPatt Name [Patt] Exp + | DFull [Name] Exp Exp + deriving (Eq,Ord,Show) + +data TopDef = + DefCat [CatDef] + | DefFun [FunDef] + | DefFunData [FunDef] + | DefDef [Def] + | DefData [DataDef] + | DefTrans [Def] + | DefPar [ParDef] + | DefOper [Def] + | DefLincat [PrintDef] + | DefLindef [Def] + | DefLin [Def] + | DefPrintCat [PrintDef] + | DefPrintFun [PrintDef] + | DefFlag [FlagDef] + | DefPrintOld [PrintDef] + | DefLintype [Def] + | DefPattern [Def] + | DefPackage PIdent [TopDef] + | DefVars [Def] + | DefTokenizer PIdent + deriving (Eq,Ord,Show) + +data CatDef = + SimpleCatDef PIdent [DDecl] + | ListCatDef PIdent [DDecl] + | ListSizeCatDef PIdent [DDecl] Integer + deriving (Eq,Ord,Show) + +data FunDef = + FunDef [PIdent] Exp + deriving (Eq,Ord,Show) + +data DataDef = + DataDef PIdent [DataConstr] + deriving (Eq,Ord,Show) + +data DataConstr = + DataId PIdent + | DataQId PIdent PIdent + deriving (Eq,Ord,Show) + +data ParDef = + ParDefDir PIdent [ParConstr] + | ParDefIndir PIdent PIdent + | ParDefAbs PIdent + deriving (Eq,Ord,Show) + +data ParConstr = + ParConstr PIdent [DDecl] + deriving (Eq,Ord,Show) + +data PrintDef = + PrintDef [Name] Exp + deriving (Eq,Ord,Show) + +data FlagDef = + FlagDef PIdent PIdent + deriving (Eq,Ord,Show) + +data Name = + IdentName PIdent + | ListName PIdent + deriving (Eq,Ord,Show) + +data LocDef = + LDDecl [PIdent] Exp + | LDDef [PIdent] Exp + | LDFull [PIdent] Exp Exp + deriving (Eq,Ord,Show) + +data Exp = + EIdent PIdent + | EConstr PIdent + | ECons PIdent + | ESort Sort + | EString String + | EInt Integer + | EFloat Double + | EMeta + | EEmpty + | EData + | EList PIdent Exps + | EStrings String + | ERecord [LocDef] + | ETuple [TupleComp] + | EIndir PIdent + | ETyped Exp Exp + | EProj Exp Label + | EQConstr PIdent PIdent + | EQCons PIdent PIdent + | EApp Exp Exp + | ETable [Case] + | ETTable Exp [Case] + | EVTable Exp [Exp] + | ECase Exp [Case] + | EVariants [Exp] + | EPre Exp [Altern] + | EStrs [Exp] + | EConAt PIdent Exp + | EPatt Patt + | EPattType Exp + | ESelect Exp Exp + | ETupTyp Exp Exp + | EExtend Exp Exp + | EGlue Exp Exp + | EConcat Exp Exp + | EAbstr [Bind] Exp + | ECTable [Bind] Exp + | EProd Decl Exp + | ETType Exp Exp + | ELet [LocDef] Exp + | ELetb [LocDef] Exp + | EWhere Exp [LocDef] + | EEqs [Equation] + | EExample Exp String + | ELString LString + | ELin PIdent + deriving (Eq,Ord,Show) + +data Exps = + NilExp + | ConsExp Exp Exps + deriving (Eq,Ord,Show) + +data Patt = + PChar + | PChars String + | PMacro PIdent + | PM PIdent PIdent + | PW + | PV PIdent + | PCon PIdent + | PQ PIdent PIdent + | PInt Integer + | PFloat Double + | PStr String + | PR [PattAss] + | PTup [PattTupleComp] + | PC PIdent [Patt] + | PQC PIdent PIdent [Patt] + | PDisj Patt Patt + | PSeq Patt Patt + | PRep Patt + | PAs PIdent Patt + | PNeg Patt + deriving (Eq,Ord,Show) + +data PattAss = + PA [PIdent] Patt + deriving (Eq,Ord,Show) + +data Label = + LIdent PIdent + | LVar Integer + deriving (Eq,Ord,Show) + +data Sort = + Sort_Type + | Sort_PType + | Sort_Tok + | Sort_Str + | Sort_Strs + deriving (Eq,Ord,Show) + +data Bind = + BIdent PIdent + | BWild + deriving (Eq,Ord,Show) + +data Decl = + DDec [Bind] Exp + | DExp Exp + deriving (Eq,Ord,Show) + +data TupleComp = + TComp Exp + deriving (Eq,Ord,Show) + +data PattTupleComp = + PTComp Patt + deriving (Eq,Ord,Show) + +data Case = + Case Patt Exp + deriving (Eq,Ord,Show) + +data Equation = + Equ [Patt] Exp + deriving (Eq,Ord,Show) + +data Altern = + Alt Exp Exp + deriving (Eq,Ord,Show) + +data DDecl = + DDDec [Bind] Exp + | DDExp Exp + deriving (Eq,Ord,Show) + +data OldGrammar = + OldGr Include [TopDef] + deriving (Eq,Ord,Show) + +data Include = + NoIncl + | Incl [FileName] + deriving (Eq,Ord,Show) + +data FileName = + FString String + | FIdent PIdent + | FSlash FileName + | FDot FileName + | FMinus FileName + | FAddId PIdent FileName + deriving (Eq,Ord,Show) + diff --git a/src-3.0/GF/Source/ErrM.hs b/src-3.0/GF/Source/ErrM.hs index 63840758e..addd22f69 100644 --- a/src-3.0/GF/Source/ErrM.hs +++ b/src-3.0/GF/Source/ErrM.hs @@ -1,26 +1,26 @@ --- BNF Converter: Error Monad --- Copyright (C) 2004 Author: Aarne Ranta - --- This file comes with NO WARRANTY and may be used FOR ANY PURPOSE. -module GF.Source.ErrM where - --- the Error monad: like Maybe type with error msgs - -import Control.Monad (MonadPlus(..), liftM) - -data Err a = Ok a | Bad String - deriving (Read, Show, Eq, Ord) - -instance Monad Err where - return = Ok - fail = Bad - Ok a >>= f = f a - Bad s >>= f = Bad s - -instance Functor Err where - fmap = liftM - -instance MonadPlus Err where - mzero = Bad "Err.mzero" - mplus (Bad _) y = y - mplus x _ = x +-- BNF Converter: Error Monad +-- Copyright (C) 2004 Author: Aarne Ranta + +-- This file comes with NO WARRANTY and may be used FOR ANY PURPOSE. +module GF.Source.ErrM where + +-- the Error monad: like Maybe type with error msgs + +import Control.Monad (MonadPlus(..), liftM) + +data Err a = Ok a | Bad String + deriving (Read, Show, Eq, Ord) + +instance Monad Err where + return = Ok + fail = Bad + Ok a >>= f = f a + Bad s >>= f = Bad s + +instance Functor Err where + fmap = liftM + +instance MonadPlus Err where + mzero = Bad "Err.mzero" + mplus (Bad _) y = y + mplus x _ = x diff --git a/src-3.0/GF/Source/GF.cf b/src-3.0/GF/Source/GF.cf index 364550e6f..ef458c91a 100644 --- a/src-3.0/GF/Source/GF.cf +++ b/src-3.0/GF/Source/GF.cf @@ -5,6 +5,7 @@ entrypoints Grammar, ModDef, OldGrammar, --% + ModHeader, Exp ; -- let's see if more are needed comment "--" ; diff --git a/src-3.0/GF/Source/GrammarToSource.hs b/src-3.0/GF/Source/GrammarToSource.hs index 6d48e4ced..6926ec202 100644 --- a/src-3.0/GF/Source/GrammarToSource.hs +++ b/src-3.0/GF/Source/GrammarToSource.hs @@ -21,10 +21,12 @@ module GF.Source.GrammarToSource ( trGrammar, import GF.Data.Operations import GF.Grammar.Grammar +import GF.Grammar.Predef import GF.Infra.Modules import GF.Infra.Option import qualified GF.Source.AbsGF as P import GF.Infra.Ident +import qualified Data.ByteString.Char8 as BS -- | AR 13\/5\/2003 -- @@ -96,7 +98,7 @@ trAnyDef (i,info) = let i' = tri i in case info of ResOverload tysts -> [P.DefOper [P.DDef [mkName i'] ( - P.EApp (P.EIdent $ tri $ identC "overload") + P.EApp (P.EIdent $ tri $ cOverload) (P.ERecord [P.LDFull [i'] (trt ty) (trt fu) | (ty,fu) <- tysts]))]] CncCat (Yes ty) Nope _ -> @@ -131,7 +133,7 @@ trPerh p = case p of trFlag :: Option -> P.TopDef trFlag o = case o of - Opt (f,[x]) -> P.DefFlag [P.FlagDef (tri $ identC f) (tri $ identC x)] + Opt (f,[x]) -> P.DefFlag [P.FlagDef (tri $ identC (BS.pack f)) (tri $ identC (BS.pack x))] _ -> P.DefFlag [] --- warning? trt :: Term -> P.Exp @@ -139,14 +141,12 @@ trt trm = case trm of Vr s -> P.EIdent $ tri s Cn s -> P.ECons $ tri s Con s -> P.EConstr $ tri s - Sort s -> P.ESort $ case s of - "Type" -> P.Sort_Type - "PType" -> P.Sort_PType - "Tok" -> P.Sort_Tok - "Str" -> P.Sort_Str - "Strs" -> P.Sort_Strs - _ -> error $ "not yet sort " +++ show trm ---- - + Sort s -> P.ESort $! if s == cType then P.Sort_Type else + if s == cPType then P.Sort_PType else + if s == cTok then P.Sort_Tok else + if s == cStr then P.Sort_Str else + if s == cStrs then P.Sort_Strs else + error $ "not yet sort " +++ show trm App c a -> P.EApp (trt c) (trt a) Abs x b -> P.EAbstr [trb x] (trt b) Eqs pts -> P.EEqs [P.Equ (map trp ps) (trt t) | (ps,t) <- pts] @@ -210,7 +210,7 @@ trp p = case p of PC c a -> P.PC (tri c) (map trp a) PP p c [] -> P.PQ (tri p) (tri c) PP p c a -> P.PQC (tri p) (tri c) (map trp a) - PR r -> P.PR [P.PA [tri $ trLabelIdent l] (trp p) | (l,p) <- r] + PR r -> P.PR [P.PA [tri $ label2ident l] (trp p) | (l,p) <- r] PString s -> P.PStr s PInt i -> P.PInt i PFloat i -> P.PFloat i @@ -230,9 +230,9 @@ trp p = case p of trAssign (lab, (mty, t)) = maybe (P.LDDef x t') (\ty -> P.LDFull x (trt ty) t') mty where t' = trt t - x = [tri $ trLabelIdent lab] + x = [tri $ label2ident lab] -trLabelling (lab,ty) = P.LDDecl [tri $ trLabelIdent lab] (trt ty) +trLabelling (lab,ty) = P.LDDecl [tri $ label2ident lab] (trt ty) trCase (patt, trm) = P.Case (trp patt) (trt trm) trCases (patts,trm) = P.Case (foldl1 P.PDisj (map trp patts)) (trt trm) @@ -240,7 +240,7 @@ trCases (patts,trm) = P.Case (foldl1 P.PDisj (map trp patts)) (trt trm) trDecl (x,ty) = P.DDDec [trb x] (trt ty) tri :: Ident -> P.PIdent -tri = ppIdent . prIdent +tri = ppIdent . ident2bs ppIdent i = P.PIdent ((0,0),i) @@ -251,9 +251,5 @@ trLabel i = case i of LIdent s -> P.LIdent $ ppIdent s LVar i -> P.LVar $ toInteger i -trLabelIdent i = identC $ case i of - LIdent s -> s - LVar i -> "v" ++ show i --- should not happen - mkName :: P.PIdent -> P.Name mkName = P.IdentName diff --git a/src-3.0/GF/Source/LexGF.hs b/src-3.0/GF/Source/LexGF.hs index 89067b6b6..1a2e507be 100644 --- a/src-3.0/GF/Source/LexGF.hs +++ b/src-3.0/GF/Source/LexGF.hs @@ -1,345 +1,350 @@ -{-# OPTIONS -fglasgow-exts -cpp #-} -{-# LINE 3 "GF/Source/LexGF.x" #-} -{-# OPTIONS -fno-warn-incomplete-patterns #-} -module GF.Source.LexGF where - - -import qualified Data.ByteString.Char8 as BS - -#if __GLASGOW_HASKELL__ >= 603 -#include "ghcconfig.h" -#else -#include "config.h" -#endif -#if __GLASGOW_HASKELL__ >= 503 -import Data.Array -import Data.Char (ord) -import Data.Array.Base (unsafeAt) -#else -import Array -import Char (ord) -#endif -#if __GLASGOW_HASKELL__ >= 503 -import GHC.Exts -#else -import GlaExts -#endif -alex_base :: AlexAddr -alex_base = AlexA# "\x01\x00\x00\x00\x15\x00\x00\x00\x39\x00\x00\x00\x3a\x00\x00\x00\x18\x00\x00\x00\x19\x00\x00\x00\x1a\x00\x00\x00\x00\x00\x00\x00\x44\x00\x00\x00\x45\x00\x00\x00\x1b\x00\x00\x00\x1c\x00\x00\x00\x1d\x00\x00\x00\x42\x00\x00\x00\x00\x00\x00\x00\x26\x00\x00\x00\x27\x00\x00\x00\x13\x00\x00\x00\x9c\x00\x00\x00\x00\x00\x00\x00\x2c\x00\x00\x00\x2d\x00\x00\x00\x6c\x01\x00\x00\x3c\x02\x00\x00\x0c\x03\x00\x00\x00\x00\x00\x00\x17\x01\x00\x00\xe7\x01\x00\x00\xd5\x00\x00\x00\x35\x00\x00\x00\xe7\x00\x00\x00\xf2\x00\x00\x00\x1d\x01\x00\x00\xc2\x01\x00\x00\xcc\x01\x00\x00"# - -alex_table :: AlexAddr -alex_table = AlexA# "\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x0d\x00\x0e\x00\x1a\x00\x0e\x00\x0e\x00\x0e\x00\xff\xff\x14\x00\x0e\x00\x0e\x00\x0f\x00\x10\x00\x0e\x00\x05\x00\x0e\x00\x0e\x00\x1d\x00\x1d\x00\x1d\x00\x1d\x00\x1d\x00\x1d\x00\x1d\x00\x1d\x00\x1d\x00\x1d\x00\x0e\x00\x0e\x00\x0e\x00\x11\x00\x0e\x00\x0e\x00\x0e\x00\x04\x00\xff\xff\xff\xff\x02\x00\x02\x00\x09\x00\x09\x00\x09\x00\x0a\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0e\x00\x0e\x00\x0e\x00\x13\x00\x13\x00\x00\x00\x00\x00\x0e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0e\x00\x0e\x00\x0e\x00\xff\xff\x12\x00\xff\xff\x0d\x00\x20\x00\x00\x00\x1d\x00\x1d\x00\x1d\x00\x1d\x00\x1d\x00\x1d\x00\x1d\x00\x1d\x00\x1d\x00\x1d\x00\x00\x00\x00\x00\x09\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0c\x00\x0e\x00\x0e\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x06\x00\x07\x00\x17\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x00\x00\x00\x00\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x1b\x00\xff\xff\x00\x00\x00\x00\x17\x00\x1b\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x1e\x00\x1e\x00\x1e\x00\x1e\x00\x1e\x00\x1e\x00\x1e\x00\x1e\x00\x1e\x00\x1e\x00\xff\xff\x1f\x00\x1f\x00\x1f\x00\x1f\x00\x1f\x00\x1f\x00\x1f\x00\x1f\x00\x1f\x00\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1b\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x19\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1b\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1b\x00\x00\x00\x00\x00\x21\x00\x1e\x00\x1e\x00\x1e\x00\x1e\x00\x1e\x00\x1e\x00\x1e\x00\x1e\x00\x1e\x00\x1e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x1c\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x18\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x00\x00\x00\x00\x00\x00\x00\x00\x18\x00\x00\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x22\x00\x00\x00\xff\xff\x1f\x00\x1f\x00\x1f\x00\x1f\x00\x1f\x00\x1f\x00\x1f\x00\x1f\x00\x1f\x00\x1f\x00\x1f\x00\x1f\x00\x1f\x00\x1f\x00\x1f\x00\x1f\x00\x1f\x00\x1f\x00\x1f\x00\x1f\x00\x00\x00\x00\x00\x00\x00\x19\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x1c\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x17\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x00\x00\x00\x00\x00\x00\x00\x00\x17\x00\x00\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x00\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x18\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x00\x00\x00\x00\x00\x00\x00\x00\x18\x00\x00\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x00\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x00\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00"# - -alex_check :: AlexAddr -alex_check = AlexA# "\xff\xff\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x05\x00\x06\x00\x07\x00\x08\x00\x09\x00\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x29\x00\x2a\x00\x2b\x00\x2c\x00\x2d\x00\x2e\x00\x2f\x00\x30\x00\x31\x00\x32\x00\x33\x00\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\x3a\x00\x3b\x00\x3c\x00\x3d\x00\x3e\x00\x3f\x00\x40\x00\x2d\x00\x0a\x00\x0a\x00\x2d\x00\x2d\x00\x2d\x00\x2d\x00\x2d\x00\x2d\x00\x09\x00\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x2a\x00\x3e\x00\x2b\x00\x27\x00\x27\x00\xff\xff\xff\xff\x3e\x00\xff\xff\xff\xff\xff\xff\xff\xff\x5b\x00\x5c\x00\x5d\x00\x5e\x00\x5f\x00\x60\x00\x20\x00\x2e\x00\xff\xff\x30\x00\x31\x00\x32\x00\x33\x00\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\xff\xff\xff\xff\x2d\x00\x2d\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x7b\x00\x7c\x00\x7d\x00\x7e\x00\x7f\x00\x80\x00\x81\x00\x82\x00\x83\x00\x84\x00\x85\x00\x86\x00\x87\x00\x88\x00\x89\x00\x8a\x00\x8b\x00\x8c\x00\x8d\x00\x8e\x00\x8f\x00\x90\x00\x91\x00\x92\x00\x93\x00\x94\x00\x95\x00\x96\x00\x97\x00\x98\x00\x99\x00\x9a\x00\x9b\x00\x9c\x00\x9d\x00\x9e\x00\x9f\x00\xa0\x00\xa1\x00\xa2\x00\xa3\x00\xa4\x00\xa5\x00\xa6\x00\xa7\x00\xa8\x00\xa9\x00\xaa\x00\xab\x00\xac\x00\xad\x00\xae\x00\xaf\x00\xb0\x00\xb1\x00\xb2\x00\xb3\x00\xb4\x00\xb5\x00\xb6\x00\xb7\x00\xb8\x00\xb9\x00\xba\x00\xbb\x00\xbc\x00\xbd\x00\xbe\x00\xbf\x00\x7d\x00\x7d\x00\x27\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x30\x00\x31\x00\x32\x00\x33\x00\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\xff\xff\xff\xff\xd7\x00\xff\xff\xff\xff\xff\xff\xff\xff\x41\x00\x42\x00\x43\x00\x44\x00\x45\x00\x46\x00\x47\x00\x48\x00\x49\x00\x4a\x00\x4b\x00\x4c\x00\x4d\x00\x4e\x00\x4f\x00\x50\x00\x51\x00\x52\x00\x53\x00\x54\x00\x55\x00\x56\x00\x57\x00\x58\x00\x59\x00\x5a\x00\x22\x00\xf7\x00\xff\xff\xff\xff\x5f\x00\x27\x00\x61\x00\x62\x00\x63\x00\x64\x00\x65\x00\x66\x00\x67\x00\x68\x00\x69\x00\x6a\x00\x6b\x00\x6c\x00\x6d\x00\x6e\x00\x6f\x00\x70\x00\x71\x00\x72\x00\x73\x00\x74\x00\x75\x00\x76\x00\x77\x00\x78\x00\x79\x00\x7a\x00\x30\x00\x31\x00\x32\x00\x33\x00\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\x0a\x00\x30\x00\x31\x00\x32\x00\x33\x00\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x5c\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x22\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x6e\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x74\x00\xff\xff\xff\xff\x65\x00\x30\x00\x31\x00\x32\x00\x33\x00\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xc0\x00\xc1\x00\xc2\x00\xc3\x00\xc4\x00\xc5\x00\xc6\x00\xc7\x00\xc8\x00\xc9\x00\xca\x00\xcb\x00\xcc\x00\xcd\x00\xce\x00\xcf\x00\xd0\x00\xd1\x00\xd2\x00\xd3\x00\xd4\x00\xd5\x00\xd6\x00\x5c\x00\xd8\x00\xd9\x00\xda\x00\xdb\x00\xdc\x00\xdd\x00\xde\x00\xdf\x00\xe0\x00\xe1\x00\xe2\x00\xe3\x00\xe4\x00\xe5\x00\xe6\x00\xe7\x00\xe8\x00\xe9\x00\xea\x00\xeb\x00\xec\x00\xed\x00\xee\x00\xef\x00\xf0\x00\xf1\x00\xf2\x00\xf3\x00\xf4\x00\xf5\x00\xf6\x00\x27\x00\xf8\x00\xf9\x00\xfa\x00\xfb\x00\xfc\x00\xfd\x00\xfe\x00\xff\x00\x30\x00\x31\x00\x32\x00\x33\x00\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x41\x00\x42\x00\x43\x00\x44\x00\x45\x00\x46\x00\x47\x00\x48\x00\x49\x00\x4a\x00\x4b\x00\x4c\x00\x4d\x00\x4e\x00\x4f\x00\x50\x00\x51\x00\x52\x00\x53\x00\x54\x00\x55\x00\x56\x00\x57\x00\x58\x00\x59\x00\x5a\x00\xff\xff\xff\xff\xff\xff\xff\xff\x5f\x00\xff\xff\x61\x00\x62\x00\x63\x00\x64\x00\x65\x00\x66\x00\x67\x00\x68\x00\x69\x00\x6a\x00\x6b\x00\x6c\x00\x6d\x00\x6e\x00\x6f\x00\x70\x00\x71\x00\x72\x00\x73\x00\x74\x00\x75\x00\x76\x00\x77\x00\x78\x00\x79\x00\x7a\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x2d\x00\xff\xff\x0a\x00\x30\x00\x31\x00\x32\x00\x33\x00\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\x30\x00\x31\x00\x32\x00\x33\x00\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\xff\xff\xff\xff\xff\xff\x22\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xc0\x00\xc1\x00\xc2\x00\xc3\x00\xc4\x00\xc5\x00\xc6\x00\xc7\x00\xc8\x00\xc9\x00\xca\x00\xcb\x00\xcc\x00\xcd\x00\xce\x00\xcf\x00\xd0\x00\xd1\x00\xd2\x00\xd3\x00\xd4\x00\xd5\x00\xd6\x00\x5c\x00\xd8\x00\xd9\x00\xda\x00\xdb\x00\xdc\x00\xdd\x00\xde\x00\xdf\x00\xe0\x00\xe1\x00\xe2\x00\xe3\x00\xe4\x00\xe5\x00\xe6\x00\xe7\x00\xe8\x00\xe9\x00\xea\x00\xeb\x00\xec\x00\xed\x00\xee\x00\xef\x00\xf0\x00\xf1\x00\xf2\x00\xf3\x00\xf4\x00\xf5\x00\xf6\x00\x27\x00\xf8\x00\xf9\x00\xfa\x00\xfb\x00\xfc\x00\xfd\x00\xfe\x00\xff\x00\x30\x00\x31\x00\x32\x00\x33\x00\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x41\x00\x42\x00\x43\x00\x44\x00\x45\x00\x46\x00\x47\x00\x48\x00\x49\x00\x4a\x00\x4b\x00\x4c\x00\x4d\x00\x4e\x00\x4f\x00\x50\x00\x51\x00\x52\x00\x53\x00\x54\x00\x55\x00\x56\x00\x57\x00\x58\x00\x59\x00\x5a\x00\xff\xff\xff\xff\xff\xff\xff\xff\x5f\x00\xff\xff\x61\x00\x62\x00\x63\x00\x64\x00\x65\x00\x66\x00\x67\x00\x68\x00\x69\x00\x6a\x00\x6b\x00\x6c\x00\x6d\x00\x6e\x00\x6f\x00\x70\x00\x71\x00\x72\x00\x73\x00\x74\x00\x75\x00\x76\x00\x77\x00\x78\x00\x79\x00\x7a\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xc0\x00\xc1\x00\xc2\x00\xc3\x00\xc4\x00\xc5\x00\xc6\x00\xc7\x00\xc8\x00\xc9\x00\xca\x00\xcb\x00\xcc\x00\xcd\x00\xce\x00\xcf\x00\xd0\x00\xd1\x00\xd2\x00\xd3\x00\xd4\x00\xd5\x00\xd6\x00\xff\xff\xd8\x00\xd9\x00\xda\x00\xdb\x00\xdc\x00\xdd\x00\xde\x00\xdf\x00\xe0\x00\xe1\x00\xe2\x00\xe3\x00\xe4\x00\xe5\x00\xe6\x00\xe7\x00\xe8\x00\xe9\x00\xea\x00\xeb\x00\xec\x00\xed\x00\xee\x00\xef\x00\xf0\x00\xf1\x00\xf2\x00\xf3\x00\xf4\x00\xf5\x00\xf6\x00\x27\x00\xf8\x00\xf9\x00\xfa\x00\xfb\x00\xfc\x00\xfd\x00\xfe\x00\xff\x00\x30\x00\x31\x00\x32\x00\x33\x00\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x41\x00\x42\x00\x43\x00\x44\x00\x45\x00\x46\x00\x47\x00\x48\x00\x49\x00\x4a\x00\x4b\x00\x4c\x00\x4d\x00\x4e\x00\x4f\x00\x50\x00\x51\x00\x52\x00\x53\x00\x54\x00\x55\x00\x56\x00\x57\x00\x58\x00\x59\x00\x5a\x00\xff\xff\xff\xff\xff\xff\xff\xff\x5f\x00\xff\xff\x61\x00\x62\x00\x63\x00\x64\x00\x65\x00\x66\x00\x67\x00\x68\x00\x69\x00\x6a\x00\x6b\x00\x6c\x00\x6d\x00\x6e\x00\x6f\x00\x70\x00\x71\x00\x72\x00\x73\x00\x74\x00\x75\x00\x76\x00\x77\x00\x78\x00\x79\x00\x7a\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xc0\x00\xc1\x00\xc2\x00\xc3\x00\xc4\x00\xc5\x00\xc6\x00\xc7\x00\xc8\x00\xc9\x00\xca\x00\xcb\x00\xcc\x00\xcd\x00\xce\x00\xcf\x00\xd0\x00\xd1\x00\xd2\x00\xd3\x00\xd4\x00\xd5\x00\xd6\x00\xff\xff\xd8\x00\xd9\x00\xda\x00\xdb\x00\xdc\x00\xdd\x00\xde\x00\xdf\x00\xe0\x00\xe1\x00\xe2\x00\xe3\x00\xe4\x00\xe5\x00\xe6\x00\xe7\x00\xe8\x00\xe9\x00\xea\x00\xeb\x00\xec\x00\xed\x00\xee\x00\xef\x00\xf0\x00\xf1\x00\xf2\x00\xf3\x00\xf4\x00\xf5\x00\xf6\x00\xff\xff\xf8\x00\xf9\x00\xfa\x00\xfb\x00\xfc\x00\xfd\x00\xfe\x00\xff\x00"# - -alex_deflt :: AlexAddr -alex_deflt = AlexA# "\x16\x00\xff\xff\x03\x00\x03\x00\xff\xff\xff\xff\x0b\x00\xff\xff\x0b\x00\x0b\x00\x0b\x00\x0b\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x15\x00\x15\x00\xff\xff\xff\xff\xff\xff\xff\xff\x1b\x00\x1b\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"# - -alex_accept = listArray (0::Int,34) [[],[],[(AlexAccSkip)],[(AlexAccSkip)],[],[(AlexAcc (alex_action_3))],[(AlexAccSkip)],[(AlexAccSkip)],[],[],[],[],[(AlexAcc (alex_action_3))],[(AlexAccSkip)],[(AlexAcc (alex_action_3))],[(AlexAcc (alex_action_3))],[(AlexAcc (alex_action_3))],[(AlexAcc (alex_action_3))],[(AlexAcc (alex_action_3))],[(AlexAcc (alex_action_4))],[],[],[(AlexAcc (alex_action_5))],[(AlexAcc (alex_action_5))],[(AlexAcc (alex_action_5))],[(AlexAcc (alex_action_7))],[],[],[],[(AlexAcc (alex_action_8))],[(AlexAcc (alex_action_9))],[(AlexAcc (alex_action_9))],[],[],[]] -{-# LINE 36 "GF/Source/LexGF.x" #-} - -tok f p s = f p s - -share :: String -> String -share = id - -data Tok = - TS !String -- reserved words and symbols - | TL !String -- string literals - | TI !String -- integer literals - | TV !String -- identifiers - | TD !String -- double precision float literals - | TC !String -- character literals - | T_LString !String - | T_PIdent !String - - deriving (Eq,Show,Ord) - -data Token = - PT Posn Tok - | Err Posn - deriving (Eq,Show,Ord) - -tokenPos (PT (Pn _ l _) _ :_) = "line " ++ show l -tokenPos (Err (Pn _ l _) :_) = "line " ++ show l -tokenPos _ = "end of file" - -posLineCol (Pn _ l c) = (l,c) -mkPosToken t@(PT p _) = (posLineCol p, prToken t) - -prToken t = case t of - PT _ (TS s) -> s - PT _ (TI s) -> s - PT _ (TV s) -> s - PT _ (TD s) -> s - PT _ (TC s) -> s - PT _ (T_LString s) -> s - PT _ (T_PIdent s) -> s - - _ -> show t - -data BTree = N | B String Tok BTree BTree deriving (Show) - -eitherResIdent :: (String -> Tok) -> String -> Tok -eitherResIdent tv s = treeFind resWords - where - treeFind N = tv s - treeFind (B a t left right) | s < a = treeFind left - | s > a = treeFind right - | s == a = t - -resWords = b "lincat" (b "def" (b "Type" (b "Str" (b "PType" (b "Lin" N N) N) (b "Tok" (b "Strs" N N) N)) (b "cat" (b "case" (b "abstract" N N) N) (b "data" (b "concrete" N N) N))) (b "include" (b "fun" (b "fn" (b "flags" N N) N) (b "in" (b "grammar" N N) N)) (b "interface" (b "instance" (b "incomplete" N N) N) (b "lin" (b "let" N N) N)))) (b "resource" (b "out" (b "of" (b "lintype" (b "lindef" N N) N) (b "oper" (b "open" N N) N)) (b "pattern" (b "param" (b "package" N N) N) (b "printname" (b "pre" N N) N))) (b "union" (b "table" (b "strs" (b "reuse" N N) N) (b "transfer" (b "tokenizer" N N) N)) (b "where" (b "variants" (b "var" N N) N) (b "with" N N)))) - where b s = B s (TS s) - -unescapeInitTail :: String -> String -unescapeInitTail = unesc . tail where - unesc s = case s of - '\\':c:cs | elem c ['\"', '\\', '\''] -> c : unesc cs - '\\':'n':cs -> '\n' : unesc cs - '\\':'t':cs -> '\t' : unesc cs - '"':[] -> [] - c:cs -> c : unesc cs - _ -> [] - -------------------------------------------------------------------- --- Alex wrapper code. --- A modified "posn" wrapper. -------------------------------------------------------------------- - -data Posn = Pn !Int !Int !Int - deriving (Eq, Show,Ord) - -alexStartPos :: Posn -alexStartPos = Pn 0 1 1 - -alexMove :: Posn -> Char -> Posn -alexMove (Pn a l c) '\t' = Pn (a+1) l (((c+7) `div` 8)*8+1) -alexMove (Pn a l c) '\n' = Pn (a+1) (l+1) 1 -alexMove (Pn a l c) _ = Pn (a+1) l (c+1) - -type AlexInput = (Posn, -- current position, - Char, -- previous char - BS.ByteString) -- current input string - -tokens :: BS.ByteString -> [Token] -tokens str = go (alexStartPos, '\n', str) - where - go :: AlexInput -> [Token] - go inp@(pos, _, str) = - case alexScan inp 0 of - AlexEOF -> [] - AlexError (pos, _, _) -> [Err pos] - AlexSkip inp' len -> go inp' - AlexToken inp' len act -> act pos (BS.unpack (BS.take len str)) : (go inp') - -alexGetChar :: AlexInput -> Maybe (Char,AlexInput) -alexGetChar (p,_,cs) | BS.null cs = Nothing - | otherwise = let c = BS.head cs - cs' = BS.tail cs - p' = alexMove p c - in p' `seq` cs' `seq` Just (c, (p', c, cs')) - -alexInputPrevChar :: AlexInput -> Char -alexInputPrevChar (p, c, s) = c - -alex_action_3 = tok (\p s -> PT p (TS $ share s)) -alex_action_4 = tok (\p s -> PT p (eitherResIdent (T_LString . share) s)) -alex_action_5 = tok (\p s -> PT p (eitherResIdent (T_PIdent . share) s)) -alex_action_6 = tok (\p s -> PT p (eitherResIdent (TV . share) s)) -alex_action_7 = tok (\p s -> PT p (TL $ share $ unescapeInitTail s)) -alex_action_8 = tok (\p s -> PT p (TI $ share s)) -alex_action_9 = tok (\p s -> PT p (TD $ share s)) -{-# LINE 1 "GenericTemplate.hs" #-} -{-# LINE 1 "" #-} -{-# LINE 1 "" #-} -{-# LINE 1 "GenericTemplate.hs" #-} --- ----------------------------------------------------------------------------- --- ALEX TEMPLATE --- --- This code is in the PUBLIC DOMAIN; you may copy it freely and use --- it for any purpose whatsoever. - --- ----------------------------------------------------------------------------- --- INTERNALS and main scanner engine - -{-# LINE 35 "GenericTemplate.hs" #-} - -{-# LINE 45 "GenericTemplate.hs" #-} - - -data AlexAddr = AlexA# Addr# - -#if __GLASGOW_HASKELL__ < 503 -uncheckedShiftL# = shiftL# -#endif - -{-# INLINE alexIndexInt16OffAddr #-} -alexIndexInt16OffAddr (AlexA# arr) off = -#ifdef WORDS_BIGENDIAN - narrow16Int# i - where - i = word2Int# ((high `uncheckedShiftL#` 8#) `or#` low) - high = int2Word# (ord# (indexCharOffAddr# arr (off' +# 1#))) - low = int2Word# (ord# (indexCharOffAddr# arr off')) - off' = off *# 2# -#else - indexInt16OffAddr# arr off -#endif - - - - - -{-# INLINE alexIndexInt32OffAddr #-} -alexIndexInt32OffAddr (AlexA# arr) off = -#ifdef WORDS_BIGENDIAN - narrow32Int# i - where - i = word2Int# ((b3 `uncheckedShiftL#` 24#) `or#` - (b2 `uncheckedShiftL#` 16#) `or#` - (b1 `uncheckedShiftL#` 8#) `or#` b0) - b3 = int2Word# (ord# (indexCharOffAddr# arr (off' +# 3#))) - b2 = int2Word# (ord# (indexCharOffAddr# arr (off' +# 2#))) - b1 = int2Word# (ord# (indexCharOffAddr# arr (off' +# 1#))) - b0 = int2Word# (ord# (indexCharOffAddr# arr off')) - off' = off *# 4# -#else - indexInt32OffAddr# arr off -#endif - - - - - -#if __GLASGOW_HASKELL__ < 503 -quickIndex arr i = arr ! i -#else --- GHC >= 503, unsafeAt is available from Data.Array.Base. -quickIndex = unsafeAt -#endif - - - - --- ----------------------------------------------------------------------------- --- Main lexing routines - -data AlexReturn a - = AlexEOF - | AlexError !AlexInput - | AlexSkip !AlexInput !Int - | AlexToken !AlexInput !Int a - --- alexScan :: AlexInput -> StartCode -> AlexReturn a -alexScan input (I# (sc)) - = alexScanUser undefined input (I# (sc)) - -alexScanUser user input (I# (sc)) - = case alex_scan_tkn user input 0# input sc AlexNone of - (AlexNone, input') -> - case alexGetChar input of - Nothing -> - - - - AlexEOF - Just _ -> - - - - AlexError input' - - (AlexLastSkip input len, _) -> - - - - AlexSkip input len - - (AlexLastAcc k input len, _) -> - - - - AlexToken input len k - - --- Push the input through the DFA, remembering the most recent accepting --- state it encountered. - -alex_scan_tkn user orig_input len input s last_acc = - input `seq` -- strict in the input - let - new_acc = check_accs (alex_accept `quickIndex` (I# (s))) - in - new_acc `seq` - case alexGetChar input of - Nothing -> (new_acc, input) - Just (c, new_input) -> - - - - let - base = alexIndexInt32OffAddr alex_base s - (I# (ord_c)) = ord c - offset = (base +# ord_c) - check = alexIndexInt16OffAddr alex_check offset - - new_s = if (offset >=# 0#) && (check ==# ord_c) - then alexIndexInt16OffAddr alex_table offset - else alexIndexInt16OffAddr alex_deflt s - in - case new_s of - -1# -> (new_acc, input) - -- on an error, we want to keep the input *before* the - -- character that failed, not after. - _ -> alex_scan_tkn user orig_input (len +# 1#) - new_input new_s new_acc - - where - check_accs [] = last_acc - check_accs (AlexAcc a : _) = AlexLastAcc a input (I# (len)) - check_accs (AlexAccSkip : _) = AlexLastSkip input (I# (len)) - check_accs (AlexAccPred a pred : rest) - | pred user orig_input (I# (len)) input - = AlexLastAcc a input (I# (len)) - check_accs (AlexAccSkipPred pred : rest) - | pred user orig_input (I# (len)) input - = AlexLastSkip input (I# (len)) - check_accs (_ : rest) = check_accs rest - -data AlexLastAcc a - = AlexNone - | AlexLastAcc a !AlexInput !Int - | AlexLastSkip !AlexInput !Int - -data AlexAcc a user - = AlexAcc a - | AlexAccSkip - | AlexAccPred a (AlexAccPred user) - | AlexAccSkipPred (AlexAccPred user) - -type AlexAccPred user = user -> AlexInput -> Int -> AlexInput -> Bool - --- ----------------------------------------------------------------------------- --- Predicates on a rule - -alexAndPred p1 p2 user in1 len in2 - = p1 user in1 len in2 && p2 user in1 len in2 - ---alexPrevCharIsPred :: Char -> AlexAccPred _ -alexPrevCharIs c _ input _ _ = c == alexInputPrevChar input - ---alexPrevCharIsOneOfPred :: Array Char Bool -> AlexAccPred _ -alexPrevCharIsOneOf arr _ input _ _ = arr ! alexInputPrevChar input - ---alexRightContext :: Int -> AlexAccPred _ -alexRightContext (I# (sc)) user _ _ input = - case alex_scan_tkn user input 0# input sc AlexNone of - (AlexNone, _) -> False - _ -> True - -- TODO: there's no need to find the longest - -- match when checking the right context, just - -- the first match will do. - --- used by wrappers -iUnbox (I# (i)) = i +{-# OPTIONS -fglasgow-exts -cpp #-} +{-# LINE 3 "LexGF.x" #-} + +{-# OPTIONS -fno-warn-incomplete-patterns #-} +module GF.Source.LexGF where + +import GF.Source.SharedString +import qualified Data.ByteString.Char8 as BS + +#if __GLASGOW_HASKELL__ >= 603 +#include "ghcconfig.h" +#elif defined(__GLASGOW_HASKELL__) +#include "config.h" +#endif +#if __GLASGOW_HASKELL__ >= 503 +import Data.Array +import Data.Char (ord) +import Data.Array.Base (unsafeAt) +#else +import Array +import Char (ord) +#endif +#if __GLASGOW_HASKELL__ >= 503 +import GHC.Exts +#else +import GlaExts +#endif +alex_base :: AlexAddr +alex_base = AlexA# "\x01\x00\x00\x00\x15\x00\x00\x00\x39\x00\x00\x00\x3a\x00\x00\x00\x18\x00\x00\x00\x19\x00\x00\x00\x1a\x00\x00\x00\x00\x00\x00\x00\x44\x00\x00\x00\x45\x00\x00\x00\x1b\x00\x00\x00\x1c\x00\x00\x00\x1d\x00\x00\x00\x42\x00\x00\x00\x00\x00\x00\x00\x26\x00\x00\x00\x27\x00\x00\x00\x13\x00\x00\x00\x9c\x00\x00\x00\x00\x00\x00\x00\x2c\x00\x00\x00\x2d\x00\x00\x00\x6c\x01\x00\x00\x3c\x02\x00\x00\x0c\x03\x00\x00\x00\x00\x00\x00\x17\x01\x00\x00\xe7\x01\x00\x00\xd5\x00\x00\x00\x35\x00\x00\x00\xe7\x00\x00\x00\xf2\x00\x00\x00\x1d\x01\x00\x00\xc2\x01\x00\x00\xcc\x01\x00\x00"# + +alex_table :: AlexAddr +alex_table = AlexA# "\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x0d\x00\x0e\x00\x1a\x00\x0e\x00\x0e\x00\x0e\x00\xff\xff\x14\x00\x0e\x00\x0e\x00\x0f\x00\x10\x00\x0e\x00\x05\x00\x0e\x00\x0e\x00\x1d\x00\x1d\x00\x1d\x00\x1d\x00\x1d\x00\x1d\x00\x1d\x00\x1d\x00\x1d\x00\x1d\x00\x0e\x00\x0e\x00\x0e\x00\x11\x00\x0e\x00\x0e\x00\x0e\x00\x04\x00\xff\xff\xff\xff\x02\x00\x02\x00\x09\x00\x09\x00\x09\x00\x0a\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0e\x00\x0e\x00\x0e\x00\x13\x00\x13\x00\x00\x00\x00\x00\x0e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0e\x00\x0e\x00\x0e\x00\xff\xff\x12\x00\xff\xff\x0d\x00\x20\x00\x00\x00\x1d\x00\x1d\x00\x1d\x00\x1d\x00\x1d\x00\x1d\x00\x1d\x00\x1d\x00\x1d\x00\x1d\x00\x00\x00\x00\x00\x09\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0c\x00\x0e\x00\x0e\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x06\x00\x07\x00\x17\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x00\x00\x00\x00\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x1b\x00\xff\xff\x00\x00\x00\x00\x17\x00\x1b\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x1e\x00\x1e\x00\x1e\x00\x1e\x00\x1e\x00\x1e\x00\x1e\x00\x1e\x00\x1e\x00\x1e\x00\xff\xff\x1f\x00\x1f\x00\x1f\x00\x1f\x00\x1f\x00\x1f\x00\x1f\x00\x1f\x00\x1f\x00\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1b\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x19\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1b\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1b\x00\x00\x00\x00\x00\x21\x00\x1e\x00\x1e\x00\x1e\x00\x1e\x00\x1e\x00\x1e\x00\x1e\x00\x1e\x00\x1e\x00\x1e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x1c\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x18\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x00\x00\x00\x00\x00\x00\x00\x00\x18\x00\x00\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x22\x00\x00\x00\xff\xff\x1f\x00\x1f\x00\x1f\x00\x1f\x00\x1f\x00\x1f\x00\x1f\x00\x1f\x00\x1f\x00\x1f\x00\x1f\x00\x1f\x00\x1f\x00\x1f\x00\x1f\x00\x1f\x00\x1f\x00\x1f\x00\x1f\x00\x1f\x00\x00\x00\x00\x00\x00\x00\x19\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x1c\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x17\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x00\x00\x00\x00\x00\x00\x00\x00\x17\x00\x00\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x00\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x18\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x00\x00\x00\x00\x00\x00\x00\x00\x18\x00\x00\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x00\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x00\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00\x18\x00"# + +alex_check :: AlexAddr +alex_check = AlexA# "\xff\xff\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x05\x00\x06\x00\x07\x00\x08\x00\x09\x00\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x29\x00\x2a\x00\x2b\x00\x2c\x00\x2d\x00\x2e\x00\x2f\x00\x30\x00\x31\x00\x32\x00\x33\x00\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\x3a\x00\x3b\x00\x3c\x00\x3d\x00\x3e\x00\x3f\x00\x40\x00\x2d\x00\x0a\x00\x0a\x00\x2d\x00\x2d\x00\x2d\x00\x2d\x00\x2d\x00\x2d\x00\x09\x00\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x2a\x00\x3e\x00\x2b\x00\x27\x00\x27\x00\xff\xff\xff\xff\x3e\x00\xff\xff\xff\xff\xff\xff\xff\xff\x5b\x00\x5c\x00\x5d\x00\x5e\x00\x5f\x00\x60\x00\x20\x00\x2e\x00\xff\xff\x30\x00\x31\x00\x32\x00\x33\x00\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\xff\xff\xff\xff\x2d\x00\x2d\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x7b\x00\x7c\x00\x7d\x00\x7e\x00\x7f\x00\x80\x00\x81\x00\x82\x00\x83\x00\x84\x00\x85\x00\x86\x00\x87\x00\x88\x00\x89\x00\x8a\x00\x8b\x00\x8c\x00\x8d\x00\x8e\x00\x8f\x00\x90\x00\x91\x00\x92\x00\x93\x00\x94\x00\x95\x00\x96\x00\x97\x00\x98\x00\x99\x00\x9a\x00\x9b\x00\x9c\x00\x9d\x00\x9e\x00\x9f\x00\xa0\x00\xa1\x00\xa2\x00\xa3\x00\xa4\x00\xa5\x00\xa6\x00\xa7\x00\xa8\x00\xa9\x00\xaa\x00\xab\x00\xac\x00\xad\x00\xae\x00\xaf\x00\xb0\x00\xb1\x00\xb2\x00\xb3\x00\xb4\x00\xb5\x00\xb6\x00\xb7\x00\xb8\x00\xb9\x00\xba\x00\xbb\x00\xbc\x00\xbd\x00\xbe\x00\xbf\x00\x7d\x00\x7d\x00\x27\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x30\x00\x31\x00\x32\x00\x33\x00\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\xff\xff\xff\xff\xd7\x00\xff\xff\xff\xff\xff\xff\xff\xff\x41\x00\x42\x00\x43\x00\x44\x00\x45\x00\x46\x00\x47\x00\x48\x00\x49\x00\x4a\x00\x4b\x00\x4c\x00\x4d\x00\x4e\x00\x4f\x00\x50\x00\x51\x00\x52\x00\x53\x00\x54\x00\x55\x00\x56\x00\x57\x00\x58\x00\x59\x00\x5a\x00\x22\x00\xf7\x00\xff\xff\xff\xff\x5f\x00\x27\x00\x61\x00\x62\x00\x63\x00\x64\x00\x65\x00\x66\x00\x67\x00\x68\x00\x69\x00\x6a\x00\x6b\x00\x6c\x00\x6d\x00\x6e\x00\x6f\x00\x70\x00\x71\x00\x72\x00\x73\x00\x74\x00\x75\x00\x76\x00\x77\x00\x78\x00\x79\x00\x7a\x00\x30\x00\x31\x00\x32\x00\x33\x00\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\x0a\x00\x30\x00\x31\x00\x32\x00\x33\x00\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x5c\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x22\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x6e\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x74\x00\xff\xff\xff\xff\x65\x00\x30\x00\x31\x00\x32\x00\x33\x00\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xc0\x00\xc1\x00\xc2\x00\xc3\x00\xc4\x00\xc5\x00\xc6\x00\xc7\x00\xc8\x00\xc9\x00\xca\x00\xcb\x00\xcc\x00\xcd\x00\xce\x00\xcf\x00\xd0\x00\xd1\x00\xd2\x00\xd3\x00\xd4\x00\xd5\x00\xd6\x00\x5c\x00\xd8\x00\xd9\x00\xda\x00\xdb\x00\xdc\x00\xdd\x00\xde\x00\xdf\x00\xe0\x00\xe1\x00\xe2\x00\xe3\x00\xe4\x00\xe5\x00\xe6\x00\xe7\x00\xe8\x00\xe9\x00\xea\x00\xeb\x00\xec\x00\xed\x00\xee\x00\xef\x00\xf0\x00\xf1\x00\xf2\x00\xf3\x00\xf4\x00\xf5\x00\xf6\x00\x27\x00\xf8\x00\xf9\x00\xfa\x00\xfb\x00\xfc\x00\xfd\x00\xfe\x00\xff\x00\x30\x00\x31\x00\x32\x00\x33\x00\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x41\x00\x42\x00\x43\x00\x44\x00\x45\x00\x46\x00\x47\x00\x48\x00\x49\x00\x4a\x00\x4b\x00\x4c\x00\x4d\x00\x4e\x00\x4f\x00\x50\x00\x51\x00\x52\x00\x53\x00\x54\x00\x55\x00\x56\x00\x57\x00\x58\x00\x59\x00\x5a\x00\xff\xff\xff\xff\xff\xff\xff\xff\x5f\x00\xff\xff\x61\x00\x62\x00\x63\x00\x64\x00\x65\x00\x66\x00\x67\x00\x68\x00\x69\x00\x6a\x00\x6b\x00\x6c\x00\x6d\x00\x6e\x00\x6f\x00\x70\x00\x71\x00\x72\x00\x73\x00\x74\x00\x75\x00\x76\x00\x77\x00\x78\x00\x79\x00\x7a\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x2d\x00\xff\xff\x0a\x00\x30\x00\x31\x00\x32\x00\x33\x00\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\x30\x00\x31\x00\x32\x00\x33\x00\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\xff\xff\xff\xff\xff\xff\x22\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xc0\x00\xc1\x00\xc2\x00\xc3\x00\xc4\x00\xc5\x00\xc6\x00\xc7\x00\xc8\x00\xc9\x00\xca\x00\xcb\x00\xcc\x00\xcd\x00\xce\x00\xcf\x00\xd0\x00\xd1\x00\xd2\x00\xd3\x00\xd4\x00\xd5\x00\xd6\x00\x5c\x00\xd8\x00\xd9\x00\xda\x00\xdb\x00\xdc\x00\xdd\x00\xde\x00\xdf\x00\xe0\x00\xe1\x00\xe2\x00\xe3\x00\xe4\x00\xe5\x00\xe6\x00\xe7\x00\xe8\x00\xe9\x00\xea\x00\xeb\x00\xec\x00\xed\x00\xee\x00\xef\x00\xf0\x00\xf1\x00\xf2\x00\xf3\x00\xf4\x00\xf5\x00\xf6\x00\x27\x00\xf8\x00\xf9\x00\xfa\x00\xfb\x00\xfc\x00\xfd\x00\xfe\x00\xff\x00\x30\x00\x31\x00\x32\x00\x33\x00\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x41\x00\x42\x00\x43\x00\x44\x00\x45\x00\x46\x00\x47\x00\x48\x00\x49\x00\x4a\x00\x4b\x00\x4c\x00\x4d\x00\x4e\x00\x4f\x00\x50\x00\x51\x00\x52\x00\x53\x00\x54\x00\x55\x00\x56\x00\x57\x00\x58\x00\x59\x00\x5a\x00\xff\xff\xff\xff\xff\xff\xff\xff\x5f\x00\xff\xff\x61\x00\x62\x00\x63\x00\x64\x00\x65\x00\x66\x00\x67\x00\x68\x00\x69\x00\x6a\x00\x6b\x00\x6c\x00\x6d\x00\x6e\x00\x6f\x00\x70\x00\x71\x00\x72\x00\x73\x00\x74\x00\x75\x00\x76\x00\x77\x00\x78\x00\x79\x00\x7a\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xc0\x00\xc1\x00\xc2\x00\xc3\x00\xc4\x00\xc5\x00\xc6\x00\xc7\x00\xc8\x00\xc9\x00\xca\x00\xcb\x00\xcc\x00\xcd\x00\xce\x00\xcf\x00\xd0\x00\xd1\x00\xd2\x00\xd3\x00\xd4\x00\xd5\x00\xd6\x00\xff\xff\xd8\x00\xd9\x00\xda\x00\xdb\x00\xdc\x00\xdd\x00\xde\x00\xdf\x00\xe0\x00\xe1\x00\xe2\x00\xe3\x00\xe4\x00\xe5\x00\xe6\x00\xe7\x00\xe8\x00\xe9\x00\xea\x00\xeb\x00\xec\x00\xed\x00\xee\x00\xef\x00\xf0\x00\xf1\x00\xf2\x00\xf3\x00\xf4\x00\xf5\x00\xf6\x00\x27\x00\xf8\x00\xf9\x00\xfa\x00\xfb\x00\xfc\x00\xfd\x00\xfe\x00\xff\x00\x30\x00\x31\x00\x32\x00\x33\x00\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x41\x00\x42\x00\x43\x00\x44\x00\x45\x00\x46\x00\x47\x00\x48\x00\x49\x00\x4a\x00\x4b\x00\x4c\x00\x4d\x00\x4e\x00\x4f\x00\x50\x00\x51\x00\x52\x00\x53\x00\x54\x00\x55\x00\x56\x00\x57\x00\x58\x00\x59\x00\x5a\x00\xff\xff\xff\xff\xff\xff\xff\xff\x5f\x00\xff\xff\x61\x00\x62\x00\x63\x00\x64\x00\x65\x00\x66\x00\x67\x00\x68\x00\x69\x00\x6a\x00\x6b\x00\x6c\x00\x6d\x00\x6e\x00\x6f\x00\x70\x00\x71\x00\x72\x00\x73\x00\x74\x00\x75\x00\x76\x00\x77\x00\x78\x00\x79\x00\x7a\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xc0\x00\xc1\x00\xc2\x00\xc3\x00\xc4\x00\xc5\x00\xc6\x00\xc7\x00\xc8\x00\xc9\x00\xca\x00\xcb\x00\xcc\x00\xcd\x00\xce\x00\xcf\x00\xd0\x00\xd1\x00\xd2\x00\xd3\x00\xd4\x00\xd5\x00\xd6\x00\xff\xff\xd8\x00\xd9\x00\xda\x00\xdb\x00\xdc\x00\xdd\x00\xde\x00\xdf\x00\xe0\x00\xe1\x00\xe2\x00\xe3\x00\xe4\x00\xe5\x00\xe6\x00\xe7\x00\xe8\x00\xe9\x00\xea\x00\xeb\x00\xec\x00\xed\x00\xee\x00\xef\x00\xf0\x00\xf1\x00\xf2\x00\xf3\x00\xf4\x00\xf5\x00\xf6\x00\xff\xff\xf8\x00\xf9\x00\xfa\x00\xfb\x00\xfc\x00\xfd\x00\xfe\x00\xff\x00"# + +alex_deflt :: AlexAddr +alex_deflt = AlexA# "\x16\x00\xff\xff\x03\x00\x03\x00\xff\xff\xff\xff\x0b\x00\xff\xff\x0b\x00\x0b\x00\x0b\x00\x0b\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x15\x00\x15\x00\xff\xff\xff\xff\xff\xff\xff\xff\x1b\x00\x1b\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"# + +alex_accept = listArray (0::Int,34) [[],[],[(AlexAccSkip)],[(AlexAccSkip)],[],[(AlexAcc (alex_action_3))],[(AlexAccSkip)],[(AlexAccSkip)],[],[],[],[],[(AlexAcc (alex_action_3))],[(AlexAccSkip)],[(AlexAcc (alex_action_3))],[(AlexAcc (alex_action_3))],[(AlexAcc (alex_action_3))],[(AlexAcc (alex_action_3))],[(AlexAcc (alex_action_3))],[(AlexAcc (alex_action_4))],[],[],[(AlexAcc (alex_action_5))],[(AlexAcc (alex_action_5))],[(AlexAcc (alex_action_5))],[(AlexAcc (alex_action_7))],[],[],[],[(AlexAcc (alex_action_8))],[(AlexAcc (alex_action_9))],[(AlexAcc (alex_action_9))],[],[],[]] +{-# LINE 37 "LexGF.x" #-} + + +tok f p s = f p s + +share :: BS.ByteString -> BS.ByteString +share = shareString + +data Tok = + TS !BS.ByteString !Int -- reserved words and symbols + | TL !BS.ByteString -- string literals + | TI !BS.ByteString -- integer literals + | TV !BS.ByteString -- identifiers + | TD !BS.ByteString -- double precision float literals + | TC !BS.ByteString -- character literals + | T_LString !BS.ByteString + | T_PIdent !BS.ByteString + + deriving (Eq,Show,Ord) + +data Token = + PT Posn Tok + | Err Posn + deriving (Eq,Show,Ord) + +tokenPos (PT (Pn _ l _) _ :_) = "line " ++ show l +tokenPos (Err (Pn _ l _) :_) = "line " ++ show l +tokenPos _ = "end of file" + +posLineCol (Pn _ l c) = (l,c) +mkPosToken t@(PT p _) = (posLineCol p, prToken t) + +prToken t = case t of + PT _ (TS s _) -> s + PT _ (TL s) -> s + PT _ (TI s) -> s + PT _ (TV s) -> s + PT _ (TD s) -> s + PT _ (TC s) -> s + PT _ (T_LString s) -> s + PT _ (T_PIdent s) -> s + + +data BTree = N | B BS.ByteString Tok BTree BTree deriving (Show) + +eitherResIdent :: (BS.ByteString -> Tok) -> BS.ByteString -> Tok +eitherResIdent tv s = treeFind resWords + where + treeFind N = tv s + treeFind (B a t left right) | s < a = treeFind left + | s > a = treeFind right + | s == a = t + +resWords = b "def" 39 (b "=>" 20 (b "++" 10 (b "(" 5 (b "$" 3 (b "#" 2 (b "!" 1 N N) N) (b "%" 4 N N)) (b "**" 8 (b "*" 7 (b ")" 6 N N) N) (b "+" 9 N N))) (b "/" 15 (b "->" 13 (b "-" 12 (b "," 11 N N) N) (b "." 14 N N)) (b "<" 18 (b ";" 17 (b ":" 16 N N) N) (b "=" 19 N N)))) (b "[" 30 (b "PType" 25 (b "@" 23 (b "?" 22 (b ">" 21 N N) N) (b "Lin" 24 N N)) (b "Tok" 28 (b "Strs" 27 (b "Str" 26 N N) N) (b "Type" 29 N N))) (b "case" 35 (b "_" 33 (b "]" 32 (b "\\" 31 N N) N) (b "abstract" 34 N N)) (b "concrete" 37 (b "cat" 36 N N) (b "data" 38 N N))))) (b "package" 58 (b "let" 49 (b "in" 44 (b "fun" 42 (b "fn" 41 (b "flags" 40 N N) N) (b "grammar" 43 N N)) (b "instance" 47 (b "incomplete" 46 (b "include" 45 N N) N) (b "interface" 48 N N))) (b "of" 54 (b "lindef" 52 (b "lincat" 51 (b "lin" 50 N N) N) (b "lintype" 53 N N)) (b "oper" 56 (b "open" 55 N N) (b "out" 57 N N)))) (b "transfer" 68 (b "resource" 63 (b "pre" 61 (b "pattern" 60 (b "param" 59 N N) N) (b "printname" 62 N N)) (b "table" 66 (b "strs" 65 (b "reuse" 64 N N) N) (b "tokenizer" 67 N N))) (b "with" 73 (b "variants" 71 (b "var" 70 (b "union" 69 N N) N) (b "where" 72 N N)) (b "|" 75 (b "{" 74 N N) (b "}" 76 N N))))) + where b s n = let bs = BS.pack s + in B bs (TS bs n) + +unescapeInitTail :: BS.ByteString -> BS.ByteString +unescapeInitTail = BS.pack . unesc . tail . BS.unpack where + unesc s = case s of + '\\':c:cs | elem c ['\"', '\\', '\''] -> c : unesc cs + '\\':'n':cs -> '\n' : unesc cs + '\\':'t':cs -> '\t' : unesc cs + '"':[] -> [] + c:cs -> c : unesc cs + _ -> [] + +------------------------------------------------------------------- +-- Alex wrapper code. +-- A modified "posn" wrapper. +------------------------------------------------------------------- + +data Posn = Pn !Int !Int !Int + deriving (Eq, Show,Ord) + +alexStartPos :: Posn +alexStartPos = Pn 0 1 1 + +alexMove :: Posn -> Char -> Posn +alexMove (Pn a l c) '\t' = Pn (a+1) l (((c+7) `div` 8)*8+1) +alexMove (Pn a l c) '\n' = Pn (a+1) (l+1) 1 +alexMove (Pn a l c) _ = Pn (a+1) l (c+1) + +type AlexInput = (Posn, -- current position, + Char, -- previous char + BS.ByteString) -- current input string + +tokens :: BS.ByteString -> [Token] +tokens str = go (alexStartPos, '\n', str) + where + go :: AlexInput -> [Token] + go inp@(pos, _, str) = + case alexScan inp 0 of + AlexEOF -> [] + AlexError (pos, _, _) -> [Err pos] + AlexSkip inp' len -> go inp' + AlexToken inp' len act -> act pos (BS.take len str) : (go inp') + +alexGetChar :: AlexInput -> Maybe (Char,AlexInput) +alexGetChar (p, _, s) = + case BS.uncons s of + Nothing -> Nothing + Just (c,s) -> + let p' = alexMove p c + in p' `seq` Just (c, (p', c, s)) + +alexInputPrevChar :: AlexInput -> Char +alexInputPrevChar (p, c, s) = c + +alex_action_3 = tok (\p s -> PT p (eitherResIdent (T_PIdent . share) s)) +alex_action_4 = tok (\p s -> PT p (eitherResIdent (T_LString . share) s)) +alex_action_5 = tok (\p s -> PT p (eitherResIdent (T_PIdent . share) s)) +alex_action_6 = tok (\p s -> PT p (eitherResIdent (TV . share) s)) +alex_action_7 = tok (\p s -> PT p (TL $ share $ unescapeInitTail s)) +alex_action_8 = tok (\p s -> PT p (TI $ share s)) +alex_action_9 = tok (\p s -> PT p (TD $ share s)) +{-# LINE 1 "templates/GenericTemplate.hs" #-} +{-# LINE 1 "templates/GenericTemplate.hs" #-} +{-# LINE 1 "" #-} +{-# LINE 1 "" #-} +{-# LINE 1 "templates/GenericTemplate.hs" #-} +-- ----------------------------------------------------------------------------- +-- ALEX TEMPLATE +-- +-- This code is in the PUBLIC DOMAIN; you may copy it freely and use +-- it for any purpose whatsoever. + +-- ----------------------------------------------------------------------------- +-- INTERNALS and main scanner engine + +{-# LINE 35 "templates/GenericTemplate.hs" #-} + +{-# LINE 45 "templates/GenericTemplate.hs" #-} + + +data AlexAddr = AlexA# Addr# + +#if __GLASGOW_HASKELL__ < 503 +uncheckedShiftL# = shiftL# +#endif + +{-# INLINE alexIndexInt16OffAddr #-} +alexIndexInt16OffAddr (AlexA# arr) off = +#ifdef WORDS_BIGENDIAN + narrow16Int# i + where + i = word2Int# ((high `uncheckedShiftL#` 8#) `or#` low) + high = int2Word# (ord# (indexCharOffAddr# arr (off' +# 1#))) + low = int2Word# (ord# (indexCharOffAddr# arr off')) + off' = off *# 2# +#else + indexInt16OffAddr# arr off +#endif + + + + + +{-# INLINE alexIndexInt32OffAddr #-} +alexIndexInt32OffAddr (AlexA# arr) off = +#ifdef WORDS_BIGENDIAN + narrow32Int# i + where + i = word2Int# ((b3 `uncheckedShiftL#` 24#) `or#` + (b2 `uncheckedShiftL#` 16#) `or#` + (b1 `uncheckedShiftL#` 8#) `or#` b0) + b3 = int2Word# (ord# (indexCharOffAddr# arr (off' +# 3#))) + b2 = int2Word# (ord# (indexCharOffAddr# arr (off' +# 2#))) + b1 = int2Word# (ord# (indexCharOffAddr# arr (off' +# 1#))) + b0 = int2Word# (ord# (indexCharOffAddr# arr off')) + off' = off *# 4# +#else + indexInt32OffAddr# arr off +#endif + + + + + +#if __GLASGOW_HASKELL__ < 503 +quickIndex arr i = arr ! i +#else +-- GHC >= 503, unsafeAt is available from Data.Array.Base. +quickIndex = unsafeAt +#endif + + + + +-- ----------------------------------------------------------------------------- +-- Main lexing routines + +data AlexReturn a + = AlexEOF + | AlexError !AlexInput + | AlexSkip !AlexInput !Int + | AlexToken !AlexInput !Int a + +-- alexScan :: AlexInput -> StartCode -> AlexReturn a +alexScan input (I# (sc)) + = alexScanUser undefined input (I# (sc)) + +alexScanUser user input (I# (sc)) + = case alex_scan_tkn user input 0# input sc AlexNone of + (AlexNone, input') -> + case alexGetChar input of + Nothing -> + + + + AlexEOF + Just _ -> + + + + AlexError input' + + (AlexLastSkip input len, _) -> + + + + AlexSkip input len + + (AlexLastAcc k input len, _) -> + + + + AlexToken input len k + + +-- Push the input through the DFA, remembering the most recent accepting +-- state it encountered. + +alex_scan_tkn user orig_input len input s last_acc = + input `seq` -- strict in the input + let + new_acc = check_accs (alex_accept `quickIndex` (I# (s))) + in + new_acc `seq` + case alexGetChar input of + Nothing -> (new_acc, input) + Just (c, new_input) -> + + + + let + base = alexIndexInt32OffAddr alex_base s + (I# (ord_c)) = ord c + offset = (base +# ord_c) + check = alexIndexInt16OffAddr alex_check offset + + new_s = if (offset >=# 0#) && (check ==# ord_c) + then alexIndexInt16OffAddr alex_table offset + else alexIndexInt16OffAddr alex_deflt s + in + case new_s of + -1# -> (new_acc, input) + -- on an error, we want to keep the input *before* the + -- character that failed, not after. + _ -> alex_scan_tkn user orig_input (len +# 1#) + new_input new_s new_acc + + where + check_accs [] = last_acc + check_accs (AlexAcc a : _) = AlexLastAcc a input (I# (len)) + check_accs (AlexAccSkip : _) = AlexLastSkip input (I# (len)) + check_accs (AlexAccPred a pred : rest) + | pred user orig_input (I# (len)) input + = AlexLastAcc a input (I# (len)) + check_accs (AlexAccSkipPred pred : rest) + | pred user orig_input (I# (len)) input + = AlexLastSkip input (I# (len)) + check_accs (_ : rest) = check_accs rest + +data AlexLastAcc a + = AlexNone + | AlexLastAcc a !AlexInput !Int + | AlexLastSkip !AlexInput !Int + +data AlexAcc a user + = AlexAcc a + | AlexAccSkip + | AlexAccPred a (AlexAccPred user) + | AlexAccSkipPred (AlexAccPred user) + +type AlexAccPred user = user -> AlexInput -> Int -> AlexInput -> Bool + +-- ----------------------------------------------------------------------------- +-- Predicates on a rule + +alexAndPred p1 p2 user in1 len in2 + = p1 user in1 len in2 && p2 user in1 len in2 + +--alexPrevCharIsPred :: Char -> AlexAccPred _ +alexPrevCharIs c _ input _ _ = c == alexInputPrevChar input + +--alexPrevCharIsOneOfPred :: Array Char Bool -> AlexAccPred _ +alexPrevCharIsOneOf arr _ input _ _ = arr ! alexInputPrevChar input + +--alexRightContext :: Int -> AlexAccPred _ +alexRightContext (I# (sc)) user _ _ input = + case alex_scan_tkn user input 0# input sc AlexNone of + (AlexNone, _) -> False + _ -> True + -- TODO: there's no need to find the longest + -- match when checking the right context, just + -- the first match will do. + +-- used by wrappers +iUnbox (I# (i)) = i diff --git a/src-3.0/GF/Source/LexGF.x b/src-3.0/GF/Source/LexGF.x index 7ea768e75..15671c9de 100644 --- a/src-3.0/GF/Source/LexGF.x +++ b/src-3.0/GF/Source/LexGF.x @@ -1,137 +1,144 @@ --- -*- haskell -*- --- This Alex file was machine-generated by the BNF converter -{ -module LexGF where - -import ErrM -import SharedString -} - - -$l = [a-zA-Z\192 - \255] # [\215 \247] -- isolatin1 letter FIXME -$c = [A-Z\192-\221] # [\215] -- capital isolatin1 letter FIXME -$s = [a-z\222-\255] # [\247] -- small isolatin1 letter FIXME -$d = [0-9] -- digit -$i = [$l $d _ '] -- identifier character -$u = [\0-\255] -- universal: any character - -@rsyms = -- reserved words consisting of special symbols - \; | \= | \{ | \} | \( | \) | \: | \- \> | \* \* | \, | \[ | \] | \- | \. | \| | \% | \? | \< | \> | \@ | \! | \* | \+ | \+ \+ | \\ | \= \> | \_ | \$ | \/ - -:- -"--" [.]* ; -- Toss single line comments -"{-" ([$u # \-] | \- [$u # \}])* ("-")+ "}" ; - -$white+ ; -@rsyms { tok (\p s -> PT p (TS $ share s)) } -\' ($u # \')* \' { tok (\p s -> PT p (eitherResIdent (T_LString . share) s)) } - -$l $i* { tok (\p s -> PT p (eitherResIdent (TV . share) s)) } -\" ([$u # [\" \\ \n]] | (\\ (\" | \\ | \' | n | t)))* \"{ tok (\p s -> PT p (TL $ share $ unescapeInitTail s)) } - -$d+ { tok (\p s -> PT p (TI $ share s)) } -$d+ \. $d+ (e (\-)? $d+)? { tok (\p s -> PT p (TD $ share s)) } - -{ - -tok f p s = f p s - -share :: String -> String -share = shareString - -data Tok = - TS !String -- reserved words - | TL !String -- string literals - | TI !String -- integer literals - | TV !String -- identifiers - | TD !String -- double precision float literals - | TC !String -- character literals - | T_LString !String - - deriving (Eq,Show,Ord) - -data Token = - PT Posn Tok - | Err Posn - deriving (Eq,Show,Ord) - -tokenPos (PT (Pn _ l _) _ :_) = "line " ++ show l -tokenPos (Err (Pn _ l _) :_) = "line " ++ show l -tokenPos _ = "end of file" - -posLineCol (Pn _ l c) = (l,c) -mkPosToken t@(PT p _) = (posLineCol p, prToken t) - -prToken t = case t of - PT _ (TS s) -> s - PT _ (TI s) -> s - PT _ (TV s) -> s - PT _ (TD s) -> s - PT _ (TC s) -> s - PT _ (T_LString s) -> s - - _ -> show t - -data BTree = N | B String Tok BTree BTree deriving (Show) - -eitherResIdent :: (String -> Tok) -> String -> Tok -eitherResIdent tv s = treeFind resWords - where - treeFind N = tv s - treeFind (B a t left right) | s < a = treeFind left - | s > a = treeFind right - | s == a = t - -resWords = b "lincat" (b "def" (b "Type" (b "Str" (b "PType" (b "Lin" N N) N) (b "Tok" (b "Strs" N N) N)) (b "cat" (b "case" (b "abstract" N N) N) (b "data" (b "concrete" N N) N))) (b "include" (b "fun" (b "fn" (b "flags" N N) N) (b "in" (b "grammar" N N) N)) (b "interface" (b "instance" (b "incomplete" N N) N) (b "lin" (b "let" N N) N)))) (b "resource" (b "out" (b "of" (b "lintype" (b "lindef" N N) N) (b "oper" (b "open" N N) N)) (b "pattern" (b "param" (b "package" N N) N) (b "printname" (b "pre" N N) N))) (b "union" (b "table" (b "strs" (b "reuse" N N) N) (b "transfer" (b "tokenizer" N N) N)) (b "where" (b "variants" (b "var" N N) N) (b "with" N N)))) - where b s = B s (TS s) - -unescapeInitTail :: String -> String -unescapeInitTail = unesc . tail where - unesc s = case s of - '\\':c:cs | elem c ['\"', '\\', '\''] -> c : unesc cs - '\\':'n':cs -> '\n' : unesc cs - '\\':'t':cs -> '\t' : unesc cs - '"':[] -> [] - c:cs -> c : unesc cs - _ -> [] - -------------------------------------------------------------------- --- Alex wrapper code. --- A modified "posn" wrapper. -------------------------------------------------------------------- - -data Posn = Pn !Int !Int !Int - deriving (Eq, Show,Ord) - -alexStartPos :: Posn -alexStartPos = Pn 0 1 1 - -alexMove :: Posn -> Char -> Posn -alexMove (Pn a l c) '\t' = Pn (a+1) l (((c+7) `div` 8)*8+1) -alexMove (Pn a l c) '\n' = Pn (a+1) (l+1) 1 -alexMove (Pn a l c) _ = Pn (a+1) l (c+1) - -type AlexInput = (Posn, -- current position, - Char, -- previous char - String) -- current input string - -tokens :: String -> [Token] -tokens str = go (alexStartPos, '\n', str) - where - go :: (Posn, Char, String) -> [Token] - go inp@(pos, _, str) = - case alexScan inp 0 of - AlexEOF -> [] - AlexError (pos, _, _) -> fail $ show pos ++ ": lexical error" - AlexSkip inp' len -> go inp' - AlexToken inp' len act -> act pos (take len str) : (go inp') - -alexGetChar :: AlexInput -> Maybe (Char,AlexInput) -alexGetChar (p, c, []) = Nothing -alexGetChar (p, _, (c:s)) = - let p' = alexMove p c - in p' `seq` Just (c, (p', c, s)) - -alexInputPrevChar :: AlexInput -> Char -alexInputPrevChar (p, c, s) = c -} +-- -*- haskell -*- +-- This Alex file was machine-generated by the BNF converter +{ +{-# OPTIONS -fno-warn-incomplete-patterns #-} +module GF.Source.LexGF where + +import GF.Source.SharedString +import qualified Data.ByteString.Char8 as BS +} + + +$l = [a-zA-Z\192 - \255] # [\215 \247] -- isolatin1 letter FIXME +$c = [A-Z\192-\221] # [\215] -- capital isolatin1 letter FIXME +$s = [a-z\222-\255] # [\247] -- small isolatin1 letter FIXME +$d = [0-9] -- digit +$i = [$l $d _ '] -- identifier character +$u = [\0-\255] -- universal: any character + +@rsyms = -- symbols and non-identifier-like reserved words + \; | \= | \{ | \} | \( | \) | \* \* | \: | \- \> | \, | \[ | \] | \- | \. | \| | \% | \? | \< | \> | \@ | \# | \! | \* | \+ | \+ \+ | \\ | \= \> | \_ | \$ | \/ + +:- +"--" [.]* ; -- Toss single line comments +"{-" ([$u # \-] | \- [$u # \}])* ("-")+ "}" ; + +$white+ ; +@rsyms { tok (\p s -> PT p (eitherResIdent (T_PIdent . share) s)) } +\' ($u # \')* \' { tok (\p s -> PT p (eitherResIdent (T_LString . share) s)) } +(\_ | $l)($l | $d | \_ | \')* { tok (\p s -> PT p (eitherResIdent (T_PIdent . share) s)) } + +$l $i* { tok (\p s -> PT p (eitherResIdent (TV . share) s)) } +\" ([$u # [\" \\ \n]] | (\\ (\" | \\ | \' | n | t)))* \"{ tok (\p s -> PT p (TL $ share $ unescapeInitTail s)) } + +$d+ { tok (\p s -> PT p (TI $ share s)) } +$d+ \. $d+ (e (\-)? $d+)? { tok (\p s -> PT p (TD $ share s)) } + +{ + +tok f p s = f p s + +share :: BS.ByteString -> BS.ByteString +share = shareString + +data Tok = + TS !BS.ByteString !Int -- reserved words and symbols + | TL !BS.ByteString -- string literals + | TI !BS.ByteString -- integer literals + | TV !BS.ByteString -- identifiers + | TD !BS.ByteString -- double precision float literals + | TC !BS.ByteString -- character literals + | T_LString !BS.ByteString + | T_PIdent !BS.ByteString + + deriving (Eq,Show,Ord) + +data Token = + PT Posn Tok + | Err Posn + deriving (Eq,Show,Ord) + +tokenPos (PT (Pn _ l _) _ :_) = "line " ++ show l +tokenPos (Err (Pn _ l _) :_) = "line " ++ show l +tokenPos _ = "end of file" + +posLineCol (Pn _ l c) = (l,c) +mkPosToken t@(PT p _) = (posLineCol p, prToken t) + +prToken t = case t of + PT _ (TS s _) -> s + PT _ (TL s) -> s + PT _ (TI s) -> s + PT _ (TV s) -> s + PT _ (TD s) -> s + PT _ (TC s) -> s + PT _ (T_LString s) -> s + PT _ (T_PIdent s) -> s + + +data BTree = N | B BS.ByteString Tok BTree BTree deriving (Show) + +eitherResIdent :: (BS.ByteString -> Tok) -> BS.ByteString -> Tok +eitherResIdent tv s = treeFind resWords + where + treeFind N = tv s + treeFind (B a t left right) | s < a = treeFind left + | s > a = treeFind right + | s == a = t + +resWords = b "def" 39 (b "=>" 20 (b "++" 10 (b "(" 5 (b "$" 3 (b "#" 2 (b "!" 1 N N) N) (b "%" 4 N N)) (b "**" 8 (b "*" 7 (b ")" 6 N N) N) (b "+" 9 N N))) (b "/" 15 (b "->" 13 (b "-" 12 (b "," 11 N N) N) (b "." 14 N N)) (b "<" 18 (b ";" 17 (b ":" 16 N N) N) (b "=" 19 N N)))) (b "[" 30 (b "PType" 25 (b "@" 23 (b "?" 22 (b ">" 21 N N) N) (b "Lin" 24 N N)) (b "Tok" 28 (b "Strs" 27 (b "Str" 26 N N) N) (b "Type" 29 N N))) (b "case" 35 (b "_" 33 (b "]" 32 (b "\\" 31 N N) N) (b "abstract" 34 N N)) (b "concrete" 37 (b "cat" 36 N N) (b "data" 38 N N))))) (b "package" 58 (b "let" 49 (b "in" 44 (b "fun" 42 (b "fn" 41 (b "flags" 40 N N) N) (b "grammar" 43 N N)) (b "instance" 47 (b "incomplete" 46 (b "include" 45 N N) N) (b "interface" 48 N N))) (b "of" 54 (b "lindef" 52 (b "lincat" 51 (b "lin" 50 N N) N) (b "lintype" 53 N N)) (b "oper" 56 (b "open" 55 N N) (b "out" 57 N N)))) (b "transfer" 68 (b "resource" 63 (b "pre" 61 (b "pattern" 60 (b "param" 59 N N) N) (b "printname" 62 N N)) (b "table" 66 (b "strs" 65 (b "reuse" 64 N N) N) (b "tokenizer" 67 N N))) (b "with" 73 (b "variants" 71 (b "var" 70 (b "union" 69 N N) N) (b "where" 72 N N)) (b "|" 75 (b "{" 74 N N) (b "}" 76 N N))))) + where b s n = let bs = BS.pack s + in B bs (TS bs n) + +unescapeInitTail :: BS.ByteString -> BS.ByteString +unescapeInitTail = BS.pack . unesc . tail . BS.unpack where + unesc s = case s of + '\\':c:cs | elem c ['\"', '\\', '\''] -> c : unesc cs + '\\':'n':cs -> '\n' : unesc cs + '\\':'t':cs -> '\t' : unesc cs + '"':[] -> [] + c:cs -> c : unesc cs + _ -> [] + +------------------------------------------------------------------- +-- Alex wrapper code. +-- A modified "posn" wrapper. +------------------------------------------------------------------- + +data Posn = Pn !Int !Int !Int + deriving (Eq, Show,Ord) + +alexStartPos :: Posn +alexStartPos = Pn 0 1 1 + +alexMove :: Posn -> Char -> Posn +alexMove (Pn a l c) '\t' = Pn (a+1) l (((c+7) `div` 8)*8+1) +alexMove (Pn a l c) '\n' = Pn (a+1) (l+1) 1 +alexMove (Pn a l c) _ = Pn (a+1) l (c+1) + +type AlexInput = (Posn, -- current position, + Char, -- previous char + BS.ByteString) -- current input string + +tokens :: BS.ByteString -> [Token] +tokens str = go (alexStartPos, '\n', str) + where + go :: AlexInput -> [Token] + go inp@(pos, _, str) = + case alexScan inp 0 of + AlexEOF -> [] + AlexError (pos, _, _) -> [Err pos] + AlexSkip inp' len -> go inp' + AlexToken inp' len act -> act pos (BS.take len str) : (go inp') + +alexGetChar :: AlexInput -> Maybe (Char,AlexInput) +alexGetChar (p, _, s) = + case BS.uncons s of + Nothing -> Nothing + Just (c,s) -> + let p' = alexMove p c + in p' `seq` Just (c, (p', c, s)) + +alexInputPrevChar :: AlexInput -> Char +alexInputPrevChar (p, c, s) = c +} diff --git a/src-3.0/GF/Source/ParGF.hs b/src-3.0/GF/Source/ParGF.hs index 30f83eef6..863e6c7e9 100644 --- a/src-3.0/GF/Source/ParGF.hs +++ b/src-3.0/GF/Source/ParGF.hs @@ -1,10 +1,10 @@ {-# OPTIONS -fglasgow-exts -cpp #-} {-# OPTIONS -fno-warn-incomplete-patterns -fno-warn-overlapping-patterns #-} - module GF.Source.ParGF (pGrammar, pModDef, pOldGrammar, pExp, pModHeader, myLexer) where --H -import GF.Source.AbsGF --H -import GF.Source.LexGF --H -import GF.Infra.Ident --H -import GF.Data.ErrM --H +module GF.Source.ParGF where +import GF.Source.AbsGF +import GF.Source.LexGF +import GF.Data.ErrM +import qualified Data.ByteString.Char8 as BS #if __GLASGOW_HASKELL__ >= 503 import GHC.Exts #else @@ -925,460 +925,460 @@ action_0 (13#) = happyGoto action_58 action_0 (14#) = happyGoto action_59 action_0 x = happyTcHack x happyReduce_11 -action_1 (139#) = happyShift action_57 -action_1 (142#) = happyShift action_9 +action_1 (136#) = happyShift action_57 +action_1 (139#) = happyShift action_51 action_1 (15#) = happyGoto action_55 action_1 (30#) = happyGoto action_56 action_1 x = happyTcHack x happyReduce_60 -action_2 (141#) = happyShift action_54 +action_2 (138#) = happyShift action_54 action_2 (90#) = happyGoto action_52 action_2 (91#) = happyGoto action_53 action_2 x = happyTcHack x happyReduce_265 -action_3 (96#) = happyShift action_24 -action_3 (98#) = happyShift action_25 -action_3 (104#) = happyShift action_26 -action_3 (109#) = happyShift action_27 -action_3 (110#) = happyShift action_28 -action_3 (111#) = happyShift action_29 -action_3 (114#) = happyShift action_30 -action_3 (119#) = happyShift action_31 -action_3 (124#) = happyShift action_32 -action_3 (125#) = happyShift action_33 -action_3 (126#) = happyShift action_34 -action_3 (127#) = happyShift action_35 -action_3 (128#) = happyShift action_36 -action_3 (129#) = happyShift action_37 -action_3 (131#) = happyShift action_38 -action_3 (134#) = happyShift action_39 -action_3 (137#) = happyShift action_40 -action_3 (140#) = happyShift action_41 -action_3 (145#) = happyShift action_42 -action_3 (156#) = happyShift action_43 -action_3 (157#) = happyShift action_44 -action_3 (161#) = happyShift action_45 -action_3 (162#) = happyShift action_46 -action_3 (167#) = happyShift action_47 -action_3 (170#) = happyShift action_6 -action_3 (171#) = happyShift action_48 -action_3 (172#) = happyShift action_49 -action_3 (173#) = happyShift action_50 -action_3 (174#) = happyShift action_51 -action_3 (8#) = happyGoto action_10 -action_3 (9#) = happyGoto action_11 -action_3 (10#) = happyGoto action_12 -action_3 (11#) = happyGoto action_13 -action_3 (12#) = happyGoto action_14 -action_3 (58#) = happyGoto action_15 -action_3 (59#) = happyGoto action_16 -action_3 (60#) = happyGoto action_17 -action_3 (61#) = happyGoto action_18 -action_3 (62#) = happyGoto action_19 -action_3 (63#) = happyGoto action_20 -action_3 (64#) = happyGoto action_21 -action_3 (72#) = happyGoto action_22 -action_3 (77#) = happyGoto action_23 -action_3 x = happyTcHack x happyFail +action_3 (139#) = happyShift action_51 +action_3 (21#) = happyGoto action_49 +action_3 (30#) = happyGoto action_50 +action_3 x = happyTcHack x happyReduce_60 -action_4 (142#) = happyShift action_9 -action_4 (21#) = happyGoto action_7 -action_4 (30#) = happyGoto action_8 -action_4 x = happyTcHack x happyReduce_60 +action_4 (95#) = happyShift action_21 +action_4 (97#) = happyShift action_22 +action_4 (98#) = happyShift action_23 +action_4 (111#) = happyShift action_24 +action_4 (115#) = happyShift action_25 +action_4 (117#) = happyShift action_26 +action_4 (118#) = happyShift action_27 +action_4 (119#) = happyShift action_28 +action_4 (120#) = happyShift action_29 +action_4 (121#) = happyShift action_30 +action_4 (122#) = happyShift action_31 +action_4 (123#) = happyShift action_32 +action_4 (124#) = happyShift action_33 +action_4 (128#) = happyShift action_34 +action_4 (131#) = happyShift action_35 +action_4 (134#) = happyShift action_36 +action_4 (137#) = happyShift action_37 +action_4 (142#) = happyShift action_38 +action_4 (153#) = happyShift action_39 +action_4 (154#) = happyShift action_40 +action_4 (158#) = happyShift action_41 +action_4 (159#) = happyShift action_42 +action_4 (164#) = happyShift action_43 +action_4 (167#) = happyShift action_44 +action_4 (170#) = happyShift action_6 +action_4 (171#) = happyShift action_45 +action_4 (172#) = happyShift action_46 +action_4 (173#) = happyShift action_47 +action_4 (174#) = happyShift action_48 +action_4 (8#) = happyGoto action_7 +action_4 (9#) = happyGoto action_8 +action_4 (10#) = happyGoto action_9 +action_4 (11#) = happyGoto action_10 +action_4 (12#) = happyGoto action_11 +action_4 (58#) = happyGoto action_12 +action_4 (59#) = happyGoto action_13 +action_4 (60#) = happyGoto action_14 +action_4 (61#) = happyGoto action_15 +action_4 (62#) = happyGoto action_16 +action_4 (63#) = happyGoto action_17 +action_4 (64#) = happyGoto action_18 +action_4 (72#) = happyGoto action_19 +action_4 (77#) = happyGoto action_20 +action_4 x = happyTcHack x happyFail action_5 (170#) = happyShift action_6 action_5 x = happyTcHack x happyFail action_6 x = happyTcHack x happyReduce_5 -action_7 (1#) = happyAccept -action_7 x = happyTcHack x happyFail +action_7 x = happyTcHack x happyReduce_145 -action_8 (130#) = happyShift action_63 -action_8 (133#) = happyShift action_64 -action_8 (143#) = happyShift action_65 -action_8 (144#) = happyShift action_66 -action_8 (159#) = happyShift action_67 -action_8 (164#) = happyShift action_68 -action_8 (23#) = happyGoto action_137 -action_8 x = happyTcHack x happyFail +action_8 x = happyTcHack x happyReduce_144 -action_9 x = happyTcHack x happyReduce_61 +action_9 x = happyTcHack x happyReduce_146 -action_10 x = happyTcHack x happyReduce_145 +action_10 x = happyTcHack x happyReduce_157 -action_11 x = happyTcHack x happyReduce_144 +action_11 (116#) = happyShift action_137 +action_11 x = happyTcHack x happyReduce_140 -action_12 x = happyTcHack x happyReduce_146 +action_12 x = happyTcHack x happyReduce_161 -action_13 x = happyTcHack x happyReduce_157 +action_13 (107#) = happyShift action_136 +action_13 x = happyTcHack x happyReduce_173 -action_14 (113#) = happyShift action_136 -action_14 x = happyTcHack x happyReduce_140 +action_14 (97#) = happyShift action_22 +action_14 (98#) = happyShift action_87 +action_14 (106#) = happyReduce_240 +action_14 (111#) = happyShift action_24 +action_14 (115#) = happyShift action_25 +action_14 (118#) = happyShift action_27 +action_14 (119#) = happyShift action_28 +action_14 (120#) = happyShift action_29 +action_14 (121#) = happyShift action_30 +action_14 (122#) = happyShift action_31 +action_14 (123#) = happyShift action_32 +action_14 (131#) = happyShift action_35 +action_14 (167#) = happyShift action_44 +action_14 (170#) = happyShift action_6 +action_14 (171#) = happyShift action_45 +action_14 (172#) = happyShift action_46 +action_14 (173#) = happyShift action_47 +action_14 (174#) = happyShift action_48 +action_14 (8#) = happyGoto action_7 +action_14 (9#) = happyGoto action_8 +action_14 (10#) = happyGoto action_9 +action_14 (11#) = happyGoto action_10 +action_14 (12#) = happyGoto action_84 +action_14 (58#) = happyGoto action_12 +action_14 (59#) = happyGoto action_135 +action_14 (72#) = happyGoto action_19 +action_14 x = happyTcHack x happyReduce_178 -action_15 x = happyTcHack x happyReduce_161 +action_15 (94#) = happyShift action_130 +action_15 (100#) = happyShift action_131 +action_15 (101#) = happyShift action_132 +action_15 (113#) = happyShift action_133 +action_15 (165#) = happyShift action_134 +action_15 x = happyTcHack x happyReduce_192 -action_16 (107#) = happyShift action_135 -action_16 x = happyTcHack x happyReduce_173 +action_16 (103#) = happyShift action_129 +action_16 x = happyTcHack x happyReduce_191 -action_17 (96#) = happyShift action_24 -action_17 (98#) = happyShift action_82 -action_17 (101#) = happyReduce_240 -action_17 (104#) = happyShift action_26 -action_17 (109#) = happyShift action_27 -action_17 (110#) = happyShift action_28 -action_17 (111#) = happyShift action_29 -action_17 (125#) = happyShift action_33 -action_17 (126#) = happyShift action_34 -action_17 (127#) = happyShift action_35 -action_17 (128#) = happyShift action_36 -action_17 (129#) = happyShift action_37 -action_17 (134#) = happyShift action_39 -action_17 (170#) = happyShift action_6 -action_17 (171#) = happyShift action_48 -action_17 (172#) = happyShift action_49 -action_17 (173#) = happyShift action_50 -action_17 (174#) = happyShift action_51 -action_17 (8#) = happyGoto action_10 -action_17 (9#) = happyGoto action_11 -action_17 (10#) = happyGoto action_12 -action_17 (11#) = happyGoto action_13 -action_17 (12#) = happyGoto action_79 -action_17 (58#) = happyGoto action_15 -action_17 (59#) = happyGoto action_134 -action_17 (72#) = happyGoto action_22 -action_17 x = happyTcHack x happyReduce_178 +action_17 (176#) = happyAccept +action_17 x = happyTcHack x happyFail -action_18 (102#) = happyShift action_129 -action_18 (115#) = happyShift action_130 -action_18 (116#) = happyShift action_131 -action_18 (120#) = happyShift action_132 -action_18 (168#) = happyShift action_133 -action_18 x = happyTcHack x happyReduce_192 +action_18 (102#) = happyShift action_128 +action_18 x = happyTcHack x happyReduce_180 -action_19 (118#) = happyShift action_128 -action_19 x = happyTcHack x happyReduce_191 +action_19 x = happyTcHack x happyReduce_143 -action_20 (176#) = happyAccept +action_20 (106#) = happyShift action_127 action_20 x = happyTcHack x happyFail -action_21 (117#) = happyShift action_127 -action_21 x = happyTcHack x happyReduce_180 +action_21 (95#) = happyShift action_120 +action_21 (98#) = happyShift action_121 +action_21 (111#) = happyShift action_122 +action_21 (115#) = happyShift action_123 +action_21 (123#) = happyShift action_124 +action_21 (126#) = happyShift action_125 +action_21 (167#) = happyShift action_126 +action_21 (170#) = happyShift action_6 +action_21 (171#) = happyShift action_45 +action_21 (172#) = happyShift action_46 +action_21 (174#) = happyShift action_48 +action_21 (8#) = happyGoto action_115 +action_21 (9#) = happyGoto action_116 +action_21 (10#) = happyGoto action_117 +action_21 (12#) = happyGoto action_118 +action_21 (67#) = happyGoto action_119 +action_21 x = happyTcHack x happyFail -action_22 x = happyTcHack x happyReduce_143 +action_22 (174#) = happyShift action_48 +action_22 (12#) = happyGoto action_114 +action_22 x = happyTcHack x happyFail -action_23 (101#) = happyShift action_126 -action_23 x = happyTcHack x happyFail +action_23 (95#) = happyShift action_21 +action_23 (97#) = happyShift action_22 +action_23 (98#) = happyShift action_23 +action_23 (111#) = happyShift action_24 +action_23 (115#) = happyShift action_25 +action_23 (117#) = happyShift action_26 +action_23 (118#) = happyShift action_27 +action_23 (119#) = happyShift action_28 +action_23 (120#) = happyShift action_29 +action_23 (121#) = happyShift action_30 +action_23 (122#) = happyShift action_31 +action_23 (123#) = happyShift action_32 +action_23 (124#) = happyShift action_33 +action_23 (126#) = happyShift action_102 +action_23 (128#) = happyShift action_34 +action_23 (131#) = happyShift action_35 +action_23 (134#) = happyShift action_36 +action_23 (137#) = happyShift action_113 +action_23 (142#) = happyShift action_38 +action_23 (153#) = happyShift action_39 +action_23 (154#) = happyShift action_40 +action_23 (158#) = happyShift action_41 +action_23 (159#) = happyShift action_42 +action_23 (164#) = happyShift action_43 +action_23 (167#) = happyShift action_44 +action_23 (170#) = happyShift action_6 +action_23 (171#) = happyShift action_45 +action_23 (172#) = happyShift action_46 +action_23 (173#) = happyShift action_47 +action_23 (174#) = happyShift action_48 +action_23 (8#) = happyGoto action_7 +action_23 (9#) = happyGoto action_8 +action_23 (10#) = happyGoto action_9 +action_23 (11#) = happyGoto action_10 +action_23 (12#) = happyGoto action_110 +action_23 (58#) = happyGoto action_12 +action_23 (59#) = happyGoto action_13 +action_23 (60#) = happyGoto action_14 +action_23 (61#) = happyGoto action_15 +action_23 (62#) = happyGoto action_16 +action_23 (63#) = happyGoto action_111 +action_23 (64#) = happyGoto action_18 +action_23 (72#) = happyGoto action_19 +action_23 (75#) = happyGoto action_99 +action_23 (76#) = happyGoto action_112 +action_23 (77#) = happyGoto action_20 +action_23 x = happyTcHack x happyReduce_236 -action_24 (174#) = happyShift action_51 -action_24 (12#) = happyGoto action_124 -action_24 (53#) = happyGoto action_88 -action_24 (56#) = happyGoto action_89 -action_24 (57#) = happyGoto action_125 -action_24 x = happyTcHack x happyReduce_137 +action_24 (95#) = happyShift action_21 +action_24 (97#) = happyShift action_22 +action_24 (98#) = happyShift action_23 +action_24 (111#) = happyShift action_24 +action_24 (115#) = happyShift action_25 +action_24 (117#) = happyShift action_26 +action_24 (118#) = happyShift action_27 +action_24 (119#) = happyShift action_28 +action_24 (120#) = happyShift action_29 +action_24 (121#) = happyShift action_30 +action_24 (122#) = happyShift action_31 +action_24 (123#) = happyShift action_32 +action_24 (124#) = happyShift action_33 +action_24 (128#) = happyShift action_34 +action_24 (131#) = happyShift action_35 +action_24 (134#) = happyShift action_36 +action_24 (137#) = happyShift action_37 +action_24 (142#) = happyShift action_38 +action_24 (153#) = happyShift action_39 +action_24 (154#) = happyShift action_40 +action_24 (158#) = happyShift action_41 +action_24 (159#) = happyShift action_42 +action_24 (164#) = happyShift action_43 +action_24 (167#) = happyShift action_44 +action_24 (170#) = happyShift action_6 +action_24 (171#) = happyShift action_45 +action_24 (172#) = happyShift action_46 +action_24 (173#) = happyShift action_47 +action_24 (174#) = happyShift action_48 +action_24 (8#) = happyGoto action_7 +action_24 (9#) = happyGoto action_8 +action_24 (10#) = happyGoto action_9 +action_24 (11#) = happyGoto action_10 +action_24 (12#) = happyGoto action_11 +action_24 (58#) = happyGoto action_12 +action_24 (59#) = happyGoto action_13 +action_24 (60#) = happyGoto action_14 +action_24 (61#) = happyGoto action_15 +action_24 (62#) = happyGoto action_16 +action_24 (63#) = happyGoto action_107 +action_24 (64#) = happyGoto action_18 +action_24 (72#) = happyGoto action_19 +action_24 (77#) = happyGoto action_20 +action_24 (78#) = happyGoto action_108 +action_24 (80#) = happyGoto action_109 +action_24 x = happyTcHack x happyReduce_243 -action_25 (96#) = happyShift action_24 -action_25 (98#) = happyShift action_25 -action_25 (104#) = happyShift action_26 -action_25 (109#) = happyShift action_27 -action_25 (110#) = happyShift action_28 -action_25 (111#) = happyShift action_29 -action_25 (114#) = happyShift action_30 -action_25 (119#) = happyShift action_31 -action_25 (121#) = happyShift action_100 -action_25 (124#) = happyShift action_32 -action_25 (125#) = happyShift action_33 -action_25 (126#) = happyShift action_34 -action_25 (127#) = happyShift action_35 -action_25 (128#) = happyShift action_36 -action_25 (129#) = happyShift action_37 -action_25 (131#) = happyShift action_38 -action_25 (134#) = happyShift action_39 -action_25 (137#) = happyShift action_40 -action_25 (140#) = happyShift action_123 -action_25 (145#) = happyShift action_42 -action_25 (156#) = happyShift action_43 -action_25 (157#) = happyShift action_44 -action_25 (161#) = happyShift action_45 -action_25 (162#) = happyShift action_46 -action_25 (167#) = happyShift action_47 -action_25 (170#) = happyShift action_6 -action_25 (171#) = happyShift action_48 -action_25 (172#) = happyShift action_49 -action_25 (173#) = happyShift action_50 -action_25 (174#) = happyShift action_51 -action_25 (8#) = happyGoto action_10 -action_25 (9#) = happyGoto action_11 -action_25 (10#) = happyGoto action_12 -action_25 (11#) = happyGoto action_13 -action_25 (12#) = happyGoto action_120 -action_25 (58#) = happyGoto action_15 -action_25 (59#) = happyGoto action_16 -action_25 (60#) = happyGoto action_17 -action_25 (61#) = happyGoto action_18 -action_25 (62#) = happyGoto action_19 -action_25 (63#) = happyGoto action_121 -action_25 (64#) = happyGoto action_21 -action_25 (72#) = happyGoto action_22 -action_25 (75#) = happyGoto action_97 -action_25 (76#) = happyGoto action_122 -action_25 (77#) = happyGoto action_23 -action_25 x = happyTcHack x happyReduce_236 +action_25 x = happyTcHack x happyReduce_147 -action_26 (105#) = happyShift action_119 -action_26 (171#) = happyShift action_48 -action_26 (174#) = happyShift action_51 -action_26 (9#) = happyGoto action_117 -action_26 (12#) = happyGoto action_118 +action_26 (174#) = happyShift action_48 +action_26 (12#) = happyGoto action_106 action_26 x = happyTcHack x happyFail -action_27 (174#) = happyShift action_51 -action_27 (12#) = happyGoto action_116 -action_27 x = happyTcHack x happyFail +action_27 x = happyTcHack x happyReduce_225 -action_28 x = happyTcHack x happyReduce_147 +action_28 x = happyTcHack x happyReduce_227 -action_29 (96#) = happyShift action_24 -action_29 (98#) = happyShift action_25 -action_29 (104#) = happyShift action_26 -action_29 (109#) = happyShift action_27 -action_29 (110#) = happyShift action_28 -action_29 (111#) = happyShift action_29 -action_29 (114#) = happyShift action_30 -action_29 (119#) = happyShift action_31 -action_29 (124#) = happyShift action_32 -action_29 (125#) = happyShift action_33 -action_29 (126#) = happyShift action_34 -action_29 (127#) = happyShift action_35 -action_29 (128#) = happyShift action_36 -action_29 (129#) = happyShift action_37 -action_29 (131#) = happyShift action_38 -action_29 (134#) = happyShift action_39 -action_29 (137#) = happyShift action_40 -action_29 (140#) = happyShift action_41 -action_29 (145#) = happyShift action_42 -action_29 (156#) = happyShift action_43 -action_29 (157#) = happyShift action_44 -action_29 (161#) = happyShift action_45 -action_29 (162#) = happyShift action_46 -action_29 (167#) = happyShift action_47 -action_29 (170#) = happyShift action_6 -action_29 (171#) = happyShift action_48 -action_29 (172#) = happyShift action_49 -action_29 (173#) = happyShift action_50 -action_29 (174#) = happyShift action_51 -action_29 (8#) = happyGoto action_10 -action_29 (9#) = happyGoto action_11 -action_29 (10#) = happyGoto action_12 -action_29 (11#) = happyGoto action_13 -action_29 (12#) = happyGoto action_14 -action_29 (58#) = happyGoto action_15 -action_29 (59#) = happyGoto action_16 -action_29 (60#) = happyGoto action_17 -action_29 (61#) = happyGoto action_18 -action_29 (62#) = happyGoto action_19 -action_29 (63#) = happyGoto action_113 -action_29 (64#) = happyGoto action_21 -action_29 (72#) = happyGoto action_22 -action_29 (77#) = happyGoto action_23 -action_29 (78#) = happyGoto action_114 -action_29 (80#) = happyGoto action_115 -action_29 x = happyTcHack x happyReduce_243 +action_29 x = happyTcHack x happyReduce_228 -action_30 (96#) = happyShift action_106 -action_30 (98#) = happyShift action_107 -action_30 (104#) = happyShift action_108 -action_30 (110#) = happyShift action_109 -action_30 (111#) = happyShift action_110 -action_30 (114#) = happyShift action_111 -action_30 (121#) = happyShift action_112 -action_30 (170#) = happyShift action_6 -action_30 (171#) = happyShift action_48 -action_30 (172#) = happyShift action_49 -action_30 (174#) = happyShift action_51 -action_30 (8#) = happyGoto action_101 -action_30 (9#) = happyGoto action_102 -action_30 (10#) = happyGoto action_103 -action_30 (12#) = happyGoto action_104 -action_30 (67#) = happyGoto action_105 -action_30 x = happyTcHack x happyFail +action_30 x = happyTcHack x happyReduce_226 -action_31 (119#) = happyShift action_99 -action_31 (121#) = happyShift action_100 -action_31 (174#) = happyShift action_51 -action_31 (12#) = happyGoto action_96 -action_31 (75#) = happyGoto action_97 -action_31 (76#) = happyGoto action_98 -action_31 x = happyTcHack x happyReduce_236 +action_31 x = happyTcHack x happyReduce_224 -action_32 (174#) = happyShift action_51 -action_32 (12#) = happyGoto action_95 +action_32 (125#) = happyShift action_105 +action_32 (171#) = happyShift action_45 +action_32 (174#) = happyShift action_48 +action_32 (9#) = happyGoto action_103 +action_32 (12#) = happyGoto action_104 action_32 x = happyTcHack x happyFail -action_33 x = happyTcHack x happyReduce_225 +action_33 (124#) = happyShift action_101 +action_33 (126#) = happyShift action_102 +action_33 (174#) = happyShift action_48 +action_33 (12#) = happyGoto action_98 +action_33 (75#) = happyGoto action_99 +action_33 (76#) = happyGoto action_100 +action_33 x = happyTcHack x happyReduce_236 -action_34 x = happyTcHack x happyReduce_227 +action_34 (95#) = happyShift action_21 +action_34 (97#) = happyShift action_22 +action_34 (98#) = happyShift action_23 +action_34 (111#) = happyShift action_24 +action_34 (115#) = happyShift action_25 +action_34 (117#) = happyShift action_26 +action_34 (118#) = happyShift action_27 +action_34 (119#) = happyShift action_28 +action_34 (120#) = happyShift action_29 +action_34 (121#) = happyShift action_30 +action_34 (122#) = happyShift action_31 +action_34 (123#) = happyShift action_32 +action_34 (124#) = happyShift action_33 +action_34 (128#) = happyShift action_34 +action_34 (131#) = happyShift action_35 +action_34 (134#) = happyShift action_36 +action_34 (137#) = happyShift action_37 +action_34 (142#) = happyShift action_38 +action_34 (153#) = happyShift action_39 +action_34 (154#) = happyShift action_40 +action_34 (158#) = happyShift action_41 +action_34 (159#) = happyShift action_42 +action_34 (164#) = happyShift action_43 +action_34 (167#) = happyShift action_44 +action_34 (170#) = happyShift action_6 +action_34 (171#) = happyShift action_45 +action_34 (172#) = happyShift action_46 +action_34 (173#) = happyShift action_47 +action_34 (174#) = happyShift action_48 +action_34 (8#) = happyGoto action_7 +action_34 (9#) = happyGoto action_8 +action_34 (10#) = happyGoto action_9 +action_34 (11#) = happyGoto action_10 +action_34 (12#) = happyGoto action_11 +action_34 (58#) = happyGoto action_12 +action_34 (59#) = happyGoto action_13 +action_34 (60#) = happyGoto action_14 +action_34 (61#) = happyGoto action_15 +action_34 (62#) = happyGoto action_16 +action_34 (63#) = happyGoto action_97 +action_34 (64#) = happyGoto action_18 +action_34 (72#) = happyGoto action_19 +action_34 (77#) = happyGoto action_20 +action_34 x = happyTcHack x happyFail -action_35 x = happyTcHack x happyReduce_228 +action_35 x = happyTcHack x happyReduce_149 -action_36 x = happyTcHack x happyReduce_226 +action_36 (167#) = happyShift action_96 +action_36 x = happyTcHack x happyFail -action_37 x = happyTcHack x happyReduce_224 +action_37 (97#) = happyShift action_22 +action_37 (98#) = happyShift action_87 +action_37 (111#) = happyShift action_24 +action_37 (115#) = happyShift action_25 +action_37 (118#) = happyShift action_27 +action_37 (119#) = happyShift action_28 +action_37 (120#) = happyShift action_29 +action_37 (121#) = happyShift action_30 +action_37 (122#) = happyShift action_31 +action_37 (123#) = happyShift action_32 +action_37 (131#) = happyShift action_35 +action_37 (167#) = happyShift action_44 +action_37 (170#) = happyShift action_6 +action_37 (171#) = happyShift action_45 +action_37 (172#) = happyShift action_46 +action_37 (173#) = happyShift action_47 +action_37 (174#) = happyShift action_48 +action_37 (8#) = happyGoto action_7 +action_37 (9#) = happyGoto action_8 +action_37 (10#) = happyGoto action_9 +action_37 (11#) = happyGoto action_10 +action_37 (12#) = happyGoto action_84 +action_37 (58#) = happyGoto action_12 +action_37 (59#) = happyGoto action_95 +action_37 (72#) = happyGoto action_19 +action_37 x = happyTcHack x happyFail -action_38 (96#) = happyShift action_24 -action_38 (98#) = happyShift action_25 -action_38 (104#) = happyShift action_26 -action_38 (109#) = happyShift action_27 -action_38 (110#) = happyShift action_28 -action_38 (111#) = happyShift action_29 -action_38 (114#) = happyShift action_30 -action_38 (119#) = happyShift action_31 -action_38 (124#) = happyShift action_32 -action_38 (125#) = happyShift action_33 -action_38 (126#) = happyShift action_34 -action_38 (127#) = happyShift action_35 -action_38 (128#) = happyShift action_36 -action_38 (129#) = happyShift action_37 -action_38 (131#) = happyShift action_38 -action_38 (134#) = happyShift action_39 -action_38 (137#) = happyShift action_40 -action_38 (140#) = happyShift action_41 -action_38 (145#) = happyShift action_42 -action_38 (156#) = happyShift action_43 -action_38 (157#) = happyShift action_44 -action_38 (161#) = happyShift action_45 -action_38 (162#) = happyShift action_46 -action_38 (167#) = happyShift action_47 -action_38 (170#) = happyShift action_6 -action_38 (171#) = happyShift action_48 -action_38 (172#) = happyShift action_49 -action_38 (173#) = happyShift action_50 -action_38 (174#) = happyShift action_51 -action_38 (8#) = happyGoto action_10 -action_38 (9#) = happyGoto action_11 -action_38 (10#) = happyGoto action_12 -action_38 (11#) = happyGoto action_13 -action_38 (12#) = happyGoto action_14 -action_38 (58#) = happyGoto action_15 -action_38 (59#) = happyGoto action_16 -action_38 (60#) = happyGoto action_17 -action_38 (61#) = happyGoto action_18 -action_38 (62#) = happyGoto action_19 -action_38 (63#) = happyGoto action_94 -action_38 (64#) = happyGoto action_21 -action_38 (72#) = happyGoto action_22 -action_38 (77#) = happyGoto action_23 -action_38 x = happyTcHack x happyFail +action_38 (167#) = happyShift action_94 +action_38 (174#) = happyShift action_48 +action_38 (12#) = happyGoto action_92 +action_38 (53#) = happyGoto action_80 +action_38 (56#) = happyGoto action_81 +action_38 (57#) = happyGoto action_93 +action_38 x = happyTcHack x happyReduce_137 -action_39 x = happyTcHack x happyReduce_149 +action_39 (97#) = happyShift action_22 +action_39 (98#) = happyShift action_87 +action_39 (111#) = happyShift action_24 +action_39 (115#) = happyShift action_25 +action_39 (118#) = happyShift action_27 +action_39 (119#) = happyShift action_28 +action_39 (120#) = happyShift action_29 +action_39 (121#) = happyShift action_30 +action_39 (122#) = happyShift action_31 +action_39 (123#) = happyShift action_32 +action_39 (131#) = happyShift action_35 +action_39 (167#) = happyShift action_44 +action_39 (170#) = happyShift action_6 +action_39 (171#) = happyShift action_45 +action_39 (172#) = happyShift action_46 +action_39 (173#) = happyShift action_47 +action_39 (174#) = happyShift action_48 +action_39 (8#) = happyGoto action_7 +action_39 (9#) = happyGoto action_8 +action_39 (10#) = happyGoto action_9 +action_39 (11#) = happyGoto action_10 +action_39 (12#) = happyGoto action_84 +action_39 (58#) = happyGoto action_12 +action_39 (59#) = happyGoto action_91 +action_39 (72#) = happyGoto action_19 +action_39 x = happyTcHack x happyFail -action_40 (96#) = happyShift action_93 +action_40 (167#) = happyShift action_90 action_40 x = happyTcHack x happyFail -action_41 (96#) = happyShift action_24 -action_41 (98#) = happyShift action_82 -action_41 (104#) = happyShift action_26 -action_41 (109#) = happyShift action_27 -action_41 (110#) = happyShift action_28 -action_41 (111#) = happyShift action_29 -action_41 (125#) = happyShift action_33 -action_41 (126#) = happyShift action_34 -action_41 (127#) = happyShift action_35 -action_41 (128#) = happyShift action_36 -action_41 (129#) = happyShift action_37 -action_41 (134#) = happyShift action_39 -action_41 (170#) = happyShift action_6 -action_41 (171#) = happyShift action_48 -action_41 (172#) = happyShift action_49 -action_41 (173#) = happyShift action_50 -action_41 (174#) = happyShift action_51 -action_41 (8#) = happyGoto action_10 -action_41 (9#) = happyGoto action_11 -action_41 (10#) = happyGoto action_12 -action_41 (11#) = happyGoto action_13 -action_41 (12#) = happyGoto action_79 -action_41 (58#) = happyGoto action_15 -action_41 (59#) = happyGoto action_92 -action_41 (72#) = happyGoto action_22 +action_41 (167#) = happyShift action_89 action_41 x = happyTcHack x happyFail -action_42 (96#) = happyShift action_91 -action_42 (174#) = happyShift action_51 -action_42 (12#) = happyGoto action_87 -action_42 (53#) = happyGoto action_88 -action_42 (56#) = happyGoto action_89 -action_42 (57#) = happyGoto action_90 -action_42 x = happyTcHack x happyReduce_137 +action_42 (97#) = happyShift action_86 +action_42 (98#) = happyShift action_87 +action_42 (111#) = happyShift action_24 +action_42 (115#) = happyShift action_25 +action_42 (118#) = happyShift action_27 +action_42 (119#) = happyShift action_28 +action_42 (120#) = happyShift action_29 +action_42 (121#) = happyShift action_30 +action_42 (122#) = happyShift action_31 +action_42 (123#) = happyShift action_32 +action_42 (131#) = happyShift action_35 +action_42 (167#) = happyShift action_88 +action_42 (170#) = happyShift action_6 +action_42 (171#) = happyShift action_45 +action_42 (172#) = happyShift action_46 +action_42 (173#) = happyShift action_47 +action_42 (174#) = happyShift action_48 +action_42 (8#) = happyGoto action_7 +action_42 (9#) = happyGoto action_8 +action_42 (10#) = happyGoto action_9 +action_42 (11#) = happyGoto action_10 +action_42 (12#) = happyGoto action_84 +action_42 (58#) = happyGoto action_85 +action_42 (72#) = happyGoto action_19 +action_42 x = happyTcHack x happyFail -action_43 (96#) = happyShift action_24 -action_43 (98#) = happyShift action_82 -action_43 (104#) = happyShift action_26 -action_43 (109#) = happyShift action_27 -action_43 (110#) = happyShift action_28 -action_43 (111#) = happyShift action_29 -action_43 (125#) = happyShift action_33 -action_43 (126#) = happyShift action_34 -action_43 (127#) = happyShift action_35 -action_43 (128#) = happyShift action_36 -action_43 (129#) = happyShift action_37 -action_43 (134#) = happyShift action_39 -action_43 (170#) = happyShift action_6 -action_43 (171#) = happyShift action_48 -action_43 (172#) = happyShift action_49 -action_43 (173#) = happyShift action_50 -action_43 (174#) = happyShift action_51 -action_43 (8#) = happyGoto action_10 -action_43 (9#) = happyGoto action_11 -action_43 (10#) = happyGoto action_12 -action_43 (11#) = happyGoto action_13 -action_43 (12#) = happyGoto action_79 -action_43 (58#) = happyGoto action_15 -action_43 (59#) = happyGoto action_86 -action_43 (72#) = happyGoto action_22 +action_43 (167#) = happyShift action_83 action_43 x = happyTcHack x happyFail -action_44 (96#) = happyShift action_85 -action_44 x = happyTcHack x happyFail +action_44 (174#) = happyShift action_48 +action_44 (12#) = happyGoto action_79 +action_44 (53#) = happyGoto action_80 +action_44 (56#) = happyGoto action_81 +action_44 (57#) = happyGoto action_82 +action_44 x = happyTcHack x happyReduce_137 -action_45 (96#) = happyShift action_84 -action_45 x = happyTcHack x happyFail +action_45 x = happyTcHack x happyReduce_6 -action_46 (96#) = happyShift action_81 -action_46 (98#) = happyShift action_82 -action_46 (104#) = happyShift action_26 -action_46 (109#) = happyShift action_83 -action_46 (110#) = happyShift action_28 -action_46 (111#) = happyShift action_29 -action_46 (125#) = happyShift action_33 -action_46 (126#) = happyShift action_34 -action_46 (127#) = happyShift action_35 -action_46 (128#) = happyShift action_36 -action_46 (129#) = happyShift action_37 -action_46 (134#) = happyShift action_39 -action_46 (170#) = happyShift action_6 -action_46 (171#) = happyShift action_48 -action_46 (172#) = happyShift action_49 -action_46 (173#) = happyShift action_50 -action_46 (174#) = happyShift action_51 -action_46 (8#) = happyGoto action_10 -action_46 (9#) = happyGoto action_11 -action_46 (10#) = happyGoto action_12 -action_46 (11#) = happyGoto action_13 -action_46 (12#) = happyGoto action_79 -action_46 (58#) = happyGoto action_80 -action_46 (72#) = happyGoto action_22 -action_46 x = happyTcHack x happyFail +action_46 x = happyTcHack x happyReduce_7 -action_47 (96#) = happyShift action_78 -action_47 x = happyTcHack x happyFail +action_47 x = happyTcHack x happyReduce_8 -action_48 x = happyTcHack x happyReduce_6 +action_48 x = happyTcHack x happyReduce_9 -action_49 x = happyTcHack x happyReduce_7 +action_49 (1#) = happyAccept +action_49 x = happyTcHack x happyFail -action_50 x = happyTcHack x happyReduce_8 +action_50 (127#) = happyShift action_63 +action_50 (130#) = happyShift action_64 +action_50 (140#) = happyShift action_65 +action_50 (141#) = happyShift action_66 +action_50 (156#) = happyShift action_67 +action_50 (161#) = happyShift action_68 +action_50 (23#) = happyGoto action_78 +action_50 x = happyTcHack x happyFail -action_51 x = happyTcHack x happyReduce_9 +action_51 x = happyTcHack x happyReduce_61 action_52 (176#) = happyAccept action_52 x = happyTcHack x happyFail @@ -1386,74 +1386,74 @@ action_52 x = happyTcHack x happyFail action_53 (25#) = happyGoto action_77 action_53 x = happyTcHack x happyReduce_48 -action_54 (106#) = happyShift action_74 +action_54 (105#) = happyShift action_74 action_54 (107#) = happyShift action_75 -action_54 (123#) = happyShift action_76 -action_54 (171#) = happyShift action_48 -action_54 (174#) = happyShift action_51 +action_54 (108#) = happyShift action_76 +action_54 (171#) = happyShift action_45 +action_54 (174#) = happyShift action_48 action_54 (9#) = happyGoto action_70 action_54 (12#) = happyGoto action_71 action_54 (92#) = happyGoto action_72 action_54 (93#) = happyGoto action_73 action_54 x = happyTcHack x happyFail -action_55 (94#) = happyShift action_69 +action_55 (110#) = happyShift action_69 action_55 (176#) = happyAccept action_55 x = happyTcHack x happyFail -action_56 (130#) = happyShift action_63 -action_56 (133#) = happyShift action_64 -action_56 (143#) = happyShift action_65 -action_56 (144#) = happyShift action_66 -action_56 (159#) = happyShift action_67 -action_56 (164#) = happyShift action_68 +action_56 (127#) = happyShift action_63 +action_56 (130#) = happyShift action_64 +action_56 (140#) = happyShift action_65 +action_56 (141#) = happyShift action_66 +action_56 (156#) = happyShift action_67 +action_56 (161#) = happyShift action_68 action_56 (23#) = happyGoto action_62 action_56 x = happyTcHack x happyFail -action_57 (174#) = happyShift action_51 +action_57 (174#) = happyShift action_48 action_57 (12#) = happyGoto action_61 action_57 x = happyTcHack x happyFail action_58 (176#) = happyAccept action_58 x = happyTcHack x happyFail -action_59 (139#) = happyShift action_57 -action_59 (142#) = happyShift action_9 +action_59 (136#) = happyShift action_57 +action_59 (139#) = happyShift action_51 action_59 (176#) = happyReduce_10 action_59 (15#) = happyGoto action_60 action_59 (30#) = happyGoto action_56 action_59 x = happyTcHack x happyReduce_60 -action_60 (94#) = happyShift action_69 +action_60 (110#) = happyShift action_69 action_60 x = happyTcHack x happyReduce_12 -action_61 (95#) = happyShift action_239 +action_61 (112#) = happyShift action_239 action_61 x = happyTcHack x happyFail -action_62 (95#) = happyShift action_238 +action_62 (112#) = happyShift action_238 action_62 x = happyTcHack x happyFail -action_63 (174#) = happyShift action_51 +action_63 (174#) = happyShift action_48 action_63 (12#) = happyGoto action_237 action_63 x = happyTcHack x happyFail -action_64 (174#) = happyShift action_51 +action_64 (174#) = happyShift action_48 action_64 (12#) = happyGoto action_236 action_64 x = happyTcHack x happyFail -action_65 (174#) = happyShift action_51 +action_65 (174#) = happyShift action_48 action_65 (12#) = happyGoto action_235 action_65 x = happyTcHack x happyFail -action_66 (174#) = happyShift action_51 +action_66 (174#) = happyShift action_48 action_66 (12#) = happyGoto action_234 action_66 x = happyTcHack x happyFail -action_67 (174#) = happyShift action_51 +action_67 (174#) = happyShift action_48 action_67 (12#) = happyGoto action_233 action_67 x = happyTcHack x happyFail -action_68 (174#) = happyShift action_51 +action_68 (174#) = happyShift action_48 action_68 (12#) = happyGoto action_232 action_68 x = happyTcHack x happyFail @@ -1461,1648 +1461,1646 @@ action_69 x = happyTcHack x happyReduce_13 action_70 x = happyTcHack x happyReduce_267 -action_71 (106#) = happyShift action_74 +action_71 (105#) = happyShift action_74 action_71 (107#) = happyShift action_75 -action_71 (123#) = happyShift action_76 -action_71 (171#) = happyShift action_48 -action_71 (174#) = happyShift action_51 +action_71 (108#) = happyShift action_76 +action_71 (171#) = happyShift action_45 +action_71 (174#) = happyShift action_48 action_71 (9#) = happyGoto action_70 action_71 (12#) = happyGoto action_71 action_71 (92#) = happyGoto action_231 action_71 x = happyTcHack x happyReduce_268 -action_72 (94#) = happyShift action_230 +action_72 (110#) = happyShift action_230 action_72 x = happyTcHack x happyFail action_73 x = happyTcHack x happyReduce_266 -action_74 (106#) = happyShift action_74 +action_74 (105#) = happyShift action_74 action_74 (107#) = happyShift action_75 -action_74 (123#) = happyShift action_76 -action_74 (171#) = happyShift action_48 -action_74 (174#) = happyShift action_51 +action_74 (108#) = happyShift action_76 +action_74 (171#) = happyShift action_45 +action_74 (174#) = happyShift action_48 action_74 (9#) = happyGoto action_70 action_74 (12#) = happyGoto action_71 action_74 (92#) = happyGoto action_229 action_74 x = happyTcHack x happyFail -action_75 (106#) = happyShift action_74 +action_75 (105#) = happyShift action_74 action_75 (107#) = happyShift action_75 -action_75 (123#) = happyShift action_76 -action_75 (171#) = happyShift action_48 -action_75 (174#) = happyShift action_51 +action_75 (108#) = happyShift action_76 +action_75 (171#) = happyShift action_45 +action_75 (174#) = happyShift action_48 action_75 (9#) = happyGoto action_70 action_75 (12#) = happyGoto action_71 action_75 (92#) = happyGoto action_228 action_75 x = happyTcHack x happyFail -action_76 (106#) = happyShift action_74 +action_76 (105#) = happyShift action_74 action_76 (107#) = happyShift action_75 -action_76 (123#) = happyShift action_76 -action_76 (171#) = happyShift action_48 -action_76 (174#) = happyShift action_51 +action_76 (108#) = happyShift action_76 +action_76 (171#) = happyShift action_45 +action_76 (174#) = happyShift action_48 action_76 (9#) = happyGoto action_70 action_76 (12#) = happyGoto action_71 action_76 (92#) = happyGoto action_227 action_76 x = happyTcHack x happyFail -action_77 (132#) = happyShift action_210 -action_77 (134#) = happyShift action_211 -action_77 (135#) = happyShift action_212 -action_77 (136#) = happyShift action_213 -action_77 (138#) = happyShift action_214 -action_77 (146#) = happyShift action_215 -action_77 (147#) = happyShift action_216 -action_77 (148#) = happyShift action_217 -action_77 (149#) = happyShift action_218 -action_77 (152#) = happyShift action_219 -action_77 (154#) = happyShift action_220 -action_77 (155#) = happyShift action_221 -action_77 (156#) = happyShift action_222 -action_77 (158#) = happyShift action_223 -action_77 (163#) = happyShift action_224 -action_77 (164#) = happyShift action_225 -action_77 (166#) = happyShift action_226 +action_77 (129#) = happyShift action_210 +action_77 (131#) = happyShift action_211 +action_77 (132#) = happyShift action_212 +action_77 (133#) = happyShift action_213 +action_77 (135#) = happyShift action_214 +action_77 (143#) = happyShift action_215 +action_77 (144#) = happyShift action_216 +action_77 (145#) = happyShift action_217 +action_77 (146#) = happyShift action_218 +action_77 (149#) = happyShift action_219 +action_77 (151#) = happyShift action_220 +action_77 (152#) = happyShift action_221 +action_77 (153#) = happyShift action_222 +action_77 (155#) = happyShift action_223 +action_77 (160#) = happyShift action_224 +action_77 (161#) = happyShift action_225 +action_77 (163#) = happyShift action_226 action_77 (35#) = happyGoto action_209 action_77 x = happyTcHack x happyReduce_264 -action_78 (96#) = happyShift action_24 -action_78 (98#) = happyShift action_25 -action_78 (104#) = happyShift action_26 -action_78 (109#) = happyShift action_27 -action_78 (110#) = happyShift action_28 -action_78 (111#) = happyShift action_29 -action_78 (114#) = happyShift action_30 -action_78 (119#) = happyShift action_31 -action_78 (124#) = happyShift action_32 -action_78 (125#) = happyShift action_33 -action_78 (126#) = happyShift action_34 -action_78 (127#) = happyShift action_35 -action_78 (128#) = happyShift action_36 -action_78 (129#) = happyShift action_37 -action_78 (131#) = happyShift action_38 -action_78 (134#) = happyShift action_39 -action_78 (137#) = happyShift action_40 -action_78 (140#) = happyShift action_41 -action_78 (145#) = happyShift action_42 -action_78 (156#) = happyShift action_43 -action_78 (157#) = happyShift action_44 -action_78 (161#) = happyShift action_45 -action_78 (162#) = happyShift action_46 -action_78 (167#) = happyShift action_47 -action_78 (170#) = happyShift action_6 -action_78 (171#) = happyShift action_48 -action_78 (172#) = happyShift action_49 -action_78 (173#) = happyShift action_50 -action_78 (174#) = happyShift action_51 -action_78 (8#) = happyGoto action_10 -action_78 (9#) = happyGoto action_11 -action_78 (10#) = happyGoto action_12 -action_78 (11#) = happyGoto action_13 -action_78 (12#) = happyGoto action_14 -action_78 (58#) = happyGoto action_15 -action_78 (59#) = happyGoto action_16 -action_78 (60#) = happyGoto action_17 -action_78 (61#) = happyGoto action_18 -action_78 (62#) = happyGoto action_19 -action_78 (63#) = happyGoto action_199 -action_78 (64#) = happyGoto action_21 -action_78 (65#) = happyGoto action_208 -action_78 (72#) = happyGoto action_22 -action_78 (77#) = happyGoto action_23 -action_78 x = happyTcHack x happyReduce_193 +action_78 (112#) = happyShift action_208 +action_78 x = happyTcHack x happyFail -action_79 x = happyTcHack x happyReduce_140 +action_79 (104#) = happyShift action_190 +action_79 (107#) = happyShift action_206 +action_79 (169#) = happyShift action_207 +action_79 x = happyTcHack x happyReduce_128 -action_80 (96#) = happyShift action_206 -action_80 (104#) = happyShift action_207 +action_80 (109#) = happyShift action_204 +action_80 (112#) = happyShift action_205 action_80 x = happyTcHack x happyFail -action_81 (96#) = happyShift action_106 -action_81 (98#) = happyShift action_107 -action_81 (104#) = happyShift action_108 -action_81 (106#) = happyShift action_176 -action_81 (110#) = happyShift action_109 -action_81 (111#) = happyShift action_110 -action_81 (114#) = happyShift action_111 -action_81 (121#) = happyShift action_112 -action_81 (170#) = happyShift action_6 -action_81 (171#) = happyShift action_48 -action_81 (172#) = happyShift action_49 -action_81 (174#) = happyShift action_51 -action_81 (8#) = happyGoto action_101 -action_81 (9#) = happyGoto action_102 -action_81 (10#) = happyGoto action_103 -action_81 (12#) = happyGoto action_202 -action_81 (53#) = happyGoto action_88 -action_81 (56#) = happyGoto action_89 -action_81 (57#) = happyGoto action_125 -action_81 (67#) = happyGoto action_171 -action_81 (68#) = happyGoto action_172 -action_81 (69#) = happyGoto action_203 -action_81 (82#) = happyGoto action_204 -action_81 (83#) = happyGoto action_205 -action_81 x = happyTcHack x happyReduce_137 +action_81 (110#) = happyShift action_203 +action_81 x = happyTcHack x happyReduce_138 -action_82 (96#) = happyShift action_24 -action_82 (98#) = happyShift action_25 -action_82 (104#) = happyShift action_26 -action_82 (109#) = happyShift action_27 -action_82 (110#) = happyShift action_28 -action_82 (111#) = happyShift action_29 -action_82 (114#) = happyShift action_30 -action_82 (119#) = happyShift action_31 -action_82 (124#) = happyShift action_32 -action_82 (125#) = happyShift action_33 -action_82 (126#) = happyShift action_34 -action_82 (127#) = happyShift action_35 -action_82 (128#) = happyShift action_36 -action_82 (129#) = happyShift action_37 -action_82 (131#) = happyShift action_38 -action_82 (134#) = happyShift action_39 -action_82 (137#) = happyShift action_40 -action_82 (140#) = happyShift action_123 -action_82 (145#) = happyShift action_42 -action_82 (156#) = happyShift action_43 -action_82 (157#) = happyShift action_44 -action_82 (161#) = happyShift action_45 -action_82 (162#) = happyShift action_46 -action_82 (167#) = happyShift action_47 -action_82 (170#) = happyShift action_6 -action_82 (171#) = happyShift action_48 -action_82 (172#) = happyShift action_49 -action_82 (173#) = happyShift action_50 -action_82 (174#) = happyShift action_51 -action_82 (8#) = happyGoto action_10 -action_82 (9#) = happyGoto action_11 -action_82 (10#) = happyGoto action_12 -action_82 (11#) = happyGoto action_13 -action_82 (12#) = happyGoto action_14 -action_82 (58#) = happyGoto action_15 -action_82 (59#) = happyGoto action_16 -action_82 (60#) = happyGoto action_17 -action_82 (61#) = happyGoto action_18 -action_82 (62#) = happyGoto action_19 -action_82 (63#) = happyGoto action_121 -action_82 (64#) = happyGoto action_21 -action_82 (72#) = happyGoto action_22 -action_82 (77#) = happyGoto action_23 +action_82 (169#) = happyShift action_202 action_82 x = happyTcHack x happyFail -action_83 (174#) = happyShift action_51 -action_83 (12#) = happyGoto action_201 -action_83 x = happyTcHack x happyFail +action_83 (95#) = happyShift action_21 +action_83 (97#) = happyShift action_22 +action_83 (98#) = happyShift action_23 +action_83 (111#) = happyShift action_24 +action_83 (115#) = happyShift action_25 +action_83 (117#) = happyShift action_26 +action_83 (118#) = happyShift action_27 +action_83 (119#) = happyShift action_28 +action_83 (120#) = happyShift action_29 +action_83 (121#) = happyShift action_30 +action_83 (122#) = happyShift action_31 +action_83 (123#) = happyShift action_32 +action_83 (124#) = happyShift action_33 +action_83 (128#) = happyShift action_34 +action_83 (131#) = happyShift action_35 +action_83 (134#) = happyShift action_36 +action_83 (137#) = happyShift action_37 +action_83 (142#) = happyShift action_38 +action_83 (153#) = happyShift action_39 +action_83 (154#) = happyShift action_40 +action_83 (158#) = happyShift action_41 +action_83 (159#) = happyShift action_42 +action_83 (164#) = happyShift action_43 +action_83 (167#) = happyShift action_44 +action_83 (170#) = happyShift action_6 +action_83 (171#) = happyShift action_45 +action_83 (172#) = happyShift action_46 +action_83 (173#) = happyShift action_47 +action_83 (174#) = happyShift action_48 +action_83 (8#) = happyGoto action_7 +action_83 (9#) = happyGoto action_8 +action_83 (10#) = happyGoto action_9 +action_83 (11#) = happyGoto action_10 +action_83 (12#) = happyGoto action_11 +action_83 (58#) = happyGoto action_12 +action_83 (59#) = happyGoto action_13 +action_83 (60#) = happyGoto action_14 +action_83 (61#) = happyGoto action_15 +action_83 (62#) = happyGoto action_16 +action_83 (63#) = happyGoto action_192 +action_83 (64#) = happyGoto action_18 +action_83 (65#) = happyGoto action_201 +action_83 (72#) = happyGoto action_19 +action_83 (77#) = happyGoto action_20 +action_83 x = happyTcHack x happyReduce_193 -action_84 (96#) = happyShift action_24 -action_84 (98#) = happyShift action_25 -action_84 (104#) = happyShift action_26 -action_84 (109#) = happyShift action_27 -action_84 (110#) = happyShift action_28 -action_84 (111#) = happyShift action_29 -action_84 (114#) = happyShift action_30 -action_84 (119#) = happyShift action_31 -action_84 (124#) = happyShift action_32 -action_84 (125#) = happyShift action_33 -action_84 (126#) = happyShift action_34 -action_84 (127#) = happyShift action_35 -action_84 (128#) = happyShift action_36 -action_84 (129#) = happyShift action_37 -action_84 (131#) = happyShift action_38 -action_84 (134#) = happyShift action_39 -action_84 (137#) = happyShift action_40 -action_84 (140#) = happyShift action_41 -action_84 (145#) = happyShift action_42 -action_84 (156#) = happyShift action_43 -action_84 (157#) = happyShift action_44 -action_84 (161#) = happyShift action_45 -action_84 (162#) = happyShift action_46 -action_84 (167#) = happyShift action_47 -action_84 (170#) = happyShift action_6 -action_84 (171#) = happyShift action_48 -action_84 (172#) = happyShift action_49 -action_84 (173#) = happyShift action_50 -action_84 (174#) = happyShift action_51 -action_84 (8#) = happyGoto action_10 -action_84 (9#) = happyGoto action_11 -action_84 (10#) = happyGoto action_12 -action_84 (11#) = happyGoto action_13 -action_84 (12#) = happyGoto action_14 -action_84 (58#) = happyGoto action_15 -action_84 (59#) = happyGoto action_16 -action_84 (60#) = happyGoto action_17 -action_84 (61#) = happyGoto action_18 -action_84 (62#) = happyGoto action_19 -action_84 (63#) = happyGoto action_199 -action_84 (64#) = happyGoto action_21 -action_84 (65#) = happyGoto action_200 -action_84 (72#) = happyGoto action_22 -action_84 (77#) = happyGoto action_23 -action_84 x = happyTcHack x happyReduce_193 +action_84 x = happyTcHack x happyReduce_140 -action_85 (96#) = happyShift action_24 -action_85 (98#) = happyShift action_25 -action_85 (104#) = happyShift action_26 -action_85 (109#) = happyShift action_27 -action_85 (110#) = happyShift action_28 -action_85 (111#) = happyShift action_29 -action_85 (114#) = happyShift action_30 -action_85 (119#) = happyShift action_31 -action_85 (124#) = happyShift action_32 -action_85 (125#) = happyShift action_33 -action_85 (126#) = happyShift action_34 -action_85 (127#) = happyShift action_35 -action_85 (128#) = happyShift action_36 -action_85 (129#) = happyShift action_37 -action_85 (131#) = happyShift action_38 -action_85 (134#) = happyShift action_39 -action_85 (137#) = happyShift action_40 -action_85 (140#) = happyShift action_41 -action_85 (145#) = happyShift action_42 -action_85 (156#) = happyShift action_43 -action_85 (157#) = happyShift action_44 -action_85 (161#) = happyShift action_45 -action_85 (162#) = happyShift action_46 -action_85 (167#) = happyShift action_47 -action_85 (170#) = happyShift action_6 -action_85 (171#) = happyShift action_48 -action_85 (172#) = happyShift action_49 -action_85 (173#) = happyShift action_50 -action_85 (174#) = happyShift action_51 -action_85 (8#) = happyGoto action_10 -action_85 (9#) = happyGoto action_11 -action_85 (10#) = happyGoto action_12 -action_85 (11#) = happyGoto action_13 -action_85 (12#) = happyGoto action_14 -action_85 (58#) = happyGoto action_15 -action_85 (59#) = happyGoto action_16 -action_85 (60#) = happyGoto action_17 -action_85 (61#) = happyGoto action_18 -action_85 (62#) = happyGoto action_19 -action_85 (63#) = happyGoto action_198 -action_85 (64#) = happyGoto action_21 -action_85 (72#) = happyGoto action_22 -action_85 (77#) = happyGoto action_23 +action_85 (123#) = happyShift action_199 +action_85 (167#) = happyShift action_200 action_85 x = happyTcHack x happyFail -action_86 (107#) = happyShift action_135 -action_86 x = happyTcHack x happyReduce_172 +action_86 (174#) = happyShift action_48 +action_86 (12#) = happyGoto action_198 +action_86 x = happyTcHack x happyFail -action_87 (103#) = happyShift action_156 -action_87 x = happyTcHack x happyReduce_128 +action_87 (95#) = happyShift action_21 +action_87 (97#) = happyShift action_22 +action_87 (98#) = happyShift action_23 +action_87 (111#) = happyShift action_24 +action_87 (115#) = happyShift action_25 +action_87 (117#) = happyShift action_26 +action_87 (118#) = happyShift action_27 +action_87 (119#) = happyShift action_28 +action_87 (120#) = happyShift action_29 +action_87 (121#) = happyShift action_30 +action_87 (122#) = happyShift action_31 +action_87 (123#) = happyShift action_32 +action_87 (124#) = happyShift action_33 +action_87 (128#) = happyShift action_34 +action_87 (131#) = happyShift action_35 +action_87 (134#) = happyShift action_36 +action_87 (137#) = happyShift action_113 +action_87 (142#) = happyShift action_38 +action_87 (153#) = happyShift action_39 +action_87 (154#) = happyShift action_40 +action_87 (158#) = happyShift action_41 +action_87 (159#) = happyShift action_42 +action_87 (164#) = happyShift action_43 +action_87 (167#) = happyShift action_44 +action_87 (170#) = happyShift action_6 +action_87 (171#) = happyShift action_45 +action_87 (172#) = happyShift action_46 +action_87 (173#) = happyShift action_47 +action_87 (174#) = happyShift action_48 +action_87 (8#) = happyGoto action_7 +action_87 (9#) = happyGoto action_8 +action_87 (10#) = happyGoto action_9 +action_87 (11#) = happyGoto action_10 +action_87 (12#) = happyGoto action_11 +action_87 (58#) = happyGoto action_12 +action_87 (59#) = happyGoto action_13 +action_87 (60#) = happyGoto action_14 +action_87 (61#) = happyGoto action_15 +action_87 (62#) = happyGoto action_16 +action_87 (63#) = happyGoto action_111 +action_87 (64#) = happyGoto action_18 +action_87 (72#) = happyGoto action_19 +action_87 (77#) = happyGoto action_20 +action_87 x = happyTcHack x happyFail -action_88 (95#) = happyShift action_196 -action_88 (100#) = happyShift action_197 -action_88 x = happyTcHack x happyFail +action_88 (95#) = happyShift action_120 +action_88 (98#) = happyShift action_121 +action_88 (105#) = happyShift action_164 +action_88 (111#) = happyShift action_122 +action_88 (115#) = happyShift action_123 +action_88 (123#) = happyShift action_124 +action_88 (126#) = happyShift action_125 +action_88 (167#) = happyShift action_126 +action_88 (170#) = happyShift action_6 +action_88 (171#) = happyShift action_45 +action_88 (172#) = happyShift action_46 +action_88 (174#) = happyShift action_48 +action_88 (8#) = happyGoto action_115 +action_88 (9#) = happyGoto action_116 +action_88 (10#) = happyGoto action_117 +action_88 (12#) = happyGoto action_194 +action_88 (53#) = happyGoto action_80 +action_88 (56#) = happyGoto action_81 +action_88 (57#) = happyGoto action_82 +action_88 (67#) = happyGoto action_159 +action_88 (68#) = happyGoto action_160 +action_88 (69#) = happyGoto action_195 +action_88 (82#) = happyGoto action_196 +action_88 (83#) = happyGoto action_197 +action_88 x = happyTcHack x happyReduce_137 -action_89 (94#) = happyShift action_195 -action_89 x = happyTcHack x happyReduce_138 +action_89 (95#) = happyShift action_21 +action_89 (97#) = happyShift action_22 +action_89 (98#) = happyShift action_23 +action_89 (111#) = happyShift action_24 +action_89 (115#) = happyShift action_25 +action_89 (117#) = happyShift action_26 +action_89 (118#) = happyShift action_27 +action_89 (119#) = happyShift action_28 +action_89 (120#) = happyShift action_29 +action_89 (121#) = happyShift action_30 +action_89 (122#) = happyShift action_31 +action_89 (123#) = happyShift action_32 +action_89 (124#) = happyShift action_33 +action_89 (128#) = happyShift action_34 +action_89 (131#) = happyShift action_35 +action_89 (134#) = happyShift action_36 +action_89 (137#) = happyShift action_37 +action_89 (142#) = happyShift action_38 +action_89 (153#) = happyShift action_39 +action_89 (154#) = happyShift action_40 +action_89 (158#) = happyShift action_41 +action_89 (159#) = happyShift action_42 +action_89 (164#) = happyShift action_43 +action_89 (167#) = happyShift action_44 +action_89 (170#) = happyShift action_6 +action_89 (171#) = happyShift action_45 +action_89 (172#) = happyShift action_46 +action_89 (173#) = happyShift action_47 +action_89 (174#) = happyShift action_48 +action_89 (8#) = happyGoto action_7 +action_89 (9#) = happyGoto action_8 +action_89 (10#) = happyGoto action_9 +action_89 (11#) = happyGoto action_10 +action_89 (12#) = happyGoto action_11 +action_89 (58#) = happyGoto action_12 +action_89 (59#) = happyGoto action_13 +action_89 (60#) = happyGoto action_14 +action_89 (61#) = happyGoto action_15 +action_89 (62#) = happyGoto action_16 +action_89 (63#) = happyGoto action_192 +action_89 (64#) = happyGoto action_18 +action_89 (65#) = happyGoto action_193 +action_89 (72#) = happyGoto action_19 +action_89 (77#) = happyGoto action_20 +action_89 x = happyTcHack x happyReduce_193 -action_90 (140#) = happyShift action_194 +action_90 (95#) = happyShift action_21 +action_90 (97#) = happyShift action_22 +action_90 (98#) = happyShift action_23 +action_90 (111#) = happyShift action_24 +action_90 (115#) = happyShift action_25 +action_90 (117#) = happyShift action_26 +action_90 (118#) = happyShift action_27 +action_90 (119#) = happyShift action_28 +action_90 (120#) = happyShift action_29 +action_90 (121#) = happyShift action_30 +action_90 (122#) = happyShift action_31 +action_90 (123#) = happyShift action_32 +action_90 (124#) = happyShift action_33 +action_90 (128#) = happyShift action_34 +action_90 (131#) = happyShift action_35 +action_90 (134#) = happyShift action_36 +action_90 (137#) = happyShift action_37 +action_90 (142#) = happyShift action_38 +action_90 (153#) = happyShift action_39 +action_90 (154#) = happyShift action_40 +action_90 (158#) = happyShift action_41 +action_90 (159#) = happyShift action_42 +action_90 (164#) = happyShift action_43 +action_90 (167#) = happyShift action_44 +action_90 (170#) = happyShift action_6 +action_90 (171#) = happyShift action_45 +action_90 (172#) = happyShift action_46 +action_90 (173#) = happyShift action_47 +action_90 (174#) = happyShift action_48 +action_90 (8#) = happyGoto action_7 +action_90 (9#) = happyGoto action_8 +action_90 (10#) = happyGoto action_9 +action_90 (11#) = happyGoto action_10 +action_90 (12#) = happyGoto action_11 +action_90 (58#) = happyGoto action_12 +action_90 (59#) = happyGoto action_13 +action_90 (60#) = happyGoto action_14 +action_90 (61#) = happyGoto action_15 +action_90 (62#) = happyGoto action_16 +action_90 (63#) = happyGoto action_191 +action_90 (64#) = happyGoto action_18 +action_90 (72#) = happyGoto action_19 +action_90 (77#) = happyGoto action_20 action_90 x = happyTcHack x happyFail -action_91 (174#) = happyShift action_51 -action_91 (12#) = happyGoto action_87 -action_91 (53#) = happyGoto action_88 -action_91 (56#) = happyGoto action_89 -action_91 (57#) = happyGoto action_193 -action_91 x = happyTcHack x happyReduce_137 +action_91 (107#) = happyShift action_136 +action_91 x = happyTcHack x happyReduce_172 -action_92 (107#) = happyShift action_135 -action_92 (171#) = happyShift action_48 -action_92 (9#) = happyGoto action_192 -action_92 x = happyTcHack x happyFail +action_92 (104#) = happyShift action_190 +action_92 x = happyTcHack x happyReduce_128 -action_93 (96#) = happyShift action_106 -action_93 (98#) = happyShift action_107 -action_93 (104#) = happyShift action_108 -action_93 (110#) = happyShift action_109 -action_93 (111#) = happyShift action_110 -action_93 (114#) = happyShift action_111 -action_93 (121#) = happyShift action_112 -action_93 (170#) = happyShift action_6 -action_93 (171#) = happyShift action_48 -action_93 (172#) = happyShift action_49 -action_93 (174#) = happyShift action_51 -action_93 (8#) = happyGoto action_101 -action_93 (9#) = happyGoto action_102 -action_93 (10#) = happyGoto action_103 -action_93 (12#) = happyGoto action_104 -action_93 (67#) = happyGoto action_188 -action_93 (74#) = happyGoto action_189 -action_93 (84#) = happyGoto action_190 -action_93 (85#) = happyGoto action_191 -action_93 x = happyTcHack x happyReduce_253 +action_93 (137#) = happyShift action_189 +action_93 x = happyTcHack x happyFail -action_94 (150#) = happyShift action_187 -action_94 x = happyTcHack x happyFail +action_94 (174#) = happyShift action_48 +action_94 (12#) = happyGoto action_92 +action_94 (53#) = happyGoto action_80 +action_94 (56#) = happyGoto action_81 +action_94 (57#) = happyGoto action_188 +action_94 x = happyTcHack x happyReduce_137 -action_95 x = happyTcHack x happyReduce_174 +action_95 (107#) = happyShift action_136 +action_95 (171#) = happyShift action_45 +action_95 (9#) = happyGoto action_187 +action_95 x = happyTcHack x happyFail -action_96 x = happyTcHack x happyReduce_234 +action_96 (95#) = happyShift action_120 +action_96 (98#) = happyShift action_121 +action_96 (111#) = happyShift action_122 +action_96 (115#) = happyShift action_123 +action_96 (123#) = happyShift action_124 +action_96 (126#) = happyShift action_125 +action_96 (167#) = happyShift action_126 +action_96 (170#) = happyShift action_6 +action_96 (171#) = happyShift action_45 +action_96 (172#) = happyShift action_46 +action_96 (174#) = happyShift action_48 +action_96 (8#) = happyGoto action_115 +action_96 (9#) = happyGoto action_116 +action_96 (10#) = happyGoto action_117 +action_96 (12#) = happyGoto action_118 +action_96 (67#) = happyGoto action_183 +action_96 (74#) = happyGoto action_184 +action_96 (84#) = happyGoto action_185 +action_96 (85#) = happyGoto action_186 +action_96 x = happyTcHack x happyReduce_253 -action_97 (103#) = happyShift action_186 -action_97 x = happyTcHack x happyReduce_237 +action_97 (147#) = happyShift action_182 +action_97 x = happyTcHack x happyFail -action_98 (101#) = happyShift action_185 -action_98 x = happyTcHack x happyFail +action_98 x = happyTcHack x happyReduce_234 -action_99 (121#) = happyShift action_100 -action_99 (174#) = happyShift action_51 -action_99 (12#) = happyGoto action_96 -action_99 (75#) = happyGoto action_97 -action_99 (76#) = happyGoto action_184 -action_99 x = happyTcHack x happyReduce_236 +action_99 (104#) = happyShift action_181 +action_99 x = happyTcHack x happyReduce_237 -action_100 x = happyTcHack x happyReduce_235 +action_100 (106#) = happyShift action_180 +action_100 x = happyTcHack x happyFail -action_101 x = happyTcHack x happyReduce_206 +action_101 (126#) = happyShift action_102 +action_101 (174#) = happyShift action_48 +action_101 (12#) = happyGoto action_98 +action_101 (75#) = happyGoto action_99 +action_101 (76#) = happyGoto action_179 +action_101 x = happyTcHack x happyReduce_236 -action_102 x = happyTcHack x happyReduce_208 +action_102 x = happyTcHack x happyReduce_235 -action_103 x = happyTcHack x happyReduce_207 +action_103 (125#) = happyShift action_178 +action_103 x = happyTcHack x happyFail -action_104 (107#) = happyShift action_183 -action_104 x = happyTcHack x happyReduce_203 +action_104 (97#) = happyShift action_86 +action_104 (98#) = happyShift action_87 +action_104 (111#) = happyShift action_24 +action_104 (115#) = happyShift action_25 +action_104 (118#) = happyShift action_27 +action_104 (119#) = happyShift action_28 +action_104 (120#) = happyShift action_29 +action_104 (121#) = happyShift action_30 +action_104 (122#) = happyShift action_31 +action_104 (123#) = happyShift action_32 +action_104 (131#) = happyShift action_35 +action_104 (167#) = happyShift action_139 +action_104 (170#) = happyShift action_6 +action_104 (171#) = happyShift action_45 +action_104 (172#) = happyShift action_46 +action_104 (173#) = happyShift action_47 +action_104 (174#) = happyShift action_48 +action_104 (8#) = happyGoto action_7 +action_104 (9#) = happyGoto action_8 +action_104 (10#) = happyGoto action_9 +action_104 (11#) = happyGoto action_10 +action_104 (12#) = happyGoto action_84 +action_104 (58#) = happyGoto action_176 +action_104 (66#) = happyGoto action_177 +action_104 (72#) = happyGoto action_19 +action_104 x = happyTcHack x happyReduce_196 -action_105 x = happyTcHack x happyReduce_171 +action_105 x = happyTcHack x happyReduce_148 -action_106 (174#) = happyShift action_51 -action_106 (12#) = happyGoto action_179 -action_106 (53#) = happyGoto action_180 -action_106 (70#) = happyGoto action_181 -action_106 (73#) = happyGoto action_182 -action_106 x = happyTcHack x happyReduce_229 +action_106 x = happyTcHack x happyReduce_174 -action_107 (96#) = happyShift action_106 -action_107 (98#) = happyShift action_107 -action_107 (104#) = happyShift action_108 -action_107 (106#) = happyShift action_176 -action_107 (110#) = happyShift action_109 -action_107 (111#) = happyShift action_110 -action_107 (114#) = happyShift action_111 -action_107 (121#) = happyShift action_112 -action_107 (170#) = happyShift action_6 -action_107 (171#) = happyShift action_48 -action_107 (172#) = happyShift action_49 -action_107 (174#) = happyShift action_51 -action_107 (8#) = happyGoto action_101 -action_107 (9#) = happyGoto action_102 -action_107 (10#) = happyGoto action_103 -action_107 (12#) = happyGoto action_170 -action_107 (67#) = happyGoto action_171 -action_107 (68#) = happyGoto action_172 -action_107 (69#) = happyGoto action_178 -action_107 x = happyTcHack x happyFail +action_107 (109#) = happyShift action_175 +action_107 x = happyTcHack x happyReduce_241 -action_108 (171#) = happyShift action_48 -action_108 (9#) = happyGoto action_177 -action_108 x = happyTcHack x happyFail +action_108 (104#) = happyShift action_174 +action_108 x = happyTcHack x happyReduce_244 -action_109 x = happyTcHack x happyReduce_198 +action_109 (114#) = happyShift action_173 +action_109 x = happyTcHack x happyFail -action_110 (96#) = happyShift action_106 -action_110 (98#) = happyShift action_107 -action_110 (104#) = happyShift action_108 -action_110 (106#) = happyShift action_176 -action_110 (110#) = happyShift action_109 -action_110 (111#) = happyShift action_110 -action_110 (114#) = happyShift action_111 -action_110 (121#) = happyShift action_112 -action_110 (170#) = happyShift action_6 -action_110 (171#) = happyShift action_48 -action_110 (172#) = happyShift action_49 -action_110 (174#) = happyShift action_51 -action_110 (8#) = happyGoto action_101 -action_110 (9#) = happyGoto action_102 -action_110 (10#) = happyGoto action_103 -action_110 (12#) = happyGoto action_170 -action_110 (67#) = happyGoto action_171 -action_110 (68#) = happyGoto action_172 -action_110 (69#) = happyGoto action_173 -action_110 (79#) = happyGoto action_174 -action_110 (81#) = happyGoto action_175 -action_110 x = happyTcHack x happyReduce_246 +action_110 (104#) = happyReduce_234 +action_110 (109#) = happyReduce_234 +action_110 (116#) = happyShift action_137 +action_110 x = happyTcHack x happyReduce_140 -action_111 (174#) = happyShift action_51 -action_111 (12#) = happyGoto action_169 +action_111 (99#) = happyShift action_172 action_111 x = happyTcHack x happyFail -action_112 x = happyTcHack x happyReduce_202 +action_112 (109#) = happyShift action_171 +action_112 x = happyTcHack x happyFail -action_113 (100#) = happyShift action_168 -action_113 x = happyTcHack x happyReduce_241 +action_113 (97#) = happyShift action_22 +action_113 (98#) = happyShift action_87 +action_113 (111#) = happyShift action_24 +action_113 (115#) = happyShift action_25 +action_113 (118#) = happyShift action_27 +action_113 (119#) = happyShift action_28 +action_113 (120#) = happyShift action_29 +action_113 (121#) = happyShift action_30 +action_113 (122#) = happyShift action_31 +action_113 (123#) = happyShift action_32 +action_113 (131#) = happyShift action_35 +action_113 (167#) = happyShift action_44 +action_113 (170#) = happyShift action_6 +action_113 (171#) = happyShift action_45 +action_113 (172#) = happyShift action_46 +action_113 (173#) = happyShift action_47 +action_113 (174#) = happyShift action_48 +action_113 (8#) = happyGoto action_7 +action_113 (9#) = happyGoto action_8 +action_113 (10#) = happyGoto action_9 +action_113 (11#) = happyGoto action_10 +action_113 (12#) = happyGoto action_170 +action_113 (58#) = happyGoto action_12 +action_113 (59#) = happyGoto action_95 +action_113 (72#) = happyGoto action_19 +action_113 x = happyTcHack x happyFail -action_114 (103#) = happyShift action_167 -action_114 x = happyTcHack x happyReduce_244 +action_114 (97#) = happyShift action_168 +action_114 (107#) = happyShift action_169 +action_114 x = happyTcHack x happyFail -action_115 (112#) = happyShift action_166 -action_115 x = happyTcHack x happyFail +action_115 x = happyTcHack x happyReduce_206 -action_116 (107#) = happyShift action_164 -action_116 (109#) = happyShift action_165 -action_116 x = happyTcHack x happyFail +action_116 x = happyTcHack x happyReduce_208 -action_117 (105#) = happyShift action_163 -action_117 x = happyTcHack x happyFail +action_117 x = happyTcHack x happyReduce_207 -action_118 (96#) = happyShift action_140 -action_118 (98#) = happyShift action_82 -action_118 (104#) = happyShift action_26 -action_118 (109#) = happyShift action_83 -action_118 (110#) = happyShift action_28 -action_118 (111#) = happyShift action_29 -action_118 (125#) = happyShift action_33 -action_118 (126#) = happyShift action_34 -action_118 (127#) = happyShift action_35 -action_118 (128#) = happyShift action_36 -action_118 (129#) = happyShift action_37 -action_118 (134#) = happyShift action_39 -action_118 (170#) = happyShift action_6 -action_118 (171#) = happyShift action_48 -action_118 (172#) = happyShift action_49 -action_118 (173#) = happyShift action_50 -action_118 (174#) = happyShift action_51 -action_118 (8#) = happyGoto action_10 -action_118 (9#) = happyGoto action_11 -action_118 (10#) = happyGoto action_12 -action_118 (11#) = happyGoto action_13 -action_118 (12#) = happyGoto action_79 -action_118 (58#) = happyGoto action_161 -action_118 (66#) = happyGoto action_162 -action_118 (72#) = happyGoto action_22 -action_118 x = happyTcHack x happyReduce_196 +action_118 (107#) = happyShift action_167 +action_118 x = happyTcHack x happyReduce_203 -action_119 x = happyTcHack x happyReduce_148 +action_119 x = happyTcHack x happyReduce_171 -action_120 (100#) = happyReduce_234 -action_120 (103#) = happyReduce_234 -action_120 (113#) = happyShift action_136 -action_120 x = happyTcHack x happyReduce_140 +action_120 (174#) = happyShift action_48 +action_120 (12#) = happyGoto action_166 +action_120 x = happyTcHack x happyFail -action_121 (99#) = happyShift action_160 +action_121 (95#) = happyShift action_120 +action_121 (98#) = happyShift action_121 +action_121 (105#) = happyShift action_164 +action_121 (111#) = happyShift action_122 +action_121 (115#) = happyShift action_123 +action_121 (123#) = happyShift action_124 +action_121 (126#) = happyShift action_125 +action_121 (167#) = happyShift action_126 +action_121 (170#) = happyShift action_6 +action_121 (171#) = happyShift action_45 +action_121 (172#) = happyShift action_46 +action_121 (174#) = happyShift action_48 +action_121 (8#) = happyGoto action_115 +action_121 (9#) = happyGoto action_116 +action_121 (10#) = happyGoto action_117 +action_121 (12#) = happyGoto action_158 +action_121 (67#) = happyGoto action_159 +action_121 (68#) = happyGoto action_160 +action_121 (69#) = happyGoto action_165 action_121 x = happyTcHack x happyFail -action_122 (100#) = happyShift action_159 -action_122 x = happyTcHack x happyFail +action_122 (95#) = happyShift action_120 +action_122 (98#) = happyShift action_121 +action_122 (105#) = happyShift action_164 +action_122 (111#) = happyShift action_122 +action_122 (115#) = happyShift action_123 +action_122 (123#) = happyShift action_124 +action_122 (126#) = happyShift action_125 +action_122 (167#) = happyShift action_126 +action_122 (170#) = happyShift action_6 +action_122 (171#) = happyShift action_45 +action_122 (172#) = happyShift action_46 +action_122 (174#) = happyShift action_48 +action_122 (8#) = happyGoto action_115 +action_122 (9#) = happyGoto action_116 +action_122 (10#) = happyGoto action_117 +action_122 (12#) = happyGoto action_158 +action_122 (67#) = happyGoto action_159 +action_122 (68#) = happyGoto action_160 +action_122 (69#) = happyGoto action_161 +action_122 (79#) = happyGoto action_162 +action_122 (81#) = happyGoto action_163 +action_122 x = happyTcHack x happyReduce_246 -action_123 (96#) = happyShift action_24 -action_123 (98#) = happyShift action_82 -action_123 (104#) = happyShift action_26 -action_123 (109#) = happyShift action_27 -action_123 (110#) = happyShift action_28 -action_123 (111#) = happyShift action_29 -action_123 (125#) = happyShift action_33 -action_123 (126#) = happyShift action_34 -action_123 (127#) = happyShift action_35 -action_123 (128#) = happyShift action_36 -action_123 (129#) = happyShift action_37 -action_123 (134#) = happyShift action_39 -action_123 (170#) = happyShift action_6 -action_123 (171#) = happyShift action_48 -action_123 (172#) = happyShift action_49 -action_123 (173#) = happyShift action_50 -action_123 (174#) = happyShift action_51 -action_123 (8#) = happyGoto action_10 -action_123 (9#) = happyGoto action_11 -action_123 (10#) = happyGoto action_12 -action_123 (11#) = happyGoto action_13 -action_123 (12#) = happyGoto action_158 -action_123 (58#) = happyGoto action_15 -action_123 (59#) = happyGoto action_92 -action_123 (72#) = happyGoto action_22 -action_123 x = happyTcHack x happyFail +action_123 x = happyTcHack x happyReduce_198 -action_124 (97#) = happyShift action_155 -action_124 (103#) = happyShift action_156 -action_124 (107#) = happyShift action_157 -action_124 x = happyTcHack x happyReduce_128 +action_124 (171#) = happyShift action_45 +action_124 (9#) = happyGoto action_157 +action_124 x = happyTcHack x happyFail -action_125 (97#) = happyShift action_154 -action_125 x = happyTcHack x happyFail +action_125 x = happyTcHack x happyReduce_202 -action_126 (96#) = happyShift action_24 -action_126 (98#) = happyShift action_25 -action_126 (104#) = happyShift action_26 -action_126 (109#) = happyShift action_27 -action_126 (110#) = happyShift action_28 -action_126 (111#) = happyShift action_29 -action_126 (114#) = happyShift action_30 -action_126 (119#) = happyShift action_31 -action_126 (124#) = happyShift action_32 -action_126 (125#) = happyShift action_33 -action_126 (126#) = happyShift action_34 -action_126 (127#) = happyShift action_35 -action_126 (128#) = happyShift action_36 -action_126 (129#) = happyShift action_37 -action_126 (131#) = happyShift action_38 -action_126 (134#) = happyShift action_39 -action_126 (137#) = happyShift action_40 -action_126 (140#) = happyShift action_41 -action_126 (145#) = happyShift action_42 -action_126 (156#) = happyShift action_43 -action_126 (157#) = happyShift action_44 -action_126 (161#) = happyShift action_45 -action_126 (162#) = happyShift action_46 -action_126 (167#) = happyShift action_47 -action_126 (170#) = happyShift action_6 -action_126 (171#) = happyShift action_48 -action_126 (172#) = happyShift action_49 -action_126 (173#) = happyShift action_50 -action_126 (174#) = happyShift action_51 -action_126 (8#) = happyGoto action_10 -action_126 (9#) = happyGoto action_11 -action_126 (10#) = happyGoto action_12 -action_126 (11#) = happyGoto action_13 -action_126 (12#) = happyGoto action_14 -action_126 (58#) = happyGoto action_15 -action_126 (59#) = happyGoto action_16 -action_126 (60#) = happyGoto action_17 -action_126 (61#) = happyGoto action_18 -action_126 (62#) = happyGoto action_19 -action_126 (63#) = happyGoto action_153 -action_126 (64#) = happyGoto action_21 -action_126 (72#) = happyGoto action_22 -action_126 (77#) = happyGoto action_23 -action_126 x = happyTcHack x happyFail +action_126 (174#) = happyShift action_48 +action_126 (12#) = happyGoto action_153 +action_126 (53#) = happyGoto action_154 +action_126 (70#) = happyGoto action_155 +action_126 (73#) = happyGoto action_156 +action_126 x = happyTcHack x happyReduce_229 -action_127 (96#) = happyShift action_24 -action_127 (98#) = happyShift action_82 -action_127 (104#) = happyShift action_26 -action_127 (109#) = happyShift action_27 -action_127 (110#) = happyShift action_28 -action_127 (111#) = happyShift action_29 -action_127 (114#) = happyShift action_30 -action_127 (124#) = happyShift action_32 -action_127 (125#) = happyShift action_33 -action_127 (126#) = happyShift action_34 -action_127 (127#) = happyShift action_35 -action_127 (128#) = happyShift action_36 -action_127 (129#) = happyShift action_37 -action_127 (131#) = happyShift action_38 -action_127 (134#) = happyShift action_39 -action_127 (156#) = happyShift action_43 -action_127 (157#) = happyShift action_44 -action_127 (161#) = happyShift action_45 -action_127 (162#) = happyShift action_46 -action_127 (167#) = happyShift action_47 +action_127 (95#) = happyShift action_21 +action_127 (97#) = happyShift action_22 +action_127 (98#) = happyShift action_23 +action_127 (111#) = happyShift action_24 +action_127 (115#) = happyShift action_25 +action_127 (117#) = happyShift action_26 +action_127 (118#) = happyShift action_27 +action_127 (119#) = happyShift action_28 +action_127 (120#) = happyShift action_29 +action_127 (121#) = happyShift action_30 +action_127 (122#) = happyShift action_31 +action_127 (123#) = happyShift action_32 +action_127 (124#) = happyShift action_33 +action_127 (128#) = happyShift action_34 +action_127 (131#) = happyShift action_35 +action_127 (134#) = happyShift action_36 +action_127 (137#) = happyShift action_37 +action_127 (142#) = happyShift action_38 +action_127 (153#) = happyShift action_39 +action_127 (154#) = happyShift action_40 +action_127 (158#) = happyShift action_41 +action_127 (159#) = happyShift action_42 +action_127 (164#) = happyShift action_43 +action_127 (167#) = happyShift action_44 action_127 (170#) = happyShift action_6 -action_127 (171#) = happyShift action_48 -action_127 (172#) = happyShift action_49 -action_127 (173#) = happyShift action_50 -action_127 (174#) = happyShift action_51 -action_127 (8#) = happyGoto action_10 -action_127 (9#) = happyGoto action_11 -action_127 (10#) = happyGoto action_12 -action_127 (11#) = happyGoto action_13 -action_127 (12#) = happyGoto action_14 -action_127 (58#) = happyGoto action_15 -action_127 (59#) = happyGoto action_16 -action_127 (60#) = happyGoto action_150 -action_127 (61#) = happyGoto action_151 -action_127 (62#) = happyGoto action_152 -action_127 (64#) = happyGoto action_21 -action_127 (72#) = happyGoto action_22 +action_127 (171#) = happyShift action_45 +action_127 (172#) = happyShift action_46 +action_127 (173#) = happyShift action_47 +action_127 (174#) = happyShift action_48 +action_127 (8#) = happyGoto action_7 +action_127 (9#) = happyGoto action_8 +action_127 (10#) = happyGoto action_9 +action_127 (11#) = happyGoto action_10 +action_127 (12#) = happyGoto action_11 +action_127 (58#) = happyGoto action_12 +action_127 (59#) = happyGoto action_13 +action_127 (60#) = happyGoto action_14 +action_127 (61#) = happyGoto action_15 +action_127 (62#) = happyGoto action_16 +action_127 (63#) = happyGoto action_152 +action_127 (64#) = happyGoto action_18 +action_127 (72#) = happyGoto action_19 +action_127 (77#) = happyGoto action_20 action_127 x = happyTcHack x happyFail -action_128 (96#) = happyShift action_24 -action_128 (98#) = happyShift action_25 -action_128 (104#) = happyShift action_26 -action_128 (109#) = happyShift action_27 -action_128 (110#) = happyShift action_28 -action_128 (111#) = happyShift action_29 -action_128 (114#) = happyShift action_30 -action_128 (119#) = happyShift action_31 -action_128 (124#) = happyShift action_32 -action_128 (125#) = happyShift action_33 -action_128 (126#) = happyShift action_34 -action_128 (127#) = happyShift action_35 -action_128 (128#) = happyShift action_36 -action_128 (129#) = happyShift action_37 -action_128 (131#) = happyShift action_38 -action_128 (134#) = happyShift action_39 -action_128 (137#) = happyShift action_40 -action_128 (140#) = happyShift action_41 -action_128 (145#) = happyShift action_42 -action_128 (156#) = happyShift action_43 -action_128 (157#) = happyShift action_44 -action_128 (161#) = happyShift action_45 -action_128 (162#) = happyShift action_46 -action_128 (167#) = happyShift action_47 +action_128 (95#) = happyShift action_21 +action_128 (97#) = happyShift action_22 +action_128 (98#) = happyShift action_87 +action_128 (111#) = happyShift action_24 +action_128 (115#) = happyShift action_25 +action_128 (117#) = happyShift action_26 +action_128 (118#) = happyShift action_27 +action_128 (119#) = happyShift action_28 +action_128 (120#) = happyShift action_29 +action_128 (121#) = happyShift action_30 +action_128 (122#) = happyShift action_31 +action_128 (123#) = happyShift action_32 +action_128 (128#) = happyShift action_34 +action_128 (131#) = happyShift action_35 +action_128 (153#) = happyShift action_39 +action_128 (154#) = happyShift action_40 +action_128 (158#) = happyShift action_41 +action_128 (159#) = happyShift action_42 +action_128 (164#) = happyShift action_43 +action_128 (167#) = happyShift action_44 action_128 (170#) = happyShift action_6 -action_128 (171#) = happyShift action_48 -action_128 (172#) = happyShift action_49 -action_128 (173#) = happyShift action_50 -action_128 (174#) = happyShift action_51 -action_128 (8#) = happyGoto action_10 -action_128 (9#) = happyGoto action_11 -action_128 (10#) = happyGoto action_12 -action_128 (11#) = happyGoto action_13 -action_128 (12#) = happyGoto action_14 -action_128 (58#) = happyGoto action_15 -action_128 (59#) = happyGoto action_16 -action_128 (60#) = happyGoto action_17 -action_128 (61#) = happyGoto action_18 -action_128 (62#) = happyGoto action_19 -action_128 (63#) = happyGoto action_149 -action_128 (64#) = happyGoto action_21 -action_128 (72#) = happyGoto action_22 -action_128 (77#) = happyGoto action_23 +action_128 (171#) = happyShift action_45 +action_128 (172#) = happyShift action_46 +action_128 (173#) = happyShift action_47 +action_128 (174#) = happyShift action_48 +action_128 (8#) = happyGoto action_7 +action_128 (9#) = happyGoto action_8 +action_128 (10#) = happyGoto action_9 +action_128 (11#) = happyGoto action_10 +action_128 (12#) = happyGoto action_11 +action_128 (58#) = happyGoto action_12 +action_128 (59#) = happyGoto action_13 +action_128 (60#) = happyGoto action_149 +action_128 (61#) = happyGoto action_150 +action_128 (62#) = happyGoto action_151 +action_128 (64#) = happyGoto action_18 +action_128 (72#) = happyGoto action_19 action_128 x = happyTcHack x happyFail -action_129 (96#) = happyShift action_24 -action_129 (98#) = happyShift action_82 -action_129 (104#) = happyShift action_26 -action_129 (109#) = happyShift action_27 -action_129 (110#) = happyShift action_28 -action_129 (111#) = happyShift action_29 -action_129 (114#) = happyShift action_30 -action_129 (124#) = happyShift action_32 -action_129 (125#) = happyShift action_33 -action_129 (126#) = happyShift action_34 -action_129 (127#) = happyShift action_35 -action_129 (128#) = happyShift action_36 -action_129 (129#) = happyShift action_37 -action_129 (131#) = happyShift action_38 -action_129 (134#) = happyShift action_39 -action_129 (156#) = happyShift action_43 -action_129 (157#) = happyShift action_44 -action_129 (161#) = happyShift action_45 -action_129 (162#) = happyShift action_46 -action_129 (167#) = happyShift action_47 +action_129 (95#) = happyShift action_21 +action_129 (97#) = happyShift action_22 +action_129 (98#) = happyShift action_23 +action_129 (111#) = happyShift action_24 +action_129 (115#) = happyShift action_25 +action_129 (117#) = happyShift action_26 +action_129 (118#) = happyShift action_27 +action_129 (119#) = happyShift action_28 +action_129 (120#) = happyShift action_29 +action_129 (121#) = happyShift action_30 +action_129 (122#) = happyShift action_31 +action_129 (123#) = happyShift action_32 +action_129 (124#) = happyShift action_33 +action_129 (128#) = happyShift action_34 +action_129 (131#) = happyShift action_35 +action_129 (134#) = happyShift action_36 +action_129 (137#) = happyShift action_37 +action_129 (142#) = happyShift action_38 +action_129 (153#) = happyShift action_39 +action_129 (154#) = happyShift action_40 +action_129 (158#) = happyShift action_41 +action_129 (159#) = happyShift action_42 +action_129 (164#) = happyShift action_43 +action_129 (167#) = happyShift action_44 action_129 (170#) = happyShift action_6 -action_129 (171#) = happyShift action_48 -action_129 (172#) = happyShift action_49 -action_129 (173#) = happyShift action_50 -action_129 (174#) = happyShift action_51 -action_129 (8#) = happyGoto action_10 -action_129 (9#) = happyGoto action_11 -action_129 (10#) = happyGoto action_12 -action_129 (11#) = happyGoto action_13 -action_129 (12#) = happyGoto action_14 -action_129 (58#) = happyGoto action_15 -action_129 (59#) = happyGoto action_16 -action_129 (60#) = happyGoto action_148 -action_129 (72#) = happyGoto action_22 +action_129 (171#) = happyShift action_45 +action_129 (172#) = happyShift action_46 +action_129 (173#) = happyShift action_47 +action_129 (174#) = happyShift action_48 +action_129 (8#) = happyGoto action_7 +action_129 (9#) = happyGoto action_8 +action_129 (10#) = happyGoto action_9 +action_129 (11#) = happyGoto action_10 +action_129 (12#) = happyGoto action_11 +action_129 (58#) = happyGoto action_12 +action_129 (59#) = happyGoto action_13 +action_129 (60#) = happyGoto action_14 +action_129 (61#) = happyGoto action_15 +action_129 (62#) = happyGoto action_16 +action_129 (63#) = happyGoto action_148 +action_129 (64#) = happyGoto action_18 +action_129 (72#) = happyGoto action_19 +action_129 (77#) = happyGoto action_20 action_129 x = happyTcHack x happyFail -action_130 (96#) = happyShift action_24 -action_130 (98#) = happyShift action_82 -action_130 (104#) = happyShift action_26 -action_130 (109#) = happyShift action_27 -action_130 (110#) = happyShift action_28 -action_130 (111#) = happyShift action_29 -action_130 (114#) = happyShift action_30 -action_130 (124#) = happyShift action_32 -action_130 (125#) = happyShift action_33 -action_130 (126#) = happyShift action_34 -action_130 (127#) = happyShift action_35 -action_130 (128#) = happyShift action_36 -action_130 (129#) = happyShift action_37 -action_130 (131#) = happyShift action_38 -action_130 (134#) = happyShift action_39 -action_130 (156#) = happyShift action_43 -action_130 (157#) = happyShift action_44 -action_130 (161#) = happyShift action_45 -action_130 (162#) = happyShift action_46 -action_130 (167#) = happyShift action_47 +action_130 (95#) = happyShift action_21 +action_130 (97#) = happyShift action_22 +action_130 (98#) = happyShift action_87 +action_130 (111#) = happyShift action_24 +action_130 (115#) = happyShift action_25 +action_130 (117#) = happyShift action_26 +action_130 (118#) = happyShift action_27 +action_130 (119#) = happyShift action_28 +action_130 (120#) = happyShift action_29 +action_130 (121#) = happyShift action_30 +action_130 (122#) = happyShift action_31 +action_130 (123#) = happyShift action_32 +action_130 (128#) = happyShift action_34 +action_130 (131#) = happyShift action_35 +action_130 (153#) = happyShift action_39 +action_130 (154#) = happyShift action_40 +action_130 (158#) = happyShift action_41 +action_130 (159#) = happyShift action_42 +action_130 (164#) = happyShift action_43 +action_130 (167#) = happyShift action_44 action_130 (170#) = happyShift action_6 -action_130 (171#) = happyShift action_48 -action_130 (172#) = happyShift action_49 -action_130 (173#) = happyShift action_50 -action_130 (174#) = happyShift action_51 -action_130 (8#) = happyGoto action_10 -action_130 (9#) = happyGoto action_11 -action_130 (10#) = happyGoto action_12 -action_130 (11#) = happyGoto action_13 -action_130 (12#) = happyGoto action_14 -action_130 (58#) = happyGoto action_15 -action_130 (59#) = happyGoto action_16 +action_130 (171#) = happyShift action_45 +action_130 (172#) = happyShift action_46 +action_130 (173#) = happyShift action_47 +action_130 (174#) = happyShift action_48 +action_130 (8#) = happyGoto action_7 +action_130 (9#) = happyGoto action_8 +action_130 (10#) = happyGoto action_9 +action_130 (11#) = happyGoto action_10 +action_130 (12#) = happyGoto action_11 +action_130 (58#) = happyGoto action_12 +action_130 (59#) = happyGoto action_13 action_130 (60#) = happyGoto action_147 -action_130 (72#) = happyGoto action_22 +action_130 (72#) = happyGoto action_19 action_130 x = happyTcHack x happyFail -action_131 (96#) = happyShift action_24 -action_131 (98#) = happyShift action_82 -action_131 (104#) = happyShift action_26 -action_131 (109#) = happyShift action_27 -action_131 (110#) = happyShift action_28 -action_131 (111#) = happyShift action_29 -action_131 (114#) = happyShift action_30 -action_131 (124#) = happyShift action_32 -action_131 (125#) = happyShift action_33 -action_131 (126#) = happyShift action_34 -action_131 (127#) = happyShift action_35 -action_131 (128#) = happyShift action_36 -action_131 (129#) = happyShift action_37 -action_131 (131#) = happyShift action_38 -action_131 (134#) = happyShift action_39 -action_131 (156#) = happyShift action_43 -action_131 (157#) = happyShift action_44 -action_131 (161#) = happyShift action_45 -action_131 (162#) = happyShift action_46 -action_131 (167#) = happyShift action_47 +action_131 (95#) = happyShift action_21 +action_131 (97#) = happyShift action_22 +action_131 (98#) = happyShift action_87 +action_131 (111#) = happyShift action_24 +action_131 (115#) = happyShift action_25 +action_131 (117#) = happyShift action_26 +action_131 (118#) = happyShift action_27 +action_131 (119#) = happyShift action_28 +action_131 (120#) = happyShift action_29 +action_131 (121#) = happyShift action_30 +action_131 (122#) = happyShift action_31 +action_131 (123#) = happyShift action_32 +action_131 (128#) = happyShift action_34 +action_131 (131#) = happyShift action_35 +action_131 (153#) = happyShift action_39 +action_131 (154#) = happyShift action_40 +action_131 (158#) = happyShift action_41 +action_131 (159#) = happyShift action_42 +action_131 (164#) = happyShift action_43 +action_131 (167#) = happyShift action_44 action_131 (170#) = happyShift action_6 -action_131 (171#) = happyShift action_48 -action_131 (172#) = happyShift action_49 -action_131 (173#) = happyShift action_50 -action_131 (174#) = happyShift action_51 -action_131 (8#) = happyGoto action_10 -action_131 (9#) = happyGoto action_11 -action_131 (10#) = happyGoto action_12 -action_131 (11#) = happyGoto action_13 -action_131 (12#) = happyGoto action_14 -action_131 (58#) = happyGoto action_15 -action_131 (59#) = happyGoto action_16 +action_131 (171#) = happyShift action_45 +action_131 (172#) = happyShift action_46 +action_131 (173#) = happyShift action_47 +action_131 (174#) = happyShift action_48 +action_131 (8#) = happyGoto action_7 +action_131 (9#) = happyGoto action_8 +action_131 (10#) = happyGoto action_9 +action_131 (11#) = happyGoto action_10 +action_131 (12#) = happyGoto action_11 +action_131 (58#) = happyGoto action_12 +action_131 (59#) = happyGoto action_13 action_131 (60#) = happyGoto action_146 -action_131 (72#) = happyGoto action_22 +action_131 (72#) = happyGoto action_19 action_131 x = happyTcHack x happyFail -action_132 (96#) = happyShift action_24 -action_132 (98#) = happyShift action_25 -action_132 (104#) = happyShift action_26 -action_132 (109#) = happyShift action_27 -action_132 (110#) = happyShift action_28 -action_132 (111#) = happyShift action_29 -action_132 (114#) = happyShift action_30 -action_132 (119#) = happyShift action_31 -action_132 (124#) = happyShift action_32 -action_132 (125#) = happyShift action_33 -action_132 (126#) = happyShift action_34 -action_132 (127#) = happyShift action_35 -action_132 (128#) = happyShift action_36 -action_132 (129#) = happyShift action_37 -action_132 (131#) = happyShift action_38 -action_132 (134#) = happyShift action_39 -action_132 (137#) = happyShift action_40 -action_132 (140#) = happyShift action_41 -action_132 (145#) = happyShift action_42 -action_132 (156#) = happyShift action_43 -action_132 (157#) = happyShift action_44 -action_132 (161#) = happyShift action_45 -action_132 (162#) = happyShift action_46 -action_132 (167#) = happyShift action_47 +action_132 (95#) = happyShift action_21 +action_132 (97#) = happyShift action_22 +action_132 (98#) = happyShift action_87 +action_132 (111#) = happyShift action_24 +action_132 (115#) = happyShift action_25 +action_132 (117#) = happyShift action_26 +action_132 (118#) = happyShift action_27 +action_132 (119#) = happyShift action_28 +action_132 (120#) = happyShift action_29 +action_132 (121#) = happyShift action_30 +action_132 (122#) = happyShift action_31 +action_132 (123#) = happyShift action_32 +action_132 (128#) = happyShift action_34 +action_132 (131#) = happyShift action_35 +action_132 (153#) = happyShift action_39 +action_132 (154#) = happyShift action_40 +action_132 (158#) = happyShift action_41 +action_132 (159#) = happyShift action_42 +action_132 (164#) = happyShift action_43 +action_132 (167#) = happyShift action_44 action_132 (170#) = happyShift action_6 -action_132 (171#) = happyShift action_48 -action_132 (172#) = happyShift action_49 -action_132 (173#) = happyShift action_50 -action_132 (174#) = happyShift action_51 -action_132 (8#) = happyGoto action_10 -action_132 (9#) = happyGoto action_11 -action_132 (10#) = happyGoto action_12 -action_132 (11#) = happyGoto action_13 -action_132 (12#) = happyGoto action_14 -action_132 (58#) = happyGoto action_15 -action_132 (59#) = happyGoto action_16 -action_132 (60#) = happyGoto action_17 -action_132 (61#) = happyGoto action_18 -action_132 (62#) = happyGoto action_19 -action_132 (63#) = happyGoto action_145 -action_132 (64#) = happyGoto action_21 -action_132 (72#) = happyGoto action_22 -action_132 (77#) = happyGoto action_23 +action_132 (171#) = happyShift action_45 +action_132 (172#) = happyShift action_46 +action_132 (173#) = happyShift action_47 +action_132 (174#) = happyShift action_48 +action_132 (8#) = happyGoto action_7 +action_132 (9#) = happyGoto action_8 +action_132 (10#) = happyGoto action_9 +action_132 (11#) = happyGoto action_10 +action_132 (12#) = happyGoto action_11 +action_132 (58#) = happyGoto action_12 +action_132 (59#) = happyGoto action_13 +action_132 (60#) = happyGoto action_145 +action_132 (72#) = happyGoto action_19 action_132 x = happyTcHack x happyFail -action_133 (96#) = happyShift action_144 +action_133 (95#) = happyShift action_21 +action_133 (97#) = happyShift action_22 +action_133 (98#) = happyShift action_23 +action_133 (111#) = happyShift action_24 +action_133 (115#) = happyShift action_25 +action_133 (117#) = happyShift action_26 +action_133 (118#) = happyShift action_27 +action_133 (119#) = happyShift action_28 +action_133 (120#) = happyShift action_29 +action_133 (121#) = happyShift action_30 +action_133 (122#) = happyShift action_31 +action_133 (123#) = happyShift action_32 +action_133 (124#) = happyShift action_33 +action_133 (128#) = happyShift action_34 +action_133 (131#) = happyShift action_35 +action_133 (134#) = happyShift action_36 +action_133 (137#) = happyShift action_37 +action_133 (142#) = happyShift action_38 +action_133 (153#) = happyShift action_39 +action_133 (154#) = happyShift action_40 +action_133 (158#) = happyShift action_41 +action_133 (159#) = happyShift action_42 +action_133 (164#) = happyShift action_43 +action_133 (167#) = happyShift action_44 +action_133 (170#) = happyShift action_6 +action_133 (171#) = happyShift action_45 +action_133 (172#) = happyShift action_46 +action_133 (173#) = happyShift action_47 +action_133 (174#) = happyShift action_48 +action_133 (8#) = happyGoto action_7 +action_133 (9#) = happyGoto action_8 +action_133 (10#) = happyGoto action_9 +action_133 (11#) = happyGoto action_10 +action_133 (12#) = happyGoto action_11 +action_133 (58#) = happyGoto action_12 +action_133 (59#) = happyGoto action_13 +action_133 (60#) = happyGoto action_14 +action_133 (61#) = happyGoto action_15 +action_133 (62#) = happyGoto action_16 +action_133 (63#) = happyGoto action_144 +action_133 (64#) = happyGoto action_18 +action_133 (72#) = happyGoto action_19 +action_133 (77#) = happyGoto action_20 action_133 x = happyTcHack x happyFail -action_134 (107#) = happyShift action_135 -action_134 x = happyTcHack x happyReduce_162 +action_134 (167#) = happyShift action_143 +action_134 x = happyTcHack x happyFail -action_135 (122#) = happyShift action_143 -action_135 (174#) = happyShift action_51 -action_135 (12#) = happyGoto action_141 -action_135 (71#) = happyGoto action_142 -action_135 x = happyTcHack x happyFail +action_135 (107#) = happyShift action_136 +action_135 x = happyTcHack x happyReduce_162 -action_136 (96#) = happyShift action_140 -action_136 (98#) = happyShift action_82 -action_136 (104#) = happyShift action_26 -action_136 (109#) = happyShift action_83 -action_136 (110#) = happyShift action_28 -action_136 (111#) = happyShift action_29 -action_136 (125#) = happyShift action_33 -action_136 (126#) = happyShift action_34 -action_136 (127#) = happyShift action_35 -action_136 (128#) = happyShift action_36 -action_136 (129#) = happyShift action_37 -action_136 (134#) = happyShift action_39 -action_136 (170#) = happyShift action_6 -action_136 (171#) = happyShift action_48 -action_136 (172#) = happyShift action_49 -action_136 (173#) = happyShift action_50 -action_136 (174#) = happyShift action_51 -action_136 (8#) = happyGoto action_10 -action_136 (9#) = happyGoto action_11 -action_136 (10#) = happyGoto action_12 -action_136 (11#) = happyGoto action_13 -action_136 (12#) = happyGoto action_79 -action_136 (58#) = happyGoto action_139 -action_136 (72#) = happyGoto action_22 +action_136 (96#) = happyShift action_142 +action_136 (174#) = happyShift action_48 +action_136 (12#) = happyGoto action_140 +action_136 (71#) = happyGoto action_141 action_136 x = happyTcHack x happyFail -action_137 (95#) = happyShift action_138 +action_137 (97#) = happyShift action_86 +action_137 (98#) = happyShift action_87 +action_137 (111#) = happyShift action_24 +action_137 (115#) = happyShift action_25 +action_137 (118#) = happyShift action_27 +action_137 (119#) = happyShift action_28 +action_137 (120#) = happyShift action_29 +action_137 (121#) = happyShift action_30 +action_137 (122#) = happyShift action_31 +action_137 (123#) = happyShift action_32 +action_137 (131#) = happyShift action_35 +action_137 (167#) = happyShift action_139 +action_137 (170#) = happyShift action_6 +action_137 (171#) = happyShift action_45 +action_137 (172#) = happyShift action_46 +action_137 (173#) = happyShift action_47 +action_137 (174#) = happyShift action_48 +action_137 (8#) = happyGoto action_7 +action_137 (9#) = happyGoto action_8 +action_137 (10#) = happyGoto action_9 +action_137 (11#) = happyGoto action_10 +action_137 (12#) = happyGoto action_84 +action_137 (58#) = happyGoto action_138 +action_137 (72#) = happyGoto action_19 action_137 x = happyTcHack x happyFail -action_138 (1#) = happyReduce_65 -action_138 (102#) = happyReduce_65 -action_138 (151#) = happyReduce_51 -action_138 (160#) = happyShift action_347 -action_138 (165#) = happyShift action_348 -action_138 (174#) = happyShift action_51 -action_138 (12#) = happyGoto action_241 -action_138 (22#) = happyGoto action_343 -action_138 (26#) = happyGoto action_344 -action_138 (32#) = happyGoto action_345 -action_138 (33#) = happyGoto action_346 -action_138 x = happyTcHack x happyReduce_65 +action_138 x = happyTcHack x happyReduce_170 -action_139 x = happyTcHack x happyReduce_170 +action_139 (174#) = happyShift action_48 +action_139 (12#) = happyGoto action_348 +action_139 (53#) = happyGoto action_80 +action_139 (56#) = happyGoto action_81 +action_139 (57#) = happyGoto action_82 +action_139 x = happyTcHack x happyReduce_137 -action_140 (174#) = happyShift action_51 -action_140 (12#) = happyGoto action_342 -action_140 (53#) = happyGoto action_88 -action_140 (56#) = happyGoto action_89 -action_140 (57#) = happyGoto action_125 -action_140 x = happyTcHack x happyReduce_137 +action_140 x = happyTcHack x happyReduce_222 -action_141 x = happyTcHack x happyReduce_222 +action_141 x = happyTcHack x happyReduce_158 -action_142 x = happyTcHack x happyReduce_158 +action_142 (170#) = happyShift action_6 +action_142 (8#) = happyGoto action_347 +action_142 x = happyTcHack x happyFail -action_143 (170#) = happyShift action_6 -action_143 (8#) = happyGoto action_341 -action_143 x = happyTcHack x happyFail +action_143 (174#) = happyShift action_48 +action_143 (12#) = happyGoto action_92 +action_143 (53#) = happyGoto action_80 +action_143 (56#) = happyGoto action_81 +action_143 (57#) = happyGoto action_346 +action_143 x = happyTcHack x happyReduce_137 -action_144 (174#) = happyShift action_51 -action_144 (12#) = happyGoto action_87 -action_144 (53#) = happyGoto action_88 -action_144 (56#) = happyGoto action_89 -action_144 (57#) = happyGoto action_340 -action_144 x = happyTcHack x happyReduce_137 +action_144 x = happyTcHack x happyReduce_185 -action_145 x = happyTcHack x happyReduce_185 +action_145 (97#) = happyShift action_22 +action_145 (98#) = happyShift action_87 +action_145 (111#) = happyShift action_24 +action_145 (115#) = happyShift action_25 +action_145 (118#) = happyShift action_27 +action_145 (119#) = happyShift action_28 +action_145 (120#) = happyShift action_29 +action_145 (121#) = happyShift action_30 +action_145 (122#) = happyShift action_31 +action_145 (123#) = happyShift action_32 +action_145 (131#) = happyShift action_35 +action_145 (167#) = happyShift action_44 +action_145 (170#) = happyShift action_6 +action_145 (171#) = happyShift action_45 +action_145 (172#) = happyShift action_46 +action_145 (173#) = happyShift action_47 +action_145 (174#) = happyShift action_48 +action_145 (8#) = happyGoto action_7 +action_145 (9#) = happyGoto action_8 +action_145 (10#) = happyGoto action_9 +action_145 (11#) = happyGoto action_10 +action_145 (12#) = happyGoto action_84 +action_145 (58#) = happyGoto action_12 +action_145 (59#) = happyGoto action_135 +action_145 (72#) = happyGoto action_19 +action_145 x = happyTcHack x happyReduce_177 -action_146 (96#) = happyShift action_24 -action_146 (98#) = happyShift action_82 -action_146 (104#) = happyShift action_26 -action_146 (109#) = happyShift action_27 -action_146 (110#) = happyShift action_28 -action_146 (111#) = happyShift action_29 -action_146 (125#) = happyShift action_33 -action_146 (126#) = happyShift action_34 -action_146 (127#) = happyShift action_35 -action_146 (128#) = happyShift action_36 -action_146 (129#) = happyShift action_37 -action_146 (134#) = happyShift action_39 +action_146 (97#) = happyShift action_22 +action_146 (98#) = happyShift action_87 +action_146 (111#) = happyShift action_24 +action_146 (115#) = happyShift action_25 +action_146 (118#) = happyShift action_27 +action_146 (119#) = happyShift action_28 +action_146 (120#) = happyShift action_29 +action_146 (121#) = happyShift action_30 +action_146 (122#) = happyShift action_31 +action_146 (123#) = happyShift action_32 +action_146 (131#) = happyShift action_35 +action_146 (167#) = happyShift action_44 action_146 (170#) = happyShift action_6 -action_146 (171#) = happyShift action_48 -action_146 (172#) = happyShift action_49 -action_146 (173#) = happyShift action_50 -action_146 (174#) = happyShift action_51 -action_146 (8#) = happyGoto action_10 -action_146 (9#) = happyGoto action_11 -action_146 (10#) = happyGoto action_12 -action_146 (11#) = happyGoto action_13 -action_146 (12#) = happyGoto action_79 -action_146 (58#) = happyGoto action_15 -action_146 (59#) = happyGoto action_134 -action_146 (72#) = happyGoto action_22 +action_146 (171#) = happyShift action_45 +action_146 (172#) = happyShift action_46 +action_146 (173#) = happyShift action_47 +action_146 (174#) = happyShift action_48 +action_146 (8#) = happyGoto action_7 +action_146 (9#) = happyGoto action_8 +action_146 (10#) = happyGoto action_9 +action_146 (11#) = happyGoto action_10 +action_146 (12#) = happyGoto action_84 +action_146 (58#) = happyGoto action_12 +action_146 (59#) = happyGoto action_135 +action_146 (72#) = happyGoto action_19 action_146 x = happyTcHack x happyReduce_176 -action_147 (96#) = happyShift action_24 -action_147 (98#) = happyShift action_82 -action_147 (104#) = happyShift action_26 -action_147 (109#) = happyShift action_27 -action_147 (110#) = happyShift action_28 -action_147 (111#) = happyShift action_29 -action_147 (125#) = happyShift action_33 -action_147 (126#) = happyShift action_34 -action_147 (127#) = happyShift action_35 -action_147 (128#) = happyShift action_36 -action_147 (129#) = happyShift action_37 -action_147 (134#) = happyShift action_39 +action_147 (97#) = happyShift action_22 +action_147 (98#) = happyShift action_87 +action_147 (111#) = happyShift action_24 +action_147 (115#) = happyShift action_25 +action_147 (118#) = happyShift action_27 +action_147 (119#) = happyShift action_28 +action_147 (120#) = happyShift action_29 +action_147 (121#) = happyShift action_30 +action_147 (122#) = happyShift action_31 +action_147 (123#) = happyShift action_32 +action_147 (131#) = happyShift action_35 +action_147 (167#) = happyShift action_44 action_147 (170#) = happyShift action_6 -action_147 (171#) = happyShift action_48 -action_147 (172#) = happyShift action_49 -action_147 (173#) = happyShift action_50 -action_147 (174#) = happyShift action_51 -action_147 (8#) = happyGoto action_10 -action_147 (9#) = happyGoto action_11 -action_147 (10#) = happyGoto action_12 -action_147 (11#) = happyGoto action_13 -action_147 (12#) = happyGoto action_79 -action_147 (58#) = happyGoto action_15 -action_147 (59#) = happyGoto action_134 -action_147 (72#) = happyGoto action_22 +action_147 (171#) = happyShift action_45 +action_147 (172#) = happyShift action_46 +action_147 (173#) = happyShift action_47 +action_147 (174#) = happyShift action_48 +action_147 (8#) = happyGoto action_7 +action_147 (9#) = happyGoto action_8 +action_147 (10#) = happyGoto action_9 +action_147 (11#) = happyGoto action_10 +action_147 (12#) = happyGoto action_84 +action_147 (58#) = happyGoto action_12 +action_147 (59#) = happyGoto action_135 +action_147 (72#) = happyGoto action_19 action_147 x = happyTcHack x happyReduce_175 -action_148 (96#) = happyShift action_24 -action_148 (98#) = happyShift action_82 -action_148 (104#) = happyShift action_26 -action_148 (109#) = happyShift action_27 -action_148 (110#) = happyShift action_28 -action_148 (111#) = happyShift action_29 -action_148 (125#) = happyShift action_33 -action_148 (126#) = happyShift action_34 -action_148 (127#) = happyShift action_35 -action_148 (128#) = happyShift action_36 -action_148 (129#) = happyShift action_37 -action_148 (134#) = happyShift action_39 -action_148 (170#) = happyShift action_6 -action_148 (171#) = happyShift action_48 -action_148 (172#) = happyShift action_49 -action_148 (173#) = happyShift action_50 -action_148 (174#) = happyShift action_51 -action_148 (8#) = happyGoto action_10 -action_148 (9#) = happyGoto action_11 -action_148 (10#) = happyGoto action_12 -action_148 (11#) = happyGoto action_13 -action_148 (12#) = happyGoto action_79 -action_148 (58#) = happyGoto action_15 -action_148 (59#) = happyGoto action_134 -action_148 (72#) = happyGoto action_22 -action_148 x = happyTcHack x happyReduce_177 +action_148 x = happyTcHack x happyReduce_181 -action_149 x = happyTcHack x happyReduce_181 +action_149 (97#) = happyShift action_22 +action_149 (98#) = happyShift action_87 +action_149 (111#) = happyShift action_24 +action_149 (115#) = happyShift action_25 +action_149 (118#) = happyShift action_27 +action_149 (119#) = happyShift action_28 +action_149 (120#) = happyShift action_29 +action_149 (121#) = happyShift action_30 +action_149 (122#) = happyShift action_31 +action_149 (123#) = happyShift action_32 +action_149 (131#) = happyShift action_35 +action_149 (167#) = happyShift action_44 +action_149 (170#) = happyShift action_6 +action_149 (171#) = happyShift action_45 +action_149 (172#) = happyShift action_46 +action_149 (173#) = happyShift action_47 +action_149 (174#) = happyShift action_48 +action_149 (8#) = happyGoto action_7 +action_149 (9#) = happyGoto action_8 +action_149 (10#) = happyGoto action_9 +action_149 (11#) = happyGoto action_10 +action_149 (12#) = happyGoto action_84 +action_149 (58#) = happyGoto action_12 +action_149 (59#) = happyGoto action_135 +action_149 (72#) = happyGoto action_19 +action_149 x = happyTcHack x happyReduce_178 -action_150 (96#) = happyShift action_24 -action_150 (98#) = happyShift action_82 -action_150 (104#) = happyShift action_26 -action_150 (109#) = happyShift action_27 -action_150 (110#) = happyShift action_28 -action_150 (111#) = happyShift action_29 -action_150 (125#) = happyShift action_33 -action_150 (126#) = happyShift action_34 -action_150 (127#) = happyShift action_35 -action_150 (128#) = happyShift action_36 -action_150 (129#) = happyShift action_37 -action_150 (134#) = happyShift action_39 -action_150 (170#) = happyShift action_6 -action_150 (171#) = happyShift action_48 -action_150 (172#) = happyShift action_49 -action_150 (173#) = happyShift action_50 -action_150 (174#) = happyShift action_51 -action_150 (8#) = happyGoto action_10 -action_150 (9#) = happyGoto action_11 -action_150 (10#) = happyGoto action_12 -action_150 (11#) = happyGoto action_13 -action_150 (12#) = happyGoto action_79 -action_150 (58#) = happyGoto action_15 -action_150 (59#) = happyGoto action_134 -action_150 (72#) = happyGoto action_22 -action_150 x = happyTcHack x happyReduce_178 +action_150 (94#) = happyShift action_130 +action_150 (100#) = happyShift action_131 +action_150 (101#) = happyShift action_132 +action_150 x = happyTcHack x happyReduce_192 -action_151 (102#) = happyShift action_129 -action_151 (115#) = happyShift action_130 -action_151 (116#) = happyShift action_131 -action_151 x = happyTcHack x happyReduce_192 +action_151 x = happyTcHack x happyReduce_179 -action_152 x = happyTcHack x happyReduce_179 +action_152 x = happyTcHack x happyReduce_184 -action_153 x = happyTcHack x happyReduce_184 +action_153 (104#) = happyShift action_190 +action_153 (169#) = happyShift action_345 +action_153 x = happyTcHack x happyReduce_128 -action_154 x = happyTcHack x happyReduce_152 +action_154 (112#) = happyShift action_344 +action_154 x = happyTcHack x happyFail -action_155 x = happyTcHack x happyReduce_141 +action_155 (110#) = happyShift action_343 +action_155 x = happyTcHack x happyReduce_230 -action_156 (174#) = happyShift action_51 -action_156 (12#) = happyGoto action_87 -action_156 (53#) = happyGoto action_339 +action_156 (169#) = happyShift action_342 action_156 x = happyTcHack x happyFail -action_157 (174#) = happyShift action_51 -action_157 (12#) = happyGoto action_338 +action_157 (125#) = happyShift action_341 action_157 x = happyTcHack x happyFail -action_158 (99#) = happyShift action_337 -action_158 x = happyTcHack x happyReduce_140 +action_158 (95#) = happyShift action_120 +action_158 (98#) = happyShift action_121 +action_158 (107#) = happyShift action_310 +action_158 (111#) = happyShift action_122 +action_158 (115#) = happyShift action_123 +action_158 (116#) = happyShift action_311 +action_158 (123#) = happyShift action_124 +action_158 (126#) = happyShift action_125 +action_158 (167#) = happyShift action_126 +action_158 (170#) = happyShift action_6 +action_158 (171#) = happyShift action_45 +action_158 (172#) = happyShift action_46 +action_158 (174#) = happyShift action_48 +action_158 (8#) = happyGoto action_115 +action_158 (9#) = happyGoto action_116 +action_158 (10#) = happyGoto action_117 +action_158 (12#) = happyGoto action_118 +action_158 (67#) = happyGoto action_183 +action_158 (74#) = happyGoto action_309 +action_158 x = happyTcHack x happyReduce_203 -action_159 (96#) = happyShift action_24 -action_159 (98#) = happyShift action_25 -action_159 (104#) = happyShift action_26 -action_159 (109#) = happyShift action_27 -action_159 (110#) = happyShift action_28 -action_159 (111#) = happyShift action_29 -action_159 (114#) = happyShift action_30 -action_159 (119#) = happyShift action_31 -action_159 (124#) = happyShift action_32 -action_159 (125#) = happyShift action_33 -action_159 (126#) = happyShift action_34 -action_159 (127#) = happyShift action_35 -action_159 (128#) = happyShift action_36 -action_159 (129#) = happyShift action_37 -action_159 (131#) = happyShift action_38 -action_159 (134#) = happyShift action_39 -action_159 (137#) = happyShift action_40 -action_159 (140#) = happyShift action_41 -action_159 (145#) = happyShift action_42 -action_159 (156#) = happyShift action_43 -action_159 (157#) = happyShift action_44 -action_159 (161#) = happyShift action_45 -action_159 (162#) = happyShift action_46 -action_159 (167#) = happyShift action_47 -action_159 (170#) = happyShift action_6 -action_159 (171#) = happyShift action_48 -action_159 (172#) = happyShift action_49 -action_159 (173#) = happyShift action_50 -action_159 (174#) = happyShift action_51 -action_159 (8#) = happyGoto action_10 -action_159 (9#) = happyGoto action_11 -action_159 (10#) = happyGoto action_12 -action_159 (11#) = happyGoto action_13 -action_159 (12#) = happyGoto action_14 -action_159 (58#) = happyGoto action_15 -action_159 (59#) = happyGoto action_16 -action_159 (60#) = happyGoto action_17 -action_159 (61#) = happyGoto action_18 -action_159 (62#) = happyGoto action_19 -action_159 (63#) = happyGoto action_336 -action_159 (64#) = happyGoto action_21 -action_159 (72#) = happyGoto action_22 -action_159 (77#) = happyGoto action_23 -action_159 x = happyTcHack x happyFail +action_159 (100#) = happyShift action_340 +action_159 x = happyTcHack x happyReduce_217 -action_160 x = happyTcHack x happyReduce_156 +action_160 x = happyTcHack x happyReduce_220 -action_161 (96#) = happyShift action_140 -action_161 (98#) = happyShift action_82 -action_161 (104#) = happyShift action_26 -action_161 (109#) = happyShift action_83 -action_161 (110#) = happyShift action_28 -action_161 (111#) = happyShift action_29 -action_161 (125#) = happyShift action_33 -action_161 (126#) = happyShift action_34 -action_161 (127#) = happyShift action_35 -action_161 (128#) = happyShift action_36 -action_161 (129#) = happyShift action_37 -action_161 (134#) = happyShift action_39 -action_161 (170#) = happyShift action_6 -action_161 (171#) = happyShift action_48 -action_161 (172#) = happyShift action_49 -action_161 (173#) = happyShift action_50 -action_161 (174#) = happyShift action_51 -action_161 (8#) = happyGoto action_10 -action_161 (9#) = happyGoto action_11 -action_161 (10#) = happyGoto action_12 -action_161 (11#) = happyGoto action_13 -action_161 (12#) = happyGoto action_79 -action_161 (58#) = happyGoto action_161 -action_161 (66#) = happyGoto action_335 -action_161 (72#) = happyGoto action_22 -action_161 x = happyTcHack x happyReduce_196 +action_161 (102#) = happyShift action_306 +action_161 (168#) = happyShift action_308 +action_161 x = happyTcHack x happyReduce_242 -action_162 (105#) = happyShift action_334 -action_162 x = happyTcHack x happyFail +action_162 (104#) = happyShift action_339 +action_162 x = happyTcHack x happyReduce_247 -action_163 x = happyTcHack x happyReduce_151 +action_163 (114#) = happyShift action_338 +action_163 x = happyTcHack x happyFail -action_164 (174#) = happyShift action_51 -action_164 (12#) = happyGoto action_333 +action_164 (95#) = happyShift action_120 +action_164 (98#) = happyShift action_121 +action_164 (111#) = happyShift action_122 +action_164 (115#) = happyShift action_123 +action_164 (123#) = happyShift action_124 +action_164 (126#) = happyShift action_125 +action_164 (167#) = happyShift action_126 +action_164 (170#) = happyShift action_6 +action_164 (171#) = happyShift action_45 +action_164 (172#) = happyShift action_46 +action_164 (174#) = happyShift action_48 +action_164 (8#) = happyGoto action_115 +action_164 (9#) = happyGoto action_116 +action_164 (10#) = happyGoto action_117 +action_164 (12#) = happyGoto action_118 +action_164 (67#) = happyGoto action_337 action_164 x = happyTcHack x happyFail -action_165 x = happyTcHack x happyReduce_142 +action_165 (99#) = happyShift action_336 +action_165 (102#) = happyShift action_306 +action_165 (168#) = happyShift action_308 +action_165 x = happyTcHack x happyFail -action_166 x = happyTcHack x happyReduce_153 +action_166 (107#) = happyShift action_335 +action_166 x = happyTcHack x happyReduce_200 -action_167 (96#) = happyShift action_24 -action_167 (98#) = happyShift action_25 -action_167 (104#) = happyShift action_26 -action_167 (109#) = happyShift action_27 -action_167 (110#) = happyShift action_28 -action_167 (111#) = happyShift action_29 -action_167 (114#) = happyShift action_30 -action_167 (119#) = happyShift action_31 -action_167 (124#) = happyShift action_32 -action_167 (125#) = happyShift action_33 -action_167 (126#) = happyShift action_34 -action_167 (127#) = happyShift action_35 -action_167 (128#) = happyShift action_36 -action_167 (129#) = happyShift action_37 -action_167 (131#) = happyShift action_38 -action_167 (134#) = happyShift action_39 -action_167 (137#) = happyShift action_40 -action_167 (140#) = happyShift action_41 -action_167 (145#) = happyShift action_42 -action_167 (156#) = happyShift action_43 -action_167 (157#) = happyShift action_44 -action_167 (161#) = happyShift action_45 -action_167 (162#) = happyShift action_46 -action_167 (167#) = happyShift action_47 -action_167 (170#) = happyShift action_6 -action_167 (171#) = happyShift action_48 -action_167 (172#) = happyShift action_49 -action_167 (173#) = happyShift action_50 -action_167 (174#) = happyShift action_51 -action_167 (8#) = happyGoto action_10 -action_167 (9#) = happyGoto action_11 -action_167 (10#) = happyGoto action_12 -action_167 (11#) = happyGoto action_13 -action_167 (12#) = happyGoto action_14 -action_167 (58#) = happyGoto action_15 -action_167 (59#) = happyGoto action_16 -action_167 (60#) = happyGoto action_17 -action_167 (61#) = happyGoto action_18 -action_167 (62#) = happyGoto action_19 -action_167 (63#) = happyGoto action_331 -action_167 (64#) = happyGoto action_21 -action_167 (72#) = happyGoto action_22 -action_167 (77#) = happyGoto action_23 -action_167 (78#) = happyGoto action_114 -action_167 (80#) = happyGoto action_332 -action_167 x = happyTcHack x happyReduce_243 +action_167 (174#) = happyShift action_48 +action_167 (12#) = happyGoto action_334 +action_167 x = happyTcHack x happyFail -action_168 (96#) = happyShift action_24 -action_168 (98#) = happyShift action_25 -action_168 (104#) = happyShift action_26 -action_168 (109#) = happyShift action_27 -action_168 (110#) = happyShift action_28 -action_168 (111#) = happyShift action_29 -action_168 (114#) = happyShift action_30 -action_168 (119#) = happyShift action_31 -action_168 (124#) = happyShift action_32 -action_168 (125#) = happyShift action_33 -action_168 (126#) = happyShift action_34 -action_168 (127#) = happyShift action_35 -action_168 (128#) = happyShift action_36 -action_168 (129#) = happyShift action_37 -action_168 (131#) = happyShift action_38 -action_168 (134#) = happyShift action_39 -action_168 (137#) = happyShift action_40 -action_168 (140#) = happyShift action_41 -action_168 (145#) = happyShift action_42 -action_168 (156#) = happyShift action_43 -action_168 (157#) = happyShift action_44 -action_168 (161#) = happyShift action_45 -action_168 (162#) = happyShift action_46 -action_168 (167#) = happyShift action_47 -action_168 (170#) = happyShift action_6 -action_168 (171#) = happyShift action_48 -action_168 (172#) = happyShift action_49 -action_168 (173#) = happyShift action_50 -action_168 (174#) = happyShift action_51 -action_168 (8#) = happyGoto action_10 -action_168 (9#) = happyGoto action_11 -action_168 (10#) = happyGoto action_12 -action_168 (11#) = happyGoto action_13 -action_168 (12#) = happyGoto action_14 -action_168 (58#) = happyGoto action_15 -action_168 (59#) = happyGoto action_16 -action_168 (60#) = happyGoto action_17 -action_168 (61#) = happyGoto action_18 -action_168 (62#) = happyGoto action_19 -action_168 (63#) = happyGoto action_330 -action_168 (64#) = happyGoto action_21 -action_168 (72#) = happyGoto action_22 -action_168 (77#) = happyGoto action_23 -action_168 x = happyTcHack x happyFail +action_168 x = happyTcHack x happyReduce_142 -action_169 (107#) = happyShift action_329 -action_169 x = happyTcHack x happyReduce_200 +action_169 (174#) = happyShift action_48 +action_169 (12#) = happyGoto action_333 +action_169 x = happyTcHack x happyFail -action_170 (96#) = happyShift action_106 -action_170 (98#) = happyShift action_107 -action_170 (104#) = happyShift action_108 -action_170 (107#) = happyShift action_300 -action_170 (110#) = happyShift action_109 -action_170 (111#) = happyShift action_110 -action_170 (113#) = happyShift action_301 -action_170 (114#) = happyShift action_111 -action_170 (121#) = happyShift action_112 -action_170 (170#) = happyShift action_6 -action_170 (171#) = happyShift action_48 -action_170 (172#) = happyShift action_49 -action_170 (174#) = happyShift action_51 -action_170 (8#) = happyGoto action_101 -action_170 (9#) = happyGoto action_102 -action_170 (10#) = happyGoto action_103 -action_170 (12#) = happyGoto action_104 -action_170 (67#) = happyGoto action_188 -action_170 (74#) = happyGoto action_299 -action_170 x = happyTcHack x happyReduce_203 +action_170 (99#) = happyShift action_332 +action_170 x = happyTcHack x happyReduce_140 -action_171 (116#) = happyShift action_328 -action_171 x = happyTcHack x happyReduce_217 +action_171 (95#) = happyShift action_21 +action_171 (97#) = happyShift action_22 +action_171 (98#) = happyShift action_23 +action_171 (111#) = happyShift action_24 +action_171 (115#) = happyShift action_25 +action_171 (117#) = happyShift action_26 +action_171 (118#) = happyShift action_27 +action_171 (119#) = happyShift action_28 +action_171 (120#) = happyShift action_29 +action_171 (121#) = happyShift action_30 +action_171 (122#) = happyShift action_31 +action_171 (123#) = happyShift action_32 +action_171 (124#) = happyShift action_33 +action_171 (128#) = happyShift action_34 +action_171 (131#) = happyShift action_35 +action_171 (134#) = happyShift action_36 +action_171 (137#) = happyShift action_37 +action_171 (142#) = happyShift action_38 +action_171 (153#) = happyShift action_39 +action_171 (154#) = happyShift action_40 +action_171 (158#) = happyShift action_41 +action_171 (159#) = happyShift action_42 +action_171 (164#) = happyShift action_43 +action_171 (167#) = happyShift action_44 +action_171 (170#) = happyShift action_6 +action_171 (171#) = happyShift action_45 +action_171 (172#) = happyShift action_46 +action_171 (173#) = happyShift action_47 +action_171 (174#) = happyShift action_48 +action_171 (8#) = happyGoto action_7 +action_171 (9#) = happyGoto action_8 +action_171 (10#) = happyGoto action_9 +action_171 (11#) = happyGoto action_10 +action_171 (12#) = happyGoto action_11 +action_171 (58#) = happyGoto action_12 +action_171 (59#) = happyGoto action_13 +action_171 (60#) = happyGoto action_14 +action_171 (61#) = happyGoto action_15 +action_171 (62#) = happyGoto action_16 +action_171 (63#) = happyGoto action_331 +action_171 (64#) = happyGoto action_18 +action_171 (72#) = happyGoto action_19 +action_171 (77#) = happyGoto action_20 +action_171 x = happyTcHack x happyFail -action_172 x = happyTcHack x happyReduce_220 +action_172 x = happyTcHack x happyReduce_156 -action_173 (108#) = happyShift action_296 -action_173 (117#) = happyShift action_297 -action_173 x = happyTcHack x happyReduce_242 +action_173 x = happyTcHack x happyReduce_153 -action_174 (103#) = happyShift action_327 -action_174 x = happyTcHack x happyReduce_247 +action_174 (95#) = happyShift action_21 +action_174 (97#) = happyShift action_22 +action_174 (98#) = happyShift action_23 +action_174 (111#) = happyShift action_24 +action_174 (115#) = happyShift action_25 +action_174 (117#) = happyShift action_26 +action_174 (118#) = happyShift action_27 +action_174 (119#) = happyShift action_28 +action_174 (120#) = happyShift action_29 +action_174 (121#) = happyShift action_30 +action_174 (122#) = happyShift action_31 +action_174 (123#) = happyShift action_32 +action_174 (124#) = happyShift action_33 +action_174 (128#) = happyShift action_34 +action_174 (131#) = happyShift action_35 +action_174 (134#) = happyShift action_36 +action_174 (137#) = happyShift action_37 +action_174 (142#) = happyShift action_38 +action_174 (153#) = happyShift action_39 +action_174 (154#) = happyShift action_40 +action_174 (158#) = happyShift action_41 +action_174 (159#) = happyShift action_42 +action_174 (164#) = happyShift action_43 +action_174 (167#) = happyShift action_44 +action_174 (170#) = happyShift action_6 +action_174 (171#) = happyShift action_45 +action_174 (172#) = happyShift action_46 +action_174 (173#) = happyShift action_47 +action_174 (174#) = happyShift action_48 +action_174 (8#) = happyGoto action_7 +action_174 (9#) = happyGoto action_8 +action_174 (10#) = happyGoto action_9 +action_174 (11#) = happyGoto action_10 +action_174 (12#) = happyGoto action_11 +action_174 (58#) = happyGoto action_12 +action_174 (59#) = happyGoto action_13 +action_174 (60#) = happyGoto action_14 +action_174 (61#) = happyGoto action_15 +action_174 (62#) = happyGoto action_16 +action_174 (63#) = happyGoto action_329 +action_174 (64#) = happyGoto action_18 +action_174 (72#) = happyGoto action_19 +action_174 (77#) = happyGoto action_20 +action_174 (78#) = happyGoto action_108 +action_174 (80#) = happyGoto action_330 +action_174 x = happyTcHack x happyReduce_243 -action_175 (112#) = happyShift action_326 +action_175 (95#) = happyShift action_21 +action_175 (97#) = happyShift action_22 +action_175 (98#) = happyShift action_23 +action_175 (111#) = happyShift action_24 +action_175 (115#) = happyShift action_25 +action_175 (117#) = happyShift action_26 +action_175 (118#) = happyShift action_27 +action_175 (119#) = happyShift action_28 +action_175 (120#) = happyShift action_29 +action_175 (121#) = happyShift action_30 +action_175 (122#) = happyShift action_31 +action_175 (123#) = happyShift action_32 +action_175 (124#) = happyShift action_33 +action_175 (128#) = happyShift action_34 +action_175 (131#) = happyShift action_35 +action_175 (134#) = happyShift action_36 +action_175 (137#) = happyShift action_37 +action_175 (142#) = happyShift action_38 +action_175 (153#) = happyShift action_39 +action_175 (154#) = happyShift action_40 +action_175 (158#) = happyShift action_41 +action_175 (159#) = happyShift action_42 +action_175 (164#) = happyShift action_43 +action_175 (167#) = happyShift action_44 +action_175 (170#) = happyShift action_6 +action_175 (171#) = happyShift action_45 +action_175 (172#) = happyShift action_46 +action_175 (173#) = happyShift action_47 +action_175 (174#) = happyShift action_48 +action_175 (8#) = happyGoto action_7 +action_175 (9#) = happyGoto action_8 +action_175 (10#) = happyGoto action_9 +action_175 (11#) = happyGoto action_10 +action_175 (12#) = happyGoto action_11 +action_175 (58#) = happyGoto action_12 +action_175 (59#) = happyGoto action_13 +action_175 (60#) = happyGoto action_14 +action_175 (61#) = happyGoto action_15 +action_175 (62#) = happyGoto action_16 +action_175 (63#) = happyGoto action_328 +action_175 (64#) = happyGoto action_18 +action_175 (72#) = happyGoto action_19 +action_175 (77#) = happyGoto action_20 action_175 x = happyTcHack x happyFail -action_176 (96#) = happyShift action_106 -action_176 (98#) = happyShift action_107 -action_176 (104#) = happyShift action_108 -action_176 (110#) = happyShift action_109 -action_176 (111#) = happyShift action_110 -action_176 (114#) = happyShift action_111 -action_176 (121#) = happyShift action_112 +action_176 (97#) = happyShift action_86 +action_176 (98#) = happyShift action_87 +action_176 (111#) = happyShift action_24 +action_176 (115#) = happyShift action_25 +action_176 (118#) = happyShift action_27 +action_176 (119#) = happyShift action_28 +action_176 (120#) = happyShift action_29 +action_176 (121#) = happyShift action_30 +action_176 (122#) = happyShift action_31 +action_176 (123#) = happyShift action_32 +action_176 (131#) = happyShift action_35 +action_176 (167#) = happyShift action_139 action_176 (170#) = happyShift action_6 -action_176 (171#) = happyShift action_48 -action_176 (172#) = happyShift action_49 -action_176 (174#) = happyShift action_51 -action_176 (8#) = happyGoto action_101 -action_176 (9#) = happyGoto action_102 -action_176 (10#) = happyGoto action_103 -action_176 (12#) = happyGoto action_104 -action_176 (67#) = happyGoto action_325 -action_176 x = happyTcHack x happyFail +action_176 (171#) = happyShift action_45 +action_176 (172#) = happyShift action_46 +action_176 (173#) = happyShift action_47 +action_176 (174#) = happyShift action_48 +action_176 (8#) = happyGoto action_7 +action_176 (9#) = happyGoto action_8 +action_176 (10#) = happyGoto action_9 +action_176 (11#) = happyGoto action_10 +action_176 (12#) = happyGoto action_84 +action_176 (58#) = happyGoto action_176 +action_176 (66#) = happyGoto action_327 +action_176 (72#) = happyGoto action_19 +action_176 x = happyTcHack x happyReduce_196 -action_177 (105#) = happyShift action_324 +action_177 (125#) = happyShift action_326 action_177 x = happyTcHack x happyFail -action_178 (99#) = happyShift action_323 -action_178 (108#) = happyShift action_296 -action_178 (117#) = happyShift action_297 -action_178 x = happyTcHack x happyFail +action_178 x = happyTcHack x happyReduce_151 -action_179 (97#) = happyShift action_322 -action_179 (103#) = happyShift action_156 -action_179 x = happyTcHack x happyReduce_128 +action_179 (113#) = happyShift action_325 +action_179 x = happyTcHack x happyFail -action_180 (95#) = happyShift action_321 +action_180 (95#) = happyShift action_21 +action_180 (97#) = happyShift action_22 +action_180 (98#) = happyShift action_23 +action_180 (111#) = happyShift action_24 +action_180 (115#) = happyShift action_25 +action_180 (117#) = happyShift action_26 +action_180 (118#) = happyShift action_27 +action_180 (119#) = happyShift action_28 +action_180 (120#) = happyShift action_29 +action_180 (121#) = happyShift action_30 +action_180 (122#) = happyShift action_31 +action_180 (123#) = happyShift action_32 +action_180 (124#) = happyShift action_33 +action_180 (128#) = happyShift action_34 +action_180 (131#) = happyShift action_35 +action_180 (134#) = happyShift action_36 +action_180 (137#) = happyShift action_37 +action_180 (142#) = happyShift action_38 +action_180 (153#) = happyShift action_39 +action_180 (154#) = happyShift action_40 +action_180 (158#) = happyShift action_41 +action_180 (159#) = happyShift action_42 +action_180 (164#) = happyShift action_43 +action_180 (167#) = happyShift action_44 +action_180 (170#) = happyShift action_6 +action_180 (171#) = happyShift action_45 +action_180 (172#) = happyShift action_46 +action_180 (173#) = happyShift action_47 +action_180 (174#) = happyShift action_48 +action_180 (8#) = happyGoto action_7 +action_180 (9#) = happyGoto action_8 +action_180 (10#) = happyGoto action_9 +action_180 (11#) = happyGoto action_10 +action_180 (12#) = happyGoto action_11 +action_180 (58#) = happyGoto action_12 +action_180 (59#) = happyGoto action_13 +action_180 (60#) = happyGoto action_14 +action_180 (61#) = happyGoto action_15 +action_180 (62#) = happyGoto action_16 +action_180 (63#) = happyGoto action_324 +action_180 (64#) = happyGoto action_18 +action_180 (72#) = happyGoto action_19 +action_180 (77#) = happyGoto action_20 action_180 x = happyTcHack x happyFail -action_181 (94#) = happyShift action_320 -action_181 x = happyTcHack x happyReduce_230 +action_181 (126#) = happyShift action_102 +action_181 (174#) = happyShift action_48 +action_181 (12#) = happyGoto action_98 +action_181 (75#) = happyGoto action_99 +action_181 (76#) = happyGoto action_323 +action_181 x = happyTcHack x happyReduce_236 -action_182 (97#) = happyShift action_319 +action_182 (167#) = happyShift action_322 action_182 x = happyTcHack x happyFail -action_183 (174#) = happyShift action_51 -action_183 (12#) = happyGoto action_318 -action_183 x = happyTcHack x happyFail +action_183 (95#) = happyShift action_120 +action_183 (98#) = happyShift action_121 +action_183 (111#) = happyShift action_122 +action_183 (115#) = happyShift action_123 +action_183 (123#) = happyShift action_124 +action_183 (126#) = happyShift action_125 +action_183 (167#) = happyShift action_126 +action_183 (170#) = happyShift action_6 +action_183 (171#) = happyShift action_45 +action_183 (172#) = happyShift action_46 +action_183 (174#) = happyShift action_48 +action_183 (8#) = happyGoto action_115 +action_183 (9#) = happyGoto action_116 +action_183 (10#) = happyGoto action_117 +action_183 (12#) = happyGoto action_118 +action_183 (67#) = happyGoto action_183 +action_183 (74#) = happyGoto action_321 +action_183 x = happyTcHack x happyReduce_232 -action_184 (120#) = happyShift action_317 +action_184 (106#) = happyShift action_320 action_184 x = happyTcHack x happyFail -action_185 (96#) = happyShift action_24 -action_185 (98#) = happyShift action_25 -action_185 (104#) = happyShift action_26 -action_185 (109#) = happyShift action_27 -action_185 (110#) = happyShift action_28 -action_185 (111#) = happyShift action_29 -action_185 (114#) = happyShift action_30 -action_185 (119#) = happyShift action_31 -action_185 (124#) = happyShift action_32 -action_185 (125#) = happyShift action_33 -action_185 (126#) = happyShift action_34 -action_185 (127#) = happyShift action_35 -action_185 (128#) = happyShift action_36 -action_185 (129#) = happyShift action_37 -action_185 (131#) = happyShift action_38 -action_185 (134#) = happyShift action_39 -action_185 (137#) = happyShift action_40 -action_185 (140#) = happyShift action_41 -action_185 (145#) = happyShift action_42 -action_185 (156#) = happyShift action_43 -action_185 (157#) = happyShift action_44 -action_185 (161#) = happyShift action_45 -action_185 (162#) = happyShift action_46 -action_185 (167#) = happyShift action_47 -action_185 (170#) = happyShift action_6 -action_185 (171#) = happyShift action_48 -action_185 (172#) = happyShift action_49 -action_185 (173#) = happyShift action_50 -action_185 (174#) = happyShift action_51 -action_185 (8#) = happyGoto action_10 -action_185 (9#) = happyGoto action_11 -action_185 (10#) = happyGoto action_12 -action_185 (11#) = happyGoto action_13 -action_185 (12#) = happyGoto action_14 -action_185 (58#) = happyGoto action_15 -action_185 (59#) = happyGoto action_16 -action_185 (60#) = happyGoto action_17 -action_185 (61#) = happyGoto action_18 -action_185 (62#) = happyGoto action_19 -action_185 (63#) = happyGoto action_316 -action_185 (64#) = happyGoto action_21 -action_185 (72#) = happyGoto action_22 -action_185 (77#) = happyGoto action_23 -action_185 x = happyTcHack x happyFail +action_185 (110#) = happyShift action_319 +action_185 x = happyTcHack x happyReduce_254 -action_186 (121#) = happyShift action_100 -action_186 (174#) = happyShift action_51 -action_186 (12#) = happyGoto action_96 -action_186 (75#) = happyGoto action_97 -action_186 (76#) = happyGoto action_315 -action_186 x = happyTcHack x happyReduce_236 +action_186 (169#) = happyShift action_318 +action_186 x = happyTcHack x happyFail -action_187 (96#) = happyShift action_314 -action_187 x = happyTcHack x happyFail +action_187 x = happyTcHack x happyReduce_190 -action_188 (96#) = happyShift action_106 -action_188 (98#) = happyShift action_107 -action_188 (104#) = happyShift action_108 -action_188 (110#) = happyShift action_109 -action_188 (111#) = happyShift action_110 -action_188 (114#) = happyShift action_111 -action_188 (121#) = happyShift action_112 -action_188 (170#) = happyShift action_6 -action_188 (171#) = happyShift action_48 -action_188 (172#) = happyShift action_49 -action_188 (174#) = happyShift action_51 -action_188 (8#) = happyGoto action_101 -action_188 (9#) = happyGoto action_102 -action_188 (10#) = happyGoto action_103 -action_188 (12#) = happyGoto action_104 -action_188 (67#) = happyGoto action_188 -action_188 (74#) = happyGoto action_313 -action_188 x = happyTcHack x happyReduce_232 +action_188 (169#) = happyShift action_317 +action_188 x = happyTcHack x happyFail -action_189 (101#) = happyShift action_312 +action_189 (95#) = happyShift action_21 +action_189 (97#) = happyShift action_22 +action_189 (98#) = happyShift action_23 +action_189 (111#) = happyShift action_24 +action_189 (115#) = happyShift action_25 +action_189 (117#) = happyShift action_26 +action_189 (118#) = happyShift action_27 +action_189 (119#) = happyShift action_28 +action_189 (120#) = happyShift action_29 +action_189 (121#) = happyShift action_30 +action_189 (122#) = happyShift action_31 +action_189 (123#) = happyShift action_32 +action_189 (124#) = happyShift action_33 +action_189 (128#) = happyShift action_34 +action_189 (131#) = happyShift action_35 +action_189 (134#) = happyShift action_36 +action_189 (137#) = happyShift action_37 +action_189 (142#) = happyShift action_38 +action_189 (153#) = happyShift action_39 +action_189 (154#) = happyShift action_40 +action_189 (158#) = happyShift action_41 +action_189 (159#) = happyShift action_42 +action_189 (164#) = happyShift action_43 +action_189 (167#) = happyShift action_44 +action_189 (170#) = happyShift action_6 +action_189 (171#) = happyShift action_45 +action_189 (172#) = happyShift action_46 +action_189 (173#) = happyShift action_47 +action_189 (174#) = happyShift action_48 +action_189 (8#) = happyGoto action_7 +action_189 (9#) = happyGoto action_8 +action_189 (10#) = happyGoto action_9 +action_189 (11#) = happyGoto action_10 +action_189 (12#) = happyGoto action_11 +action_189 (58#) = happyGoto action_12 +action_189 (59#) = happyGoto action_13 +action_189 (60#) = happyGoto action_14 +action_189 (61#) = happyGoto action_15 +action_189 (62#) = happyGoto action_16 +action_189 (63#) = happyGoto action_316 +action_189 (64#) = happyGoto action_18 +action_189 (72#) = happyGoto action_19 +action_189 (77#) = happyGoto action_20 action_189 x = happyTcHack x happyFail -action_190 (94#) = happyShift action_311 -action_190 x = happyTcHack x happyReduce_254 +action_190 (174#) = happyShift action_48 +action_190 (12#) = happyGoto action_92 +action_190 (53#) = happyGoto action_315 +action_190 x = happyTcHack x happyFail -action_191 (97#) = happyShift action_310 +action_191 (110#) = happyShift action_314 action_191 x = happyTcHack x happyFail -action_192 x = happyTcHack x happyReduce_190 +action_192 (110#) = happyShift action_313 +action_192 x = happyTcHack x happyReduce_194 -action_193 (97#) = happyShift action_309 +action_193 (169#) = happyShift action_312 action_193 x = happyTcHack x happyFail -action_194 (96#) = happyShift action_24 -action_194 (98#) = happyShift action_25 -action_194 (104#) = happyShift action_26 -action_194 (109#) = happyShift action_27 -action_194 (110#) = happyShift action_28 -action_194 (111#) = happyShift action_29 -action_194 (114#) = happyShift action_30 -action_194 (119#) = happyShift action_31 -action_194 (124#) = happyShift action_32 -action_194 (125#) = happyShift action_33 -action_194 (126#) = happyShift action_34 -action_194 (127#) = happyShift action_35 -action_194 (128#) = happyShift action_36 -action_194 (129#) = happyShift action_37 -action_194 (131#) = happyShift action_38 -action_194 (134#) = happyShift action_39 -action_194 (137#) = happyShift action_40 -action_194 (140#) = happyShift action_41 -action_194 (145#) = happyShift action_42 -action_194 (156#) = happyShift action_43 -action_194 (157#) = happyShift action_44 -action_194 (161#) = happyShift action_45 -action_194 (162#) = happyShift action_46 -action_194 (167#) = happyShift action_47 +action_194 (95#) = happyShift action_120 +action_194 (98#) = happyShift action_121 +action_194 (104#) = happyShift action_190 +action_194 (107#) = happyShift action_310 +action_194 (109#) = happyReduce_128 +action_194 (111#) = happyShift action_122 +action_194 (112#) = happyReduce_128 +action_194 (115#) = happyShift action_123 +action_194 (116#) = happyShift action_311 +action_194 (123#) = happyShift action_124 +action_194 (126#) = happyShift action_125 +action_194 (167#) = happyShift action_126 +action_194 (169#) = happyShift action_207 action_194 (170#) = happyShift action_6 -action_194 (171#) = happyShift action_48 -action_194 (172#) = happyShift action_49 -action_194 (173#) = happyShift action_50 -action_194 (174#) = happyShift action_51 -action_194 (8#) = happyGoto action_10 -action_194 (9#) = happyGoto action_11 -action_194 (10#) = happyGoto action_12 -action_194 (11#) = happyGoto action_13 -action_194 (12#) = happyGoto action_14 -action_194 (58#) = happyGoto action_15 -action_194 (59#) = happyGoto action_16 -action_194 (60#) = happyGoto action_17 -action_194 (61#) = happyGoto action_18 -action_194 (62#) = happyGoto action_19 -action_194 (63#) = happyGoto action_308 -action_194 (64#) = happyGoto action_21 -action_194 (72#) = happyGoto action_22 -action_194 (77#) = happyGoto action_23 -action_194 x = happyTcHack x happyFail +action_194 (171#) = happyShift action_45 +action_194 (172#) = happyShift action_46 +action_194 (174#) = happyShift action_48 +action_194 (8#) = happyGoto action_115 +action_194 (9#) = happyGoto action_116 +action_194 (10#) = happyGoto action_117 +action_194 (12#) = happyGoto action_118 +action_194 (67#) = happyGoto action_183 +action_194 (74#) = happyGoto action_309 +action_194 x = happyTcHack x happyReduce_203 -action_195 (174#) = happyShift action_51 -action_195 (12#) = happyGoto action_87 -action_195 (53#) = happyGoto action_88 -action_195 (56#) = happyGoto action_89 -action_195 (57#) = happyGoto action_307 -action_195 x = happyTcHack x happyReduce_137 +action_195 (102#) = happyShift action_306 +action_195 (113#) = happyShift action_307 +action_195 (168#) = happyShift action_308 +action_195 x = happyTcHack x happyFail -action_196 (96#) = happyShift action_24 -action_196 (98#) = happyShift action_25 -action_196 (104#) = happyShift action_26 -action_196 (109#) = happyShift action_27 -action_196 (110#) = happyShift action_28 -action_196 (111#) = happyShift action_29 -action_196 (114#) = happyShift action_30 -action_196 (119#) = happyShift action_31 -action_196 (124#) = happyShift action_32 -action_196 (125#) = happyShift action_33 -action_196 (126#) = happyShift action_34 -action_196 (127#) = happyShift action_35 -action_196 (128#) = happyShift action_36 -action_196 (129#) = happyShift action_37 -action_196 (131#) = happyShift action_38 -action_196 (134#) = happyShift action_39 -action_196 (137#) = happyShift action_40 -action_196 (140#) = happyShift action_41 -action_196 (145#) = happyShift action_42 -action_196 (156#) = happyShift action_43 -action_196 (157#) = happyShift action_44 -action_196 (161#) = happyShift action_45 -action_196 (162#) = happyShift action_46 -action_196 (167#) = happyShift action_47 -action_196 (170#) = happyShift action_6 -action_196 (171#) = happyShift action_48 -action_196 (172#) = happyShift action_49 -action_196 (173#) = happyShift action_50 -action_196 (174#) = happyShift action_51 -action_196 (8#) = happyGoto action_10 -action_196 (9#) = happyGoto action_11 -action_196 (10#) = happyGoto action_12 -action_196 (11#) = happyGoto action_13 -action_196 (12#) = happyGoto action_14 -action_196 (58#) = happyGoto action_15 -action_196 (59#) = happyGoto action_16 -action_196 (60#) = happyGoto action_17 -action_196 (61#) = happyGoto action_18 -action_196 (62#) = happyGoto action_19 -action_196 (63#) = happyGoto action_306 -action_196 (64#) = happyGoto action_21 -action_196 (72#) = happyGoto action_22 -action_196 (77#) = happyGoto action_23 -action_196 x = happyTcHack x happyFail +action_196 (110#) = happyShift action_305 +action_196 x = happyTcHack x happyReduce_250 -action_197 (96#) = happyShift action_24 -action_197 (98#) = happyShift action_25 -action_197 (104#) = happyShift action_26 -action_197 (109#) = happyShift action_27 -action_197 (110#) = happyShift action_28 -action_197 (111#) = happyShift action_29 -action_197 (114#) = happyShift action_30 -action_197 (119#) = happyShift action_31 -action_197 (124#) = happyShift action_32 -action_197 (125#) = happyShift action_33 -action_197 (126#) = happyShift action_34 -action_197 (127#) = happyShift action_35 -action_197 (128#) = happyShift action_36 -action_197 (129#) = happyShift action_37 -action_197 (131#) = happyShift action_38 -action_197 (134#) = happyShift action_39 -action_197 (137#) = happyShift action_40 -action_197 (140#) = happyShift action_41 -action_197 (145#) = happyShift action_42 -action_197 (156#) = happyShift action_43 -action_197 (157#) = happyShift action_44 -action_197 (161#) = happyShift action_45 -action_197 (162#) = happyShift action_46 -action_197 (167#) = happyShift action_47 -action_197 (170#) = happyShift action_6 -action_197 (171#) = happyShift action_48 -action_197 (172#) = happyShift action_49 -action_197 (173#) = happyShift action_50 -action_197 (174#) = happyShift action_51 -action_197 (8#) = happyGoto action_10 -action_197 (9#) = happyGoto action_11 -action_197 (10#) = happyGoto action_12 -action_197 (11#) = happyGoto action_13 -action_197 (12#) = happyGoto action_14 -action_197 (58#) = happyGoto action_15 -action_197 (59#) = happyGoto action_16 -action_197 (60#) = happyGoto action_17 -action_197 (61#) = happyGoto action_18 -action_197 (62#) = happyGoto action_19 -action_197 (63#) = happyGoto action_305 -action_197 (64#) = happyGoto action_21 -action_197 (72#) = happyGoto action_22 -action_197 (77#) = happyGoto action_23 +action_197 (169#) = happyShift action_304 action_197 x = happyTcHack x happyFail -action_198 (94#) = happyShift action_304 +action_198 (97#) = happyShift action_168 action_198 x = happyTcHack x happyFail -action_199 (94#) = happyShift action_303 -action_199 x = happyTcHack x happyReduce_194 +action_199 (95#) = happyShift action_21 +action_199 (97#) = happyShift action_22 +action_199 (98#) = happyShift action_23 +action_199 (111#) = happyShift action_24 +action_199 (115#) = happyShift action_25 +action_199 (117#) = happyShift action_26 +action_199 (118#) = happyShift action_27 +action_199 (119#) = happyShift action_28 +action_199 (120#) = happyShift action_29 +action_199 (121#) = happyShift action_30 +action_199 (122#) = happyShift action_31 +action_199 (123#) = happyShift action_32 +action_199 (124#) = happyShift action_33 +action_199 (128#) = happyShift action_34 +action_199 (131#) = happyShift action_35 +action_199 (134#) = happyShift action_36 +action_199 (137#) = happyShift action_37 +action_199 (142#) = happyShift action_38 +action_199 (153#) = happyShift action_39 +action_199 (154#) = happyShift action_40 +action_199 (158#) = happyShift action_41 +action_199 (159#) = happyShift action_42 +action_199 (164#) = happyShift action_43 +action_199 (167#) = happyShift action_44 +action_199 (170#) = happyShift action_6 +action_199 (171#) = happyShift action_45 +action_199 (172#) = happyShift action_46 +action_199 (173#) = happyShift action_47 +action_199 (174#) = happyShift action_48 +action_199 (8#) = happyGoto action_7 +action_199 (9#) = happyGoto action_8 +action_199 (10#) = happyGoto action_9 +action_199 (11#) = happyGoto action_10 +action_199 (12#) = happyGoto action_11 +action_199 (58#) = happyGoto action_12 +action_199 (59#) = happyGoto action_13 +action_199 (60#) = happyGoto action_14 +action_199 (61#) = happyGoto action_15 +action_199 (62#) = happyGoto action_16 +action_199 (63#) = happyGoto action_192 +action_199 (64#) = happyGoto action_18 +action_199 (65#) = happyGoto action_303 +action_199 (72#) = happyGoto action_19 +action_199 (77#) = happyGoto action_20 +action_199 x = happyTcHack x happyReduce_193 -action_200 (97#) = happyShift action_302 +action_200 (95#) = happyShift action_120 +action_200 (98#) = happyShift action_121 +action_200 (105#) = happyShift action_164 +action_200 (111#) = happyShift action_122 +action_200 (115#) = happyShift action_123 +action_200 (123#) = happyShift action_124 +action_200 (126#) = happyShift action_125 +action_200 (167#) = happyShift action_126 +action_200 (170#) = happyShift action_6 +action_200 (171#) = happyShift action_45 +action_200 (172#) = happyShift action_46 +action_200 (174#) = happyShift action_48 +action_200 (8#) = happyGoto action_115 +action_200 (9#) = happyGoto action_116 +action_200 (10#) = happyGoto action_117 +action_200 (12#) = happyGoto action_158 +action_200 (67#) = happyGoto action_159 +action_200 (68#) = happyGoto action_160 +action_200 (69#) = happyGoto action_195 +action_200 (82#) = happyGoto action_196 +action_200 (83#) = happyGoto action_302 action_200 x = happyTcHack x happyFail -action_201 (109#) = happyShift action_165 +action_201 (169#) = happyShift action_301 action_201 x = happyTcHack x happyFail -action_202 (96#) = happyShift action_106 -action_202 (97#) = happyShift action_155 -action_202 (98#) = happyShift action_107 -action_202 (103#) = happyShift action_156 -action_202 (104#) = happyShift action_108 -action_202 (107#) = happyShift action_300 -action_202 (108#) = happyReduce_203 -action_202 (110#) = happyShift action_109 -action_202 (111#) = happyShift action_110 -action_202 (113#) = happyShift action_301 -action_202 (114#) = happyShift action_111 -action_202 (116#) = happyReduce_203 -action_202 (117#) = happyReduce_203 -action_202 (120#) = happyReduce_203 -action_202 (121#) = happyShift action_112 -action_202 (170#) = happyShift action_6 -action_202 (171#) = happyShift action_48 -action_202 (172#) = happyShift action_49 -action_202 (174#) = happyShift action_51 -action_202 (8#) = happyGoto action_101 -action_202 (9#) = happyGoto action_102 -action_202 (10#) = happyGoto action_103 -action_202 (12#) = happyGoto action_104 -action_202 (67#) = happyGoto action_188 -action_202 (74#) = happyGoto action_299 -action_202 x = happyTcHack x happyReduce_128 +action_202 x = happyTcHack x happyReduce_152 -action_203 (108#) = happyShift action_296 -action_203 (117#) = happyShift action_297 -action_203 (120#) = happyShift action_298 -action_203 x = happyTcHack x happyFail +action_203 (174#) = happyShift action_48 +action_203 (12#) = happyGoto action_92 +action_203 (53#) = happyGoto action_80 +action_203 (56#) = happyGoto action_81 +action_203 (57#) = happyGoto action_300 +action_203 x = happyTcHack x happyReduce_137 -action_204 (94#) = happyShift action_295 -action_204 x = happyTcHack x happyReduce_250 +action_204 (95#) = happyShift action_21 +action_204 (97#) = happyShift action_22 +action_204 (98#) = happyShift action_23 +action_204 (111#) = happyShift action_24 +action_204 (115#) = happyShift action_25 +action_204 (117#) = happyShift action_26 +action_204 (118#) = happyShift action_27 +action_204 (119#) = happyShift action_28 +action_204 (120#) = happyShift action_29 +action_204 (121#) = happyShift action_30 +action_204 (122#) = happyShift action_31 +action_204 (123#) = happyShift action_32 +action_204 (124#) = happyShift action_33 +action_204 (128#) = happyShift action_34 +action_204 (131#) = happyShift action_35 +action_204 (134#) = happyShift action_36 +action_204 (137#) = happyShift action_37 +action_204 (142#) = happyShift action_38 +action_204 (153#) = happyShift action_39 +action_204 (154#) = happyShift action_40 +action_204 (158#) = happyShift action_41 +action_204 (159#) = happyShift action_42 +action_204 (164#) = happyShift action_43 +action_204 (167#) = happyShift action_44 +action_204 (170#) = happyShift action_6 +action_204 (171#) = happyShift action_45 +action_204 (172#) = happyShift action_46 +action_204 (173#) = happyShift action_47 +action_204 (174#) = happyShift action_48 +action_204 (8#) = happyGoto action_7 +action_204 (9#) = happyGoto action_8 +action_204 (10#) = happyGoto action_9 +action_204 (11#) = happyGoto action_10 +action_204 (12#) = happyGoto action_11 +action_204 (58#) = happyGoto action_12 +action_204 (59#) = happyGoto action_13 +action_204 (60#) = happyGoto action_14 +action_204 (61#) = happyGoto action_15 +action_204 (62#) = happyGoto action_16 +action_204 (63#) = happyGoto action_299 +action_204 (64#) = happyGoto action_18 +action_204 (72#) = happyGoto action_19 +action_204 (77#) = happyGoto action_20 +action_204 x = happyTcHack x happyFail -action_205 (97#) = happyShift action_294 +action_205 (95#) = happyShift action_21 +action_205 (97#) = happyShift action_22 +action_205 (98#) = happyShift action_23 +action_205 (111#) = happyShift action_24 +action_205 (115#) = happyShift action_25 +action_205 (117#) = happyShift action_26 +action_205 (118#) = happyShift action_27 +action_205 (119#) = happyShift action_28 +action_205 (120#) = happyShift action_29 +action_205 (121#) = happyShift action_30 +action_205 (122#) = happyShift action_31 +action_205 (123#) = happyShift action_32 +action_205 (124#) = happyShift action_33 +action_205 (128#) = happyShift action_34 +action_205 (131#) = happyShift action_35 +action_205 (134#) = happyShift action_36 +action_205 (137#) = happyShift action_37 +action_205 (142#) = happyShift action_38 +action_205 (153#) = happyShift action_39 +action_205 (154#) = happyShift action_40 +action_205 (158#) = happyShift action_41 +action_205 (159#) = happyShift action_42 +action_205 (164#) = happyShift action_43 +action_205 (167#) = happyShift action_44 +action_205 (170#) = happyShift action_6 +action_205 (171#) = happyShift action_45 +action_205 (172#) = happyShift action_46 +action_205 (173#) = happyShift action_47 +action_205 (174#) = happyShift action_48 +action_205 (8#) = happyGoto action_7 +action_205 (9#) = happyGoto action_8 +action_205 (10#) = happyGoto action_9 +action_205 (11#) = happyGoto action_10 +action_205 (12#) = happyGoto action_11 +action_205 (58#) = happyGoto action_12 +action_205 (59#) = happyGoto action_13 +action_205 (60#) = happyGoto action_14 +action_205 (61#) = happyGoto action_15 +action_205 (62#) = happyGoto action_16 +action_205 (63#) = happyGoto action_298 +action_205 (64#) = happyGoto action_18 +action_205 (72#) = happyGoto action_19 +action_205 (77#) = happyGoto action_20 action_205 x = happyTcHack x happyFail -action_206 (96#) = happyShift action_106 -action_206 (98#) = happyShift action_107 -action_206 (104#) = happyShift action_108 -action_206 (106#) = happyShift action_176 -action_206 (110#) = happyShift action_109 -action_206 (111#) = happyShift action_110 -action_206 (114#) = happyShift action_111 -action_206 (121#) = happyShift action_112 -action_206 (170#) = happyShift action_6 -action_206 (171#) = happyShift action_48 -action_206 (172#) = happyShift action_49 -action_206 (174#) = happyShift action_51 -action_206 (8#) = happyGoto action_101 -action_206 (9#) = happyGoto action_102 -action_206 (10#) = happyGoto action_103 -action_206 (12#) = happyGoto action_170 -action_206 (67#) = happyGoto action_171 -action_206 (68#) = happyGoto action_172 -action_206 (69#) = happyGoto action_203 -action_206 (82#) = happyGoto action_204 -action_206 (83#) = happyGoto action_293 +action_206 (174#) = happyShift action_48 +action_206 (12#) = happyGoto action_297 action_206 x = happyTcHack x happyFail -action_207 (96#) = happyShift action_24 -action_207 (98#) = happyShift action_25 -action_207 (104#) = happyShift action_26 -action_207 (109#) = happyShift action_27 -action_207 (110#) = happyShift action_28 -action_207 (111#) = happyShift action_29 -action_207 (114#) = happyShift action_30 -action_207 (119#) = happyShift action_31 -action_207 (124#) = happyShift action_32 -action_207 (125#) = happyShift action_33 -action_207 (126#) = happyShift action_34 -action_207 (127#) = happyShift action_35 -action_207 (128#) = happyShift action_36 -action_207 (129#) = happyShift action_37 -action_207 (131#) = happyShift action_38 -action_207 (134#) = happyShift action_39 -action_207 (137#) = happyShift action_40 -action_207 (140#) = happyShift action_41 -action_207 (145#) = happyShift action_42 -action_207 (156#) = happyShift action_43 -action_207 (157#) = happyShift action_44 -action_207 (161#) = happyShift action_45 -action_207 (162#) = happyShift action_46 -action_207 (167#) = happyShift action_47 -action_207 (170#) = happyShift action_6 -action_207 (171#) = happyShift action_48 -action_207 (172#) = happyShift action_49 -action_207 (173#) = happyShift action_50 -action_207 (174#) = happyShift action_51 -action_207 (8#) = happyGoto action_10 -action_207 (9#) = happyGoto action_11 -action_207 (10#) = happyGoto action_12 -action_207 (11#) = happyGoto action_13 -action_207 (12#) = happyGoto action_14 -action_207 (58#) = happyGoto action_15 -action_207 (59#) = happyGoto action_16 -action_207 (60#) = happyGoto action_17 -action_207 (61#) = happyGoto action_18 -action_207 (62#) = happyGoto action_19 -action_207 (63#) = happyGoto action_199 -action_207 (64#) = happyGoto action_21 -action_207 (65#) = happyGoto action_292 -action_207 (72#) = happyGoto action_22 -action_207 (77#) = happyGoto action_23 -action_207 x = happyTcHack x happyReduce_193 +action_207 x = happyTcHack x happyReduce_141 -action_208 (97#) = happyShift action_291 -action_208 x = happyTcHack x happyFail +action_208 (1#) = happyReduce_65 +action_208 (101#) = happyReduce_65 +action_208 (148#) = happyReduce_51 +action_208 (157#) = happyShift action_295 +action_208 (162#) = happyShift action_296 +action_208 (174#) = happyShift action_48 +action_208 (12#) = happyGoto action_241 +action_208 (22#) = happyGoto action_291 +action_208 (26#) = happyGoto action_292 +action_208 (32#) = happyGoto action_293 +action_208 (33#) = happyGoto action_294 +action_208 x = happyTcHack x happyReduce_65 action_209 x = happyTcHack x happyReduce_49 -action_210 (104#) = happyShift action_290 -action_210 (174#) = happyShift action_51 +action_210 (123#) = happyShift action_290 +action_210 (174#) = happyShift action_48 action_210 (12#) = happyGoto action_287 action_210 (36#) = happyGoto action_288 action_210 (46#) = happyGoto action_289 action_210 x = happyTcHack x happyFail -action_211 (174#) = happyShift action_51 +action_211 (174#) = happyShift action_48 action_211 (12#) = happyGoto action_283 action_211 (37#) = happyGoto action_276 action_211 (38#) = happyGoto action_284 @@ -3111,8 +3109,8 @@ action_211 (48#) = happyGoto action_286 action_211 (53#) = happyGoto action_278 action_211 x = happyTcHack x happyFail -action_212 (104#) = happyShift action_257 -action_212 (174#) = happyShift action_51 +action_212 (123#) = happyShift action_257 +action_212 (174#) = happyShift action_48 action_212 (12#) = happyGoto action_252 action_212 (34#) = happyGoto action_253 action_212 (45#) = happyGoto action_282 @@ -3120,21 +3118,21 @@ action_212 (54#) = happyGoto action_255 action_212 (55#) = happyGoto action_256 action_212 x = happyTcHack x happyFail -action_213 (174#) = happyShift action_51 +action_213 (174#) = happyShift action_48 action_213 (12#) = happyGoto action_279 action_213 (44#) = happyGoto action_280 action_213 (51#) = happyGoto action_281 action_213 x = happyTcHack x happyFail -action_214 (174#) = happyShift action_51 -action_214 (12#) = happyGoto action_87 +action_214 (174#) = happyShift action_48 +action_214 (12#) = happyGoto action_92 action_214 (37#) = happyGoto action_276 action_214 (47#) = happyGoto action_277 action_214 (53#) = happyGoto action_278 action_214 x = happyTcHack x happyFail -action_215 (104#) = happyShift action_257 -action_215 (174#) = happyShift action_51 +action_215 (123#) = happyShift action_257 +action_215 (174#) = happyShift action_48 action_215 (12#) = happyGoto action_252 action_215 (34#) = happyGoto action_253 action_215 (45#) = happyGoto action_275 @@ -3142,8 +3140,8 @@ action_215 (54#) = happyGoto action_255 action_215 (55#) = happyGoto action_256 action_215 x = happyTcHack x happyFail -action_216 (104#) = happyShift action_257 -action_216 (174#) = happyShift action_51 +action_216 (123#) = happyShift action_257 +action_216 (174#) = happyShift action_48 action_216 (12#) = happyGoto action_252 action_216 (43#) = happyGoto action_260 action_216 (50#) = happyGoto action_274 @@ -3151,8 +3149,8 @@ action_216 (54#) = happyGoto action_262 action_216 (55#) = happyGoto action_263 action_216 x = happyTcHack x happyFail -action_217 (104#) = happyShift action_257 -action_217 (174#) = happyShift action_51 +action_217 (123#) = happyShift action_257 +action_217 (174#) = happyShift action_48 action_217 (12#) = happyGoto action_252 action_217 (34#) = happyGoto action_253 action_217 (45#) = happyGoto action_273 @@ -3160,8 +3158,8 @@ action_217 (54#) = happyGoto action_255 action_217 (55#) = happyGoto action_256 action_217 x = happyTcHack x happyFail -action_218 (104#) = happyShift action_257 -action_218 (174#) = happyShift action_51 +action_218 (123#) = happyShift action_257 +action_218 (174#) = happyShift action_48 action_218 (12#) = happyGoto action_252 action_218 (34#) = happyGoto action_253 action_218 (45#) = happyGoto action_272 @@ -3169,8 +3167,8 @@ action_218 (54#) = happyGoto action_255 action_218 (55#) = happyGoto action_256 action_218 x = happyTcHack x happyFail -action_219 (104#) = happyShift action_257 -action_219 (174#) = happyShift action_51 +action_219 (123#) = happyShift action_257 +action_219 (174#) = happyShift action_48 action_219 (12#) = happyGoto action_252 action_219 (34#) = happyGoto action_253 action_219 (45#) = happyGoto action_271 @@ -3178,18 +3176,18 @@ action_219 (54#) = happyGoto action_255 action_219 (55#) = happyGoto action_256 action_219 x = happyTcHack x happyFail -action_220 (174#) = happyShift action_51 +action_220 (174#) = happyShift action_48 action_220 (12#) = happyGoto action_270 action_220 x = happyTcHack x happyFail -action_221 (174#) = happyShift action_51 +action_221 (174#) = happyShift action_48 action_221 (12#) = happyGoto action_267 action_221 (41#) = happyGoto action_268 action_221 (49#) = happyGoto action_269 action_221 x = happyTcHack x happyFail -action_222 (104#) = happyShift action_257 -action_222 (174#) = happyShift action_51 +action_222 (123#) = happyShift action_257 +action_222 (174#) = happyShift action_48 action_222 (12#) = happyGoto action_252 action_222 (34#) = happyGoto action_253 action_222 (45#) = happyGoto action_266 @@ -3197,10 +3195,10 @@ action_222 (54#) = happyGoto action_255 action_222 (55#) = happyGoto action_256 action_222 x = happyTcHack x happyFail -action_223 (104#) = happyShift action_257 -action_223 (132#) = happyShift action_264 -action_223 (138#) = happyShift action_265 -action_223 (174#) = happyShift action_51 +action_223 (123#) = happyShift action_257 +action_223 (129#) = happyShift action_264 +action_223 (135#) = happyShift action_265 +action_223 (174#) = happyShift action_48 action_223 (12#) = happyGoto action_252 action_223 (43#) = happyGoto action_260 action_223 (50#) = happyGoto action_261 @@ -3208,12 +3206,12 @@ action_223 (54#) = happyGoto action_262 action_223 (55#) = happyGoto action_263 action_223 x = happyTcHack x happyFail -action_224 (174#) = happyShift action_51 +action_224 (174#) = happyShift action_48 action_224 (12#) = happyGoto action_259 action_224 x = happyTcHack x happyFail -action_225 (104#) = happyShift action_257 -action_225 (174#) = happyShift action_51 +action_225 (123#) = happyShift action_257 +action_225 (174#) = happyShift action_48 action_225 (12#) = happyGoto action_252 action_225 (34#) = happyGoto action_253 action_225 (45#) = happyGoto action_258 @@ -3221,8 +3219,8 @@ action_225 (54#) = happyGoto action_255 action_225 (55#) = happyGoto action_256 action_225 x = happyTcHack x happyFail -action_226 (104#) = happyShift action_257 -action_226 (174#) = happyShift action_51 +action_226 (123#) = happyShift action_257 +action_226 (174#) = happyShift action_48 action_226 (12#) = happyGoto action_252 action_226 (34#) = happyGoto action_253 action_226 (45#) = happyGoto action_254 @@ -3236,11 +3234,11 @@ action_228 x = happyTcHack x happyReduce_270 action_229 x = happyTcHack x happyReduce_271 -action_230 (106#) = happyShift action_74 +action_230 (105#) = happyShift action_74 action_230 (107#) = happyShift action_75 -action_230 (123#) = happyShift action_76 -action_230 (171#) = happyShift action_48 -action_230 (174#) = happyShift action_51 +action_230 (108#) = happyShift action_76 +action_230 (171#) = happyShift action_45 +action_230 (174#) = happyShift action_48 action_230 (9#) = happyGoto action_70 action_230 (12#) = happyGoto action_71 action_230 (92#) = happyGoto action_72 @@ -3249,26 +3247,26 @@ action_230 x = happyTcHack x happyReduce_273 action_231 x = happyTcHack x happyReduce_272 -action_232 (100#) = happyShift action_250 +action_232 (109#) = happyShift action_250 action_232 x = happyTcHack x happyFail action_233 x = happyTcHack x happyReduce_35 action_234 x = happyTcHack x happyReduce_36 -action_235 (150#) = happyShift action_249 +action_235 (147#) = happyShift action_249 action_235 x = happyTcHack x happyFail -action_236 (150#) = happyShift action_248 +action_236 (147#) = happyShift action_248 action_236 x = happyTcHack x happyFail action_237 x = happyTcHack x happyReduce_34 -action_238 (96#) = happyReduce_51 -action_238 (151#) = happyReduce_51 -action_238 (160#) = happyShift action_246 -action_238 (165#) = happyShift action_247 -action_238 (174#) = happyShift action_51 +action_238 (148#) = happyReduce_51 +action_238 (157#) = happyShift action_246 +action_238 (162#) = happyShift action_247 +action_238 (167#) = happyReduce_51 +action_238 (174#) = happyShift action_48 action_238 (12#) = happyGoto action_241 action_238 (24#) = happyGoto action_242 action_238 (26#) = happyGoto action_243 @@ -3276,49 +3274,49 @@ action_238 (32#) = happyGoto action_244 action_238 (33#) = happyGoto action_245 action_238 x = happyTcHack x happyReduce_65 -action_239 (96#) = happyShift action_240 +action_239 (167#) = happyShift action_240 action_239 x = happyTcHack x happyFail -action_240 (130#) = happyShift action_418 +action_240 (127#) = happyShift action_418 action_240 x = happyTcHack x happyFail -action_241 (104#) = happyShift action_416 -action_241 (106#) = happyShift action_417 +action_241 (105#) = happyShift action_416 +action_241 (123#) = happyShift action_417 action_241 x = happyTcHack x happyReduce_68 action_242 x = happyTcHack x happyReduce_15 -action_243 (151#) = happyShift action_356 +action_243 (148#) = happyShift action_382 action_243 (28#) = happyGoto action_415 action_243 x = happyTcHack x happyReduce_55 -action_244 (102#) = happyShift action_414 +action_244 (101#) = happyShift action_414 action_244 x = happyTcHack x happyReduce_41 -action_245 (103#) = happyShift action_352 -action_245 (169#) = happyShift action_413 +action_245 (104#) = happyShift action_378 +action_245 (166#) = happyShift action_413 action_245 x = happyTcHack x happyReduce_66 -action_246 (174#) = happyShift action_51 +action_246 (174#) = happyShift action_48 action_246 (12#) = happyGoto action_412 action_246 x = happyTcHack x happyFail -action_247 (174#) = happyShift action_51 +action_247 (174#) = happyShift action_48 action_247 (12#) = happyGoto action_241 action_247 (32#) = happyGoto action_411 -action_247 (33#) = happyGoto action_350 +action_247 (33#) = happyGoto action_376 action_247 x = happyTcHack x happyReduce_65 -action_248 (174#) = happyShift action_51 +action_248 (174#) = happyShift action_48 action_248 (12#) = happyGoto action_410 action_248 x = happyTcHack x happyFail -action_249 (174#) = happyShift action_51 +action_249 (174#) = happyShift action_48 action_249 (12#) = happyGoto action_409 action_249 x = happyTcHack x happyFail action_250 (98#) = happyShift action_408 -action_250 (174#) = happyShift action_51 +action_250 (174#) = happyShift action_48 action_250 (12#) = happyGoto action_406 action_250 (29#) = happyGoto action_407 action_250 x = happyTcHack x happyFail @@ -3327,57 +3325,57 @@ action_251 x = happyTcHack x happyReduce_274 action_252 x = happyTcHack x happyReduce_130 -action_253 (94#) = happyShift action_405 +action_253 (110#) = happyShift action_405 action_253 x = happyTcHack x happyFail action_254 x = happyTcHack x happyReduce_93 -action_255 (96#) = happyShift action_106 -action_255 (98#) = happyShift action_107 -action_255 (103#) = happyShift action_398 -action_255 (104#) = happyShift action_108 -action_255 (110#) = happyShift action_109 -action_255 (111#) = happyShift action_110 -action_255 (114#) = happyShift action_111 -action_255 (121#) = happyShift action_112 +action_255 (95#) = happyShift action_120 +action_255 (98#) = happyShift action_121 +action_255 (104#) = happyShift action_398 +action_255 (111#) = happyShift action_122 +action_255 (115#) = happyShift action_123 +action_255 (123#) = happyShift action_124 +action_255 (126#) = happyShift action_125 +action_255 (167#) = happyShift action_126 action_255 (170#) = happyShift action_6 -action_255 (171#) = happyShift action_48 -action_255 (172#) = happyShift action_49 -action_255 (174#) = happyShift action_51 -action_255 (8#) = happyGoto action_101 -action_255 (9#) = happyGoto action_102 -action_255 (10#) = happyGoto action_103 -action_255 (12#) = happyGoto action_104 -action_255 (67#) = happyGoto action_188 +action_255 (171#) = happyShift action_45 +action_255 (172#) = happyShift action_46 +action_255 (174#) = happyShift action_48 +action_255 (8#) = happyGoto action_115 +action_255 (9#) = happyGoto action_116 +action_255 (10#) = happyGoto action_117 +action_255 (12#) = happyGoto action_118 +action_255 (67#) = happyGoto action_183 action_255 (74#) = happyGoto action_404 action_255 x = happyTcHack x happyReduce_132 -action_256 (95#) = happyShift action_402 -action_256 (100#) = happyShift action_403 +action_256 (109#) = happyShift action_402 +action_256 (112#) = happyShift action_403 action_256 x = happyTcHack x happyFail -action_257 (174#) = happyShift action_51 +action_257 (174#) = happyShift action_48 action_257 (12#) = happyGoto action_401 action_257 x = happyTcHack x happyFail action_258 x = happyTcHack x happyReduce_80 -action_259 (94#) = happyShift action_400 +action_259 (110#) = happyShift action_400 action_259 x = happyTcHack x happyFail -action_260 (94#) = happyShift action_399 +action_260 (110#) = happyShift action_399 action_260 x = happyTcHack x happyFail action_261 x = happyTcHack x happyReduce_89 -action_262 (103#) = happyShift action_398 +action_262 (104#) = happyShift action_398 action_262 x = happyTcHack x happyReduce_132 -action_263 (95#) = happyShift action_397 +action_263 (112#) = happyShift action_397 action_263 x = happyTcHack x happyFail -action_264 (104#) = happyShift action_257 -action_264 (174#) = happyShift action_51 +action_264 (123#) = happyShift action_257 +action_264 (174#) = happyShift action_48 action_264 (12#) = happyGoto action_252 action_264 (43#) = happyGoto action_260 action_264 (50#) = happyGoto action_396 @@ -3385,8 +3383,8 @@ action_264 (54#) = happyGoto action_262 action_264 (55#) = happyGoto action_263 action_264 x = happyTcHack x happyFail -action_265 (104#) = happyShift action_257 -action_265 (174#) = happyShift action_51 +action_265 (123#) = happyShift action_257 +action_265 (174#) = happyShift action_48 action_265 (12#) = happyGoto action_252 action_265 (43#) = happyGoto action_260 action_265 (50#) = happyGoto action_395 @@ -3396,15 +3394,15 @@ action_265 x = happyTcHack x happyFail action_266 x = happyTcHack x happyReduce_91 -action_267 (95#) = happyShift action_394 +action_267 (112#) = happyShift action_394 action_267 x = happyTcHack x happyReduce_107 -action_268 (94#) = happyShift action_393 +action_268 (110#) = happyShift action_393 action_268 x = happyTcHack x happyFail action_269 x = happyTcHack x happyReduce_81 -action_270 (95#) = happyShift action_392 +action_270 (112#) = happyShift action_392 action_270 x = happyTcHack x happyFail action_271 x = happyTcHack x happyReduce_82 @@ -3417,29 +3415,29 @@ action_274 x = happyTcHack x happyReduce_83 action_275 x = happyTcHack x happyReduce_85 -action_276 (94#) = happyShift action_391 +action_276 (110#) = happyShift action_391 action_276 x = happyTcHack x happyFail action_277 x = happyTcHack x happyReduce_76 -action_278 (100#) = happyShift action_390 +action_278 (109#) = happyShift action_390 action_278 x = happyTcHack x happyFail -action_279 (95#) = happyShift action_389 +action_279 (112#) = happyShift action_389 action_279 x = happyTcHack x happyFail -action_280 (94#) = happyShift action_388 +action_280 (110#) = happyShift action_388 action_280 x = happyTcHack x happyFail action_281 x = happyTcHack x happyReduce_88 action_282 x = happyTcHack x happyReduce_78 -action_283 (95#) = happyShift action_387 -action_283 (103#) = happyShift action_156 +action_283 (104#) = happyShift action_190 +action_283 (112#) = happyShift action_387 action_283 x = happyTcHack x happyReduce_128 -action_284 (94#) = happyShift action_386 +action_284 (110#) = happyShift action_386 action_284 x = happyTcHack x happyFail action_285 x = happyTcHack x happyReduce_77 @@ -3449,849 +3447,849 @@ action_286 x = happyTcHack x happyReduce_79 action_287 (89#) = happyGoto action_385 action_287 x = happyTcHack x happyReduce_262 -action_288 (94#) = happyShift action_384 +action_288 (110#) = happyShift action_384 action_288 x = happyTcHack x happyFail action_289 x = happyTcHack x happyReduce_75 -action_290 (174#) = happyShift action_51 +action_290 (174#) = happyShift action_48 action_290 (12#) = happyGoto action_383 action_290 x = happyTcHack x happyFail -action_291 x = happyTcHack x happyReduce_167 +action_291 x = happyTcHack x happyReduce_25 -action_292 (105#) = happyShift action_382 -action_292 x = happyTcHack x happyFail +action_292 (148#) = happyShift action_382 +action_292 (28#) = happyGoto action_381 +action_292 x = happyTcHack x happyReduce_55 -action_293 (97#) = happyShift action_381 -action_293 x = happyTcHack x happyFail +action_293 (101#) = happyShift action_380 +action_293 x = happyTcHack x happyReduce_27 -action_294 x = happyTcHack x happyReduce_163 +action_294 (104#) = happyShift action_378 +action_294 (166#) = happyShift action_379 +action_294 x = happyTcHack x happyReduce_66 -action_295 (96#) = happyShift action_106 -action_295 (98#) = happyShift action_107 -action_295 (104#) = happyShift action_108 -action_295 (106#) = happyShift action_176 -action_295 (110#) = happyShift action_109 -action_295 (111#) = happyShift action_110 -action_295 (114#) = happyShift action_111 -action_295 (121#) = happyShift action_112 -action_295 (170#) = happyShift action_6 -action_295 (171#) = happyShift action_48 -action_295 (172#) = happyShift action_49 -action_295 (174#) = happyShift action_51 -action_295 (8#) = happyGoto action_101 -action_295 (9#) = happyGoto action_102 -action_295 (10#) = happyGoto action_103 -action_295 (12#) = happyGoto action_170 -action_295 (67#) = happyGoto action_171 -action_295 (68#) = happyGoto action_172 -action_295 (69#) = happyGoto action_203 -action_295 (82#) = happyGoto action_204 -action_295 (83#) = happyGoto action_380 +action_295 (174#) = happyShift action_48 +action_295 (12#) = happyGoto action_377 action_295 x = happyTcHack x happyFail -action_296 (96#) = happyShift action_106 -action_296 (98#) = happyShift action_107 -action_296 (104#) = happyShift action_108 -action_296 (106#) = happyShift action_176 -action_296 (110#) = happyShift action_109 -action_296 (111#) = happyShift action_110 -action_296 (114#) = happyShift action_111 -action_296 (121#) = happyShift action_112 -action_296 (170#) = happyShift action_6 -action_296 (171#) = happyShift action_48 -action_296 (172#) = happyShift action_49 -action_296 (174#) = happyShift action_51 -action_296 (8#) = happyGoto action_101 -action_296 (9#) = happyGoto action_102 -action_296 (10#) = happyGoto action_103 -action_296 (12#) = happyGoto action_170 -action_296 (67#) = happyGoto action_171 -action_296 (68#) = happyGoto action_379 -action_296 x = happyTcHack x happyFail +action_296 (174#) = happyShift action_48 +action_296 (12#) = happyGoto action_241 +action_296 (32#) = happyGoto action_375 +action_296 (33#) = happyGoto action_376 +action_296 x = happyTcHack x happyReduce_65 -action_297 (96#) = happyShift action_106 -action_297 (98#) = happyShift action_107 -action_297 (104#) = happyShift action_108 -action_297 (106#) = happyShift action_176 -action_297 (110#) = happyShift action_109 -action_297 (111#) = happyShift action_110 -action_297 (114#) = happyShift action_111 -action_297 (121#) = happyShift action_112 -action_297 (170#) = happyShift action_6 -action_297 (171#) = happyShift action_48 -action_297 (172#) = happyShift action_49 -action_297 (174#) = happyShift action_51 -action_297 (8#) = happyGoto action_101 -action_297 (9#) = happyGoto action_102 -action_297 (10#) = happyGoto action_103 -action_297 (12#) = happyGoto action_170 -action_297 (67#) = happyGoto action_171 -action_297 (68#) = happyGoto action_378 +action_297 (169#) = happyShift action_374 action_297 x = happyTcHack x happyFail -action_298 (96#) = happyShift action_24 -action_298 (98#) = happyShift action_25 -action_298 (104#) = happyShift action_26 -action_298 (109#) = happyShift action_27 -action_298 (110#) = happyShift action_28 -action_298 (111#) = happyShift action_29 -action_298 (114#) = happyShift action_30 -action_298 (119#) = happyShift action_31 -action_298 (124#) = happyShift action_32 -action_298 (125#) = happyShift action_33 -action_298 (126#) = happyShift action_34 -action_298 (127#) = happyShift action_35 -action_298 (128#) = happyShift action_36 -action_298 (129#) = happyShift action_37 -action_298 (131#) = happyShift action_38 -action_298 (134#) = happyShift action_39 -action_298 (137#) = happyShift action_40 -action_298 (140#) = happyShift action_41 -action_298 (145#) = happyShift action_42 -action_298 (156#) = happyShift action_43 -action_298 (157#) = happyShift action_44 -action_298 (161#) = happyShift action_45 -action_298 (162#) = happyShift action_46 -action_298 (167#) = happyShift action_47 -action_298 (170#) = happyShift action_6 -action_298 (171#) = happyShift action_48 -action_298 (172#) = happyShift action_49 -action_298 (173#) = happyShift action_50 -action_298 (174#) = happyShift action_51 -action_298 (8#) = happyGoto action_10 -action_298 (9#) = happyGoto action_11 -action_298 (10#) = happyGoto action_12 -action_298 (11#) = happyGoto action_13 -action_298 (12#) = happyGoto action_14 -action_298 (58#) = happyGoto action_15 -action_298 (59#) = happyGoto action_16 -action_298 (60#) = happyGoto action_17 -action_298 (61#) = happyGoto action_18 -action_298 (62#) = happyGoto action_19 -action_298 (63#) = happyGoto action_377 -action_298 (64#) = happyGoto action_21 -action_298 (72#) = happyGoto action_22 -action_298 (77#) = happyGoto action_23 -action_298 x = happyTcHack x happyFail +action_298 x = happyTcHack x happyReduce_135 -action_299 x = happyTcHack x happyReduce_212 +action_299 (112#) = happyShift action_373 +action_299 x = happyTcHack x happyReduce_134 -action_300 (174#) = happyShift action_51 -action_300 (12#) = happyGoto action_376 -action_300 x = happyTcHack x happyFail +action_300 x = happyTcHack x happyReduce_139 -action_301 (96#) = happyShift action_106 -action_301 (98#) = happyShift action_107 -action_301 (104#) = happyShift action_108 -action_301 (110#) = happyShift action_109 -action_301 (111#) = happyShift action_110 -action_301 (114#) = happyShift action_111 -action_301 (121#) = happyShift action_112 -action_301 (170#) = happyShift action_6 -action_301 (171#) = happyShift action_48 -action_301 (172#) = happyShift action_49 -action_301 (174#) = happyShift action_51 -action_301 (8#) = happyGoto action_101 -action_301 (9#) = happyGoto action_102 -action_301 (10#) = happyGoto action_103 -action_301 (12#) = happyGoto action_104 -action_301 (67#) = happyGoto action_375 -action_301 x = happyTcHack x happyFail +action_301 x = happyTcHack x happyReduce_167 -action_302 x = happyTcHack x happyReduce_169 +action_302 (169#) = happyShift action_372 +action_302 x = happyTcHack x happyFail -action_303 (96#) = happyShift action_24 -action_303 (98#) = happyShift action_25 -action_303 (104#) = happyShift action_26 -action_303 (109#) = happyShift action_27 -action_303 (110#) = happyShift action_28 -action_303 (111#) = happyShift action_29 -action_303 (114#) = happyShift action_30 -action_303 (119#) = happyShift action_31 -action_303 (124#) = happyShift action_32 -action_303 (125#) = happyShift action_33 -action_303 (126#) = happyShift action_34 -action_303 (127#) = happyShift action_35 -action_303 (128#) = happyShift action_36 -action_303 (129#) = happyShift action_37 -action_303 (131#) = happyShift action_38 -action_303 (134#) = happyShift action_39 -action_303 (137#) = happyShift action_40 -action_303 (140#) = happyShift action_41 -action_303 (145#) = happyShift action_42 -action_303 (156#) = happyShift action_43 -action_303 (157#) = happyShift action_44 -action_303 (161#) = happyShift action_45 -action_303 (162#) = happyShift action_46 -action_303 (167#) = happyShift action_47 -action_303 (170#) = happyShift action_6 -action_303 (171#) = happyShift action_48 -action_303 (172#) = happyShift action_49 -action_303 (173#) = happyShift action_50 -action_303 (174#) = happyShift action_51 -action_303 (8#) = happyGoto action_10 -action_303 (9#) = happyGoto action_11 -action_303 (10#) = happyGoto action_12 -action_303 (11#) = happyGoto action_13 -action_303 (12#) = happyGoto action_14 -action_303 (58#) = happyGoto action_15 -action_303 (59#) = happyGoto action_16 -action_303 (60#) = happyGoto action_17 -action_303 (61#) = happyGoto action_18 -action_303 (62#) = happyGoto action_19 -action_303 (63#) = happyGoto action_199 -action_303 (64#) = happyGoto action_21 -action_303 (65#) = happyGoto action_374 -action_303 (72#) = happyGoto action_22 -action_303 (77#) = happyGoto action_23 -action_303 x = happyTcHack x happyReduce_193 +action_303 (125#) = happyShift action_371 +action_303 x = happyTcHack x happyFail -action_304 (96#) = happyShift action_24 -action_304 (98#) = happyShift action_25 -action_304 (104#) = happyShift action_26 -action_304 (109#) = happyShift action_27 -action_304 (110#) = happyShift action_28 -action_304 (111#) = happyShift action_29 -action_304 (114#) = happyShift action_30 -action_304 (119#) = happyShift action_31 -action_304 (124#) = happyShift action_32 -action_304 (125#) = happyShift action_33 -action_304 (126#) = happyShift action_34 -action_304 (127#) = happyShift action_35 -action_304 (128#) = happyShift action_36 -action_304 (129#) = happyShift action_37 -action_304 (131#) = happyShift action_38 -action_304 (134#) = happyShift action_39 -action_304 (137#) = happyShift action_40 -action_304 (140#) = happyShift action_41 -action_304 (145#) = happyShift action_42 -action_304 (156#) = happyShift action_43 -action_304 (157#) = happyShift action_44 -action_304 (161#) = happyShift action_45 -action_304 (162#) = happyShift action_46 -action_304 (167#) = happyShift action_47 -action_304 (170#) = happyShift action_6 -action_304 (171#) = happyShift action_48 -action_304 (172#) = happyShift action_49 -action_304 (173#) = happyShift action_50 -action_304 (174#) = happyShift action_51 -action_304 (8#) = happyGoto action_10 -action_304 (9#) = happyGoto action_11 -action_304 (10#) = happyGoto action_12 -action_304 (11#) = happyGoto action_13 -action_304 (12#) = happyGoto action_14 -action_304 (58#) = happyGoto action_15 -action_304 (59#) = happyGoto action_16 -action_304 (60#) = happyGoto action_17 -action_304 (61#) = happyGoto action_18 -action_304 (62#) = happyGoto action_19 -action_304 (63#) = happyGoto action_371 -action_304 (64#) = happyGoto action_21 -action_304 (72#) = happyGoto action_22 -action_304 (77#) = happyGoto action_23 -action_304 (86#) = happyGoto action_372 -action_304 (87#) = happyGoto action_373 -action_304 x = happyTcHack x happyReduce_257 +action_304 x = happyTcHack x happyReduce_163 -action_305 (95#) = happyShift action_370 -action_305 x = happyTcHack x happyReduce_134 +action_305 (95#) = happyShift action_120 +action_305 (98#) = happyShift action_121 +action_305 (105#) = happyShift action_164 +action_305 (111#) = happyShift action_122 +action_305 (115#) = happyShift action_123 +action_305 (123#) = happyShift action_124 +action_305 (126#) = happyShift action_125 +action_305 (167#) = happyShift action_126 +action_305 (170#) = happyShift action_6 +action_305 (171#) = happyShift action_45 +action_305 (172#) = happyShift action_46 +action_305 (174#) = happyShift action_48 +action_305 (8#) = happyGoto action_115 +action_305 (9#) = happyGoto action_116 +action_305 (10#) = happyGoto action_117 +action_305 (12#) = happyGoto action_158 +action_305 (67#) = happyGoto action_159 +action_305 (68#) = happyGoto action_160 +action_305 (69#) = happyGoto action_195 +action_305 (82#) = happyGoto action_196 +action_305 (83#) = happyGoto action_370 +action_305 x = happyTcHack x happyFail -action_306 x = happyTcHack x happyReduce_135 +action_306 (95#) = happyShift action_120 +action_306 (98#) = happyShift action_121 +action_306 (105#) = happyShift action_164 +action_306 (111#) = happyShift action_122 +action_306 (115#) = happyShift action_123 +action_306 (123#) = happyShift action_124 +action_306 (126#) = happyShift action_125 +action_306 (167#) = happyShift action_126 +action_306 (170#) = happyShift action_6 +action_306 (171#) = happyShift action_45 +action_306 (172#) = happyShift action_46 +action_306 (174#) = happyShift action_48 +action_306 (8#) = happyGoto action_115 +action_306 (9#) = happyGoto action_116 +action_306 (10#) = happyGoto action_117 +action_306 (12#) = happyGoto action_158 +action_306 (67#) = happyGoto action_159 +action_306 (68#) = happyGoto action_369 +action_306 x = happyTcHack x happyFail -action_307 x = happyTcHack x happyReduce_139 +action_307 (95#) = happyShift action_21 +action_307 (97#) = happyShift action_22 +action_307 (98#) = happyShift action_23 +action_307 (111#) = happyShift action_24 +action_307 (115#) = happyShift action_25 +action_307 (117#) = happyShift action_26 +action_307 (118#) = happyShift action_27 +action_307 (119#) = happyShift action_28 +action_307 (120#) = happyShift action_29 +action_307 (121#) = happyShift action_30 +action_307 (122#) = happyShift action_31 +action_307 (123#) = happyShift action_32 +action_307 (124#) = happyShift action_33 +action_307 (128#) = happyShift action_34 +action_307 (131#) = happyShift action_35 +action_307 (134#) = happyShift action_36 +action_307 (137#) = happyShift action_37 +action_307 (142#) = happyShift action_38 +action_307 (153#) = happyShift action_39 +action_307 (154#) = happyShift action_40 +action_307 (158#) = happyShift action_41 +action_307 (159#) = happyShift action_42 +action_307 (164#) = happyShift action_43 +action_307 (167#) = happyShift action_44 +action_307 (170#) = happyShift action_6 +action_307 (171#) = happyShift action_45 +action_307 (172#) = happyShift action_46 +action_307 (173#) = happyShift action_47 +action_307 (174#) = happyShift action_48 +action_307 (8#) = happyGoto action_7 +action_307 (9#) = happyGoto action_8 +action_307 (10#) = happyGoto action_9 +action_307 (11#) = happyGoto action_10 +action_307 (12#) = happyGoto action_11 +action_307 (58#) = happyGoto action_12 +action_307 (59#) = happyGoto action_13 +action_307 (60#) = happyGoto action_14 +action_307 (61#) = happyGoto action_15 +action_307 (62#) = happyGoto action_16 +action_307 (63#) = happyGoto action_368 +action_307 (64#) = happyGoto action_18 +action_307 (72#) = happyGoto action_19 +action_307 (77#) = happyGoto action_20 +action_307 x = happyTcHack x happyFail -action_308 x = happyTcHack x happyReduce_187 +action_308 (95#) = happyShift action_120 +action_308 (98#) = happyShift action_121 +action_308 (105#) = happyShift action_164 +action_308 (111#) = happyShift action_122 +action_308 (115#) = happyShift action_123 +action_308 (123#) = happyShift action_124 +action_308 (126#) = happyShift action_125 +action_308 (167#) = happyShift action_126 +action_308 (170#) = happyShift action_6 +action_308 (171#) = happyShift action_45 +action_308 (172#) = happyShift action_46 +action_308 (174#) = happyShift action_48 +action_308 (8#) = happyGoto action_115 +action_308 (9#) = happyGoto action_116 +action_308 (10#) = happyGoto action_117 +action_308 (12#) = happyGoto action_158 +action_308 (67#) = happyGoto action_159 +action_308 (68#) = happyGoto action_367 +action_308 x = happyTcHack x happyFail -action_309 (140#) = happyShift action_369 -action_309 x = happyTcHack x happyFail +action_309 x = happyTcHack x happyReduce_212 -action_310 x = happyTcHack x happyReduce_189 +action_310 (174#) = happyShift action_48 +action_310 (12#) = happyGoto action_366 +action_310 x = happyTcHack x happyFail -action_311 (96#) = happyShift action_106 -action_311 (98#) = happyShift action_107 -action_311 (104#) = happyShift action_108 -action_311 (110#) = happyShift action_109 -action_311 (111#) = happyShift action_110 -action_311 (114#) = happyShift action_111 -action_311 (121#) = happyShift action_112 +action_311 (95#) = happyShift action_120 +action_311 (98#) = happyShift action_121 +action_311 (111#) = happyShift action_122 +action_311 (115#) = happyShift action_123 +action_311 (123#) = happyShift action_124 +action_311 (126#) = happyShift action_125 +action_311 (167#) = happyShift action_126 action_311 (170#) = happyShift action_6 -action_311 (171#) = happyShift action_48 -action_311 (172#) = happyShift action_49 -action_311 (174#) = happyShift action_51 -action_311 (8#) = happyGoto action_101 -action_311 (9#) = happyGoto action_102 -action_311 (10#) = happyGoto action_103 -action_311 (12#) = happyGoto action_104 -action_311 (67#) = happyGoto action_188 -action_311 (74#) = happyGoto action_189 -action_311 (84#) = happyGoto action_190 -action_311 (85#) = happyGoto action_368 -action_311 x = happyTcHack x happyReduce_253 +action_311 (171#) = happyShift action_45 +action_311 (172#) = happyShift action_46 +action_311 (174#) = happyShift action_48 +action_311 (8#) = happyGoto action_115 +action_311 (9#) = happyGoto action_116 +action_311 (10#) = happyGoto action_117 +action_311 (12#) = happyGoto action_118 +action_311 (67#) = happyGoto action_365 +action_311 x = happyTcHack x happyFail -action_312 (96#) = happyShift action_24 -action_312 (98#) = happyShift action_25 -action_312 (104#) = happyShift action_26 -action_312 (109#) = happyShift action_27 -action_312 (110#) = happyShift action_28 -action_312 (111#) = happyShift action_29 -action_312 (114#) = happyShift action_30 -action_312 (119#) = happyShift action_31 -action_312 (124#) = happyShift action_32 -action_312 (125#) = happyShift action_33 -action_312 (126#) = happyShift action_34 -action_312 (127#) = happyShift action_35 -action_312 (128#) = happyShift action_36 -action_312 (129#) = happyShift action_37 -action_312 (131#) = happyShift action_38 -action_312 (134#) = happyShift action_39 -action_312 (137#) = happyShift action_40 -action_312 (140#) = happyShift action_41 -action_312 (145#) = happyShift action_42 -action_312 (156#) = happyShift action_43 -action_312 (157#) = happyShift action_44 -action_312 (161#) = happyShift action_45 -action_312 (162#) = happyShift action_46 -action_312 (167#) = happyShift action_47 -action_312 (170#) = happyShift action_6 -action_312 (171#) = happyShift action_48 -action_312 (172#) = happyShift action_49 -action_312 (173#) = happyShift action_50 -action_312 (174#) = happyShift action_51 -action_312 (8#) = happyGoto action_10 -action_312 (9#) = happyGoto action_11 -action_312 (10#) = happyGoto action_12 -action_312 (11#) = happyGoto action_13 -action_312 (12#) = happyGoto action_14 -action_312 (58#) = happyGoto action_15 -action_312 (59#) = happyGoto action_16 -action_312 (60#) = happyGoto action_17 -action_312 (61#) = happyGoto action_18 -action_312 (62#) = happyGoto action_19 -action_312 (63#) = happyGoto action_367 -action_312 (64#) = happyGoto action_21 -action_312 (72#) = happyGoto action_22 -action_312 (77#) = happyGoto action_23 -action_312 x = happyTcHack x happyFail +action_312 x = happyTcHack x happyReduce_169 -action_313 x = happyTcHack x happyReduce_233 +action_313 (95#) = happyShift action_21 +action_313 (97#) = happyShift action_22 +action_313 (98#) = happyShift action_23 +action_313 (111#) = happyShift action_24 +action_313 (115#) = happyShift action_25 +action_313 (117#) = happyShift action_26 +action_313 (118#) = happyShift action_27 +action_313 (119#) = happyShift action_28 +action_313 (120#) = happyShift action_29 +action_313 (121#) = happyShift action_30 +action_313 (122#) = happyShift action_31 +action_313 (123#) = happyShift action_32 +action_313 (124#) = happyShift action_33 +action_313 (128#) = happyShift action_34 +action_313 (131#) = happyShift action_35 +action_313 (134#) = happyShift action_36 +action_313 (137#) = happyShift action_37 +action_313 (142#) = happyShift action_38 +action_313 (153#) = happyShift action_39 +action_313 (154#) = happyShift action_40 +action_313 (158#) = happyShift action_41 +action_313 (159#) = happyShift action_42 +action_313 (164#) = happyShift action_43 +action_313 (167#) = happyShift action_44 +action_313 (170#) = happyShift action_6 +action_313 (171#) = happyShift action_45 +action_313 (172#) = happyShift action_46 +action_313 (173#) = happyShift action_47 +action_313 (174#) = happyShift action_48 +action_313 (8#) = happyGoto action_7 +action_313 (9#) = happyGoto action_8 +action_313 (10#) = happyGoto action_9 +action_313 (11#) = happyGoto action_10 +action_313 (12#) = happyGoto action_11 +action_313 (58#) = happyGoto action_12 +action_313 (59#) = happyGoto action_13 +action_313 (60#) = happyGoto action_14 +action_313 (61#) = happyGoto action_15 +action_313 (62#) = happyGoto action_16 +action_313 (63#) = happyGoto action_192 +action_313 (64#) = happyGoto action_18 +action_313 (65#) = happyGoto action_364 +action_313 (72#) = happyGoto action_19 +action_313 (77#) = happyGoto action_20 +action_313 x = happyTcHack x happyReduce_193 -action_314 (96#) = happyShift action_106 -action_314 (98#) = happyShift action_107 -action_314 (104#) = happyShift action_108 -action_314 (106#) = happyShift action_176 -action_314 (110#) = happyShift action_109 -action_314 (111#) = happyShift action_110 -action_314 (114#) = happyShift action_111 -action_314 (121#) = happyShift action_112 +action_314 (95#) = happyShift action_21 +action_314 (97#) = happyShift action_22 +action_314 (98#) = happyShift action_23 +action_314 (111#) = happyShift action_24 +action_314 (115#) = happyShift action_25 +action_314 (117#) = happyShift action_26 +action_314 (118#) = happyShift action_27 +action_314 (119#) = happyShift action_28 +action_314 (120#) = happyShift action_29 +action_314 (121#) = happyShift action_30 +action_314 (122#) = happyShift action_31 +action_314 (123#) = happyShift action_32 +action_314 (124#) = happyShift action_33 +action_314 (128#) = happyShift action_34 +action_314 (131#) = happyShift action_35 +action_314 (134#) = happyShift action_36 +action_314 (137#) = happyShift action_37 +action_314 (142#) = happyShift action_38 +action_314 (153#) = happyShift action_39 +action_314 (154#) = happyShift action_40 +action_314 (158#) = happyShift action_41 +action_314 (159#) = happyShift action_42 +action_314 (164#) = happyShift action_43 +action_314 (167#) = happyShift action_44 action_314 (170#) = happyShift action_6 -action_314 (171#) = happyShift action_48 -action_314 (172#) = happyShift action_49 -action_314 (174#) = happyShift action_51 -action_314 (8#) = happyGoto action_101 -action_314 (9#) = happyGoto action_102 -action_314 (10#) = happyGoto action_103 -action_314 (12#) = happyGoto action_170 -action_314 (67#) = happyGoto action_171 -action_314 (68#) = happyGoto action_172 -action_314 (69#) = happyGoto action_203 -action_314 (82#) = happyGoto action_204 -action_314 (83#) = happyGoto action_366 -action_314 x = happyTcHack x happyFail +action_314 (171#) = happyShift action_45 +action_314 (172#) = happyShift action_46 +action_314 (173#) = happyShift action_47 +action_314 (174#) = happyShift action_48 +action_314 (8#) = happyGoto action_7 +action_314 (9#) = happyGoto action_8 +action_314 (10#) = happyGoto action_9 +action_314 (11#) = happyGoto action_10 +action_314 (12#) = happyGoto action_11 +action_314 (58#) = happyGoto action_12 +action_314 (59#) = happyGoto action_13 +action_314 (60#) = happyGoto action_14 +action_314 (61#) = happyGoto action_15 +action_314 (62#) = happyGoto action_16 +action_314 (63#) = happyGoto action_361 +action_314 (64#) = happyGoto action_18 +action_314 (72#) = happyGoto action_19 +action_314 (77#) = happyGoto action_20 +action_314 (86#) = happyGoto action_362 +action_314 (87#) = happyGoto action_363 +action_314 x = happyTcHack x happyReduce_257 -action_315 x = happyTcHack x happyReduce_238 +action_315 x = happyTcHack x happyReduce_129 -action_316 x = happyTcHack x happyReduce_182 +action_316 x = happyTcHack x happyReduce_187 -action_317 (96#) = happyShift action_24 -action_317 (98#) = happyShift action_25 -action_317 (104#) = happyShift action_26 -action_317 (109#) = happyShift action_27 -action_317 (110#) = happyShift action_28 -action_317 (111#) = happyShift action_29 -action_317 (114#) = happyShift action_30 -action_317 (119#) = happyShift action_31 -action_317 (124#) = happyShift action_32 -action_317 (125#) = happyShift action_33 -action_317 (126#) = happyShift action_34 -action_317 (127#) = happyShift action_35 -action_317 (128#) = happyShift action_36 -action_317 (129#) = happyShift action_37 -action_317 (131#) = happyShift action_38 -action_317 (134#) = happyShift action_39 -action_317 (137#) = happyShift action_40 -action_317 (140#) = happyShift action_41 -action_317 (145#) = happyShift action_42 -action_317 (156#) = happyShift action_43 -action_317 (157#) = happyShift action_44 -action_317 (161#) = happyShift action_45 -action_317 (162#) = happyShift action_46 -action_317 (167#) = happyShift action_47 -action_317 (170#) = happyShift action_6 -action_317 (171#) = happyShift action_48 -action_317 (172#) = happyShift action_49 -action_317 (173#) = happyShift action_50 -action_317 (174#) = happyShift action_51 -action_317 (8#) = happyGoto action_10 -action_317 (9#) = happyGoto action_11 -action_317 (10#) = happyGoto action_12 -action_317 (11#) = happyGoto action_13 -action_317 (12#) = happyGoto action_14 -action_317 (58#) = happyGoto action_15 -action_317 (59#) = happyGoto action_16 -action_317 (60#) = happyGoto action_17 -action_317 (61#) = happyGoto action_18 -action_317 (62#) = happyGoto action_19 -action_317 (63#) = happyGoto action_365 -action_317 (64#) = happyGoto action_21 -action_317 (72#) = happyGoto action_22 -action_317 (77#) = happyGoto action_23 +action_317 (137#) = happyShift action_360 action_317 x = happyTcHack x happyFail -action_318 x = happyTcHack x happyReduce_205 +action_318 x = happyTcHack x happyReduce_189 -action_319 x = happyTcHack x happyReduce_209 +action_319 (95#) = happyShift action_120 +action_319 (98#) = happyShift action_121 +action_319 (111#) = happyShift action_122 +action_319 (115#) = happyShift action_123 +action_319 (123#) = happyShift action_124 +action_319 (126#) = happyShift action_125 +action_319 (167#) = happyShift action_126 +action_319 (170#) = happyShift action_6 +action_319 (171#) = happyShift action_45 +action_319 (172#) = happyShift action_46 +action_319 (174#) = happyShift action_48 +action_319 (8#) = happyGoto action_115 +action_319 (9#) = happyGoto action_116 +action_319 (10#) = happyGoto action_117 +action_319 (12#) = happyGoto action_118 +action_319 (67#) = happyGoto action_183 +action_319 (74#) = happyGoto action_184 +action_319 (84#) = happyGoto action_185 +action_319 (85#) = happyGoto action_359 +action_319 x = happyTcHack x happyReduce_253 -action_320 (174#) = happyShift action_51 -action_320 (12#) = happyGoto action_87 -action_320 (53#) = happyGoto action_180 -action_320 (70#) = happyGoto action_181 -action_320 (73#) = happyGoto action_364 -action_320 x = happyTcHack x happyReduce_229 +action_320 (95#) = happyShift action_21 +action_320 (97#) = happyShift action_22 +action_320 (98#) = happyShift action_23 +action_320 (111#) = happyShift action_24 +action_320 (115#) = happyShift action_25 +action_320 (117#) = happyShift action_26 +action_320 (118#) = happyShift action_27 +action_320 (119#) = happyShift action_28 +action_320 (120#) = happyShift action_29 +action_320 (121#) = happyShift action_30 +action_320 (122#) = happyShift action_31 +action_320 (123#) = happyShift action_32 +action_320 (124#) = happyShift action_33 +action_320 (128#) = happyShift action_34 +action_320 (131#) = happyShift action_35 +action_320 (134#) = happyShift action_36 +action_320 (137#) = happyShift action_37 +action_320 (142#) = happyShift action_38 +action_320 (153#) = happyShift action_39 +action_320 (154#) = happyShift action_40 +action_320 (158#) = happyShift action_41 +action_320 (159#) = happyShift action_42 +action_320 (164#) = happyShift action_43 +action_320 (167#) = happyShift action_44 +action_320 (170#) = happyShift action_6 +action_320 (171#) = happyShift action_45 +action_320 (172#) = happyShift action_46 +action_320 (173#) = happyShift action_47 +action_320 (174#) = happyShift action_48 +action_320 (8#) = happyGoto action_7 +action_320 (9#) = happyGoto action_8 +action_320 (10#) = happyGoto action_9 +action_320 (11#) = happyGoto action_10 +action_320 (12#) = happyGoto action_11 +action_320 (58#) = happyGoto action_12 +action_320 (59#) = happyGoto action_13 +action_320 (60#) = happyGoto action_14 +action_320 (61#) = happyGoto action_15 +action_320 (62#) = happyGoto action_16 +action_320 (63#) = happyGoto action_358 +action_320 (64#) = happyGoto action_18 +action_320 (72#) = happyGoto action_19 +action_320 (77#) = happyGoto action_20 +action_320 x = happyTcHack x happyFail -action_321 (96#) = happyShift action_106 -action_321 (98#) = happyShift action_107 -action_321 (104#) = happyShift action_108 -action_321 (106#) = happyShift action_176 -action_321 (110#) = happyShift action_109 -action_321 (111#) = happyShift action_110 -action_321 (114#) = happyShift action_111 -action_321 (121#) = happyShift action_112 -action_321 (170#) = happyShift action_6 -action_321 (171#) = happyShift action_48 -action_321 (172#) = happyShift action_49 -action_321 (174#) = happyShift action_51 -action_321 (8#) = happyGoto action_101 -action_321 (9#) = happyGoto action_102 -action_321 (10#) = happyGoto action_103 -action_321 (12#) = happyGoto action_170 -action_321 (67#) = happyGoto action_171 -action_321 (68#) = happyGoto action_172 -action_321 (69#) = happyGoto action_363 -action_321 x = happyTcHack x happyFail +action_321 x = happyTcHack x happyReduce_233 -action_322 x = happyTcHack x happyReduce_204 +action_322 (95#) = happyShift action_120 +action_322 (98#) = happyShift action_121 +action_322 (105#) = happyShift action_164 +action_322 (111#) = happyShift action_122 +action_322 (115#) = happyShift action_123 +action_322 (123#) = happyShift action_124 +action_322 (126#) = happyShift action_125 +action_322 (167#) = happyShift action_126 +action_322 (170#) = happyShift action_6 +action_322 (171#) = happyShift action_45 +action_322 (172#) = happyShift action_46 +action_322 (174#) = happyShift action_48 +action_322 (8#) = happyGoto action_115 +action_322 (9#) = happyGoto action_116 +action_322 (10#) = happyGoto action_117 +action_322 (12#) = happyGoto action_158 +action_322 (67#) = happyGoto action_159 +action_322 (68#) = happyGoto action_160 +action_322 (69#) = happyGoto action_195 +action_322 (82#) = happyGoto action_196 +action_322 (83#) = happyGoto action_357 +action_322 x = happyTcHack x happyFail -action_323 x = happyTcHack x happyReduce_211 +action_323 x = happyTcHack x happyReduce_238 -action_324 x = happyTcHack x happyReduce_199 +action_324 x = happyTcHack x happyReduce_182 -action_325 x = happyTcHack x happyReduce_216 +action_325 (95#) = happyShift action_21 +action_325 (97#) = happyShift action_22 +action_325 (98#) = happyShift action_23 +action_325 (111#) = happyShift action_24 +action_325 (115#) = happyShift action_25 +action_325 (117#) = happyShift action_26 +action_325 (118#) = happyShift action_27 +action_325 (119#) = happyShift action_28 +action_325 (120#) = happyShift action_29 +action_325 (121#) = happyShift action_30 +action_325 (122#) = happyShift action_31 +action_325 (123#) = happyShift action_32 +action_325 (124#) = happyShift action_33 +action_325 (128#) = happyShift action_34 +action_325 (131#) = happyShift action_35 +action_325 (134#) = happyShift action_36 +action_325 (137#) = happyShift action_37 +action_325 (142#) = happyShift action_38 +action_325 (153#) = happyShift action_39 +action_325 (154#) = happyShift action_40 +action_325 (158#) = happyShift action_41 +action_325 (159#) = happyShift action_42 +action_325 (164#) = happyShift action_43 +action_325 (167#) = happyShift action_44 +action_325 (170#) = happyShift action_6 +action_325 (171#) = happyShift action_45 +action_325 (172#) = happyShift action_46 +action_325 (173#) = happyShift action_47 +action_325 (174#) = happyShift action_48 +action_325 (8#) = happyGoto action_7 +action_325 (9#) = happyGoto action_8 +action_325 (10#) = happyGoto action_9 +action_325 (11#) = happyGoto action_10 +action_325 (12#) = happyGoto action_11 +action_325 (58#) = happyGoto action_12 +action_325 (59#) = happyGoto action_13 +action_325 (60#) = happyGoto action_14 +action_325 (61#) = happyGoto action_15 +action_325 (62#) = happyGoto action_16 +action_325 (63#) = happyGoto action_356 +action_325 (64#) = happyGoto action_18 +action_325 (72#) = happyGoto action_19 +action_325 (77#) = happyGoto action_20 +action_325 x = happyTcHack x happyFail -action_326 x = happyTcHack x happyReduce_210 +action_326 x = happyTcHack x happyReduce_150 -action_327 (96#) = happyShift action_106 -action_327 (98#) = happyShift action_107 -action_327 (104#) = happyShift action_108 -action_327 (106#) = happyShift action_176 -action_327 (110#) = happyShift action_109 -action_327 (111#) = happyShift action_110 -action_327 (114#) = happyShift action_111 -action_327 (121#) = happyShift action_112 -action_327 (170#) = happyShift action_6 -action_327 (171#) = happyShift action_48 -action_327 (172#) = happyShift action_49 -action_327 (174#) = happyShift action_51 -action_327 (8#) = happyGoto action_101 -action_327 (9#) = happyGoto action_102 -action_327 (10#) = happyGoto action_103 -action_327 (12#) = happyGoto action_170 -action_327 (67#) = happyGoto action_171 -action_327 (68#) = happyGoto action_172 -action_327 (69#) = happyGoto action_173 -action_327 (79#) = happyGoto action_174 -action_327 (81#) = happyGoto action_362 -action_327 x = happyTcHack x happyReduce_246 +action_327 x = happyTcHack x happyReduce_197 -action_328 x = happyTcHack x happyReduce_214 +action_328 (114#) = happyShift action_355 +action_328 x = happyTcHack x happyFail -action_329 (174#) = happyShift action_51 -action_329 (12#) = happyGoto action_361 -action_329 x = happyTcHack x happyFail +action_329 x = happyTcHack x happyReduce_241 -action_330 (112#) = happyShift action_360 -action_330 x = happyTcHack x happyFail +action_330 x = happyTcHack x happyReduce_245 -action_331 x = happyTcHack x happyReduce_241 +action_331 (99#) = happyShift action_354 +action_331 x = happyTcHack x happyFail -action_332 x = happyTcHack x happyReduce_245 +action_332 x = happyTcHack x happyReduce_154 action_333 x = happyTcHack x happyReduce_160 -action_334 x = happyTcHack x happyReduce_150 +action_334 x = happyTcHack x happyReduce_205 -action_335 x = happyTcHack x happyReduce_197 +action_335 (174#) = happyShift action_48 +action_335 (12#) = happyGoto action_353 +action_335 x = happyTcHack x happyFail -action_336 (99#) = happyShift action_359 -action_336 x = happyTcHack x happyFail +action_336 x = happyTcHack x happyReduce_211 -action_337 x = happyTcHack x happyReduce_154 +action_337 x = happyTcHack x happyReduce_216 -action_338 (97#) = happyShift action_358 -action_338 x = happyTcHack x happyFail +action_338 x = happyTcHack x happyReduce_210 -action_339 x = happyTcHack x happyReduce_129 +action_339 (95#) = happyShift action_120 +action_339 (98#) = happyShift action_121 +action_339 (105#) = happyShift action_164 +action_339 (111#) = happyShift action_122 +action_339 (115#) = happyShift action_123 +action_339 (123#) = happyShift action_124 +action_339 (126#) = happyShift action_125 +action_339 (167#) = happyShift action_126 +action_339 (170#) = happyShift action_6 +action_339 (171#) = happyShift action_45 +action_339 (172#) = happyShift action_46 +action_339 (174#) = happyShift action_48 +action_339 (8#) = happyGoto action_115 +action_339 (9#) = happyGoto action_116 +action_339 (10#) = happyGoto action_117 +action_339 (12#) = happyGoto action_158 +action_339 (67#) = happyGoto action_159 +action_339 (68#) = happyGoto action_160 +action_339 (69#) = happyGoto action_161 +action_339 (79#) = happyGoto action_162 +action_339 (81#) = happyGoto action_352 +action_339 x = happyTcHack x happyReduce_246 -action_340 (97#) = happyShift action_357 -action_340 x = happyTcHack x happyFail +action_340 x = happyTcHack x happyReduce_214 -action_341 x = happyTcHack x happyReduce_223 +action_341 x = happyTcHack x happyReduce_199 -action_342 (97#) = happyShift action_155 -action_342 (103#) = happyShift action_156 -action_342 x = happyTcHack x happyReduce_128 +action_342 x = happyTcHack x happyReduce_209 -action_343 x = happyTcHack x happyReduce_25 +action_343 (174#) = happyShift action_48 +action_343 (12#) = happyGoto action_92 +action_343 (53#) = happyGoto action_154 +action_343 (70#) = happyGoto action_155 +action_343 (73#) = happyGoto action_351 +action_343 x = happyTcHack x happyReduce_229 -action_344 (151#) = happyShift action_356 -action_344 (28#) = happyGoto action_355 -action_344 x = happyTcHack x happyReduce_55 +action_344 (95#) = happyShift action_120 +action_344 (98#) = happyShift action_121 +action_344 (105#) = happyShift action_164 +action_344 (111#) = happyShift action_122 +action_344 (115#) = happyShift action_123 +action_344 (123#) = happyShift action_124 +action_344 (126#) = happyShift action_125 +action_344 (167#) = happyShift action_126 +action_344 (170#) = happyShift action_6 +action_344 (171#) = happyShift action_45 +action_344 (172#) = happyShift action_46 +action_344 (174#) = happyShift action_48 +action_344 (8#) = happyGoto action_115 +action_344 (9#) = happyGoto action_116 +action_344 (10#) = happyGoto action_117 +action_344 (12#) = happyGoto action_158 +action_344 (67#) = happyGoto action_159 +action_344 (68#) = happyGoto action_160 +action_344 (69#) = happyGoto action_350 +action_344 x = happyTcHack x happyFail -action_345 (102#) = happyShift action_354 -action_345 x = happyTcHack x happyReduce_27 +action_345 x = happyTcHack x happyReduce_204 -action_346 (103#) = happyShift action_352 -action_346 (169#) = happyShift action_353 -action_346 x = happyTcHack x happyReduce_66 +action_346 (169#) = happyShift action_349 +action_346 x = happyTcHack x happyFail -action_347 (174#) = happyShift action_51 -action_347 (12#) = happyGoto action_351 -action_347 x = happyTcHack x happyFail +action_347 x = happyTcHack x happyReduce_223 -action_348 (174#) = happyShift action_51 -action_348 (12#) = happyGoto action_241 -action_348 (32#) = happyGoto action_349 -action_348 (33#) = happyGoto action_350 -action_348 x = happyTcHack x happyReduce_65 +action_348 (104#) = happyShift action_190 +action_348 (169#) = happyShift action_207 +action_348 x = happyTcHack x happyReduce_128 -action_349 x = happyTcHack x happyReduce_33 +action_349 x = happyTcHack x happyReduce_188 -action_350 (103#) = happyShift action_352 -action_350 x = happyTcHack x happyReduce_66 +action_350 (102#) = happyShift action_306 +action_350 (168#) = happyShift action_308 +action_350 x = happyTcHack x happyReduce_221 -action_351 x = happyTcHack x happyReduce_32 +action_351 x = happyTcHack x happyReduce_231 -action_352 (174#) = happyShift action_51 -action_352 (12#) = happyGoto action_241 -action_352 (32#) = happyGoto action_468 -action_352 (33#) = happyGoto action_350 -action_352 x = happyTcHack x happyReduce_65 +action_352 x = happyTcHack x happyReduce_248 -action_353 (98#) = happyShift action_408 -action_353 (174#) = happyShift action_51 -action_353 (12#) = happyGoto action_406 -action_353 (27#) = happyGoto action_467 -action_353 (29#) = happyGoto action_425 -action_353 x = happyTcHack x happyReduce_52 +action_353 x = happyTcHack x happyReduce_201 -action_354 (174#) = happyShift action_51 -action_354 (12#) = happyGoto action_241 -action_354 (33#) = happyGoto action_466 -action_354 x = happyTcHack x happyReduce_50 +action_354 x = happyTcHack x happyReduce_239 -action_355 x = happyTcHack x happyReduce_26 +action_355 x = happyTcHack x happyReduce_155 -action_356 (98#) = happyShift action_408 -action_356 (174#) = happyShift action_51 -action_356 (12#) = happyGoto action_406 -action_356 (27#) = happyGoto action_465 -action_356 (29#) = happyGoto action_425 -action_356 x = happyTcHack x happyReduce_52 +action_356 x = happyTcHack x happyReduce_183 -action_357 x = happyTcHack x happyReduce_188 +action_357 (169#) = happyShift action_468 +action_357 x = happyTcHack x happyFail -action_358 x = happyTcHack x happyReduce_159 +action_358 x = happyTcHack x happyReduce_252 -action_359 x = happyTcHack x happyReduce_239 +action_359 x = happyTcHack x happyReduce_255 -action_360 x = happyTcHack x happyReduce_155 +action_360 (95#) = happyShift action_21 +action_360 (97#) = happyShift action_22 +action_360 (98#) = happyShift action_23 +action_360 (111#) = happyShift action_24 +action_360 (115#) = happyShift action_25 +action_360 (117#) = happyShift action_26 +action_360 (118#) = happyShift action_27 +action_360 (119#) = happyShift action_28 +action_360 (120#) = happyShift action_29 +action_360 (121#) = happyShift action_30 +action_360 (122#) = happyShift action_31 +action_360 (123#) = happyShift action_32 +action_360 (124#) = happyShift action_33 +action_360 (128#) = happyShift action_34 +action_360 (131#) = happyShift action_35 +action_360 (134#) = happyShift action_36 +action_360 (137#) = happyShift action_37 +action_360 (142#) = happyShift action_38 +action_360 (153#) = happyShift action_39 +action_360 (154#) = happyShift action_40 +action_360 (158#) = happyShift action_41 +action_360 (159#) = happyShift action_42 +action_360 (164#) = happyShift action_43 +action_360 (167#) = happyShift action_44 +action_360 (170#) = happyShift action_6 +action_360 (171#) = happyShift action_45 +action_360 (172#) = happyShift action_46 +action_360 (173#) = happyShift action_47 +action_360 (174#) = happyShift action_48 +action_360 (8#) = happyGoto action_7 +action_360 (9#) = happyGoto action_8 +action_360 (10#) = happyGoto action_9 +action_360 (11#) = happyGoto action_10 +action_360 (12#) = happyGoto action_11 +action_360 (58#) = happyGoto action_12 +action_360 (59#) = happyGoto action_13 +action_360 (60#) = happyGoto action_14 +action_360 (61#) = happyGoto action_15 +action_360 (62#) = happyGoto action_16 +action_360 (63#) = happyGoto action_467 +action_360 (64#) = happyGoto action_18 +action_360 (72#) = happyGoto action_19 +action_360 (77#) = happyGoto action_20 +action_360 x = happyTcHack x happyFail -action_361 x = happyTcHack x happyReduce_201 +action_361 (108#) = happyShift action_466 +action_361 x = happyTcHack x happyFail -action_362 x = happyTcHack x happyReduce_248 +action_362 (110#) = happyShift action_465 +action_362 x = happyTcHack x happyReduce_258 -action_363 (108#) = happyShift action_296 -action_363 (117#) = happyShift action_297 -action_363 x = happyTcHack x happyReduce_221 +action_363 (169#) = happyShift action_464 +action_363 x = happyTcHack x happyFail -action_364 x = happyTcHack x happyReduce_231 +action_364 x = happyTcHack x happyReduce_195 -action_365 x = happyTcHack x happyReduce_183 +action_365 x = happyTcHack x happyReduce_215 -action_366 (97#) = happyShift action_464 -action_366 x = happyTcHack x happyFail +action_366 (95#) = happyShift action_120 +action_366 (98#) = happyShift action_121 +action_366 (111#) = happyShift action_122 +action_366 (115#) = happyShift action_123 +action_366 (123#) = happyShift action_124 +action_366 (126#) = happyShift action_125 +action_366 (167#) = happyShift action_126 +action_366 (170#) = happyShift action_6 +action_366 (171#) = happyShift action_45 +action_366 (172#) = happyShift action_46 +action_366 (174#) = happyShift action_48 +action_366 (8#) = happyGoto action_115 +action_366 (9#) = happyGoto action_116 +action_366 (10#) = happyGoto action_117 +action_366 (12#) = happyGoto action_118 +action_366 (67#) = happyGoto action_183 +action_366 (74#) = happyGoto action_463 +action_366 x = happyTcHack x happyReduce_205 -action_367 x = happyTcHack x happyReduce_252 +action_367 x = happyTcHack x happyReduce_218 -action_368 x = happyTcHack x happyReduce_255 +action_368 x = happyTcHack x happyReduce_249 -action_369 (96#) = happyShift action_24 -action_369 (98#) = happyShift action_25 -action_369 (104#) = happyShift action_26 -action_369 (109#) = happyShift action_27 -action_369 (110#) = happyShift action_28 -action_369 (111#) = happyShift action_29 -action_369 (114#) = happyShift action_30 -action_369 (119#) = happyShift action_31 -action_369 (124#) = happyShift action_32 -action_369 (125#) = happyShift action_33 -action_369 (126#) = happyShift action_34 -action_369 (127#) = happyShift action_35 -action_369 (128#) = happyShift action_36 -action_369 (129#) = happyShift action_37 -action_369 (131#) = happyShift action_38 -action_369 (134#) = happyShift action_39 -action_369 (137#) = happyShift action_40 -action_369 (140#) = happyShift action_41 -action_369 (145#) = happyShift action_42 -action_369 (156#) = happyShift action_43 -action_369 (157#) = happyShift action_44 -action_369 (161#) = happyShift action_45 -action_369 (162#) = happyShift action_46 -action_369 (167#) = happyShift action_47 -action_369 (170#) = happyShift action_6 -action_369 (171#) = happyShift action_48 -action_369 (172#) = happyShift action_49 -action_369 (173#) = happyShift action_50 -action_369 (174#) = happyShift action_51 -action_369 (8#) = happyGoto action_10 -action_369 (9#) = happyGoto action_11 -action_369 (10#) = happyGoto action_12 -action_369 (11#) = happyGoto action_13 -action_369 (12#) = happyGoto action_14 -action_369 (58#) = happyGoto action_15 -action_369 (59#) = happyGoto action_16 -action_369 (60#) = happyGoto action_17 -action_369 (61#) = happyGoto action_18 -action_369 (62#) = happyGoto action_19 -action_369 (63#) = happyGoto action_463 -action_369 (64#) = happyGoto action_21 -action_369 (72#) = happyGoto action_22 -action_369 (77#) = happyGoto action_23 -action_369 x = happyTcHack x happyFail +action_369 x = happyTcHack x happyReduce_219 -action_370 (96#) = happyShift action_24 -action_370 (98#) = happyShift action_25 -action_370 (104#) = happyShift action_26 -action_370 (109#) = happyShift action_27 -action_370 (110#) = happyShift action_28 -action_370 (111#) = happyShift action_29 -action_370 (114#) = happyShift action_30 -action_370 (119#) = happyShift action_31 -action_370 (124#) = happyShift action_32 -action_370 (125#) = happyShift action_33 -action_370 (126#) = happyShift action_34 -action_370 (127#) = happyShift action_35 -action_370 (128#) = happyShift action_36 -action_370 (129#) = happyShift action_37 -action_370 (131#) = happyShift action_38 -action_370 (134#) = happyShift action_39 -action_370 (137#) = happyShift action_40 -action_370 (140#) = happyShift action_41 -action_370 (145#) = happyShift action_42 -action_370 (156#) = happyShift action_43 -action_370 (157#) = happyShift action_44 -action_370 (161#) = happyShift action_45 -action_370 (162#) = happyShift action_46 -action_370 (167#) = happyShift action_47 -action_370 (170#) = happyShift action_6 -action_370 (171#) = happyShift action_48 -action_370 (172#) = happyShift action_49 -action_370 (173#) = happyShift action_50 -action_370 (174#) = happyShift action_51 -action_370 (8#) = happyGoto action_10 -action_370 (9#) = happyGoto action_11 -action_370 (10#) = happyGoto action_12 -action_370 (11#) = happyGoto action_13 -action_370 (12#) = happyGoto action_14 -action_370 (58#) = happyGoto action_15 -action_370 (59#) = happyGoto action_16 -action_370 (60#) = happyGoto action_17 -action_370 (61#) = happyGoto action_18 -action_370 (62#) = happyGoto action_19 -action_370 (63#) = happyGoto action_462 -action_370 (64#) = happyGoto action_21 -action_370 (72#) = happyGoto action_22 -action_370 (77#) = happyGoto action_23 -action_370 x = happyTcHack x happyFail +action_370 x = happyTcHack x happyReduce_251 -action_371 (123#) = happyShift action_461 -action_371 x = happyTcHack x happyFail +action_371 x = happyTcHack x happyReduce_165 -action_372 (94#) = happyShift action_460 -action_372 x = happyTcHack x happyReduce_258 +action_372 x = happyTcHack x happyReduce_164 -action_373 (97#) = happyShift action_459 +action_373 (95#) = happyShift action_21 +action_373 (97#) = happyShift action_22 +action_373 (98#) = happyShift action_23 +action_373 (111#) = happyShift action_24 +action_373 (115#) = happyShift action_25 +action_373 (117#) = happyShift action_26 +action_373 (118#) = happyShift action_27 +action_373 (119#) = happyShift action_28 +action_373 (120#) = happyShift action_29 +action_373 (121#) = happyShift action_30 +action_373 (122#) = happyShift action_31 +action_373 (123#) = happyShift action_32 +action_373 (124#) = happyShift action_33 +action_373 (128#) = happyShift action_34 +action_373 (131#) = happyShift action_35 +action_373 (134#) = happyShift action_36 +action_373 (137#) = happyShift action_37 +action_373 (142#) = happyShift action_38 +action_373 (153#) = happyShift action_39 +action_373 (154#) = happyShift action_40 +action_373 (158#) = happyShift action_41 +action_373 (159#) = happyShift action_42 +action_373 (164#) = happyShift action_43 +action_373 (167#) = happyShift action_44 +action_373 (170#) = happyShift action_6 +action_373 (171#) = happyShift action_45 +action_373 (172#) = happyShift action_46 +action_373 (173#) = happyShift action_47 +action_373 (174#) = happyShift action_48 +action_373 (8#) = happyGoto action_7 +action_373 (9#) = happyGoto action_8 +action_373 (10#) = happyGoto action_9 +action_373 (11#) = happyGoto action_10 +action_373 (12#) = happyGoto action_11 +action_373 (58#) = happyGoto action_12 +action_373 (59#) = happyGoto action_13 +action_373 (60#) = happyGoto action_14 +action_373 (61#) = happyGoto action_15 +action_373 (62#) = happyGoto action_16 +action_373 (63#) = happyGoto action_462 +action_373 (64#) = happyGoto action_18 +action_373 (72#) = happyGoto action_19 +action_373 (77#) = happyGoto action_20 action_373 x = happyTcHack x happyFail -action_374 x = happyTcHack x happyReduce_195 +action_374 x = happyTcHack x happyReduce_159 -action_375 x = happyTcHack x happyReduce_215 +action_375 x = happyTcHack x happyReduce_33 -action_376 (96#) = happyShift action_106 -action_376 (98#) = happyShift action_107 -action_376 (104#) = happyShift action_108 -action_376 (110#) = happyShift action_109 -action_376 (111#) = happyShift action_110 -action_376 (114#) = happyShift action_111 -action_376 (121#) = happyShift action_112 -action_376 (170#) = happyShift action_6 -action_376 (171#) = happyShift action_48 -action_376 (172#) = happyShift action_49 -action_376 (174#) = happyShift action_51 -action_376 (8#) = happyGoto action_101 -action_376 (9#) = happyGoto action_102 -action_376 (10#) = happyGoto action_103 -action_376 (12#) = happyGoto action_104 -action_376 (67#) = happyGoto action_188 -action_376 (74#) = happyGoto action_458 -action_376 x = happyTcHack x happyReduce_205 +action_376 (104#) = happyShift action_378 +action_376 x = happyTcHack x happyReduce_66 -action_377 x = happyTcHack x happyReduce_249 +action_377 x = happyTcHack x happyReduce_32 -action_378 x = happyTcHack x happyReduce_219 +action_378 (174#) = happyShift action_48 +action_378 (12#) = happyGoto action_241 +action_378 (32#) = happyGoto action_461 +action_378 (33#) = happyGoto action_376 +action_378 x = happyTcHack x happyReduce_65 -action_379 x = happyTcHack x happyReduce_218 +action_379 (98#) = happyShift action_408 +action_379 (174#) = happyShift action_48 +action_379 (12#) = happyGoto action_406 +action_379 (27#) = happyGoto action_460 +action_379 (29#) = happyGoto action_425 +action_379 x = happyTcHack x happyReduce_52 -action_380 x = happyTcHack x happyReduce_251 +action_380 (174#) = happyShift action_48 +action_380 (12#) = happyGoto action_241 +action_380 (33#) = happyGoto action_459 +action_380 x = happyTcHack x happyReduce_50 -action_381 x = happyTcHack x happyReduce_164 +action_381 x = happyTcHack x happyReduce_26 -action_382 x = happyTcHack x happyReduce_165 +action_382 (98#) = happyShift action_408 +action_382 (174#) = happyShift action_48 +action_382 (12#) = happyGoto action_406 +action_382 (27#) = happyGoto action_458 +action_382 (29#) = happyGoto action_425 +action_382 x = happyTcHack x happyReduce_52 action_383 (89#) = happyGoto action_457 action_383 x = happyTcHack x happyReduce_262 -action_384 (104#) = happyShift action_290 -action_384 (174#) = happyShift action_51 +action_384 (123#) = happyShift action_290 +action_384 (174#) = happyShift action_48 action_384 (12#) = happyGoto action_287 action_384 (36#) = happyGoto action_288 action_384 (46#) = happyGoto action_456 action_384 x = happyTcHack x happyReduce_113 -action_385 (96#) = happyShift action_140 +action_385 (97#) = happyShift action_86 action_385 (98#) = happyShift action_455 -action_385 (104#) = happyShift action_26 -action_385 (109#) = happyShift action_83 -action_385 (110#) = happyShift action_28 -action_385 (111#) = happyShift action_29 -action_385 (125#) = happyShift action_33 -action_385 (126#) = happyShift action_34 -action_385 (127#) = happyShift action_35 -action_385 (128#) = happyShift action_36 -action_385 (129#) = happyShift action_37 -action_385 (134#) = happyShift action_39 +action_385 (111#) = happyShift action_24 +action_385 (115#) = happyShift action_25 +action_385 (118#) = happyShift action_27 +action_385 (119#) = happyShift action_28 +action_385 (120#) = happyShift action_29 +action_385 (121#) = happyShift action_30 +action_385 (122#) = happyShift action_31 +action_385 (123#) = happyShift action_32 +action_385 (131#) = happyShift action_35 +action_385 (167#) = happyShift action_139 action_385 (170#) = happyShift action_6 -action_385 (171#) = happyShift action_48 -action_385 (172#) = happyShift action_49 -action_385 (173#) = happyShift action_50 -action_385 (174#) = happyShift action_51 -action_385 (8#) = happyGoto action_10 -action_385 (9#) = happyGoto action_11 -action_385 (10#) = happyGoto action_12 -action_385 (11#) = happyGoto action_13 -action_385 (12#) = happyGoto action_79 +action_385 (171#) = happyShift action_45 +action_385 (172#) = happyShift action_46 +action_385 (173#) = happyShift action_47 +action_385 (174#) = happyShift action_48 +action_385 (8#) = happyGoto action_7 +action_385 (9#) = happyGoto action_8 +action_385 (10#) = happyGoto action_9 +action_385 (11#) = happyGoto action_10 +action_385 (12#) = happyGoto action_84 action_385 (58#) = happyGoto action_453 -action_385 (72#) = happyGoto action_22 +action_385 (72#) = happyGoto action_19 action_385 (88#) = happyGoto action_454 action_385 x = happyTcHack x happyReduce_95 -action_386 (174#) = happyShift action_51 +action_386 (174#) = happyShift action_48 action_386 (12#) = happyGoto action_451 action_386 (38#) = happyGoto action_284 action_386 (48#) = happyGoto action_452 action_386 x = happyTcHack x happyReduce_117 -action_387 (174#) = happyShift action_51 +action_387 (174#) = happyShift action_48 action_387 (12#) = happyGoto action_448 action_387 (39#) = happyGoto action_449 action_387 (40#) = happyGoto action_450 action_387 x = happyTcHack x happyReduce_102 -action_388 (174#) = happyShift action_51 +action_388 (174#) = happyShift action_48 action_388 (12#) = happyGoto action_279 action_388 (44#) = happyGoto action_280 action_388 (51#) = happyGoto action_447 action_388 x = happyTcHack x happyReduce_123 -action_389 (174#) = happyShift action_51 +action_389 (174#) = happyShift action_48 action_389 (12#) = happyGoto action_446 action_389 x = happyTcHack x happyFail -action_390 (96#) = happyShift action_24 -action_390 (98#) = happyShift action_25 -action_390 (104#) = happyShift action_26 -action_390 (109#) = happyShift action_27 -action_390 (110#) = happyShift action_28 -action_390 (111#) = happyShift action_29 -action_390 (114#) = happyShift action_30 -action_390 (119#) = happyShift action_31 -action_390 (124#) = happyShift action_32 -action_390 (125#) = happyShift action_33 -action_390 (126#) = happyShift action_34 -action_390 (127#) = happyShift action_35 -action_390 (128#) = happyShift action_36 -action_390 (129#) = happyShift action_37 -action_390 (131#) = happyShift action_38 -action_390 (134#) = happyShift action_39 -action_390 (137#) = happyShift action_40 -action_390 (140#) = happyShift action_41 -action_390 (145#) = happyShift action_42 -action_390 (156#) = happyShift action_43 -action_390 (157#) = happyShift action_44 -action_390 (161#) = happyShift action_45 -action_390 (162#) = happyShift action_46 -action_390 (167#) = happyShift action_47 +action_390 (95#) = happyShift action_21 +action_390 (97#) = happyShift action_22 +action_390 (98#) = happyShift action_23 +action_390 (111#) = happyShift action_24 +action_390 (115#) = happyShift action_25 +action_390 (117#) = happyShift action_26 +action_390 (118#) = happyShift action_27 +action_390 (119#) = happyShift action_28 +action_390 (120#) = happyShift action_29 +action_390 (121#) = happyShift action_30 +action_390 (122#) = happyShift action_31 +action_390 (123#) = happyShift action_32 +action_390 (124#) = happyShift action_33 +action_390 (128#) = happyShift action_34 +action_390 (131#) = happyShift action_35 +action_390 (134#) = happyShift action_36 +action_390 (137#) = happyShift action_37 +action_390 (142#) = happyShift action_38 +action_390 (153#) = happyShift action_39 +action_390 (154#) = happyShift action_40 +action_390 (158#) = happyShift action_41 +action_390 (159#) = happyShift action_42 +action_390 (164#) = happyShift action_43 +action_390 (167#) = happyShift action_44 action_390 (170#) = happyShift action_6 -action_390 (171#) = happyShift action_48 -action_390 (172#) = happyShift action_49 -action_390 (173#) = happyShift action_50 -action_390 (174#) = happyShift action_51 -action_390 (8#) = happyGoto action_10 -action_390 (9#) = happyGoto action_11 -action_390 (10#) = happyGoto action_12 -action_390 (11#) = happyGoto action_13 -action_390 (12#) = happyGoto action_14 -action_390 (58#) = happyGoto action_15 -action_390 (59#) = happyGoto action_16 -action_390 (60#) = happyGoto action_17 -action_390 (61#) = happyGoto action_18 -action_390 (62#) = happyGoto action_19 +action_390 (171#) = happyShift action_45 +action_390 (172#) = happyShift action_46 +action_390 (173#) = happyShift action_47 +action_390 (174#) = happyShift action_48 +action_390 (8#) = happyGoto action_7 +action_390 (9#) = happyGoto action_8 +action_390 (10#) = happyGoto action_9 +action_390 (11#) = happyGoto action_10 +action_390 (12#) = happyGoto action_11 +action_390 (58#) = happyGoto action_12 +action_390 (59#) = happyGoto action_13 +action_390 (60#) = happyGoto action_14 +action_390 (61#) = happyGoto action_15 +action_390 (62#) = happyGoto action_16 action_390 (63#) = happyGoto action_445 -action_390 (64#) = happyGoto action_21 -action_390 (72#) = happyGoto action_22 -action_390 (77#) = happyGoto action_23 +action_390 (64#) = happyGoto action_18 +action_390 (72#) = happyGoto action_19 +action_390 (77#) = happyGoto action_20 action_390 x = happyTcHack x happyFail -action_391 (174#) = happyShift action_51 -action_391 (12#) = happyGoto action_87 +action_391 (174#) = happyShift action_48 +action_391 (12#) = happyGoto action_92 action_391 (37#) = happyGoto action_276 action_391 (47#) = happyGoto action_444 action_391 (53#) = happyGoto action_278 action_391 x = happyTcHack x happyReduce_115 -action_392 (96#) = happyShift action_443 +action_392 (167#) = happyShift action_443 action_392 x = happyTcHack x happyFail -action_393 (174#) = happyShift action_51 +action_393 (174#) = happyShift action_48 action_393 (12#) = happyGoto action_267 action_393 (41#) = happyGoto action_268 action_393 (49#) = happyGoto action_442 action_393 x = happyTcHack x happyReduce_119 action_394 (98#) = happyShift action_441 -action_394 (174#) = happyShift action_51 +action_394 (174#) = happyShift action_48 action_394 (12#) = happyGoto action_438 action_394 (42#) = happyGoto action_439 action_394 (52#) = happyGoto action_440 @@ -4301,60 +4299,60 @@ action_395 x = happyTcHack x happyReduce_87 action_396 x = happyTcHack x happyReduce_86 -action_397 (96#) = happyShift action_24 -action_397 (98#) = happyShift action_25 -action_397 (104#) = happyShift action_26 -action_397 (109#) = happyShift action_27 -action_397 (110#) = happyShift action_28 -action_397 (111#) = happyShift action_29 -action_397 (114#) = happyShift action_30 -action_397 (119#) = happyShift action_31 -action_397 (124#) = happyShift action_32 -action_397 (125#) = happyShift action_33 -action_397 (126#) = happyShift action_34 -action_397 (127#) = happyShift action_35 -action_397 (128#) = happyShift action_36 -action_397 (129#) = happyShift action_37 -action_397 (131#) = happyShift action_38 -action_397 (134#) = happyShift action_39 -action_397 (137#) = happyShift action_40 -action_397 (140#) = happyShift action_41 -action_397 (145#) = happyShift action_42 -action_397 (156#) = happyShift action_43 -action_397 (157#) = happyShift action_44 -action_397 (161#) = happyShift action_45 -action_397 (162#) = happyShift action_46 -action_397 (167#) = happyShift action_47 +action_397 (95#) = happyShift action_21 +action_397 (97#) = happyShift action_22 +action_397 (98#) = happyShift action_23 +action_397 (111#) = happyShift action_24 +action_397 (115#) = happyShift action_25 +action_397 (117#) = happyShift action_26 +action_397 (118#) = happyShift action_27 +action_397 (119#) = happyShift action_28 +action_397 (120#) = happyShift action_29 +action_397 (121#) = happyShift action_30 +action_397 (122#) = happyShift action_31 +action_397 (123#) = happyShift action_32 +action_397 (124#) = happyShift action_33 +action_397 (128#) = happyShift action_34 +action_397 (131#) = happyShift action_35 +action_397 (134#) = happyShift action_36 +action_397 (137#) = happyShift action_37 +action_397 (142#) = happyShift action_38 +action_397 (153#) = happyShift action_39 +action_397 (154#) = happyShift action_40 +action_397 (158#) = happyShift action_41 +action_397 (159#) = happyShift action_42 +action_397 (164#) = happyShift action_43 +action_397 (167#) = happyShift action_44 action_397 (170#) = happyShift action_6 -action_397 (171#) = happyShift action_48 -action_397 (172#) = happyShift action_49 -action_397 (173#) = happyShift action_50 -action_397 (174#) = happyShift action_51 -action_397 (8#) = happyGoto action_10 -action_397 (9#) = happyGoto action_11 -action_397 (10#) = happyGoto action_12 -action_397 (11#) = happyGoto action_13 -action_397 (12#) = happyGoto action_14 -action_397 (58#) = happyGoto action_15 -action_397 (59#) = happyGoto action_16 -action_397 (60#) = happyGoto action_17 -action_397 (61#) = happyGoto action_18 -action_397 (62#) = happyGoto action_19 +action_397 (171#) = happyShift action_45 +action_397 (172#) = happyShift action_46 +action_397 (173#) = happyShift action_47 +action_397 (174#) = happyShift action_48 +action_397 (8#) = happyGoto action_7 +action_397 (9#) = happyGoto action_8 +action_397 (10#) = happyGoto action_9 +action_397 (11#) = happyGoto action_10 +action_397 (12#) = happyGoto action_11 +action_397 (58#) = happyGoto action_12 +action_397 (59#) = happyGoto action_13 +action_397 (60#) = happyGoto action_14 +action_397 (61#) = happyGoto action_15 +action_397 (62#) = happyGoto action_16 action_397 (63#) = happyGoto action_437 -action_397 (64#) = happyGoto action_21 -action_397 (72#) = happyGoto action_22 -action_397 (77#) = happyGoto action_23 +action_397 (64#) = happyGoto action_18 +action_397 (72#) = happyGoto action_19 +action_397 (77#) = happyGoto action_20 action_397 x = happyTcHack x happyFail -action_398 (104#) = happyShift action_257 -action_398 (174#) = happyShift action_51 +action_398 (123#) = happyShift action_257 +action_398 (174#) = happyShift action_48 action_398 (12#) = happyGoto action_252 action_398 (54#) = happyGoto action_262 action_398 (55#) = happyGoto action_436 action_398 x = happyTcHack x happyFail -action_399 (104#) = happyShift action_257 -action_399 (174#) = happyShift action_51 +action_399 (123#) = happyShift action_257 +action_399 (174#) = happyShift action_48 action_399 (12#) = happyGoto action_252 action_399 (43#) = happyGoto action_260 action_399 (50#) = happyGoto action_435 @@ -4364,104 +4362,104 @@ action_399 x = happyTcHack x happyReduce_121 action_400 x = happyTcHack x happyReduce_94 -action_401 (105#) = happyShift action_434 +action_401 (125#) = happyShift action_434 action_401 x = happyTcHack x happyFail -action_402 (96#) = happyShift action_24 -action_402 (98#) = happyShift action_25 -action_402 (104#) = happyShift action_26 -action_402 (109#) = happyShift action_27 -action_402 (110#) = happyShift action_28 -action_402 (111#) = happyShift action_29 -action_402 (114#) = happyShift action_30 -action_402 (119#) = happyShift action_31 -action_402 (124#) = happyShift action_32 -action_402 (125#) = happyShift action_33 -action_402 (126#) = happyShift action_34 -action_402 (127#) = happyShift action_35 -action_402 (128#) = happyShift action_36 -action_402 (129#) = happyShift action_37 -action_402 (131#) = happyShift action_38 -action_402 (134#) = happyShift action_39 -action_402 (137#) = happyShift action_40 -action_402 (140#) = happyShift action_41 -action_402 (145#) = happyShift action_42 -action_402 (156#) = happyShift action_43 -action_402 (157#) = happyShift action_44 -action_402 (161#) = happyShift action_45 -action_402 (162#) = happyShift action_46 -action_402 (167#) = happyShift action_47 +action_402 (95#) = happyShift action_21 +action_402 (97#) = happyShift action_22 +action_402 (98#) = happyShift action_23 +action_402 (111#) = happyShift action_24 +action_402 (115#) = happyShift action_25 +action_402 (117#) = happyShift action_26 +action_402 (118#) = happyShift action_27 +action_402 (119#) = happyShift action_28 +action_402 (120#) = happyShift action_29 +action_402 (121#) = happyShift action_30 +action_402 (122#) = happyShift action_31 +action_402 (123#) = happyShift action_32 +action_402 (124#) = happyShift action_33 +action_402 (128#) = happyShift action_34 +action_402 (131#) = happyShift action_35 +action_402 (134#) = happyShift action_36 +action_402 (137#) = happyShift action_37 +action_402 (142#) = happyShift action_38 +action_402 (153#) = happyShift action_39 +action_402 (154#) = happyShift action_40 +action_402 (158#) = happyShift action_41 +action_402 (159#) = happyShift action_42 +action_402 (164#) = happyShift action_43 +action_402 (167#) = happyShift action_44 action_402 (170#) = happyShift action_6 -action_402 (171#) = happyShift action_48 -action_402 (172#) = happyShift action_49 -action_402 (173#) = happyShift action_50 -action_402 (174#) = happyShift action_51 -action_402 (8#) = happyGoto action_10 -action_402 (9#) = happyGoto action_11 -action_402 (10#) = happyGoto action_12 -action_402 (11#) = happyGoto action_13 -action_402 (12#) = happyGoto action_14 -action_402 (58#) = happyGoto action_15 -action_402 (59#) = happyGoto action_16 -action_402 (60#) = happyGoto action_17 -action_402 (61#) = happyGoto action_18 -action_402 (62#) = happyGoto action_19 +action_402 (171#) = happyShift action_45 +action_402 (172#) = happyShift action_46 +action_402 (173#) = happyShift action_47 +action_402 (174#) = happyShift action_48 +action_402 (8#) = happyGoto action_7 +action_402 (9#) = happyGoto action_8 +action_402 (10#) = happyGoto action_9 +action_402 (11#) = happyGoto action_10 +action_402 (12#) = happyGoto action_11 +action_402 (58#) = happyGoto action_12 +action_402 (59#) = happyGoto action_13 +action_402 (60#) = happyGoto action_14 +action_402 (61#) = happyGoto action_15 +action_402 (62#) = happyGoto action_16 action_402 (63#) = happyGoto action_433 -action_402 (64#) = happyGoto action_21 -action_402 (72#) = happyGoto action_22 -action_402 (77#) = happyGoto action_23 +action_402 (64#) = happyGoto action_18 +action_402 (72#) = happyGoto action_19 +action_402 (77#) = happyGoto action_20 action_402 x = happyTcHack x happyFail -action_403 (96#) = happyShift action_24 -action_403 (98#) = happyShift action_25 -action_403 (104#) = happyShift action_26 -action_403 (109#) = happyShift action_27 -action_403 (110#) = happyShift action_28 -action_403 (111#) = happyShift action_29 -action_403 (114#) = happyShift action_30 -action_403 (119#) = happyShift action_31 -action_403 (124#) = happyShift action_32 -action_403 (125#) = happyShift action_33 -action_403 (126#) = happyShift action_34 -action_403 (127#) = happyShift action_35 -action_403 (128#) = happyShift action_36 -action_403 (129#) = happyShift action_37 -action_403 (131#) = happyShift action_38 -action_403 (134#) = happyShift action_39 -action_403 (137#) = happyShift action_40 -action_403 (140#) = happyShift action_41 -action_403 (145#) = happyShift action_42 -action_403 (156#) = happyShift action_43 -action_403 (157#) = happyShift action_44 -action_403 (161#) = happyShift action_45 -action_403 (162#) = happyShift action_46 -action_403 (167#) = happyShift action_47 +action_403 (95#) = happyShift action_21 +action_403 (97#) = happyShift action_22 +action_403 (98#) = happyShift action_23 +action_403 (111#) = happyShift action_24 +action_403 (115#) = happyShift action_25 +action_403 (117#) = happyShift action_26 +action_403 (118#) = happyShift action_27 +action_403 (119#) = happyShift action_28 +action_403 (120#) = happyShift action_29 +action_403 (121#) = happyShift action_30 +action_403 (122#) = happyShift action_31 +action_403 (123#) = happyShift action_32 +action_403 (124#) = happyShift action_33 +action_403 (128#) = happyShift action_34 +action_403 (131#) = happyShift action_35 +action_403 (134#) = happyShift action_36 +action_403 (137#) = happyShift action_37 +action_403 (142#) = happyShift action_38 +action_403 (153#) = happyShift action_39 +action_403 (154#) = happyShift action_40 +action_403 (158#) = happyShift action_41 +action_403 (159#) = happyShift action_42 +action_403 (164#) = happyShift action_43 +action_403 (167#) = happyShift action_44 action_403 (170#) = happyShift action_6 -action_403 (171#) = happyShift action_48 -action_403 (172#) = happyShift action_49 -action_403 (173#) = happyShift action_50 -action_403 (174#) = happyShift action_51 -action_403 (8#) = happyGoto action_10 -action_403 (9#) = happyGoto action_11 -action_403 (10#) = happyGoto action_12 -action_403 (11#) = happyGoto action_13 -action_403 (12#) = happyGoto action_14 -action_403 (58#) = happyGoto action_15 -action_403 (59#) = happyGoto action_16 -action_403 (60#) = happyGoto action_17 -action_403 (61#) = happyGoto action_18 -action_403 (62#) = happyGoto action_19 +action_403 (171#) = happyShift action_45 +action_403 (172#) = happyShift action_46 +action_403 (173#) = happyShift action_47 +action_403 (174#) = happyShift action_48 +action_403 (8#) = happyGoto action_7 +action_403 (9#) = happyGoto action_8 +action_403 (10#) = happyGoto action_9 +action_403 (11#) = happyGoto action_10 +action_403 (12#) = happyGoto action_11 +action_403 (58#) = happyGoto action_12 +action_403 (59#) = happyGoto action_13 +action_403 (60#) = happyGoto action_14 +action_403 (61#) = happyGoto action_15 +action_403 (62#) = happyGoto action_16 action_403 (63#) = happyGoto action_432 -action_403 (64#) = happyGoto action_21 -action_403 (72#) = happyGoto action_22 -action_403 (77#) = happyGoto action_23 +action_403 (64#) = happyGoto action_18 +action_403 (72#) = happyGoto action_19 +action_403 (77#) = happyGoto action_20 action_403 x = happyTcHack x happyFail -action_404 (95#) = happyShift action_431 +action_404 (112#) = happyShift action_431 action_404 x = happyTcHack x happyFail -action_405 (104#) = happyShift action_257 -action_405 (174#) = happyShift action_51 +action_405 (123#) = happyShift action_257 +action_405 (174#) = happyShift action_48 action_405 (12#) = happyGoto action_252 action_405 (34#) = happyGoto action_253 action_405 (45#) = happyGoto action_430 @@ -4471,11 +4469,11 @@ action_405 x = happyTcHack x happyReduce_111 action_406 x = happyTcHack x happyReduce_57 -action_407 (101#) = happyShift action_429 +action_407 (106#) = happyShift action_429 action_407 x = happyTcHack x happyFail -action_408 (142#) = happyShift action_427 -action_408 (144#) = happyShift action_428 +action_408 (139#) = happyShift action_427 +action_408 (141#) = happyShift action_428 action_408 (31#) = happyGoto action_426 action_408 x = happyTcHack x happyReduce_62 @@ -4488,56 +4486,56 @@ action_411 x = happyTcHack x happyReduce_47 action_412 x = happyTcHack x happyReduce_46 action_413 (98#) = happyShift action_408 -action_413 (174#) = happyShift action_51 +action_413 (174#) = happyShift action_48 action_413 (12#) = happyGoto action_406 action_413 (27#) = happyGoto action_424 action_413 (29#) = happyGoto action_425 action_413 x = happyTcHack x happyReduce_52 -action_414 (174#) = happyShift action_51 +action_414 (174#) = happyShift action_48 action_414 (12#) = happyGoto action_241 action_414 (33#) = happyGoto action_423 action_414 x = happyTcHack x happyReduce_50 -action_415 (96#) = happyShift action_422 +action_415 (167#) = happyShift action_422 action_415 x = happyTcHack x happyFail -action_416 (174#) = happyShift action_51 -action_416 (12#) = happyGoto action_87 -action_416 (53#) = happyGoto action_421 +action_416 (123#) = happyShift action_421 action_416 x = happyTcHack x happyFail -action_417 (104#) = happyShift action_420 +action_417 (174#) = happyShift action_48 +action_417 (12#) = happyGoto action_92 +action_417 (53#) = happyGoto action_420 action_417 x = happyTcHack x happyFail -action_418 (95#) = happyShift action_419 +action_418 (112#) = happyShift action_419 action_418 x = happyTcHack x happyFail -action_419 (174#) = happyShift action_51 +action_419 (174#) = happyShift action_48 action_419 (12#) = happyGoto action_492 action_419 x = happyTcHack x happyFail -action_420 (174#) = happyShift action_51 -action_420 (12#) = happyGoto action_87 -action_420 (53#) = happyGoto action_491 +action_420 (125#) = happyShift action_491 action_420 x = happyTcHack x happyFail -action_421 (105#) = happyShift action_490 +action_421 (174#) = happyShift action_48 +action_421 (12#) = happyGoto action_92 +action_421 (53#) = happyGoto action_490 action_421 x = happyTcHack x happyFail action_422 (25#) = happyGoto action_489 action_422 x = happyTcHack x happyReduce_48 -action_423 (169#) = happyShift action_488 +action_423 (166#) = happyShift action_488 action_423 x = happyTcHack x happyFail -action_424 (102#) = happyShift action_487 +action_424 (101#) = happyShift action_487 action_424 x = happyTcHack x happyReduce_42 -action_425 (103#) = happyShift action_486 +action_425 (104#) = happyShift action_486 action_425 x = happyTcHack x happyReduce_53 -action_426 (174#) = happyShift action_51 +action_426 (174#) = happyShift action_48 action_426 (12#) = happyGoto action_485 action_426 x = happyTcHack x happyFail @@ -4546,62 +4544,62 @@ action_427 x = happyTcHack x happyReduce_63 action_428 x = happyTcHack x happyReduce_64 action_429 (98#) = happyShift action_408 -action_429 (174#) = happyShift action_51 +action_429 (174#) = happyShift action_48 action_429 (12#) = happyGoto action_406 action_429 (29#) = happyGoto action_484 action_429 x = happyTcHack x happyFail action_430 x = happyTcHack x happyReduce_112 -action_431 (96#) = happyShift action_24 -action_431 (98#) = happyShift action_25 -action_431 (104#) = happyShift action_26 -action_431 (109#) = happyShift action_27 -action_431 (110#) = happyShift action_28 -action_431 (111#) = happyShift action_29 -action_431 (114#) = happyShift action_30 -action_431 (119#) = happyShift action_31 -action_431 (124#) = happyShift action_32 -action_431 (125#) = happyShift action_33 -action_431 (126#) = happyShift action_34 -action_431 (127#) = happyShift action_35 -action_431 (128#) = happyShift action_36 -action_431 (129#) = happyShift action_37 -action_431 (131#) = happyShift action_38 -action_431 (134#) = happyShift action_39 -action_431 (137#) = happyShift action_40 -action_431 (140#) = happyShift action_41 -action_431 (145#) = happyShift action_42 -action_431 (156#) = happyShift action_43 -action_431 (157#) = happyShift action_44 -action_431 (161#) = happyShift action_45 -action_431 (162#) = happyShift action_46 -action_431 (167#) = happyShift action_47 +action_431 (95#) = happyShift action_21 +action_431 (97#) = happyShift action_22 +action_431 (98#) = happyShift action_23 +action_431 (111#) = happyShift action_24 +action_431 (115#) = happyShift action_25 +action_431 (117#) = happyShift action_26 +action_431 (118#) = happyShift action_27 +action_431 (119#) = happyShift action_28 +action_431 (120#) = happyShift action_29 +action_431 (121#) = happyShift action_30 +action_431 (122#) = happyShift action_31 +action_431 (123#) = happyShift action_32 +action_431 (124#) = happyShift action_33 +action_431 (128#) = happyShift action_34 +action_431 (131#) = happyShift action_35 +action_431 (134#) = happyShift action_36 +action_431 (137#) = happyShift action_37 +action_431 (142#) = happyShift action_38 +action_431 (153#) = happyShift action_39 +action_431 (154#) = happyShift action_40 +action_431 (158#) = happyShift action_41 +action_431 (159#) = happyShift action_42 +action_431 (164#) = happyShift action_43 +action_431 (167#) = happyShift action_44 action_431 (170#) = happyShift action_6 -action_431 (171#) = happyShift action_48 -action_431 (172#) = happyShift action_49 -action_431 (173#) = happyShift action_50 -action_431 (174#) = happyShift action_51 -action_431 (8#) = happyGoto action_10 -action_431 (9#) = happyGoto action_11 -action_431 (10#) = happyGoto action_12 -action_431 (11#) = happyGoto action_13 -action_431 (12#) = happyGoto action_14 -action_431 (58#) = happyGoto action_15 -action_431 (59#) = happyGoto action_16 -action_431 (60#) = happyGoto action_17 -action_431 (61#) = happyGoto action_18 -action_431 (62#) = happyGoto action_19 +action_431 (171#) = happyShift action_45 +action_431 (172#) = happyShift action_46 +action_431 (173#) = happyShift action_47 +action_431 (174#) = happyShift action_48 +action_431 (8#) = happyGoto action_7 +action_431 (9#) = happyGoto action_8 +action_431 (10#) = happyGoto action_9 +action_431 (11#) = happyGoto action_10 +action_431 (12#) = happyGoto action_11 +action_431 (58#) = happyGoto action_12 +action_431 (59#) = happyGoto action_13 +action_431 (60#) = happyGoto action_14 +action_431 (61#) = happyGoto action_15 +action_431 (62#) = happyGoto action_16 action_431 (63#) = happyGoto action_483 -action_431 (64#) = happyGoto action_21 -action_431 (72#) = happyGoto action_22 -action_431 (77#) = happyGoto action_23 +action_431 (64#) = happyGoto action_18 +action_431 (72#) = happyGoto action_19 +action_431 (77#) = happyGoto action_20 action_431 x = happyTcHack x happyFail -action_432 (95#) = happyShift action_482 -action_432 x = happyTcHack x happyReduce_71 +action_432 x = happyTcHack x happyReduce_72 -action_433 x = happyTcHack x happyReduce_72 +action_433 (112#) = happyShift action_482 +action_433 x = happyTcHack x happyReduce_71 action_434 x = happyTcHack x happyReduce_131 @@ -4614,12 +4612,12 @@ action_437 x = happyTcHack x happyReduce_109 action_438 (89#) = happyGoto action_481 action_438 x = happyTcHack x happyReduce_262 -action_439 (108#) = happyShift action_480 +action_439 (168#) = happyShift action_480 action_439 x = happyTcHack x happyReduce_126 action_440 x = happyTcHack x happyReduce_105 -action_441 (140#) = happyShift action_479 +action_441 (137#) = happyShift action_479 action_441 x = happyTcHack x happyFail action_442 x = happyTcHack x happyReduce_120 @@ -4638,12 +4636,12 @@ action_447 x = happyTcHack x happyReduce_124 action_448 (107#) = happyShift action_477 action_448 x = happyTcHack x happyReduce_100 -action_449 (108#) = happyShift action_476 +action_449 (168#) = happyShift action_476 action_449 x = happyTcHack x happyReduce_103 action_450 x = happyTcHack x happyReduce_99 -action_451 (95#) = happyShift action_387 +action_451 (112#) = happyShift action_387 action_451 x = happyTcHack x happyFail action_452 x = happyTcHack x happyReduce_118 @@ -4652,389 +4650,389 @@ action_453 x = happyTcHack x happyReduce_261 action_454 x = happyTcHack x happyReduce_263 -action_455 (96#) = happyShift action_24 -action_455 (98#) = happyShift action_25 -action_455 (104#) = happyShift action_26 -action_455 (109#) = happyShift action_27 -action_455 (110#) = happyShift action_28 -action_455 (111#) = happyShift action_29 -action_455 (114#) = happyShift action_30 -action_455 (119#) = happyShift action_31 -action_455 (121#) = happyShift action_100 -action_455 (124#) = happyShift action_32 -action_455 (125#) = happyShift action_33 -action_455 (126#) = happyShift action_34 -action_455 (127#) = happyShift action_35 -action_455 (128#) = happyShift action_36 -action_455 (129#) = happyShift action_37 -action_455 (131#) = happyShift action_38 -action_455 (134#) = happyShift action_39 -action_455 (137#) = happyShift action_40 -action_455 (140#) = happyShift action_123 -action_455 (145#) = happyShift action_42 -action_455 (156#) = happyShift action_43 -action_455 (157#) = happyShift action_44 -action_455 (161#) = happyShift action_45 -action_455 (162#) = happyShift action_46 -action_455 (167#) = happyShift action_47 +action_455 (95#) = happyShift action_21 +action_455 (97#) = happyShift action_22 +action_455 (98#) = happyShift action_23 +action_455 (111#) = happyShift action_24 +action_455 (115#) = happyShift action_25 +action_455 (117#) = happyShift action_26 +action_455 (118#) = happyShift action_27 +action_455 (119#) = happyShift action_28 +action_455 (120#) = happyShift action_29 +action_455 (121#) = happyShift action_30 +action_455 (122#) = happyShift action_31 +action_455 (123#) = happyShift action_32 +action_455 (124#) = happyShift action_33 +action_455 (126#) = happyShift action_102 +action_455 (128#) = happyShift action_34 +action_455 (131#) = happyShift action_35 +action_455 (134#) = happyShift action_36 +action_455 (137#) = happyShift action_113 +action_455 (142#) = happyShift action_38 +action_455 (153#) = happyShift action_39 +action_455 (154#) = happyShift action_40 +action_455 (158#) = happyShift action_41 +action_455 (159#) = happyShift action_42 +action_455 (164#) = happyShift action_43 +action_455 (167#) = happyShift action_44 action_455 (170#) = happyShift action_6 -action_455 (171#) = happyShift action_48 -action_455 (172#) = happyShift action_49 -action_455 (173#) = happyShift action_50 -action_455 (174#) = happyShift action_51 -action_455 (8#) = happyGoto action_10 -action_455 (9#) = happyGoto action_11 -action_455 (10#) = happyGoto action_12 -action_455 (11#) = happyGoto action_13 -action_455 (12#) = happyGoto action_120 -action_455 (58#) = happyGoto action_15 -action_455 (59#) = happyGoto action_16 -action_455 (60#) = happyGoto action_17 -action_455 (61#) = happyGoto action_18 -action_455 (62#) = happyGoto action_19 -action_455 (63#) = happyGoto action_121 -action_455 (64#) = happyGoto action_21 -action_455 (72#) = happyGoto action_22 -action_455 (75#) = happyGoto action_97 +action_455 (171#) = happyShift action_45 +action_455 (172#) = happyShift action_46 +action_455 (173#) = happyShift action_47 +action_455 (174#) = happyShift action_48 +action_455 (8#) = happyGoto action_7 +action_455 (9#) = happyGoto action_8 +action_455 (10#) = happyGoto action_9 +action_455 (11#) = happyGoto action_10 +action_455 (12#) = happyGoto action_110 +action_455 (58#) = happyGoto action_12 +action_455 (59#) = happyGoto action_13 +action_455 (60#) = happyGoto action_14 +action_455 (61#) = happyGoto action_15 +action_455 (62#) = happyGoto action_16 +action_455 (63#) = happyGoto action_111 +action_455 (64#) = happyGoto action_18 +action_455 (72#) = happyGoto action_19 +action_455 (75#) = happyGoto action_99 action_455 (76#) = happyGoto action_475 -action_455 (77#) = happyGoto action_23 +action_455 (77#) = happyGoto action_20 action_455 x = happyTcHack x happyReduce_236 action_456 x = happyTcHack x happyReduce_114 -action_457 (96#) = happyShift action_140 +action_457 (97#) = happyShift action_86 action_457 (98#) = happyShift action_455 -action_457 (104#) = happyShift action_26 -action_457 (105#) = happyShift action_474 -action_457 (109#) = happyShift action_83 -action_457 (110#) = happyShift action_28 -action_457 (111#) = happyShift action_29 -action_457 (125#) = happyShift action_33 -action_457 (126#) = happyShift action_34 -action_457 (127#) = happyShift action_35 -action_457 (128#) = happyShift action_36 -action_457 (129#) = happyShift action_37 -action_457 (134#) = happyShift action_39 +action_457 (111#) = happyShift action_24 +action_457 (115#) = happyShift action_25 +action_457 (118#) = happyShift action_27 +action_457 (119#) = happyShift action_28 +action_457 (120#) = happyShift action_29 +action_457 (121#) = happyShift action_30 +action_457 (122#) = happyShift action_31 +action_457 (123#) = happyShift action_32 +action_457 (125#) = happyShift action_474 +action_457 (131#) = happyShift action_35 +action_457 (167#) = happyShift action_139 action_457 (170#) = happyShift action_6 -action_457 (171#) = happyShift action_48 -action_457 (172#) = happyShift action_49 -action_457 (173#) = happyShift action_50 -action_457 (174#) = happyShift action_51 -action_457 (8#) = happyGoto action_10 -action_457 (9#) = happyGoto action_11 -action_457 (10#) = happyGoto action_12 -action_457 (11#) = happyGoto action_13 -action_457 (12#) = happyGoto action_79 +action_457 (171#) = happyShift action_45 +action_457 (172#) = happyShift action_46 +action_457 (173#) = happyShift action_47 +action_457 (174#) = happyShift action_48 +action_457 (8#) = happyGoto action_7 +action_457 (9#) = happyGoto action_8 +action_457 (10#) = happyGoto action_9 +action_457 (11#) = happyGoto action_10 +action_457 (12#) = happyGoto action_84 action_457 (58#) = happyGoto action_453 -action_457 (72#) = happyGoto action_22 +action_457 (72#) = happyGoto action_19 action_457 (88#) = happyGoto action_454 action_457 x = happyTcHack x happyFail -action_458 x = happyTcHack x happyReduce_213 +action_458 (137#) = happyShift action_473 +action_458 x = happyTcHack x happyFail -action_459 x = happyTcHack x happyReduce_168 +action_459 (166#) = happyShift action_472 +action_459 x = happyTcHack x happyFail -action_460 (96#) = happyShift action_24 -action_460 (98#) = happyShift action_25 -action_460 (104#) = happyShift action_26 -action_460 (109#) = happyShift action_27 -action_460 (110#) = happyShift action_28 -action_460 (111#) = happyShift action_29 -action_460 (114#) = happyShift action_30 -action_460 (119#) = happyShift action_31 -action_460 (124#) = happyShift action_32 -action_460 (125#) = happyShift action_33 -action_460 (126#) = happyShift action_34 -action_460 (127#) = happyShift action_35 -action_460 (128#) = happyShift action_36 -action_460 (129#) = happyShift action_37 -action_460 (131#) = happyShift action_38 -action_460 (134#) = happyShift action_39 -action_460 (137#) = happyShift action_40 -action_460 (140#) = happyShift action_41 -action_460 (145#) = happyShift action_42 -action_460 (156#) = happyShift action_43 -action_460 (157#) = happyShift action_44 -action_460 (161#) = happyShift action_45 -action_460 (162#) = happyShift action_46 -action_460 (167#) = happyShift action_47 -action_460 (170#) = happyShift action_6 -action_460 (171#) = happyShift action_48 -action_460 (172#) = happyShift action_49 -action_460 (173#) = happyShift action_50 -action_460 (174#) = happyShift action_51 -action_460 (8#) = happyGoto action_10 -action_460 (9#) = happyGoto action_11 -action_460 (10#) = happyGoto action_12 -action_460 (11#) = happyGoto action_13 -action_460 (12#) = happyGoto action_14 -action_460 (58#) = happyGoto action_15 -action_460 (59#) = happyGoto action_16 -action_460 (60#) = happyGoto action_17 -action_460 (61#) = happyGoto action_18 -action_460 (62#) = happyGoto action_19 -action_460 (63#) = happyGoto action_371 -action_460 (64#) = happyGoto action_21 -action_460 (72#) = happyGoto action_22 -action_460 (77#) = happyGoto action_23 -action_460 (86#) = happyGoto action_372 -action_460 (87#) = happyGoto action_473 -action_460 x = happyTcHack x happyReduce_257 +action_460 (101#) = happyShift action_471 +action_460 x = happyTcHack x happyReduce_28 -action_461 (96#) = happyShift action_24 -action_461 (98#) = happyShift action_25 -action_461 (104#) = happyShift action_26 -action_461 (109#) = happyShift action_27 -action_461 (110#) = happyShift action_28 -action_461 (111#) = happyShift action_29 -action_461 (114#) = happyShift action_30 -action_461 (119#) = happyShift action_31 -action_461 (124#) = happyShift action_32 -action_461 (125#) = happyShift action_33 -action_461 (126#) = happyShift action_34 -action_461 (127#) = happyShift action_35 -action_461 (128#) = happyShift action_36 -action_461 (129#) = happyShift action_37 -action_461 (131#) = happyShift action_38 -action_461 (134#) = happyShift action_39 -action_461 (137#) = happyShift action_40 -action_461 (140#) = happyShift action_41 -action_461 (145#) = happyShift action_42 -action_461 (156#) = happyShift action_43 -action_461 (157#) = happyShift action_44 -action_461 (161#) = happyShift action_45 -action_461 (162#) = happyShift action_46 -action_461 (167#) = happyShift action_47 -action_461 (170#) = happyShift action_6 -action_461 (171#) = happyShift action_48 -action_461 (172#) = happyShift action_49 -action_461 (173#) = happyShift action_50 -action_461 (174#) = happyShift action_51 -action_461 (8#) = happyGoto action_10 -action_461 (9#) = happyGoto action_11 -action_461 (10#) = happyGoto action_12 -action_461 (11#) = happyGoto action_13 -action_461 (12#) = happyGoto action_14 -action_461 (58#) = happyGoto action_15 -action_461 (59#) = happyGoto action_16 -action_461 (60#) = happyGoto action_17 -action_461 (61#) = happyGoto action_18 -action_461 (62#) = happyGoto action_19 -action_461 (63#) = happyGoto action_472 -action_461 (64#) = happyGoto action_21 -action_461 (72#) = happyGoto action_22 -action_461 (77#) = happyGoto action_23 -action_461 x = happyTcHack x happyFail +action_461 x = happyTcHack x happyReduce_67 action_462 x = happyTcHack x happyReduce_136 -action_463 x = happyTcHack x happyReduce_186 +action_463 x = happyTcHack x happyReduce_213 -action_464 x = happyTcHack x happyReduce_166 +action_464 x = happyTcHack x happyReduce_168 -action_465 (140#) = happyShift action_471 -action_465 x = happyTcHack x happyFail +action_465 (95#) = happyShift action_21 +action_465 (97#) = happyShift action_22 +action_465 (98#) = happyShift action_23 +action_465 (111#) = happyShift action_24 +action_465 (115#) = happyShift action_25 +action_465 (117#) = happyShift action_26 +action_465 (118#) = happyShift action_27 +action_465 (119#) = happyShift action_28 +action_465 (120#) = happyShift action_29 +action_465 (121#) = happyShift action_30 +action_465 (122#) = happyShift action_31 +action_465 (123#) = happyShift action_32 +action_465 (124#) = happyShift action_33 +action_465 (128#) = happyShift action_34 +action_465 (131#) = happyShift action_35 +action_465 (134#) = happyShift action_36 +action_465 (137#) = happyShift action_37 +action_465 (142#) = happyShift action_38 +action_465 (153#) = happyShift action_39 +action_465 (154#) = happyShift action_40 +action_465 (158#) = happyShift action_41 +action_465 (159#) = happyShift action_42 +action_465 (164#) = happyShift action_43 +action_465 (167#) = happyShift action_44 +action_465 (170#) = happyShift action_6 +action_465 (171#) = happyShift action_45 +action_465 (172#) = happyShift action_46 +action_465 (173#) = happyShift action_47 +action_465 (174#) = happyShift action_48 +action_465 (8#) = happyGoto action_7 +action_465 (9#) = happyGoto action_8 +action_465 (10#) = happyGoto action_9 +action_465 (11#) = happyGoto action_10 +action_465 (12#) = happyGoto action_11 +action_465 (58#) = happyGoto action_12 +action_465 (59#) = happyGoto action_13 +action_465 (60#) = happyGoto action_14 +action_465 (61#) = happyGoto action_15 +action_465 (62#) = happyGoto action_16 +action_465 (63#) = happyGoto action_361 +action_465 (64#) = happyGoto action_18 +action_465 (72#) = happyGoto action_19 +action_465 (77#) = happyGoto action_20 +action_465 (86#) = happyGoto action_362 +action_465 (87#) = happyGoto action_470 +action_465 x = happyTcHack x happyReduce_257 -action_466 (169#) = happyShift action_470 +action_466 (95#) = happyShift action_21 +action_466 (97#) = happyShift action_22 +action_466 (98#) = happyShift action_23 +action_466 (111#) = happyShift action_24 +action_466 (115#) = happyShift action_25 +action_466 (117#) = happyShift action_26 +action_466 (118#) = happyShift action_27 +action_466 (119#) = happyShift action_28 +action_466 (120#) = happyShift action_29 +action_466 (121#) = happyShift action_30 +action_466 (122#) = happyShift action_31 +action_466 (123#) = happyShift action_32 +action_466 (124#) = happyShift action_33 +action_466 (128#) = happyShift action_34 +action_466 (131#) = happyShift action_35 +action_466 (134#) = happyShift action_36 +action_466 (137#) = happyShift action_37 +action_466 (142#) = happyShift action_38 +action_466 (153#) = happyShift action_39 +action_466 (154#) = happyShift action_40 +action_466 (158#) = happyShift action_41 +action_466 (159#) = happyShift action_42 +action_466 (164#) = happyShift action_43 +action_466 (167#) = happyShift action_44 +action_466 (170#) = happyShift action_6 +action_466 (171#) = happyShift action_45 +action_466 (172#) = happyShift action_46 +action_466 (173#) = happyShift action_47 +action_466 (174#) = happyShift action_48 +action_466 (8#) = happyGoto action_7 +action_466 (9#) = happyGoto action_8 +action_466 (10#) = happyGoto action_9 +action_466 (11#) = happyGoto action_10 +action_466 (12#) = happyGoto action_11 +action_466 (58#) = happyGoto action_12 +action_466 (59#) = happyGoto action_13 +action_466 (60#) = happyGoto action_14 +action_466 (61#) = happyGoto action_15 +action_466 (62#) = happyGoto action_16 +action_466 (63#) = happyGoto action_469 +action_466 (64#) = happyGoto action_18 +action_466 (72#) = happyGoto action_19 +action_466 (77#) = happyGoto action_20 action_466 x = happyTcHack x happyFail -action_467 (102#) = happyShift action_469 -action_467 x = happyTcHack x happyReduce_28 +action_467 x = happyTcHack x happyReduce_186 -action_468 x = happyTcHack x happyReduce_67 +action_468 x = happyTcHack x happyReduce_166 -action_469 (151#) = happyShift action_356 -action_469 (28#) = happyGoto action_510 -action_469 x = happyTcHack x happyReduce_55 +action_469 x = happyTcHack x happyReduce_256 -action_470 (98#) = happyShift action_408 -action_470 (174#) = happyShift action_51 -action_470 (12#) = happyGoto action_406 -action_470 (27#) = happyGoto action_509 -action_470 (29#) = happyGoto action_425 -action_470 x = happyTcHack x happyReduce_52 +action_470 x = happyTcHack x happyReduce_259 -action_471 x = happyTcHack x happyReduce_56 +action_471 (148#) = happyShift action_382 +action_471 (28#) = happyGoto action_510 +action_471 x = happyTcHack x happyReduce_55 -action_472 x = happyTcHack x happyReduce_256 +action_472 (98#) = happyShift action_408 +action_472 (174#) = happyShift action_48 +action_472 (12#) = happyGoto action_406 +action_472 (27#) = happyGoto action_509 +action_472 (29#) = happyGoto action_425 +action_472 x = happyTcHack x happyReduce_52 -action_473 x = happyTcHack x happyReduce_259 +action_473 x = happyTcHack x happyReduce_56 -action_474 (96#) = happyShift action_508 +action_474 (167#) = happyShift action_508 action_474 x = happyTcHack x happyReduce_96 -action_475 (100#) = happyShift action_507 +action_475 (109#) = happyShift action_507 action_475 x = happyTcHack x happyFail -action_476 (174#) = happyShift action_51 +action_476 (174#) = happyShift action_48 action_476 (12#) = happyGoto action_448 action_476 (39#) = happyGoto action_449 action_476 (40#) = happyGoto action_506 action_476 x = happyTcHack x happyReduce_102 -action_477 (174#) = happyShift action_51 +action_477 (174#) = happyShift action_48 action_477 (12#) = happyGoto action_505 action_477 x = happyTcHack x happyFail -action_478 (97#) = happyShift action_504 -action_478 (132#) = happyShift action_210 -action_478 (134#) = happyShift action_211 -action_478 (135#) = happyShift action_212 -action_478 (136#) = happyShift action_213 -action_478 (138#) = happyShift action_214 -action_478 (146#) = happyShift action_215 -action_478 (147#) = happyShift action_216 -action_478 (148#) = happyShift action_217 -action_478 (149#) = happyShift action_218 -action_478 (152#) = happyShift action_219 -action_478 (154#) = happyShift action_220 -action_478 (155#) = happyShift action_221 -action_478 (156#) = happyShift action_222 -action_478 (158#) = happyShift action_223 -action_478 (163#) = happyShift action_224 -action_478 (164#) = happyShift action_225 -action_478 (166#) = happyShift action_226 +action_478 (129#) = happyShift action_210 +action_478 (131#) = happyShift action_211 +action_478 (132#) = happyShift action_212 +action_478 (133#) = happyShift action_213 +action_478 (135#) = happyShift action_214 +action_478 (143#) = happyShift action_215 +action_478 (144#) = happyShift action_216 +action_478 (145#) = happyShift action_217 +action_478 (146#) = happyShift action_218 +action_478 (149#) = happyShift action_219 +action_478 (151#) = happyShift action_220 +action_478 (152#) = happyShift action_221 +action_478 (153#) = happyShift action_222 +action_478 (155#) = happyShift action_223 +action_478 (160#) = happyShift action_224 +action_478 (161#) = happyShift action_225 +action_478 (163#) = happyShift action_226 +action_478 (169#) = happyShift action_504 action_478 (35#) = happyGoto action_209 action_478 x = happyTcHack x happyFail -action_479 (174#) = happyShift action_51 +action_479 (174#) = happyShift action_48 action_479 (12#) = happyGoto action_503 action_479 x = happyTcHack x happyFail -action_480 (174#) = happyShift action_51 +action_480 (174#) = happyShift action_48 action_480 (12#) = happyGoto action_438 action_480 (42#) = happyGoto action_439 action_480 (52#) = happyGoto action_502 action_480 x = happyTcHack x happyReduce_125 -action_481 (96#) = happyShift action_140 +action_481 (97#) = happyShift action_86 action_481 (98#) = happyShift action_455 -action_481 (104#) = happyShift action_26 -action_481 (109#) = happyShift action_83 -action_481 (110#) = happyShift action_28 -action_481 (111#) = happyShift action_29 -action_481 (125#) = happyShift action_33 -action_481 (126#) = happyShift action_34 -action_481 (127#) = happyShift action_35 -action_481 (128#) = happyShift action_36 -action_481 (129#) = happyShift action_37 -action_481 (134#) = happyShift action_39 +action_481 (111#) = happyShift action_24 +action_481 (115#) = happyShift action_25 +action_481 (118#) = happyShift action_27 +action_481 (119#) = happyShift action_28 +action_481 (120#) = happyShift action_29 +action_481 (121#) = happyShift action_30 +action_481 (122#) = happyShift action_31 +action_481 (123#) = happyShift action_32 +action_481 (131#) = happyShift action_35 +action_481 (167#) = happyShift action_139 action_481 (170#) = happyShift action_6 -action_481 (171#) = happyShift action_48 -action_481 (172#) = happyShift action_49 -action_481 (173#) = happyShift action_50 -action_481 (174#) = happyShift action_51 -action_481 (8#) = happyGoto action_10 -action_481 (9#) = happyGoto action_11 -action_481 (10#) = happyGoto action_12 -action_481 (11#) = happyGoto action_13 -action_481 (12#) = happyGoto action_79 +action_481 (171#) = happyShift action_45 +action_481 (172#) = happyShift action_46 +action_481 (173#) = happyShift action_47 +action_481 (174#) = happyShift action_48 +action_481 (8#) = happyGoto action_7 +action_481 (9#) = happyGoto action_8 +action_481 (10#) = happyGoto action_9 +action_481 (11#) = happyGoto action_10 +action_481 (12#) = happyGoto action_84 action_481 (58#) = happyGoto action_453 -action_481 (72#) = happyGoto action_22 +action_481 (72#) = happyGoto action_19 action_481 (88#) = happyGoto action_454 action_481 x = happyTcHack x happyReduce_108 -action_482 (96#) = happyShift action_24 -action_482 (98#) = happyShift action_25 -action_482 (104#) = happyShift action_26 -action_482 (109#) = happyShift action_27 -action_482 (110#) = happyShift action_28 -action_482 (111#) = happyShift action_29 -action_482 (114#) = happyShift action_30 -action_482 (119#) = happyShift action_31 -action_482 (124#) = happyShift action_32 -action_482 (125#) = happyShift action_33 -action_482 (126#) = happyShift action_34 -action_482 (127#) = happyShift action_35 -action_482 (128#) = happyShift action_36 -action_482 (129#) = happyShift action_37 -action_482 (131#) = happyShift action_38 -action_482 (134#) = happyShift action_39 -action_482 (137#) = happyShift action_40 -action_482 (140#) = happyShift action_41 -action_482 (145#) = happyShift action_42 -action_482 (156#) = happyShift action_43 -action_482 (157#) = happyShift action_44 -action_482 (161#) = happyShift action_45 -action_482 (162#) = happyShift action_46 -action_482 (167#) = happyShift action_47 +action_482 (95#) = happyShift action_21 +action_482 (97#) = happyShift action_22 +action_482 (98#) = happyShift action_23 +action_482 (111#) = happyShift action_24 +action_482 (115#) = happyShift action_25 +action_482 (117#) = happyShift action_26 +action_482 (118#) = happyShift action_27 +action_482 (119#) = happyShift action_28 +action_482 (120#) = happyShift action_29 +action_482 (121#) = happyShift action_30 +action_482 (122#) = happyShift action_31 +action_482 (123#) = happyShift action_32 +action_482 (124#) = happyShift action_33 +action_482 (128#) = happyShift action_34 +action_482 (131#) = happyShift action_35 +action_482 (134#) = happyShift action_36 +action_482 (137#) = happyShift action_37 +action_482 (142#) = happyShift action_38 +action_482 (153#) = happyShift action_39 +action_482 (154#) = happyShift action_40 +action_482 (158#) = happyShift action_41 +action_482 (159#) = happyShift action_42 +action_482 (164#) = happyShift action_43 +action_482 (167#) = happyShift action_44 action_482 (170#) = happyShift action_6 -action_482 (171#) = happyShift action_48 -action_482 (172#) = happyShift action_49 -action_482 (173#) = happyShift action_50 -action_482 (174#) = happyShift action_51 -action_482 (8#) = happyGoto action_10 -action_482 (9#) = happyGoto action_11 -action_482 (10#) = happyGoto action_12 -action_482 (11#) = happyGoto action_13 -action_482 (12#) = happyGoto action_14 -action_482 (58#) = happyGoto action_15 -action_482 (59#) = happyGoto action_16 -action_482 (60#) = happyGoto action_17 -action_482 (61#) = happyGoto action_18 -action_482 (62#) = happyGoto action_19 +action_482 (171#) = happyShift action_45 +action_482 (172#) = happyShift action_46 +action_482 (173#) = happyShift action_47 +action_482 (174#) = happyShift action_48 +action_482 (8#) = happyGoto action_7 +action_482 (9#) = happyGoto action_8 +action_482 (10#) = happyGoto action_9 +action_482 (11#) = happyGoto action_10 +action_482 (12#) = happyGoto action_11 +action_482 (58#) = happyGoto action_12 +action_482 (59#) = happyGoto action_13 +action_482 (60#) = happyGoto action_14 +action_482 (61#) = happyGoto action_15 +action_482 (62#) = happyGoto action_16 action_482 (63#) = happyGoto action_501 -action_482 (64#) = happyGoto action_21 -action_482 (72#) = happyGoto action_22 -action_482 (77#) = happyGoto action_23 +action_482 (64#) = happyGoto action_18 +action_482 (72#) = happyGoto action_19 +action_482 (77#) = happyGoto action_20 action_482 x = happyTcHack x happyFail action_483 x = happyTcHack x happyReduce_73 action_484 x = happyTcHack x happyReduce_39 -action_485 (95#) = happyShift action_499 -action_485 (99#) = happyShift action_500 +action_485 (99#) = happyShift action_499 +action_485 (112#) = happyShift action_500 action_485 x = happyTcHack x happyFail action_486 (98#) = happyShift action_408 -action_486 (174#) = happyShift action_51 +action_486 (174#) = happyShift action_48 action_486 (12#) = happyGoto action_406 action_486 (27#) = happyGoto action_498 action_486 (29#) = happyGoto action_425 action_486 x = happyTcHack x happyReduce_52 -action_487 (151#) = happyShift action_356 +action_487 (148#) = happyShift action_382 action_487 (28#) = happyGoto action_497 action_487 x = happyTcHack x happyReduce_55 action_488 (98#) = happyShift action_408 -action_488 (174#) = happyShift action_51 +action_488 (174#) = happyShift action_48 action_488 (12#) = happyGoto action_406 action_488 (27#) = happyGoto action_496 action_488 (29#) = happyGoto action_425 action_488 x = happyTcHack x happyReduce_52 -action_489 (97#) = happyShift action_495 -action_489 (132#) = happyShift action_210 -action_489 (134#) = happyShift action_211 -action_489 (135#) = happyShift action_212 -action_489 (136#) = happyShift action_213 -action_489 (138#) = happyShift action_214 -action_489 (146#) = happyShift action_215 -action_489 (147#) = happyShift action_216 -action_489 (148#) = happyShift action_217 -action_489 (149#) = happyShift action_218 -action_489 (152#) = happyShift action_219 -action_489 (154#) = happyShift action_220 -action_489 (155#) = happyShift action_221 -action_489 (156#) = happyShift action_222 -action_489 (158#) = happyShift action_223 -action_489 (163#) = happyShift action_224 -action_489 (164#) = happyShift action_225 -action_489 (166#) = happyShift action_226 +action_489 (129#) = happyShift action_210 +action_489 (131#) = happyShift action_211 +action_489 (132#) = happyShift action_212 +action_489 (133#) = happyShift action_213 +action_489 (135#) = happyShift action_214 +action_489 (143#) = happyShift action_215 +action_489 (144#) = happyShift action_216 +action_489 (145#) = happyShift action_217 +action_489 (146#) = happyShift action_218 +action_489 (149#) = happyShift action_219 +action_489 (151#) = happyShift action_220 +action_489 (152#) = happyShift action_221 +action_489 (153#) = happyShift action_222 +action_489 (155#) = happyShift action_223 +action_489 (160#) = happyShift action_224 +action_489 (161#) = happyShift action_225 +action_489 (163#) = happyShift action_226 +action_489 (169#) = happyShift action_495 action_489 (35#) = happyGoto action_209 action_489 x = happyTcHack x happyFail -action_490 x = happyTcHack x happyReduce_69 +action_490 (125#) = happyShift action_494 +action_490 x = happyTcHack x happyFail -action_491 (105#) = happyShift action_494 -action_491 x = happyTcHack x happyFail +action_491 x = happyTcHack x happyReduce_69 -action_492 (94#) = happyShift action_493 +action_492 (110#) = happyShift action_493 action_492 x = happyTcHack x happyFail -action_493 (174#) = happyShift action_51 +action_493 (174#) = happyShift action_48 action_493 (12#) = happyGoto action_519 action_493 (16#) = happyGoto action_520 action_493 (17#) = happyGoto action_521 @@ -5044,19 +5042,19 @@ action_494 x = happyTcHack x happyReduce_70 action_495 x = happyTcHack x happyReduce_40 -action_496 (102#) = happyShift action_518 +action_496 (101#) = happyShift action_518 action_496 x = happyTcHack x happyReduce_44 -action_497 (96#) = happyShift action_517 +action_497 (167#) = happyShift action_517 action_497 x = happyTcHack x happyFail action_498 x = happyTcHack x happyReduce_54 -action_499 (174#) = happyShift action_51 -action_499 (12#) = happyGoto action_516 -action_499 x = happyTcHack x happyFail +action_499 x = happyTcHack x happyReduce_58 -action_500 x = happyTcHack x happyReduce_58 +action_500 (174#) = happyShift action_48 +action_500 (12#) = happyGoto action_516 +action_500 x = happyTcHack x happyFail action_501 x = happyTcHack x happyReduce_74 @@ -5065,72 +5063,72 @@ action_502 x = happyTcHack x happyReduce_127 action_503 (99#) = happyShift action_515 action_503 x = happyTcHack x happyFail -action_504 (94#) = happyShift action_514 +action_504 (110#) = happyShift action_514 action_504 x = happyTcHack x happyFail action_505 x = happyTcHack x happyReduce_101 action_506 x = happyTcHack x happyReduce_104 -action_507 (96#) = happyShift action_24 -action_507 (98#) = happyShift action_25 -action_507 (104#) = happyShift action_26 -action_507 (109#) = happyShift action_27 -action_507 (110#) = happyShift action_28 -action_507 (111#) = happyShift action_29 -action_507 (114#) = happyShift action_30 -action_507 (119#) = happyShift action_31 -action_507 (124#) = happyShift action_32 -action_507 (125#) = happyShift action_33 -action_507 (126#) = happyShift action_34 -action_507 (127#) = happyShift action_35 -action_507 (128#) = happyShift action_36 -action_507 (129#) = happyShift action_37 -action_507 (131#) = happyShift action_38 -action_507 (134#) = happyShift action_39 -action_507 (137#) = happyShift action_40 -action_507 (140#) = happyShift action_41 -action_507 (145#) = happyShift action_42 -action_507 (156#) = happyShift action_43 -action_507 (157#) = happyShift action_44 -action_507 (161#) = happyShift action_45 -action_507 (162#) = happyShift action_46 -action_507 (167#) = happyShift action_47 +action_507 (95#) = happyShift action_21 +action_507 (97#) = happyShift action_22 +action_507 (98#) = happyShift action_23 +action_507 (111#) = happyShift action_24 +action_507 (115#) = happyShift action_25 +action_507 (117#) = happyShift action_26 +action_507 (118#) = happyShift action_27 +action_507 (119#) = happyShift action_28 +action_507 (120#) = happyShift action_29 +action_507 (121#) = happyShift action_30 +action_507 (122#) = happyShift action_31 +action_507 (123#) = happyShift action_32 +action_507 (124#) = happyShift action_33 +action_507 (128#) = happyShift action_34 +action_507 (131#) = happyShift action_35 +action_507 (134#) = happyShift action_36 +action_507 (137#) = happyShift action_37 +action_507 (142#) = happyShift action_38 +action_507 (153#) = happyShift action_39 +action_507 (154#) = happyShift action_40 +action_507 (158#) = happyShift action_41 +action_507 (159#) = happyShift action_42 +action_507 (164#) = happyShift action_43 +action_507 (167#) = happyShift action_44 action_507 (170#) = happyShift action_6 -action_507 (171#) = happyShift action_48 -action_507 (172#) = happyShift action_49 -action_507 (173#) = happyShift action_50 -action_507 (174#) = happyShift action_51 -action_507 (8#) = happyGoto action_10 -action_507 (9#) = happyGoto action_11 -action_507 (10#) = happyGoto action_12 -action_507 (11#) = happyGoto action_13 -action_507 (12#) = happyGoto action_14 -action_507 (58#) = happyGoto action_15 -action_507 (59#) = happyGoto action_16 -action_507 (60#) = happyGoto action_17 -action_507 (61#) = happyGoto action_18 -action_507 (62#) = happyGoto action_19 +action_507 (171#) = happyShift action_45 +action_507 (172#) = happyShift action_46 +action_507 (173#) = happyShift action_47 +action_507 (174#) = happyShift action_48 +action_507 (8#) = happyGoto action_7 +action_507 (9#) = happyGoto action_8 +action_507 (10#) = happyGoto action_9 +action_507 (11#) = happyGoto action_10 +action_507 (12#) = happyGoto action_11 +action_507 (58#) = happyGoto action_12 +action_507 (59#) = happyGoto action_13 +action_507 (60#) = happyGoto action_14 +action_507 (61#) = happyGoto action_15 +action_507 (62#) = happyGoto action_16 action_507 (63#) = happyGoto action_513 -action_507 (64#) = happyGoto action_21 -action_507 (72#) = happyGoto action_22 -action_507 (77#) = happyGoto action_23 +action_507 (64#) = happyGoto action_18 +action_507 (72#) = happyGoto action_19 +action_507 (77#) = happyGoto action_20 action_507 x = happyTcHack x happyFail action_508 (170#) = happyShift action_6 action_508 (8#) = happyGoto action_512 action_508 x = happyTcHack x happyFail -action_509 (102#) = happyShift action_511 +action_509 (101#) = happyShift action_511 action_509 x = happyTcHack x happyReduce_30 action_510 x = happyTcHack x happyReduce_29 -action_511 (151#) = happyShift action_356 +action_511 (148#) = happyShift action_382 action_511 (28#) = happyGoto action_530 action_511 x = happyTcHack x happyReduce_55 -action_512 (97#) = happyShift action_529 +action_512 (169#) = happyShift action_529 action_512 x = happyTcHack x happyFail action_513 (99#) = happyShift action_528 @@ -5146,53 +5144,53 @@ action_516 x = happyTcHack x happyFail action_517 (25#) = happyGoto action_526 action_517 x = happyTcHack x happyReduce_48 -action_518 (151#) = happyShift action_356 +action_518 (148#) = happyShift action_382 action_518 (28#) = happyGoto action_525 action_518 x = happyTcHack x happyReduce_55 -action_519 (95#) = happyShift action_524 +action_519 (112#) = happyShift action_524 action_519 x = happyTcHack x happyFail -action_520 (94#) = happyShift action_523 +action_520 (110#) = happyShift action_523 action_520 x = happyTcHack x happyReduce_18 -action_521 (97#) = happyShift action_522 +action_521 (169#) = happyShift action_522 action_521 x = happyTcHack x happyFail action_522 x = happyTcHack x happyReduce_14 -action_523 (174#) = happyShift action_51 +action_523 (174#) = happyShift action_48 action_523 (12#) = happyGoto action_519 action_523 (16#) = happyGoto action_520 action_523 (17#) = happyGoto action_535 action_523 x = happyTcHack x happyReduce_17 -action_524 (174#) = happyShift action_51 +action_524 (174#) = happyShift action_48 action_524 (12#) = happyGoto action_533 action_524 (18#) = happyGoto action_534 action_524 x = happyTcHack x happyFail -action_525 (96#) = happyShift action_532 +action_525 (167#) = happyShift action_532 action_525 x = happyTcHack x happyFail -action_526 (97#) = happyShift action_531 -action_526 (132#) = happyShift action_210 -action_526 (134#) = happyShift action_211 -action_526 (135#) = happyShift action_212 -action_526 (136#) = happyShift action_213 -action_526 (138#) = happyShift action_214 -action_526 (146#) = happyShift action_215 -action_526 (147#) = happyShift action_216 -action_526 (148#) = happyShift action_217 -action_526 (149#) = happyShift action_218 -action_526 (152#) = happyShift action_219 -action_526 (154#) = happyShift action_220 -action_526 (155#) = happyShift action_221 -action_526 (156#) = happyShift action_222 -action_526 (158#) = happyShift action_223 -action_526 (163#) = happyShift action_224 -action_526 (164#) = happyShift action_225 -action_526 (166#) = happyShift action_226 +action_526 (129#) = happyShift action_210 +action_526 (131#) = happyShift action_211 +action_526 (132#) = happyShift action_212 +action_526 (133#) = happyShift action_213 +action_526 (135#) = happyShift action_214 +action_526 (143#) = happyShift action_215 +action_526 (144#) = happyShift action_216 +action_526 (145#) = happyShift action_217 +action_526 (146#) = happyShift action_218 +action_526 (149#) = happyShift action_219 +action_526 (151#) = happyShift action_220 +action_526 (152#) = happyShift action_221 +action_526 (153#) = happyShift action_222 +action_526 (155#) = happyShift action_223 +action_526 (160#) = happyShift action_224 +action_526 (161#) = happyShift action_225 +action_526 (163#) = happyShift action_226 +action_526 (169#) = happyShift action_531 action_526 (35#) = happyGoto action_209 action_526 x = happyTcHack x happyFail @@ -5220,24 +5218,24 @@ action_536 (98#) = happyShift action_540 action_536 (20#) = happyGoto action_539 action_536 x = happyTcHack x happyReduce_20 -action_537 (97#) = happyShift action_538 -action_537 (132#) = happyShift action_210 -action_537 (134#) = happyShift action_211 -action_537 (135#) = happyShift action_212 -action_537 (136#) = happyShift action_213 -action_537 (138#) = happyShift action_214 -action_537 (146#) = happyShift action_215 -action_537 (147#) = happyShift action_216 -action_537 (148#) = happyShift action_217 -action_537 (149#) = happyShift action_218 -action_537 (152#) = happyShift action_219 -action_537 (154#) = happyShift action_220 -action_537 (155#) = happyShift action_221 -action_537 (156#) = happyShift action_222 -action_537 (158#) = happyShift action_223 -action_537 (163#) = happyShift action_224 -action_537 (164#) = happyShift action_225 -action_537 (166#) = happyShift action_226 +action_537 (129#) = happyShift action_210 +action_537 (131#) = happyShift action_211 +action_537 (132#) = happyShift action_212 +action_537 (133#) = happyShift action_213 +action_537 (135#) = happyShift action_214 +action_537 (143#) = happyShift action_215 +action_537 (144#) = happyShift action_216 +action_537 (145#) = happyShift action_217 +action_537 (146#) = happyShift action_218 +action_537 (149#) = happyShift action_219 +action_537 (151#) = happyShift action_220 +action_537 (152#) = happyShift action_221 +action_537 (153#) = happyShift action_222 +action_537 (155#) = happyShift action_223 +action_537 (160#) = happyShift action_224 +action_537 (161#) = happyShift action_225 +action_537 (163#) = happyShift action_226 +action_537 (169#) = happyShift action_538 action_537 (35#) = happyGoto action_209 action_537 x = happyTcHack x happyFail @@ -5245,21 +5243,21 @@ action_538 x = happyTcHack x happyReduce_45 action_539 x = happyTcHack x happyReduce_22 -action_540 (164#) = happyShift action_541 +action_540 (161#) = happyShift action_541 action_540 x = happyTcHack x happyFail -action_541 (140#) = happyShift action_542 -action_541 (153#) = happyShift action_543 +action_541 (137#) = happyShift action_542 +action_541 (150#) = happyShift action_543 action_541 x = happyTcHack x happyFail action_542 (98#) = happyShift action_408 -action_542 (174#) = happyShift action_51 +action_542 (174#) = happyShift action_48 action_542 (12#) = happyGoto action_406 action_542 (29#) = happyGoto action_545 action_542 x = happyTcHack x happyFail action_543 (98#) = happyShift action_408 -action_543 (174#) = happyShift action_51 +action_543 (174#) = happyShift action_48 action_543 (12#) = happyGoto action_406 action_543 (29#) = happyGoto action_544 action_543 x = happyTcHack x happyFail @@ -5277,21 +5275,21 @@ action_547 x = happyTcHack x happyReduce_24 happyReduce_5 = happySpecReduce_1 8# happyReduction_5 happyReduction_5 (HappyTerminal (PT _ (TI happy_var_1))) = HappyAbsSyn8 - ((read happy_var_1) :: Integer + ((read (BS.unpack happy_var_1)) :: Integer ) happyReduction_5 _ = notHappyAtAll happyReduce_6 = happySpecReduce_1 9# happyReduction_6 happyReduction_6 (HappyTerminal (PT _ (TL happy_var_1))) = HappyAbsSyn9 - (happy_var_1 + (BS.unpack happy_var_1 ) happyReduction_6 _ = notHappyAtAll happyReduce_7 = happySpecReduce_1 10# happyReduction_7 happyReduction_7 (HappyTerminal (PT _ (TD happy_var_1))) = HappyAbsSyn10 - ((read happy_var_1) :: Double + ((read (BS.unpack happy_var_1)) :: Double ) happyReduction_7 _ = notHappyAtAll @@ -7509,82 +7507,82 @@ happyNewToken action sts stk [] = happyNewToken action sts stk (tk:tks) = let cont i = action i i tk (HappyState action) sts stk tks in case tk of { - PT _ (TS ";") -> cont 94#; - PT _ (TS "=") -> cont 95#; - PT _ (TS "{") -> cont 96#; - PT _ (TS "}") -> cont 97#; - PT _ (TS "(") -> cont 98#; - PT _ (TS ")") -> cont 99#; - PT _ (TS ":") -> cont 100#; - PT _ (TS "->") -> cont 101#; - PT _ (TS "**") -> cont 102#; - PT _ (TS ",") -> cont 103#; - PT _ (TS "[") -> cont 104#; - PT _ (TS "]") -> cont 105#; - PT _ (TS "-") -> cont 106#; - PT _ (TS ".") -> cont 107#; - PT _ (TS "|") -> cont 108#; - PT _ (TS "%") -> cont 109#; - PT _ (TS "?") -> cont 110#; - PT _ (TS "<") -> cont 111#; - PT _ (TS ">") -> cont 112#; - PT _ (TS "@") -> cont 113#; - PT _ (TS "#") -> cont 114#; - PT _ (TS "!") -> cont 115#; - PT _ (TS "*") -> cont 116#; - PT _ (TS "+") -> cont 117#; - PT _ (TS "++") -> cont 118#; - PT _ (TS "\\") -> cont 119#; - PT _ (TS "=>") -> cont 120#; - PT _ (TS "_") -> cont 121#; - PT _ (TS "$") -> cont 122#; - PT _ (TS "/") -> cont 123#; - PT _ (TS "Lin") -> cont 124#; - PT _ (TS "PType") -> cont 125#; - PT _ (TS "Str") -> cont 126#; - PT _ (TS "Strs") -> cont 127#; - PT _ (TS "Tok") -> cont 128#; - PT _ (TS "Type") -> cont 129#; - PT _ (TS "abstract") -> cont 130#; - PT _ (TS "case") -> cont 131#; - PT _ (TS "cat") -> cont 132#; - PT _ (TS "concrete") -> cont 133#; - PT _ (TS "data") -> cont 134#; - PT _ (TS "def") -> cont 135#; - PT _ (TS "flags") -> cont 136#; - PT _ (TS "fn") -> cont 137#; - PT _ (TS "fun") -> cont 138#; - PT _ (TS "grammar") -> cont 139#; - PT _ (TS "in") -> cont 140#; - PT _ (TS "include") -> cont 141#; - PT _ (TS "incomplete") -> cont 142#; - PT _ (TS "instance") -> cont 143#; - PT _ (TS "interface") -> cont 144#; - PT _ (TS "let") -> cont 145#; - PT _ (TS "lin") -> cont 146#; - PT _ (TS "lincat") -> cont 147#; - PT _ (TS "lindef") -> cont 148#; - PT _ (TS "lintype") -> cont 149#; - PT _ (TS "of") -> cont 150#; - PT _ (TS "open") -> cont 151#; - PT _ (TS "oper") -> cont 152#; - PT _ (TS "out") -> cont 153#; - PT _ (TS "package") -> cont 154#; - PT _ (TS "param") -> cont 155#; - PT _ (TS "pattern") -> cont 156#; - PT _ (TS "pre") -> cont 157#; - PT _ (TS "printname") -> cont 158#; - PT _ (TS "resource") -> cont 159#; - PT _ (TS "reuse") -> cont 160#; - PT _ (TS "strs") -> cont 161#; - PT _ (TS "table") -> cont 162#; - PT _ (TS "tokenizer") -> cont 163#; - PT _ (TS "transfer") -> cont 164#; - PT _ (TS "union") -> cont 165#; - PT _ (TS "var") -> cont 166#; - PT _ (TS "variants") -> cont 167#; - PT _ (TS "where") -> cont 168#; - PT _ (TS "with") -> cont 169#; + PT _ (TS _ 1) -> cont 94#; + PT _ (TS _ 2) -> cont 95#; + PT _ (TS _ 3) -> cont 96#; + PT _ (TS _ 4) -> cont 97#; + PT _ (TS _ 5) -> cont 98#; + PT _ (TS _ 6) -> cont 99#; + PT _ (TS _ 7) -> cont 100#; + PT _ (TS _ 8) -> cont 101#; + PT _ (TS _ 9) -> cont 102#; + PT _ (TS _ 10) -> cont 103#; + PT _ (TS _ 11) -> cont 104#; + PT _ (TS _ 12) -> cont 105#; + PT _ (TS _ 13) -> cont 106#; + PT _ (TS _ 14) -> cont 107#; + PT _ (TS _ 15) -> cont 108#; + PT _ (TS _ 16) -> cont 109#; + PT _ (TS _ 17) -> cont 110#; + PT _ (TS _ 18) -> cont 111#; + PT _ (TS _ 19) -> cont 112#; + PT _ (TS _ 20) -> cont 113#; + PT _ (TS _ 21) -> cont 114#; + PT _ (TS _ 22) -> cont 115#; + PT _ (TS _ 23) -> cont 116#; + PT _ (TS _ 24) -> cont 117#; + PT _ (TS _ 25) -> cont 118#; + PT _ (TS _ 26) -> cont 119#; + PT _ (TS _ 27) -> cont 120#; + PT _ (TS _ 28) -> cont 121#; + PT _ (TS _ 29) -> cont 122#; + PT _ (TS _ 30) -> cont 123#; + PT _ (TS _ 31) -> cont 124#; + PT _ (TS _ 32) -> cont 125#; + PT _ (TS _ 33) -> cont 126#; + PT _ (TS _ 34) -> cont 127#; + PT _ (TS _ 35) -> cont 128#; + PT _ (TS _ 36) -> cont 129#; + PT _ (TS _ 37) -> cont 130#; + PT _ (TS _ 38) -> cont 131#; + PT _ (TS _ 39) -> cont 132#; + PT _ (TS _ 40) -> cont 133#; + PT _ (TS _ 41) -> cont 134#; + PT _ (TS _ 42) -> cont 135#; + PT _ (TS _ 43) -> cont 136#; + PT _ (TS _ 44) -> cont 137#; + PT _ (TS _ 45) -> cont 138#; + PT _ (TS _ 46) -> cont 139#; + PT _ (TS _ 47) -> cont 140#; + PT _ (TS _ 48) -> cont 141#; + PT _ (TS _ 49) -> cont 142#; + PT _ (TS _ 50) -> cont 143#; + PT _ (TS _ 51) -> cont 144#; + PT _ (TS _ 52) -> cont 145#; + PT _ (TS _ 53) -> cont 146#; + PT _ (TS _ 54) -> cont 147#; + PT _ (TS _ 55) -> cont 148#; + PT _ (TS _ 56) -> cont 149#; + PT _ (TS _ 57) -> cont 150#; + PT _ (TS _ 58) -> cont 151#; + PT _ (TS _ 59) -> cont 152#; + PT _ (TS _ 60) -> cont 153#; + PT _ (TS _ 61) -> cont 154#; + PT _ (TS _ 62) -> cont 155#; + PT _ (TS _ 63) -> cont 156#; + PT _ (TS _ 64) -> cont 157#; + PT _ (TS _ 65) -> cont 158#; + PT _ (TS _ 66) -> cont 159#; + PT _ (TS _ 67) -> cont 160#; + PT _ (TS _ 68) -> cont 161#; + PT _ (TS _ 69) -> cont 162#; + PT _ (TS _ 70) -> cont 163#; + PT _ (TS _ 71) -> cont 164#; + PT _ (TS _ 72) -> cont 165#; + PT _ (TS _ 73) -> cont 166#; + PT _ (TS _ 74) -> cont 167#; + PT _ (TS _ 75) -> cont 168#; + PT _ (TS _ 76) -> cont 169#; PT _ (TI happy_dollar_dollar) -> cont 170#; PT _ (TL happy_dollar_dollar) -> cont 171#; PT _ (TD happy_dollar_dollar) -> cont 172#; @@ -7615,11 +7613,11 @@ pModDef tks = happySomeParser where pOldGrammar tks = happySomeParser where happySomeParser = happyThen (happyParse action_2 tks) (\x -> case x of {HappyAbsSyn90 z -> happyReturn z; _other -> notHappyAtAll }) -pExp tks = happySomeParser where - happySomeParser = happyThen (happyParse action_3 tks) (\x -> case x of {HappyAbsSyn58 z -> happyReturn z; _other -> notHappyAtAll }) - pModHeader tks = happySomeParser where - happySomeParser = happyThen (happyParse action_4 tks) (\x -> case x of {HappyAbsSyn15 z -> happyReturn z; _other -> notHappyAtAll }) + happySomeParser = happyThen (happyParse action_3 tks) (\x -> case x of {HappyAbsSyn15 z -> happyReturn z; _other -> notHappyAtAll }) + +pExp tks = happySomeParser where + happySomeParser = happyThen (happyParse action_4 tks) (\x -> case x of {HappyAbsSyn58 z -> happyReturn z; _other -> notHappyAtAll }) happySeq = happyDontSeq @@ -7636,7 +7634,7 @@ happyError ts = case ts of [] -> [] [Err _] -> " due to lexer error" - _ -> " before " ++ unwords (map prToken (take 4 ts)) + _ -> " before " ++ unwords (map (BS.unpack . prToken) (take 4 ts)) myLexer = tokens {-# LINE 1 "templates/GenericTemplate.hs" #-} diff --git a/src-3.0/GF/Source/ParGF.y b/src-3.0/GF/Source/ParGF.y index 2109434e5..22a15cd93 100644 --- a/src-3.0/GF/Source/ParGF.y +++ b/src-3.0/GF/Source/ParGF.y @@ -1,642 +1,642 @@ --- This Happy file was machine-generated by the BNF converter -{ -{-# OPTIONS -fno-warn-incomplete-patterns -fno-warn-overlapping-patterns #-} - module GF.Source.ParGF (pGrammar, pModDef, pOldGrammar, pExp, pModHeader, myLexer) where --H -import GF.Source.AbsGF --H -import GF.Source.LexGF --H -import GF.Infra.Ident --H -import GF.Data.ErrM --H -} - -%name pGrammar Grammar -%name pModDef ModDef -%name pOldGrammar OldGrammar -%name pExp Exp -%partial pModHeader ModHeader - --- no lexer declaration -%monad { Err } { thenM } { returnM } -%tokentype { Token } - -%token - ';' { PT _ (TS ";") } - '=' { PT _ (TS "=") } - '{' { PT _ (TS "{") } - '}' { PT _ (TS "}") } - '(' { PT _ (TS "(") } - ')' { PT _ (TS ")") } - ':' { PT _ (TS ":") } - '->' { PT _ (TS "->") } - '**' { PT _ (TS "**") } - ',' { PT _ (TS ",") } - '[' { PT _ (TS "[") } - ']' { PT _ (TS "]") } - '-' { PT _ (TS "-") } - '.' { PT _ (TS ".") } - '|' { PT _ (TS "|") } - '%' { PT _ (TS "%") } - '?' { PT _ (TS "?") } - '<' { PT _ (TS "<") } - '>' { PT _ (TS ">") } - '@' { PT _ (TS "@") } - '#' { PT _ (TS "#") } - '!' { PT _ (TS "!") } - '*' { PT _ (TS "*") } - '+' { PT _ (TS "+") } - '++' { PT _ (TS "++") } - '\\' { PT _ (TS "\\") } - '=>' { PT _ (TS "=>") } - '_' { PT _ (TS "_") } - '$' { PT _ (TS "$") } - '/' { PT _ (TS "/") } - 'Lin' { PT _ (TS "Lin") } - 'PType' { PT _ (TS "PType") } - 'Str' { PT _ (TS "Str") } - 'Strs' { PT _ (TS "Strs") } - 'Tok' { PT _ (TS "Tok") } - 'Type' { PT _ (TS "Type") } - 'abstract' { PT _ (TS "abstract") } - 'case' { PT _ (TS "case") } - 'cat' { PT _ (TS "cat") } - 'concrete' { PT _ (TS "concrete") } - 'data' { PT _ (TS "data") } - 'def' { PT _ (TS "def") } - 'flags' { PT _ (TS "flags") } - 'fn' { PT _ (TS "fn") } - 'fun' { PT _ (TS "fun") } - 'grammar' { PT _ (TS "grammar") } - 'in' { PT _ (TS "in") } - 'include' { PT _ (TS "include") } - 'incomplete' { PT _ (TS "incomplete") } - 'instance' { PT _ (TS "instance") } - 'interface' { PT _ (TS "interface") } - 'let' { PT _ (TS "let") } - 'lin' { PT _ (TS "lin") } - 'lincat' { PT _ (TS "lincat") } - 'lindef' { PT _ (TS "lindef") } - 'lintype' { PT _ (TS "lintype") } - 'of' { PT _ (TS "of") } - 'open' { PT _ (TS "open") } - 'oper' { PT _ (TS "oper") } - 'out' { PT _ (TS "out") } - 'package' { PT _ (TS "package") } - 'param' { PT _ (TS "param") } - 'pattern' { PT _ (TS "pattern") } - 'pre' { PT _ (TS "pre") } - 'printname' { PT _ (TS "printname") } - 'resource' { PT _ (TS "resource") } - 'reuse' { PT _ (TS "reuse") } - 'strs' { PT _ (TS "strs") } - 'table' { PT _ (TS "table") } - 'tokenizer' { PT _ (TS "tokenizer") } - 'transfer' { PT _ (TS "transfer") } - 'union' { PT _ (TS "union") } - 'var' { PT _ (TS "var") } - 'variants' { PT _ (TS "variants") } - 'where' { PT _ (TS "where") } - 'with' { PT _ (TS "with") } - -L_integ { PT _ (TI $$) } -L_quoted { PT _ (TL $$) } -L_doubl { PT _ (TD $$) } -L_LString { PT _ (T_LString $$) } -L_PIdent { PT _ (T_PIdent _) } -L_err { _ } - - -%% - -Integer :: { Integer } : L_integ { (read $1) :: Integer } -String :: { String } : L_quoted { $1 } -Double :: { Double } : L_doubl { (read $1) :: Double } -LString :: { LString} : L_LString { LString ($1)} -PIdent :: { PIdent} : L_PIdent { PIdent (mkPosToken $1)} - -Grammar :: { Grammar } -Grammar : ListModDef { Gr (reverse $1) } - - -ListModDef :: { [ModDef] } -ListModDef : {- empty -} { [] } - | ListModDef ModDef { flip (:) $1 $2 } - - -ModDef :: { ModDef } -ModDef : ModDef ';' { $1 } - | 'grammar' PIdent '=' '{' 'abstract' '=' PIdent ';' ListConcSpec '}' { MMain $2 $7 $9 } - | ComplMod ModType '=' ModBody { MModule $1 $2 $4 } - - -ConcSpec :: { ConcSpec } -ConcSpec : PIdent '=' ConcExp { ConcSpec $1 $3 } - - -ListConcSpec :: { [ConcSpec] } -ListConcSpec : {- empty -} { [] } - | ConcSpec { (:[]) $1 } - | ConcSpec ';' ListConcSpec { (:) $1 $3 } - - -ConcExp :: { ConcExp } -ConcExp : PIdent ListTransfer { ConcExp $1 (reverse $2) } - - -ListTransfer :: { [Transfer] } -ListTransfer : {- empty -} { [] } - | ListTransfer Transfer { flip (:) $1 $2 } - - -Transfer :: { Transfer } -Transfer : '(' 'transfer' 'in' Open ')' { TransferIn $4 } - | '(' 'transfer' 'out' Open ')' { TransferOut $4 } - - -ModHeader :: { ModDef } -ModHeader : ComplMod ModType '=' ModHeaderBody { MModule $1 $2 $4 } - - -ModHeaderBody :: { ModBody } -ModHeaderBody : Extend Opens { MBody $1 $2 [] } - | ListIncluded { MNoBody $1 } - | Included 'with' ListOpen { MWith $1 $3 } - | Included 'with' ListOpen '**' Opens { MWithBody $1 $3 $5 [] } - | ListIncluded '**' Included 'with' ListOpen { MWithE $1 $3 $5 } - | ListIncluded '**' Included 'with' ListOpen '**' Opens { MWithEBody $1 $3 $5 $7 [] } - | 'reuse' PIdent { MReuse $2 } - | 'union' ListIncluded { MUnion $2 } - - -ModType :: { ModType } -ModType : 'abstract' PIdent { MTAbstract $2 } - | 'resource' PIdent { MTResource $2 } - | 'interface' PIdent { MTInterface $2 } - | 'concrete' PIdent 'of' PIdent { MTConcrete $2 $4 } - | 'instance' PIdent 'of' PIdent { MTInstance $2 $4 } - | 'transfer' PIdent ':' Open '->' Open { MTTransfer $2 $4 $6 } - - -ModBody :: { ModBody } -ModBody : Extend Opens '{' ListTopDef '}' { MBody $1 $2 (reverse $4) } - | ListIncluded { MNoBody $1 } - | Included 'with' ListOpen { MWith $1 $3 } - | Included 'with' ListOpen '**' Opens '{' ListTopDef '}' { MWithBody $1 $3 $5 (reverse $7) } - | ListIncluded '**' Included 'with' ListOpen { MWithE $1 $3 $5 } - | ListIncluded '**' Included 'with' ListOpen '**' Opens '{' ListTopDef '}' { MWithEBody $1 $3 $5 $7 (reverse $9) } - | 'reuse' PIdent { MReuse $2 } - | 'union' ListIncluded { MUnion $2 } - - -ListTopDef :: { [TopDef] } -ListTopDef : {- empty -} { [] } - | ListTopDef TopDef { flip (:) $1 $2 } - - -Extend :: { Extend } -Extend : ListIncluded '**' { Ext $1 } - | {- empty -} { NoExt } - - -ListOpen :: { [Open] } -ListOpen : {- empty -} { [] } - | Open { (:[]) $1 } - | Open ',' ListOpen { (:) $1 $3 } - - -Opens :: { Opens } -Opens : {- empty -} { NoOpens } - | 'open' ListOpen 'in' { OpenIn $2 } - - -Open :: { Open } -Open : PIdent { OName $1 } - | '(' QualOpen PIdent ')' { OQualQO $2 $3 } - | '(' QualOpen PIdent '=' PIdent ')' { OQual $2 $3 $5 } - - -ComplMod :: { ComplMod } -ComplMod : {- empty -} { CMCompl } - | 'incomplete' { CMIncompl } - - -QualOpen :: { QualOpen } -QualOpen : {- empty -} { QOCompl } - | 'incomplete' { QOIncompl } - | 'interface' { QOInterface } - - -ListIncluded :: { [Included] } -ListIncluded : {- empty -} { [] } - | Included { (:[]) $1 } - | Included ',' ListIncluded { (:) $1 $3 } - - -Included :: { Included } -Included : PIdent { IAll $1 } - | PIdent '[' ListPIdent ']' { ISome $1 $3 } - | PIdent '-' '[' ListPIdent ']' { IMinus $1 $4 } - - -Def :: { Def } -Def : ListName ':' Exp { DDecl $1 $3 } - | ListName '=' Exp { DDef $1 $3 } - | Name ListPatt '=' Exp { DPatt $1 $2 $4 } - | ListName ':' Exp '=' Exp { DFull $1 $3 $5 } - - -TopDef :: { TopDef } -TopDef : 'cat' ListCatDef { DefCat $2 } - | 'fun' ListFunDef { DefFun $2 } - | 'data' ListFunDef { DefFunData $2 } - | 'def' ListDef { DefDef $2 } - | 'data' ListDataDef { DefData $2 } - | 'transfer' ListDef { DefTrans $2 } - | 'param' ListParDef { DefPar $2 } - | 'oper' ListDef { DefOper $2 } - | 'lincat' ListPrintDef { DefLincat $2 } - | 'lindef' ListDef { DefLindef $2 } - | 'lin' ListDef { DefLin $2 } - | 'printname' 'cat' ListPrintDef { DefPrintCat $3 } - | 'printname' 'fun' ListPrintDef { DefPrintFun $3 } - | 'flags' ListFlagDef { DefFlag $2 } - | 'printname' ListPrintDef { DefPrintOld $2 } - | 'lintype' ListDef { DefLintype $2 } - | 'pattern' ListDef { DefPattern $2 } - | 'package' PIdent '=' '{' ListTopDef '}' ';' { DefPackage $2 (reverse $5) } - | 'var' ListDef { DefVars $2 } - | 'tokenizer' PIdent ';' { DefTokenizer $2 } - - -CatDef :: { CatDef } -CatDef : PIdent ListDDecl { SimpleCatDef $1 (reverse $2) } - | '[' PIdent ListDDecl ']' { ListCatDef $2 (reverse $3) } - | '[' PIdent ListDDecl ']' '{' Integer '}' { ListSizeCatDef $2 (reverse $3) $6 } - - -FunDef :: { FunDef } -FunDef : ListPIdent ':' Exp { FunDef $1 $3 } - - -DataDef :: { DataDef } -DataDef : PIdent '=' ListDataConstr { DataDef $1 $3 } - - -DataConstr :: { DataConstr } -DataConstr : PIdent { DataId $1 } - | PIdent '.' PIdent { DataQId $1 $3 } - - -ListDataConstr :: { [DataConstr] } -ListDataConstr : {- empty -} { [] } - | DataConstr { (:[]) $1 } - | DataConstr '|' ListDataConstr { (:) $1 $3 } - - -ParDef :: { ParDef } -ParDef : PIdent '=' ListParConstr { ParDefDir $1 $3 } - | PIdent '=' '(' 'in' PIdent ')' { ParDefIndir $1 $5 } - | PIdent { ParDefAbs $1 } - - -ParConstr :: { ParConstr } -ParConstr : PIdent ListDDecl { ParConstr $1 (reverse $2) } - - -PrintDef :: { PrintDef } -PrintDef : ListName '=' Exp { PrintDef $1 $3 } - - -FlagDef :: { FlagDef } -FlagDef : PIdent '=' PIdent { FlagDef $1 $3 } - - -ListDef :: { [Def] } -ListDef : Def ';' { (:[]) $1 } - | Def ';' ListDef { (:) $1 $3 } - - -ListCatDef :: { [CatDef] } -ListCatDef : CatDef ';' { (:[]) $1 } - | CatDef ';' ListCatDef { (:) $1 $3 } - - -ListFunDef :: { [FunDef] } -ListFunDef : FunDef ';' { (:[]) $1 } - | FunDef ';' ListFunDef { (:) $1 $3 } - - -ListDataDef :: { [DataDef] } -ListDataDef : DataDef ';' { (:[]) $1 } - | DataDef ';' ListDataDef { (:) $1 $3 } - - -ListParDef :: { [ParDef] } -ListParDef : ParDef ';' { (:[]) $1 } - | ParDef ';' ListParDef { (:) $1 $3 } - - -ListPrintDef :: { [PrintDef] } -ListPrintDef : PrintDef ';' { (:[]) $1 } - | PrintDef ';' ListPrintDef { (:) $1 $3 } - - -ListFlagDef :: { [FlagDef] } -ListFlagDef : FlagDef ';' { (:[]) $1 } - | FlagDef ';' ListFlagDef { (:) $1 $3 } - - -ListParConstr :: { [ParConstr] } -ListParConstr : {- empty -} { [] } - | ParConstr { (:[]) $1 } - | ParConstr '|' ListParConstr { (:) $1 $3 } - - -ListPIdent :: { [PIdent] } -ListPIdent : PIdent { (:[]) $1 } - | PIdent ',' ListPIdent { (:) $1 $3 } - - -Name :: { Name } -Name : PIdent { IdentName $1 } - | '[' PIdent ']' { ListName $2 } - - -ListName :: { [Name] } -ListName : Name { (:[]) $1 } - | Name ',' ListName { (:) $1 $3 } - - -LocDef :: { LocDef } -LocDef : ListPIdent ':' Exp { LDDecl $1 $3 } - | ListPIdent '=' Exp { LDDef $1 $3 } - | ListPIdent ':' Exp '=' Exp { LDFull $1 $3 $5 } - - -ListLocDef :: { [LocDef] } -ListLocDef : {- empty -} { [] } - | LocDef { (:[]) $1 } - | LocDef ';' ListLocDef { (:) $1 $3 } - - -Exp6 :: { Exp } -Exp6 : PIdent { EIdent $1 } - | '{' PIdent '}' { EConstr $2 } - | '%' PIdent '%' { ECons $2 } - | Sort { ESort $1 } - | String { EString $1 } - | Integer { EInt $1 } - | Double { EFloat $1 } - | '?' { EMeta } - | '[' ']' { EEmpty } - | 'data' { EData } - | '[' PIdent Exps ']' { EList $2 $3 } - | '[' String ']' { EStrings $2 } - | '{' ListLocDef '}' { ERecord $2 } - | '<' ListTupleComp '>' { ETuple $2 } - | '(' 'in' PIdent ')' { EIndir $3 } - | '<' Exp ':' Exp '>' { ETyped $2 $4 } - | '(' Exp ')' { $2 } - | LString { ELString $1 } - - -Exp5 :: { Exp } -Exp5 : Exp5 '.' Label { EProj $1 $3 } - | '{' PIdent '.' PIdent '}' { EQConstr $2 $4 } - | '%' PIdent '.' PIdent { EQCons $2 $4 } - | Exp6 { $1 } - - -Exp4 :: { Exp } -Exp4 : Exp4 Exp5 { EApp $1 $2 } - | 'table' '{' ListCase '}' { ETable $3 } - | 'table' Exp6 '{' ListCase '}' { ETTable $2 $4 } - | 'table' Exp6 '[' ListExp ']' { EVTable $2 $4 } - | 'case' Exp 'of' '{' ListCase '}' { ECase $2 $5 } - | 'variants' '{' ListExp '}' { EVariants $3 } - | 'pre' '{' Exp ';' ListAltern '}' { EPre $3 $5 } - | 'strs' '{' ListExp '}' { EStrs $3 } - | PIdent '@' Exp6 { EConAt $1 $3 } - | '#' Patt2 { EPatt $2 } - | 'pattern' Exp5 { EPattType $2 } - | Exp5 { $1 } - | 'Lin' PIdent { ELin $2 } - - -Exp3 :: { Exp } -Exp3 : Exp3 '!' Exp4 { ESelect $1 $3 } - | Exp3 '*' Exp4 { ETupTyp $1 $3 } - | Exp3 '**' Exp4 { EExtend $1 $3 } - | Exp4 { $1 } - - -Exp1 :: { Exp } -Exp1 : Exp2 '+' Exp1 { EGlue $1 $3 } - | Exp2 { $1 } - - -Exp :: { Exp } -Exp : Exp1 '++' Exp { EConcat $1 $3 } - | '\\' ListBind '->' Exp { EAbstr $2 $4 } - | '\\' '\\' ListBind '=>' Exp { ECTable $3 $5 } - | Decl '->' Exp { EProd $1 $3 } - | Exp3 '=>' Exp { ETType $1 $3 } - | 'let' '{' ListLocDef '}' 'in' Exp { ELet $3 $6 } - | 'let' ListLocDef 'in' Exp { ELetb $2 $4 } - | Exp3 'where' '{' ListLocDef '}' { EWhere $1 $4 } - | 'fn' '{' ListEquation '}' { EEqs $3 } - | 'in' Exp5 String { EExample $2 $3 } - | Exp1 { $1 } - - -Exp2 :: { Exp } -Exp2 : Exp3 { $1 } - - -ListExp :: { [Exp] } -ListExp : {- empty -} { [] } - | Exp { (:[]) $1 } - | Exp ';' ListExp { (:) $1 $3 } - - -Exps :: { Exps } -Exps : {- empty -} { NilExp } - | Exp6 Exps { ConsExp $1 $2 } - - -Patt2 :: { Patt } -Patt2 : '?' { PChar } - | '[' String ']' { PChars $2 } - | '#' PIdent { PMacro $2 } - | '#' PIdent '.' PIdent { PM $2 $4 } - | '_' { PW } - | PIdent { PV $1 } - | '{' PIdent '}' { PCon $2 } - | PIdent '.' PIdent { PQ $1 $3 } - | Integer { PInt $1 } - | Double { PFloat $1 } - | String { PStr $1 } - | '{' ListPattAss '}' { PR $2 } - | '<' ListPattTupleComp '>' { PTup $2 } - | '(' Patt ')' { $2 } - - -Patt1 :: { Patt } -Patt1 : PIdent ListPatt { PC $1 $2 } - | PIdent '.' PIdent ListPatt { PQC $1 $3 $4 } - | Patt2 '*' { PRep $1 } - | PIdent '@' Patt2 { PAs $1 $3 } - | '-' Patt2 { PNeg $2 } - | Patt2 { $1 } - - -Patt :: { Patt } -Patt : Patt '|' Patt1 { PDisj $1 $3 } - | Patt '+' Patt1 { PSeq $1 $3 } - | Patt1 { $1 } - - -PattAss :: { PattAss } -PattAss : ListPIdent '=' Patt { PA $1 $3 } - - -Label :: { Label } -Label : PIdent { LIdent $1 } - | '$' Integer { LVar $2 } - - -Sort :: { Sort } -Sort : 'Type' { Sort_Type } - | 'PType' { Sort_PType } - | 'Tok' { Sort_Tok } - | 'Str' { Sort_Str } - | 'Strs' { Sort_Strs } - - -ListPattAss :: { [PattAss] } -ListPattAss : {- empty -} { [] } - | PattAss { (:[]) $1 } - | PattAss ';' ListPattAss { (:) $1 $3 } - - -ListPatt :: { [Patt] } -ListPatt : Patt2 { (:[]) $1 } - | Patt2 ListPatt { (:) $1 $2 } - - -Bind :: { Bind } -Bind : PIdent { BIdent $1 } - | '_' { BWild } - - -ListBind :: { [Bind] } -ListBind : {- empty -} { [] } - | Bind { (:[]) $1 } - | Bind ',' ListBind { (:) $1 $3 } - - -Decl :: { Decl } -Decl : '(' ListBind ':' Exp ')' { DDec $2 $4 } - | Exp4 { DExp $1 } - - -TupleComp :: { TupleComp } -TupleComp : Exp { TComp $1 } - - -PattTupleComp :: { PattTupleComp } -PattTupleComp : Patt { PTComp $1 } - - -ListTupleComp :: { [TupleComp] } -ListTupleComp : {- empty -} { [] } - | TupleComp { (:[]) $1 } - | TupleComp ',' ListTupleComp { (:) $1 $3 } - - -ListPattTupleComp :: { [PattTupleComp] } -ListPattTupleComp : {- empty -} { [] } - | PattTupleComp { (:[]) $1 } - | PattTupleComp ',' ListPattTupleComp { (:) $1 $3 } - - -Case :: { Case } -Case : Patt '=>' Exp { Case $1 $3 } - - -ListCase :: { [Case] } -ListCase : Case { (:[]) $1 } - | Case ';' ListCase { (:) $1 $3 } - - -Equation :: { Equation } -Equation : ListPatt '->' Exp { Equ $1 $3 } - - -ListEquation :: { [Equation] } -ListEquation : {- empty -} { [] } - | Equation { (:[]) $1 } - | Equation ';' ListEquation { (:) $1 $3 } - - -Altern :: { Altern } -Altern : Exp '/' Exp { Alt $1 $3 } - - -ListAltern :: { [Altern] } -ListAltern : {- empty -} { [] } - | Altern { (:[]) $1 } - | Altern ';' ListAltern { (:) $1 $3 } - - -DDecl :: { DDecl } -DDecl : '(' ListBind ':' Exp ')' { DDDec $2 $4 } - | Exp6 { DDExp $1 } - - -ListDDecl :: { [DDecl] } -ListDDecl : {- empty -} { [] } - | ListDDecl DDecl { flip (:) $1 $2 } - - -OldGrammar :: { OldGrammar } -OldGrammar : Include ListTopDef { OldGr $1 (reverse $2) } - - -Include :: { Include } -Include : {- empty -} { NoIncl } - | 'include' ListFileName { Incl $2 } - - -FileName :: { FileName } -FileName : String { FString $1 } - | PIdent { FIdent $1 } - | '/' FileName { FSlash $2 } - | '.' FileName { FDot $2 } - | '-' FileName { FMinus $2 } - | PIdent FileName { FAddId $1 $2 } - - -ListFileName :: { [FileName] } -ListFileName : FileName ';' { (:[]) $1 } - | FileName ';' ListFileName { (:) $1 $3 } - - - -{ - -returnM :: a -> Err a -returnM = return - -thenM :: Err a -> (a -> Err b) -> Err b -thenM = (>>=) - -happyError :: [Token] -> Err a -happyError ts = - Bad $ "syntax error at " ++ tokenPos ts ++ - case ts of - [] -> [] - [Err _] -> " due to lexer error" - _ -> " before " ++ unwords (map prToken (take 4 ts)) - -myLexer = tokens -} - +-- This Happy file was machine-generated by the BNF converter +{ +{-# OPTIONS -fno-warn-incomplete-patterns -fno-warn-overlapping-patterns #-} +module GF.Source.ParGF where +import GF.Source.AbsGF +import GF.Source.LexGF +import GF.Data.ErrM +import qualified Data.ByteString.Char8 as BS +} + +%name pGrammar Grammar +%name pModDef ModDef +%name pOldGrammar OldGrammar +%partial pModHeader ModHeader +%name pExp Exp + +-- no lexer declaration +%monad { Err } { thenM } { returnM } +%tokentype { Token } + +%token + '!' { PT _ (TS _ 1) } + '#' { PT _ (TS _ 2) } + '$' { PT _ (TS _ 3) } + '%' { PT _ (TS _ 4) } + '(' { PT _ (TS _ 5) } + ')' { PT _ (TS _ 6) } + '*' { PT _ (TS _ 7) } + '**' { PT _ (TS _ 8) } + '+' { PT _ (TS _ 9) } + '++' { PT _ (TS _ 10) } + ',' { PT _ (TS _ 11) } + '-' { PT _ (TS _ 12) } + '->' { PT _ (TS _ 13) } + '.' { PT _ (TS _ 14) } + '/' { PT _ (TS _ 15) } + ':' { PT _ (TS _ 16) } + ';' { PT _ (TS _ 17) } + '<' { PT _ (TS _ 18) } + '=' { PT _ (TS _ 19) } + '=>' { PT _ (TS _ 20) } + '>' { PT _ (TS _ 21) } + '?' { PT _ (TS _ 22) } + '@' { PT _ (TS _ 23) } + 'Lin' { PT _ (TS _ 24) } + 'PType' { PT _ (TS _ 25) } + 'Str' { PT _ (TS _ 26) } + 'Strs' { PT _ (TS _ 27) } + 'Tok' { PT _ (TS _ 28) } + 'Type' { PT _ (TS _ 29) } + '[' { PT _ (TS _ 30) } + '\\' { PT _ (TS _ 31) } + ']' { PT _ (TS _ 32) } + '_' { PT _ (TS _ 33) } + 'abstract' { PT _ (TS _ 34) } + 'case' { PT _ (TS _ 35) } + 'cat' { PT _ (TS _ 36) } + 'concrete' { PT _ (TS _ 37) } + 'data' { PT _ (TS _ 38) } + 'def' { PT _ (TS _ 39) } + 'flags' { PT _ (TS _ 40) } + 'fn' { PT _ (TS _ 41) } + 'fun' { PT _ (TS _ 42) } + 'grammar' { PT _ (TS _ 43) } + 'in' { PT _ (TS _ 44) } + 'include' { PT _ (TS _ 45) } + 'incomplete' { PT _ (TS _ 46) } + 'instance' { PT _ (TS _ 47) } + 'interface' { PT _ (TS _ 48) } + 'let' { PT _ (TS _ 49) } + 'lin' { PT _ (TS _ 50) } + 'lincat' { PT _ (TS _ 51) } + 'lindef' { PT _ (TS _ 52) } + 'lintype' { PT _ (TS _ 53) } + 'of' { PT _ (TS _ 54) } + 'open' { PT _ (TS _ 55) } + 'oper' { PT _ (TS _ 56) } + 'out' { PT _ (TS _ 57) } + 'package' { PT _ (TS _ 58) } + 'param' { PT _ (TS _ 59) } + 'pattern' { PT _ (TS _ 60) } + 'pre' { PT _ (TS _ 61) } + 'printname' { PT _ (TS _ 62) } + 'resource' { PT _ (TS _ 63) } + 'reuse' { PT _ (TS _ 64) } + 'strs' { PT _ (TS _ 65) } + 'table' { PT _ (TS _ 66) } + 'tokenizer' { PT _ (TS _ 67) } + 'transfer' { PT _ (TS _ 68) } + 'union' { PT _ (TS _ 69) } + 'var' { PT _ (TS _ 70) } + 'variants' { PT _ (TS _ 71) } + 'where' { PT _ (TS _ 72) } + 'with' { PT _ (TS _ 73) } + '{' { PT _ (TS _ 74) } + '|' { PT _ (TS _ 75) } + '}' { PT _ (TS _ 76) } + +L_integ { PT _ (TI $$) } +L_quoted { PT _ (TL $$) } +L_doubl { PT _ (TD $$) } +L_LString { PT _ (T_LString $$) } +L_PIdent { PT _ (T_PIdent _) } +L_err { _ } + + +%% + +Integer :: { Integer } : L_integ { (read (BS.unpack $1)) :: Integer } +String :: { String } : L_quoted { BS.unpack $1 } +Double :: { Double } : L_doubl { (read (BS.unpack $1)) :: Double } +LString :: { LString} : L_LString { LString ($1)} +PIdent :: { PIdent} : L_PIdent { PIdent (mkPosToken $1)} + +Grammar :: { Grammar } +Grammar : ListModDef { Gr (reverse $1) } + + +ListModDef :: { [ModDef] } +ListModDef : {- empty -} { [] } + | ListModDef ModDef { flip (:) $1 $2 } + + +ModDef :: { ModDef } +ModDef : ModDef ';' { $1 } + | 'grammar' PIdent '=' '{' 'abstract' '=' PIdent ';' ListConcSpec '}' { MMain $2 $7 $9 } + | ComplMod ModType '=' ModBody { MModule $1 $2 $4 } + + +ConcSpec :: { ConcSpec } +ConcSpec : PIdent '=' ConcExp { ConcSpec $1 $3 } + + +ListConcSpec :: { [ConcSpec] } +ListConcSpec : {- empty -} { [] } + | ConcSpec { (:[]) $1 } + | ConcSpec ';' ListConcSpec { (:) $1 $3 } + + +ConcExp :: { ConcExp } +ConcExp : PIdent ListTransfer { ConcExp $1 (reverse $2) } + + +ListTransfer :: { [Transfer] } +ListTransfer : {- empty -} { [] } + | ListTransfer Transfer { flip (:) $1 $2 } + + +Transfer :: { Transfer } +Transfer : '(' 'transfer' 'in' Open ')' { TransferIn $4 } + | '(' 'transfer' 'out' Open ')' { TransferOut $4 } + + +ModHeader :: { ModDef } +ModHeader : ComplMod ModType '=' ModHeaderBody { MModule $1 $2 $4 } + + +ModHeaderBody :: { ModBody } +ModHeaderBody : Extend Opens { MBody $1 $2 [] } + | ListIncluded { MNoBody $1 } + | Included 'with' ListOpen { MWith $1 $3 } + | Included 'with' ListOpen '**' Opens { MWithBody $1 $3 $5 [] } + | ListIncluded '**' Included 'with' ListOpen { MWithE $1 $3 $5 } + | ListIncluded '**' Included 'with' ListOpen '**' Opens { MWithEBody $1 $3 $5 $7 [] } + | 'reuse' PIdent { MReuse $2 } + | 'union' ListIncluded { MUnion $2 } + + +ModType :: { ModType } +ModType : 'abstract' PIdent { MTAbstract $2 } + | 'resource' PIdent { MTResource $2 } + | 'interface' PIdent { MTInterface $2 } + | 'concrete' PIdent 'of' PIdent { MTConcrete $2 $4 } + | 'instance' PIdent 'of' PIdent { MTInstance $2 $4 } + | 'transfer' PIdent ':' Open '->' Open { MTTransfer $2 $4 $6 } + + +ModBody :: { ModBody } +ModBody : Extend Opens '{' ListTopDef '}' { MBody $1 $2 (reverse $4) } + | ListIncluded { MNoBody $1 } + | Included 'with' ListOpen { MWith $1 $3 } + | Included 'with' ListOpen '**' Opens '{' ListTopDef '}' { MWithBody $1 $3 $5 (reverse $7) } + | ListIncluded '**' Included 'with' ListOpen { MWithE $1 $3 $5 } + | ListIncluded '**' Included 'with' ListOpen '**' Opens '{' ListTopDef '}' { MWithEBody $1 $3 $5 $7 (reverse $9) } + | 'reuse' PIdent { MReuse $2 } + | 'union' ListIncluded { MUnion $2 } + + +ListTopDef :: { [TopDef] } +ListTopDef : {- empty -} { [] } + | ListTopDef TopDef { flip (:) $1 $2 } + + +Extend :: { Extend } +Extend : ListIncluded '**' { Ext $1 } + | {- empty -} { NoExt } + + +ListOpen :: { [Open] } +ListOpen : {- empty -} { [] } + | Open { (:[]) $1 } + | Open ',' ListOpen { (:) $1 $3 } + + +Opens :: { Opens } +Opens : {- empty -} { NoOpens } + | 'open' ListOpen 'in' { OpenIn $2 } + + +Open :: { Open } +Open : PIdent { OName $1 } + | '(' QualOpen PIdent ')' { OQualQO $2 $3 } + | '(' QualOpen PIdent '=' PIdent ')' { OQual $2 $3 $5 } + + +ComplMod :: { ComplMod } +ComplMod : {- empty -} { CMCompl } + | 'incomplete' { CMIncompl } + + +QualOpen :: { QualOpen } +QualOpen : {- empty -} { QOCompl } + | 'incomplete' { QOIncompl } + | 'interface' { QOInterface } + + +ListIncluded :: { [Included] } +ListIncluded : {- empty -} { [] } + | Included { (:[]) $1 } + | Included ',' ListIncluded { (:) $1 $3 } + + +Included :: { Included } +Included : PIdent { IAll $1 } + | PIdent '[' ListPIdent ']' { ISome $1 $3 } + | PIdent '-' '[' ListPIdent ']' { IMinus $1 $4 } + + +Def :: { Def } +Def : ListName ':' Exp { DDecl $1 $3 } + | ListName '=' Exp { DDef $1 $3 } + | Name ListPatt '=' Exp { DPatt $1 $2 $4 } + | ListName ':' Exp '=' Exp { DFull $1 $3 $5 } + + +TopDef :: { TopDef } +TopDef : 'cat' ListCatDef { DefCat $2 } + | 'fun' ListFunDef { DefFun $2 } + | 'data' ListFunDef { DefFunData $2 } + | 'def' ListDef { DefDef $2 } + | 'data' ListDataDef { DefData $2 } + | 'transfer' ListDef { DefTrans $2 } + | 'param' ListParDef { DefPar $2 } + | 'oper' ListDef { DefOper $2 } + | 'lincat' ListPrintDef { DefLincat $2 } + | 'lindef' ListDef { DefLindef $2 } + | 'lin' ListDef { DefLin $2 } + | 'printname' 'cat' ListPrintDef { DefPrintCat $3 } + | 'printname' 'fun' ListPrintDef { DefPrintFun $3 } + | 'flags' ListFlagDef { DefFlag $2 } + | 'printname' ListPrintDef { DefPrintOld $2 } + | 'lintype' ListDef { DefLintype $2 } + | 'pattern' ListDef { DefPattern $2 } + | 'package' PIdent '=' '{' ListTopDef '}' ';' { DefPackage $2 (reverse $5) } + | 'var' ListDef { DefVars $2 } + | 'tokenizer' PIdent ';' { DefTokenizer $2 } + + +CatDef :: { CatDef } +CatDef : PIdent ListDDecl { SimpleCatDef $1 (reverse $2) } + | '[' PIdent ListDDecl ']' { ListCatDef $2 (reverse $3) } + | '[' PIdent ListDDecl ']' '{' Integer '}' { ListSizeCatDef $2 (reverse $3) $6 } + + +FunDef :: { FunDef } +FunDef : ListPIdent ':' Exp { FunDef $1 $3 } + + +DataDef :: { DataDef } +DataDef : PIdent '=' ListDataConstr { DataDef $1 $3 } + + +DataConstr :: { DataConstr } +DataConstr : PIdent { DataId $1 } + | PIdent '.' PIdent { DataQId $1 $3 } + + +ListDataConstr :: { [DataConstr] } +ListDataConstr : {- empty -} { [] } + | DataConstr { (:[]) $1 } + | DataConstr '|' ListDataConstr { (:) $1 $3 } + + +ParDef :: { ParDef } +ParDef : PIdent '=' ListParConstr { ParDefDir $1 $3 } + | PIdent '=' '(' 'in' PIdent ')' { ParDefIndir $1 $5 } + | PIdent { ParDefAbs $1 } + + +ParConstr :: { ParConstr } +ParConstr : PIdent ListDDecl { ParConstr $1 (reverse $2) } + + +PrintDef :: { PrintDef } +PrintDef : ListName '=' Exp { PrintDef $1 $3 } + + +FlagDef :: { FlagDef } +FlagDef : PIdent '=' PIdent { FlagDef $1 $3 } + + +ListDef :: { [Def] } +ListDef : Def ';' { (:[]) $1 } + | Def ';' ListDef { (:) $1 $3 } + + +ListCatDef :: { [CatDef] } +ListCatDef : CatDef ';' { (:[]) $1 } + | CatDef ';' ListCatDef { (:) $1 $3 } + + +ListFunDef :: { [FunDef] } +ListFunDef : FunDef ';' { (:[]) $1 } + | FunDef ';' ListFunDef { (:) $1 $3 } + + +ListDataDef :: { [DataDef] } +ListDataDef : DataDef ';' { (:[]) $1 } + | DataDef ';' ListDataDef { (:) $1 $3 } + + +ListParDef :: { [ParDef] } +ListParDef : ParDef ';' { (:[]) $1 } + | ParDef ';' ListParDef { (:) $1 $3 } + + +ListPrintDef :: { [PrintDef] } +ListPrintDef : PrintDef ';' { (:[]) $1 } + | PrintDef ';' ListPrintDef { (:) $1 $3 } + + +ListFlagDef :: { [FlagDef] } +ListFlagDef : FlagDef ';' { (:[]) $1 } + | FlagDef ';' ListFlagDef { (:) $1 $3 } + + +ListParConstr :: { [ParConstr] } +ListParConstr : {- empty -} { [] } + | ParConstr { (:[]) $1 } + | ParConstr '|' ListParConstr { (:) $1 $3 } + + +ListPIdent :: { [PIdent] } +ListPIdent : PIdent { (:[]) $1 } + | PIdent ',' ListPIdent { (:) $1 $3 } + + +Name :: { Name } +Name : PIdent { IdentName $1 } + | '[' PIdent ']' { ListName $2 } + + +ListName :: { [Name] } +ListName : Name { (:[]) $1 } + | Name ',' ListName { (:) $1 $3 } + + +LocDef :: { LocDef } +LocDef : ListPIdent ':' Exp { LDDecl $1 $3 } + | ListPIdent '=' Exp { LDDef $1 $3 } + | ListPIdent ':' Exp '=' Exp { LDFull $1 $3 $5 } + + +ListLocDef :: { [LocDef] } +ListLocDef : {- empty -} { [] } + | LocDef { (:[]) $1 } + | LocDef ';' ListLocDef { (:) $1 $3 } + + +Exp6 :: { Exp } +Exp6 : PIdent { EIdent $1 } + | '{' PIdent '}' { EConstr $2 } + | '%' PIdent '%' { ECons $2 } + | Sort { ESort $1 } + | String { EString $1 } + | Integer { EInt $1 } + | Double { EFloat $1 } + | '?' { EMeta } + | '[' ']' { EEmpty } + | 'data' { EData } + | '[' PIdent Exps ']' { EList $2 $3 } + | '[' String ']' { EStrings $2 } + | '{' ListLocDef '}' { ERecord $2 } + | '<' ListTupleComp '>' { ETuple $2 } + | '(' 'in' PIdent ')' { EIndir $3 } + | '<' Exp ':' Exp '>' { ETyped $2 $4 } + | '(' Exp ')' { $2 } + | LString { ELString $1 } + + +Exp5 :: { Exp } +Exp5 : Exp5 '.' Label { EProj $1 $3 } + | '{' PIdent '.' PIdent '}' { EQConstr $2 $4 } + | '%' PIdent '.' PIdent { EQCons $2 $4 } + | Exp6 { $1 } + + +Exp4 :: { Exp } +Exp4 : Exp4 Exp5 { EApp $1 $2 } + | 'table' '{' ListCase '}' { ETable $3 } + | 'table' Exp6 '{' ListCase '}' { ETTable $2 $4 } + | 'table' Exp6 '[' ListExp ']' { EVTable $2 $4 } + | 'case' Exp 'of' '{' ListCase '}' { ECase $2 $5 } + | 'variants' '{' ListExp '}' { EVariants $3 } + | 'pre' '{' Exp ';' ListAltern '}' { EPre $3 $5 } + | 'strs' '{' ListExp '}' { EStrs $3 } + | PIdent '@' Exp6 { EConAt $1 $3 } + | '#' Patt2 { EPatt $2 } + | 'pattern' Exp5 { EPattType $2 } + | Exp5 { $1 } + | 'Lin' PIdent { ELin $2 } + + +Exp3 :: { Exp } +Exp3 : Exp3 '!' Exp4 { ESelect $1 $3 } + | Exp3 '*' Exp4 { ETupTyp $1 $3 } + | Exp3 '**' Exp4 { EExtend $1 $3 } + | Exp4 { $1 } + + +Exp1 :: { Exp } +Exp1 : Exp2 '+' Exp1 { EGlue $1 $3 } + | Exp2 { $1 } + + +Exp :: { Exp } +Exp : Exp1 '++' Exp { EConcat $1 $3 } + | '\\' ListBind '->' Exp { EAbstr $2 $4 } + | '\\' '\\' ListBind '=>' Exp { ECTable $3 $5 } + | Decl '->' Exp { EProd $1 $3 } + | Exp3 '=>' Exp { ETType $1 $3 } + | 'let' '{' ListLocDef '}' 'in' Exp { ELet $3 $6 } + | 'let' ListLocDef 'in' Exp { ELetb $2 $4 } + | Exp3 'where' '{' ListLocDef '}' { EWhere $1 $4 } + | 'fn' '{' ListEquation '}' { EEqs $3 } + | 'in' Exp5 String { EExample $2 $3 } + | Exp1 { $1 } + + +Exp2 :: { Exp } +Exp2 : Exp3 { $1 } + + +ListExp :: { [Exp] } +ListExp : {- empty -} { [] } + | Exp { (:[]) $1 } + | Exp ';' ListExp { (:) $1 $3 } + + +Exps :: { Exps } +Exps : {- empty -} { NilExp } + | Exp6 Exps { ConsExp $1 $2 } + + +Patt2 :: { Patt } +Patt2 : '?' { PChar } + | '[' String ']' { PChars $2 } + | '#' PIdent { PMacro $2 } + | '#' PIdent '.' PIdent { PM $2 $4 } + | '_' { PW } + | PIdent { PV $1 } + | '{' PIdent '}' { PCon $2 } + | PIdent '.' PIdent { PQ $1 $3 } + | Integer { PInt $1 } + | Double { PFloat $1 } + | String { PStr $1 } + | '{' ListPattAss '}' { PR $2 } + | '<' ListPattTupleComp '>' { PTup $2 } + | '(' Patt ')' { $2 } + + +Patt1 :: { Patt } +Patt1 : PIdent ListPatt { PC $1 $2 } + | PIdent '.' PIdent ListPatt { PQC $1 $3 $4 } + | Patt2 '*' { PRep $1 } + | PIdent '@' Patt2 { PAs $1 $3 } + | '-' Patt2 { PNeg $2 } + | Patt2 { $1 } + + +Patt :: { Patt } +Patt : Patt '|' Patt1 { PDisj $1 $3 } + | Patt '+' Patt1 { PSeq $1 $3 } + | Patt1 { $1 } + + +PattAss :: { PattAss } +PattAss : ListPIdent '=' Patt { PA $1 $3 } + + +Label :: { Label } +Label : PIdent { LIdent $1 } + | '$' Integer { LVar $2 } + + +Sort :: { Sort } +Sort : 'Type' { Sort_Type } + | 'PType' { Sort_PType } + | 'Tok' { Sort_Tok } + | 'Str' { Sort_Str } + | 'Strs' { Sort_Strs } + + +ListPattAss :: { [PattAss] } +ListPattAss : {- empty -} { [] } + | PattAss { (:[]) $1 } + | PattAss ';' ListPattAss { (:) $1 $3 } + + +ListPatt :: { [Patt] } +ListPatt : Patt2 { (:[]) $1 } + | Patt2 ListPatt { (:) $1 $2 } + + +Bind :: { Bind } +Bind : PIdent { BIdent $1 } + | '_' { BWild } + + +ListBind :: { [Bind] } +ListBind : {- empty -} { [] } + | Bind { (:[]) $1 } + | Bind ',' ListBind { (:) $1 $3 } + + +Decl :: { Decl } +Decl : '(' ListBind ':' Exp ')' { DDec $2 $4 } + | Exp4 { DExp $1 } + + +TupleComp :: { TupleComp } +TupleComp : Exp { TComp $1 } + + +PattTupleComp :: { PattTupleComp } +PattTupleComp : Patt { PTComp $1 } + + +ListTupleComp :: { [TupleComp] } +ListTupleComp : {- empty -} { [] } + | TupleComp { (:[]) $1 } + | TupleComp ',' ListTupleComp { (:) $1 $3 } + + +ListPattTupleComp :: { [PattTupleComp] } +ListPattTupleComp : {- empty -} { [] } + | PattTupleComp { (:[]) $1 } + | PattTupleComp ',' ListPattTupleComp { (:) $1 $3 } + + +Case :: { Case } +Case : Patt '=>' Exp { Case $1 $3 } + + +ListCase :: { [Case] } +ListCase : Case { (:[]) $1 } + | Case ';' ListCase { (:) $1 $3 } + + +Equation :: { Equation } +Equation : ListPatt '->' Exp { Equ $1 $3 } + + +ListEquation :: { [Equation] } +ListEquation : {- empty -} { [] } + | Equation { (:[]) $1 } + | Equation ';' ListEquation { (:) $1 $3 } + + +Altern :: { Altern } +Altern : Exp '/' Exp { Alt $1 $3 } + + +ListAltern :: { [Altern] } +ListAltern : {- empty -} { [] } + | Altern { (:[]) $1 } + | Altern ';' ListAltern { (:) $1 $3 } + + +DDecl :: { DDecl } +DDecl : '(' ListBind ':' Exp ')' { DDDec $2 $4 } + | Exp6 { DDExp $1 } + + +ListDDecl :: { [DDecl] } +ListDDecl : {- empty -} { [] } + | ListDDecl DDecl { flip (:) $1 $2 } + + +OldGrammar :: { OldGrammar } +OldGrammar : Include ListTopDef { OldGr $1 (reverse $2) } + + +Include :: { Include } +Include : {- empty -} { NoIncl } + | 'include' ListFileName { Incl $2 } + + +FileName :: { FileName } +FileName : String { FString $1 } + | PIdent { FIdent $1 } + | '/' FileName { FSlash $2 } + | '.' FileName { FDot $2 } + | '-' FileName { FMinus $2 } + | PIdent FileName { FAddId $1 $2 } + + +ListFileName :: { [FileName] } +ListFileName : FileName ';' { (:[]) $1 } + | FileName ';' ListFileName { (:) $1 $3 } + + + +{ + +returnM :: a -> Err a +returnM = return + +thenM :: Err a -> (a -> Err b) -> Err b +thenM = (>>=) + +happyError :: [Token] -> Err a +happyError ts = + Bad $ "syntax error at " ++ tokenPos ts ++ + case ts of + [] -> [] + [Err _] -> " due to lexer error" + _ -> " before " ++ unwords (map (BS.unpack . prToken) (take 4 ts)) + +myLexer = tokens +} + diff --git a/src-3.0/GF/Source/PrintGF.hs b/src-3.0/GF/Source/PrintGF.hs index 0a260f5bf..ea2277e67 100644 --- a/src-3.0/GF/Source/PrintGF.hs +++ b/src-3.0/GF/Source/PrintGF.hs @@ -1,532 +1,534 @@ -{-# OPTIONS -fno-warn-incomplete-patterns #-} -module GF.Source.PrintGF where - --- pretty-printer generated by the BNF converter - -import GF.Source.AbsGF -import Char - --- the top-level printing method -printTree :: Print a => a -> String -printTree = render . prt 0 - -type Doc = [ShowS] -> [ShowS] - -doc :: ShowS -> Doc -doc = (:) - -render :: Doc -> String -render d = rend 0 (map ($ "") $ d []) "" where - rend i ss = case ss of - "[" :ts -> showChar '[' . rend i ts - "(" :ts -> showChar '(' . rend i ts - "{" :ts -> showChar '{' . new (i+1) . rend (i+1) ts - "}" : ";":ts -> new (i-1) . space "}" . showChar ';' . new (i-1) . rend (i-1) ts - "}" :ts -> new (i-1) . showChar '}' . new (i-1) . rend (i-1) ts - ";" :ts -> showChar ';' . new i . rend i ts - t : "," :ts -> showString t . space "," . rend i ts - t : ")" :ts -> showString t . showChar ')' . rend i ts - t : "]" :ts -> showString t . showChar ']' . rend i ts - t :ts -> space t . rend i ts - _ -> id - new i = showChar '\n' . replicateS (2*i) (showChar ' ') . dropWhile isSpace - space t = showString t . (\s -> if null s then "" else (' ':s)) - -parenth :: Doc -> Doc -parenth ss = doc (showChar '(') . ss . doc (showChar ')') - -concatS :: [ShowS] -> ShowS -concatS = foldr (.) id - -concatD :: [Doc] -> Doc -concatD = foldr (.) id - -replicateS :: Int -> ShowS -> ShowS -replicateS n f = concatS (replicate n f) - --- the printer class does the job -class Print a where - prt :: Int -> a -> Doc - prtList :: [a] -> Doc - prtList = concatD . map (prt 0) - -instance Print a => Print [a] where - prt _ = prtList - -instance Print Char where - prt _ s = doc (showChar '\'' . mkEsc '\'' s . showChar '\'') - prtList s = doc (showChar '"' . concatS (map (mkEsc '"') s) . showChar '"') - -mkEsc :: Char -> Char -> ShowS -mkEsc q s = case s of - _ | s == q -> showChar '\\' . showChar s - '\\'-> showString "\\\\" - '\n' -> showString "\\n" - '\t' -> showString "\\t" - _ -> showChar s - -prPrec :: Int -> Int -> Doc -> Doc -prPrec i j = if j (concatD [prt 0 x]) - x:xs -> (concatD [prt 0 x , doc (showString ",") , prt 0 xs]) - - - -instance Print Grammar where - prt i e = case e of - Gr moddefs -> prPrec i 0 (concatD [prt 0 moddefs]) - - -instance Print ModDef where - prt i e = case e of - MMain pident0 pident concspecs -> prPrec i 0 (concatD [doc (showString "grammar") , prt 0 pident0 , doc (showString "=") , doc (showString "{") , doc (showString "abstract") , doc (showString "=") , prt 0 pident , doc (showString ";") , prt 0 concspecs , doc (showString "}")]) - MModule complmod modtype modbody -> prPrec i 0 (concatD [prt 0 complmod , prt 0 modtype , doc (showString "=") , prt 0 modbody]) - - prtList es = case es of - [] -> (concatD []) - x:xs -> (concatD [prt 0 x , prt 0 xs]) - -instance Print ConcSpec where - prt i e = case e of - ConcSpec pident concexp -> prPrec i 0 (concatD [prt 0 pident , doc (showString "=") , prt 0 concexp]) - - prtList es = case es of - [] -> (concatD []) - [x] -> (concatD [prt 0 x]) - x:xs -> (concatD [prt 0 x , doc (showString ";") , prt 0 xs]) - -instance Print ConcExp where - prt i e = case e of - ConcExp pident transfers -> prPrec i 0 (concatD [prt 0 pident , prt 0 transfers]) - - -instance Print Transfer where - prt i e = case e of - TransferIn open -> prPrec i 0 (concatD [doc (showString "(") , doc (showString "transfer") , doc (showString "in") , prt 0 open , doc (showString ")")]) - TransferOut open -> prPrec i 0 (concatD [doc (showString "(") , doc (showString "transfer") , doc (showString "out") , prt 0 open , doc (showString ")")]) - - prtList es = case es of - [] -> (concatD []) - x:xs -> (concatD [prt 0 x , prt 0 xs]) - -instance Print ModType where - prt i e = case e of - MTAbstract pident -> prPrec i 0 (concatD [doc (showString "abstract") , prt 0 pident]) - MTResource pident -> prPrec i 0 (concatD [doc (showString "resource") , prt 0 pident]) - MTInterface pident -> prPrec i 0 (concatD [doc (showString "interface") , prt 0 pident]) - MTConcrete pident0 pident -> prPrec i 0 (concatD [doc (showString "concrete") , prt 0 pident0 , doc (showString "of") , prt 0 pident]) - MTInstance pident0 pident -> prPrec i 0 (concatD [doc (showString "instance") , prt 0 pident0 , doc (showString "of") , prt 0 pident]) - MTTransfer pident open0 open -> prPrec i 0 (concatD [doc (showString "transfer") , prt 0 pident , doc (showString ":") , prt 0 open0 , doc (showString "->") , prt 0 open]) - - -instance Print ModBody where - prt i e = case e of - MBody extend opens topdefs -> prPrec i 0 (concatD [prt 0 extend , prt 0 opens , doc (showString "{") , prt 0 topdefs , doc (showString "}")]) - MNoBody includeds -> prPrec i 0 (concatD [prt 0 includeds]) - MWith included opens -> prPrec i 0 (concatD [prt 0 included , doc (showString "with") , prt 0 opens]) - MWithBody included opens0 opens topdefs -> prPrec i 0 (concatD [prt 0 included , doc (showString "with") , prt 0 opens0 , doc (showString "**") , prt 0 opens , doc (showString "{") , prt 0 topdefs , doc (showString "}")]) - MWithE includeds included opens -> prPrec i 0 (concatD [prt 0 includeds , doc (showString "**") , prt 0 included , doc (showString "with") , prt 0 opens]) - MWithEBody includeds included opens0 opens topdefs -> prPrec i 0 (concatD [prt 0 includeds , doc (showString "**") , prt 0 included , doc (showString "with") , prt 0 opens0 , doc (showString "**") , prt 0 opens , doc (showString "{") , prt 0 topdefs , doc (showString "}")]) - MReuse pident -> prPrec i 0 (concatD [doc (showString "reuse") , prt 0 pident]) - MUnion includeds -> prPrec i 0 (concatD [doc (showString "union") , prt 0 includeds]) - - -instance Print Extend where - prt i e = case e of - Ext includeds -> prPrec i 0 (concatD [prt 0 includeds , doc (showString "**")]) - NoExt -> prPrec i 0 (concatD []) - - -instance Print Opens where - prt i e = case e of - NoOpens -> prPrec i 0 (concatD []) - OpenIn opens -> prPrec i 0 (concatD [doc (showString "open") , prt 0 opens , doc (showString "in")]) - - -instance Print Open where - prt i e = case e of - OName pident -> prPrec i 0 (concatD [prt 0 pident]) - OQualQO qualopen pident -> prPrec i 0 (concatD [doc (showString "(") , prt 0 qualopen , prt 0 pident , doc (showString ")")]) - OQual qualopen pident0 pident -> prPrec i 0 (concatD [doc (showString "(") , prt 0 qualopen , prt 0 pident0 , doc (showString "=") , prt 0 pident , doc (showString ")")]) - - prtList es = case es of - [] -> (concatD []) - [x] -> (concatD [prt 0 x]) - x:xs -> (concatD [prt 0 x , doc (showString ",") , prt 0 xs]) - -instance Print ComplMod where - prt i e = case e of - CMCompl -> prPrec i 0 (concatD []) - CMIncompl -> prPrec i 0 (concatD [doc (showString "incomplete")]) - - -instance Print QualOpen where - prt i e = case e of - QOCompl -> prPrec i 0 (concatD []) - QOIncompl -> prPrec i 0 (concatD [doc (showString "incomplete")]) - QOInterface -> prPrec i 0 (concatD [doc (showString "interface")]) - - -instance Print Included where - prt i e = case e of - IAll pident -> prPrec i 0 (concatD [prt 0 pident]) - ISome pident pidents -> prPrec i 0 (concatD [prt 0 pident , doc (showString "[") , prt 0 pidents , doc (showString "]")]) - IMinus pident pidents -> prPrec i 0 (concatD [prt 0 pident , doc (showString "-") , doc (showString "[") , prt 0 pidents , doc (showString "]")]) - - prtList es = case es of - [] -> (concatD []) - [x] -> (concatD [prt 0 x]) - x:xs -> (concatD [prt 0 x , doc (showString ",") , prt 0 xs]) - -instance Print Def where - prt i e = case e of - DDecl names exp -> prPrec i 0 (concatD [prt 0 names , doc (showString ":") , prt 0 exp]) - DDef names exp -> prPrec i 0 (concatD [prt 0 names , doc (showString "=") , prt 0 exp]) - DPatt name patts exp -> prPrec i 0 (concatD [prt 0 name , prt 0 patts , doc (showString "=") , prt 0 exp]) - DFull names exp0 exp -> prPrec i 0 (concatD [prt 0 names , doc (showString ":") , prt 0 exp0 , doc (showString "=") , prt 0 exp]) - - prtList es = case es of - [x] -> (concatD [prt 0 x , doc (showString ";")]) - x:xs -> (concatD [prt 0 x , doc (showString ";") , prt 0 xs]) - -instance Print TopDef where - prt i e = case e of - DefCat catdefs -> prPrec i 0 (concatD [doc (showString "cat") , prt 0 catdefs]) - DefFun fundefs -> prPrec i 0 (concatD [doc (showString "fun") , prt 0 fundefs]) - DefFunData fundefs -> prPrec i 0 (concatD [doc (showString "data") , prt 0 fundefs]) - DefDef defs -> prPrec i 0 (concatD [doc (showString "def") , prt 0 defs]) - DefData datadefs -> prPrec i 0 (concatD [doc (showString "data") , prt 0 datadefs]) - DefTrans defs -> prPrec i 0 (concatD [doc (showString "transfer") , prt 0 defs]) - DefPar pardefs -> prPrec i 0 (concatD [doc (showString "param") , prt 0 pardefs]) - DefOper defs -> prPrec i 0 (concatD [doc (showString "oper") , prt 0 defs]) - DefLincat printdefs -> prPrec i 0 (concatD [doc (showString "lincat") , prt 0 printdefs]) - DefLindef defs -> prPrec i 0 (concatD [doc (showString "lindef") , prt 0 defs]) - DefLin defs -> prPrec i 0 (concatD [doc (showString "lin") , prt 0 defs]) - DefPrintCat printdefs -> prPrec i 0 (concatD [doc (showString "printname") , doc (showString "cat") , prt 0 printdefs]) - DefPrintFun printdefs -> prPrec i 0 (concatD [doc (showString "printname") , doc (showString "fun") , prt 0 printdefs]) - DefFlag flagdefs -> prPrec i 0 (concatD [doc (showString "flags") , prt 0 flagdefs]) - DefPrintOld printdefs -> prPrec i 0 (concatD [doc (showString "printname") , prt 0 printdefs]) - DefLintype defs -> prPrec i 0 (concatD [doc (showString "lintype") , prt 0 defs]) - DefPattern defs -> prPrec i 0 (concatD [doc (showString "pattern") , prt 0 defs]) - DefPackage pident topdefs -> prPrec i 0 (concatD [doc (showString "package") , prt 0 pident , doc (showString "=") , doc (showString "{") , prt 0 topdefs , doc (showString "}") , doc (showString ";")]) - DefVars defs -> prPrec i 0 (concatD [doc (showString "var") , prt 0 defs]) - DefTokenizer pident -> prPrec i 0 (concatD [doc (showString "tokenizer") , prt 0 pident , doc (showString ";")]) - - prtList es = case es of - [] -> (concatD []) - x:xs -> (concatD [prt 0 x , prt 0 xs]) - -instance Print CatDef where - prt i e = case e of - SimpleCatDef pident ddecls -> prPrec i 0 (concatD [prt 0 pident , prt 0 ddecls]) - ListCatDef pident ddecls -> prPrec i 0 (concatD [doc (showString "[") , prt 0 pident , prt 0 ddecls , doc (showString "]")]) - ListSizeCatDef pident ddecls n -> prPrec i 0 (concatD [doc (showString "[") , prt 0 pident , prt 0 ddecls , doc (showString "]") , doc (showString "{") , prt 0 n , doc (showString "}")]) - - prtList es = case es of - [x] -> (concatD [prt 0 x , doc (showString ";")]) - x:xs -> (concatD [prt 0 x , doc (showString ";") , prt 0 xs]) - -instance Print FunDef where - prt i e = case e of - FunDef pidents exp -> prPrec i 0 (concatD [prt 0 pidents , doc (showString ":") , prt 0 exp]) - - prtList es = case es of - [x] -> (concatD [prt 0 x , doc (showString ";")]) - x:xs -> (concatD [prt 0 x , doc (showString ";") , prt 0 xs]) - -instance Print DataDef where - prt i e = case e of - DataDef pident dataconstrs -> prPrec i 0 (concatD [prt 0 pident , doc (showString "=") , prt 0 dataconstrs]) - - prtList es = case es of - [x] -> (concatD [prt 0 x , doc (showString ";")]) - x:xs -> (concatD [prt 0 x , doc (showString ";") , prt 0 xs]) - -instance Print DataConstr where - prt i e = case e of - DataId pident -> prPrec i 0 (concatD [prt 0 pident]) - DataQId pident0 pident -> prPrec i 0 (concatD [prt 0 pident0 , doc (showString ".") , prt 0 pident]) - - prtList es = case es of - [] -> (concatD []) - [x] -> (concatD [prt 0 x]) - x:xs -> (concatD [prt 0 x , doc (showString "|") , prt 0 xs]) - -instance Print ParDef where - prt i e = case e of - ParDefDir pident parconstrs -> prPrec i 0 (concatD [prt 0 pident , doc (showString "=") , prt 0 parconstrs]) - ParDefIndir pident0 pident -> prPrec i 0 (concatD [prt 0 pident0 , doc (showString "=") , doc (showString "(") , doc (showString "in") , prt 0 pident , doc (showString ")")]) - ParDefAbs pident -> prPrec i 0 (concatD [prt 0 pident]) - - prtList es = case es of - [x] -> (concatD [prt 0 x , doc (showString ";")]) - x:xs -> (concatD [prt 0 x , doc (showString ";") , prt 0 xs]) - -instance Print ParConstr where - prt i e = case e of - ParConstr pident ddecls -> prPrec i 0 (concatD [prt 0 pident , prt 0 ddecls]) - - prtList es = case es of - [] -> (concatD []) - [x] -> (concatD [prt 0 x]) - x:xs -> (concatD [prt 0 x , doc (showString "|") , prt 0 xs]) - -instance Print PrintDef where - prt i e = case e of - PrintDef names exp -> prPrec i 0 (concatD [prt 0 names , doc (showString "=") , prt 0 exp]) - - prtList es = case es of - [x] -> (concatD [prt 0 x , doc (showString ";")]) - x:xs -> (concatD [prt 0 x , doc (showString ";") , prt 0 xs]) - -instance Print FlagDef where - prt i e = case e of - FlagDef pident0 pident -> prPrec i 0 (concatD [prt 0 pident0 , doc (showString "=") , prt 0 pident]) - - prtList es = case es of - [x] -> (concatD [prt 0 x , doc (showString ";")]) - x:xs -> (concatD [prt 0 x , doc (showString ";") , prt 0 xs]) - -instance Print Name where - prt i e = case e of - IdentName pident -> prPrec i 0 (concatD [prt 0 pident]) - ListName pident -> prPrec i 0 (concatD [doc (showString "[") , prt 0 pident , doc (showString "]")]) - - prtList es = case es of - [x] -> (concatD [prt 0 x]) - x:xs -> (concatD [prt 0 x , doc (showString ",") , prt 0 xs]) - -instance Print LocDef where - prt i e = case e of - LDDecl pidents exp -> prPrec i 0 (concatD [prt 0 pidents , doc (showString ":") , prt 0 exp]) - LDDef pidents exp -> prPrec i 0 (concatD [prt 0 pidents , doc (showString "=") , prt 0 exp]) - LDFull pidents exp0 exp -> prPrec i 0 (concatD [prt 0 pidents , doc (showString ":") , prt 0 exp0 , doc (showString "=") , prt 0 exp]) - - prtList es = case es of - [] -> (concatD []) - [x] -> (concatD [prt 0 x]) - x:xs -> (concatD [prt 0 x , doc (showString ";") , prt 0 xs]) - -instance Print Exp where - prt i e = case e of - EIdent pident -> prPrec i 6 (concatD [prt 0 pident]) - EConstr pident -> prPrec i 6 (concatD [doc (showString "{") , prt 0 pident , doc (showString "}")]) - ECons pident -> prPrec i 6 (concatD [doc (showString "%") , prt 0 pident , doc (showString "%")]) - ESort sort -> prPrec i 6 (concatD [prt 0 sort]) - EString str -> prPrec i 6 (concatD [prt 0 str]) - EInt n -> prPrec i 6 (concatD [prt 0 n]) - EFloat d -> prPrec i 6 (concatD [prt 0 d]) - EMeta -> prPrec i 6 (concatD [doc (showString "?")]) - EEmpty -> prPrec i 6 (concatD [doc (showString "[") , doc (showString "]")]) - EData -> prPrec i 6 (concatD [doc (showString "data")]) - EList pident exps -> prPrec i 6 (concatD [doc (showString "[") , prt 0 pident , prt 0 exps , doc (showString "]")]) - EStrings str -> prPrec i 6 (concatD [doc (showString "[") , prt 0 str , doc (showString "]")]) - ERecord locdefs -> prPrec i 6 (concatD [doc (showString "{") , prt 0 locdefs , doc (showString "}")]) - ETuple tuplecomps -> prPrec i 6 (concatD [doc (showString "<") , prt 0 tuplecomps , doc (showString ">")]) - EIndir pident -> prPrec i 6 (concatD [doc (showString "(") , doc (showString "in") , prt 0 pident , doc (showString ")")]) - ETyped exp0 exp -> prPrec i 6 (concatD [doc (showString "<") , prt 0 exp0 , doc (showString ":") , prt 0 exp , doc (showString ">")]) - EProj exp label -> prPrec i 5 (concatD [prt 5 exp , doc (showString ".") , prt 0 label]) - EQConstr pident0 pident -> prPrec i 5 (concatD [doc (showString "{") , prt 0 pident0 , doc (showString ".") , prt 0 pident , doc (showString "}")]) - EQCons pident0 pident -> prPrec i 5 (concatD [doc (showString "%") , prt 0 pident0 , doc (showString ".") , prt 0 pident]) - EApp exp0 exp -> prPrec i 4 (concatD [prt 4 exp0 , prt 5 exp]) - ETable cases -> prPrec i 4 (concatD [doc (showString "table") , doc (showString "{") , prt 0 cases , doc (showString "}")]) - ETTable exp cases -> prPrec i 4 (concatD [doc (showString "table") , prt 6 exp , doc (showString "{") , prt 0 cases , doc (showString "}")]) - EVTable exp exps -> prPrec i 4 (concatD [doc (showString "table") , prt 6 exp , doc (showString "[") , prt 0 exps , doc (showString "]")]) - ECase exp cases -> prPrec i 4 (concatD [doc (showString "case") , prt 0 exp , doc (showString "of") , doc (showString "{") , prt 0 cases , doc (showString "}")]) - EVariants exps -> prPrec i 4 (concatD [doc (showString "variants") , doc (showString "{") , prt 0 exps , doc (showString "}")]) - EPre exp alterns -> prPrec i 4 (concatD [doc (showString "pre") , doc (showString "{") , prt 0 exp , doc (showString ";") , prt 0 alterns , doc (showString "}")]) - EStrs exps -> prPrec i 4 (concatD [doc (showString "strs") , doc (showString "{") , prt 0 exps , doc (showString "}")]) - EConAt pident exp -> prPrec i 4 (concatD [prt 0 pident , doc (showString "@") , prt 6 exp]) - EPatt patt -> prPrec i 4 (concatD [doc (showString "#") , prt 2 patt]) - EPattType exp -> prPrec i 4 (concatD [doc (showString "pattern") , prt 5 exp]) - ESelect exp0 exp -> prPrec i 3 (concatD [prt 3 exp0 , doc (showString "!") , prt 4 exp]) - ETupTyp exp0 exp -> prPrec i 3 (concatD [prt 3 exp0 , doc (showString "*") , prt 4 exp]) - EExtend exp0 exp -> prPrec i 3 (concatD [prt 3 exp0 , doc (showString "**") , prt 4 exp]) - EGlue exp0 exp -> prPrec i 1 (concatD [prt 2 exp0 , doc (showString "+") , prt 1 exp]) - EConcat exp0 exp -> prPrec i 0 (concatD [prt 1 exp0 , doc (showString "++") , prt 0 exp]) - EAbstr binds exp -> prPrec i 0 (concatD [doc (showString "\\") , prt 0 binds , doc (showString "->") , prt 0 exp]) - ECTable binds exp -> prPrec i 0 (concatD [doc (showString "\\") , doc (showString "\\") , prt 0 binds , doc (showString "=>") , prt 0 exp]) - EProd decl exp -> prPrec i 0 (concatD [prt 0 decl , doc (showString "->") , prt 0 exp]) - ETType exp0 exp -> prPrec i 0 (concatD [prt 3 exp0 , doc (showString "=>") , prt 0 exp]) - ELet locdefs exp -> prPrec i 0 (concatD [doc (showString "let") , doc (showString "{") , prt 0 locdefs , doc (showString "}") , doc (showString "in") , prt 0 exp]) - ELetb locdefs exp -> prPrec i 0 (concatD [doc (showString "let") , prt 0 locdefs , doc (showString "in") , prt 0 exp]) - EWhere exp locdefs -> prPrec i 0 (concatD [prt 3 exp , doc (showString "where") , doc (showString "{") , prt 0 locdefs , doc (showString "}")]) - EEqs equations -> prPrec i 0 (concatD [doc (showString "fn") , doc (showString "{") , prt 0 equations , doc (showString "}")]) - EExample exp str -> prPrec i 0 (concatD [doc (showString "in") , prt 5 exp , prt 0 str]) - ELString lstring -> prPrec i 6 (concatD [prt 0 lstring]) - ELin pident -> prPrec i 4 (concatD [doc (showString "Lin") , prt 0 pident]) - - prtList es = case es of - [] -> (concatD []) - [x] -> (concatD [prt 0 x]) - x:xs -> (concatD [prt 0 x , doc (showString ";") , prt 0 xs]) - -instance Print Exps where - prt i e = case e of - NilExp -> prPrec i 0 (concatD []) - ConsExp exp exps -> prPrec i 0 (concatD [prt 6 exp , prt 0 exps]) - - -instance Print Patt where - prt i e = case e of - PChar -> prPrec i 2 (concatD [doc (showString "?")]) - PChars str -> prPrec i 2 (concatD [doc (showString "[") , prt 0 str , doc (showString "]")]) - PMacro pident -> prPrec i 2 (concatD [doc (showString "#") , prt 0 pident]) - PM pident0 pident -> prPrec i 2 (concatD [doc (showString "#") , prt 0 pident0 , doc (showString ".") , prt 0 pident]) - PW -> prPrec i 2 (concatD [doc (showString "_")]) - PV pident -> prPrec i 2 (concatD [prt 0 pident]) - PCon pident -> prPrec i 2 (concatD [doc (showString "{") , prt 0 pident , doc (showString "}")]) - PQ pident0 pident -> prPrec i 2 (concatD [prt 0 pident0 , doc (showString ".") , prt 0 pident]) - PInt n -> prPrec i 2 (concatD [prt 0 n]) - PFloat d -> prPrec i 2 (concatD [prt 0 d]) - PStr str -> prPrec i 2 (concatD [prt 0 str]) - PR pattasss -> prPrec i 2 (concatD [doc (showString "{") , prt 0 pattasss , doc (showString "}")]) - PTup patttuplecomps -> prPrec i 2 (concatD [doc (showString "<") , prt 0 patttuplecomps , doc (showString ">")]) - PC pident patts -> prPrec i 1 (concatD [prt 0 pident , prt 0 patts]) - PQC pident0 pident patts -> prPrec i 1 (concatD [prt 0 pident0 , doc (showString ".") , prt 0 pident , prt 0 patts]) - PDisj patt0 patt -> prPrec i 0 (concatD [prt 0 patt0 , doc (showString "|") , prt 1 patt]) - PSeq patt0 patt -> prPrec i 0 (concatD [prt 0 patt0 , doc (showString "+") , prt 1 patt]) - PRep patt -> prPrec i 1 (concatD [prt 2 patt , doc (showString "*")]) - PAs pident patt -> prPrec i 1 (concatD [prt 0 pident , doc (showString "@") , prt 2 patt]) - PNeg patt -> prPrec i 1 (concatD [doc (showString "-") , prt 2 patt]) - - prtList es = case es of - [x] -> (concatD [prt 2 x]) - x:xs -> (concatD [prt 2 x , prt 0 xs]) - -instance Print PattAss where - prt i e = case e of - PA pidents patt -> prPrec i 0 (concatD [prt 0 pidents , doc (showString "=") , prt 0 patt]) - - prtList es = case es of - [] -> (concatD []) - [x] -> (concatD [prt 0 x]) - x:xs -> (concatD [prt 0 x , doc (showString ";") , prt 0 xs]) - -instance Print Label where - prt i e = case e of - LIdent pident -> prPrec i 0 (concatD [prt 0 pident]) - LVar n -> prPrec i 0 (concatD [doc (showString "$") , prt 0 n]) - - -instance Print Sort where - prt i e = case e of - Sort_Type -> prPrec i 0 (concatD [doc (showString "Type")]) - Sort_PType -> prPrec i 0 (concatD [doc (showString "PType")]) - Sort_Tok -> prPrec i 0 (concatD [doc (showString "Tok")]) - Sort_Str -> prPrec i 0 (concatD [doc (showString "Str")]) - Sort_Strs -> prPrec i 0 (concatD [doc (showString "Strs")]) - - -instance Print Bind where - prt i e = case e of - BIdent pident -> prPrec i 0 (concatD [prt 0 pident]) - BWild -> prPrec i 0 (concatD [doc (showString "_")]) - - prtList es = case es of - [] -> (concatD []) - [x] -> (concatD [prt 0 x]) - x:xs -> (concatD [prt 0 x , doc (showString ",") , prt 0 xs]) - -instance Print Decl where - prt i e = case e of - DDec binds exp -> prPrec i 0 (concatD [doc (showString "(") , prt 0 binds , doc (showString ":") , prt 0 exp , doc (showString ")")]) - DExp exp -> prPrec i 0 (concatD [prt 4 exp]) - - -instance Print TupleComp where - prt i e = case e of - TComp exp -> prPrec i 0 (concatD [prt 0 exp]) - - prtList es = case es of - [] -> (concatD []) - [x] -> (concatD [prt 0 x]) - x:xs -> (concatD [prt 0 x , doc (showString ",") , prt 0 xs]) - -instance Print PattTupleComp where - prt i e = case e of - PTComp patt -> prPrec i 0 (concatD [prt 0 patt]) - - prtList es = case es of - [] -> (concatD []) - [x] -> (concatD [prt 0 x]) - x:xs -> (concatD [prt 0 x , doc (showString ",") , prt 0 xs]) - -instance Print Case where - prt i e = case e of - Case patt exp -> prPrec i 0 (concatD [prt 0 patt , doc (showString "=>") , prt 0 exp]) - - prtList es = case es of - [x] -> (concatD [prt 0 x]) - x:xs -> (concatD [prt 0 x , doc (showString ";") , prt 0 xs]) - -instance Print Equation where - prt i e = case e of - Equ patts exp -> prPrec i 0 (concatD [prt 0 patts , doc (showString "->") , prt 0 exp]) - - prtList es = case es of - [] -> (concatD []) - [x] -> (concatD [prt 0 x]) - x:xs -> (concatD [prt 0 x , doc (showString ";") , prt 0 xs]) - -instance Print Altern where - prt i e = case e of - Alt exp0 exp -> prPrec i 0 (concatD [prt 0 exp0 , doc (showString "/") , prt 0 exp]) - - prtList es = case es of - [] -> (concatD []) - [x] -> (concatD [prt 0 x]) - x:xs -> (concatD [prt 0 x , doc (showString ";") , prt 0 xs]) - -instance Print DDecl where - prt i e = case e of - DDDec binds exp -> prPrec i 0 (concatD [doc (showString "(") , prt 0 binds , doc (showString ":") , prt 0 exp , doc (showString ")")]) - DDExp exp -> prPrec i 0 (concatD [prt 6 exp]) - - prtList es = case es of - [] -> (concatD []) - x:xs -> (concatD [prt 0 x , prt 0 xs]) - -instance Print OldGrammar where - prt i e = case e of - OldGr include topdefs -> prPrec i 0 (concatD [prt 0 include , prt 0 topdefs]) - - -instance Print Include where - prt i e = case e of - NoIncl -> prPrec i 0 (concatD []) - Incl filenames -> prPrec i 0 (concatD [doc (showString "include") , prt 0 filenames]) - - -instance Print FileName where - prt i e = case e of - FString str -> prPrec i 0 (concatD [prt 0 str]) - FIdent pident -> prPrec i 0 (concatD [prt 0 pident]) - FSlash filename -> prPrec i 0 (concatD [doc (showString "/") , prt 0 filename]) - FDot filename -> prPrec i 0 (concatD [doc (showString ".") , prt 0 filename]) - FMinus filename -> prPrec i 0 (concatD [doc (showString "-") , prt 0 filename]) - FAddId pident filename -> prPrec i 0 (concatD [prt 0 pident , prt 0 filename]) - - prtList es = case es of - [x] -> (concatD [prt 0 x , doc (showString ";")]) - x:xs -> (concatD [prt 0 x , doc (showString ";") , prt 0 xs]) - - +{-# OPTIONS -fno-warn-incomplete-patterns #-} +module GF.Source.PrintGF where + +-- pretty-printer generated by the BNF converter + +import GF.Source.AbsGF +import Data.Char +import qualified Data.ByteString.Char8 as BS + +-- the top-level printing method +printTree :: Print a => a -> String +printTree = render . prt 0 + +type Doc = [ShowS] -> [ShowS] + +doc :: ShowS -> Doc +doc = (:) + +render :: Doc -> String +render d = rend 0 (map ($ "") $ d []) "" where + rend i ss = case ss of + "[" :ts -> showChar '[' . rend i ts + "(" :ts -> showChar '(' . rend i ts + "{" :ts -> showChar '{' . new (i+1) . rend (i+1) ts + "}" : ";":ts -> new (i-1) . space "}" . showChar ';' . new (i-1) . rend (i-1) ts + "}" :ts -> new (i-1) . showChar '}' . new (i-1) . rend (i-1) ts + ";" :ts -> showChar ';' . new i . rend i ts + t : "," :ts -> showString t . space "," . rend i ts + t : ")" :ts -> showString t . showChar ')' . rend i ts + t : "]" :ts -> showString t . showChar ']' . rend i ts + t :ts -> space t . rend i ts + _ -> id + new i = showChar '\n' . replicateS (2*i) (showChar ' ') . dropWhile isSpace + space t = showString t . (\s -> if null s then "" else (' ':s)) + +parenth :: Doc -> Doc +parenth ss = doc (showChar '(') . ss . doc (showChar ')') + +concatS :: [ShowS] -> ShowS +concatS = foldr (.) id + +concatD :: [Doc] -> Doc +concatD = foldr (.) id + +replicateS :: Int -> ShowS -> ShowS +replicateS n f = concatS (replicate n f) + +-- the printer class does the job +class Print a where + prt :: Int -> a -> Doc + prtList :: [a] -> Doc + prtList = concatD . map (prt 0) + +instance Print a => Print [a] where + prt _ = prtList + +instance Print Char where + prt _ s = doc (showChar '\'' . mkEsc '\'' s . showChar '\'') + prtList s = doc (showChar '"' . concatS (map (mkEsc '"') s) . showChar '"') + +mkEsc :: Char -> Char -> ShowS +mkEsc q s = case s of + _ | s == q -> showChar '\\' . showChar s + '\\'-> showString "\\\\" + '\n' -> showString "\\n" + '\t' -> showString "\\t" + _ -> showChar s + +prPrec :: Int -> Int -> Doc -> Doc +prPrec i j = if j (concatD [prt 0 x]) + x:xs -> (concatD [prt 0 x , doc (showString ",") , prt 0 xs]) + + + +instance Print Grammar where + prt i e = case e of + Gr moddefs -> prPrec i 0 (concatD [prt 0 moddefs]) + + +instance Print ModDef where + prt i e = case e of + MMain pident0 pident concspecs -> prPrec i 0 (concatD [doc (showString "grammar") , prt 0 pident0 , doc (showString "=") , doc (showString "{") , doc (showString "abstract") , doc (showString "=") , prt 0 pident , doc (showString ";") , prt 0 concspecs , doc (showString "}")]) + MModule complmod modtype modbody -> prPrec i 0 (concatD [prt 0 complmod , prt 0 modtype , doc (showString "=") , prt 0 modbody]) + + prtList es = case es of + [] -> (concatD []) + x:xs -> (concatD [prt 0 x , prt 0 xs]) + +instance Print ConcSpec where + prt i e = case e of + ConcSpec pident concexp -> prPrec i 0 (concatD [prt 0 pident , doc (showString "=") , prt 0 concexp]) + + prtList es = case es of + [] -> (concatD []) + [x] -> (concatD [prt 0 x]) + x:xs -> (concatD [prt 0 x , doc (showString ";") , prt 0 xs]) + +instance Print ConcExp where + prt i e = case e of + ConcExp pident transfers -> prPrec i 0 (concatD [prt 0 pident , prt 0 transfers]) + + +instance Print Transfer where + prt i e = case e of + TransferIn open -> prPrec i 0 (concatD [doc (showString "(") , doc (showString "transfer") , doc (showString "in") , prt 0 open , doc (showString ")")]) + TransferOut open -> prPrec i 0 (concatD [doc (showString "(") , doc (showString "transfer") , doc (showString "out") , prt 0 open , doc (showString ")")]) + + prtList es = case es of + [] -> (concatD []) + x:xs -> (concatD [prt 0 x , prt 0 xs]) + + +instance Print ModType where + prt i e = case e of + MTAbstract pident -> prPrec i 0 (concatD [doc (showString "abstract") , prt 0 pident]) + MTResource pident -> prPrec i 0 (concatD [doc (showString "resource") , prt 0 pident]) + MTInterface pident -> prPrec i 0 (concatD [doc (showString "interface") , prt 0 pident]) + MTConcrete pident0 pident -> prPrec i 0 (concatD [doc (showString "concrete") , prt 0 pident0 , doc (showString "of") , prt 0 pident]) + MTInstance pident0 pident -> prPrec i 0 (concatD [doc (showString "instance") , prt 0 pident0 , doc (showString "of") , prt 0 pident]) + MTTransfer pident open0 open -> prPrec i 0 (concatD [doc (showString "transfer") , prt 0 pident , doc (showString ":") , prt 0 open0 , doc (showString "->") , prt 0 open]) + + +instance Print ModBody where + prt i e = case e of + MBody extend opens topdefs -> prPrec i 0 (concatD [prt 0 extend , prt 0 opens , doc (showString "{") , prt 0 topdefs , doc (showString "}")]) + MNoBody includeds -> prPrec i 0 (concatD [prt 0 includeds]) + MWith included opens -> prPrec i 0 (concatD [prt 0 included , doc (showString "with") , prt 0 opens]) + MWithBody included opens0 opens topdefs -> prPrec i 0 (concatD [prt 0 included , doc (showString "with") , prt 0 opens0 , doc (showString "**") , prt 0 opens , doc (showString "{") , prt 0 topdefs , doc (showString "}")]) + MWithE includeds included opens -> prPrec i 0 (concatD [prt 0 includeds , doc (showString "**") , prt 0 included , doc (showString "with") , prt 0 opens]) + MWithEBody includeds included opens0 opens topdefs -> prPrec i 0 (concatD [prt 0 includeds , doc (showString "**") , prt 0 included , doc (showString "with") , prt 0 opens0 , doc (showString "**") , prt 0 opens , doc (showString "{") , prt 0 topdefs , doc (showString "}")]) + MReuse pident -> prPrec i 0 (concatD [doc (showString "reuse") , prt 0 pident]) + MUnion includeds -> prPrec i 0 (concatD [doc (showString "union") , prt 0 includeds]) + + +instance Print Extend where + prt i e = case e of + Ext includeds -> prPrec i 0 (concatD [prt 0 includeds , doc (showString "**")]) + NoExt -> prPrec i 0 (concatD []) + + +instance Print Opens where + prt i e = case e of + NoOpens -> prPrec i 0 (concatD []) + OpenIn opens -> prPrec i 0 (concatD [doc (showString "open") , prt 0 opens , doc (showString "in")]) + + +instance Print Open where + prt i e = case e of + OName pident -> prPrec i 0 (concatD [prt 0 pident]) + OQualQO qualopen pident -> prPrec i 0 (concatD [doc (showString "(") , prt 0 qualopen , prt 0 pident , doc (showString ")")]) + OQual qualopen pident0 pident -> prPrec i 0 (concatD [doc (showString "(") , prt 0 qualopen , prt 0 pident0 , doc (showString "=") , prt 0 pident , doc (showString ")")]) + + prtList es = case es of + [] -> (concatD []) + [x] -> (concatD [prt 0 x]) + x:xs -> (concatD [prt 0 x , doc (showString ",") , prt 0 xs]) + +instance Print ComplMod where + prt i e = case e of + CMCompl -> prPrec i 0 (concatD []) + CMIncompl -> prPrec i 0 (concatD [doc (showString "incomplete")]) + + +instance Print QualOpen where + prt i e = case e of + QOCompl -> prPrec i 0 (concatD []) + QOIncompl -> prPrec i 0 (concatD [doc (showString "incomplete")]) + QOInterface -> prPrec i 0 (concatD [doc (showString "interface")]) + + +instance Print Included where + prt i e = case e of + IAll pident -> prPrec i 0 (concatD [prt 0 pident]) + ISome pident pidents -> prPrec i 0 (concatD [prt 0 pident , doc (showString "[") , prt 0 pidents , doc (showString "]")]) + IMinus pident pidents -> prPrec i 0 (concatD [prt 0 pident , doc (showString "-") , doc (showString "[") , prt 0 pidents , doc (showString "]")]) + + prtList es = case es of + [] -> (concatD []) + [x] -> (concatD [prt 0 x]) + x:xs -> (concatD [prt 0 x , doc (showString ",") , prt 0 xs]) + +instance Print Def where + prt i e = case e of + DDecl names exp -> prPrec i 0 (concatD [prt 0 names , doc (showString ":") , prt 0 exp]) + DDef names exp -> prPrec i 0 (concatD [prt 0 names , doc (showString "=") , prt 0 exp]) + DPatt name patts exp -> prPrec i 0 (concatD [prt 0 name , prt 0 patts , doc (showString "=") , prt 0 exp]) + DFull names exp0 exp -> prPrec i 0 (concatD [prt 0 names , doc (showString ":") , prt 0 exp0 , doc (showString "=") , prt 0 exp]) + + prtList es = case es of + [x] -> (concatD [prt 0 x , doc (showString ";")]) + x:xs -> (concatD [prt 0 x , doc (showString ";") , prt 0 xs]) + +instance Print TopDef where + prt i e = case e of + DefCat catdefs -> prPrec i 0 (concatD [doc (showString "cat") , prt 0 catdefs]) + DefFun fundefs -> prPrec i 0 (concatD [doc (showString "fun") , prt 0 fundefs]) + DefFunData fundefs -> prPrec i 0 (concatD [doc (showString "data") , prt 0 fundefs]) + DefDef defs -> prPrec i 0 (concatD [doc (showString "def") , prt 0 defs]) + DefData datadefs -> prPrec i 0 (concatD [doc (showString "data") , prt 0 datadefs]) + DefTrans defs -> prPrec i 0 (concatD [doc (showString "transfer") , prt 0 defs]) + DefPar pardefs -> prPrec i 0 (concatD [doc (showString "param") , prt 0 pardefs]) + DefOper defs -> prPrec i 0 (concatD [doc (showString "oper") , prt 0 defs]) + DefLincat printdefs -> prPrec i 0 (concatD [doc (showString "lincat") , prt 0 printdefs]) + DefLindef defs -> prPrec i 0 (concatD [doc (showString "lindef") , prt 0 defs]) + DefLin defs -> prPrec i 0 (concatD [doc (showString "lin") , prt 0 defs]) + DefPrintCat printdefs -> prPrec i 0 (concatD [doc (showString "printname") , doc (showString "cat") , prt 0 printdefs]) + DefPrintFun printdefs -> prPrec i 0 (concatD [doc (showString "printname") , doc (showString "fun") , prt 0 printdefs]) + DefFlag flagdefs -> prPrec i 0 (concatD [doc (showString "flags") , prt 0 flagdefs]) + DefPrintOld printdefs -> prPrec i 0 (concatD [doc (showString "printname") , prt 0 printdefs]) + DefLintype defs -> prPrec i 0 (concatD [doc (showString "lintype") , prt 0 defs]) + DefPattern defs -> prPrec i 0 (concatD [doc (showString "pattern") , prt 0 defs]) + DefPackage pident topdefs -> prPrec i 0 (concatD [doc (showString "package") , prt 0 pident , doc (showString "=") , doc (showString "{") , prt 0 topdefs , doc (showString "}") , doc (showString ";")]) + DefVars defs -> prPrec i 0 (concatD [doc (showString "var") , prt 0 defs]) + DefTokenizer pident -> prPrec i 0 (concatD [doc (showString "tokenizer") , prt 0 pident , doc (showString ";")]) + + prtList es = case es of + [] -> (concatD []) + x:xs -> (concatD [prt 0 x , prt 0 xs]) + +instance Print CatDef where + prt i e = case e of + SimpleCatDef pident ddecls -> prPrec i 0 (concatD [prt 0 pident , prt 0 ddecls]) + ListCatDef pident ddecls -> prPrec i 0 (concatD [doc (showString "[") , prt 0 pident , prt 0 ddecls , doc (showString "]")]) + ListSizeCatDef pident ddecls n -> prPrec i 0 (concatD [doc (showString "[") , prt 0 pident , prt 0 ddecls , doc (showString "]") , doc (showString "{") , prt 0 n , doc (showString "}")]) + + prtList es = case es of + [x] -> (concatD [prt 0 x , doc (showString ";")]) + x:xs -> (concatD [prt 0 x , doc (showString ";") , prt 0 xs]) + +instance Print FunDef where + prt i e = case e of + FunDef pidents exp -> prPrec i 0 (concatD [prt 0 pidents , doc (showString ":") , prt 0 exp]) + + prtList es = case es of + [x] -> (concatD [prt 0 x , doc (showString ";")]) + x:xs -> (concatD [prt 0 x , doc (showString ";") , prt 0 xs]) + +instance Print DataDef where + prt i e = case e of + DataDef pident dataconstrs -> prPrec i 0 (concatD [prt 0 pident , doc (showString "=") , prt 0 dataconstrs]) + + prtList es = case es of + [x] -> (concatD [prt 0 x , doc (showString ";")]) + x:xs -> (concatD [prt 0 x , doc (showString ";") , prt 0 xs]) + +instance Print DataConstr where + prt i e = case e of + DataId pident -> prPrec i 0 (concatD [prt 0 pident]) + DataQId pident0 pident -> prPrec i 0 (concatD [prt 0 pident0 , doc (showString ".") , prt 0 pident]) + + prtList es = case es of + [] -> (concatD []) + [x] -> (concatD [prt 0 x]) + x:xs -> (concatD [prt 0 x , doc (showString "|") , prt 0 xs]) + +instance Print ParDef where + prt i e = case e of + ParDefDir pident parconstrs -> prPrec i 0 (concatD [prt 0 pident , doc (showString "=") , prt 0 parconstrs]) + ParDefIndir pident0 pident -> prPrec i 0 (concatD [prt 0 pident0 , doc (showString "=") , doc (showString "(") , doc (showString "in") , prt 0 pident , doc (showString ")")]) + ParDefAbs pident -> prPrec i 0 (concatD [prt 0 pident]) + + prtList es = case es of + [x] -> (concatD [prt 0 x , doc (showString ";")]) + x:xs -> (concatD [prt 0 x , doc (showString ";") , prt 0 xs]) + +instance Print ParConstr where + prt i e = case e of + ParConstr pident ddecls -> prPrec i 0 (concatD [prt 0 pident , prt 0 ddecls]) + + prtList es = case es of + [] -> (concatD []) + [x] -> (concatD [prt 0 x]) + x:xs -> (concatD [prt 0 x , doc (showString "|") , prt 0 xs]) + +instance Print PrintDef where + prt i e = case e of + PrintDef names exp -> prPrec i 0 (concatD [prt 0 names , doc (showString "=") , prt 0 exp]) + + prtList es = case es of + [x] -> (concatD [prt 0 x , doc (showString ";")]) + x:xs -> (concatD [prt 0 x , doc (showString ";") , prt 0 xs]) + +instance Print FlagDef where + prt i e = case e of + FlagDef pident0 pident -> prPrec i 0 (concatD [prt 0 pident0 , doc (showString "=") , prt 0 pident]) + + prtList es = case es of + [x] -> (concatD [prt 0 x , doc (showString ";")]) + x:xs -> (concatD [prt 0 x , doc (showString ";") , prt 0 xs]) + +instance Print Name where + prt i e = case e of + IdentName pident -> prPrec i 0 (concatD [prt 0 pident]) + ListName pident -> prPrec i 0 (concatD [doc (showString "[") , prt 0 pident , doc (showString "]")]) + + prtList es = case es of + [x] -> (concatD [prt 0 x]) + x:xs -> (concatD [prt 0 x , doc (showString ",") , prt 0 xs]) + +instance Print LocDef where + prt i e = case e of + LDDecl pidents exp -> prPrec i 0 (concatD [prt 0 pidents , doc (showString ":") , prt 0 exp]) + LDDef pidents exp -> prPrec i 0 (concatD [prt 0 pidents , doc (showString "=") , prt 0 exp]) + LDFull pidents exp0 exp -> prPrec i 0 (concatD [prt 0 pidents , doc (showString ":") , prt 0 exp0 , doc (showString "=") , prt 0 exp]) + + prtList es = case es of + [] -> (concatD []) + [x] -> (concatD [prt 0 x]) + x:xs -> (concatD [prt 0 x , doc (showString ";") , prt 0 xs]) + +instance Print Exp where + prt i e = case e of + EIdent pident -> prPrec i 6 (concatD [prt 0 pident]) + EConstr pident -> prPrec i 6 (concatD [doc (showString "{") , prt 0 pident , doc (showString "}")]) + ECons pident -> prPrec i 6 (concatD [doc (showString "%") , prt 0 pident , doc (showString "%")]) + ESort sort -> prPrec i 6 (concatD [prt 0 sort]) + EString str -> prPrec i 6 (concatD [prt 0 str]) + EInt n -> prPrec i 6 (concatD [prt 0 n]) + EFloat d -> prPrec i 6 (concatD [prt 0 d]) + EMeta -> prPrec i 6 (concatD [doc (showString "?")]) + EEmpty -> prPrec i 6 (concatD [doc (showString "[") , doc (showString "]")]) + EData -> prPrec i 6 (concatD [doc (showString "data")]) + EList pident exps -> prPrec i 6 (concatD [doc (showString "[") , prt 0 pident , prt 0 exps , doc (showString "]")]) + EStrings str -> prPrec i 6 (concatD [doc (showString "[") , prt 0 str , doc (showString "]")]) + ERecord locdefs -> prPrec i 6 (concatD [doc (showString "{") , prt 0 locdefs , doc (showString "}")]) + ETuple tuplecomps -> prPrec i 6 (concatD [doc (showString "<") , prt 0 tuplecomps , doc (showString ">")]) + EIndir pident -> prPrec i 6 (concatD [doc (showString "(") , doc (showString "in") , prt 0 pident , doc (showString ")")]) + ETyped exp0 exp -> prPrec i 6 (concatD [doc (showString "<") , prt 0 exp0 , doc (showString ":") , prt 0 exp , doc (showString ">")]) + EProj exp label -> prPrec i 5 (concatD [prt 5 exp , doc (showString ".") , prt 0 label]) + EQConstr pident0 pident -> prPrec i 5 (concatD [doc (showString "{") , prt 0 pident0 , doc (showString ".") , prt 0 pident , doc (showString "}")]) + EQCons pident0 pident -> prPrec i 5 (concatD [doc (showString "%") , prt 0 pident0 , doc (showString ".") , prt 0 pident]) + EApp exp0 exp -> prPrec i 4 (concatD [prt 4 exp0 , prt 5 exp]) + ETable cases -> prPrec i 4 (concatD [doc (showString "table") , doc (showString "{") , prt 0 cases , doc (showString "}")]) + ETTable exp cases -> prPrec i 4 (concatD [doc (showString "table") , prt 6 exp , doc (showString "{") , prt 0 cases , doc (showString "}")]) + EVTable exp exps -> prPrec i 4 (concatD [doc (showString "table") , prt 6 exp , doc (showString "[") , prt 0 exps , doc (showString "]")]) + ECase exp cases -> prPrec i 4 (concatD [doc (showString "case") , prt 0 exp , doc (showString "of") , doc (showString "{") , prt 0 cases , doc (showString "}")]) + EVariants exps -> prPrec i 4 (concatD [doc (showString "variants") , doc (showString "{") , prt 0 exps , doc (showString "}")]) + EPre exp alterns -> prPrec i 4 (concatD [doc (showString "pre") , doc (showString "{") , prt 0 exp , doc (showString ";") , prt 0 alterns , doc (showString "}")]) + EStrs exps -> prPrec i 4 (concatD [doc (showString "strs") , doc (showString "{") , prt 0 exps , doc (showString "}")]) + EConAt pident exp -> prPrec i 4 (concatD [prt 0 pident , doc (showString "@") , prt 6 exp]) + EPatt patt -> prPrec i 4 (concatD [doc (showString "#") , prt 2 patt]) + EPattType exp -> prPrec i 4 (concatD [doc (showString "pattern") , prt 5 exp]) + ESelect exp0 exp -> prPrec i 3 (concatD [prt 3 exp0 , doc (showString "!") , prt 4 exp]) + ETupTyp exp0 exp -> prPrec i 3 (concatD [prt 3 exp0 , doc (showString "*") , prt 4 exp]) + EExtend exp0 exp -> prPrec i 3 (concatD [prt 3 exp0 , doc (showString "**") , prt 4 exp]) + EGlue exp0 exp -> prPrec i 1 (concatD [prt 2 exp0 , doc (showString "+") , prt 1 exp]) + EConcat exp0 exp -> prPrec i 0 (concatD [prt 1 exp0 , doc (showString "++") , prt 0 exp]) + EAbstr binds exp -> prPrec i 0 (concatD [doc (showString "\\") , prt 0 binds , doc (showString "->") , prt 0 exp]) + ECTable binds exp -> prPrec i 0 (concatD [doc (showString "\\") , doc (showString "\\") , prt 0 binds , doc (showString "=>") , prt 0 exp]) + EProd decl exp -> prPrec i 0 (concatD [prt 0 decl , doc (showString "->") , prt 0 exp]) + ETType exp0 exp -> prPrec i 0 (concatD [prt 3 exp0 , doc (showString "=>") , prt 0 exp]) + ELet locdefs exp -> prPrec i 0 (concatD [doc (showString "let") , doc (showString "{") , prt 0 locdefs , doc (showString "}") , doc (showString "in") , prt 0 exp]) + ELetb locdefs exp -> prPrec i 0 (concatD [doc (showString "let") , prt 0 locdefs , doc (showString "in") , prt 0 exp]) + EWhere exp locdefs -> prPrec i 0 (concatD [prt 3 exp , doc (showString "where") , doc (showString "{") , prt 0 locdefs , doc (showString "}")]) + EEqs equations -> prPrec i 0 (concatD [doc (showString "fn") , doc (showString "{") , prt 0 equations , doc (showString "}")]) + EExample exp str -> prPrec i 0 (concatD [doc (showString "in") , prt 5 exp , prt 0 str]) + ELString lstring -> prPrec i 6 (concatD [prt 0 lstring]) + ELin pident -> prPrec i 4 (concatD [doc (showString "Lin") , prt 0 pident]) + + prtList es = case es of + [] -> (concatD []) + [x] -> (concatD [prt 0 x]) + x:xs -> (concatD [prt 0 x , doc (showString ";") , prt 0 xs]) + +instance Print Exps where + prt i e = case e of + NilExp -> prPrec i 0 (concatD []) + ConsExp exp exps -> prPrec i 0 (concatD [prt 6 exp , prt 0 exps]) + + +instance Print Patt where + prt i e = case e of + PChar -> prPrec i 2 (concatD [doc (showString "?")]) + PChars str -> prPrec i 2 (concatD [doc (showString "[") , prt 0 str , doc (showString "]")]) + PMacro pident -> prPrec i 2 (concatD [doc (showString "#") , prt 0 pident]) + PM pident0 pident -> prPrec i 2 (concatD [doc (showString "#") , prt 0 pident0 , doc (showString ".") , prt 0 pident]) + PW -> prPrec i 2 (concatD [doc (showString "_")]) + PV pident -> prPrec i 2 (concatD [prt 0 pident]) + PCon pident -> prPrec i 2 (concatD [doc (showString "{") , prt 0 pident , doc (showString "}")]) + PQ pident0 pident -> prPrec i 2 (concatD [prt 0 pident0 , doc (showString ".") , prt 0 pident]) + PInt n -> prPrec i 2 (concatD [prt 0 n]) + PFloat d -> prPrec i 2 (concatD [prt 0 d]) + PStr str -> prPrec i 2 (concatD [prt 0 str]) + PR pattasss -> prPrec i 2 (concatD [doc (showString "{") , prt 0 pattasss , doc (showString "}")]) + PTup patttuplecomps -> prPrec i 2 (concatD [doc (showString "<") , prt 0 patttuplecomps , doc (showString ">")]) + PC pident patts -> prPrec i 1 (concatD [prt 0 pident , prt 0 patts]) + PQC pident0 pident patts -> prPrec i 1 (concatD [prt 0 pident0 , doc (showString ".") , prt 0 pident , prt 0 patts]) + PDisj patt0 patt -> prPrec i 0 (concatD [prt 0 patt0 , doc (showString "|") , prt 1 patt]) + PSeq patt0 patt -> prPrec i 0 (concatD [prt 0 patt0 , doc (showString "+") , prt 1 patt]) + PRep patt -> prPrec i 1 (concatD [prt 2 patt , doc (showString "*")]) + PAs pident patt -> prPrec i 1 (concatD [prt 0 pident , doc (showString "@") , prt 2 patt]) + PNeg patt -> prPrec i 1 (concatD [doc (showString "-") , prt 2 patt]) + + prtList es = case es of + [x] -> (concatD [prt 2 x]) + x:xs -> (concatD [prt 2 x , prt 0 xs]) + +instance Print PattAss where + prt i e = case e of + PA pidents patt -> prPrec i 0 (concatD [prt 0 pidents , doc (showString "=") , prt 0 patt]) + + prtList es = case es of + [] -> (concatD []) + [x] -> (concatD [prt 0 x]) + x:xs -> (concatD [prt 0 x , doc (showString ";") , prt 0 xs]) + +instance Print Label where + prt i e = case e of + LIdent pident -> prPrec i 0 (concatD [prt 0 pident]) + LVar n -> prPrec i 0 (concatD [doc (showString "$") , prt 0 n]) + + +instance Print Sort where + prt i e = case e of + Sort_Type -> prPrec i 0 (concatD [doc (showString "Type")]) + Sort_PType -> prPrec i 0 (concatD [doc (showString "PType")]) + Sort_Tok -> prPrec i 0 (concatD [doc (showString "Tok")]) + Sort_Str -> prPrec i 0 (concatD [doc (showString "Str")]) + Sort_Strs -> prPrec i 0 (concatD [doc (showString "Strs")]) + + +instance Print Bind where + prt i e = case e of + BIdent pident -> prPrec i 0 (concatD [prt 0 pident]) + BWild -> prPrec i 0 (concatD [doc (showString "_")]) + + prtList es = case es of + [] -> (concatD []) + [x] -> (concatD [prt 0 x]) + x:xs -> (concatD [prt 0 x , doc (showString ",") , prt 0 xs]) + +instance Print Decl where + prt i e = case e of + DDec binds exp -> prPrec i 0 (concatD [doc (showString "(") , prt 0 binds , doc (showString ":") , prt 0 exp , doc (showString ")")]) + DExp exp -> prPrec i 0 (concatD [prt 4 exp]) + + +instance Print TupleComp where + prt i e = case e of + TComp exp -> prPrec i 0 (concatD [prt 0 exp]) + + prtList es = case es of + [] -> (concatD []) + [x] -> (concatD [prt 0 x]) + x:xs -> (concatD [prt 0 x , doc (showString ",") , prt 0 xs]) + +instance Print PattTupleComp where + prt i e = case e of + PTComp patt -> prPrec i 0 (concatD [prt 0 patt]) + + prtList es = case es of + [] -> (concatD []) + [x] -> (concatD [prt 0 x]) + x:xs -> (concatD [prt 0 x , doc (showString ",") , prt 0 xs]) + +instance Print Case where + prt i e = case e of + Case patt exp -> prPrec i 0 (concatD [prt 0 patt , doc (showString "=>") , prt 0 exp]) + + prtList es = case es of + [x] -> (concatD [prt 0 x]) + x:xs -> (concatD [prt 0 x , doc (showString ";") , prt 0 xs]) + +instance Print Equation where + prt i e = case e of + Equ patts exp -> prPrec i 0 (concatD [prt 0 patts , doc (showString "->") , prt 0 exp]) + + prtList es = case es of + [] -> (concatD []) + [x] -> (concatD [prt 0 x]) + x:xs -> (concatD [prt 0 x , doc (showString ";") , prt 0 xs]) + +instance Print Altern where + prt i e = case e of + Alt exp0 exp -> prPrec i 0 (concatD [prt 0 exp0 , doc (showString "/") , prt 0 exp]) + + prtList es = case es of + [] -> (concatD []) + [x] -> (concatD [prt 0 x]) + x:xs -> (concatD [prt 0 x , doc (showString ";") , prt 0 xs]) + +instance Print DDecl where + prt i e = case e of + DDDec binds exp -> prPrec i 0 (concatD [doc (showString "(") , prt 0 binds , doc (showString ":") , prt 0 exp , doc (showString ")")]) + DDExp exp -> prPrec i 0 (concatD [prt 6 exp]) + + prtList es = case es of + [] -> (concatD []) + x:xs -> (concatD [prt 0 x , prt 0 xs]) + +instance Print OldGrammar where + prt i e = case e of + OldGr include topdefs -> prPrec i 0 (concatD [prt 0 include , prt 0 topdefs]) + + +instance Print Include where + prt i e = case e of + NoIncl -> prPrec i 0 (concatD []) + Incl filenames -> prPrec i 0 (concatD [doc (showString "include") , prt 0 filenames]) + + +instance Print FileName where + prt i e = case e of + FString str -> prPrec i 0 (concatD [prt 0 str]) + FIdent pident -> prPrec i 0 (concatD [prt 0 pident]) + FSlash filename -> prPrec i 0 (concatD [doc (showString "/") , prt 0 filename]) + FDot filename -> prPrec i 0 (concatD [doc (showString ".") , prt 0 filename]) + FMinus filename -> prPrec i 0 (concatD [doc (showString "-") , prt 0 filename]) + FAddId pident filename -> prPrec i 0 (concatD [prt 0 pident , prt 0 filename]) + + prtList es = case es of + [x] -> (concatD [prt 0 x , doc (showString ";")]) + x:xs -> (concatD [prt 0 x , doc (showString ";") , prt 0 xs]) + + diff --git a/src-3.0/GF/Source/SkelGF.hs b/src-3.0/GF/Source/SkelGF.hs index 3bd192f9d..cb1b84a4e 100644 --- a/src-3.0/GF/Source/SkelGF.hs +++ b/src-3.0/GF/Source/SkelGF.hs @@ -1,364 +1,381 @@ -module GF.Source.SkelGF where - --- Haskell module generated by the BNF converter - -import GF.Source.AbsGF -import GF.Source.ErrM -type Result = Err String - -failure :: Show a => a -> Result -failure x = Bad $ "Undefined case: " ++ show x - -transLString :: LString -> Result -transLString x = case x of - LString str -> failure x - - -transPIdent :: PIdent -> Result -transPIdent x = case x of - PIdent str -> failure x - - -transGrammar :: Grammar -> Result -transGrammar x = case x of - Gr moddefs -> failure x - - -transModDef :: ModDef -> Result -transModDef x = case x of - MMain pident0 pident concspecs -> failure x - MModule complmod modtype modbody -> failure x - - -transConcSpec :: ConcSpec -> Result -transConcSpec x = case x of - ConcSpec pident concexp -> failure x - - -transConcExp :: ConcExp -> Result -transConcExp x = case x of - ConcExp pident transfers -> failure x - - -transTransfer :: Transfer -> Result -transTransfer x = case x of - TransferIn open -> failure x - TransferOut open -> failure x - - -transModType :: ModType -> Result -transModType x = case x of - MTAbstract pident -> failure x - MTResource pident -> failure x - MTInterface pident -> failure x - MTConcrete pident0 pident -> failure x - MTInstance pident0 pident -> failure x - MTTransfer pident open0 open -> failure x - - -transModBody :: ModBody -> Result -transModBody x = case x of - MBody extend opens topdefs -> failure x - MNoBody includeds -> failure x - MWith included opens -> failure x - MWithBody included opens0 opens topdefs -> failure x - MWithE includeds included opens -> failure x - MWithEBody includeds included opens0 opens topdefs -> failure x - MReuse pident -> failure x - MUnion includeds -> failure x - - -transExtend :: Extend -> Result -transExtend x = case x of - Ext includeds -> failure x - NoExt -> failure x - - -transOpens :: Opens -> Result -transOpens x = case x of - NoOpens -> failure x - OpenIn opens -> failure x - - -transOpen :: Open -> Result -transOpen x = case x of - OName pident -> failure x - OQualQO qualopen pident -> failure x - OQual qualopen pident0 pident -> failure x - - -transComplMod :: ComplMod -> Result -transComplMod x = case x of - CMCompl -> failure x - CMIncompl -> failure x - - -transQualOpen :: QualOpen -> Result -transQualOpen x = case x of - QOCompl -> failure x - QOIncompl -> failure x - QOInterface -> failure x - - -transIncluded :: Included -> Result -transIncluded x = case x of - IAll pident -> failure x - ISome pident pidents -> failure x - IMinus pident pidents -> failure x - - -transDef :: Def -> Result -transDef x = case x of - DDecl names exp -> failure x - DDef names exp -> failure x - DPatt name patts exp -> failure x - DFull names exp0 exp -> failure x - - -transTopDef :: TopDef -> Result -transTopDef x = case x of - DefCat catdefs -> failure x - DefFun fundefs -> failure x - DefFunData fundefs -> failure x - DefDef defs -> failure x - DefData datadefs -> failure x - DefTrans defs -> failure x - DefPar pardefs -> failure x - DefOper defs -> failure x - DefLincat printdefs -> failure x - DefLindef defs -> failure x - DefLin defs -> failure x - DefPrintCat printdefs -> failure x - DefPrintFun printdefs -> failure x - DefFlag flagdefs -> failure x - DefPrintOld printdefs -> failure x - DefLintype defs -> failure x - DefPattern defs -> failure x - DefPackage pident topdefs -> failure x - DefVars defs -> failure x - DefTokenizer pident -> failure x - - -transCatDef :: CatDef -> Result -transCatDef x = case x of - SimpleCatDef pident ddecls -> failure x - ListCatDef pident ddecls -> failure x - ListSizeCatDef pident ddecls n -> failure x - - -transFunDef :: FunDef -> Result -transFunDef x = case x of - FunDef pidents exp -> failure x - - -transDataDef :: DataDef -> Result -transDataDef x = case x of - DataDef pident dataconstrs -> failure x - - -transDataConstr :: DataConstr -> Result -transDataConstr x = case x of - DataId pident -> failure x - DataQId pident0 pident -> failure x - - -transParDef :: ParDef -> Result -transParDef x = case x of - ParDefDir pident parconstrs -> failure x - ParDefIndir pident0 pident -> failure x - ParDefAbs pident -> failure x - - -transParConstr :: ParConstr -> Result -transParConstr x = case x of - ParConstr pident ddecls -> failure x - - -transPrintDef :: PrintDef -> Result -transPrintDef x = case x of - PrintDef names exp -> failure x - - -transFlagDef :: FlagDef -> Result -transFlagDef x = case x of - FlagDef pident0 pident -> failure x - - -transName :: Name -> Result -transName x = case x of - IdentName pident -> failure x - ListName pident -> failure x - - -transLocDef :: LocDef -> Result -transLocDef x = case x of - LDDecl pidents exp -> failure x - LDDef pidents exp -> failure x - LDFull pidents exp0 exp -> failure x - - -transExp :: Exp -> Result -transExp x = case x of - EIdent pident -> failure x - EConstr pident -> failure x - ECons pident -> failure x - ESort sort -> failure x - EString str -> failure x - EInt n -> failure x - EFloat d -> failure x - EMeta -> failure x - EEmpty -> failure x - EData -> failure x - EList pident exps -> failure x - EStrings str -> failure x - ERecord locdefs -> failure x - ETuple tuplecomps -> failure x - EIndir pident -> failure x - ETyped exp0 exp -> failure x - EProj exp label -> failure x - EQConstr pident0 pident -> failure x - EQCons pident0 pident -> failure x - EApp exp0 exp -> failure x - ETable cases -> failure x - ETTable exp cases -> failure x - EVTable exp exps -> failure x - ECase exp cases -> failure x - EVariants exps -> failure x - EPre exp alterns -> failure x - EStrs exps -> failure x - EConAt pident exp -> failure x - EPatt patt -> failure x - EPattType exp -> failure x - ESelect exp0 exp -> failure x - ETupTyp exp0 exp -> failure x - EExtend exp0 exp -> failure x - EGlue exp0 exp -> failure x - EConcat exp0 exp -> failure x - EAbstr binds exp -> failure x - ECTable binds exp -> failure x - EProd decl exp -> failure x - ETType exp0 exp -> failure x - ELet locdefs exp -> failure x - ELetb locdefs exp -> failure x - EWhere exp locdefs -> failure x - EEqs equations -> failure x - EExample exp str -> failure x - ELString lstring -> failure x - ELin pident -> failure x - - -transExps :: Exps -> Result -transExps x = case x of - NilExp -> failure x - ConsExp exp exps -> failure x - - -transPatt :: Patt -> Result -transPatt x = case x of - PChar -> failure x - PChars str -> failure x - PMacro pident -> failure x - PM pident0 pident -> failure x - PW -> failure x - PV pident -> failure x - PCon pident -> failure x - PQ pident0 pident -> failure x - PInt n -> failure x - PFloat d -> failure x - PStr str -> failure x - PR pattasss -> failure x - PTup patttuplecomps -> failure x - PC pident patts -> failure x - PQC pident0 pident patts -> failure x - PDisj patt0 patt -> failure x - PSeq patt0 patt -> failure x - PRep patt -> failure x - PAs pident patt -> failure x - PNeg patt -> failure x - - -transPattAss :: PattAss -> Result -transPattAss x = case x of - PA pidents patt -> failure x - - -transLabel :: Label -> Result -transLabel x = case x of - LIdent pident -> failure x - LVar n -> failure x - - -transSort :: Sort -> Result -transSort x = case x of - Sort_Type -> failure x - Sort_PType -> failure x - Sort_Tok -> failure x - Sort_Str -> failure x - Sort_Strs -> failure x - - -transBind :: Bind -> Result -transBind x = case x of - BIdent pident -> failure x - BWild -> failure x - - -transDecl :: Decl -> Result -transDecl x = case x of - DDec binds exp -> failure x - DExp exp -> failure x - - -transTupleComp :: TupleComp -> Result -transTupleComp x = case x of - TComp exp -> failure x - - -transPattTupleComp :: PattTupleComp -> Result -transPattTupleComp x = case x of - PTComp patt -> failure x - - -transCase :: Case -> Result -transCase x = case x of - Case patt exp -> failure x - - -transEquation :: Equation -> Result -transEquation x = case x of - Equ patts exp -> failure x - - -transAltern :: Altern -> Result -transAltern x = case x of - Alt exp0 exp -> failure x - - -transDDecl :: DDecl -> Result -transDDecl x = case x of - DDDec binds exp -> failure x - DDExp exp -> failure x - - -transOldGrammar :: OldGrammar -> Result -transOldGrammar x = case x of - OldGr include topdefs -> failure x - - -transInclude :: Include -> Result -transInclude x = case x of - NoIncl -> failure x - Incl filenames -> failure x - - -transFileName :: FileName -> Result -transFileName x = case x of - FString str -> failure x - FIdent pident -> failure x - FSlash filename -> failure x - FDot filename -> failure x - FMinus filename -> failure x - FAddId pident filename -> failure x - - - +module GF.Source.SkelGF where + +-- Haskell module generated by the BNF converter + +import GF.Source.AbsGF +import GF.Source.ErrM +type Result = Err String + +failure :: Show a => a -> Result +failure x = Bad $ "Undefined case: " ++ show x + +transLString :: LString -> Result +transLString x = case x of + LString str -> failure x + + +transPIdent :: PIdent -> Result +transPIdent x = case x of + PIdent str -> failure x + + +transGrammar :: Grammar -> Result +transGrammar x = case x of + Gr moddefs -> failure x + + +transModDef :: ModDef -> Result +transModDef x = case x of + MMain pident0 pident concspecs -> failure x + MModule complmod modtype modbody -> failure x + + +transConcSpec :: ConcSpec -> Result +transConcSpec x = case x of + ConcSpec pident concexp -> failure x + + +transConcExp :: ConcExp -> Result +transConcExp x = case x of + ConcExp pident transfers -> failure x + + +transTransfer :: Transfer -> Result +transTransfer x = case x of + TransferIn open -> failure x + TransferOut open -> failure x + + +transModHeader :: ModHeader -> Result +transModHeader x = case x of + MModule2 complmod modtype modheaderbody -> failure x + + +transModHeaderBody :: ModHeaderBody -> Result +transModHeaderBody x = case x of + MBody2 extend opens -> failure x + MNoBody2 includeds -> failure x + MWith2 included opens -> failure x + MWithBody2 included opens0 opens -> failure x + MWithE2 includeds included opens -> failure x + MWithEBody2 includeds included opens0 opens -> failure x + MReuse2 pident -> failure x + MUnion2 includeds -> failure x + + +transModType :: ModType -> Result +transModType x = case x of + MTAbstract pident -> failure x + MTResource pident -> failure x + MTInterface pident -> failure x + MTConcrete pident0 pident -> failure x + MTInstance pident0 pident -> failure x + MTTransfer pident open0 open -> failure x + + +transModBody :: ModBody -> Result +transModBody x = case x of + MBody extend opens topdefs -> failure x + MNoBody includeds -> failure x + MWith included opens -> failure x + MWithBody included opens0 opens topdefs -> failure x + MWithE includeds included opens -> failure x + MWithEBody includeds included opens0 opens topdefs -> failure x + MReuse pident -> failure x + MUnion includeds -> failure x + + +transExtend :: Extend -> Result +transExtend x = case x of + Ext includeds -> failure x + NoExt -> failure x + + +transOpens :: Opens -> Result +transOpens x = case x of + NoOpens -> failure x + OpenIn opens -> failure x + + +transOpen :: Open -> Result +transOpen x = case x of + OName pident -> failure x + OQualQO qualopen pident -> failure x + OQual qualopen pident0 pident -> failure x + + +transComplMod :: ComplMod -> Result +transComplMod x = case x of + CMCompl -> failure x + CMIncompl -> failure x + + +transQualOpen :: QualOpen -> Result +transQualOpen x = case x of + QOCompl -> failure x + QOIncompl -> failure x + QOInterface -> failure x + + +transIncluded :: Included -> Result +transIncluded x = case x of + IAll pident -> failure x + ISome pident pidents -> failure x + IMinus pident pidents -> failure x + + +transDef :: Def -> Result +transDef x = case x of + DDecl names exp -> failure x + DDef names exp -> failure x + DPatt name patts exp -> failure x + DFull names exp0 exp -> failure x + + +transTopDef :: TopDef -> Result +transTopDef x = case x of + DefCat catdefs -> failure x + DefFun fundefs -> failure x + DefFunData fundefs -> failure x + DefDef defs -> failure x + DefData datadefs -> failure x + DefTrans defs -> failure x + DefPar pardefs -> failure x + DefOper defs -> failure x + DefLincat printdefs -> failure x + DefLindef defs -> failure x + DefLin defs -> failure x + DefPrintCat printdefs -> failure x + DefPrintFun printdefs -> failure x + DefFlag flagdefs -> failure x + DefPrintOld printdefs -> failure x + DefLintype defs -> failure x + DefPattern defs -> failure x + DefPackage pident topdefs -> failure x + DefVars defs -> failure x + DefTokenizer pident -> failure x + + +transCatDef :: CatDef -> Result +transCatDef x = case x of + SimpleCatDef pident ddecls -> failure x + ListCatDef pident ddecls -> failure x + ListSizeCatDef pident ddecls n -> failure x + + +transFunDef :: FunDef -> Result +transFunDef x = case x of + FunDef pidents exp -> failure x + + +transDataDef :: DataDef -> Result +transDataDef x = case x of + DataDef pident dataconstrs -> failure x + + +transDataConstr :: DataConstr -> Result +transDataConstr x = case x of + DataId pident -> failure x + DataQId pident0 pident -> failure x + + +transParDef :: ParDef -> Result +transParDef x = case x of + ParDefDir pident parconstrs -> failure x + ParDefIndir pident0 pident -> failure x + ParDefAbs pident -> failure x + + +transParConstr :: ParConstr -> Result +transParConstr x = case x of + ParConstr pident ddecls -> failure x + + +transPrintDef :: PrintDef -> Result +transPrintDef x = case x of + PrintDef names exp -> failure x + + +transFlagDef :: FlagDef -> Result +transFlagDef x = case x of + FlagDef pident0 pident -> failure x + + +transName :: Name -> Result +transName x = case x of + IdentName pident -> failure x + ListName pident -> failure x + + +transLocDef :: LocDef -> Result +transLocDef x = case x of + LDDecl pidents exp -> failure x + LDDef pidents exp -> failure x + LDFull pidents exp0 exp -> failure x + + +transExp :: Exp -> Result +transExp x = case x of + EIdent pident -> failure x + EConstr pident -> failure x + ECons pident -> failure x + ESort sort -> failure x + EString str -> failure x + EInt n -> failure x + EFloat d -> failure x + EMeta -> failure x + EEmpty -> failure x + EData -> failure x + EList pident exps -> failure x + EStrings str -> failure x + ERecord locdefs -> failure x + ETuple tuplecomps -> failure x + EIndir pident -> failure x + ETyped exp0 exp -> failure x + EProj exp label -> failure x + EQConstr pident0 pident -> failure x + EQCons pident0 pident -> failure x + EApp exp0 exp -> failure x + ETable cases -> failure x + ETTable exp cases -> failure x + EVTable exp exps -> failure x + ECase exp cases -> failure x + EVariants exps -> failure x + EPre exp alterns -> failure x + EStrs exps -> failure x + EConAt pident exp -> failure x + EPatt patt -> failure x + EPattType exp -> failure x + ESelect exp0 exp -> failure x + ETupTyp exp0 exp -> failure x + EExtend exp0 exp -> failure x + EGlue exp0 exp -> failure x + EConcat exp0 exp -> failure x + EAbstr binds exp -> failure x + ECTable binds exp -> failure x + EProd decl exp -> failure x + ETType exp0 exp -> failure x + ELet locdefs exp -> failure x + ELetb locdefs exp -> failure x + EWhere exp locdefs -> failure x + EEqs equations -> failure x + EExample exp str -> failure x + ELString lstring -> failure x + ELin pident -> failure x + + +transExps :: Exps -> Result +transExps x = case x of + NilExp -> failure x + ConsExp exp exps -> failure x + + +transPatt :: Patt -> Result +transPatt x = case x of + PChar -> failure x + PChars str -> failure x + PMacro pident -> failure x + PM pident0 pident -> failure x + PW -> failure x + PV pident -> failure x + PCon pident -> failure x + PQ pident0 pident -> failure x + PInt n -> failure x + PFloat d -> failure x + PStr str -> failure x + PR pattasss -> failure x + PTup patttuplecomps -> failure x + PC pident patts -> failure x + PQC pident0 pident patts -> failure x + PDisj patt0 patt -> failure x + PSeq patt0 patt -> failure x + PRep patt -> failure x + PAs pident patt -> failure x + PNeg patt -> failure x + + +transPattAss :: PattAss -> Result +transPattAss x = case x of + PA pidents patt -> failure x + + +transLabel :: Label -> Result +transLabel x = case x of + LIdent pident -> failure x + LVar n -> failure x + + +transSort :: Sort -> Result +transSort x = case x of + Sort_Type -> failure x + Sort_PType -> failure x + Sort_Tok -> failure x + Sort_Str -> failure x + Sort_Strs -> failure x + + +transBind :: Bind -> Result +transBind x = case x of + BIdent pident -> failure x + BWild -> failure x + + +transDecl :: Decl -> Result +transDecl x = case x of + DDec binds exp -> failure x + DExp exp -> failure x + + +transTupleComp :: TupleComp -> Result +transTupleComp x = case x of + TComp exp -> failure x + + +transPattTupleComp :: PattTupleComp -> Result +transPattTupleComp x = case x of + PTComp patt -> failure x + + +transCase :: Case -> Result +transCase x = case x of + Case patt exp -> failure x + + +transEquation :: Equation -> Result +transEquation x = case x of + Equ patts exp -> failure x + + +transAltern :: Altern -> Result +transAltern x = case x of + Alt exp0 exp -> failure x + + +transDDecl :: DDecl -> Result +transDDecl x = case x of + DDDec binds exp -> failure x + DDExp exp -> failure x + + +transOldGrammar :: OldGrammar -> Result +transOldGrammar x = case x of + OldGr include topdefs -> failure x + + +transInclude :: Include -> Result +transInclude x = case x of + NoIncl -> failure x + Incl filenames -> failure x + + +transFileName :: FileName -> Result +transFileName x = case x of + FString str -> failure x + FIdent pident -> failure x + FSlash filename -> failure x + FDot filename -> failure x + FMinus filename -> failure x + FAddId pident filename -> failure x + + + diff --git a/src-3.0/GF/Source/SourceToGrammar.hs b/src-3.0/GF/Source/SourceToGrammar.hs index 132bd4704..f27c096c6 100644 --- a/src-3.0/GF/Source/SourceToGrammar.hs +++ b/src-3.0/GF/Source/SourceToGrammar.hs @@ -27,6 +27,7 @@ import qualified GF.Grammar.Macros as M import qualified GF.Compile.Update as U import qualified GF.Infra.Option as GO import qualified GF.Compile.ModDeps as GD +import GF.Grammar.Predef import GF.Infra.Ident import GF.Source.AbsGF import GF.Source.PrintGF @@ -37,6 +38,7 @@ import GF.Infra.Option import Control.Monad import Data.Char import Data.List (genericReplicate) +import qualified Data.ByteString.Char8 as BS -- based on the skeleton Haskell module generated by the BNF converter @@ -45,9 +47,6 @@ type Result = Err String failure :: Show a => a -> Err b failure x = Bad $ "Undefined case: " ++ show x -prPIdent :: PIdent -> String -prPIdent (PIdent (_,c)) = c - getIdentPos :: PIdent -> Err (Ident,Int) getIdentPos x = case x of PIdent ((line,_),c) -> return (IC c,line) @@ -225,7 +224,7 @@ transAbsDef x = case x of DefFunData fundefs -> do fundefs' <- mapM transFunDef fundefs returnl $ - [(cat, G.AbsCat nope (yes [M.cn fun])) | (funs,typ) <- fundefs', + [(cat, G.AbsCat nope (yes [G.Cn fun])) | (funs,typ) <- fundefs', fun <- funs, Ok (_,cat) <- [M.valCat typ] ] ++ @@ -257,6 +256,9 @@ returnl = return . Left transFlagDef :: FlagDef -> Err GO.Option transFlagDef x = case x of FlagDef f x -> return $ GO.Opt (prPIdent f,[prPIdent x]) + where + prPIdent (PIdent (_,c)) = BS.unpack c + -- | Cat definitions can also return some fun defs -- if it is a list category definition @@ -280,7 +282,7 @@ transCatDef x = case x of consId = mkConsId id' catd0@(c,G.AbsCat (Yes cont0) _) <- cat li ddecls let - catd = (c,G.AbsCat (Yes cont0) (Yes [M.cn baseId,M.cn consId])) + catd = (c,G.AbsCat (Yes cont0) (Yes [G.Cn baseId,G.Cn consId])) cont = [(mkId x i,ty) | (i,(x,ty)) <- zip [0..] cont0] xs = map (G.Vr . fst) cont cd = M.mkDecl (M.mkApp (G.Vr id') xs) @@ -290,7 +292,7 @@ transCatDef x = case x of constyp = M.mkProdSimple (cont ++ [cd, M.mkDecl lc]) lc consfund = (consId, G.AbsFun (yes constyp) (yes G.EData)) return [catd,nilfund,consfund] - mkId x i = if isWildIdent x then (mkIdent "x" i) else x + mkId x i = if isWildIdent x then (varX i) else x transFunDef :: FunDef -> Err ([Ident], G.Type) transFunDef x = case x of @@ -434,10 +436,10 @@ transExp x = case x of EQConstr m c -> liftM2 G.QC (transIdent m) (transIdent c) EQCons m c -> liftM2 G.Q (transIdent m) (transIdent c) EString str -> return $ G.K str - ESort sort -> liftM G.Sort $ transSort sort + ESort sort -> return $ G.Sort $ transSort sort EInt n -> return $ G.EInt n EFloat n -> return $ G.EFloat n - EMeta -> return $ M.meta $ M.int2meta 0 + EMeta -> return $ G.Meta $ M.int2meta 0 EEmpty -> return G.Empty -- [ C x_1 ... x_n ] becomes (ListC x_1 ... x_n) EList i es -> do @@ -499,7 +501,7 @@ transExp x = case x of EPattType typ -> liftM G.EPattType (transExp typ) EPatt patt -> liftM G.EPatt (transPatt patt) - ELString (LString str) -> return $ G.K str + ELString (LString str) -> return $ G.K (BS.unpack str) -- use the grammar encoding here ELin id -> liftM G.LiT $ transIdent id EEqs eqs -> liftM G.Eqs $ mapM transEquation eqs @@ -527,10 +529,10 @@ erecord2term ds = do (lab,(Just ty,Nothing)) -> mapM tryRT fs >>= return . Left _ -> mapM tryR fs >>= return . Right tryRT f = case f of - (lab,(Just ty,Nothing)) -> return (M.ident2label lab,ty) + (lab,(Just ty,Nothing)) -> return (G.ident2label lab,ty) _ -> Bad $ "illegal record type field" +++ GP.prt (fst f) --- manifest fields ?! tryR f = case f of - (lab,(mty, Just t)) -> return (M.ident2label lab,(mty,t)) + (lab,(mty, Just t)) -> return (G.ident2label lab,(mty,t)) _ -> Bad $ "illegal record field" +++ GP.prt (fst f) @@ -552,16 +554,16 @@ locdef2fields d = case d of trLabel :: Label -> Err G.Label trLabel x = case x of - - -- this case is for bward compatibility and should be removed - LIdent (PIdent (_,'v':ds@(_:_))) | all isDigit ds -> return $ G.LVar $ readIntArg ds - LIdent (PIdent (_, s)) -> return $ G.LIdent s - LVar x -> return $ G.LVar $ fromInteger x + LVar x -> return $ G.LVar $ fromInteger x + +transSort :: Sort -> Ident +transSort Sort_Type = cType +transSort Sort_PType = cPType +transSort Sort_Tok = cTok +transSort Sort_Str = cStr +transSort Sort_Strs = cStrs -transSort :: Sort -> Err String -transSort x = case x of - _ -> return $ printTree x {- --- no more used 7/1/2006 AR @@ -703,7 +705,7 @@ transOldGrammar opts name0 x = case x of resName = identPI $ maybe ("Res" ++ lang) id $ getOptVal opts useResName cncName = identPI $ maybe lang id $ getOptVal opts useCncName - identPI s = PIdent ((0,0),s) + identPI s = PIdent ((0,0),BS.pack s) (beg,rest) = span (/='.') name (topic,lang) = case rest of -- to avoid overwriting old files @@ -725,8 +727,8 @@ transInclude x = case x of FDot filename -> '.' : trans filename FMinus filename -> '-' : trans filename FAddId (PIdent (_, s)) filename -> modif s ++ trans filename - modif s = let s' = init s ++ [toLower (last s)] in - if elem s' newReservedWords then s' else s + modif s = let s' = BS.snoc (BS.init s) (toLower (BS.last s)) in + BS.unpack (if elem (BS.unpack s') newReservedWords then s' else s) --- unsafe hack ; cf. GetGrammar.oldLexer @@ -740,16 +742,16 @@ termInPattern t = M.mkAbs xx $ G.R [(s, (Nothing, toP body))] where toP t = case t of G.Vr x -> G.P t s _ -> M.composSafeOp toP t - s = G.LIdent "s" + s = G.LIdent (BS.pack "s") (xx,body) = abss [] t abss xs t = case t of G.Abs x b -> abss (x:xs) b _ -> (reverse xs,t) mkListId,mkConsId,mkBaseId :: Ident -> Ident -mkListId = prefixId "List" -mkConsId = prefixId "Cons" -mkBaseId = prefixId "Base" +mkListId = prefixId (BS.pack "List") +mkConsId = prefixId (BS.pack "Cons") +mkBaseId = prefixId (BS.pack "Base") -prefixId :: String -> Ident -> Ident -prefixId pref id = IC (pref ++ prIdent id) +prefixId :: BS.ByteString -> Ident -> Ident +prefixId pref id = identC (BS.append pref (ident2bs id)) diff --git a/src-3.0/GF/Source/TestGF.hs b/src-3.0/GF/Source/TestGF.hs index e4c072467..1c5da52ab 100644 --- a/src-3.0/GF/Source/TestGF.hs +++ b/src-3.0/GF/Source/TestGF.hs @@ -1,58 +1,58 @@ --- automatically generated by BNF Converter -module Main where - - -import IO ( stdin, hGetContents ) -import System ( getArgs, getProgName ) - -import GF.Source.LexGF -import GF.Source.ParGF -import GF.Source.SkelGF -import GF.Source.PrintGF -import GF.Source.AbsGF - - - - -import GF.Source.ErrM - -type ParseFun a = [Token] -> Err a - -myLLexer = myLexer - -type Verbosity = Int - -putStrV :: Verbosity -> String -> IO () -putStrV v s = if v > 1 then putStrLn s else return () - -runFile :: (Print a, Show a) => Verbosity -> ParseFun a -> FilePath -> IO () -runFile v p f = putStrLn f >> readFile f >>= run v p - -run :: (Print a, Show a) => Verbosity -> ParseFun a -> String -> IO () -run v p s = let ts = myLLexer s in case p ts of - Bad s -> do putStrLn "\nParse Failed...\n" - putStrV v "Tokens:" - putStrV v $ show ts - putStrLn s - Ok tree -> do putStrLn "\nParse Successful!" - showTree v tree - - - -showTree :: (Show a, Print a) => Int -> a -> IO () -showTree v tree - = do - putStrV v $ "\n[Abstract Syntax]\n\n" ++ show tree - putStrV v $ "\n[Linearized tree]\n\n" ++ printTree tree - -main :: IO () -main = do args <- getArgs - case args of - [] -> hGetContents stdin >>= run 2 pGrammar - "-s":fs -> mapM_ (runFile 0 pGrammar) fs - fs -> mapM_ (runFile 2 pGrammar) fs - - - - - +-- automatically generated by BNF Converter +module Main where + + +import IO ( stdin, hGetContents ) +import System ( getArgs, getProgName ) + +import GF.Source.LexGF +import GF.Source.ParGF +import GF.Source.SkelGF +import GF.Source.PrintGF +import GF.Source.AbsGF + + + + +import GF.Source.ErrM + +type ParseFun a = [Token] -> Err a + +myLLexer = myLexer + +type Verbosity = Int + +putStrV :: Verbosity -> String -> IO () +putStrV v s = if v > 1 then putStrLn s else return () + +runFile :: (Print a, Show a) => Verbosity -> ParseFun a -> FilePath -> IO () +runFile v p f = putStrLn f >> readFile f >>= run v p + +run :: (Print a, Show a) => Verbosity -> ParseFun a -> String -> IO () +run v p s = let ts = myLLexer s in case p ts of + Bad s -> do putStrLn "\nParse Failed...\n" + putStrV v "Tokens:" + putStrV v $ show ts + putStrLn s + Ok tree -> do putStrLn "\nParse Successful!" + showTree v tree + + + +showTree :: (Show a, Print a) => Int -> a -> IO () +showTree v tree + = do + putStrV v $ "\n[Abstract Syntax]\n\n" ++ show tree + putStrV v $ "\n[Linearized tree]\n\n" ++ printTree tree + +main :: IO () +main = do args <- getArgs + case args of + [] -> hGetContents stdin >>= run 2 pGrammar + "-s":fs -> mapM_ (runFile 0 pGrammar) fs + fs -> mapM_ (runFile 2 pGrammar) fs + + + + + diff --git a/src-3.0/GF/UseGrammar/Editing.hs b/src-3.0/GF/UseGrammar/Editing.hs index 762562eb0..85fee1be4 100644 --- a/src-3.0/GF/UseGrammar/Editing.hs +++ b/src-3.0/GF/UseGrammar/Editing.hs @@ -20,7 +20,6 @@ import qualified GF.Canon.GFC as GFC import GF.Grammar.TypeCheck import GF.Grammar.LookAbs import GF.Grammar.AbsCompute -import GF.Grammar.Macros (errorCat) import GF.Data.Operations import GF.Data.Zipper @@ -51,7 +50,7 @@ actVal :: State -> Val actVal = valNode . nodeTree . actTree actCat :: State -> Cat -actCat = errVal errorCat . val2cat . actVal ---- undef +actCat = errVal (cMeta,cMeta) . val2cat . actVal ---- undef actAtom :: State -> Atom actAtom = atomTree . actTree diff --git a/src-3.0/Makefile b/src-3.0/Makefile index 53c648908..920cde6b5 100644 --- a/src-3.0/Makefile +++ b/src-3.0/Makefile @@ -4,7 +4,7 @@ include config.mk GHMAKE=$(GHC) --make GHCXMAKE=ghcxmake GHCFLAGS+= -fglasgow-exts -GHCOPTFLAGS=-O2 +GHCOPTFLAGS=-O2 -prof GHCFUDFLAG= JAVAFLAGS=-target 1.4 -source 1.4 GFEDITOR=JavaGUI2 @@ -207,7 +207,7 @@ gfc: gf3 gfi: gf3 gf3: - $(GHMAKE) $(GHCOPTFLAGS) $(GHCFLAGS) -o gf3 GF/Devel/GF.hs + $(GHMAKE) $(GHCOPTFLAGS) -o gf3 GF/Devel/GF.hs strip $(GF3_EXE) mv $(GF3_EXE) ../bin/ diff --git a/src-3.0/exper/Optimize.hs b/src-3.0/exper/Optimize.hs index ff4614700..93346bc70 100644 --- a/src-3.0/exper/Optimize.hs +++ b/src-3.0/exper/Optimize.hs @@ -114,9 +114,9 @@ evalCncInfo opts gr cnc abs (c,info) = errIn ("optimizing" +++ prt c) $ case inf pde' <- case (ptyp,pde) of (Yes typ, Yes de) -> - liftM yes $ pEval ([(strVar, typeStr)], typ) de + liftM yes $ pEval ([(varStr, typeStr)], typ) de (Yes typ, Nope) -> - liftM yes $ mkLinDefault gr typ >>= partEval noOptions gr ([(strVar, typeStr)],typ) + liftM yes $ mkLinDefault gr typ >>= partEval noOptions gr ([(varStr, typeStr)],typ) (May b, Nope) -> return $ May b _ -> return pde -- indirection @@ -222,7 +222,7 @@ recordExpand typ trm = case unComputed typ of mkLinDefault :: SourceGrammar -> Type -> Err Term mkLinDefault gr typ = do case unComputed typ of - RecType lts -> mapPairsM mkDefField lts >>= (return . Abs strVar . R . mkAssign) + RecType lts -> mapPairsM mkDefField lts >>= (return . Abs varStr . R . mkAssign) _ -> prtBad "linearization type must be a record type, not" typ where mkDefField typ = case unComputed typ of @@ -230,7 +230,7 @@ mkLinDefault gr typ = do t' <- mkDefField t let T _ cs = mkWildCases t' return $ T (TWild p) cs - Sort "Str" -> return $ Vr strVar + Sort "Str" -> return $ Vr varStr QC q p -> lookupFirstTag gr q p RecType r -> do let (ls,ts) = unzip r