in shardingsphere-operator/pkg/distsql/visitor_parser/sharding/rdlstatement_parser.go [5205:5270]
func (p *RDLStatementParser) ShardingStrategy() (localctx IShardingStrategyContext) {
localctx = NewShardingStrategyContext(p, p.GetParserRuleContext(), p.GetState())
p.EnterRule(localctx, 58, RDLStatementParserRULE_shardingStrategy)
var _la int
defer func() {
p.ExitRule()
}()
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)
}
}
}()
p.EnterOuterAlt(localctx, 1)
{
p.SetState(405)
p.Match(RDLStatementParserTYPE)
}
{
p.SetState(406)
p.Match(RDLStatementParserEQ_)
}
{
p.SetState(407)
p.StrategyType()
}
p.SetState(414)
p.GetErrorHandler().Sync(p)
_la = p.GetTokenStream().LA(1)
if _la == RDLStatementParserCOMMA_ {
p.SetState(410)
p.GetErrorHandler().Sync(p)
if p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 33, p.GetParserRuleContext()) == 1 {
{
p.SetState(408)
p.Match(RDLStatementParserCOMMA_)
}
{
p.SetState(409)
p.ShardingColumnDefinition()
}
}
{
p.SetState(412)
p.Match(RDLStatementParserCOMMA_)
}
{
p.SetState(413)
p.ShardingAlgorithm()
}
}
return localctx
}