Documentation
¶
Overview ¶
********************************************************************** MicroCore Copyright 2020 - 2020 by Danyil Dobryvechir (dobrivecher@yahoo.com ddobryvechir@gmail.com) ***********************************************************************
********************************************************************** MicroCore Copyright 2020 - 2020 by Danyil Dobryvechir (dobrivecher@yahoo.com ddobryvechir@gmail.com) ***********************************************************************
********************************************************************** MicroCore Copyright 2020 - 2020 by Danyil Dobryvechir (dobrivecher@yahoo.com ddobryvechir@gmail.com) ***********************************************************************
********************************************************************** MicroCore Copyright 2020 - 2020 by Danyil Dobryvechir (dobrivecher@yahoo.com ddobryvechir@gmail.com) ***********************************************************************
********************************************************************** MicroCore Copyright 2020 - 2020 by Danyil Dobryvechir (dobrivecher@yahoo.com ddobryvechir@gmail.com) ***********************************************************************
********************************************************************** MicroCore Copyright 2020 - 2020 by Danyil Dobryvechir (dobrivecher@yahoo.com ddobryvechir@gmail.com) ***********************************************************************
********************************************************************** MicroCore Copyright 2020 - 2020 by Danyil Dobryvechir (dobrivecher@yahoo.com ddobryvechir@gmail.com) ***********************************************************************
********************************************************************** MicroCore Copyright 2020 - 2020 by Danyil Dobryvechir (dobrivecher@yahoo.com ddobryvechir@gmail.com) ***********************************************************************
********************************************************************** MicroCore Copyright 2020 - 2020 by Danyil Dobryvechir (dobrivecher@yahoo.com ddobryvechir@gmail.com) ***********************************************************************
********************************************************************** MicroCore Copyright 2020 - 2020 by Danyil Dobryvechir (dobrivecher@yahoo.com ddobryvechir@gmail.com) ***********************************************************************
********************************************************************** MicroCore Copyright 2020 - 2020 by Danyil Dobryvechir (dobrivecher@yahoo.com ddobryvechir@gmail.com) ***********************************************************************
********************************************************************** MicroCore Copyright 2020 - 2020 by Danyil Dobryvechir (dobrivecher@yahoo.com ddobryvechir@gmail.com) ***********************************************************************
Index ¶
- Constants
- Variables
- func AddToGlobalFunctionPool(properties map[string]interface{})
- func AnyCompareAnyWithTypes(kind1 int, value1 interface{}, kind2 int, value2 interface{}) int
- func AnyGetType(v interface{}) int
- func AnyToBoolean(v interface{}) bool
- func AnyToNumber(v interface{}) float64
- func AnyToNumberInt(v interface{}) (f int64, ok bool)
- func AnyToString(v interface{}) string
- func AnyWithTypeToBoolean(kind int, v interface{}, defValue bool) bool
- func AnyWithTypeToNumber(kind int, v interface{}) float64
- func AnyWithTypeToNumberInt(kind int, v interface{}) (int64, bool)
- func AnyWithTypeToString(kind int, v interface{}) (string, bool)
- func ApplyDvFunction(self interface{}, args []interface{}) (interface{}, error)
- func AssignArrayStringToVariable(parent *DvVariable, variableDefinition string, data []string, force bool) error
- func AssignIntToVariable(parent *DvVariable, variableDefinition string, data int, force bool) error
- func AssignMapStringToVariable(parent *DvVariable, variableDefinition string, data map[string]string, ...) error
- func AssignVariable(parent *DvVariable, keys []string, value *DvVariable, force bool) error
- func AssignVariableDirect(parent *DvVariable, value *DvVariable) error
- func AssignVariableToVariable(parent *DvVariable, variableDefinition string, data *DvVariable, force bool) error
- func BindDvFunction(self interface{}, args []interface{}) (interface{}, error)
- func BitwiseNotOperator(value *dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, ...) (*dvgrammar.ExpressionValue, error)
- func CalculateDefined(data []byte, scope dvgrammar.ScopeInterface, ...) (*dvgrammar.ExpressionValue, error)
- func CalculatorDataGetter(token *dvgrammar.Token, context *dvgrammar.ExpressionContext) (*dvgrammar.ExpressionValue, error)
- func CalculatorEvaluator(data []byte, scope dvgrammar.ScopeInterface, ...) (*dvgrammar.ExpressionValue, error)
- func CallDvFunction(self interface{}, args []interface{}) (interface{}, error)
- func CompareAsIntegers(value1 interface{}, value2 interface{}) int
- func CompareAsNumbers(value1 interface{}, value2 interface{}) int
- func CompareAsStrings(value1 interface{}, value2 interface{}) int
- func CompareByComparisonType(compareType int, value1 interface{}, value2 interface{}) int
- func ConvertStringMapToDvVariableMap(data map[string]string) (res map[string]*DvVariable)
- func ConvertVariableNameToKeys(data string) (res []string, err error)
- func DeleteVariable(parent *DvVariable, keys []string) error
- func DvObjectInternalToString(obj *DvObject) string
- func ExecFunction(fn interface{}, self interface{}, arguments []interface{}) (interface{}, error)
- func GetDvFunctionArguments(funcObj *DvObject) []string
- func GetEscapedString(s string) string
- func GetIntFromVariable(parent *DvVariable, variableDefinition string, force bool) (res int, err error)
- func GetIntFromVariableAndIncrementAfter(parent *DvVariable, variableDefinition string, force bool) (res int, err error)
- func GetIntFromVariableAndModify(parent *DvVariable, variableDefinition string, modify int, after bool, ...) (res int, err error)
- func GetNumberKindFromString(v []byte, n int) (int, int, int64, float64)
- func GetStringFromVariable(parent *DvVariable, variableDefinition string, force bool) (res string, err error)
- func GetVariableByDefinition(parent *DvVariable, variableDefinition string) (thisValue *DvVariable, child *DvVariable, prototyped bool, err error, ...)
- func GetVariableByKeys(parent *DvVariable, keys []string) (thisValue *DvVariable, child *DvVariable, prototyped bool, err error)
- func Init() bool
- func IsDefined(data []byte, scope dvgrammar.ScopeInterface, row int, col int, place string, ...) (int, error)
- func IsFunction(v interface{}) bool
- func LogicalDataGetter(token *dvgrammar.Token, context *dvgrammar.ExpressionContext) (*dvgrammar.ExpressionValue, error)
- func LogicalNotOperator(value *dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, ...) (*dvgrammar.ExpressionValue, error)
- func ModifySimpleValueAfterGet(thisVal *DvVariable, child *DvVariable, prototyped bool, value string, tp int, ...) error
- func NumberToInt(v float64) (f int64, ok bool)
- func PostMinusMinusOperator(value *dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, ...) (*dvgrammar.ExpressionValue, error)
- func PostPlusPlusOperator(value *dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, ...) (*dvgrammar.ExpressionValue, error)
- func PreMinusMinusOperator(value *dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, ...) (*dvgrammar.ExpressionValue, error)
- func PrePlusPlusOperator(value *dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, ...) (*dvgrammar.ExpressionValue, error)
- func ProcessorBoolAnd(values []*dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, ...) (*dvgrammar.ExpressionValue, error)
- func ProcessorBoolOr(values []*dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, ...) (*dvgrammar.ExpressionValue, error)
- func ProcessorBoolXor(values []*dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, ...) (*dvgrammar.ExpressionValue, error)
- func ProcessorBooleanAnd(values []*dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, ...) (*dvgrammar.ExpressionValue, error)
- func ProcessorBooleanOr(values []*dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, ...) (*dvgrammar.ExpressionValue, error)
- func ProcessorDivision(values []*dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, ...) (*dvgrammar.ExpressionValue, error)
- func ProcessorEqual(values []*dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, ...) (*dvgrammar.ExpressionValue, error)
- func ProcessorEqualExact(values []*dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, ...) (*dvgrammar.ExpressionValue, error)
- func ProcessorGreaterEqual(values []*dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, ...) (*dvgrammar.ExpressionValue, error)
- func ProcessorGreaterThan(values []*dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, ...) (*dvgrammar.ExpressionValue, error)
- func ProcessorLeftShift(values []*dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, ...) (*dvgrammar.ExpressionValue, error)
- func ProcessorLessEqual(values []*dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, ...) (*dvgrammar.ExpressionValue, error)
- func ProcessorLessThan(values []*dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, ...) (*dvgrammar.ExpressionValue, error)
- func ProcessorLogicalRightShift(values []*dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, ...) (*dvgrammar.ExpressionValue, error)
- func ProcessorMinus(values []*dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, ...) (*dvgrammar.ExpressionValue, error)
- func ProcessorMultiply(values []*dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, ...) (*dvgrammar.ExpressionValue, error)
- func ProcessorNotEqual(values []*dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, ...) (*dvgrammar.ExpressionValue, error)
- func ProcessorNotEqualExact(values []*dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, ...) (*dvgrammar.ExpressionValue, error)
- func ProcessorPercent(values []*dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, ...) (*dvgrammar.ExpressionValue, error)
- func ProcessorPlus(values []*dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, ...) (*dvgrammar.ExpressionValue, error)
- func ProcessorPower(values []*dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, ...) (*dvgrammar.ExpressionValue, error)
- func ProcessorRightShift(values []*dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, ...) (*dvgrammar.ExpressionValue, error)
- func SetNodeValue(tree *dvgrammar.BuildNode, v interface{}, dataType int, ...) error
- func StringToAny(v string) interface{}
- func StringToNumber(v string) float64
- func UnaryMinusOperator(value *dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, ...) (*dvgrammar.ExpressionValue, error)
- func UnaryPlusOperator(value *dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, ...) (*dvgrammar.ExpressionValue, error)
- func ValidateNumber(data string) error
- type DvCall
- type DvContext
- func (context *DvContext) CurrentRoutineCallBreak() error
- func (context *DvContext) CurrentRoutineCallExecute(routine *DvRoutine) (bool, error)
- func (context *DvContext) CurrentRoutineCallShift(delta int) (int, error)
- func (context *DvContext) DumpContextMemory()
- func (context *DvContext) ExecuteCurrentRoutine() (bool, error)
- func (context *DvContext) ExecuteRoutine(routine *DvRoutine) error
- func (context *DvContext) ExecuteRoutines(routines []string, params []string) error
- func (context *DvContext) FunctionCallByKeys(variable *DvVariable, keys []string, params []*DvVariable, ...) (*DvVariable, error)
- func (context *DvContext) FunctionCallByVariableDefinition(variable *DvVariable, variableDefinition string, params []*DvVariable, ...) (*DvVariable, error)
- func (context *DvContext) FunctionCallByVariableDefinitionWithStringParams(variable *DvVariable, variableDefinition string, params []string, ...) (*DvVariable, error)
- func (context *DvContext) RoutineCallExecute(dvCall *DvCall) error
- func (context *DvContext) SetGeneralArguments(params map[string]string) error
- type DvFunc
- type DvFunction
- type DvObject
- func NewDvFunction(name string, args []string, fn DvFunc) *DvObject
- func NewDvObject(properties map[string]string, prototype *DvObject) *DvObject
- func NewDvObjectFrom2Maps(localMap map[string]string, globalMap map[string]string) *DvObject
- func NewDvObjectWithGlobalPrototype(properties map[string]string) *DvObject
- func NewDvObjectWithSpecialValues(value interface{}, kind int, proto *DvObject, ...) *DvObject
- func NewObject(properties map[string]interface{}) *DvObject
- func NewObjectWithPrototype(properties map[string]interface{}, prototype *DvObject) *DvObject
- func (obj *DvObject) AssignProperties(properties map[string]interface{})
- func (obj *DvObject) CalculateExpression(b []byte) ([]byte, error)
- func (obj *DvObject) CalculateString(str string) (string, error)
- func (obj *DvObject) CalculateStringWithBrackets(b []byte, level int) (string, error)
- func (obj *DvObject) Get(key string) (interface{}, bool)
- func (obj *DvObject) GetObjectType() int
- func (obj *DvObject) GetString(key string) string
- func (obj *DvObject) Set(key string, value interface{})
- func (obj *DvObject) SetProperty(name string, value interface{})
- func (obj *DvObject) ToBoolean() bool
- func (obj *DvObject) ToNumber() float64
- func (obj *DvObject) ToNumberInt() (int64, bool)
- func (obj *DvObject) ToString() string
- type DvRoutine
- type DvScript
- type DvVariable
- func ConvertDvFunctionToDvVariable(fn DvvFunction) *DvVariable
- func ConvertStringArrayToDvVariableArray(data []string) (res []*DvVariable)
- func DvVariableFromArray(parent *DvVariable, data []*DvVariable) *DvVariable
- func DvVariableFromInt(parent *DvVariable, data int) *DvVariable
- func DvVariableFromMap(parent *DvVariable, data map[string]*DvVariable, reuse bool) *DvVariable
- func DvVariableFromString(parent *DvVariable, data string) *DvVariable
- func DvVariableFromStringArray(parent *DvVariable, data []string) *DvVariable
- func DvVariableFromStringMap(parent *DvVariable, data map[string]string) *DvVariable
- func DvVariableGetNewObject() *DvVariable
- func FunctionApply(context *DvContext, thisVariable *DvVariable, params []*DvVariable) (*DvVariable, error)
- func FunctionBind(context *DvContext, thisVariable *DvVariable, params []*DvVariable) (*DvVariable, error)
- func FunctionBindLite(context *DvContext, thisVariable *DvVariable, params []*DvVariable) (*DvVariable, error)
- func FunctionCall(context *DvContext, thisVariable *DvVariable, params []*DvVariable) (*DvVariable, error)
- func QuickNumberEvaluation(parent *DvVariable, data string) (res *DvVariable, err error)
- func QuickStringEvaluation(parent *DvVariable, data string) (res *DvVariable, err error)
- func QuickVariableArrayEvaluation(parent *DvVariable, data []string) (res []*DvVariable, err error)
- func QuickVariableEvaluation(parent *DvVariable, data string) (res *DvVariable, err error)
- func RegisterMasterObject(name string, values map[string]*DvVariable, functions map[string]DvvFunction) *DvVariable
- func RegisterMasterVariable(name string, variable *DvVariable) *DvVariable
- func (variable *DvVariable) GetIntValue(force bool) (int, error)
- func (variable *DvVariable) GetStringArrayMap() (res map[string][]string)
- func (variable *DvVariable) GetStringArrayValue() []string
- func (variable *DvVariable) GetStringMap() (res map[string]string)
- func (variable *DvVariable) GetStringValue() string
- func (variable *DvVariable) GetStringValueAsBytes() []byte
- func (variable *DvVariable) GetVariableArray(force bool) ([]*DvVariable, error)
- func (variable *DvVariable) JsonStringify() []byte
- func (variable *DvVariable) JsonStringifyNonEmpty() []byte
- func (variable *DvVariable) ObjectGet(key string) (*DvVariable, error)
- func (variable *DvVariable) ObjectGetByKeys(keys []string) (*DvVariable, error)
- func (variable *DvVariable) ObjectGetByVariableDefinition(variableDefinition string) (*DvVariable, error)
- func (variable *DvVariable) ObjectInPrototypedChain(key string) *DvVariable
- func (variable *DvVariable) SetSimpleValue(value string, tp int) error
- type DvVariable_DumpInfo
- type DvvFunction
- type EvaluateBoolean
- type EvaluateResult
- func FindEndAndParse(data []byte, pos int, limit int, sequenceLimit int, ...) *EvaluateResult
- func Parse(data []byte, globalMap map[string]string, localMap map[string]string, row int, ...) (r *EvaluateResult)
- func ParseForDvObject(data []byte, params *DvObject, row int, column int, place string) *EvaluateResult
Constants ¶
const ( COMPARE_NOT = iota COMPARE_AS_NUMBERS COMPARE_AS_INTEGERS COMPARE_AS_STRINGS )
const ( BOOLEAN_FALSE = "false" BOOLEAN_TRUE = "true" )
const ( UNARY_BOOLEAN_NOT = 1 << iota UNARY_LOGICAL_NOT = 1 << iota UNARY_MINUS = 1 << iota UNARY_PLUS = 1 << iota )
const ( JS_TYPE_UNDEFINED = iota JS_TYPE_NULL = iota JS_TYPE_NUMBER = iota JS_TYPE_BOOLEAN = iota JS_TYPE_STRING = iota JS_TYPE_OBJECT = iota JS_TYPE_ARRAY = iota JS_TYPE_FUNCTION = iota )
const (
EVALUATE_OPTION_UNDEFINED = 1 << (iota + 8)
)
const LENGTH_PROPERTY = "length"
Variables ¶
var CalculatorOperators = map[string]dvgrammar.InterOperatorVisitor{ "+": ProcessorPlus, "-": ProcessorMinus, "*": ProcessorMultiply, "/": ProcessorDivision, "%": ProcessorPercent, "&": ProcessorBoolAnd, "|": ProcessorBoolOr, "^": ProcessorBoolXor, "**": ProcessorPower, "||": ProcessorBooleanOr, "&&": ProcessorBooleanAnd, "<<": ProcessorLeftShift, ">>>": ProcessorLogicalRightShift, ">>": ProcessorRightShift, "===": ProcessorEqualExact, "!==": ProcessorNotEqualExact, "==": ProcessorEqual, "!=": ProcessorNotEqual, ">": ProcessorGreaterThan, ">=": ProcessorGreaterEqual, "<": ProcessorLessThan, "<=": ProcessorLessEqual, }
var CalculatorPostUnaryMap = map[string]dvgrammar.UnaryVisitor{ "++": PostPlusPlusOperator, "--": PostMinusMinusOperator, }
var CalculatorRules = &dvgrammar.GrammarRuleDefinitions{ Visitors: CalculatorOperators, DataGetter: CalculatorDataGetter, EvaluateOptions: 0, UnaryPreVisitors: CalculatorUnaryMap, UnaryPostVisitors: CalculatorPostUnaryMap, }
var CalculatorUnaryMap = map[string]dvgrammar.UnaryVisitor{ "!": LogicalNotOperator, "~": BitwiseNotOperator, "+": UnaryPlusOperator, "-": UnaryMinusOperator, "++": PrePlusPlusOperator, "--": PreMinusMinusOperator, }
var GlobalFunctionPool = make(map[string]interface{})
var GlobalFunctionPrototype = NewObject(GlobalFunctionPool)
var LogicalOperators = map[string]dvgrammar.InterOperatorVisitor{ "||": ProcessorBooleanOr, "&&": ProcessorBooleanAnd, }
var LogicalRules = &dvgrammar.GrammarRuleDefinitions{ BaseGrammar: dvgrammar.LogicalGrammarBaseDefinition, Visitors: LogicalOperators, DataGetter: LogicalDataGetter, EvaluateOptions: 0, UnaryPreVisitors: LogicalUnaryMap, }
var LogicalUnaryMap = map[string]dvgrammar.UnaryVisitor{ "!": LogicalNotOperator, }
Functions ¶
func AddToGlobalFunctionPool ¶
func AddToGlobalFunctionPool(properties map[string]interface{})
func AnyCompareAnyWithTypes ¶
returns 1-greater, -1-lesser, 0-equal, -2 not applied
func AnyGetType ¶
func AnyGetType(v interface{}) int
func AnyToBoolean ¶
func AnyToBoolean(v interface{}) bool
func AnyToNumber ¶
func AnyToNumber(v interface{}) float64
func AnyToNumberInt ¶
func AnyToString ¶
func AnyToString(v interface{}) string
func AnyWithTypeToBoolean ¶
func AnyWithTypeToNumber ¶
func AnyWithTypeToNumberInt ¶
func AnyWithTypeToString ¶
func ApplyDvFunction ¶
func ApplyDvFunction(self interface{}, args []interface{}) (interface{}, error)
func AssignArrayStringToVariable ¶
func AssignArrayStringToVariable(parent *DvVariable, variableDefinition string, data []string, force bool) error
func AssignIntToVariable ¶
func AssignIntToVariable(parent *DvVariable, variableDefinition string, data int, force bool) error
func AssignVariable ¶
func AssignVariable(parent *DvVariable, keys []string, value *DvVariable, force bool) error
func AssignVariableDirect ¶
func AssignVariableDirect(parent *DvVariable, value *DvVariable) error
func AssignVariableToVariable ¶
func AssignVariableToVariable(parent *DvVariable, variableDefinition string, data *DvVariable, force bool) error
func BindDvFunction ¶
func BindDvFunction(self interface{}, args []interface{}) (interface{}, error)
func BitwiseNotOperator ¶
func BitwiseNotOperator(value *dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, context *dvgrammar.ExpressionContext, operator string) (*dvgrammar.ExpressionValue, error)
func CalculateDefined ¶
func CalculateDefined(data []byte, scope dvgrammar.ScopeInterface, reference *dvgrammar.SourceReference, visitorOptions int) (*dvgrammar.ExpressionValue, error)
func CalculatorDataGetter ¶
func CalculatorDataGetter(token *dvgrammar.Token, context *dvgrammar.ExpressionContext) (*dvgrammar.ExpressionValue, error)
func CalculatorEvaluator ¶
func CalculatorEvaluator(data []byte, scope dvgrammar.ScopeInterface, reference *dvgrammar.SourceReference, visitorOptions int) (*dvgrammar.ExpressionValue, error)
func CallDvFunction ¶
func CallDvFunction(self interface{}, args []interface{}) (interface{}, error)
func CompareAsIntegers ¶
func CompareAsIntegers(value1 interface{}, value2 interface{}) int
func CompareAsNumbers ¶
func CompareAsNumbers(value1 interface{}, value2 interface{}) int
func CompareAsStrings ¶
func CompareAsStrings(value1 interface{}, value2 interface{}) int
func CompareByComparisonType ¶
func ConvertStringMapToDvVariableMap ¶
func ConvertStringMapToDvVariableMap(data map[string]string) (res map[string]*DvVariable)
func DeleteVariable ¶
func DeleteVariable(parent *DvVariable, keys []string) error
func ExecFunction ¶
func ExecFunction(fn interface{}, self interface{}, arguments []interface{}) (interface{}, error)
func GetDvFunctionArguments ¶
func GetEscapedString ¶
func GetIntFromVariable ¶
func GetIntFromVariable(parent *DvVariable, variableDefinition string, force bool) (res int, err error)
func GetIntFromVariableAndIncrementAfter ¶
func GetIntFromVariableAndIncrementAfter(parent *DvVariable, variableDefinition string, force bool) (res int, err error)
func GetNumberKindFromString ¶
func GetStringFromVariable ¶
func GetStringFromVariable(parent *DvVariable, variableDefinition string, force bool) (res string, err error)
func GetVariableByDefinition ¶
func GetVariableByDefinition(parent *DvVariable, variableDefinition string) (thisValue *DvVariable, child *DvVariable, prototyped bool, err error, keys []string)
func GetVariableByKeys ¶
func GetVariableByKeys(parent *DvVariable, keys []string) (thisValue *DvVariable, child *DvVariable, prototyped bool, err error)
func IsFunction ¶
func IsFunction(v interface{}) bool
func LogicalDataGetter ¶
func LogicalDataGetter(token *dvgrammar.Token, context *dvgrammar.ExpressionContext) (*dvgrammar.ExpressionValue, error)
func LogicalNotOperator ¶
func LogicalNotOperator(value *dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, context *dvgrammar.ExpressionContext, operator string) (*dvgrammar.ExpressionValue, error)
func ModifySimpleValueAfterGet ¶
func ModifySimpleValueAfterGet(thisVal *DvVariable, child *DvVariable, prototyped bool, value string, tp int, keys []string) error
func NumberToInt ¶
func PostMinusMinusOperator ¶
func PostMinusMinusOperator(value *dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, context *dvgrammar.ExpressionContext, operator string) (*dvgrammar.ExpressionValue, error)
func PostPlusPlusOperator ¶
func PostPlusPlusOperator(value *dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, context *dvgrammar.ExpressionContext, operator string) (*dvgrammar.ExpressionValue, error)
func PreMinusMinusOperator ¶
func PreMinusMinusOperator(value *dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, context *dvgrammar.ExpressionContext, operator string) (*dvgrammar.ExpressionValue, error)
func PrePlusPlusOperator ¶
func PrePlusPlusOperator(value *dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, context *dvgrammar.ExpressionContext, operator string) (*dvgrammar.ExpressionValue, error)
func ProcessorBoolAnd ¶
func ProcessorBoolAnd(values []*dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, context *dvgrammar.ExpressionContext, operator string) (*dvgrammar.ExpressionValue, error)
func ProcessorBoolOr ¶
func ProcessorBoolOr(values []*dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, context *dvgrammar.ExpressionContext, operator string) (*dvgrammar.ExpressionValue, error)
func ProcessorBoolXor ¶
func ProcessorBoolXor(values []*dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, context *dvgrammar.ExpressionContext, operator string) (*dvgrammar.ExpressionValue, error)
func ProcessorBooleanAnd ¶
func ProcessorBooleanAnd(values []*dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, context *dvgrammar.ExpressionContext, operator string) (*dvgrammar.ExpressionValue, error)
func ProcessorBooleanOr ¶
func ProcessorBooleanOr(values []*dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, context *dvgrammar.ExpressionContext, operator string) (*dvgrammar.ExpressionValue, error)
func ProcessorDivision ¶
func ProcessorDivision(values []*dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, context *dvgrammar.ExpressionContext, operator string) (*dvgrammar.ExpressionValue, error)
func ProcessorEqual ¶
func ProcessorEqual(values []*dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, context *dvgrammar.ExpressionContext, operator string) (*dvgrammar.ExpressionValue, error)
func ProcessorEqualExact ¶
func ProcessorEqualExact(values []*dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, context *dvgrammar.ExpressionContext, operator string) (*dvgrammar.ExpressionValue, error)
func ProcessorGreaterEqual ¶
func ProcessorGreaterEqual(values []*dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, context *dvgrammar.ExpressionContext, operator string) (*dvgrammar.ExpressionValue, error)
func ProcessorGreaterThan ¶
func ProcessorGreaterThan(values []*dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, context *dvgrammar.ExpressionContext, operator string) (*dvgrammar.ExpressionValue, error)
func ProcessorLeftShift ¶
func ProcessorLeftShift(values []*dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, context *dvgrammar.ExpressionContext, operator string) (*dvgrammar.ExpressionValue, error)
func ProcessorLessEqual ¶
func ProcessorLessEqual(values []*dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, context *dvgrammar.ExpressionContext, operator string) (*dvgrammar.ExpressionValue, error)
func ProcessorLessThan ¶
func ProcessorLessThan(values []*dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, context *dvgrammar.ExpressionContext, operator string) (*dvgrammar.ExpressionValue, error)
func ProcessorLogicalRightShift ¶
func ProcessorLogicalRightShift(values []*dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, context *dvgrammar.ExpressionContext, operator string) (*dvgrammar.ExpressionValue, error)
func ProcessorMinus ¶
func ProcessorMinus(values []*dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, context *dvgrammar.ExpressionContext, operator string) (*dvgrammar.ExpressionValue, error)
func ProcessorMultiply ¶
func ProcessorMultiply(values []*dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, context *dvgrammar.ExpressionContext, operator string) (*dvgrammar.ExpressionValue, error)
func ProcessorNotEqual ¶
func ProcessorNotEqual(values []*dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, context *dvgrammar.ExpressionContext, operator string) (*dvgrammar.ExpressionValue, error)
func ProcessorNotEqualExact ¶
func ProcessorNotEqualExact(values []*dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, context *dvgrammar.ExpressionContext, operator string) (*dvgrammar.ExpressionValue, error)
func ProcessorPercent ¶
func ProcessorPercent(values []*dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, context *dvgrammar.ExpressionContext, operator string) (*dvgrammar.ExpressionValue, error)
func ProcessorPlus ¶
func ProcessorPlus(values []*dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, context *dvgrammar.ExpressionContext, operator string) (*dvgrammar.ExpressionValue, error)
func ProcessorPower ¶
func ProcessorPower(values []*dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, context *dvgrammar.ExpressionContext, operator string) (*dvgrammar.ExpressionValue, error)
func ProcessorRightShift ¶
func ProcessorRightShift(values []*dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, context *dvgrammar.ExpressionContext, operator string) (*dvgrammar.ExpressionValue, error)
func SetNodeValue ¶
func StringToAny ¶
func StringToAny(v string) interface{}
func StringToNumber ¶
func UnaryMinusOperator ¶
func UnaryMinusOperator(value *dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, context *dvgrammar.ExpressionContext, operator string) (*dvgrammar.ExpressionValue, error)
func UnaryPlusOperator ¶
func UnaryPlusOperator(value *dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, context *dvgrammar.ExpressionContext, operator string) (*dvgrammar.ExpressionValue, error)
func ValidateNumber ¶
Types ¶
type DvContext ¶
type DvContext struct {
// contains filtered or unexported fields
}
func (*DvContext) CurrentRoutineCallBreak ¶
func (*DvContext) CurrentRoutineCallExecute ¶
func (*DvContext) CurrentRoutineCallShift ¶
func (*DvContext) DumpContextMemory ¶
func (context *DvContext) DumpContextMemory()
func (*DvContext) ExecuteCurrentRoutine ¶
func (*DvContext) ExecuteRoutine ¶
func (*DvContext) ExecuteRoutines ¶
func (*DvContext) FunctionCallByKeys ¶
func (context *DvContext) FunctionCallByKeys(variable *DvVariable, keys []string, params []*DvVariable, thisVariable *DvVariable) (*DvVariable, error)
func (*DvContext) FunctionCallByVariableDefinition ¶
func (context *DvContext) FunctionCallByVariableDefinition(variable *DvVariable, variableDefinition string, params []*DvVariable, thisVariable *DvVariable) (*DvVariable, error)
func (*DvContext) FunctionCallByVariableDefinitionWithStringParams ¶
func (context *DvContext) FunctionCallByVariableDefinitionWithStringParams(variable *DvVariable, variableDefinition string, params []string, thisVariable *DvVariable) (*DvVariable, error)
func (*DvContext) RoutineCallExecute ¶
type DvFunction ¶
func (*DvFunction) ToString ¶
func (fn *DvFunction) ToString() string
type DvObject ¶
type DvObject struct {
Value interface{}
Options int
Properties map[string]interface{}
Prototype *DvObject
}
var DvFunctionPrototype *DvObject
func NewDvObjectFrom2Maps ¶
func NewObjectWithPrototype ¶
func (*DvObject) AssignProperties ¶
func (*DvObject) CalculateExpression ¶
func (*DvObject) CalculateStringWithBrackets ¶
func (*DvObject) GetObjectType ¶
func (*DvObject) SetProperty ¶
func (*DvObject) ToNumberInt ¶
type DvScript ¶
type DvScript struct {
// contains filtered or unexported fields
}
func ParseScripts ¶
func (*DvScript) AddRoutines ¶
func (*DvScript) GetNewContext ¶
func (*DvScript) VerifyRoutines ¶
type DvVariable ¶
type DvVariable struct {
Refs map[string]*DvVariable
Value string
Tp int
Fn DvvFunction
Prototype *DvVariable
}
var ArrayMaster *DvVariable = RegisterMasterVariable("Array", &DvVariable{Tp: JS_TYPE_OBJECT})
var FunctionMaster *DvVariable = RegisterMasterVariable("Function", &DvVariable{ Refs: make(map[string]*DvVariable), Tp: JS_TYPE_OBJECT, Prototype: &DvVariable{ Refs: map[string]*DvVariable{ "call": { Tp: JS_TYPE_FUNCTION, Fn: FunctionCall, }, "apply": { Tp: JS_TYPE_FUNCTION, Fn: FunctionApply, }, "bind": { Tp: JS_TYPE_FUNCTION, Fn: FunctionBindLite, }, }, Tp: JS_TYPE_OBJECT, }, })
var ObjectMaster *DvVariable = RegisterMasterVariable("Object", &DvVariable{Tp: JS_TYPE_OBJECT})
func ConvertDvFunctionToDvVariable ¶
func ConvertDvFunctionToDvVariable(fn DvvFunction) *DvVariable
func ConvertStringArrayToDvVariableArray ¶
func ConvertStringArrayToDvVariableArray(data []string) (res []*DvVariable)
func DvVariableFromArray ¶
func DvVariableFromArray(parent *DvVariable, data []*DvVariable) *DvVariable
func DvVariableFromInt ¶
func DvVariableFromInt(parent *DvVariable, data int) *DvVariable
func DvVariableFromMap ¶
func DvVariableFromMap(parent *DvVariable, data map[string]*DvVariable, reuse bool) *DvVariable
func DvVariableFromString ¶
func DvVariableFromString(parent *DvVariable, data string) *DvVariable
func DvVariableFromStringArray ¶
func DvVariableFromStringArray(parent *DvVariable, data []string) *DvVariable
func DvVariableFromStringMap ¶
func DvVariableFromStringMap(parent *DvVariable, data map[string]string) *DvVariable
func DvVariableGetNewObject ¶
func DvVariableGetNewObject() *DvVariable
func FunctionApply ¶
func FunctionApply(context *DvContext, thisVariable *DvVariable, params []*DvVariable) (*DvVariable, error)
func FunctionBind ¶
func FunctionBind(context *DvContext, thisVariable *DvVariable, params []*DvVariable) (*DvVariable, error)
func FunctionBindLite ¶
func FunctionBindLite(context *DvContext, thisVariable *DvVariable, params []*DvVariable) (*DvVariable, error)
func FunctionCall ¶
func FunctionCall(context *DvContext, thisVariable *DvVariable, params []*DvVariable) (*DvVariable, error)
func QuickNumberEvaluation ¶
func QuickNumberEvaluation(parent *DvVariable, data string) (res *DvVariable, err error)
func QuickStringEvaluation ¶
func QuickStringEvaluation(parent *DvVariable, data string) (res *DvVariable, err error)
func QuickVariableArrayEvaluation ¶
func QuickVariableArrayEvaluation(parent *DvVariable, data []string) (res []*DvVariable, err error)
func QuickVariableEvaluation ¶
func QuickVariableEvaluation(parent *DvVariable, data string) (res *DvVariable, err error)
func RegisterMasterObject ¶
func RegisterMasterObject(name string, values map[string]*DvVariable, functions map[string]DvvFunction) *DvVariable
func RegisterMasterVariable ¶
func RegisterMasterVariable(name string, variable *DvVariable) *DvVariable
func (*DvVariable) GetIntValue ¶
func (variable *DvVariable) GetIntValue(force bool) (int, error)
func (*DvVariable) GetStringArrayMap ¶
func (variable *DvVariable) GetStringArrayMap() (res map[string][]string)
func (*DvVariable) GetStringArrayValue ¶
func (variable *DvVariable) GetStringArrayValue() []string
func (*DvVariable) GetStringMap ¶
func (variable *DvVariable) GetStringMap() (res map[string]string)
func (*DvVariable) GetStringValue ¶
func (variable *DvVariable) GetStringValue() string
func (*DvVariable) GetStringValueAsBytes ¶
func (variable *DvVariable) GetStringValueAsBytes() []byte
func (*DvVariable) GetVariableArray ¶
func (variable *DvVariable) GetVariableArray(force bool) ([]*DvVariable, error)
func (*DvVariable) JsonStringify ¶
func (variable *DvVariable) JsonStringify() []byte
func (*DvVariable) JsonStringifyNonEmpty ¶
func (variable *DvVariable) JsonStringifyNonEmpty() []byte
func (*DvVariable) ObjectGet ¶
func (variable *DvVariable) ObjectGet(key string) (*DvVariable, error)
func (*DvVariable) ObjectGetByKeys ¶
func (variable *DvVariable) ObjectGetByKeys(keys []string) (*DvVariable, error)
func (*DvVariable) ObjectGetByVariableDefinition ¶
func (variable *DvVariable) ObjectGetByVariableDefinition(variableDefinition string) (*DvVariable, error)
func (*DvVariable) ObjectInPrototypedChain ¶
func (variable *DvVariable) ObjectInPrototypedChain(key string) *DvVariable
func (*DvVariable) SetSimpleValue ¶
func (variable *DvVariable) SetSimpleValue(value string, tp int) error
type DvVariable_DumpInfo ¶
type DvVariable_DumpInfo struct {
// contains filtered or unexported fields
}
type DvvFunction ¶
type DvvFunction func(*DvContext, *DvVariable, []*DvVariable) (*DvVariable, error)
type EvaluateBoolean ¶
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
********************************************************************** MicroCore Copyright 2020-2020 by Danyil Dobryvechir (dobrivecher@yahoo.com ddobryvechir@gmail.com) *********************************************************************** ********************************************************************** MicroCore Copyright 2020-2020 by Danyil Dobryvechir (dobrivecher@yahoo.com ddobryvechir@gmail.com) ***********************************************************************
|
********************************************************************** MicroCore Copyright 2020-2020 by Danyil Dobryvechir (dobrivecher@yahoo.com ddobryvechir@gmail.com) *********************************************************************** ********************************************************************** MicroCore Copyright 2020-2020 by Danyil Dobryvechir (dobrivecher@yahoo.com ddobryvechir@gmail.com) *********************************************************************** |