bytecode

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2017 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// label types
	LabelDef      = "Def"
	LabelDefClass = "DefClass"
	Block         = "Block"
	Program       = "ProgramStart"

	// instruction actions
	GetLocal            = "getlocal"
	GetConstant         = "getconstant"
	GetInstanceVariable = "getinstancevariable"
	SetLocal            = "setlocal"
	SetConstant         = "setconstant"
	SetInstanceVariable = "setinstancevariable"
	PutString           = "putstring"
	PutSelf             = "putself"
	PutObject           = "putobject"
	PutNull             = "putnil"
	NewArray            = "newarray"
	NewHash             = "newhash"
	BranchUnless        = "branchunless"
	BranchIf            = "branchif"
	Jump                = "jump"
	DefMethod           = "def_method"
	DefSingletonMethod  = "def_singleton_method"
	DefClass            = "def_class"
	Send                = "send"
	InvokeBlock         = "invokeblock"
	Pop                 = "pop"
	Leave               = "leave"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Generator

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

Generator contains program's AST and will store generated instruction sets

func NewGenerator

func NewGenerator(program *ast.Program) *Generator

NewGenerator initializes new Generator with complete AST tree.

func (*Generator) GenerateByteCode

func (g *Generator) GenerateByteCode(program *ast.Program) string

GenerateByteCode returns compiled bytecodes

Jump to

Keyboard shortcuts

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