Documentation
¶
Index ¶
- func CastNumberLiteral(ast Ast, to AstType) (Ast, bool)
- func Execute(ctx *ExecutionContext, ast Ast) (interface{}, error)
- func ToAstType(ty AstOpCodeType) AstType
- func ToOpCodeType(ty AstType) AstOpCodeType
- type ExecutionContext
- func (p *ExecutionContext) CaptureVariable(vi *VariableInfo, newName string) (*VariableInfo, bool)
- func (p *ExecutionContext) DefineVariable(name string, vi VariableInfo) (*VariableInfo, bool)
- func (p *ExecutionContext) DummyTypeId() uint32
- func (p *ExecutionContext) GetRegisteredTypeInfo(ty tsys.TypeInfo) (tsys.TypeInfo, error)
- func (p *ExecutionContext) GetTypeInfoById(id uint32) (tsys.TypeInfo, error)
- func (p *ExecutionContext) GetTypeInfoByName(name string) (tsys.TypeInfo, error)
- func (p *ExecutionContext) GetVariableInfo(name string) (*VariableInfo, bool)
- func (p *ExecutionContext) NewTypeId() uint32
- func (p *ExecutionContext) PopScope() bool
- func (p *ExecutionContext) PushFuncScope(returnType mnem.AstOpCodeType)
- func (p *ExecutionContext) PushLambdaScope(returnType mnem.AstOpCodeType)
- func (p *ExecutionContext) PushScope(returnType mnem.AstOpCodeType)
- func (p *ExecutionContext) ResetScope()
- type ExecutionScope
- type ExecutionScopeType
- type VariableInfo
- func (p *VariableInfo) ComplexMapIndex(k interface{}) Box
- func (p *VariableInfo) GetAny() interface{}
- func (p *VariableInfo) GetBool() bool
- func (p *VariableInfo) GetBytes() []byte
- func (p *VariableInfo) GetFloat() float64
- func (p *VariableInfo) GetInt() int64
- func (p *VariableInfo) GetPointer() unsafe.Pointer
- func (p *VariableInfo) GetString() string
- func (p *VariableInfo) GetUint() uint64
- func (p *VariableInfo) Index(i int) Box
- func (p *VariableInfo) MapIndex(k string) Box
- func (p *VariableInfo) SetAny(v interface{})
- func (p *VariableInfo) SetBool(v bool)
- func (p *VariableInfo) SetBytes(v []byte)
- func (p *VariableInfo) SetFloat(v float64)
- func (p *VariableInfo) SetInt(v int64)
- func (p *VariableInfo) SetPointer(v unsafe.Pointer)
- func (p *VariableInfo) SetString(v string)
- func (p *VariableInfo) SetUint(v uint64)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CastNumberLiteral ¶
func CastNumberLiteral(ast Ast, to AstType) (Ast, bool)
func Execute ¶
func Execute(ctx *ExecutionContext, ast Ast) (interface{}, error)
func ToAstType ¶
func ToAstType(ty AstOpCodeType) AstType
TODO: BUG: `xtor.ToAstType` returns w/o checking type marker flags
func ToOpCodeType ¶
func ToOpCodeType(ty AstType) AstOpCodeType
Types ¶
type ExecutionContext ¶
type ExecutionContext struct {
RootScope *ExecutionScope
ModuleScope *ExecutionScope
LastModuleScope *ExecutionScope
Scope *ExecutionScope
// contains filtered or unexported fields
}
func NewExecutionContext ¶
func NewExecutionContext(rootScope *ExecutionScope) *ExecutionContext
func (*ExecutionContext) CaptureVariable ¶
func (p *ExecutionContext) CaptureVariable(vi *VariableInfo, newName string) (*VariableInfo, bool)
func (*ExecutionContext) DefineVariable ¶
func (p *ExecutionContext) DefineVariable(name string, vi VariableInfo) (*VariableInfo, bool)
func (*ExecutionContext) DummyTypeId ¶
func (p *ExecutionContext) DummyTypeId() uint32
func (*ExecutionContext) GetRegisteredTypeInfo ¶
TODO:
func (*ExecutionContext) GetTypeInfoById ¶
func (p *ExecutionContext) GetTypeInfoById(id uint32) (tsys.TypeInfo, error)
TODO:
func (*ExecutionContext) GetTypeInfoByName ¶
func (p *ExecutionContext) GetTypeInfoByName(name string) (tsys.TypeInfo, error)
func (*ExecutionContext) GetVariableInfo ¶
func (p *ExecutionContext) GetVariableInfo(name string) (*VariableInfo, bool)
func (*ExecutionContext) NewTypeId ¶
func (p *ExecutionContext) NewTypeId() uint32
func (*ExecutionContext) PopScope ¶
func (p *ExecutionContext) PopScope() bool
func (*ExecutionContext) PushFuncScope ¶
func (p *ExecutionContext) PushFuncScope(returnType mnem.AstOpCodeType)
func (*ExecutionContext) PushLambdaScope ¶
func (p *ExecutionContext) PushLambdaScope(returnType mnem.AstOpCodeType)
func (*ExecutionContext) PushScope ¶
func (p *ExecutionContext) PushScope(returnType mnem.AstOpCodeType)
func (*ExecutionContext) ResetScope ¶
func (p *ExecutionContext) ResetScope()
type ExecutionScope ¶
type ExecutionScope struct {
Type ExecutionScopeType
ReturnType AstOpCodeType
Dict map[string]*VariableInfo
Next *ExecutionScope
StackNext *ExecutionScope
}
type ExecutionScopeType ¶
type ExecutionScopeType int
const ( // ExecutionScope_Normal ExecutionScopeType = iota // ExecutionScope_Function // ExecutionScope_Lambda )
type VariableInfo ¶
type VariableInfo struct {
Flags AstOpCodeType
Value interface{}
}
Implements interface Box
func (*VariableInfo) ComplexMapIndex ¶
func (p *VariableInfo) ComplexMapIndex(k interface{}) Box
func (*VariableInfo) GetAny ¶
func (p *VariableInfo) GetAny() interface{}
func (*VariableInfo) GetBool ¶
func (p *VariableInfo) GetBool() bool
func (*VariableInfo) GetBytes ¶
func (p *VariableInfo) GetBytes() []byte
func (*VariableInfo) GetFloat ¶
func (p *VariableInfo) GetFloat() float64
func (*VariableInfo) GetInt ¶
func (p *VariableInfo) GetInt() int64
func (*VariableInfo) GetPointer ¶
func (p *VariableInfo) GetPointer() unsafe.Pointer
func (*VariableInfo) GetString ¶
func (p *VariableInfo) GetString() string
func (*VariableInfo) GetUint ¶
func (p *VariableInfo) GetUint() uint64
func (*VariableInfo) Index ¶
func (p *VariableInfo) Index(i int) Box
func (*VariableInfo) MapIndex ¶
func (p *VariableInfo) MapIndex(k string) Box
func (*VariableInfo) SetAny ¶
func (p *VariableInfo) SetAny(v interface{})
func (*VariableInfo) SetBool ¶
func (p *VariableInfo) SetBool(v bool)
func (*VariableInfo) SetBytes ¶
func (p *VariableInfo) SetBytes(v []byte)
func (*VariableInfo) SetFloat ¶
func (p *VariableInfo) SetFloat(v float64)
func (*VariableInfo) SetInt ¶
func (p *VariableInfo) SetInt(v int64)
func (*VariableInfo) SetPointer ¶
func (p *VariableInfo) SetPointer(v unsafe.Pointer)
func (*VariableInfo) SetString ¶
func (p *VariableInfo) SetString(v string)
func (*VariableInfo) SetUint ¶
func (p *VariableInfo) SetUint(v uint64)
Source Files
¶
Click to show internal directories.
Click to hide internal directories.