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

Copilot.Compile.C99.Translate

Description

Translate Copilot Core expressions and operators to C99.

Synopsis

Documentation

transexpr :: Expr a -> State FunEnv Expr Source #

Translates a Copilot Core expression into a C99 expression.

transop1 :: Op1 a b -> Expr -> Expr Source #

Translates a Copilot unary operator and its argument into a C99 expression.

transop2 :: Op2 a b c -> Expr -> Expr -> Expr Source #

Translates a Copilot binary operator and its arguments into a C99 expression.

transop3 :: Op3 a b c d -> Expr -> Expr -> Expr -> Expr Source #

Translates a Copilot ternary operator and its arguments into a C99 expression.

constty :: Type a -> a -> Expr Source #

Transform a Copilot Core literal, based on its value and type, into a C99 literal.

explicitty :: Type a -> Expr -> Expr Source #

Explicitly cast a C99 value to a type.

transtype :: Type a -> Type Source #

Translate a Copilot type to a C99 type.

transtypename :: Type a -> TypeName Source #

Translate a Copilot type intro a C typename