package api
import "github.com/mmcloughlin/avo/internal/api"
Package api determines the API of avo instruction constructors.
Index ¶
- Constants
- func CheckerName(t string) string
- func ISAsIdentifier(isas []string) string
- func ImplicitRegister(r string) string
- func ImplicitRegisterIdentifier(r string) string
- func ImportPath(pkg string) string
- func OperandTypeIdentifier(t string) string
- func SortFunctions(fns []*Function)
- func SuffixesClassIdentifier(c string) string
- type Function
- func InstructionFunctions(i inst.Instruction) []*Function
- func InstructionsFunctions(is []inst.Instruction) []*Function
- func (f *Function) Doc() []string
- func (f *Function) HasSuffix(suffix inst.Suffix) bool
- func (f *Function) Name() string
- func (f *Function) Opcode() string
- func (f *Function) Signature() Signature
- func (f *Function) Summary() string
- type Signature
Constants ¶
const ( // Package is the avo package import path. Package = "github.com/mmcloughlin/avo" // IRPackage is the package that defines intermediate representation types. IRPackage = "ir" // OperandPackage is the package for operand types. OperandPackage = "operand" // OperandType is the type used for operands. OperandType = OperandPackage + ".Op" // RegisterPackage is the name of the package containing register types. RegisterPackage = "reg" // RegisterType is the type used for registers. RegisterType = RegisterPackage + ".Register" )
Functions ¶
func CheckerName ¶
CheckerName returns the name of the function that checks an operand of type t.
func ISAsIdentifier ¶
ISAsIdentifier returns a string representation of an ISA list that suitable for use in a Go identifier.
func ImplicitRegister ¶
ImplicitRegister returns avo syntax for the given implicit register type (from Opcodes XML).
func ImplicitRegisterIdentifier ¶
ImplicitRegisterIdentifier maps an implicit register name to a string suitable for a related Go identifier.
func ImportPath ¶
ImportPath returns the full import path for an avo subpackage.
func OperandTypeIdentifier ¶
OperandTypeIdentifier maps an operand type to a string suitable for a related Go identifier.
func SortFunctions ¶
func SortFunctions(fns []*Function)
SortFunctions sorts a list of functions by name.
func SuffixesClassIdentifier ¶
SuffixesClassIdentifier returns a string representation of a suffix class that's suitable for use in a Go identifier.
Types ¶
type Function ¶
Function represents a function that constructs some collection of instruction forms.
func InstructionFunctions ¶
func InstructionFunctions(i inst.Instruction) []*Function
InstructionFunctions builds the list of all functions for a given instruction.
func InstructionsFunctions ¶
func InstructionsFunctions(is []inst.Instruction) []*Function
InstructionsFunctions builds all functions for a list of instructions.
func (*Function) Doc ¶
Doc returns the function document comment as a list of lines.
func (*Function) HasSuffix ¶
HasSuffix reports whether the function has the provided suffix.
func (*Function) Name ¶
Name returns the function name.
func (*Function) Opcode ¶
Opcode returns the full Go opcode of the instruction built by this function. Includes any suffixes.
func (*Function) Signature ¶
Signature of the function. Derived from the instruction forms generated by this function.
func (*Function) Summary ¶
Summary returns a summary of the instruction this function constructs.
type Signature ¶
type Signature interface { ParameterList() string Arguments() string ParameterName(int) string ParameterSlice() string Length() string }
Signature provides access to details about the signature of an instruction function.
func ArgsList ¶
ArgsList builds a signature for a function with the named parameters.
func Niladic ¶
func Niladic() Signature
Niladic is the signature for a function with no arguments.
func Variadic ¶
Variadic is the signature for a variadic function with the named argument slice.
Source Files ¶
doc.go function.go signature.go types.go
- Version
- v0.6.0 (latest)
- Published
- Jan 7, 2024
- Platform
- linux/amd64
- Imports
- 8 packages
- Last checked
- 1 month ago –
Tools for package owners.