in shardingsphere-operator/pkg/distsql/visitor_parser/sharding/rdlstatement_parser.go [2313:2394]
func (p *RDLStatementParser) CreateDefaultShardingStrategy() (localctx ICreateDefaultShardingStrategyContext) {
localctx = NewCreateDefaultShardingStrategyContext(p, p.GetParserRuleContext(), p.GetState())
p.EnterRule(localctx, 18, RDLStatementParserRULE_createDefaultShardingStrategy)
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(241)
p.Match(RDLStatementParserCREATE)
}
{
p.SetState(242)
p.Match(RDLStatementParserDEFAULT)
}
{
p.SetState(243)
p.Match(RDLStatementParserSHARDING)
}
{
p.SetState(244)
var _lt = p.GetTokenStream().LT(1)
localctx.(*CreateDefaultShardingStrategyContext).typ = _lt
_la = p.GetTokenStream().LA(1)
if !(_la == RDLStatementParserTABLE || _la == RDLStatementParserDATABASE) {
var _ri = p.GetErrorHandler().RecoverInline(p)
localctx.(*CreateDefaultShardingStrategyContext).typ = _ri
} else {
p.GetErrorHandler().ReportMatch(p)
p.Consume()
}
}
{
p.SetState(245)
p.Match(RDLStatementParserSTRATEGY)
}
p.SetState(247)
p.GetErrorHandler().Sync(p)
_la = p.GetTokenStream().LA(1)
if _la == RDLStatementParserIF {
{
p.SetState(246)
p.IfNotExists()
}
}
{
p.SetState(249)
p.Match(RDLStatementParserLP_)
}
{
p.SetState(250)
p.ShardingStrategy()
}
{
p.SetState(251)
p.Match(RDLStatementParserRP_)
}
return localctx
}