Documentation
¶
Index ¶
- func Generate(conf config.Conf, outdir string, renderType string)
- func GenerateCppRandom(conf config.Conf, num int, outdir string)
- func GetFloatTypes() []string
- func GetFloatValue(floatType string, isComplex bool) string
- func GetIntegralNumericTypes() []string
- func GetIntegralTypes(withinStruct bool, withinUnion bool) []string
- func GetIntegralValue(integralType string, isSigned bool, name string) string
- func WriteTemplate(path string, t *template.Template, funcs *map[string]Function)
- type FloatFormalParam
- func (p FloatFormalParam) Assert() string
- func (p FloatFormalParam) Declaration() string
- func (p FloatFormalParam) DeclareFormalParam() string
- func (p FloatFormalParam) DeclareValue() string
- func (p FloatFormalParam) GetFieldName() string
- func (p FloatFormalParam) GetName() string
- func (p FloatFormalParam) GetRawType() string
- func (p FloatFormalParam) GetType() string
- func (p FloatFormalParam) GetValue() string
- func (p FloatFormalParam) Prefix() string
- func (p FloatFormalParam) Print() string
- func (p FloatFormalParam) Reference() string
- type FormalParam
- func GenerateFormalParams(entry config.Render, nestingCount int, withinStruct bool, withinUnion bool) []FormalParam
- func NewFloat() FormalParam
- func NewFormalParam(entry config.Render, nestingCount int, withinStruct bool, withinUnion bool) FormalParam
- func NewInt(usePointers bool) FormalParam
- func NewIntegral(withinStruct bool, withinUnion bool, usePointers bool) FormalParam
- func NewIntegralNumeric(usePointers bool) FormalParam
- func NewStruct(entry config.Render, nestingCount int, usePointers bool) FormalParam
- type Function
- type IntegralFormalParam
- func (p IntegralFormalParam) Assert() string
- func (p IntegralFormalParam) Declaration() string
- func (p IntegralFormalParam) DeclareFormalParam() string
- func (p IntegralFormalParam) DeclareValue() string
- func (p IntegralFormalParam) GetFieldName() string
- func (p IntegralFormalParam) GetName() string
- func (p IntegralFormalParam) GetRawType() string
- func (p IntegralFormalParam) GetType() string
- func (p IntegralFormalParam) GetValue() string
- func (p IntegralFormalParam) Prefix() string
- func (p IntegralFormalParam) Print() string
- func (p IntegralFormalParam) Reference() string
- type StructureParam
- func (p StructureParam) Assert() string
- func (p StructureParam) Declaration() string
- func (p StructureParam) DeclareFormalParam() string
- func (p StructureParam) DeclareValue() string
- func (p StructureParam) GetFieldName() string
- func (p StructureParam) GetName() string
- func (p StructureParam) GetRawType() string
- func (p StructureParam) GetType() string
- func (p StructureParam) GetValue() string
- func (p StructureParam) Prefix() string
- func (p StructureParam) Print() string
- func (p StructureParam) Reference() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateCppRandom ¶
GenerateCppRandom generates randomized types for all templates
func GetFloatTypes ¶
func GetFloatTypes() []string
func GetFloatValue ¶
GetFloatValue returns a float value depending on type of float and if is complex TODO not written yet!
func GetIntegralTypes ¶
INTEGRAL Possible integral types NOTE __int128 removed for now, need help to define!
func GetIntegralValue ¶
GetIntegralValue returns an integral value depending on the type
Types ¶
type FloatFormalParam ¶
type FloatFormalParam struct { Name string `json:"name"` Type string `json:"type"` IsComplex bool `json:"is_complex"` IsPointer bool `json:"is_pointer"` Value string `json:"value"` }
Integral Types
func (FloatFormalParam) Assert ¶
func (p FloatFormalParam) Assert() string
Assert an integral formal param
func (FloatFormalParam) Declaration ¶
func (p FloatFormalParam) Declaration() string
Declaration of a float
func (FloatFormalParam) DeclareFormalParam ¶
func (p FloatFormalParam) DeclareFormalParam() string
Declaration of a formal param
func (FloatFormalParam) DeclareValue ¶
func (p FloatFormalParam) DeclareValue() string
DeclareValues includes the value
func (FloatFormalParam) GetFieldName ¶
func (p FloatFormalParam) GetFieldName() string
GetFieldName returns the name without decoration
func (FloatFormalParam) GetName ¶
func (p FloatFormalParam) GetName() string
GetName returns the name
func (FloatFormalParam) GetType ¶
func (p FloatFormalParam) GetType() string
Type of an integral formal param
func (FloatFormalParam) GetValue ¶
func (p FloatFormalParam) GetValue() string
Value returns the string representation of the value
func (FloatFormalParam) Prefix ¶
func (p FloatFormalParam) Prefix() string
Prefix of an integral formal param
func (FloatFormalParam) Print ¶
func (p FloatFormalParam) Print() string
Print prints an float formal param
func (FloatFormalParam) Reference ¶
func (p FloatFormalParam) Reference() string
Reference of an integral formal param
type FormalParam ¶
type FormalParam interface { GetName() string GetFieldName() string GetType() string GetRawType() string Prefix() string Print() string Assert() string Reference() string DeclareFormalParam() string DeclareValue() string Declaration() string GetValue() string }
FormalParam holds a type of formal parameter
func GenerateFormalParams ¶
func GenerateFormalParams(entry config.Render, nestingCount int, withinStruct bool, withinUnion bool) []FormalParam
Generate formal params, either for a function or structure
func NewFloat ¶
func NewFloat() FormalParam
func NewFormalParam ¶
func NewFormalParam(entry config.Render, nestingCount int, withinStruct bool, withinUnion bool) FormalParam
Functions to create new Formal Parameters (all random)
func NewIntegral ¶
func NewIntegral(withinStruct bool, withinUnion bool, usePointers bool) FormalParam
NewIntegral returns a new integral type
func NewIntegralNumeric ¶
func NewIntegralNumeric(usePointers bool) FormalParam
NewIntegralNumeric returns a new integral numeric type
type Function ¶
type Function struct { Name string `json:"name"` FormalParams []FormalParam `json:"parameters,omitempty"` }
A Function holds a name and one or more formal params
type IntegralFormalParam ¶
type IntegralFormalParam struct { Name string `json:"name"` Type string `json:"type"` IsSigned bool `json:"is_signed"` IsPointer bool `json:"is_pointer"` Value string `json:"value"` }
Integral Types
func (IntegralFormalParam) Assert ¶
func (p IntegralFormalParam) Assert() string
Assert an integral formal param
func (IntegralFormalParam) Declaration ¶
func (p IntegralFormalParam) Declaration() string
Declaration of an integral formal param
func (IntegralFormalParam) DeclareFormalParam ¶
func (p IntegralFormalParam) DeclareFormalParam() string
Declaration of a formal param
func (IntegralFormalParam) DeclareValue ¶
func (p IntegralFormalParam) DeclareValue() string
DeclareValues includes the value
func (IntegralFormalParam) GetFieldName ¶
func (p IntegralFormalParam) GetFieldName() string
func (IntegralFormalParam) GetName ¶
func (p IntegralFormalParam) GetName() string
GetName returns the string representation of the value
func (IntegralFormalParam) GetRawType ¶
func (p IntegralFormalParam) GetRawType() string
func (IntegralFormalParam) GetType ¶
func (p IntegralFormalParam) GetType() string
GetType of an integral formal param
func (IntegralFormalParam) GetValue ¶
func (p IntegralFormalParam) GetValue() string
GetValue returns the string representation of the value
func (IntegralFormalParam) Prefix ¶
func (p IntegralFormalParam) Prefix() string
Prefix of an integral formal param
func (IntegralFormalParam) Print ¶
func (p IntegralFormalParam) Print() string
Print prints an integral formal param
func (IntegralFormalParam) Reference ¶
func (p IntegralFormalParam) Reference() string
Reference of an integral formal param
type StructureParam ¶
type StructureParam struct { Type string `json:"type"` Value string `json:"value"` Name string `json:"name"` IsPointer bool `json:"is_pointer"` Fields []FormalParam `json:"fields"` IsUnion bool `json:"is_union"` }
Structure or Union Type
func (StructureParam) Declaration ¶
func (p StructureParam) Declaration() string
Declaration is for a separate declaration of just the type
func (StructureParam) DeclareFormalParam ¶
func (p StructureParam) DeclareFormalParam() string
DeclareFormalParams just declares the type (and if a pointer)
func (StructureParam) DeclareValue ¶
func (p StructureParam) DeclareValue() string
Declaration of a structure
func (StructureParam) GetFieldName ¶
func (p StructureParam) GetFieldName() string
GetFieldName returns the field name
func (StructureParam) GetType ¶
func (p StructureParam) GetType() string
GetType for a general param
func (StructureParam) GetValue ¶
func (p StructureParam) GetValue() string
Value returns the string representation of the value
func (StructureParam) Prefix ¶
func (p StructureParam) Prefix() string
Prefix of an structure formal param
func (StructureParam) Reference ¶
func (p StructureParam) Reference() string
Reference of a structure param