Documentation ¶
Overview ¶
Package ast describes an abstract syntax tree for PQL
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AST ¶
type AST struct { Query ExpressionStatement Modifiers []ModifierStatement }
AST is the parsed abstract syntax tree of a query
type DateLiteral ¶
DateLiteral is a string representing a date
func (DateLiteral) GetValue ¶
func (dl DateLiteral) GetValue() interface{}
Value impelements literal
func (DateLiteral) String ¶
func (dl DateLiteral) String() string
func (DateLiteral) TokenLiteral ¶
func (dl DateLiteral) TokenLiteral() string
TokenLiteral implements AST node
type Expression ¶
type Expression interface { Node // contains filtered or unexported methods }
Expression represents an AST node that evaluates to a value
type ExpressionStatement ¶
type ExpressionStatement struct { Token token.Token Expression Expression }
ExpressionStatement is the root node of a query
func (*ExpressionStatement) String ¶
func (es *ExpressionStatement) String() string
func (*ExpressionStatement) TokenLiteral ¶
func (es *ExpressionStatement) TokenLiteral() string
TokenLiteral implements AST node
type FieldLiteral ¶
FieldLiteral is a field name either a custom field or otherwise
func (FieldLiteral) IsCustomField ¶
func (fl FieldLiteral) IsCustomField() bool
IsCustomField will return whether or not the given field is a custom field
func (FieldLiteral) String ¶
func (fl FieldLiteral) String() string
func (FieldLiteral) TokenLiteral ¶
func (fl FieldLiteral) TokenLiteral() string
TokenLiteral implements AST node
type InfixExpression ¶
type InfixExpression struct { Token token.Token Left Expression Operator string Right Expression }
InfixExpression is an expression with a left and right side, as well as an operator to perform on those sides
func (InfixExpression) String ¶
func (ie InfixExpression) String() string
func (InfixExpression) TokenLiteral ¶
func (ie InfixExpression) TokenLiteral() string
TokenLiteral implements AST node
type IntegerLiteral ¶
IntegerLiteral is a node whose value is an Integer
func (IntegerLiteral) GetValue ¶
func (il IntegerLiteral) GetValue() interface{}
func (IntegerLiteral) String ¶
func (il IntegerLiteral) String() string
func (IntegerLiteral) TokenLiteral ¶
func (il IntegerLiteral) TokenLiteral() string
TokenLiteral implements AST node
type ModifierStatement ¶
type ModifierStatement struct { Token token.Token Modifier string Value Expression }
ModifierStatement is a statement which modifies the behavior of a query, i.e. LIMIT or ORDER BY
func (*ModifierStatement) String ¶
func (es *ModifierStatement) String() string
func (*ModifierStatement) TokenLiteral ¶
func (es *ModifierStatement) TokenLiteral() string
TokenLiteral implements AST node
type Statement ¶
type Statement interface { Node // contains filtered or unexported methods }
Statement represents an AST node that performs some action
type StringLiteral ¶
func (StringLiteral) GetValue ¶
func (sl StringLiteral) GetValue() interface{}
Value impelements literal
func (StringLiteral) String ¶
func (sl StringLiteral) String() string
func (StringLiteral) TokenLiteral ¶
func (sl StringLiteral) TokenLiteral() string
TokenLiteral implements AST node