mirror of
https://github.com/polserver/polserver
synced 2026-08-13 08:23:08 -04:00
* implementation * tests * maybe fix windows compilation? * undo change of match_flag_type * switch to boost regex * move flags to BRegExp object * fix tests due to cmake 4 update * update grammar * update prettifier * move flag parsing to BRegExp ctor * add AST nodes, update instr generation and execution * copy tests but use regular expression literals * fix grammar for handling division correctly * modify return values a bit, update tests - string.match: make groups hold structs of matched, offset - string.match: add offset - string.replace: use a groups array like string.match vs individual arguments * bundle of changes - standardize error messages - add more tests for coverage - move BRegExp creation to static method: previous implementation had ctor throwing, which was no good inside executor since it didn't have a try/catch * more tests; add OT_REGEXP to basic.em * move string regex stuff to bregexp and support regex/wregex via std::visit * maybe fix compilation errors? * add unicode escape sequence handling * really maybe fix compilation error? * fix compiler warnings * refactor a bit to remove duplicate code * address discord comments - just return wstring, no need for vector<wchar_t> method * Add string.split by string and regexp * Use Max_Split instead of Limit This makes it match basic::SplitWords * add support for empty string delim in SplitWords * remove duplicate code across string.split and mf_SplitWords * Squashed commit of the following: commitb3148e069fAuthor: turleypol <turley@polserver.com> Date: Sat Sep 27 17:02:22 2025 +0200 memorylocation of input string is not allowed to changed, switched back to uniqueptr commit5a4d1c8fcbAuthor: turleypol <turley@polserver.com> Date: Sat Sep 27 10:18:01 2025 +0200 no need to use ptr for input commit90fa0edc66Author: turleypol <turley@polserver.com> Date: Sat Sep 27 09:56:29 2025 +0200 fixed typo commitbed4ff3ac9Author: turleypol <turley@polserver.com> Date: Sat Sep 27 09:47:36 2025 +0200 make Callback for BContinuation move only * use uninit when group isn't matched * fix multiline flag handling; add test * add docs and doc example tests * some cleanup * address review comments - allow move assignment * add core-changes
10373 lines
337 KiB
C++
10373 lines
337 KiB
C++
|
|
|
|
|
|
// 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<std::string> ruleNames,
|
|
std::vector<std::string> literalNames,
|
|
std::vector<std::string> 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<antlr4::dfa::DFA> decisionToDFA;
|
|
antlr4::atn::PredictionContextCache sharedContextCache;
|
|
const std::vector<std::string> ruleNames;
|
|
const std::vector<std::string> literalNames;
|
|
const std::vector<std::string> symbolicNames;
|
|
const antlr4::dfa::Vocabulary vocabulary;
|
|
antlr4::atn::SerializedATNView serializedATN;
|
|
std::unique_ptr<antlr4::atn::ATN> 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<EscriptParserStaticData>(
|
|
std::vector<std::string>{
|
|
"compilationUnit", "moduleUnit", "evaluateUnit", "moduleDeclarationStatement",
|
|
"moduleFunctionDeclaration", "moduleFunctionParameterList", "moduleFunctionParameter",
|
|
"topLevelDeclaration", "classDeclaration", "classParameters", "classParameterList",
|
|
"classBody", "classStatement", "uninitFunctionDeclaration", "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",
|
|
"bindingDeclaration", "indexBindingList", "sequenceBindingList", "sequenceBinding",
|
|
"indexBinding", "binding", "bindingDeclarationInitializer", "programParameters",
|
|
"programParameterList", "programParameter", "functionParameters",
|
|
"functionParameterList", "functionParameter", "scopedFunctionCall",
|
|
"functionReference", "expression", "primary", "scopedIdentifier",
|
|
"functionExpression", "explicitArrayInitializer", "explicitStructInitializer",
|
|
"explicitDictInitializer", "explicitErrorInitializer", "bareArrayInitializer",
|
|
"parExpression", "expressionList", "expressionListEntry", "expressionSuffix",
|
|
"indexingSuffix", "indexList", "navigationSuffix", "methodCallSuffix",
|
|
"functionCallSuffix", "functionCall", "structInitializerExpression",
|
|
"structInitializerExpressionList", "structInitializer", "dictInitializerExpression",
|
|
"dictInitializerExpressionList", "dictInitializer", "arrayInitializer",
|
|
"literal", "interpolatedString", "interpolatedStringPart", "integerLiteral",
|
|
"floatLiteral", "boolLiteral"
|
|
},
|
|
std::vector<std::string>{
|
|
"", "'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'", "'class'",
|
|
"'endclass'", "'downto'", "'step'", "'reference'", "'out'", "'inout'",
|
|
"'ByVal'", "'string'", "'long'", "'integer'", "'unsigned'", "'signed'",
|
|
"'real'", "'float'", "'double'", "'as'", "'...'", "'&&'", "'and'",
|
|
"'||'", "'or'", "'!'", "'not'", "'byref'", "'unused'", "'error'",
|
|
"'hash'", "'dictionary'", "'struct'", "'array'", "'stack'", "'in'",
|
|
"'uninit'", "'true'", "'false'", "'is'", "", "", "", "", "", "", "",
|
|
"", "", "'('", "')'", "'['", "']'", "'{'", "'}'", "'.'", "'->'", "'*'",
|
|
"'/'", "'%'", "'+'", "'-'", "'+='", "'-='", "'*='", "'/='", "'%='",
|
|
"'<='", "'<'", "'>='", "'>'", "'>>'", "'<<'", "'&'", "'^'", "'|'",
|
|
"'<>'", "'!='", "'='", "'=='", "':='", "'.+'", "'.-'", "'.\\u003F'",
|
|
"';'", "','", "'~'", "'@'", "'::'", "':'", "'++'", "'--'", "'\\u003F:'",
|
|
"'\\u003F'", "", "", "", "", "'{{'"
|
|
},
|
|
std::vector<std::string>{
|
|
"", "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", "CLASS", "ENDCLASS",
|
|
"DOWNTO", "STEP", "REFERENCE", "TOK_OUT", "INOUT", "BYVAL", "STRING",
|
|
"TOK_LONG", "INTEGER", "UNSIGNED", "SIGNED", "REAL", "FLOAT", "DOUBLE",
|
|
"AS", "ELLIPSIS", "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", "IS", "DECIMAL_LITERAL",
|
|
"HEX_LITERAL", "OCT_LITERAL", "BINARY_LITERAL", "FLOAT_LITERAL", "HEX_FLOAT_LITERAL",
|
|
"STRING_LITERAL", "REGEXP_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,138,1010,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,2,81,7,81,2,82,7,82,2,83,7,83,2,84,
|
|
7,84,2,85,7,85,2,86,7,86,2,87,7,87,2,88,7,88,2,89,7,89,2,90,7,90,2,91,
|
|
7,91,2,92,7,92,2,93,7,93,2,94,7,94,2,95,7,95,2,96,7,96,1,0,5,0,196,8,
|
|
0,10,0,12,0,199,9,0,1,0,1,0,1,1,5,1,204,8,1,10,1,12,1,207,9,1,1,1,1,1,
|
|
1,2,1,2,1,2,1,3,1,3,3,3,216,8,3,1,4,1,4,1,4,3,4,221,8,4,1,4,1,4,1,4,1,
|
|
5,1,5,1,5,5,5,229,8,5,10,5,12,5,232,9,5,1,6,1,6,1,6,3,6,237,8,6,1,7,1,
|
|
7,1,7,1,7,1,7,1,7,3,7,245,8,7,1,8,1,8,1,8,1,8,1,8,1,8,1,9,1,9,3,9,255,
|
|
8,9,1,9,1,9,1,10,1,10,1,10,5,10,262,8,10,10,10,12,10,265,9,10,1,11,5,
|
|
11,268,8,11,10,11,12,11,271,9,11,1,12,1,12,1,12,3,12,276,8,12,1,13,1,
|
|
13,1,13,1,13,1,13,1,13,1,13,1,14,3,14,286,8,14,1,14,1,14,1,14,1,14,1,
|
|
14,1,14,1,14,1,15,1,15,1,16,1,16,1,16,1,16,1,17,1,17,1,17,1,17,1,18,1,
|
|
18,1,18,1,18,1,18,1,18,1,19,1,19,1,19,1,19,1,19,1,19,1,19,1,19,1,19,1,
|
|
19,1,19,1,19,1,19,1,19,1,19,1,19,1,19,1,19,1,19,3,19,330,8,19,1,20,1,
|
|
20,1,20,1,21,1,21,1,21,3,21,338,8,21,1,21,1,21,1,21,1,21,1,21,5,21,345,
|
|
8,21,10,21,12,21,348,9,21,1,21,1,21,3,21,352,8,21,1,21,1,21,1,22,1,22,
|
|
1,22,1,22,1,23,1,23,3,23,362,8,23,1,23,1,23,1,24,1,24,1,24,1,24,1,25,
|
|
1,25,1,25,1,25,1,26,3,26,375,8,26,1,26,1,26,1,26,1,26,1,26,1,26,1,27,
|
|
3,27,384,8,27,1,27,1,27,1,27,1,27,1,27,1,28,1,28,1,28,1,29,1,29,3,29,
|
|
396,8,29,1,29,1,29,1,30,1,30,3,30,402,8,30,1,30,1,30,1,31,3,31,407,8,
|
|
31,1,31,1,31,1,31,1,31,1,32,1,32,1,32,1,32,1,32,1,32,1,32,3,32,420,8,
|
|
32,1,33,3,33,423,8,33,1,33,1,33,1,33,1,33,1,33,1,33,1,33,1,34,3,34,433,
|
|
8,34,1,34,1,34,1,34,1,34,1,34,1,34,1,35,3,35,442,8,35,1,35,1,35,1,35,
|
|
1,35,1,35,4,35,449,8,35,11,35,12,35,450,1,35,1,35,1,36,1,36,3,36,457,
|
|
8,36,1,36,1,36,1,36,1,36,1,37,5,37,464,8,37,10,37,12,37,467,9,37,1,38,
|
|
1,38,1,38,1,38,1,38,1,38,1,38,3,38,476,8,38,1,39,1,39,1,39,5,39,481,8,
|
|
39,10,39,12,39,484,9,39,1,39,3,39,487,8,39,1,40,1,40,1,40,3,40,492,8,
|
|
40,1,41,4,41,495,8,41,11,41,12,41,496,1,41,1,41,1,42,1,42,1,42,1,42,1,
|
|
42,1,42,3,42,507,8,42,1,42,1,42,1,42,3,42,512,8,42,1,43,1,43,3,43,516,
|
|
8,43,1,44,1,44,1,44,1,44,1,44,1,44,1,44,1,45,1,45,1,45,1,45,1,45,1,45,
|
|
1,45,1,45,1,45,1,46,1,46,1,46,3,46,537,8,46,1,47,1,47,1,47,5,47,542,8,
|
|
47,10,47,12,47,545,9,47,1,48,1,48,1,48,1,49,1,49,3,49,552,8,49,1,49,1,
|
|
49,1,49,3,49,557,8,49,1,50,1,50,1,50,1,50,1,50,1,50,1,50,1,50,3,50,567,
|
|
8,50,1,51,1,51,1,51,5,51,572,8,51,10,51,12,51,575,9,51,1,52,1,52,1,52,
|
|
5,52,580,8,52,10,52,12,52,583,9,52,1,53,1,53,3,53,587,8,53,1,53,3,53,
|
|
590,8,53,1,54,1,54,3,54,594,8,54,1,54,1,54,3,54,598,8,54,1,54,1,54,1,
|
|
54,1,54,1,54,3,54,605,8,54,1,55,1,55,1,55,1,55,3,55,611,8,55,1,56,1,56,
|
|
1,56,1,56,1,56,1,56,3,56,619,8,56,1,57,1,57,3,57,623,8,57,1,57,1,57,1,
|
|
58,1,58,3,58,629,8,58,1,58,5,58,632,8,58,10,58,12,58,635,9,58,1,59,1,
|
|
59,1,59,1,59,1,59,3,59,642,8,59,3,59,644,8,59,1,60,1,60,3,60,648,8,60,
|
|
1,60,1,60,1,61,1,61,1,61,5,61,655,8,61,10,61,12,61,658,9,61,1,62,3,62,
|
|
661,8,62,1,62,1,62,3,62,665,8,62,1,62,1,62,3,62,669,8,62,1,62,1,62,3,
|
|
62,673,8,62,1,62,1,62,1,62,3,62,678,8,62,1,63,3,63,681,8,63,1,63,1,63,
|
|
1,63,1,64,1,64,3,64,688,8,64,1,64,3,64,691,8,64,1,64,1,64,1,65,1,65,1,
|
|
65,1,65,1,65,1,65,3,65,701,8,65,1,65,1,65,1,65,1,65,1,65,1,65,1,65,1,
|
|
65,1,65,1,65,1,65,1,65,1,65,1,65,1,65,1,65,1,65,1,65,1,65,1,65,1,65,1,
|
|
65,1,65,1,65,1,65,1,65,1,65,1,65,1,65,1,65,1,65,1,65,1,65,1,65,1,65,1,
|
|
65,1,65,1,65,1,65,1,65,1,65,1,65,1,65,1,65,1,65,1,65,1,65,5,65,750,8,
|
|
65,10,65,12,65,753,9,65,1,66,1,66,1,66,1,66,1,66,1,66,1,66,1,66,1,66,
|
|
1,66,1,66,1,66,1,66,1,66,3,66,769,8,66,1,67,3,67,772,8,67,1,67,1,67,1,
|
|
67,1,68,1,68,1,68,3,68,780,8,68,1,68,1,68,1,68,1,68,1,69,1,69,3,69,788,
|
|
8,69,1,70,1,70,3,70,792,8,70,1,71,1,71,3,71,796,8,71,1,72,1,72,3,72,800,
|
|
8,72,1,73,1,73,3,73,804,8,73,1,73,1,73,1,73,3,73,809,8,73,1,73,1,73,1,
|
|
73,3,73,814,8,73,1,74,1,74,1,74,1,74,1,75,1,75,1,75,5,75,823,8,75,10,
|
|
75,12,75,826,9,75,1,76,1,76,3,76,830,8,76,1,77,1,77,1,77,1,77,3,77,836,
|
|
8,77,1,78,1,78,1,78,1,78,1,79,1,79,1,79,5,79,845,8,79,10,79,12,79,848,
|
|
9,79,1,80,1,80,1,80,1,81,1,81,1,81,1,81,3,81,857,8,81,1,81,1,81,1,82,
|
|
1,82,3,82,863,8,82,1,82,1,82,1,83,1,83,1,83,3,83,870,8,83,1,83,1,83,1,
|
|
84,1,84,1,84,3,84,877,8,84,1,84,1,84,1,84,3,84,882,8,84,1,84,1,84,1,84,
|
|
3,84,887,8,84,1,85,1,85,1,85,5,85,892,8,85,10,85,12,85,895,9,85,1,86,
|
|
1,86,3,86,899,8,86,1,86,1,86,1,86,3,86,904,8,86,1,86,1,86,1,86,3,86,909,
|
|
8,86,1,87,1,87,1,87,3,87,914,8,87,1,87,1,87,1,87,3,87,919,8,87,1,88,1,
|
|
88,1,88,5,88,924,8,88,10,88,12,88,927,9,88,1,89,1,89,3,89,931,8,89,1,
|
|
89,1,89,1,89,3,89,936,8,89,1,89,1,89,1,89,3,89,941,8,89,1,90,1,90,3,90,
|
|
945,8,90,1,90,1,90,1,90,3,90,950,8,90,1,90,1,90,1,90,1,90,1,90,3,90,957,
|
|
8,90,1,90,1,90,1,90,3,90,962,8,90,1,90,1,90,1,90,3,90,967,8,90,1,91,1,
|
|
91,1,91,1,91,1,91,1,91,3,91,975,8,91,1,92,1,92,5,92,979,8,92,10,92,12,
|
|
92,982,9,92,1,92,1,92,1,93,1,93,1,93,1,93,3,93,990,8,93,1,93,1,93,1,93,
|
|
3,93,995,8,93,1,93,1,93,1,93,1,93,1,93,3,93,1002,8,93,1,94,1,94,1,95,
|
|
1,95,1,96,1,96,1,96,0,1,130,97,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,162,164,166,168,170,172,174,176,178,180,182,184,186,188,
|
|
190,192,0,16,2,0,79,79,130,130,2,0,93,94,123,124,2,0,58,59,119,119,2,
|
|
0,90,92,104,106,2,0,93,94,107,108,1,0,100,103,2,0,109,110,112,112,1,0,
|
|
54,55,1,0,56,57,1,0,114,116,2,0,95,99,113,113,1,0,123,124,3,0,15,15,79,
|
|
79,130,130,1,0,73,76,1,0,77,78,1,0,70,71,1091,0,197,1,0,0,0,2,205,1,0,
|
|
0,0,4,210,1,0,0,0,6,215,1,0,0,0,8,217,1,0,0,0,10,225,1,0,0,0,12,233,1,
|
|
0,0,0,14,244,1,0,0,0,16,246,1,0,0,0,18,252,1,0,0,0,20,258,1,0,0,0,22,
|
|
269,1,0,0,0,24,275,1,0,0,0,26,277,1,0,0,0,28,285,1,0,0,0,30,294,1,0,0,
|
|
0,32,296,1,0,0,0,34,300,1,0,0,0,36,304,1,0,0,0,38,329,1,0,0,0,40,331,
|
|
1,0,0,0,42,334,1,0,0,0,44,355,1,0,0,0,46,359,1,0,0,0,48,365,1,0,0,0,50,
|
|
369,1,0,0,0,52,374,1,0,0,0,54,383,1,0,0,0,56,390,1,0,0,0,58,393,1,0,0,
|
|
0,60,399,1,0,0,0,62,406,1,0,0,0,64,419,1,0,0,0,66,422,1,0,0,0,68,432,
|
|
1,0,0,0,70,441,1,0,0,0,72,454,1,0,0,0,74,465,1,0,0,0,76,475,1,0,0,0,78,
|
|
477,1,0,0,0,80,488,1,0,0,0,82,494,1,0,0,0,84,511,1,0,0,0,86,515,1,0,0,
|
|
0,88,517,1,0,0,0,90,524,1,0,0,0,92,533,1,0,0,0,94,538,1,0,0,0,96,546,
|
|
1,0,0,0,98,556,1,0,0,0,100,566,1,0,0,0,102,568,1,0,0,0,104,576,1,0,0,
|
|
0,106,589,1,0,0,0,108,604,1,0,0,0,110,610,1,0,0,0,112,618,1,0,0,0,114,
|
|
620,1,0,0,0,116,626,1,0,0,0,118,643,1,0,0,0,120,645,1,0,0,0,122,651,1,
|
|
0,0,0,124,660,1,0,0,0,126,680,1,0,0,0,128,685,1,0,0,0,130,700,1,0,0,0,
|
|
132,768,1,0,0,0,134,771,1,0,0,0,136,776,1,0,0,0,138,785,1,0,0,0,140,789,
|
|
1,0,0,0,142,793,1,0,0,0,144,797,1,0,0,0,146,813,1,0,0,0,148,815,1,0,0,
|
|
0,150,819,1,0,0,0,152,827,1,0,0,0,154,835,1,0,0,0,156,837,1,0,0,0,158,
|
|
841,1,0,0,0,160,849,1,0,0,0,162,852,1,0,0,0,164,860,1,0,0,0,166,866,1,
|
|
0,0,0,168,886,1,0,0,0,170,888,1,0,0,0,172,908,1,0,0,0,174,918,1,0,0,0,
|
|
176,920,1,0,0,0,178,940,1,0,0,0,180,966,1,0,0,0,182,974,1,0,0,0,184,976,
|
|
1,0,0,0,186,1001,1,0,0,0,188,1003,1,0,0,0,190,1005,1,0,0,0,192,1007,1,
|
|
0,0,0,194,196,3,14,7,0,195,194,1,0,0,0,196,199,1,0,0,0,197,195,1,0,0,
|
|
0,197,198,1,0,0,0,198,200,1,0,0,0,199,197,1,0,0,0,200,201,5,0,0,1,201,
|
|
1,1,0,0,0,202,204,3,6,3,0,203,202,1,0,0,0,204,207,1,0,0,0,205,203,1,0,
|
|
0,0,205,206,1,0,0,0,206,208,1,0,0,0,207,205,1,0,0,0,208,209,5,0,0,1,209,
|
|
3,1,0,0,0,210,211,3,130,65,0,211,212,5,0,0,1,212,5,1,0,0,0,213,216,3,
|
|
8,4,0,214,216,3,48,24,0,215,213,1,0,0,0,215,214,1,0,0,0,216,7,1,0,0,0,
|
|
217,218,5,130,0,0,218,220,5,82,0,0,219,221,3,10,5,0,220,219,1,0,0,0,220,
|
|
221,1,0,0,0,221,222,1,0,0,0,222,223,5,83,0,0,223,224,5,117,0,0,224,9,
|
|
1,0,0,0,225,230,3,12,6,0,226,227,5,118,0,0,227,229,3,12,6,0,228,226,1,
|
|
0,0,0,229,232,1,0,0,0,230,228,1,0,0,0,230,231,1,0,0,0,231,11,1,0,0,0,
|
|
232,230,1,0,0,0,233,236,5,130,0,0,234,235,5,113,0,0,235,237,3,130,65,
|
|
0,236,234,1,0,0,0,236,237,1,0,0,0,237,13,1,0,0,0,238,245,3,32,16,0,239,
|
|
245,3,34,17,0,240,245,3,36,18,0,241,245,3,28,14,0,242,245,3,16,8,0,243,
|
|
245,3,38,19,0,244,238,1,0,0,0,244,239,1,0,0,0,244,240,1,0,0,0,244,241,
|
|
1,0,0,0,244,242,1,0,0,0,244,243,1,0,0,0,245,15,1,0,0,0,246,247,5,36,0,
|
|
0,247,248,5,130,0,0,248,249,3,18,9,0,249,250,3,22,11,0,250,251,5,37,0,
|
|
0,251,17,1,0,0,0,252,254,5,82,0,0,253,255,3,20,10,0,254,253,1,0,0,0,254,
|
|
255,1,0,0,0,255,256,1,0,0,0,256,257,5,83,0,0,257,19,1,0,0,0,258,263,5,
|
|
130,0,0,259,260,5,118,0,0,260,262,5,130,0,0,261,259,1,0,0,0,262,265,1,
|
|
0,0,0,263,261,1,0,0,0,263,264,1,0,0,0,264,21,1,0,0,0,265,263,1,0,0,0,
|
|
266,268,3,24,12,0,267,266,1,0,0,0,268,271,1,0,0,0,269,267,1,0,0,0,269,
|
|
270,1,0,0,0,270,23,1,0,0,0,271,269,1,0,0,0,272,276,3,28,14,0,273,276,
|
|
3,50,25,0,274,276,3,26,13,0,275,272,1,0,0,0,275,273,1,0,0,0,275,274,1,
|
|
0,0,0,276,25,1,0,0,0,277,278,5,69,0,0,278,279,5,15,0,0,279,280,5,130,
|
|
0,0,280,281,6,13,-1,0,281,282,3,120,60,0,282,283,5,117,0,0,283,27,1,0,
|
|
0,0,284,286,5,17,0,0,285,284,1,0,0,0,285,286,1,0,0,0,286,287,1,0,0,0,
|
|
287,288,5,15,0,0,288,289,5,130,0,0,289,290,6,14,-1,0,290,291,3,120,60,
|
|
0,291,292,3,74,37,0,292,293,5,16,0,0,293,29,1,0,0,0,294,295,7,0,0,0,295,
|
|
31,1,0,0,0,296,297,5,18,0,0,297,298,3,30,15,0,298,299,5,117,0,0,299,33,
|
|
1,0,0,0,300,301,5,19,0,0,301,302,3,30,15,0,302,303,5,117,0,0,303,35,1,
|
|
0,0,0,304,305,5,29,0,0,305,306,5,130,0,0,306,307,3,114,57,0,307,308,3,
|
|
74,37,0,308,309,5,30,0,0,309,37,1,0,0,0,310,330,3,42,21,0,311,330,3,44,
|
|
22,0,312,330,3,46,23,0,313,330,3,48,24,0,314,330,3,50,25,0,315,330,3,
|
|
52,26,0,316,330,3,54,27,0,317,330,3,56,28,0,318,330,3,58,29,0,319,330,
|
|
3,60,30,0,320,330,3,62,31,0,321,330,3,66,33,0,322,330,3,68,34,0,323,330,
|
|
3,70,35,0,324,330,3,72,36,0,325,330,5,117,0,0,326,327,3,130,65,0,327,
|
|
328,5,117,0,0,328,330,1,0,0,0,329,310,1,0,0,0,329,311,1,0,0,0,329,312,
|
|
1,0,0,0,329,313,1,0,0,0,329,314,1,0,0,0,329,315,1,0,0,0,329,316,1,0,0,
|
|
0,329,317,1,0,0,0,329,318,1,0,0,0,329,319,1,0,0,0,329,320,1,0,0,0,329,
|
|
321,1,0,0,0,329,322,1,0,0,0,329,323,1,0,0,0,329,324,1,0,0,0,329,325,1,
|
|
0,0,0,329,326,1,0,0,0,330,39,1,0,0,0,331,332,5,130,0,0,332,333,5,122,
|
|
0,0,333,41,1,0,0,0,334,335,5,1,0,0,335,337,3,148,74,0,336,338,5,2,0,0,
|
|
337,336,1,0,0,0,337,338,1,0,0,0,338,339,1,0,0,0,339,346,3,74,37,0,340,
|
|
341,5,3,0,0,341,342,3,148,74,0,342,343,3,74,37,0,343,345,1,0,0,0,344,
|
|
340,1,0,0,0,345,348,1,0,0,0,346,344,1,0,0,0,346,347,1,0,0,0,347,351,1,
|
|
0,0,0,348,346,1,0,0,0,349,350,5,5,0,0,350,352,3,74,37,0,351,349,1,0,0,
|
|
0,351,352,1,0,0,0,352,353,1,0,0,0,353,354,5,4,0,0,354,43,1,0,0,0,355,
|
|
356,5,6,0,0,356,357,5,130,0,0,357,358,5,117,0,0,358,45,1,0,0,0,359,361,
|
|
5,7,0,0,360,362,3,130,65,0,361,360,1,0,0,0,361,362,1,0,0,0,362,363,1,
|
|
0,0,0,363,364,5,117,0,0,364,47,1,0,0,0,365,366,5,8,0,0,366,367,3,96,48,
|
|
0,367,368,5,117,0,0,368,49,1,0,0,0,369,370,5,9,0,0,370,371,3,94,47,0,
|
|
371,372,5,117,0,0,372,51,1,0,0,0,373,375,3,40,20,0,374,373,1,0,0,0,374,
|
|
375,1,0,0,0,375,376,1,0,0,0,376,377,5,10,0,0,377,378,3,74,37,0,378,379,
|
|
5,11,0,0,379,380,3,148,74,0,380,381,5,117,0,0,381,53,1,0,0,0,382,384,
|
|
3,40,20,0,383,382,1,0,0,0,383,384,1,0,0,0,384,385,1,0,0,0,385,386,5,12,
|
|
0,0,386,387,3,148,74,0,387,388,3,74,37,0,388,389,5,13,0,0,389,55,1,0,
|
|
0,0,390,391,5,14,0,0,391,392,5,117,0,0,392,57,1,0,0,0,393,395,5,20,0,
|
|
0,394,396,5,130,0,0,395,394,1,0,0,0,395,396,1,0,0,0,396,397,1,0,0,0,397,
|
|
398,5,117,0,0,398,59,1,0,0,0,399,401,5,21,0,0,400,402,5,130,0,0,401,400,
|
|
1,0,0,0,401,402,1,0,0,0,402,403,1,0,0,0,403,404,5,117,0,0,404,61,1,0,
|
|
0,0,405,407,3,40,20,0,406,405,1,0,0,0,406,407,1,0,0,0,407,408,1,0,0,0,
|
|
408,409,5,22,0,0,409,410,3,86,43,0,410,411,5,23,0,0,411,63,1,0,0,0,412,
|
|
420,3,166,83,0,413,420,3,126,63,0,414,420,3,134,67,0,415,420,5,130,0,
|
|
0,416,420,3,148,74,0,417,420,3,146,73,0,418,420,3,138,69,0,419,412,1,
|
|
0,0,0,419,413,1,0,0,0,419,414,1,0,0,0,419,415,1,0,0,0,419,416,1,0,0,0,
|
|
419,417,1,0,0,0,419,418,1,0,0,0,420,65,1,0,0,0,421,423,3,40,20,0,422,
|
|
421,1,0,0,0,422,423,1,0,0,0,423,424,1,0,0,0,424,425,5,25,0,0,425,426,
|
|
5,130,0,0,426,427,5,68,0,0,427,428,3,64,32,0,428,429,3,74,37,0,429,430,
|
|
5,26,0,0,430,67,1,0,0,0,431,433,3,40,20,0,432,431,1,0,0,0,432,433,1,0,
|
|
0,0,433,434,1,0,0,0,434,435,5,27,0,0,435,436,3,74,37,0,436,437,5,28,0,
|
|
0,437,438,3,130,65,0,438,439,5,117,0,0,439,69,1,0,0,0,440,442,3,40,20,
|
|
0,441,440,1,0,0,0,441,442,1,0,0,0,442,443,1,0,0,0,443,444,5,31,0,0,444,
|
|
445,5,82,0,0,445,446,3,130,65,0,446,448,5,83,0,0,447,449,3,82,41,0,448,
|
|
447,1,0,0,0,449,450,1,0,0,0,450,448,1,0,0,0,450,451,1,0,0,0,451,452,1,
|
|
0,0,0,452,453,5,33,0,0,453,71,1,0,0,0,454,456,5,34,0,0,455,457,5,36,0,
|
|
0,456,455,1,0,0,0,456,457,1,0,0,0,457,458,1,0,0,0,458,459,5,130,0,0,459,
|
|
460,3,78,39,0,460,461,5,35,0,0,461,73,1,0,0,0,462,464,3,38,19,0,463,462,
|
|
1,0,0,0,464,467,1,0,0,0,465,463,1,0,0,0,465,466,1,0,0,0,466,75,1,0,0,
|
|
0,467,465,1,0,0,0,468,469,5,113,0,0,469,476,3,130,65,0,470,471,5,111,
|
|
0,0,471,472,3,130,65,0,472,473,6,38,-1,0,473,476,1,0,0,0,474,476,5,66,
|
|
0,0,475,468,1,0,0,0,475,470,1,0,0,0,475,474,1,0,0,0,476,77,1,0,0,0,477,
|
|
482,3,80,40,0,478,479,5,118,0,0,479,481,3,80,40,0,480,478,1,0,0,0,481,
|
|
484,1,0,0,0,482,480,1,0,0,0,482,483,1,0,0,0,483,486,1,0,0,0,484,482,1,
|
|
0,0,0,485,487,5,118,0,0,486,485,1,0,0,0,486,487,1,0,0,0,487,79,1,0,0,
|
|
0,488,491,5,130,0,0,489,490,5,113,0,0,490,492,3,130,65,0,491,489,1,0,
|
|
0,0,491,492,1,0,0,0,492,81,1,0,0,0,493,495,3,84,42,0,494,493,1,0,0,0,
|
|
495,496,1,0,0,0,496,494,1,0,0,0,496,497,1,0,0,0,497,498,1,0,0,0,498,499,
|
|
3,74,37,0,499,83,1,0,0,0,500,507,3,188,94,0,501,507,3,192,96,0,502,507,
|
|
3,134,67,0,503,507,5,69,0,0,504,507,5,130,0,0,505,507,5,79,0,0,506,500,
|
|
1,0,0,0,506,501,1,0,0,0,506,502,1,0,0,0,506,503,1,0,0,0,506,504,1,0,0,
|
|
0,506,505,1,0,0,0,507,508,1,0,0,0,508,512,5,122,0,0,509,510,5,32,0,0,
|
|
510,512,5,122,0,0,511,506,1,0,0,0,511,509,1,0,0,0,512,85,1,0,0,0,513,
|
|
516,3,90,45,0,514,516,3,88,44,0,515,513,1,0,0,0,515,514,1,0,0,0,516,87,
|
|
1,0,0,0,517,518,5,130,0,0,518,519,5,113,0,0,519,520,3,130,65,0,520,521,
|
|
5,24,0,0,521,522,3,130,65,0,522,523,3,74,37,0,523,89,1,0,0,0,524,525,
|
|
5,82,0,0,525,526,3,130,65,0,526,527,5,117,0,0,527,528,3,130,65,0,528,
|
|
529,5,117,0,0,529,530,3,130,65,0,530,531,5,83,0,0,531,532,3,74,37,0,532,
|
|
91,1,0,0,0,533,536,5,130,0,0,534,535,5,118,0,0,535,537,3,92,46,0,536,
|
|
534,1,0,0,0,536,537,1,0,0,0,537,93,1,0,0,0,538,543,3,98,49,0,539,540,
|
|
5,118,0,0,540,542,3,98,49,0,541,539,1,0,0,0,542,545,1,0,0,0,543,541,1,
|
|
0,0,0,543,544,1,0,0,0,544,95,1,0,0,0,545,543,1,0,0,0,546,547,5,130,0,
|
|
0,547,548,3,76,38,0,548,97,1,0,0,0,549,551,5,130,0,0,550,552,3,76,38,
|
|
0,551,550,1,0,0,0,551,552,1,0,0,0,552,557,1,0,0,0,553,554,3,100,50,0,
|
|
554,555,3,112,56,0,555,557,1,0,0,0,556,549,1,0,0,0,556,553,1,0,0,0,557,
|
|
99,1,0,0,0,558,559,5,84,0,0,559,560,3,104,52,0,560,561,5,85,0,0,561,567,
|
|
1,0,0,0,562,563,5,86,0,0,563,564,3,102,51,0,564,565,5,87,0,0,565,567,
|
|
1,0,0,0,566,558,1,0,0,0,566,562,1,0,0,0,567,101,1,0,0,0,568,573,3,108,
|
|
54,0,569,570,5,118,0,0,570,572,3,108,54,0,571,569,1,0,0,0,572,575,1,0,
|
|
0,0,573,571,1,0,0,0,573,574,1,0,0,0,574,103,1,0,0,0,575,573,1,0,0,0,576,
|
|
581,3,106,53,0,577,578,5,118,0,0,578,580,3,106,53,0,579,577,1,0,0,0,580,
|
|
583,1,0,0,0,581,579,1,0,0,0,581,582,1,0,0,0,582,105,1,0,0,0,583,581,1,
|
|
0,0,0,584,586,5,130,0,0,585,587,5,53,0,0,586,585,1,0,0,0,586,587,1,0,
|
|
0,0,587,590,1,0,0,0,588,590,3,100,50,0,589,584,1,0,0,0,589,588,1,0,0,
|
|
0,590,107,1,0,0,0,591,593,5,130,0,0,592,594,5,53,0,0,593,592,1,0,0,0,
|
|
593,594,1,0,0,0,594,605,1,0,0,0,595,597,5,130,0,0,596,598,3,110,55,0,
|
|
597,596,1,0,0,0,597,598,1,0,0,0,598,605,1,0,0,0,599,600,5,84,0,0,600,
|
|
601,3,130,65,0,601,602,5,85,0,0,602,603,3,110,55,0,603,605,1,0,0,0,604,
|
|
591,1,0,0,0,604,595,1,0,0,0,604,599,1,0,0,0,605,109,1,0,0,0,606,607,5,
|
|
122,0,0,607,611,5,130,0,0,608,609,5,122,0,0,609,611,3,100,50,0,610,606,
|
|
1,0,0,0,610,608,1,0,0,0,611,111,1,0,0,0,612,613,5,113,0,0,613,619,3,130,
|
|
65,0,614,615,5,111,0,0,615,616,3,130,65,0,616,617,6,56,-1,0,617,619,1,
|
|
0,0,0,618,612,1,0,0,0,618,614,1,0,0,0,619,113,1,0,0,0,620,622,5,82,0,
|
|
0,621,623,3,116,58,0,622,621,1,0,0,0,622,623,1,0,0,0,623,624,1,0,0,0,
|
|
624,625,5,83,0,0,625,115,1,0,0,0,626,633,3,118,59,0,627,629,5,118,0,0,
|
|
628,627,1,0,0,0,628,629,1,0,0,0,629,630,1,0,0,0,630,632,3,118,59,0,631,
|
|
628,1,0,0,0,632,635,1,0,0,0,633,631,1,0,0,0,633,634,1,0,0,0,634,117,1,
|
|
0,0,0,635,633,1,0,0,0,636,637,5,61,0,0,637,644,5,130,0,0,638,641,5,130,
|
|
0,0,639,640,5,113,0,0,640,642,3,130,65,0,641,639,1,0,0,0,641,642,1,0,
|
|
0,0,642,644,1,0,0,0,643,636,1,0,0,0,643,638,1,0,0,0,644,119,1,0,0,0,645,
|
|
647,5,82,0,0,646,648,3,122,61,0,647,646,1,0,0,0,647,648,1,0,0,0,648,649,
|
|
1,0,0,0,649,650,5,83,0,0,650,121,1,0,0,0,651,656,3,124,62,0,652,653,5,
|
|
118,0,0,653,655,3,124,62,0,654,652,1,0,0,0,655,658,1,0,0,0,656,654,1,
|
|
0,0,0,656,657,1,0,0,0,657,123,1,0,0,0,658,656,1,0,0,0,659,661,5,60,0,
|
|
0,660,659,1,0,0,0,660,661,1,0,0,0,661,664,1,0,0,0,662,663,6,62,-1,0,663,
|
|
665,5,61,0,0,664,662,1,0,0,0,664,665,1,0,0,0,665,668,1,0,0,0,666,667,
|
|
6,62,-1,0,667,669,5,32,0,0,668,666,1,0,0,0,668,669,1,0,0,0,669,670,1,
|
|
0,0,0,670,672,5,130,0,0,671,673,5,53,0,0,672,671,1,0,0,0,672,673,1,0,
|
|
0,0,673,677,1,0,0,0,674,675,5,113,0,0,675,676,6,62,-1,0,676,678,3,130,
|
|
65,0,677,674,1,0,0,0,677,678,1,0,0,0,678,125,1,0,0,0,679,681,5,130,0,
|
|
0,680,679,1,0,0,0,680,681,1,0,0,0,681,682,1,0,0,0,682,683,5,121,0,0,683,
|
|
684,3,166,83,0,684,127,1,0,0,0,685,690,5,120,0,0,686,688,5,130,0,0,687,
|
|
686,1,0,0,0,687,688,1,0,0,0,688,689,1,0,0,0,689,691,5,121,0,0,690,687,
|
|
1,0,0,0,690,691,1,0,0,0,691,692,1,0,0,0,692,693,5,130,0,0,693,129,1,0,
|
|
0,0,694,695,6,65,-1,0,695,701,3,132,66,0,696,697,7,1,0,0,697,701,3,130,
|
|
65,15,698,699,7,2,0,0,699,701,3,130,65,14,700,694,1,0,0,0,700,696,1,0,
|
|
0,0,700,698,1,0,0,0,701,751,1,0,0,0,702,703,10,13,0,0,703,704,7,3,0,0,
|
|
704,750,3,130,65,14,705,706,10,12,0,0,706,707,7,4,0,0,707,750,3,130,65,
|
|
13,708,709,10,11,0,0,709,710,5,125,0,0,710,750,3,130,65,12,711,712,10,
|
|
10,0,0,712,713,5,68,0,0,713,750,3,130,65,11,714,715,10,9,0,0,715,716,
|
|
7,5,0,0,716,750,3,130,65,10,717,718,10,8,0,0,718,719,5,72,0,0,719,750,
|
|
3,130,65,9,720,721,10,7,0,0,721,722,5,111,0,0,722,723,6,65,-1,0,723,750,
|
|
3,130,65,8,724,725,10,6,0,0,725,726,7,6,0,0,726,750,3,130,65,7,727,728,
|
|
10,5,0,0,728,729,7,7,0,0,729,750,3,130,65,6,730,731,10,4,0,0,731,732,
|
|
7,8,0,0,732,750,3,130,65,5,733,734,10,3,0,0,734,735,5,126,0,0,735,736,
|
|
3,130,65,0,736,737,5,122,0,0,737,738,3,130,65,4,738,750,1,0,0,0,739,740,
|
|
10,2,0,0,740,741,7,9,0,0,741,750,3,130,65,2,742,743,10,1,0,0,743,744,
|
|
7,10,0,0,744,750,3,130,65,1,745,746,10,17,0,0,746,750,3,154,77,0,747,
|
|
748,10,16,0,0,748,750,7,11,0,0,749,702,1,0,0,0,749,705,1,0,0,0,749,708,
|
|
1,0,0,0,749,711,1,0,0,0,749,714,1,0,0,0,749,717,1,0,0,0,749,720,1,0,0,
|
|
0,749,724,1,0,0,0,749,727,1,0,0,0,749,730,1,0,0,0,749,733,1,0,0,0,749,
|
|
739,1,0,0,0,749,742,1,0,0,0,749,745,1,0,0,0,749,747,1,0,0,0,750,753,1,
|
|
0,0,0,751,749,1,0,0,0,751,752,1,0,0,0,752,131,1,0,0,0,753,751,1,0,0,0,
|
|
754,769,3,182,91,0,755,769,3,148,74,0,756,769,3,166,83,0,757,769,3,126,
|
|
63,0,758,769,3,134,67,0,759,769,5,130,0,0,760,769,3,128,64,0,761,769,
|
|
3,136,68,0,762,769,3,138,69,0,763,769,3,140,70,0,764,769,3,142,71,0,765,
|
|
769,3,144,72,0,766,769,3,146,73,0,767,769,3,184,92,0,768,754,1,0,0,0,
|
|
768,755,1,0,0,0,768,756,1,0,0,0,768,757,1,0,0,0,768,758,1,0,0,0,768,759,
|
|
1,0,0,0,768,760,1,0,0,0,768,761,1,0,0,0,768,762,1,0,0,0,768,763,1,0,0,
|
|
0,768,764,1,0,0,0,768,765,1,0,0,0,768,766,1,0,0,0,768,767,1,0,0,0,769,
|
|
133,1,0,0,0,770,772,5,130,0,0,771,770,1,0,0,0,771,772,1,0,0,0,772,773,
|
|
1,0,0,0,773,774,5,121,0,0,774,775,5,130,0,0,775,135,1,0,0,0,776,777,5,
|
|
120,0,0,777,779,6,68,-1,0,778,780,3,120,60,0,779,778,1,0,0,0,779,780,
|
|
1,0,0,0,780,781,1,0,0,0,781,782,5,86,0,0,782,783,3,74,37,0,783,784,5,
|
|
87,0,0,784,137,1,0,0,0,785,787,5,66,0,0,786,788,3,180,90,0,787,786,1,
|
|
0,0,0,787,788,1,0,0,0,788,139,1,0,0,0,789,791,5,65,0,0,790,792,3,172,
|
|
86,0,791,790,1,0,0,0,791,792,1,0,0,0,792,141,1,0,0,0,793,795,5,64,0,0,
|
|
794,796,3,178,89,0,795,794,1,0,0,0,795,796,1,0,0,0,796,143,1,0,0,0,797,
|
|
799,5,62,0,0,798,800,3,172,86,0,799,798,1,0,0,0,799,800,1,0,0,0,800,145,
|
|
1,0,0,0,801,803,5,86,0,0,802,804,3,150,75,0,803,802,1,0,0,0,803,804,1,
|
|
0,0,0,804,805,1,0,0,0,805,814,5,87,0,0,806,808,5,86,0,0,807,809,3,150,
|
|
75,0,808,807,1,0,0,0,808,809,1,0,0,0,809,810,1,0,0,0,810,811,5,118,0,
|
|
0,811,812,5,87,0,0,812,814,6,73,-1,0,813,801,1,0,0,0,813,806,1,0,0,0,
|
|
814,147,1,0,0,0,815,816,5,82,0,0,816,817,3,130,65,0,817,818,5,83,0,0,
|
|
818,149,1,0,0,0,819,824,3,152,76,0,820,821,5,118,0,0,821,823,3,152,76,
|
|
0,822,820,1,0,0,0,823,826,1,0,0,0,824,822,1,0,0,0,824,825,1,0,0,0,825,
|
|
151,1,0,0,0,826,824,1,0,0,0,827,829,3,130,65,0,828,830,5,53,0,0,829,828,
|
|
1,0,0,0,829,830,1,0,0,0,830,153,1,0,0,0,831,836,3,156,78,0,832,836,3,
|
|
162,81,0,833,836,3,160,80,0,834,836,3,164,82,0,835,831,1,0,0,0,835,832,
|
|
1,0,0,0,835,833,1,0,0,0,835,834,1,0,0,0,836,155,1,0,0,0,837,838,5,84,
|
|
0,0,838,839,3,158,79,0,839,840,5,85,0,0,840,157,1,0,0,0,841,846,3,130,
|
|
65,0,842,843,5,118,0,0,843,845,3,130,65,0,844,842,1,0,0,0,845,848,1,0,
|
|
0,0,846,844,1,0,0,0,846,847,1,0,0,0,847,159,1,0,0,0,848,846,1,0,0,0,849,
|
|
850,5,88,0,0,850,851,7,12,0,0,851,161,1,0,0,0,852,853,5,88,0,0,853,854,
|
|
5,130,0,0,854,856,5,82,0,0,855,857,3,150,75,0,856,855,1,0,0,0,856,857,
|
|
1,0,0,0,857,858,1,0,0,0,858,859,5,83,0,0,859,163,1,0,0,0,860,862,5,82,
|
|
0,0,861,863,3,150,75,0,862,861,1,0,0,0,862,863,1,0,0,0,863,864,1,0,0,
|
|
0,864,865,5,83,0,0,865,165,1,0,0,0,866,867,5,130,0,0,867,869,5,82,0,0,
|
|
868,870,3,150,75,0,869,868,1,0,0,0,869,870,1,0,0,0,870,871,1,0,0,0,871,
|
|
872,5,83,0,0,872,167,1,0,0,0,873,876,5,130,0,0,874,875,5,113,0,0,875,
|
|
877,3,130,65,0,876,874,1,0,0,0,876,877,1,0,0,0,877,887,1,0,0,0,878,881,
|
|
5,79,0,0,879,880,5,113,0,0,880,882,3,130,65,0,881,879,1,0,0,0,881,882,
|
|
1,0,0,0,882,887,1,0,0,0,883,884,3,130,65,0,884,885,5,53,0,0,885,887,1,
|
|
0,0,0,886,873,1,0,0,0,886,878,1,0,0,0,886,883,1,0,0,0,887,169,1,0,0,0,
|
|
888,893,3,168,84,0,889,890,5,118,0,0,890,892,3,168,84,0,891,889,1,0,0,
|
|
0,892,895,1,0,0,0,893,891,1,0,0,0,893,894,1,0,0,0,894,171,1,0,0,0,895,
|
|
893,1,0,0,0,896,898,5,86,0,0,897,899,3,170,85,0,898,897,1,0,0,0,898,899,
|
|
1,0,0,0,899,900,1,0,0,0,900,909,5,87,0,0,901,903,5,86,0,0,902,904,3,170,
|
|
85,0,903,902,1,0,0,0,903,904,1,0,0,0,904,905,1,0,0,0,905,906,5,118,0,
|
|
0,906,907,5,87,0,0,907,909,6,86,-1,0,908,896,1,0,0,0,908,901,1,0,0,0,
|
|
909,173,1,0,0,0,910,913,3,130,65,0,911,912,5,89,0,0,912,914,3,130,65,
|
|
0,913,911,1,0,0,0,913,914,1,0,0,0,914,919,1,0,0,0,915,916,3,130,65,0,
|
|
916,917,5,53,0,0,917,919,1,0,0,0,918,910,1,0,0,0,918,915,1,0,0,0,919,
|
|
175,1,0,0,0,920,925,3,174,87,0,921,922,5,118,0,0,922,924,3,174,87,0,923,
|
|
921,1,0,0,0,924,927,1,0,0,0,925,923,1,0,0,0,925,926,1,0,0,0,926,177,1,
|
|
0,0,0,927,925,1,0,0,0,928,930,5,86,0,0,929,931,3,176,88,0,930,929,1,0,
|
|
0,0,930,931,1,0,0,0,931,932,1,0,0,0,932,941,5,87,0,0,933,935,5,86,0,0,
|
|
934,936,3,176,88,0,935,934,1,0,0,0,935,936,1,0,0,0,936,937,1,0,0,0,937,
|
|
938,5,118,0,0,938,939,5,87,0,0,939,941,6,89,-1,0,940,928,1,0,0,0,940,
|
|
933,1,0,0,0,941,179,1,0,0,0,942,944,5,86,0,0,943,945,3,150,75,0,944,943,
|
|
1,0,0,0,944,945,1,0,0,0,945,946,1,0,0,0,946,967,5,87,0,0,947,949,5,86,
|
|
0,0,948,950,3,150,75,0,949,948,1,0,0,0,949,950,1,0,0,0,950,951,1,0,0,
|
|
0,951,952,5,118,0,0,952,953,5,87,0,0,953,967,6,90,-1,0,954,956,5,82,0,
|
|
0,955,957,3,150,75,0,956,955,1,0,0,0,956,957,1,0,0,0,957,958,1,0,0,0,
|
|
958,967,5,83,0,0,959,961,5,82,0,0,960,962,3,150,75,0,961,960,1,0,0,0,
|
|
961,962,1,0,0,0,962,963,1,0,0,0,963,964,5,118,0,0,964,965,5,83,0,0,965,
|
|
967,6,90,-1,0,966,942,1,0,0,0,966,947,1,0,0,0,966,954,1,0,0,0,966,959,
|
|
1,0,0,0,967,181,1,0,0,0,968,975,3,188,94,0,969,975,3,190,95,0,970,975,
|
|
3,192,96,0,971,975,5,79,0,0,972,975,5,69,0,0,973,975,5,80,0,0,974,968,
|
|
1,0,0,0,974,969,1,0,0,0,974,970,1,0,0,0,974,971,1,0,0,0,974,972,1,0,0,
|
|
0,974,973,1,0,0,0,975,183,1,0,0,0,976,980,5,81,0,0,977,979,3,186,93,0,
|
|
978,977,1,0,0,0,979,982,1,0,0,0,980,978,1,0,0,0,980,981,1,0,0,0,981,983,
|
|
1,0,0,0,982,980,1,0,0,0,983,984,5,134,0,0,984,185,1,0,0,0,985,986,5,132,
|
|
0,0,986,989,3,130,65,0,987,988,5,122,0,0,988,990,5,138,0,0,989,987,1,
|
|
0,0,0,989,990,1,0,0,0,990,1002,1,0,0,0,991,994,5,132,0,0,992,993,5,122,
|
|
0,0,993,995,5,138,0,0,994,992,1,0,0,0,994,995,1,0,0,0,995,996,1,0,0,0,
|
|
996,1002,6,93,-1,0,997,1002,5,131,0,0,998,1002,5,133,0,0,999,1002,5,135,
|
|
0,0,1000,1002,5,136,0,0,1001,985,1,0,0,0,1001,991,1,0,0,0,1001,997,1,
|
|
0,0,0,1001,998,1,0,0,0,1001,999,1,0,0,0,1001,1000,1,0,0,0,1002,187,1,
|
|
0,0,0,1003,1004,7,13,0,0,1004,189,1,0,0,0,1005,1006,7,14,0,0,1006,191,
|
|
1,0,0,0,1007,1008,7,15,0,0,1008,193,1,0,0,0,109,197,205,215,220,230,236,
|
|
244,254,263,269,275,285,329,337,346,351,361,374,383,395,401,406,419,422,
|
|
432,441,450,456,465,475,482,486,491,496,506,511,515,536,543,551,556,566,
|
|
573,581,586,589,593,597,604,610,618,622,628,633,641,643,647,656,660,664,
|
|
668,672,677,680,687,690,700,749,751,768,771,779,787,791,795,799,803,808,
|
|
813,824,829,835,846,856,862,869,876,881,886,893,898,903,908,913,918,925,
|
|
930,935,940,944,949,956,961,966,974,980,989,994,1001
|
|
};
|
|
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<std::string>& 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::TopLevelDeclarationContext *> EscriptParser::CompilationUnitContext::topLevelDeclaration() {
|
|
return getRuleContexts<EscriptParser::TopLevelDeclarationContext>();
|
|
}
|
|
|
|
EscriptParser::TopLevelDeclarationContext* EscriptParser::CompilationUnitContext::topLevelDeclaration(size_t i) {
|
|
return getRuleContext<EscriptParser::TopLevelDeclarationContext>(i);
|
|
}
|
|
|
|
|
|
size_t EscriptParser::CompilationUnitContext::getRuleIndex() const {
|
|
return EscriptParser::RuleCompilationUnit;
|
|
}
|
|
|
|
void EscriptParser::CompilationUnitContext::enterRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->enterCompilationUnit(this);
|
|
}
|
|
|
|
void EscriptParser::CompilationUnitContext::exitRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->exitCompilationUnit(this);
|
|
}
|
|
|
|
|
|
std::any EscriptParser::CompilationUnitContext::accept(tree::ParseTreeVisitor *visitor) {
|
|
if (auto parserVisitor = dynamic_cast<EscriptParserVisitor*>(visitor))
|
|
return parserVisitor->visitCompilationUnit(this);
|
|
else
|
|
return visitor->visitChildren(this);
|
|
}
|
|
|
|
EscriptParser::CompilationUnitContext* EscriptParser::compilationUnit() {
|
|
CompilationUnitContext *_localctx = _tracker.createInstance<CompilationUnitContext>(_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(197);
|
|
_errHandler->sync(this);
|
|
_la = _input->LA(1);
|
|
while ((((_la & ~ 0x3fULL) == 0) &&
|
|
((1ULL << _la) & 5476377235642308546) != 0) || ((((_la - 64) & ~ 0x3fULL) == 0) &&
|
|
((1ULL << (_la - 64)) & 1990591036913090279) != 0) || _la == EscriptParser::IDENTIFIER) {
|
|
setState(194);
|
|
topLevelDeclaration();
|
|
setState(199);
|
|
_errHandler->sync(this);
|
|
_la = _input->LA(1);
|
|
}
|
|
setState(200);
|
|
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::ModuleDeclarationStatementContext *> EscriptParser::ModuleUnitContext::moduleDeclarationStatement() {
|
|
return getRuleContexts<EscriptParser::ModuleDeclarationStatementContext>();
|
|
}
|
|
|
|
EscriptParser::ModuleDeclarationStatementContext* EscriptParser::ModuleUnitContext::moduleDeclarationStatement(size_t i) {
|
|
return getRuleContext<EscriptParser::ModuleDeclarationStatementContext>(i);
|
|
}
|
|
|
|
|
|
size_t EscriptParser::ModuleUnitContext::getRuleIndex() const {
|
|
return EscriptParser::RuleModuleUnit;
|
|
}
|
|
|
|
void EscriptParser::ModuleUnitContext::enterRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->enterModuleUnit(this);
|
|
}
|
|
|
|
void EscriptParser::ModuleUnitContext::exitRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->exitModuleUnit(this);
|
|
}
|
|
|
|
|
|
std::any EscriptParser::ModuleUnitContext::accept(tree::ParseTreeVisitor *visitor) {
|
|
if (auto parserVisitor = dynamic_cast<EscriptParserVisitor*>(visitor))
|
|
return parserVisitor->visitModuleUnit(this);
|
|
else
|
|
return visitor->visitChildren(this);
|
|
}
|
|
|
|
EscriptParser::ModuleUnitContext* EscriptParser::moduleUnit() {
|
|
ModuleUnitContext *_localctx = _tracker.createInstance<ModuleUnitContext>(_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(205);
|
|
_errHandler->sync(this);
|
|
_la = _input->LA(1);
|
|
while (_la == EscriptParser::TOK_CONST || _la == EscriptParser::IDENTIFIER) {
|
|
setState(202);
|
|
moduleDeclarationStatement();
|
|
setState(207);
|
|
_errHandler->sync(this);
|
|
_la = _input->LA(1);
|
|
}
|
|
setState(208);
|
|
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<EscriptParser::ExpressionContext>(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<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->enterEvaluateUnit(this);
|
|
}
|
|
|
|
void EscriptParser::EvaluateUnitContext::exitRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->exitEvaluateUnit(this);
|
|
}
|
|
|
|
|
|
std::any EscriptParser::EvaluateUnitContext::accept(tree::ParseTreeVisitor *visitor) {
|
|
if (auto parserVisitor = dynamic_cast<EscriptParserVisitor*>(visitor))
|
|
return parserVisitor->visitEvaluateUnit(this);
|
|
else
|
|
return visitor->visitChildren(this);
|
|
}
|
|
|
|
EscriptParser::EvaluateUnitContext* EscriptParser::evaluateUnit() {
|
|
EvaluateUnitContext *_localctx = _tracker.createInstance<EvaluateUnitContext>(_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(210);
|
|
expression(0);
|
|
setState(211);
|
|
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<EscriptParser::ModuleFunctionDeclarationContext>(0);
|
|
}
|
|
|
|
EscriptParser::ConstStatementContext* EscriptParser::ModuleDeclarationStatementContext::constStatement() {
|
|
return getRuleContext<EscriptParser::ConstStatementContext>(0);
|
|
}
|
|
|
|
|
|
size_t EscriptParser::ModuleDeclarationStatementContext::getRuleIndex() const {
|
|
return EscriptParser::RuleModuleDeclarationStatement;
|
|
}
|
|
|
|
void EscriptParser::ModuleDeclarationStatementContext::enterRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->enterModuleDeclarationStatement(this);
|
|
}
|
|
|
|
void EscriptParser::ModuleDeclarationStatementContext::exitRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->exitModuleDeclarationStatement(this);
|
|
}
|
|
|
|
|
|
std::any EscriptParser::ModuleDeclarationStatementContext::accept(tree::ParseTreeVisitor *visitor) {
|
|
if (auto parserVisitor = dynamic_cast<EscriptParserVisitor*>(visitor))
|
|
return parserVisitor->visitModuleDeclarationStatement(this);
|
|
else
|
|
return visitor->visitChildren(this);
|
|
}
|
|
|
|
EscriptParser::ModuleDeclarationStatementContext* EscriptParser::moduleDeclarationStatement() {
|
|
ModuleDeclarationStatementContext *_localctx = _tracker.createInstance<ModuleDeclarationStatementContext>(_ctx, getState());
|
|
enterRule(_localctx, 6, EscriptParser::RuleModuleDeclarationStatement);
|
|
|
|
#if __cplusplus > 201703L
|
|
auto onExit = finally([=, this] {
|
|
#else
|
|
auto onExit = finally([=] {
|
|
#endif
|
|
exitRule();
|
|
});
|
|
try {
|
|
setState(215);
|
|
_errHandler->sync(this);
|
|
switch (_input->LA(1)) {
|
|
case EscriptParser::IDENTIFIER: {
|
|
enterOuterAlt(_localctx, 1);
|
|
setState(213);
|
|
moduleFunctionDeclaration();
|
|
break;
|
|
}
|
|
|
|
case EscriptParser::TOK_CONST: {
|
|
enterOuterAlt(_localctx, 2);
|
|
setState(214);
|
|
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<EscriptParser::ModuleFunctionParameterListContext>(0);
|
|
}
|
|
|
|
|
|
size_t EscriptParser::ModuleFunctionDeclarationContext::getRuleIndex() const {
|
|
return EscriptParser::RuleModuleFunctionDeclaration;
|
|
}
|
|
|
|
void EscriptParser::ModuleFunctionDeclarationContext::enterRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->enterModuleFunctionDeclaration(this);
|
|
}
|
|
|
|
void EscriptParser::ModuleFunctionDeclarationContext::exitRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->exitModuleFunctionDeclaration(this);
|
|
}
|
|
|
|
|
|
std::any EscriptParser::ModuleFunctionDeclarationContext::accept(tree::ParseTreeVisitor *visitor) {
|
|
if (auto parserVisitor = dynamic_cast<EscriptParserVisitor*>(visitor))
|
|
return parserVisitor->visitModuleFunctionDeclaration(this);
|
|
else
|
|
return visitor->visitChildren(this);
|
|
}
|
|
|
|
EscriptParser::ModuleFunctionDeclarationContext* EscriptParser::moduleFunctionDeclaration() {
|
|
ModuleFunctionDeclarationContext *_localctx = _tracker.createInstance<ModuleFunctionDeclarationContext>(_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(217);
|
|
match(EscriptParser::IDENTIFIER);
|
|
setState(218);
|
|
match(EscriptParser::LPAREN);
|
|
setState(220);
|
|
_errHandler->sync(this);
|
|
|
|
_la = _input->LA(1);
|
|
if (_la == EscriptParser::IDENTIFIER) {
|
|
setState(219);
|
|
moduleFunctionParameterList();
|
|
}
|
|
setState(222);
|
|
match(EscriptParser::RPAREN);
|
|
setState(223);
|
|
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::ModuleFunctionParameterContext *> EscriptParser::ModuleFunctionParameterListContext::moduleFunctionParameter() {
|
|
return getRuleContexts<EscriptParser::ModuleFunctionParameterContext>();
|
|
}
|
|
|
|
EscriptParser::ModuleFunctionParameterContext* EscriptParser::ModuleFunctionParameterListContext::moduleFunctionParameter(size_t i) {
|
|
return getRuleContext<EscriptParser::ModuleFunctionParameterContext>(i);
|
|
}
|
|
|
|
std::vector<tree::TerminalNode *> 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<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->enterModuleFunctionParameterList(this);
|
|
}
|
|
|
|
void EscriptParser::ModuleFunctionParameterListContext::exitRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->exitModuleFunctionParameterList(this);
|
|
}
|
|
|
|
|
|
std::any EscriptParser::ModuleFunctionParameterListContext::accept(tree::ParseTreeVisitor *visitor) {
|
|
if (auto parserVisitor = dynamic_cast<EscriptParserVisitor*>(visitor))
|
|
return parserVisitor->visitModuleFunctionParameterList(this);
|
|
else
|
|
return visitor->visitChildren(this);
|
|
}
|
|
|
|
EscriptParser::ModuleFunctionParameterListContext* EscriptParser::moduleFunctionParameterList() {
|
|
ModuleFunctionParameterListContext *_localctx = _tracker.createInstance<ModuleFunctionParameterListContext>(_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(225);
|
|
moduleFunctionParameter();
|
|
setState(230);
|
|
_errHandler->sync(this);
|
|
_la = _input->LA(1);
|
|
while (_la == EscriptParser::COMMA) {
|
|
setState(226);
|
|
match(EscriptParser::COMMA);
|
|
setState(227);
|
|
moduleFunctionParameter();
|
|
setState(232);
|
|
_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<EscriptParser::ExpressionContext>(0);
|
|
}
|
|
|
|
|
|
size_t EscriptParser::ModuleFunctionParameterContext::getRuleIndex() const {
|
|
return EscriptParser::RuleModuleFunctionParameter;
|
|
}
|
|
|
|
void EscriptParser::ModuleFunctionParameterContext::enterRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->enterModuleFunctionParameter(this);
|
|
}
|
|
|
|
void EscriptParser::ModuleFunctionParameterContext::exitRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->exitModuleFunctionParameter(this);
|
|
}
|
|
|
|
|
|
std::any EscriptParser::ModuleFunctionParameterContext::accept(tree::ParseTreeVisitor *visitor) {
|
|
if (auto parserVisitor = dynamic_cast<EscriptParserVisitor*>(visitor))
|
|
return parserVisitor->visitModuleFunctionParameter(this);
|
|
else
|
|
return visitor->visitChildren(this);
|
|
}
|
|
|
|
EscriptParser::ModuleFunctionParameterContext* EscriptParser::moduleFunctionParameter() {
|
|
ModuleFunctionParameterContext *_localctx = _tracker.createInstance<ModuleFunctionParameterContext>(_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(233);
|
|
match(EscriptParser::IDENTIFIER);
|
|
setState(236);
|
|
_errHandler->sync(this);
|
|
|
|
_la = _input->LA(1);
|
|
if (_la == EscriptParser::ASSIGN) {
|
|
setState(234);
|
|
match(EscriptParser::ASSIGN);
|
|
setState(235);
|
|
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<EscriptParser::UseDeclarationContext>(0);
|
|
}
|
|
|
|
EscriptParser::IncludeDeclarationContext* EscriptParser::TopLevelDeclarationContext::includeDeclaration() {
|
|
return getRuleContext<EscriptParser::IncludeDeclarationContext>(0);
|
|
}
|
|
|
|
EscriptParser::ProgramDeclarationContext* EscriptParser::TopLevelDeclarationContext::programDeclaration() {
|
|
return getRuleContext<EscriptParser::ProgramDeclarationContext>(0);
|
|
}
|
|
|
|
EscriptParser::FunctionDeclarationContext* EscriptParser::TopLevelDeclarationContext::functionDeclaration() {
|
|
return getRuleContext<EscriptParser::FunctionDeclarationContext>(0);
|
|
}
|
|
|
|
EscriptParser::ClassDeclarationContext* EscriptParser::TopLevelDeclarationContext::classDeclaration() {
|
|
return getRuleContext<EscriptParser::ClassDeclarationContext>(0);
|
|
}
|
|
|
|
EscriptParser::StatementContext* EscriptParser::TopLevelDeclarationContext::statement() {
|
|
return getRuleContext<EscriptParser::StatementContext>(0);
|
|
}
|
|
|
|
|
|
size_t EscriptParser::TopLevelDeclarationContext::getRuleIndex() const {
|
|
return EscriptParser::RuleTopLevelDeclaration;
|
|
}
|
|
|
|
void EscriptParser::TopLevelDeclarationContext::enterRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->enterTopLevelDeclaration(this);
|
|
}
|
|
|
|
void EscriptParser::TopLevelDeclarationContext::exitRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->exitTopLevelDeclaration(this);
|
|
}
|
|
|
|
|
|
std::any EscriptParser::TopLevelDeclarationContext::accept(tree::ParseTreeVisitor *visitor) {
|
|
if (auto parserVisitor = dynamic_cast<EscriptParserVisitor*>(visitor))
|
|
return parserVisitor->visitTopLevelDeclaration(this);
|
|
else
|
|
return visitor->visitChildren(this);
|
|
}
|
|
|
|
EscriptParser::TopLevelDeclarationContext* EscriptParser::topLevelDeclaration() {
|
|
TopLevelDeclarationContext *_localctx = _tracker.createInstance<TopLevelDeclarationContext>(_ctx, getState());
|
|
enterRule(_localctx, 14, EscriptParser::RuleTopLevelDeclaration);
|
|
|
|
#if __cplusplus > 201703L
|
|
auto onExit = finally([=, this] {
|
|
#else
|
|
auto onExit = finally([=] {
|
|
#endif
|
|
exitRule();
|
|
});
|
|
try {
|
|
setState(244);
|
|
_errHandler->sync(this);
|
|
switch (_input->LA(1)) {
|
|
case EscriptParser::USE: {
|
|
enterOuterAlt(_localctx, 1);
|
|
setState(238);
|
|
useDeclaration();
|
|
break;
|
|
}
|
|
|
|
case EscriptParser::INCLUDE: {
|
|
enterOuterAlt(_localctx, 2);
|
|
setState(239);
|
|
includeDeclaration();
|
|
break;
|
|
}
|
|
|
|
case EscriptParser::PROGRAM: {
|
|
enterOuterAlt(_localctx, 3);
|
|
setState(240);
|
|
programDeclaration();
|
|
break;
|
|
}
|
|
|
|
case EscriptParser::FUNCTION:
|
|
case EscriptParser::EXPORTED: {
|
|
enterOuterAlt(_localctx, 4);
|
|
setState(241);
|
|
functionDeclaration();
|
|
break;
|
|
}
|
|
|
|
case EscriptParser::CLASS: {
|
|
enterOuterAlt(_localctx, 5);
|
|
setState(242);
|
|
classDeclaration();
|
|
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::REGEXP_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::COLONCOLON:
|
|
case EscriptParser::INC:
|
|
case EscriptParser::DEC:
|
|
case EscriptParser::IDENTIFIER: {
|
|
enterOuterAlt(_localctx, 6);
|
|
setState(243);
|
|
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;
|
|
}
|
|
|
|
//----------------- ClassDeclarationContext ------------------------------------------------------------------
|
|
|
|
EscriptParser::ClassDeclarationContext::ClassDeclarationContext(ParserRuleContext *parent, size_t invokingState)
|
|
: ParserRuleContext(parent, invokingState) {
|
|
}
|
|
|
|
tree::TerminalNode* EscriptParser::ClassDeclarationContext::CLASS() {
|
|
return getToken(EscriptParser::CLASS, 0);
|
|
}
|
|
|
|
tree::TerminalNode* EscriptParser::ClassDeclarationContext::IDENTIFIER() {
|
|
return getToken(EscriptParser::IDENTIFIER, 0);
|
|
}
|
|
|
|
EscriptParser::ClassParametersContext* EscriptParser::ClassDeclarationContext::classParameters() {
|
|
return getRuleContext<EscriptParser::ClassParametersContext>(0);
|
|
}
|
|
|
|
EscriptParser::ClassBodyContext* EscriptParser::ClassDeclarationContext::classBody() {
|
|
return getRuleContext<EscriptParser::ClassBodyContext>(0);
|
|
}
|
|
|
|
tree::TerminalNode* EscriptParser::ClassDeclarationContext::ENDCLASS() {
|
|
return getToken(EscriptParser::ENDCLASS, 0);
|
|
}
|
|
|
|
|
|
size_t EscriptParser::ClassDeclarationContext::getRuleIndex() const {
|
|
return EscriptParser::RuleClassDeclaration;
|
|
}
|
|
|
|
void EscriptParser::ClassDeclarationContext::enterRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->enterClassDeclaration(this);
|
|
}
|
|
|
|
void EscriptParser::ClassDeclarationContext::exitRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->exitClassDeclaration(this);
|
|
}
|
|
|
|
|
|
std::any EscriptParser::ClassDeclarationContext::accept(tree::ParseTreeVisitor *visitor) {
|
|
if (auto parserVisitor = dynamic_cast<EscriptParserVisitor*>(visitor))
|
|
return parserVisitor->visitClassDeclaration(this);
|
|
else
|
|
return visitor->visitChildren(this);
|
|
}
|
|
|
|
EscriptParser::ClassDeclarationContext* EscriptParser::classDeclaration() {
|
|
ClassDeclarationContext *_localctx = _tracker.createInstance<ClassDeclarationContext>(_ctx, getState());
|
|
enterRule(_localctx, 16, EscriptParser::RuleClassDeclaration);
|
|
|
|
#if __cplusplus > 201703L
|
|
auto onExit = finally([=, this] {
|
|
#else
|
|
auto onExit = finally([=] {
|
|
#endif
|
|
exitRule();
|
|
});
|
|
try {
|
|
enterOuterAlt(_localctx, 1);
|
|
setState(246);
|
|
match(EscriptParser::CLASS);
|
|
setState(247);
|
|
match(EscriptParser::IDENTIFIER);
|
|
setState(248);
|
|
classParameters();
|
|
setState(249);
|
|
classBody();
|
|
setState(250);
|
|
match(EscriptParser::ENDCLASS);
|
|
|
|
}
|
|
catch (RecognitionException &e) {
|
|
_errHandler->reportError(this, e);
|
|
_localctx->exception = std::current_exception();
|
|
_errHandler->recover(this, _localctx->exception);
|
|
}
|
|
|
|
return _localctx;
|
|
}
|
|
|
|
//----------------- ClassParametersContext ------------------------------------------------------------------
|
|
|
|
EscriptParser::ClassParametersContext::ClassParametersContext(ParserRuleContext *parent, size_t invokingState)
|
|
: ParserRuleContext(parent, invokingState) {
|
|
}
|
|
|
|
tree::TerminalNode* EscriptParser::ClassParametersContext::LPAREN() {
|
|
return getToken(EscriptParser::LPAREN, 0);
|
|
}
|
|
|
|
tree::TerminalNode* EscriptParser::ClassParametersContext::RPAREN() {
|
|
return getToken(EscriptParser::RPAREN, 0);
|
|
}
|
|
|
|
EscriptParser::ClassParameterListContext* EscriptParser::ClassParametersContext::classParameterList() {
|
|
return getRuleContext<EscriptParser::ClassParameterListContext>(0);
|
|
}
|
|
|
|
|
|
size_t EscriptParser::ClassParametersContext::getRuleIndex() const {
|
|
return EscriptParser::RuleClassParameters;
|
|
}
|
|
|
|
void EscriptParser::ClassParametersContext::enterRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->enterClassParameters(this);
|
|
}
|
|
|
|
void EscriptParser::ClassParametersContext::exitRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->exitClassParameters(this);
|
|
}
|
|
|
|
|
|
std::any EscriptParser::ClassParametersContext::accept(tree::ParseTreeVisitor *visitor) {
|
|
if (auto parserVisitor = dynamic_cast<EscriptParserVisitor*>(visitor))
|
|
return parserVisitor->visitClassParameters(this);
|
|
else
|
|
return visitor->visitChildren(this);
|
|
}
|
|
|
|
EscriptParser::ClassParametersContext* EscriptParser::classParameters() {
|
|
ClassParametersContext *_localctx = _tracker.createInstance<ClassParametersContext>(_ctx, getState());
|
|
enterRule(_localctx, 18, EscriptParser::RuleClassParameters);
|
|
size_t _la = 0;
|
|
|
|
#if __cplusplus > 201703L
|
|
auto onExit = finally([=, this] {
|
|
#else
|
|
auto onExit = finally([=] {
|
|
#endif
|
|
exitRule();
|
|
});
|
|
try {
|
|
enterOuterAlt(_localctx, 1);
|
|
setState(252);
|
|
match(EscriptParser::LPAREN);
|
|
setState(254);
|
|
_errHandler->sync(this);
|
|
|
|
_la = _input->LA(1);
|
|
if (_la == EscriptParser::IDENTIFIER) {
|
|
setState(253);
|
|
classParameterList();
|
|
}
|
|
setState(256);
|
|
match(EscriptParser::RPAREN);
|
|
|
|
}
|
|
catch (RecognitionException &e) {
|
|
_errHandler->reportError(this, e);
|
|
_localctx->exception = std::current_exception();
|
|
_errHandler->recover(this, _localctx->exception);
|
|
}
|
|
|
|
return _localctx;
|
|
}
|
|
|
|
//----------------- ClassParameterListContext ------------------------------------------------------------------
|
|
|
|
EscriptParser::ClassParameterListContext::ClassParameterListContext(ParserRuleContext *parent, size_t invokingState)
|
|
: ParserRuleContext(parent, invokingState) {
|
|
}
|
|
|
|
std::vector<tree::TerminalNode *> EscriptParser::ClassParameterListContext::IDENTIFIER() {
|
|
return getTokens(EscriptParser::IDENTIFIER);
|
|
}
|
|
|
|
tree::TerminalNode* EscriptParser::ClassParameterListContext::IDENTIFIER(size_t i) {
|
|
return getToken(EscriptParser::IDENTIFIER, i);
|
|
}
|
|
|
|
std::vector<tree::TerminalNode *> EscriptParser::ClassParameterListContext::COMMA() {
|
|
return getTokens(EscriptParser::COMMA);
|
|
}
|
|
|
|
tree::TerminalNode* EscriptParser::ClassParameterListContext::COMMA(size_t i) {
|
|
return getToken(EscriptParser::COMMA, i);
|
|
}
|
|
|
|
|
|
size_t EscriptParser::ClassParameterListContext::getRuleIndex() const {
|
|
return EscriptParser::RuleClassParameterList;
|
|
}
|
|
|
|
void EscriptParser::ClassParameterListContext::enterRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->enterClassParameterList(this);
|
|
}
|
|
|
|
void EscriptParser::ClassParameterListContext::exitRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->exitClassParameterList(this);
|
|
}
|
|
|
|
|
|
std::any EscriptParser::ClassParameterListContext::accept(tree::ParseTreeVisitor *visitor) {
|
|
if (auto parserVisitor = dynamic_cast<EscriptParserVisitor*>(visitor))
|
|
return parserVisitor->visitClassParameterList(this);
|
|
else
|
|
return visitor->visitChildren(this);
|
|
}
|
|
|
|
EscriptParser::ClassParameterListContext* EscriptParser::classParameterList() {
|
|
ClassParameterListContext *_localctx = _tracker.createInstance<ClassParameterListContext>(_ctx, getState());
|
|
enterRule(_localctx, 20, EscriptParser::RuleClassParameterList);
|
|
size_t _la = 0;
|
|
|
|
#if __cplusplus > 201703L
|
|
auto onExit = finally([=, this] {
|
|
#else
|
|
auto onExit = finally([=] {
|
|
#endif
|
|
exitRule();
|
|
});
|
|
try {
|
|
enterOuterAlt(_localctx, 1);
|
|
setState(258);
|
|
match(EscriptParser::IDENTIFIER);
|
|
setState(263);
|
|
_errHandler->sync(this);
|
|
_la = _input->LA(1);
|
|
while (_la == EscriptParser::COMMA) {
|
|
setState(259);
|
|
match(EscriptParser::COMMA);
|
|
setState(260);
|
|
match(EscriptParser::IDENTIFIER);
|
|
setState(265);
|
|
_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;
|
|
}
|
|
|
|
//----------------- ClassBodyContext ------------------------------------------------------------------
|
|
|
|
EscriptParser::ClassBodyContext::ClassBodyContext(ParserRuleContext *parent, size_t invokingState)
|
|
: ParserRuleContext(parent, invokingState) {
|
|
}
|
|
|
|
std::vector<EscriptParser::ClassStatementContext *> EscriptParser::ClassBodyContext::classStatement() {
|
|
return getRuleContexts<EscriptParser::ClassStatementContext>();
|
|
}
|
|
|
|
EscriptParser::ClassStatementContext* EscriptParser::ClassBodyContext::classStatement(size_t i) {
|
|
return getRuleContext<EscriptParser::ClassStatementContext>(i);
|
|
}
|
|
|
|
|
|
size_t EscriptParser::ClassBodyContext::getRuleIndex() const {
|
|
return EscriptParser::RuleClassBody;
|
|
}
|
|
|
|
void EscriptParser::ClassBodyContext::enterRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->enterClassBody(this);
|
|
}
|
|
|
|
void EscriptParser::ClassBodyContext::exitRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->exitClassBody(this);
|
|
}
|
|
|
|
|
|
std::any EscriptParser::ClassBodyContext::accept(tree::ParseTreeVisitor *visitor) {
|
|
if (auto parserVisitor = dynamic_cast<EscriptParserVisitor*>(visitor))
|
|
return parserVisitor->visitClassBody(this);
|
|
else
|
|
return visitor->visitChildren(this);
|
|
}
|
|
|
|
EscriptParser::ClassBodyContext* EscriptParser::classBody() {
|
|
ClassBodyContext *_localctx = _tracker.createInstance<ClassBodyContext>(_ctx, getState());
|
|
enterRule(_localctx, 22, EscriptParser::RuleClassBody);
|
|
size_t _la = 0;
|
|
|
|
#if __cplusplus > 201703L
|
|
auto onExit = finally([=, this] {
|
|
#else
|
|
auto onExit = finally([=] {
|
|
#endif
|
|
exitRule();
|
|
});
|
|
try {
|
|
enterOuterAlt(_localctx, 1);
|
|
setState(269);
|
|
_errHandler->sync(this);
|
|
_la = _input->LA(1);
|
|
while (((((_la - 9) & ~ 0x3fULL) == 0) &&
|
|
((1ULL << (_la - 9)) & 1152921504606847297) != 0)) {
|
|
setState(266);
|
|
classStatement();
|
|
setState(271);
|
|
_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;
|
|
}
|
|
|
|
//----------------- ClassStatementContext ------------------------------------------------------------------
|
|
|
|
EscriptParser::ClassStatementContext::ClassStatementContext(ParserRuleContext *parent, size_t invokingState)
|
|
: ParserRuleContext(parent, invokingState) {
|
|
}
|
|
|
|
EscriptParser::FunctionDeclarationContext* EscriptParser::ClassStatementContext::functionDeclaration() {
|
|
return getRuleContext<EscriptParser::FunctionDeclarationContext>(0);
|
|
}
|
|
|
|
EscriptParser::VarStatementContext* EscriptParser::ClassStatementContext::varStatement() {
|
|
return getRuleContext<EscriptParser::VarStatementContext>(0);
|
|
}
|
|
|
|
EscriptParser::UninitFunctionDeclarationContext* EscriptParser::ClassStatementContext::uninitFunctionDeclaration() {
|
|
return getRuleContext<EscriptParser::UninitFunctionDeclarationContext>(0);
|
|
}
|
|
|
|
|
|
size_t EscriptParser::ClassStatementContext::getRuleIndex() const {
|
|
return EscriptParser::RuleClassStatement;
|
|
}
|
|
|
|
void EscriptParser::ClassStatementContext::enterRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->enterClassStatement(this);
|
|
}
|
|
|
|
void EscriptParser::ClassStatementContext::exitRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->exitClassStatement(this);
|
|
}
|
|
|
|
|
|
std::any EscriptParser::ClassStatementContext::accept(tree::ParseTreeVisitor *visitor) {
|
|
if (auto parserVisitor = dynamic_cast<EscriptParserVisitor*>(visitor))
|
|
return parserVisitor->visitClassStatement(this);
|
|
else
|
|
return visitor->visitChildren(this);
|
|
}
|
|
|
|
EscriptParser::ClassStatementContext* EscriptParser::classStatement() {
|
|
ClassStatementContext *_localctx = _tracker.createInstance<ClassStatementContext>(_ctx, getState());
|
|
enterRule(_localctx, 24, EscriptParser::RuleClassStatement);
|
|
|
|
#if __cplusplus > 201703L
|
|
auto onExit = finally([=, this] {
|
|
#else
|
|
auto onExit = finally([=] {
|
|
#endif
|
|
exitRule();
|
|
});
|
|
try {
|
|
setState(275);
|
|
_errHandler->sync(this);
|
|
switch (_input->LA(1)) {
|
|
case EscriptParser::FUNCTION:
|
|
case EscriptParser::EXPORTED: {
|
|
enterOuterAlt(_localctx, 1);
|
|
setState(272);
|
|
functionDeclaration();
|
|
break;
|
|
}
|
|
|
|
case EscriptParser::VAR: {
|
|
enterOuterAlt(_localctx, 2);
|
|
setState(273);
|
|
varStatement();
|
|
break;
|
|
}
|
|
|
|
case EscriptParser::UNINIT: {
|
|
enterOuterAlt(_localctx, 3);
|
|
setState(274);
|
|
uninitFunctionDeclaration();
|
|
break;
|
|
}
|
|
|
|
default:
|
|
throw NoViableAltException(this);
|
|
}
|
|
|
|
}
|
|
catch (RecognitionException &e) {
|
|
_errHandler->reportError(this, e);
|
|
_localctx->exception = std::current_exception();
|
|
_errHandler->recover(this, _localctx->exception);
|
|
}
|
|
|
|
return _localctx;
|
|
}
|
|
|
|
//----------------- UninitFunctionDeclarationContext ------------------------------------------------------------------
|
|
|
|
EscriptParser::UninitFunctionDeclarationContext::UninitFunctionDeclarationContext(ParserRuleContext *parent, size_t invokingState)
|
|
: ParserRuleContext(parent, invokingState) {
|
|
}
|
|
|
|
tree::TerminalNode* EscriptParser::UninitFunctionDeclarationContext::UNINIT() {
|
|
return getToken(EscriptParser::UNINIT, 0);
|
|
}
|
|
|
|
tree::TerminalNode* EscriptParser::UninitFunctionDeclarationContext::FUNCTION() {
|
|
return getToken(EscriptParser::FUNCTION, 0);
|
|
}
|
|
|
|
tree::TerminalNode* EscriptParser::UninitFunctionDeclarationContext::IDENTIFIER() {
|
|
return getToken(EscriptParser::IDENTIFIER, 0);
|
|
}
|
|
|
|
EscriptParser::FunctionParametersContext* EscriptParser::UninitFunctionDeclarationContext::functionParameters() {
|
|
return getRuleContext<EscriptParser::FunctionParametersContext>(0);
|
|
}
|
|
|
|
tree::TerminalNode* EscriptParser::UninitFunctionDeclarationContext::SEMI() {
|
|
return getToken(EscriptParser::SEMI, 0);
|
|
}
|
|
|
|
|
|
size_t EscriptParser::UninitFunctionDeclarationContext::getRuleIndex() const {
|
|
return EscriptParser::RuleUninitFunctionDeclaration;
|
|
}
|
|
|
|
void EscriptParser::UninitFunctionDeclarationContext::enterRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->enterUninitFunctionDeclaration(this);
|
|
}
|
|
|
|
void EscriptParser::UninitFunctionDeclarationContext::exitRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->exitUninitFunctionDeclaration(this);
|
|
}
|
|
|
|
|
|
std::any EscriptParser::UninitFunctionDeclarationContext::accept(tree::ParseTreeVisitor *visitor) {
|
|
if (auto parserVisitor = dynamic_cast<EscriptParserVisitor*>(visitor))
|
|
return parserVisitor->visitUninitFunctionDeclaration(this);
|
|
else
|
|
return visitor->visitChildren(this);
|
|
}
|
|
|
|
EscriptParser::UninitFunctionDeclarationContext* EscriptParser::uninitFunctionDeclaration() {
|
|
UninitFunctionDeclarationContext *_localctx = _tracker.createInstance<UninitFunctionDeclarationContext>(_ctx, getState());
|
|
enterRule(_localctx, 26, EscriptParser::RuleUninitFunctionDeclaration);
|
|
|
|
#if __cplusplus > 201703L
|
|
auto onExit = finally([=, this] {
|
|
#else
|
|
auto onExit = finally([=] {
|
|
#endif
|
|
exitRule();
|
|
});
|
|
try {
|
|
enterOuterAlt(_localctx, 1);
|
|
setState(277);
|
|
match(EscriptParser::UNINIT);
|
|
setState(278);
|
|
match(EscriptParser::FUNCTION);
|
|
setState(279);
|
|
match(EscriptParser::IDENTIFIER);
|
|
inUninitFunction = true;
|
|
setState(281);
|
|
functionParameters();
|
|
setState(282);
|
|
match(EscriptParser::SEMI);
|
|
|
|
}
|
|
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<EscriptParser::FunctionParametersContext>(0);
|
|
}
|
|
|
|
EscriptParser::BlockContext* EscriptParser::FunctionDeclarationContext::block() {
|
|
return getRuleContext<EscriptParser::BlockContext>(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<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->enterFunctionDeclaration(this);
|
|
}
|
|
|
|
void EscriptParser::FunctionDeclarationContext::exitRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->exitFunctionDeclaration(this);
|
|
}
|
|
|
|
|
|
std::any EscriptParser::FunctionDeclarationContext::accept(tree::ParseTreeVisitor *visitor) {
|
|
if (auto parserVisitor = dynamic_cast<EscriptParserVisitor*>(visitor))
|
|
return parserVisitor->visitFunctionDeclaration(this);
|
|
else
|
|
return visitor->visitChildren(this);
|
|
}
|
|
|
|
EscriptParser::FunctionDeclarationContext* EscriptParser::functionDeclaration() {
|
|
FunctionDeclarationContext *_localctx = _tracker.createInstance<FunctionDeclarationContext>(_ctx, getState());
|
|
enterRule(_localctx, 28, EscriptParser::RuleFunctionDeclaration);
|
|
size_t _la = 0;
|
|
|
|
#if __cplusplus > 201703L
|
|
auto onExit = finally([=, this] {
|
|
#else
|
|
auto onExit = finally([=] {
|
|
#endif
|
|
exitRule();
|
|
});
|
|
try {
|
|
enterOuterAlt(_localctx, 1);
|
|
setState(285);
|
|
_errHandler->sync(this);
|
|
|
|
_la = _input->LA(1);
|
|
if (_la == EscriptParser::EXPORTED) {
|
|
setState(284);
|
|
match(EscriptParser::EXPORTED);
|
|
}
|
|
setState(287);
|
|
match(EscriptParser::FUNCTION);
|
|
setState(288);
|
|
match(EscriptParser::IDENTIFIER);
|
|
inUninitFunction = false;
|
|
setState(290);
|
|
functionParameters();
|
|
setState(291);
|
|
block();
|
|
setState(292);
|
|
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<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->enterStringIdentifier(this);
|
|
}
|
|
|
|
void EscriptParser::StringIdentifierContext::exitRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->exitStringIdentifier(this);
|
|
}
|
|
|
|
|
|
std::any EscriptParser::StringIdentifierContext::accept(tree::ParseTreeVisitor *visitor) {
|
|
if (auto parserVisitor = dynamic_cast<EscriptParserVisitor*>(visitor))
|
|
return parserVisitor->visitStringIdentifier(this);
|
|
else
|
|
return visitor->visitChildren(this);
|
|
}
|
|
|
|
EscriptParser::StringIdentifierContext* EscriptParser::stringIdentifier() {
|
|
StringIdentifierContext *_localctx = _tracker.createInstance<StringIdentifierContext>(_ctx, getState());
|
|
enterRule(_localctx, 30, EscriptParser::RuleStringIdentifier);
|
|
size_t _la = 0;
|
|
|
|
#if __cplusplus > 201703L
|
|
auto onExit = finally([=, this] {
|
|
#else
|
|
auto onExit = finally([=] {
|
|
#endif
|
|
exitRule();
|
|
});
|
|
try {
|
|
enterOuterAlt(_localctx, 1);
|
|
setState(294);
|
|
_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<EscriptParser::StringIdentifierContext>(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<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->enterUseDeclaration(this);
|
|
}
|
|
|
|
void EscriptParser::UseDeclarationContext::exitRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->exitUseDeclaration(this);
|
|
}
|
|
|
|
|
|
std::any EscriptParser::UseDeclarationContext::accept(tree::ParseTreeVisitor *visitor) {
|
|
if (auto parserVisitor = dynamic_cast<EscriptParserVisitor*>(visitor))
|
|
return parserVisitor->visitUseDeclaration(this);
|
|
else
|
|
return visitor->visitChildren(this);
|
|
}
|
|
|
|
EscriptParser::UseDeclarationContext* EscriptParser::useDeclaration() {
|
|
UseDeclarationContext *_localctx = _tracker.createInstance<UseDeclarationContext>(_ctx, getState());
|
|
enterRule(_localctx, 32, EscriptParser::RuleUseDeclaration);
|
|
|
|
#if __cplusplus > 201703L
|
|
auto onExit = finally([=, this] {
|
|
#else
|
|
auto onExit = finally([=] {
|
|
#endif
|
|
exitRule();
|
|
});
|
|
try {
|
|
enterOuterAlt(_localctx, 1);
|
|
setState(296);
|
|
match(EscriptParser::USE);
|
|
setState(297);
|
|
stringIdentifier();
|
|
setState(298);
|
|
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<EscriptParser::StringIdentifierContext>(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<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->enterIncludeDeclaration(this);
|
|
}
|
|
|
|
void EscriptParser::IncludeDeclarationContext::exitRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->exitIncludeDeclaration(this);
|
|
}
|
|
|
|
|
|
std::any EscriptParser::IncludeDeclarationContext::accept(tree::ParseTreeVisitor *visitor) {
|
|
if (auto parserVisitor = dynamic_cast<EscriptParserVisitor*>(visitor))
|
|
return parserVisitor->visitIncludeDeclaration(this);
|
|
else
|
|
return visitor->visitChildren(this);
|
|
}
|
|
|
|
EscriptParser::IncludeDeclarationContext* EscriptParser::includeDeclaration() {
|
|
IncludeDeclarationContext *_localctx = _tracker.createInstance<IncludeDeclarationContext>(_ctx, getState());
|
|
enterRule(_localctx, 34, EscriptParser::RuleIncludeDeclaration);
|
|
|
|
#if __cplusplus > 201703L
|
|
auto onExit = finally([=, this] {
|
|
#else
|
|
auto onExit = finally([=] {
|
|
#endif
|
|
exitRule();
|
|
});
|
|
try {
|
|
enterOuterAlt(_localctx, 1);
|
|
setState(300);
|
|
match(EscriptParser::INCLUDE);
|
|
setState(301);
|
|
stringIdentifier();
|
|
setState(302);
|
|
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<EscriptParser::ProgramParametersContext>(0);
|
|
}
|
|
|
|
EscriptParser::BlockContext* EscriptParser::ProgramDeclarationContext::block() {
|
|
return getRuleContext<EscriptParser::BlockContext>(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<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->enterProgramDeclaration(this);
|
|
}
|
|
|
|
void EscriptParser::ProgramDeclarationContext::exitRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->exitProgramDeclaration(this);
|
|
}
|
|
|
|
|
|
std::any EscriptParser::ProgramDeclarationContext::accept(tree::ParseTreeVisitor *visitor) {
|
|
if (auto parserVisitor = dynamic_cast<EscriptParserVisitor*>(visitor))
|
|
return parserVisitor->visitProgramDeclaration(this);
|
|
else
|
|
return visitor->visitChildren(this);
|
|
}
|
|
|
|
EscriptParser::ProgramDeclarationContext* EscriptParser::programDeclaration() {
|
|
ProgramDeclarationContext *_localctx = _tracker.createInstance<ProgramDeclarationContext>(_ctx, getState());
|
|
enterRule(_localctx, 36, EscriptParser::RuleProgramDeclaration);
|
|
|
|
#if __cplusplus > 201703L
|
|
auto onExit = finally([=, this] {
|
|
#else
|
|
auto onExit = finally([=] {
|
|
#endif
|
|
exitRule();
|
|
});
|
|
try {
|
|
enterOuterAlt(_localctx, 1);
|
|
setState(304);
|
|
match(EscriptParser::PROGRAM);
|
|
setState(305);
|
|
match(EscriptParser::IDENTIFIER);
|
|
setState(306);
|
|
programParameters();
|
|
setState(307);
|
|
block();
|
|
setState(308);
|
|
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<EscriptParser::IfStatementContext>(0);
|
|
}
|
|
|
|
EscriptParser::GotoStatementContext* EscriptParser::StatementContext::gotoStatement() {
|
|
return getRuleContext<EscriptParser::GotoStatementContext>(0);
|
|
}
|
|
|
|
EscriptParser::ReturnStatementContext* EscriptParser::StatementContext::returnStatement() {
|
|
return getRuleContext<EscriptParser::ReturnStatementContext>(0);
|
|
}
|
|
|
|
EscriptParser::ConstStatementContext* EscriptParser::StatementContext::constStatement() {
|
|
return getRuleContext<EscriptParser::ConstStatementContext>(0);
|
|
}
|
|
|
|
EscriptParser::VarStatementContext* EscriptParser::StatementContext::varStatement() {
|
|
return getRuleContext<EscriptParser::VarStatementContext>(0);
|
|
}
|
|
|
|
EscriptParser::DoStatementContext* EscriptParser::StatementContext::doStatement() {
|
|
return getRuleContext<EscriptParser::DoStatementContext>(0);
|
|
}
|
|
|
|
EscriptParser::WhileStatementContext* EscriptParser::StatementContext::whileStatement() {
|
|
return getRuleContext<EscriptParser::WhileStatementContext>(0);
|
|
}
|
|
|
|
EscriptParser::ExitStatementContext* EscriptParser::StatementContext::exitStatement() {
|
|
return getRuleContext<EscriptParser::ExitStatementContext>(0);
|
|
}
|
|
|
|
EscriptParser::BreakStatementContext* EscriptParser::StatementContext::breakStatement() {
|
|
return getRuleContext<EscriptParser::BreakStatementContext>(0);
|
|
}
|
|
|
|
EscriptParser::ContinueStatementContext* EscriptParser::StatementContext::continueStatement() {
|
|
return getRuleContext<EscriptParser::ContinueStatementContext>(0);
|
|
}
|
|
|
|
EscriptParser::ForStatementContext* EscriptParser::StatementContext::forStatement() {
|
|
return getRuleContext<EscriptParser::ForStatementContext>(0);
|
|
}
|
|
|
|
EscriptParser::ForeachStatementContext* EscriptParser::StatementContext::foreachStatement() {
|
|
return getRuleContext<EscriptParser::ForeachStatementContext>(0);
|
|
}
|
|
|
|
EscriptParser::RepeatStatementContext* EscriptParser::StatementContext::repeatStatement() {
|
|
return getRuleContext<EscriptParser::RepeatStatementContext>(0);
|
|
}
|
|
|
|
EscriptParser::CaseStatementContext* EscriptParser::StatementContext::caseStatement() {
|
|
return getRuleContext<EscriptParser::CaseStatementContext>(0);
|
|
}
|
|
|
|
EscriptParser::EnumStatementContext* EscriptParser::StatementContext::enumStatement() {
|
|
return getRuleContext<EscriptParser::EnumStatementContext>(0);
|
|
}
|
|
|
|
tree::TerminalNode* EscriptParser::StatementContext::SEMI() {
|
|
return getToken(EscriptParser::SEMI, 0);
|
|
}
|
|
|
|
EscriptParser::ExpressionContext* EscriptParser::StatementContext::expression() {
|
|
return getRuleContext<EscriptParser::ExpressionContext>(0);
|
|
}
|
|
|
|
|
|
size_t EscriptParser::StatementContext::getRuleIndex() const {
|
|
return EscriptParser::RuleStatement;
|
|
}
|
|
|
|
void EscriptParser::StatementContext::enterRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->enterStatement(this);
|
|
}
|
|
|
|
void EscriptParser::StatementContext::exitRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->exitStatement(this);
|
|
}
|
|
|
|
|
|
std::any EscriptParser::StatementContext::accept(tree::ParseTreeVisitor *visitor) {
|
|
if (auto parserVisitor = dynamic_cast<EscriptParserVisitor*>(visitor))
|
|
return parserVisitor->visitStatement(this);
|
|
else
|
|
return visitor->visitChildren(this);
|
|
}
|
|
|
|
EscriptParser::StatementContext* EscriptParser::statement() {
|
|
StatementContext *_localctx = _tracker.createInstance<StatementContext>(_ctx, getState());
|
|
enterRule(_localctx, 38, EscriptParser::RuleStatement);
|
|
|
|
#if __cplusplus > 201703L
|
|
auto onExit = finally([=, this] {
|
|
#else
|
|
auto onExit = finally([=] {
|
|
#endif
|
|
exitRule();
|
|
});
|
|
try {
|
|
setState(329);
|
|
_errHandler->sync(this);
|
|
switch (getInterpreter<atn::ParserATNSimulator>()->adaptivePredict(_input, 12, _ctx)) {
|
|
case 1: {
|
|
enterOuterAlt(_localctx, 1);
|
|
setState(310);
|
|
ifStatement();
|
|
break;
|
|
}
|
|
|
|
case 2: {
|
|
enterOuterAlt(_localctx, 2);
|
|
setState(311);
|
|
gotoStatement();
|
|
break;
|
|
}
|
|
|
|
case 3: {
|
|
enterOuterAlt(_localctx, 3);
|
|
setState(312);
|
|
returnStatement();
|
|
break;
|
|
}
|
|
|
|
case 4: {
|
|
enterOuterAlt(_localctx, 4);
|
|
setState(313);
|
|
constStatement();
|
|
break;
|
|
}
|
|
|
|
case 5: {
|
|
enterOuterAlt(_localctx, 5);
|
|
setState(314);
|
|
varStatement();
|
|
break;
|
|
}
|
|
|
|
case 6: {
|
|
enterOuterAlt(_localctx, 6);
|
|
setState(315);
|
|
doStatement();
|
|
break;
|
|
}
|
|
|
|
case 7: {
|
|
enterOuterAlt(_localctx, 7);
|
|
setState(316);
|
|
whileStatement();
|
|
break;
|
|
}
|
|
|
|
case 8: {
|
|
enterOuterAlt(_localctx, 8);
|
|
setState(317);
|
|
exitStatement();
|
|
break;
|
|
}
|
|
|
|
case 9: {
|
|
enterOuterAlt(_localctx, 9);
|
|
setState(318);
|
|
breakStatement();
|
|
break;
|
|
}
|
|
|
|
case 10: {
|
|
enterOuterAlt(_localctx, 10);
|
|
setState(319);
|
|
continueStatement();
|
|
break;
|
|
}
|
|
|
|
case 11: {
|
|
enterOuterAlt(_localctx, 11);
|
|
setState(320);
|
|
forStatement();
|
|
break;
|
|
}
|
|
|
|
case 12: {
|
|
enterOuterAlt(_localctx, 12);
|
|
setState(321);
|
|
foreachStatement();
|
|
break;
|
|
}
|
|
|
|
case 13: {
|
|
enterOuterAlt(_localctx, 13);
|
|
setState(322);
|
|
repeatStatement();
|
|
break;
|
|
}
|
|
|
|
case 14: {
|
|
enterOuterAlt(_localctx, 14);
|
|
setState(323);
|
|
caseStatement();
|
|
break;
|
|
}
|
|
|
|
case 15: {
|
|
enterOuterAlt(_localctx, 15);
|
|
setState(324);
|
|
enumStatement();
|
|
break;
|
|
}
|
|
|
|
case 16: {
|
|
enterOuterAlt(_localctx, 16);
|
|
setState(325);
|
|
match(EscriptParser::SEMI);
|
|
break;
|
|
}
|
|
|
|
case 17: {
|
|
enterOuterAlt(_localctx, 17);
|
|
setState(326);
|
|
antlrcpp::downCast<StatementContext *>(_localctx)->statementExpression = expression(0);
|
|
setState(327);
|
|
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<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->enterStatementLabel(this);
|
|
}
|
|
|
|
void EscriptParser::StatementLabelContext::exitRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->exitStatementLabel(this);
|
|
}
|
|
|
|
|
|
std::any EscriptParser::StatementLabelContext::accept(tree::ParseTreeVisitor *visitor) {
|
|
if (auto parserVisitor = dynamic_cast<EscriptParserVisitor*>(visitor))
|
|
return parserVisitor->visitStatementLabel(this);
|
|
else
|
|
return visitor->visitChildren(this);
|
|
}
|
|
|
|
EscriptParser::StatementLabelContext* EscriptParser::statementLabel() {
|
|
StatementLabelContext *_localctx = _tracker.createInstance<StatementLabelContext>(_ctx, getState());
|
|
enterRule(_localctx, 40, EscriptParser::RuleStatementLabel);
|
|
|
|
#if __cplusplus > 201703L
|
|
auto onExit = finally([=, this] {
|
|
#else
|
|
auto onExit = finally([=] {
|
|
#endif
|
|
exitRule();
|
|
});
|
|
try {
|
|
enterOuterAlt(_localctx, 1);
|
|
setState(331);
|
|
match(EscriptParser::IDENTIFIER);
|
|
setState(332);
|
|
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::ParExpressionContext *> EscriptParser::IfStatementContext::parExpression() {
|
|
return getRuleContexts<EscriptParser::ParExpressionContext>();
|
|
}
|
|
|
|
EscriptParser::ParExpressionContext* EscriptParser::IfStatementContext::parExpression(size_t i) {
|
|
return getRuleContext<EscriptParser::ParExpressionContext>(i);
|
|
}
|
|
|
|
std::vector<EscriptParser::BlockContext *> EscriptParser::IfStatementContext::block() {
|
|
return getRuleContexts<EscriptParser::BlockContext>();
|
|
}
|
|
|
|
EscriptParser::BlockContext* EscriptParser::IfStatementContext::block(size_t i) {
|
|
return getRuleContext<EscriptParser::BlockContext>(i);
|
|
}
|
|
|
|
tree::TerminalNode* EscriptParser::IfStatementContext::ENDIF() {
|
|
return getToken(EscriptParser::ENDIF, 0);
|
|
}
|
|
|
|
tree::TerminalNode* EscriptParser::IfStatementContext::THEN() {
|
|
return getToken(EscriptParser::THEN, 0);
|
|
}
|
|
|
|
std::vector<tree::TerminalNode *> 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<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->enterIfStatement(this);
|
|
}
|
|
|
|
void EscriptParser::IfStatementContext::exitRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->exitIfStatement(this);
|
|
}
|
|
|
|
|
|
std::any EscriptParser::IfStatementContext::accept(tree::ParseTreeVisitor *visitor) {
|
|
if (auto parserVisitor = dynamic_cast<EscriptParserVisitor*>(visitor))
|
|
return parserVisitor->visitIfStatement(this);
|
|
else
|
|
return visitor->visitChildren(this);
|
|
}
|
|
|
|
EscriptParser::IfStatementContext* EscriptParser::ifStatement() {
|
|
IfStatementContext *_localctx = _tracker.createInstance<IfStatementContext>(_ctx, getState());
|
|
enterRule(_localctx, 42, EscriptParser::RuleIfStatement);
|
|
size_t _la = 0;
|
|
|
|
#if __cplusplus > 201703L
|
|
auto onExit = finally([=, this] {
|
|
#else
|
|
auto onExit = finally([=] {
|
|
#endif
|
|
exitRule();
|
|
});
|
|
try {
|
|
enterOuterAlt(_localctx, 1);
|
|
setState(334);
|
|
match(EscriptParser::IF);
|
|
setState(335);
|
|
parExpression();
|
|
setState(337);
|
|
_errHandler->sync(this);
|
|
|
|
_la = _input->LA(1);
|
|
if (_la == EscriptParser::THEN) {
|
|
setState(336);
|
|
match(EscriptParser::THEN);
|
|
}
|
|
setState(339);
|
|
block();
|
|
setState(346);
|
|
_errHandler->sync(this);
|
|
_la = _input->LA(1);
|
|
while (_la == EscriptParser::ELSEIF) {
|
|
setState(340);
|
|
match(EscriptParser::ELSEIF);
|
|
setState(341);
|
|
parExpression();
|
|
setState(342);
|
|
block();
|
|
setState(348);
|
|
_errHandler->sync(this);
|
|
_la = _input->LA(1);
|
|
}
|
|
setState(351);
|
|
_errHandler->sync(this);
|
|
|
|
_la = _input->LA(1);
|
|
if (_la == EscriptParser::ELSE) {
|
|
setState(349);
|
|
match(EscriptParser::ELSE);
|
|
setState(350);
|
|
block();
|
|
}
|
|
setState(353);
|
|
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<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->enterGotoStatement(this);
|
|
}
|
|
|
|
void EscriptParser::GotoStatementContext::exitRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->exitGotoStatement(this);
|
|
}
|
|
|
|
|
|
std::any EscriptParser::GotoStatementContext::accept(tree::ParseTreeVisitor *visitor) {
|
|
if (auto parserVisitor = dynamic_cast<EscriptParserVisitor*>(visitor))
|
|
return parserVisitor->visitGotoStatement(this);
|
|
else
|
|
return visitor->visitChildren(this);
|
|
}
|
|
|
|
EscriptParser::GotoStatementContext* EscriptParser::gotoStatement() {
|
|
GotoStatementContext *_localctx = _tracker.createInstance<GotoStatementContext>(_ctx, getState());
|
|
enterRule(_localctx, 44, EscriptParser::RuleGotoStatement);
|
|
|
|
#if __cplusplus > 201703L
|
|
auto onExit = finally([=, this] {
|
|
#else
|
|
auto onExit = finally([=] {
|
|
#endif
|
|
exitRule();
|
|
});
|
|
try {
|
|
enterOuterAlt(_localctx, 1);
|
|
setState(355);
|
|
match(EscriptParser::GOTO);
|
|
setState(356);
|
|
match(EscriptParser::IDENTIFIER);
|
|
setState(357);
|
|
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<EscriptParser::ExpressionContext>(0);
|
|
}
|
|
|
|
|
|
size_t EscriptParser::ReturnStatementContext::getRuleIndex() const {
|
|
return EscriptParser::RuleReturnStatement;
|
|
}
|
|
|
|
void EscriptParser::ReturnStatementContext::enterRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->enterReturnStatement(this);
|
|
}
|
|
|
|
void EscriptParser::ReturnStatementContext::exitRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->exitReturnStatement(this);
|
|
}
|
|
|
|
|
|
std::any EscriptParser::ReturnStatementContext::accept(tree::ParseTreeVisitor *visitor) {
|
|
if (auto parserVisitor = dynamic_cast<EscriptParserVisitor*>(visitor))
|
|
return parserVisitor->visitReturnStatement(this);
|
|
else
|
|
return visitor->visitChildren(this);
|
|
}
|
|
|
|
EscriptParser::ReturnStatementContext* EscriptParser::returnStatement() {
|
|
ReturnStatementContext *_localctx = _tracker.createInstance<ReturnStatementContext>(_ctx, getState());
|
|
enterRule(_localctx, 46, EscriptParser::RuleReturnStatement);
|
|
size_t _la = 0;
|
|
|
|
#if __cplusplus > 201703L
|
|
auto onExit = finally([=, this] {
|
|
#else
|
|
auto onExit = finally([=] {
|
|
#endif
|
|
exitRule();
|
|
});
|
|
try {
|
|
enterOuterAlt(_localctx, 1);
|
|
setState(359);
|
|
match(EscriptParser::RETURN);
|
|
setState(361);
|
|
_errHandler->sync(this);
|
|
|
|
_la = _input->LA(1);
|
|
if (((((_la - 58) & ~ 0x3fULL) == 0) &&
|
|
((1ULL << (_la - 58)) & -2305842905832506925) != 0) || ((((_la - 123) & ~ 0x3fULL) == 0) &&
|
|
((1ULL << (_la - 123)) & 131) != 0)) {
|
|
setState(360);
|
|
expression(0);
|
|
}
|
|
setState(363);
|
|
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<EscriptParser::ConstantDeclarationContext>(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<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->enterConstStatement(this);
|
|
}
|
|
|
|
void EscriptParser::ConstStatementContext::exitRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->exitConstStatement(this);
|
|
}
|
|
|
|
|
|
std::any EscriptParser::ConstStatementContext::accept(tree::ParseTreeVisitor *visitor) {
|
|
if (auto parserVisitor = dynamic_cast<EscriptParserVisitor*>(visitor))
|
|
return parserVisitor->visitConstStatement(this);
|
|
else
|
|
return visitor->visitChildren(this);
|
|
}
|
|
|
|
EscriptParser::ConstStatementContext* EscriptParser::constStatement() {
|
|
ConstStatementContext *_localctx = _tracker.createInstance<ConstStatementContext>(_ctx, getState());
|
|
enterRule(_localctx, 48, EscriptParser::RuleConstStatement);
|
|
|
|
#if __cplusplus > 201703L
|
|
auto onExit = finally([=, this] {
|
|
#else
|
|
auto onExit = finally([=] {
|
|
#endif
|
|
exitRule();
|
|
});
|
|
try {
|
|
enterOuterAlt(_localctx, 1);
|
|
setState(365);
|
|
match(EscriptParser::TOK_CONST);
|
|
setState(366);
|
|
constantDeclaration();
|
|
setState(367);
|
|
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<EscriptParser::VariableDeclarationListContext>(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<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->enterVarStatement(this);
|
|
}
|
|
|
|
void EscriptParser::VarStatementContext::exitRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->exitVarStatement(this);
|
|
}
|
|
|
|
|
|
std::any EscriptParser::VarStatementContext::accept(tree::ParseTreeVisitor *visitor) {
|
|
if (auto parserVisitor = dynamic_cast<EscriptParserVisitor*>(visitor))
|
|
return parserVisitor->visitVarStatement(this);
|
|
else
|
|
return visitor->visitChildren(this);
|
|
}
|
|
|
|
EscriptParser::VarStatementContext* EscriptParser::varStatement() {
|
|
VarStatementContext *_localctx = _tracker.createInstance<VarStatementContext>(_ctx, getState());
|
|
enterRule(_localctx, 50, EscriptParser::RuleVarStatement);
|
|
|
|
#if __cplusplus > 201703L
|
|
auto onExit = finally([=, this] {
|
|
#else
|
|
auto onExit = finally([=] {
|
|
#endif
|
|
exitRule();
|
|
});
|
|
try {
|
|
enterOuterAlt(_localctx, 1);
|
|
setState(369);
|
|
match(EscriptParser::VAR);
|
|
setState(370);
|
|
variableDeclarationList();
|
|
setState(371);
|
|
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<EscriptParser::BlockContext>(0);
|
|
}
|
|
|
|
tree::TerminalNode* EscriptParser::DoStatementContext::DOWHILE() {
|
|
return getToken(EscriptParser::DOWHILE, 0);
|
|
}
|
|
|
|
EscriptParser::ParExpressionContext* EscriptParser::DoStatementContext::parExpression() {
|
|
return getRuleContext<EscriptParser::ParExpressionContext>(0);
|
|
}
|
|
|
|
tree::TerminalNode* EscriptParser::DoStatementContext::SEMI() {
|
|
return getToken(EscriptParser::SEMI, 0);
|
|
}
|
|
|
|
EscriptParser::StatementLabelContext* EscriptParser::DoStatementContext::statementLabel() {
|
|
return getRuleContext<EscriptParser::StatementLabelContext>(0);
|
|
}
|
|
|
|
|
|
size_t EscriptParser::DoStatementContext::getRuleIndex() const {
|
|
return EscriptParser::RuleDoStatement;
|
|
}
|
|
|
|
void EscriptParser::DoStatementContext::enterRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->enterDoStatement(this);
|
|
}
|
|
|
|
void EscriptParser::DoStatementContext::exitRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->exitDoStatement(this);
|
|
}
|
|
|
|
|
|
std::any EscriptParser::DoStatementContext::accept(tree::ParseTreeVisitor *visitor) {
|
|
if (auto parserVisitor = dynamic_cast<EscriptParserVisitor*>(visitor))
|
|
return parserVisitor->visitDoStatement(this);
|
|
else
|
|
return visitor->visitChildren(this);
|
|
}
|
|
|
|
EscriptParser::DoStatementContext* EscriptParser::doStatement() {
|
|
DoStatementContext *_localctx = _tracker.createInstance<DoStatementContext>(_ctx, getState());
|
|
enterRule(_localctx, 52, EscriptParser::RuleDoStatement);
|
|
size_t _la = 0;
|
|
|
|
#if __cplusplus > 201703L
|
|
auto onExit = finally([=, this] {
|
|
#else
|
|
auto onExit = finally([=] {
|
|
#endif
|
|
exitRule();
|
|
});
|
|
try {
|
|
enterOuterAlt(_localctx, 1);
|
|
setState(374);
|
|
_errHandler->sync(this);
|
|
|
|
_la = _input->LA(1);
|
|
if (_la == EscriptParser::IDENTIFIER) {
|
|
setState(373);
|
|
statementLabel();
|
|
}
|
|
setState(376);
|
|
match(EscriptParser::DO);
|
|
setState(377);
|
|
block();
|
|
setState(378);
|
|
match(EscriptParser::DOWHILE);
|
|
setState(379);
|
|
parExpression();
|
|
setState(380);
|
|
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<EscriptParser::ParExpressionContext>(0);
|
|
}
|
|
|
|
EscriptParser::BlockContext* EscriptParser::WhileStatementContext::block() {
|
|
return getRuleContext<EscriptParser::BlockContext>(0);
|
|
}
|
|
|
|
tree::TerminalNode* EscriptParser::WhileStatementContext::ENDWHILE() {
|
|
return getToken(EscriptParser::ENDWHILE, 0);
|
|
}
|
|
|
|
EscriptParser::StatementLabelContext* EscriptParser::WhileStatementContext::statementLabel() {
|
|
return getRuleContext<EscriptParser::StatementLabelContext>(0);
|
|
}
|
|
|
|
|
|
size_t EscriptParser::WhileStatementContext::getRuleIndex() const {
|
|
return EscriptParser::RuleWhileStatement;
|
|
}
|
|
|
|
void EscriptParser::WhileStatementContext::enterRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->enterWhileStatement(this);
|
|
}
|
|
|
|
void EscriptParser::WhileStatementContext::exitRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->exitWhileStatement(this);
|
|
}
|
|
|
|
|
|
std::any EscriptParser::WhileStatementContext::accept(tree::ParseTreeVisitor *visitor) {
|
|
if (auto parserVisitor = dynamic_cast<EscriptParserVisitor*>(visitor))
|
|
return parserVisitor->visitWhileStatement(this);
|
|
else
|
|
return visitor->visitChildren(this);
|
|
}
|
|
|
|
EscriptParser::WhileStatementContext* EscriptParser::whileStatement() {
|
|
WhileStatementContext *_localctx = _tracker.createInstance<WhileStatementContext>(_ctx, getState());
|
|
enterRule(_localctx, 54, EscriptParser::RuleWhileStatement);
|
|
size_t _la = 0;
|
|
|
|
#if __cplusplus > 201703L
|
|
auto onExit = finally([=, this] {
|
|
#else
|
|
auto onExit = finally([=] {
|
|
#endif
|
|
exitRule();
|
|
});
|
|
try {
|
|
enterOuterAlt(_localctx, 1);
|
|
setState(383);
|
|
_errHandler->sync(this);
|
|
|
|
_la = _input->LA(1);
|
|
if (_la == EscriptParser::IDENTIFIER) {
|
|
setState(382);
|
|
statementLabel();
|
|
}
|
|
setState(385);
|
|
match(EscriptParser::WHILE);
|
|
setState(386);
|
|
parExpression();
|
|
setState(387);
|
|
block();
|
|
setState(388);
|
|
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<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->enterExitStatement(this);
|
|
}
|
|
|
|
void EscriptParser::ExitStatementContext::exitRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->exitExitStatement(this);
|
|
}
|
|
|
|
|
|
std::any EscriptParser::ExitStatementContext::accept(tree::ParseTreeVisitor *visitor) {
|
|
if (auto parserVisitor = dynamic_cast<EscriptParserVisitor*>(visitor))
|
|
return parserVisitor->visitExitStatement(this);
|
|
else
|
|
return visitor->visitChildren(this);
|
|
}
|
|
|
|
EscriptParser::ExitStatementContext* EscriptParser::exitStatement() {
|
|
ExitStatementContext *_localctx = _tracker.createInstance<ExitStatementContext>(_ctx, getState());
|
|
enterRule(_localctx, 56, EscriptParser::RuleExitStatement);
|
|
|
|
#if __cplusplus > 201703L
|
|
auto onExit = finally([=, this] {
|
|
#else
|
|
auto onExit = finally([=] {
|
|
#endif
|
|
exitRule();
|
|
});
|
|
try {
|
|
enterOuterAlt(_localctx, 1);
|
|
setState(390);
|
|
match(EscriptParser::EXIT);
|
|
setState(391);
|
|
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<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->enterBreakStatement(this);
|
|
}
|
|
|
|
void EscriptParser::BreakStatementContext::exitRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->exitBreakStatement(this);
|
|
}
|
|
|
|
|
|
std::any EscriptParser::BreakStatementContext::accept(tree::ParseTreeVisitor *visitor) {
|
|
if (auto parserVisitor = dynamic_cast<EscriptParserVisitor*>(visitor))
|
|
return parserVisitor->visitBreakStatement(this);
|
|
else
|
|
return visitor->visitChildren(this);
|
|
}
|
|
|
|
EscriptParser::BreakStatementContext* EscriptParser::breakStatement() {
|
|
BreakStatementContext *_localctx = _tracker.createInstance<BreakStatementContext>(_ctx, getState());
|
|
enterRule(_localctx, 58, EscriptParser::RuleBreakStatement);
|
|
size_t _la = 0;
|
|
|
|
#if __cplusplus > 201703L
|
|
auto onExit = finally([=, this] {
|
|
#else
|
|
auto onExit = finally([=] {
|
|
#endif
|
|
exitRule();
|
|
});
|
|
try {
|
|
enterOuterAlt(_localctx, 1);
|
|
setState(393);
|
|
match(EscriptParser::BREAK);
|
|
setState(395);
|
|
_errHandler->sync(this);
|
|
|
|
_la = _input->LA(1);
|
|
if (_la == EscriptParser::IDENTIFIER) {
|
|
setState(394);
|
|
match(EscriptParser::IDENTIFIER);
|
|
}
|
|
setState(397);
|
|
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<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->enterContinueStatement(this);
|
|
}
|
|
|
|
void EscriptParser::ContinueStatementContext::exitRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->exitContinueStatement(this);
|
|
}
|
|
|
|
|
|
std::any EscriptParser::ContinueStatementContext::accept(tree::ParseTreeVisitor *visitor) {
|
|
if (auto parserVisitor = dynamic_cast<EscriptParserVisitor*>(visitor))
|
|
return parserVisitor->visitContinueStatement(this);
|
|
else
|
|
return visitor->visitChildren(this);
|
|
}
|
|
|
|
EscriptParser::ContinueStatementContext* EscriptParser::continueStatement() {
|
|
ContinueStatementContext *_localctx = _tracker.createInstance<ContinueStatementContext>(_ctx, getState());
|
|
enterRule(_localctx, 60, EscriptParser::RuleContinueStatement);
|
|
size_t _la = 0;
|
|
|
|
#if __cplusplus > 201703L
|
|
auto onExit = finally([=, this] {
|
|
#else
|
|
auto onExit = finally([=] {
|
|
#endif
|
|
exitRule();
|
|
});
|
|
try {
|
|
enterOuterAlt(_localctx, 1);
|
|
setState(399);
|
|
match(EscriptParser::CONTINUE);
|
|
setState(401);
|
|
_errHandler->sync(this);
|
|
|
|
_la = _input->LA(1);
|
|
if (_la == EscriptParser::IDENTIFIER) {
|
|
setState(400);
|
|
match(EscriptParser::IDENTIFIER);
|
|
}
|
|
setState(403);
|
|
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<EscriptParser::ForGroupContext>(0);
|
|
}
|
|
|
|
tree::TerminalNode* EscriptParser::ForStatementContext::ENDFOR() {
|
|
return getToken(EscriptParser::ENDFOR, 0);
|
|
}
|
|
|
|
EscriptParser::StatementLabelContext* EscriptParser::ForStatementContext::statementLabel() {
|
|
return getRuleContext<EscriptParser::StatementLabelContext>(0);
|
|
}
|
|
|
|
|
|
size_t EscriptParser::ForStatementContext::getRuleIndex() const {
|
|
return EscriptParser::RuleForStatement;
|
|
}
|
|
|
|
void EscriptParser::ForStatementContext::enterRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->enterForStatement(this);
|
|
}
|
|
|
|
void EscriptParser::ForStatementContext::exitRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->exitForStatement(this);
|
|
}
|
|
|
|
|
|
std::any EscriptParser::ForStatementContext::accept(tree::ParseTreeVisitor *visitor) {
|
|
if (auto parserVisitor = dynamic_cast<EscriptParserVisitor*>(visitor))
|
|
return parserVisitor->visitForStatement(this);
|
|
else
|
|
return visitor->visitChildren(this);
|
|
}
|
|
|
|
EscriptParser::ForStatementContext* EscriptParser::forStatement() {
|
|
ForStatementContext *_localctx = _tracker.createInstance<ForStatementContext>(_ctx, getState());
|
|
enterRule(_localctx, 62, EscriptParser::RuleForStatement);
|
|
size_t _la = 0;
|
|
|
|
#if __cplusplus > 201703L
|
|
auto onExit = finally([=, this] {
|
|
#else
|
|
auto onExit = finally([=] {
|
|
#endif
|
|
exitRule();
|
|
});
|
|
try {
|
|
enterOuterAlt(_localctx, 1);
|
|
setState(406);
|
|
_errHandler->sync(this);
|
|
|
|
_la = _input->LA(1);
|
|
if (_la == EscriptParser::IDENTIFIER) {
|
|
setState(405);
|
|
statementLabel();
|
|
}
|
|
setState(408);
|
|
match(EscriptParser::FOR);
|
|
setState(409);
|
|
forGroup();
|
|
setState(410);
|
|
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<EscriptParser::FunctionCallContext>(0);
|
|
}
|
|
|
|
EscriptParser::ScopedFunctionCallContext* EscriptParser::ForeachIterableExpressionContext::scopedFunctionCall() {
|
|
return getRuleContext<EscriptParser::ScopedFunctionCallContext>(0);
|
|
}
|
|
|
|
EscriptParser::ScopedIdentifierContext* EscriptParser::ForeachIterableExpressionContext::scopedIdentifier() {
|
|
return getRuleContext<EscriptParser::ScopedIdentifierContext>(0);
|
|
}
|
|
|
|
tree::TerminalNode* EscriptParser::ForeachIterableExpressionContext::IDENTIFIER() {
|
|
return getToken(EscriptParser::IDENTIFIER, 0);
|
|
}
|
|
|
|
EscriptParser::ParExpressionContext* EscriptParser::ForeachIterableExpressionContext::parExpression() {
|
|
return getRuleContext<EscriptParser::ParExpressionContext>(0);
|
|
}
|
|
|
|
EscriptParser::BareArrayInitializerContext* EscriptParser::ForeachIterableExpressionContext::bareArrayInitializer() {
|
|
return getRuleContext<EscriptParser::BareArrayInitializerContext>(0);
|
|
}
|
|
|
|
EscriptParser::ExplicitArrayInitializerContext* EscriptParser::ForeachIterableExpressionContext::explicitArrayInitializer() {
|
|
return getRuleContext<EscriptParser::ExplicitArrayInitializerContext>(0);
|
|
}
|
|
|
|
|
|
size_t EscriptParser::ForeachIterableExpressionContext::getRuleIndex() const {
|
|
return EscriptParser::RuleForeachIterableExpression;
|
|
}
|
|
|
|
void EscriptParser::ForeachIterableExpressionContext::enterRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->enterForeachIterableExpression(this);
|
|
}
|
|
|
|
void EscriptParser::ForeachIterableExpressionContext::exitRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->exitForeachIterableExpression(this);
|
|
}
|
|
|
|
|
|
std::any EscriptParser::ForeachIterableExpressionContext::accept(tree::ParseTreeVisitor *visitor) {
|
|
if (auto parserVisitor = dynamic_cast<EscriptParserVisitor*>(visitor))
|
|
return parserVisitor->visitForeachIterableExpression(this);
|
|
else
|
|
return visitor->visitChildren(this);
|
|
}
|
|
|
|
EscriptParser::ForeachIterableExpressionContext* EscriptParser::foreachIterableExpression() {
|
|
ForeachIterableExpressionContext *_localctx = _tracker.createInstance<ForeachIterableExpressionContext>(_ctx, getState());
|
|
enterRule(_localctx, 64, EscriptParser::RuleForeachIterableExpression);
|
|
|
|
#if __cplusplus > 201703L
|
|
auto onExit = finally([=, this] {
|
|
#else
|
|
auto onExit = finally([=] {
|
|
#endif
|
|
exitRule();
|
|
});
|
|
try {
|
|
setState(419);
|
|
_errHandler->sync(this);
|
|
switch (getInterpreter<atn::ParserATNSimulator>()->adaptivePredict(_input, 22, _ctx)) {
|
|
case 1: {
|
|
enterOuterAlt(_localctx, 1);
|
|
setState(412);
|
|
functionCall();
|
|
break;
|
|
}
|
|
|
|
case 2: {
|
|
enterOuterAlt(_localctx, 2);
|
|
setState(413);
|
|
scopedFunctionCall();
|
|
break;
|
|
}
|
|
|
|
case 3: {
|
|
enterOuterAlt(_localctx, 3);
|
|
setState(414);
|
|
scopedIdentifier();
|
|
break;
|
|
}
|
|
|
|
case 4: {
|
|
enterOuterAlt(_localctx, 4);
|
|
setState(415);
|
|
match(EscriptParser::IDENTIFIER);
|
|
break;
|
|
}
|
|
|
|
case 5: {
|
|
enterOuterAlt(_localctx, 5);
|
|
setState(416);
|
|
parExpression();
|
|
break;
|
|
}
|
|
|
|
case 6: {
|
|
enterOuterAlt(_localctx, 6);
|
|
setState(417);
|
|
bareArrayInitializer();
|
|
break;
|
|
}
|
|
|
|
case 7: {
|
|
enterOuterAlt(_localctx, 7);
|
|
setState(418);
|
|
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<EscriptParser::ForeachIterableExpressionContext>(0);
|
|
}
|
|
|
|
EscriptParser::BlockContext* EscriptParser::ForeachStatementContext::block() {
|
|
return getRuleContext<EscriptParser::BlockContext>(0);
|
|
}
|
|
|
|
tree::TerminalNode* EscriptParser::ForeachStatementContext::ENDFOREACH() {
|
|
return getToken(EscriptParser::ENDFOREACH, 0);
|
|
}
|
|
|
|
EscriptParser::StatementLabelContext* EscriptParser::ForeachStatementContext::statementLabel() {
|
|
return getRuleContext<EscriptParser::StatementLabelContext>(0);
|
|
}
|
|
|
|
|
|
size_t EscriptParser::ForeachStatementContext::getRuleIndex() const {
|
|
return EscriptParser::RuleForeachStatement;
|
|
}
|
|
|
|
void EscriptParser::ForeachStatementContext::enterRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->enterForeachStatement(this);
|
|
}
|
|
|
|
void EscriptParser::ForeachStatementContext::exitRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->exitForeachStatement(this);
|
|
}
|
|
|
|
|
|
std::any EscriptParser::ForeachStatementContext::accept(tree::ParseTreeVisitor *visitor) {
|
|
if (auto parserVisitor = dynamic_cast<EscriptParserVisitor*>(visitor))
|
|
return parserVisitor->visitForeachStatement(this);
|
|
else
|
|
return visitor->visitChildren(this);
|
|
}
|
|
|
|
EscriptParser::ForeachStatementContext* EscriptParser::foreachStatement() {
|
|
ForeachStatementContext *_localctx = _tracker.createInstance<ForeachStatementContext>(_ctx, getState());
|
|
enterRule(_localctx, 66, EscriptParser::RuleForeachStatement);
|
|
size_t _la = 0;
|
|
|
|
#if __cplusplus > 201703L
|
|
auto onExit = finally([=, this] {
|
|
#else
|
|
auto onExit = finally([=] {
|
|
#endif
|
|
exitRule();
|
|
});
|
|
try {
|
|
enterOuterAlt(_localctx, 1);
|
|
setState(422);
|
|
_errHandler->sync(this);
|
|
|
|
_la = _input->LA(1);
|
|
if (_la == EscriptParser::IDENTIFIER) {
|
|
setState(421);
|
|
statementLabel();
|
|
}
|
|
setState(424);
|
|
match(EscriptParser::FOREACH);
|
|
setState(425);
|
|
match(EscriptParser::IDENTIFIER);
|
|
setState(426);
|
|
match(EscriptParser::TOK_IN);
|
|
setState(427);
|
|
foreachIterableExpression();
|
|
setState(428);
|
|
block();
|
|
setState(429);
|
|
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<EscriptParser::BlockContext>(0);
|
|
}
|
|
|
|
tree::TerminalNode* EscriptParser::RepeatStatementContext::UNTIL() {
|
|
return getToken(EscriptParser::UNTIL, 0);
|
|
}
|
|
|
|
EscriptParser::ExpressionContext* EscriptParser::RepeatStatementContext::expression() {
|
|
return getRuleContext<EscriptParser::ExpressionContext>(0);
|
|
}
|
|
|
|
tree::TerminalNode* EscriptParser::RepeatStatementContext::SEMI() {
|
|
return getToken(EscriptParser::SEMI, 0);
|
|
}
|
|
|
|
EscriptParser::StatementLabelContext* EscriptParser::RepeatStatementContext::statementLabel() {
|
|
return getRuleContext<EscriptParser::StatementLabelContext>(0);
|
|
}
|
|
|
|
|
|
size_t EscriptParser::RepeatStatementContext::getRuleIndex() const {
|
|
return EscriptParser::RuleRepeatStatement;
|
|
}
|
|
|
|
void EscriptParser::RepeatStatementContext::enterRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->enterRepeatStatement(this);
|
|
}
|
|
|
|
void EscriptParser::RepeatStatementContext::exitRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->exitRepeatStatement(this);
|
|
}
|
|
|
|
|
|
std::any EscriptParser::RepeatStatementContext::accept(tree::ParseTreeVisitor *visitor) {
|
|
if (auto parserVisitor = dynamic_cast<EscriptParserVisitor*>(visitor))
|
|
return parserVisitor->visitRepeatStatement(this);
|
|
else
|
|
return visitor->visitChildren(this);
|
|
}
|
|
|
|
EscriptParser::RepeatStatementContext* EscriptParser::repeatStatement() {
|
|
RepeatStatementContext *_localctx = _tracker.createInstance<RepeatStatementContext>(_ctx, getState());
|
|
enterRule(_localctx, 68, EscriptParser::RuleRepeatStatement);
|
|
size_t _la = 0;
|
|
|
|
#if __cplusplus > 201703L
|
|
auto onExit = finally([=, this] {
|
|
#else
|
|
auto onExit = finally([=] {
|
|
#endif
|
|
exitRule();
|
|
});
|
|
try {
|
|
enterOuterAlt(_localctx, 1);
|
|
setState(432);
|
|
_errHandler->sync(this);
|
|
|
|
_la = _input->LA(1);
|
|
if (_la == EscriptParser::IDENTIFIER) {
|
|
setState(431);
|
|
statementLabel();
|
|
}
|
|
setState(434);
|
|
match(EscriptParser::REPEAT);
|
|
setState(435);
|
|
block();
|
|
setState(436);
|
|
match(EscriptParser::UNTIL);
|
|
setState(437);
|
|
expression(0);
|
|
setState(438);
|
|
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<EscriptParser::ExpressionContext>(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<EscriptParser::StatementLabelContext>(0);
|
|
}
|
|
|
|
std::vector<EscriptParser::SwitchBlockStatementGroupContext *> EscriptParser::CaseStatementContext::switchBlockStatementGroup() {
|
|
return getRuleContexts<EscriptParser::SwitchBlockStatementGroupContext>();
|
|
}
|
|
|
|
EscriptParser::SwitchBlockStatementGroupContext* EscriptParser::CaseStatementContext::switchBlockStatementGroup(size_t i) {
|
|
return getRuleContext<EscriptParser::SwitchBlockStatementGroupContext>(i);
|
|
}
|
|
|
|
|
|
size_t EscriptParser::CaseStatementContext::getRuleIndex() const {
|
|
return EscriptParser::RuleCaseStatement;
|
|
}
|
|
|
|
void EscriptParser::CaseStatementContext::enterRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->enterCaseStatement(this);
|
|
}
|
|
|
|
void EscriptParser::CaseStatementContext::exitRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->exitCaseStatement(this);
|
|
}
|
|
|
|
|
|
std::any EscriptParser::CaseStatementContext::accept(tree::ParseTreeVisitor *visitor) {
|
|
if (auto parserVisitor = dynamic_cast<EscriptParserVisitor*>(visitor))
|
|
return parserVisitor->visitCaseStatement(this);
|
|
else
|
|
return visitor->visitChildren(this);
|
|
}
|
|
|
|
EscriptParser::CaseStatementContext* EscriptParser::caseStatement() {
|
|
CaseStatementContext *_localctx = _tracker.createInstance<CaseStatementContext>(_ctx, getState());
|
|
enterRule(_localctx, 70, EscriptParser::RuleCaseStatement);
|
|
size_t _la = 0;
|
|
|
|
#if __cplusplus > 201703L
|
|
auto onExit = finally([=, this] {
|
|
#else
|
|
auto onExit = finally([=] {
|
|
#endif
|
|
exitRule();
|
|
});
|
|
try {
|
|
enterOuterAlt(_localctx, 1);
|
|
setState(441);
|
|
_errHandler->sync(this);
|
|
|
|
_la = _input->LA(1);
|
|
if (_la == EscriptParser::IDENTIFIER) {
|
|
setState(440);
|
|
statementLabel();
|
|
}
|
|
setState(443);
|
|
match(EscriptParser::CASE);
|
|
setState(444);
|
|
match(EscriptParser::LPAREN);
|
|
setState(445);
|
|
expression(0);
|
|
setState(446);
|
|
match(EscriptParser::RPAREN);
|
|
setState(448);
|
|
_errHandler->sync(this);
|
|
_la = _input->LA(1);
|
|
do {
|
|
setState(447);
|
|
switchBlockStatementGroup();
|
|
setState(450);
|
|
_errHandler->sync(this);
|
|
_la = _input->LA(1);
|
|
} while (_la == EscriptParser::DEFAULT || ((((_la - 69) & ~ 0x3fULL) == 0) &&
|
|
((1ULL << (_la - 69)) & 2310346608841065719) != 0));
|
|
setState(452);
|
|
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<EscriptParser::EnumListContext>(0);
|
|
}
|
|
|
|
tree::TerminalNode* EscriptParser::EnumStatementContext::ENDENUM() {
|
|
return getToken(EscriptParser::ENDENUM, 0);
|
|
}
|
|
|
|
tree::TerminalNode* EscriptParser::EnumStatementContext::CLASS() {
|
|
return getToken(EscriptParser::CLASS, 0);
|
|
}
|
|
|
|
|
|
size_t EscriptParser::EnumStatementContext::getRuleIndex() const {
|
|
return EscriptParser::RuleEnumStatement;
|
|
}
|
|
|
|
void EscriptParser::EnumStatementContext::enterRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->enterEnumStatement(this);
|
|
}
|
|
|
|
void EscriptParser::EnumStatementContext::exitRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->exitEnumStatement(this);
|
|
}
|
|
|
|
|
|
std::any EscriptParser::EnumStatementContext::accept(tree::ParseTreeVisitor *visitor) {
|
|
if (auto parserVisitor = dynamic_cast<EscriptParserVisitor*>(visitor))
|
|
return parserVisitor->visitEnumStatement(this);
|
|
else
|
|
return visitor->visitChildren(this);
|
|
}
|
|
|
|
EscriptParser::EnumStatementContext* EscriptParser::enumStatement() {
|
|
EnumStatementContext *_localctx = _tracker.createInstance<EnumStatementContext>(_ctx, getState());
|
|
enterRule(_localctx, 72, EscriptParser::RuleEnumStatement);
|
|
size_t _la = 0;
|
|
|
|
#if __cplusplus > 201703L
|
|
auto onExit = finally([=, this] {
|
|
#else
|
|
auto onExit = finally([=] {
|
|
#endif
|
|
exitRule();
|
|
});
|
|
try {
|
|
enterOuterAlt(_localctx, 1);
|
|
setState(454);
|
|
match(EscriptParser::ENUM);
|
|
setState(456);
|
|
_errHandler->sync(this);
|
|
|
|
_la = _input->LA(1);
|
|
if (_la == EscriptParser::CLASS) {
|
|
setState(455);
|
|
match(EscriptParser::CLASS);
|
|
}
|
|
setState(458);
|
|
match(EscriptParser::IDENTIFIER);
|
|
setState(459);
|
|
enumList();
|
|
setState(460);
|
|
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::StatementContext *> EscriptParser::BlockContext::statement() {
|
|
return getRuleContexts<EscriptParser::StatementContext>();
|
|
}
|
|
|
|
EscriptParser::StatementContext* EscriptParser::BlockContext::statement(size_t i) {
|
|
return getRuleContext<EscriptParser::StatementContext>(i);
|
|
}
|
|
|
|
|
|
size_t EscriptParser::BlockContext::getRuleIndex() const {
|
|
return EscriptParser::RuleBlock;
|
|
}
|
|
|
|
void EscriptParser::BlockContext::enterRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->enterBlock(this);
|
|
}
|
|
|
|
void EscriptParser::BlockContext::exitRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->exitBlock(this);
|
|
}
|
|
|
|
|
|
std::any EscriptParser::BlockContext::accept(tree::ParseTreeVisitor *visitor) {
|
|
if (auto parserVisitor = dynamic_cast<EscriptParserVisitor*>(visitor))
|
|
return parserVisitor->visitBlock(this);
|
|
else
|
|
return visitor->visitChildren(this);
|
|
}
|
|
|
|
EscriptParser::BlockContext* EscriptParser::block() {
|
|
BlockContext *_localctx = _tracker.createInstance<BlockContext>(_ctx, getState());
|
|
enterRule(_localctx, 74, EscriptParser::RuleBlock);
|
|
|
|
#if __cplusplus > 201703L
|
|
auto onExit = finally([=, this] {
|
|
#else
|
|
auto onExit = finally([=] {
|
|
#endif
|
|
exitRule();
|
|
});
|
|
try {
|
|
size_t alt;
|
|
enterOuterAlt(_localctx, 1);
|
|
setState(465);
|
|
_errHandler->sync(this);
|
|
alt = getInterpreter<atn::ParserATNSimulator>()->adaptivePredict(_input, 28, _ctx);
|
|
while (alt != 2 && alt != atn::ATN::INVALID_ALT_NUMBER) {
|
|
if (alt == 1) {
|
|
setState(462);
|
|
statement();
|
|
}
|
|
setState(467);
|
|
_errHandler->sync(this);
|
|
alt = getInterpreter<atn::ParserATNSimulator>()->adaptivePredict(_input, 28, _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<EscriptParser::ExpressionContext>(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<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->enterVariableDeclarationInitializer(this);
|
|
}
|
|
|
|
void EscriptParser::VariableDeclarationInitializerContext::exitRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->exitVariableDeclarationInitializer(this);
|
|
}
|
|
|
|
|
|
std::any EscriptParser::VariableDeclarationInitializerContext::accept(tree::ParseTreeVisitor *visitor) {
|
|
if (auto parserVisitor = dynamic_cast<EscriptParserVisitor*>(visitor))
|
|
return parserVisitor->visitVariableDeclarationInitializer(this);
|
|
else
|
|
return visitor->visitChildren(this);
|
|
}
|
|
|
|
EscriptParser::VariableDeclarationInitializerContext* EscriptParser::variableDeclarationInitializer() {
|
|
VariableDeclarationInitializerContext *_localctx = _tracker.createInstance<VariableDeclarationInitializerContext>(_ctx, getState());
|
|
enterRule(_localctx, 76, EscriptParser::RuleVariableDeclarationInitializer);
|
|
|
|
#if __cplusplus > 201703L
|
|
auto onExit = finally([=, this] {
|
|
#else
|
|
auto onExit = finally([=] {
|
|
#endif
|
|
exitRule();
|
|
});
|
|
try {
|
|
setState(475);
|
|
_errHandler->sync(this);
|
|
switch (_input->LA(1)) {
|
|
case EscriptParser::ASSIGN: {
|
|
enterOuterAlt(_localctx, 1);
|
|
setState(468);
|
|
match(EscriptParser::ASSIGN);
|
|
setState(469);
|
|
expression(0);
|
|
break;
|
|
}
|
|
|
|
case EscriptParser::EQUAL_DEPRECATED: {
|
|
enterOuterAlt(_localctx, 2);
|
|
setState(470);
|
|
match(EscriptParser::EQUAL_DEPRECATED);
|
|
setState(471);
|
|
expression(0);
|
|
notifyErrorListeners("Unexpected token: '='. Did you mean := for assign?\n");
|
|
break;
|
|
}
|
|
|
|
case EscriptParser::ARRAY: {
|
|
enterOuterAlt(_localctx, 3);
|
|
setState(474);
|
|
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::EnumListEntryContext *> EscriptParser::EnumListContext::enumListEntry() {
|
|
return getRuleContexts<EscriptParser::EnumListEntryContext>();
|
|
}
|
|
|
|
EscriptParser::EnumListEntryContext* EscriptParser::EnumListContext::enumListEntry(size_t i) {
|
|
return getRuleContext<EscriptParser::EnumListEntryContext>(i);
|
|
}
|
|
|
|
std::vector<tree::TerminalNode *> 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<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->enterEnumList(this);
|
|
}
|
|
|
|
void EscriptParser::EnumListContext::exitRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->exitEnumList(this);
|
|
}
|
|
|
|
|
|
std::any EscriptParser::EnumListContext::accept(tree::ParseTreeVisitor *visitor) {
|
|
if (auto parserVisitor = dynamic_cast<EscriptParserVisitor*>(visitor))
|
|
return parserVisitor->visitEnumList(this);
|
|
else
|
|
return visitor->visitChildren(this);
|
|
}
|
|
|
|
EscriptParser::EnumListContext* EscriptParser::enumList() {
|
|
EnumListContext *_localctx = _tracker.createInstance<EnumListContext>(_ctx, getState());
|
|
enterRule(_localctx, 78, 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(477);
|
|
enumListEntry();
|
|
setState(482);
|
|
_errHandler->sync(this);
|
|
alt = getInterpreter<atn::ParserATNSimulator>()->adaptivePredict(_input, 30, _ctx);
|
|
while (alt != 2 && alt != atn::ATN::INVALID_ALT_NUMBER) {
|
|
if (alt == 1) {
|
|
setState(478);
|
|
match(EscriptParser::COMMA);
|
|
setState(479);
|
|
enumListEntry();
|
|
}
|
|
setState(484);
|
|
_errHandler->sync(this);
|
|
alt = getInterpreter<atn::ParserATNSimulator>()->adaptivePredict(_input, 30, _ctx);
|
|
}
|
|
setState(486);
|
|
_errHandler->sync(this);
|
|
|
|
_la = _input->LA(1);
|
|
if (_la == EscriptParser::COMMA) {
|
|
setState(485);
|
|
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<EscriptParser::ExpressionContext>(0);
|
|
}
|
|
|
|
|
|
size_t EscriptParser::EnumListEntryContext::getRuleIndex() const {
|
|
return EscriptParser::RuleEnumListEntry;
|
|
}
|
|
|
|
void EscriptParser::EnumListEntryContext::enterRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->enterEnumListEntry(this);
|
|
}
|
|
|
|
void EscriptParser::EnumListEntryContext::exitRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->exitEnumListEntry(this);
|
|
}
|
|
|
|
|
|
std::any EscriptParser::EnumListEntryContext::accept(tree::ParseTreeVisitor *visitor) {
|
|
if (auto parserVisitor = dynamic_cast<EscriptParserVisitor*>(visitor))
|
|
return parserVisitor->visitEnumListEntry(this);
|
|
else
|
|
return visitor->visitChildren(this);
|
|
}
|
|
|
|
EscriptParser::EnumListEntryContext* EscriptParser::enumListEntry() {
|
|
EnumListEntryContext *_localctx = _tracker.createInstance<EnumListEntryContext>(_ctx, getState());
|
|
enterRule(_localctx, 80, EscriptParser::RuleEnumListEntry);
|
|
size_t _la = 0;
|
|
|
|
#if __cplusplus > 201703L
|
|
auto onExit = finally([=, this] {
|
|
#else
|
|
auto onExit = finally([=] {
|
|
#endif
|
|
exitRule();
|
|
});
|
|
try {
|
|
enterOuterAlt(_localctx, 1);
|
|
setState(488);
|
|
match(EscriptParser::IDENTIFIER);
|
|
setState(491);
|
|
_errHandler->sync(this);
|
|
|
|
_la = _input->LA(1);
|
|
if (_la == EscriptParser::ASSIGN) {
|
|
setState(489);
|
|
match(EscriptParser::ASSIGN);
|
|
setState(490);
|
|
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<EscriptParser::BlockContext>(0);
|
|
}
|
|
|
|
std::vector<EscriptParser::SwitchLabelContext *> EscriptParser::SwitchBlockStatementGroupContext::switchLabel() {
|
|
return getRuleContexts<EscriptParser::SwitchLabelContext>();
|
|
}
|
|
|
|
EscriptParser::SwitchLabelContext* EscriptParser::SwitchBlockStatementGroupContext::switchLabel(size_t i) {
|
|
return getRuleContext<EscriptParser::SwitchLabelContext>(i);
|
|
}
|
|
|
|
|
|
size_t EscriptParser::SwitchBlockStatementGroupContext::getRuleIndex() const {
|
|
return EscriptParser::RuleSwitchBlockStatementGroup;
|
|
}
|
|
|
|
void EscriptParser::SwitchBlockStatementGroupContext::enterRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->enterSwitchBlockStatementGroup(this);
|
|
}
|
|
|
|
void EscriptParser::SwitchBlockStatementGroupContext::exitRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->exitSwitchBlockStatementGroup(this);
|
|
}
|
|
|
|
|
|
std::any EscriptParser::SwitchBlockStatementGroupContext::accept(tree::ParseTreeVisitor *visitor) {
|
|
if (auto parserVisitor = dynamic_cast<EscriptParserVisitor*>(visitor))
|
|
return parserVisitor->visitSwitchBlockStatementGroup(this);
|
|
else
|
|
return visitor->visitChildren(this);
|
|
}
|
|
|
|
EscriptParser::SwitchBlockStatementGroupContext* EscriptParser::switchBlockStatementGroup() {
|
|
SwitchBlockStatementGroupContext *_localctx = _tracker.createInstance<SwitchBlockStatementGroupContext>(_ctx, getState());
|
|
enterRule(_localctx, 82, EscriptParser::RuleSwitchBlockStatementGroup);
|
|
|
|
#if __cplusplus > 201703L
|
|
auto onExit = finally([=, this] {
|
|
#else
|
|
auto onExit = finally([=] {
|
|
#endif
|
|
exitRule();
|
|
});
|
|
try {
|
|
size_t alt;
|
|
enterOuterAlt(_localctx, 1);
|
|
setState(494);
|
|
_errHandler->sync(this);
|
|
alt = 1;
|
|
do {
|
|
switch (alt) {
|
|
case 1: {
|
|
setState(493);
|
|
switchLabel();
|
|
break;
|
|
}
|
|
|
|
default:
|
|
throw NoViableAltException(this);
|
|
}
|
|
setState(496);
|
|
_errHandler->sync(this);
|
|
alt = getInterpreter<atn::ParserATNSimulator>()->adaptivePredict(_input, 33, _ctx);
|
|
} while (alt != 2 && alt != atn::ATN::INVALID_ALT_NUMBER);
|
|
setState(498);
|
|
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<EscriptParser::IntegerLiteralContext>(0);
|
|
}
|
|
|
|
EscriptParser::BoolLiteralContext* EscriptParser::SwitchLabelContext::boolLiteral() {
|
|
return getRuleContext<EscriptParser::BoolLiteralContext>(0);
|
|
}
|
|
|
|
EscriptParser::ScopedIdentifierContext* EscriptParser::SwitchLabelContext::scopedIdentifier() {
|
|
return getRuleContext<EscriptParser::ScopedIdentifierContext>(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<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->enterSwitchLabel(this);
|
|
}
|
|
|
|
void EscriptParser::SwitchLabelContext::exitRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->exitSwitchLabel(this);
|
|
}
|
|
|
|
|
|
std::any EscriptParser::SwitchLabelContext::accept(tree::ParseTreeVisitor *visitor) {
|
|
if (auto parserVisitor = dynamic_cast<EscriptParserVisitor*>(visitor))
|
|
return parserVisitor->visitSwitchLabel(this);
|
|
else
|
|
return visitor->visitChildren(this);
|
|
}
|
|
|
|
EscriptParser::SwitchLabelContext* EscriptParser::switchLabel() {
|
|
SwitchLabelContext *_localctx = _tracker.createInstance<SwitchLabelContext>(_ctx, getState());
|
|
enterRule(_localctx, 84, EscriptParser::RuleSwitchLabel);
|
|
|
|
#if __cplusplus > 201703L
|
|
auto onExit = finally([=, this] {
|
|
#else
|
|
auto onExit = finally([=] {
|
|
#endif
|
|
exitRule();
|
|
});
|
|
try {
|
|
setState(511);
|
|
_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::COLONCOLON:
|
|
case EscriptParser::IDENTIFIER: {
|
|
enterOuterAlt(_localctx, 1);
|
|
setState(506);
|
|
_errHandler->sync(this);
|
|
switch (getInterpreter<atn::ParserATNSimulator>()->adaptivePredict(_input, 34, _ctx)) {
|
|
case 1: {
|
|
setState(500);
|
|
integerLiteral();
|
|
break;
|
|
}
|
|
|
|
case 2: {
|
|
setState(501);
|
|
boolLiteral();
|
|
break;
|
|
}
|
|
|
|
case 3: {
|
|
setState(502);
|
|
scopedIdentifier();
|
|
break;
|
|
}
|
|
|
|
case 4: {
|
|
setState(503);
|
|
match(EscriptParser::UNINIT);
|
|
break;
|
|
}
|
|
|
|
case 5: {
|
|
setState(504);
|
|
match(EscriptParser::IDENTIFIER);
|
|
break;
|
|
}
|
|
|
|
case 6: {
|
|
setState(505);
|
|
match(EscriptParser::STRING_LITERAL);
|
|
break;
|
|
}
|
|
|
|
default:
|
|
break;
|
|
}
|
|
setState(508);
|
|
match(EscriptParser::COLON);
|
|
break;
|
|
}
|
|
|
|
case EscriptParser::DEFAULT: {
|
|
enterOuterAlt(_localctx, 2);
|
|
setState(509);
|
|
match(EscriptParser::DEFAULT);
|
|
setState(510);
|
|
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<EscriptParser::CstyleForStatementContext>(0);
|
|
}
|
|
|
|
EscriptParser::BasicForStatementContext* EscriptParser::ForGroupContext::basicForStatement() {
|
|
return getRuleContext<EscriptParser::BasicForStatementContext>(0);
|
|
}
|
|
|
|
|
|
size_t EscriptParser::ForGroupContext::getRuleIndex() const {
|
|
return EscriptParser::RuleForGroup;
|
|
}
|
|
|
|
void EscriptParser::ForGroupContext::enterRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->enterForGroup(this);
|
|
}
|
|
|
|
void EscriptParser::ForGroupContext::exitRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->exitForGroup(this);
|
|
}
|
|
|
|
|
|
std::any EscriptParser::ForGroupContext::accept(tree::ParseTreeVisitor *visitor) {
|
|
if (auto parserVisitor = dynamic_cast<EscriptParserVisitor*>(visitor))
|
|
return parserVisitor->visitForGroup(this);
|
|
else
|
|
return visitor->visitChildren(this);
|
|
}
|
|
|
|
EscriptParser::ForGroupContext* EscriptParser::forGroup() {
|
|
ForGroupContext *_localctx = _tracker.createInstance<ForGroupContext>(_ctx, getState());
|
|
enterRule(_localctx, 86, EscriptParser::RuleForGroup);
|
|
|
|
#if __cplusplus > 201703L
|
|
auto onExit = finally([=, this] {
|
|
#else
|
|
auto onExit = finally([=] {
|
|
#endif
|
|
exitRule();
|
|
});
|
|
try {
|
|
setState(515);
|
|
_errHandler->sync(this);
|
|
switch (_input->LA(1)) {
|
|
case EscriptParser::LPAREN: {
|
|
enterOuterAlt(_localctx, 1);
|
|
setState(513);
|
|
cstyleForStatement();
|
|
break;
|
|
}
|
|
|
|
case EscriptParser::IDENTIFIER: {
|
|
enterOuterAlt(_localctx, 2);
|
|
setState(514);
|
|
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::ExpressionContext *> EscriptParser::BasicForStatementContext::expression() {
|
|
return getRuleContexts<EscriptParser::ExpressionContext>();
|
|
}
|
|
|
|
EscriptParser::ExpressionContext* EscriptParser::BasicForStatementContext::expression(size_t i) {
|
|
return getRuleContext<EscriptParser::ExpressionContext>(i);
|
|
}
|
|
|
|
tree::TerminalNode* EscriptParser::BasicForStatementContext::TO() {
|
|
return getToken(EscriptParser::TO, 0);
|
|
}
|
|
|
|
EscriptParser::BlockContext* EscriptParser::BasicForStatementContext::block() {
|
|
return getRuleContext<EscriptParser::BlockContext>(0);
|
|
}
|
|
|
|
|
|
size_t EscriptParser::BasicForStatementContext::getRuleIndex() const {
|
|
return EscriptParser::RuleBasicForStatement;
|
|
}
|
|
|
|
void EscriptParser::BasicForStatementContext::enterRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->enterBasicForStatement(this);
|
|
}
|
|
|
|
void EscriptParser::BasicForStatementContext::exitRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->exitBasicForStatement(this);
|
|
}
|
|
|
|
|
|
std::any EscriptParser::BasicForStatementContext::accept(tree::ParseTreeVisitor *visitor) {
|
|
if (auto parserVisitor = dynamic_cast<EscriptParserVisitor*>(visitor))
|
|
return parserVisitor->visitBasicForStatement(this);
|
|
else
|
|
return visitor->visitChildren(this);
|
|
}
|
|
|
|
EscriptParser::BasicForStatementContext* EscriptParser::basicForStatement() {
|
|
BasicForStatementContext *_localctx = _tracker.createInstance<BasicForStatementContext>(_ctx, getState());
|
|
enterRule(_localctx, 88, EscriptParser::RuleBasicForStatement);
|
|
|
|
#if __cplusplus > 201703L
|
|
auto onExit = finally([=, this] {
|
|
#else
|
|
auto onExit = finally([=] {
|
|
#endif
|
|
exitRule();
|
|
});
|
|
try {
|
|
enterOuterAlt(_localctx, 1);
|
|
setState(517);
|
|
match(EscriptParser::IDENTIFIER);
|
|
setState(518);
|
|
match(EscriptParser::ASSIGN);
|
|
setState(519);
|
|
expression(0);
|
|
setState(520);
|
|
match(EscriptParser::TO);
|
|
setState(521);
|
|
expression(0);
|
|
setState(522);
|
|
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::ExpressionContext *> EscriptParser::CstyleForStatementContext::expression() {
|
|
return getRuleContexts<EscriptParser::ExpressionContext>();
|
|
}
|
|
|
|
EscriptParser::ExpressionContext* EscriptParser::CstyleForStatementContext::expression(size_t i) {
|
|
return getRuleContext<EscriptParser::ExpressionContext>(i);
|
|
}
|
|
|
|
std::vector<tree::TerminalNode *> 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<EscriptParser::BlockContext>(0);
|
|
}
|
|
|
|
|
|
size_t EscriptParser::CstyleForStatementContext::getRuleIndex() const {
|
|
return EscriptParser::RuleCstyleForStatement;
|
|
}
|
|
|
|
void EscriptParser::CstyleForStatementContext::enterRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->enterCstyleForStatement(this);
|
|
}
|
|
|
|
void EscriptParser::CstyleForStatementContext::exitRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->exitCstyleForStatement(this);
|
|
}
|
|
|
|
|
|
std::any EscriptParser::CstyleForStatementContext::accept(tree::ParseTreeVisitor *visitor) {
|
|
if (auto parserVisitor = dynamic_cast<EscriptParserVisitor*>(visitor))
|
|
return parserVisitor->visitCstyleForStatement(this);
|
|
else
|
|
return visitor->visitChildren(this);
|
|
}
|
|
|
|
EscriptParser::CstyleForStatementContext* EscriptParser::cstyleForStatement() {
|
|
CstyleForStatementContext *_localctx = _tracker.createInstance<CstyleForStatementContext>(_ctx, getState());
|
|
enterRule(_localctx, 90, EscriptParser::RuleCstyleForStatement);
|
|
|
|
#if __cplusplus > 201703L
|
|
auto onExit = finally([=, this] {
|
|
#else
|
|
auto onExit = finally([=] {
|
|
#endif
|
|
exitRule();
|
|
});
|
|
try {
|
|
enterOuterAlt(_localctx, 1);
|
|
setState(524);
|
|
match(EscriptParser::LPAREN);
|
|
setState(525);
|
|
expression(0);
|
|
setState(526);
|
|
match(EscriptParser::SEMI);
|
|
setState(527);
|
|
expression(0);
|
|
setState(528);
|
|
match(EscriptParser::SEMI);
|
|
setState(529);
|
|
expression(0);
|
|
setState(530);
|
|
match(EscriptParser::RPAREN);
|
|
setState(531);
|
|
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<EscriptParser::IdentifierListContext>(0);
|
|
}
|
|
|
|
|
|
size_t EscriptParser::IdentifierListContext::getRuleIndex() const {
|
|
return EscriptParser::RuleIdentifierList;
|
|
}
|
|
|
|
void EscriptParser::IdentifierListContext::enterRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->enterIdentifierList(this);
|
|
}
|
|
|
|
void EscriptParser::IdentifierListContext::exitRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->exitIdentifierList(this);
|
|
}
|
|
|
|
|
|
std::any EscriptParser::IdentifierListContext::accept(tree::ParseTreeVisitor *visitor) {
|
|
if (auto parserVisitor = dynamic_cast<EscriptParserVisitor*>(visitor))
|
|
return parserVisitor->visitIdentifierList(this);
|
|
else
|
|
return visitor->visitChildren(this);
|
|
}
|
|
|
|
EscriptParser::IdentifierListContext* EscriptParser::identifierList() {
|
|
IdentifierListContext *_localctx = _tracker.createInstance<IdentifierListContext>(_ctx, getState());
|
|
enterRule(_localctx, 92, EscriptParser::RuleIdentifierList);
|
|
|
|
#if __cplusplus > 201703L
|
|
auto onExit = finally([=, this] {
|
|
#else
|
|
auto onExit = finally([=] {
|
|
#endif
|
|
exitRule();
|
|
});
|
|
try {
|
|
enterOuterAlt(_localctx, 1);
|
|
setState(533);
|
|
match(EscriptParser::IDENTIFIER);
|
|
setState(536);
|
|
_errHandler->sync(this);
|
|
|
|
switch (getInterpreter<atn::ParserATNSimulator>()->adaptivePredict(_input, 37, _ctx)) {
|
|
case 1: {
|
|
setState(534);
|
|
match(EscriptParser::COMMA);
|
|
setState(535);
|
|
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::VariableDeclarationContext *> EscriptParser::VariableDeclarationListContext::variableDeclaration() {
|
|
return getRuleContexts<EscriptParser::VariableDeclarationContext>();
|
|
}
|
|
|
|
EscriptParser::VariableDeclarationContext* EscriptParser::VariableDeclarationListContext::variableDeclaration(size_t i) {
|
|
return getRuleContext<EscriptParser::VariableDeclarationContext>(i);
|
|
}
|
|
|
|
std::vector<tree::TerminalNode *> 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<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->enterVariableDeclarationList(this);
|
|
}
|
|
|
|
void EscriptParser::VariableDeclarationListContext::exitRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->exitVariableDeclarationList(this);
|
|
}
|
|
|
|
|
|
std::any EscriptParser::VariableDeclarationListContext::accept(tree::ParseTreeVisitor *visitor) {
|
|
if (auto parserVisitor = dynamic_cast<EscriptParserVisitor*>(visitor))
|
|
return parserVisitor->visitVariableDeclarationList(this);
|
|
else
|
|
return visitor->visitChildren(this);
|
|
}
|
|
|
|
EscriptParser::VariableDeclarationListContext* EscriptParser::variableDeclarationList() {
|
|
VariableDeclarationListContext *_localctx = _tracker.createInstance<VariableDeclarationListContext>(_ctx, getState());
|
|
enterRule(_localctx, 94, EscriptParser::RuleVariableDeclarationList);
|
|
size_t _la = 0;
|
|
|
|
#if __cplusplus > 201703L
|
|
auto onExit = finally([=, this] {
|
|
#else
|
|
auto onExit = finally([=] {
|
|
#endif
|
|
exitRule();
|
|
});
|
|
try {
|
|
enterOuterAlt(_localctx, 1);
|
|
setState(538);
|
|
variableDeclaration();
|
|
setState(543);
|
|
_errHandler->sync(this);
|
|
_la = _input->LA(1);
|
|
while (_la == EscriptParser::COMMA) {
|
|
setState(539);
|
|
match(EscriptParser::COMMA);
|
|
setState(540);
|
|
variableDeclaration();
|
|
setState(545);
|
|
_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<EscriptParser::VariableDeclarationInitializerContext>(0);
|
|
}
|
|
|
|
|
|
size_t EscriptParser::ConstantDeclarationContext::getRuleIndex() const {
|
|
return EscriptParser::RuleConstantDeclaration;
|
|
}
|
|
|
|
void EscriptParser::ConstantDeclarationContext::enterRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->enterConstantDeclaration(this);
|
|
}
|
|
|
|
void EscriptParser::ConstantDeclarationContext::exitRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->exitConstantDeclaration(this);
|
|
}
|
|
|
|
|
|
std::any EscriptParser::ConstantDeclarationContext::accept(tree::ParseTreeVisitor *visitor) {
|
|
if (auto parserVisitor = dynamic_cast<EscriptParserVisitor*>(visitor))
|
|
return parserVisitor->visitConstantDeclaration(this);
|
|
else
|
|
return visitor->visitChildren(this);
|
|
}
|
|
|
|
EscriptParser::ConstantDeclarationContext* EscriptParser::constantDeclaration() {
|
|
ConstantDeclarationContext *_localctx = _tracker.createInstance<ConstantDeclarationContext>(_ctx, getState());
|
|
enterRule(_localctx, 96, EscriptParser::RuleConstantDeclaration);
|
|
|
|
#if __cplusplus > 201703L
|
|
auto onExit = finally([=, this] {
|
|
#else
|
|
auto onExit = finally([=] {
|
|
#endif
|
|
exitRule();
|
|
});
|
|
try {
|
|
enterOuterAlt(_localctx, 1);
|
|
setState(546);
|
|
match(EscriptParser::IDENTIFIER);
|
|
setState(547);
|
|
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<EscriptParser::VariableDeclarationInitializerContext>(0);
|
|
}
|
|
|
|
EscriptParser::BindingDeclarationContext* EscriptParser::VariableDeclarationContext::bindingDeclaration() {
|
|
return getRuleContext<EscriptParser::BindingDeclarationContext>(0);
|
|
}
|
|
|
|
EscriptParser::BindingDeclarationInitializerContext* EscriptParser::VariableDeclarationContext::bindingDeclarationInitializer() {
|
|
return getRuleContext<EscriptParser::BindingDeclarationInitializerContext>(0);
|
|
}
|
|
|
|
|
|
size_t EscriptParser::VariableDeclarationContext::getRuleIndex() const {
|
|
return EscriptParser::RuleVariableDeclaration;
|
|
}
|
|
|
|
void EscriptParser::VariableDeclarationContext::enterRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->enterVariableDeclaration(this);
|
|
}
|
|
|
|
void EscriptParser::VariableDeclarationContext::exitRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->exitVariableDeclaration(this);
|
|
}
|
|
|
|
|
|
std::any EscriptParser::VariableDeclarationContext::accept(tree::ParseTreeVisitor *visitor) {
|
|
if (auto parserVisitor = dynamic_cast<EscriptParserVisitor*>(visitor))
|
|
return parserVisitor->visitVariableDeclaration(this);
|
|
else
|
|
return visitor->visitChildren(this);
|
|
}
|
|
|
|
EscriptParser::VariableDeclarationContext* EscriptParser::variableDeclaration() {
|
|
VariableDeclarationContext *_localctx = _tracker.createInstance<VariableDeclarationContext>(_ctx, getState());
|
|
enterRule(_localctx, 98, EscriptParser::RuleVariableDeclaration);
|
|
size_t _la = 0;
|
|
|
|
#if __cplusplus > 201703L
|
|
auto onExit = finally([=, this] {
|
|
#else
|
|
auto onExit = finally([=] {
|
|
#endif
|
|
exitRule();
|
|
});
|
|
try {
|
|
setState(556);
|
|
_errHandler->sync(this);
|
|
switch (_input->LA(1)) {
|
|
case EscriptParser::IDENTIFIER: {
|
|
enterOuterAlt(_localctx, 1);
|
|
setState(549);
|
|
match(EscriptParser::IDENTIFIER);
|
|
setState(551);
|
|
_errHandler->sync(this);
|
|
|
|
_la = _input->LA(1);
|
|
if (((((_la - 66) & ~ 0x3fULL) == 0) &&
|
|
((1ULL << (_la - 66)) & 175921860444161) != 0)) {
|
|
setState(550);
|
|
variableDeclarationInitializer();
|
|
}
|
|
break;
|
|
}
|
|
|
|
case EscriptParser::LBRACK:
|
|
case EscriptParser::LBRACE: {
|
|
enterOuterAlt(_localctx, 2);
|
|
setState(553);
|
|
bindingDeclaration();
|
|
setState(554);
|
|
bindingDeclarationInitializer();
|
|
break;
|
|
}
|
|
|
|
default:
|
|
throw NoViableAltException(this);
|
|
}
|
|
|
|
}
|
|
catch (RecognitionException &e) {
|
|
_errHandler->reportError(this, e);
|
|
_localctx->exception = std::current_exception();
|
|
_errHandler->recover(this, _localctx->exception);
|
|
}
|
|
|
|
return _localctx;
|
|
}
|
|
|
|
//----------------- BindingDeclarationContext ------------------------------------------------------------------
|
|
|
|
EscriptParser::BindingDeclarationContext::BindingDeclarationContext(ParserRuleContext *parent, size_t invokingState)
|
|
: ParserRuleContext(parent, invokingState) {
|
|
}
|
|
|
|
tree::TerminalNode* EscriptParser::BindingDeclarationContext::LBRACK() {
|
|
return getToken(EscriptParser::LBRACK, 0);
|
|
}
|
|
|
|
EscriptParser::SequenceBindingListContext* EscriptParser::BindingDeclarationContext::sequenceBindingList() {
|
|
return getRuleContext<EscriptParser::SequenceBindingListContext>(0);
|
|
}
|
|
|
|
tree::TerminalNode* EscriptParser::BindingDeclarationContext::RBRACK() {
|
|
return getToken(EscriptParser::RBRACK, 0);
|
|
}
|
|
|
|
tree::TerminalNode* EscriptParser::BindingDeclarationContext::LBRACE() {
|
|
return getToken(EscriptParser::LBRACE, 0);
|
|
}
|
|
|
|
EscriptParser::IndexBindingListContext* EscriptParser::BindingDeclarationContext::indexBindingList() {
|
|
return getRuleContext<EscriptParser::IndexBindingListContext>(0);
|
|
}
|
|
|
|
tree::TerminalNode* EscriptParser::BindingDeclarationContext::RBRACE() {
|
|
return getToken(EscriptParser::RBRACE, 0);
|
|
}
|
|
|
|
|
|
size_t EscriptParser::BindingDeclarationContext::getRuleIndex() const {
|
|
return EscriptParser::RuleBindingDeclaration;
|
|
}
|
|
|
|
void EscriptParser::BindingDeclarationContext::enterRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->enterBindingDeclaration(this);
|
|
}
|
|
|
|
void EscriptParser::BindingDeclarationContext::exitRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->exitBindingDeclaration(this);
|
|
}
|
|
|
|
|
|
std::any EscriptParser::BindingDeclarationContext::accept(tree::ParseTreeVisitor *visitor) {
|
|
if (auto parserVisitor = dynamic_cast<EscriptParserVisitor*>(visitor))
|
|
return parserVisitor->visitBindingDeclaration(this);
|
|
else
|
|
return visitor->visitChildren(this);
|
|
}
|
|
|
|
EscriptParser::BindingDeclarationContext* EscriptParser::bindingDeclaration() {
|
|
BindingDeclarationContext *_localctx = _tracker.createInstance<BindingDeclarationContext>(_ctx, getState());
|
|
enterRule(_localctx, 100, EscriptParser::RuleBindingDeclaration);
|
|
|
|
#if __cplusplus > 201703L
|
|
auto onExit = finally([=, this] {
|
|
#else
|
|
auto onExit = finally([=] {
|
|
#endif
|
|
exitRule();
|
|
});
|
|
try {
|
|
setState(566);
|
|
_errHandler->sync(this);
|
|
switch (_input->LA(1)) {
|
|
case EscriptParser::LBRACK: {
|
|
enterOuterAlt(_localctx, 1);
|
|
setState(558);
|
|
match(EscriptParser::LBRACK);
|
|
setState(559);
|
|
sequenceBindingList();
|
|
setState(560);
|
|
match(EscriptParser::RBRACK);
|
|
break;
|
|
}
|
|
|
|
case EscriptParser::LBRACE: {
|
|
enterOuterAlt(_localctx, 2);
|
|
setState(562);
|
|
match(EscriptParser::LBRACE);
|
|
setState(563);
|
|
indexBindingList();
|
|
setState(564);
|
|
match(EscriptParser::RBRACE);
|
|
break;
|
|
}
|
|
|
|
default:
|
|
throw NoViableAltException(this);
|
|
}
|
|
|
|
}
|
|
catch (RecognitionException &e) {
|
|
_errHandler->reportError(this, e);
|
|
_localctx->exception = std::current_exception();
|
|
_errHandler->recover(this, _localctx->exception);
|
|
}
|
|
|
|
return _localctx;
|
|
}
|
|
|
|
//----------------- IndexBindingListContext ------------------------------------------------------------------
|
|
|
|
EscriptParser::IndexBindingListContext::IndexBindingListContext(ParserRuleContext *parent, size_t invokingState)
|
|
: ParserRuleContext(parent, invokingState) {
|
|
}
|
|
|
|
std::vector<EscriptParser::IndexBindingContext *> EscriptParser::IndexBindingListContext::indexBinding() {
|
|
return getRuleContexts<EscriptParser::IndexBindingContext>();
|
|
}
|
|
|
|
EscriptParser::IndexBindingContext* EscriptParser::IndexBindingListContext::indexBinding(size_t i) {
|
|
return getRuleContext<EscriptParser::IndexBindingContext>(i);
|
|
}
|
|
|
|
std::vector<tree::TerminalNode *> EscriptParser::IndexBindingListContext::COMMA() {
|
|
return getTokens(EscriptParser::COMMA);
|
|
}
|
|
|
|
tree::TerminalNode* EscriptParser::IndexBindingListContext::COMMA(size_t i) {
|
|
return getToken(EscriptParser::COMMA, i);
|
|
}
|
|
|
|
|
|
size_t EscriptParser::IndexBindingListContext::getRuleIndex() const {
|
|
return EscriptParser::RuleIndexBindingList;
|
|
}
|
|
|
|
void EscriptParser::IndexBindingListContext::enterRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->enterIndexBindingList(this);
|
|
}
|
|
|
|
void EscriptParser::IndexBindingListContext::exitRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->exitIndexBindingList(this);
|
|
}
|
|
|
|
|
|
std::any EscriptParser::IndexBindingListContext::accept(tree::ParseTreeVisitor *visitor) {
|
|
if (auto parserVisitor = dynamic_cast<EscriptParserVisitor*>(visitor))
|
|
return parserVisitor->visitIndexBindingList(this);
|
|
else
|
|
return visitor->visitChildren(this);
|
|
}
|
|
|
|
EscriptParser::IndexBindingListContext* EscriptParser::indexBindingList() {
|
|
IndexBindingListContext *_localctx = _tracker.createInstance<IndexBindingListContext>(_ctx, getState());
|
|
enterRule(_localctx, 102, EscriptParser::RuleIndexBindingList);
|
|
size_t _la = 0;
|
|
|
|
#if __cplusplus > 201703L
|
|
auto onExit = finally([=, this] {
|
|
#else
|
|
auto onExit = finally([=] {
|
|
#endif
|
|
exitRule();
|
|
});
|
|
try {
|
|
enterOuterAlt(_localctx, 1);
|
|
setState(568);
|
|
indexBinding();
|
|
setState(573);
|
|
_errHandler->sync(this);
|
|
_la = _input->LA(1);
|
|
while (_la == EscriptParser::COMMA) {
|
|
setState(569);
|
|
match(EscriptParser::COMMA);
|
|
setState(570);
|
|
indexBinding();
|
|
setState(575);
|
|
_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;
|
|
}
|
|
|
|
//----------------- SequenceBindingListContext ------------------------------------------------------------------
|
|
|
|
EscriptParser::SequenceBindingListContext::SequenceBindingListContext(ParserRuleContext *parent, size_t invokingState)
|
|
: ParserRuleContext(parent, invokingState) {
|
|
}
|
|
|
|
std::vector<EscriptParser::SequenceBindingContext *> EscriptParser::SequenceBindingListContext::sequenceBinding() {
|
|
return getRuleContexts<EscriptParser::SequenceBindingContext>();
|
|
}
|
|
|
|
EscriptParser::SequenceBindingContext* EscriptParser::SequenceBindingListContext::sequenceBinding(size_t i) {
|
|
return getRuleContext<EscriptParser::SequenceBindingContext>(i);
|
|
}
|
|
|
|
std::vector<tree::TerminalNode *> EscriptParser::SequenceBindingListContext::COMMA() {
|
|
return getTokens(EscriptParser::COMMA);
|
|
}
|
|
|
|
tree::TerminalNode* EscriptParser::SequenceBindingListContext::COMMA(size_t i) {
|
|
return getToken(EscriptParser::COMMA, i);
|
|
}
|
|
|
|
|
|
size_t EscriptParser::SequenceBindingListContext::getRuleIndex() const {
|
|
return EscriptParser::RuleSequenceBindingList;
|
|
}
|
|
|
|
void EscriptParser::SequenceBindingListContext::enterRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->enterSequenceBindingList(this);
|
|
}
|
|
|
|
void EscriptParser::SequenceBindingListContext::exitRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->exitSequenceBindingList(this);
|
|
}
|
|
|
|
|
|
std::any EscriptParser::SequenceBindingListContext::accept(tree::ParseTreeVisitor *visitor) {
|
|
if (auto parserVisitor = dynamic_cast<EscriptParserVisitor*>(visitor))
|
|
return parserVisitor->visitSequenceBindingList(this);
|
|
else
|
|
return visitor->visitChildren(this);
|
|
}
|
|
|
|
EscriptParser::SequenceBindingListContext* EscriptParser::sequenceBindingList() {
|
|
SequenceBindingListContext *_localctx = _tracker.createInstance<SequenceBindingListContext>(_ctx, getState());
|
|
enterRule(_localctx, 104, EscriptParser::RuleSequenceBindingList);
|
|
size_t _la = 0;
|
|
|
|
#if __cplusplus > 201703L
|
|
auto onExit = finally([=, this] {
|
|
#else
|
|
auto onExit = finally([=] {
|
|
#endif
|
|
exitRule();
|
|
});
|
|
try {
|
|
enterOuterAlt(_localctx, 1);
|
|
setState(576);
|
|
sequenceBinding();
|
|
setState(581);
|
|
_errHandler->sync(this);
|
|
_la = _input->LA(1);
|
|
while (_la == EscriptParser::COMMA) {
|
|
setState(577);
|
|
match(EscriptParser::COMMA);
|
|
setState(578);
|
|
sequenceBinding();
|
|
setState(583);
|
|
_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;
|
|
}
|
|
|
|
//----------------- SequenceBindingContext ------------------------------------------------------------------
|
|
|
|
EscriptParser::SequenceBindingContext::SequenceBindingContext(ParserRuleContext *parent, size_t invokingState)
|
|
: ParserRuleContext(parent, invokingState) {
|
|
}
|
|
|
|
tree::TerminalNode* EscriptParser::SequenceBindingContext::IDENTIFIER() {
|
|
return getToken(EscriptParser::IDENTIFIER, 0);
|
|
}
|
|
|
|
tree::TerminalNode* EscriptParser::SequenceBindingContext::ELLIPSIS() {
|
|
return getToken(EscriptParser::ELLIPSIS, 0);
|
|
}
|
|
|
|
EscriptParser::BindingDeclarationContext* EscriptParser::SequenceBindingContext::bindingDeclaration() {
|
|
return getRuleContext<EscriptParser::BindingDeclarationContext>(0);
|
|
}
|
|
|
|
|
|
size_t EscriptParser::SequenceBindingContext::getRuleIndex() const {
|
|
return EscriptParser::RuleSequenceBinding;
|
|
}
|
|
|
|
void EscriptParser::SequenceBindingContext::enterRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->enterSequenceBinding(this);
|
|
}
|
|
|
|
void EscriptParser::SequenceBindingContext::exitRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->exitSequenceBinding(this);
|
|
}
|
|
|
|
|
|
std::any EscriptParser::SequenceBindingContext::accept(tree::ParseTreeVisitor *visitor) {
|
|
if (auto parserVisitor = dynamic_cast<EscriptParserVisitor*>(visitor))
|
|
return parserVisitor->visitSequenceBinding(this);
|
|
else
|
|
return visitor->visitChildren(this);
|
|
}
|
|
|
|
EscriptParser::SequenceBindingContext* EscriptParser::sequenceBinding() {
|
|
SequenceBindingContext *_localctx = _tracker.createInstance<SequenceBindingContext>(_ctx, getState());
|
|
enterRule(_localctx, 106, EscriptParser::RuleSequenceBinding);
|
|
size_t _la = 0;
|
|
|
|
#if __cplusplus > 201703L
|
|
auto onExit = finally([=, this] {
|
|
#else
|
|
auto onExit = finally([=] {
|
|
#endif
|
|
exitRule();
|
|
});
|
|
try {
|
|
setState(589);
|
|
_errHandler->sync(this);
|
|
switch (_input->LA(1)) {
|
|
case EscriptParser::IDENTIFIER: {
|
|
enterOuterAlt(_localctx, 1);
|
|
setState(584);
|
|
match(EscriptParser::IDENTIFIER);
|
|
setState(586);
|
|
_errHandler->sync(this);
|
|
|
|
_la = _input->LA(1);
|
|
if (_la == EscriptParser::ELLIPSIS) {
|
|
setState(585);
|
|
match(EscriptParser::ELLIPSIS);
|
|
}
|
|
break;
|
|
}
|
|
|
|
case EscriptParser::LBRACK:
|
|
case EscriptParser::LBRACE: {
|
|
enterOuterAlt(_localctx, 2);
|
|
setState(588);
|
|
bindingDeclaration();
|
|
break;
|
|
}
|
|
|
|
default:
|
|
throw NoViableAltException(this);
|
|
}
|
|
|
|
}
|
|
catch (RecognitionException &e) {
|
|
_errHandler->reportError(this, e);
|
|
_localctx->exception = std::current_exception();
|
|
_errHandler->recover(this, _localctx->exception);
|
|
}
|
|
|
|
return _localctx;
|
|
}
|
|
|
|
//----------------- IndexBindingContext ------------------------------------------------------------------
|
|
|
|
EscriptParser::IndexBindingContext::IndexBindingContext(ParserRuleContext *parent, size_t invokingState)
|
|
: ParserRuleContext(parent, invokingState) {
|
|
}
|
|
|
|
tree::TerminalNode* EscriptParser::IndexBindingContext::IDENTIFIER() {
|
|
return getToken(EscriptParser::IDENTIFIER, 0);
|
|
}
|
|
|
|
tree::TerminalNode* EscriptParser::IndexBindingContext::ELLIPSIS() {
|
|
return getToken(EscriptParser::ELLIPSIS, 0);
|
|
}
|
|
|
|
EscriptParser::BindingContext* EscriptParser::IndexBindingContext::binding() {
|
|
return getRuleContext<EscriptParser::BindingContext>(0);
|
|
}
|
|
|
|
tree::TerminalNode* EscriptParser::IndexBindingContext::LBRACK() {
|
|
return getToken(EscriptParser::LBRACK, 0);
|
|
}
|
|
|
|
EscriptParser::ExpressionContext* EscriptParser::IndexBindingContext::expression() {
|
|
return getRuleContext<EscriptParser::ExpressionContext>(0);
|
|
}
|
|
|
|
tree::TerminalNode* EscriptParser::IndexBindingContext::RBRACK() {
|
|
return getToken(EscriptParser::RBRACK, 0);
|
|
}
|
|
|
|
|
|
size_t EscriptParser::IndexBindingContext::getRuleIndex() const {
|
|
return EscriptParser::RuleIndexBinding;
|
|
}
|
|
|
|
void EscriptParser::IndexBindingContext::enterRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->enterIndexBinding(this);
|
|
}
|
|
|
|
void EscriptParser::IndexBindingContext::exitRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->exitIndexBinding(this);
|
|
}
|
|
|
|
|
|
std::any EscriptParser::IndexBindingContext::accept(tree::ParseTreeVisitor *visitor) {
|
|
if (auto parserVisitor = dynamic_cast<EscriptParserVisitor*>(visitor))
|
|
return parserVisitor->visitIndexBinding(this);
|
|
else
|
|
return visitor->visitChildren(this);
|
|
}
|
|
|
|
EscriptParser::IndexBindingContext* EscriptParser::indexBinding() {
|
|
IndexBindingContext *_localctx = _tracker.createInstance<IndexBindingContext>(_ctx, getState());
|
|
enterRule(_localctx, 108, EscriptParser::RuleIndexBinding);
|
|
size_t _la = 0;
|
|
|
|
#if __cplusplus > 201703L
|
|
auto onExit = finally([=, this] {
|
|
#else
|
|
auto onExit = finally([=] {
|
|
#endif
|
|
exitRule();
|
|
});
|
|
try {
|
|
setState(604);
|
|
_errHandler->sync(this);
|
|
switch (getInterpreter<atn::ParserATNSimulator>()->adaptivePredict(_input, 48, _ctx)) {
|
|
case 1: {
|
|
enterOuterAlt(_localctx, 1);
|
|
setState(591);
|
|
match(EscriptParser::IDENTIFIER);
|
|
setState(593);
|
|
_errHandler->sync(this);
|
|
|
|
_la = _input->LA(1);
|
|
if (_la == EscriptParser::ELLIPSIS) {
|
|
setState(592);
|
|
match(EscriptParser::ELLIPSIS);
|
|
}
|
|
break;
|
|
}
|
|
|
|
case 2: {
|
|
enterOuterAlt(_localctx, 2);
|
|
setState(595);
|
|
match(EscriptParser::IDENTIFIER);
|
|
setState(597);
|
|
_errHandler->sync(this);
|
|
|
|
_la = _input->LA(1);
|
|
if (_la == EscriptParser::COLON) {
|
|
setState(596);
|
|
binding();
|
|
}
|
|
break;
|
|
}
|
|
|
|
case 3: {
|
|
enterOuterAlt(_localctx, 3);
|
|
setState(599);
|
|
match(EscriptParser::LBRACK);
|
|
setState(600);
|
|
expression(0);
|
|
setState(601);
|
|
match(EscriptParser::RBRACK);
|
|
setState(602);
|
|
binding();
|
|
break;
|
|
}
|
|
|
|
default:
|
|
break;
|
|
}
|
|
|
|
}
|
|
catch (RecognitionException &e) {
|
|
_errHandler->reportError(this, e);
|
|
_localctx->exception = std::current_exception();
|
|
_errHandler->recover(this, _localctx->exception);
|
|
}
|
|
|
|
return _localctx;
|
|
}
|
|
|
|
//----------------- BindingContext ------------------------------------------------------------------
|
|
|
|
EscriptParser::BindingContext::BindingContext(ParserRuleContext *parent, size_t invokingState)
|
|
: ParserRuleContext(parent, invokingState) {
|
|
}
|
|
|
|
tree::TerminalNode* EscriptParser::BindingContext::COLON() {
|
|
return getToken(EscriptParser::COLON, 0);
|
|
}
|
|
|
|
tree::TerminalNode* EscriptParser::BindingContext::IDENTIFIER() {
|
|
return getToken(EscriptParser::IDENTIFIER, 0);
|
|
}
|
|
|
|
EscriptParser::BindingDeclarationContext* EscriptParser::BindingContext::bindingDeclaration() {
|
|
return getRuleContext<EscriptParser::BindingDeclarationContext>(0);
|
|
}
|
|
|
|
|
|
size_t EscriptParser::BindingContext::getRuleIndex() const {
|
|
return EscriptParser::RuleBinding;
|
|
}
|
|
|
|
void EscriptParser::BindingContext::enterRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->enterBinding(this);
|
|
}
|
|
|
|
void EscriptParser::BindingContext::exitRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->exitBinding(this);
|
|
}
|
|
|
|
|
|
std::any EscriptParser::BindingContext::accept(tree::ParseTreeVisitor *visitor) {
|
|
if (auto parserVisitor = dynamic_cast<EscriptParserVisitor*>(visitor))
|
|
return parserVisitor->visitBinding(this);
|
|
else
|
|
return visitor->visitChildren(this);
|
|
}
|
|
|
|
EscriptParser::BindingContext* EscriptParser::binding() {
|
|
BindingContext *_localctx = _tracker.createInstance<BindingContext>(_ctx, getState());
|
|
enterRule(_localctx, 110, EscriptParser::RuleBinding);
|
|
|
|
#if __cplusplus > 201703L
|
|
auto onExit = finally([=, this] {
|
|
#else
|
|
auto onExit = finally([=] {
|
|
#endif
|
|
exitRule();
|
|
});
|
|
try {
|
|
setState(610);
|
|
_errHandler->sync(this);
|
|
switch (getInterpreter<atn::ParserATNSimulator>()->adaptivePredict(_input, 49, _ctx)) {
|
|
case 1: {
|
|
enterOuterAlt(_localctx, 1);
|
|
setState(606);
|
|
match(EscriptParser::COLON);
|
|
setState(607);
|
|
match(EscriptParser::IDENTIFIER);
|
|
break;
|
|
}
|
|
|
|
case 2: {
|
|
enterOuterAlt(_localctx, 2);
|
|
setState(608);
|
|
match(EscriptParser::COLON);
|
|
setState(609);
|
|
bindingDeclaration();
|
|
break;
|
|
}
|
|
|
|
default:
|
|
break;
|
|
}
|
|
|
|
}
|
|
catch (RecognitionException &e) {
|
|
_errHandler->reportError(this, e);
|
|
_localctx->exception = std::current_exception();
|
|
_errHandler->recover(this, _localctx->exception);
|
|
}
|
|
|
|
return _localctx;
|
|
}
|
|
|
|
//----------------- BindingDeclarationInitializerContext ------------------------------------------------------------------
|
|
|
|
EscriptParser::BindingDeclarationInitializerContext::BindingDeclarationInitializerContext(ParserRuleContext *parent, size_t invokingState)
|
|
: ParserRuleContext(parent, invokingState) {
|
|
}
|
|
|
|
tree::TerminalNode* EscriptParser::BindingDeclarationInitializerContext::ASSIGN() {
|
|
return getToken(EscriptParser::ASSIGN, 0);
|
|
}
|
|
|
|
EscriptParser::ExpressionContext* EscriptParser::BindingDeclarationInitializerContext::expression() {
|
|
return getRuleContext<EscriptParser::ExpressionContext>(0);
|
|
}
|
|
|
|
tree::TerminalNode* EscriptParser::BindingDeclarationInitializerContext::EQUAL_DEPRECATED() {
|
|
return getToken(EscriptParser::EQUAL_DEPRECATED, 0);
|
|
}
|
|
|
|
|
|
size_t EscriptParser::BindingDeclarationInitializerContext::getRuleIndex() const {
|
|
return EscriptParser::RuleBindingDeclarationInitializer;
|
|
}
|
|
|
|
void EscriptParser::BindingDeclarationInitializerContext::enterRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->enterBindingDeclarationInitializer(this);
|
|
}
|
|
|
|
void EscriptParser::BindingDeclarationInitializerContext::exitRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->exitBindingDeclarationInitializer(this);
|
|
}
|
|
|
|
|
|
std::any EscriptParser::BindingDeclarationInitializerContext::accept(tree::ParseTreeVisitor *visitor) {
|
|
if (auto parserVisitor = dynamic_cast<EscriptParserVisitor*>(visitor))
|
|
return parserVisitor->visitBindingDeclarationInitializer(this);
|
|
else
|
|
return visitor->visitChildren(this);
|
|
}
|
|
|
|
EscriptParser::BindingDeclarationInitializerContext* EscriptParser::bindingDeclarationInitializer() {
|
|
BindingDeclarationInitializerContext *_localctx = _tracker.createInstance<BindingDeclarationInitializerContext>(_ctx, getState());
|
|
enterRule(_localctx, 112, EscriptParser::RuleBindingDeclarationInitializer);
|
|
|
|
#if __cplusplus > 201703L
|
|
auto onExit = finally([=, this] {
|
|
#else
|
|
auto onExit = finally([=] {
|
|
#endif
|
|
exitRule();
|
|
});
|
|
try {
|
|
setState(618);
|
|
_errHandler->sync(this);
|
|
switch (_input->LA(1)) {
|
|
case EscriptParser::ASSIGN: {
|
|
enterOuterAlt(_localctx, 1);
|
|
setState(612);
|
|
match(EscriptParser::ASSIGN);
|
|
setState(613);
|
|
expression(0);
|
|
break;
|
|
}
|
|
|
|
case EscriptParser::EQUAL_DEPRECATED: {
|
|
enterOuterAlt(_localctx, 2);
|
|
setState(614);
|
|
match(EscriptParser::EQUAL_DEPRECATED);
|
|
setState(615);
|
|
expression(0);
|
|
notifyErrorListeners("Unexpected token: '='. Did you mean := for assign?\n");
|
|
break;
|
|
}
|
|
|
|
default:
|
|
throw NoViableAltException(this);
|
|
}
|
|
|
|
}
|
|
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<EscriptParser::ProgramParameterListContext>(0);
|
|
}
|
|
|
|
|
|
size_t EscriptParser::ProgramParametersContext::getRuleIndex() const {
|
|
return EscriptParser::RuleProgramParameters;
|
|
}
|
|
|
|
void EscriptParser::ProgramParametersContext::enterRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->enterProgramParameters(this);
|
|
}
|
|
|
|
void EscriptParser::ProgramParametersContext::exitRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->exitProgramParameters(this);
|
|
}
|
|
|
|
|
|
std::any EscriptParser::ProgramParametersContext::accept(tree::ParseTreeVisitor *visitor) {
|
|
if (auto parserVisitor = dynamic_cast<EscriptParserVisitor*>(visitor))
|
|
return parserVisitor->visitProgramParameters(this);
|
|
else
|
|
return visitor->visitChildren(this);
|
|
}
|
|
|
|
EscriptParser::ProgramParametersContext* EscriptParser::programParameters() {
|
|
ProgramParametersContext *_localctx = _tracker.createInstance<ProgramParametersContext>(_ctx, getState());
|
|
enterRule(_localctx, 114, EscriptParser::RuleProgramParameters);
|
|
size_t _la = 0;
|
|
|
|
#if __cplusplus > 201703L
|
|
auto onExit = finally([=, this] {
|
|
#else
|
|
auto onExit = finally([=] {
|
|
#endif
|
|
exitRule();
|
|
});
|
|
try {
|
|
enterOuterAlt(_localctx, 1);
|
|
setState(620);
|
|
match(EscriptParser::LPAREN);
|
|
setState(622);
|
|
_errHandler->sync(this);
|
|
|
|
_la = _input->LA(1);
|
|
if (_la == EscriptParser::UNUSED || _la == EscriptParser::IDENTIFIER) {
|
|
setState(621);
|
|
programParameterList();
|
|
}
|
|
setState(624);
|
|
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::ProgramParameterContext *> EscriptParser::ProgramParameterListContext::programParameter() {
|
|
return getRuleContexts<EscriptParser::ProgramParameterContext>();
|
|
}
|
|
|
|
EscriptParser::ProgramParameterContext* EscriptParser::ProgramParameterListContext::programParameter(size_t i) {
|
|
return getRuleContext<EscriptParser::ProgramParameterContext>(i);
|
|
}
|
|
|
|
std::vector<tree::TerminalNode *> 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<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->enterProgramParameterList(this);
|
|
}
|
|
|
|
void EscriptParser::ProgramParameterListContext::exitRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->exitProgramParameterList(this);
|
|
}
|
|
|
|
|
|
std::any EscriptParser::ProgramParameterListContext::accept(tree::ParseTreeVisitor *visitor) {
|
|
if (auto parserVisitor = dynamic_cast<EscriptParserVisitor*>(visitor))
|
|
return parserVisitor->visitProgramParameterList(this);
|
|
else
|
|
return visitor->visitChildren(this);
|
|
}
|
|
|
|
EscriptParser::ProgramParameterListContext* EscriptParser::programParameterList() {
|
|
ProgramParameterListContext *_localctx = _tracker.createInstance<ProgramParameterListContext>(_ctx, getState());
|
|
enterRule(_localctx, 116, EscriptParser::RuleProgramParameterList);
|
|
size_t _la = 0;
|
|
|
|
#if __cplusplus > 201703L
|
|
auto onExit = finally([=, this] {
|
|
#else
|
|
auto onExit = finally([=] {
|
|
#endif
|
|
exitRule();
|
|
});
|
|
try {
|
|
enterOuterAlt(_localctx, 1);
|
|
setState(626);
|
|
programParameter();
|
|
setState(633);
|
|
_errHandler->sync(this);
|
|
_la = _input->LA(1);
|
|
while (_la == EscriptParser::UNUSED || _la == EscriptParser::COMMA
|
|
|
|
|| _la == EscriptParser::IDENTIFIER) {
|
|
setState(628);
|
|
_errHandler->sync(this);
|
|
|
|
_la = _input->LA(1);
|
|
if (_la == EscriptParser::COMMA) {
|
|
setState(627);
|
|
match(EscriptParser::COMMA);
|
|
}
|
|
setState(630);
|
|
programParameter();
|
|
setState(635);
|
|
_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<EscriptParser::ExpressionContext>(0);
|
|
}
|
|
|
|
|
|
size_t EscriptParser::ProgramParameterContext::getRuleIndex() const {
|
|
return EscriptParser::RuleProgramParameter;
|
|
}
|
|
|
|
void EscriptParser::ProgramParameterContext::enterRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->enterProgramParameter(this);
|
|
}
|
|
|
|
void EscriptParser::ProgramParameterContext::exitRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->exitProgramParameter(this);
|
|
}
|
|
|
|
|
|
std::any EscriptParser::ProgramParameterContext::accept(tree::ParseTreeVisitor *visitor) {
|
|
if (auto parserVisitor = dynamic_cast<EscriptParserVisitor*>(visitor))
|
|
return parserVisitor->visitProgramParameter(this);
|
|
else
|
|
return visitor->visitChildren(this);
|
|
}
|
|
|
|
EscriptParser::ProgramParameterContext* EscriptParser::programParameter() {
|
|
ProgramParameterContext *_localctx = _tracker.createInstance<ProgramParameterContext>(_ctx, getState());
|
|
enterRule(_localctx, 118, EscriptParser::RuleProgramParameter);
|
|
size_t _la = 0;
|
|
|
|
#if __cplusplus > 201703L
|
|
auto onExit = finally([=, this] {
|
|
#else
|
|
auto onExit = finally([=] {
|
|
#endif
|
|
exitRule();
|
|
});
|
|
try {
|
|
setState(643);
|
|
_errHandler->sync(this);
|
|
switch (_input->LA(1)) {
|
|
case EscriptParser::UNUSED: {
|
|
enterOuterAlt(_localctx, 1);
|
|
setState(636);
|
|
match(EscriptParser::UNUSED);
|
|
setState(637);
|
|
match(EscriptParser::IDENTIFIER);
|
|
break;
|
|
}
|
|
|
|
case EscriptParser::IDENTIFIER: {
|
|
enterOuterAlt(_localctx, 2);
|
|
setState(638);
|
|
match(EscriptParser::IDENTIFIER);
|
|
setState(641);
|
|
_errHandler->sync(this);
|
|
|
|
_la = _input->LA(1);
|
|
if (_la == EscriptParser::ASSIGN) {
|
|
setState(639);
|
|
match(EscriptParser::ASSIGN);
|
|
setState(640);
|
|
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<EscriptParser::FunctionParameterListContext>(0);
|
|
}
|
|
|
|
|
|
size_t EscriptParser::FunctionParametersContext::getRuleIndex() const {
|
|
return EscriptParser::RuleFunctionParameters;
|
|
}
|
|
|
|
void EscriptParser::FunctionParametersContext::enterRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->enterFunctionParameters(this);
|
|
}
|
|
|
|
void EscriptParser::FunctionParametersContext::exitRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->exitFunctionParameters(this);
|
|
}
|
|
|
|
|
|
std::any EscriptParser::FunctionParametersContext::accept(tree::ParseTreeVisitor *visitor) {
|
|
if (auto parserVisitor = dynamic_cast<EscriptParserVisitor*>(visitor))
|
|
return parserVisitor->visitFunctionParameters(this);
|
|
else
|
|
return visitor->visitChildren(this);
|
|
}
|
|
|
|
EscriptParser::FunctionParametersContext* EscriptParser::functionParameters() {
|
|
FunctionParametersContext *_localctx = _tracker.createInstance<FunctionParametersContext>(_ctx, getState());
|
|
enterRule(_localctx, 120, EscriptParser::RuleFunctionParameters);
|
|
size_t _la = 0;
|
|
|
|
#if __cplusplus > 201703L
|
|
auto onExit = finally([=, this] {
|
|
#else
|
|
auto onExit = finally([=] {
|
|
#endif
|
|
exitRule();
|
|
});
|
|
try {
|
|
enterOuterAlt(_localctx, 1);
|
|
setState(645);
|
|
match(EscriptParser::LPAREN);
|
|
setState(647);
|
|
_errHandler->sync(this);
|
|
|
|
_la = _input->LA(1);
|
|
if ((((_la & ~ 0x3fULL) == 0) &&
|
|
((1ULL << _la) & 3458764518115508224) != 0) || _la == EscriptParser::IDENTIFIER) {
|
|
setState(646);
|
|
functionParameterList();
|
|
}
|
|
setState(649);
|
|
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::FunctionParameterContext *> EscriptParser::FunctionParameterListContext::functionParameter() {
|
|
return getRuleContexts<EscriptParser::FunctionParameterContext>();
|
|
}
|
|
|
|
EscriptParser::FunctionParameterContext* EscriptParser::FunctionParameterListContext::functionParameter(size_t i) {
|
|
return getRuleContext<EscriptParser::FunctionParameterContext>(i);
|
|
}
|
|
|
|
std::vector<tree::TerminalNode *> 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<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->enterFunctionParameterList(this);
|
|
}
|
|
|
|
void EscriptParser::FunctionParameterListContext::exitRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->exitFunctionParameterList(this);
|
|
}
|
|
|
|
|
|
std::any EscriptParser::FunctionParameterListContext::accept(tree::ParseTreeVisitor *visitor) {
|
|
if (auto parserVisitor = dynamic_cast<EscriptParserVisitor*>(visitor))
|
|
return parserVisitor->visitFunctionParameterList(this);
|
|
else
|
|
return visitor->visitChildren(this);
|
|
}
|
|
|
|
EscriptParser::FunctionParameterListContext* EscriptParser::functionParameterList() {
|
|
FunctionParameterListContext *_localctx = _tracker.createInstance<FunctionParameterListContext>(_ctx, getState());
|
|
enterRule(_localctx, 122, EscriptParser::RuleFunctionParameterList);
|
|
size_t _la = 0;
|
|
|
|
#if __cplusplus > 201703L
|
|
auto onExit = finally([=, this] {
|
|
#else
|
|
auto onExit = finally([=] {
|
|
#endif
|
|
exitRule();
|
|
});
|
|
try {
|
|
enterOuterAlt(_localctx, 1);
|
|
setState(651);
|
|
functionParameter();
|
|
setState(656);
|
|
_errHandler->sync(this);
|
|
_la = _input->LA(1);
|
|
while (_la == EscriptParser::COMMA) {
|
|
setState(652);
|
|
match(EscriptParser::COMMA);
|
|
setState(653);
|
|
functionParameter();
|
|
setState(658);
|
|
_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::DEFAULT() {
|
|
return getToken(EscriptParser::DEFAULT, 0);
|
|
}
|
|
|
|
tree::TerminalNode* EscriptParser::FunctionParameterContext::ELLIPSIS() {
|
|
return getToken(EscriptParser::ELLIPSIS, 0);
|
|
}
|
|
|
|
tree::TerminalNode* EscriptParser::FunctionParameterContext::ASSIGN() {
|
|
return getToken(EscriptParser::ASSIGN, 0);
|
|
}
|
|
|
|
EscriptParser::ExpressionContext* EscriptParser::FunctionParameterContext::expression() {
|
|
return getRuleContext<EscriptParser::ExpressionContext>(0);
|
|
}
|
|
|
|
|
|
size_t EscriptParser::FunctionParameterContext::getRuleIndex() const {
|
|
return EscriptParser::RuleFunctionParameter;
|
|
}
|
|
|
|
void EscriptParser::FunctionParameterContext::enterRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->enterFunctionParameter(this);
|
|
}
|
|
|
|
void EscriptParser::FunctionParameterContext::exitRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->exitFunctionParameter(this);
|
|
}
|
|
|
|
|
|
std::any EscriptParser::FunctionParameterContext::accept(tree::ParseTreeVisitor *visitor) {
|
|
if (auto parserVisitor = dynamic_cast<EscriptParserVisitor*>(visitor))
|
|
return parserVisitor->visitFunctionParameter(this);
|
|
else
|
|
return visitor->visitChildren(this);
|
|
}
|
|
|
|
EscriptParser::FunctionParameterContext* EscriptParser::functionParameter() {
|
|
FunctionParameterContext *_localctx = _tracker.createInstance<FunctionParameterContext>(_ctx, getState());
|
|
enterRule(_localctx, 124, EscriptParser::RuleFunctionParameter);
|
|
size_t _la = 0;
|
|
|
|
#if __cplusplus > 201703L
|
|
auto onExit = finally([=, this] {
|
|
#else
|
|
auto onExit = finally([=] {
|
|
#endif
|
|
exitRule();
|
|
});
|
|
try {
|
|
enterOuterAlt(_localctx, 1);
|
|
setState(660);
|
|
_errHandler->sync(this);
|
|
|
|
_la = _input->LA(1);
|
|
if (_la == EscriptParser::BYREF) {
|
|
setState(659);
|
|
match(EscriptParser::BYREF);
|
|
}
|
|
setState(664);
|
|
_errHandler->sync(this);
|
|
|
|
_la = _input->LA(1);
|
|
if (_la == EscriptParser::UNUSED) {
|
|
if ( inUninitFunction ) notifyErrorListeners( "The 'unused' keyword may not be used here." );
|
|
setState(663);
|
|
match(EscriptParser::UNUSED);
|
|
}
|
|
setState(668);
|
|
_errHandler->sync(this);
|
|
|
|
_la = _input->LA(1);
|
|
if (_la == EscriptParser::DEFAULT) {
|
|
if ( !inUninitFunction ) notifyErrorListeners( "The 'default' keyword may not be used here." );
|
|
setState(667);
|
|
match(EscriptParser::DEFAULT);
|
|
}
|
|
setState(670);
|
|
match(EscriptParser::IDENTIFIER);
|
|
setState(672);
|
|
_errHandler->sync(this);
|
|
|
|
_la = _input->LA(1);
|
|
if (_la == EscriptParser::ELLIPSIS) {
|
|
setState(671);
|
|
match(EscriptParser::ELLIPSIS);
|
|
}
|
|
setState(677);
|
|
_errHandler->sync(this);
|
|
|
|
_la = _input->LA(1);
|
|
if (_la == EscriptParser::ASSIGN) {
|
|
setState(674);
|
|
match(EscriptParser::ASSIGN);
|
|
if ( inUninitFunction ) notifyErrorListeners( "A parameter may not be given a default value here." );
|
|
setState(676);
|
|
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::COLONCOLON() {
|
|
return getToken(EscriptParser::COLONCOLON, 0);
|
|
}
|
|
|
|
EscriptParser::FunctionCallContext* EscriptParser::ScopedFunctionCallContext::functionCall() {
|
|
return getRuleContext<EscriptParser::FunctionCallContext>(0);
|
|
}
|
|
|
|
tree::TerminalNode* EscriptParser::ScopedFunctionCallContext::IDENTIFIER() {
|
|
return getToken(EscriptParser::IDENTIFIER, 0);
|
|
}
|
|
|
|
|
|
size_t EscriptParser::ScopedFunctionCallContext::getRuleIndex() const {
|
|
return EscriptParser::RuleScopedFunctionCall;
|
|
}
|
|
|
|
void EscriptParser::ScopedFunctionCallContext::enterRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->enterScopedFunctionCall(this);
|
|
}
|
|
|
|
void EscriptParser::ScopedFunctionCallContext::exitRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->exitScopedFunctionCall(this);
|
|
}
|
|
|
|
|
|
std::any EscriptParser::ScopedFunctionCallContext::accept(tree::ParseTreeVisitor *visitor) {
|
|
if (auto parserVisitor = dynamic_cast<EscriptParserVisitor*>(visitor))
|
|
return parserVisitor->visitScopedFunctionCall(this);
|
|
else
|
|
return visitor->visitChildren(this);
|
|
}
|
|
|
|
EscriptParser::ScopedFunctionCallContext* EscriptParser::scopedFunctionCall() {
|
|
ScopedFunctionCallContext *_localctx = _tracker.createInstance<ScopedFunctionCallContext>(_ctx, getState());
|
|
enterRule(_localctx, 126, EscriptParser::RuleScopedFunctionCall);
|
|
size_t _la = 0;
|
|
|
|
#if __cplusplus > 201703L
|
|
auto onExit = finally([=, this] {
|
|
#else
|
|
auto onExit = finally([=] {
|
|
#endif
|
|
exitRule();
|
|
});
|
|
try {
|
|
enterOuterAlt(_localctx, 1);
|
|
setState(680);
|
|
_errHandler->sync(this);
|
|
|
|
_la = _input->LA(1);
|
|
if (_la == EscriptParser::IDENTIFIER) {
|
|
setState(679);
|
|
match(EscriptParser::IDENTIFIER);
|
|
}
|
|
setState(682);
|
|
match(EscriptParser::COLONCOLON);
|
|
setState(683);
|
|
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);
|
|
}
|
|
|
|
std::vector<tree::TerminalNode *> EscriptParser::FunctionReferenceContext::IDENTIFIER() {
|
|
return getTokens(EscriptParser::IDENTIFIER);
|
|
}
|
|
|
|
tree::TerminalNode* EscriptParser::FunctionReferenceContext::IDENTIFIER(size_t i) {
|
|
return getToken(EscriptParser::IDENTIFIER, i);
|
|
}
|
|
|
|
tree::TerminalNode* EscriptParser::FunctionReferenceContext::COLONCOLON() {
|
|
return getToken(EscriptParser::COLONCOLON, 0);
|
|
}
|
|
|
|
|
|
size_t EscriptParser::FunctionReferenceContext::getRuleIndex() const {
|
|
return EscriptParser::RuleFunctionReference;
|
|
}
|
|
|
|
void EscriptParser::FunctionReferenceContext::enterRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->enterFunctionReference(this);
|
|
}
|
|
|
|
void EscriptParser::FunctionReferenceContext::exitRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->exitFunctionReference(this);
|
|
}
|
|
|
|
|
|
std::any EscriptParser::FunctionReferenceContext::accept(tree::ParseTreeVisitor *visitor) {
|
|
if (auto parserVisitor = dynamic_cast<EscriptParserVisitor*>(visitor))
|
|
return parserVisitor->visitFunctionReference(this);
|
|
else
|
|
return visitor->visitChildren(this);
|
|
}
|
|
|
|
EscriptParser::FunctionReferenceContext* EscriptParser::functionReference() {
|
|
FunctionReferenceContext *_localctx = _tracker.createInstance<FunctionReferenceContext>(_ctx, getState());
|
|
enterRule(_localctx, 128, EscriptParser::RuleFunctionReference);
|
|
size_t _la = 0;
|
|
|
|
#if __cplusplus > 201703L
|
|
auto onExit = finally([=, this] {
|
|
#else
|
|
auto onExit = finally([=] {
|
|
#endif
|
|
exitRule();
|
|
});
|
|
try {
|
|
enterOuterAlt(_localctx, 1);
|
|
setState(685);
|
|
match(EscriptParser::AT);
|
|
setState(690);
|
|
_errHandler->sync(this);
|
|
|
|
switch (getInterpreter<atn::ParserATNSimulator>()->adaptivePredict(_input, 65, _ctx)) {
|
|
case 1: {
|
|
setState(687);
|
|
_errHandler->sync(this);
|
|
|
|
_la = _input->LA(1);
|
|
if (_la == EscriptParser::IDENTIFIER) {
|
|
setState(686);
|
|
antlrcpp::downCast<FunctionReferenceContext *>(_localctx)->scope = match(EscriptParser::IDENTIFIER);
|
|
}
|
|
setState(689);
|
|
match(EscriptParser::COLONCOLON);
|
|
break;
|
|
}
|
|
|
|
default:
|
|
break;
|
|
}
|
|
setState(692);
|
|
antlrcpp::downCast<FunctionReferenceContext *>(_localctx)->function = 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<EscriptParser::PrimaryContext>(0);
|
|
}
|
|
|
|
std::vector<EscriptParser::ExpressionContext *> EscriptParser::ExpressionContext::expression() {
|
|
return getRuleContexts<EscriptParser::ExpressionContext>();
|
|
}
|
|
|
|
EscriptParser::ExpressionContext* EscriptParser::ExpressionContext::expression(size_t i) {
|
|
return getRuleContext<EscriptParser::ExpressionContext>(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::IS() {
|
|
return getToken(EscriptParser::IS, 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<EscriptParser::ExpressionSuffixContext>(0);
|
|
}
|
|
|
|
|
|
size_t EscriptParser::ExpressionContext::getRuleIndex() const {
|
|
return EscriptParser::RuleExpression;
|
|
}
|
|
|
|
void EscriptParser::ExpressionContext::enterRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->enterExpression(this);
|
|
}
|
|
|
|
void EscriptParser::ExpressionContext::exitRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->exitExpression(this);
|
|
}
|
|
|
|
|
|
std::any EscriptParser::ExpressionContext::accept(tree::ParseTreeVisitor *visitor) {
|
|
if (auto parserVisitor = dynamic_cast<EscriptParserVisitor*>(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<ExpressionContext>(_ctx, parentState);
|
|
EscriptParser::ExpressionContext *previousContext = _localctx;
|
|
(void)previousContext; // Silence compiler, in case the context is not used by generated code.
|
|
size_t startState = 130;
|
|
enterRecursionRule(_localctx, 130, 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(700);
|
|
_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::REGEXP_LITERAL:
|
|
case EscriptParser::INTERPOLATED_STRING_START:
|
|
case EscriptParser::LPAREN:
|
|
case EscriptParser::LBRACE:
|
|
case EscriptParser::AT:
|
|
case EscriptParser::COLONCOLON:
|
|
case EscriptParser::IDENTIFIER: {
|
|
setState(695);
|
|
primary();
|
|
break;
|
|
}
|
|
|
|
case EscriptParser::ADD:
|
|
case EscriptParser::SUB:
|
|
case EscriptParser::INC:
|
|
case EscriptParser::DEC: {
|
|
setState(696);
|
|
antlrcpp::downCast<ExpressionContext *>(_localctx)->prefix = _input->LT(1);
|
|
_la = _input->LA(1);
|
|
if (!(((((_la - 93) & ~ 0x3fULL) == 0) &&
|
|
((1ULL << (_la - 93)) & 3221225475) != 0))) {
|
|
antlrcpp::downCast<ExpressionContext *>(_localctx)->prefix = _errHandler->recoverInline(this);
|
|
}
|
|
else {
|
|
_errHandler->reportMatch(this);
|
|
consume();
|
|
}
|
|
setState(697);
|
|
expression(15);
|
|
break;
|
|
}
|
|
|
|
case EscriptParser::BANG_A:
|
|
case EscriptParser::BANG_B:
|
|
case EscriptParser::TILDE: {
|
|
setState(698);
|
|
antlrcpp::downCast<ExpressionContext *>(_localctx)->prefix = _input->LT(1);
|
|
_la = _input->LA(1);
|
|
if (!(((((_la - 58) & ~ 0x3fULL) == 0) &&
|
|
((1ULL << (_la - 58)) & 2305843009213693955) != 0))) {
|
|
antlrcpp::downCast<ExpressionContext *>(_localctx)->prefix = _errHandler->recoverInline(this);
|
|
}
|
|
else {
|
|
_errHandler->reportMatch(this);
|
|
consume();
|
|
}
|
|
setState(699);
|
|
expression(14);
|
|
break;
|
|
}
|
|
|
|
default:
|
|
throw NoViableAltException(this);
|
|
}
|
|
_ctx->stop = _input->LT(-1);
|
|
setState(751);
|
|
_errHandler->sync(this);
|
|
alt = getInterpreter<atn::ParserATNSimulator>()->adaptivePredict(_input, 68, _ctx);
|
|
while (alt != 2 && alt != atn::ATN::INVALID_ALT_NUMBER) {
|
|
if (alt == 1) {
|
|
if (!_parseListeners.empty())
|
|
triggerExitRuleEvent();
|
|
previousContext = _localctx;
|
|
setState(749);
|
|
_errHandler->sync(this);
|
|
switch (getInterpreter<atn::ParserATNSimulator>()->adaptivePredict(_input, 67, _ctx)) {
|
|
case 1: {
|
|
_localctx = _tracker.createInstance<ExpressionContext>(parentContext, parentState);
|
|
pushNewRecursionContext(_localctx, startState, RuleExpression);
|
|
setState(702);
|
|
|
|
if (!(precpred(_ctx, 13))) throw FailedPredicateException(this, "precpred(_ctx, 13)");
|
|
setState(703);
|
|
antlrcpp::downCast<ExpressionContext *>(_localctx)->bop = _input->LT(1);
|
|
_la = _input->LA(1);
|
|
if (!(((((_la - 90) & ~ 0x3fULL) == 0) &&
|
|
((1ULL << (_la - 90)) & 114695) != 0))) {
|
|
antlrcpp::downCast<ExpressionContext *>(_localctx)->bop = _errHandler->recoverInline(this);
|
|
}
|
|
else {
|
|
_errHandler->reportMatch(this);
|
|
consume();
|
|
}
|
|
setState(704);
|
|
expression(14);
|
|
break;
|
|
}
|
|
|
|
case 2: {
|
|
_localctx = _tracker.createInstance<ExpressionContext>(parentContext, parentState);
|
|
pushNewRecursionContext(_localctx, startState, RuleExpression);
|
|
setState(705);
|
|
|
|
if (!(precpred(_ctx, 12))) throw FailedPredicateException(this, "precpred(_ctx, 12)");
|
|
setState(706);
|
|
antlrcpp::downCast<ExpressionContext *>(_localctx)->bop = _input->LT(1);
|
|
_la = _input->LA(1);
|
|
if (!(((((_la - 93) & ~ 0x3fULL) == 0) &&
|
|
((1ULL << (_la - 93)) & 49155) != 0))) {
|
|
antlrcpp::downCast<ExpressionContext *>(_localctx)->bop = _errHandler->recoverInline(this);
|
|
}
|
|
else {
|
|
_errHandler->reportMatch(this);
|
|
consume();
|
|
}
|
|
setState(707);
|
|
expression(13);
|
|
break;
|
|
}
|
|
|
|
case 3: {
|
|
_localctx = _tracker.createInstance<ExpressionContext>(parentContext, parentState);
|
|
pushNewRecursionContext(_localctx, startState, RuleExpression);
|
|
setState(708);
|
|
|
|
if (!(precpred(_ctx, 11))) throw FailedPredicateException(this, "precpred(_ctx, 11)");
|
|
setState(709);
|
|
antlrcpp::downCast<ExpressionContext *>(_localctx)->bop = match(EscriptParser::ELVIS);
|
|
setState(710);
|
|
expression(12);
|
|
break;
|
|
}
|
|
|
|
case 4: {
|
|
_localctx = _tracker.createInstance<ExpressionContext>(parentContext, parentState);
|
|
pushNewRecursionContext(_localctx, startState, RuleExpression);
|
|
setState(711);
|
|
|
|
if (!(precpred(_ctx, 10))) throw FailedPredicateException(this, "precpred(_ctx, 10)");
|
|
setState(712);
|
|
antlrcpp::downCast<ExpressionContext *>(_localctx)->bop = match(EscriptParser::TOK_IN);
|
|
setState(713);
|
|
expression(11);
|
|
break;
|
|
}
|
|
|
|
case 5: {
|
|
_localctx = _tracker.createInstance<ExpressionContext>(parentContext, parentState);
|
|
pushNewRecursionContext(_localctx, startState, RuleExpression);
|
|
setState(714);
|
|
|
|
if (!(precpred(_ctx, 9))) throw FailedPredicateException(this, "precpred(_ctx, 9)");
|
|
setState(715);
|
|
antlrcpp::downCast<ExpressionContext *>(_localctx)->bop = _input->LT(1);
|
|
_la = _input->LA(1);
|
|
if (!(((((_la - 100) & ~ 0x3fULL) == 0) &&
|
|
((1ULL << (_la - 100)) & 15) != 0))) {
|
|
antlrcpp::downCast<ExpressionContext *>(_localctx)->bop = _errHandler->recoverInline(this);
|
|
}
|
|
else {
|
|
_errHandler->reportMatch(this);
|
|
consume();
|
|
}
|
|
setState(716);
|
|
expression(10);
|
|
break;
|
|
}
|
|
|
|
case 6: {
|
|
_localctx = _tracker.createInstance<ExpressionContext>(parentContext, parentState);
|
|
pushNewRecursionContext(_localctx, startState, RuleExpression);
|
|
setState(717);
|
|
|
|
if (!(precpred(_ctx, 8))) throw FailedPredicateException(this, "precpred(_ctx, 8)");
|
|
setState(718);
|
|
antlrcpp::downCast<ExpressionContext *>(_localctx)->bop = match(EscriptParser::IS);
|
|
setState(719);
|
|
expression(9);
|
|
break;
|
|
}
|
|
|
|
case 7: {
|
|
_localctx = _tracker.createInstance<ExpressionContext>(parentContext, parentState);
|
|
pushNewRecursionContext(_localctx, startState, RuleExpression);
|
|
setState(720);
|
|
|
|
if (!(precpred(_ctx, 7))) throw FailedPredicateException(this, "precpred(_ctx, 7)");
|
|
setState(721);
|
|
antlrcpp::downCast<ExpressionContext *>(_localctx)->bop = match(EscriptParser::EQUAL_DEPRECATED);
|
|
notifyErrorListeners("Deprecated '=' found: did you mean '==' or ':='?\n");
|
|
setState(723);
|
|
expression(8);
|
|
break;
|
|
}
|
|
|
|
case 8: {
|
|
_localctx = _tracker.createInstance<ExpressionContext>(parentContext, parentState);
|
|
pushNewRecursionContext(_localctx, startState, RuleExpression);
|
|
setState(724);
|
|
|
|
if (!(precpred(_ctx, 6))) throw FailedPredicateException(this, "precpred(_ctx, 6)");
|
|
setState(725);
|
|
antlrcpp::downCast<ExpressionContext *>(_localctx)->bop = _input->LT(1);
|
|
_la = _input->LA(1);
|
|
if (!(((((_la - 109) & ~ 0x3fULL) == 0) &&
|
|
((1ULL << (_la - 109)) & 11) != 0))) {
|
|
antlrcpp::downCast<ExpressionContext *>(_localctx)->bop = _errHandler->recoverInline(this);
|
|
}
|
|
else {
|
|
_errHandler->reportMatch(this);
|
|
consume();
|
|
}
|
|
setState(726);
|
|
expression(7);
|
|
break;
|
|
}
|
|
|
|
case 9: {
|
|
_localctx = _tracker.createInstance<ExpressionContext>(parentContext, parentState);
|
|
pushNewRecursionContext(_localctx, startState, RuleExpression);
|
|
setState(727);
|
|
|
|
if (!(precpred(_ctx, 5))) throw FailedPredicateException(this, "precpred(_ctx, 5)");
|
|
setState(728);
|
|
antlrcpp::downCast<ExpressionContext *>(_localctx)->bop = _input->LT(1);
|
|
_la = _input->LA(1);
|
|
if (!(_la == EscriptParser::AND_A
|
|
|
|
|| _la == EscriptParser::AND_B)) {
|
|
antlrcpp::downCast<ExpressionContext *>(_localctx)->bop = _errHandler->recoverInline(this);
|
|
}
|
|
else {
|
|
_errHandler->reportMatch(this);
|
|
consume();
|
|
}
|
|
setState(729);
|
|
expression(6);
|
|
break;
|
|
}
|
|
|
|
case 10: {
|
|
_localctx = _tracker.createInstance<ExpressionContext>(parentContext, parentState);
|
|
pushNewRecursionContext(_localctx, startState, RuleExpression);
|
|
setState(730);
|
|
|
|
if (!(precpred(_ctx, 4))) throw FailedPredicateException(this, "precpred(_ctx, 4)");
|
|
setState(731);
|
|
antlrcpp::downCast<ExpressionContext *>(_localctx)->bop = _input->LT(1);
|
|
_la = _input->LA(1);
|
|
if (!(_la == EscriptParser::OR_A
|
|
|
|
|| _la == EscriptParser::OR_B)) {
|
|
antlrcpp::downCast<ExpressionContext *>(_localctx)->bop = _errHandler->recoverInline(this);
|
|
}
|
|
else {
|
|
_errHandler->reportMatch(this);
|
|
consume();
|
|
}
|
|
setState(732);
|
|
expression(5);
|
|
break;
|
|
}
|
|
|
|
case 11: {
|
|
_localctx = _tracker.createInstance<ExpressionContext>(parentContext, parentState);
|
|
pushNewRecursionContext(_localctx, startState, RuleExpression);
|
|
setState(733);
|
|
|
|
if (!(precpred(_ctx, 3))) throw FailedPredicateException(this, "precpred(_ctx, 3)");
|
|
setState(734);
|
|
match(EscriptParser::QUESTION);
|
|
setState(735);
|
|
expression(0);
|
|
setState(736);
|
|
match(EscriptParser::COLON);
|
|
setState(737);
|
|
expression(4);
|
|
break;
|
|
}
|
|
|
|
case 12: {
|
|
_localctx = _tracker.createInstance<ExpressionContext>(parentContext, parentState);
|
|
pushNewRecursionContext(_localctx, startState, RuleExpression);
|
|
setState(739);
|
|
|
|
if (!(precpred(_ctx, 2))) throw FailedPredicateException(this, "precpred(_ctx, 2)");
|
|
setState(740);
|
|
antlrcpp::downCast<ExpressionContext *>(_localctx)->bop = _input->LT(1);
|
|
_la = _input->LA(1);
|
|
if (!(((((_la - 114) & ~ 0x3fULL) == 0) &&
|
|
((1ULL << (_la - 114)) & 7) != 0))) {
|
|
antlrcpp::downCast<ExpressionContext *>(_localctx)->bop = _errHandler->recoverInline(this);
|
|
}
|
|
else {
|
|
_errHandler->reportMatch(this);
|
|
consume();
|
|
}
|
|
setState(741);
|
|
expression(2);
|
|
break;
|
|
}
|
|
|
|
case 13: {
|
|
_localctx = _tracker.createInstance<ExpressionContext>(parentContext, parentState);
|
|
pushNewRecursionContext(_localctx, startState, RuleExpression);
|
|
setState(742);
|
|
|
|
if (!(precpred(_ctx, 1))) throw FailedPredicateException(this, "precpred(_ctx, 1)");
|
|
setState(743);
|
|
antlrcpp::downCast<ExpressionContext *>(_localctx)->bop = _input->LT(1);
|
|
_la = _input->LA(1);
|
|
if (!(((((_la - 95) & ~ 0x3fULL) == 0) &&
|
|
((1ULL << (_la - 95)) & 262175) != 0))) {
|
|
antlrcpp::downCast<ExpressionContext *>(_localctx)->bop = _errHandler->recoverInline(this);
|
|
}
|
|
else {
|
|
_errHandler->reportMatch(this);
|
|
consume();
|
|
}
|
|
setState(744);
|
|
expression(1);
|
|
break;
|
|
}
|
|
|
|
case 14: {
|
|
_localctx = _tracker.createInstance<ExpressionContext>(parentContext, parentState);
|
|
pushNewRecursionContext(_localctx, startState, RuleExpression);
|
|
setState(745);
|
|
|
|
if (!(precpred(_ctx, 17))) throw FailedPredicateException(this, "precpred(_ctx, 17)");
|
|
setState(746);
|
|
expressionSuffix();
|
|
break;
|
|
}
|
|
|
|
case 15: {
|
|
_localctx = _tracker.createInstance<ExpressionContext>(parentContext, parentState);
|
|
pushNewRecursionContext(_localctx, startState, RuleExpression);
|
|
setState(747);
|
|
|
|
if (!(precpred(_ctx, 16))) throw FailedPredicateException(this, "precpred(_ctx, 16)");
|
|
setState(748);
|
|
antlrcpp::downCast<ExpressionContext *>(_localctx)->postfix = _input->LT(1);
|
|
_la = _input->LA(1);
|
|
if (!(_la == EscriptParser::INC
|
|
|
|
|| _la == EscriptParser::DEC)) {
|
|
antlrcpp::downCast<ExpressionContext *>(_localctx)->postfix = _errHandler->recoverInline(this);
|
|
}
|
|
else {
|
|
_errHandler->reportMatch(this);
|
|
consume();
|
|
}
|
|
break;
|
|
}
|
|
|
|
default:
|
|
break;
|
|
}
|
|
}
|
|
setState(753);
|
|
_errHandler->sync(this);
|
|
alt = getInterpreter<atn::ParserATNSimulator>()->adaptivePredict(_input, 68, _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<EscriptParser::LiteralContext>(0);
|
|
}
|
|
|
|
EscriptParser::ParExpressionContext* EscriptParser::PrimaryContext::parExpression() {
|
|
return getRuleContext<EscriptParser::ParExpressionContext>(0);
|
|
}
|
|
|
|
EscriptParser::FunctionCallContext* EscriptParser::PrimaryContext::functionCall() {
|
|
return getRuleContext<EscriptParser::FunctionCallContext>(0);
|
|
}
|
|
|
|
EscriptParser::ScopedFunctionCallContext* EscriptParser::PrimaryContext::scopedFunctionCall() {
|
|
return getRuleContext<EscriptParser::ScopedFunctionCallContext>(0);
|
|
}
|
|
|
|
EscriptParser::ScopedIdentifierContext* EscriptParser::PrimaryContext::scopedIdentifier() {
|
|
return getRuleContext<EscriptParser::ScopedIdentifierContext>(0);
|
|
}
|
|
|
|
tree::TerminalNode* EscriptParser::PrimaryContext::IDENTIFIER() {
|
|
return getToken(EscriptParser::IDENTIFIER, 0);
|
|
}
|
|
|
|
EscriptParser::FunctionReferenceContext* EscriptParser::PrimaryContext::functionReference() {
|
|
return getRuleContext<EscriptParser::FunctionReferenceContext>(0);
|
|
}
|
|
|
|
EscriptParser::FunctionExpressionContext* EscriptParser::PrimaryContext::functionExpression() {
|
|
return getRuleContext<EscriptParser::FunctionExpressionContext>(0);
|
|
}
|
|
|
|
EscriptParser::ExplicitArrayInitializerContext* EscriptParser::PrimaryContext::explicitArrayInitializer() {
|
|
return getRuleContext<EscriptParser::ExplicitArrayInitializerContext>(0);
|
|
}
|
|
|
|
EscriptParser::ExplicitStructInitializerContext* EscriptParser::PrimaryContext::explicitStructInitializer() {
|
|
return getRuleContext<EscriptParser::ExplicitStructInitializerContext>(0);
|
|
}
|
|
|
|
EscriptParser::ExplicitDictInitializerContext* EscriptParser::PrimaryContext::explicitDictInitializer() {
|
|
return getRuleContext<EscriptParser::ExplicitDictInitializerContext>(0);
|
|
}
|
|
|
|
EscriptParser::ExplicitErrorInitializerContext* EscriptParser::PrimaryContext::explicitErrorInitializer() {
|
|
return getRuleContext<EscriptParser::ExplicitErrorInitializerContext>(0);
|
|
}
|
|
|
|
EscriptParser::BareArrayInitializerContext* EscriptParser::PrimaryContext::bareArrayInitializer() {
|
|
return getRuleContext<EscriptParser::BareArrayInitializerContext>(0);
|
|
}
|
|
|
|
EscriptParser::InterpolatedStringContext* EscriptParser::PrimaryContext::interpolatedString() {
|
|
return getRuleContext<EscriptParser::InterpolatedStringContext>(0);
|
|
}
|
|
|
|
|
|
size_t EscriptParser::PrimaryContext::getRuleIndex() const {
|
|
return EscriptParser::RulePrimary;
|
|
}
|
|
|
|
void EscriptParser::PrimaryContext::enterRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->enterPrimary(this);
|
|
}
|
|
|
|
void EscriptParser::PrimaryContext::exitRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->exitPrimary(this);
|
|
}
|
|
|
|
|
|
std::any EscriptParser::PrimaryContext::accept(tree::ParseTreeVisitor *visitor) {
|
|
if (auto parserVisitor = dynamic_cast<EscriptParserVisitor*>(visitor))
|
|
return parserVisitor->visitPrimary(this);
|
|
else
|
|
return visitor->visitChildren(this);
|
|
}
|
|
|
|
EscriptParser::PrimaryContext* EscriptParser::primary() {
|
|
PrimaryContext *_localctx = _tracker.createInstance<PrimaryContext>(_ctx, getState());
|
|
enterRule(_localctx, 132, EscriptParser::RulePrimary);
|
|
|
|
#if __cplusplus > 201703L
|
|
auto onExit = finally([=, this] {
|
|
#else
|
|
auto onExit = finally([=] {
|
|
#endif
|
|
exitRule();
|
|
});
|
|
try {
|
|
setState(768);
|
|
_errHandler->sync(this);
|
|
switch (getInterpreter<atn::ParserATNSimulator>()->adaptivePredict(_input, 69, _ctx)) {
|
|
case 1: {
|
|
enterOuterAlt(_localctx, 1);
|
|
setState(754);
|
|
literal();
|
|
break;
|
|
}
|
|
|
|
case 2: {
|
|
enterOuterAlt(_localctx, 2);
|
|
setState(755);
|
|
parExpression();
|
|
break;
|
|
}
|
|
|
|
case 3: {
|
|
enterOuterAlt(_localctx, 3);
|
|
setState(756);
|
|
functionCall();
|
|
break;
|
|
}
|
|
|
|
case 4: {
|
|
enterOuterAlt(_localctx, 4);
|
|
setState(757);
|
|
scopedFunctionCall();
|
|
break;
|
|
}
|
|
|
|
case 5: {
|
|
enterOuterAlt(_localctx, 5);
|
|
setState(758);
|
|
scopedIdentifier();
|
|
break;
|
|
}
|
|
|
|
case 6: {
|
|
enterOuterAlt(_localctx, 6);
|
|
setState(759);
|
|
match(EscriptParser::IDENTIFIER);
|
|
break;
|
|
}
|
|
|
|
case 7: {
|
|
enterOuterAlt(_localctx, 7);
|
|
setState(760);
|
|
functionReference();
|
|
break;
|
|
}
|
|
|
|
case 8: {
|
|
enterOuterAlt(_localctx, 8);
|
|
setState(761);
|
|
functionExpression();
|
|
break;
|
|
}
|
|
|
|
case 9: {
|
|
enterOuterAlt(_localctx, 9);
|
|
setState(762);
|
|
explicitArrayInitializer();
|
|
break;
|
|
}
|
|
|
|
case 10: {
|
|
enterOuterAlt(_localctx, 10);
|
|
setState(763);
|
|
explicitStructInitializer();
|
|
break;
|
|
}
|
|
|
|
case 11: {
|
|
enterOuterAlt(_localctx, 11);
|
|
setState(764);
|
|
explicitDictInitializer();
|
|
break;
|
|
}
|
|
|
|
case 12: {
|
|
enterOuterAlt(_localctx, 12);
|
|
setState(765);
|
|
explicitErrorInitializer();
|
|
break;
|
|
}
|
|
|
|
case 13: {
|
|
enterOuterAlt(_localctx, 13);
|
|
setState(766);
|
|
bareArrayInitializer();
|
|
break;
|
|
}
|
|
|
|
case 14: {
|
|
enterOuterAlt(_localctx, 14);
|
|
setState(767);
|
|
interpolatedString();
|
|
break;
|
|
}
|
|
|
|
default:
|
|
break;
|
|
}
|
|
|
|
}
|
|
catch (RecognitionException &e) {
|
|
_errHandler->reportError(this, e);
|
|
_localctx->exception = std::current_exception();
|
|
_errHandler->recover(this, _localctx->exception);
|
|
}
|
|
|
|
return _localctx;
|
|
}
|
|
|
|
//----------------- ScopedIdentifierContext ------------------------------------------------------------------
|
|
|
|
EscriptParser::ScopedIdentifierContext::ScopedIdentifierContext(ParserRuleContext *parent, size_t invokingState)
|
|
: ParserRuleContext(parent, invokingState) {
|
|
}
|
|
|
|
tree::TerminalNode* EscriptParser::ScopedIdentifierContext::COLONCOLON() {
|
|
return getToken(EscriptParser::COLONCOLON, 0);
|
|
}
|
|
|
|
std::vector<tree::TerminalNode *> EscriptParser::ScopedIdentifierContext::IDENTIFIER() {
|
|
return getTokens(EscriptParser::IDENTIFIER);
|
|
}
|
|
|
|
tree::TerminalNode* EscriptParser::ScopedIdentifierContext::IDENTIFIER(size_t i) {
|
|
return getToken(EscriptParser::IDENTIFIER, i);
|
|
}
|
|
|
|
|
|
size_t EscriptParser::ScopedIdentifierContext::getRuleIndex() const {
|
|
return EscriptParser::RuleScopedIdentifier;
|
|
}
|
|
|
|
void EscriptParser::ScopedIdentifierContext::enterRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->enterScopedIdentifier(this);
|
|
}
|
|
|
|
void EscriptParser::ScopedIdentifierContext::exitRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->exitScopedIdentifier(this);
|
|
}
|
|
|
|
|
|
std::any EscriptParser::ScopedIdentifierContext::accept(tree::ParseTreeVisitor *visitor) {
|
|
if (auto parserVisitor = dynamic_cast<EscriptParserVisitor*>(visitor))
|
|
return parserVisitor->visitScopedIdentifier(this);
|
|
else
|
|
return visitor->visitChildren(this);
|
|
}
|
|
|
|
EscriptParser::ScopedIdentifierContext* EscriptParser::scopedIdentifier() {
|
|
ScopedIdentifierContext *_localctx = _tracker.createInstance<ScopedIdentifierContext>(_ctx, getState());
|
|
enterRule(_localctx, 134, EscriptParser::RuleScopedIdentifier);
|
|
size_t _la = 0;
|
|
|
|
#if __cplusplus > 201703L
|
|
auto onExit = finally([=, this] {
|
|
#else
|
|
auto onExit = finally([=] {
|
|
#endif
|
|
exitRule();
|
|
});
|
|
try {
|
|
enterOuterAlt(_localctx, 1);
|
|
setState(771);
|
|
_errHandler->sync(this);
|
|
|
|
_la = _input->LA(1);
|
|
if (_la == EscriptParser::IDENTIFIER) {
|
|
setState(770);
|
|
antlrcpp::downCast<ScopedIdentifierContext *>(_localctx)->scope = match(EscriptParser::IDENTIFIER);
|
|
}
|
|
setState(773);
|
|
match(EscriptParser::COLONCOLON);
|
|
setState(774);
|
|
antlrcpp::downCast<ScopedIdentifierContext *>(_localctx)->identifier = match(EscriptParser::IDENTIFIER);
|
|
|
|
}
|
|
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<EscriptParser::BlockContext>(0);
|
|
}
|
|
|
|
tree::TerminalNode* EscriptParser::FunctionExpressionContext::RBRACE() {
|
|
return getToken(EscriptParser::RBRACE, 0);
|
|
}
|
|
|
|
EscriptParser::FunctionParametersContext* EscriptParser::FunctionExpressionContext::functionParameters() {
|
|
return getRuleContext<EscriptParser::FunctionParametersContext>(0);
|
|
}
|
|
|
|
|
|
size_t EscriptParser::FunctionExpressionContext::getRuleIndex() const {
|
|
return EscriptParser::RuleFunctionExpression;
|
|
}
|
|
|
|
void EscriptParser::FunctionExpressionContext::enterRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->enterFunctionExpression(this);
|
|
}
|
|
|
|
void EscriptParser::FunctionExpressionContext::exitRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->exitFunctionExpression(this);
|
|
}
|
|
|
|
|
|
std::any EscriptParser::FunctionExpressionContext::accept(tree::ParseTreeVisitor *visitor) {
|
|
if (auto parserVisitor = dynamic_cast<EscriptParserVisitor*>(visitor))
|
|
return parserVisitor->visitFunctionExpression(this);
|
|
else
|
|
return visitor->visitChildren(this);
|
|
}
|
|
|
|
EscriptParser::FunctionExpressionContext* EscriptParser::functionExpression() {
|
|
FunctionExpressionContext *_localctx = _tracker.createInstance<FunctionExpressionContext>(_ctx, getState());
|
|
enterRule(_localctx, 136, EscriptParser::RuleFunctionExpression);
|
|
size_t _la = 0;
|
|
|
|
#if __cplusplus > 201703L
|
|
auto onExit = finally([=, this] {
|
|
#else
|
|
auto onExit = finally([=] {
|
|
#endif
|
|
exitRule();
|
|
});
|
|
try {
|
|
enterOuterAlt(_localctx, 1);
|
|
setState(776);
|
|
match(EscriptParser::AT);
|
|
inUninitFunction = false;
|
|
setState(779);
|
|
_errHandler->sync(this);
|
|
|
|
_la = _input->LA(1);
|
|
if (_la == EscriptParser::LPAREN) {
|
|
setState(778);
|
|
functionParameters();
|
|
}
|
|
setState(781);
|
|
match(EscriptParser::LBRACE);
|
|
setState(782);
|
|
block();
|
|
setState(783);
|
|
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<EscriptParser::ArrayInitializerContext>(0);
|
|
}
|
|
|
|
|
|
size_t EscriptParser::ExplicitArrayInitializerContext::getRuleIndex() const {
|
|
return EscriptParser::RuleExplicitArrayInitializer;
|
|
}
|
|
|
|
void EscriptParser::ExplicitArrayInitializerContext::enterRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->enterExplicitArrayInitializer(this);
|
|
}
|
|
|
|
void EscriptParser::ExplicitArrayInitializerContext::exitRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->exitExplicitArrayInitializer(this);
|
|
}
|
|
|
|
|
|
std::any EscriptParser::ExplicitArrayInitializerContext::accept(tree::ParseTreeVisitor *visitor) {
|
|
if (auto parserVisitor = dynamic_cast<EscriptParserVisitor*>(visitor))
|
|
return parserVisitor->visitExplicitArrayInitializer(this);
|
|
else
|
|
return visitor->visitChildren(this);
|
|
}
|
|
|
|
EscriptParser::ExplicitArrayInitializerContext* EscriptParser::explicitArrayInitializer() {
|
|
ExplicitArrayInitializerContext *_localctx = _tracker.createInstance<ExplicitArrayInitializerContext>(_ctx, getState());
|
|
enterRule(_localctx, 138, EscriptParser::RuleExplicitArrayInitializer);
|
|
|
|
#if __cplusplus > 201703L
|
|
auto onExit = finally([=, this] {
|
|
#else
|
|
auto onExit = finally([=] {
|
|
#endif
|
|
exitRule();
|
|
});
|
|
try {
|
|
enterOuterAlt(_localctx, 1);
|
|
setState(785);
|
|
match(EscriptParser::ARRAY);
|
|
setState(787);
|
|
_errHandler->sync(this);
|
|
|
|
switch (getInterpreter<atn::ParserATNSimulator>()->adaptivePredict(_input, 72, _ctx)) {
|
|
case 1: {
|
|
setState(786);
|
|
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<EscriptParser::StructInitializerContext>(0);
|
|
}
|
|
|
|
|
|
size_t EscriptParser::ExplicitStructInitializerContext::getRuleIndex() const {
|
|
return EscriptParser::RuleExplicitStructInitializer;
|
|
}
|
|
|
|
void EscriptParser::ExplicitStructInitializerContext::enterRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->enterExplicitStructInitializer(this);
|
|
}
|
|
|
|
void EscriptParser::ExplicitStructInitializerContext::exitRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->exitExplicitStructInitializer(this);
|
|
}
|
|
|
|
|
|
std::any EscriptParser::ExplicitStructInitializerContext::accept(tree::ParseTreeVisitor *visitor) {
|
|
if (auto parserVisitor = dynamic_cast<EscriptParserVisitor*>(visitor))
|
|
return parserVisitor->visitExplicitStructInitializer(this);
|
|
else
|
|
return visitor->visitChildren(this);
|
|
}
|
|
|
|
EscriptParser::ExplicitStructInitializerContext* EscriptParser::explicitStructInitializer() {
|
|
ExplicitStructInitializerContext *_localctx = _tracker.createInstance<ExplicitStructInitializerContext>(_ctx, getState());
|
|
enterRule(_localctx, 140, EscriptParser::RuleExplicitStructInitializer);
|
|
|
|
#if __cplusplus > 201703L
|
|
auto onExit = finally([=, this] {
|
|
#else
|
|
auto onExit = finally([=] {
|
|
#endif
|
|
exitRule();
|
|
});
|
|
try {
|
|
enterOuterAlt(_localctx, 1);
|
|
setState(789);
|
|
match(EscriptParser::STRUCT);
|
|
setState(791);
|
|
_errHandler->sync(this);
|
|
|
|
switch (getInterpreter<atn::ParserATNSimulator>()->adaptivePredict(_input, 73, _ctx)) {
|
|
case 1: {
|
|
setState(790);
|
|
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<EscriptParser::DictInitializerContext>(0);
|
|
}
|
|
|
|
|
|
size_t EscriptParser::ExplicitDictInitializerContext::getRuleIndex() const {
|
|
return EscriptParser::RuleExplicitDictInitializer;
|
|
}
|
|
|
|
void EscriptParser::ExplicitDictInitializerContext::enterRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->enterExplicitDictInitializer(this);
|
|
}
|
|
|
|
void EscriptParser::ExplicitDictInitializerContext::exitRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->exitExplicitDictInitializer(this);
|
|
}
|
|
|
|
|
|
std::any EscriptParser::ExplicitDictInitializerContext::accept(tree::ParseTreeVisitor *visitor) {
|
|
if (auto parserVisitor = dynamic_cast<EscriptParserVisitor*>(visitor))
|
|
return parserVisitor->visitExplicitDictInitializer(this);
|
|
else
|
|
return visitor->visitChildren(this);
|
|
}
|
|
|
|
EscriptParser::ExplicitDictInitializerContext* EscriptParser::explicitDictInitializer() {
|
|
ExplicitDictInitializerContext *_localctx = _tracker.createInstance<ExplicitDictInitializerContext>(_ctx, getState());
|
|
enterRule(_localctx, 142, EscriptParser::RuleExplicitDictInitializer);
|
|
|
|
#if __cplusplus > 201703L
|
|
auto onExit = finally([=, this] {
|
|
#else
|
|
auto onExit = finally([=] {
|
|
#endif
|
|
exitRule();
|
|
});
|
|
try {
|
|
enterOuterAlt(_localctx, 1);
|
|
setState(793);
|
|
match(EscriptParser::DICTIONARY);
|
|
setState(795);
|
|
_errHandler->sync(this);
|
|
|
|
switch (getInterpreter<atn::ParserATNSimulator>()->adaptivePredict(_input, 74, _ctx)) {
|
|
case 1: {
|
|
setState(794);
|
|
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<EscriptParser::StructInitializerContext>(0);
|
|
}
|
|
|
|
|
|
size_t EscriptParser::ExplicitErrorInitializerContext::getRuleIndex() const {
|
|
return EscriptParser::RuleExplicitErrorInitializer;
|
|
}
|
|
|
|
void EscriptParser::ExplicitErrorInitializerContext::enterRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->enterExplicitErrorInitializer(this);
|
|
}
|
|
|
|
void EscriptParser::ExplicitErrorInitializerContext::exitRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->exitExplicitErrorInitializer(this);
|
|
}
|
|
|
|
|
|
std::any EscriptParser::ExplicitErrorInitializerContext::accept(tree::ParseTreeVisitor *visitor) {
|
|
if (auto parserVisitor = dynamic_cast<EscriptParserVisitor*>(visitor))
|
|
return parserVisitor->visitExplicitErrorInitializer(this);
|
|
else
|
|
return visitor->visitChildren(this);
|
|
}
|
|
|
|
EscriptParser::ExplicitErrorInitializerContext* EscriptParser::explicitErrorInitializer() {
|
|
ExplicitErrorInitializerContext *_localctx = _tracker.createInstance<ExplicitErrorInitializerContext>(_ctx, getState());
|
|
enterRule(_localctx, 144, EscriptParser::RuleExplicitErrorInitializer);
|
|
|
|
#if __cplusplus > 201703L
|
|
auto onExit = finally([=, this] {
|
|
#else
|
|
auto onExit = finally([=] {
|
|
#endif
|
|
exitRule();
|
|
});
|
|
try {
|
|
enterOuterAlt(_localctx, 1);
|
|
setState(797);
|
|
match(EscriptParser::TOK_ERROR);
|
|
setState(799);
|
|
_errHandler->sync(this);
|
|
|
|
switch (getInterpreter<atn::ParserATNSimulator>()->adaptivePredict(_input, 75, _ctx)) {
|
|
case 1: {
|
|
setState(798);
|
|
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<EscriptParser::ExpressionListContext>(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<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->enterBareArrayInitializer(this);
|
|
}
|
|
|
|
void EscriptParser::BareArrayInitializerContext::exitRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->exitBareArrayInitializer(this);
|
|
}
|
|
|
|
|
|
std::any EscriptParser::BareArrayInitializerContext::accept(tree::ParseTreeVisitor *visitor) {
|
|
if (auto parserVisitor = dynamic_cast<EscriptParserVisitor*>(visitor))
|
|
return parserVisitor->visitBareArrayInitializer(this);
|
|
else
|
|
return visitor->visitChildren(this);
|
|
}
|
|
|
|
EscriptParser::BareArrayInitializerContext* EscriptParser::bareArrayInitializer() {
|
|
BareArrayInitializerContext *_localctx = _tracker.createInstance<BareArrayInitializerContext>(_ctx, getState());
|
|
enterRule(_localctx, 146, EscriptParser::RuleBareArrayInitializer);
|
|
size_t _la = 0;
|
|
|
|
#if __cplusplus > 201703L
|
|
auto onExit = finally([=, this] {
|
|
#else
|
|
auto onExit = finally([=] {
|
|
#endif
|
|
exitRule();
|
|
});
|
|
try {
|
|
setState(813);
|
|
_errHandler->sync(this);
|
|
switch (getInterpreter<atn::ParserATNSimulator>()->adaptivePredict(_input, 78, _ctx)) {
|
|
case 1: {
|
|
enterOuterAlt(_localctx, 1);
|
|
setState(801);
|
|
match(EscriptParser::LBRACE);
|
|
setState(803);
|
|
_errHandler->sync(this);
|
|
|
|
_la = _input->LA(1);
|
|
if (((((_la - 58) & ~ 0x3fULL) == 0) &&
|
|
((1ULL << (_la - 58)) & -2305842905832506925) != 0) || ((((_la - 123) & ~ 0x3fULL) == 0) &&
|
|
((1ULL << (_la - 123)) & 131) != 0)) {
|
|
setState(802);
|
|
expressionList();
|
|
}
|
|
setState(805);
|
|
match(EscriptParser::RBRACE);
|
|
break;
|
|
}
|
|
|
|
case 2: {
|
|
enterOuterAlt(_localctx, 2);
|
|
setState(806);
|
|
match(EscriptParser::LBRACE);
|
|
setState(808);
|
|
_errHandler->sync(this);
|
|
|
|
_la = _input->LA(1);
|
|
if (((((_la - 58) & ~ 0x3fULL) == 0) &&
|
|
((1ULL << (_la - 58)) & -2305842905832506925) != 0) || ((((_la - 123) & ~ 0x3fULL) == 0) &&
|
|
((1ULL << (_la - 123)) & 131) != 0)) {
|
|
setState(807);
|
|
expressionList();
|
|
}
|
|
setState(810);
|
|
match(EscriptParser::COMMA);
|
|
setState(811);
|
|
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<EscriptParser::ExpressionContext>(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<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->enterParExpression(this);
|
|
}
|
|
|
|
void EscriptParser::ParExpressionContext::exitRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->exitParExpression(this);
|
|
}
|
|
|
|
|
|
std::any EscriptParser::ParExpressionContext::accept(tree::ParseTreeVisitor *visitor) {
|
|
if (auto parserVisitor = dynamic_cast<EscriptParserVisitor*>(visitor))
|
|
return parserVisitor->visitParExpression(this);
|
|
else
|
|
return visitor->visitChildren(this);
|
|
}
|
|
|
|
EscriptParser::ParExpressionContext* EscriptParser::parExpression() {
|
|
ParExpressionContext *_localctx = _tracker.createInstance<ParExpressionContext>(_ctx, getState());
|
|
enterRule(_localctx, 148, EscriptParser::RuleParExpression);
|
|
|
|
#if __cplusplus > 201703L
|
|
auto onExit = finally([=, this] {
|
|
#else
|
|
auto onExit = finally([=] {
|
|
#endif
|
|
exitRule();
|
|
});
|
|
try {
|
|
enterOuterAlt(_localctx, 1);
|
|
setState(815);
|
|
match(EscriptParser::LPAREN);
|
|
setState(816);
|
|
expression(0);
|
|
setState(817);
|
|
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::ExpressionListEntryContext *> EscriptParser::ExpressionListContext::expressionListEntry() {
|
|
return getRuleContexts<EscriptParser::ExpressionListEntryContext>();
|
|
}
|
|
|
|
EscriptParser::ExpressionListEntryContext* EscriptParser::ExpressionListContext::expressionListEntry(size_t i) {
|
|
return getRuleContext<EscriptParser::ExpressionListEntryContext>(i);
|
|
}
|
|
|
|
std::vector<tree::TerminalNode *> 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<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->enterExpressionList(this);
|
|
}
|
|
|
|
void EscriptParser::ExpressionListContext::exitRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->exitExpressionList(this);
|
|
}
|
|
|
|
|
|
std::any EscriptParser::ExpressionListContext::accept(tree::ParseTreeVisitor *visitor) {
|
|
if (auto parserVisitor = dynamic_cast<EscriptParserVisitor*>(visitor))
|
|
return parserVisitor->visitExpressionList(this);
|
|
else
|
|
return visitor->visitChildren(this);
|
|
}
|
|
|
|
EscriptParser::ExpressionListContext* EscriptParser::expressionList() {
|
|
ExpressionListContext *_localctx = _tracker.createInstance<ExpressionListContext>(_ctx, getState());
|
|
enterRule(_localctx, 150, EscriptParser::RuleExpressionList);
|
|
|
|
#if __cplusplus > 201703L
|
|
auto onExit = finally([=, this] {
|
|
#else
|
|
auto onExit = finally([=] {
|
|
#endif
|
|
exitRule();
|
|
});
|
|
try {
|
|
size_t alt;
|
|
enterOuterAlt(_localctx, 1);
|
|
setState(819);
|
|
expressionListEntry();
|
|
setState(824);
|
|
_errHandler->sync(this);
|
|
alt = getInterpreter<atn::ParserATNSimulator>()->adaptivePredict(_input, 79, _ctx);
|
|
while (alt != 2 && alt != atn::ATN::INVALID_ALT_NUMBER) {
|
|
if (alt == 1) {
|
|
setState(820);
|
|
match(EscriptParser::COMMA);
|
|
setState(821);
|
|
expressionListEntry();
|
|
}
|
|
setState(826);
|
|
_errHandler->sync(this);
|
|
alt = getInterpreter<atn::ParserATNSimulator>()->adaptivePredict(_input, 79, _ctx);
|
|
}
|
|
|
|
}
|
|
catch (RecognitionException &e) {
|
|
_errHandler->reportError(this, e);
|
|
_localctx->exception = std::current_exception();
|
|
_errHandler->recover(this, _localctx->exception);
|
|
}
|
|
|
|
return _localctx;
|
|
}
|
|
|
|
//----------------- ExpressionListEntryContext ------------------------------------------------------------------
|
|
|
|
EscriptParser::ExpressionListEntryContext::ExpressionListEntryContext(ParserRuleContext *parent, size_t invokingState)
|
|
: ParserRuleContext(parent, invokingState) {
|
|
}
|
|
|
|
EscriptParser::ExpressionContext* EscriptParser::ExpressionListEntryContext::expression() {
|
|
return getRuleContext<EscriptParser::ExpressionContext>(0);
|
|
}
|
|
|
|
tree::TerminalNode* EscriptParser::ExpressionListEntryContext::ELLIPSIS() {
|
|
return getToken(EscriptParser::ELLIPSIS, 0);
|
|
}
|
|
|
|
|
|
size_t EscriptParser::ExpressionListEntryContext::getRuleIndex() const {
|
|
return EscriptParser::RuleExpressionListEntry;
|
|
}
|
|
|
|
void EscriptParser::ExpressionListEntryContext::enterRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->enterExpressionListEntry(this);
|
|
}
|
|
|
|
void EscriptParser::ExpressionListEntryContext::exitRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->exitExpressionListEntry(this);
|
|
}
|
|
|
|
|
|
std::any EscriptParser::ExpressionListEntryContext::accept(tree::ParseTreeVisitor *visitor) {
|
|
if (auto parserVisitor = dynamic_cast<EscriptParserVisitor*>(visitor))
|
|
return parserVisitor->visitExpressionListEntry(this);
|
|
else
|
|
return visitor->visitChildren(this);
|
|
}
|
|
|
|
EscriptParser::ExpressionListEntryContext* EscriptParser::expressionListEntry() {
|
|
ExpressionListEntryContext *_localctx = _tracker.createInstance<ExpressionListEntryContext>(_ctx, getState());
|
|
enterRule(_localctx, 152, EscriptParser::RuleExpressionListEntry);
|
|
size_t _la = 0;
|
|
|
|
#if __cplusplus > 201703L
|
|
auto onExit = finally([=, this] {
|
|
#else
|
|
auto onExit = finally([=] {
|
|
#endif
|
|
exitRule();
|
|
});
|
|
try {
|
|
enterOuterAlt(_localctx, 1);
|
|
setState(827);
|
|
expression(0);
|
|
setState(829);
|
|
_errHandler->sync(this);
|
|
|
|
_la = _input->LA(1);
|
|
if (_la == EscriptParser::ELLIPSIS) {
|
|
setState(828);
|
|
match(EscriptParser::ELLIPSIS);
|
|
}
|
|
|
|
}
|
|
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<EscriptParser::IndexingSuffixContext>(0);
|
|
}
|
|
|
|
EscriptParser::MethodCallSuffixContext* EscriptParser::ExpressionSuffixContext::methodCallSuffix() {
|
|
return getRuleContext<EscriptParser::MethodCallSuffixContext>(0);
|
|
}
|
|
|
|
EscriptParser::NavigationSuffixContext* EscriptParser::ExpressionSuffixContext::navigationSuffix() {
|
|
return getRuleContext<EscriptParser::NavigationSuffixContext>(0);
|
|
}
|
|
|
|
EscriptParser::FunctionCallSuffixContext* EscriptParser::ExpressionSuffixContext::functionCallSuffix() {
|
|
return getRuleContext<EscriptParser::FunctionCallSuffixContext>(0);
|
|
}
|
|
|
|
|
|
size_t EscriptParser::ExpressionSuffixContext::getRuleIndex() const {
|
|
return EscriptParser::RuleExpressionSuffix;
|
|
}
|
|
|
|
void EscriptParser::ExpressionSuffixContext::enterRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->enterExpressionSuffix(this);
|
|
}
|
|
|
|
void EscriptParser::ExpressionSuffixContext::exitRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->exitExpressionSuffix(this);
|
|
}
|
|
|
|
|
|
std::any EscriptParser::ExpressionSuffixContext::accept(tree::ParseTreeVisitor *visitor) {
|
|
if (auto parserVisitor = dynamic_cast<EscriptParserVisitor*>(visitor))
|
|
return parserVisitor->visitExpressionSuffix(this);
|
|
else
|
|
return visitor->visitChildren(this);
|
|
}
|
|
|
|
EscriptParser::ExpressionSuffixContext* EscriptParser::expressionSuffix() {
|
|
ExpressionSuffixContext *_localctx = _tracker.createInstance<ExpressionSuffixContext>(_ctx, getState());
|
|
enterRule(_localctx, 154, EscriptParser::RuleExpressionSuffix);
|
|
|
|
#if __cplusplus > 201703L
|
|
auto onExit = finally([=, this] {
|
|
#else
|
|
auto onExit = finally([=] {
|
|
#endif
|
|
exitRule();
|
|
});
|
|
try {
|
|
setState(835);
|
|
_errHandler->sync(this);
|
|
switch (getInterpreter<atn::ParserATNSimulator>()->adaptivePredict(_input, 81, _ctx)) {
|
|
case 1: {
|
|
enterOuterAlt(_localctx, 1);
|
|
setState(831);
|
|
indexingSuffix();
|
|
break;
|
|
}
|
|
|
|
case 2: {
|
|
enterOuterAlt(_localctx, 2);
|
|
setState(832);
|
|
methodCallSuffix();
|
|
break;
|
|
}
|
|
|
|
case 3: {
|
|
enterOuterAlt(_localctx, 3);
|
|
setState(833);
|
|
navigationSuffix();
|
|
break;
|
|
}
|
|
|
|
case 4: {
|
|
enterOuterAlt(_localctx, 4);
|
|
setState(834);
|
|
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::IndexListContext* EscriptParser::IndexingSuffixContext::indexList() {
|
|
return getRuleContext<EscriptParser::IndexListContext>(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<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->enterIndexingSuffix(this);
|
|
}
|
|
|
|
void EscriptParser::IndexingSuffixContext::exitRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->exitIndexingSuffix(this);
|
|
}
|
|
|
|
|
|
std::any EscriptParser::IndexingSuffixContext::accept(tree::ParseTreeVisitor *visitor) {
|
|
if (auto parserVisitor = dynamic_cast<EscriptParserVisitor*>(visitor))
|
|
return parserVisitor->visitIndexingSuffix(this);
|
|
else
|
|
return visitor->visitChildren(this);
|
|
}
|
|
|
|
EscriptParser::IndexingSuffixContext* EscriptParser::indexingSuffix() {
|
|
IndexingSuffixContext *_localctx = _tracker.createInstance<IndexingSuffixContext>(_ctx, getState());
|
|
enterRule(_localctx, 156, EscriptParser::RuleIndexingSuffix);
|
|
|
|
#if __cplusplus > 201703L
|
|
auto onExit = finally([=, this] {
|
|
#else
|
|
auto onExit = finally([=] {
|
|
#endif
|
|
exitRule();
|
|
});
|
|
try {
|
|
enterOuterAlt(_localctx, 1);
|
|
setState(837);
|
|
match(EscriptParser::LBRACK);
|
|
setState(838);
|
|
indexList();
|
|
setState(839);
|
|
match(EscriptParser::RBRACK);
|
|
|
|
}
|
|
catch (RecognitionException &e) {
|
|
_errHandler->reportError(this, e);
|
|
_localctx->exception = std::current_exception();
|
|
_errHandler->recover(this, _localctx->exception);
|
|
}
|
|
|
|
return _localctx;
|
|
}
|
|
|
|
//----------------- IndexListContext ------------------------------------------------------------------
|
|
|
|
EscriptParser::IndexListContext::IndexListContext(ParserRuleContext *parent, size_t invokingState)
|
|
: ParserRuleContext(parent, invokingState) {
|
|
}
|
|
|
|
std::vector<EscriptParser::ExpressionContext *> EscriptParser::IndexListContext::expression() {
|
|
return getRuleContexts<EscriptParser::ExpressionContext>();
|
|
}
|
|
|
|
EscriptParser::ExpressionContext* EscriptParser::IndexListContext::expression(size_t i) {
|
|
return getRuleContext<EscriptParser::ExpressionContext>(i);
|
|
}
|
|
|
|
std::vector<tree::TerminalNode *> EscriptParser::IndexListContext::COMMA() {
|
|
return getTokens(EscriptParser::COMMA);
|
|
}
|
|
|
|
tree::TerminalNode* EscriptParser::IndexListContext::COMMA(size_t i) {
|
|
return getToken(EscriptParser::COMMA, i);
|
|
}
|
|
|
|
|
|
size_t EscriptParser::IndexListContext::getRuleIndex() const {
|
|
return EscriptParser::RuleIndexList;
|
|
}
|
|
|
|
void EscriptParser::IndexListContext::enterRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->enterIndexList(this);
|
|
}
|
|
|
|
void EscriptParser::IndexListContext::exitRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->exitIndexList(this);
|
|
}
|
|
|
|
|
|
std::any EscriptParser::IndexListContext::accept(tree::ParseTreeVisitor *visitor) {
|
|
if (auto parserVisitor = dynamic_cast<EscriptParserVisitor*>(visitor))
|
|
return parserVisitor->visitIndexList(this);
|
|
else
|
|
return visitor->visitChildren(this);
|
|
}
|
|
|
|
EscriptParser::IndexListContext* EscriptParser::indexList() {
|
|
IndexListContext *_localctx = _tracker.createInstance<IndexListContext>(_ctx, getState());
|
|
enterRule(_localctx, 158, EscriptParser::RuleIndexList);
|
|
size_t _la = 0;
|
|
|
|
#if __cplusplus > 201703L
|
|
auto onExit = finally([=, this] {
|
|
#else
|
|
auto onExit = finally([=] {
|
|
#endif
|
|
exitRule();
|
|
});
|
|
try {
|
|
enterOuterAlt(_localctx, 1);
|
|
setState(841);
|
|
expression(0);
|
|
setState(846);
|
|
_errHandler->sync(this);
|
|
_la = _input->LA(1);
|
|
while (_la == EscriptParser::COMMA) {
|
|
setState(842);
|
|
match(EscriptParser::COMMA);
|
|
setState(843);
|
|
expression(0);
|
|
setState(848);
|
|
_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;
|
|
}
|
|
|
|
//----------------- 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);
|
|
}
|
|
|
|
tree::TerminalNode* EscriptParser::NavigationSuffixContext::FUNCTION() {
|
|
return getToken(EscriptParser::FUNCTION, 0);
|
|
}
|
|
|
|
|
|
size_t EscriptParser::NavigationSuffixContext::getRuleIndex() const {
|
|
return EscriptParser::RuleNavigationSuffix;
|
|
}
|
|
|
|
void EscriptParser::NavigationSuffixContext::enterRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->enterNavigationSuffix(this);
|
|
}
|
|
|
|
void EscriptParser::NavigationSuffixContext::exitRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->exitNavigationSuffix(this);
|
|
}
|
|
|
|
|
|
std::any EscriptParser::NavigationSuffixContext::accept(tree::ParseTreeVisitor *visitor) {
|
|
if (auto parserVisitor = dynamic_cast<EscriptParserVisitor*>(visitor))
|
|
return parserVisitor->visitNavigationSuffix(this);
|
|
else
|
|
return visitor->visitChildren(this);
|
|
}
|
|
|
|
EscriptParser::NavigationSuffixContext* EscriptParser::navigationSuffix() {
|
|
NavigationSuffixContext *_localctx = _tracker.createInstance<NavigationSuffixContext>(_ctx, getState());
|
|
enterRule(_localctx, 160, EscriptParser::RuleNavigationSuffix);
|
|
size_t _la = 0;
|
|
|
|
#if __cplusplus > 201703L
|
|
auto onExit = finally([=, this] {
|
|
#else
|
|
auto onExit = finally([=] {
|
|
#endif
|
|
exitRule();
|
|
});
|
|
try {
|
|
enterOuterAlt(_localctx, 1);
|
|
setState(849);
|
|
match(EscriptParser::DOT);
|
|
setState(850);
|
|
_la = _input->LA(1);
|
|
if (!(_la == EscriptParser::FUNCTION || _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<EscriptParser::ExpressionListContext>(0);
|
|
}
|
|
|
|
|
|
size_t EscriptParser::MethodCallSuffixContext::getRuleIndex() const {
|
|
return EscriptParser::RuleMethodCallSuffix;
|
|
}
|
|
|
|
void EscriptParser::MethodCallSuffixContext::enterRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->enterMethodCallSuffix(this);
|
|
}
|
|
|
|
void EscriptParser::MethodCallSuffixContext::exitRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->exitMethodCallSuffix(this);
|
|
}
|
|
|
|
|
|
std::any EscriptParser::MethodCallSuffixContext::accept(tree::ParseTreeVisitor *visitor) {
|
|
if (auto parserVisitor = dynamic_cast<EscriptParserVisitor*>(visitor))
|
|
return parserVisitor->visitMethodCallSuffix(this);
|
|
else
|
|
return visitor->visitChildren(this);
|
|
}
|
|
|
|
EscriptParser::MethodCallSuffixContext* EscriptParser::methodCallSuffix() {
|
|
MethodCallSuffixContext *_localctx = _tracker.createInstance<MethodCallSuffixContext>(_ctx, getState());
|
|
enterRule(_localctx, 162, EscriptParser::RuleMethodCallSuffix);
|
|
size_t _la = 0;
|
|
|
|
#if __cplusplus > 201703L
|
|
auto onExit = finally([=, this] {
|
|
#else
|
|
auto onExit = finally([=] {
|
|
#endif
|
|
exitRule();
|
|
});
|
|
try {
|
|
enterOuterAlt(_localctx, 1);
|
|
setState(852);
|
|
match(EscriptParser::DOT);
|
|
setState(853);
|
|
match(EscriptParser::IDENTIFIER);
|
|
setState(854);
|
|
match(EscriptParser::LPAREN);
|
|
setState(856);
|
|
_errHandler->sync(this);
|
|
|
|
_la = _input->LA(1);
|
|
if (((((_la - 58) & ~ 0x3fULL) == 0) &&
|
|
((1ULL << (_la - 58)) & -2305842905832506925) != 0) || ((((_la - 123) & ~ 0x3fULL) == 0) &&
|
|
((1ULL << (_la - 123)) & 131) != 0)) {
|
|
setState(855);
|
|
expressionList();
|
|
}
|
|
setState(858);
|
|
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<EscriptParser::ExpressionListContext>(0);
|
|
}
|
|
|
|
|
|
size_t EscriptParser::FunctionCallSuffixContext::getRuleIndex() const {
|
|
return EscriptParser::RuleFunctionCallSuffix;
|
|
}
|
|
|
|
void EscriptParser::FunctionCallSuffixContext::enterRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->enterFunctionCallSuffix(this);
|
|
}
|
|
|
|
void EscriptParser::FunctionCallSuffixContext::exitRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->exitFunctionCallSuffix(this);
|
|
}
|
|
|
|
|
|
std::any EscriptParser::FunctionCallSuffixContext::accept(tree::ParseTreeVisitor *visitor) {
|
|
if (auto parserVisitor = dynamic_cast<EscriptParserVisitor*>(visitor))
|
|
return parserVisitor->visitFunctionCallSuffix(this);
|
|
else
|
|
return visitor->visitChildren(this);
|
|
}
|
|
|
|
EscriptParser::FunctionCallSuffixContext* EscriptParser::functionCallSuffix() {
|
|
FunctionCallSuffixContext *_localctx = _tracker.createInstance<FunctionCallSuffixContext>(_ctx, getState());
|
|
enterRule(_localctx, 164, EscriptParser::RuleFunctionCallSuffix);
|
|
size_t _la = 0;
|
|
|
|
#if __cplusplus > 201703L
|
|
auto onExit = finally([=, this] {
|
|
#else
|
|
auto onExit = finally([=] {
|
|
#endif
|
|
exitRule();
|
|
});
|
|
try {
|
|
enterOuterAlt(_localctx, 1);
|
|
setState(860);
|
|
match(EscriptParser::LPAREN);
|
|
setState(862);
|
|
_errHandler->sync(this);
|
|
|
|
_la = _input->LA(1);
|
|
if (((((_la - 58) & ~ 0x3fULL) == 0) &&
|
|
((1ULL << (_la - 58)) & -2305842905832506925) != 0) || ((((_la - 123) & ~ 0x3fULL) == 0) &&
|
|
((1ULL << (_la - 123)) & 131) != 0)) {
|
|
setState(861);
|
|
expressionList();
|
|
}
|
|
setState(864);
|
|
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<EscriptParser::ExpressionListContext>(0);
|
|
}
|
|
|
|
|
|
size_t EscriptParser::FunctionCallContext::getRuleIndex() const {
|
|
return EscriptParser::RuleFunctionCall;
|
|
}
|
|
|
|
void EscriptParser::FunctionCallContext::enterRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->enterFunctionCall(this);
|
|
}
|
|
|
|
void EscriptParser::FunctionCallContext::exitRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->exitFunctionCall(this);
|
|
}
|
|
|
|
|
|
std::any EscriptParser::FunctionCallContext::accept(tree::ParseTreeVisitor *visitor) {
|
|
if (auto parserVisitor = dynamic_cast<EscriptParserVisitor*>(visitor))
|
|
return parserVisitor->visitFunctionCall(this);
|
|
else
|
|
return visitor->visitChildren(this);
|
|
}
|
|
|
|
EscriptParser::FunctionCallContext* EscriptParser::functionCall() {
|
|
FunctionCallContext *_localctx = _tracker.createInstance<FunctionCallContext>(_ctx, getState());
|
|
enterRule(_localctx, 166, EscriptParser::RuleFunctionCall);
|
|
size_t _la = 0;
|
|
|
|
#if __cplusplus > 201703L
|
|
auto onExit = finally([=, this] {
|
|
#else
|
|
auto onExit = finally([=] {
|
|
#endif
|
|
exitRule();
|
|
});
|
|
try {
|
|
enterOuterAlt(_localctx, 1);
|
|
setState(866);
|
|
match(EscriptParser::IDENTIFIER);
|
|
setState(867);
|
|
match(EscriptParser::LPAREN);
|
|
setState(869);
|
|
_errHandler->sync(this);
|
|
|
|
_la = _input->LA(1);
|
|
if (((((_la - 58) & ~ 0x3fULL) == 0) &&
|
|
((1ULL << (_la - 58)) & -2305842905832506925) != 0) || ((((_la - 123) & ~ 0x3fULL) == 0) &&
|
|
((1ULL << (_la - 123)) & 131) != 0)) {
|
|
setState(868);
|
|
expressionList();
|
|
}
|
|
setState(871);
|
|
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<EscriptParser::ExpressionContext>(0);
|
|
}
|
|
|
|
tree::TerminalNode* EscriptParser::StructInitializerExpressionContext::STRING_LITERAL() {
|
|
return getToken(EscriptParser::STRING_LITERAL, 0);
|
|
}
|
|
|
|
tree::TerminalNode* EscriptParser::StructInitializerExpressionContext::ELLIPSIS() {
|
|
return getToken(EscriptParser::ELLIPSIS, 0);
|
|
}
|
|
|
|
|
|
size_t EscriptParser::StructInitializerExpressionContext::getRuleIndex() const {
|
|
return EscriptParser::RuleStructInitializerExpression;
|
|
}
|
|
|
|
void EscriptParser::StructInitializerExpressionContext::enterRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->enterStructInitializerExpression(this);
|
|
}
|
|
|
|
void EscriptParser::StructInitializerExpressionContext::exitRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->exitStructInitializerExpression(this);
|
|
}
|
|
|
|
|
|
std::any EscriptParser::StructInitializerExpressionContext::accept(tree::ParseTreeVisitor *visitor) {
|
|
if (auto parserVisitor = dynamic_cast<EscriptParserVisitor*>(visitor))
|
|
return parserVisitor->visitStructInitializerExpression(this);
|
|
else
|
|
return visitor->visitChildren(this);
|
|
}
|
|
|
|
EscriptParser::StructInitializerExpressionContext* EscriptParser::structInitializerExpression() {
|
|
StructInitializerExpressionContext *_localctx = _tracker.createInstance<StructInitializerExpressionContext>(_ctx, getState());
|
|
enterRule(_localctx, 168, EscriptParser::RuleStructInitializerExpression);
|
|
size_t _la = 0;
|
|
|
|
#if __cplusplus > 201703L
|
|
auto onExit = finally([=, this] {
|
|
#else
|
|
auto onExit = finally([=] {
|
|
#endif
|
|
exitRule();
|
|
});
|
|
try {
|
|
setState(886);
|
|
_errHandler->sync(this);
|
|
switch (getInterpreter<atn::ParserATNSimulator>()->adaptivePredict(_input, 88, _ctx)) {
|
|
case 1: {
|
|
enterOuterAlt(_localctx, 1);
|
|
setState(873);
|
|
match(EscriptParser::IDENTIFIER);
|
|
setState(876);
|
|
_errHandler->sync(this);
|
|
|
|
_la = _input->LA(1);
|
|
if (_la == EscriptParser::ASSIGN) {
|
|
setState(874);
|
|
match(EscriptParser::ASSIGN);
|
|
setState(875);
|
|
expression(0);
|
|
}
|
|
break;
|
|
}
|
|
|
|
case 2: {
|
|
enterOuterAlt(_localctx, 2);
|
|
setState(878);
|
|
match(EscriptParser::STRING_LITERAL);
|
|
setState(881);
|
|
_errHandler->sync(this);
|
|
|
|
_la = _input->LA(1);
|
|
if (_la == EscriptParser::ASSIGN) {
|
|
setState(879);
|
|
match(EscriptParser::ASSIGN);
|
|
setState(880);
|
|
expression(0);
|
|
}
|
|
break;
|
|
}
|
|
|
|
case 3: {
|
|
enterOuterAlt(_localctx, 3);
|
|
setState(883);
|
|
expression(0);
|
|
setState(884);
|
|
match(EscriptParser::ELLIPSIS);
|
|
break;
|
|
}
|
|
|
|
default:
|
|
break;
|
|
}
|
|
|
|
}
|
|
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::StructInitializerExpressionContext *> EscriptParser::StructInitializerExpressionListContext::structInitializerExpression() {
|
|
return getRuleContexts<EscriptParser::StructInitializerExpressionContext>();
|
|
}
|
|
|
|
EscriptParser::StructInitializerExpressionContext* EscriptParser::StructInitializerExpressionListContext::structInitializerExpression(size_t i) {
|
|
return getRuleContext<EscriptParser::StructInitializerExpressionContext>(i);
|
|
}
|
|
|
|
std::vector<tree::TerminalNode *> 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<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->enterStructInitializerExpressionList(this);
|
|
}
|
|
|
|
void EscriptParser::StructInitializerExpressionListContext::exitRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->exitStructInitializerExpressionList(this);
|
|
}
|
|
|
|
|
|
std::any EscriptParser::StructInitializerExpressionListContext::accept(tree::ParseTreeVisitor *visitor) {
|
|
if (auto parserVisitor = dynamic_cast<EscriptParserVisitor*>(visitor))
|
|
return parserVisitor->visitStructInitializerExpressionList(this);
|
|
else
|
|
return visitor->visitChildren(this);
|
|
}
|
|
|
|
EscriptParser::StructInitializerExpressionListContext* EscriptParser::structInitializerExpressionList() {
|
|
StructInitializerExpressionListContext *_localctx = _tracker.createInstance<StructInitializerExpressionListContext>(_ctx, getState());
|
|
enterRule(_localctx, 170, EscriptParser::RuleStructInitializerExpressionList);
|
|
|
|
#if __cplusplus > 201703L
|
|
auto onExit = finally([=, this] {
|
|
#else
|
|
auto onExit = finally([=] {
|
|
#endif
|
|
exitRule();
|
|
});
|
|
try {
|
|
size_t alt;
|
|
enterOuterAlt(_localctx, 1);
|
|
setState(888);
|
|
structInitializerExpression();
|
|
setState(893);
|
|
_errHandler->sync(this);
|
|
alt = getInterpreter<atn::ParserATNSimulator>()->adaptivePredict(_input, 89, _ctx);
|
|
while (alt != 2 && alt != atn::ATN::INVALID_ALT_NUMBER) {
|
|
if (alt == 1) {
|
|
setState(889);
|
|
match(EscriptParser::COMMA);
|
|
setState(890);
|
|
structInitializerExpression();
|
|
}
|
|
setState(895);
|
|
_errHandler->sync(this);
|
|
alt = getInterpreter<atn::ParserATNSimulator>()->adaptivePredict(_input, 89, _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<EscriptParser::StructInitializerExpressionListContext>(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<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->enterStructInitializer(this);
|
|
}
|
|
|
|
void EscriptParser::StructInitializerContext::exitRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->exitStructInitializer(this);
|
|
}
|
|
|
|
|
|
std::any EscriptParser::StructInitializerContext::accept(tree::ParseTreeVisitor *visitor) {
|
|
if (auto parserVisitor = dynamic_cast<EscriptParserVisitor*>(visitor))
|
|
return parserVisitor->visitStructInitializer(this);
|
|
else
|
|
return visitor->visitChildren(this);
|
|
}
|
|
|
|
EscriptParser::StructInitializerContext* EscriptParser::structInitializer() {
|
|
StructInitializerContext *_localctx = _tracker.createInstance<StructInitializerContext>(_ctx, getState());
|
|
enterRule(_localctx, 172, EscriptParser::RuleStructInitializer);
|
|
size_t _la = 0;
|
|
|
|
#if __cplusplus > 201703L
|
|
auto onExit = finally([=, this] {
|
|
#else
|
|
auto onExit = finally([=] {
|
|
#endif
|
|
exitRule();
|
|
});
|
|
try {
|
|
setState(908);
|
|
_errHandler->sync(this);
|
|
switch (getInterpreter<atn::ParserATNSimulator>()->adaptivePredict(_input, 92, _ctx)) {
|
|
case 1: {
|
|
enterOuterAlt(_localctx, 1);
|
|
setState(896);
|
|
match(EscriptParser::LBRACE);
|
|
setState(898);
|
|
_errHandler->sync(this);
|
|
|
|
_la = _input->LA(1);
|
|
if (((((_la - 58) & ~ 0x3fULL) == 0) &&
|
|
((1ULL << (_la - 58)) & -2305842905832506925) != 0) || ((((_la - 123) & ~ 0x3fULL) == 0) &&
|
|
((1ULL << (_la - 123)) & 131) != 0)) {
|
|
setState(897);
|
|
structInitializerExpressionList();
|
|
}
|
|
setState(900);
|
|
match(EscriptParser::RBRACE);
|
|
break;
|
|
}
|
|
|
|
case 2: {
|
|
enterOuterAlt(_localctx, 2);
|
|
setState(901);
|
|
match(EscriptParser::LBRACE);
|
|
setState(903);
|
|
_errHandler->sync(this);
|
|
|
|
_la = _input->LA(1);
|
|
if (((((_la - 58) & ~ 0x3fULL) == 0) &&
|
|
((1ULL << (_la - 58)) & -2305842905832506925) != 0) || ((((_la - 123) & ~ 0x3fULL) == 0) &&
|
|
((1ULL << (_la - 123)) & 131) != 0)) {
|
|
setState(902);
|
|
structInitializerExpressionList();
|
|
}
|
|
setState(905);
|
|
match(EscriptParser::COMMA);
|
|
setState(906);
|
|
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::ExpressionContext *> EscriptParser::DictInitializerExpressionContext::expression() {
|
|
return getRuleContexts<EscriptParser::ExpressionContext>();
|
|
}
|
|
|
|
EscriptParser::ExpressionContext* EscriptParser::DictInitializerExpressionContext::expression(size_t i) {
|
|
return getRuleContext<EscriptParser::ExpressionContext>(i);
|
|
}
|
|
|
|
tree::TerminalNode* EscriptParser::DictInitializerExpressionContext::ARROW() {
|
|
return getToken(EscriptParser::ARROW, 0);
|
|
}
|
|
|
|
tree::TerminalNode* EscriptParser::DictInitializerExpressionContext::ELLIPSIS() {
|
|
return getToken(EscriptParser::ELLIPSIS, 0);
|
|
}
|
|
|
|
|
|
size_t EscriptParser::DictInitializerExpressionContext::getRuleIndex() const {
|
|
return EscriptParser::RuleDictInitializerExpression;
|
|
}
|
|
|
|
void EscriptParser::DictInitializerExpressionContext::enterRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->enterDictInitializerExpression(this);
|
|
}
|
|
|
|
void EscriptParser::DictInitializerExpressionContext::exitRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->exitDictInitializerExpression(this);
|
|
}
|
|
|
|
|
|
std::any EscriptParser::DictInitializerExpressionContext::accept(tree::ParseTreeVisitor *visitor) {
|
|
if (auto parserVisitor = dynamic_cast<EscriptParserVisitor*>(visitor))
|
|
return parserVisitor->visitDictInitializerExpression(this);
|
|
else
|
|
return visitor->visitChildren(this);
|
|
}
|
|
|
|
EscriptParser::DictInitializerExpressionContext* EscriptParser::dictInitializerExpression() {
|
|
DictInitializerExpressionContext *_localctx = _tracker.createInstance<DictInitializerExpressionContext>(_ctx, getState());
|
|
enterRule(_localctx, 174, EscriptParser::RuleDictInitializerExpression);
|
|
size_t _la = 0;
|
|
|
|
#if __cplusplus > 201703L
|
|
auto onExit = finally([=, this] {
|
|
#else
|
|
auto onExit = finally([=] {
|
|
#endif
|
|
exitRule();
|
|
});
|
|
try {
|
|
setState(918);
|
|
_errHandler->sync(this);
|
|
switch (getInterpreter<atn::ParserATNSimulator>()->adaptivePredict(_input, 94, _ctx)) {
|
|
case 1: {
|
|
enterOuterAlt(_localctx, 1);
|
|
setState(910);
|
|
expression(0);
|
|
setState(913);
|
|
_errHandler->sync(this);
|
|
|
|
_la = _input->LA(1);
|
|
if (_la == EscriptParser::ARROW) {
|
|
setState(911);
|
|
match(EscriptParser::ARROW);
|
|
setState(912);
|
|
expression(0);
|
|
}
|
|
break;
|
|
}
|
|
|
|
case 2: {
|
|
enterOuterAlt(_localctx, 2);
|
|
setState(915);
|
|
expression(0);
|
|
setState(916);
|
|
match(EscriptParser::ELLIPSIS);
|
|
break;
|
|
}
|
|
|
|
default:
|
|
break;
|
|
}
|
|
|
|
}
|
|
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::DictInitializerExpressionContext *> EscriptParser::DictInitializerExpressionListContext::dictInitializerExpression() {
|
|
return getRuleContexts<EscriptParser::DictInitializerExpressionContext>();
|
|
}
|
|
|
|
EscriptParser::DictInitializerExpressionContext* EscriptParser::DictInitializerExpressionListContext::dictInitializerExpression(size_t i) {
|
|
return getRuleContext<EscriptParser::DictInitializerExpressionContext>(i);
|
|
}
|
|
|
|
std::vector<tree::TerminalNode *> 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<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->enterDictInitializerExpressionList(this);
|
|
}
|
|
|
|
void EscriptParser::DictInitializerExpressionListContext::exitRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->exitDictInitializerExpressionList(this);
|
|
}
|
|
|
|
|
|
std::any EscriptParser::DictInitializerExpressionListContext::accept(tree::ParseTreeVisitor *visitor) {
|
|
if (auto parserVisitor = dynamic_cast<EscriptParserVisitor*>(visitor))
|
|
return parserVisitor->visitDictInitializerExpressionList(this);
|
|
else
|
|
return visitor->visitChildren(this);
|
|
}
|
|
|
|
EscriptParser::DictInitializerExpressionListContext* EscriptParser::dictInitializerExpressionList() {
|
|
DictInitializerExpressionListContext *_localctx = _tracker.createInstance<DictInitializerExpressionListContext>(_ctx, getState());
|
|
enterRule(_localctx, 176, EscriptParser::RuleDictInitializerExpressionList);
|
|
|
|
#if __cplusplus > 201703L
|
|
auto onExit = finally([=, this] {
|
|
#else
|
|
auto onExit = finally([=] {
|
|
#endif
|
|
exitRule();
|
|
});
|
|
try {
|
|
size_t alt;
|
|
enterOuterAlt(_localctx, 1);
|
|
setState(920);
|
|
dictInitializerExpression();
|
|
setState(925);
|
|
_errHandler->sync(this);
|
|
alt = getInterpreter<atn::ParserATNSimulator>()->adaptivePredict(_input, 95, _ctx);
|
|
while (alt != 2 && alt != atn::ATN::INVALID_ALT_NUMBER) {
|
|
if (alt == 1) {
|
|
setState(921);
|
|
match(EscriptParser::COMMA);
|
|
setState(922);
|
|
dictInitializerExpression();
|
|
}
|
|
setState(927);
|
|
_errHandler->sync(this);
|
|
alt = getInterpreter<atn::ParserATNSimulator>()->adaptivePredict(_input, 95, _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<EscriptParser::DictInitializerExpressionListContext>(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<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->enterDictInitializer(this);
|
|
}
|
|
|
|
void EscriptParser::DictInitializerContext::exitRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->exitDictInitializer(this);
|
|
}
|
|
|
|
|
|
std::any EscriptParser::DictInitializerContext::accept(tree::ParseTreeVisitor *visitor) {
|
|
if (auto parserVisitor = dynamic_cast<EscriptParserVisitor*>(visitor))
|
|
return parserVisitor->visitDictInitializer(this);
|
|
else
|
|
return visitor->visitChildren(this);
|
|
}
|
|
|
|
EscriptParser::DictInitializerContext* EscriptParser::dictInitializer() {
|
|
DictInitializerContext *_localctx = _tracker.createInstance<DictInitializerContext>(_ctx, getState());
|
|
enterRule(_localctx, 178, EscriptParser::RuleDictInitializer);
|
|
size_t _la = 0;
|
|
|
|
#if __cplusplus > 201703L
|
|
auto onExit = finally([=, this] {
|
|
#else
|
|
auto onExit = finally([=] {
|
|
#endif
|
|
exitRule();
|
|
});
|
|
try {
|
|
setState(940);
|
|
_errHandler->sync(this);
|
|
switch (getInterpreter<atn::ParserATNSimulator>()->adaptivePredict(_input, 98, _ctx)) {
|
|
case 1: {
|
|
enterOuterAlt(_localctx, 1);
|
|
setState(928);
|
|
match(EscriptParser::LBRACE);
|
|
setState(930);
|
|
_errHandler->sync(this);
|
|
|
|
_la = _input->LA(1);
|
|
if (((((_la - 58) & ~ 0x3fULL) == 0) &&
|
|
((1ULL << (_la - 58)) & -2305842905832506925) != 0) || ((((_la - 123) & ~ 0x3fULL) == 0) &&
|
|
((1ULL << (_la - 123)) & 131) != 0)) {
|
|
setState(929);
|
|
dictInitializerExpressionList();
|
|
}
|
|
setState(932);
|
|
match(EscriptParser::RBRACE);
|
|
break;
|
|
}
|
|
|
|
case 2: {
|
|
enterOuterAlt(_localctx, 2);
|
|
setState(933);
|
|
match(EscriptParser::LBRACE);
|
|
setState(935);
|
|
_errHandler->sync(this);
|
|
|
|
_la = _input->LA(1);
|
|
if (((((_la - 58) & ~ 0x3fULL) == 0) &&
|
|
((1ULL << (_la - 58)) & -2305842905832506925) != 0) || ((((_la - 123) & ~ 0x3fULL) == 0) &&
|
|
((1ULL << (_la - 123)) & 131) != 0)) {
|
|
setState(934);
|
|
dictInitializerExpressionList();
|
|
}
|
|
setState(937);
|
|
match(EscriptParser::COMMA);
|
|
setState(938);
|
|
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<EscriptParser::ExpressionListContext>(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<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->enterArrayInitializer(this);
|
|
}
|
|
|
|
void EscriptParser::ArrayInitializerContext::exitRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->exitArrayInitializer(this);
|
|
}
|
|
|
|
|
|
std::any EscriptParser::ArrayInitializerContext::accept(tree::ParseTreeVisitor *visitor) {
|
|
if (auto parserVisitor = dynamic_cast<EscriptParserVisitor*>(visitor))
|
|
return parserVisitor->visitArrayInitializer(this);
|
|
else
|
|
return visitor->visitChildren(this);
|
|
}
|
|
|
|
EscriptParser::ArrayInitializerContext* EscriptParser::arrayInitializer() {
|
|
ArrayInitializerContext *_localctx = _tracker.createInstance<ArrayInitializerContext>(_ctx, getState());
|
|
enterRule(_localctx, 180, EscriptParser::RuleArrayInitializer);
|
|
size_t _la = 0;
|
|
|
|
#if __cplusplus > 201703L
|
|
auto onExit = finally([=, this] {
|
|
#else
|
|
auto onExit = finally([=] {
|
|
#endif
|
|
exitRule();
|
|
});
|
|
try {
|
|
setState(966);
|
|
_errHandler->sync(this);
|
|
switch (getInterpreter<atn::ParserATNSimulator>()->adaptivePredict(_input, 103, _ctx)) {
|
|
case 1: {
|
|
enterOuterAlt(_localctx, 1);
|
|
setState(942);
|
|
match(EscriptParser::LBRACE);
|
|
setState(944);
|
|
_errHandler->sync(this);
|
|
|
|
_la = _input->LA(1);
|
|
if (((((_la - 58) & ~ 0x3fULL) == 0) &&
|
|
((1ULL << (_la - 58)) & -2305842905832506925) != 0) || ((((_la - 123) & ~ 0x3fULL) == 0) &&
|
|
((1ULL << (_la - 123)) & 131) != 0)) {
|
|
setState(943);
|
|
expressionList();
|
|
}
|
|
setState(946);
|
|
match(EscriptParser::RBRACE);
|
|
break;
|
|
}
|
|
|
|
case 2: {
|
|
enterOuterAlt(_localctx, 2);
|
|
setState(947);
|
|
match(EscriptParser::LBRACE);
|
|
setState(949);
|
|
_errHandler->sync(this);
|
|
|
|
_la = _input->LA(1);
|
|
if (((((_la - 58) & ~ 0x3fULL) == 0) &&
|
|
((1ULL << (_la - 58)) & -2305842905832506925) != 0) || ((((_la - 123) & ~ 0x3fULL) == 0) &&
|
|
((1ULL << (_la - 123)) & 131) != 0)) {
|
|
setState(948);
|
|
expressionList();
|
|
}
|
|
setState(951);
|
|
match(EscriptParser::COMMA);
|
|
setState(952);
|
|
match(EscriptParser::RBRACE);
|
|
notifyErrorListeners("Expected expression following comma before right-brace in array initializer list");
|
|
break;
|
|
}
|
|
|
|
case 3: {
|
|
enterOuterAlt(_localctx, 3);
|
|
setState(954);
|
|
match(EscriptParser::LPAREN);
|
|
setState(956);
|
|
_errHandler->sync(this);
|
|
|
|
_la = _input->LA(1);
|
|
if (((((_la - 58) & ~ 0x3fULL) == 0) &&
|
|
((1ULL << (_la - 58)) & -2305842905832506925) != 0) || ((((_la - 123) & ~ 0x3fULL) == 0) &&
|
|
((1ULL << (_la - 123)) & 131) != 0)) {
|
|
setState(955);
|
|
expressionList();
|
|
}
|
|
setState(958);
|
|
match(EscriptParser::RPAREN);
|
|
break;
|
|
}
|
|
|
|
case 4: {
|
|
enterOuterAlt(_localctx, 4);
|
|
setState(959);
|
|
match(EscriptParser::LPAREN);
|
|
setState(961);
|
|
_errHandler->sync(this);
|
|
|
|
_la = _input->LA(1);
|
|
if (((((_la - 58) & ~ 0x3fULL) == 0) &&
|
|
((1ULL << (_la - 58)) & -2305842905832506925) != 0) || ((((_la - 123) & ~ 0x3fULL) == 0) &&
|
|
((1ULL << (_la - 123)) & 131) != 0)) {
|
|
setState(960);
|
|
expressionList();
|
|
}
|
|
setState(963);
|
|
match(EscriptParser::COMMA);
|
|
setState(964);
|
|
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<EscriptParser::IntegerLiteralContext>(0);
|
|
}
|
|
|
|
EscriptParser::FloatLiteralContext* EscriptParser::LiteralContext::floatLiteral() {
|
|
return getRuleContext<EscriptParser::FloatLiteralContext>(0);
|
|
}
|
|
|
|
EscriptParser::BoolLiteralContext* EscriptParser::LiteralContext::boolLiteral() {
|
|
return getRuleContext<EscriptParser::BoolLiteralContext>(0);
|
|
}
|
|
|
|
tree::TerminalNode* EscriptParser::LiteralContext::STRING_LITERAL() {
|
|
return getToken(EscriptParser::STRING_LITERAL, 0);
|
|
}
|
|
|
|
tree::TerminalNode* EscriptParser::LiteralContext::UNINIT() {
|
|
return getToken(EscriptParser::UNINIT, 0);
|
|
}
|
|
|
|
tree::TerminalNode* EscriptParser::LiteralContext::REGEXP_LITERAL() {
|
|
return getToken(EscriptParser::REGEXP_LITERAL, 0);
|
|
}
|
|
|
|
|
|
size_t EscriptParser::LiteralContext::getRuleIndex() const {
|
|
return EscriptParser::RuleLiteral;
|
|
}
|
|
|
|
void EscriptParser::LiteralContext::enterRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->enterLiteral(this);
|
|
}
|
|
|
|
void EscriptParser::LiteralContext::exitRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->exitLiteral(this);
|
|
}
|
|
|
|
|
|
std::any EscriptParser::LiteralContext::accept(tree::ParseTreeVisitor *visitor) {
|
|
if (auto parserVisitor = dynamic_cast<EscriptParserVisitor*>(visitor))
|
|
return parserVisitor->visitLiteral(this);
|
|
else
|
|
return visitor->visitChildren(this);
|
|
}
|
|
|
|
EscriptParser::LiteralContext* EscriptParser::literal() {
|
|
LiteralContext *_localctx = _tracker.createInstance<LiteralContext>(_ctx, getState());
|
|
enterRule(_localctx, 182, EscriptParser::RuleLiteral);
|
|
|
|
#if __cplusplus > 201703L
|
|
auto onExit = finally([=, this] {
|
|
#else
|
|
auto onExit = finally([=] {
|
|
#endif
|
|
exitRule();
|
|
});
|
|
try {
|
|
setState(974);
|
|
_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(968);
|
|
integerLiteral();
|
|
break;
|
|
}
|
|
|
|
case EscriptParser::FLOAT_LITERAL:
|
|
case EscriptParser::HEX_FLOAT_LITERAL: {
|
|
enterOuterAlt(_localctx, 2);
|
|
setState(969);
|
|
floatLiteral();
|
|
break;
|
|
}
|
|
|
|
case EscriptParser::BOOL_TRUE:
|
|
case EscriptParser::BOOL_FALSE: {
|
|
enterOuterAlt(_localctx, 3);
|
|
setState(970);
|
|
boolLiteral();
|
|
break;
|
|
}
|
|
|
|
case EscriptParser::STRING_LITERAL: {
|
|
enterOuterAlt(_localctx, 4);
|
|
setState(971);
|
|
match(EscriptParser::STRING_LITERAL);
|
|
break;
|
|
}
|
|
|
|
case EscriptParser::UNINIT: {
|
|
enterOuterAlt(_localctx, 5);
|
|
setState(972);
|
|
match(EscriptParser::UNINIT);
|
|
break;
|
|
}
|
|
|
|
case EscriptParser::REGEXP_LITERAL: {
|
|
enterOuterAlt(_localctx, 6);
|
|
setState(973);
|
|
match(EscriptParser::REGEXP_LITERAL);
|
|
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::InterpolatedStringPartContext *> EscriptParser::InterpolatedStringContext::interpolatedStringPart() {
|
|
return getRuleContexts<EscriptParser::InterpolatedStringPartContext>();
|
|
}
|
|
|
|
EscriptParser::InterpolatedStringPartContext* EscriptParser::InterpolatedStringContext::interpolatedStringPart(size_t i) {
|
|
return getRuleContext<EscriptParser::InterpolatedStringPartContext>(i);
|
|
}
|
|
|
|
|
|
size_t EscriptParser::InterpolatedStringContext::getRuleIndex() const {
|
|
return EscriptParser::RuleInterpolatedString;
|
|
}
|
|
|
|
void EscriptParser::InterpolatedStringContext::enterRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->enterInterpolatedString(this);
|
|
}
|
|
|
|
void EscriptParser::InterpolatedStringContext::exitRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->exitInterpolatedString(this);
|
|
}
|
|
|
|
|
|
std::any EscriptParser::InterpolatedStringContext::accept(tree::ParseTreeVisitor *visitor) {
|
|
if (auto parserVisitor = dynamic_cast<EscriptParserVisitor*>(visitor))
|
|
return parserVisitor->visitInterpolatedString(this);
|
|
else
|
|
return visitor->visitChildren(this);
|
|
}
|
|
|
|
EscriptParser::InterpolatedStringContext* EscriptParser::interpolatedString() {
|
|
InterpolatedStringContext *_localctx = _tracker.createInstance<InterpolatedStringContext>(_ctx, getState());
|
|
enterRule(_localctx, 184, EscriptParser::RuleInterpolatedString);
|
|
size_t _la = 0;
|
|
|
|
#if __cplusplus > 201703L
|
|
auto onExit = finally([=, this] {
|
|
#else
|
|
auto onExit = finally([=] {
|
|
#endif
|
|
exitRule();
|
|
});
|
|
try {
|
|
enterOuterAlt(_localctx, 1);
|
|
setState(976);
|
|
match(EscriptParser::INTERPOLATED_STRING_START);
|
|
setState(980);
|
|
_errHandler->sync(this);
|
|
_la = _input->LA(1);
|
|
while (((((_la - 131) & ~ 0x3fULL) == 0) &&
|
|
((1ULL << (_la - 131)) & 55) != 0)) {
|
|
setState(977);
|
|
interpolatedStringPart();
|
|
setState(982);
|
|
_errHandler->sync(this);
|
|
_la = _input->LA(1);
|
|
}
|
|
setState(983);
|
|
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<EscriptParser::ExpressionContext>(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<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->enterInterpolatedStringPart(this);
|
|
}
|
|
|
|
void EscriptParser::InterpolatedStringPartContext::exitRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->exitInterpolatedStringPart(this);
|
|
}
|
|
|
|
|
|
std::any EscriptParser::InterpolatedStringPartContext::accept(tree::ParseTreeVisitor *visitor) {
|
|
if (auto parserVisitor = dynamic_cast<EscriptParserVisitor*>(visitor))
|
|
return parserVisitor->visitInterpolatedStringPart(this);
|
|
else
|
|
return visitor->visitChildren(this);
|
|
}
|
|
|
|
EscriptParser::InterpolatedStringPartContext* EscriptParser::interpolatedStringPart() {
|
|
InterpolatedStringPartContext *_localctx = _tracker.createInstance<InterpolatedStringPartContext>(_ctx, getState());
|
|
enterRule(_localctx, 186, EscriptParser::RuleInterpolatedStringPart);
|
|
size_t _la = 0;
|
|
|
|
#if __cplusplus > 201703L
|
|
auto onExit = finally([=, this] {
|
|
#else
|
|
auto onExit = finally([=] {
|
|
#endif
|
|
exitRule();
|
|
});
|
|
try {
|
|
setState(1001);
|
|
_errHandler->sync(this);
|
|
switch (getInterpreter<atn::ParserATNSimulator>()->adaptivePredict(_input, 108, _ctx)) {
|
|
case 1: {
|
|
enterOuterAlt(_localctx, 1);
|
|
setState(985);
|
|
match(EscriptParser::LBRACE_INSIDE);
|
|
setState(986);
|
|
expression(0);
|
|
setState(989);
|
|
_errHandler->sync(this);
|
|
|
|
_la = _input->LA(1);
|
|
if (_la == EscriptParser::COLON) {
|
|
setState(987);
|
|
match(EscriptParser::COLON);
|
|
setState(988);
|
|
match(EscriptParser::FORMAT_STRING);
|
|
}
|
|
break;
|
|
}
|
|
|
|
case 2: {
|
|
enterOuterAlt(_localctx, 2);
|
|
setState(991);
|
|
match(EscriptParser::LBRACE_INSIDE);
|
|
setState(994);
|
|
_errHandler->sync(this);
|
|
|
|
_la = _input->LA(1);
|
|
if (_la == EscriptParser::COLON) {
|
|
setState(992);
|
|
match(EscriptParser::COLON);
|
|
setState(993);
|
|
match(EscriptParser::FORMAT_STRING);
|
|
}
|
|
notifyErrorListeners("Expected expression following interpolated string part start");
|
|
break;
|
|
}
|
|
|
|
case 3: {
|
|
enterOuterAlt(_localctx, 3);
|
|
setState(997);
|
|
match(EscriptParser::DOUBLE_LBRACE_INSIDE);
|
|
break;
|
|
}
|
|
|
|
case 4: {
|
|
enterOuterAlt(_localctx, 4);
|
|
setState(998);
|
|
match(EscriptParser::REGULAR_CHAR_INSIDE);
|
|
break;
|
|
}
|
|
|
|
case 5: {
|
|
enterOuterAlt(_localctx, 5);
|
|
setState(999);
|
|
match(EscriptParser::DOUBLE_RBRACE);
|
|
break;
|
|
}
|
|
|
|
case 6: {
|
|
enterOuterAlt(_localctx, 6);
|
|
setState(1000);
|
|
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<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->enterIntegerLiteral(this);
|
|
}
|
|
|
|
void EscriptParser::IntegerLiteralContext::exitRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->exitIntegerLiteral(this);
|
|
}
|
|
|
|
|
|
std::any EscriptParser::IntegerLiteralContext::accept(tree::ParseTreeVisitor *visitor) {
|
|
if (auto parserVisitor = dynamic_cast<EscriptParserVisitor*>(visitor))
|
|
return parserVisitor->visitIntegerLiteral(this);
|
|
else
|
|
return visitor->visitChildren(this);
|
|
}
|
|
|
|
EscriptParser::IntegerLiteralContext* EscriptParser::integerLiteral() {
|
|
IntegerLiteralContext *_localctx = _tracker.createInstance<IntegerLiteralContext>(_ctx, getState());
|
|
enterRule(_localctx, 188, EscriptParser::RuleIntegerLiteral);
|
|
size_t _la = 0;
|
|
|
|
#if __cplusplus > 201703L
|
|
auto onExit = finally([=, this] {
|
|
#else
|
|
auto onExit = finally([=] {
|
|
#endif
|
|
exitRule();
|
|
});
|
|
try {
|
|
enterOuterAlt(_localctx, 1);
|
|
setState(1003);
|
|
_la = _input->LA(1);
|
|
if (!(((((_la - 73) & ~ 0x3fULL) == 0) &&
|
|
((1ULL << (_la - 73)) & 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<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->enterFloatLiteral(this);
|
|
}
|
|
|
|
void EscriptParser::FloatLiteralContext::exitRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->exitFloatLiteral(this);
|
|
}
|
|
|
|
|
|
std::any EscriptParser::FloatLiteralContext::accept(tree::ParseTreeVisitor *visitor) {
|
|
if (auto parserVisitor = dynamic_cast<EscriptParserVisitor*>(visitor))
|
|
return parserVisitor->visitFloatLiteral(this);
|
|
else
|
|
return visitor->visitChildren(this);
|
|
}
|
|
|
|
EscriptParser::FloatLiteralContext* EscriptParser::floatLiteral() {
|
|
FloatLiteralContext *_localctx = _tracker.createInstance<FloatLiteralContext>(_ctx, getState());
|
|
enterRule(_localctx, 190, EscriptParser::RuleFloatLiteral);
|
|
size_t _la = 0;
|
|
|
|
#if __cplusplus > 201703L
|
|
auto onExit = finally([=, this] {
|
|
#else
|
|
auto onExit = finally([=] {
|
|
#endif
|
|
exitRule();
|
|
});
|
|
try {
|
|
enterOuterAlt(_localctx, 1);
|
|
setState(1005);
|
|
_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<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->enterBoolLiteral(this);
|
|
}
|
|
|
|
void EscriptParser::BoolLiteralContext::exitRule(tree::ParseTreeListener *listener) {
|
|
auto parserListener = dynamic_cast<EscriptParserListener *>(listener);
|
|
if (parserListener != nullptr)
|
|
parserListener->exitBoolLiteral(this);
|
|
}
|
|
|
|
|
|
std::any EscriptParser::BoolLiteralContext::accept(tree::ParseTreeVisitor *visitor) {
|
|
if (auto parserVisitor = dynamic_cast<EscriptParserVisitor*>(visitor))
|
|
return parserVisitor->visitBoolLiteral(this);
|
|
else
|
|
return visitor->visitChildren(this);
|
|
}
|
|
|
|
EscriptParser::BoolLiteralContext* EscriptParser::boolLiteral() {
|
|
BoolLiteralContext *_localctx = _tracker.createInstance<BoolLiteralContext>(_ctx, getState());
|
|
enterRule(_localctx, 192, EscriptParser::RuleBoolLiteral);
|
|
size_t _la = 0;
|
|
|
|
#if __cplusplus > 201703L
|
|
auto onExit = finally([=, this] {
|
|
#else
|
|
auto onExit = finally([=] {
|
|
#endif
|
|
exitRule();
|
|
});
|
|
try {
|
|
enterOuterAlt(_localctx, 1);
|
|
setState(1007);
|
|
_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 65: return expressionSempred(antlrcpp::downCast<ExpressionContext *>(context), predicateIndex);
|
|
|
|
default:
|
|
break;
|
|
}
|
|
return true;
|
|
}
|
|
|
|
bool EscriptParser::expressionSempred(ExpressionContext *_localctx, size_t predicateIndex) {
|
|
switch (predicateIndex) {
|
|
case 0: return precpred(_ctx, 13);
|
|
case 1: return precpred(_ctx, 12);
|
|
case 2: return precpred(_ctx, 11);
|
|
case 3: return precpred(_ctx, 10);
|
|
case 4: return precpred(_ctx, 9);
|
|
case 5: return precpred(_ctx, 8);
|
|
case 6: return precpred(_ctx, 7);
|
|
case 7: return precpred(_ctx, 6);
|
|
case 8: return precpred(_ctx, 5);
|
|
case 9: return precpred(_ctx, 4);
|
|
case 10: return precpred(_ctx, 3);
|
|
case 11: return precpred(_ctx, 2);
|
|
case 12: return precpred(_ctx, 1);
|
|
case 13: return precpred(_ctx, 17);
|
|
case 14: return precpred(_ctx, 16);
|
|
|
|
default:
|
|
break;
|
|
}
|
|
return true;
|
|
}
|
|
|
|
void EscriptParser::initialize() {
|
|
#if ANTLR4_USE_THREAD_LOCAL_CACHE
|
|
escriptparserParserInitialize();
|
|
#else
|
|
::antlr4::internal::call_once(escriptparserParserOnceFlag, escriptparserParserInitialize);
|
|
#endif
|
|
}
|