{-# LANGUAGE Rank2Types, GADTs #-}
{-# LANGUAGE ScopedTypeVariables #-}
module Visage where
{-# LINE 2 "src-ag/Expression.ag" #-}
import UU.Scanner.Position(Pos)
import HsToken
{-# LINE 10 "src-generated/Visage.hs" #-}
{-# LINE 2 "src-ag/VisagePatterns.ag" #-}
import UU.Scanner.Position(Pos)
import CommonTypes
{-# LINE 16 "src-generated/Visage.hs" #-}
{-# LINE 2 "src-ag/VisageSyntax.ag" #-}
import CommonTypes
import UU.Pretty
import AbstractSyntax
import VisagePatterns
import Expression
{-# LINE 25 "src-generated/Visage.hs" #-}
{-# LINE 6 "src-ag/Visage.ag" #-}
import UU.Scanner.Position(Pos(..))
import CommonTypes
import ATermAbstractSyntax
import Expression
import VisagePatterns
import VisageSyntax
import qualified Data.Map as Map
import Data.Map(Map)
import Data.List(intersperse)
import TokenDef
{-# LINE 39 "src-generated/Visage.hs" #-}
import Control.Monad.Identity (Identity)
import qualified Control.Monad.Identity
{-# LINE 19 "src-ag/Visage.ag" #-}
convert :: String -> String
convert [] = []
convert (c:ct) | c == '\n' = '\\' : 'n' : convert ct
| otherwise = c : convert ct
sQ :: String -> String
sQ [] = []
sQ (x:xs) = if (x=='"') then rest else x:rest
where
rest = if not (null xs) && last xs == '"' then init xs else xs
showAGPos :: Pos -> String
showAGPos (Pos l c f) | l == (-1) = ""
| otherwise = let file = if null f then "" else f
lc = "(line " ++ show l ++ ", column " ++ show c ++")"
in file ++ lc
showMap :: (Show a, Show b) => Map a b -> String
showMap
= braces . concat . intersperse "," . map (uncurry assign) . Map.assocs
where
braces s = "{" ++ s ++ "}"
assign a b = show a ++ ":=" ++ show b
{-# LINE 67 "src-generated/Visage.hs" #-}
data Inh_Expression = Inh_Expression { }
data Syn_Expression = Syn_Expression { Syn_Expression -> ATerm
aterm_Syn_Expression :: (ATerm) }
{-# INLINABLE wrap_Expression #-}
wrap_Expression :: T_Expression -> Inh_Expression -> (Syn_Expression )
wrap_Expression :: T_Expression -> Inh_Expression -> Syn_Expression
wrap_Expression (T_Expression Identity T_Expression_s2
act) (Inh_Expression
Inh_Expression ) =
Identity Syn_Expression -> Syn_Expression
forall a. Identity a -> a
Control.Monad.Identity.runIdentity (
do T_Expression_s2
sem <- Identity T_Expression_s2
act
let arg1 :: T_Expression_vIn1
arg1 = T_Expression_vIn1
T_Expression_vIn1
(T_Expression_vOut1 ATerm
_lhsOaterm) <- T_Expression_vOut1 -> Identity T_Expression_vOut1
forall (m :: * -> *) a. Monad m => a -> m a
return (T_Expression_s2 -> T_Expression_v1
inv_Expression_s2 T_Expression_s2
sem T_Expression_vIn1
arg1)
Syn_Expression -> Identity Syn_Expression
forall (m :: * -> *) a. Monad m => a -> m a
return (ATerm -> Syn_Expression
Syn_Expression ATerm
_lhsOaterm)
)
{-# INLINE sem_Expression #-}
sem_Expression :: Expression -> T_Expression
sem_Expression :: Expression -> T_Expression
sem_Expression ( Expression Pos
pos_ [HsToken]
tks_ ) = Pos -> [HsToken] -> T_Expression
sem_Expression_Expression Pos
pos_ [HsToken]
tks_
newtype T_Expression = T_Expression {
T_Expression -> Identity T_Expression_s2
attach_T_Expression :: Identity (T_Expression_s2 )
}
newtype T_Expression_s2 = C_Expression_s2 {
T_Expression_s2 -> T_Expression_v1
inv_Expression_s2 :: (T_Expression_v1 )
}
data T_Expression_s3 = C_Expression_s3
type T_Expression_v1 = (T_Expression_vIn1 ) -> (T_Expression_vOut1 )
data T_Expression_vIn1 = T_Expression_vIn1
data T_Expression_vOut1 = T_Expression_vOut1 (ATerm)
{-# NOINLINE sem_Expression_Expression #-}
sem_Expression_Expression :: (Pos) -> ([HsToken]) -> T_Expression
sem_Expression_Expression :: Pos -> [HsToken] -> T_Expression
sem_Expression_Expression Pos
arg_pos_ [HsToken]
arg_tks_ = Identity T_Expression_s2 -> T_Expression
T_Expression (T_Expression_s2 -> Identity T_Expression_s2
forall (m :: * -> *) a. Monad m => a -> m a
return T_Expression_s2
st2) where
{-# NOINLINE st2 #-}
st2 :: T_Expression_s2
st2 = let
v1 :: T_Expression_v1
v1 :: T_Expression_v1
v1 = \ (T_Expression_vIn1
T_Expression_vIn1 ) -> ( let
_lhsOaterm :: ATerm
_lhsOaterm :: ATerm
_lhsOaterm = Pos -> [HsToken] -> ATerm
rule0 Pos
arg_pos_ [HsToken]
arg_tks_
__result_ :: T_Expression_vOut1
__result_ = ATerm -> T_Expression_vOut1
T_Expression_vOut1 ATerm
_lhsOaterm
in T_Expression_vOut1
__result_ )
in T_Expression_v1 -> T_Expression_s2
C_Expression_s2 T_Expression_v1
v1
{-# INLINE rule0 #-}
{-# LINE 103 "src-ag/Visage.ag" #-}
rule0 = \ pos_ tks_ ->
{-# LINE 103 "src-ag/Visage.ag" #-}
AAppl "Expression" [AString (sQ (showAGPos pos_)), AString (sQ (unlines . showTokens . tokensToStrings $ tks_))]
{-# LINE 115 "src-generated/Visage.hs" #-}
data Inh_VisageChild = Inh_VisageChild { }
data Syn_VisageChild = Syn_VisageChild { Syn_VisageChild -> ATerm
aterm_Syn_VisageChild :: (ATerm) }
{-# INLINABLE wrap_VisageChild #-}
wrap_VisageChild :: T_VisageChild -> Inh_VisageChild -> (Syn_VisageChild )
wrap_VisageChild :: T_VisageChild -> Inh_VisageChild -> Syn_VisageChild
wrap_VisageChild (T_VisageChild Identity T_VisageChild_s5
act) (Inh_VisageChild
Inh_VisageChild ) =
Identity Syn_VisageChild -> Syn_VisageChild
forall a. Identity a -> a
Control.Monad.Identity.runIdentity (
do T_VisageChild_s5
sem <- Identity T_VisageChild_s5
act
let arg4 :: T_VisageChild_vIn4
arg4 = T_VisageChild_vIn4
T_VisageChild_vIn4
(T_VisageChild_vOut4 ATerm
_lhsOaterm) <- T_VisageChild_vOut4 -> Identity T_VisageChild_vOut4
forall (m :: * -> *) a. Monad m => a -> m a
return (T_VisageChild_s5 -> T_VisageChild_v4
inv_VisageChild_s5 T_VisageChild_s5
sem T_VisageChild_vIn4
arg4)
Syn_VisageChild -> Identity Syn_VisageChild
forall (m :: * -> *) a. Monad m => a -> m a
return (ATerm -> Syn_VisageChild
Syn_VisageChild ATerm
_lhsOaterm)
)
{-# INLINE sem_VisageChild #-}
sem_VisageChild :: VisageChild -> T_VisageChild
sem_VisageChild :: VisageChild -> T_VisageChild
sem_VisageChild ( VChild Identifier
name_ Type
tp_ Map Identifier Type
inh_ Map Identifier Type
syn_ VisageRules
rules_ ) = Identifier
-> Type
-> Map Identifier Type
-> Map Identifier Type
-> T_VisageRules
-> T_VisageChild
sem_VisageChild_VChild Identifier
name_ Type
tp_ Map Identifier Type
inh_ Map Identifier Type
syn_ ( VisageRules -> T_VisageRules
sem_VisageRules VisageRules
rules_ )
newtype T_VisageChild = T_VisageChild {
T_VisageChild -> Identity T_VisageChild_s5
attach_T_VisageChild :: Identity (T_VisageChild_s5 )
}
newtype T_VisageChild_s5 = C_VisageChild_s5 {
T_VisageChild_s5 -> T_VisageChild_v4
inv_VisageChild_s5 :: (T_VisageChild_v4 )
}
data T_VisageChild_s6 = C_VisageChild_s6
type T_VisageChild_v4 = (T_VisageChild_vIn4 ) -> (T_VisageChild_vOut4 )
data T_VisageChild_vIn4 = T_VisageChild_vIn4
data T_VisageChild_vOut4 = T_VisageChild_vOut4 (ATerm)
{-# NOINLINE sem_VisageChild_VChild #-}
sem_VisageChild_VChild :: (Identifier) -> (Type) -> (Attributes) -> (Attributes) -> T_VisageRules -> T_VisageChild
sem_VisageChild_VChild :: Identifier
-> Type
-> Map Identifier Type
-> Map Identifier Type
-> T_VisageRules
-> T_VisageChild
sem_VisageChild_VChild Identifier
arg_name_ Type
arg_tp_ Map Identifier Type
arg_inh_ Map Identifier Type
arg_syn_ T_VisageRules
arg_rules_ = Identity T_VisageChild_s5 -> T_VisageChild
T_VisageChild (T_VisageChild_s5 -> Identity T_VisageChild_s5
forall (m :: * -> *) a. Monad m => a -> m a
return T_VisageChild_s5
st5) where
{-# NOINLINE st5 #-}
st5 :: T_VisageChild_s5
st5 = let
v4 :: T_VisageChild_v4
v4 :: T_VisageChild_v4
v4 = \ (T_VisageChild_vIn4
T_VisageChild_vIn4 ) -> ( let
_rulesX35 :: T_VisageRules_s35
_rulesX35 = Identity T_VisageRules_s35 -> T_VisageRules_s35
forall a. Identity a -> a
Control.Monad.Identity.runIdentity (T_VisageRules -> Identity T_VisageRules_s35
attach_T_VisageRules (T_VisageRules
arg_rules_))
(T_VisageRules_vOut34 [ATerm]
_rulesIaterms) = T_VisageRules_s35 -> T_VisageRules_v34
inv_VisageRules_s35 T_VisageRules_s35
_rulesX35 (Bool -> T_VisageRules_vIn34
T_VisageRules_vIn34 Bool
_rulesOisLoc)
_lhsOaterm :: ATerm
_lhsOaterm :: ATerm
_lhsOaterm = [ATerm]
-> Map Identifier Type
-> Identifier
-> Map Identifier Type
-> Type
-> ATerm
rule1 [ATerm]
_rulesIaterms Map Identifier Type
arg_inh_ Identifier
arg_name_ Map Identifier Type
arg_syn_ Type
arg_tp_
_rulesOisLoc :: Bool
_rulesOisLoc = () -> Bool
rule2 ()
__result_ :: T_VisageChild_vOut4
__result_ = ATerm -> T_VisageChild_vOut4
T_VisageChild_vOut4 ATerm
_lhsOaterm
in T_VisageChild_vOut4
__result_ )
in T_VisageChild_v4 -> T_VisageChild_s5
C_VisageChild_s5 T_VisageChild_v4
v4
{-# INLINE rule1 #-}
{-# LINE 85 "src-ag/Visage.ag" #-}
rule1 = \ ((_rulesIaterms) :: [ATerm]) inh_ name_ syn_ tp_ ->
{-# LINE 85 "src-ag/Visage.ag" #-}
AAppl "Child" [AString (sQ (getName name_)), AString (sQ (show tp_)),
AString (sQ (showMap inh_)),
AString (sQ (showMap syn_)),
AAppl "Rules" _rulesIaterms]
{-# LINE 170 "src-generated/Visage.hs" #-}
{-# INLINE rule2 #-}
{-# LINE 89 "src-ag/Visage.ag" #-}
rule2 = \ (_ :: ()) ->
{-# LINE 89 "src-ag/Visage.ag" #-}
False
{-# LINE 176 "src-generated/Visage.hs" #-}
data Inh_VisageChildren = Inh_VisageChildren { }
data Syn_VisageChildren = Syn_VisageChildren { Syn_VisageChildren -> [ATerm]
aterms_Syn_VisageChildren :: ([ATerm]) }
{-# INLINABLE wrap_VisageChildren #-}
wrap_VisageChildren :: T_VisageChildren -> Inh_VisageChildren -> (Syn_VisageChildren )
wrap_VisageChildren :: T_VisageChildren -> Inh_VisageChildren -> Syn_VisageChildren
wrap_VisageChildren (T_VisageChildren Identity T_VisageChildren_s8
act) (Inh_VisageChildren
Inh_VisageChildren ) =
Identity Syn_VisageChildren -> Syn_VisageChildren
forall a. Identity a -> a
Control.Monad.Identity.runIdentity (
do T_VisageChildren_s8
sem <- Identity T_VisageChildren_s8
act
let arg7 :: T_VisageChildren_vIn7
arg7 = T_VisageChildren_vIn7
T_VisageChildren_vIn7
(T_VisageChildren_vOut7 [ATerm]
_lhsOaterms) <- T_VisageChildren_vOut7 -> Identity T_VisageChildren_vOut7
forall (m :: * -> *) a. Monad m => a -> m a
return (T_VisageChildren_s8 -> T_VisageChildren_v7
inv_VisageChildren_s8 T_VisageChildren_s8
sem T_VisageChildren_vIn7
arg7)
Syn_VisageChildren -> Identity Syn_VisageChildren
forall (m :: * -> *) a. Monad m => a -> m a
return ([ATerm] -> Syn_VisageChildren
Syn_VisageChildren [ATerm]
_lhsOaterms)
)
{-# NOINLINE sem_VisageChildren #-}
sem_VisageChildren :: VisageChildren -> T_VisageChildren
sem_VisageChildren :: VisageChildren -> T_VisageChildren
sem_VisageChildren VisageChildren
list = (T_VisageChild -> T_VisageChildren -> T_VisageChildren)
-> T_VisageChildren -> [T_VisageChild] -> T_VisageChildren
forall (t :: * -> *) a b.
Foldable t =>
(a -> b -> b) -> b -> t a -> b
Prelude.foldr T_VisageChild -> T_VisageChildren -> T_VisageChildren
sem_VisageChildren_Cons T_VisageChildren
sem_VisageChildren_Nil ((VisageChild -> T_VisageChild) -> VisageChildren -> [T_VisageChild]
forall a b. (a -> b) -> [a] -> [b]
Prelude.map VisageChild -> T_VisageChild
sem_VisageChild VisageChildren
list)
newtype T_VisageChildren = T_VisageChildren {
T_VisageChildren -> Identity T_VisageChildren_s8
attach_T_VisageChildren :: Identity (T_VisageChildren_s8 )
}
newtype T_VisageChildren_s8 = C_VisageChildren_s8 {
T_VisageChildren_s8 -> T_VisageChildren_v7
inv_VisageChildren_s8 :: (T_VisageChildren_v7 )
}
data T_VisageChildren_s9 = C_VisageChildren_s9
type T_VisageChildren_v7 = (T_VisageChildren_vIn7 ) -> (T_VisageChildren_vOut7 )
data T_VisageChildren_vIn7 = T_VisageChildren_vIn7
data T_VisageChildren_vOut7 = T_VisageChildren_vOut7 ([ATerm])
{-# NOINLINE sem_VisageChildren_Cons #-}
sem_VisageChildren_Cons :: T_VisageChild -> T_VisageChildren -> T_VisageChildren
sem_VisageChildren_Cons :: T_VisageChild -> T_VisageChildren -> T_VisageChildren
sem_VisageChildren_Cons T_VisageChild
arg_hd_ T_VisageChildren
arg_tl_ = Identity T_VisageChildren_s8 -> T_VisageChildren
T_VisageChildren (T_VisageChildren_s8 -> Identity T_VisageChildren_s8
forall (m :: * -> *) a. Monad m => a -> m a
return T_VisageChildren_s8
st8) where
{-# NOINLINE st8 #-}
st8 :: T_VisageChildren_s8
st8 = let
v7 :: T_VisageChildren_v7
v7 :: T_VisageChildren_v7
v7 = \ (T_VisageChildren_vIn7
T_VisageChildren_vIn7 ) -> ( let
_hdX5 :: T_VisageChild_s5
_hdX5 = Identity T_VisageChild_s5 -> T_VisageChild_s5
forall a. Identity a -> a
Control.Monad.Identity.runIdentity (T_VisageChild -> Identity T_VisageChild_s5
attach_T_VisageChild (T_VisageChild
arg_hd_))
_tlX8 :: T_VisageChildren_s8
_tlX8 = Identity T_VisageChildren_s8 -> T_VisageChildren_s8
forall a. Identity a -> a
Control.Monad.Identity.runIdentity (T_VisageChildren -> Identity T_VisageChildren_s8
attach_T_VisageChildren (T_VisageChildren
arg_tl_))
(T_VisageChild_vOut4 ATerm
_hdIaterm) = T_VisageChild_s5 -> T_VisageChild_v4
inv_VisageChild_s5 T_VisageChild_s5
_hdX5 (T_VisageChild_vIn4
T_VisageChild_vIn4 )
(T_VisageChildren_vOut7 [ATerm]
_tlIaterms) = T_VisageChildren_s8 -> T_VisageChildren_v7
inv_VisageChildren_s8 T_VisageChildren_s8
_tlX8 (T_VisageChildren_vIn7
T_VisageChildren_vIn7 )
_lhsOaterms :: [ATerm]
_lhsOaterms :: [ATerm]
_lhsOaterms = ATerm -> [ATerm] -> [ATerm]
rule3 ATerm
_hdIaterm [ATerm]
_tlIaterms
__result_ :: T_VisageChildren_vOut7
__result_ = [ATerm] -> T_VisageChildren_vOut7
T_VisageChildren_vOut7 [ATerm]
_lhsOaterms
in T_VisageChildren_vOut7
__result_ )
in T_VisageChildren_v7 -> T_VisageChildren_s8
C_VisageChildren_s8 T_VisageChildren_v7
v7
{-# INLINE rule3 #-}
{-# LINE 80 "src-ag/Visage.ag" #-}
rule3 = \ ((_hdIaterm) :: ATerm) ((_tlIaterms) :: [ATerm]) ->
{-# LINE 80 "src-ag/Visage.ag" #-}
_hdIaterm : _tlIaterms
{-# LINE 229 "src-generated/Visage.hs" #-}
{-# NOINLINE sem_VisageChildren_Nil #-}
sem_VisageChildren_Nil :: T_VisageChildren
sem_VisageChildren_Nil :: T_VisageChildren
sem_VisageChildren_Nil = Identity T_VisageChildren_s8 -> T_VisageChildren
T_VisageChildren (T_VisageChildren_s8 -> Identity T_VisageChildren_s8
forall (m :: * -> *) a. Monad m => a -> m a
return T_VisageChildren_s8
st8) where
{-# NOINLINE st8 #-}
st8 :: T_VisageChildren_s8
st8 = let
v7 :: T_VisageChildren_v7
v7 :: T_VisageChildren_v7
v7 = \ (T_VisageChildren_vIn7
T_VisageChildren_vIn7 ) -> ( let
_lhsOaterms :: [ATerm]
_lhsOaterms :: [ATerm]
_lhsOaterms = () -> [ATerm]
forall a. () -> [a]
rule4 ()
__result_ :: T_VisageChildren_vOut7
__result_ = [ATerm] -> T_VisageChildren_vOut7
T_VisageChildren_vOut7 [ATerm]
_lhsOaterms
in T_VisageChildren_vOut7
__result_ )
in T_VisageChildren_v7 -> T_VisageChildren_s8
C_VisageChildren_s8 T_VisageChildren_v7
v7
{-# INLINE rule4 #-}
{-# LINE 81 "src-ag/Visage.ag" #-}
rule4 = \ (_ :: ()) ->
{-# LINE 81 "src-ag/Visage.ag" #-}
[]
{-# LINE 247 "src-generated/Visage.hs" #-}
data Inh_VisageGrammar = Inh_VisageGrammar { }
data Syn_VisageGrammar = Syn_VisageGrammar { Syn_VisageGrammar -> ATerm
aterm_Syn_VisageGrammar :: (ATerm) }
{-# INLINABLE wrap_VisageGrammar #-}
wrap_VisageGrammar :: T_VisageGrammar -> Inh_VisageGrammar -> (Syn_VisageGrammar )
wrap_VisageGrammar :: T_VisageGrammar -> Inh_VisageGrammar -> Syn_VisageGrammar
wrap_VisageGrammar (T_VisageGrammar Identity T_VisageGrammar_s11
act) (Inh_VisageGrammar
Inh_VisageGrammar ) =
Identity Syn_VisageGrammar -> Syn_VisageGrammar
forall a. Identity a -> a
Control.Monad.Identity.runIdentity (
do T_VisageGrammar_s11
sem <- Identity T_VisageGrammar_s11
act
let arg10 :: T_VisageGrammar_vIn10
arg10 = T_VisageGrammar_vIn10
T_VisageGrammar_vIn10
(T_VisageGrammar_vOut10 ATerm
_lhsOaterm) <- T_VisageGrammar_vOut10 -> Identity T_VisageGrammar_vOut10
forall (m :: * -> *) a. Monad m => a -> m a
return (T_VisageGrammar_s11 -> T_VisageGrammar_v10
inv_VisageGrammar_s11 T_VisageGrammar_s11
sem T_VisageGrammar_vIn10
arg10)
Syn_VisageGrammar -> Identity Syn_VisageGrammar
forall (m :: * -> *) a. Monad m => a -> m a
return (ATerm -> Syn_VisageGrammar
Syn_VisageGrammar ATerm
_lhsOaterm)
)
{-# INLINE sem_VisageGrammar #-}
sem_VisageGrammar :: VisageGrammar -> T_VisageGrammar
sem_VisageGrammar :: VisageGrammar -> T_VisageGrammar
sem_VisageGrammar ( VGrammar VisageNonterminals
nonts_ ) = T_VisageNonterminals -> T_VisageGrammar
sem_VisageGrammar_VGrammar ( VisageNonterminals -> T_VisageNonterminals
sem_VisageNonterminals VisageNonterminals
nonts_ )
newtype T_VisageGrammar = T_VisageGrammar {
T_VisageGrammar -> Identity T_VisageGrammar_s11
attach_T_VisageGrammar :: Identity (T_VisageGrammar_s11 )
}
newtype T_VisageGrammar_s11 = C_VisageGrammar_s11 {
T_VisageGrammar_s11 -> T_VisageGrammar_v10
inv_VisageGrammar_s11 :: (T_VisageGrammar_v10 )
}
data T_VisageGrammar_s12 = C_VisageGrammar_s12
type T_VisageGrammar_v10 = (T_VisageGrammar_vIn10 ) -> (T_VisageGrammar_vOut10 )
data T_VisageGrammar_vIn10 = T_VisageGrammar_vIn10
data T_VisageGrammar_vOut10 = T_VisageGrammar_vOut10 (ATerm)
{-# NOINLINE sem_VisageGrammar_VGrammar #-}
sem_VisageGrammar_VGrammar :: T_VisageNonterminals -> T_VisageGrammar
sem_VisageGrammar_VGrammar :: T_VisageNonterminals -> T_VisageGrammar
sem_VisageGrammar_VGrammar T_VisageNonterminals
arg_nonts_ = Identity T_VisageGrammar_s11 -> T_VisageGrammar
T_VisageGrammar (T_VisageGrammar_s11 -> Identity T_VisageGrammar_s11
forall (m :: * -> *) a. Monad m => a -> m a
return T_VisageGrammar_s11
st11) where
{-# NOINLINE st11 #-}
st11 :: T_VisageGrammar_s11
st11 = let
v10 :: T_VisageGrammar_v10
v10 :: T_VisageGrammar_v10
v10 = \ (T_VisageGrammar_vIn10
T_VisageGrammar_vIn10 ) -> ( let
_nontsX17 :: T_VisageNonterminals_s17
_nontsX17 = Identity T_VisageNonterminals_s17 -> T_VisageNonterminals_s17
forall a. Identity a -> a
Control.Monad.Identity.runIdentity (T_VisageNonterminals -> Identity T_VisageNonterminals_s17
attach_T_VisageNonterminals (T_VisageNonterminals
arg_nonts_))
(T_VisageNonterminals_vOut16 [ATerm]
_nontsIaterms) = T_VisageNonterminals_s17 -> T_VisageNonterminals_v16
inv_VisageNonterminals_s17 T_VisageNonterminals_s17
_nontsX17 (T_VisageNonterminals_vIn16
T_VisageNonterminals_vIn16 )
_lhsOaterm :: ATerm
_lhsOaterm :: ATerm
_lhsOaterm = [ATerm] -> ATerm
rule5 [ATerm]
_nontsIaterms
__result_ :: T_VisageGrammar_vOut10
__result_ = ATerm -> T_VisageGrammar_vOut10
T_VisageGrammar_vOut10 ATerm
_lhsOaterm
in T_VisageGrammar_vOut10
__result_ )
in T_VisageGrammar_v10 -> T_VisageGrammar_s11
C_VisageGrammar_s11 T_VisageGrammar_v10
v10
{-# INLINE rule5 #-}
{-# LINE 54 "src-ag/Visage.ag" #-}
rule5 = \ ((_nontsIaterms) :: [ATerm]) ->
{-# LINE 54 "src-ag/Visage.ag" #-}
AAppl "Productions" _nontsIaterms
{-# LINE 298 "src-generated/Visage.hs" #-}
data Inh_VisageNonterminal = Inh_VisageNonterminal { }
data Syn_VisageNonterminal = Syn_VisageNonterminal { Syn_VisageNonterminal -> ATerm
aterm_Syn_VisageNonterminal :: (ATerm) }
{-# INLINABLE wrap_VisageNonterminal #-}
wrap_VisageNonterminal :: T_VisageNonterminal -> Inh_VisageNonterminal -> (Syn_VisageNonterminal )
wrap_VisageNonterminal :: T_VisageNonterminal
-> Inh_VisageNonterminal -> Syn_VisageNonterminal
wrap_VisageNonterminal (T_VisageNonterminal Identity T_VisageNonterminal_s14
act) (Inh_VisageNonterminal
Inh_VisageNonterminal ) =
Identity Syn_VisageNonterminal -> Syn_VisageNonterminal
forall a. Identity a -> a
Control.Monad.Identity.runIdentity (
do T_VisageNonterminal_s14
sem <- Identity T_VisageNonterminal_s14
act
let arg13 :: T_VisageNonterminal_vIn13
arg13 = T_VisageNonterminal_vIn13
T_VisageNonterminal_vIn13
(T_VisageNonterminal_vOut13 ATerm
_lhsOaterm) <- T_VisageNonterminal_vOut13 -> Identity T_VisageNonterminal_vOut13
forall (m :: * -> *) a. Monad m => a -> m a
return (T_VisageNonterminal_s14 -> T_VisageNonterminal_v13
inv_VisageNonterminal_s14 T_VisageNonterminal_s14
sem T_VisageNonterminal_vIn13
arg13)
Syn_VisageNonterminal -> Identity Syn_VisageNonterminal
forall (m :: * -> *) a. Monad m => a -> m a
return (ATerm -> Syn_VisageNonterminal
Syn_VisageNonterminal ATerm
_lhsOaterm)
)
{-# INLINE sem_VisageNonterminal #-}
sem_VisageNonterminal :: VisageNonterminal -> T_VisageNonterminal
sem_VisageNonterminal :: VisageNonterminal -> T_VisageNonterminal
sem_VisageNonterminal ( VNonterminal Identifier
nt_ Map Identifier Type
inh_ Map Identifier Type
syn_ VisageProductions
alts_ ) = Identifier
-> Map Identifier Type
-> Map Identifier Type
-> T_VisageProductions
-> T_VisageNonterminal
sem_VisageNonterminal_VNonterminal Identifier
nt_ Map Identifier Type
inh_ Map Identifier Type
syn_ ( VisageProductions -> T_VisageProductions
sem_VisageProductions VisageProductions
alts_ )
newtype T_VisageNonterminal = T_VisageNonterminal {
T_VisageNonterminal -> Identity T_VisageNonterminal_s14
attach_T_VisageNonterminal :: Identity (T_VisageNonterminal_s14 )
}
newtype T_VisageNonterminal_s14 = C_VisageNonterminal_s14 {
T_VisageNonterminal_s14 -> T_VisageNonterminal_v13
inv_VisageNonterminal_s14 :: (T_VisageNonterminal_v13 )
}
data T_VisageNonterminal_s15 = C_VisageNonterminal_s15
type T_VisageNonterminal_v13 = (T_VisageNonterminal_vIn13 ) -> (T_VisageNonterminal_vOut13 )
data T_VisageNonterminal_vIn13 = T_VisageNonterminal_vIn13
data T_VisageNonterminal_vOut13 = T_VisageNonterminal_vOut13 (ATerm)
{-# NOINLINE sem_VisageNonterminal_VNonterminal #-}
sem_VisageNonterminal_VNonterminal :: (NontermIdent) -> (Attributes) -> (Attributes) -> T_VisageProductions -> T_VisageNonterminal
sem_VisageNonterminal_VNonterminal :: Identifier
-> Map Identifier Type
-> Map Identifier Type
-> T_VisageProductions
-> T_VisageNonterminal
sem_VisageNonterminal_VNonterminal Identifier
arg_nt_ Map Identifier Type
arg_inh_ Map Identifier Type
arg_syn_ T_VisageProductions
arg_alts_ = Identity T_VisageNonterminal_s14 -> T_VisageNonterminal
T_VisageNonterminal (T_VisageNonterminal_s14 -> Identity T_VisageNonterminal_s14
forall (m :: * -> *) a. Monad m => a -> m a
return T_VisageNonterminal_s14
st14) where
{-# NOINLINE st14 #-}
st14 :: T_VisageNonterminal_s14
st14 = let
v13 :: T_VisageNonterminal_v13
v13 :: T_VisageNonterminal_v13
v13 = \ (T_VisageNonterminal_vIn13
T_VisageNonterminal_vIn13 ) -> ( let
_altsX29 :: T_VisageProductions_s29
_altsX29 = Identity T_VisageProductions_s29 -> T_VisageProductions_s29
forall a. Identity a -> a
Control.Monad.Identity.runIdentity (T_VisageProductions -> Identity T_VisageProductions_s29
attach_T_VisageProductions (T_VisageProductions
arg_alts_))
(T_VisageProductions_vOut28 [ATerm]
_altsIaterms) = T_VisageProductions_s29 -> T_VisageProductions_v28
inv_VisageProductions_s29 T_VisageProductions_s29
_altsX29 (T_VisageProductions_vIn28
T_VisageProductions_vIn28 )
_lhsOaterm :: ATerm
_lhsOaterm :: ATerm
_lhsOaterm = [ATerm]
-> Map Identifier Type
-> Identifier
-> Map Identifier Type
-> ATerm
rule6 [ATerm]
_altsIaterms Map Identifier Type
arg_inh_ Identifier
arg_nt_ Map Identifier Type
arg_syn_
__result_ :: T_VisageNonterminal_vOut13
__result_ = ATerm -> T_VisageNonterminal_vOut13
T_VisageNonterminal_vOut13 ATerm
_lhsOaterm
in T_VisageNonterminal_vOut13
__result_ )
in T_VisageNonterminal_v13 -> T_VisageNonterminal_s14
C_VisageNonterminal_s14 T_VisageNonterminal_v13
v13
{-# INLINE rule6 #-}
{-# LINE 63 "src-ag/Visage.ag" #-}
rule6 = \ ((_altsIaterms) :: [ATerm]) inh_ nt_ syn_ ->
{-# LINE 63 "src-ag/Visage.ag" #-}
AAppl "Production" [AString (sQ (getName nt_)), AString (sQ(showMap inh_)),
AString (sQ(showMap syn_)), AAppl "Alternatives" _altsIaterms]
{-# LINE 350 "src-generated/Visage.hs" #-}
data Inh_VisageNonterminals = Inh_VisageNonterminals { }
data Syn_VisageNonterminals = Syn_VisageNonterminals { Syn_VisageNonterminals -> [ATerm]
aterms_Syn_VisageNonterminals :: ([ATerm]) }
{-# INLINABLE wrap_VisageNonterminals #-}
wrap_VisageNonterminals :: T_VisageNonterminals -> Inh_VisageNonterminals -> (Syn_VisageNonterminals )
wrap_VisageNonterminals :: T_VisageNonterminals
-> Inh_VisageNonterminals -> Syn_VisageNonterminals
wrap_VisageNonterminals (T_VisageNonterminals Identity T_VisageNonterminals_s17
act) (Inh_VisageNonterminals
Inh_VisageNonterminals ) =
Identity Syn_VisageNonterminals -> Syn_VisageNonterminals
forall a. Identity a -> a
Control.Monad.Identity.runIdentity (
do T_VisageNonterminals_s17
sem <- Identity T_VisageNonterminals_s17
act
let arg16 :: T_VisageNonterminals_vIn16
arg16 = T_VisageNonterminals_vIn16
T_VisageNonterminals_vIn16
(T_VisageNonterminals_vOut16 [ATerm]
_lhsOaterms) <- T_VisageNonterminals_vOut16 -> Identity T_VisageNonterminals_vOut16
forall (m :: * -> *) a. Monad m => a -> m a
return (T_VisageNonterminals_s17 -> T_VisageNonterminals_v16
inv_VisageNonterminals_s17 T_VisageNonterminals_s17
sem T_VisageNonterminals_vIn16
arg16)
Syn_VisageNonterminals -> Identity Syn_VisageNonterminals
forall (m :: * -> *) a. Monad m => a -> m a
return ([ATerm] -> Syn_VisageNonterminals
Syn_VisageNonterminals [ATerm]
_lhsOaterms)
)
{-# NOINLINE sem_VisageNonterminals #-}
sem_VisageNonterminals :: VisageNonterminals -> T_VisageNonterminals
sem_VisageNonterminals :: VisageNonterminals -> T_VisageNonterminals
sem_VisageNonterminals VisageNonterminals
list = (T_VisageNonterminal
-> T_VisageNonterminals -> T_VisageNonterminals)
-> T_VisageNonterminals
-> [T_VisageNonterminal]
-> T_VisageNonterminals
forall (t :: * -> *) a b.
Foldable t =>
(a -> b -> b) -> b -> t a -> b
Prelude.foldr T_VisageNonterminal -> T_VisageNonterminals -> T_VisageNonterminals
sem_VisageNonterminals_Cons T_VisageNonterminals
sem_VisageNonterminals_Nil ((VisageNonterminal -> T_VisageNonterminal)
-> VisageNonterminals -> [T_VisageNonterminal]
forall a b. (a -> b) -> [a] -> [b]
Prelude.map VisageNonterminal -> T_VisageNonterminal
sem_VisageNonterminal VisageNonterminals
list)
newtype T_VisageNonterminals = T_VisageNonterminals {
T_VisageNonterminals -> Identity T_VisageNonterminals_s17
attach_T_VisageNonterminals :: Identity (T_VisageNonterminals_s17 )
}
newtype T_VisageNonterminals_s17 = C_VisageNonterminals_s17 {
T_VisageNonterminals_s17 -> T_VisageNonterminals_v16
inv_VisageNonterminals_s17 :: (T_VisageNonterminals_v16 )
}
data T_VisageNonterminals_s18 = C_VisageNonterminals_s18
type T_VisageNonterminals_v16 = (T_VisageNonterminals_vIn16 ) -> (T_VisageNonterminals_vOut16 )
data T_VisageNonterminals_vIn16 = T_VisageNonterminals_vIn16
data T_VisageNonterminals_vOut16 = T_VisageNonterminals_vOut16 ([ATerm])
{-# NOINLINE sem_VisageNonterminals_Cons #-}
sem_VisageNonterminals_Cons :: T_VisageNonterminal -> T_VisageNonterminals -> T_VisageNonterminals
sem_VisageNonterminals_Cons :: T_VisageNonterminal -> T_VisageNonterminals -> T_VisageNonterminals
sem_VisageNonterminals_Cons T_VisageNonterminal
arg_hd_ T_VisageNonterminals
arg_tl_ = Identity T_VisageNonterminals_s17 -> T_VisageNonterminals
T_VisageNonterminals (T_VisageNonterminals_s17 -> Identity T_VisageNonterminals_s17
forall (m :: * -> *) a. Monad m => a -> m a
return T_VisageNonterminals_s17
st17) where
{-# NOINLINE st17 #-}
st17 :: T_VisageNonterminals_s17
st17 = let
v16 :: T_VisageNonterminals_v16
v16 :: T_VisageNonterminals_v16
v16 = \ (T_VisageNonterminals_vIn16
T_VisageNonterminals_vIn16 ) -> ( let
_hdX14 :: T_VisageNonterminal_s14
_hdX14 = Identity T_VisageNonterminal_s14 -> T_VisageNonterminal_s14
forall a. Identity a -> a
Control.Monad.Identity.runIdentity (T_VisageNonterminal -> Identity T_VisageNonterminal_s14
attach_T_VisageNonterminal (T_VisageNonterminal
arg_hd_))
_tlX17 :: T_VisageNonterminals_s17
_tlX17 = Identity T_VisageNonterminals_s17 -> T_VisageNonterminals_s17
forall a. Identity a -> a
Control.Monad.Identity.runIdentity (T_VisageNonterminals -> Identity T_VisageNonterminals_s17
attach_T_VisageNonterminals (T_VisageNonterminals
arg_tl_))
(T_VisageNonterminal_vOut13 ATerm
_hdIaterm) = T_VisageNonterminal_s14 -> T_VisageNonterminal_v13
inv_VisageNonterminal_s14 T_VisageNonterminal_s14
_hdX14 (T_VisageNonterminal_vIn13
T_VisageNonterminal_vIn13 )
(T_VisageNonterminals_vOut16 [ATerm]
_tlIaterms) = T_VisageNonterminals_s17 -> T_VisageNonterminals_v16
inv_VisageNonterminals_s17 T_VisageNonterminals_s17
_tlX17 (T_VisageNonterminals_vIn16
T_VisageNonterminals_vIn16 )
_lhsOaterms :: [ATerm]
_lhsOaterms :: [ATerm]
_lhsOaterms = ATerm -> [ATerm] -> [ATerm]
rule7 ATerm
_hdIaterm [ATerm]
_tlIaterms
__result_ :: T_VisageNonterminals_vOut16
__result_ = [ATerm] -> T_VisageNonterminals_vOut16
T_VisageNonterminals_vOut16 [ATerm]
_lhsOaterms
in T_VisageNonterminals_vOut16
__result_ )
in T_VisageNonterminals_v16 -> T_VisageNonterminals_s17
C_VisageNonterminals_s17 T_VisageNonterminals_v16
v16
{-# INLINE rule7 #-}
{-# LINE 58 "src-ag/Visage.ag" #-}
rule7 = \ ((_hdIaterm) :: ATerm) ((_tlIaterms) :: [ATerm]) ->
{-# LINE 58 "src-ag/Visage.ag" #-}
_hdIaterm : _tlIaterms
{-# LINE 403 "src-generated/Visage.hs" #-}
{-# NOINLINE sem_VisageNonterminals_Nil #-}
sem_VisageNonterminals_Nil :: T_VisageNonterminals
sem_VisageNonterminals_Nil :: T_VisageNonterminals
sem_VisageNonterminals_Nil = Identity T_VisageNonterminals_s17 -> T_VisageNonterminals
T_VisageNonterminals (T_VisageNonterminals_s17 -> Identity T_VisageNonterminals_s17
forall (m :: * -> *) a. Monad m => a -> m a
return T_VisageNonterminals_s17
st17) where
{-# NOINLINE st17 #-}
st17 :: T_VisageNonterminals_s17
st17 = let
v16 :: T_VisageNonterminals_v16
v16 :: T_VisageNonterminals_v16
v16 = \ (T_VisageNonterminals_vIn16
T_VisageNonterminals_vIn16 ) -> ( let
_lhsOaterms :: [ATerm]
_lhsOaterms :: [ATerm]
_lhsOaterms = () -> [ATerm]
forall a. () -> [a]
rule8 ()
__result_ :: T_VisageNonterminals_vOut16
__result_ = [ATerm] -> T_VisageNonterminals_vOut16
T_VisageNonterminals_vOut16 [ATerm]
_lhsOaterms
in T_VisageNonterminals_vOut16
__result_ )
in T_VisageNonterminals_v16 -> T_VisageNonterminals_s17
C_VisageNonterminals_s17 T_VisageNonterminals_v16
v16
{-# INLINE rule8 #-}
{-# LINE 59 "src-ag/Visage.ag" #-}
rule8 = \ (_ :: ()) ->
{-# LINE 59 "src-ag/Visage.ag" #-}
[]
{-# LINE 421 "src-generated/Visage.hs" #-}
data Inh_VisagePattern = Inh_VisagePattern { }
data Syn_VisagePattern = Syn_VisagePattern { Syn_VisagePattern -> ATerm
aterm_Syn_VisagePattern :: (ATerm) }
{-# INLINABLE wrap_VisagePattern #-}
wrap_VisagePattern :: T_VisagePattern -> Inh_VisagePattern -> (Syn_VisagePattern )
wrap_VisagePattern :: T_VisagePattern -> Inh_VisagePattern -> Syn_VisagePattern
wrap_VisagePattern (T_VisagePattern Identity T_VisagePattern_s20
act) (Inh_VisagePattern
Inh_VisagePattern ) =
Identity Syn_VisagePattern -> Syn_VisagePattern
forall a. Identity a -> a
Control.Monad.Identity.runIdentity (
do T_VisagePattern_s20
sem <- Identity T_VisagePattern_s20
act
let arg19 :: T_VisagePattern_vIn19
arg19 = T_VisagePattern_vIn19
T_VisagePattern_vIn19
(T_VisagePattern_vOut19 ATerm
_lhsOaterm) <- T_VisagePattern_vOut19 -> Identity T_VisagePattern_vOut19
forall (m :: * -> *) a. Monad m => a -> m a
return (T_VisagePattern_s20 -> T_VisagePattern_v19
inv_VisagePattern_s20 T_VisagePattern_s20
sem T_VisagePattern_vIn19
arg19)
Syn_VisagePattern -> Identity Syn_VisagePattern
forall (m :: * -> *) a. Monad m => a -> m a
return (ATerm -> Syn_VisagePattern
Syn_VisagePattern ATerm
_lhsOaterm)
)
{-# NOINLINE sem_VisagePattern #-}
sem_VisagePattern :: VisagePattern -> T_VisagePattern
sem_VisagePattern :: VisagePattern -> T_VisagePattern
sem_VisagePattern ( VConstr Identifier
name_ VisagePatterns
pats_ ) = Identifier -> T_VisagePatterns -> T_VisagePattern
sem_VisagePattern_VConstr Identifier
name_ ( VisagePatterns -> T_VisagePatterns
sem_VisagePatterns VisagePatterns
pats_ )
sem_VisagePattern ( VProduct Pos
pos_ VisagePatterns
pats_ ) = Pos -> T_VisagePatterns -> T_VisagePattern
sem_VisagePattern_VProduct Pos
pos_ ( VisagePatterns -> T_VisagePatterns
sem_VisagePatterns VisagePatterns
pats_ )
sem_VisagePattern ( VVar Identifier
field_ Identifier
attr_ ) = Identifier -> Identifier -> T_VisagePattern
sem_VisagePattern_VVar Identifier
field_ Identifier
attr_
sem_VisagePattern ( VAlias Identifier
field_ Identifier
attr_ VisagePattern
pat_ ) = Identifier -> Identifier -> T_VisagePattern -> T_VisagePattern
sem_VisagePattern_VAlias Identifier
field_ Identifier
attr_ ( VisagePattern -> T_VisagePattern
sem_VisagePattern VisagePattern
pat_ )
sem_VisagePattern ( VUnderscore Pos
pos_ ) = Pos -> T_VisagePattern
sem_VisagePattern_VUnderscore Pos
pos_
newtype T_VisagePattern = T_VisagePattern {
T_VisagePattern -> Identity T_VisagePattern_s20
attach_T_VisagePattern :: Identity (T_VisagePattern_s20 )
}
newtype T_VisagePattern_s20 = C_VisagePattern_s20 {
T_VisagePattern_s20 -> T_VisagePattern_v19
inv_VisagePattern_s20 :: (T_VisagePattern_v19 )
}
data T_VisagePattern_s21 = C_VisagePattern_s21
type T_VisagePattern_v19 = (T_VisagePattern_vIn19 ) -> (T_VisagePattern_vOut19 )
data T_VisagePattern_vIn19 = T_VisagePattern_vIn19
data T_VisagePattern_vOut19 = T_VisagePattern_vOut19 (ATerm)
{-# NOINLINE sem_VisagePattern_VConstr #-}
sem_VisagePattern_VConstr :: (ConstructorIdent) -> T_VisagePatterns -> T_VisagePattern
sem_VisagePattern_VConstr :: Identifier -> T_VisagePatterns -> T_VisagePattern
sem_VisagePattern_VConstr Identifier
arg_name_ T_VisagePatterns
arg_pats_ = Identity T_VisagePattern_s20 -> T_VisagePattern
T_VisagePattern (T_VisagePattern_s20 -> Identity T_VisagePattern_s20
forall (m :: * -> *) a. Monad m => a -> m a
return T_VisagePattern_s20
st20) where
{-# NOINLINE st20 #-}
st20 :: T_VisagePattern_s20
st20 = let
v19 :: T_VisagePattern_v19
v19 :: T_VisagePattern_v19
v19 = \ (T_VisagePattern_vIn19
T_VisagePattern_vIn19 ) -> ( let
_patsX23 :: T_VisagePatterns_s23
_patsX23 = Identity T_VisagePatterns_s23 -> T_VisagePatterns_s23
forall a. Identity a -> a
Control.Monad.Identity.runIdentity (T_VisagePatterns -> Identity T_VisagePatterns_s23
attach_T_VisagePatterns (T_VisagePatterns
arg_pats_))
(T_VisagePatterns_vOut22 [ATerm]
_patsIaterms) = T_VisagePatterns_s23 -> T_VisagePatterns_v22
inv_VisagePatterns_s23 T_VisagePatterns_s23
_patsX23 (T_VisagePatterns_vIn22
T_VisagePatterns_vIn22 )
_lhsOaterm :: ATerm
_lhsOaterm :: ATerm
_lhsOaterm = [ATerm] -> Identifier -> ATerm
rule9 [ATerm]
_patsIaterms Identifier
arg_name_
__result_ :: T_VisagePattern_vOut19
__result_ = ATerm -> T_VisagePattern_vOut19
T_VisagePattern_vOut19 ATerm
_lhsOaterm
in T_VisagePattern_vOut19
__result_ )
in T_VisagePattern_v19 -> T_VisagePattern_s20
C_VisagePattern_s20 T_VisagePattern_v19
v19
{-# INLINE rule9 #-}
{-# LINE 112 "src-ag/Visage.ag" #-}
rule9 = \ ((_patsIaterms) :: [ATerm]) name_ ->
{-# LINE 112 "src-ag/Visage.ag" #-}
AAppl "Pattern" [AAppl "Constr" [AString (sQ (showAGPos (getPos name_))),
AString (sQ (getName name_)),
AAppl "Patterns" _patsIaterms]]
{-# LINE 478 "src-generated/Visage.hs" #-}
{-# NOINLINE sem_VisagePattern_VProduct #-}
sem_VisagePattern_VProduct :: (Pos) -> T_VisagePatterns -> T_VisagePattern
sem_VisagePattern_VProduct :: Pos -> T_VisagePatterns -> T_VisagePattern
sem_VisagePattern_VProduct Pos
arg_pos_ T_VisagePatterns
arg_pats_ = Identity T_VisagePattern_s20 -> T_VisagePattern
T_VisagePattern (T_VisagePattern_s20 -> Identity T_VisagePattern_s20
forall (m :: * -> *) a. Monad m => a -> m a
return T_VisagePattern_s20
st20) where
{-# NOINLINE st20 #-}
st20 :: T_VisagePattern_s20
st20 = let
v19 :: T_VisagePattern_v19
v19 :: T_VisagePattern_v19
v19 = \ (T_VisagePattern_vIn19
T_VisagePattern_vIn19 ) -> ( let
_patsX23 :: T_VisagePatterns_s23
_patsX23 = Identity T_VisagePatterns_s23 -> T_VisagePatterns_s23
forall a. Identity a -> a
Control.Monad.Identity.runIdentity (T_VisagePatterns -> Identity T_VisagePatterns_s23
attach_T_VisagePatterns (T_VisagePatterns
arg_pats_))
(T_VisagePatterns_vOut22 [ATerm]
_patsIaterms) = T_VisagePatterns_s23 -> T_VisagePatterns_v22
inv_VisagePatterns_s23 T_VisagePatterns_s23
_patsX23 (T_VisagePatterns_vIn22
T_VisagePatterns_vIn22 )
_lhsOaterm :: ATerm
_lhsOaterm :: ATerm
_lhsOaterm = [ATerm] -> Pos -> ATerm
rule10 [ATerm]
_patsIaterms Pos
arg_pos_
__result_ :: T_VisagePattern_vOut19
__result_ = ATerm -> T_VisagePattern_vOut19
T_VisagePattern_vOut19 ATerm
_lhsOaterm
in T_VisagePattern_vOut19
__result_ )
in T_VisagePattern_v19 -> T_VisagePattern_s20
C_VisagePattern_s20 T_VisagePattern_v19
v19
{-# INLINE rule10 #-}
{-# LINE 115 "src-ag/Visage.ag" #-}
rule10 = \ ((_patsIaterms) :: [ATerm]) pos_ ->
{-# LINE 115 "src-ag/Visage.ag" #-}
AAppl "Pattern" [AAppl "Product" [AString (sQ (showAGPos pos_)),
AAppl "Patterns" _patsIaterms]]
{-# LINE 499 "src-generated/Visage.hs" #-}
{-# NOINLINE sem_VisagePattern_VVar #-}
sem_VisagePattern_VVar :: (Identifier) -> (Identifier) -> T_VisagePattern
sem_VisagePattern_VVar :: Identifier -> Identifier -> T_VisagePattern
sem_VisagePattern_VVar Identifier
arg_field_ Identifier
arg_attr_ = Identity T_VisagePattern_s20 -> T_VisagePattern
T_VisagePattern (T_VisagePattern_s20 -> Identity T_VisagePattern_s20
forall (m :: * -> *) a. Monad m => a -> m a
return T_VisagePattern_s20
st20) where
{-# NOINLINE st20 #-}
st20 :: T_VisagePattern_s20
st20 = let
v19 :: T_VisagePattern_v19
v19 :: T_VisagePattern_v19
v19 = \ (T_VisagePattern_vIn19
T_VisagePattern_vIn19 ) -> ( let
_lhsOaterm :: ATerm
_lhsOaterm :: ATerm
_lhsOaterm = Identifier -> Identifier -> ATerm
rule11 Identifier
arg_attr_ Identifier
arg_field_
__result_ :: T_VisagePattern_vOut19
__result_ = ATerm -> T_VisagePattern_vOut19
T_VisagePattern_vOut19 ATerm
_lhsOaterm
in T_VisagePattern_vOut19
__result_ )
in T_VisagePattern_v19 -> T_VisagePattern_s20
C_VisagePattern_s20 T_VisagePattern_v19
v19
{-# INLINE rule11 #-}
{-# LINE 117 "src-ag/Visage.ag" #-}
rule11 = \ attr_ field_ ->
{-# LINE 117 "src-ag/Visage.ag" #-}
AAppl "Pattern" [AAppl "Var" [AString (sQ (showAGPos (getPos field_))),
AString (sQ (getName field_ ++ "." ++ getName attr_))]]
{-# LINE 518 "src-generated/Visage.hs" #-}
{-# NOINLINE sem_VisagePattern_VAlias #-}
sem_VisagePattern_VAlias :: (Identifier) -> (Identifier) -> T_VisagePattern -> T_VisagePattern
sem_VisagePattern_VAlias :: Identifier -> Identifier -> T_VisagePattern -> T_VisagePattern
sem_VisagePattern_VAlias Identifier
arg_field_ Identifier
arg_attr_ T_VisagePattern
arg_pat_ = Identity T_VisagePattern_s20 -> T_VisagePattern
T_VisagePattern (T_VisagePattern_s20 -> Identity T_VisagePattern_s20
forall (m :: * -> *) a. Monad m => a -> m a
return T_VisagePattern_s20
st20) where
{-# NOINLINE st20 #-}
st20 :: T_VisagePattern_s20
st20 = let
v19 :: T_VisagePattern_v19
v19 :: T_VisagePattern_v19
v19 = \ (T_VisagePattern_vIn19
T_VisagePattern_vIn19 ) -> ( let
_patX20 :: T_VisagePattern_s20
_patX20 = Identity T_VisagePattern_s20 -> T_VisagePattern_s20
forall a. Identity a -> a
Control.Monad.Identity.runIdentity (T_VisagePattern -> Identity T_VisagePattern_s20
attach_T_VisagePattern (T_VisagePattern
arg_pat_))
(T_VisagePattern_vOut19 ATerm
_patIaterm) = T_VisagePattern_s20 -> T_VisagePattern_v19
inv_VisagePattern_s20 T_VisagePattern_s20
_patX20 (T_VisagePattern_vIn19
T_VisagePattern_vIn19 )
_lhsOaterm :: ATerm
_lhsOaterm :: ATerm
_lhsOaterm = ATerm -> Identifier -> Identifier -> ATerm
rule12 ATerm
_patIaterm Identifier
arg_attr_ Identifier
arg_field_
__result_ :: T_VisagePattern_vOut19
__result_ = ATerm -> T_VisagePattern_vOut19
T_VisagePattern_vOut19 ATerm
_lhsOaterm
in T_VisagePattern_vOut19
__result_ )
in T_VisagePattern_v19 -> T_VisagePattern_s20
C_VisagePattern_s20 T_VisagePattern_v19
v19
{-# INLINE rule12 #-}
{-# LINE 119 "src-ag/Visage.ag" #-}
rule12 = \ ((_patIaterm) :: ATerm) attr_ field_ ->
{-# LINE 119 "src-ag/Visage.ag" #-}
AAppl "Pattern" [AAppl "Alias" [AString (sQ (showAGPos (getPos field_))),
AString (sQ (getName field_ ++ "." ++ getName attr_)), _patIaterm]]
{-# LINE 539 "src-generated/Visage.hs" #-}
{-# NOINLINE sem_VisagePattern_VUnderscore #-}
sem_VisagePattern_VUnderscore :: (Pos) -> T_VisagePattern
sem_VisagePattern_VUnderscore :: Pos -> T_VisagePattern
sem_VisagePattern_VUnderscore Pos
arg_pos_ = Identity T_VisagePattern_s20 -> T_VisagePattern
T_VisagePattern (T_VisagePattern_s20 -> Identity T_VisagePattern_s20
forall (m :: * -> *) a. Monad m => a -> m a
return T_VisagePattern_s20
st20) where
{-# NOINLINE st20 #-}
st20 :: T_VisagePattern_s20
st20 = let
v19 :: T_VisagePattern_v19
v19 :: T_VisagePattern_v19
v19 = \ (T_VisagePattern_vIn19
T_VisagePattern_vIn19 ) -> ( let
_lhsOaterm :: ATerm
_lhsOaterm :: ATerm
_lhsOaterm = Pos -> ATerm
rule13 Pos
arg_pos_
__result_ :: T_VisagePattern_vOut19
__result_ = ATerm -> T_VisagePattern_vOut19
T_VisagePattern_vOut19 ATerm
_lhsOaterm
in T_VisagePattern_vOut19
__result_ )
in T_VisagePattern_v19 -> T_VisagePattern_s20
C_VisagePattern_s20 T_VisagePattern_v19
v19
{-# INLINE rule13 #-}
{-# LINE 121 "src-ag/Visage.ag" #-}
rule13 = \ pos_ ->
{-# LINE 121 "src-ag/Visage.ag" #-}
AAppl "Pattern" [AAppl "Underscore" [AString (sQ (showAGPos pos_))]]
{-# LINE 557 "src-generated/Visage.hs" #-}
data Inh_VisagePatterns = Inh_VisagePatterns { }
data Syn_VisagePatterns = Syn_VisagePatterns { Syn_VisagePatterns -> [ATerm]
aterms_Syn_VisagePatterns :: ([ATerm]) }
{-# INLINABLE wrap_VisagePatterns #-}
wrap_VisagePatterns :: T_VisagePatterns -> Inh_VisagePatterns -> (Syn_VisagePatterns )
wrap_VisagePatterns :: T_VisagePatterns -> Inh_VisagePatterns -> Syn_VisagePatterns
wrap_VisagePatterns (T_VisagePatterns Identity T_VisagePatterns_s23
act) (Inh_VisagePatterns
Inh_VisagePatterns ) =
Identity Syn_VisagePatterns -> Syn_VisagePatterns
forall a. Identity a -> a
Control.Monad.Identity.runIdentity (
do T_VisagePatterns_s23
sem <- Identity T_VisagePatterns_s23
act
let arg22 :: T_VisagePatterns_vIn22
arg22 = T_VisagePatterns_vIn22
T_VisagePatterns_vIn22
(T_VisagePatterns_vOut22 [ATerm]
_lhsOaterms) <- T_VisagePatterns_vOut22 -> Identity T_VisagePatterns_vOut22
forall (m :: * -> *) a. Monad m => a -> m a
return (T_VisagePatterns_s23 -> T_VisagePatterns_v22
inv_VisagePatterns_s23 T_VisagePatterns_s23
sem T_VisagePatterns_vIn22
arg22)
Syn_VisagePatterns -> Identity Syn_VisagePatterns
forall (m :: * -> *) a. Monad m => a -> m a
return ([ATerm] -> Syn_VisagePatterns
Syn_VisagePatterns [ATerm]
_lhsOaterms)
)
{-# NOINLINE sem_VisagePatterns #-}
sem_VisagePatterns :: VisagePatterns -> T_VisagePatterns
sem_VisagePatterns :: VisagePatterns -> T_VisagePatterns
sem_VisagePatterns VisagePatterns
list = (T_VisagePattern -> T_VisagePatterns -> T_VisagePatterns)
-> T_VisagePatterns -> [T_VisagePattern] -> T_VisagePatterns
forall (t :: * -> *) a b.
Foldable t =>
(a -> b -> b) -> b -> t a -> b
Prelude.foldr T_VisagePattern -> T_VisagePatterns -> T_VisagePatterns
sem_VisagePatterns_Cons T_VisagePatterns
sem_VisagePatterns_Nil ((VisagePattern -> T_VisagePattern)
-> VisagePatterns -> [T_VisagePattern]
forall a b. (a -> b) -> [a] -> [b]
Prelude.map VisagePattern -> T_VisagePattern
sem_VisagePattern VisagePatterns
list)
newtype T_VisagePatterns = T_VisagePatterns {
T_VisagePatterns -> Identity T_VisagePatterns_s23
attach_T_VisagePatterns :: Identity (T_VisagePatterns_s23 )
}
newtype T_VisagePatterns_s23 = C_VisagePatterns_s23 {
T_VisagePatterns_s23 -> T_VisagePatterns_v22
inv_VisagePatterns_s23 :: (T_VisagePatterns_v22 )
}
data T_VisagePatterns_s24 = C_VisagePatterns_s24
type T_VisagePatterns_v22 = (T_VisagePatterns_vIn22 ) -> (T_VisagePatterns_vOut22 )
data T_VisagePatterns_vIn22 = T_VisagePatterns_vIn22
data T_VisagePatterns_vOut22 = T_VisagePatterns_vOut22 ([ATerm])
{-# NOINLINE sem_VisagePatterns_Cons #-}
sem_VisagePatterns_Cons :: T_VisagePattern -> T_VisagePatterns -> T_VisagePatterns
sem_VisagePatterns_Cons :: T_VisagePattern -> T_VisagePatterns -> T_VisagePatterns
sem_VisagePatterns_Cons T_VisagePattern
arg_hd_ T_VisagePatterns
arg_tl_ = Identity T_VisagePatterns_s23 -> T_VisagePatterns
T_VisagePatterns (T_VisagePatterns_s23 -> Identity T_VisagePatterns_s23
forall (m :: * -> *) a. Monad m => a -> m a
return T_VisagePatterns_s23
st23) where
{-# NOINLINE st23 #-}
st23 :: T_VisagePatterns_s23
st23 = let
v22 :: T_VisagePatterns_v22
v22 :: T_VisagePatterns_v22
v22 = \ (T_VisagePatterns_vIn22
T_VisagePatterns_vIn22 ) -> ( let
_hdX20 :: T_VisagePattern_s20
_hdX20 = Identity T_VisagePattern_s20 -> T_VisagePattern_s20
forall a. Identity a -> a
Control.Monad.Identity.runIdentity (T_VisagePattern -> Identity T_VisagePattern_s20
attach_T_VisagePattern (T_VisagePattern
arg_hd_))
_tlX23 :: T_VisagePatterns_s23
_tlX23 = Identity T_VisagePatterns_s23 -> T_VisagePatterns_s23
forall a. Identity a -> a
Control.Monad.Identity.runIdentity (T_VisagePatterns -> Identity T_VisagePatterns_s23
attach_T_VisagePatterns (T_VisagePatterns
arg_tl_))
(T_VisagePattern_vOut19 ATerm
_hdIaterm) = T_VisagePattern_s20 -> T_VisagePattern_v19
inv_VisagePattern_s20 T_VisagePattern_s20
_hdX20 (T_VisagePattern_vIn19
T_VisagePattern_vIn19 )
(T_VisagePatterns_vOut22 [ATerm]
_tlIaterms) = T_VisagePatterns_s23 -> T_VisagePatterns_v22
inv_VisagePatterns_s23 T_VisagePatterns_s23
_tlX23 (T_VisagePatterns_vIn22
T_VisagePatterns_vIn22 )
_lhsOaterms :: [ATerm]
_lhsOaterms :: [ATerm]
_lhsOaterms = ATerm -> [ATerm] -> [ATerm]
rule14 ATerm
_hdIaterm [ATerm]
_tlIaterms
__result_ :: T_VisagePatterns_vOut22
__result_ = [ATerm] -> T_VisagePatterns_vOut22
T_VisagePatterns_vOut22 [ATerm]
_lhsOaterms
in T_VisagePatterns_vOut22
__result_ )
in T_VisagePatterns_v22 -> T_VisagePatterns_s23
C_VisagePatterns_s23 T_VisagePatterns_v22
v22
{-# INLINE rule14 #-}
{-# LINE 107 "src-ag/Visage.ag" #-}
rule14 = \ ((_hdIaterm) :: ATerm) ((_tlIaterms) :: [ATerm]) ->
{-# LINE 107 "src-ag/Visage.ag" #-}
_hdIaterm : _tlIaterms
{-# LINE 610 "src-generated/Visage.hs" #-}
{-# NOINLINE sem_VisagePatterns_Nil #-}
sem_VisagePatterns_Nil :: T_VisagePatterns
sem_VisagePatterns_Nil :: T_VisagePatterns
sem_VisagePatterns_Nil = Identity T_VisagePatterns_s23 -> T_VisagePatterns
T_VisagePatterns (T_VisagePatterns_s23 -> Identity T_VisagePatterns_s23
forall (m :: * -> *) a. Monad m => a -> m a
return T_VisagePatterns_s23
st23) where
{-# NOINLINE st23 #-}
st23 :: T_VisagePatterns_s23
st23 = let
v22 :: T_VisagePatterns_v22
v22 :: T_VisagePatterns_v22
v22 = \ (T_VisagePatterns_vIn22
T_VisagePatterns_vIn22 ) -> ( let
_lhsOaterms :: [ATerm]
_lhsOaterms :: [ATerm]
_lhsOaterms = () -> [ATerm]
forall a. () -> [a]
rule15 ()
__result_ :: T_VisagePatterns_vOut22
__result_ = [ATerm] -> T_VisagePatterns_vOut22
T_VisagePatterns_vOut22 [ATerm]
_lhsOaterms
in T_VisagePatterns_vOut22
__result_ )
in T_VisagePatterns_v22 -> T_VisagePatterns_s23
C_VisagePatterns_s23 T_VisagePatterns_v22
v22
{-# INLINE rule15 #-}
{-# LINE 108 "src-ag/Visage.ag" #-}
rule15 = \ (_ :: ()) ->
{-# LINE 108 "src-ag/Visage.ag" #-}
[]
{-# LINE 628 "src-generated/Visage.hs" #-}
data Inh_VisageProduction = Inh_VisageProduction { }
data Syn_VisageProduction = Syn_VisageProduction { Syn_VisageProduction -> ATerm
aterm_Syn_VisageProduction :: (ATerm) }
{-# INLINABLE wrap_VisageProduction #-}
wrap_VisageProduction :: T_VisageProduction -> Inh_VisageProduction -> (Syn_VisageProduction )
wrap_VisageProduction :: T_VisageProduction -> Inh_VisageProduction -> Syn_VisageProduction
wrap_VisageProduction (T_VisageProduction Identity T_VisageProduction_s26
act) (Inh_VisageProduction
Inh_VisageProduction ) =
Identity Syn_VisageProduction -> Syn_VisageProduction
forall a. Identity a -> a
Control.Monad.Identity.runIdentity (
do T_VisageProduction_s26
sem <- Identity T_VisageProduction_s26
act
let arg25 :: T_VisageProduction_vIn25
arg25 = T_VisageProduction_vIn25
T_VisageProduction_vIn25
(T_VisageProduction_vOut25 ATerm
_lhsOaterm) <- T_VisageProduction_vOut25 -> Identity T_VisageProduction_vOut25
forall (m :: * -> *) a. Monad m => a -> m a
return (T_VisageProduction_s26 -> T_VisageProduction_v25
inv_VisageProduction_s26 T_VisageProduction_s26
sem T_VisageProduction_vIn25
arg25)
Syn_VisageProduction -> Identity Syn_VisageProduction
forall (m :: * -> *) a. Monad m => a -> m a
return (ATerm -> Syn_VisageProduction
Syn_VisageProduction ATerm
_lhsOaterm)
)
{-# INLINE sem_VisageProduction #-}
sem_VisageProduction :: VisageProduction -> T_VisageProduction
sem_VisageProduction :: VisageProduction -> T_VisageProduction
sem_VisageProduction ( VProduction Identifier
con_ VisageChildren
children_ VisageRules
rules_ VisageRules
locrules_ ) = Identifier
-> T_VisageChildren
-> T_VisageRules
-> T_VisageRules
-> T_VisageProduction
sem_VisageProduction_VProduction Identifier
con_ ( VisageChildren -> T_VisageChildren
sem_VisageChildren VisageChildren
children_ ) ( VisageRules -> T_VisageRules
sem_VisageRules VisageRules
rules_ ) ( VisageRules -> T_VisageRules
sem_VisageRules VisageRules
locrules_ )
newtype T_VisageProduction = T_VisageProduction {
T_VisageProduction -> Identity T_VisageProduction_s26
attach_T_VisageProduction :: Identity (T_VisageProduction_s26 )
}
newtype T_VisageProduction_s26 = C_VisageProduction_s26 {
T_VisageProduction_s26 -> T_VisageProduction_v25
inv_VisageProduction_s26 :: (T_VisageProduction_v25 )
}
data T_VisageProduction_s27 = C_VisageProduction_s27
type T_VisageProduction_v25 = (T_VisageProduction_vIn25 ) -> (T_VisageProduction_vOut25 )
data T_VisageProduction_vIn25 = T_VisageProduction_vIn25
data T_VisageProduction_vOut25 = T_VisageProduction_vOut25 (ATerm)
{-# NOINLINE sem_VisageProduction_VProduction #-}
sem_VisageProduction_VProduction :: (ConstructorIdent) -> T_VisageChildren -> T_VisageRules -> T_VisageRules -> T_VisageProduction
sem_VisageProduction_VProduction :: Identifier
-> T_VisageChildren
-> T_VisageRules
-> T_VisageRules
-> T_VisageProduction
sem_VisageProduction_VProduction Identifier
arg_con_ T_VisageChildren
arg_children_ T_VisageRules
arg_rules_ T_VisageRules
arg_locrules_ = Identity T_VisageProduction_s26 -> T_VisageProduction
T_VisageProduction (T_VisageProduction_s26 -> Identity T_VisageProduction_s26
forall (m :: * -> *) a. Monad m => a -> m a
return T_VisageProduction_s26
st26) where
{-# NOINLINE st26 #-}
st26 :: T_VisageProduction_s26
st26 = let
v25 :: T_VisageProduction_v25
v25 :: T_VisageProduction_v25
v25 = \ (T_VisageProduction_vIn25
T_VisageProduction_vIn25 ) -> ( let
_childrenX8 :: T_VisageChildren_s8
_childrenX8 = Identity T_VisageChildren_s8 -> T_VisageChildren_s8
forall a. Identity a -> a
Control.Monad.Identity.runIdentity (T_VisageChildren -> Identity T_VisageChildren_s8
attach_T_VisageChildren (T_VisageChildren
arg_children_))
_rulesX35 :: T_VisageRules_s35
_rulesX35 = Identity T_VisageRules_s35 -> T_VisageRules_s35
forall a. Identity a -> a
Control.Monad.Identity.runIdentity (T_VisageRules -> Identity T_VisageRules_s35
attach_T_VisageRules (T_VisageRules
arg_rules_))
_locrulesX35 :: T_VisageRules_s35
_locrulesX35 = Identity T_VisageRules_s35 -> T_VisageRules_s35
forall a. Identity a -> a
Control.Monad.Identity.runIdentity (T_VisageRules -> Identity T_VisageRules_s35
attach_T_VisageRules (T_VisageRules
arg_locrules_))
(T_VisageChildren_vOut7 [ATerm]
_childrenIaterms) = T_VisageChildren_s8 -> T_VisageChildren_v7
inv_VisageChildren_s8 T_VisageChildren_s8
_childrenX8 (T_VisageChildren_vIn7
T_VisageChildren_vIn7 )
(T_VisageRules_vOut34 [ATerm]
_rulesIaterms) = T_VisageRules_s35 -> T_VisageRules_v34
inv_VisageRules_s35 T_VisageRules_s35
_rulesX35 (Bool -> T_VisageRules_vIn34
T_VisageRules_vIn34 Bool
_rulesOisLoc)
(T_VisageRules_vOut34 [ATerm]
_locrulesIaterms) = T_VisageRules_s35 -> T_VisageRules_v34
inv_VisageRules_s35 T_VisageRules_s35
_locrulesX35 (Bool -> T_VisageRules_vIn34
T_VisageRules_vIn34 Bool
_locrulesOisLoc)
_lhsOaterm :: ATerm
_lhsOaterm :: ATerm
_lhsOaterm = [ATerm] -> [ATerm] -> [ATerm] -> Identifier -> ATerm
rule16 [ATerm]
_childrenIaterms [ATerm]
_locrulesIaterms [ATerm]
_rulesIaterms Identifier
arg_con_
_locrulesOisLoc :: Bool
_locrulesOisLoc = () -> Bool
rule17 ()
_rulesOisLoc :: Bool
_rulesOisLoc = () -> Bool
rule18 ()
__result_ :: T_VisageProduction_vOut25
__result_ = ATerm -> T_VisageProduction_vOut25
T_VisageProduction_vOut25 ATerm
_lhsOaterm
in T_VisageProduction_vOut25
__result_ )
in T_VisageProduction_v25 -> T_VisageProduction_s26
C_VisageProduction_s26 T_VisageProduction_v25
v25
{-# INLINE rule16 #-}
{-# LINE 73 "src-ag/Visage.ag" #-}
rule16 = \ ((_childrenIaterms) :: [ATerm]) ((_locrulesIaterms) :: [ATerm]) ((_rulesIaterms) :: [ATerm]) con_ ->
{-# LINE 73 "src-ag/Visage.ag" #-}
AAppl "Alternative" [AString (sQ (getName con_)), AAppl "Children" _childrenIaterms,
AAppl "Rules" _rulesIaterms,
AAppl "LocRules" _locrulesIaterms]
{-# LINE 687 "src-generated/Visage.hs" #-}
{-# INLINE rule17 #-}
{-# LINE 76 "src-ag/Visage.ag" #-}
rule17 = \ (_ :: ()) ->
{-# LINE 76 "src-ag/Visage.ag" #-}
True
{-# LINE 693 "src-generated/Visage.hs" #-}
{-# INLINE rule18 #-}
{-# LINE 77 "src-ag/Visage.ag" #-}
rule18 = \ (_ :: ()) ->
{-# LINE 77 "src-ag/Visage.ag" #-}
False
{-# LINE 699 "src-generated/Visage.hs" #-}
data Inh_VisageProductions = Inh_VisageProductions { }
data Syn_VisageProductions = Syn_VisageProductions { Syn_VisageProductions -> [ATerm]
aterms_Syn_VisageProductions :: ([ATerm]) }
{-# INLINABLE wrap_VisageProductions #-}
wrap_VisageProductions :: T_VisageProductions -> Inh_VisageProductions -> (Syn_VisageProductions )
wrap_VisageProductions :: T_VisageProductions
-> Inh_VisageProductions -> Syn_VisageProductions
wrap_VisageProductions (T_VisageProductions Identity T_VisageProductions_s29
act) (Inh_VisageProductions
Inh_VisageProductions ) =
Identity Syn_VisageProductions -> Syn_VisageProductions
forall a. Identity a -> a
Control.Monad.Identity.runIdentity (
do T_VisageProductions_s29
sem <- Identity T_VisageProductions_s29
act
let arg28 :: T_VisageProductions_vIn28
arg28 = T_VisageProductions_vIn28
T_VisageProductions_vIn28
(T_VisageProductions_vOut28 [ATerm]
_lhsOaterms) <- T_VisageProductions_vOut28 -> Identity T_VisageProductions_vOut28
forall (m :: * -> *) a. Monad m => a -> m a
return (T_VisageProductions_s29 -> T_VisageProductions_v28
inv_VisageProductions_s29 T_VisageProductions_s29
sem T_VisageProductions_vIn28
arg28)
Syn_VisageProductions -> Identity Syn_VisageProductions
forall (m :: * -> *) a. Monad m => a -> m a
return ([ATerm] -> Syn_VisageProductions
Syn_VisageProductions [ATerm]
_lhsOaterms)
)
{-# NOINLINE sem_VisageProductions #-}
sem_VisageProductions :: VisageProductions -> T_VisageProductions
sem_VisageProductions :: VisageProductions -> T_VisageProductions
sem_VisageProductions VisageProductions
list = (T_VisageProduction -> T_VisageProductions -> T_VisageProductions)
-> T_VisageProductions
-> [T_VisageProduction]
-> T_VisageProductions
forall (t :: * -> *) a b.
Foldable t =>
(a -> b -> b) -> b -> t a -> b
Prelude.foldr T_VisageProduction -> T_VisageProductions -> T_VisageProductions
sem_VisageProductions_Cons T_VisageProductions
sem_VisageProductions_Nil ((VisageProduction -> T_VisageProduction)
-> VisageProductions -> [T_VisageProduction]
forall a b. (a -> b) -> [a] -> [b]
Prelude.map VisageProduction -> T_VisageProduction
sem_VisageProduction VisageProductions
list)
newtype T_VisageProductions = T_VisageProductions {
T_VisageProductions -> Identity T_VisageProductions_s29
attach_T_VisageProductions :: Identity (T_VisageProductions_s29 )
}
newtype T_VisageProductions_s29 = C_VisageProductions_s29 {
T_VisageProductions_s29 -> T_VisageProductions_v28
inv_VisageProductions_s29 :: (T_VisageProductions_v28 )
}
data T_VisageProductions_s30 = C_VisageProductions_s30
type T_VisageProductions_v28 = (T_VisageProductions_vIn28 ) -> (T_VisageProductions_vOut28 )
data T_VisageProductions_vIn28 = T_VisageProductions_vIn28
data T_VisageProductions_vOut28 = T_VisageProductions_vOut28 ([ATerm])
{-# NOINLINE sem_VisageProductions_Cons #-}
sem_VisageProductions_Cons :: T_VisageProduction -> T_VisageProductions -> T_VisageProductions
sem_VisageProductions_Cons :: T_VisageProduction -> T_VisageProductions -> T_VisageProductions
sem_VisageProductions_Cons T_VisageProduction
arg_hd_ T_VisageProductions
arg_tl_ = Identity T_VisageProductions_s29 -> T_VisageProductions
T_VisageProductions (T_VisageProductions_s29 -> Identity T_VisageProductions_s29
forall (m :: * -> *) a. Monad m => a -> m a
return T_VisageProductions_s29
st29) where
{-# NOINLINE st29 #-}
st29 :: T_VisageProductions_s29
st29 = let
v28 :: T_VisageProductions_v28
v28 :: T_VisageProductions_v28
v28 = \ (T_VisageProductions_vIn28
T_VisageProductions_vIn28 ) -> ( let
_hdX26 :: T_VisageProduction_s26
_hdX26 = Identity T_VisageProduction_s26 -> T_VisageProduction_s26
forall a. Identity a -> a
Control.Monad.Identity.runIdentity (T_VisageProduction -> Identity T_VisageProduction_s26
attach_T_VisageProduction (T_VisageProduction
arg_hd_))
_tlX29 :: T_VisageProductions_s29
_tlX29 = Identity T_VisageProductions_s29 -> T_VisageProductions_s29
forall a. Identity a -> a
Control.Monad.Identity.runIdentity (T_VisageProductions -> Identity T_VisageProductions_s29
attach_T_VisageProductions (T_VisageProductions
arg_tl_))
(T_VisageProduction_vOut25 ATerm
_hdIaterm) = T_VisageProduction_s26 -> T_VisageProduction_v25
inv_VisageProduction_s26 T_VisageProduction_s26
_hdX26 (T_VisageProduction_vIn25
T_VisageProduction_vIn25 )
(T_VisageProductions_vOut28 [ATerm]
_tlIaterms) = T_VisageProductions_s29 -> T_VisageProductions_v28
inv_VisageProductions_s29 T_VisageProductions_s29
_tlX29 (T_VisageProductions_vIn28
T_VisageProductions_vIn28 )
_lhsOaterms :: [ATerm]
_lhsOaterms :: [ATerm]
_lhsOaterms = ATerm -> [ATerm] -> [ATerm]
rule19 ATerm
_hdIaterm [ATerm]
_tlIaterms
__result_ :: T_VisageProductions_vOut28
__result_ = [ATerm] -> T_VisageProductions_vOut28
T_VisageProductions_vOut28 [ATerm]
_lhsOaterms
in T_VisageProductions_vOut28
__result_ )
in T_VisageProductions_v28 -> T_VisageProductions_s29
C_VisageProductions_s29 T_VisageProductions_v28
v28
{-# INLINE rule19 #-}
{-# LINE 68 "src-ag/Visage.ag" #-}
rule19 = \ ((_hdIaterm) :: ATerm) ((_tlIaterms) :: [ATerm]) ->
{-# LINE 68 "src-ag/Visage.ag" #-}
_hdIaterm : _tlIaterms
{-# LINE 752 "src-generated/Visage.hs" #-}
{-# NOINLINE sem_VisageProductions_Nil #-}
sem_VisageProductions_Nil :: T_VisageProductions
sem_VisageProductions_Nil :: T_VisageProductions
sem_VisageProductions_Nil = Identity T_VisageProductions_s29 -> T_VisageProductions
T_VisageProductions (T_VisageProductions_s29 -> Identity T_VisageProductions_s29
forall (m :: * -> *) a. Monad m => a -> m a
return T_VisageProductions_s29
st29) where
{-# NOINLINE st29 #-}
st29 :: T_VisageProductions_s29
st29 = let
v28 :: T_VisageProductions_v28
v28 :: T_VisageProductions_v28
v28 = \ (T_VisageProductions_vIn28
T_VisageProductions_vIn28 ) -> ( let
_lhsOaterms :: [ATerm]
_lhsOaterms :: [ATerm]
_lhsOaterms = () -> [ATerm]
forall a. () -> [a]
rule20 ()
__result_ :: T_VisageProductions_vOut28
__result_ = [ATerm] -> T_VisageProductions_vOut28
T_VisageProductions_vOut28 [ATerm]
_lhsOaterms
in T_VisageProductions_vOut28
__result_ )
in T_VisageProductions_v28 -> T_VisageProductions_s29
C_VisageProductions_s29 T_VisageProductions_v28
v28
{-# INLINE rule20 #-}
{-# LINE 69 "src-ag/Visage.ag" #-}
rule20 = \ (_ :: ()) ->
{-# LINE 69 "src-ag/Visage.ag" #-}
[]
{-# LINE 770 "src-generated/Visage.hs" #-}
data Inh_VisageRule = Inh_VisageRule { Inh_VisageRule -> Bool
isLoc_Inh_VisageRule :: (Bool) }
data Syn_VisageRule = Syn_VisageRule { Syn_VisageRule -> ATerm
aterm_Syn_VisageRule :: (ATerm) }
{-# INLINABLE wrap_VisageRule #-}
wrap_VisageRule :: T_VisageRule -> Inh_VisageRule -> (Syn_VisageRule )
wrap_VisageRule :: T_VisageRule -> Inh_VisageRule -> Syn_VisageRule
wrap_VisageRule (T_VisageRule Identity T_VisageRule_s32
act) (Inh_VisageRule Bool
_lhsIisLoc) =
Identity Syn_VisageRule -> Syn_VisageRule
forall a. Identity a -> a
Control.Monad.Identity.runIdentity (
do T_VisageRule_s32
sem <- Identity T_VisageRule_s32
act
let arg31 :: T_VisageRule_vIn31
arg31 = Bool -> T_VisageRule_vIn31
T_VisageRule_vIn31 Bool
_lhsIisLoc
(T_VisageRule_vOut31 ATerm
_lhsOaterm) <- T_VisageRule_vOut31 -> Identity T_VisageRule_vOut31
forall (m :: * -> *) a. Monad m => a -> m a
return (T_VisageRule_s32 -> T_VisageRule_v31
inv_VisageRule_s32 T_VisageRule_s32
sem T_VisageRule_vIn31
arg31)
Syn_VisageRule -> Identity Syn_VisageRule
forall (m :: * -> *) a. Monad m => a -> m a
return (ATerm -> Syn_VisageRule
Syn_VisageRule ATerm
_lhsOaterm)
)
{-# INLINE sem_VisageRule #-}
sem_VisageRule :: VisageRule -> T_VisageRule
sem_VisageRule :: VisageRule -> T_VisageRule
sem_VisageRule ( VRule [(Identifier, Identifier)]
fieldattrs_ Identifier
attr_ VisagePattern
pat_ Expression
rhs_ Bool
owrt_ ) = [(Identifier, Identifier)]
-> Identifier
-> T_VisagePattern
-> T_Expression
-> Bool
-> T_VisageRule
sem_VisageRule_VRule [(Identifier, Identifier)]
fieldattrs_ Identifier
attr_ ( VisagePattern -> T_VisagePattern
sem_VisagePattern VisagePattern
pat_ ) ( Expression -> T_Expression
sem_Expression Expression
rhs_ ) Bool
owrt_
newtype T_VisageRule = T_VisageRule {
T_VisageRule -> Identity T_VisageRule_s32
attach_T_VisageRule :: Identity (T_VisageRule_s32 )
}
newtype T_VisageRule_s32 = C_VisageRule_s32 {
T_VisageRule_s32 -> T_VisageRule_v31
inv_VisageRule_s32 :: (T_VisageRule_v31 )
}
data T_VisageRule_s33 = C_VisageRule_s33
type T_VisageRule_v31 = (T_VisageRule_vIn31 ) -> (T_VisageRule_vOut31 )
data T_VisageRule_vIn31 = T_VisageRule_vIn31 (Bool)
data T_VisageRule_vOut31 = T_VisageRule_vOut31 (ATerm)
{-# NOINLINE sem_VisageRule_VRule #-}
sem_VisageRule_VRule :: ([(Identifier,Identifier)]) -> (Identifier) -> T_VisagePattern -> T_Expression -> (Bool) -> T_VisageRule
sem_VisageRule_VRule :: [(Identifier, Identifier)]
-> Identifier
-> T_VisagePattern
-> T_Expression
-> Bool
-> T_VisageRule
sem_VisageRule_VRule [(Identifier, Identifier)]
_ Identifier
arg_attr_ T_VisagePattern
arg_pat_ T_Expression
arg_rhs_ Bool
arg_owrt_ = Identity T_VisageRule_s32 -> T_VisageRule
T_VisageRule (T_VisageRule_s32 -> Identity T_VisageRule_s32
forall (m :: * -> *) a. Monad m => a -> m a
return T_VisageRule_s32
st32) where
{-# NOINLINE st32 #-}
st32 :: T_VisageRule_s32
st32 = let
v31 :: T_VisageRule_v31
v31 :: T_VisageRule_v31
v31 = \ (T_VisageRule_vIn31 Bool
_lhsIisLoc) -> ( let
_patX20 :: T_VisagePattern_s20
_patX20 = Identity T_VisagePattern_s20 -> T_VisagePattern_s20
forall a. Identity a -> a
Control.Monad.Identity.runIdentity (T_VisagePattern -> Identity T_VisagePattern_s20
attach_T_VisagePattern (T_VisagePattern
arg_pat_))
_rhsX2 :: T_Expression_s2
_rhsX2 = Identity T_Expression_s2 -> T_Expression_s2
forall a. Identity a -> a
Control.Monad.Identity.runIdentity (T_Expression -> Identity T_Expression_s2
attach_T_Expression (T_Expression
arg_rhs_))
(T_VisagePattern_vOut19 ATerm
_patIaterm) = T_VisagePattern_s20 -> T_VisagePattern_v19
inv_VisagePattern_s20 T_VisagePattern_s20
_patX20 (T_VisagePattern_vIn19
T_VisagePattern_vIn19 )
(T_Expression_vOut1 ATerm
_rhsIaterm) = T_Expression_s2 -> T_Expression_v1
inv_Expression_s2 T_Expression_s2
_rhsX2 (T_Expression_vIn1
T_Expression_vIn1 )
_lhsOaterm :: ATerm
_lhsOaterm :: ATerm
_lhsOaterm = Bool -> ATerm -> ATerm -> Identifier -> Bool -> ATerm
rule21 Bool
_lhsIisLoc ATerm
_patIaterm ATerm
_rhsIaterm Identifier
arg_attr_ Bool
arg_owrt_
__result_ :: T_VisageRule_vOut31
__result_ = ATerm -> T_VisageRule_vOut31
T_VisageRule_vOut31 ATerm
_lhsOaterm
in T_VisageRule_vOut31
__result_ )
in T_VisageRule_v31 -> T_VisageRule_s32
C_VisageRule_s32 T_VisageRule_v31
v31
{-# INLINE rule21 #-}
{-# LINE 97 "src-ag/Visage.ag" #-}
rule21 = \ ((_lhsIisLoc) :: Bool) ((_patIaterm) :: ATerm) ((_rhsIaterm) :: ATerm) attr_ owrt_ ->
{-# LINE 97 "src-ag/Visage.ag" #-}
AAppl (if _lhsIisLoc then "LocRule" else "Rule")
([AString (sQ (getName attr_)), _patIaterm, _rhsIaterm] ++ if _lhsIisLoc then [AString (sQ (show owrt_))] else [])
{-# LINE 824 "src-generated/Visage.hs" #-}
data Inh_VisageRules = Inh_VisageRules { Inh_VisageRules -> Bool
isLoc_Inh_VisageRules :: (Bool) }
data Syn_VisageRules = Syn_VisageRules { Syn_VisageRules -> [ATerm]
aterms_Syn_VisageRules :: ([ATerm]) }
{-# INLINABLE wrap_VisageRules #-}
wrap_VisageRules :: T_VisageRules -> Inh_VisageRules -> (Syn_VisageRules )
wrap_VisageRules :: T_VisageRules -> Inh_VisageRules -> Syn_VisageRules
wrap_VisageRules (T_VisageRules Identity T_VisageRules_s35
act) (Inh_VisageRules Bool
_lhsIisLoc) =
Identity Syn_VisageRules -> Syn_VisageRules
forall a. Identity a -> a
Control.Monad.Identity.runIdentity (
do T_VisageRules_s35
sem <- Identity T_VisageRules_s35
act
let arg34 :: T_VisageRules_vIn34
arg34 = Bool -> T_VisageRules_vIn34
T_VisageRules_vIn34 Bool
_lhsIisLoc
(T_VisageRules_vOut34 [ATerm]
_lhsOaterms) <- T_VisageRules_vOut34 -> Identity T_VisageRules_vOut34
forall (m :: * -> *) a. Monad m => a -> m a
return (T_VisageRules_s35 -> T_VisageRules_v34
inv_VisageRules_s35 T_VisageRules_s35
sem T_VisageRules_vIn34
arg34)
Syn_VisageRules -> Identity Syn_VisageRules
forall (m :: * -> *) a. Monad m => a -> m a
return ([ATerm] -> Syn_VisageRules
Syn_VisageRules [ATerm]
_lhsOaterms)
)
{-# NOINLINE sem_VisageRules #-}
sem_VisageRules :: VisageRules -> T_VisageRules
sem_VisageRules :: VisageRules -> T_VisageRules
sem_VisageRules VisageRules
list = (T_VisageRule -> T_VisageRules -> T_VisageRules)
-> T_VisageRules -> [T_VisageRule] -> T_VisageRules
forall (t :: * -> *) a b.
Foldable t =>
(a -> b -> b) -> b -> t a -> b
Prelude.foldr T_VisageRule -> T_VisageRules -> T_VisageRules
sem_VisageRules_Cons T_VisageRules
sem_VisageRules_Nil ((VisageRule -> T_VisageRule) -> VisageRules -> [T_VisageRule]
forall a b. (a -> b) -> [a] -> [b]
Prelude.map VisageRule -> T_VisageRule
sem_VisageRule VisageRules
list)
newtype T_VisageRules = T_VisageRules {
T_VisageRules -> Identity T_VisageRules_s35
attach_T_VisageRules :: Identity (T_VisageRules_s35 )
}
newtype T_VisageRules_s35 = C_VisageRules_s35 {
T_VisageRules_s35 -> T_VisageRules_v34
inv_VisageRules_s35 :: (T_VisageRules_v34 )
}
data T_VisageRules_s36 = C_VisageRules_s36
type T_VisageRules_v34 = (T_VisageRules_vIn34 ) -> (T_VisageRules_vOut34 )
data T_VisageRules_vIn34 = T_VisageRules_vIn34 (Bool)
data T_VisageRules_vOut34 = T_VisageRules_vOut34 ([ATerm])
{-# NOINLINE sem_VisageRules_Cons #-}
sem_VisageRules_Cons :: T_VisageRule -> T_VisageRules -> T_VisageRules
sem_VisageRules_Cons :: T_VisageRule -> T_VisageRules -> T_VisageRules
sem_VisageRules_Cons T_VisageRule
arg_hd_ T_VisageRules
arg_tl_ = Identity T_VisageRules_s35 -> T_VisageRules
T_VisageRules (T_VisageRules_s35 -> Identity T_VisageRules_s35
forall (m :: * -> *) a. Monad m => a -> m a
return T_VisageRules_s35
st35) where
{-# NOINLINE st35 #-}
st35 :: T_VisageRules_s35
st35 = let
v34 :: T_VisageRules_v34
v34 :: T_VisageRules_v34
v34 = \ (T_VisageRules_vIn34 Bool
_lhsIisLoc) -> ( let
_hdX32 :: T_VisageRule_s32
_hdX32 = Identity T_VisageRule_s32 -> T_VisageRule_s32
forall a. Identity a -> a
Control.Monad.Identity.runIdentity (T_VisageRule -> Identity T_VisageRule_s32
attach_T_VisageRule (T_VisageRule
arg_hd_))
_tlX35 :: T_VisageRules_s35
_tlX35 = Identity T_VisageRules_s35 -> T_VisageRules_s35
forall a. Identity a -> a
Control.Monad.Identity.runIdentity (T_VisageRules -> Identity T_VisageRules_s35
attach_T_VisageRules (T_VisageRules
arg_tl_))
(T_VisageRule_vOut31 ATerm
_hdIaterm) = T_VisageRule_s32 -> T_VisageRule_v31
inv_VisageRule_s32 T_VisageRule_s32
_hdX32 (Bool -> T_VisageRule_vIn31
T_VisageRule_vIn31 Bool
_hdOisLoc)
(T_VisageRules_vOut34 [ATerm]
_tlIaterms) = T_VisageRules_s35 -> T_VisageRules_v34
inv_VisageRules_s35 T_VisageRules_s35
_tlX35 (Bool -> T_VisageRules_vIn34
T_VisageRules_vIn34 Bool
_tlOisLoc)
_lhsOaterms :: [ATerm]
_lhsOaterms :: [ATerm]
_lhsOaterms = ATerm -> [ATerm] -> [ATerm]
rule22 ATerm
_hdIaterm [ATerm]
_tlIaterms
_hdOisLoc :: Bool
_hdOisLoc = Bool -> Bool
rule23 Bool
_lhsIisLoc
_tlOisLoc :: Bool
_tlOisLoc = Bool -> Bool
rule24 Bool
_lhsIisLoc
__result_ :: T_VisageRules_vOut34
__result_ = [ATerm] -> T_VisageRules_vOut34
T_VisageRules_vOut34 [ATerm]
_lhsOaterms
in T_VisageRules_vOut34
__result_ )
in T_VisageRules_v34 -> T_VisageRules_s35
C_VisageRules_s35 T_VisageRules_v34
v34
{-# INLINE rule22 #-}
{-# LINE 92 "src-ag/Visage.ag" #-}
rule22 = \ ((_hdIaterm) :: ATerm) ((_tlIaterms) :: [ATerm]) ->
{-# LINE 92 "src-ag/Visage.ag" #-}
_hdIaterm : _tlIaterms
{-# LINE 879 "src-generated/Visage.hs" #-}
{-# INLINE rule23 #-}
rule23 = \ ((_lhsIisLoc) :: Bool) ->
_lhsIisLoc
{-# INLINE rule24 #-}
rule24 = \ ((_lhsIisLoc) :: Bool) ->
_lhsIisLoc
{-# NOINLINE sem_VisageRules_Nil #-}
sem_VisageRules_Nil :: T_VisageRules
sem_VisageRules_Nil :: T_VisageRules
sem_VisageRules_Nil = Identity T_VisageRules_s35 -> T_VisageRules
T_VisageRules (T_VisageRules_s35 -> Identity T_VisageRules_s35
forall (m :: * -> *) a. Monad m => a -> m a
return T_VisageRules_s35
st35) where
{-# NOINLINE st35 #-}
st35 :: T_VisageRules_s35
st35 = let
v34 :: T_VisageRules_v34
v34 :: T_VisageRules_v34
v34 = \ (T_VisageRules_vIn34 Bool
_lhsIisLoc) -> ( let
_lhsOaterms :: [ATerm]
_lhsOaterms :: [ATerm]
_lhsOaterms = () -> [ATerm]
forall a. () -> [a]
rule25 ()
__result_ :: T_VisageRules_vOut34
__result_ = [ATerm] -> T_VisageRules_vOut34
T_VisageRules_vOut34 [ATerm]
_lhsOaterms
in T_VisageRules_vOut34
__result_ )
in T_VisageRules_v34 -> T_VisageRules_s35
C_VisageRules_s35 T_VisageRules_v34
v34
{-# INLINE rule25 #-}
{-# LINE 93 "src-ag/Visage.ag" #-}
rule25 = \ (_ :: ()) ->
{-# LINE 93 "src-ag/Visage.ag" #-}
[]
{-# LINE 903 "src-generated/Visage.hs" #-}