Documentation ¶
Index ¶
- Constants
- type Chunk
- type Code
- type Constant
- type EConstantType
- type Header
- type LocVar
- type Prototype
- func (me *Prototype) Constants() []Constant
- func (me *Prototype) Instructions() []instruction.LuaInstruction
- func (me *Prototype) IsVararg() byte
- func (me *Prototype) LastLineDefined() uint32
- func (me *Prototype) LineDefined() uint32
- func (me *Prototype) LineInfos() []uint32
- func (me *Prototype) List() []string
- func (me *Prototype) ListConstants() []string
- func (me *Prototype) ListInstructions() []string
- func (me *Prototype) ListLocVars() []string
- func (me *Prototype) ListMeta() []string
- func (me *Prototype) ListName() []string
- func (me *Prototype) ListSubPrototypes() []string
- func (me *Prototype) ListUpvalues() []string
- func (me *Prototype) LocVars() []LocVar
- func (me *Prototype) MaxStackSize() byte
- func (me *Prototype) NumParams() byte
- func (me *Prototype) PrintList()
- func (me *Prototype) Prototypes() []*Prototype
- func (me *Prototype) Source() string
- func (me *Prototype) UpvalueNames() []string
- func (me *Prototype) Upvalues() []Upvalue
- type Reader
- func (me *Reader) ReadByte() byte
- func (me *Reader) ReadBytes(size uint64) []byte
- func (me *Reader) ReadConstant() Constant
- func (me *Reader) ReadConstants() []Constant
- func (me *Reader) ReadInstructions() []instruction.LuaInstruction
- func (me *Reader) ReadLineInfos() []uint32
- func (me *Reader) ReadLocVars() []LocVar
- func (me *Reader) ReadLuaInteger() int64
- func (me *Reader) ReadLuaNumber() float64
- func (me *Reader) ReadPrototype(parentSource string) *Prototype
- func (me *Reader) ReadPrototypes(parentSource string) []*Prototype
- func (me *Reader) ReadString() string
- func (me *Reader) ReadUint32() uint32
- func (me *Reader) ReadUint64() uint64
- func (me *Reader) ReadUpvalueNames() []string
- func (me *Reader) ReadUpvalues() []Upvalue
- type Upvalue
Constants ¶
View Source
const ( // LuaSignature 魔数 LuaSignature = "\x1bLua" // LuacVersion Luac版本 LuacVersion = 0x53 // LuacFormat Luac格式数字 LuacFormat = 0x00 // LuacData Luac预留验证数据 LuacData = "\x19\x93\r\n\x1a\n" // CIntSize Lua虚拟机cint宽度 CIntSize = 4 // SizeTSize Lua虚拟机size_t宽度 SizeTSize = 8 // InstructionSize Lua虚拟机指令宽度 InstructionSize = 4 // LuaIntegerSize Lua虚拟机整数宽度 LuaIntegerSize = 8 // LuaNumberSize Lua虚拟机浮点数宽度 LuaNumberSize = 8 // LuacInt 整数验证数字 LuacInt = 0x5678 // LuacNum 浮点数验证数字 LuacNum = 370.5 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Chunk ¶
type Chunk struct {
// contains filtered or unexported fields
}
Chunk 结构
func (*Chunk) SizeUpdatevalues ¶
SizeUpdatevalues 获取SizeUpdatevalues
type EConstantType ¶
type EConstantType byte
EConstantType Lua常量类型枚举
const ( // ConstantTypeNil nil常量类型 ConstantTypeNil EConstantType = 0x00 // ConstantTypeBoolean 布尔值常量类型 ConstantTypeBoolean EConstantType = 0x01 // ConstantTypeNumber 浮点数常量类型 ConstantTypeNumber EConstantType = 0x03 // ConstantTypeInteger 整数常量类型 ConstantTypeInteger EConstantType = 0x13 // ConstantTypeShortStr 短字符串常量类型 ConstantTypeShortStr EConstantType = 0x04 // ConstantTypeLongStr 长字符串常量类型 ConstantTypeLongStr EConstantType = 0x14 )
type Header ¶
type Header struct {
// contains filtered or unexported fields
}
Header Chunk的Header部分
type Prototype ¶
type Prototype struct {
// contains filtered or unexported fields
}
Prototype 函数原型
func (*Prototype) Instructions ¶
func (me *Prototype) Instructions() []instruction.LuaInstruction
Instructions 指令列表
func (*Prototype) LastLineDefined ¶
LastLineDefined 获取结束行号
func (*Prototype) ListConstants ¶
ListConstants 打印常量列表
func (*Prototype) ListInstructions ¶
ListInstructions 指令列表信息
func (*Prototype) ListSubPrototypes ¶
ListSubPrototypes 子函数原型信息
func (*Prototype) ListUpvalues ¶
ListUpvalues Upvalue信息
func (*Prototype) UpvalueNames ¶
UpvalueNames 获取Upvalue名列表
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
Reader 读取器
func (*Reader) ReadInstructions ¶
func (me *Reader) ReadInstructions() []instruction.LuaInstruction
ReadInstructions 读取Lua虚拟机指令
func (*Reader) ReadPrototype ¶
ReadPrototype 读取函数原型
func (*Reader) ReadPrototypes ¶
ReadPrototypes 读取函数原型列表
func (*Reader) ReadUpvalueNames ¶
ReadUpvalueNames 读取Upvalue名称列表
Click to show internal directories.
Click to hide internal directories.