MCPcopy Create free account
hub / github.com/bumptop/BumpTop / getToken

Function getToken

trunk/win/Source/LUpdateString/cpp.cpp:164–467  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

162}
163
164static Token getToken()
165{
166 yyIdent.clear();
167 yyComment.clear();
168 yyString.clear();
169
170 while (yyCh != EOF) {
171 yyLineNo = yyCurLineNo;
172
173 if (isalpha(yyCh) || yyCh == '_') {
174 do {
175 yyIdent += yyCh;
176 yyCh = getChar();
177 } while (isalnum(yyCh) || yyCh == '_');
178
179 //qDebug() << "IDENT: " << yyIdent;
180
181 switch (yyIdent.at(0).unicode()) {
182 case 'Q':
183 if (yyIdent == QLatin1String("Q_OBJECT"))
184 return Tok_Q_OBJECT;
185 if (yyIdent == QLatin1String("Q_DECLARE_TR_FUNCTIONS"))
186 return Tok_Q_DECLARE_TR_FUNCTIONS;
187 if (yyIdent == QLatin1String("QT_TR_NOOP"))
188 return Tok_tr;
189 if (yyIdent == QLatin1String("QT_TRANSLATE_NOOP"))
190 return Tok_translate;
191 if (yyIdent == QLatin1String("QT_TRANSLATE_NOOP3"))
192 return Tok_translate;
193 if (yyIdent == QLatin1String("QT_TR_NOOP_UTF8"))
194 return Tok_trUtf8;
195 if (yyIdent == QLatin1String("QT_TRANSLATE_NOOP_UTF8"))
196 return Tok_translateUtf8;
197 if (yyIdent == QLatin1String("QT_TRANSLATE_NOOP3_UTF8"))
198 return Tok_translateUtf8;
199 if (yyIdent == QLatin1String("QT_NT"))
200 return Tok_notranslate;
201 if (yyIdent == QLatin1String("QString_NT"))
202 return Tok_notranslate;
203 break;
204 case 'T':
205 // TR() for when all else fails
206 if (yyIdent.compare(QLatin1String("TR"), Qt::CaseInsensitive) == 0) {
207 return Tok_tr;
208 }
209 break;
210 case 'c':
211 if (yyIdent == QLatin1String("class"))
212 return Tok_class;
213 break;
214 case 'f':
215 /*
216 QTranslator::findMessage() has the same parameters as
217 QApplication::translate().
218 */
219 if (yyIdent == QLatin1String("findMessage"))
220 return Tok_translate;
221 break;

Callers 6

matchFunction · 0.85
matchStringFunction · 0.85
matchEncodingFunction · 0.85
matchIntegerFunction · 0.85
matchExpressionFunction · 0.85
parseFunction · 0.85

Calls 15

QLatin1StringClass · 0.85
qWarningFunction · 0.85
QLatin1CharClass · 0.85
chopMethod · 0.80
getCharFunction · 0.70
clearMethod · 0.45
unicodeMethod · 0.45
atMethod · 0.45
compareMethod · 0.45
pushMethod · 0.45
isEmptyMethod · 0.45
topMethod · 0.45

Tested by

no test coverage detected