Documentation ¶
Index ¶
- Variables
- type Compiler
- func (p *Compiler) CallFn(fn interface{})
- func (p *Compiler) Cl(codeText []byte, fname string) int
- func (p *Compiler) Code() *exec.Code
- func (p *Compiler) Compile(fname string) int
- func (p *Compiler) Done()
- func (p *Compiler) Fntable() map[string]interface{}
- func (p *Compiler) Grammar() string
- func (p *Compiler) InjectMethods(cls *exec.Class, code []byte) (err error)
- func (p *Compiler) SetLibs(libs string)
- func (p *Compiler) Stack() interpreter.Stack
- func (p *Compiler) Vars() map[string]interface{}
- type FindEntryError
Constants ¶
This section is empty.
Variables ¶
var ( // FindEntry specifies the policy how qlang searches library file. FindEntry = findEntry // ReadFile specifies the policy how qlang reads source file. ReadFile = ioutil.ReadFile )
var DumpCode int
DumpCode is mode how to dump code. 1 means to dump code with `rem` instruction; 2 means to dump clean code; 0 means don't dump code.
Functions ¶
This section is empty.
Types ¶
type Compiler ¶
A Compiler represents a qlang compiler.
func (*Compiler) CallFn ¶
func (p *Compiler) CallFn(fn interface{})
CallFn generates a function call instruction. It is required by tpl.Interpreter engine.
func (*Compiler) Done ¶
func (p *Compiler) Done()
Done completes all exit functions generated by `Cl`.
func (*Compiler) Fntable ¶
Fntable returns the qlang compiler's function table. It is required by tpl.Interpreter engine.
func (*Compiler) Grammar ¶
Grammar returns the qlang compiler's grammar. It is required by tpl.Interpreter engine.
func (*Compiler) InjectMethods ¶ added in v0.2.4
InjectMethods injects some methods into a class.
func (*Compiler) SetLibs ¶
SetLibs sets searching paths when qlang searchs a library (ie. import a module).
type FindEntryError ¶ added in v0.2.5
An FindEntryError represents a FindEntry error.
func (*FindEntryError) Error ¶ added in v0.2.5
func (e *FindEntryError) Error() string