Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Compiler ¶
type Compiler struct { // The generated bytecode Bytes []byte Constants []object.Object Names []string Jumps []int }
A Compiler translates an AST into some bytecode.
func (*Compiler) Compile ¶
Compile compiles an ast.Program into bytecode, returning any errors. The bytecode, constants, and names, are stored in the Compiler instance in the respective fields.
func (*Compiler) CompileExpression ¶
func (c *Compiler) CompileExpression(e ast.Expression) error
CompileExpression takes an AST expression and generates some bytecode for it.
Click to show internal directories.
Click to hide internal directories.