// Generated from /home/carbon/code/compiler_guas/grammar/SYSYParser.g4 by ANTLR 4.12.0
#include "SYSYParserListener.h"
#include "SYSYParserVisitor.h"
#include "SYSYParser.h"
using namespace antlrcpp;
using namespace antlr4;
namespace {
struct SYSYParserStaticData final {
SYSYParserStaticData(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) {}
SYSYParserStaticData(const SYSYParserStaticData&) = delete;
SYSYParserStaticData(SYSYParserStaticData&&) = delete;
SYSYParserStaticData& operator=(const SYSYParserStaticData&) = delete;
SYSYParserStaticData& operator=(SYSYParserStaticData&&) = 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 sysyparserParserOnceFlag;
SYSYParserStaticData *sysyparserParserStaticData = nullptr;
void sysyparserParserInitialize() {
assert(sysyparserParserStaticData == nullptr);
auto staticData = std::make_unique<SYSYParserStaticData>(
std::vector<std::string>{
"compilationUnit", "decl", "constdecl", "constdef", "init", "vardecl",
"vardef", "funcdef", "funcFparams", "funcFparam", "functype", "typeId",
"block", "stmt", "lval", "cond", "exp", "number"
},
std::vector<std::string>{
"", "','", "';'", "'='", "'['", "']'", "'{'", "'}'", "'('", "')'",
"'if'", "'else'", "'while'", "'const'", "'=='", "'!='", "'<'", "'>'",
"'<='", "'>='", "'+'", "'-'", "'*'", "'/'", "'%'", "'!'", "'&&'",
"'||'", "'int'", "'float'", "'void'", "", "", "", "'break'", "'continue'",
"'return'"
},
std::vector<std::string>{
"", "Comma", "SemiColon", "Assign", "LeftBracket", "RightBracket",
"LeftBrace", "RightBrace", "LeftParen", "RightParen", "If", "Else",
"While", "Const", "Equal", "NonEqual", "Less", "Greater", "LessEqual",
"GreaterEqual", "Plus", "Minus", "Multiply", "Divide", "Modulo", "Not",
"And", "Or", "Int", "Float", "Void", "Identifier", "FloatConst", "IntConst",
"Break", "Continue", "Return", "LineComment", "BlockComment", "WhiteSpace"
}
);
static const int32_t serializedATNSegment[] = {
4,1,39,302,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,1,0,1,0,4,0,39,8,0,11,0,12,0,40,1,1,
1,1,3,1,45,8,1,1,2,1,2,1,2,1,2,1,2,5,2,52,8,2,10,2,12,2,55,9,2,1,2,1,
2,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,4,3,67,8,3,11,3,12,3,68,1,3,1,3,1,3,
3,3,74,8,3,1,4,1,4,1,4,1,4,5,4,80,8,4,10,4,12,4,83,9,4,3,4,85,8,4,1,4,
1,4,3,4,89,8,4,1,5,1,5,1,5,1,5,5,5,95,8,5,10,5,12,5,98,9,5,1,5,1,5,1,
6,1,6,1,6,1,6,1,6,1,6,4,6,108,8,6,11,6,12,6,109,1,6,1,6,1,6,1,6,1,6,1,
6,1,6,1,6,4,6,120,8,6,11,6,12,6,121,1,6,1,6,1,6,3,6,127,8,6,1,7,1,7,1,
7,1,7,3,7,133,8,7,1,7,1,7,1,7,1,8,1,8,1,8,5,8,141,8,8,10,8,12,8,144,9,
8,1,9,1,9,1,9,1,9,1,9,1,9,1,9,1,9,5,9,154,8,9,10,9,12,9,157,9,9,3,9,159,
8,9,1,10,1,10,1,11,1,11,1,12,1,12,1,12,5,12,168,8,12,10,12,12,12,171,
9,12,1,12,1,12,1,13,1,13,1,13,1,13,1,13,1,13,1,13,1,13,1,13,1,13,5,13,
185,8,13,10,13,12,13,188,9,13,1,13,1,13,1,13,1,13,1,13,1,13,1,13,1,13,
1,13,1,13,1,13,1,13,1,13,1,13,1,13,3,13,205,8,13,1,13,1,13,1,13,1,13,
1,13,1,13,1,13,1,13,1,13,1,13,1,13,1,13,3,13,219,8,13,1,13,1,13,3,13,
223,8,13,1,13,3,13,226,8,13,1,14,1,14,1,14,1,14,1,14,1,14,4,14,234,8,
14,11,14,12,14,235,3,14,238,8,14,1,15,1,15,1,15,1,15,3,15,244,8,15,1,
15,1,15,1,15,1,15,1,15,1,15,1,15,1,15,1,15,1,15,1,15,1,15,5,15,258,8,
15,10,15,12,15,261,9,15,1,16,1,16,1,16,1,16,1,16,1,16,1,16,1,16,1,16,
1,16,1,16,1,16,1,16,1,16,5,16,277,8,16,10,16,12,16,280,9,16,1,16,1,16,
1,16,1,16,1,16,3,16,287,8,16,1,16,1,16,1,16,1,16,1,16,1,16,5,16,295,8,
16,10,16,12,16,298,9,16,1,17,1,17,1,17,0,2,30,32,18,0,2,4,6,8,10,12,14,
16,18,20,22,24,26,28,30,32,34,0,8,1,0,28,29,1,0,28,30,2,0,20,21,25,25,
1,0,16,19,1,0,14,15,1,0,20,21,1,0,22,24,1,0,32,33,332,0,38,1,0,0,0,2,
44,1,0,0,0,4,46,1,0,0,0,6,73,1,0,0,0,8,88,1,0,0,0,10,90,1,0,0,0,12,126,
1,0,0,0,14,128,1,0,0,0,16,137,1,0,0,0,18,145,1,0,0,0,20,160,1,0,0,0,22,
162,1,0,0,0,24,164,1,0,0,0,26,225,1,0,0,0,28,237,1,0,0,0,30,243,1,0,0,
0,32,286,1,0,0,0,34,299,1,0,0,0,36,39,3,2,1,0,37,39,3,14,7,0,38,36,1,
0,0,0,38,37,1,0,0,0,39,40,1,0,0,0,40,38,1,0,0,0,40,41,1,0,0,0,41,1,1,
0,0,0,42,45,3,4,2,0,43,45,3,10,5,0,44,42,1,0,0,0,44,43,1,0,0,0,45,3,1,
0,0,0,46,47,5,13,0,0,47,48,7,0,0,0,48,53,3,6,3,0,49,50,5,1,0,0,50,52,
3,6,3,0,51,49,1,0,0,0,52,55,1,0,0,0,53,51,1,0,0,0,53,54,1,0,0,0,54,56,
1,0,0,0,55,53,1,0,0,0,56,57,5,2,0,0,57,5,1,0,0,0,58,59,5,31,0,0,59,60,
5,3,0,0,60,74,3,8,4,0,61,66,5,31,0,0,62,63,5,4,0,0,63,64,3,32,16,0,64,
65,5,5,0,0,65,67,1,0,0,0,66,62,1,0,0,0,67,68,1,0,0,0,68,66,1,0,0,0,68,
69,1,0,0,0,69,70,1,0,0,0,70,71,5,3,0,0,71,72,3,8,4,0,72,74,1,0,0,0,73,
58,1,0,0,0,73,61,1,0,0,0,74,7,1,0,0,0,75,84,5,6,0,0,76,81,3,8,4,0,77,
78,5,1,0,0,78,80,3,8,4,0,79,77,1,0,0,0,80,83,1,0,0,0,81,79,1,0,0,0,81,
82,1,0,0,0,82,85,1,0,0,0,83,81,1,0,0,0,84,76,1,0,0,0,84,85,1,0,0,0,85,
86,1,0,0,0,86,89,5,7,0,0,87,89,3,32,16,0,88,75,1,0,0,0,88,87,1,0,0,0,
89,9,1,0,0,0,90,91,7,0,0,0,91,96,3,12,6,0,92,93,5,1,0,0,93,95,3,12,6,
0,94,92,1,0,0,0,95,98,1,0,0,0,96,94,1,0,0,0,96,97,1,0,0,0,97,99,1,0,0,
0,98,96,1,0,0,0,99,100,5,2,0,0,100,11,1,0,0,0,101,127,5,31,0,0,102,107,
5,31,0,0,103,104,5,4,0,0,104,105,3,32,16,0,105,106,5,5,0,0,106,108,1,
0,0,0,107,103,1,0,0,0,108,109,1,0,0,0,109,107,1,0,0,0,109,110,1,0,0,0,
110,127,1,0,0,0,111,112,5,31,0,0,112,113,5,3,0,0,113,127,3,8,4,0,114,
119,5,31,0,0,115,116,5,4,0,0,116,117,3,32,16,0,117,118,5,5,0,0,118,120,
1,0,0,0,119,115,1,0,0,0,120,121,1,0,0,0,121,119,1,0,0,0,121,122,1,0,0,
0,122,123,1,0,0,0,123,124,5,3,0,0,124,125,3,8,4,0,125,127,1,0,0,0,126,
101,1,0,0,0,126,102,1,0,0,0,126,111,1,0,0,0,126,114,1,0,0,0,127,13,1,
0,0,0,128,129,3,20,10,0,129,130,5,31,0,0,130,132,5,8,0,0,131,133,3,16,
8,0,132,131,1,0,0,0,132,133,1,0,0,0,133,134,1,0,0,0,134,135,5,9,0,0,135,
136,3,24,12,0,136,15,1,0,0,0,137,142,3,18,9,0,138,139,5,1,0,0,139,141,
3,18,9,0,140,138,1,0,0,0,141,144,1,0,0,0,142,140,1,0,0,0,142,143,1,0,
0,0,143,17,1,0,0,0,144,142,1,0,0,0,145,146,3,22,11,0,146,158,5,31,0,0,
147,148,5,4,0,0,148,155,5,5,0,0,149,150,5,4,0,0,150,151,3,32,16,0,151,
152,5,5,0,0,152,154,1,0,0,0,153,149,1,0,0,0,154,157,1,0,0,0,155,153,1,
0,0,0,155,156,1,0,0,0,156,159,1,0,0,0,157,155,1,0,0,0,158,147,1,0,0,0,
158,159,1,0,0,0,159,19,1,0,0,0,160,161,7,1,0,0,161,21,1,0,0,0,162,163,
7,0,0,0,163,23,1,0,0,0,164,169,5,6,0,0,165,168,3,2,1,0,166,168,3,26,13,
0,167,165,1,0,0,0,167,166,1,0,0,0,168,171,1,0,0,0,169,167,1,0,0,0,169,
170,1,0,0,0,170,172,1,0,0,0,171,169,1,0,0,0,172,173,5,7,0,0,173,25,1,
0,0,0,174,175,3,28,14,0,175,176,5,3,0,0,176,177,3,32,16,0,177,178,5,2,
0,0,178,226,1,0,0,0,179,180,5,31,0,0,180,181,5,8,0,0,181,186,3,32,16,
0,182,183,5,1,0,0,183,185,3,32,16,0,184,182,1,0,0,0,185,188,1,0,0,0,186,
184,1,0,0,0,186,187,1,0,0,0,187,189,1,0,0,0,188,186,1,0,0,0,189,190,5,
9,0,0,190,191,5,2,0,0,191,226,1,0,0,0,192,193,5,31,0,0,193,194,5,8,0,
0,194,195,5,9,0,0,195,226,5,2,0,0,196,226,3,24,12,0,197,198,5,10,0,0,
198,199,5,8,0,0,199,200,3,30,15,0,200,201,5,9,0,0,201,204,3,26,13,0,202,
203,5,11,0,0,203,205,3,26,13,0,204,202,1,0,0,0,204,205,1,0,0,0,205,226,
1,0,0,0,206,207,5,12,