uno

package
v0.0.20 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 23, 2023 License: AGPL-3.0 Imports: 13 Imported by: 0

README

UNO

This is an expression engine that serves the recommender system and is mainly divided into two parts:

  1. cpp is the evaluation of the expression engine
  2. go is he parsing and optimization of expressions, a wrapper for libraries used externally

Why do you need an expression engine?

In actual business, we find that conditional filtering occurs in many scenarios, such as: When generating an item pool, you need to filter out the item pool according to certain conditions; At the time of recall, conditional filtering is required. Therefore, we want to abstract an expression engine and handle it efficiently.

go

Here is mainly to parse the string into AST, on the one hand, including the syntax parsing part, which is implemented using ANTLR. Another aspect is the optimization of AST, which mainly includes:

  1. Not Push down
  2. Constant folding and propagation
  3. Pruning
    1. In AND operation, as long as a node is false, false is returned
    2. In OR operation, return true as long as a node is true

cpp

Here is mainly the calculation of expressions, using go's antlr to convert AST into a node array, and then sequentially perform node-related operations, rather than using the structure of the tree for recursive calculation.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var FUNCTION_IO_TYPES = map[string]map[string][]sample.DataType{
	"mini": {
		"in":  {sample.Int64Type, sample.Int64Type},
		"out": {sample.Int64Type},
	},
	"minf": {
		"in":  {sample.Float32Type, sample.Float32Type},
		"out": {sample.Float32Type},
	},
	"min": {
		"in":  {sample.Float32Type, sample.Float32Type},
		"out": {sample.Float32Type},
	},
	"maxi": {
		"in":  {sample.Int64Type, sample.Int64Type},
		"out": {sample.Int64Type},
	},
	"maxf": {
		"in":  {sample.Float32Type, sample.Float32Type},
		"out": {sample.Float32Type},
	},
	"max": {
		"in":  {sample.Float32Type, sample.Float32Type},
		"out": {sample.Float32Type},
	},
	"addi": {
		"in":  {sample.Int64Type, sample.Int64Type},
		"out": {sample.Int64Type},
	},
	"addf": {
		"in":  {sample.Float32Type, sample.Float32Type},
		"out": {sample.Float32Type},
	},
	"subi": {
		"in":  {sample.Int64Type, sample.Int64Type},
		"out": {sample.Int64Type},
	},
	"subf": {
		"in":  {sample.Float32Type, sample.Float32Type},
		"out": {sample.Float32Type},
	},
	"muli": {
		"in":  {sample.Int64Type, sample.Int64Type},
		"out": {sample.Int64Type},
	},
	"mulf": {
		"in":  {sample.Float32Type, sample.Float32Type},
		"out": {sample.Float32Type},
	},
	"divi": {
		"in":  {sample.Int64Type, sample.Int64Type},
		"out": {sample.Int64Type},
	},
	"divf": {
		"in":  {sample.Float32Type, sample.Float32Type},
		"out": {sample.Float32Type},
	},
	"mod": {
		"in":  {sample.Int64Type, sample.Int64Type},
		"out": {sample.Int64Type},
	},
	"pow": {
		"in":  {sample.Float32Type, sample.Float32Type},
		"out": {sample.Float32Type},
	},
	"round": {
		"in":  {sample.Float32Type},
		"out": {sample.Int64Type},
	},
	"floor": {
		"in":  {sample.Float32Type},
		"out": {sample.Int64Type},
	},
	"ceil": {
		"in":  {sample.Float32Type},
		"out": {sample.Int64Type},
	},
	"log": {
		"in":  {sample.Float32Type},
		"out": {sample.Float32Type},
	},
	"exp": {
		"in":  {sample.Float32Type},
		"out": {sample.Float32Type},
	},
	"log10": {
		"in":  {sample.Float32Type},
		"out": {sample.Float32Type},
	},
	"log2": {
		"in":  {sample.Float32Type},
		"out": {sample.Float32Type},
	},
	"sqrt": {
		"in":  {sample.Float32Type},
		"out": {sample.Float32Type},
	},
	"abs": {
		"in":  {sample.Float32Type},
		"out": {sample.Float32Type},
	},
	"absf": {
		"in":  {sample.Float32Type},
		"out": {sample.Float32Type},
	},
	"absi": {
		"in":  {sample.Int64Type},
		"out": {sample.Int64Type},
	},
	"sin": {
		"in":  {sample.Float32Type},
		"out": {sample.Float32Type},
	},
	"asin": {
		"in":  {sample.Float32Type},
		"out": {sample.Float32Type},
	},
	"sinh": {
		"in":  {sample.Float32Type},
		"out": {sample.Float32Type},
	},
	"asinh": {
		"in":  {sample.Float32Type},
		"out": {sample.Float32Type},
	},
	"cos": {
		"in":  {sample.Float32Type},
		"out": {sample.Float32Type},
	},
	"acos": {
		"in":  {sample.Float32Type},
		"out": {sample.Float32Type},
	},
	"cosh": {
		"in":  {sample.Float32Type},
		"out": {sample.Float32Type},
	},
	"acosh": {
		"in":  {sample.Float32Type},
		"out": {sample.Float32Type},
	},
	"tanh": {
		"in":  {sample.Float32Type},
		"out": {sample.Float32Type},
	},
	"atan": {
		"in":  {sample.Float32Type},
		"out": {sample.Float32Type},
	},
	"atanh": {
		"in":  {sample.Float32Type},
		"out": {sample.Float32Type},
	},
	"sigmoid": {
		"in":  {sample.Float32Type},
		"out": {sample.Float32Type},
	},

	"year": {
		"in":  {},
		"out": {sample.StringType},
	},
	"month": {
		"in":  {},
		"out": {sample.StringType},
	},
	"day": {
		"in":  {},
		"out": {sample.StringType},
	},
	"date": {
		"in":  {},
		"out": {sample.StringType},
	},
	"hour": {
		"in":  {},
		"out": {sample.StringType},
	},
	"minute": {
		"in":  {},
		"out": {sample.StringType},
	},
	"second": {
		"in":  {},
		"out": {sample.StringType},
	},
	"now": {
		"in":  {},
		"out": {sample.Int64Type},
	},

	"from_unixtime": {
		"in":  {sample.Int64Type, sample.StringType},
		"out": {sample.StringType},
	},

	"unix_timestamp": {
		"in":  {sample.StringType, sample.StringType},
		"out": {sample.Int64Type},
	},
	"date_add": {
		"in":  {sample.StringType, sample.Int64Type},
		"out": {sample.StringType},
	},
	"date_sub": {
		"in":  {sample.StringType, sample.Int64Type},
		"out": {sample.StringType},
	},
	"date_diff": {
		"in":  {sample.StringType, sample.StringType},
		"out": {sample.Int64Type},
	},
	"reverse": {
		"in":  {sample.StringType},
		"out": {sample.StringType},
	},
	"upper": {
		"in":  {sample.StringType},
		"out": {sample.StringType},
	},
	"lower": {
		"in":  {sample.StringType},
		"out": {sample.StringType},
	},
	"substr": {
		"in":  {sample.StringType, sample.Int64Type, sample.Int64Type},
		"out": {sample.StringType},
	},
	"concat": {
		"in":  {sample.StringType, sample.StringType},
		"out": {sample.StringType},
	},
	"casti2f": {
		"in":  {sample.Int64Type},
		"out": {sample.Float32Type},
	},
	"castf2i": {
		"in":  {sample.Float32Type},
		"out": {sample.Int64Type},
	},
}
View Source
var UnoLexerLexerStaticData struct {
	ChannelNames           []string
	ModeNames              []string
	LiteralNames           []string
	SymbolicNames          []string
	RuleNames              []string
	PredictionContextCache *antlr.PredictionContextCache
	// contains filtered or unexported fields
}
View Source
var UnoParserStaticData struct {
	LiteralNames           []string
	SymbolicNames          []string
	RuleNames              []string
	PredictionContextCache *antlr.PredictionContextCache
	// contains filtered or unexported fields
}

Functions

func InitEmptyArithmetic_expressionContext

func InitEmptyArithmetic_expressionContext(p *Arithmetic_expressionContext)

func InitEmptyBoolean_expressionContext

func InitEmptyBoolean_expressionContext(p *Boolean_expressionContext)

func InitEmptyStartContext

func InitEmptyStartContext(p *StartContext)

func InitEmptyType_markerContext

func InitEmptyType_markerContext(p *Type_markerContext)

func NewunoLexer

func NewunoLexer(input antlr.CharStream) *unoLexer

NewunoLexer produces a new lexer instance for the optional input antlr.CharStream.

func NewunoParser

func NewunoParser(input antlr.TokenStream) *unoParser

NewunoParser produces a new parser instance for the optional input antlr.TokenStream.

func UnoLexerInit

func UnoLexerInit()

unoLexerInit initializes any static state used to implement unoLexer. By default the static state used to implement the lexer is lazily initialized during the first call to NewunoLexer(). You can call this function if you wish to initialize the static state ahead of time.

func UnoParserInit

func UnoParserInit()

unoParserInit initializes any static state used to implement unoParser. By default the static state used to implement the parser is lazily initialized during the first call to NewunoParser(). You can call this function if you wish to initialize the static state ahead of time.

Types

type AddArithmeticExpressionContext

type AddArithmeticExpressionContext struct {
	Arithmetic_expressionContext
}

func NewAddArithmeticExpressionContext

func NewAddArithmeticExpressionContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *AddArithmeticExpressionContext

func (*AddArithmeticExpressionContext) AllArithmetic_expression

func (s *AddArithmeticExpressionContext) AllArithmetic_expression() []IArithmetic_expressionContext

func (*AddArithmeticExpressionContext) Arithmetic_expression

func (*AddArithmeticExpressionContext) EnterRule

func (s *AddArithmeticExpressionContext) EnterRule(listener antlr.ParseTreeListener)

func (*AddArithmeticExpressionContext) ExitRule

func (s *AddArithmeticExpressionContext) ExitRule(listener antlr.ParseTreeListener)

func (*AddArithmeticExpressionContext) GetRuleContext

func (s *AddArithmeticExpressionContext) GetRuleContext() antlr.RuleContext

func (*AddArithmeticExpressionContext) T_ADD

func (s *AddArithmeticExpressionContext) T_ADD() antlr.TerminalNode

type And

type And struct {
	BaseExpression
	// contains filtered or unexported fields
}

func (*And) GetType

func (a *And) GetType() NodeType

func (*And) MarshalJSON

func (a *And) MarshalJSON() ([]byte, error)

func (*And) Negation

func (a *And) Negation() BooleanExpression

func (*And) Simplify

func (a *And) Simplify() BooleanExpression

func (*And) ToList

func (a *And) ToList() []Expression

func (*And) Trivial

func (a *And) Trivial() bool

type AndBooleanExpressionContext

type AndBooleanExpressionContext struct {
	Boolean_expressionContext
}

func NewAndBooleanExpressionContext

func NewAndBooleanExpressionContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *AndBooleanExpressionContext

func (*AndBooleanExpressionContext) AllBoolean_expression

func (s *AndBooleanExpressionContext) AllBoolean_expression() []IBoolean_expressionContext

func (*AndBooleanExpressionContext) Boolean_expression

func (*AndBooleanExpressionContext) EnterRule

func (s *AndBooleanExpressionContext) EnterRule(listener antlr.ParseTreeListener)

func (*AndBooleanExpressionContext) ExitRule

func (s *AndBooleanExpressionContext) ExitRule(listener antlr.ParseTreeListener)

func (*AndBooleanExpressionContext) GetRuleContext

func (s *AndBooleanExpressionContext) GetRuleContext() antlr.RuleContext

func (*AndBooleanExpressionContext) T_AND

func (s *AndBooleanExpressionContext) T_AND() antlr.TerminalNode

type ArithmeticExpression

type ArithmeticExpression interface {
	Expression
	GetDataType() sample.DataType
	GetValue() unsafe.Pointer
	Simplify() ArithmeticExpression
}

define arithmetic expression interface

type Arithmetic_expressionContext

type Arithmetic_expressionContext struct {
	antlr.BaseParserRuleContext
	// contains filtered or unexported fields
}

func NewArithmetic_expressionContext

func NewArithmetic_expressionContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *Arithmetic_expressionContext

func NewEmptyArithmetic_expressionContext

func NewEmptyArithmetic_expressionContext() *Arithmetic_expressionContext

func (*Arithmetic_expressionContext) CopyAll

func (*Arithmetic_expressionContext) GetParser

func (s *Arithmetic_expressionContext) GetParser() antlr.Parser

func (*Arithmetic_expressionContext) GetRuleContext

func (s *Arithmetic_expressionContext) GetRuleContext() antlr.RuleContext

func (*Arithmetic_expressionContext) IsArithmetic_expressionContext

func (*Arithmetic_expressionContext) IsArithmetic_expressionContext()

func (*Arithmetic_expressionContext) ToStringTree

func (s *Arithmetic_expressionContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string

type BaseExpression

type BaseExpression struct {
	// contains filtered or unexported fields
}

func (*BaseExpression) GetId

func (e *BaseExpression) GetId() int32

func (*BaseExpression) SetId

func (e *BaseExpression) SetId(id int32)

type BaseunoListener

type BaseunoListener struct{}

BaseunoListener is a complete listener for a parse tree produced by unoParser.

func (*BaseunoListener) EnterAddArithmeticExpression

func (s *BaseunoListener) EnterAddArithmeticExpression(ctx *AddArithmeticExpressionContext)

EnterAddArithmeticExpression is called when production AddArithmeticExpression is entered.

func (*BaseunoListener) EnterAndBooleanExpression

func (s *BaseunoListener) EnterAndBooleanExpression(ctx *AndBooleanExpressionContext)

EnterAndBooleanExpression is called when production AndBooleanExpression is entered.

func (*BaseunoListener) EnterCmpBooleanExpression

func (s *BaseunoListener) EnterCmpBooleanExpression(ctx *CmpBooleanExpressionContext)

EnterCmpBooleanExpression is called when production CmpBooleanExpression is entered.

func (*BaseunoListener) EnterColumnArithmeticExpression

func (s *BaseunoListener) EnterColumnArithmeticExpression(ctx *ColumnArithmeticExpressionContext)

EnterColumnArithmeticExpression is called when production ColumnArithmeticExpression is entered.

func (*BaseunoListener) EnterDecimalArithmeticExpression

func (s *BaseunoListener) EnterDecimalArithmeticExpression(ctx *DecimalArithmeticExpressionContext)

EnterDecimalArithmeticExpression is called when production DecimalArithmeticExpression is entered.

func (*BaseunoListener) EnterDivArithmeticExpression

func (s *BaseunoListener) EnterDivArithmeticExpression(ctx *DivArithmeticExpressionContext)

EnterDivArithmeticExpression is called when production DivArithmeticExpression is entered.

func (*BaseunoListener) EnterEveryRule

func (s *BaseunoListener) EnterEveryRule(ctx antlr.ParserRuleContext)

EnterEveryRule is called when any rule is entered.

func (*BaseunoListener) EnterFalseBooleanExpression

func (s *BaseunoListener) EnterFalseBooleanExpression(ctx *FalseBooleanExpressionContext)

EnterFalseBooleanExpression is called when production FalseBooleanExpression is entered.

func (*BaseunoListener) EnterFieldColumnArithmeticExpression

func (s *BaseunoListener) EnterFieldColumnArithmeticExpression(ctx *FieldColumnArithmeticExpressionContext)

EnterFieldColumnArithmeticExpression is called when production FieldColumnArithmeticExpression is entered.

func (*BaseunoListener) EnterFuncArithmeticExpression

func (s *BaseunoListener) EnterFuncArithmeticExpression(ctx *FuncArithmeticExpressionContext)

EnterFuncArithmeticExpression is called when production FuncArithmeticExpression is entered.

func (*BaseunoListener) EnterInBooleanExpression

func (s *BaseunoListener) EnterInBooleanExpression(ctx *InBooleanExpressionContext)

EnterInBooleanExpression is called when production InBooleanExpression is entered.

func (*BaseunoListener) EnterIntegerArithmeticExpression

func (s *BaseunoListener) EnterIntegerArithmeticExpression(ctx *IntegerArithmeticExpressionContext)

EnterIntegerArithmeticExpression is called when production IntegerArithmeticExpression is entered.

func (*BaseunoListener) EnterModArithmeticExpression

func (s *BaseunoListener) EnterModArithmeticExpression(ctx *ModArithmeticExpressionContext)

EnterModArithmeticExpression is called when production ModArithmeticExpression is entered.

func (*BaseunoListener) EnterMulArithmeticExpression

func (s *BaseunoListener) EnterMulArithmeticExpression(ctx *MulArithmeticExpressionContext)

EnterMulArithmeticExpression is called when production MulArithmeticExpression is entered.

func (*BaseunoListener) EnterNotBooleanExpression

func (s *BaseunoListener) EnterNotBooleanExpression(ctx *NotBooleanExpressionContext)

EnterNotBooleanExpression is called when production NotBooleanExpression is entered.

func (*BaseunoListener) EnterNotInBooleanExpression

func (s *BaseunoListener) EnterNotInBooleanExpression(ctx *NotInBooleanExpressionContext)

EnterNotInBooleanExpression is called when production NotInBooleanExpression is entered.

func (*BaseunoListener) EnterOrBooleanExpression

func (s *BaseunoListener) EnterOrBooleanExpression(ctx *OrBooleanExpressionContext)

EnterOrBooleanExpression is called when production OrBooleanExpression is entered.

func (*BaseunoListener) EnterPlainArithmeticExpression

func (s *BaseunoListener) EnterPlainArithmeticExpression(ctx *PlainArithmeticExpressionContext)

EnterPlainArithmeticExpression is called when production PlainArithmeticExpression is entered.

func (*BaseunoListener) EnterPlainBooleanExpression

func (s *BaseunoListener) EnterPlainBooleanExpression(ctx *PlainBooleanExpressionContext)

EnterPlainBooleanExpression is called when production PlainBooleanExpression is entered.

func (*BaseunoListener) EnterRuntTimeFuncArithmeticExpression

func (s *BaseunoListener) EnterRuntTimeFuncArithmeticExpression(ctx *RuntTimeFuncArithmeticExpressionContext)

EnterRuntTimeFuncArithmeticExpression is called when production RuntTimeFuncArithmeticExpression is entered.

func (*BaseunoListener) EnterStart

func (s *BaseunoListener) EnterStart(ctx *StartContext)

EnterStart is called when production start is entered.

func (*BaseunoListener) EnterStringArithmeticExpression

func (s *BaseunoListener) EnterStringArithmeticExpression(ctx *StringArithmeticExpressionContext)

EnterStringArithmeticExpression is called when production StringArithmeticExpression is entered.

func (*BaseunoListener) EnterSubArithmeticExpression

func (s *BaseunoListener) EnterSubArithmeticExpression(ctx *SubArithmeticExpressionContext)

EnterSubArithmeticExpression is called when production SubArithmeticExpression is entered.

func (*BaseunoListener) EnterTrueBooleanExpression

func (s *BaseunoListener) EnterTrueBooleanExpression(ctx *TrueBooleanExpressionContext)

EnterTrueBooleanExpression is called when production TrueBooleanExpression is entered.

func (*BaseunoListener) EnterType_marker

func (s *BaseunoListener) EnterType_marker(ctx *Type_markerContext)

EnterType_marker is called when production type_marker is entered.

func (*BaseunoListener) ExitAddArithmeticExpression

func (s *BaseunoListener) ExitAddArithmeticExpression(ctx *AddArithmeticExpressionContext)

ExitAddArithmeticExpression is called when production AddArithmeticExpression is exited.

func (*BaseunoListener) ExitAndBooleanExpression

func (s *BaseunoListener) ExitAndBooleanExpression(ctx *AndBooleanExpressionContext)

ExitAndBooleanExpression is called when production AndBooleanExpression is exited.

func (*BaseunoListener) ExitCmpBooleanExpression

func (s *BaseunoListener) ExitCmpBooleanExpression(ctx *CmpBooleanExpressionContext)

ExitCmpBooleanExpression is called when production CmpBooleanExpression is exited.

func (*BaseunoListener) ExitColumnArithmeticExpression

func (s *BaseunoListener) ExitColumnArithmeticExpression(ctx *ColumnArithmeticExpressionContext)

ExitColumnArithmeticExpression is called when production ColumnArithmeticExpression is exited.

func (*BaseunoListener) ExitDecimalArithmeticExpression

func (s *BaseunoListener) ExitDecimalArithmeticExpression(ctx *DecimalArithmeticExpressionContext)

ExitDecimalArithmeticExpression is called when production DecimalArithmeticExpression is exited.

func (*BaseunoListener) ExitDivArithmeticExpression

func (s *BaseunoListener) ExitDivArithmeticExpression(ctx *DivArithmeticExpressionContext)

ExitDivArithmeticExpression is called when production DivArithmeticExpression is exited.

func (*BaseunoListener) ExitEveryRule

func (s *BaseunoListener) ExitEveryRule(ctx antlr.ParserRuleContext)

ExitEveryRule is called when any rule is exited.

func (*BaseunoListener) ExitFalseBooleanExpression

func (s *BaseunoListener) ExitFalseBooleanExpression(ctx *FalseBooleanExpressionContext)

ExitFalseBooleanExpression is called when production FalseBooleanExpression is exited.

func (*BaseunoListener) ExitFieldColumnArithmeticExpression

func (s *BaseunoListener) ExitFieldColumnArithmeticExpression(ctx *FieldColumnArithmeticExpressionContext)

ExitFieldColumnArithmeticExpression is called when production FieldColumnArithmeticExpression is exited.

func (*BaseunoListener) ExitFuncArithmeticExpression

func (s *BaseunoListener) ExitFuncArithmeticExpression(ctx *FuncArithmeticExpressionContext)

ExitFuncArithmeticExpression is called when production FuncArithmeticExpression is exited.

func (*BaseunoListener) ExitInBooleanExpression

func (s *BaseunoListener) ExitInBooleanExpression(ctx *InBooleanExpressionContext)

ExitInBooleanExpression is called when production InBooleanExpression is exited.

func (*BaseunoListener) ExitIntegerArithmeticExpression

func (s *BaseunoListener) ExitIntegerArithmeticExpression(ctx *IntegerArithmeticExpressionContext)

ExitIntegerArithmeticExpression is called when production IntegerArithmeticExpression is exited.

func (*BaseunoListener) ExitModArithmeticExpression

func (s *BaseunoListener) ExitModArithmeticExpression(ctx *ModArithmeticExpressionContext)

ExitModArithmeticExpression is called when production ModArithmeticExpression is exited.

func (*BaseunoListener) ExitMulArithmeticExpression

func (s *BaseunoListener) ExitMulArithmeticExpression(ctx *MulArithmeticExpressionContext)

ExitMulArithmeticExpression is called when production MulArithmeticExpression is exited.

func (*BaseunoListener) ExitNotBooleanExpression

func (s *BaseunoListener) ExitNotBooleanExpression(ctx *NotBooleanExpressionContext)

ExitNotBooleanExpression is called when production NotBooleanExpression is exited.

func (*BaseunoListener) ExitNotInBooleanExpression

func (s *BaseunoListener) ExitNotInBooleanExpression(ctx *NotInBooleanExpressionContext)

ExitNotInBooleanExpression is called when production NotInBooleanExpression is exited.

func (*BaseunoListener) ExitOrBooleanExpression

func (s *BaseunoListener) ExitOrBooleanExpression(ctx *OrBooleanExpressionContext)

ExitOrBooleanExpression is called when production OrBooleanExpression is exited.

func (*BaseunoListener) ExitPlainArithmeticExpression

func (s *BaseunoListener) ExitPlainArithmeticExpression(ctx *PlainArithmeticExpressionContext)

ExitPlainArithmeticExpression is called when production PlainArithmeticExpression is exited.

func (*BaseunoListener) ExitPlainBooleanExpression

func (s *BaseunoListener) ExitPlainBooleanExpression(ctx *PlainBooleanExpressionContext)

ExitPlainBooleanExpression is called when production PlainBooleanExpression is exited.

func (*BaseunoListener) ExitRuntTimeFuncArithmeticExpression

func (s *BaseunoListener) ExitRuntTimeFuncArithmeticExpression(ctx *RuntTimeFuncArithmeticExpressionContext)

ExitRuntTimeFuncArithmeticExpression is called when production RuntTimeFuncArithmeticExpression is exited.

func (*BaseunoListener) ExitStart

func (s *BaseunoListener) ExitStart(ctx *StartContext)

ExitStart is called when production start is exited.

func (*BaseunoListener) ExitStringArithmeticExpression

func (s *BaseunoListener) ExitStringArithmeticExpression(ctx *StringArithmeticExpressionContext)

ExitStringArithmeticExpression is called when production StringArithmeticExpression is exited.

func (*BaseunoListener) ExitSubArithmeticExpression

func (s *BaseunoListener) ExitSubArithmeticExpression(ctx *SubArithmeticExpressionContext)

ExitSubArithmeticExpression is called when production SubArithmeticExpression is exited.

func (*BaseunoListener) ExitTrueBooleanExpression

func (s *BaseunoListener) ExitTrueBooleanExpression(ctx *TrueBooleanExpressionContext)

ExitTrueBooleanExpression is called when production TrueBooleanExpression is exited.

func (*BaseunoListener) ExitType_marker

func (s *BaseunoListener) ExitType_marker(ctx *Type_markerContext)

ExitType_marker is called when production type_marker is exited.

func (*BaseunoListener) VisitErrorNode

func (s *BaseunoListener) VisitErrorNode(node antlr.ErrorNode)

VisitErrorNode is called when an error node is visited.

func (*BaseunoListener) VisitTerminal

func (s *BaseunoListener) VisitTerminal(node antlr.TerminalNode)

VisitTerminal is called when a terminal node is visited.

type BooleanExpression

type BooleanExpression interface {
	Expression
	Negation() BooleanExpression
	Simplify() BooleanExpression
}

define boolean expression interface

type Boolean_expressionContext

type Boolean_expressionContext struct {
	antlr.BaseParserRuleContext
	// contains filtered or unexported fields
}

func NewBoolean_expressionContext

func NewBoolean_expressionContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *Boolean_expressionContext

func NewEmptyBoolean_expressionContext

func NewEmptyBoolean_expressionContext() *Boolean_expressionContext

func (*Boolean_expressionContext) CopyAll

func (*Boolean_expressionContext) GetParser

func (s *Boolean_expressionContext) GetParser() antlr.Parser

func (*Boolean_expressionContext) GetRuleContext

func (s *Boolean_expressionContext) GetRuleContext() antlr.RuleContext

func (*Boolean_expressionContext) IsBoolean_expressionContext

func (*Boolean_expressionContext) IsBoolean_expressionContext()

func (*Boolean_expressionContext) ToStringTree

func (s *Boolean_expressionContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string

type Cmp

type Cmp struct {
	BaseExpression
	// contains filtered or unexported fields
}

func (*Cmp) GetType

func (c *Cmp) GetType() NodeType

func (*Cmp) MarshalJSON

func (c *Cmp) MarshalJSON() ([]byte, error)

func (*Cmp) Negation

func (c *Cmp) Negation() BooleanExpression

func (*Cmp) Simplify

func (c *Cmp) Simplify() BooleanExpression

func (*Cmp) ToList

func (c *Cmp) ToList() []Expression

func (*Cmp) Trivial

func (c *Cmp) Trivial() bool

type CmpBooleanExpressionContext

type CmpBooleanExpressionContext struct {
	Boolean_expressionContext
}

func NewCmpBooleanExpressionContext

func NewCmpBooleanExpressionContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *CmpBooleanExpressionContext

func (*CmpBooleanExpressionContext) AllArithmetic_expression

func (s *CmpBooleanExpressionContext) AllArithmetic_expression() []IArithmetic_expressionContext

func (*CmpBooleanExpressionContext) Arithmetic_expression

func (*CmpBooleanExpressionContext) EnterRule

func (s *CmpBooleanExpressionContext) EnterRule(listener antlr.ParseTreeListener)

func (*CmpBooleanExpressionContext) ExitRule

func (s *CmpBooleanExpressionContext) ExitRule(listener antlr.ParseTreeListener)

func (*CmpBooleanExpressionContext) GetRuleContext

func (s *CmpBooleanExpressionContext) GetRuleContext() antlr.RuleContext

func (*CmpBooleanExpressionContext) T_COMPARE

func (s *CmpBooleanExpressionContext) T_COMPARE() antlr.TerminalNode

type CmpType

type CmpType int32

type ColumnArithmeticExpressionContext

type ColumnArithmeticExpressionContext struct {
	Arithmetic_expressionContext
}

func NewColumnArithmeticExpressionContext

func NewColumnArithmeticExpressionContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *ColumnArithmeticExpressionContext

func (*ColumnArithmeticExpressionContext) EnterRule

func (s *ColumnArithmeticExpressionContext) EnterRule(listener antlr.ParseTreeListener)

func (*ColumnArithmeticExpressionContext) ExitRule

func (s *ColumnArithmeticExpressionContext) ExitRule(listener antlr.ParseTreeListener)

func (*ColumnArithmeticExpressionContext) GetRuleContext

func (s *ColumnArithmeticExpressionContext) GetRuleContext() antlr.RuleContext

func (*ColumnArithmeticExpressionContext) IDENTIFIER

func (s *ColumnArithmeticExpressionContext) IDENTIFIER() antlr.TerminalNode

func (*ColumnArithmeticExpressionContext) Type_marker

type DecimalArithmeticExpressionContext

type DecimalArithmeticExpressionContext struct {
	Arithmetic_expressionContext
}

func NewDecimalArithmeticExpressionContext

func NewDecimalArithmeticExpressionContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *DecimalArithmeticExpressionContext

func (*DecimalArithmeticExpressionContext) DECIMAL

func (s *DecimalArithmeticExpressionContext) DECIMAL() antlr.TerminalNode

func (*DecimalArithmeticExpressionContext) EnterRule

func (s *DecimalArithmeticExpressionContext) EnterRule(listener antlr.ParseTreeListener)

func (*DecimalArithmeticExpressionContext) ExitRule

func (s *DecimalArithmeticExpressionContext) ExitRule(listener antlr.ParseTreeListener)

func (*DecimalArithmeticExpressionContext) GetRuleContext

func (s *DecimalArithmeticExpressionContext) GetRuleContext() antlr.RuleContext

type DivArithmeticExpressionContext

type DivArithmeticExpressionContext struct {
	Arithmetic_expressionContext
}

func NewDivArithmeticExpressionContext

func NewDivArithmeticExpressionContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *DivArithmeticExpressionContext

func (*DivArithmeticExpressionContext) AllArithmetic_expression

func (s *DivArithmeticExpressionContext) AllArithmetic_expression() []IArithmetic_expressionContext

func (*DivArithmeticExpressionContext) Arithmetic_expression

func (*DivArithmeticExpressionContext) EnterRule

func (s *DivArithmeticExpressionContext) EnterRule(listener antlr.ParseTreeListener)

func (*DivArithmeticExpressionContext) ExitRule

func (s *DivArithmeticExpressionContext) ExitRule(listener antlr.ParseTreeListener)

func (*DivArithmeticExpressionContext) GetRuleContext

func (s *DivArithmeticExpressionContext) GetRuleContext() antlr.RuleContext

func (*DivArithmeticExpressionContext) T_DIV

func (s *DivArithmeticExpressionContext) T_DIV() antlr.TerminalNode

type Evaluator

type Evaluator struct {
	// contains filtered or unexported fields
}

func NewEvaluator

func NewEvaluator(condition string) (*Evaluator, error)

func (*Evaluator) Allocate

func (e *Evaluator) Allocate() []unsafe.Pointer

func (*Evaluator) BatchEval

func (e *Evaluator) BatchEval(slices [][]unsafe.Pointer) []int32

func (*Evaluator) Clean

func (e *Evaluator) Clean(slice []unsafe.Pointer)

func (*Evaluator) Eval

func (e *Evaluator) Eval(slice []unsafe.Pointer) int32

func (*Evaluator) Fill

func (e *Evaluator) Fill(table string, features sample.Features, value []unsafe.Pointer)

func (*Evaluator) FillFloat32

func (e *Evaluator) FillFloat32(table, col string, data float32, value []unsafe.Pointer) error

func (*Evaluator) FillFloat32s

func (e *Evaluator) FillFloat32s(table, col string, data []float32, value []unsafe.Pointer) error

func (*Evaluator) FillInt64

func (e *Evaluator) FillInt64(table, col string, data int64, value []unsafe.Pointer) error

func (*Evaluator) FillInt64s

func (e *Evaluator) FillInt64s(table, col string, data []int64, value []unsafe.Pointer) error

func (*Evaluator) FillString

func (e *Evaluator) FillString(table, col string, data string, value []unsafe.Pointer) error

func (*Evaluator) FillStrings

func (e *Evaluator) FillStrings(table, col string, data []string, value []unsafe.Pointer) error

func (*Evaluator) PreEval

func (e *Evaluator) PreEval(slice []unsafe.Pointer)

func (*Evaluator) Release

func (e *Evaluator) Release()

type Expression

type Expression interface {
	GetId() int32
	SetId(int32)
	GetType() NodeType
	Trivial() bool
	MarshalJSON() ([]byte, error)
	ToList() []Expression
}

type FalseBooleanExpressionContext

type FalseBooleanExpressionContext struct {
	Boolean_expressionContext
}

func NewFalseBooleanExpressionContext

func NewFalseBooleanExpressionContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *FalseBooleanExpressionContext

func (*FalseBooleanExpressionContext) EnterRule

func (s *FalseBooleanExpressionContext) EnterRule(listener antlr.ParseTreeListener)

func (*FalseBooleanExpressionContext) ExitRule

func (s *FalseBooleanExpressionContext) ExitRule(listener antlr.ParseTreeListener)

func (*FalseBooleanExpressionContext) GetRuleContext

func (s *FalseBooleanExpressionContext) GetRuleContext() antlr.RuleContext

func (*FalseBooleanExpressionContext) T_FALSE

func (s *FalseBooleanExpressionContext) T_FALSE() antlr.TerminalNode

type FieldColumnArithmeticExpressionContext

type FieldColumnArithmeticExpressionContext struct {
	Arithmetic_expressionContext
}

func NewFieldColumnArithmeticExpressionContext

func NewFieldColumnArithmeticExpressionContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *FieldColumnArithmeticExpressionContext

func (*FieldColumnArithmeticExpressionContext) AllIDENTIFIER

func (s *FieldColumnArithmeticExpressionContext) AllIDENTIFIER() []antlr.TerminalNode

func (*FieldColumnArithmeticExpressionContext) EnterRule

func (s *FieldColumnArithmeticExpressionContext) EnterRule(listener antlr.ParseTreeListener)

func (*FieldColumnArithmeticExpressionContext) ExitRule

func (s *FieldColumnArithmeticExpressionContext) ExitRule(listener antlr.ParseTreeListener)

func (*FieldColumnArithmeticExpressionContext) GetRuleContext

func (s *FieldColumnArithmeticExpressionContext) GetRuleContext() antlr.RuleContext

func (*FieldColumnArithmeticExpressionContext) IDENTIFIER

func (s *FieldColumnArithmeticExpressionContext) IDENTIFIER(i int) antlr.TerminalNode

func (*FieldColumnArithmeticExpressionContext) Type_marker

type Float32

type Float32 struct {
	BaseExpression
	// contains filtered or unexported fields
}

func (*Float32) GetDataType

func (f *Float32) GetDataType() sample.DataType

func (*Float32) GetType

func (f *Float32) GetType() NodeType

func (*Float32) GetValue

func (f *Float32) GetValue() unsafe.Pointer

func (*Float32) MarshalJSON

func (f *Float32) MarshalJSON() ([]byte, error)

func (*Float32) Simplify

func (f *Float32) Simplify() ArithmeticExpression

func (*Float32) ToList

func (f *Float32) ToList() []Expression

func (*Float32) Trivial

func (f *Float32) Trivial() bool

type Float32s

type Float32s struct {
	BaseExpression
	// contains filtered or unexported fields
}

func (*Float32s) GetDataType

func (f *Float32s) GetDataType() sample.DataType

func (*Float32s) GetType

func (f *Float32s) GetType() NodeType

func (*Float32s) GetValue

func (f *Float32s) GetValue() unsafe.Pointer

func (*Float32s) MarshalJSON

func (f *Float32s) MarshalJSON() ([]byte, error)

func (*Float32s) Simplify

func (f *Float32s) Simplify() ArithmeticExpression

func (*Float32s) ToList

func (f *Float32s) ToList() []Expression

func (*Float32s) Trivial

func (i *Float32s) Trivial() bool

type FuncArithmeticExpressionContext

type FuncArithmeticExpressionContext struct {
	Arithmetic_expressionContext
}

func NewFuncArithmeticExpressionContext

func NewFuncArithmeticExpressionContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *FuncArithmeticExpressionContext

func (*FuncArithmeticExpressionContext) AllArithmetic_expression

func (s *FuncArithmeticExpressionContext) AllArithmetic_expression() []IArithmetic_expressionContext

func (*FuncArithmeticExpressionContext) Arithmetic_expression

func (*FuncArithmeticExpressionContext) EnterRule

func (s *FuncArithmeticExpressionContext) EnterRule(listener antlr.ParseTreeListener)

func (*FuncArithmeticExpressionContext) ExitRule

func (s *FuncArithmeticExpressionContext) ExitRule(listener antlr.ParseTreeListener)

func (*FuncArithmeticExpressionContext) GetRuleContext

func (s *FuncArithmeticExpressionContext) GetRuleContext() antlr.RuleContext

func (*FuncArithmeticExpressionContext) IDENTIFIER

func (s *FuncArithmeticExpressionContext) IDENTIFIER() antlr.TerminalNode

type Function

type Function struct {
	BaseExpression
	// contains filtered or unexported fields
}

func (*Function) GetDataType

func (f *Function) GetDataType() sample.DataType

func (*Function) GetType

func (f *Function) GetType() NodeType

func (*Function) GetValue

func (f *Function) GetValue() unsafe.Pointer

func (*Function) MarshalJSON

func (f *Function) MarshalJSON() ([]byte, error)

func (*Function) Simplify

func (f *Function) Simplify() ArithmeticExpression

func (*Function) ToList

func (f *Function) ToList() []Expression

func (*Function) Trivial

func (f *Function) Trivial() bool

type IArithmetic_expressionContext

type IArithmetic_expressionContext interface {
	antlr.ParserRuleContext

	// GetParser returns the parser.
	GetParser() antlr.Parser
	// IsArithmetic_expressionContext differentiates from other interfaces.
	IsArithmetic_expressionContext()
}

IArithmetic_expressionContext is an interface to support dynamic dispatch.

type IBoolean_expressionContext

type IBoolean_expressionContext interface {
	antlr.ParserRuleContext

	// GetParser returns the parser.
	GetParser() antlr.Parser
	// IsBoolean_expressionContext differentiates from other interfaces.
	IsBoolean_expressionContext()
}

IBoolean_expressionContext is an interface to support dynamic dispatch.

type IStartContext

type IStartContext interface {
	antlr.ParserRuleContext

	// GetParser returns the parser.
	GetParser() antlr.Parser

	// Getter signatures
	Boolean_expression() IBoolean_expressionContext
	EOF() antlr.TerminalNode

	// IsStartContext differentiates from other interfaces.
	IsStartContext()
}

IStartContext is an interface to support dynamic dispatch.

type IType_markerContext

type IType_markerContext interface {
	antlr.ParserRuleContext

	// GetParser returns the parser.
	GetParser() antlr.Parser

	// Getter signatures
	T_INT() antlr.TerminalNode
	T_FLOAT() antlr.TerminalNode
	T_STRING() antlr.TerminalNode

	// IsType_markerContext differentiates from other interfaces.
	IsType_markerContext()
}

IType_markerContext is an interface to support dynamic dispatch.

type In

type In struct {
	BaseExpression
	// contains filtered or unexported fields
}

func (*In) GetType

func (i *In) GetType() NodeType

func (*In) MarshalJSON

func (i *In) MarshalJSON() ([]byte, error)

func (*In) Negation

func (i *In) Negation() BooleanExpression

func (*In) Simplify

func (i *In) Simplify() BooleanExpression

func (*In) ToList

func (i *In) ToList() []Expression

func (*In) Trivial

func (i *In) Trivial() bool

type InBooleanExpressionContext

type InBooleanExpressionContext struct {
	Boolean_expressionContext
}

func NewInBooleanExpressionContext

func NewInBooleanExpressionContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *InBooleanExpressionContext

func (*InBooleanExpressionContext) Arithmetic_expression

func (s *InBooleanExpressionContext) Arithmetic_expression() IArithmetic_expressionContext

func (*InBooleanExpressionContext) DECIMAL_LIST

func (s *InBooleanExpressionContext) DECIMAL_LIST() antlr.TerminalNode

func (*InBooleanExpressionContext) EnterRule

func (s *InBooleanExpressionContext) EnterRule(listener antlr.ParseTreeListener)

func (*InBooleanExpressionContext) ExitRule

func (s *InBooleanExpressionContext) ExitRule(listener antlr.ParseTreeListener)

func (*InBooleanExpressionContext) GetRuleContext

func (s *InBooleanExpressionContext) GetRuleContext() antlr.RuleContext

func (*InBooleanExpressionContext) INTEGER_LIST

func (s *InBooleanExpressionContext) INTEGER_LIST() antlr.TerminalNode

func (*InBooleanExpressionContext) STRING_LIST

func (s *InBooleanExpressionContext) STRING_LIST() antlr.TerminalNode

func (*InBooleanExpressionContext) T_IN

func (s *InBooleanExpressionContext) T_IN() antlr.TerminalNode

type Int64

type Int64 struct {
	BaseExpression
	// contains filtered or unexported fields
}

func (*Int64) GetDataType

func (i *Int64) GetDataType() sample.DataType

func (*Int64) GetType

func (i *Int64) GetType() NodeType

func (*Int64) GetValue

func (i *Int64) GetValue() unsafe.Pointer

func (*Int64) MarshalJSON

func (i *Int64) MarshalJSON() ([]byte, error)

func (*Int64) Simplify

func (i *Int64) Simplify() ArithmeticExpression

func (*Int64) ToList

func (i *Int64) ToList() []Expression

func (*Int64) Trivial

func (i *Int64) Trivial() bool

type Int64s

type Int64s struct {
	BaseExpression
	// contains filtered or unexported fields
}

func (*Int64s) GetDataType

func (i *Int64s) GetDataType() sample.DataType

func (*Int64s) GetType

func (i *Int64s) GetType() NodeType

func (*Int64s) GetValue

func (i *Int64s) GetValue() unsafe.Pointer

func (*Int64s) MarshalJSON

func (i *Int64s) MarshalJSON() ([]byte, error)

func (*Int64s) Simplify

func (i *Int64s) Simplify() ArithmeticExpression

func (*Int64s) ToList

func (i *Int64s) ToList() []Expression

func (*Int64s) Trivial

func (i *Int64s) Trivial() bool

type IntegerArithmeticExpressionContext

type IntegerArithmeticExpressionContext struct {
	Arithmetic_expressionContext
}

func NewIntegerArithmeticExpressionContext

func NewIntegerArithmeticExpressionContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *IntegerArithmeticExpressionContext

func (*IntegerArithmeticExpressionContext) EnterRule

func (s *IntegerArithmeticExpressionContext) EnterRule(listener antlr.ParseTreeListener)

func (*IntegerArithmeticExpressionContext) ExitRule

func (s *IntegerArithmeticExpressionContext) ExitRule(listener antlr.ParseTreeListener)

func (*IntegerArithmeticExpressionContext) GetRuleContext

func (s *IntegerArithmeticExpressionContext) GetRuleContext() antlr.RuleContext

func (*IntegerArithmeticExpressionContext) INTEGER

func (s *IntegerArithmeticExpressionContext) INTEGER() antlr.TerminalNode

type Listener

type Listener struct {
	*BaseunoListener
	*antlr.DefaultErrorListener
	// contains filtered or unexported fields
}

func NewListener

func NewListener() *Listener

func (*Listener) ExitAddArithmeticExpression

func (s *Listener) ExitAddArithmeticExpression(ctx *AddArithmeticExpressionContext)

ExitAddArithmeticExpression is called when production AddArithmeticExpression is exited.

func (*Listener) ExitAndBooleanExpression

func (s *Listener) ExitAndBooleanExpression(ctx *AndBooleanExpressionContext)

ExitAndBooleanExpression is called when production AndBooleanExpression is exited.

func (*Listener) ExitCmpBooleanExpression

func (s *Listener) ExitCmpBooleanExpression(ctx *CmpBooleanExpressionContext)

ExitCmpBooleanExpression is called when production CmpBooleanExpression is exited.

func (*Listener) ExitColumnArithmeticExpression

func (s *Listener) ExitColumnArithmeticExpression(ctx *ColumnArithmeticExpressionContext)

ExitColumnArithmeticExpression is called when production ColumnArithmeticExpression is exited.

func (*Listener) ExitDecimalArithmeticExpression

func (s *Listener) ExitDecimalArithmeticExpression(ctx *DecimalArithmeticExpressionContext)

ExitDecimalArithmeticExpression is called when production DecimalArithmeticExpression is exited.

func (*Listener) ExitDivArithmeticExpression

func (s *Listener) ExitDivArithmeticExpression(ctx *DivArithmeticExpressionContext)

ExitDivArithmeticExpression is called when production DivArithmeticExpression is exited.

func (*Listener) ExitFalseBooleanExpression

func (s *Listener) ExitFalseBooleanExpression(ctx *FalseBooleanExpressionContext)

ExitFalseBooleanExpression is called when production FalseBooleanExpression is exited.

func (*Listener) ExitFieldColumnArithmeticExpression

func (s *Listener) ExitFieldColumnArithmeticExpression(ctx *FieldColumnArithmeticExpressionContext)

ExitFieldColumnArithmeticExpression is called when production FieldColumnArithmeticExpression is exited.

func (*Listener) ExitFuncArithmeticExpression

func (s *Listener) ExitFuncArithmeticExpression(ctx *FuncArithmeticExpressionContext)

ExitFuncArithmeticExpression is called when production FuncArithmeticExpression is exited.

func (*Listener) ExitInBooleanExpression

func (s *Listener) ExitInBooleanExpression(ctx *InBooleanExpressionContext)

ExitInBooleanExpression is called when production InBooleanExpression is exited.

func (*Listener) ExitIntegerArithmeticExpression

func (s *Listener) ExitIntegerArithmeticExpression(ctx *IntegerArithmeticExpressionContext)

ExitIntegerArithmeticExpression is called when production IntegerArithmeticExpression is exited.

func (*Listener) ExitModArithmeticExpression

func (s *Listener) ExitModArithmeticExpression(ctx *ModArithmeticExpressionContext)

ExitModArithmeticExpression is called when production ModArithmeticExpression is exited.

func (*Listener) ExitMulArithmeticExpression

func (s *Listener) ExitMulArithmeticExpression(ctx *MulArithmeticExpressionContext)

ExitMulArithmeticExpression is called when production MulArithmeticExpression is exited.

func (*Listener) ExitNotBooleanExpression

func (s *Listener) ExitNotBooleanExpression(ctx *NotBooleanExpressionContext)

ExitNotBooleanExpression is called when production NotBooleanExpression is exited.

func (*Listener) ExitNotInBooleanExpression

func (s *Listener) ExitNotInBooleanExpression(ctx *NotInBooleanExpressionContext)

ExitNotInBooleanExpression is called when production NotInBooleanExpression is exited.

func (*Listener) ExitOrBooleanExpression

func (s *Listener) ExitOrBooleanExpression(ctx *OrBooleanExpressionContext)

ExitOrBooleanExpression is called when production OrBooleanExpression is exited.

func (*Listener) ExitRuntTimeFuncArithmeticExpression

func (s *Listener) ExitRuntTimeFuncArithmeticExpression(ctx *RuntTimeFuncArithmeticExpressionContext)

ExitRuntTimeFuncArithmeticExpression is called when production RuntTimeFuncArithmeticExpression is exited.

func (*Listener) ExitStringArithmeticExpression

func (s *Listener) ExitStringArithmeticExpression(ctx *StringArithmeticExpressionContext)

ExitStringArithmeticExpression is called when production StringArithmeticExpression is exited.

func (*Listener) ExitSubArithmeticExpression

func (s *Listener) ExitSubArithmeticExpression(ctx *SubArithmeticExpressionContext)

ExitSubArithmeticExpression is called when production SubArithmeticExpression is exited.

func (*Listener) ExitTrueBooleanExpression

func (s *Listener) ExitTrueBooleanExpression(ctx *TrueBooleanExpressionContext)

ExitTrueBooleanExpression is called when production TrueBooleanExpression is exited.

func (*Listener) SyntaxError

func (s *Listener) SyntaxError(recognizer antlr.Recognizer, offendingSymbol interface{}, line, column int, msg string, e antlr.RecognitionException)

type Literal

type Literal struct {
	BaseExpression
	// contains filtered or unexported fields
}

func (*Literal) GetType

func (l *Literal) GetType() NodeType

func (*Literal) MarshalJSON

func (l *Literal) MarshalJSON() ([]byte, error)

func (*Literal) Negation

func (l *Literal) Negation() BooleanExpression

func (*Literal) Simplify

func (l *Literal) Simplify() BooleanExpression

func (*Literal) ToList

func (l *Literal) ToList() []Expression

func (*Literal) Trivial

func (l *Literal) Trivial() bool

type ModArithmeticExpressionContext

type ModArithmeticExpressionContext struct {
	Arithmetic_expressionContext
}

func NewModArithmeticExpressionContext

func NewModArithmeticExpressionContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *ModArithmeticExpressionContext

func (*ModArithmeticExpressionContext) AllArithmetic_expression

func (s *ModArithmeticExpressionContext) AllArithmetic_expression() []IArithmetic_expressionContext

func (*ModArithmeticExpressionContext) Arithmetic_expression

func (*ModArithmeticExpressionContext) EnterRule

func (s *ModArithmeticExpressionContext) EnterRule(listener antlr.ParseTreeListener)

func (*ModArithmeticExpressionContext) ExitRule

func (s *ModArithmeticExpressionContext) ExitRule(listener antlr.ParseTreeListener)

func (*ModArithmeticExpressionContext) GetRuleContext

func (s *ModArithmeticExpressionContext) GetRuleContext() antlr.RuleContext

func (*ModArithmeticExpressionContext) T_MOD

func (s *ModArithmeticExpressionContext) T_MOD() antlr.TerminalNode

type MulArithmeticExpressionContext

type MulArithmeticExpressionContext struct {
	Arithmetic_expressionContext
}

func NewMulArithmeticExpressionContext

func NewMulArithmeticExpressionContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *MulArithmeticExpressionContext

func (*MulArithmeticExpressionContext) AllArithmetic_expression

func (s *MulArithmeticExpressionContext) AllArithmetic_expression() []IArithmetic_expressionContext

func (*MulArithmeticExpressionContext) Arithmetic_expression

func (*MulArithmeticExpressionContext) EnterRule

func (s *MulArithmeticExpressionContext) EnterRule(listener antlr.ParseTreeListener)

func (*MulArithmeticExpressionContext) ExitRule

func (s *MulArithmeticExpressionContext) ExitRule(listener antlr.ParseTreeListener)

func (*MulArithmeticExpressionContext) GetRuleContext

func (s *MulArithmeticExpressionContext) GetRuleContext() antlr.RuleContext

func (*MulArithmeticExpressionContext) T_MUL

func (s *MulArithmeticExpressionContext) T_MUL() antlr.TerminalNode

type NodeType

type NodeType int32

type NotBooleanExpressionContext

type NotBooleanExpressionContext struct {
	Boolean_expressionContext
}

func NewNotBooleanExpressionContext

func NewNotBooleanExpressionContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *NotBooleanExpressionContext

func (*NotBooleanExpressionContext) Boolean_expression

func (*NotBooleanExpressionContext) EnterRule

func (s *NotBooleanExpressionContext) EnterRule(listener antlr.ParseTreeListener)

func (*NotBooleanExpressionContext) ExitRule

func (s *NotBooleanExpressionContext) ExitRule(listener antlr.ParseTreeListener)

func (*NotBooleanExpressionContext) GetRuleContext

func (s *NotBooleanExpressionContext) GetRuleContext() antlr.RuleContext

func (*NotBooleanExpressionContext) T_NOT

func (s *NotBooleanExpressionContext) T_NOT() antlr.TerminalNode

type NotIn

type NotIn struct {
	BaseExpression
	// contains filtered or unexported fields
}

func (*NotIn) GetId

func (i *NotIn) GetId() int32

func (*NotIn) GetType

func (i *NotIn) GetType() NodeType

func (*NotIn) MarshalJSON

func (i *NotIn) MarshalJSON() ([]byte, error)

func (*NotIn) Negation

func (i *NotIn) Negation() BooleanExpression

func (*NotIn) Simplify

func (i *NotIn) Simplify() BooleanExpression

func (*NotIn) ToList

func (i *NotIn) ToList() []Expression

func (*NotIn) Trivial

func (i *NotIn) Trivial() bool

type NotInBooleanExpressionContext

type NotInBooleanExpressionContext struct {
	Boolean_expressionContext
}

func NewNotInBooleanExpressionContext

func NewNotInBooleanExpressionContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *NotInBooleanExpressionContext

func (*NotInBooleanExpressionContext) Arithmetic_expression

func (*NotInBooleanExpressionContext) DECIMAL_LIST

func (s *NotInBooleanExpressionContext) DECIMAL_LIST() antlr.TerminalNode

func (*NotInBooleanExpressionContext) EnterRule

func (s *NotInBooleanExpressionContext) EnterRule(listener antlr.ParseTreeListener)

func (*NotInBooleanExpressionContext) ExitRule

func (s *NotInBooleanExpressionContext) ExitRule(listener antlr.ParseTreeListener)

func (*NotInBooleanExpressionContext) GetRuleContext

func (s *NotInBooleanExpressionContext) GetRuleContext() antlr.RuleContext

func (*NotInBooleanExpressionContext) INTEGER_LIST

func (s *NotInBooleanExpressionContext) INTEGER_LIST() antlr.TerminalNode

func (*NotInBooleanExpressionContext) STRING_LIST

func (s *NotInBooleanExpressionContext) STRING_LIST() antlr.TerminalNode

func (*NotInBooleanExpressionContext) T_IN

func (s *NotInBooleanExpressionContext) T_IN() antlr.TerminalNode

func (*NotInBooleanExpressionContext) T_NOT

func (s *NotInBooleanExpressionContext) T_NOT() antlr.TerminalNode

type Or

type Or struct {
	BaseExpression
	// contains filtered or unexported fields
}

func (*Or) GetType

func (o *Or) GetType() NodeType

func (*Or) MarshalJSON

func (o *Or) MarshalJSON() ([]byte, error)

func (*Or) Negation

func (o *Or) Negation() BooleanExpression

func (*Or) Simplify

func (o *Or) Simplify() BooleanExpression

func (*Or) ToList

func (o *Or) ToList() []Expression

func (*Or) Trivial

func (o *Or) Trivial() bool

type OrBooleanExpressionContext

type OrBooleanExpressionContext struct {
	Boolean_expressionContext
}

func NewOrBooleanExpressionContext

func NewOrBooleanExpressionContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *OrBooleanExpressionContext

func (*OrBooleanExpressionContext) AllBoolean_expression

func (s *OrBooleanExpressionContext) AllBoolean_expression() []IBoolean_expressionContext

func (*OrBooleanExpressionContext) Boolean_expression

func (*OrBooleanExpressionContext) EnterRule

func (s *OrBooleanExpressionContext) EnterRule(listener antlr.ParseTreeListener)

func (*OrBooleanExpressionContext) ExitRule

func (s *OrBooleanExpressionContext) ExitRule(listener antlr.ParseTreeListener)

func (*OrBooleanExpressionContext) GetRuleContext

func (s *OrBooleanExpressionContext) GetRuleContext() antlr.RuleContext

func (*OrBooleanExpressionContext) T_OR

func (s *OrBooleanExpressionContext) T_OR() antlr.TerminalNode

type PlainArithmeticExpressionContext

type PlainArithmeticExpressionContext struct {
	Arithmetic_expressionContext
}

func NewPlainArithmeticExpressionContext

func NewPlainArithmeticExpressionContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *PlainArithmeticExpressionContext

func (*PlainArithmeticExpressionContext) Arithmetic_expression

func (*PlainArithmeticExpressionContext) EnterRule

func (s *PlainArithmeticExpressionContext) EnterRule(listener antlr.ParseTreeListener)

func (*PlainArithmeticExpressionContext) ExitRule

func (s *PlainArithmeticExpressionContext) ExitRule(listener antlr.ParseTreeListener)

func (*PlainArithmeticExpressionContext) GetRuleContext

func (s *PlainArithmeticExpressionContext) GetRuleContext() antlr.RuleContext

type PlainBooleanExpressionContext

type PlainBooleanExpressionContext struct {
	Boolean_expressionContext
}

func NewPlainBooleanExpressionContext

func NewPlainBooleanExpressionContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *PlainBooleanExpressionContext

func (*PlainBooleanExpressionContext) Boolean_expression

func (*PlainBooleanExpressionContext) EnterRule

func (s *PlainBooleanExpressionContext) EnterRule(listener antlr.ParseTreeListener)

func (*PlainBooleanExpressionContext) ExitRule

func (s *PlainBooleanExpressionContext) ExitRule(listener antlr.ParseTreeListener)

func (*PlainBooleanExpressionContext) GetRuleContext

func (s *PlainBooleanExpressionContext) GetRuleContext() antlr.RuleContext

type RuntTimeFuncArithmeticExpressionContext

type RuntTimeFuncArithmeticExpressionContext struct {
	Arithmetic_expressionContext
}

func NewRuntTimeFuncArithmeticExpressionContext

func NewRuntTimeFuncArithmeticExpressionContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *RuntTimeFuncArithmeticExpressionContext

func (*RuntTimeFuncArithmeticExpressionContext) EnterRule

func (s *RuntTimeFuncArithmeticExpressionContext) EnterRule(listener antlr.ParseTreeListener)

func (*RuntTimeFuncArithmeticExpressionContext) ExitRule

func (s *RuntTimeFuncArithmeticExpressionContext) ExitRule(listener antlr.ParseTreeListener)

func (*RuntTimeFuncArithmeticExpressionContext) GetRuleContext

func (s *RuntTimeFuncArithmeticExpressionContext) GetRuleContext() antlr.RuleContext

func (*RuntTimeFuncArithmeticExpressionContext) IDENTIFIER

func (s *RuntTimeFuncArithmeticExpressionContext) IDENTIFIER() antlr.TerminalNode

type Stack

type Stack[T any] struct {
	// contains filtered or unexported fields
}

func NewStack

func NewStack[T any]() *Stack[T]

func (*Stack[T]) Pop

func (s *Stack[T]) Pop() T

func (*Stack[T]) Push

func (s *Stack[T]) Push(val T)

type StartContext

type StartContext struct {
	antlr.BaseParserRuleContext
	// contains filtered or unexported fields
}

func NewEmptyStartContext

func NewEmptyStartContext() *StartContext

func NewStartContext

func NewStartContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *StartContext

func (*StartContext) Boolean_expression

func (s *StartContext) Boolean_expression() IBoolean_expressionContext

func (*StartContext) EOF

func (s *StartContext) EOF() antlr.TerminalNode

func (*StartContext) EnterRule

func (s *StartContext) EnterRule(listener antlr.ParseTreeListener)

func (*StartContext) ExitRule

func (s *StartContext) ExitRule(listener antlr.ParseTreeListener)

func (*StartContext) GetParser

func (s *StartContext) GetParser() antlr.Parser

func (*StartContext) GetRuleContext

func (s *StartContext) GetRuleContext() antlr.RuleContext

func (*StartContext) IsStartContext

func (*StartContext) IsStartContext()

func (*StartContext) ToStringTree

func (s *StartContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string

type String

type String struct {
	BaseExpression
	// contains filtered or unexported fields
}

func (*String) GetDataType

func (s *String) GetDataType() sample.DataType

func (*String) GetType

func (s *String) GetType() NodeType

func (*String) GetValue

func (f *String) GetValue() unsafe.Pointer

func (*String) MarshalJSON

func (s *String) MarshalJSON() ([]byte, error)

func (*String) Simplify

func (f *String) Simplify() ArithmeticExpression

func (*String) ToList

func (s *String) ToList() []Expression

func (*String) Trivial

func (s *String) Trivial() bool

type StringArithmeticExpressionContext

type StringArithmeticExpressionContext struct {
	Arithmetic_expressionContext
}

func NewStringArithmeticExpressionContext

func NewStringArithmeticExpressionContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *StringArithmeticExpressionContext

func (*StringArithmeticExpressionContext) EnterRule

func (s *StringArithmeticExpressionContext) EnterRule(listener antlr.ParseTreeListener)

func (*StringArithmeticExpressionContext) ExitRule

func (s *StringArithmeticExpressionContext) ExitRule(listener antlr.ParseTreeListener)

func (*StringArithmeticExpressionContext) GetRuleContext

func (s *StringArithmeticExpressionContext) GetRuleContext() antlr.RuleContext

func (*StringArithmeticExpressionContext) STRING

func (s *StringArithmeticExpressionContext) STRING() antlr.TerminalNode

type Strings

type Strings struct {
	BaseExpression
	// contains filtered or unexported fields
}

func (*Strings) GetDataType

func (s *Strings) GetDataType() sample.DataType

func (*Strings) GetType

func (s *Strings) GetType() NodeType

func (*Strings) GetValue

func (f *Strings) GetValue() unsafe.Pointer

func (*Strings) MarshalJSON

func (s *Strings) MarshalJSON() ([]byte, error)

func (*Strings) Simplify

func (s *Strings) Simplify() ArithmeticExpression

func (*Strings) ToList

func (s *Strings) ToList() []Expression

func (*Strings) Trivial

func (s *Strings) Trivial() bool

type SubArithmeticExpressionContext

type SubArithmeticExpressionContext struct {
	Arithmetic_expressionContext
}

func NewSubArithmeticExpressionContext

func NewSubArithmeticExpressionContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *SubArithmeticExpressionContext

func (*SubArithmeticExpressionContext) AllArithmetic_expression

func (s *SubArithmeticExpressionContext) AllArithmetic_expression() []IArithmetic_expressionContext

func (*SubArithmeticExpressionContext) Arithmetic_expression

func (*SubArithmeticExpressionContext) EnterRule

func (s *SubArithmeticExpressionContext) EnterRule(listener antlr.ParseTreeListener)

func (*SubArithmeticExpressionContext) ExitRule

func (s *SubArithmeticExpressionContext) ExitRule(listener antlr.ParseTreeListener)

func (*SubArithmeticExpressionContext) GetRuleContext

func (s *SubArithmeticExpressionContext) GetRuleContext() antlr.RuleContext

func (*SubArithmeticExpressionContext) T_SUB

func (s *SubArithmeticExpressionContext) T_SUB() antlr.TerminalNode

type TrueBooleanExpressionContext

type TrueBooleanExpressionContext struct {
	Boolean_expressionContext
}

func NewTrueBooleanExpressionContext

func NewTrueBooleanExpressionContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *TrueBooleanExpressionContext

func (*TrueBooleanExpressionContext) EnterRule

func (s *TrueBooleanExpressionContext) EnterRule(listener antlr.ParseTreeListener)

func (*TrueBooleanExpressionContext) ExitRule

func (s *TrueBooleanExpressionContext) ExitRule(listener antlr.ParseTreeListener)

func (*TrueBooleanExpressionContext) GetRuleContext

func (s *TrueBooleanExpressionContext) GetRuleContext() antlr.RuleContext

func (*TrueBooleanExpressionContext) T_TRUE

func (s *TrueBooleanExpressionContext) T_TRUE() antlr.TerminalNode

type Type_markerContext

type Type_markerContext struct {
	antlr.BaseParserRuleContext
	// contains filtered or unexported fields
}

func NewEmptyType_markerContext

func NewEmptyType_markerContext() *Type_markerContext

func NewType_markerContext

func NewType_markerContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *Type_markerContext

func (*Type_markerContext) EnterRule

func (s *Type_markerContext) EnterRule(listener antlr.ParseTreeListener)

func (*Type_markerContext) ExitRule

func (s *Type_markerContext) ExitRule(listener antlr.ParseTreeListener)

func (*Type_markerContext) GetParser

func (s *Type_markerContext) GetParser() antlr.Parser

func (*Type_markerContext) GetRuleContext

func (s *Type_markerContext) GetRuleContext() antlr.RuleContext

func (*Type_markerContext) IsType_markerContext

func (*Type_markerContext) IsType_markerContext()

func (*Type_markerContext) T_FLOAT

func (s *Type_markerContext) T_FLOAT() antlr.TerminalNode

func (*Type_markerContext) T_INT

func (s *Type_markerContext) T_INT() antlr.TerminalNode

func (*Type_markerContext) T_STRING

func (s *Type_markerContext) T_STRING() antlr.TerminalNode

func (*Type_markerContext) ToStringTree

func (s *Type_markerContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string

type Variable

type Variable struct {
	BaseExpression
	// contains filtered or unexported fields
}

func (*Variable) GetDataType

func (v *Variable) GetDataType() sample.DataType

func (*Variable) GetType

func (v *Variable) GetType() NodeType

func (*Variable) GetValue

func (v *Variable) GetValue() unsafe.Pointer

func (*Variable) MarshalJSON

func (c *Variable) MarshalJSON() ([]byte, error)

func (*Variable) Simplify

func (v *Variable) Simplify() ArithmeticExpression

func (*Variable) ToList

func (v *Variable) ToList() []Expression

func (*Variable) Trivial

func (v *Variable) Trivial() bool

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL