1
1
2
- // Generated from XPathLexer.g4 by ANTLR 4.9.3
2
+ // Generated from XPathLexer.g4 by ANTLR 4.12.0
3
3
4
4
5
5
#include " XPathLexer.h"
6
6
7
7
8
+ using namespace antlr4 ;
9
+
10
+
11
+
8
12
using namespace antlr4 ;
9
13
10
14
namespace {
11
15
12
16
struct XPathLexerStaticData final {
13
17
XPathLexerStaticData (std::vector<std::string> ruleNames,
14
- std::vector<std::string> channelNames,
15
- std::vector<std::string> modeNames,
16
- std::vector<std::string> literalNames,
17
- std::vector<std::string> symbolicNames)
18
+ std::vector<std::string> channelNames,
19
+ std::vector<std::string> modeNames,
20
+ std::vector<std::string> literalNames,
21
+ std::vector<std::string> symbolicNames)
18
22
: ruleNames(std::move(ruleNames)), channelNames(std::move(channelNames)),
19
23
modeNames (std::move(modeNames)), literalNames(std::move(literalNames)),
20
24
symbolicNames(std::move(symbolicNames)),
@@ -37,14 +41,23 @@ struct XPathLexerStaticData final {
37
41
std::unique_ptr<antlr4::atn::ATN> atn;
38
42
};
39
43
40
- ::antlr4::internal::OnceFlag xpathLexerOnceFlag;
41
- XPathLexerStaticData *xpathLexerStaticData = nullptr ;
44
+ ::antlr4::internal::OnceFlag xpathlexerLexerOnceFlag;
45
+ #if ANTLR4_USE_THREAD_LOCAL_CACHE
46
+ static thread_local
47
+ #endif
48
+ XPathLexerStaticData *xpathlexerLexerStaticData = nullptr ;
42
49
43
- void xpathLexerInitialize () {
44
- assert (xpathLexerStaticData == nullptr );
50
+ void xpathlexerLexerInitialize () {
51
+ #if ANTLR4_USE_THREAD_LOCAL_CACHE
52
+ if (xpathlexerLexerStaticData != nullptr ) {
53
+ return ;
54
+ }
55
+ #else
56
+ assert (xpathlexerLexerStaticData == nullptr );
57
+ #endif
45
58
auto staticData = std::make_unique<XPathLexerStaticData>(
46
59
std::vector<std::string>{
47
- " ANYWHERE" , " ROOT" , " WILDCARD" , " BANG" , " ID" , " NameChar" , " NameStartChar" ,
60
+ " ANYWHERE" , " ROOT" , " WILDCARD" , " BANG" , " ID" , " NameChar" , " NameStartChar" ,
48
61
" STRING"
49
62
},
50
63
std::vector<std::string>{
@@ -57,69 +70,47 @@ void xpathLexerInitialize() {
57
70
" " , " " , " " , " '//'" , " '/'" , " '*'" , " '!'"
58
71
},
59
72
std::vector<std::string>{
60
- " " , " TOKEN_REF" , " RULE_REF" , " ANYWHERE" , " ROOT" , " WILDCARD" , " BANG" , " ID " ,
61
- " STRING"
73
+ " " , " TOKEN_REF" , " RULE_REF" , " ANYWHERE" , " ROOT" , " WILDCARD" , " BANG" ,
74
+ " ID " , " STRING"
62
75
}
63
76
);
64
77
static const int32_t serializedATNSegment[] = {
65
- 0x4 , 0x0 , 0x8 , 0x32 , 0x6 , -1 , 0x2 , 0x0 , 0x7 , 0x0 , 0x2 , 0x1 , 0x7 ,
66
- 0x1 , 0x2 , 0x2 , 0x7 , 0x2 , 0x2 , 0x3 , 0x7 , 0x3 , 0x2 , 0x4 , 0x7 , 0x4 ,
67
- 0x2 , 0x5 , 0x7 , 0x5 , 0x2 , 0x6 , 0x7 , 0x6 , 0x2 , 0x7 , 0x7 , 0x7 , 0x1 ,
68
- 0x0 , 0x1 , 0x0 , 0x1 , 0x0 , 0x1 , 0x1 , 0x1 , 0x1 , 0x1 , 0x2 , 0x1 , 0x2 ,
69
- 0x1 , 0x3 , 0x1 , 0x3 , 0x1 , 0x4 , 0x1 , 0x4 , 0x5 , 0x4 , 0x1d , 0x8 , 0x4 ,
70
- 0xa , 0x4 , 0xc , 0x4 , 0x20 , 0x9 , 0x4 , 0x1 , 0x4 , 0x1 , 0x4 , 0x1 , 0x5 ,
71
- 0x1 , 0x5 , 0x3 , 0x5 , 0x26 , 0x8 , 0x5 , 0x1 , 0x6 , 0x1 , 0x6 , 0x1 , 0x7 ,
72
- 0x1 , 0x7 , 0x5 , 0x7 , 0x2c , 0x8 , 0x7 , 0xa , 0x7 , 0xc , 0x7 , 0x2f , 0x9 ,
73
- 0x7 , 0x1 , 0x7 , 0x1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,0 ,0 ,0 ,39 ,40 ,7 ,1 ,0 ,0 ,40 ,
92
+ 14 ,1 ,0 ,0 ,0 ,41 ,45 ,5 ,39 ,0 ,0 ,42 ,44 ,9 ,0 ,0 ,0 ,43 ,42 ,1 ,0 ,0 ,0 ,44 ,47 ,1 ,0 ,0 ,0 ,45 ,
93
+ 46 ,1 ,0 ,0 ,0 ,45 ,43 ,1 ,0 ,0 ,0 ,46 ,48 ,1 ,0 ,0 ,0 ,47 ,45 ,1 ,0 ,0 ,0 ,48 ,49 ,5 ,39 ,0 ,0 ,49 ,
94
+ 16 ,1 ,0 ,0 ,0 ,4 ,0 ,30 ,37 ,45 ,1 ,1 ,4 ,0
103
95
};
104
-
105
96
staticData->serializedATN = antlr4::atn::SerializedATNView (serializedATNSegment, sizeof (serializedATNSegment) / sizeof (serializedATNSegment[0 ]));
106
97
107
- atn::ATNDeserializer deserializer;
98
+ antlr4:: atn::ATNDeserializer deserializer;
108
99
staticData->atn = deserializer.deserialize (staticData->serializedATN );
109
100
110
- size_t count = staticData->atn ->getNumberOfDecisions ();
101
+ const size_t count = staticData->atn ->getNumberOfDecisions ();
111
102
staticData->decisionToDFA .reserve (count);
112
- for (size_t i = 0 ; i < count; i++) {
103
+ for (size_t i = 0 ; i < count; i++) {
113
104
staticData->decisionToDFA .emplace_back (staticData->atn ->getDecisionState (i), i);
114
105
}
115
- xpathLexerStaticData = staticData.release ();
106
+ xpathlexerLexerStaticData = staticData.release ();
116
107
}
117
108
118
109
}
119
110
120
111
XPathLexer::XPathLexer (CharStream *input) : Lexer(input) {
121
112
XPathLexer::initialize ();
122
- _interpreter = new atn::LexerATNSimulator (this , *xpathLexerStaticData ->atn , xpathLexerStaticData ->decisionToDFA , xpathLexerStaticData ->sharedContextCache );
113
+ _interpreter = new atn::LexerATNSimulator (this , *xpathlexerLexerStaticData ->atn , xpathlexerLexerStaticData ->decisionToDFA , xpathlexerLexerStaticData ->sharedContextCache );
123
114
}
124
115
125
116
XPathLexer::~XPathLexer () {
@@ -131,29 +122,30 @@ std::string XPathLexer::getGrammarFileName() const {
131
122
}
132
123
133
124
const std::vector<std::string>& XPathLexer::getRuleNames () const {
134
- return xpathLexerStaticData ->ruleNames ;
125
+ return xpathlexerLexerStaticData ->ruleNames ;
135
126
}
136
127
137
128
const std::vector<std::string>& XPathLexer::getChannelNames () const {
138
- return xpathLexerStaticData ->channelNames ;
129
+ return xpathlexerLexerStaticData ->channelNames ;
139
130
}
140
131
141
132
const std::vector<std::string>& XPathLexer::getModeNames () const {
142
- return xpathLexerStaticData ->modeNames ;
133
+ return xpathlexerLexerStaticData ->modeNames ;
143
134
}
144
135
145
136
const dfa::Vocabulary& XPathLexer::getVocabulary () const {
146
- return xpathLexerStaticData ->vocabulary ;
137
+ return xpathlexerLexerStaticData ->vocabulary ;
147
138
}
148
139
149
140
antlr4::atn::SerializedATNView XPathLexer::getSerializedATN () const {
150
- return xpathLexerStaticData ->serializedATN ;
141
+ return xpathlexerLexerStaticData ->serializedATN ;
151
142
}
152
143
153
144
const atn::ATN& XPathLexer::getATN () const {
154
- return *xpathLexerStaticData ->atn ;
145
+ return *xpathlexerLexerStaticData ->atn ;
155
146
}
156
147
148
+
157
149
void XPathLexer::action (RuleContext *context, size_t ruleIndex, size_t actionIndex) {
158
150
switch (ruleIndex) {
159
151
case 4 : IDAction (antlrcpp::downCast<antlr4::RuleContext *>(context), actionIndex); break ;
@@ -165,7 +157,7 @@ void XPathLexer::action(RuleContext *context, size_t ruleIndex, size_t actionInd
165
157
166
158
void XPathLexer::IDAction (antlr4::RuleContext *context, size_t actionIndex) {
167
159
switch (actionIndex) {
168
- case 0 :
160
+ case 0 :
169
161
if (isupper (getText ()[0 ]))
170
162
setType (TOKEN_REF);
171
163
else
@@ -177,6 +169,12 @@ void XPathLexer::IDAction(antlr4::RuleContext *context, size_t actionIndex) {
177
169
}
178
170
}
179
171
172
+
173
+
180
174
void XPathLexer::initialize () {
181
- ::antlr4::internal::call_once (xpathLexerOnceFlag, xpathLexerInitialize);
175
+ #if ANTLR4_USE_THREAD_LOCAL_CACHE
176
+ xpathlexerLexerInitialize ();
177
+ #else
178
+ ::antlr4::internal::call_once (xpathlexerLexerOnceFlag, xpathlexerLexerInitialize);
179
+ #endif
182
180
}
0 commit comments