Documentation
¶
Overview ¶
Package fmla generates functions from formulae.
Index ¶
- func Package(cfg Config) (gen.Files, error)
- func ParametersVariableNames(params ...Parameter) []ast.Variable
- func ParametersVariables(params ...Parameter) map[ast.Variable]Variable
- type Action
- type Asm
- type AsmFunction
- type Component
- type Config
- type Constant
- type Function
- func (f Function) AliasSets() [][]ast.Variable
- func (f *Function) HasResults() bool
- func (f Function) Inputs() []Parameter
- func (f *Function) IsVoid() bool
- func (f Function) Outputs() []Parameter
- func (f Function) Parameters() []Parameter
- func (f Function) ParametersWithAction(a Action) []Parameter
- func (f Function) Program() (*ast.Program, error)
- func (f Function) Symbols() map[string]bool
- func (f Function) Variables() map[ast.Variable]Variable
- type Lookup
- type Parameter
- type Representation
- type Variable
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParametersVariableNames ¶
ParametersVariableNames gathers all variable names for the given list of parameters.
Types ¶
type Asm ¶
type Asm struct {
// contains filtered or unexported fields
}
func (*Asm) Lookup ¶
func (a *Asm) Lookup(name string, repr Representation)
type AsmFunction ¶
type AsmFunction struct {
Function
// AsmName is the name of the assembly function implementing the formula.
// Typically this will be unexported.
AsmName string
}
AsmFunction is a Function implemented in assembly under the hood.
func NewAsmFunctionDefault ¶
func NewAsmFunctionDefault(f Function) AsmFunction
type Function ¶
type Function struct {
Name string
Receiver Parameter
Params []Parameter
Results []Parameter
Globals []Parameter
Formula *ast.Program
}
func (Function) AliasSets ¶
AliasSets returns groups of variable names with a may-alias relationship, meaning there is a possibility they are pointers to the same memory locations.
func (*Function) HasResults ¶
HasResults reports whether f has return values.
func (*Function) IsVoid ¶
IsVoid reports whether f is void. That is, it returns true if the function has no return values.
func (Function) Parameters ¶
Parameters returns all parameters.
func (Function) ParametersWithAction ¶
ParametersWithAction returns all parameters supporting action a.
type Lookup ¶
type Lookup struct {
Name string
Repr Representation
}
Lookup is a table lookup function for a given point representation.
type Parameter ¶
type Parameter interface {
Name() string
Action() Action
Type() types.Type
Variables() map[ast.Variable]Variable
AliasSets(Parameter) [][]ast.Variable
}
type Representation ¶
func (Representation) Equals ¶
func (r Representation) Equals(other Representation) bool
func (Representation) Type ¶
func (r Representation) Type() types.Type