Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AttributeExpression ¶
type AttributeExpression struct { Expression AttributePath AttributePath CompareOperator Token CompareValue string }
AttributeExpression is an Expression with a name, operator and value.
func (AttributeExpression) String ¶
func (expression AttributeExpression) String() string
type AttributePath ¶
func (AttributePath) String ¶
func (attributePath AttributePath) String() string
type BinaryExpression ¶
type BinaryExpression struct { Expression X Expression CompareOperator Token Y Expression }
BinaryExpression is an Expression with a token bound to two (child) expressions X and Y.
func (BinaryExpression) String ¶
func (expression BinaryExpression) String() string
type Expression ¶
type Expression interface{}
Expression is a type to assign to implemented expressions.
type Parser ¶
type Parser struct {
// contains filtered or unexported fields
}
Parser is a parser.
func (*Parser) Parse ¶
func (parser *Parser) Parse() (Expression, error)
Parse returns an abstract syntax tree of the string in the scanner. https://tools.ietf.org/html/rfc7644#section-3.4.2.2
type Path ¶
type Path struct { AttributeName string SubAttribute string ValueExpression Expression }
type Scanner ¶
type Scanner struct {
// contains filtered or unexported fields
}
Scanner is a lexical scanner.
func NewScanner ¶
NewScanner returns a new instance of Scanner.
type Token ¶
type Token int
Token is an int type representing tokens.
const ( // UNKNOWN is an unknown token UNKNOWN Token = iota // WHITESPACE is a whitespace (i.e. " ") WHITESPACE // IDENTIFIER is an identifier (i.e. "userName") IDENTIFIER // EOF represents an end-of-file EOF // VALUE is a value (i.e. "john") VALUE // EQ = equals EQ // NE = not equal NE // CO = contains CO // SW = starts with SW // EW = ends with EW // PR = present (has value) PR // GT = greater than GT // GE = greater than or equal to GE // LT = less than LT // LE = less than or equal to LE // AND = logical "and" AND // OR = logical "or" OR // NOT = "not" function NOT // LeftParenthesis = "(" LeftParenthesis // RightParenthesis = ")" RightParenthesis // LeftBracket = "[" LeftBracket // RightBracket = "]" RightBracket // Dot = . Dot )
func (Token) IsAssociative ¶
IsAssociative return whether the token in associative.
func (Token) IsOperator ¶
IsOperator returns whether the token is an operator.
func (Token) Precedence ¶
Precedence returns the precedence value of the token.
type UnaryExpression ¶
type UnaryExpression struct { Expression CompareOperator Token X Expression }
UnaryExpression is an Expression with a token bound to a (child) expression X.
func (UnaryExpression) String ¶
func (expression UnaryExpression) String() string
type ValuePath ¶
type ValuePath struct { Expression AttributeName string ValueExpression Expression }