Documentation
¶
Index ¶
- Constants
- Variables
- func AppendCastRules(op int, numArgs uint8, sourceTypes []types.T, targetTypes []types.Type)
- func AppendFunctionRets(op int, args []types.T, ret types.T)
- func BinaryEval(op int, ltyp, rtyp types.T, lc, rc bool, lv, rv *vector.Vector, ...) (*vector.Vector, error)
- func GetBinOpReturnType(op int, lt, rt types.T) types.T
- func GetMultiReturnType(op int, ts []types.T) types.T
- func GetUnaryOpReturnType(op int, arg types.T) types.T
- func IsLogical(op int) uint8
- func MultiEval(op int, typ types.T, bs []bool, vecs []*vector.Vector, proc *process.Process) (*vector.Vector, error)
- func OperatorType(op int) int
- func UnaryEval(op int, typ types.T, c bool, v *vector.Vector, p *process.Process) (*vector.Vector, error)
- func UpdateEval(typ, toTyp types.T, c bool, v *vector.Vector, p *process.Process) (*vector.Vector, error)
- type BinOp
- type MultiOp
- type UnaryOp
Constants ¶
View Source
const ( NotLogical = iota MayLogical MustLogical )
View Source
const ( Unary = iota Multi Binary )
View Source
const ( // unary operator UnaryMinus = iota Not // binary operator Or And Plus Minus Mult Div IntegerDiv Mod Like NotLike Typecast // binary operator - comparison operator EQ LT LE GT GE NE )
Variables ¶
View Source
var ( // ErrDivByZero is reported on a division by zero. ErrDivByZero = errors.New(errno.SyntaxErrororAccessRuleViolation, "division by zero") // ErrModByZero is reported when computing the rest of a division by zero. ErrModByZero = errors.New(errno.SyntaxErrororAccessRuleViolation, "zero modulus") // BinOps contains the binary operations indexed by operation type. BinOps = map[int][]*BinOp{} )
View Source
var ( // OperatorCastRules records implicit type conversion rule for all operators and built-in functions // map's key is operator id or function id (eg: overload.Plus) OperatorCastRules = make(map[int][]castRule) // OperatorReturnType records return type for all operator and built-in functions // first map : key is operator or function id (eg: overload.Minus), value is second map : // key is numbers of args, and value is a slice of struct retType (contains information about arg types and return type) OperatorReturnType = make(map[int]map[uint8][]retType) )
View Source
var LogicalOps = map[int]uint8{ Or: MayLogical, And: MayLogical, Like: MustLogical, NotLike: MustLogical, EQ: MustLogical, LT: MustLogical, LE: MustLogical, GT: MustLogical, GE: MustLogical, NE: MustLogical, }
View Source
var MultiOps = map[int][]*MultiOp{}
View Source
var NegOps = map[int]int{ Or: And, And: Or, EQ: NE, LT: GE, LE: GT, GT: LE, GE: LT, Like: NotLike, }
View Source
var OpName = map[int]string{ UnaryMinus: "-", Not: "not", Or: "or", And: "and", Plus: "+", Minus: "-", Mult: "*", Div: "/", IntegerDiv: "div", Mod: "%", Like: "like", NotLike: "notLike", Typecast: "cast", EQ: "=", LT: "<", LE: "<=", GT: ">", GE: ">=", NE: "<>", }
View Source
var OpTypes = map[int]int{ UnaryMinus: Unary, Or: Binary, And: Binary, Plus: Binary, Minus: Binary, Mult: Binary, Div: Binary, Mod: Binary, Like: Binary, NotLike: Binary, Typecast: Binary, EQ: Binary, LT: Binary, LE: Binary, GT: Binary, GE: Binary, NE: Binary, }
View Source
var SelsType = types.Type{Oid: types.T_sel, Size: 8}
View Source
var ( // UnaryOps contains the unary operations indexed by operation type. UnaryOps = map[int][]*UnaryOp{} )
Functions ¶
func AppendCastRules ¶
func AppendFunctionRets ¶
AppendFunctionRets will add function-return-type information into related structure op is function id args is a slice of argument types ret is return type of this function
func BinaryEval ¶
func GetBinOpReturnType ¶
GetBinOpReturnType returns the returnType of binary ops or binary functions
func GetMultiReturnType ¶
GetMultiReturnType returns the returnType of multi ops or multi functions
func GetUnaryOpReturnType ¶
GetUnaryOpReturnType returns the returnType of unary ops or binary functions
func OperatorType ¶
Types ¶
type BinOp ¶
type BinOp struct {
LeftType types.T
RightType types.T
ReturnType types.T
Fn func(*vector.Vector, *vector.Vector, *process.Process, bool, bool) (*vector.Vector, error)
}
BinOp is a binary operator.
Click to show internal directories.
Click to hide internal directories.