Safe Haskell | None |
---|---|
Language | Haskell2010 |
Common data structures and functions supporting analysis of the AST.
- initAnalysis :: Functor b => b a -> b (Analysis a)
- stripAnalysis :: ProgramFile (Analysis a) -> ProgramFile a
- data Analysis a = Analysis {}
- varName :: Expression (Analysis a) -> String
- genVar :: Analysis a -> SrcSpan -> String -> Expression (Analysis a)
- puName :: ProgramUnit (Analysis a) -> ProgramUnitName
- blockRhsExprs :: Data a => Block a -> [Expression a]
- rhsExprs :: (Data a, Data (b a)) => b a -> [Expression a]
- type ModEnv = Map String (String, NameType)
- data NameType
- data IDType = IDType {}
- data ConstructType
- data BaseType
- lhsExprs :: (Data a, Data (b a)) => b a -> [Expression a]
- isLExpr :: Expression a -> Bool
- allVars :: forall a b. (Data a, Data (b (Analysis a))) => b (Analysis a) -> [Name]
- allLhsVars :: (Data a, Data (b (Analysis a))) => b (Analysis a) -> [Name]
- blockVarUses :: Data a => Block (Analysis a) -> [Name]
- blockVarDefs :: Data a => Block (Analysis a) -> [Name]
- type BB a = [Block a]
- type BBGr a = Gr (BB a) ()
- type TransFunc f g a = (f (Analysis a) -> f (Analysis a)) -> g (Analysis a) -> g (Analysis a)
- type TransFuncM m f g a = (f (Analysis a) -> m (f (Analysis a))) -> g (Analysis a) -> m (g (Analysis a))
Documentation
initAnalysis :: Functor b => b a -> b (Analysis a) Source #
Create analysis annotations for the program, saving the original annotations.
stripAnalysis :: ProgramFile (Analysis a) -> ProgramFile a Source #
Remove analysis annotations from the program, restoring the original annotations.
Analysis | |
|
varName :: Expression (Analysis a) -> String Source #
Obtain either uniqueName or source name from an ExpValue variable.
genVar :: Analysis a -> SrcSpan -> String -> Expression (Analysis a) Source #
Generate an ExpValue variable with its source name == to its uniqueName.
puName :: ProgramUnit (Analysis a) -> ProgramUnitName Source #
Obtain either uniqueName or source program unit name.
blockRhsExprs :: Data a => Block a -> [Expression a] Source #
Set of expressions used -- not defined -- by an AST-block.
rhsExprs :: (Data a, Data (b a)) => b a -> [Expression a] Source #
Return list of expressions that are not "left-hand-side" of assignment statements.
data ConstructType Source #
lhsExprs :: (Data a, Data (b a)) => b a -> [Expression a] Source #
Return list of expressions used as the left-hand-side of assignment statements (including for-loops and function-calls by reference).
isLExpr :: Expression a -> Bool Source #
Is this an expression capable of assignment?
allVars :: forall a b. (Data a, Data (b (Analysis a))) => b (Analysis a) -> [Name] Source #
Set of names found in an AST node.
allLhsVars :: (Data a, Data (b (Analysis a))) => b (Analysis a) -> [Name] Source #
Set of names found in the parts of an AST that are the target of an assignment statement.
blockVarUses :: Data a => Block (Analysis a) -> [Name] Source #
Set of names used -- not defined -- by an AST-block.
blockVarDefs :: Data a => Block (Analysis a) -> [Name] Source #
Set of names defined by an AST-block.
type TransFunc f g a = (f (Analysis a) -> f (Analysis a)) -> g (Analysis a) -> g (Analysis a) Source #
The type of "transformBi"-family functions
type TransFuncM m f g a = (f (Analysis a) -> m (f (Analysis a))) -> g (Analysis a) -> m (g (Analysis a)) Source #
The type of "transformBiM"-family functions