8#include <qstringlist.h>
10#include <qjsondocument.h>
11#include <qjsonarray.h>
12#include <qjsonobject.h>
13#include <qtmocconstants.h>
14#include <qtyperevision.h>
17#include <private/qtools_p.h>
28 inline explicit Type(
const QByteArray &_name)
109 s += QtMiscUtils::toAsciiUpper(name[0]);
114 QByteArray name,
type,
member,
read,
write,
bind,
reset,
designable,
scriptable,
stored,
user,
notify,
inPrivateClass;
234 void generate(FILE *out, FILE *jsonOutput);
238 return index > def->begin && index < def->end - 1;
242 return index > def->begin && index < def->end - 1;
300 if (type.endsWith(
'&')) {
301 if (type.endsWith(
"&&"))
302 return type.left(type.size()-2);
303 return type.left(type.size()-1);
int main(int argc, char *argv[])
[2]
bool testFunctionAttribute(Token tok, FunctionDef *def)
void parseEnumOrFlag(BaseDef *def, QtMocConstants::EnumFlags flags)
void checkSuperClasses(ClassDef *def)
bool parseEnum(EnumDef *def)
void parseProperty(ClassDef *def, PropertyMode mode)
QByteArray lexemUntil(Token)
EncounteredQmlMacro parseClassInfo(BaseDef *def)
QList< QByteArray > includeFiles
bool requireCompleteTypes
QHash< QByteArray, QByteArray > knownQObjectClasses
void createPropertyDef(PropertyDef &def, int propertyIndex, PropertyMode mode)
void parseClassInfo(ClassDef *def)
bool parseClassHead(ClassDef *def)
void parsePrivateProperty(ClassDef *def, PropertyMode mode)
void parseFlag(BaseDef *def)
void parseSignals(ClassDef *def)
void parseDeclareMetatype()
void parsePropertyAttributes(PropertyDef &propDef)
void parseInterfaces(ClassDef *def)
bool testFunctionRevision(FunctionDef *def)
bool testFunctionAttribute(FunctionDef *def)
void prependNamespaces(BaseDef &def, const QList< NamespaceDef > &namespaceList) const
QHash< QByteArray, QByteArray > knownGadgets
QList< QByteArray > metaTypes
bool parseFunction(FunctionDef *def, bool inMacro=false)
QByteArray parsePropertyAccessor()
QMap< QString, QJsonArray > metaArgs
bool testForFunctionModifiers(FunctionDef *def)
const QByteArray & toFullyQualified(const QByteArray &name) const noexcept
void parseSlots(ClassDef *def, FunctionDef::Access access)
void parseDeclareInterface()
void checkListSizes(const ClassDef &def)
QTypeRevision parseRevision()
QList< QString > parsedPluginMetadataFiles
bool parseMaybeFunction(const ClassDef *cdef, FunctionDef *def)
void checkProperties(ClassDef *cdef)
void parseFunctionArguments(FunctionDef *def)
void parseSlotInPrivate(ClassDef *def, FunctionDef::Access access)
bool inClass(const ClassDef *def) const
void parsePluginData(ClassDef *def)
void generate(FILE *out, FILE *jsonOutput)
QMap< QByteArray, QByteArray > interface2IdMap
bool inNamespace(const NamespaceDef *def) const
QList< ClassDef > classList
void setDebugIncludes(bool value)
void parseDefineArguments(Macro *m)
QHash< QByteArray, QByteArray > nonlocalIncludePathResolutionCache
Symbols preprocessed(const QByteArray &filename, QFile *device)
void substituteUntilNewline(Symbols &substituted)
QList< QByteArray > frameworks
static bool preprocessOnly
static Symbols macroExpandIdentifier(Preprocessor *that, SymbolStack &symbols, int lineNum, QByteArray *macroName)
QByteArray resolveInclude(const QByteArray &filename, const QByteArray &relativeTo)
static Symbols tokenize(const QByteArray &input, int lineNum=1, TokenizeMode mode=TokenizeCpp)
static void macroExpand(Symbols *into, Preprocessor *that, const Symbols &toExpand, qsizetype &index, int lineNum, bool one, const QSet< QByteArray > &excludeSymbols=QSet< QByteArray >())
@ PreparePreprocessorStatement
@ TokenizePreprocessorStatement
The QCommandLineOption class defines a possible command-line option. \inmodule QtCore.
The QCommandLineParser class provides a means for handling the command line options.
QByteArray unquotedLexem()
const Symbol & symbol() const
bool dontReplaceSymbol(const QByteArray &name) const
Q_DECLARE_TYPEINFO(EnumDef, Q_RELOCATABLE_TYPE)
QByteArray noRef(const QByteArray &type)
Q_DECLARE_TYPEINFO(PropertyDef, Q_RELOCATABLE_TYPE)
Q_DECLARE_TYPEINFO(NamespaceDef, Q_RELOCATABLE_TYPE)
Q_DECLARE_TYPEINFO(ClassDef, Q_RELOCATABLE_TYPE)
Q_DECLARE_TYPEINFO(ClassInfoDef, Q_RELOCATABLE_TYPE)
Q_DECLARE_TYPEINFO(ClassDef::Interface, Q_RELOCATABLE_TYPE)
Q_DECLARE_TYPEINFO(SuperClass, Q_RELOCATABLE_TYPE)
Q_DECLARE_TYPEINFO(ArgumentDef, Q_RELOCATABLE_TYPE)
Q_DECLARE_TYPEINFO(PrivateQPropertyDef, Q_RELOCATABLE_TYPE)
Q_DECLARE_TYPEINFO(Type, Q_RELOCATABLE_TYPE)
Q_DECLARE_TYPEINFO(FunctionDef, Q_RELOCATABLE_TYPE)
Combined button and popup list for selecting options.
QHash< MacroName, Macro > Macros
#define qPrintable(string)
static QByteArray combinePath(const QString &infile, const QString &outfile)
static bool hasNext(const Symbols &symbols, int i)
static const Symbol & next(const Symbols &symbols, int &i)
int runMoc(int argc, char **argv)
static auto openFileForWriting(const QString &name)
void error(const char *msg="Invalid argument")
static QStringList argumentsFromCommandLineAndFile(const QStringList &arguments, bool &hasOptionFiles)
QByteArray composePreprocessorOutput(const Symbols &symbols)
QByteArray normalizedType
QJsonObject toJson() const
QByteArray typeNameForCast
QMap< QByteArray, QByteArray > flagAliases
QList< ClassInfoDef > classInfoList
QList< EnumDef > enumList
Interface(const QByteArray &_className)
QMap< QString, QJsonArray > metaArgs
QList< QList< Interface > > interfaceList
QList< FunctionDef > publicList
QList< FunctionDef > methodList
QList< PropertyDef > propertyList
QList< FunctionDef > constructorList
QList< SuperClass > superclassList
bool requireCompleteMethodTypes
QList< FunctionDef > slotList
QList< FunctionDef > signalList
QJsonObject toJson() const
QList< QByteArray > nonClassSignalList
QFlags< QtMocConstants::EnumFlags > flags
QByteArray qualifiedType(const ClassDef *cdef) const
QJsonObject toJson(const ClassDef &cdef) const
QList< QByteArray > values
QByteArray normalizedType
QJsonObject toJson(int index) const
static void accessToJson(QJsonObject *obj, Access acs)
QByteArray inPrivateClass
QList< ArgumentDef > arguments
bool returnTypeIsVolatile
Simple structure used by the Doc and DocParser classes.
QByteArray inPrivateClass
QJsonObject toJson() const
bool operator==(const SubArray &other) const
SubArray(const QByteArray &a)
SubArray(const QByteArray &a, qsizetype from, qsizetype len)
FunctionDef::Access access
Symbol(int lineNum, Token token)
operator SubArray() const
bool operator==(const Symbol &o) const
Symbol(int lineNum, Token token, const QByteArray &lexem, qsizetype from, qsizetype len)
QByteArray unquotedLexem() const
Symbol(int lineNum, Token token, const QByteArray &lexem)
Type(const QByteArray &_name)
ReferenceType referenceType
size_t qHash(const SubArray &key, size_t seed=0)
Q_DECLARE_TYPEINFO(Symbol, Q_RELOCATABLE_TYPE)
Q_DECLARE_TYPEINFO(SafeSymbols, Q_RELOCATABLE_TYPE)
#define FOR_ALL_TOKENS(F)