Documentation ¶
Index ¶
- Constants
- Variables
- func DoCalculationAction(express string, operator Operator, a interface{}, b interface{}, ...) (interface{}, error)
- func DoEqualAction(express string, operator Operator, a interface{}, b interface{}, ...) (bool, error)
- func Eval(express string, operator Operator, a interface{}, b interface{}) (interface{}, error)
- func EvalTakes(argNode ArgNode, arg interface{}) (interface{}, error)
- func GetDeepPtr(v reflect.Value) reflect.Value
- func GetDeepValue(av reflect.Value, arg interface{}) (interface{}, reflect.Value)
- type ArgNode
- type BinaryNode
- type BoolNode
- type FloatNode
- type IntNode
- type NilNode
- type Node
- type Operator
- type OptNode
- type StringNode
- type UIntNode
Constants ¶
View Source
const ( NArg nodeType = iota NString //string 节点 NFloat //float节点 NInt //int 节点 NUInt //uint节点 NBool //bool节点 NNil //空节点 NBinary //二元计算节点 NOpt //操作符节点 )
Variables ¶
Functions ¶
func DoCalculationAction ¶
func DoEqualAction ¶
Types ¶
type BinaryNode ¶
type BinaryNode struct {
// contains filtered or unexported fields
}
计算节点
func (BinaryNode) Eval ¶
func (it BinaryNode) Eval(env interface{}) (interface{}, error)
func (BinaryNode) Express ¶
func (it BinaryNode) Express() string
func (BinaryNode) Type ¶
func (it BinaryNode) Type() nodeType
type Operator ¶
type Operator = string
操作符
const ( //计算操作符 Add Operator = "+" Reduce Operator = "-" Ride Operator = "*" Divide Operator = "/" //比较操作符 And Operator = "&&" Or Operator = "||" Equal Operator = "==" UnEqual Operator = "!=" Less Operator = "<" LessEqual Operator = "<=" More Operator = ">" MoreEqual Operator = ">=" Nil Operator = "nil" Null Operator = "null" )
func ParserOperators ¶
type OptNode ¶
type OptNode struct {
// contains filtered or unexported fields
}
func (OptNode) IsCalculationOperator ¶
type StringNode ¶
type StringNode struct {
// contains filtered or unexported fields
}
值节点
func (StringNode) Eval ¶
func (it StringNode) Eval(env interface{}) (interface{}, error)
func (StringNode) Express ¶
func (it StringNode) Express() string
func (StringNode) Type ¶
func (it StringNode) Type() nodeType
Click to show internal directories.
Click to hide internal directories.