Documentation
¶
Index ¶
Constants ¶
View Source
const ( FilterTokenOpenParen int = iota FilterTokenCloseParen FilterTokenWhitespace FilterTokenComma FilterTokenLogical FilterTokenFunc FilterTokenFloat FilterTokenInteger FilterTokenString FilterTokenDate FilterTokenTime FilterTokenDateTime FilterTokenBoolean FilterTokenLiteral )
Token constants
View Source
const ( OpAssociationLeft int = iota OpAssociationRight )
Operator constants
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Operator ¶
type Operator struct {
Token string
// Whether the operator is left/right/or not associative
Association int
// The number of operands this operator operates on
Operands int
// Rank of precedence
Precedence int
}
Operator operator structure
type Parser ¶
type Parser struct {
// Map from string inputs to operator types
Operators map[string]*Operator
// Map from string inputs to function types
Functions map[string]*Function
}
Parser parser structure
func (*Parser) DefineFunction ¶
DefineFunction Adds a function to the language
func (*Parser) DefineOperator ¶
DefineOperator Adds an operator to the language. Provide the token, a precedence, and whether the operator is left, right, or not associative.
type Token ¶
type Token struct {
Value interface{}
Type int
// contains filtered or unexported fields
}
Token token structure
type TokenMatcher ¶
TokenMatcher token matcher structure
type Tokenizer ¶
type Tokenizer struct {
TokenMatchers []*TokenMatcher
IgnoreMatchers []*TokenMatcher
}
Tokenizer structure
Click to show internal directories.
Click to hide internal directories.