module Desugar where
import qualified Data.Set as Set
import qualified Data.Map as Map
import Data.Map(Map)
import qualified Data.Sequence as Seq
import Data.Sequence(Seq,(><))
import UU.Scanner.Position(Pos(..))
import Data.Maybe
import Data.List(intersperse)
import AbstractSyntax
import ErrorMessages
import Options
import HsToken
import HsTokenScanner
import TokenDef
import CommonTypes
import Data.Set(Set)
import Data.Map(Map)
import Patterns (Pattern(..),Patterns)
import Expression (Expression(..))
import Macro --marcos
import CommonTypes
import ErrorMessages
import UU.Scanner.Position(Pos)
import CommonTypes (ConstructorIdent,Identifier)
import UU.Scanner.Position(Pos)
import HsToken
import CommonTypes
import UU.Scanner.Position(Pos)
import Control.Monad.Identity (Identity)
import qualified Control.Monad.Identity
addl :: Int -> Pos -> Pos
addl n (Pos l c f) = Pos (l+n) c f
maybeError :: a -> Error -> Maybe a -> (a, Seq Error)
maybeError def err mb
= maybe (def, Seq.singleton err) (\r -> (r, Seq.empty)) mb
findField :: Identifier -> Identifier -> [(Identifier,Identifier)] -> Maybe Identifier
findField fld attr list
| fld == _FIRST = f list
| fld == _LAST = f (reverse list)
| otherwise = Just fld
where
f = lookup attr
mergeAttributes :: AttrMap -> AttrMap -> AttrMap
mergeAttributes = Map.unionWith $ Map.unionWith $ Set.union
desugarExprs :: Options -> NontermIdent -> ConstructorIdent ->
[(Identifier, Identifier)] -> [(Identifier, Identifier)] ->
Seq Error -> [Expression] -> (Seq Error, [Expression])
desugarExprs options nt con childInhs childSyns
= mapAccum (desugarExpr options nt con childInhs childSyns)
where mapAccum f e = foldr (\x (e0,xs) -> let (e1,x') = f e0 x in (e1, x:xs)) (e, [])
desugarExpr :: Options -> NontermIdent -> ConstructorIdent ->
[(Identifier, Identifier)] -> [(Identifier, Identifier)] ->
Seq Error -> Expression -> (Seq Error, Expression)
desugarExpr options nt con childInhs childSyns errs expr
= (errs Seq.>< errors_Syn_Expression syn, output_Syn_Expression syn)
where
inh = Inh_Expression { childInhs_Inh_Expression = childInhs
, childSyns_Inh_Expression = childSyns
, con_Inh_Expression = con
, nt_Inh_Expression = nt
, options_Inh_Expression = options
, ruleDescr_Inh_Expression = "augment-rule"
}
sem = sem_Expression expr
syn = wrap_Expression sem inh
addLateAttr :: Options -> String -> Attributes
addLateAttr options mainName
| kennedyWarren options && lateHigherOrderBinding options =
let tp = lateBindingType mainName
in Map.singleton idLateBindingAttr tp
| otherwise = Map.empty
data Inh_Child = Inh_Child { inhMap_Inh_Child :: !(Map Identifier Attributes), mainName_Inh_Child :: !(String), options_Inh_Child :: !(Options), synMap_Inh_Child :: !(Map Identifier Attributes) }
data Syn_Child = Syn_Child { childInhs_Syn_Child :: !([(Identifier, Identifier)]), childSyns_Syn_Child :: !([(Identifier, Identifier)]), output_Syn_Child :: !(Child) }
wrap_Child :: T_Child -> Inh_Child -> (Syn_Child )
wrap_Child !(T_Child act) !(Inh_Child _lhsIinhMap _lhsImainName _lhsIoptions _lhsIsynMap) =
Control.Monad.Identity.runIdentity (
do !sem <- act
let arg = T_Child_vIn1 _lhsIinhMap _lhsImainName _lhsIoptions _lhsIsynMap
!(T_Child_vOut1 _lhsOchildInhs _lhsOchildSyns _lhsOoutput) <- return (inv_Child_s2 sem arg)
return (Syn_Child _lhsOchildInhs _lhsOchildSyns _lhsOoutput)
)
sem_Child :: Child -> T_Child
sem_Child ( Child !name_ !tp_ !kind_ ) = sem_Child_Child name_ tp_ kind_
newtype T_Child = T_Child {
attach_T_Child :: Identity (T_Child_s2 )
}
newtype T_Child_s2 = C_Child_s2 {
inv_Child_s2 :: (T_Child_v1 )
}
data T_Child_s3 = C_Child_s3
type T_Child_v1 = (T_Child_vIn1 ) -> (T_Child_vOut1 )
data T_Child_vIn1 = T_Child_vIn1 (Map Identifier Attributes) (String) (Options) (Map Identifier Attributes)
data T_Child_vOut1 = T_Child_vOut1 ([(Identifier, Identifier)]) ([(Identifier, Identifier)]) (Child)
sem_Child_Child :: (Identifier) -> (Type) -> (ChildKind) -> T_Child
sem_Child_Child !arg_name_ !arg_tp_ !arg_kind_ = T_Child (return st2) where
!st2 = let
v1 :: T_Child_v1
v1 = \ !(T_Child_vIn1 _lhsIinhMap _lhsImainName _lhsIoptions _lhsIsynMap) -> ( let
_lhsOchildInhs :: [(Identifier, Identifier)]
_lhsOchildInhs = rule0 _inh arg_name_
_lhsOchildSyns :: [(Identifier, Identifier)]
_lhsOchildSyns = rule1 _syn arg_name_
_lhsOoutput :: Child
_lhsOoutput = rule2 arg_kind_ arg_name_ arg_tp_
_chnt = rule3 arg_name_ arg_tp_
_inh = rule4 _chnt _lhsIinhMap
_syn = rule5 _chnt _lhsIsynMap
_output = rule6 arg_kind_ arg_name_ arg_tp_
!__result_ = T_Child_vOut1 _lhsOchildInhs _lhsOchildSyns _lhsOoutput
in __result_ )
in C_Child_s2 v1
rule0 = \ _inh name_ ->
[(i, name_) | i <- Map.keys _inh ]
rule1 = \ _syn name_ ->
[(s, name_) | s <- Map.keys _syn ]
rule2 = \ kind_ name_ tp_ ->
Child name_ tp_ kind_
rule3 = \ name_ tp_ ->
case tp_ of
NT nt _ _ -> nt
Self -> error ("The type of child " ++ show name_ ++ " should not be a Self type.")
Haskell t -> identifier ""
rule4 = \ _chnt ((_lhsIinhMap) :: Map Identifier Attributes) ->
Map.findWithDefault Map.empty _chnt _lhsIinhMap
rule5 = \ _chnt ((_lhsIsynMap) :: Map Identifier Attributes) ->
Map.findWithDefault Map.empty _chnt _lhsIsynMap
rule6 = \ kind_ name_ tp_ ->
Child name_ tp_ kind_
data Inh_Children = Inh_Children { inhMap_Inh_Children :: !(Map Identifier Attributes), mainName_Inh_Children :: !(String), options_Inh_Children :: !(Options), synMap_Inh_Children :: !(Map Identifier Attributes) }
data Syn_Children = Syn_Children { childInhs_Syn_Children :: !([(Identifier, Identifier)]), childSyns_Syn_Children :: !([(Identifier, Identifier)]), output_Syn_Children :: !(Children) }
wrap_Children :: T_Children -> Inh_Children -> (Syn_Children )
wrap_Children !(T_Children act) !(Inh_Children _lhsIinhMap _lhsImainName _lhsIoptions _lhsIsynMap) =
Control.Monad.Identity.runIdentity (
do !sem <- act
let arg = T_Children_vIn4 _lhsIinhMap _lhsImainName _lhsIoptions _lhsIsynMap
!(T_Children_vOut4 _lhsOchildInhs _lhsOchildSyns _lhsOoutput) <- return (inv_Children_s5 sem arg)
return (Syn_Children _lhsOchildInhs _lhsOchildSyns _lhsOoutput)
)
sem_Children :: Children -> T_Children
sem_Children list = Prelude.foldr sem_Children_Cons sem_Children_Nil (Prelude.map sem_Child list)
newtype T_Children = T_Children {
attach_T_Children :: Identity (T_Children_s5 )
}
newtype T_Children_s5 = C_Children_s5 {
inv_Children_s5 :: (T_Children_v4 )
}
data T_Children_s6 = C_Children_s6
type T_Children_v4 = (T_Children_vIn4 ) -> (T_Children_vOut4 )
data T_Children_vIn4 = T_Children_vIn4 (Map Identifier Attributes) (String) (Options) (Map Identifier Attributes)
data T_Children_vOut4 = T_Children_vOut4 ([(Identifier, Identifier)]) ([(Identifier, Identifier)]) (Children)
sem_Children_Cons :: T_Child -> T_Children -> T_Children
sem_Children_Cons arg_hd_ arg_tl_ = T_Children (return st5) where
!st5 = let
v4 :: T_Children_v4
v4 = \ !(T_Children_vIn4 _lhsIinhMap _lhsImainName _lhsIoptions _lhsIsynMap) -> ( let
_hdX2 = Control.Monad.Identity.runIdentity (attach_T_Child (arg_hd_))
_tlX5 = Control.Monad.Identity.runIdentity (attach_T_Children (arg_tl_))
(T_Child_vOut1 _hdIchildInhs _hdIchildSyns _hdIoutput) = inv_Child_s2 _hdX2 (T_Child_vIn1 _hdOinhMap _hdOmainName _hdOoptions _hdOsynMap)
(T_Children_vOut4 _tlIchildInhs _tlIchildSyns _tlIoutput) = inv_Children_s5 _tlX5 (T_Children_vIn4 _tlOinhMap _tlOmainName _tlOoptions _tlOsynMap)
_lhsOchildInhs :: [(Identifier, Identifier)]
_lhsOchildInhs = rule7 _hdIchildInhs _tlIchildInhs
_lhsOchildSyns :: [(Identifier, Identifier)]
_lhsOchildSyns = rule8 _hdIchildSyns _tlIchildSyns
_output = rule9 _hdIoutput _tlIoutput
_lhsOoutput :: Children
_lhsOoutput = rule10 _output
_hdOinhMap = rule11 _lhsIinhMap
_hdOmainName = rule12 _lhsImainName
_hdOoptions = rule13 _lhsIoptions
_hdOsynMap = rule14 _lhsIsynMap
_tlOinhMap = rule15 _lhsIinhMap
_tlOmainName = rule16 _lhsImainName
_tlOoptions = rule17 _lhsIoptions
_tlOsynMap = rule18 _lhsIsynMap
!__result_ = T_Children_vOut4 _lhsOchildInhs _lhsOchildSyns _lhsOoutput
in __result_ )
in C_Children_s5 v4
rule7 = \ ((_hdIchildInhs) :: [(Identifier, Identifier)]) ((_tlIchildInhs) :: [(Identifier, Identifier)]) ->
_hdIchildInhs ++ _tlIchildInhs
rule8 = \ ((_hdIchildSyns) :: [(Identifier, Identifier)]) ((_tlIchildSyns) :: [(Identifier, Identifier)]) ->
_hdIchildSyns ++ _tlIchildSyns
rule9 = \ ((_hdIoutput) :: Child) ((_tlIoutput) :: Children) ->
(:) _hdIoutput _tlIoutput
rule10 = \ _output ->
_output
rule11 = \ ((_lhsIinhMap) :: Map Identifier Attributes) ->
_lhsIinhMap
rule12 = \ ((_lhsImainName) :: String) ->
_lhsImainName
rule13 = \ ((_lhsIoptions) :: Options) ->
_lhsIoptions
rule14 = \ ((_lhsIsynMap) :: Map Identifier Attributes) ->
_lhsIsynMap
rule15 = \ ((_lhsIinhMap) :: Map Identifier Attributes) ->
_lhsIinhMap
rule16 = \ ((_lhsImainName) :: String) ->
_lhsImainName
rule17 = \ ((_lhsIoptions) :: Options) ->
_lhsIoptions
rule18 = \ ((_lhsIsynMap) :: Map Identifier Attributes) ->
_lhsIsynMap
sem_Children_Nil :: T_Children
sem_Children_Nil = T_Children (return st5) where
!st5 = let
v4 :: T_Children_v4
v4 = \ !(T_Children_vIn4 _lhsIinhMap _lhsImainName _lhsIoptions _lhsIsynMap) -> ( let
_lhsOchildInhs :: [(Identifier, Identifier)]
_lhsOchildInhs = rule19 ()
_lhsOchildSyns :: [(Identifier, Identifier)]
_lhsOchildSyns = rule20 ()
_output = rule21 ()
_lhsOoutput :: Children
_lhsOoutput = rule22 _output
!__result_ = T_Children_vOut4 _lhsOchildInhs _lhsOchildSyns _lhsOoutput
in __result_ )
in C_Children_s5 v4
rule19 = \ (_ :: ()) ->
[]
rule20 = \ (_ :: ()) ->
[]
rule21 = \ (_ :: ()) ->
[]
rule22 = \ _output ->
_output
data Inh_Expression = Inh_Expression { childInhs_Inh_Expression :: !([(Identifier, Identifier)]), childSyns_Inh_Expression :: !([(Identifier, Identifier)]), con_Inh_Expression :: !(ConstructorIdent), nt_Inh_Expression :: !(NontermIdent), options_Inh_Expression :: !(Options), ruleDescr_Inh_Expression :: !(String) }
data Syn_Expression = Syn_Expression { errors_Syn_Expression :: !(Seq Error), output_Syn_Expression :: !(Expression) }
wrap_Expression :: T_Expression -> Inh_Expression -> (Syn_Expression )
wrap_Expression !(T_Expression act) !(Inh_Expression _lhsIchildInhs _lhsIchildSyns _lhsIcon _lhsInt _lhsIoptions _lhsIruleDescr) =
Control.Monad.Identity.runIdentity (
do !sem <- act
let arg = T_Expression_vIn7 _lhsIchildInhs _lhsIchildSyns _lhsIcon _lhsInt _lhsIoptions _lhsIruleDescr
!(T_Expression_vOut7 _lhsOerrors _lhsOoutput) <- return (inv_Expression_s8 sem arg)
return (Syn_Expression _lhsOerrors _lhsOoutput)
)
sem_Expression :: Expression -> T_Expression
sem_Expression ( Expression !pos_ !tks_ ) = sem_Expression_Expression pos_ tks_
newtype T_Expression = T_Expression {
attach_T_Expression :: Identity (T_Expression_s8 )
}
newtype T_Expression_s8 = C_Expression_s8 {
inv_Expression_s8 :: (T_Expression_v7 )
}
data T_Expression_s9 = C_Expression_s9
type T_Expression_v7 = (T_Expression_vIn7 ) -> (T_Expression_vOut7 )
data T_Expression_vIn7 = T_Expression_vIn7 ([(Identifier, Identifier)]) ([(Identifier, Identifier)]) (ConstructorIdent) (NontermIdent) (Options) (String)
data T_Expression_vOut7 = T_Expression_vOut7 (Seq Error) (Expression)
sem_Expression_Expression :: (Pos) -> ([HsToken]) -> T_Expression
sem_Expression_Expression !arg_pos_ !arg_tks_ = T_Expression (return st8) where
!st8 = let
v7 :: T_Expression_v7
v7 = \ !(T_Expression_vIn7 _lhsIchildInhs _lhsIchildSyns _lhsIcon _lhsInt _lhsIoptions _lhsIruleDescr) -> ( let
_lhsOerrors :: Seq Error
(_tks',_lhsOerrors) = rule23 _lhsIchildInhs _lhsIchildSyns _lhsIcon _lhsInt _lhsIoptions _lhsIruleDescr arg_tks_
_lhsOoutput :: Expression
_lhsOoutput = rule24 _tks' arg_pos_
_output = rule25 arg_pos_ arg_tks_
!__result_ = T_Expression_vOut7 _lhsOerrors _lhsOoutput
in __result_ )
in C_Expression_s8 v7
rule23 = \ ((_lhsIchildInhs) :: [(Identifier, Identifier)]) ((_lhsIchildSyns) :: [(Identifier, Identifier)]) ((_lhsIcon) :: ConstructorIdent) ((_lhsInt) :: NontermIdent) ((_lhsIoptions) :: Options) ((_lhsIruleDescr) :: String) tks_ ->
let inh = Inh_HsTokensRoot { childInhs_Inh_HsTokensRoot = _lhsIchildInhs
, childSyns_Inh_HsTokensRoot = _lhsIchildSyns
, nt_Inh_HsTokensRoot = _lhsInt
, con_Inh_HsTokensRoot = _lhsIcon
, ruleDescr_Inh_HsTokensRoot = _lhsIruleDescr
, useFieldIdent_Inh_HsTokensRoot = genUseTraces _lhsIoptions
}
sem = sem_HsTokensRoot (HsTokensRoot tks_)
syn = wrap_HsTokensRoot sem inh
in (tks_Syn_HsTokensRoot syn, errors_Syn_HsTokensRoot syn)
rule24 = \ _tks' pos_ ->
Expression pos_ _tks'
rule25 = \ pos_ tks_ ->
Expression pos_ tks_
data Inh_Grammar = Inh_Grammar { forcedIrrefutables_Inh_Grammar :: !(AttrMap), mainName_Inh_Grammar :: !(String), options_Inh_Grammar :: !(Options) }
data Syn_Grammar = Syn_Grammar { allAttributes_Syn_Grammar :: !(AttrMap), errors_Syn_Grammar :: !(Seq Error), output_Syn_Grammar :: !(Grammar) }
wrap_Grammar :: T_Grammar -> Inh_Grammar -> (Syn_Grammar )
wrap_Grammar !(T_Grammar act) !(Inh_Grammar _lhsIforcedIrrefutables _lhsImainName _lhsIoptions) =
Control.Monad.Identity.runIdentity (
do !sem <- act
let arg = T_Grammar_vIn10 _lhsIforcedIrrefutables _lhsImainName _lhsIoptions
!(T_Grammar_vOut10 _lhsOallAttributes _lhsOerrors _lhsOoutput) <- return (inv_Grammar_s11 sem arg)
return (Syn_Grammar _lhsOallAttributes _lhsOerrors _lhsOoutput)
)
sem_Grammar :: Grammar -> T_Grammar
sem_Grammar ( Grammar !typeSyns_ !useMap_ !derivings_ !wrappers_ nonts_ !pragmas_ !manualAttrOrderMap_ !paramMap_ !contextMap_ !quantMap_ !uniqueMap_ !augmentsMap_ !aroundsMap_ !mergeMap_ ) = sem_Grammar_Grammar typeSyns_ useMap_ derivings_ wrappers_ ( sem_Nonterminals nonts_ ) pragmas_ manualAttrOrderMap_ paramMap_ contextMap_ quantMap_ uniqueMap_ augmentsMap_ aroundsMap_ mergeMap_
newtype T_Grammar = T_Grammar {
attach_T_Grammar :: Identity (T_Grammar_s11 )
}
newtype T_Grammar_s11 = C_Grammar_s11 {
inv_Grammar_s11 :: (T_Grammar_v10 )
}
data T_Grammar_s12 = C_Grammar_s12
type T_Grammar_v10 = (T_Grammar_vIn10 ) -> (T_Grammar_vOut10 )
data T_Grammar_vIn10 = T_Grammar_vIn10 (AttrMap) (String) (Options)
data T_Grammar_vOut10 = T_Grammar_vOut10 (AttrMap) (Seq Error) (Grammar)
sem_Grammar_Grammar :: (TypeSyns) -> (UseMap) -> (Derivings) -> (Set NontermIdent) -> T_Nonterminals -> (PragmaMap) -> (AttrOrderMap) -> (ParamMap) -> (ContextMap) -> (QuantMap) -> (UniqueMap) -> (Map NontermIdent (Map ConstructorIdent (Map Identifier [Expression]))) -> (Map NontermIdent (Map ConstructorIdent (Map Identifier [Expression]))) -> (Map NontermIdent (Map ConstructorIdent (Map Identifier (Identifier, [Identifier], Expression)))) -> T_Grammar
sem_Grammar_Grammar !arg_typeSyns_ !arg_useMap_ !arg_derivings_ !arg_wrappers_ arg_nonts_ !arg_pragmas_ !arg_manualAttrOrderMap_ !arg_paramMap_ !arg_contextMap_ !arg_quantMap_ !arg_uniqueMap_ !arg_augmentsMap_ !arg_aroundsMap_ !arg_mergeMap_ = T_Grammar (return st11) where
!st11 = let
v10 :: T_Grammar_v10
v10 = \ !(T_Grammar_vIn10 _lhsIforcedIrrefutables _lhsImainName _lhsIoptions) -> ( let
_nontsX26 = Control.Monad.Identity.runIdentity (attach_T_Nonterminals (arg_nonts_))
(T_Nonterminals_vOut25 _nontsIallAttributes _nontsIaugmentsOut _nontsIerrors _nontsIinhMap' _nontsIoutput _nontsIsynMap') = inv_Nonterminals_s26 _nontsX26 (T_Nonterminals_vIn25 _nontsOaugmentsIn _nontsOforcedIrrefutables _nontsOinhMap _nontsOmainName _nontsOoptions _nontsOsynMap)
_nontsOaugmentsIn = rule26 arg_augmentsMap_
_lhsOoutput :: Grammar
_lhsOoutput = rule27 _nontsIaugmentsOut _nontsIoutput arg_aroundsMap_ arg_contextMap_ arg_derivings_ arg_manualAttrOrderMap_ arg_mergeMap_ arg_paramMap_ arg_pragmas_ arg_quantMap_ arg_typeSyns_ arg_uniqueMap_ arg_useMap_ arg_wrappers_
_nontsOinhMap = rule28 _nontsIinhMap'
_nontsOsynMap = rule29 _nontsIsynMap'
_lhsOallAttributes :: AttrMap
_lhsOallAttributes = rule30 _nontsIallAttributes
_lhsOerrors :: Seq Error
_lhsOerrors = rule31 _nontsIerrors
_output = rule32 _nontsIoutput arg_aroundsMap_ arg_augmentsMap_ arg_contextMap_ arg_derivings_ arg_manualAttrOrderMap_ arg_mergeMap_ arg_paramMap_ arg_pragmas_ arg_quantMap_ arg_typeSyns_ arg_uniqueMap_ arg_useMap_ arg_wrappers_
_nontsOforcedIrrefutables = rule33 _lhsIforcedIrrefutables
_nontsOmainName = rule34 _lhsImainName
_nontsOoptions = rule35 _lhsIoptions
!__result_ = T_Grammar_vOut10 _lhsOallAttributes _lhsOerrors _lhsOoutput
in __result_ )
in C_Grammar_s11 v10
rule26 = \ augmentsMap_ ->
augmentsMap_
rule27 = \ ((_nontsIaugmentsOut) :: Map NontermIdent (Map ConstructorIdent (Map Identifier [Expression]))) ((_nontsIoutput) :: Nonterminals) aroundsMap_ contextMap_ derivings_ manualAttrOrderMap_ mergeMap_ paramMap_ pragmas_ quantMap_ typeSyns_ uniqueMap_ useMap_ wrappers_ ->
Grammar typeSyns_
useMap_
derivings_
wrappers_
_nontsIoutput
pragmas_
manualAttrOrderMap_
paramMap_
contextMap_
quantMap_
uniqueMap_
_nontsIaugmentsOut
aroundsMap_
mergeMap_
rule28 = \ ((_nontsIinhMap') :: Map Identifier Attributes) ->
_nontsIinhMap'
rule29 = \ ((_nontsIsynMap') :: Map Identifier Attributes) ->
_nontsIsynMap'
rule30 = \ ((_nontsIallAttributes) :: AttrMap) ->
_nontsIallAttributes
rule31 = \ ((_nontsIerrors) :: Seq Error) ->
_nontsIerrors
rule32 = \ ((_nontsIoutput) :: Nonterminals) aroundsMap_ augmentsMap_ contextMap_ derivings_ manualAttrOrderMap_ mergeMap_ paramMap_ pragmas_ quantMap_ typeSyns_ uniqueMap_ useMap_ wrappers_ ->
Grammar typeSyns_ useMap_ derivings_ wrappers_ _nontsIoutput pragmas_ manualAttrOrderMap_ paramMap_ contextMap_ quantMap_ uniqueMap_ augmentsMap_ aroundsMap_ mergeMap_
rule33 = \ ((_lhsIforcedIrrefutables) :: AttrMap) ->
_lhsIforcedIrrefutables
rule34 = \ ((_lhsImainName) :: String) ->
_lhsImainName
rule35 = \ ((_lhsIoptions) :: Options) ->
_lhsIoptions
data Inh_HsToken = Inh_HsToken { addLines_Inh_HsToken :: !(Int), childInhs_Inh_HsToken :: !([(Identifier, Identifier)]), childSyns_Inh_HsToken :: !([(Identifier, Identifier)]), con_Inh_HsToken :: !(ConstructorIdent), nt_Inh_HsToken :: !(NontermIdent), ruleDescr_Inh_HsToken :: !(String), useFieldIdent_Inh_HsToken :: !(Bool) }
data Syn_HsToken = Syn_HsToken { addLines_Syn_HsToken :: !(Int), errors_Syn_HsToken :: !(Seq Error), tks_Syn_HsToken :: !(HsToken) }
wrap_HsToken :: T_HsToken -> Inh_HsToken -> (Syn_HsToken )
wrap_HsToken !(T_HsToken act) !(Inh_HsToken _lhsIaddLines _lhsIchildInhs _lhsIchildSyns _lhsIcon _lhsInt _lhsIruleDescr _lhsIuseFieldIdent) =
Control.Monad.Identity.runIdentity (
do !sem <- act
let arg = T_HsToken_vIn13 _lhsIaddLines _lhsIchildInhs _lhsIchildSyns _lhsIcon _lhsInt _lhsIruleDescr _lhsIuseFieldIdent
!(T_HsToken_vOut13 _lhsOaddLines _lhsOerrors _lhsOtks) <- return (inv_HsToken_s14 sem arg)
return (Syn_HsToken _lhsOaddLines _lhsOerrors _lhsOtks)
)
sem_HsToken :: HsToken -> T_HsToken
sem_HsToken ( AGLocal !var_ !pos_ !rdesc_ ) = sem_HsToken_AGLocal var_ pos_ rdesc_
sem_HsToken ( AGField !field_ !attr_ !pos_ !rdesc_ ) = sem_HsToken_AGField field_ attr_ pos_ rdesc_
sem_HsToken ( HsToken !value_ !pos_ ) = sem_HsToken_HsToken value_ pos_
sem_HsToken ( CharToken !value_ !pos_ ) = sem_HsToken_CharToken value_ pos_
sem_HsToken ( StrToken !value_ !pos_ ) = sem_HsToken_StrToken value_ pos_
sem_HsToken ( Err !mesg_ !pos_ ) = sem_HsToken_Err mesg_ pos_
newtype T_HsToken = T_HsToken {
attach_T_HsToken :: Identity (T_HsToken_s14 )
}
newtype T_HsToken_s14 = C_HsToken_s14 {
inv_HsToken_s14 :: (T_HsToken_v13 )
}
data T_HsToken_s15 = C_HsToken_s15
type T_HsToken_v13 = (T_HsToken_vIn13 ) -> (T_HsToken_vOut13 )
data T_HsToken_vIn13 = T_HsToken_vIn13 (Int) ([(Identifier, Identifier)]) ([(Identifier, Identifier)]) (ConstructorIdent) (NontermIdent) (String) (Bool)
data T_HsToken_vOut13 = T_HsToken_vOut13 (Int) (Seq Error) (HsToken)
sem_HsToken_AGLocal :: (Identifier) -> (Pos) -> (Maybe String) -> T_HsToken
sem_HsToken_AGLocal !arg_var_ !arg_pos_ _ = T_HsToken (return st14) where
!st14 = let
v13 :: T_HsToken_v13
v13 = \ !(T_HsToken_vIn13 _lhsIaddLines _lhsIchildInhs _lhsIchildSyns _lhsIcon _lhsInt _lhsIruleDescr _lhsIuseFieldIdent) -> ( let
_lhsOaddLines :: Int
_lhsOaddLines = rule36 _lhsIaddLines _lhsIuseFieldIdent
_tks = rule37 _lhsIaddLines _lhsIruleDescr _lhsIuseFieldIdent arg_pos_ arg_var_
_lhsOerrors :: Seq Error
_lhsOerrors = rule38 ()
_lhsOtks :: HsToken
_lhsOtks = rule39 _tks
!__result_ = T_HsToken_vOut13 _lhsOaddLines _lhsOerrors _lhsOtks
in __result_ )
in C_HsToken_s14 v13
rule36 = \ ((_lhsIaddLines) :: Int) ((_lhsIuseFieldIdent) :: Bool) ->
if _lhsIuseFieldIdent
then _lhsIaddLines + 1
else _lhsIaddLines
rule37 = \ ((_lhsIaddLines) :: Int) ((_lhsIruleDescr) :: String) ((_lhsIuseFieldIdent) :: Bool) pos_ var_ ->
AGLocal var_ (addl _lhsIaddLines pos_) (if _lhsIuseFieldIdent then Just _lhsIruleDescr else Nothing)
rule38 = \ (_ :: ()) ->
Seq.empty
rule39 = \ _tks ->
_tks
sem_HsToken_AGField :: (Identifier) -> (Identifier) -> (Pos) -> (Maybe String) -> T_HsToken
sem_HsToken_AGField !arg_field_ !arg_attr_ !arg_pos_ _ = T_HsToken (return st14) where
!st14 = let
v13 :: T_HsToken_v13
v13 = \ !(T_HsToken_vIn13 _lhsIaddLines _lhsIchildInhs _lhsIchildSyns _lhsIcon _lhsInt _lhsIruleDescr _lhsIuseFieldIdent) -> ( let
_mField = rule40 _lhsIchildSyns arg_attr_ arg_field_
_field' = rule41 _mField arg_field_
_lhsOerrors :: Seq Error
_lhsOerrors = rule42 _lhsIcon _lhsInt _mField arg_field_
_lhsOaddLines :: Int
_lhsOaddLines = rule43 _field' _lhsIaddLines _lhsIuseFieldIdent arg_field_
_tks = rule44 _field' _lhsIaddLines _lhsIruleDescr _lhsIuseFieldIdent arg_attr_ arg_pos_
_lhsOtks :: HsToken
_lhsOtks = rule45 _tks
!__result_ = T_HsToken_vOut13 _lhsOaddLines _lhsOerrors _lhsOtks
in __result_ )
in C_HsToken_s14 v13
rule40 = \ ((_lhsIchildSyns) :: [(Identifier, Identifier)]) attr_ field_ ->
findField field_ attr_ _lhsIchildSyns
rule41 = \ _mField field_ ->
maybe field_ id _mField
rule42 = \ ((_lhsIcon) :: ConstructorIdent) ((_lhsInt) :: NontermIdent) _mField field_ ->
maybe (Seq.singleton (UndefAttr _lhsInt _lhsIcon field_ (Ident "<ANY>" (getPos field_)) False)) (const Seq.empty) _mField
rule43 = \ _field' ((_lhsIaddLines) :: Int) ((_lhsIuseFieldIdent) :: Bool) field_ ->
if _lhsIuseFieldIdent || length (getName field_) < length (getName _field' )
then _lhsIaddLines + 1
else _lhsIaddLines
rule44 = \ _field' ((_lhsIaddLines) :: Int) ((_lhsIruleDescr) :: String) ((_lhsIuseFieldIdent) :: Bool) attr_ pos_ ->
AGField _field' attr_ (addl _lhsIaddLines pos_) (if _lhsIuseFieldIdent then Just _lhsIruleDescr else Nothing)
rule45 = \ _tks ->
_tks
sem_HsToken_HsToken :: (String) -> (Pos) -> T_HsToken
sem_HsToken_HsToken !arg_value_ !arg_pos_ = T_HsToken (return st14) where
!st14 = let
v13 :: T_HsToken_v13
v13 = \ !(T_HsToken_vIn13 _lhsIaddLines _lhsIchildInhs _lhsIchildSyns _lhsIcon _lhsInt _lhsIruleDescr _lhsIuseFieldIdent) -> ( let
_tks = rule46 _lhsIaddLines arg_pos_ arg_value_
_lhsOerrors :: Seq Error
_lhsOerrors = rule47 ()
_lhsOtks :: HsToken
_lhsOtks = rule48 _tks
_lhsOaddLines :: Int
_lhsOaddLines = rule49 _lhsIaddLines
!__result_ = T_HsToken_vOut13 _lhsOaddLines _lhsOerrors _lhsOtks
in __result_ )
in C_HsToken_s14 v13
rule46 = \ ((_lhsIaddLines) :: Int) pos_ value_ ->
HsToken value_ (addl _lhsIaddLines pos_)
rule47 = \ (_ :: ()) ->
Seq.empty
rule48 = \ _tks ->
_tks
rule49 = \ ((_lhsIaddLines) :: Int) ->
_lhsIaddLines
sem_HsToken_CharToken :: (String) -> (Pos) -> T_HsToken
sem_HsToken_CharToken !arg_value_ !arg_pos_ = T_HsToken (return st14) where
!st14 = let
v13 :: T_HsToken_v13
v13 = \ !(T_HsToken_vIn13 _lhsIaddLines _lhsIchildInhs _lhsIchildSyns _lhsIcon _lhsInt _lhsIruleDescr _lhsIuseFieldIdent) -> ( let
_tks = rule50 _lhsIaddLines arg_pos_ arg_value_
_lhsOerrors :: Seq Error
_lhsOerrors = rule51 ()
_lhsOtks :: HsToken
_lhsOtks = rule52 _tks
_lhsOaddLines :: Int
_lhsOaddLines = rule53 _lhsIaddLines
!__result_ = T_HsToken_vOut13 _lhsOaddLines _lhsOerrors _lhsOtks
in __result_ )
in C_HsToken_s14 v13
rule50 = \ ((_lhsIaddLines) :: Int) pos_ value_ ->
CharToken value_ (addl _lhsIaddLines pos_)
rule51 = \ (_ :: ()) ->
Seq.empty
rule52 = \ _tks ->
_tks
rule53 = \ ((_lhsIaddLines) :: Int) ->
_lhsIaddLines
sem_HsToken_StrToken :: (String) -> (Pos) -> T_HsToken
sem_HsToken_StrToken !arg_value_ !arg_pos_ = T_HsToken (return st14) where
!st14 = let
v13 :: T_HsToken_v13
v13 = \ !(T_HsToken_vIn13 _lhsIaddLines _lhsIchildInhs _lhsIchildSyns _lhsIcon _lhsInt _lhsIruleDescr _lhsIuseFieldIdent) -> ( let
_tks = rule54 _lhsIaddLines arg_pos_ arg_value_
_lhsOerrors :: Seq Error
_lhsOerrors = rule55 ()
_lhsOtks :: HsToken
_lhsOtks = rule56 _tks
_lhsOaddLines :: Int
_lhsOaddLines = rule57 _lhsIaddLines
!__result_ = T_HsToken_vOut13 _lhsOaddLines _lhsOerrors _lhsOtks
in __result_ )
in C_HsToken_s14 v13
rule54 = \ ((_lhsIaddLines) :: Int) pos_ value_ ->
StrToken value_ (addl _lhsIaddLines pos_)
rule55 = \ (_ :: ()) ->
Seq.empty
rule56 = \ _tks ->
_tks
rule57 = \ ((_lhsIaddLines) :: Int) ->
_lhsIaddLines
sem_HsToken_Err :: (String) -> (Pos) -> T_HsToken
sem_HsToken_Err !arg_mesg_ !arg_pos_ = T_HsToken (return st14) where
!st14 = let
v13 :: T_HsToken_v13
v13 = \ !(T_HsToken_vIn13 _lhsIaddLines _lhsIchildInhs _lhsIchildSyns _lhsIcon _lhsInt _lhsIruleDescr _lhsIuseFieldIdent) -> ( let
_tks = rule58 _lhsIaddLines arg_mesg_ arg_pos_
_lhsOerrors :: Seq Error
_lhsOerrors = rule59 ()
_lhsOtks :: HsToken
_lhsOtks = rule60 _tks
_lhsOaddLines :: Int
_lhsOaddLines = rule61 _lhsIaddLines
!__result_ = T_HsToken_vOut13 _lhsOaddLines _lhsOerrors _lhsOtks
in __result_ )
in C_HsToken_s14 v13
rule58 = \ ((_lhsIaddLines) :: Int) mesg_ pos_ ->
Err mesg_ (addl _lhsIaddLines pos_)
rule59 = \ (_ :: ()) ->
Seq.empty
rule60 = \ _tks ->
_tks
rule61 = \ ((_lhsIaddLines) :: Int) ->
_lhsIaddLines
data Inh_HsTokens = Inh_HsTokens { addLines_Inh_HsTokens :: !(Int), childInhs_Inh_HsTokens :: !([(Identifier, Identifier)]), childSyns_Inh_HsTokens :: !([(Identifier, Identifier)]), con_Inh_HsTokens :: !(ConstructorIdent), nt_Inh_HsTokens :: !(NontermIdent), ruleDescr_Inh_HsTokens :: !(String), useFieldIdent_Inh_HsTokens :: !(Bool) }
data Syn_HsTokens = Syn_HsTokens { addLines_Syn_HsTokens :: !(Int), errors_Syn_HsTokens :: !(Seq Error), tks_Syn_HsTokens :: !(HsTokens) }
wrap_HsTokens :: T_HsTokens -> Inh_HsTokens -> (Syn_HsTokens )
wrap_HsTokens !(T_HsTokens act) !(Inh_HsTokens _lhsIaddLines _lhsIchildInhs _lhsIchildSyns _lhsIcon _lhsInt _lhsIruleDescr _lhsIuseFieldIdent) =
Control.Monad.Identity.runIdentity (
do !sem <- act
let arg = T_HsTokens_vIn16 _lhsIaddLines _lhsIchildInhs _lhsIchildSyns _lhsIcon _lhsInt _lhsIruleDescr _lhsIuseFieldIdent
!(T_HsTokens_vOut16 _lhsOaddLines _lhsOerrors _lhsOtks) <- return (inv_HsTokens_s17 sem arg)
return (Syn_HsTokens _lhsOaddLines _lhsOerrors _lhsOtks)
)
sem_HsTokens :: HsTokens -> T_HsTokens
sem_HsTokens list = Prelude.foldr sem_HsTokens_Cons sem_HsTokens_Nil (Prelude.map sem_HsToken list)
newtype T_HsTokens = T_HsTokens {
attach_T_HsTokens :: Identity (T_HsTokens_s17 )
}
newtype T_HsTokens_s17 = C_HsTokens_s17 {
inv_HsTokens_s17 :: (T_HsTokens_v16 )
}
data T_HsTokens_s18 = C_HsTokens_s18
type T_HsTokens_v16 = (T_HsTokens_vIn16 ) -> (T_HsTokens_vOut16 )
data T_HsTokens_vIn16 = T_HsTokens_vIn16 (Int) ([(Identifier, Identifier)]) ([(Identifier, Identifier)]) (ConstructorIdent) (NontermIdent) (String) (Bool)
data T_HsTokens_vOut16 = T_HsTokens_vOut16 (Int) (Seq Error) (HsTokens)
sem_HsTokens_Cons :: T_HsToken -> T_HsTokens -> T_HsTokens
sem_HsTokens_Cons arg_hd_ arg_tl_ = T_HsTokens (return st17) where
!st17 = let
v16 :: T_HsTokens_v16
v16 = \ !(T_HsTokens_vIn16 _lhsIaddLines _lhsIchildInhs _lhsIchildSyns _lhsIcon _lhsInt _lhsIruleDescr _lhsIuseFieldIdent) -> ( let
_hdX14 = Control.Monad.Identity.runIdentity (attach_T_HsToken (arg_hd_))
_tlX17 = Control.Monad.Identity.runIdentity (attach_T_HsTokens (arg_tl_))
(T_HsToken_vOut13 _hdIaddLines _hdIerrors _hdItks) = inv_HsToken_s14 _hdX14 (T_HsToken_vIn13 _hdOaddLines _hdOchildInhs _hdOchildSyns _hdOcon _hdOnt _hdOruleDescr _hdOuseFieldIdent)
(T_HsTokens_vOut16 _tlIaddLines _tlIerrors _tlItks) = inv_HsTokens_s17 _tlX17 (T_HsTokens_vIn16 _tlOaddLines _tlOchildInhs _tlOchildSyns _tlOcon _tlOnt _tlOruleDescr _tlOuseFieldIdent)
_lhsOerrors :: Seq Error
_lhsOerrors = rule62 _hdIerrors _tlIerrors
_tks = rule63 _hdItks _tlItks
_lhsOtks :: HsTokens
_lhsOtks = rule64 _tks
_lhsOaddLines :: Int
_lhsOaddLines = rule65 _tlIaddLines
_hdOaddLines = rule66 _lhsIaddLines
_hdOchildInhs = rule67 _lhsIchildInhs
_hdOchildSyns = rule68 _lhsIchildSyns
_hdOcon = rule69 _lhsIcon
_hdOnt = rule70 _lhsInt
_hdOruleDescr = rule71 _lhsIruleDescr
_hdOuseFieldIdent = rule72 _lhsIuseFieldIdent
_tlOaddLines = rule73 _hdIaddLines
_tlOchildInhs = rule74 _lhsIchildInhs
_tlOchildSyns = rule75 _lhsIchildSyns
_tlOcon = rule76 _lhsIcon
_tlOnt = rule77 _lhsInt
_tlOruleDescr = rule78 _lhsIruleDescr
_tlOuseFieldIdent = rule79 _lhsIuseFieldIdent
!__result_ = T_HsTokens_vOut16 _lhsOaddLines _lhsOerrors _lhsOtks
in __result_ )
in C_HsTokens_s17 v16
rule62 = \ ((_hdIerrors) :: Seq Error) ((_tlIerrors) :: Seq Error) ->
_hdIerrors Seq.>< _tlIerrors
rule63 = \ ((_hdItks) :: HsToken) ((_tlItks) :: HsTokens) ->
(:) _hdItks _tlItks
rule64 = \ _tks ->
_tks
rule65 = \ ((_tlIaddLines) :: Int) ->
_tlIaddLines
rule66 = \ ((_lhsIaddLines) :: Int) ->
_lhsIaddLines
rule67 = \ ((_lhsIchildInhs) :: [(Identifier, Identifier)]) ->
_lhsIchildInhs
rule68 = \ ((_lhsIchildSyns) :: [(Identifier, Identifier)]) ->
_lhsIchildSyns
rule69 = \ ((_lhsIcon) :: ConstructorIdent) ->
_lhsIcon
rule70 = \ ((_lhsInt) :: NontermIdent) ->
_lhsInt
rule71 = \ ((_lhsIruleDescr) :: String) ->
_lhsIruleDescr
rule72 = \ ((_lhsIuseFieldIdent) :: Bool) ->
_lhsIuseFieldIdent
rule73 = \ ((_hdIaddLines) :: Int) ->
_hdIaddLines
rule74 = \ ((_lhsIchildInhs) :: [(Identifier, Identifier)]) ->
_lhsIchildInhs
rule75 = \ ((_lhsIchildSyns) :: [(Identifier, Identifier)]) ->
_lhsIchildSyns
rule76 = \ ((_lhsIcon) :: ConstructorIdent) ->
_lhsIcon
rule77 = \ ((_lhsInt) :: NontermIdent) ->
_lhsInt
rule78 = \ ((_lhsIruleDescr) :: String) ->
_lhsIruleDescr
rule79 = \ ((_lhsIuseFieldIdent) :: Bool) ->
_lhsIuseFieldIdent
sem_HsTokens_Nil :: T_HsTokens
sem_HsTokens_Nil = T_HsTokens (return st17) where
!st17 = let
v16 :: T_HsTokens_v16
v16 = \ !(T_HsTokens_vIn16 _lhsIaddLines _lhsIchildInhs _lhsIchildSyns _lhsIcon _lhsInt _lhsIruleDescr _lhsIuseFieldIdent) -> ( let
_lhsOerrors :: Seq Error
_lhsOerrors = rule80 ()
_tks = rule81 ()
_lhsOtks :: HsTokens
_lhsOtks = rule82 _tks
_lhsOaddLines :: Int
_lhsOaddLines = rule83 _lhsIaddLines
!__result_ = T_HsTokens_vOut16 _lhsOaddLines _lhsOerrors _lhsOtks
in __result_ )
in C_HsTokens_s17 v16
rule80 = \ (_ :: ()) ->
Seq.empty
rule81 = \ (_ :: ()) ->
[]
rule82 = \ _tks ->
_tks
rule83 = \ ((_lhsIaddLines) :: Int) ->
_lhsIaddLines
data Inh_HsTokensRoot = Inh_HsTokensRoot { childInhs_Inh_HsTokensRoot :: !([(Identifier, Identifier)]), childSyns_Inh_HsTokensRoot :: !([(Identifier, Identifier)]), con_Inh_HsTokensRoot :: !(ConstructorIdent), nt_Inh_HsTokensRoot :: !(NontermIdent), ruleDescr_Inh_HsTokensRoot :: !(String), useFieldIdent_Inh_HsTokensRoot :: !(Bool) }
data Syn_HsTokensRoot = Syn_HsTokensRoot { errors_Syn_HsTokensRoot :: !(Seq Error), tks_Syn_HsTokensRoot :: !([HsToken]) }
wrap_HsTokensRoot :: T_HsTokensRoot -> Inh_HsTokensRoot -> (Syn_HsTokensRoot )
wrap_HsTokensRoot !(T_HsTokensRoot act) !(Inh_HsTokensRoot _lhsIchildInhs _lhsIchildSyns _lhsIcon _lhsInt _lhsIruleDescr _lhsIuseFieldIdent) =
Control.Monad.Identity.runIdentity (
do !sem <- act
let arg = T_HsTokensRoot_vIn19 _lhsIchildInhs _lhsIchildSyns _lhsIcon _lhsInt _lhsIruleDescr _lhsIuseFieldIdent
!(T_HsTokensRoot_vOut19 _lhsOerrors _lhsOtks) <- return (inv_HsTokensRoot_s20 sem arg)
return (Syn_HsTokensRoot _lhsOerrors _lhsOtks)
)
sem_HsTokensRoot :: HsTokensRoot -> T_HsTokensRoot
sem_HsTokensRoot ( HsTokensRoot tokens_ ) = sem_HsTokensRoot_HsTokensRoot ( sem_HsTokens tokens_ )
newtype T_HsTokensRoot = T_HsTokensRoot {
attach_T_HsTokensRoot :: Identity (T_HsTokensRoot_s20 )
}
newtype T_HsTokensRoot_s20 = C_HsTokensRoot_s20 {
inv_HsTokensRoot_s20 :: (T_HsTokensRoot_v19 )
}
data T_HsTokensRoot_s21 = C_HsTokensRoot_s21
type T_HsTokensRoot_v19 = (T_HsTokensRoot_vIn19 ) -> (T_HsTokensRoot_vOut19 )
data T_HsTokensRoot_vIn19 = T_HsTokensRoot_vIn19 ([(Identifier, Identifier)]) ([(Identifier, Identifier)]) (ConstructorIdent) (NontermIdent) (String) (Bool)
data T_HsTokensRoot_vOut19 = T_HsTokensRoot_vOut19 (Seq Error) ([HsToken])
sem_HsTokensRoot_HsTokensRoot :: T_HsTokens -> T_HsTokensRoot
sem_HsTokensRoot_HsTokensRoot arg_tokens_ = T_HsTokensRoot (return st20) where
!st20 = let
v19 :: T_HsTokensRoot_v19
v19 = \ !(T_HsTokensRoot_vIn19 _lhsIchildInhs _lhsIchildSyns _lhsIcon _lhsInt _lhsIruleDescr _lhsIuseFieldIdent) -> ( let
_tokensX17 = Control.Monad.Identity.runIdentity (attach_T_HsTokens (arg_tokens_))
(T_HsTokens_vOut16 _tokensIaddLines _tokensIerrors _tokensItks) = inv_HsTokens_s17 _tokensX17 (T_HsTokens_vIn16 _tokensOaddLines _tokensOchildInhs _tokensOchildSyns _tokensOcon _tokensOnt _tokensOruleDescr _tokensOuseFieldIdent)
_tokensOaddLines = rule84 ()
_lhsOerrors :: Seq Error
_lhsOerrors = rule85 _tokensIerrors
_lhsOtks :: [HsToken]
_lhsOtks = rule86 _tokensItks
_tokensOchildInhs = rule87 _lhsIchildInhs
_tokensOchildSyns = rule88 _lhsIchildSyns
_tokensOcon = rule89 _lhsIcon
_tokensOnt = rule90 _lhsInt
_tokensOruleDescr = rule91 _lhsIruleDescr
_tokensOuseFieldIdent = rule92 _lhsIuseFieldIdent
!__result_ = T_HsTokensRoot_vOut19 _lhsOerrors _lhsOtks
in __result_ )
in C_HsTokensRoot_s20 v19
rule84 = \ (_ :: ()) ->
0
rule85 = \ ((_tokensIerrors) :: Seq Error) ->
_tokensIerrors
rule86 = \ ((_tokensItks) :: HsTokens) ->
_tokensItks
rule87 = \ ((_lhsIchildInhs) :: [(Identifier, Identifier)]) ->
_lhsIchildInhs
rule88 = \ ((_lhsIchildSyns) :: [(Identifier, Identifier)]) ->
_lhsIchildSyns
rule89 = \ ((_lhsIcon) :: ConstructorIdent) ->
_lhsIcon
rule90 = \ ((_lhsInt) :: NontermIdent) ->
_lhsInt
rule91 = \ ((_lhsIruleDescr) :: String) ->
_lhsIruleDescr
rule92 = \ ((_lhsIuseFieldIdent) :: Bool) ->
_lhsIuseFieldIdent
data Inh_Nonterminal = Inh_Nonterminal { augmentsIn_Inh_Nonterminal :: !(Map NontermIdent (Map ConstructorIdent (Map Identifier [Expression]))), forcedIrrefutables_Inh_Nonterminal :: !(AttrMap), inhMap_Inh_Nonterminal :: !(Map Identifier Attributes), mainName_Inh_Nonterminal :: !(String), options_Inh_Nonterminal :: !(Options), synMap_Inh_Nonterminal :: !(Map Identifier Attributes) }
data Syn_Nonterminal = Syn_Nonterminal { allAttributes_Syn_Nonterminal :: !(AttrMap), augmentsOut_Syn_Nonterminal :: !(Map NontermIdent (Map ConstructorIdent (Map Identifier [Expression]))), errors_Syn_Nonterminal :: !(Seq Error), inhMap'_Syn_Nonterminal :: !(Map Identifier Attributes), output_Syn_Nonterminal :: !(Nonterminal), synMap'_Syn_Nonterminal :: !(Map Identifier Attributes) }
wrap_Nonterminal :: T_Nonterminal -> Inh_Nonterminal -> (Syn_Nonterminal )
wrap_Nonterminal !(T_Nonterminal act) !(Inh_Nonterminal _lhsIaugmentsIn _lhsIforcedIrrefutables _lhsIinhMap _lhsImainName _lhsIoptions _lhsIsynMap) =
Control.Monad.Identity.runIdentity (
do !sem <- act
let arg = T_Nonterminal_vIn22 _lhsIaugmentsIn _lhsIforcedIrrefutables _lhsIinhMap _lhsImainName _lhsIoptions _lhsIsynMap
!(T_Nonterminal_vOut22 _lhsOallAttributes _lhsOaugmentsOut _lhsOerrors _lhsOinhMap' _lhsOoutput _lhsOsynMap') <- return (inv_Nonterminal_s23 sem arg)
return (Syn_Nonterminal _lhsOallAttributes _lhsOaugmentsOut _lhsOerrors _lhsOinhMap' _lhsOoutput _lhsOsynMap')
)
sem_Nonterminal :: Nonterminal -> T_Nonterminal
sem_Nonterminal ( Nonterminal !nt_ !params_ !inh_ !syn_ prods_ ) = sem_Nonterminal_Nonterminal nt_ params_ inh_ syn_ ( sem_Productions prods_ )
newtype T_Nonterminal = T_Nonterminal {
attach_T_Nonterminal :: Identity (T_Nonterminal_s23 )
}
newtype T_Nonterminal_s23 = C_Nonterminal_s23 {
inv_Nonterminal_s23 :: (T_Nonterminal_v22 )
}
data T_Nonterminal_s24 = C_Nonterminal_s24
type T_Nonterminal_v22 = (T_Nonterminal_vIn22 ) -> (T_Nonterminal_vOut22 )
data T_Nonterminal_vIn22 = T_Nonterminal_vIn22 (Map NontermIdent (Map ConstructorIdent (Map Identifier [Expression]))) (AttrMap) (Map Identifier Attributes) (String) (Options) (Map Identifier Attributes)
data T_Nonterminal_vOut22 = T_Nonterminal_vOut22 (AttrMap) (Map NontermIdent (Map ConstructorIdent (Map Identifier [Expression]))) (Seq Error) (Map Identifier Attributes) (Nonterminal) (Map Identifier Attributes)
sem_Nonterminal_Nonterminal :: (NontermIdent) -> ([Identifier]) -> (Attributes) -> (Attributes) -> T_Productions -> T_Nonterminal
sem_Nonterminal_Nonterminal !arg_nt_ !arg_params_ !arg_inh_ !arg_syn_ arg_prods_ = T_Nonterminal (return st23) where
!st23 = let
v22 :: T_Nonterminal_v22
v22 = \ !(T_Nonterminal_vIn22 _lhsIaugmentsIn _lhsIforcedIrrefutables _lhsIinhMap _lhsImainName _lhsIoptions _lhsIsynMap) -> ( let
_prodsX38 = Control.Monad.Identity.runIdentity (attach_T_Productions (arg_prods_))
(T_Productions_vOut37 _prodsIallAttributes _prodsIaugmentsOut _prodsIerrors _prodsIoutput) = inv_Productions_s38 _prodsX38 (T_Productions_vIn37 _prodsOaugmentsIn _prodsOforcedIrrefutables _prodsOinhMap _prodsOmainName _prodsOnt _prodsOoptions _prodsOsynMap)
_prodsOnt = rule93 arg_nt_
_augmentsIn = rule94 _lhsIaugmentsIn arg_nt_
_augmentsOut = rule95 _prodsIaugmentsOut arg_nt_
_extraInh = rule96 _lhsImainName _lhsIoptions
_lhsOoutput :: Nonterminal
_lhsOoutput = rule97 _extraInh _prodsIoutput arg_inh_ arg_nt_ arg_params_ arg_syn_
_lhsOinhMap' :: Map Identifier Attributes
_lhsOinhMap' = rule98 arg_inh_ arg_nt_
_lhsOsynMap' :: Map Identifier Attributes
_lhsOsynMap' = rule99 arg_nt_ arg_syn_
_lhsOallAttributes :: AttrMap
_lhsOallAttributes = rule100 _prodsIallAttributes
_lhsOaugmentsOut :: Map NontermIdent (Map ConstructorIdent (Map Identifier [Expression]))
_lhsOaugmentsOut = rule101 _augmentsOut
_lhsOerrors :: Seq Error
_lhsOerrors = rule102 _prodsIerrors
_output = rule103 _prodsIoutput arg_inh_ arg_nt_ arg_params_ arg_syn_
_prodsOaugmentsIn = rule104 _augmentsIn
_prodsOforcedIrrefutables = rule105 _lhsIforcedIrrefutables
_prodsOinhMap = rule106 _lhsIinhMap
_prodsOmainName = rule107 _lhsImainName
_prodsOoptions = rule108 _lhsIoptions
_prodsOsynMap = rule109 _lhsIsynMap
!__result_ = T_Nonterminal_vOut22 _lhsOallAttributes _lhsOaugmentsOut _lhsOerrors _lhsOinhMap' _lhsOoutput _lhsOsynMap'
in __result_ )
in C_Nonterminal_s23 v22
rule93 = \ nt_ ->
nt_
rule94 = \ ((_lhsIaugmentsIn) :: Map NontermIdent (Map ConstructorIdent (Map Identifier [Expression]))) nt_ ->
Map.findWithDefault Map.empty nt_ _lhsIaugmentsIn
rule95 = \ ((_prodsIaugmentsOut) :: Map ConstructorIdent (Map Identifier [Expression])) nt_ ->
Map.singleton nt_ _prodsIaugmentsOut
rule96 = \ ((_lhsImainName) :: String) ((_lhsIoptions) :: Options) ->
addLateAttr _lhsIoptions _lhsImainName
rule97 = \ _extraInh ((_prodsIoutput) :: Productions) inh_ nt_ params_ syn_ ->
Nonterminal
nt_ params_
(_extraInh `Map.union` inh_)
syn_
_prodsIoutput
rule98 = \ inh_ nt_ ->
Map.singleton nt_ inh_
rule99 = \ nt_ syn_ ->
Map.singleton nt_ syn_
rule100 = \ ((_prodsIallAttributes) :: AttrMap) ->
_prodsIallAttributes
rule101 = \ _augmentsOut ->
_augmentsOut
rule102 = \ ((_prodsIerrors) :: Seq Error) ->
_prodsIerrors
rule103 = \ ((_prodsIoutput) :: Productions) inh_ nt_ params_ syn_ ->
Nonterminal nt_ params_ inh_ syn_ _prodsIoutput
rule104 = \ _augmentsIn ->
_augmentsIn
rule105 = \ ((_lhsIforcedIrrefutables) :: AttrMap) ->
_lhsIforcedIrrefutables
rule106 = \ ((_lhsIinhMap) :: Map Identifier Attributes) ->
_lhsIinhMap
rule107 = \ ((_lhsImainName) :: String) ->
_lhsImainName
rule108 = \ ((_lhsIoptions) :: Options) ->
_lhsIoptions
rule109 = \ ((_lhsIsynMap) :: Map Identifier Attributes) ->
_lhsIsynMap
data Inh_Nonterminals = Inh_Nonterminals { augmentsIn_Inh_Nonterminals :: !(Map NontermIdent (Map ConstructorIdent (Map Identifier [Expression]))), forcedIrrefutables_Inh_Nonterminals :: !(AttrMap), inhMap_Inh_Nonterminals :: !(Map Identifier Attributes), mainName_Inh_Nonterminals :: !(String), options_Inh_Nonterminals :: !(Options), synMap_Inh_Nonterminals :: !(Map Identifier Attributes) }
data Syn_Nonterminals = Syn_Nonterminals { allAttributes_Syn_Nonterminals :: !(AttrMap), augmentsOut_Syn_Nonterminals :: !(Map NontermIdent (Map ConstructorIdent (Map Identifier [Expression]))), errors_Syn_Nonterminals :: !(Seq Error), inhMap'_Syn_Nonterminals :: !(Map Identifier Attributes), output_Syn_Nonterminals :: !(Nonterminals), synMap'_Syn_Nonterminals :: !(Map Identifier Attributes) }
wrap_Nonterminals :: T_Nonterminals -> Inh_Nonterminals -> (Syn_Nonterminals )
wrap_Nonterminals !(T_Nonterminals act) !(Inh_Nonterminals _lhsIaugmentsIn _lhsIforcedIrrefutables _lhsIinhMap _lhsImainName _lhsIoptions _lhsIsynMap) =
Control.Monad.Identity.runIdentity (
do !sem <- act
let arg = T_Nonterminals_vIn25 _lhsIaugmentsIn _lhsIforcedIrrefutables _lhsIinhMap _lhsImainName _lhsIoptions _lhsIsynMap
!(T_Nonterminals_vOut25 _lhsOallAttributes _lhsOaugmentsOut _lhsOerrors _lhsOinhMap' _lhsOoutput _lhsOsynMap') <- return (inv_Nonterminals_s26 sem arg)
return (Syn_Nonterminals _lhsOallAttributes _lhsOaugmentsOut _lhsOerrors _lhsOinhMap' _lhsOoutput _lhsOsynMap')
)
sem_Nonterminals :: Nonterminals -> T_Nonterminals
sem_Nonterminals list = Prelude.foldr sem_Nonterminals_Cons sem_Nonterminals_Nil (Prelude.map sem_Nonterminal list)
newtype T_Nonterminals = T_Nonterminals {
attach_T_Nonterminals :: Identity (T_Nonterminals_s26 )
}
newtype T_Nonterminals_s26 = C_Nonterminals_s26 {
inv_Nonterminals_s26 :: (T_Nonterminals_v25 )
}
data T_Nonterminals_s27 = C_Nonterminals_s27
type T_Nonterminals_v25 = (T_Nonterminals_vIn25 ) -> (T_Nonterminals_vOut25 )
data T_Nonterminals_vIn25 = T_Nonterminals_vIn25 (Map NontermIdent (Map ConstructorIdent (Map Identifier [Expression]))) (AttrMap) (Map Identifier Attributes) (String) (Options) (Map Identifier Attributes)
data T_Nonterminals_vOut25 = T_Nonterminals_vOut25 (AttrMap) (Map NontermIdent (Map ConstructorIdent (Map Identifier [Expression]))) (Seq Error) (Map Identifier Attributes) (Nonterminals) (Map Identifier Attributes)
sem_Nonterminals_Cons :: T_Nonterminal -> T_Nonterminals -> T_Nonterminals
sem_Nonterminals_Cons arg_hd_ arg_tl_ = T_Nonterminals (return st26) where
!st26 = let
v25 :: T_Nonterminals_v25
v25 = \ !(T_Nonterminals_vIn25 _lhsIaugmentsIn _lhsIforcedIrrefutables _lhsIinhMap _lhsImainName _lhsIoptions _lhsIsynMap) -> ( let
_hdX23 = Control.Monad.Identity.runIdentity (attach_T_Nonterminal (arg_hd_))
_tlX26 = Control.Monad.Identity.runIdentity (attach_T_Nonterminals (arg_tl_))
(T_Nonterminal_vOut22 _hdIallAttributes _hdIaugmentsOut _hdIerrors _hdIinhMap' _hdIoutput _hdIsynMap') = inv_Nonterminal_s23 _hdX23 (T_Nonterminal_vIn22 _hdOaugmentsIn _hdOforcedIrrefutables _hdOinhMap _hdOmainName _hdOoptions _hdOsynMap)
(T_Nonterminals_vOut25 _tlIallAttributes _tlIaugmentsOut _tlIerrors _tlIinhMap' _tlIoutput _tlIsynMap') = inv_Nonterminals_s26 _tlX26 (T_Nonterminals_vIn25 _tlOaugmentsIn _tlOforcedIrrefutables _tlOinhMap _tlOmainName _tlOoptions _tlOsynMap)
_lhsOallAttributes :: AttrMap
_lhsOallAttributes = rule110 _hdIallAttributes _tlIallAttributes
_lhsOaugmentsOut :: Map NontermIdent (Map ConstructorIdent (Map Identifier [Expression]))
_lhsOaugmentsOut = rule111 _hdIaugmentsOut _tlIaugmentsOut
_lhsOerrors :: Seq Error
_lhsOerrors = rule112 _hdIerrors _tlIerrors
_lhsOinhMap' :: Map Identifier Attributes
_lhsOinhMap' = rule113 _hdIinhMap' _tlIinhMap'
_lhsOsynMap' :: Map Identifier Attributes
_lhsOsynMap' = rule114 _hdIsynMap' _tlIsynMap'
_output = rule115 _hdIoutput _tlIoutput
_lhsOoutput :: Nonterminals
_lhsOoutput = rule116 _output
_hdOaugmentsIn = rule117 _lhsIaugmentsIn
_hdOforcedIrrefutables = rule118 _lhsIforcedIrrefutables
_hdOinhMap = rule119 _lhsIinhMap
_hdOmainName = rule120 _lhsImainName
_hdOoptions = rule121 _lhsIoptions
_hdOsynMap = rule122 _lhsIsynMap
_tlOaugmentsIn = rule123 _lhsIaugmentsIn
_tlOforcedIrrefutables = rule124 _lhsIforcedIrrefutables
_tlOinhMap = rule125 _lhsIinhMap
_tlOmainName = rule126 _lhsImainName
_tlOoptions = rule127 _lhsIoptions
_tlOsynMap = rule128 _lhsIsynMap
!__result_ = T_Nonterminals_vOut25 _lhsOallAttributes _lhsOaugmentsOut _lhsOerrors _lhsOinhMap' _lhsOoutput _lhsOsynMap'
in __result_ )
in C_Nonterminals_s26 v25
rule110 = \ ((_hdIallAttributes) :: AttrMap) ((_tlIallAttributes) :: AttrMap) ->
_hdIallAttributes `mergeAttributes` _tlIallAttributes
rule111 = \ ((_hdIaugmentsOut) :: Map NontermIdent (Map ConstructorIdent (Map Identifier [Expression]))) ((_tlIaugmentsOut) :: Map NontermIdent (Map ConstructorIdent (Map Identifier [Expression]))) ->
_hdIaugmentsOut `Map.union` _tlIaugmentsOut
rule112 = \ ((_hdIerrors) :: Seq Error) ((_tlIerrors) :: Seq Error) ->
_hdIerrors Seq.>< _tlIerrors
rule113 = \ ((_hdIinhMap') :: Map Identifier Attributes) ((_tlIinhMap') :: Map Identifier Attributes) ->
_hdIinhMap' `Map.union` _tlIinhMap'
rule114 = \ ((_hdIsynMap') :: Map Identifier Attributes) ((_tlIsynMap') :: Map Identifier Attributes) ->
_hdIsynMap' `Map.union` _tlIsynMap'
rule115 = \ ((_hdIoutput) :: Nonterminal) ((_tlIoutput) :: Nonterminals) ->
(:) _hdIoutput _tlIoutput
rule116 = \ _output ->
_output
rule117 = \ ((_lhsIaugmentsIn) :: Map NontermIdent (Map ConstructorIdent (Map Identifier [Expression]))) ->
_lhsIaugmentsIn
rule118 = \ ((_lhsIforcedIrrefutables) :: AttrMap) ->
_lhsIforcedIrrefutables
rule119 = \ ((_lhsIinhMap) :: Map Identifier Attributes) ->
_lhsIinhMap
rule120 = \ ((_lhsImainName) :: String) ->
_lhsImainName
rule121 = \ ((_lhsIoptions) :: Options) ->
_lhsIoptions
rule122 = \ ((_lhsIsynMap) :: Map Identifier Attributes) ->
_lhsIsynMap
rule123 = \ ((_lhsIaugmentsIn) :: Map NontermIdent (Map ConstructorIdent (Map Identifier [Expression]))) ->
_lhsIaugmentsIn
rule124 = \ ((_lhsIforcedIrrefutables) :: AttrMap) ->
_lhsIforcedIrrefutables
rule125 = \ ((_lhsIinhMap) :: Map Identifier Attributes) ->
_lhsIinhMap
rule126 = \ ((_lhsImainName) :: String) ->
_lhsImainName
rule127 = \ ((_lhsIoptions) :: Options) ->
_lhsIoptions
rule128 = \ ((_lhsIsynMap) :: Map Identifier Attributes) ->
_lhsIsynMap
sem_Nonterminals_Nil :: T_Nonterminals
sem_Nonterminals_Nil = T_Nonterminals (return st26) where
!st26 = let
v25 :: T_Nonterminals_v25
v25 = \ !(T_Nonterminals_vIn25 _lhsIaugmentsIn _lhsIforcedIrrefutables _lhsIinhMap _lhsImainName _lhsIoptions _lhsIsynMap) -> ( let
_lhsOallAttributes :: AttrMap
_lhsOallAttributes = rule129 ()
_lhsOaugmentsOut :: Map NontermIdent (Map ConstructorIdent (Map Identifier [Expression]))
_lhsOaugmentsOut = rule130 ()
_lhsOerrors :: Seq Error
_lhsOerrors = rule131 ()
_lhsOinhMap' :: Map Identifier Attributes
_lhsOinhMap' = rule132 ()
_lhsOsynMap' :: Map Identifier Attributes
_lhsOsynMap' = rule133 ()
_output = rule134 ()
_lhsOoutput :: Nonterminals
_lhsOoutput = rule135 _output
!__result_ = T_Nonterminals_vOut25 _lhsOallAttributes _lhsOaugmentsOut _lhsOerrors _lhsOinhMap' _lhsOoutput _lhsOsynMap'
in __result_ )
in C_Nonterminals_s26 v25
rule129 = \ (_ :: ()) ->
Map.empty
rule130 = \ (_ :: ()) ->
Map.empty
rule131 = \ (_ :: ()) ->
Seq.empty
rule132 = \ (_ :: ()) ->
Map.empty
rule133 = \ (_ :: ()) ->
Map.empty
rule134 = \ (_ :: ()) ->
[]
rule135 = \ _output ->
_output
data Inh_Pattern = Inh_Pattern { childInhs_Inh_Pattern :: !([(Identifier, Identifier)]), childSyns_Inh_Pattern :: !([(Identifier, Identifier)]), con_Inh_Pattern :: !(ConstructorIdent), defs_Inh_Pattern :: !(Set (Identifier, Identifier)), forcedIrrefutables_Inh_Pattern :: !(AttrMap), nt_Inh_Pattern :: !(NontermIdent) }
data Syn_Pattern = Syn_Pattern { allAttributes_Syn_Pattern :: !(AttrMap), copy_Syn_Pattern :: !(Pattern), defsCollect_Syn_Pattern :: !(Set (Identifier, Identifier)), errors_Syn_Pattern :: !(Seq Error), output_Syn_Pattern :: !(Pattern) }
wrap_Pattern :: T_Pattern -> Inh_Pattern -> (Syn_Pattern )
wrap_Pattern !(T_Pattern act) !(Inh_Pattern _lhsIchildInhs _lhsIchildSyns _lhsIcon _lhsIdefs _lhsIforcedIrrefutables _lhsInt) =
Control.Monad.Identity.runIdentity (
do !sem <- act
let arg = T_Pattern_vIn28 _lhsIchildInhs _lhsIchildSyns _lhsIcon _lhsIdefs _lhsIforcedIrrefutables _lhsInt
!(T_Pattern_vOut28 _lhsOallAttributes _lhsOcopy _lhsOdefsCollect _lhsOerrors _lhsOoutput) <- return (inv_Pattern_s29 sem arg)
return (Syn_Pattern _lhsOallAttributes _lhsOcopy _lhsOdefsCollect _lhsOerrors _lhsOoutput)
)
sem_Pattern :: Pattern -> T_Pattern
sem_Pattern ( Constr !name_ pats_ ) = sem_Pattern_Constr name_ ( sem_Patterns pats_ )
sem_Pattern ( Product !pos_ pats_ ) = sem_Pattern_Product pos_ ( sem_Patterns pats_ )
sem_Pattern ( Alias !field_ !attr_ pat_ ) = sem_Pattern_Alias field_ attr_ ( sem_Pattern pat_ )
sem_Pattern ( Irrefutable pat_ ) = sem_Pattern_Irrefutable ( sem_Pattern pat_ )
sem_Pattern ( Underscore !pos_ ) = sem_Pattern_Underscore pos_
newtype T_Pattern = T_Pattern {
attach_T_Pattern :: Identity (T_Pattern_s29 )
}
newtype T_Pattern_s29 = C_Pattern_s29 {
inv_Pattern_s29 :: (T_Pattern_v28 )
}
data T_Pattern_s30 = C_Pattern_s30
type T_Pattern_v28 = (T_Pattern_vIn28 ) -> (T_Pattern_vOut28 )
data T_Pattern_vIn28 = T_Pattern_vIn28 ([(Identifier, Identifier)]) ([(Identifier, Identifier)]) (ConstructorIdent) (Set (Identifier, Identifier)) (AttrMap) (NontermIdent)
data T_Pattern_vOut28 = T_Pattern_vOut28 (AttrMap) (Pattern) (Set (Identifier, Identifier)) (Seq Error) (Pattern)
sem_Pattern_Constr :: (ConstructorIdent) -> T_Patterns -> T_Pattern
sem_Pattern_Constr !arg_name_ arg_pats_ = T_Pattern (return st29) where
!st29 = let
v28 :: T_Pattern_v28
v28 = \ !(T_Pattern_vIn28 _lhsIchildInhs _lhsIchildSyns _lhsIcon _lhsIdefs _lhsIforcedIrrefutables _lhsInt) -> ( let
_patsX32 = Control.Monad.Identity.runIdentity (attach_T_Patterns (arg_pats_))
(T_Patterns_vOut31 _patsIallAttributes _patsIcopy _patsIdefsCollect _patsIerrors _patsIoutput) = inv_Patterns_s32 _patsX32 (T_Patterns_vIn31 _patsOchildInhs _patsOchildSyns _patsOcon _patsOdefs _patsOforcedIrrefutables _patsOnt)
_lhsOallAttributes :: AttrMap
_lhsOallAttributes = rule136 _patsIallAttributes
_lhsOdefsCollect :: Set (Identifier, Identifier)
_lhsOdefsCollect = rule137 _patsIdefsCollect
_lhsOerrors :: Seq Error
_lhsOerrors = rule138 _patsIerrors
_copy = rule139 _patsIcopy arg_name_
_output = rule140 _patsIoutput arg_name_
_lhsOcopy :: Pattern
_lhsOcopy = rule141 _copy
_lhsOoutput :: Pattern
_lhsOoutput = rule142 _output
_patsOchildInhs = rule143 _lhsIchildInhs
_patsOchildSyns = rule144 _lhsIchildSyns
_patsOcon = rule145 _lhsIcon
_patsOdefs = rule146 _lhsIdefs
_patsOforcedIrrefutables = rule147 _lhsIforcedIrrefutables
_patsOnt = rule148 _lhsInt
!__result_ = T_Pattern_vOut28 _lhsOallAttributes _lhsOcopy _lhsOdefsCollect _lhsOerrors _lhsOoutput
in __result_ )
in C_Pattern_s29 v28
rule136 = \ ((_patsIallAttributes) :: AttrMap) ->
_patsIallAttributes
rule137 = \ ((_patsIdefsCollect) :: Set (Identifier, Identifier)) ->
_patsIdefsCollect
rule138 = \ ((_patsIerrors) :: Seq Error) ->
_patsIerrors
rule139 = \ ((_patsIcopy) :: Patterns) name_ ->
Constr name_ _patsIcopy
rule140 = \ ((_patsIoutput) :: Patterns) name_ ->
Constr name_ _patsIoutput
rule141 = \ _copy ->
_copy
rule142 = \ _output ->
_output
rule143 = \ ((_lhsIchildInhs) :: [(Identifier, Identifier)]) ->
_lhsIchildInhs
rule144 = \ ((_lhsIchildSyns) :: [(Identifier, Identifier)]) ->
_lhsIchildSyns
rule145 = \ ((_lhsIcon) :: ConstructorIdent) ->
_lhsIcon
rule146 = \ ((_lhsIdefs) :: Set (Identifier, Identifier)) ->
_lhsIdefs
rule147 = \ ((_lhsIforcedIrrefutables) :: AttrMap) ->
_lhsIforcedIrrefutables
rule148 = \ ((_lhsInt) :: NontermIdent) ->
_lhsInt
sem_Pattern_Product :: (Pos) -> T_Patterns -> T_Pattern
sem_Pattern_Product !arg_pos_ arg_pats_ = T_Pattern (return st29) where
!st29 = let
v28 :: T_Pattern_v28
v28 = \ !(T_Pattern_vIn28 _lhsIchildInhs _lhsIchildSyns _lhsIcon _lhsIdefs _lhsIforcedIrrefutables _lhsInt) -> ( let
_patsX32 = Control.Monad.Identity.runIdentity (attach_T_Patterns (arg_pats_))
(T_Patterns_vOut31 _patsIallAttributes _patsIcopy _patsIdefsCollect _patsIerrors _patsIoutput) = inv_Patterns_s32 _patsX32 (T_Patterns_vIn31 _patsOchildInhs _patsOchildSyns _patsOcon _patsOdefs _patsOforcedIrrefutables _patsOnt)
_lhsOallAttributes :: AttrMap
_lhsOallAttributes = rule149 _patsIallAttributes
_lhsOdefsCollect :: Set (Identifier, Identifier)
_lhsOdefsCollect = rule150 _patsIdefsCollect
_lhsOerrors :: Seq Error
_lhsOerrors = rule151 _patsIerrors
_copy = rule152 _patsIcopy arg_pos_
_output = rule153 _patsIoutput arg_pos_
_lhsOcopy :: Pattern
_lhsOcopy = rule154 _copy
_lhsOoutput :: Pattern
_lhsOoutput = rule155 _output
_patsOchildInhs = rule156 _lhsIchildInhs
_patsOchildSyns = rule157 _lhsIchildSyns
_patsOcon = rule158 _lhsIcon
_patsOdefs = rule159 _lhsIdefs
_patsOforcedIrrefutables = rule160 _lhsIforcedIrrefutables
_patsOnt = rule161 _lhsInt
!__result_ = T_Pattern_vOut28 _lhsOallAttributes _lhsOcopy _lhsOdefsCollect _lhsOerrors _lhsOoutput
in __result_ )
in C_Pattern_s29 v28
rule149 = \ ((_patsIallAttributes) :: AttrMap) ->
_patsIallAttributes
rule150 = \ ((_patsIdefsCollect) :: Set (Identifier, Identifier)) ->
_patsIdefsCollect
rule151 = \ ((_patsIerrors) :: Seq Error) ->
_patsIerrors
rule152 = \ ((_patsIcopy) :: Patterns) pos_ ->
Product pos_ _patsIcopy
rule153 = \ ((_patsIoutput) :: Patterns) pos_ ->
Product pos_ _patsIoutput
rule154 = \ _copy ->
_copy
rule155 = \ _output ->
_output
rule156 = \ ((_lhsIchildInhs) :: [(Identifier, Identifier)]) ->
_lhsIchildInhs
rule157 = \ ((_lhsIchildSyns) :: [(Identifier, Identifier)]) ->
_lhsIchildSyns
rule158 = \ ((_lhsIcon) :: ConstructorIdent) ->
_lhsIcon
rule159 = \ ((_lhsIdefs) :: Set (Identifier, Identifier)) ->
_lhsIdefs
rule160 = \ ((_lhsIforcedIrrefutables) :: AttrMap) ->
_lhsIforcedIrrefutables
rule161 = \ ((_lhsInt) :: NontermIdent) ->
_lhsInt
sem_Pattern_Alias :: (Identifier) -> (Identifier) -> T_Pattern -> T_Pattern
sem_Pattern_Alias !arg_field_ !arg_attr_ arg_pat_ = T_Pattern (return st29) where
!st29 = let
v28 :: T_Pattern_v28
v28 = \ !(T_Pattern_vIn28 _lhsIchildInhs _lhsIchildSyns _lhsIcon _lhsIdefs _lhsIforcedIrrefutables _lhsInt) -> ( let
_patX29 = Control.Monad.Identity.runIdentity (attach_T_Pattern (arg_pat_))
(T_Pattern_vOut28 _patIallAttributes _patIcopy _patIdefsCollect _patIerrors _patIoutput) = inv_Pattern_s29 _patX29 (T_Pattern_vIn28 _patOchildInhs _patOchildSyns _patOcon _patOdefs _patOforcedIrrefutables _patOnt)
(_field',_err1) = rule162 _lhsIchildInhs _lhsIcon _lhsInt arg_attr_ arg_field_
_err2 = rule163 _field' _lhsIcon _lhsIdefs _lhsInt arg_attr_ arg_field_
_lhsOerrors :: Seq Error
_lhsOerrors = rule164 _err1 _err2 _patIerrors
_output = rule165 _field' _patIoutput arg_attr_
_def = rule166 arg_attr_ arg_field_
_lhsOdefsCollect :: Set (Identifier, Identifier)
_lhsOdefsCollect = rule167 _def _patIdefsCollect
_lhsOallAttributes :: AttrMap
_lhsOallAttributes = rule168 _lhsIcon _lhsInt _patIallAttributes arg_attr_ arg_field_
_lhsOoutput :: Pattern
_lhsOoutput = rule169 _lhsIcon _lhsIforcedIrrefutables _lhsInt _output arg_attr_ arg_field_
_copy = rule170 _patIcopy arg_attr_ arg_field_
_lhsOcopy :: Pattern
_lhsOcopy = rule171 _copy
_patOchildInhs = rule172 _lhsIchildInhs
_patOchildSyns = rule173 _lhsIchildSyns
_patOcon = rule174 _lhsIcon
_patOdefs = rule175 _lhsIdefs
_patOforcedIrrefutables = rule176 _lhsIforcedIrrefutables
_patOnt = rule177 _lhsInt
!__result_ = T_Pattern_vOut28 _lhsOallAttributes _lhsOcopy _lhsOdefsCollect _lhsOerrors _lhsOoutput
in __result_ )
in C_Pattern_s29 v28
rule162 = \ ((_lhsIchildInhs) :: [(Identifier, Identifier)]) ((_lhsIcon) :: ConstructorIdent) ((_lhsInt) :: NontermIdent) attr_ field_ ->
maybeError field_ (UndefAttr _lhsInt _lhsIcon (Ident "<ANY>" (getPos field_)) attr_ True) $
findField field_ attr_ _lhsIchildInhs
rule163 = \ _field' ((_lhsIcon) :: ConstructorIdent) ((_lhsIdefs) :: Set (Identifier, Identifier)) ((_lhsInt) :: NontermIdent) attr_ field_ ->
if _field' == field_
then Seq.empty
else if (_field' , attr_) `Set.member` _lhsIdefs
then Seq.singleton $ DupRule _lhsInt _lhsIcon field_ attr_ _field'
else Seq.empty
rule164 = \ _err1 _err2 ((_patIerrors) :: Seq Error) ->
_err1 Seq.>< _err2 Seq.>< _patIerrors
rule165 = \ _field' ((_patIoutput) :: Pattern) attr_ ->
Alias _field' attr_ _patIoutput
rule166 = \ attr_ field_ ->
Set.singleton (field_, attr_)
rule167 = \ _def ((_patIdefsCollect) :: Set (Identifier, Identifier)) ->
_def `Set.union` _patIdefsCollect
rule168 = \ ((_lhsIcon) :: ConstructorIdent) ((_lhsInt) :: NontermIdent) ((_patIallAttributes) :: AttrMap) attr_ field_ ->
(Map.singleton _lhsInt $ Map.singleton _lhsIcon $ Set.singleton (field_, attr_)) `mergeAttributes` _patIallAttributes
rule169 = \ ((_lhsIcon) :: ConstructorIdent) ((_lhsIforcedIrrefutables) :: AttrMap) ((_lhsInt) :: NontermIdent) _output attr_ field_ ->
if Set.member (field_, attr_) $ Map.findWithDefault Set.empty _lhsIcon $ Map.findWithDefault Map.empty _lhsInt $ _lhsIforcedIrrefutables
then Irrefutable _output
else _output
rule170 = \ ((_patIcopy) :: Pattern) attr_ field_ ->
Alias field_ attr_ _patIcopy
rule171 = \ _copy ->
_copy
rule172 = \ ((_lhsIchildInhs) :: [(Identifier, Identifier)]) ->
_lhsIchildInhs
rule173 = \ ((_lhsIchildSyns) :: [(Identifier, Identifier)]) ->
_lhsIchildSyns
rule174 = \ ((_lhsIcon) :: ConstructorIdent) ->
_lhsIcon
rule175 = \ ((_lhsIdefs) :: Set (Identifier, Identifier)) ->
_lhsIdefs
rule176 = \ ((_lhsIforcedIrrefutables) :: AttrMap) ->
_lhsIforcedIrrefutables
rule177 = \ ((_lhsInt) :: NontermIdent) ->
_lhsInt
sem_Pattern_Irrefutable :: T_Pattern -> T_Pattern
sem_Pattern_Irrefutable arg_pat_ = T_Pattern (return st29) where
!st29 = let
v28 :: T_Pattern_v28
v28 = \ !(T_Pattern_vIn28 _lhsIchildInhs _lhsIchildSyns _lhsIcon _lhsIdefs _lhsIforcedIrrefutables _lhsInt) -> ( let
_patX29 = Control.Monad.Identity.runIdentity (attach_T_Pattern (arg_pat_))
(T_Pattern_vOut28 _patIallAttributes _patIcopy _patIdefsCollect _patIerrors _patIoutput) = inv_Pattern_s29 _patX29 (T_Pattern_vIn28 _patOchildInhs _patOchildSyns _patOcon _patOdefs _patOforcedIrrefutables _patOnt)
_lhsOallAttributes :: AttrMap
_lhsOallAttributes = rule178 ()
_lhsOdefsCollect :: Set (Identifier, Identifier)
_lhsOdefsCollect = rule179 _patIdefsCollect
_lhsOerrors :: Seq Error
_lhsOerrors = rule180 _patIerrors
_copy = rule181 _patIcopy
_output = rule182 _patIoutput
_lhsOcopy :: Pattern
_lhsOcopy = rule183 _copy
_lhsOoutput :: Pattern
_lhsOoutput = rule184 _output
_patOchildInhs = rule185 _lhsIchildInhs
_patOchildSyns = rule186 _lhsIchildSyns
_patOcon = rule187 _lhsIcon
_patOdefs = rule188 _lhsIdefs
_patOforcedIrrefutables = rule189 _lhsIforcedIrrefutables
_patOnt = rule190 _lhsInt
!__result_ = T_Pattern_vOut28 _lhsOallAttributes _lhsOcopy _lhsOdefsCollect _lhsOerrors _lhsOoutput
in __result_ )
in C_Pattern_s29 v28
rule178 = \ (_ :: ()) ->
Map.empty
rule179 = \ ((_patIdefsCollect) :: Set (Identifier, Identifier)) ->
_patIdefsCollect
rule180 = \ ((_patIerrors) :: Seq Error) ->
_patIerrors
rule181 = \ ((_patIcopy) :: Pattern) ->
Irrefutable _patIcopy
rule182 = \ ((_patIoutput) :: Pattern) ->
Irrefutable _patIoutput
rule183 = \ _copy ->
_copy
rule184 = \ _output ->
_output
rule185 = \ ((_lhsIchildInhs) :: [(Identifier, Identifier)]) ->
_lhsIchildInhs
rule186 = \ ((_lhsIchildSyns) :: [(Identifier, Identifier)]) ->
_lhsIchildSyns
rule187 = \ ((_lhsIcon) :: ConstructorIdent) ->
_lhsIcon
rule188 = \ ((_lhsIdefs) :: Set (Identifier, Identifier)) ->
_lhsIdefs
rule189 = \ ((_lhsIforcedIrrefutables) :: AttrMap) ->
_lhsIforcedIrrefutables
rule190 = \ ((_lhsInt) :: NontermIdent) ->
_lhsInt
sem_Pattern_Underscore :: (Pos) -> T_Pattern
sem_Pattern_Underscore !arg_pos_ = T_Pattern (return st29) where
!st29 = let
v28 :: T_Pattern_v28
v28 = \ !(T_Pattern_vIn28 _lhsIchildInhs _lhsIchildSyns _lhsIcon _lhsIdefs _lhsIforcedIrrefutables _lhsInt) -> ( let
_lhsOallAttributes :: AttrMap
_lhsOallAttributes = rule191 ()
_lhsOdefsCollect :: Set (Identifier, Identifier)
_lhsOdefsCollect = rule192 ()
_lhsOerrors :: Seq Error
_lhsOerrors = rule193 ()
_copy = rule194 arg_pos_
_output = rule195 arg_pos_
_lhsOcopy :: Pattern
_lhsOcopy = rule196 _copy
_lhsOoutput :: Pattern
_lhsOoutput = rule197 _output
!__result_ = T_Pattern_vOut28 _lhsOallAttributes _lhsOcopy _lhsOdefsCollect _lhsOerrors _lhsOoutput
in __result_ )
in C_Pattern_s29 v28
rule191 = \ (_ :: ()) ->
Map.empty
rule192 = \ (_ :: ()) ->
Set.empty
rule193 = \ (_ :: ()) ->
Seq.empty
rule194 = \ pos_ ->
Underscore pos_
rule195 = \ pos_ ->
Underscore pos_
rule196 = \ _copy ->
_copy
rule197 = \ _output ->
_output
data Inh_Patterns = Inh_Patterns { childInhs_Inh_Patterns :: !([(Identifier, Identifier)]), childSyns_Inh_Patterns :: !([(Identifier, Identifier)]), con_Inh_Patterns :: !(ConstructorIdent), defs_Inh_Patterns :: !(Set (Identifier, Identifier)), forcedIrrefutables_Inh_Patterns :: !(AttrMap), nt_Inh_Patterns :: !(NontermIdent) }
data Syn_Patterns = Syn_Patterns { allAttributes_Syn_Patterns :: !(AttrMap), copy_Syn_Patterns :: !(Patterns), defsCollect_Syn_Patterns :: !(Set (Identifier, Identifier)), errors_Syn_Patterns :: !(Seq Error), output_Syn_Patterns :: !(Patterns) }
wrap_Patterns :: T_Patterns -> Inh_Patterns -> (Syn_Patterns )
wrap_Patterns !(T_Patterns act) !(Inh_Patterns _lhsIchildInhs _lhsIchildSyns _lhsIcon _lhsIdefs _lhsIforcedIrrefutables _lhsInt) =
Control.Monad.Identity.runIdentity (
do !sem <- act
let arg = T_Patterns_vIn31 _lhsIchildInhs _lhsIchildSyns _lhsIcon _lhsIdefs _lhsIforcedIrrefutables _lhsInt
!(T_Patterns_vOut31 _lhsOallAttributes _lhsOcopy _lhsOdefsCollect _lhsOerrors _lhsOoutput) <- return (inv_Patterns_s32 sem arg)
return (Syn_Patterns _lhsOallAttributes _lhsOcopy _lhsOdefsCollect _lhsOerrors _lhsOoutput)
)
sem_Patterns :: Patterns -> T_Patterns
sem_Patterns list = Prelude.foldr sem_Patterns_Cons sem_Patterns_Nil (Prelude.map sem_Pattern list)
newtype T_Patterns = T_Patterns {
attach_T_Patterns :: Identity (T_Patterns_s32 )
}
newtype T_Patterns_s32 = C_Patterns_s32 {
inv_Patterns_s32 :: (T_Patterns_v31 )
}
data T_Patterns_s33 = C_Patterns_s33
type T_Patterns_v31 = (T_Patterns_vIn31 ) -> (T_Patterns_vOut31 )
data T_Patterns_vIn31 = T_Patterns_vIn31 ([(Identifier, Identifier)]) ([(Identifier, Identifier)]) (ConstructorIdent) (Set (Identifier, Identifier)) (AttrMap) (NontermIdent)
data T_Patterns_vOut31 = T_Patterns_vOut31 (AttrMap) (Patterns) (Set (Identifier, Identifier)) (Seq Error) (Patterns)
sem_Patterns_Cons :: T_Pattern -> T_Patterns -> T_Patterns
sem_Patterns_Cons arg_hd_ arg_tl_ = T_Patterns (return st32) where
!st32 = let
v31 :: T_Patterns_v31
v31 = \ !(T_Patterns_vIn31 _lhsIchildInhs _lhsIchildSyns _lhsIcon _lhsIdefs _lhsIforcedIrrefutables _lhsInt) -> ( let
_hdX29 = Control.Monad.Identity.runIdentity (attach_T_Pattern (arg_hd_))
_tlX32 = Control.Monad.Identity.runIdentity (attach_T_Patterns (arg_tl_))
(T_Pattern_vOut28 _hdIallAttributes _hdIcopy _hdIdefsCollect _hdIerrors _hdIoutput) = inv_Pattern_s29 _hdX29 (T_Pattern_vIn28 _hdOchildInhs _hdOchildSyns _hdOcon _hdOdefs _hdOforcedIrrefutables _hdOnt)
(T_Patterns_vOut31 _tlIallAttributes _tlIcopy _tlIdefsCollect _tlIerrors _tlIoutput) = inv_Patterns_s32 _tlX32 (T_Patterns_vIn31 _tlOchildInhs _tlOchildSyns _tlOcon _tlOdefs _tlOforcedIrrefutables _tlOnt)
_lhsOallAttributes :: AttrMap
_lhsOallAttributes = rule198 _hdIallAttributes _tlIallAttributes
_lhsOdefsCollect :: Set (Identifier, Identifier)
_lhsOdefsCollect = rule199 _hdIdefsCollect _tlIdefsCollect
_lhsOerrors :: Seq Error
_lhsOerrors = rule200 _hdIerrors _tlIerrors
_copy = rule201 _hdIcopy _tlIcopy
_output = rule202 _hdIoutput _tlIoutput
_lhsOcopy :: Patterns
_lhsOcopy = rule203 _copy
_lhsOoutput :: Patterns
_lhsOoutput = rule204 _output
_hdOchildInhs = rule205 _lhsIchildInhs
_hdOchildSyns = rule206 _lhsIchildSyns
_hdOcon = rule207 _lhsIcon
_hdOdefs = rule208 _lhsIdefs
_hdOforcedIrrefutables = rule209 _lhsIforcedIrrefutables
_hdOnt = rule210 _lhsInt
_tlOchildInhs = rule211 _lhsIchildInhs
_tlOchildSyns = rule212 _lhsIchildSyns
_tlOcon = rule213 _lhsIcon
_tlOdefs = rule214 _lhsIdefs
_tlOforcedIrrefutables = rule215 _lhsIforcedIrrefutables
_tlOnt = rule216 _lhsInt
!__result_ = T_Patterns_vOut31 _lhsOallAttributes _lhsOcopy _lhsOdefsCollect _lhsOerrors _lhsOoutput
in __result_ )
in C_Patterns_s32 v31
rule198 = \ ((_hdIallAttributes) :: AttrMap) ((_tlIallAttributes) :: AttrMap) ->
_hdIallAttributes `mergeAttributes` _tlIallAttributes
rule199 = \ ((_hdIdefsCollect) :: Set (Identifier, Identifier)) ((_tlIdefsCollect) :: Set (Identifier, Identifier)) ->
_hdIdefsCollect `Set.union` _tlIdefsCollect
rule200 = \ ((_hdIerrors) :: Seq Error) ((_tlIerrors) :: Seq Error) ->
_hdIerrors Seq.>< _tlIerrors
rule201 = \ ((_hdIcopy) :: Pattern) ((_tlIcopy) :: Patterns) ->
(:) _hdIcopy _tlIcopy
rule202 = \ ((_hdIoutput) :: Pattern) ((_tlIoutput) :: Patterns) ->
(:) _hdIoutput _tlIoutput
rule203 = \ _copy ->
_copy
rule204 = \ _output ->
_output
rule205 = \ ((_lhsIchildInhs) :: [(Identifier, Identifier)]) ->
_lhsIchildInhs
rule206 = \ ((_lhsIchildSyns) :: [(Identifier, Identifier)]) ->
_lhsIchildSyns
rule207 = \ ((_lhsIcon) :: ConstructorIdent) ->
_lhsIcon
rule208 = \ ((_lhsIdefs) :: Set (Identifier, Identifier)) ->
_lhsIdefs
rule209 = \ ((_lhsIforcedIrrefutables) :: AttrMap) ->
_lhsIforcedIrrefutables
rule210 = \ ((_lhsInt) :: NontermIdent) ->
_lhsInt
rule211 = \ ((_lhsIchildInhs) :: [(Identifier, Identifier)]) ->
_lhsIchildInhs
rule212 = \ ((_lhsIchildSyns) :: [(Identifier, Identifier)]) ->
_lhsIchildSyns
rule213 = \ ((_lhsIcon) :: ConstructorIdent) ->
_lhsIcon
rule214 = \ ((_lhsIdefs) :: Set (Identifier, Identifier)) ->
_lhsIdefs
rule215 = \ ((_lhsIforcedIrrefutables) :: AttrMap) ->
_lhsIforcedIrrefutables
rule216 = \ ((_lhsInt) :: NontermIdent) ->
_lhsInt
sem_Patterns_Nil :: T_Patterns
sem_Patterns_Nil = T_Patterns (return st32) where
!st32 = let
v31 :: T_Patterns_v31
v31 = \ !(T_Patterns_vIn31 _lhsIchildInhs _lhsIchildSyns _lhsIcon _lhsIdefs _lhsIforcedIrrefutables _lhsInt) -> ( let
_lhsOallAttributes :: AttrMap
_lhsOallAttributes = rule217 ()
_lhsOdefsCollect :: Set (Identifier, Identifier)
_lhsOdefsCollect = rule218 ()
_lhsOerrors :: Seq Error
_lhsOerrors = rule219 ()
_copy = rule220 ()
_output = rule221 ()
_lhsOcopy :: Patterns
_lhsOcopy = rule222 _copy
_lhsOoutput :: Patterns
_lhsOoutput = rule223 _output
!__result_ = T_Patterns_vOut31 _lhsOallAttributes _lhsOcopy _lhsOdefsCollect _lhsOerrors _lhsOoutput
in __result_ )
in C_Patterns_s32 v31
rule217 = \ (_ :: ()) ->
Map.empty
rule218 = \ (_ :: ()) ->
Set.empty
rule219 = \ (_ :: ()) ->
Seq.empty
rule220 = \ (_ :: ()) ->
[]
rule221 = \ (_ :: ()) ->
[]
rule222 = \ _copy ->
_copy
rule223 = \ _output ->
_output
data Inh_Production = Inh_Production { augmentsIn_Inh_Production :: !(Map ConstructorIdent (Map Identifier [Expression])), forcedIrrefutables_Inh_Production :: !(AttrMap), inhMap_Inh_Production :: !(Map Identifier Attributes), mainName_Inh_Production :: !(String), nt_Inh_Production :: !(NontermIdent), options_Inh_Production :: !(Options), synMap_Inh_Production :: !(Map Identifier Attributes) }
data Syn_Production = Syn_Production { allAttributes_Syn_Production :: !(AttrMap), augmentsOut_Syn_Production :: !(Map ConstructorIdent (Map Identifier [Expression])), errors_Syn_Production :: !(Seq Error), output_Syn_Production :: !(Production) }
wrap_Production :: T_Production -> Inh_Production -> (Syn_Production )
wrap_Production !(T_Production act) !(Inh_Production _lhsIaugmentsIn _lhsIforcedIrrefutables _lhsIinhMap _lhsImainName _lhsInt _lhsIoptions _lhsIsynMap) =
Control.Monad.Identity.runIdentity (
do !sem <- act
let arg = T_Production_vIn34 _lhsIaugmentsIn _lhsIforcedIrrefutables _lhsIinhMap _lhsImainName _lhsInt _lhsIoptions _lhsIsynMap
!(T_Production_vOut34 _lhsOallAttributes _lhsOaugmentsOut _lhsOerrors _lhsOoutput) <- return (inv_Production_s35 sem arg)
return (Syn_Production _lhsOallAttributes _lhsOaugmentsOut _lhsOerrors _lhsOoutput)
)
sem_Production :: Production -> T_Production
sem_Production ( Production !con_ !params_ !constraints_ children_ rules_ typeSigs_ !macro_ ) = sem_Production_Production con_ params_ constraints_ ( sem_Children children_ ) ( sem_Rules rules_ ) ( sem_TypeSigs typeSigs_ ) macro_
newtype T_Production = T_Production {
attach_T_Production :: Identity (T_Production_s35 )
}
newtype T_Production_s35 = C_Production_s35 {
inv_Production_s35 :: (T_Production_v34 )
}
data T_Production_s36 = C_Production_s36
type T_Production_v34 = (T_Production_vIn34 ) -> (T_Production_vOut34 )
data T_Production_vIn34 = T_Production_vIn34 (Map ConstructorIdent (Map Identifier [Expression])) (AttrMap) (Map Identifier Attributes) (String) (NontermIdent) (Options) (Map Identifier Attributes)
data T_Production_vOut34 = T_Production_vOut34 (AttrMap) (Map ConstructorIdent (Map Identifier [Expression])) (Seq Error) (Production)
sem_Production_Production :: (ConstructorIdent) -> ([Identifier]) -> ([Type]) -> T_Children -> T_Rules -> T_TypeSigs -> (MaybeMacro) -> T_Production
sem_Production_Production !arg_con_ !arg_params_ !arg_constraints_ arg_children_ arg_rules_ arg_typeSigs_ !arg_macro_ = T_Production (return st35) where
!st35 = let
v34 :: T_Production_v34
v34 = \ !(T_Production_vIn34 _lhsIaugmentsIn _lhsIforcedIrrefutables _lhsIinhMap _lhsImainName _lhsInt _lhsIoptions _lhsIsynMap) -> ( let
_childrenX5 = Control.Monad.Identity.runIdentity (attach_T_Children (arg_children_))
_rulesX44 = Control.Monad.Identity.runIdentity (attach_T_Rules (arg_rules_))
_typeSigsX50 = Control.Monad.Identity.runIdentity (attach_T_TypeSigs (arg_typeSigs_))
(T_Children_vOut4 _childrenIchildInhs _childrenIchildSyns _childrenIoutput) = inv_Children_s5 _childrenX5 (T_Children_vIn4 _childrenOinhMap _childrenOmainName _childrenOoptions _childrenOsynMap)
(T_Rules_vOut43 _rulesIallAttributes _rulesIdefsCollect _rulesIerrors _rulesIoutput) = inv_Rules_s44 _rulesX44 (T_Rules_vIn43 _rulesOchildInhs _rulesOchildSyns _rulesOcon _rulesOdefs _rulesOforcedIrrefutables _rulesOnt _rulesOoptions)
(T_TypeSigs_vOut49 _typeSigsIoutput) = inv_TypeSigs_s50 _typeSigsX50 (T_TypeSigs_vIn49 )
_rulesOcon = rule224 arg_con_
_rulesOdefs = rule225 _rulesIdefsCollect
_augmentsIn = rule226 _lhsIaugmentsIn arg_con_
_augmentsOut = rule227 _augmentsOut1 arg_con_
(_augmentErrs,_augmentsOut1) = rule228 _augmentsIn _childrenIchildInhs _childrenIchildSyns _lhsInt _lhsIoptions arg_con_
_lhsOerrors :: Seq Error
_lhsOerrors = rule229 _augmentErrs _rulesIerrors
_lhsOallAttributes :: AttrMap
_lhsOallAttributes = rule230 _rulesIallAttributes
_lhsOaugmentsOut :: Map ConstructorIdent (Map Identifier [Expression])
_lhsOaugmentsOut = rule231 _augmentsOut
_output = rule232 _childrenIoutput _rulesIoutput _typeSigsIoutput arg_con_ arg_constraints_ arg_macro_ arg_params_
_lhsOoutput :: Production
_lhsOoutput = rule233 _output
_childrenOinhMap = rule234 _lhsIinhMap
_childrenOmainName = rule235 _lhsImainName
_childrenOoptions = rule236 _lhsIoptions
_childrenOsynMap = rule237 _lhsIsynMap
_rulesOchildInhs = rule238 _childrenIchildInhs
_rulesOchildSyns = rule239 _childrenIchildSyns
_rulesOforcedIrrefutables = rule240 _lhsIforcedIrrefutables
_rulesOnt = rule241 _lhsInt
_rulesOoptions = rule242 _lhsIoptions
!__result_ = T_Production_vOut34 _lhsOallAttributes _lhsOaugmentsOut _lhsOerrors _lhsOoutput
in __result_ )
in C_Production_s35 v34
rule224 = \ con_ ->
con_
rule225 = \ ((_rulesIdefsCollect) :: Set (Identifier, Identifier)) ->
_rulesIdefsCollect
rule226 = \ ((_lhsIaugmentsIn) :: Map ConstructorIdent (Map Identifier [Expression])) con_ ->
Map.findWithDefault Map.empty con_ _lhsIaugmentsIn
rule227 = \ _augmentsOut1 con_ ->
Map.singleton con_ _augmentsOut1
rule228 = \ _augmentsIn ((_childrenIchildInhs) :: [(Identifier, Identifier)]) ((_childrenIchildSyns) :: [(Identifier, Identifier)]) ((_lhsInt) :: NontermIdent) ((_lhsIoptions) :: Options) con_ ->
Map.mapAccum (desugarExprs _lhsIoptions _lhsInt con_ _childrenIchildInhs _childrenIchildSyns) Seq.empty _augmentsIn
rule229 = \ _augmentErrs ((_rulesIerrors) :: Seq Error) ->
_rulesIerrors Seq.>< _augmentErrs
rule230 = \ ((_rulesIallAttributes) :: AttrMap) ->
_rulesIallAttributes
rule231 = \ _augmentsOut ->
_augmentsOut
rule232 = \ ((_childrenIoutput) :: Children) ((_rulesIoutput) :: Rules) ((_typeSigsIoutput) :: TypeSigs) con_ constraints_ macro_ params_ ->
Production con_ params_ constraints_ _childrenIoutput _rulesIoutput _typeSigsIoutput macro_
rule233 = \ _output ->
_output
rule234 = \ ((_lhsIinhMap) :: Map Identifier Attributes) ->
_lhsIinhMap
rule235 = \ ((_lhsImainName) :: String) ->
_lhsImainName
rule236 = \ ((_lhsIoptions) :: Options) ->
_lhsIoptions
rule237 = \ ((_lhsIsynMap) :: Map Identifier Attributes) ->
_lhsIsynMap
rule238 = \ ((_childrenIchildInhs) :: [(Identifier, Identifier)]) ->
_childrenIchildInhs
rule239 = \ ((_childrenIchildSyns) :: [(Identifier, Identifier)]) ->
_childrenIchildSyns
rule240 = \ ((_lhsIforcedIrrefutables) :: AttrMap) ->
_lhsIforcedIrrefutables
rule241 = \ ((_lhsInt) :: NontermIdent) ->
_lhsInt
rule242 = \ ((_lhsIoptions) :: Options) ->
_lhsIoptions
data Inh_Productions = Inh_Productions { augmentsIn_Inh_Productions :: !(Map ConstructorIdent (Map Identifier [Expression])), forcedIrrefutables_Inh_Productions :: !(AttrMap), inhMap_Inh_Productions :: !(Map Identifier Attributes), mainName_Inh_Productions :: !(String), nt_Inh_Productions :: !(NontermIdent), options_Inh_Productions :: !(Options), synMap_Inh_Productions :: !(Map Identifier Attributes) }
data Syn_Productions = Syn_Productions { allAttributes_Syn_Productions :: !(AttrMap), augmentsOut_Syn_Productions :: !(Map ConstructorIdent (Map Identifier [Expression])), errors_Syn_Productions :: !(Seq Error), output_Syn_Productions :: !(Productions) }
wrap_Productions :: T_Productions -> Inh_Productions -> (Syn_Productions )
wrap_Productions !(T_Productions act) !(Inh_Productions _lhsIaugmentsIn _lhsIforcedIrrefutables _lhsIinhMap _lhsImainName _lhsInt _lhsIoptions _lhsIsynMap) =
Control.Monad.Identity.runIdentity (
do !sem <- act
let arg = T_Productions_vIn37 _lhsIaugmentsIn _lhsIforcedIrrefutables _lhsIinhMap _lhsImainName _lhsInt _lhsIoptions _lhsIsynMap
!(T_Productions_vOut37 _lhsOallAttributes _lhsOaugmentsOut _lhsOerrors _lhsOoutput) <- return (inv_Productions_s38 sem arg)
return (Syn_Productions _lhsOallAttributes _lhsOaugmentsOut _lhsOerrors _lhsOoutput)
)
sem_Productions :: Productions -> T_Productions
sem_Productions list = Prelude.foldr sem_Productions_Cons sem_Productions_Nil (Prelude.map sem_Production list)
newtype T_Productions = T_Productions {
attach_T_Productions :: Identity (T_Productions_s38 )
}
newtype T_Productions_s38 = C_Productions_s38 {
inv_Productions_s38 :: (T_Productions_v37 )
}
data T_Productions_s39 = C_Productions_s39
type T_Productions_v37 = (T_Productions_vIn37 ) -> (T_Productions_vOut37 )
data T_Productions_vIn37 = T_Productions_vIn37 (Map ConstructorIdent (Map Identifier [Expression])) (AttrMap) (Map Identifier Attributes) (String) (NontermIdent) (Options) (Map Identifier Attributes)
data T_Productions_vOut37 = T_Productions_vOut37 (AttrMap) (Map ConstructorIdent (Map Identifier [Expression])) (Seq Error) (Productions)
sem_Productions_Cons :: T_Production -> T_Productions -> T_Productions
sem_Productions_Cons arg_hd_ arg_tl_ = T_Productions (return st38) where
!st38 = let
v37 :: T_Productions_v37
v37 = \ !(T_Productions_vIn37 _lhsIaugmentsIn _lhsIforcedIrrefutables _lhsIinhMap _lhsImainName _lhsInt _lhsIoptions _lhsIsynMap) -> ( let
_hdX35 = Control.Monad.Identity.runIdentity (attach_T_Production (arg_hd_))
_tlX38 = Control.Monad.Identity.runIdentity (attach_T_Productions (arg_tl_))
(T_Production_vOut34 _hdIallAttributes _hdIaugmentsOut _hdIerrors _hdIoutput) = inv_Production_s35 _hdX35 (T_Production_vIn34 _hdOaugmentsIn _hdOforcedIrrefutables _hdOinhMap _hdOmainName _hdOnt _hdOoptions _hdOsynMap)
(T_Productions_vOut37 _tlIallAttributes _tlIaugmentsOut _tlIerrors _tlIoutput) = inv_Productions_s38 _tlX38 (T_Productions_vIn37 _tlOaugmentsIn _tlOforcedIrrefutables _tlOinhMap _tlOmainName _tlOnt _tlOoptions _tlOsynMap)
_lhsOallAttributes :: AttrMap
_lhsOallAttributes = rule243 _hdIallAttributes _tlIallAttributes
_lhsOaugmentsOut :: Map ConstructorIdent (Map Identifier [Expression])
_lhsOaugmentsOut = rule244 _hdIaugmentsOut _tlIaugmentsOut
_lhsOerrors :: Seq Error
_lhsOerrors = rule245 _hdIerrors _tlIerrors
_output = rule246 _hdIoutput _tlIoutput
_lhsOoutput :: Productions
_lhsOoutput = rule247 _output
_hdOaugmentsIn = rule248 _lhsIaugmentsIn
_hdOforcedIrrefutables = rule249 _lhsIforcedIrrefutables
_hdOinhMap = rule250 _lhsIinhMap
_hdOmainName = rule251 _lhsImainName
_hdOnt = rule252 _lhsInt
_hdOoptions = rule253 _lhsIoptions
_hdOsynMap = rule254 _lhsIsynMap
_tlOaugmentsIn = rule255 _lhsIaugmentsIn
_tlOforcedIrrefutables = rule256 _lhsIforcedIrrefutables
_tlOinhMap = rule257 _lhsIinhMap
_tlOmainName = rule258 _lhsImainName
_tlOnt = rule259 _lhsInt
_tlOoptions = rule260 _lhsIoptions
_tlOsynMap = rule261 _lhsIsynMap
!__result_ = T_Productions_vOut37 _lhsOallAttributes _lhsOaugmentsOut _lhsOerrors _lhsOoutput
in __result_ )
in C_Productions_s38 v37
rule243 = \ ((_hdIallAttributes) :: AttrMap) ((_tlIallAttributes) :: AttrMap) ->
_hdIallAttributes `mergeAttributes` _tlIallAttributes
rule244 = \ ((_hdIaugmentsOut) :: Map ConstructorIdent (Map Identifier [Expression])) ((_tlIaugmentsOut) :: Map ConstructorIdent (Map Identifier [Expression])) ->
_hdIaugmentsOut `Map.union` _tlIaugmentsOut
rule245 = \ ((_hdIerrors) :: Seq Error) ((_tlIerrors) :: Seq Error) ->
_hdIerrors Seq.>< _tlIerrors
rule246 = \ ((_hdIoutput) :: Production) ((_tlIoutput) :: Productions) ->
(:) _hdIoutput _tlIoutput
rule247 = \ _output ->
_output
rule248 = \ ((_lhsIaugmentsIn) :: Map ConstructorIdent (Map Identifier [Expression])) ->
_lhsIaugmentsIn
rule249 = \ ((_lhsIforcedIrrefutables) :: AttrMap) ->
_lhsIforcedIrrefutables
rule250 = \ ((_lhsIinhMap) :: Map Identifier Attributes) ->
_lhsIinhMap
rule251 = \ ((_lhsImainName) :: String) ->
_lhsImainName
rule252 = \ ((_lhsInt) :: NontermIdent) ->
_lhsInt
rule253 = \ ((_lhsIoptions) :: Options) ->
_lhsIoptions
rule254 = \ ((_lhsIsynMap) :: Map Identifier Attributes) ->
_lhsIsynMap
rule255 = \ ((_lhsIaugmentsIn) :: Map ConstructorIdent (Map Identifier [Expression])) ->
_lhsIaugmentsIn
rule256 = \ ((_lhsIforcedIrrefutables) :: AttrMap) ->
_lhsIforcedIrrefutables
rule257 = \ ((_lhsIinhMap) :: Map Identifier Attributes) ->
_lhsIinhMap
rule258 = \ ((_lhsImainName) :: String) ->
_lhsImainName
rule259 = \ ((_lhsInt) :: NontermIdent) ->
_lhsInt
rule260 = \ ((_lhsIoptions) :: Options) ->
_lhsIoptions
rule261 = \ ((_lhsIsynMap) :: Map Identifier Attributes) ->
_lhsIsynMap
sem_Productions_Nil :: T_Productions
sem_Productions_Nil = T_Productions (return st38) where
!st38 = let
v37 :: T_Productions_v37
v37 = \ !(T_Productions_vIn37 _lhsIaugmentsIn _lhsIforcedIrrefutables _lhsIinhMap _lhsImainName _lhsInt _lhsIoptions _lhsIsynMap) -> ( let
_lhsOallAttributes :: AttrMap
_lhsOallAttributes = rule262 ()
_lhsOaugmentsOut :: Map ConstructorIdent (Map Identifier [Expression])
_lhsOaugmentsOut = rule263 ()
_lhsOerrors :: Seq Error
_lhsOerrors = rule264 ()
_output = rule265 ()
_lhsOoutput :: Productions
_lhsOoutput = rule266 _output
!__result_ = T_Productions_vOut37 _lhsOallAttributes _lhsOaugmentsOut _lhsOerrors _lhsOoutput
in __result_ )
in C_Productions_s38 v37
rule262 = \ (_ :: ()) ->
Map.empty
rule263 = \ (_ :: ()) ->
Map.empty
rule264 = \ (_ :: ()) ->
Seq.empty
rule265 = \ (_ :: ()) ->
[]
rule266 = \ _output ->
_output
data Inh_Rule = Inh_Rule { childInhs_Inh_Rule :: !([(Identifier, Identifier)]), childSyns_Inh_Rule :: !([(Identifier, Identifier)]), con_Inh_Rule :: !(ConstructorIdent), defs_Inh_Rule :: !(Set (Identifier, Identifier)), forcedIrrefutables_Inh_Rule :: !(AttrMap), nt_Inh_Rule :: !(NontermIdent), options_Inh_Rule :: !(Options) }
data Syn_Rule = Syn_Rule { allAttributes_Syn_Rule :: !(AttrMap), defsCollect_Syn_Rule :: !(Set (Identifier, Identifier)), errors_Syn_Rule :: !(Seq Error), output_Syn_Rule :: !(Rule) }
wrap_Rule :: T_Rule -> Inh_Rule -> (Syn_Rule )
wrap_Rule !(T_Rule act) !(Inh_Rule _lhsIchildInhs _lhsIchildSyns _lhsIcon _lhsIdefs _lhsIforcedIrrefutables _lhsInt _lhsIoptions) =
Control.Monad.Identity.runIdentity (
do !sem <- act
let arg = T_Rule_vIn40 _lhsIchildInhs _lhsIchildSyns _lhsIcon _lhsIdefs _lhsIforcedIrrefutables _lhsInt _lhsIoptions
!(T_Rule_vOut40 _lhsOallAttributes _lhsOdefsCollect _lhsOerrors _lhsOoutput) <- return (inv_Rule_s41 sem arg)
return (Syn_Rule _lhsOallAttributes _lhsOdefsCollect _lhsOerrors _lhsOoutput)
)
sem_Rule :: Rule -> T_Rule
sem_Rule ( Rule !mbName_ pattern_ rhs_ !owrt_ !origin_ !explicit_ !pure_ !identity_ !mbError_ !eager_ ) = sem_Rule_Rule mbName_ ( sem_Pattern pattern_ ) ( sem_Expression rhs_ ) owrt_ origin_ explicit_ pure_ identity_ mbError_ eager_
newtype T_Rule = T_Rule {
attach_T_Rule :: Identity (T_Rule_s41 )
}
newtype T_Rule_s41 = C_Rule_s41 {
inv_Rule_s41 :: (T_Rule_v40 )
}
data T_Rule_s42 = C_Rule_s42
type T_Rule_v40 = (T_Rule_vIn40 ) -> (T_Rule_vOut40 )
data T_Rule_vIn40 = T_Rule_vIn40 ([(Identifier, Identifier)]) ([(Identifier, Identifier)]) (ConstructorIdent) (Set (Identifier, Identifier)) (AttrMap) (NontermIdent) (Options)
data T_Rule_vOut40 = T_Rule_vOut40 (AttrMap) (Set (Identifier, Identifier)) (Seq Error) (Rule)
sem_Rule_Rule :: (Maybe Identifier) -> T_Pattern -> T_Expression -> (Bool) -> (String) -> (Bool) -> (Bool) -> (Bool) -> (Maybe Error) -> (Bool) -> T_Rule
sem_Rule_Rule !arg_mbName_ arg_pattern_ arg_rhs_ !arg_owrt_ !arg_origin_ !arg_explicit_ !arg_pure_ !arg_identity_ !arg_mbError_ !arg_eager_ = T_Rule (return st41) where
!st41 = let
v40 :: T_Rule_v40
v40 = \ !(T_Rule_vIn40 _lhsIchildInhs _lhsIchildSyns _lhsIcon _lhsIdefs _lhsIforcedIrrefutables _lhsInt _lhsIoptions) -> ( let
_patternX29 = Control.Monad.Identity.runIdentity (attach_T_Pattern (arg_pattern_))
_rhsX8 = Control.Monad.Identity.runIdentity (attach_T_Expression (arg_rhs_))
(T_Pattern_vOut28 _patternIallAttributes _patternIcopy _patternIdefsCollect _patternIerrors _patternIoutput) = inv_Pattern_s29 _patternX29 (T_Pattern_vIn28 _patternOchildInhs _patternOchildSyns _patternOcon _patternOdefs _patternOforcedIrrefutables _patternOnt)
(T_Expression_vOut7 _rhsIerrors _rhsIoutput) = inv_Expression_s8 _rhsX8 (T_Expression_vIn7 _rhsOchildInhs _rhsOchildSyns _rhsOcon _rhsOnt _rhsOoptions _rhsOruleDescr)
_ruleDescr = rule267 _lhsIcon _lhsInt _patternIdefsCollect
_lhsOallAttributes :: AttrMap
_lhsOallAttributes = rule268 _patternIallAttributes
_lhsOdefsCollect :: Set (Identifier, Identifier)
_lhsOdefsCollect = rule269 _patternIdefsCollect
_lhsOerrors :: Seq Error
_lhsOerrors = rule270 _patternIerrors _rhsIerrors
_output = rule271 _patternIoutput _rhsIoutput arg_eager_ arg_explicit_ arg_identity_ arg_mbError_ arg_mbName_ arg_origin_ arg_owrt_ arg_pure_
_lhsOoutput :: Rule
_lhsOoutput = rule272 _output
_patternOchildInhs = rule273 _lhsIchildInhs
_patternOchildSyns = rule274 _lhsIchildSyns
_patternOcon = rule275 _lhsIcon
_patternOdefs = rule276 _lhsIdefs
_patternOforcedIrrefutables = rule277 _lhsIforcedIrrefutables
_patternOnt = rule278 _lhsInt
_rhsOchildInhs = rule279 _lhsIchildInhs
_rhsOchildSyns = rule280 _lhsIchildSyns
_rhsOcon = rule281 _lhsIcon
_rhsOnt = rule282 _lhsInt
_rhsOoptions = rule283 _lhsIoptions
_rhsOruleDescr = rule284 _ruleDescr
!__result_ = T_Rule_vOut40 _lhsOallAttributes _lhsOdefsCollect _lhsOerrors _lhsOoutput
in __result_ )
in C_Rule_s41 v40
rule267 = \ ((_lhsIcon) :: ConstructorIdent) ((_lhsInt) :: NontermIdent) ((_patternIdefsCollect) :: Set (Identifier, Identifier)) ->
show _lhsInt ++ " :: " ++ show _lhsIcon ++ " :: " ++ (concat $ intersperse "," $ map (\(f,a) -> show f ++ "." ++ show a) $ Set.toList _patternIdefsCollect)
rule268 = \ ((_patternIallAttributes) :: AttrMap) ->
_patternIallAttributes
rule269 = \ ((_patternIdefsCollect) :: Set (Identifier, Identifier)) ->
_patternIdefsCollect
rule270 = \ ((_patternIerrors) :: Seq Error) ((_rhsIerrors) :: Seq Error) ->
_patternIerrors Seq.>< _rhsIerrors
rule271 = \ ((_patternIoutput) :: Pattern) ((_rhsIoutput) :: Expression) eager_ explicit_ identity_ mbError_ mbName_ origin_ owrt_ pure_ ->
Rule mbName_ _patternIoutput _rhsIoutput owrt_ origin_ explicit_ pure_ identity_ mbError_ eager_
rule272 = \ _output ->
_output
rule273 = \ ((_lhsIchildInhs) :: [(Identifier, Identifier)]) ->
_lhsIchildInhs
rule274 = \ ((_lhsIchildSyns) :: [(Identifier, Identifier)]) ->
_lhsIchildSyns
rule275 = \ ((_lhsIcon) :: ConstructorIdent) ->
_lhsIcon
rule276 = \ ((_lhsIdefs) :: Set (Identifier, Identifier)) ->
_lhsIdefs
rule277 = \ ((_lhsIforcedIrrefutables) :: AttrMap) ->
_lhsIforcedIrrefutables
rule278 = \ ((_lhsInt) :: NontermIdent) ->
_lhsInt
rule279 = \ ((_lhsIchildInhs) :: [(Identifier, Identifier)]) ->
_lhsIchildInhs
rule280 = \ ((_lhsIchildSyns) :: [(Identifier, Identifier)]) ->
_lhsIchildSyns
rule281 = \ ((_lhsIcon) :: ConstructorIdent) ->
_lhsIcon
rule282 = \ ((_lhsInt) :: NontermIdent) ->
_lhsInt
rule283 = \ ((_lhsIoptions) :: Options) ->
_lhsIoptions
rule284 = \ _ruleDescr ->
_ruleDescr
data Inh_Rules = Inh_Rules { childInhs_Inh_Rules :: !([(Identifier, Identifier)]), childSyns_Inh_Rules :: !([(Identifier, Identifier)]), con_Inh_Rules :: !(ConstructorIdent), defs_Inh_Rules :: !(Set (Identifier, Identifier)), forcedIrrefutables_Inh_Rules :: !(AttrMap), nt_Inh_Rules :: !(NontermIdent), options_Inh_Rules :: !(Options) }
data Syn_Rules = Syn_Rules { allAttributes_Syn_Rules :: !(AttrMap), defsCollect_Syn_Rules :: !(Set (Identifier, Identifier)), errors_Syn_Rules :: !(Seq Error), output_Syn_Rules :: !(Rules) }
wrap_Rules :: T_Rules -> Inh_Rules -> (Syn_Rules )
wrap_Rules !(T_Rules act) !(Inh_Rules _lhsIchildInhs _lhsIchildSyns _lhsIcon _lhsIdefs _lhsIforcedIrrefutables _lhsInt _lhsIoptions) =
Control.Monad.Identity.runIdentity (
do !sem <- act
let arg = T_Rules_vIn43 _lhsIchildInhs _lhsIchildSyns _lhsIcon _lhsIdefs _lhsIforcedIrrefutables _lhsInt _lhsIoptions
!(T_Rules_vOut43 _lhsOallAttributes _lhsOdefsCollect _lhsOerrors _lhsOoutput) <- return (inv_Rules_s44 sem arg)
return (Syn_Rules _lhsOallAttributes _lhsOdefsCollect _lhsOerrors _lhsOoutput)
)
sem_Rules :: Rules -> T_Rules
sem_Rules list = Prelude.foldr sem_Rules_Cons sem_Rules_Nil (Prelude.map sem_Rule list)
newtype T_Rules = T_Rules {
attach_T_Rules :: Identity (T_Rules_s44 )
}
newtype T_Rules_s44 = C_Rules_s44 {
inv_Rules_s44 :: (T_Rules_v43 )
}
data T_Rules_s45 = C_Rules_s45
type T_Rules_v43 = (T_Rules_vIn43 ) -> (T_Rules_vOut43 )
data T_Rules_vIn43 = T_Rules_vIn43 ([(Identifier, Identifier)]) ([(Identifier, Identifier)]) (ConstructorIdent) (Set (Identifier, Identifier)) (AttrMap) (NontermIdent) (Options)
data T_Rules_vOut43 = T_Rules_vOut43 (AttrMap) (Set (Identifier, Identifier)) (Seq Error) (Rules)
sem_Rules_Cons :: T_Rule -> T_Rules -> T_Rules
sem_Rules_Cons arg_hd_ arg_tl_ = T_Rules (return st44) where
!st44 = let
v43 :: T_Rules_v43
v43 = \ !(T_Rules_vIn43 _lhsIchildInhs _lhsIchildSyns _lhsIcon _lhsIdefs _lhsIforcedIrrefutables _lhsInt _lhsIoptions) -> ( let
_hdX41 = Control.Monad.Identity.runIdentity (attach_T_Rule (arg_hd_))
_tlX44 = Control.Monad.Identity.runIdentity (attach_T_Rules (arg_tl_))
(T_Rule_vOut40 _hdIallAttributes _hdIdefsCollect _hdIerrors _hdIoutput) = inv_Rule_s41 _hdX41 (T_Rule_vIn40 _hdOchildInhs _hdOchildSyns _hdOcon _hdOdefs _hdOforcedIrrefutables _hdOnt _hdOoptions)
(T_Rules_vOut43 _tlIallAttributes _tlIdefsCollect _tlIerrors _tlIoutput) = inv_Rules_s44 _tlX44 (T_Rules_vIn43 _tlOchildInhs _tlOchildSyns _tlOcon _tlOdefs _tlOforcedIrrefutables _tlOnt _tlOoptions)
_lhsOallAttributes :: AttrMap
_lhsOallAttributes = rule285 _hdIallAttributes _tlIallAttributes
_lhsOdefsCollect :: Set (Identifier, Identifier)
_lhsOdefsCollect = rule286 _hdIdefsCollect _tlIdefsCollect
_lhsOerrors :: Seq Error
_lhsOerrors = rule287 _hdIerrors _tlIerrors
_output = rule288 _hdIoutput _tlIoutput
_lhsOoutput :: Rules
_lhsOoutput = rule289 _output
_hdOchildInhs = rule290 _lhsIchildInhs
_hdOchildSyns = rule291 _lhsIchildSyns
_hdOcon = rule292 _lhsIcon
_hdOdefs = rule293 _lhsIdefs
_hdOforcedIrrefutables = rule294 _lhsIforcedIrrefutables
_hdOnt = rule295 _lhsInt
_hdOoptions = rule296 _lhsIoptions
_tlOchildInhs = rule297 _lhsIchildInhs
_tlOchildSyns = rule298 _lhsIchildSyns
_tlOcon = rule299 _lhsIcon
_tlOdefs = rule300 _lhsIdefs
_tlOforcedIrrefutables = rule301 _lhsIforcedIrrefutables
_tlOnt = rule302 _lhsInt
_tlOoptions = rule303 _lhsIoptions
!__result_ = T_Rules_vOut43 _lhsOallAttributes _lhsOdefsCollect _lhsOerrors _lhsOoutput
in __result_ )
in C_Rules_s44 v43
rule285 = \ ((_hdIallAttributes) :: AttrMap) ((_tlIallAttributes) :: AttrMap) ->
_hdIallAttributes `mergeAttributes` _tlIallAttributes
rule286 = \ ((_hdIdefsCollect) :: Set (Identifier, Identifier)) ((_tlIdefsCollect) :: Set (Identifier, Identifier)) ->
_hdIdefsCollect `Set.union` _tlIdefsCollect
rule287 = \ ((_hdIerrors) :: Seq Error) ((_tlIerrors) :: Seq Error) ->
_hdIerrors Seq.>< _tlIerrors
rule288 = \ ((_hdIoutput) :: Rule) ((_tlIoutput) :: Rules) ->
(:) _hdIoutput _tlIoutput
rule289 = \ _output ->
_output
rule290 = \ ((_lhsIchildInhs) :: [(Identifier, Identifier)]) ->
_lhsIchildInhs
rule291 = \ ((_lhsIchildSyns) :: [(Identifier, Identifier)]) ->
_lhsIchildSyns
rule292 = \ ((_lhsIcon) :: ConstructorIdent) ->
_lhsIcon
rule293 = \ ((_lhsIdefs) :: Set (Identifier, Identifier)) ->
_lhsIdefs
rule294 = \ ((_lhsIforcedIrrefutables) :: AttrMap) ->
_lhsIforcedIrrefutables
rule295 = \ ((_lhsInt) :: NontermIdent) ->
_lhsInt
rule296 = \ ((_lhsIoptions) :: Options) ->
_lhsIoptions
rule297 = \ ((_lhsIchildInhs) :: [(Identifier, Identifier)]) ->
_lhsIchildInhs
rule298 = \ ((_lhsIchildSyns) :: [(Identifier, Identifier)]) ->
_lhsIchildSyns
rule299 = \ ((_lhsIcon) :: ConstructorIdent) ->
_lhsIcon
rule300 = \ ((_lhsIdefs) :: Set (Identifier, Identifier)) ->
_lhsIdefs
rule301 = \ ((_lhsIforcedIrrefutables) :: AttrMap) ->
_lhsIforcedIrrefutables
rule302 = \ ((_lhsInt) :: NontermIdent) ->
_lhsInt
rule303 = \ ((_lhsIoptions) :: Options) ->
_lhsIoptions
sem_Rules_Nil :: T_Rules
sem_Rules_Nil = T_Rules (return st44) where
!st44 = let
v43 :: T_Rules_v43
v43 = \ !(T_Rules_vIn43 _lhsIchildInhs _lhsIchildSyns _lhsIcon _lhsIdefs _lhsIforcedIrrefutables _lhsInt _lhsIoptions) -> ( let
_lhsOallAttributes :: AttrMap
_lhsOallAttributes = rule304 ()
_lhsOdefsCollect :: Set (Identifier, Identifier)
_lhsOdefsCollect = rule305 ()
_lhsOerrors :: Seq Error
_lhsOerrors = rule306 ()
_output = rule307 ()
_lhsOoutput :: Rules
_lhsOoutput = rule308 _output
!__result_ = T_Rules_vOut43 _lhsOallAttributes _lhsOdefsCollect _lhsOerrors _lhsOoutput
in __result_ )
in C_Rules_s44 v43
rule304 = \ (_ :: ()) ->
Map.empty
rule305 = \ (_ :: ()) ->
Set.empty
rule306 = \ (_ :: ()) ->
Seq.empty
rule307 = \ (_ :: ()) ->
[]
rule308 = \ _output ->
_output
data Inh_TypeSig = Inh_TypeSig { }
data Syn_TypeSig = Syn_TypeSig { output_Syn_TypeSig :: !(TypeSig) }
wrap_TypeSig :: T_TypeSig -> Inh_TypeSig -> (Syn_TypeSig )
wrap_TypeSig !(T_TypeSig act) !(Inh_TypeSig ) =
Control.Monad.Identity.runIdentity (
do !sem <- act
let arg = T_TypeSig_vIn46
!(T_TypeSig_vOut46 _lhsOoutput) <- return (inv_TypeSig_s47 sem arg)
return (Syn_TypeSig _lhsOoutput)
)
sem_TypeSig :: TypeSig -> T_TypeSig
sem_TypeSig ( TypeSig !name_ !tp_ ) = sem_TypeSig_TypeSig name_ tp_
newtype T_TypeSig = T_TypeSig {
attach_T_TypeSig :: Identity (T_TypeSig_s47 )
}
newtype T_TypeSig_s47 = C_TypeSig_s47 {
inv_TypeSig_s47 :: (T_TypeSig_v46 )
}
data T_TypeSig_s48 = C_TypeSig_s48
type T_TypeSig_v46 = (T_TypeSig_vIn46 ) -> (T_TypeSig_vOut46 )
data T_TypeSig_vIn46 = T_TypeSig_vIn46
data T_TypeSig_vOut46 = T_TypeSig_vOut46 (TypeSig)
sem_TypeSig_TypeSig :: (Identifier) -> (Type) -> T_TypeSig
sem_TypeSig_TypeSig !arg_name_ !arg_tp_ = T_TypeSig (return st47) where
!st47 = let
v46 :: T_TypeSig_v46
v46 = \ !(T_TypeSig_vIn46 ) -> ( let
_output = rule309 arg_name_ arg_tp_
_lhsOoutput :: TypeSig
_lhsOoutput = rule310 _output
!__result_ = T_TypeSig_vOut46 _lhsOoutput
in __result_ )
in C_TypeSig_s47 v46
rule309 = \ name_ tp_ ->
TypeSig name_ tp_
rule310 = \ _output ->
_output
data Inh_TypeSigs = Inh_TypeSigs { }
data Syn_TypeSigs = Syn_TypeSigs { output_Syn_TypeSigs :: !(TypeSigs) }
wrap_TypeSigs :: T_TypeSigs -> Inh_TypeSigs -> (Syn_TypeSigs )
wrap_TypeSigs !(T_TypeSigs act) !(Inh_TypeSigs ) =
Control.Monad.Identity.runIdentity (
do !sem <- act
let arg = T_TypeSigs_vIn49
!(T_TypeSigs_vOut49 _lhsOoutput) <- return (inv_TypeSigs_s50 sem arg)
return (Syn_TypeSigs _lhsOoutput)
)
sem_TypeSigs :: TypeSigs -> T_TypeSigs
sem_TypeSigs list = Prelude.foldr sem_TypeSigs_Cons sem_TypeSigs_Nil (Prelude.map sem_TypeSig list)
newtype T_TypeSigs = T_TypeSigs {
attach_T_TypeSigs :: Identity (T_TypeSigs_s50 )
}
newtype T_TypeSigs_s50 = C_TypeSigs_s50 {
inv_TypeSigs_s50 :: (T_TypeSigs_v49 )
}
data T_TypeSigs_s51 = C_TypeSigs_s51
type T_TypeSigs_v49 = (T_TypeSigs_vIn49 ) -> (T_TypeSigs_vOut49 )
data T_TypeSigs_vIn49 = T_TypeSigs_vIn49
data T_TypeSigs_vOut49 = T_TypeSigs_vOut49 (TypeSigs)
sem_TypeSigs_Cons :: T_TypeSig -> T_TypeSigs -> T_TypeSigs
sem_TypeSigs_Cons arg_hd_ arg_tl_ = T_TypeSigs (return st50) where
!st50 = let
v49 :: T_TypeSigs_v49
v49 = \ !(T_TypeSigs_vIn49 ) -> ( let
_hdX47 = Control.Monad.Identity.runIdentity (attach_T_TypeSig (arg_hd_))
_tlX50 = Control.Monad.Identity.runIdentity (attach_T_TypeSigs (arg_tl_))
(T_TypeSig_vOut46 _hdIoutput) = inv_TypeSig_s47 _hdX47 (T_TypeSig_vIn46 )
(T_TypeSigs_vOut49 _tlIoutput) = inv_TypeSigs_s50 _tlX50 (T_TypeSigs_vIn49 )
_output = rule311 _hdIoutput _tlIoutput
_lhsOoutput :: TypeSigs
_lhsOoutput = rule312 _output
!__result_ = T_TypeSigs_vOut49 _lhsOoutput
in __result_ )
in C_TypeSigs_s50 v49
rule311 = \ ((_hdIoutput) :: TypeSig) ((_tlIoutput) :: TypeSigs) ->
(:) _hdIoutput _tlIoutput
rule312 = \ _output ->
_output
sem_TypeSigs_Nil :: T_TypeSigs
sem_TypeSigs_Nil = T_TypeSigs (return st50) where
!st50 = let
v49 :: T_TypeSigs_v49
v49 = \ !(T_TypeSigs_vIn49 ) -> ( let
_output = rule313 ()
_lhsOoutput :: TypeSigs
_lhsOoutput = rule314 _output
!__result_ = T_TypeSigs_vOut49 _lhsOoutput
in __result_ )
in C_TypeSigs_s50 v49
rule313 = \ (_ :: ()) ->
[]
rule314 = \ _output ->
_output