Documentation
¶
Index ¶
- type CodePrinter
- type Contract
- type ContractGlobal
- type Function
- type FunctionGlobal
- type Global
- type GlobalInfo
- type GlobalKind
- type Import
- type ImportedGlobal
- type InstructionProgram
- type LineNumberTable
- type Position
- type PositionInfo
- type Program
- type ProgramPrinter
- type StaticType
- type TypeDecoder
- type Variable
- type VariableGlobal
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CodePrinter ¶
type ContractGlobal ¶ added in v1.8.0
type ContractGlobal struct {
GlobalInfo
Contract *Contract
}
func NewContractGlobal ¶ added in v1.8.0
func NewContractGlobal( memoryGauge common.MemoryGauge, name string, location common.Location, index uint16, ) *ContractGlobal
func (ContractGlobal) GetGlobalInfo ¶ added in v1.8.0
func (g ContractGlobal) GetGlobalInfo() GlobalInfo
type Function ¶
type Function[E any] struct { Name string QualifiedName string Code []E ParameterCount uint16 TypeParameterCount uint16 LocalCount uint16 TypeIndex uint16 LineNumbers LineNumberTable }
func (Function[E]) IsAnonymous ¶
type FunctionGlobal ¶ added in v1.8.0
type FunctionGlobal[E any] struct { GlobalInfo Function *Function[E] }
func NewFunctionGlobal ¶ added in v1.8.0
func NewFunctionGlobal[E any]( memoryGauge common.MemoryGauge, name string, location common.Location, index uint16, ) *FunctionGlobal[E]
func (FunctionGlobal[E]) GetGlobalInfo ¶ added in v1.8.0
func (g FunctionGlobal[E]) GetGlobalInfo() GlobalInfo
type Global ¶ added in v1.8.0
type Global interface {
GetGlobalInfo() GlobalInfo
}
type GlobalInfo ¶ added in v1.8.0
type GlobalInfo struct {
Name string
// Need to maintain both "qualified" and "unqualified" names for a global,
// because when type-aliasing is used, imported global name becomes qualified.
// However, the same imported-global must use the unqualified name when linking.
// TODO: We can simplify this by always using qualified names for all imports.
QualifiedName string
Location common.Location
Index uint16
}
type GlobalKind ¶ added in v1.8.0
type GlobalKind int
const ( GlobalKindFunction GlobalKind = iota GlobalKindVariable GlobalKindContract GlobalKindImported )
type ImportedGlobal ¶ added in v1.8.0
type ImportedGlobal struct {
GlobalInfo
}
func NewImportedGlobal ¶ added in v1.8.0
func NewImportedGlobal( memoryGauge common.MemoryGauge, name string, qualifiedName string, location common.Location, index uint16, ) *ImportedGlobal
func (ImportedGlobal) GetGlobalInfo ¶ added in v1.8.0
func (g ImportedGlobal) GetGlobalInfo() GlobalInfo
type InstructionProgram ¶
type InstructionProgram = Program[opcode.Instruction, StaticType]
type LineNumberTable ¶
type LineNumberTable struct {
Positions []PositionInfo
}
LineNumberTable holds the instruction-index to source-position mapping. It only maintains an entry for an instruction only if the position info got changed during that instruction. i.e: If multiple consecutive instructions were emitted for the same source-code position, then only the first instruction of that instruction-set would be available in the table.
func (*LineNumberTable) AddPositionInfo ¶
func (t *LineNumberTable) AddPositionInfo(bytecodeIndex uint16, position Position)
func (*LineNumberTable) GetSourcePosition ¶
func (t *LineNumberTable) GetSourcePosition(instructionIndex uint16) Position
type Position ¶
func (Position) EndPosition ¶
func (p Position) EndPosition(_ common.MemoryGauge) ast.Position
func (Position) StartPosition ¶
type PositionInfo ¶
type ProgramPrinter ¶
type ProgramPrinter[E, T any] struct { // contains filtered or unexported fields }
func NewInstructionsProgramPrinter ¶
func NewInstructionsProgramPrinter(resolve bool, colorize bool, showFlow bool) *ProgramPrinter[opcode.Instruction, StaticType]
func (*ProgramPrinter[E, T]) PrintProgram ¶
func (p *ProgramPrinter[E, T]) PrintProgram(program *Program[E, T]) string
type StaticType ¶
type StaticType = interpreter.StaticType
type TypeDecoder ¶
type TypeDecoder[T any] func(bytes T) (StaticType, error)
type VariableGlobal ¶ added in v1.8.0
type VariableGlobal[E any] struct { GlobalInfo Variable *Variable[E] }
func NewVariableGlobal ¶ added in v1.8.0
func NewVariableGlobal[E any]( memoryGauge common.MemoryGauge, name string, location common.Location, index uint16, ) *VariableGlobal[E]
func (VariableGlobal[E]) GetGlobalInfo ¶ added in v1.8.0
func (g VariableGlobal[E]) GetGlobalInfo() GlobalInfo
Source Files
¶
Click to show internal directories.
Click to hide internal directories.