Documentation
¶
Index ¶
- Constants
- Variables
- func TypeGet(size int) int
- func TypeSize(t int) int
- type AbsoluteAddress
- func (self *AbsoluteAddress) AsOperand() core.IOperand
- func (self *AbsoluteAddress) CollectStatistics(stats core.IStatistics)
- func (self AbsoluteAddress) GetRegister() core.IOperand
- func (self AbsoluteAddress) IsMemoryReference() bool
- func (self AbsoluteAddress) IsRegister() bool
- func (self *AbsoluteAddress) ToSource(table core.ISymbolTable) string
- type Comment
- func (self *Comment) AsAssembly() core.IAssembly
- func (self *Comment) CollectStatistics(stats core.IStatistics)
- func (self Comment) IsComment() bool
- func (self Comment) IsDirective() bool
- func (self Comment) IsInstruction() bool
- func (self Comment) IsLabel() bool
- func (self *Comment) ToSource(table core.ISymbolTable) string
- type DirectMemoryReference
- func (self *DirectMemoryReference) AsMemoryReference() core.IMemoryReference
- func (self *DirectMemoryReference) AsOperand() core.IOperand
- func (self *DirectMemoryReference) CollectStatistics(stats core.IStatistics)
- func (self *DirectMemoryReference) FixOffset(n int64)
- func (self DirectMemoryReference) GetValue() core.ILiteral
- func (self DirectMemoryReference) IsMemoryReference() bool
- func (self DirectMemoryReference) IsRegister() bool
- func (self *DirectMemoryReference) String() string
- func (self *DirectMemoryReference) ToSource(table core.ISymbolTable) string
- type Directive
- func (self *Directive) AsAssembly() core.IAssembly
- func (self *Directive) CollectStatistics(stats core.IStatistics)
- func (self Directive) IsComment() bool
- func (self Directive) IsDirective() bool
- func (self Directive) IsInstruction() bool
- func (self Directive) IsLabel() bool
- func (self *Directive) ToSource(table core.ISymbolTable) string
- type ImmediateValue
- func (self *ImmediateValue) AsImmediateValue() core.IImmediateValue
- func (self *ImmediateValue) AsOperand() core.IOperand
- func (self *ImmediateValue) CollectStatistics(stats core.IStatistics)
- func (self ImmediateValue) GetExpr() core.ILiteral
- func (self ImmediateValue) IsMemoryReference() bool
- func (self ImmediateValue) IsRegister() bool
- func (self *ImmediateValue) ToSource(table core.ISymbolTable) string
- type IndirectMemoryReference
- func (self *IndirectMemoryReference) AsMemoryReference() core.IMemoryReference
- func (self *IndirectMemoryReference) AsOperand() core.IOperand
- func (self *IndirectMemoryReference) CollectStatistics(stats core.IStatistics)
- func (self *IndirectMemoryReference) FixOffset(diff int64)
- func (self IndirectMemoryReference) IsMemoryReference() bool
- func (self IndirectMemoryReference) IsRegister() bool
- func (self *IndirectMemoryReference) String() string
- func (self *IndirectMemoryReference) ToSource(table core.ISymbolTable) string
- type Instruction
- func (self *Instruction) AsAssembly() core.IAssembly
- func (self *Instruction) CollectStatistics(stats core.IStatistics)
- func (self Instruction) GetMnemonic() string
- func (self Instruction) IsComment() bool
- func (self Instruction) IsDirective() bool
- func (self Instruction) IsInstruction() bool
- func (self Instruction) IsJumpInstruction() bool
- func (self Instruction) IsLabel() bool
- func (self Instruction) JumpDestination() core.ISymbol
- func (self Instruction) NumOperands() int
- func (self Instruction) Operand1() core.IOperand
- func (self Instruction) Operand2() core.IOperand
- func (self *Instruction) ToSource(table core.ISymbolTable) string
- type IntegerLiteral
- func (self *IntegerLiteral) AsLiteral() core.ILiteral
- func (self *IntegerLiteral) CollectStatistics(stats core.IStatistics)
- func (self IntegerLiteral) GetValue() int64
- func (self IntegerLiteral) IsZero() bool
- func (self IntegerLiteral) String() string
- func (self *IntegerLiteral) ToSource(table core.ISymbolTable) string
- type Label
- func (self *Label) AsAssembly() core.IAssembly
- func (self *Label) CollectStatistics(stats core.IStatistics)
- func (self Label) GetSymbol() core.ISymbol
- func (self Label) IsComment() bool
- func (self Label) IsDirective() bool
- func (self Label) IsInstruction() bool
- func (self Label) IsLabel() bool
- func (self *Label) ToSource(table core.ISymbolTable) string
- type NamedSymbol
- func (self *NamedSymbol) AsLiteral() core.ILiteral
- func (self *NamedSymbol) AsSymbol() core.ISymbol
- func (self *NamedSymbol) CollectStatistics(stats core.IStatistics)
- func (self NamedSymbol) GetName() string
- func (self NamedSymbol) IsZero() bool
- func (self NamedSymbol) String() string
- func (self *NamedSymbol) ToSource(table core.ISymbolTable) string
- type Statistics
- func (self *Statistics) AsStatistics() core.IStatistics
- func (self *Statistics) DoesInstructionUsed(insn string) bool
- func (self *Statistics) DoesRegisterUsed(reg core.IRegister) bool
- func (self *Statistics) DoesSymbolUsed(sym core.ISymbol) bool
- func (self *Statistics) InstructionUsed(insn string)
- func (self *Statistics) NumInstructionUsed(insn string) int
- func (self *Statistics) NumRegisterUsed(reg core.IRegister) int
- func (self *Statistics) NumSymbolUsed(sym core.ISymbol) int
- func (self *Statistics) RegisterUsed(reg core.IRegister)
- func (self *Statistics) SymbolUsed(sym core.ISymbol)
- type SuffixedSymbol
- func (self *SuffixedSymbol) AsLiteral() core.ILiteral
- func (self *SuffixedSymbol) AsSymbol() core.ISymbol
- func (self *SuffixedSymbol) CollectStatistics(stats core.IStatistics)
- func (self SuffixedSymbol) GetName() string
- func (self SuffixedSymbol) IsZero() bool
- func (self SuffixedSymbol) String() string
- func (self *SuffixedSymbol) ToSource(table core.ISymbolTable) string
- type SymbolTable
- type UnnamedSymbol
- func (self *UnnamedSymbol) AsLiteral() core.ILiteral
- func (self *UnnamedSymbol) AsSymbol() core.ISymbol
- func (self *UnnamedSymbol) CollectStatistics(stats core.IStatistics)
- func (self UnnamedSymbol) GetName() string
- func (self UnnamedSymbol) IsZero() bool
- func (self UnnamedSymbol) String() string
- func (self *UnnamedSymbol) ToSource(table core.ISymbolTable) string
Constants ¶
View Source
const ( TYPE_INT8 = iota TYPE_INT16 TYPE_INT32 TYPE_INT64 )
Variables ¶
View Source
var DUMMY_SYMBOL_BASE = "L"
View Source
var DummySymbolTable = NewSymbolTable(DUMMY_SYMBOL_BASE)
Functions ¶
Types ¶
type AbsoluteAddress ¶
func NewAbsoluteAddress ¶
func NewAbsoluteAddress(reg core.IRegister) *AbsoluteAddress
func (*AbsoluteAddress) AsOperand ¶
func (self *AbsoluteAddress) AsOperand() core.IOperand
func (*AbsoluteAddress) CollectStatistics ¶
func (self *AbsoluteAddress) CollectStatistics(stats core.IStatistics)
func (AbsoluteAddress) GetRegister ¶
func (self AbsoluteAddress) GetRegister() core.IOperand
func (AbsoluteAddress) IsMemoryReference ¶
func (self AbsoluteAddress) IsMemoryReference() bool
func (AbsoluteAddress) IsRegister ¶
func (self AbsoluteAddress) IsRegister() bool
func (*AbsoluteAddress) ToSource ¶
func (self *AbsoluteAddress) ToSource(table core.ISymbolTable) string
type Comment ¶
func NewComment ¶
func (*Comment) AsAssembly ¶
func (*Comment) CollectStatistics ¶
func (self *Comment) CollectStatistics(stats core.IStatistics)
func (Comment) IsDirective ¶
func (Comment) IsInstruction ¶
type DirectMemoryReference ¶
func NewDirectMemoryReference ¶
func NewDirectMemoryReference(val core.ILiteral) *DirectMemoryReference
func (*DirectMemoryReference) AsMemoryReference ¶
func (self *DirectMemoryReference) AsMemoryReference() core.IMemoryReference
func (*DirectMemoryReference) AsOperand ¶
func (self *DirectMemoryReference) AsOperand() core.IOperand
func (*DirectMemoryReference) CollectStatistics ¶
func (self *DirectMemoryReference) CollectStatistics(stats core.IStatistics)
func (*DirectMemoryReference) FixOffset ¶
func (self *DirectMemoryReference) FixOffset(n int64)
func (DirectMemoryReference) GetValue ¶
func (self DirectMemoryReference) GetValue() core.ILiteral
func (DirectMemoryReference) IsMemoryReference ¶
func (self DirectMemoryReference) IsMemoryReference() bool
func (DirectMemoryReference) IsRegister ¶
func (self DirectMemoryReference) IsRegister() bool
func (*DirectMemoryReference) String ¶
func (self *DirectMemoryReference) String() string
func (*DirectMemoryReference) ToSource ¶
func (self *DirectMemoryReference) ToSource(table core.ISymbolTable) string
type Directive ¶
func NewDirective ¶
func (*Directive) AsAssembly ¶
func (*Directive) CollectStatistics ¶
func (self *Directive) CollectStatistics(stats core.IStatistics)
func (Directive) IsDirective ¶
func (Directive) IsInstruction ¶
type ImmediateValue ¶
func NewImmediateValue ¶
func NewImmediateValue(val core.ILiteral) *ImmediateValue
func (*ImmediateValue) AsImmediateValue ¶
func (self *ImmediateValue) AsImmediateValue() core.IImmediateValue
func (*ImmediateValue) AsOperand ¶
func (self *ImmediateValue) AsOperand() core.IOperand
func (*ImmediateValue) CollectStatistics ¶
func (self *ImmediateValue) CollectStatistics(stats core.IStatistics)
func (ImmediateValue) GetExpr ¶
func (self ImmediateValue) GetExpr() core.ILiteral
func (ImmediateValue) IsMemoryReference ¶
func (self ImmediateValue) IsMemoryReference() bool
func (ImmediateValue) IsRegister ¶
func (self ImmediateValue) IsRegister() bool
func (*ImmediateValue) ToSource ¶
func (self *ImmediateValue) ToSource(table core.ISymbolTable) string
type IndirectMemoryReference ¶
type IndirectMemoryReference struct { ClassName string Offset core.ILiteral Base core.IRegister Fixed bool }
func (*IndirectMemoryReference) AsMemoryReference ¶
func (self *IndirectMemoryReference) AsMemoryReference() core.IMemoryReference
func (*IndirectMemoryReference) AsOperand ¶
func (self *IndirectMemoryReference) AsOperand() core.IOperand
func (*IndirectMemoryReference) CollectStatistics ¶
func (self *IndirectMemoryReference) CollectStatistics(stats core.IStatistics)
func (*IndirectMemoryReference) FixOffset ¶
func (self *IndirectMemoryReference) FixOffset(diff int64)
func (IndirectMemoryReference) IsMemoryReference ¶
func (self IndirectMemoryReference) IsMemoryReference() bool
func (IndirectMemoryReference) IsRegister ¶
func (self IndirectMemoryReference) IsRegister() bool
func (*IndirectMemoryReference) String ¶
func (self *IndirectMemoryReference) String() string
func (*IndirectMemoryReference) ToSource ¶
func (self *IndirectMemoryReference) ToSource(table core.ISymbolTable) string
type Instruction ¶
type Instruction struct { ClassName string Mnemonic string Suffix string Operands []core.IOperand NeedRelocation bool }
func NewInstruction ¶
func (*Instruction) AsAssembly ¶
func (self *Instruction) AsAssembly() core.IAssembly
func (*Instruction) CollectStatistics ¶
func (self *Instruction) CollectStatistics(stats core.IStatistics)
func (Instruction) GetMnemonic ¶
func (self Instruction) GetMnemonic() string
func (Instruction) IsComment ¶
func (self Instruction) IsComment() bool
func (Instruction) IsDirective ¶
func (self Instruction) IsDirective() bool
func (Instruction) IsInstruction ¶
func (self Instruction) IsInstruction() bool
func (Instruction) IsJumpInstruction ¶
func (self Instruction) IsJumpInstruction() bool
func (Instruction) IsLabel ¶
func (self Instruction) IsLabel() bool
func (Instruction) JumpDestination ¶
func (self Instruction) JumpDestination() core.ISymbol
func (Instruction) NumOperands ¶
func (self Instruction) NumOperands() int
func (Instruction) Operand1 ¶
func (self Instruction) Operand1() core.IOperand
func (Instruction) Operand2 ¶
func (self Instruction) Operand2() core.IOperand
func (*Instruction) ToSource ¶
func (self *Instruction) ToSource(table core.ISymbolTable) string
type IntegerLiteral ¶
func NewIntegerLiteral ¶
func NewIntegerLiteral(n int64) *IntegerLiteral
func (*IntegerLiteral) AsLiteral ¶
func (self *IntegerLiteral) AsLiteral() core.ILiteral
func (*IntegerLiteral) CollectStatistics ¶
func (self *IntegerLiteral) CollectStatistics(stats core.IStatistics)
func (IntegerLiteral) GetValue ¶
func (self IntegerLiteral) GetValue() int64
func (IntegerLiteral) IsZero ¶
func (self IntegerLiteral) IsZero() bool
func (IntegerLiteral) String ¶
func (self IntegerLiteral) String() string
func (*IntegerLiteral) ToSource ¶
func (self *IntegerLiteral) ToSource(table core.ISymbolTable) string
type Label ¶
func NewUnnamedLabel ¶
func NewUnnamedLabel() *Label
func (*Label) AsAssembly ¶
func (*Label) CollectStatistics ¶
func (self *Label) CollectStatistics(stats core.IStatistics)
func (Label) IsDirective ¶
func (Label) IsInstruction ¶
type NamedSymbol ¶
func NewNamedSymbol ¶
func NewNamedSymbol(name string) *NamedSymbol
func (*NamedSymbol) AsLiteral ¶
func (self *NamedSymbol) AsLiteral() core.ILiteral
func (*NamedSymbol) AsSymbol ¶
func (self *NamedSymbol) AsSymbol() core.ISymbol
func (*NamedSymbol) CollectStatistics ¶
func (self *NamedSymbol) CollectStatistics(stats core.IStatistics)
func (NamedSymbol) GetName ¶
func (self NamedSymbol) GetName() string
func (NamedSymbol) IsZero ¶
func (self NamedSymbol) IsZero() bool
func (NamedSymbol) String ¶
func (self NamedSymbol) String() string
func (*NamedSymbol) ToSource ¶
func (self *NamedSymbol) ToSource(table core.ISymbolTable) string
type Statistics ¶
type Statistics struct {
// contains filtered or unexported fields
}
func CollectStatistics ¶
func CollectStatistics(assemblies []core.IAssembly) *Statistics
func NewStatistics ¶
func NewStatistics() *Statistics
func (*Statistics) AsStatistics ¶
func (self *Statistics) AsStatistics() core.IStatistics
func (*Statistics) DoesInstructionUsed ¶
func (self *Statistics) DoesInstructionUsed(insn string) bool
func (*Statistics) DoesRegisterUsed ¶
func (self *Statistics) DoesRegisterUsed(reg core.IRegister) bool
func (*Statistics) DoesSymbolUsed ¶
func (self *Statistics) DoesSymbolUsed(sym core.ISymbol) bool
func (*Statistics) InstructionUsed ¶
func (self *Statistics) InstructionUsed(insn string)
func (*Statistics) NumInstructionUsed ¶
func (self *Statistics) NumInstructionUsed(insn string) int
func (*Statistics) NumRegisterUsed ¶
func (self *Statistics) NumRegisterUsed(reg core.IRegister) int
func (*Statistics) NumSymbolUsed ¶
func (self *Statistics) NumSymbolUsed(sym core.ISymbol) int
func (*Statistics) RegisterUsed ¶
func (self *Statistics) RegisterUsed(reg core.IRegister)
func (*Statistics) SymbolUsed ¶
func (self *Statistics) SymbolUsed(sym core.ISymbol)
type SuffixedSymbol ¶
func NewSuffixedSymbol ¶
func NewSuffixedSymbol(base core.ISymbol, suffix string) *SuffixedSymbol
func (*SuffixedSymbol) AsLiteral ¶
func (self *SuffixedSymbol) AsLiteral() core.ILiteral
func (*SuffixedSymbol) AsSymbol ¶
func (self *SuffixedSymbol) AsSymbol() core.ISymbol
func (*SuffixedSymbol) CollectStatistics ¶
func (self *SuffixedSymbol) CollectStatistics(stats core.IStatistics)
func (SuffixedSymbol) GetName ¶
func (self SuffixedSymbol) GetName() string
func (SuffixedSymbol) IsZero ¶
func (self SuffixedSymbol) IsZero() bool
func (SuffixedSymbol) String ¶
func (self SuffixedSymbol) String() string
func (*SuffixedSymbol) ToSource ¶
func (self *SuffixedSymbol) ToSource(table core.ISymbolTable) string
type SymbolTable ¶
type SymbolTable struct { ClassName string Base string Seq int // contains filtered or unexported fields }
func NewSymbolTable ¶
func NewSymbolTable(base string) *SymbolTable
func (*SymbolTable) AsSymbolTable ¶
func (self *SymbolTable) AsSymbolTable() core.ISymbolTable
func (*SymbolTable) NewSymbol ¶
func (self *SymbolTable) NewSymbol() core.ISymbol
func (*SymbolTable) SymbolString ¶
func (self *SymbolTable) SymbolString(sym core.ISymbol) string
type UnnamedSymbol ¶
type UnnamedSymbol struct {
ClassName string
}
func NewUnnamedSymbol ¶
func NewUnnamedSymbol() *UnnamedSymbol
func (*UnnamedSymbol) AsLiteral ¶
func (self *UnnamedSymbol) AsLiteral() core.ILiteral
func (*UnnamedSymbol) AsSymbol ¶
func (self *UnnamedSymbol) AsSymbol() core.ISymbol
func (*UnnamedSymbol) CollectStatistics ¶
func (self *UnnamedSymbol) CollectStatistics(stats core.IStatistics)
func (UnnamedSymbol) GetName ¶
func (self UnnamedSymbol) GetName() string
func (UnnamedSymbol) IsZero ¶
func (self UnnamedSymbol) IsZero() bool
func (UnnamedSymbol) String ¶
func (self UnnamedSymbol) String() string
func (*UnnamedSymbol) ToSource ¶
func (self *UnnamedSymbol) ToSource(table core.ISymbolTable) string
Click to show internal directories.
Click to hide internal directories.