git-svn-id: svn://ultimatepp.org/upp/trunk@8159 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2015-02-09 18:22:27 +00:00
parent d91bdd45d9
commit ca1913c579
5 changed files with 181 additions and 104 deletions

View file

@ -3,30 +3,52 @@
#include <Core/Core.h>
#include <CppBase/CppBase.h>
using namespace Upp;
struct CppMacro : Moveable<CppMacro> {
String body;
Index<String> param;
bool variadic;
bool flag; // used when expanding macros to mark those use; MT incompatible (!)
String Expand(const Vector<String>& p);
String Expand(const Vector<String>& p) const;
String ToString() const;
CppMacro() { flag = variadic = false; }
CppMacro() { variadic = false; }
};
struct CppMacroRecord {
Time last_write;
VectorMap<String, CppMacro> macro;
Index<String> includes;
CppMacroRecord() { last_write = Time::Low(); }
};
const VectorMap<String, CppMacro> *GetFileMacros(const String& filepath);
struct Cpp {
bool incomment;
VectorMap<String, CppMacro> macro;
String filedir;
String include_path;
int level;
VectorMap<String, CppMacro> used_macro;
Index<String> not_macro;
Index<String> header;
VectorMap<String, CppMacro> macro0;
VectorMap<String, CppMacro> macro;
Index<String> notmacro;
Index<String> usedmacro;
void SyncSet();
Vector<const VectorMap<String, CppMacro> *> macro_set;
void Define(const char *s);
String Define(const char *s);
static const char *SkipString(const char *s);
void ParamAdd(Vector<String>& param, const char *b, const char *e);
@ -35,7 +57,10 @@ struct Cpp {
void Include(const char *s);
String GetIncludePath(const char *s);
String Preprocess(Stream& in, bool needresult = true);
String Do(Stream& in, Index<String>& header);
};
String Preprocess(const String& filename, const String& include_path);
#endif