Qt 6.x
The Qt SDK
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
14struct Macro
15{
21};
22
23#ifdef USE_LEXEM_STORE
24typedef QByteArray MacroName;
25#else
27#endif
29
30class QFile;
31
32class Preprocessor : public Parser
33{
34public:
36 static bool preprocessOnly;
41 QByteArray resolveInclude(const QByteArray &filename, const QByteArray &relativeTo);
42 Symbols preprocessed(const QByteArray &filename, QFile *device);
43
45
46 void skipUntilEndif();
47 bool skipBranch();
48
49 void substituteUntilNewline(Symbols &substituted);
50 static Symbols macroExpandIdentifier(Preprocessor *that, SymbolStack &symbols, int lineNum, QByteArray *macroName);
51 static void macroExpand(Symbols *into, Preprocessor *that, const Symbols &toExpand,
52 qsizetype &index, int lineNum, bool one,
53 const QSet<QByteArray> &excludeSymbols = QSet<QByteArray>());
54
56
58 static Symbols tokenize(const QByteArray &input, int lineNum = 1, TokenizeMode mode = TokenizeCpp);
59
60 void setDebugIncludes(bool value);
61
62private:
63 void until(Token);
64
65 void preprocess(const QByteArray &filename, Symbols &preprocessed);
66 bool debugIncludes = false;
67};
68
70
71#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
\inmodule QtCore
Definition qhash.h:818
Definition qset.h:18
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:70
Symbols symbols
bool isVariadic
bool isFunction
Symbols arguments
Token
Definition token.h:194