293 lines
15 KiB
C++
293 lines
15 KiB
C++
|
|
// Generated from SysY.g4 by ANTLR 4.13.2
|
|
|
|
|
|
#include "SysYLexer.h"
|
|
|
|
|
|
using namespace antlr4;
|
|
|
|
|
|
|
|
using namespace antlr4;
|
|
|
|
namespace {
|
|
|
|
struct SysYLexerStaticData final {
|
|
SysYLexerStaticData(std::vector<std::string> ruleNames,
|
|
std::vector<std::string> channelNames,
|
|
std::vector<std::string> modeNames,
|
|
std::vector<std::string> literalNames,
|
|
std::vector<std::string> symbolicNames)
|
|
: ruleNames(std::move(ruleNames)), channelNames(std::move(channelNames)),
|
|
modeNames(std::move(modeNames)), literalNames(std::move(literalNames)),
|
|
symbolicNames(std::move(symbolicNames)),
|
|
vocabulary(this->literalNames, this->symbolicNames) {}
|
|
|
|
SysYLexerStaticData(const SysYLexerStaticData&) = delete;
|
|
SysYLexerStaticData(SysYLexerStaticData&&) = delete;
|
|
SysYLexerStaticData& operator=(const SysYLexerStaticData&) = delete;
|
|
SysYLexerStaticData& operator=(SysYLexerStaticData&&) = delete;
|
|
|
|
std::vector<antlr4::dfa::DFA> decisionToDFA;
|
|
antlr4::atn::PredictionContextCache sharedContextCache;
|
|
const std::vector<std::string> ruleNames;
|
|
const std::vector<std::string> channelNames;
|
|
const std::vector<std::string> modeNames;
|
|
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 sysylexerLexerOnceFlag;
|
|
#if ANTLR4_USE_THREAD_LOCAL_CACHE
|
|
static thread_local
|
|
#endif
|
|
std::unique_ptr<SysYLexerStaticData> sysylexerLexerStaticData = nullptr;
|
|
|
|
void sysylexerLexerInitialize() {
|
|
#if ANTLR4_USE_THREAD_LOCAL_CACHE
|
|
if (sysylexerLexerStaticData != nullptr) {
|
|
return;
|
|
}
|
|
#else
|
|
assert(sysylexerLexerStaticData == nullptr);
|
|
#endif
|
|
auto staticData = std::make_unique<SysYLexerStaticData>(
|
|
std::vector<std::string>{
|
|
"CONST", "INT", "FLOAT", "VOID", "IF", "ELSE", "WHILE", "BREAK", "CONTINUE",
|
|
"RETURN", "ADD", "SUB", "MUL", "DIV", "MOD", "EQ", "NE", "LT", "LE",
|
|
"GT", "GE", "AND", "OR", "NOT", "ASSIGN", "COMMA", "SEMICOLON", "LPAREN",
|
|
"RPAREN", "LBRACE", "RBRACE", "LBRACK", "RBRACK", "DecDigit", "OctDigit",
|
|
"HexDigit", "OctPrefix", "HexPrefix", "NonZeroDecDigit", "Sign", "DecFractional",
|
|
"Exponent", "DecFloat", "HexFractional", "BinExponent", "HexFloat",
|
|
"ESC", "ALPHA", "ALPHANUM", "NONDIGIT", "Ident", "ILITERAL", "FLITERAL",
|
|
"STRING", "WS", "LINECOMMENT", "BLOCKCOMMENT"
|
|
},
|
|
std::vector<std::string>{
|
|
"DEFAULT_TOKEN_CHANNEL", "HIDDEN"
|
|
},
|
|
std::vector<std::string>{
|
|
"DEFAULT_MODE"
|
|
},
|
|
std::vector<std::string>{
|
|
"", "'const'", "'int'", "'float'", "'void'", "'if'", "'else'", "'while'",
|
|
"'break'", "'continue'", "'return'", "'+'", "'-'", "'*'", "'/'", "'%'",
|
|
"'=='", "'!='", "'<'", "'<='", "'>'", "'>='", "'&&'", "'||'", "'!'",
|
|
"'='", "','", "';'", "'('", "')'", "'{'", "'}'", "'['", "']'"
|
|
},
|
|
std::vector<std::string>{
|
|
"", "CONST", "INT", "FLOAT", "VOID", "IF", "ELSE", "WHILE", "BREAK",
|
|
"CONTINUE", "RETURN", "ADD", "SUB", "MUL", "DIV", "MOD", "EQ", "NE",
|
|
"LT", "LE", "GT", "GE", "AND", "OR", "NOT", "ASSIGN", "COMMA", "SEMICOLON",
|
|
"LPAREN", "RPAREN", "LBRACE", "RBRACE", "LBRACK", "RBRACK", "Ident",
|
|
"ILITERAL", "FLITERAL", "STRING", "WS", "LINECOMMENT", "BLOCKCOMMENT"
|
|
}
|
|
);
|
|
static const int32_t serializedATNSegment[] = {
|
|
4,0,40,416,6,-1,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,1,0,1,0,1,0,1,0,1,0,1,0,1,1,1,1,1,1,1,1,1,2,1,2,1,2,1,2,1,2,1,2,
|
|
1,3,1,3,1,3,1,3,1,3,1,4,1,4,1,4,1,5,1,5,1,5,1,5,1,5,1,6,1,6,1,6,1,6,1,
|
|
6,1,6,1,7,1,7,1,7,1,7,1,7,1,7,1,8,1,8,1,8,1,8,1,8,1,8,1,8,1,8,1,8,1,9,
|
|
1,9,1,9,1,9,1,9,1,9,1,9,1,10,1,10,1,11,1,11,1,12,1,12,1,13,1,13,1,14,
|
|
1,14,1,15,1,15,1,15,1,16,1,16,1,16,1,17,1,17,1,18,1,18,1,18,1,19,1,19,
|
|
1,20,1,20,1,20,1,21,1,21,1,21,1,22,1,22,1,22,1,23,1,23,1,24,1,24,1,25,
|
|
1,25,1,26,1,26,1,27,1,27,1,28,1,28,1,29,1,29,1,30,1,30,1,31,1,31,1,32,
|
|
1,32,1,33,1,33,1,34,1,34,1,35,1,35,1,36,1,36,1,37,1,37,1,37,1,38,1,38,
|
|
1,39,1,39,1,40,5,40,241,8,40,10,40,12,40,244,9,40,1,40,1,40,4,40,248,
|
|
8,40,11,40,12,40,249,1,40,4,40,253,8,40,11,40,12,40,254,1,40,1,40,3,40,
|
|
259,8,40,1,41,1,41,3,41,263,8,41,1,41,4,41,266,8,41,11,41,12,41,267,1,
|
|
42,1,42,3,42,272,8,42,1,42,4,42,275,8,42,11,42,12,42,276,1,42,1,42,3,
|
|
42,281,8,42,1,43,5,43,284,8,43,10,43,12,43,287,9,43,1,43,1,43,4,43,291,
|
|
8,43,11,43,12,43,292,1,43,4,43,296,8,43,11,43,12,43,297,1,43,1,43,3,43,
|
|
302,8,43,1,44,1,44,3,44,306,8,44,1,44,4,44,309,8,44,11,44,12,44,310,1,
|
|
45,1,45,1,45,1,45,1,45,1,45,4,45,319,8,45,11,45,12,45,320,1,45,1,45,3,
|
|
45,325,8,45,1,46,1,46,1,46,1,46,3,46,331,8,46,1,47,1,47,1,48,1,48,1,49,
|
|
1,49,1,50,1,50,1,50,5,50,342,8,50,10,50,12,50,345,9,50,1,51,1,51,5,51,
|
|
349,8,51,10,51,12,51,352,9,51,1,51,1,51,5,51,356,8,51,10,51,12,51,359,
|
|
9,51,1,51,1,51,4,51,363,8,51,11,51,12,51,364,3,51,367,8,51,1,52,1,52,
|
|
3,52,371,8,52,1,53,1,53,1,53,5,53,376,8,53,10,53,12,53,379,9,53,1,53,
|
|
1,53,1,54,1,54,1,54,1,54,1,55,1,55,1,55,1,55,5,55,391,8,55,10,55,12,55,
|
|
394,9,55,1,55,3,55,397,8,55,1,55,1,55,1,55,1,55,1,56,1,56,1,56,1,56,5,
|
|
56,407,8,56,10,56,12,56,410,9,56,1,56,1,56,1,56,1,56,1,56,3,377,392,408,
|
|
0,57,1,1,3,2,5,3,7,4,9,5,11,6,13,7,15,8,17,9,19,10,21,11,23,12,25,13,
|
|
27,14,29,15,31,16,33,17,35,18,37,19,39,20,41,21,43,22,45,23,47,24,49,
|
|
25,51,26,53,27,55,28,57,29,59,30,61,31,63,32,65,33,67,0,69,0,71,0,73,
|
|
0,75,0,77,0,79,0,81,0,83,0,85,0,87,0,89,0,91,0,93,0,95,0,97,0,99,0,101,
|
|
34,103,35,105,36,107,37,109,38,111,39,113,40,1,0,12,1,0,48,57,1,0,48,
|
|
55,3,0,48,57,65,70,97,102,2,0,88,88,120,120,1,0,49,57,2,0,43,43,45,45,
|
|
2,0,69,69,101,101,2,0,80,80,112,112,2,0,65,90,97,122,3,0,48,57,65,90,
|
|
97,122,3,0,65,90,95,95,97,122,3,0,9,10,13,13,32,32,429,0,1,1,0,0,0,0,
|
|
3,1,0,0,0,0,5,1,0,0,0,0,7,1,0,0,0,0,9,1,0,0,0,0,11,1,0,0,0,0,13,1,0,0,
|
|
0,0,15,1,0,0,0,0,17,1,0,0,0,0,19,1,0,0,0,0,21,1,0,0,0,0,23,1,0,0,0,0,
|
|
25,1,0,0,0,0,27,1,0,0,0,0,29,1,0,0,0,0,31,1,0,0,0,0,33,1,0,0,0,0,35,1,
|
|
0,0,0,0,37,1,0,0,0,0,39,1,0,0,0,0,41,1,0,0,0,0,43,1,0,0,0,0,45,1,0,0,
|
|
0,0,47,1,0,0,0,0,49,1,0,0,0,0,51,1,0,0,0,0,53,1,0,0,0,0,55,1,0,0,0,0,
|
|
57,1,0,0,0,0,59,1,0,0,0,0,61,1,0,0,0,0,63,1,0,0,0,0,65,1,0,0,0,0,101,
|
|
1,0,0,0,0,103,1,0,0,0,0,105,1,0,0,0,0,107,1,0,0,0,0,109,1,0,0,0,0,111,
|
|
1,0,0,0,0,113,1,0,0,0,1,115,1,0,0,0,3,121,1,0,0,0,5,125,1,0,0,0,7,131,
|
|
1,0,0,0,9,136,1,0,0,0,11,139,1,0,0,0,13,144,1,0,0,0,15,150,1,0,0,0,17,
|
|
156,1,0,0,0,19,165,1,0,0,0,21,172,1,0,0,0,23,174,1,0,0,0,25,176,1,0,0,
|
|
0,27,178,1,0,0,0,29,180,1,0,0,0,31,182,1,0,0,0,33,185,1,0,0,0,35,188,
|
|
1,0,0,0,37,190,1,0,0,0,39,193,1,0,0,0,41,195,1,0,0,0,43,198,1,0,0,0,45,
|
|
201,1,0,0,0,47,204,1,0,0,0,49,206,1,0,0,0,51,208,1,0,0,0,53,210,1,0,0,
|
|
0,55,212,1,0,0,0,57,214,1,0,0,0,59,216,1,0,0,0,61,218,1,0,0,0,63,220,
|
|
1,0,0,0,65,222,1,0,0,0,67,224,1,0,0,0,69,226,1,0,0,0,71,228,1,0,0,0,73,
|
|
230,1,0,0,0,75,232,1,0,0,0,77,235,1,0,0,0,79,237,1,0,0,0,81,258,1,0,0,
|
|
0,83,260,1,0,0,0,85,280,1,0,0,0,87,301,1,0,0,0,89,303,1,0,0,0,91,324,
|
|
1,0,0,0,93,330,1,0,0,0,95,332,1,0,0,0,97,334,1,0,0,0,99,336,1,0,0,0,101,
|
|
338,1,0,0,0,103,366,1,0,0,0,105,370,1,0,0,0,107,372,1,0,0,0,109,382,1,
|
|
0,0,0,111,386,1,0,0,0,113,402,1,0,0,0,115,116,5,99,0,0,116,117,5,111,
|
|
0,0,117,118,5,110,0,0,118,119,5,115,0,0,119,120,5,116,0,0,120,2,1,0,0,
|
|
0,121,122,5,105,0,0,122,123,5,110,0,0,123,124,5,116,0,0,124,4,1,0,0,0,
|
|
125,126,5,102,0,0,126,127,5,108,0,0,127,128,5,111,0,0,128,129,5,97,0,
|
|
0,129,130,5,116,0,0,130,6,1,0,0,0,131,132,5,118,0,0,132,133,5,111,0,0,
|
|
133,134,5,105,0,0,134,135,5,100,0,0,135,8,1,0,0,0,136,137,5,105,0,0,137,
|
|
138,5,102,0,0,138,10,1,0,0,0,139,140,5,101,0,0,140,141,5,108,0,0,141,
|
|
142,5,115,0,0,142,143,5,101,0,0,143,12,1,0,0,0,144,145,5,119,0,0,145,
|
|
146,5,104,0,0,146,147,5,105,0,0,147,148,5,108,0,0,148,149,5,101,0,0,149,
|
|
14,1,0,0,0,150,151,5,98,0,0,151,152,5,114,0,0,152,153,5,101,0,0,153,154,
|
|
5,97,0,0,154,155,5,107,0,0,155,16,1,0,0,0,156,157,5,99,0,0,157,158,5,
|
|
111,0,0,158,159,5,110,0,0,159,160,5,116,0,0,160,161,5,105,0,0,161,162,
|
|
5,110,0,0,162,163,5,117,0,0,163,164,5,101,0,0,164,18,1,0,0,0,165,166,
|
|
5,114,0,0,166,167,5,101,0,0,167,168,5,116,0,0,168,169,5,117,0,0,169,170,
|
|
5,114,0,0,170,171,5,110,0,0,171,20,1,0,0,0,172,173,5,43,0,0,173,22,1,
|
|
0,0,0,174,175,5,45,0,0,175,24,1,0,0,0,176,177,5,42,0,0,177,26,1,0,0,0,
|
|
178,179,5,47,0,0,179,28,1,0,0,0,180,181,5,37,0,0,181,30,1,0,0,0,182,183,
|
|
5,61,0,0,183,184,5,61,0,0,184,32,1,0,0,0,185,186,5,33,0,0,186,187,5,61,
|
|
0,0,187,34,1,0,0,0,188,189,5,60,0,0,189,36,1,0,0,0,190,191,5,60,0,0,191,
|
|
192,5,61,0,0,192,38,1,0,0,0,193,194,5,62,0,0,194,40,1,0,0,0,195,196,5,
|
|
62,0,0,196,197,5,61,0,0,197,42,1,0,0,0,198,199,5,38,0,0,199,200,5,38,
|
|
0,0,200,44,1,0,0,0,201,202,5,124,0,0,202,203,5,124,0,0,203,46,1,0,0,0,
|
|
204,205,5,33,0,0,205,48,1,0,0,0,206,207,5,61,0,0,207,50,1,0,0,0,208,209,
|
|
5,44,0,0,209,52,1,0,0,0,210,211,5,59,0,0,211,54,1,0,0,0,212,213,5,40,
|
|
0,0,213,56,1,0,0,0,214,215,5,41,0,0,215,58,1,0,0,0,216,217,5,123,0,0,
|
|
217,60,1,0,0,0,218,219,5,125,0,0,219,62,1,0,0,0,220,221,5,91,0,0,221,
|
|
64,1,0,0,0,222,223,5,93,0,0,223,66,1,0,0,0,224,225,7,0,0,0,225,68,1,0,
|
|
0,0,226,227,7,1,0,0,227,70,1,0,0,0,228,229,7,2,0,0,229,72,1,0,0,0,230,
|
|
231,5,48,0,0,231,74,1,0,0,0,232,233,5,48,0,0,233,234,7,3,0,0,234,76,1,
|
|
0,0,0,235,236,7,4,0,0,236,78,1,0,0,0,237,238,7,5,0,0,238,80,1,0,0,0,239,
|
|
241,3,67,33,0,240,239,1,0,0,0,241,244,1,0,0,0,242,240,1,0,0,0,242,243,
|
|
1,0,0,0,243,245,1,0,0,0,244,242,1,0,0,0,245,247,5,46,0,0,246,248,3,67,
|
|
33,0,247,246,1,0,0,0,248,249,1,0,0,0,249,247,1,0,0,0,249,250,1,0,0,0,
|
|
250,259,1,0,0,0,251,253,3,67,33,0,252,251,1,0,0,0,253,254,1,0,0,0,254,
|
|
252,1,0,0,0,254,255,1,0,0,0,255,256,1,0,0,0,256,257,5,46,0,0,257,259,
|
|
1,0,0,0,258,242,1,0,0,0,258,252,1,0,0,0,259,82,1,0,0,0,260,262,7,6,0,
|
|
0,261,263,3,79,39,0,262,261,1,0,0,0,262,263,1,0,0,0,263,265,1,0,0,0,264,
|
|
266,3,67,33,0,265,264,1,0,0,0,266,267,1,0,0,0,267,265,1,0,0,0,267,268,
|
|
1,0,0,0,268,84,1,0,0,0,269,271,3,81,40,0,270,272,3,83,41,0,271,270,1,
|
|
0,0,0,271,272,1,0,0,0,272,281,1,0,0,0,273,275,3,67,33,0,274,273,1,0,0,
|
|
0,275,276,1,0,0,0,276,274,1,0,0,0,276,277,1,0,0,0,277,278,1,0,0,0,278,
|
|
279,3,83,41,0,279,281,1,0,0,0,280,269,1,0,0,0,280,274,1,0,0,0,281,86,
|
|
1,0,0,0,282,284,3,71,35,0,283,282,1,0,0,0,284,287,1,0,0,0,285,283,1,0,
|
|
0,0,285,286,1,0,0,0,286,288,1,0,0,0,287,285,1,0,0,0,288,290,5,46,0,0,
|
|
289,291,3,71,35,0,290,289,1,0,0,0,291,292,1,0,0,0,292,290,1,0,0,0,292,
|
|
293,1,0,0,0,293,302,1,0,0,0,294,296,3,71,35,0,295,294,1,0,0,0,296,297,
|
|
1,0,0,0,297,295,1,0,0,0,297,298,1,0,0,0,298,299,1,0,0,0,299,300,5,46,
|
|
0,0,300,302,1,0,0,0,301,285,1,0,0,0,301,295,1,0,0,0,302,88,1,0,0,0,303,
|
|
305,7,7,0,0,304,306,3,79,39,0,305,304,1,0,0,0,305,306,1,0,0,0,306,308,
|
|
1,0,0,0,307,309,3,67,33,0,308,307,1,0,0,0,309,310,1,0,0,0,310,308,1,0,
|
|
0,0,310,311,1,0,0,0,311,90,1,0,0,0,312,313,3,75,37,0,313,314,3,87,43,
|
|
0,314,315,3,89,44,0,315,325,1,0,0,0,316,318,3,75,37,0,317,319,3,71,35,
|
|
0,318,317,1,0,0,0,319,320,1,0,0,0,320,318,1,0,0,0,320,321,1,0,0,0,321,
|
|
322,1,0,0,0,322,323,3,89,44,0,323,325,1,0,0,0,324,312,1,0,0,0,324,316,
|
|
1,0,0,0,325,92,1,0,0,0,326,327,5,92,0,0,327,331,5,34,0,0,328,329,5,92,
|
|
0,0,329,331,5,92,0,0,330,326,1,0,0,0,330,328,1,0,0,0,331,94,1,0,0,0,332,
|
|
333,7,8,0,0,333,96,1,0,0,0,334,335,7,9,0,0,335,98,1,0,0,0,336,337,7,10,
|
|
0,0,337,100,1,0,0,0,338,343,3,99,49,0,339,342,3,97,48,0,340,342,5,95,
|
|
0,0,341,339,1,0,0,0,341,340,1,0,0,0,342,345,1,0,0,0,343,341,1,0,0,0,343,
|
|
344,1,0,0,0,344,102,1,0,0,0,345,343,1,0,0,0,346,350,3,77,38,0,347,349,
|
|
3,67,33,0,348,347,1,0,0,0,349,352,1,0,0,0,350,348,1,0,0,0,350,351,1,0,
|
|
0,0,351,367,1,0,0,0,352,350,1,0,0,0,353,357,3,73,36,0,354,356,3,69,34,
|
|
0,355,354,1,0,0,0,356,359,1,0,0,0,357,355,1,0,0,0,357,358,1,0,0,0,358,
|
|
367,1,0,0,0,359,357,1,0,0,0,360,362,3,75,37,0,361,363,3,71,35,0,362,361,
|
|
1,0,0,0,363,364,1,0,0,0,364,362,1,0,0,0,364,365,1,0,0,0,365,367,1,0,0,
|
|
0,366,346,1,0,0,0,366,353,1,0,0,0,366,360,1,0,0,0,367,104,1,0,0,0,368,
|
|
371,3,85,42,0,369,371,3,91,45,0,370,368,1,0,0,0,370,369,1,0,0,0,371,106,
|
|
1,0,0,0,372,377,5,34,0,0,373,376,3,93,46,0,374,376,9,0,0,0,375,373,1,
|
|
0,0,0,375,374,1,0,0,0,376,379,1,0,0,0,377,378,1,0,0,0,377,375,1,0,0,0,
|
|
378,380,1,0,0,0,379,377,1,0,0,0,380,381,5,34,0,0,381,108,1,0,0,0,382,
|
|
383,7,11,0,0,383,384,1,0,0,0,384,385,6,54,0,0,385,110,1,0,0,0,386,387,
|
|
5,47,0,0,387,388,5,47,0,0,388,392,1,0,0,0,389,391,9,0,0,0,390,389,1,0,
|
|
0,0,391,394,1,0,0,0,392,393,1,0,0,0,392,390,1,0,0,0,393,396,1,0,0,0,394,
|
|
392,1,0,0,0,395,397,5,13,0,0,396,395,1,0,0,0,396,397,1,0,0,0,397,398,
|
|
1,0,0,0,398,399,5,10,0,0,399,400,1,0,0,0,400,401,6,55,0,0,401,112,1,0,
|
|
0,0,402,403,5,47,0,0,403,404,5,42,0,0,404,408,1,0,0,0,405,407,9,0,0,0,
|
|
406,405,1,0,0,0,407,410,1,0,0,0,408,409,1,0,0,0,408,406,1,0,0,0,409,411,
|
|
1,0,0,0,410,408,1,0,0,0,411,412,5,42,0,0,412,413,5,47,0,0,413,414,1,0,
|
|
0,0,414,415,6,56,0,0,415,114,1,0,0,0,31,0,242,249,254,258,262,267,271,
|
|
276,280,285,292,297,301,305,310,320,324,330,341,343,350,357,364,366,370,
|
|
375,377,392,396,408,1,6,0,0
|
|
};
|
|
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);
|
|
}
|
|
sysylexerLexerStaticData = std::move(staticData);
|
|
}
|
|
|
|
}
|
|
|
|
SysYLexer::SysYLexer(CharStream *input) : Lexer(input) {
|
|
SysYLexer::initialize();
|
|
_interpreter = new atn::LexerATNSimulator(this, *sysylexerLexerStaticData->atn, sysylexerLexerStaticData->decisionToDFA, sysylexerLexerStaticData->sharedContextCache);
|
|
}
|
|
|
|
SysYLexer::~SysYLexer() {
|
|
delete _interpreter;
|
|
}
|
|
|
|
std::string SysYLexer::getGrammarFileName() const {
|
|
return "SysY.g4";
|
|
}
|
|
|
|
const std::vector<std::string>& SysYLexer::getRuleNames() const {
|
|
return sysylexerLexerStaticData->ruleNames;
|
|
}
|
|
|
|
const std::vector<std::string>& SysYLexer::getChannelNames() const {
|
|
return sysylexerLexerStaticData->channelNames;
|
|
}
|
|
|
|
const std::vector<std::string>& SysYLexer::getModeNames() const {
|
|
return sysylexerLexerStaticData->modeNames;
|
|
}
|
|
|
|
const dfa::Vocabulary& SysYLexer::getVocabulary() const {
|
|
return sysylexerLexerStaticData->vocabulary;
|
|
}
|
|
|
|
antlr4::atn::SerializedATNView SysYLexer::getSerializedATN() const {
|
|
return sysylexerLexerStaticData->serializedATN;
|
|
}
|
|
|
|
const atn::ATN& SysYLexer::getATN() const {
|
|
return *sysylexerLexerStaticData->atn;
|
|
}
|
|
|
|
|
|
|
|
|
|
void SysYLexer::initialize() {
|
|
#if ANTLR4_USE_THREAD_LOCAL_CACHE
|
|
sysylexerLexerInitialize();
|
|
#else
|
|
::antlr4::internal::call_once(sysylexerLexerOnceFlag, sysylexerLexerInitialize);
|
|
#endif
|
|
}
|