// Code generated from Plan.g4 by ANTLR 4.13.2. DO NOT EDIT. package planparserv2 // Plan import ( "fmt" "strconv" "sync" "github.com/antlr4-go/antlr/v4" ) // Suppress unused import errors var _ = fmt.Printf var _ = strconv.Itoa var _ = sync.Once{} type PlanParser struct { *antlr.BaseParser } var PlanParserStaticData struct { once sync.Once serializedATN []int32 LiteralNames []string SymbolicNames []string RuleNames []string PredictionContextCache *antlr.PredictionContextCache atn *antlr.ATN decisionToDFA []*antlr.DFA } func planParserInit() { staticData := &PlanParserStaticData staticData.LiteralNames = []string{ "", "'('", "')'", "'['", "','", "']'", "'<'", "'<='", "'>'", "'>='", "'=='", "'!='", "", "", "", "'+'", "'-'", "'*'", "'/'", "'%'", "'**'", "'<<'", "'>>'", "'&'", "'|'", "'^'", "", "", "'~'", } staticData.SymbolicNames = []string{ "", "", "", "", "", "", "LT", "LE", "GT", "GE", "EQ", "NE", "LIKE", "EXISTS", "TEXTMATCH", "ADD", "SUB", "MUL", "DIV", "MOD", "POW", "SHL", "SHR", "BAND", "BOR", "BXOR", "AND", "OR", "BNOT", "NOT", "IN", "EmptyArray", "JSONContains", "JSONContainsAll", "JSONContainsAny", "ArrayContains", "ArrayContainsAll", "ArrayContainsAny", "ArrayLength", "BooleanConstant", "IntegerConstant", "FloatingConstant", "Identifier", "StringLiteral", "JSONIdentifier", "Whitespace", "Newline", } staticData.RuleNames = []string{ "expr", } staticData.PredictionContextCache = antlr.NewPredictionContextCache() staticData.serializedATN = []int32{ 4, 1, 46, 123, 2, 0, 7, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 5, 0, 18, 8, 0, 10, 0, 12, 0, 21, 9, 0, 1, 0, 3, 0, 24, 8, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 3, 0, 64, 8, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 3, 0, 80, 8, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 5, 0, 118, 8, 0, 10, 0, 12, 0, 121, 9, 0, 1, 0, 0, 1, 0, 1, 0, 0, 12, 2, 0, 15, 16, 28, 29, 2, 0, 32, 32, 35, 35, 2, 0, 33, 33, 36, 36, 2, 0, 34, 34, 37, 37, 2, 0, 42, 42, 44, 44, 1, 0, 17, 19, 1, 0, 15, 16, 1, 0, 21, 22, 1, 0, 6, 7, 1, 0, 8, 9, 1, 0, 6, 9, 1, 0, 10, 11, 154, 0, 63, 1, 0, 0, 0, 2, 3, 6, 0, -1, 0, 3, 64, 5, 40, 0, 0, 4, 64, 5, 41, 0, 0, 5, 64, 5, 39, 0, 0, 6, 64, 5, 43, 0, 0, 7, 64, 5, 42, 0, 0, 8, 64, 5, 44, 0, 0, 9, 10, 5, 1, 0, 0, 10, 11, 3, 0, 0, 0, 11, 12, 5, 2, 0, 0, 12, 64, 1, 0, 0, 0, 13, 14, 5, 3, 0, 0, 14, 19, 3, 0, 0, 0, 15, 16, 5, 4, 0, 0, 16, 18, 3, 0, 0, 0, 17, 15, 1, 0, 0, 0, 18, 21, 1, 0, 0, 0, 19, 17, 1, 0, 0, 0, 19, 20, 1, 0, 0, 0, 20, 23, 1, 0, 0, 0, 21, 19, 1, 0, 0, 0, 22, 24, 5, 4, 0, 0, 23, 22, 1, 0, 0, 0, 23, 24, 1, 0, 0, 0, 24, 25, 1, 0, 0, 0, 25, 26, 5, 5, 0, 0, 26, 64, 1, 0, 0, 0, 27, 64, 5, 31, 0, 0, 28, 29, 5, 14, 0, 0, 29, 30, 5, 1, 0, 0, 30, 31, 5, 42, 0, 0, 31, 32, 5, 4, 0, 0, 32, 33, 5, 43, 0, 0, 33, 64, 5, 2, 0, 0, 34, 35, 7, 0, 0, 0, 35, 64, 3, 0, 0, 19, 36, 37, 7, 1, 0, 0, 37, 38, 5, 1, 0, 0, 38, 39, 3, 0, 0, 0, 39, 40, 5, 4, 0, 0, 40, 41, 3, 0, 0, 0, 41, 42, 5, 2, 0, 0, 42, 64, 1, 0, 0, 0, 43, 44, 7, 2, 0, 0, 44, 45, 5, 1, 0, 0, 45, 46, 3, 0, 0, 0, 46, 47, 5, 4, 0, 0, 47, 48, 3, 0, 0, 0, 48, 49, 5, 2, 0, 0, 49, 64, 1, 0, 0, 0, 50, 51, 7, 3, 0, 0, 51, 52, 5, 1, 0, 0, 52, 53, 3, 0, 0, 0, 53, 54, 5, 4, 0, 0, 54, 55, 3, 0, 0, 0, 55, 56, 5, 2, 0, 0, 56, 64, 1, 0, 0, 0, 57, 58, 5, 38, 0, 0, 58, 59, 5, 1, 0, 0, 59, 60, 7, 4, 0, 0, 60, 64, 5, 2, 0, 0, 61, 62, 5, 13, 0, 0, 62, 64, 3, 0, 0, 1, 63, 2, 1, 0, 0, 0, 63, 4, 1, 0, 0, 0, 63, 5, 1, 0, 0, 0, 63, 6, 1, 0, 0, 0, 63, 7, 1, 0, 0, 0, 63, 8, 1, 0, 0, 0, 63, 9, 1, 0, 0, 0, 63, 13, 1, 0, 0, 0, 63, 27, 1, 0, 0, 0, 63, 28, 1, 0, 0, 0, 63, 34, 1, 0, 0, 0, 63, 36, 1, 0, 0, 0, 63, 43, 1, 0, 0, 0, 63, 50, 1, 0, 0, 0, 63, 57, 1, 0, 0, 0, 63, 61, 1, 0, 0, 0, 64, 119, 1, 0, 0, 0, 65, 66, 10, 20, 0, 0, 66, 67, 5, 20, 0, 0, 67, 118, 3, 0, 0, 21, 68, 69, 10, 18, 0, 0, 69, 70, 7, 5, 0, 0, 70, 118, 3, 0, 0, 19, 71, 72, 10, 17, 0, 0, 72, 73, 7, 6, 0, 0, 73, 118, 3, 0, 0, 18, 74, 75, 10, 16, 0, 0, 75, 76, 7, 7, 0, 0, 76, 118, 3, 0, 0, 17, 77, 79, 10, 15, 0, 0, 78, 80, 5, 29, 0, 0, 79, 78, 1, 0, 0, 0, 79, 80, 1, 0, 0, 0, 80, 81, 1, 0, 0, 0, 81, 82, 5, 30, 0, 0, 82, 118, 3, 0, 0, 16, 83, 84, 10, 10, 0, 0, 84, 85, 7, 8, 0, 0, 85, 86, 7, 4, 0, 0, 86, 87, 7, 8, 0, 0, 87, 118, 3, 0, 0, 11, 88, 89, 10, 9, 0, 0, 89, 90, 7, 9, 0, 0, 90, 91, 7, 4, 0, 0, 91, 92, 7, 9, 0, 0, 92, 118, 3, 0, 0, 10, 93, 94, 10, 8, 0, 0, 94, 95, 7, 10, 0, 0, 95, 118, 3, 0, 0, 9, 96, 97, 10, 7, 0, 0, 97, 98, 7, 11, 0, 0, 98, 118, 3, 0, 0, 8, 99, 100, 10, 6, 0, 0, 100, 101, 5, 23, 0, 0, 101, 118, 3, 0, 0, 7, 102, 103, 10, 5, 0, 0, 103, 104, 5, 25, 0, 0, 104, 118, 3, 0, 0, 6, 105, 106, 10, 4, 0, 0, 106, 107, 5, 24, 0, 0, 107, 118, 3, 0, 0, 5, 108, 109, 10, 3, 0, 0, 109, 110, 5, 26, 0, 0, 110, 118, 3, 0, 0, 4, 111, 112, 10, 2, 0, 0, 112, 113, 5, 27, 0, 0, 113, 118, 3, 0, 0, 3, 114, 115, 10, 22, 0, 0, 115, 116, 5, 12, 0, 0, 116, 118, 5, 43, 0, 0, 117, 65, 1, 0, 0, 0, 117, 68, 1, 0, 0, 0, 117, 71, 1, 0, 0, 0, 117, 74, 1, 0, 0, 0, 117, 77, 1, 0, 0, 0, 117, 83, 1, 0, 0, 0, 117, 88, 1, 0, 0, 0, 117, 93, 1, 0, 0, 0, 117, 96, 1, 0, 0, 0, 117, 99, 1, 0, 0, 0, 117, 102, 1, 0, 0, 0, 117, 105, 1, 0, 0, 0, 117, 108, 1, 0, 0, 0, 117, 111, 1, 0, 0, 0, 117, 114, 1, 0, 0, 0, 118, 121, 1, 0, 0, 0, 119, 117, 1, 0, 0, 0, 119, 120, 1, 0, 0, 0, 120, 1, 1, 0, 0, 0, 121, 119, 1, 0, 0, 0, 6, 19, 23, 63, 79, 117, 119, } deserializer := antlr.NewATNDeserializer(nil) staticData.atn = deserializer.Deserialize(staticData.serializedATN) atn := staticData.atn staticData.decisionToDFA = make([]*antlr.DFA, len(atn.DecisionToState)) decisionToDFA := staticData.decisionToDFA for index, state := range atn.DecisionToState { decisionToDFA[index] = antlr.NewDFA(state, index) } } // PlanParserInit initializes any static state used to implement PlanParser. By default the // static state used to implement the parser is lazily initialized during the first call to // NewPlanParser(). You can call this function if you wish to initialize the static state ahead // of time. func PlanParserInit() { staticData := &PlanParserStaticData staticData.once.Do(planParserInit) } // NewPlanParser produces a new parser instance for the optional input antlr.TokenStream. func NewPlanParser(input antlr.TokenStream) *PlanParser { PlanParserInit() this := new(PlanParser) this.BaseParser = antlr.NewBaseParser(input) staticData := &PlanParserStaticData this.Interpreter = antlr.NewParserATNSimulator(this, staticData.atn, staticData.decisionToDFA, staticData.PredictionContextCache) this.RuleNames = staticData.RuleNames this.LiteralNames = staticData.LiteralNames this.SymbolicNames = staticData.SymbolicNames this.GrammarFileName = "Plan.g4" return this } // PlanParser tokens. const ( PlanParserEOF = antlr.TokenEOF PlanParserT__0 = 1 PlanParserT__1 = 2 PlanParserT__2 = 3 PlanParserT__3 = 4 PlanParserT__4 = 5 PlanParserLT = 6 PlanParserLE = 7 PlanParserGT = 8 PlanParserGE = 9 PlanParserEQ = 10 PlanParserNE = 11 PlanParserLIKE = 12 PlanParserEXISTS = 13 PlanParserTEXTMATCH = 14 PlanParserADD = 15 PlanParserSUB = 16 PlanParserMUL = 17 PlanParserDIV = 18 PlanParserMOD = 19 PlanParserPOW = 20 PlanParserSHL = 21 PlanParserSHR = 22 PlanParserBAND = 23 PlanParserBOR = 24 PlanParserBXOR = 25 PlanParserAND = 26 PlanParserOR = 27 PlanParserBNOT = 28 PlanParserNOT = 29 PlanParserIN = 30 PlanParserEmptyArray = 31 PlanParserJSONContains = 32 PlanParserJSONContainsAll = 33 PlanParserJSONContainsAny = 34 PlanParserArrayContains = 35 PlanParserArrayContainsAll = 36 PlanParserArrayContainsAny = 37 PlanParserArrayLength = 38 PlanParserBooleanConstant = 39 PlanParserIntegerConstant = 40 PlanParserFloatingConstant = 41 PlanParserIdentifier = 42 PlanParserStringLiteral = 43 PlanParserJSONIdentifier = 44 PlanParserWhitespace = 45 PlanParserNewline = 46 ) // PlanParserRULE_expr is the PlanParser rule. const PlanParserRULE_expr = 0 // IExprContext is an interface to support dynamic dispatch. type IExprContext interface { antlr.ParserRuleContext // GetParser returns the parser. GetParser() antlr.Parser // IsExprContext differentiates from other interfaces. IsExprContext() } type ExprContext struct { antlr.BaseParserRuleContext parser antlr.Parser } func NewEmptyExprContext() *ExprContext { var p = new(ExprContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) p.RuleIndex = PlanParserRULE_expr return p } func InitEmptyExprContext(p *ExprContext) { antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) p.RuleIndex = PlanParserRULE_expr } func (*ExprContext) IsExprContext() {} func NewExprContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ExprContext { var p = new(ExprContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser p.RuleIndex = PlanParserRULE_expr return p } func (s *ExprContext) GetParser() antlr.Parser { return s.parser } func (s *ExprContext) CopyAll(ctx *ExprContext) { s.CopyFrom(&ctx.BaseParserRuleContext) } func (s *ExprContext) GetRuleContext() antlr.RuleContext { return s } func (s *ExprContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { return antlr.TreesStringTree(s, ruleNames, recog) } type JSONIdentifierContext struct { ExprContext } func NewJSONIdentifierContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *JSONIdentifierContext { var p = new(JSONIdentifierContext) InitEmptyExprContext(&p.ExprContext) p.parser = parser p.CopyAll(ctx.(*ExprContext)) return p } func (s *JSONIdentifierContext) GetRuleContext() antlr.RuleContext { return s } func (s *JSONIdentifierContext) JSONIdentifier() antlr.TerminalNode { return s.GetToken(PlanParserJSONIdentifier, 0) } func (s *JSONIdentifierContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case PlanVisitor: return t.VisitJSONIdentifier(s) default: return t.VisitChildren(s) } } type ParensContext struct { ExprContext } func NewParensContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *ParensContext { var p = new(ParensContext) InitEmptyExprContext(&p.ExprContext) p.parser = parser p.CopyAll(ctx.(*ExprContext)) return p } func (s *ParensContext) GetRuleContext() antlr.RuleContext { return s } func (s *ParensContext) Expr() IExprContext { var t antlr.RuleContext for _, ctx := range s.GetChildren() { if _, ok := ctx.(IExprContext); ok { t = ctx.(antlr.RuleContext) break } } if t == nil { return nil } return t.(IExprContext) } func (s *ParensContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case PlanVisitor: return t.VisitParens(s) default: return t.VisitChildren(s) } } type StringContext struct { ExprContext } func NewStringContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *StringContext { var p = new(StringContext) InitEmptyExprContext(&p.ExprContext) p.parser = parser p.CopyAll(ctx.(*ExprContext)) return p } func (s *StringContext) GetRuleContext() antlr.RuleContext { return s } func (s *StringContext) StringLiteral() antlr.TerminalNode { return s.GetToken(PlanParserStringLiteral, 0) } func (s *StringContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case PlanVisitor: return t.VisitString(s) default: return t.VisitChildren(s) } } type FloatingContext struct { ExprContext } func NewFloatingContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *FloatingContext { var p = new(FloatingContext) InitEmptyExprContext(&p.ExprContext) p.parser = parser p.CopyAll(ctx.(*ExprContext)) return p } func (s *FloatingContext) GetRuleContext() antlr.RuleContext { return s } func (s *FloatingContext) FloatingConstant() antlr.TerminalNode { return s.GetToken(PlanParserFloatingConstant, 0) } func (s *FloatingContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case PlanVisitor: return t.VisitFloating(s) default: return t.VisitChildren(s) } } type JSONContainsAllContext struct { ExprContext } func NewJSONContainsAllContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *JSONContainsAllContext { var p = new(JSONContainsAllContext) InitEmptyExprContext(&p.ExprContext) p.parser = parser p.CopyAll(ctx.(*ExprContext)) return p } func (s *JSONContainsAllContext) GetRuleContext() antlr.RuleContext { return s } func (s *JSONContainsAllContext) AllExpr() []IExprContext { children := s.GetChildren() len := 0 for _, ctx := range children { if _, ok := ctx.(IExprContext); ok { len++ } } tst := make([]IExprContext, len) i := 0 for _, ctx := range children { if t, ok := ctx.(IExprContext); ok { tst[i] = t.(IExprContext) i++ } } return tst } func (s *JSONContainsAllContext) Expr(i int) IExprContext { var t antlr.RuleContext j := 0 for _, ctx := range s.GetChildren() { if _, ok := ctx.(IExprContext); ok { if j == i { t = ctx.(antlr.RuleContext) break } j++ } } if t == nil { return nil } return t.(IExprContext) } func (s *JSONContainsAllContext) JSONContainsAll() antlr.TerminalNode { return s.GetToken(PlanParserJSONContainsAll, 0) } func (s *JSONContainsAllContext) ArrayContainsAll() antlr.TerminalNode { return s.GetToken(PlanParserArrayContainsAll, 0) } func (s *JSONContainsAllContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case PlanVisitor: return t.VisitJSONContainsAll(s) default: return t.VisitChildren(s) } } type LogicalOrContext struct { ExprContext } func NewLogicalOrContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *LogicalOrContext { var p = new(LogicalOrContext) InitEmptyExprContext(&p.ExprContext) p.parser = parser p.CopyAll(ctx.(*ExprContext)) return p } func (s *LogicalOrContext) GetRuleContext() antlr.RuleContext { return s } func (s *LogicalOrContext) AllExpr() []IExprContext { children := s.GetChildren() len := 0 for _, ctx := range children { if _, ok := ctx.(IExprContext); ok { len++ } } tst := make([]IExprContext, len) i := 0 for _, ctx := range children { if t, ok := ctx.(IExprContext); ok { tst[i] = t.(IExprContext) i++ } } return tst } func (s *LogicalOrContext) Expr(i int) IExprContext { var t antlr.RuleContext j := 0 for _, ctx := range s.GetChildren() { if _, ok := ctx.(IExprContext); ok { if j == i { t = ctx.(antlr.RuleContext) break } j++ } } if t == nil { return nil } return t.(IExprContext) } func (s *LogicalOrContext) OR() antlr.TerminalNode { return s.GetToken(PlanParserOR, 0) } func (s *LogicalOrContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case PlanVisitor: return t.VisitLogicalOr(s) default: return t.VisitChildren(s) } } type MulDivModContext struct { ExprContext op antlr.Token } func NewMulDivModContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *MulDivModContext { var p = new(MulDivModContext) InitEmptyExprContext(&p.ExprContext) p.parser = parser p.CopyAll(ctx.(*ExprContext)) return p } func (s *MulDivModContext) GetOp() antlr.Token { return s.op } func (s *MulDivModContext) SetOp(v antlr.Token) { s.op = v } func (s *MulDivModContext) GetRuleContext() antlr.RuleContext { return s } func (s *MulDivModContext) AllExpr() []IExprContext { children := s.GetChildren() len := 0 for _, ctx := range children { if _, ok := ctx.(IExprContext); ok { len++ } } tst := make([]IExprContext, len) i := 0 for _, ctx := range children { if t, ok := ctx.(IExprContext); ok { tst[i] = t.(IExprContext) i++ } } return tst } func (s *MulDivModContext) Expr(i int) IExprContext { var t antlr.RuleContext j := 0 for _, ctx := range s.GetChildren() { if _, ok := ctx.(IExprContext); ok { if j == i { t = ctx.(antlr.RuleContext) break } j++ } } if t == nil { return nil } return t.(IExprContext) } func (s *MulDivModContext) MUL() antlr.TerminalNode { return s.GetToken(PlanParserMUL, 0) } func (s *MulDivModContext) DIV() antlr.TerminalNode { return s.GetToken(PlanParserDIV, 0) } func (s *MulDivModContext) MOD() antlr.TerminalNode { return s.GetToken(PlanParserMOD, 0) } func (s *MulDivModContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case PlanVisitor: return t.VisitMulDivMod(s) default: return t.VisitChildren(s) } } type IdentifierContext struct { ExprContext } func NewIdentifierContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *IdentifierContext { var p = new(IdentifierContext) InitEmptyExprContext(&p.ExprContext) p.parser = parser p.CopyAll(ctx.(*ExprContext)) return p } func (s *IdentifierContext) GetRuleContext() antlr.RuleContext { return s } func (s *IdentifierContext) Identifier() antlr.TerminalNode { return s.GetToken(PlanParserIdentifier, 0) } func (s *IdentifierContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case PlanVisitor: return t.VisitIdentifier(s) default: return t.VisitChildren(s) } } type LikeContext struct { ExprContext } func NewLikeContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *LikeContext { var p = new(LikeContext) InitEmptyExprContext(&p.ExprContext) p.parser = parser p.CopyAll(ctx.(*ExprContext)) return p } func (s *LikeContext) GetRuleContext() antlr.RuleContext { return s } func (s *LikeContext) Expr() IExprContext { var t antlr.RuleContext for _, ctx := range s.GetChildren() { if _, ok := ctx.(IExprContext); ok { t = ctx.(antlr.RuleContext) break } } if t == nil { return nil } return t.(IExprContext) } func (s *LikeContext) LIKE() antlr.TerminalNode { return s.GetToken(PlanParserLIKE, 0) } func (s *LikeContext) StringLiteral() antlr.TerminalNode { return s.GetToken(PlanParserStringLiteral, 0) } func (s *LikeContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case PlanVisitor: return t.VisitLike(s) default: return t.VisitChildren(s) } } type LogicalAndContext struct { ExprContext } func NewLogicalAndContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *LogicalAndContext { var p = new(LogicalAndContext) InitEmptyExprContext(&p.ExprContext) p.parser = parser p.CopyAll(ctx.(*ExprContext)) return p } func (s *LogicalAndContext) GetRuleContext() antlr.RuleContext { return s } func (s *LogicalAndContext) AllExpr() []IExprContext { children := s.GetChildren() len := 0 for _, ctx := range children { if _, ok := ctx.(IExprContext); ok { len++ } } tst := make([]IExprContext, len) i := 0 for _, ctx := range children { if t, ok := ctx.(IExprContext); ok { tst[i] = t.(IExprContext) i++ } } return tst } func (s *LogicalAndContext) Expr(i int) IExprContext { var t antlr.RuleContext j := 0 for _, ctx := range s.GetChildren() { if _, ok := ctx.(IExprContext); ok { if j == i { t = ctx.(antlr.RuleContext) break } j++ } } if t == nil { return nil } return t.(IExprContext) } func (s *LogicalAndContext) AND() antlr.TerminalNode { return s.GetToken(PlanParserAND, 0) } func (s *LogicalAndContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case PlanVisitor: return t.VisitLogicalAnd(s) default: return t.VisitChildren(s) } } type EqualityContext struct { ExprContext op antlr.Token } func NewEqualityContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *EqualityContext { var p = new(EqualityContext) InitEmptyExprContext(&p.ExprContext) p.parser = parser p.CopyAll(ctx.(*ExprContext)) return p } func (s *EqualityContext) GetOp() antlr.Token { return s.op } func (s *EqualityContext) SetOp(v antlr.Token) { s.op = v } func (s *EqualityContext) GetRuleContext() antlr.RuleContext { return s } func (s *EqualityContext) AllExpr() []IExprContext { children := s.GetChildren() len := 0 for _, ctx := range children { if _, ok := ctx.(IExprContext); ok { len++ } } tst := make([]IExprContext, len) i := 0 for _, ctx := range children { if t, ok := ctx.(IExprContext); ok { tst[i] = t.(IExprContext) i++ } } return tst } func (s *EqualityContext) Expr(i int) IExprContext { var t antlr.RuleContext j := 0 for _, ctx := range s.GetChildren() { if _, ok := ctx.(IExprContext); ok { if j == i { t = ctx.(antlr.RuleContext) break } j++ } } if t == nil { return nil } return t.(IExprContext) } func (s *EqualityContext) EQ() antlr.TerminalNode { return s.GetToken(PlanParserEQ, 0) } func (s *EqualityContext) NE() antlr.TerminalNode { return s.GetToken(PlanParserNE, 0) } func (s *EqualityContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case PlanVisitor: return t.VisitEquality(s) default: return t.VisitChildren(s) } } type BooleanContext struct { ExprContext } func NewBooleanContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *BooleanContext { var p = new(BooleanContext) InitEmptyExprContext(&p.ExprContext) p.parser = parser p.CopyAll(ctx.(*ExprContext)) return p } func (s *BooleanContext) GetRuleContext() antlr.RuleContext { return s } func (s *BooleanContext) BooleanConstant() antlr.TerminalNode { return s.GetToken(PlanParserBooleanConstant, 0) } func (s *BooleanContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case PlanVisitor: return t.VisitBoolean(s) default: return t.VisitChildren(s) } } type ShiftContext struct { ExprContext op antlr.Token } func NewShiftContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *ShiftContext { var p = new(ShiftContext) InitEmptyExprContext(&p.ExprContext) p.parser = parser p.CopyAll(ctx.(*ExprContext)) return p } func (s *ShiftContext) GetOp() antlr.Token { return s.op } func (s *ShiftContext) SetOp(v antlr.Token) { s.op = v } func (s *ShiftContext) GetRuleContext() antlr.RuleContext { return s } func (s *ShiftContext) AllExpr() []IExprContext { children := s.GetChildren() len := 0 for _, ctx := range children { if _, ok := ctx.(IExprContext); ok { len++ } } tst := make([]IExprContext, len) i := 0 for _, ctx := range children { if t, ok := ctx.(IExprContext); ok { tst[i] = t.(IExprContext) i++ } } return tst } func (s *ShiftContext) Expr(i int) IExprContext { var t antlr.RuleContext j := 0 for _, ctx := range s.GetChildren() { if _, ok := ctx.(IExprContext); ok { if j == i { t = ctx.(antlr.RuleContext) break } j++ } } if t == nil { return nil } return t.(IExprContext) } func (s *ShiftContext) SHL() antlr.TerminalNode { return s.GetToken(PlanParserSHL, 0) } func (s *ShiftContext) SHR() antlr.TerminalNode { return s.GetToken(PlanParserSHR, 0) } func (s *ShiftContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case PlanVisitor: return t.VisitShift(s) default: return t.VisitChildren(s) } } type ReverseRangeContext struct { ExprContext op1 antlr.Token op2 antlr.Token } func NewReverseRangeContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *ReverseRangeContext { var p = new(ReverseRangeContext) InitEmptyExprContext(&p.ExprContext) p.parser = parser p.CopyAll(ctx.(*ExprContext)) return p } func (s *ReverseRangeContext) GetOp1() antlr.Token { return s.op1 } func (s *ReverseRangeContext) GetOp2() antlr.Token { return s.op2 } func (s *ReverseRangeContext) SetOp1(v antlr.Token) { s.op1 = v } func (s *ReverseRangeContext) SetOp2(v antlr.Token) { s.op2 = v } func (s *ReverseRangeContext) GetRuleContext() antlr.RuleContext { return s } func (s *ReverseRangeContext) AllExpr() []IExprContext { children := s.GetChildren() len := 0 for _, ctx := range children { if _, ok := ctx.(IExprContext); ok { len++ } } tst := make([]IExprContext, len) i := 0 for _, ctx := range children { if t, ok := ctx.(IExprContext); ok { tst[i] = t.(IExprContext) i++ } } return tst } func (s *ReverseRangeContext) Expr(i int) IExprContext { var t antlr.RuleContext j := 0 for _, ctx := range s.GetChildren() { if _, ok := ctx.(IExprContext); ok { if j == i { t = ctx.(antlr.RuleContext) break } j++ } } if t == nil { return nil } return t.(IExprContext) } func (s *ReverseRangeContext) Identifier() antlr.TerminalNode { return s.GetToken(PlanParserIdentifier, 0) } func (s *ReverseRangeContext) JSONIdentifier() antlr.TerminalNode { return s.GetToken(PlanParserJSONIdentifier, 0) } func (s *ReverseRangeContext) AllGT() []antlr.TerminalNode { return s.GetTokens(PlanParserGT) } func (s *ReverseRangeContext) GT(i int) antlr.TerminalNode { return s.GetToken(PlanParserGT, i) } func (s *ReverseRangeContext) AllGE() []antlr.TerminalNode { return s.GetTokens(PlanParserGE) } func (s *ReverseRangeContext) GE(i int) antlr.TerminalNode { return s.GetToken(PlanParserGE, i) } func (s *ReverseRangeContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case PlanVisitor: return t.VisitReverseRange(s) default: return t.VisitChildren(s) } } type BitOrContext struct { ExprContext } func NewBitOrContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *BitOrContext { var p = new(BitOrContext) InitEmptyExprContext(&p.ExprContext) p.parser = parser p.CopyAll(ctx.(*ExprContext)) return p } func (s *BitOrContext) GetRuleContext() antlr.RuleContext { return s } func (s *BitOrContext) AllExpr() []IExprContext { children := s.GetChildren() len := 0 for _, ctx := range children { if _, ok := ctx.(IExprContext); ok { len++ } } tst := make([]IExprContext, len) i := 0 for _, ctx := range children { if t, ok := ctx.(IExprContext); ok { tst[i] = t.(IExprContext) i++ } } return tst } func (s *BitOrContext) Expr(i int) IExprContext { var t antlr.RuleContext j := 0 for _, ctx := range s.GetChildren() { if _, ok := ctx.(IExprContext); ok { if j == i { t = ctx.(antlr.RuleContext) break } j++ } } if t == nil { return nil } return t.(IExprContext) } func (s *BitOrContext) BOR() antlr.TerminalNode { return s.GetToken(PlanParserBOR, 0) } func (s *BitOrContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case PlanVisitor: return t.VisitBitOr(s) default: return t.VisitChildren(s) } } type EmptyArrayContext struct { ExprContext } func NewEmptyArrayContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *EmptyArrayContext { var p = new(EmptyArrayContext) InitEmptyExprContext(&p.ExprContext) p.parser = parser p.CopyAll(ctx.(*ExprContext)) return p } func (s *EmptyArrayContext) GetRuleContext() antlr.RuleContext { return s } func (s *EmptyArrayContext) EmptyArray() antlr.TerminalNode { return s.GetToken(PlanParserEmptyArray, 0) } func (s *EmptyArrayContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case PlanVisitor: return t.VisitEmptyArray(s) default: return t.VisitChildren(s) } } type AddSubContext struct { ExprContext op antlr.Token } func NewAddSubContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *AddSubContext { var p = new(AddSubContext) InitEmptyExprContext(&p.ExprContext) p.parser = parser p.CopyAll(ctx.(*ExprContext)) return p } func (s *AddSubContext) GetOp() antlr.Token { return s.op } func (s *AddSubContext) SetOp(v antlr.Token) { s.op = v } func (s *AddSubContext) GetRuleContext() antlr.RuleContext { return s } func (s *AddSubContext) AllExpr() []IExprContext { children := s.GetChildren() len := 0 for _, ctx := range children { if _, ok := ctx.(IExprContext); ok { len++ } } tst := make([]IExprContext, len) i := 0 for _, ctx := range children { if t, ok := ctx.(IExprContext); ok { tst[i] = t.(IExprContext) i++ } } return tst } func (s *AddSubContext) Expr(i int) IExprContext { var t antlr.RuleContext j := 0 for _, ctx := range s.GetChildren() { if _, ok := ctx.(IExprContext); ok { if j == i { t = ctx.(antlr.RuleContext) break } j++ } } if t == nil { return nil } return t.(IExprContext) } func (s *AddSubContext) ADD() antlr.TerminalNode { return s.GetToken(PlanParserADD, 0) } func (s *AddSubContext) SUB() antlr.TerminalNode { return s.GetToken(PlanParserSUB, 0) } func (s *AddSubContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case PlanVisitor: return t.VisitAddSub(s) default: return t.VisitChildren(s) } } type RelationalContext struct { ExprContext op antlr.Token } func NewRelationalContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *RelationalContext { var p = new(RelationalContext) InitEmptyExprContext(&p.ExprContext) p.parser = parser p.CopyAll(ctx.(*ExprContext)) return p } func (s *RelationalContext) GetOp() antlr.Token { return s.op } func (s *RelationalContext) SetOp(v antlr.Token) { s.op = v } func (s *RelationalContext) GetRuleContext() antlr.RuleContext { return s } func (s *RelationalContext) AllExpr() []IExprContext { children := s.GetChildren() len := 0 for _, ctx := range children { if _, ok := ctx.(IExprContext); ok { len++ } } tst := make([]IExprContext, len) i := 0 for _, ctx := range children { if t, ok := ctx.(IExprContext); ok { tst[i] = t.(IExprContext) i++ } } return tst } func (s *RelationalContext) Expr(i int) IExprContext { var t antlr.RuleContext j := 0 for _, ctx := range s.GetChildren() { if _, ok := ctx.(IExprContext); ok { if j == i { t = ctx.(antlr.RuleContext) break } j++ } } if t == nil { return nil } return t.(IExprContext) } func (s *RelationalContext) LT() antlr.TerminalNode { return s.GetToken(PlanParserLT, 0) } func (s *RelationalContext) LE() antlr.TerminalNode { return s.GetToken(PlanParserLE, 0) } func (s *RelationalContext) GT() antlr.TerminalNode { return s.GetToken(PlanParserGT, 0) } func (s *RelationalContext) GE() antlr.TerminalNode { return s.GetToken(PlanParserGE, 0) } func (s *RelationalContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case PlanVisitor: return t.VisitRelational(s) default: return t.VisitChildren(s) } } type ArrayLengthContext struct { ExprContext } func NewArrayLengthContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *ArrayLengthContext { var p = new(ArrayLengthContext) InitEmptyExprContext(&p.ExprContext) p.parser = parser p.CopyAll(ctx.(*ExprContext)) return p } func (s *ArrayLengthContext) GetRuleContext() antlr.RuleContext { return s } func (s *ArrayLengthContext) ArrayLength() antlr.TerminalNode { return s.GetToken(PlanParserArrayLength, 0) } func (s *ArrayLengthContext) Identifier() antlr.TerminalNode { return s.GetToken(PlanParserIdentifier, 0) } func (s *ArrayLengthContext) JSONIdentifier() antlr.TerminalNode { return s.GetToken(PlanParserJSONIdentifier, 0) } func (s *ArrayLengthContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case PlanVisitor: return t.VisitArrayLength(s) default: return t.VisitChildren(s) } } type TextMatchContext struct { ExprContext } func NewTextMatchContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *TextMatchContext { var p = new(TextMatchContext) InitEmptyExprContext(&p.ExprContext) p.parser = parser p.CopyAll(ctx.(*ExprContext)) return p } func (s *TextMatchContext) GetRuleContext() antlr.RuleContext { return s } func (s *TextMatchContext) TEXTMATCH() antlr.TerminalNode { return s.GetToken(PlanParserTEXTMATCH, 0) } func (s *TextMatchContext) Identifier() antlr.TerminalNode { return s.GetToken(PlanParserIdentifier, 0) } func (s *TextMatchContext) StringLiteral() antlr.TerminalNode { return s.GetToken(PlanParserStringLiteral, 0) } func (s *TextMatchContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case PlanVisitor: return t.VisitTextMatch(s) default: return t.VisitChildren(s) } } type TermContext struct { ExprContext op antlr.Token } func NewTermContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *TermContext { var p = new(TermContext) InitEmptyExprContext(&p.ExprContext) p.parser = parser p.CopyAll(ctx.(*ExprContext)) return p } func (s *TermContext) GetOp() antlr.Token { return s.op } func (s *TermContext) SetOp(v antlr.Token) { s.op = v } func (s *TermContext) GetRuleContext() antlr.RuleContext { return s } func (s *TermContext) AllExpr() []IExprContext { children := s.GetChildren() len := 0 for _, ctx := range children { if _, ok := ctx.(IExprContext); ok { len++ } } tst := make([]IExprContext, len) i := 0 for _, ctx := range children { if t, ok := ctx.(IExprContext); ok { tst[i] = t.(IExprContext) i++ } } return tst } func (s *TermContext) Expr(i int) IExprContext { var t antlr.RuleContext j := 0 for _, ctx := range s.GetChildren() { if _, ok := ctx.(IExprContext); ok { if j == i { t = ctx.(antlr.RuleContext) break } j++ } } if t == nil { return nil } return t.(IExprContext) } func (s *TermContext) IN() antlr.TerminalNode { return s.GetToken(PlanParserIN, 0) } func (s *TermContext) NOT() antlr.TerminalNode { return s.GetToken(PlanParserNOT, 0) } func (s *TermContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case PlanVisitor: return t.VisitTerm(s) default: return t.VisitChildren(s) } } type JSONContainsContext struct { ExprContext } func NewJSONContainsContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *JSONContainsContext { var p = new(JSONContainsContext) InitEmptyExprContext(&p.ExprContext) p.parser = parser p.CopyAll(ctx.(*ExprContext)) return p } func (s *JSONContainsContext) GetRuleContext() antlr.RuleContext { return s } func (s *JSONContainsContext) AllExpr() []IExprContext { children := s.GetChildren() len := 0 for _, ctx := range children { if _, ok := ctx.(IExprContext); ok { len++ } } tst := make([]IExprContext, len) i := 0 for _, ctx := range children { if t, ok := ctx.(IExprContext); ok { tst[i] = t.(IExprContext) i++ } } return tst } func (s *JSONContainsContext) Expr(i int) IExprContext { var t antlr.RuleContext j := 0 for _, ctx := range s.GetChildren() { if _, ok := ctx.(IExprContext); ok { if j == i { t = ctx.(antlr.RuleContext) break } j++ } } if t == nil { return nil } return t.(IExprContext) } func (s *JSONContainsContext) JSONContains() antlr.TerminalNode { return s.GetToken(PlanParserJSONContains, 0) } func (s *JSONContainsContext) ArrayContains() antlr.TerminalNode { return s.GetToken(PlanParserArrayContains, 0) } func (s *JSONContainsContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case PlanVisitor: return t.VisitJSONContains(s) default: return t.VisitChildren(s) } } type RangeContext struct { ExprContext op1 antlr.Token op2 antlr.Token } func NewRangeContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *RangeContext { var p = new(RangeContext) InitEmptyExprContext(&p.ExprContext) p.parser = parser p.CopyAll(ctx.(*ExprContext)) return p } func (s *RangeContext) GetOp1() antlr.Token { return s.op1 } func (s *RangeContext) GetOp2() antlr.Token { return s.op2 } func (s *RangeContext) SetOp1(v antlr.Token) { s.op1 = v } func (s *RangeContext) SetOp2(v antlr.Token) { s.op2 = v } func (s *RangeContext) GetRuleContext() antlr.RuleContext { return s } func (s *RangeContext) AllExpr() []IExprContext { children := s.GetChildren() len := 0 for _, ctx := range children { if _, ok := ctx.(IExprContext); ok { len++ } } tst := make([]IExprContext, len) i := 0 for _, ctx := range children { if t, ok := ctx.(IExprContext); ok { tst[i] = t.(IExprContext) i++ } } return tst } func (s *RangeContext) Expr(i int) IExprContext { var t antlr.RuleContext j := 0 for _, ctx := range s.GetChildren() { if _, ok := ctx.(IExprContext); ok { if j == i { t = ctx.(antlr.RuleContext) break } j++ } } if t == nil { return nil } return t.(IExprContext) } func (s *RangeContext) Identifier() antlr.TerminalNode { return s.GetToken(PlanParserIdentifier, 0) } func (s *RangeContext) JSONIdentifier() antlr.TerminalNode { return s.GetToken(PlanParserJSONIdentifier, 0) } func (s *RangeContext) AllLT() []antlr.TerminalNode { return s.GetTokens(PlanParserLT) } func (s *RangeContext) LT(i int) antlr.TerminalNode { return s.GetToken(PlanParserLT, i) } func (s *RangeContext) AllLE() []antlr.TerminalNode { return s.GetTokens(PlanParserLE) } func (s *RangeContext) LE(i int) antlr.TerminalNode { return s.GetToken(PlanParserLE, i) } func (s *RangeContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case PlanVisitor: return t.VisitRange(s) default: return t.VisitChildren(s) } } type UnaryContext struct { ExprContext op antlr.Token } func NewUnaryContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *UnaryContext { var p = new(UnaryContext) InitEmptyExprContext(&p.ExprContext) p.parser = parser p.CopyAll(ctx.(*ExprContext)) return p } func (s *UnaryContext) GetOp() antlr.Token { return s.op } func (s *UnaryContext) SetOp(v antlr.Token) { s.op = v } func (s *UnaryContext) GetRuleContext() antlr.RuleContext { return s } func (s *UnaryContext) Expr() IExprContext { var t antlr.RuleContext for _, ctx := range s.GetChildren() { if _, ok := ctx.(IExprContext); ok { t = ctx.(antlr.RuleContext) break } } if t == nil { return nil } return t.(IExprContext) } func (s *UnaryContext) ADD() antlr.TerminalNode { return s.GetToken(PlanParserADD, 0) } func (s *UnaryContext) SUB() antlr.TerminalNode { return s.GetToken(PlanParserSUB, 0) } func (s *UnaryContext) BNOT() antlr.TerminalNode { return s.GetToken(PlanParserBNOT, 0) } func (s *UnaryContext) NOT() antlr.TerminalNode { return s.GetToken(PlanParserNOT, 0) } func (s *UnaryContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case PlanVisitor: return t.VisitUnary(s) default: return t.VisitChildren(s) } } type IntegerContext struct { ExprContext } func NewIntegerContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *IntegerContext { var p = new(IntegerContext) InitEmptyExprContext(&p.ExprContext) p.parser = parser p.CopyAll(ctx.(*ExprContext)) return p } func (s *IntegerContext) GetRuleContext() antlr.RuleContext { return s } func (s *IntegerContext) IntegerConstant() antlr.TerminalNode { return s.GetToken(PlanParserIntegerConstant, 0) } func (s *IntegerContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case PlanVisitor: return t.VisitInteger(s) default: return t.VisitChildren(s) } } type ArrayContext struct { ExprContext } func NewArrayContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *ArrayContext { var p = new(ArrayContext) InitEmptyExprContext(&p.ExprContext) p.parser = parser p.CopyAll(ctx.(*ExprContext)) return p } func (s *ArrayContext) GetRuleContext() antlr.RuleContext { return s } func (s *ArrayContext) AllExpr() []IExprContext { children := s.GetChildren() len := 0 for _, ctx := range children { if _, ok := ctx.(IExprContext); ok { len++ } } tst := make([]IExprContext, len) i := 0 for _, ctx := range children { if t, ok := ctx.(IExprContext); ok { tst[i] = t.(IExprContext) i++ } } return tst } func (s *ArrayContext) Expr(i int) IExprContext { var t antlr.RuleContext j := 0 for _, ctx := range s.GetChildren() { if _, ok := ctx.(IExprContext); ok { if j == i { t = ctx.(antlr.RuleContext) break } j++ } } if t == nil { return nil } return t.(IExprContext) } func (s *ArrayContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case PlanVisitor: return t.VisitArray(s) default: return t.VisitChildren(s) } } type JSONContainsAnyContext struct { ExprContext } func NewJSONContainsAnyContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *JSONContainsAnyContext { var p = new(JSONContainsAnyContext) InitEmptyExprContext(&p.ExprContext) p.parser = parser p.CopyAll(ctx.(*ExprContext)) return p } func (s *JSONContainsAnyContext) GetRuleContext() antlr.RuleContext { return s } func (s *JSONContainsAnyContext) AllExpr() []IExprContext { children := s.GetChildren() len := 0 for _, ctx := range children { if _, ok := ctx.(IExprContext); ok { len++ } } tst := make([]IExprContext, len) i := 0 for _, ctx := range children { if t, ok := ctx.(IExprContext); ok { tst[i] = t.(IExprContext) i++ } } return tst } func (s *JSONContainsAnyContext) Expr(i int) IExprContext { var t antlr.RuleContext j := 0 for _, ctx := range s.GetChildren() { if _, ok := ctx.(IExprContext); ok { if j == i { t = ctx.(antlr.RuleContext) break } j++ } } if t == nil { return nil } return t.(IExprContext) } func (s *JSONContainsAnyContext) JSONContainsAny() antlr.TerminalNode { return s.GetToken(PlanParserJSONContainsAny, 0) } func (s *JSONContainsAnyContext) ArrayContainsAny() antlr.TerminalNode { return s.GetToken(PlanParserArrayContainsAny, 0) } func (s *JSONContainsAnyContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case PlanVisitor: return t.VisitJSONContainsAny(s) default: return t.VisitChildren(s) } } type BitXorContext struct { ExprContext } func NewBitXorContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *BitXorContext { var p = new(BitXorContext) InitEmptyExprContext(&p.ExprContext) p.parser = parser p.CopyAll(ctx.(*ExprContext)) return p } func (s *BitXorContext) GetRuleContext() antlr.RuleContext { return s } func (s *BitXorContext) AllExpr() []IExprContext { children := s.GetChildren() len := 0 for _, ctx := range children { if _, ok := ctx.(IExprContext); ok { len++ } } tst := make([]IExprContext, len) i := 0 for _, ctx := range children { if t, ok := ctx.(IExprContext); ok { tst[i] = t.(IExprContext) i++ } } return tst } func (s *BitXorContext) Expr(i int) IExprContext { var t antlr.RuleContext j := 0 for _, ctx := range s.GetChildren() { if _, ok := ctx.(IExprContext); ok { if j == i { t = ctx.(antlr.RuleContext) break } j++ } } if t == nil { return nil } return t.(IExprContext) } func (s *BitXorContext) BXOR() antlr.TerminalNode { return s.GetToken(PlanParserBXOR, 0) } func (s *BitXorContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case PlanVisitor: return t.VisitBitXor(s) default: return t.VisitChildren(s) } } type ExistsContext struct { ExprContext } func NewExistsContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *ExistsContext { var p = new(ExistsContext) InitEmptyExprContext(&p.ExprContext) p.parser = parser p.CopyAll(ctx.(*ExprContext)) return p } func (s *ExistsContext) GetRuleContext() antlr.RuleContext { return s } func (s *ExistsContext) EXISTS() antlr.TerminalNode { return s.GetToken(PlanParserEXISTS, 0) } func (s *ExistsContext) Expr() IExprContext { var t antlr.RuleContext for _, ctx := range s.GetChildren() { if _, ok := ctx.(IExprContext); ok { t = ctx.(antlr.RuleContext) break } } if t == nil { return nil } return t.(IExprContext) } func (s *ExistsContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case PlanVisitor: return t.VisitExists(s) default: return t.VisitChildren(s) } } type BitAndContext struct { ExprContext } func NewBitAndContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *BitAndContext { var p = new(BitAndContext) InitEmptyExprContext(&p.ExprContext) p.parser = parser p.CopyAll(ctx.(*ExprContext)) return p } func (s *BitAndContext) GetRuleContext() antlr.RuleContext { return s } func (s *BitAndContext) AllExpr() []IExprContext { children := s.GetChildren() len := 0 for _, ctx := range children { if _, ok := ctx.(IExprContext); ok { len++ } } tst := make([]IExprContext, len) i := 0 for _, ctx := range children { if t, ok := ctx.(IExprContext); ok { tst[i] = t.(IExprContext) i++ } } return tst } func (s *BitAndContext) Expr(i int) IExprContext { var t antlr.RuleContext j := 0 for _, ctx := range s.GetChildren() { if _, ok := ctx.(IExprContext); ok { if j == i { t = ctx.(antlr.RuleContext) break } j++ } } if t == nil { return nil } return t.(IExprContext) } func (s *BitAndContext) BAND() antlr.TerminalNode { return s.GetToken(PlanParserBAND, 0) } func (s *BitAndContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case PlanVisitor: return t.VisitBitAnd(s) default: return t.VisitChildren(s) } } type PowerContext struct { ExprContext } func NewPowerContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *PowerContext { var p = new(PowerContext) InitEmptyExprContext(&p.ExprContext) p.parser = parser p.CopyAll(ctx.(*ExprContext)) return p } func (s *PowerContext) GetRuleContext() antlr.RuleContext { return s } func (s *PowerContext) AllExpr() []IExprContext { children := s.GetChildren() len := 0 for _, ctx := range children { if _, ok := ctx.(IExprContext); ok { len++ } } tst := make([]IExprContext, len) i := 0 for _, ctx := range children { if t, ok := ctx.(IExprContext); ok { tst[i] = t.(IExprContext) i++ } } return tst } func (s *PowerContext) Expr(i int) IExprContext { var t antlr.RuleContext j := 0 for _, ctx := range s.GetChildren() { if _, ok := ctx.(IExprContext); ok { if j == i { t = ctx.(antlr.RuleContext) break } j++ } } if t == nil { return nil } return t.(IExprContext) } func (s *PowerContext) POW() antlr.TerminalNode { return s.GetToken(PlanParserPOW, 0) } func (s *PowerContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case PlanVisitor: return t.VisitPower(s) default: return t.VisitChildren(s) } } func (p *PlanParser) Expr() (localctx IExprContext) { return p.expr(0) } func (p *PlanParser) expr(_p int) (localctx IExprContext) { var _parentctx antlr.ParserRuleContext = p.GetParserRuleContext() _parentState := p.GetState() localctx = NewExprContext(p, p.GetParserRuleContext(), _parentState) var _prevctx IExprContext = localctx var _ antlr.ParserRuleContext = _prevctx // TODO: To prevent unused variable warning. _startState := 0 p.EnterRecursionRule(localctx, 0, PlanParserRULE_expr, _p) var _la int var _alt int p.EnterOuterAlt(localctx, 1) p.SetState(63) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } switch p.GetTokenStream().LA(1) { case PlanParserIntegerConstant: localctx = NewIntegerContext(p, localctx) p.SetParserRuleContext(localctx) _prevctx = localctx { p.SetState(3) p.Match(PlanParserIntegerConstant) if p.HasError() { // Recognition error - abort rule goto errorExit } } case PlanParserFloatingConstant: localctx = NewFloatingContext(p, localctx) p.SetParserRuleContext(localctx) _prevctx = localctx { p.SetState(4) p.Match(PlanParserFloatingConstant) if p.HasError() { // Recognition error - abort rule goto errorExit } } case PlanParserBooleanConstant: localctx = NewBooleanContext(p, localctx) p.SetParserRuleContext(localctx) _prevctx = localctx { p.SetState(5) p.Match(PlanParserBooleanConstant) if p.HasError() { // Recognition error - abort rule goto errorExit } } case PlanParserStringLiteral: localctx = NewStringContext(p, localctx) p.SetParserRuleContext(localctx) _prevctx = localctx { p.SetState(6) p.Match(PlanParserStringLiteral) if p.HasError() { // Recognition error - abort rule goto errorExit } } case PlanParserIdentifier: localctx = NewIdentifierContext(p, localctx) p.SetParserRuleContext(localctx) _prevctx = localctx { p.SetState(7) p.Match(PlanParserIdentifier) if p.HasError() { // Recognition error - abort rule goto errorExit } } case PlanParserJSONIdentifier: localctx = NewJSONIdentifierContext(p, localctx) p.SetParserRuleContext(localctx) _prevctx = localctx { p.SetState(8) p.Match(PlanParserJSONIdentifier) if p.HasError() { // Recognition error - abort rule goto errorExit } } case PlanParserT__0: localctx = NewParensContext(p, localctx) p.SetParserRuleContext(localctx) _prevctx = localctx { p.SetState(9) p.Match(PlanParserT__0) if p.HasError() { // Recognition error - abort rule goto errorExit } } { p.SetState(10) p.expr(0) } { p.SetState(11) p.Match(PlanParserT__1) if p.HasError() { // Recognition error - abort rule goto errorExit } } case PlanParserT__2: localctx = NewArrayContext(p, localctx) p.SetParserRuleContext(localctx) _prevctx = localctx { p.SetState(13) p.Match(PlanParserT__2) if p.HasError() { // Recognition error - abort rule goto errorExit } } { p.SetState(14) p.expr(0) } p.SetState(19) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 0, p.GetParserRuleContext()) if p.HasError() { goto errorExit } for _alt != 2 && _alt != antlr.ATNInvalidAltNumber { if _alt == 1 { { p.SetState(15) p.Match(PlanParserT__3) if p.HasError() { // Recognition error - abort rule goto errorExit } } { p.SetState(16) p.expr(0) } } p.SetState(21) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 0, p.GetParserRuleContext()) if p.HasError() { goto errorExit } } p.SetState(23) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } _la = p.GetTokenStream().LA(1) if _la == PlanParserT__3 { { p.SetState(22) p.Match(PlanParserT__3) if p.HasError() { // Recognition error - abort rule goto errorExit } } } { p.SetState(25) p.Match(PlanParserT__4) if p.HasError() { // Recognition error - abort rule goto errorExit } } case PlanParserEmptyArray: localctx = NewEmptyArrayContext(p, localctx) p.SetParserRuleContext(localctx) _prevctx = localctx { p.SetState(27) p.Match(PlanParserEmptyArray) if p.HasError() { // Recognition error - abort rule goto errorExit } } case PlanParserTEXTMATCH: localctx = NewTextMatchContext(p, localctx) p.SetParserRuleContext(localctx) _prevctx = localctx { p.SetState(28) p.Match(PlanParserTEXTMATCH) if p.HasError() { // Recognition error - abort rule goto errorExit } } { p.SetState(29) p.Match(PlanParserT__0) if p.HasError() { // Recognition error - abort rule goto errorExit } } { p.SetState(30) p.Match(PlanParserIdentifier) if p.HasError() { // Recognition error - abort rule goto errorExit } } { p.SetState(31) p.Match(PlanParserT__3) if p.HasError() { // Recognition error - abort rule goto errorExit } } { p.SetState(32) p.Match(PlanParserStringLiteral) if p.HasError() { // Recognition error - abort rule goto errorExit } } { p.SetState(33) p.Match(PlanParserT__1) if p.HasError() { // Recognition error - abort rule goto errorExit } } case PlanParserADD, PlanParserSUB, PlanParserBNOT, PlanParserNOT: localctx = NewUnaryContext(p, localctx) p.SetParserRuleContext(localctx) _prevctx = localctx { p.SetState(34) var _lt = p.GetTokenStream().LT(1) localctx.(*UnaryContext).op = _lt _la = p.GetTokenStream().LA(1) if !((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&805404672) != 0) { var _ri = p.GetErrorHandler().RecoverInline(p) localctx.(*UnaryContext).op = _ri } else { p.GetErrorHandler().ReportMatch(p) p.Consume() } } { p.SetState(35) p.expr(19) } case PlanParserJSONContains, PlanParserArrayContains: localctx = NewJSONContainsContext(p, localctx) p.SetParserRuleContext(localctx) _prevctx = localctx { p.SetState(36) _la = p.GetTokenStream().LA(1) if !(_la == PlanParserJSONContains || _la == PlanParserArrayContains) { p.GetErrorHandler().RecoverInline(p) } else { p.GetErrorHandler().ReportMatch(p) p.Consume() } } { p.SetState(37) p.Match(PlanParserT__0) if p.HasError() { // Recognition error - abort rule goto errorExit } } { p.SetState(38) p.expr(0) } { p.SetState(39) p.Match(PlanParserT__3) if p.HasError() { // Recognition error - abort rule goto errorExit } } { p.SetState(40) p.expr(0) } { p.SetState(41) p.Match(PlanParserT__1) if p.HasError() { // Recognition error - abort rule goto errorExit } } case PlanParserJSONContainsAll, PlanParserArrayContainsAll: localctx = NewJSONContainsAllContext(p, localctx) p.SetParserRuleContext(localctx) _prevctx = localctx { p.SetState(43) _la = p.GetTokenStream().LA(1) if !(_la == PlanParserJSONContainsAll || _la == PlanParserArrayContainsAll) { p.GetErrorHandler().RecoverInline(p) } else { p.GetErrorHandler().ReportMatch(p) p.Consume() } } { p.SetState(44) p.Match(PlanParserT__0) if p.HasError() { // Recognition error - abort rule goto errorExit } } { p.SetState(45) p.expr(0) } { p.SetState(46) p.Match(PlanParserT__3) if p.HasError() { // Recognition error - abort rule goto errorExit } } { p.SetState(47) p.expr(0) } { p.SetState(48) p.Match(PlanParserT__1) if p.HasError() { // Recognition error - abort rule goto errorExit } } case PlanParserJSONContainsAny, PlanParserArrayContainsAny: localctx = NewJSONContainsAnyContext(p, localctx) p.SetParserRuleContext(localctx) _prevctx = localctx { p.SetState(50) _la = p.GetTokenStream().LA(1) if !(_la == PlanParserJSONContainsAny || _la == PlanParserArrayContainsAny) { p.GetErrorHandler().RecoverInline(p) } else { p.GetErrorHandler().ReportMatch(p) p.Consume() } } { p.SetState(51) p.Match(PlanParserT__0) if p.HasError() { // Recognition error - abort rule goto errorExit } } { p.SetState(52) p.expr(0) } { p.SetState(53) p.Match(PlanParserT__3) if p.HasError() { // Recognition error - abort rule goto errorExit } } { p.SetState(54) p.expr(0) } { p.SetState(55) p.Match(PlanParserT__1) if p.HasError() { // Recognition error - abort rule goto errorExit } } case PlanParserArrayLength: localctx = NewArrayLengthContext(p, localctx) p.SetParserRuleContext(localctx) _prevctx = localctx { p.SetState(57) p.Match(PlanParserArrayLength) if p.HasError() { // Recognition error - abort rule goto errorExit } } { p.SetState(58) p.Match(PlanParserT__0) if p.HasError() { // Recognition error - abort rule goto errorExit } } { p.SetState(59) _la = p.GetTokenStream().LA(1) if !(_la == PlanParserIdentifier || _la == PlanParserJSONIdentifier) { p.GetErrorHandler().RecoverInline(p) } else { p.GetErrorHandler().ReportMatch(p) p.Consume() } } { p.SetState(60) p.Match(PlanParserT__1) if p.HasError() { // Recognition error - abort rule goto errorExit } } case PlanParserEXISTS: localctx = NewExistsContext(p, localctx) p.SetParserRuleContext(localctx) _prevctx = localctx { p.SetState(61) p.Match(PlanParserEXISTS) if p.HasError() { // Recognition error - abort rule goto errorExit } } { p.SetState(62) p.expr(1) } default: p.SetError(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) goto errorExit } p.GetParserRuleContext().SetStop(p.GetTokenStream().LT(-1)) p.SetState(119) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 5, p.GetParserRuleContext()) if p.HasError() { goto errorExit } for _alt != 2 && _alt != antlr.ATNInvalidAltNumber { if _alt == 1 { if p.GetParseListeners() != nil { p.TriggerExitRuleEvent() } _prevctx = localctx p.SetState(117) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 4, p.GetParserRuleContext()) { case 1: localctx = NewPowerContext(p, NewExprContext(p, _parentctx, _parentState)) p.PushNewRecursionContext(localctx, _startState, PlanParserRULE_expr) p.SetState(65) if !(p.Precpred(p.GetParserRuleContext(), 20)) { p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 20)", "")) goto errorExit } { p.SetState(66) p.Match(PlanParserPOW) if p.HasError() { // Recognition error - abort rule goto errorExit } } { p.SetState(67) p.expr(21) } case 2: localctx = NewMulDivModContext(p, NewExprContext(p, _parentctx, _parentState)) p.PushNewRecursionContext(localctx, _startState, PlanParserRULE_expr) p.SetState(68) if !(p.Precpred(p.GetParserRuleContext(), 18)) { p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 18)", "")) goto errorExit } { p.SetState(69) var _lt = p.GetTokenStream().LT(1) localctx.(*MulDivModContext).op = _lt _la = p.GetTokenStream().LA(1) if !((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&917504) != 0) { var _ri = p.GetErrorHandler().RecoverInline(p) localctx.(*MulDivModContext).op = _ri } else { p.GetErrorHandler().ReportMatch(p) p.Consume() } } { p.SetState(70) p.expr(19) } case 3: localctx = NewAddSubContext(p, NewExprContext(p, _parentctx, _parentState)) p.PushNewRecursionContext(localctx, _startState, PlanParserRULE_expr) p.SetState(71) if !(p.Precpred(p.GetParserRuleContext(), 17)) { p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 17)", "")) goto errorExit } { p.SetState(72) var _lt = p.GetTokenStream().LT(1) localctx.(*AddSubContext).op = _lt _la = p.GetTokenStream().LA(1) if !(_la == PlanParserADD || _la == PlanParserSUB) { var _ri = p.GetErrorHandler().RecoverInline(p) localctx.(*AddSubContext).op = _ri } else { p.GetErrorHandler().ReportMatch(p) p.Consume() } } { p.SetState(73) p.expr(18) } case 4: localctx = NewShiftContext(p, NewExprContext(p, _parentctx, _parentState)) p.PushNewRecursionContext(localctx, _startState, PlanParserRULE_expr) p.SetState(74) if !(p.Precpred(p.GetParserRuleContext(), 16)) { p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 16)", "")) goto errorExit } { p.SetState(75) var _lt = p.GetTokenStream().LT(1) localctx.(*ShiftContext).op = _lt _la = p.GetTokenStream().LA(1) if !(_la == PlanParserSHL || _la == PlanParserSHR) { var _ri = p.GetErrorHandler().RecoverInline(p) localctx.(*ShiftContext).op = _ri } else { p.GetErrorHandler().ReportMatch(p) p.Consume() } } { p.SetState(76) p.expr(17) } case 5: localctx = NewTermContext(p, NewExprContext(p, _parentctx, _parentState)) p.PushNewRecursionContext(localctx, _startState, PlanParserRULE_expr) p.SetState(77) if !(p.Precpred(p.GetParserRuleContext(), 15)) { p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 15)", "")) goto errorExit } p.SetState(79) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } _la = p.GetTokenStream().LA(1) if _la == PlanParserNOT { { p.SetState(78) var _m = p.Match(PlanParserNOT) localctx.(*TermContext).op = _m if p.HasError() { // Recognition error - abort rule goto errorExit } } } { p.SetState(81) p.Match(PlanParserIN) if p.HasError() { // Recognition error - abort rule goto errorExit } } { p.SetState(82) p.expr(16) } case 6: localctx = NewRangeContext(p, NewExprContext(p, _parentctx, _parentState)) p.PushNewRecursionContext(localctx, _startState, PlanParserRULE_expr) p.SetState(83) if !(p.Precpred(p.GetParserRuleContext(), 10)) { p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 10)", "")) goto errorExit } { p.SetState(84) var _lt = p.GetTokenStream().LT(1) localctx.(*RangeContext).op1 = _lt _la = p.GetTokenStream().LA(1) if !(_la == PlanParserLT || _la == PlanParserLE) { var _ri = p.GetErrorHandler().RecoverInline(p) localctx.(*RangeContext).op1 = _ri } else { p.GetErrorHandler().ReportMatch(p) p.Consume() } } { p.SetState(85) _la = p.GetTokenStream().LA(1) if !(_la == PlanParserIdentifier || _la == PlanParserJSONIdentifier) { p.GetErrorHandler().RecoverInline(p) } else { p.GetErrorHandler().ReportMatch(p) p.Consume() } } { p.SetState(86) var _lt = p.GetTokenStream().LT(1) localctx.(*RangeContext).op2 = _lt _la = p.GetTokenStream().LA(1) if !(_la == PlanParserLT || _la == PlanParserLE) { var _ri = p.GetErrorHandler().RecoverInline(p) localctx.(*RangeContext).op2 = _ri } else { p.GetErrorHandler().ReportMatch(p) p.Consume() } } { p.SetState(87) p.expr(11) } case 7: localctx = NewReverseRangeContext(p, NewExprContext(p, _parentctx, _parentState)) p.PushNewRecursionContext(localctx, _startState, PlanParserRULE_expr) p.SetState(88) if !(p.Precpred(p.GetParserRuleContext(), 9)) { p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 9)", "")) goto errorExit } { p.SetState(89) var _lt = p.GetTokenStream().LT(1) localctx.(*ReverseRangeContext).op1 = _lt _la = p.GetTokenStream().LA(1) if !(_la == PlanParserGT || _la == PlanParserGE) { var _ri = p.GetErrorHandler().RecoverInline(p) localctx.(*ReverseRangeContext).op1 = _ri } else { p.GetErrorHandler().ReportMatch(p) p.Consume() } } { p.SetState(90) _la = p.GetTokenStream().LA(1) if !(_la == PlanParserIdentifier || _la == PlanParserJSONIdentifier) { p.GetErrorHandler().RecoverInline(p) } else { p.GetErrorHandler().ReportMatch(p) p.Consume() } } { p.SetState(91) var _lt = p.GetTokenStream().LT(1) localctx.(*ReverseRangeContext).op2 = _lt _la = p.GetTokenStream().LA(1) if !(_la == PlanParserGT || _la == PlanParserGE) { var _ri = p.GetErrorHandler().RecoverInline(p) localctx.(*ReverseRangeContext).op2 = _ri } else { p.GetErrorHandler().ReportMatch(p) p.Consume() } } { p.SetState(92) p.expr(10) } case 8: localctx = NewRelationalContext(p, NewExprContext(p, _parentctx, _parentState)) p.PushNewRecursionContext(localctx, _startState, PlanParserRULE_expr) p.SetState(93) if !(p.Precpred(p.GetParserRuleContext(), 8)) { p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 8)", "")) goto errorExit } { p.SetState(94) var _lt = p.GetTokenStream().LT(1) localctx.(*RelationalContext).op = _lt _la = p.GetTokenStream().LA(1) if !((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&960) != 0) { var _ri = p.GetErrorHandler().RecoverInline(p) localctx.(*RelationalContext).op = _ri } else { p.GetErrorHandler().ReportMatch(p) p.Consume() } } { p.SetState(95) p.expr(9) } case 9: localctx = NewEqualityContext(p, NewExprContext(p, _parentctx, _parentState)) p.PushNewRecursionContext(localctx, _startState, PlanParserRULE_expr) p.SetState(96) if !(p.Precpred(p.GetParserRuleContext(), 7)) { p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 7)", "")) goto errorExit } { p.SetState(97) var _lt = p.GetTokenStream().LT(1) localctx.(*EqualityContext).op = _lt _la = p.GetTokenStream().LA(1) if !(_la == PlanParserEQ || _la == PlanParserNE) { var _ri = p.GetErrorHandler().RecoverInline(p) localctx.(*EqualityContext).op = _ri } else { p.GetErrorHandler().ReportMatch(p) p.Consume() } } { p.SetState(98) p.expr(8) } case 10: localctx = NewBitAndContext(p, NewExprContext(p, _parentctx, _parentState)) p.PushNewRecursionContext(localctx, _startState, PlanParserRULE_expr) p.SetState(99) if !(p.Precpred(p.GetParserRuleContext(), 6)) { p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 6)", "")) goto errorExit } { p.SetState(100) p.Match(PlanParserBAND) if p.HasError() { // Recognition error - abort rule goto errorExit } } { p.SetState(101) p.expr(7) } case 11: localctx = NewBitXorContext(p, NewExprContext(p, _parentctx, _parentState)) p.PushNewRecursionContext(localctx, _startState, PlanParserRULE_expr) p.SetState(102) if !(p.Precpred(p.GetParserRuleContext(), 5)) { p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 5)", "")) goto errorExit } { p.SetState(103) p.Match(PlanParserBXOR) if p.HasError() { // Recognition error - abort rule goto errorExit } } { p.SetState(104) p.expr(6) } case 12: localctx = NewBitOrContext(p, NewExprContext(p, _parentctx, _parentState)) p.PushNewRecursionContext(localctx, _startState, PlanParserRULE_expr) p.SetState(105) if !(p.Precpred(p.GetParserRuleContext(), 4)) { p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 4)", "")) goto errorExit } { p.SetState(106) p.Match(PlanParserBOR) if p.HasError() { // Recognition error - abort rule goto errorExit } } { p.SetState(107) p.expr(5) } case 13: localctx = NewLogicalAndContext(p, NewExprContext(p, _parentctx, _parentState)) p.PushNewRecursionContext(localctx, _startState, PlanParserRULE_expr) p.SetState(108) if !(p.Precpred(p.GetParserRuleContext(), 3)) { p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 3)", "")) goto errorExit } { p.SetState(109) p.Match(PlanParserAND) if p.HasError() { // Recognition error - abort rule goto errorExit } } { p.SetState(110) p.expr(4) } case 14: localctx = NewLogicalOrContext(p, NewExprContext(p, _parentctx, _parentState)) p.PushNewRecursionContext(localctx, _startState, PlanParserRULE_expr) p.SetState(111) if !(p.Precpred(p.GetParserRuleContext(), 2)) { p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 2)", "")) goto errorExit } { p.SetState(112) p.Match(PlanParserOR) if p.HasError() { // Recognition error - abort rule goto errorExit } } { p.SetState(113) p.expr(3) } case 15: localctx = NewLikeContext(p, NewExprContext(p, _parentctx, _parentState)) p.PushNewRecursionContext(localctx, _startState, PlanParserRULE_expr) p.SetState(114) if !(p.Precpred(p.GetParserRuleContext(), 22)) { p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 22)", "")) goto errorExit } { p.SetState(115) p.Match(PlanParserLIKE) if p.HasError() { // Recognition error - abort rule goto errorExit } } { p.SetState(116) p.Match(PlanParserStringLiteral) if p.HasError() { // Recognition error - abort rule goto errorExit } } case antlr.ATNInvalidAltNumber: goto errorExit } } p.SetState(121) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 5, p.GetParserRuleContext()) if p.HasError() { goto errorExit } } errorExit: if p.HasError() { v := p.GetError() localctx.SetException(v) p.GetErrorHandler().ReportError(p, v) p.GetErrorHandler().Recover(p, v) p.SetError(nil) } p.UnrollRecursionContexts(_parentctx) return localctx goto errorExit // Trick to prevent compiler error if the label is not used } func (p *PlanParser) Sempred(localctx antlr.RuleContext, ruleIndex, predIndex int) bool { switch ruleIndex { case 0: var t *ExprContext = nil if localctx != nil { t = localctx.(*ExprContext) } return p.Expr_Sempred(t, predIndex) default: panic("No predicate with index: " + fmt.Sprint(ruleIndex)) } } func (p *PlanParser) Expr_Sempred(localctx antlr.RuleContext, predIndex int) bool { switch predIndex { case 0: return p.Precpred(p.GetParserRuleContext(), 20) case 1: return p.Precpred(p.GetParserRuleContext(), 18) case 2: return p.Precpred(p.GetParserRuleContext(), 17) case 3: return p.Precpred(p.GetParserRuleContext(), 16) case 4: return p.Precpred(p.GetParserRuleContext(), 15) case 5: return p.Precpred(p.GetParserRuleContext(), 10) case 6: return p.Precpred(p.GetParserRuleContext(), 9) case 7: return p.Precpred(p.GetParserRuleContext(), 8) case 8: return p.Precpred(p.GetParserRuleContext(), 7) case 9: return p.Precpred(p.GetParserRuleContext(), 6) case 10: return p.Precpred(p.GetParserRuleContext(), 5) case 11: return p.Precpred(p.GetParserRuleContext(), 4) case 12: return p.Precpred(p.GetParserRuleContext(), 3) case 13: return p.Precpred(p.GetParserRuleContext(), 2) case 14: return p.Precpred(p.GetParserRuleContext(), 22) default: panic("No predicate with index: " + fmt.Sprint(predIndex)) } }