@amplitude/ampli
Version:
Amplitude CLI
1,294 lines • 321 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.EosContext = exports.ReceiverTypeContext = exports.MethodExprContext = exports.ArgumentsContext = exports.TypeAssertionContext = exports.Slice_Context = exports.IndexContext = exports.FunctionLitContext = exports.EmbeddedFieldContext = exports.String_Context = exports.FieldDeclContext = exports.StructTypeContext = exports.ElementContext = exports.KeyContext = exports.KeyedElementContext = exports.ElementListContext = exports.LiteralValueContext = exports.LiteralTypeContext = exports.CompositeLitContext = exports.QualifiedIdentContext = exports.OperandNameContext = exports.IntegerContext = exports.BasicLitContext = exports.LiteralContext = exports.OperandContext = exports.NonNamedTypeContext = exports.ConversionContext = exports.PrimaryExprContext = exports.ExpressionContext = exports.ParameterDeclContext = exports.ParametersContext = exports.ResultContext = exports.SignatureContext = exports.FunctionTypeContext = exports.MethodSpecContext = exports.ChannelTypeContext = exports.MapTypeContext = exports.SliceTypeContext = exports.InterfaceTypeContext = exports.PointerTypeContext = exports.ElementTypeContext = exports.ArrayLengthContext = exports.ArrayTypeContext = exports.TypeLitContext = exports.TypeNameContext = exports.Type_Context = exports.GoStmtContext = exports.RangeClauseContext = exports.ForClauseContext = exports.ForStmtContext = exports.RecvStmtContext = exports.CommCaseContext = exports.CommClauseContext = exports.SelectStmtContext = exports.TypeListContext = exports.TypeSwitchCaseContext = exports.TypeCaseClauseContext = exports.TypeSwitchGuardContext = exports.TypeSwitchStmtContext = exports.ExprSwitchCaseContext = exports.ExprCaseClauseContext = exports.ExprSwitchStmtContext = exports.SwitchStmtContext = exports.IfStmtContext = exports.DeferStmtContext = exports.FallthroughStmtContext = exports.GotoStmtContext = exports.ContinueStmtContext = exports.BreakStmtContext = exports.ReturnStmtContext = exports.LabeledStmtContext = exports.EmptyStmtContext = exports.ShortVarDeclContext = exports.Assign_opContext = exports.AssignmentContext = exports.IncDecStmtContext = exports.SendStmtContext = exports.ExpressionStmtContext = exports.SimpleStmtContext = exports.StatementContext = exports.StatementListContext = exports.BlockContext = exports.VarSpecContext = exports.VarDeclContext = exports.ReceiverContext = exports.MethodDeclContext = exports.FunctionDeclContext = exports.TypeSpecContext = exports.TypeDeclContext = exports.ExpressionListContext = exports.IdentifierListContext = exports.ConstSpecContext = exports.ConstDeclContext = exports.DeclarationContext = exports.ImportPathContext = exports.ImportSpecContext = exports.ImportDeclContext = exports.PackageClauseContext = exports.SourceFileContext = exports.GoParser = 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 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 = require("antlr4ts/misc/Utils");
const GoParserBase_1 = require("./GoParserBase");
class GoParser extends GoParserBase_1.GoParserBase {
constructor(input) {
super(input);
this._interp = new ParserATNSimulator_1.ParserATNSimulator(GoParser._ATN, this);
}
get vocabulary() {
return GoParser.VOCABULARY;
}
get grammarFileName() { return "GoParser.g4"; }
get ruleNames() { return GoParser.ruleNames; }
get serializedATN() { return GoParser._serializedATN; }
createFailedPredicateException(predicate, message) {
return new FailedPredicateException_1.FailedPredicateException(this, predicate, message);
}
sourceFile() {
let _localctx = new SourceFileContext(this._ctx, this.state);
this.enterRule(_localctx, 0, GoParser.RULE_sourceFile);
let _la;
try {
this.enterOuterAlt(_localctx, 1);
{
this.state = 198;
this.packageClause();
this.state = 199;
this.eos();
this.state = 205;
this._errHandler.sync(this);
_la = this._input.LA(1);
while (_la === GoParser.IMPORT) {
{
{
this.state = 200;
this.importDecl();
this.state = 201;
this.eos();
}
}
this.state = 207;
this._errHandler.sync(this);
_la = this._input.LA(1);
}
this.state = 217;
this._errHandler.sync(this);
_la = this._input.LA(1);
while ((((_la) & ~0x1F) === 0 && ((1 << _la) & ((1 << GoParser.FUNC) | (1 << GoParser.CONST) | (1 << GoParser.TYPE) | (1 << GoParser.VAR))) !== 0)) {
{
{
this.state = 211;
this._errHandler.sync(this);
switch (this.interpreter.adaptivePredict(this._input, 1, this._ctx)) {
case 1:
{
this.state = 208;
this.functionDecl();
}
break;
case 2:
{
this.state = 209;
this.methodDecl();
}
break;
case 3:
{
this.state = 210;
this.declaration();
}
break;
}
this.state = 213;
this.eos();
}
}
this.state = 219;
this._errHandler.sync(this);
_la = this._input.LA(1);
}
this.state = 220;
this.match(GoParser.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;
}
packageClause() {
let _localctx = new PackageClauseContext(this._ctx, this.state);
this.enterRule(_localctx, 2, GoParser.RULE_packageClause);
try {
this.enterOuterAlt(_localctx, 1);
{
this.state = 222;
this.match(GoParser.PACKAGE);
this.state = 223;
_localctx._packageName = this.match(GoParser.IDENTIFIER);
}
}
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;
}
importDecl() {
let _localctx = new ImportDeclContext(this._ctx, this.state);
this.enterRule(_localctx, 4, GoParser.RULE_importDecl);
let _la;
try {
this.enterOuterAlt(_localctx, 1);
{
this.state = 225;
this.match(GoParser.IMPORT);
this.state = 237;
this._errHandler.sync(this);
switch (this._input.LA(1)) {
case GoParser.IDENTIFIER:
case GoParser.DOT:
case GoParser.RAW_STRING_LIT:
case GoParser.INTERPRETED_STRING_LIT:
{
this.state = 226;
this.importSpec();
}
break;
case GoParser.L_PAREN:
{
this.state = 227;
this.match(GoParser.L_PAREN);
this.state = 233;
this._errHandler.sync(this);
_la = this._input.LA(1);
while (_la === GoParser.IDENTIFIER || _la === GoParser.DOT || _la === GoParser.RAW_STRING_LIT || _la === GoParser.INTERPRETED_STRING_LIT) {
{
{
this.state = 228;
this.importSpec();
this.state = 229;
this.eos();
}
}
this.state = 235;
this._errHandler.sync(this);
_la = this._input.LA(1);
}
this.state = 236;
this.match(GoParser.R_PAREN);
}
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;
}
importSpec() {
let _localctx = new ImportSpecContext(this._ctx, this.state);
this.enterRule(_localctx, 6, GoParser.RULE_importSpec);
let _la;
try {
this.enterOuterAlt(_localctx, 1);
{
this.state = 240;
this._errHandler.sync(this);
_la = this._input.LA(1);
if (_la === GoParser.IDENTIFIER || _la === GoParser.DOT) {
{
this.state = 239;
_localctx._alias = this._input.LT(1);
_la = this._input.LA(1);
if (!(_la === GoParser.IDENTIFIER || _la === GoParser.DOT)) {
_localctx._alias = this._errHandler.recoverInline(this);
}
else {
if (this._input.LA(1) === Token_1.Token.EOF) {
this.matchedEOF = true;
}
this._errHandler.reportMatch(this);
this.consume();
}
}
}
this.state = 242;
this.importPath();
}
}
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;
}
importPath() {
let _localctx = new ImportPathContext(this._ctx, this.state);
this.enterRule(_localctx, 8, GoParser.RULE_importPath);
try {
this.enterOuterAlt(_localctx, 1);
{
this.state = 244;
this.string_();
}
}
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;
}
declaration() {
let _localctx = new DeclarationContext(this._ctx, this.state);
this.enterRule(_localctx, 10, GoParser.RULE_declaration);
try {
this.state = 249;
this._errHandler.sync(this);
switch (this._input.LA(1)) {
case GoParser.CONST:
this.enterOuterAlt(_localctx, 1);
{
this.state = 246;
this.constDecl();
}
break;
case GoParser.TYPE:
this.enterOuterAlt(_localctx, 2);
{
this.state = 247;
this.typeDecl();
}
break;
case GoParser.VAR:
this.enterOuterAlt(_localctx, 3);
{
this.state = 248;
this.varDecl();
}
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;
}
constDecl() {
let _localctx = new ConstDeclContext(this._ctx, this.state);
this.enterRule(_localctx, 12, GoParser.RULE_constDecl);
let _la;
try {
this.enterOuterAlt(_localctx, 1);
{
this.state = 251;
this.match(GoParser.CONST);
this.state = 263;
this._errHandler.sync(this);
switch (this._input.LA(1)) {
case GoParser.IDENTIFIER:
{
this.state = 252;
this.constSpec();
}
break;
case GoParser.L_PAREN:
{
this.state = 253;
this.match(GoParser.L_PAREN);
this.state = 259;
this._errHandler.sync(this);
_la = this._input.LA(1);
while (_la === GoParser.IDENTIFIER) {
{
{
this.state = 254;
this.constSpec();
this.state = 255;
this.eos();
}
}
this.state = 261;
this._errHandler.sync(this);
_la = this._input.LA(1);
}
this.state = 262;
this.match(GoParser.R_PAREN);
}
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;
}
constSpec() {
let _localctx = new ConstSpecContext(this._ctx, this.state);
this.enterRule(_localctx, 14, GoParser.RULE_constSpec);
let _la;
try {
this.enterOuterAlt(_localctx, 1);
{
this.state = 265;
this.identifierList();
this.state = 271;
this._errHandler.sync(this);
switch (this.interpreter.adaptivePredict(this._input, 10, this._ctx)) {
case 1:
{
this.state = 267;
this._errHandler.sync(this);
_la = this._input.LA(1);
if ((((_la) & ~0x1F) === 0 && ((1 << _la) & ((1 << GoParser.FUNC) | (1 << GoParser.INTERFACE) | (1 << GoParser.MAP) | (1 << GoParser.STRUCT) | (1 << GoParser.CHAN) | (1 << GoParser.IDENTIFIER) | (1 << GoParser.L_PAREN))) !== 0) || ((((_la - 32)) & ~0x1F) === 0 && ((1 << (_la - 32)) & ((1 << (GoParser.L_BRACKET - 32)) | (1 << (GoParser.STAR - 32)) | (1 << (GoParser.RECEIVE - 32)))) !== 0)) {
{
this.state = 266;
this.type_();
}
}
this.state = 269;
this.match(GoParser.ASSIGN);
this.state = 270;
this.expressionList();
}
break;
}
}
}
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;
}
identifierList() {
let _localctx = new IdentifierListContext(this._ctx, this.state);
this.enterRule(_localctx, 16, GoParser.RULE_identifierList);
try {
let _alt;
this.enterOuterAlt(_localctx, 1);
{
this.state = 273;
this.match(GoParser.IDENTIFIER);
this.state = 278;
this._errHandler.sync(this);
_alt = this.interpreter.adaptivePredict(this._input, 11, this._ctx);
while (_alt !== 2 && _alt !== ATN_1.ATN.INVALID_ALT_NUMBER) {
if (_alt === 1) {
{
{
this.state = 274;
this.match(GoParser.COMMA);
this.state = 275;
this.match(GoParser.IDENTIFIER);
}
}
}
this.state = 280;
this._errHandler.sync(this);
_alt = this.interpreter.adaptivePredict(this._input, 11, this._ctx);
}
}
}
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;
}
expressionList() {
let _localctx = new ExpressionListContext(this._ctx, this.state);
this.enterRule(_localctx, 18, GoParser.RULE_expressionList);
try {
let _alt;
this.enterOuterAlt(_localctx, 1);
{
this.state = 281;
this.expression(0);
this.state = 286;
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 = 282;
this.match(GoParser.COMMA);
this.state = 283;
this.expression(0);
}
}
}
this.state = 288;
this._errHandler.sync(this);
_alt = this.interpreter.adaptivePredict(this._input, 12, this._ctx);
}
}
}
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;
}
typeDecl() {
let _localctx = new TypeDeclContext(this._ctx, this.state);
this.enterRule(_localctx, 20, GoParser.RULE_typeDecl);
let _la;
try {
this.enterOuterAlt(_localctx, 1);
{
this.state = 289;
this.match(GoParser.TYPE);
this.state = 301;
this._errHandler.sync(this);
switch (this._input.LA(1)) {
case GoParser.IDENTIFIER:
{
this.state = 290;
this.typeSpec();
}
break;
case GoParser.L_PAREN:
{
this.state = 291;
this.match(GoParser.L_PAREN);
this.state = 297;
this._errHandler.sync(this);
_la = this._input.LA(1);
while (_la === GoParser.IDENTIFIER) {
{
{
this.state = 292;
this.typeSpec();
this.state = 293;
this.eos();
}
}
this.state = 299;
this._errHandler.sync(this);
_la = this._input.LA(1);
}
this.state = 300;
this.match(GoParser.R_PAREN);
}
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;
}
typeSpec() {
let _localctx = new TypeSpecContext(this._ctx, this.state);
this.enterRule(_localctx, 22, GoParser.RULE_typeSpec);
let _la;
try {
this.enterOuterAlt(_localctx, 1);
{
this.state = 303;
this.match(GoParser.IDENTIFIER);
this.state = 305;
this._errHandler.sync(this);
_la = this._input.LA(1);
if (_la === GoParser.ASSIGN) {
{
this.state = 304;
this.match(GoParser.ASSIGN);
}
}
this.state = 307;
this.type_();
}
}
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;
}
functionDecl() {
let _localctx = new FunctionDeclContext(this._ctx, this.state);
this.enterRule(_localctx, 24, GoParser.RULE_functionDecl);
try {
this.enterOuterAlt(_localctx, 1);
{
this.state = 309;
this.match(GoParser.FUNC);
this.state = 310;
this.match(GoParser.IDENTIFIER);
{
this.state = 311;
this.signature();
this.state = 313;
this._errHandler.sync(this);
switch (this.interpreter.adaptivePredict(this._input, 16, this._ctx)) {
case 1:
{
this.state = 312;
this.block();
}
break;
}
}
}
}
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;
}
methodDecl() {
let _localctx = new MethodDeclContext(this._ctx, this.state);
this.enterRule(_localctx, 26, GoParser.RULE_methodDecl);
try {
this.enterOuterAlt(_localctx, 1);
{
this.state = 315;
this.match(GoParser.FUNC);
this.state = 316;
this.receiver();
this.state = 317;
this.match(GoParser.IDENTIFIER);
{
this.state = 318;
this.signature();
this.state = 320;
this._errHandler.sync(this);
switch (this.interpreter.adaptivePredict(this._input, 17, this._ctx)) {
case 1:
{
this.state = 319;
this.block();
}
break;
}
}
}
}
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;
}
receiver() {
let _localctx = new ReceiverContext(this._ctx, this.state);
this.enterRule(_localctx, 28, GoParser.RULE_receiver);
try {
this.enterOuterAlt(_localctx, 1);
{
this.state = 322;
this.parameters();
}
}
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;
}
varDecl() {
let _localctx = new VarDeclContext(this._ctx, this.state);
this.enterRule(_localctx, 30, GoParser.RULE_varDecl);
let _la;
try {
this.enterOuterAlt(_localctx, 1);
{
this.state = 324;
this.match(GoParser.VAR);
this.state = 336;
this._errHandler.sync(this);
switch (this._input.LA(1)) {
case GoParser.IDENTIFIER:
{
this.state = 325;
this.varSpec();
}
break;
case GoParser.L_PAREN:
{
this.state = 326;
this.match(GoParser.L_PAREN);
this.state = 332;
this._errHandler.sync(this);
_la = this._input.LA(1);
while (_la === GoParser.IDENTIFIER) {
{
{
this.state = 327;
this.varSpec();
this.state = 328;
this.eos();
}
}
this.state = 334;
this._errHandler.sync(this);
_la = this._input.LA(1);
}
this.state = 335;
this.match(GoParser.R_PAREN);
}
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;
}
varSpec() {
let _localctx = new VarSpecContext(this._ctx, this.state);
this.enterRule(_localctx, 32, GoParser.RULE_varSpec);
try {
this.enterOuterAlt(_localctx, 1);
{
this.state = 338;
this.identifierList();
this.state = 346;
this._errHandler.sync(this);
switch (this._input.LA(1)) {
case GoParser.FUNC:
case GoParser.INTERFACE:
case GoParser.MAP:
case GoParser.STRUCT:
case GoParser.CHAN:
case GoParser.IDENTIFIER:
case GoParser.L_PAREN:
case GoParser.L_BRACKET:
case GoParser.STAR:
case GoParser.RECEIVE:
{
this.state = 339;
this.type_();
this.state = 342;
this._errHandler.sync(this);
switch (this.interpreter.adaptivePredict(this._input, 20, this._ctx)) {
case 1:
{
this.state = 340;
this.match(GoParser.ASSIGN);
this.state = 341;
this.expressionList();
}
break;
}
}
break;
case GoParser.ASSIGN:
{
this.state = 344;
this.match(GoParser.ASSIGN);
this.state = 345;
this.expressionList();
}
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;
}
block() {
let _localctx = new BlockContext(this._ctx, this.state);
this.enterRule(_localctx, 34, GoParser.RULE_block);
try {
this.enterOuterAlt(_localctx, 1);
{
this.state = 348;
this.match(GoParser.L_CURLY);
this.state = 350;
this._errHandler.sync(this);
switch (this.interpreter.adaptivePredict(this._input, 22, this._ctx)) {
case 1:
{
this.state = 349;
this.statementList();
}
break;
}
this.state = 352;
this.match(GoParser.R_CURLY);
}
}
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;
}
statementList() {
let _localctx = new StatementListContext(this._ctx, this.state);
this.enterRule(_localctx, 36, GoParser.RULE_statementList);
let _la;
try {
let _alt;
this.enterOuterAlt(_localctx, 1);
{
this.state = 366;
this._errHandler.sync(this);
_alt = 1;
do {
switch (_alt) {
case 1:
{
{
this.state = 361;
this._errHandler.sync(this);
switch (this.interpreter.adaptivePredict(this._input, 25, this._ctx)) {
case 1:
{
this.state = 355;
this._errHandler.sync(this);
_la = this._input.LA(1);
if (_la === GoParser.SEMI) {
{
this.state = 354;
this.match(GoParser.SEMI);
}
}
}
break;
case 2:
{
this.state = 358;
this._errHandler.sync(this);
_la = this._input.LA(1);
if (_la === GoParser.EOS) {
{
this.state = 357;
this.match(GoParser.EOS);
}
}
}
break;
case 3:
{
this.state = 360;
if (!(this.closingBracket())) {
throw this.createFailedPredicateException("this.closingBracket()");
}
}
break;
}
this.state = 363;
this.statement();
this.state = 364;
this.eos();
}
}
break;
default:
throw new NoViableAltException_1.NoViableAltException(this);
}
this.state = 368;
this._errHandler.sync(this);
_alt = this.interpreter.adaptivePredict(this._input, 26, this._ctx);
} while (_alt !== 2 && _alt !== ATN_1.ATN.INVALID_ALT_NUMBER);
}
}
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;
}
statement() {
let _localctx = new StatementContext(this._ctx, this.state);
this.enterRule(_localctx, 38, GoParser.RULE_statement);
try {
this.state = 385;
this._errHandler.sync(this);
switch (this.interpreter.adaptivePredict(this._input, 27, this._ctx)) {
case 1:
this.enterOuterAlt(_localctx, 1);
{
this.state = 370;
this.declaration();
}
break;
case 2:
this.enterOuterAlt(_localctx, 2);
{
this.state = 371;
this.labeledStmt();
}
break;
case 3:
this.enterOuterAlt(_localctx, 3);
{
this.state = 372;
this.simpleStmt();
}
break;
case 4:
this.enterOuterAlt(_localctx, 4);
{
this.state = 373;
this.goStmt();
}
break;
case 5:
this.enterOuterAlt(_localctx, 5);
{
this.state = 374;
this.returnStmt();
}
break;
case 6:
this.enterOuterAlt(_localctx, 6);
{
this.state = 375;
this.breakStmt();
}
break;
case 7:
this.enterOuterAlt(_localctx, 7);
{
this.state = 376;
this.continueStmt();
}
break;
case 8:
this.enterOuterAlt(_localctx, 8);
{
this.state = 377;
this.gotoStmt();
}
break;
case 9:
this.enterOuterAlt(_localctx, 9);
{
this.state = 378;
this.fallthroughStmt();
}
break;
case 10:
this.enterOuterAlt(_localctx, 10);
{
this.state = 379;
this.block();
}
break;
case 11:
this.enterOuterAlt(_localctx, 11);
{
this.state = 380;
this.ifStmt();
}
break;
case 12:
this.enterOuterAlt(_localctx, 12);
{
this.state = 381;
this.switchStmt();
}
break;
case 13:
this.enterOuterAlt(_localctx, 13);
{
this.state = 382;
this.selectStmt();
}
break;
case 14:
this.enterOuterAlt(_localctx, 14);
{
this.state = 383;
this.forStmt();
}
break;
case 15:
this.enterOuterAlt(_localctx, 15);
{
this.state = 384;
this.deferStmt();
}
break;
}
}
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;
}
simpleStmt() {
let _localctx = new SimpleStmtContext(this._ctx, this.state);
this.enterRule(_localctx, 40, GoParser.RULE_simpleStmt);
try {
this.state = 392;
this._errHandler.sync(this);
switch (this.interpreter.adaptivePredict(this._input, 28, this._ctx)) {
case 1:
this.enterOuterAlt(_localctx, 1);
{
this.state = 387;
this.sendStmt();
}
break;
case 2:
this.enterOuterAlt(_localctx, 2);
{
this.state = 388;
this.incDecStmt();
}
break;
case 3:
this.enterOuterAlt(_localctx, 3);
{
this.state = 389;
this.assignment();
}
break;
case 4:
this.enterOuterAlt(_localctx, 4);
{
this.state = 390;
this.expressionStmt();
}
break;
case 5:
this.enterOuterAlt(_localctx, 5);
{
this.state = 391;
this.shortVarDecl();
}
break;
}
}
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;
}
expressionStmt() {
let _localctx = new ExpressionStmtContext(this._ctx, this.state);
this.enterRule(_localctx, 42, GoParser.RULE_expressionStmt);
try {
this.enterOuterAlt(_localctx, 1);
{
this.state = 394;
this.expression(0);
}
}
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;
}
sendStmt() {
let _localctx = new SendStmtContext(this._ctx, this.state);
this.enterRule(_localctx, 44, GoParser.RULE_sendStmt);
try {
this.enterOuterAlt(_localctx, 1);
{
this.state = 396;
_localctx._channel = this.expression(0);
this.state = 397;
this.match(GoParser.RECEIVE);
this.state = 398;
this.expression(0);
}
}
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;
}
incDecStmt() {
let _localctx = new IncDecStmtContext(this._ctx, this.state);
this.enterRule(_localctx, 46, GoParser.RULE_incDecStmt);
let _la;
try {
this.enterOuterAlt(_localctx, 1);
{
this.state = 400;
this.expression(0);
this.state = 401;
_la = this._input.LA(1);
if (!(_la === GoParser.PLUS_PLUS || _la === GoParser.MINUS_MINUS)) {
this._errHandler.recoverInline(this);
}
else {
if (this._input.LA(1) === Token_1.Token.EOF) {
this.matchedEOF = true;
}
this._errHandler.reportMatch(this);
this.consume();
}
}
}
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;
}
assignment() {
let _localctx = new AssignmentContext(this._ctx, this.state);
this.enterRule(_localctx, 48, GoParser.RULE_assignment);
try {
this.enterOuterAlt(_localctx, 1);
{
this.state = 403;
this.expressionList();
this.state = 404;
this.assign_op();
this.state = 405;
this.expressionList();
}
}
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;
}
assign_op() {
let _localctx = new Assign_opContext(this._ctx, this.state);
this.enterRule(_localctx, 50, GoParser.RULE_assign_op);
let _la;
try {
this.enterOuterAlt(_localctx, 1);
{
this.state = 408;
this._errHandler.sync(this);
_la = this._i