Documentation ¶
Index ¶
Constants ¶
const ( PrecedenceLowest PrecedenceAND PrecedenceOR PrecedenceCompare PrecedenceHighest )
Precidence enumerations
const ( TokIllegal = "TokIllegal" TokEOF = "TokEOF" TokIdent = "TokIdent" TokInteger = "TokInteger" TokString = "TokString" TokFloat = "TokFloat" TokExtend = "TokExtend" TokLParen = "(" TokRParen = ")" TokLBracket = "[" TokRBracket = "]" TokLIKE = "~" TokNLIKE = "!~" TokNOT = "!" TokLT = "<" TokGT = ">" TokLE = "<=" TokGE = ">=" TokEQ = "==" TokNEQ = "!=" TokAND = ";" TokOR = "," TokTRUE = "true" TokFALSE = "false" TokNULL = "null" )
Tokens for RSQL FIQL
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Array ¶
type Array struct { Token Token Elements []Expression }
Array is an array of tokens
func (*Array) TokenLiteral ¶
TokenLiteral returns the literal value of a token
type Bool ¶
Bool is a boolean value
func (*Bool) TokenLiteral ¶
TokenLiteral returns the literal value of a token
type Expression ¶
type Expression interface { Node // contains filtered or unexported methods }
Expression is a portion of tree
type ExpressionStatement ¶
type ExpressionStatement struct { Token Token Expression Expression }
ExpressionStatement is a collection of expressions
func (ExpressionStatement) String ¶
func (e ExpressionStatement) String() string
String returns a string representation of value
func (ExpressionStatement) TokenLiteral ¶
func (e ExpressionStatement) TokenLiteral() string
TokenLiteral returns the literal value of a token
type Float ¶
Float is a floating point value
func (*Float) TokenLiteral ¶
TokenLiteral returns the literal value of a token
type Identifier ¶
Identifier is a variable name
func (*Identifier) String ¶
func (i *Identifier) String() string
String returns a string representation of value
func (*Identifier) TokenLiteral ¶
func (i *Identifier) TokenLiteral() string
TokenLiteral returns the literal value of a token
type InfixExpression ¶
type InfixExpression struct { Token Token Left Expression Operator string Right Expression }
InfixExpression is two expressions with a infix operator
func (*InfixExpression) String ¶
func (i *InfixExpression) String() string
String returns a string representation of value
func (*InfixExpression) TokenLiteral ¶
func (i *InfixExpression) TokenLiteral() string
TokenLiteral returns the literal value of a token
type Integer ¶
Integer is a numeric value
func (*Integer) TokenLiteral ¶
TokenLiteral returns the literal value of a token
type Lexer ¶
type Lexer struct {
// contains filtered or unexported fields
}
Lexer reads tokens from input
type Null ¶
type Null struct {
Token Token
}
Null is an empty value
func (*Null) TokenLiteral ¶
TokenLiteral returns the literal value of a token
type Parser ¶
type Parser struct {
// contains filtered or unexported fields
}
Parser reads lexed values and builds an AST
func (*Parser) ParseProgram ¶
ParseProgram builds a program AST from lexer
type PrefixExpression ¶
type PrefixExpression struct { Token Token Operator string Right Expression }
PrefixExpression is an expression with a preceeding operator
func (*PrefixExpression) String ¶
func (p *PrefixExpression) String() string
String returns a string representation of value
func (*PrefixExpression) TokenLiteral ¶
func (p *PrefixExpression) TokenLiteral() string
TokenLiteral returns the literal value of a token
type Program ¶
type Program struct {
Statements []Statement
}
Program is a collection of statements
func DefaultParse ¶
DefaultParse sets up a default lex/parse and returns the program
func (*Program) TokenLiteral ¶
TokenLiteral returns the literal value of a token
type Statement ¶
type Statement interface { Node // contains filtered or unexported methods }
Statement is a executable tree