sol-merger
Version:
Merges all import files into single file.
1,183 lines (1,182 loc) • 487 kB
JavaScript
"use strict";
// Generated from SolidityParser.g4 by ANTLR 4.9.0-SNAPSHOT
// @ts-nocheck
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 (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.FunctionCallContext = exports.FunctionCallOptionsContext = exports.MemberAccessContext = exports.IndexRangeAccessContext = exports.IndexAccessContext = exports.ExpressionContext = exports.DataLocationContext = exports.VariableDeclarationContext = exports.FunctionTypeNameContext = exports.ElementaryTypeNameContext = exports.TypeNameContext = exports.UsingDirectiveContext = exports.UserDefinableOperatorContext = exports.ErrorDefinitionContext = exports.ErrorParameterContext = exports.EventDefinitionContext = exports.EventParameterContext = exports.ConstantVariableDeclarationContext = exports.StateVariableDeclarationContext = exports.UserDefinedValueTypeDefinitionContext = exports.EnumDefinitionContext = exports.StructMemberContext = exports.StructDefinitionContext = exports.ReceiveFunctionDefinitionContext = exports.FallbackFunctionDefinitionContext = exports.ModifierDefinitionContext = exports.FunctionDefinitionContext = exports.OverrideSpecifierContext = exports.StateMutabilityContext = exports.ConstructorDefinitionContext = exports.ParameterDeclarationContext = exports.ParameterListContext = exports.VisibilityContext = exports.ModifierInvocationContext = exports.IdentifierPathContext = exports.CallArgumentListContext = exports.NamedArgumentContext = exports.ContractBodyElementContext = exports.InheritanceSpecifierContext = exports.InheritanceSpecifierListContext = exports.LibraryDefinitionContext = exports.InterfaceDefinitionContext = exports.ContractDefinitionContext = exports.SymbolAliasesContext = exports.PathContext = exports.ImportAliasesContext = exports.ImportDirectiveContext = exports.PragmaDirectiveContext = exports.SourceUnitContext = exports.SolidityParser = void 0;
exports.VariableDeclarationListContext = exports.AssemblyFlagsContext = exports.AssemblyStatementContext = exports.RevertStatementContext = exports.EmitStatementContext = exports.ReturnStatementContext = exports.CatchClauseContext = exports.TryStatementContext = exports.BreakStatementContext = exports.ContinueStatementContext = exports.DoWhileStatementContext = exports.WhileStatementContext = exports.ForStatementContext = exports.IfStatementContext = exports.SimpleStatementContext = exports.StatementContext = exports.UncheckedBlockContext = exports.BlockContext = exports.NumberLiteralContext = exports.UnicodeStringLiteralContext = exports.HexStringLiteralContext = exports.StringLiteralContext = exports.BooleanLiteralContext = exports.LiteralWithSubDenominationContext = exports.LiteralContext = exports.IdentifierContext = exports.InlineArrayExpressionContext = exports.TupleExpressionContext = exports.AssignOpContext = exports.PrimaryExpressionContext = exports.InlineArrayContext = exports.TupleContext = exports.NewExprContext = exports.AssignmentContext = exports.ConditionalContext = exports.OrOperationContext = exports.AndOperationContext = exports.EqualityComparisonContext = exports.OrderComparisonContext = exports.BitOrOperationContext = exports.BitXorOperationContext = exports.BitAndOperationContext = exports.ShiftOperationContext = exports.AddSubOperationContext = exports.MulDivModOperationContext = exports.ExpOperationContext = exports.UnarySuffixOperationContext = exports.UnaryPrefixOperationContext = exports.MetaTypeContext = exports.PayableConversionContext = void 0;
exports.YulExpressionContext = exports.YulLiteralContext = exports.YulBooleanContext = exports.YulFunctionCallContext = exports.YulPathContext = exports.YulFunctionDefinitionContext = exports.YulSwitchStatementContext = exports.YulSwitchCaseContext = exports.YulForStatementContext = exports.YulIfStatementContext = exports.YulAssignmentContext = exports.YulVariableDeclarationContext = exports.YulBlockContext = exports.YulStatementContext = exports.MappingKeyTypeContext = exports.MappingTypeContext = exports.ExpressionStatementContext = exports.VariableDeclarationStatementContext = exports.VariableDeclarationTupleContext = 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 SolidityParser extends Parser_1.Parser {
// @Override
// @NotNull
get vocabulary() {
return SolidityParser.VOCABULARY;
}
// tslint:enable:no-trailing-whitespace
// @Override
get grammarFileName() { return "SolidityParser.g4"; }
// @Override
get ruleNames() { return SolidityParser.ruleNames; }
// @Override
get serializedATN() { return SolidityParser._serializedATN; }
createFailedPredicateException(predicate, message) {
return new FailedPredicateException_1.FailedPredicateException(this, predicate, message);
}
constructor(input) {
super(input);
this._interp = new ParserATNSimulator_1.ParserATNSimulator(SolidityParser._ATN, this);
}
// @RuleVersion(0)
sourceUnit() {
let _localctx = new SourceUnitContext(this._ctx, this.state);
this.enterRule(_localctx, 0, SolidityParser.RULE_sourceUnit);
try {
let _alt;
this.enterOuterAlt(_localctx, 1);
{
this.state = 199;
this._errHandler.sync(this);
_alt = this.interpreter.adaptivePredict(this._input, 1, this._ctx);
while (_alt !== 2 && _alt !== ATN_1.ATN.INVALID_ALT_NUMBER) {
if (_alt === 1) {
{
this.state = 197;
this._errHandler.sync(this);
switch (this.interpreter.adaptivePredict(this._input, 0, this._ctx)) {
case 1:
{
this.state = 184;
this.pragmaDirective();
}
break;
case 2:
{
this.state = 185;
this.importDirective();
}
break;
case 3:
{
this.state = 186;
this.usingDirective();
}
break;
case 4:
{
this.state = 187;
this.contractDefinition();
}
break;
case 5:
{
this.state = 188;
this.interfaceDefinition();
}
break;
case 6:
{
this.state = 189;
this.libraryDefinition();
}
break;
case 7:
{
this.state = 190;
this.functionDefinition();
}
break;
case 8:
{
this.state = 191;
this.constantVariableDeclaration();
}
break;
case 9:
{
this.state = 192;
this.structDefinition();
}
break;
case 10:
{
this.state = 193;
this.enumDefinition();
}
break;
case 11:
{
this.state = 194;
this.userDefinedValueTypeDefinition();
}
break;
case 12:
{
this.state = 195;
this.errorDefinition();
}
break;
case 13:
{
this.state = 196;
this.eventDefinition();
}
break;
}
}
}
this.state = 201;
this._errHandler.sync(this);
_alt = this.interpreter.adaptivePredict(this._input, 1, this._ctx);
}
this.state = 202;
this.match(SolidityParser.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)
pragmaDirective() {
let _localctx = new PragmaDirectiveContext(this._ctx, this.state);
this.enterRule(_localctx, 2, SolidityParser.RULE_pragmaDirective);
let _la;
try {
this.enterOuterAlt(_localctx, 1);
{
this.state = 204;
this.match(SolidityParser.Pragma);
this.state = 206;
this._errHandler.sync(this);
_la = this._input.LA(1);
do {
{
{
this.state = 205;
this.match(SolidityParser.PragmaToken);
}
}
this.state = 208;
this._errHandler.sync(this);
_la = this._input.LA(1);
} while (_la === SolidityParser.PragmaToken);
this.state = 210;
this.match(SolidityParser.PragmaSemicolon);
}
}
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)
importDirective() {
let _localctx = new ImportDirectiveContext(this._ctx, this.state);
this.enterRule(_localctx, 4, SolidityParser.RULE_importDirective);
let _la;
try {
this.enterOuterAlt(_localctx, 1);
{
this.state = 212;
this.match(SolidityParser.Import);
this.state = 228;
this._errHandler.sync(this);
switch (this._input.LA(1)) {
case SolidityParser.NonEmptyStringLiteral:
{
{
this.state = 213;
this.path();
this.state = 216;
this._errHandler.sync(this);
_la = this._input.LA(1);
if (_la === SolidityParser.As) {
{
this.state = 214;
this.match(SolidityParser.As);
this.state = 215;
_localctx._unitAlias = this.identifier();
}
}
}
}
break;
case SolidityParser.LBrace:
{
{
this.state = 218;
this.symbolAliases();
this.state = 219;
this.match(SolidityParser.From);
this.state = 220;
this.path();
}
}
break;
case SolidityParser.Mul:
{
{
this.state = 222;
this.match(SolidityParser.Mul);
this.state = 223;
this.match(SolidityParser.As);
this.state = 224;
_localctx._unitAlias = this.identifier();
this.state = 225;
this.match(SolidityParser.From);
this.state = 226;
this.path();
}
}
break;
default:
throw new NoViableAltException_1.NoViableAltException(this);
}
this.state = 230;
this.match(SolidityParser.Semicolon);
}
}
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)
importAliases() {
let _localctx = new ImportAliasesContext(this._ctx, this.state);
this.enterRule(_localctx, 6, SolidityParser.RULE_importAliases);
let _la;
try {
this.enterOuterAlt(_localctx, 1);
{
this.state = 232;
_localctx._symbol = this.identifier();
this.state = 235;
this._errHandler.sync(this);
_la = this._input.LA(1);
if (_la === SolidityParser.As) {
{
this.state = 233;
this.match(SolidityParser.As);
this.state = 234;
_localctx._alias = this.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;
}
// @RuleVersion(0)
path() {
let _localctx = new PathContext(this._ctx, this.state);
this.enterRule(_localctx, 8, SolidityParser.RULE_path);
try {
this.enterOuterAlt(_localctx, 1);
{
this.state = 237;
this.match(SolidityParser.NonEmptyStringLiteral);
}
}
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)
symbolAliases() {
let _localctx = new SymbolAliasesContext(this._ctx, this.state);
this.enterRule(_localctx, 10, SolidityParser.RULE_symbolAliases);
let _la;
try {
this.enterOuterAlt(_localctx, 1);
{
this.state = 239;
this.match(SolidityParser.LBrace);
this.state = 240;
_localctx._importAliases = this.importAliases();
_localctx._aliases.push(_localctx._importAliases);
this.state = 245;
this._errHandler.sync(this);
_la = this._input.LA(1);
while (_la === SolidityParser.Comma) {
{
{
this.state = 241;
this.match(SolidityParser.Comma);
this.state = 242;
_localctx._importAliases = this.importAliases();
_localctx._aliases.push(_localctx._importAliases);
}
}
this.state = 247;
this._errHandler.sync(this);
_la = this._input.LA(1);
}
this.state = 248;
this.match(SolidityParser.RBrace);
}
}
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)
contractDefinition() {
let _localctx = new ContractDefinitionContext(this._ctx, this.state);
this.enterRule(_localctx, 12, SolidityParser.RULE_contractDefinition);
let _la;
try {
let _alt;
this.enterOuterAlt(_localctx, 1);
{
this.state = 251;
this._errHandler.sync(this);
_la = this._input.LA(1);
if (_la === SolidityParser.Abstract) {
{
this.state = 250;
this.match(SolidityParser.Abstract);
}
}
this.state = 253;
this.match(SolidityParser.Contract);
this.state = 254;
_localctx._name = this.identifier();
this.state = 256;
this._errHandler.sync(this);
_la = this._input.LA(1);
if (_la === SolidityParser.Is) {
{
this.state = 255;
this.inheritanceSpecifierList();
}
}
this.state = 258;
this.match(SolidityParser.LBrace);
this.state = 262;
this._errHandler.sync(this);
_alt = this.interpreter.adaptivePredict(this._input, 9, this._ctx);
while (_alt !== 2 && _alt !== ATN_1.ATN.INVALID_ALT_NUMBER) {
if (_alt === 1) {
{
{
this.state = 259;
this.contractBodyElement();
}
}
}
this.state = 264;
this._errHandler.sync(this);
_alt = this.interpreter.adaptivePredict(this._input, 9, this._ctx);
}
this.state = 265;
this.match(SolidityParser.RBrace);
}
}
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)
interfaceDefinition() {
let _localctx = new InterfaceDefinitionContext(this._ctx, this.state);
this.enterRule(_localctx, 14, SolidityParser.RULE_interfaceDefinition);
let _la;
try {
let _alt;
this.enterOuterAlt(_localctx, 1);
{
this.state = 267;
this.match(SolidityParser.Interface);
this.state = 268;
_localctx._name = this.identifier();
this.state = 270;
this._errHandler.sync(this);
_la = this._input.LA(1);
if (_la === SolidityParser.Is) {
{
this.state = 269;
this.inheritanceSpecifierList();
}
}
this.state = 272;
this.match(SolidityParser.LBrace);
this.state = 276;
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 = 273;
this.contractBodyElement();
}
}
}
this.state = 278;
this._errHandler.sync(this);
_alt = this.interpreter.adaptivePredict(this._input, 11, this._ctx);
}
this.state = 279;
this.match(SolidityParser.RBrace);
}
}
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)
libraryDefinition() {
let _localctx = new LibraryDefinitionContext(this._ctx, this.state);
this.enterRule(_localctx, 16, SolidityParser.RULE_libraryDefinition);
try {
let _alt;
this.enterOuterAlt(_localctx, 1);
{
this.state = 281;
this.match(SolidityParser.Library);
this.state = 282;
_localctx._name = this.identifier();
this.state = 283;
this.match(SolidityParser.LBrace);
this.state = 287;
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 = 284;
this.contractBodyElement();
}
}
}
this.state = 289;
this._errHandler.sync(this);
_alt = this.interpreter.adaptivePredict(this._input, 12, this._ctx);
}
this.state = 290;
this.match(SolidityParser.RBrace);
}
}
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)
inheritanceSpecifierList() {
let _localctx = new InheritanceSpecifierListContext(this._ctx, this.state);
this.enterRule(_localctx, 18, SolidityParser.RULE_inheritanceSpecifierList);
try {
let _alt;
this.enterOuterAlt(_localctx, 1);
{
this.state = 292;
this.match(SolidityParser.Is);
this.state = 293;
_localctx._inheritanceSpecifier = this.inheritanceSpecifier();
_localctx._inheritanceSpecifiers.push(_localctx._inheritanceSpecifier);
this.state = 298;
this._errHandler.sync(this);
_alt = this.interpreter.adaptivePredict(this._input, 13, this._ctx);
while (_alt !== 1 && _alt !== ATN_1.ATN.INVALID_ALT_NUMBER) {
if (_alt === 1 + 1) {
{
{
this.state = 294;
this.match(SolidityParser.Comma);
this.state = 295;
_localctx._inheritanceSpecifier = this.inheritanceSpecifier();
_localctx._inheritanceSpecifiers.push(_localctx._inheritanceSpecifier);
}
}
}
this.state = 300;
this._errHandler.sync(this);
_alt = this.interpreter.adaptivePredict(this._input, 13, 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;
}
// @RuleVersion(0)
inheritanceSpecifier() {
let _localctx = new InheritanceSpecifierContext(this._ctx, this.state);
this.enterRule(_localctx, 20, SolidityParser.RULE_inheritanceSpecifier);
let _la;
try {
this.enterOuterAlt(_localctx, 1);
{
this.state = 301;
_localctx._name = this.identifierPath();
this.state = 303;
this._errHandler.sync(this);
_la = this._input.LA(1);
if (_la === SolidityParser.LParen) {
{
this.state = 302;
_localctx._arguments = this.callArgumentList();
}
}
}
}
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)
contractBodyElement() {
let _localctx = new ContractBodyElementContext(this._ctx, this.state);
this.enterRule(_localctx, 22, SolidityParser.RULE_contractBodyElement);
try {
this.state = 317;
this._errHandler.sync(this);
switch (this.interpreter.adaptivePredict(this._input, 15, this._ctx)) {
case 1:
this.enterOuterAlt(_localctx, 1);
{
this.state = 305;
this.constructorDefinition();
}
break;
case 2:
this.enterOuterAlt(_localctx, 2);
{
this.state = 306;
this.functionDefinition();
}
break;
case 3:
this.enterOuterAlt(_localctx, 3);
{
this.state = 307;
this.modifierDefinition();
}
break;
case 4:
this.enterOuterAlt(_localctx, 4);
{
this.state = 308;
this.fallbackFunctionDefinition();
}
break;
case 5:
this.enterOuterAlt(_localctx, 5);
{
this.state = 309;
this.receiveFunctionDefinition();
}
break;
case 6:
this.enterOuterAlt(_localctx, 6);
{
this.state = 310;
this.structDefinition();
}
break;
case 7:
this.enterOuterAlt(_localctx, 7);
{
this.state = 311;
this.enumDefinition();
}
break;
case 8:
this.enterOuterAlt(_localctx, 8);
{
this.state = 312;
this.userDefinedValueTypeDefinition();
}
break;
case 9:
this.enterOuterAlt(_localctx, 9);
{
this.state = 313;
this.stateVariableDeclaration();
}
break;
case 10:
this.enterOuterAlt(_localctx, 10);
{
this.state = 314;
this.eventDefinition();
}
break;
case 11:
this.enterOuterAlt(_localctx, 11);
{
this.state = 315;
this.errorDefinition();
}
break;
case 12:
this.enterOuterAlt(_localctx, 12);
{
this.state = 316;
this.usingDirective();
}
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;
}
// @RuleVersion(0)
namedArgument() {
let _localctx = new NamedArgumentContext(this._ctx, this.state);
this.enterRule(_localctx, 24, SolidityParser.RULE_namedArgument);
try {
this.enterOuterAlt(_localctx, 1);
{
this.state = 319;
_localctx._name = this.identifier();
this.state = 320;
this.match(SolidityParser.Colon);
this.state = 321;
_localctx._value = 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;
}
// @RuleVersion(0)
callArgumentList() {
let _localctx = new CallArgumentListContext(this._ctx, this.state);
this.enterRule(_localctx, 26, SolidityParser.RULE_callArgumentList);
let _la;
try {
this.enterOuterAlt(_localctx, 1);
{
this.state = 323;
this.match(SolidityParser.LParen);
this.state = 346;
this._errHandler.sync(this);
switch (this.interpreter.adaptivePredict(this._input, 20, this._ctx)) {
case 1:
{
this.state = 332;
this._errHandler.sync(this);
switch (this.interpreter.adaptivePredict(this._input, 17, this._ctx)) {
case 1:
{
this.state = 324;
this.expression(0);
this.state = 329;
this._errHandler.sync(this);
_la = this._input.LA(1);
while (_la === SolidityParser.Comma) {
{
{
this.state = 325;
this.match(SolidityParser.Comma);
this.state = 326;
this.expression(0);
}
}
this.state = 331;
this._errHandler.sync(this);
_la = this._input.LA(1);
}
}
break;
}
}
break;
case 2:
{
this.state = 334;
this.match(SolidityParser.LBrace);
this.state = 343;
this._errHandler.sync(this);
_la = this._input.LA(1);
if ((((_la) & ~0x1F) === 0 && ((1 << _la) & ((1 << SolidityParser.Error) | (1 << SolidityParser.From) | (1 << SolidityParser.Global))) !== 0) || _la === SolidityParser.Revert || _la === SolidityParser.Identifier) {
{
this.state = 335;
this.namedArgument();
this.state = 340;
this._errHandler.sync(this);
_la = this._input.LA(1);
while (_la === SolidityParser.Comma) {
{
{
this.state = 336;
this.match(SolidityParser.Comma);
this.state = 337;
this.namedArgument();
}
}
this.state = 342;
this._errHandler.sync(this);
_la = this._input.LA(1);
}
}
}
this.state = 345;
this.match(SolidityParser.RBrace);
}
break;
}
this.state = 348;
this.match(SolidityParser.RParen);
}
}
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)
identifierPath() {
let _localctx = new IdentifierPathContext(this._ctx, this.state);
this.enterRule(_localctx, 28, SolidityParser.RULE_identifierPath);
try {
let _alt;
this.enterOuterAlt(_localctx, 1);
{
this.state = 350;
this.identifier();
this.state = 355;
this._errHandler.sync(this);
_alt = this.interpreter.adaptivePredict(this._input, 21, this._ctx);
while (_alt !== 2 && _alt !== ATN_1.ATN.INVALID_ALT_NUMBER) {
if (_alt === 1) {
{
{
this.state = 351;
this.match(SolidityParser.Period);
this.state = 352;
this.identifier();
}
}
}
this.state = 357;
this._errHandler.sync(this);
_alt = this.interpreter.adaptivePredict(this._input, 21, 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;
}
// @RuleVersion(0)
modifierInvocation() {
let _localctx = new ModifierInvocationContext(this._ctx, this.state);
this.enterRule(_localctx, 30, SolidityParser.RULE_modifierInvocation);
try {
this.enterOuterAlt(_localctx, 1);
{
this.state = 358;
this.identifierPath();
this.state = 360;
this._errHandler.sync(this);
switch (this.interpreter.adaptivePredict(this._input, 22, this._ctx)) {
case 1:
{
this.state = 359;
this.callArgumentList();
}
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;
}
// @RuleVersion(0)
visibility() {
let _localctx = new VisibilityContext(this._ctx, this.state);
this.enterRule(_localctx, 32, SolidityParser.RULE_visibility);
let _la;
try {
this.enterOuterAlt(_localctx, 1);
{
this.state = 362;
_la = this._input.LA(1);
if (!(((((_la - 23)) & ~0x1F) === 0 && ((1 << (_la - 23)) & ((1 << (SolidityParser.External - 23)) | (1 << (SolidityParser.Internal - 23)) | (1 << (SolidityParser.Private - 23)) | (1 << (SolidityParser.Public - 23)))) !== 0))) {
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;
}
// @RuleVersion(0)
parameterList() {
let _localctx = new ParameterListContext(this._ctx, this.state);
this.enterRule(_localctx, 34, SolidityParser.RULE_parameterList);
let _la;
try {
this.enterOuterAlt(_localctx, 1);
{
this.state = 364;
_localctx._parameterDeclaration = this.parameterDeclaration();
_localctx._parameters.push(_localctx._parameterDeclaration);
this.state = 369;
this._errHandler.sync(this);
_la = this._input.LA(1);
while (_la === SolidityParser.Comma) {
{
{
this.state = 365;
this.match(SolidityParser.Comma);
this.state = 366;
_localctx._parameterDeclaration = this.parameterDeclaration();
_localctx._parameters.push(_localctx._parameterDeclaration);
}
}
this.state = 371;
this._errHandler.sync(this);
_la = this._input.LA(1);
}
}
}
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)
parameterDeclaration() {
let _localctx = new ParameterDeclarationContext(this._ctx, this.state);
this.enterRule(_localctx, 36, SolidityParser.RULE_parameterDeclaration);
let _la;
try {
this.enterOuterAlt(_localctx, 1);
{
this.state = 372;
_localctx._type = this.typeName(0);
this.state = 374;
this._errHandler.sync(this);
_la = this._input.LA(1);
if (_la === SolidityParser.Calldata || _la === SolidityParser.Memory || _la === SolidityParser.Storage) {
{
this.state = 373;
_localctx._location = this.dataLocation();
}
}
this.state = 377;
this._errHandler.sync(this);
_la = this._input.LA(1);
if ((((_la) & ~0x1F) === 0 && ((1 << _la) & ((1 << SolidityParser.Error) | (1 << SolidityParser.From) | (1 << SolidityParser.Global))) !== 0) || _la === SolidityParser.Revert || _la === SolidityParser.Identifier) {
{
this.state = 376;
_localctx._name = this.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;
}
// @RuleVersion(0)
constructorDefinition() {
let _localctx = new ConstructorDefinitionContext(this._ctx, this.state);
this.enterRule(_localctx, 38, SolidityParser.RULE_constructorDefinition);
try {
let _alt;
this.enterOuterAlt(_localctx, 1);
{
this.state = 379;
this.match(SolidityParser.Constructor);
this.state = 380;
this.match(SolidityParser.LParen);
this.state = 382;
this._errHandler.sync(this);
switch (this.interpreter.adaptivePredict(this._input, 26, this._ctx)) {
case 1:
{
this.state = 381;
_localctx._arguments = this.parameterList();
}
break;
}
this.state = 384;
this.match(SolidityParser.RParen);
this.state = 397;
this._errHandler.sync(this);
_alt = this.interpreter.adaptivePredict(this._input, 28, this._ctx);
while (_alt !== 2 && _alt !== ATN_1.ATN.INVALID_ALT_NUMBER) {
if (_alt === 1) {
{
this.state = 395;
this._errHandler.sync(this);
switch (this.interpreter.adaptivePredict(this._input, 27, this._ctx)) {
case 1:
{
this.state = 385;
this.modifierInvocation();
}
break;
case 2:
{
this.state = 386;
if (!(!_localctx.payableSet)) {
throw this.createFailedPredicateException("!$payableSet");
}
this.state = 387;
this.match(SolidityParser.Payable);
_localctx.payableSet = true;
}
break;
case 3:
{
this.state = 389;
if (!(!_localctx.visibilitySet)) {
throw this.createFailedPredicateException("!$visibilitySet");
}
this.state = 390;
this.match(SolidityParser.Internal);