func (t Token) Precedence() int {
	switch t {
	case OR:
		return 1
	case AND:
		return 2
	case NOT:
		return 3
	}
	return 0
}
Precedence returns the operator precedence of the binary operator token.
package query
import "strings"
type Token int
const (
	ILLEGAL Token = iota  
	EOF                   
	WS                    
	COLON                 
	STRING  
	keywordBeg
	AND  
	OR   
	NOT  
	keywordEnd
	LPAREN  
	RPAREN  
)
var tokens = [...]string{
	ILLEGAL: "ILLEGAL",
	EOF:     "EOF",
	WS:      "WS",
	COLON:   ":",
	AND: "AND",
	OR:  "OR",
	NOT: "NOT",
	LPAREN: "(",
	RPAREN: ")",
}
var keywords map[string]Token
func init() {
	keywords = make(map[string]Token)
	for tok := keywordBeg + 1; tok < keywordEnd; tok++ {
		keywords[strings.ToLower(tokens[tok])] = tok
	}
	for _, tok := range []Token{AND, OR} {
		keywords[strings.ToLower(tokens[tok])] = tok
	}
}
func (t Token) isOperator() bool {
	return t == AND || t == OR || t == NOT
}
func (t Token) String() string {
	if t >= 0 && t < Token(len(tokens)) {
		return tokens[t]
	}
	return ""
}