From 41c9834662fdccfc8ae8abde2d279a70ff17c597 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 8 Dec 2010 20:36:16 +0000 Subject: Remove Engine::compileIf git-svn-id: http://svn.drobilla.net/resp/resp@316 ad02d1e2-f140-0410-9f75-f8b11f17cedd --- src/resp.hpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/resp.hpp') diff --git a/src/resp.hpp b/src/resp.hpp index 593205d..7dc9f16 100644 --- a/src/resp.hpp +++ b/src/resp.hpp @@ -694,6 +694,8 @@ Subst unify(const Constraints& c); * Code Generation * ***************************************************************************/ +typedef void* IfState; + /// Compiler backend struct Engine { virtual ~Engine() {} @@ -719,11 +721,14 @@ struct Engine { 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 compileGlobal(CEnv& cenv, const AType* t, const string& sym, CVal val) = 0; virtual CVal compileGlobalGet(CEnv& cenv, const string& sym, CVal val) = 0; - + + virtual IfState compileIfStart(CEnv& cenv) = 0; + virtual void compileIfBranch(CEnv& cenv, IfState state, CVal condV, const AST* then) = 0; + virtual CVal compileIfEnd(CEnv& cenv, IfState state, CVal elseV, const AType* type) = 0; + virtual void writeModule(CEnv& cenv, std::ostream& os) = 0; virtual const string call(CEnv& cenv, CFunc f, const AType* retT) = 0; -- cgit v1.2.1