{-# LANGUAGE Rank2Types, GADTs #-}
{-# LANGUAGE ScopedTypeVariables #-}

module ExecutionPlan2Caml where
{-# LINE 2 "src-ag/HsToken.ag" #-}

import CommonTypes
import UU.Scanner.Position(Pos)
{-# LINE 10 "src-generated/ExecutionPlan2Caml.hs" #-}

{-# LINE 2 "src-ag/Expression.ag" #-}

import UU.Scanner.Position(Pos)
import HsToken
{-# LINE 16 "src-generated/ExecutionPlan2Caml.hs" #-}

{-# LINE 2 "src-ag/Patterns.ag" #-}

-- Patterns.ag imports
import UU.Scanner.Position(Pos)
import CommonTypes (ConstructorIdent,Identifier)
{-# LINE 23 "src-generated/ExecutionPlan2Caml.hs" #-}

{-# LINE 2 "src-ag/ExecutionPlan.ag" #-}

-- VisitSyntax.ag imports
import Patterns    (Pattern(..),Patterns)
import Expression  (Expression(..))
import CommonTypes
import ErrorMessages

import qualified Data.Set as Set
import Data.Set(Set)
import qualified Data.Map as Map
import Data.Map(Map)
{-# LINE 37 "src-generated/ExecutionPlan2Caml.hs" #-}

{-# LINE 32 "src-ag/ExecutionPlan2Caml.ag" #-}

import ExecutionPlan
import Pretty
import PPUtil
import Options
import Data.Monoid(mappend,mempty)
import Data.Maybe
import Data.Graph
import Debug.Trace
import System.IO
import System.Directory
import System.FilePath
import UU.Scanner.Position

import TokenDef
import HsToken
import ErrorMessages

import Data.Set (Set)
import qualified Data.Set as Set
import Data.Map (Map)
import qualified Data.Map as Map
import Data.Sequence(Seq)
import qualified Data.Sequence as Seq
import Data.Foldable(toList)
{-# LINE 65 "src-generated/ExecutionPlan2Caml.hs" #-}
import Control.Monad.Identity (Identity)
import qualified Control.Monad.Identity
{-# LINE 175 "src-ag/ExecutionPlan2Caml.ag" #-}

ppRecordTp :: PP a => [a] -> PP_Doc
ppRecordTp es
  | null es   = text "unit"
  | otherwise = pp_block "{" "}" "; " (map pp es)

ppRecordVal :: PP a => [a] -> PP_Doc
ppRecordVal es
  | null es   = text "()"
  | otherwise = pp_block "{" "}" "; " (map pp es)

ppFieldsVal :: Bool -> [(PP_Doc,PP_Doc,PP_Doc,PP_Doc)] -> PP_Doc
ppFieldsVal record fields
  | null fields = text "()"
  | record      = ppRecordVal [ r >#< "=" >#< x | (r,x,_,_) <- fields ]
  | otherwise   = pp_block "(" ")" "," [ x | (_,x,_,_) <- fields ]

ppFieldsType :: Bool -> Bool -> [(PP_Doc,PP_Doc,PP_Doc,PP_Doc)] -> PP_Doc
ppFieldsType record defor fields
  | null fields = text "unit"
  | record      = ppRecordTp [ r >#< ":" >#< (if defor then d else f) | (r,_,d,f) <- fields ]
  | otherwise   = pp_block "(" ")" "*" [ if defor then d else f | (_,_,d,f) <- fields ]
{-# LINE 91 "src-generated/ExecutionPlan2Caml.hs" #-}

{-# LINE 288 "src-ag/ExecutionPlan2Caml.ag" #-}

ppTp :: Type -> PP_Doc
ppTp tp = case tp of
  Haskell t -> pp t   -- ocaml type
  NT nt tps deforested
    | nt == _SELF -> pp "?SELF?"
    | null tps    -> ppNontTp nt deforested
    | otherwise   -> pp_parens (ppSpaced (map pp_parens tps) >#< ppNontTp nt deforested)
  Self -> pp "?SELF?"

ppNontTp :: NontermIdent -> Bool -> PP_Doc
ppNontTp nt True  = pp "t_" >|< pp nt
ppNontTp nt False = pp nt

-- multiple type parameters go into a tuple
ppTypeParams :: PP a => [a] -> PP_Doc
ppTypeParams []  = empty
ppTypeParams [x] = pp x
ppTypeParams xs  = pp_block "(" ")" "," (map pp xs)
{-# LINE 113 "src-generated/ExecutionPlan2Caml.hs" #-}

{-# LINE 361 "src-ag/ExecutionPlan2Caml.ag" #-}

-- convention for nonterminals to module names
modName :: NontermIdent -> PP_Doc
modName nt = pp "M_" >|< pp nt

ppFunDecl :: Bool -> PP_Doc -> [(PP_Doc,PP_Doc)] -> PP_Doc -> PP_Doc -> PP_Doc
ppFunDecl gensigs nm args resSig expr = body where
  body = nm >#< ppSpaced (map arg args) >#< ppRes >#< "="
         >-< indent 2 expr
  arg (arg,tp) = ppArg gensigs arg tp
  ppRes
    | gensigs  = ":" >#< resSig
    | otherwise = empty

ppArg :: Bool -> PP_Doc -> PP_Doc -> PP_Doc
ppArg gensigs arg tp
  | gensigs   = pp_parens (arg >#< ":" >#< tp)
  | otherwise = arg

{-# LINE 135 "src-generated/ExecutionPlan2Caml.hs" #-}

{-# LINE 428 "src-ag/ExecutionPlan2Caml.ag" #-}
type VisitStateState = (VisitIdentifier,StateIdentifier, StateIdentifier)
{-# LINE 139 "src-generated/ExecutionPlan2Caml.hs" #-}

{-# LINE 464 "src-ag/ExecutionPlan2Caml.ag" #-}

--
-- conventions
--

-- type of the state of a node: a closure containing the children states and attributes,
-- with code of type 'type_nt_sem' that represents the subsequent visits to successor states.
type_nt_state nt st = "s_" >|< nt >|< "_" >|< st

-- type of a visit to a node (the initial, and when in a given state)
-- an instance of this type is called the "semantics"
type_nt_sem_top nt = "t_" >|< nt
type_nt_sem nt st = type_nt_sem_top nt >|< "_s" >|< st

-- type of a caller (contains visit selection + inputs + continuation)
type_caller nt st = "c_" >|< nt >|< "_s" >|< st

-- names of records
nm_attach nt = "attach_">|< nt
nm_invoke nt st = "inv_" >|< nt >|< "_s" >|< st

-- name of the type variable representing the result type of the continuation
cont_tvar = text "'cont__"


-- order states in reverse topological order so that successor states are
-- earlier in the resulting list.
orderStates :: StateIdentifier -> [VisitStateState] -> [StateIdentifier]
orderStates initial edges = res where
  source  = Map.singleton initial Set.empty  -- ensures that the initial state is in graph even when there are no edges
  targets = [ Map.singleton t Set.empty | (_,_,t) <- edges ]
  deps    = [ Map.singleton f (Set.singleton t) | (_,f,t) <- edges ]

  mp  = Map.unionsWith Set.union (source : (targets ++ deps))
  es  = [ (f,f,Set.toList ts) | (f,ts) <- Map.toList mp ]
  cps = stronglyConnComp es
  res = flattenSCCs cps
{-# LINE 179 "src-generated/ExecutionPlan2Caml.hs" #-}

{-# LINE 521 "src-ag/ExecutionPlan2Caml.ag" #-}

type_caller_visit nt v = "c_" >|< nt >|< "_v" >|< v
con_visit nt v = "C_" >|< nt >|< "_v" >|< v

-- field names
nm_inh nt v  = "inh_" >|< nt >|< "_v" >|< v
nm_cont nt v = "cont_" >|< nt >|< "_v" >|< v
{-# LINE 189 "src-generated/ExecutionPlan2Caml.hs" #-}

{-# LINE 567 "src-ag/ExecutionPlan2Caml.ag" #-}

-- more naming conventions
nm_inarg nm nt v = "i_" >|< nm >|< "_" >|< nt >|< "_v" >|< v
nm_outarg nm nt v = "o_" >|< nm >|< "_" >|< nt >|< "_v" >|< v
nm_outarg_cont = nm_outarg "_cont"

conNmTVisit nt vId      = "t_" >|< nt >|< "_v"    >|< vId
conNmTVisitIn nt vId    = "t_" >|< nt >|< "_vIn"  >|< vId
conNmTVisitOut nt vId   = "t_" >|< nt >|< "_vOut" >|< vId

-- todo: remove ppMonadType
ppMonadType :: Options -> PP_Doc
ppMonadType opts
  | parallelInvoke opts = text "IO"
  | otherwise           = text "Identity"
{-# LINE 207 "src-generated/ExecutionPlan2Caml.hs" #-}

{-# LINE 780 "src-ag/ExecutionPlan2Caml.ag" #-}

nm_visit v = "__v" >|< v
nm_k st = "__k" >|< st
nm_st st = "__st" >|< st

mklets :: (PP b, PP c) => [b] -> c -> PP_Doc
mklets defs body = res where
  ppLet def = "let" >#< def >#< "in"
  res = vlist (map ppLet defs) >-< body
{-# LINE 219 "src-generated/ExecutionPlan2Caml.hs" #-}

{-# LINE 822 "src-ag/ExecutionPlan2Caml.ag" #-}

resultValName :: String
resultValName = "__result_"

nextStName :: String
nextStName = "__st_"
{-# LINE 228 "src-generated/ExecutionPlan2Caml.hs" #-}

{-# LINE 963 "src-ag/ExecutionPlan2Caml.ag" #-}

stname :: Identifier -> Int -> String
stname child st = "_" ++ getName child ++ "X" ++ show st

-- should actually return some conversion info
compatibleAttach :: VisitKind -> NontermIdent -> Options -> Bool
compatibleAttach _ _ _ = True
{-# LINE 238 "src-generated/ExecutionPlan2Caml.hs" #-}

{-# LINE 1030 "src-ag/ExecutionPlan2Caml.ag" #-}

dummyPat :: Options -> Bool -> PP_Doc
dummyPat opts noArgs
  | not noArgs            = empty
  | strictDummyToken opts = text "()"
  | otherwise             = text "(_ : unit)"

dummyArg :: Options -> Bool -> PP_Doc
dummyArg opts noArgs
  | not noArgs            = empty
  | otherwise             = text "()"

dummyType :: Options -> Bool -> PP_Doc
dummyType opts noArgs
  | not noArgs            = empty
  | otherwise             = text "unit"
{-# LINE 257 "src-generated/ExecutionPlan2Caml.hs" #-}

{-# LINE 1106 "src-ag/ExecutionPlan2Caml.ag" #-}

data NonLocalAttr
  = AttrInh Identifier Identifier
  | AttrSyn Identifier Identifier deriving Show

mkNonLocalAttr :: Bool -> Identifier -> Identifier -> NonLocalAttr
mkNonLocalAttr True  = AttrInh  -- True: inherited attr
mkNonLocalAttr False = AttrSyn

lookupAttrType :: NonLocalAttr -> Map Identifier Attributes -> Map Identifier Attributes -> Map Identifier Type -> Maybe PP_Doc
lookupAttrType (AttrInh child name) inhs _ = lookupType child name inhs
lookupAttrType (AttrSyn child name) _ syns = lookupType child name syns

-- Note: if the child takes type parameters, the type of an attribute of this child may refer to these parameters. This means that
-- the actual type of the attribute needs to have its type parameters substituted with the actual type argument of the child.
-- However, for now we simply decide to return Nothing in this case, which skips the type annotation.
lookupType :: Identifier -> Identifier -> Map Identifier Attributes -> Map Identifier Type -> Maybe PP_Doc
lookupType child name attrMp childMp
  | noParameters childTp = Just ppDoc
  | otherwise            = Nothing
  where
    attrTp     = Map.findWithDefault (error "lookupType: the attribute is not in the attrs of the child") name childAttrs
    childAttrs = Map.findWithDefault (error "lookupType: the attributes of the nonterm are not in the map") nonterm attrMp
    nonterm    = extractNonterminal childTp
    childTp    = Map.findWithDefault (error ("lookupType: the child " ++ show child ++ "is not in the appropriate map")) child childMp
    ppDoc      = ppTp attrTp

noParameters :: Type -> Bool
noParameters (Haskell _)   = True
noParameters (NT _ args _) = null args
{-# LINE 290 "src-generated/ExecutionPlan2Caml.hs" #-}

{-# LINE 1204 "src-ag/ExecutionPlan2Caml.ag" #-}

contNm = text "__cont_"
inpsNm = text "__inps_"

-- a `compatibleKind` b  means: can kind b be invoked from a
compatibleKind :: VisitKind -> VisitKind -> Bool
compatibleKind _              _             = True

compatibleRule :: VisitKind -> Bool -> Bool
compatibleRule (VisitPure _) False = False
compatibleRule _             _     = True
{-# LINE 304 "src-generated/ExecutionPlan2Caml.hs" #-}

{-# LINE 1229 "src-ag/ExecutionPlan2Caml.ag" #-}

unionWithSum = Map.unionWith (+)
{-# LINE 309 "src-generated/ExecutionPlan2Caml.hs" #-}

{-# LINE 1252 "src-ag/ExecutionPlan2Caml.ag" #-}

uwSetUnion :: (Ord a, Ord b) => Map a (Set b) -> Map a (Set b) -> Map a (Set b)
uwSetUnion = Map.unionWith Set.union

uwMapUnion :: (Ord a, Ord b) => Map a (Map b c) -> Map a (Map b c) -> Map a (Map b c)
uwMapUnion = Map.unionWith Map.union
{-# LINE 318 "src-generated/ExecutionPlan2Caml.hs" #-}
-- EChild ------------------------------------------------------
-- wrapper
data Inh_EChild  = Inh_EChild { Inh_EChild -> Map NontermIdent Int
allInitStates_Inh_EChild :: (Map NontermIdent Int), Inh_EChild -> NontermIdent
con_Inh_EChild :: (ConstructorIdent), Inh_EChild -> String
mainFile_Inh_EChild :: (String), Inh_EChild -> String
mainName_Inh_EChild :: (String), Inh_EChild -> NontermIdent
nt_Inh_EChild :: (NontermIdent), Inh_EChild -> Options
options_Inh_EChild :: (Options) }
data Syn_EChild  = Syn_EChild { Syn_EChild -> PP_Doc
argnamesw_Syn_EChild :: ( PP_Doc ), Syn_EChild -> Attributes
childTypes_Syn_EChild :: (Map Identifier Type), Syn_EChild
-> Map
     NontermIdent
     (VisitKind
      -> Either
           Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
childintros_Syn_EChild :: (Map Identifier (VisitKind -> Either Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))), Syn_EChild -> [(PP_Doc, PP_Doc, PP_Doc, PP_Doc)]
sigs_Syn_EChild :: ([(PP_Doc,PP_Doc,PP_Doc,PP_Doc)]), Syn_EChild -> Set String
terminaldefs_Syn_EChild :: (Set String) }
{-# INLINABLE wrap_EChild #-}
wrap_EChild :: T_EChild  -> Inh_EChild  -> (Syn_EChild )
wrap_EChild :: T_EChild -> Inh_EChild -> Syn_EChild
wrap_EChild (T_EChild Identity T_EChild_s2
act) (Inh_EChild Map NontermIdent Int
_lhsIallInitStates NontermIdent
_lhsIcon String
_lhsImainFile String
_lhsImainName NontermIdent
_lhsInt Options
_lhsIoptions) =
   forall a. Identity a -> a
Control.Monad.Identity.runIdentity (
     do T_EChild_s2
sem <- Identity T_EChild_s2
act
        let arg1 :: T_EChild_vIn1
arg1 = Map NontermIdent Int
-> NontermIdent
-> String
-> String
-> NontermIdent
-> Options
-> T_EChild_vIn1
T_EChild_vIn1 Map NontermIdent Int
_lhsIallInitStates NontermIdent
_lhsIcon String
_lhsImainFile String
_lhsImainName NontermIdent
_lhsInt Options
_lhsIoptions
        (T_EChild_vOut1 PP_Doc
_lhsOargnamesw Attributes
_lhsOchildTypes Map
  NontermIdent
  (VisitKind
   -> Either
        Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
_lhsOchildintros [(PP_Doc, PP_Doc, PP_Doc, PP_Doc)]
_lhsOsigs Set String
_lhsOterminaldefs) <- forall (m :: * -> *) a. Monad m => a -> m a
return (T_EChild_s2 -> T_EChild_v1
inv_EChild_s2 T_EChild_s2
sem T_EChild_vIn1
arg1)
        forall (m :: * -> *) a. Monad m => a -> m a
return (PP_Doc
-> Attributes
-> Map
     NontermIdent
     (VisitKind
      -> Either
           Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
-> [(PP_Doc, PP_Doc, PP_Doc, PP_Doc)]
-> Set String
-> Syn_EChild
Syn_EChild PP_Doc
_lhsOargnamesw Attributes
_lhsOchildTypes Map
  NontermIdent
  (VisitKind
   -> Either
        Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
_lhsOchildintros [(PP_Doc, PP_Doc, PP_Doc, PP_Doc)]
_lhsOsigs Set String
_lhsOterminaldefs)
   )

-- cata
{-# NOINLINE sem_EChild #-}
sem_EChild :: EChild  -> T_EChild 
sem_EChild :: EChild -> T_EChild
sem_EChild ( EChild NontermIdent
name_ Type
tp_ ChildKind
kind_ Bool
hasAround_ Maybe [NontermIdent]
merges_ Bool
isMerged_ ) = NontermIdent
-> Type
-> ChildKind
-> Bool
-> Maybe [NontermIdent]
-> Bool
-> T_EChild
sem_EChild_EChild NontermIdent
name_ Type
tp_ ChildKind
kind_ Bool
hasAround_ Maybe [NontermIdent]
merges_ Bool
isMerged_
sem_EChild ( ETerm NontermIdent
name_ Type
tp_ ) = NontermIdent -> Type -> T_EChild
sem_EChild_ETerm NontermIdent
name_ Type
tp_

-- semantic domain
newtype T_EChild  = T_EChild {
                             T_EChild -> Identity T_EChild_s2
attach_T_EChild :: Identity (T_EChild_s2 )
                             }
newtype T_EChild_s2  = C_EChild_s2 {
                                   T_EChild_s2 -> T_EChild_v1
inv_EChild_s2 :: (T_EChild_v1 )
                                   }
data T_EChild_s3  = C_EChild_s3
type T_EChild_v1  = (T_EChild_vIn1 ) -> (T_EChild_vOut1 )
data T_EChild_vIn1  = T_EChild_vIn1 (Map NontermIdent Int) (ConstructorIdent) (String) (String) (NontermIdent) (Options)
data T_EChild_vOut1  = T_EChild_vOut1 ( PP_Doc ) (Map Identifier Type) (Map Identifier (VisitKind -> Either Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))) ([(PP_Doc,PP_Doc,PP_Doc,PP_Doc)]) (Set String)
{-# NOINLINE sem_EChild_EChild #-}
sem_EChild_EChild :: (Identifier) -> (Type) -> (ChildKind) -> (Bool) -> (Maybe [Identifier]) -> (Bool) -> T_EChild 
sem_EChild_EChild :: NontermIdent
-> Type
-> ChildKind
-> Bool
-> Maybe [NontermIdent]
-> Bool
-> T_EChild
sem_EChild_EChild NontermIdent
arg_name_ Type
arg_tp_ ChildKind
arg_kind_ Bool
arg_hasAround_ Maybe [NontermIdent]
_ Bool
_ = Identity T_EChild_s2 -> T_EChild
T_EChild (forall (m :: * -> *) a. Monad m => a -> m a
return T_EChild_s2
st2) where
   {-# NOINLINE st2 #-}
   st2 :: T_EChild_s2
st2 = let
      v1 :: T_EChild_v1 
      v1 :: T_EChild_v1
v1 = \ (T_EChild_vIn1 Map NontermIdent Int
_lhsIallInitStates NontermIdent
_lhsIcon String
_lhsImainFile String
_lhsImainName NontermIdent
_lhsInt Options
_lhsIoptions) -> ( let
         _tpDocFor :: PP_Doc
_tpDocFor = Type -> PP_Doc
rule0 Type
arg_tp_
         _tpDocDefor :: PP_Doc
_tpDocDefor = Type -> PP_Doc
rule1 Type
arg_tp_
         _fieldNm :: PP_Doc
_fieldNm = NontermIdent -> NontermIdent -> NontermIdent -> PP_Doc
rule2 NontermIdent
_lhsIcon NontermIdent
_lhsInt NontermIdent
arg_name_
         _childNm :: PP_Doc
_childNm = NontermIdent -> PP_Doc
rule3 NontermIdent
arg_name_
         _field :: (PP_Doc, PP_Doc, PP_Doc, PP_Doc)
_field = forall {b} {a} {c} {d}. b -> a -> c -> d -> (a, b, c, d)
rule4 PP_Doc
_childNm PP_Doc
_fieldNm PP_Doc
_tpDocDefor PP_Doc
_tpDocFor
         _lhsOsigs :: [(PP_Doc,PP_Doc,PP_Doc,PP_Doc)]
         _lhsOsigs :: [(PP_Doc, PP_Doc, PP_Doc, PP_Doc)]
_lhsOsigs = forall {a}. a -> ChildKind -> [a]
rule5 (PP_Doc, PP_Doc, PP_Doc, PP_Doc)
_field ChildKind
arg_kind_
         _lhsOargnamesw ::  PP_Doc 
         _lhsOargnamesw :: PP_Doc
_lhsOargnamesw = Options -> NontermIdent -> ChildKind -> NontermIdent -> PP_Doc
rule6 Options
_lhsIoptions NontermIdent
_nt ChildKind
arg_kind_ NontermIdent
arg_name_
         _lhsOchildintros :: Map Identifier (VisitKind -> Either Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
         _lhsOchildintros :: Map
  NontermIdent
  (VisitKind
   -> Either
        Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
_lhsOchildintros = forall {a} {k}. a -> k -> Map k a
rule7 VisitKind
-> Either
     Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr))
_introcode NontermIdent
arg_name_
         _isDefor :: Bool
_isDefor = Type -> Bool
rule8 Type
arg_tp_
         _valcode :: PP_Doc
_valcode = Bool
-> Options -> NontermIdent -> ChildKind -> NontermIdent -> PP_Doc
rule9 Bool
_isDefor Options
_lhsIoptions NontermIdent
_nt ChildKind
arg_kind_ NontermIdent
arg_name_
         _aroundcode :: PP_Doc
_aroundcode = Options -> Bool -> NontermIdent -> PP_Doc
rule10 Options
_lhsIoptions Bool
arg_hasAround_ NontermIdent
arg_name_
         _introcode :: VisitKind
-> Either
     Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr))
_introcode = PP_Doc
-> Int
-> Bool
-> Options
-> NontermIdent
-> PP_Doc
-> Bool
-> ChildKind
-> NontermIdent
-> VisitKind
-> Either
     Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr))
rule11 PP_Doc
_aroundcode Int
_initSt Bool
_isDefor Options
_lhsIoptions NontermIdent
_nt PP_Doc
_valcode Bool
arg_hasAround_ ChildKind
arg_kind_ NontermIdent
arg_name_
         _nt :: NontermIdent
_nt = Type -> NontermIdent
rule12 Type
arg_tp_
         _lhsOchildTypes :: Map Identifier Type
         _lhsOchildTypes :: Attributes
_lhsOchildTypes = forall k a. k -> a -> Map k a
rule13 NontermIdent
arg_name_ Type
arg_tp_
         _initSt :: Int
_initSt = Map NontermIdent Int -> NontermIdent -> Int
rule14 Map NontermIdent Int
_lhsIallInitStates NontermIdent
_nt
         _lhsOterminaldefs :: Set String
         _lhsOterminaldefs :: Set String
_lhsOterminaldefs = forall {a}. () -> Set a
rule15  ()
         __result_ :: T_EChild_vOut1
__result_ = PP_Doc
-> Attributes
-> Map
     NontermIdent
     (VisitKind
      -> Either
           Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
-> [(PP_Doc, PP_Doc, PP_Doc, PP_Doc)]
-> Set String
-> T_EChild_vOut1
T_EChild_vOut1 PP_Doc
_lhsOargnamesw Attributes
_lhsOchildTypes Map
  NontermIdent
  (VisitKind
   -> Either
        Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
_lhsOchildintros [(PP_Doc, PP_Doc, PP_Doc, PP_Doc)]
_lhsOsigs Set String
_lhsOterminaldefs
         in T_EChild_vOut1
__result_ )
     in T_EChild_v1 -> T_EChild_s2
C_EChild_s2 T_EChild_v1
v1
   {-# INLINE rule0 #-}
   {-# LINE 278 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule0 = \ tp_ ->
                         {-# LINE 278 "src-ag/ExecutionPlan2Caml.ag" #-}
                         ppTp $ removeDeforested tp_
                         {-# LINE 386 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule1 #-}
   {-# LINE 279 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule1 = \ tp_ ->
                         {-# LINE 279 "src-ag/ExecutionPlan2Caml.ag" #-}
                         ppTp $ forceDeforested tp_
                         {-# LINE 392 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule2 #-}
   {-# LINE 280 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule2 = \ ((_lhsIcon) :: ConstructorIdent) ((_lhsInt) :: NontermIdent) name_ ->
                         {-# LINE 280 "src-ag/ExecutionPlan2Caml.ag" #-}
                         text $ recordFieldname _lhsInt _lhsIcon name_
                         {-# LINE 398 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule3 #-}
   {-# LINE 281 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule3 = \ name_ ->
                         {-# LINE 281 "src-ag/ExecutionPlan2Caml.ag" #-}
                         text (fieldname name_)
                         {-# LINE 404 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule4 #-}
   {-# LINE 282 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule4 = \ _childNm _fieldNm _tpDocDefor _tpDocFor ->
                     {-# LINE 282 "src-ag/ExecutionPlan2Caml.ag" #-}
                     (_fieldNm    , _childNm    , _tpDocDefor    , _tpDocFor    )
                     {-# LINE 410 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule5 #-}
   {-# LINE 283 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule5 = \ _field kind_ ->
                         {-# LINE 283 "src-ag/ExecutionPlan2Caml.ag" #-}
                         case kind_ of
                           ChildAttr -> []
                           _         -> [_field    ]
                         {-# LINE 418 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule6 #-}
   {-# LINE 396 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule6 = \ ((_lhsIoptions) :: Options) _nt kind_ name_ ->
                             {-# LINE 396 "src-ag/ExecutionPlan2Caml.ag" #-}
                             case kind_ of
                               ChildSyntax     -> "(" >#< prefix _lhsIoptions >|< _nt     >#< name_ >|< "_" >#< ")"
                               ChildAttr       -> empty
                               ChildReplace tp -> "(" >#< prefix _lhsIoptions >|< extractNonterminal tp >#< name_ >|< "_" >#< ")"
                             {-# LINE 427 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule7 #-}
   {-# LINE 923 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule7 = \ _introcode name_ ->
                               {-# LINE 923 "src-ag/ExecutionPlan2Caml.ag" #-}
                               Map.singleton name_ _introcode
                               {-# LINE 433 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule8 #-}
   {-# LINE 924 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule8 = \ tp_ ->
                               {-# LINE 924 "src-ag/ExecutionPlan2Caml.ag" #-}
                               case tp_ of
                                 NT _ _ defor -> defor
                                 _            -> False
                               {-# LINE 441 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule9 #-}
   {-# LINE 927 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule9 = \ _isDefor ((_lhsIoptions) :: Options) _nt kind_ name_ ->
                               {-# LINE 927 "src-ag/ExecutionPlan2Caml.ag" #-}
                               case kind_ of
                                 ChildSyntax -> name_ >|< "_"
                                 ChildAttr   ->
                                                let head | not _isDefor     = if lateHigherOrderBinding _lhsIoptions
                                                                              then lateSemNtLabel _nt     >#< lhsname _lhsIoptions True idLateBindingAttr
                                                                              else prefix _lhsIoptions >|< _nt
                                                         | otherwise        = empty
                                                in pp_parens (head >#< instname name_)
                                 ChildReplace _ ->
                                                   pp_parens (instname name_ >#< name_ >|< "_")
                               {-# LINE 456 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule10 #-}
   {-# LINE 938 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule10 = \ ((_lhsIoptions) :: Options) hasAround_ name_ ->
                               {-# LINE 938 "src-ag/ExecutionPlan2Caml.ag" #-}
                               if hasAround_
                               then locname _lhsIoptions name_ >|< "_around"
                               else empty
                               {-# LINE 464 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule11 #-}
   {-# LINE 941 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule11 = \ _aroundcode _initSt _isDefor ((_lhsIoptions) :: Options) _nt _valcode hasAround_ kind_ name_ ->
                               {-# LINE 941 "src-ag/ExecutionPlan2Caml.ag" #-}
                               \kind -> let pat    = text $ stname name_ _initSt
                                            attach = pp_parens (_aroundcode     >#< _valcode    ) >|< "." >|< nm_attach _nt     >#< "()"
                                            decl   = pat >#< "=" >#< attach
                                        in if compatibleAttach kind _nt     _lhsIoptions
                                           then Right ( "let" >#< decl >#< "in"
                                                      , Set.singleton (stname name_ _initSt    )
                                                      , case kind_ of
                                                          ChildAttr   -> Map.insert (instname name_) Nothing $
                                                                           ( if _isDefor     || not (lateHigherOrderBinding _lhsIoptions)
                                                                             then id
                                                                             else Map.insert (lhsname _lhsIoptions True idLateBindingAttr) (Just $ AttrInh _LHS idLateBindingAttr)
                                                                           ) $
                                                                           ( if hasAround_
                                                                             then Map.insert (locname _lhsIoptions (name_) ++ "_around") Nothing
                                                                             else id
                                                                           ) $ Map.empty
                                                          ChildReplace _ -> Map.singleton (instname name_) Nothing
                                                          ChildSyntax    -> Map.empty
                                                      )
                                           else Left $ IncompatibleAttachKind name_ kind
                               {-# LINE 489 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule12 #-}
   {-# LINE 961 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule12 = \ tp_ ->
                      {-# LINE 961 "src-ag/ExecutionPlan2Caml.ag" #-}
                      extractNonterminal tp_
                      {-# LINE 495 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule13 #-}
   {-# LINE 1424 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule13 = \ name_ tp_ ->
                     {-# LINE 1424 "src-ag/ExecutionPlan2Caml.ag" #-}
                     Map.singleton name_ tp_
                     {-# LINE 501 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule14 #-}
   {-# LINE 1468 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule14 = \ ((_lhsIallInitStates) :: Map NontermIdent Int) _nt ->
                 {-# LINE 1468 "src-ag/ExecutionPlan2Caml.ag" #-}
                 Map.findWithDefault (error "nonterminal not in allInitStates map") _nt     _lhsIallInitStates
                 {-# LINE 507 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule15 #-}
   rule15 = \  (_ :: ()) ->
     Set.empty
{-# NOINLINE sem_EChild_ETerm #-}
sem_EChild_ETerm :: (Identifier) -> (Type) -> T_EChild 
sem_EChild_ETerm :: NontermIdent -> Type -> T_EChild
sem_EChild_ETerm NontermIdent
arg_name_ Type
arg_tp_ = Identity T_EChild_s2 -> T_EChild
T_EChild (forall (m :: * -> *) a. Monad m => a -> m a
return T_EChild_s2
st2) where
   {-# NOINLINE st2 #-}
   st2 :: T_EChild_s2
st2 = let
      v1 :: T_EChild_v1 
      v1 :: T_EChild_v1
v1 = \ (T_EChild_vIn1 Map NontermIdent Int
_lhsIallInitStates NontermIdent
_lhsIcon String
_lhsImainFile String
_lhsImainName NontermIdent
_lhsInt Options
_lhsIoptions) -> ( let
         _tpDocFor :: PP_Doc
_tpDocFor = Type -> PP_Doc
rule16 Type
arg_tp_
         _tpDocDefor :: PP_Doc
_tpDocDefor = Type -> PP_Doc
rule17 Type
arg_tp_
         _fieldNm :: PP_Doc
_fieldNm = NontermIdent -> NontermIdent -> NontermIdent -> PP_Doc
rule18 NontermIdent
_lhsIcon NontermIdent
_lhsInt NontermIdent
arg_name_
         _childNm :: PP_Doc
_childNm = NontermIdent -> PP_Doc
rule19 NontermIdent
arg_name_
         _field :: (PP_Doc, PP_Doc, PP_Doc, PP_Doc)
_field = forall {b} {a} {c} {d}. b -> a -> c -> d -> (a, b, c, d)
rule20 PP_Doc
_childNm PP_Doc
_fieldNm PP_Doc
_tpDocDefor PP_Doc
_tpDocFor
         _lhsOsigs :: [(PP_Doc,PP_Doc,PP_Doc,PP_Doc)]
         _lhsOsigs :: [(PP_Doc, PP_Doc, PP_Doc, PP_Doc)]
_lhsOsigs = forall {a}. a -> [a]
rule21 (PP_Doc, PP_Doc, PP_Doc, PP_Doc)
_field
         _lhsOargnamesw ::  PP_Doc 
         _lhsOargnamesw :: PP_Doc
_lhsOargnamesw = NontermIdent -> PP_Doc
rule22 NontermIdent
arg_name_
         _lhsOchildintros :: Map Identifier (VisitKind -> Either Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
         _lhsOchildintros :: Map
  NontermIdent
  (VisitKind
   -> Either
        Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
_lhsOchildintros = forall {k} {p} {a} {a} {k} {a}.
k -> Map k (p -> Either a (PP_Doc, Set a, Map k a))
rule23 NontermIdent
arg_name_
         _lhsOterminaldefs :: Set String
         _lhsOterminaldefs :: Set String
_lhsOterminaldefs = NontermIdent -> Set String
rule24 NontermIdent
arg_name_
         _lhsOchildTypes :: Map Identifier Type
         _lhsOchildTypes :: Attributes
_lhsOchildTypes = forall k a. k -> a -> Map k a
rule25 NontermIdent
arg_name_ Type
arg_tp_
         __result_ :: T_EChild_vOut1
__result_ = PP_Doc
-> Attributes
-> Map
     NontermIdent
     (VisitKind
      -> Either
           Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
-> [(PP_Doc, PP_Doc, PP_Doc, PP_Doc)]
-> Set String
-> T_EChild_vOut1
T_EChild_vOut1 PP_Doc
_lhsOargnamesw Attributes
_lhsOchildTypes Map
  NontermIdent
  (VisitKind
   -> Either
        Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
_lhsOchildintros [(PP_Doc, PP_Doc, PP_Doc, PP_Doc)]
_lhsOsigs Set String
_lhsOterminaldefs
         in T_EChild_vOut1
__result_ )
     in T_EChild_v1 -> T_EChild_s2
C_EChild_s2 T_EChild_v1
v1
   {-# INLINE rule16 #-}
   {-# LINE 278 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule16 = \ tp_ ->
                         {-# LINE 278 "src-ag/ExecutionPlan2Caml.ag" #-}
                         ppTp $ removeDeforested tp_
                         {-# LINE 541 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule17 #-}
   {-# LINE 279 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule17 = \ tp_ ->
                         {-# LINE 279 "src-ag/ExecutionPlan2Caml.ag" #-}
                         ppTp $ forceDeforested tp_
                         {-# LINE 547 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule18 #-}
   {-# LINE 280 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule18 = \ ((_lhsIcon) :: ConstructorIdent) ((_lhsInt) :: NontermIdent) name_ ->
                         {-# LINE 280 "src-ag/ExecutionPlan2Caml.ag" #-}
                         text $ recordFieldname _lhsInt _lhsIcon name_
                         {-# LINE 553 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule19 #-}
   {-# LINE 281 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule19 = \ name_ ->
                         {-# LINE 281 "src-ag/ExecutionPlan2Caml.ag" #-}
                         text (fieldname name_)
                         {-# LINE 559 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule20 #-}
   {-# LINE 282 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule20 = \ _childNm _fieldNm _tpDocDefor _tpDocFor ->
                     {-# LINE 282 "src-ag/ExecutionPlan2Caml.ag" #-}
                     (_fieldNm    , _childNm    , _tpDocDefor    , _tpDocFor    )
                     {-# LINE 565 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule21 #-}
   {-# LINE 286 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule21 = \ _field ->
                         {-# LINE 286 "src-ag/ExecutionPlan2Caml.ag" #-}
                         [_field    ]
                         {-# LINE 571 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule22 #-}
   {-# LINE 400 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule22 = \ name_ ->
                             {-# LINE 400 "src-ag/ExecutionPlan2Caml.ag" #-}
                             text $ fieldname name_
                             {-# LINE 577 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule23 #-}
   {-# LINE 922 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule23 = \ name_ ->
                               {-# LINE 922 "src-ag/ExecutionPlan2Caml.ag" #-}
                               Map.singleton name_ (\_ -> Right (empty, Set.empty, Map.empty))
                               {-# LINE 583 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule24 #-}
   {-# LINE 1266 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule24 = \ name_ ->
                       {-# LINE 1266 "src-ag/ExecutionPlan2Caml.ag" #-}
                       Set.singleton $ fieldname name_
                       {-# LINE 589 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule25 #-}
   {-# LINE 1424 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule25 = \ name_ tp_ ->
                     {-# LINE 1424 "src-ag/ExecutionPlan2Caml.ag" #-}
                     Map.singleton name_ tp_
                     {-# LINE 595 "src-generated/ExecutionPlan2Caml.hs" #-}

-- EChildren ---------------------------------------------------
-- wrapper
data Inh_EChildren  = Inh_EChildren { Inh_EChildren -> Map NontermIdent Int
allInitStates_Inh_EChildren :: (Map NontermIdent Int), Inh_EChildren -> NontermIdent
con_Inh_EChildren :: (ConstructorIdent), Inh_EChildren -> String
mainFile_Inh_EChildren :: (String), Inh_EChildren -> String
mainName_Inh_EChildren :: (String), Inh_EChildren -> NontermIdent
nt_Inh_EChildren :: (NontermIdent), Inh_EChildren -> Options
options_Inh_EChildren :: (Options) }
data Syn_EChildren  = Syn_EChildren { Syn_EChildren -> [PP_Doc]
argnamesw_Syn_EChildren :: ([PP_Doc]), Syn_EChildren -> Attributes
childTypes_Syn_EChildren :: (Map Identifier Type), Syn_EChildren
-> Map
     NontermIdent
     (VisitKind
      -> Either
           Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
childintros_Syn_EChildren :: (Map Identifier (VisitKind -> Either Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))), Syn_EChildren -> [(PP_Doc, PP_Doc, PP_Doc, PP_Doc)]
sigs_Syn_EChildren :: ([(PP_Doc,PP_Doc,PP_Doc,PP_Doc)]), Syn_EChildren -> Set String
terminaldefs_Syn_EChildren :: (Set String) }
{-# INLINABLE wrap_EChildren #-}
wrap_EChildren :: T_EChildren  -> Inh_EChildren  -> (Syn_EChildren )
wrap_EChildren :: T_EChildren -> Inh_EChildren -> Syn_EChildren
wrap_EChildren (T_EChildren Identity T_EChildren_s5
act) (Inh_EChildren Map NontermIdent Int
_lhsIallInitStates NontermIdent
_lhsIcon String
_lhsImainFile String
_lhsImainName NontermIdent
_lhsInt Options
_lhsIoptions) =
   forall a. Identity a -> a
Control.Monad.Identity.runIdentity (
     do T_EChildren_s5
sem <- Identity T_EChildren_s5
act
        let arg4 :: T_EChildren_vIn4
arg4 = Map NontermIdent Int
-> NontermIdent
-> String
-> String
-> NontermIdent
-> Options
-> T_EChildren_vIn4
T_EChildren_vIn4 Map NontermIdent Int
_lhsIallInitStates NontermIdent
_lhsIcon String
_lhsImainFile String
_lhsImainName NontermIdent
_lhsInt Options
_lhsIoptions
        (T_EChildren_vOut4 [PP_Doc]
_lhsOargnamesw Attributes
_lhsOchildTypes Map
  NontermIdent
  (VisitKind
   -> Either
        Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
_lhsOchildintros [(PP_Doc, PP_Doc, PP_Doc, PP_Doc)]
_lhsOsigs Set String
_lhsOterminaldefs) <- forall (m :: * -> *) a. Monad m => a -> m a
return (T_EChildren_s5 -> T_EChildren_v4
inv_EChildren_s5 T_EChildren_s5
sem T_EChildren_vIn4
arg4)
        forall (m :: * -> *) a. Monad m => a -> m a
return ([PP_Doc]
-> Attributes
-> Map
     NontermIdent
     (VisitKind
      -> Either
           Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
-> [(PP_Doc, PP_Doc, PP_Doc, PP_Doc)]
-> Set String
-> Syn_EChildren
Syn_EChildren [PP_Doc]
_lhsOargnamesw Attributes
_lhsOchildTypes Map
  NontermIdent
  (VisitKind
   -> Either
        Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
_lhsOchildintros [(PP_Doc, PP_Doc, PP_Doc, PP_Doc)]
_lhsOsigs Set String
_lhsOterminaldefs)
   )

-- cata
{-# NOINLINE sem_EChildren #-}
sem_EChildren :: EChildren  -> T_EChildren 
sem_EChildren :: EChildren -> T_EChildren
sem_EChildren EChildren
list = forall (t :: * -> *) a b.
Foldable t =>
(a -> b -> b) -> b -> t a -> b
Prelude.foldr T_EChild -> T_EChildren -> T_EChildren
sem_EChildren_Cons T_EChildren
sem_EChildren_Nil (forall a b. (a -> b) -> [a] -> [b]
Prelude.map EChild -> T_EChild
sem_EChild EChildren
list)

-- semantic domain
newtype T_EChildren  = T_EChildren {
                                   T_EChildren -> Identity T_EChildren_s5
attach_T_EChildren :: Identity (T_EChildren_s5 )
                                   }
newtype T_EChildren_s5  = C_EChildren_s5 {
                                         T_EChildren_s5 -> T_EChildren_v4
inv_EChildren_s5 :: (T_EChildren_v4 )
                                         }
data T_EChildren_s6  = C_EChildren_s6
type T_EChildren_v4  = (T_EChildren_vIn4 ) -> (T_EChildren_vOut4 )
data T_EChildren_vIn4  = T_EChildren_vIn4 (Map NontermIdent Int) (ConstructorIdent) (String) (String) (NontermIdent) (Options)
data T_EChildren_vOut4  = T_EChildren_vOut4 ([PP_Doc]) (Map Identifier Type) (Map Identifier (VisitKind -> Either Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))) ([(PP_Doc,PP_Doc,PP_Doc,PP_Doc)]) (Set String)
{-# NOINLINE sem_EChildren_Cons #-}
sem_EChildren_Cons :: T_EChild  -> T_EChildren  -> T_EChildren 
sem_EChildren_Cons :: T_EChild -> T_EChildren -> T_EChildren
sem_EChildren_Cons T_EChild
arg_hd_ T_EChildren
arg_tl_ = Identity T_EChildren_s5 -> T_EChildren
T_EChildren (forall (m :: * -> *) a. Monad m => a -> m a
return T_EChildren_s5
st5) where
   {-# NOINLINE st5 #-}
   st5 :: T_EChildren_s5
st5 = let
      v4 :: T_EChildren_v4 
      v4 :: T_EChildren_v4
v4 = \ (T_EChildren_vIn4 Map NontermIdent Int
_lhsIallInitStates NontermIdent
_lhsIcon String
_lhsImainFile String
_lhsImainName NontermIdent
_lhsInt Options
_lhsIoptions) -> ( let
         _hdX2 :: T_EChild_s2
_hdX2 = forall a. Identity a -> a
Control.Monad.Identity.runIdentity (T_EChild -> Identity T_EChild_s2
attach_T_EChild (T_EChild
arg_hd_))
         _tlX5 :: T_EChildren_s5
_tlX5 = forall a. Identity a -> a
Control.Monad.Identity.runIdentity (T_EChildren -> Identity T_EChildren_s5
attach_T_EChildren (T_EChildren
arg_tl_))
         (T_EChild_vOut1 PP_Doc
_hdIargnamesw Attributes
_hdIchildTypes Map
  NontermIdent
  (VisitKind
   -> Either
        Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
_hdIchildintros [(PP_Doc, PP_Doc, PP_Doc, PP_Doc)]
_hdIsigs Set String
_hdIterminaldefs) = T_EChild_s2 -> T_EChild_v1
inv_EChild_s2 T_EChild_s2
_hdX2 (Map NontermIdent Int
-> NontermIdent
-> String
-> String
-> NontermIdent
-> Options
-> T_EChild_vIn1
T_EChild_vIn1 Map NontermIdent Int
_hdOallInitStates NontermIdent
_hdOcon String
_hdOmainFile String
_hdOmainName NontermIdent
_hdOnt Options
_hdOoptions)
         (T_EChildren_vOut4 [PP_Doc]
_tlIargnamesw Attributes
_tlIchildTypes Map
  NontermIdent
  (VisitKind
   -> Either
        Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
_tlIchildintros [(PP_Doc, PP_Doc, PP_Doc, PP_Doc)]
_tlIsigs Set String
_tlIterminaldefs) = T_EChildren_s5 -> T_EChildren_v4
inv_EChildren_s5 T_EChildren_s5
_tlX5 (Map NontermIdent Int
-> NontermIdent
-> String
-> String
-> NontermIdent
-> Options
-> T_EChildren_vIn4
T_EChildren_vIn4 Map NontermIdent Int
_tlOallInitStates NontermIdent
_tlOcon String
_tlOmainFile String
_tlOmainName NontermIdent
_tlOnt Options
_tlOoptions)
         _lhsOargnamesw :: [PP_Doc]
         _lhsOargnamesw :: [PP_Doc]
_lhsOargnamesw = PP_Doc -> [PP_Doc] -> [PP_Doc]
rule26 PP_Doc
_hdIargnamesw [PP_Doc]
_tlIargnamesw
         _lhsOchildTypes :: Map Identifier Type
         _lhsOchildTypes :: Attributes
_lhsOchildTypes = Attributes -> Attributes -> Attributes
rule27 Attributes
_hdIchildTypes Attributes
_tlIchildTypes
         _lhsOchildintros :: Map Identifier (VisitKind -> Either Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
         _lhsOchildintros :: Map
  NontermIdent
  (VisitKind
   -> Either
        Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
_lhsOchildintros = Map
  NontermIdent
  (VisitKind
   -> Either
        Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
-> Map
     NontermIdent
     (VisitKind
      -> Either
           Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
-> Map
     NontermIdent
     (VisitKind
      -> Either
           Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
rule28 Map
  NontermIdent
  (VisitKind
   -> Either
        Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
_hdIchildintros Map
  NontermIdent
  (VisitKind
   -> Either
        Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
_tlIchildintros
         _lhsOsigs :: [(PP_Doc,PP_Doc,PP_Doc,PP_Doc)]
         _lhsOsigs :: [(PP_Doc, PP_Doc, PP_Doc, PP_Doc)]
_lhsOsigs = [(PP_Doc, PP_Doc, PP_Doc, PP_Doc)]
-> [(PP_Doc, PP_Doc, PP_Doc, PP_Doc)]
-> [(PP_Doc, PP_Doc, PP_Doc, PP_Doc)]
rule29 [(PP_Doc, PP_Doc, PP_Doc, PP_Doc)]
_hdIsigs [(PP_Doc, PP_Doc, PP_Doc, PP_Doc)]
_tlIsigs
         _lhsOterminaldefs :: Set String
         _lhsOterminaldefs :: Set String
_lhsOterminaldefs = Set String -> Set String -> Set String
rule30 Set String
_hdIterminaldefs Set String
_tlIterminaldefs
         _hdOallInitStates :: Map NontermIdent Int
_hdOallInitStates = Map NontermIdent Int -> Map NontermIdent Int
rule31 Map NontermIdent Int
_lhsIallInitStates
         _hdOcon :: NontermIdent
_hdOcon = NontermIdent -> NontermIdent
rule32 NontermIdent
_lhsIcon
         _hdOmainFile :: String
_hdOmainFile = String -> String
rule33 String
_lhsImainFile
         _hdOmainName :: String
_hdOmainName = String -> String
rule34 String
_lhsImainName
         _hdOnt :: NontermIdent
_hdOnt = NontermIdent -> NontermIdent
rule35 NontermIdent
_lhsInt
         _hdOoptions :: Options
_hdOoptions = Options -> Options
rule36 Options
_lhsIoptions
         _tlOallInitStates :: Map NontermIdent Int
_tlOallInitStates = Map NontermIdent Int -> Map NontermIdent Int
rule37 Map NontermIdent Int
_lhsIallInitStates
         _tlOcon :: NontermIdent
_tlOcon = NontermIdent -> NontermIdent
rule38 NontermIdent
_lhsIcon
         _tlOmainFile :: String
_tlOmainFile = String -> String
rule39 String
_lhsImainFile
         _tlOmainName :: String
_tlOmainName = String -> String
rule40 String
_lhsImainName
         _tlOnt :: NontermIdent
_tlOnt = NontermIdent -> NontermIdent
rule41 NontermIdent
_lhsInt
         _tlOoptions :: Options
_tlOoptions = Options -> Options
rule42 Options
_lhsIoptions
         __result_ :: T_EChildren_vOut4
__result_ = [PP_Doc]
-> Attributes
-> Map
     NontermIdent
     (VisitKind
      -> Either
           Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
-> [(PP_Doc, PP_Doc, PP_Doc, PP_Doc)]
-> Set String
-> T_EChildren_vOut4
T_EChildren_vOut4 [PP_Doc]
_lhsOargnamesw Attributes
_lhsOchildTypes Map
  NontermIdent
  (VisitKind
   -> Either
        Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
_lhsOchildintros [(PP_Doc, PP_Doc, PP_Doc, PP_Doc)]
_lhsOsigs Set String
_lhsOterminaldefs
         in T_EChildren_vOut4
__result_ )
     in T_EChildren_v4 -> T_EChildren_s5
C_EChildren_s5 T_EChildren_v4
v4
   {-# INLINE rule26 #-}
   rule26 :: PP_Doc -> [PP_Doc] -> [PP_Doc]
rule26 = \ ((PP_Doc
_hdIargnamesw) ::  PP_Doc ) (([PP_Doc]
_tlIargnamesw) :: [PP_Doc]) ->
     PP_Doc
_hdIargnamesw forall a. a -> [a] -> [a]
: [PP_Doc]
_tlIargnamesw
   {-# INLINE rule27 #-}
   rule27 :: Attributes -> Attributes -> Attributes
rule27 = \ ((Attributes
_hdIchildTypes) :: Map Identifier Type) ((Attributes
_tlIchildTypes) :: Map Identifier Type) ->
     Attributes
_hdIchildTypes forall a. Monoid a => a -> a -> a
`mappend` Attributes
_tlIchildTypes
   {-# INLINE rule28 #-}
   rule28 :: Map
  NontermIdent
  (VisitKind
   -> Either
        Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
-> Map
     NontermIdent
     (VisitKind
      -> Either
           Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
-> Map
     NontermIdent
     (VisitKind
      -> Either
           Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
rule28 = \ ((Map
  NontermIdent
  (VisitKind
   -> Either
        Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
_hdIchildintros) :: Map Identifier (VisitKind -> Either Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))) ((Map
  NontermIdent
  (VisitKind
   -> Either
        Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
_tlIchildintros) :: Map Identifier (VisitKind -> Either Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))) ->
     Map
  NontermIdent
  (VisitKind
   -> Either
        Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
_hdIchildintros forall k a. Ord k => Map k a -> Map k a -> Map k a
`Map.union` Map
  NontermIdent
  (VisitKind
   -> Either
        Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
_tlIchildintros
   {-# INLINE rule29 #-}
   rule29 :: [(PP_Doc, PP_Doc, PP_Doc, PP_Doc)]
-> [(PP_Doc, PP_Doc, PP_Doc, PP_Doc)]
-> [(PP_Doc, PP_Doc, PP_Doc, PP_Doc)]
rule29 = \ (([(PP_Doc, PP_Doc, PP_Doc, PP_Doc)]
_hdIsigs) :: [(PP_Doc,PP_Doc,PP_Doc,PP_Doc)]) (([(PP_Doc, PP_Doc, PP_Doc, PP_Doc)]
_tlIsigs) :: [(PP_Doc,PP_Doc,PP_Doc,PP_Doc)]) ->
     [(PP_Doc, PP_Doc, PP_Doc, PP_Doc)]
_hdIsigs forall a. [a] -> [a] -> [a]
++ [(PP_Doc, PP_Doc, PP_Doc, PP_Doc)]
_tlIsigs
   {-# INLINE rule30 #-}
   rule30 :: Set String -> Set String -> Set String
rule30 = \ ((Set String
_hdIterminaldefs) :: Set String) ((Set String
_tlIterminaldefs) :: Set String) ->
     Set String
_hdIterminaldefs forall a. Ord a => Set a -> Set a -> Set a
`Set.union` Set String
_tlIterminaldefs
   {-# INLINE rule31 #-}
   rule31 :: Map NontermIdent Int -> Map NontermIdent Int
rule31 = \ ((Map NontermIdent Int
_lhsIallInitStates) :: Map NontermIdent Int) ->
     Map NontermIdent Int
_lhsIallInitStates
   {-# INLINE rule32 #-}
   rule32 :: NontermIdent -> NontermIdent
rule32 = \ ((NontermIdent
_lhsIcon) :: ConstructorIdent) ->
     NontermIdent
_lhsIcon
   {-# INLINE rule33 #-}
   rule33 :: String -> String
rule33 = \ ((String
_lhsImainFile) :: String) ->
     String
_lhsImainFile
   {-# INLINE rule34 #-}
   rule34 :: String -> String
rule34 = \ ((String
_lhsImainName) :: String) ->
     String
_lhsImainName
   {-# INLINE rule35 #-}
   rule35 :: NontermIdent -> NontermIdent
rule35 = \ ((NontermIdent
_lhsInt) :: NontermIdent) ->
     NontermIdent
_lhsInt
   {-# INLINE rule36 #-}
   rule36 :: Options -> Options
rule36 = \ ((Options
_lhsIoptions) :: Options) ->
     Options
_lhsIoptions
   {-# INLINE rule37 #-}
   rule37 :: Map NontermIdent Int -> Map NontermIdent Int
rule37 = \ ((Map NontermIdent Int
_lhsIallInitStates) :: Map NontermIdent Int) ->
     Map NontermIdent Int
_lhsIallInitStates
   {-# INLINE rule38 #-}
   rule38 :: NontermIdent -> NontermIdent
rule38 = \ ((NontermIdent
_lhsIcon) :: ConstructorIdent) ->
     NontermIdent
_lhsIcon
   {-# INLINE rule39 #-}
   rule39 :: String -> String
rule39 = \ ((String
_lhsImainFile) :: String) ->
     String
_lhsImainFile
   {-# INLINE rule40 #-}
   rule40 :: String -> String
rule40 = \ ((String
_lhsImainName) :: String) ->
     String
_lhsImainName
   {-# INLINE rule41 #-}
   rule41 :: NontermIdent -> NontermIdent
rule41 = \ ((NontermIdent
_lhsInt) :: NontermIdent) ->
     NontermIdent
_lhsInt
   {-# INLINE rule42 #-}
   rule42 :: Options -> Options
rule42 = \ ((Options
_lhsIoptions) :: Options) ->
     Options
_lhsIoptions
{-# NOINLINE sem_EChildren_Nil #-}
sem_EChildren_Nil ::  T_EChildren 
sem_EChildren_Nil :: T_EChildren
sem_EChildren_Nil  = Identity T_EChildren_s5 -> T_EChildren
T_EChildren (forall (m :: * -> *) a. Monad m => a -> m a
return T_EChildren_s5
st5) where
   {-# NOINLINE st5 #-}
   st5 :: T_EChildren_s5
st5 = let
      v4 :: T_EChildren_v4 
      v4 :: T_EChildren_v4
v4 = \ (T_EChildren_vIn4 Map NontermIdent Int
_lhsIallInitStates NontermIdent
_lhsIcon String
_lhsImainFile String
_lhsImainName NontermIdent
_lhsInt Options
_lhsIoptions) -> ( let
         _lhsOargnamesw :: [PP_Doc]
         _lhsOargnamesw :: [PP_Doc]
_lhsOargnamesw = forall {a}. () -> [a]
rule43  ()
         _lhsOchildTypes :: Map Identifier Type
         _lhsOchildTypes :: Attributes
_lhsOchildTypes = () -> Attributes
rule44  ()
         _lhsOchildintros :: Map Identifier (VisitKind -> Either Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
         _lhsOchildintros :: Map
  NontermIdent
  (VisitKind
   -> Either
        Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
_lhsOchildintros = forall {k} {a}. () -> Map k a
rule45  ()
         _lhsOsigs :: [(PP_Doc,PP_Doc,PP_Doc,PP_Doc)]
         _lhsOsigs :: [(PP_Doc, PP_Doc, PP_Doc, PP_Doc)]
_lhsOsigs = forall {a}. () -> [a]
rule46  ()
         _lhsOterminaldefs :: Set String
         _lhsOterminaldefs :: Set String
_lhsOterminaldefs = forall {a}. () -> Set a
rule47  ()
         __result_ :: T_EChildren_vOut4
__result_ = [PP_Doc]
-> Attributes
-> Map
     NontermIdent
     (VisitKind
      -> Either
           Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
-> [(PP_Doc, PP_Doc, PP_Doc, PP_Doc)]
-> Set String
-> T_EChildren_vOut4
T_EChildren_vOut4 [PP_Doc]
_lhsOargnamesw Attributes
_lhsOchildTypes Map
  NontermIdent
  (VisitKind
   -> Either
        Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
_lhsOchildintros [(PP_Doc, PP_Doc, PP_Doc, PP_Doc)]
_lhsOsigs Set String
_lhsOterminaldefs
         in T_EChildren_vOut4
__result_ )
     in T_EChildren_v4 -> T_EChildren_s5
C_EChildren_s5 T_EChildren_v4
v4
   {-# INLINE rule43 #-}
   rule43 :: () -> [a]
rule43 = \  (()
_ :: ()) ->
     []
   {-# INLINE rule44 #-}
   rule44 :: () -> Attributes
rule44 = \  (()
_ :: ()) ->
     forall a. Monoid a => a
mempty
   {-# INLINE rule45 #-}
   rule45 :: () -> Map k a
rule45 = \  (()
_ :: ()) ->
     forall k a. Map k a
Map.empty
   {-# INLINE rule46 #-}
   rule46 :: () -> [a]
rule46 = \  (()
_ :: ()) ->
     []
   {-# INLINE rule47 #-}
   rule47 :: () -> Set a
rule47 = \  (()
_ :: ()) ->
     forall a. Set a
Set.empty

-- ENonterminal ------------------------------------------------
-- wrapper
data Inh_ENonterminal  = Inh_ENonterminal { Inh_ENonterminal -> Map Int (Int, Int)
allFromToStates_Inh_ENonterminal :: (Map VisitIdentifier (Int,Int)), Inh_ENonterminal -> Map NontermIdent Int
allInitStates_Inh_ENonterminal :: (Map NontermIdent Int), Inh_ENonterminal -> Map Int VisitKind
allVisitKinds_Inh_ENonterminal :: (Map VisitIdentifier VisitKind), Inh_ENonterminal
-> Map
     Int
     (NontermIdent
      -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
allchildvisit_Inh_ENonterminal :: (Map VisitIdentifier (Identifier -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)), Inh_ENonterminal -> Map Int (Set NontermIdent)
avisitdefs_Inh_ENonterminal :: (Map VisitIdentifier (Set Identifier)), Inh_ENonterminal -> Map Int (Set NontermIdent)
avisituses_Inh_ENonterminal :: (Map VisitIdentifier (Set Identifier)), Inh_ENonterminal -> Map NontermIdent Attributes
inhmap_Inh_ENonterminal :: (Map NontermIdent Attributes), Inh_ENonterminal -> Map NontermIdent (Map NontermIdent Attributes)
localAttrTypes_Inh_ENonterminal :: (Map NontermIdent (Map ConstructorIdent (Map Identifier Type))), Inh_ENonterminal -> String
mainFile_Inh_ENonterminal :: (String), Inh_ENonterminal -> String
mainName_Inh_ENonterminal :: (String), Inh_ENonterminal -> Options
options_Inh_ENonterminal :: (Options), Inh_ENonterminal -> Map NontermIdent Attributes
synmap_Inh_ENonterminal :: (Map NontermIdent Attributes), Inh_ENonterminal -> TypeSyns
typeSyns_Inh_ENonterminal :: (TypeSyns), Inh_ENonterminal -> Set NontermIdent
wrappers_Inh_ENonterminal :: (Set NontermIdent) }
data Syn_ENonterminal  = Syn_ENonterminal { Syn_ENonterminal
-> Map
     Int
     (NontermIdent
      -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
childvisit_Syn_ENonterminal :: (Map VisitIdentifier (Identifier -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)), Syn_ENonterminal -> PP_Doc
code_Syn_ENonterminal :: (PP_Doc), Syn_ENonterminal -> PP_Doc
datas_Syn_ENonterminal :: (PP_Doc), Syn_ENonterminal -> Seq Error
errors_Syn_ENonterminal :: (Seq Error), Syn_ENonterminal -> Map Int (Int, Int)
fromToStates_Syn_ENonterminal :: (Map VisitIdentifier (Int,Int)), Syn_ENonterminal -> Map NontermIdent Int
initStates_Syn_ENonterminal :: (Map NontermIdent Int), Syn_ENonterminal -> PP_Doc
modules_Syn_ENonterminal :: (PP_Doc), Syn_ENonterminal -> Seq PP_Doc
semFunBndDefs_Syn_ENonterminal :: (Seq PP_Doc), Syn_ENonterminal -> Seq PP_Doc
semFunBndTps_Syn_ENonterminal :: (Seq PP_Doc), Syn_ENonterminal -> Map Int VisitKind
visitKinds_Syn_ENonterminal :: (Map VisitIdentifier VisitKind), Syn_ENonterminal -> Map Int (Set NontermIdent)
visitdefs_Syn_ENonterminal :: (Map VisitIdentifier (Set Identifier)), Syn_ENonterminal -> Map Int (Set NontermIdent)
visituses_Syn_ENonterminal :: (Map VisitIdentifier (Set Identifier)) }
{-# INLINABLE wrap_ENonterminal #-}
wrap_ENonterminal :: T_ENonterminal  -> Inh_ENonterminal  -> (Syn_ENonterminal )
wrap_ENonterminal :: T_ENonterminal -> Inh_ENonterminal -> Syn_ENonterminal
wrap_ENonterminal (T_ENonterminal Identity T_ENonterminal_s8
act) (Inh_ENonterminal Map Int (Int, Int)
_lhsIallFromToStates Map NontermIdent Int
_lhsIallInitStates Map Int VisitKind
_lhsIallVisitKinds Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_lhsIallchildvisit Map Int (Set NontermIdent)
_lhsIavisitdefs Map Int (Set NontermIdent)
_lhsIavisituses Map NontermIdent Attributes
_lhsIinhmap Map NontermIdent (Map NontermIdent Attributes)
_lhsIlocalAttrTypes String
_lhsImainFile String
_lhsImainName Options
_lhsIoptions Map NontermIdent Attributes
_lhsIsynmap TypeSyns
_lhsItypeSyns Set NontermIdent
_lhsIwrappers) =
   forall a. Identity a -> a
Control.Monad.Identity.runIdentity (
     do T_ENonterminal_s8
sem <- Identity T_ENonterminal_s8
act
        let arg7 :: T_ENonterminal_vIn7
arg7 = Map Int (Int, Int)
-> Map NontermIdent Int
-> Map Int VisitKind
-> Map
     Int
     (NontermIdent
      -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
-> Map Int (Set NontermIdent)
-> Map Int (Set NontermIdent)
-> Map NontermIdent Attributes
-> Map NontermIdent (Map NontermIdent Attributes)
-> String
-> String
-> Options
-> Map NontermIdent Attributes
-> TypeSyns
-> Set NontermIdent
-> T_ENonterminal_vIn7
T_ENonterminal_vIn7 Map Int (Int, Int)
_lhsIallFromToStates Map NontermIdent Int
_lhsIallInitStates Map Int VisitKind
_lhsIallVisitKinds Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_lhsIallchildvisit Map Int (Set NontermIdent)
_lhsIavisitdefs Map Int (Set NontermIdent)
_lhsIavisituses Map NontermIdent Attributes
_lhsIinhmap Map NontermIdent (Map NontermIdent Attributes)
_lhsIlocalAttrTypes String
_lhsImainFile String
_lhsImainName Options
_lhsIoptions Map NontermIdent Attributes
_lhsIsynmap TypeSyns
_lhsItypeSyns Set NontermIdent
_lhsIwrappers
        (T_ENonterminal_vOut7 Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_lhsOchildvisit PP_Doc
_lhsOcode PP_Doc
_lhsOdatas Seq Error
_lhsOerrors Map Int (Int, Int)
_lhsOfromToStates Map NontermIdent Int
_lhsOinitStates PP_Doc
_lhsOmodules Seq PP_Doc
_lhsOsemFunBndDefs Seq PP_Doc
_lhsOsemFunBndTps Map Int VisitKind
_lhsOvisitKinds Map Int (Set NontermIdent)
_lhsOvisitdefs Map Int (Set NontermIdent)
_lhsOvisituses) <- forall (m :: * -> *) a. Monad m => a -> m a
return (T_ENonterminal_s8 -> T_ENonterminal_v7
inv_ENonterminal_s8 T_ENonterminal_s8
sem T_ENonterminal_vIn7
arg7)
        forall (m :: * -> *) a. Monad m => a -> m a
return (Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
-> PP_Doc
-> PP_Doc
-> Seq Error
-> Map Int (Int, Int)
-> Map NontermIdent Int
-> PP_Doc
-> Seq PP_Doc
-> Seq PP_Doc
-> Map Int VisitKind
-> Map Int (Set NontermIdent)
-> Map Int (Set NontermIdent)
-> Syn_ENonterminal
Syn_ENonterminal Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_lhsOchildvisit PP_Doc
_lhsOcode PP_Doc
_lhsOdatas Seq Error
_lhsOerrors Map Int (Int, Int)
_lhsOfromToStates Map NontermIdent Int
_lhsOinitStates PP_Doc
_lhsOmodules Seq PP_Doc
_lhsOsemFunBndDefs Seq PP_Doc
_lhsOsemFunBndTps Map Int VisitKind
_lhsOvisitKinds Map Int (Set NontermIdent)
_lhsOvisitdefs Map Int (Set NontermIdent)
_lhsOvisituses)
   )

-- cata
{-# INLINE sem_ENonterminal #-}
sem_ENonterminal :: ENonterminal  -> T_ENonterminal 
sem_ENonterminal :: ENonterminal -> T_ENonterminal
sem_ENonterminal ( ENonterminal NontermIdent
nt_ [NontermIdent]
params_ ClassContext
classCtxs_ Int
initial_ [Int]
initialv_ Map Int StateCtx
nextVisits_ Map Int StateCtx
prevVisits_ EProductions
prods_ Bool
recursive_ HigherOrderInfo
hoInfo_ ) = NontermIdent
-> [NontermIdent]
-> ClassContext
-> Int
-> [Int]
-> Map Int StateCtx
-> Map Int StateCtx
-> T_EProductions
-> Bool
-> HigherOrderInfo
-> T_ENonterminal
sem_ENonterminal_ENonterminal NontermIdent
nt_ [NontermIdent]
params_ ClassContext
classCtxs_ Int
initial_ [Int]
initialv_ Map Int StateCtx
nextVisits_ Map Int StateCtx
prevVisits_ ( EProductions -> T_EProductions
sem_EProductions EProductions
prods_ ) Bool
recursive_ HigherOrderInfo
hoInfo_

-- semantic domain
newtype T_ENonterminal  = T_ENonterminal {
                                         T_ENonterminal -> Identity T_ENonterminal_s8
attach_T_ENonterminal :: Identity (T_ENonterminal_s8 )
                                         }
newtype T_ENonterminal_s8  = C_ENonterminal_s8 {
                                               T_ENonterminal_s8 -> T_ENonterminal_v7
inv_ENonterminal_s8 :: (T_ENonterminal_v7 )
                                               }
data T_ENonterminal_s9  = C_ENonterminal_s9
type T_ENonterminal_v7  = (T_ENonterminal_vIn7 ) -> (T_ENonterminal_vOut7 )
data T_ENonterminal_vIn7  = T_ENonterminal_vIn7 (Map VisitIdentifier (Int,Int)) (Map NontermIdent Int) (Map VisitIdentifier VisitKind) (Map VisitIdentifier (Identifier -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)) (Map VisitIdentifier (Set Identifier)) (Map VisitIdentifier (Set Identifier)) (Map NontermIdent Attributes) (Map NontermIdent (Map ConstructorIdent (Map Identifier Type))) (String) (String) (Options) (Map NontermIdent Attributes) (TypeSyns) (Set NontermIdent)
data T_ENonterminal_vOut7  = T_ENonterminal_vOut7 (Map VisitIdentifier (Identifier -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)) (PP_Doc) (PP_Doc) (Seq Error) (Map VisitIdentifier (Int,Int)) (Map NontermIdent Int) (PP_Doc) (Seq PP_Doc) (Seq PP_Doc) (Map VisitIdentifier VisitKind) (Map VisitIdentifier (Set Identifier)) (Map VisitIdentifier (Set Identifier))
{-# NOINLINE sem_ENonterminal_ENonterminal #-}
sem_ENonterminal_ENonterminal :: (NontermIdent) -> ([Identifier]) -> (ClassContext) -> (StateIdentifier) -> ([VisitIdentifier]) -> (Map StateIdentifier StateCtx) -> (Map StateIdentifier StateCtx) -> T_EProductions  -> (Bool) -> (HigherOrderInfo) -> T_ENonterminal 
sem_ENonterminal_ENonterminal :: NontermIdent
-> [NontermIdent]
-> ClassContext
-> Int
-> [Int]
-> Map Int StateCtx
-> Map Int StateCtx
-> T_EProductions
-> Bool
-> HigherOrderInfo
-> T_ENonterminal
sem_ENonterminal_ENonterminal NontermIdent
arg_nt_ [NontermIdent]
arg_params_ ClassContext
_ Int
arg_initial_ [Int]
arg_initialv_ Map Int StateCtx
arg_nextVisits_ Map Int StateCtx
arg_prevVisits_ T_EProductions
arg_prods_ Bool
_ HigherOrderInfo
_ = Identity T_ENonterminal_s8 -> T_ENonterminal
T_ENonterminal (forall (m :: * -> *) a. Monad m => a -> m a
return T_ENonterminal_s8
st8) where
   {-# NOINLINE st8 #-}
   st8 :: T_ENonterminal_s8
st8 = let
      v7 :: T_ENonterminal_v7 
      v7 :: T_ENonterminal_v7
v7 = \ (T_ENonterminal_vIn7 Map Int (Int, Int)
_lhsIallFromToStates Map NontermIdent Int
_lhsIallInitStates Map Int VisitKind
_lhsIallVisitKinds Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_lhsIallchildvisit Map Int (Set NontermIdent)
_lhsIavisitdefs Map Int (Set NontermIdent)
_lhsIavisituses Map NontermIdent Attributes
_lhsIinhmap Map NontermIdent (Map NontermIdent Attributes)
_lhsIlocalAttrTypes String
_lhsImainFile String
_lhsImainName Options
_lhsIoptions Map NontermIdent Attributes
_lhsIsynmap TypeSyns
_lhsItypeSyns Set NontermIdent
_lhsIwrappers) -> ( let
         _prodsX17 :: T_EProductions_s17
_prodsX17 = forall a. Identity a -> a
Control.Monad.Identity.runIdentity (T_EProductions -> Identity T_EProductions_s17
attach_T_EProductions (T_EProductions
arg_prods_))
         (T_EProductions_vOut16 [VisitStateState]
_prodsIallvisits Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_prodsIchildvisit Int
_prodsIcount [PP_Doc]
_prodsIdatatype [PP_Doc]
_prodsIdatatype_call [PP_Doc]
_prodsIdatatype_con Seq Error
_prodsIerrors Map Int (Int, Int)
_prodsIfromToStates Seq PP_Doc
_prodsIsemFunBndDefs Seq PP_Doc
_prodsIsemFunBndTps PP_Doc
_prodsIsem_nt PP_Doc
_prodsIsem_prod PP_Doc
_prodsIt_visits Map Int VisitKind
_prodsIvisitKinds Map Int (Set NontermIdent)
_prodsIvisitdefs Map Int (Set NontermIdent)
_prodsIvisituses) = T_EProductions_s17 -> T_EProductions_v16
inv_EProductions_s17 T_EProductions_s17
_prodsX17 (Map Int (Int, Int)
-> Map NontermIdent Attributes
-> Map NontermIdent Int
-> Map NontermIdent Attributes
-> Map Int VisitKind
-> Map
     Int
     (NontermIdent
      -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
-> [Int]
-> Map Int (Set NontermIdent)
-> Map Int (Set NontermIdent)
-> Attributes
-> Int
-> Map NontermIdent Attributes
-> String
-> String
-> Map Int StateCtx
-> NontermIdent
-> Type
-> Options
-> [NontermIdent]
-> Map Int StateCtx
-> Bool
-> Attributes
-> T_EProductions_vIn16
T_EProductions_vIn16 Map Int (Int, Int)
_prodsOallFromToStates Map NontermIdent Attributes
_prodsOallInhmap Map NontermIdent Int
_prodsOallInitStates Map NontermIdent Attributes
_prodsOallSynmap Map Int VisitKind
_prodsOallVisitKinds Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_prodsOallchildvisit [Int]
_prodsOallstates Map Int (Set NontermIdent)
_prodsOavisitdefs Map Int (Set NontermIdent)
_prodsOavisituses Attributes
_prodsOinhmap Int
_prodsOinitial Map NontermIdent Attributes
_prodsOlocalAttrTypes String
_prodsOmainFile String
_prodsOmainName Map Int StateCtx
_prodsOnextVisits NontermIdent
_prodsOnt Type
_prodsOntType Options
_prodsOoptions [NontermIdent]
_prodsOparams Map Int StateCtx
_prodsOprevVisits Bool
_prodsOrename Attributes
_prodsOsynmap)
         _prodsOrename :: Bool
_prodsOrename = Options -> Bool
rule48 Options
_lhsIoptions
         _prodsOnt :: NontermIdent
_prodsOnt = forall a. a -> a
rule49 NontermIdent
arg_nt_
         _prodsOparams :: [NontermIdent]
_prodsOparams = forall a. a -> a
rule50 [NontermIdent]
arg_params_
         _lhsOdatas :: PP_Doc
         _lhsOdatas :: PP_Doc
_lhsOdatas = PP_Doc
-> PP_Doc
-> PP_Doc
-> Bool
-> Options
-> PP_Doc
-> PP_Doc
-> PP_Doc
-> PP_Doc
-> PP_Doc
-> NontermIdent
-> PP_Doc
rule51 PP_Doc
_c_states PP_Doc
_datatypeNt PP_Doc
_datatypeProds Bool
_hasWrapper Options
_lhsIoptions PP_Doc
_prodsIt_visits PP_Doc
_t_init PP_Doc
_t_states PP_Doc
_wr_inh PP_Doc
_wr_syn NontermIdent
arg_nt_
         _lhsOcode :: PP_Doc
         _lhsOcode :: PP_Doc
_lhsOcode = PP_Doc
-> Bool
-> Options
-> PP_Doc
-> PP_Doc
-> PP_Doc
-> NontermIdent
-> PP_Doc
rule52 PP_Doc
_datatypeCon Bool
_hasWrapper Options
_lhsIoptions PP_Doc
_prodsIsem_prod PP_Doc
_sem_nt PP_Doc
_wrapper NontermIdent
arg_nt_
         _lhsOmodules :: PP_Doc
         _lhsOmodules :: PP_Doc
_lhsOmodules = forall a. a -> a
rule53 PP_Doc
_moduleDecl
         _hasWrapper :: Bool
_hasWrapper = Set NontermIdent -> NontermIdent -> Bool
rule54 Set NontermIdent
_lhsIwrappers NontermIdent
arg_nt_
         _t_params :: PP_Doc
_t_params = [NontermIdent] -> PP_Doc
rule55 [NontermIdent]
arg_params_
         _aliasPre :: PP_Doc
_aliasPre = PP_Doc -> NontermIdent -> PP_Doc
rule56 PP_Doc
_t_params NontermIdent
arg_nt_
         _aliasMod :: PP_Doc
_aliasMod = PP_Doc -> NontermIdent -> PP_Doc
rule57 PP_Doc
_aliasPre NontermIdent
arg_nt_
         _datatypeNt :: PP_Doc
_datatypeNt = PP_Doc
-> PP_Doc
-> TypeSyns
-> [PP_Doc]
-> [PP_Doc]
-> PP_Doc
-> NontermIdent
-> PP_Doc
rule58 PP_Doc
_aliasMod PP_Doc
_aliasPre TypeSyns
_lhsItypeSyns [PP_Doc]
_prodsIdatatype [PP_Doc]
_prodsIdatatype_call PP_Doc
_t_params NontermIdent
arg_nt_
         _datatypeCon :: PP_Doc
_datatypeCon = TypeSyns -> [PP_Doc] -> NontermIdent -> PP_Doc
rule59 TypeSyns
_lhsItypeSyns [PP_Doc]
_prodsIdatatype_con NontermIdent
arg_nt_
         _moduleDecl :: PP_Doc
_moduleDecl = TypeSyns -> NontermIdent -> PP_Doc
rule60 TypeSyns
_lhsItypeSyns NontermIdent
arg_nt_
         _datatypeProds :: PP_Doc
_datatypeProds = [PP_Doc] -> PP_Doc
rule61 [PP_Doc]
_prodsIdatatype
         _fsemname :: NontermIdent -> String
_fsemname = Options -> NontermIdent -> String
rule62 Options
_lhsIoptions
         _semname :: String
_semname = forall {t} {t}. (t -> t) -> t -> t
rule63 NontermIdent -> String
_fsemname NontermIdent
arg_nt_
         _frecarg :: Type -> PP_Doc -> PP_Doc
_frecarg = (NontermIdent -> String) -> Type -> PP_Doc -> PP_Doc
rule64 NontermIdent -> String
_fsemname
         _sem_param_tp :: PP_Doc
_sem_param_tp = PP_Doc -> NontermIdent -> PP_Doc
rule65 PP_Doc
_t_params NontermIdent
arg_nt_
         _sem_res_tp :: PP_Doc
_sem_res_tp = PP_Doc -> PP_Doc -> PP_Doc
rule66 PP_Doc
_t_params PP_Doc
_t_type
         _sem_tp :: PP_Doc
_sem_tp = PP_Doc -> PP_Doc -> PP_Doc
rule67 PP_Doc
_sem_param_tp PP_Doc
_sem_res_tp
         _o_sigs :: Bool
_o_sigs = Options -> Bool
rule68 Options
_lhsIoptions
         _sem_nt_body :: PP_Doc
_sem_nt_body = PP_Doc -> PP_Doc
rule69 PP_Doc
_prodsIsem_nt
         _sem_nt :: PP_Doc
_sem_nt = (Type -> PP_Doc -> PP_Doc)
-> (NontermIdent -> String)
-> TypeSyns
-> Bool
-> PP_Doc
-> PP_Doc
-> PP_Doc
-> String
-> NontermIdent
-> PP_Doc
rule70 Type -> PP_Doc -> PP_Doc
_frecarg NontermIdent -> String
_fsemname TypeSyns
_lhsItypeSyns Bool
_o_sigs PP_Doc
_sem_nt_body PP_Doc
_sem_param_tp PP_Doc
_sem_res_tp String
_semname NontermIdent
arg_nt_
         (Just Attributes
_prodsOinhmap) = Map NontermIdent Attributes -> NontermIdent -> Maybe Attributes
rule71 Map NontermIdent Attributes
_lhsIinhmap NontermIdent
arg_nt_
         (Just Attributes
_prodsOsynmap) = Map NontermIdent Attributes -> NontermIdent -> Maybe Attributes
rule72 Map NontermIdent Attributes
_lhsIsynmap NontermIdent
arg_nt_
         _prodsOallInhmap :: Map NontermIdent Attributes
_prodsOallInhmap = Map NontermIdent Attributes -> Map NontermIdent Attributes
rule73 Map NontermIdent Attributes
_lhsIinhmap
         _prodsOallSynmap :: Map NontermIdent Attributes
_prodsOallSynmap = Map NontermIdent Attributes -> Map NontermIdent Attributes
rule74 Map NontermIdent Attributes
_lhsIsynmap
         _allstates :: [Int]
_allstates = [VisitStateState] -> Int -> [Int]
rule75 [VisitStateState]
_prodsIallvisits Int
arg_initial_
         _stvisits :: Int -> [VisitStateState]
_stvisits = [VisitStateState] -> Int -> [VisitStateState]
rule76 [VisitStateState]
_prodsIallvisits
         _t_type :: PP_Doc
_t_type = NontermIdent -> PP_Doc
rule77 NontermIdent
arg_nt_
         _t_c_params :: PP_Doc
_t_c_params = [NontermIdent] -> PP_Doc
rule78 [NontermIdent]
arg_params_
         _t_init :: PP_Doc
_t_init = PP_Doc -> PP_Doc -> Int -> NontermIdent -> PP_Doc
rule79 PP_Doc
_t_params PP_Doc
_t_type Int
arg_initial_ NontermIdent
arg_nt_
         _t_states :: PP_Doc
_t_states = [Int]
-> PP_Doc -> PP_Doc -> Map Int StateCtx -> NontermIdent -> PP_Doc
rule80 [Int]
_allstates PP_Doc
_t_c_params PP_Doc
_t_params Map Int StateCtx
arg_nextVisits_ NontermIdent
arg_nt_
         _c_states :: PP_Doc
_c_states = [Int]
-> [VisitStateState]
-> PP_Doc
-> Map Int StateCtx
-> NontermIdent
-> PP_Doc
rule81 [Int]
_allstates [VisitStateState]
_prodsIallvisits PP_Doc
_t_c_params Map Int StateCtx
arg_nextVisits_ NontermIdent
arg_nt_
         _wr_inh :: PP_Doc
_wr_inh = forall {t} {t}. (String -> t -> t) -> t -> t
rule82 String -> [(NontermIdent, Type)] -> PP_Doc
_genwrap [(NontermIdent, Type)]
_wr_inhs1
         _wr_syn :: PP_Doc
_wr_syn = forall {t} {t}. (String -> t -> t) -> t -> t
rule83 String -> [(NontermIdent, Type)] -> PP_Doc
_genwrap [(NontermIdent, Type)]
_wr_syns
         _genwrap :: String -> [(NontermIdent, Type)] -> PP_Doc
_genwrap = PP_Doc
-> NontermIdent -> String -> [(NontermIdent, Type)] -> PP_Doc
rule84 PP_Doc
_t_params NontermIdent
arg_nt_
         _inhAttrs :: Attributes
_inhAttrs = Map NontermIdent Attributes -> NontermIdent -> Attributes
rule85 Map NontermIdent Attributes
_lhsIinhmap NontermIdent
arg_nt_
         _wr_inhs :: [(NontermIdent, Type)]
_wr_inhs = forall {p} {k} {a}. p -> (p -> Map k a) -> [(k, a)]
rule86 Attributes
_inhAttrs Attributes -> Attributes
_wr_filter
         _wr_inhs1 :: [(NontermIdent, Type)]
_wr_inhs1 = forall k a. Map k a -> [(k, a)]
rule87 Attributes
_inhAttrs
         _wr_filter :: Attributes -> Attributes
_wr_filter = forall {a}. Options -> Map NontermIdent a -> Map NontermIdent a
rule88 Options
_lhsIoptions
         _wr_syns :: [(NontermIdent, Type)]
_wr_syns = Map NontermIdent Attributes
-> NontermIdent -> [(NontermIdent, Type)]
rule89 Map NontermIdent Attributes
_lhsIsynmap NontermIdent
arg_nt_
         _wrapname :: PP_Doc
_wrapname = NontermIdent -> PP_Doc
rule90 NontermIdent
arg_nt_
         _inhname :: PP_Doc
_inhname = NontermIdent -> PP_Doc
rule91 NontermIdent
arg_nt_
         _synname :: PP_Doc
_synname = NontermIdent -> PP_Doc
rule92 NontermIdent
arg_nt_
         _firstVisitInfo :: StateCtx
_firstVisitInfo = Int -> Map Int StateCtx -> StateCtx
rule93 Int
arg_initial_ Map Int StateCtx
arg_nextVisits_
         _wrapArgSemTp :: PP_Doc
_wrapArgSemTp = PP_Doc -> PP_Doc -> PP_Doc
rule94 PP_Doc
_t_params PP_Doc
_t_type
         _wrapArgInhTp :: PP_Doc
_wrapArgInhTp = PP_Doc -> PP_Doc -> PP_Doc
rule95 PP_Doc
_inhname PP_Doc
_t_params
         _wrapArgPats :: PP_Doc
_wrapArgPats = forall {b}.
Options -> [(NontermIdent, b)] -> NontermIdent -> PP_Doc
rule96 Options
_lhsIoptions [(NontermIdent, Type)]
_wr_inhs1 NontermIdent
arg_nt_
         _wrapResTp :: PP_Doc
_wrapResTp = PP_Doc -> PP_Doc -> PP_Doc
rule97 PP_Doc
_synname PP_Doc
_t_params
         _wrapper :: PP_Doc
_wrapper = Bool
-> PP_Doc
-> PP_Doc
-> PP_Doc
-> PP_Doc
-> PP_Doc
-> PP_Doc
-> PP_Doc
rule98 Bool
_o_sigs PP_Doc
_wrapArgInhTp PP_Doc
_wrapArgPats PP_Doc
_wrapArgSemTp PP_Doc
_wrapResTp PP_Doc
_wrapname PP_Doc
_wrapperPreamble
         _wrapperPreamble :: PP_Doc
_wrapperPreamble = String -> Options -> PP_Doc -> PP_Doc
rule99 String
_lhsImainName Options
_lhsIoptions PP_Doc
_wrapperBody
         _wrapperBody :: PP_Doc
_wrapperBody = forall {b} {b}.
StateCtx
-> Options
-> [(NontermIdent, b)]
-> [(NontermIdent, b)]
-> Int
-> [Int]
-> NontermIdent
-> PP_Doc
rule100 StateCtx
_firstVisitInfo Options
_lhsIoptions [(NontermIdent, Type)]
_wr_inhs [(NontermIdent, Type)]
_wr_syns Int
arg_initial_ [Int]
arg_initialv_ NontermIdent
arg_nt_
         _lhsOsemFunBndDefs :: Seq PP_Doc
         _lhsOsemFunBndDefs :: Seq PP_Doc
_lhsOsemFunBndDefs = Seq PP_Doc -> PP_Doc -> Seq PP_Doc
rule101 Seq PP_Doc
_prodsIsemFunBndDefs PP_Doc
_semFunBndDef
         _lhsOsemFunBndTps :: Seq PP_Doc
         _lhsOsemFunBndTps :: Seq PP_Doc
_lhsOsemFunBndTps = Seq PP_Doc -> PP_Doc -> Seq PP_Doc
rule102 Seq PP_Doc
_prodsIsemFunBndTps PP_Doc
_semFunBndTp
         _semFunBndDef :: PP_Doc
_semFunBndDef = String -> String -> PP_Doc
rule103 String
_semFunBndNm String
_semname
         _semFunBndTp :: PP_Doc
_semFunBndTp = String -> PP_Doc -> PP_Doc
rule104 String
_semFunBndNm PP_Doc
_sem_tp
         _semFunBndNm :: String
_semFunBndNm = NontermIdent -> String
rule105 NontermIdent
arg_nt_
         _prodsOinitial :: Int
_prodsOinitial = forall a. a -> a
rule106 Int
arg_initial_
         _prodsOallstates :: [Int]
_prodsOallstates = forall a. a -> a
rule107 [Int]
_allstates
         _prodsOnextVisits :: Map Int StateCtx
_prodsOnextVisits = forall a. a -> a
rule108 Map Int StateCtx
arg_nextVisits_
         _prodsOprevVisits :: Map Int StateCtx
_prodsOprevVisits = forall a. a -> a
rule109 Map Int StateCtx
arg_prevVisits_
         _prodsOlocalAttrTypes :: Map NontermIdent Attributes
_prodsOlocalAttrTypes = Map NontermIdent (Map NontermIdent Attributes)
-> NontermIdent -> Map NontermIdent Attributes
rule110 Map NontermIdent (Map NontermIdent Attributes)
_lhsIlocalAttrTypes NontermIdent
arg_nt_
         _lhsOinitStates :: Map NontermIdent Int
         _lhsOinitStates :: Map NontermIdent Int
_lhsOinitStates = forall {a} {k}. a -> k -> Map k a
rule111 Int
arg_initial_ NontermIdent
arg_nt_
         _ntType :: Type
_ntType = NontermIdent -> [NontermIdent] -> Type
rule112 NontermIdent
arg_nt_ [NontermIdent]
arg_params_
         _lhsOchildvisit :: Map VisitIdentifier (Identifier -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
         _lhsOchildvisit :: Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_lhsOchildvisit = Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
-> Map
     Int
     (NontermIdent
      -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
rule113 Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_prodsIchildvisit
         _lhsOerrors :: Seq Error
         _lhsOerrors :: Seq Error
_lhsOerrors = Seq Error -> Seq Error
rule114 Seq Error
_prodsIerrors
         _lhsOfromToStates :: Map VisitIdentifier (Int,Int)
         _lhsOfromToStates :: Map Int (Int, Int)
_lhsOfromToStates = Map Int (Int, Int) -> Map Int (Int, Int)
rule115 Map Int (Int, Int)
_prodsIfromToStates
         _lhsOvisitKinds :: Map VisitIdentifier VisitKind
         _lhsOvisitKinds :: Map Int VisitKind
_lhsOvisitKinds = Map Int VisitKind -> Map Int VisitKind
rule116 Map Int VisitKind
_prodsIvisitKinds
         _lhsOvisitdefs :: Map VisitIdentifier (Set Identifier)
         _lhsOvisitdefs :: Map Int (Set NontermIdent)
_lhsOvisitdefs = Map Int (Set NontermIdent) -> Map Int (Set NontermIdent)
rule117 Map Int (Set NontermIdent)
_prodsIvisitdefs
         _lhsOvisituses :: Map VisitIdentifier (Set Identifier)
         _lhsOvisituses :: Map Int (Set NontermIdent)
_lhsOvisituses = Map Int (Set NontermIdent) -> Map Int (Set NontermIdent)
rule118 Map Int (Set NontermIdent)
_prodsIvisituses
         _prodsOallFromToStates :: Map Int (Int, Int)
_prodsOallFromToStates = Map Int (Int, Int) -> Map Int (Int, Int)
rule119 Map Int (Int, Int)
_lhsIallFromToStates
         _prodsOallInitStates :: Map NontermIdent Int
_prodsOallInitStates = Map NontermIdent Int -> Map NontermIdent Int
rule120 Map NontermIdent Int
_lhsIallInitStates
         _prodsOallVisitKinds :: Map Int VisitKind
_prodsOallVisitKinds = Map Int VisitKind -> Map Int VisitKind
rule121 Map Int VisitKind
_lhsIallVisitKinds
         _prodsOallchildvisit :: Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_prodsOallchildvisit = Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
-> Map
     Int
     (NontermIdent
      -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
rule122 Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_lhsIallchildvisit
         _prodsOavisitdefs :: Map Int (Set NontermIdent)
_prodsOavisitdefs = Map Int (Set NontermIdent) -> Map Int (Set NontermIdent)
rule123 Map Int (Set NontermIdent)
_lhsIavisitdefs
         _prodsOavisituses :: Map Int (Set NontermIdent)
_prodsOavisituses = Map Int (Set NontermIdent) -> Map Int (Set NontermIdent)
rule124 Map Int (Set NontermIdent)
_lhsIavisituses
         _prodsOmainFile :: String
_prodsOmainFile = String -> String
rule125 String
_lhsImainFile
         _prodsOmainName :: String
_prodsOmainName = String -> String
rule126 String
_lhsImainName
         _prodsOntType :: Type
_prodsOntType = forall a. a -> a
rule127 Type
_ntType
         _prodsOoptions :: Options
_prodsOoptions = Options -> Options
rule128 Options
_lhsIoptions
         __result_ :: T_ENonterminal_vOut7
__result_ = Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
-> PP_Doc
-> PP_Doc
-> Seq Error
-> Map Int (Int, Int)
-> Map NontermIdent Int
-> PP_Doc
-> Seq PP_Doc
-> Seq PP_Doc
-> Map Int VisitKind
-> Map Int (Set NontermIdent)
-> Map Int (Set NontermIdent)
-> T_ENonterminal_vOut7
T_ENonterminal_vOut7 Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_lhsOchildvisit PP_Doc
_lhsOcode PP_Doc
_lhsOdatas Seq Error
_lhsOerrors Map Int (Int, Int)
_lhsOfromToStates Map NontermIdent Int
_lhsOinitStates PP_Doc
_lhsOmodules Seq PP_Doc
_lhsOsemFunBndDefs Seq PP_Doc
_lhsOsemFunBndTps Map Int VisitKind
_lhsOvisitKinds Map Int (Set NontermIdent)
_lhsOvisitdefs Map Int (Set NontermIdent)
_lhsOvisituses
         in T_ENonterminal_vOut7
__result_ )
     in T_ENonterminal_v7 -> T_ENonterminal_s8
C_ENonterminal_s8 T_ENonterminal_v7
v7
   {-# INLINE rule48 #-}
   {-# LINE 78 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule48 = \ ((_lhsIoptions) :: Options) ->
                   {-# LINE 78 "src-ag/ExecutionPlan2Caml.ag" #-}
                   rename _lhsIoptions
                   {-# LINE 890 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule49 #-}
   {-# LINE 86 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule49 = \ nt_ ->
               {-# LINE 86 "src-ag/ExecutionPlan2Caml.ag" #-}
               nt_
               {-# LINE 896 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule50 #-}
   {-# LINE 96 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule50 = \ params_ ->
                   {-# LINE 96 "src-ag/ExecutionPlan2Caml.ag" #-}
                   params_
                   {-# LINE 902 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule51 #-}
   {-# LINE 115 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule51 = \ _c_states _datatypeNt _datatypeProds _hasWrapper ((_lhsIoptions) :: Options) ((_prodsIt_visits) :: PP_Doc) _t_init _t_states _wr_inh _wr_syn nt_ ->
                {-# LINE 115 "src-ag/ExecutionPlan2Caml.ag" #-}
                (    text ""
                 >-< "(* *** " ++ getName nt_ ++ " *** [data] *)")
                 >-< (if dataTypes _lhsIoptions
                      then pp "(* data *)"
                           >-< _datatypeNt
                           >-< _datatypeProds
                           >-< ""
                      else empty)
                 >-< (if _hasWrapper
                       then pp "(* wrapper *)"
                            >-< _wr_inh
                            >-< _wr_syn
                            >-< ""
                       else empty)
                 >-< (if semfuns _lhsIoptions
                      then pp "(* semantic domain *)"
                           >-< _t_init
                           >-< _t_states
                           >-< _c_states
                           >-< _prodsIt_visits
                           >-< ""
                      else empty)
                {-# LINE 929 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule52 #-}
   {-# LINE 138 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule52 = \ _datatypeCon _hasWrapper ((_lhsIoptions) :: Options) ((_prodsIsem_prod) :: PP_Doc) _sem_nt _wrapper nt_ ->
                 {-# LINE 138 "src-ag/ExecutionPlan2Caml.ag" #-}
                 (    text ""
                  >-< "(* *** " ++ getName nt_ ++ " *** [code] *)")
                  >-< (if dataTypes _lhsIoptions
                      then pp "(* constructor functions *)"
                           >-< _datatypeCon
                      else empty)
                  >-< (if _hasWrapper
                       then pp "(* wrapper *)"
                            >-< _wrapper
                            >-< ""
                       else empty)
                  >-< (if folds _lhsIoptions
                       then "(* cata *)"
                            >-< _sem_nt
                            >-< ""
                       else empty)
                  >-< (if semfuns _lhsIoptions
                       then "(* semantic domain *)"
                            >-< _prodsIsem_prod
                            >-< ""
                       else empty)
                 {-# LINE 955 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule53 #-}
   {-# LINE 163 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule53 = \ _moduleDecl ->
                  {-# LINE 163 "src-ag/ExecutionPlan2Caml.ag" #-}
                  _moduleDecl
                  {-# LINE 961 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule54 #-}
   {-# LINE 165 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule54 = \ ((_lhsIwrappers) :: Set NontermIdent) nt_ ->
                     {-# LINE 165 "src-ag/ExecutionPlan2Caml.ag" #-}
                     nt_ `Set.member` _lhsIwrappers
                     {-# LINE 967 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule55 #-}
   {-# LINE 216 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule55 = \ params_ ->
                   {-# LINE 216 "src-ag/ExecutionPlan2Caml.ag" #-}
                   ppTypeParams params_
                   {-# LINE 973 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule56 #-}
   {-# LINE 217 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule56 = \ _t_params nt_ ->
                   {-# LINE 217 "src-ag/ExecutionPlan2Caml.ag" #-}
                   "and" >#< _t_params     >#< nt_ >#< "="
                   {-# LINE 979 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule57 #-}
   {-# LINE 218 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule57 = \ _aliasPre nt_ ->
                   {-# LINE 218 "src-ag/ExecutionPlan2Caml.ag" #-}
                   _aliasPre     >#< modName nt_ >|< ".t"
                   {-# LINE 985 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule58 #-}
   {-# LINE 220 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule58 = \ _aliasMod _aliasPre ((_lhsItypeSyns) :: TypeSyns) ((_prodsIdatatype) :: [PP_Doc]) ((_prodsIdatatype_call) :: [PP_Doc]) _t_params nt_ ->
        {-# LINE 220 "src-ag/ExecutionPlan2Caml.ag" #-}
        case lookup nt_ _lhsItypeSyns of
          Just (List t)     -> _aliasPre     >#< ppTp t >#< "list"
          Just (Maybe t)    -> _aliasPre     >#< ppTp t >#< "option"
          Just (Tuple ts)   -> _aliasPre     >#< (pp_block "(" ")" " * " $ map (ppTp . snd) ts)
          Just (Map k v)    -> _aliasMod
          Just (IntMap t)   -> _aliasMod
          Just (OrdSet t)   -> _aliasMod
          Just IntSet       -> _aliasMod
          _ -> "and" >#< _t_params     >#< nt_ >#< "="
               >-< ( if null _prodsIdatatype
                     then pp "unit"
                     else indent 2 $ vlist _prodsIdatatype_call
                   )
        {-# LINE 1003 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule59 #-}
   {-# LINE 239 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule59 = \ ((_lhsItypeSyns) :: TypeSyns) ((_prodsIdatatype_con) :: [PP_Doc]) nt_ ->
        {-# LINE 239 "src-ag/ExecutionPlan2Caml.ag" #-}
        case lookup nt_ _lhsItypeSyns of
          Just _  -> empty
          Nothing -> vlist _prodsIdatatype_con
        {-# LINE 1011 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule60 #-}
   {-# LINE 244 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule60 = \ ((_lhsItypeSyns) :: TypeSyns) nt_ ->
        {-# LINE 244 "src-ag/ExecutionPlan2Caml.ag" #-}
        let ppModule :: PP a => a -> PP_Doc
            ppModule expr = "module" >#< modName nt_ >#< "="
        in case lookup nt_ _lhsItypeSyns of
             Just (Map k _)  -> ppModule ("Map.Make" >#< pp_parens (ppTp k))
             Just (IntMap _) -> ppModule ("Map.Make ()")
             Just (OrdSet t) -> ppModule ("Set.Make" >#< pp_parens (ppTp t))
             Just IntSet     -> ppModule ("Set.Make (struct  type t = int  let compare = Pervasives.compare  end)")
             _               -> empty
        {-# LINE 1024 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule61 #-}
   {-# LINE 253 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule61 = \ ((_prodsIdatatype) :: [PP_Doc]) ->
                        {-# LINE 253 "src-ag/ExecutionPlan2Caml.ag" #-}
                        vlist _prodsIdatatype
                        {-# LINE 1030 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule62 #-}
   {-# LINE 313 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule62 = \ ((_lhsIoptions) :: Options) ->
                   {-# LINE 313 "src-ag/ExecutionPlan2Caml.ag" #-}
                   \x -> prefix _lhsIoptions ++ show x
                   {-# LINE 1036 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule63 #-}
   {-# LINE 314 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule63 = \ _fsemname nt_ ->
                  {-# LINE 314 "src-ag/ExecutionPlan2Caml.ag" #-}
                  _fsemname     nt_
                  {-# LINE 1042 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule64 #-}
   {-# LINE 315 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule64 = \ _fsemname ->
                  {-# LINE 315 "src-ag/ExecutionPlan2Caml.ag" #-}
                  \t x -> case t of
                    NT nt _ _ -> pp_parens (_fsemname nt >#< x)
                    _         -> x
                  {-# LINE 1050 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule65 #-}
   {-# LINE 319 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule65 = \ _t_params nt_ ->
                       {-# LINE 319 "src-ag/ExecutionPlan2Caml.ag" #-}
                       _t_params     >#< nt_
                       {-# LINE 1056 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule66 #-}
   {-# LINE 320 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule66 = \ _t_params _t_type ->
                       {-# LINE 320 "src-ag/ExecutionPlan2Caml.ag" #-}
                       _t_params     >#< _t_type
                       {-# LINE 1062 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule67 #-}
   {-# LINE 321 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule67 = \ _sem_param_tp _sem_res_tp ->
                       {-# LINE 321 "src-ag/ExecutionPlan2Caml.ag" #-}
                       _sem_param_tp     >#< "->" >#< _sem_res_tp
                       {-# LINE 1068 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule68 #-}
   {-# LINE 323 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule68 = \ ((_lhsIoptions) :: Options) ->
                  {-# LINE 323 "src-ag/ExecutionPlan2Caml.ag" #-}
                  typeSigs _lhsIoptions
                  {-# LINE 1074 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule69 #-}
   {-# LINE 324 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule69 = \ ((_prodsIsem_nt) :: PP_Doc) ->
                      {-# LINE 324 "src-ag/ExecutionPlan2Caml.ag" #-}
                      "match arg with" >-< (indent 2 $ _prodsIsem_nt)
                      {-# LINE 1080 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule70 #-}
   {-# LINE 325 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule70 = \ _frecarg _fsemname ((_lhsItypeSyns) :: TypeSyns) _o_sigs _sem_nt_body _sem_param_tp _sem_res_tp _semname nt_ ->
                  {-# LINE 325 "src-ag/ExecutionPlan2Caml.ag" #-}
                  let genSem :: PP a => a -> PP_Doc -> PP_Doc
                      genSem nm body = "and" >#< ppFunDecl _o_sigs     (pp _semname    ) [(pp nm, _sem_param_tp    )] _sem_res_tp     body
                      genAlias alts = genSem (pp "arg") (pp "match arg with" >-< (indent 2 $ vlist $ map (pp "|" >#<) alts))
                      genMap v = let body = modName nt_ >|< ".fold" >#< _semname     >|< "_Entry" >#< _semname     >|< "_Nil" >#< els
                                     els  = case v of
                                       NT nt _ _ -> pp_parens (modName nt_ >|< ".map" >#< _fsemname     nt >#< "m")
                                       _         -> pp "m"
                                 in genSem "m" body
                      genSet mbNt = let body = "List.fold_right" >#< _semname     >|< "_Entry" >#<
                                                els (pp_parens (modName nt_ >|< ".elements" >#< "s")) >#< _semname     >|< "_Nil"
                                        els r = maybe r (\nt -> pp_parens ("List.map" >#< _fsemname     nt >#< r)) mbNt
                                    in genSem "s" body
                  in case lookup nt_ _lhsItypeSyns of
                       Just (List t) -> let body = "List.fold_right" >#< _semname     >|< "_Cons" >#< els >#< _semname     >|< "_Nil"
                                            els  = case t of
                                              NT nt _ _ -> pp_parens ("List.map" >#< _fsemname     nt >#< "list")
                                              _         -> pp "list"
                                        in genSem "list" body
                       Just (Tuple ts) -> let pat = pp_parens (ppCommas $ map fst ts)
                                              body = _semname     >|< "_Tuple" >#< ppSpaced (map (\t -> _frecarg     (snd t) (pp $ fst t)) ts)
                                          in genSem pat body
                       Just (Map _ v) -> genMap v
                       Just (IntMap v) -> genMap v
                       Just (Maybe t) -> genAlias
                           [ "None" >#< "->" >#< "=" >#< _semname     >|< "_Nothing"
                           , "Some" >#< "just" >#< "->" >#< _semname     >|< "_Just" >#< _frecarg t (pp "just")
                           ]
                       Just (OrdSet t) -> genSet $ case t of
                                            NT nt _ _ -> Just nt
                                            _         -> Nothing
                       Just (IntSet) -> genSet Nothing
                       _ -> genSem "arg" _sem_nt_body
                  {-# LINE 1117 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule71 #-}
   {-# LINE 420 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule71 = \ ((_lhsIinhmap) :: Map NontermIdent Attributes) nt_ ->
                                         {-# LINE 420 "src-ag/ExecutionPlan2Caml.ag" #-}
                                         Map.lookup nt_ _lhsIinhmap
                                         {-# LINE 1123 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule72 #-}
   {-# LINE 421 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule72 = \ ((_lhsIsynmap) :: Map NontermIdent Attributes) nt_ ->
                                         {-# LINE 421 "src-ag/ExecutionPlan2Caml.ag" #-}
                                         Map.lookup nt_ _lhsIsynmap
                                         {-# LINE 1129 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule73 #-}
   {-# LINE 422 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule73 = \ ((_lhsIinhmap) :: Map NontermIdent Attributes) ->
                                     {-# LINE 422 "src-ag/ExecutionPlan2Caml.ag" #-}
                                     _lhsIinhmap
                                     {-# LINE 1135 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule74 #-}
   {-# LINE 423 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule74 = \ ((_lhsIsynmap) :: Map NontermIdent Attributes) ->
                                     {-# LINE 423 "src-ag/ExecutionPlan2Caml.ag" #-}
                                     _lhsIsynmap
                                     {-# LINE 1141 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule75 #-}
   {-# LINE 444 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule75 = \ ((_prodsIallvisits) :: [VisitStateState]) initial_ ->
                    {-# LINE 444 "src-ag/ExecutionPlan2Caml.ag" #-}
                    orderStates initial_ _prodsIallvisits
                    {-# LINE 1147 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule76 #-}
   {-# LINE 445 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule76 = \ ((_prodsIallvisits) :: [VisitStateState]) ->
                    {-# LINE 445 "src-ag/ExecutionPlan2Caml.ag" #-}
                    \st -> filter (\(v,f,t) -> f == st) _prodsIallvisits
                    {-# LINE 1153 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule77 #-}
   {-# LINE 446 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule77 = \ nt_ ->
                    {-# LINE 446 "src-ag/ExecutionPlan2Caml.ag" #-}
                    type_nt_sem_top nt_
                    {-# LINE 1159 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule78 #-}
   {-# LINE 447 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule78 = \ params_ ->
                     {-# LINE 447 "src-ag/ExecutionPlan2Caml.ag" #-}
                     ppTypeParams (cont_tvar : map pp params_)
                     {-# LINE 1165 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule79 #-}
   {-# LINE 450 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule79 = \ _t_params _t_type initial_ nt_ ->
                    {-# LINE 450 "src-ag/ExecutionPlan2Caml.ag" #-}
                    "and" >#< _t_params     >#< _t_type     >#< "=" >#< pp_braces ( nm_attach nt_ >#< ":" >#< "unit" >#< "->" >#< _t_params     >#< type_nt_sem nt_ initial_)
                    {-# LINE 1171 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule80 #-}
   {-# LINE 453 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule80 = \ _allstates _t_c_params _t_params nextVisits_ nt_ ->
                    {-# LINE 453 "src-ag/ExecutionPlan2Caml.ag" #-}
                    vlist $ map (\st ->
                      let s_st = type_nt_state nt_ st
                          t_st  = type_nt_sem nt_ st
                          c_st  = type_caller nt_ st
                          nextVisits = Map.findWithDefault ManyVis st nextVisits_
                          decl = "and" >#< _t_params     >#< t_st >#< "="
                      in case nextVisits of
                           NoneVis    -> decl >#< "unit"
                           _          -> decl >#< ppRecordVal [ nm_invoke nt_ st >#< ":" >#< cont_tvar >#< "." >#< _t_c_params     >#< c_st >#< "->" >#< cont_tvar ]
                     ) _allstates
                    {-# LINE 1186 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule81 #-}
   {-# LINE 506 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule81 = \ _allstates ((_prodsIallvisits) :: [VisitStateState]) _t_c_params nextVisits_ nt_ ->
                   {-# LINE 506 "src-ag/ExecutionPlan2Caml.ag" #-}
                   vlist $ map (\st ->
                     let nt_st = type_nt_state nt_ st
                         c_st  = type_caller nt_ st
                         outg  = filter (\(_,f,_) -> f == st) _prodsIallvisits
                         nextVisits = Map.findWithDefault ManyVis st nextVisits_
                         declHead = "and" >#< _t_c_params     >#< c_st >#< "="
                         visitcons = vlist $ map (\(v,_,_) ->
                           "|" >#< con_visit nt_ v >#< "of" >#< _t_c_params     >#< type_caller_visit nt_ v
                          ) outg
                     in case nextVisits of
                          NoneVis  -> empty
                          OneVis v -> declHead >#< _t_c_params     >#< type_caller_visit nt_ v
                          ManyVis  -> declHead >-< indent 3 visitcons
                    ) _allstates
                   {-# LINE 1205 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule82 #-}
   {-# LINE 588 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule82 = \ _genwrap _wr_inhs1 ->
                   {-# LINE 588 "src-ag/ExecutionPlan2Caml.ag" #-}
                   _genwrap     "inh" _wr_inhs1
                   {-# LINE 1211 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule83 #-}
   {-# LINE 589 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule83 = \ _genwrap _wr_syns ->
                   {-# LINE 589 "src-ag/ExecutionPlan2Caml.ag" #-}
                   _genwrap     "syn" _wr_syns
                   {-# LINE 1217 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule84 #-}
   {-# LINE 590 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule84 = \ _t_params nt_ ->
                   {-# LINE 590 "src-ag/ExecutionPlan2Caml.ag" #-}
                   \nm attrs ->
                     "and" >#< _t_params     >#< nm >|< "_" >|< nt_ >#< "=" >#< ppRecordTp
                       [ i >|< "_" >|< nm >|< "_" >|< nt_ >#< ":" >#< ppTp t | (i,t) <- attrs ]
                   {-# LINE 1225 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule85 #-}
   {-# LINE 594 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule85 = \ ((_lhsIinhmap) :: Map NontermIdent Attributes) nt_ ->
                   {-# LINE 594 "src-ag/ExecutionPlan2Caml.ag" #-}
                   fromJust $ Map.lookup nt_ _lhsIinhmap
                   {-# LINE 1231 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule86 #-}
   {-# LINE 595 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule86 = \ _inhAttrs _wr_filter ->
                   {-# LINE 595 "src-ag/ExecutionPlan2Caml.ag" #-}
                   Map.toList $ _wr_filter     $ _inhAttrs
                   {-# LINE 1237 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule87 #-}
   {-# LINE 596 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule87 = \ _inhAttrs ->
                   {-# LINE 596 "src-ag/ExecutionPlan2Caml.ag" #-}
                   Map.toList _inhAttrs
                   {-# LINE 1243 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule88 #-}
   {-# LINE 597 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule88 = \ ((_lhsIoptions) :: Options) ->
                    {-# LINE 597 "src-ag/ExecutionPlan2Caml.ag" #-}
                    if kennedyWarren _lhsIoptions && lateHigherOrderBinding _lhsIoptions
                    then Map.delete idLateBindingAttr
                    else id
                    {-# LINE 1251 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule89 #-}
   {-# LINE 600 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule89 = \ ((_lhsIsynmap) :: Map NontermIdent Attributes) nt_ ->
                   {-# LINE 600 "src-ag/ExecutionPlan2Caml.ag" #-}
                   Map.toList $ fromJust $ Map.lookup nt_ _lhsIsynmap
                   {-# LINE 1257 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule90 #-}
   {-# LINE 602 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule90 = \ nt_ ->
                   {-# LINE 602 "src-ag/ExecutionPlan2Caml.ag" #-}
                   text ("wrap_" ++ show nt_)
                   {-# LINE 1263 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule91 #-}
   {-# LINE 603 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule91 = \ nt_ ->
                   {-# LINE 603 "src-ag/ExecutionPlan2Caml.ag" #-}
                   text ("inh_" ++ show nt_)
                   {-# LINE 1269 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule92 #-}
   {-# LINE 604 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule92 = \ nt_ ->
                   {-# LINE 604 "src-ag/ExecutionPlan2Caml.ag" #-}
                   text ("syn_" ++ show nt_)
                   {-# LINE 1275 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule93 #-}
   {-# LINE 605 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule93 = \ initial_ nextVisits_ ->
                         {-# LINE 605 "src-ag/ExecutionPlan2Caml.ag" #-}
                         Map.findWithDefault ManyVis initial_ nextVisits_
                         {-# LINE 1281 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule94 #-}
   {-# LINE 607 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule94 = \ _t_params _t_type ->
                       {-# LINE 607 "src-ag/ExecutionPlan2Caml.ag" #-}
                       _t_params     >#< _t_type
                       {-# LINE 1287 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule95 #-}
   {-# LINE 608 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule95 = \ _inhname _t_params ->
                       {-# LINE 608 "src-ag/ExecutionPlan2Caml.ag" #-}
                       _t_params     >#< _inhname
                       {-# LINE 1293 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule96 #-}
   {-# LINE 609 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule96 = \ ((_lhsIoptions) :: Options) _wr_inhs1 nt_ ->
                       {-# LINE 609 "src-ag/ExecutionPlan2Caml.ag" #-}
                       ppRecordVal [ i >|< "_inh_" >|< nt_ >#< "=" >#< lhsname _lhsIoptions True i | (i,_) <- _wr_inhs1     ]
                       {-# LINE 1299 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule97 #-}
   {-# LINE 610 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule97 = \ _synname _t_params ->
                    {-# LINE 610 "src-ag/ExecutionPlan2Caml.ag" #-}
                    _t_params     >#< _synname
                    {-# LINE 1305 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule98 #-}
   {-# LINE 611 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule98 = \ _o_sigs _wrapArgInhTp _wrapArgPats _wrapArgSemTp _wrapResTp _wrapname _wrapperPreamble ->
                   {-# LINE 611 "src-ag/ExecutionPlan2Caml.ag" #-}
                   "and" >#< ppFunDecl _o_sigs     _wrapname     [(pp "act", _wrapArgSemTp    ), (_wrapArgPats    , _wrapArgInhTp    )] _wrapResTp     _wrapperPreamble
                   {-# LINE 1311 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule99 #-}
   {-# LINE 613 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule99 = \ ((_lhsImainName) :: String) ((_lhsIoptions) :: Options) _wrapperBody ->
        {-# LINE 613 "src-ag/ExecutionPlan2Caml.ag" #-}
        ( if lateHigherOrderBinding _lhsIoptions
          then "let" >#< lhsname _lhsIoptions True idLateBindingAttr >#< "=" >#< lateBindingFieldNm _lhsImainName >#< "in"
          else empty
        )
        >-< _wrapperBody
        {-# LINE 1321 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule100 #-}
   {-# LINE 619 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule100 = \ _firstVisitInfo ((_lhsIoptions) :: Options) _wr_inhs _wr_syns initial_ initialv_ nt_ ->
        {-# LINE 619 "src-ag/ExecutionPlan2Caml.ag" #-}
        case initialv_ of
          [] -> text "{ }"
          (initv:_) ->
            let attach  = "let" >#< "sem" >#< "=" >#< "act." >|< nm_attach nt_ >#< "()" >#< "in"
                pat     = ppRecordVal [ nm_outarg i nt_ initv >#< "=" >#< lhsname _lhsIoptions False i | (i,_) <- _wr_syns     ]
                bld     = ppRecordVal [ i >|< "_syn_" >|< nt_ >#< "=" >#< lhsname _lhsIoptions False i | (i,_) <- _wr_syns     ]
                res     = "let res = function" >#< pat >#< "->" >#< bld >#< "in"
                inps    = "let" >#< "inps" >#< "=" >#< ppRecordVal [ nm_inarg i nt_ initv >#< "=" >#< lhsname _lhsIoptions True i | (i,_) <- _wr_inhs     ] >#< "in"
                arg     = "let" >#< "arg" >#< "=" >#< argcon >#< argrec >#< "in"
                argcon  = case _firstVisitInfo     of
                            ManyVis -> con_visit nt_ initv
                            _       -> empty
                argrec  = ppRecordVal
                            [ nm_inh nt_ initv >#< "=" >#<  "inps"
                            , nm_cont nt_ initv >#< "=" >#< "res"
                            ]
                invoke  = "sem." >|< nm_invoke nt_ initial_ >#< "arg"
            in attach >-< res >-< inps >-< arg >-< invoke
        {-# LINE 1344 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule101 #-}
   {-# LINE 648 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule101 = \ ((_prodsIsemFunBndDefs) :: Seq PP_Doc) _semFunBndDef ->
                        {-# LINE 648 "src-ag/ExecutionPlan2Caml.ag" #-}
                        _semFunBndDef     Seq.<| _prodsIsemFunBndDefs
                        {-# LINE 1350 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule102 #-}
   {-# LINE 649 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule102 = \ ((_prodsIsemFunBndTps) :: Seq PP_Doc) _semFunBndTp ->
                        {-# LINE 649 "src-ag/ExecutionPlan2Caml.ag" #-}
                        _semFunBndTp     Seq.<| _prodsIsemFunBndTps
                        {-# LINE 1356 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule103 #-}
   {-# LINE 650 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule103 = \ _semFunBndNm _semname ->
                        {-# LINE 650 "src-ag/ExecutionPlan2Caml.ag" #-}
                        _semFunBndNm     >#< "=" >#< _semname
                        {-# LINE 1362 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule104 #-}
   {-# LINE 651 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule104 = \ _semFunBndNm _sem_tp ->
                        {-# LINE 651 "src-ag/ExecutionPlan2Caml.ag" #-}
                        _semFunBndNm     >#< ":" >#< _sem_tp
                        {-# LINE 1368 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule105 #-}
   {-# LINE 652 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule105 = \ nt_ ->
                        {-# LINE 652 "src-ag/ExecutionPlan2Caml.ag" #-}
                        lateSemNtLabel nt_
                        {-# LINE 1374 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule106 #-}
   {-# LINE 682 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule106 = \ initial_ ->
                      {-# LINE 682 "src-ag/ExecutionPlan2Caml.ag" #-}
                      initial_
                      {-# LINE 1380 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule107 #-}
   {-# LINE 683 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule107 = \ _allstates ->
                      {-# LINE 683 "src-ag/ExecutionPlan2Caml.ag" #-}
                      _allstates
                      {-# LINE 1386 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule108 #-}
   {-# LINE 1390 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule108 = \ nextVisits_ ->
                       {-# LINE 1390 "src-ag/ExecutionPlan2Caml.ag" #-}
                       nextVisits_
                       {-# LINE 1392 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule109 #-}
   {-# LINE 1391 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule109 = \ prevVisits_ ->
                       {-# LINE 1391 "src-ag/ExecutionPlan2Caml.ag" #-}
                       prevVisits_
                       {-# LINE 1398 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule110 #-}
   {-# LINE 1435 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule110 = \ ((_lhsIlocalAttrTypes) :: Map NontermIdent (Map ConstructorIdent (Map Identifier Type))) nt_ ->
                           {-# LINE 1435 "src-ag/ExecutionPlan2Caml.ag" #-}
                           Map.findWithDefault Map.empty nt_ _lhsIlocalAttrTypes
                           {-# LINE 1404 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule111 #-}
   {-# LINE 1462 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule111 = \ initial_ nt_ ->
                     {-# LINE 1462 "src-ag/ExecutionPlan2Caml.ag" #-}
                     Map.singleton nt_ initial_
                     {-# LINE 1410 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule112 #-}
   {-# LINE 1476 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule112 = \ nt_ params_ ->
                 {-# LINE 1476 "src-ag/ExecutionPlan2Caml.ag" #-}
                 NT nt_ (map show params_) False
                 {-# LINE 1416 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule113 #-}
   rule113 = \ ((_prodsIchildvisit) :: Map VisitIdentifier (Identifier -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)) ->
     _prodsIchildvisit
   {-# INLINE rule114 #-}
   rule114 = \ ((_prodsIerrors) :: Seq Error) ->
     _prodsIerrors
   {-# INLINE rule115 #-}
   rule115 = \ ((_prodsIfromToStates) :: Map VisitIdentifier (Int,Int)) ->
     _prodsIfromToStates
   {-# INLINE rule116 #-}
   rule116 = \ ((_prodsIvisitKinds) :: Map VisitIdentifier VisitKind) ->
     _prodsIvisitKinds
   {-# INLINE rule117 #-}
   rule117 = \ ((_prodsIvisitdefs) :: Map VisitIdentifier (Set Identifier)) ->
     _prodsIvisitdefs
   {-# INLINE rule118 #-}
   rule118 = \ ((_prodsIvisituses) :: Map VisitIdentifier (Set Identifier)) ->
     _prodsIvisituses
   {-# INLINE rule119 #-}
   rule119 = \ ((_lhsIallFromToStates) :: Map VisitIdentifier (Int,Int)) ->
     _lhsIallFromToStates
   {-# INLINE rule120 #-}
   rule120 = \ ((_lhsIallInitStates) :: Map NontermIdent Int) ->
     _lhsIallInitStates
   {-# INLINE rule121 #-}
   rule121 = \ ((_lhsIallVisitKinds) :: Map VisitIdentifier VisitKind) ->
     _lhsIallVisitKinds
   {-# INLINE rule122 #-}
   rule122 = \ ((_lhsIallchildvisit) :: Map VisitIdentifier (Identifier -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)) ->
     _lhsIallchildvisit
   {-# INLINE rule123 #-}
   rule123 = \ ((_lhsIavisitdefs) :: Map VisitIdentifier (Set Identifier)) ->
     _lhsIavisitdefs
   {-# INLINE rule124 #-}
   rule124 = \ ((_lhsIavisituses) :: Map VisitIdentifier (Set Identifier)) ->
     _lhsIavisituses
   {-# INLINE rule125 #-}
   rule125 = \ ((_lhsImainFile) :: String) ->
     _lhsImainFile
   {-# INLINE rule126 #-}
   rule126 = \ ((_lhsImainName) :: String) ->
     _lhsImainName
   {-# INLINE rule127 #-}
   rule127 = \ _ntType ->
     _ntType
   {-# INLINE rule128 #-}
   rule128 = \ ((_lhsIoptions) :: Options) ->
     _lhsIoptions

-- ENonterminals -----------------------------------------------
-- wrapper
data Inh_ENonterminals  = Inh_ENonterminals { Inh_ENonterminals -> Map Int (Int, Int)
allFromToStates_Inh_ENonterminals :: (Map VisitIdentifier (Int,Int)), Inh_ENonterminals -> Map NontermIdent Int
allInitStates_Inh_ENonterminals :: (Map NontermIdent Int), Inh_ENonterminals -> Map Int VisitKind
allVisitKinds_Inh_ENonterminals :: (Map VisitIdentifier VisitKind), Inh_ENonterminals
-> Map
     Int
     (NontermIdent
      -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
allchildvisit_Inh_ENonterminals :: (Map VisitIdentifier (Identifier -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)), Inh_ENonterminals -> Map Int (Set NontermIdent)
avisitdefs_Inh_ENonterminals :: (Map VisitIdentifier (Set Identifier)), Inh_ENonterminals -> Map Int (Set NontermIdent)
avisituses_Inh_ENonterminals :: (Map VisitIdentifier (Set Identifier)), Inh_ENonterminals -> Map NontermIdent Attributes
inhmap_Inh_ENonterminals :: (Map NontermIdent Attributes), Inh_ENonterminals -> Map NontermIdent (Map NontermIdent Attributes)
localAttrTypes_Inh_ENonterminals :: (Map NontermIdent (Map ConstructorIdent (Map Identifier Type))), Inh_ENonterminals -> String
mainFile_Inh_ENonterminals :: (String), Inh_ENonterminals -> String
mainName_Inh_ENonterminals :: (String), Inh_ENonterminals -> Options
options_Inh_ENonterminals :: (Options), Inh_ENonterminals -> Map NontermIdent Attributes
synmap_Inh_ENonterminals :: (Map NontermIdent Attributes), Inh_ENonterminals -> TypeSyns
typeSyns_Inh_ENonterminals :: (TypeSyns), Inh_ENonterminals -> Set NontermIdent
wrappers_Inh_ENonterminals :: (Set NontermIdent) }
data Syn_ENonterminals  = Syn_ENonterminals { Syn_ENonterminals
-> Map
     Int
     (NontermIdent
      -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
childvisit_Syn_ENonterminals :: (Map VisitIdentifier (Identifier -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)), Syn_ENonterminals -> PP_Doc
code_Syn_ENonterminals :: (PP_Doc), Syn_ENonterminals -> PP_Doc
datas_Syn_ENonterminals :: (PP_Doc), Syn_ENonterminals -> Seq Error
errors_Syn_ENonterminals :: (Seq Error), Syn_ENonterminals -> Map Int (Int, Int)
fromToStates_Syn_ENonterminals :: (Map VisitIdentifier (Int,Int)), Syn_ENonterminals -> Map NontermIdent Int
initStates_Syn_ENonterminals :: (Map NontermIdent Int), Syn_ENonterminals -> PP_Doc
modules_Syn_ENonterminals :: (PP_Doc), Syn_ENonterminals -> Seq PP_Doc
semFunBndDefs_Syn_ENonterminals :: (Seq PP_Doc), Syn_ENonterminals -> Seq PP_Doc
semFunBndTps_Syn_ENonterminals :: (Seq PP_Doc), Syn_ENonterminals -> Map Int VisitKind
visitKinds_Syn_ENonterminals :: (Map VisitIdentifier VisitKind), Syn_ENonterminals -> Map Int (Set NontermIdent)
visitdefs_Syn_ENonterminals :: (Map VisitIdentifier (Set Identifier)), Syn_ENonterminals -> Map Int (Set NontermIdent)
visituses_Syn_ENonterminals :: (Map VisitIdentifier (Set Identifier)) }
{-# INLINABLE wrap_ENonterminals #-}
wrap_ENonterminals :: T_ENonterminals  -> Inh_ENonterminals  -> (Syn_ENonterminals )
wrap_ENonterminals :: T_ENonterminals -> Inh_ENonterminals -> Syn_ENonterminals
wrap_ENonterminals (T_ENonterminals Identity T_ENonterminals_s11
act) (Inh_ENonterminals Map Int (Int, Int)
_lhsIallFromToStates Map NontermIdent Int
_lhsIallInitStates Map Int VisitKind
_lhsIallVisitKinds Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_lhsIallchildvisit Map Int (Set NontermIdent)
_lhsIavisitdefs Map Int (Set NontermIdent)
_lhsIavisituses Map NontermIdent Attributes
_lhsIinhmap Map NontermIdent (Map NontermIdent Attributes)
_lhsIlocalAttrTypes String
_lhsImainFile String
_lhsImainName Options
_lhsIoptions Map NontermIdent Attributes
_lhsIsynmap TypeSyns
_lhsItypeSyns Set NontermIdent
_lhsIwrappers) =
   forall a. Identity a -> a
Control.Monad.Identity.runIdentity (
     do T_ENonterminals_s11
sem <- Identity T_ENonterminals_s11
act
        let arg10 :: T_ENonterminals_vIn10
arg10 = Map Int (Int, Int)
-> Map NontermIdent Int
-> Map Int VisitKind
-> Map
     Int
     (NontermIdent
      -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
-> Map Int (Set NontermIdent)
-> Map Int (Set NontermIdent)
-> Map NontermIdent Attributes
-> Map NontermIdent (Map NontermIdent Attributes)
-> String
-> String
-> Options
-> Map NontermIdent Attributes
-> TypeSyns
-> Set NontermIdent
-> T_ENonterminals_vIn10
T_ENonterminals_vIn10 Map Int (Int, Int)
_lhsIallFromToStates Map NontermIdent Int
_lhsIallInitStates Map Int VisitKind
_lhsIallVisitKinds Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_lhsIallchildvisit Map Int (Set NontermIdent)
_lhsIavisitdefs Map Int (Set NontermIdent)
_lhsIavisituses Map NontermIdent Attributes
_lhsIinhmap Map NontermIdent (Map NontermIdent Attributes)
_lhsIlocalAttrTypes String
_lhsImainFile String
_lhsImainName Options
_lhsIoptions Map NontermIdent Attributes
_lhsIsynmap TypeSyns
_lhsItypeSyns Set NontermIdent
_lhsIwrappers
        (T_ENonterminals_vOut10 Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_lhsOchildvisit PP_Doc
_lhsOcode PP_Doc
_lhsOdatas Seq Error
_lhsOerrors Map Int (Int, Int)
_lhsOfromToStates Map NontermIdent Int
_lhsOinitStates PP_Doc
_lhsOmodules Seq PP_Doc
_lhsOsemFunBndDefs Seq PP_Doc
_lhsOsemFunBndTps Map Int VisitKind
_lhsOvisitKinds Map Int (Set NontermIdent)
_lhsOvisitdefs Map Int (Set NontermIdent)
_lhsOvisituses) <- forall (m :: * -> *) a. Monad m => a -> m a
return (T_ENonterminals_s11 -> T_ENonterminals_v10
inv_ENonterminals_s11 T_ENonterminals_s11
sem T_ENonterminals_vIn10
arg10)
        forall (m :: * -> *) a. Monad m => a -> m a
return (Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
-> PP_Doc
-> PP_Doc
-> Seq Error
-> Map Int (Int, Int)
-> Map NontermIdent Int
-> PP_Doc
-> Seq PP_Doc
-> Seq PP_Doc
-> Map Int VisitKind
-> Map Int (Set NontermIdent)
-> Map Int (Set NontermIdent)
-> Syn_ENonterminals
Syn_ENonterminals Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_lhsOchildvisit PP_Doc
_lhsOcode PP_Doc
_lhsOdatas Seq Error
_lhsOerrors Map Int (Int, Int)
_lhsOfromToStates Map NontermIdent Int
_lhsOinitStates PP_Doc
_lhsOmodules Seq PP_Doc
_lhsOsemFunBndDefs Seq PP_Doc
_lhsOsemFunBndTps Map Int VisitKind
_lhsOvisitKinds Map Int (Set NontermIdent)
_lhsOvisitdefs Map Int (Set NontermIdent)
_lhsOvisituses)
   )

-- cata
{-# NOINLINE sem_ENonterminals #-}
sem_ENonterminals :: ENonterminals  -> T_ENonterminals 
sem_ENonterminals :: ENonterminals -> T_ENonterminals
sem_ENonterminals ENonterminals
list = forall (t :: * -> *) a b.
Foldable t =>
(a -> b -> b) -> b -> t a -> b
Prelude.foldr T_ENonterminal -> T_ENonterminals -> T_ENonterminals
sem_ENonterminals_Cons T_ENonterminals
sem_ENonterminals_Nil (forall a b. (a -> b) -> [a] -> [b]
Prelude.map ENonterminal -> T_ENonterminal
sem_ENonterminal ENonterminals
list)

-- semantic domain
newtype T_ENonterminals  = T_ENonterminals {
                                           T_ENonterminals -> Identity T_ENonterminals_s11
attach_T_ENonterminals :: Identity (T_ENonterminals_s11 )
                                           }
newtype T_ENonterminals_s11  = C_ENonterminals_s11 {
                                                   T_ENonterminals_s11 -> T_ENonterminals_v10
inv_ENonterminals_s11 :: (T_ENonterminals_v10 )
                                                   }
data T_ENonterminals_s12  = C_ENonterminals_s12
type T_ENonterminals_v10  = (T_ENonterminals_vIn10 ) -> (T_ENonterminals_vOut10 )
data T_ENonterminals_vIn10  = T_ENonterminals_vIn10 (Map VisitIdentifier (Int,Int)) (Map NontermIdent Int) (Map VisitIdentifier VisitKind) (Map VisitIdentifier (Identifier -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)) (Map VisitIdentifier (Set Identifier)) (Map VisitIdentifier (Set Identifier)) (Map NontermIdent Attributes) (Map NontermIdent (Map ConstructorIdent (Map Identifier Type))) (String) (String) (Options) (Map NontermIdent Attributes) (TypeSyns) (Set NontermIdent)
data T_ENonterminals_vOut10  = T_ENonterminals_vOut10 (Map VisitIdentifier (Identifier -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)) (PP_Doc) (PP_Doc) (Seq Error) (Map VisitIdentifier (Int,Int)) (Map NontermIdent Int) (PP_Doc) (Seq PP_Doc) (Seq PP_Doc) (Map VisitIdentifier VisitKind) (Map VisitIdentifier (Set Identifier)) (Map VisitIdentifier (Set Identifier))
{-# NOINLINE sem_ENonterminals_Cons #-}
sem_ENonterminals_Cons :: T_ENonterminal  -> T_ENonterminals  -> T_ENonterminals 
sem_ENonterminals_Cons :: T_ENonterminal -> T_ENonterminals -> T_ENonterminals
sem_ENonterminals_Cons T_ENonterminal
arg_hd_ T_ENonterminals
arg_tl_ = Identity T_ENonterminals_s11 -> T_ENonterminals
T_ENonterminals (forall (m :: * -> *) a. Monad m => a -> m a
return T_ENonterminals_s11
st11) where
   {-# NOINLINE st11 #-}
   st11 :: T_ENonterminals_s11
st11 = let
      v10 :: T_ENonterminals_v10 
      v10 :: T_ENonterminals_v10
v10 = \ (T_ENonterminals_vIn10 Map Int (Int, Int)
_lhsIallFromToStates Map NontermIdent Int
_lhsIallInitStates Map Int VisitKind
_lhsIallVisitKinds Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_lhsIallchildvisit Map Int (Set NontermIdent)
_lhsIavisitdefs Map Int (Set NontermIdent)
_lhsIavisituses Map NontermIdent Attributes
_lhsIinhmap Map NontermIdent (Map NontermIdent Attributes)
_lhsIlocalAttrTypes String
_lhsImainFile String
_lhsImainName Options
_lhsIoptions Map NontermIdent Attributes
_lhsIsynmap TypeSyns
_lhsItypeSyns Set NontermIdent
_lhsIwrappers) -> ( let
         _hdX8 :: T_ENonterminal_s8
_hdX8 = forall a. Identity a -> a
Control.Monad.Identity.runIdentity (T_ENonterminal -> Identity T_ENonterminal_s8
attach_T_ENonterminal (T_ENonterminal
arg_hd_))
         _tlX11 :: T_ENonterminals_s11
_tlX11 = forall a. Identity a -> a
Control.Monad.Identity.runIdentity (T_ENonterminals -> Identity T_ENonterminals_s11
attach_T_ENonterminals (T_ENonterminals
arg_tl_))
         (T_ENonterminal_vOut7 Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_hdIchildvisit PP_Doc
_hdIcode PP_Doc
_hdIdatas Seq Error
_hdIerrors Map Int (Int, Int)
_hdIfromToStates Map NontermIdent Int
_hdIinitStates PP_Doc
_hdImodules Seq PP_Doc
_hdIsemFunBndDefs Seq PP_Doc
_hdIsemFunBndTps Map Int VisitKind
_hdIvisitKinds Map Int (Set NontermIdent)
_hdIvisitdefs Map Int (Set NontermIdent)
_hdIvisituses) = T_ENonterminal_s8 -> T_ENonterminal_v7
inv_ENonterminal_s8 T_ENonterminal_s8
_hdX8 (Map Int (Int, Int)
-> Map NontermIdent Int
-> Map Int VisitKind
-> Map
     Int
     (NontermIdent
      -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
-> Map Int (Set NontermIdent)
-> Map Int (Set NontermIdent)
-> Map NontermIdent Attributes
-> Map NontermIdent (Map NontermIdent Attributes)
-> String
-> String
-> Options
-> Map NontermIdent Attributes
-> TypeSyns
-> Set NontermIdent
-> T_ENonterminal_vIn7
T_ENonterminal_vIn7 Map Int (Int, Int)
_hdOallFromToStates Map NontermIdent Int
_hdOallInitStates Map Int VisitKind
_hdOallVisitKinds Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_hdOallchildvisit Map Int (Set NontermIdent)
_hdOavisitdefs Map Int (Set NontermIdent)
_hdOavisituses Map NontermIdent Attributes
_hdOinhmap Map NontermIdent (Map NontermIdent Attributes)
_hdOlocalAttrTypes String
_hdOmainFile String
_hdOmainName Options
_hdOoptions Map NontermIdent Attributes
_hdOsynmap TypeSyns
_hdOtypeSyns Set NontermIdent
_hdOwrappers)
         (T_ENonterminals_vOut10 Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_tlIchildvisit PP_Doc
_tlIcode PP_Doc
_tlIdatas Seq Error
_tlIerrors Map Int (Int, Int)
_tlIfromToStates Map NontermIdent Int
_tlIinitStates PP_Doc
_tlImodules Seq PP_Doc
_tlIsemFunBndDefs Seq PP_Doc
_tlIsemFunBndTps Map Int VisitKind
_tlIvisitKinds Map Int (Set NontermIdent)
_tlIvisitdefs Map Int (Set NontermIdent)
_tlIvisituses) = T_ENonterminals_s11 -> T_ENonterminals_v10
inv_ENonterminals_s11 T_ENonterminals_s11
_tlX11 (Map Int (Int, Int)
-> Map NontermIdent Int
-> Map Int VisitKind
-> Map
     Int
     (NontermIdent
      -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
-> Map Int (Set NontermIdent)
-> Map Int (Set NontermIdent)
-> Map NontermIdent Attributes
-> Map NontermIdent (Map NontermIdent Attributes)
-> String
-> String
-> Options
-> Map NontermIdent Attributes
-> TypeSyns
-> Set NontermIdent
-> T_ENonterminals_vIn10
T_ENonterminals_vIn10 Map Int (Int, Int)
_tlOallFromToStates Map NontermIdent Int
_tlOallInitStates Map Int VisitKind
_tlOallVisitKinds Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_tlOallchildvisit Map Int (Set NontermIdent)
_tlOavisitdefs Map Int (Set NontermIdent)
_tlOavisituses Map NontermIdent Attributes
_tlOinhmap Map NontermIdent (Map NontermIdent Attributes)
_tlOlocalAttrTypes String
_tlOmainFile String
_tlOmainName Options
_tlOoptions Map NontermIdent Attributes
_tlOsynmap TypeSyns
_tlOtypeSyns Set NontermIdent
_tlOwrappers)
         _lhsOchildvisit :: Map VisitIdentifier (Identifier -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
         _lhsOchildvisit :: Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_lhsOchildvisit = Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
-> Map
     Int
     (NontermIdent
      -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
-> Map
     Int
     (NontermIdent
      -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
rule129 Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_hdIchildvisit Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_tlIchildvisit
         _lhsOcode :: PP_Doc
         _lhsOcode :: PP_Doc
_lhsOcode = PP_Doc -> PP_Doc -> PP_Doc
rule130 PP_Doc
_hdIcode PP_Doc
_tlIcode
         _lhsOdatas :: PP_Doc
         _lhsOdatas :: PP_Doc
_lhsOdatas = PP_Doc -> PP_Doc -> PP_Doc
rule131 PP_Doc
_hdIdatas PP_Doc
_tlIdatas
         _lhsOerrors :: Seq Error
         _lhsOerrors :: Seq Error
_lhsOerrors = Seq Error -> Seq Error -> Seq Error
rule132 Seq Error
_hdIerrors Seq Error
_tlIerrors
         _lhsOfromToStates :: Map VisitIdentifier (Int,Int)
         _lhsOfromToStates :: Map Int (Int, Int)
_lhsOfromToStates = Map Int (Int, Int) -> Map Int (Int, Int) -> Map Int (Int, Int)
rule133 Map Int (Int, Int)
_hdIfromToStates Map Int (Int, Int)
_tlIfromToStates
         _lhsOinitStates :: Map NontermIdent Int
         _lhsOinitStates :: Map NontermIdent Int
_lhsOinitStates = Map NontermIdent Int
-> Map NontermIdent Int -> Map NontermIdent Int
rule134 Map NontermIdent Int
_hdIinitStates Map NontermIdent Int
_tlIinitStates
         _lhsOmodules :: PP_Doc
         _lhsOmodules :: PP_Doc
_lhsOmodules = PP_Doc -> PP_Doc -> PP_Doc
rule135 PP_Doc
_hdImodules PP_Doc
_tlImodules
         _lhsOsemFunBndDefs :: Seq PP_Doc
         _lhsOsemFunBndDefs :: Seq PP_Doc
_lhsOsemFunBndDefs = Seq PP_Doc -> Seq PP_Doc -> Seq PP_Doc
rule136 Seq PP_Doc
_hdIsemFunBndDefs Seq PP_Doc
_tlIsemFunBndDefs
         _lhsOsemFunBndTps :: Seq PP_Doc
         _lhsOsemFunBndTps :: Seq PP_Doc
_lhsOsemFunBndTps = Seq PP_Doc -> Seq PP_Doc -> Seq PP_Doc
rule137 Seq PP_Doc
_hdIsemFunBndTps Seq PP_Doc
_tlIsemFunBndTps
         _lhsOvisitKinds :: Map VisitIdentifier VisitKind
         _lhsOvisitKinds :: Map Int VisitKind
_lhsOvisitKinds = Map Int VisitKind -> Map Int VisitKind -> Map Int VisitKind
rule138 Map Int VisitKind
_hdIvisitKinds Map Int VisitKind
_tlIvisitKinds
         _lhsOvisitdefs :: Map VisitIdentifier (Set Identifier)
         _lhsOvisitdefs :: Map Int (Set NontermIdent)
_lhsOvisitdefs = Map Int (Set NontermIdent)
-> Map Int (Set NontermIdent) -> Map Int (Set NontermIdent)
rule139 Map Int (Set NontermIdent)
_hdIvisitdefs Map Int (Set NontermIdent)
_tlIvisitdefs
         _lhsOvisituses :: Map VisitIdentifier (Set Identifier)
         _lhsOvisituses :: Map Int (Set NontermIdent)
_lhsOvisituses = Map Int (Set NontermIdent)
-> Map Int (Set NontermIdent) -> Map Int (Set NontermIdent)
rule140 Map Int (Set NontermIdent)
_hdIvisituses Map Int (Set NontermIdent)
_tlIvisituses
         _hdOallFromToStates :: Map Int (Int, Int)
_hdOallFromToStates = Map Int (Int, Int) -> Map Int (Int, Int)
rule141 Map Int (Int, Int)
_lhsIallFromToStates
         _hdOallInitStates :: Map NontermIdent Int
_hdOallInitStates = Map NontermIdent Int -> Map NontermIdent Int
rule142 Map NontermIdent Int
_lhsIallInitStates
         _hdOallVisitKinds :: Map Int VisitKind
_hdOallVisitKinds = Map Int VisitKind -> Map Int VisitKind
rule143 Map Int VisitKind
_lhsIallVisitKinds
         _hdOallchildvisit :: Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_hdOallchildvisit = Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
-> Map
     Int
     (NontermIdent
      -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
rule144 Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_lhsIallchildvisit
         _hdOavisitdefs :: Map Int (Set NontermIdent)
_hdOavisitdefs = Map Int (Set NontermIdent) -> Map Int (Set NontermIdent)
rule145 Map Int (Set NontermIdent)
_lhsIavisitdefs
         _hdOavisituses :: Map Int (Set NontermIdent)
_hdOavisituses = Map Int (Set NontermIdent) -> Map Int (Set NontermIdent)
rule146 Map Int (Set NontermIdent)
_lhsIavisituses
         _hdOinhmap :: Map NontermIdent Attributes
_hdOinhmap = Map NontermIdent Attributes -> Map NontermIdent Attributes
rule147 Map NontermIdent Attributes
_lhsIinhmap
         _hdOlocalAttrTypes :: Map NontermIdent (Map NontermIdent Attributes)
_hdOlocalAttrTypes = Map NontermIdent (Map NontermIdent Attributes)
-> Map NontermIdent (Map NontermIdent Attributes)
rule148 Map NontermIdent (Map NontermIdent Attributes)
_lhsIlocalAttrTypes
         _hdOmainFile :: String
_hdOmainFile = String -> String
rule149 String
_lhsImainFile
         _hdOmainName :: String
_hdOmainName = String -> String
rule150 String
_lhsImainName
         _hdOoptions :: Options
_hdOoptions = Options -> Options
rule151 Options
_lhsIoptions
         _hdOsynmap :: Map NontermIdent Attributes
_hdOsynmap = Map NontermIdent Attributes -> Map NontermIdent Attributes
rule152 Map NontermIdent Attributes
_lhsIsynmap
         _hdOtypeSyns :: TypeSyns
_hdOtypeSyns = TypeSyns -> TypeSyns
rule153 TypeSyns
_lhsItypeSyns
         _hdOwrappers :: Set NontermIdent
_hdOwrappers = Set NontermIdent -> Set NontermIdent
rule154 Set NontermIdent
_lhsIwrappers
         _tlOallFromToStates :: Map Int (Int, Int)
_tlOallFromToStates = Map Int (Int, Int) -> Map Int (Int, Int)
rule155 Map Int (Int, Int)
_lhsIallFromToStates
         _tlOallInitStates :: Map NontermIdent Int
_tlOallInitStates = Map NontermIdent Int -> Map NontermIdent Int
rule156 Map NontermIdent Int
_lhsIallInitStates
         _tlOallVisitKinds :: Map Int VisitKind
_tlOallVisitKinds = Map Int VisitKind -> Map Int VisitKind
rule157 Map Int VisitKind
_lhsIallVisitKinds
         _tlOallchildvisit :: Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_tlOallchildvisit = Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
-> Map
     Int
     (NontermIdent
      -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
rule158 Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_lhsIallchildvisit
         _tlOavisitdefs :: Map Int (Set NontermIdent)
_tlOavisitdefs = Map Int (Set NontermIdent) -> Map Int (Set NontermIdent)
rule159 Map Int (Set NontermIdent)
_lhsIavisitdefs
         _tlOavisituses :: Map Int (Set NontermIdent)
_tlOavisituses = Map Int (Set NontermIdent) -> Map Int (Set NontermIdent)
rule160 Map Int (Set NontermIdent)
_lhsIavisituses
         _tlOinhmap :: Map NontermIdent Attributes
_tlOinhmap = Map NontermIdent Attributes -> Map NontermIdent Attributes
rule161 Map NontermIdent Attributes
_lhsIinhmap
         _tlOlocalAttrTypes :: Map NontermIdent (Map NontermIdent Attributes)
_tlOlocalAttrTypes = Map NontermIdent (Map NontermIdent Attributes)
-> Map NontermIdent (Map NontermIdent Attributes)
rule162 Map NontermIdent (Map NontermIdent Attributes)
_lhsIlocalAttrTypes
         _tlOmainFile :: String
_tlOmainFile = String -> String
rule163 String
_lhsImainFile
         _tlOmainName :: String
_tlOmainName = String -> String
rule164 String
_lhsImainName
         _tlOoptions :: Options
_tlOoptions = Options -> Options
rule165 Options
_lhsIoptions
         _tlOsynmap :: Map NontermIdent Attributes
_tlOsynmap = Map NontermIdent Attributes -> Map NontermIdent Attributes
rule166 Map NontermIdent Attributes
_lhsIsynmap
         _tlOtypeSyns :: TypeSyns
_tlOtypeSyns = TypeSyns -> TypeSyns
rule167 TypeSyns
_lhsItypeSyns
         _tlOwrappers :: Set NontermIdent
_tlOwrappers = Set NontermIdent -> Set NontermIdent
rule168 Set NontermIdent
_lhsIwrappers
         __result_ :: T_ENonterminals_vOut10
__result_ = Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
-> PP_Doc
-> PP_Doc
-> Seq Error
-> Map Int (Int, Int)
-> Map NontermIdent Int
-> PP_Doc
-> Seq PP_Doc
-> Seq PP_Doc
-> Map Int VisitKind
-> Map Int (Set NontermIdent)
-> Map Int (Set NontermIdent)
-> T_ENonterminals_vOut10
T_ENonterminals_vOut10 Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_lhsOchildvisit PP_Doc
_lhsOcode PP_Doc
_lhsOdatas Seq Error
_lhsOerrors Map Int (Int, Int)
_lhsOfromToStates Map NontermIdent Int
_lhsOinitStates PP_Doc
_lhsOmodules Seq PP_Doc
_lhsOsemFunBndDefs Seq PP_Doc
_lhsOsemFunBndTps Map Int VisitKind
_lhsOvisitKinds Map Int (Set NontermIdent)
_lhsOvisitdefs Map Int (Set NontermIdent)
_lhsOvisituses
         in T_ENonterminals_vOut10
__result_ )
     in T_ENonterminals_v10 -> T_ENonterminals_s11
C_ENonterminals_s11 T_ENonterminals_v10
v10
   {-# INLINE rule129 #-}
   rule129 :: Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
-> Map
     Int
     (NontermIdent
      -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
-> Map
     Int
     (NontermIdent
      -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
rule129 = \ ((Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_hdIchildvisit) :: Map VisitIdentifier (Identifier -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)) ((Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_tlIchildvisit) :: Map VisitIdentifier (Identifier -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)) ->
     Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_hdIchildvisit forall k a. Ord k => Map k a -> Map k a -> Map k a
`Map.union` Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_tlIchildvisit
   {-# INLINE rule130 #-}
   rule130 :: PP_Doc -> PP_Doc -> PP_Doc
rule130 = \ ((PP_Doc
_hdIcode) :: PP_Doc) ((PP_Doc
_tlIcode) :: PP_Doc) ->
     PP_Doc
_hdIcode forall a b. (PP a, PP b) => a -> b -> PP_Doc
>-< PP_Doc
_tlIcode
   {-# INLINE rule131 #-}
   rule131 :: PP_Doc -> PP_Doc -> PP_Doc
rule131 = \ ((PP_Doc
_hdIdatas) :: PP_Doc) ((PP_Doc
_tlIdatas) :: PP_Doc) ->
     PP_Doc
_hdIdatas forall a b. (PP a, PP b) => a -> b -> PP_Doc
>-< PP_Doc
_tlIdatas
   {-# INLINE rule132 #-}
   rule132 :: Seq Error -> Seq Error -> Seq Error
rule132 = \ ((Seq Error
_hdIerrors) :: Seq Error) ((Seq Error
_tlIerrors) :: Seq Error) ->
     Seq Error
_hdIerrors forall a. Seq a -> Seq a -> Seq a
Seq.>< Seq Error
_tlIerrors
   {-# INLINE rule133 #-}
   rule133 :: Map Int (Int, Int) -> Map Int (Int, Int) -> Map Int (Int, Int)
rule133 = \ ((Map Int (Int, Int)
_hdIfromToStates) :: Map VisitIdentifier (Int,Int)) ((Map Int (Int, Int)
_tlIfromToStates) :: Map VisitIdentifier (Int,Int)) ->
     Map Int (Int, Int)
_hdIfromToStates forall a. Monoid a => a -> a -> a
`mappend` Map Int (Int, Int)
_tlIfromToStates
   {-# INLINE rule134 #-}
   rule134 :: Map NontermIdent Int
-> Map NontermIdent Int -> Map NontermIdent Int
rule134 = \ ((Map NontermIdent Int
_hdIinitStates) :: Map NontermIdent Int) ((Map NontermIdent Int
_tlIinitStates) :: Map NontermIdent Int) ->
     Map NontermIdent Int
_hdIinitStates forall a. Monoid a => a -> a -> a
`mappend` Map NontermIdent Int
_tlIinitStates
   {-# INLINE rule135 #-}
   rule135 :: PP_Doc -> PP_Doc -> PP_Doc
rule135 = \ ((PP_Doc
_hdImodules) :: PP_Doc) ((PP_Doc
_tlImodules) :: PP_Doc) ->
     PP_Doc
_hdImodules forall a b. (PP a, PP b) => a -> b -> PP_Doc
>-< PP_Doc
_tlImodules
   {-# INLINE rule136 #-}
   rule136 :: Seq PP_Doc -> Seq PP_Doc -> Seq PP_Doc
rule136 = \ ((Seq PP_Doc
_hdIsemFunBndDefs) :: Seq PP_Doc) ((Seq PP_Doc
_tlIsemFunBndDefs) :: Seq PP_Doc) ->
     Seq PP_Doc
_hdIsemFunBndDefs forall a. Seq a -> Seq a -> Seq a
Seq.>< Seq PP_Doc
_tlIsemFunBndDefs
   {-# INLINE rule137 #-}
   rule137 :: Seq PP_Doc -> Seq PP_Doc -> Seq PP_Doc
rule137 = \ ((Seq PP_Doc
_hdIsemFunBndTps) :: Seq PP_Doc) ((Seq PP_Doc
_tlIsemFunBndTps) :: Seq PP_Doc) ->
     Seq PP_Doc
_hdIsemFunBndTps forall a. Seq a -> Seq a -> Seq a
Seq.>< Seq PP_Doc
_tlIsemFunBndTps
   {-# INLINE rule138 #-}
   rule138 :: Map Int VisitKind -> Map Int VisitKind -> Map Int VisitKind
rule138 = \ ((Map Int VisitKind
_hdIvisitKinds) :: Map VisitIdentifier VisitKind) ((Map Int VisitKind
_tlIvisitKinds) :: Map VisitIdentifier VisitKind) ->
     Map Int VisitKind
_hdIvisitKinds forall a. Monoid a => a -> a -> a
`mappend` Map Int VisitKind
_tlIvisitKinds
   {-# INLINE rule139 #-}
   rule139 :: Map Int (Set NontermIdent)
-> Map Int (Set NontermIdent) -> Map Int (Set NontermIdent)
rule139 = \ ((Map Int (Set NontermIdent)
_hdIvisitdefs) :: Map VisitIdentifier (Set Identifier)) ((Map Int (Set NontermIdent)
_tlIvisitdefs) :: Map VisitIdentifier (Set Identifier)) ->
     Map Int (Set NontermIdent)
_hdIvisitdefs forall a b.
(Ord a, Ord b) =>
Map a (Set b) -> Map a (Set b) -> Map a (Set b)
`uwSetUnion` Map Int (Set NontermIdent)
_tlIvisitdefs
   {-# INLINE rule140 #-}
   rule140 :: Map Int (Set NontermIdent)
-> Map Int (Set NontermIdent) -> Map Int (Set NontermIdent)
rule140 = \ ((Map Int (Set NontermIdent)
_hdIvisituses) :: Map VisitIdentifier (Set Identifier)) ((Map Int (Set NontermIdent)
_tlIvisituses) :: Map VisitIdentifier (Set Identifier)) ->
     Map Int (Set NontermIdent)
_hdIvisituses forall a b.
(Ord a, Ord b) =>
Map a (Set b) -> Map a (Set b) -> Map a (Set b)
`uwSetUnion` Map Int (Set NontermIdent)
_tlIvisituses
   {-# INLINE rule141 #-}
   rule141 :: Map Int (Int, Int) -> Map Int (Int, Int)
rule141 = \ ((Map Int (Int, Int)
_lhsIallFromToStates) :: Map VisitIdentifier (Int,Int)) ->
     Map Int (Int, Int)
_lhsIallFromToStates
   {-# INLINE rule142 #-}
   rule142 :: Map NontermIdent Int -> Map NontermIdent Int
rule142 = \ ((Map NontermIdent Int
_lhsIallInitStates) :: Map NontermIdent Int) ->
     Map NontermIdent Int
_lhsIallInitStates
   {-# INLINE rule143 #-}
   rule143 :: Map Int VisitKind -> Map Int VisitKind
rule143 = \ ((Map Int VisitKind
_lhsIallVisitKinds) :: Map VisitIdentifier VisitKind) ->
     Map Int VisitKind
_lhsIallVisitKinds
   {-# INLINE rule144 #-}
   rule144 :: Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
-> Map
     Int
     (NontermIdent
      -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
rule144 = \ ((Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_lhsIallchildvisit) :: Map VisitIdentifier (Identifier -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)) ->
     Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_lhsIallchildvisit
   {-# INLINE rule145 #-}
   rule145 :: Map Int (Set NontermIdent) -> Map Int (Set NontermIdent)
rule145 = \ ((Map Int (Set NontermIdent)
_lhsIavisitdefs) :: Map VisitIdentifier (Set Identifier)) ->
     Map Int (Set NontermIdent)
_lhsIavisitdefs
   {-# INLINE rule146 #-}
   rule146 :: Map Int (Set NontermIdent) -> Map Int (Set NontermIdent)
rule146 = \ ((Map Int (Set NontermIdent)
_lhsIavisituses) :: Map VisitIdentifier (Set Identifier)) ->
     Map Int (Set NontermIdent)
_lhsIavisituses
   {-# INLINE rule147 #-}
   rule147 :: Map NontermIdent Attributes -> Map NontermIdent Attributes
rule147 = \ ((Map NontermIdent Attributes
_lhsIinhmap) :: Map NontermIdent Attributes) ->
     Map NontermIdent Attributes
_lhsIinhmap
   {-# INLINE rule148 #-}
   rule148 :: Map NontermIdent (Map NontermIdent Attributes)
-> Map NontermIdent (Map NontermIdent Attributes)
rule148 = \ ((Map NontermIdent (Map NontermIdent Attributes)
_lhsIlocalAttrTypes) :: Map NontermIdent (Map ConstructorIdent (Map Identifier Type))) ->
     Map NontermIdent (Map NontermIdent Attributes)
_lhsIlocalAttrTypes
   {-# INLINE rule149 #-}
   rule149 :: String -> String
rule149 = \ ((String
_lhsImainFile) :: String) ->
     String
_lhsImainFile
   {-# INLINE rule150 #-}
   rule150 :: String -> String
rule150 = \ ((String
_lhsImainName) :: String) ->
     String
_lhsImainName
   {-# INLINE rule151 #-}
   rule151 :: Options -> Options
rule151 = \ ((Options
_lhsIoptions) :: Options) ->
     Options
_lhsIoptions
   {-# INLINE rule152 #-}
   rule152 :: Map NontermIdent Attributes -> Map NontermIdent Attributes
rule152 = \ ((Map NontermIdent Attributes
_lhsIsynmap) :: Map NontermIdent Attributes) ->
     Map NontermIdent Attributes
_lhsIsynmap
   {-# INLINE rule153 #-}
   rule153 :: TypeSyns -> TypeSyns
rule153 = \ ((TypeSyns
_lhsItypeSyns) :: TypeSyns) ->
     TypeSyns
_lhsItypeSyns
   {-# INLINE rule154 #-}
   rule154 :: Set NontermIdent -> Set NontermIdent
rule154 = \ ((Set NontermIdent
_lhsIwrappers) :: Set NontermIdent) ->
     Set NontermIdent
_lhsIwrappers
   {-# INLINE rule155 #-}
   rule155 :: Map Int (Int, Int) -> Map Int (Int, Int)
rule155 = \ ((Map Int (Int, Int)
_lhsIallFromToStates) :: Map VisitIdentifier (Int,Int)) ->
     Map Int (Int, Int)
_lhsIallFromToStates
   {-# INLINE rule156 #-}
   rule156 :: Map NontermIdent Int -> Map NontermIdent Int
rule156 = \ ((Map NontermIdent Int
_lhsIallInitStates) :: Map NontermIdent Int) ->
     Map NontermIdent Int
_lhsIallInitStates
   {-# INLINE rule157 #-}
   rule157 :: Map Int VisitKind -> Map Int VisitKind
rule157 = \ ((Map Int VisitKind
_lhsIallVisitKinds) :: Map VisitIdentifier VisitKind) ->
     Map Int VisitKind
_lhsIallVisitKinds
   {-# INLINE rule158 #-}
   rule158 :: Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
-> Map
     Int
     (NontermIdent
      -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
rule158 = \ ((Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_lhsIallchildvisit) :: Map VisitIdentifier (Identifier -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)) ->
     Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_lhsIallchildvisit
   {-# INLINE rule159 #-}
   rule159 :: Map Int (Set NontermIdent) -> Map Int (Set NontermIdent)
rule159 = \ ((Map Int (Set NontermIdent)
_lhsIavisitdefs) :: Map VisitIdentifier (Set Identifier)) ->
     Map Int (Set NontermIdent)
_lhsIavisitdefs
   {-# INLINE rule160 #-}
   rule160 :: Map Int (Set NontermIdent) -> Map Int (Set NontermIdent)
rule160 = \ ((Map Int (Set NontermIdent)
_lhsIavisituses) :: Map VisitIdentifier (Set Identifier)) ->
     Map Int (Set NontermIdent)
_lhsIavisituses
   {-# INLINE rule161 #-}
   rule161 :: Map NontermIdent Attributes -> Map NontermIdent Attributes
rule161 = \ ((Map NontermIdent Attributes
_lhsIinhmap) :: Map NontermIdent Attributes) ->
     Map NontermIdent Attributes
_lhsIinhmap
   {-# INLINE rule162 #-}
   rule162 :: Map NontermIdent (Map NontermIdent Attributes)
-> Map NontermIdent (Map NontermIdent Attributes)
rule162 = \ ((Map NontermIdent (Map NontermIdent Attributes)
_lhsIlocalAttrTypes) :: Map NontermIdent (Map ConstructorIdent (Map Identifier Type))) ->
     Map NontermIdent (Map NontermIdent Attributes)
_lhsIlocalAttrTypes
   {-# INLINE rule163 #-}
   rule163 :: String -> String
rule163 = \ ((String
_lhsImainFile) :: String) ->
     String
_lhsImainFile
   {-# INLINE rule164 #-}
   rule164 :: String -> String
rule164 = \ ((String
_lhsImainName) :: String) ->
     String
_lhsImainName
   {-# INLINE rule165 #-}
   rule165 :: Options -> Options
rule165 = \ ((Options
_lhsIoptions) :: Options) ->
     Options
_lhsIoptions
   {-# INLINE rule166 #-}
   rule166 :: Map NontermIdent Attributes -> Map NontermIdent Attributes
rule166 = \ ((Map NontermIdent Attributes
_lhsIsynmap) :: Map NontermIdent Attributes) ->
     Map NontermIdent Attributes
_lhsIsynmap
   {-# INLINE rule167 #-}
   rule167 :: TypeSyns -> TypeSyns
rule167 = \ ((TypeSyns
_lhsItypeSyns) :: TypeSyns) ->
     TypeSyns
_lhsItypeSyns
   {-# INLINE rule168 #-}
   rule168 :: Set NontermIdent -> Set NontermIdent
rule168 = \ ((Set NontermIdent
_lhsIwrappers) :: Set NontermIdent) ->
     Set NontermIdent
_lhsIwrappers
{-# NOINLINE sem_ENonterminals_Nil #-}
sem_ENonterminals_Nil ::  T_ENonterminals 
sem_ENonterminals_Nil :: T_ENonterminals
sem_ENonterminals_Nil  = Identity T_ENonterminals_s11 -> T_ENonterminals
T_ENonterminals (forall (m :: * -> *) a. Monad m => a -> m a
return T_ENonterminals_s11
st11) where
   {-# NOINLINE st11 #-}
   st11 :: T_ENonterminals_s11
st11 = let
      v10 :: T_ENonterminals_v10 
      v10 :: T_ENonterminals_v10
v10 = \ (T_ENonterminals_vIn10 Map Int (Int, Int)
_lhsIallFromToStates Map NontermIdent Int
_lhsIallInitStates Map Int VisitKind
_lhsIallVisitKinds Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_lhsIallchildvisit Map Int (Set NontermIdent)
_lhsIavisitdefs Map Int (Set NontermIdent)
_lhsIavisituses Map NontermIdent Attributes
_lhsIinhmap Map NontermIdent (Map NontermIdent Attributes)
_lhsIlocalAttrTypes String
_lhsImainFile String
_lhsImainName Options
_lhsIoptions Map NontermIdent Attributes
_lhsIsynmap TypeSyns
_lhsItypeSyns Set NontermIdent
_lhsIwrappers) -> ( let
         _lhsOchildvisit :: Map VisitIdentifier (Identifier -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
         _lhsOchildvisit :: Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_lhsOchildvisit = forall {k} {a}. () -> Map k a
rule169  ()
         _lhsOcode :: PP_Doc
         _lhsOcode :: PP_Doc
_lhsOcode = () -> PP_Doc
rule170  ()
         _lhsOdatas :: PP_Doc
         _lhsOdatas :: PP_Doc
_lhsOdatas = () -> PP_Doc
rule171  ()
         _lhsOerrors :: Seq Error
         _lhsOerrors :: Seq Error
_lhsOerrors = forall {a}. () -> Seq a
rule172  ()
         _lhsOfromToStates :: Map VisitIdentifier (Int,Int)
         _lhsOfromToStates :: Map Int (Int, Int)
_lhsOfromToStates = () -> Map Int (Int, Int)
rule173  ()
         _lhsOinitStates :: Map NontermIdent Int
         _lhsOinitStates :: Map NontermIdent Int
_lhsOinitStates = () -> Map NontermIdent Int
rule174  ()
         _lhsOmodules :: PP_Doc
         _lhsOmodules :: PP_Doc
_lhsOmodules = () -> PP_Doc
rule175  ()
         _lhsOsemFunBndDefs :: Seq PP_Doc
         _lhsOsemFunBndDefs :: Seq PP_Doc
_lhsOsemFunBndDefs = forall {a}. () -> Seq a
rule176  ()
         _lhsOsemFunBndTps :: Seq PP_Doc
         _lhsOsemFunBndTps :: Seq PP_Doc
_lhsOsemFunBndTps = forall {a}. () -> Seq a
rule177  ()
         _lhsOvisitKinds :: Map VisitIdentifier VisitKind
         _lhsOvisitKinds :: Map Int VisitKind
_lhsOvisitKinds = () -> Map Int VisitKind
rule178  ()
         _lhsOvisitdefs :: Map VisitIdentifier (Set Identifier)
         _lhsOvisitdefs :: Map Int (Set NontermIdent)
_lhsOvisitdefs = forall {k} {a}. () -> Map k a
rule179  ()
         _lhsOvisituses :: Map VisitIdentifier (Set Identifier)
         _lhsOvisituses :: Map Int (Set NontermIdent)
_lhsOvisituses = forall {k} {a}. () -> Map k a
rule180  ()
         __result_ :: T_ENonterminals_vOut10
__result_ = Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
-> PP_Doc
-> PP_Doc
-> Seq Error
-> Map Int (Int, Int)
-> Map NontermIdent Int
-> PP_Doc
-> Seq PP_Doc
-> Seq PP_Doc
-> Map Int VisitKind
-> Map Int (Set NontermIdent)
-> Map Int (Set NontermIdent)
-> T_ENonterminals_vOut10
T_ENonterminals_vOut10 Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_lhsOchildvisit PP_Doc
_lhsOcode PP_Doc
_lhsOdatas Seq Error
_lhsOerrors Map Int (Int, Int)
_lhsOfromToStates Map NontermIdent Int
_lhsOinitStates PP_Doc
_lhsOmodules Seq PP_Doc
_lhsOsemFunBndDefs Seq PP_Doc
_lhsOsemFunBndTps Map Int VisitKind
_lhsOvisitKinds Map Int (Set NontermIdent)
_lhsOvisitdefs Map Int (Set NontermIdent)
_lhsOvisituses
         in T_ENonterminals_vOut10
__result_ )
     in T_ENonterminals_v10 -> T_ENonterminals_s11
C_ENonterminals_s11 T_ENonterminals_v10
v10
   {-# INLINE rule169 #-}
   rule169 :: () -> Map k a
rule169 = \  (()
_ :: ()) ->
     forall k a. Map k a
Map.empty
   {-# INLINE rule170 #-}
   rule170 :: () -> PP_Doc
rule170 = \  (()
_ :: ()) ->
     PP_Doc
empty
   {-# INLINE rule171 #-}
   rule171 :: () -> PP_Doc
rule171 = \  (()
_ :: ()) ->
     PP_Doc
empty
   {-# INLINE rule172 #-}
   rule172 :: () -> Seq a
rule172 = \  (()
_ :: ()) ->
     forall a. Seq a
Seq.empty
   {-# INLINE rule173 #-}
   rule173 :: () -> Map Int (Int, Int)
rule173 = \  (()
_ :: ()) ->
     forall a. Monoid a => a
mempty
   {-# INLINE rule174 #-}
   rule174 :: () -> Map NontermIdent Int
rule174 = \  (()
_ :: ()) ->
     forall a. Monoid a => a
mempty
   {-# INLINE rule175 #-}
   rule175 :: () -> PP_Doc
rule175 = \  (()
_ :: ()) ->
     PP_Doc
empty
   {-# INLINE rule176 #-}
   rule176 :: () -> Seq a
rule176 = \  (()
_ :: ()) ->
     forall a. Seq a
Seq.empty
   {-# INLINE rule177 #-}
   rule177 :: () -> Seq a
rule177 = \  (()
_ :: ()) ->
     forall a. Seq a
Seq.empty
   {-# INLINE rule178 #-}
   rule178 :: () -> Map Int VisitKind
rule178 = \  (()
_ :: ()) ->
     forall a. Monoid a => a
mempty
   {-# INLINE rule179 #-}
   rule179 :: () -> Map k a
rule179 = \  (()
_ :: ()) ->
     forall k a. Map k a
Map.empty
   {-# INLINE rule180 #-}
   rule180 :: () -> Map k a
rule180 = \  (()
_ :: ()) ->
     forall k a. Map k a
Map.empty

-- EProduction -------------------------------------------------
-- wrapper
data Inh_EProduction  = Inh_EProduction { Inh_EProduction -> Map Int (Int, Int)
allFromToStates_Inh_EProduction :: (Map VisitIdentifier (Int,Int)), Inh_EProduction -> Map NontermIdent Attributes
allInhmap_Inh_EProduction :: (Map NontermIdent Attributes), Inh_EProduction -> Map NontermIdent Int
allInitStates_Inh_EProduction :: (Map NontermIdent Int), Inh_EProduction -> Map NontermIdent Attributes
allSynmap_Inh_EProduction :: (Map NontermIdent Attributes), Inh_EProduction -> Map Int VisitKind
allVisitKinds_Inh_EProduction :: (Map VisitIdentifier VisitKind), Inh_EProduction
-> Map
     Int
     (NontermIdent
      -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
allchildvisit_Inh_EProduction :: (Map VisitIdentifier (Identifier -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)), Inh_EProduction -> [Int]
allstates_Inh_EProduction :: ([StateIdentifier]), Inh_EProduction -> Map Int (Set NontermIdent)
avisitdefs_Inh_EProduction :: (Map VisitIdentifier (Set Identifier)), Inh_EProduction -> Map Int (Set NontermIdent)
avisituses_Inh_EProduction :: (Map VisitIdentifier (Set Identifier)), Inh_EProduction -> Attributes
inhmap_Inh_EProduction :: (Attributes), Inh_EProduction -> Int
initial_Inh_EProduction :: (StateIdentifier), Inh_EProduction -> Map NontermIdent Attributes
localAttrTypes_Inh_EProduction :: (Map ConstructorIdent (Map Identifier Type)), Inh_EProduction -> String
mainFile_Inh_EProduction :: (String), Inh_EProduction -> String
mainName_Inh_EProduction :: (String), Inh_EProduction -> Map Int StateCtx
nextVisits_Inh_EProduction :: (Map StateIdentifier StateCtx), Inh_EProduction -> NontermIdent
nt_Inh_EProduction :: (NontermIdent), Inh_EProduction -> Type
ntType_Inh_EProduction :: (Type), Inh_EProduction -> Options
options_Inh_EProduction :: (Options), Inh_EProduction -> [NontermIdent]
params_Inh_EProduction :: ([Identifier]), Inh_EProduction -> Map Int StateCtx
prevVisits_Inh_EProduction :: (Map StateIdentifier StateCtx), Inh_EProduction -> Bool
rename_Inh_EProduction :: (Bool), Inh_EProduction -> Attributes
synmap_Inh_EProduction :: (Attributes) }
data Syn_EProduction  = Syn_EProduction { Syn_EProduction -> [VisitStateState]
allvisits_Syn_EProduction :: ([VisitStateState]), Syn_EProduction
-> Map
     Int
     (NontermIdent
      -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
childvisit_Syn_EProduction :: (Map VisitIdentifier (Identifier -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)), Syn_EProduction -> Int
count_Syn_EProduction :: (Int), Syn_EProduction -> PP_Doc
datatype_Syn_EProduction :: (PP_Doc), Syn_EProduction -> PP_Doc
datatype_call_Syn_EProduction :: (PP_Doc), Syn_EProduction -> PP_Doc
datatype_con_Syn_EProduction :: (PP_Doc), Syn_EProduction -> Seq Error
errors_Syn_EProduction :: (Seq Error), Syn_EProduction -> Map Int (Int, Int)
fromToStates_Syn_EProduction :: (Map VisitIdentifier (Int,Int)), Syn_EProduction -> Seq PP_Doc
semFunBndDefs_Syn_EProduction :: (Seq PP_Doc), Syn_EProduction -> Seq PP_Doc
semFunBndTps_Syn_EProduction :: (Seq PP_Doc), Syn_EProduction -> PP_Doc
sem_nt_Syn_EProduction :: (PP_Doc), Syn_EProduction -> PP_Doc
sem_prod_Syn_EProduction :: (PP_Doc), Syn_EProduction -> PP_Doc
t_visits_Syn_EProduction :: (PP_Doc), Syn_EProduction -> Map Int VisitKind
visitKinds_Syn_EProduction :: (Map VisitIdentifier VisitKind), Syn_EProduction -> Map Int (Set NontermIdent)
visitdefs_Syn_EProduction :: (Map VisitIdentifier (Set Identifier)), Syn_EProduction -> Map Int (Set NontermIdent)
visituses_Syn_EProduction :: (Map VisitIdentifier (Set Identifier)) }
{-# INLINABLE wrap_EProduction #-}
wrap_EProduction :: T_EProduction  -> Inh_EProduction  -> (Syn_EProduction )
wrap_EProduction :: T_EProduction -> Inh_EProduction -> Syn_EProduction
wrap_EProduction (T_EProduction Identity T_EProduction_s14
act) (Inh_EProduction Map Int (Int, Int)
_lhsIallFromToStates Map NontermIdent Attributes
_lhsIallInhmap Map NontermIdent Int
_lhsIallInitStates Map NontermIdent Attributes
_lhsIallSynmap Map Int VisitKind
_lhsIallVisitKinds Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_lhsIallchildvisit [Int]
_lhsIallstates Map Int (Set NontermIdent)
_lhsIavisitdefs Map Int (Set NontermIdent)
_lhsIavisituses Attributes
_lhsIinhmap Int
_lhsIinitial Map NontermIdent Attributes
_lhsIlocalAttrTypes String
_lhsImainFile String
_lhsImainName Map Int StateCtx
_lhsInextVisits NontermIdent
_lhsInt Type
_lhsIntType Options
_lhsIoptions [NontermIdent]
_lhsIparams Map Int StateCtx
_lhsIprevVisits Bool
_lhsIrename Attributes
_lhsIsynmap) =
   forall a. Identity a -> a
Control.Monad.Identity.runIdentity (
     do T_EProduction_s14
sem <- Identity T_EProduction_s14
act
        let arg13 :: T_EProduction_vIn13
arg13 = Map Int (Int, Int)
-> Map NontermIdent Attributes
-> Map NontermIdent Int
-> Map NontermIdent Attributes
-> Map Int VisitKind
-> Map
     Int
     (NontermIdent
      -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
-> [Int]
-> Map Int (Set NontermIdent)
-> Map Int (Set NontermIdent)
-> Attributes
-> Int
-> Map NontermIdent Attributes
-> String
-> String
-> Map Int StateCtx
-> NontermIdent
-> Type
-> Options
-> [NontermIdent]
-> Map Int StateCtx
-> Bool
-> Attributes
-> T_EProduction_vIn13
T_EProduction_vIn13 Map Int (Int, Int)
_lhsIallFromToStates Map NontermIdent Attributes
_lhsIallInhmap Map NontermIdent Int
_lhsIallInitStates Map NontermIdent Attributes
_lhsIallSynmap Map Int VisitKind
_lhsIallVisitKinds Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_lhsIallchildvisit [Int]
_lhsIallstates Map Int (Set NontermIdent)
_lhsIavisitdefs Map Int (Set NontermIdent)
_lhsIavisituses Attributes
_lhsIinhmap Int
_lhsIinitial Map NontermIdent Attributes
_lhsIlocalAttrTypes String
_lhsImainFile String
_lhsImainName Map Int StateCtx
_lhsInextVisits NontermIdent
_lhsInt Type
_lhsIntType Options
_lhsIoptions [NontermIdent]
_lhsIparams Map Int StateCtx
_lhsIprevVisits Bool
_lhsIrename Attributes
_lhsIsynmap
        (T_EProduction_vOut13 [VisitStateState]
_lhsOallvisits Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_lhsOchildvisit Int
_lhsOcount PP_Doc
_lhsOdatatype PP_Doc
_lhsOdatatype_call PP_Doc
_lhsOdatatype_con Seq Error
_lhsOerrors Map Int (Int, Int)
_lhsOfromToStates Seq PP_Doc
_lhsOsemFunBndDefs Seq PP_Doc
_lhsOsemFunBndTps PP_Doc
_lhsOsem_nt PP_Doc
_lhsOsem_prod PP_Doc
_lhsOt_visits Map Int VisitKind
_lhsOvisitKinds Map Int (Set NontermIdent)
_lhsOvisitdefs Map Int (Set NontermIdent)
_lhsOvisituses) <- forall (m :: * -> *) a. Monad m => a -> m a
return (T_EProduction_s14 -> T_EProduction_v13
inv_EProduction_s14 T_EProduction_s14
sem T_EProduction_vIn13
arg13)
        forall (m :: * -> *) a. Monad m => a -> m a
return ([VisitStateState]
-> Map
     Int
     (NontermIdent
      -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
-> Int
-> PP_Doc
-> PP_Doc
-> PP_Doc
-> Seq Error
-> Map Int (Int, Int)
-> Seq PP_Doc
-> Seq PP_Doc
-> PP_Doc
-> PP_Doc
-> PP_Doc
-> Map Int VisitKind
-> Map Int (Set NontermIdent)
-> Map Int (Set NontermIdent)
-> Syn_EProduction
Syn_EProduction [VisitStateState]
_lhsOallvisits Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_lhsOchildvisit Int
_lhsOcount PP_Doc
_lhsOdatatype PP_Doc
_lhsOdatatype_call PP_Doc
_lhsOdatatype_con Seq Error
_lhsOerrors Map Int (Int, Int)
_lhsOfromToStates Seq PP_Doc
_lhsOsemFunBndDefs Seq PP_Doc
_lhsOsemFunBndTps PP_Doc
_lhsOsem_nt PP_Doc
_lhsOsem_prod PP_Doc
_lhsOt_visits Map Int VisitKind
_lhsOvisitKinds Map Int (Set NontermIdent)
_lhsOvisitdefs Map Int (Set NontermIdent)
_lhsOvisituses)
   )

-- cata
{-# INLINE sem_EProduction #-}
sem_EProduction :: EProduction  -> T_EProduction 
sem_EProduction :: EProduction -> T_EProduction
sem_EProduction ( EProduction NontermIdent
con_ [NontermIdent]
params_ [Type]
constraints_ ERules
rules_ EChildren
children_ Visits
visits_ ) = NontermIdent
-> [NontermIdent]
-> [Type]
-> T_ERules
-> T_EChildren
-> T_Visits
-> T_EProduction
sem_EProduction_EProduction NontermIdent
con_ [NontermIdent]
params_ [Type]
constraints_ ( ERules -> T_ERules
sem_ERules ERules
rules_ ) ( EChildren -> T_EChildren
sem_EChildren EChildren
children_ ) ( Visits -> T_Visits
sem_Visits Visits
visits_ )

-- semantic domain
newtype T_EProduction  = T_EProduction {
                                       T_EProduction -> Identity T_EProduction_s14
attach_T_EProduction :: Identity (T_EProduction_s14 )
                                       }
newtype T_EProduction_s14  = C_EProduction_s14 {
                                               T_EProduction_s14 -> T_EProduction_v13
inv_EProduction_s14 :: (T_EProduction_v13 )
                                               }
data T_EProduction_s15  = C_EProduction_s15
type T_EProduction_v13  = (T_EProduction_vIn13 ) -> (T_EProduction_vOut13 )
data T_EProduction_vIn13  = T_EProduction_vIn13 (Map VisitIdentifier (Int,Int)) (Map NontermIdent Attributes) (Map NontermIdent Int) (Map NontermIdent Attributes) (Map VisitIdentifier VisitKind) (Map VisitIdentifier (Identifier -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)) ([StateIdentifier]) (Map VisitIdentifier (Set Identifier)) (Map VisitIdentifier (Set Identifier)) (Attributes) (StateIdentifier) (Map ConstructorIdent (Map Identifier Type)) (String) (String) (Map StateIdentifier StateCtx) (NontermIdent) (Type) (Options) ([Identifier]) (Map StateIdentifier StateCtx) (Bool) (Attributes)
data T_EProduction_vOut13  = T_EProduction_vOut13 ([VisitStateState]) (Map VisitIdentifier (Identifier -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)) (Int) (PP_Doc) (PP_Doc) (PP_Doc) (Seq Error) (Map VisitIdentifier (Int,Int)) (Seq PP_Doc) (Seq PP_Doc) (PP_Doc) (PP_Doc) (PP_Doc) (Map VisitIdentifier VisitKind) (Map VisitIdentifier (Set Identifier)) (Map VisitIdentifier (Set Identifier))
{-# NOINLINE sem_EProduction_EProduction #-}
sem_EProduction_EProduction :: (ConstructorIdent) -> ([Identifier]) -> ([Type]) -> T_ERules  -> T_EChildren  -> T_Visits  -> T_EProduction 
sem_EProduction_EProduction :: NontermIdent
-> [NontermIdent]
-> [Type]
-> T_ERules
-> T_EChildren
-> T_Visits
-> T_EProduction
sem_EProduction_EProduction NontermIdent
arg_con_ [NontermIdent]
arg_params_ [Type]
_ T_ERules
arg_rules_ T_EChildren
arg_children_ T_Visits
arg_visits_ = Identity T_EProduction_s14 -> T_EProduction
T_EProduction (forall (m :: * -> *) a. Monad m => a -> m a
return T_EProduction_s14
st14) where
   {-# NOINLINE st14 #-}
   st14 :: T_EProduction_s14
st14 = let
      v13 :: T_EProduction_v13 
      v13 :: T_EProduction_v13
v13 = \ (T_EProduction_vIn13 Map Int (Int, Int)
_lhsIallFromToStates Map NontermIdent Attributes
_lhsIallInhmap Map NontermIdent Int
_lhsIallInitStates Map NontermIdent Attributes
_lhsIallSynmap Map Int VisitKind
_lhsIallVisitKinds Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_lhsIallchildvisit [Int]
_lhsIallstates Map Int (Set NontermIdent)
_lhsIavisitdefs Map Int (Set NontermIdent)
_lhsIavisituses Attributes
_lhsIinhmap Int
_lhsIinitial Map NontermIdent Attributes
_lhsIlocalAttrTypes String
_lhsImainFile String
_lhsImainName Map Int StateCtx
_lhsInextVisits NontermIdent
_lhsInt Type
_lhsIntType Options
_lhsIoptions [NontermIdent]
_lhsIparams Map Int StateCtx
_lhsIprevVisits Bool
_lhsIrename Attributes
_lhsIsynmap) -> ( let
         _rulesX23 :: T_ERules_s23
_rulesX23 = forall a. Identity a -> a
Control.Monad.Identity.runIdentity (T_ERules -> Identity T_ERules_s23
attach_T_ERules (T_ERules
arg_rules_))
         _childrenX5 :: T_EChildren_s5
_childrenX5 = forall a. Identity a -> a
Control.Monad.Identity.runIdentity (T_EChildren -> Identity T_EChildren_s5
attach_T_EChildren (T_EChildren
arg_children_))
         _visitsX56 :: T_Visits_s56
_visitsX56 = forall a. Identity a -> a
Control.Monad.Identity.runIdentity (T_Visits -> Identity T_Visits_s56
attach_T_Visits (T_Visits
arg_visits_))
         (T_ERules_vOut22 Seq Error
_rulesIerrors Map NontermIdent (VisitKind -> Either Error PP_Doc)
_rulesImrules Map NontermIdent (Set String)
_rulesIruledefs Map NontermIdent (Map String (Maybe NonLocalAttr))
_rulesIruleuses PP_Doc
_rulesIsem_rules) = T_ERules_s23 -> T_ERules_v22
inv_ERules_s23 T_ERules_s23
_rulesX23 (Map NontermIdent Attributes
-> Map NontermIdent Attributes
-> Attributes
-> NontermIdent
-> Attributes
-> Set String
-> Attributes
-> String
-> String
-> NontermIdent
-> Options
-> Map NontermIdent (Set VisitKind)
-> Attributes
-> Map NontermIdent Int
-> T_ERules_vIn22
T_ERules_vIn22 Map NontermIdent Attributes
_rulesOallInhmap Map NontermIdent Attributes
_rulesOallSynmap Attributes
_rulesOchildTypes NontermIdent
_rulesOcon Attributes
_rulesOinhmap Set String
_rulesOlazyIntras Attributes
_rulesOlocalAttrTypes String
_rulesOmainFile String
_rulesOmainName NontermIdent
_rulesOnt Options
_rulesOoptions Map NontermIdent (Set VisitKind)
_rulesOruleKinds Attributes
_rulesOsynmap Map NontermIdent Int
_rulesOusageInfo)
         (T_EChildren_vOut4 [PP_Doc]
_childrenIargnamesw Attributes
_childrenIchildTypes Map
  NontermIdent
  (VisitKind
   -> Either
        Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
_childrenIchildintros [(PP_Doc, PP_Doc, PP_Doc, PP_Doc)]
_childrenIsigs Set String
_childrenIterminaldefs) = T_EChildren_s5 -> T_EChildren_v4
inv_EChildren_s5 T_EChildren_s5
_childrenX5 (Map NontermIdent Int
-> NontermIdent
-> String
-> String
-> NontermIdent
-> Options
-> T_EChildren_vIn4
T_EChildren_vIn4 Map NontermIdent Int
_childrenOallInitStates NontermIdent
_childrenOcon String
_childrenOmainFile String
_childrenOmainName NontermIdent
_childrenOnt Options
_childrenOoptions)
         (T_Visits_vOut55 [VisitStateState]
_visitsIallvisits Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_visitsIchildvisit Seq Error
_visitsIerrors Map Int (Int, Int)
_visitsIfromToStates Map Int (Map String (Maybe NonLocalAttr))
_visitsIintramap Set String
_visitsIlazyIntras Map NontermIdent (Set VisitKind)
_visitsIruleKinds Map NontermIdent Int
_visitsIruleUsage [(Int, PP_Doc)]
_visitsIsem_visit PP_Doc
_visitsIt_visits Map Int VisitKind
_visitsIvisitKinds Map Int (Set NontermIdent)
_visitsIvisitdefs Map Int (Set NontermIdent)
_visitsIvisituses) = T_Visits_s56 -> T_Visits_v55
inv_Visits_s56 T_Visits_s56
_visitsX56 (Map Int (Int, Int)
-> Map NontermIdent Attributes
-> Map NontermIdent Int
-> Map NontermIdent Attributes
-> Map Int VisitKind
-> Map
     Int
     (NontermIdent
      -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
-> Map Int (Map String (Maybe NonLocalAttr))
-> Map Int (Set NontermIdent)
-> Map Int (Set NontermIdent)
-> Attributes
-> Map
     NontermIdent
     (VisitKind
      -> Either
           Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
-> NontermIdent
-> Attributes
-> Map NontermIdent (VisitKind -> Either Error PP_Doc)
-> Map Int StateCtx
-> NontermIdent
-> Options
-> [NontermIdent]
-> Map Int StateCtx
-> Map NontermIdent (Set String)
-> Map NontermIdent (Map String (Maybe NonLocalAttr))
-> Attributes
-> Set String
-> T_Visits_vIn55
T_Visits_vIn55 Map Int (Int, Int)
_visitsOallFromToStates Map NontermIdent Attributes
_visitsOallInhmap Map NontermIdent Int
_visitsOallInitStates Map NontermIdent Attributes
_visitsOallSynmap Map Int VisitKind
_visitsOallVisitKinds Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_visitsOallchildvisit Map Int (Map String (Maybe NonLocalAttr))
_visitsOallintramap Map Int (Set NontermIdent)
_visitsOavisitdefs Map Int (Set NontermIdent)
_visitsOavisituses Attributes
_visitsOchildTypes Map
  NontermIdent
  (VisitKind
   -> Either
        Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
_visitsOchildintros NontermIdent
_visitsOcon Attributes
_visitsOinhmap Map NontermIdent (VisitKind -> Either Error PP_Doc)
_visitsOmrules Map Int StateCtx
_visitsOnextVisits NontermIdent
_visitsOnt Options
_visitsOoptions [NontermIdent]
_visitsOparams Map Int StateCtx
_visitsOprevVisits Map NontermIdent (Set String)
_visitsOruledefs Map NontermIdent (Map String (Maybe NonLocalAttr))
_visitsOruleuses Attributes
_visitsOsynmap Set String
_visitsOterminaldefs)
         _childrenOcon :: NontermIdent
_childrenOcon = forall a. a -> a
rule181 NontermIdent
arg_con_
         _rulesOcon :: NontermIdent
_rulesOcon = forall a. a -> a
rule182 NontermIdent
arg_con_
         _visitsOcon :: NontermIdent
_visitsOcon = forall a. a -> a
rule183 NontermIdent
arg_con_
         _o_records :: Bool
_o_records = Options -> Bool
rule184 Options
_lhsIoptions
         _t_params :: PP_Doc
_t_params = [NontermIdent] -> PP_Doc
rule185 [NontermIdent]
_lhsIparams
         _t_c_params :: PP_Doc
_t_c_params = [NontermIdent] -> PP_Doc
rule186 [NontermIdent]
arg_params_
         _conname :: String
_conname = NontermIdent -> Bool -> NontermIdent -> String
rule187 NontermIdent
_lhsInt Bool
_lhsIrename NontermIdent
arg_con_
         _recname :: PP_Doc
_recname = String -> PP_Doc
rule188 String
_conname
         _lhsOdatatype :: PP_Doc
         _lhsOdatatype :: PP_Doc
_lhsOdatatype = [(PP_Doc, PP_Doc, PP_Doc, PP_Doc)]
-> Bool -> PP_Doc -> PP_Doc -> PP_Doc
rule189 [(PP_Doc, PP_Doc, PP_Doc, PP_Doc)]
_childrenIsigs Bool
_o_records PP_Doc
_recname PP_Doc
_t_params
         _lhsOdatatype_call :: PP_Doc
         _lhsOdatatype_call :: PP_Doc
_lhsOdatatype_call = String -> PP_Doc -> PP_Doc -> PP_Doc
rule190 String
_conname PP_Doc
_recname PP_Doc
_t_params
         _lhsOdatatype_con :: PP_Doc
         _lhsOdatatype_con :: PP_Doc
_lhsOdatatype_con = [(PP_Doc, PP_Doc, PP_Doc, PP_Doc)]
-> String
-> NontermIdent
-> Bool
-> Bool
-> PP_Doc
-> NontermIdent
-> PP_Doc
rule191 [(PP_Doc, PP_Doc, PP_Doc, PP_Doc)]
_childrenIsigs String
_conname NontermIdent
_lhsInt Bool
_o_records Bool
_o_sigs PP_Doc
_t_params NontermIdent
arg_con_
         _lhsOcount :: Int
         _lhsOcount :: Int
_lhsOcount = () -> Int
rule192  ()
         _lhsOsem_nt :: PP_Doc
         _lhsOsem_nt :: PP_Doc
_lhsOsem_nt = [PP_Doc]
-> [(PP_Doc, PP_Doc, PP_Doc, PP_Doc)]
-> NontermIdent
-> Options
-> Bool
-> Bool
-> NontermIdent
-> PP_Doc
rule193 [PP_Doc]
_childrenIargnamesw [(PP_Doc, PP_Doc, PP_Doc, PP_Doc)]
_childrenIsigs NontermIdent
_lhsInt Options
_lhsIoptions Bool
_lhsIrename Bool
_o_records NontermIdent
arg_con_
         _lhsOsemFunBndDefs :: Seq PP_Doc
         _lhsOsemFunBndDefs :: Seq PP_Doc
_lhsOsemFunBndDefs = forall a. a -> Seq a
rule194 PP_Doc
_semFunBndDef
         _lhsOsemFunBndTps :: Seq PP_Doc
         _lhsOsemFunBndTps :: Seq PP_Doc
_lhsOsemFunBndTps = forall a. a -> Seq a
rule195 PP_Doc
_semFunBndTp
         _semFunBndDef :: PP_Doc
_semFunBndDef = String -> PP_Doc -> PP_Doc
rule196 String
_semFunBndNm PP_Doc
_semname
         _semFunBndTp :: PP_Doc
_semFunBndTp = String -> PP_Doc -> PP_Doc
rule197 String
_semFunBndNm PP_Doc
_sem_tp
         _semFunBndNm :: String
_semFunBndNm = NontermIdent -> NontermIdent -> String
rule198 NontermIdent
_lhsInt NontermIdent
arg_con_
         _o_sigs :: Bool
_o_sigs = Options -> Bool
rule199 Options
_lhsIoptions
         _t_type :: PP_Doc
_t_type = NontermIdent -> PP_Doc
rule200 NontermIdent
_lhsInt
         _semname :: PP_Doc
_semname = NontermIdent -> Options -> NontermIdent -> PP_Doc
rule201 NontermIdent
_lhsInt Options
_lhsIoptions NontermIdent
arg_con_
         _sem_res_tp :: PP_Doc
_sem_res_tp = PP_Doc -> PP_Doc -> PP_Doc
rule202 PP_Doc
_t_params PP_Doc
_t_type
         _sem_tp :: PP_Doc
_sem_tp = [(PP_Doc, PP_Doc, PP_Doc, PP_Doc)] -> PP_Doc -> PP_Doc
rule203 [(PP_Doc, PP_Doc, PP_Doc, PP_Doc)]
_childrenIsigs PP_Doc
_sem_res_tp
         _initializer :: PP_Doc
_initializer = () -> PP_Doc
rule204  ()
         _sem_prod :: PP_Doc
_sem_prod = [(PP_Doc, PP_Doc, PP_Doc, PP_Doc)]
-> Bool -> PP_Doc -> PP_Doc -> PP_Doc -> PP_Doc
rule205 [(PP_Doc, PP_Doc, PP_Doc, PP_Doc)]
_childrenIsigs Bool
_o_sigs PP_Doc
_prod_body PP_Doc
_sem_res_tp PP_Doc
_semname
         _prod_body :: PP_Doc
_prod_body = PP_Doc
-> Int
-> NontermIdent
-> PP_Doc
-> [PP_Doc]
-> NontermIdent
-> PP_Doc
rule206 PP_Doc
_initializer Int
_lhsIinitial NontermIdent
_lhsInt PP_Doc
_rulesIsem_rules [PP_Doc]
_statefuns NontermIdent
arg_con_
         _statefuns :: [PP_Doc]
_statefuns = forall {b}. (Int -> b) -> [Int] -> [b]
rule207 Int -> PP_Doc
_genstfn [Int]
_lhsIallstates
         _genstfn :: Int -> PP_Doc
_genstfn = Int
-> Map Int StateCtx
-> NontermIdent
-> (Int -> PP_Doc)
-> (Int -> [PP_Doc])
-> (Int -> [PP_Doc])
-> Int
-> PP_Doc
rule208 Int
_lhsIinitial Map Int StateCtx
_lhsInextVisits NontermIdent
_lhsInt Int -> PP_Doc
_stargs Int -> [PP_Doc]
_stks Int -> [PP_Doc]
_stvs
         _stargs :: Int -> PP_Doc
_stargs = Attributes
-> Map NontermIdent Attributes
-> Map NontermIdent Attributes
-> Options
-> Attributes
-> Map Int (Map String (Maybe NonLocalAttr))
-> Int
-> PP_Doc
rule209 Attributes
_childTypes Map NontermIdent Attributes
_lhsIallInhmap Map NontermIdent Attributes
_lhsIallSynmap Options
_lhsIoptions Attributes
_localAttrTypes Map Int (Map String (Maybe NonLocalAttr))
_visitsIintramap
         _stvisits :: Int -> [VisitStateState]
_stvisits = [VisitStateState] -> Int -> [VisitStateState]
rule210 [VisitStateState]
_visitsIallvisits
         _stks :: Int -> [PP_Doc]
_stks = forall {b} {c}.
Map Int StateCtx
-> NontermIdent
-> (Int -> [(Int, b, c)])
-> PP_Doc
-> NontermIdent
-> Int
-> [PP_Doc]
rule211 Map Int StateCtx
_lhsInextVisits NontermIdent
_lhsInt Int -> [VisitStateState]
_stvisits PP_Doc
_t_c_params NontermIdent
arg_con_
         _stvs :: Int -> [PP_Doc]
_stvs = [(Int, PP_Doc)] -> Int -> [PP_Doc]
rule212 [(Int, PP_Doc)]
_visitsIsem_visit
         _visitsOmrules :: Map NontermIdent (VisitKind -> Either Error PP_Doc)
_visitsOmrules = Map NontermIdent (VisitKind -> Either Error PP_Doc)
-> Map NontermIdent (VisitKind -> Either Error PP_Doc)
rule213 Map NontermIdent (VisitKind -> Either Error PP_Doc)
_rulesImrules
         _visitsOchildintros :: Map
  NontermIdent
  (VisitKind
   -> Either
        Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
_visitsOchildintros = Map
  NontermIdent
  (VisitKind
   -> Either
        Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
-> Map
     NontermIdent
     (VisitKind
      -> Either
           Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
rule214 Map
  NontermIdent
  (VisitKind
   -> Either
        Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
_childrenIchildintros
         _rulesOusageInfo :: Map NontermIdent Int
_rulesOusageInfo = Map NontermIdent Int -> Map NontermIdent Int
rule215 Map NontermIdent Int
_visitsIruleUsage
         _rulesOruleKinds :: Map NontermIdent (Set VisitKind)
_rulesOruleKinds = Map NontermIdent (Set VisitKind)
-> Map NontermIdent (Set VisitKind)
rule216 Map NontermIdent (Set VisitKind)
_visitsIruleKinds
         _visitsOallintramap :: Map Int (Map String (Maybe NonLocalAttr))
_visitsOallintramap = Map Int (Map String (Maybe NonLocalAttr))
-> Map Int (Map String (Maybe NonLocalAttr))
rule217 Map Int (Map String (Maybe NonLocalAttr))
_visitsIintramap
         _visitsOterminaldefs :: Set String
_visitsOterminaldefs = Set String -> Set String
rule218 Set String
_childrenIterminaldefs
         _visitsOruledefs :: Map NontermIdent (Set String)
_visitsOruledefs = Map NontermIdent (Set String) -> Map NontermIdent (Set String)
rule219 Map NontermIdent (Set String)
_rulesIruledefs
         _visitsOruleuses :: Map NontermIdent (Map String (Maybe NonLocalAttr))
_visitsOruleuses = Map NontermIdent (Map String (Maybe NonLocalAttr))
-> Map NontermIdent (Map String (Maybe NonLocalAttr))
rule220 Map NontermIdent (Map String (Maybe NonLocalAttr))
_rulesIruleuses
         _lazyIntras :: Set String
_lazyIntras = Set String -> Set String
rule221 Set String
_visitsIlazyIntras
         _childTypes :: Attributes
_childTypes = Attributes -> Type -> Attributes
rule222 Attributes
_childrenIchildTypes Type
_lhsIntType
         _localAttrTypes :: Attributes
_localAttrTypes = Map NontermIdent Attributes -> NontermIdent -> Attributes
rule223 Map NontermIdent Attributes
_lhsIlocalAttrTypes NontermIdent
arg_con_
         _lhsOchildvisit :: Map VisitIdentifier (Identifier -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
         _lhsOchildvisit :: Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_lhsOchildvisit = Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
-> Map
     Int
     (NontermIdent
      -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
rule224 Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_visitsIchildvisit
         _lhsOerrors :: Seq Error
         _lhsOerrors :: Seq Error
_lhsOerrors = Seq Error -> Seq Error -> Seq Error
rule225 Seq Error
_rulesIerrors Seq Error
_visitsIerrors
         _lhsOfromToStates :: Map VisitIdentifier (Int,Int)
         _lhsOfromToStates :: Map Int (Int, Int)
_lhsOfromToStates = Map Int (Int, Int) -> Map Int (Int, Int)
rule226 Map Int (Int, Int)
_visitsIfromToStates
         _lhsOt_visits :: PP_Doc
         _lhsOt_visits :: PP_Doc
_lhsOt_visits = PP_Doc -> PP_Doc
rule227 PP_Doc
_visitsIt_visits
         _lhsOvisitKinds :: Map VisitIdentifier VisitKind
         _lhsOvisitKinds :: Map Int VisitKind
_lhsOvisitKinds = Map Int VisitKind -> Map Int VisitKind
rule228 Map Int VisitKind
_visitsIvisitKinds
         _lhsOvisitdefs :: Map VisitIdentifier (Set Identifier)
         _lhsOvisitdefs :: Map Int (Set NontermIdent)
_lhsOvisitdefs = Map Int (Set NontermIdent) -> Map Int (Set NontermIdent)
rule229 Map Int (Set NontermIdent)
_visitsIvisitdefs
         _lhsOvisituses :: Map VisitIdentifier (Set Identifier)
         _lhsOvisituses :: Map Int (Set NontermIdent)
_lhsOvisituses = Map Int (Set NontermIdent) -> Map Int (Set NontermIdent)
rule230 Map Int (Set NontermIdent)
_visitsIvisituses
         _lhsOallvisits :: [VisitStateState]
         _lhsOallvisits :: [VisitStateState]
_lhsOallvisits = [VisitStateState] -> [VisitStateState]
rule231 [VisitStateState]
_visitsIallvisits
         _lhsOsem_prod :: PP_Doc
         _lhsOsem_prod :: PP_Doc
_lhsOsem_prod = forall a. a -> a
rule232 PP_Doc
_sem_prod
         _rulesOallInhmap :: Map NontermIdent Attributes
_rulesOallInhmap = Map NontermIdent Attributes -> Map NontermIdent Attributes
rule233 Map NontermIdent Attributes
_lhsIallInhmap
         _rulesOallSynmap :: Map NontermIdent Attributes
_rulesOallSynmap = Map NontermIdent Attributes -> Map NontermIdent Attributes
rule234 Map NontermIdent Attributes
_lhsIallSynmap
         _rulesOchildTypes :: Attributes
_rulesOchildTypes = forall a. a -> a
rule235 Attributes
_childTypes
         _rulesOinhmap :: Attributes
_rulesOinhmap = Attributes -> Attributes
rule236 Attributes
_lhsIinhmap
         _rulesOlazyIntras :: Set String
_rulesOlazyIntras = forall a. a -> a
rule237 Set String
_lazyIntras
         _rulesOlocalAttrTypes :: Attributes
_rulesOlocalAttrTypes = forall a. a -> a
rule238 Attributes
_localAttrTypes
         _rulesOmainFile :: String
_rulesOmainFile = String -> String
rule239 String
_lhsImainFile
         _rulesOmainName :: String
_rulesOmainName = String -> String
rule240 String
_lhsImainName
         _rulesOnt :: NontermIdent
_rulesOnt = NontermIdent -> NontermIdent
rule241 NontermIdent
_lhsInt
         _rulesOoptions :: Options
_rulesOoptions = Options -> Options
rule242 Options
_lhsIoptions
         _rulesOsynmap :: Attributes
_rulesOsynmap = Attributes -> Attributes
rule243 Attributes
_lhsIsynmap
         _childrenOallInitStates :: Map NontermIdent Int
_childrenOallInitStates = Map NontermIdent Int -> Map NontermIdent Int
rule244 Map NontermIdent Int
_lhsIallInitStates
         _childrenOmainFile :: String
_childrenOmainFile = String -> String
rule245 String
_lhsImainFile
         _childrenOmainName :: String
_childrenOmainName = String -> String
rule246 String
_lhsImainName
         _childrenOnt :: NontermIdent
_childrenOnt = NontermIdent -> NontermIdent
rule247 NontermIdent
_lhsInt
         _childrenOoptions :: Options
_childrenOoptions = Options -> Options
rule248 Options
_lhsIoptions
         _visitsOallFromToStates :: Map Int (Int, Int)
_visitsOallFromToStates = Map Int (Int, Int) -> Map Int (Int, Int)
rule249 Map Int (Int, Int)
_lhsIallFromToStates
         _visitsOallInhmap :: Map NontermIdent Attributes
_visitsOallInhmap = Map NontermIdent Attributes -> Map NontermIdent Attributes
rule250 Map NontermIdent Attributes
_lhsIallInhmap
         _visitsOallInitStates :: Map NontermIdent Int
_visitsOallInitStates = Map NontermIdent Int -> Map NontermIdent Int
rule251 Map NontermIdent Int
_lhsIallInitStates
         _visitsOallSynmap :: Map NontermIdent Attributes
_visitsOallSynmap = Map NontermIdent Attributes -> Map NontermIdent Attributes
rule252 Map NontermIdent Attributes
_lhsIallSynmap
         _visitsOallVisitKinds :: Map Int VisitKind
_visitsOallVisitKinds = Map Int VisitKind -> Map Int VisitKind
rule253 Map Int VisitKind
_lhsIallVisitKinds
         _visitsOallchildvisit :: Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_visitsOallchildvisit = Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
-> Map
     Int
     (NontermIdent
      -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
rule254 Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_lhsIallchildvisit
         _visitsOavisitdefs :: Map Int (Set NontermIdent)
_visitsOavisitdefs = Map Int (Set NontermIdent) -> Map Int (Set NontermIdent)
rule255 Map Int (Set NontermIdent)
_lhsIavisitdefs
         _visitsOavisituses :: Map Int (Set NontermIdent)
_visitsOavisituses = Map Int (Set NontermIdent) -> Map Int (Set NontermIdent)
rule256 Map Int (Set NontermIdent)
_lhsIavisituses
         _visitsOchildTypes :: Attributes
_visitsOchildTypes = forall a. a -> a
rule257 Attributes
_childTypes
         _visitsOinhmap :: Attributes
_visitsOinhmap = Attributes -> Attributes
rule258 Attributes
_lhsIinhmap
         _visitsOnextVisits :: Map Int StateCtx
_visitsOnextVisits = Map Int StateCtx -> Map Int StateCtx
rule259 Map Int StateCtx
_lhsInextVisits
         _visitsOnt :: NontermIdent
_visitsOnt = NontermIdent -> NontermIdent
rule260 NontermIdent
_lhsInt
         _visitsOoptions :: Options
_visitsOoptions = Options -> Options
rule261 Options
_lhsIoptions
         _visitsOparams :: [NontermIdent]
_visitsOparams = [NontermIdent] -> [NontermIdent]
rule262 [NontermIdent]
_lhsIparams
         _visitsOprevVisits :: Map Int StateCtx
_visitsOprevVisits = Map Int StateCtx -> Map Int StateCtx
rule263 Map Int StateCtx
_lhsIprevVisits
         _visitsOsynmap :: Attributes
_visitsOsynmap = Attributes -> Attributes
rule264 Attributes
_lhsIsynmap
         __result_ :: T_EProduction_vOut13
__result_ = [VisitStateState]
-> Map
     Int
     (NontermIdent
      -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
-> Int
-> PP_Doc
-> PP_Doc
-> PP_Doc
-> Seq Error
-> Map Int (Int, Int)
-> Seq PP_Doc
-> Seq PP_Doc
-> PP_Doc
-> PP_Doc
-> PP_Doc
-> Map Int VisitKind
-> Map Int (Set NontermIdent)
-> Map Int (Set NontermIdent)
-> T_EProduction_vOut13
T_EProduction_vOut13 [VisitStateState]
_lhsOallvisits Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_lhsOchildvisit Int
_lhsOcount PP_Doc
_lhsOdatatype PP_Doc
_lhsOdatatype_call PP_Doc
_lhsOdatatype_con Seq Error
_lhsOerrors Map Int (Int, Int)
_lhsOfromToStates Seq PP_Doc
_lhsOsemFunBndDefs Seq PP_Doc
_lhsOsemFunBndTps PP_Doc
_lhsOsem_nt PP_Doc
_lhsOsem_prod PP_Doc
_lhsOt_visits Map Int VisitKind
_lhsOvisitKinds Map Int (Set NontermIdent)
_lhsOvisitdefs Map Int (Set NontermIdent)
_lhsOvisituses
         in T_EProduction_vOut13
__result_ )
     in T_EProduction_v13 -> T_EProduction_s14
C_EProduction_s14 T_EProduction_v13
v13
   {-# INLINE rule181 #-}
   {-# LINE 90 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule181 = \ con_ ->
                                               {-# LINE 90 "src-ag/ExecutionPlan2Caml.ag" #-}
                                               con_
                                               {-# LINE 1904 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule182 #-}
   {-# LINE 91 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule182 = \ con_ ->
                   {-# LINE 91 "src-ag/ExecutionPlan2Caml.ag" #-}
                   con_
                   {-# LINE 1910 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule183 #-}
   {-# LINE 92 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule183 = \ con_ ->
                   {-# LINE 92 "src-ag/ExecutionPlan2Caml.ag" #-}
                   con_
                   {-# LINE 1916 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule184 #-}
   {-# LINE 259 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule184 = \ ((_lhsIoptions) :: Options) ->
                    {-# LINE 259 "src-ag/ExecutionPlan2Caml.ag" #-}
                    dataRecords _lhsIoptions
                    {-# LINE 1922 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule185 #-}
   {-# LINE 260 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule185 = \ ((_lhsIparams) :: [Identifier]) ->
                   {-# LINE 260 "src-ag/ExecutionPlan2Caml.ag" #-}
                   ppTypeParams _lhsIparams
                   {-# LINE 1928 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule186 #-}
   {-# LINE 261 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule186 = \ params_ ->
                     {-# LINE 261 "src-ag/ExecutionPlan2Caml.ag" #-}
                     ppTypeParams (cont_tvar : map pp params_)
                     {-# LINE 1934 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule187 #-}
   {-# LINE 262 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule187 = \ ((_lhsInt) :: NontermIdent) ((_lhsIrename) :: Bool) con_ ->
                  {-# LINE 262 "src-ag/ExecutionPlan2Caml.ag" #-}
                  conname _lhsIrename _lhsInt con_
                  {-# LINE 1940 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule188 #-}
   {-# LINE 263 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule188 = \ _conname ->
                  {-# LINE 263 "src-ag/ExecutionPlan2Caml.ag" #-}
                  pp "fields_" >|< _conname
                  {-# LINE 1946 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule189 #-}
   {-# LINE 264 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule189 = \ ((_childrenIsigs) :: [(PP_Doc,PP_Doc,PP_Doc,PP_Doc)]) _o_records _recname _t_params ->
                   {-# LINE 264 "src-ag/ExecutionPlan2Caml.ag" #-}
                   "and" >#< _t_params     >#< _recname     >#< "="
                   >#< ppFieldsType _o_records     False _childrenIsigs
                   {-# LINE 1953 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule190 #-}
   {-# LINE 266 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule190 = \ _conname _recname _t_params ->
                        {-# LINE 266 "src-ag/ExecutionPlan2Caml.ag" #-}
                        pp "|" >#< _conname     >#< "of" >#< pp_parens (_t_params     >#< _recname    )
                        {-# LINE 1959 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule191 #-}
   {-# LINE 268 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule191 = \ ((_childrenIsigs) :: [(PP_Doc,PP_Doc,PP_Doc,PP_Doc)]) _conname ((_lhsInt) :: NontermIdent) _o_records _o_sigs _t_params con_ ->
        {-# LINE 268 "src-ag/ExecutionPlan2Caml.ag" #-}
        let funNm  = _lhsInt >|< "_" >|< con_
            decl   = "and" >#< ppFunDecl _o_sigs     funNm params (_t_params     >#< _lhsInt) body
            params = [ (x, t) | (_,x,_,t) <- _childrenIsigs ]
            body   = _conname     >#< ppFieldsVal _o_records     _childrenIsigs
        in decl
        {-# LINE 1969 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule192 #-}
   {-# LINE 384 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule192 = \  (_ :: ()) ->
                                              {-# LINE 384 "src-ag/ExecutionPlan2Caml.ag" #-}
                                              1
                                              {-# LINE 1975 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule193 #-}
   {-# LINE 389 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule193 = \ ((_childrenIargnamesw) :: [PP_Doc]) ((_childrenIsigs) :: [(PP_Doc,PP_Doc,PP_Doc,PP_Doc)]) ((_lhsInt) :: NontermIdent) ((_lhsIoptions) :: Options) ((_lhsIrename) :: Bool) _o_records con_ ->
                 {-# LINE 389 "src-ag/ExecutionPlan2Caml.ag" #-}
                 "|" >#< conname _lhsIrename _lhsInt con_ >#< ppFieldsVal _o_records     _childrenIsigs >#< "->" >#<
                   prefix _lhsIoptions >|< _lhsInt >|< "_" >|< con_ >#< ppSpaced _childrenIargnamesw
                 {-# LINE 1982 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule194 #-}
   {-# LINE 655 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule194 = \ _semFunBndDef ->
                        {-# LINE 655 "src-ag/ExecutionPlan2Caml.ag" #-}
                        Seq.singleton _semFunBndDef
                        {-# LINE 1988 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule195 #-}
   {-# LINE 656 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule195 = \ _semFunBndTp ->
                        {-# LINE 656 "src-ag/ExecutionPlan2Caml.ag" #-}
                        Seq.singleton _semFunBndTp
                        {-# LINE 1994 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule196 #-}
   {-# LINE 657 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule196 = \ _semFunBndNm _semname ->
                        {-# LINE 657 "src-ag/ExecutionPlan2Caml.ag" #-}
                        _semFunBndNm     >#< "=" >#< _semname
                        {-# LINE 2000 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule197 #-}
   {-# LINE 658 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule197 = \ _semFunBndNm _sem_tp ->
                        {-# LINE 658 "src-ag/ExecutionPlan2Caml.ag" #-}
                        _semFunBndNm     >#< ":" >#< _sem_tp
                        {-# LINE 2006 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule198 #-}
   {-# LINE 659 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule198 = \ ((_lhsInt) :: NontermIdent) con_ ->
                        {-# LINE 659 "src-ag/ExecutionPlan2Caml.ag" #-}
                        lateSemConLabel _lhsInt con_
                        {-# LINE 2012 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule199 #-}
   {-# LINE 686 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule199 = \ ((_lhsIoptions) :: Options) ->
                     {-# LINE 686 "src-ag/ExecutionPlan2Caml.ag" #-}
                     typeSigs _lhsIoptions
                     {-# LINE 2018 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule200 #-}
   {-# LINE 687 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule200 = \ ((_lhsInt) :: NontermIdent) ->
                     {-# LINE 687 "src-ag/ExecutionPlan2Caml.ag" #-}
                     type_nt_sem_top _lhsInt
                     {-# LINE 2024 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule201 #-}
   {-# LINE 688 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule201 = \ ((_lhsInt) :: NontermIdent) ((_lhsIoptions) :: Options) con_ ->
                     {-# LINE 688 "src-ag/ExecutionPlan2Caml.ag" #-}
                     prefix _lhsIoptions >|< _lhsInt >|< "_" >|< con_
                     {-# LINE 2030 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule202 #-}
   {-# LINE 689 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule202 = \ _t_params _t_type ->
                     {-# LINE 689 "src-ag/ExecutionPlan2Caml.ag" #-}
                     _t_params     >#< _t_type
                     {-# LINE 2036 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule203 #-}
   {-# LINE 690 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule203 = \ ((_childrenIsigs) :: [(PP_Doc,PP_Doc,PP_Doc,PP_Doc)]) _sem_res_tp ->
                     {-# LINE 690 "src-ag/ExecutionPlan2Caml.ag" #-}
                     pp_block "" "" "->" [ d | (_,_,d,_) <- _childrenIsigs ] >#< "->" >#< _sem_res_tp
                     {-# LINE 2042 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule204 #-}
   {-# LINE 693 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule204 = \  (_ :: ()) ->
        {-# LINE 693 "src-ag/ExecutionPlan2Caml.ag" #-}
        empty
        {-# LINE 2048 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule205 #-}
   {-# LINE 699 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule205 = \ ((_childrenIsigs) :: [(PP_Doc,PP_Doc,PP_Doc,PP_Doc)]) _o_sigs _prod_body _sem_res_tp _semname ->
                    {-# LINE 699 "src-ag/ExecutionPlan2Caml.ag" #-}
                    "and" >#< ppFunDecl _o_sigs     _semname     [ (x,d) | (_,x,d,_) <- _childrenIsigs ] _sem_res_tp     _prod_body
                    {-# LINE 2054 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule206 #-}
   {-# LINE 701 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule206 = \ _initializer ((_lhsIinitial) :: StateIdentifier) ((_lhsInt) :: NontermIdent) ((_rulesIsem_rules) :: PP_Doc) _statefuns con_ ->
        {-# LINE 701 "src-ag/ExecutionPlan2Caml.ag" #-}
        _initializer
        >-< "{" >#< nm_attach _lhsInt >#< "=" >#< "function () ->"
        >-< indent 2
            (   "(* rules of production" >#< con_ >#< "*)"
            >-< _rulesIsem_rules
            >-< "(* states of production" >#< con_ >#< "*)"
            >-< vlist _statefuns
            >-< nm_st _lhsIinitial
            )
        >#< "}"
        {-# LINE 2069 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule207 #-}
   {-# LINE 717 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule207 = \ _genstfn ((_lhsIallstates) :: [StateIdentifier]) ->
                    {-# LINE 717 "src-ag/ExecutionPlan2Caml.ag" #-}
                    map _genstfn     _lhsIallstates
                    {-# LINE 2075 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule208 #-}
   {-# LINE 719 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule208 = \ ((_lhsIinitial) :: StateIdentifier) ((_lhsInextVisits) :: Map StateIdentifier StateCtx) ((_lhsInt) :: NontermIdent) _stargs _stks _stvs ->
        {-# LINE 719 "src-ag/ExecutionPlan2Caml.ag" #-}
        \st -> let nextVisitInfo = Map.findWithDefault ManyVis st _lhsInextVisits
                   stNm = nm_st st
                   stDef body = "let" >#< stNm >#< (if st == _lhsIinitial then empty else _stargs     st) >#< "="
                                >-< indent 2 body >#< "in"
               in case nextVisitInfo of
                    NoneVis ->
                               if st == _lhsIinitial
                               then stDef (pp "unit")
                               else empty
                    _       -> stDef $ mklets (_stvs     st ++ _stks     st) $ ppRecordVal
                                 [ nm_invoke _lhsInt st >#< "=" >#< nm_k st ]
        {-# LINE 2091 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule209 #-}
   {-# LINE 739 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule209 = \ _childTypes ((_lhsIallInhmap) :: Map NontermIdent Attributes) ((_lhsIallSynmap) :: Map NontermIdent Attributes) ((_lhsIoptions) :: Options) _localAttrTypes ((_visitsIintramap) :: Map StateIdentifier (Map String (Maybe NonLocalAttr))) ->
        {-# LINE 739 "src-ag/ExecutionPlan2Caml.ag" #-}
        \st -> let attrs = maybe Map.empty id $ Map.lookup st _visitsIintramap in ppSpaced
                 [ case mbAttr of
                     Just (AttrSyn child nm) | child == _LOC && not (noPerStateTypeSigs _lhsIoptions) ->
                       case Map.lookup nm _localAttrTypes     of
                         Just tp -> pp_parens (strNm >#< ":" >#< ppTp tp)
                         Nothing -> pp strNm
                     Just attr | not (noPerStateTypeSigs _lhsIoptions) ->
                       case lookupAttrType attr _lhsIallInhmap _lhsIallSynmap _childTypes     of
                         Just tpDoc -> pp_parens (strNm >#< ":" >#< tpDoc)
                         Nothing    -> pp strNm
                     _ -> pp strNm
                 | (strNm, mbAttr) <- Map.assocs attrs
                 ] >#< dummyPat _lhsIoptions (Map.null attrs)
        {-# LINE 2109 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule210 #-}
   {-# LINE 754 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule210 = \ ((_visitsIallvisits) :: [VisitStateState]) ->
                   {-# LINE 754 "src-ag/ExecutionPlan2Caml.ag" #-}
                   \st -> filter (\(_,f,_) -> f == st) _visitsIallvisits
                   {-# LINE 2115 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule211 #-}
   {-# LINE 756 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule211 = \ ((_lhsInextVisits) :: Map StateIdentifier StateCtx) ((_lhsInt) :: NontermIdent) _stvisits _t_c_params con_ ->
        {-# LINE 756 "src-ag/ExecutionPlan2Caml.ag" #-}
        \st -> let stvisits = _stvisits     st
                   def = ppFunDecl False                   (pp $ nm_k st)
                           [(pp "arg", _t_c_params     >#< type_caller _lhsInt st)] (pp cont_tvar) body
                   nextVisitInfo = Map.findWithDefault ManyVis st _lhsInextVisits
                   body = case nextVisitInfo of
                     NoneVis  -> text "?no next visit?"
                     OneVis v -> dispatch "arg" v
                     ManyVis  -> let alt (v,_,_) = "|" >#< con_visit _lhsInt v >#< "chosen" >#< "->" >-< indent 2 (dispatch "chosen" v)
                                 in "match arg with" >-< (indent 2 $ vlist $ map alt stvisits)
                   dispatch nm v = "let" >#< ppRecordVal
                                     [ nm_inh _lhsInt v >#< "=" >#< "inp"
                                     , nm_cont _lhsInt v >#< "=" >#< "cont" ]
                                   >#< "=" >#< pp nm
                                   >-< "in" >#< "cont" >#< pp_parens (nm_visit v >#< "inp")
               in if null stvisits
                  then []
                  else [ "(* k-function for production" >#< con_ >#< " *)" >-< def ]
        {-# LINE 2137 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule212 #-}
   {-# LINE 777 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule212 = \ ((_visitsIsem_visit) ::  [(StateIdentifier,PP_Doc)] ) ->
               {-# LINE 777 "src-ag/ExecutionPlan2Caml.ag" #-}
               \st -> [ppf | (f,ppf) <- _visitsIsem_visit, f == st]
               {-# LINE 2143 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule213 #-}
   {-# LINE 778 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule213 = \ ((_rulesImrules) :: Map Identifier (VisitKind -> Either Error PP_Doc)) ->
                    {-# LINE 778 "src-ag/ExecutionPlan2Caml.ag" #-}
                    _rulesImrules
                    {-# LINE 2149 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule214 #-}
   {-# LINE 919 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule214 = \ ((_childrenIchildintros) :: Map Identifier (VisitKind -> Either Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))) ->
                         {-# LINE 919 "src-ag/ExecutionPlan2Caml.ag" #-}
                         _childrenIchildintros
                         {-# LINE 2155 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule215 #-}
   {-# LINE 1225 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule215 = \ ((_visitsIruleUsage) :: Map Identifier Int) ->
                                                   {-# LINE 1225 "src-ag/ExecutionPlan2Caml.ag" #-}
                                                   _visitsIruleUsage
                                                   {-# LINE 2161 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule216 #-}
   {-# LINE 1240 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule216 = \ ((_visitsIruleKinds) :: Map Identifier (Set VisitKind)) ->
                      {-# LINE 1240 "src-ag/ExecutionPlan2Caml.ag" #-}
                      _visitsIruleKinds
                      {-# LINE 2167 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule217 #-}
   {-# LINE 1269 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule217 = \ ((_visitsIintramap) :: Map StateIdentifier (Map String (Maybe NonLocalAttr))) ->
                          {-# LINE 1269 "src-ag/ExecutionPlan2Caml.ag" #-}
                          _visitsIintramap
                          {-# LINE 2173 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule218 #-}
   {-# LINE 1270 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule218 = \ ((_childrenIterminaldefs) :: Set String) ->
                          {-# LINE 1270 "src-ag/ExecutionPlan2Caml.ag" #-}
                          _childrenIterminaldefs
                          {-# LINE 2179 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule219 #-}
   {-# LINE 1294 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule219 = \ ((_rulesIruledefs) :: Map Identifier (Set String)) ->
                                    {-# LINE 1294 "src-ag/ExecutionPlan2Caml.ag" #-}
                                    _rulesIruledefs
                                    {-# LINE 2185 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule220 #-}
   {-# LINE 1295 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule220 = \ ((_rulesIruleuses) :: Map Identifier (Map String (Maybe NonLocalAttr))) ->
                                    {-# LINE 1295 "src-ag/ExecutionPlan2Caml.ag" #-}
                                    _rulesIruleuses
                                    {-# LINE 2191 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule221 #-}
   {-# LINE 1349 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule221 = \ ((_visitsIlazyIntras) :: Set String) ->
                     {-# LINE 1349 "src-ag/ExecutionPlan2Caml.ag" #-}
                     _visitsIlazyIntras
                     {-# LINE 2197 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule222 #-}
   {-# LINE 1421 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule222 = \ ((_childrenIchildTypes) :: Map Identifier Type) ((_lhsIntType) :: Type) ->
                     {-# LINE 1421 "src-ag/ExecutionPlan2Caml.ag" #-}
                     Map.singleton _LHS _lhsIntType `Map.union` _childrenIchildTypes
                     {-# LINE 2203 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule223 #-}
   {-# LINE 1438 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule223 = \ ((_lhsIlocalAttrTypes) :: Map ConstructorIdent (Map Identifier Type)) con_ ->
                           {-# LINE 1438 "src-ag/ExecutionPlan2Caml.ag" #-}
                           Map.findWithDefault Map.empty con_ _lhsIlocalAttrTypes
                           {-# LINE 2209 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule224 #-}
   rule224 = \ ((_visitsIchildvisit) :: Map VisitIdentifier (Identifier -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)) ->
     _visitsIchildvisit
   {-# INLINE rule225 #-}
   rule225 = \ ((_rulesIerrors) :: Seq Error) ((_visitsIerrors) :: Seq Error) ->
     _rulesIerrors Seq.>< _visitsIerrors
   {-# INLINE rule226 #-}
   rule226 = \ ((_visitsIfromToStates) :: Map VisitIdentifier (Int,Int)) ->
     _visitsIfromToStates
   {-# INLINE rule227 #-}
   rule227 = \ ((_visitsIt_visits) :: PP_Doc) ->
     _visitsIt_visits
   {-# INLINE rule228 #-}
   rule228 = \ ((_visitsIvisitKinds) :: Map VisitIdentifier VisitKind) ->
     _visitsIvisitKinds
   {-# INLINE rule229 #-}
   rule229 = \ ((_visitsIvisitdefs) :: Map VisitIdentifier (Set Identifier)) ->
     _visitsIvisitdefs
   {-# INLINE rule230 #-}
   rule230 = \ ((_visitsIvisituses) :: Map VisitIdentifier (Set Identifier)) ->
     _visitsIvisituses
   {-# INLINE rule231 #-}
   rule231 = \ ((_visitsIallvisits) :: [VisitStateState]) ->
     _visitsIallvisits
   {-# INLINE rule232 #-}
   rule232 = \ _sem_prod ->
     _sem_prod
   {-# INLINE rule233 #-}
   rule233 = \ ((_lhsIallInhmap) :: Map NontermIdent Attributes) ->
     _lhsIallInhmap
   {-# INLINE rule234 #-}
   rule234 = \ ((_lhsIallSynmap) :: Map NontermIdent Attributes) ->
     _lhsIallSynmap
   {-# INLINE rule235 #-}
   rule235 = \ _childTypes ->
     _childTypes
   {-# INLINE rule236 #-}
   rule236 = \ ((_lhsIinhmap) :: Attributes) ->
     _lhsIinhmap
   {-# INLINE rule237 #-}
   rule237 = \ _lazyIntras ->
     _lazyIntras
   {-# INLINE rule238 #-}
   rule238 = \ _localAttrTypes ->
     _localAttrTypes
   {-# INLINE rule239 #-}
   rule239 = \ ((_lhsImainFile) :: String) ->
     _lhsImainFile
   {-# INLINE rule240 #-}
   rule240 = \ ((_lhsImainName) :: String) ->
     _lhsImainName
   {-# INLINE rule241 #-}
   rule241 = \ ((_lhsInt) :: NontermIdent) ->
     _lhsInt
   {-# INLINE rule242 #-}
   rule242 = \ ((_lhsIoptions) :: Options) ->
     _lhsIoptions
   {-# INLINE rule243 #-}
   rule243 = \ ((_lhsIsynmap) :: Attributes) ->
     _lhsIsynmap
   {-# INLINE rule244 #-}
   rule244 = \ ((_lhsIallInitStates) :: Map NontermIdent Int) ->
     _lhsIallInitStates
   {-# INLINE rule245 #-}
   rule245 = \ ((_lhsImainFile) :: String) ->
     _lhsImainFile
   {-# INLINE rule246 #-}
   rule246 = \ ((_lhsImainName) :: String) ->
     _lhsImainName
   {-# INLINE rule247 #-}
   rule247 = \ ((_lhsInt) :: NontermIdent) ->
     _lhsInt
   {-# INLINE rule248 #-}
   rule248 = \ ((_lhsIoptions) :: Options) ->
     _lhsIoptions
   {-# INLINE rule249 #-}
   rule249 = \ ((_lhsIallFromToStates) :: Map VisitIdentifier (Int,Int)) ->
     _lhsIallFromToStates
   {-# INLINE rule250 #-}
   rule250 = \ ((_lhsIallInhmap) :: Map NontermIdent Attributes) ->
     _lhsIallInhmap
   {-# INLINE rule251 #-}
   rule251 = \ ((_lhsIallInitStates) :: Map NontermIdent Int) ->
     _lhsIallInitStates
   {-# INLINE rule252 #-}
   rule252 = \ ((_lhsIallSynmap) :: Map NontermIdent Attributes) ->
     _lhsIallSynmap
   {-# INLINE rule253 #-}
   rule253 = \ ((_lhsIallVisitKinds) :: Map VisitIdentifier VisitKind) ->
     _lhsIallVisitKinds
   {-# INLINE rule254 #-}
   rule254 = \ ((_lhsIallchildvisit) :: Map VisitIdentifier (Identifier -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)) ->
     _lhsIallchildvisit
   {-# INLINE rule255 #-}
   rule255 = \ ((_lhsIavisitdefs) :: Map VisitIdentifier (Set Identifier)) ->
     _lhsIavisitdefs
   {-# INLINE rule256 #-}
   rule256 = \ ((_lhsIavisituses) :: Map VisitIdentifier (Set Identifier)) ->
     _lhsIavisituses
   {-# INLINE rule257 #-}
   rule257 = \ _childTypes ->
     _childTypes
   {-# INLINE rule258 #-}
   rule258 = \ ((_lhsIinhmap) :: Attributes) ->
     _lhsIinhmap
   {-# INLINE rule259 #-}
   rule259 = \ ((_lhsInextVisits) :: Map StateIdentifier StateCtx) ->
     _lhsInextVisits
   {-# INLINE rule260 #-}
   rule260 = \ ((_lhsInt) :: NontermIdent) ->
     _lhsInt
   {-# INLINE rule261 #-}
   rule261 = \ ((_lhsIoptions) :: Options) ->
     _lhsIoptions
   {-# INLINE rule262 #-}
   rule262 = \ ((_lhsIparams) :: [Identifier]) ->
     _lhsIparams
   {-# INLINE rule263 #-}
   rule263 = \ ((_lhsIprevVisits) :: Map StateIdentifier StateCtx) ->
     _lhsIprevVisits
   {-# INLINE rule264 #-}
   rule264 = \ ((_lhsIsynmap) :: Attributes) ->
     _lhsIsynmap

-- EProductions ------------------------------------------------
-- wrapper
data Inh_EProductions  = Inh_EProductions { Inh_EProductions -> Map Int (Int, Int)
allFromToStates_Inh_EProductions :: (Map VisitIdentifier (Int,Int)), Inh_EProductions -> Map NontermIdent Attributes
allInhmap_Inh_EProductions :: (Map NontermIdent Attributes), Inh_EProductions -> Map NontermIdent Int
allInitStates_Inh_EProductions :: (Map NontermIdent Int), Inh_EProductions -> Map NontermIdent Attributes
allSynmap_Inh_EProductions :: (Map NontermIdent Attributes), Inh_EProductions -> Map Int VisitKind
allVisitKinds_Inh_EProductions :: (Map VisitIdentifier VisitKind), Inh_EProductions
-> Map
     Int
     (NontermIdent
      -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
allchildvisit_Inh_EProductions :: (Map VisitIdentifier (Identifier -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)), Inh_EProductions -> [Int]
allstates_Inh_EProductions :: ([StateIdentifier]), Inh_EProductions -> Map Int (Set NontermIdent)
avisitdefs_Inh_EProductions :: (Map VisitIdentifier (Set Identifier)), Inh_EProductions -> Map Int (Set NontermIdent)
avisituses_Inh_EProductions :: (Map VisitIdentifier (Set Identifier)), Inh_EProductions -> Attributes
inhmap_Inh_EProductions :: (Attributes), Inh_EProductions -> Int
initial_Inh_EProductions :: (StateIdentifier), Inh_EProductions -> Map NontermIdent Attributes
localAttrTypes_Inh_EProductions :: (Map ConstructorIdent (Map Identifier Type)), Inh_EProductions -> String
mainFile_Inh_EProductions :: (String), Inh_EProductions -> String
mainName_Inh_EProductions :: (String), Inh_EProductions -> Map Int StateCtx
nextVisits_Inh_EProductions :: (Map StateIdentifier StateCtx), Inh_EProductions -> NontermIdent
nt_Inh_EProductions :: (NontermIdent), Inh_EProductions -> Type
ntType_Inh_EProductions :: (Type), Inh_EProductions -> Options
options_Inh_EProductions :: (Options), Inh_EProductions -> [NontermIdent]
params_Inh_EProductions :: ([Identifier]), Inh_EProductions -> Map Int StateCtx
prevVisits_Inh_EProductions :: (Map StateIdentifier StateCtx), Inh_EProductions -> Bool
rename_Inh_EProductions :: (Bool), Inh_EProductions -> Attributes
synmap_Inh_EProductions :: (Attributes) }
data Syn_EProductions  = Syn_EProductions { Syn_EProductions -> [VisitStateState]
allvisits_Syn_EProductions :: ([VisitStateState]), Syn_EProductions
-> Map
     Int
     (NontermIdent
      -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
childvisit_Syn_EProductions :: (Map VisitIdentifier (Identifier -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)), Syn_EProductions -> Int
count_Syn_EProductions :: (Int), Syn_EProductions -> [PP_Doc]
datatype_Syn_EProductions :: ([PP_Doc]), Syn_EProductions -> [PP_Doc]
datatype_call_Syn_EProductions :: ([PP_Doc]), Syn_EProductions -> [PP_Doc]
datatype_con_Syn_EProductions :: ([PP_Doc]), Syn_EProductions -> Seq Error
errors_Syn_EProductions :: (Seq Error), Syn_EProductions -> Map Int (Int, Int)
fromToStates_Syn_EProductions :: (Map VisitIdentifier (Int,Int)), Syn_EProductions -> Seq PP_Doc
semFunBndDefs_Syn_EProductions :: (Seq PP_Doc), Syn_EProductions -> Seq PP_Doc
semFunBndTps_Syn_EProductions :: (Seq PP_Doc), Syn_EProductions -> PP_Doc
sem_nt_Syn_EProductions :: (PP_Doc), Syn_EProductions -> PP_Doc
sem_prod_Syn_EProductions :: (PP_Doc), Syn_EProductions -> PP_Doc
t_visits_Syn_EProductions :: (PP_Doc), Syn_EProductions -> Map Int VisitKind
visitKinds_Syn_EProductions :: (Map VisitIdentifier VisitKind), Syn_EProductions -> Map Int (Set NontermIdent)
visitdefs_Syn_EProductions :: (Map VisitIdentifier (Set Identifier)), Syn_EProductions -> Map Int (Set NontermIdent)
visituses_Syn_EProductions :: (Map VisitIdentifier (Set Identifier)) }
{-# INLINABLE wrap_EProductions #-}
wrap_EProductions :: T_EProductions  -> Inh_EProductions  -> (Syn_EProductions )
wrap_EProductions :: T_EProductions -> Inh_EProductions -> Syn_EProductions
wrap_EProductions (T_EProductions Identity T_EProductions_s17
act) (Inh_EProductions Map Int (Int, Int)
_lhsIallFromToStates Map NontermIdent Attributes
_lhsIallInhmap Map NontermIdent Int
_lhsIallInitStates Map NontermIdent Attributes
_lhsIallSynmap Map Int VisitKind
_lhsIallVisitKinds Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_lhsIallchildvisit [Int]
_lhsIallstates Map Int (Set NontermIdent)
_lhsIavisitdefs Map Int (Set NontermIdent)
_lhsIavisituses Attributes
_lhsIinhmap Int
_lhsIinitial Map NontermIdent Attributes
_lhsIlocalAttrTypes String
_lhsImainFile String
_lhsImainName Map Int StateCtx
_lhsInextVisits NontermIdent
_lhsInt Type
_lhsIntType Options
_lhsIoptions [NontermIdent]
_lhsIparams Map Int StateCtx
_lhsIprevVisits Bool
_lhsIrename Attributes
_lhsIsynmap) =
   forall a. Identity a -> a
Control.Monad.Identity.runIdentity (
     do T_EProductions_s17
sem <- Identity T_EProductions_s17
act
        let arg16 :: T_EProductions_vIn16
arg16 = Map Int (Int, Int)
-> Map NontermIdent Attributes
-> Map NontermIdent Int
-> Map NontermIdent Attributes
-> Map Int VisitKind
-> Map
     Int
     (NontermIdent
      -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
-> [Int]
-> Map Int (Set NontermIdent)
-> Map Int (Set NontermIdent)
-> Attributes
-> Int
-> Map NontermIdent Attributes
-> String
-> String
-> Map Int StateCtx
-> NontermIdent
-> Type
-> Options
-> [NontermIdent]
-> Map Int StateCtx
-> Bool
-> Attributes
-> T_EProductions_vIn16
T_EProductions_vIn16 Map Int (Int, Int)
_lhsIallFromToStates Map NontermIdent Attributes
_lhsIallInhmap Map NontermIdent Int
_lhsIallInitStates Map NontermIdent Attributes
_lhsIallSynmap Map Int VisitKind
_lhsIallVisitKinds Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_lhsIallchildvisit [Int]
_lhsIallstates Map Int (Set NontermIdent)
_lhsIavisitdefs Map Int (Set NontermIdent)
_lhsIavisituses Attributes
_lhsIinhmap Int
_lhsIinitial Map NontermIdent Attributes
_lhsIlocalAttrTypes String
_lhsImainFile String
_lhsImainName Map Int StateCtx
_lhsInextVisits NontermIdent
_lhsInt Type
_lhsIntType Options
_lhsIoptions [NontermIdent]
_lhsIparams Map Int StateCtx
_lhsIprevVisits Bool
_lhsIrename Attributes
_lhsIsynmap
        (T_EProductions_vOut16 [VisitStateState]
_lhsOallvisits Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_lhsOchildvisit Int
_lhsOcount [PP_Doc]
_lhsOdatatype [PP_Doc]
_lhsOdatatype_call [PP_Doc]
_lhsOdatatype_con Seq Error
_lhsOerrors Map Int (Int, Int)
_lhsOfromToStates Seq PP_Doc
_lhsOsemFunBndDefs Seq PP_Doc
_lhsOsemFunBndTps PP_Doc
_lhsOsem_nt PP_Doc
_lhsOsem_prod PP_Doc
_lhsOt_visits Map Int VisitKind
_lhsOvisitKinds Map Int (Set NontermIdent)
_lhsOvisitdefs Map Int (Set NontermIdent)
_lhsOvisituses) <- forall (m :: * -> *) a. Monad m => a -> m a
return (T_EProductions_s17 -> T_EProductions_v16
inv_EProductions_s17 T_EProductions_s17
sem T_EProductions_vIn16
arg16)
        forall (m :: * -> *) a. Monad m => a -> m a
return ([VisitStateState]
-> Map
     Int
     (NontermIdent
      -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
-> Int
-> [PP_Doc]
-> [PP_Doc]
-> [PP_Doc]
-> Seq Error
-> Map Int (Int, Int)
-> Seq PP_Doc
-> Seq PP_Doc
-> PP_Doc
-> PP_Doc
-> PP_Doc
-> Map Int VisitKind
-> Map Int (Set NontermIdent)
-> Map Int (Set NontermIdent)
-> Syn_EProductions
Syn_EProductions [VisitStateState]
_lhsOallvisits Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_lhsOchildvisit Int
_lhsOcount [PP_Doc]
_lhsOdatatype [PP_Doc]
_lhsOdatatype_call [PP_Doc]
_lhsOdatatype_con Seq Error
_lhsOerrors Map Int (Int, Int)
_lhsOfromToStates Seq PP_Doc
_lhsOsemFunBndDefs Seq PP_Doc
_lhsOsemFunBndTps PP_Doc
_lhsOsem_nt PP_Doc
_lhsOsem_prod PP_Doc
_lhsOt_visits Map Int VisitKind
_lhsOvisitKinds Map Int (Set NontermIdent)
_lhsOvisitdefs Map Int (Set NontermIdent)
_lhsOvisituses)
   )

-- cata
{-# NOINLINE sem_EProductions #-}
sem_EProductions :: EProductions  -> T_EProductions 
sem_EProductions :: EProductions -> T_EProductions
sem_EProductions EProductions
list = forall (t :: * -> *) a b.
Foldable t =>
(a -> b -> b) -> b -> t a -> b
Prelude.foldr T_EProduction -> T_EProductions -> T_EProductions
sem_EProductions_Cons T_EProductions
sem_EProductions_Nil (forall a b. (a -> b) -> [a] -> [b]
Prelude.map EProduction -> T_EProduction
sem_EProduction EProductions
list)

-- semantic domain
newtype T_EProductions  = T_EProductions {
                                         T_EProductions -> Identity T_EProductions_s17
attach_T_EProductions :: Identity (T_EProductions_s17 )
                                         }
newtype T_EProductions_s17  = C_EProductions_s17 {
                                                 T_EProductions_s17 -> T_EProductions_v16
inv_EProductions_s17 :: (T_EProductions_v16 )
                                                 }
data T_EProductions_s18  = C_EProductions_s18
type T_EProductions_v16  = (T_EProductions_vIn16 ) -> (T_EProductions_vOut16 )
data T_EProductions_vIn16  = T_EProductions_vIn16 (Map VisitIdentifier (Int,Int)) (Map NontermIdent Attributes) (Map NontermIdent Int) (Map NontermIdent Attributes) (Map VisitIdentifier VisitKind) (Map VisitIdentifier (Identifier -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)) ([StateIdentifier]) (Map VisitIdentifier (Set Identifier)) (Map VisitIdentifier (Set Identifier)) (Attributes) (StateIdentifier) (Map ConstructorIdent (Map Identifier Type)) (String) (String) (Map StateIdentifier StateCtx) (NontermIdent) (Type) (Options) ([Identifier]) (Map StateIdentifier StateCtx) (Bool) (Attributes)
data T_EProductions_vOut16  = T_EProductions_vOut16 ([VisitStateState]) (Map VisitIdentifier (Identifier -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)) (Int) ([PP_Doc]) ([PP_Doc]) ([PP_Doc]) (Seq Error) (Map VisitIdentifier (Int,Int)) (Seq PP_Doc) (Seq PP_Doc) (PP_Doc) (PP_Doc) (PP_Doc) (Map VisitIdentifier VisitKind) (Map VisitIdentifier (Set Identifier)) (Map VisitIdentifier (Set Identifier))
{-# NOINLINE sem_EProductions_Cons #-}
sem_EProductions_Cons :: T_EProduction  -> T_EProductions  -> T_EProductions 
sem_EProductions_Cons :: T_EProduction -> T_EProductions -> T_EProductions
sem_EProductions_Cons T_EProduction
arg_hd_ T_EProductions
arg_tl_ = Identity T_EProductions_s17 -> T_EProductions
T_EProductions (forall (m :: * -> *) a. Monad m => a -> m a
return T_EProductions_s17
st17) where
   {-# NOINLINE st17 #-}
   st17 :: T_EProductions_s17
st17 = let
      v16 :: T_EProductions_v16 
      v16 :: T_EProductions_v16
v16 = \ (T_EProductions_vIn16 Map Int (Int, Int)
_lhsIallFromToStates Map NontermIdent Attributes
_lhsIallInhmap Map NontermIdent Int
_lhsIallInitStates Map NontermIdent Attributes
_lhsIallSynmap Map Int VisitKind
_lhsIallVisitKinds Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_lhsIallchildvisit [Int]
_lhsIallstates Map Int (Set NontermIdent)
_lhsIavisitdefs Map Int (Set NontermIdent)
_lhsIavisituses Attributes
_lhsIinhmap Int
_lhsIinitial Map NontermIdent Attributes
_lhsIlocalAttrTypes String
_lhsImainFile String
_lhsImainName Map Int StateCtx
_lhsInextVisits NontermIdent
_lhsInt Type
_lhsIntType Options
_lhsIoptions [NontermIdent]
_lhsIparams Map Int StateCtx
_lhsIprevVisits Bool
_lhsIrename Attributes
_lhsIsynmap) -> ( let
         _hdX14 :: T_EProduction_s14
_hdX14 = forall a. Identity a -> a
Control.Monad.Identity.runIdentity (T_EProduction -> Identity T_EProduction_s14
attach_T_EProduction (T_EProduction
arg_hd_))
         _tlX17 :: T_EProductions_s17
_tlX17 = forall a. Identity a -> a
Control.Monad.Identity.runIdentity (T_EProductions -> Identity T_EProductions_s17
attach_T_EProductions (T_EProductions
arg_tl_))
         (T_EProduction_vOut13 [VisitStateState]
_hdIallvisits Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_hdIchildvisit Int
_hdIcount PP_Doc
_hdIdatatype PP_Doc
_hdIdatatype_call PP_Doc
_hdIdatatype_con Seq Error
_hdIerrors Map Int (Int, Int)
_hdIfromToStates Seq PP_Doc
_hdIsemFunBndDefs Seq PP_Doc
_hdIsemFunBndTps PP_Doc
_hdIsem_nt PP_Doc
_hdIsem_prod PP_Doc
_hdIt_visits Map Int VisitKind
_hdIvisitKinds Map Int (Set NontermIdent)
_hdIvisitdefs Map Int (Set NontermIdent)
_hdIvisituses) = T_EProduction_s14 -> T_EProduction_v13
inv_EProduction_s14 T_EProduction_s14
_hdX14 (Map Int (Int, Int)
-> Map NontermIdent Attributes
-> Map NontermIdent Int
-> Map NontermIdent Attributes
-> Map Int VisitKind
-> Map
     Int
     (NontermIdent
      -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
-> [Int]
-> Map Int (Set NontermIdent)
-> Map Int (Set NontermIdent)
-> Attributes
-> Int
-> Map NontermIdent Attributes
-> String
-> String
-> Map Int StateCtx
-> NontermIdent
-> Type
-> Options
-> [NontermIdent]
-> Map Int StateCtx
-> Bool
-> Attributes
-> T_EProduction_vIn13
T_EProduction_vIn13 Map Int (Int, Int)
_hdOallFromToStates Map NontermIdent Attributes
_hdOallInhmap Map NontermIdent Int
_hdOallInitStates Map NontermIdent Attributes
_hdOallSynmap Map Int VisitKind
_hdOallVisitKinds Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_hdOallchildvisit [Int]
_hdOallstates Map Int (Set NontermIdent)
_hdOavisitdefs Map Int (Set NontermIdent)
_hdOavisituses Attributes
_hdOinhmap Int
_hdOinitial Map NontermIdent Attributes
_hdOlocalAttrTypes String
_hdOmainFile String
_hdOmainName Map Int StateCtx
_hdOnextVisits NontermIdent
_hdOnt Type
_hdOntType Options
_hdOoptions [NontermIdent]
_hdOparams Map Int StateCtx
_hdOprevVisits Bool
_hdOrename Attributes
_hdOsynmap)
         (T_EProductions_vOut16 [VisitStateState]
_tlIallvisits Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_tlIchildvisit Int
_tlIcount [PP_Doc]
_tlIdatatype [PP_Doc]
_tlIdatatype_call [PP_Doc]
_tlIdatatype_con Seq Error
_tlIerrors Map Int (Int, Int)
_tlIfromToStates Seq PP_Doc
_tlIsemFunBndDefs Seq PP_Doc
_tlIsemFunBndTps PP_Doc
_tlIsem_nt PP_Doc
_tlIsem_prod PP_Doc
_tlIt_visits Map Int VisitKind
_tlIvisitKinds Map Int (Set NontermIdent)
_tlIvisitdefs Map Int (Set NontermIdent)
_tlIvisituses) = T_EProductions_s17 -> T_EProductions_v16
inv_EProductions_s17 T_EProductions_s17
_tlX17 (Map Int (Int, Int)
-> Map NontermIdent Attributes
-> Map NontermIdent Int
-> Map NontermIdent Attributes
-> Map Int VisitKind
-> Map
     Int
     (NontermIdent
      -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
-> [Int]
-> Map Int (Set NontermIdent)
-> Map Int (Set NontermIdent)
-> Attributes
-> Int
-> Map NontermIdent Attributes
-> String
-> String
-> Map Int StateCtx
-> NontermIdent
-> Type
-> Options
-> [NontermIdent]
-> Map Int StateCtx
-> Bool
-> Attributes
-> T_EProductions_vIn16
T_EProductions_vIn16 Map Int (Int, Int)
_tlOallFromToStates Map NontermIdent Attributes
_tlOallInhmap Map NontermIdent Int
_tlOallInitStates Map NontermIdent Attributes
_tlOallSynmap Map Int VisitKind
_tlOallVisitKinds Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_tlOallchildvisit [Int]
_tlOallstates Map Int (Set NontermIdent)
_tlOavisitdefs Map Int (Set NontermIdent)
_tlOavisituses Attributes
_tlOinhmap Int
_tlOinitial Map NontermIdent Attributes
_tlOlocalAttrTypes String
_tlOmainFile String
_tlOmainName Map Int StateCtx
_tlOnextVisits NontermIdent
_tlOnt Type
_tlOntType Options
_tlOoptions [NontermIdent]
_tlOparams Map Int StateCtx
_tlOprevVisits Bool
_tlOrename Attributes
_tlOsynmap)
         _lhsOallvisits :: [VisitStateState]
         _lhsOallvisits :: [VisitStateState]
_lhsOallvisits = [VisitStateState] -> [VisitStateState]
rule265 [VisitStateState]
_hdIallvisits
         _lhsOt_visits :: PP_Doc
         _lhsOt_visits :: PP_Doc
_lhsOt_visits = PP_Doc -> PP_Doc
rule266 PP_Doc
_hdIt_visits
         _lhsOchildvisit :: Map VisitIdentifier (Identifier -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
         _lhsOchildvisit :: Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_lhsOchildvisit = Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
-> Map
     Int
     (NontermIdent
      -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
-> Map
     Int
     (NontermIdent
      -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
rule267 Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_hdIchildvisit Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_tlIchildvisit
         _lhsOcount :: Int
         _lhsOcount :: Int
_lhsOcount = Int -> Int -> Int
rule268 Int
_hdIcount Int
_tlIcount
         _lhsOdatatype :: [PP_Doc]
         _lhsOdatatype :: [PP_Doc]
_lhsOdatatype = PP_Doc -> [PP_Doc] -> [PP_Doc]
rule269 PP_Doc
_hdIdatatype [PP_Doc]
_tlIdatatype
         _lhsOdatatype_call :: [PP_Doc]
         _lhsOdatatype_call :: [PP_Doc]
_lhsOdatatype_call = PP_Doc -> [PP_Doc] -> [PP_Doc]
rule270 PP_Doc
_hdIdatatype_call [PP_Doc]
_tlIdatatype_call
         _lhsOdatatype_con :: [PP_Doc]
         _lhsOdatatype_con :: [PP_Doc]
_lhsOdatatype_con = PP_Doc -> [PP_Doc] -> [PP_Doc]
rule271 PP_Doc
_hdIdatatype_con [PP_Doc]
_tlIdatatype_con
         _lhsOerrors :: Seq Error
         _lhsOerrors :: Seq Error
_lhsOerrors = Seq Error -> Seq Error -> Seq Error
rule272 Seq Error
_hdIerrors Seq Error
_tlIerrors
         _lhsOfromToStates :: Map VisitIdentifier (Int,Int)
         _lhsOfromToStates :: Map Int (Int, Int)
_lhsOfromToStates = Map Int (Int, Int) -> Map Int (Int, Int) -> Map Int (Int, Int)
rule273 Map Int (Int, Int)
_hdIfromToStates Map Int (Int, Int)
_tlIfromToStates
         _lhsOsemFunBndDefs :: Seq PP_Doc
         _lhsOsemFunBndDefs :: Seq PP_Doc
_lhsOsemFunBndDefs = Seq PP_Doc -> Seq PP_Doc -> Seq PP_Doc
rule274 Seq PP_Doc
_hdIsemFunBndDefs Seq PP_Doc
_tlIsemFunBndDefs
         _lhsOsemFunBndTps :: Seq PP_Doc
         _lhsOsemFunBndTps :: Seq PP_Doc
_lhsOsemFunBndTps = Seq PP_Doc -> Seq PP_Doc -> Seq PP_Doc
rule275 Seq PP_Doc
_hdIsemFunBndTps Seq PP_Doc
_tlIsemFunBndTps
         _lhsOsem_nt :: PP_Doc
         _lhsOsem_nt :: PP_Doc
_lhsOsem_nt = PP_Doc -> PP_Doc -> PP_Doc
rule276 PP_Doc
_hdIsem_nt PP_Doc
_tlIsem_nt
         _lhsOsem_prod :: PP_Doc
         _lhsOsem_prod :: PP_Doc
_lhsOsem_prod = PP_Doc -> PP_Doc -> PP_Doc
rule277 PP_Doc
_hdIsem_prod PP_Doc
_tlIsem_prod
         _lhsOvisitKinds :: Map VisitIdentifier VisitKind
         _lhsOvisitKinds :: Map Int VisitKind
_lhsOvisitKinds = Map Int VisitKind -> Map Int VisitKind -> Map Int VisitKind
rule278 Map Int VisitKind
_hdIvisitKinds Map Int VisitKind
_tlIvisitKinds
         _lhsOvisitdefs :: Map VisitIdentifier (Set Identifier)
         _lhsOvisitdefs :: Map Int (Set NontermIdent)
_lhsOvisitdefs = Map Int (Set NontermIdent)
-> Map Int (Set NontermIdent) -> Map Int (Set NontermIdent)
rule279 Map Int (Set NontermIdent)
_hdIvisitdefs Map Int (Set NontermIdent)
_tlIvisitdefs
         _lhsOvisituses :: Map VisitIdentifier (Set Identifier)
         _lhsOvisituses :: Map Int (Set NontermIdent)
_lhsOvisituses = Map Int (Set NontermIdent)
-> Map Int (Set NontermIdent) -> Map Int (Set NontermIdent)
rule280 Map Int (Set NontermIdent)
_hdIvisituses Map Int (Set NontermIdent)
_tlIvisituses
         _hdOallFromToStates :: Map Int (Int, Int)
_hdOallFromToStates = Map Int (Int, Int) -> Map Int (Int, Int)
rule281 Map Int (Int, Int)
_lhsIallFromToStates
         _hdOallInhmap :: Map NontermIdent Attributes
_hdOallInhmap = Map NontermIdent Attributes -> Map NontermIdent Attributes
rule282 Map NontermIdent Attributes
_lhsIallInhmap
         _hdOallInitStates :: Map NontermIdent Int
_hdOallInitStates = Map NontermIdent Int -> Map NontermIdent Int
rule283 Map NontermIdent Int
_lhsIallInitStates
         _hdOallSynmap :: Map NontermIdent Attributes
_hdOallSynmap = Map NontermIdent Attributes -> Map NontermIdent Attributes
rule284 Map NontermIdent Attributes
_lhsIallSynmap
         _hdOallVisitKinds :: Map Int VisitKind
_hdOallVisitKinds = Map Int VisitKind -> Map Int VisitKind
rule285 Map Int VisitKind
_lhsIallVisitKinds
         _hdOallchildvisit :: Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_hdOallchildvisit = Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
-> Map
     Int
     (NontermIdent
      -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
rule286 Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_lhsIallchildvisit
         _hdOallstates :: [Int]
_hdOallstates = [Int] -> [Int]
rule287 [Int]
_lhsIallstates
         _hdOavisitdefs :: Map Int (Set NontermIdent)
_hdOavisitdefs = Map Int (Set NontermIdent) -> Map Int (Set NontermIdent)
rule288 Map Int (Set NontermIdent)
_lhsIavisitdefs
         _hdOavisituses :: Map Int (Set NontermIdent)
_hdOavisituses = Map Int (Set NontermIdent) -> Map Int (Set NontermIdent)
rule289 Map Int (Set NontermIdent)
_lhsIavisituses
         _hdOinhmap :: Attributes
_hdOinhmap = Attributes -> Attributes
rule290 Attributes
_lhsIinhmap
         _hdOinitial :: Int
_hdOinitial = Int -> Int
rule291 Int
_lhsIinitial
         _hdOlocalAttrTypes :: Map NontermIdent Attributes
_hdOlocalAttrTypes = Map NontermIdent Attributes -> Map NontermIdent Attributes
rule292 Map NontermIdent Attributes
_lhsIlocalAttrTypes
         _hdOmainFile :: String
_hdOmainFile = String -> String
rule293 String
_lhsImainFile
         _hdOmainName :: String
_hdOmainName = String -> String
rule294 String
_lhsImainName
         _hdOnextVisits :: Map Int StateCtx
_hdOnextVisits = Map Int StateCtx -> Map Int StateCtx
rule295 Map Int StateCtx
_lhsInextVisits
         _hdOnt :: NontermIdent
_hdOnt = NontermIdent -> NontermIdent
rule296 NontermIdent
_lhsInt
         _hdOntType :: Type
_hdOntType = Type -> Type
rule297 Type
_lhsIntType
         _hdOoptions :: Options
_hdOoptions = Options -> Options
rule298 Options
_lhsIoptions
         _hdOparams :: [NontermIdent]
_hdOparams = [NontermIdent] -> [NontermIdent]
rule299 [NontermIdent]
_lhsIparams
         _hdOprevVisits :: Map Int StateCtx
_hdOprevVisits = Map Int StateCtx -> Map Int StateCtx
rule300 Map Int StateCtx
_lhsIprevVisits
         _hdOrename :: Bool
_hdOrename = Bool -> Bool
rule301 Bool
_lhsIrename
         _hdOsynmap :: Attributes
_hdOsynmap = Attributes -> Attributes
rule302 Attributes
_lhsIsynmap
         _tlOallFromToStates :: Map Int (Int, Int)
_tlOallFromToStates = Map Int (Int, Int) -> Map Int (Int, Int)
rule303 Map Int (Int, Int)
_lhsIallFromToStates
         _tlOallInhmap :: Map NontermIdent Attributes
_tlOallInhmap = Map NontermIdent Attributes -> Map NontermIdent Attributes
rule304 Map NontermIdent Attributes
_lhsIallInhmap
         _tlOallInitStates :: Map NontermIdent Int
_tlOallInitStates = Map NontermIdent Int -> Map NontermIdent Int
rule305 Map NontermIdent Int
_lhsIallInitStates
         _tlOallSynmap :: Map NontermIdent Attributes
_tlOallSynmap = Map NontermIdent Attributes -> Map NontermIdent Attributes
rule306 Map NontermIdent Attributes
_lhsIallSynmap
         _tlOallVisitKinds :: Map Int VisitKind
_tlOallVisitKinds = Map Int VisitKind -> Map Int VisitKind
rule307 Map Int VisitKind
_lhsIallVisitKinds
         _tlOallchildvisit :: Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_tlOallchildvisit = Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
-> Map
     Int
     (NontermIdent
      -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
rule308 Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_lhsIallchildvisit
         _tlOallstates :: [Int]
_tlOallstates = [Int] -> [Int]
rule309 [Int]
_lhsIallstates
         _tlOavisitdefs :: Map Int (Set NontermIdent)
_tlOavisitdefs = Map Int (Set NontermIdent) -> Map Int (Set NontermIdent)
rule310 Map Int (Set NontermIdent)
_lhsIavisitdefs
         _tlOavisituses :: Map Int (Set NontermIdent)
_tlOavisituses = Map Int (Set NontermIdent) -> Map Int (Set NontermIdent)
rule311 Map Int (Set NontermIdent)
_lhsIavisituses
         _tlOinhmap :: Attributes
_tlOinhmap = Attributes -> Attributes
rule312 Attributes
_lhsIinhmap
         _tlOinitial :: Int
_tlOinitial = Int -> Int
rule313 Int
_lhsIinitial
         _tlOlocalAttrTypes :: Map NontermIdent Attributes
_tlOlocalAttrTypes = Map NontermIdent Attributes -> Map NontermIdent Attributes
rule314 Map NontermIdent Attributes
_lhsIlocalAttrTypes
         _tlOmainFile :: String
_tlOmainFile = String -> String
rule315 String
_lhsImainFile
         _tlOmainName :: String
_tlOmainName = String -> String
rule316 String
_lhsImainName
         _tlOnextVisits :: Map Int StateCtx
_tlOnextVisits = Map Int StateCtx -> Map Int StateCtx
rule317 Map Int StateCtx
_lhsInextVisits
         _tlOnt :: NontermIdent
_tlOnt = NontermIdent -> NontermIdent
rule318 NontermIdent
_lhsInt
         _tlOntType :: Type
_tlOntType = Type -> Type
rule319 Type
_lhsIntType
         _tlOoptions :: Options
_tlOoptions = Options -> Options
rule320 Options
_lhsIoptions
         _tlOparams :: [NontermIdent]
_tlOparams = [NontermIdent] -> [NontermIdent]
rule321 [NontermIdent]
_lhsIparams
         _tlOprevVisits :: Map Int StateCtx
_tlOprevVisits = Map Int StateCtx -> Map Int StateCtx
rule322 Map Int StateCtx
_lhsIprevVisits
         _tlOrename :: Bool
_tlOrename = Bool -> Bool
rule323 Bool
_lhsIrename
         _tlOsynmap :: Attributes
_tlOsynmap = Attributes -> Attributes
rule324 Attributes
_lhsIsynmap
         __result_ :: T_EProductions_vOut16
__result_ = [VisitStateState]
-> Map
     Int
     (NontermIdent
      -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
-> Int
-> [PP_Doc]
-> [PP_Doc]
-> [PP_Doc]
-> Seq Error
-> Map Int (Int, Int)
-> Seq PP_Doc
-> Seq PP_Doc
-> PP_Doc
-> PP_Doc
-> PP_Doc
-> Map Int VisitKind
-> Map Int (Set NontermIdent)
-> Map Int (Set NontermIdent)
-> T_EProductions_vOut16
T_EProductions_vOut16 [VisitStateState]
_lhsOallvisits Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_lhsOchildvisit Int
_lhsOcount [PP_Doc]
_lhsOdatatype [PP_Doc]
_lhsOdatatype_call [PP_Doc]
_lhsOdatatype_con Seq Error
_lhsOerrors Map Int (Int, Int)
_lhsOfromToStates Seq PP_Doc
_lhsOsemFunBndDefs Seq PP_Doc
_lhsOsemFunBndTps PP_Doc
_lhsOsem_nt PP_Doc
_lhsOsem_prod PP_Doc
_lhsOt_visits Map Int VisitKind
_lhsOvisitKinds Map Int (Set NontermIdent)
_lhsOvisitdefs Map Int (Set NontermIdent)
_lhsOvisituses
         in T_EProductions_vOut16
__result_ )
     in T_EProductions_v16 -> T_EProductions_s17
C_EProductions_s17 T_EProductions_v16
v16
   {-# INLINE rule265 #-}
   {-# LINE 439 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule265 = \ ((_hdIallvisits) :: [VisitStateState]) ->
                           {-# LINE 439 "src-ag/ExecutionPlan2Caml.ag" #-}
                           _hdIallvisits
                           {-# LINE 2459 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule266 #-}
   {-# LINE 534 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule266 = \ ((_hdIt_visits) :: PP_Doc) ->
                   {-# LINE 534 "src-ag/ExecutionPlan2Caml.ag" #-}
                   _hdIt_visits
                   {-# LINE 2465 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule267 #-}
   rule267 = \ ((_hdIchildvisit) :: Map VisitIdentifier (Identifier -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)) ((_tlIchildvisit) :: Map VisitIdentifier (Identifier -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)) ->
     _hdIchildvisit `Map.union` _tlIchildvisit
   {-# INLINE rule268 #-}
   rule268 = \ ((_hdIcount) :: Int) ((_tlIcount) :: Int) ->
     _hdIcount + _tlIcount
   {-# INLINE rule269 #-}
   rule269 = \ ((_hdIdatatype) :: PP_Doc) ((_tlIdatatype) :: [PP_Doc]) ->
     _hdIdatatype : _tlIdatatype
   {-# INLINE rule270 #-}
   rule270 = \ ((_hdIdatatype_call) :: PP_Doc) ((_tlIdatatype_call) :: [PP_Doc]) ->
     _hdIdatatype_call : _tlIdatatype_call
   {-# INLINE rule271 #-}
   rule271 = \ ((_hdIdatatype_con) :: PP_Doc) ((_tlIdatatype_con) :: [PP_Doc]) ->
     _hdIdatatype_con : _tlIdatatype_con
   {-# INLINE rule272 #-}
   rule272 = \ ((_hdIerrors) :: Seq Error) ((_tlIerrors) :: Seq Error) ->
     _hdIerrors Seq.>< _tlIerrors
   {-# INLINE rule273 #-}
   rule273 = \ ((_hdIfromToStates) :: Map VisitIdentifier (Int,Int)) ((_tlIfromToStates) :: Map VisitIdentifier (Int,Int)) ->
     _hdIfromToStates `mappend` _tlIfromToStates
   {-# INLINE rule274 #-}
   rule274 = \ ((_hdIsemFunBndDefs) :: Seq PP_Doc) ((_tlIsemFunBndDefs) :: Seq PP_Doc) ->
     _hdIsemFunBndDefs Seq.>< _tlIsemFunBndDefs
   {-# INLINE rule275 #-}
   rule275 = \ ((_hdIsemFunBndTps) :: Seq PP_Doc) ((_tlIsemFunBndTps) :: Seq PP_Doc) ->
     _hdIsemFunBndTps Seq.>< _tlIsemFunBndTps
   {-# INLINE rule276 #-}
   rule276 = \ ((_hdIsem_nt) :: PP_Doc) ((_tlIsem_nt) :: PP_Doc) ->
     _hdIsem_nt >-< _tlIsem_nt
   {-# INLINE rule277 #-}
   rule277 = \ ((_hdIsem_prod) :: PP_Doc) ((_tlIsem_prod) :: PP_Doc) ->
     _hdIsem_prod >-< _tlIsem_prod
   {-# INLINE rule278 #-}
   rule278 = \ ((_hdIvisitKinds) :: Map VisitIdentifier VisitKind) ((_tlIvisitKinds) :: Map VisitIdentifier VisitKind) ->
     _hdIvisitKinds `mappend` _tlIvisitKinds
   {-# INLINE rule279 #-}
   rule279 = \ ((_hdIvisitdefs) :: Map VisitIdentifier (Set Identifier)) ((_tlIvisitdefs) :: Map VisitIdentifier (Set Identifier)) ->
     _hdIvisitdefs `uwSetUnion` _tlIvisitdefs
   {-# INLINE rule280 #-}
   rule280 = \ ((_hdIvisituses) :: Map VisitIdentifier (Set Identifier)) ((_tlIvisituses) :: Map VisitIdentifier (Set Identifier)) ->
     _hdIvisituses `uwSetUnion` _tlIvisituses
   {-# INLINE rule281 #-}
   rule281 = \ ((_lhsIallFromToStates) :: Map VisitIdentifier (Int,Int)) ->
     _lhsIallFromToStates
   {-# INLINE rule282 #-}
   rule282 = \ ((_lhsIallInhmap) :: Map NontermIdent Attributes) ->
     _lhsIallInhmap
   {-# INLINE rule283 #-}
   rule283 = \ ((_lhsIallInitStates) :: Map NontermIdent Int) ->
     _lhsIallInitStates
   {-# INLINE rule284 #-}
   rule284 = \ ((_lhsIallSynmap) :: Map NontermIdent Attributes) ->
     _lhsIallSynmap
   {-# INLINE rule285 #-}
   rule285 = \ ((_lhsIallVisitKinds) :: Map VisitIdentifier VisitKind) ->
     _lhsIallVisitKinds
   {-# INLINE rule286 #-}
   rule286 = \ ((_lhsIallchildvisit) :: Map VisitIdentifier (Identifier -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)) ->
     _lhsIallchildvisit
   {-# INLINE rule287 #-}
   rule287 = \ ((_lhsIallstates) :: [StateIdentifier]) ->
     _lhsIallstates
   {-# INLINE rule288 #-}
   rule288 = \ ((_lhsIavisitdefs) :: Map VisitIdentifier (Set Identifier)) ->
     _lhsIavisitdefs
   {-# INLINE rule289 #-}
   rule289 = \ ((_lhsIavisituses) :: Map VisitIdentifier (Set Identifier)) ->
     _lhsIavisituses
   {-# INLINE rule290 #-}
   rule290 = \ ((_lhsIinhmap) :: Attributes) ->
     _lhsIinhmap
   {-# INLINE rule291 #-}
   rule291 = \ ((_lhsIinitial) :: StateIdentifier) ->
     _lhsIinitial
   {-# INLINE rule292 #-}
   rule292 = \ ((_lhsIlocalAttrTypes) :: Map ConstructorIdent (Map Identifier Type)) ->
     _lhsIlocalAttrTypes
   {-# INLINE rule293 #-}
   rule293 = \ ((_lhsImainFile) :: String) ->
     _lhsImainFile
   {-# INLINE rule294 #-}
   rule294 = \ ((_lhsImainName) :: String) ->
     _lhsImainName
   {-# INLINE rule295 #-}
   rule295 = \ ((_lhsInextVisits) :: Map StateIdentifier StateCtx) ->
     _lhsInextVisits
   {-# INLINE rule296 #-}
   rule296 = \ ((_lhsInt) :: NontermIdent) ->
     _lhsInt
   {-# INLINE rule297 #-}
   rule297 = \ ((_lhsIntType) :: Type) ->
     _lhsIntType
   {-# INLINE rule298 #-}
   rule298 = \ ((_lhsIoptions) :: Options) ->
     _lhsIoptions
   {-# INLINE rule299 #-}
   rule299 = \ ((_lhsIparams) :: [Identifier]) ->
     _lhsIparams
   {-# INLINE rule300 #-}
   rule300 = \ ((_lhsIprevVisits) :: Map StateIdentifier StateCtx) ->
     _lhsIprevVisits
   {-# INLINE rule301 #-}
   rule301 = \ ((_lhsIrename) :: Bool) ->
     _lhsIrename
   {-# INLINE rule302 #-}
   rule302 = \ ((_lhsIsynmap) :: Attributes) ->
     _lhsIsynmap
   {-# INLINE rule303 #-}
   rule303 = \ ((_lhsIallFromToStates) :: Map VisitIdentifier (Int,Int)) ->
     _lhsIallFromToStates
   {-# INLINE rule304 #-}
   rule304 = \ ((_lhsIallInhmap) :: Map NontermIdent Attributes) ->
     _lhsIallInhmap
   {-# INLINE rule305 #-}
   rule305 = \ ((_lhsIallInitStates) :: Map NontermIdent Int) ->
     _lhsIallInitStates
   {-# INLINE rule306 #-}
   rule306 = \ ((_lhsIallSynmap) :: Map NontermIdent Attributes) ->
     _lhsIallSynmap
   {-# INLINE rule307 #-}
   rule307 = \ ((_lhsIallVisitKinds) :: Map VisitIdentifier VisitKind) ->
     _lhsIallVisitKinds
   {-# INLINE rule308 #-}
   rule308 = \ ((_lhsIallchildvisit) :: Map VisitIdentifier (Identifier -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)) ->
     _lhsIallchildvisit
   {-# INLINE rule309 #-}
   rule309 = \ ((_lhsIallstates) :: [StateIdentifier]) ->
     _lhsIallstates
   {-# INLINE rule310 #-}
   rule310 = \ ((_lhsIavisitdefs) :: Map VisitIdentifier (Set Identifier)) ->
     _lhsIavisitdefs
   {-# INLINE rule311 #-}
   rule311 = \ ((_lhsIavisituses) :: Map VisitIdentifier (Set Identifier)) ->
     _lhsIavisituses
   {-# INLINE rule312 #-}
   rule312 = \ ((_lhsIinhmap) :: Attributes) ->
     _lhsIinhmap
   {-# INLINE rule313 #-}
   rule313 = \ ((_lhsIinitial) :: StateIdentifier) ->
     _lhsIinitial
   {-# INLINE rule314 #-}
   rule314 = \ ((_lhsIlocalAttrTypes) :: Map ConstructorIdent (Map Identifier Type)) ->
     _lhsIlocalAttrTypes
   {-# INLINE rule315 #-}
   rule315 = \ ((_lhsImainFile) :: String) ->
     _lhsImainFile
   {-# INLINE rule316 #-}
   rule316 = \ ((_lhsImainName) :: String) ->
     _lhsImainName
   {-# INLINE rule317 #-}
   rule317 = \ ((_lhsInextVisits) :: Map StateIdentifier StateCtx) ->
     _lhsInextVisits
   {-# INLINE rule318 #-}
   rule318 = \ ((_lhsInt) :: NontermIdent) ->
     _lhsInt
   {-# INLINE rule319 #-}
   rule319 = \ ((_lhsIntType) :: Type) ->
     _lhsIntType
   {-# INLINE rule320 #-}
   rule320 = \ ((_lhsIoptions) :: Options) ->
     _lhsIoptions
   {-# INLINE rule321 #-}
   rule321 = \ ((_lhsIparams) :: [Identifier]) ->
     _lhsIparams
   {-# INLINE rule322 #-}
   rule322 = \ ((_lhsIprevVisits) :: Map StateIdentifier StateCtx) ->
     _lhsIprevVisits
   {-# INLINE rule323 #-}
   rule323 = \ ((_lhsIrename) :: Bool) ->
     _lhsIrename
   {-# INLINE rule324 #-}
   rule324 = \ ((_lhsIsynmap) :: Attributes) ->
     _lhsIsynmap
{-# NOINLINE sem_EProductions_Nil #-}
sem_EProductions_Nil ::  T_EProductions 
sem_EProductions_Nil :: T_EProductions
sem_EProductions_Nil  = Identity T_EProductions_s17 -> T_EProductions
T_EProductions (forall (m :: * -> *) a. Monad m => a -> m a
return T_EProductions_s17
st17) where
   {-# NOINLINE st17 #-}
   st17 :: T_EProductions_s17
st17 = let
      v16 :: T_EProductions_v16 
      v16 :: T_EProductions_v16
v16 = \ (T_EProductions_vIn16 Map Int (Int, Int)
_lhsIallFromToStates Map NontermIdent Attributes
_lhsIallInhmap Map NontermIdent Int
_lhsIallInitStates Map NontermIdent Attributes
_lhsIallSynmap Map Int VisitKind
_lhsIallVisitKinds Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_lhsIallchildvisit [Int]
_lhsIallstates Map Int (Set NontermIdent)
_lhsIavisitdefs Map Int (Set NontermIdent)
_lhsIavisituses Attributes
_lhsIinhmap Int
_lhsIinitial Map NontermIdent Attributes
_lhsIlocalAttrTypes String
_lhsImainFile String
_lhsImainName Map Int StateCtx
_lhsInextVisits NontermIdent
_lhsInt Type
_lhsIntType Options
_lhsIoptions [NontermIdent]
_lhsIparams Map Int StateCtx
_lhsIprevVisits Bool
_lhsIrename Attributes
_lhsIsynmap) -> ( let
         _lhsOallvisits :: [VisitStateState]
         _lhsOallvisits :: [VisitStateState]
_lhsOallvisits = forall {a}. () -> a
rule325  ()
         _lhsOchildvisit :: Map VisitIdentifier (Identifier -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
         _lhsOchildvisit :: Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_lhsOchildvisit = forall {k} {a}. () -> Map k a
rule326  ()
         _lhsOcount :: Int
         _lhsOcount :: Int
_lhsOcount = () -> Int
rule327  ()
         _lhsOdatatype :: [PP_Doc]
         _lhsOdatatype :: [PP_Doc]
_lhsOdatatype = forall {a}. () -> [a]
rule328  ()
         _lhsOdatatype_call :: [PP_Doc]
         _lhsOdatatype_call :: [PP_Doc]
_lhsOdatatype_call = forall {a}. () -> [a]
rule329  ()
         _lhsOdatatype_con :: [PP_Doc]
         _lhsOdatatype_con :: [PP_Doc]
_lhsOdatatype_con = forall {a}. () -> [a]
rule330  ()
         _lhsOerrors :: Seq Error
         _lhsOerrors :: Seq Error
_lhsOerrors = forall {a}. () -> Seq a
rule331  ()
         _lhsOfromToStates :: Map VisitIdentifier (Int,Int)
         _lhsOfromToStates :: Map Int (Int, Int)
_lhsOfromToStates = () -> Map Int (Int, Int)
rule332  ()
         _lhsOsemFunBndDefs :: Seq PP_Doc
         _lhsOsemFunBndDefs :: Seq PP_Doc
_lhsOsemFunBndDefs = forall {a}. () -> Seq a
rule333  ()
         _lhsOsemFunBndTps :: Seq PP_Doc
         _lhsOsemFunBndTps :: Seq PP_Doc
_lhsOsemFunBndTps = forall {a}. () -> Seq a
rule334  ()
         _lhsOsem_nt :: PP_Doc
         _lhsOsem_nt :: PP_Doc
_lhsOsem_nt = () -> PP_Doc
rule335  ()
         _lhsOsem_prod :: PP_Doc
         _lhsOsem_prod :: PP_Doc
_lhsOsem_prod = () -> PP_Doc
rule336  ()
         _lhsOt_visits :: PP_Doc
         _lhsOt_visits :: PP_Doc
_lhsOt_visits = () -> PP_Doc
rule337  ()
         _lhsOvisitKinds :: Map VisitIdentifier VisitKind
         _lhsOvisitKinds :: Map Int VisitKind
_lhsOvisitKinds = () -> Map Int VisitKind
rule338  ()
         _lhsOvisitdefs :: Map VisitIdentifier (Set Identifier)
         _lhsOvisitdefs :: Map Int (Set NontermIdent)
_lhsOvisitdefs = forall {k} {a}. () -> Map k a
rule339  ()
         _lhsOvisituses :: Map VisitIdentifier (Set Identifier)
         _lhsOvisituses :: Map Int (Set NontermIdent)
_lhsOvisituses = forall {k} {a}. () -> Map k a
rule340  ()
         __result_ :: T_EProductions_vOut16
__result_ = [VisitStateState]
-> Map
     Int
     (NontermIdent
      -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
-> Int
-> [PP_Doc]
-> [PP_Doc]
-> [PP_Doc]
-> Seq Error
-> Map Int (Int, Int)
-> Seq PP_Doc
-> Seq PP_Doc
-> PP_Doc
-> PP_Doc
-> PP_Doc
-> Map Int VisitKind
-> Map Int (Set NontermIdent)
-> Map Int (Set NontermIdent)
-> T_EProductions_vOut16
T_EProductions_vOut16 [VisitStateState]
_lhsOallvisits Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_lhsOchildvisit Int
_lhsOcount [PP_Doc]
_lhsOdatatype [PP_Doc]
_lhsOdatatype_call [PP_Doc]
_lhsOdatatype_con Seq Error
_lhsOerrors Map Int (Int, Int)
_lhsOfromToStates Seq PP_Doc
_lhsOsemFunBndDefs Seq PP_Doc
_lhsOsemFunBndTps PP_Doc
_lhsOsem_nt PP_Doc
_lhsOsem_prod PP_Doc
_lhsOt_visits Map Int VisitKind
_lhsOvisitKinds Map Int (Set NontermIdent)
_lhsOvisitdefs Map Int (Set NontermIdent)
_lhsOvisituses
         in T_EProductions_vOut16
__result_ )
     in T_EProductions_v16 -> T_EProductions_s17
C_EProductions_s17 T_EProductions_v16
v16
   {-# INLINE rule325 #-}
   {-# LINE 440 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule325 = \  (_ :: ()) ->
                           {-# LINE 440 "src-ag/ExecutionPlan2Caml.ag" #-}
                           error "Every nonterminal should have at least 1 production"
                           {-# LINE 2687 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule326 #-}
   rule326 = \  (_ :: ()) ->
     Map.empty
   {-# INLINE rule327 #-}
   rule327 = \  (_ :: ()) ->
     0
   {-# INLINE rule328 #-}
   rule328 = \  (_ :: ()) ->
     []
   {-# INLINE rule329 #-}
   rule329 = \  (_ :: ()) ->
     []
   {-# INLINE rule330 #-}
   rule330 = \  (_ :: ()) ->
     []
   {-# INLINE rule331 #-}
   rule331 = \  (_ :: ()) ->
     Seq.empty
   {-# INLINE rule332 #-}
   rule332 = \  (_ :: ()) ->
     mempty
   {-# INLINE rule333 #-}
   rule333 = \  (_ :: ()) ->
     Seq.empty
   {-# INLINE rule334 #-}
   rule334 = \  (_ :: ()) ->
     Seq.empty
   {-# INLINE rule335 #-}
   rule335 = \  (_ :: ()) ->
     empty
   {-# INLINE rule336 #-}
   rule336 = \  (_ :: ()) ->
     empty
   {-# INLINE rule337 #-}
   rule337 = \  (_ :: ()) ->
     empty
   {-# INLINE rule338 #-}
   rule338 = \  (_ :: ()) ->
     mempty
   {-# INLINE rule339 #-}
   rule339 = \  (_ :: ()) ->
     Map.empty
   {-# INLINE rule340 #-}
   rule340 = \  (_ :: ()) ->
     Map.empty

-- ERule -------------------------------------------------------
-- wrapper
data Inh_ERule  = Inh_ERule { Inh_ERule -> Map NontermIdent Attributes
allInhmap_Inh_ERule :: (Map NontermIdent Attributes), Inh_ERule -> Map NontermIdent Attributes
allSynmap_Inh_ERule :: (Map NontermIdent Attributes), Inh_ERule -> Attributes
childTypes_Inh_ERule :: (Map Identifier Type), Inh_ERule -> NontermIdent
con_Inh_ERule :: (ConstructorIdent), Inh_ERule -> Attributes
inhmap_Inh_ERule :: (Attributes), Inh_ERule -> Set String
lazyIntras_Inh_ERule :: (Set String), Inh_ERule -> Attributes
localAttrTypes_Inh_ERule :: (Map Identifier Type), Inh_ERule -> String
mainFile_Inh_ERule :: (String), Inh_ERule -> String
mainName_Inh_ERule :: (String), Inh_ERule -> NontermIdent
nt_Inh_ERule :: (NontermIdent), Inh_ERule -> Options
options_Inh_ERule :: (Options), Inh_ERule -> Map NontermIdent (Set VisitKind)
ruleKinds_Inh_ERule :: (Map Identifier (Set VisitKind)), Inh_ERule -> Attributes
synmap_Inh_ERule :: (Attributes), Inh_ERule -> Map NontermIdent Int
usageInfo_Inh_ERule :: (Map Identifier Int) }
data Syn_ERule  = Syn_ERule { Syn_ERule -> Seq Error
errors_Syn_ERule :: (Seq Error), Syn_ERule -> Map NontermIdent (VisitKind -> Either Error PP_Doc)
mrules_Syn_ERule :: (Map Identifier (VisitKind -> Either Error PP_Doc)), Syn_ERule -> Map NontermIdent (Set String)
ruledefs_Syn_ERule :: (Map Identifier (Set String)), Syn_ERule -> Map NontermIdent (Map String (Maybe NonLocalAttr))
ruleuses_Syn_ERule :: (Map Identifier (Map String (Maybe NonLocalAttr))), Syn_ERule -> PP_Doc
sem_rules_Syn_ERule :: (PP_Doc) }
{-# INLINABLE wrap_ERule #-}
wrap_ERule :: T_ERule  -> Inh_ERule  -> (Syn_ERule )
wrap_ERule :: T_ERule -> Inh_ERule -> Syn_ERule
wrap_ERule (T_ERule Identity T_ERule_s20
act) (Inh_ERule Map NontermIdent Attributes
_lhsIallInhmap Map NontermIdent Attributes
_lhsIallSynmap Attributes
_lhsIchildTypes NontermIdent
_lhsIcon Attributes
_lhsIinhmap Set String
_lhsIlazyIntras Attributes
_lhsIlocalAttrTypes String
_lhsImainFile String
_lhsImainName NontermIdent
_lhsInt Options
_lhsIoptions Map NontermIdent (Set VisitKind)
_lhsIruleKinds Attributes
_lhsIsynmap Map NontermIdent Int
_lhsIusageInfo) =
   forall a. Identity a -> a
Control.Monad.Identity.runIdentity (
     do T_ERule_s20
sem <- Identity T_ERule_s20
act
        let arg19 :: T_ERule_vIn19
arg19 = Map NontermIdent Attributes
-> Map NontermIdent Attributes
-> Attributes
-> NontermIdent
-> Attributes
-> Set String
-> Attributes
-> String
-> String
-> NontermIdent
-> Options
-> Map NontermIdent (Set VisitKind)
-> Attributes
-> Map NontermIdent Int
-> T_ERule_vIn19
T_ERule_vIn19 Map NontermIdent Attributes
_lhsIallInhmap Map NontermIdent Attributes
_lhsIallSynmap Attributes
_lhsIchildTypes NontermIdent
_lhsIcon Attributes
_lhsIinhmap Set String
_lhsIlazyIntras Attributes
_lhsIlocalAttrTypes String
_lhsImainFile String
_lhsImainName NontermIdent
_lhsInt Options
_lhsIoptions Map NontermIdent (Set VisitKind)
_lhsIruleKinds Attributes
_lhsIsynmap Map NontermIdent Int
_lhsIusageInfo
        (T_ERule_vOut19 Seq Error
_lhsOerrors Map NontermIdent (VisitKind -> Either Error PP_Doc)
_lhsOmrules Map NontermIdent (Set String)
_lhsOruledefs Map NontermIdent (Map String (Maybe NonLocalAttr))
_lhsOruleuses PP_Doc
_lhsOsem_rules) <- forall (m :: * -> *) a. Monad m => a -> m a
return (T_ERule_s20 -> T_ERule_v19
inv_ERule_s20 T_ERule_s20
sem T_ERule_vIn19
arg19)
        forall (m :: * -> *) a. Monad m => a -> m a
return (Seq Error
-> Map NontermIdent (VisitKind -> Either Error PP_Doc)
-> Map NontermIdent (Set String)
-> Map NontermIdent (Map String (Maybe NonLocalAttr))
-> PP_Doc
-> Syn_ERule
Syn_ERule Seq Error
_lhsOerrors Map NontermIdent (VisitKind -> Either Error PP_Doc)
_lhsOmrules Map NontermIdent (Set String)
_lhsOruledefs Map NontermIdent (Map String (Maybe NonLocalAttr))
_lhsOruleuses PP_Doc
_lhsOsem_rules)
   )

-- cata
{-# INLINE sem_ERule #-}
sem_ERule :: ERule  -> T_ERule 
sem_ERule :: ERule -> T_ERule
sem_ERule ( ERule NontermIdent
name_ Pattern
pattern_ Expression
rhs_ Bool
owrt_ String
origin_ Bool
explicit_ Bool
pure_ Maybe Error
mbError_ ) = NontermIdent
-> T_Pattern
-> T_Expression
-> Bool
-> String
-> Bool
-> Bool
-> Maybe Error
-> T_ERule
sem_ERule_ERule NontermIdent
name_ ( Pattern -> T_Pattern
sem_Pattern Pattern
pattern_ ) ( Expression -> T_Expression
sem_Expression Expression
rhs_ ) Bool
owrt_ String
origin_ Bool
explicit_ Bool
pure_ Maybe Error
mbError_

-- semantic domain
newtype T_ERule  = T_ERule {
                           T_ERule -> Identity T_ERule_s20
attach_T_ERule :: Identity (T_ERule_s20 )
                           }
newtype T_ERule_s20  = C_ERule_s20 {
                                   T_ERule_s20 -> T_ERule_v19
inv_ERule_s20 :: (T_ERule_v19 )
                                   }
data T_ERule_s21  = C_ERule_s21
type T_ERule_v19  = (T_ERule_vIn19 ) -> (T_ERule_vOut19 )
data T_ERule_vIn19  = T_ERule_vIn19 (Map NontermIdent Attributes) (Map NontermIdent Attributes) (Map Identifier Type) (ConstructorIdent) (Attributes) (Set String) (Map Identifier Type) (String) (String) (NontermIdent) (Options) (Map Identifier (Set VisitKind)) (Attributes) (Map Identifier Int)
data T_ERule_vOut19  = T_ERule_vOut19 (Seq Error) (Map Identifier (VisitKind -> Either Error PP_Doc)) (Map Identifier (Set String)) (Map Identifier (Map String (Maybe NonLocalAttr))) (PP_Doc)
{-# NOINLINE sem_ERule_ERule #-}
sem_ERule_ERule :: (Identifier) -> T_Pattern  -> T_Expression  -> (Bool) -> (String) -> (Bool) -> (Bool) -> (Maybe Error) -> T_ERule 
sem_ERule_ERule :: NontermIdent
-> T_Pattern
-> T_Expression
-> Bool
-> String
-> Bool
-> Bool
-> Maybe Error
-> T_ERule
sem_ERule_ERule NontermIdent
arg_name_ T_Pattern
arg_pattern_ T_Expression
arg_rhs_ Bool
_ String
_ Bool
arg_explicit_ Bool
arg_pure_ Maybe Error
arg_mbError_ = Identity T_ERule_s20 -> T_ERule
T_ERule (forall (m :: * -> *) a. Monad m => a -> m a
return T_ERule_s20
st20) where
   {-# NOINLINE st20 #-}
   st20 :: T_ERule_s20
st20 = let
      v19 :: T_ERule_v19 
      v19 :: T_ERule_v19
v19 = \ (T_ERule_vIn19 Map NontermIdent Attributes
_lhsIallInhmap Map NontermIdent Attributes
_lhsIallSynmap Attributes
_lhsIchildTypes NontermIdent
_lhsIcon Attributes
_lhsIinhmap Set String
_lhsIlazyIntras Attributes
_lhsIlocalAttrTypes String
_lhsImainFile String
_lhsImainName NontermIdent
_lhsInt Options
_lhsIoptions Map NontermIdent (Set VisitKind)
_lhsIruleKinds Attributes
_lhsIsynmap Map NontermIdent Int
_lhsIusageInfo) -> ( let
         _patternX41 :: T_Pattern_s41
_patternX41 = forall a. Identity a -> a
Control.Monad.Identity.runIdentity (T_Pattern -> Identity T_Pattern_s41
attach_T_Pattern (T_Pattern
arg_pattern_))
         _rhsX29 :: T_Expression_s29
_rhsX29 = forall a. Identity a -> a
Control.Monad.Identity.runIdentity (T_Expression -> Identity T_Expression_s29
attach_T_Expression (T_Expression
arg_rhs_))
         (T_Pattern_vOut40 PP_Doc
_patternIattrTypes Set String
_patternIattrs Pattern
_patternIcopy [(PP_Doc, PP_Doc)]
_patternIextraDefs Bool
_patternIisUnderscore PP_Doc
_patternIsem_lhs) = T_Pattern_s41 -> T_Pattern_v40
inv_Pattern_s41 T_Pattern_s41
_patternX41 (Map NontermIdent Attributes
-> Map NontermIdent Attributes
-> Bool
-> Attributes
-> Attributes
-> Options
-> Attributes
-> T_Pattern_vIn40
T_Pattern_vIn40 Map NontermIdent Attributes
_patternOallInhmap Map NontermIdent Attributes
_patternOallSynmap Bool
_patternOanyLazyKind Attributes
_patternOinhmap Attributes
_patternOlocalAttrTypes Options
_patternOoptions Attributes
_patternOsynmap)
         (T_Expression_vOut28 Map String (Maybe NonLocalAttr)
_rhsIattrs Pos
_rhsIpos PP_Doc
_rhsIsemfunc [HsToken]
_rhsItks) = T_Expression_s29 -> T_Expression_v28
inv_Expression_s29 T_Expression_s29
_rhsX29 (Options -> T_Expression_vIn28
T_Expression_vIn28 Options
_rhsOoptions)
         _lhsOsem_rules :: PP_Doc
         _lhsOsem_rules :: PP_Doc
_lhsOsem_rules = PP_Doc -> Int -> PP_Doc
rule341 PP_Doc
_rulecode Int
_used
         _rulecode :: PP_Doc
_rulecode = PP_Doc -> PP_Doc -> Bool -> PP_Doc -> Pos -> PP_Doc -> PP_Doc
rule342 PP_Doc
_declHead PP_Doc
_endpragma Bool
_genpragma PP_Doc
_pragma Pos
_rhsIpos PP_Doc
_rhsIsemfunc
         _pragma :: PP_Doc
_pragma = Options -> Pos -> PP_Doc
rule343 Options
_lhsIoptions Pos
_rhsIpos
         _endpragma :: PP_Doc
_endpragma = String -> Options -> PP_Doc
rule344 String
_lhsImainFile Options
_lhsIoptions
         _genpragma :: Bool
_genpragma = Bool -> Options -> Bool -> Bool
rule345 Bool
_haspos Options
_lhsIoptions Bool
arg_explicit_
         _haspos :: Bool
_haspos = Pos -> Bool
rule346 Pos
_rhsIpos
         _declHead :: PP_Doc
_declHead = PP_Doc
-> Options
-> Map String (Maybe NonLocalAttr)
-> NontermIdent
-> PP_Doc
rule347 PP_Doc
_argPats Options
_lhsIoptions Map String (Maybe NonLocalAttr)
_rhsIattrs NontermIdent
arg_name_
         _argPats :: PP_Doc
_argPats = Map NontermIdent Attributes
-> Map NontermIdent Attributes
-> Attributes
-> Attributes
-> Options
-> Map String (Maybe NonLocalAttr)
-> PP_Doc
rule348 Map NontermIdent Attributes
_lhsIallInhmap Map NontermIdent Attributes
_lhsIallSynmap Attributes
_lhsIchildTypes Attributes
_lhsIlocalAttrTypes Options
_lhsIoptions Map String (Maybe NonLocalAttr)
_rhsIattrs
         _argExprs :: PP_Doc
_argExprs = Map String (Maybe NonLocalAttr) -> PP_Doc
rule349 Map String (Maybe NonLocalAttr)
_rhsIattrs
         _stepcode :: VisitKind -> Either Error PP_Doc
_stepcode = PP_Doc
-> Options
-> [(PP_Doc, PP_Doc)]
-> PP_Doc
-> Map String (Maybe NonLocalAttr)
-> NontermIdent
-> Bool
-> VisitKind
-> Either Error PP_Doc
rule350 PP_Doc
_argExprs Options
_lhsIoptions [(PP_Doc, PP_Doc)]
_patternIextraDefs PP_Doc
_patternIsem_lhs Map String (Maybe NonLocalAttr)
_rhsIattrs NontermIdent
arg_name_ Bool
arg_pure_
         _lhsOmrules :: Map Identifier (VisitKind -> Either Error PP_Doc)
         _lhsOmrules :: Map NontermIdent (VisitKind -> Either Error PP_Doc)
_lhsOmrules = forall {a} {k}. a -> k -> Map k a
rule351 VisitKind -> Either Error PP_Doc
_stepcode NontermIdent
arg_name_
         _used :: Int
_used = Map NontermIdent Int -> NontermIdent -> Int
rule352 Map NontermIdent Int
_lhsIusageInfo NontermIdent
arg_name_
         _kinds :: Set VisitKind
_kinds = Map NontermIdent (Set VisitKind) -> NontermIdent -> Set VisitKind
rule353 Map NontermIdent (Set VisitKind)
_lhsIruleKinds NontermIdent
arg_name_
         _anyLazyKind :: Bool
_anyLazyKind = Set VisitKind -> Bool
rule354 Set VisitKind
_kinds
         _lhsOruledefs :: Map Identifier (Set String)
         _lhsOruledefs :: Map NontermIdent (Set String)
_lhsOruledefs = forall {k}. Set String -> k -> Map k (Set String)
rule355 Set String
_patternIattrs NontermIdent
arg_name_
         _lhsOruleuses :: Map Identifier (Map String (Maybe NonLocalAttr))
         _lhsOruleuses :: Map NontermIdent (Map String (Maybe NonLocalAttr))
_lhsOruleuses = forall {k}.
Map String (Maybe NonLocalAttr)
-> k -> Map k (Map String (Maybe NonLocalAttr))
rule356 Map String (Maybe NonLocalAttr)
_rhsIattrs NontermIdent
arg_name_
         _lhsOerrors :: Seq Error
         _lhsOerrors :: Seq Error
_lhsOerrors = forall {a}. Int -> Maybe a -> Seq a
rule357 Int
_used Maybe Error
arg_mbError_
         _patternOallInhmap :: Map NontermIdent Attributes
_patternOallInhmap = Map NontermIdent Attributes -> Map NontermIdent Attributes
rule358 Map NontermIdent Attributes
_lhsIallInhmap
         _patternOallSynmap :: Map NontermIdent Attributes
_patternOallSynmap = Map NontermIdent Attributes -> Map NontermIdent Attributes
rule359 Map NontermIdent Attributes
_lhsIallSynmap
         _patternOanyLazyKind :: Bool
_patternOanyLazyKind = forall a. a -> a
rule360 Bool
_anyLazyKind
         _patternOinhmap :: Attributes
_patternOinhmap = Attributes -> Attributes
rule361 Attributes
_lhsIinhmap
         _patternOlocalAttrTypes :: Attributes
_patternOlocalAttrTypes = Attributes -> Attributes
rule362 Attributes
_lhsIlocalAttrTypes
         _patternOoptions :: Options
_patternOoptions = Options -> Options
rule363 Options
_lhsIoptions
         _patternOsynmap :: Attributes
_patternOsynmap = Attributes -> Attributes
rule364 Attributes
_lhsIsynmap
         _rhsOoptions :: Options
_rhsOoptions = Options -> Options
rule365 Options
_lhsIoptions
         __result_ :: T_ERule_vOut19
__result_ = Seq Error
-> Map NontermIdent (VisitKind -> Either Error PP_Doc)
-> Map NontermIdent (Set String)
-> Map NontermIdent (Map String (Maybe NonLocalAttr))
-> PP_Doc
-> T_ERule_vOut19
T_ERule_vOut19 Seq Error
_lhsOerrors Map NontermIdent (VisitKind -> Either Error PP_Doc)
_lhsOmrules Map NontermIdent (Set String)
_lhsOruledefs Map NontermIdent (Map String (Maybe NonLocalAttr))
_lhsOruleuses PP_Doc
_lhsOsem_rules
         in T_ERule_vOut19
__result_ )
     in T_ERule_v19 -> T_ERule_s20
C_ERule_s20 T_ERule_v19
v19
   {-# INLINE rule341 #-}
   {-# LINE 977 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule341 = \ _rulecode _used ->
                          {-# LINE 977 "src-ag/ExecutionPlan2Caml.ag" #-}
                          if _used     == 0
                          then empty
                          else _rulecode
                          {-# LINE 2815 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule342 #-}
   {-# LINE 980 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule342 = \ _declHead _endpragma _genpragma _pragma ((_rhsIpos) :: Pos) ((_rhsIsemfunc) :: PP_Doc) ->
                          {-# LINE 980 "src-ag/ExecutionPlan2Caml.ag" #-}
                          ( if _genpragma
                            then _pragma
                            else empty
                          )
                          >-< _declHead
                          >-< indent ((column _rhsIpos - 2) `max` 2)
                                ( if _genpragma
                                  then _pragma     >-< _rhsIsemfunc >-< _endpragma
                                  else _rhsIsemfunc
                                )
                          >#< "in"
                          {-# LINE 2831 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule343 #-}
   {-# LINE 993 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule343 = \ ((_lhsIoptions) :: Options) ((_rhsIpos) :: Pos) ->
                           {-# LINE 993 "src-ag/ExecutionPlan2Caml.ag" #-}
                           ppLinePragma _lhsIoptions (line _rhsIpos) (file _rhsIpos)
                           {-# LINE 2837 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule344 #-}
   {-# LINE 994 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule344 = \ ((_lhsImainFile) :: String) ((_lhsIoptions) :: Options) ->
                           {-# LINE 994 "src-ag/ExecutionPlan2Caml.ag" #-}
                           ppWithLineNr (\ln -> ppLinePragma _lhsIoptions (ln+1) _lhsImainFile)
                           {-# LINE 2843 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule345 #-}
   {-# LINE 995 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule345 = \ _haspos ((_lhsIoptions) :: Options) explicit_ ->
                           {-# LINE 995 "src-ag/ExecutionPlan2Caml.ag" #-}
                           genLinePragmas _lhsIoptions && explicit_ && _haspos
                           {-# LINE 2849 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule346 #-}
   {-# LINE 996 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule346 = \ ((_rhsIpos) :: Pos) ->
                           {-# LINE 996 "src-ag/ExecutionPlan2Caml.ag" #-}
                           line _rhsIpos > 0 && column _rhsIpos >= 0 && not (null (file _rhsIpos))
                           {-# LINE 2855 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule347 #-}
   {-# LINE 1000 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule347 = \ _argPats ((_lhsIoptions) :: Options) ((_rhsIattrs) :: Map String (Maybe NonLocalAttr)) name_ ->
                       {-# LINE 1000 "src-ag/ExecutionPlan2Caml.ag" #-}
                       "let" >#< name_ >#< _argPats     >#< dummyPat _lhsIoptions (Map.null _rhsIattrs) >#< "="
                       {-# LINE 2861 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule348 #-}
   {-# LINE 1002 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule348 = \ ((_lhsIallInhmap) :: Map NontermIdent Attributes) ((_lhsIallSynmap) :: Map NontermIdent Attributes) ((_lhsIchildTypes) :: Map Identifier Type) ((_lhsIlocalAttrTypes) :: Map Identifier Type) ((_lhsIoptions) :: Options) ((_rhsIattrs) :: Map String (Maybe NonLocalAttr)) ->
            {-# LINE 1002 "src-ag/ExecutionPlan2Caml.ag" #-}
            ppSpaced
              [ case mbAttr of
                  Just (AttrSyn child nm) | child == _LOC && not (noPerStateTypeSigs _lhsIoptions) ->
                    case Map.lookup nm _lhsIlocalAttrTypes of
                      Just tp -> pp_parens (strNm >#< ":" >#< ppTp tp)
                      Nothing -> pp strNm
                  Just attr | not (noPerStateTypeSigs _lhsIoptions) ->
                    case lookupAttrType attr _lhsIallInhmap _lhsIallSynmap _lhsIchildTypes of
                      Just tpDoc -> pp_parens (strNm >#< ":" >#< tpDoc)
                      Nothing    -> pp strNm
                  _ -> pp strNm
              | (strNm, mbAttr) <- Map.assocs _rhsIattrs
              ]
            {-# LINE 2879 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule349 #-}
   {-# LINE 1016 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule349 = \ ((_rhsIattrs) :: Map String (Maybe NonLocalAttr)) ->
                       {-# LINE 1016 "src-ag/ExecutionPlan2Caml.ag" #-}
                       ppSpaced $ Map.keys _rhsIattrs
                       {-# LINE 2885 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule350 #-}
   {-# LINE 1017 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule350 = \ _argExprs ((_lhsIoptions) :: Options) ((_patternIextraDefs) :: [(PP_Doc,PP_Doc)]) ((_patternIsem_lhs) ::  PP_Doc ) ((_rhsIattrs) :: Map String (Maybe NonLocalAttr)) name_ pure_ ->
                       {-# LINE 1017 "src-ag/ExecutionPlan2Caml.ag" #-}
                       \kind ->
                         let mkBind (pat,expr) = "let" >#< pat >#< "=" >#< expr >#< "in"
                         in if kind `compatibleRule` pure_
                            then Right $ mkBind (_patternIsem_lhs, name_ >#< _argExprs     >#< dummyArg _lhsIoptions (Map.null _rhsIattrs))
                                         >-< vlist (map mkBind _patternIextraDefs)
                            else Left $ IncompatibleRuleKind name_ kind
                       {-# LINE 2896 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule351 #-}
   {-# LINE 1024 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule351 = \ _stepcode name_ ->
                       {-# LINE 1024 "src-ag/ExecutionPlan2Caml.ag" #-}
                       Map.singleton name_ _stepcode
                       {-# LINE 2902 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule352 #-}
   {-# LINE 1227 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule352 = \ ((_lhsIusageInfo) :: Map Identifier Int) name_ ->
                                                 {-# LINE 1227 "src-ag/ExecutionPlan2Caml.ag" #-}
                                                 Map.findWithDefault 0 name_ _lhsIusageInfo
                                                 {-# LINE 2908 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule353 #-}
   {-# LINE 1243 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule353 = \ ((_lhsIruleKinds) :: Map Identifier (Set VisitKind)) name_ ->
                {-# LINE 1243 "src-ag/ExecutionPlan2Caml.ag" #-}
                Map.findWithDefault Set.empty name_ _lhsIruleKinds
                {-# LINE 2914 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule354 #-}
   {-# LINE 1244 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule354 = \ _kinds ->
                      {-# LINE 1244 "src-ag/ExecutionPlan2Caml.ag" #-}
                      Set.fold (\k r -> isLazyKind k || r) False _kinds
                      {-# LINE 2920 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule355 #-}
   {-# LINE 1290 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule355 = \ ((_patternIattrs) :: Set String) name_ ->
                           {-# LINE 1290 "src-ag/ExecutionPlan2Caml.ag" #-}
                           Map.singleton name_ _patternIattrs
                           {-# LINE 2926 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule356 #-}
   {-# LINE 1291 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule356 = \ ((_rhsIattrs) :: Map String (Maybe NonLocalAttr)) name_ ->
                           {-# LINE 1291 "src-ag/ExecutionPlan2Caml.ag" #-}
                           Map.singleton name_ _rhsIattrs
                           {-# LINE 2932 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule357 #-}
   {-# LINE 1485 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule357 = \ _used mbError_ ->
                 {-# LINE 1485 "src-ag/ExecutionPlan2Caml.ag" #-}
                 case mbError_ of
                   Just e | _used     > 0 -> Seq.singleton e
                   _                      -> Seq.empty
                 {-# LINE 2940 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule358 #-}
   rule358 = \ ((_lhsIallInhmap) :: Map NontermIdent Attributes) ->
     _lhsIallInhmap
   {-# INLINE rule359 #-}
   rule359 = \ ((_lhsIallSynmap) :: Map NontermIdent Attributes) ->
     _lhsIallSynmap
   {-# INLINE rule360 #-}
   rule360 = \ _anyLazyKind ->
     _anyLazyKind
   {-# INLINE rule361 #-}
   rule361 = \ ((_lhsIinhmap) :: Attributes) ->
     _lhsIinhmap
   {-# INLINE rule362 #-}
   rule362 = \ ((_lhsIlocalAttrTypes) :: Map Identifier Type) ->
     _lhsIlocalAttrTypes
   {-# INLINE rule363 #-}
   rule363 = \ ((_lhsIoptions) :: Options) ->
     _lhsIoptions
   {-# INLINE rule364 #-}
   rule364 = \ ((_lhsIsynmap) :: Attributes) ->
     _lhsIsynmap
   {-# INLINE rule365 #-}
   rule365 = \ ((_lhsIoptions) :: Options) ->
     _lhsIoptions

-- ERules ------------------------------------------------------
-- wrapper
data Inh_ERules  = Inh_ERules { Inh_ERules -> Map NontermIdent Attributes
allInhmap_Inh_ERules :: (Map NontermIdent Attributes), Inh_ERules -> Map NontermIdent Attributes
allSynmap_Inh_ERules :: (Map NontermIdent Attributes), Inh_ERules -> Attributes
childTypes_Inh_ERules :: (Map Identifier Type), Inh_ERules -> NontermIdent
con_Inh_ERules :: (ConstructorIdent), Inh_ERules -> Attributes
inhmap_Inh_ERules :: (Attributes), Inh_ERules -> Set String
lazyIntras_Inh_ERules :: (Set String), Inh_ERules -> Attributes
localAttrTypes_Inh_ERules :: (Map Identifier Type), Inh_ERules -> String
mainFile_Inh_ERules :: (String), Inh_ERules -> String
mainName_Inh_ERules :: (String), Inh_ERules -> NontermIdent
nt_Inh_ERules :: (NontermIdent), Inh_ERules -> Options
options_Inh_ERules :: (Options), Inh_ERules -> Map NontermIdent (Set VisitKind)
ruleKinds_Inh_ERules :: (Map Identifier (Set VisitKind)), Inh_ERules -> Attributes
synmap_Inh_ERules :: (Attributes), Inh_ERules -> Map NontermIdent Int
usageInfo_Inh_ERules :: (Map Identifier Int) }
data Syn_ERules  = Syn_ERules { Syn_ERules -> Seq Error
errors_Syn_ERules :: (Seq Error), Syn_ERules -> Map NontermIdent (VisitKind -> Either Error PP_Doc)
mrules_Syn_ERules :: (Map Identifier (VisitKind -> Either Error PP_Doc)), Syn_ERules -> Map NontermIdent (Set String)
ruledefs_Syn_ERules :: (Map Identifier (Set String)), Syn_ERules -> Map NontermIdent (Map String (Maybe NonLocalAttr))
ruleuses_Syn_ERules :: (Map Identifier (Map String (Maybe NonLocalAttr))), Syn_ERules -> PP_Doc
sem_rules_Syn_ERules :: (PP_Doc) }
{-# INLINABLE wrap_ERules #-}
wrap_ERules :: T_ERules  -> Inh_ERules  -> (Syn_ERules )
wrap_ERules :: T_ERules -> Inh_ERules -> Syn_ERules
wrap_ERules (T_ERules Identity T_ERules_s23
act) (Inh_ERules Map NontermIdent Attributes
_lhsIallInhmap Map NontermIdent Attributes
_lhsIallSynmap Attributes
_lhsIchildTypes NontermIdent
_lhsIcon Attributes
_lhsIinhmap Set String
_lhsIlazyIntras Attributes
_lhsIlocalAttrTypes String
_lhsImainFile String
_lhsImainName NontermIdent
_lhsInt Options
_lhsIoptions Map NontermIdent (Set VisitKind)
_lhsIruleKinds Attributes
_lhsIsynmap Map NontermIdent Int
_lhsIusageInfo) =
   forall a. Identity a -> a
Control.Monad.Identity.runIdentity (
     do T_ERules_s23
sem <- Identity T_ERules_s23
act
        let arg22 :: T_ERules_vIn22
arg22 = Map NontermIdent Attributes
-> Map NontermIdent Attributes
-> Attributes
-> NontermIdent
-> Attributes
-> Set String
-> Attributes
-> String
-> String
-> NontermIdent
-> Options
-> Map NontermIdent (Set VisitKind)
-> Attributes
-> Map NontermIdent Int
-> T_ERules_vIn22
T_ERules_vIn22 Map NontermIdent Attributes
_lhsIallInhmap Map NontermIdent Attributes
_lhsIallSynmap Attributes
_lhsIchildTypes NontermIdent
_lhsIcon Attributes
_lhsIinhmap Set String
_lhsIlazyIntras Attributes
_lhsIlocalAttrTypes String
_lhsImainFile String
_lhsImainName NontermIdent
_lhsInt Options
_lhsIoptions Map NontermIdent (Set VisitKind)
_lhsIruleKinds Attributes
_lhsIsynmap Map NontermIdent Int
_lhsIusageInfo
        (T_ERules_vOut22 Seq Error
_lhsOerrors Map NontermIdent (VisitKind -> Either Error PP_Doc)
_lhsOmrules Map NontermIdent (Set String)
_lhsOruledefs Map NontermIdent (Map String (Maybe NonLocalAttr))
_lhsOruleuses PP_Doc
_lhsOsem_rules) <- forall (m :: * -> *) a. Monad m => a -> m a
return (T_ERules_s23 -> T_ERules_v22
inv_ERules_s23 T_ERules_s23
sem T_ERules_vIn22
arg22)
        forall (m :: * -> *) a. Monad m => a -> m a
return (Seq Error
-> Map NontermIdent (VisitKind -> Either Error PP_Doc)
-> Map NontermIdent (Set String)
-> Map NontermIdent (Map String (Maybe NonLocalAttr))
-> PP_Doc
-> Syn_ERules
Syn_ERules Seq Error
_lhsOerrors Map NontermIdent (VisitKind -> Either Error PP_Doc)
_lhsOmrules Map NontermIdent (Set String)
_lhsOruledefs Map NontermIdent (Map String (Maybe NonLocalAttr))
_lhsOruleuses PP_Doc
_lhsOsem_rules)
   )

-- cata
{-# NOINLINE sem_ERules #-}
sem_ERules :: ERules  -> T_ERules 
sem_ERules :: ERules -> T_ERules
sem_ERules ERules
list = forall (t :: * -> *) a b.
Foldable t =>
(a -> b -> b) -> b -> t a -> b
Prelude.foldr T_ERule -> T_ERules -> T_ERules
sem_ERules_Cons T_ERules
sem_ERules_Nil (forall a b. (a -> b) -> [a] -> [b]
Prelude.map ERule -> T_ERule
sem_ERule ERules
list)

-- semantic domain
newtype T_ERules  = T_ERules {
                             T_ERules -> Identity T_ERules_s23
attach_T_ERules :: Identity (T_ERules_s23 )
                             }
newtype T_ERules_s23  = C_ERules_s23 {
                                     T_ERules_s23 -> T_ERules_v22
inv_ERules_s23 :: (T_ERules_v22 )
                                     }
data T_ERules_s24  = C_ERules_s24
type T_ERules_v22  = (T_ERules_vIn22 ) -> (T_ERules_vOut22 )
data T_ERules_vIn22  = T_ERules_vIn22 (Map NontermIdent Attributes) (Map NontermIdent Attributes) (Map Identifier Type) (ConstructorIdent) (Attributes) (Set String) (Map Identifier Type) (String) (String) (NontermIdent) (Options) (Map Identifier (Set VisitKind)) (Attributes) (Map Identifier Int)
data T_ERules_vOut22  = T_ERules_vOut22 (Seq Error) (Map Identifier (VisitKind -> Either Error PP_Doc)) (Map Identifier (Set String)) (Map Identifier (Map String (Maybe NonLocalAttr))) (PP_Doc)
{-# NOINLINE sem_ERules_Cons #-}
sem_ERules_Cons :: T_ERule  -> T_ERules  -> T_ERules 
sem_ERules_Cons :: T_ERule -> T_ERules -> T_ERules
sem_ERules_Cons T_ERule
arg_hd_ T_ERules
arg_tl_ = Identity T_ERules_s23 -> T_ERules
T_ERules (forall (m :: * -> *) a. Monad m => a -> m a
return T_ERules_s23
st23) where
   {-# NOINLINE st23 #-}
   st23 :: T_ERules_s23
st23 = let
      v22 :: T_ERules_v22 
      v22 :: T_ERules_v22
v22 = \ (T_ERules_vIn22 Map NontermIdent Attributes
_lhsIallInhmap Map NontermIdent Attributes
_lhsIallSynmap Attributes
_lhsIchildTypes NontermIdent
_lhsIcon Attributes
_lhsIinhmap Set String
_lhsIlazyIntras Attributes
_lhsIlocalAttrTypes String
_lhsImainFile String
_lhsImainName NontermIdent
_lhsInt Options
_lhsIoptions Map NontermIdent (Set VisitKind)
_lhsIruleKinds Attributes
_lhsIsynmap Map NontermIdent Int
_lhsIusageInfo) -> ( let
         _hdX20 :: T_ERule_s20
_hdX20 = forall a. Identity a -> a
Control.Monad.Identity.runIdentity (T_ERule -> Identity T_ERule_s20
attach_T_ERule (T_ERule
arg_hd_))
         _tlX23 :: T_ERules_s23
_tlX23 = forall a. Identity a -> a
Control.Monad.Identity.runIdentity (T_ERules -> Identity T_ERules_s23
attach_T_ERules (T_ERules
arg_tl_))
         (T_ERule_vOut19 Seq Error
_hdIerrors Map NontermIdent (VisitKind -> Either Error PP_Doc)
_hdImrules Map NontermIdent (Set String)
_hdIruledefs Map NontermIdent (Map String (Maybe NonLocalAttr))
_hdIruleuses PP_Doc
_hdIsem_rules) = T_ERule_s20 -> T_ERule_v19
inv_ERule_s20 T_ERule_s20
_hdX20 (Map NontermIdent Attributes
-> Map NontermIdent Attributes
-> Attributes
-> NontermIdent
-> Attributes
-> Set String
-> Attributes
-> String
-> String
-> NontermIdent
-> Options
-> Map NontermIdent (Set VisitKind)
-> Attributes
-> Map NontermIdent Int
-> T_ERule_vIn19
T_ERule_vIn19 Map NontermIdent Attributes
_hdOallInhmap Map NontermIdent Attributes
_hdOallSynmap Attributes
_hdOchildTypes NontermIdent
_hdOcon Attributes
_hdOinhmap Set String
_hdOlazyIntras Attributes
_hdOlocalAttrTypes String
_hdOmainFile String
_hdOmainName NontermIdent
_hdOnt Options
_hdOoptions Map NontermIdent (Set VisitKind)
_hdOruleKinds Attributes
_hdOsynmap Map NontermIdent Int
_hdOusageInfo)
         (T_ERules_vOut22 Seq Error
_tlIerrors Map NontermIdent (VisitKind -> Either Error PP_Doc)
_tlImrules Map NontermIdent (Set String)
_tlIruledefs Map NontermIdent (Map String (Maybe NonLocalAttr))
_tlIruleuses PP_Doc
_tlIsem_rules) = T_ERules_s23 -> T_ERules_v22
inv_ERules_s23 T_ERules_s23
_tlX23 (Map NontermIdent Attributes
-> Map NontermIdent Attributes
-> Attributes
-> NontermIdent
-> Attributes
-> Set String
-> Attributes
-> String
-> String
-> NontermIdent
-> Options
-> Map NontermIdent (Set VisitKind)
-> Attributes
-> Map NontermIdent Int
-> T_ERules_vIn22
T_ERules_vIn22 Map NontermIdent Attributes
_tlOallInhmap Map NontermIdent Attributes
_tlOallSynmap Attributes
_tlOchildTypes NontermIdent
_tlOcon Attributes
_tlOinhmap Set String
_tlOlazyIntras Attributes
_tlOlocalAttrTypes String
_tlOmainFile String
_tlOmainName NontermIdent
_tlOnt Options
_tlOoptions Map NontermIdent (Set VisitKind)
_tlOruleKinds Attributes
_tlOsynmap Map NontermIdent Int
_tlOusageInfo)
         _lhsOerrors :: Seq Error
         _lhsOerrors :: Seq Error
_lhsOerrors = Seq Error -> Seq Error -> Seq Error
rule366 Seq Error
_hdIerrors Seq Error
_tlIerrors
         _lhsOmrules :: Map Identifier (VisitKind -> Either Error PP_Doc)
         _lhsOmrules :: Map NontermIdent (VisitKind -> Either Error PP_Doc)
_lhsOmrules = Map NontermIdent (VisitKind -> Either Error PP_Doc)
-> Map NontermIdent (VisitKind -> Either Error PP_Doc)
-> Map NontermIdent (VisitKind -> Either Error PP_Doc)
rule367 Map NontermIdent (VisitKind -> Either Error PP_Doc)
_hdImrules Map NontermIdent (VisitKind -> Either Error PP_Doc)
_tlImrules
         _lhsOruledefs :: Map Identifier (Set String)
         _lhsOruledefs :: Map NontermIdent (Set String)
_lhsOruledefs = Map NontermIdent (Set String)
-> Map NontermIdent (Set String) -> Map NontermIdent (Set String)
rule368 Map NontermIdent (Set String)
_hdIruledefs Map NontermIdent (Set String)
_tlIruledefs
         _lhsOruleuses :: Map Identifier (Map String (Maybe NonLocalAttr))
         _lhsOruleuses :: Map NontermIdent (Map String (Maybe NonLocalAttr))
_lhsOruleuses = Map NontermIdent (Map String (Maybe NonLocalAttr))
-> Map NontermIdent (Map String (Maybe NonLocalAttr))
-> Map NontermIdent (Map String (Maybe NonLocalAttr))
rule369 Map NontermIdent (Map String (Maybe NonLocalAttr))
_hdIruleuses Map NontermIdent (Map String (Maybe NonLocalAttr))
_tlIruleuses
         _lhsOsem_rules :: PP_Doc
         _lhsOsem_rules :: PP_Doc
_lhsOsem_rules = PP_Doc -> PP_Doc -> PP_Doc
rule370 PP_Doc
_hdIsem_rules PP_Doc
_tlIsem_rules
         _hdOallInhmap :: Map NontermIdent Attributes
_hdOallInhmap = Map NontermIdent Attributes -> Map NontermIdent Attributes
rule371 Map NontermIdent Attributes
_lhsIallInhmap
         _hdOallSynmap :: Map NontermIdent Attributes
_hdOallSynmap = Map NontermIdent Attributes -> Map NontermIdent Attributes
rule372 Map NontermIdent Attributes
_lhsIallSynmap
         _hdOchildTypes :: Attributes
_hdOchildTypes = Attributes -> Attributes
rule373 Attributes
_lhsIchildTypes
         _hdOcon :: NontermIdent
_hdOcon = NontermIdent -> NontermIdent
rule374 NontermIdent
_lhsIcon
         _hdOinhmap :: Attributes
_hdOinhmap = Attributes -> Attributes
rule375 Attributes
_lhsIinhmap
         _hdOlazyIntras :: Set String
_hdOlazyIntras = Set String -> Set String
rule376 Set String
_lhsIlazyIntras
         _hdOlocalAttrTypes :: Attributes
_hdOlocalAttrTypes = Attributes -> Attributes
rule377 Attributes
_lhsIlocalAttrTypes
         _hdOmainFile :: String
_hdOmainFile = String -> String
rule378 String
_lhsImainFile
         _hdOmainName :: String
_hdOmainName = String -> String
rule379 String
_lhsImainName
         _hdOnt :: NontermIdent
_hdOnt = NontermIdent -> NontermIdent
rule380 NontermIdent
_lhsInt
         _hdOoptions :: Options
_hdOoptions = Options -> Options
rule381 Options
_lhsIoptions
         _hdOruleKinds :: Map NontermIdent (Set VisitKind)
_hdOruleKinds = Map NontermIdent (Set VisitKind)
-> Map NontermIdent (Set VisitKind)
rule382 Map NontermIdent (Set VisitKind)
_lhsIruleKinds
         _hdOsynmap :: Attributes
_hdOsynmap = Attributes -> Attributes
rule383 Attributes
_lhsIsynmap
         _hdOusageInfo :: Map NontermIdent Int
_hdOusageInfo = Map NontermIdent Int -> Map NontermIdent Int
rule384 Map NontermIdent Int
_lhsIusageInfo
         _tlOallInhmap :: Map NontermIdent Attributes
_tlOallInhmap = Map NontermIdent Attributes -> Map NontermIdent Attributes
rule385 Map NontermIdent Attributes
_lhsIallInhmap
         _tlOallSynmap :: Map NontermIdent Attributes
_tlOallSynmap = Map NontermIdent Attributes -> Map NontermIdent Attributes
rule386 Map NontermIdent Attributes
_lhsIallSynmap
         _tlOchildTypes :: Attributes
_tlOchildTypes = Attributes -> Attributes
rule387 Attributes
_lhsIchildTypes
         _tlOcon :: NontermIdent
_tlOcon = NontermIdent -> NontermIdent
rule388 NontermIdent
_lhsIcon
         _tlOinhmap :: Attributes
_tlOinhmap = Attributes -> Attributes
rule389 Attributes
_lhsIinhmap
         _tlOlazyIntras :: Set String
_tlOlazyIntras = Set String -> Set String
rule390 Set String
_lhsIlazyIntras
         _tlOlocalAttrTypes :: Attributes
_tlOlocalAttrTypes = Attributes -> Attributes
rule391 Attributes
_lhsIlocalAttrTypes
         _tlOmainFile :: String
_tlOmainFile = String -> String
rule392 String
_lhsImainFile
         _tlOmainName :: String
_tlOmainName = String -> String
rule393 String
_lhsImainName
         _tlOnt :: NontermIdent
_tlOnt = NontermIdent -> NontermIdent
rule394 NontermIdent
_lhsInt
         _tlOoptions :: Options
_tlOoptions = Options -> Options
rule395 Options
_lhsIoptions
         _tlOruleKinds :: Map NontermIdent (Set VisitKind)
_tlOruleKinds = Map NontermIdent (Set VisitKind)
-> Map NontermIdent (Set VisitKind)
rule396 Map NontermIdent (Set VisitKind)
_lhsIruleKinds
         _tlOsynmap :: Attributes
_tlOsynmap = Attributes -> Attributes
rule397 Attributes
_lhsIsynmap
         _tlOusageInfo :: Map NontermIdent Int
_tlOusageInfo = Map NontermIdent Int -> Map NontermIdent Int
rule398 Map NontermIdent Int
_lhsIusageInfo
         __result_ :: T_ERules_vOut22
__result_ = Seq Error
-> Map NontermIdent (VisitKind -> Either Error PP_Doc)
-> Map NontermIdent (Set String)
-> Map NontermIdent (Map String (Maybe NonLocalAttr))
-> PP_Doc
-> T_ERules_vOut22
T_ERules_vOut22 Seq Error
_lhsOerrors Map NontermIdent (VisitKind -> Either Error PP_Doc)
_lhsOmrules Map NontermIdent (Set String)
_lhsOruledefs Map NontermIdent (Map String (Maybe NonLocalAttr))
_lhsOruleuses PP_Doc
_lhsOsem_rules
         in T_ERules_vOut22
__result_ )
     in T_ERules_v22 -> T_ERules_s23
C_ERules_s23 T_ERules_v22
v22
   {-# INLINE rule366 #-}
   rule366 :: Seq Error -> Seq Error -> Seq Error
rule366 = \ ((Seq Error
_hdIerrors) :: Seq Error) ((Seq Error
_tlIerrors) :: Seq Error) ->
     Seq Error
_hdIerrors forall a. Seq a -> Seq a -> Seq a
Seq.>< Seq Error
_tlIerrors
   {-# INLINE rule367 #-}
   rule367 :: Map NontermIdent (VisitKind -> Either Error PP_Doc)
-> Map NontermIdent (VisitKind -> Either Error PP_Doc)
-> Map NontermIdent (VisitKind -> Either Error PP_Doc)
rule367 = \ ((Map NontermIdent (VisitKind -> Either Error PP_Doc)
_hdImrules) :: Map Identifier (VisitKind -> Either Error PP_Doc)) ((Map NontermIdent (VisitKind -> Either Error PP_Doc)
_tlImrules) :: Map Identifier (VisitKind -> Either Error PP_Doc)) ->
     Map NontermIdent (VisitKind -> Either Error PP_Doc)
_hdImrules forall k a. Ord k => Map k a -> Map k a -> Map k a
`Map.union` Map NontermIdent (VisitKind -> Either Error PP_Doc)
_tlImrules
   {-# INLINE rule368 #-}
   rule368 :: Map NontermIdent (Set String)
-> Map NontermIdent (Set String) -> Map NontermIdent (Set String)
rule368 = \ ((Map NontermIdent (Set String)
_hdIruledefs) :: Map Identifier (Set String)) ((Map NontermIdent (Set String)
_tlIruledefs) :: Map Identifier (Set String)) ->
     Map NontermIdent (Set String)
_hdIruledefs forall a b.
(Ord a, Ord b) =>
Map a (Set b) -> Map a (Set b) -> Map a (Set b)
`uwSetUnion` Map NontermIdent (Set String)
_tlIruledefs
   {-# INLINE rule369 #-}
   rule369 :: Map NontermIdent (Map String (Maybe NonLocalAttr))
-> Map NontermIdent (Map String (Maybe NonLocalAttr))
-> Map NontermIdent (Map String (Maybe NonLocalAttr))
rule369 = \ ((Map NontermIdent (Map String (Maybe NonLocalAttr))
_hdIruleuses) :: Map Identifier (Map String (Maybe NonLocalAttr))) ((Map NontermIdent (Map String (Maybe NonLocalAttr))
_tlIruleuses) :: Map Identifier (Map String (Maybe NonLocalAttr))) ->
     Map NontermIdent (Map String (Maybe NonLocalAttr))
_hdIruleuses forall a b c.
(Ord a, Ord b) =>
Map a (Map b c) -> Map a (Map b c) -> Map a (Map b c)
`uwMapUnion` Map NontermIdent (Map String (Maybe NonLocalAttr))
_tlIruleuses
   {-# INLINE rule370 #-}
   rule370 :: PP_Doc -> PP_Doc -> PP_Doc
rule370 = \ ((PP_Doc
_hdIsem_rules) :: PP_Doc) ((PP_Doc
_tlIsem_rules) :: PP_Doc) ->
     PP_Doc
_hdIsem_rules forall a b. (PP a, PP b) => a -> b -> PP_Doc
>-< PP_Doc
_tlIsem_rules
   {-# INLINE rule371 #-}
   rule371 :: Map NontermIdent Attributes -> Map NontermIdent Attributes
rule371 = \ ((Map NontermIdent Attributes
_lhsIallInhmap) :: Map NontermIdent Attributes) ->
     Map NontermIdent Attributes
_lhsIallInhmap
   {-# INLINE rule372 #-}
   rule372 :: Map NontermIdent Attributes -> Map NontermIdent Attributes
rule372 = \ ((Map NontermIdent Attributes
_lhsIallSynmap) :: Map NontermIdent Attributes) ->
     Map NontermIdent Attributes
_lhsIallSynmap
   {-# INLINE rule373 #-}
   rule373 :: Attributes -> Attributes
rule373 = \ ((Attributes
_lhsIchildTypes) :: Map Identifier Type) ->
     Attributes
_lhsIchildTypes
   {-# INLINE rule374 #-}
   rule374 :: NontermIdent -> NontermIdent
rule374 = \ ((NontermIdent
_lhsIcon) :: ConstructorIdent) ->
     NontermIdent
_lhsIcon
   {-# INLINE rule375 #-}
   rule375 :: Attributes -> Attributes
rule375 = \ ((Attributes
_lhsIinhmap) :: Attributes) ->
     Attributes
_lhsIinhmap
   {-# INLINE rule376 #-}
   rule376 :: Set String -> Set String
rule376 = \ ((Set String
_lhsIlazyIntras) :: Set String) ->
     Set String
_lhsIlazyIntras
   {-# INLINE rule377 #-}
   rule377 :: Attributes -> Attributes
rule377 = \ ((Attributes
_lhsIlocalAttrTypes) :: Map Identifier Type) ->
     Attributes
_lhsIlocalAttrTypes
   {-# INLINE rule378 #-}
   rule378 :: String -> String
rule378 = \ ((String
_lhsImainFile) :: String) ->
     String
_lhsImainFile
   {-# INLINE rule379 #-}
   rule379 :: String -> String
rule379 = \ ((String
_lhsImainName) :: String) ->
     String
_lhsImainName
   {-# INLINE rule380 #-}
   rule380 :: NontermIdent -> NontermIdent
rule380 = \ ((NontermIdent
_lhsInt) :: NontermIdent) ->
     NontermIdent
_lhsInt
   {-# INLINE rule381 #-}
   rule381 :: Options -> Options
rule381 = \ ((Options
_lhsIoptions) :: Options) ->
     Options
_lhsIoptions
   {-# INLINE rule382 #-}
   rule382 :: Map NontermIdent (Set VisitKind)
-> Map NontermIdent (Set VisitKind)
rule382 = \ ((Map NontermIdent (Set VisitKind)
_lhsIruleKinds) :: Map Identifier (Set VisitKind)) ->
     Map NontermIdent (Set VisitKind)
_lhsIruleKinds
   {-# INLINE rule383 #-}
   rule383 :: Attributes -> Attributes
rule383 = \ ((Attributes
_lhsIsynmap) :: Attributes) ->
     Attributes
_lhsIsynmap
   {-# INLINE rule384 #-}
   rule384 :: Map NontermIdent Int -> Map NontermIdent Int
rule384 = \ ((Map NontermIdent Int
_lhsIusageInfo) :: Map Identifier Int) ->
     Map NontermIdent Int
_lhsIusageInfo
   {-# INLINE rule385 #-}
   rule385 :: Map NontermIdent Attributes -> Map NontermIdent Attributes
rule385 = \ ((Map NontermIdent Attributes
_lhsIallInhmap) :: Map NontermIdent Attributes) ->
     Map NontermIdent Attributes
_lhsIallInhmap
   {-# INLINE rule386 #-}
   rule386 :: Map NontermIdent Attributes -> Map NontermIdent Attributes
rule386 = \ ((Map NontermIdent Attributes
_lhsIallSynmap) :: Map NontermIdent Attributes) ->
     Map NontermIdent Attributes
_lhsIallSynmap
   {-# INLINE rule387 #-}
   rule387 :: Attributes -> Attributes
rule387 = \ ((Attributes
_lhsIchildTypes) :: Map Identifier Type) ->
     Attributes
_lhsIchildTypes
   {-# INLINE rule388 #-}
   rule388 :: NontermIdent -> NontermIdent
rule388 = \ ((NontermIdent
_lhsIcon) :: ConstructorIdent) ->
     NontermIdent
_lhsIcon
   {-# INLINE rule389 #-}
   rule389 :: Attributes -> Attributes
rule389 = \ ((Attributes
_lhsIinhmap) :: Attributes) ->
     Attributes
_lhsIinhmap
   {-# INLINE rule390 #-}
   rule390 :: Set String -> Set String
rule390 = \ ((Set String
_lhsIlazyIntras) :: Set String) ->
     Set String
_lhsIlazyIntras
   {-# INLINE rule391 #-}
   rule391 :: Attributes -> Attributes
rule391 = \ ((Attributes
_lhsIlocalAttrTypes) :: Map Identifier Type) ->
     Attributes
_lhsIlocalAttrTypes
   {-# INLINE rule392 #-}
   rule392 :: String -> String
rule392 = \ ((String
_lhsImainFile) :: String) ->
     String
_lhsImainFile
   {-# INLINE rule393 #-}
   rule393 :: String -> String
rule393 = \ ((String
_lhsImainName) :: String) ->
     String
_lhsImainName
   {-# INLINE rule394 #-}
   rule394 :: NontermIdent -> NontermIdent
rule394 = \ ((NontermIdent
_lhsInt) :: NontermIdent) ->
     NontermIdent
_lhsInt
   {-# INLINE rule395 #-}
   rule395 :: Options -> Options
rule395 = \ ((Options
_lhsIoptions) :: Options) ->
     Options
_lhsIoptions
   {-# INLINE rule396 #-}
   rule396 :: Map NontermIdent (Set VisitKind)
-> Map NontermIdent (Set VisitKind)
rule396 = \ ((Map NontermIdent (Set VisitKind)
_lhsIruleKinds) :: Map Identifier (Set VisitKind)) ->
     Map NontermIdent (Set VisitKind)
_lhsIruleKinds
   {-# INLINE rule397 #-}
   rule397 :: Attributes -> Attributes
rule397 = \ ((Attributes
_lhsIsynmap) :: Attributes) ->
     Attributes
_lhsIsynmap
   {-# INLINE rule398 #-}
   rule398 :: Map NontermIdent Int -> Map NontermIdent Int
rule398 = \ ((Map NontermIdent Int
_lhsIusageInfo) :: Map Identifier Int) ->
     Map NontermIdent Int
_lhsIusageInfo
{-# NOINLINE sem_ERules_Nil #-}
sem_ERules_Nil ::  T_ERules 
sem_ERules_Nil :: T_ERules
sem_ERules_Nil  = Identity T_ERules_s23 -> T_ERules
T_ERules (forall (m :: * -> *) a. Monad m => a -> m a
return T_ERules_s23
st23) where
   {-# NOINLINE st23 #-}
   st23 :: T_ERules_s23
st23 = let
      v22 :: T_ERules_v22 
      v22 :: T_ERules_v22
v22 = \ (T_ERules_vIn22 Map NontermIdent Attributes
_lhsIallInhmap Map NontermIdent Attributes
_lhsIallSynmap Attributes
_lhsIchildTypes NontermIdent
_lhsIcon Attributes
_lhsIinhmap Set String
_lhsIlazyIntras Attributes
_lhsIlocalAttrTypes String
_lhsImainFile String
_lhsImainName NontermIdent
_lhsInt Options
_lhsIoptions Map NontermIdent (Set VisitKind)
_lhsIruleKinds Attributes
_lhsIsynmap Map NontermIdent Int
_lhsIusageInfo) -> ( let
         _lhsOerrors :: Seq Error
         _lhsOerrors :: Seq Error
_lhsOerrors = forall {a}. () -> Seq a
rule399  ()
         _lhsOmrules :: Map Identifier (VisitKind -> Either Error PP_Doc)
         _lhsOmrules :: Map NontermIdent (VisitKind -> Either Error PP_Doc)
_lhsOmrules = forall {k} {a}. () -> Map k a
rule400  ()
         _lhsOruledefs :: Map Identifier (Set String)
         _lhsOruledefs :: Map NontermIdent (Set String)
_lhsOruledefs = forall {k} {a}. () -> Map k a
rule401  ()
         _lhsOruleuses :: Map Identifier (Map String (Maybe NonLocalAttr))
         _lhsOruleuses :: Map NontermIdent (Map String (Maybe NonLocalAttr))
_lhsOruleuses = forall {k} {a}. () -> Map k a
rule402  ()
         _lhsOsem_rules :: PP_Doc
         _lhsOsem_rules :: PP_Doc
_lhsOsem_rules = () -> PP_Doc
rule403  ()
         __result_ :: T_ERules_vOut22
__result_ = Seq Error
-> Map NontermIdent (VisitKind -> Either Error PP_Doc)
-> Map NontermIdent (Set String)
-> Map NontermIdent (Map String (Maybe NonLocalAttr))
-> PP_Doc
-> T_ERules_vOut22
T_ERules_vOut22 Seq Error
_lhsOerrors Map NontermIdent (VisitKind -> Either Error PP_Doc)
_lhsOmrules Map NontermIdent (Set String)
_lhsOruledefs Map NontermIdent (Map String (Maybe NonLocalAttr))
_lhsOruleuses PP_Doc
_lhsOsem_rules
         in T_ERules_vOut22
__result_ )
     in T_ERules_v22 -> T_ERules_s23
C_ERules_s23 T_ERules_v22
v22
   {-# INLINE rule399 #-}
   rule399 :: () -> Seq a
rule399 = \  (()
_ :: ()) ->
     forall a. Seq a
Seq.empty
   {-# INLINE rule400 #-}
   rule400 :: () -> Map k a
rule400 = \  (()
_ :: ()) ->
     forall k a. Map k a
Map.empty
   {-# INLINE rule401 #-}
   rule401 :: () -> Map k a
rule401 = \  (()
_ :: ()) ->
     forall k a. Map k a
Map.empty
   {-# INLINE rule402 #-}
   rule402 :: () -> Map k a
rule402 = \  (()
_ :: ()) ->
     forall k a. Map k a
Map.empty
   {-# INLINE rule403 #-}
   rule403 :: () -> PP_Doc
rule403 = \  (()
_ :: ()) ->
     PP_Doc
empty

-- ExecutionPlan -----------------------------------------------
-- wrapper
data Inh_ExecutionPlan  = Inh_ExecutionPlan { Inh_ExecutionPlan -> Map NontermIdent Attributes
inhmap_Inh_ExecutionPlan :: (Map NontermIdent Attributes), Inh_ExecutionPlan -> Map NontermIdent (Map NontermIdent Attributes)
localAttrTypes_Inh_ExecutionPlan :: (Map NontermIdent (Map ConstructorIdent (Map Identifier Type))), Inh_ExecutionPlan -> String
mainFile_Inh_ExecutionPlan :: (String), Inh_ExecutionPlan -> String
mainName_Inh_ExecutionPlan :: (String), Inh_ExecutionPlan -> Options
options_Inh_ExecutionPlan :: (Options), Inh_ExecutionPlan -> Map NontermIdent Attributes
synmap_Inh_ExecutionPlan :: (Map NontermIdent Attributes) }
data Syn_ExecutionPlan  = Syn_ExecutionPlan { Syn_ExecutionPlan -> PP_Doc
code_Syn_ExecutionPlan :: (PP_Doc), Syn_ExecutionPlan -> PP_Doc
datas_Syn_ExecutionPlan :: (PP_Doc), Syn_ExecutionPlan -> Seq Error
errors_Syn_ExecutionPlan :: (Seq Error), Syn_ExecutionPlan -> PP_Doc
modules_Syn_ExecutionPlan :: (PP_Doc) }
{-# INLINABLE wrap_ExecutionPlan #-}
wrap_ExecutionPlan :: T_ExecutionPlan  -> Inh_ExecutionPlan  -> (Syn_ExecutionPlan )
wrap_ExecutionPlan :: T_ExecutionPlan -> Inh_ExecutionPlan -> Syn_ExecutionPlan
wrap_ExecutionPlan (T_ExecutionPlan Identity T_ExecutionPlan_s26
act) (Inh_ExecutionPlan Map NontermIdent Attributes
_lhsIinhmap Map NontermIdent (Map NontermIdent Attributes)
_lhsIlocalAttrTypes String
_lhsImainFile String
_lhsImainName Options
_lhsIoptions Map NontermIdent Attributes
_lhsIsynmap) =
   forall a. Identity a -> a
Control.Monad.Identity.runIdentity (
     do T_ExecutionPlan_s26
sem <- Identity T_ExecutionPlan_s26
act
        let arg25 :: T_ExecutionPlan_vIn25
arg25 = Map NontermIdent Attributes
-> Map NontermIdent (Map NontermIdent Attributes)
-> String
-> String
-> Options
-> Map NontermIdent Attributes
-> T_ExecutionPlan_vIn25
T_ExecutionPlan_vIn25 Map NontermIdent Attributes
_lhsIinhmap Map NontermIdent (Map NontermIdent Attributes)
_lhsIlocalAttrTypes String
_lhsImainFile String
_lhsImainName Options
_lhsIoptions Map NontermIdent Attributes
_lhsIsynmap
        (T_ExecutionPlan_vOut25 PP_Doc
_lhsOcode PP_Doc
_lhsOdatas Seq Error
_lhsOerrors PP_Doc
_lhsOmodules) <- forall (m :: * -> *) a. Monad m => a -> m a
return (T_ExecutionPlan_s26 -> T_ExecutionPlan_v25
inv_ExecutionPlan_s26 T_ExecutionPlan_s26
sem T_ExecutionPlan_vIn25
arg25)
        forall (m :: * -> *) a. Monad m => a -> m a
return (PP_Doc -> PP_Doc -> Seq Error -> PP_Doc -> Syn_ExecutionPlan
Syn_ExecutionPlan PP_Doc
_lhsOcode PP_Doc
_lhsOdatas Seq Error
_lhsOerrors PP_Doc
_lhsOmodules)
   )

-- cata
{-# INLINE sem_ExecutionPlan #-}
sem_ExecutionPlan :: ExecutionPlan  -> T_ExecutionPlan 
sem_ExecutionPlan :: ExecutionPlan -> T_ExecutionPlan
sem_ExecutionPlan ( ExecutionPlan ENonterminals
nonts_ TypeSyns
typeSyns_ Set NontermIdent
wrappers_ Derivings
derivings_ ) = T_ENonterminals
-> TypeSyns -> Set NontermIdent -> Derivings -> T_ExecutionPlan
sem_ExecutionPlan_ExecutionPlan ( ENonterminals -> T_ENonterminals
sem_ENonterminals ENonterminals
nonts_ ) TypeSyns
typeSyns_ Set NontermIdent
wrappers_ Derivings
derivings_

-- semantic domain
newtype T_ExecutionPlan  = T_ExecutionPlan {
                                           T_ExecutionPlan -> Identity T_ExecutionPlan_s26
attach_T_ExecutionPlan :: Identity (T_ExecutionPlan_s26 )
                                           }
newtype T_ExecutionPlan_s26  = C_ExecutionPlan_s26 {
                                                   T_ExecutionPlan_s26 -> T_ExecutionPlan_v25
inv_ExecutionPlan_s26 :: (T_ExecutionPlan_v25 )
                                                   }
data T_ExecutionPlan_s27  = C_ExecutionPlan_s27
type T_ExecutionPlan_v25  = (T_ExecutionPlan_vIn25 ) -> (T_ExecutionPlan_vOut25 )
data T_ExecutionPlan_vIn25  = T_ExecutionPlan_vIn25 (Map NontermIdent Attributes) (Map NontermIdent (Map ConstructorIdent (Map Identifier Type))) (String) (String) (Options) (Map NontermIdent Attributes)
data T_ExecutionPlan_vOut25  = T_ExecutionPlan_vOut25 (PP_Doc) (PP_Doc) (Seq Error) (PP_Doc)
{-# NOINLINE sem_ExecutionPlan_ExecutionPlan #-}
sem_ExecutionPlan_ExecutionPlan :: T_ENonterminals  -> (TypeSyns) -> (Set NontermIdent) -> (Derivings) -> T_ExecutionPlan 
sem_ExecutionPlan_ExecutionPlan :: T_ENonterminals
-> TypeSyns -> Set NontermIdent -> Derivings -> T_ExecutionPlan
sem_ExecutionPlan_ExecutionPlan T_ENonterminals
arg_nonts_ TypeSyns
arg_typeSyns_ Set NontermIdent
arg_wrappers_ Derivings
_ = Identity T_ExecutionPlan_s26 -> T_ExecutionPlan
T_ExecutionPlan (forall (m :: * -> *) a. Monad m => a -> m a
return T_ExecutionPlan_s26
st26) where
   {-# NOINLINE st26 #-}
   st26 :: T_ExecutionPlan_s26
st26 = let
      v25 :: T_ExecutionPlan_v25 
      v25 :: T_ExecutionPlan_v25
v25 = \ (T_ExecutionPlan_vIn25 Map NontermIdent Attributes
_lhsIinhmap Map NontermIdent (Map NontermIdent Attributes)
_lhsIlocalAttrTypes String
_lhsImainFile String
_lhsImainName Options
_lhsIoptions Map NontermIdent Attributes
_lhsIsynmap) -> ( let
         _nontsX11 :: T_ENonterminals_s11
_nontsX11 = forall a. Identity a -> a
Control.Monad.Identity.runIdentity (T_ENonterminals -> Identity T_ENonterminals_s11
attach_T_ENonterminals (T_ENonterminals
arg_nonts_))
         (T_ENonterminals_vOut10 Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_nontsIchildvisit PP_Doc
_nontsIcode PP_Doc
_nontsIdatas Seq Error
_nontsIerrors Map Int (Int, Int)
_nontsIfromToStates Map NontermIdent Int
_nontsIinitStates PP_Doc
_nontsImodules Seq PP_Doc
_nontsIsemFunBndDefs Seq PP_Doc
_nontsIsemFunBndTps Map Int VisitKind
_nontsIvisitKinds Map Int (Set NontermIdent)
_nontsIvisitdefs Map Int (Set NontermIdent)
_nontsIvisituses) = T_ENonterminals_s11 -> T_ENonterminals_v10
inv_ENonterminals_s11 T_ENonterminals_s11
_nontsX11 (Map Int (Int, Int)
-> Map NontermIdent Int
-> Map Int VisitKind
-> Map
     Int
     (NontermIdent
      -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
-> Map Int (Set NontermIdent)
-> Map Int (Set NontermIdent)
-> Map NontermIdent Attributes
-> Map NontermIdent (Map NontermIdent Attributes)
-> String
-> String
-> Options
-> Map NontermIdent Attributes
-> TypeSyns
-> Set NontermIdent
-> T_ENonterminals_vIn10
T_ENonterminals_vIn10 Map Int (Int, Int)
_nontsOallFromToStates Map NontermIdent Int
_nontsOallInitStates Map Int VisitKind
_nontsOallVisitKinds Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_nontsOallchildvisit Map Int (Set NontermIdent)
_nontsOavisitdefs Map Int (Set NontermIdent)
_nontsOavisituses Map NontermIdent Attributes
_nontsOinhmap Map NontermIdent (Map NontermIdent Attributes)
_nontsOlocalAttrTypes String
_nontsOmainFile String
_nontsOmainName Options
_nontsOoptions Map NontermIdent Attributes
_nontsOsynmap TypeSyns
_nontsOtypeSyns Set NontermIdent
_nontsOwrappers)
         _lhsOcode :: PP_Doc
         _lhsOcode :: PP_Doc
_lhsOcode = PP_Doc -> PP_Doc -> PP_Doc
rule404 PP_Doc
_nontsIcode PP_Doc
_wrappersExtra
         _lhsOdatas :: PP_Doc
         _lhsOdatas :: PP_Doc
_lhsOdatas = PP_Doc -> PP_Doc -> PP_Doc
rule405 PP_Doc
_commonExtra PP_Doc
_nontsIdatas
         _nontsOwrappers :: Set NontermIdent
_nontsOwrappers = forall a. a -> a
rule406 Set NontermIdent
arg_wrappers_
         _nontsOtypeSyns :: TypeSyns
_nontsOtypeSyns = forall a. a -> a
rule407 TypeSyns
arg_typeSyns_
         _wrappersExtra :: PP_Doc
_wrappersExtra = PP_Doc -> Options -> PP_Doc
rule408 PP_Doc
_lateSemBndDef Options
_lhsIoptions
         _commonExtra :: PP_Doc
_commonExtra = PP_Doc -> Options -> PP_Doc
rule409 PP_Doc
_lateSemBndTp Options
_lhsIoptions
         _lateSemBndTp :: PP_Doc
_lateSemBndTp = String -> Seq PP_Doc -> PP_Doc
rule410 String
_lhsImainName Seq PP_Doc
_nontsIsemFunBndTps
         _lateSemBndDef :: PP_Doc
_lateSemBndDef = String -> Seq PP_Doc -> PP_Doc
rule411 String
_lhsImainName Seq PP_Doc
_nontsIsemFunBndDefs
         _nontsOallchildvisit :: Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_nontsOallchildvisit = Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
-> Map
     Int
     (NontermIdent
      -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
rule412 Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_nontsIchildvisit
         _nontsOavisitdefs :: Map Int (Set NontermIdent)
_nontsOavisitdefs = Map Int (Set NontermIdent) -> Map Int (Set NontermIdent)
rule413 Map Int (Set NontermIdent)
_nontsIvisitdefs
         _nontsOavisituses :: Map Int (Set NontermIdent)
_nontsOavisituses = Map Int (Set NontermIdent) -> Map Int (Set NontermIdent)
rule414 Map Int (Set NontermIdent)
_nontsIvisituses
         _nontsOallFromToStates :: Map Int (Int, Int)
_nontsOallFromToStates = Map Int (Int, Int) -> Map Int (Int, Int)
rule415 Map Int (Int, Int)
_nontsIfromToStates
         _nontsOallVisitKinds :: Map Int VisitKind
_nontsOallVisitKinds = Map Int VisitKind -> Map Int VisitKind
rule416 Map Int VisitKind
_nontsIvisitKinds
         _nontsOallInitStates :: Map NontermIdent Int
_nontsOallInitStates = Map NontermIdent Int -> Map NontermIdent Int
rule417 Map NontermIdent Int
_nontsIinitStates
         _lhsOerrors :: Seq Error
         _lhsOerrors :: Seq Error
_lhsOerrors = Seq Error -> Seq Error
rule418 Seq Error
_nontsIerrors
         _lhsOmodules :: PP_Doc
         _lhsOmodules :: PP_Doc
_lhsOmodules = PP_Doc -> PP_Doc
rule419 PP_Doc
_nontsImodules
         _nontsOinhmap :: Map NontermIdent Attributes
_nontsOinhmap = Map NontermIdent Attributes -> Map NontermIdent Attributes
rule420 Map NontermIdent Attributes
_lhsIinhmap
         _nontsOlocalAttrTypes :: Map NontermIdent (Map NontermIdent Attributes)
_nontsOlocalAttrTypes = Map NontermIdent (Map NontermIdent Attributes)
-> Map NontermIdent (Map NontermIdent Attributes)
rule421 Map NontermIdent (Map NontermIdent Attributes)
_lhsIlocalAttrTypes
         _nontsOmainFile :: String
_nontsOmainFile = String -> String
rule422 String
_lhsImainFile
         _nontsOmainName :: String
_nontsOmainName = String -> String
rule423 String
_lhsImainName
         _nontsOoptions :: Options
_nontsOoptions = Options -> Options
rule424 Options
_lhsIoptions
         _nontsOsynmap :: Map NontermIdent Attributes
_nontsOsynmap = Map NontermIdent Attributes -> Map NontermIdent Attributes
rule425 Map NontermIdent Attributes
_lhsIsynmap
         __result_ :: T_ExecutionPlan_vOut25
__result_ = PP_Doc -> PP_Doc -> Seq Error -> PP_Doc -> T_ExecutionPlan_vOut25
T_ExecutionPlan_vOut25 PP_Doc
_lhsOcode PP_Doc
_lhsOdatas Seq Error
_lhsOerrors PP_Doc
_lhsOmodules
         in T_ExecutionPlan_vOut25
__result_ )
     in T_ExecutionPlan_v25 -> T_ExecutionPlan_s26
C_ExecutionPlan_s26 T_ExecutionPlan_v25
v25
   {-# INLINE rule404 #-}
   {-# LINE 105 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule404 = \ ((_nontsIcode) :: PP_Doc) _wrappersExtra ->
                 {-# LINE 105 "src-ag/ExecutionPlan2Caml.ag" #-}
                 _nontsIcode  >-< _wrappersExtra
                 {-# LINE 3256 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule405 #-}
   {-# LINE 106 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule405 = \ _commonExtra ((_nontsIdatas) :: PP_Doc) ->
                 {-# LINE 106 "src-ag/ExecutionPlan2Caml.ag" #-}
                 _nontsIdatas >-< _commonExtra
                 {-# LINE 3262 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule406 #-}
   {-# LINE 112 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule406 = \ wrappers_ ->
                     {-# LINE 112 "src-ag/ExecutionPlan2Caml.ag" #-}
                     wrappers_
                     {-# LINE 3268 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule407 #-}
   {-# LINE 173 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule407 = \ typeSyns_ ->
                     {-# LINE 173 "src-ag/ExecutionPlan2Caml.ag" #-}
                     typeSyns_
                     {-# LINE 3274 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule408 #-}
   {-# LINE 663 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule408 = \ _lateSemBndDef ((_lhsIoptions) :: Options) ->
                        {-# LINE 663 "src-ag/ExecutionPlan2Caml.ag" #-}
                        if lateHigherOrderBinding _lhsIoptions
                        then _lateSemBndDef
                        else empty
                        {-# LINE 3282 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule409 #-}
   {-# LINE 666 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule409 = \ _lateSemBndTp ((_lhsIoptions) :: Options) ->
                        {-# LINE 666 "src-ag/ExecutionPlan2Caml.ag" #-}
                        if lateHigherOrderBinding _lhsIoptions
                        then _lateSemBndTp
                        else empty
                        {-# LINE 3290 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule410 #-}
   {-# LINE 669 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule410 = \ ((_lhsImainName) :: String) ((_nontsIsemFunBndTps) :: Seq PP_Doc) ->
                       {-# LINE 669 "src-ag/ExecutionPlan2Caml.ag" #-}
                       "and" >#< lateBindingTypeNm _lhsImainName >#< "=" >#< ppRecordTp (toList _nontsIsemFunBndTps)
                       {-# LINE 3296 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule411 #-}
   {-# LINE 670 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule411 = \ ((_lhsImainName) :: String) ((_nontsIsemFunBndDefs) :: Seq PP_Doc) ->
                        {-# LINE 670 "src-ag/ExecutionPlan2Caml.ag" #-}
                        "and" >#< lateBindingFieldNm _lhsImainName >#< ":" >#< lateBindingTypeNm _lhsImainName >#< "="
                        >-< (indent 2 $ ppRecordVal $ toList _nontsIsemFunBndDefs)
                        {-# LINE 3303 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule412 #-}
   {-# LINE 1157 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule412 = \ ((_nontsIchildvisit) :: Map VisitIdentifier (Identifier -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)) ->
                                          {-# LINE 1157 "src-ag/ExecutionPlan2Caml.ag" #-}
                                          _nontsIchildvisit
                                          {-# LINE 3309 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule413 #-}
   {-# LINE 1315 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule413 = \ ((_nontsIvisitdefs) :: Map VisitIdentifier (Set Identifier)) ->
                                       {-# LINE 1315 "src-ag/ExecutionPlan2Caml.ag" #-}
                                       _nontsIvisitdefs
                                       {-# LINE 3315 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule414 #-}
   {-# LINE 1316 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule414 = \ ((_nontsIvisituses) :: Map VisitIdentifier (Set Identifier)) ->
                                       {-# LINE 1316 "src-ag/ExecutionPlan2Caml.ag" #-}
                                       _nontsIvisituses
                                       {-# LINE 3321 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule415 #-}
   {-# LINE 1407 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule415 = \ ((_nontsIfromToStates) :: Map VisitIdentifier (Int,Int)) ->
                            {-# LINE 1407 "src-ag/ExecutionPlan2Caml.ag" #-}
                            _nontsIfromToStates
                            {-# LINE 3327 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule416 #-}
   {-# LINE 1451 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule416 = \ ((_nontsIvisitKinds) :: Map VisitIdentifier VisitKind) ->
                          {-# LINE 1451 "src-ag/ExecutionPlan2Caml.ag" #-}
                          _nontsIvisitKinds
                          {-# LINE 3333 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule417 #-}
   {-# LINE 1465 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule417 = \ ((_nontsIinitStates) :: Map NontermIdent Int) ->
                          {-# LINE 1465 "src-ag/ExecutionPlan2Caml.ag" #-}
                          _nontsIinitStates
                          {-# LINE 3339 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule418 #-}
   rule418 = \ ((_nontsIerrors) :: Seq Error) ->
     _nontsIerrors
   {-# INLINE rule419 #-}
   rule419 = \ ((_nontsImodules) :: PP_Doc) ->
     _nontsImodules
   {-# INLINE rule420 #-}
   rule420 = \ ((_lhsIinhmap) :: Map NontermIdent Attributes) ->
     _lhsIinhmap
   {-# INLINE rule421 #-}
   rule421 = \ ((_lhsIlocalAttrTypes) :: Map NontermIdent (Map ConstructorIdent (Map Identifier Type))) ->
     _lhsIlocalAttrTypes
   {-# INLINE rule422 #-}
   rule422 = \ ((_lhsImainFile) :: String) ->
     _lhsImainFile
   {-# INLINE rule423 #-}
   rule423 = \ ((_lhsImainName) :: String) ->
     _lhsImainName
   {-# INLINE rule424 #-}
   rule424 = \ ((_lhsIoptions) :: Options) ->
     _lhsIoptions
   {-# INLINE rule425 #-}
   rule425 = \ ((_lhsIsynmap) :: Map NontermIdent Attributes) ->
     _lhsIsynmap

-- Expression --------------------------------------------------
-- wrapper
data Inh_Expression  = Inh_Expression { Inh_Expression -> Options
options_Inh_Expression :: (Options) }
data Syn_Expression  = Syn_Expression { Syn_Expression -> Map String (Maybe NonLocalAttr)
attrs_Syn_Expression :: (Map String (Maybe NonLocalAttr)), Syn_Expression -> Pos
pos_Syn_Expression :: (Pos), Syn_Expression -> PP_Doc
semfunc_Syn_Expression :: (PP_Doc), Syn_Expression -> [HsToken]
tks_Syn_Expression :: ([HsToken]) }
{-# INLINABLE wrap_Expression #-}
wrap_Expression :: T_Expression  -> Inh_Expression  -> (Syn_Expression )
wrap_Expression :: T_Expression -> Inh_Expression -> Syn_Expression
wrap_Expression (T_Expression Identity T_Expression_s29
act) (Inh_Expression Options
_lhsIoptions) =
   forall a. Identity a -> a
Control.Monad.Identity.runIdentity (
     do T_Expression_s29
sem <- Identity T_Expression_s29
act
        let arg28 :: T_Expression_vIn28
arg28 = Options -> T_Expression_vIn28
T_Expression_vIn28 Options
_lhsIoptions
        (T_Expression_vOut28 Map String (Maybe NonLocalAttr)
_lhsOattrs Pos
_lhsOpos PP_Doc
_lhsOsemfunc [HsToken]
_lhsOtks) <- forall (m :: * -> *) a. Monad m => a -> m a
return (T_Expression_s29 -> T_Expression_v28
inv_Expression_s29 T_Expression_s29
sem T_Expression_vIn28
arg28)
        forall (m :: * -> *) a. Monad m => a -> m a
return (Map String (Maybe NonLocalAttr)
-> Pos -> PP_Doc -> [HsToken] -> Syn_Expression
Syn_Expression Map String (Maybe NonLocalAttr)
_lhsOattrs Pos
_lhsOpos PP_Doc
_lhsOsemfunc [HsToken]
_lhsOtks)
   )

-- cata
{-# INLINE sem_Expression #-}
sem_Expression :: Expression  -> T_Expression 
sem_Expression :: Expression -> T_Expression
sem_Expression ( Expression Pos
pos_ [HsToken]
tks_ ) = Pos -> [HsToken] -> T_Expression
sem_Expression_Expression Pos
pos_ [HsToken]
tks_

-- semantic domain
newtype T_Expression  = T_Expression {
                                     T_Expression -> Identity T_Expression_s29
attach_T_Expression :: Identity (T_Expression_s29 )
                                     }
newtype T_Expression_s29  = C_Expression_s29 {
                                             T_Expression_s29 -> T_Expression_v28
inv_Expression_s29 :: (T_Expression_v28 )
                                             }
data T_Expression_s30  = C_Expression_s30
type T_Expression_v28  = (T_Expression_vIn28 ) -> (T_Expression_vOut28 )
data T_Expression_vIn28  = T_Expression_vIn28 (Options)
data T_Expression_vOut28  = T_Expression_vOut28 (Map String (Maybe NonLocalAttr)) (Pos) (PP_Doc) ([HsToken])
{-# NOINLINE sem_Expression_Expression #-}
sem_Expression_Expression :: (Pos) -> ([HsToken]) -> T_Expression 
sem_Expression_Expression :: Pos -> [HsToken] -> T_Expression
sem_Expression_Expression Pos
arg_pos_ [HsToken]
arg_tks_ = Identity T_Expression_s29 -> T_Expression
T_Expression (forall (m :: * -> *) a. Monad m => a -> m a
return T_Expression_s29
st29) where
   {-# NOINLINE st29 #-}
   st29 :: T_Expression_s29
st29 = let
      v28 :: T_Expression_v28 
      v28 :: T_Expression_v28
v28 = \ (T_Expression_vIn28 Options
_lhsIoptions) -> ( let
         _lhsOtks :: [HsToken]
         _lhsOtks :: [HsToken]
_lhsOtks = forall a. a -> a
rule426 [HsToken]
arg_tks_
         _lhsOpos :: Pos
         _lhsOpos :: Pos
_lhsOpos = forall a. a -> a
rule427 Pos
arg_pos_
         _lhsOattrs :: Map String (Maybe NonLocalAttr)
         _lhsOattrs :: Map String (Maybe NonLocalAttr)
_lhsOattrs = Inh_HsToken -> [HsToken] -> Map String (Maybe NonLocalAttr)
rule428 Inh_HsToken
_inhhstoken [HsToken]
arg_tks_
         _lhsOsemfunc :: PP_Doc
         _lhsOsemfunc :: PP_Doc
_lhsOsemfunc = Inh_HsToken -> [HsToken] -> PP_Doc
rule429 Inh_HsToken
_inhhstoken [HsToken]
arg_tks_
         _inhhstoken :: Inh_HsToken
_inhhstoken = Options -> Inh_HsToken
rule430 Options
_lhsIoptions
         __result_ :: T_Expression_vOut28
__result_ = Map String (Maybe NonLocalAttr)
-> Pos -> PP_Doc -> [HsToken] -> T_Expression_vOut28
T_Expression_vOut28 Map String (Maybe NonLocalAttr)
_lhsOattrs Pos
_lhsOpos PP_Doc
_lhsOsemfunc [HsToken]
_lhsOtks
         in T_Expression_vOut28
__result_ )
     in T_Expression_v28 -> T_Expression_s29
C_Expression_s29 T_Expression_v28
v28
   {-# INLINE rule426 #-}
   {-# LINE 1028 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule426 = \ tks_ ->
                           {-# LINE 1028 "src-ag/ExecutionPlan2Caml.ag" #-}
                           tks_
                           {-# LINE 3419 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule427 #-}
   {-# LINE 1049 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule427 = \ pos_ ->
                                        {-# LINE 1049 "src-ag/ExecutionPlan2Caml.ag" #-}
                                        pos_
                                        {-# LINE 3425 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule428 #-}
   {-# LINE 1141 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule428 = \ _inhhstoken tks_ ->
                               {-# LINE 1141 "src-ag/ExecutionPlan2Caml.ag" #-}
                               Map.unions $ map (\tok -> attrs_Syn_HsToken (wrap_HsToken (sem_HsToken tok) _inhhstoken    )) tks_
                               {-# LINE 3431 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule429 #-}
   {-# LINE 1142 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule429 = \ _inhhstoken tks_ ->
                               {-# LINE 1142 "src-ag/ExecutionPlan2Caml.ag" #-}
                               vlist $ showTokens $ map (\tok -> tok_Syn_HsToken (wrap_HsToken (sem_HsToken tok) _inhhstoken    )) tks_
                               {-# LINE 3437 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule430 #-}
   {-# LINE 1143 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule430 = \ ((_lhsIoptions) :: Options) ->
                                  {-# LINE 1143 "src-ag/ExecutionPlan2Caml.ag" #-}
                                  Inh_HsToken _lhsIoptions
                                  {-# LINE 3443 "src-generated/ExecutionPlan2Caml.hs" #-}

-- HsToken -----------------------------------------------------
-- wrapper
data Inh_HsToken  = Inh_HsToken { Inh_HsToken -> Options
options_Inh_HsToken :: (Options) }
data Syn_HsToken  = Syn_HsToken { Syn_HsToken -> Map String (Maybe NonLocalAttr)
attrs_Syn_HsToken :: (Map String (Maybe NonLocalAttr)), Syn_HsToken -> (Pos, String)
tok_Syn_HsToken :: ((Pos,String)) }
{-# INLINABLE wrap_HsToken #-}
wrap_HsToken :: T_HsToken  -> Inh_HsToken  -> (Syn_HsToken )
wrap_HsToken :: T_HsToken -> Inh_HsToken -> Syn_HsToken
wrap_HsToken (T_HsToken Identity T_HsToken_s32
act) (Inh_HsToken Options
_lhsIoptions) =
   forall a. Identity a -> a
Control.Monad.Identity.runIdentity (
     do T_HsToken_s32
sem <- Identity T_HsToken_s32
act
        let arg31 :: T_HsToken_vIn31
arg31 = Options -> T_HsToken_vIn31
T_HsToken_vIn31 Options
_lhsIoptions
        (T_HsToken_vOut31 Map String (Maybe NonLocalAttr)
_lhsOattrs (Pos, String)
_lhsOtok) <- forall (m :: * -> *) a. Monad m => a -> m a
return (T_HsToken_s32 -> T_HsToken_v31
inv_HsToken_s32 T_HsToken_s32
sem T_HsToken_vIn31
arg31)
        forall (m :: * -> *) a. Monad m => a -> m a
return (Map String (Maybe NonLocalAttr) -> (Pos, String) -> Syn_HsToken
Syn_HsToken Map String (Maybe NonLocalAttr)
_lhsOattrs (Pos, String)
_lhsOtok)
   )

-- cata
{-# NOINLINE sem_HsToken #-}
sem_HsToken :: HsToken  -> T_HsToken 
sem_HsToken :: HsToken -> T_HsToken
sem_HsToken ( AGLocal NontermIdent
var_ Pos
pos_ Maybe String
rdesc_ ) = NontermIdent -> Pos -> Maybe String -> T_HsToken
sem_HsToken_AGLocal NontermIdent
var_ Pos
pos_ Maybe String
rdesc_
sem_HsToken ( AGField NontermIdent
field_ NontermIdent
attr_ Pos
pos_ Maybe String
rdesc_ ) = NontermIdent -> NontermIdent -> Pos -> Maybe String -> T_HsToken
sem_HsToken_AGField NontermIdent
field_ NontermIdent
attr_ Pos
pos_ Maybe String
rdesc_
sem_HsToken ( HsToken String
value_ Pos
pos_ ) = String -> Pos -> T_HsToken
sem_HsToken_HsToken String
value_ Pos
pos_
sem_HsToken ( CharToken String
value_ Pos
pos_ ) = String -> Pos -> T_HsToken
sem_HsToken_CharToken String
value_ Pos
pos_
sem_HsToken ( StrToken String
value_ Pos
pos_ ) = String -> Pos -> T_HsToken
sem_HsToken_StrToken String
value_ Pos
pos_
sem_HsToken ( Err String
mesg_ Pos
pos_ ) = String -> Pos -> T_HsToken
sem_HsToken_Err String
mesg_ Pos
pos_

-- semantic domain
newtype T_HsToken  = T_HsToken {
                               T_HsToken -> Identity T_HsToken_s32
attach_T_HsToken :: Identity (T_HsToken_s32 )
                               }
newtype T_HsToken_s32  = C_HsToken_s32 {
                                       T_HsToken_s32 -> T_HsToken_v31
inv_HsToken_s32 :: (T_HsToken_v31 )
                                       }
data T_HsToken_s33  = C_HsToken_s33
type T_HsToken_v31  = (T_HsToken_vIn31 ) -> (T_HsToken_vOut31 )
data T_HsToken_vIn31  = T_HsToken_vIn31 (Options)
data T_HsToken_vOut31  = T_HsToken_vOut31 (Map String (Maybe NonLocalAttr)) ((Pos,String))
{-# NOINLINE sem_HsToken_AGLocal #-}
sem_HsToken_AGLocal :: (Identifier) -> (Pos) -> (Maybe String) -> T_HsToken 
sem_HsToken_AGLocal :: NontermIdent -> Pos -> Maybe String -> T_HsToken
sem_HsToken_AGLocal NontermIdent
arg_var_ Pos
arg_pos_ Maybe String
_ = Identity T_HsToken_s32 -> T_HsToken
T_HsToken (forall (m :: * -> *) a. Monad m => a -> m a
return T_HsToken_s32
st32) where
   {-# NOINLINE st32 #-}
   st32 :: T_HsToken_s32
st32 = let
      v31 :: T_HsToken_v31 
      v31 :: T_HsToken_v31
v31 = \ (T_HsToken_vIn31 Options
_lhsIoptions) -> ( let
         _lhsOattrs :: Map String (Maybe NonLocalAttr)
         _lhsOattrs :: Map String (Maybe NonLocalAttr)
_lhsOattrs = forall {a}. NontermIdent -> Map String (Maybe a)
rule431 NontermIdent
arg_var_
         _tok :: (Pos, String)
_tok = forall {a}. a -> NontermIdent -> (a, String)
rule432 Pos
arg_pos_ NontermIdent
arg_var_
         _lhsOtok :: (Pos,String)
         _lhsOtok :: (Pos, String)
_lhsOtok = forall a. a -> a
rule433 (Pos, String)
_tok
         __result_ :: T_HsToken_vOut31
__result_ = Map String (Maybe NonLocalAttr)
-> (Pos, String) -> T_HsToken_vOut31
T_HsToken_vOut31 Map String (Maybe NonLocalAttr)
_lhsOattrs (Pos, String)
_lhsOtok
         in T_HsToken_vOut31
__result_ )
     in T_HsToken_v31 -> T_HsToken_s32
C_HsToken_s32 T_HsToken_v31
v31
   {-# INLINE rule431 #-}
   {-# LINE 1100 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule431 = \ var_ ->
                              {-# LINE 1100 "src-ag/ExecutionPlan2Caml.ag" #-}
                              Map.singleton (fieldname var_) Nothing
                              {-# LINE 3500 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule432 #-}
   {-# LINE 1363 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule432 = \ pos_ var_ ->
                          {-# LINE 1363 "src-ag/ExecutionPlan2Caml.ag" #-}
                          (pos_,fieldname var_)
                          {-# LINE 3506 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule433 #-}
   rule433 = \ _tok ->
     _tok
{-# NOINLINE sem_HsToken_AGField #-}
sem_HsToken_AGField :: (Identifier) -> (Identifier) -> (Pos) -> (Maybe String) -> T_HsToken 
sem_HsToken_AGField :: NontermIdent -> NontermIdent -> Pos -> Maybe String -> T_HsToken
sem_HsToken_AGField NontermIdent
arg_field_ NontermIdent
arg_attr_ Pos
arg_pos_ Maybe String
arg_rdesc_ = Identity T_HsToken_s32 -> T_HsToken
T_HsToken (forall (m :: * -> *) a. Monad m => a -> m a
return T_HsToken_s32
st32) where
   {-# NOINLINE st32 #-}
   st32 :: T_HsToken_s32
st32 = let
      v31 :: T_HsToken_v31 
      v31 :: T_HsToken_v31
v31 = \ (T_HsToken_vIn31 Options
_lhsIoptions) -> ( let
         _mbAttr :: Maybe NonLocalAttr
_mbAttr = NontermIdent -> NontermIdent -> Maybe NonLocalAttr
rule434 NontermIdent
arg_attr_ NontermIdent
arg_field_
         _lhsOattrs :: Map String (Maybe NonLocalAttr)
         _lhsOattrs :: Map String (Maybe NonLocalAttr)
_lhsOattrs = forall {a}.
Options -> a -> NontermIdent -> NontermIdent -> Map String a
rule435 Options
_lhsIoptions Maybe NonLocalAttr
_mbAttr NontermIdent
arg_attr_ NontermIdent
arg_field_
         _addTrace :: String -> String
_addTrace = NontermIdent -> NontermIdent -> Maybe String -> String -> String
rule436 NontermIdent
arg_attr_ NontermIdent
arg_field_ Maybe String
arg_rdesc_
         _lhsOtok :: (Pos,String)
         _lhsOtok :: (Pos, String)
_lhsOtok = forall {b} {a}.
(String -> b)
-> Options -> NontermIdent -> NontermIdent -> a -> (a, b)
rule437 String -> String
_addTrace Options
_lhsIoptions NontermIdent
arg_attr_ NontermIdent
arg_field_ Pos
arg_pos_
         __result_ :: T_HsToken_vOut31
__result_ = Map String (Maybe NonLocalAttr)
-> (Pos, String) -> T_HsToken_vOut31
T_HsToken_vOut31 Map String (Maybe NonLocalAttr)
_lhsOattrs (Pos, String)
_lhsOtok
         in T_HsToken_vOut31
__result_ )
     in T_HsToken_v31 -> T_HsToken_s32
C_HsToken_s32 T_HsToken_v31
v31
   {-# INLINE rule434 #-}
   {-# LINE 1101 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule434 = \ attr_ field_ ->
                              {-# LINE 1101 "src-ag/ExecutionPlan2Caml.ag" #-}
                              if field_ == _INST || field_ == _FIELD || field_ == _INST'
                              then Nothing
                              else Just $ mkNonLocalAttr (field_ == _LHS) field_ attr_
                              {-# LINE 3533 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule435 #-}
   {-# LINE 1104 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule435 = \ ((_lhsIoptions) :: Options) _mbAttr attr_ field_ ->
                              {-# LINE 1104 "src-ag/ExecutionPlan2Caml.ag" #-}
                              Map.singleton (attrname _lhsIoptions True field_ attr_) _mbAttr
                              {-# LINE 3539 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule436 #-}
   {-# LINE 1367 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule436 = \ attr_ field_ rdesc_ ->
                        {-# LINE 1367 "src-ag/ExecutionPlan2Caml.ag" #-}
                        case rdesc_ of
                          Just d  -> \x -> "(prerr_endline " ++ show (d ++ " -> " ++ show field_ ++ "." ++ show attr_) ++ "; " ++ x ++ ")"
                          Nothing -> id
                        {-# LINE 3547 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule437 #-}
   {-# LINE 1370 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule437 = \ _addTrace ((_lhsIoptions) :: Options) attr_ field_ pos_ ->
                   {-# LINE 1370 "src-ag/ExecutionPlan2Caml.ag" #-}
                   (pos_, _addTrace     $ attrname _lhsIoptions True field_ attr_)
                   {-# LINE 3553 "src-generated/ExecutionPlan2Caml.hs" #-}
{-# NOINLINE sem_HsToken_HsToken #-}
sem_HsToken_HsToken :: (String) -> (Pos) -> T_HsToken 
sem_HsToken_HsToken :: String -> Pos -> T_HsToken
sem_HsToken_HsToken String
arg_value_ Pos
arg_pos_ = Identity T_HsToken_s32 -> T_HsToken
T_HsToken (forall (m :: * -> *) a. Monad m => a -> m a
return T_HsToken_s32
st32) where
   {-# NOINLINE st32 #-}
   st32 :: T_HsToken_s32
st32 = let
      v31 :: T_HsToken_v31 
      v31 :: T_HsToken_v31
v31 = \ (T_HsToken_vIn31 Options
_lhsIoptions) -> ( let
         _lhsOtok :: (Pos,String)
         _lhsOtok :: (Pos, String)
_lhsOtok = forall {a} {b}. a -> b -> (a, b)
rule438 Pos
arg_pos_ String
arg_value_
         _lhsOattrs :: Map String (Maybe NonLocalAttr)
         _lhsOattrs :: Map String (Maybe NonLocalAttr)
_lhsOattrs = forall {k} {a}. () -> Map k a
rule439  ()
         __result_ :: T_HsToken_vOut31
__result_ = Map String (Maybe NonLocalAttr)
-> (Pos, String) -> T_HsToken_vOut31
T_HsToken_vOut31 Map String (Maybe NonLocalAttr)
_lhsOattrs (Pos, String)
_lhsOtok
         in T_HsToken_vOut31
__result_ )
     in T_HsToken_v31 -> T_HsToken_s32
C_HsToken_s32 T_HsToken_v31
v31
   {-# INLINE rule438 #-}
   {-# LINE 1372 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule438 = \ pos_ value_ ->
                         {-# LINE 1372 "src-ag/ExecutionPlan2Caml.ag" #-}
                         (pos_, value_)
                         {-# LINE 3573 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule439 #-}
   rule439 = \  (_ :: ()) ->
     Map.empty
{-# NOINLINE sem_HsToken_CharToken #-}
sem_HsToken_CharToken :: (String) -> (Pos) -> T_HsToken 
sem_HsToken_CharToken :: String -> Pos -> T_HsToken
sem_HsToken_CharToken String
arg_value_ Pos
arg_pos_ = Identity T_HsToken_s32 -> T_HsToken
T_HsToken (forall (m :: * -> *) a. Monad m => a -> m a
return T_HsToken_s32
st32) where
   {-# NOINLINE st32 #-}
   st32 :: T_HsToken_s32
st32 = let
      v31 :: T_HsToken_v31 
      v31 :: T_HsToken_v31
v31 = \ (T_HsToken_vIn31 Options
_lhsIoptions) -> ( let
         _lhsOtok :: (Pos,String)
         _lhsOtok :: (Pos, String)
_lhsOtok = forall {a}. a -> String -> (a, String)
rule440 Pos
arg_pos_ String
arg_value_
         _lhsOattrs :: Map String (Maybe NonLocalAttr)
         _lhsOattrs :: Map String (Maybe NonLocalAttr)
_lhsOattrs = forall {k} {a}. () -> Map k a
rule441  ()
         __result_ :: T_HsToken_vOut31
__result_ = Map String (Maybe NonLocalAttr)
-> (Pos, String) -> T_HsToken_vOut31
T_HsToken_vOut31 Map String (Maybe NonLocalAttr)
_lhsOattrs (Pos, String)
_lhsOtok
         in T_HsToken_vOut31
__result_ )
     in T_HsToken_v31 -> T_HsToken_s32
C_HsToken_s32 T_HsToken_v31
v31
   {-# INLINE rule440 #-}
   {-# LINE 1374 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule440 = \ pos_ value_ ->
                           {-# LINE 1374 "src-ag/ExecutionPlan2Caml.ag" #-}
                           (pos_, if null value_
                                     then ""
                                     else showCharShort (head value_)
                           )
                           {-# LINE 3599 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule441 #-}
   rule441 = \  (_ :: ()) ->
     Map.empty
{-# NOINLINE sem_HsToken_StrToken #-}
sem_HsToken_StrToken :: (String) -> (Pos) -> T_HsToken 
sem_HsToken_StrToken :: String -> Pos -> T_HsToken
sem_HsToken_StrToken String
arg_value_ Pos
arg_pos_ = Identity T_HsToken_s32 -> T_HsToken
T_HsToken (forall (m :: * -> *) a. Monad m => a -> m a
return T_HsToken_s32
st32) where
   {-# NOINLINE st32 #-}
   st32 :: T_HsToken_s32
st32 = let
      v31 :: T_HsToken_v31 
      v31 :: T_HsToken_v31
v31 = \ (T_HsToken_vIn31 Options
_lhsIoptions) -> ( let
         _lhsOtok :: (Pos,String)
         _lhsOtok :: (Pos, String)
_lhsOtok = forall {a}. a -> String -> (a, String)
rule442 Pos
arg_pos_ String
arg_value_
         _lhsOattrs :: Map String (Maybe NonLocalAttr)
         _lhsOattrs :: Map String (Maybe NonLocalAttr)
_lhsOattrs = forall {k} {a}. () -> Map k a
rule443  ()
         __result_ :: T_HsToken_vOut31
__result_ = Map String (Maybe NonLocalAttr)
-> (Pos, String) -> T_HsToken_vOut31
T_HsToken_vOut31 Map String (Maybe NonLocalAttr)
_lhsOattrs (Pos, String)
_lhsOtok
         in T_HsToken_vOut31
__result_ )
     in T_HsToken_v31 -> T_HsToken_s32
C_HsToken_s32 T_HsToken_v31
v31
   {-# INLINE rule442 #-}
   {-# LINE 1379 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule442 = \ pos_ value_ ->
                           {-# LINE 1379 "src-ag/ExecutionPlan2Caml.ag" #-}
                           (pos_, showStrShort value_)
                           {-# LINE 3622 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule443 #-}
   rule443 = \  (_ :: ()) ->
     Map.empty
{-# NOINLINE sem_HsToken_Err #-}
sem_HsToken_Err :: (String) -> (Pos) -> T_HsToken 
sem_HsToken_Err :: String -> Pos -> T_HsToken
sem_HsToken_Err String
_ Pos
arg_pos_ = Identity T_HsToken_s32 -> T_HsToken
T_HsToken (forall (m :: * -> *) a. Monad m => a -> m a
return T_HsToken_s32
st32) where
   {-# NOINLINE st32 #-}
   st32 :: T_HsToken_s32
st32 = let
      v31 :: T_HsToken_v31 
      v31 :: T_HsToken_v31
v31 = \ (T_HsToken_vIn31 Options
_lhsIoptions) -> ( let
         _lhsOtok :: (Pos,String)
         _lhsOtok :: (Pos, String)
_lhsOtok = forall {a}. a -> (a, String)
rule444 Pos
arg_pos_
         _lhsOattrs :: Map String (Maybe NonLocalAttr)
         _lhsOattrs :: Map String (Maybe NonLocalAttr)
_lhsOattrs = forall {k} {a}. () -> Map k a
rule445  ()
         __result_ :: T_HsToken_vOut31
__result_ = Map String (Maybe NonLocalAttr)
-> (Pos, String) -> T_HsToken_vOut31
T_HsToken_vOut31 Map String (Maybe NonLocalAttr)
_lhsOattrs (Pos, String)
_lhsOtok
         in T_HsToken_vOut31
__result_ )
     in T_HsToken_v31 -> T_HsToken_s32
C_HsToken_s32 T_HsToken_v31
v31
   {-# INLINE rule444 #-}
   {-# LINE 1380 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule444 = \ pos_ ->
                           {-# LINE 1380 "src-ag/ExecutionPlan2Caml.ag" #-}
                           (pos_, "")
                           {-# LINE 3645 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule445 #-}
   rule445 = \  (_ :: ()) ->
     Map.empty

-- HsTokens ----------------------------------------------------
-- wrapper
data Inh_HsTokens  = Inh_HsTokens { Inh_HsTokens -> Options
options_Inh_HsTokens :: (Options) }
data Syn_HsTokens  = Syn_HsTokens { Syn_HsTokens -> [(Pos, String)]
tks_Syn_HsTokens :: ([(Pos,String)]) }
{-# INLINABLE wrap_HsTokens #-}
wrap_HsTokens :: T_HsTokens  -> Inh_HsTokens  -> (Syn_HsTokens )
wrap_HsTokens :: T_HsTokens -> Inh_HsTokens -> Syn_HsTokens
wrap_HsTokens (T_HsTokens Identity T_HsTokens_s35
act) (Inh_HsTokens Options
_lhsIoptions) =
   forall a. Identity a -> a
Control.Monad.Identity.runIdentity (
     do T_HsTokens_s35
sem <- Identity T_HsTokens_s35
act
        let arg34 :: T_HsTokens_vIn34
arg34 = Options -> T_HsTokens_vIn34
T_HsTokens_vIn34 Options
_lhsIoptions
        (T_HsTokens_vOut34 [(Pos, String)]
_lhsOtks) <- forall (m :: * -> *) a. Monad m => a -> m a
return (T_HsTokens_s35 -> T_HsTokens_v34
inv_HsTokens_s35 T_HsTokens_s35
sem T_HsTokens_vIn34
arg34)
        forall (m :: * -> *) a. Monad m => a -> m a
return ([(Pos, String)] -> Syn_HsTokens
Syn_HsTokens [(Pos, String)]
_lhsOtks)
   )

-- cata
{-# NOINLINE sem_HsTokens #-}
sem_HsTokens :: HsTokens  -> T_HsTokens 
sem_HsTokens :: [HsToken] -> T_HsTokens
sem_HsTokens [HsToken]
list = forall (t :: * -> *) a b.
Foldable t =>
(a -> b -> b) -> b -> t a -> b
Prelude.foldr T_HsToken -> T_HsTokens -> T_HsTokens
sem_HsTokens_Cons T_HsTokens
sem_HsTokens_Nil (forall a b. (a -> b) -> [a] -> [b]
Prelude.map HsToken -> T_HsToken
sem_HsToken [HsToken]
list)

-- semantic domain
newtype T_HsTokens  = T_HsTokens {
                                 T_HsTokens -> Identity T_HsTokens_s35
attach_T_HsTokens :: Identity (T_HsTokens_s35 )
                                 }
newtype T_HsTokens_s35  = C_HsTokens_s35 {
                                         T_HsTokens_s35 -> T_HsTokens_v34
inv_HsTokens_s35 :: (T_HsTokens_v34 )
                                         }
data T_HsTokens_s36  = C_HsTokens_s36
type T_HsTokens_v34  = (T_HsTokens_vIn34 ) -> (T_HsTokens_vOut34 )
data T_HsTokens_vIn34  = T_HsTokens_vIn34 (Options)
data T_HsTokens_vOut34  = T_HsTokens_vOut34 ([(Pos,String)])
{-# NOINLINE sem_HsTokens_Cons #-}
sem_HsTokens_Cons :: T_HsToken  -> T_HsTokens  -> T_HsTokens 
sem_HsTokens_Cons :: T_HsToken -> T_HsTokens -> T_HsTokens
sem_HsTokens_Cons T_HsToken
arg_hd_ T_HsTokens
arg_tl_ = Identity T_HsTokens_s35 -> T_HsTokens
T_HsTokens (forall (m :: * -> *) a. Monad m => a -> m a
return T_HsTokens_s35
st35) where
   {-# NOINLINE st35 #-}
   st35 :: T_HsTokens_s35
st35 = let
      v34 :: T_HsTokens_v34 
      v34 :: T_HsTokens_v34
v34 = \ (T_HsTokens_vIn34 Options
_lhsIoptions) -> ( let
         _hdX32 :: T_HsToken_s32
_hdX32 = forall a. Identity a -> a
Control.Monad.Identity.runIdentity (T_HsToken -> Identity T_HsToken_s32
attach_T_HsToken (T_HsToken
arg_hd_))
         _tlX35 :: T_HsTokens_s35
_tlX35 = forall a. Identity a -> a
Control.Monad.Identity.runIdentity (T_HsTokens -> Identity T_HsTokens_s35
attach_T_HsTokens (T_HsTokens
arg_tl_))
         (T_HsToken_vOut31 Map String (Maybe NonLocalAttr)
_hdIattrs (Pos, String)
_hdItok) = T_HsToken_s32 -> T_HsToken_v31
inv_HsToken_s32 T_HsToken_s32
_hdX32 (Options -> T_HsToken_vIn31
T_HsToken_vIn31 Options
_hdOoptions)
         (T_HsTokens_vOut34 [(Pos, String)]
_tlItks) = T_HsTokens_s35 -> T_HsTokens_v34
inv_HsTokens_s35 T_HsTokens_s35
_tlX35 (Options -> T_HsTokens_vIn34
T_HsTokens_vIn34 Options
_tlOoptions)
         _lhsOtks :: [(Pos,String)]
         _lhsOtks :: [(Pos, String)]
_lhsOtks = (Pos, String) -> [(Pos, String)] -> [(Pos, String)]
rule446 (Pos, String)
_hdItok [(Pos, String)]
_tlItks
         _hdOoptions :: Options
_hdOoptions = Options -> Options
rule447 Options
_lhsIoptions
         _tlOoptions :: Options
_tlOoptions = Options -> Options
rule448 Options
_lhsIoptions
         __result_ :: T_HsTokens_vOut34
__result_ = [(Pos, String)] -> T_HsTokens_vOut34
T_HsTokens_vOut34 [(Pos, String)]
_lhsOtks
         in T_HsTokens_vOut34
__result_ )
     in T_HsTokens_v34 -> T_HsTokens_s35
C_HsTokens_s35 T_HsTokens_v34
v34
   {-# INLINE rule446 #-}
   {-# LINE 1359 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule446 = \ ((_hdItok) :: (Pos,String)) ((_tlItks) :: [(Pos,String)]) ->
                     {-# LINE 1359 "src-ag/ExecutionPlan2Caml.ag" #-}
                     _hdItok : _tlItks
                     {-# LINE 3703 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule447 #-}
   rule447 = \ ((_lhsIoptions) :: Options) ->
     _lhsIoptions
   {-# INLINE rule448 #-}
   rule448 = \ ((_lhsIoptions) :: Options) ->
     _lhsIoptions
{-# NOINLINE sem_HsTokens_Nil #-}
sem_HsTokens_Nil ::  T_HsTokens 
sem_HsTokens_Nil :: T_HsTokens
sem_HsTokens_Nil  = Identity T_HsTokens_s35 -> T_HsTokens
T_HsTokens (forall (m :: * -> *) a. Monad m => a -> m a
return T_HsTokens_s35
st35) where
   {-# NOINLINE st35 #-}
   st35 :: T_HsTokens_s35
st35 = let
      v34 :: T_HsTokens_v34 
      v34 :: T_HsTokens_v34
v34 = \ (T_HsTokens_vIn34 Options
_lhsIoptions) -> ( let
         _lhsOtks :: [(Pos,String)]
         _lhsOtks :: [(Pos, String)]
_lhsOtks = forall {a}. () -> [a]
rule449  ()
         __result_ :: T_HsTokens_vOut34
__result_ = [(Pos, String)] -> T_HsTokens_vOut34
T_HsTokens_vOut34 [(Pos, String)]
_lhsOtks
         in T_HsTokens_vOut34
__result_ )
     in T_HsTokens_v34 -> T_HsTokens_s35
C_HsTokens_s35 T_HsTokens_v34
v34
   {-# INLINE rule449 #-}
   {-# LINE 1360 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule449 = \  (_ :: ()) ->
                     {-# LINE 1360 "src-ag/ExecutionPlan2Caml.ag" #-}
                     []
                     {-# LINE 3727 "src-generated/ExecutionPlan2Caml.hs" #-}

-- HsTokensRoot ------------------------------------------------
-- wrapper
data Inh_HsTokensRoot  = Inh_HsTokensRoot { Inh_HsTokensRoot -> Options
options_Inh_HsTokensRoot :: (Options) }
data Syn_HsTokensRoot  = Syn_HsTokensRoot {  }
{-# INLINABLE wrap_HsTokensRoot #-}
wrap_HsTokensRoot :: T_HsTokensRoot  -> Inh_HsTokensRoot  -> (Syn_HsTokensRoot )
wrap_HsTokensRoot :: T_HsTokensRoot -> Inh_HsTokensRoot -> Syn_HsTokensRoot
wrap_HsTokensRoot (T_HsTokensRoot Identity T_HsTokensRoot_s38
act) (Inh_HsTokensRoot Options
_lhsIoptions) =
   forall a. Identity a -> a
Control.Monad.Identity.runIdentity (
     do T_HsTokensRoot_s38
sem <- Identity T_HsTokensRoot_s38
act
        let arg37 :: T_HsTokensRoot_vIn37
arg37 = Options -> T_HsTokensRoot_vIn37
T_HsTokensRoot_vIn37 Options
_lhsIoptions
        (T_HsTokensRoot_vOut37
T_HsTokensRoot_vOut37 ) <- forall (m :: * -> *) a. Monad m => a -> m a
return (T_HsTokensRoot_s38 -> T_HsTokensRoot_v37
inv_HsTokensRoot_s38 T_HsTokensRoot_s38
sem T_HsTokensRoot_vIn37
arg37)
        forall (m :: * -> *) a. Monad m => a -> m a
return (Syn_HsTokensRoot
Syn_HsTokensRoot )
   )

-- cata
{-# INLINE sem_HsTokensRoot #-}
sem_HsTokensRoot :: HsTokensRoot  -> T_HsTokensRoot 
sem_HsTokensRoot :: HsTokensRoot -> T_HsTokensRoot
sem_HsTokensRoot ( HsTokensRoot [HsToken]
tokens_ ) = T_HsTokens -> T_HsTokensRoot
sem_HsTokensRoot_HsTokensRoot ( [HsToken] -> T_HsTokens
sem_HsTokens [HsToken]
tokens_ )

-- semantic domain
newtype T_HsTokensRoot  = T_HsTokensRoot {
                                         T_HsTokensRoot -> Identity T_HsTokensRoot_s38
attach_T_HsTokensRoot :: Identity (T_HsTokensRoot_s38 )
                                         }
newtype T_HsTokensRoot_s38  = C_HsTokensRoot_s38 {
                                                 T_HsTokensRoot_s38 -> T_HsTokensRoot_v37
inv_HsTokensRoot_s38 :: (T_HsTokensRoot_v37 )
                                                 }
data T_HsTokensRoot_s39  = C_HsTokensRoot_s39
type T_HsTokensRoot_v37  = (T_HsTokensRoot_vIn37 ) -> (T_HsTokensRoot_vOut37 )
data T_HsTokensRoot_vIn37  = T_HsTokensRoot_vIn37 (Options)
data T_HsTokensRoot_vOut37  = T_HsTokensRoot_vOut37 
{-# NOINLINE sem_HsTokensRoot_HsTokensRoot #-}
sem_HsTokensRoot_HsTokensRoot :: T_HsTokens  -> T_HsTokensRoot 
sem_HsTokensRoot_HsTokensRoot :: T_HsTokens -> T_HsTokensRoot
sem_HsTokensRoot_HsTokensRoot T_HsTokens
arg_tokens_ = Identity T_HsTokensRoot_s38 -> T_HsTokensRoot
T_HsTokensRoot (forall (m :: * -> *) a. Monad m => a -> m a
return T_HsTokensRoot_s38
st38) where
   {-# NOINLINE st38 #-}
   st38 :: T_HsTokensRoot_s38
st38 = let
      v37 :: T_HsTokensRoot_v37 
      v37 :: T_HsTokensRoot_v37
v37 = \ (T_HsTokensRoot_vIn37 Options
_lhsIoptions) -> ( let
         _tokensX35 :: T_HsTokens_s35
_tokensX35 = forall a. Identity a -> a
Control.Monad.Identity.runIdentity (T_HsTokens -> Identity T_HsTokens_s35
attach_T_HsTokens (T_HsTokens
arg_tokens_))
         (T_HsTokens_vOut34 [(Pos, String)]
_tokensItks) = T_HsTokens_s35 -> T_HsTokens_v34
inv_HsTokens_s35 T_HsTokens_s35
_tokensX35 (Options -> T_HsTokens_vIn34
T_HsTokens_vIn34 Options
_tokensOoptions)
         _tokensOoptions :: Options
_tokensOoptions = Options -> Options
rule450 Options
_lhsIoptions
         __result_ :: T_HsTokensRoot_vOut37
__result_ = T_HsTokensRoot_vOut37
T_HsTokensRoot_vOut37 
         in T_HsTokensRoot_vOut37
__result_ )
     in T_HsTokensRoot_v37 -> T_HsTokensRoot_s38
C_HsTokensRoot_s38 T_HsTokensRoot_v37
v37
   {-# INLINE rule450 #-}
   rule450 :: Options -> Options
rule450 = \ ((Options
_lhsIoptions) :: Options) ->
     Options
_lhsIoptions

-- Pattern -----------------------------------------------------
-- wrapper
data Inh_Pattern  = Inh_Pattern { Inh_Pattern -> Map NontermIdent Attributes
allInhmap_Inh_Pattern :: (Map NontermIdent Attributes), Inh_Pattern -> Map NontermIdent Attributes
allSynmap_Inh_Pattern :: (Map NontermIdent Attributes), Inh_Pattern -> Bool
anyLazyKind_Inh_Pattern :: (Bool), Inh_Pattern -> Attributes
inhmap_Inh_Pattern :: (Attributes), Inh_Pattern -> Attributes
localAttrTypes_Inh_Pattern :: (Map Identifier Type), Inh_Pattern -> Options
options_Inh_Pattern :: (Options), Inh_Pattern -> Attributes
synmap_Inh_Pattern :: (Attributes) }
data Syn_Pattern  = Syn_Pattern { Syn_Pattern -> PP_Doc
attrTypes_Syn_Pattern :: (PP_Doc), Syn_Pattern -> Set String
attrs_Syn_Pattern :: (Set String), Syn_Pattern -> Pattern
copy_Syn_Pattern :: (Pattern), Syn_Pattern -> [(PP_Doc, PP_Doc)]
extraDefs_Syn_Pattern :: ([(PP_Doc,PP_Doc)]), Syn_Pattern -> Bool
isUnderscore_Syn_Pattern :: (Bool), Syn_Pattern -> PP_Doc
sem_lhs_Syn_Pattern :: ( PP_Doc ) }
{-# INLINABLE wrap_Pattern #-}
wrap_Pattern :: T_Pattern  -> Inh_Pattern  -> (Syn_Pattern )
wrap_Pattern :: T_Pattern -> Inh_Pattern -> Syn_Pattern
wrap_Pattern (T_Pattern Identity T_Pattern_s41
act) (Inh_Pattern Map NontermIdent Attributes
_lhsIallInhmap Map NontermIdent Attributes
_lhsIallSynmap Bool
_lhsIanyLazyKind Attributes
_lhsIinhmap Attributes
_lhsIlocalAttrTypes Options
_lhsIoptions Attributes
_lhsIsynmap) =
   forall a. Identity a -> a
Control.Monad.Identity.runIdentity (
     do T_Pattern_s41
sem <- Identity T_Pattern_s41
act
        let arg40 :: T_Pattern_vIn40
arg40 = Map NontermIdent Attributes
-> Map NontermIdent Attributes
-> Bool
-> Attributes
-> Attributes
-> Options
-> Attributes
-> T_Pattern_vIn40
T_Pattern_vIn40 Map NontermIdent Attributes
_lhsIallInhmap Map NontermIdent Attributes
_lhsIallSynmap Bool
_lhsIanyLazyKind Attributes
_lhsIinhmap Attributes
_lhsIlocalAttrTypes Options
_lhsIoptions Attributes
_lhsIsynmap
        (T_Pattern_vOut40 PP_Doc
_lhsOattrTypes Set String
_lhsOattrs Pattern
_lhsOcopy [(PP_Doc, PP_Doc)]
_lhsOextraDefs Bool
_lhsOisUnderscore PP_Doc
_lhsOsem_lhs) <- forall (m :: * -> *) a. Monad m => a -> m a
return (T_Pattern_s41 -> T_Pattern_v40
inv_Pattern_s41 T_Pattern_s41
sem T_Pattern_vIn40
arg40)
        forall (m :: * -> *) a. Monad m => a -> m a
return (PP_Doc
-> Set String
-> Pattern
-> [(PP_Doc, PP_Doc)]
-> Bool
-> PP_Doc
-> Syn_Pattern
Syn_Pattern PP_Doc
_lhsOattrTypes Set String
_lhsOattrs Pattern
_lhsOcopy [(PP_Doc, PP_Doc)]
_lhsOextraDefs Bool
_lhsOisUnderscore PP_Doc
_lhsOsem_lhs)
   )

-- cata
{-# NOINLINE sem_Pattern #-}
sem_Pattern :: Pattern  -> T_Pattern 
sem_Pattern :: Pattern -> T_Pattern
sem_Pattern ( Constr NontermIdent
name_ Patterns
pats_ ) = NontermIdent -> T_Patterns -> T_Pattern
sem_Pattern_Constr NontermIdent
name_ ( Patterns -> T_Patterns
sem_Patterns Patterns
pats_ )
sem_Pattern ( Product Pos
pos_ Patterns
pats_ ) = Pos -> T_Patterns -> T_Pattern
sem_Pattern_Product Pos
pos_ ( Patterns -> T_Patterns
sem_Patterns Patterns
pats_ )
sem_Pattern ( Alias NontermIdent
field_ NontermIdent
attr_ Pattern
pat_ ) = NontermIdent -> NontermIdent -> T_Pattern -> T_Pattern
sem_Pattern_Alias NontermIdent
field_ NontermIdent
attr_ ( Pattern -> T_Pattern
sem_Pattern Pattern
pat_ )
sem_Pattern ( Irrefutable Pattern
pat_ ) = T_Pattern -> T_Pattern
sem_Pattern_Irrefutable ( Pattern -> T_Pattern
sem_Pattern Pattern
pat_ )
sem_Pattern ( Underscore Pos
pos_ ) = Pos -> T_Pattern
sem_Pattern_Underscore Pos
pos_

-- semantic domain
newtype T_Pattern  = T_Pattern {
                               T_Pattern -> Identity T_Pattern_s41
attach_T_Pattern :: Identity (T_Pattern_s41 )
                               }
newtype T_Pattern_s41  = C_Pattern_s41 {
                                       T_Pattern_s41 -> T_Pattern_v40
inv_Pattern_s41 :: (T_Pattern_v40 )
                                       }
data T_Pattern_s42  = C_Pattern_s42
type T_Pattern_v40  = (T_Pattern_vIn40 ) -> (T_Pattern_vOut40 )
data T_Pattern_vIn40  = T_Pattern_vIn40 (Map NontermIdent Attributes) (Map NontermIdent Attributes) (Bool) (Attributes) (Map Identifier Type) (Options) (Attributes)
data T_Pattern_vOut40  = T_Pattern_vOut40 (PP_Doc) (Set String) (Pattern) ([(PP_Doc,PP_Doc)]) (Bool) ( PP_Doc )
{-# NOINLINE sem_Pattern_Constr #-}
sem_Pattern_Constr :: (ConstructorIdent) -> T_Patterns  -> T_Pattern 
sem_Pattern_Constr :: NontermIdent -> T_Patterns -> T_Pattern
sem_Pattern_Constr NontermIdent
arg_name_ T_Patterns
arg_pats_ = Identity T_Pattern_s41 -> T_Pattern
T_Pattern (forall (m :: * -> *) a. Monad m => a -> m a
return T_Pattern_s41
st41) where
   {-# NOINLINE st41 #-}
   st41 :: T_Pattern_s41
st41 = let
      v40 :: T_Pattern_v40 
      v40 :: T_Pattern_v40
v40 = \ (T_Pattern_vIn40 Map NontermIdent Attributes
_lhsIallInhmap Map NontermIdent Attributes
_lhsIallSynmap Bool
_lhsIanyLazyKind Attributes
_lhsIinhmap Attributes
_lhsIlocalAttrTypes Options
_lhsIoptions Attributes
_lhsIsynmap) -> ( let
         _patsX44 :: T_Patterns_s44
_patsX44 = forall a. Identity a -> a
Control.Monad.Identity.runIdentity (T_Patterns -> Identity T_Patterns_s44
attach_T_Patterns (T_Patterns
arg_pats_))
         (T_Patterns_vOut43 PP_Doc
_patsIattrTypes Set String
_patsIattrs Patterns
_patsIcopy [(PP_Doc, PP_Doc)]
_patsIextraDefs [PP_Doc]
_patsIsem_lhs) = T_Patterns_s44 -> T_Patterns_v43
inv_Patterns_s44 T_Patterns_s44
_patsX44 (Map NontermIdent Attributes
-> Map NontermIdent Attributes
-> Bool
-> Attributes
-> Attributes
-> Options
-> Attributes
-> T_Patterns_vIn43
T_Patterns_vIn43 Map NontermIdent Attributes
_patsOallInhmap Map NontermIdent Attributes
_patsOallSynmap Bool
_patsOanyLazyKind Attributes
_patsOinhmap Attributes
_patsOlocalAttrTypes Options
_patsOoptions Attributes
_patsOsynmap)
         _lhsOsem_lhs ::  PP_Doc 
         _lhsOsem_lhs :: PP_Doc
_lhsOsem_lhs = [PP_Doc] -> NontermIdent -> PP_Doc
rule451 [PP_Doc]
_patsIsem_lhs NontermIdent
arg_name_
         _lhsOisUnderscore :: Bool
         _lhsOisUnderscore :: Bool
_lhsOisUnderscore = () -> Bool
rule452  ()
         _lhsOattrTypes :: PP_Doc
         _lhsOattrTypes :: PP_Doc
_lhsOattrTypes = PP_Doc -> PP_Doc
rule453 PP_Doc
_patsIattrTypes
         _lhsOattrs :: Set String
         _lhsOattrs :: Set String
_lhsOattrs = Set String -> Set String
rule454 Set String
_patsIattrs
         _lhsOextraDefs :: [(PP_Doc,PP_Doc)]
         _lhsOextraDefs :: [(PP_Doc, PP_Doc)]
_lhsOextraDefs = [(PP_Doc, PP_Doc)] -> [(PP_Doc, PP_Doc)]
rule455 [(PP_Doc, PP_Doc)]
_patsIextraDefs
         _copy :: Pattern
_copy = Patterns -> NontermIdent -> Pattern
rule456 Patterns
_patsIcopy NontermIdent
arg_name_
         _lhsOcopy :: Pattern
         _lhsOcopy :: Pattern
_lhsOcopy = forall a. a -> a
rule457 Pattern
_copy
         _patsOallInhmap :: Map NontermIdent Attributes
_patsOallInhmap = Map NontermIdent Attributes -> Map NontermIdent Attributes
rule458 Map NontermIdent Attributes
_lhsIallInhmap
         _patsOallSynmap :: Map NontermIdent Attributes
_patsOallSynmap = Map NontermIdent Attributes -> Map NontermIdent Attributes
rule459 Map NontermIdent Attributes
_lhsIallSynmap
         _patsOanyLazyKind :: Bool
_patsOanyLazyKind = Bool -> Bool
rule460 Bool
_lhsIanyLazyKind
         _patsOinhmap :: Attributes
_patsOinhmap = Attributes -> Attributes
rule461 Attributes
_lhsIinhmap
         _patsOlocalAttrTypes :: Attributes
_patsOlocalAttrTypes = Attributes -> Attributes
rule462 Attributes
_lhsIlocalAttrTypes
         _patsOoptions :: Options
_patsOoptions = Options -> Options
rule463 Options
_lhsIoptions
         _patsOsynmap :: Attributes
_patsOsynmap = Attributes -> Attributes
rule464 Attributes
_lhsIsynmap
         __result_ :: T_Pattern_vOut40
__result_ = PP_Doc
-> Set String
-> Pattern
-> [(PP_Doc, PP_Doc)]
-> Bool
-> PP_Doc
-> T_Pattern_vOut40
T_Pattern_vOut40 PP_Doc
_lhsOattrTypes Set String
_lhsOattrs Pattern
_lhsOcopy [(PP_Doc, PP_Doc)]
_lhsOextraDefs Bool
_lhsOisUnderscore PP_Doc
_lhsOsem_lhs
         in T_Pattern_vOut40
__result_ )
     in T_Pattern_v40 -> T_Pattern_s41
C_Pattern_s41 T_Pattern_v40
v40
   {-# INLINE rule451 #-}
   {-# LINE 1066 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule451 = \ ((_patsIsem_lhs) :: [PP_Doc]) name_ ->
                                  {-# LINE 1066 "src-ag/ExecutionPlan2Caml.ag" #-}
                                  pp_parens $ name_ >#< pp_block "(" ")" "," _patsIsem_lhs
                                  {-# LINE 3847 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule452 #-}
   {-# LINE 1075 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule452 = \  (_ :: ()) ->
                                    {-# LINE 1075 "src-ag/ExecutionPlan2Caml.ag" #-}
                                    False
                                    {-# LINE 3853 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule453 #-}
   rule453 = \ ((_patsIattrTypes) :: PP_Doc) ->
     _patsIattrTypes
   {-# INLINE rule454 #-}
   rule454 = \ ((_patsIattrs) :: Set String) ->
     _patsIattrs
   {-# INLINE rule455 #-}
   rule455 = \ ((_patsIextraDefs) :: [(PP_Doc,PP_Doc)]) ->
     _patsIextraDefs
   {-# INLINE rule456 #-}
   rule456 = \ ((_patsIcopy) :: Patterns) name_ ->
     Constr name_ _patsIcopy
   {-# INLINE rule457 #-}
   rule457 = \ _copy ->
     _copy
   {-# INLINE rule458 #-}
   rule458 = \ ((_lhsIallInhmap) :: Map NontermIdent Attributes) ->
     _lhsIallInhmap
   {-# INLINE rule459 #-}
   rule459 = \ ((_lhsIallSynmap) :: Map NontermIdent Attributes) ->
     _lhsIallSynmap
   {-# INLINE rule460 #-}
   rule460 = \ ((_lhsIanyLazyKind) :: Bool) ->
     _lhsIanyLazyKind
   {-# INLINE rule461 #-}
   rule461 = \ ((_lhsIinhmap) :: Attributes) ->
     _lhsIinhmap
   {-# INLINE rule462 #-}
   rule462 = \ ((_lhsIlocalAttrTypes) :: Map Identifier Type) ->
     _lhsIlocalAttrTypes
   {-# INLINE rule463 #-}
   rule463 = \ ((_lhsIoptions) :: Options) ->
     _lhsIoptions
   {-# INLINE rule464 #-}
   rule464 = \ ((_lhsIsynmap) :: Attributes) ->
     _lhsIsynmap
{-# NOINLINE sem_Pattern_Product #-}
sem_Pattern_Product :: (Pos) -> T_Patterns  -> T_Pattern 
sem_Pattern_Product :: Pos -> T_Patterns -> T_Pattern
sem_Pattern_Product Pos
arg_pos_ T_Patterns
arg_pats_ = Identity T_Pattern_s41 -> T_Pattern
T_Pattern (forall (m :: * -> *) a. Monad m => a -> m a
return T_Pattern_s41
st41) where
   {-# NOINLINE st41 #-}
   st41 :: T_Pattern_s41
st41 = let
      v40 :: T_Pattern_v40 
      v40 :: T_Pattern_v40
v40 = \ (T_Pattern_vIn40 Map NontermIdent Attributes
_lhsIallInhmap Map NontermIdent Attributes
_lhsIallSynmap Bool
_lhsIanyLazyKind Attributes
_lhsIinhmap Attributes
_lhsIlocalAttrTypes Options
_lhsIoptions Attributes
_lhsIsynmap) -> ( let
         _patsX44 :: T_Patterns_s44
_patsX44 = forall a. Identity a -> a
Control.Monad.Identity.runIdentity (T_Patterns -> Identity T_Patterns_s44
attach_T_Patterns (T_Patterns
arg_pats_))
         (T_Patterns_vOut43 PP_Doc
_patsIattrTypes Set String
_patsIattrs Patterns
_patsIcopy [(PP_Doc, PP_Doc)]
_patsIextraDefs [PP_Doc]
_patsIsem_lhs) = T_Patterns_s44 -> T_Patterns_v43
inv_Patterns_s44 T_Patterns_s44
_patsX44 (Map NontermIdent Attributes
-> Map NontermIdent Attributes
-> Bool
-> Attributes
-> Attributes
-> Options
-> Attributes
-> T_Patterns_vIn43
T_Patterns_vIn43 Map NontermIdent Attributes
_patsOallInhmap Map NontermIdent Attributes
_patsOallSynmap Bool
_patsOanyLazyKind Attributes
_patsOinhmap Attributes
_patsOlocalAttrTypes Options
_patsOoptions Attributes
_patsOsynmap)
         _lhsOsem_lhs ::  PP_Doc 
         _lhsOsem_lhs :: PP_Doc
_lhsOsem_lhs = [PP_Doc] -> PP_Doc
rule465 [PP_Doc]
_patsIsem_lhs
         _lhsOisUnderscore :: Bool
         _lhsOisUnderscore :: Bool
_lhsOisUnderscore = () -> Bool
rule466  ()
         _lhsOattrTypes :: PP_Doc
         _lhsOattrTypes :: PP_Doc
_lhsOattrTypes = PP_Doc -> PP_Doc
rule467 PP_Doc
_patsIattrTypes
         _lhsOattrs :: Set String
         _lhsOattrs :: Set String
_lhsOattrs = Set String -> Set String
rule468 Set String
_patsIattrs
         _lhsOextraDefs :: [(PP_Doc,PP_Doc)]
         _lhsOextraDefs :: [(PP_Doc, PP_Doc)]
_lhsOextraDefs = [(PP_Doc, PP_Doc)] -> [(PP_Doc, PP_Doc)]
rule469 [(PP_Doc, PP_Doc)]
_patsIextraDefs
         _copy :: Pattern
_copy = Patterns -> Pos -> Pattern
rule470 Patterns
_patsIcopy Pos
arg_pos_
         _lhsOcopy :: Pattern
         _lhsOcopy :: Pattern
_lhsOcopy = forall a. a -> a
rule471 Pattern
_copy
         _patsOallInhmap :: Map NontermIdent Attributes
_patsOallInhmap = Map NontermIdent Attributes -> Map NontermIdent Attributes
rule472 Map NontermIdent Attributes
_lhsIallInhmap
         _patsOallSynmap :: Map NontermIdent Attributes
_patsOallSynmap = Map NontermIdent Attributes -> Map NontermIdent Attributes
rule473 Map NontermIdent Attributes
_lhsIallSynmap
         _patsOanyLazyKind :: Bool
_patsOanyLazyKind = Bool -> Bool
rule474 Bool
_lhsIanyLazyKind
         _patsOinhmap :: Attributes
_patsOinhmap = Attributes -> Attributes
rule475 Attributes
_lhsIinhmap
         _patsOlocalAttrTypes :: Attributes
_patsOlocalAttrTypes = Attributes -> Attributes
rule476 Attributes
_lhsIlocalAttrTypes
         _patsOoptions :: Options
_patsOoptions = Options -> Options
rule477 Options
_lhsIoptions
         _patsOsynmap :: Attributes
_patsOsynmap = Attributes -> Attributes
rule478 Attributes
_lhsIsynmap
         __result_ :: T_Pattern_vOut40
__result_ = PP_Doc
-> Set String
-> Pattern
-> [(PP_Doc, PP_Doc)]
-> Bool
-> PP_Doc
-> T_Pattern_vOut40
T_Pattern_vOut40 PP_Doc
_lhsOattrTypes Set String
_lhsOattrs Pattern
_lhsOcopy [(PP_Doc, PP_Doc)]
_lhsOextraDefs Bool
_lhsOisUnderscore PP_Doc
_lhsOsem_lhs
         in T_Pattern_vOut40
__result_ )
     in T_Pattern_v40 -> T_Pattern_s41
C_Pattern_s41 T_Pattern_v40
v40
   {-# INLINE rule465 #-}
   {-# LINE 1065 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule465 = \ ((_patsIsem_lhs) :: [PP_Doc]) ->
                                  {-# LINE 1065 "src-ag/ExecutionPlan2Caml.ag" #-}
                                  pp_block "(" ")" "," _patsIsem_lhs
                                  {-# LINE 3927 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule466 #-}
   {-# LINE 1076 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule466 = \  (_ :: ()) ->
                                    {-# LINE 1076 "src-ag/ExecutionPlan2Caml.ag" #-}
                                    False
                                    {-# LINE 3933 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule467 #-}
   rule467 = \ ((_patsIattrTypes) :: PP_Doc) ->
     _patsIattrTypes
   {-# INLINE rule468 #-}
   rule468 = \ ((_patsIattrs) :: Set String) ->
     _patsIattrs
   {-# INLINE rule469 #-}
   rule469 = \ ((_patsIextraDefs) :: [(PP_Doc,PP_Doc)]) ->
     _patsIextraDefs
   {-# INLINE rule470 #-}
   rule470 = \ ((_patsIcopy) :: Patterns) pos_ ->
     Product pos_ _patsIcopy
   {-# INLINE rule471 #-}
   rule471 = \ _copy ->
     _copy
   {-# INLINE rule472 #-}
   rule472 = \ ((_lhsIallInhmap) :: Map NontermIdent Attributes) ->
     _lhsIallInhmap
   {-# INLINE rule473 #-}
   rule473 = \ ((_lhsIallSynmap) :: Map NontermIdent Attributes) ->
     _lhsIallSynmap
   {-# INLINE rule474 #-}
   rule474 = \ ((_lhsIanyLazyKind) :: Bool) ->
     _lhsIanyLazyKind
   {-# INLINE rule475 #-}
   rule475 = \ ((_lhsIinhmap) :: Attributes) ->
     _lhsIinhmap
   {-# INLINE rule476 #-}
   rule476 = \ ((_lhsIlocalAttrTypes) :: Map Identifier Type) ->
     _lhsIlocalAttrTypes
   {-# INLINE rule477 #-}
   rule477 = \ ((_lhsIoptions) :: Options) ->
     _lhsIoptions
   {-# INLINE rule478 #-}
   rule478 = \ ((_lhsIsynmap) :: Attributes) ->
     _lhsIsynmap
{-# NOINLINE sem_Pattern_Alias #-}
sem_Pattern_Alias :: (Identifier) -> (Identifier) -> T_Pattern  -> T_Pattern 
sem_Pattern_Alias :: NontermIdent -> NontermIdent -> T_Pattern -> T_Pattern
sem_Pattern_Alias NontermIdent
arg_field_ NontermIdent
arg_attr_ T_Pattern
arg_pat_ = Identity T_Pattern_s41 -> T_Pattern
T_Pattern (forall (m :: * -> *) a. Monad m => a -> m a
return T_Pattern_s41
st41) where
   {-# NOINLINE st41 #-}
   st41 :: T_Pattern_s41
st41 = let
      v40 :: T_Pattern_v40 
      v40 :: T_Pattern_v40
v40 = \ (T_Pattern_vIn40 Map NontermIdent Attributes
_lhsIallInhmap Map NontermIdent Attributes
_lhsIallSynmap Bool
_lhsIanyLazyKind Attributes
_lhsIinhmap Attributes
_lhsIlocalAttrTypes Options
_lhsIoptions Attributes
_lhsIsynmap) -> ( let
         _patX41 :: T_Pattern_s41
_patX41 = forall a. Identity a -> a
Control.Monad.Identity.runIdentity (T_Pattern -> Identity T_Pattern_s41
attach_T_Pattern (T_Pattern
arg_pat_))
         (T_Pattern_vOut40 PP_Doc
_patIattrTypes Set String
_patIattrs Pattern
_patIcopy [(PP_Doc, PP_Doc)]
_patIextraDefs Bool
_patIisUnderscore PP_Doc
_patIsem_lhs) = T_Pattern_s41 -> T_Pattern_v40
inv_Pattern_s41 T_Pattern_s41
_patX41 (Map NontermIdent Attributes
-> Map NontermIdent Attributes
-> Bool
-> Attributes
-> Attributes
-> Options
-> Attributes
-> T_Pattern_vIn40
T_Pattern_vIn40 Map NontermIdent Attributes
_patOallInhmap Map NontermIdent Attributes
_patOallSynmap Bool
_patOanyLazyKind Attributes
_patOinhmap Attributes
_patOlocalAttrTypes Options
_patOoptions Attributes
_patOsynmap)
         _var :: PP_Doc
_var = Options -> NontermIdent -> NontermIdent -> PP_Doc
rule479 Options
_lhsIoptions NontermIdent
arg_attr_ NontermIdent
arg_field_
         _hasTp :: Bool
_hasTp = forall a. Maybe a -> Bool
rule480 Maybe Type
_mbTp
         _o_sigs :: Bool
_o_sigs = Options -> Bool
rule481 Options
_lhsIoptions
         _lhsOsem_lhs ::  PP_Doc 
         _lhsOsem_lhs :: PP_Doc
_lhsOsem_lhs = Bool -> Maybe Type -> Bool -> PP_Doc -> PP_Doc
rule482 Bool
_hasTp Maybe Type
_mbTp Bool
_o_sigs PP_Doc
_var
         _lhsOextraDefs :: [(PP_Doc,PP_Doc)]
         _lhsOextraDefs :: [(PP_Doc, PP_Doc)]
_lhsOextraDefs = forall {b}. Bool -> PP_Doc -> b -> [(PP_Doc, b)]
rule483 Bool
_patIisUnderscore PP_Doc
_patIsem_lhs PP_Doc
_var
         _lhsOisUnderscore :: Bool
         _lhsOisUnderscore :: Bool
_lhsOisUnderscore = () -> Bool
rule484  ()
         _lhsOattrs :: Set String
         _lhsOattrs :: Set String
_lhsOattrs = Options -> Set String -> NontermIdent -> NontermIdent -> Set String
rule485 Options
_lhsIoptions Set String
_patIattrs NontermIdent
arg_attr_ NontermIdent
arg_field_
         _mbTp :: Maybe Type
_mbTp = Attributes
-> Attributes -> NontermIdent -> NontermIdent -> Maybe Type
rule486 Attributes
_lhsIlocalAttrTypes Attributes
_lhsIsynmap NontermIdent
arg_attr_ NontermIdent
arg_field_
         _lhsOattrTypes :: PP_Doc
         _lhsOattrTypes :: PP_Doc
_lhsOattrTypes = Options
-> Maybe Type -> PP_Doc -> NontermIdent -> NontermIdent -> PP_Doc
rule487 Options
_lhsIoptions Maybe Type
_mbTp PP_Doc
_patIattrTypes NontermIdent
arg_attr_ NontermIdent
arg_field_
         _copy :: Pattern
_copy = Pattern -> NontermIdent -> NontermIdent -> Pattern
rule488 Pattern
_patIcopy NontermIdent
arg_attr_ NontermIdent
arg_field_
         _lhsOcopy :: Pattern
         _lhsOcopy :: Pattern
_lhsOcopy = forall a. a -> a
rule489 Pattern
_copy
         _patOallInhmap :: Map NontermIdent Attributes
_patOallInhmap = Map NontermIdent Attributes -> Map NontermIdent Attributes
rule490 Map NontermIdent Attributes
_lhsIallInhmap
         _patOallSynmap :: Map NontermIdent Attributes
_patOallSynmap = Map NontermIdent Attributes -> Map NontermIdent Attributes
rule491 Map NontermIdent Attributes
_lhsIallSynmap
         _patOanyLazyKind :: Bool
_patOanyLazyKind = Bool -> Bool
rule492 Bool
_lhsIanyLazyKind
         _patOinhmap :: Attributes
_patOinhmap = Attributes -> Attributes
rule493 Attributes
_lhsIinhmap
         _patOlocalAttrTypes :: Attributes
_patOlocalAttrTypes = Attributes -> Attributes
rule494 Attributes
_lhsIlocalAttrTypes
         _patOoptions :: Options
_patOoptions = Options -> Options
rule495 Options
_lhsIoptions
         _patOsynmap :: Attributes
_patOsynmap = Attributes -> Attributes
rule496 Attributes
_lhsIsynmap
         __result_ :: T_Pattern_vOut40
__result_ = PP_Doc
-> Set String
-> Pattern
-> [(PP_Doc, PP_Doc)]
-> Bool
-> PP_Doc
-> T_Pattern_vOut40
T_Pattern_vOut40 PP_Doc
_lhsOattrTypes Set String
_lhsOattrs Pattern
_lhsOcopy [(PP_Doc, PP_Doc)]
_lhsOextraDefs Bool
_lhsOisUnderscore PP_Doc
_lhsOsem_lhs
         in T_Pattern_vOut40
__result_ )
     in T_Pattern_v40 -> T_Pattern_s41
C_Pattern_s41 T_Pattern_v40
v40
   {-# INLINE rule479 #-}
   {-# LINE 1057 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule479 = \ ((_lhsIoptions) :: Options) attr_ field_ ->
                                  {-# LINE 1057 "src-ag/ExecutionPlan2Caml.ag" #-}
                                  text $ attrname _lhsIoptions False field_ attr_
                                  {-# LINE 4011 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule480 #-}
   {-# LINE 1058 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule480 = \ _mbTp ->
                                  {-# LINE 1058 "src-ag/ExecutionPlan2Caml.ag" #-}
                                  isJust _mbTp
                                  {-# LINE 4017 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule481 #-}
   {-# LINE 1059 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule481 = \ ((_lhsIoptions) :: Options) ->
                                  {-# LINE 1059 "src-ag/ExecutionPlan2Caml.ag" #-}
                                  typeSigs _lhsIoptions
                                  {-# LINE 4023 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule482 #-}
   {-# LINE 1061 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule482 = \ _hasTp _mbTp _o_sigs _var ->
                                  {-# LINE 1061 "src-ag/ExecutionPlan2Caml.ag" #-}
                                  ppArg (_hasTp     && _o_sigs    ) _var     (maybe (text "?no type?") ppTp _mbTp    )
                                  {-# LINE 4029 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule483 #-}
   {-# LINE 1062 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule483 = \ ((_patIisUnderscore) :: Bool) ((_patIsem_lhs) ::  PP_Doc ) _var ->
                                  {-# LINE 1062 "src-ag/ExecutionPlan2Caml.ag" #-}
                                  if _patIisUnderscore
                                  then []
                                  else [ (_patIsem_lhs, _var    ) ]
                                  {-# LINE 4037 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule484 #-}
   {-# LINE 1077 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule484 = \  (_ :: ()) ->
                                    {-# LINE 1077 "src-ag/ExecutionPlan2Caml.ag" #-}
                                    False
                                    {-# LINE 4043 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule485 #-}
   {-# LINE 1083 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule485 = \ ((_lhsIoptions) :: Options) ((_patIattrs) :: Set String) attr_ field_ ->
                    {-# LINE 1083 "src-ag/ExecutionPlan2Caml.ag" #-}
                    Set.insert (attrname _lhsIoptions False field_ attr_) _patIattrs
                    {-# LINE 4049 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule486 #-}
   {-# LINE 1089 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule486 = \ ((_lhsIlocalAttrTypes) :: Map Identifier Type) ((_lhsIsynmap) :: Attributes) attr_ field_ ->
                    {-# LINE 1089 "src-ag/ExecutionPlan2Caml.ag" #-}
                    if field_ == _LHS
                    then Map.lookup attr_ _lhsIsynmap
                    else if field_ == _LOC
                         then Map.lookup attr_ _lhsIlocalAttrTypes
                         else Nothing
                    {-# LINE 4059 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule487 #-}
   {-# LINE 1094 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule487 = \ ((_lhsIoptions) :: Options) _mbTp ((_patIattrTypes) :: PP_Doc) attr_ field_ ->
                    {-# LINE 1094 "src-ag/ExecutionPlan2Caml.ag" #-}
                    maybe empty (\tp -> (attrname _lhsIoptions False field_ attr_) >#< "::" >#< ppTp tp) _mbTp
                    >-< _patIattrTypes
                    {-# LINE 4066 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule488 #-}
   rule488 = \ ((_patIcopy) :: Pattern) attr_ field_ ->
     Alias field_ attr_ _patIcopy
   {-# INLINE rule489 #-}
   rule489 = \ _copy ->
     _copy
   {-# INLINE rule490 #-}
   rule490 = \ ((_lhsIallInhmap) :: Map NontermIdent Attributes) ->
     _lhsIallInhmap
   {-# INLINE rule491 #-}
   rule491 = \ ((_lhsIallSynmap) :: Map NontermIdent Attributes) ->
     _lhsIallSynmap
   {-# INLINE rule492 #-}
   rule492 = \ ((_lhsIanyLazyKind) :: Bool) ->
     _lhsIanyLazyKind
   {-# INLINE rule493 #-}
   rule493 = \ ((_lhsIinhmap) :: Attributes) ->
     _lhsIinhmap
   {-# INLINE rule494 #-}
   rule494 = \ ((_lhsIlocalAttrTypes) :: Map Identifier Type) ->
     _lhsIlocalAttrTypes
   {-# INLINE rule495 #-}
   rule495 = \ ((_lhsIoptions) :: Options) ->
     _lhsIoptions
   {-# INLINE rule496 #-}
   rule496 = \ ((_lhsIsynmap) :: Attributes) ->
     _lhsIsynmap
{-# NOINLINE sem_Pattern_Irrefutable #-}
sem_Pattern_Irrefutable :: T_Pattern  -> T_Pattern 
sem_Pattern_Irrefutable :: T_Pattern -> T_Pattern
sem_Pattern_Irrefutable T_Pattern
arg_pat_ = Identity T_Pattern_s41 -> T_Pattern
T_Pattern (forall (m :: * -> *) a. Monad m => a -> m a
return T_Pattern_s41
st41) where
   {-# NOINLINE st41 #-}
   st41 :: T_Pattern_s41
st41 = let
      v40 :: T_Pattern_v40 
      v40 :: T_Pattern_v40
v40 = \ (T_Pattern_vIn40 Map NontermIdent Attributes
_lhsIallInhmap Map NontermIdent Attributes
_lhsIallSynmap Bool
_lhsIanyLazyKind Attributes
_lhsIinhmap Attributes
_lhsIlocalAttrTypes Options
_lhsIoptions Attributes
_lhsIsynmap) -> ( let
         _patX41 :: T_Pattern_s41
_patX41 = forall a. Identity a -> a
Control.Monad.Identity.runIdentity (T_Pattern -> Identity T_Pattern_s41
attach_T_Pattern (T_Pattern
arg_pat_))
         (T_Pattern_vOut40 PP_Doc
_patIattrTypes Set String
_patIattrs Pattern
_patIcopy [(PP_Doc, PP_Doc)]
_patIextraDefs Bool
_patIisUnderscore PP_Doc
_patIsem_lhs) = T_Pattern_s41 -> T_Pattern_v40
inv_Pattern_s41 T_Pattern_s41
_patX41 (Map NontermIdent Attributes
-> Map NontermIdent Attributes
-> Bool
-> Attributes
-> Attributes
-> Options
-> Attributes
-> T_Pattern_vIn40
T_Pattern_vIn40 Map NontermIdent Attributes
_patOallInhmap Map NontermIdent Attributes
_patOallSynmap Bool
_patOanyLazyKind Attributes
_patOinhmap Attributes
_patOlocalAttrTypes Options
_patOoptions Attributes
_patOsynmap)
         _lhsOsem_lhs ::  PP_Doc 
         _lhsOsem_lhs :: PP_Doc
_lhsOsem_lhs = PP_Doc -> PP_Doc
rule497 PP_Doc
_patIsem_lhs
         _lhsOattrTypes :: PP_Doc
         _lhsOattrTypes :: PP_Doc
_lhsOattrTypes = PP_Doc -> PP_Doc
rule498 PP_Doc
_patIattrTypes
         _lhsOattrs :: Set String
         _lhsOattrs :: Set String
_lhsOattrs = Set String -> Set String
rule499 Set String
_patIattrs
         _lhsOextraDefs :: [(PP_Doc,PP_Doc)]
         _lhsOextraDefs :: [(PP_Doc, PP_Doc)]
_lhsOextraDefs = [(PP_Doc, PP_Doc)] -> [(PP_Doc, PP_Doc)]
rule500 [(PP_Doc, PP_Doc)]
_patIextraDefs
         _copy :: Pattern
_copy = Pattern -> Pattern
rule501 Pattern
_patIcopy
         _lhsOcopy :: Pattern
         _lhsOcopy :: Pattern
_lhsOcopy = forall a. a -> a
rule502 Pattern
_copy
         _lhsOisUnderscore :: Bool
         _lhsOisUnderscore :: Bool
_lhsOisUnderscore = Bool -> Bool
rule503 Bool
_patIisUnderscore
         _patOallInhmap :: Map NontermIdent Attributes
_patOallInhmap = Map NontermIdent Attributes -> Map NontermIdent Attributes
rule504 Map NontermIdent Attributes
_lhsIallInhmap
         _patOallSynmap :: Map NontermIdent Attributes
_patOallSynmap = Map NontermIdent Attributes -> Map NontermIdent Attributes
rule505 Map NontermIdent Attributes
_lhsIallSynmap
         _patOanyLazyKind :: Bool
_patOanyLazyKind = Bool -> Bool
rule506 Bool
_lhsIanyLazyKind
         _patOinhmap :: Attributes
_patOinhmap = Attributes -> Attributes
rule507 Attributes
_lhsIinhmap
         _patOlocalAttrTypes :: Attributes
_patOlocalAttrTypes = Attributes -> Attributes
rule508 Attributes
_lhsIlocalAttrTypes
         _patOoptions :: Options
_patOoptions = Options -> Options
rule509 Options
_lhsIoptions
         _patOsynmap :: Attributes
_patOsynmap = Attributes -> Attributes
rule510 Attributes
_lhsIsynmap
         __result_ :: T_Pattern_vOut40
__result_ = PP_Doc
-> Set String
-> Pattern
-> [(PP_Doc, PP_Doc)]
-> Bool
-> PP_Doc
-> T_Pattern_vOut40
T_Pattern_vOut40 PP_Doc
_lhsOattrTypes Set String
_lhsOattrs Pattern
_lhsOcopy [(PP_Doc, PP_Doc)]
_lhsOextraDefs Bool
_lhsOisUnderscore PP_Doc
_lhsOsem_lhs
         in T_Pattern_vOut40
__result_ )
     in T_Pattern_v40 -> T_Pattern_s41
C_Pattern_s41 T_Pattern_v40
v40
   {-# INLINE rule497 #-}
   {-# LINE 1068 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule497 = \ ((_patIsem_lhs) ::  PP_Doc ) ->
                                  {-# LINE 1068 "src-ag/ExecutionPlan2Caml.ag" #-}
                                  pp_parens (text "lazy" >#< _patIsem_lhs)
                                  {-# LINE 4131 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule498 #-}
   rule498 = \ ((_patIattrTypes) :: PP_Doc) ->
     _patIattrTypes
   {-# INLINE rule499 #-}
   rule499 = \ ((_patIattrs) :: Set String) ->
     _patIattrs
   {-# INLINE rule500 #-}
   rule500 = \ ((_patIextraDefs) :: [(PP_Doc,PP_Doc)]) ->
     _patIextraDefs
   {-# INLINE rule501 #-}
   rule501 = \ ((_patIcopy) :: Pattern) ->
     Irrefutable _patIcopy
   {-# INLINE rule502 #-}
   rule502 = \ _copy ->
     _copy
   {-# INLINE rule503 #-}
   rule503 = \ ((_patIisUnderscore) :: Bool) ->
     _patIisUnderscore
   {-# INLINE rule504 #-}
   rule504 = \ ((_lhsIallInhmap) :: Map NontermIdent Attributes) ->
     _lhsIallInhmap
   {-# INLINE rule505 #-}
   rule505 = \ ((_lhsIallSynmap) :: Map NontermIdent Attributes) ->
     _lhsIallSynmap
   {-# INLINE rule506 #-}
   rule506 = \ ((_lhsIanyLazyKind) :: Bool) ->
     _lhsIanyLazyKind
   {-# INLINE rule507 #-}
   rule507 = \ ((_lhsIinhmap) :: Attributes) ->
     _lhsIinhmap
   {-# INLINE rule508 #-}
   rule508 = \ ((_lhsIlocalAttrTypes) :: Map Identifier Type) ->
     _lhsIlocalAttrTypes
   {-# INLINE rule509 #-}
   rule509 = \ ((_lhsIoptions) :: Options) ->
     _lhsIoptions
   {-# INLINE rule510 #-}
   rule510 = \ ((_lhsIsynmap) :: Attributes) ->
     _lhsIsynmap
{-# NOINLINE sem_Pattern_Underscore #-}
sem_Pattern_Underscore :: (Pos) -> T_Pattern 
sem_Pattern_Underscore :: Pos -> T_Pattern
sem_Pattern_Underscore Pos
arg_pos_ = Identity T_Pattern_s41 -> T_Pattern
T_Pattern (forall (m :: * -> *) a. Monad m => a -> m a
return T_Pattern_s41
st41) where
   {-# NOINLINE st41 #-}
   st41 :: T_Pattern_s41
st41 = let
      v40 :: T_Pattern_v40 
      v40 :: T_Pattern_v40
v40 = \ (T_Pattern_vIn40 Map NontermIdent Attributes
_lhsIallInhmap Map NontermIdent Attributes
_lhsIallSynmap Bool
_lhsIanyLazyKind Attributes
_lhsIinhmap Attributes
_lhsIlocalAttrTypes Options
_lhsIoptions Attributes
_lhsIsynmap) -> ( let
         _lhsOsem_lhs ::  PP_Doc 
         _lhsOsem_lhs :: PP_Doc
_lhsOsem_lhs = () -> PP_Doc
rule511  ()
         _lhsOisUnderscore :: Bool
         _lhsOisUnderscore :: Bool
_lhsOisUnderscore = () -> Bool
rule512  ()
         _lhsOattrTypes :: PP_Doc
         _lhsOattrTypes :: PP_Doc
_lhsOattrTypes = () -> PP_Doc
rule513  ()
         _lhsOattrs :: Set String
         _lhsOattrs :: Set String
_lhsOattrs = forall {a}. () -> Set a
rule514  ()
         _lhsOextraDefs :: [(PP_Doc,PP_Doc)]
         _lhsOextraDefs :: [(PP_Doc, PP_Doc)]
_lhsOextraDefs = forall {a}. () -> [a]
rule515  ()
         _copy :: Pattern
_copy = Pos -> Pattern
rule516 Pos
arg_pos_
         _lhsOcopy :: Pattern
         _lhsOcopy :: Pattern
_lhsOcopy = forall a. a -> a
rule517 Pattern
_copy
         __result_ :: T_Pattern_vOut40
__result_ = PP_Doc
-> Set String
-> Pattern
-> [(PP_Doc, PP_Doc)]
-> Bool
-> PP_Doc
-> T_Pattern_vOut40
T_Pattern_vOut40 PP_Doc
_lhsOattrTypes Set String
_lhsOattrs Pattern
_lhsOcopy [(PP_Doc, PP_Doc)]
_lhsOextraDefs Bool
_lhsOisUnderscore PP_Doc
_lhsOsem_lhs
         in T_Pattern_vOut40
__result_ )
     in T_Pattern_v40 -> T_Pattern_s41
C_Pattern_s41 T_Pattern_v40
v40
   {-# INLINE rule511 #-}
   {-# LINE 1067 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule511 = \  (_ :: ()) ->
                                  {-# LINE 1067 "src-ag/ExecutionPlan2Caml.ag" #-}
                                  text "_"
                                  {-# LINE 4199 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule512 #-}
   {-# LINE 1078 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule512 = \  (_ :: ()) ->
                                    {-# LINE 1078 "src-ag/ExecutionPlan2Caml.ag" #-}
                                    True
                                    {-# LINE 4205 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule513 #-}
   rule513 = \  (_ :: ()) ->
     empty
   {-# INLINE rule514 #-}
   rule514 = \  (_ :: ()) ->
     Set.empty
   {-# INLINE rule515 #-}
   rule515 = \  (_ :: ()) ->
     []
   {-# INLINE rule516 #-}
   rule516 = \ pos_ ->
     Underscore pos_
   {-# INLINE rule517 #-}
   rule517 = \ _copy ->
     _copy

-- Patterns ----------------------------------------------------
-- wrapper
data Inh_Patterns  = Inh_Patterns { Inh_Patterns -> Map NontermIdent Attributes
allInhmap_Inh_Patterns :: (Map NontermIdent Attributes), Inh_Patterns -> Map NontermIdent Attributes
allSynmap_Inh_Patterns :: (Map NontermIdent Attributes), Inh_Patterns -> Bool
anyLazyKind_Inh_Patterns :: (Bool), Inh_Patterns -> Attributes
inhmap_Inh_Patterns :: (Attributes), Inh_Patterns -> Attributes
localAttrTypes_Inh_Patterns :: (Map Identifier Type), Inh_Patterns -> Options
options_Inh_Patterns :: (Options), Inh_Patterns -> Attributes
synmap_Inh_Patterns :: (Attributes) }
data Syn_Patterns  = Syn_Patterns { Syn_Patterns -> PP_Doc
attrTypes_Syn_Patterns :: (PP_Doc), Syn_Patterns -> Set String
attrs_Syn_Patterns :: (Set String), Syn_Patterns -> Patterns
copy_Syn_Patterns :: (Patterns), Syn_Patterns -> [(PP_Doc, PP_Doc)]
extraDefs_Syn_Patterns :: ([(PP_Doc,PP_Doc)]), Syn_Patterns -> [PP_Doc]
sem_lhs_Syn_Patterns :: ([PP_Doc]) }
{-# INLINABLE wrap_Patterns #-}
wrap_Patterns :: T_Patterns  -> Inh_Patterns  -> (Syn_Patterns )
wrap_Patterns :: T_Patterns -> Inh_Patterns -> Syn_Patterns
wrap_Patterns (T_Patterns Identity T_Patterns_s44
act) (Inh_Patterns Map NontermIdent Attributes
_lhsIallInhmap Map NontermIdent Attributes
_lhsIallSynmap Bool
_lhsIanyLazyKind Attributes
_lhsIinhmap Attributes
_lhsIlocalAttrTypes Options
_lhsIoptions Attributes
_lhsIsynmap) =
   forall a. Identity a -> a
Control.Monad.Identity.runIdentity (
     do T_Patterns_s44
sem <- Identity T_Patterns_s44
act
        let arg43 :: T_Patterns_vIn43
arg43 = Map NontermIdent Attributes
-> Map NontermIdent Attributes
-> Bool
-> Attributes
-> Attributes
-> Options
-> Attributes
-> T_Patterns_vIn43
T_Patterns_vIn43 Map NontermIdent Attributes
_lhsIallInhmap Map NontermIdent Attributes
_lhsIallSynmap Bool
_lhsIanyLazyKind Attributes
_lhsIinhmap Attributes
_lhsIlocalAttrTypes Options
_lhsIoptions Attributes
_lhsIsynmap
        (T_Patterns_vOut43 PP_Doc
_lhsOattrTypes Set String
_lhsOattrs Patterns
_lhsOcopy [(PP_Doc, PP_Doc)]
_lhsOextraDefs [PP_Doc]
_lhsOsem_lhs) <- forall (m :: * -> *) a. Monad m => a -> m a
return (T_Patterns_s44 -> T_Patterns_v43
inv_Patterns_s44 T_Patterns_s44
sem T_Patterns_vIn43
arg43)
        forall (m :: * -> *) a. Monad m => a -> m a
return (PP_Doc
-> Set String
-> Patterns
-> [(PP_Doc, PP_Doc)]
-> [PP_Doc]
-> Syn_Patterns
Syn_Patterns PP_Doc
_lhsOattrTypes Set String
_lhsOattrs Patterns
_lhsOcopy [(PP_Doc, PP_Doc)]
_lhsOextraDefs [PP_Doc]
_lhsOsem_lhs)
   )

-- cata
{-# NOINLINE sem_Patterns #-}
sem_Patterns :: Patterns  -> T_Patterns 
sem_Patterns :: Patterns -> T_Patterns
sem_Patterns Patterns
list = forall (t :: * -> *) a b.
Foldable t =>
(a -> b -> b) -> b -> t a -> b
Prelude.foldr T_Pattern -> T_Patterns -> T_Patterns
sem_Patterns_Cons T_Patterns
sem_Patterns_Nil (forall a b. (a -> b) -> [a] -> [b]
Prelude.map Pattern -> T_Pattern
sem_Pattern Patterns
list)

-- semantic domain
newtype T_Patterns  = T_Patterns {
                                 T_Patterns -> Identity T_Patterns_s44
attach_T_Patterns :: Identity (T_Patterns_s44 )
                                 }
newtype T_Patterns_s44  = C_Patterns_s44 {
                                         T_Patterns_s44 -> T_Patterns_v43
inv_Patterns_s44 :: (T_Patterns_v43 )
                                         }
data T_Patterns_s45  = C_Patterns_s45
type T_Patterns_v43  = (T_Patterns_vIn43 ) -> (T_Patterns_vOut43 )
data T_Patterns_vIn43  = T_Patterns_vIn43 (Map NontermIdent Attributes) (Map NontermIdent Attributes) (Bool) (Attributes) (Map Identifier Type) (Options) (Attributes)
data T_Patterns_vOut43  = T_Patterns_vOut43 (PP_Doc) (Set String) (Patterns) ([(PP_Doc,PP_Doc)]) ([PP_Doc])
{-# NOINLINE sem_Patterns_Cons #-}
sem_Patterns_Cons :: T_Pattern  -> T_Patterns  -> T_Patterns 
sem_Patterns_Cons :: T_Pattern -> T_Patterns -> T_Patterns
sem_Patterns_Cons T_Pattern
arg_hd_ T_Patterns
arg_tl_ = Identity T_Patterns_s44 -> T_Patterns
T_Patterns (forall (m :: * -> *) a. Monad m => a -> m a
return T_Patterns_s44
st44) where
   {-# NOINLINE st44 #-}
   st44 :: T_Patterns_s44
st44 = let
      v43 :: T_Patterns_v43 
      v43 :: T_Patterns_v43
v43 = \ (T_Patterns_vIn43 Map NontermIdent Attributes
_lhsIallInhmap Map NontermIdent Attributes
_lhsIallSynmap Bool
_lhsIanyLazyKind Attributes
_lhsIinhmap Attributes
_lhsIlocalAttrTypes Options
_lhsIoptions Attributes
_lhsIsynmap) -> ( let
         _hdX41 :: T_Pattern_s41
_hdX41 = forall a. Identity a -> a
Control.Monad.Identity.runIdentity (T_Pattern -> Identity T_Pattern_s41
attach_T_Pattern (T_Pattern
arg_hd_))
         _tlX44 :: T_Patterns_s44
_tlX44 = forall a. Identity a -> a
Control.Monad.Identity.runIdentity (T_Patterns -> Identity T_Patterns_s44
attach_T_Patterns (T_Patterns
arg_tl_))
         (T_Pattern_vOut40 PP_Doc
_hdIattrTypes Set String
_hdIattrs Pattern
_hdIcopy [(PP_Doc, PP_Doc)]
_hdIextraDefs Bool
_hdIisUnderscore PP_Doc
_hdIsem_lhs) = T_Pattern_s41 -> T_Pattern_v40
inv_Pattern_s41 T_Pattern_s41
_hdX41 (Map NontermIdent Attributes
-> Map NontermIdent Attributes
-> Bool
-> Attributes
-> Attributes
-> Options
-> Attributes
-> T_Pattern_vIn40
T_Pattern_vIn40 Map NontermIdent Attributes
_hdOallInhmap Map NontermIdent Attributes
_hdOallSynmap Bool
_hdOanyLazyKind Attributes
_hdOinhmap Attributes
_hdOlocalAttrTypes Options
_hdOoptions Attributes
_hdOsynmap)
         (T_Patterns_vOut43 PP_Doc
_tlIattrTypes Set String
_tlIattrs Patterns
_tlIcopy [(PP_Doc, PP_Doc)]
_tlIextraDefs [PP_Doc]
_tlIsem_lhs) = T_Patterns_s44 -> T_Patterns_v43
inv_Patterns_s44 T_Patterns_s44
_tlX44 (Map NontermIdent Attributes
-> Map NontermIdent Attributes
-> Bool
-> Attributes
-> Attributes
-> Options
-> Attributes
-> T_Patterns_vIn43
T_Patterns_vIn43 Map NontermIdent Attributes
_tlOallInhmap Map NontermIdent Attributes
_tlOallSynmap Bool
_tlOanyLazyKind Attributes
_tlOinhmap Attributes
_tlOlocalAttrTypes Options
_tlOoptions Attributes
_tlOsynmap)
         _lhsOattrTypes :: PP_Doc
         _lhsOattrTypes :: PP_Doc
_lhsOattrTypes = PP_Doc -> PP_Doc -> PP_Doc
rule518 PP_Doc
_hdIattrTypes PP_Doc
_tlIattrTypes
         _lhsOattrs :: Set String
         _lhsOattrs :: Set String
_lhsOattrs = Set String -> Set String -> Set String
rule519 Set String
_hdIattrs Set String
_tlIattrs
         _lhsOextraDefs :: [(PP_Doc,PP_Doc)]
         _lhsOextraDefs :: [(PP_Doc, PP_Doc)]
_lhsOextraDefs = [(PP_Doc, PP_Doc)] -> [(PP_Doc, PP_Doc)] -> [(PP_Doc, PP_Doc)]
rule520 [(PP_Doc, PP_Doc)]
_hdIextraDefs [(PP_Doc, PP_Doc)]
_tlIextraDefs
         _lhsOsem_lhs :: [PP_Doc]
         _lhsOsem_lhs :: [PP_Doc]
_lhsOsem_lhs = PP_Doc -> [PP_Doc] -> [PP_Doc]
rule521 PP_Doc
_hdIsem_lhs [PP_Doc]
_tlIsem_lhs
         _copy :: Patterns
_copy = Pattern -> Patterns -> Patterns
rule522 Pattern
_hdIcopy Patterns
_tlIcopy
         _lhsOcopy :: Patterns
         _lhsOcopy :: Patterns
_lhsOcopy = forall a. a -> a
rule523 Patterns
_copy
         _hdOallInhmap :: Map NontermIdent Attributes
_hdOallInhmap = Map NontermIdent Attributes -> Map NontermIdent Attributes
rule524 Map NontermIdent Attributes
_lhsIallInhmap
         _hdOallSynmap :: Map NontermIdent Attributes
_hdOallSynmap = Map NontermIdent Attributes -> Map NontermIdent Attributes
rule525 Map NontermIdent Attributes
_lhsIallSynmap
         _hdOanyLazyKind :: Bool
_hdOanyLazyKind = Bool -> Bool
rule526 Bool
_lhsIanyLazyKind
         _hdOinhmap :: Attributes
_hdOinhmap = Attributes -> Attributes
rule527 Attributes
_lhsIinhmap
         _hdOlocalAttrTypes :: Attributes
_hdOlocalAttrTypes = Attributes -> Attributes
rule528 Attributes
_lhsIlocalAttrTypes
         _hdOoptions :: Options
_hdOoptions = Options -> Options
rule529 Options
_lhsIoptions
         _hdOsynmap :: Attributes
_hdOsynmap = Attributes -> Attributes
rule530 Attributes
_lhsIsynmap
         _tlOallInhmap :: Map NontermIdent Attributes
_tlOallInhmap = Map NontermIdent Attributes -> Map NontermIdent Attributes
rule531 Map NontermIdent Attributes
_lhsIallInhmap
         _tlOallSynmap :: Map NontermIdent Attributes
_tlOallSynmap = Map NontermIdent Attributes -> Map NontermIdent Attributes
rule532 Map NontermIdent Attributes
_lhsIallSynmap
         _tlOanyLazyKind :: Bool
_tlOanyLazyKind = Bool -> Bool
rule533 Bool
_lhsIanyLazyKind
         _tlOinhmap :: Attributes
_tlOinhmap = Attributes -> Attributes
rule534 Attributes
_lhsIinhmap
         _tlOlocalAttrTypes :: Attributes
_tlOlocalAttrTypes = Attributes -> Attributes
rule535 Attributes
_lhsIlocalAttrTypes
         _tlOoptions :: Options
_tlOoptions = Options -> Options
rule536 Options
_lhsIoptions
         _tlOsynmap :: Attributes
_tlOsynmap = Attributes -> Attributes
rule537 Attributes
_lhsIsynmap
         __result_ :: T_Patterns_vOut43
__result_ = PP_Doc
-> Set String
-> Patterns
-> [(PP_Doc, PP_Doc)]
-> [PP_Doc]
-> T_Patterns_vOut43
T_Patterns_vOut43 PP_Doc
_lhsOattrTypes Set String
_lhsOattrs Patterns
_lhsOcopy [(PP_Doc, PP_Doc)]
_lhsOextraDefs [PP_Doc]
_lhsOsem_lhs
         in T_Patterns_vOut43
__result_ )
     in T_Patterns_v43 -> T_Patterns_s44
C_Patterns_s44 T_Patterns_v43
v43
   {-# INLINE rule518 #-}
   rule518 :: PP_Doc -> PP_Doc -> PP_Doc
rule518 = \ ((PP_Doc
_hdIattrTypes) :: PP_Doc) ((PP_Doc
_tlIattrTypes) :: PP_Doc) ->
     PP_Doc
_hdIattrTypes forall a b. (PP a, PP b) => a -> b -> PP_Doc
>-< PP_Doc
_tlIattrTypes
   {-# INLINE rule519 #-}
   rule519 :: Set String -> Set String -> Set String
rule519 = \ ((Set String
_hdIattrs) :: Set String) ((Set String
_tlIattrs) :: Set String) ->
     Set String
_hdIattrs forall a. Ord a => Set a -> Set a -> Set a
`Set.union` Set String
_tlIattrs
   {-# INLINE rule520 #-}
   rule520 :: [(PP_Doc, PP_Doc)] -> [(PP_Doc, PP_Doc)] -> [(PP_Doc, PP_Doc)]
rule520 = \ (([(PP_Doc, PP_Doc)]
_hdIextraDefs) :: [(PP_Doc,PP_Doc)]) (([(PP_Doc, PP_Doc)]
_tlIextraDefs) :: [(PP_Doc,PP_Doc)]) ->
     [(PP_Doc, PP_Doc)]
_hdIextraDefs forall a. [a] -> [a] -> [a]
++ [(PP_Doc, PP_Doc)]
_tlIextraDefs
   {-# INLINE rule521 #-}
   rule521 :: PP_Doc -> [PP_Doc] -> [PP_Doc]
rule521 = \ ((PP_Doc
_hdIsem_lhs) ::  PP_Doc ) (([PP_Doc]
_tlIsem_lhs) :: [PP_Doc]) ->
     PP_Doc
_hdIsem_lhs forall a. a -> [a] -> [a]
: [PP_Doc]
_tlIsem_lhs
   {-# INLINE rule522 #-}
   rule522 :: Pattern -> Patterns -> Patterns
rule522 = \ ((Pattern
_hdIcopy) :: Pattern) ((Patterns
_tlIcopy) :: Patterns) ->
     (:) Pattern
_hdIcopy Patterns
_tlIcopy
   {-# INLINE rule523 #-}
   rule523 :: p -> p
rule523 = \ p
_copy ->
     p
_copy
   {-# INLINE rule524 #-}
   rule524 :: Map NontermIdent Attributes -> Map NontermIdent Attributes
rule524 = \ ((Map NontermIdent Attributes
_lhsIallInhmap) :: Map NontermIdent Attributes) ->
     Map NontermIdent Attributes
_lhsIallInhmap
   {-# INLINE rule525 #-}
   rule525 :: Map NontermIdent Attributes -> Map NontermIdent Attributes
rule525 = \ ((Map NontermIdent Attributes
_lhsIallSynmap) :: Map NontermIdent Attributes) ->
     Map NontermIdent Attributes
_lhsIallSynmap
   {-# INLINE rule526 #-}
   rule526 :: Bool -> Bool
rule526 = \ ((Bool
_lhsIanyLazyKind) :: Bool) ->
     Bool
_lhsIanyLazyKind
   {-# INLINE rule527 #-}
   rule527 :: Attributes -> Attributes
rule527 = \ ((Attributes
_lhsIinhmap) :: Attributes) ->
     Attributes
_lhsIinhmap
   {-# INLINE rule528 #-}
   rule528 :: Attributes -> Attributes
rule528 = \ ((Attributes
_lhsIlocalAttrTypes) :: Map Identifier Type) ->
     Attributes
_lhsIlocalAttrTypes
   {-# INLINE rule529 #-}
   rule529 :: Options -> Options
rule529 = \ ((Options
_lhsIoptions) :: Options) ->
     Options
_lhsIoptions
   {-# INLINE rule530 #-}
   rule530 :: Attributes -> Attributes
rule530 = \ ((Attributes
_lhsIsynmap) :: Attributes) ->
     Attributes
_lhsIsynmap
   {-# INLINE rule531 #-}
   rule531 :: Map NontermIdent Attributes -> Map NontermIdent Attributes
rule531 = \ ((Map NontermIdent Attributes
_lhsIallInhmap) :: Map NontermIdent Attributes) ->
     Map NontermIdent Attributes
_lhsIallInhmap
   {-# INLINE rule532 #-}
   rule532 :: Map NontermIdent Attributes -> Map NontermIdent Attributes
rule532 = \ ((Map NontermIdent Attributes
_lhsIallSynmap) :: Map NontermIdent Attributes) ->
     Map NontermIdent Attributes
_lhsIallSynmap
   {-# INLINE rule533 #-}
   rule533 :: Bool -> Bool
rule533 = \ ((Bool
_lhsIanyLazyKind) :: Bool) ->
     Bool
_lhsIanyLazyKind
   {-# INLINE rule534 #-}
   rule534 :: Attributes -> Attributes
rule534 = \ ((Attributes
_lhsIinhmap) :: Attributes) ->
     Attributes
_lhsIinhmap
   {-# INLINE rule535 #-}
   rule535 :: Attributes -> Attributes
rule535 = \ ((Attributes
_lhsIlocalAttrTypes) :: Map Identifier Type) ->
     Attributes
_lhsIlocalAttrTypes
   {-# INLINE rule536 #-}
   rule536 :: Options -> Options
rule536 = \ ((Options
_lhsIoptions) :: Options) ->
     Options
_lhsIoptions
   {-# INLINE rule537 #-}
   rule537 :: Attributes -> Attributes
rule537 = \ ((Attributes
_lhsIsynmap) :: Attributes) ->
     Attributes
_lhsIsynmap
{-# NOINLINE sem_Patterns_Nil #-}
sem_Patterns_Nil ::  T_Patterns 
sem_Patterns_Nil :: T_Patterns
sem_Patterns_Nil  = Identity T_Patterns_s44 -> T_Patterns
T_Patterns (forall (m :: * -> *) a. Monad m => a -> m a
return T_Patterns_s44
st44) where
   {-# NOINLINE st44 #-}
   st44 :: T_Patterns_s44
st44 = let
      v43 :: T_Patterns_v43 
      v43 :: T_Patterns_v43
v43 = \ (T_Patterns_vIn43 Map NontermIdent Attributes
_lhsIallInhmap Map NontermIdent Attributes
_lhsIallSynmap Bool
_lhsIanyLazyKind Attributes
_lhsIinhmap Attributes
_lhsIlocalAttrTypes Options
_lhsIoptions Attributes
_lhsIsynmap) -> ( let
         _lhsOattrTypes :: PP_Doc
         _lhsOattrTypes :: PP_Doc
_lhsOattrTypes = () -> PP_Doc
rule538  ()
         _lhsOattrs :: Set String
         _lhsOattrs :: Set String
_lhsOattrs = forall {a}. () -> Set a
rule539  ()
         _lhsOextraDefs :: [(PP_Doc,PP_Doc)]
         _lhsOextraDefs :: [(PP_Doc, PP_Doc)]
_lhsOextraDefs = forall {a}. () -> [a]
rule540  ()
         _lhsOsem_lhs :: [PP_Doc]
         _lhsOsem_lhs :: [PP_Doc]
_lhsOsem_lhs = forall {a}. () -> [a]
rule541  ()
         _copy :: [a]
_copy = forall {a}. () -> [a]
rule542  ()
         _lhsOcopy :: Patterns
         _lhsOcopy :: Patterns
_lhsOcopy = forall a. a -> a
rule543 forall a. [a]
_copy
         __result_ :: T_Patterns_vOut43
__result_ = PP_Doc
-> Set String
-> Patterns
-> [(PP_Doc, PP_Doc)]
-> [PP_Doc]
-> T_Patterns_vOut43
T_Patterns_vOut43 PP_Doc
_lhsOattrTypes Set String
_lhsOattrs Patterns
_lhsOcopy [(PP_Doc, PP_Doc)]
_lhsOextraDefs [PP_Doc]
_lhsOsem_lhs
         in T_Patterns_vOut43
__result_ )
     in T_Patterns_v43 -> T_Patterns_s44
C_Patterns_s44 T_Patterns_v43
v43
   {-# INLINE rule538 #-}
   rule538 :: () -> PP_Doc
rule538 = \  (()
_ :: ()) ->
     PP_Doc
empty
   {-# INLINE rule539 #-}
   rule539 :: () -> Set a
rule539 = \  (()
_ :: ()) ->
     forall a. Set a
Set.empty
   {-# INLINE rule540 #-}
   rule540 :: () -> [a]
rule540 = \  (()
_ :: ()) ->
     []
   {-# INLINE rule541 #-}
   rule541 :: () -> [a]
rule541 = \  (()
_ :: ()) ->
     []
   {-# INLINE rule542 #-}
   rule542 :: () -> [a]
rule542 = \  (()
_ :: ()) ->
     []
   {-# INLINE rule543 #-}
   rule543 :: p -> p
rule543 = \ p
_copy ->
     p
_copy

-- Visit -------------------------------------------------------
-- wrapper
data Inh_Visit  = Inh_Visit { Inh_Visit -> Map Int (Int, Int)
allFromToStates_Inh_Visit :: (Map VisitIdentifier (Int,Int)), Inh_Visit -> Map NontermIdent Attributes
allInhmap_Inh_Visit :: (Map NontermIdent Attributes), Inh_Visit -> Map NontermIdent Int
allInitStates_Inh_Visit :: (Map NontermIdent Int), Inh_Visit -> Map NontermIdent Attributes
allSynmap_Inh_Visit :: (Map NontermIdent Attributes), Inh_Visit -> Map Int VisitKind
allVisitKinds_Inh_Visit :: (Map VisitIdentifier VisitKind), Inh_Visit
-> Map
     Int
     (NontermIdent
      -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
allchildvisit_Inh_Visit :: (Map VisitIdentifier (Identifier -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)), Inh_Visit -> Map Int (Map String (Maybe NonLocalAttr))
allintramap_Inh_Visit :: (Map StateIdentifier (Map String (Maybe NonLocalAttr))), Inh_Visit -> Map Int (Set NontermIdent)
avisitdefs_Inh_Visit :: (Map VisitIdentifier (Set Identifier)), Inh_Visit -> Map Int (Set NontermIdent)
avisituses_Inh_Visit :: (Map VisitIdentifier (Set Identifier)), Inh_Visit -> Attributes
childTypes_Inh_Visit :: (Map Identifier Type), Inh_Visit
-> Map
     NontermIdent
     (VisitKind
      -> Either
           Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
childintros_Inh_Visit :: (Map Identifier (VisitKind -> Either Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))), Inh_Visit -> NontermIdent
con_Inh_Visit :: (ConstructorIdent), Inh_Visit -> Attributes
inhmap_Inh_Visit :: (Attributes), Inh_Visit -> Map NontermIdent (VisitKind -> Either Error PP_Doc)
mrules_Inh_Visit :: (Map Identifier (VisitKind ->  Either Error PP_Doc)), Inh_Visit -> Map Int StateCtx
nextVisits_Inh_Visit :: (Map StateIdentifier StateCtx), Inh_Visit -> NontermIdent
nt_Inh_Visit :: (NontermIdent), Inh_Visit -> Options
options_Inh_Visit :: (Options), Inh_Visit -> [NontermIdent]
params_Inh_Visit :: ([Identifier]), Inh_Visit -> Map Int StateCtx
prevVisits_Inh_Visit :: (Map StateIdentifier StateCtx), Inh_Visit -> Map NontermIdent (Set String)
ruledefs_Inh_Visit :: (Map Identifier (Set String)), Inh_Visit -> Map NontermIdent (Map String (Maybe NonLocalAttr))
ruleuses_Inh_Visit :: (Map Identifier (Map String (Maybe NonLocalAttr))), Inh_Visit -> Attributes
synmap_Inh_Visit :: (Attributes), Inh_Visit -> Set String
terminaldefs_Inh_Visit :: (Set String) }
data Syn_Visit  = Syn_Visit { Syn_Visit -> VisitStateState
allvisits_Syn_Visit :: ( VisitStateState ), Syn_Visit
-> Map
     Int
     (NontermIdent
      -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
childvisit_Syn_Visit :: (Map VisitIdentifier (Identifier -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)), Syn_Visit -> Seq Error
errors_Syn_Visit :: (Seq Error), Syn_Visit -> Map Int (Int, Int)
fromToStates_Syn_Visit :: (Map VisitIdentifier (Int,Int)), Syn_Visit -> Map Int (Map String (Maybe NonLocalAttr))
intramap_Syn_Visit :: (Map StateIdentifier (Map String (Maybe NonLocalAttr))), Syn_Visit -> Set String
lazyIntras_Syn_Visit :: (Set String), Syn_Visit -> Map NontermIdent (Set VisitKind)
ruleKinds_Syn_Visit :: (Map Identifier (Set VisitKind)), Syn_Visit -> Map NontermIdent Int
ruleUsage_Syn_Visit :: (Map Identifier Int), Syn_Visit -> (Int, PP_Doc)
sem_visit_Syn_Visit :: (  (StateIdentifier,PP_Doc)  ), Syn_Visit -> PP_Doc
t_visits_Syn_Visit :: (PP_Doc), Syn_Visit -> Map Int VisitKind
visitKinds_Syn_Visit :: (Map VisitIdentifier VisitKind), Syn_Visit -> Map Int (Set NontermIdent)
visitdefs_Syn_Visit :: (Map VisitIdentifier (Set Identifier)), Syn_Visit -> Map Int (Set NontermIdent)
visituses_Syn_Visit :: (Map VisitIdentifier (Set Identifier)) }
{-# INLINABLE wrap_Visit #-}
wrap_Visit :: T_Visit  -> Inh_Visit  -> (Syn_Visit )
wrap_Visit :: T_Visit -> Inh_Visit -> Syn_Visit
wrap_Visit (T_Visit Identity T_Visit_s47
act) (Inh_Visit Map Int (Int, Int)
_lhsIallFromToStates Map NontermIdent Attributes
_lhsIallInhmap Map NontermIdent Int
_lhsIallInitStates Map NontermIdent Attributes
_lhsIallSynmap Map Int VisitKind
_lhsIallVisitKinds Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_lhsIallchildvisit Map Int (Map String (Maybe NonLocalAttr))
_lhsIallintramap Map Int (Set NontermIdent)
_lhsIavisitdefs Map Int (Set NontermIdent)
_lhsIavisituses Attributes
_lhsIchildTypes Map
  NontermIdent
  (VisitKind
   -> Either
        Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
_lhsIchildintros NontermIdent
_lhsIcon Attributes
_lhsIinhmap Map NontermIdent (VisitKind -> Either Error PP_Doc)
_lhsImrules Map Int StateCtx
_lhsInextVisits NontermIdent
_lhsInt Options
_lhsIoptions [NontermIdent]
_lhsIparams Map Int StateCtx
_lhsIprevVisits Map NontermIdent (Set String)
_lhsIruledefs Map NontermIdent (Map String (Maybe NonLocalAttr))
_lhsIruleuses Attributes
_lhsIsynmap Set String
_lhsIterminaldefs) =
   forall a. Identity a -> a
Control.Monad.Identity.runIdentity (
     do T_Visit_s47
sem <- Identity T_Visit_s47
act
        let arg46 :: T_Visit_vIn46
arg46 = Map Int (Int, Int)
-> Map NontermIdent Attributes
-> Map NontermIdent Int
-> Map NontermIdent Attributes
-> Map Int VisitKind
-> Map
     Int
     (NontermIdent
      -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
-> Map Int (Map String (Maybe NonLocalAttr))
-> Map Int (Set NontermIdent)
-> Map Int (Set NontermIdent)
-> Attributes
-> Map
     NontermIdent
     (VisitKind
      -> Either
           Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
-> NontermIdent
-> Attributes
-> Map NontermIdent (VisitKind -> Either Error PP_Doc)
-> Map Int StateCtx
-> NontermIdent
-> Options
-> [NontermIdent]
-> Map Int StateCtx
-> Map NontermIdent (Set String)
-> Map NontermIdent (Map String (Maybe NonLocalAttr))
-> Attributes
-> Set String
-> T_Visit_vIn46
T_Visit_vIn46 Map Int (Int, Int)
_lhsIallFromToStates Map NontermIdent Attributes
_lhsIallInhmap Map NontermIdent Int
_lhsIallInitStates Map NontermIdent Attributes
_lhsIallSynmap Map Int VisitKind
_lhsIallVisitKinds Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_lhsIallchildvisit Map Int (Map String (Maybe NonLocalAttr))
_lhsIallintramap Map Int (Set NontermIdent)
_lhsIavisitdefs Map Int (Set NontermIdent)
_lhsIavisituses Attributes
_lhsIchildTypes Map
  NontermIdent
  (VisitKind
   -> Either
        Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
_lhsIchildintros NontermIdent
_lhsIcon Attributes
_lhsIinhmap Map NontermIdent (VisitKind -> Either Error PP_Doc)
_lhsImrules Map Int StateCtx
_lhsInextVisits NontermIdent
_lhsInt Options
_lhsIoptions [NontermIdent]
_lhsIparams Map Int StateCtx
_lhsIprevVisits Map NontermIdent (Set String)
_lhsIruledefs Map NontermIdent (Map String (Maybe NonLocalAttr))
_lhsIruleuses Attributes
_lhsIsynmap Set String
_lhsIterminaldefs
        (T_Visit_vOut46 VisitStateState
_lhsOallvisits Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_lhsOchildvisit Seq Error
_lhsOerrors Map Int (Int, Int)
_lhsOfromToStates Map Int (Map String (Maybe NonLocalAttr))
_lhsOintramap Set String
_lhsOlazyIntras Map NontermIdent (Set VisitKind)
_lhsOruleKinds Map NontermIdent Int
_lhsOruleUsage (Int, PP_Doc)
_lhsOsem_visit PP_Doc
_lhsOt_visits Map Int VisitKind
_lhsOvisitKinds Map Int (Set NontermIdent)
_lhsOvisitdefs Map Int (Set NontermIdent)
_lhsOvisituses) <- forall (m :: * -> *) a. Monad m => a -> m a
return (T_Visit_s47 -> T_Visit_v46
inv_Visit_s47 T_Visit_s47
sem T_Visit_vIn46
arg46)
        forall (m :: * -> *) a. Monad m => a -> m a
return (VisitStateState
-> Map
     Int
     (NontermIdent
      -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
-> Seq Error
-> Map Int (Int, Int)
-> Map Int (Map String (Maybe NonLocalAttr))
-> Set String
-> Map NontermIdent (Set VisitKind)
-> Map NontermIdent Int
-> (Int, PP_Doc)
-> PP_Doc
-> Map Int VisitKind
-> Map Int (Set NontermIdent)
-> Map Int (Set NontermIdent)
-> Syn_Visit
Syn_Visit VisitStateState
_lhsOallvisits Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_lhsOchildvisit Seq Error
_lhsOerrors Map Int (Int, Int)
_lhsOfromToStates Map Int (Map String (Maybe NonLocalAttr))
_lhsOintramap Set String
_lhsOlazyIntras Map NontermIdent (Set VisitKind)
_lhsOruleKinds Map NontermIdent Int
_lhsOruleUsage (Int, PP_Doc)
_lhsOsem_visit PP_Doc
_lhsOt_visits Map Int VisitKind
_lhsOvisitKinds Map Int (Set NontermIdent)
_lhsOvisitdefs Map Int (Set NontermIdent)
_lhsOvisituses)
   )

-- cata
{-# INLINE sem_Visit #-}
sem_Visit :: Visit  -> T_Visit 
sem_Visit :: Visit -> T_Visit
sem_Visit ( Visit Int
ident_ Int
from_ Int
to_ Set NontermIdent
inh_ Set NontermIdent
syn_ VisitSteps
steps_ VisitKind
kind_ ) = Int
-> Int
-> Int
-> Set NontermIdent
-> Set NontermIdent
-> T_VisitSteps
-> VisitKind
-> T_Visit
sem_Visit_Visit Int
ident_ Int
from_ Int
to_ Set NontermIdent
inh_ Set NontermIdent
syn_ ( VisitSteps -> T_VisitSteps
sem_VisitSteps VisitSteps
steps_ ) VisitKind
kind_

-- semantic domain
newtype T_Visit  = T_Visit {
                           T_Visit -> Identity T_Visit_s47
attach_T_Visit :: Identity (T_Visit_s47 )
                           }
newtype T_Visit_s47  = C_Visit_s47 {
                                   T_Visit_s47 -> T_Visit_v46
inv_Visit_s47 :: (T_Visit_v46 )
                                   }
data T_Visit_s48  = C_Visit_s48
type T_Visit_v46  = (T_Visit_vIn46 ) -> (T_Visit_vOut46 )
data T_Visit_vIn46  = T_Visit_vIn46 (Map VisitIdentifier (Int,Int)) (Map NontermIdent Attributes) (Map NontermIdent Int) (Map NontermIdent Attributes) (Map VisitIdentifier VisitKind) (Map VisitIdentifier (Identifier -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)) (Map StateIdentifier (Map String (Maybe NonLocalAttr))) (Map VisitIdentifier (Set Identifier)) (Map VisitIdentifier (Set Identifier)) (Map Identifier Type) (Map Identifier (VisitKind -> Either Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))) (ConstructorIdent) (Attributes) (Map Identifier (VisitKind ->  Either Error PP_Doc)) (Map StateIdentifier StateCtx) (NontermIdent) (Options) ([Identifier]) (Map StateIdentifier StateCtx) (Map Identifier (Set String)) (Map Identifier (Map String (Maybe NonLocalAttr))) (Attributes) (Set String)
data T_Visit_vOut46  = T_Visit_vOut46 ( VisitStateState ) (Map VisitIdentifier (Identifier -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)) (Seq Error) (Map VisitIdentifier (Int,Int)) (Map StateIdentifier (Map String (Maybe NonLocalAttr))) (Set String) (Map Identifier (Set VisitKind)) (Map Identifier Int) (  (StateIdentifier,PP_Doc)  ) (PP_Doc) (Map VisitIdentifier VisitKind) (Map VisitIdentifier (Set Identifier)) (Map VisitIdentifier (Set Identifier))
{-# NOINLINE sem_Visit_Visit #-}
sem_Visit_Visit :: (VisitIdentifier) -> (StateIdentifier) -> (StateIdentifier) -> (Set Identifier) -> (Set Identifier) -> T_VisitSteps  -> (VisitKind) -> T_Visit 
sem_Visit_Visit :: Int
-> Int
-> Int
-> Set NontermIdent
-> Set NontermIdent
-> T_VisitSteps
-> VisitKind
-> T_Visit
sem_Visit_Visit Int
arg_ident_ Int
arg_from_ Int
arg_to_ Set NontermIdent
arg_inh_ Set NontermIdent
arg_syn_ T_VisitSteps
arg_steps_ VisitKind
arg_kind_ = Identity T_Visit_s47 -> T_Visit
T_Visit (forall (m :: * -> *) a. Monad m => a -> m a
return T_Visit_s47
st47) where
   {-# NOINLINE st47 #-}
   st47 :: T_Visit_s47
st47 = let
      v46 :: T_Visit_v46 
      v46 :: T_Visit_v46
v46 = \ (T_Visit_vIn46 Map Int (Int, Int)
_lhsIallFromToStates Map NontermIdent Attributes
_lhsIallInhmap Map NontermIdent Int
_lhsIallInitStates Map NontermIdent Attributes
_lhsIallSynmap Map Int VisitKind
_lhsIallVisitKinds Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_lhsIallchildvisit Map Int (Map String (Maybe NonLocalAttr))
_lhsIallintramap Map Int (Set NontermIdent)
_lhsIavisitdefs Map Int (Set NontermIdent)
_lhsIavisituses Attributes
_lhsIchildTypes Map
  NontermIdent
  (VisitKind
   -> Either
        Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
_lhsIchildintros NontermIdent
_lhsIcon Attributes
_lhsIinhmap Map NontermIdent (VisitKind -> Either Error PP_Doc)
_lhsImrules Map Int StateCtx
_lhsInextVisits NontermIdent
_lhsInt Options
_lhsIoptions [NontermIdent]
_lhsIparams Map Int StateCtx
_lhsIprevVisits Map NontermIdent (Set String)
_lhsIruledefs Map NontermIdent (Map String (Maybe NonLocalAttr))
_lhsIruleuses Attributes
_lhsIsynmap Set String
_lhsIterminaldefs) -> ( let
         _stepsX53 :: T_VisitSteps_s53
_stepsX53 = forall a. Identity a -> a
Control.Monad.Identity.runIdentity (T_VisitSteps -> Identity T_VisitSteps_s53
attach_T_VisitSteps (T_VisitSteps
arg_steps_))
         (T_VisitSteps_vOut52 Set String
_stepsIdefs Seq Error
_stepsIerrors Int
_stepsIindex Bool
_stepsIisLast Set String
_stepsIlazyIntras Int
_stepsIprevMaxSimRefs Map NontermIdent (Set VisitKind)
_stepsIruleKinds Map NontermIdent Int
_stepsIruleUsage PP_Doc
_stepsIsem_steps Int
_stepsIsize Map String (Maybe NonLocalAttr)
_stepsIuses Map Int VisitKind
_stepsIvisitKinds) = T_VisitSteps_s53 -> T_VisitSteps_v52
inv_VisitSteps_s53 T_VisitSteps_s53
_stepsX53 (Map Int (Int, Int)
-> Map NontermIdent Int
-> Map Int VisitKind
-> Map
     Int
     (NontermIdent
      -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
-> Map Int (Set NontermIdent)
-> Map Int (Set NontermIdent)
-> Attributes
-> Map
     NontermIdent
     (VisitKind
      -> Either
           Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
-> PP_Doc
-> Int
-> VisitKind
-> Map NontermIdent (VisitKind -> Either Error PP_Doc)
-> Options
-> Int
-> Map NontermIdent (Set String)
-> Map NontermIdent (Map String (Maybe NonLocalAttr))
-> Bool
-> T_VisitSteps_vIn52
T_VisitSteps_vIn52 Map Int (Int, Int)
_stepsOallFromToStates Map NontermIdent Int
_stepsOallInitStates Map Int VisitKind
_stepsOallVisitKinds Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_stepsOallchildvisit Map Int (Set NontermIdent)
_stepsOavisitdefs Map Int (Set NontermIdent)
_stepsOavisituses Attributes
_stepsOchildTypes Map
  NontermIdent
  (VisitKind
   -> Either
        Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
_stepsOchildintros PP_Doc
_stepsOfollow Int
_stepsOindex VisitKind
_stepsOkind Map NontermIdent (VisitKind -> Either Error PP_Doc)
_stepsOmrules Options
_stepsOoptions Int
_stepsOprevMaxSimRefs Map NontermIdent (Set String)
_stepsOruledefs Map NontermIdent (Map String (Maybe NonLocalAttr))
_stepsOruleuses Bool
_stepsOuseParallel)
         _lhsOallvisits ::  VisitStateState 
         _lhsOallvisits :: VisitStateState
_lhsOallvisits = forall {b} {a} {c}. b -> a -> c -> (a, b, c)
rule544 Int
arg_from_ Int
arg_ident_ Int
arg_to_
         _nameTIn_visit :: PP_Doc
_nameTIn_visit = NontermIdent -> Int -> PP_Doc
rule545 NontermIdent
_lhsInt Int
arg_ident_
         _nameTOut_visit :: PP_Doc
_nameTOut_visit = NontermIdent -> Int -> PP_Doc
rule546 NontermIdent
_lhsInt Int
arg_ident_
         _nameNextState :: PP_Doc
_nameNextState = NontermIdent -> Int -> PP_Doc
rule547 NontermIdent
_lhsInt Int
arg_to_
         _nameCaller_visit :: PP_Doc
_nameCaller_visit = NontermIdent -> Int -> PP_Doc
rule548 NontermIdent
_lhsInt Int
arg_ident_
         _nextVisitInfo :: StateCtx
_nextVisitInfo = Map Int StateCtx -> Int -> StateCtx
rule549 Map Int StateCtx
_lhsInextVisits Int
arg_to_
         _t_params :: PP_Doc
_t_params = [NontermIdent] -> PP_Doc
rule550 [NontermIdent]
_lhsIparams
         _t_c_params :: PP_Doc
_t_c_params = [NontermIdent] -> PP_Doc
rule551 [NontermIdent]
_lhsIparams
         _lhsOt_visits :: PP_Doc
         _lhsOt_visits :: PP_Doc
_lhsOt_visits = [PP_Doc]
-> [PP_Doc]
-> NontermIdent
-> PP_Doc
-> PP_Doc
-> PP_Doc
-> [PP_Doc]
-> PP_Doc
-> PP_Doc
-> Int
-> PP_Doc
rule552 [PP_Doc]
_contpart [PP_Doc]
_inhpart NontermIdent
_lhsInt PP_Doc
_nameCaller_visit PP_Doc
_nameTIn_visit PP_Doc
_nameTOut_visit [PP_Doc]
_synpart PP_Doc
_t_c_params PP_Doc
_t_params Int
arg_ident_
         _contpart :: [PP_Doc]
_contpart = NontermIdent -> PP_Doc -> StateCtx -> PP_Doc -> Int -> [PP_Doc]
rule553 NontermIdent
_lhsInt PP_Doc
_nameNextState StateCtx
_nextVisitInfo PP_Doc
_t_params Int
arg_ident_
         _inhpart :: [PP_Doc]
_inhpart = forall {t} {t}.
Attributes
-> ((NontermIdent -> NontermIdent -> Int -> PP_Doc)
    -> t -> Attributes -> t)
-> t
-> t
rule554 Attributes
_lhsIinhmap (NontermIdent -> NontermIdent -> Int -> PP_Doc)
-> Set NontermIdent -> Attributes -> [PP_Doc]
_ppTypeList Set NontermIdent
arg_inh_
         _synpart :: [PP_Doc]
_synpart = forall {t} {t}.
Attributes
-> ((NontermIdent -> NontermIdent -> Int -> PP_Doc)
    -> t -> Attributes -> t)
-> t
-> t
rule555 Attributes
_lhsIsynmap (NontermIdent -> NontermIdent -> Int -> PP_Doc)
-> Set NontermIdent -> Attributes -> [PP_Doc]
_ppTypeList Set NontermIdent
arg_syn_
         _ppTypeList :: (NontermIdent -> NontermIdent -> Int -> PP_Doc)
-> Set NontermIdent -> Attributes -> [PP_Doc]
_ppTypeList = forall {t}.
NontermIdent
-> t
-> (NontermIdent -> NontermIdent -> t -> PP_Doc)
-> Set NontermIdent
-> Attributes
-> [PP_Doc]
rule556 NontermIdent
_lhsInt Int
arg_ident_
         _o_sigs :: Bool
_o_sigs = Options -> Bool
rule557 Options
_lhsIoptions
         _lhsOsem_visit ::   (StateIdentifier,PP_Doc)  
         _lhsOsem_visit :: (Int, PP_Doc)
_lhsOsem_visit = forall {a}.
NontermIdent
-> Options
-> PP_Doc
-> PP_Doc
-> Bool
-> PP_Doc
-> PP_Doc
-> a
-> Int
-> Set NontermIdent
-> (a, PP_Doc)
rule558 NontermIdent
_lhsInt Options
_lhsIoptions PP_Doc
_nameTIn_visit PP_Doc
_nameTOut_visit Bool
_o_sigs PP_Doc
_stepsIsem_steps PP_Doc
_t_params Int
arg_from_ Int
arg_ident_ Set NontermIdent
arg_inh_
         _stepsOfollow :: PP_Doc
_stepsOfollow = PP_Doc -> PP_Doc -> PP_Doc
rule559 PP_Doc
_nextStBuild PP_Doc
_resultval
         _nextArgsMp :: Map String (Maybe NonLocalAttr)
_nextArgsMp = Map Int (Map String (Maybe NonLocalAttr))
-> Int -> Map String (Maybe NonLocalAttr)
rule560 Map Int (Map String (Maybe NonLocalAttr))
_lhsIallintramap Int
arg_to_
         _nextArgs :: PP_Doc
_nextArgs = forall {a}. Map String a -> PP_Doc
rule561 Map String (Maybe NonLocalAttr)
_nextArgsMp
         _nextStExp :: PP_Doc
_nextStExp = forall {k} {a}. Options -> PP_Doc -> Map k a -> Int -> PP_Doc
rule562 Options
_lhsIoptions PP_Doc
_nextArgs Map String (Maybe NonLocalAttr)
_nextArgsMp Int
arg_to_
         _resultval :: PP_Doc
_resultval = NontermIdent
-> Options -> PP_Doc -> Int -> Set NontermIdent -> PP_Doc
rule563 NontermIdent
_lhsInt Options
_lhsIoptions PP_Doc
_nextStRefExp Int
arg_ident_ Set NontermIdent
arg_syn_
         (PP_Doc
_nextStBuild,PP_Doc
_nextStRefExp) = NontermIdent -> PP_Doc -> StateCtx -> Int -> (PP_Doc, PP_Doc)
rule564 NontermIdent
_lhsInt PP_Doc
_nextStExp StateCtx
_nextVisitInfo Int
arg_ident_
         _stepsOkind :: VisitKind
_stepsOkind = forall a. a -> a
rule565 VisitKind
arg_kind_
         _stepsOindex :: Int
_stepsOindex = () -> Int
rule566  ()
         _stepsOprevMaxSimRefs :: Int
_stepsOprevMaxSimRefs = () -> Int
rule567  ()
         _stepsOuseParallel :: Bool
_stepsOuseParallel = () -> Bool
rule568  ()
         _prevVisitInfo :: StateCtx
_prevVisitInfo = Map Int StateCtx -> Int -> StateCtx
rule569 Map Int StateCtx
_lhsInextVisits Int
arg_from_
         _lhsOchildvisit :: Map VisitIdentifier (Identifier -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
         _lhsOchildvisit :: Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_lhsOchildvisit = forall {a} {k}. a -> k -> Map k a
rule570 NontermIdent -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc
_invokecode Int
arg_ident_
         _invokecode :: NontermIdent -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc
_invokecode = NontermIdent
-> Options
-> PP_Doc
-> StateCtx
-> Bool
-> StateCtx
-> Int
-> Int
-> Set NontermIdent
-> VisitKind
-> Set NontermIdent
-> Int
-> NontermIdent
-> Type
-> VisitKind
-> PP_Doc
-> Either Error PP_Doc
rule571 NontermIdent
_lhsInt Options
_lhsIoptions PP_Doc
_nameTOut_visit StateCtx
_nextVisitInfo Bool
_o_sigs StateCtx
_prevVisitInfo Int
arg_from_ Int
arg_ident_ Set NontermIdent
arg_inh_ VisitKind
arg_kind_ Set NontermIdent
arg_syn_ Int
arg_to_
         _thisintra :: Map String (Maybe NonLocalAttr)
_thisintra = forall {b} {a}.
Map String b -> Map String a -> Map String a -> Map String a
rule572 Map String (Maybe Any)
_defsAsMap Map String (Maybe NonLocalAttr)
_nextintra Map String (Maybe NonLocalAttr)
_uses
         _lhsOintramap :: Map StateIdentifier (Map String (Maybe NonLocalAttr))
         _lhsOintramap :: Map Int (Map String (Maybe NonLocalAttr))
_lhsOintramap = forall {a} {k}. a -> k -> Map k a
rule573 Map String (Maybe NonLocalAttr)
_thisintra Int
arg_from_
         _nextintra :: Map String (Maybe NonLocalAttr)
_nextintra = Map Int (Map String (Maybe NonLocalAttr))
-> Int -> Map String (Maybe NonLocalAttr)
rule574 Map Int (Map String (Maybe NonLocalAttr))
_lhsIallintramap Int
arg_to_
         _uses :: Map String (Maybe NonLocalAttr)
_uses = Options
-> Map String (Maybe NonLocalAttr)
-> Set NontermIdent
-> Map String (Maybe NonLocalAttr)
rule575 Options
_lhsIoptions Map String (Maybe NonLocalAttr)
_stepsIuses Set NontermIdent
arg_syn_
         _inhVarNms :: Set String
_inhVarNms = Options -> Set NontermIdent -> Set String
rule576 Options
_lhsIoptions Set NontermIdent
arg_inh_
         _defs :: Set String
_defs = Set String -> Set String -> Set String -> Set String
rule577 Set String
_inhVarNms Set String
_lhsIterminaldefs Set String
_stepsIdefs
         _defsAsMap :: Map String (Maybe Any)
_defsAsMap = forall {a}. Set String -> Map String (Maybe a)
rule578 Set String
_defs
         _lhsOvisitdefs :: Map VisitIdentifier (Set Identifier)
         _lhsOvisitdefs :: Map Int (Set NontermIdent)
_lhsOvisitdefs = forall k a. k -> a -> Map k a
rule579 Int
arg_ident_ Set NontermIdent
arg_syn_
         _lhsOvisituses :: Map VisitIdentifier (Set Identifier)
         _lhsOvisituses :: Map Int (Set NontermIdent)
_lhsOvisituses = forall k a. k -> a -> Map k a
rule580 Int
arg_ident_ Set NontermIdent
arg_inh_
         _lazyIntrasInh :: Set String
_lazyIntrasInh = Set String -> Set String -> VisitKind -> Set String
rule581 Set String
_inhVarNms Set String
_stepsIdefs VisitKind
arg_kind_
         _lhsOlazyIntras :: Set String
         _lhsOlazyIntras :: Set String
_lhsOlazyIntras = Set String -> Set String -> Set String
rule582 Set String
_lazyIntrasInh Set String
_stepsIlazyIntras
         _lhsOfromToStates :: Map VisitIdentifier (Int,Int)
         _lhsOfromToStates :: Map Int (Int, Int)
_lhsOfromToStates = forall {a} {k} {b}. a -> k -> b -> Map k (a, b)
rule583 Int
arg_from_ Int
arg_ident_ Int
arg_to_
         _lhsOvisitKinds :: Map VisitIdentifier VisitKind
         _lhsOvisitKinds :: Map Int VisitKind
_lhsOvisitKinds = forall k a. k -> a -> Map k a
rule584 Int
arg_ident_ VisitKind
arg_kind_
         _lhsOerrors :: Seq Error
         _lhsOerrors :: Seq Error
_lhsOerrors = Seq Error -> Seq Error
rule585 Seq Error
_stepsIerrors
         _lhsOruleKinds :: Map Identifier (Set VisitKind)
         _lhsOruleKinds :: Map NontermIdent (Set VisitKind)
_lhsOruleKinds = Map NontermIdent (Set VisitKind)
-> Map NontermIdent (Set VisitKind)
rule586 Map NontermIdent (Set VisitKind)
_stepsIruleKinds
         _lhsOruleUsage :: Map Identifier Int
         _lhsOruleUsage :: Map NontermIdent Int
_lhsOruleUsage = Map NontermIdent Int -> Map NontermIdent Int
rule587 Map NontermIdent Int
_stepsIruleUsage
         _stepsOallFromToStates :: Map Int (Int, Int)
_stepsOallFromToStates = Map Int (Int, Int) -> Map Int (Int, Int)
rule588 Map Int (Int, Int)
_lhsIallFromToStates
         _stepsOallInitStates :: Map NontermIdent Int
_stepsOallInitStates = Map NontermIdent Int -> Map NontermIdent Int
rule589 Map NontermIdent Int
_lhsIallInitStates
         _stepsOallVisitKinds :: Map Int VisitKind
_stepsOallVisitKinds = Map Int VisitKind -> Map Int VisitKind
rule590 Map Int VisitKind
_lhsIallVisitKinds
         _stepsOallchildvisit :: Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_stepsOallchildvisit = Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
-> Map
     Int
     (NontermIdent
      -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
rule591 Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_lhsIallchildvisit
         _stepsOavisitdefs :: Map Int (Set NontermIdent)
_stepsOavisitdefs = Map Int (Set NontermIdent) -> Map Int (Set NontermIdent)
rule592 Map Int (Set NontermIdent)
_lhsIavisitdefs
         _stepsOavisituses :: Map Int (Set NontermIdent)
_stepsOavisituses = Map Int (Set NontermIdent) -> Map Int (Set NontermIdent)
rule593 Map Int (Set NontermIdent)
_lhsIavisituses
         _stepsOchildTypes :: Attributes
_stepsOchildTypes = Attributes -> Attributes
rule594 Attributes
_lhsIchildTypes
         _stepsOchildintros :: Map
  NontermIdent
  (VisitKind
   -> Either
        Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
_stepsOchildintros = Map
  NontermIdent
  (VisitKind
   -> Either
        Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
-> Map
     NontermIdent
     (VisitKind
      -> Either
           Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
rule595 Map
  NontermIdent
  (VisitKind
   -> Either
        Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
_lhsIchildintros
         _stepsOmrules :: Map NontermIdent (VisitKind -> Either Error PP_Doc)
_stepsOmrules = Map NontermIdent (VisitKind -> Either Error PP_Doc)
-> Map NontermIdent (VisitKind -> Either Error PP_Doc)
rule596 Map NontermIdent (VisitKind -> Either Error PP_Doc)
_lhsImrules
         _stepsOoptions :: Options
_stepsOoptions = Options -> Options
rule597 Options
_lhsIoptions
         _stepsOruledefs :: Map NontermIdent (Set String)
_stepsOruledefs = Map NontermIdent (Set String) -> Map NontermIdent (Set String)
rule598 Map NontermIdent (Set String)
_lhsIruledefs
         _stepsOruleuses :: Map NontermIdent (Map String (Maybe NonLocalAttr))
_stepsOruleuses = Map NontermIdent (Map String (Maybe NonLocalAttr))
-> Map NontermIdent (Map String (Maybe NonLocalAttr))
rule599 Map NontermIdent (Map String (Maybe NonLocalAttr))
_lhsIruleuses
         __result_ :: T_Visit_vOut46
__result_ = VisitStateState
-> Map
     Int
     (NontermIdent
      -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
-> Seq Error
-> Map Int (Int, Int)
-> Map Int (Map String (Maybe NonLocalAttr))
-> Set String
-> Map NontermIdent (Set VisitKind)
-> Map NontermIdent Int
-> (Int, PP_Doc)
-> PP_Doc
-> Map Int VisitKind
-> Map Int (Set NontermIdent)
-> Map Int (Set NontermIdent)
-> T_Visit_vOut46
T_Visit_vOut46 VisitStateState
_lhsOallvisits Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_lhsOchildvisit Seq Error
_lhsOerrors Map Int (Int, Int)
_lhsOfromToStates Map Int (Map String (Maybe NonLocalAttr))
_lhsOintramap Set String
_lhsOlazyIntras Map NontermIdent (Set VisitKind)
_lhsOruleKinds Map NontermIdent Int
_lhsOruleUsage (Int, PP_Doc)
_lhsOsem_visit PP_Doc
_lhsOt_visits Map Int VisitKind
_lhsOvisitKinds Map Int (Set NontermIdent)
_lhsOvisitdefs Map Int (Set NontermIdent)
_lhsOvisituses
         in T_Visit_vOut46
__result_ )
     in T_Visit_v46 -> T_Visit_s47
C_Visit_s47 T_Visit_v46
v46
   {-# INLINE rule544 #-}
   {-# LINE 436 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule544 = \ from_ ident_ to_ ->
                            {-# LINE 436 "src-ag/ExecutionPlan2Caml.ag" #-}
                            (ident_, from_, to_)
                            {-# LINE 4507 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule545 #-}
   {-# LINE 539 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule545 = \ ((_lhsInt) :: NontermIdent) ident_ ->
                          {-# LINE 539 "src-ag/ExecutionPlan2Caml.ag" #-}
                          conNmTVisitIn _lhsInt ident_
                          {-# LINE 4513 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule546 #-}
   {-# LINE 540 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule546 = \ ((_lhsInt) :: NontermIdent) ident_ ->
                          {-# LINE 540 "src-ag/ExecutionPlan2Caml.ag" #-}
                          conNmTVisitOut _lhsInt ident_
                          {-# LINE 4519 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule547 #-}
   {-# LINE 541 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule547 = \ ((_lhsInt) :: NontermIdent) to_ ->
                           {-# LINE 541 "src-ag/ExecutionPlan2Caml.ag" #-}
                           type_nt_sem _lhsInt to_
                           {-# LINE 4525 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule548 #-}
   {-# LINE 542 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule548 = \ ((_lhsInt) :: NontermIdent) ident_ ->
                           {-# LINE 542 "src-ag/ExecutionPlan2Caml.ag" #-}
                           type_caller_visit _lhsInt ident_
                           {-# LINE 4531 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule549 #-}
   {-# LINE 544 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule549 = \ ((_lhsInextVisits) :: Map StateIdentifier StateCtx) to_ ->
                          {-# LINE 544 "src-ag/ExecutionPlan2Caml.ag" #-}
                          Map.findWithDefault ManyVis to_ _lhsInextVisits
                          {-# LINE 4537 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule550 #-}
   {-# LINE 546 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule550 = \ ((_lhsIparams) :: [Identifier]) ->
                    {-# LINE 546 "src-ag/ExecutionPlan2Caml.ag" #-}
                    ppTypeParams _lhsIparams
                    {-# LINE 4543 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule551 #-}
   {-# LINE 547 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule551 = \ ((_lhsIparams) :: [Identifier]) ->
                     {-# LINE 547 "src-ag/ExecutionPlan2Caml.ag" #-}
                     ppTypeParams (cont_tvar : map pp _lhsIparams)
                     {-# LINE 4549 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule552 #-}
   {-# LINE 551 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule552 = \ _contpart _inhpart ((_lhsInt) :: NontermIdent) _nameCaller_visit _nameTIn_visit _nameTOut_visit _synpart _t_c_params _t_params ident_ ->
                    {-# LINE 551 "src-ag/ExecutionPlan2Caml.ag" #-}
                    "and" >#< _t_c_params     >#< _nameCaller_visit     >#< "=" >#< ppRecordTp
                      [ nm_inh _lhsInt ident_ >#< ":" >#< _t_params     >#< conNmTVisitIn _lhsInt ident_
                      , nm_cont _lhsInt ident_ >#< ":" >#< _t_params     >#< conNmTVisitOut _lhsInt ident_ >#< "->" >#< cont_tvar
                      ]
                    >-< "and" >#< _t_params     >#< _nameTIn_visit      >#< "=" >#< ppRecordTp _inhpart
                    >-< "and" >#< _t_params     >#< _nameTOut_visit     >#< "=" >#< ppRecordTp (_synpart     ++ _contpart    )
                    {-# LINE 4560 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule553 #-}
   {-# LINE 558 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule553 = \ ((_lhsInt) :: NontermIdent) _nameNextState _nextVisitInfo _t_params ident_ ->
                   {-# LINE 558 "src-ag/ExecutionPlan2Caml.ag" #-}
                   case _nextVisitInfo     of
                     NoneVis -> []
                     _       -> [ nm_outarg_cont _lhsInt ident_ >#< ":" >#< _t_params     >#< _nameNextState     ]
                   {-# LINE 4568 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule554 #-}
   {-# LINE 562 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule554 = \ ((_lhsIinhmap) :: Attributes) _ppTypeList inh_ ->
                    {-# LINE 562 "src-ag/ExecutionPlan2Caml.ag" #-}
                    _ppTypeList     nm_inarg inh_ _lhsIinhmap
                    {-# LINE 4574 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule555 #-}
   {-# LINE 563 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule555 = \ ((_lhsIsynmap) :: Attributes) _ppTypeList syn_ ->
                    {-# LINE 563 "src-ag/ExecutionPlan2Caml.ag" #-}
                    _ppTypeList     nm_outarg syn_ _lhsIsynmap
                    {-# LINE 4580 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule556 #-}
   {-# LINE 564 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule556 = \ ((_lhsInt) :: NontermIdent) ident_ ->
                     {-# LINE 564 "src-ag/ExecutionPlan2Caml.ag" #-}
                     \f s m -> map (\i -> case Map.lookup i m of
                                            Just tp -> f i _lhsInt ident_ >#< ":" >#< ppTp tp ) $ Set.toList s
                     {-# LINE 4587 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule557 #-}
   {-# LINE 798 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule557 = \ ((_lhsIoptions) :: Options) ->
                 {-# LINE 798 "src-ag/ExecutionPlan2Caml.ag" #-}
                 typeSigs _lhsIoptions
                 {-# LINE 4593 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule558 #-}
   {-# LINE 799 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule558 = \ ((_lhsInt) :: NontermIdent) ((_lhsIoptions) :: Options) _nameTIn_visit _nameTOut_visit _o_sigs ((_stepsIsem_steps) :: PP_Doc) _t_params from_ ident_ inh_ ->
                    {-# LINE 799 "src-ag/ExecutionPlan2Caml.ag" #-}
                    ( from_
                    , let resTp = _t_params     >#< _nameTOut_visit
                          argTp = _t_params     >#< _nameTIn_visit
                          argMatch = ppRecordVal [ nm_inarg i _lhsInt ident_ >#< "=" >#< lhsname _lhsIoptions True i | i <- Set.toList inh_ ]
                      in ppFunDecl _o_sigs     (nm_visit ident_) [(argMatch, argTp)] resTp _stepsIsem_steps
                    )
                    {-# LINE 4604 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule559 #-}
   {-# LINE 806 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule559 = \ _nextStBuild _resultval ->
                     {-# LINE 806 "src-ag/ExecutionPlan2Caml.ag" #-}
                     _nextStBuild     >-< _resultval
                     {-# LINE 4610 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule560 #-}
   {-# LINE 808 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule560 = \ ((_lhsIallintramap) :: Map StateIdentifier (Map String (Maybe NonLocalAttr))) to_ ->
                     {-# LINE 808 "src-ag/ExecutionPlan2Caml.ag" #-}
                     maybe Map.empty id $ Map.lookup to_ _lhsIallintramap
                     {-# LINE 4616 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule561 #-}
   {-# LINE 809 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule561 = \ _nextArgsMp ->
                     {-# LINE 809 "src-ag/ExecutionPlan2Caml.ag" #-}
                     ppSpaced $ Map.keys $ _nextArgsMp
                     {-# LINE 4622 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule562 #-}
   {-# LINE 810 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule562 = \ ((_lhsIoptions) :: Options) _nextArgs _nextArgsMp to_ ->
                     {-# LINE 810 "src-ag/ExecutionPlan2Caml.ag" #-}
                     nm_st to_ >#< _nextArgs     >#< dummyArg _lhsIoptions (Map.null _nextArgsMp    )
                     {-# LINE 4628 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule563 #-}
   {-# LINE 812 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule563 = \ ((_lhsInt) :: NontermIdent) ((_lhsIoptions) :: Options) _nextStRefExp ident_ syn_ ->
                    {-# LINE 812 "src-ag/ExecutionPlan2Caml.ag" #-}
                    ppRecordVal
                      (  [ nm_outarg i _lhsInt ident_ >#< "=" >#< lhsname _lhsIoptions False i | i <- Set.toList syn_ ]
                      ++ [ _nextStRefExp     ])
                    {-# LINE 4636 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule564 #-}
   {-# LINE 817 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule564 = \ ((_lhsInt) :: NontermIdent) _nextStExp _nextVisitInfo ident_ ->
         {-# LINE 817 "src-ag/ExecutionPlan2Caml.ag" #-}
         case _nextVisitInfo     of
           NoneVis  -> (empty, empty)
           _        -> ( "let" >#< nextStName >#< "=" >#< _nextStExp     >#< "in"
                       , nm_outarg_cont _lhsInt ident_ >#< "=" >#< nextStName)
         {-# LINE 4645 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule565 #-}
   {-# LINE 832 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule565 = \ kind_ ->
                                  {-# LINE 832 "src-ag/ExecutionPlan2Caml.ag" #-}
                                  kind_
                                  {-# LINE 4651 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule566 #-}
   {-# LINE 884 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule566 = \  (_ :: ()) ->
                                     {-# LINE 884 "src-ag/ExecutionPlan2Caml.ag" #-}
                                     0
                                     {-# LINE 4657 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule567 #-}
   {-# LINE 891 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule567 = \  (_ :: ()) ->
                                              {-# LINE 891 "src-ag/ExecutionPlan2Caml.ag" #-}
                                              0
                                              {-# LINE 4663 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule568 #-}
   {-# LINE 908 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule568 = \  (_ :: ()) ->
                                           {-# LINE 908 "src-ag/ExecutionPlan2Caml.ag" #-}
                                           False
                                           {-# LINE 4669 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule569 #-}
   {-# LINE 1165 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule569 = \ ((_lhsInextVisits) :: Map StateIdentifier StateCtx) from_ ->
                        {-# LINE 1165 "src-ag/ExecutionPlan2Caml.ag" #-}
                        Map.findWithDefault ManyVis from_ _lhsInextVisits
                        {-# LINE 4675 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule570 #-}
   {-# LINE 1166 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule570 = \ _invokecode ident_ ->
                     {-# LINE 1166 "src-ag/ExecutionPlan2Caml.ag" #-}
                     Map.singleton ident_ _invokecode
                     {-# LINE 4681 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule571 #-}
   {-# LINE 1168 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule571 = \ ((_lhsInt) :: NontermIdent) ((_lhsIoptions) :: Options) _nameTOut_visit _nextVisitInfo _o_sigs _prevVisitInfo from_ ident_ inh_ kind_ syn_ to_ ->
        {-# LINE 1168 "src-ag/ExecutionPlan2Caml.ag" #-}
        \chld childTp kind follow ->
          let code = cont >-< inps >-< call
              childNmTo   = text $ stname chld to_
              childNmFrom = text $ stname chld from_
              childTpArgs = case childTp of
                              NT _ args _ -> args
                              _           -> error "generate visit call: type of the child is not a nonterminal!"
              cont = "let" >#< contNm >#< ppArg _o_sigs     (ppRecordVal cont_in) cont_in_tp >#< "="
                     >-< indent 2 follow
                     >#< "in"
              cont_in = [ nm_outarg i _lhsInt ident_ >#< "=" >#< attrname _lhsIoptions True chld i | i <- Set.toList syn_ ]
                        ++ case _nextVisitInfo     of
                             NoneVis -> []
                             _       -> [ nm_outarg_cont _lhsInt ident_ >#< "=" >#< childNmTo ]
              cont_in_tp = ppTypeParams childTpArgs >#< _nameTOut_visit
              inps = "let" >#< inpsNm >#< "=" >#< ppRecordVal
                       [ nm_inh _lhsInt ident_ >#< "=" >#< ppRecordVal inps_in
                       , nm_cont _lhsInt ident_ >#< "=" >#< contNm
                       ] >#< "in"
              inps_in = [ nm_inarg i _lhsInt ident_ >#< "=" >#< attrname _lhsIoptions False chld i | i <- Set.toList inh_ ]
              call = childNmFrom >|< "." >|< nm_invoke _lhsInt from_ >#< arg
              arg = case _prevVisitInfo     of
                      NoneVis  -> error "error: invocation of a visit from a state that has no next visits"
                      OneVis _ -> pp inpsNm
                      ManyVis  -> pp_parens (con_visit _lhsInt ident_ >#< inpsNm)
          in if kind `compatibleKind` kind_
             then Right code
             else Left $ IncompatibleVisitKind chld ident_ kind kind_
        {-# LINE 4714 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule572 #-}
   {-# LINE 1273 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule572 = \ _defsAsMap _nextintra _uses ->
                            {-# LINE 1273 "src-ag/ExecutionPlan2Caml.ag" #-}
                            (_uses     `Map.union` _nextintra    ) `Map.difference` _defsAsMap
                            {-# LINE 4720 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule573 #-}
   {-# LINE 1274 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule573 = \ _thisintra from_ ->
                            {-# LINE 1274 "src-ag/ExecutionPlan2Caml.ag" #-}
                            Map.singleton from_ _thisintra
                            {-# LINE 4726 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule574 #-}
   {-# LINE 1275 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule574 = \ ((_lhsIallintramap) :: Map StateIdentifier (Map String (Maybe NonLocalAttr))) to_ ->
                            {-# LINE 1275 "src-ag/ExecutionPlan2Caml.ag" #-}
                            maybe Map.empty id $ Map.lookup to_ _lhsIallintramap
                            {-# LINE 4732 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule575 #-}
   {-# LINE 1276 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule575 = \ ((_lhsIoptions) :: Options) ((_stepsIuses) :: Map String (Maybe NonLocalAttr)) syn_ ->
                            {-# LINE 1276 "src-ag/ExecutionPlan2Caml.ag" #-}
                            let mp1 = _stepsIuses
                                mp2 = Map.fromList [ (lhsname _lhsIoptions False i, Just (AttrSyn _LHS i)) | i <- Set.elems syn_ ]
                            in mp1 `Map.union` mp2
                            {-# LINE 4740 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule576 #-}
   {-# LINE 1279 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule576 = \ ((_lhsIoptions) :: Options) inh_ ->
                            {-# LINE 1279 "src-ag/ExecutionPlan2Caml.ag" #-}
                            Set.map (lhsname _lhsIoptions True) inh_
                            {-# LINE 4746 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule577 #-}
   {-# LINE 1280 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule577 = \ _inhVarNms ((_lhsIterminaldefs) :: Set String) ((_stepsIdefs) :: Set String) ->
                            {-# LINE 1280 "src-ag/ExecutionPlan2Caml.ag" #-}
                            _stepsIdefs `Set.union` _inhVarNms     `Set.union` _lhsIterminaldefs
                            {-# LINE 4752 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule578 #-}
   {-# LINE 1281 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule578 = \ _defs ->
                            {-# LINE 1281 "src-ag/ExecutionPlan2Caml.ag" #-}
                            Map.fromList [ (a, Nothing) | a <- Set.elems _defs     ]
                            {-# LINE 4758 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule579 #-}
   {-# LINE 1305 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule579 = \ ident_ syn_ ->
                            {-# LINE 1305 "src-ag/ExecutionPlan2Caml.ag" #-}
                            Map.singleton ident_ syn_
                            {-# LINE 4764 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule580 #-}
   {-# LINE 1306 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule580 = \ ident_ inh_ ->
                            {-# LINE 1306 "src-ag/ExecutionPlan2Caml.ag" #-}
                            Map.singleton ident_ inh_
                            {-# LINE 4770 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule581 #-}
   {-# LINE 1338 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule581 = \ _inhVarNms ((_stepsIdefs) :: Set String) kind_ ->
                        {-# LINE 1338 "src-ag/ExecutionPlan2Caml.ag" #-}
                        case kind_ of
                          VisitPure False -> _inhVarNms     `Set.union` _stepsIdefs
                          _               -> Set.empty
                        {-# LINE 4778 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule582 #-}
   {-# LINE 1341 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule582 = \ _lazyIntrasInh ((_stepsIlazyIntras) :: Set String) ->
                     {-# LINE 1341 "src-ag/ExecutionPlan2Caml.ag" #-}
                     _lazyIntrasInh     `Set.union` _stepsIlazyIntras
                     {-# LINE 4784 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule583 #-}
   {-# LINE 1404 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule583 = \ from_ ident_ to_ ->
                       {-# LINE 1404 "src-ag/ExecutionPlan2Caml.ag" #-}
                       Map.singleton ident_ (from_, to_)
                       {-# LINE 4790 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule584 #-}
   {-# LINE 1448 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule584 = \ ident_ kind_ ->
                     {-# LINE 1448 "src-ag/ExecutionPlan2Caml.ag" #-}
                     Map.singleton ident_ kind_
                     {-# LINE 4796 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule585 #-}
   rule585 = \ ((_stepsIerrors) :: Seq Error) ->
     _stepsIerrors
   {-# INLINE rule586 #-}
   rule586 = \ ((_stepsIruleKinds) :: Map Identifier (Set VisitKind)) ->
     _stepsIruleKinds
   {-# INLINE rule587 #-}
   rule587 = \ ((_stepsIruleUsage) :: Map Identifier Int) ->
     _stepsIruleUsage
   {-# INLINE rule588 #-}
   rule588 = \ ((_lhsIallFromToStates) :: Map VisitIdentifier (Int,Int)) ->
     _lhsIallFromToStates
   {-# INLINE rule589 #-}
   rule589 = \ ((_lhsIallInitStates) :: Map NontermIdent Int) ->
     _lhsIallInitStates
   {-# INLINE rule590 #-}
   rule590 = \ ((_lhsIallVisitKinds) :: Map VisitIdentifier VisitKind) ->
     _lhsIallVisitKinds
   {-# INLINE rule591 #-}
   rule591 = \ ((_lhsIallchildvisit) :: Map VisitIdentifier (Identifier -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)) ->
     _lhsIallchildvisit
   {-# INLINE rule592 #-}
   rule592 = \ ((_lhsIavisitdefs) :: Map VisitIdentifier (Set Identifier)) ->
     _lhsIavisitdefs
   {-# INLINE rule593 #-}
   rule593 = \ ((_lhsIavisituses) :: Map VisitIdentifier (Set Identifier)) ->
     _lhsIavisituses
   {-# INLINE rule594 #-}
   rule594 = \ ((_lhsIchildTypes) :: Map Identifier Type) ->
     _lhsIchildTypes
   {-# INLINE rule595 #-}
   rule595 = \ ((_lhsIchildintros) :: Map Identifier (VisitKind -> Either Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))) ->
     _lhsIchildintros
   {-# INLINE rule596 #-}
   rule596 = \ ((_lhsImrules) :: Map Identifier (VisitKind ->  Either Error PP_Doc)) ->
     _lhsImrules
   {-# INLINE rule597 #-}
   rule597 = \ ((_lhsIoptions) :: Options) ->
     _lhsIoptions
   {-# INLINE rule598 #-}
   rule598 = \ ((_lhsIruledefs) :: Map Identifier (Set String)) ->
     _lhsIruledefs
   {-# INLINE rule599 #-}
   rule599 = \ ((_lhsIruleuses) :: Map Identifier (Map String (Maybe NonLocalAttr))) ->
     _lhsIruleuses

-- VisitStep ---------------------------------------------------
-- wrapper
data Inh_VisitStep  = Inh_VisitStep { Inh_VisitStep -> Map Int (Int, Int)
allFromToStates_Inh_VisitStep :: (Map VisitIdentifier (Int,Int)), Inh_VisitStep -> Map NontermIdent Int
allInitStates_Inh_VisitStep :: (Map NontermIdent Int), Inh_VisitStep -> Map Int VisitKind
allVisitKinds_Inh_VisitStep :: (Map VisitIdentifier VisitKind), Inh_VisitStep
-> Map
     Int
     (NontermIdent
      -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
allchildvisit_Inh_VisitStep :: (Map VisitIdentifier (Identifier -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)), Inh_VisitStep -> Map Int (Set NontermIdent)
avisitdefs_Inh_VisitStep :: (Map VisitIdentifier (Set Identifier)), Inh_VisitStep -> Map Int (Set NontermIdent)
avisituses_Inh_VisitStep :: (Map VisitIdentifier (Set Identifier)), Inh_VisitStep -> Attributes
childTypes_Inh_VisitStep :: (Map Identifier Type), Inh_VisitStep
-> Map
     NontermIdent
     (VisitKind
      -> Either
           Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
childintros_Inh_VisitStep :: (Map Identifier (VisitKind -> Either Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))), Inh_VisitStep -> PP_Doc
follow_Inh_VisitStep :: (PP_Doc), Inh_VisitStep -> Int
index_Inh_VisitStep :: (Int), Inh_VisitStep -> Bool
isLast_Inh_VisitStep :: (Bool), Inh_VisitStep -> VisitKind
kind_Inh_VisitStep :: (VisitKind), Inh_VisitStep
-> Map NontermIdent (VisitKind -> Either Error PP_Doc)
mrules_Inh_VisitStep :: (Map Identifier (VisitKind ->  Either Error PP_Doc)), Inh_VisitStep -> Options
options_Inh_VisitStep :: (Options), Inh_VisitStep -> Int
prevMaxSimRefs_Inh_VisitStep :: (Int), Inh_VisitStep -> Map NontermIdent (Set String)
ruledefs_Inh_VisitStep :: (Map Identifier (Set String)), Inh_VisitStep -> Map NontermIdent (Map String (Maybe NonLocalAttr))
ruleuses_Inh_VisitStep :: (Map Identifier (Map String (Maybe NonLocalAttr))), Inh_VisitStep -> Bool
useParallel_Inh_VisitStep :: (Bool) }
data Syn_VisitStep  = Syn_VisitStep { Syn_VisitStep -> Set String
defs_Syn_VisitStep :: (Set String), Syn_VisitStep -> Seq Error
errors_Syn_VisitStep :: (Seq Error), Syn_VisitStep -> Int
index_Syn_VisitStep :: (Int), Syn_VisitStep -> Bool
isLast_Syn_VisitStep :: (Bool), Syn_VisitStep -> Set String
lazyIntras_Syn_VisitStep :: (Set String), Syn_VisitStep -> Int
prevMaxSimRefs_Syn_VisitStep :: (Int), Syn_VisitStep -> Map NontermIdent (Set VisitKind)
ruleKinds_Syn_VisitStep :: (Map Identifier (Set VisitKind)), Syn_VisitStep -> Map NontermIdent Int
ruleUsage_Syn_VisitStep :: (Map Identifier Int), Syn_VisitStep -> PP_Doc
sem_steps_Syn_VisitStep :: (PP_Doc), Syn_VisitStep -> Map String (Maybe NonLocalAttr)
uses_Syn_VisitStep :: (Map String (Maybe NonLocalAttr)), Syn_VisitStep -> Map Int VisitKind
visitKinds_Syn_VisitStep :: (Map VisitIdentifier VisitKind) }
{-# INLINABLE wrap_VisitStep #-}
wrap_VisitStep :: T_VisitStep  -> Inh_VisitStep  -> (Syn_VisitStep )
wrap_VisitStep :: T_VisitStep -> Inh_VisitStep -> Syn_VisitStep
wrap_VisitStep (T_VisitStep Identity T_VisitStep_s50
act) (Inh_VisitStep Map Int (Int, Int)
_lhsIallFromToStates Map NontermIdent Int
_lhsIallInitStates Map Int VisitKind
_lhsIallVisitKinds Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_lhsIallchildvisit Map Int (Set NontermIdent)
_lhsIavisitdefs Map Int (Set NontermIdent)
_lhsIavisituses Attributes
_lhsIchildTypes Map
  NontermIdent
  (VisitKind
   -> Either
        Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
_lhsIchildintros PP_Doc
_lhsIfollow Int
_lhsIindex Bool
_lhsIisLast VisitKind
_lhsIkind Map NontermIdent (VisitKind -> Either Error PP_Doc)
_lhsImrules Options
_lhsIoptions Int
_lhsIprevMaxSimRefs Map NontermIdent (Set String)
_lhsIruledefs Map NontermIdent (Map String (Maybe NonLocalAttr))
_lhsIruleuses Bool
_lhsIuseParallel) =
   forall a. Identity a -> a
Control.Monad.Identity.runIdentity (
     do T_VisitStep_s50
sem <- Identity T_VisitStep_s50
act
        let arg49 :: T_VisitStep_vIn49
arg49 = Map Int (Int, Int)
-> Map NontermIdent Int
-> Map Int VisitKind
-> Map
     Int
     (NontermIdent
      -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
-> Map Int (Set NontermIdent)
-> Map Int (Set NontermIdent)
-> Attributes
-> Map
     NontermIdent
     (VisitKind
      -> Either
           Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
-> PP_Doc
-> Int
-> Bool
-> VisitKind
-> Map NontermIdent (VisitKind -> Either Error PP_Doc)
-> Options
-> Int
-> Map NontermIdent (Set String)
-> Map NontermIdent (Map String (Maybe NonLocalAttr))
-> Bool
-> T_VisitStep_vIn49
T_VisitStep_vIn49 Map Int (Int, Int)
_lhsIallFromToStates Map NontermIdent Int
_lhsIallInitStates Map Int VisitKind
_lhsIallVisitKinds Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_lhsIallchildvisit Map Int (Set NontermIdent)
_lhsIavisitdefs Map Int (Set NontermIdent)
_lhsIavisituses Attributes
_lhsIchildTypes Map
  NontermIdent
  (VisitKind
   -> Either
        Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
_lhsIchildintros PP_Doc
_lhsIfollow Int
_lhsIindex Bool
_lhsIisLast VisitKind
_lhsIkind Map NontermIdent (VisitKind -> Either Error PP_Doc)
_lhsImrules Options
_lhsIoptions Int
_lhsIprevMaxSimRefs Map NontermIdent (Set String)
_lhsIruledefs Map NontermIdent (Map String (Maybe NonLocalAttr))
_lhsIruleuses Bool
_lhsIuseParallel
        (T_VisitStep_vOut49 Set String
_lhsOdefs Seq Error
_lhsOerrors Int
_lhsOindex Bool
_lhsOisLast Set String
_lhsOlazyIntras Int
_lhsOprevMaxSimRefs Map NontermIdent (Set VisitKind)
_lhsOruleKinds Map NontermIdent Int
_lhsOruleUsage PP_Doc
_lhsOsem_steps Map String (Maybe NonLocalAttr)
_lhsOuses Map Int VisitKind
_lhsOvisitKinds) <- forall (m :: * -> *) a. Monad m => a -> m a
return (T_VisitStep_s50 -> T_VisitStep_v49
inv_VisitStep_s50 T_VisitStep_s50
sem T_VisitStep_vIn49
arg49)
        forall (m :: * -> *) a. Monad m => a -> m a
return (Set String
-> Seq Error
-> Int
-> Bool
-> Set String
-> Int
-> Map NontermIdent (Set VisitKind)
-> Map NontermIdent Int
-> PP_Doc
-> Map String (Maybe NonLocalAttr)
-> Map Int VisitKind
-> Syn_VisitStep
Syn_VisitStep Set String
_lhsOdefs Seq Error
_lhsOerrors Int
_lhsOindex Bool
_lhsOisLast Set String
_lhsOlazyIntras Int
_lhsOprevMaxSimRefs Map NontermIdent (Set VisitKind)
_lhsOruleKinds Map NontermIdent Int
_lhsOruleUsage PP_Doc
_lhsOsem_steps Map String (Maybe NonLocalAttr)
_lhsOuses Map Int VisitKind
_lhsOvisitKinds)
   )

-- cata
{-# NOINLINE sem_VisitStep #-}
sem_VisitStep :: VisitStep  -> T_VisitStep 
sem_VisitStep :: VisitStep -> T_VisitStep
sem_VisitStep ( Sem NontermIdent
name_ ) = NontermIdent -> T_VisitStep
sem_VisitStep_Sem NontermIdent
name_
sem_VisitStep ( ChildVisit NontermIdent
child_ NontermIdent
nonterm_ Int
visit_ ) = NontermIdent -> NontermIdent -> Int -> T_VisitStep
sem_VisitStep_ChildVisit NontermIdent
child_ NontermIdent
nonterm_ Int
visit_
sem_VisitStep ( PureGroup VisitSteps
steps_ Bool
ordered_ ) = T_VisitSteps -> Bool -> T_VisitStep
sem_VisitStep_PureGroup ( VisitSteps -> T_VisitSteps
sem_VisitSteps VisitSteps
steps_ ) Bool
ordered_
sem_VisitStep ( Sim VisitSteps
steps_ ) = T_VisitSteps -> T_VisitStep
sem_VisitStep_Sim ( VisitSteps -> T_VisitSteps
sem_VisitSteps VisitSteps
steps_ )
sem_VisitStep ( ChildIntro NontermIdent
child_ ) = NontermIdent -> T_VisitStep
sem_VisitStep_ChildIntro NontermIdent
child_

-- semantic domain
newtype T_VisitStep  = T_VisitStep {
                                   T_VisitStep -> Identity T_VisitStep_s50
attach_T_VisitStep :: Identity (T_VisitStep_s50 )
                                   }
newtype T_VisitStep_s50  = C_VisitStep_s50 {
                                           T_VisitStep_s50 -> T_VisitStep_v49
inv_VisitStep_s50 :: (T_VisitStep_v49 )
                                           }
data T_VisitStep_s51  = C_VisitStep_s51
type T_VisitStep_v49  = (T_VisitStep_vIn49 ) -> (T_VisitStep_vOut49 )
data T_VisitStep_vIn49  = T_VisitStep_vIn49 (Map VisitIdentifier (Int,Int)) (Map NontermIdent Int) (Map VisitIdentifier VisitKind) (Map VisitIdentifier (Identifier -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)) (Map VisitIdentifier (Set Identifier)) (Map VisitIdentifier (Set Identifier)) (Map Identifier Type) (Map Identifier (VisitKind -> Either Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))) (PP_Doc) (Int) (Bool) (VisitKind) (Map Identifier (VisitKind ->  Either Error PP_Doc)) (Options) (Int) (Map Identifier (Set String)) (Map Identifier (Map String (Maybe NonLocalAttr))) (Bool)
data T_VisitStep_vOut49  = T_VisitStep_vOut49 (Set String) (Seq Error) (Int) (Bool) (Set String) (Int) (Map Identifier (Set VisitKind)) (Map Identifier Int) (PP_Doc) (Map String (Maybe NonLocalAttr)) (Map VisitIdentifier VisitKind)
{-# NOINLINE sem_VisitStep_Sem #-}
sem_VisitStep_Sem :: (Identifier) -> T_VisitStep 
sem_VisitStep_Sem :: NontermIdent -> T_VisitStep
sem_VisitStep_Sem NontermIdent
arg_name_ = Identity T_VisitStep_s50 -> T_VisitStep
T_VisitStep (forall (m :: * -> *) a. Monad m => a -> m a
return T_VisitStep_s50
st50) where
   {-# NOINLINE st50 #-}
   st50 :: T_VisitStep_s50
st50 = let
      v49 :: T_VisitStep_v49 
      v49 :: T_VisitStep_v49
v49 = \ (T_VisitStep_vIn49 Map Int (Int, Int)
_lhsIallFromToStates Map NontermIdent Int
_lhsIallInitStates Map Int VisitKind
_lhsIallVisitKinds Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_lhsIallchildvisit Map Int (Set NontermIdent)
_lhsIavisitdefs Map Int (Set NontermIdent)
_lhsIavisituses Attributes
_lhsIchildTypes Map
  NontermIdent
  (VisitKind
   -> Either
        Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
_lhsIchildintros PP_Doc
_lhsIfollow Int
_lhsIindex Bool
_lhsIisLast VisitKind
_lhsIkind Map NontermIdent (VisitKind -> Either Error PP_Doc)
_lhsImrules Options
_lhsIoptions Int
_lhsIprevMaxSimRefs Map NontermIdent (Set String)
_lhsIruledefs Map NontermIdent (Map String (Maybe NonLocalAttr))
_lhsIruleuses Bool
_lhsIuseParallel) -> ( let
         _ruleItf :: VisitKind -> Either Error PP_Doc
_ruleItf = Map NontermIdent (VisitKind -> Either Error PP_Doc)
-> NontermIdent -> VisitKind -> Either Error PP_Doc
rule600 Map NontermIdent (VisitKind -> Either Error PP_Doc)
_lhsImrules NontermIdent
arg_name_
         _lhsOerrors :: Seq Error
         (Seq Error
_lhsOerrors,PP_Doc
_sem_steps) = forall {a}.
VisitKind -> (VisitKind -> Either a PP_Doc) -> (Seq a, PP_Doc)
rule601 VisitKind
_lhsIkind VisitKind -> Either Error PP_Doc
_ruleItf
         _lhsOsem_steps :: PP_Doc
         _lhsOsem_steps :: PP_Doc
_lhsOsem_steps = PP_Doc -> PP_Doc -> PP_Doc
rule602 PP_Doc
_lhsIfollow PP_Doc
_sem_steps
         _lhsOruleUsage :: Map Identifier Int
         _lhsOruleUsage :: Map NontermIdent Int
_lhsOruleUsage = forall {k}. k -> Map k Int
rule603 NontermIdent
arg_name_
         _lhsOruleKinds :: Map Identifier (Set VisitKind)
         _lhsOruleKinds :: Map NontermIdent (Set VisitKind)
_lhsOruleKinds = forall {k}. VisitKind -> k -> Map k (Set VisitKind)
rule604 VisitKind
_lhsIkind NontermIdent
arg_name_
         _lhsOdefs :: Set String
         _lhsOdefs :: Set String
_lhsOdefs = Map NontermIdent (Set String) -> NontermIdent -> Set String
rule605 Map NontermIdent (Set String)
_lhsIruledefs NontermIdent
arg_name_
         _lhsOuses :: Map String (Maybe NonLocalAttr)
         _lhsOuses :: Map String (Maybe NonLocalAttr)
_lhsOuses = Map NontermIdent (Map String (Maybe NonLocalAttr))
-> NontermIdent -> Map String (Maybe NonLocalAttr)
rule606 Map NontermIdent (Map String (Maybe NonLocalAttr))
_lhsIruleuses NontermIdent
arg_name_
         _lhsOlazyIntras :: Set String
         _lhsOlazyIntras :: Set String
_lhsOlazyIntras = forall {a}. () -> Set a
rule607  ()
         _lhsOvisitKinds :: Map VisitIdentifier VisitKind
         _lhsOvisitKinds :: Map Int VisitKind
_lhsOvisitKinds = () -> Map Int VisitKind
rule608  ()
         _lhsOindex :: Int
         _lhsOindex :: Int
_lhsOindex = Int -> Int
rule609 Int
_lhsIindex
         _lhsOisLast :: Bool
         _lhsOisLast :: Bool
_lhsOisLast = Bool -> Bool
rule610 Bool
_lhsIisLast
         _lhsOprevMaxSimRefs :: Int
         _lhsOprevMaxSimRefs :: Int
_lhsOprevMaxSimRefs = Int -> Int
rule611 Int
_lhsIprevMaxSimRefs
         __result_ :: T_VisitStep_vOut49
__result_ = Set String
-> Seq Error
-> Int
-> Bool
-> Set String
-> Int
-> Map NontermIdent (Set VisitKind)
-> Map NontermIdent Int
-> PP_Doc
-> Map String (Maybe NonLocalAttr)
-> Map Int VisitKind
-> T_VisitStep_vOut49
T_VisitStep_vOut49 Set String
_lhsOdefs Seq Error
_lhsOerrors Int
_lhsOindex Bool
_lhsOisLast Set String
_lhsOlazyIntras Int
_lhsOprevMaxSimRefs Map NontermIdent (Set VisitKind)
_lhsOruleKinds Map NontermIdent Int
_lhsOruleUsage PP_Doc
_lhsOsem_steps Map String (Maybe NonLocalAttr)
_lhsOuses Map Int VisitKind
_lhsOvisitKinds
         in T_VisitStep_vOut49
__result_ )
     in T_VisitStep_v49 -> T_VisitStep_s50
C_VisitStep_s50 T_VisitStep_v49
v49
   {-# INLINE rule600 #-}
   {-# LINE 849 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule600 = \ ((_lhsImrules) :: Map Identifier (VisitKind ->  Either Error PP_Doc)) name_ ->
                               {-# LINE 849 "src-ag/ExecutionPlan2Caml.ag" #-}
                               Map.findWithDefault (error $ "Rule "  ++ show name_  ++ " not found") name_ _lhsImrules
                               {-# LINE 4915 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule601 #-}
   {-# LINE 850 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule601 = \ ((_lhsIkind) :: VisitKind) _ruleItf ->
                                               {-# LINE 850 "src-ag/ExecutionPlan2Caml.ag" #-}
                                               case _ruleItf     _lhsIkind of
                                                 Left e     -> (Seq.singleton e, empty)
                                                 Right stmt -> (Seq.empty, stmt)
                                               {-# LINE 4923 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule602 #-}
   {-# LINE 853 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule602 = \ ((_lhsIfollow) :: PP_Doc) _sem_steps ->
                                 {-# LINE 853 "src-ag/ExecutionPlan2Caml.ag" #-}
                                 _sem_steps     >-< _lhsIfollow
                                 {-# LINE 4929 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule603 #-}
   {-# LINE 1226 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule603 = \ name_ ->
                                                 {-# LINE 1226 "src-ag/ExecutionPlan2Caml.ag" #-}
                                                 Map.singleton name_ 1
                                                 {-# LINE 4935 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule604 #-}
   {-# LINE 1236 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule604 = \ ((_lhsIkind) :: VisitKind) name_ ->
                    {-# LINE 1236 "src-ag/ExecutionPlan2Caml.ag" #-}
                    Map.singleton name_ (Set.singleton _lhsIkind)
                    {-# LINE 4941 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule605 #-}
   {-# LINE 1321 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule605 = \ ((_lhsIruledefs) :: Map Identifier (Set String)) name_ ->
                            {-# LINE 1321 "src-ag/ExecutionPlan2Caml.ag" #-}
                            maybe (error "Rule not found") id $ Map.lookup name_ _lhsIruledefs
                            {-# LINE 4947 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule606 #-}
   {-# LINE 1322 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule606 = \ ((_lhsIruleuses) :: Map Identifier (Map String (Maybe NonLocalAttr))) name_ ->
                            {-# LINE 1322 "src-ag/ExecutionPlan2Caml.ag" #-}
                            maybe (error "Rule not found") id $ Map.lookup name_ _lhsIruleuses
                            {-# LINE 4953 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule607 #-}
   rule607 = \  (_ :: ()) ->
     Set.empty
   {-# INLINE rule608 #-}
   rule608 = \  (_ :: ()) ->
     mempty
   {-# INLINE rule609 #-}
   rule609 = \ ((_lhsIindex) :: Int) ->
     _lhsIindex
   {-# INLINE rule610 #-}
   rule610 = \ ((_lhsIisLast) :: Bool) ->
     _lhsIisLast
   {-# INLINE rule611 #-}
   rule611 = \ ((_lhsIprevMaxSimRefs) :: Int) ->
     _lhsIprevMaxSimRefs
{-# NOINLINE sem_VisitStep_ChildVisit #-}
sem_VisitStep_ChildVisit :: (Identifier) -> (NontermIdent) -> (VisitIdentifier) -> T_VisitStep 
sem_VisitStep_ChildVisit :: NontermIdent -> NontermIdent -> Int -> T_VisitStep
sem_VisitStep_ChildVisit NontermIdent
arg_child_ NontermIdent
_ Int
arg_visit_ = Identity T_VisitStep_s50 -> T_VisitStep
T_VisitStep (forall (m :: * -> *) a. Monad m => a -> m a
return T_VisitStep_s50
st50) where
   {-# NOINLINE st50 #-}
   st50 :: T_VisitStep_s50
st50 = let
      v49 :: T_VisitStep_v49 
      v49 :: T_VisitStep_v49
v49 = \ (T_VisitStep_vIn49 Map Int (Int, Int)
_lhsIallFromToStates Map NontermIdent Int
_lhsIallInitStates Map Int VisitKind
_lhsIallVisitKinds Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_lhsIallchildvisit Map Int (Set NontermIdent)
_lhsIavisitdefs Map Int (Set NontermIdent)
_lhsIavisituses Attributes
_lhsIchildTypes Map
  NontermIdent
  (VisitKind
   -> Either
        Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
_lhsIchildintros PP_Doc
_lhsIfollow Int
_lhsIindex Bool
_lhsIisLast VisitKind
_lhsIkind Map NontermIdent (VisitKind -> Either Error PP_Doc)
_lhsImrules Options
_lhsIoptions Int
_lhsIprevMaxSimRefs Map NontermIdent (Set String)
_lhsIruledefs Map NontermIdent (Map String (Maybe NonLocalAttr))
_lhsIruleuses Bool
_lhsIuseParallel) -> ( let
         _visitItf :: NontermIdent -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc
_visitItf = Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
-> Int
-> NontermIdent
-> Type
-> VisitKind
-> PP_Doc
-> Either Error PP_Doc
rule612 Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_lhsIallchildvisit Int
arg_visit_
         _childType :: Type
_childType = Attributes -> NontermIdent -> Type
rule613 Attributes
_lhsIchildTypes NontermIdent
arg_child_
         _lhsOerrors :: Seq Error
         _lhsOsem_steps :: PP_Doc
         (Seq Error
_lhsOerrors,PP_Doc
_lhsOsem_steps) = forall {t} {t} {a}.
t
-> PP_Doc
-> VisitKind
-> (t -> t -> VisitKind -> PP_Doc -> Either a PP_Doc)
-> t
-> (Seq a, PP_Doc)
rule614 Type
_childType PP_Doc
_lhsIfollow VisitKind
_lhsIkind NontermIdent -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc
_visitItf NontermIdent
arg_child_
         _lhsOdefs :: Set String
         _lhsOdefs :: Set String
_lhsOdefs = Map Int (Set NontermIdent)
-> Options -> Int -> NontermIdent -> Int -> Set String
rule615 Map Int (Set NontermIdent)
_lhsIavisitdefs Options
_lhsIoptions Int
_to NontermIdent
arg_child_ Int
arg_visit_
         _lhsOuses :: Map String (Maybe NonLocalAttr)
         _lhsOuses :: Map String (Maybe NonLocalAttr)
_lhsOuses = Int
-> Map Int (Set NontermIdent)
-> Options
-> NontermIdent
-> Int
-> Map String (Maybe NonLocalAttr)
rule616 Int
_from Map Int (Set NontermIdent)
_lhsIavisituses Options
_lhsIoptions NontermIdent
arg_child_ Int
arg_visit_
         (Int
_from,Int
_to) = Map Int (Int, Int) -> Int -> (Int, Int)
rule617 Map Int (Int, Int)
_lhsIallFromToStates Int
arg_visit_
         _lhsOlazyIntras :: Set String
         _lhsOlazyIntras :: Set String
_lhsOlazyIntras = forall {a}. () -> Set a
rule618  ()
         _lhsOruleKinds :: Map Identifier (Set VisitKind)
         _lhsOruleKinds :: Map NontermIdent (Set VisitKind)
_lhsOruleKinds = forall {k} {a}. () -> Map k a
rule619  ()
         _lhsOruleUsage :: Map Identifier Int
         _lhsOruleUsage :: Map NontermIdent Int
_lhsOruleUsage = forall {k} {a}. () -> Map k a
rule620  ()
         _lhsOvisitKinds :: Map VisitIdentifier VisitKind
         _lhsOvisitKinds :: Map Int VisitKind
_lhsOvisitKinds = () -> Map Int VisitKind
rule621  ()
         _lhsOindex :: Int
         _lhsOindex :: Int
_lhsOindex = Int -> Int
rule622 Int
_lhsIindex
         _lhsOisLast :: Bool
         _lhsOisLast :: Bool
_lhsOisLast = Bool -> Bool
rule623 Bool
_lhsIisLast
         _lhsOprevMaxSimRefs :: Int
         _lhsOprevMaxSimRefs :: Int
_lhsOprevMaxSimRefs = Int -> Int
rule624 Int
_lhsIprevMaxSimRefs
         __result_ :: T_VisitStep_vOut49
__result_ = Set String
-> Seq Error
-> Int
-> Bool
-> Set String
-> Int
-> Map NontermIdent (Set VisitKind)
-> Map NontermIdent Int
-> PP_Doc
-> Map String (Maybe NonLocalAttr)
-> Map Int VisitKind
-> T_VisitStep_vOut49
T_VisitStep_vOut49 Set String
_lhsOdefs Seq Error
_lhsOerrors Int
_lhsOindex Bool
_lhsOisLast Set String
_lhsOlazyIntras Int
_lhsOprevMaxSimRefs Map NontermIdent (Set VisitKind)
_lhsOruleKinds Map NontermIdent Int
_lhsOruleUsage PP_Doc
_lhsOsem_steps Map String (Maybe NonLocalAttr)
_lhsOuses Map Int VisitKind
_lhsOvisitKinds
         in T_VisitStep_vOut49
__result_ )
     in T_VisitStep_v49 -> T_VisitStep_s50
C_VisitStep_s50 T_VisitStep_v49
v49
   {-# INLINE rule612 #-}
   {-# LINE 860 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule612 = \ ((_lhsIallchildvisit) :: Map VisitIdentifier (Identifier -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)) visit_ ->
                                {-# LINE 860 "src-ag/ExecutionPlan2Caml.ag" #-}
                                Map.findWithDefault (error $ "Visit " ++ show visit_ ++ " not found") visit_ _lhsIallchildvisit
                                {-# LINE 5008 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule613 #-}
   {-# LINE 861 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule613 = \ ((_lhsIchildTypes) :: Map Identifier Type) child_ ->
                                 {-# LINE 861 "src-ag/ExecutionPlan2Caml.ag" #-}
                                 Map.findWithDefault (error ("type of child " ++ show child_ ++ " is not in the childTypes map! " ++ show _lhsIchildTypes)) child_ _lhsIchildTypes
                                 {-# LINE 5014 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule614 #-}
   {-# LINE 862 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule614 = \ _childType ((_lhsIfollow) :: PP_Doc) ((_lhsIkind) :: VisitKind) _visitItf child_ ->
                                               {-# LINE 862 "src-ag/ExecutionPlan2Caml.ag" #-}
                                               case _visitItf     child_ _childType     _lhsIkind _lhsIfollow of
                                                 Left e      -> (Seq.singleton e, empty)
                                                 Right steps -> (Seq.empty, steps)
                                               {-# LINE 5022 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule615 #-}
   {-# LINE 1323 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule615 = \ ((_lhsIavisitdefs) :: Map VisitIdentifier (Set Identifier)) ((_lhsIoptions) :: Options) _to child_ visit_ ->
                            {-# LINE 1323 "src-ag/ExecutionPlan2Caml.ag" #-}
                            Set.insert (stname child_ _to) $ maybe (error "Visit not found") (Set.map $ attrname _lhsIoptions True child_) $ Map.lookup visit_ _lhsIavisitdefs
                            {-# LINE 5028 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule616 #-}
   {-# LINE 1324 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule616 = \ _from ((_lhsIavisituses) :: Map VisitIdentifier (Set Identifier)) ((_lhsIoptions) :: Options) child_ visit_ ->
                            {-# LINE 1324 "src-ag/ExecutionPlan2Caml.ag" #-}
                            let convert attrs = Map.fromList [ (attrname _lhsIoptions False child_ attr, Just $ mkNonLocalAttr True child_ attr) | attr <- Set.elems attrs ]
                            in Map.insert (stname child_ _from) Nothing $ convert $
                                 maybe (error "Visit not found") id $ Map.lookup visit_ _lhsIavisituses
                            {-# LINE 5036 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule617 #-}
   {-# LINE 1410 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule617 = \ ((_lhsIallFromToStates) :: Map VisitIdentifier (Int,Int)) visit_ ->
                         {-# LINE 1410 "src-ag/ExecutionPlan2Caml.ag" #-}
                         Map.findWithDefault (error "visit not in allFromToStates") visit_ _lhsIallFromToStates
                         {-# LINE 5042 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule618 #-}
   rule618 = \  (_ :: ()) ->
     Set.empty
   {-# INLINE rule619 #-}
   rule619 = \  (_ :: ()) ->
     Map.empty
   {-# INLINE rule620 #-}
   rule620 = \  (_ :: ()) ->
     Map.empty
   {-# INLINE rule621 #-}
   rule621 = \  (_ :: ()) ->
     mempty
   {-# INLINE rule622 #-}
   rule622 = \ ((_lhsIindex) :: Int) ->
     _lhsIindex
   {-# INLINE rule623 #-}
   rule623 = \ ((_lhsIisLast) :: Bool) ->
     _lhsIisLast
   {-# INLINE rule624 #-}
   rule624 = \ ((_lhsIprevMaxSimRefs) :: Int) ->
     _lhsIprevMaxSimRefs
{-# NOINLINE sem_VisitStep_PureGroup #-}
sem_VisitStep_PureGroup :: T_VisitSteps  -> (Bool) -> T_VisitStep 
sem_VisitStep_PureGroup :: T_VisitSteps -> Bool -> T_VisitStep
sem_VisitStep_PureGroup T_VisitSteps
arg_steps_ Bool
arg_ordered_ = Identity T_VisitStep_s50 -> T_VisitStep
T_VisitStep (forall (m :: * -> *) a. Monad m => a -> m a
return T_VisitStep_s50
st50) where
   {-# NOINLINE st50 #-}
   st50 :: T_VisitStep_s50
st50 = let
      v49 :: T_VisitStep_v49 
      v49 :: T_VisitStep_v49
v49 = \ (T_VisitStep_vIn49 Map Int (Int, Int)
_lhsIallFromToStates Map NontermIdent Int
_lhsIallInitStates Map Int VisitKind
_lhsIallVisitKinds Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_lhsIallchildvisit Map Int (Set NontermIdent)
_lhsIavisitdefs Map Int (Set NontermIdent)
_lhsIavisituses Attributes
_lhsIchildTypes Map
  NontermIdent
  (VisitKind
   -> Either
        Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
_lhsIchildintros PP_Doc
_lhsIfollow Int
_lhsIindex Bool
_lhsIisLast VisitKind
_lhsIkind Map NontermIdent (VisitKind -> Either Error PP_Doc)
_lhsImrules Options
_lhsIoptions Int
_lhsIprevMaxSimRefs Map NontermIdent (Set String)
_lhsIruledefs Map NontermIdent (Map String (Maybe NonLocalAttr))
_lhsIruleuses Bool
_lhsIuseParallel) -> ( let
         _stepsX53 :: T_VisitSteps_s53
_stepsX53 = forall a. Identity a -> a
Control.Monad.Identity.runIdentity (T_VisitSteps -> Identity T_VisitSteps_s53
attach_T_VisitSteps (T_VisitSteps
arg_steps_))
         (T_VisitSteps_vOut52 Set String
_stepsIdefs Seq Error
_stepsIerrors Int
_stepsIindex Bool
_stepsIisLast Set String
_stepsIlazyIntras Int
_stepsIprevMaxSimRefs Map NontermIdent (Set VisitKind)
_stepsIruleKinds Map NontermIdent Int
_stepsIruleUsage PP_Doc
_stepsIsem_steps Int
_stepsIsize Map String (Maybe NonLocalAttr)
_stepsIuses Map Int VisitKind
_stepsIvisitKinds) = T_VisitSteps_s53 -> T_VisitSteps_v52
inv_VisitSteps_s53 T_VisitSteps_s53
_stepsX53 (Map Int (Int, Int)
-> Map NontermIdent Int
-> Map Int VisitKind
-> Map
     Int
     (NontermIdent
      -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
-> Map Int (Set NontermIdent)
-> Map Int (Set NontermIdent)
-> Attributes
-> Map
     NontermIdent
     (VisitKind
      -> Either
           Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
-> PP_Doc
-> Int
-> VisitKind
-> Map NontermIdent (VisitKind -> Either Error PP_Doc)
-> Options
-> Int
-> Map NontermIdent (Set String)
-> Map NontermIdent (Map String (Maybe NonLocalAttr))
-> Bool
-> T_VisitSteps_vIn52
T_VisitSteps_vIn52 Map Int (Int, Int)
_stepsOallFromToStates Map NontermIdent Int
_stepsOallInitStates Map Int VisitKind
_stepsOallVisitKinds Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_stepsOallchildvisit Map Int (Set NontermIdent)
_stepsOavisitdefs Map Int (Set NontermIdent)
_stepsOavisituses Attributes
_stepsOchildTypes Map
  NontermIdent
  (VisitKind
   -> Either
        Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
_stepsOchildintros PP_Doc
_stepsOfollow Int
_stepsOindex VisitKind
_stepsOkind Map NontermIdent (VisitKind -> Either Error PP_Doc)
_stepsOmrules Options
_stepsOoptions Int
_stepsOprevMaxSimRefs Map NontermIdent (Set String)
_stepsOruledefs Map NontermIdent (Map String (Maybe NonLocalAttr))
_stepsOruleuses Bool
_stepsOuseParallel)
         _stepsOkind :: VisitKind
_stepsOkind = Bool -> VisitKind
rule625 Bool
arg_ordered_
         _lhsOlazyIntras :: Set String
         _lhsOlazyIntras :: Set String
_lhsOlazyIntras = Set String -> Set String -> Bool -> Set String
rule626 Set String
_stepsIdefs Set String
_stepsIlazyIntras Bool
arg_ordered_
         _lhsOdefs :: Set String
         _lhsOdefs :: Set String
_lhsOdefs = Set String -> Set String
rule627 Set String
_stepsIdefs
         _lhsOerrors :: Seq Error
         _lhsOerrors :: Seq Error
_lhsOerrors = Seq Error -> Seq Error
rule628 Seq Error
_stepsIerrors
         _lhsOruleKinds :: Map Identifier (Set VisitKind)
         _lhsOruleKinds :: Map NontermIdent (Set VisitKind)
_lhsOruleKinds = Map NontermIdent (Set VisitKind)
-> Map NontermIdent (Set VisitKind)
rule629 Map NontermIdent (Set VisitKind)
_stepsIruleKinds
         _lhsOruleUsage :: Map Identifier Int
         _lhsOruleUsage :: Map NontermIdent Int
_lhsOruleUsage = Map NontermIdent Int -> Map NontermIdent Int
rule630 Map NontermIdent Int
_stepsIruleUsage
         _lhsOsem_steps :: PP_Doc
         _lhsOsem_steps :: PP_Doc
_lhsOsem_steps = PP_Doc -> PP_Doc
rule631 PP_Doc
_stepsIsem_steps
         _lhsOuses :: Map String (Maybe NonLocalAttr)
         _lhsOuses :: Map String (Maybe NonLocalAttr)
_lhsOuses = Map String (Maybe NonLocalAttr) -> Map String (Maybe NonLocalAttr)
rule632 Map String (Maybe NonLocalAttr)
_stepsIuses
         _lhsOvisitKinds :: Map VisitIdentifier VisitKind
         _lhsOvisitKinds :: Map Int VisitKind
_lhsOvisitKinds = Map Int VisitKind -> Map Int VisitKind
rule633 Map Int VisitKind
_stepsIvisitKinds
         _lhsOindex :: Int
         _lhsOindex :: Int
_lhsOindex = Int -> Int
rule634 Int
_stepsIindex
         _lhsOisLast :: Bool
         _lhsOisLast :: Bool
_lhsOisLast = Bool -> Bool
rule635 Bool
_stepsIisLast
         _lhsOprevMaxSimRefs :: Int
         _lhsOprevMaxSimRefs :: Int
_lhsOprevMaxSimRefs = Int -> Int
rule636 Int
_stepsIprevMaxSimRefs
         _stepsOallFromToStates :: Map Int (Int, Int)
_stepsOallFromToStates = Map Int (Int, Int) -> Map Int (Int, Int)
rule637 Map Int (Int, Int)
_lhsIallFromToStates
         _stepsOallInitStates :: Map NontermIdent Int
_stepsOallInitStates = Map NontermIdent Int -> Map NontermIdent Int
rule638 Map NontermIdent Int
_lhsIallInitStates
         _stepsOallVisitKinds :: Map Int VisitKind
_stepsOallVisitKinds = Map Int VisitKind -> Map Int VisitKind
rule639 Map Int VisitKind
_lhsIallVisitKinds
         _stepsOallchildvisit :: Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_stepsOallchildvisit = Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
-> Map
     Int
     (NontermIdent
      -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
rule640 Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_lhsIallchildvisit
         _stepsOavisitdefs :: Map Int (Set NontermIdent)
_stepsOavisitdefs = Map Int (Set NontermIdent) -> Map Int (Set NontermIdent)
rule641 Map Int (Set NontermIdent)
_lhsIavisitdefs
         _stepsOavisituses :: Map Int (Set NontermIdent)
_stepsOavisituses = Map Int (Set NontermIdent) -> Map Int (Set NontermIdent)
rule642 Map Int (Set NontermIdent)
_lhsIavisituses
         _stepsOchildTypes :: Attributes
_stepsOchildTypes = Attributes -> Attributes
rule643 Attributes
_lhsIchildTypes
         _stepsOchildintros :: Map
  NontermIdent
  (VisitKind
   -> Either
        Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
_stepsOchildintros = Map
  NontermIdent
  (VisitKind
   -> Either
        Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
-> Map
     NontermIdent
     (VisitKind
      -> Either
           Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
rule644 Map
  NontermIdent
  (VisitKind
   -> Either
        Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
_lhsIchildintros
         _stepsOfollow :: PP_Doc
_stepsOfollow = PP_Doc -> PP_Doc
rule645 PP_Doc
_lhsIfollow
         _stepsOindex :: Int
_stepsOindex = Int -> Int
rule646 Int
_lhsIindex
         _stepsOmrules :: Map NontermIdent (VisitKind -> Either Error PP_Doc)
_stepsOmrules = Map NontermIdent (VisitKind -> Either Error PP_Doc)
-> Map NontermIdent (VisitKind -> Either Error PP_Doc)
rule647 Map NontermIdent (VisitKind -> Either Error PP_Doc)
_lhsImrules
         _stepsOoptions :: Options
_stepsOoptions = Options -> Options
rule648 Options
_lhsIoptions
         _stepsOprevMaxSimRefs :: Int
_stepsOprevMaxSimRefs = Int -> Int
rule649 Int
_lhsIprevMaxSimRefs
         _stepsOruledefs :: Map NontermIdent (Set String)
_stepsOruledefs = Map NontermIdent (Set String) -> Map NontermIdent (Set String)
rule650 Map NontermIdent (Set String)
_lhsIruledefs
         _stepsOruleuses :: Map NontermIdent (Map String (Maybe NonLocalAttr))
_stepsOruleuses = Map NontermIdent (Map String (Maybe NonLocalAttr))
-> Map NontermIdent (Map String (Maybe NonLocalAttr))
rule651 Map NontermIdent (Map String (Maybe NonLocalAttr))
_lhsIruleuses
         _stepsOuseParallel :: Bool
_stepsOuseParallel = Bool -> Bool
rule652 Bool
_lhsIuseParallel
         __result_ :: T_VisitStep_vOut49
__result_ = Set String
-> Seq Error
-> Int
-> Bool
-> Set String
-> Int
-> Map NontermIdent (Set VisitKind)
-> Map NontermIdent Int
-> PP_Doc
-> Map String (Maybe NonLocalAttr)
-> Map Int VisitKind
-> T_VisitStep_vOut49
T_VisitStep_vOut49 Set String
_lhsOdefs Seq Error
_lhsOerrors Int
_lhsOindex Bool
_lhsOisLast Set String
_lhsOlazyIntras Int
_lhsOprevMaxSimRefs Map NontermIdent (Set VisitKind)
_lhsOruleKinds Map NontermIdent Int
_lhsOruleUsage PP_Doc
_lhsOsem_steps Map String (Maybe NonLocalAttr)
_lhsOuses Map Int VisitKind
_lhsOvisitKinds
         in T_VisitStep_vOut49
__result_ )
     in T_VisitStep_v49 -> T_VisitStep_s50
C_VisitStep_s50 T_VisitStep_v49
v49
   {-# INLINE rule625 #-}
   {-# LINE 836 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule625 = \ ordered_ ->
                 {-# LINE 836 "src-ag/ExecutionPlan2Caml.ag" #-}
                 VisitPure ordered_
                 {-# LINE 5120 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule626 #-}
   {-# LINE 1344 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule626 = \ ((_stepsIdefs) :: Set String) ((_stepsIlazyIntras) :: Set String) ordered_ ->
                     {-# LINE 1344 "src-ag/ExecutionPlan2Caml.ag" #-}
                     if ordered_
                     then _stepsIlazyIntras
                     else _stepsIdefs
                     {-# LINE 5128 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule627 #-}
   rule627 = \ ((_stepsIdefs) :: Set String) ->
     _stepsIdefs
   {-# INLINE rule628 #-}
   rule628 = \ ((_stepsIerrors) :: Seq Error) ->
     _stepsIerrors
   {-# INLINE rule629 #-}
   rule629 = \ ((_stepsIruleKinds) :: Map Identifier (Set VisitKind)) ->
     _stepsIruleKinds
   {-# INLINE rule630 #-}
   rule630 = \ ((_stepsIruleUsage) :: Map Identifier Int) ->
     _stepsIruleUsage
   {-# INLINE rule631 #-}
   rule631 = \ ((_stepsIsem_steps) :: PP_Doc) ->
     _stepsIsem_steps
   {-# INLINE rule632 #-}
   rule632 = \ ((_stepsIuses) :: Map String (Maybe NonLocalAttr)) ->
     _stepsIuses
   {-# INLINE rule633 #-}
   rule633 = \ ((_stepsIvisitKinds) :: Map VisitIdentifier VisitKind) ->
     _stepsIvisitKinds
   {-# INLINE rule634 #-}
   rule634 = \ ((_stepsIindex) :: Int) ->
     _stepsIindex
   {-# INLINE rule635 #-}
   rule635 = \ ((_stepsIisLast) :: Bool) ->
     _stepsIisLast
   {-# INLINE rule636 #-}
   rule636 = \ ((_stepsIprevMaxSimRefs) :: Int) ->
     _stepsIprevMaxSimRefs
   {-# INLINE rule637 #-}
   rule637 = \ ((_lhsIallFromToStates) :: Map VisitIdentifier (Int,Int)) ->
     _lhsIallFromToStates
   {-# INLINE rule638 #-}
   rule638 = \ ((_lhsIallInitStates) :: Map NontermIdent Int) ->
     _lhsIallInitStates
   {-# INLINE rule639 #-}
   rule639 = \ ((_lhsIallVisitKinds) :: Map VisitIdentifier VisitKind) ->
     _lhsIallVisitKinds
   {-# INLINE rule640 #-}
   rule640 = \ ((_lhsIallchildvisit) :: Map VisitIdentifier (Identifier -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)) ->
     _lhsIallchildvisit
   {-# INLINE rule641 #-}
   rule641 = \ ((_lhsIavisitdefs) :: Map VisitIdentifier (Set Identifier)) ->
     _lhsIavisitdefs
   {-# INLINE rule642 #-}
   rule642 = \ ((_lhsIavisituses) :: Map VisitIdentifier (Set Identifier)) ->
     _lhsIavisituses
   {-# INLINE rule643 #-}
   rule643 = \ ((_lhsIchildTypes) :: Map Identifier Type) ->
     _lhsIchildTypes
   {-# INLINE rule644 #-}
   rule644 = \ ((_lhsIchildintros) :: Map Identifier (VisitKind -> Either Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))) ->
     _lhsIchildintros
   {-# INLINE rule645 #-}
   rule645 = \ ((_lhsIfollow) :: PP_Doc) ->
     _lhsIfollow
   {-# INLINE rule646 #-}
   rule646 = \ ((_lhsIindex) :: Int) ->
     _lhsIindex
   {-# INLINE rule647 #-}
   rule647 = \ ((_lhsImrules) :: Map Identifier (VisitKind ->  Either Error PP_Doc)) ->
     _lhsImrules
   {-# INLINE rule648 #-}
   rule648 = \ ((_lhsIoptions) :: Options) ->
     _lhsIoptions
   {-# INLINE rule649 #-}
   rule649 = \ ((_lhsIprevMaxSimRefs) :: Int) ->
     _lhsIprevMaxSimRefs
   {-# INLINE rule650 #-}
   rule650 = \ ((_lhsIruledefs) :: Map Identifier (Set String)) ->
     _lhsIruledefs
   {-# INLINE rule651 #-}
   rule651 = \ ((_lhsIruleuses) :: Map Identifier (Map String (Maybe NonLocalAttr))) ->
     _lhsIruleuses
   {-# INLINE rule652 #-}
   rule652 = \ ((_lhsIuseParallel) :: Bool) ->
     _lhsIuseParallel
{-# NOINLINE sem_VisitStep_Sim #-}
sem_VisitStep_Sim :: T_VisitSteps  -> T_VisitStep 
sem_VisitStep_Sim :: T_VisitSteps -> T_VisitStep
sem_VisitStep_Sim T_VisitSteps
arg_steps_ = Identity T_VisitStep_s50 -> T_VisitStep
T_VisitStep (forall (m :: * -> *) a. Monad m => a -> m a
return T_VisitStep_s50
st50) where
   {-# NOINLINE st50 #-}
   st50 :: T_VisitStep_s50
st50 = let
      v49 :: T_VisitStep_v49 
      v49 :: T_VisitStep_v49
v49 = \ (T_VisitStep_vIn49 Map Int (Int, Int)
_lhsIallFromToStates Map NontermIdent Int
_lhsIallInitStates Map Int VisitKind
_lhsIallVisitKinds Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_lhsIallchildvisit Map Int (Set NontermIdent)
_lhsIavisitdefs Map Int (Set NontermIdent)
_lhsIavisituses Attributes
_lhsIchildTypes Map
  NontermIdent
  (VisitKind
   -> Either
        Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
_lhsIchildintros PP_Doc
_lhsIfollow Int
_lhsIindex Bool
_lhsIisLast VisitKind
_lhsIkind Map NontermIdent (VisitKind -> Either Error PP_Doc)
_lhsImrules Options
_lhsIoptions Int
_lhsIprevMaxSimRefs Map NontermIdent (Set String)
_lhsIruledefs Map NontermIdent (Map String (Maybe NonLocalAttr))
_lhsIruleuses Bool
_lhsIuseParallel) -> ( let
         _stepsX53 :: T_VisitSteps_s53
_stepsX53 = forall a. Identity a -> a
Control.Monad.Identity.runIdentity (T_VisitSteps -> Identity T_VisitSteps_s53
attach_T_VisitSteps (T_VisitSteps
arg_steps_))
         (T_VisitSteps_vOut52 Set String
_stepsIdefs Seq Error
_stepsIerrors Int
_stepsIindex Bool
_stepsIisLast Set String
_stepsIlazyIntras Int
_stepsIprevMaxSimRefs Map NontermIdent (Set VisitKind)
_stepsIruleKinds Map NontermIdent Int
_stepsIruleUsage PP_Doc
_stepsIsem_steps Int
_stepsIsize Map String (Maybe NonLocalAttr)
_stepsIuses Map Int VisitKind
_stepsIvisitKinds) = T_VisitSteps_s53 -> T_VisitSteps_v52
inv_VisitSteps_s53 T_VisitSteps_s53
_stepsX53 (Map Int (Int, Int)
-> Map NontermIdent Int
-> Map Int VisitKind
-> Map
     Int
     (NontermIdent
      -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
-> Map Int (Set NontermIdent)
-> Map Int (Set NontermIdent)
-> Attributes
-> Map
     NontermIdent
     (VisitKind
      -> Either
           Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
-> PP_Doc
-> Int
-> VisitKind
-> Map NontermIdent (VisitKind -> Either Error PP_Doc)
-> Options
-> Int
-> Map NontermIdent (Set String)
-> Map NontermIdent (Map String (Maybe NonLocalAttr))
-> Bool
-> T_VisitSteps_vIn52
T_VisitSteps_vIn52 Map Int (Int, Int)
_stepsOallFromToStates Map NontermIdent Int
_stepsOallInitStates Map Int VisitKind
_stepsOallVisitKinds Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_stepsOallchildvisit Map Int (Set NontermIdent)
_stepsOavisitdefs Map Int (Set NontermIdent)
_stepsOavisituses Attributes
_stepsOchildTypes Map
  NontermIdent
  (VisitKind
   -> Either
        Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
_stepsOchildintros PP_Doc
_stepsOfollow Int
_stepsOindex VisitKind
_stepsOkind Map NontermIdent (VisitKind -> Either Error PP_Doc)
_stepsOmrules Options
_stepsOoptions Int
_stepsOprevMaxSimRefs Map NontermIdent (Set String)
_stepsOruledefs Map NontermIdent (Map String (Maybe NonLocalAttr))
_stepsOruleuses Bool
_stepsOuseParallel)
         _stepsOindex :: Int
_stepsOindex = () -> Int
rule653  ()
         _lhsOindex :: Int
         _lhsOindex :: Int
_lhsOindex = Int -> Int
rule654 Int
_lhsIindex
         _lhsOprevMaxSimRefs :: Int
         _lhsOprevMaxSimRefs :: Int
_lhsOprevMaxSimRefs = Int -> Int -> Bool -> Int
rule655 Int
_lhsIprevMaxSimRefs Int
_stepsIindex Bool
_useParallel
         _useParallel :: Bool
_useParallel = Options -> Int -> Bool
rule656 Options
_lhsIoptions Int
_stepsIsize
         _lhsOdefs :: Set String
         _lhsOdefs :: Set String
_lhsOdefs = Set String -> Set String
rule657 Set String
_stepsIdefs
         _lhsOerrors :: Seq Error
         _lhsOerrors :: Seq Error
_lhsOerrors = Seq Error -> Seq Error
rule658 Seq Error
_stepsIerrors
         _lhsOlazyIntras :: Set String
         _lhsOlazyIntras :: Set String
_lhsOlazyIntras = Set String -> Set String
rule659 Set String
_stepsIlazyIntras
         _lhsOruleKinds :: Map Identifier (Set VisitKind)
         _lhsOruleKinds :: Map NontermIdent (Set VisitKind)
_lhsOruleKinds = Map NontermIdent (Set VisitKind)
-> Map NontermIdent (Set VisitKind)
rule660 Map NontermIdent (Set VisitKind)
_stepsIruleKinds
         _lhsOruleUsage :: Map Identifier Int
         _lhsOruleUsage :: Map NontermIdent Int
_lhsOruleUsage = Map NontermIdent Int -> Map NontermIdent Int
rule661 Map NontermIdent Int
_stepsIruleUsage
         _lhsOsem_steps :: PP_Doc
         _lhsOsem_steps :: PP_Doc
_lhsOsem_steps = PP_Doc -> PP_Doc
rule662 PP_Doc
_stepsIsem_steps
         _lhsOuses :: Map String (Maybe NonLocalAttr)
         _lhsOuses :: Map String (Maybe NonLocalAttr)
_lhsOuses = Map String (Maybe NonLocalAttr) -> Map String (Maybe NonLocalAttr)
rule663 Map String (Maybe NonLocalAttr)
_stepsIuses
         _lhsOvisitKinds :: Map VisitIdentifier VisitKind
         _lhsOvisitKinds :: Map Int VisitKind
_lhsOvisitKinds = Map Int VisitKind -> Map Int VisitKind
rule664 Map Int VisitKind
_stepsIvisitKinds
         _lhsOisLast :: Bool
         _lhsOisLast :: Bool
_lhsOisLast = Bool -> Bool
rule665 Bool
_stepsIisLast
         _stepsOallFromToStates :: Map Int (Int, Int)
_stepsOallFromToStates = Map Int (Int, Int) -> Map Int (Int, Int)
rule666 Map Int (Int, Int)
_lhsIallFromToStates
         _stepsOallInitStates :: Map NontermIdent Int
_stepsOallInitStates = Map NontermIdent Int -> Map NontermIdent Int
rule667 Map NontermIdent Int
_lhsIallInitStates
         _stepsOallVisitKinds :: Map Int VisitKind
_stepsOallVisitKinds = Map Int VisitKind -> Map Int VisitKind
rule668 Map Int VisitKind
_lhsIallVisitKinds
         _stepsOallchildvisit :: Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_stepsOallchildvisit = Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
-> Map
     Int
     (NontermIdent
      -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
rule669 Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_lhsIallchildvisit
         _stepsOavisitdefs :: Map Int (Set NontermIdent)
_stepsOavisitdefs = Map Int (Set NontermIdent) -> Map Int (Set NontermIdent)
rule670 Map Int (Set NontermIdent)
_lhsIavisitdefs
         _stepsOavisituses :: Map Int (Set NontermIdent)
_stepsOavisituses = Map Int (Set NontermIdent) -> Map Int (Set NontermIdent)
rule671 Map Int (Set NontermIdent)
_lhsIavisituses
         _stepsOchildTypes :: Attributes
_stepsOchildTypes = Attributes -> Attributes
rule672 Attributes
_lhsIchildTypes
         _stepsOchildintros :: Map
  NontermIdent
  (VisitKind
   -> Either
        Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
_stepsOchildintros = Map
  NontermIdent
  (VisitKind
   -> Either
        Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
-> Map
     NontermIdent
     (VisitKind
      -> Either
           Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
rule673 Map
  NontermIdent
  (VisitKind
   -> Either
        Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
_lhsIchildintros
         _stepsOfollow :: PP_Doc
_stepsOfollow = PP_Doc -> PP_Doc
rule674 PP_Doc
_lhsIfollow
         _stepsOkind :: VisitKind
_stepsOkind = VisitKind -> VisitKind
rule675 VisitKind
_lhsIkind
         _stepsOmrules :: Map NontermIdent (VisitKind -> Either Error PP_Doc)
_stepsOmrules = Map NontermIdent (VisitKind -> Either Error PP_Doc)
-> Map NontermIdent (VisitKind -> Either Error PP_Doc)
rule676 Map NontermIdent (VisitKind -> Either Error PP_Doc)
_lhsImrules
         _stepsOoptions :: Options
_stepsOoptions = Options -> Options
rule677 Options
_lhsIoptions
         _stepsOprevMaxSimRefs :: Int
_stepsOprevMaxSimRefs = Int -> Int
rule678 Int
_lhsIprevMaxSimRefs
         _stepsOruledefs :: Map NontermIdent (Set String)
_stepsOruledefs = Map NontermIdent (Set String) -> Map NontermIdent (Set String)
rule679 Map NontermIdent (Set String)
_lhsIruledefs
         _stepsOruleuses :: Map NontermIdent (Map String (Maybe NonLocalAttr))
_stepsOruleuses = Map NontermIdent (Map String (Maybe NonLocalAttr))
-> Map NontermIdent (Map String (Maybe NonLocalAttr))
rule680 Map NontermIdent (Map String (Maybe NonLocalAttr))
_lhsIruleuses
         _stepsOuseParallel :: Bool
_stepsOuseParallel = forall a. a -> a
rule681 Bool
_useParallel
         __result_ :: T_VisitStep_vOut49
__result_ = Set String
-> Seq Error
-> Int
-> Bool
-> Set String
-> Int
-> Map NontermIdent (Set VisitKind)
-> Map NontermIdent Int
-> PP_Doc
-> Map String (Maybe NonLocalAttr)
-> Map Int VisitKind
-> T_VisitStep_vOut49
T_VisitStep_vOut49 Set String
_lhsOdefs Seq Error
_lhsOerrors Int
_lhsOindex Bool
_lhsOisLast Set String
_lhsOlazyIntras Int
_lhsOprevMaxSimRefs Map NontermIdent (Set VisitKind)
_lhsOruleKinds Map NontermIdent Int
_lhsOruleUsage PP_Doc
_lhsOsem_steps Map String (Maybe NonLocalAttr)
_lhsOuses Map Int VisitKind
_lhsOvisitKinds
         in T_VisitStep_vOut49
__result_ )
     in T_VisitStep_v49 -> T_VisitStep_s50
C_VisitStep_s50 T_VisitStep_v49
v49
   {-# INLINE rule653 #-}
   {-# LINE 885 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule653 = \  (_ :: ()) ->
                                     {-# LINE 885 "src-ag/ExecutionPlan2Caml.ag" #-}
                                     0
                                     {-# LINE 5264 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule654 #-}
   {-# LINE 886 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule654 = \ ((_lhsIindex) :: Int) ->
                                     {-# LINE 886 "src-ag/ExecutionPlan2Caml.ag" #-}
                                     _lhsIindex
                                     {-# LINE 5270 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule655 #-}
   {-# LINE 893 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule655 = \ ((_lhsIprevMaxSimRefs) :: Int) ((_stepsIindex) :: Int) _useParallel ->
                         {-# LINE 893 "src-ag/ExecutionPlan2Caml.ag" #-}
                         if _useParallel
                         then _lhsIprevMaxSimRefs `max` (_stepsIindex - 1)
                         else _lhsIprevMaxSimRefs
                         {-# LINE 5278 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule656 #-}
   {-# LINE 909 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule656 = \ ((_lhsIoptions) :: Options) ((_stepsIsize) :: Int) ->
                                         {-# LINE 909 "src-ag/ExecutionPlan2Caml.ag" #-}
                                         parallelInvoke _lhsIoptions && _stepsIsize > 1
                                         {-# LINE 5284 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule657 #-}
   rule657 = \ ((_stepsIdefs) :: Set String) ->
     _stepsIdefs
   {-# INLINE rule658 #-}
   rule658 = \ ((_stepsIerrors) :: Seq Error) ->
     _stepsIerrors
   {-# INLINE rule659 #-}
   rule659 = \ ((_stepsIlazyIntras) :: Set String) ->
     _stepsIlazyIntras
   {-# INLINE rule660 #-}
   rule660 = \ ((_stepsIruleKinds) :: Map Identifier (Set VisitKind)) ->
     _stepsIruleKinds
   {-# INLINE rule661 #-}
   rule661 = \ ((_stepsIruleUsage) :: Map Identifier Int) ->
     _stepsIruleUsage
   {-# INLINE rule662 #-}
   rule662 = \ ((_stepsIsem_steps) :: PP_Doc) ->
     _stepsIsem_steps
   {-# INLINE rule663 #-}
   rule663 = \ ((_stepsIuses) :: Map String (Maybe NonLocalAttr)) ->
     _stepsIuses
   {-# INLINE rule664 #-}
   rule664 = \ ((_stepsIvisitKinds) :: Map VisitIdentifier VisitKind) ->
     _stepsIvisitKinds
   {-# INLINE rule665 #-}
   rule665 = \ ((_stepsIisLast) :: Bool) ->
     _stepsIisLast
   {-# INLINE rule666 #-}
   rule666 = \ ((_lhsIallFromToStates) :: Map VisitIdentifier (Int,Int)) ->
     _lhsIallFromToStates
   {-# INLINE rule667 #-}
   rule667 = \ ((_lhsIallInitStates) :: Map NontermIdent Int) ->
     _lhsIallInitStates
   {-# INLINE rule668 #-}
   rule668 = \ ((_lhsIallVisitKinds) :: Map VisitIdentifier VisitKind) ->
     _lhsIallVisitKinds
   {-# INLINE rule669 #-}
   rule669 = \ ((_lhsIallchildvisit) :: Map VisitIdentifier (Identifier -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)) ->
     _lhsIallchildvisit
   {-# INLINE rule670 #-}
   rule670 = \ ((_lhsIavisitdefs) :: Map VisitIdentifier (Set Identifier)) ->
     _lhsIavisitdefs
   {-# INLINE rule671 #-}
   rule671 = \ ((_lhsIavisituses) :: Map VisitIdentifier (Set Identifier)) ->
     _lhsIavisituses
   {-# INLINE rule672 #-}
   rule672 = \ ((_lhsIchildTypes) :: Map Identifier Type) ->
     _lhsIchildTypes
   {-# INLINE rule673 #-}
   rule673 = \ ((_lhsIchildintros) :: Map Identifier (VisitKind -> Either Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))) ->
     _lhsIchildintros
   {-# INLINE rule674 #-}
   rule674 = \ ((_lhsIfollow) :: PP_Doc) ->
     _lhsIfollow
   {-# INLINE rule675 #-}
   rule675 = \ ((_lhsIkind) :: VisitKind) ->
     _lhsIkind
   {-# INLINE rule676 #-}
   rule676 = \ ((_lhsImrules) :: Map Identifier (VisitKind ->  Either Error PP_Doc)) ->
     _lhsImrules
   {-# INLINE rule677 #-}
   rule677 = \ ((_lhsIoptions) :: Options) ->
     _lhsIoptions
   {-# INLINE rule678 #-}
   rule678 = \ ((_lhsIprevMaxSimRefs) :: Int) ->
     _lhsIprevMaxSimRefs
   {-# INLINE rule679 #-}
   rule679 = \ ((_lhsIruledefs) :: Map Identifier (Set String)) ->
     _lhsIruledefs
   {-# INLINE rule680 #-}
   rule680 = \ ((_lhsIruleuses) :: Map Identifier (Map String (Maybe NonLocalAttr))) ->
     _lhsIruleuses
   {-# INLINE rule681 #-}
   rule681 = \ _useParallel ->
     _useParallel
{-# NOINLINE sem_VisitStep_ChildIntro #-}
sem_VisitStep_ChildIntro :: (Identifier) -> T_VisitStep 
sem_VisitStep_ChildIntro :: NontermIdent -> T_VisitStep
sem_VisitStep_ChildIntro NontermIdent
arg_child_ = Identity T_VisitStep_s50 -> T_VisitStep
T_VisitStep (forall (m :: * -> *) a. Monad m => a -> m a
return T_VisitStep_s50
st50) where
   {-# NOINLINE st50 #-}
   st50 :: T_VisitStep_s50
st50 = let
      v49 :: T_VisitStep_v49 
      v49 :: T_VisitStep_v49
v49 = \ (T_VisitStep_vIn49 Map Int (Int, Int)
_lhsIallFromToStates Map NontermIdent Int
_lhsIallInitStates Map Int VisitKind
_lhsIallVisitKinds Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_lhsIallchildvisit Map Int (Set NontermIdent)
_lhsIavisitdefs Map Int (Set NontermIdent)
_lhsIavisituses Attributes
_lhsIchildTypes Map
  NontermIdent
  (VisitKind
   -> Either
        Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
_lhsIchildintros PP_Doc
_lhsIfollow Int
_lhsIindex Bool
_lhsIisLast VisitKind
_lhsIkind Map NontermIdent (VisitKind -> Either Error PP_Doc)
_lhsImrules Options
_lhsIoptions Int
_lhsIprevMaxSimRefs Map NontermIdent (Set String)
_lhsIruledefs Map NontermIdent (Map String (Maybe NonLocalAttr))
_lhsIruleuses Bool
_lhsIuseParallel) -> ( let
         _attachItf :: VisitKind
-> Either
     Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr))
_attachItf = Map
  NontermIdent
  (VisitKind
   -> Either
        Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
-> NontermIdent
-> VisitKind
-> Either
     Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr))
rule682 Map
  NontermIdent
  (VisitKind
   -> Either
        Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
_lhsIchildintros NontermIdent
arg_child_
         _lhsOerrors :: Seq Error
         _lhsOdefs :: Set String
         _lhsOuses :: Map String (Maybe NonLocalAttr)
         (Seq Error
_lhsOerrors,PP_Doc
_sem_steps,Set String
_lhsOdefs,Map String (Maybe NonLocalAttr)
_lhsOuses) = forall {a} {a} {k} {a}.
(VisitKind -> Either a (PP_Doc, Set a, Map k a))
-> VisitKind -> (Seq a, PP_Doc, Set a, Map k a)
rule683 VisitKind
-> Either
     Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr))
_attachItf VisitKind
_lhsIkind
         _lhsOsem_steps :: PP_Doc
         _lhsOsem_steps :: PP_Doc
_lhsOsem_steps = PP_Doc -> PP_Doc -> PP_Doc
rule684 PP_Doc
_lhsIfollow PP_Doc
_sem_steps
         _lhsOlazyIntras :: Set String
         _lhsOlazyIntras :: Set String
_lhsOlazyIntras = forall {a}. () -> Set a
rule685  ()
         _lhsOruleKinds :: Map Identifier (Set VisitKind)
         _lhsOruleKinds :: Map NontermIdent (Set VisitKind)
_lhsOruleKinds = forall {k} {a}. () -> Map k a
rule686  ()
         _lhsOruleUsage :: Map Identifier Int
         _lhsOruleUsage :: Map NontermIdent Int
_lhsOruleUsage = forall {k} {a}. () -> Map k a
rule687  ()
         _lhsOvisitKinds :: Map VisitIdentifier VisitKind
         _lhsOvisitKinds :: Map Int VisitKind
_lhsOvisitKinds = () -> Map Int VisitKind
rule688  ()
         _lhsOindex :: Int
         _lhsOindex :: Int
_lhsOindex = Int -> Int
rule689 Int
_lhsIindex
         _lhsOisLast :: Bool
         _lhsOisLast :: Bool
_lhsOisLast = Bool -> Bool
rule690 Bool
_lhsIisLast
         _lhsOprevMaxSimRefs :: Int
         _lhsOprevMaxSimRefs :: Int
_lhsOprevMaxSimRefs = Int -> Int
rule691 Int
_lhsIprevMaxSimRefs
         __result_ :: T_VisitStep_vOut49
__result_ = Set String
-> Seq Error
-> Int
-> Bool
-> Set String
-> Int
-> Map NontermIdent (Set VisitKind)
-> Map NontermIdent Int
-> PP_Doc
-> Map String (Maybe NonLocalAttr)
-> Map Int VisitKind
-> T_VisitStep_vOut49
T_VisitStep_vOut49 Set String
_lhsOdefs Seq Error
_lhsOerrors Int
_lhsOindex Bool
_lhsOisLast Set String
_lhsOlazyIntras Int
_lhsOprevMaxSimRefs Map NontermIdent (Set VisitKind)
_lhsOruleKinds Map NontermIdent Int
_lhsOruleUsage PP_Doc
_lhsOsem_steps Map String (Maybe NonLocalAttr)
_lhsOuses Map Int VisitKind
_lhsOvisitKinds
         in T_VisitStep_vOut49
__result_ )
     in T_VisitStep_v49 -> T_VisitStep_s50
C_VisitStep_s50 T_VisitStep_v49
v49
   {-# INLINE rule682 #-}
   {-# LINE 854 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule682 = \ ((_lhsIchildintros) :: Map Identifier (VisitKind -> Either Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))) child_ ->
                                 {-# LINE 854 "src-ag/ExecutionPlan2Caml.ag" #-}
                                 Map.findWithDefault (error $ "Child " ++ show child_ ++ " not found") child_ _lhsIchildintros
                                 {-# LINE 5396 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule683 #-}
   {-# LINE 856 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule683 = \ _attachItf ((_lhsIkind) :: VisitKind) ->
                     {-# LINE 856 "src-ag/ExecutionPlan2Caml.ag" #-}
                     case _attachItf     _lhsIkind of
                       Left e                   -> (Seq.singleton e, empty, Set.empty, Map.empty)
                       Right (code, defs, uses) -> (Seq.empty, code, defs, uses)
                     {-# LINE 5404 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule684 #-}
   {-# LINE 859 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule684 = \ ((_lhsIfollow) :: PP_Doc) _sem_steps ->
                                 {-# LINE 859 "src-ag/ExecutionPlan2Caml.ag" #-}
                                 _sem_steps     >-< _lhsIfollow
                                 {-# LINE 5410 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule685 #-}
   rule685 = \  (_ :: ()) ->
     Set.empty
   {-# INLINE rule686 #-}
   rule686 = \  (_ :: ()) ->
     Map.empty
   {-# INLINE rule687 #-}
   rule687 = \  (_ :: ()) ->
     Map.empty
   {-# INLINE rule688 #-}
   rule688 = \  (_ :: ()) ->
     mempty
   {-# INLINE rule689 #-}
   rule689 = \ ((_lhsIindex) :: Int) ->
     _lhsIindex
   {-# INLINE rule690 #-}
   rule690 = \ ((_lhsIisLast) :: Bool) ->
     _lhsIisLast
   {-# INLINE rule691 #-}
   rule691 = \ ((_lhsIprevMaxSimRefs) :: Int) ->
     _lhsIprevMaxSimRefs

-- VisitSteps --------------------------------------------------
-- wrapper
data Inh_VisitSteps  = Inh_VisitSteps { Inh_VisitSteps -> Map Int (Int, Int)
allFromToStates_Inh_VisitSteps :: (Map VisitIdentifier (Int,Int)), Inh_VisitSteps -> Map NontermIdent Int
allInitStates_Inh_VisitSteps :: (Map NontermIdent Int), Inh_VisitSteps -> Map Int VisitKind
allVisitKinds_Inh_VisitSteps :: (Map VisitIdentifier VisitKind), Inh_VisitSteps
-> Map
     Int
     (NontermIdent
      -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
allchildvisit_Inh_VisitSteps :: (Map VisitIdentifier (Identifier -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)), Inh_VisitSteps -> Map Int (Set NontermIdent)
avisitdefs_Inh_VisitSteps :: (Map VisitIdentifier (Set Identifier)), Inh_VisitSteps -> Map Int (Set NontermIdent)
avisituses_Inh_VisitSteps :: (Map VisitIdentifier (Set Identifier)), Inh_VisitSteps -> Attributes
childTypes_Inh_VisitSteps :: (Map Identifier Type), Inh_VisitSteps
-> Map
     NontermIdent
     (VisitKind
      -> Either
           Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
childintros_Inh_VisitSteps :: (Map Identifier (VisitKind -> Either Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))), Inh_VisitSteps -> PP_Doc
follow_Inh_VisitSteps :: (PP_Doc), Inh_VisitSteps -> Int
index_Inh_VisitSteps :: (Int), Inh_VisitSteps -> VisitKind
kind_Inh_VisitSteps :: (VisitKind), Inh_VisitSteps
-> Map NontermIdent (VisitKind -> Either Error PP_Doc)
mrules_Inh_VisitSteps :: (Map Identifier (VisitKind ->  Either Error PP_Doc)), Inh_VisitSteps -> Options
options_Inh_VisitSteps :: (Options), Inh_VisitSteps -> Int
prevMaxSimRefs_Inh_VisitSteps :: (Int), Inh_VisitSteps -> Map NontermIdent (Set String)
ruledefs_Inh_VisitSteps :: (Map Identifier (Set String)), Inh_VisitSteps
-> Map NontermIdent (Map String (Maybe NonLocalAttr))
ruleuses_Inh_VisitSteps :: (Map Identifier (Map String (Maybe NonLocalAttr))), Inh_VisitSteps -> Bool
useParallel_Inh_VisitSteps :: (Bool) }
data Syn_VisitSteps  = Syn_VisitSteps { Syn_VisitSteps -> Set String
defs_Syn_VisitSteps :: (Set String), Syn_VisitSteps -> Seq Error
errors_Syn_VisitSteps :: (Seq Error), Syn_VisitSteps -> Int
index_Syn_VisitSteps :: (Int), Syn_VisitSteps -> Bool
isLast_Syn_VisitSteps :: (Bool), Syn_VisitSteps -> Set String
lazyIntras_Syn_VisitSteps :: (Set String), Syn_VisitSteps -> Int
prevMaxSimRefs_Syn_VisitSteps :: (Int), Syn_VisitSteps -> Map NontermIdent (Set VisitKind)
ruleKinds_Syn_VisitSteps :: (Map Identifier (Set VisitKind)), Syn_VisitSteps -> Map NontermIdent Int
ruleUsage_Syn_VisitSteps :: (Map Identifier Int), Syn_VisitSteps -> PP_Doc
sem_steps_Syn_VisitSteps :: (PP_Doc), Syn_VisitSteps -> Int
size_Syn_VisitSteps :: (Int), Syn_VisitSteps -> Map String (Maybe NonLocalAttr)
uses_Syn_VisitSteps :: (Map String (Maybe NonLocalAttr)), Syn_VisitSteps -> Map Int VisitKind
visitKinds_Syn_VisitSteps :: (Map VisitIdentifier VisitKind) }
{-# INLINABLE wrap_VisitSteps #-}
wrap_VisitSteps :: T_VisitSteps  -> Inh_VisitSteps  -> (Syn_VisitSteps )
wrap_VisitSteps :: T_VisitSteps -> Inh_VisitSteps -> Syn_VisitSteps
wrap_VisitSteps (T_VisitSteps Identity T_VisitSteps_s53
act) (Inh_VisitSteps Map Int (Int, Int)
_lhsIallFromToStates Map NontermIdent Int
_lhsIallInitStates Map Int VisitKind
_lhsIallVisitKinds Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_lhsIallchildvisit Map Int (Set NontermIdent)
_lhsIavisitdefs Map Int (Set NontermIdent)
_lhsIavisituses Attributes
_lhsIchildTypes Map
  NontermIdent
  (VisitKind
   -> Either
        Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
_lhsIchildintros PP_Doc
_lhsIfollow Int
_lhsIindex VisitKind
_lhsIkind Map NontermIdent (VisitKind -> Either Error PP_Doc)
_lhsImrules Options
_lhsIoptions Int
_lhsIprevMaxSimRefs Map NontermIdent (Set String)
_lhsIruledefs Map NontermIdent (Map String (Maybe NonLocalAttr))
_lhsIruleuses Bool
_lhsIuseParallel) =
   forall a. Identity a -> a
Control.Monad.Identity.runIdentity (
     do T_VisitSteps_s53
sem <- Identity T_VisitSteps_s53
act
        let arg52 :: T_VisitSteps_vIn52
arg52 = Map Int (Int, Int)
-> Map NontermIdent Int
-> Map Int VisitKind
-> Map
     Int
     (NontermIdent
      -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
-> Map Int (Set NontermIdent)
-> Map Int (Set NontermIdent)
-> Attributes
-> Map
     NontermIdent
     (VisitKind
      -> Either
           Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
-> PP_Doc
-> Int
-> VisitKind
-> Map NontermIdent (VisitKind -> Either Error PP_Doc)
-> Options
-> Int
-> Map NontermIdent (Set String)
-> Map NontermIdent (Map String (Maybe NonLocalAttr))
-> Bool
-> T_VisitSteps_vIn52
T_VisitSteps_vIn52 Map Int (Int, Int)
_lhsIallFromToStates Map NontermIdent Int
_lhsIallInitStates Map Int VisitKind
_lhsIallVisitKinds Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_lhsIallchildvisit Map Int (Set NontermIdent)
_lhsIavisitdefs Map Int (Set NontermIdent)
_lhsIavisituses Attributes
_lhsIchildTypes Map
  NontermIdent
  (VisitKind
   -> Either
        Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
_lhsIchildintros PP_Doc
_lhsIfollow Int
_lhsIindex VisitKind
_lhsIkind Map NontermIdent (VisitKind -> Either Error PP_Doc)
_lhsImrules Options
_lhsIoptions Int
_lhsIprevMaxSimRefs Map NontermIdent (Set String)
_lhsIruledefs Map NontermIdent (Map String (Maybe NonLocalAttr))
_lhsIruleuses Bool
_lhsIuseParallel
        (T_VisitSteps_vOut52 Set String
_lhsOdefs Seq Error
_lhsOerrors Int
_lhsOindex Bool
_lhsOisLast Set String
_lhsOlazyIntras Int
_lhsOprevMaxSimRefs Map NontermIdent (Set VisitKind)
_lhsOruleKinds Map NontermIdent Int
_lhsOruleUsage PP_Doc
_lhsOsem_steps Int
_lhsOsize Map String (Maybe NonLocalAttr)
_lhsOuses Map Int VisitKind
_lhsOvisitKinds) <- forall (m :: * -> *) a. Monad m => a -> m a
return (T_VisitSteps_s53 -> T_VisitSteps_v52
inv_VisitSteps_s53 T_VisitSteps_s53
sem T_VisitSteps_vIn52
arg52)
        forall (m :: * -> *) a. Monad m => a -> m a
return (Set String
-> Seq Error
-> Int
-> Bool
-> Set String
-> Int
-> Map NontermIdent (Set VisitKind)
-> Map NontermIdent Int
-> PP_Doc
-> Int
-> Map String (Maybe NonLocalAttr)
-> Map Int VisitKind
-> Syn_VisitSteps
Syn_VisitSteps Set String
_lhsOdefs Seq Error
_lhsOerrors Int
_lhsOindex Bool
_lhsOisLast Set String
_lhsOlazyIntras Int
_lhsOprevMaxSimRefs Map NontermIdent (Set VisitKind)
_lhsOruleKinds Map NontermIdent Int
_lhsOruleUsage PP_Doc
_lhsOsem_steps Int
_lhsOsize Map String (Maybe NonLocalAttr)
_lhsOuses Map Int VisitKind
_lhsOvisitKinds)
   )

-- cata
{-# NOINLINE sem_VisitSteps #-}
sem_VisitSteps :: VisitSteps  -> T_VisitSteps 
sem_VisitSteps :: VisitSteps -> T_VisitSteps
sem_VisitSteps VisitSteps
list = forall (t :: * -> *) a b.
Foldable t =>
(a -> b -> b) -> b -> t a -> b
Prelude.foldr T_VisitStep -> T_VisitSteps -> T_VisitSteps
sem_VisitSteps_Cons T_VisitSteps
sem_VisitSteps_Nil (forall a b. (a -> b) -> [a] -> [b]
Prelude.map VisitStep -> T_VisitStep
sem_VisitStep VisitSteps
list)

-- semantic domain
newtype T_VisitSteps  = T_VisitSteps {
                                     T_VisitSteps -> Identity T_VisitSteps_s53
attach_T_VisitSteps :: Identity (T_VisitSteps_s53 )
                                     }
newtype T_VisitSteps_s53  = C_VisitSteps_s53 {
                                             T_VisitSteps_s53 -> T_VisitSteps_v52
inv_VisitSteps_s53 :: (T_VisitSteps_v52 )
                                             }
data T_VisitSteps_s54  = C_VisitSteps_s54
type T_VisitSteps_v52  = (T_VisitSteps_vIn52 ) -> (T_VisitSteps_vOut52 )
data T_VisitSteps_vIn52  = T_VisitSteps_vIn52 (Map VisitIdentifier (Int,Int)) (Map NontermIdent Int) (Map VisitIdentifier VisitKind) (Map VisitIdentifier (Identifier -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)) (Map VisitIdentifier (Set Identifier)) (Map VisitIdentifier (Set Identifier)) (Map Identifier Type) (Map Identifier (VisitKind -> Either Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))) (PP_Doc) (Int) (VisitKind) (Map Identifier (VisitKind ->  Either Error PP_Doc)) (Options) (Int) (Map Identifier (Set String)) (Map Identifier (Map String (Maybe NonLocalAttr))) (Bool)
data T_VisitSteps_vOut52  = T_VisitSteps_vOut52 (Set String) (Seq Error) (Int) (Bool) (Set String) (Int) (Map Identifier (Set VisitKind)) (Map Identifier Int) (PP_Doc) (Int) (Map String (Maybe NonLocalAttr)) (Map VisitIdentifier VisitKind)
{-# NOINLINE sem_VisitSteps_Cons #-}
sem_VisitSteps_Cons :: T_VisitStep  -> T_VisitSteps  -> T_VisitSteps 
sem_VisitSteps_Cons :: T_VisitStep -> T_VisitSteps -> T_VisitSteps
sem_VisitSteps_Cons T_VisitStep
arg_hd_ T_VisitSteps
arg_tl_ = Identity T_VisitSteps_s53 -> T_VisitSteps
T_VisitSteps (forall (m :: * -> *) a. Monad m => a -> m a
return T_VisitSteps_s53
st53) where
   {-# NOINLINE st53 #-}
   st53 :: T_VisitSteps_s53
st53 = let
      v52 :: T_VisitSteps_v52 
      v52 :: T_VisitSteps_v52
v52 = \ (T_VisitSteps_vIn52 Map Int (Int, Int)
_lhsIallFromToStates Map NontermIdent Int
_lhsIallInitStates Map Int VisitKind
_lhsIallVisitKinds Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_lhsIallchildvisit Map Int (Set NontermIdent)
_lhsIavisitdefs Map Int (Set NontermIdent)
_lhsIavisituses Attributes
_lhsIchildTypes Map
  NontermIdent
  (VisitKind
   -> Either
        Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
_lhsIchildintros PP_Doc
_lhsIfollow Int
_lhsIindex VisitKind
_lhsIkind Map NontermIdent (VisitKind -> Either Error PP_Doc)
_lhsImrules Options
_lhsIoptions Int
_lhsIprevMaxSimRefs Map NontermIdent (Set String)
_lhsIruledefs Map NontermIdent (Map String (Maybe NonLocalAttr))
_lhsIruleuses Bool
_lhsIuseParallel) -> ( let
         _hdX50 :: T_VisitStep_s50
_hdX50 = forall a. Identity a -> a
Control.Monad.Identity.runIdentity (T_VisitStep -> Identity T_VisitStep_s50
attach_T_VisitStep (T_VisitStep
arg_hd_))
         _tlX53 :: T_VisitSteps_s53
_tlX53 = forall a. Identity a -> a
Control.Monad.Identity.runIdentity (T_VisitSteps -> Identity T_VisitSteps_s53
attach_T_VisitSteps (T_VisitSteps
arg_tl_))
         (T_VisitStep_vOut49 Set String
_hdIdefs Seq Error
_hdIerrors Int
_hdIindex Bool
_hdIisLast Set String
_hdIlazyIntras Int
_hdIprevMaxSimRefs Map NontermIdent (Set VisitKind)
_hdIruleKinds Map NontermIdent Int
_hdIruleUsage PP_Doc
_hdIsem_steps Map String (Maybe NonLocalAttr)
_hdIuses Map Int VisitKind
_hdIvisitKinds) = T_VisitStep_s50 -> T_VisitStep_v49
inv_VisitStep_s50 T_VisitStep_s50
_hdX50 (Map Int (Int, Int)
-> Map NontermIdent Int
-> Map Int VisitKind
-> Map
     Int
     (NontermIdent
      -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
-> Map Int (Set NontermIdent)
-> Map Int (Set NontermIdent)
-> Attributes
-> Map
     NontermIdent
     (VisitKind
      -> Either
           Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
-> PP_Doc
-> Int
-> Bool
-> VisitKind
-> Map NontermIdent (VisitKind -> Either Error PP_Doc)
-> Options
-> Int
-> Map NontermIdent (Set String)
-> Map NontermIdent (Map String (Maybe NonLocalAttr))
-> Bool
-> T_VisitStep_vIn49
T_VisitStep_vIn49 Map Int (Int, Int)
_hdOallFromToStates Map NontermIdent Int
_hdOallInitStates Map Int VisitKind
_hdOallVisitKinds Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_hdOallchildvisit Map Int (Set NontermIdent)
_hdOavisitdefs Map Int (Set NontermIdent)
_hdOavisituses Attributes
_hdOchildTypes Map
  NontermIdent
  (VisitKind
   -> Either
        Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
_hdOchildintros PP_Doc
_hdOfollow Int
_hdOindex Bool
_hdOisLast VisitKind
_hdOkind Map NontermIdent (VisitKind -> Either Error PP_Doc)
_hdOmrules Options
_hdOoptions Int
_hdOprevMaxSimRefs Map NontermIdent (Set String)
_hdOruledefs Map NontermIdent (Map String (Maybe NonLocalAttr))
_hdOruleuses Bool
_hdOuseParallel)
         (T_VisitSteps_vOut52 Set String
_tlIdefs Seq Error
_tlIerrors Int
_tlIindex Bool
_tlIisLast Set String
_tlIlazyIntras Int
_tlIprevMaxSimRefs Map NontermIdent (Set VisitKind)
_tlIruleKinds Map NontermIdent Int
_tlIruleUsage PP_Doc
_tlIsem_steps Int
_tlIsize Map String (Maybe NonLocalAttr)
_tlIuses Map Int VisitKind
_tlIvisitKinds) = T_VisitSteps_s53 -> T_VisitSteps_v52
inv_VisitSteps_s53 T_VisitSteps_s53
_tlX53 (Map Int (Int, Int)
-> Map NontermIdent Int
-> Map Int VisitKind
-> Map
     Int
     (NontermIdent
      -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
-> Map Int (Set NontermIdent)
-> Map Int (Set NontermIdent)
-> Attributes
-> Map
     NontermIdent
     (VisitKind
      -> Either
           Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
-> PP_Doc
-> Int
-> VisitKind
-> Map NontermIdent (VisitKind -> Either Error PP_Doc)
-> Options
-> Int
-> Map NontermIdent (Set String)
-> Map NontermIdent (Map String (Maybe NonLocalAttr))
-> Bool
-> T_VisitSteps_vIn52
T_VisitSteps_vIn52 Map Int (Int, Int)
_tlOallFromToStates Map NontermIdent Int
_tlOallInitStates Map Int VisitKind
_tlOallVisitKinds Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_tlOallchildvisit Map Int (Set NontermIdent)
_tlOavisitdefs Map Int (Set NontermIdent)
_tlOavisituses Attributes
_tlOchildTypes Map
  NontermIdent
  (VisitKind
   -> Either
        Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
_tlOchildintros PP_Doc
_tlOfollow Int
_tlOindex VisitKind
_tlOkind Map NontermIdent (VisitKind -> Either Error PP_Doc)
_tlOmrules Options
_tlOoptions Int
_tlOprevMaxSimRefs Map NontermIdent (Set String)
_tlOruledefs Map NontermIdent (Map String (Maybe NonLocalAttr))
_tlOruleuses Bool
_tlOuseParallel)
         _hdOfollow :: PP_Doc
_hdOfollow = PP_Doc -> PP_Doc
rule692 PP_Doc
_tlIsem_steps
         _lhsOsem_steps :: PP_Doc
         _lhsOsem_steps :: PP_Doc
_lhsOsem_steps = PP_Doc -> PP_Doc
rule693 PP_Doc
_hdIsem_steps
         _lhsOsize :: Int
         _lhsOsize :: Int
_lhsOsize = Int -> Int
rule694 Int
_tlIsize
         _hdOindex :: Int
_hdOindex = Int -> Int
rule695 Int
_lhsIindex
         _tlOindex :: Int
_tlOindex = Int -> Int
rule696 Int
_lhsIindex
         _lhsOindex :: Int
         _lhsOindex :: Int
_lhsOindex = Int -> Int
rule697 Int
_tlIindex
         _lhsOisLast :: Bool
         _lhsOisLast :: Bool
_lhsOisLast = () -> Bool
rule698  ()
         _hdOisLast :: Bool
_hdOisLast = Bool -> Bool
rule699 Bool
_tlIisLast
         _lhsOdefs :: Set String
         _lhsOdefs :: Set String
_lhsOdefs = Set String -> Set String -> Set String
rule700 Set String
_hdIdefs Set String
_tlIdefs
         _lhsOerrors :: Seq Error
         _lhsOerrors :: Seq Error
_lhsOerrors = Seq Error -> Seq Error -> Seq Error
rule701 Seq Error
_hdIerrors Seq Error
_tlIerrors
         _lhsOlazyIntras :: Set String
         _lhsOlazyIntras :: Set String
_lhsOlazyIntras = Set String -> Set String -> Set String
rule702 Set String
_hdIlazyIntras Set String
_tlIlazyIntras
         _lhsOruleKinds :: Map Identifier (Set VisitKind)
         _lhsOruleKinds :: Map NontermIdent (Set VisitKind)
_lhsOruleKinds = Map NontermIdent (Set VisitKind)
-> Map NontermIdent (Set VisitKind)
-> Map NontermIdent (Set VisitKind)
rule703 Map NontermIdent (Set VisitKind)
_hdIruleKinds Map NontermIdent (Set VisitKind)
_tlIruleKinds
         _lhsOruleUsage :: Map Identifier Int
         _lhsOruleUsage :: Map NontermIdent Int
_lhsOruleUsage = Map NontermIdent Int
-> Map NontermIdent Int -> Map NontermIdent Int
rule704 Map NontermIdent Int
_hdIruleUsage Map NontermIdent Int
_tlIruleUsage
         _lhsOuses :: Map String (Maybe NonLocalAttr)
         _lhsOuses :: Map String (Maybe NonLocalAttr)
_lhsOuses = Map String (Maybe NonLocalAttr)
-> Map String (Maybe NonLocalAttr)
-> Map String (Maybe NonLocalAttr)
rule705 Map String (Maybe NonLocalAttr)
_hdIuses Map String (Maybe NonLocalAttr)
_tlIuses
         _lhsOvisitKinds :: Map VisitIdentifier VisitKind
         _lhsOvisitKinds :: Map Int VisitKind
_lhsOvisitKinds = Map Int VisitKind -> Map Int VisitKind -> Map Int VisitKind
rule706 Map Int VisitKind
_hdIvisitKinds Map Int VisitKind
_tlIvisitKinds
         _lhsOprevMaxSimRefs :: Int
         _lhsOprevMaxSimRefs :: Int
_lhsOprevMaxSimRefs = Int -> Int
rule707 Int
_tlIprevMaxSimRefs
         _hdOallFromToStates :: Map Int (Int, Int)
_hdOallFromToStates = Map Int (Int, Int) -> Map Int (Int, Int)
rule708 Map Int (Int, Int)
_lhsIallFromToStates
         _hdOallInitStates :: Map NontermIdent Int
_hdOallInitStates = Map NontermIdent Int -> Map NontermIdent Int
rule709 Map NontermIdent Int
_lhsIallInitStates
         _hdOallVisitKinds :: Map Int VisitKind
_hdOallVisitKinds = Map Int VisitKind -> Map Int VisitKind
rule710 Map Int VisitKind
_lhsIallVisitKinds
         _hdOallchildvisit :: Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_hdOallchildvisit = Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
-> Map
     Int
     (NontermIdent
      -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
rule711 Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_lhsIallchildvisit
         _hdOavisitdefs :: Map Int (Set NontermIdent)
_hdOavisitdefs = Map Int (Set NontermIdent) -> Map Int (Set NontermIdent)
rule712 Map Int (Set NontermIdent)
_lhsIavisitdefs
         _hdOavisituses :: Map Int (Set NontermIdent)
_hdOavisituses = Map Int (Set NontermIdent) -> Map Int (Set NontermIdent)
rule713 Map Int (Set NontermIdent)
_lhsIavisituses
         _hdOchildTypes :: Attributes
_hdOchildTypes = Attributes -> Attributes
rule714 Attributes
_lhsIchildTypes
         _hdOchildintros :: Map
  NontermIdent
  (VisitKind
   -> Either
        Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
_hdOchildintros = Map
  NontermIdent
  (VisitKind
   -> Either
        Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
-> Map
     NontermIdent
     (VisitKind
      -> Either
           Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
rule715 Map
  NontermIdent
  (VisitKind
   -> Either
        Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
_lhsIchildintros
         _hdOkind :: VisitKind
_hdOkind = VisitKind -> VisitKind
rule716 VisitKind
_lhsIkind
         _hdOmrules :: Map NontermIdent (VisitKind -> Either Error PP_Doc)
_hdOmrules = Map NontermIdent (VisitKind -> Either Error PP_Doc)
-> Map NontermIdent (VisitKind -> Either Error PP_Doc)
rule717 Map NontermIdent (VisitKind -> Either Error PP_Doc)
_lhsImrules
         _hdOoptions :: Options
_hdOoptions = Options -> Options
rule718 Options
_lhsIoptions
         _hdOprevMaxSimRefs :: Int
_hdOprevMaxSimRefs = Int -> Int
rule719 Int
_lhsIprevMaxSimRefs
         _hdOruledefs :: Map NontermIdent (Set String)
_hdOruledefs = Map NontermIdent (Set String) -> Map NontermIdent (Set String)
rule720 Map NontermIdent (Set String)
_lhsIruledefs
         _hdOruleuses :: Map NontermIdent (Map String (Maybe NonLocalAttr))
_hdOruleuses = Map NontermIdent (Map String (Maybe NonLocalAttr))
-> Map NontermIdent (Map String (Maybe NonLocalAttr))
rule721 Map NontermIdent (Map String (Maybe NonLocalAttr))
_lhsIruleuses
         _hdOuseParallel :: Bool
_hdOuseParallel = Bool -> Bool
rule722 Bool
_lhsIuseParallel
         _tlOallFromToStates :: Map Int (Int, Int)
_tlOallFromToStates = Map Int (Int, Int) -> Map Int (Int, Int)
rule723 Map Int (Int, Int)
_lhsIallFromToStates
         _tlOallInitStates :: Map NontermIdent Int
_tlOallInitStates = Map NontermIdent Int -> Map NontermIdent Int
rule724 Map NontermIdent Int
_lhsIallInitStates
         _tlOallVisitKinds :: Map Int VisitKind
_tlOallVisitKinds = Map Int VisitKind -> Map Int VisitKind
rule725 Map Int VisitKind
_lhsIallVisitKinds
         _tlOallchildvisit :: Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_tlOallchildvisit = Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
-> Map
     Int
     (NontermIdent
      -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
rule726 Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_lhsIallchildvisit
         _tlOavisitdefs :: Map Int (Set NontermIdent)
_tlOavisitdefs = Map Int (Set NontermIdent) -> Map Int (Set NontermIdent)
rule727 Map Int (Set NontermIdent)
_lhsIavisitdefs
         _tlOavisituses :: Map Int (Set NontermIdent)
_tlOavisituses = Map Int (Set NontermIdent) -> Map Int (Set NontermIdent)
rule728 Map Int (Set NontermIdent)
_lhsIavisituses
         _tlOchildTypes :: Attributes
_tlOchildTypes = Attributes -> Attributes
rule729 Attributes
_lhsIchildTypes
         _tlOchildintros :: Map
  NontermIdent
  (VisitKind
   -> Either
        Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
_tlOchildintros = Map
  NontermIdent
  (VisitKind
   -> Either
        Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
-> Map
     NontermIdent
     (VisitKind
      -> Either
           Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
rule730 Map
  NontermIdent
  (VisitKind
   -> Either
        Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
_lhsIchildintros
         _tlOfollow :: PP_Doc
_tlOfollow = PP_Doc -> PP_Doc
rule731 PP_Doc
_lhsIfollow
         _tlOkind :: VisitKind
_tlOkind = VisitKind -> VisitKind
rule732 VisitKind
_lhsIkind
         _tlOmrules :: Map NontermIdent (VisitKind -> Either Error PP_Doc)
_tlOmrules = Map NontermIdent (VisitKind -> Either Error PP_Doc)
-> Map NontermIdent (VisitKind -> Either Error PP_Doc)
rule733 Map NontermIdent (VisitKind -> Either Error PP_Doc)
_lhsImrules
         _tlOoptions :: Options
_tlOoptions = Options -> Options
rule734 Options
_lhsIoptions
         _tlOprevMaxSimRefs :: Int
_tlOprevMaxSimRefs = Int -> Int
rule735 Int
_hdIprevMaxSimRefs
         _tlOruledefs :: Map NontermIdent (Set String)
_tlOruledefs = Map NontermIdent (Set String) -> Map NontermIdent (Set String)
rule736 Map NontermIdent (Set String)
_lhsIruledefs
         _tlOruleuses :: Map NontermIdent (Map String (Maybe NonLocalAttr))
_tlOruleuses = Map NontermIdent (Map String (Maybe NonLocalAttr))
-> Map NontermIdent (Map String (Maybe NonLocalAttr))
rule737 Map NontermIdent (Map String (Maybe NonLocalAttr))
_lhsIruleuses
         _tlOuseParallel :: Bool
_tlOuseParallel = Bool -> Bool
rule738 Bool
_lhsIuseParallel
         __result_ :: T_VisitSteps_vOut52
__result_ = Set String
-> Seq Error
-> Int
-> Bool
-> Set String
-> Int
-> Map NontermIdent (Set VisitKind)
-> Map NontermIdent Int
-> PP_Doc
-> Int
-> Map String (Maybe NonLocalAttr)
-> Map Int VisitKind
-> T_VisitSteps_vOut52
T_VisitSteps_vOut52 Set String
_lhsOdefs Seq Error
_lhsOerrors Int
_lhsOindex Bool
_lhsOisLast Set String
_lhsOlazyIntras Int
_lhsOprevMaxSimRefs Map NontermIdent (Set VisitKind)
_lhsOruleKinds Map NontermIdent Int
_lhsOruleUsage PP_Doc
_lhsOsem_steps Int
_lhsOsize Map String (Maybe NonLocalAttr)
_lhsOuses Map Int VisitKind
_lhsOvisitKinds
         in T_VisitSteps_vOut52
__result_ )
     in T_VisitSteps_v52 -> T_VisitSteps_s53
C_VisitSteps_s53 T_VisitSteps_v52
v52
   {-# INLINE rule692 #-}
   {-# LINE 844 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule692 = \ ((_tlIsem_steps) :: PP_Doc) ->
                            {-# LINE 844 "src-ag/ExecutionPlan2Caml.ag" #-}
                            _tlIsem_steps
                            {-# LINE 5541 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule693 #-}
   {-# LINE 845 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule693 = \ ((_hdIsem_steps) :: PP_Doc) ->
                            {-# LINE 845 "src-ag/ExecutionPlan2Caml.ag" #-}
                            _hdIsem_steps
                            {-# LINE 5547 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule694 #-}
   {-# LINE 876 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule694 = \ ((_tlIsize) :: Int) ->
                      {-# LINE 876 "src-ag/ExecutionPlan2Caml.ag" #-}
                      1 + _tlIsize
                      {-# LINE 5553 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule695 #-}
   {-# LINE 881 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule695 = \ ((_lhsIindex) :: Int) ->
                {-# LINE 881 "src-ag/ExecutionPlan2Caml.ag" #-}
                _lhsIindex
                {-# LINE 5559 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule696 #-}
   {-# LINE 882 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule696 = \ ((_lhsIindex) :: Int) ->
                {-# LINE 882 "src-ag/ExecutionPlan2Caml.ag" #-}
                1 + _lhsIindex
                {-# LINE 5565 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule697 #-}
   {-# LINE 883 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule697 = \ ((_tlIindex) :: Int) ->
                {-# LINE 883 "src-ag/ExecutionPlan2Caml.ag" #-}
                _tlIindex
                {-# LINE 5571 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule698 #-}
   {-# LINE 902 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule698 = \  (_ :: ()) ->
                         {-# LINE 902 "src-ag/ExecutionPlan2Caml.ag" #-}
                         False
                         {-# LINE 5577 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule699 #-}
   {-# LINE 903 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule699 = \ ((_tlIisLast) :: Bool) ->
                         {-# LINE 903 "src-ag/ExecutionPlan2Caml.ag" #-}
                         _tlIisLast
                         {-# LINE 5583 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule700 #-}
   rule700 = \ ((_hdIdefs) :: Set String) ((_tlIdefs) :: Set String) ->
     _hdIdefs `Set.union` _tlIdefs
   {-# INLINE rule701 #-}
   rule701 = \ ((_hdIerrors) :: Seq Error) ((_tlIerrors) :: Seq Error) ->
     _hdIerrors Seq.>< _tlIerrors
   {-# INLINE rule702 #-}
   rule702 = \ ((_hdIlazyIntras) :: Set String) ((_tlIlazyIntras) :: Set String) ->
     _hdIlazyIntras `Set.union` _tlIlazyIntras
   {-# INLINE rule703 #-}
   rule703 = \ ((_hdIruleKinds) :: Map Identifier (Set VisitKind)) ((_tlIruleKinds) :: Map Identifier (Set VisitKind)) ->
     _hdIruleKinds `unionWithMappend` _tlIruleKinds
   {-# INLINE rule704 #-}
   rule704 = \ ((_hdIruleUsage) :: Map Identifier Int) ((_tlIruleUsage) :: Map Identifier Int) ->
     _hdIruleUsage `unionWithSum` _tlIruleUsage
   {-# INLINE rule705 #-}
   rule705 = \ ((_hdIuses) :: Map String (Maybe NonLocalAttr)) ((_tlIuses) :: Map String (Maybe NonLocalAttr)) ->
     _hdIuses `Map.union` _tlIuses
   {-# INLINE rule706 #-}
   rule706 = \ ((_hdIvisitKinds) :: Map VisitIdentifier VisitKind) ((_tlIvisitKinds) :: Map VisitIdentifier VisitKind) ->
     _hdIvisitKinds `mappend` _tlIvisitKinds
   {-# INLINE rule707 #-}
   rule707 = \ ((_tlIprevMaxSimRefs) :: Int) ->
     _tlIprevMaxSimRefs
   {-# INLINE rule708 #-}
   rule708 = \ ((_lhsIallFromToStates) :: Map VisitIdentifier (Int,Int)) ->
     _lhsIallFromToStates
   {-# INLINE rule709 #-}
   rule709 = \ ((_lhsIallInitStates) :: Map NontermIdent Int) ->
     _lhsIallInitStates
   {-# INLINE rule710 #-}
   rule710 = \ ((_lhsIallVisitKinds) :: Map VisitIdentifier VisitKind) ->
     _lhsIallVisitKinds
   {-# INLINE rule711 #-}
   rule711 = \ ((_lhsIallchildvisit) :: Map VisitIdentifier (Identifier -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)) ->
     _lhsIallchildvisit
   {-# INLINE rule712 #-}
   rule712 = \ ((_lhsIavisitdefs) :: Map VisitIdentifier (Set Identifier)) ->
     _lhsIavisitdefs
   {-# INLINE rule713 #-}
   rule713 = \ ((_lhsIavisituses) :: Map VisitIdentifier (Set Identifier)) ->
     _lhsIavisituses
   {-# INLINE rule714 #-}
   rule714 = \ ((_lhsIchildTypes) :: Map Identifier Type) ->
     _lhsIchildTypes
   {-# INLINE rule715 #-}
   rule715 = \ ((_lhsIchildintros) :: Map Identifier (VisitKind -> Either Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))) ->
     _lhsIchildintros
   {-# INLINE rule716 #-}
   rule716 = \ ((_lhsIkind) :: VisitKind) ->
     _lhsIkind
   {-# INLINE rule717 #-}
   rule717 = \ ((_lhsImrules) :: Map Identifier (VisitKind ->  Either Error PP_Doc)) ->
     _lhsImrules
   {-# INLINE rule718 #-}
   rule718 = \ ((_lhsIoptions) :: Options) ->
     _lhsIoptions
   {-# INLINE rule719 #-}
   rule719 = \ ((_lhsIprevMaxSimRefs) :: Int) ->
     _lhsIprevMaxSimRefs
   {-# INLINE rule720 #-}
   rule720 = \ ((_lhsIruledefs) :: Map Identifier (Set String)) ->
     _lhsIruledefs
   {-# INLINE rule721 #-}
   rule721 = \ ((_lhsIruleuses) :: Map Identifier (Map String (Maybe NonLocalAttr))) ->
     _lhsIruleuses
   {-# INLINE rule722 #-}
   rule722 = \ ((_lhsIuseParallel) :: Bool) ->
     _lhsIuseParallel
   {-# INLINE rule723 #-}
   rule723 = \ ((_lhsIallFromToStates) :: Map VisitIdentifier (Int,Int)) ->
     _lhsIallFromToStates
   {-# INLINE rule724 #-}
   rule724 = \ ((_lhsIallInitStates) :: Map NontermIdent Int) ->
     _lhsIallInitStates
   {-# INLINE rule725 #-}
   rule725 = \ ((_lhsIallVisitKinds) :: Map VisitIdentifier VisitKind) ->
     _lhsIallVisitKinds
   {-# INLINE rule726 #-}
   rule726 = \ ((_lhsIallchildvisit) :: Map VisitIdentifier (Identifier -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)) ->
     _lhsIallchildvisit
   {-# INLINE rule727 #-}
   rule727 = \ ((_lhsIavisitdefs) :: Map VisitIdentifier (Set Identifier)) ->
     _lhsIavisitdefs
   {-# INLINE rule728 #-}
   rule728 = \ ((_lhsIavisituses) :: Map VisitIdentifier (Set Identifier)) ->
     _lhsIavisituses
   {-# INLINE rule729 #-}
   rule729 = \ ((_lhsIchildTypes) :: Map Identifier Type) ->
     _lhsIchildTypes
   {-# INLINE rule730 #-}
   rule730 = \ ((_lhsIchildintros) :: Map Identifier (VisitKind -> Either Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))) ->
     _lhsIchildintros
   {-# INLINE rule731 #-}
   rule731 = \ ((_lhsIfollow) :: PP_Doc) ->
     _lhsIfollow
   {-# INLINE rule732 #-}
   rule732 = \ ((_lhsIkind) :: VisitKind) ->
     _lhsIkind
   {-# INLINE rule733 #-}
   rule733 = \ ((_lhsImrules) :: Map Identifier (VisitKind ->  Either Error PP_Doc)) ->
     _lhsImrules
   {-# INLINE rule734 #-}
   rule734 = \ ((_lhsIoptions) :: Options) ->
     _lhsIoptions
   {-# INLINE rule735 #-}
   rule735 = \ ((_hdIprevMaxSimRefs) :: Int) ->
     _hdIprevMaxSimRefs
   {-# INLINE rule736 #-}
   rule736 = \ ((_lhsIruledefs) :: Map Identifier (Set String)) ->
     _lhsIruledefs
   {-# INLINE rule737 #-}
   rule737 = \ ((_lhsIruleuses) :: Map Identifier (Map String (Maybe NonLocalAttr))) ->
     _lhsIruleuses
   {-# INLINE rule738 #-}
   rule738 = \ ((_lhsIuseParallel) :: Bool) ->
     _lhsIuseParallel
{-# NOINLINE sem_VisitSteps_Nil #-}
sem_VisitSteps_Nil ::  T_VisitSteps 
sem_VisitSteps_Nil :: T_VisitSteps
sem_VisitSteps_Nil  = Identity T_VisitSteps_s53 -> T_VisitSteps
T_VisitSteps (forall (m :: * -> *) a. Monad m => a -> m a
return T_VisitSteps_s53
st53) where
   {-# NOINLINE st53 #-}
   st53 :: T_VisitSteps_s53
st53 = let
      v52 :: T_VisitSteps_v52 
      v52 :: T_VisitSteps_v52
v52 = \ (T_VisitSteps_vIn52 Map Int (Int, Int)
_lhsIallFromToStates Map NontermIdent Int
_lhsIallInitStates Map Int VisitKind
_lhsIallVisitKinds Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_lhsIallchildvisit Map Int (Set NontermIdent)
_lhsIavisitdefs Map Int (Set NontermIdent)
_lhsIavisituses Attributes
_lhsIchildTypes Map
  NontermIdent
  (VisitKind
   -> Either
        Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
_lhsIchildintros PP_Doc
_lhsIfollow Int
_lhsIindex VisitKind
_lhsIkind Map NontermIdent (VisitKind -> Either Error PP_Doc)
_lhsImrules Options
_lhsIoptions Int
_lhsIprevMaxSimRefs Map NontermIdent (Set String)
_lhsIruledefs Map NontermIdent (Map String (Maybe NonLocalAttr))
_lhsIruleuses Bool
_lhsIuseParallel) -> ( let
         _lhsOsem_steps :: PP_Doc
         _lhsOsem_steps :: PP_Doc
_lhsOsem_steps = PP_Doc -> PP_Doc
rule739 PP_Doc
_lhsIfollow
         _lhsOsize :: Int
         _lhsOsize :: Int
_lhsOsize = () -> Int
rule740  ()
         _lhsOisLast :: Bool
         _lhsOisLast :: Bool
_lhsOisLast = () -> Bool
rule741  ()
         _lhsOdefs :: Set String
         _lhsOdefs :: Set String
_lhsOdefs = forall {a}. () -> Set a
rule742  ()
         _lhsOerrors :: Seq Error
         _lhsOerrors :: Seq Error
_lhsOerrors = forall {a}. () -> Seq a
rule743  ()
         _lhsOlazyIntras :: Set String
         _lhsOlazyIntras :: Set String
_lhsOlazyIntras = forall {a}. () -> Set a
rule744  ()
         _lhsOruleKinds :: Map Identifier (Set VisitKind)
         _lhsOruleKinds :: Map NontermIdent (Set VisitKind)
_lhsOruleKinds = forall {k} {a}. () -> Map k a
rule745  ()
         _lhsOruleUsage :: Map Identifier Int
         _lhsOruleUsage :: Map NontermIdent Int
_lhsOruleUsage = forall {k} {a}. () -> Map k a
rule746  ()
         _lhsOuses :: Map String (Maybe NonLocalAttr)
         _lhsOuses :: Map String (Maybe NonLocalAttr)
_lhsOuses = forall {k} {a}. () -> Map k a
rule747  ()
         _lhsOvisitKinds :: Map VisitIdentifier VisitKind
         _lhsOvisitKinds :: Map Int VisitKind
_lhsOvisitKinds = () -> Map Int VisitKind
rule748  ()
         _lhsOindex :: Int
         _lhsOindex :: Int
_lhsOindex = Int -> Int
rule749 Int
_lhsIindex
         _lhsOprevMaxSimRefs :: Int
         _lhsOprevMaxSimRefs :: Int
_lhsOprevMaxSimRefs = Int -> Int
rule750 Int
_lhsIprevMaxSimRefs
         __result_ :: T_VisitSteps_vOut52
__result_ = Set String
-> Seq Error
-> Int
-> Bool
-> Set String
-> Int
-> Map NontermIdent (Set VisitKind)
-> Map NontermIdent Int
-> PP_Doc
-> Int
-> Map String (Maybe NonLocalAttr)
-> Map Int VisitKind
-> T_VisitSteps_vOut52
T_VisitSteps_vOut52 Set String
_lhsOdefs Seq Error
_lhsOerrors Int
_lhsOindex Bool
_lhsOisLast Set String
_lhsOlazyIntras Int
_lhsOprevMaxSimRefs Map NontermIdent (Set VisitKind)
_lhsOruleKinds Map NontermIdent Int
_lhsOruleUsage PP_Doc
_lhsOsem_steps Int
_lhsOsize Map String (Maybe NonLocalAttr)
_lhsOuses Map Int VisitKind
_lhsOvisitKinds
         in T_VisitSteps_vOut52
__result_ )
     in T_VisitSteps_v52 -> T_VisitSteps_s53
C_VisitSteps_s53 T_VisitSteps_v52
v52
   {-# INLINE rule739 #-}
   {-# LINE 846 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule739 = \ ((_lhsIfollow) :: PP_Doc) ->
                            {-# LINE 846 "src-ag/ExecutionPlan2Caml.ag" #-}
                            _lhsIfollow
                            {-# LINE 5740 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule740 #-}
   {-# LINE 875 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule740 = \  (_ :: ()) ->
                      {-# LINE 875 "src-ag/ExecutionPlan2Caml.ag" #-}
                      0
                      {-# LINE 5746 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule741 #-}
   {-# LINE 901 "src-ag/ExecutionPlan2Caml.ag" #-}
   rule741 = \  (_ :: ()) ->
                         {-# LINE 901 "src-ag/ExecutionPlan2Caml.ag" #-}
                         True
                         {-# LINE 5752 "src-generated/ExecutionPlan2Caml.hs" #-}
   {-# INLINE rule742 #-}
   rule742 = \  (_ :: ()) ->
     Set.empty
   {-# INLINE rule743 #-}
   rule743 = \  (_ :: ()) ->
     Seq.empty
   {-# INLINE rule744 #-}
   rule744 = \  (_ :: ()) ->
     Set.empty
   {-# INLINE rule745 #-}
   rule745 = \  (_ :: ()) ->
     Map.empty
   {-# INLINE rule746 #-}
   rule746 = \  (_ :: ()) ->
     Map.empty
   {-# INLINE rule747 #-}
   rule747 = \  (_ :: ()) ->
     Map.empty
   {-# INLINE rule748 #-}
   rule748 = \  (_ :: ()) ->
     mempty
   {-# INLINE rule749 #-}
   rule749 = \ ((_lhsIindex) :: Int) ->
     _lhsIindex
   {-# INLINE rule750 #-}
   rule750 = \ ((_lhsIprevMaxSimRefs) :: Int) ->
     _lhsIprevMaxSimRefs

-- Visits ------------------------------------------------------
-- wrapper
data Inh_Visits  = Inh_Visits { Inh_Visits -> Map Int (Int, Int)
allFromToStates_Inh_Visits :: (Map VisitIdentifier (Int,Int)), Inh_Visits -> Map NontermIdent Attributes
allInhmap_Inh_Visits :: (Map NontermIdent Attributes), Inh_Visits -> Map NontermIdent Int
allInitStates_Inh_Visits :: (Map NontermIdent Int), Inh_Visits -> Map NontermIdent Attributes
allSynmap_Inh_Visits :: (Map NontermIdent Attributes), Inh_Visits -> Map Int VisitKind
allVisitKinds_Inh_Visits :: (Map VisitIdentifier VisitKind), Inh_Visits
-> Map
     Int
     (NontermIdent
      -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
allchildvisit_Inh_Visits :: (Map VisitIdentifier (Identifier -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)), Inh_Visits -> Map Int (Map String (Maybe NonLocalAttr))
allintramap_Inh_Visits :: (Map StateIdentifier (Map String (Maybe NonLocalAttr))), Inh_Visits -> Map Int (Set NontermIdent)
avisitdefs_Inh_Visits :: (Map VisitIdentifier (Set Identifier)), Inh_Visits -> Map Int (Set NontermIdent)
avisituses_Inh_Visits :: (Map VisitIdentifier (Set Identifier)), Inh_Visits -> Attributes
childTypes_Inh_Visits :: (Map Identifier Type), Inh_Visits
-> Map
     NontermIdent
     (VisitKind
      -> Either
           Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
childintros_Inh_Visits :: (Map Identifier (VisitKind -> Either Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))), Inh_Visits -> NontermIdent
con_Inh_Visits :: (ConstructorIdent), Inh_Visits -> Attributes
inhmap_Inh_Visits :: (Attributes), Inh_Visits -> Map NontermIdent (VisitKind -> Either Error PP_Doc)
mrules_Inh_Visits :: (Map Identifier (VisitKind ->  Either Error PP_Doc)), Inh_Visits -> Map Int StateCtx
nextVisits_Inh_Visits :: (Map StateIdentifier StateCtx), Inh_Visits -> NontermIdent
nt_Inh_Visits :: (NontermIdent), Inh_Visits -> Options
options_Inh_Visits :: (Options), Inh_Visits -> [NontermIdent]
params_Inh_Visits :: ([Identifier]), Inh_Visits -> Map Int StateCtx
prevVisits_Inh_Visits :: (Map StateIdentifier StateCtx), Inh_Visits -> Map NontermIdent (Set String)
ruledefs_Inh_Visits :: (Map Identifier (Set String)), Inh_Visits -> Map NontermIdent (Map String (Maybe NonLocalAttr))
ruleuses_Inh_Visits :: (Map Identifier (Map String (Maybe NonLocalAttr))), Inh_Visits -> Attributes
synmap_Inh_Visits :: (Attributes), Inh_Visits -> Set String
terminaldefs_Inh_Visits :: (Set String) }
data Syn_Visits  = Syn_Visits { Syn_Visits -> [VisitStateState]
allvisits_Syn_Visits :: ([VisitStateState]), Syn_Visits
-> Map
     Int
     (NontermIdent
      -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
childvisit_Syn_Visits :: (Map VisitIdentifier (Identifier -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)), Syn_Visits -> Seq Error
errors_Syn_Visits :: (Seq Error), Syn_Visits -> Map Int (Int, Int)
fromToStates_Syn_Visits :: (Map VisitIdentifier (Int,Int)), Syn_Visits -> Map Int (Map String (Maybe NonLocalAttr))
intramap_Syn_Visits :: (Map StateIdentifier (Map String (Maybe NonLocalAttr))), Syn_Visits -> Set String
lazyIntras_Syn_Visits :: (Set String), Syn_Visits -> Map NontermIdent (Set VisitKind)
ruleKinds_Syn_Visits :: (Map Identifier (Set VisitKind)), Syn_Visits -> Map NontermIdent Int
ruleUsage_Syn_Visits :: (Map Identifier Int), Syn_Visits -> [(Int, PP_Doc)]
sem_visit_Syn_Visits :: ( [(StateIdentifier,PP_Doc)] ), Syn_Visits -> PP_Doc
t_visits_Syn_Visits :: (PP_Doc), Syn_Visits -> Map Int VisitKind
visitKinds_Syn_Visits :: (Map VisitIdentifier VisitKind), Syn_Visits -> Map Int (Set NontermIdent)
visitdefs_Syn_Visits :: (Map VisitIdentifier (Set Identifier)), Syn_Visits -> Map Int (Set NontermIdent)
visituses_Syn_Visits :: (Map VisitIdentifier (Set Identifier)) }
{-# INLINABLE wrap_Visits #-}
wrap_Visits :: T_Visits  -> Inh_Visits  -> (Syn_Visits )
wrap_Visits :: T_Visits -> Inh_Visits -> Syn_Visits
wrap_Visits (T_Visits Identity T_Visits_s56
act) (Inh_Visits Map Int (Int, Int)
_lhsIallFromToStates Map NontermIdent Attributes
_lhsIallInhmap Map NontermIdent Int
_lhsIallInitStates Map NontermIdent Attributes
_lhsIallSynmap Map Int VisitKind
_lhsIallVisitKinds Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_lhsIallchildvisit Map Int (Map String (Maybe NonLocalAttr))
_lhsIallintramap Map Int (Set NontermIdent)
_lhsIavisitdefs Map Int (Set NontermIdent)
_lhsIavisituses Attributes
_lhsIchildTypes Map
  NontermIdent
  (VisitKind
   -> Either
        Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
_lhsIchildintros NontermIdent
_lhsIcon Attributes
_lhsIinhmap Map NontermIdent (VisitKind -> Either Error PP_Doc)
_lhsImrules Map Int StateCtx
_lhsInextVisits NontermIdent
_lhsInt Options
_lhsIoptions [NontermIdent]
_lhsIparams Map Int StateCtx
_lhsIprevVisits Map NontermIdent (Set String)
_lhsIruledefs Map NontermIdent (Map String (Maybe NonLocalAttr))
_lhsIruleuses Attributes
_lhsIsynmap Set String
_lhsIterminaldefs) =
   forall a. Identity a -> a
Control.Monad.Identity.runIdentity (
     do T_Visits_s56
sem <- Identity T_Visits_s56
act
        let arg55 :: T_Visits_vIn55
arg55 = Map Int (Int, Int)
-> Map NontermIdent Attributes
-> Map NontermIdent Int
-> Map NontermIdent Attributes
-> Map Int VisitKind
-> Map
     Int
     (NontermIdent
      -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
-> Map Int (Map String (Maybe NonLocalAttr))
-> Map Int (Set NontermIdent)
-> Map Int (Set NontermIdent)
-> Attributes
-> Map
     NontermIdent
     (VisitKind
      -> Either
           Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
-> NontermIdent
-> Attributes
-> Map NontermIdent (VisitKind -> Either Error PP_Doc)
-> Map Int StateCtx
-> NontermIdent
-> Options
-> [NontermIdent]
-> Map Int StateCtx
-> Map NontermIdent (Set String)
-> Map NontermIdent (Map String (Maybe NonLocalAttr))
-> Attributes
-> Set String
-> T_Visits_vIn55
T_Visits_vIn55 Map Int (Int, Int)
_lhsIallFromToStates Map NontermIdent Attributes
_lhsIallInhmap Map NontermIdent Int
_lhsIallInitStates Map NontermIdent Attributes
_lhsIallSynmap Map Int VisitKind
_lhsIallVisitKinds Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_lhsIallchildvisit Map Int (Map String (Maybe NonLocalAttr))
_lhsIallintramap Map Int (Set NontermIdent)
_lhsIavisitdefs Map Int (Set NontermIdent)
_lhsIavisituses Attributes
_lhsIchildTypes Map
  NontermIdent
  (VisitKind
   -> Either
        Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
_lhsIchildintros NontermIdent
_lhsIcon Attributes
_lhsIinhmap Map NontermIdent (VisitKind -> Either Error PP_Doc)
_lhsImrules Map Int StateCtx
_lhsInextVisits NontermIdent
_lhsInt Options
_lhsIoptions [NontermIdent]
_lhsIparams Map Int StateCtx
_lhsIprevVisits Map NontermIdent (Set String)
_lhsIruledefs Map NontermIdent (Map String (Maybe NonLocalAttr))
_lhsIruleuses Attributes
_lhsIsynmap Set String
_lhsIterminaldefs
        (T_Visits_vOut55 [VisitStateState]
_lhsOallvisits Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_lhsOchildvisit Seq Error
_lhsOerrors Map Int (Int, Int)
_lhsOfromToStates Map Int (Map String (Maybe NonLocalAttr))
_lhsOintramap Set String
_lhsOlazyIntras Map NontermIdent (Set VisitKind)
_lhsOruleKinds Map NontermIdent Int
_lhsOruleUsage [(Int, PP_Doc)]
_lhsOsem_visit PP_Doc
_lhsOt_visits Map Int VisitKind
_lhsOvisitKinds Map Int (Set NontermIdent)
_lhsOvisitdefs Map Int (Set NontermIdent)
_lhsOvisituses) <- forall (m :: * -> *) a. Monad m => a -> m a
return (T_Visits_s56 -> T_Visits_v55
inv_Visits_s56 T_Visits_s56
sem T_Visits_vIn55
arg55)
        forall (m :: * -> *) a. Monad m => a -> m a
return ([VisitStateState]
-> Map
     Int
     (NontermIdent
      -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
-> Seq Error
-> Map Int (Int, Int)
-> Map Int (Map String (Maybe NonLocalAttr))
-> Set String
-> Map NontermIdent (Set VisitKind)
-> Map NontermIdent Int
-> [(Int, PP_Doc)]
-> PP_Doc
-> Map Int VisitKind
-> Map Int (Set NontermIdent)
-> Map Int (Set NontermIdent)
-> Syn_Visits
Syn_Visits [VisitStateState]
_lhsOallvisits Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_lhsOchildvisit Seq Error
_lhsOerrors Map Int (Int, Int)
_lhsOfromToStates Map Int (Map String (Maybe NonLocalAttr))
_lhsOintramap Set String
_lhsOlazyIntras Map NontermIdent (Set VisitKind)
_lhsOruleKinds Map NontermIdent Int
_lhsOruleUsage [(Int, PP_Doc)]
_lhsOsem_visit PP_Doc
_lhsOt_visits Map Int VisitKind
_lhsOvisitKinds Map Int (Set NontermIdent)
_lhsOvisitdefs Map Int (Set NontermIdent)
_lhsOvisituses)
   )

-- cata
{-# NOINLINE sem_Visits #-}
sem_Visits :: Visits  -> T_Visits 
sem_Visits :: Visits -> T_Visits
sem_Visits Visits
list = forall (t :: * -> *) a b.
Foldable t =>
(a -> b -> b) -> b -> t a -> b
Prelude.foldr T_Visit -> T_Visits -> T_Visits
sem_Visits_Cons T_Visits
sem_Visits_Nil (forall a b. (a -> b) -> [a] -> [b]
Prelude.map Visit -> T_Visit
sem_Visit Visits
list)

-- semantic domain
newtype T_Visits  = T_Visits {
                             T_Visits -> Identity T_Visits_s56
attach_T_Visits :: Identity (T_Visits_s56 )
                             }
newtype T_Visits_s56  = C_Visits_s56 {
                                     T_Visits_s56 -> T_Visits_v55
inv_Visits_s56 :: (T_Visits_v55 )
                                     }
data T_Visits_s57  = C_Visits_s57
type T_Visits_v55  = (T_Visits_vIn55 ) -> (T_Visits_vOut55 )
data T_Visits_vIn55  = T_Visits_vIn55 (Map VisitIdentifier (Int,Int)) (Map NontermIdent Attributes) (Map NontermIdent Int) (Map NontermIdent Attributes) (Map VisitIdentifier VisitKind) (Map VisitIdentifier (Identifier -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)) (Map StateIdentifier (Map String (Maybe NonLocalAttr))) (Map VisitIdentifier (Set Identifier)) (Map VisitIdentifier (Set Identifier)) (Map Identifier Type) (Map Identifier (VisitKind -> Either Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))) (ConstructorIdent) (Attributes) (Map Identifier (VisitKind ->  Either Error PP_Doc)) (Map StateIdentifier StateCtx) (NontermIdent) (Options) ([Identifier]) (Map StateIdentifier StateCtx) (Map Identifier (Set String)) (Map Identifier (Map String (Maybe NonLocalAttr))) (Attributes) (Set String)
data T_Visits_vOut55  = T_Visits_vOut55 ([VisitStateState]) (Map VisitIdentifier (Identifier -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)) (Seq Error) (Map VisitIdentifier (Int,Int)) (Map StateIdentifier (Map String (Maybe NonLocalAttr))) (Set String) (Map Identifier (Set VisitKind)) (Map Identifier Int) ( [(StateIdentifier,PP_Doc)] ) (PP_Doc) (Map VisitIdentifier VisitKind) (Map VisitIdentifier (Set Identifier)) (Map VisitIdentifier (Set Identifier))
{-# NOINLINE sem_Visits_Cons #-}
sem_Visits_Cons :: T_Visit  -> T_Visits  -> T_Visits 
sem_Visits_Cons :: T_Visit -> T_Visits -> T_Visits
sem_Visits_Cons T_Visit
arg_hd_ T_Visits
arg_tl_ = Identity T_Visits_s56 -> T_Visits
T_Visits (forall (m :: * -> *) a. Monad m => a -> m a
return T_Visits_s56
st56) where
   {-# NOINLINE st56 #-}
   st56 :: T_Visits_s56
st56 = let
      v55 :: T_Visits_v55 
      v55 :: T_Visits_v55
v55 = \ (T_Visits_vIn55 Map Int (Int, Int)
_lhsIallFromToStates Map NontermIdent Attributes
_lhsIallInhmap Map NontermIdent Int
_lhsIallInitStates Map NontermIdent Attributes
_lhsIallSynmap Map Int VisitKind
_lhsIallVisitKinds Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_lhsIallchildvisit Map Int (Map String (Maybe NonLocalAttr))
_lhsIallintramap Map Int (Set NontermIdent)
_lhsIavisitdefs Map Int (Set NontermIdent)
_lhsIavisituses Attributes
_lhsIchildTypes Map
  NontermIdent
  (VisitKind
   -> Either
        Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
_lhsIchildintros NontermIdent
_lhsIcon Attributes
_lhsIinhmap Map NontermIdent (VisitKind -> Either Error PP_Doc)
_lhsImrules Map Int StateCtx
_lhsInextVisits NontermIdent
_lhsInt Options
_lhsIoptions [NontermIdent]
_lhsIparams Map Int StateCtx
_lhsIprevVisits Map NontermIdent (Set String)
_lhsIruledefs Map NontermIdent (Map String (Maybe NonLocalAttr))
_lhsIruleuses Attributes
_lhsIsynmap Set String
_lhsIterminaldefs) -> ( let
         _hdX47 :: T_Visit_s47
_hdX47 = forall a. Identity a -> a
Control.Monad.Identity.runIdentity (T_Visit -> Identity T_Visit_s47
attach_T_Visit (T_Visit
arg_hd_))
         _tlX56 :: T_Visits_s56
_tlX56 = forall a. Identity a -> a
Control.Monad.Identity.runIdentity (T_Visits -> Identity T_Visits_s56
attach_T_Visits (T_Visits
arg_tl_))
         (T_Visit_vOut46 VisitStateState
_hdIallvisits Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_hdIchildvisit Seq Error
_hdIerrors Map Int (Int, Int)
_hdIfromToStates Map Int (Map String (Maybe NonLocalAttr))
_hdIintramap Set String
_hdIlazyIntras Map NontermIdent (Set VisitKind)
_hdIruleKinds Map NontermIdent Int
_hdIruleUsage (Int, PP_Doc)
_hdIsem_visit PP_Doc
_hdIt_visits Map Int VisitKind
_hdIvisitKinds Map Int (Set NontermIdent)
_hdIvisitdefs Map Int (Set NontermIdent)
_hdIvisituses) = T_Visit_s47 -> T_Visit_v46
inv_Visit_s47 T_Visit_s47
_hdX47 (Map Int (Int, Int)
-> Map NontermIdent Attributes
-> Map NontermIdent Int
-> Map NontermIdent Attributes
-> Map Int VisitKind
-> Map
     Int
     (NontermIdent
      -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
-> Map Int (Map String (Maybe NonLocalAttr))
-> Map Int (Set NontermIdent)
-> Map Int (Set NontermIdent)
-> Attributes
-> Map
     NontermIdent
     (VisitKind
      -> Either
           Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
-> NontermIdent
-> Attributes
-> Map NontermIdent (VisitKind -> Either Error PP_Doc)
-> Map Int StateCtx
-> NontermIdent
-> Options
-> [NontermIdent]
-> Map Int StateCtx
-> Map NontermIdent (Set String)
-> Map NontermIdent (Map String (Maybe NonLocalAttr))
-> Attributes
-> Set String
-> T_Visit_vIn46
T_Visit_vIn46 Map Int (Int, Int)
_hdOallFromToStates Map NontermIdent Attributes
_hdOallInhmap Map NontermIdent Int
_hdOallInitStates Map NontermIdent Attributes
_hdOallSynmap Map Int VisitKind
_hdOallVisitKinds Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_hdOallchildvisit Map Int (Map String (Maybe NonLocalAttr))
_hdOallintramap Map Int (Set NontermIdent)
_hdOavisitdefs Map Int (Set NontermIdent)
_hdOavisituses Attributes
_hdOchildTypes Map
  NontermIdent
  (VisitKind
   -> Either
        Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
_hdOchildintros NontermIdent
_hdOcon Attributes
_hdOinhmap Map NontermIdent (VisitKind -> Either Error PP_Doc)
_hdOmrules Map Int StateCtx
_hdOnextVisits NontermIdent
_hdOnt Options
_hdOoptions [NontermIdent]
_hdOparams Map Int StateCtx
_hdOprevVisits Map NontermIdent (Set String)
_hdOruledefs Map NontermIdent (Map String (Maybe NonLocalAttr))
_hdOruleuses Attributes
_hdOsynmap Set String
_hdOterminaldefs)
         (T_Visits_vOut55 [VisitStateState]
_tlIallvisits Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_tlIchildvisit Seq Error
_tlIerrors Map Int (Int, Int)
_tlIfromToStates Map Int (Map String (Maybe NonLocalAttr))
_tlIintramap Set String
_tlIlazyIntras Map NontermIdent (Set VisitKind)
_tlIruleKinds Map NontermIdent Int
_tlIruleUsage [(Int, PP_Doc)]
_tlIsem_visit PP_Doc
_tlIt_visits Map Int VisitKind
_tlIvisitKinds Map Int (Set NontermIdent)
_tlIvisitdefs Map Int (Set NontermIdent)
_tlIvisituses) = T_Visits_s56 -> T_Visits_v55
inv_Visits_s56 T_Visits_s56
_tlX56 (Map Int (Int, Int)
-> Map NontermIdent Attributes
-> Map NontermIdent Int
-> Map NontermIdent Attributes
-> Map Int VisitKind
-> Map
     Int
     (NontermIdent
      -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
-> Map Int (Map String (Maybe NonLocalAttr))
-> Map Int (Set NontermIdent)
-> Map Int (Set NontermIdent)
-> Attributes
-> Map
     NontermIdent
     (VisitKind
      -> Either
           Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
-> NontermIdent
-> Attributes
-> Map NontermIdent (VisitKind -> Either Error PP_Doc)
-> Map Int StateCtx
-> NontermIdent
-> Options
-> [NontermIdent]
-> Map Int StateCtx
-> Map NontermIdent (Set String)
-> Map NontermIdent (Map String (Maybe NonLocalAttr))
-> Attributes
-> Set String
-> T_Visits_vIn55
T_Visits_vIn55 Map Int (Int, Int)
_tlOallFromToStates Map NontermIdent Attributes
_tlOallInhmap Map NontermIdent Int
_tlOallInitStates Map NontermIdent Attributes
_tlOallSynmap Map Int VisitKind
_tlOallVisitKinds Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_tlOallchildvisit Map Int (Map String (Maybe NonLocalAttr))
_tlOallintramap Map Int (Set NontermIdent)
_tlOavisitdefs Map Int (Set NontermIdent)
_tlOavisituses Attributes
_tlOchildTypes Map
  NontermIdent
  (VisitKind
   -> Either
        Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
_tlOchildintros NontermIdent
_tlOcon Attributes
_tlOinhmap Map NontermIdent (VisitKind -> Either Error PP_Doc)
_tlOmrules Map Int StateCtx
_tlOnextVisits NontermIdent
_tlOnt Options
_tlOoptions [NontermIdent]
_tlOparams Map Int StateCtx
_tlOprevVisits Map NontermIdent (Set String)
_tlOruledefs Map NontermIdent (Map String (Maybe NonLocalAttr))
_tlOruleuses Attributes
_tlOsynmap Set String
_tlOterminaldefs)
         _lhsOallvisits :: [VisitStateState]
         _lhsOallvisits :: [VisitStateState]
_lhsOallvisits = VisitStateState -> [VisitStateState] -> [VisitStateState]
rule751 VisitStateState
_hdIallvisits [VisitStateState]
_tlIallvisits
         _lhsOchildvisit :: Map VisitIdentifier (Identifier -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
         _lhsOchildvisit :: Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_lhsOchildvisit = Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
-> Map
     Int
     (NontermIdent
      -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
-> Map
     Int
     (NontermIdent
      -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
rule752 Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_hdIchildvisit Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_tlIchildvisit
         _lhsOerrors :: Seq Error
         _lhsOerrors :: Seq Error
_lhsOerrors = Seq Error -> Seq Error -> Seq Error
rule753 Seq Error
_hdIerrors Seq Error
_tlIerrors
         _lhsOfromToStates :: Map VisitIdentifier (Int,Int)
         _lhsOfromToStates :: Map Int (Int, Int)
_lhsOfromToStates = Map Int (Int, Int) -> Map Int (Int, Int) -> Map Int (Int, Int)
rule754 Map Int (Int, Int)
_hdIfromToStates Map Int (Int, Int)
_tlIfromToStates
         _lhsOintramap :: Map StateIdentifier (Map String (Maybe NonLocalAttr))
         _lhsOintramap :: Map Int (Map String (Maybe NonLocalAttr))
_lhsOintramap = Map Int (Map String (Maybe NonLocalAttr))
-> Map Int (Map String (Maybe NonLocalAttr))
-> Map Int (Map String (Maybe NonLocalAttr))
rule755 Map Int (Map String (Maybe NonLocalAttr))
_hdIintramap Map Int (Map String (Maybe NonLocalAttr))
_tlIintramap
         _lhsOlazyIntras :: Set String
         _lhsOlazyIntras :: Set String
_lhsOlazyIntras = Set String -> Set String -> Set String
rule756 Set String
_hdIlazyIntras Set String
_tlIlazyIntras
         _lhsOruleKinds :: Map Identifier (Set VisitKind)
         _lhsOruleKinds :: Map NontermIdent (Set VisitKind)
_lhsOruleKinds = Map NontermIdent (Set VisitKind)
-> Map NontermIdent (Set VisitKind)
-> Map NontermIdent (Set VisitKind)
rule757 Map NontermIdent (Set VisitKind)
_hdIruleKinds Map NontermIdent (Set VisitKind)
_tlIruleKinds
         _lhsOruleUsage :: Map Identifier Int
         _lhsOruleUsage :: Map NontermIdent Int
_lhsOruleUsage = Map NontermIdent Int
-> Map NontermIdent Int -> Map NontermIdent Int
rule758 Map NontermIdent Int
_hdIruleUsage Map NontermIdent Int
_tlIruleUsage
         _lhsOsem_visit ::  [(StateIdentifier,PP_Doc)] 
         _lhsOsem_visit :: [(Int, PP_Doc)]
_lhsOsem_visit = (Int, PP_Doc) -> [(Int, PP_Doc)] -> [(Int, PP_Doc)]
rule759 (Int, PP_Doc)
_hdIsem_visit [(Int, PP_Doc)]
_tlIsem_visit
         _lhsOt_visits :: PP_Doc
         _lhsOt_visits :: PP_Doc
_lhsOt_visits = PP_Doc -> PP_Doc -> PP_Doc
rule760 PP_Doc
_hdIt_visits PP_Doc
_tlIt_visits
         _lhsOvisitKinds :: Map VisitIdentifier VisitKind
         _lhsOvisitKinds :: Map Int VisitKind
_lhsOvisitKinds = Map Int VisitKind -> Map Int VisitKind -> Map Int VisitKind
rule761 Map Int VisitKind
_hdIvisitKinds Map Int VisitKind
_tlIvisitKinds
         _lhsOvisitdefs :: Map VisitIdentifier (Set Identifier)
         _lhsOvisitdefs :: Map Int (Set NontermIdent)
_lhsOvisitdefs = Map Int (Set NontermIdent)
-> Map Int (Set NontermIdent) -> Map Int (Set NontermIdent)
rule762 Map Int (Set NontermIdent)
_hdIvisitdefs Map Int (Set NontermIdent)
_tlIvisitdefs
         _lhsOvisituses :: Map VisitIdentifier (Set Identifier)
         _lhsOvisituses :: Map Int (Set NontermIdent)
_lhsOvisituses = Map Int (Set NontermIdent)
-> Map Int (Set NontermIdent) -> Map Int (Set NontermIdent)
rule763 Map Int (Set NontermIdent)
_hdIvisituses Map Int (Set NontermIdent)
_tlIvisituses
         _hdOallFromToStates :: Map Int (Int, Int)
_hdOallFromToStates = Map Int (Int, Int) -> Map Int (Int, Int)
rule764 Map Int (Int, Int)
_lhsIallFromToStates
         _hdOallInhmap :: Map NontermIdent Attributes
_hdOallInhmap = Map NontermIdent Attributes -> Map NontermIdent Attributes
rule765 Map NontermIdent Attributes
_lhsIallInhmap
         _hdOallInitStates :: Map NontermIdent Int
_hdOallInitStates = Map NontermIdent Int -> Map NontermIdent Int
rule766 Map NontermIdent Int
_lhsIallInitStates
         _hdOallSynmap :: Map NontermIdent Attributes
_hdOallSynmap = Map NontermIdent Attributes -> Map NontermIdent Attributes
rule767 Map NontermIdent Attributes
_lhsIallSynmap
         _hdOallVisitKinds :: Map Int VisitKind
_hdOallVisitKinds = Map Int VisitKind -> Map Int VisitKind
rule768 Map Int VisitKind
_lhsIallVisitKinds
         _hdOallchildvisit :: Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_hdOallchildvisit = Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
-> Map
     Int
     (NontermIdent
      -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
rule769 Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_lhsIallchildvisit
         _hdOallintramap :: Map Int (Map String (Maybe NonLocalAttr))
_hdOallintramap = Map Int (Map String (Maybe NonLocalAttr))
-> Map Int (Map String (Maybe NonLocalAttr))
rule770 Map Int (Map String (Maybe NonLocalAttr))
_lhsIallintramap
         _hdOavisitdefs :: Map Int (Set NontermIdent)
_hdOavisitdefs = Map Int (Set NontermIdent) -> Map Int (Set NontermIdent)
rule771 Map Int (Set NontermIdent)
_lhsIavisitdefs
         _hdOavisituses :: Map Int (Set NontermIdent)
_hdOavisituses = Map Int (Set NontermIdent) -> Map Int (Set NontermIdent)
rule772 Map Int (Set NontermIdent)
_lhsIavisituses
         _hdOchildTypes :: Attributes
_hdOchildTypes = Attributes -> Attributes
rule773 Attributes
_lhsIchildTypes
         _hdOchildintros :: Map
  NontermIdent
  (VisitKind
   -> Either
        Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
_hdOchildintros = Map
  NontermIdent
  (VisitKind
   -> Either
        Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
-> Map
     NontermIdent
     (VisitKind
      -> Either
           Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
rule774 Map
  NontermIdent
  (VisitKind
   -> Either
        Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
_lhsIchildintros
         _hdOcon :: NontermIdent
_hdOcon = NontermIdent -> NontermIdent
rule775 NontermIdent
_lhsIcon
         _hdOinhmap :: Attributes
_hdOinhmap = Attributes -> Attributes
rule776 Attributes
_lhsIinhmap
         _hdOmrules :: Map NontermIdent (VisitKind -> Either Error PP_Doc)
_hdOmrules = Map NontermIdent (VisitKind -> Either Error PP_Doc)
-> Map NontermIdent (VisitKind -> Either Error PP_Doc)
rule777 Map NontermIdent (VisitKind -> Either Error PP_Doc)
_lhsImrules
         _hdOnextVisits :: Map Int StateCtx
_hdOnextVisits = Map Int StateCtx -> Map Int StateCtx
rule778 Map Int StateCtx
_lhsInextVisits
         _hdOnt :: NontermIdent
_hdOnt = NontermIdent -> NontermIdent
rule779 NontermIdent
_lhsInt
         _hdOoptions :: Options
_hdOoptions = Options -> Options
rule780 Options
_lhsIoptions
         _hdOparams :: [NontermIdent]
_hdOparams = [NontermIdent] -> [NontermIdent]
rule781 [NontermIdent]
_lhsIparams
         _hdOprevVisits :: Map Int StateCtx
_hdOprevVisits = Map Int StateCtx -> Map Int StateCtx
rule782 Map Int StateCtx
_lhsIprevVisits
         _hdOruledefs :: Map NontermIdent (Set String)
_hdOruledefs = Map NontermIdent (Set String) -> Map NontermIdent (Set String)
rule783 Map NontermIdent (Set String)
_lhsIruledefs
         _hdOruleuses :: Map NontermIdent (Map String (Maybe NonLocalAttr))
_hdOruleuses = Map NontermIdent (Map String (Maybe NonLocalAttr))
-> Map NontermIdent (Map String (Maybe NonLocalAttr))
rule784 Map NontermIdent (Map String (Maybe NonLocalAttr))
_lhsIruleuses
         _hdOsynmap :: Attributes
_hdOsynmap = Attributes -> Attributes
rule785 Attributes
_lhsIsynmap
         _hdOterminaldefs :: Set String
_hdOterminaldefs = Set String -> Set String
rule786 Set String
_lhsIterminaldefs
         _tlOallFromToStates :: Map Int (Int, Int)
_tlOallFromToStates = Map Int (Int, Int) -> Map Int (Int, Int)
rule787 Map Int (Int, Int)
_lhsIallFromToStates
         _tlOallInhmap :: Map NontermIdent Attributes
_tlOallInhmap = Map NontermIdent Attributes -> Map NontermIdent Attributes
rule788 Map NontermIdent Attributes
_lhsIallInhmap
         _tlOallInitStates :: Map NontermIdent Int
_tlOallInitStates = Map NontermIdent Int -> Map NontermIdent Int
rule789 Map NontermIdent Int
_lhsIallInitStates
         _tlOallSynmap :: Map NontermIdent Attributes
_tlOallSynmap = Map NontermIdent Attributes -> Map NontermIdent Attributes
rule790 Map NontermIdent Attributes
_lhsIallSynmap
         _tlOallVisitKinds :: Map Int VisitKind
_tlOallVisitKinds = Map Int VisitKind -> Map Int VisitKind
rule791 Map Int VisitKind
_lhsIallVisitKinds
         _tlOallchildvisit :: Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_tlOallchildvisit = Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
-> Map
     Int
     (NontermIdent
      -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
rule792 Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_lhsIallchildvisit
         _tlOallintramap :: Map Int (Map String (Maybe NonLocalAttr))
_tlOallintramap = Map Int (Map String (Maybe NonLocalAttr))
-> Map Int (Map String (Maybe NonLocalAttr))
rule793 Map Int (Map String (Maybe NonLocalAttr))
_lhsIallintramap
         _tlOavisitdefs :: Map Int (Set NontermIdent)
_tlOavisitdefs = Map Int (Set NontermIdent) -> Map Int (Set NontermIdent)
rule794 Map Int (Set NontermIdent)
_lhsIavisitdefs
         _tlOavisituses :: Map Int (Set NontermIdent)
_tlOavisituses = Map Int (Set NontermIdent) -> Map Int (Set NontermIdent)
rule795 Map Int (Set NontermIdent)
_lhsIavisituses
         _tlOchildTypes :: Attributes
_tlOchildTypes = Attributes -> Attributes
rule796 Attributes
_lhsIchildTypes
         _tlOchildintros :: Map
  NontermIdent
  (VisitKind
   -> Either
        Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
_tlOchildintros = Map
  NontermIdent
  (VisitKind
   -> Either
        Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
-> Map
     NontermIdent
     (VisitKind
      -> Either
           Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
rule797 Map
  NontermIdent
  (VisitKind
   -> Either
        Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
_lhsIchildintros
         _tlOcon :: NontermIdent
_tlOcon = NontermIdent -> NontermIdent
rule798 NontermIdent
_lhsIcon
         _tlOinhmap :: Attributes
_tlOinhmap = Attributes -> Attributes
rule799 Attributes
_lhsIinhmap
         _tlOmrules :: Map NontermIdent (VisitKind -> Either Error PP_Doc)
_tlOmrules = Map NontermIdent (VisitKind -> Either Error PP_Doc)
-> Map NontermIdent (VisitKind -> Either Error PP_Doc)
rule800 Map NontermIdent (VisitKind -> Either Error PP_Doc)
_lhsImrules
         _tlOnextVisits :: Map Int StateCtx
_tlOnextVisits = Map Int StateCtx -> Map Int StateCtx
rule801 Map Int StateCtx
_lhsInextVisits
         _tlOnt :: NontermIdent
_tlOnt = NontermIdent -> NontermIdent
rule802 NontermIdent
_lhsInt
         _tlOoptions :: Options
_tlOoptions = Options -> Options
rule803 Options
_lhsIoptions
         _tlOparams :: [NontermIdent]
_tlOparams = [NontermIdent] -> [NontermIdent]
rule804 [NontermIdent]
_lhsIparams
         _tlOprevVisits :: Map Int StateCtx
_tlOprevVisits = Map Int StateCtx -> Map Int StateCtx
rule805 Map Int StateCtx
_lhsIprevVisits
         _tlOruledefs :: Map NontermIdent (Set String)
_tlOruledefs = Map NontermIdent (Set String) -> Map NontermIdent (Set String)
rule806 Map NontermIdent (Set String)
_lhsIruledefs
         _tlOruleuses :: Map NontermIdent (Map String (Maybe NonLocalAttr))
_tlOruleuses = Map NontermIdent (Map String (Maybe NonLocalAttr))
-> Map NontermIdent (Map String (Maybe NonLocalAttr))
rule807 Map NontermIdent (Map String (Maybe NonLocalAttr))
_lhsIruleuses
         _tlOsynmap :: Attributes
_tlOsynmap = Attributes -> Attributes
rule808 Attributes
_lhsIsynmap
         _tlOterminaldefs :: Set String
_tlOterminaldefs = Set String -> Set String
rule809 Set String
_lhsIterminaldefs
         __result_ :: T_Visits_vOut55
__result_ = [VisitStateState]
-> Map
     Int
     (NontermIdent
      -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
-> Seq Error
-> Map Int (Int, Int)
-> Map Int (Map String (Maybe NonLocalAttr))
-> Set String
-> Map NontermIdent (Set VisitKind)
-> Map NontermIdent Int
-> [(Int, PP_Doc)]
-> PP_Doc
-> Map Int VisitKind
-> Map Int (Set NontermIdent)
-> Map Int (Set NontermIdent)
-> T_Visits_vOut55
T_Visits_vOut55 [VisitStateState]
_lhsOallvisits Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_lhsOchildvisit Seq Error
_lhsOerrors Map Int (Int, Int)
_lhsOfromToStates Map Int (Map String (Maybe NonLocalAttr))
_lhsOintramap Set String
_lhsOlazyIntras Map NontermIdent (Set VisitKind)
_lhsOruleKinds Map NontermIdent Int
_lhsOruleUsage [(Int, PP_Doc)]
_lhsOsem_visit PP_Doc
_lhsOt_visits Map Int VisitKind
_lhsOvisitKinds Map Int (Set NontermIdent)
_lhsOvisitdefs Map Int (Set NontermIdent)
_lhsOvisituses
         in T_Visits_vOut55
__result_ )
     in T_Visits_v55 -> T_Visits_s56
C_Visits_s56 T_Visits_v55
v55
   {-# INLINE rule751 #-}
   rule751 :: VisitStateState -> [VisitStateState] -> [VisitStateState]
rule751 = \ ((VisitStateState
_hdIallvisits) ::  VisitStateState ) (([VisitStateState]
_tlIallvisits) :: [VisitStateState]) ->
     VisitStateState
_hdIallvisits forall a. a -> [a] -> [a]
: [VisitStateState]
_tlIallvisits
   {-# INLINE rule752 #-}
   rule752 :: Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
-> Map
     Int
     (NontermIdent
      -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
-> Map
     Int
     (NontermIdent
      -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
rule752 = \ ((Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_hdIchildvisit) :: Map VisitIdentifier (Identifier -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)) ((Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_tlIchildvisit) :: Map VisitIdentifier (Identifier -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)) ->
     Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_hdIchildvisit forall k a. Ord k => Map k a -> Map k a -> Map k a
`Map.union` Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_tlIchildvisit
   {-# INLINE rule753 #-}
   rule753 :: Seq Error -> Seq Error -> Seq Error
rule753 = \ ((Seq Error
_hdIerrors) :: Seq Error) ((Seq Error
_tlIerrors) :: Seq Error) ->
     Seq Error
_hdIerrors forall a. Seq a -> Seq a -> Seq a
Seq.>< Seq Error
_tlIerrors
   {-# INLINE rule754 #-}
   rule754 :: Map Int (Int, Int) -> Map Int (Int, Int) -> Map Int (Int, Int)
rule754 = \ ((Map Int (Int, Int)
_hdIfromToStates) :: Map VisitIdentifier (Int,Int)) ((Map Int (Int, Int)
_tlIfromToStates) :: Map VisitIdentifier (Int,Int)) ->
     Map Int (Int, Int)
_hdIfromToStates forall a. Monoid a => a -> a -> a
`mappend` Map Int (Int, Int)
_tlIfromToStates
   {-# INLINE rule755 #-}
   rule755 :: Map Int (Map String (Maybe NonLocalAttr))
-> Map Int (Map String (Maybe NonLocalAttr))
-> Map Int (Map String (Maybe NonLocalAttr))
rule755 = \ ((Map Int (Map String (Maybe NonLocalAttr))
_hdIintramap) :: Map StateIdentifier (Map String (Maybe NonLocalAttr))) ((Map Int (Map String (Maybe NonLocalAttr))
_tlIintramap) :: Map StateIdentifier (Map String (Maybe NonLocalAttr))) ->
     Map Int (Map String (Maybe NonLocalAttr))
_hdIintramap forall a b c.
(Ord a, Ord b) =>
Map a (Map b c) -> Map a (Map b c) -> Map a (Map b c)
`uwMapUnion` Map Int (Map String (Maybe NonLocalAttr))
_tlIintramap
   {-# INLINE rule756 #-}
   rule756 :: Set String -> Set String -> Set String
rule756 = \ ((Set String
_hdIlazyIntras) :: Set String) ((Set String
_tlIlazyIntras) :: Set String) ->
     Set String
_hdIlazyIntras forall a. Ord a => Set a -> Set a -> Set a
`Set.union` Set String
_tlIlazyIntras
   {-# INLINE rule757 #-}
   rule757 :: Map NontermIdent (Set VisitKind)
-> Map NontermIdent (Set VisitKind)
-> Map NontermIdent (Set VisitKind)
rule757 = \ ((Map NontermIdent (Set VisitKind)
_hdIruleKinds) :: Map Identifier (Set VisitKind)) ((Map NontermIdent (Set VisitKind)
_tlIruleKinds) :: Map Identifier (Set VisitKind)) ->
     Map NontermIdent (Set VisitKind)
_hdIruleKinds forall a k. (Monoid a, Ord k) => Map k a -> Map k a -> Map k a
`unionWithMappend` Map NontermIdent (Set VisitKind)
_tlIruleKinds
   {-# INLINE rule758 #-}
   rule758 :: Map NontermIdent Int
-> Map NontermIdent Int -> Map NontermIdent Int
rule758 = \ ((Map NontermIdent Int
_hdIruleUsage) :: Map Identifier Int) ((Map NontermIdent Int
_tlIruleUsage) :: Map Identifier Int) ->
     Map NontermIdent Int
_hdIruleUsage Map NontermIdent Int
-> Map NontermIdent Int -> Map NontermIdent Int
`unionWithSum` Map NontermIdent Int
_tlIruleUsage
   {-# INLINE rule759 #-}
   rule759 :: (Int, PP_Doc) -> [(Int, PP_Doc)] -> [(Int, PP_Doc)]
rule759 = \ (((Int, PP_Doc)
_hdIsem_visit) ::   (StateIdentifier,PP_Doc)  ) (([(Int, PP_Doc)]
_tlIsem_visit) ::  [(StateIdentifier,PP_Doc)] ) ->
     (Int, PP_Doc)
_hdIsem_visit forall a. a -> [a] -> [a]
: [(Int, PP_Doc)]
_tlIsem_visit
   {-# INLINE rule760 #-}
   rule760 :: PP_Doc -> PP_Doc -> PP_Doc
rule760 = \ ((PP_Doc
_hdIt_visits) :: PP_Doc) ((PP_Doc
_tlIt_visits) :: PP_Doc) ->
     PP_Doc
_hdIt_visits forall a b. (PP a, PP b) => a -> b -> PP_Doc
>-< PP_Doc
_tlIt_visits
   {-# INLINE rule761 #-}
   rule761 :: Map Int VisitKind -> Map Int VisitKind -> Map Int VisitKind
rule761 = \ ((Map Int VisitKind
_hdIvisitKinds) :: Map VisitIdentifier VisitKind) ((Map Int VisitKind
_tlIvisitKinds) :: Map VisitIdentifier VisitKind) ->
     Map Int VisitKind
_hdIvisitKinds forall a. Monoid a => a -> a -> a
`mappend` Map Int VisitKind
_tlIvisitKinds
   {-# INLINE rule762 #-}
   rule762 :: Map Int (Set NontermIdent)
-> Map Int (Set NontermIdent) -> Map Int (Set NontermIdent)
rule762 = \ ((Map Int (Set NontermIdent)
_hdIvisitdefs) :: Map VisitIdentifier (Set Identifier)) ((Map Int (Set NontermIdent)
_tlIvisitdefs) :: Map VisitIdentifier (Set Identifier)) ->
     Map Int (Set NontermIdent)
_hdIvisitdefs forall a b.
(Ord a, Ord b) =>
Map a (Set b) -> Map a (Set b) -> Map a (Set b)
`uwSetUnion` Map Int (Set NontermIdent)
_tlIvisitdefs
   {-# INLINE rule763 #-}
   rule763 :: Map Int (Set NontermIdent)
-> Map Int (Set NontermIdent) -> Map Int (Set NontermIdent)
rule763 = \ ((Map Int (Set NontermIdent)
_hdIvisituses) :: Map VisitIdentifier (Set Identifier)) ((Map Int (Set NontermIdent)
_tlIvisituses) :: Map VisitIdentifier (Set Identifier)) ->
     Map Int (Set NontermIdent)
_hdIvisituses forall a b.
(Ord a, Ord b) =>
Map a (Set b) -> Map a (Set b) -> Map a (Set b)
`uwSetUnion` Map Int (Set NontermIdent)
_tlIvisituses
   {-# INLINE rule764 #-}
   rule764 :: Map Int (Int, Int) -> Map Int (Int, Int)
rule764 = \ ((Map Int (Int, Int)
_lhsIallFromToStates) :: Map VisitIdentifier (Int,Int)) ->
     Map Int (Int, Int)
_lhsIallFromToStates
   {-# INLINE rule765 #-}
   rule765 :: Map NontermIdent Attributes -> Map NontermIdent Attributes
rule765 = \ ((Map NontermIdent Attributes
_lhsIallInhmap) :: Map NontermIdent Attributes) ->
     Map NontermIdent Attributes
_lhsIallInhmap
   {-# INLINE rule766 #-}
   rule766 :: Map NontermIdent Int -> Map NontermIdent Int
rule766 = \ ((Map NontermIdent Int
_lhsIallInitStates) :: Map NontermIdent Int) ->
     Map NontermIdent Int
_lhsIallInitStates
   {-# INLINE rule767 #-}
   rule767 :: Map NontermIdent Attributes -> Map NontermIdent Attributes
rule767 = \ ((Map NontermIdent Attributes
_lhsIallSynmap) :: Map NontermIdent Attributes) ->
     Map NontermIdent Attributes
_lhsIallSynmap
   {-# INLINE rule768 #-}
   rule768 :: Map Int VisitKind -> Map Int VisitKind
rule768 = \ ((Map Int VisitKind
_lhsIallVisitKinds) :: Map VisitIdentifier VisitKind) ->
     Map Int VisitKind
_lhsIallVisitKinds
   {-# INLINE rule769 #-}
   rule769 :: Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
-> Map
     Int
     (NontermIdent
      -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
rule769 = \ ((Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_lhsIallchildvisit) :: Map VisitIdentifier (Identifier -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)) ->
     Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_lhsIallchildvisit
   {-# INLINE rule770 #-}
   rule770 :: Map Int (Map String (Maybe NonLocalAttr))
-> Map Int (Map String (Maybe NonLocalAttr))
rule770 = \ ((Map Int (Map String (Maybe NonLocalAttr))
_lhsIallintramap) :: Map StateIdentifier (Map String (Maybe NonLocalAttr))) ->
     Map Int (Map String (Maybe NonLocalAttr))
_lhsIallintramap
   {-# INLINE rule771 #-}
   rule771 :: Map Int (Set NontermIdent) -> Map Int (Set NontermIdent)
rule771 = \ ((Map Int (Set NontermIdent)
_lhsIavisitdefs) :: Map VisitIdentifier (Set Identifier)) ->
     Map Int (Set NontermIdent)
_lhsIavisitdefs
   {-# INLINE rule772 #-}
   rule772 :: Map Int (Set NontermIdent) -> Map Int (Set NontermIdent)
rule772 = \ ((Map Int (Set NontermIdent)
_lhsIavisituses) :: Map VisitIdentifier (Set Identifier)) ->
     Map Int (Set NontermIdent)
_lhsIavisituses
   {-# INLINE rule773 #-}
   rule773 :: Attributes -> Attributes
rule773 = \ ((Attributes
_lhsIchildTypes) :: Map Identifier Type) ->
     Attributes
_lhsIchildTypes
   {-# INLINE rule774 #-}
   rule774 :: Map
  NontermIdent
  (VisitKind
   -> Either
        Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
-> Map
     NontermIdent
     (VisitKind
      -> Either
           Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
rule774 = \ ((Map
  NontermIdent
  (VisitKind
   -> Either
        Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
_lhsIchildintros) :: Map Identifier (VisitKind -> Either Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))) ->
     Map
  NontermIdent
  (VisitKind
   -> Either
        Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
_lhsIchildintros
   {-# INLINE rule775 #-}
   rule775 :: NontermIdent -> NontermIdent
rule775 = \ ((NontermIdent
_lhsIcon) :: ConstructorIdent) ->
     NontermIdent
_lhsIcon
   {-# INLINE rule776 #-}
   rule776 :: Attributes -> Attributes
rule776 = \ ((Attributes
_lhsIinhmap) :: Attributes) ->
     Attributes
_lhsIinhmap
   {-# INLINE rule777 #-}
   rule777 :: Map NontermIdent (VisitKind -> Either Error PP_Doc)
-> Map NontermIdent (VisitKind -> Either Error PP_Doc)
rule777 = \ ((Map NontermIdent (VisitKind -> Either Error PP_Doc)
_lhsImrules) :: Map Identifier (VisitKind ->  Either Error PP_Doc)) ->
     Map NontermIdent (VisitKind -> Either Error PP_Doc)
_lhsImrules
   {-# INLINE rule778 #-}
   rule778 :: Map Int StateCtx -> Map Int StateCtx
rule778 = \ ((Map Int StateCtx
_lhsInextVisits) :: Map StateIdentifier StateCtx) ->
     Map Int StateCtx
_lhsInextVisits
   {-# INLINE rule779 #-}
   rule779 :: NontermIdent -> NontermIdent
rule779 = \ ((NontermIdent
_lhsInt) :: NontermIdent) ->
     NontermIdent
_lhsInt
   {-# INLINE rule780 #-}
   rule780 :: Options -> Options
rule780 = \ ((Options
_lhsIoptions) :: Options) ->
     Options
_lhsIoptions
   {-# INLINE rule781 #-}
   rule781 :: [NontermIdent] -> [NontermIdent]
rule781 = \ (([NontermIdent]
_lhsIparams) :: [Identifier]) ->
     [NontermIdent]
_lhsIparams
   {-# INLINE rule782 #-}
   rule782 :: Map Int StateCtx -> Map Int StateCtx
rule782 = \ ((Map Int StateCtx
_lhsIprevVisits) :: Map StateIdentifier StateCtx) ->
     Map Int StateCtx
_lhsIprevVisits
   {-# INLINE rule783 #-}
   rule783 :: Map NontermIdent (Set String) -> Map NontermIdent (Set String)
rule783 = \ ((Map NontermIdent (Set String)
_lhsIruledefs) :: Map Identifier (Set String)) ->
     Map NontermIdent (Set String)
_lhsIruledefs
   {-# INLINE rule784 #-}
   rule784 :: Map NontermIdent (Map String (Maybe NonLocalAttr))
-> Map NontermIdent (Map String (Maybe NonLocalAttr))
rule784 = \ ((Map NontermIdent (Map String (Maybe NonLocalAttr))
_lhsIruleuses) :: Map Identifier (Map String (Maybe NonLocalAttr))) ->
     Map NontermIdent (Map String (Maybe NonLocalAttr))
_lhsIruleuses
   {-# INLINE rule785 #-}
   rule785 :: Attributes -> Attributes
rule785 = \ ((Attributes
_lhsIsynmap) :: Attributes) ->
     Attributes
_lhsIsynmap
   {-# INLINE rule786 #-}
   rule786 :: Set String -> Set String
rule786 = \ ((Set String
_lhsIterminaldefs) :: Set String) ->
     Set String
_lhsIterminaldefs
   {-# INLINE rule787 #-}
   rule787 :: Map Int (Int, Int) -> Map Int (Int, Int)
rule787 = \ ((Map Int (Int, Int)
_lhsIallFromToStates) :: Map VisitIdentifier (Int,Int)) ->
     Map Int (Int, Int)
_lhsIallFromToStates
   {-# INLINE rule788 #-}
   rule788 :: Map NontermIdent Attributes -> Map NontermIdent Attributes
rule788 = \ ((Map NontermIdent Attributes
_lhsIallInhmap) :: Map NontermIdent Attributes) ->
     Map NontermIdent Attributes
_lhsIallInhmap
   {-# INLINE rule789 #-}
   rule789 :: Map NontermIdent Int -> Map NontermIdent Int
rule789 = \ ((Map NontermIdent Int
_lhsIallInitStates) :: Map NontermIdent Int) ->
     Map NontermIdent Int
_lhsIallInitStates
   {-# INLINE rule790 #-}
   rule790 :: Map NontermIdent Attributes -> Map NontermIdent Attributes
rule790 = \ ((Map NontermIdent Attributes
_lhsIallSynmap) :: Map NontermIdent Attributes) ->
     Map NontermIdent Attributes
_lhsIallSynmap
   {-# INLINE rule791 #-}
   rule791 :: Map Int VisitKind -> Map Int VisitKind
rule791 = \ ((Map Int VisitKind
_lhsIallVisitKinds) :: Map VisitIdentifier VisitKind) ->
     Map Int VisitKind
_lhsIallVisitKinds
   {-# INLINE rule792 #-}
   rule792 :: Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
-> Map
     Int
     (NontermIdent
      -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
rule792 = \ ((Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_lhsIallchildvisit) :: Map VisitIdentifier (Identifier -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)) ->
     Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_lhsIallchildvisit
   {-# INLINE rule793 #-}
   rule793 :: Map Int (Map String (Maybe NonLocalAttr))
-> Map Int (Map String (Maybe NonLocalAttr))
rule793 = \ ((Map Int (Map String (Maybe NonLocalAttr))
_lhsIallintramap) :: Map StateIdentifier (Map String (Maybe NonLocalAttr))) ->
     Map Int (Map String (Maybe NonLocalAttr))
_lhsIallintramap
   {-# INLINE rule794 #-}
   rule794 :: Map Int (Set NontermIdent) -> Map Int (Set NontermIdent)
rule794 = \ ((Map Int (Set NontermIdent)
_lhsIavisitdefs) :: Map VisitIdentifier (Set Identifier)) ->
     Map Int (Set NontermIdent)
_lhsIavisitdefs
   {-# INLINE rule795 #-}
   rule795 :: Map Int (Set NontermIdent) -> Map Int (Set NontermIdent)
rule795 = \ ((Map Int (Set NontermIdent)
_lhsIavisituses) :: Map VisitIdentifier (Set Identifier)) ->
     Map Int (Set NontermIdent)
_lhsIavisituses
   {-# INLINE rule796 #-}
   rule796 :: Attributes -> Attributes
rule796 = \ ((Attributes
_lhsIchildTypes) :: Map Identifier Type) ->
     Attributes
_lhsIchildTypes
   {-# INLINE rule797 #-}
   rule797 :: Map
  NontermIdent
  (VisitKind
   -> Either
        Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
-> Map
     NontermIdent
     (VisitKind
      -> Either
           Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
rule797 = \ ((Map
  NontermIdent
  (VisitKind
   -> Either
        Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
_lhsIchildintros) :: Map Identifier (VisitKind -> Either Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))) ->
     Map
  NontermIdent
  (VisitKind
   -> Either
        Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
_lhsIchildintros
   {-# INLINE rule798 #-}
   rule798 :: NontermIdent -> NontermIdent
rule798 = \ ((NontermIdent
_lhsIcon) :: ConstructorIdent) ->
     NontermIdent
_lhsIcon
   {-# INLINE rule799 #-}
   rule799 :: Attributes -> Attributes
rule799 = \ ((Attributes
_lhsIinhmap) :: Attributes) ->
     Attributes
_lhsIinhmap
   {-# INLINE rule800 #-}
   rule800 :: Map NontermIdent (VisitKind -> Either Error PP_Doc)
-> Map NontermIdent (VisitKind -> Either Error PP_Doc)
rule800 = \ ((Map NontermIdent (VisitKind -> Either Error PP_Doc)
_lhsImrules) :: Map Identifier (VisitKind ->  Either Error PP_Doc)) ->
     Map NontermIdent (VisitKind -> Either Error PP_Doc)
_lhsImrules
   {-# INLINE rule801 #-}
   rule801 :: Map Int StateCtx -> Map Int StateCtx
rule801 = \ ((Map Int StateCtx
_lhsInextVisits) :: Map StateIdentifier StateCtx) ->
     Map Int StateCtx
_lhsInextVisits
   {-# INLINE rule802 #-}
   rule802 :: NontermIdent -> NontermIdent
rule802 = \ ((NontermIdent
_lhsInt) :: NontermIdent) ->
     NontermIdent
_lhsInt
   {-# INLINE rule803 #-}
   rule803 :: Options -> Options
rule803 = \ ((Options
_lhsIoptions) :: Options) ->
     Options
_lhsIoptions
   {-# INLINE rule804 #-}
   rule804 :: [NontermIdent] -> [NontermIdent]
rule804 = \ (([NontermIdent]
_lhsIparams) :: [Identifier]) ->
     [NontermIdent]
_lhsIparams
   {-# INLINE rule805 #-}
   rule805 :: Map Int StateCtx -> Map Int StateCtx
rule805 = \ ((Map Int StateCtx
_lhsIprevVisits) :: Map StateIdentifier StateCtx) ->
     Map Int StateCtx
_lhsIprevVisits
   {-# INLINE rule806 #-}
   rule806 :: Map NontermIdent (Set String) -> Map NontermIdent (Set String)
rule806 = \ ((Map NontermIdent (Set String)
_lhsIruledefs) :: Map Identifier (Set String)) ->
     Map NontermIdent (Set String)
_lhsIruledefs
   {-# INLINE rule807 #-}
   rule807 :: Map NontermIdent (Map String (Maybe NonLocalAttr))
-> Map NontermIdent (Map String (Maybe NonLocalAttr))
rule807 = \ ((Map NontermIdent (Map String (Maybe NonLocalAttr))
_lhsIruleuses) :: Map Identifier (Map String (Maybe NonLocalAttr))) ->
     Map NontermIdent (Map String (Maybe NonLocalAttr))
_lhsIruleuses
   {-# INLINE rule808 #-}
   rule808 :: Attributes -> Attributes
rule808 = \ ((Attributes
_lhsIsynmap) :: Attributes) ->
     Attributes
_lhsIsynmap
   {-# INLINE rule809 #-}
   rule809 :: Set String -> Set String
rule809 = \ ((Set String
_lhsIterminaldefs) :: Set String) ->
     Set String
_lhsIterminaldefs
{-# NOINLINE sem_Visits_Nil #-}
sem_Visits_Nil ::  T_Visits 
sem_Visits_Nil :: T_Visits
sem_Visits_Nil  = Identity T_Visits_s56 -> T_Visits
T_Visits (forall (m :: * -> *) a. Monad m => a -> m a
return T_Visits_s56
st56) where
   {-# NOINLINE st56 #-}
   st56 :: T_Visits_s56
st56 = let
      v55 :: T_Visits_v55 
      v55 :: T_Visits_v55
v55 = \ (T_Visits_vIn55 Map Int (Int, Int)
_lhsIallFromToStates Map NontermIdent Attributes
_lhsIallInhmap Map NontermIdent Int
_lhsIallInitStates Map NontermIdent Attributes
_lhsIallSynmap Map Int VisitKind
_lhsIallVisitKinds Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_lhsIallchildvisit Map Int (Map String (Maybe NonLocalAttr))
_lhsIallintramap Map Int (Set NontermIdent)
_lhsIavisitdefs Map Int (Set NontermIdent)
_lhsIavisituses Attributes
_lhsIchildTypes Map
  NontermIdent
  (VisitKind
   -> Either
        Error (PP_Doc, Set String, Map String (Maybe NonLocalAttr)))
_lhsIchildintros NontermIdent
_lhsIcon Attributes
_lhsIinhmap Map NontermIdent (VisitKind -> Either Error PP_Doc)
_lhsImrules Map Int StateCtx
_lhsInextVisits NontermIdent
_lhsInt Options
_lhsIoptions [NontermIdent]
_lhsIparams Map Int StateCtx
_lhsIprevVisits Map NontermIdent (Set String)
_lhsIruledefs Map NontermIdent (Map String (Maybe NonLocalAttr))
_lhsIruleuses Attributes
_lhsIsynmap Set String
_lhsIterminaldefs) -> ( let
         _lhsOallvisits :: [VisitStateState]
         _lhsOallvisits :: [VisitStateState]
_lhsOallvisits = forall {a}. () -> [a]
rule810  ()
         _lhsOchildvisit :: Map VisitIdentifier (Identifier -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
         _lhsOchildvisit :: Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_lhsOchildvisit = forall {k} {a}. () -> Map k a
rule811  ()
         _lhsOerrors :: Seq Error
         _lhsOerrors :: Seq Error
_lhsOerrors = forall {a}. () -> Seq a
rule812  ()
         _lhsOfromToStates :: Map VisitIdentifier (Int,Int)
         _lhsOfromToStates :: Map Int (Int, Int)
_lhsOfromToStates = () -> Map Int (Int, Int)
rule813  ()
         _lhsOintramap :: Map StateIdentifier (Map String (Maybe NonLocalAttr))
         _lhsOintramap :: Map Int (Map String (Maybe NonLocalAttr))
_lhsOintramap = forall {k} {a}. () -> Map k a
rule814  ()
         _lhsOlazyIntras :: Set String
         _lhsOlazyIntras :: Set String
_lhsOlazyIntras = forall {a}. () -> Set a
rule815  ()
         _lhsOruleKinds :: Map Identifier (Set VisitKind)
         _lhsOruleKinds :: Map NontermIdent (Set VisitKind)
_lhsOruleKinds = forall {k} {a}. () -> Map k a
rule816  ()
         _lhsOruleUsage :: Map Identifier Int
         _lhsOruleUsage :: Map NontermIdent Int
_lhsOruleUsage = forall {k} {a}. () -> Map k a
rule817  ()
         _lhsOsem_visit ::  [(StateIdentifier,PP_Doc)] 
         _lhsOsem_visit :: [(Int, PP_Doc)]
_lhsOsem_visit = forall {a}. () -> [a]
rule818  ()
         _lhsOt_visits :: PP_Doc
         _lhsOt_visits :: PP_Doc
_lhsOt_visits = () -> PP_Doc
rule819  ()
         _lhsOvisitKinds :: Map VisitIdentifier VisitKind
         _lhsOvisitKinds :: Map Int VisitKind
_lhsOvisitKinds = () -> Map Int VisitKind
rule820  ()
         _lhsOvisitdefs :: Map VisitIdentifier (Set Identifier)
         _lhsOvisitdefs :: Map Int (Set NontermIdent)
_lhsOvisitdefs = forall {k} {a}. () -> Map k a
rule821  ()
         _lhsOvisituses :: Map VisitIdentifier (Set Identifier)
         _lhsOvisituses :: Map Int (Set NontermIdent)
_lhsOvisituses = forall {k} {a}. () -> Map k a
rule822  ()
         __result_ :: T_Visits_vOut55
__result_ = [VisitStateState]
-> Map
     Int
     (NontermIdent
      -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
-> Seq Error
-> Map Int (Int, Int)
-> Map Int (Map String (Maybe NonLocalAttr))
-> Set String
-> Map NontermIdent (Set VisitKind)
-> Map NontermIdent Int
-> [(Int, PP_Doc)]
-> PP_Doc
-> Map Int VisitKind
-> Map Int (Set NontermIdent)
-> Map Int (Set NontermIdent)
-> T_Visits_vOut55
T_Visits_vOut55 [VisitStateState]
_lhsOallvisits Map
  Int
  (NontermIdent
   -> Type -> VisitKind -> PP_Doc -> Either Error PP_Doc)
_lhsOchildvisit Seq Error
_lhsOerrors Map Int (Int, Int)
_lhsOfromToStates Map Int (Map String (Maybe NonLocalAttr))
_lhsOintramap Set String
_lhsOlazyIntras Map NontermIdent (Set VisitKind)
_lhsOruleKinds Map NontermIdent Int
_lhsOruleUsage [(Int, PP_Doc)]
_lhsOsem_visit PP_Doc
_lhsOt_visits Map Int VisitKind
_lhsOvisitKinds Map Int (Set NontermIdent)
_lhsOvisitdefs Map Int (Set NontermIdent)
_lhsOvisituses
         in T_Visits_vOut55
__result_ )
     in T_Visits_v55 -> T_Visits_s56
C_Visits_s56 T_Visits_v55
v55
   {-# INLINE rule810 #-}
   rule810 :: () -> [a]
rule810 = \  (()
_ :: ()) ->
     []
   {-# INLINE rule811 #-}
   rule811 :: () -> Map k a
rule811 = \  (()
_ :: ()) ->
     forall k a. Map k a
Map.empty
   {-# INLINE rule812 #-}
   rule812 :: () -> Seq a
rule812 = \  (()
_ :: ()) ->
     forall a. Seq a
Seq.empty
   {-# INLINE rule813 #-}
   rule813 :: () -> Map Int (Int, Int)
rule813 = \  (()
_ :: ()) ->
     forall a. Monoid a => a
mempty
   {-# INLINE rule814 #-}
   rule814 :: () -> Map k a
rule814 = \  (()
_ :: ()) ->
     forall k a. Map k a
Map.empty
   {-# INLINE rule815 #-}
   rule815 :: () -> Set a
rule815 = \  (()
_ :: ()) ->
     forall a. Set a
Set.empty
   {-# INLINE rule816 #-}
   rule816 :: () -> Map k a
rule816 = \  (()
_ :: ()) ->
     forall k a. Map k a
Map.empty
   {-# INLINE rule817 #-}
   rule817 :: () -> Map k a
rule817 = \  (()
_ :: ()) ->
     forall k a. Map k a
Map.empty
   {-# INLINE rule818 #-}
   rule818 :: () -> [a]
rule818 = \  (()
_ :: ()) ->
     []
   {-# INLINE rule819 #-}
   rule819 :: () -> PP_Doc
rule819 = \  (()
_ :: ()) ->
     PP_Doc
empty
   {-# INLINE rule820 #-}
   rule820 :: () -> Map Int VisitKind
rule820 = \  (()
_ :: ()) ->
     forall a. Monoid a => a
mempty
   {-# INLINE rule821 #-}
   rule821 :: () -> Map k a
rule821 = \  (()
_ :: ()) ->
     forall k a. Map k a
Map.empty
   {-# INLINE rule822 #-}
   rule822 :: () -> Map k a
rule822 = \  (()
_ :: ()) ->
     forall k a. Map k a
Map.empty