// Generated from EscriptParser.g4 by ANTLR 4.13.1 #include "EscriptParserListener.h" #include "EscriptParserVisitor.h" #include "EscriptParser.h" using namespace antlrcpp; using namespace EscriptGrammar; using namespace antlr4; namespace { struct EscriptParserStaticData final { EscriptParserStaticData(std::vector ruleNames, std::vector literalNames, std::vector symbolicNames) : ruleNames(std::move(ruleNames)), literalNames(std::move(literalNames)), symbolicNames(std::move(symbolicNames)), vocabulary(this->literalNames, this->symbolicNames) {} EscriptParserStaticData(const EscriptParserStaticData&) = delete; EscriptParserStaticData(EscriptParserStaticData&&) = delete; EscriptParserStaticData& operator=(const EscriptParserStaticData&) = delete; EscriptParserStaticData& operator=(EscriptParserStaticData&&) = delete; std::vector decisionToDFA; antlr4::atn::PredictionContextCache sharedContextCache; const std::vector ruleNames; const std::vector literalNames; const std::vector symbolicNames; const antlr4::dfa::Vocabulary vocabulary; antlr4::atn::SerializedATNView serializedATN; std::unique_ptr atn; }; ::antlr4::internal::OnceFlag escriptparserParserOnceFlag; #if ANTLR4_USE_THREAD_LOCAL_CACHE static thread_local #endif EscriptParserStaticData *escriptparserParserStaticData = nullptr; void escriptparserParserInitialize() { #if ANTLR4_USE_THREAD_LOCAL_CACHE if (escriptparserParserStaticData != nullptr) { return; } #else assert(escriptparserParserStaticData == nullptr); #endif auto staticData = std::make_unique( std::vector{ "compilationUnit", "moduleUnit", "evaluateUnit", "moduleDeclarationStatement", "moduleFunctionDeclaration", "moduleFunctionParameterList", "moduleFunctionParameter", "topLevelDeclaration", "functionDeclaration", "stringIdentifier", "useDeclaration", "includeDeclaration", "programDeclaration", "statement", "statementLabel", "ifStatement", "gotoStatement", "returnStatement", "constStatement", "varStatement", "doStatement", "whileStatement", "exitStatement", "breakStatement", "continueStatement", "forStatement", "foreachIterableExpression", "foreachStatement", "repeatStatement", "caseStatement", "enumStatement", "block", "variableDeclarationInitializer", "enumList", "enumListEntry", "switchBlockStatementGroup", "switchLabel", "forGroup", "basicForStatement", "cstyleForStatement", "identifierList", "variableDeclarationList", "constantDeclaration", "variableDeclaration", "programParameters", "programParameterList", "programParameter", "functionParameters", "functionParameterList", "functionParameter", "scopedFunctionCall", "functionReference", "expression", "primary", "functionExpression", "explicitArrayInitializer", "explicitStructInitializer", "explicitDictInitializer", "explicitErrorInitializer", "bareArrayInitializer", "parExpression", "expressionList", "expressionSuffix", "indexingSuffix", "navigationSuffix", "methodCallSuffix", "functionCallSuffix", "functionCall", "structInitializerExpression", "structInitializerExpressionList", "structInitializer", "dictInitializerExpression", "dictInitializerExpressionList", "dictInitializer", "arrayInitializer", "literal", "interpolatedString", "interpolatedStringPart", "integerLiteral", "floatLiteral", "boolLiteral" }, std::vector{ "", "'if'", "'then'", "'elseif'", "'endif'", "'else'", "'goto'", "'return'", "'const'", "'var'", "'do'", "'dowhile'", "'while'", "'endwhile'", "'exit'", "'function'", "'endfunction'", "'exported'", "'use'", "'include'", "'break'", "'continue'", "'for'", "'endfor'", "'to'", "'foreach'", "'endforeach'", "'repeat'", "'until'", "'program'", "'endprogram'", "'case'", "'default'", "'endcase'", "'enum'", "'endenum'", "'downto'", "'step'", "'reference'", "'out'", "'inout'", "'ByVal'", "'string'", "'long'", "'integer'", "'unsigned'", "'signed'", "'real'", "'float'", "'double'", "'as'", "'is'", "'&&'", "'and'", "'||'", "'or'", "'!'", "'not'", "'byref'", "'unused'", "'error'", "'hash'", "'dictionary'", "'struct'", "'array'", "'stack'", "'in'", "'uninit'", "'true'", "'false'", "", "", "", "", "", "", "", "", "'('", "')'", "'['", "']'", "'{'", "'}'", "'.'", "'->'", "'*'", "'/'", "'%'", "'+'", "'-'", "'+='", "'-='", "'*='", "'/='", "'%='", "'<='", "'<'", "'>='", "'>'", "'>>'", "'<<'", "'&'", "'^'", "'|'", "'<>'", "'!='", "'='", "'=='", "':='", "'.+'", "'.-'", "'.\\u003F'", "';'", "','", "'~'", "'@'", "'::'", "':'", "'++'", "'--'", "'\\u003F:'", "'\\u003F'", "", "", "", "", "'{{'" }, std::vector{ "", "IF", "THEN", "ELSEIF", "ENDIF", "ELSE", "GOTO", "RETURN", "TOK_CONST", "VAR", "DO", "DOWHILE", "WHILE", "ENDWHILE", "EXIT", "FUNCTION", "ENDFUNCTION", "EXPORTED", "USE", "INCLUDE", "BREAK", "CONTINUE", "FOR", "ENDFOR", "TO", "FOREACH", "ENDFOREACH", "REPEAT", "UNTIL", "PROGRAM", "ENDPROGRAM", "CASE", "DEFAULT", "ENDCASE", "ENUM", "ENDENUM", "DOWNTO", "STEP", "REFERENCE", "TOK_OUT", "INOUT", "BYVAL", "STRING", "TOK_LONG", "INTEGER", "UNSIGNED", "SIGNED", "REAL", "FLOAT", "DOUBLE", "AS", "IS", "AND_A", "AND_B", "OR_A", "OR_B", "BANG_A", "BANG_B", "BYREF", "UNUSED", "TOK_ERROR", "HASH", "DICTIONARY", "STRUCT", "ARRAY", "STACK", "TOK_IN", "UNINIT", "BOOL_TRUE", "BOOL_FALSE", "DECIMAL_LITERAL", "HEX_LITERAL", "OCT_LITERAL", "BINARY_LITERAL", "FLOAT_LITERAL", "HEX_FLOAT_LITERAL", "STRING_LITERAL", "INTERPOLATED_STRING_START", "LPAREN", "RPAREN", "LBRACK", "RBRACK", "LBRACE", "RBRACE", "DOT", "ARROW", "MUL", "DIV", "MOD", "ADD", "SUB", "ADD_ASSIGN", "SUB_ASSIGN", "MUL_ASSIGN", "DIV_ASSIGN", "MOD_ASSIGN", "LE", "LT", "GE", "GT", "RSHIFT", "LSHIFT", "BITAND", "CARET", "BITOR", "NOTEQUAL_A", "NOTEQUAL_B", "EQUAL_DEPRECATED", "EQUAL", "ASSIGN", "ADDMEMBER", "DELMEMBER", "CHKMEMBER", "SEMI", "COMMA", "TILDE", "AT", "COLONCOLON", "COLON", "INC", "DEC", "ELVIS", "QUESTION", "WS", "COMMENT", "LINE_COMMENT", "IDENTIFIER", "DOUBLE_LBRACE_INSIDE", "LBRACE_INSIDE", "REGULAR_CHAR_INSIDE", "DOUBLE_QUOTE_INSIDE", "DOUBLE_RBRACE", "STRING_LITERAL_INSIDE", "CLOSE_RBRACE_INSIDE", "FORMAT_STRING" } ); static const int32_t serializedATNSegment[] = { 4,1,134,817,2,0,7,0,2,1,7,1,2,2,7,2,2,3,7,3,2,4,7,4,2,5,7,5,2,6,7,6,2, 7,7,7,2,8,7,8,2,9,7,9,2,10,7,10,2,11,7,11,2,12,7,12,2,13,7,13,2,14,7, 14,2,15,7,15,2,16,7,16,2,17,7,17,2,18,7,18,2,19,7,19,2,20,7,20,2,21,7, 21,2,22,7,22,2,23,7,23,2,24,7,24,2,25,7,25,2,26,7,26,2,27,7,27,2,28,7, 28,2,29,7,29,2,30,7,30,2,31,7,31,2,32,7,32,2,33,7,33,2,34,7,34,2,35,7, 35,2,36,7,36,2,37,7,37,2,38,7,38,2,39,7,39,2,40,7,40,2,41,7,41,2,42,7, 42,2,43,7,43,2,44,7,44,2,45,7,45,2,46,7,46,2,47,7,47,2,48,7,48,2,49,7, 49,2,50,7,50,2,51,7,51,2,52,7,52,2,53,7,53,2,54,7,54,2,55,7,55,2,56,7, 56,2,57,7,57,2,58,7,58,2,59,7,59,2,60,7,60,2,61,7,61,2,62,7,62,2,63,7, 63,2,64,7,64,2,65,7,65,2,66,7,66,2,67,7,67,2,68,7,68,2,69,7,69,2,70,7, 70,2,71,7,71,2,72,7,72,2,73,7,73,2,74,7,74,2,75,7,75,2,76,7,76,2,77,7, 77,2,78,7,78,2,79,7,79,2,80,7,80,1,0,5,0,164,8,0,10,0,12,0,167,9,0,1, 0,1,0,1,1,5,1,172,8,1,10,1,12,1,175,9,1,1,1,1,1,1,2,1,2,1,2,1,3,1,3,3, 3,184,8,3,1,4,1,4,1,4,3,4,189,8,4,1,4,1,4,1,4,1,5,1,5,1,5,5,5,197,8,5, 10,5,12,5,200,9,5,1,6,1,6,1,6,3,6,205,8,6,1,7,1,7,1,7,1,7,1,7,3,7,212, 8,7,1,8,3,8,215,8,8,1,8,1,8,1,8,1,8,1,8,1,8,1,9,1,9,1,10,1,10,1,10,1, 10,1,11,1,11,1,11,1,11,1,12,1,12,1,12,1,12,1,12,1,12,1,13,1,13,1,13,1, 13,1,13,1,13,1,13,1,13,1,13,1,13,1,13,1,13,1,13,1,13,1,13,1,13,1,13,1, 13,1,13,3,13,258,8,13,1,14,1,14,1,14,1,15,1,15,1,15,3,15,266,8,15,1,15, 1,15,1,15,1,15,1,15,5,15,273,8,15,10,15,12,15,276,9,15,1,15,1,15,3,15, 280,8,15,1,15,1,15,1,16,1,16,1,16,1,16,1,17,1,17,3,17,290,8,17,1,17,1, 17,1,18,1,18,1,18,1,18,1,19,1,19,1,19,1,19,1,20,3,20,303,8,20,1,20,1, 20,1,20,1,20,1,20,1,20,1,21,3,21,312,8,21,1,21,1,21,1,21,1,21,1,21,1, 22,1,22,1,22,1,23,1,23,3,23,324,8,23,1,23,1,23,1,24,1,24,3,24,330,8,24, 1,24,1,24,1,25,3,25,335,8,25,1,25,1,25,1,25,1,25,1,26,1,26,1,26,1,26, 1,26,1,26,3,26,347,8,26,1,27,3,27,350,8,27,1,27,1,27,1,27,1,27,1,27,1, 27,1,27,1,28,3,28,360,8,28,1,28,1,28,1,28,1,28,1,28,1,28,1,29,3,29,369, 8,29,1,29,1,29,1,29,1,29,1,29,4,29,376,8,29,11,29,12,29,377,1,29,1,29, 1,30,1,30,1,30,1,30,1,30,1,31,5,31,388,8,31,10,31,12,31,391,9,31,1,32, 1,32,1,32,1,32,1,32,1,32,1,32,3,32,400,8,32,1,33,1,33,1,33,5,33,405,8, 33,10,33,12,33,408,9,33,1,33,3,33,411,8,33,1,34,1,34,1,34,3,34,416,8, 34,1,35,4,35,419,8,35,11,35,12,35,420,1,35,1,35,1,36,1,36,1,36,1,36,1, 36,3,36,430,8,36,1,36,1,36,1,36,3,36,435,8,36,1,37,1,37,3,37,439,8,37, 1,38,1,38,1,38,1,38,1,38,1,38,1,38,1,39,1,39,1,39,1,39,1,39,1,39,1,39, 1,39,1,39,1,40,1,40,1,40,3,40,460,8,40,1,41,1,41,1,41,5,41,465,8,41,10, 41,12,41,468,9,41,1,42,1,42,1,42,1,43,1,43,3,43,475,8,43,1,44,1,44,3, 44,479,8,44,1,44,1,44,1,45,1,45,3,45,485,8,45,1,45,5,45,488,8,45,10,45, 12,45,491,9,45,1,46,1,46,1,46,1,46,1,46,3,46,498,8,46,3,46,500,8,46,1, 47,1,47,3,47,504,8,47,1,47,1,47,1,48,1,48,1,48,5,48,511,8,48,10,48,12, 48,514,9,48,1,49,3,49,517,8,49,1,49,3,49,520,8,49,1,49,1,49,1,49,3,49, 525,8,49,1,50,1,50,1,50,1,50,1,51,1,51,1,51,1,52,1,52,1,52,1,52,1,52, 1,52,3,52,540,8,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52, 1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52, 1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52, 1,52,1,52,1,52,1,52,1,52,1,52,5,52,586,8,52,10,52,12,52,589,9,52,1,53, 1,53,1,53,1,53,1,53,1,53,1,53,1,53,1,53,1,53,1,53,1,53,1,53,3,53,604, 8,53,1,54,1,54,3,54,608,8,54,1,54,1,54,1,54,1,54,1,55,1,55,3,55,616,8, 55,1,56,1,56,3,56,620,8,56,1,57,1,57,3,57,624,8,57,1,58,1,58,3,58,628, 8,58,1,59,1,59,3,59,632,8,59,1,59,1,59,1,59,3,59,637,8,59,1,59,1,59,1, 59,3,59,642,8,59,1,60,1,60,1,60,1,60,1,61,1,61,1,61,5,61,651,8,61,10, 61,12,61,654,9,61,1,62,1,62,1,62,1,62,3,62,660,8,62,1,63,1,63,1,63,1, 63,1,64,1,64,1,64,1,65,1,65,1,65,1,65,3,65,673,8,65,1,65,1,65,1,66,1, 66,3,66,679,8,66,1,66,1,66,1,67,1,67,1,67,3,67,686,8,67,1,67,1,67,1,68, 1,68,1,68,3,68,693,8,68,1,68,1,68,1,68,3,68,698,8,68,3,68,700,8,68,1, 69,1,69,1,69,5,69,705,8,69,10,69,12,69,708,9,69,1,70,1,70,3,70,712,8, 70,1,70,1,70,1,70,3,70,717,8,70,1,70,1,70,1,70,3,70,722,8,70,1,71,1,71, 1,71,3,71,727,8,71,1,72,1,72,1,72,5,72,732,8,72,10,72,12,72,735,9,72, 1,73,1,73,3,73,739,8,73,1,73,1,73,1,73,3,73,744,8,73,1,73,1,73,1,73,3, 73,749,8,73,1,74,1,74,3,74,753,8,74,1,74,1,74,1,74,3,74,758,8,74,1,74, 1,74,1,74,1,74,1,74,3,74,765,8,74,1,74,1,74,1,74,3,74,770,8,74,1,74,1, 74,1,74,3,74,775,8,74,1,75,1,75,1,75,1,75,1,75,3,75,782,8,75,1,76,1,76, 5,76,786,8,76,10,76,12,76,789,9,76,1,76,1,76,1,77,1,77,1,77,1,77,3,77, 797,8,77,1,77,1,77,1,77,3,77,802,8,77,1,77,1,77,1,77,1,77,1,77,3,77,809, 8,77,1,78,1,78,1,79,1,79,1,80,1,80,1,80,0,1,104,81,0,2,4,6,8,10,12,14, 16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60, 62,64,66,68,70,72,74,76,78,80,82,84,86,88,90,92,94,96,98,100,102,104, 106,108,110,112,114,116,118,120,122,124,126,128,130,132,134,136,138,140, 142,144,146,148,150,152,154,156,158,160,0,15,2,0,76,76,126,126,2,0,89, 90,119,120,2,0,56,57,115,115,2,0,86,88,100,102,2,0,89,90,103,104,1,0, 96,99,2,0,105,106,108,108,1,0,52,53,1,0,54,55,1,0,110,112,2,0,91,95,109, 109,1,0,119,120,1,0,70,73,1,0,74,75,1,0,68,69,880,0,165,1,0,0,0,2,173, 1,0,0,0,4,178,1,0,0,0,6,183,1,0,0,0,8,185,1,0,0,0,10,193,1,0,0,0,12,201, 1,0,0,0,14,211,1,0,0,0,16,214,1,0,0,0,18,222,1,0,0,0,20,224,1,0,0,0,22, 228,1,0,0,0,24,232,1,0,0,0,26,257,1,0,0,0,28,259,1,0,0,0,30,262,1,0,0, 0,32,283,1,0,0,0,34,287,1,0,0,0,36,293,1,0,0,0,38,297,1,0,0,0,40,302, 1,0,0,0,42,311,1,0,0,0,44,318,1,0,0,0,46,321,1,0,0,0,48,327,1,0,0,0,50, 334,1,0,0,0,52,346,1,0,0,0,54,349,1,0,0,0,56,359,1,0,0,0,58,368,1,0,0, 0,60,381,1,0,0,0,62,389,1,0,0,0,64,399,1,0,0,0,66,401,1,0,0,0,68,412, 1,0,0,0,70,418,1,0,0,0,72,434,1,0,0,0,74,438,1,0,0,0,76,440,1,0,0,0,78, 447,1,0,0,0,80,456,1,0,0,0,82,461,1,0,0,0,84,469,1,0,0,0,86,472,1,0,0, 0,88,476,1,0,0,0,90,482,1,0,0,0,92,499,1,0,0,0,94,501,1,0,0,0,96,507, 1,0,0,0,98,516,1,0,0,0,100,526,1,0,0,0,102,530,1,0,0,0,104,539,1,0,0, 0,106,603,1,0,0,0,108,605,1,0,0,0,110,613,1,0,0,0,112,617,1,0,0,0,114, 621,1,0,0,0,116,625,1,0,0,0,118,641,1,0,0,0,120,643,1,0,0,0,122,647,1, 0,0,0,124,659,1,0,0,0,126,661,1,0,0,0,128,665,1,0,0,0,130,668,1,0,0,0, 132,676,1,0,0,0,134,682,1,0,0,0,136,699,1,0,0,0,138,701,1,0,0,0,140,721, 1,0,0,0,142,723,1,0,0,0,144,728,1,0,0,0,146,748,1,0,0,0,148,774,1,0,0, 0,150,781,1,0,0,0,152,783,1,0,0,0,154,808,1,0,0,0,156,810,1,0,0,0,158, 812,1,0,0,0,160,814,1,0,0,0,162,164,3,14,7,0,163,162,1,0,0,0,164,167, 1,0,0,0,165,163,1,0,0,0,165,166,1,0,0,0,166,168,1,0,0,0,167,165,1,0,0, 0,168,169,5,0,0,1,169,1,1,0,0,0,170,172,3,6,3,0,171,170,1,0,0,0,172,175, 1,0,0,0,173,171,1,0,0,0,173,174,1,0,0,0,174,176,1,0,0,0,175,173,1,0,0, 0,176,177,5,0,0,1,177,3,1,0,0,0,178,179,3,104,52,0,179,180,5,0,0,1,180, 5,1,0,0,0,181,184,3,8,4,0,182,184,3,36,18,0,183,181,1,0,0,0,183,182,1, 0,0,0,184,7,1,0,0,0,185,186,5,126,0,0,186,188,5,78,0,0,187,189,3,10,5, 0,188,187,1,0,0,0,188,189,1,0,0,0,189,190,1,0,0,0,190,191,5,79,0,0,191, 192,5,113,0,0,192,9,1,0,0,0,193,198,3,12,6,0,194,195,5,114,0,0,195,197, 3,12,6,0,196,194,1,0,0,0,197,200,1,0,0,0,198,196,1,0,0,0,198,199,1,0, 0,0,199,11,1,0,0,0,200,198,1,0,0,0,201,204,5,126,0,0,202,203,5,109,0, 0,203,205,3,104,52,0,204,202,1,0,0,0,204,205,1,0,0,0,205,13,1,0,0,0,206, 212,3,20,10,0,207,212,3,22,11,0,208,212,3,24,12,0,209,212,3,16,8,0,210, 212,3,26,13,0,211,206,1,0,0,0,211,207,1,0,0,0,211,208,1,0,0,0,211,209, 1,0,0,0,211,210,1,0,0,0,212,15,1,0,0,0,213,215,5,17,0,0,214,213,1,0,0, 0,214,215,1,0,0,0,215,216,1,0,0,0,216,217,5,15,0,0,217,218,5,126,0,0, 218,219,3,94,47,0,219,220,3,62,31,0,220,221,5,16,0,0,221,17,1,0,0,0,222, 223,7,0,0,0,223,19,1,0,0,0,224,225,5,18,0,0,225,226,3,18,9,0,226,227, 5,113,0,0,227,21,1,0,0,0,228,229,5,19,0,0,229,230,3,18,9,0,230,231,5, 113,0,0,231,23,1,0,0,0,232,233,5,29,0,0,233,234,5,126,0,0,234,235,3,88, 44,0,235,236,3,62,31,0,236,237,5,30,0,0,237,25,1,0,0,0,238,258,3,30,15, 0,239,258,3,32,16,0,240,258,3,34,17,0,241,258,3,36,18,0,242,258,3,38, 19,0,243,258,3,40,20,0,244,258,3,42,21,0,245,258,3,44,22,0,246,258,3, 46,23,0,247,258,3,48,24,0,248,258,3,50,25,0,249,258,3,54,27,0,250,258, 3,56,28,0,251,258,3,58,29,0,252,258,3,60,30,0,253,258,5,113,0,0,254,255, 3,104,52,0,255,256,5,113,0,0,256,258,1,0,0,0,257,238,1,0,0,0,257,239, 1,0,0,0,257,240,1,0,0,0,257,241,1,0,0,0,257,242,1,0,0,0,257,243,1,0,0, 0,257,244,1,0,0,0,257,245,1,0,0,0,257,246,1,0,0,0,257,247,1,0,0,0,257, 248,1,0,0,0,257,249,1,0,0,0,257,250,1,0,0,0,257,251,1,0,0,0,257,252,1, 0,0,0,257,253,1,0,0,0,257,254,1,0,0,0,258,27,1,0,0,0,259,260,5,126,0, 0,260,261,5,118,0,0,261,29,1,0,0,0,262,263,5,1,0,0,263,265,3,120,60,0, 264,266,5,2,0,0,265,264,1,0,0,0,265,266,1,0,0,0,266,267,1,0,0,0,267,274, 3,62,31,0,268,269,5,3,0,0,269,270,3,120,60,0,270,271,3,62,31,0,271,273, 1,0,0,0,272,268,1,0,0,0,273,276,1,0,0,0,274,272,1,0,0,0,274,275,1,0,0, 0,275,279,1,0,0,0,276,274,1,0,0,0,277,278,5,5,0,0,278,280,3,62,31,0,279, 277,1,0,0,0,279,280,1,0,0,0,280,281,1,0,0,0,281,282,5,4,0,0,282,31,1, 0,0,0,283,284,5,6,0,0,284,285,5,126,0,0,285,286,5,113,0,0,286,33,1,0, 0,0,287,289,5,7,0,0,288,290,3,104,52,0,289,288,1,0,0,0,289,290,1,0,0, 0,290,291,1,0,0,0,291,292,5,113,0,0,292,35,1,0,0,0,293,294,5,8,0,0,294, 295,3,84,42,0,295,296,5,113,0,0,296,37,1,0,0,0,297,298,5,9,0,0,298,299, 3,82,41,0,299,300,5,113,0,0,300,39,1,0,0,0,301,303,3,28,14,0,302,301, 1,0,0,0,302,303,1,0,0,0,303,304,1,0,0,0,304,305,5,10,0,0,305,306,3,62, 31,0,306,307,5,11,0,0,307,308,3,120,60,0,308,309,5,113,0,0,309,41,1,0, 0,0,310,312,3,28,14,0,311,310,1,0,0,0,311,312,1,0,0,0,312,313,1,0,0,0, 313,314,5,12,0,0,314,315,3,120,60,0,315,316,3,62,31,0,316,317,5,13,0, 0,317,43,1,0,0,0,318,319,5,14,0,0,319,320,5,113,0,0,320,45,1,0,0,0,321, 323,5,20,0,0,322,324,5,126,0,0,323,322,1,0,0,0,323,324,1,0,0,0,324,325, 1,0,0,0,325,326,5,113,0,0,326,47,1,0,0,0,327,329,5,21,0,0,328,330,5,126, 0,0,329,328,1,0,0,0,329,330,1,0,0,0,330,331,1,0,0,0,331,332,5,113,0,0, 332,49,1,0,0,0,333,335,3,28,14,0,334,333,1,0,0,0,334,335,1,0,0,0,335, 336,1,0,0,0,336,337,5,22,0,0,337,338,3,74,37,0,338,339,5,23,0,0,339,51, 1,0,0,0,340,347,3,134,67,0,341,347,3,100,50,0,342,347,5,126,0,0,343,347, 3,120,60,0,344,347,3,118,59,0,345,347,3,110,55,0,346,340,1,0,0,0,346, 341,1,0,0,0,346,342,1,0,0,0,346,343,1,0,0,0,346,344,1,0,0,0,346,345,1, 0,0,0,347,53,1,0,0,0,348,350,3,28,14,0,349,348,1,0,0,0,349,350,1,0,0, 0,350,351,1,0,0,0,351,352,5,25,0,0,352,353,5,126,0,0,353,354,5,66,0,0, 354,355,3,52,26,0,355,356,3,62,31,0,356,357,5,26,0,0,357,55,1,0,0,0,358, 360,3,28,14,0,359,358,1,0,0,0,359,360,1,0,0,0,360,361,1,0,0,0,361,362, 5,27,0,0,362,363,3,62,31,0,363,364,5,28,0,0,364,365,3,104,52,0,365,366, 5,113,0,0,366,57,1,0,0,0,367,369,3,28,14,0,368,367,1,0,0,0,368,369,1, 0,0,0,369,370,1,0,0,0,370,371,5,31,0,0,371,372,5,78,0,0,372,373,3,104, 52,0,373,375,5,79,0,0,374,376,3,70,35,0,375,374,1,0,0,0,376,377,1,0,0, 0,377,375,1,0,0,0,377,378,1,0,0,0,378,379,1,0,0,0,379,380,5,33,0,0,380, 59,1,0,0,0,381,382,5,34,0,0,382,383,5,126,0,0,383,384,3,66,33,0,384,385, 5,35,0,0,385,61,1,0,0,0,386,388,3,26,13,0,387,386,1,0,0,0,388,391,1,0, 0,0,389,387,1,0,0,0,389,390,1,0,0,0,390,63,1,0,0,0,391,389,1,0,0,0,392, 393,5,109,0,0,393,400,3,104,52,0,394,395,5,107,0,0,395,396,3,104,52,0, 396,397,6,32,-1,0,397,400,1,0,0,0,398,400,5,64,0,0,399,392,1,0,0,0,399, 394,1,0,0,0,399,398,1,0,0,0,400,65,1,0,0,0,401,406,3,68,34,0,402,403, 5,114,0,0,403,405,3,68,34,0,404,402,1,0,0,0,405,408,1,0,0,0,406,404,1, 0,0,0,406,407,1,0,0,0,407,410,1,0,0,0,408,406,1,0,0,0,409,411,5,114,0, 0,410,409,1,0,0,0,410,411,1,0,0,0,411,67,1,0,0,0,412,415,5,126,0,0,413, 414,5,109,0,0,414,416,3,104,52,0,415,413,1,0,0,0,415,416,1,0,0,0,416, 69,1,0,0,0,417,419,3,72,36,0,418,417,1,0,0,0,419,420,1,0,0,0,420,418, 1,0,0,0,420,421,1,0,0,0,421,422,1,0,0,0,422,423,3,62,31,0,423,71,1,0, 0,0,424,430,3,156,78,0,425,430,3,160,80,0,426,430,5,67,0,0,427,430,5, 126,0,0,428,430,5,76,0,0,429,424,1,0,0,0,429,425,1,0,0,0,429,426,1,0, 0,0,429,427,1,0,0,0,429,428,1,0,0,0,430,431,1,0,0,0,431,435,5,118,0,0, 432,433,5,32,0,0,433,435,5,118,0,0,434,429,1,0,0,0,434,432,1,0,0,0,435, 73,1,0,0,0,436,439,3,78,39,0,437,439,3,76,38,0,438,436,1,0,0,0,438,437, 1,0,0,0,439,75,1,0,0,0,440,441,5,126,0,0,441,442,5,109,0,0,442,443,3, 104,52,0,443,444,5,24,0,0,444,445,3,104,52,0,445,446,3,62,31,0,446,77, 1,0,0,0,447,448,5,78,0,0,448,449,3,104,52,0,449,450,5,113,0,0,450,451, 3,104,52,0,451,452,5,113,0,0,452,453,3,104,52,0,453,454,5,79,0,0,454, 455,3,62,31,0,455,79,1,0,0,0,456,459,5,126,0,0,457,458,5,114,0,0,458, 460,3,80,40,0,459,457,1,0,0,0,459,460,1,0,0,0,460,81,1,0,0,0,461,466, 3,86,43,0,462,463,5,114,0,0,463,465,3,86,43,0,464,462,1,0,0,0,465,468, 1,0,0,0,466,464,1,0,0,0,466,467,1,0,0,0,467,83,1,0,0,0,468,466,1,0,0, 0,469,470,5,126,0,0,470,471,3,64,32,0,471,85,1,0,0,0,472,474,5,126,0, 0,473,475,3,64,32,0,474,473,1,0,0,0,474,475,1,0,0,0,475,87,1,0,0,0,476, 478,5,78,0,0,477,479,3,90,45,0,478,477,1,0,0,0,478,479,1,0,0,0,479,480, 1,0,0,0,480,481,5,79,0,0,481,89,1,0,0,0,482,489,3,92,46,0,483,485,5,114, 0,0,484,483,1,0,0,0,484,485,1,0,0,0,485,486,1,0,0,0,486,488,3,92,46,0, 487,484,1,0,0,0,488,491,1,0,0,0,489,487,1,0,0,0,489,490,1,0,0,0,490,91, 1,0,0,0,491,489,1,0,0,0,492,493,5,59,0,0,493,500,5,126,0,0,494,497,5, 126,0,0,495,496,5,109,0,0,496,498,3,104,52,0,497,495,1,0,0,0,497,498, 1,0,0,0,498,500,1,0,0,0,499,492,1,0,0,0,499,494,1,0,0,0,500,93,1,0,0, 0,501,503,5,78,0,0,502,504,3,96,48,0,503,502,1,0,0,0,503,504,1,0,0,0, 504,505,1,0,0,0,505,506,5,79,0,0,506,95,1,0,0,0,507,512,3,98,49,0,508, 509,5,114,0,0,509,511,3,98,49,0,510,508,1,0,0,0,511,514,1,0,0,0,512,510, 1,0,0,0,512,513,1,0,0,0,513,97,1,0,0,0,514,512,1,0,0,0,515,517,5,58,0, 0,516,515,1,0,0,0,516,517,1,0,0,0,517,519,1,0,0,0,518,520,5,59,0,0,519, 518,1,0,0,0,519,520,1,0,0,0,520,521,1,0,0,0,521,524,5,126,0,0,522,523, 5,109,0,0,523,525,3,104,52,0,524,522,1,0,0,0,524,525,1,0,0,0,525,99,1, 0,0,0,526,527,5,126,0,0,527,528,5,117,0,0,528,529,3,134,67,0,529,101, 1,0,0,0,530,531,5,116,0,0,531,532,5,126,0,0,532,103,1,0,0,0,533,534,6, 52,-1,0,534,540,3,106,53,0,535,536,7,1,0,0,536,540,3,104,52,14,537,538, 7,2,0,0,538,540,3,104,52,13,539,533,1,0,0,0,539,535,1,0,0,0,539,537,1, 0,0,0,540,587,1,0,0,0,541,542,10,12,0,0,542,543,7,3,0,0,543,586,3,104, 52,13,544,545,10,11,0,0,545,546,7,4,0,0,546,586,3,104,52,12,547,548,10, 10,0,0,548,549,5,121,0,0,549,586,3,104,52,11,550,551,10,9,0,0,551,552, 5,66,0,0,552,586,3,104,52,10,553,554,10,8,0,0,554,555,7,5,0,0,555,586, 3,104,52,9,556,557,10,7,0,0,557,558,5,107,0,0,558,559,6,52,-1,0,559,586, 3,104,52,8,560,561,10,6,0,0,561,562,7,6,0,0,562,586,3,104,52,7,563,564, 10,5,0,0,564,565,7,7,0,0,565,586,3,104,52,6,566,567,10,4,0,0,567,568, 7,8,0,0,568,586,3,104,52,5,569,570,10,3,0,0,570,571,5,122,0,0,571,572, 3,104,52,0,572,573,5,118,0,0,573,574,3,104,52,4,574,586,1,0,0,0,575,576, 10,2,0,0,576,577,7,9,0,0,577,586,3,104,52,2,578,579,10,1,0,0,579,580, 7,10,0,0,580,586,3,104,52,1,581,582,10,16,0,0,582,586,3,124,62,0,583, 584,10,15,0,0,584,586,7,11,0,0,585,541,1,0,0,0,585,544,1,0,0,0,585,547, 1,0,0,0,585,550,1,0,0,0,585,553,1,0,0,0,585,556,1,0,0,0,585,560,1,0,0, 0,585,563,1,0,0,0,585,566,1,0,0,0,585,569,1,0,0,0,585,575,1,0,0,0,585, 578,1,0,0,0,585,581,1,0,0,0,585,583,1,0,0,0,586,589,1,0,0,0,587,585,1, 0,0,0,587,588,1,0,0,0,588,105,1,0,0,0,589,587,1,0,0,0,590,604,3,150,75, 0,591,604,3,120,60,0,592,604,3,134,67,0,593,604,3,100,50,0,594,604,5, 126,0,0,595,604,3,102,51,0,596,604,3,108,54,0,597,604,3,110,55,0,598, 604,3,112,56,0,599,604,3,114,57,0,600,604,3,116,58,0,601,604,3,118,59, 0,602,604,3,152,76,0,603,590,1,0,0,0,603,591,1,0,0,0,603,592,1,0,0,0, 603,593,1,0,0,0,603,594,1,0,0,0,603,595,1,0,0,0,603,596,1,0,0,0,603,597, 1,0,0,0,603,598,1,0,0,0,603,599,1,0,0,0,603,600,1,0,0,0,603,601,1,0,0, 0,603,602,1,0,0,0,604,107,1,0,0,0,605,607,5,116,0,0,606,608,3,94,47,0, 607,606,1,0,0,0,607,608,1,0,0,0,608,609,1,0,0,0,609,610,5,82,0,0,610, 611,3,62,31,0,611,612,5,83,0,0,612,109,1,0,0,0,613,615,5,64,0,0,614,616, 3,148,74,0,615,614,1,0,0,0,615,616,1,0,0,0,616,111,1,0,0,0,617,619,5, 63,0,0,618,620,3,140,70,0,619,618,1,0,0,0,619,620,1,0,0,0,620,113,1,0, 0,0,621,623,5,62,0,0,622,624,3,146,73,0,623,622,1,0,0,0,623,624,1,0,0, 0,624,115,1,0,0,0,625,627,5,60,0,0,626,628,3,140,70,0,627,626,1,0,0,0, 627,628,1,0,0,0,628,117,1,0,0,0,629,631,5,82,0,0,630,632,3,122,61,0,631, 630,1,0,0,0,631,632,1,0,0,0,632,633,1,0,0,0,633,642,5,83,0,0,634,636, 5,82,0,0,635,637,3,122,61,0,636,635,1,0,0,0,636,637,1,0,0,0,637,638,1, 0,0,0,638,639,5,114,0,0,639,640,5,83,0,0,640,642,6,59,-1,0,641,629,1, 0,0,0,641,634,1,0,0,0,642,119,1,0,0,0,643,644,5,78,0,0,644,645,3,104, 52,0,645,646,5,79,0,0,646,121,1,0,0,0,647,652,3,104,52,0,648,649,5,114, 0,0,649,651,3,104,52,0,650,648,1,0,0,0,651,654,1,0,0,0,652,650,1,0,0, 0,652,653,1,0,0,0,653,123,1,0,0,0,654,652,1,0,0,0,655,660,3,126,63,0, 656,660,3,130,65,0,657,660,3,128,64,0,658,660,3,132,66,0,659,655,1,0, 0,0,659,656,1,0,0,0,659,657,1,0,0,0,659,658,1,0,0,0,660,125,1,0,0,0,661, 662,5,80,0,0,662,663,3,122,61,0,663,664,5,81,0,0,664,127,1,0,0,0,665, 666,5,84,0,0,666,667,7,0,0,0,667,129,1,0,0,0,668,669,5,84,0,0,669,670, 5,126,0,0,670,672,5,78,0,0,671,673,3,122,61,0,672,671,1,0,0,0,672,673, 1,0,0,0,673,674,1,0,0,0,674,675,5,79,0,0,675,131,1,0,0,0,676,678,5,78, 0,0,677,679,3,122,61,0,678,677,1,0,0,0,678,679,1,0,0,0,679,680,1,0,0, 0,680,681,5,79,0,0,681,133,1,0,0,0,682,683,5,126,0,0,683,685,5,78,0,0, 684,686,3,122,61,0,685,684,1,0,0,0,685,686,1,0,0,0,686,687,1,0,0,0,687, 688,5,79,0,0,688,135,1,0,0,0,689,692,5,126,0,0,690,691,5,109,0,0,691, 693,3,104,52,0,692,690,1,0,0,0,692,693,1,0,0,0,693,700,1,0,0,0,694,697, 5,76,0,0,695,696,5,109,0,0,696,698,3,104,52,0,697,695,1,0,0,0,697,698, 1,0,0,0,698,700,1,0,0,0,699,689,1,0,0,0,699,694,1,0,0,0,700,137,1,0,0, 0,701,706,3,136,68,0,702,703,5,114,0,0,703,705,3,136,68,0,704,702,1,0, 0,0,705,708,1,0,0,0,706,704,1,0,0,0,706,707,1,0,0,0,707,139,1,0,0,0,708, 706,1,0,0,0,709,711,5,82,0,0,710,712,3,138,69,0,711,710,1,0,0,0,711,712, 1,0,0,0,712,713,1,0,0,0,713,722,5,83,0,0,714,716,5,82,0,0,715,717,3,138, 69,0,716,715,1,0,0,0,716,717,1,0,0,0,717,718,1,0,0,0,718,719,5,114,0, 0,719,720,5,83,0,0,720,722,6,70,-1,0,721,709,1,0,0,0,721,714,1,0,0,0, 722,141,1,0,0,0,723,726,3,104,52,0,724,725,5,85,0,0,725,727,3,104,52, 0,726,724,1,0,0,0,726,727,1,0,0,0,727,143,1,0,0,0,728,733,3,142,71,0, 729,730,5,114,0,0,730,732,3,142,71,0,731,729,1,0,0,0,732,735,1,0,0,0, 733,731,1,0,0,0,733,734,1,0,0,0,734,145,1,0,0,0,735,733,1,0,0,0,736,738, 5,82,0,0,737,739,3,144,72,0,738,737,1,0,0,0,738,739,1,0,0,0,739,740,1, 0,0,0,740,749,5,83,0,0,741,743,5,82,0,0,742,744,3,144,72,0,743,742,1, 0,0,0,743,744,1,0,0,0,744,745,1,0,0,0,745,746,5,114,0,0,746,747,5,83, 0,0,747,749,6,73,-1,0,748,736,1,0,0,0,748,741,1,0,0,0,749,147,1,0,0,0, 750,752,5,82,0,0,751,753,3,122,61,0,752,751,1,0,0,0,752,753,1,0,0,0,753, 754,1,0,0,0,754,775,5,83,0,0,755,757,5,82,0,0,756,758,3,122,61,0,757, 756,1,0,0,0,757,758,1,0,0,0,758,759,1,0,0,0,759,760,5,114,0,0,760,761, 5,83,0,0,761,775,6,74,-1,0,762,764,5,78,0,0,763,765,3,122,61,0,764,763, 1,0,0,0,764,765,1,0,0,0,765,766,1,0,0,0,766,775,5,79,0,0,767,769,5,78, 0,0,768,770,3,122,61,0,769,768,1,0,0,0,769,770,1,0,0,0,770,771,1,0,0, 0,771,772,5,114,0,0,772,773,5,79,0,0,773,775,6,74,-1,0,774,750,1,0,0, 0,774,755,1,0,0,0,774,762,1,0,0,0,774,767,1,0,0,0,775,149,1,0,0,0,776, 782,3,156,78,0,777,782,3,158,79,0,778,782,3,160,80,0,779,782,5,76,0,0, 780,782,5,67,0,0,781,776,1,0,0,0,781,777,1,0,0,0,781,778,1,0,0,0,781, 779,1,0,0,0,781,780,1,0,0,0,782,151,1,0,0,0,783,787,5,77,0,0,784,786, 3,154,77,0,785,784,1,0,0,0,786,789,1,0,0,0,787,785,1,0,0,0,787,788,1, 0,0,0,788,790,1,0,0,0,789,787,1,0,0,0,790,791,5,130,0,0,791,153,1,0,0, 0,792,793,5,128,0,0,793,796,3,104,52,0,794,795,5,118,0,0,795,797,5,134, 0,0,796,794,1,0,0,0,796,797,1,0,0,0,797,809,1,0,0,0,798,801,5,128,0,0, 799,800,5,118,0,0,800,802,5,134,0,0,801,799,1,0,0,0,801,802,1,0,0,0,802, 803,1,0,0,0,803,809,6,77,-1,0,804,809,5,127,0,0,805,809,5,129,0,0,806, 809,5,131,0,0,807,809,5,132,0,0,808,792,1,0,0,0,808,798,1,0,0,0,808,804, 1,0,0,0,808,805,1,0,0,0,808,806,1,0,0,0,808,807,1,0,0,0,809,155,1,0,0, 0,810,811,7,12,0,0,811,157,1,0,0,0,812,813,7,13,0,0,813,159,1,0,0,0,814, 815,7,14,0,0,815,161,1,0,0,0,84,165,173,183,188,198,204,211,214,257,265, 274,279,289,302,311,323,329,334,346,349,359,368,377,389,399,406,410,415, 420,429,434,438,459,466,474,478,484,489,497,499,503,512,516,519,524,539, 585,587,603,607,615,619,623,627,631,636,641,652,659,672,678,685,692,697, 699,706,711,716,721,726,733,738,743,748,752,757,764,769,774,781,787,796, 801,808 }; staticData->serializedATN = antlr4::atn::SerializedATNView(serializedATNSegment, sizeof(serializedATNSegment) / sizeof(serializedATNSegment[0])); antlr4::atn::ATNDeserializer deserializer; staticData->atn = deserializer.deserialize(staticData->serializedATN); const size_t count = staticData->atn->getNumberOfDecisions(); staticData->decisionToDFA.reserve(count); for (size_t i = 0; i < count; i++) { staticData->decisionToDFA.emplace_back(staticData->atn->getDecisionState(i), i); } escriptparserParserStaticData = staticData.release(); } } EscriptParser::EscriptParser(TokenStream *input) : EscriptParser(input, antlr4::atn::ParserATNSimulatorOptions()) {} EscriptParser::EscriptParser(TokenStream *input, const antlr4::atn::ParserATNSimulatorOptions &options) : Parser(input) { EscriptParser::initialize(); _interpreter = new atn::ParserATNSimulator(this, *escriptparserParserStaticData->atn, escriptparserParserStaticData->decisionToDFA, escriptparserParserStaticData->sharedContextCache, options); } EscriptParser::~EscriptParser() { delete _interpreter; } const atn::ATN& EscriptParser::getATN() const { return *escriptparserParserStaticData->atn; } std::string EscriptParser::getGrammarFileName() const { return "EscriptParser.g4"; } const std::vector& EscriptParser::getRuleNames() const { return escriptparserParserStaticData->ruleNames; } const dfa::Vocabulary& EscriptParser::getVocabulary() const { return escriptparserParserStaticData->vocabulary; } antlr4::atn::SerializedATNView EscriptParser::getSerializedATN() const { return escriptparserParserStaticData->serializedATN; } //----------------- CompilationUnitContext ------------------------------------------------------------------ EscriptParser::CompilationUnitContext::CompilationUnitContext(ParserRuleContext *parent, size_t invokingState) : ParserRuleContext(parent, invokingState) { } tree::TerminalNode* EscriptParser::CompilationUnitContext::EOF() { return getToken(EscriptParser::EOF, 0); } std::vector EscriptParser::CompilationUnitContext::topLevelDeclaration() { return getRuleContexts(); } EscriptParser::TopLevelDeclarationContext* EscriptParser::CompilationUnitContext::topLevelDeclaration(size_t i) { return getRuleContext(i); } size_t EscriptParser::CompilationUnitContext::getRuleIndex() const { return EscriptParser::RuleCompilationUnit; } void EscriptParser::CompilationUnitContext::enterRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->enterCompilationUnit(this); } void EscriptParser::CompilationUnitContext::exitRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->exitCompilationUnit(this); } std::any EscriptParser::CompilationUnitContext::accept(tree::ParseTreeVisitor *visitor) { if (auto parserVisitor = dynamic_cast(visitor)) return parserVisitor->visitCompilationUnit(this); else return visitor->visitChildren(this); } EscriptParser::CompilationUnitContext* EscriptParser::compilationUnit() { CompilationUnitContext *_localctx = _tracker.createInstance(_ctx, getState()); enterRule(_localctx, 0, EscriptParser::RuleCompilationUnit); size_t _la = 0; #if __cplusplus > 201703L auto onExit = finally([=, this] { #else auto onExit = finally([=] { #endif exitRule(); }); try { enterOuterAlt(_localctx, 1); setState(165); _errHandler->sync(this); _la = _input->LA(1); while ((((_la & ~ 0x3fULL) == 0) && ((1ULL << _la) & -3242591711666448446) != 0) || ((((_la - 64) & ~ 0x3fULL) == 0) && ((1ULL << (_la - 64)) & 4727090758979715065) != 0)) { setState(162); topLevelDeclaration(); setState(167); _errHandler->sync(this); _la = _input->LA(1); } setState(168); match(EscriptParser::EOF); } catch (RecognitionException &e) { _errHandler->reportError(this, e); _localctx->exception = std::current_exception(); _errHandler->recover(this, _localctx->exception); } return _localctx; } //----------------- ModuleUnitContext ------------------------------------------------------------------ EscriptParser::ModuleUnitContext::ModuleUnitContext(ParserRuleContext *parent, size_t invokingState) : ParserRuleContext(parent, invokingState) { } tree::TerminalNode* EscriptParser::ModuleUnitContext::EOF() { return getToken(EscriptParser::EOF, 0); } std::vector EscriptParser::ModuleUnitContext::moduleDeclarationStatement() { return getRuleContexts(); } EscriptParser::ModuleDeclarationStatementContext* EscriptParser::ModuleUnitContext::moduleDeclarationStatement(size_t i) { return getRuleContext(i); } size_t EscriptParser::ModuleUnitContext::getRuleIndex() const { return EscriptParser::RuleModuleUnit; } void EscriptParser::ModuleUnitContext::enterRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->enterModuleUnit(this); } void EscriptParser::ModuleUnitContext::exitRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->exitModuleUnit(this); } std::any EscriptParser::ModuleUnitContext::accept(tree::ParseTreeVisitor *visitor) { if (auto parserVisitor = dynamic_cast(visitor)) return parserVisitor->visitModuleUnit(this); else return visitor->visitChildren(this); } EscriptParser::ModuleUnitContext* EscriptParser::moduleUnit() { ModuleUnitContext *_localctx = _tracker.createInstance(_ctx, getState()); enterRule(_localctx, 2, EscriptParser::RuleModuleUnit); size_t _la = 0; #if __cplusplus > 201703L auto onExit = finally([=, this] { #else auto onExit = finally([=] { #endif exitRule(); }); try { enterOuterAlt(_localctx, 1); setState(173); _errHandler->sync(this); _la = _input->LA(1); while (_la == EscriptParser::TOK_CONST || _la == EscriptParser::IDENTIFIER) { setState(170); moduleDeclarationStatement(); setState(175); _errHandler->sync(this); _la = _input->LA(1); } setState(176); match(EscriptParser::EOF); } catch (RecognitionException &e) { _errHandler->reportError(this, e); _localctx->exception = std::current_exception(); _errHandler->recover(this, _localctx->exception); } return _localctx; } //----------------- EvaluateUnitContext ------------------------------------------------------------------ EscriptParser::EvaluateUnitContext::EvaluateUnitContext(ParserRuleContext *parent, size_t invokingState) : ParserRuleContext(parent, invokingState) { } EscriptParser::ExpressionContext* EscriptParser::EvaluateUnitContext::expression() { return getRuleContext(0); } tree::TerminalNode* EscriptParser::EvaluateUnitContext::EOF() { return getToken(EscriptParser::EOF, 0); } size_t EscriptParser::EvaluateUnitContext::getRuleIndex() const { return EscriptParser::RuleEvaluateUnit; } void EscriptParser::EvaluateUnitContext::enterRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->enterEvaluateUnit(this); } void EscriptParser::EvaluateUnitContext::exitRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->exitEvaluateUnit(this); } std::any EscriptParser::EvaluateUnitContext::accept(tree::ParseTreeVisitor *visitor) { if (auto parserVisitor = dynamic_cast(visitor)) return parserVisitor->visitEvaluateUnit(this); else return visitor->visitChildren(this); } EscriptParser::EvaluateUnitContext* EscriptParser::evaluateUnit() { EvaluateUnitContext *_localctx = _tracker.createInstance(_ctx, getState()); enterRule(_localctx, 4, EscriptParser::RuleEvaluateUnit); #if __cplusplus > 201703L auto onExit = finally([=, this] { #else auto onExit = finally([=] { #endif exitRule(); }); try { enterOuterAlt(_localctx, 1); setState(178); expression(0); setState(179); match(EscriptParser::EOF); } catch (RecognitionException &e) { _errHandler->reportError(this, e); _localctx->exception = std::current_exception(); _errHandler->recover(this, _localctx->exception); } return _localctx; } //----------------- ModuleDeclarationStatementContext ------------------------------------------------------------------ EscriptParser::ModuleDeclarationStatementContext::ModuleDeclarationStatementContext(ParserRuleContext *parent, size_t invokingState) : ParserRuleContext(parent, invokingState) { } EscriptParser::ModuleFunctionDeclarationContext* EscriptParser::ModuleDeclarationStatementContext::moduleFunctionDeclaration() { return getRuleContext(0); } EscriptParser::ConstStatementContext* EscriptParser::ModuleDeclarationStatementContext::constStatement() { return getRuleContext(0); } size_t EscriptParser::ModuleDeclarationStatementContext::getRuleIndex() const { return EscriptParser::RuleModuleDeclarationStatement; } void EscriptParser::ModuleDeclarationStatementContext::enterRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->enterModuleDeclarationStatement(this); } void EscriptParser::ModuleDeclarationStatementContext::exitRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->exitModuleDeclarationStatement(this); } std::any EscriptParser::ModuleDeclarationStatementContext::accept(tree::ParseTreeVisitor *visitor) { if (auto parserVisitor = dynamic_cast(visitor)) return parserVisitor->visitModuleDeclarationStatement(this); else return visitor->visitChildren(this); } EscriptParser::ModuleDeclarationStatementContext* EscriptParser::moduleDeclarationStatement() { ModuleDeclarationStatementContext *_localctx = _tracker.createInstance(_ctx, getState()); enterRule(_localctx, 6, EscriptParser::RuleModuleDeclarationStatement); #if __cplusplus > 201703L auto onExit = finally([=, this] { #else auto onExit = finally([=] { #endif exitRule(); }); try { setState(183); _errHandler->sync(this); switch (_input->LA(1)) { case EscriptParser::IDENTIFIER: { enterOuterAlt(_localctx, 1); setState(181); moduleFunctionDeclaration(); break; } case EscriptParser::TOK_CONST: { enterOuterAlt(_localctx, 2); setState(182); constStatement(); break; } default: throw NoViableAltException(this); } } catch (RecognitionException &e) { _errHandler->reportError(this, e); _localctx->exception = std::current_exception(); _errHandler->recover(this, _localctx->exception); } return _localctx; } //----------------- ModuleFunctionDeclarationContext ------------------------------------------------------------------ EscriptParser::ModuleFunctionDeclarationContext::ModuleFunctionDeclarationContext(ParserRuleContext *parent, size_t invokingState) : ParserRuleContext(parent, invokingState) { } tree::TerminalNode* EscriptParser::ModuleFunctionDeclarationContext::IDENTIFIER() { return getToken(EscriptParser::IDENTIFIER, 0); } tree::TerminalNode* EscriptParser::ModuleFunctionDeclarationContext::LPAREN() { return getToken(EscriptParser::LPAREN, 0); } tree::TerminalNode* EscriptParser::ModuleFunctionDeclarationContext::RPAREN() { return getToken(EscriptParser::RPAREN, 0); } tree::TerminalNode* EscriptParser::ModuleFunctionDeclarationContext::SEMI() { return getToken(EscriptParser::SEMI, 0); } EscriptParser::ModuleFunctionParameterListContext* EscriptParser::ModuleFunctionDeclarationContext::moduleFunctionParameterList() { return getRuleContext(0); } size_t EscriptParser::ModuleFunctionDeclarationContext::getRuleIndex() const { return EscriptParser::RuleModuleFunctionDeclaration; } void EscriptParser::ModuleFunctionDeclarationContext::enterRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->enterModuleFunctionDeclaration(this); } void EscriptParser::ModuleFunctionDeclarationContext::exitRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->exitModuleFunctionDeclaration(this); } std::any EscriptParser::ModuleFunctionDeclarationContext::accept(tree::ParseTreeVisitor *visitor) { if (auto parserVisitor = dynamic_cast(visitor)) return parserVisitor->visitModuleFunctionDeclaration(this); else return visitor->visitChildren(this); } EscriptParser::ModuleFunctionDeclarationContext* EscriptParser::moduleFunctionDeclaration() { ModuleFunctionDeclarationContext *_localctx = _tracker.createInstance(_ctx, getState()); enterRule(_localctx, 8, EscriptParser::RuleModuleFunctionDeclaration); size_t _la = 0; #if __cplusplus > 201703L auto onExit = finally([=, this] { #else auto onExit = finally([=] { #endif exitRule(); }); try { enterOuterAlt(_localctx, 1); setState(185); match(EscriptParser::IDENTIFIER); setState(186); match(EscriptParser::LPAREN); setState(188); _errHandler->sync(this); _la = _input->LA(1); if (_la == EscriptParser::IDENTIFIER) { setState(187); moduleFunctionParameterList(); } setState(190); match(EscriptParser::RPAREN); setState(191); match(EscriptParser::SEMI); } catch (RecognitionException &e) { _errHandler->reportError(this, e); _localctx->exception = std::current_exception(); _errHandler->recover(this, _localctx->exception); } return _localctx; } //----------------- ModuleFunctionParameterListContext ------------------------------------------------------------------ EscriptParser::ModuleFunctionParameterListContext::ModuleFunctionParameterListContext(ParserRuleContext *parent, size_t invokingState) : ParserRuleContext(parent, invokingState) { } std::vector EscriptParser::ModuleFunctionParameterListContext::moduleFunctionParameter() { return getRuleContexts(); } EscriptParser::ModuleFunctionParameterContext* EscriptParser::ModuleFunctionParameterListContext::moduleFunctionParameter(size_t i) { return getRuleContext(i); } std::vector EscriptParser::ModuleFunctionParameterListContext::COMMA() { return getTokens(EscriptParser::COMMA); } tree::TerminalNode* EscriptParser::ModuleFunctionParameterListContext::COMMA(size_t i) { return getToken(EscriptParser::COMMA, i); } size_t EscriptParser::ModuleFunctionParameterListContext::getRuleIndex() const { return EscriptParser::RuleModuleFunctionParameterList; } void EscriptParser::ModuleFunctionParameterListContext::enterRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->enterModuleFunctionParameterList(this); } void EscriptParser::ModuleFunctionParameterListContext::exitRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->exitModuleFunctionParameterList(this); } std::any EscriptParser::ModuleFunctionParameterListContext::accept(tree::ParseTreeVisitor *visitor) { if (auto parserVisitor = dynamic_cast(visitor)) return parserVisitor->visitModuleFunctionParameterList(this); else return visitor->visitChildren(this); } EscriptParser::ModuleFunctionParameterListContext* EscriptParser::moduleFunctionParameterList() { ModuleFunctionParameterListContext *_localctx = _tracker.createInstance(_ctx, getState()); enterRule(_localctx, 10, EscriptParser::RuleModuleFunctionParameterList); size_t _la = 0; #if __cplusplus > 201703L auto onExit = finally([=, this] { #else auto onExit = finally([=] { #endif exitRule(); }); try { enterOuterAlt(_localctx, 1); setState(193); moduleFunctionParameter(); setState(198); _errHandler->sync(this); _la = _input->LA(1); while (_la == EscriptParser::COMMA) { setState(194); match(EscriptParser::COMMA); setState(195); moduleFunctionParameter(); setState(200); _errHandler->sync(this); _la = _input->LA(1); } } catch (RecognitionException &e) { _errHandler->reportError(this, e); _localctx->exception = std::current_exception(); _errHandler->recover(this, _localctx->exception); } return _localctx; } //----------------- ModuleFunctionParameterContext ------------------------------------------------------------------ EscriptParser::ModuleFunctionParameterContext::ModuleFunctionParameterContext(ParserRuleContext *parent, size_t invokingState) : ParserRuleContext(parent, invokingState) { } tree::TerminalNode* EscriptParser::ModuleFunctionParameterContext::IDENTIFIER() { return getToken(EscriptParser::IDENTIFIER, 0); } tree::TerminalNode* EscriptParser::ModuleFunctionParameterContext::ASSIGN() { return getToken(EscriptParser::ASSIGN, 0); } EscriptParser::ExpressionContext* EscriptParser::ModuleFunctionParameterContext::expression() { return getRuleContext(0); } size_t EscriptParser::ModuleFunctionParameterContext::getRuleIndex() const { return EscriptParser::RuleModuleFunctionParameter; } void EscriptParser::ModuleFunctionParameterContext::enterRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->enterModuleFunctionParameter(this); } void EscriptParser::ModuleFunctionParameterContext::exitRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->exitModuleFunctionParameter(this); } std::any EscriptParser::ModuleFunctionParameterContext::accept(tree::ParseTreeVisitor *visitor) { if (auto parserVisitor = dynamic_cast(visitor)) return parserVisitor->visitModuleFunctionParameter(this); else return visitor->visitChildren(this); } EscriptParser::ModuleFunctionParameterContext* EscriptParser::moduleFunctionParameter() { ModuleFunctionParameterContext *_localctx = _tracker.createInstance(_ctx, getState()); enterRule(_localctx, 12, EscriptParser::RuleModuleFunctionParameter); size_t _la = 0; #if __cplusplus > 201703L auto onExit = finally([=, this] { #else auto onExit = finally([=] { #endif exitRule(); }); try { enterOuterAlt(_localctx, 1); setState(201); match(EscriptParser::IDENTIFIER); setState(204); _errHandler->sync(this); _la = _input->LA(1); if (_la == EscriptParser::ASSIGN) { setState(202); match(EscriptParser::ASSIGN); setState(203); expression(0); } } catch (RecognitionException &e) { _errHandler->reportError(this, e); _localctx->exception = std::current_exception(); _errHandler->recover(this, _localctx->exception); } return _localctx; } //----------------- TopLevelDeclarationContext ------------------------------------------------------------------ EscriptParser::TopLevelDeclarationContext::TopLevelDeclarationContext(ParserRuleContext *parent, size_t invokingState) : ParserRuleContext(parent, invokingState) { } EscriptParser::UseDeclarationContext* EscriptParser::TopLevelDeclarationContext::useDeclaration() { return getRuleContext(0); } EscriptParser::IncludeDeclarationContext* EscriptParser::TopLevelDeclarationContext::includeDeclaration() { return getRuleContext(0); } EscriptParser::ProgramDeclarationContext* EscriptParser::TopLevelDeclarationContext::programDeclaration() { return getRuleContext(0); } EscriptParser::FunctionDeclarationContext* EscriptParser::TopLevelDeclarationContext::functionDeclaration() { return getRuleContext(0); } EscriptParser::StatementContext* EscriptParser::TopLevelDeclarationContext::statement() { return getRuleContext(0); } size_t EscriptParser::TopLevelDeclarationContext::getRuleIndex() const { return EscriptParser::RuleTopLevelDeclaration; } void EscriptParser::TopLevelDeclarationContext::enterRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->enterTopLevelDeclaration(this); } void EscriptParser::TopLevelDeclarationContext::exitRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->exitTopLevelDeclaration(this); } std::any EscriptParser::TopLevelDeclarationContext::accept(tree::ParseTreeVisitor *visitor) { if (auto parserVisitor = dynamic_cast(visitor)) return parserVisitor->visitTopLevelDeclaration(this); else return visitor->visitChildren(this); } EscriptParser::TopLevelDeclarationContext* EscriptParser::topLevelDeclaration() { TopLevelDeclarationContext *_localctx = _tracker.createInstance(_ctx, getState()); enterRule(_localctx, 14, EscriptParser::RuleTopLevelDeclaration); #if __cplusplus > 201703L auto onExit = finally([=, this] { #else auto onExit = finally([=] { #endif exitRule(); }); try { setState(211); _errHandler->sync(this); switch (_input->LA(1)) { case EscriptParser::USE: { enterOuterAlt(_localctx, 1); setState(206); useDeclaration(); break; } case EscriptParser::INCLUDE: { enterOuterAlt(_localctx, 2); setState(207); includeDeclaration(); break; } case EscriptParser::PROGRAM: { enterOuterAlt(_localctx, 3); setState(208); programDeclaration(); break; } case EscriptParser::FUNCTION: case EscriptParser::EXPORTED: { enterOuterAlt(_localctx, 4); setState(209); functionDeclaration(); break; } case EscriptParser::IF: case EscriptParser::GOTO: case EscriptParser::RETURN: case EscriptParser::TOK_CONST: case EscriptParser::VAR: case EscriptParser::DO: case EscriptParser::WHILE: case EscriptParser::EXIT: case EscriptParser::BREAK: case EscriptParser::CONTINUE: case EscriptParser::FOR: case EscriptParser::FOREACH: case EscriptParser::REPEAT: case EscriptParser::CASE: case EscriptParser::ENUM: case EscriptParser::BANG_A: case EscriptParser::BANG_B: case EscriptParser::TOK_ERROR: case EscriptParser::DICTIONARY: case EscriptParser::STRUCT: case EscriptParser::ARRAY: case EscriptParser::UNINIT: case EscriptParser::BOOL_TRUE: case EscriptParser::BOOL_FALSE: case EscriptParser::DECIMAL_LITERAL: case EscriptParser::HEX_LITERAL: case EscriptParser::OCT_LITERAL: case EscriptParser::BINARY_LITERAL: case EscriptParser::FLOAT_LITERAL: case EscriptParser::HEX_FLOAT_LITERAL: case EscriptParser::STRING_LITERAL: case EscriptParser::INTERPOLATED_STRING_START: case EscriptParser::LPAREN: case EscriptParser::LBRACE: case EscriptParser::ADD: case EscriptParser::SUB: case EscriptParser::SEMI: case EscriptParser::TILDE: case EscriptParser::AT: case EscriptParser::INC: case EscriptParser::DEC: case EscriptParser::IDENTIFIER: { enterOuterAlt(_localctx, 5); setState(210); statement(); break; } default: throw NoViableAltException(this); } } catch (RecognitionException &e) { _errHandler->reportError(this, e); _localctx->exception = std::current_exception(); _errHandler->recover(this, _localctx->exception); } return _localctx; } //----------------- FunctionDeclarationContext ------------------------------------------------------------------ EscriptParser::FunctionDeclarationContext::FunctionDeclarationContext(ParserRuleContext *parent, size_t invokingState) : ParserRuleContext(parent, invokingState) { } tree::TerminalNode* EscriptParser::FunctionDeclarationContext::FUNCTION() { return getToken(EscriptParser::FUNCTION, 0); } tree::TerminalNode* EscriptParser::FunctionDeclarationContext::IDENTIFIER() { return getToken(EscriptParser::IDENTIFIER, 0); } EscriptParser::FunctionParametersContext* EscriptParser::FunctionDeclarationContext::functionParameters() { return getRuleContext(0); } EscriptParser::BlockContext* EscriptParser::FunctionDeclarationContext::block() { return getRuleContext(0); } tree::TerminalNode* EscriptParser::FunctionDeclarationContext::ENDFUNCTION() { return getToken(EscriptParser::ENDFUNCTION, 0); } tree::TerminalNode* EscriptParser::FunctionDeclarationContext::EXPORTED() { return getToken(EscriptParser::EXPORTED, 0); } size_t EscriptParser::FunctionDeclarationContext::getRuleIndex() const { return EscriptParser::RuleFunctionDeclaration; } void EscriptParser::FunctionDeclarationContext::enterRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->enterFunctionDeclaration(this); } void EscriptParser::FunctionDeclarationContext::exitRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->exitFunctionDeclaration(this); } std::any EscriptParser::FunctionDeclarationContext::accept(tree::ParseTreeVisitor *visitor) { if (auto parserVisitor = dynamic_cast(visitor)) return parserVisitor->visitFunctionDeclaration(this); else return visitor->visitChildren(this); } EscriptParser::FunctionDeclarationContext* EscriptParser::functionDeclaration() { FunctionDeclarationContext *_localctx = _tracker.createInstance(_ctx, getState()); enterRule(_localctx, 16, EscriptParser::RuleFunctionDeclaration); size_t _la = 0; #if __cplusplus > 201703L auto onExit = finally([=, this] { #else auto onExit = finally([=] { #endif exitRule(); }); try { enterOuterAlt(_localctx, 1); setState(214); _errHandler->sync(this); _la = _input->LA(1); if (_la == EscriptParser::EXPORTED) { setState(213); match(EscriptParser::EXPORTED); } setState(216); match(EscriptParser::FUNCTION); setState(217); match(EscriptParser::IDENTIFIER); setState(218); functionParameters(); setState(219); block(); setState(220); match(EscriptParser::ENDFUNCTION); } catch (RecognitionException &e) { _errHandler->reportError(this, e); _localctx->exception = std::current_exception(); _errHandler->recover(this, _localctx->exception); } return _localctx; } //----------------- StringIdentifierContext ------------------------------------------------------------------ EscriptParser::StringIdentifierContext::StringIdentifierContext(ParserRuleContext *parent, size_t invokingState) : ParserRuleContext(parent, invokingState) { } tree::TerminalNode* EscriptParser::StringIdentifierContext::STRING_LITERAL() { return getToken(EscriptParser::STRING_LITERAL, 0); } tree::TerminalNode* EscriptParser::StringIdentifierContext::IDENTIFIER() { return getToken(EscriptParser::IDENTIFIER, 0); } size_t EscriptParser::StringIdentifierContext::getRuleIndex() const { return EscriptParser::RuleStringIdentifier; } void EscriptParser::StringIdentifierContext::enterRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->enterStringIdentifier(this); } void EscriptParser::StringIdentifierContext::exitRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->exitStringIdentifier(this); } std::any EscriptParser::StringIdentifierContext::accept(tree::ParseTreeVisitor *visitor) { if (auto parserVisitor = dynamic_cast(visitor)) return parserVisitor->visitStringIdentifier(this); else return visitor->visitChildren(this); } EscriptParser::StringIdentifierContext* EscriptParser::stringIdentifier() { StringIdentifierContext *_localctx = _tracker.createInstance(_ctx, getState()); enterRule(_localctx, 18, EscriptParser::RuleStringIdentifier); size_t _la = 0; #if __cplusplus > 201703L auto onExit = finally([=, this] { #else auto onExit = finally([=] { #endif exitRule(); }); try { enterOuterAlt(_localctx, 1); setState(222); _la = _input->LA(1); if (!(_la == EscriptParser::STRING_LITERAL || _la == EscriptParser::IDENTIFIER)) { _errHandler->recoverInline(this); } else { _errHandler->reportMatch(this); consume(); } } catch (RecognitionException &e) { _errHandler->reportError(this, e); _localctx->exception = std::current_exception(); _errHandler->recover(this, _localctx->exception); } return _localctx; } //----------------- UseDeclarationContext ------------------------------------------------------------------ EscriptParser::UseDeclarationContext::UseDeclarationContext(ParserRuleContext *parent, size_t invokingState) : ParserRuleContext(parent, invokingState) { } tree::TerminalNode* EscriptParser::UseDeclarationContext::USE() { return getToken(EscriptParser::USE, 0); } EscriptParser::StringIdentifierContext* EscriptParser::UseDeclarationContext::stringIdentifier() { return getRuleContext(0); } tree::TerminalNode* EscriptParser::UseDeclarationContext::SEMI() { return getToken(EscriptParser::SEMI, 0); } size_t EscriptParser::UseDeclarationContext::getRuleIndex() const { return EscriptParser::RuleUseDeclaration; } void EscriptParser::UseDeclarationContext::enterRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->enterUseDeclaration(this); } void EscriptParser::UseDeclarationContext::exitRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->exitUseDeclaration(this); } std::any EscriptParser::UseDeclarationContext::accept(tree::ParseTreeVisitor *visitor) { if (auto parserVisitor = dynamic_cast(visitor)) return parserVisitor->visitUseDeclaration(this); else return visitor->visitChildren(this); } EscriptParser::UseDeclarationContext* EscriptParser::useDeclaration() { UseDeclarationContext *_localctx = _tracker.createInstance(_ctx, getState()); enterRule(_localctx, 20, EscriptParser::RuleUseDeclaration); #if __cplusplus > 201703L auto onExit = finally([=, this] { #else auto onExit = finally([=] { #endif exitRule(); }); try { enterOuterAlt(_localctx, 1); setState(224); match(EscriptParser::USE); setState(225); stringIdentifier(); setState(226); match(EscriptParser::SEMI); } catch (RecognitionException &e) { _errHandler->reportError(this, e); _localctx->exception = std::current_exception(); _errHandler->recover(this, _localctx->exception); } return _localctx; } //----------------- IncludeDeclarationContext ------------------------------------------------------------------ EscriptParser::IncludeDeclarationContext::IncludeDeclarationContext(ParserRuleContext *parent, size_t invokingState) : ParserRuleContext(parent, invokingState) { } tree::TerminalNode* EscriptParser::IncludeDeclarationContext::INCLUDE() { return getToken(EscriptParser::INCLUDE, 0); } EscriptParser::StringIdentifierContext* EscriptParser::IncludeDeclarationContext::stringIdentifier() { return getRuleContext(0); } tree::TerminalNode* EscriptParser::IncludeDeclarationContext::SEMI() { return getToken(EscriptParser::SEMI, 0); } size_t EscriptParser::IncludeDeclarationContext::getRuleIndex() const { return EscriptParser::RuleIncludeDeclaration; } void EscriptParser::IncludeDeclarationContext::enterRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->enterIncludeDeclaration(this); } void EscriptParser::IncludeDeclarationContext::exitRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->exitIncludeDeclaration(this); } std::any EscriptParser::IncludeDeclarationContext::accept(tree::ParseTreeVisitor *visitor) { if (auto parserVisitor = dynamic_cast(visitor)) return parserVisitor->visitIncludeDeclaration(this); else return visitor->visitChildren(this); } EscriptParser::IncludeDeclarationContext* EscriptParser::includeDeclaration() { IncludeDeclarationContext *_localctx = _tracker.createInstance(_ctx, getState()); enterRule(_localctx, 22, EscriptParser::RuleIncludeDeclaration); #if __cplusplus > 201703L auto onExit = finally([=, this] { #else auto onExit = finally([=] { #endif exitRule(); }); try { enterOuterAlt(_localctx, 1); setState(228); match(EscriptParser::INCLUDE); setState(229); stringIdentifier(); setState(230); match(EscriptParser::SEMI); } catch (RecognitionException &e) { _errHandler->reportError(this, e); _localctx->exception = std::current_exception(); _errHandler->recover(this, _localctx->exception); } return _localctx; } //----------------- ProgramDeclarationContext ------------------------------------------------------------------ EscriptParser::ProgramDeclarationContext::ProgramDeclarationContext(ParserRuleContext *parent, size_t invokingState) : ParserRuleContext(parent, invokingState) { } tree::TerminalNode* EscriptParser::ProgramDeclarationContext::PROGRAM() { return getToken(EscriptParser::PROGRAM, 0); } tree::TerminalNode* EscriptParser::ProgramDeclarationContext::IDENTIFIER() { return getToken(EscriptParser::IDENTIFIER, 0); } EscriptParser::ProgramParametersContext* EscriptParser::ProgramDeclarationContext::programParameters() { return getRuleContext(0); } EscriptParser::BlockContext* EscriptParser::ProgramDeclarationContext::block() { return getRuleContext(0); } tree::TerminalNode* EscriptParser::ProgramDeclarationContext::ENDPROGRAM() { return getToken(EscriptParser::ENDPROGRAM, 0); } size_t EscriptParser::ProgramDeclarationContext::getRuleIndex() const { return EscriptParser::RuleProgramDeclaration; } void EscriptParser::ProgramDeclarationContext::enterRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->enterProgramDeclaration(this); } void EscriptParser::ProgramDeclarationContext::exitRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->exitProgramDeclaration(this); } std::any EscriptParser::ProgramDeclarationContext::accept(tree::ParseTreeVisitor *visitor) { if (auto parserVisitor = dynamic_cast(visitor)) return parserVisitor->visitProgramDeclaration(this); else return visitor->visitChildren(this); } EscriptParser::ProgramDeclarationContext* EscriptParser::programDeclaration() { ProgramDeclarationContext *_localctx = _tracker.createInstance(_ctx, getState()); enterRule(_localctx, 24, EscriptParser::RuleProgramDeclaration); #if __cplusplus > 201703L auto onExit = finally([=, this] { #else auto onExit = finally([=] { #endif exitRule(); }); try { enterOuterAlt(_localctx, 1); setState(232); match(EscriptParser::PROGRAM); setState(233); match(EscriptParser::IDENTIFIER); setState(234); programParameters(); setState(235); block(); setState(236); match(EscriptParser::ENDPROGRAM); } catch (RecognitionException &e) { _errHandler->reportError(this, e); _localctx->exception = std::current_exception(); _errHandler->recover(this, _localctx->exception); } return _localctx; } //----------------- StatementContext ------------------------------------------------------------------ EscriptParser::StatementContext::StatementContext(ParserRuleContext *parent, size_t invokingState) : ParserRuleContext(parent, invokingState) { } EscriptParser::IfStatementContext* EscriptParser::StatementContext::ifStatement() { return getRuleContext(0); } EscriptParser::GotoStatementContext* EscriptParser::StatementContext::gotoStatement() { return getRuleContext(0); } EscriptParser::ReturnStatementContext* EscriptParser::StatementContext::returnStatement() { return getRuleContext(0); } EscriptParser::ConstStatementContext* EscriptParser::StatementContext::constStatement() { return getRuleContext(0); } EscriptParser::VarStatementContext* EscriptParser::StatementContext::varStatement() { return getRuleContext(0); } EscriptParser::DoStatementContext* EscriptParser::StatementContext::doStatement() { return getRuleContext(0); } EscriptParser::WhileStatementContext* EscriptParser::StatementContext::whileStatement() { return getRuleContext(0); } EscriptParser::ExitStatementContext* EscriptParser::StatementContext::exitStatement() { return getRuleContext(0); } EscriptParser::BreakStatementContext* EscriptParser::StatementContext::breakStatement() { return getRuleContext(0); } EscriptParser::ContinueStatementContext* EscriptParser::StatementContext::continueStatement() { return getRuleContext(0); } EscriptParser::ForStatementContext* EscriptParser::StatementContext::forStatement() { return getRuleContext(0); } EscriptParser::ForeachStatementContext* EscriptParser::StatementContext::foreachStatement() { return getRuleContext(0); } EscriptParser::RepeatStatementContext* EscriptParser::StatementContext::repeatStatement() { return getRuleContext(0); } EscriptParser::CaseStatementContext* EscriptParser::StatementContext::caseStatement() { return getRuleContext(0); } EscriptParser::EnumStatementContext* EscriptParser::StatementContext::enumStatement() { return getRuleContext(0); } tree::TerminalNode* EscriptParser::StatementContext::SEMI() { return getToken(EscriptParser::SEMI, 0); } EscriptParser::ExpressionContext* EscriptParser::StatementContext::expression() { return getRuleContext(0); } size_t EscriptParser::StatementContext::getRuleIndex() const { return EscriptParser::RuleStatement; } void EscriptParser::StatementContext::enterRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->enterStatement(this); } void EscriptParser::StatementContext::exitRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->exitStatement(this); } std::any EscriptParser::StatementContext::accept(tree::ParseTreeVisitor *visitor) { if (auto parserVisitor = dynamic_cast(visitor)) return parserVisitor->visitStatement(this); else return visitor->visitChildren(this); } EscriptParser::StatementContext* EscriptParser::statement() { StatementContext *_localctx = _tracker.createInstance(_ctx, getState()); enterRule(_localctx, 26, EscriptParser::RuleStatement); #if __cplusplus > 201703L auto onExit = finally([=, this] { #else auto onExit = finally([=] { #endif exitRule(); }); try { setState(257); _errHandler->sync(this); switch (getInterpreter()->adaptivePredict(_input, 8, _ctx)) { case 1: { enterOuterAlt(_localctx, 1); setState(238); ifStatement(); break; } case 2: { enterOuterAlt(_localctx, 2); setState(239); gotoStatement(); break; } case 3: { enterOuterAlt(_localctx, 3); setState(240); returnStatement(); break; } case 4: { enterOuterAlt(_localctx, 4); setState(241); constStatement(); break; } case 5: { enterOuterAlt(_localctx, 5); setState(242); varStatement(); break; } case 6: { enterOuterAlt(_localctx, 6); setState(243); doStatement(); break; } case 7: { enterOuterAlt(_localctx, 7); setState(244); whileStatement(); break; } case 8: { enterOuterAlt(_localctx, 8); setState(245); exitStatement(); break; } case 9: { enterOuterAlt(_localctx, 9); setState(246); breakStatement(); break; } case 10: { enterOuterAlt(_localctx, 10); setState(247); continueStatement(); break; } case 11: { enterOuterAlt(_localctx, 11); setState(248); forStatement(); break; } case 12: { enterOuterAlt(_localctx, 12); setState(249); foreachStatement(); break; } case 13: { enterOuterAlt(_localctx, 13); setState(250); repeatStatement(); break; } case 14: { enterOuterAlt(_localctx, 14); setState(251); caseStatement(); break; } case 15: { enterOuterAlt(_localctx, 15); setState(252); enumStatement(); break; } case 16: { enterOuterAlt(_localctx, 16); setState(253); match(EscriptParser::SEMI); break; } case 17: { enterOuterAlt(_localctx, 17); setState(254); antlrcpp::downCast(_localctx)->statementExpression = expression(0); setState(255); match(EscriptParser::SEMI); break; } default: break; } } catch (RecognitionException &e) { _errHandler->reportError(this, e); _localctx->exception = std::current_exception(); _errHandler->recover(this, _localctx->exception); } return _localctx; } //----------------- StatementLabelContext ------------------------------------------------------------------ EscriptParser::StatementLabelContext::StatementLabelContext(ParserRuleContext *parent, size_t invokingState) : ParserRuleContext(parent, invokingState) { } tree::TerminalNode* EscriptParser::StatementLabelContext::IDENTIFIER() { return getToken(EscriptParser::IDENTIFIER, 0); } tree::TerminalNode* EscriptParser::StatementLabelContext::COLON() { return getToken(EscriptParser::COLON, 0); } size_t EscriptParser::StatementLabelContext::getRuleIndex() const { return EscriptParser::RuleStatementLabel; } void EscriptParser::StatementLabelContext::enterRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->enterStatementLabel(this); } void EscriptParser::StatementLabelContext::exitRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->exitStatementLabel(this); } std::any EscriptParser::StatementLabelContext::accept(tree::ParseTreeVisitor *visitor) { if (auto parserVisitor = dynamic_cast(visitor)) return parserVisitor->visitStatementLabel(this); else return visitor->visitChildren(this); } EscriptParser::StatementLabelContext* EscriptParser::statementLabel() { StatementLabelContext *_localctx = _tracker.createInstance(_ctx, getState()); enterRule(_localctx, 28, EscriptParser::RuleStatementLabel); #if __cplusplus > 201703L auto onExit = finally([=, this] { #else auto onExit = finally([=] { #endif exitRule(); }); try { enterOuterAlt(_localctx, 1); setState(259); match(EscriptParser::IDENTIFIER); setState(260); match(EscriptParser::COLON); } catch (RecognitionException &e) { _errHandler->reportError(this, e); _localctx->exception = std::current_exception(); _errHandler->recover(this, _localctx->exception); } return _localctx; } //----------------- IfStatementContext ------------------------------------------------------------------ EscriptParser::IfStatementContext::IfStatementContext(ParserRuleContext *parent, size_t invokingState) : ParserRuleContext(parent, invokingState) { } tree::TerminalNode* EscriptParser::IfStatementContext::IF() { return getToken(EscriptParser::IF, 0); } std::vector EscriptParser::IfStatementContext::parExpression() { return getRuleContexts(); } EscriptParser::ParExpressionContext* EscriptParser::IfStatementContext::parExpression(size_t i) { return getRuleContext(i); } std::vector EscriptParser::IfStatementContext::block() { return getRuleContexts(); } EscriptParser::BlockContext* EscriptParser::IfStatementContext::block(size_t i) { return getRuleContext(i); } tree::TerminalNode* EscriptParser::IfStatementContext::ENDIF() { return getToken(EscriptParser::ENDIF, 0); } tree::TerminalNode* EscriptParser::IfStatementContext::THEN() { return getToken(EscriptParser::THEN, 0); } std::vector EscriptParser::IfStatementContext::ELSEIF() { return getTokens(EscriptParser::ELSEIF); } tree::TerminalNode* EscriptParser::IfStatementContext::ELSEIF(size_t i) { return getToken(EscriptParser::ELSEIF, i); } tree::TerminalNode* EscriptParser::IfStatementContext::ELSE() { return getToken(EscriptParser::ELSE, 0); } size_t EscriptParser::IfStatementContext::getRuleIndex() const { return EscriptParser::RuleIfStatement; } void EscriptParser::IfStatementContext::enterRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->enterIfStatement(this); } void EscriptParser::IfStatementContext::exitRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->exitIfStatement(this); } std::any EscriptParser::IfStatementContext::accept(tree::ParseTreeVisitor *visitor) { if (auto parserVisitor = dynamic_cast(visitor)) return parserVisitor->visitIfStatement(this); else return visitor->visitChildren(this); } EscriptParser::IfStatementContext* EscriptParser::ifStatement() { IfStatementContext *_localctx = _tracker.createInstance(_ctx, getState()); enterRule(_localctx, 30, EscriptParser::RuleIfStatement); size_t _la = 0; #if __cplusplus > 201703L auto onExit = finally([=, this] { #else auto onExit = finally([=] { #endif exitRule(); }); try { enterOuterAlt(_localctx, 1); setState(262); match(EscriptParser::IF); setState(263); parExpression(); setState(265); _errHandler->sync(this); _la = _input->LA(1); if (_la == EscriptParser::THEN) { setState(264); match(EscriptParser::THEN); } setState(267); block(); setState(274); _errHandler->sync(this); _la = _input->LA(1); while (_la == EscriptParser::ELSEIF) { setState(268); match(EscriptParser::ELSEIF); setState(269); parExpression(); setState(270); block(); setState(276); _errHandler->sync(this); _la = _input->LA(1); } setState(279); _errHandler->sync(this); _la = _input->LA(1); if (_la == EscriptParser::ELSE) { setState(277); match(EscriptParser::ELSE); setState(278); block(); } setState(281); match(EscriptParser::ENDIF); } catch (RecognitionException &e) { _errHandler->reportError(this, e); _localctx->exception = std::current_exception(); _errHandler->recover(this, _localctx->exception); } return _localctx; } //----------------- GotoStatementContext ------------------------------------------------------------------ EscriptParser::GotoStatementContext::GotoStatementContext(ParserRuleContext *parent, size_t invokingState) : ParserRuleContext(parent, invokingState) { } tree::TerminalNode* EscriptParser::GotoStatementContext::GOTO() { return getToken(EscriptParser::GOTO, 0); } tree::TerminalNode* EscriptParser::GotoStatementContext::IDENTIFIER() { return getToken(EscriptParser::IDENTIFIER, 0); } tree::TerminalNode* EscriptParser::GotoStatementContext::SEMI() { return getToken(EscriptParser::SEMI, 0); } size_t EscriptParser::GotoStatementContext::getRuleIndex() const { return EscriptParser::RuleGotoStatement; } void EscriptParser::GotoStatementContext::enterRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->enterGotoStatement(this); } void EscriptParser::GotoStatementContext::exitRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->exitGotoStatement(this); } std::any EscriptParser::GotoStatementContext::accept(tree::ParseTreeVisitor *visitor) { if (auto parserVisitor = dynamic_cast(visitor)) return parserVisitor->visitGotoStatement(this); else return visitor->visitChildren(this); } EscriptParser::GotoStatementContext* EscriptParser::gotoStatement() { GotoStatementContext *_localctx = _tracker.createInstance(_ctx, getState()); enterRule(_localctx, 32, EscriptParser::RuleGotoStatement); #if __cplusplus > 201703L auto onExit = finally([=, this] { #else auto onExit = finally([=] { #endif exitRule(); }); try { enterOuterAlt(_localctx, 1); setState(283); match(EscriptParser::GOTO); setState(284); match(EscriptParser::IDENTIFIER); setState(285); match(EscriptParser::SEMI); } catch (RecognitionException &e) { _errHandler->reportError(this, e); _localctx->exception = std::current_exception(); _errHandler->recover(this, _localctx->exception); } return _localctx; } //----------------- ReturnStatementContext ------------------------------------------------------------------ EscriptParser::ReturnStatementContext::ReturnStatementContext(ParserRuleContext *parent, size_t invokingState) : ParserRuleContext(parent, invokingState) { } tree::TerminalNode* EscriptParser::ReturnStatementContext::RETURN() { return getToken(EscriptParser::RETURN, 0); } tree::TerminalNode* EscriptParser::ReturnStatementContext::SEMI() { return getToken(EscriptParser::SEMI, 0); } EscriptParser::ExpressionContext* EscriptParser::ReturnStatementContext::expression() { return getRuleContext(0); } size_t EscriptParser::ReturnStatementContext::getRuleIndex() const { return EscriptParser::RuleReturnStatement; } void EscriptParser::ReturnStatementContext::enterRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->enterReturnStatement(this); } void EscriptParser::ReturnStatementContext::exitRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->exitReturnStatement(this); } std::any EscriptParser::ReturnStatementContext::accept(tree::ParseTreeVisitor *visitor) { if (auto parserVisitor = dynamic_cast(visitor)) return parserVisitor->visitReturnStatement(this); else return visitor->visitChildren(this); } EscriptParser::ReturnStatementContext* EscriptParser::returnStatement() { ReturnStatementContext *_localctx = _tracker.createInstance(_ctx, getState()); enterRule(_localctx, 34, EscriptParser::RuleReturnStatement); size_t _la = 0; #if __cplusplus > 201703L auto onExit = finally([=, this] { #else auto onExit = finally([=] { #endif exitRule(); }); try { enterOuterAlt(_localctx, 1); setState(287); match(EscriptParser::RETURN); setState(289); _errHandler->sync(this); _la = _input->LA(1); if ((((_la & ~ 0x3fULL) == 0) && ((1ULL << _la) & -3242591731706757120) != 0) || ((((_la - 64) & ~ 0x3fULL) == 0) && ((1ULL << (_la - 64)) & 4726527809026293753) != 0)) { setState(288); expression(0); } setState(291); match(EscriptParser::SEMI); } catch (RecognitionException &e) { _errHandler->reportError(this, e); _localctx->exception = std::current_exception(); _errHandler->recover(this, _localctx->exception); } return _localctx; } //----------------- ConstStatementContext ------------------------------------------------------------------ EscriptParser::ConstStatementContext::ConstStatementContext(ParserRuleContext *parent, size_t invokingState) : ParserRuleContext(parent, invokingState) { } tree::TerminalNode* EscriptParser::ConstStatementContext::TOK_CONST() { return getToken(EscriptParser::TOK_CONST, 0); } EscriptParser::ConstantDeclarationContext* EscriptParser::ConstStatementContext::constantDeclaration() { return getRuleContext(0); } tree::TerminalNode* EscriptParser::ConstStatementContext::SEMI() { return getToken(EscriptParser::SEMI, 0); } size_t EscriptParser::ConstStatementContext::getRuleIndex() const { return EscriptParser::RuleConstStatement; } void EscriptParser::ConstStatementContext::enterRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->enterConstStatement(this); } void EscriptParser::ConstStatementContext::exitRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->exitConstStatement(this); } std::any EscriptParser::ConstStatementContext::accept(tree::ParseTreeVisitor *visitor) { if (auto parserVisitor = dynamic_cast(visitor)) return parserVisitor->visitConstStatement(this); else return visitor->visitChildren(this); } EscriptParser::ConstStatementContext* EscriptParser::constStatement() { ConstStatementContext *_localctx = _tracker.createInstance(_ctx, getState()); enterRule(_localctx, 36, EscriptParser::RuleConstStatement); #if __cplusplus > 201703L auto onExit = finally([=, this] { #else auto onExit = finally([=] { #endif exitRule(); }); try { enterOuterAlt(_localctx, 1); setState(293); match(EscriptParser::TOK_CONST); setState(294); constantDeclaration(); setState(295); match(EscriptParser::SEMI); } catch (RecognitionException &e) { _errHandler->reportError(this, e); _localctx->exception = std::current_exception(); _errHandler->recover(this, _localctx->exception); } return _localctx; } //----------------- VarStatementContext ------------------------------------------------------------------ EscriptParser::VarStatementContext::VarStatementContext(ParserRuleContext *parent, size_t invokingState) : ParserRuleContext(parent, invokingState) { } tree::TerminalNode* EscriptParser::VarStatementContext::VAR() { return getToken(EscriptParser::VAR, 0); } EscriptParser::VariableDeclarationListContext* EscriptParser::VarStatementContext::variableDeclarationList() { return getRuleContext(0); } tree::TerminalNode* EscriptParser::VarStatementContext::SEMI() { return getToken(EscriptParser::SEMI, 0); } size_t EscriptParser::VarStatementContext::getRuleIndex() const { return EscriptParser::RuleVarStatement; } void EscriptParser::VarStatementContext::enterRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->enterVarStatement(this); } void EscriptParser::VarStatementContext::exitRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->exitVarStatement(this); } std::any EscriptParser::VarStatementContext::accept(tree::ParseTreeVisitor *visitor) { if (auto parserVisitor = dynamic_cast(visitor)) return parserVisitor->visitVarStatement(this); else return visitor->visitChildren(this); } EscriptParser::VarStatementContext* EscriptParser::varStatement() { VarStatementContext *_localctx = _tracker.createInstance(_ctx, getState()); enterRule(_localctx, 38, EscriptParser::RuleVarStatement); #if __cplusplus > 201703L auto onExit = finally([=, this] { #else auto onExit = finally([=] { #endif exitRule(); }); try { enterOuterAlt(_localctx, 1); setState(297); match(EscriptParser::VAR); setState(298); variableDeclarationList(); setState(299); match(EscriptParser::SEMI); } catch (RecognitionException &e) { _errHandler->reportError(this, e); _localctx->exception = std::current_exception(); _errHandler->recover(this, _localctx->exception); } return _localctx; } //----------------- DoStatementContext ------------------------------------------------------------------ EscriptParser::DoStatementContext::DoStatementContext(ParserRuleContext *parent, size_t invokingState) : ParserRuleContext(parent, invokingState) { } tree::TerminalNode* EscriptParser::DoStatementContext::DO() { return getToken(EscriptParser::DO, 0); } EscriptParser::BlockContext* EscriptParser::DoStatementContext::block() { return getRuleContext(0); } tree::TerminalNode* EscriptParser::DoStatementContext::DOWHILE() { return getToken(EscriptParser::DOWHILE, 0); } EscriptParser::ParExpressionContext* EscriptParser::DoStatementContext::parExpression() { return getRuleContext(0); } tree::TerminalNode* EscriptParser::DoStatementContext::SEMI() { return getToken(EscriptParser::SEMI, 0); } EscriptParser::StatementLabelContext* EscriptParser::DoStatementContext::statementLabel() { return getRuleContext(0); } size_t EscriptParser::DoStatementContext::getRuleIndex() const { return EscriptParser::RuleDoStatement; } void EscriptParser::DoStatementContext::enterRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->enterDoStatement(this); } void EscriptParser::DoStatementContext::exitRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->exitDoStatement(this); } std::any EscriptParser::DoStatementContext::accept(tree::ParseTreeVisitor *visitor) { if (auto parserVisitor = dynamic_cast(visitor)) return parserVisitor->visitDoStatement(this); else return visitor->visitChildren(this); } EscriptParser::DoStatementContext* EscriptParser::doStatement() { DoStatementContext *_localctx = _tracker.createInstance(_ctx, getState()); enterRule(_localctx, 40, EscriptParser::RuleDoStatement); size_t _la = 0; #if __cplusplus > 201703L auto onExit = finally([=, this] { #else auto onExit = finally([=] { #endif exitRule(); }); try { enterOuterAlt(_localctx, 1); setState(302); _errHandler->sync(this); _la = _input->LA(1); if (_la == EscriptParser::IDENTIFIER) { setState(301); statementLabel(); } setState(304); match(EscriptParser::DO); setState(305); block(); setState(306); match(EscriptParser::DOWHILE); setState(307); parExpression(); setState(308); match(EscriptParser::SEMI); } catch (RecognitionException &e) { _errHandler->reportError(this, e); _localctx->exception = std::current_exception(); _errHandler->recover(this, _localctx->exception); } return _localctx; } //----------------- WhileStatementContext ------------------------------------------------------------------ EscriptParser::WhileStatementContext::WhileStatementContext(ParserRuleContext *parent, size_t invokingState) : ParserRuleContext(parent, invokingState) { } tree::TerminalNode* EscriptParser::WhileStatementContext::WHILE() { return getToken(EscriptParser::WHILE, 0); } EscriptParser::ParExpressionContext* EscriptParser::WhileStatementContext::parExpression() { return getRuleContext(0); } EscriptParser::BlockContext* EscriptParser::WhileStatementContext::block() { return getRuleContext(0); } tree::TerminalNode* EscriptParser::WhileStatementContext::ENDWHILE() { return getToken(EscriptParser::ENDWHILE, 0); } EscriptParser::StatementLabelContext* EscriptParser::WhileStatementContext::statementLabel() { return getRuleContext(0); } size_t EscriptParser::WhileStatementContext::getRuleIndex() const { return EscriptParser::RuleWhileStatement; } void EscriptParser::WhileStatementContext::enterRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->enterWhileStatement(this); } void EscriptParser::WhileStatementContext::exitRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->exitWhileStatement(this); } std::any EscriptParser::WhileStatementContext::accept(tree::ParseTreeVisitor *visitor) { if (auto parserVisitor = dynamic_cast(visitor)) return parserVisitor->visitWhileStatement(this); else return visitor->visitChildren(this); } EscriptParser::WhileStatementContext* EscriptParser::whileStatement() { WhileStatementContext *_localctx = _tracker.createInstance(_ctx, getState()); enterRule(_localctx, 42, EscriptParser::RuleWhileStatement); size_t _la = 0; #if __cplusplus > 201703L auto onExit = finally([=, this] { #else auto onExit = finally([=] { #endif exitRule(); }); try { enterOuterAlt(_localctx, 1); setState(311); _errHandler->sync(this); _la = _input->LA(1); if (_la == EscriptParser::IDENTIFIER) { setState(310); statementLabel(); } setState(313); match(EscriptParser::WHILE); setState(314); parExpression(); setState(315); block(); setState(316); match(EscriptParser::ENDWHILE); } catch (RecognitionException &e) { _errHandler->reportError(this, e); _localctx->exception = std::current_exception(); _errHandler->recover(this, _localctx->exception); } return _localctx; } //----------------- ExitStatementContext ------------------------------------------------------------------ EscriptParser::ExitStatementContext::ExitStatementContext(ParserRuleContext *parent, size_t invokingState) : ParserRuleContext(parent, invokingState) { } tree::TerminalNode* EscriptParser::ExitStatementContext::EXIT() { return getToken(EscriptParser::EXIT, 0); } tree::TerminalNode* EscriptParser::ExitStatementContext::SEMI() { return getToken(EscriptParser::SEMI, 0); } size_t EscriptParser::ExitStatementContext::getRuleIndex() const { return EscriptParser::RuleExitStatement; } void EscriptParser::ExitStatementContext::enterRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->enterExitStatement(this); } void EscriptParser::ExitStatementContext::exitRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->exitExitStatement(this); } std::any EscriptParser::ExitStatementContext::accept(tree::ParseTreeVisitor *visitor) { if (auto parserVisitor = dynamic_cast(visitor)) return parserVisitor->visitExitStatement(this); else return visitor->visitChildren(this); } EscriptParser::ExitStatementContext* EscriptParser::exitStatement() { ExitStatementContext *_localctx = _tracker.createInstance(_ctx, getState()); enterRule(_localctx, 44, EscriptParser::RuleExitStatement); #if __cplusplus > 201703L auto onExit = finally([=, this] { #else auto onExit = finally([=] { #endif exitRule(); }); try { enterOuterAlt(_localctx, 1); setState(318); match(EscriptParser::EXIT); setState(319); match(EscriptParser::SEMI); } catch (RecognitionException &e) { _errHandler->reportError(this, e); _localctx->exception = std::current_exception(); _errHandler->recover(this, _localctx->exception); } return _localctx; } //----------------- BreakStatementContext ------------------------------------------------------------------ EscriptParser::BreakStatementContext::BreakStatementContext(ParserRuleContext *parent, size_t invokingState) : ParserRuleContext(parent, invokingState) { } tree::TerminalNode* EscriptParser::BreakStatementContext::BREAK() { return getToken(EscriptParser::BREAK, 0); } tree::TerminalNode* EscriptParser::BreakStatementContext::SEMI() { return getToken(EscriptParser::SEMI, 0); } tree::TerminalNode* EscriptParser::BreakStatementContext::IDENTIFIER() { return getToken(EscriptParser::IDENTIFIER, 0); } size_t EscriptParser::BreakStatementContext::getRuleIndex() const { return EscriptParser::RuleBreakStatement; } void EscriptParser::BreakStatementContext::enterRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->enterBreakStatement(this); } void EscriptParser::BreakStatementContext::exitRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->exitBreakStatement(this); } std::any EscriptParser::BreakStatementContext::accept(tree::ParseTreeVisitor *visitor) { if (auto parserVisitor = dynamic_cast(visitor)) return parserVisitor->visitBreakStatement(this); else return visitor->visitChildren(this); } EscriptParser::BreakStatementContext* EscriptParser::breakStatement() { BreakStatementContext *_localctx = _tracker.createInstance(_ctx, getState()); enterRule(_localctx, 46, EscriptParser::RuleBreakStatement); size_t _la = 0; #if __cplusplus > 201703L auto onExit = finally([=, this] { #else auto onExit = finally([=] { #endif exitRule(); }); try { enterOuterAlt(_localctx, 1); setState(321); match(EscriptParser::BREAK); setState(323); _errHandler->sync(this); _la = _input->LA(1); if (_la == EscriptParser::IDENTIFIER) { setState(322); match(EscriptParser::IDENTIFIER); } setState(325); match(EscriptParser::SEMI); } catch (RecognitionException &e) { _errHandler->reportError(this, e); _localctx->exception = std::current_exception(); _errHandler->recover(this, _localctx->exception); } return _localctx; } //----------------- ContinueStatementContext ------------------------------------------------------------------ EscriptParser::ContinueStatementContext::ContinueStatementContext(ParserRuleContext *parent, size_t invokingState) : ParserRuleContext(parent, invokingState) { } tree::TerminalNode* EscriptParser::ContinueStatementContext::CONTINUE() { return getToken(EscriptParser::CONTINUE, 0); } tree::TerminalNode* EscriptParser::ContinueStatementContext::SEMI() { return getToken(EscriptParser::SEMI, 0); } tree::TerminalNode* EscriptParser::ContinueStatementContext::IDENTIFIER() { return getToken(EscriptParser::IDENTIFIER, 0); } size_t EscriptParser::ContinueStatementContext::getRuleIndex() const { return EscriptParser::RuleContinueStatement; } void EscriptParser::ContinueStatementContext::enterRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->enterContinueStatement(this); } void EscriptParser::ContinueStatementContext::exitRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->exitContinueStatement(this); } std::any EscriptParser::ContinueStatementContext::accept(tree::ParseTreeVisitor *visitor) { if (auto parserVisitor = dynamic_cast(visitor)) return parserVisitor->visitContinueStatement(this); else return visitor->visitChildren(this); } EscriptParser::ContinueStatementContext* EscriptParser::continueStatement() { ContinueStatementContext *_localctx = _tracker.createInstance(_ctx, getState()); enterRule(_localctx, 48, EscriptParser::RuleContinueStatement); size_t _la = 0; #if __cplusplus > 201703L auto onExit = finally([=, this] { #else auto onExit = finally([=] { #endif exitRule(); }); try { enterOuterAlt(_localctx, 1); setState(327); match(EscriptParser::CONTINUE); setState(329); _errHandler->sync(this); _la = _input->LA(1); if (_la == EscriptParser::IDENTIFIER) { setState(328); match(EscriptParser::IDENTIFIER); } setState(331); match(EscriptParser::SEMI); } catch (RecognitionException &e) { _errHandler->reportError(this, e); _localctx->exception = std::current_exception(); _errHandler->recover(this, _localctx->exception); } return _localctx; } //----------------- ForStatementContext ------------------------------------------------------------------ EscriptParser::ForStatementContext::ForStatementContext(ParserRuleContext *parent, size_t invokingState) : ParserRuleContext(parent, invokingState) { } tree::TerminalNode* EscriptParser::ForStatementContext::FOR() { return getToken(EscriptParser::FOR, 0); } EscriptParser::ForGroupContext* EscriptParser::ForStatementContext::forGroup() { return getRuleContext(0); } tree::TerminalNode* EscriptParser::ForStatementContext::ENDFOR() { return getToken(EscriptParser::ENDFOR, 0); } EscriptParser::StatementLabelContext* EscriptParser::ForStatementContext::statementLabel() { return getRuleContext(0); } size_t EscriptParser::ForStatementContext::getRuleIndex() const { return EscriptParser::RuleForStatement; } void EscriptParser::ForStatementContext::enterRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->enterForStatement(this); } void EscriptParser::ForStatementContext::exitRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->exitForStatement(this); } std::any EscriptParser::ForStatementContext::accept(tree::ParseTreeVisitor *visitor) { if (auto parserVisitor = dynamic_cast(visitor)) return parserVisitor->visitForStatement(this); else return visitor->visitChildren(this); } EscriptParser::ForStatementContext* EscriptParser::forStatement() { ForStatementContext *_localctx = _tracker.createInstance(_ctx, getState()); enterRule(_localctx, 50, EscriptParser::RuleForStatement); size_t _la = 0; #if __cplusplus > 201703L auto onExit = finally([=, this] { #else auto onExit = finally([=] { #endif exitRule(); }); try { enterOuterAlt(_localctx, 1); setState(334); _errHandler->sync(this); _la = _input->LA(1); if (_la == EscriptParser::IDENTIFIER) { setState(333); statementLabel(); } setState(336); match(EscriptParser::FOR); setState(337); forGroup(); setState(338); match(EscriptParser::ENDFOR); } catch (RecognitionException &e) { _errHandler->reportError(this, e); _localctx->exception = std::current_exception(); _errHandler->recover(this, _localctx->exception); } return _localctx; } //----------------- ForeachIterableExpressionContext ------------------------------------------------------------------ EscriptParser::ForeachIterableExpressionContext::ForeachIterableExpressionContext(ParserRuleContext *parent, size_t invokingState) : ParserRuleContext(parent, invokingState) { } EscriptParser::FunctionCallContext* EscriptParser::ForeachIterableExpressionContext::functionCall() { return getRuleContext(0); } EscriptParser::ScopedFunctionCallContext* EscriptParser::ForeachIterableExpressionContext::scopedFunctionCall() { return getRuleContext(0); } tree::TerminalNode* EscriptParser::ForeachIterableExpressionContext::IDENTIFIER() { return getToken(EscriptParser::IDENTIFIER, 0); } EscriptParser::ParExpressionContext* EscriptParser::ForeachIterableExpressionContext::parExpression() { return getRuleContext(0); } EscriptParser::BareArrayInitializerContext* EscriptParser::ForeachIterableExpressionContext::bareArrayInitializer() { return getRuleContext(0); } EscriptParser::ExplicitArrayInitializerContext* EscriptParser::ForeachIterableExpressionContext::explicitArrayInitializer() { return getRuleContext(0); } size_t EscriptParser::ForeachIterableExpressionContext::getRuleIndex() const { return EscriptParser::RuleForeachIterableExpression; } void EscriptParser::ForeachIterableExpressionContext::enterRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->enterForeachIterableExpression(this); } void EscriptParser::ForeachIterableExpressionContext::exitRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->exitForeachIterableExpression(this); } std::any EscriptParser::ForeachIterableExpressionContext::accept(tree::ParseTreeVisitor *visitor) { if (auto parserVisitor = dynamic_cast(visitor)) return parserVisitor->visitForeachIterableExpression(this); else return visitor->visitChildren(this); } EscriptParser::ForeachIterableExpressionContext* EscriptParser::foreachIterableExpression() { ForeachIterableExpressionContext *_localctx = _tracker.createInstance(_ctx, getState()); enterRule(_localctx, 52, EscriptParser::RuleForeachIterableExpression); #if __cplusplus > 201703L auto onExit = finally([=, this] { #else auto onExit = finally([=] { #endif exitRule(); }); try { setState(346); _errHandler->sync(this); switch (getInterpreter()->adaptivePredict(_input, 18, _ctx)) { case 1: { enterOuterAlt(_localctx, 1); setState(340); functionCall(); break; } case 2: { enterOuterAlt(_localctx, 2); setState(341); scopedFunctionCall(); break; } case 3: { enterOuterAlt(_localctx, 3); setState(342); match(EscriptParser::IDENTIFIER); break; } case 4: { enterOuterAlt(_localctx, 4); setState(343); parExpression(); break; } case 5: { enterOuterAlt(_localctx, 5); setState(344); bareArrayInitializer(); break; } case 6: { enterOuterAlt(_localctx, 6); setState(345); explicitArrayInitializer(); break; } default: break; } } catch (RecognitionException &e) { _errHandler->reportError(this, e); _localctx->exception = std::current_exception(); _errHandler->recover(this, _localctx->exception); } return _localctx; } //----------------- ForeachStatementContext ------------------------------------------------------------------ EscriptParser::ForeachStatementContext::ForeachStatementContext(ParserRuleContext *parent, size_t invokingState) : ParserRuleContext(parent, invokingState) { } tree::TerminalNode* EscriptParser::ForeachStatementContext::FOREACH() { return getToken(EscriptParser::FOREACH, 0); } tree::TerminalNode* EscriptParser::ForeachStatementContext::IDENTIFIER() { return getToken(EscriptParser::IDENTIFIER, 0); } tree::TerminalNode* EscriptParser::ForeachStatementContext::TOK_IN() { return getToken(EscriptParser::TOK_IN, 0); } EscriptParser::ForeachIterableExpressionContext* EscriptParser::ForeachStatementContext::foreachIterableExpression() { return getRuleContext(0); } EscriptParser::BlockContext* EscriptParser::ForeachStatementContext::block() { return getRuleContext(0); } tree::TerminalNode* EscriptParser::ForeachStatementContext::ENDFOREACH() { return getToken(EscriptParser::ENDFOREACH, 0); } EscriptParser::StatementLabelContext* EscriptParser::ForeachStatementContext::statementLabel() { return getRuleContext(0); } size_t EscriptParser::ForeachStatementContext::getRuleIndex() const { return EscriptParser::RuleForeachStatement; } void EscriptParser::ForeachStatementContext::enterRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->enterForeachStatement(this); } void EscriptParser::ForeachStatementContext::exitRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->exitForeachStatement(this); } std::any EscriptParser::ForeachStatementContext::accept(tree::ParseTreeVisitor *visitor) { if (auto parserVisitor = dynamic_cast(visitor)) return parserVisitor->visitForeachStatement(this); else return visitor->visitChildren(this); } EscriptParser::ForeachStatementContext* EscriptParser::foreachStatement() { ForeachStatementContext *_localctx = _tracker.createInstance(_ctx, getState()); enterRule(_localctx, 54, EscriptParser::RuleForeachStatement); size_t _la = 0; #if __cplusplus > 201703L auto onExit = finally([=, this] { #else auto onExit = finally([=] { #endif exitRule(); }); try { enterOuterAlt(_localctx, 1); setState(349); _errHandler->sync(this); _la = _input->LA(1); if (_la == EscriptParser::IDENTIFIER) { setState(348); statementLabel(); } setState(351); match(EscriptParser::FOREACH); setState(352); match(EscriptParser::IDENTIFIER); setState(353); match(EscriptParser::TOK_IN); setState(354); foreachIterableExpression(); setState(355); block(); setState(356); match(EscriptParser::ENDFOREACH); } catch (RecognitionException &e) { _errHandler->reportError(this, e); _localctx->exception = std::current_exception(); _errHandler->recover(this, _localctx->exception); } return _localctx; } //----------------- RepeatStatementContext ------------------------------------------------------------------ EscriptParser::RepeatStatementContext::RepeatStatementContext(ParserRuleContext *parent, size_t invokingState) : ParserRuleContext(parent, invokingState) { } tree::TerminalNode* EscriptParser::RepeatStatementContext::REPEAT() { return getToken(EscriptParser::REPEAT, 0); } EscriptParser::BlockContext* EscriptParser::RepeatStatementContext::block() { return getRuleContext(0); } tree::TerminalNode* EscriptParser::RepeatStatementContext::UNTIL() { return getToken(EscriptParser::UNTIL, 0); } EscriptParser::ExpressionContext* EscriptParser::RepeatStatementContext::expression() { return getRuleContext(0); } tree::TerminalNode* EscriptParser::RepeatStatementContext::SEMI() { return getToken(EscriptParser::SEMI, 0); } EscriptParser::StatementLabelContext* EscriptParser::RepeatStatementContext::statementLabel() { return getRuleContext(0); } size_t EscriptParser::RepeatStatementContext::getRuleIndex() const { return EscriptParser::RuleRepeatStatement; } void EscriptParser::RepeatStatementContext::enterRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->enterRepeatStatement(this); } void EscriptParser::RepeatStatementContext::exitRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->exitRepeatStatement(this); } std::any EscriptParser::RepeatStatementContext::accept(tree::ParseTreeVisitor *visitor) { if (auto parserVisitor = dynamic_cast(visitor)) return parserVisitor->visitRepeatStatement(this); else return visitor->visitChildren(this); } EscriptParser::RepeatStatementContext* EscriptParser::repeatStatement() { RepeatStatementContext *_localctx = _tracker.createInstance(_ctx, getState()); enterRule(_localctx, 56, EscriptParser::RuleRepeatStatement); size_t _la = 0; #if __cplusplus > 201703L auto onExit = finally([=, this] { #else auto onExit = finally([=] { #endif exitRule(); }); try { enterOuterAlt(_localctx, 1); setState(359); _errHandler->sync(this); _la = _input->LA(1); if (_la == EscriptParser::IDENTIFIER) { setState(358); statementLabel(); } setState(361); match(EscriptParser::REPEAT); setState(362); block(); setState(363); match(EscriptParser::UNTIL); setState(364); expression(0); setState(365); match(EscriptParser::SEMI); } catch (RecognitionException &e) { _errHandler->reportError(this, e); _localctx->exception = std::current_exception(); _errHandler->recover(this, _localctx->exception); } return _localctx; } //----------------- CaseStatementContext ------------------------------------------------------------------ EscriptParser::CaseStatementContext::CaseStatementContext(ParserRuleContext *parent, size_t invokingState) : ParserRuleContext(parent, invokingState) { } tree::TerminalNode* EscriptParser::CaseStatementContext::CASE() { return getToken(EscriptParser::CASE, 0); } tree::TerminalNode* EscriptParser::CaseStatementContext::LPAREN() { return getToken(EscriptParser::LPAREN, 0); } EscriptParser::ExpressionContext* EscriptParser::CaseStatementContext::expression() { return getRuleContext(0); } tree::TerminalNode* EscriptParser::CaseStatementContext::RPAREN() { return getToken(EscriptParser::RPAREN, 0); } tree::TerminalNode* EscriptParser::CaseStatementContext::ENDCASE() { return getToken(EscriptParser::ENDCASE, 0); } EscriptParser::StatementLabelContext* EscriptParser::CaseStatementContext::statementLabel() { return getRuleContext(0); } std::vector EscriptParser::CaseStatementContext::switchBlockStatementGroup() { return getRuleContexts(); } EscriptParser::SwitchBlockStatementGroupContext* EscriptParser::CaseStatementContext::switchBlockStatementGroup(size_t i) { return getRuleContext(i); } size_t EscriptParser::CaseStatementContext::getRuleIndex() const { return EscriptParser::RuleCaseStatement; } void EscriptParser::CaseStatementContext::enterRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->enterCaseStatement(this); } void EscriptParser::CaseStatementContext::exitRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->exitCaseStatement(this); } std::any EscriptParser::CaseStatementContext::accept(tree::ParseTreeVisitor *visitor) { if (auto parserVisitor = dynamic_cast(visitor)) return parserVisitor->visitCaseStatement(this); else return visitor->visitChildren(this); } EscriptParser::CaseStatementContext* EscriptParser::caseStatement() { CaseStatementContext *_localctx = _tracker.createInstance(_ctx, getState()); enterRule(_localctx, 58, EscriptParser::RuleCaseStatement); size_t _la = 0; #if __cplusplus > 201703L auto onExit = finally([=, this] { #else auto onExit = finally([=] { #endif exitRule(); }); try { enterOuterAlt(_localctx, 1); setState(368); _errHandler->sync(this); _la = _input->LA(1); if (_la == EscriptParser::IDENTIFIER) { setState(367); statementLabel(); } setState(370); match(EscriptParser::CASE); setState(371); match(EscriptParser::LPAREN); setState(372); expression(0); setState(373); match(EscriptParser::RPAREN); setState(375); _errHandler->sync(this); _la = _input->LA(1); do { setState(374); switchBlockStatementGroup(); setState(377); _errHandler->sync(this); _la = _input->LA(1); } while (_la == EscriptParser::DEFAULT || ((((_la - 67) & ~ 0x3fULL) == 0) && ((1ULL << (_la - 67)) & 576460752303424127) != 0)); setState(379); match(EscriptParser::ENDCASE); } catch (RecognitionException &e) { _errHandler->reportError(this, e); _localctx->exception = std::current_exception(); _errHandler->recover(this, _localctx->exception); } return _localctx; } //----------------- EnumStatementContext ------------------------------------------------------------------ EscriptParser::EnumStatementContext::EnumStatementContext(ParserRuleContext *parent, size_t invokingState) : ParserRuleContext(parent, invokingState) { } tree::TerminalNode* EscriptParser::EnumStatementContext::ENUM() { return getToken(EscriptParser::ENUM, 0); } tree::TerminalNode* EscriptParser::EnumStatementContext::IDENTIFIER() { return getToken(EscriptParser::IDENTIFIER, 0); } EscriptParser::EnumListContext* EscriptParser::EnumStatementContext::enumList() { return getRuleContext(0); } tree::TerminalNode* EscriptParser::EnumStatementContext::ENDENUM() { return getToken(EscriptParser::ENDENUM, 0); } size_t EscriptParser::EnumStatementContext::getRuleIndex() const { return EscriptParser::RuleEnumStatement; } void EscriptParser::EnumStatementContext::enterRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->enterEnumStatement(this); } void EscriptParser::EnumStatementContext::exitRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->exitEnumStatement(this); } std::any EscriptParser::EnumStatementContext::accept(tree::ParseTreeVisitor *visitor) { if (auto parserVisitor = dynamic_cast(visitor)) return parserVisitor->visitEnumStatement(this); else return visitor->visitChildren(this); } EscriptParser::EnumStatementContext* EscriptParser::enumStatement() { EnumStatementContext *_localctx = _tracker.createInstance(_ctx, getState()); enterRule(_localctx, 60, EscriptParser::RuleEnumStatement); #if __cplusplus > 201703L auto onExit = finally([=, this] { #else auto onExit = finally([=] { #endif exitRule(); }); try { enterOuterAlt(_localctx, 1); setState(381); match(EscriptParser::ENUM); setState(382); match(EscriptParser::IDENTIFIER); setState(383); enumList(); setState(384); match(EscriptParser::ENDENUM); } catch (RecognitionException &e) { _errHandler->reportError(this, e); _localctx->exception = std::current_exception(); _errHandler->recover(this, _localctx->exception); } return _localctx; } //----------------- BlockContext ------------------------------------------------------------------ EscriptParser::BlockContext::BlockContext(ParserRuleContext *parent, size_t invokingState) : ParserRuleContext(parent, invokingState) { } std::vector EscriptParser::BlockContext::statement() { return getRuleContexts(); } EscriptParser::StatementContext* EscriptParser::BlockContext::statement(size_t i) { return getRuleContext(i); } size_t EscriptParser::BlockContext::getRuleIndex() const { return EscriptParser::RuleBlock; } void EscriptParser::BlockContext::enterRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->enterBlock(this); } void EscriptParser::BlockContext::exitRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->exitBlock(this); } std::any EscriptParser::BlockContext::accept(tree::ParseTreeVisitor *visitor) { if (auto parserVisitor = dynamic_cast(visitor)) return parserVisitor->visitBlock(this); else return visitor->visitChildren(this); } EscriptParser::BlockContext* EscriptParser::block() { BlockContext *_localctx = _tracker.createInstance(_ctx, getState()); enterRule(_localctx, 62, EscriptParser::RuleBlock); #if __cplusplus > 201703L auto onExit = finally([=, this] { #else auto onExit = finally([=] { #endif exitRule(); }); try { size_t alt; enterOuterAlt(_localctx, 1); setState(389); _errHandler->sync(this); alt = getInterpreter()->adaptivePredict(_input, 23, _ctx); while (alt != 2 && alt != atn::ATN::INVALID_ALT_NUMBER) { if (alt == 1) { setState(386); statement(); } setState(391); _errHandler->sync(this); alt = getInterpreter()->adaptivePredict(_input, 23, _ctx); } } catch (RecognitionException &e) { _errHandler->reportError(this, e); _localctx->exception = std::current_exception(); _errHandler->recover(this, _localctx->exception); } return _localctx; } //----------------- VariableDeclarationInitializerContext ------------------------------------------------------------------ EscriptParser::VariableDeclarationInitializerContext::VariableDeclarationInitializerContext(ParserRuleContext *parent, size_t invokingState) : ParserRuleContext(parent, invokingState) { } tree::TerminalNode* EscriptParser::VariableDeclarationInitializerContext::ASSIGN() { return getToken(EscriptParser::ASSIGN, 0); } EscriptParser::ExpressionContext* EscriptParser::VariableDeclarationInitializerContext::expression() { return getRuleContext(0); } tree::TerminalNode* EscriptParser::VariableDeclarationInitializerContext::EQUAL_DEPRECATED() { return getToken(EscriptParser::EQUAL_DEPRECATED, 0); } tree::TerminalNode* EscriptParser::VariableDeclarationInitializerContext::ARRAY() { return getToken(EscriptParser::ARRAY, 0); } size_t EscriptParser::VariableDeclarationInitializerContext::getRuleIndex() const { return EscriptParser::RuleVariableDeclarationInitializer; } void EscriptParser::VariableDeclarationInitializerContext::enterRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->enterVariableDeclarationInitializer(this); } void EscriptParser::VariableDeclarationInitializerContext::exitRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->exitVariableDeclarationInitializer(this); } std::any EscriptParser::VariableDeclarationInitializerContext::accept(tree::ParseTreeVisitor *visitor) { if (auto parserVisitor = dynamic_cast(visitor)) return parserVisitor->visitVariableDeclarationInitializer(this); else return visitor->visitChildren(this); } EscriptParser::VariableDeclarationInitializerContext* EscriptParser::variableDeclarationInitializer() { VariableDeclarationInitializerContext *_localctx = _tracker.createInstance(_ctx, getState()); enterRule(_localctx, 64, EscriptParser::RuleVariableDeclarationInitializer); #if __cplusplus > 201703L auto onExit = finally([=, this] { #else auto onExit = finally([=] { #endif exitRule(); }); try { setState(399); _errHandler->sync(this); switch (_input->LA(1)) { case EscriptParser::ASSIGN: { enterOuterAlt(_localctx, 1); setState(392); match(EscriptParser::ASSIGN); setState(393); expression(0); break; } case EscriptParser::EQUAL_DEPRECATED: { enterOuterAlt(_localctx, 2); setState(394); match(EscriptParser::EQUAL_DEPRECATED); setState(395); expression(0); notifyErrorListeners("Unexpected token: '='. Did you mean := for assign?\n"); break; } case EscriptParser::ARRAY: { enterOuterAlt(_localctx, 3); setState(398); match(EscriptParser::ARRAY); break; } default: throw NoViableAltException(this); } } catch (RecognitionException &e) { _errHandler->reportError(this, e); _localctx->exception = std::current_exception(); _errHandler->recover(this, _localctx->exception); } return _localctx; } //----------------- EnumListContext ------------------------------------------------------------------ EscriptParser::EnumListContext::EnumListContext(ParserRuleContext *parent, size_t invokingState) : ParserRuleContext(parent, invokingState) { } std::vector EscriptParser::EnumListContext::enumListEntry() { return getRuleContexts(); } EscriptParser::EnumListEntryContext* EscriptParser::EnumListContext::enumListEntry(size_t i) { return getRuleContext(i); } std::vector EscriptParser::EnumListContext::COMMA() { return getTokens(EscriptParser::COMMA); } tree::TerminalNode* EscriptParser::EnumListContext::COMMA(size_t i) { return getToken(EscriptParser::COMMA, i); } size_t EscriptParser::EnumListContext::getRuleIndex() const { return EscriptParser::RuleEnumList; } void EscriptParser::EnumListContext::enterRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->enterEnumList(this); } void EscriptParser::EnumListContext::exitRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->exitEnumList(this); } std::any EscriptParser::EnumListContext::accept(tree::ParseTreeVisitor *visitor) { if (auto parserVisitor = dynamic_cast(visitor)) return parserVisitor->visitEnumList(this); else return visitor->visitChildren(this); } EscriptParser::EnumListContext* EscriptParser::enumList() { EnumListContext *_localctx = _tracker.createInstance(_ctx, getState()); enterRule(_localctx, 66, EscriptParser::RuleEnumList); size_t _la = 0; #if __cplusplus > 201703L auto onExit = finally([=, this] { #else auto onExit = finally([=] { #endif exitRule(); }); try { size_t alt; enterOuterAlt(_localctx, 1); setState(401); enumListEntry(); setState(406); _errHandler->sync(this); alt = getInterpreter()->adaptivePredict(_input, 25, _ctx); while (alt != 2 && alt != atn::ATN::INVALID_ALT_NUMBER) { if (alt == 1) { setState(402); match(EscriptParser::COMMA); setState(403); enumListEntry(); } setState(408); _errHandler->sync(this); alt = getInterpreter()->adaptivePredict(_input, 25, _ctx); } setState(410); _errHandler->sync(this); _la = _input->LA(1); if (_la == EscriptParser::COMMA) { setState(409); match(EscriptParser::COMMA); } } catch (RecognitionException &e) { _errHandler->reportError(this, e); _localctx->exception = std::current_exception(); _errHandler->recover(this, _localctx->exception); } return _localctx; } //----------------- EnumListEntryContext ------------------------------------------------------------------ EscriptParser::EnumListEntryContext::EnumListEntryContext(ParserRuleContext *parent, size_t invokingState) : ParserRuleContext(parent, invokingState) { } tree::TerminalNode* EscriptParser::EnumListEntryContext::IDENTIFIER() { return getToken(EscriptParser::IDENTIFIER, 0); } tree::TerminalNode* EscriptParser::EnumListEntryContext::ASSIGN() { return getToken(EscriptParser::ASSIGN, 0); } EscriptParser::ExpressionContext* EscriptParser::EnumListEntryContext::expression() { return getRuleContext(0); } size_t EscriptParser::EnumListEntryContext::getRuleIndex() const { return EscriptParser::RuleEnumListEntry; } void EscriptParser::EnumListEntryContext::enterRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->enterEnumListEntry(this); } void EscriptParser::EnumListEntryContext::exitRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->exitEnumListEntry(this); } std::any EscriptParser::EnumListEntryContext::accept(tree::ParseTreeVisitor *visitor) { if (auto parserVisitor = dynamic_cast(visitor)) return parserVisitor->visitEnumListEntry(this); else return visitor->visitChildren(this); } EscriptParser::EnumListEntryContext* EscriptParser::enumListEntry() { EnumListEntryContext *_localctx = _tracker.createInstance(_ctx, getState()); enterRule(_localctx, 68, EscriptParser::RuleEnumListEntry); size_t _la = 0; #if __cplusplus > 201703L auto onExit = finally([=, this] { #else auto onExit = finally([=] { #endif exitRule(); }); try { enterOuterAlt(_localctx, 1); setState(412); match(EscriptParser::IDENTIFIER); setState(415); _errHandler->sync(this); _la = _input->LA(1); if (_la == EscriptParser::ASSIGN) { setState(413); match(EscriptParser::ASSIGN); setState(414); expression(0); } } catch (RecognitionException &e) { _errHandler->reportError(this, e); _localctx->exception = std::current_exception(); _errHandler->recover(this, _localctx->exception); } return _localctx; } //----------------- SwitchBlockStatementGroupContext ------------------------------------------------------------------ EscriptParser::SwitchBlockStatementGroupContext::SwitchBlockStatementGroupContext(ParserRuleContext *parent, size_t invokingState) : ParserRuleContext(parent, invokingState) { } EscriptParser::BlockContext* EscriptParser::SwitchBlockStatementGroupContext::block() { return getRuleContext(0); } std::vector EscriptParser::SwitchBlockStatementGroupContext::switchLabel() { return getRuleContexts(); } EscriptParser::SwitchLabelContext* EscriptParser::SwitchBlockStatementGroupContext::switchLabel(size_t i) { return getRuleContext(i); } size_t EscriptParser::SwitchBlockStatementGroupContext::getRuleIndex() const { return EscriptParser::RuleSwitchBlockStatementGroup; } void EscriptParser::SwitchBlockStatementGroupContext::enterRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->enterSwitchBlockStatementGroup(this); } void EscriptParser::SwitchBlockStatementGroupContext::exitRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->exitSwitchBlockStatementGroup(this); } std::any EscriptParser::SwitchBlockStatementGroupContext::accept(tree::ParseTreeVisitor *visitor) { if (auto parserVisitor = dynamic_cast(visitor)) return parserVisitor->visitSwitchBlockStatementGroup(this); else return visitor->visitChildren(this); } EscriptParser::SwitchBlockStatementGroupContext* EscriptParser::switchBlockStatementGroup() { SwitchBlockStatementGroupContext *_localctx = _tracker.createInstance(_ctx, getState()); enterRule(_localctx, 70, EscriptParser::RuleSwitchBlockStatementGroup); #if __cplusplus > 201703L auto onExit = finally([=, this] { #else auto onExit = finally([=] { #endif exitRule(); }); try { size_t alt; enterOuterAlt(_localctx, 1); setState(418); _errHandler->sync(this); alt = 1; do { switch (alt) { case 1: { setState(417); switchLabel(); break; } default: throw NoViableAltException(this); } setState(420); _errHandler->sync(this); alt = getInterpreter()->adaptivePredict(_input, 28, _ctx); } while (alt != 2 && alt != atn::ATN::INVALID_ALT_NUMBER); setState(422); block(); } catch (RecognitionException &e) { _errHandler->reportError(this, e); _localctx->exception = std::current_exception(); _errHandler->recover(this, _localctx->exception); } return _localctx; } //----------------- SwitchLabelContext ------------------------------------------------------------------ EscriptParser::SwitchLabelContext::SwitchLabelContext(ParserRuleContext *parent, size_t invokingState) : ParserRuleContext(parent, invokingState) { } tree::TerminalNode* EscriptParser::SwitchLabelContext::COLON() { return getToken(EscriptParser::COLON, 0); } EscriptParser::IntegerLiteralContext* EscriptParser::SwitchLabelContext::integerLiteral() { return getRuleContext(0); } EscriptParser::BoolLiteralContext* EscriptParser::SwitchLabelContext::boolLiteral() { return getRuleContext(0); } tree::TerminalNode* EscriptParser::SwitchLabelContext::UNINIT() { return getToken(EscriptParser::UNINIT, 0); } tree::TerminalNode* EscriptParser::SwitchLabelContext::IDENTIFIER() { return getToken(EscriptParser::IDENTIFIER, 0); } tree::TerminalNode* EscriptParser::SwitchLabelContext::STRING_LITERAL() { return getToken(EscriptParser::STRING_LITERAL, 0); } tree::TerminalNode* EscriptParser::SwitchLabelContext::DEFAULT() { return getToken(EscriptParser::DEFAULT, 0); } size_t EscriptParser::SwitchLabelContext::getRuleIndex() const { return EscriptParser::RuleSwitchLabel; } void EscriptParser::SwitchLabelContext::enterRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->enterSwitchLabel(this); } void EscriptParser::SwitchLabelContext::exitRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->exitSwitchLabel(this); } std::any EscriptParser::SwitchLabelContext::accept(tree::ParseTreeVisitor *visitor) { if (auto parserVisitor = dynamic_cast(visitor)) return parserVisitor->visitSwitchLabel(this); else return visitor->visitChildren(this); } EscriptParser::SwitchLabelContext* EscriptParser::switchLabel() { SwitchLabelContext *_localctx = _tracker.createInstance(_ctx, getState()); enterRule(_localctx, 72, EscriptParser::RuleSwitchLabel); #if __cplusplus > 201703L auto onExit = finally([=, this] { #else auto onExit = finally([=] { #endif exitRule(); }); try { setState(434); _errHandler->sync(this); switch (_input->LA(1)) { case EscriptParser::UNINIT: case EscriptParser::BOOL_TRUE: case EscriptParser::BOOL_FALSE: case EscriptParser::DECIMAL_LITERAL: case EscriptParser::HEX_LITERAL: case EscriptParser::OCT_LITERAL: case EscriptParser::BINARY_LITERAL: case EscriptParser::STRING_LITERAL: case EscriptParser::IDENTIFIER: { enterOuterAlt(_localctx, 1); setState(429); _errHandler->sync(this); switch (_input->LA(1)) { case EscriptParser::DECIMAL_LITERAL: case EscriptParser::HEX_LITERAL: case EscriptParser::OCT_LITERAL: case EscriptParser::BINARY_LITERAL: { setState(424); integerLiteral(); break; } case EscriptParser::BOOL_TRUE: case EscriptParser::BOOL_FALSE: { setState(425); boolLiteral(); break; } case EscriptParser::UNINIT: { setState(426); match(EscriptParser::UNINIT); break; } case EscriptParser::IDENTIFIER: { setState(427); match(EscriptParser::IDENTIFIER); break; } case EscriptParser::STRING_LITERAL: { setState(428); match(EscriptParser::STRING_LITERAL); break; } default: throw NoViableAltException(this); } setState(431); match(EscriptParser::COLON); break; } case EscriptParser::DEFAULT: { enterOuterAlt(_localctx, 2); setState(432); match(EscriptParser::DEFAULT); setState(433); match(EscriptParser::COLON); break; } default: throw NoViableAltException(this); } } catch (RecognitionException &e) { _errHandler->reportError(this, e); _localctx->exception = std::current_exception(); _errHandler->recover(this, _localctx->exception); } return _localctx; } //----------------- ForGroupContext ------------------------------------------------------------------ EscriptParser::ForGroupContext::ForGroupContext(ParserRuleContext *parent, size_t invokingState) : ParserRuleContext(parent, invokingState) { } EscriptParser::CstyleForStatementContext* EscriptParser::ForGroupContext::cstyleForStatement() { return getRuleContext(0); } EscriptParser::BasicForStatementContext* EscriptParser::ForGroupContext::basicForStatement() { return getRuleContext(0); } size_t EscriptParser::ForGroupContext::getRuleIndex() const { return EscriptParser::RuleForGroup; } void EscriptParser::ForGroupContext::enterRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->enterForGroup(this); } void EscriptParser::ForGroupContext::exitRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->exitForGroup(this); } std::any EscriptParser::ForGroupContext::accept(tree::ParseTreeVisitor *visitor) { if (auto parserVisitor = dynamic_cast(visitor)) return parserVisitor->visitForGroup(this); else return visitor->visitChildren(this); } EscriptParser::ForGroupContext* EscriptParser::forGroup() { ForGroupContext *_localctx = _tracker.createInstance(_ctx, getState()); enterRule(_localctx, 74, EscriptParser::RuleForGroup); #if __cplusplus > 201703L auto onExit = finally([=, this] { #else auto onExit = finally([=] { #endif exitRule(); }); try { setState(438); _errHandler->sync(this); switch (_input->LA(1)) { case EscriptParser::LPAREN: { enterOuterAlt(_localctx, 1); setState(436); cstyleForStatement(); break; } case EscriptParser::IDENTIFIER: { enterOuterAlt(_localctx, 2); setState(437); basicForStatement(); break; } default: throw NoViableAltException(this); } } catch (RecognitionException &e) { _errHandler->reportError(this, e); _localctx->exception = std::current_exception(); _errHandler->recover(this, _localctx->exception); } return _localctx; } //----------------- BasicForStatementContext ------------------------------------------------------------------ EscriptParser::BasicForStatementContext::BasicForStatementContext(ParserRuleContext *parent, size_t invokingState) : ParserRuleContext(parent, invokingState) { } tree::TerminalNode* EscriptParser::BasicForStatementContext::IDENTIFIER() { return getToken(EscriptParser::IDENTIFIER, 0); } tree::TerminalNode* EscriptParser::BasicForStatementContext::ASSIGN() { return getToken(EscriptParser::ASSIGN, 0); } std::vector EscriptParser::BasicForStatementContext::expression() { return getRuleContexts(); } EscriptParser::ExpressionContext* EscriptParser::BasicForStatementContext::expression(size_t i) { return getRuleContext(i); } tree::TerminalNode* EscriptParser::BasicForStatementContext::TO() { return getToken(EscriptParser::TO, 0); } EscriptParser::BlockContext* EscriptParser::BasicForStatementContext::block() { return getRuleContext(0); } size_t EscriptParser::BasicForStatementContext::getRuleIndex() const { return EscriptParser::RuleBasicForStatement; } void EscriptParser::BasicForStatementContext::enterRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->enterBasicForStatement(this); } void EscriptParser::BasicForStatementContext::exitRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->exitBasicForStatement(this); } std::any EscriptParser::BasicForStatementContext::accept(tree::ParseTreeVisitor *visitor) { if (auto parserVisitor = dynamic_cast(visitor)) return parserVisitor->visitBasicForStatement(this); else return visitor->visitChildren(this); } EscriptParser::BasicForStatementContext* EscriptParser::basicForStatement() { BasicForStatementContext *_localctx = _tracker.createInstance(_ctx, getState()); enterRule(_localctx, 76, EscriptParser::RuleBasicForStatement); #if __cplusplus > 201703L auto onExit = finally([=, this] { #else auto onExit = finally([=] { #endif exitRule(); }); try { enterOuterAlt(_localctx, 1); setState(440); match(EscriptParser::IDENTIFIER); setState(441); match(EscriptParser::ASSIGN); setState(442); expression(0); setState(443); match(EscriptParser::TO); setState(444); expression(0); setState(445); block(); } catch (RecognitionException &e) { _errHandler->reportError(this, e); _localctx->exception = std::current_exception(); _errHandler->recover(this, _localctx->exception); } return _localctx; } //----------------- CstyleForStatementContext ------------------------------------------------------------------ EscriptParser::CstyleForStatementContext::CstyleForStatementContext(ParserRuleContext *parent, size_t invokingState) : ParserRuleContext(parent, invokingState) { } tree::TerminalNode* EscriptParser::CstyleForStatementContext::LPAREN() { return getToken(EscriptParser::LPAREN, 0); } std::vector EscriptParser::CstyleForStatementContext::expression() { return getRuleContexts(); } EscriptParser::ExpressionContext* EscriptParser::CstyleForStatementContext::expression(size_t i) { return getRuleContext(i); } std::vector EscriptParser::CstyleForStatementContext::SEMI() { return getTokens(EscriptParser::SEMI); } tree::TerminalNode* EscriptParser::CstyleForStatementContext::SEMI(size_t i) { return getToken(EscriptParser::SEMI, i); } tree::TerminalNode* EscriptParser::CstyleForStatementContext::RPAREN() { return getToken(EscriptParser::RPAREN, 0); } EscriptParser::BlockContext* EscriptParser::CstyleForStatementContext::block() { return getRuleContext(0); } size_t EscriptParser::CstyleForStatementContext::getRuleIndex() const { return EscriptParser::RuleCstyleForStatement; } void EscriptParser::CstyleForStatementContext::enterRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->enterCstyleForStatement(this); } void EscriptParser::CstyleForStatementContext::exitRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->exitCstyleForStatement(this); } std::any EscriptParser::CstyleForStatementContext::accept(tree::ParseTreeVisitor *visitor) { if (auto parserVisitor = dynamic_cast(visitor)) return parserVisitor->visitCstyleForStatement(this); else return visitor->visitChildren(this); } EscriptParser::CstyleForStatementContext* EscriptParser::cstyleForStatement() { CstyleForStatementContext *_localctx = _tracker.createInstance(_ctx, getState()); enterRule(_localctx, 78, EscriptParser::RuleCstyleForStatement); #if __cplusplus > 201703L auto onExit = finally([=, this] { #else auto onExit = finally([=] { #endif exitRule(); }); try { enterOuterAlt(_localctx, 1); setState(447); match(EscriptParser::LPAREN); setState(448); expression(0); setState(449); match(EscriptParser::SEMI); setState(450); expression(0); setState(451); match(EscriptParser::SEMI); setState(452); expression(0); setState(453); match(EscriptParser::RPAREN); setState(454); block(); } catch (RecognitionException &e) { _errHandler->reportError(this, e); _localctx->exception = std::current_exception(); _errHandler->recover(this, _localctx->exception); } return _localctx; } //----------------- IdentifierListContext ------------------------------------------------------------------ EscriptParser::IdentifierListContext::IdentifierListContext(ParserRuleContext *parent, size_t invokingState) : ParserRuleContext(parent, invokingState) { } tree::TerminalNode* EscriptParser::IdentifierListContext::IDENTIFIER() { return getToken(EscriptParser::IDENTIFIER, 0); } tree::TerminalNode* EscriptParser::IdentifierListContext::COMMA() { return getToken(EscriptParser::COMMA, 0); } EscriptParser::IdentifierListContext* EscriptParser::IdentifierListContext::identifierList() { return getRuleContext(0); } size_t EscriptParser::IdentifierListContext::getRuleIndex() const { return EscriptParser::RuleIdentifierList; } void EscriptParser::IdentifierListContext::enterRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->enterIdentifierList(this); } void EscriptParser::IdentifierListContext::exitRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->exitIdentifierList(this); } std::any EscriptParser::IdentifierListContext::accept(tree::ParseTreeVisitor *visitor) { if (auto parserVisitor = dynamic_cast(visitor)) return parserVisitor->visitIdentifierList(this); else return visitor->visitChildren(this); } EscriptParser::IdentifierListContext* EscriptParser::identifierList() { IdentifierListContext *_localctx = _tracker.createInstance(_ctx, getState()); enterRule(_localctx, 80, EscriptParser::RuleIdentifierList); #if __cplusplus > 201703L auto onExit = finally([=, this] { #else auto onExit = finally([=] { #endif exitRule(); }); try { enterOuterAlt(_localctx, 1); setState(456); match(EscriptParser::IDENTIFIER); setState(459); _errHandler->sync(this); switch (getInterpreter()->adaptivePredict(_input, 32, _ctx)) { case 1: { setState(457); match(EscriptParser::COMMA); setState(458); identifierList(); break; } default: break; } } catch (RecognitionException &e) { _errHandler->reportError(this, e); _localctx->exception = std::current_exception(); _errHandler->recover(this, _localctx->exception); } return _localctx; } //----------------- VariableDeclarationListContext ------------------------------------------------------------------ EscriptParser::VariableDeclarationListContext::VariableDeclarationListContext(ParserRuleContext *parent, size_t invokingState) : ParserRuleContext(parent, invokingState) { } std::vector EscriptParser::VariableDeclarationListContext::variableDeclaration() { return getRuleContexts(); } EscriptParser::VariableDeclarationContext* EscriptParser::VariableDeclarationListContext::variableDeclaration(size_t i) { return getRuleContext(i); } std::vector EscriptParser::VariableDeclarationListContext::COMMA() { return getTokens(EscriptParser::COMMA); } tree::TerminalNode* EscriptParser::VariableDeclarationListContext::COMMA(size_t i) { return getToken(EscriptParser::COMMA, i); } size_t EscriptParser::VariableDeclarationListContext::getRuleIndex() const { return EscriptParser::RuleVariableDeclarationList; } void EscriptParser::VariableDeclarationListContext::enterRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->enterVariableDeclarationList(this); } void EscriptParser::VariableDeclarationListContext::exitRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->exitVariableDeclarationList(this); } std::any EscriptParser::VariableDeclarationListContext::accept(tree::ParseTreeVisitor *visitor) { if (auto parserVisitor = dynamic_cast(visitor)) return parserVisitor->visitVariableDeclarationList(this); else return visitor->visitChildren(this); } EscriptParser::VariableDeclarationListContext* EscriptParser::variableDeclarationList() { VariableDeclarationListContext *_localctx = _tracker.createInstance(_ctx, getState()); enterRule(_localctx, 82, EscriptParser::RuleVariableDeclarationList); size_t _la = 0; #if __cplusplus > 201703L auto onExit = finally([=, this] { #else auto onExit = finally([=] { #endif exitRule(); }); try { enterOuterAlt(_localctx, 1); setState(461); variableDeclaration(); setState(466); _errHandler->sync(this); _la = _input->LA(1); while (_la == EscriptParser::COMMA) { setState(462); match(EscriptParser::COMMA); setState(463); variableDeclaration(); setState(468); _errHandler->sync(this); _la = _input->LA(1); } } catch (RecognitionException &e) { _errHandler->reportError(this, e); _localctx->exception = std::current_exception(); _errHandler->recover(this, _localctx->exception); } return _localctx; } //----------------- ConstantDeclarationContext ------------------------------------------------------------------ EscriptParser::ConstantDeclarationContext::ConstantDeclarationContext(ParserRuleContext *parent, size_t invokingState) : ParserRuleContext(parent, invokingState) { } tree::TerminalNode* EscriptParser::ConstantDeclarationContext::IDENTIFIER() { return getToken(EscriptParser::IDENTIFIER, 0); } EscriptParser::VariableDeclarationInitializerContext* EscriptParser::ConstantDeclarationContext::variableDeclarationInitializer() { return getRuleContext(0); } size_t EscriptParser::ConstantDeclarationContext::getRuleIndex() const { return EscriptParser::RuleConstantDeclaration; } void EscriptParser::ConstantDeclarationContext::enterRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->enterConstantDeclaration(this); } void EscriptParser::ConstantDeclarationContext::exitRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->exitConstantDeclaration(this); } std::any EscriptParser::ConstantDeclarationContext::accept(tree::ParseTreeVisitor *visitor) { if (auto parserVisitor = dynamic_cast(visitor)) return parserVisitor->visitConstantDeclaration(this); else return visitor->visitChildren(this); } EscriptParser::ConstantDeclarationContext* EscriptParser::constantDeclaration() { ConstantDeclarationContext *_localctx = _tracker.createInstance(_ctx, getState()); enterRule(_localctx, 84, EscriptParser::RuleConstantDeclaration); #if __cplusplus > 201703L auto onExit = finally([=, this] { #else auto onExit = finally([=] { #endif exitRule(); }); try { enterOuterAlt(_localctx, 1); setState(469); match(EscriptParser::IDENTIFIER); setState(470); variableDeclarationInitializer(); } catch (RecognitionException &e) { _errHandler->reportError(this, e); _localctx->exception = std::current_exception(); _errHandler->recover(this, _localctx->exception); } return _localctx; } //----------------- VariableDeclarationContext ------------------------------------------------------------------ EscriptParser::VariableDeclarationContext::VariableDeclarationContext(ParserRuleContext *parent, size_t invokingState) : ParserRuleContext(parent, invokingState) { } tree::TerminalNode* EscriptParser::VariableDeclarationContext::IDENTIFIER() { return getToken(EscriptParser::IDENTIFIER, 0); } EscriptParser::VariableDeclarationInitializerContext* EscriptParser::VariableDeclarationContext::variableDeclarationInitializer() { return getRuleContext(0); } size_t EscriptParser::VariableDeclarationContext::getRuleIndex() const { return EscriptParser::RuleVariableDeclaration; } void EscriptParser::VariableDeclarationContext::enterRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->enterVariableDeclaration(this); } void EscriptParser::VariableDeclarationContext::exitRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->exitVariableDeclaration(this); } std::any EscriptParser::VariableDeclarationContext::accept(tree::ParseTreeVisitor *visitor) { if (auto parserVisitor = dynamic_cast(visitor)) return parserVisitor->visitVariableDeclaration(this); else return visitor->visitChildren(this); } EscriptParser::VariableDeclarationContext* EscriptParser::variableDeclaration() { VariableDeclarationContext *_localctx = _tracker.createInstance(_ctx, getState()); enterRule(_localctx, 86, EscriptParser::RuleVariableDeclaration); size_t _la = 0; #if __cplusplus > 201703L auto onExit = finally([=, this] { #else auto onExit = finally([=] { #endif exitRule(); }); try { enterOuterAlt(_localctx, 1); setState(472); match(EscriptParser::IDENTIFIER); setState(474); _errHandler->sync(this); _la = _input->LA(1); if (((((_la - 64) & ~ 0x3fULL) == 0) && ((1ULL << (_la - 64)) & 43980465111041) != 0)) { setState(473); variableDeclarationInitializer(); } } catch (RecognitionException &e) { _errHandler->reportError(this, e); _localctx->exception = std::current_exception(); _errHandler->recover(this, _localctx->exception); } return _localctx; } //----------------- ProgramParametersContext ------------------------------------------------------------------ EscriptParser::ProgramParametersContext::ProgramParametersContext(ParserRuleContext *parent, size_t invokingState) : ParserRuleContext(parent, invokingState) { } tree::TerminalNode* EscriptParser::ProgramParametersContext::LPAREN() { return getToken(EscriptParser::LPAREN, 0); } tree::TerminalNode* EscriptParser::ProgramParametersContext::RPAREN() { return getToken(EscriptParser::RPAREN, 0); } EscriptParser::ProgramParameterListContext* EscriptParser::ProgramParametersContext::programParameterList() { return getRuleContext(0); } size_t EscriptParser::ProgramParametersContext::getRuleIndex() const { return EscriptParser::RuleProgramParameters; } void EscriptParser::ProgramParametersContext::enterRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->enterProgramParameters(this); } void EscriptParser::ProgramParametersContext::exitRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->exitProgramParameters(this); } std::any EscriptParser::ProgramParametersContext::accept(tree::ParseTreeVisitor *visitor) { if (auto parserVisitor = dynamic_cast(visitor)) return parserVisitor->visitProgramParameters(this); else return visitor->visitChildren(this); } EscriptParser::ProgramParametersContext* EscriptParser::programParameters() { ProgramParametersContext *_localctx = _tracker.createInstance(_ctx, getState()); enterRule(_localctx, 88, EscriptParser::RuleProgramParameters); size_t _la = 0; #if __cplusplus > 201703L auto onExit = finally([=, this] { #else auto onExit = finally([=] { #endif exitRule(); }); try { enterOuterAlt(_localctx, 1); setState(476); match(EscriptParser::LPAREN); setState(478); _errHandler->sync(this); _la = _input->LA(1); if (_la == EscriptParser::UNUSED || _la == EscriptParser::IDENTIFIER) { setState(477); programParameterList(); } setState(480); match(EscriptParser::RPAREN); } catch (RecognitionException &e) { _errHandler->reportError(this, e); _localctx->exception = std::current_exception(); _errHandler->recover(this, _localctx->exception); } return _localctx; } //----------------- ProgramParameterListContext ------------------------------------------------------------------ EscriptParser::ProgramParameterListContext::ProgramParameterListContext(ParserRuleContext *parent, size_t invokingState) : ParserRuleContext(parent, invokingState) { } std::vector EscriptParser::ProgramParameterListContext::programParameter() { return getRuleContexts(); } EscriptParser::ProgramParameterContext* EscriptParser::ProgramParameterListContext::programParameter(size_t i) { return getRuleContext(i); } std::vector EscriptParser::ProgramParameterListContext::COMMA() { return getTokens(EscriptParser::COMMA); } tree::TerminalNode* EscriptParser::ProgramParameterListContext::COMMA(size_t i) { return getToken(EscriptParser::COMMA, i); } size_t EscriptParser::ProgramParameterListContext::getRuleIndex() const { return EscriptParser::RuleProgramParameterList; } void EscriptParser::ProgramParameterListContext::enterRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->enterProgramParameterList(this); } void EscriptParser::ProgramParameterListContext::exitRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->exitProgramParameterList(this); } std::any EscriptParser::ProgramParameterListContext::accept(tree::ParseTreeVisitor *visitor) { if (auto parserVisitor = dynamic_cast(visitor)) return parserVisitor->visitProgramParameterList(this); else return visitor->visitChildren(this); } EscriptParser::ProgramParameterListContext* EscriptParser::programParameterList() { ProgramParameterListContext *_localctx = _tracker.createInstance(_ctx, getState()); enterRule(_localctx, 90, EscriptParser::RuleProgramParameterList); size_t _la = 0; #if __cplusplus > 201703L auto onExit = finally([=, this] { #else auto onExit = finally([=] { #endif exitRule(); }); try { enterOuterAlt(_localctx, 1); setState(482); programParameter(); setState(489); _errHandler->sync(this); _la = _input->LA(1); while (_la == EscriptParser::UNUSED || _la == EscriptParser::COMMA || _la == EscriptParser::IDENTIFIER) { setState(484); _errHandler->sync(this); _la = _input->LA(1); if (_la == EscriptParser::COMMA) { setState(483); match(EscriptParser::COMMA); } setState(486); programParameter(); setState(491); _errHandler->sync(this); _la = _input->LA(1); } } catch (RecognitionException &e) { _errHandler->reportError(this, e); _localctx->exception = std::current_exception(); _errHandler->recover(this, _localctx->exception); } return _localctx; } //----------------- ProgramParameterContext ------------------------------------------------------------------ EscriptParser::ProgramParameterContext::ProgramParameterContext(ParserRuleContext *parent, size_t invokingState) : ParserRuleContext(parent, invokingState) { } tree::TerminalNode* EscriptParser::ProgramParameterContext::UNUSED() { return getToken(EscriptParser::UNUSED, 0); } tree::TerminalNode* EscriptParser::ProgramParameterContext::IDENTIFIER() { return getToken(EscriptParser::IDENTIFIER, 0); } tree::TerminalNode* EscriptParser::ProgramParameterContext::ASSIGN() { return getToken(EscriptParser::ASSIGN, 0); } EscriptParser::ExpressionContext* EscriptParser::ProgramParameterContext::expression() { return getRuleContext(0); } size_t EscriptParser::ProgramParameterContext::getRuleIndex() const { return EscriptParser::RuleProgramParameter; } void EscriptParser::ProgramParameterContext::enterRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->enterProgramParameter(this); } void EscriptParser::ProgramParameterContext::exitRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->exitProgramParameter(this); } std::any EscriptParser::ProgramParameterContext::accept(tree::ParseTreeVisitor *visitor) { if (auto parserVisitor = dynamic_cast(visitor)) return parserVisitor->visitProgramParameter(this); else return visitor->visitChildren(this); } EscriptParser::ProgramParameterContext* EscriptParser::programParameter() { ProgramParameterContext *_localctx = _tracker.createInstance(_ctx, getState()); enterRule(_localctx, 92, EscriptParser::RuleProgramParameter); size_t _la = 0; #if __cplusplus > 201703L auto onExit = finally([=, this] { #else auto onExit = finally([=] { #endif exitRule(); }); try { setState(499); _errHandler->sync(this); switch (_input->LA(1)) { case EscriptParser::UNUSED: { enterOuterAlt(_localctx, 1); setState(492); match(EscriptParser::UNUSED); setState(493); match(EscriptParser::IDENTIFIER); break; } case EscriptParser::IDENTIFIER: { enterOuterAlt(_localctx, 2); setState(494); match(EscriptParser::IDENTIFIER); setState(497); _errHandler->sync(this); _la = _input->LA(1); if (_la == EscriptParser::ASSIGN) { setState(495); match(EscriptParser::ASSIGN); setState(496); expression(0); } break; } default: throw NoViableAltException(this); } } catch (RecognitionException &e) { _errHandler->reportError(this, e); _localctx->exception = std::current_exception(); _errHandler->recover(this, _localctx->exception); } return _localctx; } //----------------- FunctionParametersContext ------------------------------------------------------------------ EscriptParser::FunctionParametersContext::FunctionParametersContext(ParserRuleContext *parent, size_t invokingState) : ParserRuleContext(parent, invokingState) { } tree::TerminalNode* EscriptParser::FunctionParametersContext::LPAREN() { return getToken(EscriptParser::LPAREN, 0); } tree::TerminalNode* EscriptParser::FunctionParametersContext::RPAREN() { return getToken(EscriptParser::RPAREN, 0); } EscriptParser::FunctionParameterListContext* EscriptParser::FunctionParametersContext::functionParameterList() { return getRuleContext(0); } size_t EscriptParser::FunctionParametersContext::getRuleIndex() const { return EscriptParser::RuleFunctionParameters; } void EscriptParser::FunctionParametersContext::enterRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->enterFunctionParameters(this); } void EscriptParser::FunctionParametersContext::exitRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->exitFunctionParameters(this); } std::any EscriptParser::FunctionParametersContext::accept(tree::ParseTreeVisitor *visitor) { if (auto parserVisitor = dynamic_cast(visitor)) return parserVisitor->visitFunctionParameters(this); else return visitor->visitChildren(this); } EscriptParser::FunctionParametersContext* EscriptParser::functionParameters() { FunctionParametersContext *_localctx = _tracker.createInstance(_ctx, getState()); enterRule(_localctx, 94, EscriptParser::RuleFunctionParameters); size_t _la = 0; #if __cplusplus > 201703L auto onExit = finally([=, this] { #else auto onExit = finally([=] { #endif exitRule(); }); try { enterOuterAlt(_localctx, 1); setState(501); match(EscriptParser::LPAREN); setState(503); _errHandler->sync(this); _la = _input->LA(1); if (_la == EscriptParser::BYREF || _la == EscriptParser::UNUSED || _la == EscriptParser::IDENTIFIER) { setState(502); functionParameterList(); } setState(505); match(EscriptParser::RPAREN); } catch (RecognitionException &e) { _errHandler->reportError(this, e); _localctx->exception = std::current_exception(); _errHandler->recover(this, _localctx->exception); } return _localctx; } //----------------- FunctionParameterListContext ------------------------------------------------------------------ EscriptParser::FunctionParameterListContext::FunctionParameterListContext(ParserRuleContext *parent, size_t invokingState) : ParserRuleContext(parent, invokingState) { } std::vector EscriptParser::FunctionParameterListContext::functionParameter() { return getRuleContexts(); } EscriptParser::FunctionParameterContext* EscriptParser::FunctionParameterListContext::functionParameter(size_t i) { return getRuleContext(i); } std::vector EscriptParser::FunctionParameterListContext::COMMA() { return getTokens(EscriptParser::COMMA); } tree::TerminalNode* EscriptParser::FunctionParameterListContext::COMMA(size_t i) { return getToken(EscriptParser::COMMA, i); } size_t EscriptParser::FunctionParameterListContext::getRuleIndex() const { return EscriptParser::RuleFunctionParameterList; } void EscriptParser::FunctionParameterListContext::enterRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->enterFunctionParameterList(this); } void EscriptParser::FunctionParameterListContext::exitRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->exitFunctionParameterList(this); } std::any EscriptParser::FunctionParameterListContext::accept(tree::ParseTreeVisitor *visitor) { if (auto parserVisitor = dynamic_cast(visitor)) return parserVisitor->visitFunctionParameterList(this); else return visitor->visitChildren(this); } EscriptParser::FunctionParameterListContext* EscriptParser::functionParameterList() { FunctionParameterListContext *_localctx = _tracker.createInstance(_ctx, getState()); enterRule(_localctx, 96, EscriptParser::RuleFunctionParameterList); size_t _la = 0; #if __cplusplus > 201703L auto onExit = finally([=, this] { #else auto onExit = finally([=] { #endif exitRule(); }); try { enterOuterAlt(_localctx, 1); setState(507); functionParameter(); setState(512); _errHandler->sync(this); _la = _input->LA(1); while (_la == EscriptParser::COMMA) { setState(508); match(EscriptParser::COMMA); setState(509); functionParameter(); setState(514); _errHandler->sync(this); _la = _input->LA(1); } } catch (RecognitionException &e) { _errHandler->reportError(this, e); _localctx->exception = std::current_exception(); _errHandler->recover(this, _localctx->exception); } return _localctx; } //----------------- FunctionParameterContext ------------------------------------------------------------------ EscriptParser::FunctionParameterContext::FunctionParameterContext(ParserRuleContext *parent, size_t invokingState) : ParserRuleContext(parent, invokingState) { } tree::TerminalNode* EscriptParser::FunctionParameterContext::IDENTIFIER() { return getToken(EscriptParser::IDENTIFIER, 0); } tree::TerminalNode* EscriptParser::FunctionParameterContext::BYREF() { return getToken(EscriptParser::BYREF, 0); } tree::TerminalNode* EscriptParser::FunctionParameterContext::UNUSED() { return getToken(EscriptParser::UNUSED, 0); } tree::TerminalNode* EscriptParser::FunctionParameterContext::ASSIGN() { return getToken(EscriptParser::ASSIGN, 0); } EscriptParser::ExpressionContext* EscriptParser::FunctionParameterContext::expression() { return getRuleContext(0); } size_t EscriptParser::FunctionParameterContext::getRuleIndex() const { return EscriptParser::RuleFunctionParameter; } void EscriptParser::FunctionParameterContext::enterRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->enterFunctionParameter(this); } void EscriptParser::FunctionParameterContext::exitRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->exitFunctionParameter(this); } std::any EscriptParser::FunctionParameterContext::accept(tree::ParseTreeVisitor *visitor) { if (auto parserVisitor = dynamic_cast(visitor)) return parserVisitor->visitFunctionParameter(this); else return visitor->visitChildren(this); } EscriptParser::FunctionParameterContext* EscriptParser::functionParameter() { FunctionParameterContext *_localctx = _tracker.createInstance(_ctx, getState()); enterRule(_localctx, 98, EscriptParser::RuleFunctionParameter); size_t _la = 0; #if __cplusplus > 201703L auto onExit = finally([=, this] { #else auto onExit = finally([=] { #endif exitRule(); }); try { enterOuterAlt(_localctx, 1); setState(516); _errHandler->sync(this); _la = _input->LA(1); if (_la == EscriptParser::BYREF) { setState(515); match(EscriptParser::BYREF); } setState(519); _errHandler->sync(this); _la = _input->LA(1); if (_la == EscriptParser::UNUSED) { setState(518); match(EscriptParser::UNUSED); } setState(521); match(EscriptParser::IDENTIFIER); setState(524); _errHandler->sync(this); _la = _input->LA(1); if (_la == EscriptParser::ASSIGN) { setState(522); match(EscriptParser::ASSIGN); setState(523); expression(0); } } catch (RecognitionException &e) { _errHandler->reportError(this, e); _localctx->exception = std::current_exception(); _errHandler->recover(this, _localctx->exception); } return _localctx; } //----------------- ScopedFunctionCallContext ------------------------------------------------------------------ EscriptParser::ScopedFunctionCallContext::ScopedFunctionCallContext(ParserRuleContext *parent, size_t invokingState) : ParserRuleContext(parent, invokingState) { } tree::TerminalNode* EscriptParser::ScopedFunctionCallContext::IDENTIFIER() { return getToken(EscriptParser::IDENTIFIER, 0); } tree::TerminalNode* EscriptParser::ScopedFunctionCallContext::COLONCOLON() { return getToken(EscriptParser::COLONCOLON, 0); } EscriptParser::FunctionCallContext* EscriptParser::ScopedFunctionCallContext::functionCall() { return getRuleContext(0); } size_t EscriptParser::ScopedFunctionCallContext::getRuleIndex() const { return EscriptParser::RuleScopedFunctionCall; } void EscriptParser::ScopedFunctionCallContext::enterRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->enterScopedFunctionCall(this); } void EscriptParser::ScopedFunctionCallContext::exitRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->exitScopedFunctionCall(this); } std::any EscriptParser::ScopedFunctionCallContext::accept(tree::ParseTreeVisitor *visitor) { if (auto parserVisitor = dynamic_cast(visitor)) return parserVisitor->visitScopedFunctionCall(this); else return visitor->visitChildren(this); } EscriptParser::ScopedFunctionCallContext* EscriptParser::scopedFunctionCall() { ScopedFunctionCallContext *_localctx = _tracker.createInstance(_ctx, getState()); enterRule(_localctx, 100, EscriptParser::RuleScopedFunctionCall); #if __cplusplus > 201703L auto onExit = finally([=, this] { #else auto onExit = finally([=] { #endif exitRule(); }); try { enterOuterAlt(_localctx, 1); setState(526); match(EscriptParser::IDENTIFIER); setState(527); match(EscriptParser::COLONCOLON); setState(528); functionCall(); } catch (RecognitionException &e) { _errHandler->reportError(this, e); _localctx->exception = std::current_exception(); _errHandler->recover(this, _localctx->exception); } return _localctx; } //----------------- FunctionReferenceContext ------------------------------------------------------------------ EscriptParser::FunctionReferenceContext::FunctionReferenceContext(ParserRuleContext *parent, size_t invokingState) : ParserRuleContext(parent, invokingState) { } tree::TerminalNode* EscriptParser::FunctionReferenceContext::AT() { return getToken(EscriptParser::AT, 0); } tree::TerminalNode* EscriptParser::FunctionReferenceContext::IDENTIFIER() { return getToken(EscriptParser::IDENTIFIER, 0); } size_t EscriptParser::FunctionReferenceContext::getRuleIndex() const { return EscriptParser::RuleFunctionReference; } void EscriptParser::FunctionReferenceContext::enterRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->enterFunctionReference(this); } void EscriptParser::FunctionReferenceContext::exitRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->exitFunctionReference(this); } std::any EscriptParser::FunctionReferenceContext::accept(tree::ParseTreeVisitor *visitor) { if (auto parserVisitor = dynamic_cast(visitor)) return parserVisitor->visitFunctionReference(this); else return visitor->visitChildren(this); } EscriptParser::FunctionReferenceContext* EscriptParser::functionReference() { FunctionReferenceContext *_localctx = _tracker.createInstance(_ctx, getState()); enterRule(_localctx, 102, EscriptParser::RuleFunctionReference); #if __cplusplus > 201703L auto onExit = finally([=, this] { #else auto onExit = finally([=] { #endif exitRule(); }); try { enterOuterAlt(_localctx, 1); setState(530); match(EscriptParser::AT); setState(531); match(EscriptParser::IDENTIFIER); } catch (RecognitionException &e) { _errHandler->reportError(this, e); _localctx->exception = std::current_exception(); _errHandler->recover(this, _localctx->exception); } return _localctx; } //----------------- ExpressionContext ------------------------------------------------------------------ EscriptParser::ExpressionContext::ExpressionContext(ParserRuleContext *parent, size_t invokingState) : ParserRuleContext(parent, invokingState) { } EscriptParser::PrimaryContext* EscriptParser::ExpressionContext::primary() { return getRuleContext(0); } std::vector EscriptParser::ExpressionContext::expression() { return getRuleContexts(); } EscriptParser::ExpressionContext* EscriptParser::ExpressionContext::expression(size_t i) { return getRuleContext(i); } tree::TerminalNode* EscriptParser::ExpressionContext::ADD() { return getToken(EscriptParser::ADD, 0); } tree::TerminalNode* EscriptParser::ExpressionContext::SUB() { return getToken(EscriptParser::SUB, 0); } tree::TerminalNode* EscriptParser::ExpressionContext::INC() { return getToken(EscriptParser::INC, 0); } tree::TerminalNode* EscriptParser::ExpressionContext::DEC() { return getToken(EscriptParser::DEC, 0); } tree::TerminalNode* EscriptParser::ExpressionContext::TILDE() { return getToken(EscriptParser::TILDE, 0); } tree::TerminalNode* EscriptParser::ExpressionContext::BANG_A() { return getToken(EscriptParser::BANG_A, 0); } tree::TerminalNode* EscriptParser::ExpressionContext::BANG_B() { return getToken(EscriptParser::BANG_B, 0); } tree::TerminalNode* EscriptParser::ExpressionContext::MUL() { return getToken(EscriptParser::MUL, 0); } tree::TerminalNode* EscriptParser::ExpressionContext::DIV() { return getToken(EscriptParser::DIV, 0); } tree::TerminalNode* EscriptParser::ExpressionContext::MOD() { return getToken(EscriptParser::MOD, 0); } tree::TerminalNode* EscriptParser::ExpressionContext::LSHIFT() { return getToken(EscriptParser::LSHIFT, 0); } tree::TerminalNode* EscriptParser::ExpressionContext::RSHIFT() { return getToken(EscriptParser::RSHIFT, 0); } tree::TerminalNode* EscriptParser::ExpressionContext::BITAND() { return getToken(EscriptParser::BITAND, 0); } tree::TerminalNode* EscriptParser::ExpressionContext::BITOR() { return getToken(EscriptParser::BITOR, 0); } tree::TerminalNode* EscriptParser::ExpressionContext::CARET() { return getToken(EscriptParser::CARET, 0); } tree::TerminalNode* EscriptParser::ExpressionContext::ELVIS() { return getToken(EscriptParser::ELVIS, 0); } tree::TerminalNode* EscriptParser::ExpressionContext::TOK_IN() { return getToken(EscriptParser::TOK_IN, 0); } tree::TerminalNode* EscriptParser::ExpressionContext::LE() { return getToken(EscriptParser::LE, 0); } tree::TerminalNode* EscriptParser::ExpressionContext::GE() { return getToken(EscriptParser::GE, 0); } tree::TerminalNode* EscriptParser::ExpressionContext::GT() { return getToken(EscriptParser::GT, 0); } tree::TerminalNode* EscriptParser::ExpressionContext::LT() { return getToken(EscriptParser::LT, 0); } tree::TerminalNode* EscriptParser::ExpressionContext::EQUAL_DEPRECATED() { return getToken(EscriptParser::EQUAL_DEPRECATED, 0); } tree::TerminalNode* EscriptParser::ExpressionContext::EQUAL() { return getToken(EscriptParser::EQUAL, 0); } tree::TerminalNode* EscriptParser::ExpressionContext::NOTEQUAL_B() { return getToken(EscriptParser::NOTEQUAL_B, 0); } tree::TerminalNode* EscriptParser::ExpressionContext::NOTEQUAL_A() { return getToken(EscriptParser::NOTEQUAL_A, 0); } tree::TerminalNode* EscriptParser::ExpressionContext::AND_A() { return getToken(EscriptParser::AND_A, 0); } tree::TerminalNode* EscriptParser::ExpressionContext::AND_B() { return getToken(EscriptParser::AND_B, 0); } tree::TerminalNode* EscriptParser::ExpressionContext::OR_A() { return getToken(EscriptParser::OR_A, 0); } tree::TerminalNode* EscriptParser::ExpressionContext::OR_B() { return getToken(EscriptParser::OR_B, 0); } tree::TerminalNode* EscriptParser::ExpressionContext::QUESTION() { return getToken(EscriptParser::QUESTION, 0); } tree::TerminalNode* EscriptParser::ExpressionContext::COLON() { return getToken(EscriptParser::COLON, 0); } tree::TerminalNode* EscriptParser::ExpressionContext::ADDMEMBER() { return getToken(EscriptParser::ADDMEMBER, 0); } tree::TerminalNode* EscriptParser::ExpressionContext::DELMEMBER() { return getToken(EscriptParser::DELMEMBER, 0); } tree::TerminalNode* EscriptParser::ExpressionContext::CHKMEMBER() { return getToken(EscriptParser::CHKMEMBER, 0); } tree::TerminalNode* EscriptParser::ExpressionContext::ASSIGN() { return getToken(EscriptParser::ASSIGN, 0); } tree::TerminalNode* EscriptParser::ExpressionContext::ADD_ASSIGN() { return getToken(EscriptParser::ADD_ASSIGN, 0); } tree::TerminalNode* EscriptParser::ExpressionContext::SUB_ASSIGN() { return getToken(EscriptParser::SUB_ASSIGN, 0); } tree::TerminalNode* EscriptParser::ExpressionContext::MUL_ASSIGN() { return getToken(EscriptParser::MUL_ASSIGN, 0); } tree::TerminalNode* EscriptParser::ExpressionContext::DIV_ASSIGN() { return getToken(EscriptParser::DIV_ASSIGN, 0); } tree::TerminalNode* EscriptParser::ExpressionContext::MOD_ASSIGN() { return getToken(EscriptParser::MOD_ASSIGN, 0); } EscriptParser::ExpressionSuffixContext* EscriptParser::ExpressionContext::expressionSuffix() { return getRuleContext(0); } size_t EscriptParser::ExpressionContext::getRuleIndex() const { return EscriptParser::RuleExpression; } void EscriptParser::ExpressionContext::enterRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->enterExpression(this); } void EscriptParser::ExpressionContext::exitRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->exitExpression(this); } std::any EscriptParser::ExpressionContext::accept(tree::ParseTreeVisitor *visitor) { if (auto parserVisitor = dynamic_cast(visitor)) return parserVisitor->visitExpression(this); else return visitor->visitChildren(this); } EscriptParser::ExpressionContext* EscriptParser::expression() { return expression(0); } EscriptParser::ExpressionContext* EscriptParser::expression(int precedence) { ParserRuleContext *parentContext = _ctx; size_t parentState = getState(); EscriptParser::ExpressionContext *_localctx = _tracker.createInstance(_ctx, parentState); EscriptParser::ExpressionContext *previousContext = _localctx; (void)previousContext; // Silence compiler, in case the context is not used by generated code. size_t startState = 104; enterRecursionRule(_localctx, 104, EscriptParser::RuleExpression, precedence); size_t _la = 0; #if __cplusplus > 201703L auto onExit = finally([=, this] { #else auto onExit = finally([=] { #endif unrollRecursionContexts(parentContext); }); try { size_t alt; enterOuterAlt(_localctx, 1); setState(539); _errHandler->sync(this); switch (_input->LA(1)) { case EscriptParser::TOK_ERROR: case EscriptParser::DICTIONARY: case EscriptParser::STRUCT: case EscriptParser::ARRAY: case EscriptParser::UNINIT: case EscriptParser::BOOL_TRUE: case EscriptParser::BOOL_FALSE: case EscriptParser::DECIMAL_LITERAL: case EscriptParser::HEX_LITERAL: case EscriptParser::OCT_LITERAL: case EscriptParser::BINARY_LITERAL: case EscriptParser::FLOAT_LITERAL: case EscriptParser::HEX_FLOAT_LITERAL: case EscriptParser::STRING_LITERAL: case EscriptParser::INTERPOLATED_STRING_START: case EscriptParser::LPAREN: case EscriptParser::LBRACE: case EscriptParser::AT: case EscriptParser::IDENTIFIER: { setState(534); primary(); break; } case EscriptParser::ADD: case EscriptParser::SUB: case EscriptParser::INC: case EscriptParser::DEC: { setState(535); antlrcpp::downCast(_localctx)->prefix = _input->LT(1); _la = _input->LA(1); if (!(((((_la - 89) & ~ 0x3fULL) == 0) && ((1ULL << (_la - 89)) & 3221225475) != 0))) { antlrcpp::downCast(_localctx)->prefix = _errHandler->recoverInline(this); } else { _errHandler->reportMatch(this); consume(); } setState(536); expression(14); break; } case EscriptParser::BANG_A: case EscriptParser::BANG_B: case EscriptParser::TILDE: { setState(537); antlrcpp::downCast(_localctx)->prefix = _input->LT(1); _la = _input->LA(1); if (!(((((_la - 56) & ~ 0x3fULL) == 0) && ((1ULL << (_la - 56)) & 576460752303423491) != 0))) { antlrcpp::downCast(_localctx)->prefix = _errHandler->recoverInline(this); } else { _errHandler->reportMatch(this); consume(); } setState(538); expression(13); break; } default: throw NoViableAltException(this); } _ctx->stop = _input->LT(-1); setState(587); _errHandler->sync(this); alt = getInterpreter()->adaptivePredict(_input, 47, _ctx); while (alt != 2 && alt != atn::ATN::INVALID_ALT_NUMBER) { if (alt == 1) { if (!_parseListeners.empty()) triggerExitRuleEvent(); previousContext = _localctx; setState(585); _errHandler->sync(this); switch (getInterpreter()->adaptivePredict(_input, 46, _ctx)) { case 1: { _localctx = _tracker.createInstance(parentContext, parentState); pushNewRecursionContext(_localctx, startState, RuleExpression); setState(541); if (!(precpred(_ctx, 12))) throw FailedPredicateException(this, "precpred(_ctx, 12)"); setState(542); antlrcpp::downCast(_localctx)->bop = _input->LT(1); _la = _input->LA(1); if (!(((((_la - 86) & ~ 0x3fULL) == 0) && ((1ULL << (_la - 86)) & 114695) != 0))) { antlrcpp::downCast(_localctx)->bop = _errHandler->recoverInline(this); } else { _errHandler->reportMatch(this); consume(); } setState(543); expression(13); break; } case 2: { _localctx = _tracker.createInstance(parentContext, parentState); pushNewRecursionContext(_localctx, startState, RuleExpression); setState(544); if (!(precpred(_ctx, 11))) throw FailedPredicateException(this, "precpred(_ctx, 11)"); setState(545); antlrcpp::downCast(_localctx)->bop = _input->LT(1); _la = _input->LA(1); if (!(((((_la - 89) & ~ 0x3fULL) == 0) && ((1ULL << (_la - 89)) & 49155) != 0))) { antlrcpp::downCast(_localctx)->bop = _errHandler->recoverInline(this); } else { _errHandler->reportMatch(this); consume(); } setState(546); expression(12); break; } case 3: { _localctx = _tracker.createInstance(parentContext, parentState); pushNewRecursionContext(_localctx, startState, RuleExpression); setState(547); if (!(precpred(_ctx, 10))) throw FailedPredicateException(this, "precpred(_ctx, 10)"); setState(548); antlrcpp::downCast(_localctx)->bop = match(EscriptParser::ELVIS); setState(549); expression(11); break; } case 4: { _localctx = _tracker.createInstance(parentContext, parentState); pushNewRecursionContext(_localctx, startState, RuleExpression); setState(550); if (!(precpred(_ctx, 9))) throw FailedPredicateException(this, "precpred(_ctx, 9)"); setState(551); antlrcpp::downCast(_localctx)->bop = match(EscriptParser::TOK_IN); setState(552); expression(10); break; } case 5: { _localctx = _tracker.createInstance(parentContext, parentState); pushNewRecursionContext(_localctx, startState, RuleExpression); setState(553); if (!(precpred(_ctx, 8))) throw FailedPredicateException(this, "precpred(_ctx, 8)"); setState(554); antlrcpp::downCast(_localctx)->bop = _input->LT(1); _la = _input->LA(1); if (!(((((_la - 96) & ~ 0x3fULL) == 0) && ((1ULL << (_la - 96)) & 15) != 0))) { antlrcpp::downCast(_localctx)->bop = _errHandler->recoverInline(this); } else { _errHandler->reportMatch(this); consume(); } setState(555); expression(9); break; } case 6: { _localctx = _tracker.createInstance(parentContext, parentState); pushNewRecursionContext(_localctx, startState, RuleExpression); setState(556); if (!(precpred(_ctx, 7))) throw FailedPredicateException(this, "precpred(_ctx, 7)"); setState(557); antlrcpp::downCast(_localctx)->bop = match(EscriptParser::EQUAL_DEPRECATED); notifyErrorListeners("Deprecated '=' found: did you mean '==' or ':='?\n"); setState(559); expression(8); break; } case 7: { _localctx = _tracker.createInstance(parentContext, parentState); pushNewRecursionContext(_localctx, startState, RuleExpression); setState(560); if (!(precpred(_ctx, 6))) throw FailedPredicateException(this, "precpred(_ctx, 6)"); setState(561); antlrcpp::downCast(_localctx)->bop = _input->LT(1); _la = _input->LA(1); if (!(((((_la - 105) & ~ 0x3fULL) == 0) && ((1ULL << (_la - 105)) & 11) != 0))) { antlrcpp::downCast(_localctx)->bop = _errHandler->recoverInline(this); } else { _errHandler->reportMatch(this); consume(); } setState(562); expression(7); break; } case 8: { _localctx = _tracker.createInstance(parentContext, parentState); pushNewRecursionContext(_localctx, startState, RuleExpression); setState(563); if (!(precpred(_ctx, 5))) throw FailedPredicateException(this, "precpred(_ctx, 5)"); setState(564); antlrcpp::downCast(_localctx)->bop = _input->LT(1); _la = _input->LA(1); if (!(_la == EscriptParser::AND_A || _la == EscriptParser::AND_B)) { antlrcpp::downCast(_localctx)->bop = _errHandler->recoverInline(this); } else { _errHandler->reportMatch(this); consume(); } setState(565); expression(6); break; } case 9: { _localctx = _tracker.createInstance(parentContext, parentState); pushNewRecursionContext(_localctx, startState, RuleExpression); setState(566); if (!(precpred(_ctx, 4))) throw FailedPredicateException(this, "precpred(_ctx, 4)"); setState(567); antlrcpp::downCast(_localctx)->bop = _input->LT(1); _la = _input->LA(1); if (!(_la == EscriptParser::OR_A || _la == EscriptParser::OR_B)) { antlrcpp::downCast(_localctx)->bop = _errHandler->recoverInline(this); } else { _errHandler->reportMatch(this); consume(); } setState(568); expression(5); break; } case 10: { _localctx = _tracker.createInstance(parentContext, parentState); pushNewRecursionContext(_localctx, startState, RuleExpression); setState(569); if (!(precpred(_ctx, 3))) throw FailedPredicateException(this, "precpred(_ctx, 3)"); setState(570); match(EscriptParser::QUESTION); setState(571); expression(0); setState(572); match(EscriptParser::COLON); setState(573); expression(4); break; } case 11: { _localctx = _tracker.createInstance(parentContext, parentState); pushNewRecursionContext(_localctx, startState, RuleExpression); setState(575); if (!(precpred(_ctx, 2))) throw FailedPredicateException(this, "precpred(_ctx, 2)"); setState(576); antlrcpp::downCast(_localctx)->bop = _input->LT(1); _la = _input->LA(1); if (!(((((_la - 110) & ~ 0x3fULL) == 0) && ((1ULL << (_la - 110)) & 7) != 0))) { antlrcpp::downCast(_localctx)->bop = _errHandler->recoverInline(this); } else { _errHandler->reportMatch(this); consume(); } setState(577); expression(2); break; } case 12: { _localctx = _tracker.createInstance(parentContext, parentState); pushNewRecursionContext(_localctx, startState, RuleExpression); setState(578); if (!(precpred(_ctx, 1))) throw FailedPredicateException(this, "precpred(_ctx, 1)"); setState(579); antlrcpp::downCast(_localctx)->bop = _input->LT(1); _la = _input->LA(1); if (!(((((_la - 91) & ~ 0x3fULL) == 0) && ((1ULL << (_la - 91)) & 262175) != 0))) { antlrcpp::downCast(_localctx)->bop = _errHandler->recoverInline(this); } else { _errHandler->reportMatch(this); consume(); } setState(580); expression(1); break; } case 13: { _localctx = _tracker.createInstance(parentContext, parentState); pushNewRecursionContext(_localctx, startState, RuleExpression); setState(581); if (!(precpred(_ctx, 16))) throw FailedPredicateException(this, "precpred(_ctx, 16)"); setState(582); expressionSuffix(); break; } case 14: { _localctx = _tracker.createInstance(parentContext, parentState); pushNewRecursionContext(_localctx, startState, RuleExpression); setState(583); if (!(precpred(_ctx, 15))) throw FailedPredicateException(this, "precpred(_ctx, 15)"); setState(584); antlrcpp::downCast(_localctx)->postfix = _input->LT(1); _la = _input->LA(1); if (!(_la == EscriptParser::INC || _la == EscriptParser::DEC)) { antlrcpp::downCast(_localctx)->postfix = _errHandler->recoverInline(this); } else { _errHandler->reportMatch(this); consume(); } break; } default: break; } } setState(589); _errHandler->sync(this); alt = getInterpreter()->adaptivePredict(_input, 47, _ctx); } } catch (RecognitionException &e) { _errHandler->reportError(this, e); _localctx->exception = std::current_exception(); _errHandler->recover(this, _localctx->exception); } return _localctx; } //----------------- PrimaryContext ------------------------------------------------------------------ EscriptParser::PrimaryContext::PrimaryContext(ParserRuleContext *parent, size_t invokingState) : ParserRuleContext(parent, invokingState) { } EscriptParser::LiteralContext* EscriptParser::PrimaryContext::literal() { return getRuleContext(0); } EscriptParser::ParExpressionContext* EscriptParser::PrimaryContext::parExpression() { return getRuleContext(0); } EscriptParser::FunctionCallContext* EscriptParser::PrimaryContext::functionCall() { return getRuleContext(0); } EscriptParser::ScopedFunctionCallContext* EscriptParser::PrimaryContext::scopedFunctionCall() { return getRuleContext(0); } tree::TerminalNode* EscriptParser::PrimaryContext::IDENTIFIER() { return getToken(EscriptParser::IDENTIFIER, 0); } EscriptParser::FunctionReferenceContext* EscriptParser::PrimaryContext::functionReference() { return getRuleContext(0); } EscriptParser::FunctionExpressionContext* EscriptParser::PrimaryContext::functionExpression() { return getRuleContext(0); } EscriptParser::ExplicitArrayInitializerContext* EscriptParser::PrimaryContext::explicitArrayInitializer() { return getRuleContext(0); } EscriptParser::ExplicitStructInitializerContext* EscriptParser::PrimaryContext::explicitStructInitializer() { return getRuleContext(0); } EscriptParser::ExplicitDictInitializerContext* EscriptParser::PrimaryContext::explicitDictInitializer() { return getRuleContext(0); } EscriptParser::ExplicitErrorInitializerContext* EscriptParser::PrimaryContext::explicitErrorInitializer() { return getRuleContext(0); } EscriptParser::BareArrayInitializerContext* EscriptParser::PrimaryContext::bareArrayInitializer() { return getRuleContext(0); } EscriptParser::InterpolatedStringContext* EscriptParser::PrimaryContext::interpolatedString() { return getRuleContext(0); } size_t EscriptParser::PrimaryContext::getRuleIndex() const { return EscriptParser::RulePrimary; } void EscriptParser::PrimaryContext::enterRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->enterPrimary(this); } void EscriptParser::PrimaryContext::exitRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->exitPrimary(this); } std::any EscriptParser::PrimaryContext::accept(tree::ParseTreeVisitor *visitor) { if (auto parserVisitor = dynamic_cast(visitor)) return parserVisitor->visitPrimary(this); else return visitor->visitChildren(this); } EscriptParser::PrimaryContext* EscriptParser::primary() { PrimaryContext *_localctx = _tracker.createInstance(_ctx, getState()); enterRule(_localctx, 106, EscriptParser::RulePrimary); #if __cplusplus > 201703L auto onExit = finally([=, this] { #else auto onExit = finally([=] { #endif exitRule(); }); try { setState(603); _errHandler->sync(this); switch (getInterpreter()->adaptivePredict(_input, 48, _ctx)) { case 1: { enterOuterAlt(_localctx, 1); setState(590); literal(); break; } case 2: { enterOuterAlt(_localctx, 2); setState(591); parExpression(); break; } case 3: { enterOuterAlt(_localctx, 3); setState(592); functionCall(); break; } case 4: { enterOuterAlt(_localctx, 4); setState(593); scopedFunctionCall(); break; } case 5: { enterOuterAlt(_localctx, 5); setState(594); match(EscriptParser::IDENTIFIER); break; } case 6: { enterOuterAlt(_localctx, 6); setState(595); functionReference(); break; } case 7: { enterOuterAlt(_localctx, 7); setState(596); functionExpression(); break; } case 8: { enterOuterAlt(_localctx, 8); setState(597); explicitArrayInitializer(); break; } case 9: { enterOuterAlt(_localctx, 9); setState(598); explicitStructInitializer(); break; } case 10: { enterOuterAlt(_localctx, 10); setState(599); explicitDictInitializer(); break; } case 11: { enterOuterAlt(_localctx, 11); setState(600); explicitErrorInitializer(); break; } case 12: { enterOuterAlt(_localctx, 12); setState(601); bareArrayInitializer(); break; } case 13: { enterOuterAlt(_localctx, 13); setState(602); interpolatedString(); break; } default: break; } } catch (RecognitionException &e) { _errHandler->reportError(this, e); _localctx->exception = std::current_exception(); _errHandler->recover(this, _localctx->exception); } return _localctx; } //----------------- FunctionExpressionContext ------------------------------------------------------------------ EscriptParser::FunctionExpressionContext::FunctionExpressionContext(ParserRuleContext *parent, size_t invokingState) : ParserRuleContext(parent, invokingState) { } tree::TerminalNode* EscriptParser::FunctionExpressionContext::AT() { return getToken(EscriptParser::AT, 0); } tree::TerminalNode* EscriptParser::FunctionExpressionContext::LBRACE() { return getToken(EscriptParser::LBRACE, 0); } EscriptParser::BlockContext* EscriptParser::FunctionExpressionContext::block() { return getRuleContext(0); } tree::TerminalNode* EscriptParser::FunctionExpressionContext::RBRACE() { return getToken(EscriptParser::RBRACE, 0); } EscriptParser::FunctionParametersContext* EscriptParser::FunctionExpressionContext::functionParameters() { return getRuleContext(0); } size_t EscriptParser::FunctionExpressionContext::getRuleIndex() const { return EscriptParser::RuleFunctionExpression; } void EscriptParser::FunctionExpressionContext::enterRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->enterFunctionExpression(this); } void EscriptParser::FunctionExpressionContext::exitRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->exitFunctionExpression(this); } std::any EscriptParser::FunctionExpressionContext::accept(tree::ParseTreeVisitor *visitor) { if (auto parserVisitor = dynamic_cast(visitor)) return parserVisitor->visitFunctionExpression(this); else return visitor->visitChildren(this); } EscriptParser::FunctionExpressionContext* EscriptParser::functionExpression() { FunctionExpressionContext *_localctx = _tracker.createInstance(_ctx, getState()); enterRule(_localctx, 108, EscriptParser::RuleFunctionExpression); size_t _la = 0; #if __cplusplus > 201703L auto onExit = finally([=, this] { #else auto onExit = finally([=] { #endif exitRule(); }); try { enterOuterAlt(_localctx, 1); setState(605); match(EscriptParser::AT); setState(607); _errHandler->sync(this); _la = _input->LA(1); if (_la == EscriptParser::LPAREN) { setState(606); functionParameters(); } setState(609); match(EscriptParser::LBRACE); setState(610); block(); setState(611); match(EscriptParser::RBRACE); } catch (RecognitionException &e) { _errHandler->reportError(this, e); _localctx->exception = std::current_exception(); _errHandler->recover(this, _localctx->exception); } return _localctx; } //----------------- ExplicitArrayInitializerContext ------------------------------------------------------------------ EscriptParser::ExplicitArrayInitializerContext::ExplicitArrayInitializerContext(ParserRuleContext *parent, size_t invokingState) : ParserRuleContext(parent, invokingState) { } tree::TerminalNode* EscriptParser::ExplicitArrayInitializerContext::ARRAY() { return getToken(EscriptParser::ARRAY, 0); } EscriptParser::ArrayInitializerContext* EscriptParser::ExplicitArrayInitializerContext::arrayInitializer() { return getRuleContext(0); } size_t EscriptParser::ExplicitArrayInitializerContext::getRuleIndex() const { return EscriptParser::RuleExplicitArrayInitializer; } void EscriptParser::ExplicitArrayInitializerContext::enterRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->enterExplicitArrayInitializer(this); } void EscriptParser::ExplicitArrayInitializerContext::exitRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->exitExplicitArrayInitializer(this); } std::any EscriptParser::ExplicitArrayInitializerContext::accept(tree::ParseTreeVisitor *visitor) { if (auto parserVisitor = dynamic_cast(visitor)) return parserVisitor->visitExplicitArrayInitializer(this); else return visitor->visitChildren(this); } EscriptParser::ExplicitArrayInitializerContext* EscriptParser::explicitArrayInitializer() { ExplicitArrayInitializerContext *_localctx = _tracker.createInstance(_ctx, getState()); enterRule(_localctx, 110, EscriptParser::RuleExplicitArrayInitializer); #if __cplusplus > 201703L auto onExit = finally([=, this] { #else auto onExit = finally([=] { #endif exitRule(); }); try { enterOuterAlt(_localctx, 1); setState(613); match(EscriptParser::ARRAY); setState(615); _errHandler->sync(this); switch (getInterpreter()->adaptivePredict(_input, 50, _ctx)) { case 1: { setState(614); arrayInitializer(); break; } default: break; } } catch (RecognitionException &e) { _errHandler->reportError(this, e); _localctx->exception = std::current_exception(); _errHandler->recover(this, _localctx->exception); } return _localctx; } //----------------- ExplicitStructInitializerContext ------------------------------------------------------------------ EscriptParser::ExplicitStructInitializerContext::ExplicitStructInitializerContext(ParserRuleContext *parent, size_t invokingState) : ParserRuleContext(parent, invokingState) { } tree::TerminalNode* EscriptParser::ExplicitStructInitializerContext::STRUCT() { return getToken(EscriptParser::STRUCT, 0); } EscriptParser::StructInitializerContext* EscriptParser::ExplicitStructInitializerContext::structInitializer() { return getRuleContext(0); } size_t EscriptParser::ExplicitStructInitializerContext::getRuleIndex() const { return EscriptParser::RuleExplicitStructInitializer; } void EscriptParser::ExplicitStructInitializerContext::enterRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->enterExplicitStructInitializer(this); } void EscriptParser::ExplicitStructInitializerContext::exitRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->exitExplicitStructInitializer(this); } std::any EscriptParser::ExplicitStructInitializerContext::accept(tree::ParseTreeVisitor *visitor) { if (auto parserVisitor = dynamic_cast(visitor)) return parserVisitor->visitExplicitStructInitializer(this); else return visitor->visitChildren(this); } EscriptParser::ExplicitStructInitializerContext* EscriptParser::explicitStructInitializer() { ExplicitStructInitializerContext *_localctx = _tracker.createInstance(_ctx, getState()); enterRule(_localctx, 112, EscriptParser::RuleExplicitStructInitializer); #if __cplusplus > 201703L auto onExit = finally([=, this] { #else auto onExit = finally([=] { #endif exitRule(); }); try { enterOuterAlt(_localctx, 1); setState(617); match(EscriptParser::STRUCT); setState(619); _errHandler->sync(this); switch (getInterpreter()->adaptivePredict(_input, 51, _ctx)) { case 1: { setState(618); structInitializer(); break; } default: break; } } catch (RecognitionException &e) { _errHandler->reportError(this, e); _localctx->exception = std::current_exception(); _errHandler->recover(this, _localctx->exception); } return _localctx; } //----------------- ExplicitDictInitializerContext ------------------------------------------------------------------ EscriptParser::ExplicitDictInitializerContext::ExplicitDictInitializerContext(ParserRuleContext *parent, size_t invokingState) : ParserRuleContext(parent, invokingState) { } tree::TerminalNode* EscriptParser::ExplicitDictInitializerContext::DICTIONARY() { return getToken(EscriptParser::DICTIONARY, 0); } EscriptParser::DictInitializerContext* EscriptParser::ExplicitDictInitializerContext::dictInitializer() { return getRuleContext(0); } size_t EscriptParser::ExplicitDictInitializerContext::getRuleIndex() const { return EscriptParser::RuleExplicitDictInitializer; } void EscriptParser::ExplicitDictInitializerContext::enterRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->enterExplicitDictInitializer(this); } void EscriptParser::ExplicitDictInitializerContext::exitRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->exitExplicitDictInitializer(this); } std::any EscriptParser::ExplicitDictInitializerContext::accept(tree::ParseTreeVisitor *visitor) { if (auto parserVisitor = dynamic_cast(visitor)) return parserVisitor->visitExplicitDictInitializer(this); else return visitor->visitChildren(this); } EscriptParser::ExplicitDictInitializerContext* EscriptParser::explicitDictInitializer() { ExplicitDictInitializerContext *_localctx = _tracker.createInstance(_ctx, getState()); enterRule(_localctx, 114, EscriptParser::RuleExplicitDictInitializer); #if __cplusplus > 201703L auto onExit = finally([=, this] { #else auto onExit = finally([=] { #endif exitRule(); }); try { enterOuterAlt(_localctx, 1); setState(621); match(EscriptParser::DICTIONARY); setState(623); _errHandler->sync(this); switch (getInterpreter()->adaptivePredict(_input, 52, _ctx)) { case 1: { setState(622); dictInitializer(); break; } default: break; } } catch (RecognitionException &e) { _errHandler->reportError(this, e); _localctx->exception = std::current_exception(); _errHandler->recover(this, _localctx->exception); } return _localctx; } //----------------- ExplicitErrorInitializerContext ------------------------------------------------------------------ EscriptParser::ExplicitErrorInitializerContext::ExplicitErrorInitializerContext(ParserRuleContext *parent, size_t invokingState) : ParserRuleContext(parent, invokingState) { } tree::TerminalNode* EscriptParser::ExplicitErrorInitializerContext::TOK_ERROR() { return getToken(EscriptParser::TOK_ERROR, 0); } EscriptParser::StructInitializerContext* EscriptParser::ExplicitErrorInitializerContext::structInitializer() { return getRuleContext(0); } size_t EscriptParser::ExplicitErrorInitializerContext::getRuleIndex() const { return EscriptParser::RuleExplicitErrorInitializer; } void EscriptParser::ExplicitErrorInitializerContext::enterRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->enterExplicitErrorInitializer(this); } void EscriptParser::ExplicitErrorInitializerContext::exitRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->exitExplicitErrorInitializer(this); } std::any EscriptParser::ExplicitErrorInitializerContext::accept(tree::ParseTreeVisitor *visitor) { if (auto parserVisitor = dynamic_cast(visitor)) return parserVisitor->visitExplicitErrorInitializer(this); else return visitor->visitChildren(this); } EscriptParser::ExplicitErrorInitializerContext* EscriptParser::explicitErrorInitializer() { ExplicitErrorInitializerContext *_localctx = _tracker.createInstance(_ctx, getState()); enterRule(_localctx, 116, EscriptParser::RuleExplicitErrorInitializer); #if __cplusplus > 201703L auto onExit = finally([=, this] { #else auto onExit = finally([=] { #endif exitRule(); }); try { enterOuterAlt(_localctx, 1); setState(625); match(EscriptParser::TOK_ERROR); setState(627); _errHandler->sync(this); switch (getInterpreter()->adaptivePredict(_input, 53, _ctx)) { case 1: { setState(626); structInitializer(); break; } default: break; } } catch (RecognitionException &e) { _errHandler->reportError(this, e); _localctx->exception = std::current_exception(); _errHandler->recover(this, _localctx->exception); } return _localctx; } //----------------- BareArrayInitializerContext ------------------------------------------------------------------ EscriptParser::BareArrayInitializerContext::BareArrayInitializerContext(ParserRuleContext *parent, size_t invokingState) : ParserRuleContext(parent, invokingState) { } tree::TerminalNode* EscriptParser::BareArrayInitializerContext::LBRACE() { return getToken(EscriptParser::LBRACE, 0); } tree::TerminalNode* EscriptParser::BareArrayInitializerContext::RBRACE() { return getToken(EscriptParser::RBRACE, 0); } EscriptParser::ExpressionListContext* EscriptParser::BareArrayInitializerContext::expressionList() { return getRuleContext(0); } tree::TerminalNode* EscriptParser::BareArrayInitializerContext::COMMA() { return getToken(EscriptParser::COMMA, 0); } size_t EscriptParser::BareArrayInitializerContext::getRuleIndex() const { return EscriptParser::RuleBareArrayInitializer; } void EscriptParser::BareArrayInitializerContext::enterRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->enterBareArrayInitializer(this); } void EscriptParser::BareArrayInitializerContext::exitRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->exitBareArrayInitializer(this); } std::any EscriptParser::BareArrayInitializerContext::accept(tree::ParseTreeVisitor *visitor) { if (auto parserVisitor = dynamic_cast(visitor)) return parserVisitor->visitBareArrayInitializer(this); else return visitor->visitChildren(this); } EscriptParser::BareArrayInitializerContext* EscriptParser::bareArrayInitializer() { BareArrayInitializerContext *_localctx = _tracker.createInstance(_ctx, getState()); enterRule(_localctx, 118, EscriptParser::RuleBareArrayInitializer); size_t _la = 0; #if __cplusplus > 201703L auto onExit = finally([=, this] { #else auto onExit = finally([=] { #endif exitRule(); }); try { setState(641); _errHandler->sync(this); switch (getInterpreter()->adaptivePredict(_input, 56, _ctx)) { case 1: { enterOuterAlt(_localctx, 1); setState(629); match(EscriptParser::LBRACE); setState(631); _errHandler->sync(this); _la = _input->LA(1); if ((((_la & ~ 0x3fULL) == 0) && ((1ULL << _la) & -3242591731706757120) != 0) || ((((_la - 64) & ~ 0x3fULL) == 0) && ((1ULL << (_la - 64)) & 4726527809026293753) != 0)) { setState(630); expressionList(); } setState(633); match(EscriptParser::RBRACE); break; } case 2: { enterOuterAlt(_localctx, 2); setState(634); match(EscriptParser::LBRACE); setState(636); _errHandler->sync(this); _la = _input->LA(1); if ((((_la & ~ 0x3fULL) == 0) && ((1ULL << _la) & -3242591731706757120) != 0) || ((((_la - 64) & ~ 0x3fULL) == 0) && ((1ULL << (_la - 64)) & 4726527809026293753) != 0)) { setState(635); expressionList(); } setState(638); match(EscriptParser::COMMA); setState(639); match(EscriptParser::RBRACE); notifyErrorListeners("Expected expression following comma before right-brace in array initializer list"); break; } default: break; } } catch (RecognitionException &e) { _errHandler->reportError(this, e); _localctx->exception = std::current_exception(); _errHandler->recover(this, _localctx->exception); } return _localctx; } //----------------- ParExpressionContext ------------------------------------------------------------------ EscriptParser::ParExpressionContext::ParExpressionContext(ParserRuleContext *parent, size_t invokingState) : ParserRuleContext(parent, invokingState) { } tree::TerminalNode* EscriptParser::ParExpressionContext::LPAREN() { return getToken(EscriptParser::LPAREN, 0); } EscriptParser::ExpressionContext* EscriptParser::ParExpressionContext::expression() { return getRuleContext(0); } tree::TerminalNode* EscriptParser::ParExpressionContext::RPAREN() { return getToken(EscriptParser::RPAREN, 0); } size_t EscriptParser::ParExpressionContext::getRuleIndex() const { return EscriptParser::RuleParExpression; } void EscriptParser::ParExpressionContext::enterRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->enterParExpression(this); } void EscriptParser::ParExpressionContext::exitRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->exitParExpression(this); } std::any EscriptParser::ParExpressionContext::accept(tree::ParseTreeVisitor *visitor) { if (auto parserVisitor = dynamic_cast(visitor)) return parserVisitor->visitParExpression(this); else return visitor->visitChildren(this); } EscriptParser::ParExpressionContext* EscriptParser::parExpression() { ParExpressionContext *_localctx = _tracker.createInstance(_ctx, getState()); enterRule(_localctx, 120, EscriptParser::RuleParExpression); #if __cplusplus > 201703L auto onExit = finally([=, this] { #else auto onExit = finally([=] { #endif exitRule(); }); try { enterOuterAlt(_localctx, 1); setState(643); match(EscriptParser::LPAREN); setState(644); expression(0); setState(645); match(EscriptParser::RPAREN); } catch (RecognitionException &e) { _errHandler->reportError(this, e); _localctx->exception = std::current_exception(); _errHandler->recover(this, _localctx->exception); } return _localctx; } //----------------- ExpressionListContext ------------------------------------------------------------------ EscriptParser::ExpressionListContext::ExpressionListContext(ParserRuleContext *parent, size_t invokingState) : ParserRuleContext(parent, invokingState) { } std::vector EscriptParser::ExpressionListContext::expression() { return getRuleContexts(); } EscriptParser::ExpressionContext* EscriptParser::ExpressionListContext::expression(size_t i) { return getRuleContext(i); } std::vector EscriptParser::ExpressionListContext::COMMA() { return getTokens(EscriptParser::COMMA); } tree::TerminalNode* EscriptParser::ExpressionListContext::COMMA(size_t i) { return getToken(EscriptParser::COMMA, i); } size_t EscriptParser::ExpressionListContext::getRuleIndex() const { return EscriptParser::RuleExpressionList; } void EscriptParser::ExpressionListContext::enterRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->enterExpressionList(this); } void EscriptParser::ExpressionListContext::exitRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->exitExpressionList(this); } std::any EscriptParser::ExpressionListContext::accept(tree::ParseTreeVisitor *visitor) { if (auto parserVisitor = dynamic_cast(visitor)) return parserVisitor->visitExpressionList(this); else return visitor->visitChildren(this); } EscriptParser::ExpressionListContext* EscriptParser::expressionList() { ExpressionListContext *_localctx = _tracker.createInstance(_ctx, getState()); enterRule(_localctx, 122, EscriptParser::RuleExpressionList); #if __cplusplus > 201703L auto onExit = finally([=, this] { #else auto onExit = finally([=] { #endif exitRule(); }); try { size_t alt; enterOuterAlt(_localctx, 1); setState(647); expression(0); setState(652); _errHandler->sync(this); alt = getInterpreter()->adaptivePredict(_input, 57, _ctx); while (alt != 2 && alt != atn::ATN::INVALID_ALT_NUMBER) { if (alt == 1) { setState(648); match(EscriptParser::COMMA); setState(649); expression(0); } setState(654); _errHandler->sync(this); alt = getInterpreter()->adaptivePredict(_input, 57, _ctx); } } catch (RecognitionException &e) { _errHandler->reportError(this, e); _localctx->exception = std::current_exception(); _errHandler->recover(this, _localctx->exception); } return _localctx; } //----------------- ExpressionSuffixContext ------------------------------------------------------------------ EscriptParser::ExpressionSuffixContext::ExpressionSuffixContext(ParserRuleContext *parent, size_t invokingState) : ParserRuleContext(parent, invokingState) { } EscriptParser::IndexingSuffixContext* EscriptParser::ExpressionSuffixContext::indexingSuffix() { return getRuleContext(0); } EscriptParser::MethodCallSuffixContext* EscriptParser::ExpressionSuffixContext::methodCallSuffix() { return getRuleContext(0); } EscriptParser::NavigationSuffixContext* EscriptParser::ExpressionSuffixContext::navigationSuffix() { return getRuleContext(0); } EscriptParser::FunctionCallSuffixContext* EscriptParser::ExpressionSuffixContext::functionCallSuffix() { return getRuleContext(0); } size_t EscriptParser::ExpressionSuffixContext::getRuleIndex() const { return EscriptParser::RuleExpressionSuffix; } void EscriptParser::ExpressionSuffixContext::enterRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->enterExpressionSuffix(this); } void EscriptParser::ExpressionSuffixContext::exitRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->exitExpressionSuffix(this); } std::any EscriptParser::ExpressionSuffixContext::accept(tree::ParseTreeVisitor *visitor) { if (auto parserVisitor = dynamic_cast(visitor)) return parserVisitor->visitExpressionSuffix(this); else return visitor->visitChildren(this); } EscriptParser::ExpressionSuffixContext* EscriptParser::expressionSuffix() { ExpressionSuffixContext *_localctx = _tracker.createInstance(_ctx, getState()); enterRule(_localctx, 124, EscriptParser::RuleExpressionSuffix); #if __cplusplus > 201703L auto onExit = finally([=, this] { #else auto onExit = finally([=] { #endif exitRule(); }); try { setState(659); _errHandler->sync(this); switch (getInterpreter()->adaptivePredict(_input, 58, _ctx)) { case 1: { enterOuterAlt(_localctx, 1); setState(655); indexingSuffix(); break; } case 2: { enterOuterAlt(_localctx, 2); setState(656); methodCallSuffix(); break; } case 3: { enterOuterAlt(_localctx, 3); setState(657); navigationSuffix(); break; } case 4: { enterOuterAlt(_localctx, 4); setState(658); functionCallSuffix(); break; } default: break; } } catch (RecognitionException &e) { _errHandler->reportError(this, e); _localctx->exception = std::current_exception(); _errHandler->recover(this, _localctx->exception); } return _localctx; } //----------------- IndexingSuffixContext ------------------------------------------------------------------ EscriptParser::IndexingSuffixContext::IndexingSuffixContext(ParserRuleContext *parent, size_t invokingState) : ParserRuleContext(parent, invokingState) { } tree::TerminalNode* EscriptParser::IndexingSuffixContext::LBRACK() { return getToken(EscriptParser::LBRACK, 0); } EscriptParser::ExpressionListContext* EscriptParser::IndexingSuffixContext::expressionList() { return getRuleContext(0); } tree::TerminalNode* EscriptParser::IndexingSuffixContext::RBRACK() { return getToken(EscriptParser::RBRACK, 0); } size_t EscriptParser::IndexingSuffixContext::getRuleIndex() const { return EscriptParser::RuleIndexingSuffix; } void EscriptParser::IndexingSuffixContext::enterRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->enterIndexingSuffix(this); } void EscriptParser::IndexingSuffixContext::exitRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->exitIndexingSuffix(this); } std::any EscriptParser::IndexingSuffixContext::accept(tree::ParseTreeVisitor *visitor) { if (auto parserVisitor = dynamic_cast(visitor)) return parserVisitor->visitIndexingSuffix(this); else return visitor->visitChildren(this); } EscriptParser::IndexingSuffixContext* EscriptParser::indexingSuffix() { IndexingSuffixContext *_localctx = _tracker.createInstance(_ctx, getState()); enterRule(_localctx, 126, EscriptParser::RuleIndexingSuffix); #if __cplusplus > 201703L auto onExit = finally([=, this] { #else auto onExit = finally([=] { #endif exitRule(); }); try { enterOuterAlt(_localctx, 1); setState(661); match(EscriptParser::LBRACK); setState(662); expressionList(); setState(663); match(EscriptParser::RBRACK); } catch (RecognitionException &e) { _errHandler->reportError(this, e); _localctx->exception = std::current_exception(); _errHandler->recover(this, _localctx->exception); } return _localctx; } //----------------- NavigationSuffixContext ------------------------------------------------------------------ EscriptParser::NavigationSuffixContext::NavigationSuffixContext(ParserRuleContext *parent, size_t invokingState) : ParserRuleContext(parent, invokingState) { } tree::TerminalNode* EscriptParser::NavigationSuffixContext::DOT() { return getToken(EscriptParser::DOT, 0); } tree::TerminalNode* EscriptParser::NavigationSuffixContext::IDENTIFIER() { return getToken(EscriptParser::IDENTIFIER, 0); } tree::TerminalNode* EscriptParser::NavigationSuffixContext::STRING_LITERAL() { return getToken(EscriptParser::STRING_LITERAL, 0); } size_t EscriptParser::NavigationSuffixContext::getRuleIndex() const { return EscriptParser::RuleNavigationSuffix; } void EscriptParser::NavigationSuffixContext::enterRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->enterNavigationSuffix(this); } void EscriptParser::NavigationSuffixContext::exitRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->exitNavigationSuffix(this); } std::any EscriptParser::NavigationSuffixContext::accept(tree::ParseTreeVisitor *visitor) { if (auto parserVisitor = dynamic_cast(visitor)) return parserVisitor->visitNavigationSuffix(this); else return visitor->visitChildren(this); } EscriptParser::NavigationSuffixContext* EscriptParser::navigationSuffix() { NavigationSuffixContext *_localctx = _tracker.createInstance(_ctx, getState()); enterRule(_localctx, 128, EscriptParser::RuleNavigationSuffix); size_t _la = 0; #if __cplusplus > 201703L auto onExit = finally([=, this] { #else auto onExit = finally([=] { #endif exitRule(); }); try { enterOuterAlt(_localctx, 1); setState(665); match(EscriptParser::DOT); setState(666); _la = _input->LA(1); if (!(_la == EscriptParser::STRING_LITERAL || _la == EscriptParser::IDENTIFIER)) { _errHandler->recoverInline(this); } else { _errHandler->reportMatch(this); consume(); } } catch (RecognitionException &e) { _errHandler->reportError(this, e); _localctx->exception = std::current_exception(); _errHandler->recover(this, _localctx->exception); } return _localctx; } //----------------- MethodCallSuffixContext ------------------------------------------------------------------ EscriptParser::MethodCallSuffixContext::MethodCallSuffixContext(ParserRuleContext *parent, size_t invokingState) : ParserRuleContext(parent, invokingState) { } tree::TerminalNode* EscriptParser::MethodCallSuffixContext::DOT() { return getToken(EscriptParser::DOT, 0); } tree::TerminalNode* EscriptParser::MethodCallSuffixContext::IDENTIFIER() { return getToken(EscriptParser::IDENTIFIER, 0); } tree::TerminalNode* EscriptParser::MethodCallSuffixContext::LPAREN() { return getToken(EscriptParser::LPAREN, 0); } tree::TerminalNode* EscriptParser::MethodCallSuffixContext::RPAREN() { return getToken(EscriptParser::RPAREN, 0); } EscriptParser::ExpressionListContext* EscriptParser::MethodCallSuffixContext::expressionList() { return getRuleContext(0); } size_t EscriptParser::MethodCallSuffixContext::getRuleIndex() const { return EscriptParser::RuleMethodCallSuffix; } void EscriptParser::MethodCallSuffixContext::enterRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->enterMethodCallSuffix(this); } void EscriptParser::MethodCallSuffixContext::exitRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->exitMethodCallSuffix(this); } std::any EscriptParser::MethodCallSuffixContext::accept(tree::ParseTreeVisitor *visitor) { if (auto parserVisitor = dynamic_cast(visitor)) return parserVisitor->visitMethodCallSuffix(this); else return visitor->visitChildren(this); } EscriptParser::MethodCallSuffixContext* EscriptParser::methodCallSuffix() { MethodCallSuffixContext *_localctx = _tracker.createInstance(_ctx, getState()); enterRule(_localctx, 130, EscriptParser::RuleMethodCallSuffix); size_t _la = 0; #if __cplusplus > 201703L auto onExit = finally([=, this] { #else auto onExit = finally([=] { #endif exitRule(); }); try { enterOuterAlt(_localctx, 1); setState(668); match(EscriptParser::DOT); setState(669); match(EscriptParser::IDENTIFIER); setState(670); match(EscriptParser::LPAREN); setState(672); _errHandler->sync(this); _la = _input->LA(1); if ((((_la & ~ 0x3fULL) == 0) && ((1ULL << _la) & -3242591731706757120) != 0) || ((((_la - 64) & ~ 0x3fULL) == 0) && ((1ULL << (_la - 64)) & 4726527809026293753) != 0)) { setState(671); expressionList(); } setState(674); match(EscriptParser::RPAREN); } catch (RecognitionException &e) { _errHandler->reportError(this, e); _localctx->exception = std::current_exception(); _errHandler->recover(this, _localctx->exception); } return _localctx; } //----------------- FunctionCallSuffixContext ------------------------------------------------------------------ EscriptParser::FunctionCallSuffixContext::FunctionCallSuffixContext(ParserRuleContext *parent, size_t invokingState) : ParserRuleContext(parent, invokingState) { } tree::TerminalNode* EscriptParser::FunctionCallSuffixContext::LPAREN() { return getToken(EscriptParser::LPAREN, 0); } tree::TerminalNode* EscriptParser::FunctionCallSuffixContext::RPAREN() { return getToken(EscriptParser::RPAREN, 0); } EscriptParser::ExpressionListContext* EscriptParser::FunctionCallSuffixContext::expressionList() { return getRuleContext(0); } size_t EscriptParser::FunctionCallSuffixContext::getRuleIndex() const { return EscriptParser::RuleFunctionCallSuffix; } void EscriptParser::FunctionCallSuffixContext::enterRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->enterFunctionCallSuffix(this); } void EscriptParser::FunctionCallSuffixContext::exitRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->exitFunctionCallSuffix(this); } std::any EscriptParser::FunctionCallSuffixContext::accept(tree::ParseTreeVisitor *visitor) { if (auto parserVisitor = dynamic_cast(visitor)) return parserVisitor->visitFunctionCallSuffix(this); else return visitor->visitChildren(this); } EscriptParser::FunctionCallSuffixContext* EscriptParser::functionCallSuffix() { FunctionCallSuffixContext *_localctx = _tracker.createInstance(_ctx, getState()); enterRule(_localctx, 132, EscriptParser::RuleFunctionCallSuffix); size_t _la = 0; #if __cplusplus > 201703L auto onExit = finally([=, this] { #else auto onExit = finally([=] { #endif exitRule(); }); try { enterOuterAlt(_localctx, 1); setState(676); match(EscriptParser::LPAREN); setState(678); _errHandler->sync(this); _la = _input->LA(1); if ((((_la & ~ 0x3fULL) == 0) && ((1ULL << _la) & -3242591731706757120) != 0) || ((((_la - 64) & ~ 0x3fULL) == 0) && ((1ULL << (_la - 64)) & 4726527809026293753) != 0)) { setState(677); expressionList(); } setState(680); match(EscriptParser::RPAREN); } catch (RecognitionException &e) { _errHandler->reportError(this, e); _localctx->exception = std::current_exception(); _errHandler->recover(this, _localctx->exception); } return _localctx; } //----------------- FunctionCallContext ------------------------------------------------------------------ EscriptParser::FunctionCallContext::FunctionCallContext(ParserRuleContext *parent, size_t invokingState) : ParserRuleContext(parent, invokingState) { } tree::TerminalNode* EscriptParser::FunctionCallContext::IDENTIFIER() { return getToken(EscriptParser::IDENTIFIER, 0); } tree::TerminalNode* EscriptParser::FunctionCallContext::LPAREN() { return getToken(EscriptParser::LPAREN, 0); } tree::TerminalNode* EscriptParser::FunctionCallContext::RPAREN() { return getToken(EscriptParser::RPAREN, 0); } EscriptParser::ExpressionListContext* EscriptParser::FunctionCallContext::expressionList() { return getRuleContext(0); } size_t EscriptParser::FunctionCallContext::getRuleIndex() const { return EscriptParser::RuleFunctionCall; } void EscriptParser::FunctionCallContext::enterRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->enterFunctionCall(this); } void EscriptParser::FunctionCallContext::exitRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->exitFunctionCall(this); } std::any EscriptParser::FunctionCallContext::accept(tree::ParseTreeVisitor *visitor) { if (auto parserVisitor = dynamic_cast(visitor)) return parserVisitor->visitFunctionCall(this); else return visitor->visitChildren(this); } EscriptParser::FunctionCallContext* EscriptParser::functionCall() { FunctionCallContext *_localctx = _tracker.createInstance(_ctx, getState()); enterRule(_localctx, 134, EscriptParser::RuleFunctionCall); size_t _la = 0; #if __cplusplus > 201703L auto onExit = finally([=, this] { #else auto onExit = finally([=] { #endif exitRule(); }); try { enterOuterAlt(_localctx, 1); setState(682); match(EscriptParser::IDENTIFIER); setState(683); match(EscriptParser::LPAREN); setState(685); _errHandler->sync(this); _la = _input->LA(1); if ((((_la & ~ 0x3fULL) == 0) && ((1ULL << _la) & -3242591731706757120) != 0) || ((((_la - 64) & ~ 0x3fULL) == 0) && ((1ULL << (_la - 64)) & 4726527809026293753) != 0)) { setState(684); expressionList(); } setState(687); match(EscriptParser::RPAREN); } catch (RecognitionException &e) { _errHandler->reportError(this, e); _localctx->exception = std::current_exception(); _errHandler->recover(this, _localctx->exception); } return _localctx; } //----------------- StructInitializerExpressionContext ------------------------------------------------------------------ EscriptParser::StructInitializerExpressionContext::StructInitializerExpressionContext(ParserRuleContext *parent, size_t invokingState) : ParserRuleContext(parent, invokingState) { } tree::TerminalNode* EscriptParser::StructInitializerExpressionContext::IDENTIFIER() { return getToken(EscriptParser::IDENTIFIER, 0); } tree::TerminalNode* EscriptParser::StructInitializerExpressionContext::ASSIGN() { return getToken(EscriptParser::ASSIGN, 0); } EscriptParser::ExpressionContext* EscriptParser::StructInitializerExpressionContext::expression() { return getRuleContext(0); } tree::TerminalNode* EscriptParser::StructInitializerExpressionContext::STRING_LITERAL() { return getToken(EscriptParser::STRING_LITERAL, 0); } size_t EscriptParser::StructInitializerExpressionContext::getRuleIndex() const { return EscriptParser::RuleStructInitializerExpression; } void EscriptParser::StructInitializerExpressionContext::enterRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->enterStructInitializerExpression(this); } void EscriptParser::StructInitializerExpressionContext::exitRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->exitStructInitializerExpression(this); } std::any EscriptParser::StructInitializerExpressionContext::accept(tree::ParseTreeVisitor *visitor) { if (auto parserVisitor = dynamic_cast(visitor)) return parserVisitor->visitStructInitializerExpression(this); else return visitor->visitChildren(this); } EscriptParser::StructInitializerExpressionContext* EscriptParser::structInitializerExpression() { StructInitializerExpressionContext *_localctx = _tracker.createInstance(_ctx, getState()); enterRule(_localctx, 136, EscriptParser::RuleStructInitializerExpression); size_t _la = 0; #if __cplusplus > 201703L auto onExit = finally([=, this] { #else auto onExit = finally([=] { #endif exitRule(); }); try { setState(699); _errHandler->sync(this); switch (_input->LA(1)) { case EscriptParser::IDENTIFIER: { enterOuterAlt(_localctx, 1); setState(689); match(EscriptParser::IDENTIFIER); setState(692); _errHandler->sync(this); _la = _input->LA(1); if (_la == EscriptParser::ASSIGN) { setState(690); match(EscriptParser::ASSIGN); setState(691); expression(0); } break; } case EscriptParser::STRING_LITERAL: { enterOuterAlt(_localctx, 2); setState(694); match(EscriptParser::STRING_LITERAL); setState(697); _errHandler->sync(this); _la = _input->LA(1); if (_la == EscriptParser::ASSIGN) { setState(695); match(EscriptParser::ASSIGN); setState(696); expression(0); } break; } default: throw NoViableAltException(this); } } catch (RecognitionException &e) { _errHandler->reportError(this, e); _localctx->exception = std::current_exception(); _errHandler->recover(this, _localctx->exception); } return _localctx; } //----------------- StructInitializerExpressionListContext ------------------------------------------------------------------ EscriptParser::StructInitializerExpressionListContext::StructInitializerExpressionListContext(ParserRuleContext *parent, size_t invokingState) : ParserRuleContext(parent, invokingState) { } std::vector EscriptParser::StructInitializerExpressionListContext::structInitializerExpression() { return getRuleContexts(); } EscriptParser::StructInitializerExpressionContext* EscriptParser::StructInitializerExpressionListContext::structInitializerExpression(size_t i) { return getRuleContext(i); } std::vector EscriptParser::StructInitializerExpressionListContext::COMMA() { return getTokens(EscriptParser::COMMA); } tree::TerminalNode* EscriptParser::StructInitializerExpressionListContext::COMMA(size_t i) { return getToken(EscriptParser::COMMA, i); } size_t EscriptParser::StructInitializerExpressionListContext::getRuleIndex() const { return EscriptParser::RuleStructInitializerExpressionList; } void EscriptParser::StructInitializerExpressionListContext::enterRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->enterStructInitializerExpressionList(this); } void EscriptParser::StructInitializerExpressionListContext::exitRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->exitStructInitializerExpressionList(this); } std::any EscriptParser::StructInitializerExpressionListContext::accept(tree::ParseTreeVisitor *visitor) { if (auto parserVisitor = dynamic_cast(visitor)) return parserVisitor->visitStructInitializerExpressionList(this); else return visitor->visitChildren(this); } EscriptParser::StructInitializerExpressionListContext* EscriptParser::structInitializerExpressionList() { StructInitializerExpressionListContext *_localctx = _tracker.createInstance(_ctx, getState()); enterRule(_localctx, 138, EscriptParser::RuleStructInitializerExpressionList); #if __cplusplus > 201703L auto onExit = finally([=, this] { #else auto onExit = finally([=] { #endif exitRule(); }); try { size_t alt; enterOuterAlt(_localctx, 1); setState(701); structInitializerExpression(); setState(706); _errHandler->sync(this); alt = getInterpreter()->adaptivePredict(_input, 65, _ctx); while (alt != 2 && alt != atn::ATN::INVALID_ALT_NUMBER) { if (alt == 1) { setState(702); match(EscriptParser::COMMA); setState(703); structInitializerExpression(); } setState(708); _errHandler->sync(this); alt = getInterpreter()->adaptivePredict(_input, 65, _ctx); } } catch (RecognitionException &e) { _errHandler->reportError(this, e); _localctx->exception = std::current_exception(); _errHandler->recover(this, _localctx->exception); } return _localctx; } //----------------- StructInitializerContext ------------------------------------------------------------------ EscriptParser::StructInitializerContext::StructInitializerContext(ParserRuleContext *parent, size_t invokingState) : ParserRuleContext(parent, invokingState) { } tree::TerminalNode* EscriptParser::StructInitializerContext::LBRACE() { return getToken(EscriptParser::LBRACE, 0); } tree::TerminalNode* EscriptParser::StructInitializerContext::RBRACE() { return getToken(EscriptParser::RBRACE, 0); } EscriptParser::StructInitializerExpressionListContext* EscriptParser::StructInitializerContext::structInitializerExpressionList() { return getRuleContext(0); } tree::TerminalNode* EscriptParser::StructInitializerContext::COMMA() { return getToken(EscriptParser::COMMA, 0); } size_t EscriptParser::StructInitializerContext::getRuleIndex() const { return EscriptParser::RuleStructInitializer; } void EscriptParser::StructInitializerContext::enterRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->enterStructInitializer(this); } void EscriptParser::StructInitializerContext::exitRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->exitStructInitializer(this); } std::any EscriptParser::StructInitializerContext::accept(tree::ParseTreeVisitor *visitor) { if (auto parserVisitor = dynamic_cast(visitor)) return parserVisitor->visitStructInitializer(this); else return visitor->visitChildren(this); } EscriptParser::StructInitializerContext* EscriptParser::structInitializer() { StructInitializerContext *_localctx = _tracker.createInstance(_ctx, getState()); enterRule(_localctx, 140, EscriptParser::RuleStructInitializer); size_t _la = 0; #if __cplusplus > 201703L auto onExit = finally([=, this] { #else auto onExit = finally([=] { #endif exitRule(); }); try { setState(721); _errHandler->sync(this); switch (getInterpreter()->adaptivePredict(_input, 68, _ctx)) { case 1: { enterOuterAlt(_localctx, 1); setState(709); match(EscriptParser::LBRACE); setState(711); _errHandler->sync(this); _la = _input->LA(1); if (_la == EscriptParser::STRING_LITERAL || _la == EscriptParser::IDENTIFIER) { setState(710); structInitializerExpressionList(); } setState(713); match(EscriptParser::RBRACE); break; } case 2: { enterOuterAlt(_localctx, 2); setState(714); match(EscriptParser::LBRACE); setState(716); _errHandler->sync(this); _la = _input->LA(1); if (_la == EscriptParser::STRING_LITERAL || _la == EscriptParser::IDENTIFIER) { setState(715); structInitializerExpressionList(); } setState(718); match(EscriptParser::COMMA); setState(719); match(EscriptParser::RBRACE); notifyErrorListeners("Expected expression following comma before right-brace in struct initializer list"); break; } default: break; } } catch (RecognitionException &e) { _errHandler->reportError(this, e); _localctx->exception = std::current_exception(); _errHandler->recover(this, _localctx->exception); } return _localctx; } //----------------- DictInitializerExpressionContext ------------------------------------------------------------------ EscriptParser::DictInitializerExpressionContext::DictInitializerExpressionContext(ParserRuleContext *parent, size_t invokingState) : ParserRuleContext(parent, invokingState) { } std::vector EscriptParser::DictInitializerExpressionContext::expression() { return getRuleContexts(); } EscriptParser::ExpressionContext* EscriptParser::DictInitializerExpressionContext::expression(size_t i) { return getRuleContext(i); } tree::TerminalNode* EscriptParser::DictInitializerExpressionContext::ARROW() { return getToken(EscriptParser::ARROW, 0); } size_t EscriptParser::DictInitializerExpressionContext::getRuleIndex() const { return EscriptParser::RuleDictInitializerExpression; } void EscriptParser::DictInitializerExpressionContext::enterRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->enterDictInitializerExpression(this); } void EscriptParser::DictInitializerExpressionContext::exitRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->exitDictInitializerExpression(this); } std::any EscriptParser::DictInitializerExpressionContext::accept(tree::ParseTreeVisitor *visitor) { if (auto parserVisitor = dynamic_cast(visitor)) return parserVisitor->visitDictInitializerExpression(this); else return visitor->visitChildren(this); } EscriptParser::DictInitializerExpressionContext* EscriptParser::dictInitializerExpression() { DictInitializerExpressionContext *_localctx = _tracker.createInstance(_ctx, getState()); enterRule(_localctx, 142, EscriptParser::RuleDictInitializerExpression); size_t _la = 0; #if __cplusplus > 201703L auto onExit = finally([=, this] { #else auto onExit = finally([=] { #endif exitRule(); }); try { enterOuterAlt(_localctx, 1); setState(723); expression(0); setState(726); _errHandler->sync(this); _la = _input->LA(1); if (_la == EscriptParser::ARROW) { setState(724); match(EscriptParser::ARROW); setState(725); expression(0); } } catch (RecognitionException &e) { _errHandler->reportError(this, e); _localctx->exception = std::current_exception(); _errHandler->recover(this, _localctx->exception); } return _localctx; } //----------------- DictInitializerExpressionListContext ------------------------------------------------------------------ EscriptParser::DictInitializerExpressionListContext::DictInitializerExpressionListContext(ParserRuleContext *parent, size_t invokingState) : ParserRuleContext(parent, invokingState) { } std::vector EscriptParser::DictInitializerExpressionListContext::dictInitializerExpression() { return getRuleContexts(); } EscriptParser::DictInitializerExpressionContext* EscriptParser::DictInitializerExpressionListContext::dictInitializerExpression(size_t i) { return getRuleContext(i); } std::vector EscriptParser::DictInitializerExpressionListContext::COMMA() { return getTokens(EscriptParser::COMMA); } tree::TerminalNode* EscriptParser::DictInitializerExpressionListContext::COMMA(size_t i) { return getToken(EscriptParser::COMMA, i); } size_t EscriptParser::DictInitializerExpressionListContext::getRuleIndex() const { return EscriptParser::RuleDictInitializerExpressionList; } void EscriptParser::DictInitializerExpressionListContext::enterRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->enterDictInitializerExpressionList(this); } void EscriptParser::DictInitializerExpressionListContext::exitRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->exitDictInitializerExpressionList(this); } std::any EscriptParser::DictInitializerExpressionListContext::accept(tree::ParseTreeVisitor *visitor) { if (auto parserVisitor = dynamic_cast(visitor)) return parserVisitor->visitDictInitializerExpressionList(this); else return visitor->visitChildren(this); } EscriptParser::DictInitializerExpressionListContext* EscriptParser::dictInitializerExpressionList() { DictInitializerExpressionListContext *_localctx = _tracker.createInstance(_ctx, getState()); enterRule(_localctx, 144, EscriptParser::RuleDictInitializerExpressionList); #if __cplusplus > 201703L auto onExit = finally([=, this] { #else auto onExit = finally([=] { #endif exitRule(); }); try { size_t alt; enterOuterAlt(_localctx, 1); setState(728); dictInitializerExpression(); setState(733); _errHandler->sync(this); alt = getInterpreter()->adaptivePredict(_input, 70, _ctx); while (alt != 2 && alt != atn::ATN::INVALID_ALT_NUMBER) { if (alt == 1) { setState(729); match(EscriptParser::COMMA); setState(730); dictInitializerExpression(); } setState(735); _errHandler->sync(this); alt = getInterpreter()->adaptivePredict(_input, 70, _ctx); } } catch (RecognitionException &e) { _errHandler->reportError(this, e); _localctx->exception = std::current_exception(); _errHandler->recover(this, _localctx->exception); } return _localctx; } //----------------- DictInitializerContext ------------------------------------------------------------------ EscriptParser::DictInitializerContext::DictInitializerContext(ParserRuleContext *parent, size_t invokingState) : ParserRuleContext(parent, invokingState) { } tree::TerminalNode* EscriptParser::DictInitializerContext::LBRACE() { return getToken(EscriptParser::LBRACE, 0); } tree::TerminalNode* EscriptParser::DictInitializerContext::RBRACE() { return getToken(EscriptParser::RBRACE, 0); } EscriptParser::DictInitializerExpressionListContext* EscriptParser::DictInitializerContext::dictInitializerExpressionList() { return getRuleContext(0); } tree::TerminalNode* EscriptParser::DictInitializerContext::COMMA() { return getToken(EscriptParser::COMMA, 0); } size_t EscriptParser::DictInitializerContext::getRuleIndex() const { return EscriptParser::RuleDictInitializer; } void EscriptParser::DictInitializerContext::enterRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->enterDictInitializer(this); } void EscriptParser::DictInitializerContext::exitRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->exitDictInitializer(this); } std::any EscriptParser::DictInitializerContext::accept(tree::ParseTreeVisitor *visitor) { if (auto parserVisitor = dynamic_cast(visitor)) return parserVisitor->visitDictInitializer(this); else return visitor->visitChildren(this); } EscriptParser::DictInitializerContext* EscriptParser::dictInitializer() { DictInitializerContext *_localctx = _tracker.createInstance(_ctx, getState()); enterRule(_localctx, 146, EscriptParser::RuleDictInitializer); size_t _la = 0; #if __cplusplus > 201703L auto onExit = finally([=, this] { #else auto onExit = finally([=] { #endif exitRule(); }); try { setState(748); _errHandler->sync(this); switch (getInterpreter()->adaptivePredict(_input, 73, _ctx)) { case 1: { enterOuterAlt(_localctx, 1); setState(736); match(EscriptParser::LBRACE); setState(738); _errHandler->sync(this); _la = _input->LA(1); if ((((_la & ~ 0x3fULL) == 0) && ((1ULL << _la) & -3242591731706757120) != 0) || ((((_la - 64) & ~ 0x3fULL) == 0) && ((1ULL << (_la - 64)) & 4726527809026293753) != 0)) { setState(737); dictInitializerExpressionList(); } setState(740); match(EscriptParser::RBRACE); break; } case 2: { enterOuterAlt(_localctx, 2); setState(741); match(EscriptParser::LBRACE); setState(743); _errHandler->sync(this); _la = _input->LA(1); if ((((_la & ~ 0x3fULL) == 0) && ((1ULL << _la) & -3242591731706757120) != 0) || ((((_la - 64) & ~ 0x3fULL) == 0) && ((1ULL << (_la - 64)) & 4726527809026293753) != 0)) { setState(742); dictInitializerExpressionList(); } setState(745); match(EscriptParser::COMMA); setState(746); match(EscriptParser::RBRACE); notifyErrorListeners("Expected expression following comma before right-brace in dictionary initializer list"); break; } default: break; } } catch (RecognitionException &e) { _errHandler->reportError(this, e); _localctx->exception = std::current_exception(); _errHandler->recover(this, _localctx->exception); } return _localctx; } //----------------- ArrayInitializerContext ------------------------------------------------------------------ EscriptParser::ArrayInitializerContext::ArrayInitializerContext(ParserRuleContext *parent, size_t invokingState) : ParserRuleContext(parent, invokingState) { } tree::TerminalNode* EscriptParser::ArrayInitializerContext::LBRACE() { return getToken(EscriptParser::LBRACE, 0); } tree::TerminalNode* EscriptParser::ArrayInitializerContext::RBRACE() { return getToken(EscriptParser::RBRACE, 0); } EscriptParser::ExpressionListContext* EscriptParser::ArrayInitializerContext::expressionList() { return getRuleContext(0); } tree::TerminalNode* EscriptParser::ArrayInitializerContext::COMMA() { return getToken(EscriptParser::COMMA, 0); } tree::TerminalNode* EscriptParser::ArrayInitializerContext::LPAREN() { return getToken(EscriptParser::LPAREN, 0); } tree::TerminalNode* EscriptParser::ArrayInitializerContext::RPAREN() { return getToken(EscriptParser::RPAREN, 0); } size_t EscriptParser::ArrayInitializerContext::getRuleIndex() const { return EscriptParser::RuleArrayInitializer; } void EscriptParser::ArrayInitializerContext::enterRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->enterArrayInitializer(this); } void EscriptParser::ArrayInitializerContext::exitRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->exitArrayInitializer(this); } std::any EscriptParser::ArrayInitializerContext::accept(tree::ParseTreeVisitor *visitor) { if (auto parserVisitor = dynamic_cast(visitor)) return parserVisitor->visitArrayInitializer(this); else return visitor->visitChildren(this); } EscriptParser::ArrayInitializerContext* EscriptParser::arrayInitializer() { ArrayInitializerContext *_localctx = _tracker.createInstance(_ctx, getState()); enterRule(_localctx, 148, EscriptParser::RuleArrayInitializer); size_t _la = 0; #if __cplusplus > 201703L auto onExit = finally([=, this] { #else auto onExit = finally([=] { #endif exitRule(); }); try { setState(774); _errHandler->sync(this); switch (getInterpreter()->adaptivePredict(_input, 78, _ctx)) { case 1: { enterOuterAlt(_localctx, 1); setState(750); match(EscriptParser::LBRACE); setState(752); _errHandler->sync(this); _la = _input->LA(1); if ((((_la & ~ 0x3fULL) == 0) && ((1ULL << _la) & -3242591731706757120) != 0) || ((((_la - 64) & ~ 0x3fULL) == 0) && ((1ULL << (_la - 64)) & 4726527809026293753) != 0)) { setState(751); expressionList(); } setState(754); match(EscriptParser::RBRACE); break; } case 2: { enterOuterAlt(_localctx, 2); setState(755); match(EscriptParser::LBRACE); setState(757); _errHandler->sync(this); _la = _input->LA(1); if ((((_la & ~ 0x3fULL) == 0) && ((1ULL << _la) & -3242591731706757120) != 0) || ((((_la - 64) & ~ 0x3fULL) == 0) && ((1ULL << (_la - 64)) & 4726527809026293753) != 0)) { setState(756); expressionList(); } setState(759); match(EscriptParser::COMMA); setState(760); match(EscriptParser::RBRACE); notifyErrorListeners("Expected expression following comma before right-brace in array initializer list"); break; } case 3: { enterOuterAlt(_localctx, 3); setState(762); match(EscriptParser::LPAREN); setState(764); _errHandler->sync(this); _la = _input->LA(1); if ((((_la & ~ 0x3fULL) == 0) && ((1ULL << _la) & -3242591731706757120) != 0) || ((((_la - 64) & ~ 0x3fULL) == 0) && ((1ULL << (_la - 64)) & 4726527809026293753) != 0)) { setState(763); expressionList(); } setState(766); match(EscriptParser::RPAREN); break; } case 4: { enterOuterAlt(_localctx, 4); setState(767); match(EscriptParser::LPAREN); setState(769); _errHandler->sync(this); _la = _input->LA(1); if ((((_la & ~ 0x3fULL) == 0) && ((1ULL << _la) & -3242591731706757120) != 0) || ((((_la - 64) & ~ 0x3fULL) == 0) && ((1ULL << (_la - 64)) & 4726527809026293753) != 0)) { setState(768); expressionList(); } setState(771); match(EscriptParser::COMMA); setState(772); match(EscriptParser::RPAREN); notifyErrorListeners("Expected expression following comma before right-paren in array initializer list"); break; } default: break; } } catch (RecognitionException &e) { _errHandler->reportError(this, e); _localctx->exception = std::current_exception(); _errHandler->recover(this, _localctx->exception); } return _localctx; } //----------------- LiteralContext ------------------------------------------------------------------ EscriptParser::LiteralContext::LiteralContext(ParserRuleContext *parent, size_t invokingState) : ParserRuleContext(parent, invokingState) { } EscriptParser::IntegerLiteralContext* EscriptParser::LiteralContext::integerLiteral() { return getRuleContext(0); } EscriptParser::FloatLiteralContext* EscriptParser::LiteralContext::floatLiteral() { return getRuleContext(0); } EscriptParser::BoolLiteralContext* EscriptParser::LiteralContext::boolLiteral() { return getRuleContext(0); } tree::TerminalNode* EscriptParser::LiteralContext::STRING_LITERAL() { return getToken(EscriptParser::STRING_LITERAL, 0); } tree::TerminalNode* EscriptParser::LiteralContext::UNINIT() { return getToken(EscriptParser::UNINIT, 0); } size_t EscriptParser::LiteralContext::getRuleIndex() const { return EscriptParser::RuleLiteral; } void EscriptParser::LiteralContext::enterRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->enterLiteral(this); } void EscriptParser::LiteralContext::exitRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->exitLiteral(this); } std::any EscriptParser::LiteralContext::accept(tree::ParseTreeVisitor *visitor) { if (auto parserVisitor = dynamic_cast(visitor)) return parserVisitor->visitLiteral(this); else return visitor->visitChildren(this); } EscriptParser::LiteralContext* EscriptParser::literal() { LiteralContext *_localctx = _tracker.createInstance(_ctx, getState()); enterRule(_localctx, 150, EscriptParser::RuleLiteral); #if __cplusplus > 201703L auto onExit = finally([=, this] { #else auto onExit = finally([=] { #endif exitRule(); }); try { setState(781); _errHandler->sync(this); switch (_input->LA(1)) { case EscriptParser::DECIMAL_LITERAL: case EscriptParser::HEX_LITERAL: case EscriptParser::OCT_LITERAL: case EscriptParser::BINARY_LITERAL: { enterOuterAlt(_localctx, 1); setState(776); integerLiteral(); break; } case EscriptParser::FLOAT_LITERAL: case EscriptParser::HEX_FLOAT_LITERAL: { enterOuterAlt(_localctx, 2); setState(777); floatLiteral(); break; } case EscriptParser::BOOL_TRUE: case EscriptParser::BOOL_FALSE: { enterOuterAlt(_localctx, 3); setState(778); boolLiteral(); break; } case EscriptParser::STRING_LITERAL: { enterOuterAlt(_localctx, 4); setState(779); match(EscriptParser::STRING_LITERAL); break; } case EscriptParser::UNINIT: { enterOuterAlt(_localctx, 5); setState(780); match(EscriptParser::UNINIT); break; } default: throw NoViableAltException(this); } } catch (RecognitionException &e) { _errHandler->reportError(this, e); _localctx->exception = std::current_exception(); _errHandler->recover(this, _localctx->exception); } return _localctx; } //----------------- InterpolatedStringContext ------------------------------------------------------------------ EscriptParser::InterpolatedStringContext::InterpolatedStringContext(ParserRuleContext *parent, size_t invokingState) : ParserRuleContext(parent, invokingState) { } tree::TerminalNode* EscriptParser::InterpolatedStringContext::INTERPOLATED_STRING_START() { return getToken(EscriptParser::INTERPOLATED_STRING_START, 0); } tree::TerminalNode* EscriptParser::InterpolatedStringContext::DOUBLE_QUOTE_INSIDE() { return getToken(EscriptParser::DOUBLE_QUOTE_INSIDE, 0); } std::vector EscriptParser::InterpolatedStringContext::interpolatedStringPart() { return getRuleContexts(); } EscriptParser::InterpolatedStringPartContext* EscriptParser::InterpolatedStringContext::interpolatedStringPart(size_t i) { return getRuleContext(i); } size_t EscriptParser::InterpolatedStringContext::getRuleIndex() const { return EscriptParser::RuleInterpolatedString; } void EscriptParser::InterpolatedStringContext::enterRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->enterInterpolatedString(this); } void EscriptParser::InterpolatedStringContext::exitRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->exitInterpolatedString(this); } std::any EscriptParser::InterpolatedStringContext::accept(tree::ParseTreeVisitor *visitor) { if (auto parserVisitor = dynamic_cast(visitor)) return parserVisitor->visitInterpolatedString(this); else return visitor->visitChildren(this); } EscriptParser::InterpolatedStringContext* EscriptParser::interpolatedString() { InterpolatedStringContext *_localctx = _tracker.createInstance(_ctx, getState()); enterRule(_localctx, 152, EscriptParser::RuleInterpolatedString); size_t _la = 0; #if __cplusplus > 201703L auto onExit = finally([=, this] { #else auto onExit = finally([=] { #endif exitRule(); }); try { enterOuterAlt(_localctx, 1); setState(783); match(EscriptParser::INTERPOLATED_STRING_START); setState(787); _errHandler->sync(this); _la = _input->LA(1); while (((((_la - 127) & ~ 0x3fULL) == 0) && ((1ULL << (_la - 127)) & 55) != 0)) { setState(784); interpolatedStringPart(); setState(789); _errHandler->sync(this); _la = _input->LA(1); } setState(790); match(EscriptParser::DOUBLE_QUOTE_INSIDE); } catch (RecognitionException &e) { _errHandler->reportError(this, e); _localctx->exception = std::current_exception(); _errHandler->recover(this, _localctx->exception); } return _localctx; } //----------------- InterpolatedStringPartContext ------------------------------------------------------------------ EscriptParser::InterpolatedStringPartContext::InterpolatedStringPartContext(ParserRuleContext *parent, size_t invokingState) : ParserRuleContext(parent, invokingState) { } tree::TerminalNode* EscriptParser::InterpolatedStringPartContext::LBRACE_INSIDE() { return getToken(EscriptParser::LBRACE_INSIDE, 0); } EscriptParser::ExpressionContext* EscriptParser::InterpolatedStringPartContext::expression() { return getRuleContext(0); } tree::TerminalNode* EscriptParser::InterpolatedStringPartContext::COLON() { return getToken(EscriptParser::COLON, 0); } tree::TerminalNode* EscriptParser::InterpolatedStringPartContext::FORMAT_STRING() { return getToken(EscriptParser::FORMAT_STRING, 0); } tree::TerminalNode* EscriptParser::InterpolatedStringPartContext::DOUBLE_LBRACE_INSIDE() { return getToken(EscriptParser::DOUBLE_LBRACE_INSIDE, 0); } tree::TerminalNode* EscriptParser::InterpolatedStringPartContext::REGULAR_CHAR_INSIDE() { return getToken(EscriptParser::REGULAR_CHAR_INSIDE, 0); } tree::TerminalNode* EscriptParser::InterpolatedStringPartContext::DOUBLE_RBRACE() { return getToken(EscriptParser::DOUBLE_RBRACE, 0); } tree::TerminalNode* EscriptParser::InterpolatedStringPartContext::STRING_LITERAL_INSIDE() { return getToken(EscriptParser::STRING_LITERAL_INSIDE, 0); } size_t EscriptParser::InterpolatedStringPartContext::getRuleIndex() const { return EscriptParser::RuleInterpolatedStringPart; } void EscriptParser::InterpolatedStringPartContext::enterRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->enterInterpolatedStringPart(this); } void EscriptParser::InterpolatedStringPartContext::exitRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->exitInterpolatedStringPart(this); } std::any EscriptParser::InterpolatedStringPartContext::accept(tree::ParseTreeVisitor *visitor) { if (auto parserVisitor = dynamic_cast(visitor)) return parserVisitor->visitInterpolatedStringPart(this); else return visitor->visitChildren(this); } EscriptParser::InterpolatedStringPartContext* EscriptParser::interpolatedStringPart() { InterpolatedStringPartContext *_localctx = _tracker.createInstance(_ctx, getState()); enterRule(_localctx, 154, EscriptParser::RuleInterpolatedStringPart); size_t _la = 0; #if __cplusplus > 201703L auto onExit = finally([=, this] { #else auto onExit = finally([=] { #endif exitRule(); }); try { setState(808); _errHandler->sync(this); switch (getInterpreter()->adaptivePredict(_input, 83, _ctx)) { case 1: { enterOuterAlt(_localctx, 1); setState(792); match(EscriptParser::LBRACE_INSIDE); setState(793); expression(0); setState(796); _errHandler->sync(this); _la = _input->LA(1); if (_la == EscriptParser::COLON) { setState(794); match(EscriptParser::COLON); setState(795); match(EscriptParser::FORMAT_STRING); } break; } case 2: { enterOuterAlt(_localctx, 2); setState(798); match(EscriptParser::LBRACE_INSIDE); setState(801); _errHandler->sync(this); _la = _input->LA(1); if (_la == EscriptParser::COLON) { setState(799); match(EscriptParser::COLON); setState(800); match(EscriptParser::FORMAT_STRING); } notifyErrorListeners("Expected expression following interpolated string part start"); break; } case 3: { enterOuterAlt(_localctx, 3); setState(804); match(EscriptParser::DOUBLE_LBRACE_INSIDE); break; } case 4: { enterOuterAlt(_localctx, 4); setState(805); match(EscriptParser::REGULAR_CHAR_INSIDE); break; } case 5: { enterOuterAlt(_localctx, 5); setState(806); match(EscriptParser::DOUBLE_RBRACE); break; } case 6: { enterOuterAlt(_localctx, 6); setState(807); match(EscriptParser::STRING_LITERAL_INSIDE); break; } default: break; } } catch (RecognitionException &e) { _errHandler->reportError(this, e); _localctx->exception = std::current_exception(); _errHandler->recover(this, _localctx->exception); } return _localctx; } //----------------- IntegerLiteralContext ------------------------------------------------------------------ EscriptParser::IntegerLiteralContext::IntegerLiteralContext(ParserRuleContext *parent, size_t invokingState) : ParserRuleContext(parent, invokingState) { } tree::TerminalNode* EscriptParser::IntegerLiteralContext::DECIMAL_LITERAL() { return getToken(EscriptParser::DECIMAL_LITERAL, 0); } tree::TerminalNode* EscriptParser::IntegerLiteralContext::HEX_LITERAL() { return getToken(EscriptParser::HEX_LITERAL, 0); } tree::TerminalNode* EscriptParser::IntegerLiteralContext::OCT_LITERAL() { return getToken(EscriptParser::OCT_LITERAL, 0); } tree::TerminalNode* EscriptParser::IntegerLiteralContext::BINARY_LITERAL() { return getToken(EscriptParser::BINARY_LITERAL, 0); } size_t EscriptParser::IntegerLiteralContext::getRuleIndex() const { return EscriptParser::RuleIntegerLiteral; } void EscriptParser::IntegerLiteralContext::enterRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->enterIntegerLiteral(this); } void EscriptParser::IntegerLiteralContext::exitRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->exitIntegerLiteral(this); } std::any EscriptParser::IntegerLiteralContext::accept(tree::ParseTreeVisitor *visitor) { if (auto parserVisitor = dynamic_cast(visitor)) return parserVisitor->visitIntegerLiteral(this); else return visitor->visitChildren(this); } EscriptParser::IntegerLiteralContext* EscriptParser::integerLiteral() { IntegerLiteralContext *_localctx = _tracker.createInstance(_ctx, getState()); enterRule(_localctx, 156, EscriptParser::RuleIntegerLiteral); size_t _la = 0; #if __cplusplus > 201703L auto onExit = finally([=, this] { #else auto onExit = finally([=] { #endif exitRule(); }); try { enterOuterAlt(_localctx, 1); setState(810); _la = _input->LA(1); if (!(((((_la - 70) & ~ 0x3fULL) == 0) && ((1ULL << (_la - 70)) & 15) != 0))) { _errHandler->recoverInline(this); } else { _errHandler->reportMatch(this); consume(); } } catch (RecognitionException &e) { _errHandler->reportError(this, e); _localctx->exception = std::current_exception(); _errHandler->recover(this, _localctx->exception); } return _localctx; } //----------------- FloatLiteralContext ------------------------------------------------------------------ EscriptParser::FloatLiteralContext::FloatLiteralContext(ParserRuleContext *parent, size_t invokingState) : ParserRuleContext(parent, invokingState) { } tree::TerminalNode* EscriptParser::FloatLiteralContext::FLOAT_LITERAL() { return getToken(EscriptParser::FLOAT_LITERAL, 0); } tree::TerminalNode* EscriptParser::FloatLiteralContext::HEX_FLOAT_LITERAL() { return getToken(EscriptParser::HEX_FLOAT_LITERAL, 0); } size_t EscriptParser::FloatLiteralContext::getRuleIndex() const { return EscriptParser::RuleFloatLiteral; } void EscriptParser::FloatLiteralContext::enterRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->enterFloatLiteral(this); } void EscriptParser::FloatLiteralContext::exitRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->exitFloatLiteral(this); } std::any EscriptParser::FloatLiteralContext::accept(tree::ParseTreeVisitor *visitor) { if (auto parserVisitor = dynamic_cast(visitor)) return parserVisitor->visitFloatLiteral(this); else return visitor->visitChildren(this); } EscriptParser::FloatLiteralContext* EscriptParser::floatLiteral() { FloatLiteralContext *_localctx = _tracker.createInstance(_ctx, getState()); enterRule(_localctx, 158, EscriptParser::RuleFloatLiteral); size_t _la = 0; #if __cplusplus > 201703L auto onExit = finally([=, this] { #else auto onExit = finally([=] { #endif exitRule(); }); try { enterOuterAlt(_localctx, 1); setState(812); _la = _input->LA(1); if (!(_la == EscriptParser::FLOAT_LITERAL || _la == EscriptParser::HEX_FLOAT_LITERAL)) { _errHandler->recoverInline(this); } else { _errHandler->reportMatch(this); consume(); } } catch (RecognitionException &e) { _errHandler->reportError(this, e); _localctx->exception = std::current_exception(); _errHandler->recover(this, _localctx->exception); } return _localctx; } //----------------- BoolLiteralContext ------------------------------------------------------------------ EscriptParser::BoolLiteralContext::BoolLiteralContext(ParserRuleContext *parent, size_t invokingState) : ParserRuleContext(parent, invokingState) { } tree::TerminalNode* EscriptParser::BoolLiteralContext::BOOL_TRUE() { return getToken(EscriptParser::BOOL_TRUE, 0); } tree::TerminalNode* EscriptParser::BoolLiteralContext::BOOL_FALSE() { return getToken(EscriptParser::BOOL_FALSE, 0); } size_t EscriptParser::BoolLiteralContext::getRuleIndex() const { return EscriptParser::RuleBoolLiteral; } void EscriptParser::BoolLiteralContext::enterRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->enterBoolLiteral(this); } void EscriptParser::BoolLiteralContext::exitRule(tree::ParseTreeListener *listener) { auto parserListener = dynamic_cast(listener); if (parserListener != nullptr) parserListener->exitBoolLiteral(this); } std::any EscriptParser::BoolLiteralContext::accept(tree::ParseTreeVisitor *visitor) { if (auto parserVisitor = dynamic_cast(visitor)) return parserVisitor->visitBoolLiteral(this); else return visitor->visitChildren(this); } EscriptParser::BoolLiteralContext* EscriptParser::boolLiteral() { BoolLiteralContext *_localctx = _tracker.createInstance(_ctx, getState()); enterRule(_localctx, 160, EscriptParser::RuleBoolLiteral); size_t _la = 0; #if __cplusplus > 201703L auto onExit = finally([=, this] { #else auto onExit = finally([=] { #endif exitRule(); }); try { enterOuterAlt(_localctx, 1); setState(814); _la = _input->LA(1); if (!(_la == EscriptParser::BOOL_TRUE || _la == EscriptParser::BOOL_FALSE)) { _errHandler->recoverInline(this); } else { _errHandler->reportMatch(this); consume(); } } catch (RecognitionException &e) { _errHandler->reportError(this, e); _localctx->exception = std::current_exception(); _errHandler->recover(this, _localctx->exception); } return _localctx; } bool EscriptParser::sempred(RuleContext *context, size_t ruleIndex, size_t predicateIndex) { switch (ruleIndex) { case 52: return expressionSempred(antlrcpp::downCast(context), predicateIndex); default: break; } return true; } bool EscriptParser::expressionSempred(ExpressionContext *_localctx, size_t predicateIndex) { switch (predicateIndex) { case 0: return precpred(_ctx, 12); case 1: return precpred(_ctx, 11); case 2: return precpred(_ctx, 10); case 3: return precpred(_ctx, 9); case 4: return precpred(_ctx, 8); case 5: return precpred(_ctx, 7); case 6: return precpred(_ctx, 6); case 7: return precpred(_ctx, 5); case 8: return precpred(_ctx, 4); case 9: return precpred(_ctx, 3); case 10: return precpred(_ctx, 2); case 11: return precpred(_ctx, 1); case 12: return precpred(_ctx, 16); case 13: return precpred(_ctx, 15); default: break; } return true; } void EscriptParser::initialize() { #if ANTLR4_USE_THREAD_LOCAL_CACHE escriptparserParserInitialize(); #else ::antlr4::internal::call_once(escriptparserParserOnceFlag, escriptparserParserInitialize); #endif }