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

Function parse

trunk/win/Source/LUpdateString/cpp.cpp:809–1120  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

807 fprintf(warnStringsFile, "%s : %s \n", qPrintable(yyFileName), qPrintable(lineText));
808}
809static void parse(Translator *tor, const QString &initialContext, const QString &defaultContext)
810{
811 static QString strColons(QLatin1String("::"));
812
813 QMap<QString, QString> qualifiedContexts;
814 QSet<QString> allClasses;
815 QSet<QString> allNamespaces;
816 QHash<QString, QStringList> namespaceAliases;
817 QStringList namespaces;
818 QString context;
819 QString text;
820 QString comment;
821 QString extracomment;
822 QString functionContext = initialContext;
823 QString prefix;
824
825#ifdef DIAGNOSE_RETRANSLATABILITY
826 QString functionName;
827#endif
828 int line;
829 bool utf8 = false;
830 bool missing_Q_OBJECT = false;
831 yyTok = getToken();
832 Token lastToken = (Token)yyTok;
833 while (yyTok != Tok_Eof) {
834 //qDebug() << "TOKEN: " << yyTok;
835 switch (yyTok) {
836 case Tok_notranslate :
837 yyTok = getToken();
838 match(Tok_LeftParen);
839 matchString(&text);
840 match(Tok_RightParen);
841 break;
842 case Tok_String:
843 WarnUnwrappedStringLitteral();
844 case Tok_class:
845 yyTokColonSeen = false;
846 /*
847 Partial support for inlined functions.
848 */
849 yyTok = getToken();
850 if (yyBraceDepth == namespaces.count() && yyParenDepth == 0) {
851 QStringList fct;
852 do {
853 /*
854 This code should execute only once, but we play
855 safe with impure definitions such as
856 'class Q_EXPORT QMessageBox', in which case
857 'QMessageBox' is the class name, not 'Q_EXPORT'.
858 */
859 fct = QStringList(yyIdent);
860 yyTok = getToken();
861 } while (yyTok == Tok_Ident);
862 while (yyTok == Tok_ColonColon) {
863 yyTok = getToken();
864 if (yyTok != Tok_Ident)
865 break; // Oops ...
866 fct += yyIdent;

Callers 2

fetchtrInlinedCppFunction · 0.70
loadCPPFunction · 0.70

Calls 15

QLatin1StringClass · 0.85
getTokenFunction · 0.85
matchStringFunction · 0.85
resolveNamespacesFunction · 0.85
matchStringOrNullFunction · 0.85
qWarningFunction · 0.85
recordMessageFunction · 0.85
matchEncodingFunction · 0.85
matchExpressionFunction · 0.85

Tested by

no test coverage detected