copilot-c99-3.1.1: A compiler for Copilot targeting C99.

Safe HaskellNone
LanguageHaskell2010

Copilot.Compile.C99.CodeGen

Synopsis

Documentation

gendecln :: String -> Type a -> Decln Source #

Write a declaration for a generator function.

genfun :: String -> Expr a -> Type a -> FunDef Source #

Write a generator function for a stream.

mkextdecln :: External -> Decln Source #

Make a extern declaration of an variable.

mkextcpydecln :: External -> Decln Source #

Make a declaration for a copy of an external variable.

mkbuffdecln :: Id -> Type a -> [a] -> Decln Source #

Make a C buffer variable and initialise it with the stream buffer.

mkindexdecln :: Id -> Decln Source #

Make a C index variable and initialise it to 0.

mkstep :: [Stream] -> [Trigger] -> [External] -> FunDef Source #

The step function updates all streams,a

mkstructdecln :: Struct a => Type a -> Decln Source #

Write a struct declaration based on its definition.

mkstructforwdecln :: Struct a => Type a -> Decln Source #

Write a forward struct decralration.

exprtypes :: Typeable a => Expr a -> [UType] Source #

List all types of an expression, returns items uniquely.

typetypes :: Typeable a => Type a -> [UType] Source #

List all types of an type, returns items uniquely.

gatherexprs :: [Stream] -> [Trigger] -> [UExpr] Source #

Collect all expression of a list of streams and triggers and wrap them into an UEXpr.