mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-07-29 06:06:54 -06:00
.uppdev
git-svn-id: svn://ultimatepp.org/upp/trunk@8159 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
d91bdd45d9
commit
ca1913c579
5 changed files with 181 additions and 104 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue