MCPcopy
hub / github.com/sqlc-dev/sqlc / Attach_stmt

Method Attach_stmt

internal/engine/sqlite/parser/sqlite_parser.go:3399–3455  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3397}
3398
3399func (p *SQLiteParser) Attach_stmt() (localctx IAttach_stmtContext) {
3400 localctx = NewAttach_stmtContext(p, p.GetParserRuleContext(), p.GetState())
3401 p.EnterRule(localctx, 10, SQLiteParserRULE_attach_stmt)
3402 p.EnterOuterAlt(localctx, 1)
3403 {
3404 p.SetState(337)
3405 p.Match(SQLiteParserATTACH_)
3406 if p.HasError() {
3407 // Recognition error - abort rule
3408 goto errorExit
3409 }
3410 }
3411 p.SetState(339)
3412 p.GetErrorHandler().Sync(p)
3413
3414 if p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 16, p.GetParserRuleContext()) == 1 {
3415 {
3416 p.SetState(338)
3417 p.Match(SQLiteParserDATABASE_)
3418 if p.HasError() {
3419 // Recognition error - abort rule
3420 goto errorExit
3421 }
3422 }
3423
3424 } else if p.HasError() { // JIM
3425 goto errorExit
3426 }
3427 {
3428 p.SetState(341)
3429 p.expr(0)
3430 }
3431 {
3432 p.SetState(342)
3433 p.Match(SQLiteParserAS_)
3434 if p.HasError() {
3435 // Recognition error - abort rule
3436 goto errorExit
3437 }
3438 }
3439 {
3440 p.SetState(343)
3441 p.Schema_name()
3442 }
3443
3444errorExit:
3445 if p.HasError() {
3446 v := p.GetError()
3447 localctx.SetException(v)
3448 p.GetErrorHandler().ReportError(p, v)
3449 p.GetErrorHandler().Recover(p, v)
3450 p.SetError(nil)
3451 }
3452 p.ExitRule()
3453 return localctx
3454 goto errorExit // Trick to prevent compiler error if the label is not used
3455}
3456

Callers 1

Sql_stmtMethod · 0.95

Calls 5

exprMethod · 0.95
Schema_nameMethod · 0.95
NewAttach_stmtContextFunction · 0.85
EnterRuleMethod · 0.45
ExitRuleMethod · 0.45

Tested by

no test coverage detected