copilot-c99-3.6: A compiler for Copilot targeting C99.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Copilot.Compile.C99.Util

Description

Deprecated: This module will be hidden in future versions.

Auxiliary helper functions to generate C99 code.

Synopsis

Documentation

type FunEnv = [Decln] Source #

Auxiliary type used to collect all the declarations of all the variables used in a function to be generated, since variable declarations are always listed first at the top of the function body.

statetell :: Monoid m => m -> State m () Source #

tell equivalent for State.

fresh :: String -> [String] -> String Source #

Generate fresh variable name based on a given one.

names :: [Decln] -> [String] Source #

Collect all the names from a list of C99 declarations.

streamname :: Id -> String Source #

Turn a stream id into a suitable C variable name.

indexname :: Id -> String Source #

Turn a stream id into the global varname for indices.

streamaccessorname :: Id -> String Source #

Turn a stream id into the name of its accessor function

excpyname :: String -> String Source #

Add a postfix for copies of external variables the name.

generatorname :: Id -> String Source #

Turn stream id into name of its generator function.

guardname :: String -> String Source #

Turn the name of a trigger into a guard generator.

argname :: String -> Int -> String Source #

Turn a trigger name into a an trigger argument name.

argnames :: String -> [String] Source #

Enumerate all argument names based on trigger name.

funcall :: Ident -> [Expr] -> Expr Source #

Define a C expression that calls a function with arguments.