@designliquido/delegua
Version:
Linguagem de programação simples e moderna usando português estruturado.
1,037 lines (1,036 loc) • 416 kB
JavaScript
"use strict";
// Generated from fontes\tradutores\python\Python3.g4 by ANTLR 4.9.0-SNAPSHOT
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.Except_clauseContext = exports.With_itemContext = exports.With_stmtContext = exports.Try_stmtContext = exports.For_stmtContext = exports.While_stmtContext = exports.If_stmtContext = exports.Async_stmtContext = exports.Compound_stmtContext = exports.Assert_stmtContext = exports.Nonlocal_stmtContext = exports.Global_stmtContext = exports.Dotted_nameContext = exports.Dotted_as_namesContext = exports.Import_as_namesContext = exports.Dotted_as_nameContext = exports.Import_as_nameContext = exports.Import_fromContext = exports.Import_nameContext = exports.Import_stmtContext = exports.Raise_stmtContext = exports.Yield_stmtContext = exports.Return_stmtContext = exports.Continue_stmtContext = exports.Break_stmtContext = exports.Flow_stmtContext = exports.Pass_stmtContext = exports.Del_stmtContext = exports.AugassignContext = exports.Testlist_star_exprContext = exports.AnnassignContext = exports.Simple_assignContext = exports.Expr_stmtContext = exports.Small_stmtContext = exports.Simple_stmtContext = exports.StmtContext = exports.VfpdefContext = exports.VarargslistContext = exports.TfpdefContext = exports.TypedargslistContext = exports.ParametersContext = exports.FuncdefContext = exports.Async_funcdefContext = exports.DecoratedContext = exports.DecoratorsContext = exports.DecoratorContext = exports.Eval_inputContext = exports.File_inputContext = exports.Single_inputContext = exports.Python3Parser = void 0;
exports.Yield_argContext = exports.Yield_exprContext = exports.Encoding_declContext = exports.Comp_ifContext = exports.Comp_forContext = exports.Comp_iterContext = exports.ArgumentContext = exports.ArglistContext = exports.ClassdefContext = exports.DictorsetmakerContext = exports.TestlistContext = exports.ExprlistContext = exports.SliceopContext = exports.SubscriptContext = exports.SubscriptlistContext = exports.TrailerContext = exports.Testlist_compContext = exports.AtomContext = exports.Atom_exprContext = exports.PowerContext = exports.FactorContext = exports.TermContext = exports.Arith_exprContext = exports.Shift_exprContext = exports.And_exprContext = exports.Xor_exprContext = exports.ExprContext = exports.Star_exprContext = exports.Comp_opContext = exports.ComparisonContext = exports.Not_testContext = exports.And_testContext = exports.Or_testContext = exports.Lambdef_nocondContext = exports.LambdefContext = exports.Test_nocondContext = exports.TestContext = exports.SuiteContext = void 0;
const ATN_1 = require("antlr4ts/atn/ATN");
const ATNDeserializer_1 = require("antlr4ts/atn/ATNDeserializer");
const FailedPredicateException_1 = require("antlr4ts/FailedPredicateException");
const NoViableAltException_1 = require("antlr4ts/NoViableAltException");
const Parser_1 = require("antlr4ts/Parser");
const ParserRuleContext_1 = require("antlr4ts/ParserRuleContext");
const ParserATNSimulator_1 = require("antlr4ts/atn/ParserATNSimulator");
const RecognitionException_1 = require("antlr4ts/RecognitionException");
const Token_1 = require("antlr4ts/Token");
const VocabularyImpl_1 = require("antlr4ts/VocabularyImpl");
const Utils = __importStar(require("antlr4ts/misc/Utils"));
class Python3Parser extends Parser_1.Parser {
// @Override
// @NotNull
get vocabulary() {
return Python3Parser.VOCABULARY;
}
// tslint:enable:no-trailing-whitespace
// @Override
get grammarFileName() {
return 'Python3.g4';
}
// @Override
get ruleNames() {
return Python3Parser.ruleNames;
}
// @Override
get serializedATN() {
return Python3Parser._serializedATN;
}
createFailedPredicateException(predicate, message) {
return new FailedPredicateException_1.FailedPredicateException(this, predicate, message);
}
constructor(input) {
super(input);
this._interp = new ParserATNSimulator_1.ParserATNSimulator(Python3Parser._ATN, this);
}
// @RuleVersion(0)
single_input() {
let _localctx = new Single_inputContext(this._ctx, this.state);
this.enterRule(_localctx, 0, Python3Parser.RULE_single_input);
try {
this.state = 179;
this._errHandler.sync(this);
switch (this._input.LA(1)) {
case Python3Parser.NEWLINE:
this.enterOuterAlt(_localctx, 1);
{
this.state = 174;
this.match(Python3Parser.NEWLINE);
}
break;
case Python3Parser.STRING:
case Python3Parser.NUMBER:
case Python3Parser.RETURN:
case Python3Parser.RAISE:
case Python3Parser.FROM:
case Python3Parser.IMPORT:
case Python3Parser.GLOBAL:
case Python3Parser.NONLOCAL:
case Python3Parser.ASSERT:
case Python3Parser.LAMBDA:
case Python3Parser.NOT:
case Python3Parser.NONE:
case Python3Parser.TRUE:
case Python3Parser.FALSE:
case Python3Parser.YIELD:
case Python3Parser.DEL:
case Python3Parser.PASS:
case Python3Parser.CONTINUE:
case Python3Parser.BREAK:
case Python3Parser.AWAIT:
case Python3Parser.NAME:
case Python3Parser.ELLIPSIS:
case Python3Parser.STAR:
case Python3Parser.OPEN_PAREN:
case Python3Parser.OPEN_BRACK:
case Python3Parser.ADD:
case Python3Parser.MINUS:
case Python3Parser.NOT_OP:
case Python3Parser.OPEN_BRACE:
this.enterOuterAlt(_localctx, 2);
{
this.state = 175;
this.simple_stmt();
}
break;
case Python3Parser.DEF:
case Python3Parser.IF:
case Python3Parser.WHILE:
case Python3Parser.FOR:
case Python3Parser.TRY:
case Python3Parser.WITH:
case Python3Parser.CLASS:
case Python3Parser.ASYNC:
case Python3Parser.AT:
this.enterOuterAlt(_localctx, 3);
{
this.state = 176;
this.compound_stmt();
this.state = 177;
this.match(Python3Parser.NEWLINE);
}
break;
default:
throw new NoViableAltException_1.NoViableAltException(this);
}
}
catch (re) {
if (re instanceof RecognitionException_1.RecognitionException) {
_localctx.exception = re;
this._errHandler.reportError(this, re);
this._errHandler.recover(this, re);
}
else {
throw re;
}
}
finally {
this.exitRule();
}
return _localctx;
}
// @RuleVersion(0)
file_input() {
let _localctx = new File_inputContext(this._ctx, this.state);
this.enterRule(_localctx, 2, Python3Parser.RULE_file_input);
let _la;
try {
this.enterOuterAlt(_localctx, 1);
{
this.state = 185;
this._errHandler.sync(this);
_la = this._input.LA(1);
while (((_la & ~0x1f) === 0 &&
((1 << _la) &
((1 << Python3Parser.STRING) |
(1 << Python3Parser.NUMBER) |
(1 << Python3Parser.DEF) |
(1 << Python3Parser.RETURN) |
(1 << Python3Parser.RAISE) |
(1 << Python3Parser.FROM) |
(1 << Python3Parser.IMPORT) |
(1 << Python3Parser.GLOBAL) |
(1 << Python3Parser.NONLOCAL) |
(1 << Python3Parser.ASSERT) |
(1 << Python3Parser.IF) |
(1 << Python3Parser.WHILE) |
(1 << Python3Parser.FOR) |
(1 << Python3Parser.TRY) |
(1 << Python3Parser.WITH) |
(1 << Python3Parser.LAMBDA) |
(1 << Python3Parser.NOT) |
(1 << Python3Parser.NONE) |
(1 << Python3Parser.TRUE) |
(1 << Python3Parser.FALSE) |
(1 << Python3Parser.CLASS))) !==
0) ||
(((_la - 32) & ~0x1f) === 0 &&
((1 << (_la - 32)) &
((1 << (Python3Parser.YIELD - 32)) |
(1 << (Python3Parser.DEL - 32)) |
(1 << (Python3Parser.PASS - 32)) |
(1 << (Python3Parser.CONTINUE - 32)) |
(1 << (Python3Parser.BREAK - 32)) |
(1 << (Python3Parser.ASYNC - 32)) |
(1 << (Python3Parser.AWAIT - 32)) |
(1 << (Python3Parser.NEWLINE - 32)) |
(1 << (Python3Parser.NAME - 32)) |
(1 << (Python3Parser.ELLIPSIS - 32)) |
(1 << (Python3Parser.STAR - 32)) |
(1 << (Python3Parser.OPEN_PAREN - 32)) |
(1 << (Python3Parser.OPEN_BRACK - 32)))) !==
0) ||
(((_la - 66) & ~0x1f) === 0 &&
((1 << (_la - 66)) &
((1 << (Python3Parser.ADD - 66)) |
(1 << (Python3Parser.MINUS - 66)) |
(1 << (Python3Parser.NOT_OP - 66)) |
(1 << (Python3Parser.OPEN_BRACE - 66)) |
(1 << (Python3Parser.AT - 66)))) !==
0)) {
{
this.state = 183;
this._errHandler.sync(this);
switch (this._input.LA(1)) {
case Python3Parser.NEWLINE:
{
this.state = 181;
this.match(Python3Parser.NEWLINE);
}
break;
case Python3Parser.STRING:
case Python3Parser.NUMBER:
case Python3Parser.DEF:
case Python3Parser.RETURN:
case Python3Parser.RAISE:
case Python3Parser.FROM:
case Python3Parser.IMPORT:
case Python3Parser.GLOBAL:
case Python3Parser.NONLOCAL:
case Python3Parser.ASSERT:
case Python3Parser.IF:
case Python3Parser.WHILE:
case Python3Parser.FOR:
case Python3Parser.TRY:
case Python3Parser.WITH:
case Python3Parser.LAMBDA:
case Python3Parser.NOT:
case Python3Parser.NONE:
case Python3Parser.TRUE:
case Python3Parser.FALSE:
case Python3Parser.CLASS:
case Python3Parser.YIELD:
case Python3Parser.DEL:
case Python3Parser.PASS:
case Python3Parser.CONTINUE:
case Python3Parser.BREAK:
case Python3Parser.ASYNC:
case Python3Parser.AWAIT:
case Python3Parser.NAME:
case Python3Parser.ELLIPSIS:
case Python3Parser.STAR:
case Python3Parser.OPEN_PAREN:
case Python3Parser.OPEN_BRACK:
case Python3Parser.ADD:
case Python3Parser.MINUS:
case Python3Parser.NOT_OP:
case Python3Parser.OPEN_BRACE:
case Python3Parser.AT:
{
this.state = 182;
this.stmt();
}
break;
default:
throw new NoViableAltException_1.NoViableAltException(this);
}
}
this.state = 187;
this._errHandler.sync(this);
_la = this._input.LA(1);
}
this.state = 188;
this.match(Python3Parser.EOF);
}
}
catch (re) {
if (re instanceof RecognitionException_1.RecognitionException) {
_localctx.exception = re;
this._errHandler.reportError(this, re);
this._errHandler.recover(this, re);
}
else {
throw re;
}
}
finally {
this.exitRule();
}
return _localctx;
}
// @RuleVersion(0)
eval_input() {
let _localctx = new Eval_inputContext(this._ctx, this.state);
this.enterRule(_localctx, 4, Python3Parser.RULE_eval_input);
let _la;
try {
this.enterOuterAlt(_localctx, 1);
{
this.state = 190;
this.testlist();
this.state = 194;
this._errHandler.sync(this);
_la = this._input.LA(1);
while (_la === Python3Parser.NEWLINE) {
{
{
this.state = 191;
this.match(Python3Parser.NEWLINE);
}
}
this.state = 196;
this._errHandler.sync(this);
_la = this._input.LA(1);
}
this.state = 197;
this.match(Python3Parser.EOF);
}
}
catch (re) {
if (re instanceof RecognitionException_1.RecognitionException) {
_localctx.exception = re;
this._errHandler.reportError(this, re);
this._errHandler.recover(this, re);
}
else {
throw re;
}
}
finally {
this.exitRule();
}
return _localctx;
}
// @RuleVersion(0)
decorator() {
let _localctx = new DecoratorContext(this._ctx, this.state);
this.enterRule(_localctx, 6, Python3Parser.RULE_decorator);
let _la;
try {
this.enterOuterAlt(_localctx, 1);
{
this.state = 199;
this.match(Python3Parser.AT);
this.state = 200;
this.dotted_name();
this.state = 206;
this._errHandler.sync(this);
_la = this._input.LA(1);
if (_la === Python3Parser.OPEN_PAREN) {
{
this.state = 201;
this.match(Python3Parser.OPEN_PAREN);
this.state = 203;
this._errHandler.sync(this);
_la = this._input.LA(1);
if (((_la & ~0x1f) === 0 &&
((1 << _la) &
((1 << Python3Parser.STRING) |
(1 << Python3Parser.NUMBER) |
(1 << Python3Parser.LAMBDA) |
(1 << Python3Parser.NOT) |
(1 << Python3Parser.NONE) |
(1 << Python3Parser.TRUE) |
(1 << Python3Parser.FALSE))) !==
0) ||
(((_la - 38) & ~0x1f) === 0 &&
((1 << (_la - 38)) &
((1 << (Python3Parser.AWAIT - 38)) |
(1 << (Python3Parser.NAME - 38)) |
(1 << (Python3Parser.ELLIPSIS - 38)) |
(1 << (Python3Parser.STAR - 38)) |
(1 << (Python3Parser.OPEN_PAREN - 38)) |
(1 << (Python3Parser.POWER - 38)) |
(1 << (Python3Parser.OPEN_BRACK - 38)) |
(1 << (Python3Parser.ADD - 38)) |
(1 << (Python3Parser.MINUS - 38)))) !==
0) ||
_la === Python3Parser.NOT_OP ||
_la === Python3Parser.OPEN_BRACE) {
{
this.state = 202;
this.arglist();
}
}
this.state = 205;
this.match(Python3Parser.CLOSE_PAREN);
}
}
this.state = 208;
this.match(Python3Parser.NEWLINE);
}
}
catch (re) {
if (re instanceof RecognitionException_1.RecognitionException) {
_localctx.exception = re;
this._errHandler.reportError(this, re);
this._errHandler.recover(this, re);
}
else {
throw re;
}
}
finally {
this.exitRule();
}
return _localctx;
}
// @RuleVersion(0)
decorators() {
let _localctx = new DecoratorsContext(this._ctx, this.state);
this.enterRule(_localctx, 8, Python3Parser.RULE_decorators);
let _la;
try {
this.enterOuterAlt(_localctx, 1);
{
this.state = 211;
this._errHandler.sync(this);
_la = this._input.LA(1);
do {
{
{
this.state = 210;
this.decorator();
}
}
this.state = 213;
this._errHandler.sync(this);
_la = this._input.LA(1);
} while (_la === Python3Parser.AT);
}
}
catch (re) {
if (re instanceof RecognitionException_1.RecognitionException) {
_localctx.exception = re;
this._errHandler.reportError(this, re);
this._errHandler.recover(this, re);
}
else {
throw re;
}
}
finally {
this.exitRule();
}
return _localctx;
}
// @RuleVersion(0)
decorated() {
let _localctx = new DecoratedContext(this._ctx, this.state);
this.enterRule(_localctx, 10, Python3Parser.RULE_decorated);
try {
this.enterOuterAlt(_localctx, 1);
{
this.state = 215;
this.decorators();
this.state = 219;
this._errHandler.sync(this);
switch (this._input.LA(1)) {
case Python3Parser.CLASS:
{
this.state = 216;
this.classdef();
}
break;
case Python3Parser.DEF:
{
this.state = 217;
this.funcdef();
}
break;
case Python3Parser.ASYNC:
{
this.state = 218;
this.async_funcdef();
}
break;
default:
throw new NoViableAltException_1.NoViableAltException(this);
}
}
}
catch (re) {
if (re instanceof RecognitionException_1.RecognitionException) {
_localctx.exception = re;
this._errHandler.reportError(this, re);
this._errHandler.recover(this, re);
}
else {
throw re;
}
}
finally {
this.exitRule();
}
return _localctx;
}
// @RuleVersion(0)
async_funcdef() {
let _localctx = new Async_funcdefContext(this._ctx, this.state);
this.enterRule(_localctx, 12, Python3Parser.RULE_async_funcdef);
try {
this.enterOuterAlt(_localctx, 1);
{
this.state = 221;
this.match(Python3Parser.ASYNC);
this.state = 222;
this.funcdef();
}
}
catch (re) {
if (re instanceof RecognitionException_1.RecognitionException) {
_localctx.exception = re;
this._errHandler.reportError(this, re);
this._errHandler.recover(this, re);
}
else {
throw re;
}
}
finally {
this.exitRule();
}
return _localctx;
}
// @RuleVersion(0)
funcdef() {
let _localctx = new FuncdefContext(this._ctx, this.state);
this.enterRule(_localctx, 14, Python3Parser.RULE_funcdef);
let _la;
try {
this.enterOuterAlt(_localctx, 1);
{
this.state = 224;
this.match(Python3Parser.DEF);
this.state = 225;
this.match(Python3Parser.NAME);
this.state = 226;
this.parameters();
this.state = 229;
this._errHandler.sync(this);
_la = this._input.LA(1);
if (_la === Python3Parser.ARROW) {
{
this.state = 227;
this.match(Python3Parser.ARROW);
this.state = 228;
this.test();
}
}
this.state = 231;
this.match(Python3Parser.COLON);
this.state = 232;
this.suite();
}
}
catch (re) {
if (re instanceof RecognitionException_1.RecognitionException) {
_localctx.exception = re;
this._errHandler.reportError(this, re);
this._errHandler.recover(this, re);
}
else {
throw re;
}
}
finally {
this.exitRule();
}
return _localctx;
}
// @RuleVersion(0)
parameters() {
let _localctx = new ParametersContext(this._ctx, this.state);
this.enterRule(_localctx, 16, Python3Parser.RULE_parameters);
let _la;
try {
this.enterOuterAlt(_localctx, 1);
{
this.state = 234;
this.match(Python3Parser.OPEN_PAREN);
this.state = 236;
this._errHandler.sync(this);
_la = this._input.LA(1);
if (((_la - 40) & ~0x1f) === 0 &&
((1 << (_la - 40)) &
((1 << (Python3Parser.NAME - 40)) |
(1 << (Python3Parser.STAR - 40)) |
(1 << (Python3Parser.POWER - 40)))) !==
0) {
{
this.state = 235;
this.typedargslist();
}
}
this.state = 238;
this.match(Python3Parser.CLOSE_PAREN);
}
}
catch (re) {
if (re instanceof RecognitionException_1.RecognitionException) {
_localctx.exception = re;
this._errHandler.reportError(this, re);
this._errHandler.recover(this, re);
}
else {
throw re;
}
}
finally {
this.exitRule();
}
return _localctx;
}
// @RuleVersion(0)
typedargslist() {
let _localctx = new TypedargslistContext(this._ctx, this.state);
this.enterRule(_localctx, 18, Python3Parser.RULE_typedargslist);
let _la;
try {
let _alt;
this.enterOuterAlt(_localctx, 1);
{
this.state = 321;
this._errHandler.sync(this);
switch (this._input.LA(1)) {
case Python3Parser.NAME:
{
this.state = 240;
this.tfpdef();
this.state = 243;
this._errHandler.sync(this);
_la = this._input.LA(1);
if (_la === Python3Parser.ASSIGN) {
{
this.state = 241;
this.match(Python3Parser.ASSIGN);
this.state = 242;
this.test();
}
}
this.state = 253;
this._errHandler.sync(this);
_alt = this.interpreter.adaptivePredict(this._input, 12, this._ctx);
while (_alt !== 2 && _alt !== ATN_1.ATN.INVALID_ALT_NUMBER) {
if (_alt === 1) {
{
{
this.state = 245;
this.match(Python3Parser.COMMA);
this.state = 246;
this.tfpdef();
this.state = 249;
this._errHandler.sync(this);
_la = this._input.LA(1);
if (_la === Python3Parser.ASSIGN) {
{
this.state = 247;
this.match(Python3Parser.ASSIGN);
this.state = 248;
this.test();
}
}
}
}
}
this.state = 255;
this._errHandler.sync(this);
_alt = this.interpreter.adaptivePredict(this._input, 12, this._ctx);
}
this.state = 289;
this._errHandler.sync(this);
_la = this._input.LA(1);
if (_la === Python3Parser.COMMA) {
{
this.state = 256;
this.match(Python3Parser.COMMA);
this.state = 287;
this._errHandler.sync(this);
switch (this._input.LA(1)) {
case Python3Parser.STAR:
{
this.state = 257;
this.match(Python3Parser.STAR);
this.state = 259;
this._errHandler.sync(this);
_la = this._input.LA(1);
if (_la === Python3Parser.NAME) {
{
this.state = 258;
this.tfpdef();
}
}
this.state = 269;
this._errHandler.sync(this);
_alt = this.interpreter.adaptivePredict(this._input, 15, this._ctx);
while (_alt !== 2 &&
_alt !== ATN_1.ATN.INVALID_ALT_NUMBER) {
if (_alt === 1) {
{
{
this.state = 261;
this.match(Python3Parser.COMMA);
this.state = 262;
this.tfpdef();
this.state = 265;
this._errHandler.sync(this);
_la = this._input.LA(1);
if (_la === Python3Parser.ASSIGN) {
{
this.state = 263;
this.match(Python3Parser.ASSIGN);
this.state = 264;
this.test();
}
}
}
}
}
this.state = 271;
this._errHandler.sync(this);
_alt = this.interpreter.adaptivePredict(this._input, 15, this._ctx);
}
this.state = 280;
this._errHandler.sync(this);
_la = this._input.LA(1);
if (_la === Python3Parser.COMMA) {
{
this.state = 272;
this.match(Python3Parser.COMMA);
this.state = 278;
this._errHandler.sync(this);
_la = this._input.LA(1);
if (_la === Python3Parser.POWER) {
{
this.state = 273;
this.match(Python3Parser.POWER);
this.state = 274;
this.tfpdef();
this.state = 276;
this._errHandler.sync(this);
_la = this._input.LA(1);
if (_la === Python3Parser.COMMA) {
{
this.state = 275;
this.match(Python3Parser.COMMA);
}
}
}
}
}
}
}
break;
case Python3Parser.POWER:
{
this.state = 282;
this.match(Python3Parser.POWER);
this.state = 283;
this.tfpdef();
this.state = 285;
this._errHandler.sync(this);
_la = this._input.LA(1);
if (_la === Python3Parser.COMMA) {
{
this.state = 284;
this.match(Python3Parser.COMMA);
}
}
}
break;
case Python3Parser.CLOSE_PAREN:
break;
default:
break;
}
}
}
}
break;
case Python3Parser.STAR:
{
this.state = 291;
this.match(Python3Parser.STAR);
this.state = 293;
this._errHandler.sync(this);
_la = this._input.LA(1);
if (_la === Python3Parser.NAME) {
{
this.state = 292;
this.tfpdef();
}
}
this.state = 303;
this._errHandler.sync(this);
_alt = this.interpreter.adaptivePredict(this._input, 24, this._ctx);
while (_alt !== 2 && _alt !== ATN_1.ATN.INVALID_ALT_NUMBER) {
if (_alt === 1) {
{
{
this.state = 295;
this.match(Python3Parser.COMMA);
this.state = 296;
this.tfpdef();
this.state = 299;
this._errHandler.sync(this);
_la = this._input.LA(1);
if (_la === Python3Parser.ASSIGN) {
{
this.state = 297;
this.match(Python3Parser.ASSIGN);
this.state = 298;
this.test();
}
}
}
}
}
this.state = 305;
this._errHandler.sync(this);
_alt = this.interpreter.adaptivePredict(this._input, 24, this._ctx);
}
this.state = 314;
this._errHandler.sync(this);
_la = this._input.LA(1);
if (_la === Python3Parser.COMMA) {
{
this.state = 306;
this.match(Python3Parser.COMMA);
this.state = 312;
this._errHandler.sync(this);
_la = this._input.LA(1);
if (_la === Python3Parser.POWER) {
{
this.state = 307;
this.match(Python3Parser.POWER);
this.state = 308;
this.tfpdef();
this.state = 310;
this._errHandler.sync(this);
_la = this._input.LA(1);
if (_la === Python3Parser.COMMA) {
{
this.state = 309;
this.match(Python3Parser.COMMA);
}
}
}
}
}
}
}
break;
case Python3Parser.POWER:
{
this.state = 316;
this.match(Python3Parser.POWER);
this.state = 317;
this.tfpdef();
this.state = 319;
this._errHandler.sync(this);
_la = this._input.LA(1);
if (_la === Python3Parser.COMMA) {
{
this.state = 318;
this.match(Python3Parser.COMMA);
}
}
}
break;
default:
throw new NoViableAltException_1.NoViableAltException(this);
}
}
}
catch (re) {
if (re instanceof RecognitionException_1.RecognitionException) {
_localctx.exception = re;
this._errHandler.reportError(this, re);
this._errHandler.recover(this, re);
}
else {
throw re;
}
}
finally {
this.exitRule();
}
return _localctx;
}
// @RuleVersion(0)
tfpdef() {
let _localctx = new TfpdefContext(this._ctx, this.state);
this.enterRule(_localctx, 20, Python3Parser.RULE_tfpdef);
let _la;
try {
this.enterOuterAlt(_localctx, 1);
{
this.state = 323;
this.match(Python3Parser.NAME);
this.state = 326;
this._errHandler.sync(this);
_la = this._input.LA(1);
if (_la === Python3Parser.COLON) {
{
this.state = 324;
this.match(Python3Parser.COLON);
this.state = 325;
this.test();
}
}
}
}
catch (re) {
if (re instanceof RecognitionException_1.RecognitionException) {
_localctx.exception = re;
this._errHandler.reportError(this, re);
this._errHandler.recover(this, re);
}
else {
throw re;
}
}
finally {
this.exitRule();
}
return _localctx;
}
// @RuleVersion(0)
varargslist() {
let _localctx = new VarargslistContext(this._ctx, this.state);
this.enterRule(_localctx, 22, Python3Parser.RULE_varargslist);
let _la;
try {
let _alt;
this.enterOuterAlt(_localctx, 1);
{
this.state = 409;
this._errHandler.sync(this);
switch (this._input.LA(1)) {
case Python3Parser.NAME:
{
this.state = 328;
this.vfpdef();
this.state = 331;
this._errHandler.sync(this);
_la = this._input.LA(1);
if (_la === Python3Parser.ASSIGN) {
{
this.state = 329;
this.match(Python3Parser.ASSIGN);
this.state = 330;
this.test();
}
}
this.state = 341;
this._errHandler.sync(this);
_alt = this.interpreter.adaptivePredict(this._input, 33, this._ctx);
while (_alt !== 2 && _alt !== ATN_1.ATN.INVALID_ALT_NUMBER) {
if (_alt === 1) {
{
{
this.state = 333;
this.match(Python3Parser.COMMA);
this.state = 334;
this.vfpdef();
this.state = 337;
this._errHandler.sync(this);
_la = this._input.LA(1);
if (_la === Python3Parser.ASSIGN) {
{
this.state = 335;
this.match(Python3Parser.ASSIGN);
this.state = 336;
this.test();
}
}
}
}
}
this.state = 343;
this._errHandler.sync(this);
_alt = this.interpreter.adaptivePredict(this._input, 33, this._ctx);
}
this.state = 377;
this._errHandler.sync(this);
_la = this._input.LA(1);
if (_la === Python3Parser.COMMA) {
{
this.state = 344;
this.match(Python3Parser.COMMA);
this.state = 375;
this._errHandler.sync(this);
switch (this._input.LA(1)) {
case Python3Parser.STAR:
{
this.state = 345;
this.match(Python3Parser.STAR);
this.state = 347;
this._errHandler.sync(this);
_la = this._input.LA(1);
if (_la === Python3Parser.NAME) {
{
this.state = 346;
this.vfpdef();
}
}
this.state = 357;
this._errHandler.sync(this);
_alt = this.interpreter.adaptivePredict(this._input, 36, this._ctx);
while (_alt !== 2 &&
_alt !== ATN_1.ATN.INVALID_ALT_NUMBER) {
if (_alt === 1) {
{
{
this.state = 349;
this.match(Python3Parser.COMMA);
this.state = 350;
this.vfpdef();
this.state = 353;
this._errHandler.sync(this);
_la = this._input.LA(1);
if (_la === Python3Parser.ASSIGN) {
{
this.state = 351;
this.match(Python3Parser.ASSIGN);
this.state = 352;