Documentation ¶
Overview ¶
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
- type Signature
Constants ¶
const ( // Package is the avo package import path. Package = "catinello.eu/x/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" )
Variables ¶
This section is empty.
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) Opcode ¶
Opcode returns the full Go opcode of the instruction built by this function. Includes any suffixes.
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.