Documentation ¶
Index ¶
- Constants
- type ExpressionParser
- func (c *ExpressionParser) Clear()
- func (c *ExpressionParser) Expression() string
- func (c *ExpressionParser) InitialTokens() []*ExpressionToken
- func (c *ExpressionParser) OriginalTokens() []*tokenizers.Token
- func (c *ExpressionParser) ParseString(expression string) error
- func (c *ExpressionParser) ParseTokens(tokens []*tokenizers.Token) error
- func (c *ExpressionParser) ResultTokens() []*ExpressionToken
- func (c *ExpressionParser) SetExpression(value string) error
- func (c *ExpressionParser) SetOriginalTokens(value []*tokenizers.Token) error
- func (c *ExpressionParser) VariableNames() []string
- type ExpressionToken
Constants ¶
View Source
const ( Unknown = iota LeftBrace RightBrace LeftSquareBrace RightSquareBrace Plus Minus Star Slash Procent Power Equal NotEqual More Less EqualMore EqualLess ShiftLeft ShiftRight And Or Xor Is In NotIn Element Null Not Like NotLike IsNull IsNotNull Comma Unary Function Variable Constant )
Define types of expression tokens.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ExpressionParser ¶
type ExpressionParser struct {
// contains filtered or unexported fields
}
Implements an expression parser class.
func NewExpressionParser ¶
func NewExpressionParser() *ExpressionParser
func (*ExpressionParser) Expression ¶
func (c *ExpressionParser) Expression() string
Gets the expression string.
func (*ExpressionParser) InitialTokens ¶
func (c *ExpressionParser) InitialTokens() []*ExpressionToken
Gets the list of original expression tokens.
func (*ExpressionParser) OriginalTokens ¶
func (c *ExpressionParser) OriginalTokens() []*tokenizers.Token
Gets the original tokens
func (*ExpressionParser) ParseString ¶
func (c *ExpressionParser) ParseString(expression string) error
Sets a new expression string and parses it into internal byte code.
Parameters:
- expression: A new expression string.
func (*ExpressionParser) ParseTokens ¶
func (c *ExpressionParser) ParseTokens(tokens []*tokenizers.Token) error
func (*ExpressionParser) ResultTokens ¶
func (c *ExpressionParser) ResultTokens() []*ExpressionToken
Gets the list of parsed expression tokens.
func (*ExpressionParser) SetExpression ¶
func (c *ExpressionParser) SetExpression(value string) error
Sets the expression string.
func (*ExpressionParser) SetOriginalTokens ¶
func (c *ExpressionParser) SetOriginalTokens(value []*tokenizers.Token) error
Sets the original tokens
func (*ExpressionParser) VariableNames ¶
func (c *ExpressionParser) VariableNames() []string
Gets the list of found variable names.
type ExpressionToken ¶
type ExpressionToken struct {
// contains filtered or unexported fields
}
Defines an expression token holder.
func NewExpressionToken ¶
Creates an instance of this token and initializes it with specified values.
Parameters:
- typ: The type of this token.
- value: The value of this token.
- line: The line number where the token is.
- column: The column number where the token is.
func (*ExpressionToken) Column ¶
func (c *ExpressionToken) Column() int
The column number where the token is.
func (*ExpressionToken) Line ¶
func (c *ExpressionToken) Line() int
The line number where the token is.
func (*ExpressionToken) Value ¶
func (c *ExpressionToken) Value() *variants.Variant
The value of this token.
Click to show internal directories.
Click to hide internal directories.