Unifex.CodeGenerator behaviour (Unifex v1.2.2)

View Source

Behaviour for code generation.

Summary

Functions

Generates boilerplate code using generator implementation from Unifex.CodeGenerators.

Types

code_t()

@type code_t() :: String.t()

generated_code_t()

@type generated_code_t() :: {header :: code_t(), source :: code_t(), generator :: t()}

t()

@type t() :: module()

Callbacks

generate_header(specs)

@callback generate_header(specs :: Unifex.Specs.t()) :: code_t()

generate_source(specs)

@callback generate_source(specs :: Unifex.Specs.t()) :: code_t()

identification_constant()

@callback identification_constant() :: String.t()

interface_io_name()

@callback interface_io_name() :: String.t()

Functions

bundlex_interface(atom)

generate_code(specs)

@spec generate_code(Unifex.Specs.t()) :: [generated_code_t()]

Generates boilerplate code using generator implementation from Unifex.CodeGenerators.

interface_generator(interface)

@spec interface_generator(Unifex.Specs.interface_t()) :: t()