Documentation
¶
Index ¶
- func CompileDir(dir string) (*ir.Module, error)
- func CompileSrc(filename string, src string) (*ir.Module, error)
- func EvaluateString(s string) string
- type Boolean
- type Float
- func (f *Float) Cleanup(_ *Program)
- func (f *Float) Copy() Value
- func (f *Float) Data(p *Program) value.Value
- func (f *Float) IsShort() bool
- func (f *Float) Long(p *Program) value.Value
- func (f *Float) SetOwned(_ bool)
- func (f *Float) SetValue(newVal value.Value)
- func (f *Float) Short(p *Program) value.Value
- func (f *Float) Value() value.Value
- type Int
- func (i *Int) Cleanup(_ *Program)
- func (i *Int) Copy() Value
- func (i *Int) Data(_ *Program) value.Value
- func (i *Int) IsShort() bool
- func (i *Int) Long(p *Program) value.Value
- func (i *Int) SetOwned(_ bool)
- func (i *Int) SetValue(newVal value.Value)
- func (i *Int) Short(p *Program) value.Value
- func (i *Int) Value() value.Value
- type Module
- type Program
- func (p *Program) AddFile(file *ast.File) error
- func (p *Program) BinaryExpr(lhs, rhs Value, op token.Token, opPos token.Pos, lPos token.Pos) (Value, error)
- func (p *Program) BinaryExprFloat(l, r *Float, op token.Token, opPos token.Pos, lPos token.Pos) (Value, error)
- func (p *Program) BinaryExprInt(l, r *Int, op token.Token, opPos token.Pos, lPos token.Pos) (Value, error)
- func (p *Program) BinaryExprString(l, r *String, op token.Token, opPos token.Pos, lPos token.Pos) (Value, error)
- func (p *Program) CleanupFunc()
- func (p *Program) CompileAssignStmt(stm *ast.AssignStmt) error
- func (p *Program) CompileBasicLit(lit *ast.BasicLit) (Value, error)
- func (p *Program) CompileBinaryExpr(expr *ast.BinaryExpr) (Value, error)
- func (p *Program) CompileCallExpr(expr *ast.CallExpr) (Value, error)
- func (p *Program) CompileDecl(decl ast.Decl) error
- func (p *Program) CompileExpr(expr ast.Expr) (Value, error)
- func (p *Program) CompileForStmt(stm *ast.ForStmt) error
- func (p *Program) CompileFuncDecl(decl *ast.FuncDecl) error
- func (p *Program) CompileGenDecl(decl *ast.GenDecl) error
- func (p *Program) CompileIdent(stm *ast.Ident) (Value, error)
- func (p *Program) CompileIfStmt(stm *ast.IfStmt) error
- func (p *Program) CompileIncDecStmt(stm *ast.IncDecStmt) error
- func (p *Program) CompileReturnStmt(stm *ast.ReturnStmt) error
- func (p *Program) CompileSpec(spec ast.Spec) error
- func (p *Program) CompileStmt(stmt ast.Stmt) error
- func (p *Program) ConvertTypeString(t string) types.Type
- func (p *Program) End()
- func (p *Program) GetStorable(expr ast.Expr, val Value, redefine bool) (value.Value, error)
- func (p *Program) GetValFromType(n ast.Node, kind types.Type) (Value, error)
- func (p *Program) NewString(len value.Value, val value.Value) *String
- func (p *Program) NewStringFromGo(val string) *String
- func (p *Program) Pos(node ast.Node) string
- type String
- type Value
- type Variable
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EvaluateString ¶
Types ¶
type Boolean ¶
type Boolean struct {
// contains filtered or unexported fields
}
func NewBoolConst ¶
type Program ¶
type Program struct {
M *ir.Module
Fset *token.FileSet
Fn *ir.Func
Block *ir.Block
Vars map[string]Variable
Funcs map[string]*ir.Func
Modules map[string]Module
TmpUsed int
CFuncs map[string]*ir.Func
}
func (*Program) BinaryExpr ¶
func (*Program) BinaryExprFloat ¶
func (*Program) BinaryExprInt ¶
func (*Program) BinaryExprString ¶
func (*Program) CleanupFunc ¶
func (p *Program) CleanupFunc()
func (*Program) CompileAssignStmt ¶
func (p *Program) CompileAssignStmt(stm *ast.AssignStmt) error
func (*Program) CompileBasicLit ¶
func (*Program) CompileBinaryExpr ¶
func (p *Program) CompileBinaryExpr(expr *ast.BinaryExpr) (Value, error)
func (*Program) CompileCallExpr ¶
func (*Program) CompileIncDecStmt ¶
func (p *Program) CompileIncDecStmt(stm *ast.IncDecStmt) error
func (*Program) CompileReturnStmt ¶
func (p *Program) CompileReturnStmt(stm *ast.ReturnStmt) error
func (*Program) GetStorable ¶
func (*Program) GetValFromType ¶
func (*Program) NewStringFromGo ¶
Click to show internal directories.
Click to hide internal directories.