func()

in shardingsphere-operator/pkg/distsql/visitor_parser/sharding/rdlstatement_parser.go [2678:2747]


func (p *RDLStatementParser) DropDefaultShardingStrategy() (localctx IDropDefaultShardingStrategyContext) {
	localctx = NewDropDefaultShardingStrategyContext(p, p.GetParserRuleContext(), p.GetState())
	p.EnterRule(localctx, 22, RDLStatementParserRULE_dropDefaultShardingStrategy)
	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(262)
		p.Match(RDLStatementParserDROP)
	}
	{
		p.SetState(263)
		p.Match(RDLStatementParserDEFAULT)
	}
	{
		p.SetState(264)
		p.Match(RDLStatementParserSHARDING)
	}
	{
		p.SetState(265)

		var _lt = p.GetTokenStream().LT(1)

		localctx.(*DropDefaultShardingStrategyContext).typ = _lt

		_la = p.GetTokenStream().LA(1)

		if !(_la == RDLStatementParserTABLE || _la == RDLStatementParserDATABASE) {
			var _ri = p.GetErrorHandler().RecoverInline(p)

			localctx.(*DropDefaultShardingStrategyContext).typ = _ri
		} else {
			p.GetErrorHandler().ReportMatch(p)
			p.Consume()
		}
	}
	{
		p.SetState(266)
		p.Match(RDLStatementParserSTRATEGY)
	}
	p.SetState(268)
	p.GetErrorHandler().Sync(p)
	_la = p.GetTokenStream().LA(1)

	if _la == RDLStatementParserIF {
		{
			p.SetState(267)
			p.IfExists()
		}

	}

	return localctx
}