Documentation
¶
Index ¶
- Constants
- type ArithmeticLibrary
- type EnumVariantType
- type EvaluationContext
- type FunctionLibrary
- type FunctionTable
- type FunctionType
- type LogicalLibrary
- type SExpr
- type StringLibrary
- type SymbolTable
- type Variant
- func (b *Variant) CoerceToBool() (bool, error)
- func (b *Variant) CoerceToFloat() (float64, error)
- func (b *Variant) CoerceToInt() (int64, error)
- func (b *Variant) CoerceToString() (string, error)
- func (b *Variant) GetDateValue() (time.Time, error)
- func (b *Variant) GetErrorValue() (error, error)
- func (b *Variant) GetIdentifierValue() (string, error)
- func (b *Variant) GetTypeConsistentValue() (interface{}, error)
- func (b *Variant) MakeConsistent() Variant
- func (b *Variant) ToDebugString() string
Constants ¶
View Source
const ( TOK_BEGIN enumTokenType = iota TOK_LPAREN TOK_RPAREN TOK_COMMENT TOK_QUOTEDSTRING TOK_SYMBOL TOK_END // put new tokens between BEGIN and END, and ensure you implement `String()` correctly! TOK_UNKNOWN )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ArithmeticLibrary ¶
type ArithmeticLibrary struct {
}
func (*ArithmeticLibrary) InjectFunctions ¶
func (l *ArithmeticLibrary) InjectFunctions(functions FunctionTable) FunctionTable
type EnumVariantType ¶
type EnumVariantType uint8
const ( VAR_UNKNOWN EnumVariantType = iota VAR_NULL VAR_DATE VAR_BOOL VAR_FLOAT VAR_INT VAR_STRING VAR_IDENT VAR_ERROR VAR_FUNCTION VAR_MAX )
func (EnumVariantType) String ¶
func (t EnumVariantType) String() string
type EvaluationContext ¶
type EvaluationContext struct {
EvaluatedValue Variant
Parent *EvaluationContext
FunctionTable FunctionTable
SymbolTable SymbolTable
}
func NewEvaluationContext ¶
func NewEvaluationContext(parent *EvaluationContext) *EvaluationContext
type FunctionLibrary ¶
type FunctionLibrary interface {
InjectFunctions(*FunctionTable) *FunctionTable
}
type FunctionTable ¶
type FunctionTable map[string]FunctionType
type FunctionType ¶
type LogicalLibrary ¶
type LogicalLibrary struct {
}
func (*LogicalLibrary) InjectFunctions ¶
func (l *LogicalLibrary) InjectFunctions(functions FunctionTable) FunctionTable
type SExpr ¶
type SExpr interface {
Eval(*EvaluationContext) *EvaluationContext
String() string
}
type StringLibrary ¶
type StringLibrary struct {
}
func (*StringLibrary) InjectFunctions ¶
func (l *StringLibrary) InjectFunctions(functions FunctionTable) FunctionTable
type SymbolTable ¶
type Variant ¶
type Variant struct {
VariantType EnumVariantType
VariantValue interface{}
}
func (*Variant) CoerceToBool ¶
func (*Variant) CoerceToFloat ¶
func (*Variant) CoerceToInt ¶
func (*Variant) CoerceToString ¶
func (*Variant) GetErrorValue ¶
func (*Variant) GetIdentifierValue ¶
func (*Variant) GetTypeConsistentValue ¶
func (*Variant) MakeConsistent ¶
func (*Variant) ToDebugString ¶
Click to show internal directories.
Click to hide internal directories.