()
| 1316 | } |
| 1317 | |
| 1318 | func (p *CommandsParser) Declare() (localctx IDeclareContext) { |
| 1319 | localctx = NewDeclareContext(p, p.GetParserRuleContext(), p.GetState()) |
| 1320 | p.EnterRule(localctx, 8, CommandsParserRULE_declare) |
| 1321 | p.EnterOuterAlt(localctx, 1) |
| 1322 | { |
| 1323 | p.SetState(101) |
| 1324 | p.Match(CommandsParserT__3) |
| 1325 | if p.HasError() { |
| 1326 | // Recognition error - abort rule |
| 1327 | goto errorExit |
| 1328 | } |
| 1329 | } |
| 1330 | p.SetState(104) |
| 1331 | p.GetErrorHandler().Sync(p) |
| 1332 | if p.HasError() { |
| 1333 | goto errorExit |
| 1334 | } |
| 1335 | |
| 1336 | switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 2, p.GetParserRuleContext()) { |
| 1337 | case 1: |
| 1338 | { |
| 1339 | p.SetState(102) |
| 1340 | |
| 1341 | var _x = p.VarDecl() |
| 1342 | |
| 1343 | localctx.(*DeclareContext).var_ = _x |
| 1344 | } |
| 1345 | |
| 1346 | case 2: |
| 1347 | { |
| 1348 | p.SetState(103) |
| 1349 | |
| 1350 | var _x = p.FnDecl() |
| 1351 | |
| 1352 | localctx.(*DeclareContext).fn = _x |
| 1353 | } |
| 1354 | |
| 1355 | case antlr.ATNInvalidAltNumber: |
| 1356 | goto errorExit |
| 1357 | } |
| 1358 | |
| 1359 | errorExit: |
| 1360 | if p.HasError() { |
| 1361 | v := p.GetError() |
| 1362 | localctx.SetException(v) |
| 1363 | p.GetErrorHandler().ReportError(p, v) |
| 1364 | p.GetErrorHandler().Recover(p, v) |
| 1365 | p.SetError(nil) |
| 1366 | } |
| 1367 | p.ExitRule() |
| 1368 | return localctx |
| 1369 | goto errorExit // Trick to prevent compiler error if the label is not used |
| 1370 | } |
| 1371 | |
| 1372 | // IVarDeclContext is an interface to support dynamic dispatch. |
| 1373 | type IVarDeclContext interface { |
no test coverage detected