Safe Haskell | None |
---|---|
Language | Haskell2010 |
Common data structures and functions supporting analysis of the AST.
- initAnalysis :: Functor b => b a -> b (Analysis a)
- stripAnalysis :: Functor b => b (Analysis a) -> b a
- data Analysis a = Analysis {}
- varName :: Expression (Analysis a) -> String
- srcName :: Expression (Analysis a) -> String
- isNamedExpression :: Expression a -> Bool
- genVar :: Analysis a -> SrcSpan -> String -> Expression (Analysis a)
- puName :: ProgramUnit (Analysis a) -> ProgramUnitName
- puSrcName :: 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 :: forall a b. (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]
- analyseAllLhsVars :: forall a. Data a => ProgramFile (Analysis a) -> ProgramFile (Analysis a)
- analyseAllLhsVars1 :: (Annotated f, Data (f (Analysis a)), Data a) => f (Analysis a) -> f (Analysis a)
- allLhsVars :: Data a => Block (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 :: Functor b => b (Analysis a) -> b 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.
srcName :: Expression (Analysis a) -> String Source #
Obtain the source name from an ExpValue variable.
isNamedExpression :: Expression a -> Bool Source #
True iff the expression can be used with varName or srcName
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 ProgramUnit uniqueName or whatever is in the AST.
puSrcName :: ProgramUnit (Analysis a) -> ProgramUnitName Source #
Obtain either ProgramUnit sourceName or whatever is in the AST.
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 :: forall a b. (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.
analyseAllLhsVars :: forall a. Data a => ProgramFile (Analysis a) -> ProgramFile (Analysis a) Source #
Initiate (lazy) computation of all LHS variables for each node of the AST so that it may be accessed later.
analyseAllLhsVars1 :: (Annotated f, Data (f (Analysis a)), Data a) => f (Analysis a) -> f (Analysis a) Source #
allLhsVars :: Data a => Block (Analysis a) -> [Name] Source #
Set of names found in the parts of an AST that are the target of an assignment statement. allLhsVars :: (Annotated b, Data a, Data (b (Analysis a))) => b (Analysis a) -> [Name]
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