in shardingsphere-operator/pkg/distsql/visitor_parser/shadow/rdlstatement_parser.go [2445:2514]
func (p *RDLStatementParser) Literal() (localctx ILiteralContext) {
localctx = NewLiteralContext(p, p.GetParserRuleContext(), p.GetState())
p.EnterRule(localctx, 30, RDLStatementParserRULE_literal)
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.SetState(175)
p.GetErrorHandler().Sync(p)
switch p.GetTokenStream().LA(1) {
case RDLStatementParserSTRING_:
p.EnterOuterAlt(localctx, 1)
{
p.SetState(168)
p.Match(RDLStatementParserSTRING_)
}
case RDLStatementParserMINUS_, RDLStatementParserINT_:
p.EnterOuterAlt(localctx, 2)
p.SetState(170)
p.GetErrorHandler().Sync(p)
_la = p.GetTokenStream().LA(1)
if _la == RDLStatementParserMINUS_ {
{
p.SetState(169)
p.Match(RDLStatementParserMINUS_)
}
}
{
p.SetState(172)
p.Match(RDLStatementParserINT_)
}
case RDLStatementParserTRUE:
p.EnterOuterAlt(localctx, 3)
{
p.SetState(173)
p.Match(RDLStatementParserTRUE)
}
case RDLStatementParserFALSE:
p.EnterOuterAlt(localctx, 4)
{
p.SetState(174)
p.Match(RDLStatementParserFALSE)
}
default:
panic(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil))
}
return localctx
}