forked from qt-creator/qt-creator
[C++] Rewrite of the preprocessor.
This rewrite fixes a couple of issues with the pre-processor. It now supports: - macros in macro bodies - stringification of parameters [cpp.stringize] - the concatenation operator [cpp.concat] - #include MACRO_HERE - defined() inside macro bodies used in pp-conditions. Change-Id: Ifdb78041fb6afadf44f939a4bd66ce2832b8601f Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
This commit is contained in:
@@ -53,6 +53,7 @@
|
||||
#define CPLUSPLUS_PP_ENVIRONMENT_H
|
||||
|
||||
#include "CPlusPlusForwardDeclarations.h"
|
||||
#include "PPToken.h"
|
||||
|
||||
#include <QList>
|
||||
#include <QByteArray>
|
||||
@@ -78,6 +79,7 @@ public:
|
||||
Macro *remove(const QByteArray &name);
|
||||
|
||||
Macro *resolve(const QByteArray &name) const;
|
||||
Macro *resolve(const Internal::ByteArrayRef &name) const;
|
||||
|
||||
iterator firstMacro() const;
|
||||
iterator lastMacro() const;
|
||||
@@ -85,10 +87,11 @@ public:
|
||||
void reset();
|
||||
void addMacros(const QList<Macro> ¯os);
|
||||
|
||||
static bool isBuiltinMacro(const QByteArray &name);
|
||||
static bool isBuiltinMacro(const Internal::ByteArrayRef &name);
|
||||
|
||||
private:
|
||||
static unsigned hashCode(const QByteArray &s);
|
||||
static unsigned hashCode(const Internal::ByteArrayRef &s);
|
||||
void rehash();
|
||||
|
||||
public:
|
||||
|
||||
Reference in New Issue
Block a user