flocc-pffb

Stabilityexperimental
Maintainerdeveloper@flocc.net
Safe HaskellNone

Compiler.Back.Generators

Description

For more information please see http://www.flocc.net/

Synopsis

Documentation

type SimpGenerator m = [Val m] -> Val m

simpGen :: (Monad m, MonadCatch m) => SimpGenerator m -> [Val m] -> GenM1 m (Val m)

gerr :: (Monad m, MonadCatch m) => String -> Generator m

genErrorC :: Monad m => String -> StateT (GenState m) m (Val m1)

g1 :: (Monad m, MonadCatch m) => Generator m

decStruct :: (Monad m, MonadCatch m) => Id -> [Ty] -> GenM1 m Code

generates a new struct declaration for a tuple type

genStructEmpty :: (Monad m, MonadCatch m) => Id -> [Maybe Id] -> GenM1 m Code

genStructPrint structName type. Generates a printVal method for |the struct.

decCollection :: (Monad m, MonadCatch m) => Id -> GenM m

generates a new collection declaration

genTypeName :: (Monad m, MonadCatch m) => Ty -> GenM1 m (Maybe Id)

genTypeName ty. Returns the type name for ty. |Tuple type names are created by generating struct declarations for them |and then saving their names in globals.

genTyName :: (Monad m, MonadCatch m) => Generator m

genTyName [VarV ty var]. Returns the target name of the |variable's type, or error if can't generate name.

genMPITyName :: (Monad m, MonadCatch m) => Generator m

treeVarsToVar :: (Monad m, MonadCatch m) => Val m -> Val m

treeVarsToVar v. If v is a tree of

decStructVar :: (Monad m, MonadCatch m) => Generator m

decStructVar [VarV ty var]. Declares a struct var for type ty, named var. |var must be a leaf id, and if the struct for ty hasn't yet been declared |it is automatically.

decInitVar :: (Monad m, MonadCatch m) => Generator m

decVar [VarV ty var, val]. Generates code to declare var with type ty, |and val passed to its constructor, unless val is LitV NulVal, in which |case the constructor is not called.

decVar :: (Monad m, MonadCatch m) => Generator m

decInitVar [VarV ty var]. Returns code to initialize the

initVar :: (Monad m, MonadCatch m) => Generator m

initVar [VarV ty var, ]. Assigns a new value to a variable, by calling the |constructor again.

decArr :: (Monad m, MonadCatch m) => Generator m

printSt :: String -> Id -> Code

printSt indent vid. Generates a print statement to display the variable.

printVar :: (Monad m, MonadCatch m) => String -> Id -> Ty -> GenM1 m Code

printVar indent varId type. Generates print statements to display the variable.

printVars :: (Monad m, MonadCatch m) => String -> Tree (Id, Ty) -> GenM1 m Code

printVars vars. Returns code to print the values of the vars.

printVarGen :: (Monad m, MonadCatch m) => Generator m

printVarGen [VarV type var]. Generates code to display var on the |standard output.

genStructPrint :: (Monad m, MonadCatch m) => Id -> Ty -> GenM1 m Code

genStructPrint structName type. Generates a printVal method for |the struct.

ifNull :: Ty -> v -> v -> v

ifNull ty nullV notNullV. If ty is the Null type then |returns nullV, else notNullV.

singleAss :: (Monad m, MonadCatch m) => (Tree (Id, Ty), Tree (Id, Ty)) -> GenM1 m Code

singleAss (destVar, srcVar). Generates code that assigns srcVar to destVar.

assignVarGen :: (Monad m, MonadCatch m) => Generator m

assignVarGen [destVar, srcVar]. Generates code that assigns srcVar to destVar.

eqGen :: (Monad m, MonadCatch m) => Generator m

eqGen [aVar, bVar]. Generates an expression to compare aVar and bVar.

genStructEq :: (Monad m, MonadCatch m) => Id -> Ty -> GenM1 m Code

genEqStruct :: (Monad m, MonadCatch m) => Id -> Ty -> GenM1 m Code

genCollectionEqMethod :: String -> Code

genCollectionEqMethod className. Returns code for the == operator between |the collections.

eqCollectionTemplate :: StrTem

eqCollectionTemplate. Template for collection equality operator implementations. |Collections are only equal, if they have the same values in the same order.

ltGen :: (Monad m, MonadCatch m) => Generator m

ltGen [aVar, bVar]. Generates code to compare aVar and bVar.

genStructLT :: (Monad m, MonadCatch m) => Id -> Ty -> GenM1 m Code

genStructMemLT structName memTypes. Returns a less than |comparision function for the struct.

hashClassTemplate :: StrTem

string template for flocc::hasher class implementations

genHashFun :: (Monad m, MonadCatch m) => Id -> [(Int, Id)] -> GenM1 m Code

redFunGen :: (Monad m, MonadCatch m) => Generator m

redFunGen [funGraph]. Generates an MPI user defined reduction functions |for distributed reductions.

litArrayGen :: (Monad m, MonadCatch m) => Generator m

litArrayGenV :: (Monad m, MonadCatch m) => Generator m

hashVar :: (Monad m, MonadCatch m) => Generator m

hashVar [inV, outV]. Returns code to assign, the hash of inV to outV.

generators :: (Monad m, MonadCatch m) => [(Id, Generator m)]