From fe836734a187a62c7b639ef87729c81d7996f264 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 5 Dec 2010 01:58:13 +0000 Subject: Remove cruft. git-svn-id: http://svn.drobilla.net/resp/resp@303 ad02d1e2-f140-0410-9f75-f8b11f17cedd --- src/resp.hpp | 34 ++++++++-------------------------- 1 file changed, 8 insertions(+), 26 deletions(-) (limited to 'src/resp.hpp') diff --git a/src/resp.hpp b/src/resp.hpp index 899f4fb..0c698a9 100644 --- a/src/resp.hpp +++ b/src/resp.hpp @@ -22,9 +22,6 @@ #ifndef RESP_HPP #define RESP_HPP -#include -#include -#include #include #include #include @@ -33,6 +30,11 @@ #include #include #include + +#include +#include +#include + #include #define FOREACH(IT, i, c) for (IT i = (c).begin(); i != (c).end(); ++i) @@ -213,43 +215,23 @@ struct AST : public Object { bool operator==(const AST& o) const; string str() const { ostringstream ss; ss << this; return ss.str(); } - ATuple* as_tuple() { - assert(tag() == T_TUPLE || tag() == T_TYPE); - return (ATuple*)this; - } const ATuple* as_tuple() const { assert(tag() == T_TUPLE || tag() == T_TYPE); return (ATuple*)this; } - ATuple* to_tuple() { - if (tag() == T_TUPLE || tag() == T_TYPE) - return (ATuple*)this; - return NULL; - } const ATuple* to_tuple() const { if (tag() == T_TUPLE || tag() == T_TYPE) return (const ATuple*)this; return NULL; } - template - T* as_a(Tag t) { - assert(tag() == t); - return (T*)this; - } template T* as_a(Tag t) const { assert(tag() == t); return (T*)this; } - template - T* to_a(Tag t) { - if (tag() == t) - return (T*)this; - return NULL; - } template T* to_a(Tag t) const { if (tag() == t) @@ -747,9 +729,9 @@ struct Engine { virtual CVal compileLiteral(CEnv& cenv, const AST* lit) = 0; virtual CVal compileString(CEnv& cenv, const char* str) = 0; virtual CVal compileCall(CEnv& cenv, CFunc f, const AType* fT, ValVec& args) = 0; - virtual CVal compilePrimitive(CEnv& cenv, const ATuple* prim) = 0; - virtual CVal compileIf(CEnv& cenv, const ATuple* aif) = 0; - virtual CVal compileMatch(CEnv& cenv, const ATuple* match) = 0; + virtual CVal compilePrimitive(CEnv& cenv, const ATuple* prim) = 0; + virtual CVal compileIf(CEnv& cenv, const ATuple* aif) = 0; + virtual CVal compileMatch(CEnv& cenv, const ATuple* match) = 0; virtual CVal compileGlobal(CEnv& cenv, const AType* t, const string& sym, CVal val) = 0; virtual CVal getGlobal(CEnv& cenv, const string& sym, CVal val) = 0; virtual void writeModule(CEnv& cenv, std::ostream& os) = 0; -- cgit v1.2.1