copilot-c99-3.2.1: A compiler for Copilot targeting C99.
Safe HaskellNone
LanguageHaskell2010

Copilot.Compile.C99.CodeGen

Description

High-level translation of Copilot Core into C99.

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 a 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 #

Writes the step function, that updates all streams.

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 declaration.

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 a 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.