mirror of https://github.com/milvus-io/milvus.git
2455 lines
53 KiB
Go
2455 lines
53 KiB
Go
// Code generated from java-escape by ANTLR 4.11.1. DO NOT EDIT.
|
|
|
|
package planparserv2 // Plan
|
|
import (
|
|
"fmt"
|
|
"strconv"
|
|
"sync"
|
|
|
|
"github.com/antlr/antlr4/runtime/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{
|
|
"", "'('", "')'", "'['", "','", "']'", "'<'", "'<='", "'>'", "'>='",
|
|
"'=='", "'!='", "", "'+'", "'-'", "'*'", "'/'", "'%'", "'**'", "'<<'",
|
|
"'>>'", "'&'", "'|'", "'^'", "", "", "'~'", "", "'in'", "'not in'",
|
|
}
|
|
staticData.symbolicNames = []string{
|
|
"", "", "", "", "", "", "LT", "LE", "GT", "GE", "EQ", "NE", "LIKE",
|
|
"ADD", "SUB", "MUL", "DIV", "MOD", "POW", "SHL", "SHR", "BAND", "BOR",
|
|
"BXOR", "AND", "OR", "BNOT", "NOT", "IN", "NIN", "EmptyTerm", "BooleanConstant",
|
|
"IntegerConstant", "FloatingConstant", "Identifier", "StringLiteral",
|
|
"Whitespace", "Newline",
|
|
}
|
|
staticData.ruleNames = []string{
|
|
"expr",
|
|
}
|
|
staticData.predictionContextCache = antlr.NewPredictionContextCache()
|
|
staticData.serializedATN = []int32{
|
|
4, 1, 37, 87, 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, 3, 0, 15, 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, 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,
|
|
69, 8, 0, 10, 0, 12, 0, 72, 9, 0, 1, 0, 3, 0, 75, 8, 0, 1, 0, 1, 0, 1,
|
|
0, 1, 0, 1, 0, 5, 0, 82, 8, 0, 10, 0, 12, 0, 85, 9, 0, 1, 0, 0, 1, 0, 1,
|
|
0, 0, 9, 2, 0, 13, 14, 26, 27, 1, 0, 15, 17, 1, 0, 13, 14, 1, 0, 19, 20,
|
|
1, 0, 6, 7, 1, 0, 8, 9, 1, 0, 6, 9, 1, 0, 10, 11, 1, 0, 28, 29, 109, 0,
|
|
14, 1, 0, 0, 0, 2, 3, 6, 0, -1, 0, 3, 15, 5, 32, 0, 0, 4, 15, 5, 33, 0,
|
|
0, 5, 15, 5, 31, 0, 0, 6, 15, 5, 35, 0, 0, 7, 15, 5, 34, 0, 0, 8, 9, 5,
|
|
1, 0, 0, 9, 10, 3, 0, 0, 0, 10, 11, 5, 2, 0, 0, 11, 15, 1, 0, 0, 0, 12,
|
|
13, 7, 0, 0, 0, 13, 15, 3, 0, 0, 15, 14, 2, 1, 0, 0, 0, 14, 4, 1, 0, 0,
|
|
0, 14, 5, 1, 0, 0, 0, 14, 6, 1, 0, 0, 0, 14, 7, 1, 0, 0, 0, 14, 8, 1, 0,
|
|
0, 0, 14, 12, 1, 0, 0, 0, 15, 83, 1, 0, 0, 0, 16, 17, 10, 16, 0, 0, 17,
|
|
18, 5, 18, 0, 0, 18, 82, 3, 0, 0, 17, 19, 20, 10, 14, 0, 0, 20, 21, 7,
|
|
1, 0, 0, 21, 82, 3, 0, 0, 15, 22, 23, 10, 13, 0, 0, 23, 24, 7, 2, 0, 0,
|
|
24, 82, 3, 0, 0, 14, 25, 26, 10, 12, 0, 0, 26, 27, 7, 3, 0, 0, 27, 82,
|
|
3, 0, 0, 13, 28, 29, 10, 9, 0, 0, 29, 30, 7, 4, 0, 0, 30, 31, 5, 34, 0,
|
|
0, 31, 32, 7, 4, 0, 0, 32, 82, 3, 0, 0, 10, 33, 34, 10, 8, 0, 0, 34, 35,
|
|
7, 5, 0, 0, 35, 36, 5, 34, 0, 0, 36, 37, 7, 5, 0, 0, 37, 82, 3, 0, 0, 9,
|
|
38, 39, 10, 7, 0, 0, 39, 40, 7, 6, 0, 0, 40, 82, 3, 0, 0, 8, 41, 42, 10,
|
|
6, 0, 0, 42, 43, 7, 7, 0, 0, 43, 82, 3, 0, 0, 7, 44, 45, 10, 5, 0, 0, 45,
|
|
46, 5, 21, 0, 0, 46, 82, 3, 0, 0, 6, 47, 48, 10, 4, 0, 0, 48, 49, 5, 23,
|
|
0, 0, 49, 82, 3, 0, 0, 5, 50, 51, 10, 3, 0, 0, 51, 52, 5, 22, 0, 0, 52,
|
|
82, 3, 0, 0, 4, 53, 54, 10, 2, 0, 0, 54, 55, 5, 24, 0, 0, 55, 82, 3, 0,
|
|
0, 3, 56, 57, 10, 1, 0, 0, 57, 58, 5, 25, 0, 0, 58, 82, 3, 0, 0, 2, 59,
|
|
60, 10, 17, 0, 0, 60, 61, 5, 12, 0, 0, 61, 82, 5, 35, 0, 0, 62, 63, 10,
|
|
11, 0, 0, 63, 64, 7, 8, 0, 0, 64, 65, 5, 3, 0, 0, 65, 70, 3, 0, 0, 0, 66,
|
|
67, 5, 4, 0, 0, 67, 69, 3, 0, 0, 0, 68, 66, 1, 0, 0, 0, 69, 72, 1, 0, 0,
|
|
0, 70, 68, 1, 0, 0, 0, 70, 71, 1, 0, 0, 0, 71, 74, 1, 0, 0, 0, 72, 70,
|
|
1, 0, 0, 0, 73, 75, 5, 4, 0, 0, 74, 73, 1, 0, 0, 0, 74, 75, 1, 0, 0, 0,
|
|
75, 76, 1, 0, 0, 0, 76, 77, 5, 5, 0, 0, 77, 82, 1, 0, 0, 0, 78, 79, 10,
|
|
10, 0, 0, 79, 80, 7, 8, 0, 0, 80, 82, 5, 30, 0, 0, 81, 16, 1, 0, 0, 0,
|
|
81, 19, 1, 0, 0, 0, 81, 22, 1, 0, 0, 0, 81, 25, 1, 0, 0, 0, 81, 28, 1,
|
|
0, 0, 0, 81, 33, 1, 0, 0, 0, 81, 38, 1, 0, 0, 0, 81, 41, 1, 0, 0, 0, 81,
|
|
44, 1, 0, 0, 0, 81, 47, 1, 0, 0, 0, 81, 50, 1, 0, 0, 0, 81, 53, 1, 0, 0,
|
|
0, 81, 56, 1, 0, 0, 0, 81, 59, 1, 0, 0, 0, 81, 62, 1, 0, 0, 0, 81, 78,
|
|
1, 0, 0, 0, 82, 85, 1, 0, 0, 0, 83, 81, 1, 0, 0, 0, 83, 84, 1, 0, 0, 0,
|
|
84, 1, 1, 0, 0, 0, 85, 83, 1, 0, 0, 0, 5, 14, 70, 74, 81, 83,
|
|
}
|
|
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 = "java-escape"
|
|
|
|
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
|
|
PlanParserADD = 13
|
|
PlanParserSUB = 14
|
|
PlanParserMUL = 15
|
|
PlanParserDIV = 16
|
|
PlanParserMOD = 17
|
|
PlanParserPOW = 18
|
|
PlanParserSHL = 19
|
|
PlanParserSHR = 20
|
|
PlanParserBAND = 21
|
|
PlanParserBOR = 22
|
|
PlanParserBXOR = 23
|
|
PlanParserAND = 24
|
|
PlanParserOR = 25
|
|
PlanParserBNOT = 26
|
|
PlanParserNOT = 27
|
|
PlanParserIN = 28
|
|
PlanParserNIN = 29
|
|
PlanParserEmptyTerm = 30
|
|
PlanParserBooleanConstant = 31
|
|
PlanParserIntegerConstant = 32
|
|
PlanParserFloatingConstant = 33
|
|
PlanParserIdentifier = 34
|
|
PlanParserStringLiteral = 35
|
|
PlanParserWhitespace = 36
|
|
PlanParserNewline = 37
|
|
)
|
|
|
|
// 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 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 {
|
|
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)
|
|
|
|
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 {
|
|
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) 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 {
|
|
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 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 {
|
|
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 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 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 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 {
|
|
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 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 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 {
|
|
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) 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 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 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 {
|
|
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) 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 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 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 {
|
|
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 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 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 {
|
|
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)
|
|
|
|
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 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 {
|
|
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 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 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 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 {
|
|
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 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 {
|
|
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 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 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 *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 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 {
|
|
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)
|
|
|
|
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 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 {
|
|
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) {
|
|
this := p
|
|
_ = this
|
|
|
|
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(14)
|
|
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 PlanParserT__0:
|
|
localctx = NewParensContext(p, localctx)
|
|
p.SetParserRuleContext(localctx)
|
|
_prevctx = localctx
|
|
{
|
|
p.SetState(8)
|
|
p.Match(PlanParserT__0)
|
|
}
|
|
{
|
|
p.SetState(9)
|
|
p.expr(0)
|
|
}
|
|
{
|
|
p.SetState(10)
|
|
p.Match(PlanParserT__1)
|
|
}
|
|
|
|
case PlanParserADD, PlanParserSUB, PlanParserBNOT, PlanParserNOT:
|
|
localctx = NewUnaryContext(p, localctx)
|
|
p.SetParserRuleContext(localctx)
|
|
_prevctx = localctx
|
|
{
|
|
p.SetState(12)
|
|
|
|
var _lt = p.GetTokenStream().LT(1)
|
|
|
|
localctx.(*UnaryContext).op = _lt
|
|
|
|
_la = p.GetTokenStream().LA(1)
|
|
|
|
if !((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&201351168) != 0) {
|
|
var _ri = p.GetErrorHandler().RecoverInline(p)
|
|
|
|
localctx.(*UnaryContext).op = _ri
|
|
} else {
|
|
p.GetErrorHandler().ReportMatch(p)
|
|
p.Consume()
|
|
}
|
|
}
|
|
{
|
|
p.SetState(13)
|
|
p.expr(15)
|
|
}
|
|
|
|
default:
|
|
panic(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil))
|
|
}
|
|
p.GetParserRuleContext().SetStop(p.GetTokenStream().LT(-1))
|
|
p.SetState(83)
|
|
p.GetErrorHandler().Sync(p)
|
|
_alt = p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 4, p.GetParserRuleContext())
|
|
|
|
for _alt != 2 && _alt != antlr.ATNInvalidAltNumber {
|
|
if _alt == 1 {
|
|
if p.GetParseListeners() != nil {
|
|
p.TriggerExitRuleEvent()
|
|
}
|
|
_prevctx = localctx
|
|
p.SetState(81)
|
|
p.GetErrorHandler().Sync(p)
|
|
switch p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 3, p.GetParserRuleContext()) {
|
|
case 1:
|
|
localctx = NewPowerContext(p, NewExprContext(p, _parentctx, _parentState))
|
|
p.PushNewRecursionContext(localctx, _startState, PlanParserRULE_expr)
|
|
p.SetState(16)
|
|
|
|
if !(p.Precpred(p.GetParserRuleContext(), 16)) {
|
|
panic(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 16)", ""))
|
|
}
|
|
{
|
|
p.SetState(17)
|
|
p.Match(PlanParserPOW)
|
|
}
|
|
{
|
|
p.SetState(18)
|
|
p.expr(17)
|
|
}
|
|
|
|
case 2:
|
|
localctx = NewMulDivModContext(p, NewExprContext(p, _parentctx, _parentState))
|
|
p.PushNewRecursionContext(localctx, _startState, PlanParserRULE_expr)
|
|
p.SetState(19)
|
|
|
|
if !(p.Precpred(p.GetParserRuleContext(), 14)) {
|
|
panic(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 14)", ""))
|
|
}
|
|
{
|
|
p.SetState(20)
|
|
|
|
var _lt = p.GetTokenStream().LT(1)
|
|
|
|
localctx.(*MulDivModContext).op = _lt
|
|
|
|
_la = p.GetTokenStream().LA(1)
|
|
|
|
if !((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&229376) != 0) {
|
|
var _ri = p.GetErrorHandler().RecoverInline(p)
|
|
|
|
localctx.(*MulDivModContext).op = _ri
|
|
} else {
|
|
p.GetErrorHandler().ReportMatch(p)
|
|
p.Consume()
|
|
}
|
|
}
|
|
{
|
|
p.SetState(21)
|
|
p.expr(15)
|
|
}
|
|
|
|
case 3:
|
|
localctx = NewAddSubContext(p, NewExprContext(p, _parentctx, _parentState))
|
|
p.PushNewRecursionContext(localctx, _startState, PlanParserRULE_expr)
|
|
p.SetState(22)
|
|
|
|
if !(p.Precpred(p.GetParserRuleContext(), 13)) {
|
|
panic(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 13)", ""))
|
|
}
|
|
{
|
|
p.SetState(23)
|
|
|
|
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(24)
|
|
p.expr(14)
|
|
}
|
|
|
|
case 4:
|
|
localctx = NewShiftContext(p, NewExprContext(p, _parentctx, _parentState))
|
|
p.PushNewRecursionContext(localctx, _startState, PlanParserRULE_expr)
|
|
p.SetState(25)
|
|
|
|
if !(p.Precpred(p.GetParserRuleContext(), 12)) {
|
|
panic(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 12)", ""))
|
|
}
|
|
{
|
|
p.SetState(26)
|
|
|
|
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(27)
|
|
p.expr(13)
|
|
}
|
|
|
|
case 5:
|
|
localctx = NewRangeContext(p, NewExprContext(p, _parentctx, _parentState))
|
|
p.PushNewRecursionContext(localctx, _startState, PlanParserRULE_expr)
|
|
p.SetState(28)
|
|
|
|
if !(p.Precpred(p.GetParserRuleContext(), 9)) {
|
|
panic(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 9)", ""))
|
|
}
|
|
{
|
|
p.SetState(29)
|
|
|
|
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(30)
|
|
p.Match(PlanParserIdentifier)
|
|
}
|
|
{
|
|
p.SetState(31)
|
|
|
|
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(32)
|
|
p.expr(10)
|
|
}
|
|
|
|
case 6:
|
|
localctx = NewReverseRangeContext(p, NewExprContext(p, _parentctx, _parentState))
|
|
p.PushNewRecursionContext(localctx, _startState, PlanParserRULE_expr)
|
|
p.SetState(33)
|
|
|
|
if !(p.Precpred(p.GetParserRuleContext(), 8)) {
|
|
panic(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 8)", ""))
|
|
}
|
|
{
|
|
p.SetState(34)
|
|
|
|
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(35)
|
|
p.Match(PlanParserIdentifier)
|
|
}
|
|
{
|
|
p.SetState(36)
|
|
|
|
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(37)
|
|
p.expr(9)
|
|
}
|
|
|
|
case 7:
|
|
localctx = NewRelationalContext(p, NewExprContext(p, _parentctx, _parentState))
|
|
p.PushNewRecursionContext(localctx, _startState, PlanParserRULE_expr)
|
|
p.SetState(38)
|
|
|
|
if !(p.Precpred(p.GetParserRuleContext(), 7)) {
|
|
panic(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 7)", ""))
|
|
}
|
|
{
|
|
p.SetState(39)
|
|
|
|
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(40)
|
|
p.expr(8)
|
|
}
|
|
|
|
case 8:
|
|
localctx = NewEqualityContext(p, NewExprContext(p, _parentctx, _parentState))
|
|
p.PushNewRecursionContext(localctx, _startState, PlanParserRULE_expr)
|
|
p.SetState(41)
|
|
|
|
if !(p.Precpred(p.GetParserRuleContext(), 6)) {
|
|
panic(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 6)", ""))
|
|
}
|
|
{
|
|
p.SetState(42)
|
|
|
|
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(43)
|
|
p.expr(7)
|
|
}
|
|
|
|
case 9:
|
|
localctx = NewBitAndContext(p, NewExprContext(p, _parentctx, _parentState))
|
|
p.PushNewRecursionContext(localctx, _startState, PlanParserRULE_expr)
|
|
p.SetState(44)
|
|
|
|
if !(p.Precpred(p.GetParserRuleContext(), 5)) {
|
|
panic(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 5)", ""))
|
|
}
|
|
{
|
|
p.SetState(45)
|
|
p.Match(PlanParserBAND)
|
|
}
|
|
{
|
|
p.SetState(46)
|
|
p.expr(6)
|
|
}
|
|
|
|
case 10:
|
|
localctx = NewBitXorContext(p, NewExprContext(p, _parentctx, _parentState))
|
|
p.PushNewRecursionContext(localctx, _startState, PlanParserRULE_expr)
|
|
p.SetState(47)
|
|
|
|
if !(p.Precpred(p.GetParserRuleContext(), 4)) {
|
|
panic(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 4)", ""))
|
|
}
|
|
{
|
|
p.SetState(48)
|
|
p.Match(PlanParserBXOR)
|
|
}
|
|
{
|
|
p.SetState(49)
|
|
p.expr(5)
|
|
}
|
|
|
|
case 11:
|
|
localctx = NewBitOrContext(p, NewExprContext(p, _parentctx, _parentState))
|
|
p.PushNewRecursionContext(localctx, _startState, PlanParserRULE_expr)
|
|
p.SetState(50)
|
|
|
|
if !(p.Precpred(p.GetParserRuleContext(), 3)) {
|
|
panic(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 3)", ""))
|
|
}
|
|
{
|
|
p.SetState(51)
|
|
p.Match(PlanParserBOR)
|
|
}
|
|
{
|
|
p.SetState(52)
|
|
p.expr(4)
|
|
}
|
|
|
|
case 12:
|
|
localctx = NewLogicalAndContext(p, NewExprContext(p, _parentctx, _parentState))
|
|
p.PushNewRecursionContext(localctx, _startState, PlanParserRULE_expr)
|
|
p.SetState(53)
|
|
|
|
if !(p.Precpred(p.GetParserRuleContext(), 2)) {
|
|
panic(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 2)", ""))
|
|
}
|
|
{
|
|
p.SetState(54)
|
|
p.Match(PlanParserAND)
|
|
}
|
|
{
|
|
p.SetState(55)
|
|
p.expr(3)
|
|
}
|
|
|
|
case 13:
|
|
localctx = NewLogicalOrContext(p, NewExprContext(p, _parentctx, _parentState))
|
|
p.PushNewRecursionContext(localctx, _startState, PlanParserRULE_expr)
|
|
p.SetState(56)
|
|
|
|
if !(p.Precpred(p.GetParserRuleContext(), 1)) {
|
|
panic(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 1)", ""))
|
|
}
|
|
{
|
|
p.SetState(57)
|
|
p.Match(PlanParserOR)
|
|
}
|
|
{
|
|
p.SetState(58)
|
|
p.expr(2)
|
|
}
|
|
|
|
case 14:
|
|
localctx = NewLikeContext(p, NewExprContext(p, _parentctx, _parentState))
|
|
p.PushNewRecursionContext(localctx, _startState, PlanParserRULE_expr)
|
|
p.SetState(59)
|
|
|
|
if !(p.Precpred(p.GetParserRuleContext(), 17)) {
|
|
panic(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 17)", ""))
|
|
}
|
|
{
|
|
p.SetState(60)
|
|
p.Match(PlanParserLIKE)
|
|
}
|
|
{
|
|
p.SetState(61)
|
|
p.Match(PlanParserStringLiteral)
|
|
}
|
|
|
|
case 15:
|
|
localctx = NewTermContext(p, NewExprContext(p, _parentctx, _parentState))
|
|
p.PushNewRecursionContext(localctx, _startState, PlanParserRULE_expr)
|
|
p.SetState(62)
|
|
|
|
if !(p.Precpred(p.GetParserRuleContext(), 11)) {
|
|
panic(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 11)", ""))
|
|
}
|
|
{
|
|
p.SetState(63)
|
|
|
|
var _lt = p.GetTokenStream().LT(1)
|
|
|
|
localctx.(*TermContext).op = _lt
|
|
|
|
_la = p.GetTokenStream().LA(1)
|
|
|
|
if !(_la == PlanParserIN || _la == PlanParserNIN) {
|
|
var _ri = p.GetErrorHandler().RecoverInline(p)
|
|
|
|
localctx.(*TermContext).op = _ri
|
|
} else {
|
|
p.GetErrorHandler().ReportMatch(p)
|
|
p.Consume()
|
|
}
|
|
}
|
|
|
|
{
|
|
p.SetState(64)
|
|
p.Match(PlanParserT__2)
|
|
}
|
|
{
|
|
p.SetState(65)
|
|
p.expr(0)
|
|
}
|
|
p.SetState(70)
|
|
p.GetErrorHandler().Sync(p)
|
|
_alt = p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 1, p.GetParserRuleContext())
|
|
|
|
for _alt != 2 && _alt != antlr.ATNInvalidAltNumber {
|
|
if _alt == 1 {
|
|
{
|
|
p.SetState(66)
|
|
p.Match(PlanParserT__3)
|
|
}
|
|
{
|
|
p.SetState(67)
|
|
p.expr(0)
|
|
}
|
|
|
|
}
|
|
p.SetState(72)
|
|
p.GetErrorHandler().Sync(p)
|
|
_alt = p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 1, p.GetParserRuleContext())
|
|
}
|
|
p.SetState(74)
|
|
p.GetErrorHandler().Sync(p)
|
|
_la = p.GetTokenStream().LA(1)
|
|
|
|
if _la == PlanParserT__3 {
|
|
{
|
|
p.SetState(73)
|
|
p.Match(PlanParserT__3)
|
|
}
|
|
|
|
}
|
|
{
|
|
p.SetState(76)
|
|
p.Match(PlanParserT__4)
|
|
}
|
|
|
|
case 16:
|
|
localctx = NewEmptyTermContext(p, NewExprContext(p, _parentctx, _parentState))
|
|
p.PushNewRecursionContext(localctx, _startState, PlanParserRULE_expr)
|
|
p.SetState(78)
|
|
|
|
if !(p.Precpred(p.GetParserRuleContext(), 10)) {
|
|
panic(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 10)", ""))
|
|
}
|
|
{
|
|
p.SetState(79)
|
|
|
|
var _lt = p.GetTokenStream().LT(1)
|
|
|
|
localctx.(*EmptyTermContext).op = _lt
|
|
|
|
_la = p.GetTokenStream().LA(1)
|
|
|
|
if !(_la == PlanParserIN || _la == PlanParserNIN) {
|
|
var _ri = p.GetErrorHandler().RecoverInline(p)
|
|
|
|
localctx.(*EmptyTermContext).op = _ri
|
|
} else {
|
|
p.GetErrorHandler().ReportMatch(p)
|
|
p.Consume()
|
|
}
|
|
}
|
|
{
|
|
p.SetState(80)
|
|
p.Match(PlanParserEmptyTerm)
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
p.SetState(85)
|
|
p.GetErrorHandler().Sync(p)
|
|
_alt = p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 4, p.GetParserRuleContext())
|
|
}
|
|
|
|
return localctx
|
|
}
|
|
|
|
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 {
|
|
this := p
|
|
_ = this
|
|
|
|
switch predIndex {
|
|
case 0:
|
|
return p.Precpred(p.GetParserRuleContext(), 16)
|
|
|
|
case 1:
|
|
return p.Precpred(p.GetParserRuleContext(), 14)
|
|
|
|
case 2:
|
|
return p.Precpred(p.GetParserRuleContext(), 13)
|
|
|
|
case 3:
|
|
return p.Precpred(p.GetParserRuleContext(), 12)
|
|
|
|
case 4:
|
|
return p.Precpred(p.GetParserRuleContext(), 9)
|
|
|
|
case 5:
|
|
return p.Precpred(p.GetParserRuleContext(), 8)
|
|
|
|
case 6:
|
|
return p.Precpred(p.GetParserRuleContext(), 7)
|
|
|
|
case 7:
|
|
return p.Precpred(p.GetParserRuleContext(), 6)
|
|
|
|
case 8:
|
|
return p.Precpred(p.GetParserRuleContext(), 5)
|
|
|
|
case 9:
|
|
return p.Precpred(p.GetParserRuleContext(), 4)
|
|
|
|
case 10:
|
|
return p.Precpred(p.GetParserRuleContext(), 3)
|
|
|
|
case 11:
|
|
return p.Precpred(p.GetParserRuleContext(), 2)
|
|
|
|
case 12:
|
|
return p.Precpred(p.GetParserRuleContext(), 1)
|
|
|
|
case 13:
|
|
return p.Precpred(p.GetParserRuleContext(), 17)
|
|
|
|
case 14:
|
|
return p.Precpred(p.GetParserRuleContext(), 11)
|
|
|
|
case 15:
|
|
return p.Precpred(p.GetParserRuleContext(), 10)
|
|
|
|
default:
|
|
panic("No predicate with index: " + fmt.Sprint(predIndex))
|
|
}
|
|
}
|