Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
preprocessor.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
3
4#ifndef PREPROCESSOR_H
5#define PREPROCESSOR_H
6
7#include "parser.h"
8#include <qlist.h>
9#include <qset.h>
10#include <stdio.h>
11
13
22
24typedef QHash<MacroName, Macro> Macros;
25
26class QFile;
27
28class Preprocessor : public Parser
29{
30public:
32 static bool preprocessOnly;
33 QList<QByteArray> frameworks;
34 QSet<QByteArray> preprocessedIncludes;
35 QHash<QByteArray, QByteArray> nonlocalIncludePathResolutionCache;
37 QByteArray resolveInclude(const QByteArray &filename, const QByteArray &relativeTo);
38 Symbols preprocessed(const QByteArray &filename, QFile *device);
39
41
42 void skipUntilEndif();
43 bool skipBranch();
44
45 void substituteUntilNewline(Symbols &substituted);
46 static Symbols macroExpandIdentifier(Preprocessor *that, SymbolStack &symbols, int lineNum, QByteArray *macroName);
47 static void macroExpand(Symbols *into, Preprocessor *that, const Symbols &toExpand,
48 qsizetype &index, int lineNum, bool one,
49 const QSet<QByteArray> &excludeSymbols = QSet<QByteArray>());
50
52
54 static Symbols tokenize(const QByteArray &input, int lineNum = 1, TokenizeMode mode = TokenizeCpp);
55
56 void setDebugIncludes(bool value);
57
58private:
59 void until(Token);
60
61 void preprocess(const QByteArray &filename, Symbols &preprocessed);
62 bool debugIncludes = false;
63};
64
66
67#endif // PREPROCESSOR_H
IOBluetoothDevice * device
Symbols symbols
Definition parser.h:18
int evaluateCondition()
QSet< QByteArray > preprocessedIncludes
void setDebugIncludes(bool value)
void parseDefineArguments(Macro *m)
void skipUntilEndif()
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
\inmodule QtCore
Definition qbytearray.h:57
\inmodule QtCore
Definition qfile.h:93
Combined button and popup list for selecting options.
QHash< MacroName, Macro > Macros
SubArray MacroName
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
GLenum mode
const GLfloat * m
GLuint index
[2]
GLenum GLenum GLenum input
ptrdiff_t qsizetype
Definition qtypes.h:165
Symbols symbols
bool isVariadic
bool isFunction
Symbols arguments