Commit 520a5c9e authored by Roberto Raggi's avatar Roberto Raggi
Browse files

Put the preprocessor the CPlusPlus namespace

parent 358eceac
...@@ -107,7 +107,7 @@ static const char pp_configuration[] = ...@@ -107,7 +107,7 @@ static const char pp_configuration[] =
namespace CppTools { namespace CppTools {
namespace Internal { namespace Internal {
class CppPreprocessor: public rpp::Client class CppPreprocessor: public CPlusPlus::Client
{ {
public: public:
CppPreprocessor(QPointer<CppModelManager> modelManager); CppPreprocessor(QPointer<CppModelManager> modelManager);
...@@ -132,9 +132,9 @@ protected: ...@@ -132,9 +132,9 @@ protected:
virtual void macroAdded(const QByteArray &macroName, virtual void macroAdded(const QByteArray &macroName,
const QByteArray &macroText); const QByteArray &macroText);
virtual void startExpandingMacro(unsigned offset, virtual void startExpandingMacro(unsigned offset,
const rpp::Macro &macro, const Macro &macro,
const QByteArray &originalText); const QByteArray &originalText);
virtual void stopExpandingMacro(unsigned offset, const rpp::Macro &macro); virtual void stopExpandingMacro(unsigned offset, const Macro &macro);
virtual void startSkippingBlocks(unsigned offset); virtual void startSkippingBlocks(unsigned offset);
virtual void stopSkippingBlocks(unsigned offset); virtual void stopSkippingBlocks(unsigned offset);
virtual void sourceNeeded(QString &fileName, IncludeType type); virtual void sourceNeeded(QString &fileName, IncludeType type);
...@@ -142,8 +142,8 @@ protected: ...@@ -142,8 +142,8 @@ protected:
private: private:
QPointer<CppModelManager> m_modelManager; QPointer<CppModelManager> m_modelManager;
CppModelManager::DocumentTable m_documents; CppModelManager::DocumentTable m_documents;
rpp::Environment env; Environment env;
rpp::pp m_proc; pp m_proc;
QStringList m_includePaths; QStringList m_includePaths;
QStringList m_systemIncludePaths; QStringList m_systemIncludePaths;
QMap<QString, QByteArray> m_workingCopy; QMap<QString, QByteArray> m_workingCopy;
...@@ -304,7 +304,7 @@ void CppPreprocessor::macroAdded(const QByteArray &macroName, const QByteArray & ...@@ -304,7 +304,7 @@ void CppPreprocessor::macroAdded(const QByteArray &macroName, const QByteArray &
} }
void CppPreprocessor::startExpandingMacro(unsigned offset, void CppPreprocessor::startExpandingMacro(unsigned offset,
const rpp::Macro &, const Macro &,
const QByteArray &originalText) const QByteArray &originalText)
{ {
if (! m_currentDoc) if (! m_currentDoc)
...@@ -314,7 +314,7 @@ void CppPreprocessor::startExpandingMacro(unsigned offset, ...@@ -314,7 +314,7 @@ void CppPreprocessor::startExpandingMacro(unsigned offset,
m_currentDoc->addMacroUse(offset, originalText.length()); m_currentDoc->addMacroUse(offset, originalText.length());
} }
void CppPreprocessor::stopExpandingMacro(unsigned, const rpp::Macro &) void CppPreprocessor::stopExpandingMacro(unsigned, const Macro &)
{ {
if (! m_currentDoc) if (! m_currentDoc)
return; return;
......
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
#include <cctype> #include <cctype>
namespace rpp { namespace CPlusPlus {
inline bool pp_isalpha (int __ch) inline bool pp_isalpha (int __ch)
{ return std::isalpha ((unsigned char) __ch) != 0; } { return std::isalpha ((unsigned char) __ch) != 0; }
...@@ -69,6 +69,6 @@ inline bool pp_isdigit (int __ch) ...@@ -69,6 +69,6 @@ inline bool pp_isdigit (int __ch)
inline bool pp_isspace (int __ch) inline bool pp_isspace (int __ch)
{ return std::isspace ((unsigned char) __ch) != 0; } { return std::isspace ((unsigned char) __ch) != 0; }
} // namespace rpp } // namespace CPlusPlus
#endif // PP_CCTYPE_H #endif // PP_CCTYPE_H
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
#include <QString> #include <QString>
#include <QFile> #include <QFile>
namespace rpp { namespace CPlusPlus {
class Macro; class Macro;
...@@ -74,6 +74,6 @@ public: ...@@ -74,6 +74,6 @@ public:
virtual void stopSkippingBlocks(unsigned offset) = 0; virtual void stopSkippingBlocks(unsigned offset) = 0;
}; };
} // namespace rpp } // namespace CPlusPlus
#endif // PP_CLIENT_H #endif // PP_CLIENT_H
...@@ -57,7 +57,6 @@ ...@@ -57,7 +57,6 @@
#include <QtDebug> #include <QtDebug>
#include <algorithm> #include <algorithm>
using namespace rpp;
using namespace CPlusPlus; using namespace CPlusPlus;
namespace { namespace {
......
...@@ -62,7 +62,7 @@ namespace CPlusPlus { ...@@ -62,7 +62,7 @@ namespace CPlusPlus {
class Token; class Token;
} }
namespace rpp { namespace CPlusPlus {
struct Value struct Value
{ {
...@@ -200,7 +200,7 @@ namespace rpp { ...@@ -200,7 +200,7 @@ namespace rpp {
Value evalExpression(TokenIterator firstToken, Value evalExpression(TokenIterator firstToken,
TokenIterator lastToken, TokenIterator lastToken,
const QByteArray &source) const; const QByteArray &source) const;
QVector<CPlusPlus::Token> tokenize(const QByteArray &text) const; QVector<CPlusPlus::Token> tokenize(const QByteArray &text) const;
...@@ -226,6 +226,6 @@ namespace rpp { ...@@ -226,6 +226,6 @@ namespace rpp {
bool isQtReservedWord(const QByteArray &name) const; bool isQtReservedWord(const QByteArray &name) const;
}; };
} // namespace rpp } // namespace CPlusPlus
#endif // PP_ENGINE_H #endif // PP_ENGINE_H
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
#include "pp.h" #include "pp.h"
#include <cstring> #include <cstring>
using namespace rpp; using namespace CPlusPlus;
Environment::Environment () Environment::Environment ()
: currentLine(0), : currentLine(0),
......
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
#include <QVector> #include <QVector>
#include <QByteArray> #include <QByteArray>
namespace rpp { namespace CPlusPlus {
struct Macro; struct Macro;
...@@ -104,6 +104,6 @@ private: ...@@ -104,6 +104,6 @@ private:
int _hash_count; int _hash_count;
}; };
} // namespace rpp } // namespace CPlusPlus
#endif // PP_ENVIRONMENT_H #endif // PP_ENVIRONMENT_H
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
#include <QByteArray> #include <QByteArray>
namespace rpp { namespace CPlusPlus {
namespace _PP_internal { namespace _PP_internal {
inline bool comment_p (const char *__first, const char *__last) inline bool comment_p (const char *__first, const char *__last)
...@@ -73,6 +73,6 @@ inline bool comment_p (const char *__first, const char *__last) ...@@ -73,6 +73,6 @@ inline bool comment_p (const char *__first, const char *__last)
} }
} // _PP_internal } // _PP_internal
} // namespace rpp } // namespace CPlusPlus
#endif // PP_INTERNAL_H #endif // PP_INTERNAL_H
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
#include "pp-macro-expander.h" #include "pp-macro-expander.h"
#include <QDateTime> #include <QDateTime>
using namespace rpp; using namespace CPlusPlus;
MacroExpander::MacroExpander (Environment &env, pp_frame *frame) MacroExpander::MacroExpander (Environment &env, pp_frame *frame)
: env(env), frame(frame), : env(env), frame(frame),
......
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
#ifndef PP_MACRO_EXPANDER_H #ifndef PP_MACRO_EXPANDER_H
#define PP_MACRO_EXPANDER_H #define PP_MACRO_EXPANDER_H
namespace rpp { namespace CPlusPlus {
struct pp_frame struct pp_frame
{ {
...@@ -97,7 +97,7 @@ namespace rpp { ...@@ -97,7 +97,7 @@ namespace rpp {
int generated_lines; int generated_lines;
}; };
} // namespace rpp } // namespace CPlusPlus
#endif // PP_MACRO_EXPANDER_H #endif // PP_MACRO_EXPANDER_H
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
#include <QByteArray> #include <QByteArray>
#include <QVector> #include <QVector>
namespace rpp { namespace CPlusPlus {
struct Macro struct Macro
{ {
...@@ -90,6 +90,6 @@ namespace rpp { ...@@ -90,6 +90,6 @@ namespace rpp {
{ } { }
}; };
} // namespace rpp } // namespace CPlusPlus
#endif // PP_MACRO_H #endif // PP_MACRO_H
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
#ifndef PP_SCANNER_H #ifndef PP_SCANNER_H
#define PP_SCANNER_H #define PP_SCANNER_H
namespace rpp { namespace CPlusPlus {
struct pp_skip_blanks struct pp_skip_blanks
{ {
...@@ -373,7 +373,7 @@ struct pp_skip_argument ...@@ -373,7 +373,7 @@ struct pp_skip_argument
} }
}; };
} // namespace rpp } // namespace CPlusPlus
#endif // PP_SCANNER_H #endif // PP_SCANNER_H
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment