Documentation ¶
Index ¶
- Constants
- Variables
- func FilterErrorMessage(state, lookAhead int) string
- func FilterParse(Filterlex FilterLexer) int
- func FilterStatname(s int) string
- func FilterTokname(c int) string
- func Filterlex1(lex FilterLexer, lval *FilterSymType) (char, token int)
- func NewNullVal() nullVal
- type AndExpr
- type BoolVal
- type ComparisonExpr
- type Expr
- type FilterLexer
- type FilterParser
- type FilterParserImpl
- type FilterSymType
- type FloatVal
- type IntVal
- type IsNullExpr
- type JSONPathVal
- type NotExpr
- type OrExpr
- type Order
- type OrderBy
- type StringVal
Constants ¶
View Source
const ( EqualStr = "=" LessThanStr = "<" GreaterThanStr = ">" LessEqualStr = "<=" GreaterEqualStr = ">=" NotEqualStr = "!=" LikeStr = "like" NotLikeStr = "not like" IsNull = "is null" IsNotNull = "is not null" )
View Source
const ( AscScr = "asc" DescScr = "desc" )
Order.Direction
View Source
const AND = 57347
View Source
const ASC = 57362
View Source
const DESC = 57363
View Source
const FALSE = 57360
View Source
const FLOAT = 57356
View Source
const FilterEofCode = 1
View Source
const FilterErrCode = 2
View Source
const FilterFlag = -1000
View Source
const FilterInitialStackSize = 16
View Source
const FilterLast = 64
View Source
const FilterPrivate = 57344
View Source
const GE = 57350
View Source
const INTEGRAL = 57355
View Source
const IS = 57353
View Source
const JSON_PATH = 57357
View Source
const LE = 57349
View Source
const LIKE = 57352
View Source
const MaxInt = uint64(int(MaxUint >> 1))
View Source
const MaxUint = ^uint(0)
View Source
const NE = 57351
View Source
const NOT = 57348
View Source
const NULL = 57358
View Source
const OR = 57346
View Source
const START_EXPRESSION = 57361
View Source
const START_ORDER_LIST = 57364
View Source
const STRING = 57354
View Source
const TRUE = 57359
Variables ¶
View Source
var ( FilterDebug = 0 FilterErrorVerbose = false )
View Source
var FilterAct = [...]int{
8, 19, 9, 7, 13, 14, 15, 16, 17, 10,
11, 35, 6, 50, 13, 14, 15, 16, 17, 10,
11, 37, 38, 20, 45, 47, 43, 43, 42, 44,
2, 4, 22, 21, 3, 22, 21, 48, 23, 24,
46, 21, 1, 36, 41, 18, 43, 12, 49, 25,
5, 0, 0, 39, 40, 27, 29, 30, 31, 32,
33, 34, 26, 28,
}
View Source
var FilterChk = [...]int{
-1000, -10, 24, 28, -1, -2, 15, 6, -6, -5,
22, 23, -4, 17, 18, 19, 20, 21, -7, -8,
20, 5, 4, -1, -1, -3, 13, 6, 14, 7,
8, 9, 10, 11, 12, 27, -9, 25, 26, -1,
-1, 16, -5, -6, -5, 13, 21, 6, -8, -5,
21,
}
View Source
var FilterDef = [...]int{
0, -2, 0, 29, 1, 3, 0, 0, -2, 0,
27, 28, 14, 22, 23, 24, 25, 26, 2, 30,
33, 0, 0, 0, 7, 0, 0, 0, 0, 16,
17, 18, 19, 20, 21, 0, 32, 34, 35, 5,
6, 4, 9, 15, 10, 0, 12, 0, 31, 11,
13,
}
View Source
var FilterErrorMessages = [...]struct { state int token int msg string }{}
View Source
var FilterExca = [...]int{
-1, 1,
1, -1,
-2, 0,
-1, 8,
1, 8,
4, 8,
5, 8,
16, 8,
-2, 15,
}
View Source
var FilterPact = [...]int{
6, -1000, -3, 3, 31, -1000, -3, -3, -1000, 49,
-1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -16, -1000,
-4, -3, -3, 28, -1000, -13, -13, 11, 19, -1000,
-1000, -1000, -1000, -1000, -1000, 3, -1000, -1000, -1000, -1000,
36, -1000, -1000, -1000, -1000, -13, -1000, -8, -1000, -1000,
-1000,
}
View Source
var FilterPgo = [...]int{
0, 31, 50, 49, 47, 2, 0, 45, 1, 43,
42,
}
View Source
var FilterR1 = [...]int{
0, 10, 10, 1, 1, 1, 1, 1, 1, 2,
2, 2, 2, 2, 5, 5, 3, 3, 3, 3,
3, 3, 4, 4, 4, 4, 4, 6, 6, 7,
7, 7, 8, 9, 9, 9,
}
View Source
var FilterR2 = [...]int{
0, 2, 2, 1, 3, 3, 3, 2, 1, 3,
3, 4, 3, 4, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 0,
1, 3, 2, 0, 1, 1,
}
View Source
var FilterStatenames = [...]string{}
View Source
var FilterTok1 = [...]int{
1, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
15, 16, 3, 3, 27, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
8, 7, 9,
}
View Source
var FilterTok2 = [...]int{
2, 3, 4, 5, 6, 10, 11, 12, 13, 14,
17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
28,
}
View Source
var FilterTok3 = [...]int{
0,
}
View Source
var FilterToknames = [...]string{
"$end",
"error",
"$unk",
"OR",
"AND",
"NOT",
"'='",
"'<'",
"'>'",
"LE",
"GE",
"NE",
"LIKE",
"IS",
"'('",
"')'",
"STRING",
"INTEGRAL",
"FLOAT",
"JSON_PATH",
"NULL",
"TRUE",
"FALSE",
"START_EXPRESSION",
"ASC",
"DESC",
"','",
"START_ORDER_LIST",
}
Functions ¶
func FilterErrorMessage ¶
func FilterParse ¶
func FilterParse(Filterlex FilterLexer) int
func FilterStatname ¶
func FilterTokname ¶
func Filterlex1 ¶
func Filterlex1(lex FilterLexer, lval *FilterSymType) (char, token int)
func NewNullVal ¶
func NewNullVal() nullVal
Types ¶
type ComparisonExpr ¶
func (ComparisonExpr) Eval ¶
func (e ComparisonExpr) Eval(v interface{}) (interface{}, error)
type Expr ¶
type Expr interface { Eval(interface{}) (interface{}, error) Traverse(accept func(a Expr) bool, visit func(v Expr)) }
func NewAndExpr ¶
func NewIsNullExpr ¶
func NewNotExpr ¶
func ParseFilterExpression ¶
type FilterLexer ¶
type FilterLexer interface { Lex(lval *FilterSymType) int Error(s string) }
type FilterParser ¶
type FilterParser interface { Parse(FilterLexer) int Lookahead() int }
func FilterNewParser ¶
func FilterNewParser() FilterParser
type FilterParserImpl ¶
type FilterParserImpl struct {
// contains filtered or unexported fields
}
func (*FilterParserImpl) Lookahead ¶
func (p *FilterParserImpl) Lookahead() int
func (*FilterParserImpl) Parse ¶
func (Filterrcvr *FilterParserImpl) Parse(Filterlex FilterLexer) int
type FilterSymType ¶
type FilterSymType struct {
// contains filtered or unexported fields
}
type IsNullExpr ¶
func (IsNullExpr) Eval ¶
func (e IsNullExpr) Eval(v interface{}) (interface{}, error)
type JSONPathVal ¶
func NewJSONPathVal ¶
func NewJSONPathVal(jsonPath *jsonpath.JSONPath, pathExpr string) JSONPathVal
func (JSONPathVal) Eval ¶
func (e JSONPathVal) Eval(v interface{}) (interface{}, error)
type OrderBy ¶
type OrderBy []*Order
func NewEmptyOrderBy ¶
func NewEmptyOrderBy() OrderBy
func NewOrderBy ¶
func ParseOrderByExpression ¶
Click to show internal directories.
Click to hide internal directories.