Provides support for dealing with EVM assembly instructions (e.g., disassembling them).
instructionIterator
// Iterator for disassembled EVM instructions
type instructionIterator struct {
code []byte
pc uint64
arg []byte
op vm.OpCode
error error
started bool
}
Compiler
// Compiler contains information about the parsed source
// and holds the tokens for the program.
type Compiler struct {
tokens []token
binary []interface{}
labels map[string]int
pc, pos int
debug bool
}
lexer
// lexer is the basic construct for parsing
// source code and turning them in to tokens.
// Tokens are interpreted by the compiler.
type lexer struct {
input string // input contains the source code of the program
tokens chan token // tokens is used to deliver tokens to the listener
state stateFn // the current state function
lineno int // current line number in the source file
start, pos, width int // positions for lexing and returning value
debug bool // flag for triggering debug output
}