module ResolveLocals 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 CommonTypes
import Patterns
import ErrorMessages
import AbstractSyntax
import Expression
import Options
import HsToken(HsTokensRoot(HsTokensRoot))
import HsTokenScanner(lexTokens)
import SemHsTokens(sem_HsTokensRoot,wrap_HsTokensRoot, Syn_HsTokensRoot(..),Inh_HsTokensRoot(..))
import Data.Maybe
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
sem_Child :: Child ->
T_Child
sem_Child (Child _name _tp _kind) =
(sem_Child_Child _name _tp _kind)
newtype T_Child = T_Child (([(Identifier,Type,ChildKind)]) ->
([Identifier]) ->
([(Identifier,Identifier)]) ->
Identifier ->
Attributes ->
(Map Identifier Attributes) ->
(Map Identifier (Identifier,[Identifier])) ->
Identifier ->
Attributes ->
(Map Identifier Attributes) ->
( ([(Identifier,Attributes,Attributes)]),((Identifier,Type,ChildKind)),Child))
data Inh_Child = Inh_Child {allfields_Inh_Child :: ([(Identifier,Type,ChildKind)]),allnts_Inh_Child :: ([Identifier]),attrs_Inh_Child :: ([(Identifier,Identifier)]),con_Inh_Child :: Identifier,inh_Inh_Child :: Attributes,inhMap_Inh_Child :: (Map Identifier Attributes),mergeMap_Inh_Child :: (Map Identifier (Identifier,[Identifier])),nt_Inh_Child :: Identifier,syn_Inh_Child :: Attributes,synMap_Inh_Child :: (Map Identifier Attributes)}
data Syn_Child = Syn_Child {attributes_Syn_Child :: ([(Identifier,Attributes,Attributes)]),field_Syn_Child :: ((Identifier,Type,ChildKind)),output_Syn_Child :: Child}
wrap_Child :: T_Child ->
Inh_Child ->
Syn_Child
wrap_Child (T_Child sem) (Inh_Child _lhsIallfields _lhsIallnts _lhsIattrs _lhsIcon _lhsIinh _lhsIinhMap _lhsImergeMap _lhsInt _lhsIsyn _lhsIsynMap) =
(let ( _lhsOattributes,_lhsOfield,_lhsOoutput) = sem _lhsIallfields _lhsIallnts _lhsIattrs _lhsIcon _lhsIinh _lhsIinhMap _lhsImergeMap _lhsInt _lhsIsyn _lhsIsynMap
in (Syn_Child _lhsOattributes _lhsOfield _lhsOoutput))
sem_Child_Child :: Identifier ->
Type ->
ChildKind ->
T_Child
sem_Child_Child name_ tp_ kind_ =
(T_Child (\ _lhsIallfields
_lhsIallnts
_lhsIattrs
_lhsIcon
_lhsIinh
_lhsIinhMap
_lhsImergeMap
_lhsInt
_lhsIsyn
_lhsIsynMap ->
(let _lhsOattributes :: ([(Identifier,Attributes,Attributes)])
_lhsOfield :: ((Identifier,Type,ChildKind))
_lhsOoutput :: Child
_lhsOattributes =
(
[(name_, _inh , _syn )]
)
_lhsOfield =
(
(name_, tp_, kind_)
)
_chnt =
(
case tp_ of
NT nt _ _ -> nt
Self -> error ("The type of child " ++ show name_ ++ " should not be a Self type.")
Haskell t -> identifier ""
)
_inh =
(
Map.findWithDefault Map.empty _chnt _lhsIinhMap
)
_syn =
(
Map.findWithDefault Map.empty _chnt _lhsIsynMap
)
_output =
(
Child name_ tp_ kind_
)
_lhsOoutput =
(
_output
)
___node =
(Syn_Child _lhsOattributes _lhsOfield _lhsOoutput)
in ( _lhsOattributes,_lhsOfield,_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 (([(Identifier,Type,ChildKind)]) ->
([Identifier]) ->
([(Identifier,Identifier)]) ->
Identifier ->
Attributes ->
(Map Identifier Attributes) ->
(Map Identifier (Identifier,[Identifier])) ->
Identifier ->
Attributes ->
(Map Identifier Attributes) ->
( ([(Identifier,Attributes,Attributes)]),([(Identifier,Type,ChildKind)]),Children))
data Inh_Children = Inh_Children {allfields_Inh_Children :: ([(Identifier,Type,ChildKind)]),allnts_Inh_Children :: ([Identifier]),attrs_Inh_Children :: ([(Identifier,Identifier)]),con_Inh_Children :: Identifier,inh_Inh_Children :: Attributes,inhMap_Inh_Children :: (Map Identifier Attributes),mergeMap_Inh_Children :: (Map Identifier (Identifier,[Identifier])),nt_Inh_Children :: Identifier,syn_Inh_Children :: Attributes,synMap_Inh_Children :: (Map Identifier Attributes)}
data Syn_Children = Syn_Children {attributes_Syn_Children :: ([(Identifier,Attributes,Attributes)]),fields_Syn_Children :: ([(Identifier,Type,ChildKind)]),output_Syn_Children :: Children}
wrap_Children :: T_Children ->
Inh_Children ->
Syn_Children
wrap_Children (T_Children sem) (Inh_Children _lhsIallfields _lhsIallnts _lhsIattrs _lhsIcon _lhsIinh _lhsIinhMap _lhsImergeMap _lhsInt _lhsIsyn _lhsIsynMap) =
(let ( _lhsOattributes,_lhsOfields,_lhsOoutput) = sem _lhsIallfields _lhsIallnts _lhsIattrs _lhsIcon _lhsIinh _lhsIinhMap _lhsImergeMap _lhsInt _lhsIsyn _lhsIsynMap
in (Syn_Children _lhsOattributes _lhsOfields _lhsOoutput))
sem_Children_Cons :: T_Child ->
T_Children ->
T_Children
sem_Children_Cons (T_Child hd_) (T_Children tl_) =
(T_Children (\ _lhsIallfields
_lhsIallnts
_lhsIattrs
_lhsIcon
_lhsIinh
_lhsIinhMap
_lhsImergeMap
_lhsInt
_lhsIsyn
_lhsIsynMap ->
(let _lhsOfields :: ([(Identifier,Type,ChildKind)])
_lhsOattributes :: ([(Identifier,Attributes,Attributes)])
_lhsOoutput :: Children
_hdOallfields :: ([(Identifier,Type,ChildKind)])
_hdOallnts :: ([Identifier])
_hdOattrs :: ([(Identifier,Identifier)])
_hdOcon :: Identifier
_hdOinh :: Attributes
_hdOinhMap :: (Map Identifier Attributes)
_hdOmergeMap :: (Map Identifier (Identifier,[Identifier]))
_hdOnt :: Identifier
_hdOsyn :: Attributes
_hdOsynMap :: (Map Identifier Attributes)
_tlOallfields :: ([(Identifier,Type,ChildKind)])
_tlOallnts :: ([Identifier])
_tlOattrs :: ([(Identifier,Identifier)])
_tlOcon :: Identifier
_tlOinh :: Attributes
_tlOinhMap :: (Map Identifier Attributes)
_tlOmergeMap :: (Map Identifier (Identifier,[Identifier]))
_tlOnt :: Identifier
_tlOsyn :: Attributes
_tlOsynMap :: (Map Identifier Attributes)
_hdIattributes :: ([(Identifier,Attributes,Attributes)])
_hdIfield :: ((Identifier,Type,ChildKind))
_hdIoutput :: Child
_tlIattributes :: ([(Identifier,Attributes,Attributes)])
_tlIfields :: ([(Identifier,Type,ChildKind)])
_tlIoutput :: Children
_lhsOfields =
(
_hdIfield : _tlIfields
)
_lhsOattributes =
(
_hdIattributes ++ _tlIattributes
)
_output =
(
(:) _hdIoutput _tlIoutput
)
_lhsOoutput =
(
_output
)
_hdOallfields =
(
_lhsIallfields
)
_hdOallnts =
(
_lhsIallnts
)
_hdOattrs =
(
_lhsIattrs
)
_hdOcon =
(
_lhsIcon
)
_hdOinh =
(
_lhsIinh
)
_hdOinhMap =
(
_lhsIinhMap
)
_hdOmergeMap =
(
_lhsImergeMap
)
_hdOnt =
(
_lhsInt
)
_hdOsyn =
(
_lhsIsyn
)
_hdOsynMap =
(
_lhsIsynMap
)
_tlOallfields =
(
_lhsIallfields
)
_tlOallnts =
(
_lhsIallnts
)
_tlOattrs =
(
_lhsIattrs
)
_tlOcon =
(
_lhsIcon
)
_tlOinh =
(
_lhsIinh
)
_tlOinhMap =
(
_lhsIinhMap
)
_tlOmergeMap =
(
_lhsImergeMap
)
_tlOnt =
(
_lhsInt
)
_tlOsyn =
(
_lhsIsyn
)
_tlOsynMap =
(
_lhsIsynMap
)
( _hdIattributes,_hdIfield,_hdIoutput) =
hd_ _hdOallfields _hdOallnts _hdOattrs _hdOcon _hdOinh _hdOinhMap _hdOmergeMap _hdOnt _hdOsyn _hdOsynMap
( _tlIattributes,_tlIfields,_tlIoutput) =
tl_ _tlOallfields _tlOallnts _tlOattrs _tlOcon _tlOinh _tlOinhMap _tlOmergeMap _tlOnt _tlOsyn _tlOsynMap
___node =
(Syn_Children _lhsOattributes _lhsOfields _lhsOoutput)
in ( _lhsOattributes,_lhsOfields,_lhsOoutput))))
sem_Children_Nil :: T_Children
sem_Children_Nil =
(T_Children (\ _lhsIallfields
_lhsIallnts
_lhsIattrs
_lhsIcon
_lhsIinh
_lhsIinhMap
_lhsImergeMap
_lhsInt
_lhsIsyn
_lhsIsynMap ->
(let _lhsOfields :: ([(Identifier,Type,ChildKind)])
_lhsOattributes :: ([(Identifier,Attributes,Attributes)])
_lhsOoutput :: Children
_lhsOfields =
(
[]
)
_lhsOattributes =
(
[]
)
_output =
(
[]
)
_lhsOoutput =
(
_output
)
___node =
(Syn_Children _lhsOattributes _lhsOfields _lhsOoutput)
in ( _lhsOattributes,_lhsOfields,_lhsOoutput))))
sem_Expression :: Expression ->
T_Expression
sem_Expression (Expression _pos _tks) =
(sem_Expression_Expression _pos _tks)
newtype T_Expression = T_Expression (([(Identifier,Type,ChildKind)]) ->
([Identifier]) ->
([(Identifier,Identifier)]) ->
Identifier ->
(Map Identifier (Identifier,[Identifier])) ->
Identifier ->
Options ->
( (Seq Error),Expression))
data Inh_Expression = Inh_Expression {allfields_Inh_Expression :: ([(Identifier,Type,ChildKind)]),allnts_Inh_Expression :: ([Identifier]),attrs_Inh_Expression :: ([(Identifier,Identifier)]),con_Inh_Expression :: Identifier,mergeMap_Inh_Expression :: (Map Identifier (Identifier,[Identifier])),nt_Inh_Expression :: Identifier,options_Inh_Expression :: Options}
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 sem) (Inh_Expression _lhsIallfields _lhsIallnts _lhsIattrs _lhsIcon _lhsImergeMap _lhsInt _lhsIoptions) =
(let ( _lhsOerrors,_lhsOoutput) = sem _lhsIallfields _lhsIallnts _lhsIattrs _lhsIcon _lhsImergeMap _lhsInt _lhsIoptions
in (Syn_Expression _lhsOerrors _lhsOoutput))
sem_Expression_Expression :: Pos ->
([HsToken]) ->
T_Expression
sem_Expression_Expression pos_ tks_ =
(T_Expression (\ _lhsIallfields
_lhsIallnts
_lhsIattrs
_lhsIcon
_lhsImergeMap
_lhsInt
_lhsIoptions ->
(let _lhsOoutput :: Expression
_lhsOerrors :: (Seq Error)
(_errors,_newTks) =
(
let mergedChildren = [ x | (_,xs) <- Map.elems _lhsImergeMap, x <- xs ]
attrsIn = filter (\(fld,_) -> not (fld `elem` mergedChildren)) _lhsIattrs
inherited = Inh_HsTokensRoot
{ attrs_Inh_HsTokensRoot = attrsIn
, con_Inh_HsTokensRoot = _lhsIcon
, allfields_Inh_HsTokensRoot = _lhsIallfields
, allnts_Inh_HsTokensRoot = _lhsIallnts
, nt_Inh_HsTokensRoot = _lhsInt
}
synthesized = wrap_HsTokensRoot (sem_HsTokensRoot (HsTokensRoot tks_)) inherited
in (errors_Syn_HsTokensRoot synthesized, output_Syn_HsTokensRoot synthesized)
)
_lhsOoutput =
(
Expression pos_ _newTks
)
_lhsOerrors =
(
_errors
)
_output =
(
Expression pos_ tks_
)
___node =
(Syn_Expression _lhsOerrors _lhsOoutput)
in ( _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 (Options ->
( (Seq Error),Grammar))
data Inh_Grammar = Inh_Grammar {options_Inh_Grammar :: Options}
data Syn_Grammar = Syn_Grammar {errors_Syn_Grammar :: (Seq Error),output_Syn_Grammar :: Grammar}
wrap_Grammar :: T_Grammar ->
Inh_Grammar ->
Syn_Grammar
wrap_Grammar (T_Grammar sem) (Inh_Grammar _lhsIoptions) =
(let ( _lhsOerrors,_lhsOoutput) = sem _lhsIoptions
in (Syn_Grammar _lhsOerrors _lhsOoutput))
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 typeSyns_ useMap_ derivings_ wrappers_ (T_Nonterminals nonts_) pragmas_ manualAttrOrderMap_ paramMap_ contextMap_ quantMap_ uniqueMap_ augmentsMap_ aroundsMap_ mergeMap_ =
(T_Grammar (\ _lhsIoptions ->
(let _nontsOallnts :: ([Identifier])
_nontsOmergeMap :: (Map NontermIdent (Map ConstructorIdent (Map Identifier (Identifier,[Identifier]))))
_nontsOinhMap :: (Map Identifier Attributes)
_nontsOsynMap :: (Map Identifier Attributes)
_lhsOerrors :: (Seq Error)
_lhsOoutput :: Grammar
_nontsOoptions :: Options
_nontsIerrors :: (Seq Error)
_nontsIinhMap' :: (Map Identifier Attributes)
_nontsInonts :: ([(NontermIdent,[ConstructorIdent])])
_nontsIoutput :: Nonterminals
_nontsIsynMap' :: (Map Identifier Attributes)
_nontsOallnts =
(
map fst (_nontsInonts)
)
_nontsOmergeMap =
(
Map.map (Map.map (Map.map (\(nt,srcs,_) -> (nt,srcs)))) mergeMap_
)
_nontsOinhMap =
(
_nontsIinhMap'
)
_nontsOsynMap =
(
_nontsIsynMap'
)
_lhsOerrors =
(
_nontsIerrors
)
_output =
(
Grammar typeSyns_ useMap_ derivings_ wrappers_ _nontsIoutput pragmas_ manualAttrOrderMap_ paramMap_ contextMap_ quantMap_ uniqueMap_ augmentsMap_ aroundsMap_ mergeMap_
)
_lhsOoutput =
(
_output
)
_nontsOoptions =
(
_lhsIoptions
)
( _nontsIerrors,_nontsIinhMap',_nontsInonts,_nontsIoutput,_nontsIsynMap') =
nonts_ _nontsOallnts _nontsOinhMap _nontsOmergeMap _nontsOoptions _nontsOsynMap
___node =
(Syn_Grammar _lhsOerrors _lhsOoutput)
in ( _lhsOerrors,_lhsOoutput))))
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 (([Identifier]) ->
(Map Identifier Attributes) ->
(Map NontermIdent (Map ConstructorIdent (Map Identifier (Identifier,[Identifier])))) ->
Options ->
(Map Identifier Attributes) ->
( (Seq Error),(Map Identifier Attributes),([(NontermIdent,[ConstructorIdent])]),Nonterminal,(Map Identifier Attributes)))
data Inh_Nonterminal = Inh_Nonterminal {allnts_Inh_Nonterminal :: ([Identifier]),inhMap_Inh_Nonterminal :: (Map Identifier Attributes),mergeMap_Inh_Nonterminal :: (Map NontermIdent (Map ConstructorIdent (Map Identifier (Identifier,[Identifier])))),options_Inh_Nonterminal :: Options,synMap_Inh_Nonterminal :: (Map Identifier Attributes)}
data Syn_Nonterminal = Syn_Nonterminal {errors_Syn_Nonterminal :: (Seq Error),inhMap'_Syn_Nonterminal :: (Map Identifier Attributes),nonts_Syn_Nonterminal :: ([(NontermIdent,[ConstructorIdent])]),output_Syn_Nonterminal :: Nonterminal,synMap'_Syn_Nonterminal :: (Map Identifier Attributes)}
wrap_Nonterminal :: T_Nonterminal ->
Inh_Nonterminal ->
Syn_Nonterminal
wrap_Nonterminal (T_Nonterminal sem) (Inh_Nonterminal _lhsIallnts _lhsIinhMap _lhsImergeMap _lhsIoptions _lhsIsynMap) =
(let ( _lhsOerrors,_lhsOinhMap',_lhsOnonts,_lhsOoutput,_lhsOsynMap') = sem _lhsIallnts _lhsIinhMap _lhsImergeMap _lhsIoptions _lhsIsynMap
in (Syn_Nonterminal _lhsOerrors _lhsOinhMap' _lhsOnonts _lhsOoutput _lhsOsynMap'))
sem_Nonterminal_Nonterminal :: NontermIdent ->
([Identifier]) ->
Attributes ->
Attributes ->
T_Productions ->
T_Nonterminal
sem_Nonterminal_Nonterminal nt_ params_ inh_ syn_ (T_Productions prods_) =
(T_Nonterminal (\ _lhsIallnts
_lhsIinhMap
_lhsImergeMap
_lhsIoptions
_lhsIsynMap ->
(let _lhsOnonts :: ([(NontermIdent,[ConstructorIdent])])
_prodsOnt :: Identifier
_prodsOinh :: Attributes
_prodsOsyn :: Attributes
_lhsOinhMap' :: (Map Identifier Attributes)
_lhsOsynMap' :: (Map Identifier Attributes)
_lhsOerrors :: (Seq Error)
_lhsOoutput :: Nonterminal
_prodsOallnts :: ([Identifier])
_prodsOinhMap :: (Map Identifier Attributes)
_prodsOmergeMap :: (Map ConstructorIdent (Map Identifier (Identifier,[Identifier])))
_prodsOoptions :: Options
_prodsOsynMap :: (Map Identifier Attributes)
_prodsIcons :: ([ConstructorIdent])
_prodsIerrors :: (Seq Error)
_prodsIoutput :: Productions
_lhsOnonts =
(
[(nt_,_prodsIcons)]
)
_prodsOnt =
(
nt_
)
_prodsOinh =
(
inh_
)
_prodsOsyn =
(
syn_
)
_mergeMap =
(
Map.findWithDefault Map.empty nt_ _lhsImergeMap
)
_lhsOinhMap' =
(
Map.singleton nt_ inh_
)
_lhsOsynMap' =
(
Map.singleton nt_ syn_
)
_lhsOerrors =
(
_prodsIerrors
)
_output =
(
Nonterminal nt_ params_ inh_ syn_ _prodsIoutput
)
_lhsOoutput =
(
_output
)
_prodsOallnts =
(
_lhsIallnts
)
_prodsOinhMap =
(
_lhsIinhMap
)
_prodsOmergeMap =
(
_mergeMap
)
_prodsOoptions =
(
_lhsIoptions
)
_prodsOsynMap =
(
_lhsIsynMap
)
( _prodsIcons,_prodsIerrors,_prodsIoutput) =
prods_ _prodsOallnts _prodsOinh _prodsOinhMap _prodsOmergeMap _prodsOnt _prodsOoptions _prodsOsyn _prodsOsynMap
___node =
(Syn_Nonterminal _lhsOerrors _lhsOinhMap' _lhsOnonts _lhsOoutput _lhsOsynMap')
in ( _lhsOerrors,_lhsOinhMap',_lhsOnonts,_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 (([Identifier]) ->
(Map Identifier Attributes) ->
(Map NontermIdent (Map ConstructorIdent (Map Identifier (Identifier,[Identifier])))) ->
Options ->
(Map Identifier Attributes) ->
( (Seq Error),(Map Identifier Attributes),([(NontermIdent,[ConstructorIdent])]),Nonterminals,(Map Identifier Attributes)))
data Inh_Nonterminals = Inh_Nonterminals {allnts_Inh_Nonterminals :: ([Identifier]),inhMap_Inh_Nonterminals :: (Map Identifier Attributes),mergeMap_Inh_Nonterminals :: (Map NontermIdent (Map ConstructorIdent (Map Identifier (Identifier,[Identifier])))),options_Inh_Nonterminals :: Options,synMap_Inh_Nonterminals :: (Map Identifier Attributes)}
data Syn_Nonterminals = Syn_Nonterminals {errors_Syn_Nonterminals :: (Seq Error),inhMap'_Syn_Nonterminals :: (Map Identifier Attributes),nonts_Syn_Nonterminals :: ([(NontermIdent,[ConstructorIdent])]),output_Syn_Nonterminals :: Nonterminals,synMap'_Syn_Nonterminals :: (Map Identifier Attributes)}
wrap_Nonterminals :: T_Nonterminals ->
Inh_Nonterminals ->
Syn_Nonterminals
wrap_Nonterminals (T_Nonterminals sem) (Inh_Nonterminals _lhsIallnts _lhsIinhMap _lhsImergeMap _lhsIoptions _lhsIsynMap) =
(let ( _lhsOerrors,_lhsOinhMap',_lhsOnonts,_lhsOoutput,_lhsOsynMap') = sem _lhsIallnts _lhsIinhMap _lhsImergeMap _lhsIoptions _lhsIsynMap
in (Syn_Nonterminals _lhsOerrors _lhsOinhMap' _lhsOnonts _lhsOoutput _lhsOsynMap'))
sem_Nonterminals_Cons :: T_Nonterminal ->
T_Nonterminals ->
T_Nonterminals
sem_Nonterminals_Cons (T_Nonterminal hd_) (T_Nonterminals tl_) =
(T_Nonterminals (\ _lhsIallnts
_lhsIinhMap
_lhsImergeMap
_lhsIoptions
_lhsIsynMap ->
(let _lhsOerrors :: (Seq Error)
_lhsOinhMap' :: (Map Identifier Attributes)
_lhsOnonts :: ([(NontermIdent,[ConstructorIdent])])
_lhsOsynMap' :: (Map Identifier Attributes)
_lhsOoutput :: Nonterminals
_hdOallnts :: ([Identifier])
_hdOinhMap :: (Map Identifier Attributes)
_hdOmergeMap :: (Map NontermIdent (Map ConstructorIdent (Map Identifier (Identifier,[Identifier]))))
_hdOoptions :: Options
_hdOsynMap :: (Map Identifier Attributes)
_tlOallnts :: ([Identifier])
_tlOinhMap :: (Map Identifier Attributes)
_tlOmergeMap :: (Map NontermIdent (Map ConstructorIdent (Map Identifier (Identifier,[Identifier]))))
_tlOoptions :: Options
_tlOsynMap :: (Map Identifier Attributes)
_hdIerrors :: (Seq Error)
_hdIinhMap' :: (Map Identifier Attributes)
_hdInonts :: ([(NontermIdent,[ConstructorIdent])])
_hdIoutput :: Nonterminal
_hdIsynMap' :: (Map Identifier Attributes)
_tlIerrors :: (Seq Error)
_tlIinhMap' :: (Map Identifier Attributes)
_tlInonts :: ([(NontermIdent,[ConstructorIdent])])
_tlIoutput :: Nonterminals
_tlIsynMap' :: (Map Identifier Attributes)
_lhsOerrors =
(
_hdIerrors Seq.>< _tlIerrors
)
_lhsOinhMap' =
(
_hdIinhMap' `Map.union` _tlIinhMap'
)
_lhsOnonts =
(
_hdInonts ++ _tlInonts
)
_lhsOsynMap' =
(
_hdIsynMap' `Map.union` _tlIsynMap'
)
_output =
(
(:) _hdIoutput _tlIoutput
)
_lhsOoutput =
(
_output
)
_hdOallnts =
(
_lhsIallnts
)
_hdOinhMap =
(
_lhsIinhMap
)
_hdOmergeMap =
(
_lhsImergeMap
)
_hdOoptions =
(
_lhsIoptions
)
_hdOsynMap =
(
_lhsIsynMap
)
_tlOallnts =
(
_lhsIallnts
)
_tlOinhMap =
(
_lhsIinhMap
)
_tlOmergeMap =
(
_lhsImergeMap
)
_tlOoptions =
(
_lhsIoptions
)
_tlOsynMap =
(
_lhsIsynMap
)
( _hdIerrors,_hdIinhMap',_hdInonts,_hdIoutput,_hdIsynMap') =
hd_ _hdOallnts _hdOinhMap _hdOmergeMap _hdOoptions _hdOsynMap
( _tlIerrors,_tlIinhMap',_tlInonts,_tlIoutput,_tlIsynMap') =
tl_ _tlOallnts _tlOinhMap _tlOmergeMap _tlOoptions _tlOsynMap
___node =
(Syn_Nonterminals _lhsOerrors _lhsOinhMap' _lhsOnonts _lhsOoutput _lhsOsynMap')
in ( _lhsOerrors,_lhsOinhMap',_lhsOnonts,_lhsOoutput,_lhsOsynMap'))))
sem_Nonterminals_Nil :: T_Nonterminals
sem_Nonterminals_Nil =
(T_Nonterminals (\ _lhsIallnts
_lhsIinhMap
_lhsImergeMap
_lhsIoptions
_lhsIsynMap ->
(let _lhsOerrors :: (Seq Error)
_lhsOinhMap' :: (Map Identifier Attributes)
_lhsOnonts :: ([(NontermIdent,[ConstructorIdent])])
_lhsOsynMap' :: (Map Identifier Attributes)
_lhsOoutput :: Nonterminals
_lhsOerrors =
(
Seq.empty
)
_lhsOinhMap' =
(
Map.empty
)
_lhsOnonts =
(
[]
)
_lhsOsynMap' =
(
Map.empty
)
_output =
(
[]
)
_lhsOoutput =
(
_output
)
___node =
(Syn_Nonterminals _lhsOerrors _lhsOinhMap' _lhsOnonts _lhsOoutput _lhsOsynMap')
in ( _lhsOerrors,_lhsOinhMap',_lhsOnonts,_lhsOoutput,_lhsOsynMap'))))
sem_Pattern :: Pattern ->
T_Pattern
sem_Pattern (Alias _field _attr _pat) =
(sem_Pattern_Alias _field _attr (sem_Pattern _pat))
sem_Pattern (Constr _name _pats) =
(sem_Pattern_Constr _name (sem_Patterns _pats))
sem_Pattern (Irrefutable _pat) =
(sem_Pattern_Irrefutable (sem_Pattern _pat))
sem_Pattern (Product _pos _pats) =
(sem_Pattern_Product _pos (sem_Patterns _pats))
sem_Pattern (Underscore _pos) =
(sem_Pattern_Underscore _pos)
newtype T_Pattern = T_Pattern (Identifier ->
Attributes ->
Identifier ->
Attributes ->
( Pattern,(Seq Error),([Identifier]),([Identifier]),Pattern))
data Inh_Pattern = Inh_Pattern {con_Inh_Pattern :: Identifier,inh_Inh_Pattern :: Attributes,nt_Inh_Pattern :: Identifier,syn_Inh_Pattern :: Attributes}
data Syn_Pattern = Syn_Pattern {copy_Syn_Pattern :: Pattern,errors_Syn_Pattern :: (Seq Error),instVars_Syn_Pattern :: ([Identifier]),locVars_Syn_Pattern :: ([Identifier]),output_Syn_Pattern :: Pattern}
wrap_Pattern :: T_Pattern ->
Inh_Pattern ->
Syn_Pattern
wrap_Pattern (T_Pattern sem) (Inh_Pattern _lhsIcon _lhsIinh _lhsInt _lhsIsyn) =
(let ( _lhsOcopy,_lhsOerrors,_lhsOinstVars,_lhsOlocVars,_lhsOoutput) = sem _lhsIcon _lhsIinh _lhsInt _lhsIsyn
in (Syn_Pattern _lhsOcopy _lhsOerrors _lhsOinstVars _lhsOlocVars _lhsOoutput))
sem_Pattern_Alias :: Identifier ->
Identifier ->
T_Pattern ->
T_Pattern
sem_Pattern_Alias field_ attr_ (T_Pattern pat_) =
(T_Pattern (\ _lhsIcon
_lhsIinh
_lhsInt
_lhsIsyn ->
(let _lhsOlocVars :: ([Identifier])
_lhsOinstVars :: ([Identifier])
_lhsOerrors :: (Seq Error)
_lhsOcopy :: Pattern
_lhsOoutput :: Pattern
_patOcon :: Identifier
_patOinh :: Attributes
_patOnt :: Identifier
_patOsyn :: Attributes
_patIcopy :: Pattern
_patIerrors :: (Seq Error)
_patIinstVars :: ([Identifier])
_patIlocVars :: ([Identifier])
_patIoutput :: Pattern
_lhsOlocVars =
(
if field_ == _LOC
then [attr_]
else []
)
_lhsOinstVars =
(
if field_ == _INST
then [attr_]
else []
)
_lhsOerrors =
(
_patIerrors
)
_copy =
(
Alias field_ attr_ _patIcopy
)
_output =
(
Alias field_ attr_ _patIoutput
)
_lhsOcopy =
(
_copy
)
_lhsOoutput =
(
_output
)
_patOcon =
(
_lhsIcon
)
_patOinh =
(
_lhsIinh
)
_patOnt =
(
_lhsInt
)
_patOsyn =
(
_lhsIsyn
)
( _patIcopy,_patIerrors,_patIinstVars,_patIlocVars,_patIoutput) =
pat_ _patOcon _patOinh _patOnt _patOsyn
___node =
(Syn_Pattern _lhsOcopy _lhsOerrors _lhsOinstVars _lhsOlocVars _lhsOoutput)
in ( _lhsOcopy,_lhsOerrors,_lhsOinstVars,_lhsOlocVars,_lhsOoutput))))
sem_Pattern_Constr :: ConstructorIdent ->
T_Patterns ->
T_Pattern
sem_Pattern_Constr name_ (T_Patterns pats_) =
(T_Pattern (\ _lhsIcon
_lhsIinh
_lhsInt
_lhsIsyn ->
(let _lhsOerrors :: (Seq Error)
_lhsOinstVars :: ([Identifier])
_lhsOlocVars :: ([Identifier])
_lhsOcopy :: Pattern
_lhsOoutput :: Pattern
_patsOcon :: Identifier
_patsOinh :: Attributes
_patsOnt :: Identifier
_patsOsyn :: Attributes
_patsIcopy :: Patterns
_patsIerrors :: (Seq Error)
_patsIinstVars :: ([Identifier])
_patsIlocVars :: ([Identifier])
_patsIoutput :: Patterns
_lhsOerrors =
(
_patsIerrors
)
_lhsOinstVars =
(
_patsIinstVars
)
_lhsOlocVars =
(
_patsIlocVars
)
_copy =
(
Constr name_ _patsIcopy
)
_output =
(
Constr name_ _patsIoutput
)
_lhsOcopy =
(
_copy
)
_lhsOoutput =
(
_output
)
_patsOcon =
(
_lhsIcon
)
_patsOinh =
(
_lhsIinh
)
_patsOnt =
(
_lhsInt
)
_patsOsyn =
(
_lhsIsyn
)
( _patsIcopy,_patsIerrors,_patsIinstVars,_patsIlocVars,_patsIoutput) =
pats_ _patsOcon _patsOinh _patsOnt _patsOsyn
___node =
(Syn_Pattern _lhsOcopy _lhsOerrors _lhsOinstVars _lhsOlocVars _lhsOoutput)
in ( _lhsOcopy,_lhsOerrors,_lhsOinstVars,_lhsOlocVars,_lhsOoutput))))
sem_Pattern_Irrefutable :: T_Pattern ->
T_Pattern
sem_Pattern_Irrefutable (T_Pattern pat_) =
(T_Pattern (\ _lhsIcon
_lhsIinh
_lhsInt
_lhsIsyn ->
(let _lhsOerrors :: (Seq Error)
_lhsOinstVars :: ([Identifier])
_lhsOlocVars :: ([Identifier])
_lhsOcopy :: Pattern
_lhsOoutput :: Pattern
_patOcon :: Identifier
_patOinh :: Attributes
_patOnt :: Identifier
_patOsyn :: Attributes
_patIcopy :: Pattern
_patIerrors :: (Seq Error)
_patIinstVars :: ([Identifier])
_patIlocVars :: ([Identifier])
_patIoutput :: Pattern
_lhsOerrors =
(
_patIerrors
)
_lhsOinstVars =
(
_patIinstVars
)
_lhsOlocVars =
(
_patIlocVars
)
_copy =
(
Irrefutable _patIcopy
)
_output =
(
Irrefutable _patIoutput
)
_lhsOcopy =
(
_copy
)
_lhsOoutput =
(
_output
)
_patOcon =
(
_lhsIcon
)
_patOinh =
(
_lhsIinh
)
_patOnt =
(
_lhsInt
)
_patOsyn =
(
_lhsIsyn
)
( _patIcopy,_patIerrors,_patIinstVars,_patIlocVars,_patIoutput) =
pat_ _patOcon _patOinh _patOnt _patOsyn
___node =
(Syn_Pattern _lhsOcopy _lhsOerrors _lhsOinstVars _lhsOlocVars _lhsOoutput)
in ( _lhsOcopy,_lhsOerrors,_lhsOinstVars,_lhsOlocVars,_lhsOoutput))))
sem_Pattern_Product :: Pos ->
T_Patterns ->
T_Pattern
sem_Pattern_Product pos_ (T_Patterns pats_) =
(T_Pattern (\ _lhsIcon
_lhsIinh
_lhsInt
_lhsIsyn ->
(let _lhsOerrors :: (Seq Error)
_lhsOinstVars :: ([Identifier])
_lhsOlocVars :: ([Identifier])
_lhsOcopy :: Pattern
_lhsOoutput :: Pattern
_patsOcon :: Identifier
_patsOinh :: Attributes
_patsOnt :: Identifier
_patsOsyn :: Attributes
_patsIcopy :: Patterns
_patsIerrors :: (Seq Error)
_patsIinstVars :: ([Identifier])
_patsIlocVars :: ([Identifier])
_patsIoutput :: Patterns
_lhsOerrors =
(
_patsIerrors
)
_lhsOinstVars =
(
_patsIinstVars
)
_lhsOlocVars =
(
_patsIlocVars
)
_copy =
(
Product pos_ _patsIcopy
)
_output =
(
Product pos_ _patsIoutput
)
_lhsOcopy =
(
_copy
)
_lhsOoutput =
(
_output
)
_patsOcon =
(
_lhsIcon
)
_patsOinh =
(
_lhsIinh
)
_patsOnt =
(
_lhsInt
)
_patsOsyn =
(
_lhsIsyn
)
( _patsIcopy,_patsIerrors,_patsIinstVars,_patsIlocVars,_patsIoutput) =
pats_ _patsOcon _patsOinh _patsOnt _patsOsyn
___node =
(Syn_Pattern _lhsOcopy _lhsOerrors _lhsOinstVars _lhsOlocVars _lhsOoutput)
in ( _lhsOcopy,_lhsOerrors,_lhsOinstVars,_lhsOlocVars,_lhsOoutput))))
sem_Pattern_Underscore :: Pos ->
T_Pattern
sem_Pattern_Underscore pos_ =
(T_Pattern (\ _lhsIcon
_lhsIinh
_lhsInt
_lhsIsyn ->
(let _lhsOerrors :: (Seq Error)
_lhsOinstVars :: ([Identifier])
_lhsOlocVars :: ([Identifier])
_lhsOcopy :: Pattern
_lhsOoutput :: Pattern
_lhsOerrors =
(
Seq.empty
)
_lhsOinstVars =
(
[]
)
_lhsOlocVars =
(
[]
)
_copy =
(
Underscore pos_
)
_output =
(
Underscore pos_
)
_lhsOcopy =
(
_copy
)
_lhsOoutput =
(
_output
)
___node =
(Syn_Pattern _lhsOcopy _lhsOerrors _lhsOinstVars _lhsOlocVars _lhsOoutput)
in ( _lhsOcopy,_lhsOerrors,_lhsOinstVars,_lhsOlocVars,_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 (Identifier ->
Attributes ->
Identifier ->
Attributes ->
( Patterns,(Seq Error),([Identifier]),([Identifier]),Patterns))
data Inh_Patterns = Inh_Patterns {con_Inh_Patterns :: Identifier,inh_Inh_Patterns :: Attributes,nt_Inh_Patterns :: Identifier,syn_Inh_Patterns :: Attributes}
data Syn_Patterns = Syn_Patterns {copy_Syn_Patterns :: Patterns,errors_Syn_Patterns :: (Seq Error),instVars_Syn_Patterns :: ([Identifier]),locVars_Syn_Patterns :: ([Identifier]),output_Syn_Patterns :: Patterns}
wrap_Patterns :: T_Patterns ->
Inh_Patterns ->
Syn_Patterns
wrap_Patterns (T_Patterns sem) (Inh_Patterns _lhsIcon _lhsIinh _lhsInt _lhsIsyn) =
(let ( _lhsOcopy,_lhsOerrors,_lhsOinstVars,_lhsOlocVars,_lhsOoutput) = sem _lhsIcon _lhsIinh _lhsInt _lhsIsyn
in (Syn_Patterns _lhsOcopy _lhsOerrors _lhsOinstVars _lhsOlocVars _lhsOoutput))
sem_Patterns_Cons :: T_Pattern ->
T_Patterns ->
T_Patterns
sem_Patterns_Cons (T_Pattern hd_) (T_Patterns tl_) =
(T_Patterns (\ _lhsIcon
_lhsIinh
_lhsInt
_lhsIsyn ->
(let _lhsOerrors :: (Seq Error)
_lhsOinstVars :: ([Identifier])
_lhsOlocVars :: ([Identifier])
_lhsOcopy :: Patterns
_lhsOoutput :: Patterns
_hdOcon :: Identifier
_hdOinh :: Attributes
_hdOnt :: Identifier
_hdOsyn :: Attributes
_tlOcon :: Identifier
_tlOinh :: Attributes
_tlOnt :: Identifier
_tlOsyn :: Attributes
_hdIcopy :: Pattern
_hdIerrors :: (Seq Error)
_hdIinstVars :: ([Identifier])
_hdIlocVars :: ([Identifier])
_hdIoutput :: Pattern
_tlIcopy :: Patterns
_tlIerrors :: (Seq Error)
_tlIinstVars :: ([Identifier])
_tlIlocVars :: ([Identifier])
_tlIoutput :: Patterns
_lhsOerrors =
(
_hdIerrors Seq.>< _tlIerrors
)
_lhsOinstVars =
(
_hdIinstVars ++ _tlIinstVars
)
_lhsOlocVars =
(
_hdIlocVars ++ _tlIlocVars
)
_copy =
(
(:) _hdIcopy _tlIcopy
)
_output =
(
(:) _hdIoutput _tlIoutput
)
_lhsOcopy =
(
_copy
)
_lhsOoutput =
(
_output
)
_hdOcon =
(
_lhsIcon
)
_hdOinh =
(
_lhsIinh
)
_hdOnt =
(
_lhsInt
)
_hdOsyn =
(
_lhsIsyn
)
_tlOcon =
(
_lhsIcon
)
_tlOinh =
(
_lhsIinh
)
_tlOnt =
(
_lhsInt
)
_tlOsyn =
(
_lhsIsyn
)
( _hdIcopy,_hdIerrors,_hdIinstVars,_hdIlocVars,_hdIoutput) =
hd_ _hdOcon _hdOinh _hdOnt _hdOsyn
( _tlIcopy,_tlIerrors,_tlIinstVars,_tlIlocVars,_tlIoutput) =
tl_ _tlOcon _tlOinh _tlOnt _tlOsyn
___node =
(Syn_Patterns _lhsOcopy _lhsOerrors _lhsOinstVars _lhsOlocVars _lhsOoutput)
in ( _lhsOcopy,_lhsOerrors,_lhsOinstVars,_lhsOlocVars,_lhsOoutput))))
sem_Patterns_Nil :: T_Patterns
sem_Patterns_Nil =
(T_Patterns (\ _lhsIcon
_lhsIinh
_lhsInt
_lhsIsyn ->
(let _lhsOerrors :: (Seq Error)
_lhsOinstVars :: ([Identifier])
_lhsOlocVars :: ([Identifier])
_lhsOcopy :: Patterns
_lhsOoutput :: Patterns
_lhsOerrors =
(
Seq.empty
)
_lhsOinstVars =
(
[]
)
_lhsOlocVars =
(
[]
)
_copy =
(
[]
)
_output =
(
[]
)
_lhsOcopy =
(
_copy
)
_lhsOoutput =
(
_output
)
___node =
(Syn_Patterns _lhsOcopy _lhsOerrors _lhsOinstVars _lhsOlocVars _lhsOoutput)
in ( _lhsOcopy,_lhsOerrors,_lhsOinstVars,_lhsOlocVars,_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 (([Identifier]) ->
Attributes ->
(Map Identifier Attributes) ->
(Map ConstructorIdent (Map Identifier (Identifier,[Identifier]))) ->
Identifier ->
Options ->
Attributes ->
(Map Identifier Attributes) ->
( ([ConstructorIdent]),(Seq Error),Production))
data Inh_Production = Inh_Production {allnts_Inh_Production :: ([Identifier]),inh_Inh_Production :: Attributes,inhMap_Inh_Production :: (Map Identifier Attributes),mergeMap_Inh_Production :: (Map ConstructorIdent (Map Identifier (Identifier,[Identifier]))),nt_Inh_Production :: Identifier,options_Inh_Production :: Options,syn_Inh_Production :: Attributes,synMap_Inh_Production :: (Map Identifier Attributes)}
data Syn_Production = Syn_Production {cons_Syn_Production :: ([ConstructorIdent]),errors_Syn_Production :: (Seq Error),output_Syn_Production :: Production}
wrap_Production :: T_Production ->
Inh_Production ->
Syn_Production
wrap_Production (T_Production sem) (Inh_Production _lhsIallnts _lhsIinh _lhsIinhMap _lhsImergeMap _lhsInt _lhsIoptions _lhsIsyn _lhsIsynMap) =
(let ( _lhsOcons,_lhsOerrors,_lhsOoutput) = sem _lhsIallnts _lhsIinh _lhsIinhMap _lhsImergeMap _lhsInt _lhsIoptions _lhsIsyn _lhsIsynMap
in (Syn_Production _lhsOcons _lhsOerrors _lhsOoutput))
sem_Production_Production :: ConstructorIdent ->
([Identifier]) ->
([Type]) ->
T_Children ->
T_Rules ->
T_TypeSigs ->
MaybeMacro ->
T_Production
sem_Production_Production con_ params_ constraints_ (T_Children children_) (T_Rules rules_) (T_TypeSigs typeSigs_) macro_ =
(T_Production (\ _lhsIallnts
_lhsIinh
_lhsIinhMap
_lhsImergeMap
_lhsInt
_lhsIoptions
_lhsIsyn
_lhsIsynMap ->
(let _lhsOcons :: ([ConstructorIdent])
_childrenOcon :: Identifier
_rulesOcon :: Identifier
_lhsOerrors :: (Seq Error)
_lhsOoutput :: Production
_childrenOallfields :: ([(Identifier,Type,ChildKind)])
_childrenOallnts :: ([Identifier])
_childrenOattrs :: ([(Identifier,Identifier)])
_childrenOinh :: Attributes
_childrenOinhMap :: (Map Identifier Attributes)
_childrenOmergeMap :: (Map Identifier (Identifier,[Identifier]))
_childrenOnt :: Identifier
_childrenOsyn :: Attributes
_childrenOsynMap :: (Map Identifier Attributes)
_rulesOallfields :: ([(Identifier,Type,ChildKind)])
_rulesOallnts :: ([Identifier])
_rulesOattrs :: ([(Identifier,Identifier)])
_rulesOinh :: Attributes
_rulesOmergeMap :: (Map Identifier (Identifier,[Identifier]))
_rulesOnt :: Identifier
_rulesOoptions :: Options
_rulesOsyn :: Attributes
_childrenIattributes :: ([(Identifier,Attributes,Attributes)])
_childrenIfields :: ([(Identifier,Type,ChildKind)])
_childrenIoutput :: Children
_rulesIerrors :: (Seq Error)
_rulesIinstVars :: ([Identifier])
_rulesIlocVars :: ([Identifier])
_rulesIoutput :: Rules
_typeSigsIoutput :: TypeSigs
_lhsOcons =
(
[con_]
)
_allfields =
(
_childrenIfields
)
_attrs =
(
map ((,) _LOC) _rulesIlocVars ++
map ((,) _INST) _rulesIinstVars ++
map ((,) _LHS) _inhnames ++
concat [map ((,) nm) (Map.keys as) | (nm,_,as) <- _childrenIattributes]
)
_inhnames =
(
Map.keys _lhsIinh
)
_synnames =
(
Map.keys _lhsIsyn
)
_childrenOcon =
(
con_
)
_rulesOcon =
(
con_
)
_mergeMap =
(
Map.findWithDefault Map.empty con_ _lhsImergeMap
)
_lhsOerrors =
(
_rulesIerrors
)
_output =
(
Production con_ params_ constraints_ _childrenIoutput _rulesIoutput _typeSigsIoutput macro_
)
_lhsOoutput =
(
_output
)
_childrenOallfields =
(
_allfields
)
_childrenOallnts =
(
_lhsIallnts
)
_childrenOattrs =
(
_attrs
)
_childrenOinh =
(
_lhsIinh
)
_childrenOinhMap =
(
_lhsIinhMap
)
_childrenOmergeMap =
(
_mergeMap
)
_childrenOnt =
(
_lhsInt
)
_childrenOsyn =
(
_lhsIsyn
)
_childrenOsynMap =
(
_lhsIsynMap
)
_rulesOallfields =
(
_allfields
)
_rulesOallnts =
(
_lhsIallnts
)
_rulesOattrs =
(
_attrs
)
_rulesOinh =
(
_lhsIinh
)
_rulesOmergeMap =
(
_mergeMap
)
_rulesOnt =
(
_lhsInt
)
_rulesOoptions =
(
_lhsIoptions
)
_rulesOsyn =
(
_lhsIsyn
)
( _childrenIattributes,_childrenIfields,_childrenIoutput) =
children_ _childrenOallfields _childrenOallnts _childrenOattrs _childrenOcon _childrenOinh _childrenOinhMap _childrenOmergeMap _childrenOnt _childrenOsyn _childrenOsynMap
( _rulesIerrors,_rulesIinstVars,_rulesIlocVars,_rulesIoutput) =
rules_ _rulesOallfields _rulesOallnts _rulesOattrs _rulesOcon _rulesOinh _rulesOmergeMap _rulesOnt _rulesOoptions _rulesOsyn
( _typeSigsIoutput) =
typeSigs_
___node =
(Syn_Production _lhsOcons _lhsOerrors _lhsOoutput)
in ( _lhsOcons,_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 (([Identifier]) ->
Attributes ->
(Map Identifier Attributes) ->
(Map ConstructorIdent (Map Identifier (Identifier,[Identifier]))) ->
Identifier ->
Options ->
Attributes ->
(Map Identifier Attributes) ->
( ([ConstructorIdent]),(Seq Error),Productions))
data Inh_Productions = Inh_Productions {allnts_Inh_Productions :: ([Identifier]),inh_Inh_Productions :: Attributes,inhMap_Inh_Productions :: (Map Identifier Attributes),mergeMap_Inh_Productions :: (Map ConstructorIdent (Map Identifier (Identifier,[Identifier]))),nt_Inh_Productions :: Identifier,options_Inh_Productions :: Options,syn_Inh_Productions :: Attributes,synMap_Inh_Productions :: (Map Identifier Attributes)}
data Syn_Productions = Syn_Productions {cons_Syn_Productions :: ([ConstructorIdent]),errors_Syn_Productions :: (Seq Error),output_Syn_Productions :: Productions}
wrap_Productions :: T_Productions ->
Inh_Productions ->
Syn_Productions
wrap_Productions (T_Productions sem) (Inh_Productions _lhsIallnts _lhsIinh _lhsIinhMap _lhsImergeMap _lhsInt _lhsIoptions _lhsIsyn _lhsIsynMap) =
(let ( _lhsOcons,_lhsOerrors,_lhsOoutput) = sem _lhsIallnts _lhsIinh _lhsIinhMap _lhsImergeMap _lhsInt _lhsIoptions _lhsIsyn _lhsIsynMap
in (Syn_Productions _lhsOcons _lhsOerrors _lhsOoutput))
sem_Productions_Cons :: T_Production ->
T_Productions ->
T_Productions
sem_Productions_Cons (T_Production hd_) (T_Productions tl_) =
(T_Productions (\ _lhsIallnts
_lhsIinh
_lhsIinhMap
_lhsImergeMap
_lhsInt
_lhsIoptions
_lhsIsyn
_lhsIsynMap ->
(let _lhsOcons :: ([ConstructorIdent])
_lhsOerrors :: (Seq Error)
_lhsOoutput :: Productions
_hdOallnts :: ([Identifier])
_hdOinh :: Attributes
_hdOinhMap :: (Map Identifier Attributes)
_hdOmergeMap :: (Map ConstructorIdent (Map Identifier (Identifier,[Identifier])))
_hdOnt :: Identifier
_hdOoptions :: Options
_hdOsyn :: Attributes
_hdOsynMap :: (Map Identifier Attributes)
_tlOallnts :: ([Identifier])
_tlOinh :: Attributes
_tlOinhMap :: (Map Identifier Attributes)
_tlOmergeMap :: (Map ConstructorIdent (Map Identifier (Identifier,[Identifier])))
_tlOnt :: Identifier
_tlOoptions :: Options
_tlOsyn :: Attributes
_tlOsynMap :: (Map Identifier Attributes)
_hdIcons :: ([ConstructorIdent])
_hdIerrors :: (Seq Error)
_hdIoutput :: Production
_tlIcons :: ([ConstructorIdent])
_tlIerrors :: (Seq Error)
_tlIoutput :: Productions
_lhsOcons =
(
_hdIcons ++ _tlIcons
)
_lhsOerrors =
(
_hdIerrors Seq.>< _tlIerrors
)
_output =
(
(:) _hdIoutput _tlIoutput
)
_lhsOoutput =
(
_output
)
_hdOallnts =
(
_lhsIallnts
)
_hdOinh =
(
_lhsIinh
)
_hdOinhMap =
(
_lhsIinhMap
)
_hdOmergeMap =
(
_lhsImergeMap
)
_hdOnt =
(
_lhsInt
)
_hdOoptions =
(
_lhsIoptions
)
_hdOsyn =
(
_lhsIsyn
)
_hdOsynMap =
(
_lhsIsynMap
)
_tlOallnts =
(
_lhsIallnts
)
_tlOinh =
(
_lhsIinh
)
_tlOinhMap =
(
_lhsIinhMap
)
_tlOmergeMap =
(
_lhsImergeMap
)
_tlOnt =
(
_lhsInt
)
_tlOoptions =
(
_lhsIoptions
)
_tlOsyn =
(
_lhsIsyn
)
_tlOsynMap =
(
_lhsIsynMap
)
( _hdIcons,_hdIerrors,_hdIoutput) =
hd_ _hdOallnts _hdOinh _hdOinhMap _hdOmergeMap _hdOnt _hdOoptions _hdOsyn _hdOsynMap
( _tlIcons,_tlIerrors,_tlIoutput) =
tl_ _tlOallnts _tlOinh _tlOinhMap _tlOmergeMap _tlOnt _tlOoptions _tlOsyn _tlOsynMap
___node =
(Syn_Productions _lhsOcons _lhsOerrors _lhsOoutput)
in ( _lhsOcons,_lhsOerrors,_lhsOoutput))))
sem_Productions_Nil :: T_Productions
sem_Productions_Nil =
(T_Productions (\ _lhsIallnts
_lhsIinh
_lhsIinhMap
_lhsImergeMap
_lhsInt
_lhsIoptions
_lhsIsyn
_lhsIsynMap ->
(let _lhsOcons :: ([ConstructorIdent])
_lhsOerrors :: (Seq Error)
_lhsOoutput :: Productions
_lhsOcons =
(
[]
)
_lhsOerrors =
(
Seq.empty
)
_output =
(
[]
)
_lhsOoutput =
(
_output
)
___node =
(Syn_Productions _lhsOcons _lhsOerrors _lhsOoutput)
in ( _lhsOcons,_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 (([(Identifier,Type,ChildKind)]) ->
([Identifier]) ->
([(Identifier,Identifier)]) ->
Identifier ->
Attributes ->
(Map Identifier (Identifier,[Identifier])) ->
Identifier ->
Options ->
Attributes ->
( (Seq Error),([Identifier]),([Identifier]),Rule))
data Inh_Rule = Inh_Rule {allfields_Inh_Rule :: ([(Identifier,Type,ChildKind)]),allnts_Inh_Rule :: ([Identifier]),attrs_Inh_Rule :: ([(Identifier,Identifier)]),con_Inh_Rule :: Identifier,inh_Inh_Rule :: Attributes,mergeMap_Inh_Rule :: (Map Identifier (Identifier,[Identifier])),nt_Inh_Rule :: Identifier,options_Inh_Rule :: Options,syn_Inh_Rule :: Attributes}
data Syn_Rule = Syn_Rule {errors_Syn_Rule :: (Seq Error),instVars_Syn_Rule :: ([Identifier]),locVars_Syn_Rule :: ([Identifier]),output_Syn_Rule :: Rule}
wrap_Rule :: T_Rule ->
Inh_Rule ->
Syn_Rule
wrap_Rule (T_Rule sem) (Inh_Rule _lhsIallfields _lhsIallnts _lhsIattrs _lhsIcon _lhsIinh _lhsImergeMap _lhsInt _lhsIoptions _lhsIsyn) =
(let ( _lhsOerrors,_lhsOinstVars,_lhsOlocVars,_lhsOoutput) = sem _lhsIallfields _lhsIallnts _lhsIattrs _lhsIcon _lhsIinh _lhsImergeMap _lhsInt _lhsIoptions _lhsIsyn
in (Syn_Rule _lhsOerrors _lhsOinstVars _lhsOlocVars _lhsOoutput))
sem_Rule_Rule :: (Maybe Identifier) ->
T_Pattern ->
T_Expression ->
Bool ->
String ->
Bool ->
Bool ->
Bool ->
(Maybe Error) ->
Bool ->
T_Rule
sem_Rule_Rule mbName_ (T_Pattern pattern_) (T_Expression rhs_) owrt_ origin_ explicit_ pure_ identity_ mbError_ eager_ =
(T_Rule (\ _lhsIallfields
_lhsIallnts
_lhsIattrs
_lhsIcon
_lhsIinh
_lhsImergeMap
_lhsInt
_lhsIoptions
_lhsIsyn ->
(let _lhsOerrors :: (Seq Error)
_lhsOinstVars :: ([Identifier])
_lhsOlocVars :: ([Identifier])
_lhsOoutput :: Rule
_patternOcon :: Identifier
_patternOinh :: Attributes
_patternOnt :: Identifier
_patternOsyn :: Attributes
_rhsOallfields :: ([(Identifier,Type,ChildKind)])
_rhsOallnts :: ([Identifier])
_rhsOattrs :: ([(Identifier,Identifier)])
_rhsOcon :: Identifier
_rhsOmergeMap :: (Map Identifier (Identifier,[Identifier]))
_rhsOnt :: Identifier
_rhsOoptions :: Options
_patternIcopy :: Pattern
_patternIerrors :: (Seq Error)
_patternIinstVars :: ([Identifier])
_patternIlocVars :: ([Identifier])
_patternIoutput :: Pattern
_rhsIerrors :: (Seq Error)
_rhsIoutput :: Expression
_lhsOerrors =
(
_patternIerrors Seq.>< _rhsIerrors
)
_lhsOinstVars =
(
_patternIinstVars
)
_lhsOlocVars =
(
_patternIlocVars
)
_output =
(
Rule mbName_ _patternIoutput _rhsIoutput owrt_ origin_ explicit_ pure_ identity_ mbError_ eager_
)
_lhsOoutput =
(
_output
)
_patternOcon =
(
_lhsIcon
)
_patternOinh =
(
_lhsIinh
)
_patternOnt =
(
_lhsInt
)
_patternOsyn =
(
_lhsIsyn
)
_rhsOallfields =
(
_lhsIallfields
)
_rhsOallnts =
(
_lhsIallnts
)
_rhsOattrs =
(
_lhsIattrs
)
_rhsOcon =
(
_lhsIcon
)
_rhsOmergeMap =
(
_lhsImergeMap
)
_rhsOnt =
(
_lhsInt
)
_rhsOoptions =
(
_lhsIoptions
)
( _patternIcopy,_patternIerrors,_patternIinstVars,_patternIlocVars,_patternIoutput) =
pattern_ _patternOcon _patternOinh _patternOnt _patternOsyn
( _rhsIerrors,_rhsIoutput) =
rhs_ _rhsOallfields _rhsOallnts _rhsOattrs _rhsOcon _rhsOmergeMap _rhsOnt _rhsOoptions
___node =
(Syn_Rule _lhsOerrors _lhsOinstVars _lhsOlocVars _lhsOoutput)
in ( _lhsOerrors,_lhsOinstVars,_lhsOlocVars,_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 (([(Identifier,Type,ChildKind)]) ->
([Identifier]) ->
([(Identifier,Identifier)]) ->
Identifier ->
Attributes ->
(Map Identifier (Identifier,[Identifier])) ->
Identifier ->
Options ->
Attributes ->
( (Seq Error),([Identifier]),([Identifier]),Rules))
data Inh_Rules = Inh_Rules {allfields_Inh_Rules :: ([(Identifier,Type,ChildKind)]),allnts_Inh_Rules :: ([Identifier]),attrs_Inh_Rules :: ([(Identifier,Identifier)]),con_Inh_Rules :: Identifier,inh_Inh_Rules :: Attributes,mergeMap_Inh_Rules :: (Map Identifier (Identifier,[Identifier])),nt_Inh_Rules :: Identifier,options_Inh_Rules :: Options,syn_Inh_Rules :: Attributes}
data Syn_Rules = Syn_Rules {errors_Syn_Rules :: (Seq Error),instVars_Syn_Rules :: ([Identifier]),locVars_Syn_Rules :: ([Identifier]),output_Syn_Rules :: Rules}
wrap_Rules :: T_Rules ->
Inh_Rules ->
Syn_Rules
wrap_Rules (T_Rules sem) (Inh_Rules _lhsIallfields _lhsIallnts _lhsIattrs _lhsIcon _lhsIinh _lhsImergeMap _lhsInt _lhsIoptions _lhsIsyn) =
(let ( _lhsOerrors,_lhsOinstVars,_lhsOlocVars,_lhsOoutput) = sem _lhsIallfields _lhsIallnts _lhsIattrs _lhsIcon _lhsIinh _lhsImergeMap _lhsInt _lhsIoptions _lhsIsyn
in (Syn_Rules _lhsOerrors _lhsOinstVars _lhsOlocVars _lhsOoutput))
sem_Rules_Cons :: T_Rule ->
T_Rules ->
T_Rules
sem_Rules_Cons (T_Rule hd_) (T_Rules tl_) =
(T_Rules (\ _lhsIallfields
_lhsIallnts
_lhsIattrs
_lhsIcon
_lhsIinh
_lhsImergeMap
_lhsInt
_lhsIoptions
_lhsIsyn ->
(let _lhsOerrors :: (Seq Error)
_lhsOinstVars :: ([Identifier])
_lhsOlocVars :: ([Identifier])
_lhsOoutput :: Rules
_hdOallfields :: ([(Identifier,Type,ChildKind)])
_hdOallnts :: ([Identifier])
_hdOattrs :: ([(Identifier,Identifier)])
_hdOcon :: Identifier
_hdOinh :: Attributes
_hdOmergeMap :: (Map Identifier (Identifier,[Identifier]))
_hdOnt :: Identifier
_hdOoptions :: Options
_hdOsyn :: Attributes
_tlOallfields :: ([(Identifier,Type,ChildKind)])
_tlOallnts :: ([Identifier])
_tlOattrs :: ([(Identifier,Identifier)])
_tlOcon :: Identifier
_tlOinh :: Attributes
_tlOmergeMap :: (Map Identifier (Identifier,[Identifier]))
_tlOnt :: Identifier
_tlOoptions :: Options
_tlOsyn :: Attributes
_hdIerrors :: (Seq Error)
_hdIinstVars :: ([Identifier])
_hdIlocVars :: ([Identifier])
_hdIoutput :: Rule
_tlIerrors :: (Seq Error)
_tlIinstVars :: ([Identifier])
_tlIlocVars :: ([Identifier])
_tlIoutput :: Rules
_lhsOerrors =
(
_hdIerrors Seq.>< _tlIerrors
)
_lhsOinstVars =
(
_hdIinstVars ++ _tlIinstVars
)
_lhsOlocVars =
(
_hdIlocVars ++ _tlIlocVars
)
_output =
(
(:) _hdIoutput _tlIoutput
)
_lhsOoutput =
(
_output
)
_hdOallfields =
(
_lhsIallfields
)
_hdOallnts =
(
_lhsIallnts
)
_hdOattrs =
(
_lhsIattrs
)
_hdOcon =
(
_lhsIcon
)
_hdOinh =
(
_lhsIinh
)
_hdOmergeMap =
(
_lhsImergeMap
)
_hdOnt =
(
_lhsInt
)
_hdOoptions =
(
_lhsIoptions
)
_hdOsyn =
(
_lhsIsyn
)
_tlOallfields =
(
_lhsIallfields
)
_tlOallnts =
(
_lhsIallnts
)
_tlOattrs =
(
_lhsIattrs
)
_tlOcon =
(
_lhsIcon
)
_tlOinh =
(
_lhsIinh
)
_tlOmergeMap =
(
_lhsImergeMap
)
_tlOnt =
(
_lhsInt
)
_tlOoptions =
(
_lhsIoptions
)
_tlOsyn =
(
_lhsIsyn
)
( _hdIerrors,_hdIinstVars,_hdIlocVars,_hdIoutput) =
hd_ _hdOallfields _hdOallnts _hdOattrs _hdOcon _hdOinh _hdOmergeMap _hdOnt _hdOoptions _hdOsyn
( _tlIerrors,_tlIinstVars,_tlIlocVars,_tlIoutput) =
tl_ _tlOallfields _tlOallnts _tlOattrs _tlOcon _tlOinh _tlOmergeMap _tlOnt _tlOoptions _tlOsyn
___node =
(Syn_Rules _lhsOerrors _lhsOinstVars _lhsOlocVars _lhsOoutput)
in ( _lhsOerrors,_lhsOinstVars,_lhsOlocVars,_lhsOoutput))))
sem_Rules_Nil :: T_Rules
sem_Rules_Nil =
(T_Rules (\ _lhsIallfields
_lhsIallnts
_lhsIattrs
_lhsIcon
_lhsIinh
_lhsImergeMap
_lhsInt
_lhsIoptions
_lhsIsyn ->
(let _lhsOerrors :: (Seq Error)
_lhsOinstVars :: ([Identifier])
_lhsOlocVars :: ([Identifier])
_lhsOoutput :: Rules
_lhsOerrors =
(
Seq.empty
)
_lhsOinstVars =
(
[]
)
_lhsOlocVars =
(
[]
)
_output =
(
[]
)
_lhsOoutput =
(
_output
)
___node =
(Syn_Rules _lhsOerrors _lhsOinstVars _lhsOlocVars _lhsOoutput)
in ( _lhsOerrors,_lhsOinstVars,_lhsOlocVars,_lhsOoutput))))
sem_TypeSig :: TypeSig ->
T_TypeSig
sem_TypeSig (TypeSig _name _tp) =
(sem_TypeSig_TypeSig _name _tp)
newtype T_TypeSig = T_TypeSig (( TypeSig))
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 sem) (Inh_TypeSig) =
(let ( _lhsOoutput) = sem
in (Syn_TypeSig _lhsOoutput))
sem_TypeSig_TypeSig :: Identifier ->
Type ->
T_TypeSig
sem_TypeSig_TypeSig name_ tp_ =
(T_TypeSig (let _lhsOoutput :: TypeSig
_output =
(
TypeSig name_ tp_
)
_lhsOoutput =
(
_output
)
___node =
(Syn_TypeSig _lhsOoutput)
in ( _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 (( TypeSigs))
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 sem) (Inh_TypeSigs) =
(let ( _lhsOoutput) = sem
in (Syn_TypeSigs _lhsOoutput))
sem_TypeSigs_Cons :: T_TypeSig ->
T_TypeSigs ->
T_TypeSigs
sem_TypeSigs_Cons (T_TypeSig hd_) (T_TypeSigs tl_) =
(T_TypeSigs (let _lhsOoutput :: TypeSigs
_hdIoutput :: TypeSig
_tlIoutput :: TypeSigs
_output =
(
(:) _hdIoutput _tlIoutput
)
_lhsOoutput =
(
_output
)
( _hdIoutput) =
hd_
( _tlIoutput) =
tl_
___node =
(Syn_TypeSigs _lhsOoutput)
in ( _lhsOoutput)))
sem_TypeSigs_Nil :: T_TypeSigs
sem_TypeSigs_Nil =
(T_TypeSigs (let _lhsOoutput :: TypeSigs
_output =
(
[]
)
_lhsOoutput =
(
_output
)
___node =
(Syn_TypeSigs _lhsOoutput)
in ( _lhsOoutput)))