module Database.HsSqlPpp.Internals.AstInternal(
Statement (..)
,QueryExpr (..)
,WithQueryList
,WithQuery(..)
,FnBody (..)
,SetClause (..)
,SetClauseList
,TableRef (..)
,TableAlias(..)
,JoinExpr (..)
,JoinType (..)
,SelectList (..)
,SelectItem (..)
,CopySource (..)
,AttributeDef (..)
,RowConstraint (..)
,AlterTableAction(..)
,Constraint (..)
,TypeAttributeDef (..)
,ParamDef (..)
,VarDef (..)
,RaiseType (..)
,CombineType (..)
,Volatility (..)
,Language (..)
,TypeName (..)
,DropType (..)
,Cascade (..)
,Direction (..)
,Distinct (..)
,Natural (..)
,IfExists (..)
,Replace(..)
,RestartIdentity (..)
,ScalarExpr (..)
,Name(..)
,NameComponent(..)
,ncStr
,IntervalField(..)
,ExtractField(..)
,FrameClause(..)
,InList (..)
,LiftFlavour(..)
,TriggerWhen(..)
,TriggerEvent(..)
,TriggerFire(..)
,StatementList
,ScalarExprListStatementListPairList
,ScalarExprListStatementListPair
,ScalarExprList
,ParamDefList
,AttributeDefList
,ConstraintList
,TypeAttributeDefList
,TypeNameList
,NameTypeNameListPair
,NameTypeNameListPairList
,ScalarExprStatementListPairList
--,SetClauseList
,CaseScalarExprListScalarExprPairList
,MaybeScalarExpr
,TableRefList
,ScalarExprListList
,SelectItemList
,OnExpr
,RowConstraintList
,VarDefList
,ScalarExprStatementListPair
,CaseScalarExprListScalarExprPair
,ScalarExprDirectionPair
,ScalarExprDirectionPairList
,MaybeBoolExpr
,MaybeSelectList
,SetValue(..)
,AlterTableActionList
,NameComponentList
,MaybeNameComponentList
,typeCheckStatements
,typeCheckParameterizedStatement
,typeCheckScalarExpr
,typeCheckQueryExpr
,fixUpIdentifiers
,fixUpIdentifiersQE
,fixUpIdentifiersSE
) where
import Data.Maybe
import Data.Either
import Data.List
import Control.Applicative
import Data.Data
import Data.Char
import Control.Monad.State
import Control.Arrow
import Data.Generics.Uniplate.Data
import Debug.Trace
import Database.HsSqlPpp.Internals.TypeType
import Database.HsSqlPpp.Internals.TypeChecking.TypeConversion
import Database.HsSqlPpp.Internals.AstAnnotation
import Database.HsSqlPpp.Internals.Catalog.CatalogInternal
import Database.HsSqlPpp.Internals.TypeChecking.LocalBindings
import Database.HsSqlPpp.Internals.TypeChecking.ErrorUtils
import Database.HsSqlPpp.Utils.Utils
import Database.HsSqlPpp.Internals.TypeChecking.IDEnv
data NameComponent = Nmc String
| QNmc String
deriving (Data,Eq,Show,Typeable)
ncStr :: NameComponent -> String
ncStr (Nmc n) = n
ncStr (QNmc n) = n
data JoinType = Inner | LeftOuter| RightOuter | FullOuter | Cross
deriving (Show,Eq,Typeable,Data)
data CopySource = CopyFilename String
| Stdin
deriving (Show,Eq,Typeable,Data)
data SetValue
= SetStr Annotation String
| SetId Annotation String
| SetNum Annotation Double
deriving (Show,Eq,Typeable,Data)
data TriggerWhen = TriggerBefore | TriggerAfter
deriving (Show,Eq,Typeable,Data)
data TriggerEvent = TInsert| TUpdate | TDelete | AntiTriggerEvent String
deriving (Show,Eq,Typeable,Data)
data TriggerFire = EachRow | EachStatement
deriving (Show,Eq,Typeable,Data)
data RaiseType = RNotice | RException | RError
deriving (Show,Eq,Typeable,Data)
data CombineType = Except | Union | Intersect | UnionAll
deriving (Show,Eq,Typeable,Data)
data Volatility = Volatile | Stable | Immutable
deriving (Show,Eq,Typeable,Data)
data Language = Sql | Plpgsql
deriving (Show,Eq,Typeable,Data)
data DropType = Table
| Domain
| View
| Type
deriving (Show,Eq,Typeable,Data)
data Cascade = Cascade | Restrict
deriving (Show,Eq,Typeable,Data)
data Direction = Asc | Desc
deriving (Show,Eq,Typeable,Data)
data Distinct = Distinct | Dupes
deriving (Show,Eq,Typeable,Data)
data Natural = Natural | Unnatural
deriving (Show,Eq,Typeable,Data)
data IfExists = Require | IfExists
deriving (Show,Eq,Typeable,Data)
data Replace = Replace | NoReplace
deriving (Show,Eq,Typeable,Data)
data RestartIdentity = RestartIdentity | ContinueIdentity
deriving (Show,Eq,Typeable,Data)
data LiftFlavour = LiftAny | LiftAll
deriving (Show,Eq,Typeable,Data)
data IntervalField = IntervalYear
| IntervalMonth
| IntervalDay
| IntervalHour
| IntervalMinute
| IntervalSecond
| IntervalYearToMonth
| IntervalDayToHour
| IntervalDayToMinute
| IntervalDayToSecond
| IntervalHourToMinute
| IntervalHourToSecond
| IntervalMinuteToSecond
deriving (Show,Eq,Typeable,Data)
data ExtractField = ExtractCentury
| ExtractDay
| ExtractDecade
| ExtractDow
| ExtractDoy
| ExtractEpoch
| ExtractHour
| ExtractIsodow
| ExtractIsoyear
| ExtractMicroseconds
| ExtractMillennium
| ExtractMilliseconds
| ExtractMinute
| ExtractMonth
| ExtractQuarter
| ExtractSecond
| ExtractTimezone
| ExtractTimezoneHour
| ExtractTimezoneMinute
| ExtractWeek
| ExtractYear
deriving (Show,Eq,Typeable,Data)
data FrameClause = FrameUnboundedPreceding
| FrameUnboundedFull
| FrameRowsUnboundedPreceding
deriving (Show,Eq,Typeable,Data)
typeCheckStatements :: Catalog -> [Statement] -> (Catalog,[Statement])
typeCheckStatements cat sts =
let t = sem_Root (Root $ fixUpIdentifiers cat sts)
ta = wrap_Root t Inh_Root {cat_Inh_Root = cat
,lib_Inh_Root = emptyBindings
,idenv_Inh_Root = emptyIDEnv "tcs"}
tl = annotatedTree_Syn_Root ta
cat1 = producedCat_Syn_Root ta
in case tl of
Root r -> (cat1,r)
typeCheckQueryExpr :: Catalog -> QueryExpr -> QueryExpr
typeCheckQueryExpr cat qe =
let (_,[QueryStatement _ qe']) = typeCheckStatements cat [QueryStatement emptyAnnotation qe]
in qe'
typeCheckParameterizedStatement :: Catalog -> Statement -> Either String Statement
typeCheckParameterizedStatement cat st =
case st of
QueryStatement _ _ -> tc
Insert _ _ _ _ _ -> tc
Update _ _ _ _ _ _ -> tc
Delete _ _ _ _ _ -> tc
_ -> Left "requires select, update, insert or delete statement"
where
tc = let t = sem_Root (Root $ fixUpIdentifiers cat [st])
ta = wrap_Root t Inh_Root {cat_Inh_Root = cat
,lib_Inh_Root = emptyBindings
,idenv_Inh_Root = emptyIDEnv "tsps"}
tl = annotatedTree_Syn_Root ta
in case tl of
Root [st1] -> Right st1
_ -> error "impossible happened in typeCheckPS!"
typeCheckScalarExpr :: Catalog -> ScalarExpr -> ScalarExpr
typeCheckScalarExpr cat ex =
let t = sem_ScalarExprRoot (ScalarExprRoot $ fixUpIdentifiersSE cat ex)
rt = (annotatedTree_Syn_ScalarExprRoot
(wrap_ScalarExprRoot t Inh_ScalarExprRoot {cat_Inh_ScalarExprRoot = cat
,lib_Inh_ScalarExprRoot = emptyBindings
,idenv_Inh_ScalarExprRoot = emptyIDEnv "tcse"}))
in case rt of
ScalarExprRoot e -> e
getEnvAlias :: IDEnv -> TableAlias
getEnvAlias i =
case expandStar i Nothing of
Just is'@((q,_):_) | all (==q) $ map fst is' ->
FullAlias emptyAnnotation (Nmc q) $ map (Nmc . snd) is'
_ -> NoAlias emptyAnnotation
aliasEnv :: TableAlias -> IDEnv -> IDEnv
aliasEnv (NoAlias _) ids = ids
aliasEnv (TableAlias _ t) ids = TableAliasIDEnv (ncStr t) ids
aliasEnv (FullAlias _ t cs) ids = FullAliasIDEnv (ncStr t) (map ncStr cs) ids
getTableTrefEnv :: Catalog -> Name -> IDEnv
getTableTrefEnv cat si =
let tn = getTName si
(pus,pvs) = either (const ([],[])) id
$ catCompositeAttrsPair cat relationComposites tn
in TrefIDEnv tn (map fst pus) (map fst pvs)
makeSelExps :: Annotation -> Annotation -> Annotation -> [(String,String)] -> [SelectItem]
makeSelExps sea a0 a1 is =
flip map is $ \(q,c) -> addSIAlias $ SelExp sea $ QIdentifier a0 [Nmc q,Nmc c]
addSIAlias :: SelectItem -> SelectItem
addSIAlias s@(SelectItem _ _ _) = s
addSIAlias (SelExp ann ex) = SelectItem ann ex $ getColName ex
where
getColName :: ScalarExpr -> NameComponent
getColName (Identifier _ i) = i
getColName (QIdentifier _ is) = last is
getColName (FunCall _ f@(Name _ ncs) _) | not (isOperatorName $ getTName f) = last ncs
getColName (Cast _ _ (SimpleTypeName _ tn)) = QNmc tn
getColName (WindowFn _ (FunCall _ f@(Name _ ncs) _) _ _ _) = last ncs
getColName (AggregateFn _ _ (FunCall _ f@(Name _ ncs) _) _) = last ncs
getColName _ = QNmc "?column?"
fixUpIdentifiers :: Catalog -> [Statement] -> [Statement]
fixUpIdentifiers cat sts =
let t = sem_Root (Root sts)
ta = wrap_Root t Inh_Root {cat_Inh_Root = cat
,lib_Inh_Root = emptyBindings
,idenv_Inh_Root = emptyIDEnv "fixupidentifiers [st]"}
tl = fixedUpIdentifiersTree_Syn_Root ta
in case tl of
Root r -> countHack r
fixUpIdentifiersSE :: Catalog -> ScalarExpr -> ScalarExpr
fixUpIdentifiersSE cat sts =
let t = sem_ScalarExprRoot (ScalarExprRoot sts)
ta = wrap_ScalarExprRoot t Inh_ScalarExprRoot {cat_Inh_ScalarExprRoot = cat
,lib_Inh_ScalarExprRoot = emptyBindings
,idenv_Inh_ScalarExprRoot = emptyIDEnv "fixupidentifiers se"}
tl = fixedUpIdentifiersTree_Syn_ScalarExprRoot ta
in case tl of
ScalarExprRoot r -> countHack r
fixUpIdentifiersQE :: Catalog -> QueryExpr -> QueryExpr
fixUpIdentifiersQE cat qe =
let [QueryStatement _ qe'] = fixUpIdentifiers cat [QueryStatement emptyAnnotation qe]
in countHack qe'
countHack :: Data a => a -> a
countHack = transformBi $ \x -> case x of
FunCall a f [Star ia] | getTName f == "count"->
FunCall a f [BooleanLit ia True]
x1 -> x1
showit :: Show a => String -> a -> a
showit a t = trace (a ++ show t ++ "\n\n") t
getUnqual :: [NameComponent] -> String
getUnqual [] = error $ "empty name component"
getUnqual x = ncStr $ last x
addTypeErrors :: Data a => [TypeError] -> a -> a
addTypeErrors es el = updateAnnotation u el
where
u a = a {errs = errs a ++ es}
setTypeAddErrors :: Data a => Et -> a -> a
setTypeAddErrors et el = updateAnnotation (setTypeAddErrorsA et) el
setTypeAddErrorsA :: Et -> Annotation -> Annotation
setTypeAddErrorsA et a =
let a1 = a {errs = errs a ++ tes et}
in case atype a1 of
Just _ -> a1 {errs = errs a
++ [InternalError $ "tried to set type a second time - " ++ show (etmt et)]}
Nothing -> a1 {atype = etmt et}
allJust :: [Maybe a] -> Maybe [a]
allJust ts = sequence ts
getName :: ScalarExpr -> String
getName (Identifier _ i) = ncStr i
getName (FunCall _ f [Identifier _ _,Identifier _ i]) | getTName f == "." = ncStr i
getName (FunCall _ f [_,a]) | getTName f == "." = getName a
getName x = error $ "internal error getName called on: " ++ show x
getTName :: Name -> String
getTName (Name _ n) = getUnqual n
unwrapLookup :: (String,[String],Type) -> Type
unwrapLookup (_,_,t) = t
allAtts :: ([(String,Type)],[(String,Type)]) -> [(String,Type)]
allAtts (a,b) = a ++ b
typeCheckValuesExpr :: Catalog -> [[Maybe Type]] -> Either [TypeError] Type
typeCheckValuesExpr cat rowsTs = do
rts <- lmt $ allJust $ map allJust rowsTs
let colNames = zipWith (++)
(repeat "column")
(map show [1..length $ head rowsTs])
unionRelTypes cat rts colNames
typeCheckCombineSelect :: Catalog -> Type -> Type -> Either [TypeError] Type
typeCheckCombineSelect cat v1 v2 = do
u1 <- unwrapSetOfComposite v1
let colNames = map fst u1
u2 <- unwrapSetOfComposite v2
let colTypes1 = map snd u1
let colTypes2 = map snd u2
unionRelTypes cat [colTypes1,colTypes2] colNames
unionRelTypes :: Catalog -> [[Type]] -> [String] -> Either [TypeError] Type
unionRelTypes cat rowsTs colNames =
let lengths = map length rowsTs
in case () of
_ | null rowsTs ->
Left [NoRowsGivenForValues]
| not (all (==head lengths) lengths) ->
Left [ValuesListsMustBeSameLength]
| otherwise ->
mapM (resolveResultSetType cat) (transpose rowsTs) >>=
(return . SetOfType . CompositeType . zip colNames)
funIdens :: Catalog -> TableAlias -> ScalarExpr -> Maybe Type -> Either [TypeError] (String,[(String,Type)])
funIdens cat (FullAlias _ t cs) (FunCall _ fnName _) ft = do
attrs <- do
fnt <- lmt ft
case fnt of
SetOfType (NamedCompositeType t) -> do
x <- catCompositePublicAttrs cat [] t
let aliaslen = length cs
gotlen = length x
if aliaslen == gotlen
then return $ zip cs $ map snd x
else Left [WrongNumberOfAliasCols gotlen aliaslen]
SetOfType x | [c] <- cs -> return [(c,x)]
| otherwise -> Left [WrongNumberOfAliasCols 1 $ length cs]
x | [c] <- cs -> return [(c,x)]
| otherwise -> Left [WrongNumberOfAliasCols 1 $ length cs]
return (ncStr t, map (first ncStr) attrs)
getAlias :: String -> TableAlias -> String
getAlias def alias =
case alias of
NoAlias _ -> def
TableAlias _ t -> ncStr t
FullAlias _ t _ -> ncStr t
unwrapSetof :: Type -> Type
unwrapSetof (SetOfType u) = u
unwrapSetof v = v
makeTrefLib :: Catalog
-> Name
-> Maybe ([(String,Type)],[(String,Type)])
-> E LocalBindings
makeTrefLib cat si tbUType = Right $ createLocalBindings $ do
let n = getTName si
(pu,pr) <- tbUType
return [(n,map (second Just) pu)
,(n,map (second Just) pr)]
defaultSystemColumns :: [(String,Type)]
defaultSystemColumns = [("tableoid", ScalarType "oid")
,("cmax", ScalarType "cid")
,("xmax", ScalarType "xid")
,("cmin", ScalarType "cid")
,("xmin", ScalarType "xid")
,("ctid", ScalarType "tid")]
data ParamName = NamedParam Int String
| UnnamedParam Int
getPlaceholderTypes :: Data a => a -> [Maybe Type]
getPlaceholderTypes ex =
[infType (getAnnotation x) | x <- universeBi ex
, isPlaceholder x]
where
isPlaceholder e = case e of
PositionalArg _ _ -> True
Placeholder _ -> True
_ -> False
data AlterTableAction = AddConstraint (Annotation) (Constraint )
| AlterColumnDefault (Annotation) (NameComponent) (ScalarExpr )
deriving ( Data,Eq,Show,Typeable)
sem_AlterTableAction :: AlterTableAction ->
T_AlterTableAction
sem_AlterTableAction (AddConstraint _ann _con ) =
(sem_AlterTableAction_AddConstraint _ann (sem_Constraint _con ) )
sem_AlterTableAction (AlterColumnDefault _ann _nm _def ) =
(sem_AlterTableAction_AlterColumnDefault _ann _nm (sem_ScalarExpr _def ) )
type T_AlterTableAction = Catalog ->
IDEnv ->
LocalBindings ->
( AlterTableAction ,AlterTableAction ,AlterTableAction )
data Inh_AlterTableAction = Inh_AlterTableAction {cat_Inh_AlterTableAction :: Catalog,idenv_Inh_AlterTableAction :: IDEnv,lib_Inh_AlterTableAction :: LocalBindings}
data Syn_AlterTableAction = Syn_AlterTableAction {annotatedTree_Syn_AlterTableAction :: AlterTableAction ,fixedUpIdentifiersTree_Syn_AlterTableAction :: AlterTableAction ,originalTree_Syn_AlterTableAction :: AlterTableAction }
wrap_AlterTableAction :: T_AlterTableAction ->
Inh_AlterTableAction ->
Syn_AlterTableAction
wrap_AlterTableAction sem (Inh_AlterTableAction _lhsIcat _lhsIidenv _lhsIlib ) =
(let ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree) = sem _lhsIcat _lhsIidenv _lhsIlib
in (Syn_AlterTableAction _lhsOannotatedTree _lhsOfixedUpIdentifiersTree _lhsOoriginalTree ))
sem_AlterTableAction_AddConstraint :: Annotation ->
T_Constraint ->
T_AlterTableAction
sem_AlterTableAction_AddConstraint ann_ con_ =
(\ _lhsIcat
_lhsIidenv
_lhsIlib ->
(let _lhsOannotatedTree :: AlterTableAction
_lhsOfixedUpIdentifiersTree :: AlterTableAction
_lhsOoriginalTree :: AlterTableAction
_conOcat :: Catalog
_conOidenv :: IDEnv
_conOlib :: LocalBindings
_conIannotatedTree :: Constraint
_conIfixedUpIdentifiersTree :: Constraint
_conIoriginalTree :: Constraint
_annotatedTree =
AddConstraint ann_ _conIannotatedTree
_fixedUpIdentifiersTree =
AddConstraint ann_ _conIfixedUpIdentifiersTree
_originalTree =
AddConstraint ann_ _conIoriginalTree
_lhsOannotatedTree =
_annotatedTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
_conOcat =
_lhsIcat
_conOidenv =
_lhsIidenv
_conOlib =
_lhsIlib
( _conIannotatedTree,_conIfixedUpIdentifiersTree,_conIoriginalTree) =
con_ _conOcat _conOidenv _conOlib
in ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree)))
sem_AlterTableAction_AlterColumnDefault :: Annotation ->
NameComponent ->
T_ScalarExpr ->
T_AlterTableAction
sem_AlterTableAction_AlterColumnDefault ann_ nm_ def_ =
(\ _lhsIcat
_lhsIidenv
_lhsIlib ->
(let _defOexpectedType :: (Maybe Type)
_lhsOannotatedTree :: AlterTableAction
_lhsOfixedUpIdentifiersTree :: AlterTableAction
_lhsOoriginalTree :: AlterTableAction
_defOcat :: Catalog
_defOidenv :: IDEnv
_defOlib :: LocalBindings
_defIannotatedTree :: ScalarExpr
_defIfixedUpIdentifiersTree :: ScalarExpr
_defIoriginalTree :: ScalarExpr
_defIuType :: (Maybe Type)
_defOexpectedType =
Nothing
_annotatedTree =
AlterColumnDefault ann_ nm_ _defIannotatedTree
_fixedUpIdentifiersTree =
AlterColumnDefault ann_ nm_ _defIfixedUpIdentifiersTree
_originalTree =
AlterColumnDefault ann_ nm_ _defIoriginalTree
_lhsOannotatedTree =
_annotatedTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
_defOcat =
_lhsIcat
_defOidenv =
_lhsIidenv
_defOlib =
_lhsIlib
( _defIannotatedTree,_defIfixedUpIdentifiersTree,_defIoriginalTree,_defIuType) =
def_ _defOcat _defOexpectedType _defOidenv _defOlib
in ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree)))
type AlterTableActionList = [AlterTableAction ]
sem_AlterTableActionList :: AlterTableActionList ->
T_AlterTableActionList
sem_AlterTableActionList list =
(Prelude.foldr sem_AlterTableActionList_Cons sem_AlterTableActionList_Nil (Prelude.map sem_AlterTableAction list) )
type T_AlterTableActionList = Catalog ->
IDEnv ->
LocalBindings ->
( AlterTableActionList ,AlterTableActionList ,AlterTableActionList )
data Inh_AlterTableActionList = Inh_AlterTableActionList {cat_Inh_AlterTableActionList :: Catalog,idenv_Inh_AlterTableActionList :: IDEnv,lib_Inh_AlterTableActionList :: LocalBindings}
data Syn_AlterTableActionList = Syn_AlterTableActionList {annotatedTree_Syn_AlterTableActionList :: AlterTableActionList ,fixedUpIdentifiersTree_Syn_AlterTableActionList :: AlterTableActionList ,originalTree_Syn_AlterTableActionList :: AlterTableActionList }
wrap_AlterTableActionList :: T_AlterTableActionList ->
Inh_AlterTableActionList ->
Syn_AlterTableActionList
wrap_AlterTableActionList sem (Inh_AlterTableActionList _lhsIcat _lhsIidenv _lhsIlib ) =
(let ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree) = sem _lhsIcat _lhsIidenv _lhsIlib
in (Syn_AlterTableActionList _lhsOannotatedTree _lhsOfixedUpIdentifiersTree _lhsOoriginalTree ))
sem_AlterTableActionList_Cons :: T_AlterTableAction ->
T_AlterTableActionList ->
T_AlterTableActionList
sem_AlterTableActionList_Cons hd_ tl_ =
(\ _lhsIcat
_lhsIidenv
_lhsIlib ->
(let _lhsOannotatedTree :: AlterTableActionList
_lhsOfixedUpIdentifiersTree :: AlterTableActionList
_lhsOoriginalTree :: AlterTableActionList
_hdOcat :: Catalog
_hdOidenv :: IDEnv
_hdOlib :: LocalBindings
_tlOcat :: Catalog
_tlOidenv :: IDEnv
_tlOlib :: LocalBindings
_hdIannotatedTree :: AlterTableAction
_hdIfixedUpIdentifiersTree :: AlterTableAction
_hdIoriginalTree :: AlterTableAction
_tlIannotatedTree :: AlterTableActionList
_tlIfixedUpIdentifiersTree :: AlterTableActionList
_tlIoriginalTree :: AlterTableActionList
_annotatedTree =
(:) _hdIannotatedTree _tlIannotatedTree
_fixedUpIdentifiersTree =
(:) _hdIfixedUpIdentifiersTree _tlIfixedUpIdentifiersTree
_originalTree =
(:) _hdIoriginalTree _tlIoriginalTree
_lhsOannotatedTree =
_annotatedTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
_hdOcat =
_lhsIcat
_hdOidenv =
_lhsIidenv
_hdOlib =
_lhsIlib
_tlOcat =
_lhsIcat
_tlOidenv =
_lhsIidenv
_tlOlib =
_lhsIlib
( _hdIannotatedTree,_hdIfixedUpIdentifiersTree,_hdIoriginalTree) =
hd_ _hdOcat _hdOidenv _hdOlib
( _tlIannotatedTree,_tlIfixedUpIdentifiersTree,_tlIoriginalTree) =
tl_ _tlOcat _tlOidenv _tlOlib
in ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree)))
sem_AlterTableActionList_Nil :: T_AlterTableActionList
sem_AlterTableActionList_Nil =
(\ _lhsIcat
_lhsIidenv
_lhsIlib ->
(let _lhsOannotatedTree :: AlterTableActionList
_lhsOfixedUpIdentifiersTree :: AlterTableActionList
_lhsOoriginalTree :: AlterTableActionList
_annotatedTree =
[]
_fixedUpIdentifiersTree =
[]
_originalTree =
[]
_lhsOannotatedTree =
_annotatedTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
in ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree)))
data AttributeDef = AttributeDef (Annotation) (NameComponent) (TypeName ) (MaybeScalarExpr ) (RowConstraintList )
deriving ( Data,Eq,Show,Typeable)
sem_AttributeDef :: AttributeDef ->
T_AttributeDef
sem_AttributeDef (AttributeDef _ann _name _typ _def _cons ) =
(sem_AttributeDef_AttributeDef _ann _name (sem_TypeName _typ ) (sem_MaybeScalarExpr _def ) (sem_RowConstraintList _cons ) )
type T_AttributeDef = Catalog ->
IDEnv ->
LocalBindings ->
( AttributeDef ,String,AttributeDef ,(Maybe Type),AttributeDef )
data Inh_AttributeDef = Inh_AttributeDef {cat_Inh_AttributeDef :: Catalog,idenv_Inh_AttributeDef :: IDEnv,lib_Inh_AttributeDef :: LocalBindings}
data Syn_AttributeDef = Syn_AttributeDef {annotatedTree_Syn_AttributeDef :: AttributeDef ,attrName_Syn_AttributeDef :: String,fixedUpIdentifiersTree_Syn_AttributeDef :: AttributeDef ,namedType_Syn_AttributeDef :: (Maybe Type),originalTree_Syn_AttributeDef :: AttributeDef }
wrap_AttributeDef :: T_AttributeDef ->
Inh_AttributeDef ->
Syn_AttributeDef
wrap_AttributeDef sem (Inh_AttributeDef _lhsIcat _lhsIidenv _lhsIlib ) =
(let ( _lhsOannotatedTree,_lhsOattrName,_lhsOfixedUpIdentifiersTree,_lhsOnamedType,_lhsOoriginalTree) = sem _lhsIcat _lhsIidenv _lhsIlib
in (Syn_AttributeDef _lhsOannotatedTree _lhsOattrName _lhsOfixedUpIdentifiersTree _lhsOnamedType _lhsOoriginalTree ))
sem_AttributeDef_AttributeDef :: Annotation ->
NameComponent ->
T_TypeName ->
T_MaybeScalarExpr ->
T_RowConstraintList ->
T_AttributeDef
sem_AttributeDef_AttributeDef ann_ name_ typ_ def_ cons_ =
(\ _lhsIcat
_lhsIidenv
_lhsIlib ->
(let _lhsOattrName :: String
_lhsOnamedType :: (Maybe Type)
_consOlib :: LocalBindings
_lhsOannotatedTree :: AttributeDef
_lhsOfixedUpIdentifiersTree :: AttributeDef
_lhsOoriginalTree :: AttributeDef
_typOcat :: Catalog
_typOidenv :: IDEnv
_typOlib :: LocalBindings
_defOcat :: Catalog
_defOidenv :: IDEnv
_defOlib :: LocalBindings
_consOcat :: Catalog
_consOidenv :: IDEnv
_typIannotatedTree :: TypeName
_typIfixedUpIdentifiersTree :: TypeName
_typInamedType :: (Maybe Type)
_typIoriginalTree :: TypeName
_defIannotatedTree :: MaybeScalarExpr
_defIfixedUpIdentifiersTree :: MaybeScalarExpr
_defIoriginalTree :: MaybeScalarExpr
_defIuType :: (Maybe Type)
_consIannotatedTree :: RowConstraintList
_consIfixedUpIdentifiersTree :: RowConstraintList
_consIoriginalTree :: RowConstraintList
_lhsOattrName =
map toLower $ ncStr name_
_lhsOnamedType =
_typInamedType
_consOlib =
either (const _lhsIlib) id $ do
t <- lmt _typInamedType
lbUpdate _lhsIcat
(LBIds "attribute def" Nothing
[(ncStr name_, t)]) _lhsIlib
_annotatedTree =
AttributeDef ann_ name_ _typIannotatedTree _defIannotatedTree _consIannotatedTree
_fixedUpIdentifiersTree =
AttributeDef ann_ name_ _typIfixedUpIdentifiersTree _defIfixedUpIdentifiersTree _consIfixedUpIdentifiersTree
_originalTree =
AttributeDef ann_ name_ _typIoriginalTree _defIoriginalTree _consIoriginalTree
_lhsOannotatedTree =
_annotatedTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
_typOcat =
_lhsIcat
_typOidenv =
_lhsIidenv
_typOlib =
_lhsIlib
_defOcat =
_lhsIcat
_defOidenv =
_lhsIidenv
_defOlib =
_lhsIlib
_consOcat =
_lhsIcat
_consOidenv =
_lhsIidenv
( _typIannotatedTree,_typIfixedUpIdentifiersTree,_typInamedType,_typIoriginalTree) =
typ_ _typOcat _typOidenv _typOlib
( _defIannotatedTree,_defIfixedUpIdentifiersTree,_defIoriginalTree,_defIuType) =
def_ _defOcat _defOidenv _defOlib
( _consIannotatedTree,_consIfixedUpIdentifiersTree,_consIoriginalTree) =
cons_ _consOcat _consOidenv _consOlib
in ( _lhsOannotatedTree,_lhsOattrName,_lhsOfixedUpIdentifiersTree,_lhsOnamedType,_lhsOoriginalTree)))
type AttributeDefList = [AttributeDef ]
sem_AttributeDefList :: AttributeDefList ->
T_AttributeDefList
sem_AttributeDefList list =
(Prelude.foldr sem_AttributeDefList_Cons sem_AttributeDefList_Nil (Prelude.map sem_AttributeDef list) )
type T_AttributeDefList = Catalog ->
IDEnv ->
LocalBindings ->
( AttributeDefList ,([(String, Maybe Type)]),AttributeDefList ,AttributeDefList )
data Inh_AttributeDefList = Inh_AttributeDefList {cat_Inh_AttributeDefList :: Catalog,idenv_Inh_AttributeDefList :: IDEnv,lib_Inh_AttributeDefList :: LocalBindings}
data Syn_AttributeDefList = Syn_AttributeDefList {annotatedTree_Syn_AttributeDefList :: AttributeDefList ,attrs_Syn_AttributeDefList :: ([(String, Maybe Type)]),fixedUpIdentifiersTree_Syn_AttributeDefList :: AttributeDefList ,originalTree_Syn_AttributeDefList :: AttributeDefList }
wrap_AttributeDefList :: T_AttributeDefList ->
Inh_AttributeDefList ->
Syn_AttributeDefList
wrap_AttributeDefList sem (Inh_AttributeDefList _lhsIcat _lhsIidenv _lhsIlib ) =
(let ( _lhsOannotatedTree,_lhsOattrs,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree) = sem _lhsIcat _lhsIidenv _lhsIlib
in (Syn_AttributeDefList _lhsOannotatedTree _lhsOattrs _lhsOfixedUpIdentifiersTree _lhsOoriginalTree ))
sem_AttributeDefList_Cons :: T_AttributeDef ->
T_AttributeDefList ->
T_AttributeDefList
sem_AttributeDefList_Cons hd_ tl_ =
(\ _lhsIcat
_lhsIidenv
_lhsIlib ->
(let _lhsOattrs :: ([(String, Maybe Type)])
_lhsOannotatedTree :: AttributeDefList
_lhsOfixedUpIdentifiersTree :: AttributeDefList
_lhsOoriginalTree :: AttributeDefList
_hdOcat :: Catalog
_hdOidenv :: IDEnv
_hdOlib :: LocalBindings
_tlOcat :: Catalog
_tlOidenv :: IDEnv
_tlOlib :: LocalBindings
_hdIannotatedTree :: AttributeDef
_hdIattrName :: String
_hdIfixedUpIdentifiersTree :: AttributeDef
_hdInamedType :: (Maybe Type)
_hdIoriginalTree :: AttributeDef
_tlIannotatedTree :: AttributeDefList
_tlIattrs :: ([(String, Maybe Type)])
_tlIfixedUpIdentifiersTree :: AttributeDefList
_tlIoriginalTree :: AttributeDefList
_lhsOattrs =
(_hdIattrName, _hdInamedType) : _tlIattrs
_annotatedTree =
(:) _hdIannotatedTree _tlIannotatedTree
_fixedUpIdentifiersTree =
(:) _hdIfixedUpIdentifiersTree _tlIfixedUpIdentifiersTree
_originalTree =
(:) _hdIoriginalTree _tlIoriginalTree
_lhsOannotatedTree =
_annotatedTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
_hdOcat =
_lhsIcat
_hdOidenv =
_lhsIidenv
_hdOlib =
_lhsIlib
_tlOcat =
_lhsIcat
_tlOidenv =
_lhsIidenv
_tlOlib =
_lhsIlib
( _hdIannotatedTree,_hdIattrName,_hdIfixedUpIdentifiersTree,_hdInamedType,_hdIoriginalTree) =
hd_ _hdOcat _hdOidenv _hdOlib
( _tlIannotatedTree,_tlIattrs,_tlIfixedUpIdentifiersTree,_tlIoriginalTree) =
tl_ _tlOcat _tlOidenv _tlOlib
in ( _lhsOannotatedTree,_lhsOattrs,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree)))
sem_AttributeDefList_Nil :: T_AttributeDefList
sem_AttributeDefList_Nil =
(\ _lhsIcat
_lhsIidenv
_lhsIlib ->
(let _lhsOattrs :: ([(String, Maybe Type)])
_lhsOannotatedTree :: AttributeDefList
_lhsOfixedUpIdentifiersTree :: AttributeDefList
_lhsOoriginalTree :: AttributeDefList
_lhsOattrs =
[]
_annotatedTree =
[]
_fixedUpIdentifiersTree =
[]
_originalTree =
[]
_lhsOannotatedTree =
_annotatedTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
in ( _lhsOannotatedTree,_lhsOattrs,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree)))
type CaseScalarExprListScalarExprPair = ( ScalarExprList ,ScalarExpr )
sem_CaseScalarExprListScalarExprPair :: CaseScalarExprListScalarExprPair ->
T_CaseScalarExprListScalarExprPair
sem_CaseScalarExprListScalarExprPair ( x1,x2) =
(sem_CaseScalarExprListScalarExprPair_Tuple (sem_ScalarExprList x1 ) (sem_ScalarExpr x2 ) )
type T_CaseScalarExprListScalarExprPair = Catalog ->
IDEnv ->
LocalBindings ->
( CaseScalarExprListScalarExprPair ,CaseScalarExprListScalarExprPair ,CaseScalarExprListScalarExprPair ,(Maybe Type),([Maybe Type]))
data Inh_CaseScalarExprListScalarExprPair = Inh_CaseScalarExprListScalarExprPair {cat_Inh_CaseScalarExprListScalarExprPair :: Catalog,idenv_Inh_CaseScalarExprListScalarExprPair :: IDEnv,lib_Inh_CaseScalarExprListScalarExprPair :: LocalBindings}
data Syn_CaseScalarExprListScalarExprPair = Syn_CaseScalarExprListScalarExprPair {annotatedTree_Syn_CaseScalarExprListScalarExprPair :: CaseScalarExprListScalarExprPair ,fixedUpIdentifiersTree_Syn_CaseScalarExprListScalarExprPair :: CaseScalarExprListScalarExprPair ,originalTree_Syn_CaseScalarExprListScalarExprPair :: CaseScalarExprListScalarExprPair ,thenType_Syn_CaseScalarExprListScalarExprPair :: (Maybe Type),whenTypes_Syn_CaseScalarExprListScalarExprPair :: ([Maybe Type])}
wrap_CaseScalarExprListScalarExprPair :: T_CaseScalarExprListScalarExprPair ->
Inh_CaseScalarExprListScalarExprPair ->
Syn_CaseScalarExprListScalarExprPair
wrap_CaseScalarExprListScalarExprPair sem (Inh_CaseScalarExprListScalarExprPair _lhsIcat _lhsIidenv _lhsIlib ) =
(let ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree,_lhsOthenType,_lhsOwhenTypes) = sem _lhsIcat _lhsIidenv _lhsIlib
in (Syn_CaseScalarExprListScalarExprPair _lhsOannotatedTree _lhsOfixedUpIdentifiersTree _lhsOoriginalTree _lhsOthenType _lhsOwhenTypes ))
sem_CaseScalarExprListScalarExprPair_Tuple :: T_ScalarExprList ->
T_ScalarExpr ->
T_CaseScalarExprListScalarExprPair
sem_CaseScalarExprListScalarExprPair_Tuple x1_ x2_ =
(\ _lhsIcat
_lhsIidenv
_lhsIlib ->
(let _lhsOwhenTypes :: ([Maybe Type])
_lhsOthenType :: (Maybe Type)
_x1OexpectedTypes :: ([Maybe Type])
_x2OexpectedType :: (Maybe Type)
_lhsOannotatedTree :: CaseScalarExprListScalarExprPair
_lhsOfixedUpIdentifiersTree :: CaseScalarExprListScalarExprPair
_lhsOoriginalTree :: CaseScalarExprListScalarExprPair
_x1Ocat :: Catalog
_x1Oidenv :: IDEnv
_x1Olib :: LocalBindings
_x2Ocat :: Catalog
_x2Oidenv :: IDEnv
_x2Olib :: LocalBindings
_x1IannotatedTree :: ScalarExprList
_x1IfixedUpIdentifiersTree :: ScalarExprList
_x1IoriginalTree :: ScalarExprList
_x1IuType :: ([Maybe Type])
_x2IannotatedTree :: ScalarExpr
_x2IfixedUpIdentifiersTree :: ScalarExpr
_x2IoriginalTree :: ScalarExpr
_x2IuType :: (Maybe Type)
_lhsOwhenTypes =
_x1IuType
_lhsOthenType =
_x2IuType
_x1OexpectedTypes =
[]
_x2OexpectedType =
Nothing
_annotatedTree =
(_x1IannotatedTree,_x2IannotatedTree)
_fixedUpIdentifiersTree =
(_x1IfixedUpIdentifiersTree,_x2IfixedUpIdentifiersTree)
_originalTree =
(_x1IoriginalTree,_x2IoriginalTree)
_lhsOannotatedTree =
_annotatedTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
_x1Ocat =
_lhsIcat
_x1Oidenv =
_lhsIidenv
_x1Olib =
_lhsIlib
_x2Ocat =
_lhsIcat
_x2Oidenv =
_lhsIidenv
_x2Olib =
_lhsIlib
( _x1IannotatedTree,_x1IfixedUpIdentifiersTree,_x1IoriginalTree,_x1IuType) =
x1_ _x1Ocat _x1OexpectedTypes _x1Oidenv _x1Olib
( _x2IannotatedTree,_x2IfixedUpIdentifiersTree,_x2IoriginalTree,_x2IuType) =
x2_ _x2Ocat _x2OexpectedType _x2Oidenv _x2Olib
in ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree,_lhsOthenType,_lhsOwhenTypes)))
type CaseScalarExprListScalarExprPairList = [CaseScalarExprListScalarExprPair ]
sem_CaseScalarExprListScalarExprPairList :: CaseScalarExprListScalarExprPairList ->
T_CaseScalarExprListScalarExprPairList
sem_CaseScalarExprListScalarExprPairList list =
(Prelude.foldr sem_CaseScalarExprListScalarExprPairList_Cons sem_CaseScalarExprListScalarExprPairList_Nil (Prelude.map sem_CaseScalarExprListScalarExprPair list) )
type T_CaseScalarExprListScalarExprPairList = Catalog ->
IDEnv ->
LocalBindings ->
( CaseScalarExprListScalarExprPairList ,CaseScalarExprListScalarExprPairList ,CaseScalarExprListScalarExprPairList ,([Maybe Type]),([[Maybe Type]]))
data Inh_CaseScalarExprListScalarExprPairList = Inh_CaseScalarExprListScalarExprPairList {cat_Inh_CaseScalarExprListScalarExprPairList :: Catalog,idenv_Inh_CaseScalarExprListScalarExprPairList :: IDEnv,lib_Inh_CaseScalarExprListScalarExprPairList :: LocalBindings}
data Syn_CaseScalarExprListScalarExprPairList = Syn_CaseScalarExprListScalarExprPairList {annotatedTree_Syn_CaseScalarExprListScalarExprPairList :: CaseScalarExprListScalarExprPairList ,fixedUpIdentifiersTree_Syn_CaseScalarExprListScalarExprPairList :: CaseScalarExprListScalarExprPairList ,originalTree_Syn_CaseScalarExprListScalarExprPairList :: CaseScalarExprListScalarExprPairList ,thenTypes_Syn_CaseScalarExprListScalarExprPairList :: ([Maybe Type]),whenTypes_Syn_CaseScalarExprListScalarExprPairList :: ([[Maybe Type]])}
wrap_CaseScalarExprListScalarExprPairList :: T_CaseScalarExprListScalarExprPairList ->
Inh_CaseScalarExprListScalarExprPairList ->
Syn_CaseScalarExprListScalarExprPairList
wrap_CaseScalarExprListScalarExprPairList sem (Inh_CaseScalarExprListScalarExprPairList _lhsIcat _lhsIidenv _lhsIlib ) =
(let ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree,_lhsOthenTypes,_lhsOwhenTypes) = sem _lhsIcat _lhsIidenv _lhsIlib
in (Syn_CaseScalarExprListScalarExprPairList _lhsOannotatedTree _lhsOfixedUpIdentifiersTree _lhsOoriginalTree _lhsOthenTypes _lhsOwhenTypes ))
sem_CaseScalarExprListScalarExprPairList_Cons :: T_CaseScalarExprListScalarExprPair ->
T_CaseScalarExprListScalarExprPairList ->
T_CaseScalarExprListScalarExprPairList
sem_CaseScalarExprListScalarExprPairList_Cons hd_ tl_ =
(\ _lhsIcat
_lhsIidenv
_lhsIlib ->
(let _lhsOwhenTypes :: ([[Maybe Type]])
_lhsOthenTypes :: ([Maybe Type])
_lhsOannotatedTree :: CaseScalarExprListScalarExprPairList
_lhsOfixedUpIdentifiersTree :: CaseScalarExprListScalarExprPairList
_lhsOoriginalTree :: CaseScalarExprListScalarExprPairList
_hdOcat :: Catalog
_hdOidenv :: IDEnv
_hdOlib :: LocalBindings
_tlOcat :: Catalog
_tlOidenv :: IDEnv
_tlOlib :: LocalBindings
_hdIannotatedTree :: CaseScalarExprListScalarExprPair
_hdIfixedUpIdentifiersTree :: CaseScalarExprListScalarExprPair
_hdIoriginalTree :: CaseScalarExprListScalarExprPair
_hdIthenType :: (Maybe Type)
_hdIwhenTypes :: ([Maybe Type])
_tlIannotatedTree :: CaseScalarExprListScalarExprPairList
_tlIfixedUpIdentifiersTree :: CaseScalarExprListScalarExprPairList
_tlIoriginalTree :: CaseScalarExprListScalarExprPairList
_tlIthenTypes :: ([Maybe Type])
_tlIwhenTypes :: ([[Maybe Type]])
_lhsOwhenTypes =
_hdIwhenTypes : _tlIwhenTypes
_lhsOthenTypes =
_hdIthenType : _tlIthenTypes
_annotatedTree =
(:) _hdIannotatedTree _tlIannotatedTree
_fixedUpIdentifiersTree =
(:) _hdIfixedUpIdentifiersTree _tlIfixedUpIdentifiersTree
_originalTree =
(:) _hdIoriginalTree _tlIoriginalTree
_lhsOannotatedTree =
_annotatedTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
_hdOcat =
_lhsIcat
_hdOidenv =
_lhsIidenv
_hdOlib =
_lhsIlib
_tlOcat =
_lhsIcat
_tlOidenv =
_lhsIidenv
_tlOlib =
_lhsIlib
( _hdIannotatedTree,_hdIfixedUpIdentifiersTree,_hdIoriginalTree,_hdIthenType,_hdIwhenTypes) =
hd_ _hdOcat _hdOidenv _hdOlib
( _tlIannotatedTree,_tlIfixedUpIdentifiersTree,_tlIoriginalTree,_tlIthenTypes,_tlIwhenTypes) =
tl_ _tlOcat _tlOidenv _tlOlib
in ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree,_lhsOthenTypes,_lhsOwhenTypes)))
sem_CaseScalarExprListScalarExprPairList_Nil :: T_CaseScalarExprListScalarExprPairList
sem_CaseScalarExprListScalarExprPairList_Nil =
(\ _lhsIcat
_lhsIidenv
_lhsIlib ->
(let _lhsOwhenTypes :: ([[Maybe Type]])
_lhsOthenTypes :: ([Maybe Type])
_lhsOannotatedTree :: CaseScalarExprListScalarExprPairList
_lhsOfixedUpIdentifiersTree :: CaseScalarExprListScalarExprPairList
_lhsOoriginalTree :: CaseScalarExprListScalarExprPairList
_lhsOwhenTypes =
[]
_lhsOthenTypes =
[]
_annotatedTree =
[]
_fixedUpIdentifiersTree =
[]
_originalTree =
[]
_lhsOannotatedTree =
_annotatedTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
in ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree,_lhsOthenTypes,_lhsOwhenTypes)))
data Constraint = CheckConstraint (Annotation) (String) (ScalarExpr )
| PrimaryKeyConstraint (Annotation) (String) (([NameComponent]))
| ReferenceConstraint (Annotation) (String) (([NameComponent])) (Name ) (([NameComponent])) (Cascade) (Cascade)
| UniqueConstraint (Annotation) (String) (([NameComponent]))
deriving ( Data,Eq,Show,Typeable)
sem_Constraint :: Constraint ->
T_Constraint
sem_Constraint (CheckConstraint _ann _name _expr ) =
(sem_Constraint_CheckConstraint _ann _name (sem_ScalarExpr _expr ) )
sem_Constraint (PrimaryKeyConstraint _ann _name _x ) =
(sem_Constraint_PrimaryKeyConstraint _ann _name _x )
sem_Constraint (ReferenceConstraint _ann _name _atts _table _tableAtts _onUpdate _onDelete ) =
(sem_Constraint_ReferenceConstraint _ann _name _atts (sem_Name _table ) _tableAtts _onUpdate _onDelete )
sem_Constraint (UniqueConstraint _ann _name _x ) =
(sem_Constraint_UniqueConstraint _ann _name _x )
type T_Constraint = Catalog ->
IDEnv ->
LocalBindings ->
( Constraint ,Constraint ,Constraint )
data Inh_Constraint = Inh_Constraint {cat_Inh_Constraint :: Catalog,idenv_Inh_Constraint :: IDEnv,lib_Inh_Constraint :: LocalBindings}
data Syn_Constraint = Syn_Constraint {annotatedTree_Syn_Constraint :: Constraint ,fixedUpIdentifiersTree_Syn_Constraint :: Constraint ,originalTree_Syn_Constraint :: Constraint }
wrap_Constraint :: T_Constraint ->
Inh_Constraint ->
Syn_Constraint
wrap_Constraint sem (Inh_Constraint _lhsIcat _lhsIidenv _lhsIlib ) =
(let ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree) = sem _lhsIcat _lhsIidenv _lhsIlib
in (Syn_Constraint _lhsOannotatedTree _lhsOfixedUpIdentifiersTree _lhsOoriginalTree ))
sem_Constraint_CheckConstraint :: Annotation ->
String ->
T_ScalarExpr ->
T_Constraint
sem_Constraint_CheckConstraint ann_ name_ expr_ =
(\ _lhsIcat
_lhsIidenv
_lhsIlib ->
(let _exprOexpectedType :: (Maybe Type)
_lhsOannotatedTree :: Constraint
_lhsOfixedUpIdentifiersTree :: Constraint
_lhsOoriginalTree :: Constraint
_exprOcat :: Catalog
_exprOidenv :: IDEnv
_exprOlib :: LocalBindings
_exprIannotatedTree :: ScalarExpr
_exprIfixedUpIdentifiersTree :: ScalarExpr
_exprIoriginalTree :: ScalarExpr
_exprIuType :: (Maybe Type)
_exprOexpectedType =
Nothing
_annotatedTree =
CheckConstraint ann_ name_ _exprIannotatedTree
_fixedUpIdentifiersTree =
CheckConstraint ann_ name_ _exprIfixedUpIdentifiersTree
_originalTree =
CheckConstraint ann_ name_ _exprIoriginalTree
_lhsOannotatedTree =
_annotatedTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
_exprOcat =
_lhsIcat
_exprOidenv =
_lhsIidenv
_exprOlib =
_lhsIlib
( _exprIannotatedTree,_exprIfixedUpIdentifiersTree,_exprIoriginalTree,_exprIuType) =
expr_ _exprOcat _exprOexpectedType _exprOidenv _exprOlib
in ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree)))
sem_Constraint_PrimaryKeyConstraint :: Annotation ->
String ->
([NameComponent]) ->
T_Constraint
sem_Constraint_PrimaryKeyConstraint ann_ name_ x_ =
(\ _lhsIcat
_lhsIidenv
_lhsIlib ->
(let _lhsOannotatedTree :: Constraint
_lhsOfixedUpIdentifiersTree :: Constraint
_lhsOoriginalTree :: Constraint
_annotatedTree =
PrimaryKeyConstraint ann_ name_ x_
_fixedUpIdentifiersTree =
PrimaryKeyConstraint ann_ name_ x_
_originalTree =
PrimaryKeyConstraint ann_ name_ x_
_lhsOannotatedTree =
_annotatedTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
in ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree)))
sem_Constraint_ReferenceConstraint :: Annotation ->
String ->
([NameComponent]) ->
T_Name ->
([NameComponent]) ->
Cascade ->
Cascade ->
T_Constraint
sem_Constraint_ReferenceConstraint ann_ name_ atts_ table_ tableAtts_ onUpdate_ onDelete_ =
(\ _lhsIcat
_lhsIidenv
_lhsIlib ->
(let _lhsOannotatedTree :: Constraint
_lhsOfixedUpIdentifiersTree :: Constraint
_lhsOoriginalTree :: Constraint
_tableOcat :: Catalog
_tableOidenv :: IDEnv
_tableOlib :: LocalBindings
_tableIannotatedTree :: Name
_tableIfixedUpIdentifiersTree :: Name
_tableIoriginalTree :: Name
_tableItbAnnotatedTree :: Name
_tableItbUType :: (Maybe ([(String,Type)],[(String,Type)]))
_annotatedTree =
ReferenceConstraint ann_ name_ atts_ _tableIannotatedTree tableAtts_ onUpdate_ onDelete_
_fixedUpIdentifiersTree =
ReferenceConstraint ann_ name_ atts_ _tableIfixedUpIdentifiersTree tableAtts_ onUpdate_ onDelete_
_originalTree =
ReferenceConstraint ann_ name_ atts_ _tableIoriginalTree tableAtts_ onUpdate_ onDelete_
_lhsOannotatedTree =
_annotatedTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
_tableOcat =
_lhsIcat
_tableOidenv =
_lhsIidenv
_tableOlib =
_lhsIlib
( _tableIannotatedTree,_tableIfixedUpIdentifiersTree,_tableIoriginalTree,_tableItbAnnotatedTree,_tableItbUType) =
table_ _tableOcat _tableOidenv _tableOlib
in ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree)))
sem_Constraint_UniqueConstraint :: Annotation ->
String ->
([NameComponent]) ->
T_Constraint
sem_Constraint_UniqueConstraint ann_ name_ x_ =
(\ _lhsIcat
_lhsIidenv
_lhsIlib ->
(let _lhsOannotatedTree :: Constraint
_lhsOfixedUpIdentifiersTree :: Constraint
_lhsOoriginalTree :: Constraint
_annotatedTree =
UniqueConstraint ann_ name_ x_
_fixedUpIdentifiersTree =
UniqueConstraint ann_ name_ x_
_originalTree =
UniqueConstraint ann_ name_ x_
_lhsOannotatedTree =
_annotatedTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
in ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree)))
type ConstraintList = [Constraint ]
sem_ConstraintList :: ConstraintList ->
T_ConstraintList
sem_ConstraintList list =
(Prelude.foldr sem_ConstraintList_Cons sem_ConstraintList_Nil (Prelude.map sem_Constraint list) )
type T_ConstraintList = Catalog ->
IDEnv ->
LocalBindings ->
( ConstraintList ,ConstraintList ,ConstraintList )
data Inh_ConstraintList = Inh_ConstraintList {cat_Inh_ConstraintList :: Catalog,idenv_Inh_ConstraintList :: IDEnv,lib_Inh_ConstraintList :: LocalBindings}
data Syn_ConstraintList = Syn_ConstraintList {annotatedTree_Syn_ConstraintList :: ConstraintList ,fixedUpIdentifiersTree_Syn_ConstraintList :: ConstraintList ,originalTree_Syn_ConstraintList :: ConstraintList }
wrap_ConstraintList :: T_ConstraintList ->
Inh_ConstraintList ->
Syn_ConstraintList
wrap_ConstraintList sem (Inh_ConstraintList _lhsIcat _lhsIidenv _lhsIlib ) =
(let ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree) = sem _lhsIcat _lhsIidenv _lhsIlib
in (Syn_ConstraintList _lhsOannotatedTree _lhsOfixedUpIdentifiersTree _lhsOoriginalTree ))
sem_ConstraintList_Cons :: T_Constraint ->
T_ConstraintList ->
T_ConstraintList
sem_ConstraintList_Cons hd_ tl_ =
(\ _lhsIcat
_lhsIidenv
_lhsIlib ->
(let _lhsOannotatedTree :: ConstraintList
_lhsOfixedUpIdentifiersTree :: ConstraintList
_lhsOoriginalTree :: ConstraintList
_hdOcat :: Catalog
_hdOidenv :: IDEnv
_hdOlib :: LocalBindings
_tlOcat :: Catalog
_tlOidenv :: IDEnv
_tlOlib :: LocalBindings
_hdIannotatedTree :: Constraint
_hdIfixedUpIdentifiersTree :: Constraint
_hdIoriginalTree :: Constraint
_tlIannotatedTree :: ConstraintList
_tlIfixedUpIdentifiersTree :: ConstraintList
_tlIoriginalTree :: ConstraintList
_annotatedTree =
(:) _hdIannotatedTree _tlIannotatedTree
_fixedUpIdentifiersTree =
(:) _hdIfixedUpIdentifiersTree _tlIfixedUpIdentifiersTree
_originalTree =
(:) _hdIoriginalTree _tlIoriginalTree
_lhsOannotatedTree =
_annotatedTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
_hdOcat =
_lhsIcat
_hdOidenv =
_lhsIidenv
_hdOlib =
_lhsIlib
_tlOcat =
_lhsIcat
_tlOidenv =
_lhsIidenv
_tlOlib =
_lhsIlib
( _hdIannotatedTree,_hdIfixedUpIdentifiersTree,_hdIoriginalTree) =
hd_ _hdOcat _hdOidenv _hdOlib
( _tlIannotatedTree,_tlIfixedUpIdentifiersTree,_tlIoriginalTree) =
tl_ _tlOcat _tlOidenv _tlOlib
in ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree)))
sem_ConstraintList_Nil :: T_ConstraintList
sem_ConstraintList_Nil =
(\ _lhsIcat
_lhsIidenv
_lhsIlib ->
(let _lhsOannotatedTree :: ConstraintList
_lhsOfixedUpIdentifiersTree :: ConstraintList
_lhsOoriginalTree :: ConstraintList
_annotatedTree =
[]
_fixedUpIdentifiersTree =
[]
_originalTree =
[]
_lhsOannotatedTree =
_annotatedTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
in ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree)))
data FnBody = PlpgsqlFnBody (Annotation) (Statement )
| SqlFnBody (Annotation) (StatementList )
deriving ( Data,Eq,Show,Typeable)
sem_FnBody :: FnBody ->
T_FnBody
sem_FnBody (PlpgsqlFnBody _ann _blk ) =
(sem_FnBody_PlpgsqlFnBody _ann (sem_Statement _blk ) )
sem_FnBody (SqlFnBody _ann _sts ) =
(sem_FnBody_SqlFnBody _ann (sem_StatementList _sts ) )
type T_FnBody = Catalog ->
IDEnv ->
LocalBindings ->
( FnBody ,FnBody ,FnBody )
data Inh_FnBody = Inh_FnBody {cat_Inh_FnBody :: Catalog,idenv_Inh_FnBody :: IDEnv,lib_Inh_FnBody :: LocalBindings}
data Syn_FnBody = Syn_FnBody {annotatedTree_Syn_FnBody :: FnBody ,fixedUpIdentifiersTree_Syn_FnBody :: FnBody ,originalTree_Syn_FnBody :: FnBody }
wrap_FnBody :: T_FnBody ->
Inh_FnBody ->
Syn_FnBody
wrap_FnBody sem (Inh_FnBody _lhsIcat _lhsIidenv _lhsIlib ) =
(let ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree) = sem _lhsIcat _lhsIidenv _lhsIlib
in (Syn_FnBody _lhsOannotatedTree _lhsOfixedUpIdentifiersTree _lhsOoriginalTree ))
sem_FnBody_PlpgsqlFnBody :: Annotation ->
T_Statement ->
T_FnBody
sem_FnBody_PlpgsqlFnBody ann_ blk_ =
(\ _lhsIcat
_lhsIidenv
_lhsIlib ->
(let _blkOinProducedCat :: Catalog
_lhsOannotatedTree :: FnBody
_lhsOfixedUpIdentifiersTree :: FnBody
_lhsOoriginalTree :: FnBody
_blkOcat :: Catalog
_blkOidenv :: IDEnv
_blkOlib :: LocalBindings
_blkIannotatedTree :: Statement
_blkIcatUpdates :: ([CatalogUpdate])
_blkIfixedUpIdentifiersTree :: Statement
_blkIlibUpdates :: ([LocalBindingsUpdate])
_blkIoriginalTree :: Statement
_blkOinProducedCat =
emptyCatalog
_annotatedTree =
PlpgsqlFnBody ann_ _blkIannotatedTree
_fixedUpIdentifiersTree =
PlpgsqlFnBody ann_ _blkIfixedUpIdentifiersTree
_originalTree =
PlpgsqlFnBody ann_ _blkIoriginalTree
_lhsOannotatedTree =
_annotatedTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
_blkOcat =
_lhsIcat
_blkOidenv =
_lhsIidenv
_blkOlib =
_lhsIlib
( _blkIannotatedTree,_blkIcatUpdates,_blkIfixedUpIdentifiersTree,_blkIlibUpdates,_blkIoriginalTree) =
blk_ _blkOcat _blkOidenv _blkOinProducedCat _blkOlib
in ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree)))
sem_FnBody_SqlFnBody :: Annotation ->
T_StatementList ->
T_FnBody
sem_FnBody_SqlFnBody ann_ sts_ =
(\ _lhsIcat
_lhsIidenv
_lhsIlib ->
(let _stsOcatUpdates :: ([CatalogUpdate])
_stsOlibUpdates :: ([LocalBindingsUpdate])
_lhsOannotatedTree :: FnBody
_lhsOfixedUpIdentifiersTree :: FnBody
_lhsOoriginalTree :: FnBody
_stsOcat :: Catalog
_stsOidenv :: IDEnv
_stsOlib :: LocalBindings
_stsIannotatedTree :: StatementList
_stsIfixedUpIdentifiersTree :: StatementList
_stsIoriginalTree :: StatementList
_stsIproducedCat :: Catalog
_stsIproducedLib :: LocalBindings
_stsOcatUpdates =
[]
_stsOlibUpdates =
[]
_annotatedTree =
SqlFnBody ann_ _stsIannotatedTree
_fixedUpIdentifiersTree =
SqlFnBody ann_ _stsIfixedUpIdentifiersTree
_originalTree =
SqlFnBody ann_ _stsIoriginalTree
_lhsOannotatedTree =
_annotatedTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
_stsOcat =
_lhsIcat
_stsOidenv =
_lhsIidenv
_stsOlib =
_lhsIlib
( _stsIannotatedTree,_stsIfixedUpIdentifiersTree,_stsIoriginalTree,_stsIproducedCat,_stsIproducedLib) =
sts_ _stsOcat _stsOcatUpdates _stsOidenv _stsOlib _stsOlibUpdates
in ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree)))
data InList = InList (Annotation) (ScalarExprList )
| InQueryExpr (Annotation) (QueryExpr )
deriving ( Data,Eq,Show,Typeable)
sem_InList :: InList ->
T_InList
sem_InList (InList _ann _exprs ) =
(sem_InList_InList _ann (sem_ScalarExprList _exprs ) )
sem_InList (InQueryExpr _ann _sel ) =
(sem_InList_InQueryExpr _ann (sem_QueryExpr _sel ) )
type T_InList = Catalog ->
(Maybe Type) ->
IDEnv ->
LocalBindings ->
( InList ,InList ,(Either [TypeError] Type),InList )
data Inh_InList = Inh_InList {cat_Inh_InList :: Catalog,expectedType_Inh_InList :: (Maybe Type),idenv_Inh_InList :: IDEnv,lib_Inh_InList :: LocalBindings}
data Syn_InList = Syn_InList {annotatedTree_Syn_InList :: InList ,fixedUpIdentifiersTree_Syn_InList :: InList ,listType_Syn_InList :: (Either [TypeError] Type),originalTree_Syn_InList :: InList }
wrap_InList :: T_InList ->
Inh_InList ->
Syn_InList
wrap_InList sem (Inh_InList _lhsIcat _lhsIexpectedType _lhsIidenv _lhsIlib ) =
(let ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOlistType,_lhsOoriginalTree) = sem _lhsIcat _lhsIexpectedType _lhsIidenv _lhsIlib
in (Syn_InList _lhsOannotatedTree _lhsOfixedUpIdentifiersTree _lhsOlistType _lhsOoriginalTree ))
sem_InList_InList :: Annotation ->
T_ScalarExprList ->
T_InList
sem_InList_InList ann_ exprs_ =
(\ _lhsIcat
_lhsIexpectedType
_lhsIidenv
_lhsIlib ->
(let _lhsOlistType :: (Either [TypeError] Type)
_exprsOexpectedTypes :: ([Maybe Type])
_lhsOannotatedTree :: InList
_lhsOfixedUpIdentifiersTree :: InList
_lhsOoriginalTree :: InList
_exprsOcat :: Catalog
_exprsOidenv :: IDEnv
_exprsOlib :: LocalBindings
_exprsIannotatedTree :: ScalarExprList
_exprsIfixedUpIdentifiersTree :: ScalarExprList
_exprsIoriginalTree :: ScalarExprList
_exprsIuType :: ([Maybe Type])
_lhsOlistType =
mapM lmt _exprsIuType >>= resolveResultSetType _lhsIcat
_exprsOexpectedTypes =
repeat _lhsIexpectedType
_annotatedTree =
InList ann_ _exprsIannotatedTree
_fixedUpIdentifiersTree =
InList ann_ _exprsIfixedUpIdentifiersTree
_originalTree =
InList ann_ _exprsIoriginalTree
_lhsOannotatedTree =
_annotatedTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
_exprsOcat =
_lhsIcat
_exprsOidenv =
_lhsIidenv
_exprsOlib =
_lhsIlib
( _exprsIannotatedTree,_exprsIfixedUpIdentifiersTree,_exprsIoriginalTree,_exprsIuType) =
exprs_ _exprsOcat _exprsOexpectedTypes _exprsOidenv _exprsOlib
in ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOlistType,_lhsOoriginalTree)))
sem_InList_InQueryExpr :: Annotation ->
T_QueryExpr ->
T_InList
sem_InList_InQueryExpr ann_ sel_ =
(\ _lhsIcat
_lhsIexpectedType
_lhsIidenv
_lhsIlib ->
(let _lhsOlistType :: (Either [TypeError] Type)
_selOcsql :: LocalBindings
_selOexpectedTypes :: ([Maybe Type])
_lhsOannotatedTree :: InList
_lhsOfixedUpIdentifiersTree :: InList
_lhsOoriginalTree :: InList
_selOcat :: Catalog
_selOidenv :: IDEnv
_selOlib :: LocalBindings
_selIannotatedTree :: QueryExpr
_selIcidenv :: IDEnv
_selIfixedUpIdentifiersTree :: QueryExpr
_selIlibUpdates :: ([LocalBindingsUpdate])
_selIoriginalTree :: QueryExpr
_selIuType :: (Maybe [(String,Type)])
_lhsOlistType =
do
st <- lmt (map snd <$> _selIuType)
case length st of
0 -> Left [InternalError
"got subquery with no columns? in inselect"]
1 -> Right $ head st
_ -> Right $ AnonymousRecordType st
_selOcsql =
emptyBindings
_selOexpectedTypes =
[]
_annotatedTree =
InQueryExpr ann_ _selIannotatedTree
_fixedUpIdentifiersTree =
InQueryExpr ann_ _selIfixedUpIdentifiersTree
_originalTree =
InQueryExpr ann_ _selIoriginalTree
_lhsOannotatedTree =
_annotatedTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
_selOcat =
_lhsIcat
_selOidenv =
_lhsIidenv
_selOlib =
_lhsIlib
( _selIannotatedTree,_selIcidenv,_selIfixedUpIdentifiersTree,_selIlibUpdates,_selIoriginalTree,_selIuType) =
sel_ _selOcat _selOcsql _selOexpectedTypes _selOidenv _selOlib
in ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOlistType,_lhsOoriginalTree)))
data JoinExpr = JoinOn (Annotation) (ScalarExpr )
| JoinUsing (Annotation) (([NameComponent]))
deriving ( Data,Eq,Show,Typeable)
sem_JoinExpr :: JoinExpr ->
T_JoinExpr
sem_JoinExpr (JoinOn _ann _expr ) =
(sem_JoinExpr_JoinOn _ann (sem_ScalarExpr _expr ) )
sem_JoinExpr (JoinUsing _ann _x ) =
(sem_JoinExpr_JoinUsing _ann _x )
type T_JoinExpr = Catalog ->
IDEnv ->
LocalBindings ->
( JoinExpr ,JoinExpr ,JoinExpr )
data Inh_JoinExpr = Inh_JoinExpr {cat_Inh_JoinExpr :: Catalog,idenv_Inh_JoinExpr :: IDEnv,lib_Inh_JoinExpr :: LocalBindings}
data Syn_JoinExpr = Syn_JoinExpr {annotatedTree_Syn_JoinExpr :: JoinExpr ,fixedUpIdentifiersTree_Syn_JoinExpr :: JoinExpr ,originalTree_Syn_JoinExpr :: JoinExpr }
wrap_JoinExpr :: T_JoinExpr ->
Inh_JoinExpr ->
Syn_JoinExpr
wrap_JoinExpr sem (Inh_JoinExpr _lhsIcat _lhsIidenv _lhsIlib ) =
(let ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree) = sem _lhsIcat _lhsIidenv _lhsIlib
in (Syn_JoinExpr _lhsOannotatedTree _lhsOfixedUpIdentifiersTree _lhsOoriginalTree ))
sem_JoinExpr_JoinOn :: Annotation ->
T_ScalarExpr ->
T_JoinExpr
sem_JoinExpr_JoinOn ann_ expr_ =
(\ _lhsIcat
_lhsIidenv
_lhsIlib ->
(let _exprOexpectedType :: (Maybe Type)
_lhsOannotatedTree :: JoinExpr
_lhsOfixedUpIdentifiersTree :: JoinExpr
_lhsOoriginalTree :: JoinExpr
_exprOcat :: Catalog
_exprOidenv :: IDEnv
_exprOlib :: LocalBindings
_exprIannotatedTree :: ScalarExpr
_exprIfixedUpIdentifiersTree :: ScalarExpr
_exprIoriginalTree :: ScalarExpr
_exprIuType :: (Maybe Type)
_exprOexpectedType =
Just typeBool
_annotatedTree =
JoinOn ann_ _exprIannotatedTree
_fixedUpIdentifiersTree =
JoinOn ann_ _exprIfixedUpIdentifiersTree
_originalTree =
JoinOn ann_ _exprIoriginalTree
_lhsOannotatedTree =
_annotatedTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
_exprOcat =
_lhsIcat
_exprOidenv =
_lhsIidenv
_exprOlib =
_lhsIlib
( _exprIannotatedTree,_exprIfixedUpIdentifiersTree,_exprIoriginalTree,_exprIuType) =
expr_ _exprOcat _exprOexpectedType _exprOidenv _exprOlib
in ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree)))
sem_JoinExpr_JoinUsing :: Annotation ->
([NameComponent]) ->
T_JoinExpr
sem_JoinExpr_JoinUsing ann_ x_ =
(\ _lhsIcat
_lhsIidenv
_lhsIlib ->
(let _lhsOannotatedTree :: JoinExpr
_lhsOfixedUpIdentifiersTree :: JoinExpr
_lhsOoriginalTree :: JoinExpr
_annotatedTree =
JoinUsing ann_ x_
_fixedUpIdentifiersTree =
JoinUsing ann_ x_
_originalTree =
JoinUsing ann_ x_
_lhsOannotatedTree =
_annotatedTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
in ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree)))
type MaybeBoolExpr = Maybe ScalarExpr
sem_MaybeBoolExpr :: MaybeBoolExpr ->
T_MaybeBoolExpr
sem_MaybeBoolExpr (Prelude.Just x ) =
(sem_MaybeBoolExpr_Just (sem_ScalarExpr x ) )
sem_MaybeBoolExpr Prelude.Nothing =
sem_MaybeBoolExpr_Nothing
type T_MaybeBoolExpr = Catalog ->
IDEnv ->
LocalBindings ->
( MaybeBoolExpr ,MaybeBoolExpr ,MaybeBoolExpr )
data Inh_MaybeBoolExpr = Inh_MaybeBoolExpr {cat_Inh_MaybeBoolExpr :: Catalog,idenv_Inh_MaybeBoolExpr :: IDEnv,lib_Inh_MaybeBoolExpr :: LocalBindings}
data Syn_MaybeBoolExpr = Syn_MaybeBoolExpr {annotatedTree_Syn_MaybeBoolExpr :: MaybeBoolExpr ,fixedUpIdentifiersTree_Syn_MaybeBoolExpr :: MaybeBoolExpr ,originalTree_Syn_MaybeBoolExpr :: MaybeBoolExpr }
wrap_MaybeBoolExpr :: T_MaybeBoolExpr ->
Inh_MaybeBoolExpr ->
Syn_MaybeBoolExpr
wrap_MaybeBoolExpr sem (Inh_MaybeBoolExpr _lhsIcat _lhsIidenv _lhsIlib ) =
(let ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree) = sem _lhsIcat _lhsIidenv _lhsIlib
in (Syn_MaybeBoolExpr _lhsOannotatedTree _lhsOfixedUpIdentifiersTree _lhsOoriginalTree ))
sem_MaybeBoolExpr_Just :: T_ScalarExpr ->
T_MaybeBoolExpr
sem_MaybeBoolExpr_Just just_ =
(\ _lhsIcat
_lhsIidenv
_lhsIlib ->
(let _lhsOannotatedTree :: MaybeBoolExpr
_justOexpectedType :: (Maybe Type)
_lhsOfixedUpIdentifiersTree :: MaybeBoolExpr
_lhsOoriginalTree :: MaybeBoolExpr
_justOcat :: Catalog
_justOidenv :: IDEnv
_justOlib :: LocalBindings
_justIannotatedTree :: ScalarExpr
_justIfixedUpIdentifiersTree :: ScalarExpr
_justIoriginalTree :: ScalarExpr
_justIuType :: (Maybe Type)
_lhsOannotatedTree =
let t = _justIuType
in if t `elem` [Nothing,Just typeBool]
then Just _justIannotatedTree
else Just $ addTypeErrors [ExpressionMustBeBool] _justIannotatedTree
_justOexpectedType =
Just typeBool
_annotatedTree =
Just _justIannotatedTree
_fixedUpIdentifiersTree =
Just _justIfixedUpIdentifiersTree
_originalTree =
Just _justIoriginalTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
_justOcat =
_lhsIcat
_justOidenv =
_lhsIidenv
_justOlib =
_lhsIlib
( _justIannotatedTree,_justIfixedUpIdentifiersTree,_justIoriginalTree,_justIuType) =
just_ _justOcat _justOexpectedType _justOidenv _justOlib
in ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree)))
sem_MaybeBoolExpr_Nothing :: T_MaybeBoolExpr
sem_MaybeBoolExpr_Nothing =
(\ _lhsIcat
_lhsIidenv
_lhsIlib ->
(let _lhsOannotatedTree :: MaybeBoolExpr
_lhsOfixedUpIdentifiersTree :: MaybeBoolExpr
_lhsOoriginalTree :: MaybeBoolExpr
_annotatedTree =
Nothing
_fixedUpIdentifiersTree =
Nothing
_originalTree =
Nothing
_lhsOannotatedTree =
_annotatedTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
in ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree)))
type MaybeNameComponentList = Maybe NameComponentList
sem_MaybeNameComponentList :: MaybeNameComponentList ->
T_MaybeNameComponentList
sem_MaybeNameComponentList (Prelude.Just x ) =
(sem_MaybeNameComponentList_Just (sem_NameComponentList x ) )
sem_MaybeNameComponentList Prelude.Nothing =
sem_MaybeNameComponentList_Nothing
type T_MaybeNameComponentList = ( )
data Inh_MaybeNameComponentList = Inh_MaybeNameComponentList {}
data Syn_MaybeNameComponentList = Syn_MaybeNameComponentList {}
wrap_MaybeNameComponentList :: T_MaybeNameComponentList ->
Inh_MaybeNameComponentList ->
Syn_MaybeNameComponentList
wrap_MaybeNameComponentList sem (Inh_MaybeNameComponentList ) =
(let ( ) = sem
in (Syn_MaybeNameComponentList ))
sem_MaybeNameComponentList_Just :: T_NameComponentList ->
T_MaybeNameComponentList
sem_MaybeNameComponentList_Just just_ =
(let
in ( ))
sem_MaybeNameComponentList_Nothing :: T_MaybeNameComponentList
sem_MaybeNameComponentList_Nothing =
(let
in ( ))
type MaybeScalarExpr = Maybe ScalarExpr
sem_MaybeScalarExpr :: MaybeScalarExpr ->
T_MaybeScalarExpr
sem_MaybeScalarExpr (Prelude.Just x ) =
(sem_MaybeScalarExpr_Just (sem_ScalarExpr x ) )
sem_MaybeScalarExpr Prelude.Nothing =
sem_MaybeScalarExpr_Nothing
type T_MaybeScalarExpr = Catalog ->
IDEnv ->
LocalBindings ->
( MaybeScalarExpr ,MaybeScalarExpr ,MaybeScalarExpr ,(Maybe Type))
data Inh_MaybeScalarExpr = Inh_MaybeScalarExpr {cat_Inh_MaybeScalarExpr :: Catalog,idenv_Inh_MaybeScalarExpr :: IDEnv,lib_Inh_MaybeScalarExpr :: LocalBindings}
data Syn_MaybeScalarExpr = Syn_MaybeScalarExpr {annotatedTree_Syn_MaybeScalarExpr :: MaybeScalarExpr ,fixedUpIdentifiersTree_Syn_MaybeScalarExpr :: MaybeScalarExpr ,originalTree_Syn_MaybeScalarExpr :: MaybeScalarExpr ,uType_Syn_MaybeScalarExpr :: (Maybe Type)}
wrap_MaybeScalarExpr :: T_MaybeScalarExpr ->
Inh_MaybeScalarExpr ->
Syn_MaybeScalarExpr
wrap_MaybeScalarExpr sem (Inh_MaybeScalarExpr _lhsIcat _lhsIidenv _lhsIlib ) =
(let ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree,_lhsOuType) = sem _lhsIcat _lhsIidenv _lhsIlib
in (Syn_MaybeScalarExpr _lhsOannotatedTree _lhsOfixedUpIdentifiersTree _lhsOoriginalTree _lhsOuType ))
sem_MaybeScalarExpr_Just :: T_ScalarExpr ->
T_MaybeScalarExpr
sem_MaybeScalarExpr_Just just_ =
(\ _lhsIcat
_lhsIidenv
_lhsIlib ->
(let _lhsOuType :: (Maybe Type)
_justOexpectedType :: (Maybe Type)
_lhsOannotatedTree :: MaybeScalarExpr
_lhsOfixedUpIdentifiersTree :: MaybeScalarExpr
_lhsOoriginalTree :: MaybeScalarExpr
_justOcat :: Catalog
_justOidenv :: IDEnv
_justOlib :: LocalBindings
_justIannotatedTree :: ScalarExpr
_justIfixedUpIdentifiersTree :: ScalarExpr
_justIoriginalTree :: ScalarExpr
_justIuType :: (Maybe Type)
_lhsOuType =
_justIuType
_justOexpectedType =
Nothing
_annotatedTree =
Just _justIannotatedTree
_fixedUpIdentifiersTree =
Just _justIfixedUpIdentifiersTree
_originalTree =
Just _justIoriginalTree
_lhsOannotatedTree =
_annotatedTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
_justOcat =
_lhsIcat
_justOidenv =
_lhsIidenv
_justOlib =
_lhsIlib
( _justIannotatedTree,_justIfixedUpIdentifiersTree,_justIoriginalTree,_justIuType) =
just_ _justOcat _justOexpectedType _justOidenv _justOlib
in ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree,_lhsOuType)))
sem_MaybeScalarExpr_Nothing :: T_MaybeScalarExpr
sem_MaybeScalarExpr_Nothing =
(\ _lhsIcat
_lhsIidenv
_lhsIlib ->
(let _lhsOuType :: (Maybe Type)
_lhsOannotatedTree :: MaybeScalarExpr
_lhsOfixedUpIdentifiersTree :: MaybeScalarExpr
_lhsOoriginalTree :: MaybeScalarExpr
_lhsOuType =
Nothing
_annotatedTree =
Nothing
_fixedUpIdentifiersTree =
Nothing
_originalTree =
Nothing
_lhsOannotatedTree =
_annotatedTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
in ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree,_lhsOuType)))
type MaybeSelectList = Maybe SelectList
sem_MaybeSelectList :: MaybeSelectList ->
T_MaybeSelectList
sem_MaybeSelectList (Prelude.Just x ) =
(sem_MaybeSelectList_Just (sem_SelectList x ) )
sem_MaybeSelectList Prelude.Nothing =
sem_MaybeSelectList_Nothing
type T_MaybeSelectList = Catalog ->
IDEnv ->
LocalBindings ->
( MaybeSelectList ,MaybeSelectList ,([(String,Maybe Type)]),MaybeSelectList )
data Inh_MaybeSelectList = Inh_MaybeSelectList {cat_Inh_MaybeSelectList :: Catalog,idenv_Inh_MaybeSelectList :: IDEnv,lib_Inh_MaybeSelectList :: LocalBindings}
data Syn_MaybeSelectList = Syn_MaybeSelectList {annotatedTree_Syn_MaybeSelectList :: MaybeSelectList ,fixedUpIdentifiersTree_Syn_MaybeSelectList :: MaybeSelectList ,listType_Syn_MaybeSelectList :: ([(String,Maybe Type)]),originalTree_Syn_MaybeSelectList :: MaybeSelectList }
wrap_MaybeSelectList :: T_MaybeSelectList ->
Inh_MaybeSelectList ->
Syn_MaybeSelectList
wrap_MaybeSelectList sem (Inh_MaybeSelectList _lhsIcat _lhsIidenv _lhsIlib ) =
(let ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOlistType,_lhsOoriginalTree) = sem _lhsIcat _lhsIidenv _lhsIlib
in (Syn_MaybeSelectList _lhsOannotatedTree _lhsOfixedUpIdentifiersTree _lhsOlistType _lhsOoriginalTree ))
sem_MaybeSelectList_Just :: T_SelectList ->
T_MaybeSelectList
sem_MaybeSelectList_Just just_ =
(\ _lhsIcat
_lhsIidenv
_lhsIlib ->
(let _lhsOlistType :: ([(String,Maybe Type)])
_lhsOannotatedTree :: MaybeSelectList
_lhsOfixedUpIdentifiersTree :: MaybeSelectList
_lhsOoriginalTree :: MaybeSelectList
_justOcat :: Catalog
_justOidenv :: IDEnv
_justOlib :: LocalBindings
_justIannotatedTree :: SelectList
_justIcidenv :: IDEnv
_justIfixedUpIdentifiersTree :: SelectList
_justIlibUpdates :: ([LocalBindingsUpdate])
_justIlistType :: ([(String,Maybe Type)])
_justIoriginalTree :: SelectList
_lhsOlistType =
_justIlistType
_annotatedTree =
Just _justIannotatedTree
_fixedUpIdentifiersTree =
Just _justIfixedUpIdentifiersTree
_originalTree =
Just _justIoriginalTree
_lhsOannotatedTree =
_annotatedTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
_justOcat =
_lhsIcat
_justOidenv =
_lhsIidenv
_justOlib =
_lhsIlib
( _justIannotatedTree,_justIcidenv,_justIfixedUpIdentifiersTree,_justIlibUpdates,_justIlistType,_justIoriginalTree) =
just_ _justOcat _justOidenv _justOlib
in ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOlistType,_lhsOoriginalTree)))
sem_MaybeSelectList_Nothing :: T_MaybeSelectList
sem_MaybeSelectList_Nothing =
(\ _lhsIcat
_lhsIidenv
_lhsIlib ->
(let _lhsOlistType :: ([(String,Maybe Type)])
_lhsOannotatedTree :: MaybeSelectList
_lhsOfixedUpIdentifiersTree :: MaybeSelectList
_lhsOoriginalTree :: MaybeSelectList
_lhsOlistType =
[]
_annotatedTree =
Nothing
_fixedUpIdentifiersTree =
Nothing
_originalTree =
Nothing
_lhsOannotatedTree =
_annotatedTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
in ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOlistType,_lhsOoriginalTree)))
data Name = Name (Annotation) (([NameComponent]))
deriving ( Data,Eq,Show,Typeable)
sem_Name :: Name ->
T_Name
sem_Name (Name _ann _is ) =
(sem_Name_Name _ann _is )
type T_Name = Catalog ->
IDEnv ->
LocalBindings ->
( Name ,Name ,Name ,Name ,(Maybe ([(String,Type)],[(String,Type)])))
data Inh_Name = Inh_Name {cat_Inh_Name :: Catalog,idenv_Inh_Name :: IDEnv,lib_Inh_Name :: LocalBindings}
data Syn_Name = Syn_Name {annotatedTree_Syn_Name :: Name ,fixedUpIdentifiersTree_Syn_Name :: Name ,originalTree_Syn_Name :: Name ,tbAnnotatedTree_Syn_Name :: Name ,tbUType_Syn_Name :: (Maybe ([(String,Type)],[(String,Type)]))}
wrap_Name :: T_Name ->
Inh_Name ->
Syn_Name
wrap_Name sem (Inh_Name _lhsIcat _lhsIidenv _lhsIlib ) =
(let ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree,_lhsOtbAnnotatedTree,_lhsOtbUType) = sem _lhsIcat _lhsIidenv _lhsIlib
in (Syn_Name _lhsOannotatedTree _lhsOfixedUpIdentifiersTree _lhsOoriginalTree _lhsOtbAnnotatedTree _lhsOtbUType ))
sem_Name_Name :: Annotation ->
([NameComponent]) ->
T_Name
sem_Name_Name ann_ is_ =
(\ _lhsIcat
_lhsIidenv
_lhsIlib ->
(let _tpe :: (E ([(String,Type)],[(String,Type)]))
_lhsOtbUType :: (Maybe ([(String,Type)],[(String,Type)]))
_lhsOtbAnnotatedTree :: Name
_lhsOannotatedTree :: Name
_lhsOfixedUpIdentifiersTree :: Name
_lhsOoriginalTree :: Name
_tpe =
catCompositeAttrsPair _lhsIcat relationComposites
(getUnqual is_)
_lhsOtbUType =
either (const Nothing) Just _tpe
_lhsOtbAnnotatedTree =
updateAnnotation
(\a -> a {errs = errs a ++ tes _tpe }) _backTree
_backTree =
Name ann_ is_
_annotatedTree =
Name ann_ is_
_fixedUpIdentifiersTree =
Name ann_ is_
_originalTree =
Name ann_ is_
_lhsOannotatedTree =
_annotatedTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
in ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree,_lhsOtbAnnotatedTree,_lhsOtbUType)))
type NameComponentList = [(NameComponent)]
sem_NameComponentList :: NameComponentList ->
T_NameComponentList
sem_NameComponentList list =
(Prelude.foldr sem_NameComponentList_Cons sem_NameComponentList_Nil list )
type T_NameComponentList = ( )
data Inh_NameComponentList = Inh_NameComponentList {}
data Syn_NameComponentList = Syn_NameComponentList {}
wrap_NameComponentList :: T_NameComponentList ->
Inh_NameComponentList ->
Syn_NameComponentList
wrap_NameComponentList sem (Inh_NameComponentList ) =
(let ( ) = sem
in (Syn_NameComponentList ))
sem_NameComponentList_Cons :: NameComponent ->
T_NameComponentList ->
T_NameComponentList
sem_NameComponentList_Cons hd_ tl_ =
(let
in ( ))
sem_NameComponentList_Nil :: T_NameComponentList
sem_NameComponentList_Nil =
(let
in ( ))
type NameTypeNameListPair = ( Name ,TypeNameList )
sem_NameTypeNameListPair :: NameTypeNameListPair ->
T_NameTypeNameListPair
sem_NameTypeNameListPair ( x1,x2) =
(sem_NameTypeNameListPair_Tuple (sem_Name x1 ) (sem_TypeNameList x2 ) )
type T_NameTypeNameListPair = Catalog ->
IDEnv ->
LocalBindings ->
( NameTypeNameListPair ,NameTypeNameListPair ,((Name,[Maybe Type])),NameTypeNameListPair )
data Inh_NameTypeNameListPair = Inh_NameTypeNameListPair {cat_Inh_NameTypeNameListPair :: Catalog,idenv_Inh_NameTypeNameListPair :: IDEnv,lib_Inh_NameTypeNameListPair :: LocalBindings}
data Syn_NameTypeNameListPair = Syn_NameTypeNameListPair {annotatedTree_Syn_NameTypeNameListPair :: NameTypeNameListPair ,fixedUpIdentifiersTree_Syn_NameTypeNameListPair :: NameTypeNameListPair ,fnSig_Syn_NameTypeNameListPair :: ((Name,[Maybe Type])),originalTree_Syn_NameTypeNameListPair :: NameTypeNameListPair }
wrap_NameTypeNameListPair :: T_NameTypeNameListPair ->
Inh_NameTypeNameListPair ->
Syn_NameTypeNameListPair
wrap_NameTypeNameListPair sem (Inh_NameTypeNameListPair _lhsIcat _lhsIidenv _lhsIlib ) =
(let ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOfnSig,_lhsOoriginalTree) = sem _lhsIcat _lhsIidenv _lhsIlib
in (Syn_NameTypeNameListPair _lhsOannotatedTree _lhsOfixedUpIdentifiersTree _lhsOfnSig _lhsOoriginalTree ))
sem_NameTypeNameListPair_Tuple :: T_Name ->
T_TypeNameList ->
T_NameTypeNameListPair
sem_NameTypeNameListPair_Tuple x1_ x2_ =
(\ _lhsIcat
_lhsIidenv
_lhsIlib ->
(let _lhsOfnSig :: ((Name,[Maybe Type]))
_lhsOannotatedTree :: NameTypeNameListPair
_lhsOfixedUpIdentifiersTree :: NameTypeNameListPair
_lhsOoriginalTree :: NameTypeNameListPair
_x1Ocat :: Catalog
_x1Oidenv :: IDEnv
_x1Olib :: LocalBindings
_x2Ocat :: Catalog
_x2Oidenv :: IDEnv
_x2Olib :: LocalBindings
_x1IannotatedTree :: Name
_x1IfixedUpIdentifiersTree :: Name
_x1IoriginalTree :: Name
_x1ItbAnnotatedTree :: Name
_x1ItbUType :: (Maybe ([(String,Type)],[(String,Type)]))
_x2IannotatedTree :: TypeNameList
_x2IfixedUpIdentifiersTree :: TypeNameList
_x2InamedTypes :: ([Maybe Type])
_x2IoriginalTree :: TypeNameList
_lhsOfnSig =
(_x1IoriginalTree, _x2InamedTypes)
_annotatedTree =
(_x1IannotatedTree,_x2IannotatedTree)
_fixedUpIdentifiersTree =
(_x1IfixedUpIdentifiersTree,_x2IfixedUpIdentifiersTree)
_originalTree =
(_x1IoriginalTree,_x2IoriginalTree)
_lhsOannotatedTree =
_annotatedTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
_x1Ocat =
_lhsIcat
_x1Oidenv =
_lhsIidenv
_x1Olib =
_lhsIlib
_x2Ocat =
_lhsIcat
_x2Oidenv =
_lhsIidenv
_x2Olib =
_lhsIlib
( _x1IannotatedTree,_x1IfixedUpIdentifiersTree,_x1IoriginalTree,_x1ItbAnnotatedTree,_x1ItbUType) =
x1_ _x1Ocat _x1Oidenv _x1Olib
( _x2IannotatedTree,_x2IfixedUpIdentifiersTree,_x2InamedTypes,_x2IoriginalTree) =
x2_ _x2Ocat _x2Oidenv _x2Olib
in ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOfnSig,_lhsOoriginalTree)))
type NameTypeNameListPairList = [NameTypeNameListPair ]
sem_NameTypeNameListPairList :: NameTypeNameListPairList ->
T_NameTypeNameListPairList
sem_NameTypeNameListPairList list =
(Prelude.foldr sem_NameTypeNameListPairList_Cons sem_NameTypeNameListPairList_Nil (Prelude.map sem_NameTypeNameListPair list) )
type T_NameTypeNameListPairList = Catalog ->
IDEnv ->
LocalBindings ->
( NameTypeNameListPairList ,NameTypeNameListPairList ,([(Name,[Maybe Type])]),NameTypeNameListPairList )
data Inh_NameTypeNameListPairList = Inh_NameTypeNameListPairList {cat_Inh_NameTypeNameListPairList :: Catalog,idenv_Inh_NameTypeNameListPairList :: IDEnv,lib_Inh_NameTypeNameListPairList :: LocalBindings}
data Syn_NameTypeNameListPairList = Syn_NameTypeNameListPairList {annotatedTree_Syn_NameTypeNameListPairList :: NameTypeNameListPairList ,fixedUpIdentifiersTree_Syn_NameTypeNameListPairList :: NameTypeNameListPairList ,fnSigs_Syn_NameTypeNameListPairList :: ([(Name,[Maybe Type])]),originalTree_Syn_NameTypeNameListPairList :: NameTypeNameListPairList }
wrap_NameTypeNameListPairList :: T_NameTypeNameListPairList ->
Inh_NameTypeNameListPairList ->
Syn_NameTypeNameListPairList
wrap_NameTypeNameListPairList sem (Inh_NameTypeNameListPairList _lhsIcat _lhsIidenv _lhsIlib ) =
(let ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOfnSigs,_lhsOoriginalTree) = sem _lhsIcat _lhsIidenv _lhsIlib
in (Syn_NameTypeNameListPairList _lhsOannotatedTree _lhsOfixedUpIdentifiersTree _lhsOfnSigs _lhsOoriginalTree ))
sem_NameTypeNameListPairList_Cons :: T_NameTypeNameListPair ->
T_NameTypeNameListPairList ->
T_NameTypeNameListPairList
sem_NameTypeNameListPairList_Cons hd_ tl_ =
(\ _lhsIcat
_lhsIidenv
_lhsIlib ->
(let _lhsOfnSigs :: ([(Name,[Maybe Type])])
_lhsOannotatedTree :: NameTypeNameListPairList
_lhsOfixedUpIdentifiersTree :: NameTypeNameListPairList
_lhsOoriginalTree :: NameTypeNameListPairList
_hdOcat :: Catalog
_hdOidenv :: IDEnv
_hdOlib :: LocalBindings
_tlOcat :: Catalog
_tlOidenv :: IDEnv
_tlOlib :: LocalBindings
_hdIannotatedTree :: NameTypeNameListPair
_hdIfixedUpIdentifiersTree :: NameTypeNameListPair
_hdIfnSig :: ((Name,[Maybe Type]))
_hdIoriginalTree :: NameTypeNameListPair
_tlIannotatedTree :: NameTypeNameListPairList
_tlIfixedUpIdentifiersTree :: NameTypeNameListPairList
_tlIfnSigs :: ([(Name,[Maybe Type])])
_tlIoriginalTree :: NameTypeNameListPairList
_lhsOfnSigs =
_hdIfnSig : _tlIfnSigs
_annotatedTree =
(:) _hdIannotatedTree _tlIannotatedTree
_fixedUpIdentifiersTree =
(:) _hdIfixedUpIdentifiersTree _tlIfixedUpIdentifiersTree
_originalTree =
(:) _hdIoriginalTree _tlIoriginalTree
_lhsOannotatedTree =
_annotatedTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
_hdOcat =
_lhsIcat
_hdOidenv =
_lhsIidenv
_hdOlib =
_lhsIlib
_tlOcat =
_lhsIcat
_tlOidenv =
_lhsIidenv
_tlOlib =
_lhsIlib
( _hdIannotatedTree,_hdIfixedUpIdentifiersTree,_hdIfnSig,_hdIoriginalTree) =
hd_ _hdOcat _hdOidenv _hdOlib
( _tlIannotatedTree,_tlIfixedUpIdentifiersTree,_tlIfnSigs,_tlIoriginalTree) =
tl_ _tlOcat _tlOidenv _tlOlib
in ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOfnSigs,_lhsOoriginalTree)))
sem_NameTypeNameListPairList_Nil :: T_NameTypeNameListPairList
sem_NameTypeNameListPairList_Nil =
(\ _lhsIcat
_lhsIidenv
_lhsIlib ->
(let _lhsOfnSigs :: ([(Name,[Maybe Type])])
_lhsOannotatedTree :: NameTypeNameListPairList
_lhsOfixedUpIdentifiersTree :: NameTypeNameListPairList
_lhsOoriginalTree :: NameTypeNameListPairList
_lhsOfnSigs =
[]
_annotatedTree =
[]
_fixedUpIdentifiersTree =
[]
_originalTree =
[]
_lhsOannotatedTree =
_annotatedTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
in ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOfnSigs,_lhsOoriginalTree)))
type OnExpr = Maybe JoinExpr
sem_OnExpr :: OnExpr ->
T_OnExpr
sem_OnExpr (Prelude.Just x ) =
(sem_OnExpr_Just (sem_JoinExpr x ) )
sem_OnExpr Prelude.Nothing =
sem_OnExpr_Nothing
type T_OnExpr = Catalog ->
IDEnv ->
LocalBindings ->
( OnExpr ,OnExpr ,OnExpr )
data Inh_OnExpr = Inh_OnExpr {cat_Inh_OnExpr :: Catalog,idenv_Inh_OnExpr :: IDEnv,lib_Inh_OnExpr :: LocalBindings}
data Syn_OnExpr = Syn_OnExpr {annotatedTree_Syn_OnExpr :: OnExpr ,fixedUpIdentifiersTree_Syn_OnExpr :: OnExpr ,originalTree_Syn_OnExpr :: OnExpr }
wrap_OnExpr :: T_OnExpr ->
Inh_OnExpr ->
Syn_OnExpr
wrap_OnExpr sem (Inh_OnExpr _lhsIcat _lhsIidenv _lhsIlib ) =
(let ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree) = sem _lhsIcat _lhsIidenv _lhsIlib
in (Syn_OnExpr _lhsOannotatedTree _lhsOfixedUpIdentifiersTree _lhsOoriginalTree ))
sem_OnExpr_Just :: T_JoinExpr ->
T_OnExpr
sem_OnExpr_Just just_ =
(\ _lhsIcat
_lhsIidenv
_lhsIlib ->
(let _lhsOannotatedTree :: OnExpr
_lhsOfixedUpIdentifiersTree :: OnExpr
_lhsOoriginalTree :: OnExpr
_justOcat :: Catalog
_justOidenv :: IDEnv
_justOlib :: LocalBindings
_justIannotatedTree :: JoinExpr
_justIfixedUpIdentifiersTree :: JoinExpr
_justIoriginalTree :: JoinExpr
_annotatedTree =
Just _justIannotatedTree
_fixedUpIdentifiersTree =
Just _justIfixedUpIdentifiersTree
_originalTree =
Just _justIoriginalTree
_lhsOannotatedTree =
_annotatedTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
_justOcat =
_lhsIcat
_justOidenv =
_lhsIidenv
_justOlib =
_lhsIlib
( _justIannotatedTree,_justIfixedUpIdentifiersTree,_justIoriginalTree) =
just_ _justOcat _justOidenv _justOlib
in ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree)))
sem_OnExpr_Nothing :: T_OnExpr
sem_OnExpr_Nothing =
(\ _lhsIcat
_lhsIidenv
_lhsIlib ->
(let _lhsOannotatedTree :: OnExpr
_lhsOfixedUpIdentifiersTree :: OnExpr
_lhsOoriginalTree :: OnExpr
_annotatedTree =
Nothing
_fixedUpIdentifiersTree =
Nothing
_originalTree =
Nothing
_lhsOannotatedTree =
_annotatedTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
in ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree)))
data ParamDef = ParamDef (Annotation) (NameComponent) (TypeName )
| ParamDefTp (Annotation) (TypeName )
deriving ( Data,Eq,Show,Typeable)
sem_ParamDef :: ParamDef ->
T_ParamDef
sem_ParamDef (ParamDef _ann _name _typ ) =
(sem_ParamDef_ParamDef _ann _name (sem_TypeName _typ ) )
sem_ParamDef (ParamDefTp _ann _typ ) =
(sem_ParamDef_ParamDefTp _ann (sem_TypeName _typ ) )
type T_ParamDef = Catalog ->
IDEnv ->
LocalBindings ->
Int ->
( ParamDef ,ParamDef ,(Maybe Type),ParamDef ,ParamName)
data Inh_ParamDef = Inh_ParamDef {cat_Inh_ParamDef :: Catalog,idenv_Inh_ParamDef :: IDEnv,lib_Inh_ParamDef :: LocalBindings,pos_Inh_ParamDef :: Int}
data Syn_ParamDef = Syn_ParamDef {annotatedTree_Syn_ParamDef :: ParamDef ,fixedUpIdentifiersTree_Syn_ParamDef :: ParamDef ,namedType_Syn_ParamDef :: (Maybe Type),originalTree_Syn_ParamDef :: ParamDef ,paramName_Syn_ParamDef :: ParamName}
wrap_ParamDef :: T_ParamDef ->
Inh_ParamDef ->
Syn_ParamDef
wrap_ParamDef sem (Inh_ParamDef _lhsIcat _lhsIidenv _lhsIlib _lhsIpos ) =
(let ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOnamedType,_lhsOoriginalTree,_lhsOparamName) = sem _lhsIcat _lhsIidenv _lhsIlib _lhsIpos
in (Syn_ParamDef _lhsOannotatedTree _lhsOfixedUpIdentifiersTree _lhsOnamedType _lhsOoriginalTree _lhsOparamName ))
sem_ParamDef_ParamDef :: Annotation ->
NameComponent ->
T_TypeName ->
T_ParamDef
sem_ParamDef_ParamDef ann_ name_ typ_ =
(\ _lhsIcat
_lhsIidenv
_lhsIlib
_lhsIpos ->
(let _lhsOnamedType :: (Maybe Type)
_lhsOparamName :: ParamName
_lhsOannotatedTree :: ParamDef
_lhsOfixedUpIdentifiersTree :: ParamDef
_lhsOoriginalTree :: ParamDef
_typOcat :: Catalog
_typOidenv :: IDEnv
_typOlib :: LocalBindings
_typIannotatedTree :: TypeName
_typIfixedUpIdentifiersTree :: TypeName
_typInamedType :: (Maybe Type)
_typIoriginalTree :: TypeName
_lhsOnamedType =
_typInamedType
_lhsOparamName =
NamedParam _lhsIpos (ncStr name_)
_annotatedTree =
ParamDef ann_ name_ _typIannotatedTree
_fixedUpIdentifiersTree =
ParamDef ann_ name_ _typIfixedUpIdentifiersTree
_originalTree =
ParamDef ann_ name_ _typIoriginalTree
_lhsOannotatedTree =
_annotatedTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
_typOcat =
_lhsIcat
_typOidenv =
_lhsIidenv
_typOlib =
_lhsIlib
( _typIannotatedTree,_typIfixedUpIdentifiersTree,_typInamedType,_typIoriginalTree) =
typ_ _typOcat _typOidenv _typOlib
in ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOnamedType,_lhsOoriginalTree,_lhsOparamName)))
sem_ParamDef_ParamDefTp :: Annotation ->
T_TypeName ->
T_ParamDef
sem_ParamDef_ParamDefTp ann_ typ_ =
(\ _lhsIcat
_lhsIidenv
_lhsIlib
_lhsIpos ->
(let _lhsOnamedType :: (Maybe Type)
_lhsOparamName :: ParamName
_lhsOannotatedTree :: ParamDef
_lhsOfixedUpIdentifiersTree :: ParamDef
_lhsOoriginalTree :: ParamDef
_typOcat :: Catalog
_typOidenv :: IDEnv
_typOlib :: LocalBindings
_typIannotatedTree :: TypeName
_typIfixedUpIdentifiersTree :: TypeName
_typInamedType :: (Maybe Type)
_typIoriginalTree :: TypeName
_lhsOnamedType =
_typInamedType
_lhsOparamName =
UnnamedParam _lhsIpos
_annotatedTree =
ParamDefTp ann_ _typIannotatedTree
_fixedUpIdentifiersTree =
ParamDefTp ann_ _typIfixedUpIdentifiersTree
_originalTree =
ParamDefTp ann_ _typIoriginalTree
_lhsOannotatedTree =
_annotatedTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
_typOcat =
_lhsIcat
_typOidenv =
_lhsIidenv
_typOlib =
_lhsIlib
( _typIannotatedTree,_typIfixedUpIdentifiersTree,_typInamedType,_typIoriginalTree) =
typ_ _typOcat _typOidenv _typOlib
in ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOnamedType,_lhsOoriginalTree,_lhsOparamName)))
type ParamDefList = [ParamDef ]
sem_ParamDefList :: ParamDefList ->
T_ParamDefList
sem_ParamDefList list =
(Prelude.foldr sem_ParamDefList_Cons sem_ParamDefList_Nil (Prelude.map sem_ParamDef list) )
type T_ParamDefList = Catalog ->
IDEnv ->
LocalBindings ->
Int ->
( ParamDefList ,ParamDefList ,ParamDefList ,([(ParamName, Maybe Type)]))
data Inh_ParamDefList = Inh_ParamDefList {cat_Inh_ParamDefList :: Catalog,idenv_Inh_ParamDefList :: IDEnv,lib_Inh_ParamDefList :: LocalBindings,pos_Inh_ParamDefList :: Int}
data Syn_ParamDefList = Syn_ParamDefList {annotatedTree_Syn_ParamDefList :: ParamDefList ,fixedUpIdentifiersTree_Syn_ParamDefList :: ParamDefList ,originalTree_Syn_ParamDefList :: ParamDefList ,params_Syn_ParamDefList :: ([(ParamName, Maybe Type)])}
wrap_ParamDefList :: T_ParamDefList ->
Inh_ParamDefList ->
Syn_ParamDefList
wrap_ParamDefList sem (Inh_ParamDefList _lhsIcat _lhsIidenv _lhsIlib _lhsIpos ) =
(let ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree,_lhsOparams) = sem _lhsIcat _lhsIidenv _lhsIlib _lhsIpos
in (Syn_ParamDefList _lhsOannotatedTree _lhsOfixedUpIdentifiersTree _lhsOoriginalTree _lhsOparams ))
sem_ParamDefList_Cons :: T_ParamDef ->
T_ParamDefList ->
T_ParamDefList
sem_ParamDefList_Cons hd_ tl_ =
(\ _lhsIcat
_lhsIidenv
_lhsIlib
_lhsIpos ->
(let _lhsOparams :: ([(ParamName, Maybe Type)])
_hdOpos :: Int
_tlOpos :: Int
_lhsOannotatedTree :: ParamDefList
_lhsOfixedUpIdentifiersTree :: ParamDefList
_lhsOoriginalTree :: ParamDefList
_hdOcat :: Catalog
_hdOidenv :: IDEnv
_hdOlib :: LocalBindings
_tlOcat :: Catalog
_tlOidenv :: IDEnv
_tlOlib :: LocalBindings
_hdIannotatedTree :: ParamDef
_hdIfixedUpIdentifiersTree :: ParamDef
_hdInamedType :: (Maybe Type)
_hdIoriginalTree :: ParamDef
_hdIparamName :: ParamName
_tlIannotatedTree :: ParamDefList
_tlIfixedUpIdentifiersTree :: ParamDefList
_tlIoriginalTree :: ParamDefList
_tlIparams :: ([(ParamName, Maybe Type)])
_lhsOparams =
((_hdIparamName, _hdInamedType) : _tlIparams)
_hdOpos =
_lhsIpos
_tlOpos =
_lhsIpos + 1
_annotatedTree =
(:) _hdIannotatedTree _tlIannotatedTree
_fixedUpIdentifiersTree =
(:) _hdIfixedUpIdentifiersTree _tlIfixedUpIdentifiersTree
_originalTree =
(:) _hdIoriginalTree _tlIoriginalTree
_lhsOannotatedTree =
_annotatedTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
_hdOcat =
_lhsIcat
_hdOidenv =
_lhsIidenv
_hdOlib =
_lhsIlib
_tlOcat =
_lhsIcat
_tlOidenv =
_lhsIidenv
_tlOlib =
_lhsIlib
( _hdIannotatedTree,_hdIfixedUpIdentifiersTree,_hdInamedType,_hdIoriginalTree,_hdIparamName) =
hd_ _hdOcat _hdOidenv _hdOlib _hdOpos
( _tlIannotatedTree,_tlIfixedUpIdentifiersTree,_tlIoriginalTree,_tlIparams) =
tl_ _tlOcat _tlOidenv _tlOlib _tlOpos
in ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree,_lhsOparams)))
sem_ParamDefList_Nil :: T_ParamDefList
sem_ParamDefList_Nil =
(\ _lhsIcat
_lhsIidenv
_lhsIlib
_lhsIpos ->
(let _lhsOparams :: ([(ParamName, Maybe Type)])
_lhsOannotatedTree :: ParamDefList
_lhsOfixedUpIdentifiersTree :: ParamDefList
_lhsOoriginalTree :: ParamDefList
_lhsOparams =
[]
_annotatedTree =
[]
_fixedUpIdentifiersTree =
[]
_originalTree =
[]
_lhsOannotatedTree =
_annotatedTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
in ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree,_lhsOparams)))
data QueryExpr = CombineQueryExpr (Annotation) (CombineType) (QueryExpr ) (QueryExpr )
| Select (Annotation) (Distinct) (SelectList ) (TableRefList ) (MaybeBoolExpr ) (ScalarExprList ) (MaybeBoolExpr ) (ScalarExprDirectionPairList ) (MaybeScalarExpr ) (MaybeScalarExpr )
| Values (Annotation) (ScalarExprListList )
| WithQueryExpr (Annotation) (WithQueryList ) (QueryExpr )
deriving ( Data,Eq,Show,Typeable)
sem_QueryExpr :: QueryExpr ->
T_QueryExpr
sem_QueryExpr (CombineQueryExpr _ann _ctype _sel1 _sel2 ) =
(sem_QueryExpr_CombineQueryExpr _ann _ctype (sem_QueryExpr _sel1 ) (sem_QueryExpr _sel2 ) )
sem_QueryExpr (Select _ann _selDistinct _selSelectList _selTref _selWhere _selGroupBy _selHaving _selOrderBy _selLimit _selOffset ) =
(sem_QueryExpr_Select _ann _selDistinct (sem_SelectList _selSelectList ) (sem_TableRefList _selTref ) (sem_MaybeBoolExpr _selWhere ) (sem_ScalarExprList _selGroupBy ) (sem_MaybeBoolExpr _selHaving ) (sem_ScalarExprDirectionPairList _selOrderBy ) (sem_MaybeScalarExpr _selLimit ) (sem_MaybeScalarExpr _selOffset ) )
sem_QueryExpr (Values _ann _vll ) =
(sem_QueryExpr_Values _ann (sem_ScalarExprListList _vll ) )
sem_QueryExpr (WithQueryExpr _ann _withs _ex ) =
(sem_QueryExpr_WithQueryExpr _ann (sem_WithQueryList _withs ) (sem_QueryExpr _ex ) )
type T_QueryExpr = Catalog ->
LocalBindings ->
([Maybe Type]) ->
IDEnv ->
LocalBindings ->
( QueryExpr ,IDEnv,QueryExpr ,([LocalBindingsUpdate]),QueryExpr ,(Maybe [(String,Type)]))
data Inh_QueryExpr = Inh_QueryExpr {cat_Inh_QueryExpr :: Catalog,csql_Inh_QueryExpr :: LocalBindings,expectedTypes_Inh_QueryExpr :: ([Maybe Type]),idenv_Inh_QueryExpr :: IDEnv,lib_Inh_QueryExpr :: LocalBindings}
data Syn_QueryExpr = Syn_QueryExpr {annotatedTree_Syn_QueryExpr :: QueryExpr ,cidenv_Syn_QueryExpr :: IDEnv,fixedUpIdentifiersTree_Syn_QueryExpr :: QueryExpr ,libUpdates_Syn_QueryExpr :: ([LocalBindingsUpdate]),originalTree_Syn_QueryExpr :: QueryExpr ,uType_Syn_QueryExpr :: (Maybe [(String,Type)])}
wrap_QueryExpr :: T_QueryExpr ->
Inh_QueryExpr ->
Syn_QueryExpr
wrap_QueryExpr sem (Inh_QueryExpr _lhsIcat _lhsIcsql _lhsIexpectedTypes _lhsIidenv _lhsIlib ) =
(let ( _lhsOannotatedTree,_lhsOcidenv,_lhsOfixedUpIdentifiersTree,_lhsOlibUpdates,_lhsOoriginalTree,_lhsOuType) = sem _lhsIcat _lhsIcsql _lhsIexpectedTypes _lhsIidenv _lhsIlib
in (Syn_QueryExpr _lhsOannotatedTree _lhsOcidenv _lhsOfixedUpIdentifiersTree _lhsOlibUpdates _lhsOoriginalTree _lhsOuType ))
sem_QueryExpr_CombineQueryExpr :: Annotation ->
CombineType ->
T_QueryExpr ->
T_QueryExpr ->
T_QueryExpr
sem_QueryExpr_CombineQueryExpr ann_ ctype_ sel1_ sel2_ =
(\ _lhsIcat
_lhsIcsql
_lhsIexpectedTypes
_lhsIidenv
_lhsIlib ->
(let _lhsOcidenv :: IDEnv
_lhsOannotatedTree :: QueryExpr
_lhsOlibUpdates :: ([LocalBindingsUpdate])
_tpe :: Et
_lhsOuType :: (Maybe [(String,Type)])
_lhsOfixedUpIdentifiersTree :: QueryExpr
_lhsOoriginalTree :: QueryExpr
_sel1Ocat :: Catalog
_sel1Ocsql :: LocalBindings
_sel1OexpectedTypes :: ([Maybe Type])
_sel1Oidenv :: IDEnv
_sel1Olib :: LocalBindings
_sel2Ocat :: Catalog
_sel2Ocsql :: LocalBindings
_sel2OexpectedTypes :: ([Maybe Type])
_sel2Oidenv :: IDEnv
_sel2Olib :: LocalBindings
_sel1IannotatedTree :: QueryExpr
_sel1Icidenv :: IDEnv
_sel1IfixedUpIdentifiersTree :: QueryExpr
_sel1IlibUpdates :: ([LocalBindingsUpdate])
_sel1IoriginalTree :: QueryExpr
_sel1IuType :: (Maybe [(String,Type)])
_sel2IannotatedTree :: QueryExpr
_sel2Icidenv :: IDEnv
_sel2IfixedUpIdentifiersTree :: QueryExpr
_sel2IlibUpdates :: ([LocalBindingsUpdate])
_sel2IoriginalTree :: QueryExpr
_sel2IuType :: (Maybe [(String,Type)])
_lhsOcidenv =
_sel1Icidenv
_lhsOannotatedTree =
setTypeAddErrors _tpe _backTree
_lhsOlibUpdates =
[]
_tpe =
do
sel1t <- lmt ((SetOfType . CompositeType) <$> _sel1IuType)
sel2t <- lmt ((SetOfType . CompositeType) <$> _sel2IuType)
typeCheckCombineSelect _lhsIcat sel1t sel2t
_backTree =
CombineQueryExpr ann_ ctype_
_sel1IannotatedTree
_sel2IannotatedTree
_lhsOuType =
etmt (_tpe >>= unwrapSetOfComposite)
_annotatedTree =
CombineQueryExpr ann_ ctype_ _sel1IannotatedTree _sel2IannotatedTree
_fixedUpIdentifiersTree =
CombineQueryExpr ann_ ctype_ _sel1IfixedUpIdentifiersTree _sel2IfixedUpIdentifiersTree
_originalTree =
CombineQueryExpr ann_ ctype_ _sel1IoriginalTree _sel2IoriginalTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
_sel1Ocat =
_lhsIcat
_sel1Ocsql =
_lhsIcsql
_sel1OexpectedTypes =
_lhsIexpectedTypes
_sel1Oidenv =
_lhsIidenv
_sel1Olib =
_lhsIlib
_sel2Ocat =
_lhsIcat
_sel2Ocsql =
_lhsIcsql
_sel2OexpectedTypes =
_lhsIexpectedTypes
_sel2Oidenv =
_lhsIidenv
_sel2Olib =
_lhsIlib
( _sel1IannotatedTree,_sel1Icidenv,_sel1IfixedUpIdentifiersTree,_sel1IlibUpdates,_sel1IoriginalTree,_sel1IuType) =
sel1_ _sel1Ocat _sel1Ocsql _sel1OexpectedTypes _sel1Oidenv _sel1Olib
( _sel2IannotatedTree,_sel2Icidenv,_sel2IfixedUpIdentifiersTree,_sel2IlibUpdates,_sel2IoriginalTree,_sel2IuType) =
sel2_ _sel2Ocat _sel2Ocsql _sel2OexpectedTypes _sel2Oidenv _sel2Olib
in ( _lhsOannotatedTree,_lhsOcidenv,_lhsOfixedUpIdentifiersTree,_lhsOlibUpdates,_lhsOoriginalTree,_lhsOuType)))
sem_QueryExpr_Select :: Annotation ->
Distinct ->
T_SelectList ->
T_TableRefList ->
T_MaybeBoolExpr ->
T_ScalarExprList ->
T_MaybeBoolExpr ->
T_ScalarExprDirectionPairList ->
T_MaybeScalarExpr ->
T_MaybeScalarExpr ->
T_QueryExpr
sem_QueryExpr_Select ann_ selDistinct_ selSelectList_ selTref_ selWhere_ selGroupBy_ selHaving_ selOrderBy_ selLimit_ selOffset_ =
(\ _lhsIcat
_lhsIcsql
_lhsIexpectedTypes
_lhsIidenv
_lhsIlib ->
(let _lhsOfixedUpIdentifiersTree :: QueryExpr
_lhsOcidenv :: IDEnv
_selSelectListOidenv :: IDEnv
_selWhereOidenv :: IDEnv
_selGroupByOidenv :: IDEnv
_selHavingOidenv :: IDEnv
_selOrderByOidenv :: IDEnv
_lhsOannotatedTree :: QueryExpr
_selSelectListOlib :: LocalBindings
_selWhereOlib :: LocalBindings
_selHavingOlib :: LocalBindings
_selGroupByOlib :: LocalBindings
_slTypes :: LocalBindings
_selOrderByOlib :: LocalBindings
_lhsOlibUpdates :: ([LocalBindingsUpdate])
_tpe :: Et
_lhsOuType :: (Maybe [(String,Type)])
_selGroupByOexpectedTypes :: ([Maybe Type])
_lhsOoriginalTree :: QueryExpr
_selSelectListOcat :: Catalog
_selTrefOcat :: Catalog
_selTrefOidenv :: IDEnv
_selTrefOlib :: LocalBindings
_selWhereOcat :: Catalog
_selGroupByOcat :: Catalog
_selHavingOcat :: Catalog
_selOrderByOcat :: Catalog
_selLimitOcat :: Catalog
_selLimitOidenv :: IDEnv
_selLimitOlib :: LocalBindings
_selOffsetOcat :: Catalog
_selOffsetOidenv :: IDEnv
_selOffsetOlib :: LocalBindings
_selSelectListIannotatedTree :: SelectList
_selSelectListIcidenv :: IDEnv
_selSelectListIfixedUpIdentifiersTree :: SelectList
_selSelectListIlibUpdates :: ([LocalBindingsUpdate])
_selSelectListIlistType :: ([(String,Maybe Type)])
_selSelectListIoriginalTree :: SelectList
_selTrefIannotatedTree :: TableRefList
_selTrefIfixedUpIdentifiersTree :: TableRefList
_selTrefIlibUpdates :: ([LocalBindingsUpdate])
_selTrefInewLib2 :: LocalBindings
_selTrefIoriginalTree :: TableRefList
_selTrefItrefIDs :: IDEnv
_selWhereIannotatedTree :: MaybeBoolExpr
_selWhereIfixedUpIdentifiersTree :: MaybeBoolExpr
_selWhereIoriginalTree :: MaybeBoolExpr
_selGroupByIannotatedTree :: ScalarExprList
_selGroupByIfixedUpIdentifiersTree :: ScalarExprList
_selGroupByIoriginalTree :: ScalarExprList
_selGroupByIuType :: ([Maybe Type])
_selHavingIannotatedTree :: MaybeBoolExpr
_selHavingIfixedUpIdentifiersTree :: MaybeBoolExpr
_selHavingIoriginalTree :: MaybeBoolExpr
_selOrderByIannotatedTree :: ScalarExprDirectionPairList
_selOrderByIfixedUpIdentifiersTree :: ScalarExprDirectionPairList
_selOrderByIoriginalTree :: ScalarExprDirectionPairList
_selLimitIannotatedTree :: MaybeScalarExpr
_selLimitIfixedUpIdentifiersTree :: MaybeScalarExpr
_selLimitIoriginalTree :: MaybeScalarExpr
_selLimitIuType :: (Maybe Type)
_selOffsetIannotatedTree :: MaybeScalarExpr
_selOffsetIfixedUpIdentifiersTree :: MaybeScalarExpr
_selOffsetIoriginalTree :: MaybeScalarExpr
_selOffsetIuType :: (Maybe Type)
_lhsOfixedUpIdentifiersTree =
Select ann_
selDistinct_
_selSelectListIfixedUpIdentifiersTree
_selTrefIfixedUpIdentifiersTree
_selWhereIfixedUpIdentifiersTree
_selGroupByIfixedUpIdentifiersTree
_selHavingIfixedUpIdentifiersTree
_selOrderByIfixedUpIdentifiersTree
_selLimitIfixedUpIdentifiersTree
_selOffsetIfixedUpIdentifiersTree
_lhsOcidenv =
_selSelectListIcidenv
_trefEnv =
_selTrefItrefIDs
_includeCorrelations =
CorrelatedIDEnv _trefEnv _lhsIidenv
_selSelectListOidenv =
_trefEnv
_selWhereOidenv =
_includeCorrelations
_selGroupByOidenv =
_trefEnv
_selHavingOidenv =
_includeCorrelations
_selOrderByOidenv =
_trefEnv
_lhsOannotatedTree =
setTypeAddErrors _tpe _backTree
_newLib =
_selTrefInewLib2
_selSelectListOlib =
_newLib
_selWhereOlib =
joinBindings _newLib _lhsIcsql
_selHavingOlib =
joinBindings _newLib _lhsIcsql
_selGroupByOlib =
_newLib
_slTypes =
createLocalBindings $ Just [("",_selSelectListIlistType)]
_selOrderByOlib =
joinBindings _slTypes _newLib
_lhsOlibUpdates =
_selSelectListIlibUpdates
_tpe =
Right $ SetOfType $ CompositeType $ fromMaybe [] $ liftList _selSelectListIlistType
_backTree =
Select ann_
selDistinct_
_selSelectListIannotatedTree
_selTrefIannotatedTree
_selWhereIannotatedTree
_selGroupByIannotatedTree
_selHavingIannotatedTree
_selOrderByIannotatedTree
_selLimitIannotatedTree
_selOffsetIannotatedTree
_lhsOuType =
etmt (_tpe >>= unwrapSetOfComposite)
_selGroupByOexpectedTypes =
[]
_annotatedTree =
Select ann_ selDistinct_ _selSelectListIannotatedTree _selTrefIannotatedTree _selWhereIannotatedTree _selGroupByIannotatedTree _selHavingIannotatedTree _selOrderByIannotatedTree _selLimitIannotatedTree _selOffsetIannotatedTree
_fixedUpIdentifiersTree =
Select ann_ selDistinct_ _selSelectListIfixedUpIdentifiersTree _selTrefIfixedUpIdentifiersTree _selWhereIfixedUpIdentifiersTree _selGroupByIfixedUpIdentifiersTree _selHavingIfixedUpIdentifiersTree _selOrderByIfixedUpIdentifiersTree _selLimitIfixedUpIdentifiersTree _selOffsetIfixedUpIdentifiersTree
_originalTree =
Select ann_ selDistinct_ _selSelectListIoriginalTree _selTrefIoriginalTree _selWhereIoriginalTree _selGroupByIoriginalTree _selHavingIoriginalTree _selOrderByIoriginalTree _selLimitIoriginalTree _selOffsetIoriginalTree
_lhsOoriginalTree =
_originalTree
_selSelectListOcat =
_lhsIcat
_selTrefOcat =
_lhsIcat
_selTrefOidenv =
_lhsIidenv
_selTrefOlib =
_lhsIlib
_selWhereOcat =
_lhsIcat
_selGroupByOcat =
_lhsIcat
_selHavingOcat =
_lhsIcat
_selOrderByOcat =
_lhsIcat
_selLimitOcat =
_lhsIcat
_selLimitOidenv =
_lhsIidenv
_selLimitOlib =
_lhsIlib
_selOffsetOcat =
_lhsIcat
_selOffsetOidenv =
_lhsIidenv
_selOffsetOlib =
_lhsIlib
( _selSelectListIannotatedTree,_selSelectListIcidenv,_selSelectListIfixedUpIdentifiersTree,_selSelectListIlibUpdates,_selSelectListIlistType,_selSelectListIoriginalTree) =
selSelectList_ _selSelectListOcat _selSelectListOidenv _selSelectListOlib
( _selTrefIannotatedTree,_selTrefIfixedUpIdentifiersTree,_selTrefIlibUpdates,_selTrefInewLib2,_selTrefIoriginalTree,_selTrefItrefIDs) =
selTref_ _selTrefOcat _selTrefOidenv _selTrefOlib
( _selWhereIannotatedTree,_selWhereIfixedUpIdentifiersTree,_selWhereIoriginalTree) =
selWhere_ _selWhereOcat _selWhereOidenv _selWhereOlib
( _selGroupByIannotatedTree,_selGroupByIfixedUpIdentifiersTree,_selGroupByIoriginalTree,_selGroupByIuType) =
selGroupBy_ _selGroupByOcat _selGroupByOexpectedTypes _selGroupByOidenv _selGroupByOlib
( _selHavingIannotatedTree,_selHavingIfixedUpIdentifiersTree,_selHavingIoriginalTree) =
selHaving_ _selHavingOcat _selHavingOidenv _selHavingOlib
( _selOrderByIannotatedTree,_selOrderByIfixedUpIdentifiersTree,_selOrderByIoriginalTree) =
selOrderBy_ _selOrderByOcat _selOrderByOidenv _selOrderByOlib
( _selLimitIannotatedTree,_selLimitIfixedUpIdentifiersTree,_selLimitIoriginalTree,_selLimitIuType) =
selLimit_ _selLimitOcat _selLimitOidenv _selLimitOlib
( _selOffsetIannotatedTree,_selOffsetIfixedUpIdentifiersTree,_selOffsetIoriginalTree,_selOffsetIuType) =
selOffset_ _selOffsetOcat _selOffsetOidenv _selOffsetOlib
in ( _lhsOannotatedTree,_lhsOcidenv,_lhsOfixedUpIdentifiersTree,_lhsOlibUpdates,_lhsOoriginalTree,_lhsOuType)))
sem_QueryExpr_Values :: Annotation ->
T_ScalarExprListList ->
T_QueryExpr
sem_QueryExpr_Values ann_ vll_ =
(\ _lhsIcat
_lhsIcsql
_lhsIexpectedTypes
_lhsIidenv
_lhsIlib ->
(let _lhsOcidenv :: IDEnv
_lhsOannotatedTree :: QueryExpr
_lhsOlibUpdates :: ([LocalBindingsUpdate])
_tpe :: Et
_lhsOuType :: (Maybe [(String,Type)])
_vllOexpectedTypes :: ([Maybe Type])
_lhsOfixedUpIdentifiersTree :: QueryExpr
_lhsOoriginalTree :: QueryExpr
_vllOcat :: Catalog
_vllOidenv :: IDEnv
_vllOlib :: LocalBindings
_vllIannotatedTree :: ScalarExprListList
_vllIfixedUpIdentifiersTree :: ScalarExprListList
_vllIoriginalTree :: ScalarExprListList
_vllIuType :: ([[Maybe Type]])
_lhsOcidenv =
emptyIDEnv "values"
_lhsOannotatedTree =
setTypeAddErrors _tpe _backTree
_lhsOlibUpdates =
[]
_tpe =
typeCheckValuesExpr
_lhsIcat
_vllIuType
_backTree =
Values ann_ _vllIannotatedTree
_lhsOuType =
etmt (_tpe >>= unwrapSetOfComposite)
_vllOexpectedTypes =
_lhsIexpectedTypes
_annotatedTree =
Values ann_ _vllIannotatedTree
_fixedUpIdentifiersTree =
Values ann_ _vllIfixedUpIdentifiersTree
_originalTree =
Values ann_ _vllIoriginalTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
_vllOcat =
_lhsIcat
_vllOidenv =
_lhsIidenv
_vllOlib =
_lhsIlib
( _vllIannotatedTree,_vllIfixedUpIdentifiersTree,_vllIoriginalTree,_vllIuType) =
vll_ _vllOcat _vllOexpectedTypes _vllOidenv _vllOlib
in ( _lhsOannotatedTree,_lhsOcidenv,_lhsOfixedUpIdentifiersTree,_lhsOlibUpdates,_lhsOoriginalTree,_lhsOuType)))
sem_QueryExpr_WithQueryExpr :: Annotation ->
T_WithQueryList ->
T_QueryExpr ->
T_QueryExpr
sem_QueryExpr_WithQueryExpr ann_ withs_ ex_ =
(\ _lhsIcat
_lhsIcsql
_lhsIexpectedTypes
_lhsIidenv
_lhsIlib ->
(let _lhsOcidenv :: IDEnv
_exOidenv :: IDEnv
_lhsOannotatedTree :: QueryExpr
_lhsOlibUpdates :: ([LocalBindingsUpdate])
_tpe :: Et
_exOcat :: Catalog
_withsOcatUpdates :: ([CatalogUpdate])
_lhsOuType :: (Maybe [(String,Type)])
_lhsOfixedUpIdentifiersTree :: QueryExpr
_lhsOoriginalTree :: QueryExpr
_withsOcat :: Catalog
_withsOidenv :: IDEnv
_withsOlib :: LocalBindings
_exOcsql :: LocalBindings
_exOexpectedTypes :: ([Maybe Type])
_exOlib :: LocalBindings
_withsIannotatedTree :: WithQueryList
_withsIcidenv :: IDEnv
_withsIfixedUpIdentifiersTree :: WithQueryList
_withsIoriginalTree :: WithQueryList
_withsIproducedCat :: Catalog
_exIannotatedTree :: QueryExpr
_exIcidenv :: IDEnv
_exIfixedUpIdentifiersTree :: QueryExpr
_exIlibUpdates :: ([LocalBindingsUpdate])
_exIoriginalTree :: QueryExpr
_exIuType :: (Maybe [(String,Type)])
_lhsOcidenv =
_exIcidenv
_exOidenv =
_exIcidenv
_lhsOannotatedTree =
setTypeAddErrors _tpe _backTree
_lhsOlibUpdates =
_exIlibUpdates
_tpe =
lmt ((SetOfType . CompositeType) <$> _exIuType)
_backTree =
WithQueryExpr ann_ _withsIannotatedTree _exIannotatedTree
_exOcat =
_withsIproducedCat
_withsOcatUpdates =
[]
_lhsOuType =
etmt (_tpe >>= unwrapSetOfComposite)
_annotatedTree =
WithQueryExpr ann_ _withsIannotatedTree _exIannotatedTree
_fixedUpIdentifiersTree =
WithQueryExpr ann_ _withsIfixedUpIdentifiersTree _exIfixedUpIdentifiersTree
_originalTree =
WithQueryExpr ann_ _withsIoriginalTree _exIoriginalTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
_withsOcat =
_lhsIcat
_withsOidenv =
_lhsIidenv
_withsOlib =
_lhsIlib
_exOcsql =
_lhsIcsql
_exOexpectedTypes =
_lhsIexpectedTypes
_exOlib =
_lhsIlib
( _withsIannotatedTree,_withsIcidenv,_withsIfixedUpIdentifiersTree,_withsIoriginalTree,_withsIproducedCat) =
withs_ _withsOcat _withsOcatUpdates _withsOidenv _withsOlib
( _exIannotatedTree,_exIcidenv,_exIfixedUpIdentifiersTree,_exIlibUpdates,_exIoriginalTree,_exIuType) =
ex_ _exOcat _exOcsql _exOexpectedTypes _exOidenv _exOlib
in ( _lhsOannotatedTree,_lhsOcidenv,_lhsOfixedUpIdentifiersTree,_lhsOlibUpdates,_lhsOoriginalTree,_lhsOuType)))
data Root = Root (StatementList )
deriving ( Show)
sem_Root :: Root ->
T_Root
sem_Root (Root _statements ) =
(sem_Root_Root (sem_StatementList _statements ) )
type T_Root = Catalog ->
IDEnv ->
LocalBindings ->
( Root ,Root ,Root ,Catalog,LocalBindings)
data Inh_Root = Inh_Root {cat_Inh_Root :: Catalog,idenv_Inh_Root :: IDEnv,lib_Inh_Root :: LocalBindings}
data Syn_Root = Syn_Root {annotatedTree_Syn_Root :: Root ,fixedUpIdentifiersTree_Syn_Root :: Root ,originalTree_Syn_Root :: Root ,producedCat_Syn_Root :: Catalog,producedLib_Syn_Root :: LocalBindings}
wrap_Root :: T_Root ->
Inh_Root ->
Syn_Root
wrap_Root sem (Inh_Root _lhsIcat _lhsIidenv _lhsIlib ) =
(let ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree,_lhsOproducedCat,_lhsOproducedLib) = sem _lhsIcat _lhsIidenv _lhsIlib
in (Syn_Root _lhsOannotatedTree _lhsOfixedUpIdentifiersTree _lhsOoriginalTree _lhsOproducedCat _lhsOproducedLib ))
sem_Root_Root :: T_StatementList ->
T_Root
sem_Root_Root statements_ =
(\ _lhsIcat
_lhsIidenv
_lhsIlib ->
(let _statementsOcatUpdates :: ([CatalogUpdate])
_statementsOlibUpdates :: ([LocalBindingsUpdate])
_lhsOannotatedTree :: Root
_lhsOfixedUpIdentifiersTree :: Root
_lhsOoriginalTree :: Root
_lhsOproducedCat :: Catalog
_lhsOproducedLib :: LocalBindings
_statementsOcat :: Catalog
_statementsOidenv :: IDEnv
_statementsOlib :: LocalBindings
_statementsIannotatedTree :: StatementList
_statementsIfixedUpIdentifiersTree :: StatementList
_statementsIoriginalTree :: StatementList
_statementsIproducedCat :: Catalog
_statementsIproducedLib :: LocalBindings
_statementsOcatUpdates =
[]
_statementsOlibUpdates =
[]
_annotatedTree =
Root _statementsIannotatedTree
_fixedUpIdentifiersTree =
Root _statementsIfixedUpIdentifiersTree
_originalTree =
Root _statementsIoriginalTree
_lhsOannotatedTree =
_annotatedTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
_lhsOproducedCat =
_statementsIproducedCat
_lhsOproducedLib =
_statementsIproducedLib
_statementsOcat =
_lhsIcat
_statementsOidenv =
_lhsIidenv
_statementsOlib =
_lhsIlib
( _statementsIannotatedTree,_statementsIfixedUpIdentifiersTree,_statementsIoriginalTree,_statementsIproducedCat,_statementsIproducedLib) =
statements_ _statementsOcat _statementsOcatUpdates _statementsOidenv _statementsOlib _statementsOlibUpdates
in ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree,_lhsOproducedCat,_lhsOproducedLib)))
data RowConstraint = NotNullConstraint (Annotation) (String)
| NullConstraint (Annotation) (String)
| RowCheckConstraint (Annotation) (String) (ScalarExpr )
| RowPrimaryKeyConstraint (Annotation) (String)
| RowReferenceConstraint (Annotation) (String) (Name ) ((Maybe NameComponent)) (Cascade) (Cascade)
| RowUniqueConstraint (Annotation) (String)
deriving ( Data,Eq,Show,Typeable)
sem_RowConstraint :: RowConstraint ->
T_RowConstraint
sem_RowConstraint (NotNullConstraint _ann _name ) =
(sem_RowConstraint_NotNullConstraint _ann _name )
sem_RowConstraint (NullConstraint _ann _name ) =
(sem_RowConstraint_NullConstraint _ann _name )
sem_RowConstraint (RowCheckConstraint _ann _name _expr ) =
(sem_RowConstraint_RowCheckConstraint _ann _name (sem_ScalarExpr _expr ) )
sem_RowConstraint (RowPrimaryKeyConstraint _ann _name ) =
(sem_RowConstraint_RowPrimaryKeyConstraint _ann _name )
sem_RowConstraint (RowReferenceConstraint _ann _name _table _att _onUpdate _onDelete ) =
(sem_RowConstraint_RowReferenceConstraint _ann _name (sem_Name _table ) _att _onUpdate _onDelete )
sem_RowConstraint (RowUniqueConstraint _ann _name ) =
(sem_RowConstraint_RowUniqueConstraint _ann _name )
type T_RowConstraint = Catalog ->
IDEnv ->
LocalBindings ->
( RowConstraint ,RowConstraint ,RowConstraint )
data Inh_RowConstraint = Inh_RowConstraint {cat_Inh_RowConstraint :: Catalog,idenv_Inh_RowConstraint :: IDEnv,lib_Inh_RowConstraint :: LocalBindings}
data Syn_RowConstraint = Syn_RowConstraint {annotatedTree_Syn_RowConstraint :: RowConstraint ,fixedUpIdentifiersTree_Syn_RowConstraint :: RowConstraint ,originalTree_Syn_RowConstraint :: RowConstraint }
wrap_RowConstraint :: T_RowConstraint ->
Inh_RowConstraint ->
Syn_RowConstraint
wrap_RowConstraint sem (Inh_RowConstraint _lhsIcat _lhsIidenv _lhsIlib ) =
(let ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree) = sem _lhsIcat _lhsIidenv _lhsIlib
in (Syn_RowConstraint _lhsOannotatedTree _lhsOfixedUpIdentifiersTree _lhsOoriginalTree ))
sem_RowConstraint_NotNullConstraint :: Annotation ->
String ->
T_RowConstraint
sem_RowConstraint_NotNullConstraint ann_ name_ =
(\ _lhsIcat
_lhsIidenv
_lhsIlib ->
(let _lhsOannotatedTree :: RowConstraint
_lhsOfixedUpIdentifiersTree :: RowConstraint
_lhsOoriginalTree :: RowConstraint
_annotatedTree =
NotNullConstraint ann_ name_
_fixedUpIdentifiersTree =
NotNullConstraint ann_ name_
_originalTree =
NotNullConstraint ann_ name_
_lhsOannotatedTree =
_annotatedTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
in ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree)))
sem_RowConstraint_NullConstraint :: Annotation ->
String ->
T_RowConstraint
sem_RowConstraint_NullConstraint ann_ name_ =
(\ _lhsIcat
_lhsIidenv
_lhsIlib ->
(let _lhsOannotatedTree :: RowConstraint
_lhsOfixedUpIdentifiersTree :: RowConstraint
_lhsOoriginalTree :: RowConstraint
_annotatedTree =
NullConstraint ann_ name_
_fixedUpIdentifiersTree =
NullConstraint ann_ name_
_originalTree =
NullConstraint ann_ name_
_lhsOannotatedTree =
_annotatedTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
in ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree)))
sem_RowConstraint_RowCheckConstraint :: Annotation ->
String ->
T_ScalarExpr ->
T_RowConstraint
sem_RowConstraint_RowCheckConstraint ann_ name_ expr_ =
(\ _lhsIcat
_lhsIidenv
_lhsIlib ->
(let _exprOexpectedType :: (Maybe Type)
_lhsOannotatedTree :: RowConstraint
_lhsOfixedUpIdentifiersTree :: RowConstraint
_lhsOoriginalTree :: RowConstraint
_exprOcat :: Catalog
_exprOidenv :: IDEnv
_exprOlib :: LocalBindings
_exprIannotatedTree :: ScalarExpr
_exprIfixedUpIdentifiersTree :: ScalarExpr
_exprIoriginalTree :: ScalarExpr
_exprIuType :: (Maybe Type)
_exprOexpectedType =
Nothing
_annotatedTree =
RowCheckConstraint ann_ name_ _exprIannotatedTree
_fixedUpIdentifiersTree =
RowCheckConstraint ann_ name_ _exprIfixedUpIdentifiersTree
_originalTree =
RowCheckConstraint ann_ name_ _exprIoriginalTree
_lhsOannotatedTree =
_annotatedTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
_exprOcat =
_lhsIcat
_exprOidenv =
_lhsIidenv
_exprOlib =
_lhsIlib
( _exprIannotatedTree,_exprIfixedUpIdentifiersTree,_exprIoriginalTree,_exprIuType) =
expr_ _exprOcat _exprOexpectedType _exprOidenv _exprOlib
in ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree)))
sem_RowConstraint_RowPrimaryKeyConstraint :: Annotation ->
String ->
T_RowConstraint
sem_RowConstraint_RowPrimaryKeyConstraint ann_ name_ =
(\ _lhsIcat
_lhsIidenv
_lhsIlib ->
(let _lhsOannotatedTree :: RowConstraint
_lhsOfixedUpIdentifiersTree :: RowConstraint
_lhsOoriginalTree :: RowConstraint
_annotatedTree =
RowPrimaryKeyConstraint ann_ name_
_fixedUpIdentifiersTree =
RowPrimaryKeyConstraint ann_ name_
_originalTree =
RowPrimaryKeyConstraint ann_ name_
_lhsOannotatedTree =
_annotatedTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
in ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree)))
sem_RowConstraint_RowReferenceConstraint :: Annotation ->
String ->
T_Name ->
(Maybe NameComponent) ->
Cascade ->
Cascade ->
T_RowConstraint
sem_RowConstraint_RowReferenceConstraint ann_ name_ table_ att_ onUpdate_ onDelete_ =
(\ _lhsIcat
_lhsIidenv
_lhsIlib ->
(let _lhsOannotatedTree :: RowConstraint
_lhsOfixedUpIdentifiersTree :: RowConstraint
_lhsOoriginalTree :: RowConstraint
_tableOcat :: Catalog
_tableOidenv :: IDEnv
_tableOlib :: LocalBindings
_tableIannotatedTree :: Name
_tableIfixedUpIdentifiersTree :: Name
_tableIoriginalTree :: Name
_tableItbAnnotatedTree :: Name
_tableItbUType :: (Maybe ([(String,Type)],[(String,Type)]))
_annotatedTree =
RowReferenceConstraint ann_ name_ _tableIannotatedTree att_ onUpdate_ onDelete_
_fixedUpIdentifiersTree =
RowReferenceConstraint ann_ name_ _tableIfixedUpIdentifiersTree att_ onUpdate_ onDelete_
_originalTree =
RowReferenceConstraint ann_ name_ _tableIoriginalTree att_ onUpdate_ onDelete_
_lhsOannotatedTree =
_annotatedTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
_tableOcat =
_lhsIcat
_tableOidenv =
_lhsIidenv
_tableOlib =
_lhsIlib
( _tableIannotatedTree,_tableIfixedUpIdentifiersTree,_tableIoriginalTree,_tableItbAnnotatedTree,_tableItbUType) =
table_ _tableOcat _tableOidenv _tableOlib
in ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree)))
sem_RowConstraint_RowUniqueConstraint :: Annotation ->
String ->
T_RowConstraint
sem_RowConstraint_RowUniqueConstraint ann_ name_ =
(\ _lhsIcat
_lhsIidenv
_lhsIlib ->
(let _lhsOannotatedTree :: RowConstraint
_lhsOfixedUpIdentifiersTree :: RowConstraint
_lhsOoriginalTree :: RowConstraint
_annotatedTree =
RowUniqueConstraint ann_ name_
_fixedUpIdentifiersTree =
RowUniqueConstraint ann_ name_
_originalTree =
RowUniqueConstraint ann_ name_
_lhsOannotatedTree =
_annotatedTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
in ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree)))
type RowConstraintList = [RowConstraint ]
sem_RowConstraintList :: RowConstraintList ->
T_RowConstraintList
sem_RowConstraintList list =
(Prelude.foldr sem_RowConstraintList_Cons sem_RowConstraintList_Nil (Prelude.map sem_RowConstraint list) )
type T_RowConstraintList = Catalog ->
IDEnv ->
LocalBindings ->
( RowConstraintList ,RowConstraintList ,RowConstraintList )
data Inh_RowConstraintList = Inh_RowConstraintList {cat_Inh_RowConstraintList :: Catalog,idenv_Inh_RowConstraintList :: IDEnv,lib_Inh_RowConstraintList :: LocalBindings}
data Syn_RowConstraintList = Syn_RowConstraintList {annotatedTree_Syn_RowConstraintList :: RowConstraintList ,fixedUpIdentifiersTree_Syn_RowConstraintList :: RowConstraintList ,originalTree_Syn_RowConstraintList :: RowConstraintList }
wrap_RowConstraintList :: T_RowConstraintList ->
Inh_RowConstraintList ->
Syn_RowConstraintList
wrap_RowConstraintList sem (Inh_RowConstraintList _lhsIcat _lhsIidenv _lhsIlib ) =
(let ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree) = sem _lhsIcat _lhsIidenv _lhsIlib
in (Syn_RowConstraintList _lhsOannotatedTree _lhsOfixedUpIdentifiersTree _lhsOoriginalTree ))
sem_RowConstraintList_Cons :: T_RowConstraint ->
T_RowConstraintList ->
T_RowConstraintList
sem_RowConstraintList_Cons hd_ tl_ =
(\ _lhsIcat
_lhsIidenv
_lhsIlib ->
(let _lhsOannotatedTree :: RowConstraintList
_lhsOfixedUpIdentifiersTree :: RowConstraintList
_lhsOoriginalTree :: RowConstraintList
_hdOcat :: Catalog
_hdOidenv :: IDEnv
_hdOlib :: LocalBindings
_tlOcat :: Catalog
_tlOidenv :: IDEnv
_tlOlib :: LocalBindings
_hdIannotatedTree :: RowConstraint
_hdIfixedUpIdentifiersTree :: RowConstraint
_hdIoriginalTree :: RowConstraint
_tlIannotatedTree :: RowConstraintList
_tlIfixedUpIdentifiersTree :: RowConstraintList
_tlIoriginalTree :: RowConstraintList
_annotatedTree =
(:) _hdIannotatedTree _tlIannotatedTree
_fixedUpIdentifiersTree =
(:) _hdIfixedUpIdentifiersTree _tlIfixedUpIdentifiersTree
_originalTree =
(:) _hdIoriginalTree _tlIoriginalTree
_lhsOannotatedTree =
_annotatedTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
_hdOcat =
_lhsIcat
_hdOidenv =
_lhsIidenv
_hdOlib =
_lhsIlib
_tlOcat =
_lhsIcat
_tlOidenv =
_lhsIidenv
_tlOlib =
_lhsIlib
( _hdIannotatedTree,_hdIfixedUpIdentifiersTree,_hdIoriginalTree) =
hd_ _hdOcat _hdOidenv _hdOlib
( _tlIannotatedTree,_tlIfixedUpIdentifiersTree,_tlIoriginalTree) =
tl_ _tlOcat _tlOidenv _tlOlib
in ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree)))
sem_RowConstraintList_Nil :: T_RowConstraintList
sem_RowConstraintList_Nil =
(\ _lhsIcat
_lhsIidenv
_lhsIlib ->
(let _lhsOannotatedTree :: RowConstraintList
_lhsOfixedUpIdentifiersTree :: RowConstraintList
_lhsOoriginalTree :: RowConstraintList
_annotatedTree =
[]
_fixedUpIdentifiersTree =
[]
_originalTree =
[]
_lhsOannotatedTree =
_annotatedTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
in ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree)))
data ScalarExpr = AggregateFn (Annotation) (Distinct) (ScalarExpr ) (ScalarExprDirectionPairList )
| AntiScalarExpr (String)
| BooleanLit (Annotation) (Bool)
| Case (Annotation) (CaseScalarExprListScalarExprPairList ) (MaybeScalarExpr )
| CaseSimple (Annotation) (ScalarExpr ) (CaseScalarExprListScalarExprPairList ) (MaybeScalarExpr )
| Cast (Annotation) (ScalarExpr ) (TypeName )
| Exists (Annotation) (QueryExpr )
| Extract (Annotation) (ExtractField) (ScalarExpr )
| FunCall (Annotation) (Name ) (ScalarExprList )
| Identifier (Annotation) (NameComponent)
| InPredicate (Annotation) (ScalarExpr ) (Bool) (InList )
| Interval (Annotation) (String) (IntervalField) ((Maybe Int))
| LiftOperator (Annotation) (String) (LiftFlavour) (ScalarExprList )
| NullLit (Annotation)
| NumberLit (Annotation) (String)
| Placeholder (Annotation)
| PositionalArg (Annotation) (Integer)
| QIdentifier (Annotation) (([NameComponent]))
| QStar (Annotation) (NameComponent)
| ScalarSubQuery (Annotation) (QueryExpr )
| Star (Annotation)
| StringLit (Annotation) (String)
| TypedStringLit (Annotation) (TypeName ) (String)
| WindowFn (Annotation) (ScalarExpr ) (ScalarExprList ) (ScalarExprDirectionPairList ) (FrameClause)
deriving ( Data,Eq,Show,Typeable)
sem_ScalarExpr :: ScalarExpr ->
T_ScalarExpr
sem_ScalarExpr (AggregateFn _ann _aggDistinct _fn _orderBy ) =
(sem_ScalarExpr_AggregateFn _ann _aggDistinct (sem_ScalarExpr _fn ) (sem_ScalarExprDirectionPairList _orderBy ) )
sem_ScalarExpr (AntiScalarExpr _string ) =
(sem_ScalarExpr_AntiScalarExpr _string )
sem_ScalarExpr (BooleanLit _ann _b ) =
(sem_ScalarExpr_BooleanLit _ann _b )
sem_ScalarExpr (Case _ann _cases _els ) =
(sem_ScalarExpr_Case _ann (sem_CaseScalarExprListScalarExprPairList _cases ) (sem_MaybeScalarExpr _els ) )
sem_ScalarExpr (CaseSimple _ann _value _cases _els ) =
(sem_ScalarExpr_CaseSimple _ann (sem_ScalarExpr _value ) (sem_CaseScalarExprListScalarExprPairList _cases ) (sem_MaybeScalarExpr _els ) )
sem_ScalarExpr (Cast _ann _expr _tn ) =
(sem_ScalarExpr_Cast _ann (sem_ScalarExpr _expr ) (sem_TypeName _tn ) )
sem_ScalarExpr (Exists _ann _sel ) =
(sem_ScalarExpr_Exists _ann (sem_QueryExpr _sel ) )
sem_ScalarExpr (Extract _ann _field _e ) =
(sem_ScalarExpr_Extract _ann _field (sem_ScalarExpr _e ) )
sem_ScalarExpr (FunCall _ann _funName _args ) =
(sem_ScalarExpr_FunCall _ann (sem_Name _funName ) (sem_ScalarExprList _args ) )
sem_ScalarExpr (Identifier _ann _i ) =
(sem_ScalarExpr_Identifier _ann _i )
sem_ScalarExpr (InPredicate _ann _expr _i _list ) =
(sem_ScalarExpr_InPredicate _ann (sem_ScalarExpr _expr ) _i (sem_InList _list ) )
sem_ScalarExpr (Interval _ann _value _field _prec ) =
(sem_ScalarExpr_Interval _ann _value _field _prec )
sem_ScalarExpr (LiftOperator _ann _oper _flav _args ) =
(sem_ScalarExpr_LiftOperator _ann _oper _flav (sem_ScalarExprList _args ) )
sem_ScalarExpr (NullLit _ann ) =
(sem_ScalarExpr_NullLit _ann )
sem_ScalarExpr (NumberLit _ann _d ) =
(sem_ScalarExpr_NumberLit _ann _d )
sem_ScalarExpr (Placeholder _ann ) =
(sem_ScalarExpr_Placeholder _ann )
sem_ScalarExpr (PositionalArg _ann _p ) =
(sem_ScalarExpr_PositionalArg _ann _p )
sem_ScalarExpr (QIdentifier _ann _is ) =
(sem_ScalarExpr_QIdentifier _ann _is )
sem_ScalarExpr (QStar _ann _q ) =
(sem_ScalarExpr_QStar _ann _q )
sem_ScalarExpr (ScalarSubQuery _ann _sel ) =
(sem_ScalarExpr_ScalarSubQuery _ann (sem_QueryExpr _sel ) )
sem_ScalarExpr (Star _ann ) =
(sem_ScalarExpr_Star _ann )
sem_ScalarExpr (StringLit _ann _value ) =
(sem_ScalarExpr_StringLit _ann _value )
sem_ScalarExpr (TypedStringLit _ann _tn _value ) =
(sem_ScalarExpr_TypedStringLit _ann (sem_TypeName _tn ) _value )
sem_ScalarExpr (WindowFn _ann _fn _partitionBy _orderBy _frm ) =
(sem_ScalarExpr_WindowFn _ann (sem_ScalarExpr _fn ) (sem_ScalarExprList _partitionBy ) (sem_ScalarExprDirectionPairList _orderBy ) _frm )
type T_ScalarExpr = Catalog ->
(Maybe Type) ->
IDEnv ->
LocalBindings ->
( ScalarExpr ,ScalarExpr ,ScalarExpr ,(Maybe Type))
data Inh_ScalarExpr = Inh_ScalarExpr {cat_Inh_ScalarExpr :: Catalog,expectedType_Inh_ScalarExpr :: (Maybe Type),idenv_Inh_ScalarExpr :: IDEnv,lib_Inh_ScalarExpr :: LocalBindings}
data Syn_ScalarExpr = Syn_ScalarExpr {annotatedTree_Syn_ScalarExpr :: ScalarExpr ,fixedUpIdentifiersTree_Syn_ScalarExpr :: ScalarExpr ,originalTree_Syn_ScalarExpr :: ScalarExpr ,uType_Syn_ScalarExpr :: (Maybe Type)}
wrap_ScalarExpr :: T_ScalarExpr ->
Inh_ScalarExpr ->
Syn_ScalarExpr
wrap_ScalarExpr sem (Inh_ScalarExpr _lhsIcat _lhsIexpectedType _lhsIidenv _lhsIlib ) =
(let ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree,_lhsOuType) = sem _lhsIcat _lhsIexpectedType _lhsIidenv _lhsIlib
in (Syn_ScalarExpr _lhsOannotatedTree _lhsOfixedUpIdentifiersTree _lhsOoriginalTree _lhsOuType ))
sem_ScalarExpr_AggregateFn :: Annotation ->
Distinct ->
T_ScalarExpr ->
T_ScalarExprDirectionPairList ->
T_ScalarExpr
sem_ScalarExpr_AggregateFn ann_ aggDistinct_ fn_ orderBy_ =
(\ _lhsIcat
_lhsIexpectedType
_lhsIidenv
_lhsIlib ->
(let _lhsOannotatedTree :: ScalarExpr
_lhsOfixedUpIdentifiersTree :: ScalarExpr
_lhsOoriginalTree :: ScalarExpr
_lhsOuType :: (Maybe Type)
_fnOcat :: Catalog
_fnOexpectedType :: (Maybe Type)
_fnOidenv :: IDEnv
_fnOlib :: LocalBindings
_orderByOcat :: Catalog
_orderByOidenv :: IDEnv
_orderByOlib :: LocalBindings
_fnIannotatedTree :: ScalarExpr
_fnIfixedUpIdentifiersTree :: ScalarExpr
_fnIoriginalTree :: ScalarExpr
_fnIuType :: (Maybe Type)
_orderByIannotatedTree :: ScalarExprDirectionPairList
_orderByIfixedUpIdentifiersTree :: ScalarExprDirectionPairList
_orderByIoriginalTree :: ScalarExprDirectionPairList
_annotatedTree =
AggregateFn ann_ aggDistinct_ _fnIannotatedTree _orderByIannotatedTree
_fixedUpIdentifiersTree =
AggregateFn ann_ aggDistinct_ _fnIfixedUpIdentifiersTree _orderByIfixedUpIdentifiersTree
_originalTree =
AggregateFn ann_ aggDistinct_ _fnIoriginalTree _orderByIoriginalTree
_lhsOannotatedTree =
_annotatedTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
_lhsOuType =
_fnIuType
_fnOcat =
_lhsIcat
_fnOexpectedType =
_lhsIexpectedType
_fnOidenv =
_lhsIidenv
_fnOlib =
_lhsIlib
_orderByOcat =
_lhsIcat
_orderByOidenv =
_lhsIidenv
_orderByOlib =
_lhsIlib
( _fnIannotatedTree,_fnIfixedUpIdentifiersTree,_fnIoriginalTree,_fnIuType) =
fn_ _fnOcat _fnOexpectedType _fnOidenv _fnOlib
( _orderByIannotatedTree,_orderByIfixedUpIdentifiersTree,_orderByIoriginalTree) =
orderBy_ _orderByOcat _orderByOidenv _orderByOlib
in ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree,_lhsOuType)))
sem_ScalarExpr_AntiScalarExpr :: String ->
T_ScalarExpr
sem_ScalarExpr_AntiScalarExpr string_ =
(\ _lhsIcat
_lhsIexpectedType
_lhsIidenv
_lhsIlib ->
(let _lhsOuType :: (Maybe Type)
_lhsOannotatedTree :: ScalarExpr
_lhsOfixedUpIdentifiersTree :: ScalarExpr
_lhsOoriginalTree :: ScalarExpr
_lhsOuType =
Nothing
_annotatedTree =
AntiScalarExpr string_
_fixedUpIdentifiersTree =
AntiScalarExpr string_
_originalTree =
AntiScalarExpr string_
_lhsOannotatedTree =
_annotatedTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
in ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree,_lhsOuType)))
sem_ScalarExpr_BooleanLit :: Annotation ->
Bool ->
T_ScalarExpr
sem_ScalarExpr_BooleanLit ann_ b_ =
(\ _lhsIcat
_lhsIexpectedType
_lhsIidenv
_lhsIlib ->
(let _lhsOannotatedTree :: ScalarExpr
_prototype :: (Maybe FunctionPrototype)
_lhsOuType :: (Maybe Type)
_tpe :: Et
_lhsOfixedUpIdentifiersTree :: ScalarExpr
_lhsOoriginalTree :: ScalarExpr
_lhsOannotatedTree =
updateAnnotation
(setTypeAddErrorsA _tpe
. \a -> a {fnProt = _prototype
,infType = msum [_lhsIexpectedType
,etmt _tpe
,Nothing]}) _backTree
_prototype =
Nothing
_lhsOuType =
etmt _tpe
_tpe =
Right typeBool
_backTree =
BooleanLit ann_ b_
_annotatedTree =
BooleanLit ann_ b_
_fixedUpIdentifiersTree =
BooleanLit ann_ b_
_originalTree =
BooleanLit ann_ b_
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
in ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree,_lhsOuType)))
sem_ScalarExpr_Case :: Annotation ->
T_CaseScalarExprListScalarExprPairList ->
T_MaybeScalarExpr ->
T_ScalarExpr
sem_ScalarExpr_Case ann_ cases_ els_ =
(\ _lhsIcat
_lhsIexpectedType
_lhsIidenv
_lhsIlib ->
(let _lhsOannotatedTree :: ScalarExpr
_prototype :: (Maybe FunctionPrototype)
_lhsOuType :: (Maybe Type)
_tpe :: Et
_lhsOfixedUpIdentifiersTree :: ScalarExpr
_lhsOoriginalTree :: ScalarExpr
_casesOcat :: Catalog
_casesOidenv :: IDEnv
_casesOlib :: LocalBindings
_elsOcat :: Catalog
_elsOidenv :: IDEnv
_elsOlib :: LocalBindings
_casesIannotatedTree :: CaseScalarExprListScalarExprPairList
_casesIfixedUpIdentifiersTree :: CaseScalarExprListScalarExprPairList
_casesIoriginalTree :: CaseScalarExprListScalarExprPairList
_casesIthenTypes :: ([Maybe Type])
_casesIwhenTypes :: ([[Maybe Type]])
_elsIannotatedTree :: MaybeScalarExpr
_elsIfixedUpIdentifiersTree :: MaybeScalarExpr
_elsIoriginalTree :: MaybeScalarExpr
_elsIuType :: (Maybe Type)
_lhsOannotatedTree =
updateAnnotation
(setTypeAddErrorsA _tpe
. \a -> a {fnProt = _prototype
,infType = msum [_lhsIexpectedType
,etmt _tpe
,Nothing]}) _backTree
_prototype =
Nothing
_lhsOuType =
etmt _tpe
_whenTypes =
_casesIwhenTypes
_thenTypes =
_casesIthenTypes ++ maybe [] ((:[]) . Just) _elsIuType
_tpe =
do
wt <- mapM lmt $ concat _whenTypes
errorWhen (any (/= typeBool) wt)
[WrongTypes typeBool wt]
tt <- mapM lmt _thenTypes
resolveResultSetType _lhsIcat tt
_backTree =
Case ann_ _casesIannotatedTree _elsIannotatedTree
_annotatedTree =
Case ann_ _casesIannotatedTree _elsIannotatedTree
_fixedUpIdentifiersTree =
Case ann_ _casesIfixedUpIdentifiersTree _elsIfixedUpIdentifiersTree
_originalTree =
Case ann_ _casesIoriginalTree _elsIoriginalTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
_casesOcat =
_lhsIcat
_casesOidenv =
_lhsIidenv
_casesOlib =
_lhsIlib
_elsOcat =
_lhsIcat
_elsOidenv =
_lhsIidenv
_elsOlib =
_lhsIlib
( _casesIannotatedTree,_casesIfixedUpIdentifiersTree,_casesIoriginalTree,_casesIthenTypes,_casesIwhenTypes) =
cases_ _casesOcat _casesOidenv _casesOlib
( _elsIannotatedTree,_elsIfixedUpIdentifiersTree,_elsIoriginalTree,_elsIuType) =
els_ _elsOcat _elsOidenv _elsOlib
in ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree,_lhsOuType)))
sem_ScalarExpr_CaseSimple :: Annotation ->
T_ScalarExpr ->
T_CaseScalarExprListScalarExprPairList ->
T_MaybeScalarExpr ->
T_ScalarExpr
sem_ScalarExpr_CaseSimple ann_ value_ cases_ els_ =
(\ _lhsIcat
_lhsIexpectedType
_lhsIidenv
_lhsIlib ->
(let _lhsOannotatedTree :: ScalarExpr
_prototype :: (Maybe FunctionPrototype)
_lhsOuType :: (Maybe Type)
_tpe :: Et
_lhsOfixedUpIdentifiersTree :: ScalarExpr
_lhsOoriginalTree :: ScalarExpr
_valueOcat :: Catalog
_valueOexpectedType :: (Maybe Type)
_valueOidenv :: IDEnv
_valueOlib :: LocalBindings
_casesOcat :: Catalog
_casesOidenv :: IDEnv
_casesOlib :: LocalBindings
_elsOcat :: Catalog
_elsOidenv :: IDEnv
_elsOlib :: LocalBindings
_valueIannotatedTree :: ScalarExpr
_valueIfixedUpIdentifiersTree :: ScalarExpr
_valueIoriginalTree :: ScalarExpr
_valueIuType :: (Maybe Type)
_casesIannotatedTree :: CaseScalarExprListScalarExprPairList
_casesIfixedUpIdentifiersTree :: CaseScalarExprListScalarExprPairList
_casesIoriginalTree :: CaseScalarExprListScalarExprPairList
_casesIthenTypes :: ([Maybe Type])
_casesIwhenTypes :: ([[Maybe Type]])
_elsIannotatedTree :: MaybeScalarExpr
_elsIfixedUpIdentifiersTree :: MaybeScalarExpr
_elsIoriginalTree :: MaybeScalarExpr
_elsIuType :: (Maybe Type)
_lhsOannotatedTree =
updateAnnotation
(setTypeAddErrorsA _tpe
. \a -> a {fnProt = _prototype
,infType = msum [_lhsIexpectedType
,etmt _tpe
,Nothing]}) _backTree
_prototype =
Nothing
_lhsOuType =
etmt _tpe
_whenTypes =
_casesIwhenTypes
_thenTypes =
_casesIthenTypes ++ maybe [] ((:[]) . Just) _elsIuType
_tpe =
do
wt <- mapM lmt $ concat _whenTypes
vt <- lmt _valueIuType
_ <- resolveResultSetType _lhsIcat (vt : wt)
tt <- mapM lmt _thenTypes
resolveResultSetType _lhsIcat tt
_backTree =
CaseSimple ann_
_valueIannotatedTree
_casesIannotatedTree
_elsIannotatedTree
_annotatedTree =
CaseSimple ann_ _valueIannotatedTree _casesIannotatedTree _elsIannotatedTree
_fixedUpIdentifiersTree =
CaseSimple ann_ _valueIfixedUpIdentifiersTree _casesIfixedUpIdentifiersTree _elsIfixedUpIdentifiersTree
_originalTree =
CaseSimple ann_ _valueIoriginalTree _casesIoriginalTree _elsIoriginalTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
_valueOcat =
_lhsIcat
_valueOexpectedType =
_lhsIexpectedType
_valueOidenv =
_lhsIidenv
_valueOlib =
_lhsIlib
_casesOcat =
_lhsIcat
_casesOidenv =
_lhsIidenv
_casesOlib =
_lhsIlib
_elsOcat =
_lhsIcat
_elsOidenv =
_lhsIidenv
_elsOlib =
_lhsIlib
( _valueIannotatedTree,_valueIfixedUpIdentifiersTree,_valueIoriginalTree,_valueIuType) =
value_ _valueOcat _valueOexpectedType _valueOidenv _valueOlib
( _casesIannotatedTree,_casesIfixedUpIdentifiersTree,_casesIoriginalTree,_casesIthenTypes,_casesIwhenTypes) =
cases_ _casesOcat _casesOidenv _casesOlib
( _elsIannotatedTree,_elsIfixedUpIdentifiersTree,_elsIoriginalTree,_elsIuType) =
els_ _elsOcat _elsOidenv _elsOlib
in ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree,_lhsOuType)))
sem_ScalarExpr_Cast :: Annotation ->
T_ScalarExpr ->
T_TypeName ->
T_ScalarExpr
sem_ScalarExpr_Cast ann_ expr_ tn_ =
(\ _lhsIcat
_lhsIexpectedType
_lhsIidenv
_lhsIlib ->
(let _lhsOannotatedTree :: ScalarExpr
_prototype :: (Maybe FunctionPrototype)
_lhsOuType :: (Maybe Type)
_tpe :: Et
_lhsOfixedUpIdentifiersTree :: ScalarExpr
_lhsOoriginalTree :: ScalarExpr
_exprOcat :: Catalog
_exprOexpectedType :: (Maybe Type)
_exprOidenv :: IDEnv
_exprOlib :: LocalBindings
_tnOcat :: Catalog
_tnOidenv :: IDEnv
_tnOlib :: LocalBindings
_exprIannotatedTree :: ScalarExpr
_exprIfixedUpIdentifiersTree :: ScalarExpr
_exprIoriginalTree :: ScalarExpr
_exprIuType :: (Maybe Type)
_tnIannotatedTree :: TypeName
_tnIfixedUpIdentifiersTree :: TypeName
_tnInamedType :: (Maybe Type)
_tnIoriginalTree :: TypeName
_lhsOannotatedTree =
updateAnnotation
(setTypeAddErrorsA _tpe
. \a -> a {fnProt = _prototype
,infType = msum [_lhsIexpectedType
,etmt _tpe
,Nothing]}) _backTree
_prototype =
Nothing
_lhsOuType =
etmt _tpe
_tpe =
lmt _tnInamedType
_backTree =
Cast ann_ _exprIannotatedTree _tnIannotatedTree
_annotatedTree =
Cast ann_ _exprIannotatedTree _tnIannotatedTree
_fixedUpIdentifiersTree =
Cast ann_ _exprIfixedUpIdentifiersTree _tnIfixedUpIdentifiersTree
_originalTree =
Cast ann_ _exprIoriginalTree _tnIoriginalTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
_exprOcat =
_lhsIcat
_exprOexpectedType =
_lhsIexpectedType
_exprOidenv =
_lhsIidenv
_exprOlib =
_lhsIlib
_tnOcat =
_lhsIcat
_tnOidenv =
_lhsIidenv
_tnOlib =
_lhsIlib
( _exprIannotatedTree,_exprIfixedUpIdentifiersTree,_exprIoriginalTree,_exprIuType) =
expr_ _exprOcat _exprOexpectedType _exprOidenv _exprOlib
( _tnIannotatedTree,_tnIfixedUpIdentifiersTree,_tnInamedType,_tnIoriginalTree) =
tn_ _tnOcat _tnOidenv _tnOlib
in ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree,_lhsOuType)))
sem_ScalarExpr_Exists :: Annotation ->
T_QueryExpr ->
T_ScalarExpr
sem_ScalarExpr_Exists ann_ sel_ =
(\ _lhsIcat
_lhsIexpectedType
_lhsIidenv
_lhsIlib ->
(let _lhsOannotatedTree :: ScalarExpr
_prototype :: (Maybe FunctionPrototype)
_lhsOuType :: (Maybe Type)
_tpe :: Et
_selOcsql :: LocalBindings
_selOexpectedTypes :: ([Maybe Type])
_lhsOfixedUpIdentifiersTree :: ScalarExpr
_lhsOoriginalTree :: ScalarExpr
_selOcat :: Catalog
_selOidenv :: IDEnv
_selOlib :: LocalBindings
_selIannotatedTree :: QueryExpr
_selIcidenv :: IDEnv
_selIfixedUpIdentifiersTree :: QueryExpr
_selIlibUpdates :: ([LocalBindingsUpdate])
_selIoriginalTree :: QueryExpr
_selIuType :: (Maybe [(String,Type)])
_lhsOannotatedTree =
updateAnnotation
(setTypeAddErrorsA _tpe
. \a -> a {fnProt = _prototype
,infType = msum [_lhsIexpectedType
,etmt _tpe
,Nothing]}) _backTree
_prototype =
Nothing
_lhsOuType =
etmt _tpe
_tpe =
Right typeBool
_backTree =
Exists ann_ _selIannotatedTree
_selOcsql =
_lhsIlib
_selOexpectedTypes =
[]
_annotatedTree =
Exists ann_ _selIannotatedTree
_fixedUpIdentifiersTree =
Exists ann_ _selIfixedUpIdentifiersTree
_originalTree =
Exists ann_ _selIoriginalTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
_selOcat =
_lhsIcat
_selOidenv =
_lhsIidenv
_selOlib =
_lhsIlib
( _selIannotatedTree,_selIcidenv,_selIfixedUpIdentifiersTree,_selIlibUpdates,_selIoriginalTree,_selIuType) =
sel_ _selOcat _selOcsql _selOexpectedTypes _selOidenv _selOlib
in ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree,_lhsOuType)))
sem_ScalarExpr_Extract :: Annotation ->
ExtractField ->
T_ScalarExpr ->
T_ScalarExpr
sem_ScalarExpr_Extract ann_ field_ e_ =
(\ _lhsIcat
_lhsIexpectedType
_lhsIidenv
_lhsIlib ->
(let _lhsOannotatedTree :: ScalarExpr
_prototype :: (Maybe FunctionPrototype)
_lhsOuType :: (Maybe Type)
_tpe :: Et
_lhsOfixedUpIdentifiersTree :: ScalarExpr
_lhsOoriginalTree :: ScalarExpr
_eOcat :: Catalog
_eOexpectedType :: (Maybe Type)
_eOidenv :: IDEnv
_eOlib :: LocalBindings
_eIannotatedTree :: ScalarExpr
_eIfixedUpIdentifiersTree :: ScalarExpr
_eIoriginalTree :: ScalarExpr
_eIuType :: (Maybe Type)
_lhsOannotatedTree =
updateAnnotation
(setTypeAddErrorsA _tpe
. \a -> a {fnProt = _prototype
,infType = msum [_lhsIexpectedType
,etmt _tpe
,Nothing]}) _backTree
_prototype =
Nothing
_lhsOuType =
etmt _tpe
_tpe =
do
x <- lmt _eIuType
if x == typeDate
then Right typeFloat8
else Left [NoMatchingOperator "extract" [x]]
_backTree =
Extract ann_ field_ _eIannotatedTree
_annotatedTree =
Extract ann_ field_ _eIannotatedTree
_fixedUpIdentifiersTree =
Extract ann_ field_ _eIfixedUpIdentifiersTree
_originalTree =
Extract ann_ field_ _eIoriginalTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
_eOcat =
_lhsIcat
_eOexpectedType =
_lhsIexpectedType
_eOidenv =
_lhsIidenv
_eOlib =
_lhsIlib
( _eIannotatedTree,_eIfixedUpIdentifiersTree,_eIoriginalTree,_eIuType) =
e_ _eOcat _eOexpectedType _eOidenv _eOlib
in ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree,_lhsOuType)))
sem_ScalarExpr_FunCall :: Annotation ->
T_Name ->
T_ScalarExprList ->
T_ScalarExpr
sem_ScalarExpr_FunCall ann_ funName_ args_ =
(\ _lhsIcat
_lhsIexpectedType
_lhsIidenv
_lhsIlib ->
(let _lhsOannotatedTree :: ScalarExpr
_lhsOuType :: (Maybe Type)
_tpe :: Et
_argsOexpectedTypes :: ([Maybe Type])
_lhsOfixedUpIdentifiersTree :: ScalarExpr
_lhsOoriginalTree :: ScalarExpr
_funNameOcat :: Catalog
_funNameOidenv :: IDEnv
_funNameOlib :: LocalBindings
_argsOcat :: Catalog
_argsOidenv :: IDEnv
_argsOlib :: LocalBindings
_funNameIannotatedTree :: Name
_funNameIfixedUpIdentifiersTree :: Name
_funNameIoriginalTree :: Name
_funNameItbAnnotatedTree :: Name
_funNameItbUType :: (Maybe ([(String,Type)],[(String,Type)]))
_argsIannotatedTree :: ScalarExprList
_argsIfixedUpIdentifiersTree :: ScalarExprList
_argsIoriginalTree :: ScalarExprList
_argsIuType :: ([Maybe Type])
_lhsOannotatedTree =
updateAnnotation
(setTypeAddErrorsA _tpe
. \a -> a {fnProt = _prototype
,infType = msum [_lhsIexpectedType
,etmt _tpe
,Nothing]}) _backTree
_lhsOuType =
etmt _tpe
__tup1 =
either (\e -> (Left e, Nothing)) id $ do
args <- mapM lmt _argsIuType
efp <- findCallMatch _lhsIcat
(getTName _funNameIoriginalTree)
args
let (_,_,r,_) = efp
return (Right r, Just efp)
(_tpe,_) =
__tup1
(_,_prototype) =
__tup1
_backTree =
FunCall ann_ _funNameIoriginalTree _argsIannotatedTree
_argsOexpectedTypes =
maybe [] id $
case (getTName _funNameIoriginalTree,_lhsIexpectedType) of
("!rowctor", Just (AnonymousRecordType ts)) -> return $ map Just ts
_ -> do
(_,t,_,_) <- _prototype
return $ map Just t
_annotatedTree =
FunCall ann_ _funNameIannotatedTree _argsIannotatedTree
_fixedUpIdentifiersTree =
FunCall ann_ _funNameIfixedUpIdentifiersTree _argsIfixedUpIdentifiersTree
_originalTree =
FunCall ann_ _funNameIoriginalTree _argsIoriginalTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
_funNameOcat =
_lhsIcat
_funNameOidenv =
_lhsIidenv
_funNameOlib =
_lhsIlib
_argsOcat =
_lhsIcat
_argsOidenv =
_lhsIidenv
_argsOlib =
_lhsIlib
( _funNameIannotatedTree,_funNameIfixedUpIdentifiersTree,_funNameIoriginalTree,_funNameItbAnnotatedTree,_funNameItbUType) =
funName_ _funNameOcat _funNameOidenv _funNameOlib
( _argsIannotatedTree,_argsIfixedUpIdentifiersTree,_argsIoriginalTree,_argsIuType) =
args_ _argsOcat _argsOexpectedTypes _argsOidenv _argsOlib
in ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree,_lhsOuType)))
sem_ScalarExpr_Identifier :: Annotation ->
NameComponent ->
T_ScalarExpr
sem_ScalarExpr_Identifier ann_ i_ =
(\ _lhsIcat
_lhsIexpectedType
_lhsIidenv
_lhsIlib ->
(let _lhsOfixedUpIdentifiersTree :: ScalarExpr
_lhsOannotatedTree :: ScalarExpr
_prototype :: (Maybe FunctionPrototype)
_lhsOuType :: (Maybe Type)
_tpe :: Et
_lhsOoriginalTree :: ScalarExpr
_lhsOfixedUpIdentifiersTree =
case qualifyID _lhsIidenv (ncStr i_) of
Nothing -> Identifier ann_ i_
Just (t,i) -> QIdentifier ann_ [Nmc t, Nmc i]
_lhsOannotatedTree =
updateAnnotation
(setTypeAddErrorsA _tpe
. \a -> a {fnProt = _prototype
,infType = msum [_lhsIexpectedType
,etmt _tpe
,Nothing]}) _backTree
_prototype =
Nothing
_lhsOuType =
etmt _tpe
_tpe =
case lookupLocalBinding _lhsIlib "" (ncStr i_) of
Right Nothing -> Left []
Right (Just t) -> Right t
Left e -> Left e
_backTree =
Identifier ann_ i_
_annotatedTree =
Identifier ann_ i_
_fixedUpIdentifiersTree =
Identifier ann_ i_
_originalTree =
Identifier ann_ i_
_lhsOoriginalTree =
_originalTree
in ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree,_lhsOuType)))
sem_ScalarExpr_InPredicate :: Annotation ->
T_ScalarExpr ->
Bool ->
T_InList ->
T_ScalarExpr
sem_ScalarExpr_InPredicate ann_ expr_ i_ list_ =
(\ _lhsIcat
_lhsIexpectedType
_lhsIidenv
_lhsIlib ->
(let _lhsOannotatedTree :: ScalarExpr
_prototype :: (Maybe FunctionPrototype)
_lhsOuType :: (Maybe Type)
_rt :: (Either [TypeError] Type)
_tpe :: Et
_listOexpectedType :: (Maybe Type)
_exprOexpectedType :: (Maybe Type)
_lhsOfixedUpIdentifiersTree :: ScalarExpr
_lhsOoriginalTree :: ScalarExpr
_exprOcat :: Catalog
_exprOidenv :: IDEnv
_exprOlib :: LocalBindings
_listOcat :: Catalog
_listOidenv :: IDEnv
_listOlib :: LocalBindings
_exprIannotatedTree :: ScalarExpr
_exprIfixedUpIdentifiersTree :: ScalarExpr
_exprIoriginalTree :: ScalarExpr
_exprIuType :: (Maybe Type)
_listIannotatedTree :: InList
_listIfixedUpIdentifiersTree :: InList
_listIlistType :: (Either [TypeError] Type)
_listIoriginalTree :: InList
_lhsOannotatedTree =
updateAnnotation
(setTypeAddErrorsA _tpe
. \a -> a {fnProt = _prototype
,infType = msum [_lhsIexpectedType
,etmt _tpe
,Nothing]}) _backTree
_prototype =
Nothing
_lhsOuType =
etmt _tpe
_rt =
do
lt <- _listIlistType
expt <- lmt _exprIuType
resolveResultSetType _lhsIcat [expt, lt]
_tpe =
do
_ <- _rt
return typeBool
_listOexpectedType =
etmt _rt
_exprOexpectedType =
etmt _rt
_backTree =
InPredicate ann_
_exprIannotatedTree
i_
_listIannotatedTree
_annotatedTree =
InPredicate ann_ _exprIannotatedTree i_ _listIannotatedTree
_fixedUpIdentifiersTree =
InPredicate ann_ _exprIfixedUpIdentifiersTree i_ _listIfixedUpIdentifiersTree
_originalTree =
InPredicate ann_ _exprIoriginalTree i_ _listIoriginalTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
_exprOcat =
_lhsIcat
_exprOidenv =
_lhsIidenv
_exprOlib =
_lhsIlib
_listOcat =
_lhsIcat
_listOidenv =
_lhsIidenv
_listOlib =
_lhsIlib
( _exprIannotatedTree,_exprIfixedUpIdentifiersTree,_exprIoriginalTree,_exprIuType) =
expr_ _exprOcat _exprOexpectedType _exprOidenv _exprOlib
( _listIannotatedTree,_listIfixedUpIdentifiersTree,_listIlistType,_listIoriginalTree) =
list_ _listOcat _listOexpectedType _listOidenv _listOlib
in ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree,_lhsOuType)))
sem_ScalarExpr_Interval :: Annotation ->
String ->
IntervalField ->
(Maybe Int) ->
T_ScalarExpr
sem_ScalarExpr_Interval ann_ value_ field_ prec_ =
(\ _lhsIcat
_lhsIexpectedType
_lhsIidenv
_lhsIlib ->
(let _lhsOannotatedTree :: ScalarExpr
_prototype :: (Maybe FunctionPrototype)
_lhsOuType :: (Maybe Type)
_tpe :: Et
_lhsOfixedUpIdentifiersTree :: ScalarExpr
_lhsOoriginalTree :: ScalarExpr
_lhsOannotatedTree =
updateAnnotation
(setTypeAddErrorsA _tpe
. \a -> a {fnProt = _prototype
,infType = msum [_lhsIexpectedType
,etmt _tpe
,Nothing]}) _backTree
_prototype =
Nothing
_lhsOuType =
etmt _tpe
_tpe =
Right $ ScalarType "interval"
_backTree =
Interval ann_ value_ field_ prec_
_annotatedTree =
Interval ann_ value_ field_ prec_
_fixedUpIdentifiersTree =
Interval ann_ value_ field_ prec_
_originalTree =
Interval ann_ value_ field_ prec_
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
in ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree,_lhsOuType)))
sem_ScalarExpr_LiftOperator :: Annotation ->
String ->
LiftFlavour ->
T_ScalarExprList ->
T_ScalarExpr
sem_ScalarExpr_LiftOperator ann_ oper_ flav_ args_ =
(\ _lhsIcat
_lhsIexpectedType
_lhsIidenv
_lhsIlib ->
(let _lhsOannotatedTree :: ScalarExpr
_prototype :: (Maybe FunctionPrototype)
_lhsOuType :: (Maybe Type)
_tpe :: Et
_argsOexpectedTypes :: ([Maybe Type])
_lhsOfixedUpIdentifiersTree :: ScalarExpr
_lhsOoriginalTree :: ScalarExpr
_argsOcat :: Catalog
_argsOidenv :: IDEnv
_argsOlib :: LocalBindings
_argsIannotatedTree :: ScalarExprList
_argsIfixedUpIdentifiersTree :: ScalarExprList
_argsIoriginalTree :: ScalarExprList
_argsIuType :: ([Maybe Type])
_lhsOannotatedTree =
updateAnnotation
(setTypeAddErrorsA _tpe
. \a -> a {fnProt = _prototype
,infType = msum [_lhsIexpectedType
,etmt _tpe
,Nothing]}) _backTree
_prototype =
Nothing
_lhsOuType =
etmt _tpe
_tpe =
do
at <- mapM lmt _argsIuType
errorWhen (length at /= 2)
[AnyAllError $ "must have two args, got " ++ show at]
let [aType,bType] = at
errorWhen (not $ isArrayType bType)
[AnyAllError $ "second arg must be array, got " ++ show at]
elemType <- unwrapArray $ bType
resType <- fmap (\(_,_,r,_) -> r) $ findCallMatch _lhsIcat
oper_
[aType,elemType]
errorWhen (resType /= typeBool)
[AnyAllError $ "operator must have bool return, got " ++ show resType]
return resType
_backTree =
LiftOperator ann_ oper_ flav_ _argsIannotatedTree
_argsOexpectedTypes =
[]
_annotatedTree =
LiftOperator ann_ oper_ flav_ _argsIannotatedTree
_fixedUpIdentifiersTree =
LiftOperator ann_ oper_ flav_ _argsIfixedUpIdentifiersTree
_originalTree =
LiftOperator ann_ oper_ flav_ _argsIoriginalTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
_argsOcat =
_lhsIcat
_argsOidenv =
_lhsIidenv
_argsOlib =
_lhsIlib
( _argsIannotatedTree,_argsIfixedUpIdentifiersTree,_argsIoriginalTree,_argsIuType) =
args_ _argsOcat _argsOexpectedTypes _argsOidenv _argsOlib
in ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree,_lhsOuType)))
sem_ScalarExpr_NullLit :: Annotation ->
T_ScalarExpr
sem_ScalarExpr_NullLit ann_ =
(\ _lhsIcat
_lhsIexpectedType
_lhsIidenv
_lhsIlib ->
(let _lhsOannotatedTree :: ScalarExpr
_prototype :: (Maybe FunctionPrototype)
_lhsOuType :: (Maybe Type)
_tpe :: Et
_lhsOfixedUpIdentifiersTree :: ScalarExpr
_lhsOoriginalTree :: ScalarExpr
_lhsOannotatedTree =
updateAnnotation
(setTypeAddErrorsA _tpe
. \a -> a {fnProt = _prototype
,infType = msum [_lhsIexpectedType
,etmt _tpe
,Nothing]}) _backTree
_prototype =
Nothing
_lhsOuType =
etmt _tpe
_tpe =
Right UnknownType
_backTree =
NullLit ann_
_annotatedTree =
NullLit ann_
_fixedUpIdentifiersTree =
NullLit ann_
_originalTree =
NullLit ann_
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
in ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree,_lhsOuType)))
sem_ScalarExpr_NumberLit :: Annotation ->
String ->
T_ScalarExpr
sem_ScalarExpr_NumberLit ann_ d_ =
(\ _lhsIcat
_lhsIexpectedType
_lhsIidenv
_lhsIlib ->
(let _lhsOannotatedTree :: ScalarExpr
_prototype :: (Maybe FunctionPrototype)
_lhsOuType :: (Maybe Type)
_tpe :: Et
_lhsOfixedUpIdentifiersTree :: ScalarExpr
_lhsOoriginalTree :: ScalarExpr
_lhsOannotatedTree =
updateAnnotation
(setTypeAddErrorsA _tpe
. \a -> a {fnProt = _prototype
,infType = msum [_lhsIexpectedType
,etmt _tpe
,Nothing]}) _backTree
_prototype =
Nothing
_lhsOuType =
etmt _tpe
_tpe =
if all (`elem` digChars) d_
then Right typeInt
else Right typeNumeric
where
digChars = concatMap show [(0::Int)..9]
_backTree =
NumberLit ann_ d_
_annotatedTree =
NumberLit ann_ d_
_fixedUpIdentifiersTree =
NumberLit ann_ d_
_originalTree =
NumberLit ann_ d_
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
in ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree,_lhsOuType)))
sem_ScalarExpr_Placeholder :: Annotation ->
T_ScalarExpr
sem_ScalarExpr_Placeholder ann_ =
(\ _lhsIcat
_lhsIexpectedType
_lhsIidenv
_lhsIlib ->
(let _lhsOannotatedTree :: ScalarExpr
_prototype :: (Maybe FunctionPrototype)
_lhsOuType :: (Maybe Type)
_tpe :: Et
_lhsOfixedUpIdentifiersTree :: ScalarExpr
_lhsOoriginalTree :: ScalarExpr
_lhsOannotatedTree =
updateAnnotation
(setTypeAddErrorsA _tpe
. \a -> a {fnProt = _prototype
,infType = msum [_lhsIexpectedType
,etmt _tpe
,Nothing]}) _backTree
_prototype =
Nothing
_lhsOuType =
etmt _tpe
_tpe =
Right UnknownType
_backTree =
Placeholder ann_
_annotatedTree =
Placeholder ann_
_fixedUpIdentifiersTree =
Placeholder ann_
_originalTree =
Placeholder ann_
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
in ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree,_lhsOuType)))
sem_ScalarExpr_PositionalArg :: Annotation ->
Integer ->
T_ScalarExpr
sem_ScalarExpr_PositionalArg ann_ p_ =
(\ _lhsIcat
_lhsIexpectedType
_lhsIidenv
_lhsIlib ->
(let _lhsOannotatedTree :: ScalarExpr
_prototype :: (Maybe FunctionPrototype)
_lhsOuType :: (Maybe Type)
_tpe :: Et
_lhsOfixedUpIdentifiersTree :: ScalarExpr
_lhsOoriginalTree :: ScalarExpr
_lhsOannotatedTree =
updateAnnotation
(setTypeAddErrorsA _tpe
. \a -> a {fnProt = _prototype
,infType = msum [_lhsIexpectedType
,etmt _tpe
,Nothing]}) _backTree
_prototype =
Nothing
_lhsOuType =
etmt _tpe
_tpe =
unwrapLookup <$> lbLookupID _lhsIlib ['$':show p_]
_backTree =
PositionalArg ann_ p_
_annotatedTree =
PositionalArg ann_ p_
_fixedUpIdentifiersTree =
PositionalArg ann_ p_
_originalTree =
PositionalArg ann_ p_
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
in ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree,_lhsOuType)))
sem_ScalarExpr_QIdentifier :: Annotation ->
([NameComponent]) ->
T_ScalarExpr
sem_ScalarExpr_QIdentifier ann_ is_ =
(\ _lhsIcat
_lhsIexpectedType
_lhsIidenv
_lhsIlib ->
(let _lhsOfixedUpIdentifiersTree :: ScalarExpr
_lhsOannotatedTree :: ScalarExpr
_prototype :: (Maybe FunctionPrototype)
_lhsOuType :: (Maybe Type)
_tpe :: Et
_lhsOoriginalTree :: ScalarExpr
_lhsOfixedUpIdentifiersTree =
QIdentifier ann_ is_
_lhsOannotatedTree =
updateAnnotation
(setTypeAddErrorsA _tpe
. \a -> a {fnProt = _prototype
,infType = msum [_lhsIexpectedType
,etmt _tpe
,Nothing]}) _backTree
_prototype =
Nothing
_lhsOuType =
etmt _tpe
_tpe =
case is_ of
[Nmc q,Nmc i] ->
case lookupLocalBinding _lhsIlib q i of
Right Nothing -> Left []
Right (Just t) -> Right t
Left e -> Left e
_ -> Left [InternalError "dot selection not implemented"]
_backTree =
QIdentifier ann_ is_
_annotatedTree =
QIdentifier ann_ is_
_fixedUpIdentifiersTree =
QIdentifier ann_ is_
_originalTree =
QIdentifier ann_ is_
_lhsOoriginalTree =
_originalTree
in ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree,_lhsOuType)))
sem_ScalarExpr_QStar :: Annotation ->
NameComponent ->
T_ScalarExpr
sem_ScalarExpr_QStar ann_ q_ =
(\ _lhsIcat
_lhsIexpectedType
_lhsIidenv
_lhsIlib ->
(let _lhsOuType :: (Maybe Type)
_lhsOannotatedTree :: ScalarExpr
_lhsOfixedUpIdentifiersTree :: ScalarExpr
_lhsOoriginalTree :: ScalarExpr
_lhsOuType =
Nothing
_annotatedTree =
QStar ann_ q_
_fixedUpIdentifiersTree =
QStar ann_ q_
_originalTree =
QStar ann_ q_
_lhsOannotatedTree =
_annotatedTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
in ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree,_lhsOuType)))
sem_ScalarExpr_ScalarSubQuery :: Annotation ->
T_QueryExpr ->
T_ScalarExpr
sem_ScalarExpr_ScalarSubQuery ann_ sel_ =
(\ _lhsIcat
_lhsIexpectedType
_lhsIidenv
_lhsIlib ->
(let _lhsOannotatedTree :: ScalarExpr
_prototype :: (Maybe FunctionPrototype)
_lhsOuType :: (Maybe Type)
_tpe :: Et
_selOcsql :: LocalBindings
_selOexpectedTypes :: ([Maybe Type])
_lhsOfixedUpIdentifiersTree :: ScalarExpr
_lhsOoriginalTree :: ScalarExpr
_selOcat :: Catalog
_selOidenv :: IDEnv
_selOlib :: LocalBindings
_selIannotatedTree :: QueryExpr
_selIcidenv :: IDEnv
_selIfixedUpIdentifiersTree :: QueryExpr
_selIlibUpdates :: ([LocalBindingsUpdate])
_selIoriginalTree :: QueryExpr
_selIuType :: (Maybe [(String,Type)])
_lhsOannotatedTree =
updateAnnotation
(setTypeAddErrorsA _tpe
. \a -> a {fnProt = _prototype
,infType = msum [_lhsIexpectedType
,etmt _tpe
,Nothing]}) _backTree
_prototype =
Nothing
_lhsOuType =
etmt _tpe
_tpe =
do
selType <- lmt (map snd <$> _selIuType)
case length selType of
0 -> Left [InternalError "no columns in scalar subquery?"]
1 -> Right $ head selType
_ -> Right $ AnonymousRecordType selType
_backTree =
ScalarSubQuery ann_ _selIannotatedTree
_selOcsql =
_lhsIlib
_selOexpectedTypes =
[]
_annotatedTree =
ScalarSubQuery ann_ _selIannotatedTree
_fixedUpIdentifiersTree =
ScalarSubQuery ann_ _selIfixedUpIdentifiersTree
_originalTree =
ScalarSubQuery ann_ _selIoriginalTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
_selOcat =
_lhsIcat
_selOidenv =
_lhsIidenv
_selOlib =
_lhsIlib
( _selIannotatedTree,_selIcidenv,_selIfixedUpIdentifiersTree,_selIlibUpdates,_selIoriginalTree,_selIuType) =
sel_ _selOcat _selOcsql _selOexpectedTypes _selOidenv _selOlib
in ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree,_lhsOuType)))
sem_ScalarExpr_Star :: Annotation ->
T_ScalarExpr
sem_ScalarExpr_Star ann_ =
(\ _lhsIcat
_lhsIexpectedType
_lhsIidenv
_lhsIlib ->
(let _lhsOuType :: (Maybe Type)
_lhsOannotatedTree :: ScalarExpr
_lhsOfixedUpIdentifiersTree :: ScalarExpr
_lhsOoriginalTree :: ScalarExpr
_lhsOuType =
Nothing
_annotatedTree =
Star ann_
_fixedUpIdentifiersTree =
Star ann_
_originalTree =
Star ann_
_lhsOannotatedTree =
_annotatedTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
in ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree,_lhsOuType)))
sem_ScalarExpr_StringLit :: Annotation ->
String ->
T_ScalarExpr
sem_ScalarExpr_StringLit ann_ value_ =
(\ _lhsIcat
_lhsIexpectedType
_lhsIidenv
_lhsIlib ->
(let _lhsOannotatedTree :: ScalarExpr
_prototype :: (Maybe FunctionPrototype)
_lhsOuType :: (Maybe Type)
_tpe :: Et
_lhsOfixedUpIdentifiersTree :: ScalarExpr
_lhsOoriginalTree :: ScalarExpr
_lhsOannotatedTree =
updateAnnotation
(setTypeAddErrorsA _tpe
. \a -> a {fnProt = _prototype
,infType = msum [_lhsIexpectedType
,etmt _tpe
,Nothing]}) _backTree
_prototype =
Nothing
_lhsOuType =
etmt _tpe
_tpe =
Right UnknownType
_backTree =
StringLit ann_ value_
_annotatedTree =
StringLit ann_ value_
_fixedUpIdentifiersTree =
StringLit ann_ value_
_originalTree =
StringLit ann_ value_
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
in ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree,_lhsOuType)))
sem_ScalarExpr_TypedStringLit :: Annotation ->
T_TypeName ->
String ->
T_ScalarExpr
sem_ScalarExpr_TypedStringLit ann_ tn_ value_ =
(\ _lhsIcat
_lhsIexpectedType
_lhsIidenv
_lhsIlib ->
(let _lhsOannotatedTree :: ScalarExpr
_prototype :: (Maybe FunctionPrototype)
_lhsOuType :: (Maybe Type)
_tpe :: Et
_lhsOfixedUpIdentifiersTree :: ScalarExpr
_lhsOoriginalTree :: ScalarExpr
_tnOcat :: Catalog
_tnOidenv :: IDEnv
_tnOlib :: LocalBindings
_tnIannotatedTree :: TypeName
_tnIfixedUpIdentifiersTree :: TypeName
_tnInamedType :: (Maybe Type)
_tnIoriginalTree :: TypeName
_lhsOannotatedTree =
updateAnnotation
(setTypeAddErrorsA _tpe
. \a -> a {fnProt = _prototype
,infType = msum [_lhsIexpectedType
,etmt _tpe
,Nothing]}) _backTree
_prototype =
Nothing
_lhsOuType =
etmt _tpe
_tpe =
lmt _tnInamedType
_backTree =
TypedStringLit ann_ _tnIannotatedTree value_
_annotatedTree =
TypedStringLit ann_ _tnIannotatedTree value_
_fixedUpIdentifiersTree =
TypedStringLit ann_ _tnIfixedUpIdentifiersTree value_
_originalTree =
TypedStringLit ann_ _tnIoriginalTree value_
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
_tnOcat =
_lhsIcat
_tnOidenv =
_lhsIidenv
_tnOlib =
_lhsIlib
( _tnIannotatedTree,_tnIfixedUpIdentifiersTree,_tnInamedType,_tnIoriginalTree) =
tn_ _tnOcat _tnOidenv _tnOlib
in ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree,_lhsOuType)))
sem_ScalarExpr_WindowFn :: Annotation ->
T_ScalarExpr ->
T_ScalarExprList ->
T_ScalarExprDirectionPairList ->
FrameClause ->
T_ScalarExpr
sem_ScalarExpr_WindowFn ann_ fn_ partitionBy_ orderBy_ frm_ =
(\ _lhsIcat
_lhsIexpectedType
_lhsIidenv
_lhsIlib ->
(let _lhsOannotatedTree :: ScalarExpr
_prototype :: (Maybe FunctionPrototype)
_lhsOuType :: (Maybe Type)
_tpe :: Et
_partitionByOexpectedTypes :: ([Maybe Type])
_lhsOfixedUpIdentifiersTree :: ScalarExpr
_lhsOoriginalTree :: ScalarExpr
_fnOcat :: Catalog
_fnOexpectedType :: (Maybe Type)
_fnOidenv :: IDEnv
_fnOlib :: LocalBindings
_partitionByOcat :: Catalog
_partitionByOidenv :: IDEnv
_partitionByOlib :: LocalBindings
_orderByOcat :: Catalog
_orderByOidenv :: IDEnv
_orderByOlib :: LocalBindings
_fnIannotatedTree :: ScalarExpr
_fnIfixedUpIdentifiersTree :: ScalarExpr
_fnIoriginalTree :: ScalarExpr
_fnIuType :: (Maybe Type)
_partitionByIannotatedTree :: ScalarExprList
_partitionByIfixedUpIdentifiersTree :: ScalarExprList
_partitionByIoriginalTree :: ScalarExprList
_partitionByIuType :: ([Maybe Type])
_orderByIannotatedTree :: ScalarExprDirectionPairList
_orderByIfixedUpIdentifiersTree :: ScalarExprDirectionPairList
_orderByIoriginalTree :: ScalarExprDirectionPairList
_lhsOannotatedTree =
updateAnnotation
(setTypeAddErrorsA _tpe
. \a -> a {fnProt = _prototype
,infType = msum [_lhsIexpectedType
,etmt _tpe
,Nothing]}) _backTree
_prototype =
Nothing
_lhsOuType =
etmt _tpe
_tpe =
lmt _fnIuType
_backTree =
WindowFn ann_
_fnIannotatedTree
_partitionByIannotatedTree
_orderByIannotatedTree
frm_
_partitionByOexpectedTypes =
[]
_annotatedTree =
WindowFn ann_ _fnIannotatedTree _partitionByIannotatedTree _orderByIannotatedTree frm_
_fixedUpIdentifiersTree =
WindowFn ann_ _fnIfixedUpIdentifiersTree _partitionByIfixedUpIdentifiersTree _orderByIfixedUpIdentifiersTree frm_
_originalTree =
WindowFn ann_ _fnIoriginalTree _partitionByIoriginalTree _orderByIoriginalTree frm_
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
_fnOcat =
_lhsIcat
_fnOexpectedType =
_lhsIexpectedType
_fnOidenv =
_lhsIidenv
_fnOlib =
_lhsIlib
_partitionByOcat =
_lhsIcat
_partitionByOidenv =
_lhsIidenv
_partitionByOlib =
_lhsIlib
_orderByOcat =
_lhsIcat
_orderByOidenv =
_lhsIidenv
_orderByOlib =
_lhsIlib
( _fnIannotatedTree,_fnIfixedUpIdentifiersTree,_fnIoriginalTree,_fnIuType) =
fn_ _fnOcat _fnOexpectedType _fnOidenv _fnOlib
( _partitionByIannotatedTree,_partitionByIfixedUpIdentifiersTree,_partitionByIoriginalTree,_partitionByIuType) =
partitionBy_ _partitionByOcat _partitionByOexpectedTypes _partitionByOidenv _partitionByOlib
( _orderByIannotatedTree,_orderByIfixedUpIdentifiersTree,_orderByIoriginalTree) =
orderBy_ _orderByOcat _orderByOidenv _orderByOlib
in ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree,_lhsOuType)))
type ScalarExprDirectionPair = ( ScalarExpr ,(Direction))
sem_ScalarExprDirectionPair :: ScalarExprDirectionPair ->
T_ScalarExprDirectionPair
sem_ScalarExprDirectionPair ( x1,x2) =
(sem_ScalarExprDirectionPair_Tuple (sem_ScalarExpr x1 ) x2 )
type T_ScalarExprDirectionPair = Catalog ->
IDEnv ->
LocalBindings ->
( ScalarExprDirectionPair ,ScalarExprDirectionPair ,ScalarExprDirectionPair )
data Inh_ScalarExprDirectionPair = Inh_ScalarExprDirectionPair {cat_Inh_ScalarExprDirectionPair :: Catalog,idenv_Inh_ScalarExprDirectionPair :: IDEnv,lib_Inh_ScalarExprDirectionPair :: LocalBindings}
data Syn_ScalarExprDirectionPair = Syn_ScalarExprDirectionPair {annotatedTree_Syn_ScalarExprDirectionPair :: ScalarExprDirectionPair ,fixedUpIdentifiersTree_Syn_ScalarExprDirectionPair :: ScalarExprDirectionPair ,originalTree_Syn_ScalarExprDirectionPair :: ScalarExprDirectionPair }
wrap_ScalarExprDirectionPair :: T_ScalarExprDirectionPair ->
Inh_ScalarExprDirectionPair ->
Syn_ScalarExprDirectionPair
wrap_ScalarExprDirectionPair sem (Inh_ScalarExprDirectionPair _lhsIcat _lhsIidenv _lhsIlib ) =
(let ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree) = sem _lhsIcat _lhsIidenv _lhsIlib
in (Syn_ScalarExprDirectionPair _lhsOannotatedTree _lhsOfixedUpIdentifiersTree _lhsOoriginalTree ))
sem_ScalarExprDirectionPair_Tuple :: T_ScalarExpr ->
Direction ->
T_ScalarExprDirectionPair
sem_ScalarExprDirectionPair_Tuple x1_ x2_ =
(\ _lhsIcat
_lhsIidenv
_lhsIlib ->
(let _x1OexpectedType :: (Maybe Type)
_lhsOannotatedTree :: ScalarExprDirectionPair
_lhsOfixedUpIdentifiersTree :: ScalarExprDirectionPair
_lhsOoriginalTree :: ScalarExprDirectionPair
_x1Ocat :: Catalog
_x1Oidenv :: IDEnv
_x1Olib :: LocalBindings
_x1IannotatedTree :: ScalarExpr
_x1IfixedUpIdentifiersTree :: ScalarExpr
_x1IoriginalTree :: ScalarExpr
_x1IuType :: (Maybe Type)
_x1OexpectedType =
Nothing
_annotatedTree =
(_x1IannotatedTree,x2_)
_fixedUpIdentifiersTree =
(_x1IfixedUpIdentifiersTree,x2_)
_originalTree =
(_x1IoriginalTree,x2_)
_lhsOannotatedTree =
_annotatedTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
_x1Ocat =
_lhsIcat
_x1Oidenv =
_lhsIidenv
_x1Olib =
_lhsIlib
( _x1IannotatedTree,_x1IfixedUpIdentifiersTree,_x1IoriginalTree,_x1IuType) =
x1_ _x1Ocat _x1OexpectedType _x1Oidenv _x1Olib
in ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree)))
type ScalarExprDirectionPairList = [ScalarExprDirectionPair ]
sem_ScalarExprDirectionPairList :: ScalarExprDirectionPairList ->
T_ScalarExprDirectionPairList
sem_ScalarExprDirectionPairList list =
(Prelude.foldr sem_ScalarExprDirectionPairList_Cons sem_ScalarExprDirectionPairList_Nil (Prelude.map sem_ScalarExprDirectionPair list) )
type T_ScalarExprDirectionPairList = Catalog ->
IDEnv ->
LocalBindings ->
( ScalarExprDirectionPairList ,ScalarExprDirectionPairList ,ScalarExprDirectionPairList )
data Inh_ScalarExprDirectionPairList = Inh_ScalarExprDirectionPairList {cat_Inh_ScalarExprDirectionPairList :: Catalog,idenv_Inh_ScalarExprDirectionPairList :: IDEnv,lib_Inh_ScalarExprDirectionPairList :: LocalBindings}
data Syn_ScalarExprDirectionPairList = Syn_ScalarExprDirectionPairList {annotatedTree_Syn_ScalarExprDirectionPairList :: ScalarExprDirectionPairList ,fixedUpIdentifiersTree_Syn_ScalarExprDirectionPairList :: ScalarExprDirectionPairList ,originalTree_Syn_ScalarExprDirectionPairList :: ScalarExprDirectionPairList }
wrap_ScalarExprDirectionPairList :: T_ScalarExprDirectionPairList ->
Inh_ScalarExprDirectionPairList ->
Syn_ScalarExprDirectionPairList
wrap_ScalarExprDirectionPairList sem (Inh_ScalarExprDirectionPairList _lhsIcat _lhsIidenv _lhsIlib ) =
(let ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree) = sem _lhsIcat _lhsIidenv _lhsIlib
in (Syn_ScalarExprDirectionPairList _lhsOannotatedTree _lhsOfixedUpIdentifiersTree _lhsOoriginalTree ))
sem_ScalarExprDirectionPairList_Cons :: T_ScalarExprDirectionPair ->
T_ScalarExprDirectionPairList ->
T_ScalarExprDirectionPairList
sem_ScalarExprDirectionPairList_Cons hd_ tl_ =
(\ _lhsIcat
_lhsIidenv
_lhsIlib ->
(let _lhsOannotatedTree :: ScalarExprDirectionPairList
_lhsOfixedUpIdentifiersTree :: ScalarExprDirectionPairList
_lhsOoriginalTree :: ScalarExprDirectionPairList
_hdOcat :: Catalog
_hdOidenv :: IDEnv
_hdOlib :: LocalBindings
_tlOcat :: Catalog
_tlOidenv :: IDEnv
_tlOlib :: LocalBindings
_hdIannotatedTree :: ScalarExprDirectionPair
_hdIfixedUpIdentifiersTree :: ScalarExprDirectionPair
_hdIoriginalTree :: ScalarExprDirectionPair
_tlIannotatedTree :: ScalarExprDirectionPairList
_tlIfixedUpIdentifiersTree :: ScalarExprDirectionPairList
_tlIoriginalTree :: ScalarExprDirectionPairList
_annotatedTree =
(:) _hdIannotatedTree _tlIannotatedTree
_fixedUpIdentifiersTree =
(:) _hdIfixedUpIdentifiersTree _tlIfixedUpIdentifiersTree
_originalTree =
(:) _hdIoriginalTree _tlIoriginalTree
_lhsOannotatedTree =
_annotatedTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
_hdOcat =
_lhsIcat
_hdOidenv =
_lhsIidenv
_hdOlib =
_lhsIlib
_tlOcat =
_lhsIcat
_tlOidenv =
_lhsIidenv
_tlOlib =
_lhsIlib
( _hdIannotatedTree,_hdIfixedUpIdentifiersTree,_hdIoriginalTree) =
hd_ _hdOcat _hdOidenv _hdOlib
( _tlIannotatedTree,_tlIfixedUpIdentifiersTree,_tlIoriginalTree) =
tl_ _tlOcat _tlOidenv _tlOlib
in ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree)))
sem_ScalarExprDirectionPairList_Nil :: T_ScalarExprDirectionPairList
sem_ScalarExprDirectionPairList_Nil =
(\ _lhsIcat
_lhsIidenv
_lhsIlib ->
(let _lhsOannotatedTree :: ScalarExprDirectionPairList
_lhsOfixedUpIdentifiersTree :: ScalarExprDirectionPairList
_lhsOoriginalTree :: ScalarExprDirectionPairList
_annotatedTree =
[]
_fixedUpIdentifiersTree =
[]
_originalTree =
[]
_lhsOannotatedTree =
_annotatedTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
in ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree)))
type ScalarExprList = [ScalarExpr ]
sem_ScalarExprList :: ScalarExprList ->
T_ScalarExprList
sem_ScalarExprList list =
(Prelude.foldr sem_ScalarExprList_Cons sem_ScalarExprList_Nil (Prelude.map sem_ScalarExpr list) )
type T_ScalarExprList = Catalog ->
([Maybe Type]) ->
IDEnv ->
LocalBindings ->
( ScalarExprList ,ScalarExprList ,ScalarExprList ,([Maybe Type]))
data Inh_ScalarExprList = Inh_ScalarExprList {cat_Inh_ScalarExprList :: Catalog,expectedTypes_Inh_ScalarExprList :: ([Maybe Type]),idenv_Inh_ScalarExprList :: IDEnv,lib_Inh_ScalarExprList :: LocalBindings}
data Syn_ScalarExprList = Syn_ScalarExprList {annotatedTree_Syn_ScalarExprList :: ScalarExprList ,fixedUpIdentifiersTree_Syn_ScalarExprList :: ScalarExprList ,originalTree_Syn_ScalarExprList :: ScalarExprList ,uType_Syn_ScalarExprList :: ([Maybe Type])}
wrap_ScalarExprList :: T_ScalarExprList ->
Inh_ScalarExprList ->
Syn_ScalarExprList
wrap_ScalarExprList sem (Inh_ScalarExprList _lhsIcat _lhsIexpectedTypes _lhsIidenv _lhsIlib ) =
(let ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree,_lhsOuType) = sem _lhsIcat _lhsIexpectedTypes _lhsIidenv _lhsIlib
in (Syn_ScalarExprList _lhsOannotatedTree _lhsOfixedUpIdentifiersTree _lhsOoriginalTree _lhsOuType ))
sem_ScalarExprList_Cons :: T_ScalarExpr ->
T_ScalarExprList ->
T_ScalarExprList
sem_ScalarExprList_Cons hd_ tl_ =
(\ _lhsIcat
_lhsIexpectedTypes
_lhsIidenv
_lhsIlib ->
(let _lhsOuType :: ([Maybe Type])
_hdOexpectedType :: (Maybe Type)
_tlOexpectedTypes :: ([Maybe Type])
_lhsOannotatedTree :: ScalarExprList
_lhsOfixedUpIdentifiersTree :: ScalarExprList
_lhsOoriginalTree :: ScalarExprList
_hdOcat :: Catalog
_hdOidenv :: IDEnv
_hdOlib :: LocalBindings
_tlOcat :: Catalog
_tlOidenv :: IDEnv
_tlOlib :: LocalBindings
_hdIannotatedTree :: ScalarExpr
_hdIfixedUpIdentifiersTree :: ScalarExpr
_hdIoriginalTree :: ScalarExpr
_hdIuType :: (Maybe Type)
_tlIannotatedTree :: ScalarExprList
_tlIfixedUpIdentifiersTree :: ScalarExprList
_tlIoriginalTree :: ScalarExprList
_tlIuType :: ([Maybe Type])
_lhsOuType =
_hdIuType : _tlIuType
_hdOexpectedType =
case _lhsIexpectedTypes of
(t:_) -> t
_ -> Nothing
_tlOexpectedTypes =
case _lhsIexpectedTypes of
(_:ts) -> ts
_ -> []
_annotatedTree =
(:) _hdIannotatedTree _tlIannotatedTree
_fixedUpIdentifiersTree =
(:) _hdIfixedUpIdentifiersTree _tlIfixedUpIdentifiersTree
_originalTree =
(:) _hdIoriginalTree _tlIoriginalTree
_lhsOannotatedTree =
_annotatedTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
_hdOcat =
_lhsIcat
_hdOidenv =
_lhsIidenv
_hdOlib =
_lhsIlib
_tlOcat =
_lhsIcat
_tlOidenv =
_lhsIidenv
_tlOlib =
_lhsIlib
( _hdIannotatedTree,_hdIfixedUpIdentifiersTree,_hdIoriginalTree,_hdIuType) =
hd_ _hdOcat _hdOexpectedType _hdOidenv _hdOlib
( _tlIannotatedTree,_tlIfixedUpIdentifiersTree,_tlIoriginalTree,_tlIuType) =
tl_ _tlOcat _tlOexpectedTypes _tlOidenv _tlOlib
in ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree,_lhsOuType)))
sem_ScalarExprList_Nil :: T_ScalarExprList
sem_ScalarExprList_Nil =
(\ _lhsIcat
_lhsIexpectedTypes
_lhsIidenv
_lhsIlib ->
(let _lhsOuType :: ([Maybe Type])
_lhsOannotatedTree :: ScalarExprList
_lhsOfixedUpIdentifiersTree :: ScalarExprList
_lhsOoriginalTree :: ScalarExprList
_lhsOuType =
[]
_annotatedTree =
[]
_fixedUpIdentifiersTree =
[]
_originalTree =
[]
_lhsOannotatedTree =
_annotatedTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
in ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree,_lhsOuType)))
type ScalarExprListList = [ScalarExprList ]
sem_ScalarExprListList :: ScalarExprListList ->
T_ScalarExprListList
sem_ScalarExprListList list =
(Prelude.foldr sem_ScalarExprListList_Cons sem_ScalarExprListList_Nil (Prelude.map sem_ScalarExprList list) )
type T_ScalarExprListList = Catalog ->
([Maybe Type]) ->
IDEnv ->
LocalBindings ->
( ScalarExprListList ,ScalarExprListList ,ScalarExprListList ,([[Maybe Type]]))
data Inh_ScalarExprListList = Inh_ScalarExprListList {cat_Inh_ScalarExprListList :: Catalog,expectedTypes_Inh_ScalarExprListList :: ([Maybe Type]),idenv_Inh_ScalarExprListList :: IDEnv,lib_Inh_ScalarExprListList :: LocalBindings}
data Syn_ScalarExprListList = Syn_ScalarExprListList {annotatedTree_Syn_ScalarExprListList :: ScalarExprListList ,fixedUpIdentifiersTree_Syn_ScalarExprListList :: ScalarExprListList ,originalTree_Syn_ScalarExprListList :: ScalarExprListList ,uType_Syn_ScalarExprListList :: ([[Maybe Type]])}
wrap_ScalarExprListList :: T_ScalarExprListList ->
Inh_ScalarExprListList ->
Syn_ScalarExprListList
wrap_ScalarExprListList sem (Inh_ScalarExprListList _lhsIcat _lhsIexpectedTypes _lhsIidenv _lhsIlib ) =
(let ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree,_lhsOuType) = sem _lhsIcat _lhsIexpectedTypes _lhsIidenv _lhsIlib
in (Syn_ScalarExprListList _lhsOannotatedTree _lhsOfixedUpIdentifiersTree _lhsOoriginalTree _lhsOuType ))
sem_ScalarExprListList_Cons :: T_ScalarExprList ->
T_ScalarExprListList ->
T_ScalarExprListList
sem_ScalarExprListList_Cons hd_ tl_ =
(\ _lhsIcat
_lhsIexpectedTypes
_lhsIidenv
_lhsIlib ->
(let _lhsOuType :: ([[Maybe Type]])
_hdOexpectedTypes :: ([Maybe Type])
_tlOexpectedTypes :: ([Maybe Type])
_lhsOannotatedTree :: ScalarExprListList
_lhsOfixedUpIdentifiersTree :: ScalarExprListList
_lhsOoriginalTree :: ScalarExprListList
_hdOcat :: Catalog
_hdOidenv :: IDEnv
_hdOlib :: LocalBindings
_tlOcat :: Catalog
_tlOidenv :: IDEnv
_tlOlib :: LocalBindings
_hdIannotatedTree :: ScalarExprList
_hdIfixedUpIdentifiersTree :: ScalarExprList
_hdIoriginalTree :: ScalarExprList
_hdIuType :: ([Maybe Type])
_tlIannotatedTree :: ScalarExprListList
_tlIfixedUpIdentifiersTree :: ScalarExprListList
_tlIoriginalTree :: ScalarExprListList
_tlIuType :: ([[Maybe Type]])
_lhsOuType =
_hdIuType : _tlIuType
_hdOexpectedTypes =
_lhsIexpectedTypes
_tlOexpectedTypes =
_lhsIexpectedTypes
_annotatedTree =
(:) _hdIannotatedTree _tlIannotatedTree
_fixedUpIdentifiersTree =
(:) _hdIfixedUpIdentifiersTree _tlIfixedUpIdentifiersTree
_originalTree =
(:) _hdIoriginalTree _tlIoriginalTree
_lhsOannotatedTree =
_annotatedTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
_hdOcat =
_lhsIcat
_hdOidenv =
_lhsIidenv
_hdOlib =
_lhsIlib
_tlOcat =
_lhsIcat
_tlOidenv =
_lhsIidenv
_tlOlib =
_lhsIlib
( _hdIannotatedTree,_hdIfixedUpIdentifiersTree,_hdIoriginalTree,_hdIuType) =
hd_ _hdOcat _hdOexpectedTypes _hdOidenv _hdOlib
( _tlIannotatedTree,_tlIfixedUpIdentifiersTree,_tlIoriginalTree,_tlIuType) =
tl_ _tlOcat _tlOexpectedTypes _tlOidenv _tlOlib
in ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree,_lhsOuType)))
sem_ScalarExprListList_Nil :: T_ScalarExprListList
sem_ScalarExprListList_Nil =
(\ _lhsIcat
_lhsIexpectedTypes
_lhsIidenv
_lhsIlib ->
(let _lhsOuType :: ([[Maybe Type]])
_lhsOannotatedTree :: ScalarExprListList
_lhsOfixedUpIdentifiersTree :: ScalarExprListList
_lhsOoriginalTree :: ScalarExprListList
_lhsOuType =
[]
_annotatedTree =
[]
_fixedUpIdentifiersTree =
[]
_originalTree =
[]
_lhsOannotatedTree =
_annotatedTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
in ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree,_lhsOuType)))
type ScalarExprListStatementListPair = ( ScalarExprList ,StatementList )
sem_ScalarExprListStatementListPair :: ScalarExprListStatementListPair ->
T_ScalarExprListStatementListPair
sem_ScalarExprListStatementListPair ( x1,x2) =
(sem_ScalarExprListStatementListPair_Tuple (sem_ScalarExprList x1 ) (sem_StatementList x2 ) )
type T_ScalarExprListStatementListPair = Catalog ->
IDEnv ->
LocalBindings ->
( ScalarExprListStatementListPair ,ScalarExprListStatementListPair ,ScalarExprListStatementListPair )
data Inh_ScalarExprListStatementListPair = Inh_ScalarExprListStatementListPair {cat_Inh_ScalarExprListStatementListPair :: Catalog,idenv_Inh_ScalarExprListStatementListPair :: IDEnv,lib_Inh_ScalarExprListStatementListPair :: LocalBindings}
data Syn_ScalarExprListStatementListPair = Syn_ScalarExprListStatementListPair {annotatedTree_Syn_ScalarExprListStatementListPair :: ScalarExprListStatementListPair ,fixedUpIdentifiersTree_Syn_ScalarExprListStatementListPair :: ScalarExprListStatementListPair ,originalTree_Syn_ScalarExprListStatementListPair :: ScalarExprListStatementListPair }
wrap_ScalarExprListStatementListPair :: T_ScalarExprListStatementListPair ->
Inh_ScalarExprListStatementListPair ->
Syn_ScalarExprListStatementListPair
wrap_ScalarExprListStatementListPair sem (Inh_ScalarExprListStatementListPair _lhsIcat _lhsIidenv _lhsIlib ) =
(let ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree) = sem _lhsIcat _lhsIidenv _lhsIlib
in (Syn_ScalarExprListStatementListPair _lhsOannotatedTree _lhsOfixedUpIdentifiersTree _lhsOoriginalTree ))
sem_ScalarExprListStatementListPair_Tuple :: T_ScalarExprList ->
T_StatementList ->
T_ScalarExprListStatementListPair
sem_ScalarExprListStatementListPair_Tuple x1_ x2_ =
(\ _lhsIcat
_lhsIidenv
_lhsIlib ->
(let _x2OcatUpdates :: ([CatalogUpdate])
_x2OlibUpdates :: ([LocalBindingsUpdate])
_x1OexpectedTypes :: ([Maybe Type])
_lhsOannotatedTree :: ScalarExprListStatementListPair
_lhsOfixedUpIdentifiersTree :: ScalarExprListStatementListPair
_lhsOoriginalTree :: ScalarExprListStatementListPair
_x1Ocat :: Catalog
_x1Oidenv :: IDEnv
_x1Olib :: LocalBindings
_x2Ocat :: Catalog
_x2Oidenv :: IDEnv
_x2Olib :: LocalBindings
_x1IannotatedTree :: ScalarExprList
_x1IfixedUpIdentifiersTree :: ScalarExprList
_x1IoriginalTree :: ScalarExprList
_x1IuType :: ([Maybe Type])
_x2IannotatedTree :: StatementList
_x2IfixedUpIdentifiersTree :: StatementList
_x2IoriginalTree :: StatementList
_x2IproducedCat :: Catalog
_x2IproducedLib :: LocalBindings
_x2OcatUpdates =
[]
_x2OlibUpdates =
[]
_x1OexpectedTypes =
[]
_annotatedTree =
(_x1IannotatedTree,_x2IannotatedTree)
_fixedUpIdentifiersTree =
(_x1IfixedUpIdentifiersTree,_x2IfixedUpIdentifiersTree)
_originalTree =
(_x1IoriginalTree,_x2IoriginalTree)
_lhsOannotatedTree =
_annotatedTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
_x1Ocat =
_lhsIcat
_x1Oidenv =
_lhsIidenv
_x1Olib =
_lhsIlib
_x2Ocat =
_lhsIcat
_x2Oidenv =
_lhsIidenv
_x2Olib =
_lhsIlib
( _x1IannotatedTree,_x1IfixedUpIdentifiersTree,_x1IoriginalTree,_x1IuType) =
x1_ _x1Ocat _x1OexpectedTypes _x1Oidenv _x1Olib
( _x2IannotatedTree,_x2IfixedUpIdentifiersTree,_x2IoriginalTree,_x2IproducedCat,_x2IproducedLib) =
x2_ _x2Ocat _x2OcatUpdates _x2Oidenv _x2Olib _x2OlibUpdates
in ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree)))
type ScalarExprListStatementListPairList = [ScalarExprListStatementListPair ]
sem_ScalarExprListStatementListPairList :: ScalarExprListStatementListPairList ->
T_ScalarExprListStatementListPairList
sem_ScalarExprListStatementListPairList list =
(Prelude.foldr sem_ScalarExprListStatementListPairList_Cons sem_ScalarExprListStatementListPairList_Nil (Prelude.map sem_ScalarExprListStatementListPair list) )
type T_ScalarExprListStatementListPairList = Catalog ->
IDEnv ->
LocalBindings ->
( ScalarExprListStatementListPairList ,ScalarExprListStatementListPairList ,ScalarExprListStatementListPairList )
data Inh_ScalarExprListStatementListPairList = Inh_ScalarExprListStatementListPairList {cat_Inh_ScalarExprListStatementListPairList :: Catalog,idenv_Inh_ScalarExprListStatementListPairList :: IDEnv,lib_Inh_ScalarExprListStatementListPairList :: LocalBindings}
data Syn_ScalarExprListStatementListPairList = Syn_ScalarExprListStatementListPairList {annotatedTree_Syn_ScalarExprListStatementListPairList :: ScalarExprListStatementListPairList ,fixedUpIdentifiersTree_Syn_ScalarExprListStatementListPairList :: ScalarExprListStatementListPairList ,originalTree_Syn_ScalarExprListStatementListPairList :: ScalarExprListStatementListPairList }
wrap_ScalarExprListStatementListPairList :: T_ScalarExprListStatementListPairList ->
Inh_ScalarExprListStatementListPairList ->
Syn_ScalarExprListStatementListPairList
wrap_ScalarExprListStatementListPairList sem (Inh_ScalarExprListStatementListPairList _lhsIcat _lhsIidenv _lhsIlib ) =
(let ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree) = sem _lhsIcat _lhsIidenv _lhsIlib
in (Syn_ScalarExprListStatementListPairList _lhsOannotatedTree _lhsOfixedUpIdentifiersTree _lhsOoriginalTree ))
sem_ScalarExprListStatementListPairList_Cons :: T_ScalarExprListStatementListPair ->
T_ScalarExprListStatementListPairList ->
T_ScalarExprListStatementListPairList
sem_ScalarExprListStatementListPairList_Cons hd_ tl_ =
(\ _lhsIcat
_lhsIidenv
_lhsIlib ->
(let _lhsOannotatedTree :: ScalarExprListStatementListPairList
_lhsOfixedUpIdentifiersTree :: ScalarExprListStatementListPairList
_lhsOoriginalTree :: ScalarExprListStatementListPairList
_hdOcat :: Catalog
_hdOidenv :: IDEnv
_hdOlib :: LocalBindings
_tlOcat :: Catalog
_tlOidenv :: IDEnv
_tlOlib :: LocalBindings
_hdIannotatedTree :: ScalarExprListStatementListPair
_hdIfixedUpIdentifiersTree :: ScalarExprListStatementListPair
_hdIoriginalTree :: ScalarExprListStatementListPair
_tlIannotatedTree :: ScalarExprListStatementListPairList
_tlIfixedUpIdentifiersTree :: ScalarExprListStatementListPairList
_tlIoriginalTree :: ScalarExprListStatementListPairList
_annotatedTree =
(:) _hdIannotatedTree _tlIannotatedTree
_fixedUpIdentifiersTree =
(:) _hdIfixedUpIdentifiersTree _tlIfixedUpIdentifiersTree
_originalTree =
(:) _hdIoriginalTree _tlIoriginalTree
_lhsOannotatedTree =
_annotatedTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
_hdOcat =
_lhsIcat
_hdOidenv =
_lhsIidenv
_hdOlib =
_lhsIlib
_tlOcat =
_lhsIcat
_tlOidenv =
_lhsIidenv
_tlOlib =
_lhsIlib
( _hdIannotatedTree,_hdIfixedUpIdentifiersTree,_hdIoriginalTree) =
hd_ _hdOcat _hdOidenv _hdOlib
( _tlIannotatedTree,_tlIfixedUpIdentifiersTree,_tlIoriginalTree) =
tl_ _tlOcat _tlOidenv _tlOlib
in ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree)))
sem_ScalarExprListStatementListPairList_Nil :: T_ScalarExprListStatementListPairList
sem_ScalarExprListStatementListPairList_Nil =
(\ _lhsIcat
_lhsIidenv
_lhsIlib ->
(let _lhsOannotatedTree :: ScalarExprListStatementListPairList
_lhsOfixedUpIdentifiersTree :: ScalarExprListStatementListPairList
_lhsOoriginalTree :: ScalarExprListStatementListPairList
_annotatedTree =
[]
_fixedUpIdentifiersTree =
[]
_originalTree =
[]
_lhsOannotatedTree =
_annotatedTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
in ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree)))
data ScalarExprRoot = ScalarExprRoot (ScalarExpr )
deriving ( Show)
sem_ScalarExprRoot :: ScalarExprRoot ->
T_ScalarExprRoot
sem_ScalarExprRoot (ScalarExprRoot _expr ) =
(sem_ScalarExprRoot_ScalarExprRoot (sem_ScalarExpr _expr ) )
type T_ScalarExprRoot = Catalog ->
IDEnv ->
LocalBindings ->
( ScalarExprRoot ,ScalarExprRoot ,ScalarExprRoot )
data Inh_ScalarExprRoot = Inh_ScalarExprRoot {cat_Inh_ScalarExprRoot :: Catalog,idenv_Inh_ScalarExprRoot :: IDEnv,lib_Inh_ScalarExprRoot :: LocalBindings}
data Syn_ScalarExprRoot = Syn_ScalarExprRoot {annotatedTree_Syn_ScalarExprRoot :: ScalarExprRoot ,fixedUpIdentifiersTree_Syn_ScalarExprRoot :: ScalarExprRoot ,originalTree_Syn_ScalarExprRoot :: ScalarExprRoot }
wrap_ScalarExprRoot :: T_ScalarExprRoot ->
Inh_ScalarExprRoot ->
Syn_ScalarExprRoot
wrap_ScalarExprRoot sem (Inh_ScalarExprRoot _lhsIcat _lhsIidenv _lhsIlib ) =
(let ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree) = sem _lhsIcat _lhsIidenv _lhsIlib
in (Syn_ScalarExprRoot _lhsOannotatedTree _lhsOfixedUpIdentifiersTree _lhsOoriginalTree ))
sem_ScalarExprRoot_ScalarExprRoot :: T_ScalarExpr ->
T_ScalarExprRoot
sem_ScalarExprRoot_ScalarExprRoot expr_ =
(\ _lhsIcat
_lhsIidenv
_lhsIlib ->
(let _exprOexpectedType :: (Maybe Type)
_lhsOannotatedTree :: ScalarExprRoot
_lhsOfixedUpIdentifiersTree :: ScalarExprRoot
_lhsOoriginalTree :: ScalarExprRoot
_exprOcat :: Catalog
_exprOidenv :: IDEnv
_exprOlib :: LocalBindings
_exprIannotatedTree :: ScalarExpr
_exprIfixedUpIdentifiersTree :: ScalarExpr
_exprIoriginalTree :: ScalarExpr
_exprIuType :: (Maybe Type)
_exprOexpectedType =
Nothing
_annotatedTree =
ScalarExprRoot _exprIannotatedTree
_fixedUpIdentifiersTree =
ScalarExprRoot _exprIfixedUpIdentifiersTree
_originalTree =
ScalarExprRoot _exprIoriginalTree
_lhsOannotatedTree =
_annotatedTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
_exprOcat =
_lhsIcat
_exprOidenv =
_lhsIidenv
_exprOlib =
_lhsIlib
( _exprIannotatedTree,_exprIfixedUpIdentifiersTree,_exprIoriginalTree,_exprIuType) =
expr_ _exprOcat _exprOexpectedType _exprOidenv _exprOlib
in ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree)))
type ScalarExprStatementListPair = ( ScalarExpr ,StatementList )
sem_ScalarExprStatementListPair :: ScalarExprStatementListPair ->
T_ScalarExprStatementListPair
sem_ScalarExprStatementListPair ( x1,x2) =
(sem_ScalarExprStatementListPair_Tuple (sem_ScalarExpr x1 ) (sem_StatementList x2 ) )
type T_ScalarExprStatementListPair = Catalog ->
IDEnv ->
LocalBindings ->
( ScalarExprStatementListPair ,ScalarExprStatementListPair ,ScalarExprStatementListPair )
data Inh_ScalarExprStatementListPair = Inh_ScalarExprStatementListPair {cat_Inh_ScalarExprStatementListPair :: Catalog,idenv_Inh_ScalarExprStatementListPair :: IDEnv,lib_Inh_ScalarExprStatementListPair :: LocalBindings}
data Syn_ScalarExprStatementListPair = Syn_ScalarExprStatementListPair {annotatedTree_Syn_ScalarExprStatementListPair :: ScalarExprStatementListPair ,fixedUpIdentifiersTree_Syn_ScalarExprStatementListPair :: ScalarExprStatementListPair ,originalTree_Syn_ScalarExprStatementListPair :: ScalarExprStatementListPair }
wrap_ScalarExprStatementListPair :: T_ScalarExprStatementListPair ->
Inh_ScalarExprStatementListPair ->
Syn_ScalarExprStatementListPair
wrap_ScalarExprStatementListPair sem (Inh_ScalarExprStatementListPair _lhsIcat _lhsIidenv _lhsIlib ) =
(let ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree) = sem _lhsIcat _lhsIidenv _lhsIlib
in (Syn_ScalarExprStatementListPair _lhsOannotatedTree _lhsOfixedUpIdentifiersTree _lhsOoriginalTree ))
sem_ScalarExprStatementListPair_Tuple :: T_ScalarExpr ->
T_StatementList ->
T_ScalarExprStatementListPair
sem_ScalarExprStatementListPair_Tuple x1_ x2_ =
(\ _lhsIcat
_lhsIidenv
_lhsIlib ->
(let _x2OcatUpdates :: ([CatalogUpdate])
_x2OlibUpdates :: ([LocalBindingsUpdate])
_x1OexpectedType :: (Maybe Type)
_lhsOannotatedTree :: ScalarExprStatementListPair
_lhsOfixedUpIdentifiersTree :: ScalarExprStatementListPair
_lhsOoriginalTree :: ScalarExprStatementListPair
_x1Ocat :: Catalog
_x1Oidenv :: IDEnv
_x1Olib :: LocalBindings
_x2Ocat :: Catalog
_x2Oidenv :: IDEnv
_x2Olib :: LocalBindings
_x1IannotatedTree :: ScalarExpr
_x1IfixedUpIdentifiersTree :: ScalarExpr
_x1IoriginalTree :: ScalarExpr
_x1IuType :: (Maybe Type)
_x2IannotatedTree :: StatementList
_x2IfixedUpIdentifiersTree :: StatementList
_x2IoriginalTree :: StatementList
_x2IproducedCat :: Catalog
_x2IproducedLib :: LocalBindings
_x2OcatUpdates =
[]
_x2OlibUpdates =
[]
_x1OexpectedType =
Nothing
_annotatedTree =
(_x1IannotatedTree,_x2IannotatedTree)
_fixedUpIdentifiersTree =
(_x1IfixedUpIdentifiersTree,_x2IfixedUpIdentifiersTree)
_originalTree =
(_x1IoriginalTree,_x2IoriginalTree)
_lhsOannotatedTree =
_annotatedTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
_x1Ocat =
_lhsIcat
_x1Oidenv =
_lhsIidenv
_x1Olib =
_lhsIlib
_x2Ocat =
_lhsIcat
_x2Oidenv =
_lhsIidenv
_x2Olib =
_lhsIlib
( _x1IannotatedTree,_x1IfixedUpIdentifiersTree,_x1IoriginalTree,_x1IuType) =
x1_ _x1Ocat _x1OexpectedType _x1Oidenv _x1Olib
( _x2IannotatedTree,_x2IfixedUpIdentifiersTree,_x2IoriginalTree,_x2IproducedCat,_x2IproducedLib) =
x2_ _x2Ocat _x2OcatUpdates _x2Oidenv _x2Olib _x2OlibUpdates
in ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree)))
type ScalarExprStatementListPairList = [ScalarExprStatementListPair ]
sem_ScalarExprStatementListPairList :: ScalarExprStatementListPairList ->
T_ScalarExprStatementListPairList
sem_ScalarExprStatementListPairList list =
(Prelude.foldr sem_ScalarExprStatementListPairList_Cons sem_ScalarExprStatementListPairList_Nil (Prelude.map sem_ScalarExprStatementListPair list) )
type T_ScalarExprStatementListPairList = Catalog ->
IDEnv ->
LocalBindings ->
( ScalarExprStatementListPairList ,ScalarExprStatementListPairList ,ScalarExprStatementListPairList )
data Inh_ScalarExprStatementListPairList = Inh_ScalarExprStatementListPairList {cat_Inh_ScalarExprStatementListPairList :: Catalog,idenv_Inh_ScalarExprStatementListPairList :: IDEnv,lib_Inh_ScalarExprStatementListPairList :: LocalBindings}
data Syn_ScalarExprStatementListPairList = Syn_ScalarExprStatementListPairList {annotatedTree_Syn_ScalarExprStatementListPairList :: ScalarExprStatementListPairList ,fixedUpIdentifiersTree_Syn_ScalarExprStatementListPairList :: ScalarExprStatementListPairList ,originalTree_Syn_ScalarExprStatementListPairList :: ScalarExprStatementListPairList }
wrap_ScalarExprStatementListPairList :: T_ScalarExprStatementListPairList ->
Inh_ScalarExprStatementListPairList ->
Syn_ScalarExprStatementListPairList
wrap_ScalarExprStatementListPairList sem (Inh_ScalarExprStatementListPairList _lhsIcat _lhsIidenv _lhsIlib ) =
(let ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree) = sem _lhsIcat _lhsIidenv _lhsIlib
in (Syn_ScalarExprStatementListPairList _lhsOannotatedTree _lhsOfixedUpIdentifiersTree _lhsOoriginalTree ))
sem_ScalarExprStatementListPairList_Cons :: T_ScalarExprStatementListPair ->
T_ScalarExprStatementListPairList ->
T_ScalarExprStatementListPairList
sem_ScalarExprStatementListPairList_Cons hd_ tl_ =
(\ _lhsIcat
_lhsIidenv
_lhsIlib ->
(let _lhsOannotatedTree :: ScalarExprStatementListPairList
_lhsOfixedUpIdentifiersTree :: ScalarExprStatementListPairList
_lhsOoriginalTree :: ScalarExprStatementListPairList
_hdOcat :: Catalog
_hdOidenv :: IDEnv
_hdOlib :: LocalBindings
_tlOcat :: Catalog
_tlOidenv :: IDEnv
_tlOlib :: LocalBindings
_hdIannotatedTree :: ScalarExprStatementListPair
_hdIfixedUpIdentifiersTree :: ScalarExprStatementListPair
_hdIoriginalTree :: ScalarExprStatementListPair
_tlIannotatedTree :: ScalarExprStatementListPairList
_tlIfixedUpIdentifiersTree :: ScalarExprStatementListPairList
_tlIoriginalTree :: ScalarExprStatementListPairList
_annotatedTree =
(:) _hdIannotatedTree _tlIannotatedTree
_fixedUpIdentifiersTree =
(:) _hdIfixedUpIdentifiersTree _tlIfixedUpIdentifiersTree
_originalTree =
(:) _hdIoriginalTree _tlIoriginalTree
_lhsOannotatedTree =
_annotatedTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
_hdOcat =
_lhsIcat
_hdOidenv =
_lhsIidenv
_hdOlib =
_lhsIlib
_tlOcat =
_lhsIcat
_tlOidenv =
_lhsIidenv
_tlOlib =
_lhsIlib
( _hdIannotatedTree,_hdIfixedUpIdentifiersTree,_hdIoriginalTree) =
hd_ _hdOcat _hdOidenv _hdOlib
( _tlIannotatedTree,_tlIfixedUpIdentifiersTree,_tlIoriginalTree) =
tl_ _tlOcat _tlOidenv _tlOlib
in ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree)))
sem_ScalarExprStatementListPairList_Nil :: T_ScalarExprStatementListPairList
sem_ScalarExprStatementListPairList_Nil =
(\ _lhsIcat
_lhsIidenv
_lhsIlib ->
(let _lhsOannotatedTree :: ScalarExprStatementListPairList
_lhsOfixedUpIdentifiersTree :: ScalarExprStatementListPairList
_lhsOoriginalTree :: ScalarExprStatementListPairList
_annotatedTree =
[]
_fixedUpIdentifiersTree =
[]
_originalTree =
[]
_lhsOannotatedTree =
_annotatedTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
in ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree)))
data SelectItem = SelExp (Annotation) (ScalarExpr )
| SelectItem (Annotation) (ScalarExpr ) (NameComponent)
deriving ( Data,Eq,Show,Typeable)
sem_SelectItem :: SelectItem ->
T_SelectItem
sem_SelectItem (SelExp _ann _ex ) =
(sem_SelectItem_SelExp _ann (sem_ScalarExpr _ex ) )
sem_SelectItem (SelectItem _ann _ex _name ) =
(sem_SelectItem_SelectItem _ann (sem_ScalarExpr _ex ) _name )
type T_SelectItem = Catalog ->
IDEnv ->
LocalBindings ->
( SelectItem ,SelectItem ,((String,Maybe Type)),SelectItem ,([SelectItem]))
data Inh_SelectItem = Inh_SelectItem {cat_Inh_SelectItem :: Catalog,idenv_Inh_SelectItem :: IDEnv,lib_Inh_SelectItem :: LocalBindings}
data Syn_SelectItem = Syn_SelectItem {annotatedTree_Syn_SelectItem :: SelectItem ,fixedUpIdentifiersTree_Syn_SelectItem :: SelectItem ,itemType_Syn_SelectItem :: ((String,Maybe Type)),originalTree_Syn_SelectItem :: SelectItem ,seIdTree_Syn_SelectItem :: ([SelectItem])}
wrap_SelectItem :: T_SelectItem ->
Inh_SelectItem ->
Syn_SelectItem
wrap_SelectItem sem (Inh_SelectItem _lhsIcat _lhsIidenv _lhsIlib ) =
(let ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOitemType,_lhsOoriginalTree,_lhsOseIdTree) = sem _lhsIcat _lhsIidenv _lhsIlib
in (Syn_SelectItem _lhsOannotatedTree _lhsOfixedUpIdentifiersTree _lhsOitemType _lhsOoriginalTree _lhsOseIdTree ))
sem_SelectItem_SelExp :: Annotation ->
T_ScalarExpr ->
T_SelectItem
sem_SelectItem_SelExp ann_ ex_ =
(\ _lhsIcat
_lhsIidenv
_lhsIlib ->
(let _lhsOseIdTree :: ([SelectItem])
_lhsOitemType :: ((String,Maybe Type))
_exOexpectedType :: (Maybe Type)
_lhsOannotatedTree :: SelectItem
_lhsOfixedUpIdentifiersTree :: SelectItem
_lhsOoriginalTree :: SelectItem
_exOcat :: Catalog
_exOidenv :: IDEnv
_exOlib :: LocalBindings
_exIannotatedTree :: ScalarExpr
_exIfixedUpIdentifiersTree :: ScalarExpr
_exIoriginalTree :: ScalarExpr
_exIuType :: (Maybe Type)
_lhsOseIdTree =
case _exIfixedUpIdentifiersTree of
Star a ->
maybe [SelExp ann_ _exIfixedUpIdentifiersTree]
(makeSelExps ann_ a a)
$ expandStar _lhsIidenv Nothing
QStar a0 (Nmc q) ->
maybe [SelExp ann_ _exIfixedUpIdentifiersTree]
(makeSelExps ann_ a0 a0)
$ expandStar _lhsIidenv $ Just q
_ -> [addSIAlias $ SelExp ann_ _exIfixedUpIdentifiersTree]
_annotatedTree =
SelExp ann_ _exIannotatedTree
_lhsOitemType =
("", Nothing)
_exOexpectedType =
Nothing
_fixedUpIdentifiersTree =
SelExp ann_ _exIfixedUpIdentifiersTree
_originalTree =
SelExp ann_ _exIoriginalTree
_lhsOannotatedTree =
_annotatedTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
_exOcat =
_lhsIcat
_exOidenv =
_lhsIidenv
_exOlib =
_lhsIlib
( _exIannotatedTree,_exIfixedUpIdentifiersTree,_exIoriginalTree,_exIuType) =
ex_ _exOcat _exOexpectedType _exOidenv _exOlib
in ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOitemType,_lhsOoriginalTree,_lhsOseIdTree)))
sem_SelectItem_SelectItem :: Annotation ->
T_ScalarExpr ->
NameComponent ->
T_SelectItem
sem_SelectItem_SelectItem ann_ ex_ name_ =
(\ _lhsIcat
_lhsIidenv
_lhsIlib ->
(let _lhsOseIdTree :: ([SelectItem])
_lhsOitemType :: ((String,Maybe Type))
_exOexpectedType :: (Maybe Type)
_lhsOannotatedTree :: SelectItem
_lhsOfixedUpIdentifiersTree :: SelectItem
_lhsOoriginalTree :: SelectItem
_exOcat :: Catalog
_exOidenv :: IDEnv
_exOlib :: LocalBindings
_exIannotatedTree :: ScalarExpr
_exIfixedUpIdentifiersTree :: ScalarExpr
_exIoriginalTree :: ScalarExpr
_exIuType :: (Maybe Type)
_lhsOseIdTree =
[SelectItem ann_ _exIfixedUpIdentifiersTree name_]
_annotatedTree =
SelectItem ann_ _exIannotatedTree name_
_lhsOitemType =
(ncStr name_, unwrapSetof `fmap` _exIuType)
_exOexpectedType =
Nothing
_fixedUpIdentifiersTree =
SelectItem ann_ _exIfixedUpIdentifiersTree name_
_originalTree =
SelectItem ann_ _exIoriginalTree name_
_lhsOannotatedTree =
_annotatedTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
_exOcat =
_lhsIcat
_exOidenv =
_lhsIidenv
_exOlib =
_lhsIlib
( _exIannotatedTree,_exIfixedUpIdentifiersTree,_exIoriginalTree,_exIuType) =
ex_ _exOcat _exOexpectedType _exOidenv _exOlib
in ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOitemType,_lhsOoriginalTree,_lhsOseIdTree)))
type SelectItemList = [SelectItem ]
sem_SelectItemList :: SelectItemList ->
T_SelectItemList
sem_SelectItemList list =
(Prelude.foldr sem_SelectItemList_Cons sem_SelectItemList_Nil (Prelude.map sem_SelectItem list) )
type T_SelectItemList = Catalog ->
IDEnv ->
LocalBindings ->
( SelectItemList ,SelectItemList ,([(String,Maybe Type)]),SelectItemList )
data Inh_SelectItemList = Inh_SelectItemList {cat_Inh_SelectItemList :: Catalog,idenv_Inh_SelectItemList :: IDEnv,lib_Inh_SelectItemList :: LocalBindings}
data Syn_SelectItemList = Syn_SelectItemList {annotatedTree_Syn_SelectItemList :: SelectItemList ,fixedUpIdentifiersTree_Syn_SelectItemList :: SelectItemList ,listType_Syn_SelectItemList :: ([(String,Maybe Type)]),originalTree_Syn_SelectItemList :: SelectItemList }
wrap_SelectItemList :: T_SelectItemList ->
Inh_SelectItemList ->
Syn_SelectItemList
wrap_SelectItemList sem (Inh_SelectItemList _lhsIcat _lhsIidenv _lhsIlib ) =
(let ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOlistType,_lhsOoriginalTree) = sem _lhsIcat _lhsIidenv _lhsIlib
in (Syn_SelectItemList _lhsOannotatedTree _lhsOfixedUpIdentifiersTree _lhsOlistType _lhsOoriginalTree ))
sem_SelectItemList_Cons :: T_SelectItem ->
T_SelectItemList ->
T_SelectItemList
sem_SelectItemList_Cons hd_ tl_ =
(\ _lhsIcat
_lhsIidenv
_lhsIlib ->
(let _lhsOfixedUpIdentifiersTree :: SelectItemList
_lhsOlistType :: ([(String,Maybe Type)])
_lhsOannotatedTree :: SelectItemList
_lhsOoriginalTree :: SelectItemList
_hdOcat :: Catalog
_hdOidenv :: IDEnv
_hdOlib :: LocalBindings
_tlOcat :: Catalog
_tlOidenv :: IDEnv
_tlOlib :: LocalBindings
_hdIannotatedTree :: SelectItem
_hdIfixedUpIdentifiersTree :: SelectItem
_hdIitemType :: ((String,Maybe Type))
_hdIoriginalTree :: SelectItem
_hdIseIdTree :: ([SelectItem])
_tlIannotatedTree :: SelectItemList
_tlIfixedUpIdentifiersTree :: SelectItemList
_tlIlistType :: ([(String,Maybe Type)])
_tlIoriginalTree :: SelectItemList
_lhsOfixedUpIdentifiersTree =
_hdIseIdTree ++ _tlIfixedUpIdentifiersTree
_lhsOlistType =
_hdIitemType : _tlIlistType
_annotatedTree =
(:) _hdIannotatedTree _tlIannotatedTree
_fixedUpIdentifiersTree =
(:) _hdIfixedUpIdentifiersTree _tlIfixedUpIdentifiersTree
_originalTree =
(:) _hdIoriginalTree _tlIoriginalTree
_lhsOannotatedTree =
_annotatedTree
_lhsOoriginalTree =
_originalTree
_hdOcat =
_lhsIcat
_hdOidenv =
_lhsIidenv
_hdOlib =
_lhsIlib
_tlOcat =
_lhsIcat
_tlOidenv =
_lhsIidenv
_tlOlib =
_lhsIlib
( _hdIannotatedTree,_hdIfixedUpIdentifiersTree,_hdIitemType,_hdIoriginalTree,_hdIseIdTree) =
hd_ _hdOcat _hdOidenv _hdOlib
( _tlIannotatedTree,_tlIfixedUpIdentifiersTree,_tlIlistType,_tlIoriginalTree) =
tl_ _tlOcat _tlOidenv _tlOlib
in ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOlistType,_lhsOoriginalTree)))
sem_SelectItemList_Nil :: T_SelectItemList
sem_SelectItemList_Nil =
(\ _lhsIcat
_lhsIidenv
_lhsIlib ->
(let _lhsOfixedUpIdentifiersTree :: SelectItemList
_lhsOlistType :: ([(String,Maybe Type)])
_lhsOannotatedTree :: SelectItemList
_lhsOoriginalTree :: SelectItemList
_lhsOfixedUpIdentifiersTree =
[]
_lhsOlistType =
[]
_annotatedTree =
[]
_fixedUpIdentifiersTree =
[]
_originalTree =
[]
_lhsOannotatedTree =
_annotatedTree
_lhsOoriginalTree =
_originalTree
in ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOlistType,_lhsOoriginalTree)))
data SelectList = SelectList (Annotation) (SelectItemList )
deriving ( Data,Eq,Show,Typeable)
sem_SelectList :: SelectList ->
T_SelectList
sem_SelectList (SelectList _ann _items ) =
(sem_SelectList_SelectList _ann (sem_SelectItemList _items ) )
type T_SelectList = Catalog ->
IDEnv ->
LocalBindings ->
( SelectList ,IDEnv,SelectList ,([LocalBindingsUpdate]),([(String,Maybe Type)]),SelectList )
data Inh_SelectList = Inh_SelectList {cat_Inh_SelectList :: Catalog,idenv_Inh_SelectList :: IDEnv,lib_Inh_SelectList :: LocalBindings}
data Syn_SelectList = Syn_SelectList {annotatedTree_Syn_SelectList :: SelectList ,cidenv_Syn_SelectList :: IDEnv,fixedUpIdentifiersTree_Syn_SelectList :: SelectList ,libUpdates_Syn_SelectList :: ([LocalBindingsUpdate]),listType_Syn_SelectList :: ([(String,Maybe Type)]),originalTree_Syn_SelectList :: SelectList }
wrap_SelectList :: T_SelectList ->
Inh_SelectList ->
Syn_SelectList
wrap_SelectList sem (Inh_SelectList _lhsIcat _lhsIidenv _lhsIlib ) =
(let ( _lhsOannotatedTree,_lhsOcidenv,_lhsOfixedUpIdentifiersTree,_lhsOlibUpdates,_lhsOlistType,_lhsOoriginalTree) = sem _lhsIcat _lhsIidenv _lhsIlib
in (Syn_SelectList _lhsOannotatedTree _lhsOcidenv _lhsOfixedUpIdentifiersTree _lhsOlibUpdates _lhsOlistType _lhsOoriginalTree ))
sem_SelectList_SelectList :: Annotation ->
T_SelectItemList ->
T_SelectList
sem_SelectList_SelectList ann_ items_ =
(\ _lhsIcat
_lhsIidenv
_lhsIlib ->
(let _lhsOcidenv :: IDEnv
_lhsOlistType :: ([(String,Maybe Type)])
_lhsOlibUpdates :: ([LocalBindingsUpdate])
_lhsOannotatedTree :: SelectList
_lhsOfixedUpIdentifiersTree :: SelectList
_lhsOoriginalTree :: SelectList
_itemsOcat :: Catalog
_itemsOidenv :: IDEnv
_itemsOlib :: LocalBindings
_itemsIannotatedTree :: SelectItemList
_itemsIfixedUpIdentifiersTree :: SelectItemList
_itemsIlistType :: ([(String,Maybe Type)])
_itemsIoriginalTree :: SelectItemList
_lhsOcidenv =
TrefIDEnv "" (map (\(SelectItem _ _ n) -> ncStr n)
_itemsIfixedUpIdentifiersTree)
[]
_lhsOlistType =
_itemsIlistType
_lhsOlibUpdates =
[]
_lhsOannotatedTree =
SelectList ann_
_itemsIannotatedTree
_annotatedTree =
SelectList ann_ _itemsIannotatedTree
_fixedUpIdentifiersTree =
SelectList ann_ _itemsIfixedUpIdentifiersTree
_originalTree =
SelectList ann_ _itemsIoriginalTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
_itemsOcat =
_lhsIcat
_itemsOidenv =
_lhsIidenv
_itemsOlib =
_lhsIlib
( _itemsIannotatedTree,_itemsIfixedUpIdentifiersTree,_itemsIlistType,_itemsIoriginalTree) =
items_ _itemsOcat _itemsOidenv _itemsOlib
in ( _lhsOannotatedTree,_lhsOcidenv,_lhsOfixedUpIdentifiersTree,_lhsOlibUpdates,_lhsOlistType,_lhsOoriginalTree)))
data SetClause = MultiSetClause (Annotation) (([NameComponent])) (ScalarExpr )
| SetClause (Annotation) (NameComponent) (ScalarExpr )
deriving ( Data,Eq,Show,Typeable)
sem_SetClause :: SetClause ->
T_SetClause
sem_SetClause (MultiSetClause _ann _setTargets _ex ) =
(sem_SetClause_MultiSetClause _ann _setTargets (sem_ScalarExpr _ex ) )
sem_SetClause (SetClause _ann _setTarget _ex ) =
(sem_SetClause_SetClause _ann _setTarget (sem_ScalarExpr _ex ) )
type T_SetClause = Catalog ->
IDEnv ->
LocalBindings ->
String ->
( SetClause ,SetClause ,SetClause )
data Inh_SetClause = Inh_SetClause {cat_Inh_SetClause :: Catalog,idenv_Inh_SetClause :: IDEnv,lib_Inh_SetClause :: LocalBindings,tbName_Inh_SetClause :: String}
data Syn_SetClause = Syn_SetClause {annotatedTree_Syn_SetClause :: SetClause ,fixedUpIdentifiersTree_Syn_SetClause :: SetClause ,originalTree_Syn_SetClause :: SetClause }
wrap_SetClause :: T_SetClause ->
Inh_SetClause ->
Syn_SetClause
wrap_SetClause sem (Inh_SetClause _lhsIcat _lhsIidenv _lhsIlib _lhsItbName ) =
(let ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree) = sem _lhsIcat _lhsIidenv _lhsIlib _lhsItbName
in (Syn_SetClause _lhsOannotatedTree _lhsOfixedUpIdentifiersTree _lhsOoriginalTree ))
sem_SetClause_MultiSetClause :: Annotation ->
([NameComponent]) ->
T_ScalarExpr ->
T_SetClause
sem_SetClause_MultiSetClause ann_ setTargets_ ex_ =
(\ _lhsIcat
_lhsIidenv
_lhsIlib
_lhsItbName ->
(let _targType :: (E Type)
_exOexpectedType :: (Maybe Type)
_lhsOannotatedTree :: SetClause
_lhsOfixedUpIdentifiersTree :: SetClause
_lhsOoriginalTree :: SetClause
_exOcat :: Catalog
_exOidenv :: IDEnv
_exOlib :: LocalBindings
_exIannotatedTree :: ScalarExpr
_exIfixedUpIdentifiersTree :: ScalarExpr
_exIoriginalTree :: ScalarExpr
_exIuType :: (Maybe Type)
_targType =
do
let etargTypes :: [E (Maybe Type)]
etargTypes = map (lookupLocalBinding _lhsIlib _lhsItbName . ncStr) setTargets_
concatLefts etargTypes
targTypes <- lmt $ sequence $ rights etargTypes
return $ AnonymousRecordType targTypes
_e =
do
tt <- _targType
exType <- lmt _exIuType
checkAssignmentValid _lhsIcat exType tt
_exOexpectedType =
etmt _targType
_backTree =
MultiSetClause ann_ setTargets_ _exIannotatedTree
_lhsOannotatedTree =
updateAnnotation
(\a -> a {errs = errs a ++ tes _e })
_backTree
_annotatedTree =
MultiSetClause ann_ setTargets_ _exIannotatedTree
_fixedUpIdentifiersTree =
MultiSetClause ann_ setTargets_ _exIfixedUpIdentifiersTree
_originalTree =
MultiSetClause ann_ setTargets_ _exIoriginalTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
_exOcat =
_lhsIcat
_exOidenv =
_lhsIidenv
_exOlib =
_lhsIlib
( _exIannotatedTree,_exIfixedUpIdentifiersTree,_exIoriginalTree,_exIuType) =
ex_ _exOcat _exOexpectedType _exOidenv _exOlib
in ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree)))
sem_SetClause_SetClause :: Annotation ->
NameComponent ->
T_ScalarExpr ->
T_SetClause
sem_SetClause_SetClause ann_ setTarget_ ex_ =
(\ _lhsIcat
_lhsIidenv
_lhsIlib
_lhsItbName ->
(let _targType :: (E Type)
_e :: (E ())
_exOexpectedType :: (Maybe Type)
_lhsOannotatedTree :: SetClause
_lhsOfixedUpIdentifiersTree :: SetClause
_lhsOoriginalTree :: SetClause
_exOcat :: Catalog
_exOidenv :: IDEnv
_exOlib :: LocalBindings
_exIannotatedTree :: ScalarExpr
_exIfixedUpIdentifiersTree :: ScalarExpr
_exIoriginalTree :: ScalarExpr
_exIuType :: (Maybe Type)
_targType =
case lookupLocalBinding _lhsIlib _lhsItbName $ ncStr setTarget_ of
Right Nothing -> Left []
Right (Just t) -> Right t
Left e -> Left e
_e =
do
tt <- _targType
exType <- lmt _exIuType
checkAssignmentValid _lhsIcat exType tt
_exOexpectedType =
etmt _targType
_backTree =
SetClause ann_ setTarget_ _exIannotatedTree
_lhsOannotatedTree =
updateAnnotation
(\a -> a {errs = errs a ++ tes _e })
_backTree
_annotatedTree =
SetClause ann_ setTarget_ _exIannotatedTree
_fixedUpIdentifiersTree =
SetClause ann_ setTarget_ _exIfixedUpIdentifiersTree
_originalTree =
SetClause ann_ setTarget_ _exIoriginalTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
_exOcat =
_lhsIcat
_exOidenv =
_lhsIidenv
_exOlib =
_lhsIlib
( _exIannotatedTree,_exIfixedUpIdentifiersTree,_exIoriginalTree,_exIuType) =
ex_ _exOcat _exOexpectedType _exOidenv _exOlib
in ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree)))
type SetClauseList = [SetClause ]
sem_SetClauseList :: SetClauseList ->
T_SetClauseList
sem_SetClauseList list =
(Prelude.foldr sem_SetClauseList_Cons sem_SetClauseList_Nil (Prelude.map sem_SetClause list) )
type T_SetClauseList = Catalog ->
IDEnv ->
LocalBindings ->
String ->
( SetClauseList ,SetClauseList ,SetClauseList )
data Inh_SetClauseList = Inh_SetClauseList {cat_Inh_SetClauseList :: Catalog,idenv_Inh_SetClauseList :: IDEnv,lib_Inh_SetClauseList :: LocalBindings,tbName_Inh_SetClauseList :: String}
data Syn_SetClauseList = Syn_SetClauseList {annotatedTree_Syn_SetClauseList :: SetClauseList ,fixedUpIdentifiersTree_Syn_SetClauseList :: SetClauseList ,originalTree_Syn_SetClauseList :: SetClauseList }
wrap_SetClauseList :: T_SetClauseList ->
Inh_SetClauseList ->
Syn_SetClauseList
wrap_SetClauseList sem (Inh_SetClauseList _lhsIcat _lhsIidenv _lhsIlib _lhsItbName ) =
(let ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree) = sem _lhsIcat _lhsIidenv _lhsIlib _lhsItbName
in (Syn_SetClauseList _lhsOannotatedTree _lhsOfixedUpIdentifiersTree _lhsOoriginalTree ))
sem_SetClauseList_Cons :: T_SetClause ->
T_SetClauseList ->
T_SetClauseList
sem_SetClauseList_Cons hd_ tl_ =
(\ _lhsIcat
_lhsIidenv
_lhsIlib
_lhsItbName ->
(let _lhsOannotatedTree :: SetClauseList
_lhsOfixedUpIdentifiersTree :: SetClauseList
_lhsOoriginalTree :: SetClauseList
_hdOcat :: Catalog
_hdOidenv :: IDEnv
_hdOlib :: LocalBindings
_hdOtbName :: String
_tlOcat :: Catalog
_tlOidenv :: IDEnv
_tlOlib :: LocalBindings
_tlOtbName :: String
_hdIannotatedTree :: SetClause
_hdIfixedUpIdentifiersTree :: SetClause
_hdIoriginalTree :: SetClause
_tlIannotatedTree :: SetClauseList
_tlIfixedUpIdentifiersTree :: SetClauseList
_tlIoriginalTree :: SetClauseList
_annotatedTree =
(:) _hdIannotatedTree _tlIannotatedTree
_fixedUpIdentifiersTree =
(:) _hdIfixedUpIdentifiersTree _tlIfixedUpIdentifiersTree
_originalTree =
(:) _hdIoriginalTree _tlIoriginalTree
_lhsOannotatedTree =
_annotatedTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
_hdOcat =
_lhsIcat
_hdOidenv =
_lhsIidenv
_hdOlib =
_lhsIlib
_hdOtbName =
_lhsItbName
_tlOcat =
_lhsIcat
_tlOidenv =
_lhsIidenv
_tlOlib =
_lhsIlib
_tlOtbName =
_lhsItbName
( _hdIannotatedTree,_hdIfixedUpIdentifiersTree,_hdIoriginalTree) =
hd_ _hdOcat _hdOidenv _hdOlib _hdOtbName
( _tlIannotatedTree,_tlIfixedUpIdentifiersTree,_tlIoriginalTree) =
tl_ _tlOcat _tlOidenv _tlOlib _tlOtbName
in ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree)))
sem_SetClauseList_Nil :: T_SetClauseList
sem_SetClauseList_Nil =
(\ _lhsIcat
_lhsIidenv
_lhsIlib
_lhsItbName ->
(let _lhsOannotatedTree :: SetClauseList
_lhsOfixedUpIdentifiersTree :: SetClauseList
_lhsOoriginalTree :: SetClauseList
_annotatedTree =
[]
_fixedUpIdentifiersTree =
[]
_originalTree =
[]
_lhsOannotatedTree =
_annotatedTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
in ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree)))
data Statement = AlterSequence (Annotation) (Name ) (Name )
| AlterTable (Annotation) (Name ) (AlterTableActionList )
| AntiStatement (String)
| Assignment (Annotation) (Name ) (ScalarExpr )
| Block (Annotation) ((Maybe String)) (VarDefList ) (StatementList )
| CaseStatement (Annotation) (ScalarExprListStatementListPairList ) (StatementList )
| CaseStatementSimple (Annotation) (ScalarExpr ) (ScalarExprListStatementListPairList ) (StatementList )
| ContinueStatement (Annotation) ((Maybe String))
| Copy (Annotation) (Name ) (([NameComponent])) (CopySource)
| CopyData (Annotation) (String)
| CreateDomain (Annotation) (Name ) (TypeName ) (String) (MaybeBoolExpr )
| CreateFunction (Annotation) (Name ) (ParamDefList ) (TypeName ) (Replace) (Language) (FnBody ) (Volatility)
| CreateLanguage (Annotation) (String)
| CreateSequence (Annotation) (Name ) (Integer) (Integer) (Integer) (Integer) (Integer)
| CreateTable (Annotation) (Name ) (AttributeDefList ) (ConstraintList )
| CreateTableAs (Annotation) (Name ) (QueryExpr )
| CreateTrigger (Annotation) (NameComponent) (TriggerWhen) (([TriggerEvent])) (Name ) (TriggerFire) (Name ) (ScalarExprList )
| CreateType (Annotation) (Name ) (TypeAttributeDefList )
| CreateView (Annotation) (Name ) (MaybeNameComponentList) (QueryExpr )
| Delete (Annotation) (Name ) (TableRefList ) (MaybeBoolExpr ) (MaybeSelectList )
| DropFunction (Annotation) (IfExists) (NameTypeNameListPairList ) (Cascade)
| DropSomething (Annotation) (DropType) (IfExists) (([Name])) (Cascade)
| Execute (Annotation) (ScalarExpr )
| ExitStatement (Annotation) ((Maybe String))
| ForIntegerStatement (Annotation) ((Maybe String)) (NameComponent) (ScalarExpr ) (ScalarExpr ) (StatementList )
| ForQueryStatement (Annotation) ((Maybe String)) (NameComponent) (QueryExpr ) (StatementList )
| If (Annotation) (ScalarExprStatementListPairList ) (StatementList )
| Insert (Annotation) (Name ) (([NameComponent])) (QueryExpr ) (MaybeSelectList )
| Into (Annotation) (Bool) (([Name])) (Statement )
| LoopStatement (Annotation) ((Maybe String)) (StatementList )
| Notify (Annotation) (String)
| NullStatement (Annotation)
| Perform (Annotation) (ScalarExpr )
| QueryStatement (Annotation) (QueryExpr )
| Raise (Annotation) (RaiseType) (String) (ScalarExprList )
| Return (Annotation) (MaybeScalarExpr )
| ReturnNext (Annotation) (ScalarExpr )
| ReturnQuery (Annotation) (QueryExpr )
| Set (Annotation) (String) (([SetValue]))
| Truncate (Annotation) (([Name])) (RestartIdentity) (Cascade)
| Update (Annotation) (Name ) (SetClauseList ) (TableRefList ) (MaybeBoolExpr ) (MaybeSelectList )
| WhileStatement (Annotation) ((Maybe String)) (ScalarExpr ) (StatementList )
deriving ( Data,Eq,Show,Typeable)
sem_Statement :: Statement ->
T_Statement
sem_Statement (AlterSequence _ann _name _ownedBy ) =
(sem_Statement_AlterSequence _ann (sem_Name _name ) (sem_Name _ownedBy ) )
sem_Statement (AlterTable _ann _name _actions ) =
(sem_Statement_AlterTable _ann (sem_Name _name ) (sem_AlterTableActionList _actions ) )
sem_Statement (AntiStatement _string ) =
(sem_Statement_AntiStatement _string )
sem_Statement (Assignment _ann _target _value ) =
(sem_Statement_Assignment _ann (sem_Name _target ) (sem_ScalarExpr _value ) )
sem_Statement (Block _ann _lb _vars _sts ) =
(sem_Statement_Block _ann _lb (sem_VarDefList _vars ) (sem_StatementList _sts ) )
sem_Statement (CaseStatement _ann _cases _els ) =
(sem_Statement_CaseStatement _ann (sem_ScalarExprListStatementListPairList _cases ) (sem_StatementList _els ) )
sem_Statement (CaseStatementSimple _ann _val _cases _els ) =
(sem_Statement_CaseStatementSimple _ann (sem_ScalarExpr _val ) (sem_ScalarExprListStatementListPairList _cases ) (sem_StatementList _els ) )
sem_Statement (ContinueStatement _ann _lb ) =
(sem_Statement_ContinueStatement _ann _lb )
sem_Statement (Copy _ann _table _targetCols _source ) =
(sem_Statement_Copy _ann (sem_Name _table ) _targetCols _source )
sem_Statement (CopyData _ann _insData ) =
(sem_Statement_CopyData _ann _insData )
sem_Statement (CreateDomain _ann _name _typ _constraintName _check ) =
(sem_Statement_CreateDomain _ann (sem_Name _name ) (sem_TypeName _typ ) _constraintName (sem_MaybeBoolExpr _check ) )
sem_Statement (CreateFunction _ann _name _params _rettype _rep _lang _body _vol ) =
(sem_Statement_CreateFunction _ann (sem_Name _name ) (sem_ParamDefList _params ) (sem_TypeName _rettype ) _rep _lang (sem_FnBody _body ) _vol )
sem_Statement (CreateLanguage _ann _name ) =
(sem_Statement_CreateLanguage _ann _name )
sem_Statement (CreateSequence _ann _name _incr _min _max _start _cache ) =
(sem_Statement_CreateSequence _ann (sem_Name _name ) _incr _min _max _start _cache )
sem_Statement (CreateTable _ann _name _atts _cons ) =
(sem_Statement_CreateTable _ann (sem_Name _name ) (sem_AttributeDefList _atts ) (sem_ConstraintList _cons ) )
sem_Statement (CreateTableAs _ann _name _expr ) =
(sem_Statement_CreateTableAs _ann (sem_Name _name ) (sem_QueryExpr _expr ) )
sem_Statement (CreateTrigger _ann _name _wh _events _tbl _firing _fnName _fnArgs ) =
(sem_Statement_CreateTrigger _ann _name _wh _events (sem_Name _tbl ) _firing (sem_Name _fnName ) (sem_ScalarExprList _fnArgs ) )
sem_Statement (CreateType _ann _name _atts ) =
(sem_Statement_CreateType _ann (sem_Name _name ) (sem_TypeAttributeDefList _atts ) )
sem_Statement (CreateView _ann _name _colNames _expr ) =
(sem_Statement_CreateView _ann (sem_Name _name ) _colNames (sem_QueryExpr _expr ) )
sem_Statement (Delete _ann _table _using _whr _returning ) =
(sem_Statement_Delete _ann (sem_Name _table ) (sem_TableRefList _using ) (sem_MaybeBoolExpr _whr ) (sem_MaybeSelectList _returning ) )
sem_Statement (DropFunction _ann _ifE _sigs _cascade ) =
(sem_Statement_DropFunction _ann _ifE (sem_NameTypeNameListPairList _sigs ) _cascade )
sem_Statement (DropSomething _ann _dropType _ifE _names _cascade ) =
(sem_Statement_DropSomething _ann _dropType _ifE _names _cascade )
sem_Statement (Execute _ann _expr ) =
(sem_Statement_Execute _ann (sem_ScalarExpr _expr ) )
sem_Statement (ExitStatement _ann _lb ) =
(sem_Statement_ExitStatement _ann _lb )
sem_Statement (ForIntegerStatement _ann _lb _var _from _to _sts ) =
(sem_Statement_ForIntegerStatement _ann _lb _var (sem_ScalarExpr _from ) (sem_ScalarExpr _to ) (sem_StatementList _sts ) )
sem_Statement (ForQueryStatement _ann _lb _var _sel _sts ) =
(sem_Statement_ForQueryStatement _ann _lb _var (sem_QueryExpr _sel ) (sem_StatementList _sts ) )
sem_Statement (If _ann _cases _els ) =
(sem_Statement_If _ann (sem_ScalarExprStatementListPairList _cases ) (sem_StatementList _els ) )
sem_Statement (Insert _ann _table _targetCols _insData _returning ) =
(sem_Statement_Insert _ann (sem_Name _table ) _targetCols (sem_QueryExpr _insData ) (sem_MaybeSelectList _returning ) )
sem_Statement (Into _ann _strict _into _stmt ) =
(sem_Statement_Into _ann _strict _into (sem_Statement _stmt ) )
sem_Statement (LoopStatement _ann _lb _sts ) =
(sem_Statement_LoopStatement _ann _lb (sem_StatementList _sts ) )
sem_Statement (Notify _ann _name ) =
(sem_Statement_Notify _ann _name )
sem_Statement (NullStatement _ann ) =
(sem_Statement_NullStatement _ann )
sem_Statement (Perform _ann _expr ) =
(sem_Statement_Perform _ann (sem_ScalarExpr _expr ) )
sem_Statement (QueryStatement _ann _ex ) =
(sem_Statement_QueryStatement _ann (sem_QueryExpr _ex ) )
sem_Statement (Raise _ann _level _message _args ) =
(sem_Statement_Raise _ann _level _message (sem_ScalarExprList _args ) )
sem_Statement (Return _ann _value ) =
(sem_Statement_Return _ann (sem_MaybeScalarExpr _value ) )
sem_Statement (ReturnNext _ann _expr ) =
(sem_Statement_ReturnNext _ann (sem_ScalarExpr _expr ) )
sem_Statement (ReturnQuery _ann _sel ) =
(sem_Statement_ReturnQuery _ann (sem_QueryExpr _sel ) )
sem_Statement (Set _ann _name _values ) =
(sem_Statement_Set _ann _name _values )
sem_Statement (Truncate _ann _tables _restartIdentity _cascade ) =
(sem_Statement_Truncate _ann _tables _restartIdentity _cascade )
sem_Statement (Update _ann _table _assigns _fromList _whr _returning ) =
(sem_Statement_Update _ann (sem_Name _table ) (sem_SetClauseList _assigns ) (sem_TableRefList _fromList ) (sem_MaybeBoolExpr _whr ) (sem_MaybeSelectList _returning ) )
sem_Statement (WhileStatement _ann _lb _expr _sts ) =
(sem_Statement_WhileStatement _ann _lb (sem_ScalarExpr _expr ) (sem_StatementList _sts ) )
type T_Statement = Catalog ->
IDEnv ->
Catalog ->
LocalBindings ->
( Statement ,([CatalogUpdate]),Statement ,([LocalBindingsUpdate]),Statement )
data Inh_Statement = Inh_Statement {cat_Inh_Statement :: Catalog,idenv_Inh_Statement :: IDEnv,inProducedCat_Inh_Statement :: Catalog,lib_Inh_Statement :: LocalBindings}
data Syn_Statement = Syn_Statement {annotatedTree_Syn_Statement :: Statement ,catUpdates_Syn_Statement :: ([CatalogUpdate]),fixedUpIdentifiersTree_Syn_Statement :: Statement ,libUpdates_Syn_Statement :: ([LocalBindingsUpdate]),originalTree_Syn_Statement :: Statement }
wrap_Statement :: T_Statement ->
Inh_Statement ->
Syn_Statement
wrap_Statement sem (Inh_Statement _lhsIcat _lhsIidenv _lhsIinProducedCat _lhsIlib ) =
(let ( _lhsOannotatedTree,_lhsOcatUpdates,_lhsOfixedUpIdentifiersTree,_lhsOlibUpdates,_lhsOoriginalTree) = sem _lhsIcat _lhsIidenv _lhsIinProducedCat _lhsIlib
in (Syn_Statement _lhsOannotatedTree _lhsOcatUpdates _lhsOfixedUpIdentifiersTree _lhsOlibUpdates _lhsOoriginalTree ))
sem_Statement_AlterSequence :: Annotation ->
T_Name ->
T_Name ->
T_Statement
sem_Statement_AlterSequence ann_ name_ ownedBy_ =
(\ _lhsIcat
_lhsIidenv
_lhsIinProducedCat
_lhsIlib ->
(let _lhsOcatUpdates :: ([CatalogUpdate])
_lhsOlibUpdates :: ([LocalBindingsUpdate])
_lhsOannotatedTree :: Statement
_lhsOfixedUpIdentifiersTree :: Statement
_lhsOoriginalTree :: Statement
_nameOcat :: Catalog
_nameOidenv :: IDEnv
_nameOlib :: LocalBindings
_ownedByOcat :: Catalog
_ownedByOidenv :: IDEnv
_ownedByOlib :: LocalBindings
_nameIannotatedTree :: Name
_nameIfixedUpIdentifiersTree :: Name
_nameIoriginalTree :: Name
_nameItbAnnotatedTree :: Name
_nameItbUType :: (Maybe ([(String,Type)],[(String,Type)]))
_ownedByIannotatedTree :: Name
_ownedByIfixedUpIdentifiersTree :: Name
_ownedByIoriginalTree :: Name
_ownedByItbAnnotatedTree :: Name
_ownedByItbUType :: (Maybe ([(String,Type)],[(String,Type)]))
_libUpdates =
[]
_lhsOcatUpdates =
[]
_lhsOlibUpdates =
[]
_annotatedTree =
AlterSequence ann_ _nameIannotatedTree _ownedByIannotatedTree
_fixedUpIdentifiersTree =
AlterSequence ann_ _nameIfixedUpIdentifiersTree _ownedByIfixedUpIdentifiersTree
_originalTree =
AlterSequence ann_ _nameIoriginalTree _ownedByIoriginalTree
_lhsOannotatedTree =
_annotatedTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
_nameOcat =
_lhsIcat
_nameOidenv =
_lhsIidenv
_nameOlib =
_lhsIlib
_ownedByOcat =
_lhsIcat
_ownedByOidenv =
_lhsIidenv
_ownedByOlib =
_lhsIlib
( _nameIannotatedTree,_nameIfixedUpIdentifiersTree,_nameIoriginalTree,_nameItbAnnotatedTree,_nameItbUType) =
name_ _nameOcat _nameOidenv _nameOlib
( _ownedByIannotatedTree,_ownedByIfixedUpIdentifiersTree,_ownedByIoriginalTree,_ownedByItbAnnotatedTree,_ownedByItbUType) =
ownedBy_ _ownedByOcat _ownedByOidenv _ownedByOlib
in ( _lhsOannotatedTree,_lhsOcatUpdates,_lhsOfixedUpIdentifiersTree,_lhsOlibUpdates,_lhsOoriginalTree)))
sem_Statement_AlterTable :: Annotation ->
T_Name ->
T_AlterTableActionList ->
T_Statement
sem_Statement_AlterTable ann_ name_ actions_ =
(\ _lhsIcat
_lhsIidenv
_lhsIinProducedCat
_lhsIlib ->
(let _lhsOcatUpdates :: ([CatalogUpdate])
_lhsOlibUpdates :: ([LocalBindingsUpdate])
_lhsOannotatedTree :: Statement
_lhsOfixedUpIdentifiersTree :: Statement
_lhsOoriginalTree :: Statement
_nameOcat :: Catalog
_nameOidenv :: IDEnv
_nameOlib :: LocalBindings
_actionsOcat :: Catalog
_actionsOidenv :: IDEnv
_actionsOlib :: LocalBindings
_nameIannotatedTree :: Name
_nameIfixedUpIdentifiersTree :: Name
_nameIoriginalTree :: Name
_nameItbAnnotatedTree :: Name
_nameItbUType :: (Maybe ([(String,Type)],[(String,Type)]))
_actionsIannotatedTree :: AlterTableActionList
_actionsIfixedUpIdentifiersTree :: AlterTableActionList
_actionsIoriginalTree :: AlterTableActionList
_lhsOcatUpdates =
[]
_lhsOlibUpdates =
[]
_annotatedTree =
AlterTable ann_ _nameIannotatedTree _actionsIannotatedTree
_fixedUpIdentifiersTree =
AlterTable ann_ _nameIfixedUpIdentifiersTree _actionsIfixedUpIdentifiersTree
_originalTree =
AlterTable ann_ _nameIoriginalTree _actionsIoriginalTree
_lhsOannotatedTree =
_annotatedTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
_nameOcat =
_lhsIcat
_nameOidenv =
_lhsIidenv
_nameOlib =
_lhsIlib
_actionsOcat =
_lhsIcat
_actionsOidenv =
_lhsIidenv
_actionsOlib =
_lhsIlib
( _nameIannotatedTree,_nameIfixedUpIdentifiersTree,_nameIoriginalTree,_nameItbAnnotatedTree,_nameItbUType) =
name_ _nameOcat _nameOidenv _nameOlib
( _actionsIannotatedTree,_actionsIfixedUpIdentifiersTree,_actionsIoriginalTree) =
actions_ _actionsOcat _actionsOidenv _actionsOlib
in ( _lhsOannotatedTree,_lhsOcatUpdates,_lhsOfixedUpIdentifiersTree,_lhsOlibUpdates,_lhsOoriginalTree)))
sem_Statement_AntiStatement :: String ->
T_Statement
sem_Statement_AntiStatement string_ =
(\ _lhsIcat
_lhsIidenv
_lhsIinProducedCat
_lhsIlib ->
(let _lhsOcatUpdates :: ([CatalogUpdate])
_lhsOlibUpdates :: ([LocalBindingsUpdate])
_lhsOannotatedTree :: Statement
_lhsOfixedUpIdentifiersTree :: Statement
_lhsOoriginalTree :: Statement
_libUpdates =
[]
_lhsOcatUpdates =
[]
_lhsOlibUpdates =
[]
_annotatedTree =
AntiStatement string_
_fixedUpIdentifiersTree =
AntiStatement string_
_originalTree =
AntiStatement string_
_lhsOannotatedTree =
_annotatedTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
in ( _lhsOannotatedTree,_lhsOcatUpdates,_lhsOfixedUpIdentifiersTree,_lhsOlibUpdates,_lhsOoriginalTree)))
sem_Statement_Assignment :: Annotation ->
T_Name ->
T_ScalarExpr ->
T_Statement
sem_Statement_Assignment ann_ target_ value_ =
(\ _lhsIcat
_lhsIidenv
_lhsIinProducedCat
_lhsIlib ->
(let _lhsOannotatedTree :: Statement
_lhsOcatUpdates :: ([CatalogUpdate])
_lhsOlibUpdates :: ([LocalBindingsUpdate])
_tpe :: (Either [TypeError] Type)
_catUpdates :: ([CatalogUpdate])
_statementType :: (Maybe ParameterizedStatementType)
_valueOexpectedType :: (Maybe Type)
_lhsOfixedUpIdentifiersTree :: Statement
_lhsOoriginalTree :: Statement
_targetOcat :: Catalog
_targetOidenv :: IDEnv
_targetOlib :: LocalBindings
_valueOcat :: Catalog
_valueOidenv :: IDEnv
_valueOlib :: LocalBindings
_targetIannotatedTree :: Name
_targetIfixedUpIdentifiersTree :: Name
_targetIoriginalTree :: Name
_targetItbAnnotatedTree :: Name
_targetItbUType :: (Maybe ([(String,Type)],[(String,Type)]))
_valueIannotatedTree :: ScalarExpr
_valueIfixedUpIdentifiersTree :: ScalarExpr
_valueIoriginalTree :: ScalarExpr
_valueIuType :: (Maybe Type)
_lhsOannotatedTree =
updateAnnotation
(\a -> a {stType = _statementType
,catUpd = _catUpdates }) $
setTypeAddErrors _tpe _backTree
_lhsOcatUpdates =
_catUpdates
_lhsOlibUpdates =
_libUpdates
_libUpdates =
[]
_tpe =
Left []
_backTree =
Assignment ann_ _targetIannotatedTree _valueIannotatedTree
_catUpdates =
[]
_statementType =
Nothing
_valueOexpectedType =
Nothing
_annotatedTree =
Assignment ann_ _targetIannotatedTree _valueIannotatedTree
_fixedUpIdentifiersTree =
Assignment ann_ _targetIfixedUpIdentifiersTree _valueIfixedUpIdentifiersTree
_originalTree =
Assignment ann_ _targetIoriginalTree _valueIoriginalTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
_targetOcat =
_lhsIcat
_targetOidenv =
_lhsIidenv
_targetOlib =
_lhsIlib
_valueOcat =
_lhsIcat
_valueOidenv =
_lhsIidenv
_valueOlib =
_lhsIlib
( _targetIannotatedTree,_targetIfixedUpIdentifiersTree,_targetIoriginalTree,_targetItbAnnotatedTree,_targetItbUType) =
target_ _targetOcat _targetOidenv _targetOlib
( _valueIannotatedTree,_valueIfixedUpIdentifiersTree,_valueIoriginalTree,_valueIuType) =
value_ _valueOcat _valueOexpectedType _valueOidenv _valueOlib
in ( _lhsOannotatedTree,_lhsOcatUpdates,_lhsOfixedUpIdentifiersTree,_lhsOlibUpdates,_lhsOoriginalTree)))
sem_Statement_Block :: Annotation ->
(Maybe String) ->
T_VarDefList ->
T_StatementList ->
T_Statement
sem_Statement_Block ann_ lb_ vars_ sts_ =
(\ _lhsIcat
_lhsIidenv
_lhsIinProducedCat
_lhsIlib ->
(let _lhsOcatUpdates :: ([CatalogUpdate])
_stsOcatUpdates :: ([CatalogUpdate])
_stsOlib :: LocalBindings
_lhsOannotatedTree :: Statement
_lhsOfixedUpIdentifiersTree :: Statement
_lhsOoriginalTree :: Statement
_lhsOlibUpdates :: ([LocalBindingsUpdate])
_varsOcat :: Catalog
_varsOidenv :: IDEnv
_varsOlib :: LocalBindings
_stsOcat :: Catalog
_stsOidenv :: IDEnv
_stsOlibUpdates :: ([LocalBindingsUpdate])
_varsIannotatedTree :: VarDefList
_varsIdefs :: ([(String,Maybe Type)])
_varsIfixedUpIdentifiersTree :: VarDefList
_varsIoriginalTree :: VarDefList
_stsIannotatedTree :: StatementList
_stsIfixedUpIdentifiersTree :: StatementList
_stsIoriginalTree :: StatementList
_stsIproducedCat :: Catalog
_stsIproducedLib :: LocalBindings
_libUpdates =
[]
_lhsOcatUpdates =
[]
_stsOcatUpdates =
[]
_stsOlib =
fromRight _lhsIlib $
lbUpdate _lhsIcat
(LBIds "declarations" lb_ $ mapMaybe lv _varsIdefs)
_lhsIlib
where
lv (_,Nothing) = Nothing
lv (s,Just t) = Just (s,t)
_annotatedTree =
Block ann_ lb_ _varsIannotatedTree _stsIannotatedTree
_fixedUpIdentifiersTree =
Block ann_ lb_ _varsIfixedUpIdentifiersTree _stsIfixedUpIdentifiersTree
_originalTree =
Block ann_ lb_ _varsIoriginalTree _stsIoriginalTree
_lhsOannotatedTree =
_annotatedTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
_lhsOlibUpdates =
_libUpdates
_varsOcat =
_lhsIcat
_varsOidenv =
_lhsIidenv
_varsOlib =
_lhsIlib
_stsOcat =
_lhsIcat
_stsOidenv =
_lhsIidenv
_stsOlibUpdates =
_libUpdates
( _varsIannotatedTree,_varsIdefs,_varsIfixedUpIdentifiersTree,_varsIoriginalTree) =
vars_ _varsOcat _varsOidenv _varsOlib
( _stsIannotatedTree,_stsIfixedUpIdentifiersTree,_stsIoriginalTree,_stsIproducedCat,_stsIproducedLib) =
sts_ _stsOcat _stsOcatUpdates _stsOidenv _stsOlib _stsOlibUpdates
in ( _lhsOannotatedTree,_lhsOcatUpdates,_lhsOfixedUpIdentifiersTree,_lhsOlibUpdates,_lhsOoriginalTree)))
sem_Statement_CaseStatement :: Annotation ->
T_ScalarExprListStatementListPairList ->
T_StatementList ->
T_Statement
sem_Statement_CaseStatement ann_ cases_ els_ =
(\ _lhsIcat
_lhsIidenv
_lhsIinProducedCat
_lhsIlib ->
(let _lhsOcatUpdates :: ([CatalogUpdate])
_lhsOlibUpdates :: ([LocalBindingsUpdate])
_elsOcatUpdates :: ([CatalogUpdate])
_elsOlibUpdates :: ([LocalBindingsUpdate])
_lhsOannotatedTree :: Statement
_lhsOfixedUpIdentifiersTree :: Statement
_lhsOoriginalTree :: Statement
_casesOcat :: Catalog
_casesOidenv :: IDEnv
_casesOlib :: LocalBindings
_elsOcat :: Catalog
_elsOidenv :: IDEnv
_elsOlib :: LocalBindings
_casesIannotatedTree :: ScalarExprListStatementListPairList
_casesIfixedUpIdentifiersTree :: ScalarExprListStatementListPairList
_casesIoriginalTree :: ScalarExprListStatementListPairList
_elsIannotatedTree :: StatementList
_elsIfixedUpIdentifiersTree :: StatementList
_elsIoriginalTree :: StatementList
_elsIproducedCat :: Catalog
_elsIproducedLib :: LocalBindings
_lhsOcatUpdates =
[]
_lhsOlibUpdates =
[]
_elsOcatUpdates =
[]
_elsOlibUpdates =
[]
_annotatedTree =
CaseStatement ann_ _casesIannotatedTree _elsIannotatedTree
_fixedUpIdentifiersTree =
CaseStatement ann_ _casesIfixedUpIdentifiersTree _elsIfixedUpIdentifiersTree
_originalTree =
CaseStatement ann_ _casesIoriginalTree _elsIoriginalTree
_lhsOannotatedTree =
_annotatedTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
_casesOcat =
_lhsIcat
_casesOidenv =
_lhsIidenv
_casesOlib =
_lhsIlib
_elsOcat =
_lhsIcat
_elsOidenv =
_lhsIidenv
_elsOlib =
_lhsIlib
( _casesIannotatedTree,_casesIfixedUpIdentifiersTree,_casesIoriginalTree) =
cases_ _casesOcat _casesOidenv _casesOlib
( _elsIannotatedTree,_elsIfixedUpIdentifiersTree,_elsIoriginalTree,_elsIproducedCat,_elsIproducedLib) =
els_ _elsOcat _elsOcatUpdates _elsOidenv _elsOlib _elsOlibUpdates
in ( _lhsOannotatedTree,_lhsOcatUpdates,_lhsOfixedUpIdentifiersTree,_lhsOlibUpdates,_lhsOoriginalTree)))
sem_Statement_CaseStatementSimple :: Annotation ->
T_ScalarExpr ->
T_ScalarExprListStatementListPairList ->
T_StatementList ->
T_Statement
sem_Statement_CaseStatementSimple ann_ val_ cases_ els_ =
(\ _lhsIcat
_lhsIidenv
_lhsIinProducedCat
_lhsIlib ->
(let _lhsOcatUpdates :: ([CatalogUpdate])
_lhsOlibUpdates :: ([LocalBindingsUpdate])
_elsOcatUpdates :: ([CatalogUpdate])
_elsOlibUpdates :: ([LocalBindingsUpdate])
_valOexpectedType :: (Maybe Type)
_lhsOannotatedTree :: Statement
_lhsOfixedUpIdentifiersTree :: Statement
_lhsOoriginalTree :: Statement
_valOcat :: Catalog
_valOidenv :: IDEnv
_valOlib :: LocalBindings
_casesOcat :: Catalog
_casesOidenv :: IDEnv
_casesOlib :: LocalBindings
_elsOcat :: Catalog
_elsOidenv :: IDEnv
_elsOlib :: LocalBindings
_valIannotatedTree :: ScalarExpr
_valIfixedUpIdentifiersTree :: ScalarExpr
_valIoriginalTree :: ScalarExpr
_valIuType :: (Maybe Type)
_casesIannotatedTree :: ScalarExprListStatementListPairList
_casesIfixedUpIdentifiersTree :: ScalarExprListStatementListPairList
_casesIoriginalTree :: ScalarExprListStatementListPairList
_elsIannotatedTree :: StatementList
_elsIfixedUpIdentifiersTree :: StatementList
_elsIoriginalTree :: StatementList
_elsIproducedCat :: Catalog
_elsIproducedLib :: LocalBindings
_lhsOcatUpdates =
[]
_lhsOlibUpdates =
[]
_elsOcatUpdates =
[]
_elsOlibUpdates =
[]
_valOexpectedType =
Nothing
_annotatedTree =
CaseStatementSimple ann_ _valIannotatedTree _casesIannotatedTree _elsIannotatedTree
_fixedUpIdentifiersTree =
CaseStatementSimple ann_ _valIfixedUpIdentifiersTree _casesIfixedUpIdentifiersTree _elsIfixedUpIdentifiersTree
_originalTree =
CaseStatementSimple ann_ _valIoriginalTree _casesIoriginalTree _elsIoriginalTree
_lhsOannotatedTree =
_annotatedTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
_valOcat =
_lhsIcat
_valOidenv =
_lhsIidenv
_valOlib =
_lhsIlib
_casesOcat =
_lhsIcat
_casesOidenv =
_lhsIidenv
_casesOlib =
_lhsIlib
_elsOcat =
_lhsIcat
_elsOidenv =
_lhsIidenv
_elsOlib =
_lhsIlib
( _valIannotatedTree,_valIfixedUpIdentifiersTree,_valIoriginalTree,_valIuType) =
val_ _valOcat _valOexpectedType _valOidenv _valOlib
( _casesIannotatedTree,_casesIfixedUpIdentifiersTree,_casesIoriginalTree) =
cases_ _casesOcat _casesOidenv _casesOlib
( _elsIannotatedTree,_elsIfixedUpIdentifiersTree,_elsIoriginalTree,_elsIproducedCat,_elsIproducedLib) =
els_ _elsOcat _elsOcatUpdates _elsOidenv _elsOlib _elsOlibUpdates
in ( _lhsOannotatedTree,_lhsOcatUpdates,_lhsOfixedUpIdentifiersTree,_lhsOlibUpdates,_lhsOoriginalTree)))
sem_Statement_ContinueStatement :: Annotation ->
(Maybe String) ->
T_Statement
sem_Statement_ContinueStatement ann_ lb_ =
(\ _lhsIcat
_lhsIidenv
_lhsIinProducedCat
_lhsIlib ->
(let _lhsOcatUpdates :: ([CatalogUpdate])
_lhsOlibUpdates :: ([LocalBindingsUpdate])
_lhsOannotatedTree :: Statement
_lhsOfixedUpIdentifiersTree :: Statement
_lhsOoriginalTree :: Statement
_lhsOcatUpdates =
[]
_lhsOlibUpdates =
[]
_annotatedTree =
ContinueStatement ann_ lb_
_fixedUpIdentifiersTree =
ContinueStatement ann_ lb_
_originalTree =
ContinueStatement ann_ lb_
_lhsOannotatedTree =
_annotatedTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
in ( _lhsOannotatedTree,_lhsOcatUpdates,_lhsOfixedUpIdentifiersTree,_lhsOlibUpdates,_lhsOoriginalTree)))
sem_Statement_Copy :: Annotation ->
T_Name ->
([NameComponent]) ->
CopySource ->
T_Statement
sem_Statement_Copy ann_ table_ targetCols_ source_ =
(\ _lhsIcat
_lhsIidenv
_lhsIinProducedCat
_lhsIlib ->
(let _lhsOcatUpdates :: ([CatalogUpdate])
_lhsOlibUpdates :: ([LocalBindingsUpdate])
_lhsOannotatedTree :: Statement
_lhsOfixedUpIdentifiersTree :: Statement
_lhsOoriginalTree :: Statement
_tableOcat :: Catalog
_tableOidenv :: IDEnv
_tableOlib :: LocalBindings
_tableIannotatedTree :: Name
_tableIfixedUpIdentifiersTree :: Name
_tableIoriginalTree :: Name
_tableItbAnnotatedTree :: Name
_tableItbUType :: (Maybe ([(String,Type)],[(String,Type)]))
_lhsOcatUpdates =
[]
_lhsOlibUpdates =
[]
_annotatedTree =
Copy ann_ _tableIannotatedTree targetCols_ source_
_fixedUpIdentifiersTree =
Copy ann_ _tableIfixedUpIdentifiersTree targetCols_ source_
_originalTree =
Copy ann_ _tableIoriginalTree targetCols_ source_
_lhsOannotatedTree =
_annotatedTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
_tableOcat =
_lhsIcat
_tableOidenv =
_lhsIidenv
_tableOlib =
_lhsIlib
( _tableIannotatedTree,_tableIfixedUpIdentifiersTree,_tableIoriginalTree,_tableItbAnnotatedTree,_tableItbUType) =
table_ _tableOcat _tableOidenv _tableOlib
in ( _lhsOannotatedTree,_lhsOcatUpdates,_lhsOfixedUpIdentifiersTree,_lhsOlibUpdates,_lhsOoriginalTree)))
sem_Statement_CopyData :: Annotation ->
String ->
T_Statement
sem_Statement_CopyData ann_ insData_ =
(\ _lhsIcat
_lhsIidenv
_lhsIinProducedCat
_lhsIlib ->
(let _lhsOcatUpdates :: ([CatalogUpdate])
_lhsOlibUpdates :: ([LocalBindingsUpdate])
_lhsOannotatedTree :: Statement
_lhsOfixedUpIdentifiersTree :: Statement
_lhsOoriginalTree :: Statement
_lhsOcatUpdates =
[]
_lhsOlibUpdates =
[]
_annotatedTree =
CopyData ann_ insData_
_fixedUpIdentifiersTree =
CopyData ann_ insData_
_originalTree =
CopyData ann_ insData_
_lhsOannotatedTree =
_annotatedTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
in ( _lhsOannotatedTree,_lhsOcatUpdates,_lhsOfixedUpIdentifiersTree,_lhsOlibUpdates,_lhsOoriginalTree)))
sem_Statement_CreateDomain :: Annotation ->
T_Name ->
T_TypeName ->
String ->
T_MaybeBoolExpr ->
T_Statement
sem_Statement_CreateDomain ann_ name_ typ_ constraintName_ check_ =
(\ _lhsIcat
_lhsIidenv
_lhsIinProducedCat
_lhsIlib ->
(let _lhsOannotatedTree :: Statement
_lhsOcatUpdates :: ([CatalogUpdate])
_lhsOlibUpdates :: ([LocalBindingsUpdate])
_tpe :: (Either [TypeError] Type)
_statementType :: (Maybe ParameterizedStatementType)
_catUpdates :: ([CatalogUpdate])
_checkOlib :: LocalBindings
_lhsOfixedUpIdentifiersTree :: Statement
_lhsOoriginalTree :: Statement
_nameOcat :: Catalog
_nameOidenv :: IDEnv
_nameOlib :: LocalBindings
_typOcat :: Catalog
_typOidenv :: IDEnv
_typOlib :: LocalBindings
_checkOcat :: Catalog
_checkOidenv :: IDEnv
_nameIannotatedTree :: Name
_nameIfixedUpIdentifiersTree :: Name
_nameIoriginalTree :: Name
_nameItbAnnotatedTree :: Name
_nameItbUType :: (Maybe ([(String,Type)],[(String,Type)]))
_typIannotatedTree :: TypeName
_typIfixedUpIdentifiersTree :: TypeName
_typInamedType :: (Maybe Type)
_typIoriginalTree :: TypeName
_checkIannotatedTree :: MaybeBoolExpr
_checkIfixedUpIdentifiersTree :: MaybeBoolExpr
_checkIoriginalTree :: MaybeBoolExpr
_lhsOannotatedTree =
updateAnnotation
(\a -> a {stType = _statementType
,catUpd = _catUpdates }) $
setTypeAddErrors _tpe _backTree
_lhsOcatUpdates =
_catUpdates
_lhsOlibUpdates =
_libUpdates
_libUpdates =
[]
_tpe =
Right $ Pseudo Void
_backTree =
CreateDomain ann_ _nameIoriginalTree _typIannotatedTree constraintName_ _checkIannotatedTree
_statementType =
Nothing
_catUpdates =
maybe [] (\t -> [CatCreateDomain (DomainType (getTName _nameIoriginalTree)) t]) _typInamedType
_checkOlib =
either (const _lhsIlib) id $ do
nt <- lmt _typInamedType
lbUpdate _lhsIcat
(LBIds "domain check value" Nothing [("value", nt)])
_lhsIlib
_annotatedTree =
CreateDomain ann_ _nameIannotatedTree _typIannotatedTree constraintName_ _checkIannotatedTree
_fixedUpIdentifiersTree =
CreateDomain ann_ _nameIfixedUpIdentifiersTree _typIfixedUpIdentifiersTree constraintName_ _checkIfixedUpIdentifiersTree
_originalTree =
CreateDomain ann_ _nameIoriginalTree _typIoriginalTree constraintName_ _checkIoriginalTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
_nameOcat =
_lhsIcat
_nameOidenv =
_lhsIidenv
_nameOlib =
_lhsIlib
_typOcat =
_lhsIcat
_typOidenv =
_lhsIidenv
_typOlib =
_lhsIlib
_checkOcat =
_lhsIcat
_checkOidenv =
_lhsIidenv
( _nameIannotatedTree,_nameIfixedUpIdentifiersTree,_nameIoriginalTree,_nameItbAnnotatedTree,_nameItbUType) =
name_ _nameOcat _nameOidenv _nameOlib
( _typIannotatedTree,_typIfixedUpIdentifiersTree,_typInamedType,_typIoriginalTree) =
typ_ _typOcat _typOidenv _typOlib
( _checkIannotatedTree,_checkIfixedUpIdentifiersTree,_checkIoriginalTree) =
check_ _checkOcat _checkOidenv _checkOlib
in ( _lhsOannotatedTree,_lhsOcatUpdates,_lhsOfixedUpIdentifiersTree,_lhsOlibUpdates,_lhsOoriginalTree)))
sem_Statement_CreateFunction :: Annotation ->
T_Name ->
T_ParamDefList ->
T_TypeName ->
Replace ->
Language ->
T_FnBody ->
Volatility ->
T_Statement
sem_Statement_CreateFunction ann_ name_ params_ rettype_ rep_ lang_ body_ vol_ =
(\ _lhsIcat
_lhsIidenv
_lhsIinProducedCat
_lhsIlib ->
(let _lhsOannotatedTree :: Statement
_lhsOcatUpdates :: ([CatalogUpdate])
_lhsOlibUpdates :: ([LocalBindingsUpdate])
_bodyOlib :: LocalBindings
_paramsOpos :: Int
_tpe :: (Either [TypeError] Type)
_catUpdates :: ([CatalogUpdate])
_statementType :: (Maybe ParameterizedStatementType)
_bodyOcat :: Catalog
_lhsOfixedUpIdentifiersTree :: Statement
_lhsOoriginalTree :: Statement
_nameOcat :: Catalog
_nameOidenv :: IDEnv
_nameOlib :: LocalBindings
_paramsOcat :: Catalog
_paramsOidenv :: IDEnv
_paramsOlib :: LocalBindings
_rettypeOcat :: Catalog
_rettypeOidenv :: IDEnv
_rettypeOlib :: LocalBindings
_bodyOidenv :: IDEnv
_nameIannotatedTree :: Name
_nameIfixedUpIdentifiersTree :: Name
_nameIoriginalTree :: Name
_nameItbAnnotatedTree :: Name
_nameItbUType :: (Maybe ([(String,Type)],[(String,Type)]))
_paramsIannotatedTree :: ParamDefList
_paramsIfixedUpIdentifiersTree :: ParamDefList
_paramsIoriginalTree :: ParamDefList
_paramsIparams :: ([(ParamName, Maybe Type)])
_rettypeIannotatedTree :: TypeName
_rettypeIfixedUpIdentifiersTree :: TypeName
_rettypeInamedType :: (Maybe Type)
_rettypeIoriginalTree :: TypeName
_bodyIannotatedTree :: FnBody
_bodyIfixedUpIdentifiersTree :: FnBody
_bodyIoriginalTree :: FnBody
_lhsOannotatedTree =
updateAnnotation
(\a -> a {stType = _statementType
,catUpd = _catUpdates }) $
setTypeAddErrors _tpe _backTree
_lhsOcatUpdates =
_catUpdates
_lhsOlibUpdates =
_libUpdates
_libUpdates =
[]
_bodyOlib =
either (const _lhsIlib) id $ do
_ <- lmt _rettypeInamedType
lbUpdate _lhsIcat (LBIds ((getTName _nameIoriginalTree) ++ " parameters") (Just (getTName _nameIoriginalTree)) paramsNoPos) _lhsIlib
>>= lbUpdate _lhsIcat (LBIds ((getTName _nameIoriginalTree) ++ " parameters") Nothing paramsPosOnly)
where
paramsPosOnly :: [(String,Type)]
paramsPosOnly = mapMaybe prm _paramsIparams
prm :: (ParamName,Maybe Type) -> Maybe (String,Type)
prm (NamedParam p _,Just t) = Just ("$" ++ show p, t)
prm (UnnamedParam p,Just t) = Just ("$" ++ show p, t)
prm _ = Nothing
paramsNoPos :: [(String,Type)]
paramsNoPos = mapMaybe pnp _paramsIparams
pnp :: (ParamName,Maybe Type) -> Maybe (String,Type)
pnp (NamedParam _ n,Just t) = Just (n,t)
pnp _ = Nothing
_paramsOpos =
1
_tpe =
Right $ Pseudo Void
_catUpdates =
either (const []) id $ do
let ps = mapMaybe lpt _paramsIparams
rt <- lmt _rettypeInamedType
return [CatCreateFunction FunName
(map toLower (getTName _nameIoriginalTree))
ps
rt
False]
where
lpt (_,Just t) = Just t
lpt _ = Nothing
_backTree =
CreateFunction ann_
_nameIoriginalTree
_paramsIannotatedTree
_rettypeIannotatedTree
rep_
lang_
_bodyIannotatedTree
vol_
_statementType =
Nothing
_bodyOcat =
_lhsIinProducedCat
_annotatedTree =
CreateFunction ann_ _nameIannotatedTree _paramsIannotatedTree _rettypeIannotatedTree rep_ lang_ _bodyIannotatedTree vol_
_fixedUpIdentifiersTree =
CreateFunction ann_ _nameIfixedUpIdentifiersTree _paramsIfixedUpIdentifiersTree _rettypeIfixedUpIdentifiersTree rep_ lang_ _bodyIfixedUpIdentifiersTree vol_
_originalTree =
CreateFunction ann_ _nameIoriginalTree _paramsIoriginalTree _rettypeIoriginalTree rep_ lang_ _bodyIoriginalTree vol_
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
_nameOcat =
_lhsIcat
_nameOidenv =
_lhsIidenv
_nameOlib =
_lhsIlib
_paramsOcat =
_lhsIcat
_paramsOidenv =
_lhsIidenv
_paramsOlib =
_lhsIlib
_rettypeOcat =
_lhsIcat
_rettypeOidenv =
_lhsIidenv
_rettypeOlib =
_lhsIlib
_bodyOidenv =
_lhsIidenv
( _nameIannotatedTree,_nameIfixedUpIdentifiersTree,_nameIoriginalTree,_nameItbAnnotatedTree,_nameItbUType) =
name_ _nameOcat _nameOidenv _nameOlib
( _paramsIannotatedTree,_paramsIfixedUpIdentifiersTree,_paramsIoriginalTree,_paramsIparams) =
params_ _paramsOcat _paramsOidenv _paramsOlib _paramsOpos
( _rettypeIannotatedTree,_rettypeIfixedUpIdentifiersTree,_rettypeInamedType,_rettypeIoriginalTree) =
rettype_ _rettypeOcat _rettypeOidenv _rettypeOlib
( _bodyIannotatedTree,_bodyIfixedUpIdentifiersTree,_bodyIoriginalTree) =
body_ _bodyOcat _bodyOidenv _bodyOlib
in ( _lhsOannotatedTree,_lhsOcatUpdates,_lhsOfixedUpIdentifiersTree,_lhsOlibUpdates,_lhsOoriginalTree)))
sem_Statement_CreateLanguage :: Annotation ->
String ->
T_Statement
sem_Statement_CreateLanguage ann_ name_ =
(\ _lhsIcat
_lhsIidenv
_lhsIinProducedCat
_lhsIlib ->
(let _lhsOannotatedTree :: Statement
_lhsOcatUpdates :: ([CatalogUpdate])
_lhsOlibUpdates :: ([LocalBindingsUpdate])
_tpe :: (Either [TypeError] Type)
_statementType :: (Maybe ParameterizedStatementType)
_catUpdates :: ([CatalogUpdate])
_lhsOfixedUpIdentifiersTree :: Statement
_lhsOoriginalTree :: Statement
_lhsOannotatedTree =
updateAnnotation
(\a -> a {stType = _statementType
,catUpd = _catUpdates }) $
setTypeAddErrors _tpe _backTree
_lhsOcatUpdates =
_catUpdates
_lhsOlibUpdates =
_libUpdates
_libUpdates =
[]
_tpe =
Right $ Pseudo Void
_backTree =
CreateLanguage ann_ name_
_statementType =
Nothing
_catUpdates =
[CatCreateFunction FunName "plpgsql_call_handler" [] (Pseudo LanguageHandler) False
,CatCreateFunction FunName "plpgsql_validator" [ScalarType "oid"] (Pseudo Void) False]
_annotatedTree =
CreateLanguage ann_ name_
_fixedUpIdentifiersTree =
CreateLanguage ann_ name_
_originalTree =
CreateLanguage ann_ name_
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
in ( _lhsOannotatedTree,_lhsOcatUpdates,_lhsOfixedUpIdentifiersTree,_lhsOlibUpdates,_lhsOoriginalTree)))
sem_Statement_CreateSequence :: Annotation ->
T_Name ->
Integer ->
Integer ->
Integer ->
Integer ->
Integer ->
T_Statement
sem_Statement_CreateSequence ann_ name_ incr_ min_ max_ start_ cache_ =
(\ _lhsIcat
_lhsIidenv
_lhsIinProducedCat
_lhsIlib ->
(let _lhsOcatUpdates :: ([CatalogUpdate])
_lhsOlibUpdates :: ([LocalBindingsUpdate])
_lhsOannotatedTree :: Statement
_lhsOfixedUpIdentifiersTree :: Statement
_lhsOoriginalTree :: Statement
_nameOcat :: Catalog
_nameOidenv :: IDEnv
_nameOlib :: LocalBindings
_nameIannotatedTree :: Name
_nameIfixedUpIdentifiersTree :: Name
_nameIoriginalTree :: Name
_nameItbAnnotatedTree :: Name
_nameItbUType :: (Maybe ([(String,Type)],[(String,Type)]))
_libUpdates =
[]
_lhsOcatUpdates =
[]
_lhsOlibUpdates =
[]
_annotatedTree =
CreateSequence ann_ _nameIannotatedTree incr_ min_ max_ start_ cache_
_fixedUpIdentifiersTree =
CreateSequence ann_ _nameIfixedUpIdentifiersTree incr_ min_ max_ start_ cache_
_originalTree =
CreateSequence ann_ _nameIoriginalTree incr_ min_ max_ start_ cache_
_lhsOannotatedTree =
_annotatedTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
_nameOcat =
_lhsIcat
_nameOidenv =
_lhsIidenv
_nameOlib =
_lhsIlib
( _nameIannotatedTree,_nameIfixedUpIdentifiersTree,_nameIoriginalTree,_nameItbAnnotatedTree,_nameItbUType) =
name_ _nameOcat _nameOidenv _nameOlib
in ( _lhsOannotatedTree,_lhsOcatUpdates,_lhsOfixedUpIdentifiersTree,_lhsOlibUpdates,_lhsOoriginalTree)))
sem_Statement_CreateTable :: Annotation ->
T_Name ->
T_AttributeDefList ->
T_ConstraintList ->
T_Statement
sem_Statement_CreateTable ann_ name_ atts_ cons_ =
(\ _lhsIcat
_lhsIidenv
_lhsIinProducedCat
_lhsIlib ->
(let _lhsOannotatedTree :: Statement
_lhsOcatUpdates :: ([CatalogUpdate])
_lhsOlibUpdates :: ([LocalBindingsUpdate])
_tpe :: (Either [TypeError] Type)
_catUpdates :: ([CatalogUpdate])
_attrs :: ([(String,Type)])
_statementType :: (Maybe ParameterizedStatementType)
_consOlib :: LocalBindings
_lhsOfixedUpIdentifiersTree :: Statement
_lhsOoriginalTree :: Statement
_nameOcat :: Catalog
_nameOidenv :: IDEnv
_nameOlib :: LocalBindings
_attsOcat :: Catalog
_attsOidenv :: IDEnv
_attsOlib :: LocalBindings
_consOcat :: Catalog
_consOidenv :: IDEnv
_nameIannotatedTree :: Name
_nameIfixedUpIdentifiersTree :: Name
_nameIoriginalTree :: Name
_nameItbAnnotatedTree :: Name
_nameItbUType :: (Maybe ([(String,Type)],[(String,Type)]))
_attsIannotatedTree :: AttributeDefList
_attsIattrs :: ([(String, Maybe Type)])
_attsIfixedUpIdentifiersTree :: AttributeDefList
_attsIoriginalTree :: AttributeDefList
_consIannotatedTree :: ConstraintList
_consIfixedUpIdentifiersTree :: ConstraintList
_consIoriginalTree :: ConstraintList
_lhsOannotatedTree =
updateAnnotation
(\a -> a {stType = _statementType
,catUpd = _catUpdates }) $
setTypeAddErrors _tpe _backTree
_lhsOcatUpdates =
_catUpdates
_lhsOlibUpdates =
_libUpdates
_libUpdates =
[]
_tpe =
Right $ Pseudo Void
_catUpdates =
[CatCreateTable (getTName _nameIoriginalTree) _attrs defaultSystemColumns]
_attrs =
mapMaybe okAt _attsIattrs
where
okAt (s, Just t) = Just (s,t)
okAt (_,Nothing) = Nothing
_statementType =
Nothing
_backTree =
CreateTable ann_
_nameIoriginalTree
_attsIannotatedTree
_consIannotatedTree
_consOlib =
case lbUpdate _lhsIcat
(LBIds "attributedefs" Nothing _attrs )
_lhsIlib of
Left x -> error $ "statement-createtable-cons.lib " ++ show x
Right e -> e
_annotatedTree =
CreateTable ann_ _nameIannotatedTree _attsIannotatedTree _consIannotatedTree
_fixedUpIdentifiersTree =
CreateTable ann_ _nameIfixedUpIdentifiersTree _attsIfixedUpIdentifiersTree _consIfixedUpIdentifiersTree
_originalTree =
CreateTable ann_ _nameIoriginalTree _attsIoriginalTree _consIoriginalTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
_nameOcat =
_lhsIcat
_nameOidenv =
_lhsIidenv
_nameOlib =
_lhsIlib
_attsOcat =
_lhsIcat
_attsOidenv =
_lhsIidenv
_attsOlib =
_lhsIlib
_consOcat =
_lhsIcat
_consOidenv =
_lhsIidenv
( _nameIannotatedTree,_nameIfixedUpIdentifiersTree,_nameIoriginalTree,_nameItbAnnotatedTree,_nameItbUType) =
name_ _nameOcat _nameOidenv _nameOlib
( _attsIannotatedTree,_attsIattrs,_attsIfixedUpIdentifiersTree,_attsIoriginalTree) =
atts_ _attsOcat _attsOidenv _attsOlib
( _consIannotatedTree,_consIfixedUpIdentifiersTree,_consIoriginalTree) =
cons_ _consOcat _consOidenv _consOlib
in ( _lhsOannotatedTree,_lhsOcatUpdates,_lhsOfixedUpIdentifiersTree,_lhsOlibUpdates,_lhsOoriginalTree)))
sem_Statement_CreateTableAs :: Annotation ->
T_Name ->
T_QueryExpr ->
T_Statement
sem_Statement_CreateTableAs ann_ name_ expr_ =
(\ _lhsIcat
_lhsIidenv
_lhsIinProducedCat
_lhsIlib ->
(let _lhsOannotatedTree :: Statement
_lhsOcatUpdates :: ([CatalogUpdate])
_lhsOlibUpdates :: ([LocalBindingsUpdate])
_exprOcsql :: LocalBindings
_tpe :: (Either [TypeError] Type)
_catUpdates :: ([CatalogUpdate])
_attrs :: (Either [TypeError] [(String,Type)])
_statementType :: (Maybe ParameterizedStatementType)
_exprOexpectedTypes :: ([Maybe Type])
_lhsOfixedUpIdentifiersTree :: Statement
_lhsOoriginalTree :: Statement
_nameOcat :: Catalog
_nameOidenv :: IDEnv
_nameOlib :: LocalBindings
_exprOcat :: Catalog
_exprOidenv :: IDEnv
_exprOlib :: LocalBindings
_nameIannotatedTree :: Name
_nameIfixedUpIdentifiersTree :: Name
_nameIoriginalTree :: Name
_nameItbAnnotatedTree :: Name
_nameItbUType :: (Maybe ([(String,Type)],[(String,Type)]))
_exprIannotatedTree :: QueryExpr
_exprIcidenv :: IDEnv
_exprIfixedUpIdentifiersTree :: QueryExpr
_exprIlibUpdates :: ([LocalBindingsUpdate])
_exprIoriginalTree :: QueryExpr
_exprIuType :: (Maybe [(String,Type)])
_lhsOannotatedTree =
updateAnnotation
(\a -> a {stType = _statementType
,catUpd = _catUpdates }) $
setTypeAddErrors _tpe _backTree
_lhsOcatUpdates =
_catUpdates
_lhsOlibUpdates =
_libUpdates
_libUpdates =
[]
_exprOcsql =
emptyBindings
_tpe =
CompositeType <$> lmt _exprIuType
_catUpdates =
either (const []) id $ do
ats <- _attrs
return [CatCreateTable (getTName _nameIoriginalTree) ats defaultSystemColumns]
_attrs =
lmt _exprIuType
_backTree =
CreateTableAs ann_ _nameIoriginalTree _exprIannotatedTree
_statementType =
Nothing
_exprOexpectedTypes =
[]
_annotatedTree =
CreateTableAs ann_ _nameIannotatedTree _exprIannotatedTree
_fixedUpIdentifiersTree =
CreateTableAs ann_ _nameIfixedUpIdentifiersTree _exprIfixedUpIdentifiersTree
_originalTree =
CreateTableAs ann_ _nameIoriginalTree _exprIoriginalTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
_nameOcat =
_lhsIcat
_nameOidenv =
_lhsIidenv
_nameOlib =
_lhsIlib
_exprOcat =
_lhsIcat
_exprOidenv =
_lhsIidenv
_exprOlib =
_lhsIlib
( _nameIannotatedTree,_nameIfixedUpIdentifiersTree,_nameIoriginalTree,_nameItbAnnotatedTree,_nameItbUType) =
name_ _nameOcat _nameOidenv _nameOlib
( _exprIannotatedTree,_exprIcidenv,_exprIfixedUpIdentifiersTree,_exprIlibUpdates,_exprIoriginalTree,_exprIuType) =
expr_ _exprOcat _exprOcsql _exprOexpectedTypes _exprOidenv _exprOlib
in ( _lhsOannotatedTree,_lhsOcatUpdates,_lhsOfixedUpIdentifiersTree,_lhsOlibUpdates,_lhsOoriginalTree)))
sem_Statement_CreateTrigger :: Annotation ->
NameComponent ->
TriggerWhen ->
([TriggerEvent]) ->
T_Name ->
TriggerFire ->
T_Name ->
T_ScalarExprList ->
T_Statement
sem_Statement_CreateTrigger ann_ name_ wh_ events_ tbl_ firing_ fnName_ fnArgs_ =
(\ _lhsIcat
_lhsIidenv
_lhsIinProducedCat
_lhsIlib ->
(let _lhsOcatUpdates :: ([CatalogUpdate])
_lhsOlibUpdates :: ([LocalBindingsUpdate])
_fnArgsOexpectedTypes :: ([Maybe Type])
_lhsOannotatedTree :: Statement
_lhsOfixedUpIdentifiersTree :: Statement
_lhsOoriginalTree :: Statement
_tblOcat :: Catalog
_tblOidenv :: IDEnv
_tblOlib :: LocalBindings
_fnNameOcat :: Catalog
_fnNameOidenv :: IDEnv
_fnNameOlib :: LocalBindings
_fnArgsOcat :: Catalog
_fnArgsOidenv :: IDEnv
_fnArgsOlib :: LocalBindings
_tblIannotatedTree :: Name
_tblIfixedUpIdentifiersTree :: Name
_tblIoriginalTree :: Name
_tblItbAnnotatedTree :: Name
_tblItbUType :: (Maybe ([(String,Type)],[(String,Type)]))
_fnNameIannotatedTree :: Name
_fnNameIfixedUpIdentifiersTree :: Name
_fnNameIoriginalTree :: Name
_fnNameItbAnnotatedTree :: Name
_fnNameItbUType :: (Maybe ([(String,Type)],[(String,Type)]))
_fnArgsIannotatedTree :: ScalarExprList
_fnArgsIfixedUpIdentifiersTree :: ScalarExprList
_fnArgsIoriginalTree :: ScalarExprList
_fnArgsIuType :: ([Maybe Type])
_lhsOcatUpdates =
[]
_lhsOlibUpdates =
[]
_fnArgsOexpectedTypes =
[]
_annotatedTree =
CreateTrigger ann_ name_ wh_ events_ _tblIannotatedTree firing_ _fnNameIannotatedTree _fnArgsIannotatedTree
_fixedUpIdentifiersTree =
CreateTrigger ann_ name_ wh_ events_ _tblIfixedUpIdentifiersTree firing_ _fnNameIfixedUpIdentifiersTree _fnArgsIfixedUpIdentifiersTree
_originalTree =
CreateTrigger ann_ name_ wh_ events_ _tblIoriginalTree firing_ _fnNameIoriginalTree _fnArgsIoriginalTree
_lhsOannotatedTree =
_annotatedTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
_tblOcat =
_lhsIcat
_tblOidenv =
_lhsIidenv
_tblOlib =
_lhsIlib
_fnNameOcat =
_lhsIcat
_fnNameOidenv =
_lhsIidenv
_fnNameOlib =
_lhsIlib
_fnArgsOcat =
_lhsIcat
_fnArgsOidenv =
_lhsIidenv
_fnArgsOlib =
_lhsIlib
( _tblIannotatedTree,_tblIfixedUpIdentifiersTree,_tblIoriginalTree,_tblItbAnnotatedTree,_tblItbUType) =
tbl_ _tblOcat _tblOidenv _tblOlib
( _fnNameIannotatedTree,_fnNameIfixedUpIdentifiersTree,_fnNameIoriginalTree,_fnNameItbAnnotatedTree,_fnNameItbUType) =
fnName_ _fnNameOcat _fnNameOidenv _fnNameOlib
( _fnArgsIannotatedTree,_fnArgsIfixedUpIdentifiersTree,_fnArgsIoriginalTree,_fnArgsIuType) =
fnArgs_ _fnArgsOcat _fnArgsOexpectedTypes _fnArgsOidenv _fnArgsOlib
in ( _lhsOannotatedTree,_lhsOcatUpdates,_lhsOfixedUpIdentifiersTree,_lhsOlibUpdates,_lhsOoriginalTree)))
sem_Statement_CreateType :: Annotation ->
T_Name ->
T_TypeAttributeDefList ->
T_Statement
sem_Statement_CreateType ann_ name_ atts_ =
(\ _lhsIcat
_lhsIidenv
_lhsIinProducedCat
_lhsIlib ->
(let _lhsOannotatedTree :: Statement
_lhsOcatUpdates :: ([CatalogUpdate])
_lhsOlibUpdates :: ([LocalBindingsUpdate])
_tpe :: (Either [TypeError] Type)
_statementType :: (Maybe ParameterizedStatementType)
_catUpdates :: ([CatalogUpdate])
_lhsOfixedUpIdentifiersTree :: Statement
_lhsOoriginalTree :: Statement
_nameOcat :: Catalog
_nameOidenv :: IDEnv
_nameOlib :: LocalBindings
_attsOcat :: Catalog
_attsOidenv :: IDEnv
_attsOlib :: LocalBindings
_nameIannotatedTree :: Name
_nameIfixedUpIdentifiersTree :: Name
_nameIoriginalTree :: Name
_nameItbAnnotatedTree :: Name
_nameItbUType :: (Maybe ([(String,Type)],[(String,Type)]))
_attsIannotatedTree :: TypeAttributeDefList
_attsIattrs :: ([(String, Maybe Type)])
_attsIfixedUpIdentifiersTree :: TypeAttributeDefList
_attsIoriginalTree :: TypeAttributeDefList
_lhsOannotatedTree =
updateAnnotation
(\a -> a {stType = _statementType
,catUpd = _catUpdates }) $
setTypeAddErrors _tpe _backTree
_lhsOcatUpdates =
_catUpdates
_lhsOlibUpdates =
_libUpdates
_libUpdates =
[]
_tpe =
Right $ Pseudo Void
_attrs =
mapMaybe okAt _attsIattrs
where
okAt (s, Just t) = Just (s,t)
okAt (_,Nothing) = Nothing
_backTree =
CreateType ann_ _nameIoriginalTree _attsIannotatedTree
_statementType =
Nothing
_catUpdates =
[CatCreateComposite (getTName _nameIoriginalTree) _attrs ]
_annotatedTree =
CreateType ann_ _nameIannotatedTree _attsIannotatedTree
_fixedUpIdentifiersTree =
CreateType ann_ _nameIfixedUpIdentifiersTree _attsIfixedUpIdentifiersTree
_originalTree =
CreateType ann_ _nameIoriginalTree _attsIoriginalTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
_nameOcat =
_lhsIcat
_nameOidenv =
_lhsIidenv
_nameOlib =
_lhsIlib
_attsOcat =
_lhsIcat
_attsOidenv =
_lhsIidenv
_attsOlib =
_lhsIlib
( _nameIannotatedTree,_nameIfixedUpIdentifiersTree,_nameIoriginalTree,_nameItbAnnotatedTree,_nameItbUType) =
name_ _nameOcat _nameOidenv _nameOlib
( _attsIannotatedTree,_attsIattrs,_attsIfixedUpIdentifiersTree,_attsIoriginalTree) =
atts_ _attsOcat _attsOidenv _attsOlib
in ( _lhsOannotatedTree,_lhsOcatUpdates,_lhsOfixedUpIdentifiersTree,_lhsOlibUpdates,_lhsOoriginalTree)))
sem_Statement_CreateView :: Annotation ->
T_Name ->
MaybeNameComponentList ->
T_QueryExpr ->
T_Statement
sem_Statement_CreateView ann_ name_ colNames_ expr_ =
(\ _lhsIcat
_lhsIidenv
_lhsIinProducedCat
_lhsIlib ->
(let _lhsOannotatedTree :: Statement
_lhsOcatUpdates :: ([CatalogUpdate])
_lhsOlibUpdates :: ([LocalBindingsUpdate])
_exprOcsql :: LocalBindings
_tpe :: (Either [TypeError] Type)
_catUpdates :: ([CatalogUpdate])
_statementType :: (Maybe ParameterizedStatementType)
_exprOexpectedTypes :: ([Maybe Type])
_lhsOfixedUpIdentifiersTree :: Statement
_lhsOoriginalTree :: Statement
_nameOcat :: Catalog
_nameOidenv :: IDEnv
_nameOlib :: LocalBindings
_exprOcat :: Catalog
_exprOidenv :: IDEnv
_exprOlib :: LocalBindings
_nameIannotatedTree :: Name
_nameIfixedUpIdentifiersTree :: Name
_nameIoriginalTree :: Name
_nameItbAnnotatedTree :: Name
_nameItbUType :: (Maybe ([(String,Type)],[(String,Type)]))
_exprIannotatedTree :: QueryExpr
_exprIcidenv :: IDEnv
_exprIfixedUpIdentifiersTree :: QueryExpr
_exprIlibUpdates :: ([LocalBindingsUpdate])
_exprIoriginalTree :: QueryExpr
_exprIuType :: (Maybe [(String,Type)])
_lhsOannotatedTree =
updateAnnotation
(\a -> a {stType = _statementType
,catUpd = _catUpdates }) $
setTypeAddErrors _tpe _backTree
_lhsOcatUpdates =
_catUpdates
_lhsOlibUpdates =
_libUpdates
_libUpdates =
[]
_exprOcsql =
emptyBindings
_tpe =
Right $ Pseudo Void
_backTree =
CreateView ann_ _nameIoriginalTree colNames_ _exprIannotatedTree
_catUpdates =
maybe [] (\a -> [CatCreateView (getTName _nameIoriginalTree) a]) _exprIuType
_statementType =
Nothing
_exprOexpectedTypes =
[]
_annotatedTree =
CreateView ann_ _nameIannotatedTree colNames_ _exprIannotatedTree
_fixedUpIdentifiersTree =
CreateView ann_ _nameIfixedUpIdentifiersTree colNames_ _exprIfixedUpIdentifiersTree
_originalTree =
CreateView ann_ _nameIoriginalTree colNames_ _exprIoriginalTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
_nameOcat =
_lhsIcat
_nameOidenv =
_lhsIidenv
_nameOlib =
_lhsIlib
_exprOcat =
_lhsIcat
_exprOidenv =
_lhsIidenv
_exprOlib =
_lhsIlib
( _nameIannotatedTree,_nameIfixedUpIdentifiersTree,_nameIoriginalTree,_nameItbAnnotatedTree,_nameItbUType) =
name_ _nameOcat _nameOidenv _nameOlib
( _exprIannotatedTree,_exprIcidenv,_exprIfixedUpIdentifiersTree,_exprIlibUpdates,_exprIoriginalTree,_exprIuType) =
expr_ _exprOcat _exprOcsql _exprOexpectedTypes _exprOidenv _exprOlib
in ( _lhsOannotatedTree,_lhsOcatUpdates,_lhsOfixedUpIdentifiersTree,_lhsOlibUpdates,_lhsOoriginalTree)))
sem_Statement_Delete :: Annotation ->
T_Name ->
T_TableRefList ->
T_MaybeBoolExpr ->
T_MaybeSelectList ->
T_Statement
sem_Statement_Delete ann_ table_ using_ whr_ returning_ =
(\ _lhsIcat
_lhsIidenv
_lhsIinProducedCat
_lhsIlib ->
(let _whrOidenv :: IDEnv
_returningOidenv :: IDEnv
_lhsOfixedUpIdentifiersTree :: Statement
_lhsOannotatedTree :: Statement
_lhsOcatUpdates :: ([CatalogUpdate])
_lhsOlibUpdates :: ([LocalBindingsUpdate])
_tpe :: (Either [TypeError] Type)
_statementType :: (Maybe ParameterizedStatementType)
_catUpdates :: ([CatalogUpdate])
_whrOlib :: LocalBindings
_returningOlib :: LocalBindings
_lhsOoriginalTree :: Statement
_tableOcat :: Catalog
_tableOidenv :: IDEnv
_tableOlib :: LocalBindings
_usingOcat :: Catalog
_usingOidenv :: IDEnv
_usingOlib :: LocalBindings
_whrOcat :: Catalog
_returningOcat :: Catalog
_tableIannotatedTree :: Name
_tableIfixedUpIdentifiersTree :: Name
_tableIoriginalTree :: Name
_tableItbAnnotatedTree :: Name
_tableItbUType :: (Maybe ([(String,Type)],[(String,Type)]))
_usingIannotatedTree :: TableRefList
_usingIfixedUpIdentifiersTree :: TableRefList
_usingIlibUpdates :: ([LocalBindingsUpdate])
_usingInewLib2 :: LocalBindings
_usingIoriginalTree :: TableRefList
_usingItrefIDs :: IDEnv
_whrIannotatedTree :: MaybeBoolExpr
_whrIfixedUpIdentifiersTree :: MaybeBoolExpr
_whrIoriginalTree :: MaybeBoolExpr
_returningIannotatedTree :: MaybeSelectList
_returningIfixedUpIdentifiersTree :: MaybeSelectList
_returningIlistType :: ([(String,Maybe Type)])
_returningIoriginalTree :: MaybeSelectList
_trefEnv =
getTableTrefEnv _lhsIcat _tableIoriginalTree
_whrOidenv =
_trefEnv
_returningOidenv =
_trefEnv
_lhsOfixedUpIdentifiersTree =
Delete ann_
_tableIfixedUpIdentifiersTree
_usingIfixedUpIdentifiersTree
_whrIfixedUpIdentifiersTree
_returningIfixedUpIdentifiersTree
_lhsOannotatedTree =
updateAnnotation
(\a -> a {stType = _statementType
,catUpd = _catUpdates }) $
setTypeAddErrors _tpe _backTree
_lhsOcatUpdates =
_catUpdates
_lhsOlibUpdates =
_libUpdates
_libUpdates =
[]
_tpe =
Right $ Pseudo Void
_statementType =
do
pt <- sequence $ getPlaceholderTypes _whrIannotatedTree
lt <- liftList _returningIlistType
return (pt,lt)
_backTree =
Delete ann_ _tableItbAnnotatedTree _usingIannotatedTree _whrIannotatedTree _returningIannotatedTree
_catUpdates =
[]
_lib =
either (const _lhsIlib) id $ do
makeTrefLib _lhsIcat _tableIannotatedTree _tableItbUType
_whrOlib =
_lib
_returningOlib =
_lib
_annotatedTree =
Delete ann_ _tableIannotatedTree _usingIannotatedTree _whrIannotatedTree _returningIannotatedTree
_fixedUpIdentifiersTree =
Delete ann_ _tableIfixedUpIdentifiersTree _usingIfixedUpIdentifiersTree _whrIfixedUpIdentifiersTree _returningIfixedUpIdentifiersTree
_originalTree =
Delete ann_ _tableIoriginalTree _usingIoriginalTree _whrIoriginalTree _returningIoriginalTree
_lhsOoriginalTree =
_originalTree
_tableOcat =
_lhsIcat
_tableOidenv =
_lhsIidenv
_tableOlib =
_lib
_usingOcat =
_lhsIcat
_usingOidenv =
_lhsIidenv
_usingOlib =
_lib
_whrOcat =
_lhsIcat
_returningOcat =
_lhsIcat
( _tableIannotatedTree,_tableIfixedUpIdentifiersTree,_tableIoriginalTree,_tableItbAnnotatedTree,_tableItbUType) =
table_ _tableOcat _tableOidenv _tableOlib
( _usingIannotatedTree,_usingIfixedUpIdentifiersTree,_usingIlibUpdates,_usingInewLib2,_usingIoriginalTree,_usingItrefIDs) =
using_ _usingOcat _usingOidenv _usingOlib
( _whrIannotatedTree,_whrIfixedUpIdentifiersTree,_whrIoriginalTree) =
whr_ _whrOcat _whrOidenv _whrOlib
( _returningIannotatedTree,_returningIfixedUpIdentifiersTree,_returningIlistType,_returningIoriginalTree) =
returning_ _returningOcat _returningOidenv _returningOlib
in ( _lhsOannotatedTree,_lhsOcatUpdates,_lhsOfixedUpIdentifiersTree,_lhsOlibUpdates,_lhsOoriginalTree)))
sem_Statement_DropFunction :: Annotation ->
IfExists ->
T_NameTypeNameListPairList ->
Cascade ->
T_Statement
sem_Statement_DropFunction ann_ ifE_ sigs_ cascade_ =
(\ _lhsIcat
_lhsIidenv
_lhsIinProducedCat
_lhsIlib ->
(let _lhsOannotatedTree :: Statement
_lhsOcatUpdates :: ([CatalogUpdate])
_lhsOlibUpdates :: ([LocalBindingsUpdate])
_tpe :: (Either [TypeError] Type)
_catUpdates :: ([CatalogUpdate])
_statementType :: (Maybe ParameterizedStatementType)
_lhsOfixedUpIdentifiersTree :: Statement
_lhsOoriginalTree :: Statement
_sigsOcat :: Catalog
_sigsOidenv :: IDEnv
_sigsOlib :: LocalBindings
_sigsIannotatedTree :: NameTypeNameListPairList
_sigsIfixedUpIdentifiersTree :: NameTypeNameListPairList
_sigsIfnSigs :: ([(Name,[Maybe Type])])
_sigsIoriginalTree :: NameTypeNameListPairList
_lhsOannotatedTree =
updateAnnotation
(\a -> a {stType = _statementType
,catUpd = _catUpdates }) $
setTypeAddErrors _tpe _backTree
_lhsOcatUpdates =
_catUpdates
_lhsOlibUpdates =
_libUpdates
_libUpdates =
[]
_tpe =
Right $ Pseudo Void
_backTree =
DropFunction ann_ ifE_ _sigsIannotatedTree cascade_
_catUpdates =
either (const []) id $
Right $ map mcu $ mapMaybe goodSig _sigsIfnSigs
where
mcu :: (String,[Type]) -> CatalogUpdate
mcu (nm,args) = CatDropFunction ifE nm args
ifE = ifE_ == IfExists
goodSig :: (Name,[Maybe Type]) -> Maybe (String,[Type])
goodSig (s, ts) = do
ts1 <- sequence ts
return (getTName s,ts1)
_statementType =
Nothing
_annotatedTree =
DropFunction ann_ ifE_ _sigsIannotatedTree cascade_
_fixedUpIdentifiersTree =
DropFunction ann_ ifE_ _sigsIfixedUpIdentifiersTree cascade_
_originalTree =
DropFunction ann_ ifE_ _sigsIoriginalTree cascade_
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
_sigsOcat =
_lhsIcat
_sigsOidenv =
_lhsIidenv
_sigsOlib =
_lhsIlib
( _sigsIannotatedTree,_sigsIfixedUpIdentifiersTree,_sigsIfnSigs,_sigsIoriginalTree) =
sigs_ _sigsOcat _sigsOidenv _sigsOlib
in ( _lhsOannotatedTree,_lhsOcatUpdates,_lhsOfixedUpIdentifiersTree,_lhsOlibUpdates,_lhsOoriginalTree)))
sem_Statement_DropSomething :: Annotation ->
DropType ->
IfExists ->
([Name]) ->
Cascade ->
T_Statement
sem_Statement_DropSomething ann_ dropType_ ifE_ names_ cascade_ =
(\ _lhsIcat
_lhsIidenv
_lhsIinProducedCat
_lhsIlib ->
(let _lhsOcatUpdates :: ([CatalogUpdate])
_lhsOlibUpdates :: ([LocalBindingsUpdate])
_lhsOannotatedTree :: Statement
_lhsOfixedUpIdentifiersTree :: Statement
_lhsOoriginalTree :: Statement
_lhsOcatUpdates =
[]
_lhsOlibUpdates =
[]
_annotatedTree =
DropSomething ann_ dropType_ ifE_ names_ cascade_
_fixedUpIdentifiersTree =
DropSomething ann_ dropType_ ifE_ names_ cascade_
_originalTree =
DropSomething ann_ dropType_ ifE_ names_ cascade_
_lhsOannotatedTree =
_annotatedTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
in ( _lhsOannotatedTree,_lhsOcatUpdates,_lhsOfixedUpIdentifiersTree,_lhsOlibUpdates,_lhsOoriginalTree)))
sem_Statement_Execute :: Annotation ->
T_ScalarExpr ->
T_Statement
sem_Statement_Execute ann_ expr_ =
(\ _lhsIcat
_lhsIidenv
_lhsIinProducedCat
_lhsIlib ->
(let _lhsOcatUpdates :: ([CatalogUpdate])
_lhsOlibUpdates :: ([LocalBindingsUpdate])
_exprOexpectedType :: (Maybe Type)
_lhsOannotatedTree :: Statement
_lhsOfixedUpIdentifiersTree :: Statement
_lhsOoriginalTree :: Statement
_exprOcat :: Catalog
_exprOidenv :: IDEnv
_exprOlib :: LocalBindings
_exprIannotatedTree :: ScalarExpr
_exprIfixedUpIdentifiersTree :: ScalarExpr
_exprIoriginalTree :: ScalarExpr
_exprIuType :: (Maybe Type)
_lhsOcatUpdates =
[]
_lhsOlibUpdates =
[]
_exprOexpectedType =
Nothing
_annotatedTree =
Execute ann_ _exprIannotatedTree
_fixedUpIdentifiersTree =
Execute ann_ _exprIfixedUpIdentifiersTree
_originalTree =
Execute ann_ _exprIoriginalTree
_lhsOannotatedTree =
_annotatedTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
_exprOcat =
_lhsIcat
_exprOidenv =
_lhsIidenv
_exprOlib =
_lhsIlib
( _exprIannotatedTree,_exprIfixedUpIdentifiersTree,_exprIoriginalTree,_exprIuType) =
expr_ _exprOcat _exprOexpectedType _exprOidenv _exprOlib
in ( _lhsOannotatedTree,_lhsOcatUpdates,_lhsOfixedUpIdentifiersTree,_lhsOlibUpdates,_lhsOoriginalTree)))
sem_Statement_ExitStatement :: Annotation ->
(Maybe String) ->
T_Statement
sem_Statement_ExitStatement ann_ lb_ =
(\ _lhsIcat
_lhsIidenv
_lhsIinProducedCat
_lhsIlib ->
(let _lhsOcatUpdates :: ([CatalogUpdate])
_lhsOlibUpdates :: ([LocalBindingsUpdate])
_lhsOannotatedTree :: Statement
_lhsOfixedUpIdentifiersTree :: Statement
_lhsOoriginalTree :: Statement
_lhsOcatUpdates =
[]
_lhsOlibUpdates =
[]
_annotatedTree =
ExitStatement ann_ lb_
_fixedUpIdentifiersTree =
ExitStatement ann_ lb_
_originalTree =
ExitStatement ann_ lb_
_lhsOannotatedTree =
_annotatedTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
in ( _lhsOannotatedTree,_lhsOcatUpdates,_lhsOfixedUpIdentifiersTree,_lhsOlibUpdates,_lhsOoriginalTree)))
sem_Statement_ForIntegerStatement :: Annotation ->
(Maybe String) ->
NameComponent ->
T_ScalarExpr ->
T_ScalarExpr ->
T_StatementList ->
T_Statement
sem_Statement_ForIntegerStatement ann_ lb_ var_ from_ to_ sts_ =
(\ _lhsIcat
_lhsIidenv
_lhsIinProducedCat
_lhsIlib ->
(let _lhsOannotatedTree :: Statement
_lhsOcatUpdates :: ([CatalogUpdate])
_lhsOlibUpdates :: ([LocalBindingsUpdate])
_stsOcatUpdates :: ([CatalogUpdate])
_stsOlibUpdates :: ([LocalBindingsUpdate])
_tpe :: (Either [TypeError] Type)
_catUpdates :: ([CatalogUpdate])
_statementType :: (Maybe ParameterizedStatementType)
_fromOexpectedType :: (Maybe Type)
_toOexpectedType :: (Maybe Type)
_lhsOfixedUpIdentifiersTree :: Statement
_lhsOoriginalTree :: Statement
_fromOcat :: Catalog
_fromOidenv :: IDEnv
_fromOlib :: LocalBindings
_toOcat :: Catalog
_toOidenv :: IDEnv
_toOlib :: LocalBindings
_stsOcat :: Catalog
_stsOidenv :: IDEnv
_stsOlib :: LocalBindings
_fromIannotatedTree :: ScalarExpr
_fromIfixedUpIdentifiersTree :: ScalarExpr
_fromIoriginalTree :: ScalarExpr
_fromIuType :: (Maybe Type)
_toIannotatedTree :: ScalarExpr
_toIfixedUpIdentifiersTree :: ScalarExpr
_toIoriginalTree :: ScalarExpr
_toIuType :: (Maybe Type)
_stsIannotatedTree :: StatementList
_stsIfixedUpIdentifiersTree :: StatementList
_stsIoriginalTree :: StatementList
_stsIproducedCat :: Catalog
_stsIproducedLib :: LocalBindings
_lhsOannotatedTree =
updateAnnotation
(\a -> a {stType = _statementType
,catUpd = _catUpdates }) $
setTypeAddErrors _tpe _backTree
_lhsOcatUpdates =
_catUpdates
_lhsOlibUpdates =
_libUpdates
_libUpdates =
[]
_stsOcatUpdates =
[]
_stsOlibUpdates =
[]
_tpe =
Left []
_backTree =
ForIntegerStatement ann_ lb_ var_ _fromIannotatedTree _toIannotatedTree _stsIannotatedTree
_catUpdates =
[]
_statementType =
Nothing
_fromOexpectedType =
Nothing
_toOexpectedType =
Nothing
_annotatedTree =
ForIntegerStatement ann_ lb_ var_ _fromIannotatedTree _toIannotatedTree _stsIannotatedTree
_fixedUpIdentifiersTree =
ForIntegerStatement ann_ lb_ var_ _fromIfixedUpIdentifiersTree _toIfixedUpIdentifiersTree _stsIfixedUpIdentifiersTree
_originalTree =
ForIntegerStatement ann_ lb_ var_ _fromIoriginalTree _toIoriginalTree _stsIoriginalTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
_fromOcat =
_lhsIcat
_fromOidenv =
_lhsIidenv
_fromOlib =
_lhsIlib
_toOcat =
_lhsIcat
_toOidenv =
_lhsIidenv
_toOlib =
_lhsIlib
_stsOcat =
_lhsIcat
_stsOidenv =
_lhsIidenv
_stsOlib =
_lhsIlib
( _fromIannotatedTree,_fromIfixedUpIdentifiersTree,_fromIoriginalTree,_fromIuType) =
from_ _fromOcat _fromOexpectedType _fromOidenv _fromOlib
( _toIannotatedTree,_toIfixedUpIdentifiersTree,_toIoriginalTree,_toIuType) =
to_ _toOcat _toOexpectedType _toOidenv _toOlib
( _stsIannotatedTree,_stsIfixedUpIdentifiersTree,_stsIoriginalTree,_stsIproducedCat,_stsIproducedLib) =
sts_ _stsOcat _stsOcatUpdates _stsOidenv _stsOlib _stsOlibUpdates
in ( _lhsOannotatedTree,_lhsOcatUpdates,_lhsOfixedUpIdentifiersTree,_lhsOlibUpdates,_lhsOoriginalTree)))
sem_Statement_ForQueryStatement :: Annotation ->
(Maybe String) ->
NameComponent ->
T_QueryExpr ->
T_StatementList ->
T_Statement
sem_Statement_ForQueryStatement ann_ lb_ var_ sel_ sts_ =
(\ _lhsIcat
_lhsIidenv
_lhsIinProducedCat
_lhsIlib ->
(let _lhsOannotatedTree :: Statement
_lhsOcatUpdates :: ([CatalogUpdate])
_lhsOlibUpdates :: ([LocalBindingsUpdate])
_stsOcatUpdates :: ([CatalogUpdate])
_stsOlibUpdates :: ([LocalBindingsUpdate])
_selOcsql :: LocalBindings
_tpe :: (Either [TypeError] Type)
_catUpdates :: ([CatalogUpdate])
_statementType :: (Maybe ParameterizedStatementType)
_selOexpectedTypes :: ([Maybe Type])
_lhsOfixedUpIdentifiersTree :: Statement
_lhsOoriginalTree :: Statement
_selOcat :: Catalog
_selOidenv :: IDEnv
_selOlib :: LocalBindings
_stsOcat :: Catalog
_stsOidenv :: IDEnv
_stsOlib :: LocalBindings
_selIannotatedTree :: QueryExpr
_selIcidenv :: IDEnv
_selIfixedUpIdentifiersTree :: QueryExpr
_selIlibUpdates :: ([LocalBindingsUpdate])
_selIoriginalTree :: QueryExpr
_selIuType :: (Maybe [(String,Type)])
_stsIannotatedTree :: StatementList
_stsIfixedUpIdentifiersTree :: StatementList
_stsIoriginalTree :: StatementList
_stsIproducedCat :: Catalog
_stsIproducedLib :: LocalBindings
_lhsOannotatedTree =
updateAnnotation
(\a -> a {stType = _statementType
,catUpd = _catUpdates }) $
setTypeAddErrors _tpe _backTree
_lhsOcatUpdates =
_catUpdates
_lhsOlibUpdates =
_libUpdates
_libUpdates =
[]
_stsOcatUpdates =
[]
_stsOlibUpdates =
[]
_selOcsql =
emptyBindings
_tpe =
Left []
_backTree =
ForQueryStatement ann_ lb_ var_ _selIannotatedTree _stsIannotatedTree
_catUpdates =
[]
_statementType =
Nothing
_selOexpectedTypes =
[]
_annotatedTree =
ForQueryStatement ann_ lb_ var_ _selIannotatedTree _stsIannotatedTree
_fixedUpIdentifiersTree =
ForQueryStatement ann_ lb_ var_ _selIfixedUpIdentifiersTree _stsIfixedUpIdentifiersTree
_originalTree =
ForQueryStatement ann_ lb_ var_ _selIoriginalTree _stsIoriginalTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
_selOcat =
_lhsIcat
_selOidenv =
_lhsIidenv
_selOlib =
_lhsIlib
_stsOcat =
_lhsIcat
_stsOidenv =
_lhsIidenv
_stsOlib =
_lhsIlib
( _selIannotatedTree,_selIcidenv,_selIfixedUpIdentifiersTree,_selIlibUpdates,_selIoriginalTree,_selIuType) =
sel_ _selOcat _selOcsql _selOexpectedTypes _selOidenv _selOlib
( _stsIannotatedTree,_stsIfixedUpIdentifiersTree,_stsIoriginalTree,_stsIproducedCat,_stsIproducedLib) =
sts_ _stsOcat _stsOcatUpdates _stsOidenv _stsOlib _stsOlibUpdates
in ( _lhsOannotatedTree,_lhsOcatUpdates,_lhsOfixedUpIdentifiersTree,_lhsOlibUpdates,_lhsOoriginalTree)))
sem_Statement_If :: Annotation ->
T_ScalarExprStatementListPairList ->
T_StatementList ->
T_Statement
sem_Statement_If ann_ cases_ els_ =
(\ _lhsIcat
_lhsIidenv
_lhsIinProducedCat
_lhsIlib ->
(let _lhsOcatUpdates :: ([CatalogUpdate])
_lhsOlibUpdates :: ([LocalBindingsUpdate])
_elsOcatUpdates :: ([CatalogUpdate])
_elsOlibUpdates :: ([LocalBindingsUpdate])
_lhsOannotatedTree :: Statement
_lhsOfixedUpIdentifiersTree :: Statement
_lhsOoriginalTree :: Statement
_casesOcat :: Catalog
_casesOidenv :: IDEnv
_casesOlib :: LocalBindings
_elsOcat :: Catalog
_elsOidenv :: IDEnv
_elsOlib :: LocalBindings
_casesIannotatedTree :: ScalarExprStatementListPairList
_casesIfixedUpIdentifiersTree :: ScalarExprStatementListPairList
_casesIoriginalTree :: ScalarExprStatementListPairList
_elsIannotatedTree :: StatementList
_elsIfixedUpIdentifiersTree :: StatementList
_elsIoriginalTree :: StatementList
_elsIproducedCat :: Catalog
_elsIproducedLib :: LocalBindings
_lhsOcatUpdates =
[]
_lhsOlibUpdates =
[]
_elsOcatUpdates =
[]
_elsOlibUpdates =
[]
_annotatedTree =
If ann_ _casesIannotatedTree _elsIannotatedTree
_fixedUpIdentifiersTree =
If ann_ _casesIfixedUpIdentifiersTree _elsIfixedUpIdentifiersTree
_originalTree =
If ann_ _casesIoriginalTree _elsIoriginalTree
_lhsOannotatedTree =
_annotatedTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
_casesOcat =
_lhsIcat
_casesOidenv =
_lhsIidenv
_casesOlib =
_lhsIlib
_elsOcat =
_lhsIcat
_elsOidenv =
_lhsIidenv
_elsOlib =
_lhsIlib
( _casesIannotatedTree,_casesIfixedUpIdentifiersTree,_casesIoriginalTree) =
cases_ _casesOcat _casesOidenv _casesOlib
( _elsIannotatedTree,_elsIfixedUpIdentifiersTree,_elsIoriginalTree,_elsIproducedCat,_elsIproducedLib) =
els_ _elsOcat _elsOcatUpdates _elsOidenv _elsOlib _elsOlibUpdates
in ( _lhsOannotatedTree,_lhsOcatUpdates,_lhsOfixedUpIdentifiersTree,_lhsOlibUpdates,_lhsOoriginalTree)))
sem_Statement_Insert :: Annotation ->
T_Name ->
([NameComponent]) ->
T_QueryExpr ->
T_MaybeSelectList ->
T_Statement
sem_Statement_Insert ann_ table_ targetCols_ insData_ returning_ =
(\ _lhsIcat
_lhsIidenv
_lhsIinProducedCat
_lhsIlib ->
(let _returningOidenv :: IDEnv
_lhsOfixedUpIdentifiersTree :: Statement
_lhsOannotatedTree :: Statement
_lhsOcatUpdates :: ([CatalogUpdate])
_lhsOlibUpdates :: ([LocalBindingsUpdate])
_insDataOcsql :: LocalBindings
_tpe :: (Either [TypeError] Type)
_statementType :: (Maybe ParameterizedStatementType)
_columnTypes :: (Either [TypeError] [(String,Type)])
_catUpdates :: ([CatalogUpdate])
_insDataOexpectedTypes :: ([Maybe Type])
_returningOlib :: LocalBindings
_lhsOoriginalTree :: Statement
_tableOcat :: Catalog
_tableOidenv :: IDEnv
_tableOlib :: LocalBindings
_insDataOcat :: Catalog
_insDataOidenv :: IDEnv
_insDataOlib :: LocalBindings
_returningOcat :: Catalog
_tableIannotatedTree :: Name
_tableIfixedUpIdentifiersTree :: Name
_tableIoriginalTree :: Name
_tableItbAnnotatedTree :: Name
_tableItbUType :: (Maybe ([(String,Type)],[(String,Type)]))
_insDataIannotatedTree :: QueryExpr
_insDataIcidenv :: IDEnv
_insDataIfixedUpIdentifiersTree :: QueryExpr
_insDataIlibUpdates :: ([LocalBindingsUpdate])
_insDataIoriginalTree :: QueryExpr
_insDataIuType :: (Maybe [(String,Type)])
_returningIannotatedTree :: MaybeSelectList
_returningIfixedUpIdentifiersTree :: MaybeSelectList
_returningIlistType :: ([(String,Maybe Type)])
_returningIoriginalTree :: MaybeSelectList
_trefEnv =
getTableTrefEnv _lhsIcat _tableIoriginalTree
_returningOidenv =
_trefEnv
_lhsOfixedUpIdentifiersTree =
Insert ann_
_tableIfixedUpIdentifiersTree
targetCols_
_insDataIfixedUpIdentifiersTree
_returningIfixedUpIdentifiersTree
_lhsOannotatedTree =
updateAnnotation
(\a -> a {stType = _statementType
,catUpd = _catUpdates }) $
setTypeAddErrors _tpe _backTree
_lhsOcatUpdates =
_catUpdates
_lhsOlibUpdates =
_libUpdates
_libUpdates =
[]
_insDataOcsql =
emptyBindings
_tpe =
either Left (const $ Right $ Pseudo Void) _columnTypes
_statementType =
Just (catMaybes $ getPlaceholderTypes _insDataIannotatedTree
,fromMaybe [] $ liftList _returningIlistType)
_columnTypes =
do
atts <- lmt (allAtts <$> _tableItbUType)
pAtts <- lmt (fst <$> _tableItbUType)
tAtts <- case targetCols_ of
[] -> return pAtts
_ -> mapM (lkpA atts) (map ncStr targetCols_)
expAtts <- lmt _insDataIuType
checkAssignmentsValid _lhsIcat (map snd expAtts) (map snd tAtts)
return tAtts
where
lkpA :: [(String,Type)] -> String -> E (String,Type)
lkpA m n = maybe (Left [UnrecognisedIdentifier n])
(\t -> Right (n,t))
$ lookup n m
_backTree =
Insert ann_ _tableItbAnnotatedTree
targetCols_
_insDataIannotatedTree
_returningIannotatedTree
_catUpdates =
[]
_insDataOexpectedTypes =
maybe [] id $ do
ts <- etmt $ _columnTypes
return $ map (Just . snd) ts
_returningOlib =
either (const _lhsIlib) id $ do
makeTrefLib _lhsIcat _tableIannotatedTree _tableItbUType
_annotatedTree =
Insert ann_ _tableIannotatedTree targetCols_ _insDataIannotatedTree _returningIannotatedTree
_fixedUpIdentifiersTree =
Insert ann_ _tableIfixedUpIdentifiersTree targetCols_ _insDataIfixedUpIdentifiersTree _returningIfixedUpIdentifiersTree
_originalTree =
Insert ann_ _tableIoriginalTree targetCols_ _insDataIoriginalTree _returningIoriginalTree
_lhsOoriginalTree =
_originalTree
_tableOcat =
_lhsIcat
_tableOidenv =
_lhsIidenv
_tableOlib =
_lhsIlib
_insDataOcat =
_lhsIcat
_insDataOidenv =
_lhsIidenv
_insDataOlib =
_lhsIlib
_returningOcat =
_lhsIcat
( _tableIannotatedTree,_tableIfixedUpIdentifiersTree,_tableIoriginalTree,_tableItbAnnotatedTree,_tableItbUType) =
table_ _tableOcat _tableOidenv _tableOlib
( _insDataIannotatedTree,_insDataIcidenv,_insDataIfixedUpIdentifiersTree,_insDataIlibUpdates,_insDataIoriginalTree,_insDataIuType) =
insData_ _insDataOcat _insDataOcsql _insDataOexpectedTypes _insDataOidenv _insDataOlib
( _returningIannotatedTree,_returningIfixedUpIdentifiersTree,_returningIlistType,_returningIoriginalTree) =
returning_ _returningOcat _returningOidenv _returningOlib
in ( _lhsOannotatedTree,_lhsOcatUpdates,_lhsOfixedUpIdentifiersTree,_lhsOlibUpdates,_lhsOoriginalTree)))
sem_Statement_Into :: Annotation ->
Bool ->
([Name]) ->
T_Statement ->
T_Statement
sem_Statement_Into ann_ strict_ into_ stmt_ =
(\ _lhsIcat
_lhsIidenv
_lhsIinProducedCat
_lhsIlib ->
(let _lhsOcatUpdates :: ([CatalogUpdate])
_lhsOlibUpdates :: ([LocalBindingsUpdate])
_lhsOannotatedTree :: Statement
_lhsOfixedUpIdentifiersTree :: Statement
_lhsOoriginalTree :: Statement
_stmtOcat :: Catalog
_stmtOidenv :: IDEnv
_stmtOinProducedCat :: Catalog
_stmtOlib :: LocalBindings
_stmtIannotatedTree :: Statement
_stmtIcatUpdates :: ([CatalogUpdate])
_stmtIfixedUpIdentifiersTree :: Statement
_stmtIlibUpdates :: ([LocalBindingsUpdate])
_stmtIoriginalTree :: Statement
_lhsOcatUpdates =
[]
_lhsOlibUpdates =
[]
_annotatedTree =
Into ann_ strict_ into_ _stmtIannotatedTree
_fixedUpIdentifiersTree =
Into ann_ strict_ into_ _stmtIfixedUpIdentifiersTree
_originalTree =
Into ann_ strict_ into_ _stmtIoriginalTree
_lhsOannotatedTree =
_annotatedTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
_stmtOcat =
_lhsIcat
_stmtOidenv =
_lhsIidenv
_stmtOinProducedCat =
_lhsIinProducedCat
_stmtOlib =
_lhsIlib
( _stmtIannotatedTree,_stmtIcatUpdates,_stmtIfixedUpIdentifiersTree,_stmtIlibUpdates,_stmtIoriginalTree) =
stmt_ _stmtOcat _stmtOidenv _stmtOinProducedCat _stmtOlib
in ( _lhsOannotatedTree,_lhsOcatUpdates,_lhsOfixedUpIdentifiersTree,_lhsOlibUpdates,_lhsOoriginalTree)))
sem_Statement_LoopStatement :: Annotation ->
(Maybe String) ->
T_StatementList ->
T_Statement
sem_Statement_LoopStatement ann_ lb_ sts_ =
(\ _lhsIcat
_lhsIidenv
_lhsIinProducedCat
_lhsIlib ->
(let _lhsOcatUpdates :: ([CatalogUpdate])
_lhsOlibUpdates :: ([LocalBindingsUpdate])
_stsOcatUpdates :: ([CatalogUpdate])
_stsOlibUpdates :: ([LocalBindingsUpdate])
_lhsOannotatedTree :: Statement
_lhsOfixedUpIdentifiersTree :: Statement
_lhsOoriginalTree :: Statement
_stsOcat :: Catalog
_stsOidenv :: IDEnv
_stsOlib :: LocalBindings
_stsIannotatedTree :: StatementList
_stsIfixedUpIdentifiersTree :: StatementList
_stsIoriginalTree :: StatementList
_stsIproducedCat :: Catalog
_stsIproducedLib :: LocalBindings
_lhsOcatUpdates =
[]
_lhsOlibUpdates =
[]
_stsOcatUpdates =
[]
_stsOlibUpdates =
[]
_annotatedTree =
LoopStatement ann_ lb_ _stsIannotatedTree
_fixedUpIdentifiersTree =
LoopStatement ann_ lb_ _stsIfixedUpIdentifiersTree
_originalTree =
LoopStatement ann_ lb_ _stsIoriginalTree
_lhsOannotatedTree =
_annotatedTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
_stsOcat =
_lhsIcat
_stsOidenv =
_lhsIidenv
_stsOlib =
_lhsIlib
( _stsIannotatedTree,_stsIfixedUpIdentifiersTree,_stsIoriginalTree,_stsIproducedCat,_stsIproducedLib) =
sts_ _stsOcat _stsOcatUpdates _stsOidenv _stsOlib _stsOlibUpdates
in ( _lhsOannotatedTree,_lhsOcatUpdates,_lhsOfixedUpIdentifiersTree,_lhsOlibUpdates,_lhsOoriginalTree)))
sem_Statement_Notify :: Annotation ->
String ->
T_Statement
sem_Statement_Notify ann_ name_ =
(\ _lhsIcat
_lhsIidenv
_lhsIinProducedCat
_lhsIlib ->
(let _lhsOcatUpdates :: ([CatalogUpdate])
_lhsOlibUpdates :: ([LocalBindingsUpdate])
_lhsOannotatedTree :: Statement
_lhsOfixedUpIdentifiersTree :: Statement
_lhsOoriginalTree :: Statement
_libUpdates =
[]
_lhsOcatUpdates =
[]
_lhsOlibUpdates =
[]
_annotatedTree =
Notify ann_ name_
_fixedUpIdentifiersTree =
Notify ann_ name_
_originalTree =
Notify ann_ name_
_lhsOannotatedTree =
_annotatedTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
in ( _lhsOannotatedTree,_lhsOcatUpdates,_lhsOfixedUpIdentifiersTree,_lhsOlibUpdates,_lhsOoriginalTree)))
sem_Statement_NullStatement :: Annotation ->
T_Statement
sem_Statement_NullStatement ann_ =
(\ _lhsIcat
_lhsIidenv
_lhsIinProducedCat
_lhsIlib ->
(let _lhsOcatUpdates :: ([CatalogUpdate])
_lhsOlibUpdates :: ([LocalBindingsUpdate])
_lhsOannotatedTree :: Statement
_lhsOfixedUpIdentifiersTree :: Statement
_lhsOoriginalTree :: Statement
_lhsOcatUpdates =
[]
_lhsOlibUpdates =
[]
_annotatedTree =
NullStatement ann_
_fixedUpIdentifiersTree =
NullStatement ann_
_originalTree =
NullStatement ann_
_lhsOannotatedTree =
_annotatedTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
in ( _lhsOannotatedTree,_lhsOcatUpdates,_lhsOfixedUpIdentifiersTree,_lhsOlibUpdates,_lhsOoriginalTree)))
sem_Statement_Perform :: Annotation ->
T_ScalarExpr ->
T_Statement
sem_Statement_Perform ann_ expr_ =
(\ _lhsIcat
_lhsIidenv
_lhsIinProducedCat
_lhsIlib ->
(let _lhsOcatUpdates :: ([CatalogUpdate])
_lhsOlibUpdates :: ([LocalBindingsUpdate])
_exprOexpectedType :: (Maybe Type)
_lhsOannotatedTree :: Statement
_lhsOfixedUpIdentifiersTree :: Statement
_lhsOoriginalTree :: Statement
_exprOcat :: Catalog
_exprOidenv :: IDEnv
_exprOlib :: LocalBindings
_exprIannotatedTree :: ScalarExpr
_exprIfixedUpIdentifiersTree :: ScalarExpr
_exprIoriginalTree :: ScalarExpr
_exprIuType :: (Maybe Type)
_lhsOcatUpdates =
[]
_lhsOlibUpdates =
[]
_exprOexpectedType =
Nothing
_annotatedTree =
Perform ann_ _exprIannotatedTree
_fixedUpIdentifiersTree =
Perform ann_ _exprIfixedUpIdentifiersTree
_originalTree =
Perform ann_ _exprIoriginalTree
_lhsOannotatedTree =
_annotatedTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
_exprOcat =
_lhsIcat
_exprOidenv =
_lhsIidenv
_exprOlib =
_lhsIlib
( _exprIannotatedTree,_exprIfixedUpIdentifiersTree,_exprIoriginalTree,_exprIuType) =
expr_ _exprOcat _exprOexpectedType _exprOidenv _exprOlib
in ( _lhsOannotatedTree,_lhsOcatUpdates,_lhsOfixedUpIdentifiersTree,_lhsOlibUpdates,_lhsOoriginalTree)))
sem_Statement_QueryStatement :: Annotation ->
T_QueryExpr ->
T_Statement
sem_Statement_QueryStatement ann_ ex_ =
(\ _lhsIcat
_lhsIidenv
_lhsIinProducedCat
_lhsIlib ->
(let _lhsOannotatedTree :: Statement
_lhsOcatUpdates :: ([CatalogUpdate])
_lhsOlibUpdates :: ([LocalBindingsUpdate])
_tpe :: (Either [TypeError] Type)
_statementType :: (Maybe ParameterizedStatementType)
_catUpdates :: ([CatalogUpdate])
_exOcsql :: LocalBindings
_exOexpectedTypes :: ([Maybe Type])
_lhsOfixedUpIdentifiersTree :: Statement
_lhsOoriginalTree :: Statement
_exOcat :: Catalog
_exOidenv :: IDEnv
_exOlib :: LocalBindings
_exIannotatedTree :: QueryExpr
_exIcidenv :: IDEnv
_exIfixedUpIdentifiersTree :: QueryExpr
_exIlibUpdates :: ([LocalBindingsUpdate])
_exIoriginalTree :: QueryExpr
_exIuType :: (Maybe [(String,Type)])
_lhsOannotatedTree =
updateAnnotation
(\a -> a {stType = _statementType
,catUpd = _catUpdates }) $
setTypeAddErrors _tpe _backTree
_lhsOcatUpdates =
_catUpdates
_lhsOlibUpdates =
_libUpdates
_tpe =
Right $ Pseudo Void
_statementType =
do
pt <- sequence $ getPlaceholderTypes _exIannotatedTree
st <- _exIuType
return (pt
,case st of
[(_,(Pseudo Void))] -> []
t -> t)
_backTree =
QueryStatement ann_ _exIannotatedTree
_catUpdates =
[]
_exOcsql =
emptyBindings
_libUpdates =
_exIlibUpdates
_exOexpectedTypes =
[]
_annotatedTree =
QueryStatement ann_ _exIannotatedTree
_fixedUpIdentifiersTree =
QueryStatement ann_ _exIfixedUpIdentifiersTree
_originalTree =
QueryStatement ann_ _exIoriginalTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
_exOcat =
_lhsIcat
_exOidenv =
_lhsIidenv
_exOlib =
_lhsIlib
( _exIannotatedTree,_exIcidenv,_exIfixedUpIdentifiersTree,_exIlibUpdates,_exIoriginalTree,_exIuType) =
ex_ _exOcat _exOcsql _exOexpectedTypes _exOidenv _exOlib
in ( _lhsOannotatedTree,_lhsOcatUpdates,_lhsOfixedUpIdentifiersTree,_lhsOlibUpdates,_lhsOoriginalTree)))
sem_Statement_Raise :: Annotation ->
RaiseType ->
String ->
T_ScalarExprList ->
T_Statement
sem_Statement_Raise ann_ level_ message_ args_ =
(\ _lhsIcat
_lhsIidenv
_lhsIinProducedCat
_lhsIlib ->
(let _lhsOcatUpdates :: ([CatalogUpdate])
_lhsOlibUpdates :: ([LocalBindingsUpdate])
_argsOexpectedTypes :: ([Maybe Type])
_lhsOannotatedTree :: Statement
_lhsOfixedUpIdentifiersTree :: Statement
_lhsOoriginalTree :: Statement
_argsOcat :: Catalog
_argsOidenv :: IDEnv
_argsOlib :: LocalBindings
_argsIannotatedTree :: ScalarExprList
_argsIfixedUpIdentifiersTree :: ScalarExprList
_argsIoriginalTree :: ScalarExprList
_argsIuType :: ([Maybe Type])
_lhsOcatUpdates =
[]
_lhsOlibUpdates =
[]
_argsOexpectedTypes =
[]
_annotatedTree =
Raise ann_ level_ message_ _argsIannotatedTree
_fixedUpIdentifiersTree =
Raise ann_ level_ message_ _argsIfixedUpIdentifiersTree
_originalTree =
Raise ann_ level_ message_ _argsIoriginalTree
_lhsOannotatedTree =
_annotatedTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
_argsOcat =
_lhsIcat
_argsOidenv =
_lhsIidenv
_argsOlib =
_lhsIlib
( _argsIannotatedTree,_argsIfixedUpIdentifiersTree,_argsIoriginalTree,_argsIuType) =
args_ _argsOcat _argsOexpectedTypes _argsOidenv _argsOlib
in ( _lhsOannotatedTree,_lhsOcatUpdates,_lhsOfixedUpIdentifiersTree,_lhsOlibUpdates,_lhsOoriginalTree)))
sem_Statement_Return :: Annotation ->
T_MaybeScalarExpr ->
T_Statement
sem_Statement_Return ann_ value_ =
(\ _lhsIcat
_lhsIidenv
_lhsIinProducedCat
_lhsIlib ->
(let _lhsOannotatedTree :: Statement
_lhsOcatUpdates :: ([CatalogUpdate])
_lhsOlibUpdates :: ([LocalBindingsUpdate])
_tpe :: (Either [TypeError] Type)
_catUpdates :: ([CatalogUpdate])
_statementType :: (Maybe ParameterizedStatementType)
_lhsOfixedUpIdentifiersTree :: Statement
_lhsOoriginalTree :: Statement
_valueOcat :: Catalog
_valueOidenv :: IDEnv
_valueOlib :: LocalBindings
_valueIannotatedTree :: MaybeScalarExpr
_valueIfixedUpIdentifiersTree :: MaybeScalarExpr
_valueIoriginalTree :: MaybeScalarExpr
_valueIuType :: (Maybe Type)
_lhsOannotatedTree =
updateAnnotation
(\a -> a {stType = _statementType
,catUpd = _catUpdates }) $
setTypeAddErrors _tpe _backTree
_lhsOcatUpdates =
_catUpdates
_lhsOlibUpdates =
_libUpdates
_libUpdates =
[]
_tpe =
maybe (Right $ Pseudo Void) Right _valueIuType
_backTree =
Return ann_ _valueIannotatedTree
_catUpdates =
[]
_statementType =
Nothing
_annotatedTree =
Return ann_ _valueIannotatedTree
_fixedUpIdentifiersTree =
Return ann_ _valueIfixedUpIdentifiersTree
_originalTree =
Return ann_ _valueIoriginalTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
_valueOcat =
_lhsIcat
_valueOidenv =
_lhsIidenv
_valueOlib =
_lhsIlib
( _valueIannotatedTree,_valueIfixedUpIdentifiersTree,_valueIoriginalTree,_valueIuType) =
value_ _valueOcat _valueOidenv _valueOlib
in ( _lhsOannotatedTree,_lhsOcatUpdates,_lhsOfixedUpIdentifiersTree,_lhsOlibUpdates,_lhsOoriginalTree)))
sem_Statement_ReturnNext :: Annotation ->
T_ScalarExpr ->
T_Statement
sem_Statement_ReturnNext ann_ expr_ =
(\ _lhsIcat
_lhsIidenv
_lhsIinProducedCat
_lhsIlib ->
(let _lhsOcatUpdates :: ([CatalogUpdate])
_lhsOlibUpdates :: ([LocalBindingsUpdate])
_exprOexpectedType :: (Maybe Type)
_lhsOannotatedTree :: Statement
_lhsOfixedUpIdentifiersTree :: Statement
_lhsOoriginalTree :: Statement
_exprOcat :: Catalog
_exprOidenv :: IDEnv
_exprOlib :: LocalBindings
_exprIannotatedTree :: ScalarExpr
_exprIfixedUpIdentifiersTree :: ScalarExpr
_exprIoriginalTree :: ScalarExpr
_exprIuType :: (Maybe Type)
_lhsOcatUpdates =
[]
_lhsOlibUpdates =
[]
_exprOexpectedType =
Nothing
_annotatedTree =
ReturnNext ann_ _exprIannotatedTree
_fixedUpIdentifiersTree =
ReturnNext ann_ _exprIfixedUpIdentifiersTree
_originalTree =
ReturnNext ann_ _exprIoriginalTree
_lhsOannotatedTree =
_annotatedTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
_exprOcat =
_lhsIcat
_exprOidenv =
_lhsIidenv
_exprOlib =
_lhsIlib
( _exprIannotatedTree,_exprIfixedUpIdentifiersTree,_exprIoriginalTree,_exprIuType) =
expr_ _exprOcat _exprOexpectedType _exprOidenv _exprOlib
in ( _lhsOannotatedTree,_lhsOcatUpdates,_lhsOfixedUpIdentifiersTree,_lhsOlibUpdates,_lhsOoriginalTree)))
sem_Statement_ReturnQuery :: Annotation ->
T_QueryExpr ->
T_Statement
sem_Statement_ReturnQuery ann_ sel_ =
(\ _lhsIcat
_lhsIidenv
_lhsIinProducedCat
_lhsIlib ->
(let _lhsOcatUpdates :: ([CatalogUpdate])
_lhsOlibUpdates :: ([LocalBindingsUpdate])
_selOcsql :: LocalBindings
_selOexpectedTypes :: ([Maybe Type])
_lhsOannotatedTree :: Statement
_lhsOfixedUpIdentifiersTree :: Statement
_lhsOoriginalTree :: Statement
_selOcat :: Catalog
_selOidenv :: IDEnv
_selOlib :: LocalBindings
_selIannotatedTree :: QueryExpr
_selIcidenv :: IDEnv
_selIfixedUpIdentifiersTree :: QueryExpr
_selIlibUpdates :: ([LocalBindingsUpdate])
_selIoriginalTree :: QueryExpr
_selIuType :: (Maybe [(String,Type)])
_lhsOcatUpdates =
[]
_lhsOlibUpdates =
[]
_selOcsql =
emptyBindings
_selOexpectedTypes =
[]
_annotatedTree =
ReturnQuery ann_ _selIannotatedTree
_fixedUpIdentifiersTree =
ReturnQuery ann_ _selIfixedUpIdentifiersTree
_originalTree =
ReturnQuery ann_ _selIoriginalTree
_lhsOannotatedTree =
_annotatedTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
_selOcat =
_lhsIcat
_selOidenv =
_lhsIidenv
_selOlib =
_lhsIlib
( _selIannotatedTree,_selIcidenv,_selIfixedUpIdentifiersTree,_selIlibUpdates,_selIoriginalTree,_selIuType) =
sel_ _selOcat _selOcsql _selOexpectedTypes _selOidenv _selOlib
in ( _lhsOannotatedTree,_lhsOcatUpdates,_lhsOfixedUpIdentifiersTree,_lhsOlibUpdates,_lhsOoriginalTree)))
sem_Statement_Set :: Annotation ->
String ->
([SetValue]) ->
T_Statement
sem_Statement_Set ann_ name_ values_ =
(\ _lhsIcat
_lhsIidenv
_lhsIinProducedCat
_lhsIlib ->
(let _lhsOcatUpdates :: ([CatalogUpdate])
_lhsOlibUpdates :: ([LocalBindingsUpdate])
_lhsOannotatedTree :: Statement
_lhsOfixedUpIdentifiersTree :: Statement
_lhsOoriginalTree :: Statement
_libUpdates =
[]
_lhsOcatUpdates =
[]
_lhsOlibUpdates =
[]
_annotatedTree =
Set ann_ name_ values_
_fixedUpIdentifiersTree =
Set ann_ name_ values_
_originalTree =
Set ann_ name_ values_
_lhsOannotatedTree =
_annotatedTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
in ( _lhsOannotatedTree,_lhsOcatUpdates,_lhsOfixedUpIdentifiersTree,_lhsOlibUpdates,_lhsOoriginalTree)))
sem_Statement_Truncate :: Annotation ->
([Name]) ->
RestartIdentity ->
Cascade ->
T_Statement
sem_Statement_Truncate ann_ tables_ restartIdentity_ cascade_ =
(\ _lhsIcat
_lhsIidenv
_lhsIinProducedCat
_lhsIlib ->
(let _lhsOcatUpdates :: ([CatalogUpdate])
_lhsOlibUpdates :: ([LocalBindingsUpdate])
_lhsOannotatedTree :: Statement
_lhsOfixedUpIdentifiersTree :: Statement
_lhsOoriginalTree :: Statement
_lhsOcatUpdates =
[]
_lhsOlibUpdates =
[]
_annotatedTree =
Truncate ann_ tables_ restartIdentity_ cascade_
_fixedUpIdentifiersTree =
Truncate ann_ tables_ restartIdentity_ cascade_
_originalTree =
Truncate ann_ tables_ restartIdentity_ cascade_
_lhsOannotatedTree =
_annotatedTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
in ( _lhsOannotatedTree,_lhsOcatUpdates,_lhsOfixedUpIdentifiersTree,_lhsOlibUpdates,_lhsOoriginalTree)))
sem_Statement_Update :: Annotation ->
T_Name ->
T_SetClauseList ->
T_TableRefList ->
T_MaybeBoolExpr ->
T_MaybeSelectList ->
T_Statement
sem_Statement_Update ann_ table_ assigns_ fromList_ whr_ returning_ =
(\ _lhsIcat
_lhsIidenv
_lhsIinProducedCat
_lhsIlib ->
(let _whrOidenv :: IDEnv
_assignsOidenv :: IDEnv
_returningOidenv :: IDEnv
_lhsOfixedUpIdentifiersTree :: Statement
_lhsOannotatedTree :: Statement
_lhsOcatUpdates :: ([CatalogUpdate])
_lhsOlibUpdates :: ([LocalBindingsUpdate])
_tpe :: (Either [TypeError] Type)
_statementType :: (Maybe ParameterizedStatementType)
_catUpdates :: ([CatalogUpdate])
_whrOlib :: LocalBindings
_assignsOlib :: LocalBindings
_returningOlib :: LocalBindings
_assignsOtbName :: String
_lhsOoriginalTree :: Statement
_tableOcat :: Catalog
_tableOidenv :: IDEnv
_tableOlib :: LocalBindings
_assignsOcat :: Catalog
_fromListOcat :: Catalog
_fromListOidenv :: IDEnv
_fromListOlib :: LocalBindings
_whrOcat :: Catalog
_returningOcat :: Catalog
_tableIannotatedTree :: Name
_tableIfixedUpIdentifiersTree :: Name
_tableIoriginalTree :: Name
_tableItbAnnotatedTree :: Name
_tableItbUType :: (Maybe ([(String,Type)],[(String,Type)]))
_assignsIannotatedTree :: SetClauseList
_assignsIfixedUpIdentifiersTree :: SetClauseList
_assignsIoriginalTree :: SetClauseList
_fromListIannotatedTree :: TableRefList
_fromListIfixedUpIdentifiersTree :: TableRefList
_fromListIlibUpdates :: ([LocalBindingsUpdate])
_fromListInewLib2 :: LocalBindings
_fromListIoriginalTree :: TableRefList
_fromListItrefIDs :: IDEnv
_whrIannotatedTree :: MaybeBoolExpr
_whrIfixedUpIdentifiersTree :: MaybeBoolExpr
_whrIoriginalTree :: MaybeBoolExpr
_returningIannotatedTree :: MaybeSelectList
_returningIfixedUpIdentifiersTree :: MaybeSelectList
_returningIlistType :: ([(String,Maybe Type)])
_returningIoriginalTree :: MaybeSelectList
_trefEnv =
getTableTrefEnv _lhsIcat _tableIoriginalTree
_whrOidenv =
_trefEnv
_assignsOidenv =
_trefEnv
_returningOidenv =
_trefEnv
_lhsOfixedUpIdentifiersTree =
Update ann_
_tableIfixedUpIdentifiersTree
_assignsIfixedUpIdentifiersTree
_fromListIfixedUpIdentifiersTree
_whrIfixedUpIdentifiersTree
_returningIfixedUpIdentifiersTree
_lhsOannotatedTree =
updateAnnotation
(\a -> a {stType = _statementType
,catUpd = _catUpdates }) $
setTypeAddErrors _tpe _backTree
_lhsOcatUpdates =
_catUpdates
_lhsOlibUpdates =
_libUpdates
_libUpdates =
[]
_tpe =
Right $ Pseudo Void
_statementType =
do
pt <- sequence $ getPlaceholderTypes _assignsIannotatedTree
++ getPlaceholderTypes _whrIannotatedTree
return (pt,fromMaybe [] $ liftList _returningIlistType)
_backTree =
Update ann_
_tableItbAnnotatedTree
_assignsIannotatedTree
_fromListIannotatedTree
_whrIannotatedTree
_returningIannotatedTree
_catUpdates =
[]
_lib =
either (const _lhsIlib) id $ do
makeTrefLib _lhsIcat _tableIannotatedTree _tableItbUType
_whrOlib =
_lib
_assignsOlib =
_lib
_returningOlib =
_lib
_assignsOtbName =
getTName _tableIannotatedTree
_annotatedTree =
Update ann_ _tableIannotatedTree _assignsIannotatedTree _fromListIannotatedTree _whrIannotatedTree _returningIannotatedTree
_fixedUpIdentifiersTree =
Update ann_ _tableIfixedUpIdentifiersTree _assignsIfixedUpIdentifiersTree _fromListIfixedUpIdentifiersTree _whrIfixedUpIdentifiersTree _returningIfixedUpIdentifiersTree
_originalTree =
Update ann_ _tableIoriginalTree _assignsIoriginalTree _fromListIoriginalTree _whrIoriginalTree _returningIoriginalTree
_lhsOoriginalTree =
_originalTree
_tableOcat =
_lhsIcat
_tableOidenv =
_lhsIidenv
_tableOlib =
_lib
_assignsOcat =
_lhsIcat
_fromListOcat =
_lhsIcat
_fromListOidenv =
_lhsIidenv
_fromListOlib =
_lib
_whrOcat =
_lhsIcat
_returningOcat =
_lhsIcat
( _tableIannotatedTree,_tableIfixedUpIdentifiersTree,_tableIoriginalTree,_tableItbAnnotatedTree,_tableItbUType) =
table_ _tableOcat _tableOidenv _tableOlib
( _assignsIannotatedTree,_assignsIfixedUpIdentifiersTree,_assignsIoriginalTree) =
assigns_ _assignsOcat _assignsOidenv _assignsOlib _assignsOtbName
( _fromListIannotatedTree,_fromListIfixedUpIdentifiersTree,_fromListIlibUpdates,_fromListInewLib2,_fromListIoriginalTree,_fromListItrefIDs) =
fromList_ _fromListOcat _fromListOidenv _fromListOlib
( _whrIannotatedTree,_whrIfixedUpIdentifiersTree,_whrIoriginalTree) =
whr_ _whrOcat _whrOidenv _whrOlib
( _returningIannotatedTree,_returningIfixedUpIdentifiersTree,_returningIlistType,_returningIoriginalTree) =
returning_ _returningOcat _returningOidenv _returningOlib
in ( _lhsOannotatedTree,_lhsOcatUpdates,_lhsOfixedUpIdentifiersTree,_lhsOlibUpdates,_lhsOoriginalTree)))
sem_Statement_WhileStatement :: Annotation ->
(Maybe String) ->
T_ScalarExpr ->
T_StatementList ->
T_Statement
sem_Statement_WhileStatement ann_ lb_ expr_ sts_ =
(\ _lhsIcat
_lhsIidenv
_lhsIinProducedCat
_lhsIlib ->
(let _lhsOcatUpdates :: ([CatalogUpdate])
_lhsOlibUpdates :: ([LocalBindingsUpdate])
_stsOcatUpdates :: ([CatalogUpdate])
_stsOlibUpdates :: ([LocalBindingsUpdate])
_exprOexpectedType :: (Maybe Type)
_lhsOannotatedTree :: Statement
_lhsOfixedUpIdentifiersTree :: Statement
_lhsOoriginalTree :: Statement
_exprOcat :: Catalog
_exprOidenv :: IDEnv
_exprOlib :: LocalBindings
_stsOcat :: Catalog
_stsOidenv :: IDEnv
_stsOlib :: LocalBindings
_exprIannotatedTree :: ScalarExpr
_exprIfixedUpIdentifiersTree :: ScalarExpr
_exprIoriginalTree :: ScalarExpr
_exprIuType :: (Maybe Type)
_stsIannotatedTree :: StatementList
_stsIfixedUpIdentifiersTree :: StatementList
_stsIoriginalTree :: StatementList
_stsIproducedCat :: Catalog
_stsIproducedLib :: LocalBindings
_lhsOcatUpdates =
[]
_lhsOlibUpdates =
[]
_stsOcatUpdates =
[]
_stsOlibUpdates =
[]
_exprOexpectedType =
Nothing
_annotatedTree =
WhileStatement ann_ lb_ _exprIannotatedTree _stsIannotatedTree
_fixedUpIdentifiersTree =
WhileStatement ann_ lb_ _exprIfixedUpIdentifiersTree _stsIfixedUpIdentifiersTree
_originalTree =
WhileStatement ann_ lb_ _exprIoriginalTree _stsIoriginalTree
_lhsOannotatedTree =
_annotatedTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
_exprOcat =
_lhsIcat
_exprOidenv =
_lhsIidenv
_exprOlib =
_lhsIlib
_stsOcat =
_lhsIcat
_stsOidenv =
_lhsIidenv
_stsOlib =
_lhsIlib
( _exprIannotatedTree,_exprIfixedUpIdentifiersTree,_exprIoriginalTree,_exprIuType) =
expr_ _exprOcat _exprOexpectedType _exprOidenv _exprOlib
( _stsIannotatedTree,_stsIfixedUpIdentifiersTree,_stsIoriginalTree,_stsIproducedCat,_stsIproducedLib) =
sts_ _stsOcat _stsOcatUpdates _stsOidenv _stsOlib _stsOlibUpdates
in ( _lhsOannotatedTree,_lhsOcatUpdates,_lhsOfixedUpIdentifiersTree,_lhsOlibUpdates,_lhsOoriginalTree)))
type StatementList = [Statement ]
sem_StatementList :: StatementList ->
T_StatementList
sem_StatementList list =
(Prelude.foldr sem_StatementList_Cons sem_StatementList_Nil (Prelude.map sem_Statement list) )
type T_StatementList = Catalog ->
([CatalogUpdate]) ->
IDEnv ->
LocalBindings ->
([LocalBindingsUpdate]) ->
( StatementList ,StatementList ,StatementList ,Catalog,LocalBindings)
data Inh_StatementList = Inh_StatementList {cat_Inh_StatementList :: Catalog,catUpdates_Inh_StatementList :: ([CatalogUpdate]),idenv_Inh_StatementList :: IDEnv,lib_Inh_StatementList :: LocalBindings,libUpdates_Inh_StatementList :: ([LocalBindingsUpdate])}
data Syn_StatementList = Syn_StatementList {annotatedTree_Syn_StatementList :: StatementList ,fixedUpIdentifiersTree_Syn_StatementList :: StatementList ,originalTree_Syn_StatementList :: StatementList ,producedCat_Syn_StatementList :: Catalog,producedLib_Syn_StatementList :: LocalBindings}
wrap_StatementList :: T_StatementList ->
Inh_StatementList ->
Syn_StatementList
wrap_StatementList sem (Inh_StatementList _lhsIcat _lhsIcatUpdates _lhsIidenv _lhsIlib _lhsIlibUpdates ) =
(let ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree,_lhsOproducedCat,_lhsOproducedLib) = sem _lhsIcat _lhsIcatUpdates _lhsIidenv _lhsIlib _lhsIlibUpdates
in (Syn_StatementList _lhsOannotatedTree _lhsOfixedUpIdentifiersTree _lhsOoriginalTree _lhsOproducedCat _lhsOproducedLib ))
sem_StatementList_Cons :: T_Statement ->
T_StatementList ->
T_StatementList
sem_StatementList_Cons hd_ tl_ =
(\ _lhsIcat
_lhsIcatUpdates
_lhsIidenv
_lhsIlib
_lhsIlibUpdates ->
(let _hdOcat :: Catalog
_tlOcat :: Catalog
_hdOlib :: LocalBindings
_tlOlib :: LocalBindings
_lhsOproducedCat :: Catalog
_lhsOproducedLib :: LocalBindings
_tlOcatUpdates :: ([CatalogUpdate])
_tlOlibUpdates :: ([LocalBindingsUpdate])
_hdOinProducedCat :: Catalog
_lhsOannotatedTree :: StatementList
_lhsOfixedUpIdentifiersTree :: StatementList
_lhsOoriginalTree :: StatementList
_hdOidenv :: IDEnv
_tlOidenv :: IDEnv
_hdIannotatedTree :: Statement
_hdIcatUpdates :: ([CatalogUpdate])
_hdIfixedUpIdentifiersTree :: Statement
_hdIlibUpdates :: ([LocalBindingsUpdate])
_hdIoriginalTree :: Statement
_tlIannotatedTree :: StatementList
_tlIfixedUpIdentifiersTree :: StatementList
_tlIoriginalTree :: StatementList
_tlIproducedCat :: Catalog
_tlIproducedLib :: LocalBindings
_newCat =
fromRight _lhsIcat $ updateCatalog _lhsIcat _lhsIcatUpdates
_newLib =
fromRight _lhsIlib $ foldM (flip $ lbUpdate _lhsIcat) _lhsIlib _lhsIlibUpdates
_hdOcat =
_newCat
_tlOcat =
_newCat
_hdOlib =
_newLib
_tlOlib =
_newLib
_lhsOproducedCat =
_tlIproducedCat
_lhsOproducedLib =
_tlIproducedLib
_tlOcatUpdates =
_hdIcatUpdates
_tlOlibUpdates =
_hdIlibUpdates
_hdOinProducedCat =
_tlIproducedCat
_annotatedTree =
(:) _hdIannotatedTree _tlIannotatedTree
_fixedUpIdentifiersTree =
(:) _hdIfixedUpIdentifiersTree _tlIfixedUpIdentifiersTree
_originalTree =
(:) _hdIoriginalTree _tlIoriginalTree
_lhsOannotatedTree =
_annotatedTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
_hdOidenv =
_lhsIidenv
_tlOidenv =
_lhsIidenv
( _hdIannotatedTree,_hdIcatUpdates,_hdIfixedUpIdentifiersTree,_hdIlibUpdates,_hdIoriginalTree) =
hd_ _hdOcat _hdOidenv _hdOinProducedCat _hdOlib
( _tlIannotatedTree,_tlIfixedUpIdentifiersTree,_tlIoriginalTree,_tlIproducedCat,_tlIproducedLib) =
tl_ _tlOcat _tlOcatUpdates _tlOidenv _tlOlib _tlOlibUpdates
in ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree,_lhsOproducedCat,_lhsOproducedLib)))
sem_StatementList_Nil :: T_StatementList
sem_StatementList_Nil =
(\ _lhsIcat
_lhsIcatUpdates
_lhsIidenv
_lhsIlib
_lhsIlibUpdates ->
(let _lhsOproducedCat :: Catalog
_lhsOproducedLib :: LocalBindings
_lhsOannotatedTree :: StatementList
_lhsOfixedUpIdentifiersTree :: StatementList
_lhsOoriginalTree :: StatementList
_newCat =
fromRight _lhsIcat $ updateCatalog _lhsIcat _lhsIcatUpdates
_newLib =
fromRight _lhsIlib $ foldM (flip $ lbUpdate _lhsIcat) _lhsIlib _lhsIlibUpdates
_lhsOproducedCat =
_newCat
_lhsOproducedLib =
_newLib
_annotatedTree =
[]
_fixedUpIdentifiersTree =
[]
_originalTree =
[]
_lhsOannotatedTree =
_annotatedTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
in ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree,_lhsOproducedCat,_lhsOproducedLib)))
data TableAlias = FullAlias (Annotation) (NameComponent) (([NameComponent]))
| NoAlias (Annotation)
| TableAlias (Annotation) (NameComponent)
deriving ( Data,Eq,Show,Typeable)
sem_TableAlias :: TableAlias ->
T_TableAlias
sem_TableAlias (FullAlias _ann _tb _cols ) =
(sem_TableAlias_FullAlias _ann _tb _cols )
sem_TableAlias (NoAlias _ann ) =
(sem_TableAlias_NoAlias _ann )
sem_TableAlias (TableAlias _ann _tb ) =
(sem_TableAlias_TableAlias _ann _tb )
type T_TableAlias = Catalog ->
(Maybe Int) ->
IDEnv ->
LocalBindings ->
( TableAlias ,TableAlias ,TableAlias )
data Inh_TableAlias = Inh_TableAlias {cat_Inh_TableAlias :: Catalog,expectedNumCols_Inh_TableAlias :: (Maybe Int),idenv_Inh_TableAlias :: IDEnv,lib_Inh_TableAlias :: LocalBindings}
data Syn_TableAlias = Syn_TableAlias {annotatedTree_Syn_TableAlias :: TableAlias ,fixedUpIdentifiersTree_Syn_TableAlias :: TableAlias ,originalTree_Syn_TableAlias :: TableAlias }
wrap_TableAlias :: T_TableAlias ->
Inh_TableAlias ->
Syn_TableAlias
wrap_TableAlias sem (Inh_TableAlias _lhsIcat _lhsIexpectedNumCols _lhsIidenv _lhsIlib ) =
(let ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree) = sem _lhsIcat _lhsIexpectedNumCols _lhsIidenv _lhsIlib
in (Syn_TableAlias _lhsOannotatedTree _lhsOfixedUpIdentifiersTree _lhsOoriginalTree ))
sem_TableAlias_FullAlias :: Annotation ->
NameComponent ->
([NameComponent]) ->
T_TableAlias
sem_TableAlias_FullAlias ann_ tb_ cols_ =
(\ _lhsIcat
_lhsIexpectedNumCols
_lhsIidenv
_lhsIlib ->
(let _lhsOannotatedTree :: TableAlias
_lhsOfixedUpIdentifiersTree :: TableAlias
_lhsOoriginalTree :: TableAlias
_lhsOannotatedTree =
addTypeErrors _errs _backTree
_errs =
case _lhsIexpectedNumCols of
Nothing -> []
Just n -> if n == length cols_
then []
else [WrongNumberOfAliasCols n $ length cols_]
_backTree =
FullAlias ann_ tb_ cols_
_annotatedTree =
FullAlias ann_ tb_ cols_
_fixedUpIdentifiersTree =
FullAlias ann_ tb_ cols_
_originalTree =
FullAlias ann_ tb_ cols_
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
in ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree)))
sem_TableAlias_NoAlias :: Annotation ->
T_TableAlias
sem_TableAlias_NoAlias ann_ =
(\ _lhsIcat
_lhsIexpectedNumCols
_lhsIidenv
_lhsIlib ->
(let _lhsOannotatedTree :: TableAlias
_lhsOfixedUpIdentifiersTree :: TableAlias
_lhsOoriginalTree :: TableAlias
_lhsOannotatedTree =
addTypeErrors _errs _backTree
_backTree =
NoAlias ann_
_errs =
[]
_annotatedTree =
NoAlias ann_
_fixedUpIdentifiersTree =
NoAlias ann_
_originalTree =
NoAlias ann_
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
in ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree)))
sem_TableAlias_TableAlias :: Annotation ->
NameComponent ->
T_TableAlias
sem_TableAlias_TableAlias ann_ tb_ =
(\ _lhsIcat
_lhsIexpectedNumCols
_lhsIidenv
_lhsIlib ->
(let _lhsOannotatedTree :: TableAlias
_lhsOfixedUpIdentifiersTree :: TableAlias
_lhsOoriginalTree :: TableAlias
_lhsOannotatedTree =
addTypeErrors _errs _backTree
_backTree =
TableAlias ann_ tb_
_errs =
[]
_annotatedTree =
TableAlias ann_ tb_
_fixedUpIdentifiersTree =
TableAlias ann_ tb_
_originalTree =
TableAlias ann_ tb_
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
in ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree)))
data TableRef = FunTref (Annotation) (ScalarExpr ) (TableAlias )
| JoinTref (Annotation) (TableRef ) (Natural) (JoinType) (TableRef ) (OnExpr ) (TableAlias )
| SubTref (Annotation) (QueryExpr ) (TableAlias )
| Tref (Annotation) (Name ) (TableAlias )
deriving ( Data,Eq,Show,Typeable)
sem_TableRef :: TableRef ->
T_TableRef
sem_TableRef (FunTref _ann _fn _alias ) =
(sem_TableRef_FunTref _ann (sem_ScalarExpr _fn ) (sem_TableAlias _alias ) )
sem_TableRef (JoinTref _ann _tbl _nat _joinType _tbl1 _onExpr _alias ) =
(sem_TableRef_JoinTref _ann (sem_TableRef _tbl ) _nat _joinType (sem_TableRef _tbl1 ) (sem_OnExpr _onExpr ) (sem_TableAlias _alias ) )
sem_TableRef (SubTref _ann _sel _alias ) =
(sem_TableRef_SubTref _ann (sem_QueryExpr _sel ) (sem_TableAlias _alias ) )
sem_TableRef (Tref _ann _tbl _alias ) =
(sem_TableRef_Tref _ann (sem_Name _tbl ) (sem_TableAlias _alias ) )
type T_TableRef = Catalog ->
IDEnv ->
LocalBindings ->
( TableRef ,TableRef ,([LocalBindingsUpdate]),LocalBindings,TableRef ,IDEnv)
data Inh_TableRef = Inh_TableRef {cat_Inh_TableRef :: Catalog,idenv_Inh_TableRef :: IDEnv,lib_Inh_TableRef :: LocalBindings}
data Syn_TableRef = Syn_TableRef {annotatedTree_Syn_TableRef :: TableRef ,fixedUpIdentifiersTree_Syn_TableRef :: TableRef ,libUpdates_Syn_TableRef :: ([LocalBindingsUpdate]),newLib2_Syn_TableRef :: LocalBindings,originalTree_Syn_TableRef :: TableRef ,trefIDs_Syn_TableRef :: IDEnv}
wrap_TableRef :: T_TableRef ->
Inh_TableRef ->
Syn_TableRef
wrap_TableRef sem (Inh_TableRef _lhsIcat _lhsIidenv _lhsIlib ) =
(let ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOlibUpdates,_lhsOnewLib2,_lhsOoriginalTree,_lhsOtrefIDs) = sem _lhsIcat _lhsIidenv _lhsIlib
in (Syn_TableRef _lhsOannotatedTree _lhsOfixedUpIdentifiersTree _lhsOlibUpdates _lhsOnewLib2 _lhsOoriginalTree _lhsOtrefIDs ))
sem_TableRef_FunTref :: Annotation ->
T_ScalarExpr ->
T_TableAlias ->
T_TableRef
sem_TableRef_FunTref ann_ fn_ alias_ =
(\ _lhsIcat
_lhsIidenv
_lhsIlib ->
(let __tup2 :: ((IDEnv,TableRef))
_lhsOtrefIDs :: IDEnv
_lhsOfixedUpIdentifiersTree :: TableRef
_lhsOannotatedTree :: TableRef
_eqfunIdens :: (Either [TypeError] (String,[(String,Type)]))
_lhsOlibUpdates :: ([LocalBindingsUpdate])
_lhsOnewLib2 :: LocalBindings
_aliasOexpectedNumCols :: (Maybe Int)
_fnOexpectedType :: (Maybe Type)
_lhsOoriginalTree :: TableRef
_fnOcat :: Catalog
_fnOidenv :: IDEnv
_fnOlib :: LocalBindings
_aliasOcat :: Catalog
_aliasOidenv :: IDEnv
_aliasOlib :: LocalBindings
_fnIannotatedTree :: ScalarExpr
_fnIfixedUpIdentifiersTree :: ScalarExpr
_fnIoriginalTree :: ScalarExpr
_fnIuType :: (Maybe Type)
_aliasIannotatedTree :: TableAlias
_aliasIfixedUpIdentifiersTree :: TableAlias
_aliasIoriginalTree :: TableAlias
__tup2 =
let (FunCall _ f _) = _fnIoriginalTree
iea = aliasEnv _aliasIoriginalTree $ FunTrefIDEnv $ getTName f
al = getEnvAlias iea
in (iea, FunTref ann_ _fnIfixedUpIdentifiersTree al)
(_lhsOtrefIDs,_) =
__tup2
(_,_lhsOfixedUpIdentifiersTree) =
__tup2
_lhsOannotatedTree =
addTypeErrors _errs _backTree
_errs =
case _eqfunIdens of
Left e -> e
Right _ -> []
_eqfunIdens =
funIdens _lhsIcat _aliasIoriginalTree _fnIannotatedTree _fnIuType
_lhsOlibUpdates =
[LBTref "fn"
(fst _qfunIdens )
(snd _qfunIdens )
[]]
_qfunIdens =
fromRight ("",[]) _eqfunIdens
_lhsOnewLib2 =
createLocalBindings $ do
(t,cs) <- etmt $ funIdens _lhsIcat _aliasIoriginalTree _fnIannotatedTree _fnIuType
return [(t,map (second Just) cs)]
_backTree =
FunTref ann_ _fnIannotatedTree _aliasIannotatedTree
_aliasOexpectedNumCols =
Nothing
_fnOexpectedType =
Nothing
_annotatedTree =
FunTref ann_ _fnIannotatedTree _aliasIannotatedTree
_fixedUpIdentifiersTree =
FunTref ann_ _fnIfixedUpIdentifiersTree _aliasIfixedUpIdentifiersTree
_originalTree =
FunTref ann_ _fnIoriginalTree _aliasIoriginalTree
_lhsOoriginalTree =
_originalTree
_fnOcat =
_lhsIcat
_fnOidenv =
_lhsIidenv
_fnOlib =
_lhsIlib
_aliasOcat =
_lhsIcat
_aliasOidenv =
_lhsIidenv
_aliasOlib =
_lhsIlib
( _fnIannotatedTree,_fnIfixedUpIdentifiersTree,_fnIoriginalTree,_fnIuType) =
fn_ _fnOcat _fnOexpectedType _fnOidenv _fnOlib
( _aliasIannotatedTree,_aliasIfixedUpIdentifiersTree,_aliasIoriginalTree) =
alias_ _aliasOcat _aliasOexpectedNumCols _aliasOidenv _aliasOlib
in ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOlibUpdates,_lhsOnewLib2,_lhsOoriginalTree,_lhsOtrefIDs)))
sem_TableRef_JoinTref :: Annotation ->
T_TableRef ->
Natural ->
JoinType ->
T_TableRef ->
T_OnExpr ->
T_TableAlias ->
T_TableRef
sem_TableRef_JoinTref ann_ tbl_ nat_ joinType_ tbl1_ onExpr_ alias_ =
(\ _lhsIcat
_lhsIidenv
_lhsIlib ->
(let _lhsOtrefIDs :: IDEnv
_onExprOidenv :: IDEnv
_lhsOfixedUpIdentifiersTree :: TableRef
_lhsOannotatedTree :: TableRef
_lhsOlibUpdates :: ([LocalBindingsUpdate])
_newLib :: (Either [TypeError] LocalBindings)
_lhsOnewLib2 :: LocalBindings
_onExprOlib :: LocalBindings
_aliasOexpectedNumCols :: (Maybe Int)
_lhsOoriginalTree :: TableRef
_tblOcat :: Catalog
_tblOidenv :: IDEnv
_tblOlib :: LocalBindings
_tbl1Ocat :: Catalog
_tbl1Oidenv :: IDEnv
_tbl1Olib :: LocalBindings
_onExprOcat :: Catalog
_aliasOcat :: Catalog
_aliasOidenv :: IDEnv
_aliasOlib :: LocalBindings
_tblIannotatedTree :: TableRef
_tblIfixedUpIdentifiersTree :: TableRef
_tblIlibUpdates :: ([LocalBindingsUpdate])
_tblInewLib2 :: LocalBindings
_tblIoriginalTree :: TableRef
_tblItrefIDs :: IDEnv
_tbl1IannotatedTree :: TableRef
_tbl1IfixedUpIdentifiersTree :: TableRef
_tbl1IlibUpdates :: ([LocalBindingsUpdate])
_tbl1InewLib2 :: LocalBindings
_tbl1IoriginalTree :: TableRef
_tbl1ItrefIDs :: IDEnv
_onExprIannotatedTree :: OnExpr
_onExprIfixedUpIdentifiersTree :: OnExpr
_onExprIoriginalTree :: OnExpr
_aliasIannotatedTree :: TableAlias
_aliasIfixedUpIdentifiersTree :: TableAlias
_aliasIoriginalTree :: TableAlias
_lhsOtrefIDs =
_trefIDs
_onExprOidenv =
_trefIDs
__tup3 =
let t0ids = maybe [] id $ fmap (map snd) $ expandStar _tblItrefIDs Nothing
t1ids = maybe [] id $ fmap (map snd) $ expandStar _tbl1ItrefIDs Nothing
jids :: [String]
jids = case (nat_,_onExprIoriginalTree) of
(Natural,_) -> intersect t0ids t1ids
(_,Just (JoinUsing _ fs)) -> map ncStr fs
_ -> []
iea = aliasEnv _aliasIoriginalTree
$ JoinTrefIDEnv jids _tblItrefIDs _tbl1ItrefIDs
al = getEnvAlias iea
in (iea, JoinTref ann_ _tblIfixedUpIdentifiersTree
nat_ joinType_ _tbl1IfixedUpIdentifiersTree
_onExprIfixedUpIdentifiersTree al)
(_trefIDs,_) =
__tup3
(_,_lhsOfixedUpIdentifiersTree) =
__tup3
_lhsOannotatedTree =
addTypeErrors _errs _backTree
_errs =
fromLeft [] _newLib
++ _joinErrors
_lhsOlibUpdates =
if _joinErrors == []
then _libUpdates
else []
_joinErrors =
fromLeft [] (foldM (flip $ lbUpdate _lhsIcat) _lhsIlib _libUpdates )
_libUpdates =
case (_tblIlibUpdates, _tbl1IlibUpdates) of
([u1], [u2]) -> [LBJoinTref "join" u1 u2 jids
(case _aliasIoriginalTree of
NoAlias _ -> Nothing
TableAlias _ t -> Just $ ncStr t
FullAlias _ t _ -> Just $ ncStr t)]
_ -> []
where
jids = case (nat_, _onExprIoriginalTree) of
(Natural, _) -> Left ()
(_,Just (JoinUsing _ s)) -> Right $ map ncStr s
_ -> Right []
_newLib =
case (_tblIlibUpdates, _tbl1IlibUpdates) of
([u1],[u2]) -> lbUpdate _lhsIcat
(LBJoinTref "join" u1 u2 (Right []) Nothing) _lhsIlib
_ -> Right _lhsIlib
_newLib2 =
let t0t :: [(String,Maybe Type)]
t0t = getUnqualifiedBindings _tblInewLib2
t1t = getUnqualifiedBindings _tbl1InewLib2
in case _aliasIoriginalTree of
(FullAlias _ n cs) ->
createLocalBindings $ Just [(ncStr n,zip (map ncStr cs) $ map snd (t0t ++ t1t))]
(TableAlias _ n) ->
createLocalBindings $ Just [(ncStr n, t0t ++ t1t)]
NoAlias _ ->
joinBindings _tblInewLib2 _tbl1InewLib2
_lhsOnewLib2 =
_newLib2
_onExprOlib =
_newLib2
_backTree =
JoinTref ann_
_tblIannotatedTree
nat_
joinType_
_tbl1IannotatedTree
_onExprIannotatedTree
_aliasIannotatedTree
_aliasOexpectedNumCols =
Nothing
_annotatedTree =
JoinTref ann_ _tblIannotatedTree nat_ joinType_ _tbl1IannotatedTree _onExprIannotatedTree _aliasIannotatedTree
_fixedUpIdentifiersTree =
JoinTref ann_ _tblIfixedUpIdentifiersTree nat_ joinType_ _tbl1IfixedUpIdentifiersTree _onExprIfixedUpIdentifiersTree _aliasIfixedUpIdentifiersTree
_originalTree =
JoinTref ann_ _tblIoriginalTree nat_ joinType_ _tbl1IoriginalTree _onExprIoriginalTree _aliasIoriginalTree
_lhsOoriginalTree =
_originalTree
_tblOcat =
_lhsIcat
_tblOidenv =
_lhsIidenv
_tblOlib =
_lhsIlib
_tbl1Ocat =
_lhsIcat
_tbl1Oidenv =
_lhsIidenv
_tbl1Olib =
_lhsIlib
_onExprOcat =
_lhsIcat
_aliasOcat =
_lhsIcat
_aliasOidenv =
_lhsIidenv
_aliasOlib =
_lhsIlib
( _tblIannotatedTree,_tblIfixedUpIdentifiersTree,_tblIlibUpdates,_tblInewLib2,_tblIoriginalTree,_tblItrefIDs) =
tbl_ _tblOcat _tblOidenv _tblOlib
( _tbl1IannotatedTree,_tbl1IfixedUpIdentifiersTree,_tbl1IlibUpdates,_tbl1InewLib2,_tbl1IoriginalTree,_tbl1ItrefIDs) =
tbl1_ _tbl1Ocat _tbl1Oidenv _tbl1Olib
( _onExprIannotatedTree,_onExprIfixedUpIdentifiersTree,_onExprIoriginalTree) =
onExpr_ _onExprOcat _onExprOidenv _onExprOlib
( _aliasIannotatedTree,_aliasIfixedUpIdentifiersTree,_aliasIoriginalTree) =
alias_ _aliasOcat _aliasOexpectedNumCols _aliasOidenv _aliasOlib
in ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOlibUpdates,_lhsOnewLib2,_lhsOoriginalTree,_lhsOtrefIDs)))
sem_TableRef_SubTref :: Annotation ->
T_QueryExpr ->
T_TableAlias ->
T_TableRef
sem_TableRef_SubTref ann_ sel_ alias_ =
(\ _lhsIcat
_lhsIidenv
_lhsIlib ->
(let __tup4 :: ((IDEnv,TableRef))
_lhsOtrefIDs :: IDEnv
_lhsOfixedUpIdentifiersTree :: TableRef
_selOcsql :: LocalBindings
_lhsOannotatedTree :: TableRef
_selectAttrs :: (Either [TypeError] [(String,Type)])
_lhsOlibUpdates :: ([LocalBindingsUpdate])
_lhsOnewLib2 :: LocalBindings
_aliasOexpectedNumCols :: (Maybe Int)
_selOexpectedTypes :: ([Maybe Type])
_lhsOoriginalTree :: TableRef
_selOcat :: Catalog
_selOidenv :: IDEnv
_selOlib :: LocalBindings
_aliasOcat :: Catalog
_aliasOidenv :: IDEnv
_aliasOlib :: LocalBindings
_selIannotatedTree :: QueryExpr
_selIcidenv :: IDEnv
_selIfixedUpIdentifiersTree :: QueryExpr
_selIlibUpdates :: ([LocalBindingsUpdate])
_selIoriginalTree :: QueryExpr
_selIuType :: (Maybe [(String,Type)])
_aliasIannotatedTree :: TableAlias
_aliasIfixedUpIdentifiersTree :: TableAlias
_aliasIoriginalTree :: TableAlias
__tup4 =
let iea = aliasEnv _aliasIoriginalTree _selIcidenv
al = getEnvAlias iea
in (iea, SubTref ann_ _selIfixedUpIdentifiersTree al)
(_lhsOtrefIDs,_) =
__tup4
(_,_lhsOfixedUpIdentifiersTree) =
__tup4
_selOcsql =
emptyBindings
_lhsOannotatedTree =
addTypeErrors _errs _backTree
_errs =
case _selectAttrs of
Left e -> e
Right _ -> []
_selectAttrs =
lmt _selIuType
_lhsOlibUpdates =
[LBTref "sub query" (getAlias "" _aliasIoriginalTree)
(fromRight [] _selectAttrs ) []]
_lhsOnewLib2 =
createLocalBindings $ do
pu <- _selIuType
let (n,cs) = case _aliasIoriginalTree of
(FullAlias _ n cs) -> (ncStr n,map ncStr cs)
_ -> (n, [])
return [(n,zip cs $ map (Just . snd) pu)]
_backTree =
SubTref ann_ _selIannotatedTree _aliasIannotatedTree
_aliasOexpectedNumCols =
Nothing
_selOexpectedTypes =
[]
_annotatedTree =
SubTref ann_ _selIannotatedTree _aliasIannotatedTree
_fixedUpIdentifiersTree =
SubTref ann_ _selIfixedUpIdentifiersTree _aliasIfixedUpIdentifiersTree
_originalTree =
SubTref ann_ _selIoriginalTree _aliasIoriginalTree
_lhsOoriginalTree =
_originalTree
_selOcat =
_lhsIcat
_selOidenv =
_lhsIidenv
_selOlib =
_lhsIlib
_aliasOcat =
_lhsIcat
_aliasOidenv =
_lhsIidenv
_aliasOlib =
_lhsIlib
( _selIannotatedTree,_selIcidenv,_selIfixedUpIdentifiersTree,_selIlibUpdates,_selIoriginalTree,_selIuType) =
sel_ _selOcat _selOcsql _selOexpectedTypes _selOidenv _selOlib
( _aliasIannotatedTree,_aliasIfixedUpIdentifiersTree,_aliasIoriginalTree) =
alias_ _aliasOcat _aliasOexpectedNumCols _aliasOidenv _aliasOlib
in ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOlibUpdates,_lhsOnewLib2,_lhsOoriginalTree,_lhsOtrefIDs)))
sem_TableRef_Tref :: Annotation ->
T_Name ->
T_TableAlias ->
T_TableRef
sem_TableRef_Tref ann_ tbl_ alias_ =
(\ _lhsIcat
_lhsIidenv
_lhsIlib ->
(let __tup5 :: ((IDEnv,TableRef))
_lhsOtrefIDs :: IDEnv
_lhsOfixedUpIdentifiersTree :: TableRef
_lhsOannotatedTree :: TableRef
_lhsOlibUpdates :: ([LocalBindingsUpdate])
_lhsOnewLib2 :: LocalBindings
_aliasOexpectedNumCols :: (Maybe Int)
_lhsOoriginalTree :: TableRef
_tblOcat :: Catalog
_tblOidenv :: IDEnv
_tblOlib :: LocalBindings
_aliasOcat :: Catalog
_aliasOidenv :: IDEnv
_aliasOlib :: LocalBindings
_tblIannotatedTree :: Name
_tblIfixedUpIdentifiersTree :: Name
_tblIoriginalTree :: Name
_tblItbAnnotatedTree :: Name
_tblItbUType :: (Maybe ([(String,Type)],[(String,Type)]))
_aliasIannotatedTree :: TableAlias
_aliasIfixedUpIdentifiersTree :: TableAlias
_aliasIoriginalTree :: TableAlias
__tup5 =
let iea = aliasEnv _aliasIoriginalTree $ getTableTrefEnv _lhsIcat _tblIoriginalTree
al = getEnvAlias iea
in (iea,Tref ann_ _tblIfixedUpIdentifiersTree al)
(_lhsOtrefIDs,_) =
__tup5
(_,_lhsOfixedUpIdentifiersTree) =
__tup5
_lhsOannotatedTree =
addTypeErrors _errs _backTree
_errs =
[]
_lhsOlibUpdates =
maybe [] id $ do
let n = getTName _tblIannotatedTree
(pu,pr) <- _tblItbUType
return [LBTref ("tref: " ++ n)
(getAlias n _aliasIoriginalTree)
pu
pr]
_lhsOnewLib2 =
createLocalBindings $ do
let n = getTName _tblIannotatedTree
(pu,pr) <- _tblItbUType
let (n,cs) = case _aliasIoriginalTree of
(FullAlias _ n cs) -> (ncStr n,map ncStr cs)
_ -> (n, [])
return [(n,zip cs $ map (Just . snd) pu)
,(n,map (second Just) pr)]
_backTree =
Tref ann_ _tblItbAnnotatedTree _aliasIannotatedTree
_aliasOexpectedNumCols =
do
let n = getTName _tblIannotatedTree
(pu,_) <- _tblItbUType
return $ length pu
_annotatedTree =
Tref ann_ _tblIannotatedTree _aliasIannotatedTree
_fixedUpIdentifiersTree =
Tref ann_ _tblIfixedUpIdentifiersTree _aliasIfixedUpIdentifiersTree
_originalTree =
Tref ann_ _tblIoriginalTree _aliasIoriginalTree
_lhsOoriginalTree =
_originalTree
_tblOcat =
_lhsIcat
_tblOidenv =
_lhsIidenv
_tblOlib =
_lhsIlib
_aliasOcat =
_lhsIcat
_aliasOidenv =
_lhsIidenv
_aliasOlib =
_lhsIlib
( _tblIannotatedTree,_tblIfixedUpIdentifiersTree,_tblIoriginalTree,_tblItbAnnotatedTree,_tblItbUType) =
tbl_ _tblOcat _tblOidenv _tblOlib
( _aliasIannotatedTree,_aliasIfixedUpIdentifiersTree,_aliasIoriginalTree) =
alias_ _aliasOcat _aliasOexpectedNumCols _aliasOidenv _aliasOlib
in ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOlibUpdates,_lhsOnewLib2,_lhsOoriginalTree,_lhsOtrefIDs)))
type TableRefList = [TableRef ]
sem_TableRefList :: TableRefList ->
T_TableRefList
sem_TableRefList list =
(Prelude.foldr sem_TableRefList_Cons sem_TableRefList_Nil (Prelude.map sem_TableRef list) )
type T_TableRefList = Catalog ->
IDEnv ->
LocalBindings ->
( TableRefList ,TableRefList ,([LocalBindingsUpdate]),LocalBindings,TableRefList ,IDEnv)
data Inh_TableRefList = Inh_TableRefList {cat_Inh_TableRefList :: Catalog,idenv_Inh_TableRefList :: IDEnv,lib_Inh_TableRefList :: LocalBindings}
data Syn_TableRefList = Syn_TableRefList {annotatedTree_Syn_TableRefList :: TableRefList ,fixedUpIdentifiersTree_Syn_TableRefList :: TableRefList ,libUpdates_Syn_TableRefList :: ([LocalBindingsUpdate]),newLib2_Syn_TableRefList :: LocalBindings,originalTree_Syn_TableRefList :: TableRefList ,trefIDs_Syn_TableRefList :: IDEnv}
wrap_TableRefList :: T_TableRefList ->
Inh_TableRefList ->
Syn_TableRefList
wrap_TableRefList sem (Inh_TableRefList _lhsIcat _lhsIidenv _lhsIlib ) =
(let ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOlibUpdates,_lhsOnewLib2,_lhsOoriginalTree,_lhsOtrefIDs) = sem _lhsIcat _lhsIidenv _lhsIlib
in (Syn_TableRefList _lhsOannotatedTree _lhsOfixedUpIdentifiersTree _lhsOlibUpdates _lhsOnewLib2 _lhsOoriginalTree _lhsOtrefIDs ))
sem_TableRefList_Cons :: T_TableRef ->
T_TableRefList ->
T_TableRefList
sem_TableRefList_Cons hd_ tl_ =
(\ _lhsIcat
_lhsIidenv
_lhsIlib ->
(let _lhsOtrefIDs :: IDEnv
_lhsOlibUpdates :: ([LocalBindingsUpdate])
_lhsOnewLib2 :: LocalBindings
_lhsOannotatedTree :: TableRefList
_lhsOfixedUpIdentifiersTree :: TableRefList
_lhsOoriginalTree :: TableRefList
_hdOcat :: Catalog
_hdOidenv :: IDEnv
_hdOlib :: LocalBindings
_tlOcat :: Catalog
_tlOidenv :: IDEnv
_tlOlib :: LocalBindings
_hdIannotatedTree :: TableRef
_hdIfixedUpIdentifiersTree :: TableRef
_hdIlibUpdates :: ([LocalBindingsUpdate])
_hdInewLib2 :: LocalBindings
_hdIoriginalTree :: TableRef
_hdItrefIDs :: IDEnv
_tlIannotatedTree :: TableRefList
_tlIfixedUpIdentifiersTree :: TableRefList
_tlIlibUpdates :: ([LocalBindingsUpdate])
_tlInewLib2 :: LocalBindings
_tlIoriginalTree :: TableRefList
_tlItrefIDs :: IDEnv
_lhsOtrefIDs =
JoinTrefIDEnv [] _hdItrefIDs _tlItrefIDs
_lhsOlibUpdates =
_hdIlibUpdates
_lhsOnewLib2 =
joinBindings _hdInewLib2 _tlInewLib2
_annotatedTree =
(:) _hdIannotatedTree _tlIannotatedTree
_fixedUpIdentifiersTree =
(:) _hdIfixedUpIdentifiersTree _tlIfixedUpIdentifiersTree
_originalTree =
(:) _hdIoriginalTree _tlIoriginalTree
_lhsOannotatedTree =
_annotatedTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
_hdOcat =
_lhsIcat
_hdOidenv =
_lhsIidenv
_hdOlib =
_lhsIlib
_tlOcat =
_lhsIcat
_tlOidenv =
_lhsIidenv
_tlOlib =
_lhsIlib
( _hdIannotatedTree,_hdIfixedUpIdentifiersTree,_hdIlibUpdates,_hdInewLib2,_hdIoriginalTree,_hdItrefIDs) =
hd_ _hdOcat _hdOidenv _hdOlib
( _tlIannotatedTree,_tlIfixedUpIdentifiersTree,_tlIlibUpdates,_tlInewLib2,_tlIoriginalTree,_tlItrefIDs) =
tl_ _tlOcat _tlOidenv _tlOlib
in ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOlibUpdates,_lhsOnewLib2,_lhsOoriginalTree,_lhsOtrefIDs)))
sem_TableRefList_Nil :: T_TableRefList
sem_TableRefList_Nil =
(\ _lhsIcat
_lhsIidenv
_lhsIlib ->
(let _lhsOtrefIDs :: IDEnv
_lhsOlibUpdates :: ([LocalBindingsUpdate])
_lhsOnewLib2 :: LocalBindings
_lhsOannotatedTree :: TableRefList
_lhsOfixedUpIdentifiersTree :: TableRefList
_lhsOoriginalTree :: TableRefList
_lhsOtrefIDs =
emptyIDEnv "empty tref list"
_lhsOlibUpdates =
[]
_lhsOnewLib2 =
createLocalBindings $ Just []
_annotatedTree =
[]
_fixedUpIdentifiersTree =
[]
_originalTree =
[]
_lhsOannotatedTree =
_annotatedTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
in ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOlibUpdates,_lhsOnewLib2,_lhsOoriginalTree,_lhsOtrefIDs)))
data TypeAttributeDef = TypeAttDef (Annotation) (NameComponent) (TypeName )
deriving ( Data,Eq,Show,Typeable)
sem_TypeAttributeDef :: TypeAttributeDef ->
T_TypeAttributeDef
sem_TypeAttributeDef (TypeAttDef _ann _name _typ ) =
(sem_TypeAttributeDef_TypeAttDef _ann _name (sem_TypeName _typ ) )
type T_TypeAttributeDef = Catalog ->
IDEnv ->
LocalBindings ->
( TypeAttributeDef ,String,TypeAttributeDef ,(Maybe Type),TypeAttributeDef )
data Inh_TypeAttributeDef = Inh_TypeAttributeDef {cat_Inh_TypeAttributeDef :: Catalog,idenv_Inh_TypeAttributeDef :: IDEnv,lib_Inh_TypeAttributeDef :: LocalBindings}
data Syn_TypeAttributeDef = Syn_TypeAttributeDef {annotatedTree_Syn_TypeAttributeDef :: TypeAttributeDef ,attrName_Syn_TypeAttributeDef :: String,fixedUpIdentifiersTree_Syn_TypeAttributeDef :: TypeAttributeDef ,namedType_Syn_TypeAttributeDef :: (Maybe Type),originalTree_Syn_TypeAttributeDef :: TypeAttributeDef }
wrap_TypeAttributeDef :: T_TypeAttributeDef ->
Inh_TypeAttributeDef ->
Syn_TypeAttributeDef
wrap_TypeAttributeDef sem (Inh_TypeAttributeDef _lhsIcat _lhsIidenv _lhsIlib ) =
(let ( _lhsOannotatedTree,_lhsOattrName,_lhsOfixedUpIdentifiersTree,_lhsOnamedType,_lhsOoriginalTree) = sem _lhsIcat _lhsIidenv _lhsIlib
in (Syn_TypeAttributeDef _lhsOannotatedTree _lhsOattrName _lhsOfixedUpIdentifiersTree _lhsOnamedType _lhsOoriginalTree ))
sem_TypeAttributeDef_TypeAttDef :: Annotation ->
NameComponent ->
T_TypeName ->
T_TypeAttributeDef
sem_TypeAttributeDef_TypeAttDef ann_ name_ typ_ =
(\ _lhsIcat
_lhsIidenv
_lhsIlib ->
(let _lhsOattrName :: String
_lhsOnamedType :: (Maybe Type)
_lhsOannotatedTree :: TypeAttributeDef
_lhsOfixedUpIdentifiersTree :: TypeAttributeDef
_lhsOoriginalTree :: TypeAttributeDef
_typOcat :: Catalog
_typOidenv :: IDEnv
_typOlib :: LocalBindings
_typIannotatedTree :: TypeName
_typIfixedUpIdentifiersTree :: TypeName
_typInamedType :: (Maybe Type)
_typIoriginalTree :: TypeName
_lhsOattrName =
ncStr name_
_lhsOnamedType =
_typInamedType
_annotatedTree =
TypeAttDef ann_ name_ _typIannotatedTree
_fixedUpIdentifiersTree =
TypeAttDef ann_ name_ _typIfixedUpIdentifiersTree
_originalTree =
TypeAttDef ann_ name_ _typIoriginalTree
_lhsOannotatedTree =
_annotatedTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
_typOcat =
_lhsIcat
_typOidenv =
_lhsIidenv
_typOlib =
_lhsIlib
( _typIannotatedTree,_typIfixedUpIdentifiersTree,_typInamedType,_typIoriginalTree) =
typ_ _typOcat _typOidenv _typOlib
in ( _lhsOannotatedTree,_lhsOattrName,_lhsOfixedUpIdentifiersTree,_lhsOnamedType,_lhsOoriginalTree)))
type TypeAttributeDefList = [TypeAttributeDef ]
sem_TypeAttributeDefList :: TypeAttributeDefList ->
T_TypeAttributeDefList
sem_TypeAttributeDefList list =
(Prelude.foldr sem_TypeAttributeDefList_Cons sem_TypeAttributeDefList_Nil (Prelude.map sem_TypeAttributeDef list) )
type T_TypeAttributeDefList = Catalog ->
IDEnv ->
LocalBindings ->
( TypeAttributeDefList ,([(String, Maybe Type)]),TypeAttributeDefList ,TypeAttributeDefList )
data Inh_TypeAttributeDefList = Inh_TypeAttributeDefList {cat_Inh_TypeAttributeDefList :: Catalog,idenv_Inh_TypeAttributeDefList :: IDEnv,lib_Inh_TypeAttributeDefList :: LocalBindings}
data Syn_TypeAttributeDefList = Syn_TypeAttributeDefList {annotatedTree_Syn_TypeAttributeDefList :: TypeAttributeDefList ,attrs_Syn_TypeAttributeDefList :: ([(String, Maybe Type)]),fixedUpIdentifiersTree_Syn_TypeAttributeDefList :: TypeAttributeDefList ,originalTree_Syn_TypeAttributeDefList :: TypeAttributeDefList }
wrap_TypeAttributeDefList :: T_TypeAttributeDefList ->
Inh_TypeAttributeDefList ->
Syn_TypeAttributeDefList
wrap_TypeAttributeDefList sem (Inh_TypeAttributeDefList _lhsIcat _lhsIidenv _lhsIlib ) =
(let ( _lhsOannotatedTree,_lhsOattrs,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree) = sem _lhsIcat _lhsIidenv _lhsIlib
in (Syn_TypeAttributeDefList _lhsOannotatedTree _lhsOattrs _lhsOfixedUpIdentifiersTree _lhsOoriginalTree ))
sem_TypeAttributeDefList_Cons :: T_TypeAttributeDef ->
T_TypeAttributeDefList ->
T_TypeAttributeDefList
sem_TypeAttributeDefList_Cons hd_ tl_ =
(\ _lhsIcat
_lhsIidenv
_lhsIlib ->
(let _lhsOattrs :: ([(String, Maybe Type)])
_lhsOannotatedTree :: TypeAttributeDefList
_lhsOfixedUpIdentifiersTree :: TypeAttributeDefList
_lhsOoriginalTree :: TypeAttributeDefList
_hdOcat :: Catalog
_hdOidenv :: IDEnv
_hdOlib :: LocalBindings
_tlOcat :: Catalog
_tlOidenv :: IDEnv
_tlOlib :: LocalBindings
_hdIannotatedTree :: TypeAttributeDef
_hdIattrName :: String
_hdIfixedUpIdentifiersTree :: TypeAttributeDef
_hdInamedType :: (Maybe Type)
_hdIoriginalTree :: TypeAttributeDef
_tlIannotatedTree :: TypeAttributeDefList
_tlIattrs :: ([(String, Maybe Type)])
_tlIfixedUpIdentifiersTree :: TypeAttributeDefList
_tlIoriginalTree :: TypeAttributeDefList
_lhsOattrs =
(_hdIattrName, _hdInamedType) : _tlIattrs
_annotatedTree =
(:) _hdIannotatedTree _tlIannotatedTree
_fixedUpIdentifiersTree =
(:) _hdIfixedUpIdentifiersTree _tlIfixedUpIdentifiersTree
_originalTree =
(:) _hdIoriginalTree _tlIoriginalTree
_lhsOannotatedTree =
_annotatedTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
_hdOcat =
_lhsIcat
_hdOidenv =
_lhsIidenv
_hdOlib =
_lhsIlib
_tlOcat =
_lhsIcat
_tlOidenv =
_lhsIidenv
_tlOlib =
_lhsIlib
( _hdIannotatedTree,_hdIattrName,_hdIfixedUpIdentifiersTree,_hdInamedType,_hdIoriginalTree) =
hd_ _hdOcat _hdOidenv _hdOlib
( _tlIannotatedTree,_tlIattrs,_tlIfixedUpIdentifiersTree,_tlIoriginalTree) =
tl_ _tlOcat _tlOidenv _tlOlib
in ( _lhsOannotatedTree,_lhsOattrs,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree)))
sem_TypeAttributeDefList_Nil :: T_TypeAttributeDefList
sem_TypeAttributeDefList_Nil =
(\ _lhsIcat
_lhsIidenv
_lhsIlib ->
(let _lhsOattrs :: ([(String, Maybe Type)])
_lhsOannotatedTree :: TypeAttributeDefList
_lhsOfixedUpIdentifiersTree :: TypeAttributeDefList
_lhsOoriginalTree :: TypeAttributeDefList
_lhsOattrs =
[]
_annotatedTree =
[]
_fixedUpIdentifiersTree =
[]
_originalTree =
[]
_lhsOannotatedTree =
_annotatedTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
in ( _lhsOannotatedTree,_lhsOattrs,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree)))
data TypeName = ArrayTypeName (Annotation) (TypeName )
| Prec2TypeName (Annotation) (String) (Integer) (Integer)
| PrecTypeName (Annotation) (String) (Integer)
| SetOfTypeName (Annotation) (TypeName )
| SimpleTypeName (Annotation) (String)
deriving ( Data,Eq,Show,Typeable)
sem_TypeName :: TypeName ->
T_TypeName
sem_TypeName (ArrayTypeName _ann _typ ) =
(sem_TypeName_ArrayTypeName _ann (sem_TypeName _typ ) )
sem_TypeName (Prec2TypeName _ann _tn _prec _prec1 ) =
(sem_TypeName_Prec2TypeName _ann _tn _prec _prec1 )
sem_TypeName (PrecTypeName _ann _tn _prec ) =
(sem_TypeName_PrecTypeName _ann _tn _prec )
sem_TypeName (SetOfTypeName _ann _typ ) =
(sem_TypeName_SetOfTypeName _ann (sem_TypeName _typ ) )
sem_TypeName (SimpleTypeName _ann _tn ) =
(sem_TypeName_SimpleTypeName _ann _tn )
type T_TypeName = Catalog ->
IDEnv ->
LocalBindings ->
( TypeName ,TypeName ,(Maybe Type),TypeName )
data Inh_TypeName = Inh_TypeName {cat_Inh_TypeName :: Catalog,idenv_Inh_TypeName :: IDEnv,lib_Inh_TypeName :: LocalBindings}
data Syn_TypeName = Syn_TypeName {annotatedTree_Syn_TypeName :: TypeName ,fixedUpIdentifiersTree_Syn_TypeName :: TypeName ,namedType_Syn_TypeName :: (Maybe Type),originalTree_Syn_TypeName :: TypeName }
wrap_TypeName :: T_TypeName ->
Inh_TypeName ->
Syn_TypeName
wrap_TypeName sem (Inh_TypeName _lhsIcat _lhsIidenv _lhsIlib ) =
(let ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOnamedType,_lhsOoriginalTree) = sem _lhsIcat _lhsIidenv _lhsIlib
in (Syn_TypeName _lhsOannotatedTree _lhsOfixedUpIdentifiersTree _lhsOnamedType _lhsOoriginalTree ))
sem_TypeName_ArrayTypeName :: Annotation ->
T_TypeName ->
T_TypeName
sem_TypeName_ArrayTypeName ann_ typ_ =
(\ _lhsIcat
_lhsIidenv
_lhsIlib ->
(let _lhsOnamedType :: (Maybe Type)
_lhsOannotatedTree :: TypeName
_lhsOfixedUpIdentifiersTree :: TypeName
_lhsOoriginalTree :: TypeName
_typOcat :: Catalog
_typOidenv :: IDEnv
_typOlib :: LocalBindings
_typIannotatedTree :: TypeName
_typIfixedUpIdentifiersTree :: TypeName
_typInamedType :: (Maybe Type)
_typIoriginalTree :: TypeName
_lhsOnamedType =
etmt _tpe
_lhsOannotatedTree =
addTypeErrors (tes _tpe ) _backTree
_tpe =
lmt _typInamedType >>= Right . ArrayType
_backTree =
ArrayTypeName ann_ _typIannotatedTree
_annotatedTree =
ArrayTypeName ann_ _typIannotatedTree
_fixedUpIdentifiersTree =
ArrayTypeName ann_ _typIfixedUpIdentifiersTree
_originalTree =
ArrayTypeName ann_ _typIoriginalTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
_typOcat =
_lhsIcat
_typOidenv =
_lhsIidenv
_typOlib =
_lhsIlib
( _typIannotatedTree,_typIfixedUpIdentifiersTree,_typInamedType,_typIoriginalTree) =
typ_ _typOcat _typOidenv _typOlib
in ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOnamedType,_lhsOoriginalTree)))
sem_TypeName_Prec2TypeName :: Annotation ->
String ->
Integer ->
Integer ->
T_TypeName
sem_TypeName_Prec2TypeName ann_ tn_ prec_ prec1_ =
(\ _lhsIcat
_lhsIidenv
_lhsIlib ->
(let _lhsOnamedType :: (Maybe Type)
_lhsOannotatedTree :: TypeName
_lhsOfixedUpIdentifiersTree :: TypeName
_lhsOoriginalTree :: TypeName
_lhsOnamedType =
etmt _tpe
_lhsOannotatedTree =
addTypeErrors (tes _tpe ) _backTree
_tpe =
catLookupType _lhsIcat $ canonicalizeTypeName tn_
_backTree =
Prec2TypeName ann_ tn_ prec_ prec1_
_annotatedTree =
Prec2TypeName ann_ tn_ prec_ prec1_
_fixedUpIdentifiersTree =
Prec2TypeName ann_ tn_ prec_ prec1_
_originalTree =
Prec2TypeName ann_ tn_ prec_ prec1_
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
in ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOnamedType,_lhsOoriginalTree)))
sem_TypeName_PrecTypeName :: Annotation ->
String ->
Integer ->
T_TypeName
sem_TypeName_PrecTypeName ann_ tn_ prec_ =
(\ _lhsIcat
_lhsIidenv
_lhsIlib ->
(let _lhsOnamedType :: (Maybe Type)
_lhsOannotatedTree :: TypeName
_lhsOfixedUpIdentifiersTree :: TypeName
_lhsOoriginalTree :: TypeName
_lhsOnamedType =
etmt _tpe
_lhsOannotatedTree =
addTypeErrors (tes _tpe ) _backTree
_tpe =
catLookupType _lhsIcat $ canonicalizeTypeName tn_
_backTree =
PrecTypeName ann_ tn_ prec_
_annotatedTree =
PrecTypeName ann_ tn_ prec_
_fixedUpIdentifiersTree =
PrecTypeName ann_ tn_ prec_
_originalTree =
PrecTypeName ann_ tn_ prec_
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
in ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOnamedType,_lhsOoriginalTree)))
sem_TypeName_SetOfTypeName :: Annotation ->
T_TypeName ->
T_TypeName
sem_TypeName_SetOfTypeName ann_ typ_ =
(\ _lhsIcat
_lhsIidenv
_lhsIlib ->
(let _lhsOnamedType :: (Maybe Type)
_lhsOannotatedTree :: TypeName
_lhsOfixedUpIdentifiersTree :: TypeName
_lhsOoriginalTree :: TypeName
_typOcat :: Catalog
_typOidenv :: IDEnv
_typOlib :: LocalBindings
_typIannotatedTree :: TypeName
_typIfixedUpIdentifiersTree :: TypeName
_typInamedType :: (Maybe Type)
_typIoriginalTree :: TypeName
_lhsOnamedType =
etmt _tpe
_lhsOannotatedTree =
addTypeErrors (tes _tpe ) _backTree
_tpe =
lmt _typInamedType >>= Right . SetOfType
_backTree =
SetOfTypeName ann_ _typIannotatedTree
_annotatedTree =
SetOfTypeName ann_ _typIannotatedTree
_fixedUpIdentifiersTree =
SetOfTypeName ann_ _typIfixedUpIdentifiersTree
_originalTree =
SetOfTypeName ann_ _typIoriginalTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
_typOcat =
_lhsIcat
_typOidenv =
_lhsIidenv
_typOlib =
_lhsIlib
( _typIannotatedTree,_typIfixedUpIdentifiersTree,_typInamedType,_typIoriginalTree) =
typ_ _typOcat _typOidenv _typOlib
in ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOnamedType,_lhsOoriginalTree)))
sem_TypeName_SimpleTypeName :: Annotation ->
String ->
T_TypeName
sem_TypeName_SimpleTypeName ann_ tn_ =
(\ _lhsIcat
_lhsIidenv
_lhsIlib ->
(let _lhsOnamedType :: (Maybe Type)
_lhsOannotatedTree :: TypeName
_lhsOfixedUpIdentifiersTree :: TypeName
_lhsOoriginalTree :: TypeName
_lhsOnamedType =
etmt _tpe
_lhsOannotatedTree =
addTypeErrors (tes _tpe ) _backTree
_tpe =
catLookupType _lhsIcat $ canonicalizeTypeName tn_
_backTree =
SimpleTypeName ann_ tn_
_annotatedTree =
SimpleTypeName ann_ tn_
_fixedUpIdentifiersTree =
SimpleTypeName ann_ tn_
_originalTree =
SimpleTypeName ann_ tn_
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
in ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOnamedType,_lhsOoriginalTree)))
type TypeNameList = [TypeName ]
sem_TypeNameList :: TypeNameList ->
T_TypeNameList
sem_TypeNameList list =
(Prelude.foldr sem_TypeNameList_Cons sem_TypeNameList_Nil (Prelude.map sem_TypeName list) )
type T_TypeNameList = Catalog ->
IDEnv ->
LocalBindings ->
( TypeNameList ,TypeNameList ,([Maybe Type]),TypeNameList )
data Inh_TypeNameList = Inh_TypeNameList {cat_Inh_TypeNameList :: Catalog,idenv_Inh_TypeNameList :: IDEnv,lib_Inh_TypeNameList :: LocalBindings}
data Syn_TypeNameList = Syn_TypeNameList {annotatedTree_Syn_TypeNameList :: TypeNameList ,fixedUpIdentifiersTree_Syn_TypeNameList :: TypeNameList ,namedTypes_Syn_TypeNameList :: ([Maybe Type]),originalTree_Syn_TypeNameList :: TypeNameList }
wrap_TypeNameList :: T_TypeNameList ->
Inh_TypeNameList ->
Syn_TypeNameList
wrap_TypeNameList sem (Inh_TypeNameList _lhsIcat _lhsIidenv _lhsIlib ) =
(let ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOnamedTypes,_lhsOoriginalTree) = sem _lhsIcat _lhsIidenv _lhsIlib
in (Syn_TypeNameList _lhsOannotatedTree _lhsOfixedUpIdentifiersTree _lhsOnamedTypes _lhsOoriginalTree ))
sem_TypeNameList_Cons :: T_TypeName ->
T_TypeNameList ->
T_TypeNameList
sem_TypeNameList_Cons hd_ tl_ =
(\ _lhsIcat
_lhsIidenv
_lhsIlib ->
(let _lhsOnamedTypes :: ([Maybe Type])
_lhsOannotatedTree :: TypeNameList
_lhsOfixedUpIdentifiersTree :: TypeNameList
_lhsOoriginalTree :: TypeNameList
_hdOcat :: Catalog
_hdOidenv :: IDEnv
_hdOlib :: LocalBindings
_tlOcat :: Catalog
_tlOidenv :: IDEnv
_tlOlib :: LocalBindings
_hdIannotatedTree :: TypeName
_hdIfixedUpIdentifiersTree :: TypeName
_hdInamedType :: (Maybe Type)
_hdIoriginalTree :: TypeName
_tlIannotatedTree :: TypeNameList
_tlIfixedUpIdentifiersTree :: TypeNameList
_tlInamedTypes :: ([Maybe Type])
_tlIoriginalTree :: TypeNameList
_lhsOnamedTypes =
_hdInamedType : _tlInamedTypes
_annotatedTree =
(:) _hdIannotatedTree _tlIannotatedTree
_fixedUpIdentifiersTree =
(:) _hdIfixedUpIdentifiersTree _tlIfixedUpIdentifiersTree
_originalTree =
(:) _hdIoriginalTree _tlIoriginalTree
_lhsOannotatedTree =
_annotatedTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
_hdOcat =
_lhsIcat
_hdOidenv =
_lhsIidenv
_hdOlib =
_lhsIlib
_tlOcat =
_lhsIcat
_tlOidenv =
_lhsIidenv
_tlOlib =
_lhsIlib
( _hdIannotatedTree,_hdIfixedUpIdentifiersTree,_hdInamedType,_hdIoriginalTree) =
hd_ _hdOcat _hdOidenv _hdOlib
( _tlIannotatedTree,_tlIfixedUpIdentifiersTree,_tlInamedTypes,_tlIoriginalTree) =
tl_ _tlOcat _tlOidenv _tlOlib
in ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOnamedTypes,_lhsOoriginalTree)))
sem_TypeNameList_Nil :: T_TypeNameList
sem_TypeNameList_Nil =
(\ _lhsIcat
_lhsIidenv
_lhsIlib ->
(let _lhsOnamedTypes :: ([Maybe Type])
_lhsOannotatedTree :: TypeNameList
_lhsOfixedUpIdentifiersTree :: TypeNameList
_lhsOoriginalTree :: TypeNameList
_lhsOnamedTypes =
[]
_annotatedTree =
[]
_fixedUpIdentifiersTree =
[]
_originalTree =
[]
_lhsOannotatedTree =
_annotatedTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
in ( _lhsOannotatedTree,_lhsOfixedUpIdentifiersTree,_lhsOnamedTypes,_lhsOoriginalTree)))
data VarDef = ParamAlias (Annotation) (NameComponent) (Integer)
| VarAlias (Annotation) (NameComponent) (Name )
| VarDef (Annotation) (NameComponent) (TypeName ) ((Maybe ScalarExpr))
deriving ( Data,Eq,Show,Typeable)
sem_VarDef :: VarDef ->
T_VarDef
sem_VarDef (ParamAlias _ann _name _i ) =
(sem_VarDef_ParamAlias _ann _name _i )
sem_VarDef (VarAlias _ann _name _aliased ) =
(sem_VarDef_VarAlias _ann _name (sem_Name _aliased ) )
sem_VarDef (VarDef _ann _name _typ _value ) =
(sem_VarDef_VarDef _ann _name (sem_TypeName _typ ) _value )
type T_VarDef = Catalog ->
IDEnv ->
LocalBindings ->
( VarDef ,((String,Maybe Type)),VarDef ,VarDef )
data Inh_VarDef = Inh_VarDef {cat_Inh_VarDef :: Catalog,idenv_Inh_VarDef :: IDEnv,lib_Inh_VarDef :: LocalBindings}
data Syn_VarDef = Syn_VarDef {annotatedTree_Syn_VarDef :: VarDef ,def_Syn_VarDef :: ((String,Maybe Type)),fixedUpIdentifiersTree_Syn_VarDef :: VarDef ,originalTree_Syn_VarDef :: VarDef }
wrap_VarDef :: T_VarDef ->
Inh_VarDef ->
Syn_VarDef
wrap_VarDef sem (Inh_VarDef _lhsIcat _lhsIidenv _lhsIlib ) =
(let ( _lhsOannotatedTree,_lhsOdef,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree) = sem _lhsIcat _lhsIidenv _lhsIlib
in (Syn_VarDef _lhsOannotatedTree _lhsOdef _lhsOfixedUpIdentifiersTree _lhsOoriginalTree ))
sem_VarDef_ParamAlias :: Annotation ->
NameComponent ->
Integer ->
T_VarDef
sem_VarDef_ParamAlias ann_ name_ i_ =
(\ _lhsIcat
_lhsIidenv
_lhsIlib ->
(let _lhsOdef :: ((String,Maybe Type))
_lhsOannotatedTree :: VarDef
_lhsOfixedUpIdentifiersTree :: VarDef
_lhsOoriginalTree :: VarDef
_lhsOdef =
(ncStr name_, Nothing)
_annotatedTree =
ParamAlias ann_ name_ i_
_fixedUpIdentifiersTree =
ParamAlias ann_ name_ i_
_originalTree =
ParamAlias ann_ name_ i_
_lhsOannotatedTree =
_annotatedTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
in ( _lhsOannotatedTree,_lhsOdef,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree)))
sem_VarDef_VarAlias :: Annotation ->
NameComponent ->
T_Name ->
T_VarDef
sem_VarDef_VarAlias ann_ name_ aliased_ =
(\ _lhsIcat
_lhsIidenv
_lhsIlib ->
(let _lhsOdef :: ((String,Maybe Type))
_lhsOannotatedTree :: VarDef
_lhsOfixedUpIdentifiersTree :: VarDef
_lhsOoriginalTree :: VarDef
_aliasedOcat :: Catalog
_aliasedOidenv :: IDEnv
_aliasedOlib :: LocalBindings
_aliasedIannotatedTree :: Name
_aliasedIfixedUpIdentifiersTree :: Name
_aliasedIoriginalTree :: Name
_aliasedItbAnnotatedTree :: Name
_aliasedItbUType :: (Maybe ([(String,Type)],[(String,Type)]))
_lhsOdef =
(ncStr name_, Nothing)
_annotatedTree =
VarAlias ann_ name_ _aliasedIannotatedTree
_fixedUpIdentifiersTree =
VarAlias ann_ name_ _aliasedIfixedUpIdentifiersTree
_originalTree =
VarAlias ann_ name_ _aliasedIoriginalTree
_lhsOannotatedTree =
_annotatedTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
_aliasedOcat =
_lhsIcat
_aliasedOidenv =
_lhsIidenv
_aliasedOlib =
_lhsIlib
( _aliasedIannotatedTree,_aliasedIfixedUpIdentifiersTree,_aliasedIoriginalTree,_aliasedItbAnnotatedTree,_aliasedItbUType) =
aliased_ _aliasedOcat _aliasedOidenv _aliasedOlib
in ( _lhsOannotatedTree,_lhsOdef,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree)))
sem_VarDef_VarDef :: Annotation ->
NameComponent ->
T_TypeName ->
(Maybe ScalarExpr) ->
T_VarDef
sem_VarDef_VarDef ann_ name_ typ_ value_ =
(\ _lhsIcat
_lhsIidenv
_lhsIlib ->
(let _lhsOdef :: ((String,Maybe Type))
_lhsOannotatedTree :: VarDef
_lhsOfixedUpIdentifiersTree :: VarDef
_lhsOoriginalTree :: VarDef
_typOcat :: Catalog
_typOidenv :: IDEnv
_typOlib :: LocalBindings
_typIannotatedTree :: TypeName
_typIfixedUpIdentifiersTree :: TypeName
_typInamedType :: (Maybe Type)
_typIoriginalTree :: TypeName
_lhsOdef =
(ncStr name_, if _typInamedType == Just (Pseudo Record)
then Just (PgRecord Nothing)
else _typInamedType)
_annotatedTree =
VarDef ann_ name_ _typIannotatedTree value_
_fixedUpIdentifiersTree =
VarDef ann_ name_ _typIfixedUpIdentifiersTree value_
_originalTree =
VarDef ann_ name_ _typIoriginalTree value_
_lhsOannotatedTree =
_annotatedTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
_typOcat =
_lhsIcat
_typOidenv =
_lhsIidenv
_typOlib =
_lhsIlib
( _typIannotatedTree,_typIfixedUpIdentifiersTree,_typInamedType,_typIoriginalTree) =
typ_ _typOcat _typOidenv _typOlib
in ( _lhsOannotatedTree,_lhsOdef,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree)))
type VarDefList = [VarDef ]
sem_VarDefList :: VarDefList ->
T_VarDefList
sem_VarDefList list =
(Prelude.foldr sem_VarDefList_Cons sem_VarDefList_Nil (Prelude.map sem_VarDef list) )
type T_VarDefList = Catalog ->
IDEnv ->
LocalBindings ->
( VarDefList ,([(String,Maybe Type)]),VarDefList ,VarDefList )
data Inh_VarDefList = Inh_VarDefList {cat_Inh_VarDefList :: Catalog,idenv_Inh_VarDefList :: IDEnv,lib_Inh_VarDefList :: LocalBindings}
data Syn_VarDefList = Syn_VarDefList {annotatedTree_Syn_VarDefList :: VarDefList ,defs_Syn_VarDefList :: ([(String,Maybe Type)]),fixedUpIdentifiersTree_Syn_VarDefList :: VarDefList ,originalTree_Syn_VarDefList :: VarDefList }
wrap_VarDefList :: T_VarDefList ->
Inh_VarDefList ->
Syn_VarDefList
wrap_VarDefList sem (Inh_VarDefList _lhsIcat _lhsIidenv _lhsIlib ) =
(let ( _lhsOannotatedTree,_lhsOdefs,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree) = sem _lhsIcat _lhsIidenv _lhsIlib
in (Syn_VarDefList _lhsOannotatedTree _lhsOdefs _lhsOfixedUpIdentifiersTree _lhsOoriginalTree ))
sem_VarDefList_Cons :: T_VarDef ->
T_VarDefList ->
T_VarDefList
sem_VarDefList_Cons hd_ tl_ =
(\ _lhsIcat
_lhsIidenv
_lhsIlib ->
(let _lhsOdefs :: ([(String,Maybe Type)])
_lhsOannotatedTree :: VarDefList
_lhsOfixedUpIdentifiersTree :: VarDefList
_lhsOoriginalTree :: VarDefList
_hdOcat :: Catalog
_hdOidenv :: IDEnv
_hdOlib :: LocalBindings
_tlOcat :: Catalog
_tlOidenv :: IDEnv
_tlOlib :: LocalBindings
_hdIannotatedTree :: VarDef
_hdIdef :: ((String,Maybe Type))
_hdIfixedUpIdentifiersTree :: VarDef
_hdIoriginalTree :: VarDef
_tlIannotatedTree :: VarDefList
_tlIdefs :: ([(String,Maybe Type)])
_tlIfixedUpIdentifiersTree :: VarDefList
_tlIoriginalTree :: VarDefList
_lhsOdefs =
_hdIdef : _tlIdefs
_annotatedTree =
(:) _hdIannotatedTree _tlIannotatedTree
_fixedUpIdentifiersTree =
(:) _hdIfixedUpIdentifiersTree _tlIfixedUpIdentifiersTree
_originalTree =
(:) _hdIoriginalTree _tlIoriginalTree
_lhsOannotatedTree =
_annotatedTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
_hdOcat =
_lhsIcat
_hdOidenv =
_lhsIidenv
_hdOlib =
_lhsIlib
_tlOcat =
_lhsIcat
_tlOidenv =
_lhsIidenv
_tlOlib =
_lhsIlib
( _hdIannotatedTree,_hdIdef,_hdIfixedUpIdentifiersTree,_hdIoriginalTree) =
hd_ _hdOcat _hdOidenv _hdOlib
( _tlIannotatedTree,_tlIdefs,_tlIfixedUpIdentifiersTree,_tlIoriginalTree) =
tl_ _tlOcat _tlOidenv _tlOlib
in ( _lhsOannotatedTree,_lhsOdefs,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree)))
sem_VarDefList_Nil :: T_VarDefList
sem_VarDefList_Nil =
(\ _lhsIcat
_lhsIidenv
_lhsIlib ->
(let _lhsOdefs :: ([(String,Maybe Type)])
_lhsOannotatedTree :: VarDefList
_lhsOfixedUpIdentifiersTree :: VarDefList
_lhsOoriginalTree :: VarDefList
_lhsOdefs =
[]
_annotatedTree =
[]
_fixedUpIdentifiersTree =
[]
_originalTree =
[]
_lhsOannotatedTree =
_annotatedTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
in ( _lhsOannotatedTree,_lhsOdefs,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree)))
data WithQuery = WithQuery (Annotation) (NameComponent) ((Maybe [NameComponent])) (QueryExpr )
deriving ( Data,Eq,Show,Typeable)
sem_WithQuery :: WithQuery ->
T_WithQuery
sem_WithQuery (WithQuery _ann _name _colAliases _ex ) =
(sem_WithQuery_WithQuery _ann _name _colAliases (sem_QueryExpr _ex ) )
type T_WithQuery = Catalog ->
IDEnv ->
LocalBindings ->
( WithQuery ,([CatalogUpdate]),IDEnv,WithQuery ,WithQuery )
data Inh_WithQuery = Inh_WithQuery {cat_Inh_WithQuery :: Catalog,idenv_Inh_WithQuery :: IDEnv,lib_Inh_WithQuery :: LocalBindings}
data Syn_WithQuery = Syn_WithQuery {annotatedTree_Syn_WithQuery :: WithQuery ,catUpdates_Syn_WithQuery :: ([CatalogUpdate]),cidenv_Syn_WithQuery :: IDEnv,fixedUpIdentifiersTree_Syn_WithQuery :: WithQuery ,originalTree_Syn_WithQuery :: WithQuery }
wrap_WithQuery :: T_WithQuery ->
Inh_WithQuery ->
Syn_WithQuery
wrap_WithQuery sem (Inh_WithQuery _lhsIcat _lhsIidenv _lhsIlib ) =
(let ( _lhsOannotatedTree,_lhsOcatUpdates,_lhsOcidenv,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree) = sem _lhsIcat _lhsIidenv _lhsIlib
in (Syn_WithQuery _lhsOannotatedTree _lhsOcatUpdates _lhsOcidenv _lhsOfixedUpIdentifiersTree _lhsOoriginalTree ))
sem_WithQuery_WithQuery :: Annotation ->
NameComponent ->
(Maybe [NameComponent]) ->
T_QueryExpr ->
T_WithQuery
sem_WithQuery_WithQuery ann_ name_ colAliases_ ex_ =
(\ _lhsIcat
_lhsIidenv
_lhsIlib ->
(let _lhsOfixedUpIdentifiersTree :: WithQuery
_exOcsql :: LocalBindings
_exOexpectedTypes :: ([Maybe Type])
_lhsOannotatedTree :: WithQuery
_lhsOoriginalTree :: WithQuery
_lhsOcatUpdates :: ([CatalogUpdate])
_lhsOcidenv :: IDEnv
_exOcat :: Catalog
_exOidenv :: IDEnv
_exOlib :: LocalBindings
_exIannotatedTree :: QueryExpr
_exIcidenv :: IDEnv
_exIfixedUpIdentifiersTree :: QueryExpr
_exIlibUpdates :: ([LocalBindingsUpdate])
_exIoriginalTree :: QueryExpr
_exIuType :: (Maybe [(String,Type)])
_lhsOfixedUpIdentifiersTree =
undefined
_exOcsql =
emptyBindings
_tpe =
Right $ Pseudo Void
_backTree =
WithQuery ann_ name_ colAliases_ _exIannotatedTree
_attrs =
maybe [] id $ _exIuType
_catUpdates =
[CatCreateView (ncStr name_) _attrs ]
_statementType =
Nothing
_exOexpectedTypes =
[]
_annotatedTree =
WithQuery ann_ name_ colAliases_ _exIannotatedTree
_fixedUpIdentifiersTree =
WithQuery ann_ name_ colAliases_ _exIfixedUpIdentifiersTree
_originalTree =
WithQuery ann_ name_ colAliases_ _exIoriginalTree
_lhsOannotatedTree =
_annotatedTree
_lhsOoriginalTree =
_originalTree
_lhsOcatUpdates =
_catUpdates
_lhsOcidenv =
_exIcidenv
_exOcat =
_lhsIcat
_exOidenv =
_lhsIidenv
_exOlib =
_lhsIlib
( _exIannotatedTree,_exIcidenv,_exIfixedUpIdentifiersTree,_exIlibUpdates,_exIoriginalTree,_exIuType) =
ex_ _exOcat _exOcsql _exOexpectedTypes _exOidenv _exOlib
in ( _lhsOannotatedTree,_lhsOcatUpdates,_lhsOcidenv,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree)))
type WithQueryList = [WithQuery ]
sem_WithQueryList :: WithQueryList ->
T_WithQueryList
sem_WithQueryList list =
(Prelude.foldr sem_WithQueryList_Cons sem_WithQueryList_Nil (Prelude.map sem_WithQuery list) )
type T_WithQueryList = Catalog ->
([CatalogUpdate]) ->
IDEnv ->
LocalBindings ->
( WithQueryList ,IDEnv,WithQueryList ,WithQueryList ,Catalog)
data Inh_WithQueryList = Inh_WithQueryList {cat_Inh_WithQueryList :: Catalog,catUpdates_Inh_WithQueryList :: ([CatalogUpdate]),idenv_Inh_WithQueryList :: IDEnv,lib_Inh_WithQueryList :: LocalBindings}
data Syn_WithQueryList = Syn_WithQueryList {annotatedTree_Syn_WithQueryList :: WithQueryList ,cidenv_Syn_WithQueryList :: IDEnv,fixedUpIdentifiersTree_Syn_WithQueryList :: WithQueryList ,originalTree_Syn_WithQueryList :: WithQueryList ,producedCat_Syn_WithQueryList :: Catalog}
wrap_WithQueryList :: T_WithQueryList ->
Inh_WithQueryList ->
Syn_WithQueryList
wrap_WithQueryList sem (Inh_WithQueryList _lhsIcat _lhsIcatUpdates _lhsIidenv _lhsIlib ) =
(let ( _lhsOannotatedTree,_lhsOcidenv,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree,_lhsOproducedCat) = sem _lhsIcat _lhsIcatUpdates _lhsIidenv _lhsIlib
in (Syn_WithQueryList _lhsOannotatedTree _lhsOcidenv _lhsOfixedUpIdentifiersTree _lhsOoriginalTree _lhsOproducedCat ))
sem_WithQueryList_Cons :: T_WithQuery ->
T_WithQueryList ->
T_WithQueryList
sem_WithQueryList_Cons hd_ tl_ =
(\ _lhsIcat
_lhsIcatUpdates
_lhsIidenv
_lhsIlib ->
(let _lhsOcidenv :: IDEnv
_hdOcat :: Catalog
_tlOcat :: Catalog
_lhsOproducedCat :: Catalog
_tlOcatUpdates :: ([CatalogUpdate])
_lhsOannotatedTree :: WithQueryList
_lhsOfixedUpIdentifiersTree :: WithQueryList
_lhsOoriginalTree :: WithQueryList
_hdOidenv :: IDEnv
_hdOlib :: LocalBindings
_tlOidenv :: IDEnv
_tlOlib :: LocalBindings
_hdIannotatedTree :: WithQuery
_hdIcatUpdates :: ([CatalogUpdate])
_hdIcidenv :: IDEnv
_hdIfixedUpIdentifiersTree :: WithQuery
_hdIoriginalTree :: WithQuery
_tlIannotatedTree :: WithQueryList
_tlIcidenv :: IDEnv
_tlIfixedUpIdentifiersTree :: WithQueryList
_tlIoriginalTree :: WithQueryList
_tlIproducedCat :: Catalog
_lhsOcidenv =
undefined
_newCat =
fromRight _lhsIcat $ updateCatalog _lhsIcat _lhsIcatUpdates
_hdOcat =
_newCat
_tlOcat =
_newCat
_lhsOproducedCat =
_tlIproducedCat
_tlOcatUpdates =
_hdIcatUpdates
_annotatedTree =
(:) _hdIannotatedTree _tlIannotatedTree
_fixedUpIdentifiersTree =
(:) _hdIfixedUpIdentifiersTree _tlIfixedUpIdentifiersTree
_originalTree =
(:) _hdIoriginalTree _tlIoriginalTree
_lhsOannotatedTree =
_annotatedTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
_hdOidenv =
_lhsIidenv
_hdOlib =
_lhsIlib
_tlOidenv =
_lhsIidenv
_tlOlib =
_lhsIlib
( _hdIannotatedTree,_hdIcatUpdates,_hdIcidenv,_hdIfixedUpIdentifiersTree,_hdIoriginalTree) =
hd_ _hdOcat _hdOidenv _hdOlib
( _tlIannotatedTree,_tlIcidenv,_tlIfixedUpIdentifiersTree,_tlIoriginalTree,_tlIproducedCat) =
tl_ _tlOcat _tlOcatUpdates _tlOidenv _tlOlib
in ( _lhsOannotatedTree,_lhsOcidenv,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree,_lhsOproducedCat)))
sem_WithQueryList_Nil :: T_WithQueryList
sem_WithQueryList_Nil =
(\ _lhsIcat
_lhsIcatUpdates
_lhsIidenv
_lhsIlib ->
(let _lhsOcidenv :: IDEnv
_lhsOproducedCat :: Catalog
_lhsOannotatedTree :: WithQueryList
_lhsOfixedUpIdentifiersTree :: WithQueryList
_lhsOoriginalTree :: WithQueryList
_lhsOcidenv =
emptyIDEnv "empty with query list"
_newCat =
fromRight _lhsIcat $ updateCatalog _lhsIcat _lhsIcatUpdates
_lhsOproducedCat =
_newCat
_annotatedTree =
[]
_fixedUpIdentifiersTree =
[]
_originalTree =
[]
_lhsOannotatedTree =
_annotatedTree
_lhsOfixedUpIdentifiersTree =
_fixedUpIdentifiersTree
_lhsOoriginalTree =
_originalTree
in ( _lhsOannotatedTree,_lhsOcidenv,_lhsOfixedUpIdentifiersTree,_lhsOoriginalTree,_lhsOproducedCat)))