asm

package
v0.0.0-...-b78b3a4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 16, 2019 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

为处理EVM装配说明(例如,拆卸它们)提供支持。

Index

Constants

View Source
const (
	Numbers            = "1234567890"                                           //表示任何十进制数的字符
	HexadecimalNumbers = Numbers + "aAbBcCdDeEfF"                               //表示任何十六进制的字符
	Alpha              = "abcdefghijklmnopqrstuwvxyzABCDEFGHIJKLMNOPQRSTUWVXYZ" //表示字母数字的字符
)

Variables

This section is empty.

Functions

func Disassemble

func Disassemble(script []byte) ([]string, error)

以可读的格式返回所有反汇编的EVM指令。

func Lex

func Lex(name string, source []byte, debug bool) <-chan token

lex使用给定的源按名称对程序进行lex。它返回一个 传递令牌的通道。

func NewInstructionIterator

func NewInstructionIterator(code []byte) *instructionIterator

func PrintDisassembled

func PrintDisassembled(code string) error

将所有反汇编的EVM指令打印到stdout。

Types

type Compiler

type Compiler struct {
	// contains filtered or unexported fields
}

编译器包含有关已分析源的信息 并持有程序的令牌。

func NewCompiler

func NewCompiler(debug bool) *Compiler

NewCompiler返回新分配的编译器。

func (*Compiler) Compile

func (c *Compiler) Compile() (string, []error)

编译编译当前令牌并返回一个 可由EVM解释的二进制字符串 如果失败了就会出错。

编译是编译阶段的第二个阶段

func (*Compiler) Feed

func (c *Compiler) Feed(ch <-chan token)

feed将令牌馈送到ch,并由 编译器。

feed是编译阶段的第一个步骤,因为它 收集程序中使用的标签并保留 用于确定位置的程序计数器 跳跃的目的地。标签不能用于 第二阶段推标签并确定正确的 位置。

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL