agora: github.com/PuerkitoBio/agora/compiler/emitter Index | Files

package emitter

import "github.com/PuerkitoBio/agora/compiler/emitter"

Package emitter generates the bytecode instructions by traversing the abstract syntax tree generated by the parser.

Index

Package Files

emitter.go

type Emitter Uses

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

An Emitter is responsible for generating the instructions for an agora program.

func (*Emitter) Emit Uses

func (e *Emitter) Emit(id string, syms []*parser.Symbol, scps *parser.Scope) (*bytecode.File, error)

Emit takes a module identifier, the symbols generated by the parser (the headless *AST*), and the root scope, and emits the instructions required to execute the program. It returns the in-memory bytecode representation of the program. If an error is encountered, it is returned as second value, otherwise it returns nil.

Package emitter imports 5 packages (graph) and is imported by 13 packages. Updated 2016-08-02. Refresh now. Tools for package owners.