{"modulePath":"github.com/Evolution404/simcore","version":"v1.0.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package asm\n\nProvides support for dealing with EVM assembly instructions (e.g., disassembling them).\n\n## Constants\n\n```go\nconst (\n\tNumbers            = \"1234567890\"                                           // characters representing any decimal number\n\tHexadecimalNumbers = Numbers + \"aAbBcCdDeEfF\"                               // characters representing any hexadecimal\n\tAlpha              = \"abcdefghijklmnopqrstuwvxyzABCDEFGHIJKLMNOPQRSTUWVXYZ\" // characters representing alphanumeric\n)\n```\n\n## Functions\n\n```go\nfunc Disassemble(script []byte) ([]string, error)\n```\nReturn all disassembled EVM instructions in human-readable format. 返回字符串\n\n```go\nfunc Lex(source []byte, debug bool) \u003c-chan token\n```\nlex lexes the program by name with the given source. It returns a channel on which the tokens are delivered. 输入源码,返回一个管道接收token\n\n```go\nfunc NewInstructionIterator(code []byte) *instructionIterator\n```\nCreate a new instruction iterator. 输入字节码(code),创建instructionIterator对象\n\n```go\nfunc PrintDisassembled(code string) error\n```\nPretty-print all disassembled EVM instructions to stdout. 直接打印到stdout上\n\n## Types\n\n```go\ntype Compiler struct {\n\t// contains filtered or unexported fields\n}\n```\nCompiler contains information about the parsed source and holds the tokens for the program.\n\n```go\nfunc NewCompiler(debug bool) *Compiler\n```\nnewCompiler returns a new allocated compiler. 创建新的编译对象,输入代表是否开启Debug\n\n```go\nfunc (c *Compiler) Compile() (string, []error)\n```\nCompile compiles the current tokens and returns a binary string that can be interpreted by the EVM and an error if it failed.\n\ncompile is the second stage in the compile phase which compiles the tokens to EVM instructions.\n\n```go\nfunc (c *Compiler) Feed(ch \u003c-chan token)\n```\nFeed feeds tokens in to ch and are interpreted by the compiler.\n\nfeed is the first pass in the compile stage as it collects the used labels in the program and keeps a program counter which is used to determine the locations of the jump dests. The labels can than be used in the second stage to push labels and determine the right position. 从输入管道中读取词法分析器解析的token\n\n","path":"github.com/Evolution404/simcore/core/asm","name":"asm","synopsis":"Provides support for dealing with EVM assembly instructions (e.g., disassembling them).","isRedistributable":true}
