Documentation ¶
Index ¶
Constants ¶
View Source
const ( TokenEOF = iota TokenWord TokenOr TokenInteger TokenLeftBracket TokenRightBracket TokenColon TokenAll )
Token types
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Parser ¶
type Parser struct {
// contains filtered or unexported fields
}
Parser represents a parser.
func (*Parser) Parse ¶
func (p *Parser) Parse() (*PrimaryFilterAST, error)
Parse parses the tokens into an AST.
type PrimaryFilterAST ¶
type PrimaryFilterAST struct { // When All is true, it represents the '*' and it means ignore the Words entirely. All bool Words []string Slice *slicecomp.Slice }
PrimaryFilterAST represents the primary filter syntax.
func ParsePrimaryFilter ¶
func ParsePrimaryFilter(input string) (*PrimaryFilterAST, error)
func (*PrimaryFilterAST) Count ¶
func (p *PrimaryFilterAST) Count() int
func (*PrimaryFilterAST) IsAll ¶
func (p *PrimaryFilterAST) IsAll() bool
func (*PrimaryFilterAST) PrefixAt ¶
func (p *PrimaryFilterAST) PrefixAt(idx int) string
func (*PrimaryFilterAST) Query ¶ added in v0.0.8
func (p *PrimaryFilterAST) Query() string
func (*PrimaryFilterAST) String ¶
func (p *PrimaryFilterAST) String() string
type Tokenizer ¶
type Tokenizer struct {
// contains filtered or unexported fields
}
Tokenizer holds the state of the scanner.
func NewTokenizer ¶
NewTokenizer returns a new instance of Tokenizer.
Click to show internal directories.
Click to hide internal directories.