diff options
author | David Robillard <d@drobilla.net> | 2010-12-05 01:58:13 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2010-12-05 01:58:13 +0000 |
commit | fe836734a187a62c7b639ef87729c81d7996f264 (patch) | |
tree | 344c71f10021b531513086757d32464d45e6eddc | |
parent | dd85fe8106ff2315c8ae46cba4f4ae81560da178 (diff) | |
download | resp-fe836734a187a62c7b639ef87729c81d7996f264.tar.gz resp-fe836734a187a62c7b639ef87729c81d7996f264.tar.bz2 resp-fe836734a187a62c7b639ef87729c81d7996f264.zip |
Remove cruft.
git-svn-id: http://svn.drobilla.net/resp/resp@303 ad02d1e2-f140-0410-9f75-f8b11f17cedd
-rw-r--r-- | src/resp.hpp | 34 |
1 files changed, 8 insertions, 26 deletions
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 <stdarg.h> -#include <stdint.h> -#include <string.h> #include <iostream> #include <list> #include <map> @@ -33,6 +30,11 @@ #include <stack> #include <string> #include <vector> + +#include <stdarg.h> +#include <stdint.h> +#include <string.h> + #include <boost/format.hpp> #define FOREACH(IT, i, c) for (IT i = (c).begin(); i != (c).end(); ++i) @@ -213,20 +215,11 @@ 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; @@ -234,23 +227,12 @@ struct AST : public Object { } template<typename T> - T* as_a(Tag t) { - assert(tag() == t); - return (T*)this; - } - template<typename T> T* as_a(Tag t) const { assert(tag() == t); return (T*)this; } template<typename T> - T* to_a(Tag t) { - if (tag() == t) - return (T*)this; - return NULL; - } - template<typename T> T* to_a(Tag t) const { if (tag() == t) return (T*)this; @@ -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; |