// Code generated from Plan.g4 by ANTLR 4.9. DO NOT EDIT. package planparserv2 // Plan import ( "fmt" "reflect" "strconv" "github.com/antlr/antlr4/runtime/Go/antlr" ) // Suppress unused import errors var _ = fmt.Printf var _ = reflect.Copy var _ = strconv.Itoa var parserATN = []uint16{ 3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 3, 48, 131, 4, 2, 9, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 7, 2, 20, 10, 2, 12, 2, 14, 2, 23, 11, 2, 3, 2, 5, 2, 26, 10, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 5, 2, 59, 10, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 7, 2, 113, 10, 2, 12, 2, 14, 2, 116, 11, 2, 3, 2, 5, 2, 119, 10, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 7, 2, 126, 10, 2, 12, 2, 14, 2, 129, 11, 2, 3, 2, 2, 3, 2, 3, 2, 2, 15, 4, 2, 16, 17, 29, 30, 4, 2, 34, 34, 37, 37, 4, 2, 35, 35, 38, 38, 4, 2, 36, 36, 39, 39, 4, 2, 44, 44, 46, 46, 3, 2, 18, 20, 3, 2, 16, 17, 3, 2, 22, 23, 3, 2, 8, 9, 3, 2, 10, 11, 3, 2, 8, 11, 3, 2, 12, 13, 3, 2, 31, 32, 2, 162, 2, 58, 3, 2, 2, 2, 4, 5, 8, 2, 1, 2, 5, 59, 7, 42, 2, 2, 6, 59, 7, 43, 2, 2, 7, 59, 7, 41, 2, 2, 8, 59, 7, 45, 2, 2, 9, 59, 7, 44, 2, 2, 10, 59, 7, 46, 2, 2, 11, 12, 7, 3, 2, 2, 12, 13, 5, 2, 2, 2, 13, 14, 7, 4, 2, 2, 14, 59, 3, 2, 2, 2, 15, 16, 7, 5, 2, 2, 16, 21, 5, 2, 2, 2, 17, 18, 7, 6, 2, 2, 18, 20, 5, 2, 2, 2, 19, 17, 3, 2, 2, 2, 20, 23, 3, 2, 2, 2, 21, 19, 3, 2, 2, 2, 21, 22, 3, 2, 2, 2, 22, 25, 3, 2, 2, 2, 23, 21, 3, 2, 2, 2, 24, 26, 7, 6, 2, 2, 25, 24, 3, 2, 2, 2, 25, 26, 3, 2, 2, 2, 26, 27, 3, 2, 2, 2, 27, 28, 7, 7, 2, 2, 28, 59, 3, 2, 2, 2, 29, 30, 9, 2, 2, 2, 30, 59, 5, 2, 2, 22, 31, 32, 9, 3, 2, 2, 32, 33, 7, 3, 2, 2, 33, 34, 5, 2, 2, 2, 34, 35, 7, 6, 2, 2, 35, 36, 5, 2, 2, 2, 36, 37, 7, 4, 2, 2, 37, 59, 3, 2, 2, 2, 38, 39, 9, 4, 2, 2, 39, 40, 7, 3, 2, 2, 40, 41, 5, 2, 2, 2, 41, 42, 7, 6, 2, 2, 42, 43, 5, 2, 2, 2, 43, 44, 7, 4, 2, 2, 44, 59, 3, 2, 2, 2, 45, 46, 9, 5, 2, 2, 46, 47, 7, 3, 2, 2, 47, 48, 5, 2, 2, 2, 48, 49, 7, 6, 2, 2, 49, 50, 5, 2, 2, 2, 50, 51, 7, 4, 2, 2, 51, 59, 3, 2, 2, 2, 52, 53, 7, 40, 2, 2, 53, 54, 7, 3, 2, 2, 54, 55, 9, 6, 2, 2, 55, 59, 7, 4, 2, 2, 56, 57, 7, 15, 2, 2, 57, 59, 5, 2, 2, 3, 58, 4, 3, 2, 2, 2, 58, 6, 3, 2, 2, 2, 58, 7, 3, 2, 2, 2, 58, 8, 3, 2, 2, 2, 58, 9, 3, 2, 2, 2, 58, 10, 3, 2, 2, 2, 58, 11, 3, 2, 2, 2, 58, 15, 3, 2, 2, 2, 58, 29, 3, 2, 2, 2, 58, 31, 3, 2, 2, 2, 58, 38, 3, 2, 2, 2, 58, 45, 3, 2, 2, 2, 58, 52, 3, 2, 2, 2, 58, 56, 3, 2, 2, 2, 59, 127, 3, 2, 2, 2, 60, 61, 12, 23, 2, 2, 61, 62, 7, 21, 2, 2, 62, 126, 5, 2, 2, 24, 63, 64, 12, 21, 2, 2, 64, 65, 9, 7, 2, 2, 65, 126, 5, 2, 2, 22, 66, 67, 12, 20, 2, 2, 67, 68, 9, 8, 2, 2, 68, 126, 5, 2, 2, 21, 69, 70, 12, 19, 2, 2, 70, 71, 9, 9, 2, 2, 71, 126, 5, 2, 2, 20, 72, 73, 12, 12, 2, 2, 73, 74, 9, 10, 2, 2, 74, 75, 9, 6, 2, 2, 75, 76, 9, 10, 2, 2, 76, 126, 5, 2, 2, 13, 77, 78, 12, 11, 2, 2, 78, 79, 9, 11, 2, 2, 79, 80, 9, 6, 2, 2, 80, 81, 9, 11, 2, 2, 81, 126, 5, 2, 2, 12, 82, 83, 12, 10, 2, 2, 83, 84, 9, 12, 2, 2, 84, 126, 5, 2, 2, 11, 85, 86, 12, 9, 2, 2, 86, 87, 9, 13, 2, 2, 87, 126, 5, 2, 2, 10, 88, 89, 12, 8, 2, 2, 89, 90, 7, 24, 2, 2, 90, 126, 5, 2, 2, 9, 91, 92, 12, 7, 2, 2, 92, 93, 7, 26, 2, 2, 93, 126, 5, 2, 2, 8, 94, 95, 12, 6, 2, 2, 95, 96, 7, 25, 2, 2, 96, 126, 5, 2, 2, 7, 97, 98, 12, 5, 2, 2, 98, 99, 7, 27, 2, 2, 99, 126, 5, 2, 2, 6, 100, 101, 12, 4, 2, 2, 101, 102, 7, 28, 2, 2, 102, 126, 5, 2, 2, 5, 103, 104, 12, 24, 2, 2, 104, 105, 7, 14, 2, 2, 105, 126, 7, 45, 2, 2, 106, 107, 12, 18, 2, 2, 107, 108, 9, 14, 2, 2, 108, 109, 7, 5, 2, 2, 109, 114, 5, 2, 2, 2, 110, 111, 7, 6, 2, 2, 111, 113, 5, 2, 2, 2, 112, 110, 3, 2, 2, 2, 113, 116, 3, 2, 2, 2, 114, 112, 3, 2, 2, 2, 114, 115, 3, 2, 2, 2, 115, 118, 3, 2, 2, 2, 116, 114, 3, 2, 2, 2, 117, 119, 7, 6, 2, 2, 118, 117, 3, 2, 2, 2, 118, 119, 3, 2, 2, 2, 119, 120, 3, 2, 2, 2, 120, 121, 7, 7, 2, 2, 121, 126, 3, 2, 2, 2, 122, 123, 12, 17, 2, 2, 123, 124, 9, 14, 2, 2, 124, 126, 7, 33, 2, 2, 125, 60, 3, 2, 2, 2, 125, 63, 3, 2, 2, 2, 125, 66, 3, 2, 2, 2, 125, 69, 3, 2, 2, 2, 125, 72, 3, 2, 2, 2, 125, 77, 3, 2, 2, 2, 125, 82, 3, 2, 2, 2, 125, 85, 3, 2, 2, 2, 125, 88, 3, 2, 2, 2, 125, 91, 3, 2, 2, 2, 125, 94, 3, 2, 2, 2, 125, 97, 3, 2, 2, 2, 125, 100, 3, 2, 2, 2, 125, 103, 3, 2, 2, 2, 125, 106, 3, 2, 2, 2, 125, 122, 3, 2, 2, 2, 126, 129, 3, 2, 2, 2, 127, 125, 3, 2, 2, 2, 127, 128, 3, 2, 2, 2, 128, 3, 3, 2, 2, 2, 129, 127, 3, 2, 2, 2, 9, 21, 25, 58, 114, 118, 125, 127, } var literalNames = []string{ "", "'('", "')'", "'['", "','", "']'", "'<'", "'<='", "'>'", "'>='", "'=='", "'!='", "", "", "'+'", "'-'", "'*'", "'/'", "'%'", "'**'", "'<<'", "'>>'", "'&'", "'|'", "'^'", "", "", "'~'", "", "'in'", "'not in'", } var symbolicNames = []string{ "", "", "", "", "", "", "LT", "LE", "GT", "GE", "EQ", "NE", "LIKE", "EXISTS", "ADD", "SUB", "MUL", "DIV", "MOD", "POW", "SHL", "SHR", "BAND", "BOR", "BXOR", "AND", "OR", "BNOT", "NOT", "IN", "NIN", "EmptyTerm", "JSONContains", "JSONContainsAll", "JSONContainsAny", "ArrayContains", "ArrayContainsAll", "ArrayContainsAny", "ArrayLength", "BooleanConstant", "IntegerConstant", "FloatingConstant", "Identifier", "StringLiteral", "JSONIdentifier", "Whitespace", "Newline", } var ruleNames = []string{ "expr", } type PlanParser struct { *antlr.BaseParser } // NewPlanParser produces a new parser instance for the optional input antlr.TokenStream. // // The *PlanParser instance produced may be reused by calling the SetInputStream method. // The initial parser configuration is expensive to construct, and the object is not thread-safe; // however, if used within a Golang sync.Pool, the construction cost amortizes well and the // objects can be used in a thread-safe manner. func NewPlanParser(input antlr.TokenStream) *PlanParser { this := new(PlanParser) deserializer := antlr.NewATNDeserializer(nil) deserializedATN := deserializer.DeserializeFromUInt16(parserATN) decisionToDFA := make([]*antlr.DFA, len(deserializedATN.DecisionToState)) for index, ds := range deserializedATN.DecisionToState { decisionToDFA[index] = antlr.NewDFA(ds, index) } this.BaseParser = antlr.NewBaseParser(input) this.Interpreter = antlr.NewParserATNSimulator(this, deserializedATN, decisionToDFA, antlr.NewPredictionContextCache()) this.RuleNames = ruleNames this.LiteralNames = literalNames this.SymbolicNames = 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 PlanParserADD = 14 PlanParserSUB = 15 PlanParserMUL = 16 PlanParserDIV = 17 PlanParserMOD = 18 PlanParserPOW = 19 PlanParserSHL = 20 PlanParserSHR = 21 PlanParserBAND = 22 PlanParserBOR = 23 PlanParserBXOR = 24 PlanParserAND = 25 PlanParserOR = 26 PlanParserBNOT = 27 PlanParserNOT = 28 PlanParserIN = 29 PlanParserNIN = 30 PlanParserEmptyTerm = 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) p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) p.RuleIndex = PlanParserRULE_expr return p } func (*ExprContext) IsExprContext() {} func NewExprContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ExprContext { var p = new(ExprContext) p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) p.parser = parser p.RuleIndex = PlanParserRULE_expr return p } func (s *ExprContext) GetParser() antlr.Parser { return s.parser } func (s *ExprContext) CopyFrom(ctx *ExprContext) { s.BaseParserRuleContext.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) p.ExprContext = NewEmptyExprContext() p.parser = parser p.CopyFrom(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) p.ExprContext = NewEmptyExprContext() p.parser = parser p.CopyFrom(ctx.(*ExprContext)) return p } func (s *ParensContext) GetRuleContext() antlr.RuleContext { return s } func (s *ParensContext) Expr() IExprContext { var t = s.GetTypedRuleContext(reflect.TypeOf((*IExprContext)(nil)).Elem(), 0) 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) p.ExprContext = NewEmptyExprContext() p.parser = parser p.CopyFrom(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) p.ExprContext = NewEmptyExprContext() p.parser = parser p.CopyFrom(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) p.ExprContext = NewEmptyExprContext() p.parser = parser p.CopyFrom(ctx.(*ExprContext)) return p } func (s *JSONContainsAllContext) GetRuleContext() antlr.RuleContext { return s } func (s *JSONContainsAllContext) AllExpr() []IExprContext { var ts = s.GetTypedRuleContexts(reflect.TypeOf((*IExprContext)(nil)).Elem()) var tst = make([]IExprContext, len(ts)) for i, t := range ts { if t != nil { tst[i] = t.(IExprContext) } } return tst } func (s *JSONContainsAllContext) Expr(i int) IExprContext { var t = s.GetTypedRuleContext(reflect.TypeOf((*IExprContext)(nil)).Elem(), i) 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) p.ExprContext = NewEmptyExprContext() p.parser = parser p.CopyFrom(ctx.(*ExprContext)) return p } func (s *LogicalOrContext) GetRuleContext() antlr.RuleContext { return s } func (s *LogicalOrContext) AllExpr() []IExprContext { var ts = s.GetTypedRuleContexts(reflect.TypeOf((*IExprContext)(nil)).Elem()) var tst = make([]IExprContext, len(ts)) for i, t := range ts { if t != nil { tst[i] = t.(IExprContext) } } return tst } func (s *LogicalOrContext) Expr(i int) IExprContext { var t = s.GetTypedRuleContext(reflect.TypeOf((*IExprContext)(nil)).Elem(), i) 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) p.ExprContext = NewEmptyExprContext() p.parser = parser p.CopyFrom(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 { var ts = s.GetTypedRuleContexts(reflect.TypeOf((*IExprContext)(nil)).Elem()) var tst = make([]IExprContext, len(ts)) for i, t := range ts { if t != nil { tst[i] = t.(IExprContext) } } return tst } func (s *MulDivModContext) Expr(i int) IExprContext { var t = s.GetTypedRuleContext(reflect.TypeOf((*IExprContext)(nil)).Elem(), i) 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) p.ExprContext = NewEmptyExprContext() p.parser = parser p.CopyFrom(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) p.ExprContext = NewEmptyExprContext() p.parser = parser p.CopyFrom(ctx.(*ExprContext)) return p } func (s *LikeContext) GetRuleContext() antlr.RuleContext { return s } func (s *LikeContext) Expr() IExprContext { var t = s.GetTypedRuleContext(reflect.TypeOf((*IExprContext)(nil)).Elem(), 0) 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) p.ExprContext = NewEmptyExprContext() p.parser = parser p.CopyFrom(ctx.(*ExprContext)) return p } func (s *LogicalAndContext) GetRuleContext() antlr.RuleContext { return s } func (s *LogicalAndContext) AllExpr() []IExprContext { var ts = s.GetTypedRuleContexts(reflect.TypeOf((*IExprContext)(nil)).Elem()) var tst = make([]IExprContext, len(ts)) for i, t := range ts { if t != nil { tst[i] = t.(IExprContext) } } return tst } func (s *LogicalAndContext) Expr(i int) IExprContext { var t = s.GetTypedRuleContext(reflect.TypeOf((*IExprContext)(nil)).Elem(), i) 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) p.ExprContext = NewEmptyExprContext() p.parser = parser p.CopyFrom(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 { var ts = s.GetTypedRuleContexts(reflect.TypeOf((*IExprContext)(nil)).Elem()) var tst = make([]IExprContext, len(ts)) for i, t := range ts { if t != nil { tst[i] = t.(IExprContext) } } return tst } func (s *EqualityContext) Expr(i int) IExprContext { var t = s.GetTypedRuleContext(reflect.TypeOf((*IExprContext)(nil)).Elem(), i) 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) p.ExprContext = NewEmptyExprContext() p.parser = parser p.CopyFrom(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) p.ExprContext = NewEmptyExprContext() p.parser = parser p.CopyFrom(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 { var ts = s.GetTypedRuleContexts(reflect.TypeOf((*IExprContext)(nil)).Elem()) var tst = make([]IExprContext, len(ts)) for i, t := range ts { if t != nil { tst[i] = t.(IExprContext) } } return tst } func (s *ShiftContext) Expr(i int) IExprContext { var t = s.GetTypedRuleContext(reflect.TypeOf((*IExprContext)(nil)).Elem(), i) 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) p.ExprContext = NewEmptyExprContext() p.parser = parser p.CopyFrom(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 { var ts = s.GetTypedRuleContexts(reflect.TypeOf((*IExprContext)(nil)).Elem()) var tst = make([]IExprContext, len(ts)) for i, t := range ts { if t != nil { tst[i] = t.(IExprContext) } } return tst } func (s *ReverseRangeContext) Expr(i int) IExprContext { var t = s.GetTypedRuleContext(reflect.TypeOf((*IExprContext)(nil)).Elem(), i) 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) p.ExprContext = NewEmptyExprContext() p.parser = parser p.CopyFrom(ctx.(*ExprContext)) return p } func (s *BitOrContext) GetRuleContext() antlr.RuleContext { return s } func (s *BitOrContext) AllExpr() []IExprContext { var ts = s.GetTypedRuleContexts(reflect.TypeOf((*IExprContext)(nil)).Elem()) var tst = make([]IExprContext, len(ts)) for i, t := range ts { if t != nil { tst[i] = t.(IExprContext) } } return tst } func (s *BitOrContext) Expr(i int) IExprContext { var t = s.GetTypedRuleContext(reflect.TypeOf((*IExprContext)(nil)).Elem(), i) 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 AddSubContext struct { *ExprContext op antlr.Token } func NewAddSubContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *AddSubContext { var p = new(AddSubContext) p.ExprContext = NewEmptyExprContext() p.parser = parser p.CopyFrom(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 { var ts = s.GetTypedRuleContexts(reflect.TypeOf((*IExprContext)(nil)).Elem()) var tst = make([]IExprContext, len(ts)) for i, t := range ts { if t != nil { tst[i] = t.(IExprContext) } } return tst } func (s *AddSubContext) Expr(i int) IExprContext { var t = s.GetTypedRuleContext(reflect.TypeOf((*IExprContext)(nil)).Elem(), i) 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) p.ExprContext = NewEmptyExprContext() p.parser = parser p.CopyFrom(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 { var ts = s.GetTypedRuleContexts(reflect.TypeOf((*IExprContext)(nil)).Elem()) var tst = make([]IExprContext, len(ts)) for i, t := range ts { if t != nil { tst[i] = t.(IExprContext) } } return tst } func (s *RelationalContext) Expr(i int) IExprContext { var t = s.GetTypedRuleContext(reflect.TypeOf((*IExprContext)(nil)).Elem(), i) 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) p.ExprContext = NewEmptyExprContext() p.parser = parser p.CopyFrom(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 TermContext struct { *ExprContext op antlr.Token } func NewTermContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *TermContext { var p = new(TermContext) p.ExprContext = NewEmptyExprContext() p.parser = parser p.CopyFrom(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 { var ts = s.GetTypedRuleContexts(reflect.TypeOf((*IExprContext)(nil)).Elem()) var tst = make([]IExprContext, len(ts)) for i, t := range ts { if t != nil { tst[i] = t.(IExprContext) } } return tst } func (s *TermContext) Expr(i int) IExprContext { var t = s.GetTypedRuleContext(reflect.TypeOf((*IExprContext)(nil)).Elem(), i) if t == nil { return nil } return t.(IExprContext) } func (s *TermContext) IN() antlr.TerminalNode { return s.GetToken(PlanParserIN, 0) } func (s *TermContext) NIN() antlr.TerminalNode { return s.GetToken(PlanParserNIN, 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) p.ExprContext = NewEmptyExprContext() p.parser = parser p.CopyFrom(ctx.(*ExprContext)) return p } func (s *JSONContainsContext) GetRuleContext() antlr.RuleContext { return s } func (s *JSONContainsContext) AllExpr() []IExprContext { var ts = s.GetTypedRuleContexts(reflect.TypeOf((*IExprContext)(nil)).Elem()) var tst = make([]IExprContext, len(ts)) for i, t := range ts { if t != nil { tst[i] = t.(IExprContext) } } return tst } func (s *JSONContainsContext) Expr(i int) IExprContext { var t = s.GetTypedRuleContext(reflect.TypeOf((*IExprContext)(nil)).Elem(), i) 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) p.ExprContext = NewEmptyExprContext() p.parser = parser p.CopyFrom(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 { var ts = s.GetTypedRuleContexts(reflect.TypeOf((*IExprContext)(nil)).Elem()) var tst = make([]IExprContext, len(ts)) for i, t := range ts { if t != nil { tst[i] = t.(IExprContext) } } return tst } func (s *RangeContext) Expr(i int) IExprContext { var t = s.GetTypedRuleContext(reflect.TypeOf((*IExprContext)(nil)).Elem(), i) 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) p.ExprContext = NewEmptyExprContext() p.parser = parser p.CopyFrom(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 = s.GetTypedRuleContext(reflect.TypeOf((*IExprContext)(nil)).Elem(), 0) 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) p.ExprContext = NewEmptyExprContext() p.parser = parser p.CopyFrom(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) p.ExprContext = NewEmptyExprContext() p.parser = parser p.CopyFrom(ctx.(*ExprContext)) return p } func (s *ArrayContext) GetRuleContext() antlr.RuleContext { return s } func (s *ArrayContext) AllExpr() []IExprContext { var ts = s.GetTypedRuleContexts(reflect.TypeOf((*IExprContext)(nil)).Elem()) var tst = make([]IExprContext, len(ts)) for i, t := range ts { if t != nil { tst[i] = t.(IExprContext) } } return tst } func (s *ArrayContext) Expr(i int) IExprContext { var t = s.GetTypedRuleContext(reflect.TypeOf((*IExprContext)(nil)).Elem(), i) 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) p.ExprContext = NewEmptyExprContext() p.parser = parser p.CopyFrom(ctx.(*ExprContext)) return p } func (s *JSONContainsAnyContext) GetRuleContext() antlr.RuleContext { return s } func (s *JSONContainsAnyContext) AllExpr() []IExprContext { var ts = s.GetTypedRuleContexts(reflect.TypeOf((*IExprContext)(nil)).Elem()) var tst = make([]IExprContext, len(ts)) for i, t := range ts { if t != nil { tst[i] = t.(IExprContext) } } return tst } func (s *JSONContainsAnyContext) Expr(i int) IExprContext { var t = s.GetTypedRuleContext(reflect.TypeOf((*IExprContext)(nil)).Elem(), i) 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) p.ExprContext = NewEmptyExprContext() p.parser = parser p.CopyFrom(ctx.(*ExprContext)) return p } func (s *BitXorContext) GetRuleContext() antlr.RuleContext { return s } func (s *BitXorContext) AllExpr() []IExprContext { var ts = s.GetTypedRuleContexts(reflect.TypeOf((*IExprContext)(nil)).Elem()) var tst = make([]IExprContext, len(ts)) for i, t := range ts { if t != nil { tst[i] = t.(IExprContext) } } return tst } func (s *BitXorContext) Expr(i int) IExprContext { var t = s.GetTypedRuleContext(reflect.TypeOf((*IExprContext)(nil)).Elem(), i) 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) p.ExprContext = NewEmptyExprContext() p.parser = parser p.CopyFrom(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 = s.GetTypedRuleContext(reflect.TypeOf((*IExprContext)(nil)).Elem(), 0) 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) p.ExprContext = NewEmptyExprContext() p.parser = parser p.CopyFrom(ctx.(*ExprContext)) return p } func (s *BitAndContext) GetRuleContext() antlr.RuleContext { return s } func (s *BitAndContext) AllExpr() []IExprContext { var ts = s.GetTypedRuleContexts(reflect.TypeOf((*IExprContext)(nil)).Elem()) var tst = make([]IExprContext, len(ts)) for i, t := range ts { if t != nil { tst[i] = t.(IExprContext) } } return tst } func (s *BitAndContext) Expr(i int) IExprContext { var t = s.GetTypedRuleContext(reflect.TypeOf((*IExprContext)(nil)).Elem(), i) 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 EmptyTermContext struct { *ExprContext op antlr.Token } func NewEmptyTermContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *EmptyTermContext { var p = new(EmptyTermContext) p.ExprContext = NewEmptyExprContext() p.parser = parser p.CopyFrom(ctx.(*ExprContext)) return p } func (s *EmptyTermContext) GetOp() antlr.Token { return s.op } func (s *EmptyTermContext) SetOp(v antlr.Token) { s.op = v } func (s *EmptyTermContext) GetRuleContext() antlr.RuleContext { return s } func (s *EmptyTermContext) Expr() IExprContext { var t = s.GetTypedRuleContext(reflect.TypeOf((*IExprContext)(nil)).Elem(), 0) if t == nil { return nil } return t.(IExprContext) } func (s *EmptyTermContext) EmptyTerm() antlr.TerminalNode { return s.GetToken(PlanParserEmptyTerm, 0) } func (s *EmptyTermContext) IN() antlr.TerminalNode { return s.GetToken(PlanParserIN, 0) } func (s *EmptyTermContext) NIN() antlr.TerminalNode { return s.GetToken(PlanParserNIN, 0) } func (s *EmptyTermContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case PlanVisitor: return t.VisitEmptyTerm(s) default: return t.VisitChildren(s) } } type PowerContext struct { *ExprContext } func NewPowerContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *PowerContext { var p = new(PowerContext) p.ExprContext = NewEmptyExprContext() p.parser = parser p.CopyFrom(ctx.(*ExprContext)) return p } func (s *PowerContext) GetRuleContext() antlr.RuleContext { return s } func (s *PowerContext) AllExpr() []IExprContext { var ts = s.GetTypedRuleContexts(reflect.TypeOf((*IExprContext)(nil)).Elem()) var tst = make([]IExprContext, len(ts)) for i, t := range ts { if t != nil { tst[i] = t.(IExprContext) } } return tst } func (s *PowerContext) Expr(i int) IExprContext { var t = s.GetTypedRuleContext(reflect.TypeOf((*IExprContext)(nil)).Elem(), i) 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 defer func() { p.UnrollRecursionContexts(_parentctx) }() defer func() { if err := recover(); err != nil { if v, ok := err.(antlr.RecognitionException); ok { localctx.SetException(v) p.GetErrorHandler().ReportError(p, v) p.GetErrorHandler().Recover(p, v) } else { panic(err) } } }() var _alt int p.EnterOuterAlt(localctx, 1) p.SetState(56) p.GetErrorHandler().Sync(p) switch p.GetTokenStream().LA(1) { case PlanParserIntegerConstant: localctx = NewIntegerContext(p, localctx) p.SetParserRuleContext(localctx) _prevctx = localctx { p.SetState(3) p.Match(PlanParserIntegerConstant) } case PlanParserFloatingConstant: localctx = NewFloatingContext(p, localctx) p.SetParserRuleContext(localctx) _prevctx = localctx { p.SetState(4) p.Match(PlanParserFloatingConstant) } case PlanParserBooleanConstant: localctx = NewBooleanContext(p, localctx) p.SetParserRuleContext(localctx) _prevctx = localctx { p.SetState(5) p.Match(PlanParserBooleanConstant) } case PlanParserStringLiteral: localctx = NewStringContext(p, localctx) p.SetParserRuleContext(localctx) _prevctx = localctx { p.SetState(6) p.Match(PlanParserStringLiteral) } case PlanParserIdentifier: localctx = NewIdentifierContext(p, localctx) p.SetParserRuleContext(localctx) _prevctx = localctx { p.SetState(7) p.Match(PlanParserIdentifier) } case PlanParserJSONIdentifier: localctx = NewJSONIdentifierContext(p, localctx) p.SetParserRuleContext(localctx) _prevctx = localctx { p.SetState(8) p.Match(PlanParserJSONIdentifier) } case PlanParserT__0: localctx = NewParensContext(p, localctx) p.SetParserRuleContext(localctx) _prevctx = localctx { p.SetState(9) p.Match(PlanParserT__0) } { p.SetState(10) p.expr(0) } { p.SetState(11) p.Match(PlanParserT__1) } case PlanParserT__2: localctx = NewArrayContext(p, localctx) p.SetParserRuleContext(localctx) _prevctx = localctx { p.SetState(13) p.Match(PlanParserT__2) } { p.SetState(14) p.expr(0) } p.SetState(19) p.GetErrorHandler().Sync(p) _alt = p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 0, p.GetParserRuleContext()) for _alt != 2 && _alt != antlr.ATNInvalidAltNumber { if _alt == 1 { { p.SetState(15) p.Match(PlanParserT__3) } { p.SetState(16) p.expr(0) } } p.SetState(21) p.GetErrorHandler().Sync(p) _alt = p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 0, p.GetParserRuleContext()) } p.SetState(23) p.GetErrorHandler().Sync(p) _la = p.GetTokenStream().LA(1) if _la == PlanParserT__3 { { p.SetState(22) p.Match(PlanParserT__3) } } { p.SetState(25) p.Match(PlanParserT__4) } case PlanParserADD, PlanParserSUB, PlanParserBNOT, PlanParserNOT: localctx = NewUnaryContext(p, localctx) p.SetParserRuleContext(localctx) _prevctx = localctx { p.SetState(27) var _lt = p.GetTokenStream().LT(1) localctx.(*UnaryContext).op = _lt _la = p.GetTokenStream().LA(1) if !(((_la)&-(0x1f+1)) == 0 && ((1<